Compare commits

...
72 Commits
Author SHA1 Message Date
ionitron 3dab196131 8.0.7 2025-05-06 18:17:46 +00:00
Brandy SmithandBrandy Smith 7f73379a7c docs(changelog): correct links and add two recent releases (#1451)
Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>
2025-05-06 07:59:07 -07:00
ionitron abda804f39 8.0.6 2025-05-05 22:56:10 +00:00
Christian Bromann b9858daaab fix(ci): uncomment ci pipeline 2025-05-05 15:55:32 -07:00
ionitron 0807bbe045 8.0.5 2025-05-05 22:52:55 +00:00
Christian Bromann 0269306a15 fix(ci): remove auth step 2025-05-05 15:52:04 -07:00
Christian Bromann be3fcd7a70 fix(ci): fix auth command 2025-05-05 15:50:01 -07:00
Christian Bromann 4921d70e32 fix(ci): fix auth command 2025-05-05 15:48:06 -07:00
Christian Bromann bef34677cd fix(ci): fix propagating version 2025-05-05 15:44:13 -07:00
Christian Bromann 2e393282c9 fix(ci): fix git set up 2025-05-05 15:42:38 -07:00
Christian Bromann ecfff506b9 fix(ci): retrieve new version from package.json 2025-05-05 15:32:25 -07:00
Christian Bromann 87161a14a5 fix(ci): dry run it 2025-05-05 15:24:20 -07:00
Christian Bromann b1893f4ef6 fix(ci): test a different token 2025-05-05 15:22:11 -07:00
Christian Bromann fa5244e544 8.0.4 2025-05-05 15:18:31 -07:00
Christian Bromann d0e18dab3e fix(ci): tweak release pipeline 2025-05-05 15:18:26 -07:00
Christian Bromann e4d8d28253 8.0.3 2025-05-05 15:13:58 -07:00
Christian Bromann 77e5de20c8 fix(ci): set token before push 2025-05-05 15:13:45 -07:00
Christian Bromann 17ea00ef3c 8.0.2 2025-05-05 15:06:01 -07:00
Christian Bromann 04975203b7 8.0.1 2025-05-05 14:56:52 -07:00
Christian Bromann 2ad4148057 fix(ci): set proper token 2025-05-05 14:56:22 -07:00
Christian Bromann 5b23d0a963 fix(ci): set up git before calling npm version 2025-05-05 14:53:56 -07:00
Christian Bromann 987d118b0b ci: update pipelines 2025-05-05 14:52:10 -07:00
Christian Bromann a380c95899 docs: missing ; in readme 2025-05-05 12:20:36 -07:00
Christian Bromann fe60bd2490 docs: clarify usage of addIcons 2025-05-05 12:19:42 -07:00
Christian Bromann ba27560096 fix: exports 2025-05-05 12:15:51 -07:00
Christian Bromann dcca52d3b2 v8.0.0 2025-05-02 08:26:41 -07:00
e04eccc868 breaking: modernize project (#1447)
* chore: update project dependencies

* remove lerna

* update build

* plugin fixes

* Icons do not display when the svg is loaded from a file:// URL in Safari

fixes #1298

* Update path fill in warning-outline.svg exclamation mark

* set currentColor - fixes #1420

* add bell tag to notifications icon - fixes #1090

* add sliders and filters tags to option icon - fixes #1060

* add loveseat tag to bed icon - closes #503

* add contacts tag to people-circle
closes #779

* fix data.json

* update data.json

* set up prettier

* fix contributing link

* prettier after rebase

* add missing rimraf

* add more comments

* run prettier as part of the build

* set module resolution to bundle

* consolidate contributing guidelines and coc as part of the root directory

* fix link

* copy svg into www

* cut me some visual slack

* Update readme.md

Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>

* Update package.json

Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>

* Update CONTRIBUTING.md

Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>

* remove generating collections

* ensure all directories exist

* only define snapshot tolerance in config

* update dependencies

* Update src/components/icon/request.ts

Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>

* Update src/components/icon/request.ts

Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>

* Update src/components/icon/request.ts

Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>

* Update src/components/icon/request.ts

Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>

* prettier

* update release pipeline

* fix exports

* recommend to use esm.sh as cdn

---------

Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>
2025-05-02 08:04:17 -07:00
Kerk en IT 5266d14dac Resolve #1242 (#1393) 2025-04-16 16:15:09 -07:00
jcesarmobile 4477c02512 chore(ci): update actions to v4 (#1415) 2024-11-19 11:39:07 +01:00
Liam DeBeasi d55d438ef0 chore: merge feature-7.4 2024-05-01 15:19:36 -04:00
Liam DeBeasi 70135edf3a chore: sync 2024-05-01 15:16:30 -04:00
Liam DeBeasi 2ac03a16d4 chore: sync with main 2024-05-01 15:15:44 -04:00
Liam DeBeasi 31c83d9d12 merge release-7.4.0
Release 7.4.0
2024-05-01 15:14:21 -04:00
ionitron 0c34dde9e8 chore(): update package lock files 2024-05-01 19:11:34 +00:00
ionitron f1794e755a v7.4.0 2024-05-01 19:10:54 +00:00
Christian Bromann 87f2094890 feat: export setAssetPath (#1372)
resolves #1302
2024-05-01 14:57:37 -04:00
Liam DeBeasi 0963fe20b7 feat: add X logo (#1371)
resolves #1249
2024-05-01 14:41:10 -04:00
Liam DeBeasi 19fbe0bde7 refactor(icon): remove addition style (#1359)
The `stroke-width: 32px` line never applies because of the following line where we apply the CSS Variable. All versions of browsers that Ionicons supports also support CSS Variables, so the `stroke-width: 32px` line isn't needed anymore.
2024-05-01 18:30:04 +00:00
Christian Bromann 06a995eebb docs: add a section on custom svg paths (#1368) 2024-05-01 14:09:49 -04:00
Liam DeBeasi 71938d06a2 test: use optimized assets (#1354) 2024-03-29 11:24:24 -04:00
Liam DeBeasi e81ddbdb4b merge release-7.3.1
Release 7.3.1
2024-03-27 09:40:09 -04:00
Liam DeBeasi 89356a9824 chore: clean up changelog 2024-03-27 09:35:43 -04:00
ionitron d3759f9ee1 chore(): update package lock files 2024-03-27 13:35:00 +00:00
ionitron 8b041ece8f v7.3.1 2024-03-27 13:34:21 +00:00
Liam DeBeasi 63e60ec44c fix: filled ellipsis circle icons renders correctly (#1353)
resolves #1320
2024-03-22 16:54:35 -04:00
Liam DeBeasi 4350c67e44 chore(ionitron): add auto response for community feedback (#1352) 2024-03-22 16:47:55 -04:00
Liam DeBeasi b4ade9d887 feat: update server icon (#1259)
resolves #407
2024-03-22 16:24:15 -04:00
b63d12b0e4 docs: update readme to use latest and switch unpkg to jsdelivr (#1084)
* docs: switch unpkg to jsdelivr

* docs: fix script tag

* Update readme.md

* Update package.json

---------

Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
Co-authored-by: mo7amd <mo7amd@users.noreply.github.com>
2024-03-22 10:23:35 -04:00
Liam DeBeasi d09ddb6404 docs(contributing): clarify icon contributions (#1351) 2024-03-22 09:20:55 -04:00
Liam DeBeasi 1c3f59def5 chore: use local version of lerna (#1349) 2024-03-20 13:18:08 -04:00
Liam DeBeasi fdd70c6607 merge release-7.3.0
Feature 7.3.0
2024-03-20 09:55:33 -04:00
Liam DeBeasi d38cbac770 merge release-7.3.0
Release 7.3.0
2024-03-20 09:48:15 -04:00
Liam DeBeasi 30f23ae9f5 chore(ci): pass env token 2024-03-20 09:41:51 -04:00
Liam DeBeasi 707325863d chore(): update package lock files 2024-03-20 09:40:19 -04:00
ionitron 5688365fb3 v7.3.0 2024-03-20 13:37:40 +00:00
Liam DeBeasi 9862cec6e8 chore: sync with main
chore: sync with main
2024-03-20 09:35:00 -04:00
Liam DeBeasi b18e5a9228 chore: sync with main 2024-03-20 09:26:21 -04:00
Liam DeBeasi c1450932cb merge release-7.2.3
Release 7.2.3
2024-03-20 09:26:09 -04:00
Liam DeBeasi 0a299f7118 chore(); update package lock files 2024-03-20 09:19:03 -04:00
Liam DeBeasi 51efbde09f chore: clean up changelog 2024-03-20 09:18:33 -04:00
Liam DeBeasi eea9396f11 chore(ci): pull branch correctly 2024-03-20 09:18:20 -04:00
Liam DeBeasiandchristophdubach 2586fb26b2 feat: update gitlab logo (#1261)
resolves #613

---------

Co-authored-by: christophdubach <christophdubach@users.noreply.github.com>
2024-03-13 19:50:06 -04:00
Liam DeBeasi c6ed6b629e feat: add updated yahoo icon (#1266) 2024-03-13 23:47:10 +00:00
Liam DeBeasi d5a55f8541 feat: add arrow box icons (#1265) 2024-03-13 23:44:14 +00:00
Liam DeBeasi 26aac36334 feat: add updated wifi logos (#1264)
resolves #323
2024-03-13 23:37:45 +00:00
Liam DeBeasi 50fe570566 feat: update ionic logo (#1263) 2024-03-13 23:14:53 +00:00
Liam DeBeasi fa5e7659fc feat: add appflow icon (#1262) 2024-03-13 19:12:29 -04:00
Liam DeBeasi 3b85413a05 feat: add trapeze icon (#1260) 2024-03-13 19:08:02 -04:00
Liam DeBeasi 302481846e feat: add binoculars icons (#1258) 2024-03-13 18:45:28 -04:00
Liam DeBeasi 8e22a3dcd1 chore: sync with main
chore: sync with main
2024-03-13 17:59:46 -04:00
Liam DeBeasi e4debc5ecb chore: sync with main 2024-03-13 17:54:45 -04:00
Piotr Tomiak f946a3ee3a feat(doc): add Web Types (#1301) 2023-11-15 11:53:55 -05:00
93 changed files with 6009 additions and 22686 deletions
-73
View File
@@ -1,73 +0,0 @@
# Contributing
Thanks for your interest in contributing to Ionicons! :tada:
## Contributing Etiquette
Please see our [Contributor Code of Conduct](./CODE_OF_CONDUCT.md) for information on our rules of conduct.
## Creating an Issue
* If you have a question about using Ionicons, please ask on the [Ionic Forum](http://forum.ionicframework.com/) or in the [Ionic Discord](https://ionic.link/discord).
* It is required that you clearly describe the steps necessary to reproduce the issue you are running into. Although we would love to help our users as much as possible, diagnosing issues without clear reproduction steps is extremely time-consuming and simply not sustainable.
* The issue list of this repository is exclusively for bug reports and feature requests. Non-conforming issues will be closed immediately.
* If you think you have found a bug, or have a new feature idea, please start by making sure it hasn't already been [reported](https://github.com/ionic-team/ionicons/issues?utf8=%E2%9C%93&q=is%3Aissue). You can search through existing issues to see if there is a similar one reported. Include closed issues as it may have been closed with a solution.
* Next, [create a new issue](https://github.com/ionic-team/ionicons/issues/new/choose) that thoroughly explains the problem.
## Creating a Pull Request
* We appreciate you taking the time to contribute! Before submitting a pull request, we ask that you please [create an issue](#creating-an-issue) that explains the bug or feature request and let us know that you plan on creating a pull request for it. If an issue already exists, please comment on that issue letting us know you would like to submit a pull request for it. This helps us to keep track of the pull request and make sure there isn't duplicated effort.
* Looking for an issue to fix? Make sure to look through our issues with the [help wanted](https://github.com/ionic-team/ionicons/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) label!
### Setup
1. [Download the installer](https://nodejs.org/) for the LTS version of Node.js. This is the best way to also [install npm](https://blog.npmjs.org/post/85484771375/how-to-install-npm#_=_).
2. Fork this repository.
3. Clone your fork.
4. Create a new branch from master for your change.
5. Run `npm install` from the root directory to install dependencies for this package.
6. Run `npm run build` to perform a first time build.
7. [Modify the Icon Component](#modifying-components) if desired.
8. Or, modify and [preview the site](#preview-site).
#### Modifying Components
1. Navigate to the `src/components/` directory and open the `icon` component to modify.
2. Make any changes to the icon component and then [preview the changes](#preview-component-changes).
#### Preview Component Changes
1. Run `npm start` from the root directory to start a local version of the icon test.
2. Modify the icon test as needed in the `index.html` file.
3. If you are modifying icons, you can run `npm run build.files` to re-run the SVG optimization script to verify there are no changes after optimizing the SVG.
<!-- #### Building Changes
TODO -->
### Submit Pull Request
1. [Create a new pull request](https://github.com/ionic-team/ionicons/compare) with the `master` branch as the `base`. You may need to click on `compare across forks` to find your changes.
2. See the [Creating a pull request from a fork](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) GitHub help article for more information.
3. Please fill out the Pull Request template to the best of your ability and include any issues that are related.
## Updating Documentation
The documentation site for Ionicons is located in the [ionicons-site](https://github.com/ionic-team/ionicons-site) repository.
## License
By contributing your code to the ionic-team/ionicons GitHub Repository, you agree to license your contribution under the MIT license.
+2 -2
View File
@@ -1,7 +1,7 @@
name: 🐛 Bug Report
description: Report a bug in the ion-icon component. Incorrect icons should use the "Incorrect Icon" template instead.
labels: ["triage"]
title: "bug: "
labels: ['triage']
title: 'bug: '
body:
- type: textarea
attributes:
+3 -3
View File
@@ -1,7 +1,7 @@
name: 💡 Feature Request
description: Suggest a new feature for the ion-icon component. Icon requests should use the "Icon Request" template instead.
labels: ["triage"]
title: "feat: "
labels: ['triage']
title: 'feat: '
body:
- type: textarea
attributes:
@@ -20,4 +20,4 @@ body:
- type: textarea
attributes:
label: Additional Information
description: Add any other context or screenshots about the feature request here.
description: Add any other context or screenshots about the feature request here.
+3 -3
View File
@@ -1,7 +1,7 @@
name: 🚀 Icon Request
description: Request a new icon
labels: ["triage"]
title: "icon request: "
labels: ['triage']
title: 'icon request: '
body:
- type: textarea
attributes:
@@ -16,4 +16,4 @@ body:
- type: textarea
attributes:
label: Additional Information
description: Add any other context about the icon request here.
description: Add any other context about the icon request here.
+3 -3
View File
@@ -1,7 +1,7 @@
name: 😒 Incorrect Icon
description: Report an incorrect icon
labels: ["triage"]
title: "incorrect icon: "
labels: ['triage']
title: 'incorrect icon: '
body:
- type: textarea
attributes:
@@ -14,4 +14,4 @@ body:
label: Expected Behavior
description: A clear description of what the icon should look like. Please include any relevant screenshots.
validations:
required: true
required: true
+15 -3
View File
@@ -26,7 +26,7 @@ closeAndLock:
comment:
labels:
- label: "help wanted"
- label: 'help wanted'
message: >
This issue has been labeled as `help wanted`. This label is added to issues
that we believe would be good for contributors.
@@ -54,12 +54,24 @@ comment:
If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was
not enough for our team to reproduce the issue.
- label: 'community feedback wanted'
message: >
This issue has been labeled as `community feedback wanted`. This label is added to issues that we would like to hear from the community on before moving forward with any final decision on the feature request.
If the requested feature is something you would find useful for your applications, please react to the original post with 👍 (`+1`). If you would like to provide an additional use case for the feature, please post a comment.
The team will review this feedback and make a final decision. Any decision will be posted on this thread, but please note that we may ultimately decide not to pursue this feature.
Thank you!
dryRun: false
noReply:
days: 14
maxIssuesPerRun: 100
label: "needs: reply"
label: 'needs: reply'
responseLabel: triage
exemptProjects: true
exemptMilestones: true
@@ -77,7 +89,7 @@ noReply:
noReproduction:
days: 14
maxIssuesPerRun: 100
label: "ionitron: needs reproduction"
label: 'ionitron: needs reproduction'
responseLabel: triage
exemptProjects: true
exemptMilestones: true
@@ -3,14 +3,14 @@ description: 'Build Ionicons'
runs:
using: 'composite'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Checkout the latest commit in this branch
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
- name: Cache Node Modules
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: node-modules
with:
@@ -31,4 +31,4 @@ runs:
with:
name: ionicons-src
output: IoniconsSrc.zip
paths: src
paths: src
@@ -10,10 +10,10 @@ inputs:
runs:
using: 'composite'
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
- name: Exract Archive
run: unzip -q -o ${{ inputs.path }}/${{ inputs.filename }}
shell: bash
shell: bash
@@ -12,12 +12,20 @@ inputs:
description: 'A folder containing a package.json file.'
token:
description: 'The NPM authentication token required to publish.'
createRelease:
description: 'Create a release on GitHub.'
default: 'false'
ghToken:
description: 'The GitHub authentication token required to create a release.'
runs:
using: 'composite'
steps:
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 22.x
- name: Install latest npm
run: npm install -g npm@latest
shell: bash
@@ -25,8 +33,16 @@ runs:
run: npm ci
shell: bash
working-directory: ${{ inputs.working-directory }}
- name: Set Git User
run: |
git config user.name ionitron
git config user.email hi@ionicframework.com
shell: bash
- name: Update Version
run: npm version ${{ inputs.version }} --git-tag-version false
id: update_version
run: |
npm version ${{ inputs.version }}
echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
shell: bash
working-directory: ${{ inputs.working-directory }}
- name: Run Build
@@ -43,3 +59,15 @@ runs:
run: npm publish ${{ inputs.folder }} --tag ${{ inputs.tag }} --provenance
shell: bash
working-directory: ${{ inputs.working-directory }}
- name: Create Release
if: ${{ inputs.createRelease == 'true' }}
run: |
git remote set-url origin https://${GH_TOKEN}:x-oauth-basic@github.com/ionic-team/ionicons.git
git remote -v
git push origin main --tags
gh release create "v$VERSION" --title "v$VERSION" --generate-notes
shell: bash
env:
GH_TOKEN: ${{ inputs.ghToken }}
VERSION: ${{ env.VERSION }}
@@ -10,10 +10,10 @@ inputs:
runs:
using: 'composite'
steps:
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
- name: Cache Node Modules
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: node-modules
with:
@@ -65,7 +65,7 @@ runs:
shell: bash
- name: Archive Updated Screenshots
if: inputs.update == 'true' && steps.test-and-update.outputs.hasUpdatedScreenshots == 'true'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: updated-screenshots-${{ inputs.shard }}-${{ inputs.totalShards }}
path: UpdatedScreenshots-${{ inputs.shard }}-${{ inputs.totalShards }}.zip
@@ -81,4 +81,4 @@ runs:
with:
name: test-results-${{ inputs.shard }}-${{ inputs.totalShards }}
output: TestResults-${{ inputs.shard }}-${{ inputs.totalShards }}.zip
paths: playwright-report
paths: playwright-report
@@ -3,10 +3,10 @@ description: 'Test Spec'
runs:
using: 'composite'
steps:
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
- name: Cache Node Modules
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: node-modules
with:
@@ -7,8 +7,8 @@ on:
runs:
using: 'composite'
steps:
- uses: actions/setup-node@v3
- uses: actions/download-artifact@v3
- uses: actions/setup-node@v4
- uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Extract Archives
@@ -35,4 +35,4 @@ runs:
git add src/\*.png --force
git commit -m "chore(): add updated snapshots"
git push
shell: bash
shell: bash
@@ -13,7 +13,7 @@ runs:
- name: Create Archive
run: zip -q -r ${{ inputs.output }} ${{ inputs.paths }}
shell: bash
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ inputs.name }}
path: ${{ inputs.output }}
path: ${{ inputs.output }}
+7 -7
View File
@@ -2,7 +2,7 @@ name: 'Ionicons Build'
on:
pull_request:
branches: [ '**' ]
branches: ['**']
# When pushing a new commit we should
# cancel the previous test run to not
@@ -15,7 +15,7 @@ jobs:
build-core:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Checkout the latest commit in this branch
ref: ${{ github.event.pull_request.head.sha }}
@@ -25,9 +25,9 @@ jobs:
needs: [build-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/workflows/actions/test-spec
test-e2e:
strategy:
# This ensures that all screenshot shard
@@ -46,12 +46,12 @@ jobs:
needs: [build-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/workflows/actions/test-e2e
with:
shard: ${{ matrix.shard }}
totalShards: ${{ matrix.totalShards }}
# Screenshots are required to pass
# in order for the branch to be merge
# eligible. However, the screenshot tests
@@ -68,4 +68,4 @@ jobs:
steps:
- name: Check build matrix status
if: ${{ needs.test-e2e.result != 'success' }}
run: exit 1
run: exit 1
+15 -7
View File
@@ -9,7 +9,7 @@ jobs:
outputs:
dev-hash: ${{ steps.create-dev-hash.outputs.DEV_HASH }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Dependencies
run: npm ci --no-package-lock
shell: bash
@@ -20,13 +20,21 @@ jobs:
shell: bash
release-ionicons:
runs-on: ubuntu-latest
needs: [create-dev-hash]
uses: ./.github/workflows/release-ionicons.yml
with:
tag: dev
version: ${{ needs.create-dev-hash.outputs.dev-hash }}
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Publish to NPM
uses: ./.github/workflows/actions/publish-npm
with:
tag: dev
version: ${{ needs.create-dev-hash.outputs.dev-hash }}
working-directory: './'
token: ${{ secrets.NPM_TOKEN }}
createRelease: 'false'
get-build:
name: Get your dev build!
-30
View File
@@ -1,30 +0,0 @@
name: 'Release Ionicons'
on:
workflow_call:
inputs:
version:
description: 'The type of version to release.'
type: string
required: true
tag:
description: 'The tag to publish to on NPM.'
type: string
required: true
secrets:
NPM_TOKEN:
required: true
jobs:
release-core:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/publish-npm
with:
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: './'
token: ${{ secrets.NPM_TOKEN }}
+15 -52
View File
@@ -20,57 +20,20 @@ on:
jobs:
release-ionicons:
uses: ./.github/workflows/release-ionicons.yml
with:
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
finalize-release:
needs: [release-ionicons]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.IONITRON_TOKEN }}
fetch-depth: 0
- name: Configure Identity
# Commits from github-actions do not
# trigger other GitHub Actions. As a result,
# we publish releases from Ionitron instead
# so actions run when merging the release branch
# back into main.
run: |
git config user.name ionitron
git config user.email hi@ionicframework.com
shell: bash
# This ensures the local version of Lerna is installed
# and that we do not use the global Lerna version
- name: Install root dependencies
run: npm ci
shell: bash
- name: Create GitHub Release
run: npx lerna version ${{ inputs.version }} --yes --force-publish='*' --conventional-commits --create-release github
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
update-package-lock:
# This needs to run after finalize-release
# because we also push to the repo in that
# job. If these jobs ran in parallel then it is
# possible for them to push at the same time.
needs: [finalize-release]
runs-on: ubuntu-latest
steps:
# Lerna does not automatically bump versions
# of Ionicons dependencies that have changed,
# so we do that here.
- name: Bump Package Lock
run: |
npx lerna exec "npm install --package-lock-only --legacy-peer-deps"
git add .
git commit -m "chore(): update package lock files"
git push
shell: bash
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.IONITRON_TOKEN }}
- name: Publish to NPM
uses: ./.github/workflows/actions/publish-npm
with:
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
working-directory: './'
token: ${{ secrets.NPM_TOKEN }}
createRelease: true
ghToken: ${{ secrets.IONITRON_TOKEN }}
+4 -4
View File
@@ -7,7 +7,7 @@ jobs:
build-core:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/workflows/actions/build-core
test-e2e:
@@ -28,7 +28,7 @@ jobs:
needs: [build-core]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/workflows/actions/test-e2e
with:
shard: ${{ matrix.shard }}
@@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-latest
needs: [test-e2e]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Normally, we could just push with the
# default GITHUB_TOKEN, but that will
# not cause the build workflow
@@ -49,4 +49,4 @@ jobs:
# to run when the screenshots are pushed.
with:
token: ${{ secrets.IONITRON_TOKEN }}
- uses: ./.github/workflows/actions/update-reference-screenshots
- uses: ./.github/workflows/actions/update-reference-screenshots
+1
View File
@@ -24,3 +24,4 @@ www/
/playwright-report/
/playwright/.cache/
/src/**/*-snapshots
*.tgz
+107 -2
View File
@@ -3,12 +3,117 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [7.2.3](https://github.com/ionic-team/ionicons/compare/v7.2.2...v7.2.3) (2024-03-20)
## [8.0.6](https://github.com/ionic-team/ionicons/compare/v8.0.5...v8.0.6) (2025-05-05)
### Bug Fixes
* publish correct Ionicons build
## [8.0.5](https://github.com/ionic-team/ionicons/compare/v8.0.0...v8.0.5) (2025-05-05)
### Bug Fixes
* properly export Ionicons package files
# [8.0.0](https://github.com/ionic-team/ionicons/compare/v7.4.0...v8.0.0) (2025-05-02)
### ⚠️ Breaking Changes
* **Modernized Project Setup** ([#1447](https://github.com/ionic-team/ionicons/pull/1447))
* Updated all project dependencies
* Removed `lerna` from the monorepo setup
* Refactored and updated the build process
* Introduced Prettier formatting with build integration
* Replaced or fixed several icons to improve browser compatibility (notably Safari's `file://` SVG rendering)
* Various plugin fixes
### 🐛 Bug Fixes
* Icons:
* SVG `fill` path updated in `warning-outline.svg` (Fixes [#1298](https://github.com/ionic-team/ionicons/issues/1298))
* Applied `currentColor` to icons for better theming (Fixes [#1420](https://github.com/ionic-team/ionicons/issues/1420))
* Added missing tags to multiple icons:
* `bell` tag to `notifications` (Fixes [#1090](https://github.com/ionic-team/ionicons/issues/1090))
* `sliders`, `filters` tags to `option` (Fixes [#1060](https://github.com/ionic-team/ionicons/issues/1060))
* `loveseat` tag to `bed` (Closes [#503](https://github.com/ionic-team/ionicons/issues/503))
* `contacts` tag to `people-circle` (Closes [#779](https://github.com/ionic-team/ionicons/issues/779))
* Fixed and updated `data.json`
* Fixed broken contributing link
* Added missing `rimraf` dependency
* Improved codebase with additional comments
# [7.4.0](https://github.com/ionic-team/ionicons/compare/v7.3.1...v7.4.0) (2024-05-01)
### Features
* add X logo ([#1371](https://github.com/ionic-team/ionicons/issues/1371)) ([0963fe2](https://github.com/ionic-team/ionicons/commit/0963fe20b77a03b0b8b7f4e94b646cd5d7b25f03)), closes [#1249](https://github.com/ionic-team/ionicons/issues/1249)
* export setAssetPath ([#1372](https://github.com/ionic-team/ionicons/issues/1372)) ([87f2094](https://github.com/ionic-team/ionicons/commit/87f2094890c22b7b03bf754b6fd2651a83fe20ed)), closes [#1302](https://github.com/ionic-team/ionicons/issues/1302)
* update server icon ([#1259](https://github.com/ionic-team/ionicons/issues/1259)) ([b4ade9d](https://github.com/ionic-team/ionicons/commit/b4ade9d887c0d5ecc29e25f8e12b576106de712a)), closes [#407](https://github.com/ionic-team/ionicons/issues/407)
## [7.3.1](https://github.com/ionic-team/ionicons/compare/v7.3.0...v7.3.1) (2024-03-27)
### Bug Fixes
* **icon:** icon names with numbers are correctly converted to kebab case ([#1339](https://github.com/ionic-team/ionicons/issues/1339)) ([077168d](https://github.com/ionic-team/ionicons/commit/077168dac9347f25d2b8ce440bd0a3e8576f4cdf)), closes [#1338](https://github.com/ionic-team/ionicons/issues/1338)
* filled ellipsis circle icons renders correctly ([#1353](https://github.com/ionic-team/ionicons/issues/1353)) ([63e60ec](https://github.com/ionic-team/ionicons/commit/63e60ec44c11bda5902b5a496113f65a5e6f3d85)), closes [#1320](https://github.com/ionic-team/ionicons/issues/1320)
# [7.3.0](https://github.com/ionic-team/ionicons/compare/v7.2.3...v7.3.0) (2024-03-20)
### Features
* add appflow icon ([#1262](https://github.com/ionic-team/ionicons/issues/1262)) ([fa5e765](https://github.com/ionic-team/ionicons/commit/fa5e7659fc1622908c4e55b01d0573017a36af6a))
* add arrow box icons ([#1265](https://github.com/ionic-team/ionicons/issues/1265)) ([d5a55f8](https://github.com/ionic-team/ionicons/commit/d5a55f8541b208ab46dd41e53528aab48a90ed10))
* add binoculars icons ([#1258](https://github.com/ionic-team/ionicons/issues/1258)) ([3024818](https://github.com/ionic-team/ionicons/commit/302481846e48428a354bc36220506001ac4c645e))
* add trapeze icon ([#1260](https://github.com/ionic-team/ionicons/issues/1260)) ([3b85413](https://github.com/ionic-team/ionicons/commit/3b85413a059b2c91f10105d576cc717fd687a491))
* add updated wifi logos ([#1264](https://github.com/ionic-team/ionicons/issues/1264)) ([26aac36](https://github.com/ionic-team/ionicons/commit/26aac36334cc09e5887523bc99c3d746586ebb63)), closes [#323](https://github.com/ionic-team/ionicons/issues/323)
* add updated yahoo icon ([#1266](https://github.com/ionic-team/ionicons/issues/1266)) ([c6ed6b6](https://github.com/ionic-team/ionicons/commit/c6ed6b629e45465b49e8e35db3830083ca9520ef))
* **doc:** add Web Types ([#1301](https://github.com/ionic-team/ionicons/issues/1301)) ([f946a3e](https://github.com/ionic-team/ionicons/commit/f946a3ee3a4a1c2bdf9508b11a71fcb0a419d571))
* update gitlab logo ([#1261](https://github.com/ionic-team/ionicons/issues/1261)) ([2586fb2](https://github.com/ionic-team/ionicons/commit/2586fb26b2a493fcb4b5b0156dd00d6b5eab1ab0)), closes [#613](https://github.com/ionic-team/ionicons/issues/613)
* update ionic logo ([#1263](https://github.com/ionic-team/ionicons/issues/1263)) ([50fe570](https://github.com/ionic-team/ionicons/commit/50fe570566d4c28de7fb10694543cd6dc72f3935))
# [7.3.0](https://github.com/ionic-team/ionicons/compare/v7.2.3...v7.3.0) (2024-03-20)
### Features
* add appflow icon ([#1262](https://github.com/ionic-team/ionicons/issues/1262)) ([fa5e765](https://github.com/ionic-team/ionicons/commit/fa5e7659fc1622908c4e55b01d0573017a36af6a))
* add arrow box icons ([#1265](https://github.com/ionic-team/ionicons/issues/1265)) ([d5a55f8](https://github.com/ionic-team/ionicons/commit/d5a55f8541b208ab46dd41e53528aab48a90ed10))
* add binoculars icons ([#1258](https://github.com/ionic-team/ionicons/issues/1258)) ([3024818](https://github.com/ionic-team/ionicons/commit/302481846e48428a354bc36220506001ac4c645e))
* add trapeze icon ([#1260](https://github.com/ionic-team/ionicons/issues/1260)) ([3b85413](https://github.com/ionic-team/ionicons/commit/3b85413a059b2c91f10105d576cc717fd687a491))
* add updated wifi logos ([#1264](https://github.com/ionic-team/ionicons/issues/1264)) ([26aac36](https://github.com/ionic-team/ionicons/commit/26aac36334cc09e5887523bc99c3d746586ebb63)), closes [#323](https://github.com/ionic-team/ionicons/issues/323)
* add updated yahoo icon ([#1266](https://github.com/ionic-team/ionicons/issues/1266)) ([c6ed6b6](https://github.com/ionic-team/ionicons/commit/c6ed6b629e45465b49e8e35db3830083ca9520ef))
* **doc:** add Web Types ([#1301](https://github.com/ionic-team/ionicons/issues/1301)) ([f946a3e](https://github.com/ionic-team/ionicons/commit/f946a3ee3a4a1c2bdf9508b11a71fcb0a419d571))
* update gitlab logo ([#1261](https://github.com/ionic-team/ionicons/issues/1261)) ([2586fb2](https://github.com/ionic-team/ionicons/commit/2586fb26b2a493fcb4b5b0156dd00d6b5eab1ab0)), closes [#613](https://github.com/ionic-team/ionicons/issues/613)
* update ionic logo ([#1263](https://github.com/ionic-team/ionicons/issues/1263)) ([50fe570](https://github.com/ionic-team/ionicons/commit/50fe570566d4c28de7fb10694543cd6dc72f3935))
+151
View File
@@ -0,0 +1,151 @@
# Contributing to Ionicons
Thank you for your interest in contributing to Ionicons! :tada:
This document outlines the guidelines and processes for contributing to this project.
## Table of Contents
- [Contributing to Ionicons](#contributing-to-ionicons)
- [Table of Contents](#table-of-contents)
- [Code of Conduct](#code-of-conduct)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Environment Setup](#environment-setup)
- [Development Workflow](#development-workflow)
- [Branch Strategy](#branch-strategy)
- [Component Modifications](#component-modifications)
- [Testing Changes](#testing-changes)
- [Code Style](#code-style)
- [Building](#building)
- [Submitting Issues](#submitting-issues)
- [Submitting Pull Requests](#submitting-pull-requests)
## Code of Conduct
Please read our [Contributor Code of Conduct](./CODE_OF_CONDUCT.md) for information on our rules of conduct. By contributing to Ionicons, you agree to abide by its terms.
## Getting Started
### Prerequisites
- [Node.js](https://nodejs.org/) (LTS version recommended)
- [npm](https://www.npmjs.com/) (comes with Node.js)
- Git
### Environment Setup
1. We recommend using [nvm](https://github.com/nvm-sh/nvm) (Node Version Manager) to manage Node.js versions:
- For macOS/Linux: `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash`
- For Windows: Use [nvm-windows](https://github.com/coreybutler/nvm-windows)
- Install and use the LTS version: `nvm install --lts && nvm use --lts`
Alternatively, you can [download the installer](https://nodejs.org/) for the LTS version of Node.js directly.
2. Fork the repository on GitHub
3. Clone your fork locally:
```bash
git clone https://github.com/YOUR-USERNAME/ionicons.git
cd ionicons
```
4. Add the original repository as an upstream remote:
```bash
git remote add upstream https://github.com/ionic-team/ionicons.git
```
5. Create a new branch from `main` for your change:
```bash
git checkout -b your-feature-branch
```
6. Install dependencies:
```bash
npm install
```
7. Run the initial build:
```bash
npm run build
```
8. If desired, [modify the Icon Component](#component-modifications)
9. Or, modify and preview the site
## Development Workflow
### Branch Strategy
- Always create a new branch from `main` for your changes:
```bash
git checkout main
git pull upstream main
git checkout -b your-feature-branch
```
### Component Modifications
If you're modifying the `ion-icon` component:
1. Navigate to `src/components/` directory and open the `icon` component to modify
2. Make your changes to the component code
3. Test your changes (see [Testing Changes](#testing-changes))
### Testing Changes
To preview component changes:
1. Run:
```bash
npm start
```
This will start a local version of the icon test with a test page
2. Modify the test page in `index.html` as needed to test your changes
3. If you are modifying icons, you can run `npm run build.files` to re-run the SVG optimization script to verify there are no changes after optimizing the SVG
### Code Style
- This project uses Prettier for code formatting
- Run `npm run prettier` to format your code before submitting
### Building
- Run `npm run build` to build the complete package
- Run `npm run build.files` to rebuild only the SVG icon files
## Submitting Issues
Please submit issues for:
- Bug reports
- Feature requests
- General questions about the project
When creating issues:
1. If you have a question about using Ionicons, please ask on the [Ionic Forum](http://forum.ionicframework.com/) or in the [Ionic Discord](https://ionic.link/discord).
2. It is required that you clearly describe the steps necessary to reproduce the issue you are running into. Although we would love to help our users as much as possible, diagnosing issues without clear reproduction steps is extremely time-consuming and simply not sustainable.
3. The issue list of this repository is exclusively for bug reports and feature requests. Non-conforming issues will be closed immediately.
4. Check if a similar issue already exists by searching through [existing issues](https://github.com/ionic-team/ionicons/issues?utf8=%E2%9C%93&q=is%3Aissue). You can search through existing issues to see if there is a similar one reported. Include closed issues as it may have been closed with a solution.
5. Use the provided issue templates and clearly describe:
- Expected behavior
- Actual behavior
- Steps to reproduce (for bugs)
- Browser/device information when relevant
6. [Create a new issue](https://github.com/ionic-team/ionicons/issues/new/choose) that thoroughly explains the problem.
## Submitting Pull Requests
1. Before submitting a Pull Request (PR), please:
- Create an issue first to discuss the proposed changes
- Comment on an existing issue mentioning you'd like to work on it
- Look for issues labeled with [`help wanted`](https://github.com/ionic-team/ionicons/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) if you're new to the project
2. Creating the PR:
- Update your fork to the latest upstream main
- Make your changes in a new git branch
- Follow the code style of the project
- Include relevant tests
- Make sure all tests pass: `npm test`
- Update documentation if needed
- [Create a new pull request](https://github.com/ionic-team/ionicons/compare) with the `main` branch as the base.
-6
View File
@@ -1,6 +0,0 @@
{
"packages": [
"./"
],
"version": "7.2.3"
}
+4475 -21735
View File
File diff suppressed because it is too large Load Diff
+56 -26
View File
@@ -1,6 +1,6 @@
{
"name": "ionicons",
"version": "7.2.3",
"version": "8.0.7",
"description": "Premium icons for Ionic.",
"files": [
"components/",
@@ -10,36 +10,65 @@
"main": "./dist/index.cjs.js",
"module": "./dist/index.js",
"types": "dist/types/index.d.ts",
"unpkg": "dist/ionicons.js",
"collection": "dist/collection/collection-manifest.json",
"collection:main": "dist/collection/index.js",
"unpkg": "dist/ionicons/ionicons.esm.js",
"jsdelivr": "dist/ionicons/ionicons.esm.js",
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs.js"
},
"./loader": {
"types": "./dist/loader/index.d.ts",
"import": "./dist/loader/index.js",
"require": "./dist/loader/index.cjs.js"
},
"./components": {
"types": "./components/index.d.ts",
"import": "./components/index.js"
},
"./icons": {
"types": "./icons/ion-icon.d.ts",
"import": "./icons/ion-icon.mjs",
"require": "./icons/ion-icon.js"
}
},
"scripts": {
"build": "tsc -p scripts/tsconfig.json && npm run build.files && npm run build.component && npm run collection.copy",
"build.files": "node scripts/build.js",
"build": "run-s clean build.* prettier",
"build.files": "tsx scripts/build.ts",
"build.component": "stencil build",
"collection.copy": "node scripts/collection-copy.js",
"start": "stencil build --dev --watch --serve",
"test": "npm run test.spec",
"test.spec": "stencil test --spec"
"clean": "rimraf dist components icons www",
"prettier": "npm run prettier.base -- --write",
"prettier.base": "prettier --cache \"./({bin,scripts,src,test}/**/*.{ts,tsx,js,jsx})|bin/stencil|.github/(**/)?*.(yml|yaml)|*.js\"",
"prettier.dry-run": "npm run prettier.base -- --list-different",
"start": "run-s build.files start.stencil",
"start.stencil": "stencil build --dev --watch --serve",
"test": "run-s test.spec",
"test.spec": "stencil test --spec",
"test.e2e": "playwright test",
"test.e2e.install": "playwright install && playwright install-deps"
},
"dependencies": {
"@stencil/core": "^4.0.3"
"@stencil/core": "^4.30.0"
},
"devDependencies": {
"@playwright/test": "^1.33.0",
"@types/fs-extra": "^11.0.1",
"@types/jest": "^27.0.3",
"@types/node": "^20.2.1",
"@types/svgo": "^1.3.3",
"fs-extra": "^11.1.1",
"jest": "^27.0.3",
"jest-cli": "^27.0.3",
"lerna": "^6.6.2",
"puppeteer": "^20.2.1",
"semver": "^7.5.1",
"serve": "^14.2.0",
"svgo": "1.3.2",
"typescript": "^5.0.4"
"@playwright/test": "^1.52.0",
"@types/fs-extra": "^11.0.4",
"@types/jest": "^29.5.14",
"@types/node": "^22.15.3",
"@types/svgo": "^3.0.0",
"fs-extra": "^11.3.0",
"jest": "^29.7.0",
"jest-cli": "^29.7.0",
"npm-run-all2": "^7.0.2",
"prettier": "^3.5.3",
"puppeteer": "^24.7.2",
"rimraf": "^6.0.1",
"semver": "^7.7.1",
"serve": "^14.2.4",
"svgo": "3.3.2",
"tsx": "^4.19.4",
"typescript": "^5.8.3"
},
"keywords": [
"icon pack",
@@ -74,5 +103,6 @@
"license": "MIT",
"sideEffects": [
"icons/imports/"
]
],
"web-types": "dist/ionic.web-types.json"
}
+19 -7
View File
@@ -1,7 +1,7 @@
import type { PlaywrightTestConfig } from '@playwright/test';
import { devices, expect } from '@playwright/test';
const projects = [
const projects: PlaywrightTestConfig['projects'] = [
{
/**
* This is really just desktop Firefox
@@ -19,10 +19,6 @@ const projects = [
viewport: {
width: 393,
height: 727
},
screen: {
width: 393,
height: 851
}
},
},
@@ -52,7 +48,23 @@ const config: PlaywrightTestConfig = {
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 5000
timeout: 5000,
/**
* Configure screenshot comparison settings
* to be more tolerant of minor visual differences
*/
toHaveScreenshot: {
// Increase the threshold to allow for small font rendering differences
// This sets the maximum allowed ratio of pixels that can be different
maxDiffPixelRatio: 0.02, // Allow up to 2% of pixels to be different
// Alternatively, you can use absolute pixel count
// maxDiffPixels: 100, // Allow up to 100 pixels to be different
// Add a threshold for per-pixel difference to handle anti-aliasing
threshold: 0.2, // Default is 0.1
}
},
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
@@ -79,7 +91,7 @@ const config: PlaywrightTestConfig = {
},
/* Configure projects for major browsers */
projects: projects,
projects,
webServer: {
command: 'serve www -p 3333',
port: 3333,
+35 -5
View File
@@ -10,7 +10,7 @@ We intend for this icon pack to be used with [Ionic](http://ionicframework.com/)
## Contributing
Thanks for your interest in contributing! Read up on our guidelines for
[contributing](https://github.com/ionic-team/ionicons/blob/master/.github/CONTRIBUTING.md)
[contributing](https://github.com/ionic-team/ionicons/blob/main/CONTRIBUTING.md)
and then look through our issues with a [help wanted](https://github.com/ionic-team/ionicons/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
label.
@@ -19,14 +19,22 @@ label.
The Ionicons Web Component is an easy and performant way to use Ionicons in your app. The component will dynamically load an SVG for each icon, so your app is only requesting the icons that you need.
Also note that only visible icons are loaded, and icons which are "below the fold" and hidden from the user's view do not make fetch requests for the svg resource.
Also note that only visible icons are loaded, and icons that are "below the fold" and hidden from the user's view do not make fetch requests for the svg resource.
### Installation
If you're using [Ionic Framework](https://ionicframework.com/), Ionicons is packaged by default, so no installation is necessary. Want to use Ionicons without Ionic Framework? Place the following `<script>` near the end of your page, right before the closing </body> tag, to enable them.
If you're using [Ionic Framework](https://ionicframework.com/), Ionicons is packaged by default, so no installation is necessary. Want to use Ionicons without Ionic Framework? Place the following `<script>` near the end of your page, right before the closing `</body>` tag, to enable them.
```html
<script src="https://unpkg.com/ionicons@latest/dist/ionicons.js"></script>
<script type="module" src="https://esm.sh/ionicons/loader@latest"></script>
<script nomodule src="https://esm.sh/ionicons/loader@latest"></script>
```
you can replace `latest` to pick any version of Ionicon, e.g.:
```html
<script type="module" src="https://esm.sh/ionicons/loader@8.0.0"></script>
<script nomodule src="https://esm.sh/ionicons/loader@8.0.0"></script>
```
### Basic usage
@@ -45,6 +53,28 @@ To use a custom SVG, provide its url in the `src` attribute to request the exter
<ion-icon src="/path/to/external/file.svg"></ion-icon>
```
#### Custom Asset Path
If you have a different set of icons you would like to load or if the Ionicon icons are hosted on a different page or path, you can set the asset url from which Ionicons pulls the icons via:
```ts
import { setAssetPath, addIcons } from 'ionicons';
import { add, logoIonic, save } from 'ionicons/icons';
// set root path for loading icons to "<root>/public/svg"
setAssetPath(`${window.location.origin}/public/svg/`);
// only load specific icons
addIcons({ add, logoIonic, save });
```
This allows the use of named icons like this:
```html
<!-- now pulls the svg from "<root>/public/svg/heart.svg" -->
<ion-icon name="heart"></ion-icon>
```
## Variants
Each app icon in Ionicons has a `filled`, `outline` and `sharp` variant. These different variants are provided to make your app feel native to a variety of platforms. The filled variant uses the default name without a suffix. Note: Logo icons do not have outline or sharp variants.
@@ -55,7 +85,7 @@ Each app icon in Ionicons has a `filled`, `outline` and `sharp` variant. These d
```
### Platform specificity
When using icons in Ionic Framework you can specify different icons per platform. Use the `md` and `ios` attributes and provide the platform specific icon/variant name.
When using icons in Ionic Framework you can specify different icons per platform. Use the `md` and `ios` attributes and provide the platform-specific icon/variant name.
```html
<ion-icon ios="heart-outline" md="heart-sharp"></ion-icon>
+121 -320
View File
@@ -1,27 +1,49 @@
import path from 'node:path';
import fs from 'fs-extra';
import { join } from 'path';
import Svgo from 'svgo';
import { optimize } from 'svgo';
import { webComponentPassPlugins, sourcePassPlugins } from './plugins';
import { reservedKeywords } from './constants';
import pkgData from '../package.json' with { type: 'json' };
import type { SvgData } from './types';
async function build(rootDir: string) {
try {
const pkgJsonPath = join(rootDir, 'package.json');
const srcDir = join(rootDir, 'src');
const srcSvgDir = join(srcDir, 'svg');
const iconDir = join(rootDir, 'icons');
const distDir = join(rootDir, 'dist');
const distIoniconsDir = join(distDir, 'ionicons');
const distSvgDir = join(distDir, 'svg');
const srcDir = path.join(rootDir, 'src');
const srcSvgDir = path.join(srcDir, 'svg');
const iconDir = path.join(rootDir, 'icons');
const distDir = path.join(rootDir, 'dist');
const distIoniconsDir = path.join(distDir, 'ionicons');
const distSvgDir = path.join(distDir, 'svg');
const optimizedSvgDir = path.join(distIoniconsDir, 'svg');
await Promise.all([fs.emptyDir(iconDir), fs.emptyDir(distDir)]);
await fs.emptyDir(distSvgDir), await fs.emptyDir(distIoniconsDir);
/**
* Create the directories first, then empty them
* This ensures they exist before we try to write files to them
*/
await Promise.all([
fs.ensureDir(iconDir),
fs.ensureDir(distDir),
fs.ensureDir(distSvgDir),
fs.ensureDir(optimizedSvgDir),
fs.ensureDir(distIoniconsDir),
]);
/**
* Empty the directories
*/
await Promise.all([
fs.emptyDir(iconDir),
fs.emptyDir(distDir),
fs.emptyDir(distSvgDir),
fs.emptyDir(optimizedSvgDir),
fs.emptyDir(distIoniconsDir),
]);
const pkgData = await fs.readJson(pkgJsonPath);
const version = pkgData.version as string;
const srcSvgData = await getSvgs(srcSvgDir, distSvgDir, distIoniconsDir);
const srcSvgData = await getSvgs(srcSvgDir, distSvgDir, optimizedSvgDir);
await optimizeSvgs(srcSvgData);
await Promise.all([
createDataJson(version, srcDir, distDir, srcSvgData),
createIconPackage(version, iconDir, srcSvgData),
@@ -30,7 +52,7 @@ async function build(rootDir: string) {
const svgSymbolsContent = await createSvgSymbols(version, distDir, srcSvgData);
await createCheatsheet(version, rootDir, distDir, svgSymbolsContent, srcSvgData);
await createWebTypes(version, rootDir, distDir, srcSvgData);
await copyToTesting(rootDir, distDir, srcSvgData);
} catch (e) {
console.error(e);
@@ -39,172 +61,58 @@ async function build(rootDir: string) {
}
async function optimizeSvgs(srcSvgData: SvgData[]) {
// https://github.com/svg/svgo
const optimizePass = new Svgo({});
const webComponentPass = new Svgo({
full: true,
plugins: [
{
addFillNoneCss: {
type: 'perItem',
fn: (item, params) => {
if (!Array.isArray(params.attrs)) {
params.attrs = [params.attrs];
}
/**
* All host SVG elements must have
* the ionicons class otherwise styles
* will not apply.
*/
if (item.elem === 'svg') {
item.class.add('ionicon');
}
if (item.isElem()) {
item.eachAttr((attr) => {
if (attr.name === 'fill') {
if (attr.value === 'none') {
item.class.add('ionicon-fill-none');
}
item.removeAttr('fill');
} else if (attr.name === 'stroke') {
item.removeAttr('stroke');
} else if (attr.name === 'stroke-width' && attr.value === '32') {
item.removeAttr('stroke-width');
item.class.add('ionicon-stroke-width');
}
});
}
},
},
} as any,
{
removeStyleElement: true,
},
{
removeScriptElement: true,
},
{
removeDimensions: true,
},
],
});
const sourcePass = new Svgo({
full: true,
plugins: [
{
addFillNoneCss: {
type: 'perItem',
fn: (item, params) => {
if (!Array.isArray(params.attrs)) {
params.attrs = [params.attrs];
}
if (item.isElem()) {
item.eachAttr((attr) => {
if (attr.name === 'stroke' || attr.name === 'fill') {
if (attr.value === '#000' || attr.value === 'currentColor') {
item.addAttr({
name: attr.name,
value: 'currentColor',
prefix: '',
local: attr.name,
});
} else if (attr.value !== 'none') {
throw new Error(`invalid "${attr.name}" value: ${attr.value}`);
}
}
});
}
},
},
} as any,
{
removeStyleElement: true,
},
{
removeScriptElement: true,
},
{
removeDimensions: true,
},
],
});
const validatePass = new Svgo({
full: true,
plugins: [
{
addFillNoneCss: {
type: 'perItem',
fn: (item, params) => {
if (!Array.isArray(params.attrs)) {
params.attrs = [params.attrs];
}
if (item.isElem()) {
item.eachAttr((attr) => {
if (attr.name === 'style') {
throw new Error('Inline style attributed detected');
}
});
}
if (item.isElem('style')) {
throw new Error('Inline style element detected');
}
},
},
} as any,
],
});
await Promise.all(
srcSvgData.map(async (svgData) => {
return optimizeSvg(optimizePass, webComponentPass, sourcePass, validatePass, svgData);
return optimizeSvg(svgData);
}),
);
}
async function optimizeSvg(
optimizePass: Svgo,
webComponentPass: Svgo,
sourcePass: Svgo,
validatePass: Svgo,
svgData: SvgData,
) {
async function optimizeSvg(svgData: SvgData) {
const srcSvgContent = await fs.readFile(svgData.srcFilePath, 'utf8');
const optimizedSvg = await optimizePass.optimize(srcSvgContent, { path: svgData.srcFilePath });
const webComponentSvg = await webComponentPass.optimize(optimizedSvg.data, { path: svgData.srcFilePath });
const sourceSvg = await sourcePass.optimize(optimizedSvg.data, { path: svgData.srcFilePath });
const optimizedSvg = await optimize(srcSvgContent, { path: svgData.srcFilePath });
const webComponentSvg = await optimize(optimizedSvg.data, {
path: svgData.srcFilePath,
plugins: webComponentPassPlugins,
});
const sourceSvg = await optimize(optimizedSvg.data, {
path: svgData.srcFilePath,
plugins: sourcePassPlugins,
});
// Ensure directories exist before writing files
await Promise.all([
fs.ensureDir(path.dirname(svgData.optimizedFilePath)),
fs.ensureDir(path.dirname(svgData.distSvgFilePath)),
]);
svgData.optimizedSvgContent = webComponentSvg.data;
try {
await validatePass.optimize(svgData.optimizedSvgContent, { path: svgData.srcFilePath });
} catch (e) {
console.error(`${e.message}: ${svgData.srcFilePath}`);
}
await fs.writeFile(svgData.optimizedFilePath, svgData.optimizedSvgContent);
await fs.writeFile(svgData.distSvgFilePath, sourceSvg.data);
await Promise.all([
fs.writeFile(svgData.optimizedFilePath, svgData.optimizedSvgContent),
fs.writeFile(svgData.distSvgFilePath, sourceSvg.data),
]);
}
async function copyToTesting(rootDir: string, distDir: string, srcSvgData: SvgData[]) {
const testDir = join(rootDir, 'www');
const testBuildDir = join(testDir, 'build');
const testSvgDir = join(testBuildDir, 'svg');
await fs.ensureDir(testSvgDir);
const testDir = path.join(rootDir, 'www');
const testBuildDir = path.join(testDir, 'build');
const testSvgDir = path.join(testBuildDir, 'svg');
// Ensure all directories exist
await Promise.all([fs.ensureDir(testDir), fs.ensureDir(testBuildDir), fs.ensureDir(testSvgDir)]);
await Promise.all(
srcSvgData.map(async (svgData) => {
const testSvgFilePath = join(testSvgDir, svgData.fileName);
await fs.writeFile(testSvgFilePath, svgData.optimizedSvgContent);
}),
srcSvgData
.filter((svgData): svgData is SvgData & { optimizedSvgContent: string } => Boolean(svgData.optimizedSvgContent))
.map(async (svgData) => {
const testSvgFilePath = path.join(testSvgDir, svgData.fileName);
await fs.writeFile(testSvgFilePath, svgData.optimizedSvgContent);
}),
);
const distCheatsheetFilePath = join(distDir, 'cheatsheet.html');
const testCheatsheetFilePath = join(testDir, 'cheatsheet.html');
const distCheatsheetFilePath = path.join(distDir, 'cheatsheet.html');
const testCheatsheetFilePath = path.join(testDir, 'cheatsheet.html');
await fs.copyFile(distCheatsheetFilePath, testCheatsheetFilePath);
}
@@ -215,7 +123,7 @@ async function createSvgSymbols(version: string, distDir: string, srcSvgData: Sv
return 0;
});
const symbolsSvgFilePath = join(distDir, 'ionicons.symbols.svg');
const symbolsSvgFilePath = path.join(distDir, 'ionicons.symbols.svg');
const lines = [
`<svg data-ionicons="${version}" style="display:none">`,
@@ -233,19 +141,19 @@ async function createSvgSymbols(version: string, distDir: string, srcSvgData: Sv
`</style>`,
];
srcSvgData.forEach((svgData) => {
const svg = svgData.optimizedSvgContent
.replace(`<svg xmlns="http://www.w3.org/2000/svg"`, `<symbol id="${svgData.iconName}"`)
.replace(`</svg>`, `</symbol>`);
lines.push(svg);
});
srcSvgData
.filter((svgData): svgData is SvgData & { optimizedSvgContent: string } => Boolean(svgData.optimizedSvgContent))
.forEach((svgData) => {
const svg = svgData.optimizedSvgContent
.replace(`<svg xmlns="http://www.w3.org/2000/svg"`, `<symbol id="${svgData.iconName}"`)
.replace(`</svg>`, `</symbol>`);
lines.push(svg);
});
lines.push(`</svg>`, ``);
const content = lines.join('\n');
await fs.writeFile(symbolsSvgFilePath, content);
return content;
}
@@ -256,11 +164,12 @@ async function createCheatsheet(
svgSymbolsContent: string,
srcSvgData: SvgData[],
) {
const CheatsheetTmpFilePath = join(rootDir, 'scripts', 'cheatsheet-template.html');
const distCheatsheetFilePath = join(distDir, 'cheatsheet.html');
const CheatsheetTmpFilePath = path.join(rootDir, 'scripts', 'cheatsheet-template.html');
const distCheatsheetFilePath = path.join(distDir, 'cheatsheet.html');
const c = srcSvgData.map(
(svgData) => `<a href="./svg/${svgData.fileName}"><svg><use href="#${svgData.iconName}" xlink:href="#${svgData.iconName}"/></svg></a>`,
(svgData) =>
`<a href="./svg/${svgData.fileName}"><svg><use href="#${svgData.iconName}" xlink:href="#${svgData.iconName}"/></svg></a>`,
);
c.push(svgSymbolsContent);
@@ -273,10 +182,26 @@ async function createCheatsheet(
await fs.writeFile(distCheatsheetFilePath, html);
}
async function getSvgs(srcSvgDir: string, distSvgDir: string, distIoniconsDir: string): Promise<SvgData[]> {
const optimizedSvgDir = join(distIoniconsDir, 'svg');
await fs.emptyDir(optimizedSvgDir);
async function createWebTypes(version: string, rootDir: string, distDir: string, srcSvgData: SvgData[]) {
const srcWebTypeFilePath = path.join(rootDir, 'src/ionicons.web-types.json');
const distWebTypesFilePath = path.join(distDir, 'ionicons.web-types.json');
const webTypes = JSON.parse(await fs.readFile(srcWebTypeFilePath, 'utf8'));
webTypes.version = version;
const icons = webTypes.contributions.html.ionicons;
for (let data of srcSvgData) {
icons.push({
name: data.iconName,
icon: 'dist/svg/' + data.fileName,
});
}
const jsonStr = JSON.stringify(webTypes, null, 2) + '\n';
await fs.writeFile(distWebTypesFilePath, jsonStr);
}
async function getSvgs(srcSvgDir: string, distSvgDir: string, optimizedSvgDir: string): Promise<SvgData[]> {
const svgFiles = (await fs.readdir(srcSvgDir)).filter((fileName) => {
return !fileName.startsWith('.') && fileName.endsWith('.svg');
});
@@ -290,13 +215,13 @@ async function getSvgs(srcSvgDir: string, distSvgDir: string, distIoniconsDir: s
}
// srcFilePath: /src/svg/airplane-outline.svg
const srcFilePath = join(srcSvgDir, fileName);
const srcFilePath = path.join(srcSvgDir, fileName);
// srcFilePath: /src/svg/airplane-outline.svg
const distSvgFilePath = join(distSvgDir, fileName);
const distSvgFilePath = path.join(distSvgDir, fileName);
// optimizedFilePath: /dist/ionicons/svg/airplane-outline.svg
const optimizedFilePath = join(optimizedSvgDir, fileName);
const optimizedFilePath = path.join(optimizedSvgDir, fileName);
const dotSplit = fileName.split('.');
if (dotSplit.length > 2) {
@@ -330,7 +255,6 @@ async function getSvgs(srcSvgDir: string, distSvgDir: string, distIoniconsDir: s
distSvgFilePath,
srcSvgContent: await fs.readFile(srcFilePath, 'utf8'),
optimizedFilePath,
optimizedSvgContent: null,
iconName,
fileNameMjs,
fileNameCjs,
@@ -347,29 +271,15 @@ async function getSvgs(srcSvgDir: string, distSvgDir: string, distIoniconsDir: s
}
async function createIconPackage(version: string, iconDir: string, srcSvgData: SvgData[]) {
const iconPkgJsonFilePath = join(iconDir, 'package.json');
await Promise.all([
createEsmIcons(version, iconDir, srcSvgData),
createCjsIcons(version, iconDir, srcSvgData),
createDtsIcons(version, iconDir, srcSvgData),
]);
const iconPkgJson = {
name: 'ionicons/icons',
version,
module: 'index.mjs',
main: 'index.js',
typings: 'index.d.ts',
private: true,
};
const jsonStr = JSON.stringify(iconPkgJson, null, 2) + '\n';
await fs.writeFile(iconPkgJsonFilePath, jsonStr);
}
async function createEsmIcons(version: string, iconDir: string, srcSvgData: SvgData[]) {
const iconEsmFilePath = join(iconDir, 'index.mjs');
const iconEsmFilePath = path.join(iconDir, 'index.mjs');
const o = [`/* Ionicons v${version}, ES Modules */`, ``];
@@ -381,7 +291,7 @@ async function createEsmIcons(version: string, iconDir: string, srcSvgData: SvgD
}
async function createCjsIcons(version: string, iconDir: string, srcSvgData: SvgData[]) {
const iconCjsFilePath = join(iconDir, 'index.js');
const iconCjsFilePath = path.join(iconDir, 'index.js');
const o = [`/* Ionicons v${version}, CommonJS */`, ``];
@@ -393,7 +303,7 @@ async function createCjsIcons(version: string, iconDir: string, srcSvgData: SvgD
}
async function createDtsIcons(version: string, iconDir: string, srcSvgData: SvgData[]) {
const iconDtsFilePath = join(iconDir, 'index.d.ts');
const iconDtsFilePath = path.join(iconDir, 'index.d.ts');
const o = [`/* Ionicons v${version}, Types */`, ``];
@@ -406,6 +316,11 @@ async function createDtsIcons(version: string, iconDir: string, srcSvgData: SvgD
function getDataUrl(svgData: SvgData) {
let svg = svgData.optimizedSvgContent;
if (!svg) {
throw new Error(`oh no! no optimized SVG content! ${svgData.fileName}`);
}
if (svg.includes(`'`)) {
throw new Error(`oh no! no single quotes allowed! ${svgData.fileName}`);
}
@@ -417,17 +332,10 @@ function getDataUrl(svgData: SvgData) {
}
async function createDataJson(version: string, srcDir: string, distDir: string, srcSvgData: SvgData[]) {
const srcDataJsonPath = join(srcDir, 'data.json');
const distDataJsonPath = join(distDir, 'ionicons.json');
let data: JsonData;
try {
data = await fs.readJson(srcDataJsonPath);
} catch (e) {
data = {} as any;
}
const srcDataJsonPath = path.join(srcDir, 'data.json');
const distDataJsonPath = path.join(distDir, 'ionicons.json');
const data = await fs.readJson(srcDataJsonPath).catch(() => ({}));
data.icons = data.icons || [];
// add new icons
@@ -476,60 +384,6 @@ function upFirst(word: string) {
return word[0].toUpperCase() + word.toLowerCase().slice(1);
}
interface SvgData {
/**
* airplane-outline.svg
*/
fileName: string;
/**
* airplane
*/
title: string;
/**
* /src/svg/airplane-outline.svg
*/
srcFilePath: string;
/**
* /dist/ionicons/svg/airplane-outline.svg
*/
optimizedFilePath: string;
/**
* /dist/svg/airplane-outline.svg
*/
distSvgFilePath: string;
optimizedSvgContent: string;
/**
* airplane-outline
*/
iconName: string;
/**
* airplane-outline.mjs
*/
fileNameMjs: string;
/**
* airplane-outline.js
*/
fileNameCjs: string;
/**
* airplaneOutline
*/
exportName: string;
}
interface JsonData {
icons: { name: string; tags?: string[] }[];
version?: string;
}
function toTitleCase(str: string) {
const s = str.trim().toLowerCase().split(' ');
for (var i = 0; i < s.length; i++) {
@@ -538,58 +392,5 @@ function toTitleCase(str: string) {
return s.join(' ');
}
// https://mathiasbynens.be/notes/reserved-keywords
const reservedKeywords = new Set([
'do',
'if',
'in',
'for',
'let',
'new',
'try',
'var',
'case',
'else',
'enum',
'eval',
'null',
'this',
'true',
'void',
'with',
'await',
'break',
'catch',
'class',
'const',
'false',
'super',
'throw',
'while',
'yield',
'delete',
'export',
'import',
'public',
'return',
'static',
'switch',
'typeof',
'default',
'extends',
'finally',
'package',
'private',
'continue',
'debugger',
'function',
'arguments',
'interface',
'protected',
'implements',
'instanceof',
'constructor',
]);
// let's do this
build(join(__dirname, '..'));
build(path.join(__dirname, '..'));
-56
View File
@@ -1,56 +0,0 @@
import fs from 'fs-extra';
import { join } from 'path';
async function collectionCopy(rootDir: string) {
// move optimized svgs to correct collection location
const optimizedSrc = join(rootDir, 'dist', 'ionicons', 'svg');
const collectionDest = join(rootDir, 'dist', 'collection', 'components', 'icon', 'svg');
await fs.copy(optimizedSrc, collectionDest);
// we don't to copy the src svgs to collection
await fs.remove(join(rootDir, 'dist', 'collection', 'svg'));
// We don't want to copy the test svg assets to collection
await fs.remove(join(rootDir, 'dist', 'collection', 'components', 'test'));
const cePackageDir = join(rootDir, 'components');
const cePackageJsonPath = join(cePackageDir, 'package.json');
const ceCjsPath = join(cePackageDir, 'index.cjs.js');
const emptyCjs = `/*empty cjs*/`;
await fs.writeFile(ceCjsPath, emptyCjs);
const cePackageJson = {
name: 'ionicons/components',
description: 'Ionicons custom element.',
main: './index.cjs.js',
module: './index.js',
types: './index.d.ts',
private: true,
};
await fs.writeFile(cePackageJsonPath, JSON.stringify(cePackageJson, null, 2));
/**
* TODO: Remove this in Ionicons v6.0
* Stencil 2 removed the legacy loader,
* but that is what Ionicons users were using
* to load Ionicons from a CDN. The lines
* below will add in a legacy loader for users
* to use so there is no breaking change in usage.
*/
const installLoaderSrc = join(rootDir, 'scripts', 'install-loader.js');
const installLoaderDest = join(rootDir, 'dist', 'ionicons.js');
await fs.copyFile(installLoaderSrc, installLoaderDest)
// this is temporary!!!!
// removing the `type` from the d.ts export
// to make it easier for users migrating between
// of older versions of angular and typescript
// to the newer verisons, where the `type` keyword
// is used. This is a megahack, no doubt.
const typesDist = join(rootDir, 'dist', 'types', 'index.d.ts');
let types = await fs.readFile(typesDist, 'utf8');
types = types.replace('export type', 'export');
await fs.writeFile(typesDist, types);
}
collectionCopy(join(__dirname, '..'));
+52
View File
@@ -0,0 +1,52 @@
// https://mathiasbynens.be/notes/reserved-keywords
export const reservedKeywords = new Set([
'do',
'if',
'in',
'for',
'let',
'new',
'try',
'var',
'case',
'else',
'enum',
'eval',
'null',
'this',
'true',
'void',
'with',
'await',
'break',
'catch',
'class',
'const',
'false',
'super',
'throw',
'while',
'yield',
'delete',
'export',
'import',
'public',
'return',
'static',
'switch',
'typeof',
'default',
'extends',
'finally',
'package',
'private',
'continue',
'debugger',
'function',
'arguments',
'interface',
'protected',
'implements',
'instanceof',
'constructor',
]);
-30
View File
@@ -1,30 +0,0 @@
(function(doc){
var scriptElm = doc.scripts[doc.scripts.length - 1];
var warn = ['[ionicons] Deprecated script, please remove: ' + scriptElm.outerHTML];
warn.push('To improve performance it is recommended to set the differential scripts in the head as follows:')
var parts = scriptElm.src.split('/');
parts.pop();
parts.push('ionicons');
var url = parts.join('/');
var scriptElm = doc.createElement('script');
scriptElm.setAttribute('type', 'module');
scriptElm.src = url + '/ionicons.esm.js';
warn.push(scriptElm.outerHTML);
scriptElm.setAttribute('data-stencil-namespace', 'ionicons');
doc.head.appendChild(scriptElm);
scriptElm = doc.createElement('script');
scriptElm.setAttribute('nomodule', '');
scriptElm.src = url + '/ionicons.js';
warn.push(scriptElm.outerHTML);
scriptElm.setAttribute('data-stencil-namespace', 'ionicons');
doc.head.appendChild(scriptElm)
console.warn(warn.join('\n'));
})(document);
+88
View File
@@ -0,0 +1,88 @@
import { PluginConfig } from 'svgo';
import type { CustomPlugin } from './types';
const setRootIoniconClass: PluginConfig = {
name: 'addClassesToSVGElement',
params: {
className: 'ionicon',
},
};
const addFillNoneCss: PluginConfig = {
name: 'addFillNoneCss',
fn: () => ({
element: {
enter: (element) => {
if (element.attributes.fill) {
if (element.attributes.fill === 'none') {
element.attributes.class = [...(element.attributes.class?.split(' ') || []), 'ionicon-fill-none'].join(' ');
}
delete element.attributes.fill;
}
if (element.attributes.stroke) {
delete element.attributes.stroke;
}
if (
element.attributes['stroke-width'] &&
(element.attributes['stroke-width'] === '32px' || element.attributes['stroke-width'] === '32')
) {
delete element.attributes['stroke-width'];
element.attributes.class = [...(element.attributes.class?.split(' ') || []), 'ionicon-stroke-width'].join(
' ',
);
}
},
},
}),
};
const forceCurrentColor: PluginConfig = {
name: 'forceCurrentColor',
fn: () => ({
element: {
enter: (element) => {
const attr = element.attributes.stroke || element.attributes.fill;
const attrName = element.attributes.stroke ? 'stroke' : element.attributes.fill ? 'fill' : undefined;
if (attrName) {
if (attr === '#000' || attr === 'currentColor') {
element.attributes[attrName] = 'currentColor';
} else if (attr !== 'none') {
throw new Error(`invalid "${attrName}" value: ${element.attributes[attrName]}`);
}
}
},
},
}),
};
const validatePlugin: PluginConfig = {
name: 'validate',
fn: () => ({
element: {
enter: (element) => {
if (element.attributes.style) {
console.warn(
`Inline style attributed detected: <${element.name} style="${element.attributes.style}">...</${element.name}>`,
);
}
if (element.name === 'style') {
console.warn('Inline style element detected');
}
},
},
}),
};
const basePlugins: PluginConfig[] = [
'removeStyleElement',
'convertStyleToAttrs',
'removeScriptElement',
'removeDimensions',
setRootIoniconClass,
validatePlugin,
];
export const webComponentPassPlugins: PluginConfig[] = [...basePlugins, addFillNoneCss];
export const sourcePassPlugins: PluginConfig[] = [...basePlugins, forceCurrentColor];
+9 -11
View File
@@ -4,38 +4,36 @@
The `src/svg` directory is the single source of truth for svgs. They should not already be optimized and can be the original svg export straight out of an svg editor. A build step before releasing will optimize the source svgs (remove comments, reduce the size, etc) and ensure they'll work within `ion-icon`.
## Build Locally
After an svg has been updated, added or deleted from the `src/svg` directory, run:
npm run build
```sh
npm run build
```
The build command will optimize all of the icons and generate the files to be distributed. After the build command, all of the optimized svgs are saved in `dist/ionicons/svg`. Additionally the `dist` directory contains the distribution files for the `ion-icon` web component.
## Svg Symbols Cheatsheet
After a build, a new `www/cheatsheet.html` file will be created. This version uses svg symbols rather than `ion-icon`.
## ion-icon Component Preview
To see the `ion-icon` component in action, run:
npm start
```sh
npm start
```
## Release Steps
npm run release.prepare
The release script will ask what version to use. After the script completes, double check the `www/cheatsheet.html` to ensure everything is good to go.
Next, update `CHANGELOG.md`, then commit and push your changes Github.
Next run:
npm run release
```sh
npm run release
```
Triple check the version number is correct, and choose which tag this should be released as. If it's a pre-release, it should be `dev`.
-7
View File
@@ -1,7 +0,0 @@
{
"compilerOptions": {
"esModuleInterop": true,
"module": "commonjs",
"target": "es2017"
}
}
+56
View File
@@ -0,0 +1,56 @@
import { PluginConfig } from 'svgo';
export interface SvgData {
/**
* airplane-outline.svg
*/
fileName: string;
/**
* airplane
*/
title: string;
/**
* /src/svg/airplane-outline.svg
*/
srcFilePath: string;
/**
* /dist/ionicons/svg/airplane-outline.svg
*/
optimizedFilePath: string;
/**
* /dist/svg/airplane-outline.svg
*/
distSvgFilePath: string;
/**
* optimized svg content
*/
optimizedSvgContent?: string;
/**
* airplane-outline
*/
iconName: string;
/**
* airplane-outline.mjs
*/
fileNameMjs: string;
/**
* airplane-outline.js
*/
fileNameCjs: string;
/**
* airplaneOutline
*/
exportName: string;
}
type ExtractCustomPlugin<T> = T extends { fn: any } ? T : never;
export type CustomPlugin = ExtractCustomPlugin<PluginConfig>;
+111 -112
View File
@@ -4,124 +4,123 @@
* This is an autogenerated file created by the Stencil compiler.
* It contains typing information for all components that exist in this project.
*/
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
import { HTMLStencilElement, JSXBase } from '@stencil/core/internal';
export namespace Components {
interface IonIcon {
/**
* The color to use for the background of the item.
*/
"color"?: string;
/**
* Specifies whether the icon should horizontally flip when `dir` is `"rtl"`.
*/
"flipRtl"?: boolean;
/**
* A combination of both `name` and `src`. If a `src` url is detected it will set the `src` property. Otherwise it assumes it's a built-in named SVG and set the `name` property.
*/
"icon"?: any;
/**
* Specifies which icon to use on `ios` mode.
*/
"ios"?: string;
/**
* If enabled, ion-icon will be loaded lazily when it's visible in the viewport. Default, `false`.
*/
"lazy": boolean;
/**
* Specifies which icon to use on `md` mode.
*/
"md"?: string;
/**
* The mode determines which platform styles to use.
*/
"mode": string;
/**
* Specifies which icon to use from the built-in set of icons.
*/
"name"?: string;
/**
* When set to `false`, SVG content that is HTTP fetched will not be checked if the response SVG content has any `<script>` elements, or any attributes that start with `on`, such as `onclick`.
* @default true
*/
"sanitize": boolean;
/**
* The size of the icon. Available options are: `"small"` and `"large"`.
*/
"size"?: string;
/**
* Specifies the exact `src` of an SVG file to use.
*/
"src"?: string;
}
interface IonIcon {
/**
* The color to use for the background of the item.
*/
color?: string;
/**
* Specifies whether the icon should horizontally flip when `dir` is `"rtl"`.
*/
flipRtl?: boolean;
/**
* A combination of both `name` and `src`. If a `src` url is detected it will set the `src` property. Otherwise it assumes it's a built-in named SVG and set the `name` property.
*/
icon?: any;
/**
* Specifies which icon to use on `ios` mode.
*/
ios?: string;
/**
* If enabled, ion-icon will be loaded lazily when it's visible in the viewport. Default, `false`.
*/
lazy: boolean;
/**
* Specifies which icon to use on `md` mode.
*/
md?: string;
/**
* The mode determines which platform styles to use.
*/
mode: string;
/**
* Specifies which icon to use from the built-in set of icons.
*/
name?: string;
/**
* When set to `false`, SVG content that is HTTP fetched will not be checked if the response SVG content has any `<script>` elements, or any attributes that start with `on`, such as `onclick`.
* @default true
*/
sanitize: boolean;
/**
* The size of the icon. Available options are: `"small"` and `"large"`.
*/
size?: string;
/**
* Specifies the exact `src` of an SVG file to use.
*/
src?: string;
}
}
declare global {
interface HTMLIonIconElement extends Components.IonIcon, HTMLStencilElement {
}
var HTMLIonIconElement: {
prototype: HTMLIonIconElement;
new (): HTMLIonIconElement;
};
interface HTMLElementTagNameMap {
"ion-icon": HTMLIonIconElement;
}
interface HTMLIonIconElement extends Components.IonIcon, HTMLStencilElement {}
var HTMLIonIconElement: {
prototype: HTMLIonIconElement;
new (): HTMLIonIconElement;
};
interface HTMLElementTagNameMap {
'ion-icon': HTMLIonIconElement;
}
}
declare namespace LocalJSX {
interface IonIcon {
/**
* The color to use for the background of the item.
*/
"color"?: string;
/**
* Specifies whether the icon should horizontally flip when `dir` is `"rtl"`.
*/
"flipRtl"?: boolean;
/**
* A combination of both `name` and `src`. If a `src` url is detected it will set the `src` property. Otherwise it assumes it's a built-in named SVG and set the `name` property.
*/
"icon"?: any;
/**
* Specifies which icon to use on `ios` mode.
*/
"ios"?: string;
/**
* If enabled, ion-icon will be loaded lazily when it's visible in the viewport. Default, `false`.
*/
"lazy"?: boolean;
/**
* Specifies which icon to use on `md` mode.
*/
"md"?: string;
/**
* The mode determines which platform styles to use.
*/
"mode"?: string;
/**
* Specifies which icon to use from the built-in set of icons.
*/
"name"?: string;
/**
* When set to `false`, SVG content that is HTTP fetched will not be checked if the response SVG content has any `<script>` elements, or any attributes that start with `on`, such as `onclick`.
* @default true
*/
"sanitize"?: boolean;
/**
* The size of the icon. Available options are: `"small"` and `"large"`.
*/
"size"?: string;
/**
* Specifies the exact `src` of an SVG file to use.
*/
"src"?: string;
}
interface IntrinsicElements {
"ion-icon": IonIcon;
}
interface IonIcon {
/**
* The color to use for the background of the item.
*/
color?: string;
/**
* Specifies whether the icon should horizontally flip when `dir` is `"rtl"`.
*/
flipRtl?: boolean;
/**
* A combination of both `name` and `src`. If a `src` url is detected it will set the `src` property. Otherwise it assumes it's a built-in named SVG and set the `name` property.
*/
icon?: any;
/**
* Specifies which icon to use on `ios` mode.
*/
ios?: string;
/**
* If enabled, ion-icon will be loaded lazily when it's visible in the viewport. Default, `false`.
*/
lazy?: boolean;
/**
* Specifies which icon to use on `md` mode.
*/
md?: string;
/**
* The mode determines which platform styles to use.
*/
mode?: string;
/**
* Specifies which icon to use from the built-in set of icons.
*/
name?: string;
/**
* When set to `false`, SVG content that is HTTP fetched will not be checked if the response SVG content has any `<script>` elements, or any attributes that start with `on`, such as `onclick`.
* @default true
*/
sanitize?: boolean;
/**
* The size of the icon. Available options are: `"small"` and `"large"`.
*/
size?: string;
/**
* Specifies the exact `src` of an SVG file to use.
*/
src?: string;
}
interface IntrinsicElements {
'ion-icon': IonIcon;
}
}
export { LocalJSX as JSX };
declare module "@stencil/core" {
export namespace JSX {
interface IntrinsicElements {
"ion-icon": LocalJSX.IonIcon & JSXBase.HTMLAttributes<HTMLIonIconElement>;
}
declare module '@stencil/core' {
export namespace JSX {
interface IntrinsicElements {
'ion-icon': LocalJSX.IonIcon & JSXBase.HTMLAttributes<HTMLIonIconElement>;
}
}
}
-1
View File
@@ -21,7 +21,6 @@
}
.ionicon-stroke-width {
stroke-width: 32px;
stroke-width: var(--ionicon-stroke-width, 32px);
}
+70 -23
View File
@@ -86,15 +86,20 @@ export class Icon {
}
connectedCallback() {
// purposely do not return the promise here because loading
// the svg file should not hold up loading the app
// only load the svg if it's visible
/**
* purposely do not return the promise here because loading
* the svg file should not hold up loading the app
* only load the svg if it's visible
*/
this.waitUntilVisible(this.el, '50px', () => {
this.isVisible = true;
this.loadIcon();
});
}
/**
* Loads the icon after the component has finished rendering.
*/
componentDidLoad() {
/**
* Addresses an Angular issue where property values are assigned after the 'connectedCallback' but prior to the registration of watchers.
@@ -107,33 +112,59 @@ export class Icon {
}
}
/**
* Disconnect the IntersectionObserver.
*/
disconnectedCallback() {
if (this.io) {
this.io.disconnect();
this.io = undefined;
}
}
private waitUntilVisible(el: HTMLElement, rootMargin: string, cb: () => void) {
if (Build.isBrowser && this.lazy && typeof window !== 'undefined' && (window as any).IntersectionObserver) {
const io = (this.io = new (window as any).IntersectionObserver(
(data: IntersectionObserverEntry[]) => {
if (data[0].isIntersecting) {
io.disconnect();
this.io = undefined;
cb();
}
},
{ rootMargin },
));
io.observe(el);
} else {
// browser doesn't support IntersectionObserver
// so just fallback to always show it
cb();
/**
* Wait until the icon is visible in the viewport.
* @param el - The element to observe.
* @param rootMargin - The root margin of the observer.
* @param cb - The callback to call when the element is visible.
*/
private waitUntilVisible(el: HTMLElement, rootMargin: string, cb: () => void) {
/**
* IntersectionObserver is a browser API that allows you to observe
* the visibility of an element relative to a root element. It is
* supported in all modern browsers, except IE and when server-side
* rendering.
*/
const hasIntersectionObserverSupport = Boolean(
Build.isBrowser && this.lazy && typeof window !== 'undefined' && window.IntersectionObserver,
);
/**
* browser doesn't support IntersectionObserver
* so just fallback to always show it
*/
if (!hasIntersectionObserverSupport) {
return cb();
}
const io = (this.io = new window.IntersectionObserver(
(data: IntersectionObserverEntry[]) => {
if (data[0].isIntersecting) {
io.disconnect();
this.io = undefined;
cb();
}
},
{ rootMargin },
));
io.observe(el);
}
/**
* Watch for changes to the icon name, src, icon, ios, or md properties.
* When a change is detected, the icon will be loaded.
*/
@Watch('name')
@Watch('src')
@Watch('icon')
@@ -161,11 +192,18 @@ export class Icon {
render() {
const { flipRtl, iconName, inheritedAttributes, el } = this;
const mode = this.mode || 'md';
// we have designated that arrows & chevrons should automatically flip (unless flip-rtl is set to false) because "back" is left in ltr and right in rtl, and "forward" is the opposite
/**
* we have designated that arrows & chevrons should automatically flip (unless flip-rtl
* is set to false) because "back" is left in ltr and right in rtl, and "forward" is the opposite
*/
const shouldAutoFlip = iconName
? (iconName.includes('arrow') || iconName.includes('chevron')) && flipRtl !== false
: false;
// if shouldBeFlippable is true, the icon should change direction when `dir` changes
/**
* if shouldBeFlippable is true, the icon should change direction when `dir` changes
*/
const shouldBeFlippable = flipRtl || shouldAutoFlip;
return (
@@ -176,7 +214,7 @@ export class Icon {
...createColorClasses(this.color),
[`icon-${this.size}`]: !!this.size,
'flip-rtl': shouldBeFlippable,
'icon-rtl': shouldBeFlippable && isRTL(el)
'icon-rtl': shouldBeFlippable && isRTL(el),
}}
{...inheritedAttributes}
>
@@ -190,9 +228,18 @@ export class Icon {
}
}
/**
* Get the mode of the document.
* @returns The mode of the document.
*/
const getIonMode = () =>
(Build.isBrowser && typeof document !== 'undefined' && document.documentElement.getAttribute('mode')) || 'md';
/**
* Create color classes for the icon.
* @param color - The color of the icon.
* @returns The color classes for the icon.
*/
const createColorClasses = (color: string | undefined) => {
return color
? {
+79 -46
View File
@@ -5,53 +5,86 @@ const requests = new Map<string, Promise<any>>();
let parser: DOMParser;
export const getSvgContent = (url: string, sanitize: boolean) => {
// see if we already have a request for this url
let req = requests.get(url);
/**
* Safely fallback to an empty svg
*/
function safeFallback(url: string) {
const svg = '';
ioniconContent.set(url, svg);
return svg;
}
if (!req) {
if (typeof fetch !== 'undefined' && typeof document !== 'undefined') {
/**
* If the url is a data url of an svg, then try to parse it
* with the DOMParser. This works with content security policies enabled.
*/
if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {
if (!parser) {
/**
* Create an instance of the DOM parser. This creates a single
* parser instance for the entire app, which is more efficient.
*/
parser = new DOMParser();
}
const doc = parser.parseFromString(url, 'text/html');
const svg = doc.querySelector('svg');
if (svg) {
ioniconContent.set(url, svg.outerHTML);
}
return Promise.resolve();
} else {
// we don't already have a request
req = fetch(url).then((rsp) => {
if (rsp.ok) {
return rsp.text().then((svgContent) => {
if (svgContent && sanitize !== false) {
svgContent = validateContent(svgContent);
}
ioniconContent.set(url, svgContent || '');
});
}
ioniconContent.set(url, '');
});
// cache for the same requests
requests.set(url, req);
}
} else {
// set to empty for ssr scenarios and resolve promise
ioniconContent.set(url, '');
return Promise.resolve();
}
export const getSvgContent = (url: string, sanitize: boolean): Promise<string> => {
/**
* See if we already have a request for this url
*/
const req = requests.get(url);
if (req) {
return req;
}
return req;
if (typeof fetch !== 'undefined' && typeof document !== 'undefined') {
/**
* If the url is a data url of an svg, then try to parse it
* with the DOMParser. This works with content security policies enabled.
*/
if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {
return Promise.resolve(getSvgByUrl(url));
}
return fetchSvg(url, sanitize);
}
return Promise.resolve(safeFallback(url));
};
function getSvgByUrl(url: string): string {
if (!parser) {
/**
* Create an instance of the DOM parser. This creates a single
* parser instance for the entire app, which is more efficient.
*/
parser = new DOMParser();
}
const doc = parser.parseFromString(url, 'text/html');
const svg = doc.querySelector('svg');
if (svg) {
ioniconContent.set(url, svg.outerHTML);
return svg.outerHTML;
}
throw new Error(`Could not parse svg from ${url}`);
}
function fetchSvg(url: string, sanitize: boolean): Promise<string> {
/**
* We don't already have a request
*/
const req = fetch(url)
.then((rsp) => {
/**
* When fetching from a file:// URL, some browsers return
* a 0 status code even when the request succeeds so don't
* rely on rsp.ok as the only signal of success.
*/
return rsp
.text()
.then((svgContent) => {
if (svgContent && sanitize !== false) {
svgContent = validateContent(svgContent);
}
const svg = svgContent || '';
ioniconContent.set(url, svg);
return svg;
})
.catch(() => safeFallback(url));
})
.catch(() => safeFallback(url));
/**
* Cache for the same requests
*/
requests.set(url, req);
return req;
}
-1
View File
@@ -67,5 +67,4 @@ test.describe('icon: basic', () => {
await expect(iconLoc).toHaveAttribute('name', 'brush');
await expect(iconLoc).not.toHaveClass(/flip-rtl/);
});
});
Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 89 KiB

+4 -4
View File
@@ -31,7 +31,7 @@ describe('icon', () => {
</ion-icon>
`);
});
it('renders custom aria-label', async () => {
const { root } = await newSpecPage({
components: [Icon],
@@ -46,13 +46,13 @@ describe('icon', () => {
</ion-icon>
`);
});
it('renders custom label after changing source', async () => {
const page = await newSpecPage({
components: [Icon],
html: `<ion-icon name="chevron-forward" aria-label="custom label"></ion-icon>`,
});
const icon = page.root;
expect(icon).toEqualHtml(`
@@ -62,7 +62,7 @@ describe('icon', () => {
</mock:shadow-root>
</ion-icon>
`);
if (icon) {
icon.name = 'trash';
}
+2 -11
View File
@@ -1,7 +1,6 @@
import { Icon } from '../icon';
import { addIcons, getIconMap, getName, getSrc, getUrl } from '../utils';
describe('getUrl', () => {
let i: Icon;
@@ -30,12 +29,9 @@ describe('getUrl', () => {
i.icon = 'some-icon';
expect(getUrl(i)).toBe('./some.svg');
});
});
describe('getSrc', () => {
it('both . and /', () => {
expect(getSrc('./somefile.svg')).toBe('./somefile.svg');
});
@@ -55,12 +51,9 @@ describe('getSrc', () => {
it('no . or /', () => {
expect(getSrc('some-name')).toBe(null);
});
});
describe('getName', () => {
it('not allow special chars', () => {
expect(getName('some\\name', '', 'io', '', '')).toBe(null);
expect(getName('some$name', '', 'io', '', '')).toBe(null);
@@ -80,7 +73,6 @@ describe('getName', () => {
it('should not use name if no name, ios or md', () => {
expect(getName(undefined, undefined, '', '', '')).toBe(null);
});
});
describe('addIcons', () => {
@@ -105,7 +97,7 @@ describe('addIcons', () => {
expect(getIconMap().get('logo-ionitron')).toEqual(logoIonitron);
expect(getIconMap().get('logoIonitron')).toEqual(logoIonitron);
const logoIonitron0 = 'stubbed data 0'
const logoIonitron0 = 'stubbed data 0';
expect(getIconMap().get('logo-ionitron-0')).toEqual(undefined);
expect(getIconMap().get('logoIonitron0')).toEqual(undefined);
@@ -131,7 +123,7 @@ describe('addIcons', () => {
expect(getIconMap().get('myCoolIcon')).toEqual(undefined);
addIcons({ 'myCoolIcon': logoIonitron });
addIcons({ myCoolIcon: logoIonitron });
expect(getIconMap().get('myCoolIcon')).toEqual(logoIonitron);
});
@@ -169,5 +161,4 @@ describe('addIcons', () => {
expect(spy).toHaveBeenCalled();
});
});
+11 -12
View File
@@ -1,14 +1,12 @@
import { isEncodedDataUrl, isSvgDataUrl, isValid } from '../validate';
describe('isValid', () => {
it('invalid onload attr', () => {
const el = {
nodeType: 1,
nodeName: 'svg',
attributes: [{ name: 'onload' }],
childNodes: []
childNodes: [],
} as any;
expect(isValid(el)).toBe(false);
});
@@ -18,16 +16,17 @@ describe('isValid', () => {
nodeType: 1,
nodeName: 'svg',
attributes: [{ name: 'OnClIcK' }],
childNodes: []
childNodes: [],
} as any;
expect(isValid(el)).toBe(false);
});
it('invalid child SCRIPT elm', () => {
const el = {
nodeType: 1, nodeName: 'svg', attributes: [], childNodes: [
{ nodeType: 1, nodeName: 'SCRIPT', attributes: [], childNodes: [] }
]
nodeType: 1,
nodeName: 'svg',
attributes: [],
childNodes: [{ nodeType: 1, nodeName: 'SCRIPT', attributes: [], childNodes: [] }],
} as any;
expect(isValid(el)).toBe(false);
});
@@ -44,9 +43,10 @@ describe('isValid', () => {
it('is valid SVG elm', () => {
const el = {
nodeType: 1, nodeName: 'SVG', attributes: [], childNodes: [
{ nodeType: 1, nodeName: 'line', attributes: [], childNodes: [] }
]
nodeType: 1,
nodeName: 'SVG',
attributes: [],
childNodes: [{ nodeType: 1, nodeName: 'line', attributes: [], childNodes: [] }],
} as any;
expect(isValid(el)).toBe(true);
});
@@ -55,7 +55,6 @@ describe('isValid', () => {
const el = { nodeType: 3, nodeName: '#text' } as any;
expect(isValid(el)).toBe(true);
});
});
it('isSvgDataUrl', () => {
@@ -70,4 +69,4 @@ it('isEncodedDataUrl', () => {
expect(isEncodedDataUrl('data:image/svg+xml;utf8,<svg></svg>')).toBe(true);
expect(isEncodedDataUrl('https://example.com/icon.svg')).toBe(false);
expect(isEncodedDataUrl('http://example.com/icon.svg')).toBe(false);
});
});
+20 -21
View File
@@ -1,7 +1,6 @@
import { getAssetPath } from '@stencil/core';
import { Icon } from './icon';
let CACHED_MAP: Map<string, string>;
export const getIconMap = (): Map<string, string> => {
@@ -17,8 +16,8 @@ export const getIconMap = (): Map<string, string> => {
}
};
export const addIcons = (icons: { [name: string]: string; }) => {
Object.keys(icons).forEach(name => {
export const addIcons = (icons: { [name: string]: string }) => {
Object.keys(icons).forEach((name) => {
addToIconMap(name, icons[name]);
/**
@@ -31,7 +30,7 @@ export const addIcons = (icons: { [name: string]: string; }) => {
* Using name="addCircleOutline" is valid too, but the
* kebab case naming is preferred.
*/
const toKebabCase = name.replace(/([a-z0-9]|(?=[A-Z]))([A-Z0-9])/g, "$1-$2").toLowerCase();
const toKebabCase = name.replace(/([a-z0-9]|(?=[A-Z]))([A-Z0-9])/g, '$1-$2').toLowerCase();
if (name !== toKebabCase) {
addToIconMap(toKebabCase, icons[name]);
}
@@ -46,15 +45,16 @@ const addToIconMap = (name: string, data: any) => {
if (existingIcon === undefined) {
map.set(name, data);
/**
* Importing and defining the same icon reference
* multiple times should not yield a warning.
*/
/**
* Importing and defining the same icon reference
* multiple times should not yield a warning.
*/
} else if (existingIcon !== data) {
console.warn(`[Ionicons Warning]: Multiple icons were mapped to name "${name}". Ensure that multiple icons are not mapped to the same icon name.`)
console.warn(
`[Ionicons Warning]: Multiple icons were mapped to name "${name}". Ensure that multiple icons are not mapped to the same icon name.`,
);
}
}
};
export const getUrl = (i: Icon) => {
let url = getSrc(i.src);
@@ -82,7 +82,6 @@ export const getUrl = (i: Icon) => {
return null;
};
const getNamedUrl = (iconName: string, iconEl: Icon) => {
const url = getIconMap().get(iconName);
if (url) {
@@ -90,7 +89,7 @@ const getNamedUrl = (iconName: string, iconEl: Icon) => {
}
try {
return getAssetPath(`svg/${iconName}.svg`);
} catch(e) {
} catch (e) {
/**
* In the custom elements build version of ionicons, referencing an icon
* by name will throw an invalid URL error because the asset path is not defined.
@@ -98,17 +97,19 @@ const getNamedUrl = (iconName: string, iconEl: Icon) => {
* We also include a reference to the ion-icon element so developers can
* figure out which instance of ion-icon needs to be updated.
*/
console.warn(`[Ionicons Warning]: Could not load icon with name "${iconName}". Ensure that the icon is registered using addIcons or that the icon SVG data is passed directly to the icon component.`, iconEl);
console.warn(
`[Ionicons Warning]: Could not load icon with name "${iconName}". Ensure that the icon is registered using addIcons or that the icon SVG data is passed directly to the icon component.`,
iconEl,
);
}
};
export const getName = (
iconName: string | undefined,
icon: string | undefined,
mode: string | undefined,
ios: string | undefined,
md: string | undefined
md: string | undefined,
) => {
// default to "md" if somehow the mode wasn't set
mode = (mode && toLower(mode)) === 'ios' ? 'ios' : 'md';
@@ -117,10 +118,8 @@ export const getName = (
// set the iconName to whatever was passed in
if (ios && mode === 'ios') {
iconName = toLower(ios);
} else if (md && mode === 'md') {
iconName = toLower(md);
} else {
if (!iconName && icon && !isSrc(icon)) {
iconName = icon;
@@ -172,7 +171,7 @@ export const toLower = (val: string) => val.toLowerCase();
export const inheritAttributes = (el: HTMLElement, attributes: string[] = []) => {
const attributeObject: { [k: string]: any } = {};
attributes.forEach(attr => {
attributes.forEach((attr) => {
if (el.hasAttribute(attr)) {
const value = el.getAttribute(attr);
if (value !== null) {
@@ -183,7 +182,7 @@ export const inheritAttributes = (el: HTMLElement, attributes: string[] = []) =>
});
return attributeObject;
}
};
/**
* Returns `true` if the document or host element
@@ -197,4 +196,4 @@ export const isRTL = (hostEl?: Pick<HTMLElement, 'dir'>) => {
}
}
return document?.dir.toLowerCase() === 'rtl';
};
};
+1 -1
View File
@@ -50,4 +50,4 @@ export const isValid = (elm: HTMLElement) => {
};
export const isSvgDataUrl = (url: string) => url.startsWith('data:image/svg+xml');
export const isEncodedDataUrl = (url: string) => url.indexOf(';utf8,') !== -1;
export const isEncodedDataUrl = (url: string) => url.indexOf(';utf8,') !== -1;
-2
View File
@@ -2,7 +2,6 @@ import { expect } from '@playwright/test';
import { test } from '../../../utils/test/playwright';
test.describe('icon: csp', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/test/csp');
});
@@ -11,5 +10,4 @@ test.describe('icon: csp', () => {
const svg = page.locator('ion-icon#icon-usage svg');
await expect(svg).toBeVisible();
});
});
@@ -2,7 +2,6 @@ import { expect } from '@playwright/test';
import { test } from '../../../utils/test/playwright';
test.describe('icon: dynamic type', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/test/dynamic-type');
});
@@ -15,5 +14,4 @@ test.describe('icon: dynamic type', () => {
await expect(icons).toHaveScreenshot(`icon-dynamic-type-diff.png`);
});
});
+197 -7
View File
@@ -460,6 +460,35 @@
"sharp"
]
},
{
"name": "arrow-down-left-box",
"tags": [
"arrow",
"box",
"down",
"left"
]
},
{
"name": "arrow-down-left-box-outline",
"tags": [
"arrow",
"box",
"down",
"left",
"outline"
]
},
{
"name": "arrow-down-left-box-sharp",
"tags": [
"arrow",
"box",
"down",
"left",
"sharp"
]
},
{
"name": "arrow-down-outline",
"tags": [
@@ -468,6 +497,35 @@
"outline"
]
},
{
"name": "arrow-down-right-box",
"tags": [
"arrow",
"box",
"down",
"right"
]
},
{
"name": "arrow-down-right-box-outline",
"tags": [
"arrow",
"box",
"down",
"outline",
"right"
]
},
{
"name": "arrow-down-right-box-sharp",
"tags": [
"arrow",
"box",
"down",
"right",
"sharp"
]
},
{
"name": "arrow-down-sharp",
"tags": [
@@ -677,6 +735,35 @@
"up"
]
},
{
"name": "arrow-up-left-box",
"tags": [
"arrow",
"box",
"left",
"up"
]
},
{
"name": "arrow-up-left-box-outline",
"tags": [
"arrow",
"box",
"left",
"outline",
"up"
]
},
{
"name": "arrow-up-left-box-sharp",
"tags": [
"arrow",
"box",
"left",
"sharp",
"up"
]
},
{
"name": "arrow-up-outline",
"tags": [
@@ -685,6 +772,35 @@
"up"
]
},
{
"name": "arrow-up-right-box",
"tags": [
"arrow",
"box",
"right",
"up"
]
},
{
"name": "arrow-up-right-box-outline",
"tags": [
"arrow",
"box",
"outline",
"right",
"up"
]
},
{
"name": "arrow-up-right-box-sharp",
"tags": [
"arrow",
"box",
"right",
"sharp",
"up"
]
},
{
"name": "arrow-up-sharp",
"tags": [
@@ -1218,6 +1334,7 @@
"tags": [
"bed",
"hotel",
"loveseat",
"sleep"
]
},
@@ -1226,6 +1343,7 @@
"tags": [
"bed",
"hotel",
"loveseat",
"outline",
"sleep"
]
@@ -1235,6 +1353,7 @@
"tags": [
"bed",
"hotel",
"loveseat",
"sharp",
"sleep"
]
@@ -1294,6 +1413,26 @@
"sharp"
]
},
{
"name": "binoculars",
"tags": [
"binoculars"
]
},
{
"name": "binoculars-outline",
"tags": [
"binoculars",
"outline"
]
},
{
"name": "binoculars-sharp",
"tags": [
"binoculars",
"sharp"
]
},
{
"name": "bluetooth",
"tags": [
@@ -6034,6 +6173,13 @@
"logo"
]
},
{
"name": "logo-appflow",
"tags": [
"appflow",
"logo"
]
},
{
"name": "logo-apple",
"tags": [
@@ -6487,6 +6633,13 @@
"tableau"
]
},
{
"name": "logo-threads",
"tags": [
"logo",
"threads"
]
},
{
"name": "logo-tiktok",
"tags": [
@@ -6494,6 +6647,13 @@
"tiktok"
]
},
{
"name": "logo-trapeze",
"tags": [
"logo",
"trapeze"
]
},
{
"name": "logo-tumblr",
"tags": [
@@ -6519,7 +6679,8 @@
"name": "logo-twitter",
"tags": [
"logo",
"twitter"
"twitter",
"x"
]
},
{
@@ -6600,6 +6761,14 @@
"wordpress"
]
},
{
"name": "logo-x",
"tags": [
"logo",
"twitter",
"x"
]
},
{
"name": "logo-xbox",
"tags": [
@@ -7304,12 +7473,14 @@
{
"name": "notifications",
"tags": [
"bell",
"notifications"
]
},
{
"name": "notifications-circle",
"tags": [
"bell",
"circle",
"notifications"
]
@@ -7317,6 +7488,7 @@
{
"name": "notifications-circle-outline",
"tags": [
"bell",
"circle",
"notifications",
"outline"
@@ -7325,6 +7497,7 @@
{
"name": "notifications-circle-sharp",
"tags": [
"bell",
"circle",
"notifications",
"sharp"
@@ -7333,6 +7506,7 @@
{
"name": "notifications-off",
"tags": [
"bell",
"notifications",
"off"
]
@@ -7340,6 +7514,7 @@
{
"name": "notifications-off-circle",
"tags": [
"bell",
"circle",
"notifications",
"off"
@@ -7348,6 +7523,7 @@
{
"name": "notifications-off-circle-outline",
"tags": [
"bell",
"circle",
"notifications",
"off",
@@ -7357,6 +7533,7 @@
{
"name": "notifications-off-circle-sharp",
"tags": [
"bell",
"circle",
"notifications",
"off",
@@ -7366,6 +7543,7 @@
{
"name": "notifications-off-outline",
"tags": [
"bell",
"notifications",
"off",
"outline"
@@ -7374,6 +7552,7 @@
{
"name": "notifications-off-sharp",
"tags": [
"bell",
"notifications",
"off",
"sharp"
@@ -7382,6 +7561,7 @@
{
"name": "notifications-outline",
"tags": [
"bell",
"notifications",
"outline"
]
@@ -7389,6 +7569,7 @@
{
"name": "notifications-sharp",
"tags": [
"bell",
"notifications",
"sharp"
]
@@ -7445,10 +7626,10 @@
{
"name": "open",
"tags": [
"open",
"external",
"anchor",
"link"
"external",
"link",
"open"
]
},
{
@@ -7468,21 +7649,27 @@
{
"name": "options",
"tags": [
"options"
"filters",
"options",
"sliders"
]
},
{
"name": "options-outline",
"tags": [
"filters",
"options",
"outline"
"outline",
"sliders"
]
},
{
"name": "options-sharp",
"tags": [
"filters",
"options",
"sharp"
"sharp",
"sliders"
]
},
{
@@ -7653,6 +7840,7 @@
"name": "people-circle",
"tags": [
"circle",
"contacts",
"head",
"human",
"people",
@@ -7665,6 +7853,7 @@
"name": "people-circle-outline",
"tags": [
"circle",
"contacts",
"head",
"human",
"outline",
@@ -7678,6 +7867,7 @@
"name": "people-circle-sharp",
"tags": [
"circle",
"contacts",
"head",
"human",
"people",
+2
View File
@@ -1,2 +1,4 @@
export { setAssetPath } from '@stencil/core';
export { addIcons } from './components/icon/utils';
export type { Components, JSX } from './components';
+95
View File
@@ -0,0 +1,95 @@
{
"$schema": "http://json.schemastore.org/web-types",
"name": "ionicons",
"version": "0.0.0",
"description-markup": "markdown",
"contributions": {
"html": {
"elements": [
{
"name": "ion-icon",
"description": "The Ionicons Web Component is an easy and performant way to use Ionicons in your app. The component will dynamically load an SVG for each icon, so your app is only requesting the icons that you need.",
"doc-url": "https://ionic.io/ionicons/usage",
"attributes": [
{
"name": "name",
"description": "The name of the built-in icon from the Ionicons package.",
"priority": "high",
"doc-url": "https://ionic.io/ionicons/usage#basic-usage",
"value": {
"type": "symbol"
},
"values": [
{
"name": "The ion-icon",
"pattern": {
"items": "ionicons"
}
}
]
},
{
"name": "src",
"priority": "high",
"description": "Provide url of a custom SVG icon. The `src` attribute works the same as `<img src=\"...\">` in that the url must be accessible from the webpage that's making a request for the image. Additionally, the external file can only be a valid `svg` and does not allow scripts or events within the `svg` element.",
"doc-url": "https://ionic.io/ionicons/usage#basic-usage"
},
{
"name": "md",
"description": "Provide icon variant specific to MD platform",
"priority": "high",
"doc-url": "https://ionic.io/ionicons/usage#basic-usage",
"value": {
"type": "symbol"
},
"values": [
{
"name": "The ion-icon",
"pattern": {
"items": "ionicons"
}
}
]
},
{
"name": "ios",
"description": "Provide icon variant specific to iOS platform",
"priority": "high",
"doc-url": "https://ionic.io/ionicons/usage#basic-usage",
"value": {
"type": "symbol"
},
"values": [
{
"name": "The ion-icon",
"pattern": {
"items": "ionicons"
}
}
]
},
{
"name": "size",
"description": "Specify the icon size using one of the pre-defined font sizes.\n\nAlternatively you can set a specific size by applying the `font-size` CSS property on the `ion-icon` component. It's recommended to use pixel sizes that are a multiple of 8 (8, 16, 32, 64, etc.)",
"doc-url": "https://ionic.io/ionicons/usage#basic-usage",
"priority": "high",
"value": {
"type": "enum"
},
"values": [
{
"name": "small"
},
{
"name": "large"
}
]
}
]
}
],
"ionicons": [
]
}
}
}
+5
View File
@@ -0,0 +1,5 @@
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M123.636 269.236L123.636 90.5454C123.636 79.2617 128.119 68.4401 136.098 60.4613C144.076 52.4824 154.898 48 166.182 48L421.455 48C432.738 48 443.56 52.4824 451.539 60.4613C459.518 68.4401 464 79.2617 464 90.5454L464 345.818C464 357.102 459.518 367.924 451.539 375.902C443.56 383.881 432.738 388.364 421.455 388.364L242.764 388.364" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M48 331.636L48 464L180.364 464" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M296 216L48 464" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 761 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M32 480L32 315.636L64 315.636L64 425.373L107.636 381.736L107.636 404.364L130.264 404.364L86.6275 448L196.364 448L196.364 480L32 480ZM318.628 216L130.264 404.364L480 404.364L480 32L107.636 31.9999L107.636 381.736L296 193.373L318.628 216Z" />
</svg>

After

Width:  |  Height:  |  Size: 385 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M180.364 480L48 480C43.7565 480 39.6869 478.314 36.6863 475.314C33.6857 472.313 32 468.244 32 464V331.636C32 322.8 39.1635 315.636 48 315.636C56.8365 315.636 64 322.8 64 331.636V425.373L115.128 374.245C117.747 378.961 121.028 383.333 124.911 387.216C128.749 391.054 133.065 394.304 137.719 396.908L86.6274 448L180.364 448C189.2 448 196.364 455.163 196.364 464C196.364 472.837 189.2 480 180.364 480ZM137.719 396.908C146.379 401.754 156.21 404.364 166.309 404.364L421.455 404.364C436.982 404.364 451.873 398.195 462.852 387.216C473.832 376.237 480 361.345 480 345.818L480 90.5454C480 75.0182 473.832 60.1269 462.852 49.1475C451.873 38.1681 436.982 32 421.455 32L166.182 32C150.655 32 135.763 38.1681 124.784 49.1475C113.805 60.1269 107.636 75.0182 107.636 90.5454L107.636 345.818C107.636 346.626 107.696 347.42 107.812 348.196C108.185 357.394 110.72 366.307 115.128 374.245L284.686 204.686C290.935 198.438 301.065 198.438 307.314 204.686C313.562 210.935 313.562 221.065 307.314 227.314L137.719 396.908Z" />
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

+5
View File
@@ -0,0 +1,5 @@
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M269.236 388.364L90.5454 388.364C79.2617 388.364 68.4401 383.881 60.4612 375.902C52.4824 367.924 48 357.102 48 345.818L48 90.5454C48 79.2617 52.4824 68.4401 60.4613 60.4613C68.4401 52.4824 79.2617 48 90.5454 48L345.818 48C357.102 48 367.924 52.4825 375.902 60.4613C383.881 68.4401 388.364 79.2617 388.364 90.5455L388.364 269.236" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M331.636 464L464 464L464 331.636" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M216 216L464 464" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 762 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M480 480L315.636 480V448L425.373 448L381.736 404.364H404.364V381.736L448 425.372L448 315.636H480L480 480ZM216 193.372L404.364 381.736L404.364 31.9999L32.0001 31.9999V404.364H381.736L193.373 216L216 193.372Z" />
</svg>

After

Width:  |  Height:  |  Size: 355 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M480 331.636L480 464C480 468.243 478.314 472.313 475.314 475.314C472.313 478.314 468.243 480 464 480H331.636C322.8 480 315.636 472.837 315.636 464C315.636 455.163 322.8 448 331.636 448H425.373L374.245 396.872C378.961 394.253 383.333 390.972 387.216 387.089C391.054 383.251 394.304 378.935 396.908 374.281L448 425.373L448 331.636C448 322.8 455.163 315.636 464 315.636C472.837 315.636 480 322.8 480 331.636ZM396.908 374.281C401.754 365.621 404.364 355.79 404.364 345.691V90.5455C404.364 75.0182 398.195 60.127 387.216 49.1476C376.237 38.1682 361.345 32 345.818 32L90.5454 32C75.0182 32 60.1269 38.1682 49.1475 49.1476C38.1681 60.127 31.9999 75.0182 31.9999 90.5455V345.818C31.9999 361.345 38.1681 376.237 49.1475 387.216C60.1269 398.195 75.0182 404.364 90.5454 404.364H345.818C346.626 404.364 347.42 404.304 348.196 404.188C357.394 403.815 366.307 401.28 374.245 396.872L204.686 227.314C198.438 221.065 198.438 210.935 204.686 204.686C210.935 198.438 221.065 198.438 227.314 204.686L396.908 374.281Z" />
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

+5
View File
@@ -0,0 +1,5 @@
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M242.764 123.636L421.455 123.636C432.738 123.636 443.56 128.119 451.539 136.098C459.518 144.076 464 154.898 464 166.182L464 421.455C464 432.738 459.518 443.56 451.539 451.539C443.56 459.518 432.738 464 421.455 464L166.182 464C154.898 464 144.076 459.518 136.098 451.539C128.119 443.56 123.636 432.738 123.636 421.455L123.636 242.764" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M180.364 48L47.9999 48L48 180.364" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M296 296L48 48" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 765 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M32.0001 31.9999L196.364 32L196.364 64L86.6274 63.9999L130.264 107.636H107.636V130.264L64.0001 86.6275L64.0001 196.364H32.0001L32.0001 31.9999ZM296 318.627L107.636 130.264L107.636 480L480 480L480 107.636L130.264 107.636L318.628 296L296 318.627Z" />
</svg>

After

Width:  |  Height:  |  Size: 393 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M32 180.364L32 48C32 43.7565 33.6857 39.6869 36.6862 36.6863C39.6868 33.6857 43.7565 32 48 32H180.364C189.2 32 196.364 39.1635 196.364 48C196.364 56.8365 189.2 64 180.364 64H86.6274L137.755 115.128C133.039 117.747 128.667 121.028 124.784 124.911C120.946 128.749 117.696 133.065 115.092 137.719L64 86.6274L64 180.364C64 189.2 56.8365 196.364 48 196.364C39.1634 196.364 32 189.2 32 180.364ZM115.092 137.719C110.246 146.379 107.636 156.21 107.636 166.309L107.636 421.455C107.636 436.982 113.805 451.873 124.784 462.852C135.763 473.832 150.655 480 166.182 480H421.455C436.982 480 451.873 473.832 462.852 462.852C473.832 451.873 480 436.982 480 421.455V166.182C480 150.655 473.832 135.763 462.852 124.784C451.873 113.805 436.982 107.636 421.455 107.636H166.182C165.374 107.636 164.58 107.696 163.804 107.812C154.606 108.185 145.693 110.72 137.755 115.128L307.314 284.686C313.562 290.935 313.562 301.065 307.314 307.314C301.065 313.562 290.935 313.562 284.686 307.314L115.092 137.719Z" />
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

+5
View File
@@ -0,0 +1,5 @@
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M388.364 242.764V421.455C388.364 432.738 383.881 443.56 375.902 451.539C367.924 459.518 357.102 464 345.818 464H90.5455C79.2617 464 68.4401 459.518 60.4613 451.539C52.4825 443.56 48 432.738 48 421.455V166.182C48 154.898 52.4825 144.076 60.4613 136.098C68.4401 128.119 79.2617 123.636 90.5455 123.636H269.236" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M464 180.364L464 48L331.636 48" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M216 296L464 48" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 738 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M480 31.9999L480 196.364H448L448 86.6273L404.364 130.264V107.636H381.736L425.373 63.9999L315.636 64V32L480 31.9999ZM193.373 296L381.736 107.636L32 107.636L32 480H404.364V130.264L216 318.627L193.373 296Z" />
</svg>

After

Width:  |  Height:  |  Size: 351 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M331.636 32L464 32C468.243 32 472.313 33.6857 475.314 36.6863C478.314 39.6868 480 43.7565 480 48V180.364C480 189.2 472.837 196.364 464 196.364C455.163 196.364 448 189.2 448 180.364V86.6274L396.872 137.755C394.253 133.039 390.972 128.667 387.089 124.784C383.251 120.946 378.935 117.696 374.281 115.092L425.373 64L331.636 64C322.8 64 315.636 56.8365 315.636 48C315.636 39.1634 322.8 32 331.636 32ZM374.281 115.092C365.621 110.246 355.79 107.636 345.691 107.636H90.5455C75.0182 107.636 60.127 113.805 49.1476 124.784C38.1682 135.763 32 150.655 32 166.182V421.455C32 436.982 38.1682 451.873 49.1476 462.852C60.127 473.832 75.0182 480 90.5455 480H345.818C361.345 480 376.237 473.832 387.216 462.852C398.195 451.873 404.364 436.982 404.364 421.455V166.182C404.364 165.374 404.304 164.58 404.188 163.804C403.815 154.606 401.28 145.693 396.872 137.755L227.314 307.314C221.065 313.562 210.935 313.562 204.686 307.314C198.438 301.065 198.438 290.935 204.686 284.686L374.281 115.092Z" />
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

+8
View File
@@ -0,0 +1,8 @@
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="392" cy="344" r="88" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="120" cy="344" r="88" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M208 344V128C208 101.5 192 80 164 80C129 80 117.5 101.5 107 128C107 128 58.5 255.833 36 317.5" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M208 184C208 184 224.5 176 256 176C287.5 176 304 184 304 184" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M208 272C208 272 224.5 264 256 264C287.5 264 304 272 304 272" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M304 344V128C304 101.5 320 80 348 80C383 80 394.5 101.5 405 128C405 128 453.5 255.833 476 317.5" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1017 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M164 64C142.711 64 126.817 70.7578 114.917 82.8311C103.846 94.0643 97.3707 108.867 92.1251 122.106L23.2827 305.692C22.6101 307.388 21.5537 310.277 20.9692 312.016C20.7194 312.701 20.5192 313.392 20.3669 314.084C17.5262 323.559 16 333.601 16 344C16 401.438 62.5624 448 120 448C177.438 448 224 401.438 224 344V283.539L224.04 283.529L288 283.539V343.886L288 344C288 401.438 334.562 448 392 448C449.438 448 496 401.438 496 344C496 333.601 494.474 323.559 491.633 314.085C491.308 313 488.718 305.693 488.718 305.693L420.511 123.778L419.875 122.106C414.629 108.867 408.155 94.0643 397.083 82.8311C385.183 70.7578 369.289 64 348 64C329.564 64 314.066 71.239 303.389 83.6068C292.943 95.7067 288 111.638 288 128V162.809L224 162.809V128C224 111.638 219.057 95.7067 208.611 83.6068C197.934 71.239 182.436 64 164 64ZM56 344C56 308.654 84.6538 280 120 280C155.346 280 184 308.654 184 344C184 379.346 155.346 408 120 408C84.6538 408 56 379.346 56 344ZM328 344C328 308.654 356.654 280 392 280C427.346 280 456 308.654 456 344C456 379.346 427.346 408 392 408C356.654 408 328 379.346 328 344Z" />
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

+3
View File
@@ -0,0 +1,3 @@
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M114.917 82.8311C126.817 70.7578 142.711 64 164 64C182.436 64 197.934 71.239 208.611 83.6068C219.057 95.7067 224 111.638 224 128V162.809C232.45 161.226 243.147 160 256 160C268.853 160 279.55 161.226 288 162.809V128C288 111.638 292.943 95.7067 303.389 83.6068C314.066 71.239 329.564 64 348 64C369.289 64 385.183 70.7578 397.083 82.8311C408.155 94.0643 414.629 108.867 419.875 122.106L420.511 123.778L488.718 305.693C488.718 305.693 491.308 313 491.633 314.085C494.474 323.559 496 333.601 496 344C496 401.438 449.438 448 392 448C334.562 448 288 401.438 288 344C288 343.962 288 343.924 288 343.886V283.539C287.987 283.536 287.974 283.533 287.96 283.529C281.089 281.825 270.382 280 256 280C241.618 280 230.911 281.825 224.04 283.529L224 283.539V344C224 401.438 177.438 448 120 448C62.5624 448 16 401.438 16 344C16 333.601 17.5262 323.559 20.3669 314.084C20.5192 313.392 20.7194 312.701 20.9692 312.016C21.5537 310.277 22.6101 307.388 23.2827 305.692L92.1251 122.106C97.3707 108.867 103.846 94.0643 114.917 82.8311ZM320 343.905C320.051 304.184 352.267 272 392 272C422.372 272 448.352 290.806 458.93 317.408C459.392 318.668 459.845 319.905 460.288 321.118C462.696 328.307 464 336.001 464 344C464 383.764 431.764 416 392 416C352.249 416 320.022 383.786 320 344.04C320 344.027 320 344.013 320 344M120 272C89.6287 272 63.6495 290.805 53.0706 317.406C52.6085 318.667 52.1552 319.906 51.7115 321.12C49.3042 328.308 48 336.002 48 344C48 383.764 80.2355 416 120 416C159.764 416 192 383.764 192 344C192 304.236 159.764 272 120 272Z" />
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

+1 -1
View File
@@ -1 +1 @@
<svg id="icons" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><circle cx="256" cy="256" r="208" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width="32"/><circle cx="288" cy="200" r="24"/><circle cx="296" cy="128" r="24"/><circle cx="360" cy="168" r="24"/></svg>
<svg id="icons" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><circle cx="256" cy="256" r="208" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width="32"/><circle cx="288" cy="200" r="24" fill="currentColor"/><circle cx="296" cy="128" r="24" fill="currentColor"/><circle cx="360" cy="168" r="24" fill="currentColor"/></svg>

Before

Width:  |  Height:  |  Size: 283 B

After

Width:  |  Height:  |  Size: 343 B

+1 -1
View File
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><circle cx="256" cy="256" r="26"/><circle cx="346" cy="256" r="26"/><circle cx="166" cy="256" r="26"/><path d="M448,256c0-106-86-192-192-192S64,150,64,256s86,192,192,192S448,362,448,256Z" style="fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M256,48C141.13,48,48,141.13,48,256s93.13,208,208,208,208-93.13,208-208S370.87,48,256,48ZM166,282a26,26,0,1,1,26-26A26,26,0,0,1,166,282Zm90,0a26,26,0,1,1,26-26A26,26,0,0,1,256,282Zm90,0a26,26,0,1,1,26-26A26,26,0,0,1,346,282Z"/></svg>

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 328 B

+1 -1
View File
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><circle cx="256" cy="256" r="26"/><circle cx="256" cy="346" r="26"/><circle cx="256" cy="166" r="26"/><path d="M448,256c0-106-86-192-192-192S64,150,64,256s86,192,192,192S448,362,448,256Z" style="fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M464,256c0-114.87-93.13-208-208-208S48,141.13,48,256s93.13,208,208,208S464,370.87,464,256ZM230,166a26,26,0,1,1,26,26A26,26,0,0,1,230,166Zm0,90a26,26,0,1,1,26,26A26,26,0,0,1,230,256Zm0,90a26,26,0,1,1,26,26A26,26,0,0,1,230,346Z"/></svg>

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 330 B

+1 -1
View File
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M248,64C146.39,64,64,146.39,64,248s82.39,184,184,184,184-82.39,184-184S349.61,64,248,64Z" style="fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px"/><polyline points="220 220 252 220 252 336" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><line x1="208" y1="340" x2="296" y2="340" style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/><path d="M248,130a26,26,0,1,0,26,26A26,26,0,0,0,248,130Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M248,64C146.39,64,64,146.39,64,248s82.39,184,184,184,184-82.39,184-184S349.61,64,248,64Z" style="fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px"/><polyline points="220 220 252 220 252 336" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><line x1="208" y1="340" x2="296" y2="340" style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/><path d="M248,130a26,26,0,1,0,26,26A26,26,0,0,0,248,130Z" fill="currentColor"/></svg>

Before

Width:  |  Height:  |  Size: 589 B

After

Width:  |  Height:  |  Size: 609 B

+4
View File
@@ -0,0 +1,4 @@
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path d="M198.626 28.4235L8.00006 484.424H122.376L256 164.779L389.624 484.424H504L313.374 28.4235H198.626Z" />
<path d="M312 346.039C312 376.967 286.928 402.039 256 402.039C225.072 402.039 200 376.967 200 346.039C200 315.111 225.072 290.039 256 290.039C286.928 290.039 312 315.111 312 346.039Z" />
</svg>

After

Width:  |  Height:  |  Size: 393 B

+3 -1
View File
@@ -1 +1,3 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M494.07,281.6l-25.18-78.08a11,11,0,0,0-.61-2.1L417.78,44.48a20.08,20.08,0,0,0-19.17-13.82A19.77,19.77,0,0,0,379.66,44.6L331.52,194.15h-152L131.34,44.59a19.76,19.76,0,0,0-18.86-13.94h-.11a20.15,20.15,0,0,0-19.12,14L42.7,201.73c0,.14-.11.26-.16.4L16.91,281.61a29.15,29.15,0,0,0,10.44,32.46L248.79,476.48a11.25,11.25,0,0,0,13.38-.07L483.65,314.07a29.13,29.13,0,0,0,10.42-32.47m-331-64.51L224.8,408.85,76.63,217.09m209.64,191.8,59.19-183.84,2.55-8h86.52L300.47,390.44M398.8,59.31l43.37,134.83H355.35M324.16,217l-43,133.58L255.5,430.14,186.94,217M112.27,59.31l43.46,134.83H69M40.68,295.58a6.19,6.19,0,0,1-2.21-6.9l19-59L197.08,410.27M470.34,295.58,313.92,410.22l.52-.69L453.5,229.64l19,59a6.2,6.2,0,0,1-2.19,6.92"/></svg>
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path d="M488.028 207.68L487.354 205.949L422.019 34.7949C420.69 31.4404 418.336 28.5947 415.296 26.6663C412.254 24.7705 408.705 23.8575 405.129 24.0504C401.554 24.2433 398.123 25.5329 395.301 27.7451C392.51 30.0207 390.485 33.1043 389.502 36.5762L345.388 172.054H166.756L122.641 36.5762C121.685 33.0854 119.655 29.9864 116.843 27.72C114.02 25.5078 110.59 24.2182 107.014 24.0253C103.438 23.8324 99.8898 24.7454 96.8475 26.6412C93.8139 28.5774 91.4622 31.4206 90.1241 34.7698L24.6648 205.848L24.015 207.579C14.6098 232.246 13.4489 259.314 20.7073 284.701C27.9656 310.089 43.2498 332.419 64.2553 348.326L64.4803 348.501L65.0801 348.928L164.606 423.742L213.844 461.149L243.837 483.879C247.345 486.553 251.629 488 256.034 488C260.439 488 264.723 486.553 268.231 483.879L298.224 461.149L347.462 423.742L447.588 348.476L447.838 348.276C468.796 332.366 484.045 310.059 491.292 284.706C498.54 259.353 497.394 232.323 488.028 207.68Z" />
</svg>

Before

Width:  |  Height:  |  Size: 820 B

After

Width:  |  Height:  |  Size: 1.0 KiB

+6 -1
View File
@@ -1 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M256,153.9A102.1,102.1,0,1,0,358.1,256,102.23,102.23,0,0,0,256,153.9Z"/><circle cx="402.59" cy="116.45" r="46.52"/><path d="M459.86,163.2l-1.95-4.28-3.11,3.52a70,70,0,0,1-28.06,19.32l-3,1.1,1.22,2.93A181.43,181.43,0,0,1,439,256c0,100.92-82.1,183-183,183S73,356.92,73,256,155.08,73,256,73a180.94,180.94,0,0,1,78.43,17.7L337.3,92l1.25-2.92A70.19,70.19,0,0,1,359.21,62l3.67-2.93L358.71,57A221.61,221.61,0,0,0,256,32C132.49,32,32,132.49,32,256S132.49,480,256,480,480,379.51,480,256A222.19,222.19,0,0,0,459.86,163.2Z"/></svg>
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path d="M73.5999 256C73.5999 155.263 155.263 73.6 256 73.6C296.552 73.6 333.992 86.8115 364.286 109.203C372.232 90.5013 388.244 76.0537 407.956 70.227C366.589 36.3569 313.656 16 256 16C123.451 16 16 123.452 16 256C16 388.548 123.451 496 256 496C388.548 496 495.999 388.548 495.999 256C495.999 228.259 491.281 201.573 482.592 176.731C470.768 192.716 452.164 203.38 431.028 204.473C435.823 220.792 438.399 238.078 438.399 256C438.399 356.737 356.736 438.4 256 438.4C155.263 438.4 73.5999 356.737 73.5999 256Z" />
<path d="M491.065 207.374C488.908 196.899 486.068 186.667 482.592 176.731C470.769 192.715 452.164 203.38 431.028 204.473C434.42 216.016 436.702 228.043 437.747 240.437C460.006 237.7 479.247 225.211 491.065 207.374Z" />
<path d="M256 361.001C313.853 361.001 361 313.944 361 256.001C361 198.147 313.943 151.001 256 151.001C198.057 151.001 151 198.147 151 256.001C151 313.854 198.147 361.001 256 361.001Z" />
<path d="M413.5 166C442.495 166 466 142.495 466 113.5C466 84.5055 442.495 61.0004 413.5 61.0004C384.505 61.0004 361 84.5055 361 113.5C361 142.495 384.505 166 413.5 166Z" />
</svg>

Before

Width:  |  Height:  |  Size: 616 B

After

Width:  |  Height:  |  Size: 1.2 KiB

+2
View File
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 512 512"><g><g id="Layer_1"><path d="M363.2,239.6c-1.9-.9-3.9-1.8-5.9-2.7-3.5-63.7-38.3-100.2-96.7-100.6-.3,0-.5,0-.8,0-35,0-64,14.9-81.9,42.1l32.2,22.1c13.4-20.3,34.4-24.6,49.8-24.6s.4,0,.5,0c19.2.1,33.8,5.7,43.2,16.6,6.8,7.9,11.4,18.9,13.7,32.8-17.1-2.9-35.5-3.8-55.3-2.7-55.6,3.2-91.3,35.6-88.9,80.7,1.2,22.8,12.6,42.5,32,55.3,16.4,10.9,37.6,16.2,59.6,15,29.1-1.6,51.9-12.7,67.8-33,12.1-15.4,19.7-35.4,23.1-60.5,13.9,8.4,24.1,19.4,29.8,32.6,9.6,22.5,10.2,59.4-19.9,89.5-26.4,26.4-58.2,37.8-106.1,38.2-53.2-.4-93.5-17.5-119.6-50.7-24.5-31.2-37.2-76.1-37.6-133.7.5-57.6,13.1-102.6,37.6-133.7,26.2-33.3,66.4-50.3,119.6-50.7,53.6.4,94.6,17.5,121.7,51,13.3,16.4,23.4,37,30,61l37.7-10.1c-8-29.6-20.7-55.1-37.8-76.2-34.8-42.9-85.8-64.8-151.4-65.3h-.3c-65.5.5-115.9,22.5-149.7,65.5-30.1,38.3-45.6,91.6-46.2,158.3v.2s0,.2,0,.2c.5,66.8,16.1,120,46.2,158.3,33.8,43,84.2,65.1,149.7,65.5h.3c58.2-.4,99.3-15.7,133.1-49.4,44.2-44.2,42.9-99.6,28.3-133.6-10.5-24.4-30.4-44.2-57.7-57.3ZM262.6,334.2c-24.4,1.4-49.7-9.6-50.9-33-.9-17.4,12.4-36.7,52.4-39,4.6-.3,9.1-.4,13.5-.4,14.5,0,28.2,1.4,40.5,4.1-4.6,57.6-31.7,67-55.5,68.3Z"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

+3
View File
@@ -0,0 +1,3 @@
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path d="M311.05 189.26C311.069 189.229 311.087 189.198 311.105 189.167L376.085 78.5494L257.923 8L192.943 118.617C192.911 118.672 192.879 118.726 192.847 118.781L8 433.451L126.162 504L212.11 357.688C226.722 375.306 244.503 390.762 265.218 403.13L434.022 503.915L504 384.789L335.197 284.004C302.598 264.541 291.801 222.142 311.05 189.26Z" />
</svg>

After

Width:  |  Height:  |  Size: 436 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.33349 6.92867L14.5459 1H13.3109L8.78291 6.14671L5.16908 1H1L6.46604 8.78342L1 15H2.235L7.01369 9.56363L10.8309 15H15L9.33349 6.92867ZM7.64142 8.85175L7.08675 8.07621L2.68037 1.91103H4.57759L8.13472 6.88838L8.68705 7.66391L13.3103 14.1334H11.4131L7.64142 8.85175Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 394 B

+3 -1
View File
@@ -1 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M410.32,37.13c-13.56,0-27-.93-39.12-5.13L256,218.67,140.8,32c-12.12,4.2-24.84,5.13-38.4,5.13C89.08,37.13,75.88,36.08,64,32L217.6,280.15V480c12-4.08,25-5.13,38.4-5.13s26.4,1.05,38.4,5.13V280.5L448,32C436.12,36,423.64,37.13,410.32,37.13Z"/></svg>
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path d="M0 139.009H97.6482L154.508 284.738L212.108 139.009H307.174L164.022 484H68.3374L107.526 392.583L0.00302391 139.009H0ZM417.5 256H311L405.907 28L512 28.0045L417.5 256ZM339.292 277.221C371.964 277.221 398.448 303.754 398.448 336.479C398.448 369.206 371.964 395.739 339.292 395.739C306.625 395.739 280.146 369.206 280.146 336.479C280.146 303.754 306.629 277.221 339.292 277.221Z" />
</svg>

Before

Width:  |  Height:  |  Size: 340 B

After

Width:  |  Height:  |  Size: 482 B

+5 -1
View File
@@ -1 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><ellipse cx="256" cy="128" rx="192" ry="80" style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/><path d="M448,214c0,44.18-86,80-192,80S64,258.18,64,214" style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/><path d="M448,300c0,44.18-86,80-192,80S64,344.18,64,300" style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/><path d="M64,127.24V384.76C64,428.52,150,464,256,464s192-35.48,192-79.24V127.24" style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/></svg>
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<ellipse cx="256" cy="112" rx="176" ry="80" stroke="currentColor" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M432 112C432 112 432 376.055 432 400C432 444.183 353.202 480 256 480C158.798 480 80 444.183 80 400C80 378.169 80 112 80 112" stroke="currentColor" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M432 256C432 300.183 353.202 336 256 336C158.798 336 80 300.183 80 256" stroke="currentColor" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 696 B

After

Width:  |  Height:  |  Size: 633 B

+5 -1
View File
@@ -1 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M409.43,389.87C362,410,305.4,421.05,256,421.05s-105.87-11.3-153.44-31.18S48,353.16,48,353.16v38.2c0,31.15,18,43.64,67.32,64.35C153.13,471.59,203.18,480,256,480s102.87-8.41,140.68-24.29C446,435,464,422.51,464,391.36v-38.2S456.86,369.75,409.43,389.87Z"/><path d="M63.69,173.22c11.23,9.84,27.82,19.49,48,27.92,42.48,17.76,96.45,28.37,144.36,28.37s101.88-10.61,144.36-28.37c20.13-8.43,36.72-18.08,47.95-27.92,6.06-5.31,10.85-10.12,13.47-12.85a8,8,0,0,0,2.22-5.54l0-26.06v-.1c-.84-28.79-24.71-54.41-67.21-72.14C358.83,40.71,308.84,32,256,32S153.17,40.71,115.26,56.53C72.85,74.22,49,99.78,48.05,128.5l0,26.33a8,8,0,0,0,2.21,5.54C52.84,163.1,57.62,167.91,63.69,173.22Z"/><path d="M409.43,221.91C365,241,305.4,253.09,256,253.09s-108.87-12.27-153.43-31.18S48,185.2,48,185.2v47.36c.08,7.52,5.5,16.2,15.69,25.13,11.24,9.84,27.82,19.5,48,27.92C154.12,303.38,208.09,314,256,314s101.88-10.6,144.36-28.37c20.13-8.42,36.72-18.08,47.95-27.92,10.25-9,15.68-17.71,15.69-25.27V185.2S453.87,202.82,409.43,221.91Z"/><path d="M409.43,306.38C362,326,305.4,337.56,256,337.56s-109.87-12.8-153.43-31.18S48,269.67,48,269.67v46.25c0,7.55,5.44,16.28,15.69,25.26,11.23,9.84,27.81,19.5,48,27.92,42.48,17.77,96.44,28.37,144.36,28.37s101.88-10.6,144.36-28.37c20.13-8.43,36.72-18.08,47.95-27.92,10.19-8.93,15.61-17.61,15.69-25.13V269.67S456.87,286.76,409.43,306.38Z"/></svg>
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path d="M125.295 40.7282C159.804 25.1587 206.27 16 256.5 16C306.73 16 352.966 25.1588 387.248 40.7476C420.143 55.7056 448 80 448 112V112.03C447.989 117.563 444.902 125.92 435.705 136.25C426.71 146.352 413.088 156.908 395.432 166.514C360.162 185.702 310.794 200 256 200C201.206 200 151.838 185.702 116.568 166.514C98.9116 156.908 85.2901 146.352 76.2953 136.25C67.0809 125.901 64 117.532 64 112C64 79.5721 92.2455 55.6392 125.295 40.7282Z" />
<path d="M410.724 194.623C424.937 186.892 437.558 176.244 448 165.024V258C448 263.532 444.919 269.901 435.705 280.25C426.71 290.352 413.088 300.908 395.432 310.514C360.162 329.702 310.794 344 256 344C201.206 344 151.838 329.702 116.568 310.514C98.9116 300.908 85.2901 290.352 76.2953 280.25C67.0809 269.901 64 263.532 64 258V165.024C74.4417 176.244 87.0634 186.892 101.276 194.623C141.286 216.39 195.918 232 256 232C316.082 232 370.714 216.39 410.724 194.623Z" />
<path d="M64 309.024V400C64 432.224 92.0043 456.169 124.928 471.134C159.297 486.756 205.653 496 256 496C306.347 496 352.703 486.756 387.072 471.134C419.996 456.169 448 432.224 448 400V309.024C437.558 320.244 424.937 330.892 410.724 338.623C370.714 360.39 316.082 376 256 376C195.918 376 141.286 360.39 101.276 338.623C87.0634 330.892 74.4417 320.244 64 309.024Z" />
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

+5 -1
View File
@@ -1 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M256,428C203.65,428,144.61,416.39,98.07,397,81,389.81,66.38,378.18,54.43,369A4,4,0,0,0,48,372.18v12.58c0,28.07,23.49,53.22,66.14,70.82C152.29,471.33,202.67,480,256,480s103.7-8.67,141.86-24.42C440.51,438,464,412.83,464,384.76V372.18a4,4,0,0,0-6.43-3.18C445.62,378.17,431,389.81,413.92,397,367.38,416.39,308.35,428,256,428Z"/><path d="M464,126.51c-.81-27.65-24.18-52.4-66-69.85C359.74,40.76,309.34,32,256,32S152.26,40.76,114.09,56.66c-41.78,17.41-65.15,42.11-66,69.69L48,144c0,6.41,5.2,16.48,14.63,24.73,11.13,9.73,27.65,19.33,47.78,27.73C153.24,214.36,207.67,225,256,225s102.76-10.68,145.59-28.58c20.13-8.4,36.65-18,47.78-27.73C458.8,160.49,464,150.42,464,144Z"/><path d="M413.92,226C367.39,245.43,308.35,257,256,257S144.61,245.43,98.07,226C81,218.85,66.38,207.21,54.43,198A4,4,0,0,0,48,201.22V232c0,6.41,5.2,14.48,14.63,22.73,11.13,9.74,27.65,19.33,47.78,27.74C153.24,300.34,207.67,311,256,311s102.76-10.68,145.59-28.57c20.13-8.41,36.65-18,47.78-27.74C458.8,246.47,464,238.41,464,232V201.22a4,4,0,0,0-6.43-3.18C445.62,207.21,431,218.85,413.92,226Z"/><path d="M413.92,312C367.38,331.41,308.35,343,256,343S144.61,331.41,98.07,312C81,304.83,66.38,293.19,54.43,284A4,4,0,0,0,48,287.2V317c0,6.41,5.2,14.47,14.62,22.71,11.13,9.74,27.66,19.33,47.79,27.74C153.24,385.32,207.66,396,256,396s102.76-10.68,145.59-28.57c20.13-8.41,36.65-18,47.78-27.74C458.8,331.44,464,323.37,464,317V287.2a4,4,0,0,0-6.43-3.18C445.62,293.19,431,304.83,413.92,312Z"/></svg>
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path d="M125.295 40.7282C159.804 25.1587 206.27 16 256.5 16C306.73 16 352.966 25.1588 387.248 40.7476C420.143 55.7056 448 80 448 112V112.03C447.989 117.563 444.902 125.92 435.705 136.25C426.71 146.352 413.088 156.908 395.432 166.514C360.162 185.702 310.794 200 256 200C201.206 200 151.838 185.702 116.568 166.514C98.9116 156.908 85.2901 146.352 76.2953 136.25C67.0809 125.901 64 117.532 64 112C64 79.5721 92.2455 55.6392 125.295 40.7282Z" />
<path d="M410.724 194.623C420.31 189.409 429.172 182.868 437.13 175.719C441.184 172.077 448 174.829 448 180.279V258C448 263.532 444.919 269.901 435.705 280.25C426.71 290.352 413.088 300.908 395.432 310.514C360.162 329.702 310.794 344 256 344C201.206 344 151.838 329.702 116.568 310.514C98.9116 300.908 85.2901 290.352 76.2953 280.25C67.0809 269.901 64 263.532 64 258V180.279C64 174.829 70.8158 172.077 74.8702 175.719C82.8279 182.867 91.69 189.409 101.276 194.623C141.286 216.39 195.918 232 256 232C316.082 232 370.714 216.39 410.724 194.623Z" />
<path d="M74.8702 319.719C70.8158 316.077 64 318.829 64 324.279V400C64 432.224 92.0043 456.169 124.928 471.134C159.297 486.756 205.653 496 256 496C306.347 496 352.703 486.756 387.072 471.134C419.996 456.169 448 432.224 448 400V324.279C448 318.829 441.184 316.077 437.13 319.719C429.172 326.867 420.31 333.409 410.724 338.623C370.714 360.39 316.082 376 256 376C195.918 376 141.286 360.39 101.276 338.623C91.69 333.409 82.8279 326.867 74.8702 319.719Z" />
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

+1 -1
View File
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M85.57,446.25H426.43a32,32,0,0,0,28.17-47.17L284.18,82.58c-12.09-22.44-44.27-22.44-56.36,0L57.4,399.08A32,32,0,0,0,85.57,446.25Z" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M250.26,195.39l5.74,122,5.73-121.95a5.74,5.74,0,0,0-5.79-6h0A5.74,5.74,0,0,0,250.26,195.39Z" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M256,397.25a20,20,0,1,1,20-20A20,20,0,0,1,256,397.25Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M85.57,446.25H426.43a32,32,0,0,0,28.17-47.17L284.18,82.58c-12.09-22.44-44.27-22.44-56.36,0L57.4,399.08A32,32,0,0,0,85.57,446.25Z" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M250.26,195.39l5.74,122,5.73-121.95a5.74,5.74,0,0,0-5.79-6h0A5.74,5.74,0,0,0,250.26,195.39Z" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M256,397.25a20,20,0,1,1,20-20A20,20,0,0,1,256,397.25Z" fill="currentColor"/></svg>

Before

Width:  |  Height:  |  Size: 583 B

After

Width:  |  Height:  |  Size: 603 B

+5 -1
View File
@@ -1 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M332.41,310.59a115,115,0,0,0-152.8,0" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M393.46,249.54a201.26,201.26,0,0,0-274.92,0" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M447.72,182.11a288,288,0,0,0-383.44,0" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M256,416a32,32,0,1,1,32-32A32,32,0,0,1,256,416Z"/></svg>
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M318.586 363.5L256 424L193.414 363.5C193.414 363.5 212 336 256 336C300 336 318.586 363.5 318.586 363.5Z" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M407.31 278L372 312C372 312 331 266 256 266C181 266 140 312 140 312L104.69 278C104.69 278 142.5 214 256 214C369.5 214 407.31 278 407.31 278Z" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M496 192L459.31 227.5C459.31 227.5 386.5 141 256 141C125.5 141 52.6897 227.5 52.6897 227.5L16 192C16 192 88 88 256 88C424 88 496 192 496 192Z" stroke="black" stroke-width="32" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 577 B

After

Width:  |  Height:  |  Size: 770 B

+5 -1
View File
@@ -1 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M332.69,320a115,115,0,0,0-152.8,0" style="fill:none;stroke:#000;stroke-linecap:square;stroke-linejoin:round;stroke-width:42px"/><path d="M393.74,259a201.26,201.26,0,0,0-274.92,0" style="fill:none;stroke:#000;stroke-linecap:square;stroke-linejoin:round;stroke-width:42px"/><path d="M448,191.52a288,288,0,0,0-383.44,0" style="fill:none;stroke:#000;stroke-linecap:square;stroke-linejoin:round;stroke-width:42px"/><path d="M300.67,384,256,433l-44.34-49a56.73,56.73,0,0,1,88.92,0Z"/></svg>
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M337.78 362.819C333.534 354.366 326.706 347.132 325.179 345.509C322.129 342.268 317.644 338.112 311.59 334.004C299.362 325.705 281.02 317.813 256 317.813C230.98 317.813 212.638 325.705 200.41 334.004C194.356 338.112 189.871 342.268 186.821 345.509C185.294 347.132 184.116 348.537 183.273 349.606C182.851 350.141 178.966 354.366 174.22 362.819L256 442L337.78 362.819Z" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M425.25 279.287C425.25 279.287 417.255 269.058 409.547 260.359C403.564 253.606 391.447 242.649 378.646 233.982C352.884 216.538 314.749 198.905 256 198.905C197.251 198.905 159.116 216.538 133.354 233.982C120.553 242.649 112.519 249.455 104.485 258.154C96.451 266.854 86.7496 279.287 86.7496 279.287L143.384 333.878L154.421 321.49C154.446 321.463 154.509 321.395 154.608 321.289C154.808 321.078 155.157 320.716 155.652 320.224C156.643 319.24 158.218 317.742 160.361 315.898C164.655 312.205 171.184 307.165 179.834 302.094C197.103 291.97 222.709 281.78 256 281.78C289.291 281.78 314.897 291.97 332.166 302.094C340.816 307.165 347.345 312.205 351.639 315.898C353.782 317.742 355.357 319.24 356.348 320.224C356.843 320.716 357.192 321.078 357.392 321.289C357.491 321.395 357.554 321.462 357.579 321.49C357.591 321.504 357.595 321.507 357.588 321.5L368.616 333.878L425.25 279.287Z" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M512 195.36C512 195.36 507.5 187 500.15 178.875C495.759 174.02 493.931 171.469 488.995 166.364C479.127 156.157 464.292 142.716 444.094 129.324C403.583 102.463 341.778 76 256 76C170.222 76 108.417 102.463 67.9063 129.324C47.7083 142.716 32.8725 156.157 23.0052 166.364C18.0692 171.469 14.3673 175.775 11.85 178.875C10.591 180.425 10.066 181.116 8.95243 182.575C5.25382 187.42 0 195.36 0 195.36L58.06 251.233L69.0637 238.232L69.0664 238.228L69.0684 238.226C69.08 238.213 69.1066 238.182 69.1483 238.134C69.2369 238.032 69.3932 237.854 69.6168 237.605C70.064 237.106 70.7799 236.323 71.7606 235.296C73.7228 233.24 76.7398 230.213 80.7814 226.536C88.873 219.175 101.017 209.256 116.97 199.315C148.861 179.443 195.744 159.606 256 159.606C316.256 159.606 363.139 179.443 395.03 199.315C410.983 209.256 423.127 219.175 431.219 226.536C435.26 230.213 438.277 233.24 440.239 235.296C441.22 236.323 441.936 237.106 442.383 237.605C442.607 237.854 442.763 238.032 442.852 238.134L442.888 238.176C442.91 238.201 442.925 238.218 442.932 238.227L442.934 238.228L442.936 238.232L453.94 251.233L512 195.36Z" />
</svg>

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 2.5 KiB

+5 -1
View File
@@ -1 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M346.65,304.3a136,136,0,0,0-180.71,0,21,21,0,1,0,27.91,31.38,94,94,0,0,1,124.89,0,21,21,0,0,0,27.91-31.4Z"/><path d="M256.28,183.7a221.47,221.47,0,0,0-151.8,59.92,21,21,0,1,0,28.68,30.67,180.28,180.28,0,0,1,246.24,0,21,21,0,1,0,28.68-30.67A221.47,221.47,0,0,0,256.28,183.7Z"/><path d="M462,175.86a309,309,0,0,0-411.44,0,21,21,0,1,0,28,31.29,267,267,0,0,1,355.43,0,21,21,0,0,0,28-31.31Z"/><circle cx="256.28" cy="393.41" r="32"/></svg>
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M331.295 353.764C331.426 353.945 331.204 353.634 331.295 353.764C331.031 353.403 330.686 352.943 330.256 352.399C329.397 351.312 328.196 349.882 326.638 348.229C323.526 344.927 318.948 340.692 312.768 336.504C300.287 328.047 281.56 320 256 320C230.44 320 211.713 328.047 199.232 336.504C193.052 340.692 188.474 344.927 185.362 348.229C183.804 349.882 182.603 351.312 181.744 352.399C182.008 352.038 181.314 352.943 181.744 352.399L180.158 354.541C175.808 360.976 176.709 369.605 182.293 375.004L244.879 435.504C251.081 441.499 260.918 441.499 267.12 435.504L329.707 375.004C335.291 369.605 336.192 360.976 331.843 354.541L331.295 353.764Z" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M421.086 269.862C420.951 269.644 420.49 268.896 420.274 268.562C419.84 267.896 419.24 267.005 418.464 265.923C416.912 263.76 414.651 260.827 411.603 257.387C405.504 250.507 396.241 241.585 383.186 232.75C356.915 214.969 315.967 198 256 198C196.033 198 155.085 214.969 128.814 232.75C115.759 241.585 106.496 250.507 100.397 257.387C97.3485 260.827 95.0878 263.76 93.5358 265.923C92.7595 267.005 92.1597 267.896 91.7263 268.562C91.5096 268.896 91.3343 269.174 91.1994 269.391C91.132 269.5 90.9141 269.862 90.9141 269.862C87.1429 276.245 88.2511 284.383 93.5918 289.526L128.902 323.526C132.036 326.543 136.263 328.154 140.61 327.988C144.936 327.823 149.009 325.913 151.901 322.695C151.903 322.692 151.905 322.689 151.909 322.686C151.936 322.656 152.001 322.586 152.104 322.477C152.311 322.258 152.669 321.886 153.178 321.381C154.197 320.37 155.812 318.834 158.009 316.945C162.411 313.16 169.102 307.998 177.964 302.804C195.658 292.436 221.893 282 256 282C290.107 282 316.342 292.436 334.036 302.804C342.898 307.998 349.589 313.16 353.991 316.945C356.188 318.834 357.803 320.37 358.822 321.381C359.331 321.886 359.689 322.258 359.896 322.477C359.999 322.586 360.064 322.656 360.091 322.686L360.086 322.68L360.073 322.665M360.073 322.665C360.082 322.675 360.091 322.685 360.099 322.694C362.991 325.913 367.064 327.823 371.39 327.988C375.737 328.154 379.964 326.543 383.098 323.526L418.408 289.526C423.749 284.383 424.857 276.245 421.086 269.862" />
<path d="M507.974 181.264C508.317 181.723 509.155 182.893 509.155 182.893C513.613 189.332 512.754 198.052 507.126 203.499L470.436 238.999C467.248 242.083 462.923 243.706 458.493 243.479C454.074 243.253 449.947 241.207 447.091 237.829L447.088 237.826C447.077 237.813 447.049 237.78 447.003 237.727C446.911 237.621 446.75 237.437 446.521 237.179C446.062 236.665 445.328 235.858 444.324 234.8C442.315 232.684 439.229 229.571 435.095 225.79C426.82 218.221 414.405 208.026 398.098 197.809C365.499 177.384 317.58 157 256 157C194.42 157 146.501 177.384 113.902 197.809C97.5948 208.026 85.1796 218.221 76.9047 225.79C72.7716 229.571 69.685 232.684 67.676 234.8C66.6719 235.858 65.9384 236.665 65.4791 237.179C65.2496 237.437 65.0888 237.621 64.9971 237.727L64.9503 237.781L64.9205 237.815L64.916 237.821L64.9117 237.826L64.9085 237.83C62.0528 241.208 57.9255 243.253 53.5069 243.479C49.0769 243.706 44.7517 242.083 41.5639 238.999L4.87425 203.499C-0.754421 198.052 -1.61321 189.332 2.84493 182.893L2.85549 182.877L2.86773 182.86L2.89728 182.817C2.91924 182.786 2.94571 182.748 2.9767 182.704C3.03868 182.616 3.11877 182.504 3.21704 182.367C3.41359 182.093 3.68298 181.723 4.02598 181.264C4.71191 180.344 5.69278 179.065 6.97482 177.478C9.53819 174.304 13.3104 169.893 18.3417 164.66C28.3994 154.2 43.5266 140.419 64.1248 126.687C105.437 99.1458 168.481 72 256 72C343.519 72 406.563 99.1458 447.875 126.687C468.473 140.419 483.601 154.2 493.658 164.66C498.69 169.893 502.462 174.304 505.025 177.478C506.307 179.065 507.288 180.344 507.974 181.264Z" />
</svg>

Before

Width:  |  Height:  |  Size: 530 B

After

Width:  |  Height:  |  Size: 3.7 KiB

+1 -1
View File
@@ -1,2 +1,2 @@
export * from './playwright-page';
export * from './playwright-declarations';
export * from './playwright-declarations';
+1 -2
View File
@@ -8,11 +8,10 @@ import type { Page, TestInfo } from '@playwright/test';
* to be hydrated before proceeding with the test.
*/
export const goto = async (page: Page, url: string, options: any, _: TestInfo, originalFn: typeof page.goto) => {
const result = await Promise.all([
page.waitForFunction(() => (window as any).testAppLoaded === true, { timeout: 4750 }),
originalFn(url, options),
]);
return result[1];
};
};
@@ -1 +1 @@
export * from './goto';
export * from './goto';
@@ -52,6 +52,6 @@ export interface E2EPage extends Page {
* - `'commit'` - consider operation to be finished when network response is received and the document started loading.
*/
waitUntil?: 'load' | 'domcontentloaded' | 'networkidle' | 'commit';
}
},
) => Promise<null | Response>;
}
}
+2 -4
View File
@@ -7,9 +7,7 @@ import type {
} from '@playwright/test';
import { test as base } from '@playwright/test';
import {
goto as goToPage,
} from './page/utils';
import { goto as goToPage } from './page/utils';
import type { E2EPage } from './playwright-declarations';
type CustomTestArgs = PlaywrightTestArgs &
@@ -54,4 +52,4 @@ export const test = base.extend<CustomFixtures>({
page = await extendPageFixture(page, testInfo);
await use(page);
},
});
});
+7 -6
View File
@@ -2,15 +2,16 @@ import { Config } from '@stencil/core';
export const config: Config = {
namespace: 'ionicons',
buildEs5: 'prod',
sourceMap: false,
outputTargets: [
{
type: 'dist',
collectionDir: null,
empty: false,
},
{
type: 'dist-custom-elements',
externalRuntime: false,
dir: './components',
},
{
@@ -23,14 +24,14 @@ export const config: Config = {
src: './components/test/*.svg',
dest: './assets/',
},
{
src: './svg/*.svg',
dest: './build/svg/',
},
{
src: './components/test/',
dest: './test/',
}
},
{
src: './svg/*.svg',
dest: './svg/',
},
],
empty: false,
serviceWorker: false,
+1 -1
View File
@@ -7,7 +7,7 @@
"declaration": false,
"experimentalDecorators": true,
"lib": ["dom", "es2017"],
"moduleResolution": "node",
"moduleResolution": "bundler",
"module": "esnext",
"target": "es2017",
"noUnusedLocals": true,