Compare commits

...
4 Commits
7 changed files with 45 additions and 10 deletions
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "ionicons",
"version": "5.5.0",
"version": "5.5.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -894,9 +894,9 @@
}
},
"@stencil/core": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.4.0.tgz",
"integrity": "sha512-gU6+Yyd6O0KrCSS/O6j8KKqmRo+/Dcs2fI0+APCpbAWK+nqhwDISpdnSEfGDCLMoAC08XOZCycBRk2K1VGnEcg=="
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.5.0.tgz",
"integrity": "sha512-gpoYJEYzu5LV2hr7uPZklug3zXhEbYGKyNodPfmOOYZtO9q42l7RQ3cAnC8MzEoF4jFrfemgtevGik8sqn9ClQ=="
},
"@szmarczak/http-timer": {
"version": "4.0.5",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "ionicons",
"version": "5.5.0",
"version": "5.5.1",
"description": "Premium icons for Ionic.",
"files": [
"components/",
@@ -24,7 +24,7 @@
"version": "npm run build"
},
"dependencies": {
"@stencil/core": "^2.4.0"
"@stencil/core": "^2.5.0"
},
"devDependencies": {
"@types/fs-extra": "^9.0.6",
+12
View File
@@ -26,6 +26,18 @@ async function collectionCopy(rootDir: string) {
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
+6 -3
View File
@@ -10,6 +10,7 @@ import { getName, getUrl } from './utils';
})
export class Icon {
private io?: IntersectionObserver;
private iconName: string | null = null;
@Element() el!: HTMLElement;
@@ -143,8 +144,9 @@ export class Icon {
}
}
const label = this.iconName = getName(this.name, this.icon, this.mode, this.ios, this.md);
if (!this.ariaLabel && this.ariaHidden !== 'true') {
const label = getName(this.name, this.icon, this.mode, this.ios, this.md);
// user did not provide a label
// come up with the label based on the icon name
if (label) {
@@ -154,11 +156,12 @@ export class Icon {
}
render() {
const { iconName } = this;
const mode = this.mode || 'md';
const flipRtl =
this.flipRtl ||
(this.ariaLabel &&
(this.ariaLabel.indexOf('arrow') > -1 || this.ariaLabel.indexOf('chevron') > -1) &&
(iconName &&
(iconName.indexOf('arrow') > -1 || iconName.indexOf('chevron') > -1) &&
this.flipRtl !== false);
return (
+16
View File
@@ -29,4 +29,20 @@ describe('icon', () => {
</ion-icon>
`);
});
it('renders rtl with aria-hidden', async () => {
const { root } = await newSpecPage({
components: [Icon],
direction: 'rtl',
html: `<ion-icon name="chevron-forward" aria-hidden="true"></ion-icon>`,
});
expect(root).toEqualHtml(`
<ion-icon class="md flip-rtl" name="chevron-forward" role="img" aria-hidden="true">
<mock:shadow-root>
<div class="icon-inner"></div>
</mock:shadow-root>
</ion-icon>
`);
});
});
+4 -1
View File
@@ -3752,13 +3752,15 @@
{
"name": "earth",
"tags": [
"earth"
"earth",
"globe"
]
},
{
"name": "earth-outline",
"tags": [
"earth",
"globe",
"outline"
]
},
@@ -3766,6 +3768,7 @@
"name": "earth-sharp",
"tags": [
"earth",
"globe",
"sharp"
]
},
+1
View File
@@ -2,6 +2,7 @@ import { Config } from '@stencil/core';
export const config: Config = {
namespace: 'ionicons',
buildEs5: 'prod',
outputTargets: [
{
type: 'dist',