Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/lucide-icons/lucide into si…
Browse files Browse the repository at this point in the history
…te-update
  • Loading branch information
ericfennis committed Nov 27, 2023
2 parents ccda5f6 + 1a09e7f commit 12a8a45
Show file tree
Hide file tree
Showing 51 changed files with 2,498 additions and 624 deletions.
3 changes: 3 additions & 0 deletions icons/user-square.json → icons/circle-user-round.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"categories": [
"account",
"shapes"
],
"aliases": [
"user-circle-2"
]
}
File renamed without changes
5 changes: 4 additions & 1 deletion icons/user-square-2.json → icons/circle-user.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"categories": [
"account",
"shapes"
],
"aliases": [
"user-circle"
]
}
}
File renamed without changes
3 changes: 3 additions & 0 deletions icons/user-circle-2.json → icons/square-user-round.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"categories": [
"account",
"shapes"
],
"aliases": [
"user-square-2"
]
}
File renamed without changes
5 changes: 4 additions & 1 deletion icons/user-circle.json → icons/square-user.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"categories": [
"account",
"shapes"
],
"aliases": [
"user-square"
]
}
}
File renamed without changes
23 changes: 0 additions & 23 deletions icons/user-cog-2.svg

This file was deleted.

16 changes: 0 additions & 16 deletions icons/user-plus-2.svg

This file was deleted.

3 changes: 3 additions & 0 deletions icons/user-check-2.json → icons/user-round-check.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
],
"categories": [
"account"
],
"aliases": [
"user-check-2"
]
}
6 changes: 3 additions & 3 deletions icons/user-check-2.svg → icons/user-round-check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions icons/user-cog-2.json → icons/user-round-cog.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
],
"categories": [
"account"
],
"aliases": [
"user-cog-2"
]
}
23 changes: 23 additions & 0 deletions icons/user-round-cog.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions icons/user-minus-2.json → icons/user-round-minus.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
],
"categories": [
"account"
],
"aliases": [
"user-minus-2"
]
}
6 changes: 3 additions & 3 deletions icons/user-minus-2.svg → icons/user-round-minus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions icons/user-plus-2.json → icons/user-round-plus.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
],
"categories": [
"account"
],
"aliases": [
"user-plus-2"
]
}
7 changes: 4 additions & 3 deletions icons/users-2.svg → icons/user-round-plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions icons/user-x-2.json → icons/user-round-x.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
],
"categories": [
"account"
],
"aliases": [
"user-x-2"
]
}
16 changes: 16 additions & 0 deletions icons/user-round-x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions icons/user-2.json → icons/user-round.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
],
"categories": [
"account"
],
"aliases": [
"user-2"
]
}
2 changes: 1 addition & 1 deletion icons/user-2.svg → icons/user-round.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 0 additions & 16 deletions icons/user-x-2.svg

This file was deleted.

3 changes: 3 additions & 0 deletions icons/users-2.json → icons/users-round.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@
],
"categories": [
"account"
],
"aliases": [
"users-2"
]
}
15 changes: 15 additions & 0 deletions icons/users-round.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ describe('LucideAngularComponent', () => {
expect(testHostComponent).toBeTruthy();
});

it('should add all classes', () => {
testHostFixture.detectChanges();

expect(getSvgAttribute('class')).toBe('lucide lucide-demo my-icon');
});

it('should set color', () => {
const color = 'red';
testHostComponent.setColor(color);
Expand Down Expand Up @@ -65,6 +71,7 @@ describe('LucideAngularComponent', () => {
selector: 'lucide-spec-host-component',
template: ` <i-lucide
name="demo"
class="my-icon"
[color]="color"
[size]="size"
[strokeWidth]="strokeWidth"
Expand Down
16 changes: 8 additions & 8 deletions packages/lucide-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@
"version": "pnpm version --git-tag-version=false"
},
"devDependencies": {
"@lucide/rollup-plugins": "workspace:*",
"@lucide/build-icons": "workspace:*",
"@preact/preset-vite": "^2.4.0",
"@testing-library/jest-dom": "^5.16.5",
"@lucide/rollup-plugins": "workspace:*",
"@preact/preset-vite": "^2.7.0",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/preact": "^2.0.1",
"preact": "^10.11.2",
"rollup": "^3.5.1",
"typescript": "^4.8.4",
"vite": "^4.3.9",
"vitest": "^0.32.2"
"preact": "^10.19.2",
"rollup": "^3.29.4",
"typescript": "^4.9.5",
"vite": "^4.5.0",
"vitest": "^0.32.4"
},
"peerDependencies": {
"preact": "^10.5.13"
Expand Down
4 changes: 2 additions & 2 deletions packages/lucide-preact/src/createLucideIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const toKebabCase = (string: string) => string.replace(/([a-z0-9])([A-Z])

const createLucideIcon = (iconName: string, iconNode: IconNode): FunctionComponent<LucideProps> => {
const Component = (
{ color = 'currentColor', size = 24, strokeWidth = 2, absoluteStrokeWidth, children, ...rest }: LucideProps
{ color = 'currentColor', size = 24, strokeWidth = 2, absoluteStrokeWidth, children, class: classes = '', ...rest }: LucideProps
) =>
h(
'svg' as unknown as ComponentType<Partial<JSX.SVGAttributes<SVGElement> & { 'stroke-width': number | string }>>,
Expand All @@ -32,7 +32,7 @@ const createLucideIcon = (iconName: string, iconNode: IconNode): FunctionCompone
height: size,
stroke: color,
['stroke-width' as 'strokeWidth']: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
class: `lucide lucide-${toKebabCase(iconName)}`,
class: ['lucide', `lucide-${toKebabCase(iconName)}`, classes].join(' '),
...rest,
},
[...iconNode.map(([tag, attrs]) => h(tag, attrs)), ...toChildArray(children)],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Using lucide icon components > should adjust the size, stroke color and stroke width 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"48\\" height=\\"48\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"red\\" stroke-width=\\"4\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\" class=\\"lucide lucide-grid3x3\\" data-testid=\\"grid-icon\\"><rect width=\\"18\\" height=\\"18\\" x=\\"3\\" y=\\"3\\" rx=\\"2\\"></rect><path d=\\"M3 9h18\\"></path><path d=\\"M3 15h18\\"></path><path d=\\"M9 3v18\\"></path><path d=\\"M15 3v18\\"></path></svg>"`;
exports[`Using lucide icon components > should adjust the size, stroke color and stroke width 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"48\\" height=\\"48\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"red\\" stroke-width=\\"4\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\" class=\\"lucide lucide-grid3x3 \\" data-testid=\\"grid-icon\\"><rect width=\\"18\\" height=\\"18\\" x=\\"3\\" y=\\"3\\" rx=\\"2\\"></rect><path d=\\"M3 9h18\\"></path><path d=\\"M3 15h18\\"></path><path d=\\"M9 3v18\\"></path><path d=\\"M15 3v18\\"></path></svg>"`;
exports[`Using lucide icon components > should not scale the strokeWidth when absoluteStrokeWidth is set 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"48\\" height=\\"48\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"red\\" stroke-width=\\"1\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\" class=\\"lucide lucide-grid3x3\\" data-testid=\\"grid-icon\\"><rect width=\\"18\\" height=\\"18\\" x=\\"3\\" y=\\"3\\" rx=\\"2\\"></rect><path d=\\"M3 9h18\\"></path><path d=\\"M3 15h18\\"></path><path d=\\"M9 3v18\\"></path><path d=\\"M15 3v18\\"></path></svg>"`;
exports[`Using lucide icon components > should not scale the strokeWidth when absoluteStrokeWidth is set 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"48\\" height=\\"48\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"red\\" stroke-width=\\"1\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\" class=\\"lucide lucide-grid3x3 \\" data-testid=\\"grid-icon\\"><rect width=\\"18\\" height=\\"18\\" x=\\"3\\" y=\\"3\\" rx=\\"2\\"></rect><path d=\\"M3 9h18\\"></path><path d=\\"M3 15h18\\"></path><path d=\\"M9 3v18\\"></path><path d=\\"M15 3v18\\"></path></svg>"`;
exports[`Using lucide icon components > should render an component 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\" class=\\"lucide lucide-grid3x3\\"><rect width=\\"18\\" height=\\"18\\" x=\\"3\\" y=\\"3\\" rx=\\"2\\"></rect><path d=\\"M3 9h18\\"></path><path d=\\"M3 15h18\\"></path><path d=\\"M9 3v18\\"></path><path d=\\"M15 3v18\\"></path></svg>"`;
exports[`Using lucide icon components > should render an component 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\" class=\\"lucide lucide-grid3x3 \\"><rect width=\\"18\\" height=\\"18\\" x=\\"3\\" y=\\"3\\" rx=\\"2\\"></rect><path d=\\"M3 9h18\\"></path><path d=\\"M3 15h18\\"></path><path d=\\"M9 3v18\\"></path><path d=\\"M15 3v18\\"></path></svg>"`;
13 changes: 12 additions & 1 deletion packages/lucide-preact/tests/lucide-preact.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, it, expect } from 'vitest';
import { render, cleanup } from '@testing-library/preact'
import { Pen, Edit2, Grid } from '../src/lucide-preact';
import { Pen, Edit2, Grid, Droplet } from '../src/lucide-preact';

type AttributesAssertion = { attributes: Record<string, { value: string }>}

Expand Down Expand Up @@ -76,4 +76,15 @@ describe('Using lucide icon components', () => {
expect(attributes['stroke-width'].value).toBe('1');
expect( container.innerHTML ).toMatchSnapshot();
});

it('should apply all classes to the element', () => {
const testClass = 'my-class';
const { container } = render(
<Droplet class={testClass} />,
);

expect(container.firstChild).toHaveClass(testClass);
expect(container.firstChild).toHaveClass('lucide');
expect(container.firstChild).toHaveClass('lucide-droplet');
});
})
1 change: 1 addition & 0 deletions packages/lucide-preact/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"outDir": "./dist",
"jsx": "react-jsx",
"jsxImportSource": "preact",
"types": ["@testing-library/jest-dom"],
},
"exclude": ["**/node_modules"]
}
Loading

0 comments on commit 12a8a45

Please sign in to comment.