@haiilo/catalyst 2.4.7 → 2.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/catalyst/catalyst.esm.js +1 -1
  2. package/dist/catalyst/index.esm.js +1 -1
  3. package/dist/catalyst/p-602c38be.entry.js +2 -0
  4. package/dist/catalyst/p-602c38be.entry.js.map +1 -0
  5. package/dist/catalyst/p-ccfebe33.js +2 -0
  6. package/dist/catalyst/p-ccfebe33.js.map +1 -0
  7. package/dist/cjs/cat-alert_23.cjs.entry.js +2 -3
  8. package/dist/cjs/cat-alert_23.cjs.entry.js.map +1 -1
  9. package/dist/cjs/{cat-icon-registry-32ed379a.js → cat-icon-registry-671af264.js} +60 -32
  10. package/dist/cjs/cat-icon-registry-671af264.js.map +1 -0
  11. package/dist/cjs/index.cjs.js +1 -1
  12. package/dist/collection/components/cat-i18n/cat-i18n-registry.js +28 -7
  13. package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
  14. package/dist/collection/components/cat-icon/cat-icon-registry.js +31 -24
  15. package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
  16. package/dist/collection/components/cat-icon/cat-icon.js +2 -3
  17. package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
  18. package/dist/components/cat-i18n-registry.js +28 -7
  19. package/dist/components/cat-i18n-registry.js.map +1 -1
  20. package/dist/components/cat-icon2.js +32 -26
  21. package/dist/components/cat-icon2.js.map +1 -1
  22. package/dist/esm/cat-alert_23.entry.js +2 -3
  23. package/dist/esm/cat-alert_23.entry.js.map +1 -1
  24. package/dist/esm/{cat-icon-registry-7c4007ff.js → cat-icon-registry-d6b80490.js} +60 -32
  25. package/dist/esm/cat-icon-registry-d6b80490.js.map +1 -0
  26. package/dist/esm/index.js +2 -2
  27. package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +3 -2
  28. package/dist/types/components/cat-icon/cat-icon-registry.d.ts +3 -5
  29. package/dist/types/components/cat-icon/cat-icon.d.ts +0 -1
  30. package/package.json +2 -2
  31. package/dist/catalyst/p-5362e648.js +0 -2
  32. package/dist/catalyst/p-5362e648.js.map +0 -1
  33. package/dist/catalyst/p-c2bf7e26.entry.js +0 -2
  34. package/dist/catalyst/p-c2bf7e26.entry.js.map +0 -1
  35. package/dist/cjs/cat-icon-registry-32ed379a.js.map +0 -1
  36. package/dist/esm/cat-icon-registry-7c4007ff.js.map +0 -1
@@ -1 +1 @@
1
- {"file":"cat-icon2.js","mappings":";;;MAEa,eAAe;EAO1B;IAJiB,UAAK,GAAwB,IAAI,GAAG,EAAE,CAAC;IAKtD,IAAI,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACxD,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;;GAEjD;EAED,OAAO,WAAW;IAChB,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;MAC7B,eAAe,CAAC,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;KAClD;IACD,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;IACrD,OAAO,eAAe,CAAC,QAAQ,CAAC;GACjC;EAED,OAAO,CAAC,IAAY,EAAE,OAAgB;IACpC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3D,IAAI,CAAC,IAAI,EAAE;MACTA,QAAG,CAAC,KAAK,CAAC,iCAAiC,OAAO,GAAG,WAAW,OAAO,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;KAC5F;IACD,OAAO,IAAI,CAAC;GACb;EAED,OAAO,CAAC,IAAY,EAAE,IAAY,E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ACE,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,gBACnC,IAAI,CAAC,SAAS,iBACb,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,MAAM,EAC3C,IAAI,EAAC,MAAM,EACX,KAAK,EAAE;QACL,IAAI,EAAE,IAAI;QACV,CAAC,QAAQ,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,KAAK,QAAQ;OAC9C,GACK,EACR;GACH;;;;;;;;;;;;;;;;;;;;;;;","names":["log"],"sources":["./src/components/cat-icon/cat-icon-registry.ts","./src/components/cat-icon/cat-icon.scss?tag=cat-icon&encapsulation=shadow","./src/components/cat-icon/cat-icon.tsx"],"sourcesContent":["import log from 'loglevel';\n\nexport class CatIconRegistry {\n private static instance: CatIconRegistry;\n\n private readonly icons: Map<string, string> = new Map();\n\n readonly id: string;\n\n private constructor() {\n this.id = (Math.random() + 1).toString(36).substring(2);\n console.log('CatIconRegistry created', this.id);\n // hide constructor\n }\n\n static getInstance(): CatIconRegistry {\n if (!CatIconRegistry.instance) {\n CatIconRegistry.instance = new CatIconRegistry();\n }\n console.log('getInstance', CatIconRegistry.instance);\n return CatIconRegistry.instance;\n }\n\n getIcon(name: string, setName?: string): string | undefined {\n const icon = this.icons.get(this.buildName(name, setName));\n if (!icon) {\n log.error(`[CatIconRegistry] Unknown icon${setName ? ` in set ${setName}` : ''}: ${name}`);\n }\n return icon;\n }\n\n addIcon(name: string, data: string, setName?: string): CatIconRegistry {\n this.icons.set(this.buildName(name, setName), data);\n log.info(`[CatIconRegistry] Added icon${setName ? ` to set ${setName}` : ''}: ${name}`);\n window.dispatchEvent(this.buildEvent('cat-icon-added', { name, setName }));\n return this;\n }\n\n addIcons(icons: { [name: string]: string }, setName?: string): CatIconRegistry {\n console.log('addIcons', setName, icons);\n Object.entries(icons).forEach(([name, data]) => this.icons.set(this.buildName(name, setName), data));\n log.info(`[CatIconRegistry] Added icons${setName ? ` to set ${setName}` : ''}: ${Object.keys(icons).concat(', ')}`);\n window.dispatchEvent(this.buildEvent('cat-icons-added', { names: Object.keys(icons), setName }));\n return this;\n }\n\n removeIcon(name: string, setName?: string): CatIconRegistry {\n this.icons.delete(this.buildName(name, setName));\n log.info(`[CatIconRegistry] Removed icon${setName ? ` from set ${setName}` : ''}: ${name}`);\n window.dispatchEvent(this.buildEvent('cat-icon-removed', { name, setName }));\n return this;\n }\n\n removeIcons(names: string[], setName?: string): CatIconRegistry {\n names.forEach(name => this.icons.delete(this.buildName(name, setName)));\n log.info(`[CatIconRegistry] Removed icons${setName ? ` from set ${setName}` : ''}: ${names.concat(', ')}`);\n window.dispatchEvent(this.buildEvent('cat-icons-removed', { names, setName }));\n return this;\n }\n\n private buildName(name: string, setName?: string) {\n return setName ? `${setName}:name` : name;\n }\n\n private buildEvent<T>(name: string, detail?: T) {\n return new CustomEvent(name, {\n bubbles: true,\n composed: true,\n detail\n });\n }\n}\n\nexport const catIconRegistry = CatIconRegistry.getInstance();\n","@use 'variables' as *;\n@use 'mixins' as *;\n@use 'sass:map';\n\n$icon-sizes: (\n 'xl': 1.75rem,\n 'l': 1.5rem,\n 'm': 1.25rem,\n 's': 1rem,\n 'xs': 0.75rem\n);\n\n:host {\n /**\n * @prop --cat-icon-ratio: The aspect ratio of the avatar.\n */\n display: inline-flex;\n vertical-align: middle;\n @include cat-select(none);\n}\n\n:host([hidden]) {\n display: none;\n}\n\nspan {\n display: inline-flex;\n}\n\nsvg {\n fill: currentColor;\n stroke: none;\n transform-origin: center center;\n height: 1em;\n width: calc(var(--cat-icon-ratio, 1) * 1em);\n}\n\n// ----- size\n\n@mixin size($size) {\n .icon-#{$size} svg {\n font-size: map.get($icon-sizes, $size);\n }\n}\n\n@include size('xs');\n@include size('s');\n@include size('m');\n@include size('l');\n@include size('xl');\n","import { Component, h, Prop } from '@stencil/core';\nimport { CatIconRegistry } from './cat-icon-registry';\n\n/**\n * Icons are used to provide additional meaning or in places where text label\n * doesn't fit.\n *\n * @part icon - The span element wrapping the SVG icon.\n */\n@Component({\n tag: 'cat-icon',\n styleUrl: 'cat-icon.scss',\n shadow: true\n})\nexport class CatIcon {\n private readonly iconRegistry = CatIconRegistry.getInstance();\n\n /**\n * The name of the icon.\n */\n @Prop() icon = '';\n\n /**\n * The size of the icon.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'inline' = 'm';\n\n /**\n * Adds accessible label for the icon that is only shown for screen\n * readers. The `aria-hidden` attribute will be set if no label is present.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n render() {\n return (\n <span\n innerHTML={this.iconRegistry.getIcon(this.icon)}\n aria-label={this.a11yLabel}\n aria-hidden={this.a11yLabel ? null : 'true'}\n part=\"icon\"\n class={{\n icon: true,\n [`icon-${this.size}`]: this.size !== 'inline'\n }}\n ></span>\n );\n }\n}\n"],"version":3}
1
+ {"file":"cat-icon2.js","mappings":";;;MAEa,eAAe;EAM1B;;IAHiB,OAAE,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACnD,UAAK,GAAwB,IAAI,GAAG,EAAE,CAAC;;;;;;;;IAYtD,MAAM,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,KAAK;MAC9C,MAAM,EAAE,MAAM,EAAE,GAAI,KAAqB,IAAI,EAAE,CAAC;MAChD,IAAI,MAAM,IAAI,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,EAAE;QACnC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;OACnD;KACF,CAAC,CAAC;IACH,MAAM,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,KAAK;MAChD,MAAM,EAAE,MAAM,EAAE,GAAI,KAAqB,IAAI,EAAE,CAAC;MAChD,IAAI,MAAM,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ACE,YACE,SAAS,EAAEC,eAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,gBACvB,IAAI,CAAC,SAAS,iBACb,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,MAAM,EAC3C,IAAI,EAAC,MAAM,EACX,KAAK,EAAE;QACL,IAAI,EAAE,IAAI;QACV,CAAC,QAAQ,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,KAAK,QAAQ;OAC9C,GACK,EACR;GACH;;;;;;;;;;;;;;;;;;;;;;;","names":["log","icons"],"sources":["./src/components/cat-icon/cat-icon-registry.ts","./src/components/cat-icon/cat-icon.scss?tag=cat-icon&encapsulation=shadow","./src/components/cat-icon/cat-icon.tsx"],"sourcesContent":["import log from 'loglevel';\n\nexport class CatIconRegistry {\n private static instance: CatIconRegistry;\n\n private readonly id = (Math.random() + 1).toString(36).substring(2);\n private readonly icons: Map<string, string> = new Map();\n\n private constructor() {\n // hide constructor\n\n // In rare cases, the registry can be initialized twice. This can happen in\n // a micro frontend architecture where the registry is initialized in the\n // host application and in the micro frontend. To prevent the registry in\n // one application from overwriting the registry in the other, we listen for\n // events that are dispatched when icons are added or removed in other\n // applications and add or remove icons if the event was not dispatched by\n // this registry.\n window.addEventListener('cat-icons-added', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.addIcons(detail.icons, detail.setName, true);\n }\n });\n window.addEventListener('cat-icons-removed', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.removeIcons(detail.names, detail.setName, true);\n }\n });\n }\n\n static getInstance(): CatIconRegistry {\n if (!CatIconRegistry.instance) {\n CatIconRegistry.instance = new CatIconRegistry();\n }\n return CatIconRegistry.instance;\n }\n\n getIcon(name: string, setName?: string): string | undefined {\n const icon = this.icons.get(this.buildName(name, setName));\n if (!icon) {\n log.error(`[CatIconRegistry] Unknown icon${setName ? ` in set ${setName}` : ''}: ${name}`);\n }\n return icon;\n }\n\n addIcons(icons: { [name: string]: string }, setName?: string, silent = false): CatIconRegistry {\n const iconEntries = Object.entries(icons);\n const iconSize = iconEntries.length;\n iconEntries.forEach(([name, data]) => this.icons.set(this.buildName(name, setName), data));\n log.info(`[CatIconRegistry] Added ${iconSize !== 1 ? 'icons' : 'icon'}${setName ? ` to set ${setName}` : ''}`);\n !silent && window.dispatchEvent(this.buildEvent('cat-icons-added', { id: this.id, icons, setName }));\n return this;\n }\n\n removeIcons(names: string[], setName?: string, silent = false): CatIconRegistry {\n const iconSize = names.length;\n names.forEach(name => this.icons.delete(this.buildName(name, setName)));\n log.info(`[CatIconRegistry] Removed ${iconSize !== 1 ? 'icons' : 'icon'}${setName ? ` from set ${setName}` : ''}`);\n !silent && window.dispatchEvent(this.buildEvent('cat-icons-removed', { id: this.id, names, setName }));\n return this;\n }\n\n private buildName(name: string, setName?: string) {\n return setName ? `${setName}:name` : name;\n }\n\n private buildEvent<T>(name: string, detail?: T) {\n return new CustomEvent(name, {\n bubbles: true,\n composed: true,\n detail\n });\n }\n}\n\nexport const catIconRegistry = CatIconRegistry.getInstance();\n","@use 'variables' as *;\n@use 'mixins' as *;\n@use 'sass:map';\n\n$icon-sizes: (\n 'xl': 1.75rem,\n 'l': 1.5rem,\n 'm': 1.25rem,\n 's': 1rem,\n 'xs': 0.75rem\n);\n\n:host {\n /**\n * @prop --cat-icon-ratio: The aspect ratio of the avatar.\n */\n display: inline-flex;\n vertical-align: middle;\n @include cat-select(none);\n}\n\n:host([hidden]) {\n display: none;\n}\n\nspan {\n display: inline-flex;\n}\n\nsvg {\n fill: currentColor;\n stroke: none;\n transform-origin: center center;\n height: 1em;\n width: calc(var(--cat-icon-ratio, 1) * 1em);\n}\n\n// ----- size\n\n@mixin size($size) {\n .icon-#{$size} svg {\n font-size: map.get($icon-sizes, $size);\n }\n}\n\n@include size('xs');\n@include size('s');\n@include size('m');\n@include size('l');\n@include size('xl');\n","import { Component, h, Prop } from '@stencil/core';\nimport { catIconRegistry as icons } from './cat-icon-registry';\n\n/**\n * Icons are used to provide additional meaning or in places where text label\n * doesn't fit.\n *\n * @part icon - The span element wrapping the SVG icon.\n */\n@Component({\n tag: 'cat-icon',\n styleUrl: 'cat-icon.scss',\n shadow: true\n})\nexport class CatIcon {\n /**\n * The name of the icon.\n */\n @Prop() icon = '';\n\n /**\n * The size of the icon.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'inline' = 'm';\n\n /**\n * Adds accessible label for the icon that is only shown for screen\n * readers. The `aria-hidden` attribute will be set if no label is present.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n render() {\n return (\n <span\n innerHTML={icons.getIcon(this.icon)}\n aria-label={this.a11yLabel}\n aria-hidden={this.a11yLabel ? null : 'true'}\n part=\"icon\"\n class={{\n icon: true,\n [`icon-${this.size}`]: this.size !== 'inline'\n }}\n ></span>\n );\n }\n}\n"],"version":3}
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-c2a28ebb.js';
2
- import { l as loglevel, e as CatIconRegistry, b as catI18nRegistry } from './cat-icon-registry-7c4007ff.js';
2
+ import { l as loglevel, d as catIconRegistry, b as catI18nRegistry } from './cat-icon-registry-d6b80490.js';
3
3
  import { c as createFocusTrap, t as tabbable, f as firstTabbable } from './first-tabbable-4a00de61.js';
4
4
 
5
5
  function setAttributeDefault(host, attr, value) {
@@ -1888,7 +1888,6 @@ const catIconCss = ":host{display:inline-flex;vertical-align:middle;-webkit-user
1888
1888
  const CatIcon = class {
1889
1889
  constructor(hostRef) {
1890
1890
  registerInstance(this, hostRef);
1891
- this.iconRegistry = CatIconRegistry.getInstance();
1892
1891
  /**
1893
1892
  * The name of the icon.
1894
1893
  */
@@ -1899,7 +1898,7 @@ const CatIcon = class {
1899
1898
  this.size = 'm';
1900
1899
  }
1901
1900
  render() {
1902
- return (h("span", { innerHTML: this.iconRegistry.getIcon(this.icon), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
1901
+ return (h("span", { innerHTML: catIconRegistry.getIcon(this.icon), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
1903
1902
  icon: true,
1904
1903
  [`icon-${this.size}`]: this.size !== 'inline'
1905
1904
  } }));