@pure-ds/core 0.7.20 → 0.7.21

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.
@@ -35,6 +35,7 @@ export class SvgIcon extends HTMLElement {
35
35
  static inlineSprites: Map<any, any>;
36
36
  static externalIconCache: Map<any, any>;
37
37
  static externalIconPromises: Map<any, any>;
38
+ static externalPathDebugLogged: Set<any>;
38
39
  static instances: Set<any>;
39
40
  static "__#private@#spriteSupport": boolean;
40
41
  static "__#private@#detectSpriteSupport"(): boolean;
@@ -67,6 +68,12 @@ export class SvgIcon extends HTMLElement {
67
68
  * @returns {string}
68
69
  */
69
70
  private static getExternalIconURL;
71
+ /**
72
+ * Whether verbose icon diagnostics should be logged.
73
+ * @private
74
+ * @returns {boolean}
75
+ */
76
+ private static isDebugLoggingEnabled;
70
77
  /**
71
78
  * Fetch an external SVG icon and cache it
72
79
  * @param {string} iconName - The icon name (without .svg extension)
@@ -1 +1 @@
1
- {"version":3,"file":"pds-icon.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-icon.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;IACE,oCAAkF;IAGlF;;;;;;;;;;MAkBE;IAEF,qCAAkC;IAClC,oCAAiC;IAGjC,wCAAqC;IAErC,2CAAwC;IAExC,2BAA6B;IAE7B,4CAA8B;IAO9B,oDA4CC;IAydD;;;;OAIG;IACH,mCAmBC;IAED;;;;;OAKG;IACH,yCAOC;IAED;;;;;;OAMG;IACH,uCAEC;IAED;;;;;;OAMG;IACH,kCAUC;IAED;;;;OAIG;IACH,mCAHW,MAAM,kBACJ,OAAO,CAAC,OAAO,CAAC,CA+E5B;IAED,wDA8EC;IACD,+BAMC;IApsBC,kBAAwB;IACxB,kBAAwB;IACxB,mBAAsB;IACtB,iBAAuB;IACvB,wBAA2B;IAC3B,kBAAoB;IACpB,mBAAqB;IACrB,mBAAqB;IACrB,yBAA2B;IAC3B,yBAA2B;IAG7B,0BAGC;IAED,6BAGC;IAED,wEAmBC;IAED,eAqQC;IA0JD;;;;;OAKG;IACH,0BAFa,OAAO,CAInB;;CAmPF"}
1
+ {"version":3,"file":"pds-icon.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-icon.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;IACE,oCAAkF;IAGlF;;;;;;;;;;MAkBE;IAEF,qCAAkC;IAClC,oCAAiC;IAGjC,wCAAqC;IAErC,2CAAwC;IAExC,yCAA2C;IAE3C,2BAA6B;IAE7B,4CAA8B;IAO9B,oDA4CC;IAydD;;;;OAIG;IACH,mCAsBC;IAED;;;;;OAKG;IACH,yCAOC;IAED;;;;;;OAMG;IACH,uCAEC;IAED;;;;;;OAMG;IACH,kCAUC;IAED;;;;OAIG;IACH,qCAOC;IAED;;;;OAIG;IACH,mCAHW,MAAM,kBACJ,OAAO,CAAC,OAAO,CAAC,CAoF5B;IAED,wDA8EC;IACD,+BAMC;IA1tBC,kBAAwB;IACxB,kBAAwB;IACxB,mBAAsB;IACtB,iBAAuB;IACvB,wBAA2B;IAC3B,kBAAoB;IACpB,mBAAqB;IACrB,mBAAqB;IACrB,yBAA2B;IAC3B,yBAA2B;IAG7B,0BAGC;IAED,6BAGC;IAED,wEAmBC;IAED,eAqQC;IA0JD;;;;;OAKG;IACH,0BAFa,OAAO,CAInB;;CAyQF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pure-ds/core",
3
3
  "shortname": "pds",
4
- "version": "0.7.20",
4
+ "version": "0.7.21",
5
5
  "description": "Why develop a Design System when you can generate one?",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,5 +1,5 @@
1
1
  var Pe=Object.defineProperty;var Me=(e,t)=>{for(var s in t)Pe(e,s,{get:t[s],enumerable:!0})};var X=class{constructor(){this._mode="static",this._staticPaths={tokens:"/assets/pds/styles/pds-tokens.css.js",primitives:"/assets/pds/styles/pds-primitives.css.js",components:"/assets/pds/styles/pds-components.css.js",utilities:"/assets/pds/styles/pds-utilities.css.js",styles:"/assets/pds/styles/pds-styles.css.js"}}setLiveMode(){this._mode="live"}setStaticMode(t={}){this._mode="static",this._staticPaths={...this._staticPaths,...t}}async getStylesheet(t){if(this._mode==="live")return null;try{return(await import(this._staticPaths[t]))[t]}catch(s){console.error(`[PDS Registry] Failed to load static ${t}:`,s),console.error(`[PDS Registry] Looking for: ${this._staticPaths[t]}`),console.error("[PDS Registry] Make sure you've run 'npm run pds:build' and configured PDS.start() with the correct static.root path");let n=new CSSStyleSheet;return n.replaceSync("/* Failed to load "+t+" */"),n}}get mode(){return this._mode}get isLive(){return this._mode==="live"}},P=new X;async function pe(e,t=[],s=null){try{let n=s?.primitivesStylesheet?s.primitivesStylesheet:await P.getStylesheet("primitives");e.adoptedStyleSheets=[n,...t]}catch(n){let c=e.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${c}> failed to adopt primitives:`,n),e.adoptedStyleSheets=t}}async function ue(e,t=["primitives"],s=[],n=null){let c=Array.isArray(s)?s.filter(Boolean):[];if(c.length){let d=(Array.isArray(e.adoptedStyleSheets)?e.adoptedStyleSheets:[]).filter(b=>!c.includes(b));e.adoptedStyleSheets=[...d,...c]}try{let d=(await Promise.all(t.map(async b=>{if(n)switch(b){case"tokens":return n.tokensStylesheet;case"primitives":return n.primitivesStylesheet;case"components":return n.componentsStylesheet;case"utilities":return n.utilitiesStylesheet;default:break}return P.getStylesheet(b)}))).filter(b=>b!==null);e.adoptedStyleSheets=[...d,...c]}catch(r){let d=e.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${d}> failed to adopt layers:`,r),e.adoptedStyleSheets=c}}function me(e){let t=new CSSStyleSheet;return t.replaceSync(e),t}var fe={FontWeights:{light:300,normal:400,medium:500,semibold:600,bold:700},LineHeights:{tight:1.25,normal:1.5,relaxed:1.75},BorderWidths:{hairline:.5,thin:1,medium:2,thick:3},RadiusSizes:{none:0,small:4,medium:8,large:16,xlarge:24,xxlarge:32},ShadowDepths:{none:"none",light:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",medium:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",deep:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",extreme:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},TransitionSpeeds:{fast:150,normal:250,slow:350},AnimationEasings:{linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},TouchTargetSizes:{compact:36,standard:44,comfortable:48,spacious:56},LinkStyles:{inline:"inline",block:"block",button:"button"},FocusStyles:{ring:"ring",outline:"outline",border:"border",glow:"glow"},TabSizes:{compact:2,standard:4,wide:8},SelectIcons:{chevron:"chevron",arrow:"arrow",caret:"caret",none:"none"},IconSizes:{xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64,"3xl":96}};var Z={};Me(Z,{deepMerge:()=>he,fragmentFromTemplateLike:()=>Te,isObject:()=>O,parseHTML:()=>Y});function O(e){return e&&typeof e=="object"&&!Array.isArray(e)}function he(e,t){let s={...e};return O(e)&&O(t)&&Object.keys(t).forEach(n=>{O(t[n])?n in e?s[n]=he(e[n],t[n]):Object.assign(s,{[n]:t[n]}):Object.assign(s,{[n]:t[n]})}),s}function Te(e){let t=Array.isArray(e?.strings)?e.strings:[],s=Array.isArray(e?.values)?e.values:[],n=new Set,c=[],r=/(\s)(\.[\w-]+)=\s*$/;for(let i=0;i<t.length;i+=1){let g=t[i]??"",f=g.match(r);if(f&&i<s.length){let w=f[2].slice(1),v=`pds-val-${i}`;g=g.replace(r,`$1data-pds-prop="${w}:${v}"`),n.add(i)}c.push(g),i<s.length&&!n.has(i)&&c.push(`<!--pds-val-${i}-->`)}let d=document.createElement("template");d.innerHTML=c.join("");let b=(i,g)=>{let f=i.parentNode;if(!f)return;if(g==null){f.removeChild(i);return}let S=w=>{if(w!=null){if(w instanceof Node){f.insertBefore(w,i);return}if(Array.isArray(w)){w.forEach(v=>S(v));return}f.insertBefore(document.createTextNode(String(w)),i)}};S(g),f.removeChild(i)},E=document.createTreeWalker(d.content,NodeFilter.SHOW_COMMENT),h=[];for(;E.nextNode();){let i=E.currentNode;i?.nodeValue?.startsWith("pds-val-")&&h.push(i)}return h.forEach(i=>{let g=Number(i.nodeValue.replace("pds-val-",""));b(i,s[g])}),d.content.querySelectorAll("*").forEach(i=>{let g=i.getAttribute("data-pds-prop");if(!g)return;let[f,S]=g.split(":"),w=Number(String(S).replace("pds-val-",""));f&&Number.isInteger(w)&&(i[f]=s[w]),i.removeAttribute("data-pds-prop")}),d.content}function Y(e){return new DOMParser().parseFromString(e,"text/html").body.childNodes}var be="pds",Ue=/^([a-z][a-z0-9+\-.]*:)?\/\//i,ye=/^[a-z]:/i;function U(e=""){return e.endsWith("/")?e:`${e}/`}function Ce(e="",t=be){let s=e.replace(/\/+$/,"");return new RegExp(`(?:^|/)${t}$`,"i").test(s)?s:`${s}/${t}`}function $e(e){return e.replace(/^\.\/+/,"")}function Ie(e){return ye.test(e)?e.replace(ye,"").replace(/^\/+/,""):e}function Ne(e){return e.startsWith("public/")?e.substring(7):e}function z(e,t={}){let s=t.segment||be,n=t.defaultRoot||`/assets/${s}/`,c=e?.public&&e.public?.root||e?.static&&e.static?.root||null;if(!c||typeof c!="string")return U(n);let r=c.trim();return r?(r=r.replace(/\\/g,"/"),r=Ce(r,s),r=U(r),Ue.test(r)?r:(r=$e(r),r=Ie(r),r.startsWith("/")||(r=Ne(r),r.startsWith("/")||(r=`/${r}`),r=r.replace(/\/+/g,(d,b)=>b===0?d:"/")),U(r))):U(n)}async function Oe(...e){let t={};e.length&&typeof e[e.length-1]=="object"&&(t=e.pop()||{});let s=e,{baseURL:n,mapper:c=h=>`${h}.js`,onError:r=(h,a)=>console.error(`[defineWebComponents] ${h}:`,a)}=t,d=n?new URL(n,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),b=h=>h.toLowerCase().replace(/(^|-)([a-z])/g,(a,i,g)=>g.toUpperCase()),E=async h=>{try{if(customElements.get(h))return{tag:h,status:"already-defined"};let a=c(h),g=await import(a instanceof URL?a.href:new URL(a,d).href),f=g?.default??g?.[b(h)];if(!f){if(customElements.get(h))return{tag:h,status:"self-defined"};throw new Error(`No export found for ${h}. Expected default export or named export "${b(h)}".`)}return customElements.get(h)?{tag:h,status:"race-already-defined"}:(customElements.define(h,f),{tag:h,status:"defined"})}catch(a){throw r(h,a),a}};return Promise.all(s.map(E))}var F=class{constructor(t={}){let{baseURL:s,mapper:n,onError:c,predicate:r=()=>!0,attributeModule:d="data-module",root:b=document,scanExisting:E=!0,debounceMs:h=16,observeShadows:a=!0,enhancers:i=[],patchAttachShadow:g=!0}=t,f=new Set,S=new Set,w=new Set,v=new Map,x=new WeakMap,_=new WeakMap,u=0,y=!1,A=null,N=l=>{if(!l||!i.length)return;let m=_.get(l);m||(m=new Set,_.set(l,m));for(let p of i)if(!(!p.selector||!p.run)&&!m.has(p.selector))try{l.matches&&l.matches(p.selector)&&(p.run(l),m.add(p.selector))}catch(L){console.warn(`[AutoDefiner] Error applying enhancer for selector "${p.selector}":`,L)}},T=(l,m)=>{if(!y&&!(!l||!l.includes("-"))&&!customElements.get(l)&&!S.has(l)&&!w.has(l)){if(m&&m.getAttribute){let p=m.getAttribute(d);p&&!v.has(l)&&v.set(l,p)}f.add(l),De()}},De=()=>{u||(u=setTimeout(ce,h))},R=l=>{if(l){if(l.nodeType===1){let m=l,p=m.tagName?.toLowerCase();p&&p.includes("-")&&!customElements.get(p)&&r(p,m)&&T(p,m),N(m),a&&m.shadowRoot&&J(m.shadowRoot)}l.querySelectorAll&&l.querySelectorAll("*").forEach(m=>{let p=m.tagName?.toLowerCase();p&&p.includes("-")&&!customElements.get(p)&&r(p,m)&&T(p,m),N(m),a&&m.shadowRoot&&J(m.shadowRoot)})}},J=l=>{if(!l||x.has(l))return;R(l);let m=new MutationObserver(p=>{for(let L of p)L.addedNodes?.forEach(D=>{R(D)}),L.type==="attributes"&&L.target&&R(L.target)});m.observe(l,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[d,...i.map(p=>p.selector).filter(p=>p.startsWith("data-"))]}),x.set(l,m)};async function ce(){if(clearTimeout(u),u=0,!f.size)return;let l=Array.from(f);f.clear(),l.forEach(m=>S.add(m));try{let m=p=>v.get(p)??(n?n(p):`${p}.js`);await Oe(...l,{baseURL:s,mapper:m,onError:(p,L)=>{w.add(p),c?.(p,L)}})}catch{}finally{l.forEach(m=>S.delete(m))}}let de=b===document?document.documentElement:b,le=new MutationObserver(l=>{for(let m of l)m.addedNodes?.forEach(p=>{R(p)}),m.type==="attributes"&&m.target&&R(m.target)});if(le.observe(de,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[d,...i.map(l=>l.selector).filter(l=>l.startsWith("data-"))]}),a&&g&&Element.prototype.attachShadow){let l=Element.prototype.attachShadow;Element.prototype.attachShadow=function(p){let L=l.call(this,p);if(p&&p.mode==="open"){J(L);let D=this.tagName?.toLowerCase();D&&D.includes("-")&&!customElements.get(D)&&T(D,this)}return L},A=()=>Element.prototype.attachShadow=l}return E&&R(de),{stop(){y=!0,le.disconnect(),A&&A(),u&&(clearTimeout(u),u=0),x.forEach(l=>l.disconnect())},flush:ce}}static async define(...t){let s={};t.length&&typeof t[t.length-1]=="object"&&(s=t.pop()||{});let n=t,{baseURL:c,mapper:r=a=>`${a}.js`,onError:d=(a,i)=>console.error(`[defineWebComponents] ${a}:`,i)}=s,b=c?new URL(c,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),E=a=>a.toLowerCase().replace(/(^|-)([a-z])/g,(i,g,f)=>f.toUpperCase()),h=async a=>{try{if(customElements.get(a))return{tag:a,status:"already-defined"};let i=r(a),f=await import(i instanceof URL?i.href:new URL(i,b).href),S=f?.default??f?.[E(a)];if(!S){if(customElements.get(a))return{tag:a,status:"self-defined"};throw new Error(`No export found for ${a}. Expected default export or named export "${E(a)}".`)}return customElements.get(a)?{tag:a,status:"race-already-defined"}:(customElements.define(a,S),{tag:a,status:"defined"})}catch(i){throw d(a,i),i}};return Promise.all(n.map(h))}};var ze=/^[a-z][a-z0-9+\-.]*:\/\//i,C=(()=>{try{return import.meta.url}catch{return}})(),W=e=>typeof e=="string"&&e.length&&!e.endsWith("/")?`${e}/`:e;function B(e,t={}){if(!e||ze.test(e))return e;let{preferModule:s=!0}=t,n=()=>{if(!C)return null;try{return new URL(e,C).href}catch{return null}},c=()=>{if(typeof window>"u"||!window.location?.origin)return null;try{return new URL(e,window.location.origin).href}catch{return null}};return(s?n()||c():c()||n())||e}var ge=(()=>{if(C)try{let e=new URL(C);if(/\/public\/assets\/js\//.test(e.pathname))return new URL("../pds/",C).href}catch{return}})(),we=!1;function Se(e){we||typeof document>"u"||(we=!0,e.addEventListener("pds:ready",t=>{let s=t.detail?.mode;s&&document.documentElement.classList.add(`pds-${s}`,"pds-ready")}))}function Ee({manageTheme:e,themeStorageKey:t,applyResolvedTheme:s,setupSystemListenerIfNeeded:n}){let c="light",r=null;if(e&&typeof window<"u"){try{r=localStorage.getItem(t)||null}catch{r=null}try{s?.(r),n?.(r)}catch{}r?r==="system"?c=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":c=r:c=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return{resolvedTheme:c,storedTheme:r}}function q(e,{resolvePublicAssetURL:t}){let s=!!(e?.public?.root||e?.static?.root),n=t(e);return!s&&ge&&(n=ge),W(B(n))}async function ve(e,{baseEnhancers:t=[]}={}){let{autoDefineBaseURL:s="/auto-define/",autoDefinePreload:n=[],autoDefineMapper:c=null,enhancers:r=[],autoDefineOverrides:d=null,autoDefinePreferModule:b=!0}=e,E=(()=>{let a=new Map;return(t||[]).forEach(i=>a.set(i.selector,i)),(r||[]).forEach(i=>a.set(i.selector,i)),Array.from(a.values())})(),h=null;if(typeof window<"u"&&typeof document<"u"){let a=F,i=u=>{switch(u){case"pds-tabpanel":return"pds-tabstrip.js";default:return`${u}.js`}},{mapper:g,enhancers:f,...S}=d&&typeof d=="object"?d:{},w=f?Array.isArray(f)?f:typeof f=="object"?Object.values(f):[]:[],v=(()=>{let u=new Map;return(E||[]).forEach(y=>{y?.selector&&u.set(y.selector,y)}),(w||[]).forEach(y=>{if(!y?.selector)return;let A=u.get(y.selector)||null;u.set(y.selector,{...A||{},...y,run:typeof y?.run=="function"?y.run:A?.run})}),Array.from(u.values())})(),_={baseURL:s&&W(B(s,{preferModule:b})),predefine:n,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:v,onError:(u,y)=>{if(typeof u=="string"&&u.startsWith("pds-")){let N=["pds-form","pds-drawer"].includes(u),T=y?.message?.includes("#pds/lit")||y?.message?.includes("Failed to resolve module specifier");N&&T?console.error(`\u274C PDS component <${u}> requires Lit but #pds/lit is not in import map.
2
- See: https://github.com/Pure-Web-Foundation/pure-ds/blob/main/readme.md#lit-components-not-working`):console.warn(`\u26A0\uFE0F PDS component <${u}> not found. Assets may not be installed.`)}else console.error(`\u274C Auto-define error for <${u}>:`,y)},...S,mapper:u=>{if(customElements.get(u))return null;if(typeof c=="function")try{let y=c(u);return y===void 0?i(u):y}catch(y){return console.warn("Custom autoDefine.mapper error; falling back to default:",y?.message||y),i(u)}return i(u)}};h=new a(_),n.length>0&&typeof a.define=="function"&&await a.define(...n,{baseURL:s,mapper:_.mapper,onError:_.onError})}return{autoDefiner:h,mergedEnhancers:E}}var ee=["light","dark"],te=new Set(ee);function Fe(e){let s=(Array.isArray(e?.themes)?e.themes.map(n=>String(n).toLowerCase()):ee).filter(n=>te.has(n));return s.length?s:ee}function se(e,{preferDocument:t=!0}={}){let s=String(e||"").toLowerCase();if(te.has(s))return s;if(t&&typeof document<"u"){let n=document.documentElement?.getAttribute("data-theme");if(te.has(n))return n}return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Le(e,t){let s=se(t);return Fe(e).includes(s)}var re=class extends EventTarget{},o=new re;o.initializing=!1;o.currentPreset=null;o.debug=!1;var H=null,V=null,K=null,G=null;function Q(e,t){return t&&typeof t=="string"?t:`${q(o.currentConfig||{},{resolvePublicAssetURL:z})}core/${e}`}async function We(){return Array.isArray(o.defaultEnhancers)&&o.defaultEnhancers.length>0?o.defaultEnhancers:(G||(G=import(Q("pds-enhancers.js",o.currentConfig?.enhancersURL)).then(t=>{let s=Array.isArray(t?.defaultPDSEnhancers)?t.defaultPDSEnhancers:[];return o.defaultEnhancers=s,s}).catch(t=>{throw G=null,t})),G)}async function Be(){return typeof o.ask=="function"&&o.ask!==ke?o.ask:(V||(V=import(Q("pds-ask.js",o.currentConfig?.askURL)).then(t=>{let s=t?.ask;if(typeof s!="function")throw new Error("Failed to load ask helper");return o.ask=s,s}).catch(t=>{throw V=null,t})),V)}async function I(){return typeof o.toast=="function"&&o.toast!==M?o.toast:(K||(K=import(Q("pds-toast.js",o.currentConfig?.toastURL)).then(t=>{let s=t?.toast;if(typeof s!="function")throw new Error("Failed to load toast helper");return o.toast=s,s}).catch(t=>{throw K=null,t})),K)}async function ke(...e){return(await Be())(...e)}async function M(...e){return(await I())(...e)}M.success=async(...e)=>(await I()).success(...e);M.error=async(...e)=>(await I()).error(...e);M.warning=async(...e)=>(await I()).warning(...e);M.info=async(...e)=>(await I()).info(...e);var Ae=function(e="log",t,...s){let n=!!(o.registry&&!o.registry.isLive),c=(this?.debug||this?.design?.debug||o.debug||!1)===!0;if(n){if(!o.debug)return}else if(!c&&e!=="error"&&e!=="warn")return;let r=console[e]||console.log;s.length>0?r(t,...s):r(t)};function oe(e){if(e==null)return e;if(typeof e=="function")return;if(typeof e!="object")return e;if(Array.isArray(e))return e.map(s=>oe(s)).filter(s=>s!==void 0);let t={};for(let[s,n]of Object.entries(e)){let c=oe(n);c!==void 0&&(t[s]=c)}return t}async function qe(e,t={}){if(t?.runtimeConfig===!1||typeof fetch!="function")return null;let s=t?.runtimeConfigURL||`${e}pds-runtime-config.json`;try{let n=await fetch(s,{cache:"no-store"});return n.ok?await n.json():null}catch{return null}}o.registry=P;o.enums=fe;o.adoptLayers=ue;o.adoptPrimitives=pe;o.parse=Y;o.createStylesheet=me;o.isLiveMode=()=>P.isLive;o.ask=ke;o.toast=M;o.common=Z;o.AutoComplete=null;o.loadAutoComplete=async()=>{if(o.AutoComplete&&typeof o.AutoComplete.connect=="function")return o.AutoComplete;let e=Q("pds-autocomplete.js",o.currentConfig?.autoCompleteURL);return H||(H=import(e).then(t=>{let s=t?.AutoComplete||t?.default?.AutoComplete||t?.default||null;if(!s)throw new Error("AutoComplete export not found in module");return o.AutoComplete=s,s}).catch(t=>{throw H=null,t})),H};function _e(e){let t=typeof CustomEvent=="function";try{let s=t?new CustomEvent("pds:ready",{detail:e}):new Event("pds:ready");o.dispatchEvent(s)}catch{}if(typeof document<"u")if(t){let s={detail:e,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:ready",s))}catch{}try{document.dispatchEvent(new CustomEvent("pds-ready",s))}catch{}}else{try{document.dispatchEvent(new Event("pds:ready"))}catch{}try{document.dispatchEvent(new Event("pds-ready"))}catch{}}}function xe(e={}){let t=typeof CustomEvent=="function",s={at:Date.now(),...e};try{let n=t?new CustomEvent("pds:config-changed",{detail:s}):new Event("pds:config-changed");o.dispatchEvent(n)}catch{}if(typeof document<"u")if(t){let n={detail:s,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:config-changed",n))}catch{}}else try{document.dispatchEvent(new Event("pds:config-changed"))}catch{}}var ne="pure-ds-theme",j=null,$=null;function ie(e){try{if(typeof document>"u")return;let t="light";e?e==="system"?t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t=e:t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",document.documentElement.setAttribute("data-theme",t)}catch{}}function ae(e){try{if(j&&$){try{typeof j.removeEventListener=="function"?j.removeEventListener("change",$):typeof j.removeListener=="function"&&j.removeListener($)}catch{}j=null,$=null}if(e==="system"&&typeof window<"u"&&window.matchMedia){let t=window.matchMedia("(prefers-color-scheme: dark)"),s=n=>{let c=n?.matches===void 0?t.matches:n.matches;try{let r=c?"dark":"light";document.documentElement.setAttribute("data-theme",r),o.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,source:"system"}}))}catch{}};j=t,$=s,typeof t.addEventListener=="function"?t.addEventListener("change",s):typeof t.addListener=="function"&&t.addListener(s)}}catch{}}Object.defineProperty(o,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(ne)||null}catch{return null}},set(e){try{if(typeof window>"u")return;let t=o.currentConfig?.design||null,s=se(e);if(t&&!Le(t,s)){let n=t?.name||o.currentPreset?.name||o.currentConfig?.preset||"current preset";console.warn(`PDS theme "${s}" not supported by preset "${n}".`),o.dispatchEvent(new CustomEvent("pds:theme:blocked",{detail:{theme:e,resolvedTheme:s,preset:n}}));return}e==null?localStorage.removeItem(ne):localStorage.setItem(ne,e),ie(e),ae(e),o.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:e,source:"api"}}))}catch{}}});o.defaultEnhancers=[];async function He(e){let t=e&&e.mode||"live",{mode:s,...n}=e||{};if(t==="static")return Ve(n);let c=q(n,{resolvePublicAssetURL:z}),r=n?.managerURL||n?.public?.managerURL||n?.manager?.url||new URL("core/pds-manager.js",c).href||new URL("./pds-manager.js",import.meta.url).href,{startLive:d}=await import(r);return d(o,n,{emitReady:_e,emitConfigChanged:xe,applyResolvedTheme:ie,setupSystemListenerIfNeeded:ae})}o.start=He;async function Ve(e){if(!e||typeof e!="object")throw new Error("PDS.start({ mode: 'static', ... }) requires a valid configuration object");let t=e.applyGlobalStyles??!0,s=e.manageTheme??!0,n=e.themeStorageKey??"pure-ds-theme",c=e.staticPaths??{},r=q(e,{resolvePublicAssetURL:z}),d=e&&e.autoDefine||null,b;d&&d.baseURL?b=W(B(d.baseURL,{preferModule:!1})):b=`${r}components/`;let E=d&&Array.isArray(d.predefine)&&d.predefine||[],h=d&&typeof d.mapper=="function"&&d.mapper||null;try{Se(o);let{resolvedTheme:a}=Ee({manageTheme:s,themeStorageKey:n,applyResolvedTheme:ie,setupSystemListenerIfNeeded:ae}),i=await qe(r,e),g=Array.isArray(e?.enhancers)?e.enhancers:e?.enhancers&&typeof e.enhancers=="object"?Object.values(e.enhancers):[],f=i?.config?{...i.config,...e,design:e?.design||i.config.design,preset:e?.preset||i.config.preset}:{...e},S={tokens:`${r}styles/pds-tokens.css.js`,primitives:`${r}styles/pds-primitives.css.js`,components:`${r}styles/pds-components.css.js`,utilities:`${r}styles/pds-utilities.css.js`,styles:`${r}styles/pds-styles.css.js`},w=i?.paths||{};if(c={...S,...w,...c},o.registry.setStaticMode(c),t&&typeof document<"u")try{let u=await o.registry.getStylesheet("styles");if(u){u._pds=!0;let y=(document.adoptedStyleSheets||[]).filter(A=>A._pds!==!0);document.adoptedStyleSheets=[...y,u],xe({mode:"static",source:"static:styles-applied"})}}catch(u){Ae.call(o,"warn","Failed to apply static styles:",u)}let v=null,x=[];try{let u=await We(),y=await ve({autoDefineBaseURL:b,autoDefinePreload:E,autoDefineMapper:h,enhancers:g,autoDefineOverrides:d||null,autoDefinePreferModule:!(d&&d.baseURL)},{baseEnhancers:u});v=y.autoDefiner,x=y.mergedEnhancers||[]}catch(u){Ae.call(o,"error","\u274C Failed to initialize AutoDefiner/Enhancers (static):",u)}let _=oe(e);return o.currentConfig=Object.freeze({mode:"static",...structuredClone(_),design:structuredClone(f.design||{}),preset:f.preset,theme:a,enhancers:x}),_e({mode:"static",config:f,theme:a,autoDefiner:v}),{config:f,theme:a,autoDefiner:v}}catch(a){throw o.dispatchEvent(new CustomEvent("pds:error",{detail:{error:a}})),a}}var je={mode:"live",liveEdit:!0,preset:"default",autoDefine:{predefine:["pds-icon","pds-drawer","pds-toaster"]},log(e,t,...s){console[e](t,...s)}};var k={name:"@pure-ds/core",shortname:"pds",version:"0.7.20",description:"Why develop a Design System when you can generate one?",repository:{type:"git",url:"git+https://github.com/Pure-Web-Foundation/pure-ds.git"},bugs:{url:"https://github.com/Pure-Web-Foundation/pure-ds/issues"},homepage:"https://puredesignsystem.z6.web.core.windows.net/",keywords:["design-system","css","web-components","lit","constructable-stylesheets","tokens","utilities","a11y"],type:"module",main:"./public/assets/pds/core.js",module:"./public/assets/pds/core.js",types:"./dist/types/pds.d.ts",bin:{"pds-build":"packages/pds-cli/bin/pds-static.js","pds-sync-assets":"packages/pds-cli/bin/sync-assets.js","pds-build-icons":"packages/pds-cli/bin/pds-build-icons.js","pds-import":"packages/pds-cli/bin/pds-import.js","pds-setup-copilot":"packages/pds-cli/bin/pds-setup-copilot.js","pds-setup-mcp":"packages/pds-cli/bin/pds-setup-mcp.js","pds-init-config":"packages/pds-cli/bin/pds-init-config.js","pds-bootstrap":"packages/pds-cli/bin/pds-bootstrap.js","pds-mcp-server":"packages/pds-cli/bin/pds-mcp-server.js","pds-mcp-health":"packages/pds-cli/bin/pds-mcp-health.js","pds-mcp-eval":"packages/pds-cli/bin/pds-mcp-eval.js"},exports:{".":{types:"./src/js/pds.d.ts",import:"./public/assets/pds/core.js"},"./pds-core":"./src/js/pds.js","./auto-define/*":"./public/auto-define/*"},files:[".github/copilot-instructions.md",".cursorrules","dist/types/","public/assets/js/","public/assets/pds/components/","public/assets/pds/templates/","public/assets/pds/core.js","public/assets/pds/core/","public/assets/pds/external/","public/assets/pds/vscode-custom-data.json","public/assets/pds/pds.css-data.json","public/assets/pds/pds-css-complete.json","public/auto-define/","public/pds/components/","public/assets/pds/icons/pds-icons.svg","packages/pds-cli/bin/","packages/pds-cli/lib/","src/js/pds.d.ts","src/js/pds.js","src/js/pds-live-manager/","src/js/pds-core/","custom-elements.json","custom-elements-manifest.config.js","pds.html-data.json","pds.css-data.json","readme.md","INTELLISENSE.md","CSS-INTELLISENSE-LIMITATION.md","CSS-INTELLISENSE-QUICK-REF.md"],scripts:{test:'echo "Error: no test specified" && exit 1',dev:"node esbuild-dev.js",prebuild:"npm run types",build:"node esbuild-build.js",types:"tsc -p tsconfig.json && node scripts/sync-types.mjs",postinstall:"node packages/pds-cli/bin/postinstall.mjs","prepds:build":"npm run types","pds:build":"node packages/pds-cli/bin/pds-static.js","pds:build-icons":"node packages/pds-cli/bin/pds-build-icons.js","pds:bootstrap":"node packages/pds-cli/bin/pds-bootstrap.js","pds:manifest":"node packages/pds-cli/bin/generate-manifest.js","pds:css-data":"node packages/pds-cli/bin/generate-css-data.js","pds:import":"node packages/pds-cli/bin/pds-import.js","pds:dx":"node packages/pds-cli/bin/pds-dx.js","pds:mcp:server":"node packages/pds-cli/bin/pds-mcp-server.js","pds:mcp:health":"node packages/pds-cli/bin/pds-mcp-health.js","pds:mcp:eval":"node packages/pds-cli/bin/pds-mcp-eval.js","storybook:generate":"cd packages/pds-storybook && npm run generate-stories","storybook:dev":"cd packages/pds-storybook && npm run storybook:dev","storybook:build":"cd packages/pds-storybook && npm run storybook:build"},author:"Marc van Neerven",license:"ISC",engines:{node:">=18"},publishConfig:{access:"public"},devDependencies:{"@custom-elements-manifest/analyzer":"^0.9.9",esbuild:"^0.19.0","fs-extra":"^11.1.1",typescript:"^5.6.3","@types/node":"^22.10.2"},dependencies:{lit:"^3.3.1","pure-web":"1.1.32"},customElements:"custom-elements.json"};await o.start(je);var Re=typeof k.repository=="string"?k.repository:k.repository?.url,Ge=Re?Re.replace(/^git\+/,"").replace(/\.git$/,""):"",bt=k.homepage||Ge,gt=k.bugs?.url||"";document.body.innerHTML=`
2
+ See: https://github.com/Pure-Web-Foundation/pure-ds/blob/main/readme.md#lit-components-not-working`):console.warn(`\u26A0\uFE0F PDS component <${u}> not found. Assets may not be installed.`)}else console.error(`\u274C Auto-define error for <${u}>:`,y)},...S,mapper:u=>{if(customElements.get(u))return null;if(typeof c=="function")try{let y=c(u);return y===void 0?i(u):y}catch(y){return console.warn("Custom autoDefine.mapper error; falling back to default:",y?.message||y),i(u)}return i(u)}};h=new a(_),n.length>0&&typeof a.define=="function"&&await a.define(...n,{baseURL:s,mapper:_.mapper,onError:_.onError})}return{autoDefiner:h,mergedEnhancers:E}}var ee=["light","dark"],te=new Set(ee);function Fe(e){let s=(Array.isArray(e?.themes)?e.themes.map(n=>String(n).toLowerCase()):ee).filter(n=>te.has(n));return s.length?s:ee}function se(e,{preferDocument:t=!0}={}){let s=String(e||"").toLowerCase();if(te.has(s))return s;if(t&&typeof document<"u"){let n=document.documentElement?.getAttribute("data-theme");if(te.has(n))return n}return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Le(e,t){let s=se(t);return Fe(e).includes(s)}var re=class extends EventTarget{},o=new re;o.initializing=!1;o.currentPreset=null;o.debug=!1;var H=null,V=null,K=null,G=null;function Q(e,t){return t&&typeof t=="string"?t:`${q(o.currentConfig||{},{resolvePublicAssetURL:z})}core/${e}`}async function We(){return Array.isArray(o.defaultEnhancers)&&o.defaultEnhancers.length>0?o.defaultEnhancers:(G||(G=import(Q("pds-enhancers.js",o.currentConfig?.enhancersURL)).then(t=>{let s=Array.isArray(t?.defaultPDSEnhancers)?t.defaultPDSEnhancers:[];return o.defaultEnhancers=s,s}).catch(t=>{throw G=null,t})),G)}async function Be(){return typeof o.ask=="function"&&o.ask!==ke?o.ask:(V||(V=import(Q("pds-ask.js",o.currentConfig?.askURL)).then(t=>{let s=t?.ask;if(typeof s!="function")throw new Error("Failed to load ask helper");return o.ask=s,s}).catch(t=>{throw V=null,t})),V)}async function I(){return typeof o.toast=="function"&&o.toast!==M?o.toast:(K||(K=import(Q("pds-toast.js",o.currentConfig?.toastURL)).then(t=>{let s=t?.toast;if(typeof s!="function")throw new Error("Failed to load toast helper");return o.toast=s,s}).catch(t=>{throw K=null,t})),K)}async function ke(...e){return(await Be())(...e)}async function M(...e){return(await I())(...e)}M.success=async(...e)=>(await I()).success(...e);M.error=async(...e)=>(await I()).error(...e);M.warning=async(...e)=>(await I()).warning(...e);M.info=async(...e)=>(await I()).info(...e);var Ae=function(e="log",t,...s){let n=!!(o.registry&&!o.registry.isLive),c=(this?.debug||this?.design?.debug||o.debug||!1)===!0;if(n){if(!o.debug)return}else if(!c&&e!=="error"&&e!=="warn")return;let r=console[e]||console.log;s.length>0?r(t,...s):r(t)};function oe(e){if(e==null)return e;if(typeof e=="function")return;if(typeof e!="object")return e;if(Array.isArray(e))return e.map(s=>oe(s)).filter(s=>s!==void 0);let t={};for(let[s,n]of Object.entries(e)){let c=oe(n);c!==void 0&&(t[s]=c)}return t}async function qe(e,t={}){if(t?.runtimeConfig===!1||typeof fetch!="function")return null;let s=t?.runtimeConfigURL||`${e}pds-runtime-config.json`;try{let n=await fetch(s,{cache:"no-store"});return n.ok?await n.json():null}catch{return null}}o.registry=P;o.enums=fe;o.adoptLayers=ue;o.adoptPrimitives=pe;o.parse=Y;o.createStylesheet=me;o.isLiveMode=()=>P.isLive;o.ask=ke;o.toast=M;o.common=Z;o.AutoComplete=null;o.loadAutoComplete=async()=>{if(o.AutoComplete&&typeof o.AutoComplete.connect=="function")return o.AutoComplete;let e=Q("pds-autocomplete.js",o.currentConfig?.autoCompleteURL);return H||(H=import(e).then(t=>{let s=t?.AutoComplete||t?.default?.AutoComplete||t?.default||null;if(!s)throw new Error("AutoComplete export not found in module");return o.AutoComplete=s,s}).catch(t=>{throw H=null,t})),H};function _e(e){let t=typeof CustomEvent=="function";try{let s=t?new CustomEvent("pds:ready",{detail:e}):new Event("pds:ready");o.dispatchEvent(s)}catch{}if(typeof document<"u")if(t){let s={detail:e,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:ready",s))}catch{}try{document.dispatchEvent(new CustomEvent("pds-ready",s))}catch{}}else{try{document.dispatchEvent(new Event("pds:ready"))}catch{}try{document.dispatchEvent(new Event("pds-ready"))}catch{}}}function xe(e={}){let t=typeof CustomEvent=="function",s={at:Date.now(),...e};try{let n=t?new CustomEvent("pds:config-changed",{detail:s}):new Event("pds:config-changed");o.dispatchEvent(n)}catch{}if(typeof document<"u")if(t){let n={detail:s,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:config-changed",n))}catch{}}else try{document.dispatchEvent(new Event("pds:config-changed"))}catch{}}var ne="pure-ds-theme",j=null,$=null;function ie(e){try{if(typeof document>"u")return;let t="light";e?e==="system"?t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t=e:t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",document.documentElement.setAttribute("data-theme",t)}catch{}}function ae(e){try{if(j&&$){try{typeof j.removeEventListener=="function"?j.removeEventListener("change",$):typeof j.removeListener=="function"&&j.removeListener($)}catch{}j=null,$=null}if(e==="system"&&typeof window<"u"&&window.matchMedia){let t=window.matchMedia("(prefers-color-scheme: dark)"),s=n=>{let c=n?.matches===void 0?t.matches:n.matches;try{let r=c?"dark":"light";document.documentElement.setAttribute("data-theme",r),o.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,source:"system"}}))}catch{}};j=t,$=s,typeof t.addEventListener=="function"?t.addEventListener("change",s):typeof t.addListener=="function"&&t.addListener(s)}}catch{}}Object.defineProperty(o,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(ne)||null}catch{return null}},set(e){try{if(typeof window>"u")return;let t=o.currentConfig?.design||null,s=se(e);if(t&&!Le(t,s)){let n=t?.name||o.currentPreset?.name||o.currentConfig?.preset||"current preset";console.warn(`PDS theme "${s}" not supported by preset "${n}".`),o.dispatchEvent(new CustomEvent("pds:theme:blocked",{detail:{theme:e,resolvedTheme:s,preset:n}}));return}e==null?localStorage.removeItem(ne):localStorage.setItem(ne,e),ie(e),ae(e),o.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:e,source:"api"}}))}catch{}}});o.defaultEnhancers=[];async function He(e){let t=e&&e.mode||"live",{mode:s,...n}=e||{};if(t==="static")return Ve(n);let c=q(n,{resolvePublicAssetURL:z}),r=n?.managerURL||n?.public?.managerURL||n?.manager?.url||new URL("core/pds-manager.js",c).href||new URL("./pds-manager.js",import.meta.url).href,{startLive:d}=await import(r);return d(o,n,{emitReady:_e,emitConfigChanged:xe,applyResolvedTheme:ie,setupSystemListenerIfNeeded:ae})}o.start=He;async function Ve(e){if(!e||typeof e!="object")throw new Error("PDS.start({ mode: 'static', ... }) requires a valid configuration object");let t=e.applyGlobalStyles??!0,s=e.manageTheme??!0,n=e.themeStorageKey??"pure-ds-theme",c=e.staticPaths??{},r=q(e,{resolvePublicAssetURL:z}),d=e&&e.autoDefine||null,b;d&&d.baseURL?b=W(B(d.baseURL,{preferModule:!1})):b=`${r}components/`;let E=d&&Array.isArray(d.predefine)&&d.predefine||[],h=d&&typeof d.mapper=="function"&&d.mapper||null;try{Se(o);let{resolvedTheme:a}=Ee({manageTheme:s,themeStorageKey:n,applyResolvedTheme:ie,setupSystemListenerIfNeeded:ae}),i=await qe(r,e),g=Array.isArray(e?.enhancers)?e.enhancers:e?.enhancers&&typeof e.enhancers=="object"?Object.values(e.enhancers):[],f=i?.config?{...i.config,...e,design:e?.design||i.config.design,preset:e?.preset||i.config.preset}:{...e},S={tokens:`${r}styles/pds-tokens.css.js`,primitives:`${r}styles/pds-primitives.css.js`,components:`${r}styles/pds-components.css.js`,utilities:`${r}styles/pds-utilities.css.js`,styles:`${r}styles/pds-styles.css.js`},w=i?.paths||{};if(c={...S,...w,...c},o.registry.setStaticMode(c),t&&typeof document<"u")try{let u=await o.registry.getStylesheet("styles");if(u){u._pds=!0;let y=(document.adoptedStyleSheets||[]).filter(A=>A._pds!==!0);document.adoptedStyleSheets=[...y,u],xe({mode:"static",source:"static:styles-applied"})}}catch(u){Ae.call(o,"warn","Failed to apply static styles:",u)}let v=null,x=[];try{let u=await We(),y=await ve({autoDefineBaseURL:b,autoDefinePreload:E,autoDefineMapper:h,enhancers:g,autoDefineOverrides:d||null,autoDefinePreferModule:!(d&&d.baseURL)},{baseEnhancers:u});v=y.autoDefiner,x=y.mergedEnhancers||[]}catch(u){Ae.call(o,"error","\u274C Failed to initialize AutoDefiner/Enhancers (static):",u)}let _=oe(e);return o.currentConfig=Object.freeze({mode:"static",...structuredClone(_),design:structuredClone(f.design||{}),preset:f.preset,theme:a,enhancers:x}),_e({mode:"static",config:f,theme:a,autoDefiner:v}),{config:f,theme:a,autoDefiner:v}}catch(a){throw o.dispatchEvent(new CustomEvent("pds:error",{detail:{error:a}})),a}}var je={mode:"live",liveEdit:!0,preset:"default",autoDefine:{predefine:["pds-icon","pds-drawer","pds-toaster"]},log(e,t,...s){console[e](t,...s)}};var k={name:"@pure-ds/core",shortname:"pds",version:"0.7.21",description:"Why develop a Design System when you can generate one?",repository:{type:"git",url:"git+https://github.com/Pure-Web-Foundation/pure-ds.git"},bugs:{url:"https://github.com/Pure-Web-Foundation/pure-ds/issues"},homepage:"https://puredesignsystem.z6.web.core.windows.net/",keywords:["design-system","css","web-components","lit","constructable-stylesheets","tokens","utilities","a11y"],type:"module",main:"./public/assets/pds/core.js",module:"./public/assets/pds/core.js",types:"./dist/types/pds.d.ts",bin:{"pds-build":"packages/pds-cli/bin/pds-static.js","pds-sync-assets":"packages/pds-cli/bin/sync-assets.js","pds-build-icons":"packages/pds-cli/bin/pds-build-icons.js","pds-import":"packages/pds-cli/bin/pds-import.js","pds-setup-copilot":"packages/pds-cli/bin/pds-setup-copilot.js","pds-setup-mcp":"packages/pds-cli/bin/pds-setup-mcp.js","pds-init-config":"packages/pds-cli/bin/pds-init-config.js","pds-bootstrap":"packages/pds-cli/bin/pds-bootstrap.js","pds-mcp-server":"packages/pds-cli/bin/pds-mcp-server.js","pds-mcp-health":"packages/pds-cli/bin/pds-mcp-health.js","pds-mcp-eval":"packages/pds-cli/bin/pds-mcp-eval.js"},exports:{".":{types:"./src/js/pds.d.ts",import:"./public/assets/pds/core.js"},"./pds-core":"./src/js/pds.js","./auto-define/*":"./public/auto-define/*"},files:[".github/copilot-instructions.md",".cursorrules","dist/types/","public/assets/js/","public/assets/pds/components/","public/assets/pds/templates/","public/assets/pds/core.js","public/assets/pds/core/","public/assets/pds/external/","public/assets/pds/vscode-custom-data.json","public/assets/pds/pds.css-data.json","public/assets/pds/pds-css-complete.json","public/auto-define/","public/pds/components/","public/assets/pds/icons/pds-icons.svg","packages/pds-cli/bin/","packages/pds-cli/lib/","src/js/pds.d.ts","src/js/pds.js","src/js/pds-live-manager/","src/js/pds-core/","custom-elements.json","custom-elements-manifest.config.js","pds.html-data.json","pds.css-data.json","readme.md","INTELLISENSE.md","CSS-INTELLISENSE-LIMITATION.md","CSS-INTELLISENSE-QUICK-REF.md"],scripts:{test:'echo "Error: no test specified" && exit 1',dev:"node esbuild-dev.js",prebuild:"npm run types",build:"node esbuild-build.js",types:"tsc -p tsconfig.json && node scripts/sync-types.mjs",postinstall:"node packages/pds-cli/bin/postinstall.mjs","prepds:build":"npm run types","pds:build":"node packages/pds-cli/bin/pds-static.js","pds:build-icons":"node packages/pds-cli/bin/pds-build-icons.js","pds:bootstrap":"node packages/pds-cli/bin/pds-bootstrap.js","pds:manifest":"node packages/pds-cli/bin/generate-manifest.js","pds:css-data":"node packages/pds-cli/bin/generate-css-data.js","pds:import":"node packages/pds-cli/bin/pds-import.js","pds:dx":"node packages/pds-cli/bin/pds-dx.js","pds:mcp:server":"node packages/pds-cli/bin/pds-mcp-server.js","pds:mcp:health":"node packages/pds-cli/bin/pds-mcp-health.js","pds:mcp:eval":"node packages/pds-cli/bin/pds-mcp-eval.js","storybook:generate":"cd packages/pds-storybook && npm run generate-stories","storybook:dev":"cd packages/pds-storybook && npm run storybook:dev","storybook:build":"cd packages/pds-storybook && npm run storybook:build"},author:"Marc van Neerven",license:"ISC",engines:{node:">=18"},publishConfig:{access:"public"},devDependencies:{"@custom-elements-manifest/analyzer":"^0.9.9",esbuild:"^0.19.0","fs-extra":"^11.1.1",typescript:"^5.6.3","@types/node":"^22.10.2"},dependencies:{lit:"^3.3.1","pure-web":"1.1.32"},customElements:"custom-elements.json"};await o.start(je);var Re=typeof k.repository=="string"?k.repository:k.repository?.url,Ge=Re?Re.replace(/^git\+/,"").replace(/\.git$/,""):"",bt=k.homepage||Ge,gt=k.bugs?.url||"";document.body.innerHTML=`
3
3
  <pds-toaster id="global-toaster"></pds-toaster>
4
4
 
5
5
  <div class="container text-center">
@@ -52,6 +52,8 @@ export class SvgIcon extends HTMLElement {
52
52
  static externalIconCache = new Map();
53
53
  // Promises for in-flight external icon fetches (path-aware key)
54
54
  static externalIconPromises = new Map();
55
+ // Tracks base paths already logged for debug diagnostics
56
+ static externalPathDebugLogged = new Set();
55
57
 
56
58
  static instances = new Set();
57
59
 
@@ -586,17 +588,20 @@ export class SvgIcon extends HTMLElement {
586
588
  */
587
589
  static getExternalIconPath() {
588
590
  try {
589
- // Try to get from PDS.compiled.tokens.icons.externalPath (live mode)
590
- if (PDS?.compiled?.tokens?.icons?.externalPath) {
591
- return PDS.compiled.tokens.icons.externalPath;
592
- }
593
- // Fallback: check compiled.config.design.icons.externalPath
594
- if (PDS?.compiled?.config?.design?.icons?.externalPath) {
595
- return PDS.compiled.config.design.icons.externalPath;
596
- }
597
- // Fallback: check currentConfig
598
- if (PDS?.currentConfig?.design?.icons?.externalPath) {
599
- return PDS.currentConfig.design.icons.externalPath;
591
+ const candidates = [
592
+ PDS?.compiled?.tokens?.icons?.externalPath,
593
+ PDS?.compiled?.config?.design?.icons?.externalPath,
594
+ PDS?.compiled?.config?.icons?.externalPath,
595
+ PDS?.compiled?.options?.design?.icons?.externalPath,
596
+ PDS?.compiled?.options?.icons?.externalPath,
597
+ PDS?.currentConfig?.design?.icons?.externalPath,
598
+ PDS?.currentConfig?.icons?.externalPath,
599
+ ];
600
+
601
+ for (const value of candidates) {
602
+ if (typeof value === 'string' && value.trim()) {
603
+ return value;
604
+ }
600
605
  }
601
606
  } catch (e) {
602
607
  // Ignore errors accessing config
@@ -650,6 +655,20 @@ export class SvgIcon extends HTMLElement {
650
655
  return `${normalizedBasePath}${iconName}.svg`;
651
656
  }
652
657
 
658
+ /**
659
+ * Whether verbose icon diagnostics should be logged.
660
+ * @private
661
+ * @returns {boolean}
662
+ */
663
+ static isDebugLoggingEnabled() {
664
+ return Boolean(
665
+ PDS?.debug === true ||
666
+ PDS?.compiled?.config?.design?.debug === true ||
667
+ PDS?.compiled?.options?.design?.debug === true ||
668
+ PDS?.currentConfig?.design?.debug === true
669
+ );
670
+ }
671
+
653
672
  /**
654
673
  * Fetch an external SVG icon and cache it
655
674
  * @param {string} iconName - The icon name (without .svg extension)
@@ -676,6 +695,11 @@ export class SvgIcon extends HTMLElement {
676
695
 
677
696
  const iconUrl = SvgIcon.getExternalIconURL(iconName, normalizedBasePath);
678
697
 
698
+ if (SvgIcon.isDebugLoggingEnabled() && !SvgIcon.externalPathDebugLogged.has(normalizedBasePath)) {
699
+ SvgIcon.externalPathDebugLogged.add(normalizedBasePath);
700
+ console.debug('[pds-icon] Resolved external icon base path:', normalizedBasePath, 'example URL:', iconUrl);
701
+ }
702
+
679
703
  const promise = fetch(iconUrl)
680
704
  .then(async (response) => {
681
705
  if (!response.ok) {