Skip to content

Commit

Permalink
fix: extends Props from svelte SVGAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
shinokada committed Jul 17, 2024
1 parent 7a0bcfc commit 3448d91
Show file tree
Hide file tree
Showing 555 changed files with 13,715 additions and 27,403 deletions.
5 changes: 5 additions & 0 deletions .changeset/clean-cougars-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'flowbite-svelte-icons': patch
---

fix: extends Props from svelte SVGAttributes
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
"publint": "^0.2.8",
"runatics": "^0.1.3",
"runes-meta-tags": "^0.3.2",
"runes-webkit": "^0.8.6",
"svelte": "5.0.0-next.178",
"svelte-5-ui-lib": "^0.6.1",
"runes-webkit": "^0.9.7",
"svelte": "5.0.0-next.188",
"svelte-5-ui-lib": "^0.7.1",
"svelte-check": "^3.8.4",
"svelte-lib-helpers": "^0.4.6",
"svelte-preprocess": "^6.0.2",
Expand Down
343 changes: 171 additions & 172 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

82 changes: 28 additions & 54 deletions src/lib/AddressBookOutline.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@
desc?: string;
};
interface BaseProps extends SVGAttributes<SVGElement>{
size?: "xs" | "sm" | "md" | "lg" | "xl";
interface BaseProps extends SVGAttributes<SVGElement> {
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
color?: string | undefined | null;
strokeWidth?: string;
withEvents?: boolean;
class?: string | undefined | null;
strokeWidth?: string | undefined | null;
class?: string | undefined | null;
}
interface CtxType extends BaseProps {}
interface Props extends BaseProps{
interface Props extends BaseProps {
title?: TitleType;
desc?: DescType;
ariaLabel?: string;
size?: "xs" | "sm" | "md" | "lg" | "xl";
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
}
const ctx: CtxType = getContext('iconCtx') ?? {};
Expand All @@ -37,33 +36,27 @@ strokeWidth?: string;
xl: 'w-8 h-8'
};
let {
size = ctx.size || 'md',
color = ctx.color || 'currentColor',
withEvents = ctx.withEvents || false,
title,
strokeWidth= ctx.strokeWidth || "2",
desc,
class: className,
ariaLabel = "address book outline" ,
...restProps
}: Props = $props();
let {
size = ctx.size || 'md',
color = ctx.color || 'currentColor',
title,
strokeWidth = ctx.strokeWidth || '2',
desc,
class: className,
ariaLabel = 'address book outline',
...restProps
}: Props = $props();
let ariaDescribedby = `${title?.id || ''} ${desc?.id || ''}`;
const hasDescription = $derived(!!(title?.id || desc?.id));
</script>

{#if withEvents}
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
{color}
{...restProps}
class={twMerge(
'shrink-0',
sizes[size],
className
)}
{color}
{...restProps}
class={twMerge('shrink-0', sizes[size], className)}
aria-label={ariaLabel}
aria-describedby={hasDescription ? ariaDescribedby : undefined}
viewBox="0 0 24 24"
Expand All @@ -74,44 +67,25 @@ strokeWidth= ctx.strokeWidth || "2",
{#if desc?.id && desc.desc}
<desc id={desc.id}>{desc.desc}</desc>
{/if}
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width={strokeWidth} d="M7 6H5m2 3H5m2 3H5m2 3H5m2 3H5m11-1a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2M7 3h11a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm8 7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"/>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width={strokeWidth}
d="M7 6H5m2 3H5m2 3H5m2 3H5m2 3H5m11-1a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2M7 3h11a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm8 7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"
/>
</svg>
{:else}
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
{color}
{...restProps}
class={twMerge(
'shrink-0',
sizes[size],
className
)}
aria-label={ariaLabel}
aria-describedby={hasDescription ? ariaDescribedby : undefined}
viewBox="0 0 24 24"
>
{#if title?.id && title.title}
<title id={title.id}>{title.title}</title>
{/if}
{#if desc?.id && desc.desc}
<desc id={desc.id}>{desc.desc}</desc>
{/if}
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width={strokeWidth} d="M7 6H5m2 3H5m2 3H5m2 3H5m2 3H5m11-1a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2M7 3h11a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm8 7a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"/>
</svg>
{/if}

<!--
@component
[Go to docs](https://flowbite-svelte-icons.codewithshin.com/)
## Props
@prop size = ctx.size || 'md'
@prop color = ctx.color || 'currentColor'
@prop withEvents = ctx.withEvents || false
@prop title
@prop strokeWidth= ctx.strokeWidth || "2"
@prop strokeWidth = ctx.strokeWidth || '2'
@prop desc
@prop class: className
@prop ariaLabel = "address book outline"
@prop ariaLabel = 'address book outline'
@prop ...restProps
-->
71 changes: 22 additions & 49 deletions src/lib/AddressBookSolid.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@
desc?: string;
};
interface BaseProps extends SVGAttributes<SVGElement>{
size?: "xs" | "sm" | "md" | "lg" | "xl";
interface BaseProps extends SVGAttributes<SVGElement> {
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
color?: string | undefined | null;
withEvents?: boolean;
class?: string | undefined | null;
class?: string | undefined | null;
}
interface CtxType extends BaseProps {}
interface Props extends BaseProps{
interface Props extends BaseProps {
title?: TitleType;
desc?: DescType;
ariaLabel?: string;
size?: "xs" | "sm" | "md" | "lg" | "xl";
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
}
const ctx: CtxType = getContext('iconCtx') ?? {};
Expand All @@ -36,31 +35,25 @@
xl: 'w-8 h-8'
};
let {
size = ctx.size || 'md',
color = ctx.color || 'currentColor',
withEvents = ctx.withEvents || false,
title,
desc,
class: className,
ariaLabel = "address book outline" ,
...restProps
}: Props = $props();
let {
size = ctx.size || 'md',
color = ctx.color || 'currentColor',
title,
desc,
class: className,
ariaLabel = 'address book outline',
...restProps
}: Props = $props();
let ariaDescribedby = `${title?.id || ''} ${desc?.id || ''}`;
const hasDescription = $derived(!!(title?.id || desc?.id));
</script>

{#if withEvents}
<svg
xmlns="http://www.w3.org/2000/svg"
fill={color}
{...restProps}
class={twMerge(
'shrink-0',
sizes[size],
className
)}
{...restProps}
class={twMerge('shrink-0', sizes[size], className)}
aria-label={ariaLabel}
aria-describedby={hasDescription ? ariaDescribedby : undefined}
viewBox="0 0 24 24"
Expand All @@ -71,42 +64,22 @@
{#if desc?.id && desc.desc}
<desc id={desc.id}>{desc.desc}</desc>
{/if}
<path fill-rule="evenodd" d="M7 2a2 2 0 0 0-2 2v1a1 1 0 0 0 0 2v1a1 1 0 0 0 0 2v1a1 1 0 1 0 0 2v1a1 1 0 1 0 0 2v1a1 1 0 1 0 0 2v1a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H7Zm3 8a3 3 0 1 1 6 0 3 3 0 0 1-6 0Zm-1 7a3 3 0 0 1 3-3h2a3 3 0 0 1 3 3 1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1Z" clip-rule="evenodd"/>
<path
fill-rule="evenodd"
d="M7 2a2 2 0 0 0-2 2v1a1 1 0 0 0 0 2v1a1 1 0 0 0 0 2v1a1 1 0 1 0 0 2v1a1 1 0 1 0 0 2v1a1 1 0 1 0 0 2v1a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H7Zm3 8a3 3 0 1 1 6 0 3 3 0 0 1-6 0Zm-1 7a3 3 0 0 1 3-3h2a3 3 0 0 1 3 3 1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1Z"
clip-rule="evenodd"
/>
</svg>
{:else}
<svg
xmlns="http://www.w3.org/2000/svg"
fill={color}
{...restProps}
class={twMerge(
'shrink-0',
sizes[size],
className
)}
aria-label={ariaLabel}
aria-describedby={hasDescription ? ariaDescribedby : undefined}
viewBox="0 0 24 24"
>
{#if title?.id && title.title}
<title id={title.id}>{title.title}</title>
{/if}
{#if desc?.id && desc.desc}
<desc id={desc.id}>{desc.desc}</desc>
{/if}
<path fill-rule="evenodd" d="M7 2a2 2 0 0 0-2 2v1a1 1 0 0 0 0 2v1a1 1 0 0 0 0 2v1a1 1 0 1 0 0 2v1a1 1 0 1 0 0 2v1a1 1 0 1 0 0 2v1a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H7Zm3 8a3 3 0 1 1 6 0 3 3 0 0 1-6 0Zm-1 7a3 3 0 0 1 3-3h2a3 3 0 0 1 3 3 1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1Z" clip-rule="evenodd"/>
</svg>
{/if}

<!--
@component
[Go to docs](https://flowbite-svelte-icons.codewithshin.com/)
## Props
@prop size = ctx.size || 'md'
@prop color = ctx.color || 'currentColor'
@prop withEvents = ctx.withEvents || false
@prop title
@prop desc
@prop class: className
@prop ariaLabel = "address book outline"
@prop ariaLabel = 'address book outline'
@prop ...restProps
-->
81 changes: 27 additions & 54 deletions src/lib/AdjustmentsHorizontalOutline.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@
desc?: string;
};
interface BaseProps extends SVGAttributes<SVGElement>{
size?: "xs" | "sm" | "md" | "lg" | "xl";
interface BaseProps extends SVGAttributes<SVGElement> {
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
color?: string | undefined | null;
strokeWidth?: string;
withEvents?: boolean;
class?: string | undefined | null;
strokeWidth?: string | undefined | null;
class?: string | undefined | null;
}
interface CtxType extends BaseProps {}
interface Props extends BaseProps{
interface Props extends BaseProps {
title?: TitleType;
desc?: DescType;
ariaLabel?: string;
size?: "xs" | "sm" | "md" | "lg" | "xl";
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
}
const ctx: CtxType = getContext('iconCtx') ?? {};
Expand All @@ -37,33 +36,27 @@ strokeWidth?: string;
xl: 'w-8 h-8'
};
let {
size = ctx.size || 'md',
color = ctx.color || 'currentColor',
withEvents = ctx.withEvents || false,
title,
strokeWidth= ctx.strokeWidth || "2",
desc,
class: className,
ariaLabel = "address book outline" ,
...restProps
}: Props = $props();
let {
size = ctx.size || 'md',
color = ctx.color || 'currentColor',
title,
strokeWidth = ctx.strokeWidth || '2',
desc,
class: className,
ariaLabel = 'address book outline',
...restProps
}: Props = $props();
let ariaDescribedby = `${title?.id || ''} ${desc?.id || ''}`;
const hasDescription = $derived(!!(title?.id || desc?.id));
</script>

{#if withEvents}
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
{color}
{...restProps}
class={twMerge(
'shrink-0',
sizes[size],
className
)}
{color}
{...restProps}
class={twMerge('shrink-0', sizes[size], className)}
aria-label={ariaLabel}
aria-describedby={hasDescription ? ariaDescribedby : undefined}
viewBox="0 0 24 24"
Expand All @@ -74,44 +67,24 @@ strokeWidth= ctx.strokeWidth || "2",
{#if desc?.id && desc.desc}
<desc id={desc.id}>{desc.desc}</desc>
{/if}
<path stroke="currentColor" stroke-linecap="round" stroke-width={strokeWidth} d="M20 6H10m0 0a2 2 0 1 0-4 0m4 0a2 2 0 1 1-4 0m0 0H4m16 6h-2m0 0a2 2 0 1 0-4 0m4 0a2 2 0 1 1-4 0m0 0H4m16 6H10m0 0a2 2 0 1 0-4 0m4 0a2 2 0 1 1-4 0m0 0H4"/>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-width={strokeWidth}
d="M20 6H10m0 0a2 2 0 1 0-4 0m4 0a2 2 0 1 1-4 0m0 0H4m16 6h-2m0 0a2 2 0 1 0-4 0m4 0a2 2 0 1 1-4 0m0 0H4m16 6H10m0 0a2 2 0 1 0-4 0m4 0a2 2 0 1 1-4 0m0 0H4"
/>
</svg>
{:else}
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
{color}
{...restProps}
class={twMerge(
'shrink-0',
sizes[size],
className
)}
aria-label={ariaLabel}
aria-describedby={hasDescription ? ariaDescribedby : undefined}
viewBox="0 0 24 24"
>
{#if title?.id && title.title}
<title id={title.id}>{title.title}</title>
{/if}
{#if desc?.id && desc.desc}
<desc id={desc.id}>{desc.desc}</desc>
{/if}
<path stroke="currentColor" stroke-linecap="round" stroke-width={strokeWidth} d="M20 6H10m0 0a2 2 0 1 0-4 0m4 0a2 2 0 1 1-4 0m0 0H4m16 6h-2m0 0a2 2 0 1 0-4 0m4 0a2 2 0 1 1-4 0m0 0H4m16 6H10m0 0a2 2 0 1 0-4 0m4 0a2 2 0 1 1-4 0m0 0H4"/>
</svg>
{/if}

<!--
@component
[Go to docs](https://flowbite-svelte-icons.codewithshin.com/)
## Props
@prop size = ctx.size || 'md'
@prop color = ctx.color || 'currentColor'
@prop withEvents = ctx.withEvents || false
@prop title
@prop strokeWidth= ctx.strokeWidth || "2"
@prop strokeWidth = ctx.strokeWidth || '2'
@prop desc
@prop class: className
@prop ariaLabel = "address book outline"
@prop ariaLabel = 'address book outline'
@prop ...restProps
-->
Loading

0 comments on commit 3448d91

Please sign in to comment.