diff --git a/README.md b/README.md index e48301793ee..0d43b0f8b65 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,6 @@ Lucide is trying to expand the icon set as much as possible while staying faithf - [Static (svg sprite, font, icons ..)](#static-svg-sprite-font-icons-) - [Figma](#figma) - [Laravel](#laravel) - - [Flutter](#flutter) - [Svelte](#svelte) - [Solid](#solid) - [Hyva](#hyva) @@ -200,16 +199,6 @@ composer require mallardduck/blade-lucide-icons For more details, see the [documentation](https://github.com/mallardduck/blade-lucide-icons/blob/main/README.md). -### Flutter - -Implementation of Lucide icon library for Flutter applications. - -```sh -flutter pub add lucide_icons -``` - -For more details, see the [pub.dev](https://pub.dev/packages/lucide_icons). - ### Svelte Implementation of the lucide icon library for Svelte applications. diff --git a/docs/.vitepress/api/gh-icon/[...data].get.ts b/docs/.vitepress/api/gh-icon/[...data].get.ts index f688c57ab67..8b4abb4c786 100644 --- a/docs/.vitepress/api/gh-icon/[...data].get.ts +++ b/docs/.vitepress/api/gh-icon/[...data].get.ts @@ -1,41 +1,44 @@ -import { eventHandler, setResponseHeader, defaultContentType } from 'h3' -import { renderToString, renderToStaticMarkup } from 'react-dom/server' -import { createElement } from 'react' +import { eventHandler, setResponseHeader, defaultContentType } from 'h3'; +import { renderToString, renderToStaticMarkup } from 'react-dom/server'; +import { createElement } from 'react'; import SvgPreview from '../../lib/SvgPreview/index.tsx'; -import iconNodes from '../../data/iconNodes' -import createLucideIcon from 'lucide-react/src/createLucideIcon' +import iconNodes from '../../data/iconNodes'; +import createLucideIcon from 'lucide-react/src/createLucideIcon'; import Backdrop from '../../lib/SvgPreview/Backdrop.tsx'; export default eventHandler((event) => { - const { params } = event.context + const { params } = event.context; - const [name, svgData] = params.data.split('/'); - const data = svgData.slice(0, -4); + const pathData = params.data.split('/'); + const data = pathData.at(-1).slice(0, -4); + const [name] = pathData; const src = Buffer.from(data, 'base64').toString('utf8'); - const children = [] + const children = []; - if (name in iconNodes) { - const iconNode = iconNodes[name] + // If the icon already exists, it uses the existing icon as the backdrop. + // If the icon does not exist but an icon exists that starts with the same group name, that icon + // is used as the backdrop + const backdropName = + name in iconNodes ? name : name.split('-')[0] in iconNodes ? name.split('-')[0] : null; + if (backdropName) { + const iconNode = iconNodes[backdropName]; - const LucideIcon = createLucideIcon(name, iconNode) - const svg = renderToStaticMarkup(createElement(LucideIcon)) + const LucideIcon = createLucideIcon(backdropName, iconNode); + const svg = renderToStaticMarkup(createElement(LucideIcon)); const backdropString = svg.replace(/]*>|<\/svg>/g, ''); - children.push(createElement(Backdrop, { backdropString, src })) + children.push(createElement(Backdrop, { backdropString, src })); } const svg = Buffer.from( // We can't use jsx here, is not supported here by nitro. - renderToString(createElement(SvgPreview, {src, showGrid: true}, children)).replace( - />/, - '>' - ) + renderToString(createElement(SvgPreview, { src, showGrid: true }, children)) ).toString('utf8'); - defaultContentType(event, 'image/svg+xml') - setResponseHeader(event, 'Cache-Control', 'public,max-age=31536000') + defaultContentType(event, 'image/svg+xml'); + setResponseHeader(event, 'Cache-Control', 'public,max-age=31536000'); - return svg -}) + return svg; +}); diff --git a/docs/.vitepress/theme/components/icons/IconsCategoryOverview.vue b/docs/.vitepress/theme/components/icons/IconsCategoryOverview.vue index e178bca6fda..12ef6501734 100644 --- a/docs/.vitepress/theme/components/icons/IconsCategoryOverview.vue +++ b/docs/.vitepress/theme/components/icons/IconsCategoryOverview.vue @@ -1,93 +1,92 @@