Compare commits

..

1 Commits

Author SHA1 Message Date
Jakob Guddas
974088a41c feat: keep guideline images in sync 2024-12-01 13:13:53 +01:00
504 changed files with 1332 additions and 2509 deletions

6
.gitignore vendored
View File

@@ -20,13 +20,9 @@ packages/**/src/aliases/*.ts
packages/**/src/aliases.ts
!packages/**/src/aliases/index.ts
packages/**/src/dynamicIconImports.ts
packages/**/DynamicIcon.d.ts
packages/**/dynamicIconImports.js
packages/**/dynamicIconImports.d.ts
packages/**/dynamicIconImports.js.map
packages/**/dynamic.d.ts
packages/**/dynamic.mjs.map
packages/**/dynamic.mjs
packages/**/LICENSE
categories.json
tags.json
@@ -45,5 +41,3 @@ docs/.vitepress/data/iconDetails
docs/.vitepress/data/relatedIcons.json
docs/.vercel
docs/.nitro
.gitignore

View File

@@ -30,17 +30,17 @@ Lucide is an open-source icon library that provides 1000+ vector (svg) files for
## Packages
| Logo | Package | Version | Downloads | Links |
| ---- | ------- | ------- | --------- | ----- |
| <img src="https://lucide.dev/framework-logos/js.svg" alt="JS logo" width="48"> | **`lucide`** | [![npm](https://img.shields.io/npm/v/lucide)](https://www.npmjs.com/package/lucide) | ![NPM Downloads](https://img.shields.io/npm/dw/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`** | [![npm](https://img.shields.io/npm/v/lucide-react)](https://www.npmjs.com/package/lucide-react) | ![NPM Downloads](https://img.shields.io/npm/dw/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`** | [![npm](https://img.shields.io/npm/v/lucide-vue-next)](https://www.npmjs.com/package/lucide-vue-next) | ![NPM Downloads](https://img.shields.io/npm/dw/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`** | [![npm](https://img.shields.io/npm/v/lucide-svelte)](https://www.npmjs.com/package/lucide-svelte) | ![NPM Downloads](https://img.shields.io/npm/dw/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`** | [![npm](https://img.shields.io/npm/v/lucide-solid)](https://www.npmjs.com/package/lucide-solid) | ![NPM Downloads](https://img.shields.io/npm/dw/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`** | [![npm](https://img.shields.io/npm/v/lucide-preact)](https://www.npmjs.com/package/lucide-preact) | ![NPM Downloads](https://img.shields.io/npm/dw/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`** | [![npm](https://img.shields.io/npm/v/lucide-react-native)](https://www.npmjs.com/package/lucide-react-native) | ![NPM Downloads](https://img.shields.io/npm/dw/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`** | [![npm](https://img.shields.io/npm/v/lucide-angular)](https://www.npmjs.com/package/lucide-angular) | ![NPM Downloads](https://img.shields.io/npm/dw/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`** | [![npm](https://img.shields.io/npm/v/lucide-static)](https://www.npmjs.com/package/lucide-static) | ![NPM Downloads](https://img.shields.io/npm/dw/lucide-static) | [Docs](https://lucide.dev/guide/packages/lucide-static) · [Source](./packages/lucide-static) |
| | Package | Version & Downloads | Links |
| --- | --- | --- | --- |
| <img src="https://lucide.dev/framework-logos/js.svg" alt="JS logo" width="48"> | `lucide` | [![npm](https://img.shields.io/npm/v/lucide)](https://www.npmjs.com/package/lucide) ![NPM Downloads](https://img.shields.io/npm/dw/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` | [![npm](https://img.shields.io/npm/v/lucide-react)](https://www.npmjs.com/package/lucide-react) ![NPM Downloads](https://img.shields.io/npm/dw/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` | [![npm](https://img.shields.io/npm/v/lucide-vue-next)](https://www.npmjs.com/package/lucide-vue-next) ![NPM Downloads](https://img.shields.io/npm/dw/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` | [![npm](https://img.shields.io/npm/v/lucide-svelte)](https://www.npmjs.com/package/lucide-svelte) ![NPM Downloads](https://img.shields.io/npm/dw/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` | [![npm](https://img.shields.io/npm/v/lucide-solid)](https://www.npmjs.com/package/lucide-solid) ![NPM Downloads](https://img.shields.io/npm/dw/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` | [![npm](https://img.shields.io/npm/v/lucide-preact)](https://www.npmjs.com/package/lucide-preact) ![NPM Downloads](https://img.shields.io/npm/dw/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` | [![npm](https://img.shields.io/npm/v/lucide-react-native)](https://www.npmjs.com/package/lucide-react-native) ![NPM Downloads](https://img.shields.io/npm/dw/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` | [![npm](https://img.shields.io/npm/v/lucide-angular)](https://www.npmjs.com/package/lucide-angular) ![NPM Downloads](https://img.shields.io/npm/dw/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` | [![npm](https://img.shields.io/npm/v/lucide-static)](https://www.npmjs.com/package/lucide-static) ![NPM Downloads](https://img.shields.io/npm/dw/lucide-static) | [Docs](https://lucide.dev/guide/packages/lucide-static) [Source](./packages/lucide-static) |
### Figma
@@ -62,7 +62,7 @@ Join the community on our [Discord](https://discord.gg/EH6nSts) server!
## 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).
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).
## Credits

5
categories/currency.json Normal file
View File

@@ -0,0 +1,5 @@
{
"$schema": "../category.schema.json",
"title": "Currency",
"icon": "dollar-sign"
}

View File

@@ -0,0 +1,5 @@
{
"$schema": "../category.schema.json",
"title": "Furniture",
"icon": "rocking-chair"
}

5
categories/maps.json Normal file
View File

@@ -0,0 +1,5 @@
{
"$schema": "../category.schema.json",
"title": "Maps",
"icon": "map"
}

View File

@@ -1,5 +1,5 @@
{
"$schema": "../category.schema.json",
"title": "Mathematics",
"title": "Maths",
"icon": "divide"
}

View File

@@ -1,5 +1,5 @@
{
"$schema": "../category.schema.json",
"title": "Finance",
"title": "Money",
"icon": "piggy-bank"
}

View File

@@ -1,5 +1,5 @@
{
"$schema": "../category.schema.json",
"title": "Notification",
"title": "Notifications",
"icon": "triangle-alert"
}

View File

@@ -35,6 +35,10 @@
"name": "connectivity",
"title": "Connectivity"
},
{
"name": "currency",
"title": "Currency"
},
{
"name": "cursors",
"title": "Cursors"
@@ -59,14 +63,14 @@
"name": "files",
"title": "File icons"
},
{
"name": "finance",
"title": "Finance"
},
{
"name": "food-beverage",
"title": "Food & beverage"
},
{
"name": "furniture",
"title": "Furniture"
},
{
"name": "gaming",
"title": "Gaming"
@@ -84,13 +88,21 @@
"title": "Mail"
},
{
"name": "math",
"title": "Mathematics"
"name": "maps",
"title": "Maps"
},
{
"name": "maths",
"title": "Maths"
},
{
"name": "medical",
"title": "Medical"
},
{
"name": "money",
"title": "Money"
},
{
"name": "multimedia",
"title": "Multimedia"
@@ -105,7 +117,7 @@
},
{
"name": "notifications",
"title": "Notification"
"title": "Notifications"
},
{
"name": "people",

View File

@@ -14,13 +14,5 @@
"light": "/library-logos/tamagui.svg",
"dark": "/library-logos/tamagui.svg"
}
},
{
"name": "Reflex",
"url": "https://reflex.dev",
"image": {
"light": "/library-logos/reflex-light.svg",
"dark": "/library-logos/reflex-dark.svg"
}
}
]

View File

@@ -49,7 +49,7 @@ import { $CamelCase } from '@lucide/lab';
</script>
<template>
<Icon :iconNode="$CamelCase" />
<Icon :iconNode="burger" />
</template>
`,
},
@@ -61,7 +61,7 @@ import { Icon } from 'lucide-svelte';
import { $CamelCase } from '@lucide/lab';
</script>
<Icon iconNode={$CamelCase} />
<Icon iconNode={burger} />
`,
},
{

View File

@@ -5,32 +5,22 @@ import IconButton from '../base/IconButton.vue';
import VPDocAsideCarbonAds from 'vitepress/dist/client/theme-default/components/VPDocAsideCarbonAds.vue'
import { x } from '../../../data/iconNodes'
import createLucideIcon from 'lucide-vue-next/src/createLucideIcon';
import { onMounted, ref } from 'vue';
const { theme } = useData()
const showAd = useSessionStorage('show-carbon-ads', true)
const carbonLoaded = ref(true)
const showAd = useSessionStorage('show-carbon-ads',true)
defineProps<{
drawerOpen: boolean
}>()
const CloseIcon = createLucideIcon('Close', x)
onMounted(() => {
setTimeout(() => {
if (window?._carbonads == null) {
carbonLoaded.value = false
}
}, 5000)
})
</script>
<template>
<div
:class="{
'drawer-open': drawerOpen,
'hide-ad': !(showAd && carbonLoaded)
'hide-ad': !showAd
}"
class="floating-ad"
v-if="theme.carbonAds"

View File

@@ -2,13 +2,17 @@
title: Icon Design Guide
---
<script setup>
import example from '../../images/24px-24px.svg?raw'
</script>
## Icon Design Principles
Here are rules that should be followed to keep quality and consistency when making icons for Lucide.
### 1. Icons must be designed on a **24 by 24 pixels** canvas.
![24px-24px](../../images/24px-24px.svg?raw=true "24px-24px")
<i v-html="example" />
### 2. Icons must have at least **1 pixel padding** within the canvas.

View File

@@ -12,8 +12,7 @@ Lucide is an open-source icon library that provides 1000+ vector (svg) files for
## 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.
### 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.

View File

@@ -85,21 +85,108 @@ const App = () => (
);
```
## Dynamic Icon Component
## One generic icon component
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.
`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.
::: danger
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`.
For static use cases, it is recommended to import the icons directly.
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.
:::
The same props can be passed to adjust the icon appearance. The `name` prop is required to load the correct icon.
### Icon Component Example
```jsx
import { DynamicIcon } from 'lucide-react/dynamic';
import { icons } from 'lucide-react';
const App = () => (
<DynamicIcon name="camera" color="red" size={48} />
);
const Icon = ({ name, color, size }) => {
const LucideIcon = icons[name];
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;
```

View File

@@ -43,7 +43,7 @@ bun add lucide-static
```html
<!-- SVG file for a single icon -->
<img src="https://unpkg.com/lucide-static@latest/icons/house.svg" />
<img src="https://unpkg.com/lucide-static@latest/icons/home.svg" />
<!-- Icon font -->
<style>
@@ -66,12 +66,12 @@ To use it in for example html:
```html
<!-- SVG file for a single icon -->
<img src="~lucide-static/icons/house.svg" />
<img src="~lucide-static/icons/home.svg" />
```
```css
.house-icon {
background-image: url(~lucide-static/icons/house.svg);
.home-icon {
background-image: url(~lucide-static/icons/home.svg);
}
```
@@ -94,7 +94,7 @@ You may need additional loader for this.
```html
<!-- Icon Sprite, not recommended for production! -->
<img src="lucide-static/sprite.svg#house" />
<img src="lucide-static/sprite.svg#home" />
<!-- or -->
<svg
@@ -151,7 +151,7 @@ and update the SVG as follows
```
```html
<div class="icon-house"></div>
<div class="icon-home"></div>
```
### Node.js

View File

@@ -49,9 +49,7 @@
<path d="M120 350h240" stroke="#D8D8D9" stroke-width=".5"/>
<path d="M350 120v240" stroke="#D8D8D9" stroke-width=".5"/>
</g>
<path d="m240 140-100 50 100 50 100-50-100-50Z" stroke="#3C3C43" stroke-width="20" stroke-linecap="round" stroke-linejoin="round"/>
<path d="m140 290 100 50 100-50" stroke="#3C3C43" stroke-width="20" stroke-linecap="round" stroke-linejoin="round"/>
<path d="m140 240 100 50 100-50" stroke="#3C3C43" stroke-width="20" stroke-linecap="round" stroke-linejoin="round"/>
<image xlink:href="https://lucide.dev/api/icons/layers?color=3C3C43" src="https://lucide.dev/api/icons/layers?color=3C3C43" width="240" height="240" x="120" y="120"/>
<g opacity=".5" stroke="#fff" stroke-width="3">
<path d="M120 92v16"/>
<path d="M360 92v16"/>

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@@ -1,6 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="81" height="16" viewBox="0 0 81 16" fill="none">
<path fill-rule="evenodd" clip-rule="evenodd" d="M29 16H32V10H39V7H32V4H39V1H29V16ZM42 16H52V13H45V1H42V16ZM55 16H65V13H58.0439L58 10H65V7H58V4H65V1H55V16ZM68 7H71V10H68V16H71V10H78V16H81V10H78V7H81V1H78V7H71V1H68V7Z" fill="#1C2024"/>
<path d="M16 16V1H26V4H19V7H26V10H19L19.0439 13H26V16H16Z" fill="#1C2024"/>
<path d="M10 10V16H13V10H10Z" fill="#1C2024"/>
<path d="M0 1V16H3V10H10V7H3V4H10V7H13V1H0Z" fill="#1C2024"/>
</svg>

Before

Width:  |  Height:  |  Size: 522 B

View File

@@ -1,6 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="81" height="16" viewBox="0 0 81 16" fill="none">
<path fill-rule="evenodd" clip-rule="evenodd" d="M29 16H32V10H39V7H32V4H39V1H29V16ZM42 16H52V13H45V1H42V16ZM55 16H65V13H58.0439L58 10H65V7H58V4H65V1H55V16ZM68 7H71V10H68V16H71V10H78V16H81V10H78V7H81V1H78V7H71V1H68V7Z" fill="#FCFCFD"/>
<path d="M16 16V1H26V4H19V7H26V10H19L19.0439 13H26V16H16Z" fill="#FCFCFD"/>
<path d="M10 10V16H13V10H10Z" fill="#FCFCFD"/>
<path d="M0 1V16H3V10H10V7H3V4H10V7H13V1H0Z" fill="#FCFCFD"/>
</svg>

Before

Width:  |  Height:  |  Size: 522 B

View File

@@ -1,17 +1,16 @@
import fs from 'fs/promises';
import fs from 'fs';
import path from 'path';
const currentDir = process.cwd();
const dataDirectory = path.resolve(currentDir, '.vitepress/data');
const directory = path.join(process.cwd(), '../categories');
async function getAllCategoryFiles() {
const categoryDirectoryContents = await fs.readdir(directory);
const fileNames = categoryDirectoryContents.filter((file) => path.extname(file) === '.json');
function getAllCategoryFiles() {
const fileNames = fs.readdirSync(directory).filter((file) => path.extname(file) === '.json');
const categoryJSONReadPromises = fileNames.map(async (fileName) => {
return fileNames.map((fileName) => {
const name = path.basename(fileName, '.json');
const fileContent = await fs.readFile(path.join(directory, fileName), 'utf8');
const fileContent = fs.readFileSync(path.join(directory, fileName), 'utf8');
const parsedFileContent = JSON.parse(fileContent);
@@ -20,15 +19,14 @@ async function getAllCategoryFiles() {
title: parsedFileContent.title,
};
});
return Promise.all(categoryJSONReadPromises);
}
const categoriesFile = path.resolve(dataDirectory, `categoriesData.json`);
const categoriesData = await getAllCategoryFiles();
const categoriesData = getAllCategoryFiles();
fs.writeFile(categoriesFile, JSON.stringify(categoriesData, null, 2), 'utf-8')
fs.promises
.writeFile(categoriesFile, JSON.stringify(categoriesData, null, 2), 'utf-8')
.then(() => {
console.log('Successfully written categoriesData.json file');
})

View File

@@ -4,7 +4,7 @@ import { readSvgDirectory, toCamelCase } from '@lucide/helpers';
const currentDir = process.cwd();
const ICONS_DIR = path.resolve(currentDir, '../icons');
const icons = await readSvgDirectory(ICONS_DIR, '.json');
const icons = readSvgDirectory(ICONS_DIR, '.json');
const iconDetailsDirectory = path.resolve(currentDir, '.vitepress/data', 'iconDetails');

View File

@@ -4,7 +4,7 @@ import { readSvgDirectory, toCamelCase } from '@lucide/helpers';
const currentDir = process.cwd();
const ICONS_DIR = path.resolve(currentDir, '../icons');
const iconJsonFiles = await readSvgDirectory(ICONS_DIR, '.json');
const iconJsonFiles = readSvgDirectory(ICONS_DIR, '.json');
const location = path.resolve(currentDir, '.vitepress/data', 'iconMetaData.ts');

View File

@@ -5,8 +5,8 @@ import { readSvgDirectory, toCamelCase } from '@lucide/helpers';
const currentDir = process.cwd();
const ICONS_DIR = path.resolve(currentDir, '../icons');
const svgFiles = await readSvgDirectory(ICONS_DIR);
const icons = await renderIconsObject(svgFiles, ICONS_DIR, true);
const svgFiles = readSvgDirectory(ICONS_DIR);
const icons = renderIconsObject(svgFiles, ICONS_DIR, true);
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');
iconIndexFileImports.push(
`import ${toCamelCase(iconName)}Node from './${iconName}.node.json' with { type: "json" };`,
`import ${toCamelCase(iconName)}Node from './${iconName}.node.json' assert { type: "json" };`,
);
iconIndexFileExports.push(` ${toCamelCase(iconName)}Node as ${toCamelCase(iconName)},`);
iconIndexFileDefaultExports.push(` '${iconName}': ${toCamelCase(iconName)}Node,`);

View File

@@ -4,7 +4,7 @@ import { readSvgDirectory } from '@lucide/helpers';
const currentDir = process.cwd();
const ICONS_DIR = path.resolve(currentDir, '../icons');
const svgFiles = await readSvgDirectory(ICONS_DIR, '.json');
const svgFiles = readSvgDirectory(ICONS_DIR, '.json');
const location = path.resolve(currentDir, '.vitepress/data', 'relatedIcons.json');
@@ -18,7 +18,9 @@ const categoryWeight = 3;
const MAX_RELATED_ICONS = 4 * 17; // grid of 4x17 icons, = 68 icons
const arrayMatches = (a, b) => a.filter((item) => b.includes(item)).length;
const arrayMatches = (a, b) => {
return a.filter((item) => b.includes(item)).length;
};
const nameParts = (icon) =>
[
@@ -34,7 +36,6 @@ const getRelatedIcons = (currentIcon, icons) => {
nameWeight * arrayMatches(nameParts(item), nameParts(currentIcon)) +
categoryWeight * arrayMatches(item.categories ?? [], currentIcon.categories ?? []) +
tagWeight * arrayMatches(item.tags ?? [], currentIcon.tags ?? []);
return icons
.filter((i) => i.name !== currentIcon.name)
.map((icon) => ({ icon, similarity: iconSimilarity(icon) }))
@@ -45,8 +46,7 @@ const getRelatedIcons = (currentIcon, icons) => {
};
const iconsMetaDataPromises = svgFiles.map(async (iconName) => {
const metaDataFileContent = await fs.promises.readFile(`../icons/${iconName}`);
const metaData = JSON.parse(metaDataFileContent);
const metaData = JSON.parse(fs.readFileSync(`../icons/${iconName}`));
const name = iconName.replace('.json', '');

View File

@@ -11,7 +11,7 @@ const git = simpleGit();
const currentDir = process.cwd();
const ICONS_DIR = path.resolve(currentDir, '../icons');
const iconJsonFiles = await readSvgDirectory(ICONS_DIR, '.json');
const iconJsonFiles = readSvgDirectory(ICONS_DIR, '.json');
const location = path.resolve(currentDir, '.vitepress/data', 'releaseMetaData.json');
const releaseMetaDataDirectory = path.resolve(currentDir, '.vitepress/data', 'releaseMetadata');

View File

@@ -6,7 +6,7 @@ import { getCurrentDirPath } from '@lucide/helpers';
const currentDir = process.cwd();
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)
.filter(([, { aliases }]) => aliases?.length)
@@ -16,7 +16,7 @@ const iconAliasesRedirectRoutes = Object.entries(iconMetaData)
const aliasRouteMatches = aliases.join('|');
return {
src: `/icons/${aliasRouteMatches}`,
src: `/icons/(${aliasRouteMatches})`,
status: 302,
headers: {
Location: `/icons/${iconName}`,
@@ -44,4 +44,4 @@ const output = JSON.stringify(vercelRouteConfig, null, 2);
const vercelOutputJSON = path.resolve(currentDir, '.vercel/output/config.json');
await fs.promises.writeFile(vercelOutputJSON, output, 'utf-8');
fs.writeFileSync(vercelOutputJSON, output, 'utf-8');

View File

@@ -64,20 +64,23 @@
"charts",
"communication",
"connectivity",
"currency",
"cursors",
"design",
"development",
"devices",
"emoji",
"files",
"finance",
"food-beverage",
"furniture",
"gaming",
"home",
"layout",
"mail",
"math",
"maps",
"maths",
"medical",
"money",
"multimedia",
"nature",
"navigation",
@@ -139,7 +142,7 @@
},
"aliasDeprecationReasons": {
"type": "string",
"enum": ["alias.typo", "alias.name", "alias.duplicate"]
"enum": ["alias.typo", "alias.name"]
},
"versionNumber": {
"type": "string",

View File

@@ -10,6 +10,7 @@
],
"categories": [
"transportation",
"text"
"text",
"maps"
]
}

View File

@@ -13,6 +13,6 @@
"couch"
],
"categories": [
"home"
"furniture"
]
}

View File

@@ -13,6 +13,7 @@
],
"categories": [
"arrows",
"navigation"
"navigation",
"maps"
]
}

View File

@@ -11,6 +11,7 @@
],
"categories": [
"arrows",
"navigation"
"navigation",
"maps"
]
}

View File

@@ -17,7 +17,7 @@
],
"categories": [
"text",
"math",
"maths",
"development"
]
}

View File

@@ -14,6 +14,7 @@
],
"categories": [
"account",
"social"
"social",
"shapes"
]
}

View File

@@ -24,6 +24,9 @@
],
"categories": [
"shopping",
"finance"
"money",
"currency",
"account",
"shapes"
]
}

View File

@@ -12,6 +12,8 @@
"check"
],
"categories": [
"social"
"account",
"social",
"shapes"
]
}

View File

@@ -22,6 +22,9 @@
],
"categories": [
"shopping",
"finance"
"money",
"currency",
"account",
"shapes"
]
}

View File

@@ -20,6 +20,9 @@
],
"categories": [
"shopping",
"finance"
"money",
"currency",
"account",
"shapes"
]
}

View File

@@ -10,7 +10,9 @@
"help"
],
"categories": [
"account",
"accessibility",
"social"
"social",
"shapes"
]
}

View File

@@ -21,6 +21,9 @@
],
"categories": [
"shopping",
"finance"
"money",
"currency",
"account",
"shapes"
]
}

View File

@@ -12,6 +12,7 @@
"categories": [
"account",
"accessibility",
"social"
"social",
"shapes"
]
}

View File

@@ -21,6 +21,9 @@
],
"categories": [
"shopping",
"finance"
"money",
"currency",
"account",
"shapes"
]
}

View File

@@ -12,6 +12,8 @@
"erase"
],
"categories": [
"social"
"account",
"social",
"shapes"
]
}

View File

@@ -15,9 +15,11 @@
"price tag"
],
"categories": [
"account",
"social",
"finance",
"money",
"shopping",
"math"
"maths",
"shapes"
]
}

View File

@@ -12,6 +12,8 @@
"new"
],
"categories": [
"social"
"account",
"social",
"shapes"
]
}

View File

@@ -22,6 +22,9 @@
],
"categories": [
"shopping",
"finance"
"money",
"currency",
"account",
"shapes"
]
}

View File

@@ -21,6 +21,9 @@
],
"categories": [
"shopping",
"finance"
"money",
"currency",
"account",
"shapes"
]
}

View File

@@ -21,6 +21,9 @@
],
"categories": [
"shopping",
"finance"
"money",
"currency",
"account",
"shapes"
]
}

View File

@@ -12,6 +12,8 @@
"remove"
],
"categories": [
"social"
"account",
"social",
"shapes"
]
}

View File

@@ -10,6 +10,7 @@
"payment"
],
"categories": [
"finance"
"currency",
"money"
]
}

View File

@@ -1,29 +0,0 @@
{
"$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"
]
}

View File

@@ -1,17 +0,0 @@
<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>

Before

Width:  |  Height:  |  Size: 398 B

View File

@@ -10,6 +10,6 @@
"furniture"
],
"categories": [
"home"
"furniture"
]
}

View File

@@ -10,6 +10,6 @@
"furniture"
],
"categories": [
"home"
"furniture"
]
}

View File

@@ -10,6 +10,6 @@
"furniture"
],
"categories": [
"home"
"furniture"
]
}

View File

@@ -9,7 +9,7 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M10.268 21a2 2 0 0 0 3.464 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" />
<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.3 21a1.94 1.94 0 0 0 3.4 0" />
<circle cx="18" cy="8" r="3" />
</svg>

Before

Width:  |  Height:  |  Size: 418 B

After

Width:  |  Height:  |  Size: 379 B

View File

@@ -9,7 +9,7 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M10.268 21a2 2 0 0 0 3.464 0" />
<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.3 21a1.94 1.94 0 0 0 3.4 0" />
<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>

Before

Width:  |  Height:  |  Size: 412 B

After

Width:  |  Height:  |  Size: 364 B

View File

@@ -9,8 +9,8 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M10.268 21a2 2 0 0 0 3.464 0" />
<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="M8.7 3A6 6 0 0 1 18 8a21.3 21.3 0 0 0 .6 5" />
<path d="M17 17H3s3-2 3-9a4.67 4.67 0 0 1 .3-1.7" />
<path d="M10.3 21a1.94 1.94 0 0 0 3.4 0" />
<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>

Before

Width:  |  Height:  |  Size: 438 B

After

Width:  |  Height:  |  Size: 393 B

View File

@@ -9,8 +9,8 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M10.268 21a2 2 0 0 0 3.464 0" />
<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.3 21a1.94 1.94 0 0 0 3.4 0" />
<path d="M15 8h6" />
<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>

Before

Width:  |  Height:  |  Size: 431 B

After

Width:  |  Height:  |  Size: 390 B

View File

@@ -9,8 +9,8 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M10.268 21a2 2 0 0 0 3.464 0" />
<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="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" />
<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" />
</svg>

Before

Width:  |  Height:  |  Size: 469 B

After

Width:  |  Height:  |  Size: 387 B

View File

@@ -9,6 +9,6 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M10.268 21a2 2 0 0 0 3.464 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" />
<path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" />
<path d="M10.3 21a1.94 1.94 0 0 0 3.4 0" />
</svg>

Before

Width:  |  Height:  |  Size: 393 B

After

Width:  |  Height:  |  Size: 311 B

View File

@@ -29,7 +29,8 @@
"categories": [
"layout",
"design",
"tools"
"tools",
"account"
],
"aliases": [
{

View File

@@ -29,7 +29,8 @@
"categories": [
"layout",
"design",
"tools"
"tools",
"account"
],
"aliases": [
{

View File

@@ -24,7 +24,7 @@
"research"
],
"categories": [
"navigation",
"maps",
"nature",
"photography",
"science",

View File

@@ -11,7 +11,8 @@
],
"categories": [
"brands",
"currency",
"development",
"finance"
"money"
]
}

View File

@@ -14,10 +14,11 @@
"diy",
"fixed",
"build",
"construction",
"contruction",
"parts"
],
"categories": [
"account",
"tools",
"home"
]

View File

@@ -45,6 +45,7 @@
],
"categories": [
"text",
"maps",
"gaming"
]
}

View File

@@ -9,15 +9,15 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M12 17h1.5" />
<path d="M12 22h1.5" />
<path d="M12 2h1.5" />
<path d="M17.5 22H19a1 1 0 0 0 1-1" />
<path d="M17.5 2H19a1 1 0 0 1 1 1v1.5" />
<path d="M20 14v3h-2.5" />
<path d="M20 8.5V10" />
<path d="M4 10V8.5" />
<path d="M4 19.5V14" />
<path d="M4 4.5A2.5 2.5 0 0 1 6.5 2H8" />
<path d="M12 17h2" />
<path d="M12 22h2" />
<path d="M12 2h2" />
<path d="M18 22h1a1 1 0 0 0 1-1" />
<path d="M18 2h1a1 1 0 0 1 1 1v1" />
<path d="M20 15v2h-2" />
<path d="M20 8v3" />
<path d="M4 11V9" />
<path d="M4 19.5V15" />
<path d="M4 5v-.5A2.5 2.5 0 0 1 6.5 2H8" />
<path d="M8 22H6.5a1 1 0 0 1 0-5H8" />
</svg>

Before

Width:  |  Height:  |  Size: 561 B

After

Width:  |  Height:  |  Size: 542 B

View File

@@ -41,6 +41,7 @@
"categories": [
"social",
"text",
"communication",
"gaming"
]
}

View File

@@ -35,6 +35,7 @@
],
"categories": [
"text",
"development",
"gaming"
]
}

View File

@@ -31,6 +31,7 @@
"unlearn"
],
"categories": [
"development",
"text",
"gaming"
]

View File

@@ -19,6 +19,6 @@
"shapes",
"gaming",
"development",
"math"
"maths"
]
}

View File

@@ -12,8 +12,7 @@
"enterprise",
"skyscraper",
"organisation",
"organization",
"city"
"organization"
],
"categories": [
"account",

View File

@@ -9,7 +9,7 @@
"calculating machine"
],
"categories": [
"math",
"maths",
"devices"
]
}

View File

@@ -12,6 +12,7 @@
],
"categories": [
"buildings",
"gaming"
"gaming",
"maps"
]
}

View File

@@ -16,7 +16,6 @@
"commodities",
"currencies",
"currency",
"stocks",
"exchange",
"hedge fund",
"statistics",
@@ -26,7 +25,7 @@
],
"categories": [
"charts",
"finance"
"money"
],
"aliases": [
{

View File

@@ -20,7 +20,7 @@
"categories": [
"arrows",
"navigation",
"math",
"maths",
"development"
]
}

View File

@@ -20,7 +20,7 @@
"categories": [
"arrows",
"navigation",
"math",
"maths",
"gaming"
]
}

View File

@@ -10,6 +10,6 @@
],
"categories": [
"buildings",
"navigation"
"maps"
]
}

View File

@@ -11,7 +11,8 @@
"exclamation mark"
],
"categories": [
"notifications"
"notifications",
"shapes"
],
"aliases": [
"alert-circle"

View File

@@ -15,6 +15,7 @@
"categories": [
"arrows",
"navigation",
"shapes",
"gaming"
],
"aliases": [

View File

@@ -17,6 +17,7 @@
"categories": [
"arrows",
"navigation",
"shapes",
"gaming"
],
"aliases": [

View File

@@ -11,7 +11,8 @@
],
"categories": [
"arrows",
"navigation"
"navigation",
"maps"
],
"aliases": [
"arrow-down-left-from-circle"

View File

@@ -11,7 +11,8 @@
],
"categories": [
"arrows",
"navigation"
"navigation",
"maps"
],
"aliases": [
"arrow-down-right-from-circle"

View File

@@ -15,6 +15,7 @@
"categories": [
"arrows",
"navigation",
"maps",
"development"
],
"aliases": [

View File

@@ -11,7 +11,8 @@
],
"categories": [
"arrows",
"navigation"
"navigation",
"maps"
],
"aliases": [
"arrow-up-right-from-circle"

View File

@@ -17,6 +17,7 @@
"categories": [
"arrows",
"navigation",
"shapes",
"gaming"
],
"aliases": [

View File

@@ -14,6 +14,7 @@
"categories": [
"arrows",
"navigation",
"shapes",
"gaming"
],
"aliases": [

View File

@@ -14,7 +14,8 @@
"task"
],
"categories": [
"notifications"
"notifications",
"shapes"
],
"aliases": [
"check-circle"

View File

@@ -12,7 +12,8 @@
"task"
],
"categories": [
"notifications"
"notifications",
"shapes"
],
"aliases": [
"check-circle-2"

View File

@@ -10,7 +10,8 @@
],
"categories": [
"arrows",
"navigation"
"navigation",
"shapes"
],
"aliases": [
"chevron-down-circle"

View File

@@ -13,7 +13,8 @@
],
"categories": [
"arrows",
"navigation"
"navigation",
"shapes"
],
"aliases": [
"chevron-left-circle"

View File

@@ -12,7 +12,8 @@
],
"categories": [
"arrows",
"navigation"
"navigation",
"shapes"
],
"aliases": [
"chevron-right-circle"

View File

@@ -11,7 +11,8 @@
],
"categories": [
"arrows",
"navigation"
"navigation",
"shapes"
],
"aliases": [
"chevron-up-circle"

View File

@@ -6,12 +6,13 @@
],
"tags": [
"calculate",
"math",
"maths",
"÷",
"/"
],
"categories": [
"math"
"maths",
"shapes"
],
"aliases": [
"divide-circle"

View File

@@ -12,6 +12,8 @@
"payment"
],
"categories": [
"finance"
"shapes",
"money",
"currency"
]
}

View File

@@ -29,6 +29,7 @@
],
"categories": [
"layout",
"development"
"development",
"shapes"
]
}

View File

@@ -9,6 +9,7 @@
"="
],
"categories": [
"math"
"maths",
"shapes"
]
}

View File

@@ -16,6 +16,7 @@
],
"categories": [
"communication",
"social"
"social",
"shapes"
]
}

View File

@@ -13,6 +13,7 @@
"level"
],
"categories": [
"account",
"transportation",
"sports",
"science"

View File

@@ -13,6 +13,7 @@
"categories": [
"accessibility",
"text",
"shapes",
"notifications"
],
"aliases": [

Some files were not shown because too many files have changed in this diff Show More