Compare commits
45 Commits
0.465.0
...
fix/fixed-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8f578fa8b | ||
|
|
97f214934d | ||
|
|
34dfc63ce2 | ||
|
|
b46927e510 | ||
|
|
1828a392c8 | ||
|
|
3ab6c373a0 | ||
|
|
ba2c4b526f | ||
|
|
bde3f01e0b | ||
|
|
50630b3aaf | ||
|
|
e28426a871 | ||
|
|
eb158561d3 | ||
|
|
410ae434fa | ||
|
|
0801b89e4d | ||
|
|
a1d17eedc9 | ||
|
|
7481dd0a3f | ||
|
|
f9e93824f1 | ||
|
|
4ba4cf2f35 | ||
|
|
6b29716aa9 | ||
|
|
97bbe1d6b2 | ||
|
|
608da04bdf | ||
|
|
961404d5cc | ||
|
|
f3100b8af1 | ||
|
|
0df4e2991c | ||
|
|
2b8242fa14 | ||
|
|
27c667556b | ||
|
|
31c3fefc17 | ||
|
|
389fed8770 | ||
|
|
58c2e108c3 | ||
|
|
d5fe5a0ef4 | ||
|
|
db30ab89f4 | ||
|
|
fa7120cbe0 | ||
|
|
419d47019c | ||
|
|
655111e4aa | ||
|
|
ea0ac2f92b | ||
|
|
1a5ee439ef | ||
|
|
5947ca82d5 | ||
|
|
edf46adc9e | ||
|
|
94782f53c1 | ||
|
|
79bbfa958e | ||
|
|
970fc3d4be | ||
|
|
f12b0de177 | ||
|
|
67cbce66e9 | ||
|
|
b927275150 | ||
|
|
ea89735f67 | ||
|
|
53c61c0f48 |
6
.gitignore
vendored
@@ -20,9 +20,13 @@ packages/**/src/aliases/*.ts
|
|||||||
packages/**/src/aliases.ts
|
packages/**/src/aliases.ts
|
||||||
!packages/**/src/aliases/index.ts
|
!packages/**/src/aliases/index.ts
|
||||||
packages/**/src/dynamicIconImports.ts
|
packages/**/src/dynamicIconImports.ts
|
||||||
|
packages/**/DynamicIcon.d.ts
|
||||||
packages/**/dynamicIconImports.js
|
packages/**/dynamicIconImports.js
|
||||||
packages/**/dynamicIconImports.d.ts
|
packages/**/dynamicIconImports.d.ts
|
||||||
packages/**/dynamicIconImports.js.map
|
packages/**/dynamicIconImports.js.map
|
||||||
|
packages/**/dynamic.d.ts
|
||||||
|
packages/**/dynamic.mjs.map
|
||||||
|
packages/**/dynamic.mjs
|
||||||
packages/**/LICENSE
|
packages/**/LICENSE
|
||||||
categories.json
|
categories.json
|
||||||
tags.json
|
tags.json
|
||||||
@@ -41,3 +45,5 @@ docs/.vitepress/data/iconDetails
|
|||||||
docs/.vitepress/data/relatedIcons.json
|
docs/.vitepress/data/relatedIcons.json
|
||||||
docs/.vercel
|
docs/.vercel
|
||||||
docs/.nitro
|
docs/.nitro
|
||||||
|
.gitignore
|
||||||
|
|
||||||
|
|||||||
24
README.md
@@ -30,17 +30,17 @@ Lucide is an open-source icon library that provides 1000+ vector (svg) files for
|
|||||||
|
|
||||||
## Packages
|
## Packages
|
||||||
|
|
||||||
| | Package | Version & Downloads | Links |
|
| Logo | Package | Version | Downloads | Links |
|
||||||
| --- | --- | --- | --- |
|
| ---- | ------- | ------- | --------- | ----- |
|
||||||
| <img src="https://lucide.dev/framework-logos/js.svg" alt="JS logo" width="48"> | `lucide` | [](https://www.npmjs.com/package/lucide)  | [Docs](https://lucide.dev/guide/packages/lucide) [Source](./packages/lucide) |
|
| <img src="https://lucide.dev/framework-logos/js.svg" alt="JS logo" width="48"> | **`lucide`** | [](https://www.npmjs.com/package/lucide) |  | [Docs](https://lucide.dev/guide/packages/lucide) · [Source](./packages/lucide) |
|
||||||
| <img src="https://lucide.dev/framework-logos/react.svg" alt="React logo" width="48"> | `lucide-react` | [](https://www.npmjs.com/package/lucide-react)  | [Docs](https://lucide.dev/guide/packages/lucide-react) [Source](./packages/lucide-react) |
|
| <img src="https://lucide.dev/framework-logos/react.svg" alt="React logo" width="48"> | **`lucide-react`** | [](https://www.npmjs.com/package/lucide-react) |  | [Docs](https://lucide.dev/guide/packages/lucide-react) · [Source](./packages/lucide-react) |
|
||||||
| <img src="https://lucide.dev/framework-logos/vue.svg" alt="Vue logo" width="48"> | `lucide-vue-next` | [](https://www.npmjs.com/package/lucide-vue-next)  | [Docs](https://lucide.dev/guide/packages/lucide-vue-next) [Source](./packages/lucide-vue-next) |
|
| <img src="https://lucide.dev/framework-logos/vue.svg" alt="Vue logo" width="48"> | **`lucide-vue-next`** | [](https://www.npmjs.com/package/lucide-vue-next) |  | [Docs](https://lucide.dev/guide/packages/lucide-vue-next) · [Source](./packages/lucide-vue-next) |
|
||||||
| <img src="https://lucide.dev/framework-logos/svelte.svg" alt="Svelte logo" width="48"> | `lucide-svelte` | [](https://www.npmjs.com/package/lucide-svelte)  | [Docs](https://lucide.dev/guide/packages/lucide-svelte) [Source](./packages/lucide-svelte) |
|
| <img src="https://lucide.dev/framework-logos/svelte.svg" alt="Svelte logo" width="48"> | **`lucide-svelte`** | [](https://www.npmjs.com/package/lucide-svelte) |  | [Docs](https://lucide.dev/guide/packages/lucide-svelte) · [Source](./packages/lucide-svelte) |
|
||||||
| <img src="https://lucide.dev/framework-logos/solid.svg" alt="Solid logo" width="48"> | `lucide-solid` | [](https://www.npmjs.com/package/lucide-solid)  | [Docs](https://lucide.dev/guide/packages/lucide-solid) [Source](./packages/lucide-solid) |
|
| <img src="https://lucide.dev/framework-logos/solid.svg" alt="Solid logo" width="48"> | **`lucide-solid`** | [](https://www.npmjs.com/package/lucide-solid) |  | [Docs](https://lucide.dev/guide/packages/lucide-solid) · [Source](./packages/lucide-solid) |
|
||||||
| <img src="https://lucide.dev/framework-logos/preact.svg" alt="Preact logo" width="48"> | `lucide-preact` | [](https://www.npmjs.com/package/lucide-preact)  | [Docs](https://lucide.dev/guide/packages/lucide-preact) [Source](./packages/lucide-preact) |
|
| <img src="https://lucide.dev/framework-logos/preact.svg" alt="Preact logo" width="48"> | **`lucide-preact`** | [](https://www.npmjs.com/package/lucide-preact) |  | [Docs](https://lucide.dev/guide/packages/lucide-preact) · [Source](./packages/lucide-preact) |
|
||||||
| <img src="https://lucide.dev/framework-logos/react-native.svg" alt="React Native logo" width="48"> | `lucide-react-native` | [](https://www.npmjs.com/package/lucide-react-native)  | [Docs](https://lucide.dev/guide/packages/lucide-react-native) [Source](./packages/lucide-react-native) |
|
| <img src="https://lucide.dev/framework-logos/react-native.svg" alt="React Native logo" width="48"> | **`lucide-react-native`** | [](https://www.npmjs.com/package/lucide-react-native) |  | [Docs](https://lucide.dev/guide/packages/lucide-react-native) · [Source](./packages/lucide-react-native) |
|
||||||
| <img src="https://lucide.dev/framework-logos/angular.svg" alt="Angular logo" width="48"> | `lucide-angular` | [](https://www.npmjs.com/package/lucide-angular)  | [Docs](https://lucide.dev/guide/packages/lucide-angular) [Source](./packages/lucide-angular) |
|
| <img src="https://lucide.dev/framework-logos/angular.svg" alt="Angular logo" width="48"> | **`lucide-angular`** | [](https://www.npmjs.com/package/lucide-angular) |  | [Docs](https://lucide.dev/guide/packages/lucide-angular) · [Source](./packages/lucide-angular) |
|
||||||
| <img src="https://lucide.dev/framework-logos/svg.svg" alt="SVG logo" width="48"> | `lucide-static` | [](https://www.npmjs.com/package/lucide-static)  | [Docs](https://lucide.dev/guide/packages/lucide-static) [Source](./packages/lucide-static) |
|
| <img src="https://lucide.dev/framework-logos/svg.svg" alt="SVG logo" width="48"> | **`lucide-static`** | [](https://www.npmjs.com/package/lucide-static) |  | [Docs](https://lucide.dev/guide/packages/lucide-static) · [Source](./packages/lucide-static) |
|
||||||
|
|
||||||
### Figma
|
### Figma
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ Join the community on our [Discord](https://discord.gg/EH6nSts) server!
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Lucide is totally free for commercial use and personally use, this software is licensed under the [ISC License](https://github.com/lucide-icons/lucide/blob/main/LICENSE).
|
Lucide is totally free for commercial use and personal use, this software is licensed under the [ISC License](https://github.com/lucide-icons/lucide/blob/main/LICENSE).
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "finance",
|
"name": "finance",
|
||||||
"title": "Money"
|
"title": "Finance"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "food-beverage",
|
"name": "food-beverage",
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "math",
|
"name": "math",
|
||||||
"title": "Math"
|
"title": "Mathematics"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "medical",
|
"name": "medical",
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ import { $CamelCase } from '@lucide/lab';
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Icon :iconNode="burger" />
|
<Icon :iconNode="$CamelCase" />
|
||||||
</template>
|
</template>
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
@@ -61,7 +61,7 @@ import { Icon } from 'lucide-svelte';
|
|||||||
import { $CamelCase } from '@lucide/lab';
|
import { $CamelCase } from '@lucide/lab';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Icon iconNode={burger} />
|
<Icon iconNode={$CamelCase} />
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,22 +5,32 @@ import IconButton from '../base/IconButton.vue';
|
|||||||
import VPDocAsideCarbonAds from 'vitepress/dist/client/theme-default/components/VPDocAsideCarbonAds.vue'
|
import VPDocAsideCarbonAds from 'vitepress/dist/client/theme-default/components/VPDocAsideCarbonAds.vue'
|
||||||
import { x } from '../../../data/iconNodes'
|
import { x } from '../../../data/iconNodes'
|
||||||
import createLucideIcon from 'lucide-vue-next/src/createLucideIcon';
|
import createLucideIcon from 'lucide-vue-next/src/createLucideIcon';
|
||||||
|
import { onMounted, ref } from 'vue';
|
||||||
|
|
||||||
const { theme } = useData()
|
const { theme } = useData()
|
||||||
const showAd = useSessionStorage('show-carbon-ads',true)
|
const showAd = useSessionStorage('show-carbon-ads', true)
|
||||||
|
const carbonLoaded = ref(true)
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
drawerOpen: boolean
|
drawerOpen: boolean
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const CloseIcon = createLucideIcon('Close', x)
|
const CloseIcon = createLucideIcon('Close', x)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
if (window?._carbonads == null) {
|
||||||
|
carbonLoaded.value = false
|
||||||
|
}
|
||||||
|
}, 5000)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
:class="{
|
:class="{
|
||||||
'drawer-open': drawerOpen,
|
'drawer-open': drawerOpen,
|
||||||
'hide-ad': !showAd
|
'hide-ad': !(showAd && carbonLoaded)
|
||||||
}"
|
}"
|
||||||
class="floating-ad"
|
class="floating-ad"
|
||||||
v-if="theme.carbonAds"
|
v-if="theme.carbonAds"
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ Lucide is an open-source icon library that provides 1000+ vector (svg) files for
|
|||||||
## Available Icons
|
## Available Icons
|
||||||
|
|
||||||
Lucide contains icons with different variants and states, allowing users to choose the most suitable icon for their needs. And if a desired icon isn't available yet, users can open a design request, and the Lucide community contributors will help provide new icons. With more icons to choose from, users have more options to work with in their projects.
|
Lucide contains icons with different variants and states, allowing users to choose the most suitable icon for their needs. And if a desired icon isn't available yet, users can open a design request, and the Lucide community contributors will help provide new icons. With more icons to choose from, users have more options to work with in their projects.
|
||||||
Complete Set of Icons
|
|
||||||
|
### Complete Set of Icons
|
||||||
|
|
||||||
As new applications with specific features arise, Lucide aims to provide a complete set of icons for every project. The community follows a set of design rules when designing new icons. These rules maintain standards for the icons, such as recognizability, consistency in style, and readability at all sizes. While creativity is valued in new icons, recognizable design conventions are important to ensure that the icons are easily identifiable by users.
|
As new applications with specific features arise, Lucide aims to provide a complete set of icons for every project. The community follows a set of design rules when designing new icons. These rules maintain standards for the icons, such as recognizability, consistency in style, and readability at all sizes. While creativity is valued in new icons, recognizable design conventions are important to ensure that the icons are easily identifiable by users.
|
||||||
|
|
||||||
|
|||||||
@@ -85,108 +85,21 @@ const App = () => (
|
|||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
## One generic icon component
|
## Dynamic Icon Component
|
||||||
|
|
||||||
It is possible to create one generic icon component to load icons, but it is not recommended.
|
It is possible to create one generic icon component to load icons, but it is not recommended.
|
||||||
|
Since it is importing all icons during build. This increases build time and the different modules it will create.
|
||||||
|
|
||||||
::: danger
|
`DynamicIcon` is useful for applications that want to show icons dynamically by icon name. For example, when using a content management system with where icon names are stored in a database.
|
||||||
The example below imports all ES Modules, so exercise caution when using it. Importing all icons will significantly increase the build size of the application, negatively affecting its performance. This is especially important to keep in mind when using bundlers like `Webpack`, `Rollup`, or `Vite`.
|
|
||||||
|
|
||||||
This is not the case for the latest NextJS, because it uses server side rendering. The icons will be streamed to the client when needed. For NextJS with Dynamic Imports, see [dynamic imports](#nextjs-example) section for more information.
|
For static use cases, it is recommended to import the icons directly.
|
||||||
:::
|
|
||||||
|
|
||||||
### Icon Component Example
|
The same props can be passed to adjust the icon appearance. The `name` prop is required to load the correct icon.
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
import { icons } from 'lucide-react';
|
import { DynamicIcon } from 'lucide-react/dynamic';
|
||||||
|
|
||||||
const Icon = ({ name, color, size }) => {
|
const App = () => (
|
||||||
const LucideIcon = icons[name];
|
<DynamicIcon name="camera" color="red" size={48} />
|
||||||
|
);
|
||||||
return <LucideIcon color={color} size={size} />;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Icon;
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Using the Icon Component
|
|
||||||
|
|
||||||
```jsx
|
|
||||||
import Icon from './Icon';
|
|
||||||
|
|
||||||
const App = () => {
|
|
||||||
return <Icon name="Home" />;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default App;
|
|
||||||
```
|
|
||||||
|
|
||||||
#### With Dynamic Imports
|
|
||||||
|
|
||||||
Lucide react exports a dynamic import map `dynamicIconImports`, which is useful for applications that want to show icons dynamically by icon name. For example, when using a content management system with where icon names are stored in a database.
|
|
||||||
|
|
||||||
When using client side rendering, it will fetch the icon component when it's needed. This will reduce the initial bundle size.
|
|
||||||
|
|
||||||
The keys of the dynamic import map are the lucide original icon names (kebab case).
|
|
||||||
|
|
||||||
Example with React suspense:
|
|
||||||
|
|
||||||
```tsx
|
|
||||||
import React, { lazy, Suspense } from 'react';
|
|
||||||
import { LucideProps } from 'lucide-react';
|
|
||||||
import dynamicIconImports from 'lucide-react/dynamicIconImports';
|
|
||||||
|
|
||||||
const fallback = <div style={{ background: '#ddd', width: 24, height: 24 }}/>
|
|
||||||
|
|
||||||
interface IconProps extends Omit<LucideProps, 'ref'> {
|
|
||||||
name: keyof typeof dynamicIconImports;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Icon = ({ name, ...props }: IconProps) => {
|
|
||||||
const LucideIcon = lazy(dynamicIconImports[name]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Suspense fallback={fallback}>
|
|
||||||
<LucideIcon {...props} />
|
|
||||||
</Suspense>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Icon
|
|
||||||
```
|
|
||||||
|
|
||||||
##### NextJS Example
|
|
||||||
|
|
||||||
In NextJS, [the dynamic function](https://nextjs.org/docs/pages/building-your-application/optimizing/lazy-loading#nextdynamic) can be used to dynamically load the icon component.
|
|
||||||
|
|
||||||
To make dynamic imports work with NextJS, you need to add `lucide-react` to the [`transpilePackages`](https://nextjs.org/docs/app/api-reference/next-config-js/transpilePackages) option in your `next.config.js` like this:
|
|
||||||
|
|
||||||
```js
|
|
||||||
/** @type {import('next').NextConfig} */
|
|
||||||
const nextConfig = {
|
|
||||||
transpilePackages: ['lucide-react'] // add this
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = nextConfig
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
You can then start using it:
|
|
||||||
|
|
||||||
```tsx
|
|
||||||
import dynamic from 'next/dynamic'
|
|
||||||
import { LucideProps } from 'lucide-react';
|
|
||||||
import dynamicIconImports from 'lucide-react/dynamicIconImports';
|
|
||||||
|
|
||||||
interface IconProps extends LucideProps {
|
|
||||||
name: keyof typeof dynamicIconImports;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Icon = ({ name, ...props }: IconProps) => {
|
|
||||||
const LucideIcon = dynamic(dynamicIconImports[name])
|
|
||||||
|
|
||||||
return <LucideIcon {...props} />;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Icon;
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
import fs from 'fs';
|
import fs from 'fs/promises';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
const currentDir = process.cwd();
|
const currentDir = process.cwd();
|
||||||
const dataDirectory = path.resolve(currentDir, '.vitepress/data');
|
const dataDirectory = path.resolve(currentDir, '.vitepress/data');
|
||||||
const directory = path.join(process.cwd(), '../categories');
|
const directory = path.join(process.cwd(), '../categories');
|
||||||
|
|
||||||
function getAllCategoryFiles() {
|
async function getAllCategoryFiles() {
|
||||||
const fileNames = fs.readdirSync(directory).filter((file) => path.extname(file) === '.json');
|
const categoryDirectoryContents = await fs.readdir(directory);
|
||||||
|
const fileNames = categoryDirectoryContents.filter((file) => path.extname(file) === '.json');
|
||||||
|
|
||||||
return fileNames.map((fileName) => {
|
const categoryJSONReadPromises = fileNames.map(async (fileName) => {
|
||||||
const name = path.basename(fileName, '.json');
|
const name = path.basename(fileName, '.json');
|
||||||
const fileContent = fs.readFileSync(path.join(directory, fileName), 'utf8');
|
const fileContent = await fs.readFile(path.join(directory, fileName), 'utf8');
|
||||||
|
|
||||||
const parsedFileContent = JSON.parse(fileContent);
|
const parsedFileContent = JSON.parse(fileContent);
|
||||||
|
|
||||||
@@ -19,14 +20,15 @@ function getAllCategoryFiles() {
|
|||||||
title: parsedFileContent.title,
|
title: parsedFileContent.title,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return Promise.all(categoryJSONReadPromises);
|
||||||
}
|
}
|
||||||
|
|
||||||
const categoriesFile = path.resolve(dataDirectory, `categoriesData.json`);
|
const categoriesFile = path.resolve(dataDirectory, `categoriesData.json`);
|
||||||
|
|
||||||
const categoriesData = getAllCategoryFiles();
|
const categoriesData = await getAllCategoryFiles();
|
||||||
|
|
||||||
fs.promises
|
fs.writeFile(categoriesFile, JSON.stringify(categoriesData, null, 2), 'utf-8')
|
||||||
.writeFile(categoriesFile, JSON.stringify(categoriesData, null, 2), 'utf-8')
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log('Successfully written categoriesData.json file');
|
console.log('Successfully written categoriesData.json file');
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { readSvgDirectory, toCamelCase } from '@lucide/helpers';
|
|||||||
|
|
||||||
const currentDir = process.cwd();
|
const currentDir = process.cwd();
|
||||||
const ICONS_DIR = path.resolve(currentDir, '../icons');
|
const ICONS_DIR = path.resolve(currentDir, '../icons');
|
||||||
const icons = readSvgDirectory(ICONS_DIR, '.json');
|
const icons = await readSvgDirectory(ICONS_DIR, '.json');
|
||||||
|
|
||||||
const iconDetailsDirectory = path.resolve(currentDir, '.vitepress/data', 'iconDetails');
|
const iconDetailsDirectory = path.resolve(currentDir, '.vitepress/data', 'iconDetails');
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { readSvgDirectory, toCamelCase } from '@lucide/helpers';
|
|||||||
|
|
||||||
const currentDir = process.cwd();
|
const currentDir = process.cwd();
|
||||||
const ICONS_DIR = path.resolve(currentDir, '../icons');
|
const ICONS_DIR = path.resolve(currentDir, '../icons');
|
||||||
const iconJsonFiles = readSvgDirectory(ICONS_DIR, '.json');
|
const iconJsonFiles = await readSvgDirectory(ICONS_DIR, '.json');
|
||||||
|
|
||||||
const location = path.resolve(currentDir, '.vitepress/data', 'iconMetaData.ts');
|
const location = path.resolve(currentDir, '.vitepress/data', 'iconMetaData.ts');
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import { readSvgDirectory, toCamelCase } from '@lucide/helpers';
|
|||||||
|
|
||||||
const currentDir = process.cwd();
|
const currentDir = process.cwd();
|
||||||
const ICONS_DIR = path.resolve(currentDir, '../icons');
|
const ICONS_DIR = path.resolve(currentDir, '../icons');
|
||||||
const svgFiles = readSvgDirectory(ICONS_DIR);
|
const svgFiles = await readSvgDirectory(ICONS_DIR);
|
||||||
const icons = renderIconsObject(svgFiles, ICONS_DIR, true);
|
const icons = await renderIconsObject(svgFiles, ICONS_DIR, true);
|
||||||
|
|
||||||
const iconNodesDirectory = path.resolve(currentDir, '.vitepress/data', 'iconNodes');
|
const iconNodesDirectory = path.resolve(currentDir, '.vitepress/data', 'iconNodes');
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ const writeIconFiles = Object.entries(icons).map(async ([iconName, { children }]
|
|||||||
await fs.promises.writeFile(location, output, 'utf-8');
|
await fs.promises.writeFile(location, output, 'utf-8');
|
||||||
|
|
||||||
iconIndexFileImports.push(
|
iconIndexFileImports.push(
|
||||||
`import ${toCamelCase(iconName)}Node from './${iconName}.node.json' assert { type: "json" };`,
|
`import ${toCamelCase(iconName)}Node from './${iconName}.node.json' with { type: "json" };`,
|
||||||
);
|
);
|
||||||
iconIndexFileExports.push(` ${toCamelCase(iconName)}Node as ${toCamelCase(iconName)},`);
|
iconIndexFileExports.push(` ${toCamelCase(iconName)}Node as ${toCamelCase(iconName)},`);
|
||||||
iconIndexFileDefaultExports.push(` '${iconName}': ${toCamelCase(iconName)}Node,`);
|
iconIndexFileDefaultExports.push(` '${iconName}': ${toCamelCase(iconName)}Node,`);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { readSvgDirectory } from '@lucide/helpers';
|
|||||||
|
|
||||||
const currentDir = process.cwd();
|
const currentDir = process.cwd();
|
||||||
const ICONS_DIR = path.resolve(currentDir, '../icons');
|
const ICONS_DIR = path.resolve(currentDir, '../icons');
|
||||||
const svgFiles = readSvgDirectory(ICONS_DIR, '.json');
|
const svgFiles = await readSvgDirectory(ICONS_DIR, '.json');
|
||||||
|
|
||||||
const location = path.resolve(currentDir, '.vitepress/data', 'relatedIcons.json');
|
const location = path.resolve(currentDir, '.vitepress/data', 'relatedIcons.json');
|
||||||
|
|
||||||
@@ -18,9 +18,7 @@ const categoryWeight = 3;
|
|||||||
|
|
||||||
const MAX_RELATED_ICONS = 4 * 17; // grid of 4x17 icons, = 68 icons
|
const MAX_RELATED_ICONS = 4 * 17; // grid of 4x17 icons, = 68 icons
|
||||||
|
|
||||||
const arrayMatches = (a, b) => {
|
const arrayMatches = (a, b) => a.filter((item) => b.includes(item)).length;
|
||||||
return a.filter((item) => b.includes(item)).length;
|
|
||||||
};
|
|
||||||
|
|
||||||
const nameParts = (icon) =>
|
const nameParts = (icon) =>
|
||||||
[
|
[
|
||||||
@@ -36,6 +34,7 @@ const getRelatedIcons = (currentIcon, icons) => {
|
|||||||
nameWeight * arrayMatches(nameParts(item), nameParts(currentIcon)) +
|
nameWeight * arrayMatches(nameParts(item), nameParts(currentIcon)) +
|
||||||
categoryWeight * arrayMatches(item.categories ?? [], currentIcon.categories ?? []) +
|
categoryWeight * arrayMatches(item.categories ?? [], currentIcon.categories ?? []) +
|
||||||
tagWeight * arrayMatches(item.tags ?? [], currentIcon.tags ?? []);
|
tagWeight * arrayMatches(item.tags ?? [], currentIcon.tags ?? []);
|
||||||
|
|
||||||
return icons
|
return icons
|
||||||
.filter((i) => i.name !== currentIcon.name)
|
.filter((i) => i.name !== currentIcon.name)
|
||||||
.map((icon) => ({ icon, similarity: iconSimilarity(icon) }))
|
.map((icon) => ({ icon, similarity: iconSimilarity(icon) }))
|
||||||
@@ -46,7 +45,8 @@ const getRelatedIcons = (currentIcon, icons) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const iconsMetaDataPromises = svgFiles.map(async (iconName) => {
|
const iconsMetaDataPromises = svgFiles.map(async (iconName) => {
|
||||||
const metaData = JSON.parse(fs.readFileSync(`../icons/${iconName}`));
|
const metaDataFileContent = await fs.promises.readFile(`../icons/${iconName}`);
|
||||||
|
const metaData = JSON.parse(metaDataFileContent);
|
||||||
|
|
||||||
const name = iconName.replace('.json', '');
|
const name = iconName.replace('.json', '');
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const git = simpleGit();
|
|||||||
|
|
||||||
const currentDir = process.cwd();
|
const currentDir = process.cwd();
|
||||||
const ICONS_DIR = path.resolve(currentDir, '../icons');
|
const ICONS_DIR = path.resolve(currentDir, '../icons');
|
||||||
const iconJsonFiles = readSvgDirectory(ICONS_DIR, '.json');
|
const iconJsonFiles = await readSvgDirectory(ICONS_DIR, '.json');
|
||||||
const location = path.resolve(currentDir, '.vitepress/data', 'releaseMetaData.json');
|
const location = path.resolve(currentDir, '.vitepress/data', 'releaseMetaData.json');
|
||||||
const releaseMetaDataDirectory = path.resolve(currentDir, '.vitepress/data', 'releaseMetadata');
|
const releaseMetaDataDirectory = path.resolve(currentDir, '.vitepress/data', 'releaseMetadata');
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { getCurrentDirPath } from '@lucide/helpers';
|
|||||||
const currentDir = process.cwd();
|
const currentDir = process.cwd();
|
||||||
const scriptDir = getCurrentDirPath(import.meta.url);
|
const scriptDir = getCurrentDirPath(import.meta.url);
|
||||||
|
|
||||||
const iconMetaData = await getIconMetaData(path.resolve(scriptDir, '../icons'));
|
const iconMetaData = await getIconMetaData(path.resolve(scriptDir, '../../icons'));
|
||||||
|
|
||||||
const iconAliasesRedirectRoutes = Object.entries(iconMetaData)
|
const iconAliasesRedirectRoutes = Object.entries(iconMetaData)
|
||||||
.filter(([, { aliases }]) => aliases?.length)
|
.filter(([, { aliases }]) => aliases?.length)
|
||||||
@@ -16,7 +16,7 @@ const iconAliasesRedirectRoutes = Object.entries(iconMetaData)
|
|||||||
const aliasRouteMatches = aliases.join('|');
|
const aliasRouteMatches = aliases.join('|');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
src: `/icons/(${aliasRouteMatches})`,
|
src: `/icons/${aliasRouteMatches}`,
|
||||||
status: 302,
|
status: 302,
|
||||||
headers: {
|
headers: {
|
||||||
Location: `/icons/${iconName}`,
|
Location: `/icons/${iconName}`,
|
||||||
@@ -44,4 +44,4 @@ const output = JSON.stringify(vercelRouteConfig, null, 2);
|
|||||||
|
|
||||||
const vercelOutputJSON = path.resolve(currentDir, '.vercel/output/config.json');
|
const vercelOutputJSON = path.resolve(currentDir, '.vercel/output/config.json');
|
||||||
|
|
||||||
fs.writeFileSync(vercelOutputJSON, output, 'utf-8');
|
await fs.promises.writeFile(vercelOutputJSON, output, 'utf-8');
|
||||||
|
|||||||
29
icons/battery-plus.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../icon.schema.json",
|
||||||
|
"contributors": [
|
||||||
|
"colebemis",
|
||||||
|
"ericfennis",
|
||||||
|
"jguddas",
|
||||||
|
"johnletey",
|
||||||
|
"Footagesus"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"power",
|
||||||
|
"electricity",
|
||||||
|
"energy",
|
||||||
|
"accumulator",
|
||||||
|
"charge",
|
||||||
|
"plus",
|
||||||
|
"economy",
|
||||||
|
"health",
|
||||||
|
"add",
|
||||||
|
"new",
|
||||||
|
"maximum",
|
||||||
|
"upgrade",
|
||||||
|
"extra",
|
||||||
|
"+"
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
"devices"
|
||||||
|
]
|
||||||
|
}
|
||||||
17
icons/battery-plus.svg
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="M10 9v6" />
|
||||||
|
<path d="M13.5 7H16a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-2.5" />
|
||||||
|
<path d="M22 11v2" />
|
||||||
|
<path d="M6.5 17H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2.5" />
|
||||||
|
<path d="M7 12h6" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 398 B |
@@ -9,7 +9,7 @@
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
>
|
>
|
||||||
<path d="M19.4 14.9C20.2 16.4 21 17 21 17H3s3-2 3-9c0-3.3 2.7-6 6-6 .7 0 1.3.1 1.9.3" />
|
<path d="M10.268 21a2 2 0 0 0 3.464 0" />
|
||||||
<path d="M10.3 21a1.94 1.94 0 0 0 3.4 0" />
|
<path d="M13.916 2.314A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.74 7.327A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673 9 9 0 0 1-.585-.665" />
|
||||||
<circle cx="18" cy="8" r="3" />
|
<circle cx="18" cy="8" r="3" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 379 B After Width: | Height: | Size: 418 B |
@@ -9,7 +9,7 @@
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
>
|
>
|
||||||
<path d="M18.4 12c.8 3.8 2.6 5 2.6 5H3s3-2 3-9c0-3.3 2.7-6 6-6 1.8 0 3.4.8 4.5 2" />
|
<path d="M10.268 21a2 2 0 0 0 3.464 0" />
|
||||||
<path d="M10.3 21a1.94 1.94 0 0 0 3.4 0" />
|
|
||||||
<path d="M15 8h6" />
|
<path d="M15 8h6" />
|
||||||
|
<path d="M16.243 3.757A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673A9.4 9.4 0 0 1 18.667 12" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 412 B |
@@ -9,8 +9,8 @@
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
>
|
>
|
||||||
<path d="M8.7 3A6 6 0 0 1 18 8a21.3 21.3 0 0 0 .6 5" />
|
<path d="M10.268 21a2 2 0 0 0 3.464 0" />
|
||||||
<path d="M17 17H3s3-2 3-9a4.67 4.67 0 0 1 .3-1.7" />
|
<path d="M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742" />
|
||||||
<path d="M10.3 21a1.94 1.94 0 0 0 3.4 0" />
|
|
||||||
<path d="m2 2 20 20" />
|
<path d="m2 2 20 20" />
|
||||||
|
<path d="M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 393 B After Width: | Height: | Size: 438 B |
@@ -9,8 +9,8 @@
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
>
|
>
|
||||||
<path d="M19.3 14.8C20.1 16.4 21 17 21 17H3s3-2 3-9c0-3.3 2.7-6 6-6 1 0 1.9.2 2.8.7" />
|
<path d="M10.268 21a2 2 0 0 0 3.464 0" />
|
||||||
<path d="M10.3 21a1.94 1.94 0 0 0 3.4 0" />
|
|
||||||
<path d="M15 8h6" />
|
<path d="M15 8h6" />
|
||||||
<path d="M18 5v6" />
|
<path d="M18 5v6" />
|
||||||
|
<path d="M20.002 14.464a9 9 0 0 0 .738.863A1 1 0 0 1 20 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 8.75-5.332" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 390 B After Width: | Height: | Size: 431 B |
@@ -9,8 +9,8 @@
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
>
|
>
|
||||||
<path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" />
|
<path d="M10.268 21a2 2 0 0 0 3.464 0" />
|
||||||
<path d="M10.3 21a1.94 1.94 0 0 0 3.4 0" />
|
|
||||||
<path d="M4 2C2.8 3.7 2 5.7 2 8" />
|
|
||||||
<path d="M22 8c0-2.3-.8-4.3-2-6" />
|
<path d="M22 8c0-2.3-.8-4.3-2-6" />
|
||||||
|
<path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" />
|
||||||
|
<path d="M4 2C2.8 3.7 2 5.7 2 8" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 469 B |
@@ -9,6 +9,6 @@
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
>
|
>
|
||||||
<path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" />
|
<path d="M10.268 21a2 2 0 0 0 3.464 0" />
|
||||||
<path d="M10.3 21a1.94 1.94 0 0 0 3.4 0" />
|
<path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 393 B |
@@ -14,7 +14,7 @@
|
|||||||
"diy",
|
"diy",
|
||||||
"fixed",
|
"fixed",
|
||||||
"build",
|
"build",
|
||||||
"contruction",
|
"construction",
|
||||||
"parts"
|
"parts"
|
||||||
],
|
],
|
||||||
"categories": [
|
"categories": [
|
||||||
|
|||||||
@@ -9,15 +9,15 @@
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
>
|
>
|
||||||
<path d="M12 17h2" />
|
<path d="M12 17h1.5" />
|
||||||
<path d="M12 22h2" />
|
<path d="M12 22h1.5" />
|
||||||
<path d="M12 2h2" />
|
<path d="M12 2h1.5" />
|
||||||
<path d="M18 22h1a1 1 0 0 0 1-1" />
|
<path d="M17.5 22H19a1 1 0 0 0 1-1" />
|
||||||
<path d="M18 2h1a1 1 0 0 1 1 1v1" />
|
<path d="M17.5 2H19a1 1 0 0 1 1 1v1.5" />
|
||||||
<path d="M20 15v2h-2" />
|
<path d="M20 14v3h-2.5" />
|
||||||
<path d="M20 8v3" />
|
<path d="M20 8.5V10" />
|
||||||
<path d="M4 11V9" />
|
<path d="M4 10V8.5" />
|
||||||
<path d="M4 19.5V15" />
|
<path d="M4 19.5V14" />
|
||||||
<path d="M4 5v-.5A2.5 2.5 0 0 1 6.5 2H8" />
|
<path d="M4 4.5A2.5 2.5 0 0 1 6.5 2H8" />
|
||||||
<path d="M8 22H6.5a1 1 0 0 1 0-5H8" />
|
<path d="M8 22H6.5a1 1 0 0 1 0-5H8" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 542 B After Width: | Height: | Size: 561 B |
@@ -12,7 +12,8 @@
|
|||||||
"enterprise",
|
"enterprise",
|
||||||
"skyscraper",
|
"skyscraper",
|
||||||
"organisation",
|
"organisation",
|
||||||
"organization"
|
"organization",
|
||||||
|
"city"
|
||||||
],
|
],
|
||||||
"categories": [
|
"categories": [
|
||||||
"account",
|
"account",
|
||||||
|
|||||||
16
icons/circle-small.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../icon.schema.json",
|
||||||
|
"contributors": [
|
||||||
|
"jamiemlaw"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"shape",
|
||||||
|
"bullet",
|
||||||
|
"gender",
|
||||||
|
"genderless"
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
"shapes",
|
||||||
|
"medical"
|
||||||
|
]
|
||||||
|
}
|
||||||
13
icons/circle-small.svg
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<circle cx="12" cy="12" r="6" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 243 B |
@@ -10,7 +10,13 @@
|
|||||||
"cog",
|
"cog",
|
||||||
"edit",
|
"edit",
|
||||||
"gear",
|
"gear",
|
||||||
"preferences"
|
"preferences",
|
||||||
|
"controls",
|
||||||
|
"configuration",
|
||||||
|
"fixed",
|
||||||
|
"build",
|
||||||
|
"construction",
|
||||||
|
"parts"
|
||||||
],
|
],
|
||||||
"categories": [
|
"categories": [
|
||||||
"account"
|
"account"
|
||||||
|
|||||||
@@ -2,13 +2,18 @@
|
|||||||
"$schema": "../icon.schema.json",
|
"$schema": "../icon.schema.json",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"mittalyashu",
|
"mittalyashu",
|
||||||
"ericfennis"
|
"ericfennis",
|
||||||
|
"jguddas"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"scale",
|
"scale",
|
||||||
"fullscreen"
|
"fullscreen",
|
||||||
|
"maximize",
|
||||||
|
"minimize",
|
||||||
|
"contract"
|
||||||
],
|
],
|
||||||
"categories": [
|
"categories": [
|
||||||
"text"
|
"text",
|
||||||
|
"arrows"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,12 @@
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
>
|
>
|
||||||
<path d="m21 21-6-6m6 6v-4.8m0 4.8h-4.8" />
|
<path d="m15 15 6 6" />
|
||||||
<path d="M3 16.2V21m0 0h4.8M3 21l6-6" />
|
<path d="m15 9 6-6" />
|
||||||
<path d="M21 7.8V3m0 0h-4.8M21 3l-6 6" />
|
<path d="M21 16.2V21h-4.8" />
|
||||||
<path d="M3 7.8V3m0 0h4.8M3 3l6 6" />
|
<path d="M21 7.8V3h-4.8" />
|
||||||
|
<path d="M3 16.2V21h4.8" />
|
||||||
|
<path d="m3 21 6-6" />
|
||||||
|
<path d="M3 7.8V3h4.8" />
|
||||||
|
<path d="M9 9 3 3" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 381 B After Width: | Height: | Size: 428 B |
@@ -26,5 +26,8 @@
|
|||||||
"text",
|
"text",
|
||||||
"layout",
|
"layout",
|
||||||
"math"
|
"math"
|
||||||
|
],
|
||||||
|
"aliases": [
|
||||||
|
"grid-2-x-2-check"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,5 +26,8 @@
|
|||||||
"text",
|
"text",
|
||||||
"layout",
|
"layout",
|
||||||
"math"
|
"math"
|
||||||
|
],
|
||||||
|
"aliases": [
|
||||||
|
"grid-2-x-2-x"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
20
icons/house-wifi.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../icon.schema.json",
|
||||||
|
"contributors": [
|
||||||
|
"akshaymemane",
|
||||||
|
"jguddas",
|
||||||
|
"karsa-mistmere"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"home",
|
||||||
|
"living",
|
||||||
|
"building",
|
||||||
|
"wifi",
|
||||||
|
"connectivity"
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
"home",
|
||||||
|
"buildings",
|
||||||
|
"connectivity"
|
||||||
|
]
|
||||||
|
}
|
||||||
16
icons/house-wifi.svg
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="M9.5 13.866a4 4 0 0 1 5 .01" />
|
||||||
|
<path d="M12 17h.01" />
|
||||||
|
<path d="M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
|
||||||
|
<path d="M7 10.754a8 8 0 0 1 10 0" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 442 B |
16
icons/list-filter-plus.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../icon.schema.json",
|
||||||
|
"contributors": [
|
||||||
|
"abdeniz"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"filter",
|
||||||
|
"plus",
|
||||||
|
"options",
|
||||||
|
"add"
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
"text",
|
||||||
|
"layout"
|
||||||
|
]
|
||||||
|
}
|
||||||
17
icons/list-filter-plus.svg
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="M10 18h4" />
|
||||||
|
<path d="M11 6H3" />
|
||||||
|
<path d="M15 6h6" />
|
||||||
|
<path d="M18 9V3" />
|
||||||
|
<path d="M7 12h8" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 324 B |
20
icons/map-plus.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../icon.schema.json",
|
||||||
|
"contributors": [
|
||||||
|
"colebemis",
|
||||||
|
"karsa-mistmere",
|
||||||
|
"ericfennis",
|
||||||
|
"Seanw265"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"location",
|
||||||
|
"navigation",
|
||||||
|
"travel",
|
||||||
|
"new",
|
||||||
|
"add",
|
||||||
|
"create"
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
"navigation"
|
||||||
|
]
|
||||||
|
}
|
||||||
17
icons/map-plus.svg
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="m11 19-1.106-.552a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0l4.212 2.106a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619V12" />
|
||||||
|
<path d="M15 5.764V12" />
|
||||||
|
<path d="M18 15v6" />
|
||||||
|
<path d="M21 18h-6" />
|
||||||
|
<path d="M9 3.236v15" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 513 B |
14
icons/mars-stroke.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../icon.schema.json",
|
||||||
|
"contributors": [
|
||||||
|
"jamiemlaw"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"gender",
|
||||||
|
"androgyne",
|
||||||
|
"transgender"
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
"medical"
|
||||||
|
]
|
||||||
|
}
|
||||||
16
icons/mars-stroke.svg
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="m14 6 4 4" />
|
||||||
|
<path d="M17 3h4v4" />
|
||||||
|
<path d="m21 3-7.75 7.75" />
|
||||||
|
<circle cx="9" cy="15" r="6" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 323 B |
18
icons/mars.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../icon.schema.json",
|
||||||
|
"contributors": [
|
||||||
|
"jguddas",
|
||||||
|
"jamiemlaw"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"gender",
|
||||||
|
"sex",
|
||||||
|
"male",
|
||||||
|
"masculine",
|
||||||
|
"man",
|
||||||
|
"boy"
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
"medical"
|
||||||
|
]
|
||||||
|
}
|
||||||
15
icons/mars.svg
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="M16 3h5v5" />
|
||||||
|
<path d="m21 3-6.75 6.75" />
|
||||||
|
<circle cx="10" cy="14" r="6" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 299 B |
14
icons/non-binary.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../icon.schema.json",
|
||||||
|
"contributors": [
|
||||||
|
"jamiemlaw"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"gender",
|
||||||
|
"nonbinary",
|
||||||
|
"enby"
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
"medical"
|
||||||
|
]
|
||||||
|
}
|
||||||
16
icons/non-binary.svg
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="M12 2v10" />
|
||||||
|
<path d="m9 4 6 4" />
|
||||||
|
<path d="m9 8 6-4" />
|
||||||
|
<circle cx="12" cy="17" r="5" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 315 B |
@@ -6,7 +6,8 @@
|
|||||||
"ericfennis",
|
"ericfennis",
|
||||||
"karsa-mistmere",
|
"karsa-mistmere",
|
||||||
"danielbayley",
|
"danielbayley",
|
||||||
"jguddas"
|
"jguddas",
|
||||||
|
"sezze"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"box",
|
"box",
|
||||||
|
|||||||
@@ -11,6 +11,6 @@
|
|||||||
>
|
>
|
||||||
<path d="M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z" />
|
<path d="M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z" />
|
||||||
<path d="M12 22V12" />
|
<path d="M12 22V12" />
|
||||||
<path d="m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7" />
|
<polyline points="3.29 7 12 12 20.71 7" />
|
||||||
<path d="m7.5 4.27 9 5.15" />
|
<path d="m7.5 4.27 9 5.15" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 460 B After Width: | Height: | Size: 446 B |
@@ -9,9 +9,9 @@
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
>
|
>
|
||||||
<path d="M17 5c0-1.7-1.3-3-3-3s-3 1.3-3 3c0 .8.3 1.5.8 2H11c-3.9 0-7 3.1-7 7c0 2.2 1.8 4 4 4" />
|
|
||||||
<path d="M16.8 3.9c.3-.3.6-.5 1-.7 1.5-.6 3.3.1 3.9 1.6.6 1.5-.1 3.3-1.6 3.9l1.6 2.8c.2.3.2.7.2 1-.2.8-.9 1.2-1.7 1.1 0 0-1.6-.3-2.7-.6H17c-1.7 0-3 1.3-3 3" />
|
|
||||||
<path d="M13.2 18a3 3 0 0 0-2.2-5" />
|
|
||||||
<path d="M13 22H4a2 2 0 0 1 0-4h12" />
|
<path d="M13 22H4a2 2 0 0 1 0-4h12" />
|
||||||
|
<path d="M13.236 18a3 3 0 0 0-2.2-5" />
|
||||||
<path d="M16 9h.01" />
|
<path d="M16 9h.01" />
|
||||||
|
<path d="M16.82 3.94a3 3 0 1 1 3.237 4.868l1.815 2.587a1.5 1.5 0 0 1-1.5 2.1l-2.872-.453a3 3 0 0 0-3.5 3" />
|
||||||
|
<path d="M17 4.988a3 3 0 1 0-5.2 2.052A7 7 0 0 0 4 14.015 4 4 0 0 0 8 18" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 575 B After Width: | Height: | Size: 506 B |
@@ -17,7 +17,12 @@
|
|||||||
"rerun",
|
"rerun",
|
||||||
"refresh",
|
"refresh",
|
||||||
"backup",
|
"backup",
|
||||||
"undo"
|
"undo",
|
||||||
|
"replay",
|
||||||
|
"redo",
|
||||||
|
"retry",
|
||||||
|
"rewind",
|
||||||
|
"reverse"
|
||||||
],
|
],
|
||||||
"categories": [
|
"categories": [
|
||||||
"arrows",
|
"arrows",
|
||||||
|
|||||||
19
icons/scan-heart.json
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../icon.schema.json",
|
||||||
|
"contributors": [
|
||||||
|
"karsa-mistmere",
|
||||||
|
"jguddas"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"health",
|
||||||
|
"heart rate",
|
||||||
|
"pulse",
|
||||||
|
"monitoring",
|
||||||
|
"healthiness",
|
||||||
|
"screening",
|
||||||
|
"dashed"
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
"medical"
|
||||||
|
]
|
||||||
|
}
|
||||||
17
icons/scan-heart.svg
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="M11.246 16.657a1 1 0 0 0 1.508 0l3.57-4.101A2.75 2.75 0 1 0 12 9.168a2.75 2.75 0 1 0-4.324 3.388z" />
|
||||||
|
<path d="M17 3h2a2 2 0 0 1 2 2v2" />
|
||||||
|
<path d="M21 17v2a2 2 0 0 1-2 2h-2" />
|
||||||
|
<path d="M3 7V5a2 2 0 0 1 2-2h2" />
|
||||||
|
<path d="M7 21H5a2 2 0 0 1-2-2v-2" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 479 B |
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../icon.schema.json",
|
"$schema": "../icon.schema.json",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
|
"karsa-mistmere",
|
||||||
"lscheibel",
|
"lscheibel",
|
||||||
"ericfennis"
|
"ericfennis"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -9,10 +9,16 @@
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
>
|
>
|
||||||
<line x1="2" x2="22" y1="12" y2="12" />
|
<path d="m10 20-1.25-2.5L6 18" />
|
||||||
<line x1="12" x2="12" y1="2" y2="22" />
|
<path d="M10 4 8.75 6.5 6 6" />
|
||||||
<path d="m20 16-4-4 4-4" />
|
<path d="m14 20 1.25-2.5L18 18" />
|
||||||
<path d="m4 8 4 4-4 4" />
|
<path d="m14 4 1.25 2.5L18 6" />
|
||||||
<path d="m16 4-4 4-4-4" />
|
<path d="m17 21-3-6h-4" />
|
||||||
<path d="m8 20 4-4 4 4" />
|
<path d="m17 3-3 6 1.5 3" />
|
||||||
|
<path d="M2 12h6.5L10 9" />
|
||||||
|
<path d="m20 10-1.5 2 1.5 2" />
|
||||||
|
<path d="M22 12h-6.5L14 15" />
|
||||||
|
<path d="m4 10 1.5 2L4 14" />
|
||||||
|
<path d="m7 21 3-6-1.5-3" />
|
||||||
|
<path d="m7 3 3 6h4" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 408 B After Width: | Height: | Size: 596 B |
@@ -9,15 +9,15 @@
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
>
|
>
|
||||||
<path d="M10 9a3 3 0 1 0 0 6" />
|
|
||||||
<path d="M2 12h1" />
|
|
||||||
<path d="M14 21V3" />
|
|
||||||
<path d="M10 4V3" />
|
|
||||||
<path d="M10 21v-1" />
|
<path d="M10 21v-1" />
|
||||||
|
<path d="M10 4V3" />
|
||||||
|
<path d="M10 9a3 3 0 0 0 0 6" />
|
||||||
|
<path d="m14 20 1.25-2.5L18 18" />
|
||||||
|
<path d="m14 4 1.25 2.5L18 6" />
|
||||||
|
<path d="m17 21-3-6 1.5-3H22" />
|
||||||
|
<path d="m17 3-3 6 1.5 3" />
|
||||||
|
<path d="M2 12h1" />
|
||||||
|
<path d="m20 10-1.5 2 1.5 2" />
|
||||||
<path d="m3.64 18.36.7-.7" />
|
<path d="m3.64 18.36.7-.7" />
|
||||||
<path d="m4.34 6.34-.7-.7" />
|
<path d="m4.34 6.34-.7-.7" />
|
||||||
<path d="M14 12h8" />
|
|
||||||
<path d="m17 4-3 3" />
|
|
||||||
<path d="m14 17 3 3" />
|
|
||||||
<path d="m21 15-3-3 3-3" />
|
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 507 B After Width: | Height: | Size: 550 B |
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../icon.schema.json",
|
"$schema": "../icon.schema.json",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"ericfennis",
|
"karsa-mistmere",
|
||||||
"karsa-mistmere"
|
"ericfennis"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"temperature",
|
"temperature",
|
||||||
|
|||||||
@@ -9,10 +9,12 @@
|
|||||||
stroke-linecap="round"
|
stroke-linecap="round"
|
||||||
stroke-linejoin="round"
|
stroke-linejoin="round"
|
||||||
>
|
>
|
||||||
<path d="M2 12h10" />
|
<path d="m10 20-1.25-2.5L6 18" />
|
||||||
<path d="M9 4v16" />
|
<path d="M10 4 8.75 6.5 6 6" />
|
||||||
<path d="m3 9 3 3-3 3" />
|
<path d="M10.585 15H10" />
|
||||||
<path d="M12 6 9 9 6 6" />
|
<path d="M2 12h6.5L10 9" />
|
||||||
<path d="m6 18 3-3 1.5 1.5" />
|
<path d="M20 14.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0z" />
|
||||||
<path d="M20 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z" />
|
<path d="m4 10 1.5 2L4 14" />
|
||||||
|
<path d="m7 21 3-6-1.5-3" />
|
||||||
|
<path d="m7 3 3 6h2" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 403 B After Width: | Height: | Size: 482 B |
14
icons/transgender.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../icon.schema.json",
|
||||||
|
"contributors": [
|
||||||
|
"jamiemlaw"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"gender",
|
||||||
|
"inclusive"
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
"medical",
|
||||||
|
"accessibility"
|
||||||
|
]
|
||||||
|
}
|
||||||
20
icons/transgender.svg
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="M12 16v6" />
|
||||||
|
<path d="M14 20h-4" />
|
||||||
|
<path d="M18 2h4v4" />
|
||||||
|
<path d="m2 2 7.17 7.17" />
|
||||||
|
<path d="M2 5.355V2h3.357" />
|
||||||
|
<path d="m22 2-7.17 7.17" />
|
||||||
|
<path d="M8 5 5 8" />
|
||||||
|
<circle cx="12" cy="12" r="4" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 434 B |
21
icons/triangle-dashed.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../icon.schema.json",
|
||||||
|
"contributors": [
|
||||||
|
"colebemis",
|
||||||
|
"csandman",
|
||||||
|
"ericfennis",
|
||||||
|
"karsa-mistmere",
|
||||||
|
"Yohh"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"equilateral",
|
||||||
|
"delta",
|
||||||
|
"shape",
|
||||||
|
"pyramid",
|
||||||
|
"hierarchy",
|
||||||
|
"dashed"
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
"shapes"
|
||||||
|
]
|
||||||
|
}
|
||||||
21
icons/triangle-dashed.svg
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="M10.17 4.193a2 2 0 0 1 3.666.013" />
|
||||||
|
<path d="M14 21h2" />
|
||||||
|
<path d="m15.874 7.743 1 1.732" />
|
||||||
|
<path d="m18.849 12.952 1 1.732" />
|
||||||
|
<path d="M21.824 18.18a2 2 0 0 1-1.835 2.824" />
|
||||||
|
<path d="M4.024 21a2 2 0 0 1-1.839-2.839" />
|
||||||
|
<path d="m5.136 12.952-1 1.732" />
|
||||||
|
<path d="M8 21h2" />
|
||||||
|
<path d="m8.102 7.743-1 1.732" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 549 B |
@@ -8,7 +8,10 @@
|
|||||||
"sports",
|
"sports",
|
||||||
"winner",
|
"winner",
|
||||||
"achievement",
|
"achievement",
|
||||||
"award"
|
"award",
|
||||||
|
"champion",
|
||||||
|
"celebration",
|
||||||
|
"victory"
|
||||||
],
|
],
|
||||||
"categories": [
|
"categories": [
|
||||||
"sports",
|
"sports",
|
||||||
|
|||||||
16
icons/venus-and-mars.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../icon.schema.json",
|
||||||
|
"contributors": [
|
||||||
|
"jamiemlaw"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"gender",
|
||||||
|
"sex",
|
||||||
|
"intersex",
|
||||||
|
"androgynous",
|
||||||
|
"hermaphrodite"
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
"medical"
|
||||||
|
]
|
||||||
|
}
|
||||||
17
icons/venus-and-mars.svg
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="M10 20h4" />
|
||||||
|
<path d="M12 16v6" />
|
||||||
|
<path d="M17 2h4v4" />
|
||||||
|
<path d="m21 2-5.46 5.46" />
|
||||||
|
<circle cx="12" cy="11" r="5" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 347 B |
18
icons/venus.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../icon.schema.json",
|
||||||
|
"contributors": [
|
||||||
|
"jguddas",
|
||||||
|
"jamiemlaw"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"gender",
|
||||||
|
"sex",
|
||||||
|
"female",
|
||||||
|
"feminine",
|
||||||
|
"woman",
|
||||||
|
"girl"
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
"medical"
|
||||||
|
]
|
||||||
|
}
|
||||||
15
icons/venus.svg
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="M12 15v7" />
|
||||||
|
<path d="M9 19h6" />
|
||||||
|
<circle cx="12" cy="9" r="6" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 289 B |
22
icons/waves-ladder.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../icon.schema.json",
|
||||||
|
"contributors": [
|
||||||
|
"karsa-mistmere"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"swimming",
|
||||||
|
"water",
|
||||||
|
"pool",
|
||||||
|
"lifeguard",
|
||||||
|
"ocean",
|
||||||
|
"🌊",
|
||||||
|
"🏊♂️",
|
||||||
|
"🏊♀️",
|
||||||
|
"🏊",
|
||||||
|
"🥽"
|
||||||
|
],
|
||||||
|
"categories": [
|
||||||
|
"sports",
|
||||||
|
"home"
|
||||||
|
]
|
||||||
|
}
|
||||||
17
icons/waves-ladder.svg
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="24"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
>
|
||||||
|
<path d="M19 5a2 2 0 0 0-2 2v11" />
|
||||||
|
<path d="M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1" />
|
||||||
|
<path d="M7 13h10" />
|
||||||
|
<path d="M7 9h10" />
|
||||||
|
<path d="M9 5a2 2 0 0 0-2 2v11" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 434 B |
@@ -1,8 +1,15 @@
|
|||||||
/* eslint-disable import/no-extraneous-dependencies */
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
||||||
|
|
||||||
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
|
export default async ({
|
||||||
const svgContents = getSvg();
|
componentName,
|
||||||
|
iconName,
|
||||||
|
children,
|
||||||
|
getSvg,
|
||||||
|
deprecated,
|
||||||
|
deprecationReason,
|
||||||
|
}) => {
|
||||||
|
const svgContents = await getSvg();
|
||||||
const svgBase64 = base64SVG(svgContents);
|
const svgBase64 = base64SVG(svgContents);
|
||||||
|
|
||||||
return `\
|
return `\
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
"rollup": "^4.22.4",
|
"rollup": "^4.22.4",
|
||||||
"rollup-plugin-dts": "^6.1.0",
|
"rollup-plugin-dts": "^6.1.0",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^5.3.3",
|
||||||
"vite": "5.1.8",
|
"vite": "5.4.13",
|
||||||
"vitest": "^1.1.1"
|
"vitest": "^1.1.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import plugins from '@lucide/rollup-plugins';
|
import plugins from '@lucide/rollup-plugins';
|
||||||
import dts from 'rollup-plugin-dts';
|
import dts from 'rollup-plugin-dts';
|
||||||
import pkg from './package.json' assert { type: 'json' };
|
import pkg from './package.json' with { type: 'json' };
|
||||||
|
|
||||||
const packageName = 'LucidePreact';
|
const packageName = 'LucidePreact';
|
||||||
const outputFileName = 'lucide-preact';
|
const outputFileName = 'lucide-preact';
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
/* eslint-disable import/no-extraneous-dependencies */
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
||||||
|
|
||||||
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
|
export default async ({
|
||||||
const svgContents = getSvg();
|
componentName,
|
||||||
|
iconName,
|
||||||
|
children,
|
||||||
|
getSvg,
|
||||||
|
deprecated,
|
||||||
|
deprecationReason,
|
||||||
|
}) => {
|
||||||
|
const svgContents = await getSvg();
|
||||||
const svgBase64 = base64SVG(svgContents);
|
const svgBase64 = base64SVG(svgContents);
|
||||||
|
|
||||||
return `
|
return `
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
"rollup": "^4.22.4",
|
"rollup": "^4.22.4",
|
||||||
"rollup-plugin-dts": "^6.1.0",
|
"rollup-plugin-dts": "^6.1.0",
|
||||||
"typescript": "^4.8.4",
|
"typescript": "^4.8.4",
|
||||||
"vite": "5.1.8",
|
"vite": "5.4.13",
|
||||||
"vitest": "^1.1.1"
|
"vitest": "^1.1.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
/* eslint-disable import/no-extraneous-dependencies */
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
||||||
|
|
||||||
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
|
export default async ({
|
||||||
const svgContents = getSvg();
|
componentName,
|
||||||
|
iconName,
|
||||||
|
children,
|
||||||
|
getSvg,
|
||||||
|
deprecated,
|
||||||
|
deprecationReason,
|
||||||
|
}) => {
|
||||||
|
const svgContents = await getSvg();
|
||||||
const svgBase64 = base64SVG(svgContents);
|
const svgBase64 = base64SVG(svgContents);
|
||||||
|
|
||||||
return `
|
return `
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
import {
|
import { forwardRef, createElement, FunctionComponent } from 'react';
|
||||||
forwardRef,
|
|
||||||
createElement,
|
|
||||||
ReactSVG,
|
|
||||||
FunctionComponent,
|
|
||||||
ForwardRefExoticComponent,
|
|
||||||
} from 'react';
|
|
||||||
import * as NativeSvg from 'react-native-svg';
|
import * as NativeSvg from 'react-native-svg';
|
||||||
import defaultAttributes, { childDefaultAttributes } from './defaultAttributes';
|
import defaultAttributes, { childDefaultAttributes } from './defaultAttributes';
|
||||||
import { IconNode, LucideIcon, LucideProps } from './types';
|
import { IconNode, LucideIcon, LucideProps } from './types';
|
||||||
|
|||||||
@@ -1,7 +1,22 @@
|
|||||||
import type { ForwardRefExoticComponent, ReactSVG } from 'react';
|
import type { ForwardRefExoticComponent } from 'react';
|
||||||
import type { SvgProps } from 'react-native-svg';
|
import type { SvgProps } from 'react-native-svg';
|
||||||
|
|
||||||
export type IconNode = [elementName: keyof ReactSVG, attrs: Record<string, string>][];
|
/**
|
||||||
|
* A reduced version of `SVGElementType` from @types/react. This type was added
|
||||||
|
* with the release of React 19, and is included here in order to support usage
|
||||||
|
* with older versions.
|
||||||
|
*/
|
||||||
|
type SVGElementType =
|
||||||
|
| 'circle'
|
||||||
|
| 'ellipse'
|
||||||
|
| 'g'
|
||||||
|
| 'line'
|
||||||
|
| 'path'
|
||||||
|
| 'polygon'
|
||||||
|
| 'polyline'
|
||||||
|
| 'rect';
|
||||||
|
|
||||||
|
export type IconNode = [elementName: SVGElementType, attrs: Record<string, string>][];
|
||||||
|
|
||||||
export interface LucideProps extends SvgProps {
|
export interface LucideProps extends SvgProps {
|
||||||
size?: string | number;
|
size?: string | number;
|
||||||
|
|||||||
1
packages/lucide-react/dynamicIconImports.mjs
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { default } from './dist/esm/dynamicIconImports.js';
|
||||||
@@ -31,14 +31,17 @@
|
|||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"files": [
|
"files": [
|
||||||
"dist",
|
"dist",
|
||||||
"dynamicIconImports.js",
|
"dynamic.mjs",
|
||||||
|
"dynamic.js.map",
|
||||||
|
"dynamic.d.ts",
|
||||||
|
"dynamicIconImports.mjs",
|
||||||
"dynamicIconImports.js.map",
|
"dynamicIconImports.js.map",
|
||||||
"dynamicIconImports.d.ts"
|
"dynamicIconImports.d.ts"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "pnpm clean && pnpm copy:license && pnpm build:icons && pnpm typecheck && pnpm build:bundles",
|
"build": "pnpm clean && pnpm copy:license && pnpm build:icons && pnpm typecheck && pnpm build:bundles",
|
||||||
"copy:license": "cp ../../LICENSE ./LICENSE",
|
"copy:license": "cp ../../LICENSE ./LICENSE",
|
||||||
"clean": "rm -rf dist && rm -rf stats && rm -rf ./src/icons/*.ts && rm -f dynamicIconImports.*",
|
"clean": "rm -rf dist && rm -rf stats && rm -rf ./src/icons/*.ts && rm -f dynamic.* && rm -f dynamicIconImports.d.ts",
|
||||||
"build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mjs --renderUniqueKey --withAliases --withDynamicImports --separateAliasesFile --aliasesFileExtension=.ts --iconFileExtension=.ts --exportFileName=index.ts",
|
"build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mjs --renderUniqueKey --withAliases --withDynamicImports --separateAliasesFile --aliasesFileExtension=.ts --iconFileExtension=.ts --exportFileName=index.ts",
|
||||||
"build:bundles": "rollup -c ./rollup.config.mjs",
|
"build:bundles": "rollup -c ./rollup.config.mjs",
|
||||||
"typecheck": "tsc",
|
"typecheck": "tsc",
|
||||||
@@ -60,11 +63,12 @@
|
|||||||
"react-dom": "18.2.0",
|
"react-dom": "18.2.0",
|
||||||
"rollup": "^4.22.4",
|
"rollup": "^4.22.4",
|
||||||
"rollup-plugin-dts": "^6.1.0",
|
"rollup-plugin-dts": "^6.1.0",
|
||||||
|
"rollup-plugin-preserve-directives": "^0.4.0",
|
||||||
"typescript": "^4.9.5",
|
"typescript": "^4.9.5",
|
||||||
"vite": "5.1.8",
|
"vite": "5.4.13",
|
||||||
"vitest": "^1.1.1"
|
"vitest": "^1.1.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc"
|
"react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import plugins from '@lucide/rollup-plugins';
|
import plugins from '@lucide/rollup-plugins';
|
||||||
|
import preserveDirectives from 'rollup-plugin-preserve-directives';
|
||||||
import pkg from './package.json' assert { type: 'json' };
|
import pkg from './package.json' assert { type: 'json' };
|
||||||
import dts from 'rollup-plugin-dts';
|
import dts from 'rollup-plugin-dts';
|
||||||
import getAliasesEntryNames from './scripts/getAliasesEntryNames.mjs';
|
import getAliasesEntryNames from './scripts/getAliasesEntryNames.mjs';
|
||||||
@@ -7,35 +8,34 @@ const aliasesEntries = await getAliasesEntryNames();
|
|||||||
|
|
||||||
const packageName = 'LucideReact';
|
const packageName = 'LucideReact';
|
||||||
const outputFileName = 'lucide-react';
|
const outputFileName = 'lucide-react';
|
||||||
const outputDir = `dist`;
|
|
||||||
const inputs = [`src/lucide-react.ts`];
|
const inputs = [`src/lucide-react.ts`];
|
||||||
const bundles = [
|
const bundles = [
|
||||||
{
|
{
|
||||||
format: 'umd',
|
format: 'umd',
|
||||||
inputs,
|
inputs,
|
||||||
outputDir,
|
outputDir: 'dist/umd',
|
||||||
minify: true,
|
minify: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
format: 'umd',
|
format: 'umd',
|
||||||
inputs,
|
inputs,
|
||||||
outputDir,
|
outputDir: 'dist/umd',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
inputs,
|
inputs,
|
||||||
outputDir,
|
outputDir: 'dist/cjs',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
format: 'esm',
|
format: 'esm',
|
||||||
inputs: [...inputs, ...aliasesEntries],
|
inputs: [...inputs, , 'src/dynamicIconImports.ts', 'src/DynamicIcon.ts', ...aliasesEntries],
|
||||||
outputDir,
|
outputDir: 'dist/esm',
|
||||||
preserveModules: true,
|
preserveModules: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
format: 'esm',
|
format: 'esm',
|
||||||
inputs: ['src/dynamicIconImports.ts'],
|
inputs: ['src/dynamic.ts'],
|
||||||
outputFile: 'dynamicIconImports.js',
|
outputFile: 'dynamic.mjs',
|
||||||
external: [/src/],
|
external: [/src/],
|
||||||
paths: (id) => {
|
paths: (id) => {
|
||||||
if (id.match(/src/)) {
|
if (id.match(/src/)) {
|
||||||
@@ -62,18 +62,23 @@ const configs = bundles
|
|||||||
}) =>
|
}) =>
|
||||||
inputs.map((input) => ({
|
inputs.map((input) => ({
|
||||||
input,
|
input,
|
||||||
plugins: plugins({ pkg, minify }),
|
plugins: [
|
||||||
|
...plugins({ pkg, minify }),
|
||||||
|
// Make sure we emit "use client" directive to make it compatible with Next.js
|
||||||
|
preserveDirectives({
|
||||||
|
include: 'src/DynamicIcon.ts',
|
||||||
|
suppressPreserveModulesWarning: true,
|
||||||
|
}),
|
||||||
|
],
|
||||||
external: ['react', 'prop-types', ...external],
|
external: ['react', 'prop-types', ...external],
|
||||||
output: {
|
output: {
|
||||||
name: packageName,
|
name: packageName,
|
||||||
...(preserveModules
|
...(preserveModules
|
||||||
? {
|
? {
|
||||||
dir: `${outputDir}/${format}`,
|
dir: outputDir,
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
file:
|
file: outputFile ?? `${outputDir}/${outputFileName}${minify ? '.min' : ''}.js`,
|
||||||
outputFile ??
|
|
||||||
`${outputDir}/${format}/${outputFileName}${minify ? '.min' : ''}.js`,
|
|
||||||
}),
|
}),
|
||||||
paths,
|
paths,
|
||||||
entryFileNames,
|
entryFileNames,
|
||||||
@@ -101,6 +106,16 @@ export default [
|
|||||||
],
|
],
|
||||||
plugins: [dts()],
|
plugins: [dts()],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
input: 'src/dynamic.ts',
|
||||||
|
output: [
|
||||||
|
{
|
||||||
|
file: `dynamic.d.ts`,
|
||||||
|
format: 'es',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
plugins: [dts()],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
input: inputs[0],
|
input: inputs[0],
|
||||||
output: [
|
output: [
|
||||||
|
|||||||
@@ -1,12 +1,22 @@
|
|||||||
/* eslint-disable import/no-extraneous-dependencies */
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
||||||
|
|
||||||
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
|
export default async ({
|
||||||
const svgContents = getSvg();
|
componentName,
|
||||||
|
iconName,
|
||||||
|
children,
|
||||||
|
getSvg,
|
||||||
|
deprecated,
|
||||||
|
deprecationReason,
|
||||||
|
}) => {
|
||||||
|
const svgContents = await getSvg();
|
||||||
const svgBase64 = base64SVG(svgContents);
|
const svgBase64 = base64SVG(svgContents);
|
||||||
|
|
||||||
return `
|
return `
|
||||||
import createLucideIcon from '../createLucideIcon';
|
import createLucideIcon from '../createLucideIcon';
|
||||||
|
import { IconNode } from '../types';
|
||||||
|
|
||||||
|
export const __iconNode: IconNode = ${JSON.stringify(children)}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @component @name ${componentName}
|
* @component @name ${componentName}
|
||||||
@@ -19,7 +29,7 @@ import createLucideIcon from '../createLucideIcon';
|
|||||||
* @returns {JSX.Element} JSX Element
|
* @returns {JSX.Element} JSX Element
|
||||||
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
|
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
|
||||||
*/
|
*/
|
||||||
const ${componentName} = createLucideIcon('${componentName}', ${JSON.stringify(children)});
|
const ${componentName} = createLucideIcon('${componentName}', __iconNode);
|
||||||
|
|
||||||
export default ${componentName};
|
export default ${componentName};
|
||||||
`;
|
`;
|
||||||
|
|||||||
73
packages/lucide-react/src/DynamicIcon.ts
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { createElement, forwardRef, useEffect, useState } from 'react';
|
||||||
|
import { IconNode, LucideIcon, LucideProps } from './types';
|
||||||
|
import dynamicIconImports from './dynamicIconImports';
|
||||||
|
import Icon from './Icon';
|
||||||
|
|
||||||
|
export type DynamicIconModule = { default: LucideIcon; __iconNode: IconNode };
|
||||||
|
|
||||||
|
export type IconName = keyof typeof dynamicIconImports;
|
||||||
|
|
||||||
|
export const iconNames = Object.keys(dynamicIconImports) as Array<IconName>;
|
||||||
|
|
||||||
|
interface DynamicIconComponentProps extends LucideProps {
|
||||||
|
name: IconName;
|
||||||
|
fallback?: () => JSX.Element | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getIconNode(name: IconName) {
|
||||||
|
if (!(name in dynamicIconImports)) {
|
||||||
|
throw new Error('[lucide-react]: Name in Lucide DynamicIcon not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Replace this with a generic iconNode package.
|
||||||
|
const icon = (await dynamicIconImports[name]()) as DynamicIconModule;
|
||||||
|
|
||||||
|
return icon.__iconNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dynamic Lucide icon component
|
||||||
|
*
|
||||||
|
* @component Icon
|
||||||
|
* @param {object} props
|
||||||
|
* @param {string} props.color - The color of the icon
|
||||||
|
* @param {number} props.size - The size of the icon
|
||||||
|
* @param {number} props.strokeWidth - The stroke width of the icon
|
||||||
|
* @param {boolean} props.absoluteStrokeWidth - Whether to use absolute stroke width
|
||||||
|
* @param {string} props.className - The class name of the icon
|
||||||
|
* @param {IconNode} props.children - The children of the icon
|
||||||
|
* @param {IconNode} props.iconNode - The icon node of the icon
|
||||||
|
*
|
||||||
|
* @returns {ForwardRefExoticComponent} LucideIcon
|
||||||
|
*/
|
||||||
|
const DynamicIcon = forwardRef<SVGSVGElement, DynamicIconComponentProps>(
|
||||||
|
({ name, fallback: Fallback, ...props }, ref) => {
|
||||||
|
const [iconNode, setIconNode] = useState<IconNode>();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getIconNode(name)
|
||||||
|
.then(setIconNode)
|
||||||
|
.catch((error) => {
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
|
}, [name]);
|
||||||
|
|
||||||
|
if (iconNode == null) {
|
||||||
|
if (Fallback == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return createElement(Fallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
return createElement(Icon, {
|
||||||
|
ref,
|
||||||
|
...props,
|
||||||
|
iconNode,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
export default DynamicIcon;
|
||||||
7
packages/lucide-react/src/dynamic.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export {
|
||||||
|
default as DynamicIcon,
|
||||||
|
iconNames,
|
||||||
|
type DynamicIconModule,
|
||||||
|
type IconName,
|
||||||
|
} from './DynamicIcon';
|
||||||
|
export { default as dynamicIconImports } from './dynamicIconImports';
|
||||||
@@ -1,6 +1,21 @@
|
|||||||
import { ReactSVG, SVGProps, ForwardRefExoticComponent, RefAttributes } from 'react';
|
import type { SVGProps, ForwardRefExoticComponent, RefAttributes } from 'react';
|
||||||
|
|
||||||
export type IconNode = [elementName: keyof ReactSVG, attrs: Record<string, string>][];
|
/**
|
||||||
|
* A reduced version of `SVGElementType` from @types/react. This type was added
|
||||||
|
* with the release of React 19, and is included here in order to support usage
|
||||||
|
* with older versions.
|
||||||
|
*/
|
||||||
|
type SVGElementType =
|
||||||
|
| 'circle'
|
||||||
|
| 'ellipse'
|
||||||
|
| 'g'
|
||||||
|
| 'line'
|
||||||
|
| 'path'
|
||||||
|
| 'polygon'
|
||||||
|
| 'polyline'
|
||||||
|
| 'rect';
|
||||||
|
|
||||||
|
export type IconNode = [elementName: SVGElementType, attrs: Record<string, string>][];
|
||||||
|
|
||||||
export type SVGAttributes = Partial<SVGProps<SVGSVGElement>>;
|
export type SVGAttributes = Partial<SVGProps<SVGSVGElement>>;
|
||||||
type ElementAttributes = RefAttributes<SVGSVGElement> & SVGAttributes;
|
type ElementAttributes = RefAttributes<SVGSVGElement> & SVGAttributes;
|
||||||
|
|||||||
55
packages/lucide-react/tests/DynamicIcon.spec.tsx
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import { describe, it, expect } from 'vitest';
|
||||||
|
import { act, render, waitFor, type RenderResult } from '@testing-library/react';
|
||||||
|
|
||||||
|
import DynamicIcon from '../src/DynamicIcon';
|
||||||
|
|
||||||
|
describe('Using DynamicIcon Component', () => {
|
||||||
|
it('should render icon by given name', async () => {
|
||||||
|
let container: RenderResult['container'];
|
||||||
|
|
||||||
|
await act(async () => {
|
||||||
|
const result = render(<DynamicIcon name="smile" />);
|
||||||
|
|
||||||
|
container = result.container;
|
||||||
|
});
|
||||||
|
|
||||||
|
await waitFor(() => {
|
||||||
|
// I'd look for a real text here that is renderer when the data loads
|
||||||
|
expect(container.firstChild).not.toBeNull();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render icon by alias name', async () => {
|
||||||
|
let container: RenderResult['container'];
|
||||||
|
|
||||||
|
await act(async () => {
|
||||||
|
const result = render(<DynamicIcon name="home" />);
|
||||||
|
|
||||||
|
container = result.container;
|
||||||
|
});
|
||||||
|
|
||||||
|
await waitFor(() => {
|
||||||
|
// I'd look for a real text here that is renderer when the data loads
|
||||||
|
expect(container.firstChild).not.toBeNull();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render icon and match snapshot', async () => {
|
||||||
|
const { container } = render(<DynamicIcon name="circle" />);
|
||||||
|
|
||||||
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should adjust the style based', async () => {
|
||||||
|
const { container } = render(
|
||||||
|
<DynamicIcon
|
||||||
|
name="circle"
|
||||||
|
size={48}
|
||||||
|
stroke="red"
|
||||||
|
absoluteStrokeWidth
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||||
|
|
||||||
|
exports[`Using DynamicIcon Component > should adjust the style based 1`] = `null`;
|
||||||
|
|
||||||
|
exports[`Using DynamicIcon Component > should render icon and match snapshot 1`] = `null`;
|
||||||
@@ -83,10 +83,10 @@
|
|||||||
"rollup": "^4.22.4",
|
"rollup": "^4.22.4",
|
||||||
"solid-js": "^1.8.7",
|
"solid-js": "^1.8.7",
|
||||||
"typescript": "^4.9.4",
|
"typescript": "^4.9.4",
|
||||||
"vite": "5.1.8",
|
"vite": "5.4.13",
|
||||||
"vite-plugin-solid": "^2.10.1",
|
"vite-plugin-solid": "^2.10.1",
|
||||||
"vitest": "^1.1.1",
|
"vitest": "^1.1.1",
|
||||||
"esbuild": "^0.19.11"
|
"esbuild": "^0.25.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"solid-js": "^1.4.7"
|
"solid-js": "^1.4.7"
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
/* eslint-disable import/no-extraneous-dependencies */
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
||||||
|
|
||||||
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
|
export default async ({
|
||||||
const svgContents = getSvg();
|
componentName,
|
||||||
|
iconName,
|
||||||
|
children,
|
||||||
|
getSvg,
|
||||||
|
deprecated,
|
||||||
|
deprecationReason,
|
||||||
|
}) => {
|
||||||
|
const svgContents = await getSvg();
|
||||||
const svgBase64 = base64SVG(svgContents);
|
const svgBase64 = base64SVG(svgContents);
|
||||||
|
|
||||||
return `
|
return `
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ const license = `@license ${pkg.name} v${pkg.version} - ${pkg.license}`;
|
|||||||
createDirectory(LIB_DIR);
|
createDirectory(LIB_DIR);
|
||||||
createDirectory(ICON_MODULE_DIR);
|
createDirectory(ICON_MODULE_DIR);
|
||||||
|
|
||||||
const svgFiles = readSvgDirectory(ICONS_DIR);
|
const svgFiles = await readSvgDirectory(ICONS_DIR);
|
||||||
const svgs = readSvgs(svgFiles, ICONS_DIR);
|
const svgs = await readSvgs(svgFiles, ICONS_DIR);
|
||||||
|
|
||||||
const parsedSvgs = svgs.map(({ name, contents }) => ({
|
const parsedSvgs = svgs.map(({ name, contents }) => ({
|
||||||
name,
|
name,
|
||||||
@@ -39,6 +39,8 @@ const parsedSvgs = svgs.map(({ name, contents }) => ({
|
|||||||
parsedSvg: parseSync(contents),
|
parsedSvg: parseSync(contents),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
generateSprite(parsedSvgs, PACKAGE_DIR, license);
|
await Promise.all([
|
||||||
generateIconNodes(parsedSvgs, PACKAGE_DIR);
|
generateSprite(parsedSvgs, PACKAGE_DIR, license),
|
||||||
copyIcons(parsedSvgs, PACKAGE_DIR, license);
|
generateIconNodes(parsedSvgs, PACKAGE_DIR),
|
||||||
|
copyIcons(parsedSvgs, PACKAGE_DIR, license),
|
||||||
|
]);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/* eslint-disable import/no-extraneous-dependencies */
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
||||||
|
|
||||||
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
|
export default async ({ componentName, iconName, getSvg, deprecated, deprecationReason }) => {
|
||||||
let svgContents = getSvg();
|
let svgContents = await getSvg();
|
||||||
const svgBase64 = base64SVG(svgContents);
|
const svgBase64 = base64SVG(svgContents);
|
||||||
|
|
||||||
svgContents = svgContents.replace(
|
svgContents = svgContents.replace(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { writeFile } from '@lucide/helpers';
|
import { writeFile } from '@lucide/helpers';
|
||||||
|
|
||||||
export default function generateIconNodes(parsedSvgs, packageDir) {
|
export default async function generateIconNodes(parsedSvgs, packageDir) {
|
||||||
const iconNodes = parsedSvgs.reduce((acc, { name, parsedSvg }) => {
|
const iconNodes = parsedSvgs.reduce((acc, { name, parsedSvg }) => {
|
||||||
acc[name] = parsedSvg.children.map(({ name, attributes }) => [name, attributes]);
|
acc[name] = parsedSvg.children.map(({ name, attributes }) => [name, attributes]);
|
||||||
|
|
||||||
@@ -9,5 +9,5 @@ export default function generateIconNodes(parsedSvgs, packageDir) {
|
|||||||
|
|
||||||
const iconNodesStringified = JSON.stringify(iconNodes, null, 2);
|
const iconNodesStringified = JSON.stringify(iconNodes, null, 2);
|
||||||
|
|
||||||
writeFile(iconNodesStringified, 'icon-nodes.json', packageDir);
|
await writeFile(iconNodesStringified, 'icon-nodes.json', packageDir);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { stringify } from 'svgson';
|
|||||||
import { format } from 'prettier';
|
import { format } from 'prettier';
|
||||||
import { appendFile } from '@lucide/helpers';
|
import { appendFile } from '@lucide/helpers';
|
||||||
|
|
||||||
export default function generateSprite(svgs, packageDir, license) {
|
export default async function generateSprite(svgs, packageDir, license) {
|
||||||
const symbols = svgs.map(({ name, parsedSvg }) => ({
|
const symbols = svgs.map(({ name, parsedSvg }) => ({
|
||||||
name: 'symbol',
|
name: 'symbol',
|
||||||
type: 'element',
|
type: 'element',
|
||||||
@@ -34,6 +34,6 @@ export default function generateSprite(svgs, packageDir, license) {
|
|||||||
|
|
||||||
const xmlMeta = `<?xml version="1.0" encoding="utf-8"?>\n<!-- ${license} -->\n`;
|
const xmlMeta = `<?xml version="1.0" encoding="utf-8"?>\n<!-- ${license} -->\n`;
|
||||||
|
|
||||||
appendFile(xmlMeta, `sprite.svg`, packageDir);
|
await appendFile(xmlMeta, `sprite.svg`, packageDir);
|
||||||
appendFile(prettifiedSprite, `sprite.svg`, packageDir);
|
await appendFile(prettifiedSprite, `sprite.svg`, packageDir);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,12 @@ import { readSvg } from '@lucide/helpers';
|
|||||||
* @returns {Object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
export default function readSVGs(svgFiles, iconsDirectory) {
|
export default function readSVGs(svgFiles, iconsDirectory) {
|
||||||
return svgFiles.map((svgFile) => {
|
const SVGReadPromises = svgFiles.map(async (svgFile) => {
|
||||||
const name = basename(svgFile, '.svg');
|
const name = basename(svgFile, '.svg');
|
||||||
const contents = readSvg(svgFile, iconsDirectory);
|
const contents = await readSvg(svgFile, iconsDirectory);
|
||||||
|
|
||||||
return { name, contents };
|
return { name, contents };
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return Promise.all(SVGReadPromises);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
"build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mjs --exportFileName=index.ts --iconFileExtension=.svelte --importImportFileExtension=.svelte --separateIconFileExport --separateIconFileExportExtension=.ts --withAliases --aliasesFileExtension=.ts --separateAliasesFile --separateAliasesFileExtension=.ts --aliasImportFileExtension=.js --pretty=false",
|
"build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mjs --exportFileName=index.ts --iconFileExtension=.svelte --importImportFileExtension=.svelte --separateIconFileExport --separateIconFileExportExtension=.ts --withAliases --aliasesFileExtension=.ts --separateAliasesFile --separateAliasesFileExtension=.ts --aliasImportFileExtension=.js --pretty=false",
|
||||||
"build:package": "svelte-package --input ./src",
|
"build:package": "svelte-package --input ./src",
|
||||||
"build:license": "node ./scripts/appendBlockComments.mjs",
|
"build:license": "node ./scripts/appendBlockComments.mjs",
|
||||||
"test": "pnpm build:icons && vitest run",
|
"test": "pnpm copy:license && pnpm build:icons && vitest run",
|
||||||
"test:watch": "vitest watch",
|
"test:watch": "vitest watch",
|
||||||
"version": "pnpm version --git-tag-version=false"
|
"version": "pnpm version --git-tag-version=false"
|
||||||
},
|
},
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
"svelte-check": "^3.4.4",
|
"svelte-check": "^3.4.4",
|
||||||
"svelte-preprocess": "^5.0.4",
|
"svelte-preprocess": "^5.0.4",
|
||||||
"typescript": "^5.1.6",
|
"typescript": "^5.1.6",
|
||||||
"vite": "5.1.8",
|
"vite": "5.4.13",
|
||||||
"vitest": "^1.1.1"
|
"vitest": "^1.1.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import path from 'path';
|
|||||||
import { getCurrentDirPath } from '@lucide/helpers';
|
import { getCurrentDirPath } from '@lucide/helpers';
|
||||||
import { getJSBanner } from './license.mjs';
|
import { getJSBanner } from './license.mjs';
|
||||||
|
|
||||||
const currentDir = getCurrentDirPath(import.meta.url);
|
const currentDir = await getCurrentDirPath(import.meta.url);
|
||||||
const targetDirectory = path.join(currentDir, '../dist');
|
const targetDirectory = path.join(currentDir, '../dist');
|
||||||
|
|
||||||
const files = await readdir(targetDirectory, {
|
const files = await readdir(targetDirectory, {
|
||||||
|
|||||||
@@ -2,8 +2,15 @@
|
|||||||
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
||||||
import { getJSBanner } from './license.mjs';
|
import { getJSBanner } from './license.mjs';
|
||||||
|
|
||||||
export default ({ iconName, children, componentName, getSvg, deprecated, deprecationReason }) => {
|
export default async ({
|
||||||
const svgContents = getSvg();
|
iconName,
|
||||||
|
children,
|
||||||
|
componentName,
|
||||||
|
getSvg,
|
||||||
|
deprecated,
|
||||||
|
deprecationReason,
|
||||||
|
}) => {
|
||||||
|
const svgContents = await getSvg();
|
||||||
const svgBase64 = base64SVG(svgContents);
|
const svgBase64 = base64SVG(svgContents);
|
||||||
|
|
||||||
return `\
|
return `\
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
|
import fs from 'fs';
|
||||||
import pkg from '../package.json' with { type: 'json' };
|
import pkg from '../package.json' with { type: 'json' };
|
||||||
|
|
||||||
|
const license = fs.readFileSync('LICENSE', 'utf-8');
|
||||||
|
|
||||||
export function getJSBanner() {
|
export function getJSBanner() {
|
||||||
return `/**
|
return `/**
|
||||||
* @license ${pkg.name} v${pkg.version} - ${pkg.license}
|
* @license ${pkg.name} v${pkg.version} - ${pkg.license}
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ${pkg.license} license.
|
* ${license.split('\n').join('\n * ')}
|
||||||
* See the LICENSE file in the root directory of this source tree.
|
|
||||||
*/
|
*/
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
"@vue/test-utils": "2.4.5",
|
"@vue/test-utils": "2.4.5",
|
||||||
"rollup": "^4.22.4",
|
"rollup": "^4.22.4",
|
||||||
"rollup-plugin-dts": "^6.1.0",
|
"rollup-plugin-dts": "^6.1.0",
|
||||||
"vite": "5.1.8",
|
"vite": "5.4.13",
|
||||||
"vitest": "^1.4.0",
|
"vitest": "^1.4.0",
|
||||||
"vue": "^3.4.21"
|
"vue": "^3.4.21"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
/* eslint-disable import/no-extraneous-dependencies */
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
||||||
|
|
||||||
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
|
export default async ({
|
||||||
const svgContents = getSvg();
|
componentName,
|
||||||
|
iconName,
|
||||||
|
children,
|
||||||
|
getSvg,
|
||||||
|
deprecated,
|
||||||
|
deprecationReason,
|
||||||
|
}) => {
|
||||||
|
const svgContents = await getSvg();
|
||||||
const svgBase64 = base64SVG(svgContents);
|
const svgBase64 = base64SVG(svgContents);
|
||||||
|
|
||||||
return `
|
return `
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
"@vue/test-utils": "1.3.0",
|
"@vue/test-utils": "1.3.0",
|
||||||
"rollup": "^3.29.5",
|
"rollup": "^3.29.5",
|
||||||
"typescript": "^4.9.5",
|
"typescript": "^4.9.5",
|
||||||
"vite": "5.1.8",
|
"vite": "5.4.13",
|
||||||
"vitest": "^0.32.2",
|
"vitest": "^0.32.2",
|
||||||
"vue": "2.7.14",
|
"vue": "2.7.14",
|
||||||
"vue-template-compiler": "2.7.14"
|
"vue-template-compiler": "2.7.14"
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
/* eslint-disable import/no-extraneous-dependencies */
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
||||||
|
|
||||||
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
|
export default async ({
|
||||||
const svgContents = getSvg();
|
componentName,
|
||||||
|
iconName,
|
||||||
|
children,
|
||||||
|
getSvg,
|
||||||
|
deprecated,
|
||||||
|
deprecationReason,
|
||||||
|
}) => {
|
||||||
|
const svgContents = await getSvg();
|
||||||
const svgBase64 = base64SVG(svgContents);
|
const svgBase64 = base64SVG(svgContents);
|
||||||
|
|
||||||
return `
|
return `
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
"build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mjs --iconFileExtension=.ts --withAliases --aliasNamesOnly --aliasesFileExtension=.ts --exportFileName=index.ts",
|
"build:icons": "build-icons --output=./src --templateSrc=./scripts/exportTemplate.mjs --iconFileExtension=.ts --withAliases --aliasNamesOnly --aliasesFileExtension=.ts --exportFileName=index.ts",
|
||||||
"build:bundle": "rollup -c rollup.config.mjs",
|
"build:bundle": "rollup -c rollup.config.mjs",
|
||||||
"test": "pnpm build:icons && vitest run",
|
"test": "pnpm build:icons && vitest run",
|
||||||
|
"test:watch": "vitest watch",
|
||||||
"version": "pnpm version --git-tag-version=false"
|
"version": "pnpm version --git-tag-version=false"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -50,7 +51,7 @@
|
|||||||
"rollup": "^4.22.4",
|
"rollup": "^4.22.4",
|
||||||
"rollup-plugin-dts": "^6.1.0",
|
"rollup-plugin-dts": "^6.1.0",
|
||||||
"typescript": "^4.9.3",
|
"typescript": "^4.9.3",
|
||||||
"vite": "5.1.8",
|
"vite": "5.4.13",
|
||||||
"vitest": "^1.1.1"
|
"vitest": "^1.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,15 @@
|
|||||||
/* eslint-disable import/no-extraneous-dependencies */
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs';
|
||||||
|
|
||||||
export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => {
|
export default async ({
|
||||||
const svgContents = getSvg();
|
componentName,
|
||||||
|
iconName,
|
||||||
|
children,
|
||||||
|
getSvg,
|
||||||
|
deprecated,
|
||||||
|
deprecationReason,
|
||||||
|
}) => {
|
||||||
|
const svgContents = await getSvg();
|
||||||
const svgBase64 = base64SVG(svgContents);
|
const svgBase64 = base64SVG(svgContents);
|
||||||
|
|
||||||
return `
|
return `
|
||||||
@@ -19,11 +26,7 @@ import type { IconNode } from '../types';
|
|||||||
* @returns {Array}
|
* @returns {Array}
|
||||||
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
|
* ${deprecated ? `@deprecated ${deprecationReason}` : ''}
|
||||||
*/
|
*/
|
||||||
const ${componentName}: IconNode = [
|
const ${componentName}: IconNode = ${JSON.stringify(children)}
|
||||||
'svg',
|
|
||||||
defaultAttributes,
|
|
||||||
${JSON.stringify(children)}
|
|
||||||
];
|
|
||||||
|
|
||||||
export default ${componentName};
|
export default ${componentName};
|
||||||
`;
|
`;
|
||||||
|
|||||||