Compare commits

...
17 Commits
Author SHA1 Message Date
Liam DeBeasi e358a4f418 merge feature-7.0
Feature 7.0
2023-03-07 13:07:44 -05:00
Liam DeBeasi 0f6c84f976 merge release-7.0.0
Release 7.0.0
2023-03-07 08:52:02 -05:00
Liam DeBeasi 63788874db chore(): add migration note 2023-03-07 08:51:36 -05:00
ionitron ac450cbd28 chore(): update package lock files 2023-03-07 13:49:51 +00:00
ionitron 2ffcb6a012 v7.0.0 2023-03-07 13:49:46 +00:00
Liam DeBeasi 998b9207f3 chore(): sync with main
chore(): sync with main
2023-03-07 08:47:10 -05:00
Liam DeBeasi c290bea476 chore(): sync with main 2023-03-07 08:42:57 -05:00
Brandy Carney f2ed84a256 docs(contributing): include a link to contribute to the ionicons site (#1183) 2023-03-03 11:32:27 -05:00
Liam DeBeasi 7f3f55c94e merge release-6.1.3
Release 6.1.3
2023-02-09 12:39:57 -05:00
Liam DeBeasi ffcf9f9034 chore(): cleanup changelog 2023-02-09 12:35:41 -05:00
ionitron 6116bc2627 chore(): update package lock files 2023-02-09 17:34:58 +00:00
ionitron b7c9bb024a v6.1.3 2023-02-09 17:34:54 +00:00
Sean Perkins 8c412f6748 fix: DomParser usage in SSR (#1180)
Resolves #1179
2023-02-09 12:30:17 -05:00
Liam DeBeasi 53ce49e929 merge release-6.1.2
Release 6.1.2
2023-02-08 09:20:16 -05:00
Liam DeBeasi b27268f7db fix changelog 2023-02-08 09:13:59 -05:00
ionitron 2c1b968bff chore(): update package lock files 2023-02-08 14:05:12 +00:00
Amanda Johnston 98975ec0f5 fix(icon): remove auto-generated aria-label (#1170) 2023-01-20 10:18:28 -06:00
8 changed files with 28 additions and 99 deletions
+5 -1
View File
@@ -43,7 +43,7 @@ Please see our [Contributor Code of Conduct](./CODE_OF_CONDUCT.md) for informati
#### 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-changes](#preview-component-changes).
2. Make any changes to the icon component and then [preview the changes](#preview-component-changes).
#### Preview Component Changes
@@ -64,6 +64,10 @@ TODO -->
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.
+13 -3
View File
@@ -3,13 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [6.1.2](https://github.com/ionic-team/ionicons/compare/v6.1.1...v6.1.2) (2023-02-08)
# [7.0.0](https://github.com/ionic-team/ionicons/compare/v6.1.3...v7.0.0) (2023-03-07)
**Migration Note:** Developers should ensure that their `<ion-icon>` usages have either `aria-label` or `aria-hidden` to avoid accessibility issues. See https://ionic.io/ionicons/usage for more information.
### Bug Fixes
* **icon:** remove auto-generated aria-label ([#1170](https://github.com/ionic-team/ionicons/issues/1170)) ([98975ec](https://github.com/ionic-team/ionicons/commit/98975ec0f54b825c33f528683834a5e38298d598))
## [6.1.3](https://github.com/ionic-team/ionicons/compare/v6.1.2...v6.1.3) (2023-02-09)
### Bug Fixes
* **icon:** load base64 data urls ([#1172](https://github.com/ionic-team/ionicons/issues/1172)) ([72f0936](https://github.com/ionic-team/ionicons/commit/72f09369de76b00697437f54d919782307843a87))
* **icon:** md and ios properties are reactive ([#1174](https://github.com/ionic-team/ionicons/issues/1174)) ([65bcbb4](https://github.com/ionic-team/ionicons/commit/65bcbb477734e33901a6f0c650d3f1f2c3084fca)), closes [#802](https://github.com/ionic-team/ionicons/issues/802)
* DomParser usage in SSR ([#1180](https://github.com/ionic-team/ionicons/issues/1180)) ([8c412f6](https://github.com/ionic-team/ionicons/commit/8c412f67486d6cc9725de63f0c15b6c6cd8d47ce)), closes [#1179](https://github.com/ionic-team/ionicons/issues/1179)
+1 -1
View File
@@ -2,5 +2,5 @@
"packages": [
"./"
],
"version": "6.1.2"
"version": "7.0.0"
}
+5 -8
View File
@@ -1,12 +1,12 @@
{
"name": "ionicons",
"version": "6.1.2",
"version": "7.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "ionicons",
"version": "6.1.2",
"version": "7.0.0",
"license": "MIT",
"dependencies": {
"@stencil/core": "^2.18.0"
@@ -19249,8 +19249,7 @@
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz",
"integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==",
"dev": true,
"requires": {}
"dev": true
},
"@octokit/plugin-rest-endpoint-methods": {
"version": "6.7.0",
@@ -24103,8 +24102,7 @@
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz",
"integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==",
"dev": true,
"requires": {}
"dev": true
},
"jest-regex-util": {
"version": "26.0.0",
@@ -29290,8 +29288,7 @@
"version": "7.4.6",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==",
"dev": true,
"requires": {}
"dev": true
},
"xml-name-validator": {
"version": "3.0.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "ionicons",
"version": "6.1.2",
"version": "7.0.0",
"description": "Premium icons for Ionic.",
"files": [
"components/",
+2 -25
View File
@@ -17,7 +17,6 @@ export class Icon {
@State() private svgContent?: string;
@State() private isVisible = false;
@State() private ariaLabel?: string;
/**
* The mode determines which platform styles to use.
@@ -123,12 +122,6 @@ export class Icon {
}
}
private hasAriaHidden = () => {
const { el } = this;
return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';
};
@Watch('name')
@Watch('src')
@Watch('icon')
@@ -149,34 +142,18 @@ export class Icon {
}
}
const label = (this.iconName = getName(this.name, this.icon, this.mode, this.ios, this.md));
/**
* Come up with a default label
* in case user does not provide their own.
*/
if (label) {
this.ariaLabel = label.replace(/\-/g, ' ');
}
this.iconName = getName(this.name, this.icon, this.mode, this.ios, this.md);
}
render() {
const { iconName, ariaLabel, el, inheritedAttributes } = this;
const { iconName, el, inheritedAttributes } = this;
const mode = this.mode || 'md';
const flipRtl =
this.flipRtl ||
(iconName && (iconName.indexOf('arrow') > -1 || iconName.indexOf('chevron') > -1) && this.flipRtl !== false);
/**
* Only set the aria-label if a) we have generated
* one for the icon and if aria-hidden is not set to "true".
* If developer wants to set their own aria-label, then
* inheritedAttributes down below will override whatever
* default label we have set.
*/
return (
<Host
aria-label={ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null}
role="img"
class={{
[mode]: true,
+1 -1
View File
@@ -3,7 +3,7 @@ import { isEncodedDataUrl, isSvgDataUrl, validateContent } from './validate';
export const ioniconContent = new Map<string, string>();
const requests = new Map<string, Promise<any>>();
let parser = new DOMParser();
let parser: DOMParser;
export const getSvgContent = (url: string, sanitize: boolean) => {
// see if we already have a request for this url
-59
View File
@@ -16,20 +16,6 @@ describe('icon', () => {
`);
});
it('renders aria-hidden and no aria-label', async () => {
const { root } = await newSpecPage({
components: [Icon],
html: `<ion-icon aria-hidden="true"></ion-icon>`,
});
expect(root).toEqualHtml(`
<ion-icon class="md" role="img" aria-hidden="true">
<mock:shadow-root>
<div class="icon-inner"></div>
</mock:shadow-root>
</ion-icon>
`);
});
it('renders rtl with aria-hidden', async () => {
const { root } = await newSpecPage({
components: [Icon],
@@ -46,21 +32,6 @@ describe('icon', () => {
`);
});
it('renders default aria-label', async () => {
const { root } = await newSpecPage({
components: [Icon],
html: `<ion-icon name="chevron-forward"></ion-icon>`,
});
expect(root).toEqualHtml(`
<ion-icon class="md" name="chevron-forward" role="img" aria-label="chevron forward">
<mock:shadow-root>
<div class="icon-inner"></div>
</mock:shadow-root>
</ion-icon>
`);
});
it('renders custom aria-label', async () => {
const { root } = await newSpecPage({
components: [Icon],
@@ -105,34 +76,4 @@ describe('icon', () => {
</ion-icon>
`);
});
it('renders default label after changing source', async () => {
const page = await newSpecPage({
components: [Icon],
html: `<ion-icon name="chevron-forward"></ion-icon>`,
});
const icon = page.root;
expect(icon).toEqualHtml(`
<ion-icon class="md" name="chevron-forward" role="img" aria-label="chevron forward">
<mock:shadow-root>
<div class="icon-inner"></div>
</mock:shadow-root>
</ion-icon>
`);
if (icon) {
icon.name = 'trash';
}
await page.waitForChanges();
expect(icon).toEqualHtml(`
<ion-icon class="md" name="trash" role="img" aria-label="trash">
<mock:shadow-root>
<div class="icon-inner"></div>
</mock:shadow-root>
</ion-icon>
`);
});
});