diff --git a/packages/lucide-preact/package.json b/packages/lucide-preact/package.json index 0c47e4ed2..57d45a8ac 100644 --- a/packages/lucide-preact/package.json +++ b/packages/lucide-preact/package.json @@ -58,4 +58,4 @@ "peerDependencies": { "preact": "^10.27.2" } -} \ No newline at end of file +} diff --git a/packages/lucide-preact/src/context.tsx b/packages/lucide-preact/src/context.tsx index ddff4f11f..098104383 100644 --- a/packages/lucide-preact/src/context.tsx +++ b/packages/lucide-preact/src/context.tsx @@ -30,7 +30,7 @@ export function LucideProvider({ color, strokeWidth, absoluteStrokeWidth, - class: className + class: className, }: LucideProviderProps) { const value = useMemo( () => ({ diff --git a/packages/lucide-preact/tests/context.spec.tsx b/packages/lucide-preact/tests/context.spec.tsx index cc9979cd6..539dda1d8 100644 --- a/packages/lucide-preact/tests/context.spec.tsx +++ b/packages/lucide-preact/tests/context.spec.tsx @@ -76,9 +76,7 @@ describe('Using LucideProvider', () => { it('should merge class names from LucideProvider and icon props', () => { const { container } = render( - + , ); diff --git a/packages/lucide-solid/src/context.tsx b/packages/lucide-solid/src/context.tsx index 6e9e5859d..709de0cc9 100644 --- a/packages/lucide-solid/src/context.tsx +++ b/packages/lucide-solid/src/context.tsx @@ -24,7 +24,13 @@ interface LucideProviderProps { } export function LucideProvider(props: LucideProviderProps) { - const [value, rest] = splitProps(props, ['size', 'color', 'strokeWidth', 'absoluteStrokeWidth', 'class']); + const [value, rest] = splitProps(props, [ + 'size', + 'color', + 'strokeWidth', + 'absoluteStrokeWidth', + 'class', + ]); return {rest.children}; } diff --git a/packages/lucide-solid/tests/context.spec.tsx b/packages/lucide-solid/tests/context.spec.tsx index e713318bb..6ae047a6d 100644 --- a/packages/lucide-solid/tests/context.spec.tsx +++ b/packages/lucide-solid/tests/context.spec.tsx @@ -47,53 +47,56 @@ describe('Using LucideProvider', () => { }); it('should render the icon with LucideProvider and custom absoluteStrokeWidth', () => { - const { container } = render(() => - ( - - ), - ); + const { container } = render(() => ( + + + + )); - const IconComponent = container.firstElementChild; + const IconComponent = container.firstElementChild; - expect(IconComponent).toHaveAttribute('stroke-width', '1'); - }); + expect(IconComponent).toHaveAttribute('stroke-width', '1'); + }); - it("should override the provider's global props when passing props to the icon", () => { - const { container } = render( - () => ( - - ), - ); + it("should override the provider's global props when passing props to the icon", () => { + const { container } = render(() => ( + + + + )); - const IconComponent = container.firstElementChild; + const IconComponent = container.firstElementChild; - expect(IconComponent).toHaveAttribute('width', '24'); - expect(IconComponent).toHaveAttribute('height', '24'); - expect(IconComponent).toHaveAttribute('stroke', 'blue'); - expect(IconComponent).toHaveAttribute('stroke-width', '2'); - }); + expect(IconComponent).toHaveAttribute('width', '24'); + expect(IconComponent).toHaveAttribute('height', '24'); + expect(IconComponent).toHaveAttribute('stroke', 'blue'); + expect(IconComponent).toHaveAttribute('stroke-width', '2'); + }); - it('should merge className from provider and icon', () => { - const { container } = render(() => ( - - - ) - ); + it('should merge className from provider and icon', () => { + const { container } = render(() => ( + + + + )); - const IconComponent = container.firstElementChild; + const IconComponent = container.firstElementChild; - expect(IconComponent).toHaveAttribute('class', 'lucide lucide-icon provider-class lucide-house icon-class'); - }); + expect(IconComponent).toHaveAttribute( + 'class', + 'lucide lucide-icon provider-class lucide-house icon-class', + ); + }); });