mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-17 14:27:41 +01:00
Compare commits
379 Commits
lucide-vue
...
0.459.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c55c2ab93 | ||
|
|
cb60e31162 | ||
|
|
09cebe178d | ||
|
|
0f3fd12f16 | ||
|
|
4b0d17ad24 | ||
|
|
30fe706dd6 | ||
|
|
d6178fa471 | ||
|
|
855cb4985d | ||
|
|
9f99ea510f | ||
|
|
e2ee0c77e7 | ||
|
|
d041d5c2d2 | ||
|
|
8700418260 | ||
|
|
30077f913f | ||
|
|
bc09d5f283 | ||
|
|
88c757f540 | ||
|
|
f93beca595 | ||
|
|
b1777430b9 | ||
|
|
d30698cb38 | ||
|
|
d2f7a0931d | ||
|
|
98bbcc4b06 | ||
|
|
c253cb821b | ||
|
|
484dc38b0a | ||
|
|
11b95f883a | ||
|
|
b8cd54f1b2 | ||
|
|
98b3b6fae7 | ||
|
|
3ca465ee11 | ||
|
|
dcd19cedc9 | ||
|
|
8cea9feecc | ||
|
|
e80d98040f | ||
|
|
a1641a372b | ||
|
|
757bf0fb85 | ||
|
|
dd3aed1ecd | ||
|
|
4d98681f05 | ||
|
|
bde9e1cb6b | ||
|
|
a5e07c28bd | ||
|
|
2a68b12cbe | ||
|
|
493382b4fd | ||
|
|
6588971ead | ||
|
|
13cea45e8b | ||
|
|
5dfcfc8d1a | ||
|
|
db24b1d517 | ||
|
|
e1202b545e | ||
|
|
2e1a5cf6ea | ||
|
|
f49ecd73a5 | ||
|
|
a72cbc2d49 | ||
|
|
d4976890e5 | ||
|
|
8c8d1d3338 | ||
|
|
542507f835 | ||
|
|
c6a4908ed0 | ||
|
|
b6e71c6c7a | ||
|
|
7de43440ee | ||
|
|
c8d5260d54 | ||
|
|
0c912bd7ff | ||
|
|
3f24597a65 | ||
|
|
590d59ac5f | ||
|
|
85d427d846 | ||
|
|
478a624162 | ||
|
|
f0afdd4614 | ||
|
|
38e7431189 | ||
|
|
19dd912381 | ||
|
|
f70d5f5169 | ||
|
|
30e0d55b4a | ||
|
|
36a5a8b9ac | ||
|
|
e20e7a43ba | ||
|
|
e8ab1bc15b | ||
|
|
ef090c7dd4 | ||
|
|
65e49e2684 | ||
|
|
0ca2099113 | ||
|
|
9c99fd809c | ||
|
|
cd0d4e1f8a | ||
|
|
e1668804c9 | ||
|
|
efcede62e7 | ||
|
|
3c3f548ec1 | ||
|
|
0160bbe539 | ||
|
|
7837a04438 | ||
|
|
944e428630 | ||
|
|
aa4b1f06b4 | ||
|
|
b1087d3da0 | ||
|
|
fd8d69a129 | ||
|
|
379df75eda | ||
|
|
25707c7c47 | ||
|
|
cbb4ed985c | ||
|
|
d7d1074a60 | ||
|
|
79c2333b7f | ||
|
|
e3f78d73d8 | ||
|
|
e391973a70 | ||
|
|
5a2e3a20ee | ||
|
|
6e65118cd3 | ||
|
|
10c3662ff1 | ||
|
|
c7c6b479fc | ||
|
|
442e477a9a | ||
|
|
777166c06d | ||
|
|
8be94e7f86 | ||
|
|
07dd0bfdb1 | ||
|
|
3271972d97 | ||
|
|
915e8b5b6d | ||
|
|
6c32e47bea | ||
|
|
d4d90f0d4e | ||
|
|
3cf67355b4 | ||
|
|
66bc180c84 | ||
|
|
3c6a8c5118 | ||
|
|
8a088af570 | ||
|
|
cf5d6fc887 | ||
|
|
6052c88831 | ||
|
|
6272f4fd1f | ||
|
|
89070bfa44 | ||
|
|
4cae01a2f5 | ||
|
|
c2cc325f40 | ||
|
|
3143b24dff | ||
|
|
f0625d085e | ||
|
|
beddaa7cbb | ||
|
|
158212c130 | ||
|
|
1d5edc507d | ||
|
|
6f44a5d624 | ||
|
|
1c12bae0f5 | ||
|
|
fdcb73cb7a | ||
|
|
f2f685bd65 | ||
|
|
18d18361e8 | ||
|
|
45c3c00d1d | ||
|
|
45bc8c08da | ||
|
|
6676cdd513 | ||
|
|
eb93f112bd | ||
|
|
54a58881da | ||
|
|
568d0b2fa3 | ||
|
|
2d1be858c8 | ||
|
|
fa6ddf923f | ||
|
|
658b94e65a | ||
|
|
137ab5c885 | ||
|
|
83284d842a | ||
|
|
8993b0b174 | ||
|
|
1b2b66f1f3 | ||
|
|
0186afc0e6 | ||
|
|
36c68bd901 | ||
|
|
e8abed3fa7 | ||
|
|
b4af645560 | ||
|
|
8f65b7e6f4 | ||
|
|
3c3e3508ec | ||
|
|
01e5fd74e6 | ||
|
|
7c62c7c662 | ||
|
|
e92d5e2d40 | ||
|
|
3975020fd2 | ||
|
|
43dfe362b6 | ||
|
|
58524b25ee | ||
|
|
34805df73f | ||
|
|
7cb867782d | ||
|
|
63deb3e4f9 | ||
|
|
4dcc340301 | ||
|
|
8bd401fa8c | ||
|
|
338fc70f6d | ||
|
|
7ca1fabc12 | ||
|
|
0d2c6c457e | ||
|
|
2539470978 | ||
|
|
12b412aa87 | ||
|
|
c8b00be37e | ||
|
|
291b11fbd1 | ||
|
|
4635141dfa | ||
|
|
c761ec7b5e | ||
|
|
bbd877a3ba | ||
|
|
e830fb16e0 | ||
|
|
7625cab264 | ||
|
|
7726b7e7ff | ||
|
|
bca0eeaf09 | ||
|
|
8125a21a7e | ||
|
|
077242cfa0 | ||
|
|
ce79418c66 | ||
|
|
80350b2cb1 | ||
|
|
172f397019 | ||
|
|
a463d8a5c7 | ||
|
|
fbd5225aad | ||
|
|
acd4a879f2 | ||
|
|
e11fa135a0 | ||
|
|
f980863f6c | ||
|
|
07230a442f | ||
|
|
a34919f0af | ||
|
|
f4d451de80 | ||
|
|
1e887bc30f | ||
|
|
1442b9a35b | ||
|
|
41fd856578 | ||
|
|
621b60b19d | ||
|
|
b77e372f3e | ||
|
|
d4891a7307 | ||
|
|
199987276b | ||
|
|
5647b34594 | ||
|
|
439e463430 | ||
|
|
22921304a7 | ||
|
|
220abb1510 | ||
|
|
91ce9221e8 | ||
|
|
904d74fe4a | ||
|
|
f507644488 | ||
|
|
501b65a7a1 | ||
|
|
14862fb0dc | ||
|
|
2963369c8d | ||
|
|
1e20d5087a | ||
|
|
4b312b369f | ||
|
|
afbef743de | ||
|
|
864fdeca84 | ||
|
|
541add925c | ||
|
|
2e7df30267 | ||
|
|
0a578c8803 | ||
|
|
b227caee98 | ||
|
|
72b74fbdb4 | ||
|
|
01d36ad363 | ||
|
|
548cb9cdf5 | ||
|
|
79430da42e | ||
|
|
0620843f4c | ||
|
|
34d063302a | ||
|
|
0abc3389db | ||
|
|
ebb8ec66af | ||
|
|
f55ced97a5 | ||
|
|
8458345535 | ||
|
|
66d6c2fe4b | ||
|
|
053808685c | ||
|
|
4f2a6b70d8 | ||
|
|
d8004e471a | ||
|
|
e2b46eac8e | ||
|
|
1b3173b17b | ||
|
|
d5f4275055 | ||
|
|
6abae7cc14 | ||
|
|
f32ffcd2a2 | ||
|
|
824bb897cf | ||
|
|
2843a76e28 | ||
|
|
155ff3319a | ||
|
|
34dddb811b | ||
|
|
5fead67bf3 | ||
|
|
48dc9372db | ||
|
|
747446fc76 | ||
|
|
5862ea735e | ||
|
|
3a8a349771 | ||
|
|
70bc2245c7 | ||
|
|
89f6b6357d | ||
|
|
354af456d3 | ||
|
|
e50582e93e | ||
|
|
65deefa53c | ||
|
|
54ef137b49 | ||
|
|
d4df542117 | ||
|
|
8c1e56a7bf | ||
|
|
dff2172173 | ||
|
|
e8ccd3df7e | ||
|
|
b593355537 | ||
|
|
09420cbca5 | ||
|
|
45e82a51b8 | ||
|
|
305e282e19 | ||
|
|
ad7ae84987 | ||
|
|
df100bde73 | ||
|
|
0724851934 | ||
|
|
34cf88d209 | ||
|
|
6322d1df66 | ||
|
|
8a414b3249 | ||
|
|
58f614acca | ||
|
|
d598ad7190 | ||
|
|
439ee3f707 | ||
|
|
c2c85fbd5c | ||
|
|
59aa7bc824 | ||
|
|
0beb50ebca | ||
|
|
649b440d9d | ||
|
|
a74e8f3863 | ||
|
|
46318b1605 | ||
|
|
4bf91a3c51 | ||
|
|
3cde4f2a41 | ||
|
|
d75c7613b2 | ||
|
|
d17e81d712 | ||
|
|
3b4a19efcf | ||
|
|
94bbdb4e06 | ||
|
|
4b87cdb55f | ||
|
|
52de557ec1 | ||
|
|
642fa718f6 | ||
|
|
215f0767d7 | ||
|
|
a0befaf186 | ||
|
|
167f563f6d | ||
|
|
0ee6b84a06 | ||
|
|
9a65837e45 | ||
|
|
4c6587612a | ||
|
|
4aa36db1cb | ||
|
|
01401a3c97 | ||
|
|
d1e528fd95 | ||
|
|
5f5be9ec1e | ||
|
|
c66cda28da | ||
|
|
e565116a4a | ||
|
|
cf50c9f849 | ||
|
|
9fa47227a7 | ||
|
|
547111ed5b | ||
|
|
0d6aa9feaa | ||
|
|
3a0f2b3fa8 | ||
|
|
712e6bf6e4 | ||
|
|
58319dd447 | ||
|
|
cf89b8eeac | ||
|
|
a8c6add82b | ||
|
|
d000e4904d | ||
|
|
c99d6cbf4a | ||
|
|
0b1fb8ff1f | ||
|
|
dcde43e97e | ||
|
|
96da23cc88 | ||
|
|
78182c3573 | ||
|
|
02f8f5a1c1 | ||
|
|
16ee591f49 | ||
|
|
5378156833 | ||
|
|
7b76078792 | ||
|
|
e2af1af4f9 | ||
|
|
c9513d0bf4 | ||
|
|
6fbd5ee06a | ||
|
|
d8773827fb | ||
|
|
bc1843f767 | ||
|
|
07aefe3b88 | ||
|
|
76d449a974 | ||
|
|
dd39fa328c | ||
|
|
0cf568c38b | ||
|
|
a8b8dfc58e | ||
|
|
41dde6b574 | ||
|
|
ae35ca256c | ||
|
|
38142f24a5 | ||
|
|
b16f70993a | ||
|
|
ad1accb2e3 | ||
|
|
d255c6ac4e | ||
|
|
d67ef7b0ca | ||
|
|
198ccb8430 | ||
|
|
ce1b5bdefa | ||
|
|
45aa928369 | ||
|
|
93dc356fa1 | ||
|
|
a0aa132682 | ||
|
|
1a4dd64862 | ||
|
|
3481f70ad7 | ||
|
|
024f21e896 | ||
|
|
c30ccd472e | ||
|
|
28ec03ebc8 | ||
|
|
ab3a31367a | ||
|
|
148bae88d8 | ||
|
|
ca4a38ba85 | ||
|
|
f297765a13 | ||
|
|
4657ccbfff | ||
|
|
db222d4591 | ||
|
|
bafad1c625 | ||
|
|
7f1e95c6e7 | ||
|
|
ca7a87112c | ||
|
|
d542da0a1c | ||
|
|
6fa51d2a22 | ||
|
|
ca53b06af2 | ||
|
|
b5dc96d2c2 | ||
|
|
5e5fe0085f | ||
|
|
0c2a8d774f | ||
|
|
804906dcd8 | ||
|
|
d575743d3a | ||
|
|
42c1faed75 | ||
|
|
42b494f853 | ||
|
|
9bf8a653a3 | ||
|
|
01cff578e5 | ||
|
|
a0b1305258 | ||
|
|
0cfdfa2181 | ||
|
|
a2e8ea32d2 | ||
|
|
8a7e6ba343 | ||
|
|
7a9233f4a7 | ||
|
|
71aef25812 | ||
|
|
33189a81ac | ||
|
|
e3923f87c2 | ||
|
|
08c040a57d | ||
|
|
981c3309ce | ||
|
|
2e0af66d8a | ||
|
|
a789c91213 | ||
|
|
91c95600f3 | ||
|
|
99acf4102c | ||
|
|
86f2dc12f4 | ||
|
|
b9fdde2d09 | ||
|
|
5c494962e1 | ||
|
|
772c5be034 | ||
|
|
ee3483eb1b | ||
|
|
9182c51962 | ||
|
|
eb035fe370 | ||
|
|
b96e6acd2e | ||
|
|
7b62649c39 | ||
|
|
10aff6cf7b | ||
|
|
cfa8924025 | ||
|
|
713e9b8a09 | ||
|
|
8ab6f80e4f | ||
|
|
a5221c236a | ||
|
|
cdd32b5294 | ||
|
|
54c8d4078d | ||
|
|
3302870983 | ||
|
|
0f25ee86a0 | ||
|
|
28686b5bd5 | ||
|
|
8cc143915c |
17
.cspell/custom-words.txt
Normal file
17
.cspell/custom-words.txt
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Custom words
|
||||||
|
fullscreen
|
||||||
|
gamepad
|
||||||
|
gantt
|
||||||
|
kanban
|
||||||
|
pilcrow
|
||||||
|
squircle
|
||||||
|
strikethrough
|
||||||
|
touchpad
|
||||||
|
ungroup
|
||||||
|
pilcrow
|
||||||
|
toc
|
||||||
|
|
||||||
|
# Brands
|
||||||
|
codepen
|
||||||
|
codesandbox
|
||||||
|
dribbble
|
||||||
@@ -6,6 +6,5 @@ tests
|
|||||||
node_modules
|
node_modules
|
||||||
.eslintrc.js
|
.eslintrc.js
|
||||||
docs/images
|
docs/images
|
||||||
docs/guide/basics/examples
|
docs/**/examples/
|
||||||
docs/guide/advanced/examples
|
|
||||||
packages/lucide-react/dynamicIconImports.js
|
packages/lucide-react/dynamicIconImports.js
|
||||||
|
|||||||
19
.eslintrc.js
19
.eslintrc.js
@@ -1,4 +1,4 @@
|
|||||||
const DEFAULT_ATTRS = require('./scripts/render/default-attrs.json');
|
const DEFAULT_ATTRS = require('./tools/build-icons/render/default-attrs.json');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
@@ -15,7 +15,9 @@ module.exports = {
|
|||||||
'no-use-before-define': 'off',
|
'no-use-before-define': 'off',
|
||||||
'import/no-extraneous-dependencies': [
|
'import/no-extraneous-dependencies': [
|
||||||
'error',
|
'error',
|
||||||
{ devDependencies: ['**/*.test.js', '**/*.spec.js', './scripts/**'] },
|
{
|
||||||
|
devDependencies: ['**/*.test.js', '**/*.spec.js', '**/scripts/**'],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
'import/extensions': [
|
'import/extensions': [
|
||||||
'error',
|
'error',
|
||||||
@@ -42,12 +44,15 @@ module.exports = {
|
|||||||
'@html-eslint/no-duplicate-attrs': 'error',
|
'@html-eslint/no-duplicate-attrs': 'error',
|
||||||
'@html-eslint/no-inline-styles': 'error',
|
'@html-eslint/no-inline-styles': 'error',
|
||||||
'@html-eslint/require-attrs': [
|
'@html-eslint/require-attrs': [
|
||||||
'error',
|
'error',
|
||||||
...Object.entries(DEFAULT_ATTRS)
|
...Object.entries(DEFAULT_ATTRS).map(([attr, value]) => ({
|
||||||
.map(([attr, value]) => ({ tag: 'svg', attr, value: String(value) }))
|
tag: 'svg',
|
||||||
|
attr,
|
||||||
|
value: String(value),
|
||||||
|
})),
|
||||||
],
|
],
|
||||||
'@html-eslint/indent': ['error', 2],
|
'@html-eslint/indent': ['error', 2],
|
||||||
"@html-eslint/no-multiple-empty-lines": ["error", { "max": 0 }],
|
'@html-eslint/no-multiple-empty-lines': ['error', { max: 0 }],
|
||||||
'@html-eslint/no-extra-spacing-attrs': [
|
'@html-eslint/no-extra-spacing-attrs': [
|
||||||
'error',
|
'error',
|
||||||
{
|
{
|
||||||
@@ -64,7 +69,7 @@ module.exports = {
|
|||||||
'@html-eslint/element-newline': 'error',
|
'@html-eslint/element-newline': 'error',
|
||||||
'@html-eslint/no-trailing-spaces': 'error',
|
'@html-eslint/no-trailing-spaces': 'error',
|
||||||
'@html-eslint/quotes': 'error',
|
'@html-eslint/quotes': 'error',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
13
.github/ISSUE_TEMPLATE/02_bug_report.yml
vendored
13
.github/ISSUE_TEMPLATE/02_bug_report.yml
vendored
@@ -35,6 +35,16 @@ body:
|
|||||||
placeholder: e.g. 0.289.1
|
placeholder: e.g. 0.289.1
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
- type: checkboxes
|
||||||
|
id: can-reproduce-in-latest-version
|
||||||
|
attributes:
|
||||||
|
label: Can you reproduce this in the latest version?
|
||||||
|
description: i.e. after running `npm install lucide-react@latest`
|
||||||
|
options:
|
||||||
|
- label: 'Yes'
|
||||||
|
- label: 'No'
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
- type: checkboxes
|
- type: checkboxes
|
||||||
id: browsers
|
id: browsers
|
||||||
attributes:
|
attributes:
|
||||||
@@ -59,6 +69,9 @@ body:
|
|||||||
- label: Windows
|
- label: Windows
|
||||||
- label: Linux
|
- label: Linux
|
||||||
- label: macOS
|
- label: macOS
|
||||||
|
- label: ChromeOS
|
||||||
|
- label: iOS
|
||||||
|
- label: Android
|
||||||
- label: Other/not relevant
|
- label: Other/not relevant
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: description
|
id: description
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ body:
|
|||||||
- label: Windows
|
- label: Windows
|
||||||
- label: Linux
|
- label: Linux
|
||||||
- label: macOS
|
- label: macOS
|
||||||
|
- label: ChromeOS
|
||||||
|
- label: iOS
|
||||||
|
- label: Android
|
||||||
- label: Other/not relevant
|
- label: Other/not relevant
|
||||||
- type: textarea
|
- type: textarea
|
||||||
id: description
|
id: description
|
||||||
|
|||||||
6
.github/actions/build-and-test.yml
vendored
6
.github/actions/build-and-test.yml
vendored
@@ -1,5 +1,5 @@
|
|||||||
name: "Build and Test"
|
name: 'Build and Test'
|
||||||
description: "Builds and test a package"
|
description: 'Builds and test a package'
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
name:
|
name:
|
||||||
@@ -7,7 +7,7 @@ inputs:
|
|||||||
required: true
|
required: true
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
|
|||||||
6
.github/actions/check-icons.yml
vendored
6
.github/actions/check-icons.yml
vendored
@@ -1,5 +1,5 @@
|
|||||||
name: "Check icons"
|
name: 'Check icons'
|
||||||
description: "Cross-checks icon and category references in JSON descriptors"
|
description: 'Cross-checks icon and category references in JSON descriptors'
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
name:
|
name:
|
||||||
@@ -7,7 +7,7 @@ inputs:
|
|||||||
required: true
|
required: true
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
|
|||||||
96
.github/labeler.yml
vendored
96
.github/labeler.yml
vendored
@@ -1,92 +1,92 @@
|
|||||||
# For changed dependencies
|
# For changed dependencies
|
||||||
📦 dependencies:
|
📦 dependencies:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file:
|
- any-glob-to-any-file:
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
# For changes in documentation
|
# For changes in documentation
|
||||||
📖 documentation:
|
📖 documentation:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file:
|
- any-glob-to-any-file:
|
||||||
- docs/*.md
|
- docs/*.md
|
||||||
- docs/**/*.md
|
- docs/**/*.md
|
||||||
|
|
||||||
# For changes in the site, but not markdown files
|
# For changes in the site, but not markdown files
|
||||||
🌍 site:
|
🌍 site:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file:
|
- any-glob-to-any-file:
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
|
|
||||||
# For changes in the metadata
|
# For changes in the metadata
|
||||||
🫧 metadata:
|
🫧 metadata:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file:
|
- any-glob-to-any-file:
|
||||||
- 'icons/*.json'
|
- 'icons/*.json'
|
||||||
- categories/*
|
- categories/*
|
||||||
|
|
||||||
# For changes or added icons
|
# For changes or added icons
|
||||||
🎨 icon:
|
🎨 icon:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file:
|
- any-glob-to-any-file:
|
||||||
- 'icons/*.svg'
|
- 'icons/*.svg'
|
||||||
|
|
||||||
# For changes in the lucide package
|
# For changes in the lucide package
|
||||||
🧳 lucide package:
|
🧳 lucide package:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file:
|
- any-glob-to-any-file:
|
||||||
- 'packages/lucide/*'
|
- 'packages/lucide/*'
|
||||||
|
|
||||||
# For changes in the lucide React package
|
# For changes in the lucide React package
|
||||||
⚛️ react package:
|
⚛️ react package:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file:
|
- any-glob-to-any-file:
|
||||||
- 'packages/lucide-react/*'
|
- 'packages/lucide-react/*'
|
||||||
|
|
||||||
# For changes in the lucide React Native package
|
# For changes in the lucide React Native package
|
||||||
⚛️ react native package:
|
⚛️ react native package:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file:
|
- any-glob-to-any-file:
|
||||||
- 'packages/lucide-react-native/*'
|
- 'packages/lucide-react-native/*'
|
||||||
|
|
||||||
# For changes in the lucide vue packages
|
# For changes in the lucide vue packages
|
||||||
💎 vue package:
|
💎 vue package:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file:
|
- any-glob-to-any-file:
|
||||||
- 'packages/lucide-vue/*'
|
- 'packages/lucide-vue/*'
|
||||||
- 'packages/lucide-vue-next/*'
|
- 'packages/lucide-vue-next/*'
|
||||||
|
|
||||||
# For changes in the lucide angular package
|
# For changes in the lucide angular package
|
||||||
🅰️ angular package:
|
🅰️ angular package:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file:
|
- any-glob-to-any-file:
|
||||||
- 'packages/lucide-angular/*'
|
- 'packages/lucide-angular/*'
|
||||||
|
|
||||||
# For changes in the lucide preact package
|
# For changes in the lucide preact package
|
||||||
⚛️ preact package:
|
⚛️ preact package:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file:
|
- any-glob-to-any-file:
|
||||||
- 'packages/lucide-preact/*'
|
- 'packages/lucide-preact/*'
|
||||||
|
|
||||||
# For changes in the lucide svelte package
|
# For changes in the lucide svelte package
|
||||||
🧣 svelte package:
|
🧣 svelte package:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file:
|
- any-glob-to-any-file:
|
||||||
- 'packages/lucide-svelte/*'
|
- 'packages/lucide-svelte/*'
|
||||||
|
|
||||||
# For changes in the lucide solid package
|
# For changes in the lucide solid package
|
||||||
🪝 solid package:
|
🪝 solid package:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file:
|
- any-glob-to-any-file:
|
||||||
- 'packages/lucide-solid/*'
|
- 'packages/lucide-solid/*'
|
||||||
|
|
||||||
# For changes in the lucide static package
|
# For changes in the lucide static package
|
||||||
🪨 static package:
|
🪨 static package:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file:
|
- any-glob-to-any-file:
|
||||||
- 'packages/lucide-static/*'
|
- 'packages/lucide-static/*'
|
||||||
|
|
||||||
# For changes in the lucide flutter package
|
# For changes in the lucide flutter package
|
||||||
🏹 flutter package:
|
🏹 flutter package:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file:
|
- any-glob-to-any-file:
|
||||||
- 'packages/lucide-flutter/*'
|
- 'packages/lucide-flutter/*'
|
||||||
|
|||||||
2
.github/pull_request_template.md
vendored
2
.github/pull_request_template.md
vendored
@@ -47,7 +47,7 @@
|
|||||||
- [ ] I've made sure that the icons look sharp on low DPI displays.
|
- [ ] I've made sure that the icons look sharp on low DPI displays.
|
||||||
- [ ] I've made sure that the icons look consistent with the icon set in size, optical volume and density.
|
- [ ] I've made sure that the icons look consistent with the icon set in size, optical volume and density.
|
||||||
- [ ] I've made sure that the icons are visually centered.
|
- [ ] I've made sure that the icons are visually centered.
|
||||||
- [ ] I've correctly optimized all icons to two points of precision.
|
- [ ] I've correctly optimized all icons to three points of precision.
|
||||||
|
|
||||||
## Before Submitting <!-- For every PR! -->
|
## Before Submitting <!-- For every PR! -->
|
||||||
<!-- All of these requirements must be fulfilled. -->
|
<!-- All of these requirements must be fulfilled. -->
|
||||||
|
|||||||
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -17,8 +17,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
|
|||||||
35
.github/workflows/close-issue-with-banned-phrases.yml
vendored
Normal file
35
.github/workflows/close-issue-with-banned-phrases.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
name: Close Issue with Banned Phrases
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types: [opened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
block_phrases:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Check for blocked phrases in issue title
|
||||||
|
run: |
|
||||||
|
ISSUE_TITLE=$(jq -r '.issue.title' "$GITHUB_EVENT_PATH")
|
||||||
|
BLOCKED_PHRASES=("twitter" "whatsapp" "logo" "google" "tiktok" "facebook" "slack" "discord")
|
||||||
|
|
||||||
|
# Check title and body for blocked phrases
|
||||||
|
for PHRASE in "${BLOCKED_PHRASES[@]}"
|
||||||
|
do
|
||||||
|
if echo "$ISSUE_TITLE" | grep -i "$PHRASE"; then
|
||||||
|
gh issue close ${{ github.event.issue.number }} --reason "not planned" --comment "This looks like a duplicate, use the [search](https://github.com/lucide-icons/lucide/issues?q=is%3Aissue+$PHRASE) to find similar issues.
|
||||||
|
|
||||||
|
Read more about brand guideline rules at [We're not accepting new Brand icons #670](https://github.com/lucide-icons/lucide/issues/670).
|
||||||
|
|
||||||
|
Always happy to help on [Discord](https://discord.gg/EH6nSts)."
|
||||||
|
gh issue lock ${{ github.event.issue.number }} --reason spam
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
5
.github/workflows/close-stale-prs.yml
vendored
5
.github/workflows/close-stale-prs.yml
vendored
@@ -1,11 +1,13 @@
|
|||||||
name: Close stale issues and PR
|
name: Close stale issues and PR
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "45 1 * * *"
|
- cron: '45 1 * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stale:
|
stale:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/stale@v9
|
- uses: actions/stale@v9
|
||||||
with:
|
with:
|
||||||
@@ -14,4 +16,5 @@ jobs:
|
|||||||
close-pr-message: This PR was closed because it has been stalled for 5 days with no activity.
|
close-pr-message: This PR was closed because it has been stalled for 5 days with no activity.
|
||||||
close-pr-label: 🧶 stale
|
close-pr-label: 🧶 stale
|
||||||
days-before-stale: 30
|
days-before-stale: 30
|
||||||
|
days-before-issue-stale: -1
|
||||||
days-before-close: -1
|
days-before-close: -1
|
||||||
|
|||||||
6
.github/workflows/labeler.yml
vendored
6
.github/workflows/labeler.yml
vendored
@@ -1,6 +1,6 @@
|
|||||||
name: "Pull Request Labeler"
|
name: 'Pull Request Labeler'
|
||||||
on:
|
on:
|
||||||
- pull_request_target
|
- pull_request_target
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
triage:
|
triage:
|
||||||
@@ -9,4 +9,4 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/labeler@v5
|
- uses: actions/labeler@v5
|
||||||
|
|||||||
2
.github/workflows/linting.yml
vendored
2
.github/workflows/linting.yml
vendored
@@ -11,8 +11,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
|
|||||||
17
.github/workflows/lucide-angular.yml
vendored
17
.github/workflows/lucide-angular.yml
vendored
@@ -8,13 +8,11 @@ on:
|
|||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lucide-angular:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
@@ -26,5 +24,18 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide-angular build
|
run: pnpm --filter lucide-angular build
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: pnpm --filter lucide-angular test
|
run: pnpm --filter lucide-angular test
|
||||||
|
|||||||
4
.github/workflows/lucide-font.yml
vendored
4
.github/workflows/lucide-font.yml
vendored
@@ -13,8 +13,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
@@ -29,7 +27,7 @@ jobs:
|
|||||||
- name: Create font in ./lucide-font
|
- name: Create font in ./lucide-font
|
||||||
run: pnpm build:font
|
run: pnpm build:font
|
||||||
|
|
||||||
- name: "Upload to Artifacts"
|
- name: 'Upload to Artifacts'
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: lucide-font
|
name: lucide-font
|
||||||
|
|||||||
6
.github/workflows/lucide-preact.yml
vendored
6
.github/workflows/lucide-preact.yml
vendored
@@ -4,6 +4,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide-preact/**
|
- packages/lucide-preact/**
|
||||||
|
- packages/shared/**
|
||||||
- tools/build-icons/**
|
- tools/build-icons/**
|
||||||
- tools/rollup-plugins/**
|
- tools/rollup-plugins/**
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
@@ -14,8 +15,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
@@ -24,8 +23,5 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: pnpm --filter lucide-preact build
|
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: pnpm --filter lucide-preact test
|
run: pnpm --filter lucide-preact test
|
||||||
|
|||||||
6
.github/workflows/lucide-react-native.yml
vendored
6
.github/workflows/lucide-react-native.yml
vendored
@@ -4,6 +4,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide-react-native/**
|
- packages/lucide-react-native/**
|
||||||
|
- packages/shared/**
|
||||||
- tools/build-icons/**
|
- tools/build-icons/**
|
||||||
- tools/rollup-plugins/**
|
- tools/rollup-plugins/**
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
@@ -14,8 +15,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
@@ -24,8 +23,5 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: pnpm --filter lucide-react-native build
|
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: pnpm --filter lucide-react-native test
|
run: pnpm --filter lucide-react-native test
|
||||||
|
|||||||
18
.github/workflows/lucide-react.yml
vendored
18
.github/workflows/lucide-react.yml
vendored
@@ -4,19 +4,18 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide-react/**
|
- packages/lucide-react/**
|
||||||
|
- packages/shared/**
|
||||||
- tools/build-icons/**
|
- tools/build-icons/**
|
||||||
- tools/rollup-plugins/**
|
- tools/rollup-plugins/**
|
||||||
- scripts/generateNextJSAliases.mjs
|
- scripts/generateNextJSAliases.mjs
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lucide-react:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
@@ -28,5 +27,18 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide-react build
|
run: pnpm --filter lucide-react build
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: pnpm --filter lucide-react test
|
run: pnpm --filter lucide-react test
|
||||||
|
|||||||
24
.github/workflows/lucide-shared.yml
vendored
Normal file
24
.github/workflows/lucide-shared.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
name: Lucide Shared Checks
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- packages/shared/**
|
||||||
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: pnpm --filter lucide-react test
|
||||||
18
.github/workflows/lucide-solid.yml
vendored
18
.github/workflows/lucide-solid.yml
vendored
@@ -4,18 +4,17 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide-solid/**
|
- packages/lucide-solid/**
|
||||||
|
- packages/shared/**
|
||||||
- tools/build-icons/**
|
- tools/build-icons/**
|
||||||
- tools/rollup-plugins/**
|
- tools/rollup-plugins/**
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lucide-solid:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
@@ -27,5 +26,18 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide-solid build
|
run: pnpm --filter lucide-solid build
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: pnpm --filter lucide-solid test
|
run: pnpm --filter lucide-solid test
|
||||||
|
|||||||
2
.github/workflows/lucide-static.yml
vendored
2
.github/workflows/lucide-static.yml
vendored
@@ -13,8 +13,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
|
|||||||
18
.github/workflows/lucide-svelte.yml
vendored
18
.github/workflows/lucide-svelte.yml
vendored
@@ -4,18 +4,17 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide-svelte/**
|
- packages/lucide-svelte/**
|
||||||
|
- packages/shared/**
|
||||||
- tools/build-icons/**
|
- tools/build-icons/**
|
||||||
- tools/rollup-plugins/**
|
- tools/rollup-plugins/**
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lucide-svelte:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
@@ -27,5 +26,18 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide-svelte build
|
run: pnpm --filter lucide-svelte build
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: pnpm --filter lucide-svelte test
|
run: pnpm --filter lucide-svelte test
|
||||||
|
|||||||
18
.github/workflows/lucide-vue-next.yml
vendored
18
.github/workflows/lucide-vue-next.yml
vendored
@@ -4,18 +4,17 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide-vue-next/**
|
- packages/lucide-vue-next/**
|
||||||
|
- packages/shared/**
|
||||||
- tools/build-icons/**
|
- tools/build-icons/**
|
||||||
- tools/rollup-plugins/**
|
- tools/rollup-plugins/**
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lucide-vue-next:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
@@ -27,5 +26,18 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide-vue-next build
|
run: pnpm --filter lucide-vue-next build
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: pnpm --filter lucide-vue-next test
|
run: pnpm --filter lucide-vue-next test
|
||||||
|
|||||||
18
.github/workflows/lucide-vue.yml
vendored
18
.github/workflows/lucide-vue.yml
vendored
@@ -4,18 +4,17 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide-vue/**
|
- packages/lucide-vue/**
|
||||||
|
- packages/shared/**
|
||||||
- tools/build-icons/**
|
- tools/build-icons/**
|
||||||
- tools/rollup-plugins/**
|
- tools/rollup-plugins/**
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lucide-vue:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
@@ -27,5 +26,18 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide-vue build
|
run: pnpm --filter lucide-vue build
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: pnpm --filter lucide-vue test
|
run: pnpm --filter lucide-vue test
|
||||||
|
|||||||
17
.github/workflows/lucide.yml
vendored
17
.github/workflows/lucide.yml
vendored
@@ -9,13 +9,11 @@ on:
|
|||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lucide:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
@@ -27,5 +25,18 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide build
|
run: pnpm --filter lucide build
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: pnpm --filter lucide test
|
run: pnpm --filter lucide test
|
||||||
|
|||||||
16
.github/workflows/pull-request.yml
vendored
16
.github/workflows/pull-request.yml
vendored
@@ -3,7 +3,7 @@ name: Add Changed Icons comment
|
|||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
paths:
|
paths:
|
||||||
- 'icons/*.svg'
|
- 'icons/*'
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- fix-icon-preview
|
- fix-icon-preview
|
||||||
@@ -68,6 +68,16 @@ jobs:
|
|||||||
# input: +++ b/icons/accessibility.json%0A@@ -2,0 +3 @@%0A+ "contributors": ["hi"],%0A@@ -13 +14 @@%0A+}%0A
|
# input: +++ b/icons/accessibility.json%0A@@ -2,0 +3 @@%0A+ "contributors": ["hi"],%0A@@ -13 +14 @@%0A+}%0A
|
||||||
# output: ::$ANNOTATION_SEVERITY file=icons/accessibility.json,line=2,endLine=3,title=$ANNOTATION_TITLE::$ANNOTATION_DESCRIPTION%0A%0A+ "contributors": ["hi"],%0A@@ -13 +14 @@%0A+}%0A
|
# output: ::$ANNOTATION_SEVERITY file=icons/accessibility.json,line=2,endLine=3,title=$ANNOTATION_TITLE::$ANNOTATION_DESCRIPTION%0A%0A+ "contributors": ["hi"],%0A@@ -13 +14 @@%0A+}%0A
|
||||||
|
|
||||||
|
lint-aliases:
|
||||||
|
name: Check Uniqueness of Aliases
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Check Uniqueness of Aliases
|
||||||
|
run: "! cat <(printf \"%s\\n\" icons/*.json | while read -r name; do basename \"$name\" .json; done) <(jq -cr 'select(.aliases) | .aliases[] | if type==\"string\" then . else .name end' icons/*.json) | sort | uniq -c | grep -ve '^\\s*1 '"
|
||||||
|
|
||||||
generate-changed-icons-comment:
|
generate-changed-icons-comment:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
@@ -94,6 +104,10 @@ jobs:
|
|||||||
comment-author: 'github-actions[bot]'
|
comment-author: 'github-actions[bot]'
|
||||||
body-includes: Added or changed icons
|
body-includes: Added or changed icons
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
- name: Install svgson for code preview (safer and faster than installing all deps)
|
||||||
|
run: npm install svgson
|
||||||
|
|
||||||
- name: Generate comment markup
|
- name: Generate comment markup
|
||||||
run: node ./scripts/generateChangedIconsCommentMarkup.mjs >> comment-markup.md
|
run: node ./scripts/generateChangedIconsCommentMarkup.mjs >> comment-markup.md
|
||||||
id: comment-markup
|
id: comment-markup
|
||||||
|
|||||||
36
.github/workflows/release.yml
vendored
36
.github/workflows/release.yml
vendored
@@ -41,22 +41,21 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
package: [
|
package:
|
||||||
'lucide',
|
[
|
||||||
'lucide-react',
|
'lucide',
|
||||||
'lucide-react-native',
|
'lucide-react',
|
||||||
'lucide-vue',
|
'lucide-react-native',
|
||||||
'lucide-vue-next',
|
'lucide-vue',
|
||||||
'lucide-angular',
|
'lucide-vue-next',
|
||||||
'lucide-preact',
|
'lucide-angular',
|
||||||
'lucide-solid',
|
'lucide-preact',
|
||||||
'lucide-svelte',
|
'lucide-solid',
|
||||||
]
|
'lucide-svelte',
|
||||||
|
]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
@@ -88,8 +87,6 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
@@ -120,8 +117,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: pnpm/action-setup@v2
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
@@ -136,7 +131,7 @@ jobs:
|
|||||||
- name: Create font in ./lucide-font
|
- name: Create font in ./lucide-font
|
||||||
run: pnpm build:font
|
run: pnpm build:font
|
||||||
|
|
||||||
- name: "Upload to Artifacts"
|
- name: 'Upload to Artifacts'
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: lucide-font
|
name: lucide-font
|
||||||
@@ -145,10 +140,7 @@ jobs:
|
|||||||
post-release:
|
post-release:
|
||||||
if: github.repository == 'lucide-icons/lucide'
|
if: github.repository == 'lucide-icons/lucide'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [
|
needs: [pre-release, lucide-font]
|
||||||
pre-release,
|
|
||||||
lucide-font,
|
|
||||||
]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -16,7 +16,9 @@ outlined
|
|||||||
packages/**/src/icons/*.js
|
packages/**/src/icons/*.js
|
||||||
packages/**/src/icons/*.ts
|
packages/**/src/icons/*.ts
|
||||||
packages/**/src/icons/*.tsx
|
packages/**/src/icons/*.tsx
|
||||||
|
packages/**/src/aliases/*.ts
|
||||||
packages/**/src/aliases.ts
|
packages/**/src/aliases.ts
|
||||||
|
!packages/**/src/aliases/index.ts
|
||||||
packages/**/src/dynamicIconImports.ts
|
packages/**/src/dynamicIconImports.ts
|
||||||
packages/**/dynamicIconImports.js
|
packages/**/dynamicIconImports.js
|
||||||
packages/**/dynamicIconImports.d.ts
|
packages/**/dynamicIconImports.d.ts
|
||||||
@@ -34,6 +36,7 @@ docs/.vitepress/data/iconNodes
|
|||||||
docs/.vitepress/data/iconMetaData.ts
|
docs/.vitepress/data/iconMetaData.ts
|
||||||
docs/.vitepress/data/releaseMetaData.json
|
docs/.vitepress/data/releaseMetaData.json
|
||||||
docs/.vitepress/data/releaseMetaData
|
docs/.vitepress/data/releaseMetaData
|
||||||
|
docs/.vitepress/data/categoriesData.json
|
||||||
docs/.vitepress/data/iconDetails
|
docs/.vitepress/data/iconDetails
|
||||||
docs/.vitepress/data/relatedIcons.json
|
docs/.vitepress/data/relatedIcons.json
|
||||||
docs/.vercel
|
docs/.vercel
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
|
|
||||||
|
# docs examples
|
||||||
|
docs/**/examples/
|
||||||
|
docs/.vitepress/.temp
|
||||||
|
docs/.vitepress/cache
|
||||||
|
docs/.vitepress/data
|
||||||
|
docs/.nitro
|
||||||
|
|
||||||
# lucide-angular
|
# lucide-angular
|
||||||
packages/lucide-angular/.angular/cache
|
packages/lucide-angular/.angular/cache
|
||||||
|
|
||||||
|
|||||||
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@@ -12,4 +12,4 @@
|
|||||||
"webRoot": "${workspaceFolder}"
|
"webRoot": "${workspaceFolder}"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
11
.vscode/settings.json
vendored
11
.vscode/settings.json
vendored
@@ -1,13 +1,6 @@
|
|||||||
{
|
{
|
||||||
"cSpell.words": [
|
"cSpell.words": ["devs", "preact", "Preact"],
|
||||||
"devs",
|
|
||||||
"preact",
|
|
||||||
"Preact"
|
|
||||||
],
|
|
||||||
"eslint.enable": true,
|
"eslint.enable": true,
|
||||||
"eslint.validate": [
|
"eslint.validate": ["javascript", "svg"],
|
||||||
"javascript",
|
|
||||||
"svg"
|
|
||||||
],
|
|
||||||
"svg.preview.background": "transparent"
|
"svg.preview.background": "transparent"
|
||||||
}
|
}
|
||||||
|
|||||||
2
.vscode/svg.code-snippets
vendored
2
.vscode/svg.code-snippets
vendored
@@ -49,7 +49,7 @@
|
|||||||
"circle",
|
"circle",
|
||||||
"<circle"
|
"<circle"
|
||||||
],
|
],
|
||||||
"body": "<circle cx=\"${2:12}\" cy=\"${3:$2}\" r=\"${1|10,2,.5|}\" />"
|
"body": "<circle cx=\"${2:12}\" cy=\"${3:$2}\" r=\"${1|10,2,.5\" fill=\"currentColor|}\" />"
|
||||||
},
|
},
|
||||||
"Ellipse": {
|
"Ellipse": {
|
||||||
"scope": "xml",
|
"scope": "xml",
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ You can also [download an Adobe Illustrator template](https://github.com/lucide-
|
|||||||
|
|
||||||
#### [Figma Guide](https://lucide.dev/docs/figma-guide)
|
#### [Figma Guide](https://lucide.dev/docs/figma-guide)
|
||||||
|
|
||||||
|
#### [Affinity Designer Guide](https://lucide.dev/guide/design/affinity-designer-guide)
|
||||||
|
|
||||||
### Submitting Multiple Icons
|
### Submitting Multiple Icons
|
||||||
|
|
||||||
If you want submit multiple icons, please separate the icons and group them. That makes reviewing the icons easier and keep the thread clean and scoped.
|
If you want submit multiple icons, please separate the icons and group them. That makes reviewing the icons easier and keep the thread clean and scoped.
|
||||||
@@ -70,7 +72,7 @@ pnpm install # Install dependencies, including the workspace packages
|
|||||||
|
|
||||||
### Packages -> PNPM Workspaces
|
### Packages -> PNPM Workspaces
|
||||||
|
|
||||||
To distribute different packages we use PNPM workspaces. Before you start make sure you are familiar with this concept. The concept of working in workspaces is created by Yarn, they have a well written introduction: [yarn workspaces](https://classic.yarnpkg.com/lang/enhttps://lucide.dev/docs/workspaces).
|
To distribute different packages we use [PNPM workspaces](https://pnpm.io/workspaces). Before you start make sure you are familiar with this concept. The concept of working in workspaces is created by Yarn, they have a well written introduction: [yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces).
|
||||||
|
|
||||||
The configured directory for workspaces is the [packages](https://github.com/lucide-icons/lucide/tree/main/packages) directory, located in the root directory. There you will find all the current packages from lucide.
|
The configured directory for workspaces is the [packages](https://github.com/lucide-icons/lucide/tree/main/packages) directory, located in the root directory. There you will find all the current packages from lucide.
|
||||||
There are more workspaces defined, see [`pnpm-workspace.yaml`](https://github.com/lucide-icons/lucide/blob/main/pnpm-workspace.yaml).
|
There are more workspaces defined, see [`pnpm-workspace.yaml`](https://github.com/lucide-icons/lucide/blob/main/pnpm-workspace.yaml).
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -1,4 +1,11 @@
|
|||||||
<p align=center><img width="480" src="https://lucide.dev/lucide-logo-repo.svg" alt="Lucide Logo"></p>
|
<p align="center">
|
||||||
|
<a href="https://github.com/lucide-icons/lucide#gh-light-mode-only">
|
||||||
|
<img src="https://lucide.dev/lucide-logo-repo.svg#gh-light-mode-only" alt="Lucide - Beautiful & consistent icon toolkit made by the community. Open-source project and a fork of Feather Icons." width="480">
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/lucide-icons/lucide#gh-dark-mode-only">
|
||||||
|
<img src="https://lucide.dev/lucide-logo-repo-dark.svg#gh-dark-mode-only" alt="Lucide - Beautiful & consistent icon toolkit made by the community. Open-source project and a fork of Feather Icons." width="480">
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/lucide-icons/lucide/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/lucide" alt="license"></a>
|
<a href="https://github.com/lucide-icons/lucide/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/lucide" alt="license"></a>
|
||||||
<a href="https://www.npmjs.com/package/lucide"><img src="https://img.shields.io/npm/v/lucide" alt="npm package"></a>
|
<a href="https://www.npmjs.com/package/lucide"><img src="https://img.shields.io/npm/v/lucide" alt="npm package"></a>
|
||||||
@@ -274,9 +281,12 @@ Thank you to all the people who contributed to Lucide!
|
|||||||
|
|
||||||
## Sponsors
|
## Sponsors
|
||||||
|
|
||||||
|
|
||||||
<a href="https://vercel.com?utm_source=lucide&utm_campaign=oss">
|
<a href="https://vercel.com?utm_source=lucide&utm_campaign=oss">
|
||||||
<img src="docs/public/vercel.svg" alt="Powered by Vercel" width="200" />
|
<img src="docs/public/vercel.svg" alt="Powered by Vercel" width="200" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="https://www.digitalocean.com/?refcode=b0877a2caebd&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge"><img src="docs/public/digitalocean.svg" width="200" alt="DigitalOcean Referral Badge" /></a>
|
<a href="https://www.digitalocean.com/?refcode=b0877a2caebd&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge"><img src="docs/public/digitalocean.svg" width="200" alt="DigitalOcean Referral Badge" /></a>
|
||||||
|
|
||||||
|
### Awesome backer 🍺
|
||||||
|
|
||||||
|
<a href="https://www.scipress.io?utm_source=lucide"><img src="docs/public/sponsors/scipress.svg" width="180" alt="Scipress sponsor badge" /></a>
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Accessibility",
|
"title": "Accessibility",
|
||||||
"icon": "accessibility"
|
"icon": "accessibility"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Accounts & access",
|
"title": "Accounts & access",
|
||||||
"icon": "user"
|
"icon": "user"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Animals",
|
"title": "Animals",
|
||||||
"icon": "dog"
|
"icon": "dog"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Arrows",
|
"title": "Arrows",
|
||||||
"icon": "arrow-left-right"
|
"icon": "arrow-left-right"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Brands",
|
"title": "Brands",
|
||||||
"icon": "facebook"
|
"icon": "facebook"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Buildings",
|
"title": "Buildings",
|
||||||
"icon": "building"
|
"icon": "building"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Charts",
|
"title": "Charts",
|
||||||
"icon": "pie-chart"
|
"icon": "chart-pie"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Communication",
|
"title": "Communication",
|
||||||
"icon": "message-circle"
|
"icon": "message-circle"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Connectivity",
|
"title": "Connectivity",
|
||||||
"icon": "wifi"
|
"icon": "wifi"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Currency",
|
"title": "Currency",
|
||||||
"icon": "dollar-sign"
|
"icon": "dollar-sign"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Cursors",
|
"title": "Cursors",
|
||||||
"icon": "mouse-pointer-2"
|
"icon": "mouse-pointer-2"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Design",
|
"title": "Design",
|
||||||
"icon": "palette"
|
"icon": "palette"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Coding & development",
|
"title": "Coding & development",
|
||||||
"icon": "code-2"
|
"icon": "code-xml"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Devices",
|
"title": "Devices",
|
||||||
"icon": "smartphone"
|
"icon": "smartphone"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Emoji",
|
"title": "Emoji",
|
||||||
"icon": "smile"
|
"icon": "smile"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "File icons",
|
"title": "File icons",
|
||||||
"icon": "panels-top-left"
|
"icon": "panels-top-left"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Food & beverage",
|
"title": "Food & beverage",
|
||||||
"icon": "coffee"
|
"icon": "coffee"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Furniture",
|
"title": "Furniture",
|
||||||
"icon": "rocking-chair"
|
"icon": "rocking-chair"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Gaming",
|
"title": "Gaming",
|
||||||
"icon": "gamepad-2"
|
"icon": "gamepad-2"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Home",
|
"title": "Home",
|
||||||
"icon": "home"
|
"icon": "house"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Layout",
|
"title": "Layout",
|
||||||
"icon": "panels-top-left"
|
"icon": "panels-top-left"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Mail",
|
"title": "Mail",
|
||||||
"icon": "mail"
|
"icon": "mail"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Maps",
|
"title": "Maps",
|
||||||
"icon": "map"
|
"icon": "map"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Maths",
|
"title": "Maths",
|
||||||
"icon": "divide"
|
"icon": "divide"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Medical",
|
"title": "Medical",
|
||||||
"icon": "heart"
|
"icon": "heart"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Money",
|
"title": "Money",
|
||||||
"icon": "piggy-bank"
|
"icon": "piggy-bank"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Multimedia",
|
"title": "Multimedia",
|
||||||
"icon": "play-circle"
|
"icon": "circle-play"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Nature",
|
"title": "Nature",
|
||||||
"icon": "sprout"
|
"icon": "sprout"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Navigation",
|
"title": "Navigation",
|
||||||
"icon": "compass"
|
"icon": "compass"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Notifications",
|
"title": "Notifications",
|
||||||
"icon": "alert-triangle"
|
"icon": "triangle-alert"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "People",
|
"title": "People",
|
||||||
"icon": "person-standing"
|
"icon": "person-standing"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Photography",
|
"title": "Photography",
|
||||||
"icon": "camera"
|
"icon": "camera"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Science",
|
"title": "Science",
|
||||||
"icon": "flask-conical"
|
"icon": "flask-conical"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Seasons",
|
"title": "Seasons",
|
||||||
"icon": "leaf"
|
"icon": "leaf"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Security",
|
"title": "Security",
|
||||||
"icon": "shield"
|
"icon": "shield"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Shapes",
|
"title": "Shapes",
|
||||||
"icon": "triangle"
|
"icon": "triangle"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Shopping",
|
"title": "Shopping",
|
||||||
"icon": "shopping-bag"
|
"icon": "shopping-bag"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Social",
|
"title": "Social",
|
||||||
"icon": "thumbs-up"
|
"icon": "thumbs-up"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Sports",
|
"title": "Sports",
|
||||||
"icon": "type"
|
"icon": "type"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Sustainability",
|
"title": "Sustainability",
|
||||||
"icon": "recycle"
|
"icon": "recycle"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Time & calendar",
|
"title": "Time & calendar",
|
||||||
"icon": "calendar"
|
"icon": "calendar"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Tools",
|
"title": "Tools",
|
||||||
"icon": "hammer"
|
"icon": "hammer"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Transportation",
|
"title": "Transportation",
|
||||||
"icon": "train-front"
|
"icon": "train-front"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Travel",
|
"title": "Travel",
|
||||||
"icon": "backpack"
|
"icon": "backpack"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,4 @@
|
|||||||
"$schema": "../category.schema.json",
|
"$schema": "../category.schema.json",
|
||||||
"title": "Weather",
|
"title": "Weather",
|
||||||
"icon": "cloud-sun"
|
"icon": "cloud-sun"
|
||||||
}
|
}
|
||||||
|
|||||||
10
cspell.json
Normal file
10
cspell.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"dictionaries": ["en-us", "custom-words"],
|
||||||
|
"dictionaryDefinitions": [
|
||||||
|
{
|
||||||
|
"name": "custom-words",
|
||||||
|
"path": "./.cspell/custom-words.txt",
|
||||||
|
"addWords": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
import { eventHandler, setResponseHeader } from 'h3'
|
import iconMetaData from '../../data/iconMetaData';
|
||||||
import iconMetaData from '../../data/iconMetaData'
|
|
||||||
|
|
||||||
export default eventHandler((event) => {
|
export default eventHandler((event) => {
|
||||||
setResponseHeader(event, 'Cache-Control', 'public, max-age=86400')
|
setResponseHeader(event, 'Cache-Control', 'public, max-age=86400');
|
||||||
setResponseHeader(event, 'Access-Control-Allow-Origin', '*')
|
setResponseHeader(event, 'Access-Control-Allow-Origin', '*');
|
||||||
|
|
||||||
return Object.fromEntries(
|
return Object.fromEntries(
|
||||||
Object.entries(iconMetaData).map(([name, { categories }]) => [ name, categories ])
|
Object.entries(iconMetaData).map(([name, { categories }]) => [name, categories]),
|
||||||
)
|
);
|
||||||
})
|
});
|
||||||
|
|||||||
40
docs/.vitepress/api/figma/data.ts
Normal file
40
docs/.vitepress/api/figma/data.ts
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
import iconNodes from '../../data/iconNodes/index.ts';
|
||||||
|
import { IconNodeWithKeys } from '../../theme/types';
|
||||||
|
import iconMetaData from '../../data/iconMetaData';
|
||||||
|
import releaseMeta from '../../data/releaseMetaData.json';
|
||||||
|
import categories from '../../data/categoriesData.json';
|
||||||
|
|
||||||
|
const dataResponse = {
|
||||||
|
icons: Object.entries(iconNodes).reduce((acc, [name, iconNode]) => {
|
||||||
|
const newIconNode = (iconNode as IconNodeWithKeys).map(([name, { key, ...attrs }]) => {
|
||||||
|
return [name, attrs];
|
||||||
|
});
|
||||||
|
|
||||||
|
acc[name] = {
|
||||||
|
iconNode: newIconNode,
|
||||||
|
aliases: (iconMetaData[name]?.aliases ?? []).map((alias) =>
|
||||||
|
typeof alias === 'string' ? alias : alias.name,
|
||||||
|
),
|
||||||
|
tags: iconMetaData[name].tags ?? [],
|
||||||
|
categories: iconMetaData[name].categories ?? [],
|
||||||
|
...releaseMeta[name],
|
||||||
|
};
|
||||||
|
|
||||||
|
return acc;
|
||||||
|
}, {}),
|
||||||
|
aliases: Object.entries(iconNodes).reduce((acc, [name]) => {
|
||||||
|
for (const alias of iconMetaData[name]?.aliases ?? []) {
|
||||||
|
acc[typeof alias === 'string' ? alias : alias.name] = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
return acc;
|
||||||
|
}, {}),
|
||||||
|
categories,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default eventHandler((event) => {
|
||||||
|
setResponseHeader(event, 'Cache-Control', 'public, max-age=86400');
|
||||||
|
setResponseHeader(event, 'Access-Control-Allow-Origin', '*');
|
||||||
|
|
||||||
|
return dataResponse;
|
||||||
|
});
|
||||||
@@ -13,7 +13,10 @@ export default eventHandler((event) => {
|
|||||||
const data = pathData.at(-1).slice(0, -4);
|
const data = pathData.at(-1).slice(0, -4);
|
||||||
const [name] = pathData;
|
const [name] = pathData;
|
||||||
|
|
||||||
const src = Buffer.from(data, 'base64').toString('utf8');
|
const src = Buffer.from(data, 'base64')
|
||||||
|
.toString('utf8')
|
||||||
|
.replaceAll('\n', '')
|
||||||
|
.replace(/<svg[^>]*>|<\/svg>/g, '');
|
||||||
|
|
||||||
const children = [];
|
const children = [];
|
||||||
|
|
||||||
@@ -25,25 +28,25 @@ export default eventHandler((event) => {
|
|||||||
.map((_, idx, arr) => arr.slice(0, idx + 1).join('-'))
|
.map((_, idx, arr) => arr.slice(0, idx + 1).join('-'))
|
||||||
.reverse()
|
.reverse()
|
||||||
.find((groupName) => groupName in iconNodes);
|
.find((groupName) => groupName in iconNodes);
|
||||||
if (backdropName) {
|
if (!(name in iconNodes) && backdropName) {
|
||||||
const iconNode = iconNodes[backdropName];
|
const iconNode = iconNodes[backdropName];
|
||||||
|
|
||||||
const LucideIcon = createLucideIcon(backdropName, iconNode);
|
const LucideIcon = createLucideIcon(backdropName, iconNode);
|
||||||
const svg = renderToStaticMarkup(createElement(LucideIcon));
|
const svg = renderToStaticMarkup(createElement(LucideIcon));
|
||||||
const backdropString = svg.replace(/<svg[^>]*>|<\/svg>/g, '');
|
const backdropString = svg.replaceAll('\n', '').replace(/<svg[^>]*>|<\/svg>/g, '');
|
||||||
|
|
||||||
children.push(
|
children.push(
|
||||||
createElement(Backdrop, {
|
createElement(Backdrop, {
|
||||||
backdropString,
|
backdropString,
|
||||||
src,
|
src,
|
||||||
color: name in iconNodes ? 'red' : '#777',
|
color: '#777',
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const svg = Buffer.from(
|
const svg = Buffer.from(
|
||||||
// We can't use jsx here, is not supported here by nitro.
|
// We can't use jsx here, is not supported here by nitro.
|
||||||
renderToString(createElement(SvgPreview, { src, showGrid: true }, children))
|
renderToString(createElement(SvgPreview, { src, showGrid: true }, children)),
|
||||||
).toString('utf8');
|
).toString('utf8');
|
||||||
|
|
||||||
defaultContentType(event, 'image/svg+xml');
|
defaultContentType(event, 'image/svg+xml');
|
||||||
|
|||||||
37
docs/.vitepress/api/gh-icon/diff/[...data].get.ts
Normal file
37
docs/.vitepress/api/gh-icon/diff/[...data].get.ts
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import { eventHandler, setResponseHeader, defaultContentType } from 'h3';
|
||||||
|
import { renderToString, renderToStaticMarkup } from 'react-dom/server';
|
||||||
|
import { createElement } from 'react';
|
||||||
|
import Diff from '../../../lib/SvgPreview/Diff.tsx';
|
||||||
|
import iconNodes from '../../../data/iconNodes';
|
||||||
|
import createLucideIcon from 'lucide-react/src/createLucideIcon';
|
||||||
|
|
||||||
|
export default eventHandler((event) => {
|
||||||
|
const { params } = event.context;
|
||||||
|
|
||||||
|
const pathData = params.data.split('/');
|
||||||
|
const data = pathData.at(-1).slice(0, -4);
|
||||||
|
const [name] = pathData;
|
||||||
|
|
||||||
|
const newSrc = Buffer.from(data, 'base64')
|
||||||
|
.toString('utf8')
|
||||||
|
.replaceAll('\n', '')
|
||||||
|
.replace(/<svg[^>]*>|<\/svg>/g, '');
|
||||||
|
|
||||||
|
const children = [];
|
||||||
|
|
||||||
|
const oldSrc = iconNodes[name]
|
||||||
|
? renderToStaticMarkup(createElement(createLucideIcon(name, iconNodes[name])))
|
||||||
|
.replaceAll('\n', '')
|
||||||
|
.replace(/<svg[^>]*>|<\/svg>/g, '')
|
||||||
|
: '';
|
||||||
|
|
||||||
|
const svg = Buffer.from(
|
||||||
|
// We can't use jsx here, is not supported here by nitro.
|
||||||
|
renderToString(createElement(Diff, { oldSrc, newSrc, showGrid: true }, children)),
|
||||||
|
).toString('utf8');
|
||||||
|
|
||||||
|
defaultContentType(event, 'image/svg+xml');
|
||||||
|
setResponseHeader(event, 'Cache-Control', 'public,max-age=31536000');
|
||||||
|
|
||||||
|
return svg;
|
||||||
|
});
|
||||||
@@ -28,7 +28,7 @@ export default eventHandler(async (event) => {
|
|||||||
stroke-width="2"
|
stroke-width="2"
|
||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
`
|
`,
|
||||||
);
|
);
|
||||||
|
|
||||||
const resvg = new Resvg(svg, { background: '#000' });
|
const resvg = new Resvg(svg, { background: '#000' });
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { eventHandler, setResponseHeader, defaultContentType } from 'h3'
|
import { eventHandler, setResponseHeader, defaultContentType } from 'h3';
|
||||||
import { renderToString } from 'react-dom/server'
|
import { renderToString } from 'react-dom/server';
|
||||||
import { createElement } from 'react'
|
import { createElement } from 'react';
|
||||||
import SvgPreview from '../../../lib/SvgPreview/index.tsx';
|
import SvgPreview from '../../../lib/SvgPreview/index.tsx';
|
||||||
import createLucideIcon, { IconNode } from 'lucide-react/src/createLucideIcon'
|
import createLucideIcon, { IconNode } from 'lucide-react/src/createLucideIcon';
|
||||||
import { parseSync } from 'svgson';
|
import { parseSync } from 'svgson';
|
||||||
|
|
||||||
export default eventHandler((event) => {
|
export default eventHandler((event) => {
|
||||||
const { params } = event.context
|
const { params } = event.context;
|
||||||
|
|
||||||
const [strokeWidth, svgData] = params.data.split('/');
|
const [strokeWidth, svgData] = params.data.split('/');
|
||||||
const data = svgData.slice(0, -4);
|
const data = svgData.slice(0, -4);
|
||||||
@@ -16,8 +16,8 @@ export default eventHandler((event) => {
|
|||||||
const Icon = createLucideIcon(
|
const Icon = createLucideIcon(
|
||||||
'icon',
|
'icon',
|
||||||
parseSync(src.includes('<svg') ? src : `<svg>${src}</svg>`).children.map(
|
parseSync(src.includes('<svg') ? src : `<svg>${src}</svg>`).children.map(
|
||||||
({ name, attributes }) => [name, attributes]
|
({ name, attributes }) => [name, attributes],
|
||||||
) as IconNode
|
) as IconNode,
|
||||||
);
|
);
|
||||||
|
|
||||||
const svg = Buffer.from(
|
const svg = Buffer.from(
|
||||||
@@ -33,12 +33,12 @@ export default eventHandler((event) => {
|
|||||||
@media screen and (prefers-color-scheme: dark) {
|
@media screen and (prefers-color-scheme: dark) {
|
||||||
svg { stroke: #fff; fill: transparent !important; }
|
svg { stroke: #fff; fill: transparent !important; }
|
||||||
}
|
}
|
||||||
</style>`
|
</style>`,
|
||||||
)
|
),
|
||||||
).toString('utf8');
|
).toString('utf8');
|
||||||
|
|
||||||
defaultContentType(event, 'image/svg+xml')
|
defaultContentType(event, 'image/svg+xml');
|
||||||
setResponseHeader(event, 'Cache-Control', 'public,max-age=31536000')
|
setResponseHeader(event, 'Cache-Control', 'public,max-age=31536000');
|
||||||
|
|
||||||
return svg
|
return svg;
|
||||||
})
|
});
|
||||||
|
|||||||
@@ -1,30 +1,30 @@
|
|||||||
import { eventHandler, getQuery, setResponseHeader } from 'h3'
|
import { eventHandler, getQuery, setResponseHeader } from 'h3';
|
||||||
import iconNodes from '../../data/iconNodes'
|
import iconNodes from '../../data/iconNodes';
|
||||||
import { IconNodeWithKeys } from '../../theme/types'
|
import { IconNodeWithKeys } from '../../theme/types';
|
||||||
|
|
||||||
export default eventHandler((event) => {
|
export default eventHandler((event) => {
|
||||||
const query = getQuery(event)
|
const query = getQuery(event);
|
||||||
|
|
||||||
const withUniqueKeys = query.withUniqueKeys === 'true'
|
const withUniqueKeys = query.withUniqueKeys === 'true';
|
||||||
|
|
||||||
setResponseHeader(event, 'Cache-Control', 'public, max-age=86400')
|
setResponseHeader(event, 'Cache-Control', 'public, max-age=86400');
|
||||||
setResponseHeader(event, 'Access-Control-Allow-Origin', '*')
|
setResponseHeader(event, 'Access-Control-Allow-Origin', '*');
|
||||||
|
|
||||||
if (withUniqueKeys) {
|
if (withUniqueKeys) {
|
||||||
return iconNodes
|
return iconNodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Object.entries(iconNodes).reduce((acc, [name, iconNode]) => {
|
return Object.entries(iconNodes).reduce((acc, [name, iconNode]) => {
|
||||||
if (withUniqueKeys) {
|
if (withUniqueKeys) {
|
||||||
return [name, iconNode]
|
return [name, iconNode];
|
||||||
}
|
}
|
||||||
|
|
||||||
const newIconNode = (iconNode as IconNodeWithKeys).map(([name, { key, ...attrs}]) => {
|
const newIconNode = (iconNode as IconNodeWithKeys).map(([name, { key, ...attrs }]) => {
|
||||||
return [name, attrs]
|
return [name, attrs];
|
||||||
})
|
});
|
||||||
|
|
||||||
acc[name] = newIconNode
|
acc[name] = newIconNode;
|
||||||
|
|
||||||
return acc
|
return acc;
|
||||||
}, {})
|
}, {});
|
||||||
})
|
});
|
||||||
|
|||||||
@@ -1,29 +1,29 @@
|
|||||||
import { eventHandler, getQuery, setResponseHeader, createError } from 'h3'
|
import { eventHandler, getQuery, setResponseHeader, createError } from 'h3';
|
||||||
import iconNodes from '../../data/iconNodes'
|
import iconNodes from '../../data/iconNodes';
|
||||||
import createLucideIcon from 'lucide-react/src/createLucideIcon'
|
import createLucideIcon from 'lucide-react/src/createLucideIcon';
|
||||||
import { renderToString } from 'react-dom/server'
|
import { renderToString } from 'react-dom/server';
|
||||||
import { createElement } from 'react'
|
import { createElement } from 'react';
|
||||||
|
|
||||||
export default eventHandler((event) => {
|
export default eventHandler((event) => {
|
||||||
const { params } = event.context
|
const { params } = event.context;
|
||||||
|
|
||||||
const iconNode = iconNodes[params.iconName]
|
const iconNode = iconNodes[params.iconName];
|
||||||
|
|
||||||
if (iconNode == null) {
|
if (iconNode == null) {
|
||||||
const error = createError({
|
const error = createError({
|
||||||
statusCode: 404,
|
statusCode: 404,
|
||||||
message: `Icon "${params.iconName}" not found`,
|
message: `Icon "${params.iconName}" not found`,
|
||||||
})
|
});
|
||||||
|
|
||||||
return sendError(event, error)
|
return sendError(event, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
const width = getQuery(event).width || undefined
|
const width = getQuery(event).width || undefined;
|
||||||
const height = getQuery(event).height || undefined
|
const height = getQuery(event).height || undefined;
|
||||||
const color = getQuery(event).color || undefined
|
const color = getQuery(event).color || undefined;
|
||||||
const strokeWidth = getQuery(event).strokeWidth || undefined
|
const strokeWidth = getQuery(event).strokeWidth || undefined;
|
||||||
|
|
||||||
const LucideIcon = createLucideIcon(params.iconName, iconNode)
|
const LucideIcon = createLucideIcon(params.iconName, iconNode);
|
||||||
|
|
||||||
const svg = Buffer.from(
|
const svg = Buffer.from(
|
||||||
renderToString(
|
renderToString(
|
||||||
@@ -32,14 +32,13 @@ export default eventHandler((event) => {
|
|||||||
height,
|
height,
|
||||||
color: color ? `#${color}` : undefined,
|
color: color ? `#${color}` : undefined,
|
||||||
strokeWidth,
|
strokeWidth,
|
||||||
}
|
}),
|
||||||
))
|
),
|
||||||
).toString('utf8');
|
).toString('utf8');
|
||||||
|
|
||||||
defaultContentType(event, 'image/svg+xml')
|
defaultContentType(event, 'image/svg+xml');
|
||||||
setResponseHeader(event, 'Cache-Control', 'public,max-age=31536000')
|
setResponseHeader(event, 'Cache-Control', 'public,max-age=31536000');
|
||||||
setResponseHeader(event, 'Access-Control-Allow-Origin', '*')
|
setResponseHeader(event, 'Access-Control-Allow-Origin', '*');
|
||||||
|
|
||||||
return svg
|
return svg;
|
||||||
|
});
|
||||||
})
|
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
import { eventHandler, setResponseHeader } from 'h3'
|
import iconMetaData from '../../data/iconMetaData';
|
||||||
import iconMetaData from '../../data/iconMetaData'
|
|
||||||
|
|
||||||
export default eventHandler((event) => {
|
export default eventHandler((event) => {
|
||||||
setResponseHeader(event, 'Cache-Control', 'public, max-age=86400')
|
setResponseHeader(event, 'Cache-Control', 'public, max-age=86400');
|
||||||
setResponseHeader(event, 'Access-Control-Allow-Origin', '*')
|
setResponseHeader(event, 'Access-Control-Allow-Origin', '*');
|
||||||
|
|
||||||
return Object.fromEntries(
|
return Object.fromEntries(Object.entries(iconMetaData).map(([name, { tags }]) => [name, tags]));
|
||||||
Object.entries(iconMetaData).map(([name, { tags }]) => [ name, tags ])
|
});
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default eventHandler(() => {
|
export default eventHandler(() => {
|
||||||
return { nitro: 'Is Awesome! asda' }
|
return { nitro: 'Is Awesome! asda' };
|
||||||
})
|
});
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { fileURLToPath, URL } from 'node:url'
|
import { fileURLToPath, URL } from 'node:url';
|
||||||
import { defineConfig } from 'vitepress'
|
import { defineConfig } from 'vitepress';
|
||||||
import sidebar from './sidebar';
|
import sidebar from './sidebar';
|
||||||
|
|
||||||
const title = "Lucide";
|
const title = 'Lucide';
|
||||||
const socialTitle = "Lucide Icons";
|
const socialTitle = 'Lucide Icons';
|
||||||
const description = "Beautiful & consistent icon toolkit made by the community."
|
const description = 'Beautiful & consistent icon toolkit made by the community.';
|
||||||
|
|
||||||
// https://vitepress.dev/reference/site-config
|
// https://vitepress.dev/reference/site-config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
@@ -19,86 +19,135 @@ export default defineConfig({
|
|||||||
{
|
{
|
||||||
find: /^.*\/VPIconAlignLeft\.vue$/,
|
find: /^.*\/VPIconAlignLeft\.vue$/,
|
||||||
replacement: fileURLToPath(
|
replacement: fileURLToPath(
|
||||||
new URL('./theme/components/overrides/VPIconAlignLeft.vue', import.meta.url)
|
new URL('./theme/components/overrides/VPIconAlignLeft.vue', import.meta.url),
|
||||||
)
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: /^.*\/VPFooter\.vue$/,
|
find: /^.*\/VPFooter\.vue$/,
|
||||||
replacement: fileURLToPath(
|
replacement: fileURLToPath(
|
||||||
new URL('./theme/components/overrides/VPFooter.vue', import.meta.url)
|
new URL('./theme/components/overrides/VPFooter.vue', import.meta.url),
|
||||||
)
|
),
|
||||||
}
|
},
|
||||||
]
|
{
|
||||||
|
find: '~/.vitepress',
|
||||||
|
replacement: fileURLToPath(new URL('./', import.meta.url)),
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
head: [
|
head: [
|
||||||
[ 'script', {
|
[
|
||||||
src: 'https://analytics.lucide.dev/js/script.js',
|
'script',
|
||||||
'data-domain': 'lucide.dev',
|
{
|
||||||
defer: ''
|
src: 'https://analytics.lucide.dev/js/script.js',
|
||||||
}],
|
'data-domain': 'lucide.dev',
|
||||||
[ 'meta', {
|
defer: '',
|
||||||
property:"og:locale",
|
},
|
||||||
content:"en_US"
|
],
|
||||||
}],
|
[
|
||||||
[ 'meta', {
|
'meta',
|
||||||
property:"og:type",
|
{
|
||||||
content:"website"
|
property: 'og:locale',
|
||||||
}],
|
content: 'en_US',
|
||||||
[ 'meta', {
|
},
|
||||||
property:"og:site_name",
|
],
|
||||||
content: title,
|
[
|
||||||
}],
|
'meta',
|
||||||
[ 'meta', {
|
{
|
||||||
property:"og:title",
|
property: 'og:type',
|
||||||
content: socialTitle,
|
content: 'website',
|
||||||
}],
|
},
|
||||||
[ 'meta', {
|
],
|
||||||
property:"og:description",
|
[
|
||||||
content: description
|
'meta',
|
||||||
}],
|
{
|
||||||
[ 'meta', {
|
property: 'og:site_name',
|
||||||
property:"og:url",
|
content: title,
|
||||||
content:"https://lucide.dev"
|
},
|
||||||
}],
|
],
|
||||||
[ 'meta', {
|
[
|
||||||
property:"og:image",
|
'meta',
|
||||||
content: "https://lucide.dev/og.png"
|
{
|
||||||
}],
|
property: 'og:title',
|
||||||
[ 'meta', {
|
content: socialTitle,
|
||||||
property:"og:image:width",
|
},
|
||||||
content:"1200"
|
],
|
||||||
}],
|
[
|
||||||
[ 'meta', {
|
'meta',
|
||||||
property:"og:image:height",
|
{
|
||||||
content:"630"
|
property: 'og:description',
|
||||||
}],
|
content: description,
|
||||||
[ 'meta', {
|
},
|
||||||
property:"og:image:type",
|
],
|
||||||
content:"image/png"
|
[
|
||||||
}],
|
'meta',
|
||||||
[ 'meta', {
|
{
|
||||||
property:"twitter:card",
|
property: 'og:url',
|
||||||
content:"summary_large_image"
|
content: 'https://lucide.dev',
|
||||||
}],
|
},
|
||||||
[ 'meta', {
|
],
|
||||||
property:"twitter:title",
|
[
|
||||||
content: socialTitle,
|
'meta',
|
||||||
}],
|
{
|
||||||
[ 'meta', {
|
property: 'og:image',
|
||||||
property:"twitter:description",
|
content: 'https://lucide.dev/og.png',
|
||||||
content: description
|
},
|
||||||
}],
|
],
|
||||||
[ 'meta', {
|
[
|
||||||
property:"twitter:image",
|
'meta',
|
||||||
content:"https://lucide.dev/og.png"
|
{
|
||||||
}],
|
property: 'og:image:width',
|
||||||
|
content: '1200',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'meta',
|
||||||
|
{
|
||||||
|
property: 'og:image:height',
|
||||||
|
content: '630',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'meta',
|
||||||
|
{
|
||||||
|
property: 'og:image:type',
|
||||||
|
content: 'image/png',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'meta',
|
||||||
|
{
|
||||||
|
property: 'twitter:card',
|
||||||
|
content: 'summary_large_image',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'meta',
|
||||||
|
{
|
||||||
|
property: 'twitter:title',
|
||||||
|
content: socialTitle,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'meta',
|
||||||
|
{
|
||||||
|
property: 'twitter:description',
|
||||||
|
content: description,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'meta',
|
||||||
|
{
|
||||||
|
property: 'twitter:image',
|
||||||
|
content: 'https://lucide.dev/og.png',
|
||||||
|
},
|
||||||
|
],
|
||||||
],
|
],
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
// https://vitepress.dev/reference/default-theme-config
|
// https://vitepress.dev/reference/default-theme-config
|
||||||
logo: {
|
logo: {
|
||||||
light: '/logo.light.svg',
|
light: '/logo.light.svg',
|
||||||
dark: '/logo.dark.svg'
|
dark: '/logo.dark.svg',
|
||||||
},
|
},
|
||||||
nav: [
|
nav: [
|
||||||
{ text: 'Icons', link: '/icons/' },
|
{ text: 'Icons', link: '/icons/' },
|
||||||
@@ -110,21 +159,21 @@ export default defineConfig({
|
|||||||
sidebar,
|
sidebar,
|
||||||
socialLinks: [
|
socialLinks: [
|
||||||
{ icon: 'github', link: 'https://github.com/lucide-icons/lucide' },
|
{ icon: 'github', link: 'https://github.com/lucide-icons/lucide' },
|
||||||
{ icon: 'discord', link: 'https://discord.gg/EH6nSts' }
|
{ icon: 'discord', link: 'https://discord.gg/EH6nSts' },
|
||||||
],
|
],
|
||||||
footer: {
|
footer: {
|
||||||
message: 'Released under the ISC License.',
|
message: 'Released under the ISC License.',
|
||||||
copyright: `Copyright © ${new Date().getFullYear()} Lucide Contributors`
|
copyright: `Copyright © ${new Date().getFullYear()} Lucide Contributors`,
|
||||||
},
|
},
|
||||||
editLink: {
|
editLink: {
|
||||||
pattern: 'https://github.com/lucide-icons/lucide/edit/main/docs/:path'
|
pattern: 'https://github.com/lucide-icons/lucide/edit/main/docs/:path',
|
||||||
},
|
},
|
||||||
carbonAds: {
|
carbonAds: {
|
||||||
code: 'CWYIC53U',
|
code: 'CWYIC53U',
|
||||||
placement: 'lucidedev'
|
placement: 'lucidedev',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
sitemap: {
|
sitemap: {
|
||||||
hostname: 'https://lucide.dev/'
|
hostname: 'https://lucide.dev/',
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
|||||||
186
docs/.vitepress/data/categoriesData.json
Normal file
186
docs/.vitepress/data/categoriesData.json
Normal file
@@ -0,0 +1,186 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "accessibility",
|
||||||
|
"title": "Accessibility"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "account",
|
||||||
|
"title": "Accounts & access"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "animals",
|
||||||
|
"title": "Animals"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "arrows",
|
||||||
|
"title": "Arrows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "brands",
|
||||||
|
"title": "Brands"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "buildings",
|
||||||
|
"title": "Buildings"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "charts",
|
||||||
|
"title": "Charts"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "communication",
|
||||||
|
"title": "Communication"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "connectivity",
|
||||||
|
"title": "Connectivity"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "currency",
|
||||||
|
"title": "Currency"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "cursors",
|
||||||
|
"title": "Cursors"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "design",
|
||||||
|
"title": "Design"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "development",
|
||||||
|
"title": "Coding & development"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "devices",
|
||||||
|
"title": "Devices"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "emoji",
|
||||||
|
"title": "Emoji"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "files",
|
||||||
|
"title": "File icons"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "food-beverage",
|
||||||
|
"title": "Food & beverage"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "furniture",
|
||||||
|
"title": "Furniture"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gaming",
|
||||||
|
"title": "Gaming"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "home",
|
||||||
|
"title": "Home"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "layout",
|
||||||
|
"title": "Layout"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mail",
|
||||||
|
"title": "Mail"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "maps",
|
||||||
|
"title": "Maps"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "maths",
|
||||||
|
"title": "Maths"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "medical",
|
||||||
|
"title": "Medical"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "money",
|
||||||
|
"title": "Money"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "multimedia",
|
||||||
|
"title": "Multimedia"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "nature",
|
||||||
|
"title": "Nature"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "navigation",
|
||||||
|
"title": "Navigation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "notifications",
|
||||||
|
"title": "Notifications"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "people",
|
||||||
|
"title": "People"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "photography",
|
||||||
|
"title": "Photography"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "science",
|
||||||
|
"title": "Science"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "seasons",
|
||||||
|
"title": "Seasons"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "security",
|
||||||
|
"title": "Security"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "shapes",
|
||||||
|
"title": "Shapes"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "shopping",
|
||||||
|
"title": "Shopping"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "social",
|
||||||
|
"title": "Social"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sports",
|
||||||
|
"title": "Sports"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sustainability",
|
||||||
|
"title": "Sustainability"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "text",
|
||||||
|
"title": "Text formatting"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "time",
|
||||||
|
"title": "Time & calendar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "tools",
|
||||||
|
"title": "Tools"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "transportation",
|
||||||
|
"title": "Transportation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "travel",
|
||||||
|
"title": "Travel"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "weather",
|
||||||
|
"title": "Weather"
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -3,87 +3,160 @@
|
|||||||
"order": 0,
|
"order": 0,
|
||||||
"icon": "js",
|
"icon": "js",
|
||||||
"shields": [
|
"shields": [
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/v/lucide", "href": "https://www.npmjs.com/package/lucide" },
|
{
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/dw/lucide", "href": "https://www.npmjs.com/package/lucide" }
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/v/lucide",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/dw/lucide",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"lucide-react": {
|
"lucide-react": {
|
||||||
"order": 1,
|
"order": 1,
|
||||||
"icon": "react",
|
"icon": "react",
|
||||||
"shields": [
|
"shields": [
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/v/lucide-react", "href": "https://www.npmjs.com/package/lucide-react" },
|
{
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/dw/lucide-react", "href": "https://www.npmjs.com/package/lucide-react" }
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/v/lucide-react",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide-react"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/dw/lucide-react",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide-react"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"lucide-vue": {
|
"lucide-vue": {
|
||||||
"order": 2,
|
"order": 2,
|
||||||
"icon": "vue",
|
"icon": "vue",
|
||||||
"shields": [
|
"shields": [
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/v/lucide-vue", "href": "https://www.npmjs.com/package/lucide-vue" },
|
{
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/dw/lucide-vue", "href": "https://www.npmjs.com/package/lucide-vue" }
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/v/lucide-vue",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide-vue"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/dw/lucide-vue",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide-vue"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"lucide-vue-next": {
|
"lucide-vue-next": {
|
||||||
"order": 3,
|
"order": 3,
|
||||||
"icon": "vue-next",
|
"icon": "vue-next",
|
||||||
"shields": [
|
"shields": [
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/v/lucide-vue-next", "href": "https://www.npmjs.com/package/lucide-vue-next" },
|
{
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/dw/lucide-vue-next", "href": "https://www.npmjs.com/package/lucide-vue-next" }
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/v/lucide-vue-next",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide-vue-next"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/dw/lucide-vue-next",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide-vue-next"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"lucide-svelte": {
|
"lucide-svelte": {
|
||||||
"order": 4,
|
"order": 4,
|
||||||
"icon": "svelte",
|
"icon": "svelte",
|
||||||
"shields": [
|
"shields": [
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/v/lucide-svelte", "href": "https://www.npmjs.com/package/lucide-svelte" },
|
{
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/dw/lucide-svelte", "href": "https://www.npmjs.com/package/lucide-svelte" }
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/v/lucide-svelte",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide-svelte"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/dw/lucide-svelte",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide-svelte"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"lucide-solid": {
|
"lucide-solid": {
|
||||||
"order": 4,
|
"order": 4,
|
||||||
"icon": "solid",
|
"icon": "solid",
|
||||||
"shields": [
|
"shields": [
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/v/lucide-solid", "href": "https://www.npmjs.com/package/lucide-solid" },
|
{
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/dw/lucide-solid", "href": "https://www.npmjs.com/package/lucide-solid" }
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/v/lucide-solid",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide-solid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/dw/lucide-solid",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide-solid"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"lucide-preact": {
|
"lucide-preact": {
|
||||||
"order": 5,
|
"order": 5,
|
||||||
"icon": "preact",
|
"icon": "preact",
|
||||||
"shields": [
|
"shields": [
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/v/lucide-preact", "href": "https://www.npmjs.com/package/lucide-preact" },
|
{
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/dw/lucide-preact", "href": "https://www.npmjs.com/package/lucide-preact" }
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/v/lucide-preact",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide-preact"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/dw/lucide-preact",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide-preact"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"lucide-react-native": {
|
"lucide-react-native": {
|
||||||
"order": 6,
|
"order": 6,
|
||||||
"icon": "react-native",
|
"icon": "react-native",
|
||||||
"shields": [
|
"shields": [
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/v/lucide-react-native", "href": "https://www.npmjs.com/package/lucide-react-native" },
|
{
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/dw/lucide-react-native", "href": "https://www.npmjs.com/package/lucide-react-native" }
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/v/lucide-react-native",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide-react-native"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/dw/lucide-react-native",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide-react-native"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"lucide-angular": {
|
"lucide-angular": {
|
||||||
"order": 7,
|
"order": 7,
|
||||||
"icon": "angular",
|
"icon": "angular",
|
||||||
"shields": [
|
"shields": [
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/v/lucide-angular", "href": "https://www.npmjs.com/package/lucide-angular" },
|
{
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/dw/lucide-angular", "href": "https://www.npmjs.com/package/lucide-angular" }
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/v/lucide-angular",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide-angular"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alt": "npm",
|
||||||
|
"src": "https://img.shields.io/npm/dw/lucide-angular",
|
||||||
|
"href": "https://www.npmjs.com/package/lucide-angular"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"lucide-static": {
|
"lucide-static": {
|
||||||
"order": 8,
|
"order": 8,
|
||||||
"icon": "svg",
|
"icon": "svg",
|
||||||
"shields": [
|
"shields": [
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/v/lucide-static", "href": "https://www.npmjs.com/package/lucide-static" },
|
{
|
||||||
{ "alt": "npm", "src": "https://img.shields.io/npm/dw/lucide-static", "href": "https://www.npmjs.com/package/lucide-static" }
|
"alt": "npm",
|
||||||
]
|
"src": "https://img.shields.io/npm/v/lucide-static",
|
||||||
},
|
"href": "https://www.npmjs.com/package/lucide-static"
|
||||||
"lucide-flutter": {
|
},
|
||||||
"order": 9,
|
{
|
||||||
"icon": "flutter",
|
"alt": "npm",
|
||||||
"shields": [
|
"src": "https://img.shields.io/npm/dw/lucide-static",
|
||||||
{ "alt": "flutter", "src": "https://img.shields.io/pub/v/lucide_icons", "href": "https://img.shields.io/pub/v/lucide_icons" }
|
"href": "https://www.npmjs.com/package/lucide-static"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,5 +76,24 @@
|
|||||||
],
|
],
|
||||||
"source": "https://github.com/swisnl/nuxt-lucide-icons",
|
"source": "https://github.com/swisnl/nuxt-lucide-icons",
|
||||||
"documentation": "https://github.com/swisnl/nuxt-lucide-icons/blob/main/README.md"
|
"documentation": "https://github.com/swisnl/nuxt-lucide-icons/blob/main/README.md"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "lucide-lustre",
|
||||||
|
"description": "A library providing https://lucide.dev icons to lustre",
|
||||||
|
"icon": "/framework-logos/lustre.webp",
|
||||||
|
"shields": [
|
||||||
|
{
|
||||||
|
"alt": "Latest Stable Version",
|
||||||
|
"src": "https://img.shields.io/hexpm/v/lucide_lustre",
|
||||||
|
"href": "https://hex.pm/packages/lucide_lustre"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alt": "Total Downloads",
|
||||||
|
"src": "https://img.shields.io/hexpm/dw/lucide_lustre",
|
||||||
|
"href": "https://hex.pm/packages/lucide_lustre"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": "https://github.com/dinkelspiel/lucide_lustre",
|
||||||
|
"documentation": "https://github.com/dinkelspiel/lucide_lustre/blob/master/README.md"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
48
docs/.vitepress/data/teamData.json
Normal file
48
docs/.vitepress/data/teamData.json
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "Eric Fennis",
|
||||||
|
"title": "Creator of Lucide & Software engineer @nedap",
|
||||||
|
"image": "https://github.com/ericfennis.png?size=192",
|
||||||
|
"sponsor": "https://github.com/sponsors/ericfennis",
|
||||||
|
"socialLinks": [
|
||||||
|
{
|
||||||
|
"icon": "github",
|
||||||
|
"link": "https://github.com/ericfennis"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon": "x",
|
||||||
|
"link": "https://x.com/ericfennis"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Karsa Rigó",
|
||||||
|
"title": "Maintainer of Lucide & Software engineer @sztaki",
|
||||||
|
"image": "https://github.com/karsa-mistmere.png?size=192",
|
||||||
|
"socialLinks": [
|
||||||
|
{
|
||||||
|
"icon": "github",
|
||||||
|
"link": "https://github.com/karsa-mistmere"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon": "linkedin",
|
||||||
|
"link": "https://www.linkedin.com/in/karsamistmere"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Jakob Guddas",
|
||||||
|
"title": "Maintainer of Lucide & Software engineer @LEGO",
|
||||||
|
"image": "https://github.com/jguddas.png?size=192",
|
||||||
|
"socialLinks": [
|
||||||
|
{
|
||||||
|
"icon": "github",
|
||||||
|
"link": "https://github.com/jguddas"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon": "linkedin",
|
||||||
|
"link": "https://www.linkedin.com/in/jguddas"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -3,55 +3,92 @@ import React from 'react';
|
|||||||
interface BackdropProps {
|
interface BackdropProps {
|
||||||
src: string;
|
src: string;
|
||||||
color?: string;
|
color?: string;
|
||||||
|
outline?: boolean;
|
||||||
backdropString: string;
|
backdropString: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Backdrop = ({ src, color = 'red', backdropString }: BackdropProps): JSX.Element => {
|
const Backdrop = ({
|
||||||
|
src,
|
||||||
|
color = 'red',
|
||||||
|
outline = true,
|
||||||
|
backdropString,
|
||||||
|
}: BackdropProps): JSX.Element => {
|
||||||
|
const id = React.useId();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<defs xmlns="http://www.w3.org/2000/svg">
|
<defs xmlns="http://www.w3.org/2000/svg">
|
||||||
<pattern
|
<pattern
|
||||||
id="pattern"
|
id={`pattern-${id}`}
|
||||||
width=".1"
|
width=".1"
|
||||||
height=".1"
|
height=".1"
|
||||||
patternUnits="userSpaceOnUse"
|
patternUnits="userSpaceOnUse"
|
||||||
patternTransform="rotate(45 50 50)"
|
patternTransform="rotate(45 50 50)"
|
||||||
>
|
>
|
||||||
<line stroke={color} strokeWidth={0.1} y2={1} />
|
<line
|
||||||
<line stroke={color} strokeWidth={0.1} y2={1} />
|
stroke={color}
|
||||||
|
strokeWidth={0.1}
|
||||||
|
y2={1}
|
||||||
|
/>
|
||||||
|
<line
|
||||||
|
stroke={color}
|
||||||
|
strokeWidth={0.1}
|
||||||
|
y2={1}
|
||||||
|
/>
|
||||||
</pattern>
|
</pattern>
|
||||||
</defs>
|
</defs>
|
||||||
<mask id="svg-preview-backdrop-mask-outline" maskUnits="userSpaceOnUse">
|
<mask
|
||||||
<g stroke="#fff" dangerouslySetInnerHTML={{ __html: backdropString }} />
|
id={`svg-preview-backdrop-mask-${id}`}
|
||||||
<g dangerouslySetInnerHTML={{ __html: src }} strokeWidth={2.05} />
|
maskUnits="userSpaceOnUse"
|
||||||
|
>
|
||||||
|
<g
|
||||||
|
stroke="#fff"
|
||||||
|
dangerouslySetInnerHTML={{ __html: backdropString }}
|
||||||
|
/>
|
||||||
|
<g dangerouslySetInnerHTML={{ __html: src }} />
|
||||||
</mask>
|
</mask>
|
||||||
<mask id="svg-preview-backdrop-mask-fill" maskUnits="userSpaceOnUse">
|
<mask
|
||||||
<g stroke="#fff" dangerouslySetInnerHTML={{ __html: backdropString }} />
|
id={`svg-preview-backdrop-mask-outline-${id}`}
|
||||||
<g dangerouslySetInnerHTML={{ __html: src }} strokeWidth={2.05} />
|
maskUnits="userSpaceOnUse"
|
||||||
<g strokeWidth={1.75} dangerouslySetInnerHTML={{ __html: backdropString }} />
|
>
|
||||||
|
<rect
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
fill="#fff"
|
||||||
|
stroke="none"
|
||||||
|
/>
|
||||||
|
<g
|
||||||
|
strokeWidth={1.75}
|
||||||
|
dangerouslySetInnerHTML={{ __html: backdropString }}
|
||||||
|
/>
|
||||||
</mask>
|
</mask>
|
||||||
<g strokeWidth={2.25} stroke="url(#pattern)" mask={'url(#svg-preview-backdrop-mask-outline)'}>
|
<g mask={`url(#svg-preview-backdrop-mask-${id})`}>
|
||||||
<rect x="0" y="0" width="24" height="24" fill="url(#pattern)" opacity={0.5} stroke="none" />
|
<rect
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
opacity={0.5}
|
||||||
|
fill={`url(#pattern-${id})`}
|
||||||
|
stroke="none"
|
||||||
|
/>
|
||||||
|
<g
|
||||||
|
stroke={color}
|
||||||
|
strokeWidth={2.25}
|
||||||
|
opacity={0.75}
|
||||||
|
dangerouslySetInnerHTML={{ __html: src }}
|
||||||
|
/>
|
||||||
|
{outline && (
|
||||||
|
<g
|
||||||
|
stroke={color}
|
||||||
|
strokeWidth={2.25}
|
||||||
|
opacity={0.75}
|
||||||
|
mask={`url(#svg-preview-backdrop-mask-outline-${id})`}
|
||||||
|
dangerouslySetInnerHTML={{ __html: backdropString }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</g>
|
</g>
|
||||||
<rect
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="24"
|
|
||||||
height="24"
|
|
||||||
fill="url(#pattern)"
|
|
||||||
stroke="none"
|
|
||||||
mask={'url(#svg-preview-backdrop-mask-fill)'}
|
|
||||||
/>
|
|
||||||
<rect
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="24"
|
|
||||||
height="24"
|
|
||||||
fill={color}
|
|
||||||
opacity={0.5}
|
|
||||||
stroke="none"
|
|
||||||
mask={'url(#svg-preview-backdrop-mask-fill)'}
|
|
||||||
/>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
71
docs/.vitepress/lib/SvgPreview/Diff.tsx
Normal file
71
docs/.vitepress/lib/SvgPreview/Diff.tsx
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import Backdrop from './Backdrop.tsx';
|
||||||
|
import { darkModeCss, Grid } from './index.tsx';
|
||||||
|
|
||||||
|
const SvgPreview = React.forwardRef<
|
||||||
|
SVGSVGElement,
|
||||||
|
{
|
||||||
|
oldSrc: string;
|
||||||
|
newSrc: string;
|
||||||
|
} & React.SVGProps<SVGSVGElement>
|
||||||
|
>(({ oldSrc, newSrc, children, ...props }, ref) => {
|
||||||
|
return (
|
||||||
|
<svg
|
||||||
|
ref={ref}
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width={24}
|
||||||
|
height={24}
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
strokeWidth={2}
|
||||||
|
strokeLinecap="round"
|
||||||
|
strokeLinejoin="round"
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
<style>{darkModeCss}</style>
|
||||||
|
<Grid
|
||||||
|
strokeWidth={0.1}
|
||||||
|
stroke="#777"
|
||||||
|
strokeOpacity={0.3}
|
||||||
|
radius={1}
|
||||||
|
/>
|
||||||
|
<mask
|
||||||
|
id="gray"
|
||||||
|
maskUnits="userSpaceOnUse"
|
||||||
|
>
|
||||||
|
<rect
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
fill="#000"
|
||||||
|
stroke="none"
|
||||||
|
/>
|
||||||
|
<g
|
||||||
|
stroke="#fff"
|
||||||
|
dangerouslySetInnerHTML={{ __html: oldSrc }}
|
||||||
|
/>
|
||||||
|
</mask>
|
||||||
|
<Backdrop
|
||||||
|
src=""
|
||||||
|
outline={false}
|
||||||
|
backdropString={`<g mask="url('#gray')">${newSrc}</g>`}
|
||||||
|
color="#777"
|
||||||
|
/>
|
||||||
|
<Backdrop
|
||||||
|
src={oldSrc}
|
||||||
|
backdropString={newSrc}
|
||||||
|
color="lime"
|
||||||
|
/>
|
||||||
|
<Backdrop
|
||||||
|
src={newSrc}
|
||||||
|
backdropString={oldSrc}
|
||||||
|
color="red"
|
||||||
|
/>
|
||||||
|
{children}
|
||||||
|
</svg>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
export default SvgPreview;
|
||||||
@@ -2,7 +2,23 @@ import React from 'react';
|
|||||||
import { PathProps, Path } from './types';
|
import { PathProps, Path } from './types';
|
||||||
import { getPaths, assert } from './utils';
|
import { getPaths, assert } from './utils';
|
||||||
|
|
||||||
const Grid = ({
|
export const darkModeCss = `
|
||||||
|
@media screen and (prefers-color-scheme: light) {
|
||||||
|
.svg-preview-grid-rect { fill: none }
|
||||||
|
}
|
||||||
|
@media screen and (prefers-color-scheme: dark) {
|
||||||
|
.svg-preview-grid-rect { fill: none }
|
||||||
|
.svg
|
||||||
|
.svg-preview-grid-group,
|
||||||
|
.svg-preview-radii-group,
|
||||||
|
.svg-preview-shadow-mask-group,
|
||||||
|
.svg-preview-shadow-group {
|
||||||
|
stroke: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
export const Grid = ({
|
||||||
radius,
|
radius,
|
||||||
fill = '#fff',
|
fill = '#fff',
|
||||||
...props
|
...props
|
||||||
@@ -10,7 +26,11 @@ const Grid = ({
|
|||||||
strokeWidth: number;
|
strokeWidth: number;
|
||||||
radius: number;
|
radius: number;
|
||||||
} & PathProps<'stroke', 'strokeWidth'>) => (
|
} & PathProps<'stroke', 'strokeWidth'>) => (
|
||||||
<g className="svg-preview-grid-group" strokeLinecap="butt" {...props}>
|
<g
|
||||||
|
className="svg-preview-grid-group"
|
||||||
|
strokeLinecap="butt"
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
<rect
|
<rect
|
||||||
className="svg-preview-grid-rect"
|
className="svg-preview-grid-rect"
|
||||||
width={24 - props.strokeWidth}
|
width={24 - props.strokeWidth}
|
||||||
@@ -21,11 +41,29 @@ const Grid = ({
|
|||||||
fill={fill}
|
fill={fill}
|
||||||
/>
|
/>
|
||||||
<path
|
<path
|
||||||
|
strokeDasharray={'0 0.1 ' + '0.1 0.15 '.repeat(11) + '0 0.15'}
|
||||||
|
strokeWidth={0.1}
|
||||||
d={
|
d={
|
||||||
props.d ||
|
props.d ||
|
||||||
new Array(Math.floor(24 - 1))
|
new Array(Math.floor(24 - 1))
|
||||||
.fill(null)
|
.fill(null)
|
||||||
.flatMap((_, i) => [
|
.map((_, i) => i)
|
||||||
|
.filter((i) => i % 3 !== 2)
|
||||||
|
.flatMap((i) => [
|
||||||
|
`M${props.strokeWidth} ${i + 1}h${24 - props.strokeWidth * 2}`,
|
||||||
|
`M${i + 1} ${props.strokeWidth}v${24 - props.strokeWidth * 2}`,
|
||||||
|
])
|
||||||
|
.join('')
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
d={
|
||||||
|
props.d ||
|
||||||
|
new Array(Math.floor(24 - 1))
|
||||||
|
.fill(null)
|
||||||
|
.map((_, i) => i)
|
||||||
|
.filter((i) => i % 3 === 2)
|
||||||
|
.flatMap((i) => [
|
||||||
`M${props.strokeWidth} ${i + 1}h${24 - props.strokeWidth * 2}`,
|
`M${props.strokeWidth} ${i + 1}h${24 - props.strokeWidth * 2}`,
|
||||||
`M${i + 1} ${props.strokeWidth}v${24 - props.strokeWidth * 2}`,
|
`M${i + 1} ${props.strokeWidth}v${24 - props.strokeWidth * 2}`,
|
||||||
])
|
])
|
||||||
@@ -44,15 +82,21 @@ const Shadow = ({
|
|||||||
paths: Path[];
|
paths: Path[];
|
||||||
} & PathProps<'stroke' | 'strokeWidth' | 'strokeOpacity', 'd'>) => {
|
} & PathProps<'stroke' | 'strokeWidth' | 'strokeOpacity', 'd'>) => {
|
||||||
const groupedPaths = Object.entries(
|
const groupedPaths = Object.entries(
|
||||||
paths.reduce((groups, val) => {
|
paths.reduce(
|
||||||
const key = val.c.id;
|
(groups, val) => {
|
||||||
groups[key] = [...(groups[key] || []), val];
|
const key = val.c.id;
|
||||||
return groups;
|
groups[key] = [...(groups[key] || []), val];
|
||||||
}, {} as Record<number, Path[]>)
|
return groups;
|
||||||
|
},
|
||||||
|
{} as Record<number, Path[]>,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<g className="svg-preview-shadow-mask-group" {...props}>
|
<g
|
||||||
|
className="svg-preview-shadow-mask-group"
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
{groupedPaths.map(([id, paths]) => (
|
{groupedPaths.map(([id, paths]) => (
|
||||||
<mask
|
<mask
|
||||||
id={`svg-preview-shadow-mask-${id}`}
|
id={`svg-preview-shadow-mask-${id}`}
|
||||||
@@ -61,7 +105,15 @@ const Shadow = ({
|
|||||||
strokeWidth={props.strokeWidth}
|
strokeWidth={props.strokeWidth}
|
||||||
stroke="#000"
|
stroke="#000"
|
||||||
>
|
>
|
||||||
<rect x={0} y={0} width={24} height={24} fill="#fff" stroke="none" rx={radius} />
|
<rect
|
||||||
|
x={0}
|
||||||
|
y={0}
|
||||||
|
width={24}
|
||||||
|
height={24}
|
||||||
|
fill="#fff"
|
||||||
|
stroke="none"
|
||||||
|
rx={radius}
|
||||||
|
/>
|
||||||
<path
|
<path
|
||||||
d={paths
|
d={paths
|
||||||
.flatMap(({ prev, next }) => [
|
.flatMap(({ prev, next }) => [
|
||||||
@@ -74,9 +126,16 @@ const Shadow = ({
|
|||||||
</mask>
|
</mask>
|
||||||
))}
|
))}
|
||||||
</g>
|
</g>
|
||||||
<g className="svg-preview-shadow-group" {...props}>
|
<g
|
||||||
|
className="svg-preview-shadow-group"
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
{paths.map(({ d, c: { id } }, i) => (
|
{paths.map(({ d, c: { id } }, i) => (
|
||||||
<path key={i} mask={`url(#svg-preview-shadow-mask-${id})`} d={d} />
|
<path
|
||||||
|
key={i}
|
||||||
|
mask={`url(#svg-preview-shadow-mask-${id})`}
|
||||||
|
d={d}
|
||||||
|
/>
|
||||||
))}
|
))}
|
||||||
<path
|
<path
|
||||||
d={paths
|
d={paths
|
||||||
@@ -94,9 +153,16 @@ const ColoredPath = ({
|
|||||||
paths,
|
paths,
|
||||||
...props
|
...props
|
||||||
}: { paths: Path[]; colors: string[] } & PathProps<never, 'd' | 'stroke'>) => (
|
}: { paths: Path[]; colors: string[] } & PathProps<never, 'd' | 'stroke'>) => (
|
||||||
<g className="svg-preview-colored-path-group" {...props}>
|
<g
|
||||||
|
className="svg-preview-colored-path-group"
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
{paths.map(({ d, c }, i) => (
|
{paths.map(({ d, c }, i) => (
|
||||||
<path key={i} d={d} stroke={colors[(c.name === 'path' ? i : c.id) % colors.length]} />
|
<path
|
||||||
|
key={i}
|
||||||
|
d={d}
|
||||||
|
stroke={colors[(c.name === 'path' ? i : c.id) % colors.length]}
|
||||||
|
/>
|
||||||
))}
|
))}
|
||||||
</g>
|
</g>
|
||||||
);
|
);
|
||||||
@@ -138,7 +204,15 @@ const ControlPath = ({
|
|||||||
key={i}
|
key={i}
|
||||||
maskUnits="userSpaceOnUse"
|
maskUnits="userSpaceOnUse"
|
||||||
>
|
>
|
||||||
<rect x="0" y="0" width="24" height="24" fill="#fff" stroke="none" rx={radius} />
|
<rect
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
fill="#fff"
|
||||||
|
stroke="none"
|
||||||
|
rx={radius}
|
||||||
|
/>
|
||||||
<path d={`M${prev.x} ${prev.y}h.01`} />
|
<path d={`M${prev.x} ${prev.y}h.01`} />
|
||||||
<path d={`M${next.x} ${next.y}h.01`} />
|
<path d={`M${next.x} ${next.y}h.01`} />
|
||||||
</mask>
|
</mask>
|
||||||
@@ -146,7 +220,10 @@ const ControlPath = ({
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</g>
|
</g>
|
||||||
<g className="svg-preview-control-path-group" {...props}>
|
<g
|
||||||
|
className="svg-preview-control-path-group"
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
{controlPaths.map(({ d, showMarker }, i) => (
|
{controlPaths.map(({ d, showMarker }, i) => (
|
||||||
<path
|
<path
|
||||||
key={i}
|
key={i}
|
||||||
@@ -155,18 +232,33 @@ const ControlPath = ({
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</g>
|
</g>
|
||||||
<g className="svg-preview-control-path-marker-group" {...props}>
|
<g
|
||||||
|
className="svg-preview-control-path-marker-group"
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
<path
|
<path
|
||||||
d={controlPaths
|
d={controlPaths
|
||||||
.flatMap(({ prev, next, showMarker }) =>
|
.flatMap(({ prev, next, showMarker }) =>
|
||||||
showMarker ? [`M${prev.x} ${prev.y}h.01`, `M${next.x} ${next.y}h.01`] : []
|
showMarker ? [`M${prev.x} ${prev.y}h.01`, `M${next.x} ${next.y}h.01`] : [],
|
||||||
)
|
)
|
||||||
.join('')}
|
.join('')}
|
||||||
/>
|
/>
|
||||||
{controlPaths.map(({ d, prev, next, startMarker, endMarker }, i) => (
|
{controlPaths.map(({ d, prev, next, startMarker, endMarker }, i) => (
|
||||||
<React.Fragment key={i}>
|
<React.Fragment key={i}>
|
||||||
{startMarker && <circle cx={prev.x} cy={prev.y} r={pointSize / 2} />}
|
{startMarker && (
|
||||||
{endMarker && <circle cx={next.x} cy={next.y} r={pointSize / 2} />}
|
<circle
|
||||||
|
cx={prev.x}
|
||||||
|
cy={prev.y}
|
||||||
|
r={pointSize / 2}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{endMarker && (
|
||||||
|
<circle
|
||||||
|
cx={next.x}
|
||||||
|
cy={next.y}
|
||||||
|
r={pointSize / 2}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
))}
|
))}
|
||||||
</g>
|
</g>
|
||||||
@@ -182,15 +274,16 @@ const Radii = ({
|
|||||||
any
|
any
|
||||||
>) => {
|
>) => {
|
||||||
return (
|
return (
|
||||||
<g className="svg-preview-radii-group" {...props}>
|
<g
|
||||||
|
className="svg-preview-radii-group"
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
{paths.map(
|
{paths.map(
|
||||||
({ c, prev, next, circle }, i) =>
|
({ c, prev, next, circle }, i) =>
|
||||||
circle && (
|
circle && (
|
||||||
<React.Fragment key={i}>
|
<React.Fragment key={i}>
|
||||||
{c.name !== "circle" && (
|
{c.name !== 'circle' && (
|
||||||
<path
|
<path d={`M${prev.x} ${prev.y} ${circle.x} ${circle.y} ${next.x} ${next.y}`} />
|
||||||
d={`M${prev.x} ${prev.y} ${circle.x} ${circle.y} ${next.x} ${next.y}`}
|
|
||||||
/>
|
|
||||||
)}
|
)}
|
||||||
<circle
|
<circle
|
||||||
cy={circle.y}
|
cy={circle.y}
|
||||||
@@ -200,7 +293,7 @@ const Radii = ({
|
|||||||
stroke={
|
stroke={
|
||||||
(Math.round(circle.x * 100) / 100) % 1 !== 0 ||
|
(Math.round(circle.x * 100) / 100) % 1 !== 0 ||
|
||||||
(Math.round(circle.y * 100) / 100) % 1 !== 0
|
(Math.round(circle.y * 100) / 100) % 1 !== 0
|
||||||
? "red"
|
? 'red'
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@@ -208,11 +301,7 @@ const Radii = ({
|
|||||||
cy={circle.y}
|
cy={circle.y}
|
||||||
cx={circle.x}
|
cx={circle.x}
|
||||||
r={circle.r}
|
r={circle.r}
|
||||||
stroke={
|
stroke={(Math.round(circle.r * 1000) / 1000) % 1 !== 0 ? 'red' : undefined}
|
||||||
(Math.round(circle.r * 1000) / 1000) % 1 !== 0
|
|
||||||
? "red"
|
|
||||||
: undefined
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
),
|
),
|
||||||
@@ -228,15 +317,29 @@ const Handles = ({
|
|||||||
'strokeWidth' | 'stroke' | 'strokeDasharray' | 'strokeOpacity',
|
'strokeWidth' | 'stroke' | 'strokeDasharray' | 'strokeOpacity',
|
||||||
any
|
any
|
||||||
>) => {
|
>) => {
|
||||||
console.log(paths);
|
|
||||||
return (
|
return (
|
||||||
<g className="svg-preview-handles-group" {...props}>
|
<g
|
||||||
|
className="svg-preview-handles-group"
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
{paths.map(({ c, prev, next, cp1, cp2 }) => (
|
{paths.map(({ c, prev, next, cp1, cp2 }) => (
|
||||||
<>
|
<>
|
||||||
{cp1 && <path d={`M${prev.x} ${prev.y} ${cp1.x} ${cp1.y}`} />}
|
{cp1 && <path d={`M${prev.x} ${prev.y} ${cp1.x} ${cp1.y}`} />}
|
||||||
{cp1 && <circle cy={cp1.y} cx={cp1.x} r={0.25} />}
|
{cp1 && (
|
||||||
|
<circle
|
||||||
|
cy={cp1.y}
|
||||||
|
cx={cp1.x}
|
||||||
|
r={0.25}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{cp2 && <path d={`M${next.x} ${next.y} ${cp2.x} ${cp2.y}`} />}
|
{cp2 && <path d={`M${next.x} ${next.y} ${cp2.x} ${cp2.y}`} />}
|
||||||
{cp2 && <circle cy={cp2.y} cx={cp2.x} r={0.25} />}
|
{cp2 && (
|
||||||
|
<circle
|
||||||
|
cy={cp2.y}
|
||||||
|
cx={cp2.x}
|
||||||
|
r={0.25}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
))}
|
))}
|
||||||
</g>
|
</g>
|
||||||
@@ -252,19 +355,6 @@ const SvgPreview = React.forwardRef<
|
|||||||
>(({ src, children, showGrid = false, ...props }, ref) => {
|
>(({ src, children, showGrid = false, ...props }, ref) => {
|
||||||
const paths = typeof src === 'string' ? getPaths(src) : src;
|
const paths = typeof src === 'string' ? getPaths(src) : src;
|
||||||
|
|
||||||
const darkModeCss = `@media screen and (prefers-color-scheme: light) {
|
|
||||||
.svg-preview-grid-rect { fill: none }
|
|
||||||
}
|
|
||||||
@media screen and (prefers-color-scheme: dark) {
|
|
||||||
.svg-preview-grid-rect { fill: none }
|
|
||||||
.svg
|
|
||||||
.svg-preview-grid-group,
|
|
||||||
.svg-preview-radii-group,
|
|
||||||
.svg-preview-shadow-mask-group,
|
|
||||||
.svg-preview-shadow-group {
|
|
||||||
stroke: #fff;
|
|
||||||
}
|
|
||||||
}`;
|
|
||||||
return (
|
return (
|
||||||
<svg
|
<svg
|
||||||
ref={ref}
|
ref={ref}
|
||||||
@@ -280,9 +370,27 @@ const SvgPreview = React.forwardRef<
|
|||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
<style>{darkModeCss}</style>
|
<style>{darkModeCss}</style>
|
||||||
{showGrid && <Grid strokeWidth={0.1} stroke="#777" strokeOpacity={0.3} radius={1} />}
|
{showGrid && (
|
||||||
<Shadow paths={paths} strokeWidth={4} stroke="#777" radius={1} strokeOpacity={0.15} />
|
<Grid
|
||||||
<Handles paths={paths} strokeWidth={0.12} stroke="#777" strokeOpacity={0.6} />
|
strokeWidth={0.1}
|
||||||
|
stroke="#777"
|
||||||
|
strokeOpacity={0.3}
|
||||||
|
radius={1}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<Shadow
|
||||||
|
paths={paths}
|
||||||
|
strokeWidth={4}
|
||||||
|
stroke="#777"
|
||||||
|
radius={1}
|
||||||
|
strokeOpacity={0.15}
|
||||||
|
/>
|
||||||
|
<Handles
|
||||||
|
paths={paths}
|
||||||
|
strokeWidth={0.12}
|
||||||
|
stroke="#777"
|
||||||
|
strokeOpacity={0.6}
|
||||||
|
/>
|
||||||
<ColoredPath
|
<ColoredPath
|
||||||
paths={paths}
|
paths={paths}
|
||||||
colors={[
|
colors={[
|
||||||
@@ -307,8 +415,19 @@ const SvgPreview = React.forwardRef<
|
|||||||
stroke="#777"
|
stroke="#777"
|
||||||
strokeOpacity={0.3}
|
strokeOpacity={0.3}
|
||||||
/>
|
/>
|
||||||
<ControlPath radius={1} paths={paths} pointSize={1} stroke="#fff" strokeWidth={0.125} />
|
<ControlPath
|
||||||
<Handles paths={paths} strokeWidth={0.12} stroke="#FFF" strokeOpacity={0.3} />
|
radius={1}
|
||||||
|
paths={paths}
|
||||||
|
pointSize={1}
|
||||||
|
stroke="#fff"
|
||||||
|
strokeWidth={0.125}
|
||||||
|
/>
|
||||||
|
<Handles
|
||||||
|
paths={paths}
|
||||||
|
strokeWidth={0.12}
|
||||||
|
stroke="#FFF"
|
||||||
|
strokeOpacity={0.3}
|
||||||
|
/>
|
||||||
{children}
|
{children}
|
||||||
</svg>
|
</svg>
|
||||||
);
|
);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user