Skip to content

Commit

Permalink
fix(lucide-svelte): update IconProps to include all properties of Ico…
Browse files Browse the repository at this point in the history
…n component (#2182)

* fix(lucide-svelte): update IconProps to include all properties of Icon component

* fix(lucide-svelte): removed custom Icon type that conflicted with Icon component type

---------

Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
  • Loading branch information
garrettpauls and ericfennis authored Jun 12, 2024
1 parent f507644 commit 904d74f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/lucide-svelte/src/Icon.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
export let size: number | string = 24
export let strokeWidth: number | string = 2
export let absoluteStrokeWidth: boolean = false
export let iconNode: IconNode
export let iconNode: IconNode = []
const mergeClasses = <ClassType = string | undefined | null>(
...classes: ClassType[]
Expand Down
5 changes: 2 additions & 3 deletions packages/lucide-svelte/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import type { SvelteComponent } from 'svelte';
import type { SVGAttributes, SvelteHTMLElements } from 'svelte/elements';

export type Attrs = SVGAttributes<SVGSVGElement>;

export type IconNode = [elementName: keyof SvelteHTMLElements, attrs: Attrs][];

export interface IconProps extends Attrs {
name?: string;
color?: string;
size?: number | string;
strokeWidth?: number | string;
absoluteStrokeWidth?: boolean;
class?: string;
iconNode?: IconNode;
}

export type IconEvents = {
Expand All @@ -20,5 +21,3 @@ export type IconEvents = {
export type IconSlots = {
default: {};
};

export type Icon = SvelteComponent<IconProps, IconEvents, IconSlots>;

0 comments on commit 904d74f

Please sign in to comment.