@pine-ds/icons 9.6.1 → 9.7.0

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.
@@ -384,6 +384,7 @@ const PdsIcon$1 = /*@__PURE__*/ proxyCustomElement(class PdsIcon extends HTMLEle
384
384
  componentWillLoad() {
385
385
  this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
386
386
  this.setCSSVariables();
387
+ this.setupInitialAriaLabel();
387
388
  }
388
389
  setCSSVariables() {
389
390
  this.el.style.setProperty(`--dimension-icon-height`, this.iconSize());
@@ -413,6 +414,11 @@ const PdsIcon$1 = /*@__PURE__*/ proxyCustomElement(class PdsIcon extends HTMLEle
413
414
  updateStyles() {
414
415
  this.setCSSVariables();
415
416
  }
417
+ onIconPropertyChange() {
418
+ this.loadIcon();
419
+ // Update aria-label when icon properties change
420
+ this.setupInitialAriaLabel();
421
+ }
416
422
  loadIcon() {
417
423
  // Reset load state when URL changes
418
424
  this.didLoadIcon = false;
@@ -442,9 +448,6 @@ const PdsIcon$1 = /*@__PURE__*/ proxyCustomElement(class PdsIcon extends HTMLEle
442
448
  }
443
449
  }
444
450
  this.iconName = getName(this.name, this.icon);
445
- if (this.iconName) {
446
- this.ariaLabel = this.iconName.replace(/\-/g, ' ');
447
- }
448
451
  }
449
452
  render() {
450
453
  const { ariaLabel, flipRtl, iconName, inheritedAttributes } = this;
@@ -452,11 +455,22 @@ const PdsIcon$1 = /*@__PURE__*/ proxyCustomElement(class PdsIcon extends HTMLEle
452
455
  ? shouldRtlFlipIcon(iconName, this.el) && flipRtl !== false
453
456
  : false;
454
457
  const shouldFlip = flipRtl || shouldIconAutoFlip;
455
- return (h(Host, Object.assign({ key: '48056743bf1a60bbf905a0779702fd366b86659d', "aria-label": ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null, alt: "", role: "img", class: Object.assign(Object.assign({}, createColorClasses(this.color)), { 'flip-rtl': shouldFlip, 'icon-rtl': shouldFlip && isRTL(this.el) }) }, inheritedAttributes), Build.isBrowser && this.svgContent ? (h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (h("div", { class: "icon-inner" }))));
458
+ // Use inherited aria-label if provided, otherwise fall back to auto-generated one
459
+ const finalAriaLabel = inheritedAttributes['aria-label'] || ariaLabel;
460
+ return (h(Host, Object.assign({ key: '43aa73531314e6529a887468e69362430d006229', "aria-label": finalAriaLabel !== undefined && !this.hasAriaHidden() ? finalAriaLabel : null, alt: "", role: "img", class: Object.assign(Object.assign({}, createColorClasses(this.color)), { 'flip-rtl': shouldFlip, 'icon-rtl': shouldFlip && isRTL(this.el) }) }, inheritedAttributes), Build.isBrowser && this.svgContent ? (h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (h("div", { class: "icon-inner" }))));
456
461
  }
457
462
  /*****
458
463
  * Private Methods
459
464
  ****/
465
+ setupInitialAriaLabel() {
466
+ // Only set aria-label during initial load if one isn't already provided
467
+ if (!this.inheritedAttributes['aria-label']) {
468
+ const iconName = getName(this.name, this.icon);
469
+ if (iconName) {
470
+ this.ariaLabel = iconName.replace(/\-/g, ' ');
471
+ }
472
+ }
473
+ }
460
474
  waitUntilVisible(el, rootMargin, cb) {
461
475
  if (Build.isBrowser && typeof window !== 'undefined' && (window).IntersectionObserver) {
462
476
  const io = (this.io = new (window).IntersectionObserver((data) => {
@@ -539,9 +553,9 @@ const PdsIcon$1 = /*@__PURE__*/ proxyCustomElement(class PdsIcon extends HTMLEle
539
553
  static get watchers() { return {
540
554
  "size": ["updateStyles"],
541
555
  "color": ["updateStyles"],
542
- "name": ["loadIcon"],
543
- "src": ["loadIcon"],
544
- "icon": ["loadIcon"]
556
+ "name": ["onIconPropertyChange"],
557
+ "src": ["onIconPropertyChange"],
558
+ "icon": ["onIconPropertyChange"]
545
559
  }; }
546
560
  static get style() { return pdsIconCss; }
547
561
  }, [1, "pds-icon", {
@@ -557,9 +571,9 @@ const PdsIcon$1 = /*@__PURE__*/ proxyCustomElement(class PdsIcon extends HTMLEle
557
571
  }, undefined, {
558
572
  "size": ["updateStyles"],
559
573
  "color": ["updateStyles"],
560
- "name": ["loadIcon"],
561
- "src": ["loadIcon"],
562
- "icon": ["loadIcon"]
574
+ "name": ["onIconPropertyChange"],
575
+ "src": ["onIconPropertyChange"],
576
+ "icon": ["onIconPropertyChange"]
563
577
  }]);
564
578
  const createColorClasses = (color) => {
565
579
  return color
@@ -1 +1 @@
1
- {"file":"pds-icon.js","mappings":";;AAEA,IAAI,uBAAuB,GAAG,KAAK;AAQnC;;;;;;;;AAQG;AACI,MAAM,YAAY,GAAG,CAAC,IAAY,KAAI;;AAC3C,IAAA,MAAM,iBAAiB,GAAG,CAAA,EAAA,GAAA,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAkB,4BAA4B,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,OAAO,CAAC,aAAa;;AAG3H,IAAA,MAAM,eAAe,GAAG,MAAM,CAAC,mBAAmB;;IAGlD,MAAM,YAAY,GAAG,mDAAmD;AAExE,IAAA,MAAM,aAAa,GAAI,KAAK,CAAC,SAAS,GAAG,iBAAiB,GAAG,iBAAiB,IAAI,eAAe,IAAI,YAAmB;;IAGxH,IAAK,aAAa,CAAC,UAAU,CAAC,+BAA+B,CAAC,IAAI,CAAC,uBAAuB,EAAG;QAC3F,uBAAuB,GAAG,IAAI;QAC9B,OAAO,CAAC,IAAI,CAAC;;AAEZ,IAAA,CAAA,CAAC;;IAGJ,IAAI,SAAS,GAAG,IAAI;AAEpB,IAAA,IAAK,IAAI,CAAC,UAAU,CAAE,IAAI,CAAC,EAAG;AAC5B,QAAA,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;;IAG/B,IAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAG;AAClC,QAAA,SAAS,GAAG,GAAG,GAAG,SAAS;;IAG7B,OAAO,aAAa,GAAG,SAAS;AAClC,CAAC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SAAS,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK;AAChD,YAAA,aAAa,EAAE,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI;YACnD,OAAO,EAAE,IAAI,CAAC,EAAE;;AAEhB,YAAA,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,WAAW;YAChC,YAAY,EAAE,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;AAC/C,YAAA,uBAAuB,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE;AAClC,YAAA,kBAAkB,EAAE,IAAI;AACxB,YAAA,gBAAgB,EAAE;gBAChB,KAAK,EAAE,MAAM,CAAC,UAAU,IAAI,QAAQ,CAAC,eAAe,CAAC,WAAW;gBAChE,MAAM,EAAE,MAAM,CAAC,WAAW,IAAI,QAAQ,CAAC,eAAe,CAAC;AACxD;AACF,SAAA,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIN,MAAM,kBAAkB,GAAG,CAAC,KAAyB,KAAI;AACvD,IAAA,OAAO;AACN,UAAE;AACE,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,CAAC,CAAa,UAAA,EAAA,KAAK,CAAE,CAAA,GAAG,IAAI;AAC7B;UACD,IAAI;AACR,CAAC;;;;;;;;;;;;;;;;;;;;","names":["PdsIcon","__stencil_proxyCustomElement"],"sources":["src/components/pds-icon/assetPath.ts","src/components/pds-icon/utils.ts","src/components/pds-icon/validate.ts","src/components/pds-icon/request.ts","src/components/pds-icon/pds-icon.scss?tag=pds-icon&encapsulation=shadow","src/components/pds-icon/pds-icon.tsx"],"sourcesContent":["import { Build } from '@stencil/core';\n\nlet missingAssetPathWarning = false;\n\ndeclare global {\n interface Window {\n __PINE_ASSET_PATH__?: string\n }\n}\n\n/**\n *\n * Reads the component asset path config from meta tag or a global variable.\n * This is a temporary workaround until these issues have been addressed:\n *\n * https://github.com/ionic-team/stencil/issues/2826/\n * https://github.com/ionic-team/stencil/issues/3470\n * https://github.com/ionic-team/stencil-ds-output-targets/issues/186\n */\nexport const getAssetPath = (path: string) => {\n const metaPineAssetPath = document.head.querySelector<HTMLMetaElement>('meta[data-pine-asset-path]')?.dataset.pineAssetPath;\n\n // Get the asset path from the window object if available\n const windowAssetPath = window.__PINE_ASSET_PATH__;\n\n // Set the CDN Asset path using the latest version\n const cdnAssetPath = 'https://cdn.jsdelivr.net/npm/@pine-ds/icons/dist/';\n\n const assetBasePath = Build.isTesting ? '/dist/pds-icons' : metaPineAssetPath || windowAssetPath || cdnAssetPath || '/'\n\n // Display a warning if the assets are fetched from the CDN.\n if ( assetBasePath.startsWith('https://cdn.jsdelivr.net/npm/') && !missingAssetPathWarning ) {\n missingAssetPathWarning = true;\n console.warn(`\n Fetching Pine assets from jsDelivr CDN.\\n\\n It's recommended that you bundle Pine Assets with your application and set the path accordingly.\\n\\nFor more information, read the documentation: \\nhttps://pine-design-system.netlify.app/?path=/docs/resources-assets--docs\n `)\n }\n\n let assetPath = path;\n\n if ( path.startsWith ('./') ) {\n assetPath = path.substring(2);\n }\n\n if ( !assetBasePath.endsWith('/') ) {\n assetPath = '/' + assetPath;\n }\n\n return assetBasePath + assetPath;\n}\n\n\nexport {};\n","import { getAssetPath } from './assetPath';\n\nimport { PdsIcon } from './pds-icon';\n\nlet CACHED_MAP: Map<string, string>;\n\nexport const addIcons = (icons: { [name: string]: string; }) => {\n const map = getIconMap();\n Object.keys(icons).forEach(name => map.set(name, icons[name]));\n}\n\nexport const getIconMap = (): Map<string, string> => {\n if (typeof window === 'undefined') {\n return new Map();\n } else {\n if (!CACHED_MAP) {\n const win = window as any; // eslint-disable-line @typescript-eslint/no-explicit-any\n win.PdsIcons = win.PdsIcons || {};\n CACHED_MAP = win.PdsIcons.map = win.PdsIcons.map || new Map();\n }\n\n return CACHED_MAP;\n }\n}\n\nexport const getName = (\n iconName: string | undefined,\n icon: string | undefined\n ) => {\n\n if(!iconName && icon && !isSrc(icon)) {\n iconName = icon;\n }\n\n if (isStr(iconName)) {\n iconName = toLower(iconName);\n }\n\n if (!isStr(iconName) || iconName.trim() === '') {\n return null;\n }\n\n const invalidChars = iconName.replace(/[a-z]|-|\\d/gi,'');\n if (invalidChars != '') { return null; }\n\n return iconName;\n}\n\nconst getNamedUrl = (iconName: string) => {\n const url = getIconMap().get(iconName);\n if (url) {\n return url;\n }\n\n return getAssetPath(`svg/${iconName}.svg`);\n};\n\nexport const getSrc = (src: string | undefined) => {\n if (isStr(src)) {\n src = src.trim();\n\n if (isSrc(src)) {\n return src;\n }\n }\n\n return null;\n}\n\nexport const getUrl = (pdsIcon: PdsIcon) => {\n let url = getSrc(pdsIcon.src);\n if (url) {\n return url;\n }\n\n url = getName(pdsIcon.name, pdsIcon.icon);\n if (url) {\n return getNamedUrl(url);\n }\n\n if (pdsIcon.icon) {\n url = getSrc(pdsIcon.icon);\n\n if(url) {\n return url;\n }\n }\n\n return null;\n};\n\n\n/**\n * Returns `true` if the document or host element\n * has a `dir` set to `rtl`. The host value will always\n * take priority over the root document value.\n */\nexport const isRTL = (hostEl?: Pick<HTMLElement, 'dir'>) => {\n if (hostEl) {\n if (hostEl.dir !== '') {\n return hostEl.dir.toLowerCase() === 'rtl';\n }\n }\n return document?.dir.toLowerCase() === 'rtl';\n};\n\nexport const isSrc = (str: string) => str.length > 0 && /(\\/|\\.)/.test(str);\nexport const isStr = (val: any): val is string => typeof val === 'string'; // eslint-disable-line @typescript-eslint/no-explicit-any\nexport const toLower = (val: string) => val.toLowerCase();\n\n/**\n * Elements inside of web components sometimes need to inherit global attributes\n * set on the host. For example, the inner input in `pds-input` should inherit\n * the `title` attribute that developers set directly on `pds-input`. This\n * helper function should be called in componentWillLoad and assigned to a variable\n * that is later used in the render function.\n *\n * This does not need to be reactive as changing attributes on the host element\n * does not trigger a re-render.\n */\n export const inheritAttributes = (el: HTMLElement, attributes: string[] = []) => {\n const attributeObject: { [k: string]: any } = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n attributes.forEach(attr => {\n if (el.hasAttribute(attr)) {\n const value = el.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = el.getAttribute(attr);\n }\n el.removeAttribute(attr);\n }\n });\n\n return attributeObject;\n}\n\n/**\n * Determines if an icon should be flipped when RTL is enabled\n * @param iconName - The name of the icon to check\n * @param hostEl - Optional host element to check for RTL direction\n * @returns {boolean} - True if the icon should be flipped in RTL mode, false otherwise\n */\nexport const shouldRtlFlipIcon = (iconName: string, hostEl?: Pick<HTMLElement, 'dir'>): boolean => {\n // First check if we're in RTL mode\n const rtlEnabled = isRTL(hostEl);\n\n // Only flip if we're in RTL mode and the icon is in the flip list\n return rtlEnabled && ICONS_TO_FLIP.includes(iconName);\n}\n\n/**\n * Array of available icon names\n */\nexport const ICONS_TO_FLIP = [\n 'align-horizontal-bottom',\n 'align-horizontal-center',\n 'align-horizontal-top',\n 'align-left',\n 'align-right',\n 'align-vertical-left',\n 'align-vertical-right',\n 'arrow-corner',\n 'arrow-left',\n 'arrow-right',\n 'calendar-schedule',\n 'caret-left',\n 'caret-right',\n 'cart',\n 'cart-add',\n 'comment',\n 'comment-no',\n 'conversation',\n 'copy',\n 'copy-07',\n 'delete-key',\n 'delete-x',\n 'downsell',\n 'drawer-collapse',\n 'drawer-expand',\n 'duplicate',\n 'feedback',\n 'file-lock',\n 'file-search',\n 'form-field',\n 'form-filled',\n 'left-small',\n 'launch',\n 'list-bullet',\n 'list-numbers',\n 'margin-left',\n 'margin-right',\n 'move-left',\n 'move-right',\n 'newsletter-2',\n 'one-off-session',\n 'quote',\n 'redo',\n 'reset-password',\n 'right-small',\n 'send-message',\n 'share',\n 'super-admin',\n 'tablet-landscape',\n 'undo',\n 'user-star',\n 'user-star-filled',\n 'users',\n 'users-filled',\n 'users-tone'\n];\n\n","import { isStr } from './utils';\n\nexport const validateContent = (svgContent: string) => {\n const div = document.createElement('div');\n div.innerHTML = svgContent;\n\n // setup this way to ensure it works on our buddy IE\n for (let i = div.childNodes.length - 1; i >= 0; i--) {\n if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {\n div.removeChild(div.childNodes[i]);\n }\n }\n\n // must only have 1 root element\n const svgElm = div.firstElementChild;\n if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {\n const svgClass = svgElm.getAttribute('class') || '';\n svgElm.setAttribute('class', (svgClass + ' s-pds-icon').trim());\n\n // root element must be an svg\n // lets double check we've got valid elements\n // do not allow scripts\n if (isValid(svgElm as HTMLElement)) {\n return div.innerHTML;\n }\n }\n return '';\n};\n\nexport const isValid = (elm: HTMLElement) => {\n if (elm.nodeType === 1) {\n if (elm.nodeName.toLowerCase() === 'script') {\n return false;\n }\n\n for (let i = 0; i < elm.attributes.length; i++) {\n const name = elm.attributes[i].name;\n if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {\n return false;\n }\n }\n\n for (let i = 0; i < elm.childNodes.length; i++) {\n if (!isValid(elm.childNodes[i] as HTMLElement)) {\n return false;\n }\n }\n }\n return true;\n};\n\nexport const isSvgDataUrl = (url: string) => url.startsWith('data:image/svg+xml');\nexport const isEncodedDataUrl = (url: string) => url.indexOf(';utf8,') !== -1;\n","import { isEncodedDataUrl, isSvgDataUrl, validateContent } from './validate';\n\nexport const pdsIconContent = new Map<string, string>();\nconst requests = new Map<string, Promise<any>>(); // eslint-disable-line @typescript-eslint/no-explicit-any\n\nlet parser: DOMParser;\n\nexport const getSvgContent = (url: string, sanitize = false) => {\n let req = requests.get(url);\n\n if(!req) {\n if (typeof fetch != 'undefined' && typeof document !== 'undefined') {\n if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {\n if (!parser) {\n parser = new DOMParser();\n }\n\n try {\n const doc = parser.parseFromString(url, 'text/html');\n const svg = doc.querySelector('svg');\n\n if (svg) {\n pdsIconContent.set(url, svg.outerHTML);\n } else {\n pdsIconContent.set(url, '');\n }\n } catch (error) {\n pdsIconContent.set(url, '');\n }\n\n return Promise.resolve();\n } else {\n // we don't have a request\n req = fetch(url).then((rsp) => {\n if (rsp.ok) {\n return rsp.text().then((svgContent) => {\n if (svgContent && sanitize !== false) {\n try {\n svgContent = validateContent(svgContent);\n } catch (validationError) {\n svgContent = '';\n }\n }\n pdsIconContent.set(url, svgContent || '');\n });\n } else {\n // Handle HTTP errors\n throw new Error(`Failed to load SVG: ${rsp.status} ${rsp.statusText}`);\n }\n }).catch((error) => {\n // Handle all fetch errors gracefully\n console.warn('Failed to load SVG:', url, error);\n pdsIconContent.set(url, '');\n // Don't re-throw to prevent unhandled promise rejections\n });\n\n requests.set(url, req);\n }\n } else {\n pdsIconContent.set(url, '');\n return Promise.resolve();\n }\n }\n\n return req;\n}\n",":host {\n --dimension-icon-height: 16px;\n --dimension-icon-width: 16px;\n --color-icon-fill: currentColor;\n\n contain: strict;\n display: inline-block;\n fill: var(--color-icon-fill);\n flex-shrink: 0;\n height: var(--dimension-icon-height);\n width: var(--dimension-icon-width);\n\n .pdsicon {\n fill: var(--color-icon-fill);\n }\n}\n\n.pds-icon-fill-none {\n fill: none;\n}\n\n.icon-inner,\n.pds-icon,\nsvg {\n display: block;\n height: 100%;\n width: 100%;\n}\n\n/* :host-context is supported in chromium; :dir is supported in safari & firefox */\n:host(.flip-rtl):host-context([dir='rtl']) .icon-inner {\n transform: scaleX(-1);\n}\n\n:host(.flip-rtl:dir(rtl)) .icon-inner {\n transform: scaleX(-1);\n}\n\n/**\n * This is needed for WebKit otherwise the fallback\n * will always cause the icon to be flipped if the document\n * loads in RTL.\n */\n:host(.flip-rtl:dir(ltr)) .icon-inner {\n transform: scaleX(1);\n}\n\n","import { Build, Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { getSvgContent, pdsIconContent } from './request';\nimport { getName, getUrl, inheritAttributes, isRTL, shouldRtlFlipIcon } from './utils';\n\n@Component({\n tag: 'pds-icon',\n assetsDirs: ['svg'],\n styleUrl: 'pds-icon.scss',\n shadow: true,\n})\nexport class PdsIcon {\n private didLoadIcon = false;\n private iconName: string | null = null;\n private io?: IntersectionObserver;\n private inheritedAttributes: { [k: string]: any } = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n @Element() el!: HTMLPdsIconElement;\n\n @State() private ariaLabel?: string;\n @State() private isVisible = false;\n @State() private svgContent?: string;\n\n /**\n *\n * The color of the icon\n *\n */\n @Prop() color?: string;\n\n /**\n * Determines if the icon should be flipped when the `dir` is right-to-left (`\"rtl\"`).\n * This is automatically enabled for icons that are in the `ICONS_TO_FLIP` list and\n * when the `dir` is `\"rtl\"`. If `flipRtl` is set to `false`, the icon will not be flipped\n * even if the `dir` is `\"rtl\"`.\n */\n @Prop() flipRtl?: boolean;\n\n /**\n * This is a combination of both `name` and `src`. If a `src` URL is detected,\n * it will set the `src` property. Otherwise it assumes it's a built-in named\n * SVG and sets the `name` property.\n */\n @Prop() icon?: any;\n\n /**\n * The name of the icon to use from\n * the built-in set.\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * The size of the icon. This can be\n * 'small', 'regular', 'medium', 'large', or a\n * custom value (40px, 1rem, etc)\n *\n */\n @Prop({ reflect: true }) size?:\n | 'small' // 12px\n | 'regular' // 16px\n | 'medium' // 20px\n | 'large' // 24px\n | 'auto'\n | string = 'regular'\n\n /**\n *\n * Specifies the exact `src` of an SVG file to use.\n */\n @Prop() src?: string;\n\n private iconSize() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sizes: { [key: string]: any } = {\n small: '12px',\n regular: '16px',\n medium: '20px',\n large: '24px',\n }\n\n if (sizes[this.size]) {\n return sizes[this.size];\n } else {\n return this.size;\n }\n }\n\n componentDidLoad() {\n this.setCSSVariables();\n\n if (!this.didLoadIcon) {\n this.loadIcon();\n }\n\n // Fallback: Ensure icon loads even if IntersectionObserver doesn't fire\n setTimeout(() => {\n if (!this.svgContent && !this.isVisible) {\n this.isVisible = true;\n this.loadIcon();\n }\n }, 100);\n\n // Additional fallback for client-side navigation (React Router, etc.)\n // React's useLayoutEffect and rendering cycles can delay visibility detection\n setTimeout(() => {\n if (!this.svgContent && !this.isVisible) {\n this.isVisible = true;\n this.loadIcon();\n }\n }, 500);\n }\n\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);\n this.setCSSVariables();\n }\n\n setCSSVariables() {\n this.el.style.setProperty(`--dimension-icon-height`, this.iconSize());\n this.el.style.setProperty(`--dimension-icon-width`, this.iconSize());\n this.el.style.setProperty(`--color-icon-fill`, typeof this.color !== 'undefined' ? this.color : 'currentColor');\n }\n\n connectedCallback() {\n // Handle re-connection during client-side navigation\n if (!this.isVisible && !this.svgContent) {\n this.waitUntilVisible(this.el, '50px', () => {\n this.isVisible = true;\n this.loadIcon();\n });\n }\n\n // Immediate load attempt if already visible (e.g., during React navigation)\n if (this.isElementInViewport(this.el)) {\n this.isVisible = true;\n this.loadIcon();\n }\n }\n\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n\n @Watch('size')\n @Watch('color')\n updateStyles() {\n this.setCSSVariables();\n }\n\n @Watch('name')\n @Watch('src')\n @Watch('icon')\n loadIcon() {\n // Reset load state when URL changes\n this.didLoadIcon = false;\n\n // Clear existing content to prevent stale content when switching icons\n this.svgContent = undefined;\n\n if (Build.isBrowser && this.isVisible) {\n const url = getUrl(this);\n if (url) {\n if (pdsIconContent.has(url)) {\n this.svgContent = pdsIconContent.get(url);\n } else {\n // Fix: Ensure promise callback triggers re-render and handle errors\n getSvgContent(url)\n .then(() => {\n // Force re-render by setting state in next tick\n setTimeout(() => {\n this.svgContent = pdsIconContent.get(url);\n }, 0);\n })\n .catch(() => {\n // Handle fetch errors gracefully\n this.svgContent = '';\n });\n }\n this.didLoadIcon = true;\n }\n }\n\n this.iconName = getName(this.name, this.icon);\n\n if (this.iconName) {\n this.ariaLabel = this.iconName.replace(/\\-/g, ' ');\n }\n }\n\n render() {\n const { ariaLabel, flipRtl, iconName,inheritedAttributes } = this;\n const shouldIconAutoFlip = iconName\n ? shouldRtlFlipIcon(iconName, this.el) && flipRtl !== false\n : false;\n const shouldFlip = flipRtl || shouldIconAutoFlip;\n\n return (\n\n <Host\n aria-label={ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null }\n alt=\"\"\n role=\"img\"\n class={{\n ...createColorClasses(this.color),\n 'flip-rtl': shouldFlip,\n 'icon-rtl': shouldFlip && isRTL(this.el)\n }}\n {...inheritedAttributes}\n >\n {Build.isBrowser && this.svgContent ? (\n <div class=\"icon-inner\" innerHTML={this.svgContent}></div>\n ) : (\n <div class=\"icon-inner\"></div>\n )}\n </Host>\n )\n }\n\n /*****\n * Private Methods\n ****/\n\n private waitUntilVisible(el: HTMLElement, rootMargin: string, cb: () => void) {\n if (Build.isBrowser && typeof window !== 'undefined' && (window).IntersectionObserver) {\n const io = (this.io = new (window).IntersectionObserver(\n (data: IntersectionObserverEntry[]) => {\n if (data[0].isIntersecting) {\n io.disconnect();\n this.io = undefined;\n cb();\n }\n },\n { rootMargin },\n ));\n\n io.observe(el);\n\n // Safety timeout for client-side navigation scenarios\n // Sometimes IntersectionObserver doesn't fire during React navigation\n setTimeout(() => {\n if (this.io && !this.isVisible) {\n // Check if element is actually visible in viewport\n if (this.isElementInViewport(el)) {\n this.io.disconnect();\n this.io = undefined;\n cb();\n }\n }\n }, 1000);\n } else {\n // browser doesn't support IntersectionObserver\n // so just fallback to always show it\n cb();\n }\n }\n\n private isElementInViewport(el: HTMLElement): boolean {\n if (!el || !el.isConnected) return false;\n\n const rect = el.getBoundingClientRect();\n const windowHeight = window.innerHeight || document.documentElement.clientHeight;\n const windowWidth = window.innerWidth || document.documentElement.clientWidth;\n\n return (\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= windowHeight &&\n rect.right <= windowWidth\n ) || (\n // Also consider partially visible elements\n rect.top < windowHeight &&\n rect.bottom > 0 &&\n rect.left < windowWidth &&\n rect.right > 0\n );\n }\n\n private hasAriaHidden = () => {\n const { el } = this;\n\n return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';\n }\n\n /**\n * Debug method to help diagnose loading issues\n * Call from browser console: document.querySelector('pds-icon').debugIconState()\n */\n debugIconState() {\n const url = getUrl(this);\n const rect = this.el.getBoundingClientRect();\n\n console.log('PdsIcon Debug State:', {\n name: this.name,\n src: this.src,\n icon: this.icon,\n iconName: this.iconName,\n url,\n isVisible: this.isVisible,\n didLoadIcon: this.didLoadIcon,\n hasSvgContent: !!this.svgContent,\n svgContentLength: this.svgContent?.length || 0,\n isInCache: url ? pdsIconContent.has(url) : false,\n cachedContent: url ? pdsIconContent.get(url) : null,\n element: this.el,\n // Client-side navigation specific debug info\n isConnected: this.el.isConnected,\n isInViewport: this.isElementInViewport(this.el),\n hasIntersectionObserver: !!this.io,\n boundingClientRect: rect,\n windowDimensions: {\n width: window.innerWidth || document.documentElement.clientWidth,\n height: window.innerHeight || document.documentElement.clientHeight\n }\n });\n }\n}\n\nconst createColorClasses = (color: string | undefined) => {\n return color\n ? {\n 'pds-color': true,\n [`pds-color-${color}`]: true,\n }\n : null;\n };\n"],"version":3}
1
+ {"file":"pds-icon.js","mappings":";;AAEA,IAAI,uBAAuB,GAAG,KAAK;AAQnC;;;;;;;;AAQG;AACI,MAAM,YAAY,GAAG,CAAC,IAAY,KAAI;;AAC3C,IAAA,MAAM,iBAAiB,GAAG,CAAA,EAAA,GAAA,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAkB,4BAA4B,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,OAAO,CAAC,aAAa;;AAG3H,IAAA,MAAM,eAAe,GAAG,MAAM,CAAC,mBAAmB;;IAGlD,MAAM,YAAY,GAAG,mDAAmD;AAExE,IAAA,MAAM,aAAa,GAAI,KAAK,CAAC,SAAS,GAAG,iBAAiB,GAAG,iBAAiB,IAAI,eAAe,IAAI,YAAmB;;IAGxH,IAAK,aAAa,CAAC,UAAU,CAAC,+BAA+B,CAAC,IA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AC,eAAe,CAAC,WAAW;gBAChE,MAAM,EAAE,MAAM,CAAC,WAAW,IAAI,QAAQ,CAAC,eAAe,CAAC;AACxD;AACF,SAAA,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIN,MAAM,kBAAkB,GAAG,CAAC,KAAyB,KAAI;AACvD,IAAA,OAAO;AACN,UAAE;AACE,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,CAAC,CAAa,UAAA,EAAA,KAAK,CAAE,CAAA,GAAG,IAAI;AAC7B;UACD,IAAI;AACR,CAAC;;;;;;;;;;;;;;;;;;;;","names":["PdsIcon","__stencil_proxyCustomElement"],"sources":["src/components/pds-icon/assetPath.ts","src/components/pds-icon/utils.ts","src/components/pds-icon/validate.ts","src/components/pds-icon/request.ts","src/components/pds-icon/pds-icon.scss?tag=pds-icon&encapsulation=shadow","src/components/pds-icon/pds-icon.tsx"],"sourcesContent":["import { Build } from '@stencil/core';\n\nlet missingAssetPathWarning = false;\n\ndeclare global {\n interface Window {\n __PINE_ASSET_PATH__?: string\n }\n}\n\n/**\n *\n * Reads the component asset path config from meta tag or a global variable.\n * This is a temporary workaround until these issues have been addressed:\n *\n * https://github.com/ionic-team/stencil/issues/2826/\n * https://github.com/ionic-team/stencil/issues/3470\n * https://github.com/ionic-team/stencil-ds-output-targets/issues/186\n */\nexport const getAssetPath = (path: string) => {\n const metaPineAssetPath = document.head.querySelector<HTMLMetaElement>('meta[data-pine-asset-path]')?.dataset.pineAssetPath;\n\n // Get the asset path from the window object if available\n const windowAssetPath = window.__PINE_ASSET_PATH__;\n\n // Set the CDN Asset path using the latest version\n const cdnAssetPath = 'https://cdn.jsdelivr.net/npm/@pine-ds/icons/dist/';\n\n const assetBasePath = Build.isTesting ? '/dist/pds-icons' : metaPineAssetPath || windowAssetPath || cdnAssetPath || '/'\n\n // Display a warning if the assets are fetched from the CDN.\n if ( assetBasePath.startsWith('https://cdn.jsdelivr.net/npm/') && !missingAssetPathWarning ) {\n missingAssetPathWarning = true;\n console.warn(`\n Fetching Pine assets from jsDelivr CDN.\\n\\n It's recommended that you bundle Pine Assets with your application and set the path accordingly.\\n\\nFor more information, read the documentation: \\nhttps://pine-design-system.netlify.app/?path=/docs/resources-assets--docs\n `)\n }\n\n let assetPath = path;\n\n if ( path.startsWith ('./') ) {\n assetPath = path.substring(2);\n }\n\n if ( !assetBasePath.endsWith('/') ) {\n assetPath = '/' + assetPath;\n }\n\n return assetBasePath + assetPath;\n}\n\n\nexport {};\n","import { getAssetPath } from './assetPath';\n\nimport { PdsIcon } from './pds-icon';\n\nlet CACHED_MAP: Map<string, string>;\n\nexport const addIcons = (icons: { [name: string]: string; }) => {\n const map = getIconMap();\n Object.keys(icons).forEach(name => map.set(name, icons[name]));\n}\n\nexport const getIconMap = (): Map<string, string> => {\n if (typeof window === 'undefined') {\n return new Map();\n } else {\n if (!CACHED_MAP) {\n const win = window as any; // eslint-disable-line @typescript-eslint/no-explicit-any\n win.PdsIcons = win.PdsIcons || {};\n CACHED_MAP = win.PdsIcons.map = win.PdsIcons.map || new Map();\n }\n\n return CACHED_MAP;\n }\n}\n\nexport const getName = (\n iconName: string | undefined,\n icon: string | undefined\n ) => {\n\n if(!iconName && icon && !isSrc(icon)) {\n iconName = icon;\n }\n\n if (isStr(iconName)) {\n iconName = toLower(iconName);\n }\n\n if (!isStr(iconName) || iconName.trim() === '') {\n return null;\n }\n\n const invalidChars = iconName.replace(/[a-z]|-|\\d/gi,'');\n if (invalidChars != '') { return null; }\n\n return iconName;\n}\n\nconst getNamedUrl = (iconName: string) => {\n const url = getIconMap().get(iconName);\n if (url) {\n return url;\n }\n\n return getAssetPath(`svg/${iconName}.svg`);\n};\n\nexport const getSrc = (src: string | undefined) => {\n if (isStr(src)) {\n src = src.trim();\n\n if (isSrc(src)) {\n return src;\n }\n }\n\n return null;\n}\n\nexport const getUrl = (pdsIcon: PdsIcon) => {\n let url = getSrc(pdsIcon.src);\n if (url) {\n return url;\n }\n\n url = getName(pdsIcon.name, pdsIcon.icon);\n if (url) {\n return getNamedUrl(url);\n }\n\n if (pdsIcon.icon) {\n url = getSrc(pdsIcon.icon);\n\n if(url) {\n return url;\n }\n }\n\n return null;\n};\n\n\n/**\n * Returns `true` if the document or host element\n * has a `dir` set to `rtl`. The host value will always\n * take priority over the root document value.\n */\nexport const isRTL = (hostEl?: Pick<HTMLElement, 'dir'>) => {\n if (hostEl) {\n if (hostEl.dir !== '') {\n return hostEl.dir.toLowerCase() === 'rtl';\n }\n }\n return document?.dir.toLowerCase() === 'rtl';\n};\n\nexport const isSrc = (str: string) => str.length > 0 && /(\\/|\\.)/.test(str);\nexport const isStr = (val: any): val is string => typeof val === 'string'; // eslint-disable-line @typescript-eslint/no-explicit-any\nexport const toLower = (val: string) => val.toLowerCase();\n\n/**\n * Elements inside of web components sometimes need to inherit global attributes\n * set on the host. For example, the inner input in `pds-input` should inherit\n * the `title` attribute that developers set directly on `pds-input`. This\n * helper function should be called in componentWillLoad and assigned to a variable\n * that is later used in the render function.\n *\n * This does not need to be reactive as changing attributes on the host element\n * does not trigger a re-render.\n */\n export const inheritAttributes = (el: HTMLElement, attributes: string[] = []) => {\n const attributeObject: { [k: string]: any } = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n attributes.forEach(attr => {\n if (el.hasAttribute(attr)) {\n const value = el.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = el.getAttribute(attr);\n }\n el.removeAttribute(attr);\n }\n });\n\n return attributeObject;\n}\n\n/**\n * Determines if an icon should be flipped when RTL is enabled\n * @param iconName - The name of the icon to check\n * @param hostEl - Optional host element to check for RTL direction\n * @returns {boolean} - True if the icon should be flipped in RTL mode, false otherwise\n */\nexport const shouldRtlFlipIcon = (iconName: string, hostEl?: Pick<HTMLElement, 'dir'>): boolean => {\n // First check if we're in RTL mode\n const rtlEnabled = isRTL(hostEl);\n\n // Only flip if we're in RTL mode and the icon is in the flip list\n return rtlEnabled && ICONS_TO_FLIP.includes(iconName);\n}\n\n/**\n * Array of available icon names\n */\nexport const ICONS_TO_FLIP = [\n 'align-horizontal-bottom',\n 'align-horizontal-center',\n 'align-horizontal-top',\n 'align-left',\n 'align-right',\n 'align-vertical-left',\n 'align-vertical-right',\n 'arrow-corner',\n 'arrow-left',\n 'arrow-right',\n 'calendar-schedule',\n 'caret-left',\n 'caret-right',\n 'cart',\n 'cart-add',\n 'comment',\n 'comment-no',\n 'conversation',\n 'copy',\n 'copy-07',\n 'delete-key',\n 'delete-x',\n 'downsell',\n 'drawer-collapse',\n 'drawer-expand',\n 'duplicate',\n 'feedback',\n 'file-lock',\n 'file-search',\n 'form-field',\n 'form-filled',\n 'left-small',\n 'launch',\n 'list-bullet',\n 'list-numbers',\n 'margin-left',\n 'margin-right',\n 'move-left',\n 'move-right',\n 'newsletter-2',\n 'one-off-session',\n 'quote',\n 'redo',\n 'reset-password',\n 'right-small',\n 'send-message',\n 'share',\n 'super-admin',\n 'tablet-landscape',\n 'undo',\n 'user-star',\n 'user-star-filled',\n 'users',\n 'users-filled',\n 'users-tone'\n];\n\n","import { isStr } from './utils';\n\nexport const validateContent = (svgContent: string) => {\n const div = document.createElement('div');\n div.innerHTML = svgContent;\n\n // setup this way to ensure it works on our buddy IE\n for (let i = div.childNodes.length - 1; i >= 0; i--) {\n if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {\n div.removeChild(div.childNodes[i]);\n }\n }\n\n // must only have 1 root element\n const svgElm = div.firstElementChild;\n if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {\n const svgClass = svgElm.getAttribute('class') || '';\n svgElm.setAttribute('class', (svgClass + ' s-pds-icon').trim());\n\n // root element must be an svg\n // lets double check we've got valid elements\n // do not allow scripts\n if (isValid(svgElm as HTMLElement)) {\n return div.innerHTML;\n }\n }\n return '';\n};\n\nexport const isValid = (elm: HTMLElement) => {\n if (elm.nodeType === 1) {\n if (elm.nodeName.toLowerCase() === 'script') {\n return false;\n }\n\n for (let i = 0; i < elm.attributes.length; i++) {\n const name = elm.attributes[i].name;\n if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {\n return false;\n }\n }\n\n for (let i = 0; i < elm.childNodes.length; i++) {\n if (!isValid(elm.childNodes[i] as HTMLElement)) {\n return false;\n }\n }\n }\n return true;\n};\n\nexport const isSvgDataUrl = (url: string) => url.startsWith('data:image/svg+xml');\nexport const isEncodedDataUrl = (url: string) => url.indexOf(';utf8,') !== -1;\n","import { isEncodedDataUrl, isSvgDataUrl, validateContent } from './validate';\n\nexport const pdsIconContent = new Map<string, string>();\nconst requests = new Map<string, Promise<any>>(); // eslint-disable-line @typescript-eslint/no-explicit-any\n\nlet parser: DOMParser;\n\nexport const getSvgContent = (url: string, sanitize = false) => {\n let req = requests.get(url);\n\n if(!req) {\n if (typeof fetch != 'undefined' && typeof document !== 'undefined') {\n if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {\n if (!parser) {\n parser = new DOMParser();\n }\n\n try {\n const doc = parser.parseFromString(url, 'text/html');\n const svg = doc.querySelector('svg');\n\n if (svg) {\n pdsIconContent.set(url, svg.outerHTML);\n } else {\n pdsIconContent.set(url, '');\n }\n } catch (error) {\n pdsIconContent.set(url, '');\n }\n\n return Promise.resolve();\n } else {\n // we don't have a request\n req = fetch(url).then((rsp) => {\n if (rsp.ok) {\n return rsp.text().then((svgContent) => {\n if (svgContent && sanitize !== false) {\n try {\n svgContent = validateContent(svgContent);\n } catch (validationError) {\n svgContent = '';\n }\n }\n pdsIconContent.set(url, svgContent || '');\n });\n } else {\n // Handle HTTP errors\n throw new Error(`Failed to load SVG: ${rsp.status} ${rsp.statusText}`);\n }\n }).catch((error) => {\n // Handle all fetch errors gracefully\n console.warn('Failed to load SVG:', url, error);\n pdsIconContent.set(url, '');\n // Don't re-throw to prevent unhandled promise rejections\n });\n\n requests.set(url, req);\n }\n } else {\n pdsIconContent.set(url, '');\n return Promise.resolve();\n }\n }\n\n return req;\n}\n",":host {\n --dimension-icon-height: 16px;\n --dimension-icon-width: 16px;\n --color-icon-fill: currentColor;\n\n contain: strict;\n display: inline-block;\n fill: var(--color-icon-fill);\n flex-shrink: 0;\n height: var(--dimension-icon-height);\n width: var(--dimension-icon-width);\n\n .pdsicon {\n fill: var(--color-icon-fill);\n }\n}\n\n.pds-icon-fill-none {\n fill: none;\n}\n\n.icon-inner,\n.pds-icon,\nsvg {\n display: block;\n height: 100%;\n width: 100%;\n}\n\n/* :host-context is supported in chromium; :dir is supported in safari & firefox */\n:host(.flip-rtl):host-context([dir='rtl']) .icon-inner {\n transform: scaleX(-1);\n}\n\n:host(.flip-rtl:dir(rtl)) .icon-inner {\n transform: scaleX(-1);\n}\n\n/**\n * This is needed for WebKit otherwise the fallback\n * will always cause the icon to be flipped if the document\n * loads in RTL.\n */\n:host(.flip-rtl:dir(ltr)) .icon-inner {\n transform: scaleX(1);\n}\n\n","import { Build, Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { getSvgContent, pdsIconContent } from './request';\nimport { getName, getUrl, inheritAttributes, isRTL, shouldRtlFlipIcon } from './utils';\n\n@Component({\n tag: 'pds-icon',\n assetsDirs: ['svg'],\n styleUrl: 'pds-icon.scss',\n shadow: true,\n})\nexport class PdsIcon {\n private didLoadIcon = false;\n private iconName: string | null = null;\n private io?: IntersectionObserver;\n private inheritedAttributes: { [k: string]: any } = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n @Element() el!: HTMLPdsIconElement;\n\n @State() private ariaLabel?: string;\n @State() private isVisible = false;\n @State() private svgContent?: string;\n\n /**\n *\n * The color of the icon\n *\n */\n @Prop() color?: string;\n\n /**\n * Determines if the icon should be flipped when the `dir` is right-to-left (`\"rtl\"`).\n * This is automatically enabled for icons that are in the `ICONS_TO_FLIP` list and\n * when the `dir` is `\"rtl\"`. If `flipRtl` is set to `false`, the icon will not be flipped\n * even if the `dir` is `\"rtl\"`.\n */\n @Prop() flipRtl?: boolean;\n\n /**\n * This is a combination of both `name` and `src`. If a `src` URL is detected,\n * it will set the `src` property. Otherwise it assumes it's a built-in named\n * SVG and sets the `name` property.\n */\n @Prop() icon?: any;\n\n /**\n * The name of the icon to use from\n * the built-in set.\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * The size of the icon. This can be\n * 'small', 'regular', 'medium', 'large', or a\n * custom value (40px, 1rem, etc)\n *\n */\n @Prop({ reflect: true }) size?:\n | 'small' // 12px\n | 'regular' // 16px\n | 'medium' // 20px\n | 'large' // 24px\n | 'auto'\n | string = 'regular'\n\n /**\n *\n * Specifies the exact `src` of an SVG file to use.\n */\n @Prop() src?: string;\n\n private iconSize() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sizes: { [key: string]: any } = {\n small: '12px',\n regular: '16px',\n medium: '20px',\n large: '24px',\n }\n\n if (sizes[this.size]) {\n return sizes[this.size];\n } else {\n return this.size;\n }\n }\n\n componentDidLoad() {\n this.setCSSVariables();\n\n if (!this.didLoadIcon) {\n this.loadIcon();\n }\n\n // Fallback: Ensure icon loads even if IntersectionObserver doesn't fire\n setTimeout(() => {\n if (!this.svgContent && !this.isVisible) {\n this.isVisible = true;\n this.loadIcon();\n }\n }, 100);\n\n // Additional fallback for client-side navigation (React Router, etc.)\n // React's useLayoutEffect and rendering cycles can delay visibility detection\n setTimeout(() => {\n if (!this.svgContent && !this.isVisible) {\n this.isVisible = true;\n this.loadIcon();\n }\n }, 500);\n }\n\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);\n this.setCSSVariables();\n this.setupInitialAriaLabel();\n }\n\n setCSSVariables() {\n this.el.style.setProperty(`--dimension-icon-height`, this.iconSize());\n this.el.style.setProperty(`--dimension-icon-width`, this.iconSize());\n this.el.style.setProperty(`--color-icon-fill`, typeof this.color !== 'undefined' ? this.color : 'currentColor');\n }\n\n connectedCallback() {\n // Handle re-connection during client-side navigation\n if (!this.isVisible && !this.svgContent) {\n this.waitUntilVisible(this.el, '50px', () => {\n this.isVisible = true;\n this.loadIcon();\n });\n }\n\n // Immediate load attempt if already visible (e.g., during React navigation)\n if (this.isElementInViewport(this.el)) {\n this.isVisible = true;\n this.loadIcon();\n }\n }\n\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n\n @Watch('size')\n @Watch('color')\n updateStyles() {\n this.setCSSVariables();\n }\n\n @Watch('name')\n @Watch('src')\n @Watch('icon')\n onIconPropertyChange() {\n this.loadIcon();\n // Update aria-label when icon properties change\n this.setupInitialAriaLabel();\n }\n\n loadIcon() {\n // Reset load state when URL changes\n this.didLoadIcon = false;\n\n // Clear existing content to prevent stale content when switching icons\n this.svgContent = undefined;\n\n if (Build.isBrowser && this.isVisible) {\n const url = getUrl(this);\n if (url) {\n if (pdsIconContent.has(url)) {\n this.svgContent = pdsIconContent.get(url);\n } else {\n // Fix: Ensure promise callback triggers re-render and handle errors\n getSvgContent(url)\n .then(() => {\n // Force re-render by setting state in next tick\n setTimeout(() => {\n this.svgContent = pdsIconContent.get(url);\n }, 0);\n })\n .catch(() => {\n // Handle fetch errors gracefully\n this.svgContent = '';\n });\n }\n this.didLoadIcon = true;\n }\n }\n\n this.iconName = getName(this.name, this.icon);\n }\n\n render() {\n const { ariaLabel, flipRtl, iconName,inheritedAttributes } = this;\n const shouldIconAutoFlip = iconName\n ? shouldRtlFlipIcon(iconName, this.el) && flipRtl !== false\n : false;\n const shouldFlip = flipRtl || shouldIconAutoFlip;\n\n // Use inherited aria-label if provided, otherwise fall back to auto-generated one\n const finalAriaLabel = inheritedAttributes['aria-label'] || ariaLabel;\n\n return (\n\n <Host\n aria-label={finalAriaLabel !== undefined && !this.hasAriaHidden() ? finalAriaLabel : null }\n alt=\"\"\n role=\"img\"\n class={{\n ...createColorClasses(this.color),\n 'flip-rtl': shouldFlip,\n 'icon-rtl': shouldFlip && isRTL(this.el)\n }}\n {...inheritedAttributes}\n >\n {Build.isBrowser && this.svgContent ? (\n <div class=\"icon-inner\" innerHTML={this.svgContent}></div>\n ) : (\n <div class=\"icon-inner\"></div>\n )}\n </Host>\n )\n }\n\n /*****\n * Private Methods\n ****/\n\n private setupInitialAriaLabel() {\n // Only set aria-label during initial load if one isn't already provided\n if (!this.inheritedAttributes['aria-label']) {\n const iconName = getName(this.name, this.icon);\n if (iconName) {\n this.ariaLabel = iconName.replace(/\\-/g, ' ');\n }\n }\n }\n\n private waitUntilVisible(el: HTMLElement, rootMargin: string, cb: () => void) {\n if (Build.isBrowser && typeof window !== 'undefined' && (window).IntersectionObserver) {\n const io = (this.io = new (window).IntersectionObserver(\n (data: IntersectionObserverEntry[]) => {\n if (data[0].isIntersecting) {\n io.disconnect();\n this.io = undefined;\n cb();\n }\n },\n { rootMargin },\n ));\n\n io.observe(el);\n\n // Safety timeout for client-side navigation scenarios\n // Sometimes IntersectionObserver doesn't fire during React navigation\n setTimeout(() => {\n if (this.io && !this.isVisible) {\n // Check if element is actually visible in viewport\n if (this.isElementInViewport(el)) {\n this.io.disconnect();\n this.io = undefined;\n cb();\n }\n }\n }, 1000);\n } else {\n // browser doesn't support IntersectionObserver\n // so just fallback to always show it\n cb();\n }\n }\n\n private isElementInViewport(el: HTMLElement): boolean {\n if (!el || !el.isConnected) return false;\n\n const rect = el.getBoundingClientRect();\n const windowHeight = window.innerHeight || document.documentElement.clientHeight;\n const windowWidth = window.innerWidth || document.documentElement.clientWidth;\n\n return (\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= windowHeight &&\n rect.right <= windowWidth\n ) || (\n // Also consider partially visible elements\n rect.top < windowHeight &&\n rect.bottom > 0 &&\n rect.left < windowWidth &&\n rect.right > 0\n );\n }\n\n private hasAriaHidden = () => {\n const { el } = this;\n\n return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';\n }\n\n /**\n * Debug method to help diagnose loading issues\n * Call from browser console: document.querySelector('pds-icon').debugIconState()\n */\n debugIconState() {\n const url = getUrl(this);\n const rect = this.el.getBoundingClientRect();\n\n console.log('PdsIcon Debug State:', {\n name: this.name,\n src: this.src,\n icon: this.icon,\n iconName: this.iconName,\n url,\n isVisible: this.isVisible,\n didLoadIcon: this.didLoadIcon,\n hasSvgContent: !!this.svgContent,\n svgContentLength: this.svgContent?.length || 0,\n isInCache: url ? pdsIconContent.has(url) : false,\n cachedContent: url ? pdsIconContent.get(url) : null,\n element: this.el,\n // Client-side navigation specific debug info\n isConnected: this.el.isConnected,\n isInViewport: this.isElementInViewport(this.el),\n hasIntersectionObserver: !!this.io,\n boundingClientRect: rect,\n windowDimensions: {\n width: window.innerWidth || document.documentElement.clientWidth,\n height: window.innerHeight || document.documentElement.clientHeight\n }\n });\n }\n}\n\nconst createColorClasses = (color: string | undefined) => {\n return color\n ? {\n 'pds-color': true,\n [`pds-color-${color}`]: true,\n }\n : null;\n };\n"],"version":3}
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8">
5
- <title>Pine icons Library - 9.6.0</title>
5
+ <title>Pine icons Library - 9.6.2</title>
6
6
  <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🌲</text></svg>"/>
7
7
 
8
8
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -199,11 +199,11 @@
199
199
  </head>
200
200
  <body>
201
201
  <div class="icon-count-container">
202
- <p class="icon-count">369 icons</p>
202
+ <p class="icon-count">370 icons</p>
203
203
  </div>
204
- <h1>Pine Icons - 9.6.0</h1>
204
+ <h1>Pine Icons - 9.6.2</h1>
205
205
  <div class="search-container">
206
- <label for="search" class="visually-hidden">Search all 369 icons</label>
206
+ <label for="search" class="visually-hidden">Search all 370 icons</label>
207
207
  <input type="text" id="search" class="search-input" placeholder="Search icons by name or tag..." oninput="filterIcons(this.value)">
208
208
  </div>
209
209
 
@@ -520,6 +520,7 @@
520
520
  <button class="icon-button" title="Copy skipped code snippet" data-tags="address,approved,cancel,check,checked,complete,completed,direction,done,gps,location,map,mark,navigation,position,route,street,tick" data-icon-name="skipped"><pds-icon name="skipped"></pds-icon><span class="visually-hidden">Copy skipped icon code</span></button>
521
521
  <button class="icon-button" title="Copy slash-divider code snippet" data-tags="divide,divider,no,slash" data-icon-name="slash-divider"><pds-icon name="slash-divider"></pds-icon><span class="visually-hidden">Copy slash-divider icon code</span></button>
522
522
  <button class="icon-button" title="Copy speaker code snippet" data-tags="announcement,megaphone,speaker" data-icon-name="speaker"><pds-icon name="speaker"></pds-icon><span class="visually-hidden">Copy speaker icon code</span></button>
523
+ <button class="icon-button" title="Copy speedometer code snippet" data-tags="dial,meter,revs,speed,speedometer" data-icon-name="speedometer"><pds-icon name="speedometer"></pds-icon><span class="visually-hidden">Copy speedometer icon code</span></button>
523
524
  <button class="icon-button" title="Copy split code snippet" data-tags="split" data-icon-name="split"><pds-icon name="split"></pds-icon><span class="visually-hidden">Copy split icon code</span></button>
524
525
  <button class="icon-button" title="Copy square-dollar code snippet" data-tags="editor,italic,italics,rich text,text" data-icon-name="square-dollar"><pds-icon name="square-dollar"></pds-icon><span class="visually-hidden">Copy square-dollar icon code</span></button>
525
526
  <button class="icon-button" title="Copy stack code snippet" data-tags="isometic,layer,layers,stack,three" data-icon-name="stack"><pds-icon name="stack"></pds-icon><span class="visually-hidden">Copy stack icon code</span></button>
@@ -580,7 +581,7 @@
580
581
  <button class="icon-button" title="Copy wrench code snippet" data-tags="preferences,settings,spanner,tool,tools" data-icon-name="wrench"><pds-icon name="wrench"></pds-icon><span class="visually-hidden">Copy wrench icon code</span></button>
581
582
  <button class="icon-button" title="Copy zoom-in code snippet" data-tags="plus,zoom,zoom in" data-icon-name="zoom-in"><pds-icon name="zoom-in"></pds-icon><span class="visually-hidden">Copy zoom-in icon code</span></button>
582
583
  <button class="icon-button" title="Copy zoom-out code snippet" data-tags="minus,zoom,zoom out" data-icon-name="zoom-out"><pds-icon name="zoom-out"></pds-icon><span class="visually-hidden">Copy zoom-out icon code</span></button>
583
- <svg data-pdsicons="9.6.0" style="display:none">
584
+ <svg data-pdsicons="9.6.2" style="display:none">
584
585
  <style>
585
586
  .pdsicon {
586
587
  fill: currentColor;
@@ -901,6 +902,7 @@
901
902
  <symbol id="skipped" viewBox="0 0 24 24" class="pdsicon"><path fill-rule="evenodd" d="M22.648 1.212c.222.19.352.48.352.788v9c0 .552-.41 1-.917 1-.506 0-.916-.448-.916-1V3.28l-6.195 1.69a.84.84 0 0 1-.512-.021L9.213 3.04l-6.38 1.74v15.938l6.195-1.69a.84.84 0 0 1 .512.022l2.75 1c.48.175.74.741.58 1.265s-.68.807-1.16.633l-2.497-.908-7.074 1.93a.86.86 0 0 1-.786-.183A1.03 1.03 0 0 1 1 22V4c0-.459.286-.859.694-.97l7.334-2a.84.84 0 0 1 .512.021l5.247 1.908 7.074-1.93a.86.86 0 0 1 .787.183m-.833 14.08c.358.391.358 1.025 0 1.415L19.713 19l2.102 2.293c.358.39.358 1.024 0 1.414a.864.864 0 0 1-1.297 0l-2.101-2.293-2.102 2.293a.864.864 0 0 1-1.297 0 1.065 1.065 0 0 1 0-1.414L17.12 19l-2.102-2.293a1.065 1.065 0 0 1 0-1.414.864.864 0 0 1 1.297 0l2.102 2.293 2.101-2.293a.864.864 0 0 1 1.297 0"/></symbol>
902
903
  <symbol id="slash-divider" viewBox="0 0 24 24" class="pdsicon"><path fill-rule="evenodd" d="M17.447 1.106a1 1 0 0 1 .447 1.341l-10 20a1 1 0 1 1-1.788-.894l10-20a1 1 0 0 1 1.341-.447"/></symbol>
903
904
  <symbol id="speaker" viewBox="0 0 24 24" class="pdsicon"><path fill-rule="evenodd" d="M17.39 4.022c-.24.108-.566.285-1.067.558-1.674.913-4.031 1.978-6.073 1.978H6.8c-.857 0-1.439 0-1.889.037-.438.036-.663.101-.819.18a2 2 0 0 0-.874.875c-.08.156-.145.38-.18.819C3 8.919 3 9.5 3 10.358v1.2c0 .48 0 .789.017 1.026.015.228.042.315.06.356a1 1 0 0 0 .54.542c.042.017.129.043.357.059.237.016.546.017 1.026.017a1 1 0 0 1 1 1v4.25c0 .256.001.311.005.348a1 1 0 0 0 .897.897c.037.003.092.005.348.005s.311-.002.348-.005a1 1 0 0 0 .897-.897c.004-.037.005-.092.005-.348v-4.25a1 1 0 0 1 1-1h.75c2.042 0 4.399 1.065 6.073 1.977.501.274.826.45 1.067.558q.047.022.083.037l.007-.07c.02-.245.02-.589.02-1.129V5.184c0-.54 0-.884-.02-1.128l-.007-.07zm-.823-1.823c.292-.132.718-.302 1.176-.246.573.07 1.048.352 1.384.822.264.369.321.807.347 1.122.026.334.026.76.026 1.247v9.828c0 .487 0 .912-.026 1.246-.026.316-.083.754-.347 1.123-.336.47-.81.751-1.384.821-.458.056-.884-.114-1.176-.246-.318-.143-.71-.357-1.167-.606l-.034-.019c-1.569-.855-3.41-1.642-4.866-1.726v3.285c0 .19 0 .354-.014.502a3 3 0 0 1-2.692 2.691c-.148.015-.312.015-.502.015h-.084c-.19 0-.354 0-.502-.015a3 3 0 0 1-2.692-2.691C4 19.204 4 19.04 4 18.85v-3.305l-.162-.009a3 3 0 0 1-.986-.207 3 3 0 0 1-1.624-1.623 3 3 0 0 1-.207-.986C1 12.407 1 12.028 1 11.59v-1.274c0-.805 0-1.469.044-2.01.046-.562.145-1.079.392-1.564a4 4 0 0 1 1.748-1.748c.485-.248 1.002-.346 1.564-.392.541-.044 1.206-.044 2.01-.044h3.492c1.491 0 3.456-.83 5.116-1.734l.034-.019c.457-.249.85-.463 1.167-.606M22 7.058a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0v-4a1 1 0 0 1 1-1"/></symbol>
905
+ <symbol id="speedometer" viewBox="0 0 24 24" class="pdsicon"><path d="M21 12a9 9 0 1 0-18 0 9 9 0 0 0 18 0m-5.207-5.207a1 1 0 1 1 1.414 1.414l-3.277 3.276q.068.248.07.517a2 2 0 1 1-1.484-1.93zM4 12a8 8 0 0 1 8-8 1 1 0 1 1 0 2 6 6 0 0 0-6 6 1 1 0 1 1-2 0m19 0c0 6.075-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1s11 4.925 11 11"/></symbol>
904
906
  <symbol id="split" viewBox="0 0 24 24" class="pdsicon"><path fill-rule="evenodd" d="M3 23h5a1 1 0 1 0 0-2H5.414l6.12-6.12A5 5 0 0 0 13 11.294V3a1 1 0 1 0-2 0v8.31a3 3 0 0 1-.879 2.155L4 19.585V17a1 1 0 1 0-2 0v5a1 1 0 0 0 1 1m15.586-2H16a1 1 0 1 0 0 2h5a1 1 0 0 0 1-1v-5a1 1 0 1 0-2 0v2.586l-4.293-4.293a1 1 0 0 0-1.414 1.414z"/></symbol>
905
907
  <symbol id="square-dollar" viewBox="0 0 24 24" class="pdsicon"><path d="M16.241 2c.805 0 1.47 0 2.011.044.562.046 1.08.144 1.564.392a4 4 0 0 1 1.749 1.748c.247.485.345 1.002.391 1.564C22 6.29 22 6.954 22 7.758v8.483c0 .805 0 1.47-.044 2.011-.046.562-.144 1.08-.392 1.564a4 4 0 0 1-1.748 1.749c-.485.247-1.002.345-1.564.391-.541.044-1.206.044-2.01.044H7.758c-.805 0-1.47 0-2.011-.044-.562-.046-1.08-.144-1.564-.392a4 4 0 0 1-1.748-1.748c-.248-.485-.346-1.002-.392-1.564C2 17.711 2 17.046 2 16.242V7.758c0-.805 0-1.47.044-2.011.046-.562.144-1.08.392-1.564a4 4 0 0 1 1.748-1.748c.485-.248 1.002-.346 1.564-.392C6.29 2 6.954 2 7.758 2zM7.8 4c-.857 0-1.439 0-1.889.037-.438.036-.663.101-.82.18a2 2 0 0 0-.873.875c-.08.156-.145.38-.18.82C4 6.361 4 6.942 4 7.8v8.4c0 .857 0 1.439.037 1.889.036.438.101.663.18.82a2 2 0 0 0 .875.873c.156.08.38.145.82.18C6.361 20 6.942 20 7.8 20h8.4c.857 0 1.439 0 1.889-.037.438-.036.663-.101.82-.18a2 2 0 0 0 .873-.875c.08-.156.145-.38.18-.82.038-.45.038-1.031.038-1.888V7.8c0-.857 0-1.439-.037-1.889-.036-.438-.101-.663-.18-.82a2 2 0 0 0-.875-.873c-.156-.08-.38-.145-.82-.18C17.639 4 17.058 4 16.2 4zM12 5.25a1 1 0 0 1 1 1v.327h.032a3.064 3.064 0 0 1 3.065 3.064 1 1 0 0 1-2 0c0-.588-.477-1.064-1.065-1.064h-1.916a1.212 1.212 0 1 0 0 2.423h1.769A3.212 3.212 0 0 1 13 17.42v.33a1 1 0 1 1-2 0v-.327h-.031a3.064 3.064 0 0 1-3.065-3.064 1 1 0 1 1 2 0c0 .588.477 1.064 1.065 1.064h1.916a1.212 1.212 0 1 0 0-2.423h-1.769A3.212 3.212 0 0 1 11 6.58v-.33a1 1 0 0 1 1-1"/></symbol>
906
908
  <symbol id="stack" viewBox="0 0 24 24" class="pdsicon"><path fill-rule="evenodd" d="M12 3.118 19.764 7 12 10.882 4.236 7zm-.277-2.033a1.5 1.5 0 0 1 .554 0 1.9 1.9 0 0 1 .528.2l9.642 4.82a1 1 0 0 1 0 1.79l-9.642 4.82-.026.014c-.093.047-.286.146-.502.186a1.5 1.5 0 0 1-.554 0c-.216-.04-.41-.139-.502-.186l-.026-.013-9.642-4.822a1 1 0 0 1 0-1.788l9.642-4.822.026-.013c.093-.047.286-.146.502-.186M1.106 11.553a1 1 0 0 1 1.341-.447L12 15.882l9.553-4.776a1 1 0 1 1 .894 1.788l-9.642 4.821-.026.014c-.093.047-.286.146-.502.186a1.5 1.5 0 0 1-.554 0c-.216-.04-.41-.139-.502-.186l-.026-.014-9.642-4.82a1 1 0 0 1-.447-1.342m0 5a1 1 0 0 1 1.341-.447L12 20.882l9.553-4.776a1 1 0 1 1 .894 1.788l-9.642 4.822-.026.012c-.093.048-.286.147-.502.187a1.5 1.5 0 0 1-.554 0c-.216-.04-.41-.139-.502-.186l-.026-.014-9.642-4.82a1 1 0 0 1-.447-1.342"/></symbol>
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
6
6
  const defineCustomElements = async (win, options) => {
7
7
  if (typeof window === 'undefined') return undefined;
8
8
  await appGlobals.globalScripts();
9
- return index.bootstrapLazy([["pds-icon.cjs",[[1,"pds-icon",{"color":[1],"flipRtl":[4,"flip-rtl"],"icon":[8],"name":[513],"size":[513],"src":[1],"ariaLabel":[32],"isVisible":[32],"svgContent":[32]},null,{"size":["updateStyles"],"color":["updateStyles"],"name":["loadIcon"],"src":["loadIcon"],"icon":["loadIcon"]}]]]], options);
9
+ return index.bootstrapLazy([["pds-icon.cjs",[[1,"pds-icon",{"color":[1],"flipRtl":[4,"flip-rtl"],"icon":[8],"name":[513],"size":[513],"src":[1],"ariaLabel":[32],"isVisible":[32],"svgContent":[32]},null,{"size":["updateStyles"],"color":["updateStyles"],"name":["onIconPropertyChange"],"src":["onIconPropertyChange"],"icon":["onIconPropertyChange"]}]]]], options);
10
10
  };
11
11
 
12
12
  exports.setNonce = index.setNonce;
@@ -171,6 +171,7 @@ const PdsIcon = class {
171
171
  componentWillLoad() {
172
172
  this.inheritedAttributes = index.inheritAttributes(this.el, ['aria-label']);
173
173
  this.setCSSVariables();
174
+ this.setupInitialAriaLabel();
174
175
  }
175
176
  setCSSVariables() {
176
177
  this.el.style.setProperty(`--dimension-icon-height`, this.iconSize());
@@ -200,6 +201,11 @@ const PdsIcon = class {
200
201
  updateStyles() {
201
202
  this.setCSSVariables();
202
203
  }
204
+ onIconPropertyChange() {
205
+ this.loadIcon();
206
+ // Update aria-label when icon properties change
207
+ this.setupInitialAriaLabel();
208
+ }
203
209
  loadIcon() {
204
210
  // Reset load state when URL changes
205
211
  this.didLoadIcon = false;
@@ -229,9 +235,6 @@ const PdsIcon = class {
229
235
  }
230
236
  }
231
237
  this.iconName = index.getName(this.name, this.icon);
232
- if (this.iconName) {
233
- this.ariaLabel = this.iconName.replace(/\-/g, ' ');
234
- }
235
238
  }
236
239
  render() {
237
240
  const { ariaLabel, flipRtl, iconName, inheritedAttributes } = this;
@@ -239,11 +242,22 @@ const PdsIcon = class {
239
242
  ? index.shouldRtlFlipIcon(iconName, this.el) && flipRtl !== false
240
243
  : false;
241
244
  const shouldFlip = flipRtl || shouldIconAutoFlip;
242
- return (index$1.h(index$1.Host, Object.assign({ key: '48056743bf1a60bbf905a0779702fd366b86659d', "aria-label": ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null, alt: "", role: "img", class: Object.assign(Object.assign({}, createColorClasses(this.color)), { 'flip-rtl': shouldFlip, 'icon-rtl': shouldFlip && index.isRTL(this.el) }) }, inheritedAttributes), this.svgContent ? (index$1.h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (index$1.h("div", { class: "icon-inner" }))));
245
+ // Use inherited aria-label if provided, otherwise fall back to auto-generated one
246
+ const finalAriaLabel = inheritedAttributes['aria-label'] || ariaLabel;
247
+ return (index$1.h(index$1.Host, Object.assign({ key: '43aa73531314e6529a887468e69362430d006229', "aria-label": finalAriaLabel !== undefined && !this.hasAriaHidden() ? finalAriaLabel : null, alt: "", role: "img", class: Object.assign(Object.assign({}, createColorClasses(this.color)), { 'flip-rtl': shouldFlip, 'icon-rtl': shouldFlip && index.isRTL(this.el) }) }, inheritedAttributes), this.svgContent ? (index$1.h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (index$1.h("div", { class: "icon-inner" }))));
243
248
  }
244
249
  /*****
245
250
  * Private Methods
246
251
  ****/
252
+ setupInitialAriaLabel() {
253
+ // Only set aria-label during initial load if one isn't already provided
254
+ if (!this.inheritedAttributes['aria-label']) {
255
+ const iconName = index.getName(this.name, this.icon);
256
+ if (iconName) {
257
+ this.ariaLabel = iconName.replace(/\-/g, ' ');
258
+ }
259
+ }
260
+ }
247
261
  waitUntilVisible(el, rootMargin, cb) {
248
262
  if (typeof window !== 'undefined' && (window).IntersectionObserver) {
249
263
  const io = (this.io = new (window).IntersectionObserver((data) => {
@@ -326,9 +340,9 @@ const PdsIcon = class {
326
340
  static get watchers() { return {
327
341
  "size": ["updateStyles"],
328
342
  "color": ["updateStyles"],
329
- "name": ["loadIcon"],
330
- "src": ["loadIcon"],
331
- "icon": ["loadIcon"]
343
+ "name": ["onIconPropertyChange"],
344
+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Ae,CAAC,WAAW;gBAChE,MAAM,EAAE,MAAM,CAAC,WAAW,IAAI,QAAQ,CAAC,eAAe,CAAC;AACxD;AACF,SAAA,CAAC;;;;;;;;;;;;AAIN,MAAM,kBAAkB,GAAG,CAAC,KAAyB,KAAI;AACvD,IAAA,OAAO;AACN,UAAE;AACE,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,CAAC,CAAa,UAAA,EAAA,KAAK,CAAE,CAAA,GAAG,IAAI;AAC7B;UACD,IAAI;AACR,CAAC;;;;;","names":["isStr","inheritAttributes","getUrl","getName","shouldRtlFlipIcon","h","Host","isRTL"],"sources":["src/components/pds-icon/validate.ts","src/components/pds-icon/request.ts","src/components/pds-icon/pds-icon.scss?tag=pds-icon&encapsulation=shadow","src/components/pds-icon/pds-icon.tsx"],"sourcesContent":["import { isStr } from './utils';\n\nexport const validateContent = (svgContent: string) => {\n const div = document.createElement('div');\n div.innerHTML = svgContent;\n\n // setup this way to ensure it works on our buddy IE\n for (let i = div.childNodes.length - 1; i >= 0; i--) {\n if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {\n div.removeChild(div.childNodes[i]);\n }\n }\n\n // must only have 1 root element\n const svgElm = div.firstElementChild;\n if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {\n const svgClass = svgElm.getAttribute('class') || '';\n svgElm.setAttribute('class', (svgClass + ' s-pds-icon').trim());\n\n // root element must be an svg\n // lets double check we've got valid elements\n // do not allow scripts\n if (isValid(svgElm as HTMLElement)) {\n return div.innerHTML;\n }\n }\n return '';\n};\n\nexport const isValid = (elm: HTMLElement) => {\n if (elm.nodeType === 1) {\n if (elm.nodeName.toLowerCase() === 'script') {\n return false;\n }\n\n for (let i = 0; i < elm.attributes.length; i++) {\n const name = elm.attributes[i].name;\n if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {\n return false;\n }\n }\n\n for (let i = 0; i < elm.childNodes.length; i++) {\n if (!isValid(elm.childNodes[i] as HTMLElement)) {\n return false;\n }\n }\n }\n return true;\n};\n\nexport const isSvgDataUrl = (url: string) => url.startsWith('data:image/svg+xml');\nexport const isEncodedDataUrl = (url: string) => url.indexOf(';utf8,') !== -1;\n","import { isEncodedDataUrl, isSvgDataUrl, validateContent } from './validate';\n\nexport const pdsIconContent = new Map<string, string>();\nconst requests = new Map<string, Promise<any>>(); // eslint-disable-line @typescript-eslint/no-explicit-any\n\nlet parser: DOMParser;\n\nexport const getSvgContent = (url: string, sanitize = false) => {\n let req = requests.get(url);\n\n if(!req) {\n if (typeof fetch != 'undefined' && typeof document !== 'undefined') {\n if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {\n if (!parser) {\n parser = new DOMParser();\n }\n\n try {\n const doc = parser.parseFromString(url, 'text/html');\n const svg = doc.querySelector('svg');\n\n if (svg) {\n pdsIconContent.set(url, svg.outerHTML);\n } else {\n pdsIconContent.set(url, '');\n }\n } catch (error) {\n pdsIconContent.set(url, '');\n }\n\n return Promise.resolve();\n } else {\n // we don't have a request\n req = fetch(url).then((rsp) => {\n if (rsp.ok) {\n return rsp.text().then((svgContent) => {\n if (svgContent && sanitize !== false) {\n try {\n svgContent = validateContent(svgContent);\n } catch (validationError) {\n svgContent = '';\n }\n }\n pdsIconContent.set(url, svgContent || '');\n });\n } else {\n // Handle HTTP errors\n throw new Error(`Failed to load SVG: ${rsp.status} ${rsp.statusText}`);\n }\n }).catch((error) => {\n // Handle all fetch errors gracefully\n console.warn('Failed to load SVG:', url, error);\n pdsIconContent.set(url, '');\n // Don't re-throw to prevent unhandled promise rejections\n });\n\n requests.set(url, req);\n }\n } else {\n pdsIconContent.set(url, '');\n return Promise.resolve();\n }\n }\n\n return req;\n}\n",":host {\n --dimension-icon-height: 16px;\n --dimension-icon-width: 16px;\n --color-icon-fill: currentColor;\n\n contain: strict;\n display: inline-block;\n fill: var(--color-icon-fill);\n flex-shrink: 0;\n height: var(--dimension-icon-height);\n width: var(--dimension-icon-width);\n\n .pdsicon {\n fill: var(--color-icon-fill);\n }\n}\n\n.pds-icon-fill-none {\n fill: none;\n}\n\n.icon-inner,\n.pds-icon,\nsvg {\n display: block;\n height: 100%;\n width: 100%;\n}\n\n/* :host-context is supported in chromium; :dir is supported in safari & firefox */\n:host(.flip-rtl):host-context([dir='rtl']) .icon-inner {\n transform: scaleX(-1);\n}\n\n:host(.flip-rtl:dir(rtl)) .icon-inner {\n transform: scaleX(-1);\n}\n\n/**\n * This is needed for WebKit otherwise the fallback\n * will always cause the icon to be flipped if the document\n * loads in RTL.\n */\n:host(.flip-rtl:dir(ltr)) .icon-inner {\n transform: scaleX(1);\n}\n\n","import { Build, Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { getSvgContent, pdsIconContent } from './request';\nimport { getName, getUrl, inheritAttributes, isRTL, shouldRtlFlipIcon } from './utils';\n\n@Component({\n tag: 'pds-icon',\n assetsDirs: ['svg'],\n styleUrl: 'pds-icon.scss',\n shadow: true,\n})\nexport class PdsIcon {\n private didLoadIcon = false;\n private iconName: string | null = null;\n private io?: IntersectionObserver;\n private inheritedAttributes: { [k: string]: any } = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n @Element() el!: HTMLPdsIconElement;\n\n @State() private ariaLabel?: string;\n @State() private isVisible = false;\n @State() private svgContent?: string;\n\n /**\n *\n * The color of the icon\n *\n */\n @Prop() color?: string;\n\n /**\n * Determines if the icon should be flipped when the `dir` is right-to-left (`\"rtl\"`).\n * This is automatically enabled for icons that are in the `ICONS_TO_FLIP` list and\n * when the `dir` is `\"rtl\"`. If `flipRtl` is set to `false`, the icon will not be flipped\n * even if the `dir` is `\"rtl\"`.\n */\n @Prop() flipRtl?: boolean;\n\n /**\n * This is a combination of both `name` and `src`. If a `src` URL is detected,\n * it will set the `src` property. Otherwise it assumes it's a built-in named\n * SVG and sets the `name` property.\n */\n @Prop() icon?: any;\n\n /**\n * The name of the icon to use from\n * the built-in set.\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * The size of the icon. This can be\n * 'small', 'regular', 'medium', 'large', or a\n * custom value (40px, 1rem, etc)\n *\n */\n @Prop({ reflect: true }) size?:\n | 'small' // 12px\n | 'regular' // 16px\n | 'medium' // 20px\n | 'large' // 24px\n | 'auto'\n | string = 'regular'\n\n /**\n *\n * Specifies the exact `src` of an SVG file to use.\n */\n @Prop() src?: string;\n\n private iconSize() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sizes: { [key: string]: any } = {\n small: '12px',\n regular: '16px',\n medium: '20px',\n large: '24px',\n }\n\n if (sizes[this.size]) {\n return sizes[this.size];\n } else {\n return this.size;\n }\n }\n\n componentDidLoad() {\n this.setCSSVariables();\n\n if (!this.didLoadIcon) {\n this.loadIcon();\n }\n\n // Fallback: Ensure icon loads even if IntersectionObserver doesn't fire\n setTimeout(() => {\n if (!this.svgContent && !this.isVisible) {\n this.isVisible = true;\n this.loadIcon();\n }\n }, 100);\n\n // Additional fallback for client-side navigation (React Router, etc.)\n // React's useLayoutEffect and rendering cycles can delay visibility detection\n setTimeout(() => {\n if (!this.svgContent && !this.isVisible) {\n this.isVisible = true;\n this.loadIcon();\n }\n }, 500);\n }\n\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);\n this.setCSSVariables();\n }\n\n setCSSVariables() {\n this.el.style.setProperty(`--dimension-icon-height`, this.iconSize());\n this.el.style.setProperty(`--dimension-icon-width`, this.iconSize());\n this.el.style.setProperty(`--color-icon-fill`, typeof this.color !== 'undefined' ? this.color : 'currentColor');\n }\n\n connectedCallback() {\n // Handle re-connection during client-side navigation\n if (!this.isVisible && !this.svgContent) {\n this.waitUntilVisible(this.el, '50px', () => {\n this.isVisible = true;\n this.loadIcon();\n });\n }\n\n // Immediate load attempt if already visible (e.g., during React navigation)\n if (this.isElementInViewport(this.el)) {\n this.isVisible = true;\n this.loadIcon();\n }\n }\n\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n\n @Watch('size')\n @Watch('color')\n updateStyles() {\n this.setCSSVariables();\n }\n\n @Watch('name')\n @Watch('src')\n @Watch('icon')\n loadIcon() {\n // Reset load state when URL changes\n this.didLoadIcon = false;\n\n // Clear existing content to prevent stale content when switching icons\n this.svgContent = undefined;\n\n if (Build.isBrowser && this.isVisible) {\n const url = getUrl(this);\n if (url) {\n if (pdsIconContent.has(url)) {\n this.svgContent = pdsIconContent.get(url);\n } else {\n // Fix: Ensure promise callback triggers re-render and handle errors\n getSvgContent(url)\n .then(() => {\n // Force re-render by setting state in next tick\n setTimeout(() => {\n this.svgContent = pdsIconContent.get(url);\n }, 0);\n })\n .catch(() => {\n // Handle fetch errors gracefully\n this.svgContent = '';\n });\n }\n this.didLoadIcon = true;\n }\n }\n\n this.iconName = getName(this.name, this.icon);\n\n if (this.iconName) {\n this.ariaLabel = this.iconName.replace(/\\-/g, ' ');\n }\n }\n\n render() {\n const { ariaLabel, flipRtl, iconName,inheritedAttributes } = this;\n const shouldIconAutoFlip = iconName\n ? shouldRtlFlipIcon(iconName, this.el) && flipRtl !== false\n : false;\n const shouldFlip = flipRtl || shouldIconAutoFlip;\n\n return (\n\n <Host\n aria-label={ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null }\n alt=\"\"\n role=\"img\"\n class={{\n ...createColorClasses(this.color),\n 'flip-rtl': shouldFlip,\n 'icon-rtl': shouldFlip && isRTL(this.el)\n }}\n {...inheritedAttributes}\n >\n {Build.isBrowser && this.svgContent ? (\n <div class=\"icon-inner\" innerHTML={this.svgContent}></div>\n ) : (\n <div class=\"icon-inner\"></div>\n )}\n </Host>\n )\n }\n\n /*****\n * Private Methods\n ****/\n\n private waitUntilVisible(el: HTMLElement, rootMargin: string, cb: () => void) {\n if (Build.isBrowser && typeof window !== 'undefined' && (window).IntersectionObserver) {\n const io = (this.io = new (window).IntersectionObserver(\n (data: IntersectionObserverEntry[]) => {\n if (data[0].isIntersecting) {\n io.disconnect();\n this.io = undefined;\n cb();\n }\n },\n { rootMargin },\n ));\n\n io.observe(el);\n\n // Safety timeout for client-side navigation scenarios\n // Sometimes IntersectionObserver doesn't fire during React navigation\n setTimeout(() => {\n if (this.io && !this.isVisible) {\n // Check if element is actually visible in viewport\n if (this.isElementInViewport(el)) {\n this.io.disconnect();\n this.io = undefined;\n cb();\n }\n }\n }, 1000);\n } else {\n // browser doesn't support IntersectionObserver\n // so just fallback to always show it\n cb();\n }\n }\n\n private isElementInViewport(el: HTMLElement): boolean {\n if (!el || !el.isConnected) return false;\n\n const rect = el.getBoundingClientRect();\n const windowHeight = window.innerHeight || document.documentElement.clientHeight;\n const windowWidth = window.innerWidth || document.documentElement.clientWidth;\n\n return (\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= windowHeight &&\n rect.right <= windowWidth\n ) || (\n // Also consider partially visible elements\n rect.top < windowHeight &&\n rect.bottom > 0 &&\n rect.left < windowWidth &&\n rect.right > 0\n );\n }\n\n private hasAriaHidden = () => {\n const { el } = this;\n\n return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';\n }\n\n /**\n * Debug method to help diagnose loading issues\n * Call from browser console: document.querySelector('pds-icon').debugIconState()\n */\n debugIconState() {\n const url = getUrl(this);\n const rect = this.el.getBoundingClientRect();\n\n console.log('PdsIcon Debug State:', {\n name: this.name,\n src: this.src,\n icon: this.icon,\n iconName: this.iconName,\n url,\n isVisible: this.isVisible,\n didLoadIcon: this.didLoadIcon,\n hasSvgContent: !!this.svgContent,\n svgContentLength: this.svgContent?.length || 0,\n isInCache: url ? pdsIconContent.has(url) : false,\n cachedContent: url ? pdsIconContent.get(url) : null,\n element: this.el,\n // Client-side navigation specific debug info\n isConnected: this.el.isConnected,\n isInViewport: this.isElementInViewport(this.el),\n hasIntersectionObserver: !!this.io,\n boundingClientRect: rect,\n windowDimensions: {\n width: window.innerWidth || document.documentElement.clientWidth,\n height: window.innerHeight || document.documentElement.clientHeight\n }\n });\n }\n}\n\nconst createColorClasses = (color: string | undefined) => {\n return color\n ? {\n 'pds-color': true,\n [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I,CAAC,EAAE,CAAC,WAAW;YAChC,YAAY,EAAE,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;AAC/C,YAAA,uBAAuB,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE;AAClC,YAAA,kBAAkB,EAAE,IAAI;AACxB,YAAA,gBAAgB,EAAE;gBAChB,KAAK,EAAE,MAAM,CAAC,UAAU,IAAI,QAAQ,CAAC,eAAe,CAAC,WAAW;gBAChE,MAAM,EAAE,MAAM,CAAC,WAAW,IAAI,QAAQ,CAAC,eAAe,CAAC;AACxD;AACF,SAAA,CAAC;;;;;;;;;;;;AAIN,MAAM,kBAAkB,GAAG,CAAC,KAAyB,KAAI;AACvD,IAAA,OAAO;AACN,UAAE;AACE,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,CAAC,CAAa,UAAA,EAAA,KAAK,CAAE,CAAA,GAAG,IAAI;AAC7B;UACD,IAAI;AACR,CAAC;;;;;","names":["isStr","inheritAttributes","getUrl","getName","shouldRtlFlipIcon","h","Host","isRTL"],"sources":["src/components/pds-icon/validate.ts","src/components/pds-icon/request.ts","src/components/pds-icon/pds-icon.scss?tag=pds-icon&encapsulation=shadow","src/components/pds-icon/pds-icon.tsx"],"sourcesContent":["import { isStr } from './utils';\n\nexport const validateContent = (svgContent: string) => {\n const div = document.createElement('div');\n div.innerHTML = svgContent;\n\n // setup this way to ensure it works on our buddy IE\n for (let i = div.childNodes.length - 1; i >= 0; i--) {\n if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {\n div.removeChild(div.childNodes[i]);\n }\n }\n\n // must only have 1 root element\n const svgElm = div.firstElementChild;\n if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {\n const svgClass = svgElm.getAttribute('class') || '';\n svgElm.setAttribute('class', (svgClass + ' s-pds-icon').trim());\n\n // root element must be an svg\n // lets double check we've got valid elements\n // do not allow scripts\n if (isValid(svgElm as HTMLElement)) {\n return div.innerHTML;\n }\n }\n return '';\n};\n\nexport const isValid = (elm: HTMLElement) => {\n if (elm.nodeType === 1) {\n if (elm.nodeName.toLowerCase() === 'script') {\n return false;\n }\n\n for (let i = 0; i < elm.attributes.length; i++) {\n const name = elm.attributes[i].name;\n if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {\n return false;\n }\n }\n\n for (let i = 0; i < elm.childNodes.length; i++) {\n if (!isValid(elm.childNodes[i] as HTMLElement)) {\n return false;\n }\n }\n }\n return true;\n};\n\nexport const isSvgDataUrl = (url: string) => url.startsWith('data:image/svg+xml');\nexport const isEncodedDataUrl = (url: string) => url.indexOf(';utf8,') !== -1;\n","import { isEncodedDataUrl, isSvgDataUrl, validateContent } from './validate';\n\nexport const pdsIconContent = new Map<string, string>();\nconst requests = new Map<string, Promise<any>>(); // eslint-disable-line @typescript-eslint/no-explicit-any\n\nlet parser: DOMParser;\n\nexport const getSvgContent = (url: string, sanitize = false) => {\n let req = requests.get(url);\n\n if(!req) {\n if (typeof fetch != 'undefined' && typeof document !== 'undefined') {\n if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {\n if (!parser) {\n parser = new DOMParser();\n }\n\n try {\n const doc = parser.parseFromString(url, 'text/html');\n const svg = doc.querySelector('svg');\n\n if (svg) {\n pdsIconContent.set(url, svg.outerHTML);\n } else {\n pdsIconContent.set(url, '');\n }\n } catch (error) {\n pdsIconContent.set(url, '');\n }\n\n return Promise.resolve();\n } else {\n // we don't have a request\n req = fetch(url).then((rsp) => {\n if (rsp.ok) {\n return rsp.text().then((svgContent) => {\n if (svgContent && sanitize !== false) {\n try {\n svgContent = validateContent(svgContent);\n } catch (validationError) {\n svgContent = '';\n }\n }\n pdsIconContent.set(url, svgContent || '');\n });\n } else {\n // Handle HTTP errors\n throw new Error(`Failed to load SVG: ${rsp.status} ${rsp.statusText}`);\n }\n }).catch((error) => {\n // Handle all fetch errors gracefully\n console.warn('Failed to load SVG:', url, error);\n pdsIconContent.set(url, '');\n // Don't re-throw to prevent unhandled promise rejections\n });\n\n requests.set(url, req);\n }\n } else {\n pdsIconContent.set(url, '');\n return Promise.resolve();\n }\n }\n\n return req;\n}\n",":host {\n --dimension-icon-height: 16px;\n --dimension-icon-width: 16px;\n --color-icon-fill: currentColor;\n\n contain: strict;\n display: inline-block;\n fill: var(--color-icon-fill);\n flex-shrink: 0;\n height: var(--dimension-icon-height);\n width: var(--dimension-icon-width);\n\n .pdsicon {\n fill: var(--color-icon-fill);\n }\n}\n\n.pds-icon-fill-none {\n fill: none;\n}\n\n.icon-inner,\n.pds-icon,\nsvg {\n display: block;\n height: 100%;\n width: 100%;\n}\n\n/* :host-context is supported in chromium; :dir is supported in safari & firefox */\n:host(.flip-rtl):host-context([dir='rtl']) .icon-inner {\n transform: scaleX(-1);\n}\n\n:host(.flip-rtl:dir(rtl)) .icon-inner {\n transform: scaleX(-1);\n}\n\n/**\n * This is needed for WebKit otherwise the fallback\n * will always cause the icon to be flipped if the document\n * loads in RTL.\n */\n:host(.flip-rtl:dir(ltr)) .icon-inner {\n transform: scaleX(1);\n}\n\n","import { Build, Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { getSvgContent, pdsIconContent } from './request';\nimport { getName, getUrl, inheritAttributes, isRTL, shouldRtlFlipIcon } from './utils';\n\n@Component({\n tag: 'pds-icon',\n assetsDirs: ['svg'],\n styleUrl: 'pds-icon.scss',\n shadow: true,\n})\nexport class PdsIcon {\n private didLoadIcon = false;\n private iconName: string | null = null;\n private io?: IntersectionObserver;\n private inheritedAttributes: { [k: string]: any } = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n @Element() el!: HTMLPdsIconElement;\n\n @State() private ariaLabel?: string;\n @State() private isVisible = false;\n @State() private svgContent?: string;\n\n /**\n *\n * The color of the icon\n *\n */\n @Prop() color?: string;\n\n /**\n * Determines if the icon should be flipped when the `dir` is right-to-left (`\"rtl\"`).\n * This is automatically enabled for icons that are in the `ICONS_TO_FLIP` list and\n * when the `dir` is `\"rtl\"`. If `flipRtl` is set to `false`, the icon will not be flipped\n * even if the `dir` is `\"rtl\"`.\n */\n @Prop() flipRtl?: boolean;\n\n /**\n * This is a combination of both `name` and `src`. If a `src` URL is detected,\n * it will set the `src` property. Otherwise it assumes it's a built-in named\n * SVG and sets the `name` property.\n */\n @Prop() icon?: any;\n\n /**\n * The name of the icon to use from\n * the built-in set.\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * The size of the icon. This can be\n * 'small', 'regular', 'medium', 'large', or a\n * custom value (40px, 1rem, etc)\n *\n */\n @Prop({ reflect: true }) size?:\n | 'small' // 12px\n | 'regular' // 16px\n | 'medium' // 20px\n | 'large' // 24px\n | 'auto'\n | string = 'regular'\n\n /**\n *\n * Specifies the exact `src` of an SVG file to use.\n */\n @Prop() src?: string;\n\n private iconSize() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sizes: { [key: string]: any } = {\n small: '12px',\n regular: '16px',\n medium: '20px',\n large: '24px',\n }\n\n if (sizes[this.size]) {\n return sizes[this.size];\n } else {\n return this.size;\n }\n }\n\n componentDidLoad() {\n this.setCSSVariables();\n\n if (!this.didLoadIcon) {\n this.loadIcon();\n }\n\n // Fallback: Ensure icon loads even if IntersectionObserver doesn't fire\n setTimeout(() => {\n if (!this.svgContent && !this.isVisible) {\n this.isVisible = true;\n this.loadIcon();\n }\n }, 100);\n\n // Additional fallback for client-side navigation (React Router, etc.)\n // React's useLayoutEffect and rendering cycles can delay visibility detection\n setTimeout(() => {\n if (!this.svgContent && !this.isVisible) {\n this.isVisible = true;\n this.loadIcon();\n }\n }, 500);\n }\n\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);\n this.setCSSVariables();\n this.setupInitialAriaLabel();\n }\n\n setCSSVariables() {\n this.el.style.setProperty(`--dimension-icon-height`, this.iconSize());\n this.el.style.setProperty(`--dimension-icon-width`, this.iconSize());\n this.el.style.setProperty(`--color-icon-fill`, typeof this.color !== 'undefined' ? this.color : 'currentColor');\n }\n\n connectedCallback() {\n // Handle re-connection during client-side navigation\n if (!this.isVisible && !this.svgContent) {\n this.waitUntilVisible(this.el, '50px', () => {\n this.isVisible = true;\n this.loadIcon();\n });\n }\n\n // Immediate load attempt if already visible (e.g., during React navigation)\n if (this.isElementInViewport(this.el)) {\n this.isVisible = true;\n this.loadIcon();\n }\n }\n\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n\n @Watch('size')\n @Watch('color')\n updateStyles() {\n this.setCSSVariables();\n }\n\n @Watch('name')\n @Watch('src')\n @Watch('icon')\n onIconPropertyChange() {\n this.loadIcon();\n // Update aria-label when icon properties change\n this.setupInitialAriaLabel();\n }\n\n loadIcon() {\n // Reset load state when URL changes\n this.didLoadIcon = false;\n\n // Clear existing content to prevent stale content when switching icons\n this.svgContent = undefined;\n\n if (Build.isBrowser && this.isVisible) {\n const url = getUrl(this);\n if (url) {\n if (pdsIconContent.has(url)) {\n this.svgContent = pdsIconContent.get(url);\n } else {\n // Fix: Ensure promise callback triggers re-render and handle errors\n getSvgContent(url)\n .then(() => {\n // Force re-render by setting state in next tick\n setTimeout(() => {\n this.svgContent = pdsIconContent.get(url);\n }, 0);\n })\n .catch(() => {\n // Handle fetch errors gracefully\n this.svgContent = '';\n });\n }\n this.didLoadIcon = true;\n }\n }\n\n this.iconName = getName(this.name, this.icon);\n }\n\n render() {\n const { ariaLabel, flipRtl, iconName,inheritedAttributes } = this;\n const shouldIconAutoFlip = iconName\n ? shouldRtlFlipIcon(iconName, this.el) && flipRtl !== false\n : false;\n const shouldFlip = flipRtl || shouldIconAutoFlip;\n\n // Use inherited aria-label if provided, otherwise fall back to auto-generated one\n const finalAriaLabel = inheritedAttributes['aria-label'] || ariaLabel;\n\n return (\n\n <Host\n aria-label={finalAriaLabel !== undefined && !this.hasAriaHidden() ? finalAriaLabel : null }\n alt=\"\"\n role=\"img\"\n class={{\n ...createColorClasses(this.color),\n 'flip-rtl': shouldFlip,\n 'icon-rtl': shouldFlip && isRTL(this.el)\n }}\n {...inheritedAttributes}\n >\n {Build.isBrowser && this.svgContent ? (\n <div class=\"icon-inner\" innerHTML={this.svgContent}></div>\n ) : (\n <div class=\"icon-inner\"></div>\n )}\n </Host>\n )\n }\n\n /*****\n * Private Methods\n ****/\n\n private setupInitialAriaLabel() {\n // Only set aria-label during initial load if one isn't already provided\n if (!this.inheritedAttributes['aria-label']) {\n const iconName = getName(this.name, this.icon);\n if (iconName) {\n this.ariaLabel = iconName.replace(/\\-/g, ' ');\n }\n }\n }\n\n private waitUntilVisible(el: HTMLElement, rootMargin: string, cb: () => void) {\n if (Build.isBrowser && typeof window !== 'undefined' && (window).IntersectionObserver) {\n const io = (this.io = new (window).IntersectionObserver(\n (data: IntersectionObserverEntry[]) => {\n if (data[0].isIntersecting) {\n io.disconnect();\n this.io = undefined;\n cb();\n }\n },\n { rootMargin },\n ));\n\n io.observe(el);\n\n // Safety timeout for client-side navigation scenarios\n // Sometimes IntersectionObserver doesn't fire during React navigation\n setTimeout(() => {\n if (this.io && !this.isVisible) {\n // Check if element is actually visible in viewport\n if (this.isElementInViewport(el)) {\n this.io.disconnect();\n this.io = undefined;\n cb();\n }\n }\n }, 1000);\n } else {\n // browser doesn't support IntersectionObserver\n // so just fallback to always show it\n cb();\n }\n }\n\n private isElementInViewport(el: HTMLElement): boolean {\n if (!el || !el.isConnected) return false;\n\n const rect = el.getBoundingClientRect();\n const windowHeight = window.innerHeight || document.documentElement.clientHeight;\n const windowWidth = window.innerWidth || document.documentElement.clientWidth;\n\n return (\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= windowHeight &&\n rect.right <= windowWidth\n ) || (\n // Also consider partially visible elements\n rect.top < windowHeight &&\n rect.bottom > 0 &&\n rect.left < windowWidth &&\n rect.right > 0\n );\n }\n\n private hasAriaHidden = () => {\n const { el } = this;\n\n return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';\n }\n\n /**\n * Debug method to help diagnose loading issues\n * Call from browser console: document.querySelector('pds-icon').debugIconState()\n */\n debugIconState() {\n const url = getUrl(this);\n const rect = this.el.getBoundingClientRect();\n\n console.log('PdsIcon Debug State:', {\n name: this.name,\n src: this.src,\n icon: this.icon,\n iconName: this.iconName,\n url,\n isVisible: this.isVisible,\n didLoadIcon: this.didLoadIcon,\n hasSvgContent: !!this.svgContent,\n svgContentLength: this.svgContent?.length || 0,\n isInCache: url ? pdsIconContent.has(url) : false,\n cachedContent: url ? pdsIconContent.get(url) : null,\n element: this.el,\n // Client-side navigation specific debug info\n isConnected: this.el.isConnected,\n isInViewport: this.isElementInViewport(this.el),\n hasIntersectionObserver: !!this.io,\n boundingClientRect: rect,\n windowDimensions: {\n width: window.innerWidth || document.documentElement.clientWidth,\n height: window.innerHeight || document.documentElement.clientHeight\n }\n });\n }\n}\n\nconst createColorClasses = (color: string | undefined) => {\n return color\n ? {\n 'pds-color': true,\n [`pds-color-${color}`]: true,\n }\n : null;\n };\n"],"version":3}