diff --git a/.github/labeler.yml b/.github/labeler.yml index 109b18937..57607e502 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -36,51 +36,51 @@ - any-glob-to-any-file: - 'packages/lucide/*' -# For changes in the lucide React package +# For changes in the Lucide React package ⚛️ react package: - changed-files: - any-glob-to-any-file: - 'packages/lucide-react/*' -# For changes in the lucide React Native package +# For changes in the Lucide React Native package ⚛️ react native package: - changed-files: - any-glob-to-any-file: - 'packages/lucide-react-native/*' -# For changes in the lucide vue packages +# For changes in the Lucide vue packages 💎 vue package: - changed-files: - any-glob-to-any-file: - 'packages/lucide-vue/*' - 'packages/lucide-vue-next/*' -# For changes in the lucide angular package +# For changes in the Lucide angular package 🅰️ angular package: - changed-files: - any-glob-to-any-file: - 'packages/angular/*' - 'packages/lucide-angular/*' -# For changes in the lucide preact package +# For changes in the Lucide preact package ⚛️ preact package: - changed-files: - any-glob-to-any-file: - 'packages/lucide-preact/*' -# For changes in the lucide svelte package +# For changes in the Lucide svelte package 🧣 svelte package: - changed-files: - any-glob-to-any-file: - 'packages/lucide-svelte/*' -# For changes in the lucide solid package +# For changes in the Lucide solid package 🪝 solid package: - changed-files: - any-glob-to-any-file: - 'packages/lucide-solid/*' -# For changes in the lucide astro package +# For changes in the Lucide astro package 🚀 astro package: - changed-files: - any-glob-to-any-file: @@ -92,13 +92,13 @@ - any-glob-to-any-file: - 'packages/lucide-icons/*' -# For changes in the lucide static package +# For changes in the Lucide static package 🪨 static package: - changed-files: - any-glob-to-any-file: - 'packages/lucide-static/*' -# For changes in the lucide flutter package +# For changes in the Lucide flutter package 🏹 flutter package: - changed-files: - any-glob-to-any-file: diff --git a/.gitignore b/.gitignore index 2112bf699..a00849849 100644 --- a/.gitignore +++ b/.gitignore @@ -50,4 +50,6 @@ docs/.vitepress/data/relatedIcons.json docs/.vitepress/data/brandStopwords.json docs/.vercel docs/.nitro +docs/public/og/** +!docs/public/og/general.png .gitignore diff --git a/.vscode/settings.json b/.vscode/settings.json index f179cbc07..47728fdf7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,5 +2,5 @@ "cSpell.words": ["devs", "preact", "Preact"], "eslint.enable": true, "eslint.validate": ["javascript", "svg"], - "svg.preview.background": "transparent" + "svg.preview.background": "editor" } diff --git a/BRAND_LOGOS_STATEMENT.md b/BRAND_LOGOS_STATEMENT.md index 9ca7c149b..de17c9722 100644 --- a/BRAND_LOGOS_STATEMENT.md +++ b/BRAND_LOGOS_STATEMENT.md @@ -1,4 +1,6 @@ -# Our Official Stance on Including Brand Logos in Lucide +# Brand Logos Statement + +Our official stance on including brand logos in Lucide ## TL;DR diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index bd8e14ad0..da613c8d4 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,74 +1,90 @@ # Contributor Covenant Code of Conduct +This Code of Conduct outlines our expectations for participant behavior as well as the consequences for unacceptable behavior within our community. We are committed to providing a welcoming, safe, and inclusive environment for all members of our community. + ## Our Pledge -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. +We pledge to make our community welcoming, safe, and equitable for all. -## Our Standards +We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant. -Examples of behavior that contributes to creating a positive environment -include: +## Encouraged Behaviors -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language. -Examples of unacceptable behavior by participants include: +With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including: -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting +1. Respecting the **purpose of our community**, our activities, and our ways of gathering. +2. Engaging **kindly and honestly** with others. +3. Respecting **different viewpoints** and experiences. +4. **Taking responsibility** for our actions and contributions. +5. Gracefully giving and accepting **constructive feedback**. +6. Committing to **repairing harm** when it occurs. +7. Behaving in other ways that promote and sustain the **well-being of our community**. -## Our Responsibilities -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. +## Restricted Behaviors + +We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct. + +1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop. +2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people. +3. **Stereotyping or discrimination.** Characterizing anyone’s personality or behavior on the basis of immutable identities or traits. +4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community. +5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission. +6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group. +7. Behaving in other ways that **threaten the well-being** of our community. + +### Other Restrictions + +1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions. +2. **Failing to credit sources.** Not properly crediting the sources of content you contribute. +3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community. +4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors. + + +## Reporting an Issue + +Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm. + +When an incident does occur, it is important to report it promptly. To report a possible violation, email: [info@lucide.dev](mailto:info@lucide.dev) + +Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution. + + +## Addressing and Repairing Harm + +If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident's impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped. + +1) Warning + 1) Event: A violation involving a single incident or series of incidents. + 2) Consequence: A private, written warning from the Community Moderators. + 3) Repair: Examples of repair include a private written apology, acknowledgement of responsibility, and seeking clarification on expectations. +2) Temporarily Limited Activities + 1) Event: A repeated incidence of a violation that previously resulted in a warning, or the first incidence of a more serious violation. + 2) Consequence: A private, written warning with a time-limited cooldown period designed to underscore the seriousness of the situation and give the community members involved time to process the incident. The cooldown period may be limited to particular communication channels or interactions with particular community members. + 3) Repair: Examples of repair may include making an apology, using the cooldown period to reflect on actions and impact, and being thoughtful about re-entering community spaces after the period is over. +3) Temporary Suspension + 1) Event: A pattern of repeated violation which the Community Moderators have tried to address with warnings, or a single serious violation. + 2) Consequence: A private written warning with conditions for return from suspension. In general, temporary suspensions give the person being suspended time to reflect upon their behavior and possible corrective actions. + 3) Repair: Examples of repair include respecting the spirit of the suspension, meeting the specified conditions for return, and being thoughtful about how to reintegrate with the community when the suspension is lifted. +4) Permanent Ban + 1) Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member. + 2) Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior. + 3) Repair: There is no possible repair in cases of this severity. + +This enforcement ladder is intended as a guideline. It does not limit the ability of Community Managers to use their discretion and judgment, in keeping with the best interests of our community. -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. ## Scope -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public or other spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event. -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at johnletey@gmail.com. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] +This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/). -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ +Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/) + +For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of [Mozilla’s code of conduct team](https://github.com/mozilla/inclusion). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 898485681..2bd46a67d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,4 @@ - -# Contribution Guidelines +# Contribution Guide :+1::tada: First off, thanks for taking the time to contribute! :tada::+1: @@ -19,13 +18,15 @@ Guidelines for pull requests: - __Make sure the target of your pull request is the relevant branch__. Most of bug fixes or new feature should go to the `main` branch. - __Include only related work__. If your pull request has unrelated commits, it won't be accepted. -### Icon Pull Requests +### Contributing Icons + +We love contributions of new icons from the community! If you want to contribute new icons, please follow the guidelines below. #### Guidelines Please make sure you follow the icon guidelines, that should be followed to keep quality and consistency when making icons for Lucide. -Read it here: [ICON_GUIDELINES](https://lucide.dev/docs/icon-design-guide). +Read it here: [ICON_GUIDELINES](https://lucide.dev/contribute/icon-design-guide). #### Lucide Studio @@ -35,15 +36,15 @@ For formatting and adjusting SVG icons, [@jguddas](https://github.com/jguddas) m Here you can find instructions on how to implement the guidelines with different vector graphics editors: -##### [Adobe Illustrator Guide](https://lucide.dev/docs/illustrator-guide) +##### [Adobe Illustrator Guide](https://lucide.dev/contribute/illustrator-guide) -You can also [download an Adobe Illustrator template](https://github.com/lucide-icons/lucide/blob/main/docs/public/templates/illustrator_template.ai). +You can also [download an Adobe Illustrator template](https://lucide.dev/templates/illustrator_template.ai). -##### [Inkscape Guide](https://lucide.dev/docs/inkscape-guide) +##### [Inkscape Guide](https://lucide.dev/contribute/inkscape-guide) -##### [Figma Guide](https://lucide.dev/docs/figma-guide) +##### [Figma Guide](https://lucide.dev/contribute/figma-guide) -##### [Affinity Designer Guide](https://lucide.dev/guide/design/affinity-designer-guide) +##### [Affinity Designer Guide](https://lucide.dev/contribute/affinity-designer-guide) #### Submitting Multiple Icons @@ -191,7 +192,7 @@ Detailed documentation about: installation, guides, packages, design guides etc. ### Icons -All the icons of lucide in SVG format. These will be used as source for all the packages and other distributions for the lucide icons. +All the icons of Lucide in SVG format. These will be used as source for all the packages and other distributions for the Lucide icons. ### Packages diff --git a/README.md b/README.md index ab0c51018..f627d65e1 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Lucide is an open-source icon library that provides 1000+ vector (svg) files for ### Figma -The lucide figma plugin. +The Lucide Figma plugin. Visit [Figma community page](https://www.figma.com/community/plugin/939567362549682242/Lucide-Icons) to install the plugin. diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index c0e788f0e..78f48ba66 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,7 +1,19 @@ import { fileURLToPath, URL } from 'node:url'; import { defineConfig } from 'vitepress'; +import { groupIconMdPlugin, groupIconVitePlugin } from 'vitepress-plugin-group-icons'; import sidebar from './sidebar'; +import snackPlayer from './markdown/snackPlayer'; +import sandpackPlugin from './markdown/sandpack'; +import { readFile } from 'node:fs/promises'; +import { resourcesSidebar } from './sidebar/resources'; import getStructuredData from './getStructuredData'; +import { createGeneralOGImage, createIconOGImage } from './createOGImage'; +import llmstxt from 'vitepress-plugin-llms'; + +const defaultSandpackCSS = await readFile( + fileURLToPath(new URL('./theme/sandpack-default.css', import.meta.url)), + 'utf-8', +); const title = 'Lucide'; const socialTitle = 'Lucide Icons'; @@ -15,6 +27,20 @@ export default defineConfig({ cleanUrls: true, outDir: '.vercel/output/static', srcExclude: ['**/README.md'], + markdown: { + config(md) { + md.use(groupIconMdPlugin); + md.use(snackPlayer); + md.use(sandpackPlugin, { + defaultFiles: { + '/styles.css': { + code: defaultSandpackCSS, + hidden: true, + }, + }, + }); + }, + }, vite: { resolve: { alias: [ @@ -36,6 +62,19 @@ export default defineConfig({ }, ], }, + plugins: [ + groupIconVitePlugin(), + llmstxt({ + ignoreFiles: [ + 'code-of-conduct.md', + 'index.md', + 'packages.md', + 'showcase.md', + 'brand-logo-statement.md', + 'icons/**', // Not working, need investigation + ], + }), + ], }, head: [ [ @@ -153,6 +192,7 @@ export default defineConfig({ ], ], async transformPageData(pageData) { + pageData.frontmatter.head ??= []; if ( pageData.relativePath.startsWith('icons/') && !pageData.relativePath.startsWith('icons/lab/') && @@ -173,13 +213,58 @@ export default defineConfig({ const structuredData = await getStructuredData(iconName, pageData); - pageData.frontmatter.head ??= []; + const ogPath = await createIconOGImage(iconName, pageData.params?.tags || []); + + if (ogPath) { + const content = `https://lucide.dev${ogPath}`; + pageData.frontmatter.head.push( + [ + 'meta', + { + property: 'og:image', + content, + }, + ], + [ + 'meta', + { + property: 'twitter:image', + content, + }, + ], + ); + } + pageData.frontmatter.head.push([ 'script', { type: 'application/ld+json' }, JSON.stringify(structuredData), ]); } + + if (pageData.relativePath.startsWith('guide/')) { + const ogPath = await createGeneralOGImage(pageData); + + if (ogPath) { + const content = `https://lucide.dev${ogPath}`; + pageData.frontmatter.head.push( + [ + 'meta', + { + property: 'og:image', + content, + }, + ], + [ + 'meta', + { + property: 'twitter:image', + content, + }, + ], + ); + } + } }, themeConfig: { logo: { @@ -189,9 +274,15 @@ export default defineConfig({ nav: [ { text: 'Icons', link: '/icons/' }, { text: 'Guide', link: '/guide/' }, + { + text: 'Resources', + items: [ + ...resourcesSidebar[0].items, + { text: 'Design icons', link: '/contribute/icon-design-guide' }, + ], + }, { text: 'Packages', link: '/packages' }, { text: 'Showcase', link: '/showcase' }, - { text: 'License', link: '/license' }, ], sidebar, socialLinks: [ diff --git a/docs/.vitepress/createOGImage.ts b/docs/.vitepress/createOGImage.ts new file mode 100644 index 000000000..84098314c --- /dev/null +++ b/docs/.vitepress/createOGImage.ts @@ -0,0 +1,79 @@ +import { PageData } from 'vitepress'; +import fs from 'node:fs/promises'; +import { cwd } from 'node:process'; +import { join } from 'node:path'; +import sharp from 'sharp'; + +const generalSVGTemplate = fs.readFile(join(cwd(), '.vitepress/lib/guideOGTemplate.svg'), 'utf-8'); + +export async function createGeneralOGImage({ title, description, relativePath }: PageData) { + const fileName = relativePath.replace(/\.md$/, '.png').replace(/\//g, '-'); + + const path = join(cwd(), 'public/og', fileName); + + let desc = description.replace(/&/g, '&').replace(//g, '>'); + if (!desc) { + desc = ''; + } + const lines = desc.replace(/(?![^\n]{1,64}$)([^\n]{1,64})\s/g, '$1\n').split('\n'); + const data = { + title: title, + line1: lines[0] || '', + line2: lines[1] || '', + line3: lines[2] || '', + line4: lines[3] || '', + }; + const svgTemplate = await generalSVGTemplate; + const svg = svgTemplate.replace(/\{\{([^}]+)\}\}/g, (_, name: keyof typeof data) => data[name]); + + console.log(`Generating ${fileName}`); + try { + await sharp(Buffer.from(svg)) + .resize(1200 * 1.1, 630 * 1.1) + .png() + .toFile(path); + } catch (e) { + console.error('Error generating', { filename: path, ...data, svg }); + console.error(e); + } + + return `/og/${fileName}`; +} + +const iconSVGTemplate = fs.readFile(join(cwd(), '.vitepress/lib/iconOGTemplate.svg'), 'utf-8'); + +export async function createIconOGImage(iconName: string, tags: string[]) { + const path = join(cwd(), 'public/og', `icon-${iconName}.png`); + + let iconSVG = await fs.readFile(join(cwd(), `../icons/${iconName}.svg`), 'utf-8'); + iconSVG = iconSVG + .replace('width="24"', 'width="320"') + .replace('height="24"', 'height="320"') + .replace('currentColor', '#dfdfd6') + .replace( + 'xmlns="http://www.w3.org/2000/svg"', + 'xmlns="http://www.w3.org/2000/svg" x="62" y="66"', + ); + + const data = { + name: iconName, + tags: tags.join(' • ').replace(//g, '>').replace(/&/g, '&'), + iconSVG, + }; + + const svgTemplate = await iconSVGTemplate; + const svg = svgTemplate.replace(/\{\{([^}]+)\}\}/g, (_, name: keyof typeof data) => data[name]); + + console.log(`Generating ${path}`); + try { + await sharp(Buffer.from(svg)) + .resize(1200 * 1.1, 630 * 1.1) + .png() + .toFile(path); + } catch (e) { + console.error('Error generating', { filename: path, ...data, svg }); + console.error(e); + } + + return `/og/icon-${iconName}.png`; +} diff --git a/docs/.vitepress/data/packageData.json b/docs/.vitepress/data/packageData.json index edcda5e41..da1c990cd 100644 --- a/docs/.vitepress/data/packageData.json +++ b/docs/.vitepress/data/packageData.json @@ -18,6 +18,7 @@ "lucide-react": { "order": 1, "icon": "react", + "docsAlias": "react", "shields": [ { "alt": "npm", @@ -34,14 +35,25 @@ "@lucide/vue": { "order": 2, "icon": "vue", - "docsAlias": "lucide-vue", + "docsAlias": "vue", "packageDirname": "vue", "shields": [ + { + "alt": "npm", + "src": "https://img.shields.io/npm/v/@lucide/vue", + "href": "https://www.npmjs.com/package/@lucide/vue" + }, + { + "alt": "npm", + "src": "https://img.shields.io/npm/dw/@lucide/vue", + "href": "https://www.npmjs.com/package/@lucide/vue" + } ] }, "lucide-svelte": { "order": 3, "icon": "svelte", + "docsAlias": "svelte", "shields": [ { "alt": "npm", @@ -58,6 +70,7 @@ "lucide-solid": { "order": 4, "icon": "solid", + "docsAlias": "solid", "shields": [ { "alt": "npm", @@ -74,6 +87,7 @@ "lucide-react-native": { "order": 5, "icon": "react-native", + "docsAlias": "react-native", "shields": [ { "alt": "npm", @@ -90,6 +104,7 @@ "@lucide/angular": { "order": 6, "icon": "angular", + "docsAlias": "angular", "shields": [ { "alt": "npm", @@ -105,7 +120,9 @@ }, "lucide-angular": { "order": 7, - "icon": "angular", + "icon": "angular-old", + "description": "Our legacy Angular package with a module based API.", + "documentation": "https://v0.lucide.dev/guide/packages/lucide-angular", "shields": [ { "alt": "npm", @@ -122,6 +139,7 @@ "lucide-preact": { "order": 8, "icon": "preact", + "docsAlias": "preact", "shields": [ { "alt": "npm", @@ -136,7 +154,7 @@ ] }, "@lucide/astro": { - "docsAlias": "lucide-astro", + "docsAlias": "astro", "packageDirname": "astro", "order": 9, "icon": "astro", @@ -157,6 +175,7 @@ "lucide-static": { "order": 10, "icon": "svg", + "docsAlias": "static", "shields": [ { "alt": "npm", @@ -171,6 +190,7 @@ ] }, "@lucide/icons": { + "hide": true, "docsAlias": "icons", "packageDirname": "icons", "order": 10, diff --git a/docs/.vitepress/data/packageData.thirdParty.json b/docs/.vitepress/data/packageData.thirdParty.json index 2e6fa4c53..b430797ab 100644 --- a/docs/.vitepress/data/packageData.thirdParty.json +++ b/docs/.vitepress/data/packageData.thirdParty.json @@ -117,7 +117,7 @@ }, { "name": "lucide-slint", - "description": "Implementation of the lucide icon library for Slint.", + "description": "Implementation of the Lucide icon library for Slint.", "icon": "/framework-logos/slint.svg", "shields": [ { diff --git a/docs/.vitepress/lib/SvgPreview/index.tsx b/docs/.vitepress/lib/SvgPreview/index.tsx index 63abfa878..864cea077 100644 --- a/docs/.vitepress/lib/SvgPreview/index.tsx +++ b/docs/.vitepress/lib/SvgPreview/index.tsx @@ -459,20 +459,7 @@ const SvgPreview = ( /> + + + + {{title}} + + + {{line1}} + {{line2}} + {{line3}} + {{line4}} + + + + + + https://lucide.dev + + + + + + + + + + + + + diff --git a/docs/.vitepress/lib/iconOGTemplate.svg b/docs/.vitepress/lib/iconOGTemplate.svg new file mode 100644 index 000000000..be67ca990 --- /dev/null +++ b/docs/.vitepress/lib/iconOGTemplate.svg @@ -0,0 +1,47 @@ + + + + + + + {{iconSVG}} + + + See the icon preview, code examples, + + release details and other related icons. + + + {{name}} + + + {{tags}} + + + + + + https://lucide.dev + + + + + + + + + + + + + + + + diff --git a/docs/.vitepress/markdown/sandpack.ts b/docs/.vitepress/markdown/sandpack.ts new file mode 100644 index 000000000..d73489e20 --- /dev/null +++ b/docs/.vitepress/markdown/sandpack.ts @@ -0,0 +1,138 @@ +import type MarkdownIt from 'markdown-it'; +import type { RenderRule } from 'markdown-it/lib/renderer.mjs'; +import container from 'markdown-it-container'; +import sandpackTheme from '../theme/sandpackTheme.json'; + +type SnackParams = { + defaultFiles?: Record< + string, + { + code: string; + active?: boolean; + hidden?: boolean; + } + >; +}; + +type ContainerArgs = [typeof container, string, { render: RenderRule }]; + +export default function sandpackPlugin(md: MarkdownIt, pluginOptions: SnackParams = {}) { + if (md == null) { + throw new Error('MarkdownIt instance is required for sandpackPlugin'); + } + const escapeHtml = md?.utils?.escapeHtml; + const defaultFence = + md.renderer.rules.fence || + ((tokens, idx, options, env, self) => self.renderToken(tokens, idx, options)); + + const renderSandbox = (tokenList: any[], index: number) => { + const renderFunc = (tokens: any[], idx: number) => { + if (tokens[idx].nesting === 1) { + const fileAttr: string[] = []; + const attrs = Object.fromEntries(tokens[idx].attrs || []); + + const files: Record< + string, + { + code: string; + active?: boolean; + hidden?: boolean; + } + > = {}; + + for ( + let i = idx + 1; + !(tokens[i].nesting === -1 && tokens[i].type === 'container_sandpack_close'); + ++i + ) { + if (tokens[i].type === 'fence' && tokens[i].tag === 'code') { + const info = tokens[i].info ?? ''; + const [lang, fileName, params = ''] = info.split(' '); + + const active = params.includes('[active]'); + const hidden = params.includes('[hidden]'); + + const code = tokens[i].content; + + if (fileName && code) { + files[fileName] = { + code, + }; + + if (active) { + (files[fileName] as any).active = true; + } + + if (hidden) { + (files[fileName] as any).hidden = true; + } + } + } + } + + const { dependencies, showTabs, externalResources, editorWidthPercentage, ...options } = + attrs; + + const dependencyList = dependencies?.split(',')?.map((dep: string) => dep.trim()) ?? []; + + const dependencyObject = dependencyList.reduce( + (acc: Record, name: string) => { + acc[name] = 'latest'; + return acc; + }, + {}, + ); + + const externalResourcesList = externalResources + ?.split(',') + ?.map((res: string) => res.trim()) + ?.filter((res: string) => res.length > 0); + + const filesWithDefaultStyles = { + ...pluginOptions.defaultFiles, + ...files, + }; + + return `\ + `; + } + return ``; + }; + return renderFunc(tokenList, index); + }; + + function createCodeGroup(md: MarkdownIt): ContainerArgs { + return [ + container, + 'sandpack', + { + render(tokens, idx) { + return renderSandbox(tokens, idx); + }, + }, + ]; + } + + md.use(...createCodeGroup(md)); +} diff --git a/docs/.vitepress/markdown/snackPlayer.ts b/docs/.vitepress/markdown/snackPlayer.ts new file mode 100644 index 000000000..a7d0abaad --- /dev/null +++ b/docs/.vitepress/markdown/snackPlayer.ts @@ -0,0 +1,99 @@ +/** + * SnackPlayer markdown-it plugin + * + * Converts fenced code blocks like: + * + * ```SnackPlayer name=My%20Example&description=Nice%20demo&ext=tsx + * // code here + * ``` + * + * into: + * + *
+ */ + +import type MarkdownIt from 'markdown-it'; + +type SnackParams = Record; + +function parseParams(paramString = ''): SnackParams { + const params = Object.fromEntries(new URLSearchParams(paramString)) as SnackParams; + + if (!params.platform) { + params.platform = 'web'; + } + + return params; +} + +export default function snackPlayerPlugin(md: MarkdownIt) { + const escapeHtml = md.utils.escapeHtml; + const defaultFence = + md.renderer.rules.fence || + ((tokens, idx, options, env, self) => self.renderToken(tokens, idx, options)); + + md.renderer.rules.fence = (tokens, idx, options, env, self) => { + const token = tokens[idx]; + const info = (token.info || '').trim(); + + if (!info) { + return defaultFence(tokens, idx, options, env, self); + } + + const [lang, ...rest] = info.split(/\s+/); + if (lang !== 'SnackPlayer') { + return defaultFence(tokens, idx, options, env, self); + } + + const paramString = rest.join(' '); + const params = parseParams(paramString); + + // Gather necessary params + const name = params.name ? decodeURIComponent(params.name) : 'Example'; + const description = params.description + ? decodeURIComponent(params.description) + : 'Example usage'; + const ext = params.ext ? decodeURIComponent(params.ext) : 'tsx'; + const filename = `App.${ext}`; + + const files = encodeURIComponent( + JSON.stringify({ + [filename]: { + type: 'CODE', + contents: token.content, + }, + }), + ); + + const dependencies = + 'react-native-safe-area-context' + (params.dependencies ? `,${params.dependencies}` : ''); + const platform = params.platform ?? 'web'; + const supportedPlatforms = params.supportedPlatforms ?? 'ios,android,web'; + const theme = params.theme ?? 'light'; + const preview = params.preview ?? 'true'; + const loading = params.loading ?? 'lazy'; + const deviceAppearance = params.deviceAppearance ?? 'dark'; + + // Build the HTML output (escaping where appropriate) + return ( + `` + ); + }; +} diff --git a/docs/.vitepress/sidebar.ts b/docs/.vitepress/sidebar.ts deleted file mode 100644 index 26d8eae88..000000000 --- a/docs/.vitepress/sidebar.ts +++ /dev/null @@ -1,143 +0,0 @@ -import { DefaultTheme, UserConfig } from 'vitepress'; - -const sidebar: UserConfig['themeConfig']['sidebar'] = { - guide: [ - { - text: 'Introduction', - items: [ - { text: 'What is lucide?', link: '/guide/' }, - { text: 'Installation', link: '/guide/installation' }, - { text: 'Comparison', link: '/guide/comparison' }, - ], - }, - { - text: 'Basics', - items: [ - { - text: 'Color', - link: '/guide/basics/color', - }, - { - text: 'Sizing', - link: '/guide/basics/sizing', - }, - { - text: 'Stroke width', - link: '/guide/basics/stroke-width', - }, - ], - }, - // TODO: Add this section - { - text: 'Advanced', - items: [ - { - text: 'Accessibility', - link: '/guide/advanced/accessibility', - }, - { - text: 'Global styling', - link: '/guide/advanced/global-styling', - }, - // { - // text: 'Animations', - // }, - { - text: 'Filled icons', - link: '/guide/advanced/filled-icons', - }, - { - text: 'Aliased Names', - link: '/guide/advanced/aliased-names', - }, - // { - // text: 'Combining icons', - // }, - // { - // text: 'Dynamic imports' - // }, - // { - // text: 'Auto importing' - // }, - ], - }, - { - text: 'Packages', - items: [ - { - text: 'Lucide', - link: '/guide/packages/lucide', - }, - { - text: 'React', - link: '/guide/packages/lucide-react', - }, - { - text: 'Vue', - link: '/guide/packages/lucide-vue', - }, - { - text: 'Svelte', - link: '/guide/packages/lucide-svelte', - }, - { - text: 'Solid', - link: '/guide/packages/lucide-solid', - }, - { - text: 'React Native', - link: '/guide/packages/lucide-react-native', - }, - { - text: 'Angular', - link: '/guide/packages/angular', - }, - { - text: 'Preact', - link: '/guide/packages/lucide-preact', - }, - { - text: 'Astro', - link: '/guide/packages/lucide-astro', - }, - { - text: 'Static', - link: '/guide/packages/lucide-static', - }, - { - text: 'Icon data & helpers', - link: '/guide/packages/icons', - }, - ], - }, - { - text: 'Contributing', - items: [ - { - text: 'Icon Design Principles', - link: '/guide/design/icon-design-guide', - }, - { - text: 'Designing in Illustrator', - link: '/guide/design/illustrator-guide', - }, - { - text: 'Designing in InkScape', - link: '/guide/design/inkscape-guide', - }, - { - text: 'Designing in Figma', - link: '/guide/design/figma-guide', - }, - { - text: 'Designing in Affinity Designer', - link: '/guide/design/affinity-designer-guide', - }, - ], - }, - ], - // This should be here to keep the sidebar shown on the icons page - icons: [{ text: '', link: '/' }], -}; - -export default sidebar; diff --git a/docs/.vitepress/sidebar/angular.ts b/docs/.vitepress/sidebar/angular.ts new file mode 100644 index 000000000..df244e363 --- /dev/null +++ b/docs/.vitepress/sidebar/angular.ts @@ -0,0 +1,107 @@ +import { DefaultTheme } from 'vitepress'; + +export const angularSidebar = [ + { + items: [ + { + text: 'Overview', + link: '/guide/angular/', + }, + { + text: 'Getting started', + link: '/guide/angular/getting-started', + desc: 'Learn how to get started with Lucide for Angular.', + }, + { + text: 'Migration from v0', + link: '/guide/angular/migration', + desc: 'Learn how to migrate from v0 to v1 of Lucide.', + }, + ], + }, + { + text: 'Basics', + items: [ + { + text: 'Color', + desc: 'Adjust the color of your icons', + link: '/guide/angular/basics/color', + }, + { + text: 'Sizing', + desc: 'Adjust the size of your icons', + link: '/guide/angular/basics/sizing', + }, + { + text: 'Stroke width', + desc: 'Adjust the stroke width of your icons', + link: '/guide/angular/basics/stroke-width', + }, + ], + }, + { + text: 'Advanced', + items: [ + { + text: 'Typescript', + link: '/guide/angular/advanced/typescript', + desc: 'All exported types and how to use them', + }, + { + text: 'Accessibility', + link: '/guide/angular/advanced/accessibility', + desc: 'Making your icons accessible', + }, + { + text: 'Global styling', + link: '/guide/angular/advanced/global-styling', + desc: 'Apply global styles to all icons', + }, + { + text: 'With Lucide Lab', + link: '/guide/angular/advanced/with-lucide-lab', + desc: 'Using lucide-lab with @lucide/angular', + }, + // { + // text: 'Animations', + // link: '/guide/angular/advanced/animations', + // desc: 'Add animations to your icons', + // }, + { + text: 'Filled icons', + link: '/guide/angular/advanced/filled-icons', + desc: 'Using filled icons in @lucide/angular', + }, + { + text: 'Combining icons', + link: '/guide/angular/advanced/combining-icons', + desc: 'Combine multiple icons into one', + }, + // { + // text: 'Dynamic icon component', + // link: '/guide/angular/advanced/dynamic-icon-component.md', + // desc: 'Dynamically import icons as needed', + // }, + { + text: 'Icon provider', + link: '/guide/angular/advanced/icon-provider', + desc: 'Provide icons at app level and use them by name', + }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'Accessibility in depth', + link: '/guide/accessibility', + desc: 'Accessibility best practices', + }, + { + text: 'VSCode', + link: '/guide/vscode', + desc: 'VSCode and Lucide', + }, + ], + }, +] satisfies DefaultTheme.SidebarItem[] & { items: { desc?: string }[] }[]; diff --git a/docs/.vitepress/sidebar/astro.ts b/docs/.vitepress/sidebar/astro.ts new file mode 100644 index 000000000..4aaa77c69 --- /dev/null +++ b/docs/.vitepress/sidebar/astro.ts @@ -0,0 +1,82 @@ +import { DefaultTheme } from 'vitepress'; + +export const astroSidebar = [ + { + items: [ + { + text: 'Overview', + link: '/guide/astro/', + }, + { + text: 'Getting started', + link: '/guide/astro/getting-started', + desc: 'Learn how to get started with Lucide for Astro.', + }, + { + text: 'Migration from v0', + link: '/guide/astro/migration', + desc: 'Learn how to migrate from v0 to v1 of Lucide Astro.', + }, + ], + }, + { + text: 'Basics', + items: [ + { + text: 'Color', + desc: 'Adjust the color of your icons', + link: '/guide/astro/basics/color', + }, + { + text: 'Sizing', + desc: 'Adjust the size of your icons', + link: '/guide/astro/basics/sizing', + }, + { + text: 'Stroke width', + desc: 'Adjust the stroke width of your icons', + link: '/guide/astro/basics/stroke-width', + }, + ], + }, + { + text: 'Advanced', + items: [ + { + text: 'Typescript', + link: '/guide/astro/advanced/typescript', + desc: 'All exported types and how to use them', + }, + { + text: 'Accessibility', + link: '/guide/astro/advanced/accessibility', + desc: 'Making your icons accessible', + }, + { + text: 'Global styling', + link: '/guide/astro/advanced/global-styling', + desc: 'Apply global styles to all icons', + }, + { + text: 'With Lucide Lab', + link: '/guide/astro/advanced/with-lucide-lab', + desc: 'Using lucide-lab with @lucide/astro', + }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'Accessibility in depth', + link: '/guide/accessibility', + desc: 'Accessibility best practices', + }, + { + text: 'VSCode', + link: '/guide/vscode', + desc: 'VSCode and Lucide', + }, + ], + }, +] satisfies DefaultTheme.SidebarItem[] & { items: { desc?: string }[] }[]; diff --git a/docs/.vitepress/sidebar/index.ts b/docs/.vitepress/sidebar/index.ts new file mode 100644 index 000000000..df0a780d3 --- /dev/null +++ b/docs/.vitepress/sidebar/index.ts @@ -0,0 +1,49 @@ +import { DefaultTheme, UserConfig } from 'vitepress'; +import { reactSidebar } from './react'; +import { vueSidebar } from './vue'; +import { svelteSidebar } from './svelte'; +import { lucideSidebar } from './lucide'; +import { solidSidebar } from './solid'; +import { preactSidebar } from './preact'; +import { reactNativeSidebar } from './react-native'; +import { astroSidebar } from './astro'; +import { resourcesSidebar } from './resources'; +import { angularSidebar } from './angular'; +import { lucideStaticSidebar } from './static'; + +type Sidebar = UserConfig['themeConfig']['sidebar']; + +export const guideSidebarTop: DefaultTheme.SidebarItem[] = [ + { + text: 'Introduction', + items: [ + { text: 'What is Lucide?', link: '/guide/' }, + { text: 'Version 1', link: '/guide/version-1' }, + { text: 'Installation', link: '/guide/installation' }, + { text: 'Comparison', link: '/guide/comparison' }, + ], + }, +]; + +const sidebar: Sidebar = { + '/guide': [{ text: '', link: '/' }], + '/guide/lucide/': lucideSidebar, + '/guide/react/': reactSidebar, + '/guide/vue/': vueSidebar, + '/guide/svelte/': svelteSidebar, + '/guide/solid/': solidSidebar, + '/guide/astro/': astroSidebar, + '/guide/preact/': preactSidebar, + '/guide/react-native/': reactNativeSidebar, + '/guide/angular/': angularSidebar, + '/guide/static/': lucideStaticSidebar, + '/community': resourcesSidebar, + '/contribute': resourcesSidebar, + '/license': resourcesSidebar, + '/code-of-conduct': resourcesSidebar, + '/brand-logo-statement': resourcesSidebar, + // This should be here to keep the sidebar shown on the icons page + icons: [{ text: '', link: '/' }], +}; + +export default sidebar; diff --git a/docs/.vitepress/sidebar/lucide.ts b/docs/.vitepress/sidebar/lucide.ts new file mode 100644 index 000000000..b61c2d6f1 --- /dev/null +++ b/docs/.vitepress/sidebar/lucide.ts @@ -0,0 +1,87 @@ +import { DefaultTheme } from 'vitepress'; + +export const lucideSidebar = [ + { + items: [ + { + text: 'Overview', + link: '/guide/lucide/', + }, + { + text: 'Getting started', + link: '/guide/lucide/getting-started', + desc: 'Learn how to get started with Lucide.', + }, + { + text: 'Migration from v0', + link: '/guide/lucide/migration', + desc: 'Learn how to migrate from v0 to v1 of Lucide.', + }, + ], + }, + { + text: 'Basics', + items: [ + { + text: 'Color', + desc: 'Adjust the color of your icons', + link: '/guide/lucide/basics/color', + }, + { + text: 'Sizing', + desc: 'Adjust the size of your icons', + link: '/guide/lucide/basics/sizing', + }, + { + text: 'Stroke width', + desc: 'Adjust the stroke width of your icons', + link: '/guide/lucide/basics/stroke-width', + }, + ], + }, + { + text: 'Advanced', + items: [ + { + text: 'Global styling', + link: '/guide/lucide/advanced/global-styling', + desc: 'Apply options and styles globally', + }, + { + text: 'Shadow DOM', + link: '/guide/lucide/advanced/shadow-dom', + desc: 'All exported types and how to use them', + }, + { + text: 'Template element', + link: '/guide/lucide/advanced/content-template-element', + desc: 'Using content template element with lucide', + }, + { + text: 'Accessibility', + link: '/guide/lucide/advanced/accessibility', + desc: 'Making your icons accessible', + }, + { + text: 'With Lucide Lab', + link: '/guide/lucide/advanced/with-lucide-lab', + desc: 'Using lucide-lab with lucide', + }, + { + text: 'Filled icons', + link: '/guide/lucide/advanced/filled-icons', + desc: 'Using filled icons in lucide', + }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'Accessibility in depth', + link: '/guide/accessibility', + desc: 'Accessibility best practices', + }, + ], + }, +] satisfies DefaultTheme.SidebarItem[] & { items: { desc?: string }[] }[]; diff --git a/docs/.vitepress/sidebar/preact.ts b/docs/.vitepress/sidebar/preact.ts new file mode 100644 index 000000000..7ecf24fc6 --- /dev/null +++ b/docs/.vitepress/sidebar/preact.ts @@ -0,0 +1,102 @@ +import { DefaultTheme } from 'vitepress'; + +export const preactSidebar = [ + { + items: [ + { + text: 'Overview', + link: '/guide/preact/', + }, + { + text: 'Getting started', + link: '/guide/preact/getting-started', + desc: 'Learn how to get started with Lucide for PReact.', + }, + { + text: 'Migration from v0', + link: '/guide/preact/migration', + desc: 'Learn how to migrate from v0 to v1 of Lucide.', + }, + ], + }, + { + text: 'Basics', + items: [ + { + text: 'Color', + desc: 'Adjust the color of your icons', + link: '/guide/preact/basics/color', + }, + { + text: 'Sizing', + desc: 'Adjust the size of your icons', + link: '/guide/preact/basics/sizing', + }, + { + text: 'Stroke width', + desc: 'Adjust the stroke width of your icons', + link: '/guide/preact/basics/stroke-width', + }, + ], + }, + { + text: 'Advanced', + items: [ + { + text: 'Typescript', + link: '/guide/preact/advanced/typescript', + desc: 'All exported types and how to use them', + }, + { + text: 'Accessibility', + link: '/guide/preact/advanced/accessibility', + desc: 'Making your icons accessible', + }, + { + text: 'Global styling', + link: '/guide/preact/advanced/global-styling', + desc: 'Apply global styles to all icons', + }, + { + text: 'With Lucide Lab', + link: '/guide/preact/advanced/with-lucide-lab', + desc: 'Using lucide-lab with lucide-preact', + }, + // { + // text: 'Animations', + // link: '/guide/preact/advanced/animations', + // desc: 'Add animations to your icons', + // }, + { + text: 'Filled icons', + link: '/guide/preact/advanced/filled-icons', + desc: 'Using filled icons in lucide-preact', + }, + { + text: 'Aliased Names', + link: '/guide/preact/advanced/aliased-names', + desc: 'Using aliased icon names', + }, + { + text: 'Combining icons', + link: '/guide/preact/advanced/combining-icons', + desc: 'Combine multiple icons into one', + }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'Accessibility in depth', + link: '/guide/accessibility', + desc: 'Accessibility best practices', + }, + { + text: 'VSCode', + link: '/guide/vscode', + desc: 'VSCode and Lucide', + }, + ], + }, +] satisfies DefaultTheme.SidebarItem[] & { items: { desc?: string }[] }[]; diff --git a/docs/.vitepress/sidebar/react-native.ts b/docs/.vitepress/sidebar/react-native.ts new file mode 100644 index 000000000..152a4adc5 --- /dev/null +++ b/docs/.vitepress/sidebar/react-native.ts @@ -0,0 +1,87 @@ +import { DefaultTheme } from 'vitepress'; + +export const reactNativeSidebar = [ + { + items: [ + { + text: 'Overview', + link: '/guide/react-native/', + }, + { + text: 'Getting started', + link: '/guide/react-native/getting-started', + desc: 'Learn how to get started with Lucide React Native', + }, + { + text: 'Migration from v0', + link: '/guide/react-native/migration', + desc: 'Learn how to migrate from v0 to v1 of Lucide.', + }, + ], + }, + { + text: 'Basics', + items: [ + { + text: 'Color', + desc: 'Adjust the color of your icons', + link: '/guide/react-native/basics/color', + }, + { + text: 'Sizing', + desc: 'Adjust the size of your icons', + link: '/guide/react-native/basics/sizing', + }, + { + text: 'Stroke width', + desc: 'Adjust the stroke width of your icons', + link: '/guide/react-native/basics/stroke-width', + }, + ], + }, + { + text: 'Advanced', + items: [ + { + text: 'Typescript', + link: '/guide/react-native/advanced/typescript', + desc: 'All exported types and how to use them', + }, + { + text: 'Global styling', + link: '/guide/react-native/advanced/global-styling', + desc: 'Apply global styles to all icons', + }, + { + text: 'With Lucide Lab', + link: '/guide/react-native/advanced/with-lucide-lab', + desc: 'Using lucide-lab with lucide-react-native', + }, + { + text: 'Filled icons', + link: '/guide/react-native/advanced/filled-icons', + desc: 'Using filled icons in lucide-react-native', + }, + { + text: 'Aliased Names', + link: '/guide/react-native/advanced/aliased-names', + desc: 'Using aliased icon names', + }, + { + text: 'Combining icons', + link: '/guide/react-native/advanced/combining-icons', + desc: 'Combine multiple icons into one', + }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'VSCode', + link: '/guide/vscode', + desc: 'VSCode and Lucide', + }, + ], + }, +] satisfies DefaultTheme.SidebarItem[] & { items: { desc?: string }[] }[]; diff --git a/docs/.vitepress/sidebar/react.ts b/docs/.vitepress/sidebar/react.ts new file mode 100644 index 000000000..5d85386ea --- /dev/null +++ b/docs/.vitepress/sidebar/react.ts @@ -0,0 +1,113 @@ +import { DefaultTheme } from 'vitepress'; + +export const reactSidebar = [ + { + items: [ + { + text: 'Overview', + link: '/guide/react/', + }, + { + text: 'Getting started', + link: '/guide/react/getting-started', + desc: 'Learn how to get started with Lucide for React.', + }, + { + text: 'Migration from v0', + link: '/guide/react/migration', + desc: 'Learn how to migrate from v0 to v1 of Lucide.', + }, + { + text: 'Migration from React Feather', + link: '/guide/react/migration-from-feather', + desc: 'Learn how to migrate from `react-feather` to `lucide-react`', + }, + ], + }, + { + text: 'Basics', + items: [ + { + text: 'Color', + desc: 'Adjust the color of your icons', + link: '/guide/react/basics/color', + }, + { + text: 'Sizing', + desc: 'Adjust the size of your icons', + link: '/guide/react/basics/sizing', + }, + { + text: 'Stroke width', + desc: 'Adjust the stroke width of your icons', + link: '/guide/react/basics/stroke-width', + }, + ], + }, + { + text: 'Advanced', + items: [ + { + text: 'Typescript', + link: '/guide/react/advanced/typescript', + desc: 'All exported types and how to use them', + }, + { + text: 'Accessibility', + link: '/guide/react/advanced/accessibility', + desc: 'Making your icons accessible', + }, + { + text: 'Global styling', + link: '/guide/react/advanced/global-styling', + desc: 'Apply global styles to all icons', + }, + { + text: 'With Lucide Lab', + link: '/guide/react/advanced/with-lucide-lab', + desc: 'Using lucide-lab with lucide-react', + }, + // { + // text: 'Animations', + // link: '/guide/react/advanced/animations', + // desc: 'Add animations to your icons', + // }, + { + text: 'Filled icons', + link: '/guide/react/advanced/filled-icons', + desc: 'Using filled icons in lucide-react', + }, + { + text: 'Aliased Names', + link: '/guide/react/advanced/aliased-names', + desc: 'Using aliased icon names', + }, + + { + text: 'Combining icons', + link: '/guide/react/advanced/combining-icons', + desc: 'Combine multiple icons into one', + }, + { + text: 'Dynamic icon component', + link: '/guide/react/advanced/dynamic-icon-component.md', + desc: 'Dynamically import icons as needed', + }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'Accessibility in depth', + link: '/guide/accessibility', + desc: 'Accessibility best practices', + }, + { + text: 'VSCode', + link: '/guide/vscode', + desc: 'VSCode and Lucide', + }, + ], + }, +] satisfies DefaultTheme.SidebarItem[] & { items: { desc?: string }[] }[]; diff --git a/docs/.vitepress/sidebar/resources.ts b/docs/.vitepress/sidebar/resources.ts new file mode 100644 index 000000000..649815478 --- /dev/null +++ b/docs/.vitepress/sidebar/resources.ts @@ -0,0 +1,52 @@ +export const resourcesSidebar = [ + { + text: 'About', + items: [ + { + text: 'License', + link: '/license', + }, + { + text: 'Community', + link: '/community', + }, + { + text: 'Code of Conduct', + link: '/code-of-conduct', + }, + { + text: 'Brand logo statement', + link: '/brand-logo-statement', + }, + { + text: 'Contributing', + link: '/contribute', + }, + ], + }, + { + text: 'Designing icons', + items: [ + { + text: 'Icon Design Principles', + link: '/contribute/icon-design-guide', + }, + { + text: 'Designing in Illustrator', + link: '/contribute/illustrator-guide', + }, + { + text: 'Designing in Inkscape', + link: '/contribute/inkscape-guide', + }, + { + text: 'Designing in Figma', + link: '/contribute/figma-guide', + }, + { + text: 'Designing in Affinity Designer', + link: '/contribute/affinity-designer-guide', + }, + ], + }, +]; diff --git a/docs/.vitepress/sidebar/solid.ts b/docs/.vitepress/sidebar/solid.ts new file mode 100644 index 000000000..78f1855a2 --- /dev/null +++ b/docs/.vitepress/sidebar/solid.ts @@ -0,0 +1,103 @@ +import { DefaultTheme } from 'vitepress'; + +export const solidSidebar = [ + { + items: [ + { + text: 'Overview', + link: '/guide/solid/', + }, + { + text: 'Getting started', + link: '/guide/solid/getting-started', + desc: 'Learn how to get started with Lucide.', + }, + { + text: 'Migration from v0', + link: '/guide/solid/migration', + desc: 'Learn how to migrate from v0 to v1 of Lucide.', + }, + ], + }, + { + text: 'Basics', + items: [ + { + text: 'Color', + desc: 'Adjust the color of your icons', + link: '/guide/solid/basics/color', + }, + { + text: 'Sizing', + desc: 'Adjust the size of your icons', + link: '/guide/solid/basics/sizing', + }, + { + text: 'Stroke width', + desc: 'Adjust the stroke width of your icons', + link: '/guide/solid/basics/stroke-width', + }, + ], + }, + { + text: 'Advanced', + items: [ + { + text: 'Typescript', + link: '/guide/solid/advanced/typescript', + desc: 'All exported types and how to use them', + }, + { + text: 'Accessibility', + link: '/guide/solid/advanced/accessibility', + desc: 'Making your icons accessible', + }, + { + text: 'Global styling', + link: '/guide/solid/advanced/global-styling', + desc: 'Apply global styles to all icons', + }, + { + text: 'With Lucide Lab', + link: '/guide/solid/advanced/with-lucide-lab', + desc: 'Using lucide-lab with lucide-solid', + }, + // { + // text: 'Animations', + // link: '/guide/solid/advanced/animations', + // desc: 'Add animations to your icons', + // }, + { + text: 'Filled icons', + link: '/guide/solid/advanced/filled-icons', + desc: 'Using filled icons in lucide-solid', + }, + { + text: 'Aliased Names', + link: '/guide/solid/advanced/aliased-names', + desc: 'Using aliased icon names', + }, + // Add support for this later + // { + // text: 'Combining icons', + // link: '/guide/solid/advanced/combining-icons', + // desc: 'Combine multiple icons into one', + // }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'Accessibility in depth', + link: '/guide/accessibility', + desc: 'Accessibility best practices', + }, + { + text: 'VSCode', + link: '/guide/vscode', + desc: 'VSCode and Lucide', + }, + ], + }, +] satisfies DefaultTheme.SidebarItem[] & { items: { desc?: string }[] }[]; diff --git a/docs/.vitepress/sidebar/static.ts b/docs/.vitepress/sidebar/static.ts new file mode 100644 index 000000000..6628623a6 --- /dev/null +++ b/docs/.vitepress/sidebar/static.ts @@ -0,0 +1,88 @@ +import { DefaultTheme } from 'vitepress'; + +export const lucideStaticSidebar = [ + { + items: [ + { + text: 'Overview', + desc: 'Overview of using Lucide icons as static assets in your projects', + link: '/guide/static/', + }, + { + text: 'Getting started', + link: '/guide/static/getting-started', + desc: 'Learn how to get started with Lucide static.', + }, + { + text: 'Migration from v0', + link: '/guide/static/migration', + desc: 'Learn how to migrate from v0 to v1 of Lucide static.', + }, + ], + }, + { + text: 'SVG Files & Sprite', + items: [ + { + text: 'Import SVG files as images', + desc: 'Use icons as images in your project', + link: '/guide/static/link-as-image', + }, + { + text: 'SVG Sprite', + desc: 'Use SVG sprites in your project', + link: '/guide/static/svg-sprite', + }, + ], + }, + { + text: 'Icon Font', + items: [ + { + text: 'Import as font', + desc: 'Use icons as a web font in your project', + link: '/guide/static/font/', + }, + { + text: 'Color', + desc: 'Adjust the color of your icons', + link: '/guide/static/font/color', + }, + { + text: 'Sizing', + desc: 'Adjust the size of your icons', + link: '/guide/static/font/sizing', + }, + ], + }, + { + text: 'SVG String JS modules', + items: [ + { + text: 'Use in Node.js', + desc: 'Use Lucide in your Node.js projects', + link: '/guide/static/js-modules/node', + }, + { + text: 'Use in JS projects', + desc: 'Use Lucide in your JavaScript projects', + link: '/guide/static/js-modules/web', + }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'Accessibility in depth', + link: '/guide/accessibility', + desc: 'Accessibility best practices', + }, + { + text: 'VSCode', + link: '/guide/vscode', + desc: 'VSCode and Lucide', + }, + ], + }, +] satisfies DefaultTheme.SidebarItem[] & { items: { desc?: string }[] }[]; diff --git a/docs/.vitepress/sidebar/svelte.ts b/docs/.vitepress/sidebar/svelte.ts new file mode 100644 index 000000000..80dbf365f --- /dev/null +++ b/docs/.vitepress/sidebar/svelte.ts @@ -0,0 +1,92 @@ +import { DefaultTheme } from 'vitepress'; + +export const svelteSidebar = [ + { + items: [ + { + text: 'Overview', + link: '/guide/svelte/', + }, + { + text: 'Getting started', + link: '/guide/svelte/getting-started', + desc: 'Learn how to get started with Lucide for Svelte.', + }, + { + text: 'Migration from v0', + link: '/guide/svelte/migration', + desc: 'Learn how to migrate from v0 to v1 of Lucide.', + }, + ], + }, + { + text: 'Basics', + items: [ + { + text: 'Color', + desc: 'Adjust the color of your icons', + link: '/guide/svelte/basics/color', + }, + { + text: 'Sizing', + desc: 'Adjust the size of your icons', + link: '/guide/svelte/basics/sizing', + }, + { + text: 'Stroke width', + desc: 'Adjust the stroke width of your icons', + link: '/guide/svelte/basics/stroke-width', + }, + ], + }, + { + text: 'Advanced', + items: [ + { + text: 'Typescript', + link: '/guide/svelte/advanced/typescript', + desc: 'All exported types and how to use them', + }, + { + text: 'Accessibility', + link: '/guide/svelte/advanced/accessibility', + desc: 'Making your icons accessible', + }, + { + text: 'Global styling', + link: '/guide/svelte/advanced/global-styling', + desc: 'Apply global styles to all icons', + }, + { + text: 'With Lucide Lab', + link: '/guide/svelte/advanced/with-lucide-lab', + desc: 'Using lucide-lab with @lucide/svelte', + }, + { + text: 'Filled icons', + link: '/guide/svelte/advanced/filled-icons', + desc: 'Using filled icons in @lucide/svelte', + }, + { + text: 'Combining icons', + link: '/guide/svelte/advanced/combining-icons', + desc: 'Combine multiple icons into one', + }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'Accessibility in depth', + link: '/guide/accessibility', + desc: 'Accessibility best practices', + }, + { + text: 'VSCode', + link: '/guide/vscode', + desc: 'VSCode and Lucide', + }, + ], + }, +] satisfies DefaultTheme.SidebarItem[] & { items: { desc?: string }[] }[]; diff --git a/docs/.vitepress/sidebar/vue.ts b/docs/.vitepress/sidebar/vue.ts new file mode 100644 index 000000000..3840ef7bd --- /dev/null +++ b/docs/.vitepress/sidebar/vue.ts @@ -0,0 +1,98 @@ +import { DefaultTheme } from 'vitepress'; + +export const vueSidebar = [ + { + items: [ + { + text: 'Overview', + link: '/guide/vue/', + }, + { + text: 'Getting started', + link: '/guide/vue/getting-started', + desc: 'Learn how to get started with Lucide for Vue.', + }, + { + text: 'Migration from v0', + link: '/guide/vue/migration', + desc: 'Learn how to migrate from v0 to v1 of Lucide.', + }, + ], + }, + { + text: 'Basics', + items: [ + { + text: 'Color', + desc: 'Adjust the color of your icons', + link: '/guide/vue/basics/color', + }, + { + text: 'Sizing', + desc: 'Adjust the size of your icons', + link: '/guide/vue/basics/sizing', + }, + { + text: 'Stroke width', + desc: 'Adjust the stroke width of your icons', + link: '/guide/vue/basics/stroke-width', + }, + ], + }, + { + text: 'Advanced', + items: [ + { + text: 'Typescript', + link: '/guide/vue/advanced/typescript', + desc: 'All exported types and how to use them', + }, + { + text: 'Accessibility', + link: '/guide/vue/advanced/accessibility', + desc: 'Making your icons accessible', + }, + { + text: 'Global styling', + link: '/guide/vue/advanced/global-styling', + desc: 'Apply global styles to all icons', + }, + { + text: 'With Lucide Lab', + link: '/guide/vue/advanced/with-lucide-lab', + desc: 'Using lucide-lab with @lucide/vue', + }, + { + text: 'Filled icons', + link: '/guide/vue/advanced/filled-icons', + desc: 'Using filled icons in @lucide/vue', + }, + { + text: 'Aliased Names', + link: '/guide/vue/advanced/aliased-names', + desc: 'Using aliased icon names', + }, + + { + text: 'Combining icons', + link: '/guide/vue/advanced/combining-icons', + desc: 'Combine multiple icons into one', + }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'Accessibility in depth', + link: '/guide/accessibility', + desc: 'Accessibility best practices', + }, + { + text: 'VSCode', + link: '/guide/vscode', + desc: 'VSCode and Lucide', + }, + ], + }, +] satisfies DefaultTheme.SidebarItem[] & { items: { desc?: string }[] }[]; diff --git a/docs/.vitepress/theme/components/base/ButtonMenu.vue b/docs/.vitepress/theme/components/base/ButtonMenu.vue index 6580c8fdb..618642d4a 100644 --- a/docs/.vitepress/theme/components/base/ButtonMenu.vue +++ b/docs/.vitepress/theme/components/base/ButtonMenu.vue @@ -1,62 +1,58 @@