diff --git a/.cspell/custom-words.txt b/.cspell/custom-words.txt index 206b4c999..d41cd853b 100644 --- a/.cspell/custom-words.txt +++ b/.cspell/custom-words.txt @@ -9,8 +9,10 @@ strikethrough touchpad ungroup pilcrow +toc # Brands codepen codesandbox dribbble +x.com diff --git a/.github/ISSUE_TEMPLATE/02_bug_report.yml b/.github/ISSUE_TEMPLATE/02_bug_report.yml index 21dd4e1f2..d8567aca2 100644 --- a/.github/ISSUE_TEMPLATE/02_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/02_bug_report.yml @@ -22,6 +22,7 @@ body: - label: lucide-svelte - label: lucide-vue - label: lucide-vue-next + - label: lucide-astro - label: Figma plugin - label: source/main - label: other/not relevant diff --git a/.github/ISSUE_TEMPLATE/04_feature_request.yml b/.github/ISSUE_TEMPLATE/04_feature_request.yml index 9b07f3645..63a2469ec 100644 --- a/.github/ISSUE_TEMPLATE/04_feature_request.yml +++ b/.github/ISSUE_TEMPLATE/04_feature_request.yml @@ -22,6 +22,7 @@ body: - label: lucide-svelte - label: lucide-vue - label: lucide-vue-next + - label: lucide-astro - label: Figma plugin - label: all JS packages - label: site diff --git a/.github/actions/build-and-test.yml b/.github/actions/build-and-test.yml deleted file mode 100644 index 5b5a4675f..000000000 --- a/.github/actions/build-and-test.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: 'Build and Test' -description: 'Builds and test a package' - -inputs: - name: - description: “Name of the package” - required: true - -runs: - using: 'composite' - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 16 - - - uses: pnpm/action-setup@v2 - name: Install pnpm - id: pnpm-install - with: - version: 8 - run_install: false - - - name: Get pnpm store directory - id: pnpm-cache - run: | - echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - - - uses: actions/cache@v3 - name: Setup pnpm cache - with: - path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: Install dependencies - run: pnpm install --filter lucide-preact - - - name: Build - run: pnpm --filter lucide-preact build - - - name: Test - run: pnpm --filter lucide-preact test diff --git a/.github/actions/check-icons.yml b/.github/actions/check-icons.yml deleted file mode 100644 index 0850a17ac..000000000 --- a/.github/actions/check-icons.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: 'Check icons' -description: 'Cross-checks icon and category references in JSON descriptors' - -inputs: - name: - description: “Name of the package” - required: true - -runs: - using: 'composite' - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 16 - - - uses: pnpm/action-setup@v2 - name: Install pnpm - id: pnpm-install - with: - version: 8 - run_install: false - - - name: Get pnpm store directory - id: pnpm-cache - run: | - echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - - - uses: actions/cache@v3 - name: Setup pnpm cache - with: - path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: Install dependencies - run: pnpm install --filter . - - - name: Check icons and categories - run: pnpm checkIcons diff --git a/.github/labeler.yml b/.github/labeler.yml index 2023caf3d..b690d1926 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -79,6 +79,12 @@ - any-glob-to-any-file: - 'packages/lucide-solid/*' +# For changes in the lucide astro package +🚀 astro package: + - changed-files: + - any-glob-to-any-file: + - 'packages/astro/*' + # For changes in the lucide static package 🪨 static package: - changed-files: diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 2403cee42..53e3d2912 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,16 +1,18 @@ + + - -## What is the purpose of this pull request? - -- [ ] New Icon -- [ ] Bug fix -- [ ] New Feature -- [ ] Documentation update -- [ ] Other: - -### Description +## Description ### Icon use case diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b6f6fed5..d37da8f74 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,20 +9,18 @@ on: jobs: create-release: - if: github.repository == 'lucide-icons/lucide' + if: github.repository == 'lucide-icons/lucide' && startsWith(github.event.head_commit.message, 'feat(icons)') runs-on: ubuntu-latest outputs: VERSION: ${{ steps.new-version.outputs.NEW_VERSION }} steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile @@ -63,8 +61,40 @@ jobs: uses: softprops/action-gh-release@v1 with: tag_name: ${{ steps.new-version.outputs.NEW_VERSION }} - name: New icons ${{ steps.new-version.outputs.NEW_VERSION }} - body: ${{ steps.change-log.outputs.CHANGE_LOG }} + name: Version ${{ steps.new-version.outputs.NEW_VERSION }} + generate_release_notes: true + + test-semantic-release: + if: github.repository == 'lucide-icons/lucide' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Semantic Release + id: semantic + uses: cycjimmy/semantic-release-action@v4 + with: + tag_format: ${version} + branches: | + ['new-release-workflow'] + extends: | + semantic-release-monorepo + extra_plugins: | + @semantic-release/github + @semantic-release/git + @semantic-release/release-notes-generator + conventional-changelog-conventionalcommits + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Log output + if: steps.semantic.outputs.new_release_published == 'true' + run: | + echo ${{ steps.semantic.outputs.new_release_version }} + echo ${{ steps.semantic.outputs.new_release_major_version }} + echo ${{ steps.semantic.outputs.new_release_minor_version }} + echo ${{ steps.semantic.outputs.new_release_patch_version }} start-release: if: github.repository == 'lucide-icons/lucide' diff --git a/.github/workflows/close-issue-with-banned-phrases.yml b/.github/workflows/close-issue-with-banned-phrases.yml new file mode 100644 index 000000000..2807f3607 --- /dev/null +++ b/.github/workflows/close-issue-with-banned-phrases.yml @@ -0,0 +1,35 @@ +name: Close Issue with Banned Phrases + +on: + issues: + types: [opened] + +jobs: + block_phrases: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Check for blocked phrases in issue title + run: | + ISSUE_TITLE=$(jq -r '.issue.title' "$GITHUB_EVENT_PATH") + BLOCKED_PHRASES=("twitter" "whatsapp" "logo" "google" "tiktok" "facebook" "slack" "discord" "bluesky" "spotify" "behance" "pix" "x.com") + + # Check title and body for blocked phrases + for PHRASE in "${BLOCKED_PHRASES[@]}" + do + if echo "$ISSUE_TITLE" | grep -i "$PHRASE"; then + gh issue close ${{ github.event.issue.number }} --reason "not planned" --comment "This looks like a duplicate, use the [search](https://github.com/lucide-icons/lucide/issues?q=is%3Aissue+$PHRASE) to find similar issues. + + Read more about brand guideline rules at [We're not accepting new Brand icons #670](https://github.com/lucide-icons/lucide/issues/670). + + Always happy to help on [Discord](https://discord.gg/EH6nSts)." + gh issue lock ${{ github.event.issue.number }} --reason spam + exit 1 + fi + done + env: + GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/comment-icon-preview.yml b/.github/workflows/comment-icon-preview.yml new file mode 100644 index 000000000..1ba1aa89e --- /dev/null +++ b/.github/workflows/comment-icon-preview.yml @@ -0,0 +1,58 @@ +name: Icon preview comment + +on: + workflow_run: + workflows: ['Pull request icon preview'] + types: + - completed + +jobs: + upload: + runs-on: ubuntu-latest + if: > + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' + steps: + - name: 'Download artifact' + uses: actions/github-script@v7 + with: + script: | + let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: context.payload.workflow_run.id, + }); + let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { + return artifact.name == "pr_number" + })[0]; + let download = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: 'zip', + }); + const fs = require('fs'); + fs.writeFileSync('${{github.workspace}}/pr_number.zip', Buffer.from(download.data)); + + - name: 'Unzip artifact' + run: unzip pr_number.zip + + - name: 'Get PR number' + run: echo "number=$(cat NR)" >> $GITHUB_OUTPUT + id: pr-number + + - name: Find Comment + uses: peter-evans/find-comment@v2 + id: pr-comment + with: + issue-number: ${{ steps.pr-number.outputs.number }} + comment-author: 'github-actions[bot]' + body-includes: Added or changed icons + + - name: Create or update comment + uses: peter-evans/create-or-update-comment@v3 + with: + comment-id: ${{ steps.pr-comment.outputs.comment-id }} + issue-number: ${{ steps.pr-number.outputs.number }} + body-path: comment-markup.md + edit-mode: replace diff --git a/.github/workflows/linting.yml b/.github/workflows/lint-code.yml similarity index 67% rename from .github/workflows/linting.yml rename to .github/workflows/lint-code.yml index cdc76ea5a..2f4206001 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/lint-code.yml @@ -1,22 +1,20 @@ -name: Linting +name: Linting PR on: pull_request: - branches: - - '**' + paths-ignore: + - icons/*.svg jobs: - linting: + lint-code: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install Dependencies run: pnpm install --frozen-lockfile diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml new file mode 100644 index 000000000..d5f7ce8a3 --- /dev/null +++ b/.github/workflows/lint-pr-title.yml @@ -0,0 +1,32 @@ +name: Linting PR + +on: + pull_request: + types: + - opened + - edited + - reopened + +jobs: + lint-pr-title: + name: PR Title Lint + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + fix + feat + perf + refactor + test + style + docs + ci + build + chore + requireScope: true + ignoreLabels: | + bot diff --git a/.github/workflows/linting-icons.yml b/.github/workflows/linting-icons.yml new file mode 100644 index 000000000..d768ff1b1 --- /dev/null +++ b/.github/workflows/linting-icons.yml @@ -0,0 +1,36 @@ +name: Linting Icons + +on: + pull_request: + paths: + - 'icons/*' + +jobs: + lint-filenames: + name: Lint Filenames + if: github.repository == 'lucide-icons/lucide' + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v46 + with: + files: icons/* + + - name: Generate annotations + run: node ./scripts/lintFilenames.mjs + env: + CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} + + lint-aliases: + name: Check Uniqueness of Aliases + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + - name: Check Uniqueness of Aliases + run: "! cat <(printf \"%s\\n\" icons/*.json | while read -r name; do basename \"$name\" .json; done) <(jq -cr 'select(.aliases) | .aliases[] | if type==\"string\" then . else .name end' icons/*.json) | sort | uniq -c | grep -ve '^\\s*1 '" diff --git a/.github/workflows/lucide-angular.yml b/.github/workflows/lucide-angular.yml index 46c9a6e58..2163314de 100644 --- a/.github/workflows/lucide-angular.yml +++ b/.github/workflows/lucide-angular.yml @@ -12,13 +12,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile @@ -29,14 +27,12 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: - version: 8 - - uses: actions/setup-node@v3.8.1 - with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/.github/workflows/lucide-vue.yml b/.github/workflows/lucide-astro.yml similarity index 74% rename from .github/workflows/lucide-vue.yml rename to .github/workflows/lucide-astro.yml index c409956dc..0dc46e62c 100644 --- a/.github/workflows/lucide-vue.yml +++ b/.github/workflows/lucide-astro.yml @@ -1,11 +1,11 @@ -name: Lucide Vue checks +name: Lucide Astro Checks on: pull_request: paths: - - packages/lucide-vue/** + - packages/astro/** + - packages/shared/** - tools/build-icons/** - - tools/rollup-plugins/** - pnpm-lock.yaml jobs: @@ -14,8 +14,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v2 - with: - version: 8 - uses: actions/setup-node@v4 with: node-version: 18 @@ -25,15 +23,13 @@ jobs: run: pnpm install --frozen-lockfile - name: Build - run: pnpm --filter lucide-vue build + run: pnpm --filter @lucide/astro build test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: pnpm/action-setup@v2 - with: - version: 8 - uses: actions/setup-node@v3.8.1 with: node-version: 18 @@ -43,4 +39,4 @@ jobs: run: pnpm install --frozen-lockfile - name: Test - run: pnpm --filter lucide-vue test + run: pnpm --filter @lucide/astro test diff --git a/.github/workflows/lucide-font.yml b/.github/workflows/lucide-font.yml index 5f183f813..2f2ccbf54 100644 --- a/.github/workflows/lucide-font.yml +++ b/.github/workflows/lucide-font.yml @@ -3,7 +3,6 @@ name: Lucide font checks on: pull_request: paths: - - icons/** - tools/build-font/** - pnpm-lock.yaml @@ -12,13 +11,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile @@ -30,7 +27,7 @@ jobs: run: pnpm build:font - name: 'Upload to Artifacts' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: lucide-font path: lucide-font diff --git a/.github/workflows/lucide-preact.yml b/.github/workflows/lucide-preact.yml index c6c598d7a..644163812 100644 --- a/.github/workflows/lucide-preact.yml +++ b/.github/workflows/lucide-preact.yml @@ -4,6 +4,7 @@ on: pull_request: paths: - packages/lucide-preact/** + - packages/shared/** - tools/build-icons/** - tools/rollup-plugins/** - pnpm-lock.yaml @@ -13,13 +14,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/.github/workflows/lucide-react-native.yml b/.github/workflows/lucide-react-native.yml index c68341303..d645e68cf 100644 --- a/.github/workflows/lucide-react-native.yml +++ b/.github/workflows/lucide-react-native.yml @@ -4,22 +4,37 @@ on: pull_request: paths: - packages/lucide-react-native/** + - packages/shared/** - tools/build-icons/** - tools/rollup-plugins/** - pnpm-lock.yaml jobs: - lucide-react-native: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build + run: pnpm --filter lucide-react-native build + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/.github/workflows/lucide-react.yml b/.github/workflows/lucide-react.yml index b5b2b92e2..0154393c0 100644 --- a/.github/workflows/lucide-react.yml +++ b/.github/workflows/lucide-react.yml @@ -4,6 +4,7 @@ on: pull_request: paths: - packages/lucide-react/** + - packages/shared/** - tools/build-icons/** - tools/rollup-plugins/** - scripts/generateNextJSAliases.mjs @@ -14,13 +15,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile @@ -31,14 +30,12 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: - version: 8 - - uses: actions/setup-node@v3.8.1 - with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/.github/workflows/lucide-shared.yml b/.github/workflows/lucide-shared.yml new file mode 100644 index 000000000..13ab83543 --- /dev/null +++ b/.github/workflows/lucide-shared.yml @@ -0,0 +1,24 @@ +name: Lucide Shared Checks + +on: + pull_request: + paths: + - packages/shared/** + - pnpm-lock.yaml + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + cache: 'pnpm' + node-version-file: 'package.json' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Test + run: pnpm --filter lucide-react test diff --git a/.github/workflows/lucide-solid.yml b/.github/workflows/lucide-solid.yml index 6f67075f3..31e0a63f0 100644 --- a/.github/workflows/lucide-solid.yml +++ b/.github/workflows/lucide-solid.yml @@ -4,6 +4,7 @@ on: pull_request: paths: - packages/lucide-solid/** + - packages/shared/** - tools/build-icons/** - tools/rollup-plugins/** - pnpm-lock.yaml @@ -13,13 +14,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile @@ -30,14 +29,12 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: - version: 8 - - uses: actions/setup-node@v3.8.1 - with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/.github/workflows/lucide-static.yml b/.github/workflows/lucide-static.yml index fc0fc4b99..11a6d6dac 100644 --- a/.github/workflows/lucide-static.yml +++ b/.github/workflows/lucide-static.yml @@ -12,13 +12,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/.github/workflows/lucide-svelte-5.yml b/.github/workflows/lucide-svelte-5.yml new file mode 100644 index 000000000..d4ecd1333 --- /dev/null +++ b/.github/workflows/lucide-svelte-5.yml @@ -0,0 +1,43 @@ +name: Lucide Svelte 5 checks + +on: + pull_request: + paths: + - packages/svelte/** + - packages/shared/** + - tools/build-icons/** + - tools/rollup-plugins/** + - pnpm-lock.yaml + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + cache: 'pnpm' + node-version-file: 'package.json' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build + run: pnpm --filter @lucide/svelte build + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + cache: 'pnpm' + node-version-file: 'package.json' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Test + run: pnpm --filter @lucide/svelte test diff --git a/.github/workflows/lucide-svelte.yml b/.github/workflows/lucide-svelte.yml index 4fa768db2..38f6a7b63 100644 --- a/.github/workflows/lucide-svelte.yml +++ b/.github/workflows/lucide-svelte.yml @@ -4,6 +4,7 @@ on: pull_request: paths: - packages/lucide-svelte/** + - packages/shared/** - tools/build-icons/** - tools/rollup-plugins/** - pnpm-lock.yaml @@ -13,13 +14,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile @@ -30,14 +29,12 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: - version: 8 - - uses: actions/setup-node@v3.8.1 - with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/.github/workflows/lucide-vue-next.yml b/.github/workflows/lucide-vue-next.yml index 07310b8e9..a268536d1 100644 --- a/.github/workflows/lucide-vue-next.yml +++ b/.github/workflows/lucide-vue-next.yml @@ -4,6 +4,7 @@ on: pull_request: paths: - packages/lucide-vue-next/** + - packages/shared/** - tools/build-icons/** - tools/rollup-plugins/** - pnpm-lock.yaml @@ -13,13 +14,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile @@ -30,14 +29,12 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: - version: 8 - - uses: actions/setup-node@v3.8.1 - with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/.github/workflows/lucide.yml b/.github/workflows/lucide.yml index 9f8083cdf..6604dcc03 100644 --- a/.github/workflows/lucide.yml +++ b/.github/workflows/lucide.yml @@ -13,13 +13,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile @@ -30,14 +28,12 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: - version: 8 - - uses: actions/setup-node@v3.8.1 - with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/.github/workflows/pull-request-icon-preview.yml b/.github/workflows/pull-request-icon-preview.yml new file mode 100644 index 000000000..d54179f36 --- /dev/null +++ b/.github/workflows/pull-request-icon-preview.yml @@ -0,0 +1,43 @@ +name: Pull request icon preview + +on: + pull_request: + paths: + - 'icons/*.svg' + +jobs: + generate-changed-icons-comment: + name: Generate Changed Icons Comment + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + + steps: + - uses: actions/checkout@v4 + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v46 + with: + files: icons/*.svg + + - uses: actions/setup-node@v4 + - name: Install svgson for code preview (safer and faster than installing all deps) + run: npm install svgson + + - name: Save PR number + run: | + mkdir -p ./pr + echo ${{ github.event.number }} > ./pr/NR + + - name: Generate comment markup + run: node ./scripts/generateChangedIconsCommentMarkup.mjs >> ./pr/comment-markup.md + id: comment-markup + env: + CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} + + - uses: actions/upload-artifact@v4 + with: + name: pr_number + path: pr/ diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml deleted file mode 100644 index a20441278..000000000 --- a/.github/workflows/pull-request.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: Add Changed Icons comment - -on: - pull_request_target: - paths: - - 'icons/*' - branches: - - main - - fix-icon-preview - -jobs: - lint-filenames: - if: github.repository == 'lucide-icons/lucide' - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: refs/pull/${{ github.event.pull_request.number }}/merge - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v41 - with: - files: icons/* - - name: Generate annotations - run: node ./scripts/lintFilenames.mjs - env: - CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} - - lint-contributors: - if: github.repository == 'lucide-icons/lucide' - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: refs/pull/${{ github.event.pull_request.number }}/merge - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v41 - with: - files: icons/* - - uses: actions/setup-node@v4 - - name: Install simple-git (safer and faster than installing all deps) - run: npm install simple-git - - name: Generate annotations - run: node ./scripts/updateContributors.mjs - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - FETCH_DEPTH: ${{ github.event.pull_request.commits }} - CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} - - name: Generate annotations - env: - ANNOTATION_SEVERITY: notice - ANNOTATION_TITLE: Contributors have changed! - ANNOTATION_DESCRIPTION: Don't add people who have only performed automatic optimizations. - run: | - git diff --unified=0 -- icons/*.json | # diff icon metadata (unified=0 gives the correct chunk line number) - perl -ne '/^(\+|- |@)/ && print' | # get chunks (lines that start with "+++", "@@", "+ ", "- ") - perl -pe 's/\n/%0A/' | # url encode line breaks (\n -> %0A) - perl -pe 's/%0A(\+\+\+ b\/)/\n\1/g' | # split chunks(one chunk per line) - perl -pe "s/\+\+\+ b\/([^@]*)%0A@@ -(\d+)[^\s]* \+(\d+)[^@]*@@(.*)/::$ANNOTATION_SEVERITY file=\1,line=\2,endLine=\3,title=$ANNOTATION_TITLE::$ANNOTATION_DESCRIPTION%0A\4/" - # Example for the previous substitution - # input: +++ b/icons/accessibility.json%0A@@ -2,0 +3 @@%0A+ "contributors": ["hi"],%0A@@ -13 +14 @@%0A+}%0A - # output: ::$ANNOTATION_SEVERITY file=icons/accessibility.json,line=2,endLine=3,title=$ANNOTATION_TITLE::$ANNOTATION_DESCRIPTION%0A%0A+ "contributors": ["hi"],%0A@@ -13 +14 @@%0A+}%0A - - lint-aliases: - name: Check Uniqueness of Aliases - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/checkout@v4 - - name: Check Uniqueness of Aliases - run: "! cat <(printf \"%s\\n\" icons/*.json | while read -r name; do basename \"$name\" .json; done) <(jq -cr 'select(.aliases) | .aliases[] | if type==\"string\" then . else .name end' icons/*.json) | sort | uniq -c | grep -ve '^\\s*1 '" - - generate-changed-icons-comment: - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: refs/pull/${{ github.event.pull_request.number }}/merge - - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v41 - with: - files: icons/*.svg - - - name: Find Comment - uses: peter-evans/find-comment@v2 - id: pr-comment - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: Added or changed icons - - - uses: actions/setup-node@v4 - - name: Install svgson for code preview (safer and faster than installing all deps) - run: npm install svgson - - - name: Generate comment markup - run: node ./scripts/generateChangedIconsCommentMarkup.mjs >> comment-markup.md - id: comment-markup - env: - CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} - - - name: Create or update comment - uses: peter-evans/create-or-update-comment@v3 - with: - comment-id: ${{ steps.pr-comment.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body-path: ./comment-markup.md - edit-mode: replace diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bfefa436e..f1594ce73 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,6 +38,8 @@ jobs: if: github.repository == 'lucide-icons/lucide' runs-on: ubuntu-latest needs: pre-release + permissions: + id-token: write strategy: fail-fast: false matrix: @@ -52,16 +54,16 @@ jobs: 'lucide-preact', 'lucide-solid', 'lucide-svelte', + '@lucide/astro', + '@lucide/svelte', ] steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile @@ -79,22 +81,24 @@ jobs: run: pnpm --filter ${{ matrix.package }} test - name: Publish - run: pnpm --filter ${{ matrix.package }} publish --no-git-checks --ignore-scripts + run: pnpm --filter ${{ matrix.package }} publish --access public --no-git-checks --ignore-scripts + env: + NPM_CONFIG_PROVENANCE: true lucide-static: if: github.repository == 'lucide-icons/lucide' runs-on: ubuntu-latest needs: [pre-release, lucide-font] + permissions: + id-token: write steps: - uses: actions/checkout@v4 - - uses: actions/download-artifact@v3 - - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: actions/download-artifact@v4 + - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile @@ -113,6 +117,8 @@ jobs: - name: Publish run: pnpm --filter lucide-static publish --no-git-checks + env: + NPM_CONFIG_PROVENANCE: true lucide-font: if: github.repository == 'lucide-icons/lucide' @@ -120,13 +126,11 @@ jobs: needs: pre-release steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 8 + - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 18 cache: 'pnpm' + node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile @@ -138,7 +142,7 @@ jobs: run: pnpm build:font - name: 'Upload to Artifacts' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: lucide-font path: lucide-font @@ -150,14 +154,14 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 - name: Zip font and icons run: | zip -r lucide-font-${{ needs.pre-release.outputs.VERSION }}.zip lucide-font zip -r lucide-icons-${{ needs.pre-release.outputs.VERSION }}.zip icons - name: Release zip and fonts - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: tag_name: ${{ needs.pre-release.outputs.VERSION }} files: | diff --git a/.github/workflows/request-review.yml b/.github/workflows/request-review.yml new file mode 100644 index 000000000..f35214e38 --- /dev/null +++ b/.github/workflows/request-review.yml @@ -0,0 +1,32 @@ +name: 'Request Review' +on: + pull_request_target: + types: [opened] + paths: icons/*.svg + +jobs: + request-review: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: refs/pull/${{ github.event.pull_request.number }}/merge + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v41 + with: + files: icons/*.svg + - run: | + while IFS= read -r file; do + jq -r '.contributors[]' "${file%.svg}.json" + done <<< "$CHANGED_FILES" | while read -r contributor; do + gh pr edit "${{ github.event.pull_request.number }}" --add-reviewer "$contributor" || true + done + env: + GH_TOKEN: ${{ github.token }} + CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} diff --git a/.gitignore b/.gitignore index a8a38a895..e2098e23e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,11 +16,17 @@ outlined packages/**/src/icons/*.js packages/**/src/icons/*.ts packages/**/src/icons/*.tsx +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 @@ -39,3 +45,5 @@ docs/.vitepress/data/iconDetails docs/.vitepress/data/relatedIcons.json docs/.vercel docs/.nitro +.gitignore + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 35b3a382d..286341283 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,10 +16,10 @@ Guidelines for pull requests: - __Make your commit messages as descriptive as possible.__ Include as much information as you can. Explain anything that the file diffs themselves won’t make apparent. - __Document your pull request__. Explain your fix, link to the relevant issue, add screenshots when adding new icons. -- __Make sure the target of your pull request is the relevant branch__. Most of bugfix or new feature should go to the `main` branch. -- __Include only related work__. If your pull request has unrelated commit, it won't be accepted. +- __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. -### Pull Requests Including Icons +### Icon Pull Requests #### Guidelines @@ -27,26 +27,30 @@ Please make sure you follow the icon guidelines, that should be followed to keep Read it here: [ICON_GUIDELINES](https://lucide.dev/docs/icon-design-guide). -### Editor guides +#### Lucide Studio + +For formatting and adjusting SVG icons, [@jguddas](https://github.com/jguddas) made a great tool called [Lucide Studio](https://studio.lucide.dev/). It is a web-based SVG editor that allows you to edit and adjust icons in the Lucide style. You can use it to create new icons or modify existing ones. + +#### Editor guides 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/docs/illustrator-guide) You can also [download an Adobe Illustrator template](https://github.com/lucide-icons/lucide/blob/main/docs/public/templates/illustrator_template.ai). -#### [Inkscape Guide](https://lucide.dev/docs/inkscape-guide) +##### [Inkscape Guide](https://lucide.dev/docs/inkscape-guide) -#### [Figma Guide](https://lucide.dev/docs/figma-guide) +##### [Figma Guide](https://lucide.dev/docs/figma-guide) -#### [Affinity Designer Guide](https://lucide.dev/guide/design/affinity-designer-guide) +##### [Affinity Designer Guide](https://lucide.dev/guide/design/affinity-designer-guide) -### Submitting Multiple Icons +#### Submitting Multiple Icons -If you want submit multiple icons, please separate the icons and group them. That makes reviewing the icons easier and keep the thread clean and scoped. -So don't submit multiple icons in one PR that have noting to do with each other. +If you want to submit multiple icons, please separate the icons and group them. That makes reviewing the icons easier and keeps the thread clean and scoped. +So don't submit multiple icons in one PR that have nothing to do with each other. So for example don't create one PR with icons: `arrow-up`, `bicycle`, `arrow-down`. -Seperate them by two PRs; 'pr-01' `arrow`, `arrow-down` and 'pr-02' `bicycle`. +Separate them into two PRs; 'pr-01' `arrow`, `arrow-down` and 'pr-02' `bicycle`. ## Icon Requests @@ -72,12 +76,12 @@ pnpm install # Install dependencies, including the workspace packages ### Packages -> PNPM Workspaces -To distribute different packages we use PNPM workspaces. Before you start make sure you are familiar with this concept. The concept of working in workspaces is created by Yarn, they have a well written introduction: [yarn workspaces](https://classic.yarnpkg.com/lang/enhttps://lucide.dev/docs/workspaces). +To distribute different packages we use [PNPM workspaces](https://pnpm.io/workspaces). Before you start make sure you are familiar with this concept. The concept of working in workspaces is created by Yarn, they have a well written introduction: [yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces). The configured directory for workspaces is the [packages](https://github.com/lucide-icons/lucide/tree/main/packages) directory, located in the root directory. There you will find all the current packages from lucide. There are more workspaces defined, see [`pnpm-workspace.yaml`](https://github.com/lucide-icons/lucide/blob/main/pnpm-workspace.yaml). -> Note: One package is not managed by pnpm: **lucide-flutter**, this package is written in Dart and used pub for publishing. +> Note: One package is not managed by pnpm: **lucide-flutter**, this package is written in Dart and uses pub for publishing. ### Generated Code @@ -127,7 +131,7 @@ When adding new features to for example the icon component for a framework. It i ### Local Testing -To test changes in a local project, you can use `yarn link`, `npm link` or `pnpm link` to link the package. Before you do this make sure you builded the package first. +To test changes in a local project, you can use `yarn link`, `npm link`, `bun link` or `pnpm link` to link the package. Before you do this make sure you've built the package first. ```sh # in packages/lucide-react @@ -165,15 +169,15 @@ Detailed documentation about: installation, guides, packages, design guides etc. 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 +### Packages Includes all the (npm) packages of lucide. -> Note: One package is not managed by pnpm: **lucide-flutter**, this package is written in Dart and used pub for publishing. +> Note: One package is not managed by pnpm: **lucide-flutter**, this package is written in Dart and uses pub for publishing. -### scripts +### Scripts -Includes usefully scripts to automate certain jobs. Big part of the scripts is the template generation, for example it generates icon components for all the packages. These scripts are usually executed from the "scripts" section in the package.json. +Includes useful scripts to automate certain jobs. Big part of the scripts is the template generation, for example it generates icon components for all the packages. These scripts are usually executed from the "scripts" section in the package.json. ## Documentation @@ -190,4 +194,4 @@ If you need any help or have problems with you contribution. Please don't hesita Thank you to all the people who already contributed to Lucide! - + diff --git a/README.md b/README.md index 6076562c3..569f512fa 100644 --- a/README.md +++ b/README.md @@ -8,185 +8,40 @@

license - npm package - figma installs + figma installs build status discord chat

+

+ Icons + · + Guide + · + Packages + · + License + · + Showcase +

# Lucide -Community-run fork of [Feather Icons](https://github.com/feathericons/feather), open for anyone to contribute icons. +Lucide is an open-source icon library that provides 1000+ vector (svg) files for displaying icons and symbols in digital and non-digital projects. The library aims to make it easier for designers and developers to incorporate icons into their projects by providing several official [packages](https://lucide.dev/packages) to make it easier to use these icons in your project. -It began after growing dissatisfaction with the [Feather Icons](https://github.com/feathericons/feather) project moderation. With over 300+ open issues and over 100+ open PRs, the Feather Icons project has been abandoned. This unfortunately means that hundreds of developers and designers wasted their time contributing to Feather Icons with no chance of PRs being accepted. +## Packages -Lucide is trying to expand the icon set as much as possible while staying faithful to the original simplistic design language. We do this as a community of devs and designers and hope that you'll join us! - -### Why choose Lucide over Feather Icons - -- More icons to work with: Lucide already has hundreds of icons more than Feather does. -- Official libraries and integrations with popular frameworks and design tools. -- Well maintained code base. -- Active community, regularly growing and improving the set. - -## Table of Contents - -- [Usage](#usage) - - [Web](#web) - - [React](#react) - - [React Native](#react-native) - - [Vue 2](#vue-2) - - [Vue 3](#vue-3) - - [Angular](#angular) - - [Preact](#preact) - - [Static (svg sprite, font, icons ..)](#static-svg-sprite-font-icons-) - - [Figma](#figma) - - [Laravel](#laravel) - - [Svelte](#svelte) - - [Solid](#solid) - - [Hyva](#hyva) - - [Eleventy](#eleventy) -- [Contributing](#contributing) -- [Community](#community) -- [License](#license) -- [Credits](#credits) -- [Sponsors](#sponsors) - -## Usage - -At its core, Lucide is a collection of [SVG](https://svgontheweb.com/#svg) files. This means that you can use Lucide icons in all the same ways you can use SVGs (e.g. `img`, `background-image`, `inline`, `object`, `embed`, `iframe`). Here's a helpful article detailing the many ways SVGs can be used on the web: [SVG on the Web – Implementation Options](https://svgontheweb.com/#implementation) - -The following are additional ways you can use Lucide. -With the Javascript library you can easily incorporate the icon you want in your webpage. - -### Web - -Implementation of the lucide icon library for web applications. - -```sh -npm install lucide -``` - -or - -```sh -yarn add lucide -``` - -For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/main/packages/lucide#lucide). - -### React - -Implementation of the lucide icon library for react applications. - -```sh -yarn add lucide-react -``` - -or - -```sh -npm install lucide-react -``` - -For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/main/packages/lucide-react#lucide-react). - -### React Native - -Implementation of the lucide icon library for React Native applications. - -```sh -yarn add lucide-react-native -``` - -or - -```sh -npm install lucide-react-native -``` - -For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/main/packages/lucide-react-native#lucide-react-native). - -### Vue 2 - -Implementation of the lucide icon library for vue applications. - -```sh -yarn add lucide-vue -``` - -or - -```sh -npm install lucide-vue -``` - -For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/main/packages/lucide-vue#lucide-vue). - -### Vue 3 - -Implementation of the lucide icon library for vue applications. - -```sh -yarn add lucide-vue-next -``` - -or - -```sh -npm install lucide-vue-next -``` - -For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/main/packages/lucide-vue-next#lucide-vue-next). - -### Angular - -```sh -yarn add lucide-angular -``` - -or - -```sh -npm install lucide-angular -``` - -For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/main/packages/lucide-angular#lucide-angular). - -### Preact - -Implementation of the lucide icon library for preact applications. - -```sh -yarn add lucide-preact -``` - -or - -```sh -npm install lucide-preact -``` - -For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/main/packages/lucide-preact#lucide-preact). - -### Static (svg sprite, font, icons ..) - -Assets: -[Font Files](https://github.com/lucide-icons/lucide/releases/latest) -[SVG Files](https://github.com/lucide-icons/lucide/releases/latest) -[SVG Sprite](https://cdn.jsdelivr.net/npm/lucide-static@latest/sprite.svg) - -NPM package - -```sh -yarn add lucide-static -``` - -or - -```sh -npm install lucide-static -``` +| Logo | Package | Version | Downloads | Links | +| ---- | ------- | ------- | --------- | ----- | +| JS logo | **`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) | +| React logo | **`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) | +| Vue logo | **`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) | +| Svelte logo | **`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) | +| Solid logo | **`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) | +| Preact logo | **`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) | +| React Native logo | **`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) | +| Angular logo | **`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) | +| Astro logo | **`@lucide/astro`** | [![npm](https://img.shields.io/npm/v/@lucide/astro)](https://www.npmjs.com/package/@lucide/astro) | ![NPM Downloads](https://img.shields.io/npm/dw/@lucide/astro) | [Docs](https://lucide.dev/guide/packages/lucide-astro) · [Source](./packages/astro) | +| SVG logo | **`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 @@ -196,68 +51,6 @@ Visit [Figma community page](https://www.figma.com/community/plugin/939567362549 Figma Lucide Cover -### Laravel - -Implementation of Lucide icon's using `blade-icons` for Laravel based projects. - -```sh -composer require mallardduck/blade-lucide-icons -``` - -For more details, see the [documentation](https://github.com/mallardduck/blade-lucide-icons/blob/main/README.md). - -### Svelte - -Implementation of the lucide icon library for Svelte applications. - -```sh -yarn add lucide-svelte -``` - -or - -```sh -npm install lucide-svelte -``` - -For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/main/packages/lucide-svelte#lucide-svelte). - -### Solid - -Implementation of the lucide icon library for solid applications. - -```sh -yarn add lucide-solid -``` - -or - -```sh -npm install lucide-solid -``` - -For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/main/packages/lucide-solid#lucide-solid). - -### Hyva - -Implementation of Lucide icon's using Hyvä's svg php viewmodal to render icons for Magento 2 Hyva theme based projects. - -```sh -composer require siteation/magento2-hyva-icons-lucide -``` - -For more details, see the [documentation](https://github.com/Siteation/magento2-hyva-icons-lucide/blob/main/README.md). - -### Eleventy - -Using this plugin, Eleventy projects can incorporate Lucide icons. it makes it simple to use Lucide icons into your themes via shortcodes, improving your website's overall usability and visual appeal. - -```sh -npm install @grimlink/eleventy-plugin-lucide-icons -``` - -For more details, see the [documentation](https://github.com/GrimLink/eleventy-plugin-lucide-icons/blob/main/README.md). - ## Contributing For more info on how to contribute please see the [contribution guidelines](https://github.com/lucide-icons/lucide/blob/main/CONTRIBUTING.md). @@ -270,14 +63,16 @@ Join the community on our [Discord](https://discord.gg/EH6nSts) server! ## License -Lucide is totally free for commercial use and personally use, this software is licensed under the [ISC License](https://github.com/lucide-icons/lucide/blob/main/LICENSE). +Lucide is totally free for commercial use and personal use, this software is licensed under the [ISC License](https://github.com/lucide-icons/lucide/blob/main/LICENSE). ## Credits Thank you to all the people who contributed to Lucide! - + + + ## Sponsors @@ -287,6 +82,7 @@ Thank you to all the people who contributed to Lucide! DigitalOcean Referral Badge -### Awesome backer 🍺 +### Awesome backers 🍺 Scipress sponsor badge +pdfme sponsor badge diff --git a/categories/charts.json b/categories/charts.json index 22beb849e..e9bdc1882 100644 --- a/categories/charts.json +++ b/categories/charts.json @@ -1,5 +1,5 @@ { "$schema": "../category.schema.json", "title": "Charts", - "icon": "pie-chart" + "icon": "chart-pie" } diff --git a/categories/currency.json b/categories/currency.json deleted file mode 100644 index 0879774d1..000000000 --- a/categories/currency.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "../category.schema.json", - "title": "Currency", - "icon": "dollar-sign" -} diff --git a/categories/money.json b/categories/finance.json similarity index 75% rename from categories/money.json rename to categories/finance.json index fd706dee5..267643671 100644 --- a/categories/money.json +++ b/categories/finance.json @@ -1,5 +1,5 @@ { "$schema": "../category.schema.json", - "title": "Money", + "title": "Finance", "icon": "piggy-bank" } diff --git a/categories/furniture.json b/categories/furniture.json deleted file mode 100644 index 56cf3fa30..000000000 --- a/categories/furniture.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "../category.schema.json", - "title": "Furniture", - "icon": "rocking-chair" -} diff --git a/categories/maps.json b/categories/maps.json deleted file mode 100644 index 1a948f119..000000000 --- a/categories/maps.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "../category.schema.json", - "title": "Maps", - "icon": "map" -} diff --git a/categories/maths.json b/categories/math.json similarity index 70% rename from categories/maths.json rename to categories/math.json index f80691908..1ae72ad9e 100644 --- a/categories/maths.json +++ b/categories/math.json @@ -1,5 +1,5 @@ { "$schema": "../category.schema.json", - "title": "Maths", + "title": "Mathematics", "icon": "divide" } diff --git a/categories/notifications.json b/categories/notifications.json index 8ef569fd0..c2a729bec 100644 --- a/categories/notifications.json +++ b/categories/notifications.json @@ -1,5 +1,5 @@ { "$schema": "../category.schema.json", - "title": "Notifications", + "title": "Notification", "icon": "triangle-alert" } diff --git a/comment-markup.md b/comment-markup.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/.vitepress/api/gh-icon/[...data].get.ts b/docs/.vitepress/api/gh-icon/[...data].get.ts index 346901712..def248303 100644 --- a/docs/.vitepress/api/gh-icon/[...data].get.ts +++ b/docs/.vitepress/api/gh-icon/[...data].get.ts @@ -28,7 +28,7 @@ export default eventHandler((event) => { .map((_, idx, arr) => arr.slice(0, idx + 1).join('-')) .reverse() .find((groupName) => groupName in iconNodes); - if (backdropName) { + if (!(name in iconNodes) && backdropName) { const iconNode = iconNodes[backdropName]; const LucideIcon = createLucideIcon(backdropName, iconNode); @@ -39,18 +39,9 @@ export default eventHandler((event) => { createElement(Backdrop, { backdropString, src, - color: name in iconNodes ? 'red' : '#777', + color: '#777', }), ); - if (name in iconNodes) { - children.push( - createElement(Backdrop, { - backdropString: src, - src: backdropString, - color: 'lime', - }), - ); - } } const svg = Buffer.from( diff --git a/docs/.vitepress/api/gh-icon/diff/[...data].get.ts b/docs/.vitepress/api/gh-icon/diff/[...data].get.ts new file mode 100644 index 000000000..b1b0f09c6 --- /dev/null +++ b/docs/.vitepress/api/gh-icon/diff/[...data].get.ts @@ -0,0 +1,37 @@ +import { eventHandler, setResponseHeader, defaultContentType } from 'h3'; +import { renderToString, renderToStaticMarkup } from 'react-dom/server'; +import { createElement } from 'react'; +import Diff from '../../../lib/SvgPreview/Diff.tsx'; +import iconNodes from '../../../data/iconNodes'; +import createLucideIcon from 'lucide-react/src/createLucideIcon'; + +export default eventHandler((event) => { + const { params } = event.context; + + const pathData = params.data.split('/'); + const data = pathData.at(-1).slice(0, -4); + const [name] = pathData; + + const newSrc = Buffer.from(data, 'base64') + .toString('utf8') + .replaceAll('\n', '') + .replace(/]*>|<\/svg>/g, ''); + + const children = []; + + const oldSrc = iconNodes[name] + ? renderToStaticMarkup(createElement(createLucideIcon(name, iconNodes[name]))) + .replaceAll('\n', '') + .replace(/]*>|<\/svg>/g, '') + : ''; + + const svg = Buffer.from( + // We can't use jsx here, is not supported here by nitro. + renderToString(createElement(Diff, { oldSrc, newSrc, showGrid: true }, children)), + ).toString('utf8'); + + defaultContentType(event, 'image/svg+xml'); + setResponseHeader(event, 'Cache-Control', 'public,max-age=31536000'); + + return svg; +}); diff --git a/docs/.vitepress/data/categoriesData.json b/docs/.vitepress/data/categoriesData.json index 03712cc23..8d6c3b1ab 100644 --- a/docs/.vitepress/data/categoriesData.json +++ b/docs/.vitepress/data/categoriesData.json @@ -35,10 +35,6 @@ "name": "connectivity", "title": "Connectivity" }, - { - "name": "currency", - "title": "Currency" - }, { "name": "cursors", "title": "Cursors" @@ -64,12 +60,12 @@ "title": "File icons" }, { - "name": "food-beverage", - "title": "Food & beverage" + "name": "finance", + "title": "Finance" }, { - "name": "furniture", - "title": "Furniture" + "name": "food-beverage", + "title": "Food & beverage" }, { "name": "gaming", @@ -88,21 +84,13 @@ "title": "Mail" }, { - "name": "maps", - "title": "Maps" - }, - { - "name": "maths", - "title": "Maths" + "name": "math", + "title": "Mathematics" }, { "name": "medical", "title": "Medical" }, - { - "name": "money", - "title": "Money" - }, { "name": "multimedia", "title": "Multimedia" @@ -117,7 +105,7 @@ }, { "name": "notifications", - "title": "Notifications" + "title": "Notification" }, { "name": "people", diff --git a/docs/.vitepress/data/componentLibrariesData.json b/docs/.vitepress/data/componentLibrariesData.json index c0534b9aa..bac1d2ad1 100644 --- a/docs/.vitepress/data/componentLibrariesData.json +++ b/docs/.vitepress/data/componentLibrariesData.json @@ -14,5 +14,13 @@ "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" + } } ] diff --git a/docs/.vitepress/data/packageData.json b/docs/.vitepress/data/packageData.json index 613ed60e7..6ad333133 100644 --- a/docs/.vitepress/data/packageData.json +++ b/docs/.vitepress/data/packageData.json @@ -31,24 +31,8 @@ } ] }, - "lucide-vue": { - "order": 2, - "icon": "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-vue-next": { - "order": 3, + "order": 2, "icon": "vue-next", "shields": [ { @@ -64,7 +48,7 @@ ] }, "lucide-svelte": { - "order": 4, + "order": 3, "icon": "svelte", "shields": [ { @@ -95,24 +79,8 @@ } ] }, - "lucide-preact": { - "order": 5, - "icon": "preact", - "shields": [ - { - "alt": "npm", - "src": "https://img.shields.io/npm/v/lucide-preact", - "href": "https://www.npmjs.com/package/lucide-preact" - }, - { - "alt": "npm", - "src": "https://img.shields.io/npm/dw/lucide-preact", - "href": "https://www.npmjs.com/package/lucide-preact" - } - ] - }, "lucide-react-native": { - "order": 6, + "order": 5, "icon": "react-native", "shields": [ { @@ -128,7 +96,7 @@ ] }, "lucide-angular": { - "order": 7, + "order": 6, "icon": "angular", "shields": [ { @@ -143,8 +111,43 @@ } ] }, - "lucide-static": { + "lucide-preact": { + "order": 7, + "icon": "preact", + "shields": [ + { + "alt": "npm", + "src": "https://img.shields.io/npm/v/lucide-preact", + "href": "https://www.npmjs.com/package/lucide-preact" + }, + { + "alt": "npm", + "src": "https://img.shields.io/npm/dw/lucide-preact", + "href": "https://www.npmjs.com/package/lucide-preact" + } + ] + }, + "@lucide/astro": { + "docsAlias": "lucide-astro", + "packageDirname": "astro", "order": 8, + "icon": "astro", + "iconDark": "astro-dark", + "shields": [ + { + "alt": "npm", + "src": "https://img.shields.io/npm/v/@lucide/astro", + "href": "https://www.npmjs.com/package/@lucide/astro" + }, + { + "alt": "npm", + "src": "https://img.shields.io/npm/dw/@lucide/astro", + "href": "https://www.npmjs.com/package/@lucide/astro" + } + ] + }, + "lucide-static": { + "order": 9, "icon": "svg", "shields": [ { diff --git a/docs/.vitepress/data/packageData.thirdParty.json b/docs/.vitepress/data/packageData.thirdParty.json index ba35181a5..dd9650730 100644 --- a/docs/.vitepress/data/packageData.thirdParty.json +++ b/docs/.vitepress/data/packageData.thirdParty.json @@ -76,5 +76,24 @@ ], "source": "https://github.com/swisnl/nuxt-lucide-icons", "documentation": "https://github.com/swisnl/nuxt-lucide-icons/blob/main/README.md" + }, + { + "name": "lucide-lustre", + "description": "A library providing https://lucide.dev icons to lustre.", + "icon": "/framework-logos/lustre.webp", + "shields": [ + { + "alt": "Latest Stable Version", + "src": "https://img.shields.io/hexpm/v/lucide_lustre", + "href": "https://hex.pm/packages/lucide_lustre" + }, + { + "alt": "Total Downloads", + "src": "https://img.shields.io/hexpm/dw/lucide_lustre", + "href": "https://hex.pm/packages/lucide_lustre" + } + ], + "source": "https://github.com/dinkelspiel/lucide_lustre", + "documentation": "https://github.com/dinkelspiel/lucide_lustre/blob/master/README.md" } ] diff --git a/docs/.vitepress/data/teamData.json b/docs/.vitepress/data/teamData.json index 3e5504aee..4f46f57f1 100644 --- a/docs/.vitepress/data/teamData.json +++ b/docs/.vitepress/data/teamData.json @@ -11,7 +11,7 @@ }, { "icon": "x", - "link": "https://github.com/ericfennis" + "link": "https://x.com/ericfennis" } ] }, diff --git a/docs/.vitepress/lib/SvgPreview/Backdrop.tsx b/docs/.vitepress/lib/SvgPreview/Backdrop.tsx index 088dcf7e9..2999f0acf 100644 --- a/docs/.vitepress/lib/SvgPreview/Backdrop.tsx +++ b/docs/.vitepress/lib/SvgPreview/Backdrop.tsx @@ -3,10 +3,16 @@ import React from 'react'; interface BackdropProps { src: string; color?: string; + outline?: boolean; backdropString: string; } -const Backdrop = ({ src, color = 'red', backdropString }: BackdropProps): JSX.Element => { +const Backdrop = ({ + src, + color = 'red', + outline = true, + backdropString, +}: BackdropProps): JSX.Element => { const id = React.useId(); return ( <> @@ -73,13 +79,15 @@ const Backdrop = ({ src, color = 'red', backdropString }: BackdropProps): JSX.El opacity={0.75} dangerouslySetInnerHTML={{ __html: src }} /> - + {outline && ( + + )} ); diff --git a/docs/.vitepress/lib/SvgPreview/Diff.tsx b/docs/.vitepress/lib/SvgPreview/Diff.tsx new file mode 100644 index 000000000..3fa6840a5 --- /dev/null +++ b/docs/.vitepress/lib/SvgPreview/Diff.tsx @@ -0,0 +1,71 @@ +import React from 'react'; +import Backdrop from './Backdrop.tsx'; +import { darkModeCss, Grid } from './index.tsx'; + +const SvgPreview = React.forwardRef< + SVGSVGElement, + { + oldSrc: string; + newSrc: string; + } & React.SVGProps +>(({ oldSrc, newSrc, children, ...props }, ref) => { + return ( + + + + + + + + ${newSrc}`} + color="#777" + /> + + + {children} + + ); +}); + +export default SvgPreview; diff --git a/docs/.vitepress/lib/SvgPreview/index.tsx b/docs/.vitepress/lib/SvgPreview/index.tsx index 5d6b5d386..562020a8e 100644 --- a/docs/.vitepress/lib/SvgPreview/index.tsx +++ b/docs/.vitepress/lib/SvgPreview/index.tsx @@ -2,7 +2,23 @@ import React from 'react'; import { PathProps, Path } from './types'; import { getPaths, assert } from './utils'; -const Grid = ({ +export const darkModeCss = ` + @media screen and (prefers-color-scheme: light) { + .svg-preview-grid-rect { fill: none } + } + @media screen and (prefers-color-scheme: dark) { + .svg-preview-grid-rect { fill: none } + .svg + .svg-preview-grid-group, + .svg-preview-radii-group, + .svg-preview-shadow-mask-group, + .svg-preview-shadow-group { + stroke: #fff; + } + } +`; + +export const Grid = ({ radius, fill = '#fff', ...props @@ -339,19 +355,6 @@ const SvgPreview = React.forwardRef< >(({ src, children, showGrid = false, ...props }, ref) => { const paths = typeof src === 'string' ? getPaths(src) : src; - const darkModeCss = `@media screen and (prefers-color-scheme: light) { - .svg-preview-grid-rect { fill: none } -} -@media screen and (prefers-color-scheme: dark) { - .svg-preview-grid-rect { fill: none } - .svg - .svg-preview-grid-group, - .svg-preview-radii-group, - .svg-preview-shadow-mask-group, - .svg-preview-shadow-group { - stroke: #fff; - } -}`; return ( `, }, @@ -61,7 +61,7 @@ import { Icon } from 'lucide-svelte'; import { $CamelCase } from '@lucide/lab'; - + `, }, { diff --git a/docs/.vitepress/sidebar.ts b/docs/.vitepress/sidebar.ts index 59f337bc0..78aa3feef 100644 --- a/docs/.vitepress/sidebar.ts +++ b/docs/.vitepress/sidebar.ts @@ -46,6 +46,10 @@ const sidebar: UserConfig['themeConfig']['sidebar'] = { text: 'Filled icons', link: '/guide/advanced/filled-icons', }, + { + text: 'Aliased Names', + link: '/guide/advanced/aliased-names', + }, // { // text: 'Combining icons', // }, @@ -68,10 +72,6 @@ const sidebar: UserConfig['themeConfig']['sidebar'] = { text: 'Lucide React', link: '/guide/packages/lucide-react', }, - { - text: 'Lucide React Native', - link: '/guide/packages/lucide-react-native', - }, { text: 'Lucide Vue', link: '/guide/packages/lucide-vue-next', @@ -85,13 +85,21 @@ const sidebar: UserConfig['themeConfig']['sidebar'] = { link: '/guide/packages/lucide-solid', }, { - text: 'Lucide Preact', - link: '/guide/packages/lucide-preact', + text: 'Lucide React Native', + link: '/guide/packages/lucide-react-native', }, { text: 'Lucide Angular', link: '/guide/packages/lucide-angular', }, + { + text: 'Lucide Preact', + link: '/guide/packages/lucide-preact', + }, + { + text: 'Lucide Astro', + link: '/guide/packages/lucide-astro', + }, { text: 'Lucide Static', link: '/guide/packages/lucide-static', diff --git a/docs/.vitepress/theme/components/base/InputSearch.vue b/docs/.vitepress/theme/components/base/InputSearch.vue index 534210ed7..8606da211 100644 --- a/docs/.vitepress/theme/components/base/InputSearch.vue +++ b/docs/.vitepress/theme/components/base/InputSearch.vue @@ -38,6 +38,7 @@ const value = computed({ @@ -35,6 +42,13 @@ const { go } = useRouter() diff --git a/docs/.vitepress/theme/components/home/TeamMemberCard.vue b/docs/.vitepress/theme/components/home/TeamMemberCard.vue index 44adef886..59c900b61 100644 --- a/docs/.vitepress/theme/components/home/TeamMemberCard.vue +++ b/docs/.vitepress/theme/components/home/TeamMemberCard.vue @@ -75,6 +75,7 @@ defineProps() font-weight: 500; color: var(--vp-c-text-2); text-align: center; + text-wrap: balance; margin-bottom: 16px;; } diff --git a/docs/.vitepress/theme/components/icons/CarbonAdOverlay.vue b/docs/.vitepress/theme/components/icons/CarbonAdOverlay.vue index 548e15b20..f917a9326 100644 --- a/docs/.vitepress/theme/components/icons/CarbonAdOverlay.vue +++ b/docs/.vitepress/theme/components/icons/CarbonAdOverlay.vue @@ -5,22 +5,32 @@ 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 showAd = useSessionStorage('show-carbon-ads', true) +const carbonLoaded = ref(true) defineProps<{ drawerOpen: boolean }>() const CloseIcon = createLucideIcon('Close', x) + +onMounted(() => { + setTimeout(() => { + if (window?._carbonads == null) { + carbonLoaded.value = false + } + }, 5000) +}) diff --git a/docs/.vitepress/theme/components/icons/IconInfo.vue b/docs/.vitepress/theme/components/icons/IconInfo.vue index 6abd902a6..3ee04d762 100644 --- a/docs/.vitepress/theme/components/icons/IconInfo.vue +++ b/docs/.vitepress/theme/components/icons/IconInfo.vue @@ -9,6 +9,8 @@ import {useData, useRouter} from 'vitepress'; import { computed } from 'vue'; import createLucideIcon from 'lucide-vue-next/src/createLucideIcon'; import { diamond } from '../../../data/iconNodes' +import deprecationReasonTemplate from '../../../../../tools/build-icons/utils/deprecationReasonTemplate.mjs'; + const props = defineProps<{ icon: IconEntity @@ -24,6 +26,15 @@ const tags = computed(() => { }) const DiamondIcon = createLucideIcon('Diamond', diamond) + +const deprecatedTitle = computed(() => { + if (!props.icon.deprecationReason) return ''; + return deprecationReasonTemplate(props.icon.deprecationReason, { + componentName: props.icon.name, + iconName: props.icon.name, + toBeRemovedInVersion: props.icon.toBeRemovedInVersion, + }); +});