@pure-ds/core 0.7.54 → 0.7.56
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.
- package/dist/types/public/assets/pds/components/pds-fab.d.ts +45 -6
- package/dist/types/public/assets/pds/components/pds-fab.d.ts.map +1 -1
- package/dist/types/src/js/pds-core/pds-generator.d.ts.map +1 -1
- package/package.json +1 -1
- package/public/assets/js/app.js +1 -1
- package/public/assets/js/pds-manager.js +14 -4
- package/public/assets/pds/components/pds-fab.js +427 -142
- package/public/assets/pds/core/pds-manager.js +14 -4
- package/src/js/pds-core/pds-generator.js +14 -4
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
* @cssprop --sat-fg - Foreground color of satellites (default: var(--color-text-primary))
|
|
16
16
|
* @cssprop --radius - Distance of satellites from main FAB (default: 100px)
|
|
17
17
|
* @cssprop --transition-duration - Animation duration (default: 420ms)
|
|
18
|
+
* @cssprop --z-fab-in-drawer - FAB z-index when used inside pds-drawer (default: var(--z-popover))
|
|
19
|
+
*
|
|
20
|
+
* @attr {"click"|"hover"} behavior - Interaction mode for opening satellites (default: click)
|
|
21
|
+
* @attr {"fixed"|"inline"} mode - Layout mode for FAB positioning (default: fixed)
|
|
18
22
|
*
|
|
19
23
|
* @csspart fab - The main FAB button
|
|
20
24
|
* @csspart satellite - Individual satellite buttons
|
|
@@ -49,33 +53,68 @@ export class PdsFab extends HTMLElement {
|
|
|
49
53
|
/**
|
|
50
54
|
* Starting angle in degrees (0=right, 90=down, 180=left, 270=up)
|
|
51
55
|
* If not specified, the angle is auto-detected based on the FAB's corner position:
|
|
52
|
-
* - Bottom-right: 180
|
|
53
|
-
* - Bottom-left: 315
|
|
54
|
-
* - Top-right: 225
|
|
55
|
-
* - Top-left: 45
|
|
56
|
+
* - Bottom-right: 180-� (fly left/up)
|
|
57
|
+
* - Bottom-left: 315-� (fly right/up)
|
|
58
|
+
* - Top-right: 225-� (fly left/down)
|
|
59
|
+
* - Top-left: 45-� (fly right/down)
|
|
56
60
|
* @type {number}
|
|
57
61
|
* @attr start-angle
|
|
58
62
|
* @default 180 (or auto-detected)
|
|
59
63
|
*/
|
|
60
64
|
get startAngle(): number;
|
|
65
|
+
set behavior(val: "click" | "hover");
|
|
66
|
+
/**
|
|
67
|
+
* Interaction mode for satellite menu.
|
|
68
|
+
* - click: toggles satellites when main FAB is clicked
|
|
69
|
+
* - hover: opens on hover/focus and closes when pointer leaves safe area
|
|
70
|
+
* @type {'click'|'hover'}
|
|
71
|
+
* @attr behavior
|
|
72
|
+
* @default click
|
|
73
|
+
*/
|
|
74
|
+
get behavior(): "click" | "hover";
|
|
75
|
+
set mode(val: "fixed" | "inline");
|
|
76
|
+
/**
|
|
77
|
+
* Layout mode for host positioning.
|
|
78
|
+
* - fixed: FAB is anchored to viewport bottom-right
|
|
79
|
+
* - inline: FAB participates in normal document flow
|
|
80
|
+
* @type {'fixed'|'inline'}
|
|
81
|
+
* @attr mode
|
|
82
|
+
* @default fixed
|
|
83
|
+
*/
|
|
84
|
+
get mode(): "fixed" | "inline";
|
|
85
|
+
set fabClass(val: string);
|
|
86
|
+
/**
|
|
87
|
+
* Space-separated class list forwarded to the internal button.
|
|
88
|
+
* Use this instead of host classes for btn-* and icon-only.
|
|
89
|
+
* @type {string}
|
|
90
|
+
* @attr fab-class
|
|
91
|
+
* @example "btn-primary icon-only"
|
|
92
|
+
*/
|
|
93
|
+
get fabClass(): string;
|
|
61
94
|
set satellites(val: Array<{
|
|
62
95
|
key: string;
|
|
63
96
|
icon?: string;
|
|
97
|
+
iconColor?: string;
|
|
98
|
+
bgColor?: string;
|
|
99
|
+
iconSize?: string;
|
|
64
100
|
label?: string;
|
|
65
101
|
action?: string;
|
|
66
102
|
}>);
|
|
67
103
|
/**
|
|
68
104
|
* Array of satellite button configurations
|
|
69
|
-
|
|
105
|
+
* @type {Array<{key: string, icon?: string, iconColor?: string, bgColor?: string, iconSize?: string, label?: string, action?: string}>}
|
|
70
106
|
*/
|
|
71
107
|
get satellites(): Array<{
|
|
72
108
|
key: string;
|
|
73
109
|
icon?: string;
|
|
110
|
+
iconColor?: string;
|
|
111
|
+
bgColor?: string;
|
|
112
|
+
iconSize?: string;
|
|
74
113
|
label?: string;
|
|
75
114
|
action?: string;
|
|
76
115
|
}>;
|
|
77
116
|
attributeChangedCallback(name: any, oldVal: any, newVal: any): void;
|
|
78
|
-
connectedCallback(): void
|
|
117
|
+
connectedCallback(): Promise<void>;
|
|
79
118
|
disconnectedCallback(): void;
|
|
80
119
|
#private;
|
|
81
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-fab.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-fab.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pds-fab.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-fab.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH;IAuBE,0CAEC;IAUD,cANU,OAAO,EAsBhB;IAxBD;;;;OAIG;IACH,YAHU,OAAO,CAKhB;IA4BD,gBAPU,MAAM,EAef;IAjBD;;;;;OAKG;IACH,cAJU,MAAM,CAMf;IAoBD,gBAPU,MAAM,EAef;IAjBD;;;;;OAKG;IACH,cAJU,MAAM,CAMf;IAyBD,oBAPU,MAAM,EAef;IAtBD;;;;;;;;;;OAUG;IACH,kBAJU,MAAM,CAMf;IAsBD,kBAPU,OAAO,GAAC,OAAO,EAgBxB;IApBD;;;;;;;OAOG;IACH,gBAJU,OAAO,GAAC,OAAO,CAMxB;IAuBD,cAPU,OAAO,GAAC,QAAQ,EAgBzB;IApBD;;;;;;;OAOG;IACH,YAJU,OAAO,GAAC,QAAQ,CAMzB;IAsBD,kBAPU,MAAM,EAoBf;IAvBD;;;;;;OAMG;IACH,gBAJU,MAAM,CAMf;IAuBD,oBALS,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC,EAarI;IAfD;;;OAGG;IACH,kBAFS,KAAK,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC,CAIrI;IAWD,oEA+CC;IAED,mCAuOC;IAED,6BAMC;;CAyWF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-generator.d.ts","sourceRoot":"","sources":["../../../../../src/js/pds-core/pds-generator.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pds-generator.d.ts","sourceRoot":"","sources":["../../../../../src/js/pds-core/pds-generator.js"],"names":[],"mappings":"AAihMA;;;;;;;;;;;GAWG;AACH,8CAPW,MAAM,YAEd;IAAyB,WAAW,GAA5B,MAAM;IACY,cAAc,GAAhC,OAAO;IACU,WAAW,GAA5B,MAAM;CACd,GAAU;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC;QAAC,IAAI,EAAC,MAAM,CAAC;QAAC,OAAO,EAAC,MAAM,CAAC;QAAC,KAAK,EAAC,MAAM,CAAC;QAAC,GAAG,EAAC,MAAM,CAAC;QAAC,OAAO,CAAC,EAAC,MAAM,CAAA;KAAC,CAAC,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC;QAAC,IAAI,EAAC,MAAM,CAAC;QAAC,OAAO,EAAC,MAAM,CAAC;QAAC,OAAO,CAAC,EAAC,MAAM,CAAA;KAAC,CAAC,CAAA;CAAE,CA0VrL;AAED;;;;;;;GAOG;AACH,0CAJW,KAAK,CAAC,MAAM,CAAC,YACb,MAAM,GACJ;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC;YAAC,IAAI,EAAC,MAAM,CAAC;YAAC,OAAO,EAAC,MAAM,CAAC;YAAC,KAAK,EAAC,MAAM,CAAC;YAAC,GAAG,EAAC,MAAM,CAAC;YAAC,OAAO,CAAC,EAAC,MAAM,CAAA;SAAC,CAAC,CAAC;QAAC,QAAQ,CAAC,EAAE,KAAK,CAAC;YAAC,IAAI,EAAC,MAAM,CAAC;YAAC,OAAO,EAAC,MAAM,CAAC;YAAC,OAAO,CAAC,EAAC,MAAM,CAAA;SAAC,CAAC,CAAA;KAAE,CAAC,CAAA;CAAE,CAkGtO;AA79MD;;;GAGG;AACH;IAEE,mCAAiB;IAEjB,2BAEC;IAOD,0BA6CC;IA5CC;;MAIC;IAaD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAmC;IA6BrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiCC;IAiiBD;;;;OAIG;IACH,kDAyBC;IAiFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6DC;IAuqID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEC;IAGD,oBAEC;IA8yBD,qBAEC;IACD,yBAEC;IACD,yBAEC;IACD,wBAEC;IACD,yBAMC;IAED;;;;;;OAMG;IACH,oBA6JC;IAGD,4BAEC;IACD,gCAEC;IACD,gCAEC;IACD,+BAEC;IAmBD;;;OAGG;IACH;;;;;;MAoBC;;CAkBF"}
|
package/package.json
CHANGED
package/public/assets/js/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var ct=Object.defineProperty;var lt=(e,t)=>{for(var n in t)ct(e,n,{get:t[n],enumerable:!0})};var le=class extends EventTarget{constructor(){super(),this.mode=null,this.compiled=null,this.log=()=>{},this.logHandler=null}},xe="__PURE_DS_PDS_SINGLETON__",de=typeof globalThis<"u"?globalThis:window,ce=de?.[xe],o=ce&&typeof ce.addEventListener=="function"?ce:new le;de&&(de[xe]=o);typeof o.log!="function"&&(o.log=(e="log",t,...n)=>{if(typeof console>"u")return;let s=typeof console[e]=="function"?console[e].bind(console):typeof console.log=="function"?console.log.bind(console):null;s&&(n.length>0?s(t,...n):s(t))});typeof o.logHandler!="function"&&(o.logHandler=null);var ue=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(n){o.log("error",`Registry: failed to load static ${t}:`,n),o.log("error",`Registry: looking for ${this._staticPaths[t]}`),o.log("error","Registry: make sure you've run 'npm run pds:build' and configured PDS.start() with the correct static.root path");let s=new CSSStyleSheet;return s.replaceSync("/* Failed to load "+t+" */"),s}}get mode(){return this._mode}get isLive(){return this._mode==="live"}},M=new ue;async function Re(e,t=[],n=null){try{let s=n?.primitivesStylesheet?n.primitivesStylesheet:await M.getStylesheet("primitives");e.adoptedStyleSheets=[s,...t]}catch(s){let a=e.host?.tagName?.toLowerCase()||"unknown";o.log("error",`Adopter: <${a}> failed to adopt primitives:`,s),e.adoptedStyleSheets=t}}async function De(e,t=["primitives"],n=[],s=null){let a=Array.isArray(n)?n.filter(Boolean):[];if(a.length){let l=(Array.isArray(e.adoptedStyleSheets)?e.adoptedStyleSheets:[]).filter(S=>!a.includes(S));e.adoptedStyleSheets=[...l,...a]}try{let l=(await Promise.all(t.map(async S=>{if(s)switch(S){case"tokens":return s.tokensStylesheet;case"primitives":return s.primitivesStylesheet;case"components":return s.componentsStylesheet;case"utilities":return s.utilitiesStylesheet;default:break}return M.getStylesheet(S)}))).filter(S=>S!==null);e.adoptedStyleSheets=[...l,...a]}catch(r){let l=e.host?.tagName?.toLowerCase()||"unknown";o.log("error",`Adopter: <${l}> failed to adopt layers:`,r),e.adoptedStyleSheets=a}}function ze(e){let t=new CSSStyleSheet;return t.replaceSync(e),t}var Ce={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 me={};lt(me,{deepMerge:()=>Te,fragmentFromTemplateLike:()=>pe,isObject:()=>K,parseFragment:()=>G,parseHTML:()=>fe});function K(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Te(e,t){let n={...e};return K(e)&&K(t)&&Object.keys(t).forEach(s=>{K(t[s])?s in e?n[s]=Te(e[s],t[s]):Object.assign(n,{[s]:t[s]}):Object.assign(n,{[s]:t[s]})}),n}function pe(e){let t=Array.isArray(e?.strings)?e.strings:[],n=Array.isArray(e?.values)?e.values:[],s=new Set,a=[],r=/(\s)(\.[\w-]+)=["']?\s*$/,l=/(\s)(@[\w-]+)=["']?\s*$/,S=/(\s)(\?[\w-]+)=["']?\s*$/,b=/(\s)([\w:-]+)=["']?\s*$/,d=/=["']\s*$/,i=!1;for(let c=0;c<t.length;c+=1){let y=t[c]??"";if(i&&(y=y.replace(/^["']/,""),i=!1),c<n.length){let w=`pds-val-${c}`,u=y.match(r),h=y.match(l),_=y.match(S),x=y.match(b);if(u){let v=u[2].slice(1);i=d.test(t[c]??""),y=y.replace(r,`$1data-pds-bind-${c}="prop:${v}:${w}"`),s.add(c)}else if(h){let v=h[2].slice(1);i=d.test(t[c]??""),y=y.replace(l,`$1data-pds-bind-${c}="event:${v}:${w}"`),s.add(c)}else if(_){let v=_[2].slice(1);i=d.test(t[c]??""),y=y.replace(S,`$1data-pds-bind-${c}="boolean:${v}:${w}"`),s.add(c)}else if(x){let v=x[2];i=d.test(t[c]??""),y=y.replace(b,`$1data-pds-bind-${c}="attr:${v}:${w}"`),s.add(c)}}a.push(y),c<n.length&&!s.has(c)&&a.push(`<!--pds-val-${c}-->`)}let p=document.createElement("template");p.innerHTML=a.join("");let A=(c,y)=>{let w=c.parentNode;if(!w)return;if(y==null){w.removeChild(c);return}let u=h=>{if(h!=null){if(h instanceof Node){w.insertBefore(h,c);return}if(Array.isArray(h)){h.forEach(_=>u(_));return}w.insertBefore(document.createTextNode(String(h)),c)}};u(y),w.removeChild(c)},L=document.createTreeWalker(p.content,NodeFilter.SHOW_COMMENT),j=[];for(;L.nextNode();){let c=L.currentNode;c?.nodeValue?.startsWith("pds-val-")&&j.push(c)}return j.forEach(c=>{let y=Number(c.nodeValue.replace("pds-val-",""));A(c,n[y])}),p.content.querySelectorAll("*").forEach(c=>{[...c.attributes].forEach(y=>{if(!y.name.startsWith("data-pds-bind-"))return;let w=y.value.indexOf(":"),u=y.value.lastIndexOf(":");if(w<=0||u<=w){c.removeAttribute(y.name);return}let h=y.value.slice(0,w),_=y.value.slice(w+1,u),x=y.value.slice(u+1),v=Number(String(x).replace("pds-val-","")),P=n[v];if(!_||!Number.isInteger(v)){c.removeAttribute(y.name);return}h==="prop"?c[_]=P:h==="event"?(typeof P=="function"||P&&typeof P.handleEvent=="function")&&c.addEventListener(_,P):h==="boolean"?P?c.setAttribute(_,""):c.removeAttribute(_):h==="attr"&&(P==null||P===!1?c.removeAttribute(_):c.setAttribute(_,String(P))),c.removeAttribute(y.name)})}),p.content}function G(e,...t){if(Array.isArray(e)&&Object.prototype.hasOwnProperty.call(e,"raw"))return pe({strings:Array.from(e),values:t});if(Array.isArray(e?.strings)&&Array.isArray(e?.values))return pe({strings:e.strings,values:e.values});let s=document.createElement("template");return s.innerHTML=String(e??""),s.content}function fe(e,...t){return G(e,...t).childNodes}var Ue="pds",dt=/^([a-z][a-z0-9+\-.]*:)?\/\//i,Me=/^[a-z]:/i;function O(e=""){return e.endsWith("/")?e:`${e}/`}function ut(e="",t=Ue){let n=e.replace(/\/+$/,"");return new RegExp(`(?:^|/)${t}$`,"i").test(n)?n:`${n}/${t}`}function pt(e){return e.replace(/^\.\/+/,"")}function ft(e){return Me.test(e)?e.replace(Me,"").replace(/^\/+/,""):e}function mt(e){return e.startsWith("public/")?e.substring(7):e}function q(e,t={}){let n=t.segment||Ue,s=t.defaultRoot||`/assets/${n}/`,a=e?.public&&e.public?.root||e?.static&&e.static?.root||null;if(!a||typeof a!="string")return O(s);let r=a.trim();return r?(r=r.replace(/\\/g,"/"),r=ut(r,n),r=O(r),dt.test(r)?r:(r=pt(r),r=ft(r),r.startsWith("/")||(r=mt(r),r.startsWith("/")||(r=`/${r}`),r=r.replace(/\/+/g,(l,S)=>S===0?l:"/")),O(r))):O(s)}async function ht(...e){let t={};e.length&&typeof e[e.length-1]=="object"&&(t=e.pop()||{});let n=e,{baseURL:s,mapper:a=d=>`${d}.js`,onError:r=(d,i)=>console.error(`[defineWebComponents] ${d}:`,i)}=t,l=s?new URL(s,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),S=d=>d.toLowerCase().replace(/(^|-)([a-z])/g,(i,p,A)=>A.toUpperCase()),b=async d=>{try{if(customElements.get(d))return{tag:d,status:"already-defined"};let i=a(d),A=await import(i instanceof URL?i.href:new URL(i,l).href),L=A?.default??A?.[S(d)];if(!L){if(customElements.get(d))return{tag:d,status:"self-defined"};throw new Error(`No export found for ${d}. Expected default export or named export "${S(d)}".`)}return customElements.get(d)?{tag:d,status:"race-already-defined"}:(customElements.define(d,L),{tag:d,status:"defined"})}catch(i){throw r(d,i),i}};return Promise.all(n.map(b))}var J=class{constructor(t={}){let{baseURL:n,mapper:s,onError:a,predicate:r=()=>!0,attributeModule:l="data-module",root:S=document,scanExisting:b=!0,debounceMs:d=16,observeShadows:i=!0,enhancers:p=[],patchAttachShadow:A=!0}=t,L=new Set,j=new Set,D=new Set,c=new Map,y=new WeakMap,w=new WeakMap,u=0,h=!1,_=null,x=f=>{if(!f||!p.length)return;let g=w.get(f);g||(g=new Set,w.set(f,g));for(let m of p)if(!(!m.selector||!m.run)&&!g.has(m.selector))try{f.matches&&f.matches(m.selector)&&(m.run(f),g.add(m.selector))}catch(k){console.warn(`[AutoDefiner] Error applying enhancer for selector "${m.selector}":`,k)}},v=(f,g)=>{if(!h&&!(!f||!f.includes("-"))&&!customElements.get(f)&&!j.has(f)&&!D.has(f)){if(g&&g.getAttribute){let m=g.getAttribute(l);m&&!c.has(f)&&c.set(f,m)}L.add(f),P()}},P=()=>{u||(u=setTimeout(je,d))},C=f=>{if(f){if(f.nodeType===1){let g=f,m=g.tagName?.toLowerCase();m&&m.includes("-")&&!customElements.get(m)&&r(m,g)&&v(m,g),x(g),i&&g.shadowRoot&&ae(g.shadowRoot)}f.querySelectorAll&&f.querySelectorAll("*").forEach(g=>{let m=g.tagName?.toLowerCase();m&&m.includes("-")&&!customElements.get(m)&&r(m,g)&&v(m,g),x(g),i&&g.shadowRoot&&ae(g.shadowRoot)})}},ae=f=>{if(!f||y.has(f))return;C(f);let g=new MutationObserver(m=>{for(let k of m)k.addedNodes?.forEach(T=>{C(T)}),k.type==="attributes"&&k.target&&C(k.target)});g.observe(f,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[l,...p.map(m=>m.selector).filter(m=>m.startsWith("data-"))]}),y.set(f,g)};async function je(){if(clearTimeout(u),u=0,!L.size)return;let f=Array.from(L);L.clear(),f.forEach(g=>j.add(g));try{let g=m=>c.get(m)??(s?s(m):`${m}.js`);await ht(...f,{baseURL:n,mapper:g,onError:(m,k)=>{D.add(m),a?.(m,k)}})}catch{}finally{f.forEach(g=>j.delete(g))}}let Pe=S===document?document.documentElement:S,ke=new MutationObserver(f=>{for(let g of f)g.addedNodes?.forEach(m=>{C(m)}),g.type==="attributes"&&g.target&&C(g.target)});if(ke.observe(Pe,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[l,...p.map(f=>f.selector).filter(f=>f.startsWith("data-"))]}),i&&A&&Element.prototype.attachShadow){let f=Element.prototype.attachShadow;Element.prototype.attachShadow=function(m){let k=f.call(this,m);if(m&&m.mode==="open"){ae(k);let T=this.tagName?.toLowerCase();T&&T.includes("-")&&!customElements.get(T)&&v(T,this)}return k},_=()=>Element.prototype.attachShadow=f}return b&&C(Pe),{stop(){h=!0,ke.disconnect(),_&&_(),u&&(clearTimeout(u),u=0),y.forEach(f=>f.disconnect())},flush:je}}static async define(...t){let n={};t.length&&typeof t[t.length-1]=="object"&&(n=t.pop()||{});let s=t,{baseURL:a,mapper:r=i=>`${i}.js`,onError:l=(i,p)=>console.error(`[defineWebComponents] ${i}:`,p)}=n,S=a?new URL(a,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),b=i=>i.toLowerCase().replace(/(^|-)([a-z])/g,(p,A,L)=>L.toUpperCase()),d=async i=>{try{if(customElements.get(i))return{tag:i,status:"already-defined"};let p=r(i),L=await import(p instanceof URL?p.href:new URL(p,S).href),j=L?.default??L?.[b(i)];if(!j){if(customElements.get(i))return{tag:i,status:"self-defined"};throw new Error(`No export found for ${i}. Expected default export or named export "${b(i)}".`)}return customElements.get(i)?{tag:i,status:"race-already-defined"}:(customElements.define(i,j),{tag:i,status:"defined"})}catch(p){throw l(i,p),p}};return Promise.all(s.map(d))}};var yt=/^[a-z][a-z0-9+\-.]*:\/\//i,I=(()=>{try{return import.meta.url}catch{return}})(),V=e=>typeof e=="string"&&e.length&&!e.endsWith("/")?`${e}/`:e;function Q(e,t={}){if(!e||yt.test(e))return e;let{preferModule:n=!0}=t,s=()=>{if(!I)return null;try{return new URL(e,I).href}catch{return null}},a=()=>{if(typeof window>"u"||!window.location?.origin)return null;try{return new URL(e,window.location.origin).href}catch{return null}};return(n?s()||a():a()||s())||e}var $e=(()=>{if(I)try{let e=new URL(I);if(/\/public\/assets\/js\//.test(e.pathname))return new URL("../pds/",I).href}catch{return}})(),Ne=!1;function Oe(e){Ne||typeof document>"u"||(Ne=!0,e.addEventListener("pds:ready",t=>{let n=t.detail?.mode;n&&document.documentElement.classList.add(`pds-${n}`,"pds-ready")}))}function Ie({manageTheme:e,themeStorageKey:t,applyResolvedTheme:n,setupSystemListenerIfNeeded:s}){let a="light",r=null;if(e&&typeof window<"u"){try{r=localStorage.getItem(t)||null}catch{r=null}try{n?.(r),s?.(r)}catch{}r?r==="system"?a=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a=r:a=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return{resolvedTheme:a,storedTheme:r}}function Y(e,{resolvePublicAssetURL:t}){let n=!!(e?.public?.root||e?.static?.root),s=t(e);return!n&&$e&&(s=$e),V(Q(s))}async function Fe(e,{baseEnhancers:t=[]}={}){let{autoDefineBaseURL:n="/auto-define/",autoDefinePreload:s=[],autoDefineMapper:a=null,enhancers:r=[],autoDefineOverrides:l=null,autoDefinePreferModule:S=!0}=e,b=(()=>{let i=new Map;return(t||[]).forEach(p=>i.set(p.selector,p)),(r||[]).forEach(p=>i.set(p.selector,p)),Array.from(i.values())})(),d=null;if(typeof window<"u"&&typeof document<"u"){let i=J,p=u=>{switch(u){case"pds-tabpanel":return"pds-tabstrip.js";default:return`${u}.js`}},{mapper:A,enhancers:L,...j}=l&&typeof l=="object"?l:{},D=L?Array.isArray(L)?L:typeof L=="object"?Object.values(L):[]:[],c=(()=>{let u=new Map;return(b||[]).forEach(h=>{h?.selector&&u.set(h.selector,h)}),(D||[]).forEach(h=>{if(!h?.selector)return;let _=u.get(h.selector)||null;u.set(h.selector,{..._||{},...h,run:typeof h?.run=="function"?h.run:_?.run})}),Array.from(u.values())})(),w={baseURL:n&&V(Q(n,{preferModule:S})),predefine:s,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:c,onError:(u,h)=>{if(typeof u=="string"&&u.startsWith("pds-")){let x=["pds-form","pds-drawer"].includes(u),v=h?.message?.includes("#pds/lit")||h?.message?.includes("Failed to resolve module specifier");x&&v?o.log("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`):o.log("warn",`\u26A0\uFE0F PDS component <${u}> not found. Assets may not be installed.`)}else o.log("error",`\u274C Auto-define error for <${u}>:`,h)},...j,mapper:u=>{if(customElements.get(u))return null;if(typeof a=="function")try{let h=a(u);return h===void 0?p(u):h}catch(h){return o.log("warn","Custom autoDefine.mapper error; falling back to default:",h?.message||h),p(u)}return p(u)}};d=new i(w),s.length>0&&typeof i.define=="function"&&await i.define(...s,{baseURL:n,mapper:w.mapper,onError:w.onError})}return{autoDefiner:d,mergedEnhancers:b}}var he=["light","dark"],ye=new Set(he);function gt(e){let n=(Array.isArray(e?.themes)?e.themes.map(s=>String(s).toLowerCase()):he).filter(s=>ye.has(s));return n.length?n:he}function ge(e,{preferDocument:t=!0}={}){let n=String(e||"").toLowerCase();if(ye.has(n))return n;if(t&&typeof document<"u"){let s=document.documentElement?.getAttribute("data-theme");if(ye.has(s))return s}return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function We(e,t){let n=ge(t);return gt(e).includes(n)}var bt=new Set(["log","warn","error","debug","info"]),wt="__PURE_DS_PDS_SINGLETON__",be=null,we=null;function He(){try{let t=(typeof globalThis<"u"?globalThis:window)?.[wt];if(t&&typeof t=="object")return t}catch{return null}return null}function St(e){return!e||typeof e!="object"?null:{mode:e.mode==="live"||e.mode==="static"?e.mode:null,debug:e.debug===!0,thisArg:e.thisArg}}function Lt(e){if(typeof e!="string")return"log";let t=e.toLowerCase();return bt.has(t)?t:"log"}function _t(){if(typeof we=="function")try{let t=St(we());if(t)return t}catch{}let e=He();if(e){let t=e?.mode||e?.compiled?.mode||(e?.registry?.isLive?"live":"static"),n=(e?.debug||e?.currentConfig?.debug||e?.currentConfig?.design?.debug||e?.compiled?.debug||e?.compiled?.design?.debug||!1)===!0;return{mode:t,debug:n,thisArg:e}}return{mode:null,debug:!1}}function Et(){if(typeof be=="function")try{let t=be();if(typeof t=="function")return t}catch{}let e=He();return typeof e?.logHandler=="function"?e.logHandler:null}function Be(e,t,...n){if(typeof console>"u")return;let s=typeof console[e]=="function"?console[e].bind(console):typeof console.log=="function"?console.log.bind(console):null;s&&(n.length>0?s(t,...n):s(t))}function vt(e,t){let n=t?.debug===!0;return!(t?.mode==="static"&&!n||!n&&e!=="error"&&e!=="warn")}function Ke({getLogger:e,getContext:t}={}){be=typeof e=="function"?e:null,we=typeof t=="function"?t:null}function Ge(e="log",t,...n){let s=Lt(e),a=_t(),r=Et();if(r)try{r.call(a?.thisArg,s,t,...n);return}catch(l){Be("error","Custom log handler failed:",l)}vt(s,a)&&Be(s,t,...n)}typeof o.initializing!="boolean"&&(o.initializing=!1);"currentPreset"in o||(o.currentPreset=null);typeof o.debug!="boolean"&&(o.debug=!1);"currentConfig"in o||(o.currentConfig=null);"compiled"in o||(o.compiled=null);typeof o.logHandler!="function"&&(o.logHandler=null);"mode"in o||(o.mode=null);var Z=null,X=null,ee=null,te=null,ne=null,se=null,Je="__pdsLocalizationRuntime";function U(){if(se)return se;let e=o?.[Je];return e&&typeof e=="object"?(se=e,e):null}function At(e){let t=e&&typeof e=="object"?e:null;se=t,o[Je]=t}Ke({getLogger:()=>typeof o.logHandler=="function"?o.logHandler:null,getContext:()=>{let e=o?.mode||o?.compiled?.mode||(o?.registry?.isLive?"live":"static"),t=(o?.debug||o?.currentConfig?.debug||o?.currentConfig?.design?.debug||o?.compiled?.debug||o?.compiled?.design?.debug||!1)===!0;return{mode:e,debug:t,thisArg:o}}});o.log=(e="log",t,...n)=>{Ge(e,t,...n)};var E={locale:"en",messages:{},hasProvider:!1},oe=new Set;function Ve(e){return!!e&&typeof e!="string"&&typeof e=="object"&&"strTag"in e}function Qe(e=[]){let t="";for(let n=0;n<=e.length-1;n+=1)t+=e[n],n<e.length-1&&(t+=`{${n}}`);return t}function jt(e,t){return String(e).replace(/\{(\d+)\}/g,(n,s)=>t(Number(s)))}function Pt(e){if(!e||typeof e!="object")return{};let t={};for(let[n,s]of Object.entries(e)){if(typeof s=="string"){t[n]=s;continue}s&&typeof s=="object"&&typeof s.content=="string"&&(t[n]=s.content)}return t}function kt(e,...t){return{strTag:!0,strings:Array.from(e||[]),values:t,raw:Array.from(e?.raw||[])}}function xt(e){if(!e)return"";if(Ve(e)){let n=Qe(e.strings||[]),s=E.messages[n]||n;return jt(s,a=>e.values?.[a])}let t=String(e);return E.messages[t]||t}function Rt(e){if(!e)return;let t=Ve(e)?Qe(e.strings||[]):String(e);typeof t=="string"&&t.length>0&&oe.add(t)}function Ye(e){if(!e||typeof e.msg!="function"||oe.size===0)return;let t=Array.from(oe);oe.clear();for(let n of t)try{e.msg(n)}catch{}}async function W(){let e=U();return e||(ne||(ne=import(B("pds-localization.js")).then(n=>{if(typeof n?.msg!="function"||typeof n?.str!="function"||typeof n?.configureLocalization!="function"||typeof n?.loadLocale!="function"||typeof n?.setLocale!="function"||typeof n?.getLocalizationState!="function")throw new Error("Failed to load localization runtime exports");return At(n),Ye(n),n}).catch(n=>{throw ne=null,n})),ne)}var $=(e,t={})=>{let n=U();return typeof n?.msg=="function"?n.msg(e,t):(Rt(e),xt(e,t))},ie=(e,...t)=>{let n=U();return typeof n?.str=="function"?n.str(e,...t):kt(e,...t)},re=(e=null)=>{let t=U();if(typeof t?.configureLocalization=="function")return t.configureLocalization(e);if(!e||typeof e!="object")return E.locale="en",E.messages={},E.hasProvider=!1,{locale:E.locale,messages:{...E.messages},hasProvider:E.hasProvider};typeof e.locale=="string"&&e.locale.trim()&&(E.locale=e.locale.trim()),Object.prototype.hasOwnProperty.call(e,"messages")&&(E.messages=Pt(e.messages));let n=!!(e.provider||e.translate||e.loadLocale||e.setLocale);return E.hasProvider=n,n&&W().then(s=>{s.configureLocalization(e),Ye(s)}).catch(()=>{}),{locale:E.locale,messages:{...E.messages},hasProvider:E.hasProvider}},Ze=async e=>(await W()).loadLocale(e),Xe=async(e,t={})=>(await W()).setLocale(e,t),et=()=>{let e=U();return typeof e?.getLocalizationState=="function"?e.getLocalizationState():{locale:E.locale,messages:{...E.messages},hasProvider:E.hasProvider}},tt=(e={})=>{let t=U();if(typeof t?.createJSONLocalization=="function")return t.createJSONLocalization(e);let n=typeof e?.locale=="string"&&e.locale.trim()?e.locale.trim().toLowerCase():"en",s=Array.isArray(e?.locales)?e.locales.map(b=>String(b||"").trim().toLowerCase()).filter(Boolean):[],a=Array.from(new Set([n,...s])),r=null,l=async()=>(r||(r=W().then(b=>typeof b?.createJSONLocalization=="function"?b.createJSONLocalization(e):null).catch(()=>null)),r),S=async(b="loadLocale")=>{let d=await l();if(!d||typeof d!="object")return null;let i=d.provider;if(!i||typeof i!="object")return null;let p=i[b];return typeof p=="function"?p:b==="setLocale"&&typeof i.loadLocale=="function"?i.loadLocale:null};return{locale:n,locales:[...a],provider:{locales:[...a],async loadLocale(b={}){let d=await S("loadLocale");return typeof d!="function"?{}:d(b)},async setLocale(b={}){let d=await S("setLocale");return typeof d!="function"?{}:d(b)}}}};function B(e,t){return t&&typeof t=="string"?t:`${Y(o.currentConfig||{},{resolvePublicAssetURL:q})}core/${e}`}async function Dt(){return Array.isArray(o.defaultEnhancers)&&o.defaultEnhancers.length>0?o.defaultEnhancers:(te||(te=import(B("pds-enhancers.js",o.currentConfig?.enhancersURL)).then(t=>{let n=Array.isArray(t?.defaultPDSEnhancers)?t.defaultPDSEnhancers:[];return o.defaultEnhancers=n,n}).catch(t=>{throw te=null,t})),te)}async function zt(){return typeof o.ask=="function"&&o.ask!==nt?o.ask:(X||(X=import(B("pds-ask.js",o.currentConfig?.askURL)).then(t=>{let n=t?.ask;if(typeof n!="function")throw new Error("Failed to load ask helper");return o.ask=n,n}).catch(t=>{throw X=null,t})),X)}async function H(){return typeof o.toast=="function"&&o.toast!==N?o.toast:(ee||(ee=import(B("pds-toast.js",o.currentConfig?.toastURL)).then(t=>{let n=t?.toast;if(typeof n!="function")throw new Error("Failed to load toast helper");return o.toast=n,n}).catch(t=>{throw ee=null,t})),ee)}async function nt(...e){return(await zt())(...e)}async function N(...e){return(await H())(...e)}N.success=async(...e)=>(await H()).success(...e);N.error=async(...e)=>(await H()).error(...e);N.warning=async(...e)=>(await H()).warning(...e);N.info=async(...e)=>(await H()).info(...e);var qe=function(e="log",t,...n){o.log(e,t,...n)};function Le(e){if(e==null)return e;if(typeof e=="function")return;if(typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>Le(n)).filter(n=>n!==void 0);let t={};for(let[n,s]of Object.entries(e)){let a=Le(s);a!==void 0&&(t[n]=a)}return t}function st(e,t=new WeakSet){if(!e||typeof e!="object"||t.has(e))return e;t.add(e),Object.freeze(e);for(let n of Object.keys(e))st(e[n],t);return e}function _e(e){return e==null||typeof e!="object"?e:st(structuredClone(Le(e)))}async function Ct(e,t={}){if(t?.runtimeConfig===!1||typeof fetch!="function")return null;let n=t?.runtimeConfigURL||`${e}pds-runtime-config.json`;try{let s=await fetch(n,{cache:"no-store"});return s.ok?await s.json():null}catch{return null}}o.registry=M;o.enums=Ce;o.adoptLayers=De;o.adoptPrimitives=Re;var Tt=fe;o.parse=Tt;var Ee=G;o.html=Ee;o.createStylesheet=ze;o.isLiveMode=()=>M.isLive;o.ask=nt;o.toast=N;o.common=me;o.msg=$;o.str=ie;o.configureLocalization=re;o.loadLocale=Ze;o.setLocale=Xe;o.getLocalizationState=et;o.createJSONLocalization=tt;o.i18n={msg:$,str:ie,configure:re,loadLocale:Ze,setLocale:Xe,getState:et,createJSONLocalization:tt};o.AutoComplete=null;o.loadAutoComplete=async()=>{if(o.AutoComplete&&typeof o.AutoComplete.connect=="function")return o.AutoComplete;let e=B("pds-autocomplete.js",o.currentConfig?.autoCompleteURL);return Z||(Z=import(e).then(t=>{let n=t?.AutoComplete||t?.default?.AutoComplete||t?.default||null;if(!n)throw new Error("AutoComplete export not found in module");return o.AutoComplete=n,n}).catch(t=>{throw Z=null,t})),Z};function ot(e){let t=typeof CustomEvent=="function";try{let n=t?new CustomEvent("pds:ready",{detail:e}):new Event("pds:ready");o.dispatchEvent(n)}catch{}if(typeof document<"u")if(t){let n={detail:e,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:ready",n))}catch{}try{document.dispatchEvent(new CustomEvent("pds-ready",n))}catch{}}else{try{document.dispatchEvent(new Event("pds:ready"))}catch{}try{document.dispatchEvent(new Event("pds-ready"))}catch{}}}function rt(e={}){let t=typeof CustomEvent=="function",n={at:Date.now(),...e};try{let s=t?new CustomEvent("pds:config-changed",{detail:n}):new Event("pds:config-changed");o.dispatchEvent(s)}catch{}if(typeof document<"u")if(t){let s={detail:n,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:config-changed",s))}catch{}}else try{document.dispatchEvent(new Event("pds:config-changed"))}catch{}}var Se="pure-ds-theme",z=null,F=null;function ve(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(z&&F){try{typeof z.removeEventListener=="function"?z.removeEventListener("change",F):typeof z.removeListener=="function"&&z.removeListener(F)}catch{}z=null,F=null}if(e==="system"&&typeof window<"u"&&window.matchMedia){let t=window.matchMedia("(prefers-color-scheme: dark)"),n=s=>{let a=s?.matches===void 0?t.matches:s.matches;try{let r=a?"dark":"light";document.documentElement.setAttribute("data-theme",r),o.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,source:"system"}}))}catch{}};z=t,F=n,typeof t.addEventListener=="function"?t.addEventListener("change",n):typeof t.addListener=="function"&&t.addListener(n)}}catch{}}var Mt=Object.getOwnPropertyDescriptor(o,"theme");Mt||Object.defineProperty(o,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(Se)||null}catch{return null}},set(e){try{if(typeof window>"u")return;let t=o.currentConfig?.design||null,n=ge(e);if(t&&!We(t,n)){let s=t?.name||o.currentPreset?.name||o.currentConfig?.preset||"current preset";o.log("warn",`PDS theme "${n}" not supported by preset "${s}".`),o.dispatchEvent(new CustomEvent("pds:theme:blocked",{detail:{theme:e,resolvedTheme:n,preset:s}}));return}e==null?localStorage.removeItem(Se):localStorage.setItem(Se,e),ve(e),Ae(e),o.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:e,source:"api"}}))}catch{}}});o.defaultEnhancers=[];async function Ut(e){o.initializing=!0;try{let t=e&&e.mode||"live",{mode:n,...s}=e||{};o.mode=t,o.logHandler=typeof s?.log=="function"?s.log:null,o.currentConfig=_e(s);let a=s&&typeof s.localization=="object"&&s.localization?s.localization:null;a?(await W(),re(a)):re(null);let r;if(t==="static")r=await $t(s);else{let{localization:S,...b}=s||{},d=Y(b,{resolvePublicAssetURL:q}),i=b?.managerURL||b?.public?.managerURL||b?.manager?.url||new URL("core/pds-manager.js",d).href||new URL("./pds-manager.js",import.meta.url).href,{startLive:p}=await import(i);r=await p(o,b,{emitReady:ot,emitConfigChanged:rt,applyResolvedTheme:ve,setupSystemListenerIfNeeded:Ae})}o.compiled=_e(r?.config||null);let l=o?.compiled?.design?.icons?.externalPath||"/assets/img/icons/";return o.log("info",`startup ready; external icon path: ${l}`),r}finally{o.initializing=!1}}o.start=Ut;async function $t(e){if(!e||typeof e!="object")throw new Error("PDS.start({ mode: 'static', ... }) requires a valid configuration object");let t=e.applyGlobalStyles??!0,n=e.manageTheme??!0,s=e.themeStorageKey??"pure-ds-theme",a=e.staticPaths??{},r=Y(e,{resolvePublicAssetURL:q}),l=e&&e.autoDefine||null,S;l&&l.baseURL?S=V(Q(l.baseURL,{preferModule:!1})):S=`${r}components/`;let b=l&&Array.isArray(l.predefine)&&l.predefine||[],d=l&&typeof l.mapper=="function"&&l.mapper||null;try{Oe(o);let{resolvedTheme:i}=Ie({manageTheme:n,themeStorageKey:s,applyResolvedTheme:ve,setupSystemListenerIfNeeded:Ae}),p=await Ct(r,e),A=Array.isArray(e?.enhancers)?e.enhancers:e?.enhancers&&typeof e.enhancers=="object"?Object.values(e.enhancers):[],L=p?.config?{...p.config,...e,design:e?.design||p.config.design,preset:e?.preset||p.config.preset}:{...e},j={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`},D=p?.paths||{};if(a={...j,...D,...a},o.registry.setStaticMode(a),t&&typeof document<"u")try{let w=await o.registry.getStylesheet("styles");if(w){w._pds=!0;let u=(document.adoptedStyleSheets||[]).filter(h=>h._pds!==!0);document.adoptedStyleSheets=[...u,w],rt({mode:"static",source:"static:styles-applied"})}}catch(w){qe.call(o,"warn","Failed to apply static styles:",w)}let c=null,y=[];try{let w=await Dt(),u=await Fe({autoDefineBaseURL:S,autoDefinePreload:b,autoDefineMapper:d,enhancers:A,autoDefineOverrides:l||null,autoDefinePreferModule:!(l&&l.baseURL)},{baseEnhancers:w});c=u.autoDefiner,y=u.mergedEnhancers||[]}catch(w){qe.call(o,"error","\u274C Failed to initialize AutoDefiner/Enhancers (static):",w)}return o.compiled=_e({mode:"static",...L,theme:i,enhancers:y}),ot({mode:"static",config:L,theme:i,autoDefiner:c}),{config:L,theme:i,autoDefiner:c}}catch(i){throw o.dispatchEvent(new CustomEvent("pds:error",{detail:{error:i}})),i}}var Nt=o.createJSONLocalization({locale:"en-US",locales:["en-US","nl-NL"],aliases:{en:["en-US"],nl:["nl-NL"]},basePath:"/assets/locales"}),it={mode:"live",liveEdit:!0,preset:"default",localization:Nt,autoDefine:{predefine:["pds-icon","pds-drawer","pds-toaster"]},log(e,t,...n){(this?.mode||this?.compiled?.mode||"live")!=="static"&&(typeof console[e]=="function"?console[e]:console.log)(`[PDS] ${t}`,...n)}};var R={name:"@pure-ds/core",shortname:"pds",version:"0.7.54",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"},"./localization":{types:"./dist/types/src/js/pds-localization.d.ts",import:"./public/assets/pds/core/pds-localization.js"},"./lit":{types:"./dist/types/src/js/lit.d.ts",import:"./public/assets/pds/external/lit.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-singleton.js","src/js/common/","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","LOCALIZATION.md","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","@types/node":"^22.10.2",esbuild:"^0.19.0","fs-extra":"^11.1.1",typescript:"^5.6.3"},dependencies:{lit:"^3.3.2","pure-web":"1.1.32"},customElements:"custom-elements.json"};await o.start(it);document.documentElement.lang="en";var at=typeof R.repository=="string"?R.repository:R.repository?.url,It=at?at.replace(/^git\+/,"").replace(/\.git$/,""):"",bn=R.homepage||It,wn=R.bugs?.url||"";document.body.appendChild(Ee`
|
|
2
|
+
See: https://github.com/Pure-Web-Foundation/pure-ds/blob/main/readme.md#lit-components-not-working`):o.log("warn",`\u26A0\uFE0F PDS component <${u}> not found. Assets may not be installed.`)}else o.log("error",`\u274C Auto-define error for <${u}>:`,h)},...j,mapper:u=>{if(customElements.get(u))return null;if(typeof a=="function")try{let h=a(u);return h===void 0?p(u):h}catch(h){return o.log("warn","Custom autoDefine.mapper error; falling back to default:",h?.message||h),p(u)}return p(u)}};d=new i(w),s.length>0&&typeof i.define=="function"&&await i.define(...s,{baseURL:n,mapper:w.mapper,onError:w.onError})}return{autoDefiner:d,mergedEnhancers:b}}var he=["light","dark"],ye=new Set(he);function gt(e){let n=(Array.isArray(e?.themes)?e.themes.map(s=>String(s).toLowerCase()):he).filter(s=>ye.has(s));return n.length?n:he}function ge(e,{preferDocument:t=!0}={}){let n=String(e||"").toLowerCase();if(ye.has(n))return n;if(t&&typeof document<"u"){let s=document.documentElement?.getAttribute("data-theme");if(ye.has(s))return s}return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function We(e,t){let n=ge(t);return gt(e).includes(n)}var bt=new Set(["log","warn","error","debug","info"]),wt="__PURE_DS_PDS_SINGLETON__",be=null,we=null;function He(){try{let t=(typeof globalThis<"u"?globalThis:window)?.[wt];if(t&&typeof t=="object")return t}catch{return null}return null}function St(e){return!e||typeof e!="object"?null:{mode:e.mode==="live"||e.mode==="static"?e.mode:null,debug:e.debug===!0,thisArg:e.thisArg}}function Lt(e){if(typeof e!="string")return"log";let t=e.toLowerCase();return bt.has(t)?t:"log"}function _t(){if(typeof we=="function")try{let t=St(we());if(t)return t}catch{}let e=He();if(e){let t=e?.mode||e?.compiled?.mode||(e?.registry?.isLive?"live":"static"),n=(e?.debug||e?.currentConfig?.debug||e?.currentConfig?.design?.debug||e?.compiled?.debug||e?.compiled?.design?.debug||!1)===!0;return{mode:t,debug:n,thisArg:e}}return{mode:null,debug:!1}}function Et(){if(typeof be=="function")try{let t=be();if(typeof t=="function")return t}catch{}let e=He();return typeof e?.logHandler=="function"?e.logHandler:null}function Be(e,t,...n){if(typeof console>"u")return;let s=typeof console[e]=="function"?console[e].bind(console):typeof console.log=="function"?console.log.bind(console):null;s&&(n.length>0?s(t,...n):s(t))}function vt(e,t){let n=t?.debug===!0;return!(t?.mode==="static"&&!n||!n&&e!=="error"&&e!=="warn")}function Ke({getLogger:e,getContext:t}={}){be=typeof e=="function"?e:null,we=typeof t=="function"?t:null}function Ge(e="log",t,...n){let s=Lt(e),a=_t(),r=Et();if(r)try{r.call(a?.thisArg,s,t,...n);return}catch(l){Be("error","Custom log handler failed:",l)}vt(s,a)&&Be(s,t,...n)}typeof o.initializing!="boolean"&&(o.initializing=!1);"currentPreset"in o||(o.currentPreset=null);typeof o.debug!="boolean"&&(o.debug=!1);"currentConfig"in o||(o.currentConfig=null);"compiled"in o||(o.compiled=null);typeof o.logHandler!="function"&&(o.logHandler=null);"mode"in o||(o.mode=null);var Z=null,X=null,ee=null,te=null,ne=null,se=null,Je="__pdsLocalizationRuntime";function U(){if(se)return se;let e=o?.[Je];return e&&typeof e=="object"?(se=e,e):null}function At(e){let t=e&&typeof e=="object"?e:null;se=t,o[Je]=t}Ke({getLogger:()=>typeof o.logHandler=="function"?o.logHandler:null,getContext:()=>{let e=o?.mode||o?.compiled?.mode||(o?.registry?.isLive?"live":"static"),t=(o?.debug||o?.currentConfig?.debug||o?.currentConfig?.design?.debug||o?.compiled?.debug||o?.compiled?.design?.debug||!1)===!0;return{mode:e,debug:t,thisArg:o}}});o.log=(e="log",t,...n)=>{Ge(e,t,...n)};var E={locale:"en",messages:{},hasProvider:!1},oe=new Set;function Ve(e){return!!e&&typeof e!="string"&&typeof e=="object"&&"strTag"in e}function Qe(e=[]){let t="";for(let n=0;n<=e.length-1;n+=1)t+=e[n],n<e.length-1&&(t+=`{${n}}`);return t}function jt(e,t){return String(e).replace(/\{(\d+)\}/g,(n,s)=>t(Number(s)))}function Pt(e){if(!e||typeof e!="object")return{};let t={};for(let[n,s]of Object.entries(e)){if(typeof s=="string"){t[n]=s;continue}s&&typeof s=="object"&&typeof s.content=="string"&&(t[n]=s.content)}return t}function kt(e,...t){return{strTag:!0,strings:Array.from(e||[]),values:t,raw:Array.from(e?.raw||[])}}function xt(e){if(!e)return"";if(Ve(e)){let n=Qe(e.strings||[]),s=E.messages[n]||n;return jt(s,a=>e.values?.[a])}let t=String(e);return E.messages[t]||t}function Rt(e){if(!e)return;let t=Ve(e)?Qe(e.strings||[]):String(e);typeof t=="string"&&t.length>0&&oe.add(t)}function Ye(e){if(!e||typeof e.msg!="function"||oe.size===0)return;let t=Array.from(oe);oe.clear();for(let n of t)try{e.msg(n)}catch{}}async function W(){let e=U();return e||(ne||(ne=import(B("pds-localization.js")).then(n=>{if(typeof n?.msg!="function"||typeof n?.str!="function"||typeof n?.configureLocalization!="function"||typeof n?.loadLocale!="function"||typeof n?.setLocale!="function"||typeof n?.getLocalizationState!="function")throw new Error("Failed to load localization runtime exports");return At(n),Ye(n),n}).catch(n=>{throw ne=null,n})),ne)}var $=(e,t={})=>{let n=U();return typeof n?.msg=="function"?n.msg(e,t):(Rt(e),xt(e,t))},ie=(e,...t)=>{let n=U();return typeof n?.str=="function"?n.str(e,...t):kt(e,...t)},re=(e=null)=>{let t=U();if(typeof t?.configureLocalization=="function")return t.configureLocalization(e);if(!e||typeof e!="object")return E.locale="en",E.messages={},E.hasProvider=!1,{locale:E.locale,messages:{...E.messages},hasProvider:E.hasProvider};typeof e.locale=="string"&&e.locale.trim()&&(E.locale=e.locale.trim()),Object.prototype.hasOwnProperty.call(e,"messages")&&(E.messages=Pt(e.messages));let n=!!(e.provider||e.translate||e.loadLocale||e.setLocale);return E.hasProvider=n,n&&W().then(s=>{s.configureLocalization(e),Ye(s)}).catch(()=>{}),{locale:E.locale,messages:{...E.messages},hasProvider:E.hasProvider}},Ze=async e=>(await W()).loadLocale(e),Xe=async(e,t={})=>(await W()).setLocale(e,t),et=()=>{let e=U();return typeof e?.getLocalizationState=="function"?e.getLocalizationState():{locale:E.locale,messages:{...E.messages},hasProvider:E.hasProvider}},tt=(e={})=>{let t=U();if(typeof t?.createJSONLocalization=="function")return t.createJSONLocalization(e);let n=typeof e?.locale=="string"&&e.locale.trim()?e.locale.trim().toLowerCase():"en",s=Array.isArray(e?.locales)?e.locales.map(b=>String(b||"").trim().toLowerCase()).filter(Boolean):[],a=Array.from(new Set([n,...s])),r=null,l=async()=>(r||(r=W().then(b=>typeof b?.createJSONLocalization=="function"?b.createJSONLocalization(e):null).catch(()=>null)),r),S=async(b="loadLocale")=>{let d=await l();if(!d||typeof d!="object")return null;let i=d.provider;if(!i||typeof i!="object")return null;let p=i[b];return typeof p=="function"?p:b==="setLocale"&&typeof i.loadLocale=="function"?i.loadLocale:null};return{locale:n,locales:[...a],provider:{locales:[...a],async loadLocale(b={}){let d=await S("loadLocale");return typeof d!="function"?{}:d(b)},async setLocale(b={}){let d=await S("setLocale");return typeof d!="function"?{}:d(b)}}}};function B(e,t){return t&&typeof t=="string"?t:`${Y(o.currentConfig||{},{resolvePublicAssetURL:q})}core/${e}`}async function Dt(){return Array.isArray(o.defaultEnhancers)&&o.defaultEnhancers.length>0?o.defaultEnhancers:(te||(te=import(B("pds-enhancers.js",o.currentConfig?.enhancersURL)).then(t=>{let n=Array.isArray(t?.defaultPDSEnhancers)?t.defaultPDSEnhancers:[];return o.defaultEnhancers=n,n}).catch(t=>{throw te=null,t})),te)}async function zt(){return typeof o.ask=="function"&&o.ask!==nt?o.ask:(X||(X=import(B("pds-ask.js",o.currentConfig?.askURL)).then(t=>{let n=t?.ask;if(typeof n!="function")throw new Error("Failed to load ask helper");return o.ask=n,n}).catch(t=>{throw X=null,t})),X)}async function H(){return typeof o.toast=="function"&&o.toast!==N?o.toast:(ee||(ee=import(B("pds-toast.js",o.currentConfig?.toastURL)).then(t=>{let n=t?.toast;if(typeof n!="function")throw new Error("Failed to load toast helper");return o.toast=n,n}).catch(t=>{throw ee=null,t})),ee)}async function nt(...e){return(await zt())(...e)}async function N(...e){return(await H())(...e)}N.success=async(...e)=>(await H()).success(...e);N.error=async(...e)=>(await H()).error(...e);N.warning=async(...e)=>(await H()).warning(...e);N.info=async(...e)=>(await H()).info(...e);var qe=function(e="log",t,...n){o.log(e,t,...n)};function Le(e){if(e==null)return e;if(typeof e=="function")return;if(typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>Le(n)).filter(n=>n!==void 0);let t={};for(let[n,s]of Object.entries(e)){let a=Le(s);a!==void 0&&(t[n]=a)}return t}function st(e,t=new WeakSet){if(!e||typeof e!="object"||t.has(e))return e;t.add(e),Object.freeze(e);for(let n of Object.keys(e))st(e[n],t);return e}function _e(e){return e==null||typeof e!="object"?e:st(structuredClone(Le(e)))}async function Ct(e,t={}){if(t?.runtimeConfig===!1||typeof fetch!="function")return null;let n=t?.runtimeConfigURL||`${e}pds-runtime-config.json`;try{let s=await fetch(n,{cache:"no-store"});return s.ok?await s.json():null}catch{return null}}o.registry=M;o.enums=Ce;o.adoptLayers=De;o.adoptPrimitives=Re;var Tt=fe;o.parse=Tt;var Ee=G;o.html=Ee;o.createStylesheet=ze;o.isLiveMode=()=>M.isLive;o.ask=nt;o.toast=N;o.common=me;o.msg=$;o.str=ie;o.configureLocalization=re;o.loadLocale=Ze;o.setLocale=Xe;o.getLocalizationState=et;o.createJSONLocalization=tt;o.i18n={msg:$,str:ie,configure:re,loadLocale:Ze,setLocale:Xe,getState:et,createJSONLocalization:tt};o.AutoComplete=null;o.loadAutoComplete=async()=>{if(o.AutoComplete&&typeof o.AutoComplete.connect=="function")return o.AutoComplete;let e=B("pds-autocomplete.js",o.currentConfig?.autoCompleteURL);return Z||(Z=import(e).then(t=>{let n=t?.AutoComplete||t?.default?.AutoComplete||t?.default||null;if(!n)throw new Error("AutoComplete export not found in module");return o.AutoComplete=n,n}).catch(t=>{throw Z=null,t})),Z};function ot(e){let t=typeof CustomEvent=="function";try{let n=t?new CustomEvent("pds:ready",{detail:e}):new Event("pds:ready");o.dispatchEvent(n)}catch{}if(typeof document<"u")if(t){let n={detail:e,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:ready",n))}catch{}try{document.dispatchEvent(new CustomEvent("pds-ready",n))}catch{}}else{try{document.dispatchEvent(new Event("pds:ready"))}catch{}try{document.dispatchEvent(new Event("pds-ready"))}catch{}}}function rt(e={}){let t=typeof CustomEvent=="function",n={at:Date.now(),...e};try{let s=t?new CustomEvent("pds:config-changed",{detail:n}):new Event("pds:config-changed");o.dispatchEvent(s)}catch{}if(typeof document<"u")if(t){let s={detail:n,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:config-changed",s))}catch{}}else try{document.dispatchEvent(new Event("pds:config-changed"))}catch{}}var Se="pure-ds-theme",z=null,F=null;function ve(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(z&&F){try{typeof z.removeEventListener=="function"?z.removeEventListener("change",F):typeof z.removeListener=="function"&&z.removeListener(F)}catch{}z=null,F=null}if(e==="system"&&typeof window<"u"&&window.matchMedia){let t=window.matchMedia("(prefers-color-scheme: dark)"),n=s=>{let a=s?.matches===void 0?t.matches:s.matches;try{let r=a?"dark":"light";document.documentElement.setAttribute("data-theme",r),o.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,source:"system"}}))}catch{}};z=t,F=n,typeof t.addEventListener=="function"?t.addEventListener("change",n):typeof t.addListener=="function"&&t.addListener(n)}}catch{}}var Mt=Object.getOwnPropertyDescriptor(o,"theme");Mt||Object.defineProperty(o,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(Se)||null}catch{return null}},set(e){try{if(typeof window>"u")return;let t=o.currentConfig?.design||null,n=ge(e);if(t&&!We(t,n)){let s=t?.name||o.currentPreset?.name||o.currentConfig?.preset||"current preset";o.log("warn",`PDS theme "${n}" not supported by preset "${s}".`),o.dispatchEvent(new CustomEvent("pds:theme:blocked",{detail:{theme:e,resolvedTheme:n,preset:s}}));return}e==null?localStorage.removeItem(Se):localStorage.setItem(Se,e),ve(e),Ae(e),o.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:e,source:"api"}}))}catch{}}});o.defaultEnhancers=[];async function Ut(e){o.initializing=!0;try{let t=e&&e.mode||"live",{mode:n,...s}=e||{};o.mode=t,o.logHandler=typeof s?.log=="function"?s.log:null,o.currentConfig=_e(s);let a=s&&typeof s.localization=="object"&&s.localization?s.localization:null;a?(await W(),re(a)):re(null);let r;if(t==="static")r=await $t(s);else{let{localization:S,...b}=s||{},d=Y(b,{resolvePublicAssetURL:q}),i=b?.managerURL||b?.public?.managerURL||b?.manager?.url||new URL("core/pds-manager.js",d).href||new URL("./pds-manager.js",import.meta.url).href,{startLive:p}=await import(i);r=await p(o,b,{emitReady:ot,emitConfigChanged:rt,applyResolvedTheme:ve,setupSystemListenerIfNeeded:Ae})}o.compiled=_e(r?.config||null);let l=o?.compiled?.design?.icons?.externalPath||"/assets/img/icons/";return o.log("info",`startup ready; external icon path: ${l}`),r}finally{o.initializing=!1}}o.start=Ut;async function $t(e){if(!e||typeof e!="object")throw new Error("PDS.start({ mode: 'static', ... }) requires a valid configuration object");let t=e.applyGlobalStyles??!0,n=e.manageTheme??!0,s=e.themeStorageKey??"pure-ds-theme",a=e.staticPaths??{},r=Y(e,{resolvePublicAssetURL:q}),l=e&&e.autoDefine||null,S;l&&l.baseURL?S=V(Q(l.baseURL,{preferModule:!1})):S=`${r}components/`;let b=l&&Array.isArray(l.predefine)&&l.predefine||[],d=l&&typeof l.mapper=="function"&&l.mapper||null;try{Oe(o);let{resolvedTheme:i}=Ie({manageTheme:n,themeStorageKey:s,applyResolvedTheme:ve,setupSystemListenerIfNeeded:Ae}),p=await Ct(r,e),A=Array.isArray(e?.enhancers)?e.enhancers:e?.enhancers&&typeof e.enhancers=="object"?Object.values(e.enhancers):[],L=p?.config?{...p.config,...e,design:e?.design||p.config.design,preset:e?.preset||p.config.preset}:{...e},j={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`},D=p?.paths||{};if(a={...j,...D,...a},o.registry.setStaticMode(a),t&&typeof document<"u")try{let w=await o.registry.getStylesheet("styles");if(w){w._pds=!0;let u=(document.adoptedStyleSheets||[]).filter(h=>h._pds!==!0);document.adoptedStyleSheets=[...u,w],rt({mode:"static",source:"static:styles-applied"})}}catch(w){qe.call(o,"warn","Failed to apply static styles:",w)}let c=null,y=[];try{let w=await Dt(),u=await Fe({autoDefineBaseURL:S,autoDefinePreload:b,autoDefineMapper:d,enhancers:A,autoDefineOverrides:l||null,autoDefinePreferModule:!(l&&l.baseURL)},{baseEnhancers:w});c=u.autoDefiner,y=u.mergedEnhancers||[]}catch(w){qe.call(o,"error","\u274C Failed to initialize AutoDefiner/Enhancers (static):",w)}return o.compiled=_e({mode:"static",...L,theme:i,enhancers:y}),ot({mode:"static",config:L,theme:i,autoDefiner:c}),{config:L,theme:i,autoDefiner:c}}catch(i){throw o.dispatchEvent(new CustomEvent("pds:error",{detail:{error:i}})),i}}var Nt=o.createJSONLocalization({locale:"en-US",locales:["en-US","nl-NL"],aliases:{en:["en-US"],nl:["nl-NL"]},basePath:"/assets/locales"}),it={mode:"live",liveEdit:!0,preset:"default",localization:Nt,autoDefine:{predefine:["pds-icon","pds-drawer","pds-toaster"]},log(e,t,...n){(this?.mode||this?.compiled?.mode||"live")!=="static"&&(typeof console[e]=="function"?console[e]:console.log)(`[PDS] ${t}`,...n)}};var R={name:"@pure-ds/core",shortname:"pds",version:"0.7.56",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"},"./localization":{types:"./dist/types/src/js/pds-localization.d.ts",import:"./public/assets/pds/core/pds-localization.js"},"./lit":{types:"./dist/types/src/js/lit.d.ts",import:"./public/assets/pds/external/lit.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-singleton.js","src/js/common/","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","LOCALIZATION.md","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","@types/node":"^22.10.2",esbuild:"^0.19.0","fs-extra":"^11.1.1",typescript:"^5.6.3"},dependencies:{lit:"^3.3.2","pure-web":"1.1.32"},customElements:"custom-elements.json"};await o.start(it);document.documentElement.lang="en";var at=typeof R.repository=="string"?R.repository:R.repository?.url,It=at?at.replace(/^git\+/,"").replace(/\.git$/,""):"",bn=R.homepage||It,wn=R.bugs?.url||"";document.body.appendChild(Ee`
|
|
3
3
|
<div class="container text-center">
|
|
4
4
|
<img src="/assets/img/pds-logo.svg" alt="PDS Logo" title="${$("PDS Logo")}" width="64" height="64" />
|
|
5
5
|
<header class="container section">
|
|
@@ -1210,10 +1210,6 @@ fieldset[role="group"].buttons {
|
|
|
1210
1210
|
color: var(--color-text-primary);
|
|
1211
1211
|
}
|
|
1212
1212
|
|
|
1213
|
-
&:has([disabled]) {
|
|
1214
|
-
pointer-events: none;
|
|
1215
|
-
}
|
|
1216
|
-
|
|
1217
1213
|
&:has(input:is([type="radio"], [type="checkbox"]):checked) {
|
|
1218
1214
|
background-color: color-mix(in oklab, var(--color-primary-fill) 8%, transparent);
|
|
1219
1215
|
border-color: var(--color-primary-fill);
|
|
@@ -3215,6 +3211,20 @@ nav[data-dropdown] {
|
|
|
3215
3211
|
/* scrollbar-gutter: stable; */
|
|
3216
3212
|
}
|
|
3217
3213
|
|
|
3214
|
+
/* Disabled primitive (low specificity): usable on any element via [disabled] or aria-disabled. */
|
|
3215
|
+
:where([disabled], [aria-disabled="true"]) {
|
|
3216
|
+
opacity: var(--state-disabled-opacity, 0.7);
|
|
3217
|
+
cursor: not-allowed;
|
|
3218
|
+
pointer-events: none;
|
|
3219
|
+
}
|
|
3220
|
+
|
|
3221
|
+
/* Also dim/disable labels that contain disabled controls. */
|
|
3222
|
+
:where(label:has(:disabled), label:has([disabled])) {
|
|
3223
|
+
opacity: var(--state-disabled-opacity, 0.7);
|
|
3224
|
+
cursor: not-allowed;
|
|
3225
|
+
pointer-events: none;
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3218
3228
|
/* Button primitives */
|
|
3219
3229
|
:where(button) {
|
|
3220
3230
|
all: unset;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PDS } from "#pds";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Floating Action Button (FAB) with expandable satellite actions
|
|
3
5
|
*
|
|
@@ -15,6 +17,10 @@
|
|
|
15
17
|
* @cssprop --sat-fg - Foreground color of satellites (default: var(--color-text-primary))
|
|
16
18
|
* @cssprop --radius - Distance of satellites from main FAB (default: 100px)
|
|
17
19
|
* @cssprop --transition-duration - Animation duration (default: 420ms)
|
|
20
|
+
* @cssprop --z-fab-in-drawer - FAB z-index when used inside pds-drawer (default: var(--z-popover))
|
|
21
|
+
*
|
|
22
|
+
* @attr {"click"|"hover"} behavior - Interaction mode for opening satellites (default: click)
|
|
23
|
+
* @attr {"fixed"|"inline"} mode - Layout mode for FAB positioning (default: fixed)
|
|
18
24
|
*
|
|
19
25
|
* @csspart fab - The main FAB button
|
|
20
26
|
* @csspart satellite - Individual satellite buttons
|
|
@@ -31,6 +37,11 @@ export class PdsFab extends HTMLElement {
|
|
|
31
37
|
#hasCustomSpread = false;
|
|
32
38
|
#hasCustomStartAngle = false;
|
|
33
39
|
#iconRetryPending = false;
|
|
40
|
+
#behavior = 'click';
|
|
41
|
+
#mode = 'fixed';
|
|
42
|
+
#fabClass = '';
|
|
43
|
+
#hoverMoveTracker = null;
|
|
44
|
+
#componentStyles = null;
|
|
34
45
|
|
|
35
46
|
constructor() {
|
|
36
47
|
super();
|
|
@@ -39,7 +50,7 @@ export class PdsFab extends HTMLElement {
|
|
|
39
50
|
}
|
|
40
51
|
|
|
41
52
|
static get observedAttributes() {
|
|
42
|
-
return ['open', 'radius', 'spread', 'start-angle'];
|
|
53
|
+
return ['open', 'radius', 'spread', 'start-angle', 'behavior', 'mode', 'fab-class'];
|
|
43
54
|
}
|
|
44
55
|
|
|
45
56
|
/**
|
|
@@ -109,10 +120,10 @@ export class PdsFab extends HTMLElement {
|
|
|
109
120
|
/**
|
|
110
121
|
* Starting angle in degrees (0=right, 90=down, 180=left, 270=up)
|
|
111
122
|
* If not specified, the angle is auto-detected based on the FAB's corner position:
|
|
112
|
-
* - Bottom-right: 180
|
|
113
|
-
* - Bottom-left: 315
|
|
114
|
-
* - Top-right: 225
|
|
115
|
-
* - Top-left: 45
|
|
123
|
+
* - Bottom-right: 180-� (fly left/up)
|
|
124
|
+
* - Bottom-left: 315-� (fly right/up)
|
|
125
|
+
* - Top-right: 225-� (fly left/down)
|
|
126
|
+
* - Top-left: 45-� (fly right/down)
|
|
116
127
|
* @type {number}
|
|
117
128
|
* @attr start-angle
|
|
118
129
|
* @default 180 (or auto-detected)
|
|
@@ -130,9 +141,78 @@ export class PdsFab extends HTMLElement {
|
|
|
130
141
|
this.#render();
|
|
131
142
|
}
|
|
132
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Interaction mode for satellite menu.
|
|
146
|
+
* - click: toggles satellites when main FAB is clicked
|
|
147
|
+
* - hover: opens on hover/focus and closes when pointer leaves safe area
|
|
148
|
+
* @type {'click'|'hover'}
|
|
149
|
+
* @attr behavior
|
|
150
|
+
* @default click
|
|
151
|
+
*/
|
|
152
|
+
get behavior() {
|
|
153
|
+
return this.#behavior;
|
|
154
|
+
}
|
|
155
|
+
set behavior(val) {
|
|
156
|
+
const next = val === 'hover' ? 'hover' : 'click';
|
|
157
|
+
if (this.#behavior === next) return;
|
|
158
|
+
this.#behavior = next;
|
|
159
|
+
if (this.getAttribute('behavior') !== next) {
|
|
160
|
+
this.setAttribute('behavior', next);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
this.#render();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Layout mode for host positioning.
|
|
168
|
+
* - fixed: FAB is anchored to viewport bottom-right
|
|
169
|
+
* - inline: FAB participates in normal document flow
|
|
170
|
+
* @type {'fixed'|'inline'}
|
|
171
|
+
* @attr mode
|
|
172
|
+
* @default fixed
|
|
173
|
+
*/
|
|
174
|
+
get mode() {
|
|
175
|
+
return this.#mode;
|
|
176
|
+
}
|
|
177
|
+
set mode(val) {
|
|
178
|
+
const next = val === 'inline' ? 'inline' : 'fixed';
|
|
179
|
+
if (this.#mode === next) return;
|
|
180
|
+
this.#mode = next;
|
|
181
|
+
if (this.getAttribute('mode') !== next) {
|
|
182
|
+
this.setAttribute('mode', next);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
this.#render();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Space-separated class list forwarded to the internal button.
|
|
190
|
+
* Use this instead of host classes for btn-* and icon-only.
|
|
191
|
+
* @type {string}
|
|
192
|
+
* @attr fab-class
|
|
193
|
+
* @example "btn-primary icon-only"
|
|
194
|
+
*/
|
|
195
|
+
get fabClass() {
|
|
196
|
+
return this.#fabClass;
|
|
197
|
+
}
|
|
198
|
+
set fabClass(val) {
|
|
199
|
+
const next = String(val || '').trim();
|
|
200
|
+
if (this.#fabClass === next) return;
|
|
201
|
+
this.#fabClass = next;
|
|
202
|
+
if (this.getAttribute('fab-class') !== next) {
|
|
203
|
+
if (next) {
|
|
204
|
+
this.setAttribute('fab-class', next);
|
|
205
|
+
} else {
|
|
206
|
+
this.removeAttribute('fab-class');
|
|
207
|
+
}
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
this.#render();
|
|
211
|
+
}
|
|
212
|
+
|
|
133
213
|
/**
|
|
134
214
|
* Array of satellite button configurations
|
|
135
|
-
|
|
215
|
+
* @type {Array<{key: string, icon?: string, iconColor?: string, bgColor?: string, iconSize?: string, label?: string, action?: string}>}
|
|
136
216
|
*/
|
|
137
217
|
get satellites() {
|
|
138
218
|
return this.#satellites;
|
|
@@ -184,18 +264,257 @@ export class PdsFab extends HTMLElement {
|
|
|
184
264
|
this.#hasCustomStartAngle = true;
|
|
185
265
|
this.startAngle = Number(newVal) || 180;
|
|
186
266
|
break;
|
|
267
|
+
case 'behavior':
|
|
268
|
+
this.behavior = newVal === 'hover' ? 'hover' : 'click';
|
|
269
|
+
break;
|
|
270
|
+
case 'mode':
|
|
271
|
+
this.mode = newVal === 'inline' ? 'inline' : 'fixed';
|
|
272
|
+
break;
|
|
273
|
+
case 'fab-class':
|
|
274
|
+
this.fabClass = newVal || '';
|
|
275
|
+
break;
|
|
187
276
|
}
|
|
188
277
|
}
|
|
189
278
|
|
|
190
|
-
connectedCallback() {
|
|
279
|
+
async connectedCallback() {
|
|
191
280
|
this.#hasCustomRadius = this.hasAttribute('radius');
|
|
192
281
|
this.#hasCustomSpread = this.hasAttribute('spread');
|
|
193
282
|
this.#hasCustomStartAngle = this.hasAttribute('start-angle');
|
|
283
|
+
this.#behavior = this.getAttribute('behavior') === 'hover' ? 'hover' : 'click';
|
|
284
|
+
this.#mode = this.getAttribute('mode') === 'inline' ? 'inline' : 'fixed';
|
|
285
|
+
this.#fabClass = (this.getAttribute('fab-class') || '').trim();
|
|
286
|
+
if (!this.#componentStyles) {
|
|
287
|
+
this.#componentStyles = PDS.createStylesheet(/*css*/`
|
|
288
|
+
@layer pds-fab {
|
|
289
|
+
:host {
|
|
290
|
+
--fab-hit-area: var(--control-min-height, 2.5rem);
|
|
291
|
+
--sat-size: 48px;
|
|
292
|
+
--fab-size: 64px;
|
|
293
|
+
--fab-bg: var(--color-primary-600, #0078d4);
|
|
294
|
+
--fab-fg: white;
|
|
295
|
+
--sat-bg: var(--color-surface-elevated, #2a2a2a);
|
|
296
|
+
--sat-fg: var(--color-text-primary, #fff);
|
|
297
|
+
--radius: 100px;
|
|
298
|
+
--transition-duration: 420ms;
|
|
299
|
+
|
|
300
|
+
position: fixed;
|
|
301
|
+
inset: auto 20px 20px auto;
|
|
302
|
+
z-index: var(--fab-host-z-index, var(--z-notification, 1000));
|
|
303
|
+
display: inline-block;
|
|
304
|
+
vertical-align: middle;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
:host([mode="inline"]) {
|
|
308
|
+
position: relative;
|
|
309
|
+
inset: auto;
|
|
310
|
+
--fab-size: auto;
|
|
311
|
+
--sat-size: 40px;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.wrap {
|
|
315
|
+
position: relative;
|
|
316
|
+
width: var(--fab-size);
|
|
317
|
+
height: var(--fab-size);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
:host([mode="inline"]) .wrap {
|
|
321
|
+
width: auto;
|
|
322
|
+
height: auto;
|
|
323
|
+
display: inline-flex;
|
|
324
|
+
align-items: center;
|
|
325
|
+
justify-content: center;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.fab {
|
|
329
|
+
position: relative;
|
|
330
|
+
z-index: 2;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.fab ::slotted(pds-icon) {
|
|
334
|
+
display: inline-block;
|
|
335
|
+
transition: transform 0.2s ease;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/* When FAB is icon-only, the slot must fill and center for proper button geometry */
|
|
339
|
+
.fab.icon-only ::slotted(pds-icon) {
|
|
340
|
+
display: grid;
|
|
341
|
+
place-items: center;
|
|
342
|
+
inline-size: 100%;
|
|
343
|
+
block-size: 100%;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
:host([mode="inline"]) .fab.icon-only {
|
|
347
|
+
/* Match compact icon-only geometry used by normal PDS buttons */
|
|
348
|
+
inline-size: max(36px, calc(var(--font-size-base) + (max(calc(var(--spacing-1) * 1), var(--spacing-2)) * 2) + (var(--border-width-medium) * 2)));
|
|
349
|
+
block-size: max(36px, calc(var(--font-size-base) + (max(calc(var(--spacing-1) * 1), var(--spacing-2)) * 2) + (var(--border-width-medium) * 2)));
|
|
350
|
+
min-inline-size: 0;
|
|
351
|
+
min-block-size: 0;
|
|
352
|
+
padding: 0;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
:host([open]) .fab.has-satellites.has-plus ::slotted(pds-icon) {
|
|
356
|
+
transform: rotate(45deg);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.sat-text {
|
|
360
|
+
font-size: 1.25rem;
|
|
361
|
+
font-weight: 600;
|
|
362
|
+
user-select: none;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/* Host may carry forwarded button classes, but must never render as a button */
|
|
367
|
+
:host([class*="btn-"]),
|
|
368
|
+
:host(.icon-only) {
|
|
369
|
+
background: transparent;
|
|
370
|
+
border: 0;
|
|
371
|
+
border-radius: 0;
|
|
372
|
+
box-shadow: none;
|
|
373
|
+
color: inherit;
|
|
374
|
+
font: inherit;
|
|
375
|
+
inline-size: auto;
|
|
376
|
+
block-size: auto;
|
|
377
|
+
min-inline-size: 0;
|
|
378
|
+
min-block-size: 0;
|
|
379
|
+
padding: 0;
|
|
380
|
+
text-decoration: none;
|
|
381
|
+
transform: none;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/* Unlayered to prevent generic button primitives from overriding satellites */
|
|
385
|
+
.sat {
|
|
386
|
+
all: unset;
|
|
387
|
+
position: absolute;
|
|
388
|
+
top: calc((var(--fab-size) - var(--sat-size)) / 2);
|
|
389
|
+
left: calc((var(--fab-size) - var(--sat-size)) / 2);
|
|
390
|
+
inline-size: var(--sat-size);
|
|
391
|
+
block-size: var(--sat-size);
|
|
392
|
+
border-radius: 50%;
|
|
393
|
+
overflow: hidden;
|
|
394
|
+
background: var(--sat-bg);
|
|
395
|
+
color: var(--sat-fg);
|
|
396
|
+
box-shadow:
|
|
397
|
+
0 2px 6px rgba(0, 0, 0, 0.15),
|
|
398
|
+
0 6px 18px rgba(0, 0, 0, 0.2);
|
|
399
|
+
display: grid;
|
|
400
|
+
place-items: center;
|
|
401
|
+
cursor: pointer;
|
|
402
|
+
transform: translate(0, 0) scale(0.2);
|
|
403
|
+
opacity: 0;
|
|
404
|
+
pointer-events: none;
|
|
405
|
+
transition:
|
|
406
|
+
transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1.4),
|
|
407
|
+
opacity 420ms ease;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
:host([mode="inline"]) .sat {
|
|
411
|
+
inline-size: 40px;
|
|
412
|
+
block-size: 40px;
|
|
413
|
+
border-radius: 50%;
|
|
414
|
+
--sat-icon-offset-x: 0px;
|
|
415
|
+
--sat-icon-offset-y: 3px;
|
|
416
|
+
background: var(--sat-bg-color, var(--sat-bg, var(--color-primary-600, #0078d4)));
|
|
417
|
+
color: var(--sat-icon-color, #fff);
|
|
418
|
+
box-shadow:
|
|
419
|
+
0 2px 6px rgba(0, 0, 0, 0.18),
|
|
420
|
+
0 8px 16px rgba(0, 0, 0, 0.16);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
:host([mode="inline"]) .sat pds-icon {
|
|
424
|
+
color: var(--sat-icon-color, #fff);
|
|
425
|
+
filter: none;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
:host([open]) .sat {
|
|
429
|
+
transform: translate(var(--tx, 0), var(--ty, 0)) scale(1);
|
|
430
|
+
opacity: 1;
|
|
431
|
+
pointer-events: auto;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.sat:hover,
|
|
435
|
+
.sat:focus-visible {
|
|
436
|
+
transform: translate(var(--tx, 0), var(--ty, 0)) scale(1.1);
|
|
437
|
+
outline: 2px solid var(--color-accent-400, #0078d4);
|
|
438
|
+
outline-offset: 2px;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.sat pds-icon,
|
|
442
|
+
.sat ::slotted(pds-icon) {
|
|
443
|
+
display: block;
|
|
444
|
+
margin: 0;
|
|
445
|
+
transform: translate(var(--sat-icon-offset-x, 0px), var(--sat-icon-offset-y, 0px));
|
|
446
|
+
pointer-events: none;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.sat > slot {
|
|
450
|
+
position: absolute;
|
|
451
|
+
inset: 0;
|
|
452
|
+
display: grid;
|
|
453
|
+
place-items: center;
|
|
454
|
+
inline-size: 100%;
|
|
455
|
+
block-size: 100%;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
:host([mode="inline"]) .sat[data-key="like"] {
|
|
459
|
+
background: var(--sat-bg-color, var(--color-primary-600, #0078d4));
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
:host([mode="inline"]) .sat[data-key="love"] {
|
|
463
|
+
background: var(--sat-bg-color, var(--color-danger-600, #b42318));
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
:host([mode="inline"]) .sat[data-key="interesting"] {
|
|
467
|
+
background: var(--sat-bg-color, var(--color-warning-600, #b54708));
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
:host(:not([mode="inline"])) .fab {
|
|
471
|
+
appearance: none;
|
|
472
|
+
border: none;
|
|
473
|
+
border-radius: 50%;
|
|
474
|
+
inline-size: var(--fab-size);
|
|
475
|
+
block-size: var(--fab-size);
|
|
476
|
+
background: var(--fab-bg);
|
|
477
|
+
color: var(--fab-fg);
|
|
478
|
+
box-shadow:
|
|
479
|
+
0 2px 8px rgba(0, 0, 0, 0.15),
|
|
480
|
+
0 8px 24px rgba(0, 0, 0, 0.25);
|
|
481
|
+
display: grid;
|
|
482
|
+
place-items: center;
|
|
483
|
+
cursor: pointer;
|
|
484
|
+
position: relative;
|
|
485
|
+
z-index: 2;
|
|
486
|
+
transition: transform 0.2s ease, box-shadow 0.3s ease;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
:host(:not([mode="inline"])) .fab:hover {
|
|
490
|
+
transform: scale(1.05);
|
|
491
|
+
box-shadow:
|
|
492
|
+
0 4px 12px rgba(0, 0, 0, 0.2),
|
|
493
|
+
0 12px 32px rgba(0, 0, 0, 0.3);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
:host(:not([mode="inline"])) .fab:active {
|
|
497
|
+
transform: scale(0.98);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
:host(:not([mode="inline"])[open]) .fab {
|
|
501
|
+
box-shadow:
|
|
502
|
+
0 0 0 2px var(--color-accent-400, #0078d4),
|
|
503
|
+
0 4px 16px rgba(0, 120, 212, 0.4);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
`);
|
|
507
|
+
}
|
|
508
|
+
await PDS.adoptLayers(this.shadowRoot, ['primitives', 'components'], [this.#componentStyles]);
|
|
194
509
|
this.#render();
|
|
195
510
|
}
|
|
196
511
|
|
|
197
512
|
disconnectedCallback() {
|
|
198
513
|
document.removeEventListener('click', this.#outsideClickBound, true);
|
|
514
|
+
if (this.#hoverMoveTracker) {
|
|
515
|
+
document.removeEventListener('pointermove', this.#hoverMoveTracker);
|
|
516
|
+
this.#hoverMoveTracker = null;
|
|
517
|
+
}
|
|
199
518
|
}
|
|
200
519
|
|
|
201
520
|
/**
|
|
@@ -253,24 +572,44 @@ export class PdsFab extends HTMLElement {
|
|
|
253
572
|
const isBottom = rect.bottom > viewportHeight / 2;
|
|
254
573
|
|
|
255
574
|
// Calculate optimal angle based on corner:
|
|
256
|
-
// - Bottom-right (default): 180
|
|
257
|
-
// - Bottom-left: 315
|
|
258
|
-
// - Top-right: 225
|
|
259
|
-
// - Top-left: 45
|
|
575
|
+
// - Bottom-right (default): 180-� (fly left/up)
|
|
576
|
+
// - Bottom-left: 315-� or -45-� (fly right/up)
|
|
577
|
+
// - Top-right: 225-� (fly left/down)
|
|
578
|
+
// - Top-left: 45-� (fly right/down)
|
|
260
579
|
|
|
261
580
|
if (isBottom && isRight) {
|
|
262
|
-
return 180; // Bottom-right
|
|
581
|
+
return 180; // Bottom-right ��� fly left
|
|
263
582
|
} else if (isBottom && !isRight) {
|
|
264
|
-
return 315; // Bottom-left
|
|
583
|
+
return 315; // Bottom-left ��� fly up-right
|
|
265
584
|
} else if (!isBottom && isRight) {
|
|
266
|
-
return 225; // Top-right
|
|
585
|
+
return 225; // Top-right ��� fly left-down
|
|
267
586
|
} else {
|
|
268
|
-
return 45; // Top-left
|
|
587
|
+
return 45; // Top-left ��� fly right-down
|
|
269
588
|
}
|
|
270
589
|
}
|
|
271
590
|
|
|
272
591
|
#render() {
|
|
592
|
+
if (this.#hoverMoveTracker) {
|
|
593
|
+
document.removeEventListener('pointermove', this.#hoverMoveTracker);
|
|
594
|
+
this.#hoverMoveTracker = null;
|
|
595
|
+
}
|
|
596
|
+
|
|
273
597
|
const count = this.satellites.length;
|
|
598
|
+
const isInDrawer = Boolean(this.closest('pds-drawer'));
|
|
599
|
+
const isInlineMode = this.#mode === 'inline';
|
|
600
|
+
const isIconOnlyFab = this.#fabClass.split(/\s+/).includes('icon-only');
|
|
601
|
+
const hostPosition = isInlineMode ? 'relative' : 'fixed';
|
|
602
|
+
const hostInset = isInlineMode ? 'auto' : 'auto 20px 20px auto';
|
|
603
|
+
const hostZIndex = isInDrawer
|
|
604
|
+
? 'var(--z-fab-in-drawer, var(--z-popover, 1060))'
|
|
605
|
+
: 'var(--z-notification, 1000)';
|
|
606
|
+
|
|
607
|
+
this.style.setProperty('--fab-host-z-index', hostZIndex);
|
|
608
|
+
|
|
609
|
+
const forwardedClasses = this.#fabClass
|
|
610
|
+
.split(/\s+/)
|
|
611
|
+
.filter(Boolean)
|
|
612
|
+
.join(' ');
|
|
274
613
|
|
|
275
614
|
// Auto-adjust spread and radius if not explicitly set by user
|
|
276
615
|
const hasCustomRadius = this.#hasCustomRadius;
|
|
@@ -291,6 +630,11 @@ export class PdsFab extends HTMLElement {
|
|
|
291
630
|
if (!hasCustomSpread) activeSpread = optimal.spread;
|
|
292
631
|
}
|
|
293
632
|
|
|
633
|
+
// Keep inline icon-only FAB satellites tighter to the trigger button.
|
|
634
|
+
if (isInlineMode && isIconOnlyFab && !hasCustomRadius) {
|
|
635
|
+
activeRadius = Math.min(activeRadius, 56);
|
|
636
|
+
}
|
|
637
|
+
|
|
294
638
|
// Calculate positions along an arc
|
|
295
639
|
const step = count > 1 ? activeSpread / (count - 1) : 0;
|
|
296
640
|
const baseAngle = hasCustomStartAngle || typeof activeStartAngle === 'number'
|
|
@@ -300,131 +644,9 @@ export class PdsFab extends HTMLElement {
|
|
|
300
644
|
? baseAngle
|
|
301
645
|
: baseAngle - (activeSpread / 2);
|
|
302
646
|
|
|
303
|
-
this.
|
|
304
|
-
<style>
|
|
305
|
-
:host {
|
|
306
|
-
--sat-size: 48px;
|
|
307
|
-
--fab-size: 64px;
|
|
308
|
-
--fab-bg: var(--color-primary-600, #0078d4);
|
|
309
|
-
--fab-fg: white;
|
|
310
|
-
--sat-bg: var(--color-surface-elevated, #2a2a2a);
|
|
311
|
-
--sat-fg: var(--color-text-primary, #fff);
|
|
312
|
-
--radius: ${activeRadius}px;
|
|
313
|
-
--transition-duration: 420ms;
|
|
314
|
-
|
|
315
|
-
position: fixed;
|
|
316
|
-
inset: auto 20px 20px auto;
|
|
317
|
-
z-index: var(--z-notification, 1000);
|
|
318
|
-
display: inline-block;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
.wrap {
|
|
322
|
-
position: relative;
|
|
323
|
-
width: var(--fab-size);
|
|
324
|
-
height: var(--fab-size);
|
|
325
|
-
}
|
|
647
|
+
this.style.setProperty('--radius', `${activeRadius}px`);
|
|
326
648
|
|
|
327
|
-
|
|
328
|
-
.fab {
|
|
329
|
-
appearance: none;
|
|
330
|
-
border: none;
|
|
331
|
-
border-radius: 50%;
|
|
332
|
-
inline-size: var(--fab-size);
|
|
333
|
-
block-size: var(--fab-size);
|
|
334
|
-
background: var(--fab-bg);
|
|
335
|
-
color: var(--fab-fg);
|
|
336
|
-
box-shadow:
|
|
337
|
-
0 2px 8px rgba(0, 0, 0, 0.15),
|
|
338
|
-
0 8px 24px rgba(0, 0, 0, 0.25);
|
|
339
|
-
display: grid;
|
|
340
|
-
place-items: center;
|
|
341
|
-
cursor: pointer;
|
|
342
|
-
transition: transform 0.2s ease, box-shadow 0.3s ease;
|
|
343
|
-
position: relative;
|
|
344
|
-
z-index: 2;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.fab:hover {
|
|
348
|
-
transform: scale(1.05);
|
|
349
|
-
box-shadow:
|
|
350
|
-
0 4px 12px rgba(0, 0, 0, 0.2),
|
|
351
|
-
0 12px 32px rgba(0, 0, 0, 0.3);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
.fab:active {
|
|
355
|
-
transform: scale(0.98);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
:host([open]) .fab {
|
|
359
|
-
box-shadow:
|
|
360
|
-
0 0 0 2px var(--color-accent-400, #0078d4),
|
|
361
|
-
0 4px 16px rgba(0, 120, 212, 0.4);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
/* Rotate plus icon 45deg when open to look like X */
|
|
365
|
-
.fab ::slotted(pds-icon) {
|
|
366
|
-
display: inline-block;
|
|
367
|
-
transition: transform 0.2s ease;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
:host([open]) .fab.has-satellites.has-plus ::slotted(pds-icon) {
|
|
371
|
-
transform: rotate(45deg);
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
/* SATELLITES */
|
|
375
|
-
.sat {
|
|
376
|
-
position: absolute;
|
|
377
|
-
top: calc((var(--fab-size) - var(--sat-size)) / 2);
|
|
378
|
-
left: calc((var(--fab-size) - var(--sat-size)) / 2);
|
|
379
|
-
inline-size: var(--sat-size);
|
|
380
|
-
block-size: var(--sat-size);
|
|
381
|
-
border-radius: 50%;
|
|
382
|
-
background: var(--sat-bg);
|
|
383
|
-
color: var(--sat-fg);
|
|
384
|
-
box-shadow:
|
|
385
|
-
0 2px 6px rgba(0, 0, 0, 0.15),
|
|
386
|
-
0 6px 18px rgba(0, 0, 0, 0.2);
|
|
387
|
-
display: grid;
|
|
388
|
-
place-items: center;
|
|
389
|
-
cursor: pointer;
|
|
390
|
-
border: none;
|
|
391
|
-
appearance: none;
|
|
392
|
-
|
|
393
|
-
transform: translate(0, 0) scale(0.2);
|
|
394
|
-
opacity: 0;
|
|
395
|
-
pointer-events: none;
|
|
396
|
-
|
|
397
|
-
transition:
|
|
398
|
-
transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1.4),
|
|
399
|
-
opacity 420ms ease;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
:host([open]) .sat {
|
|
403
|
-
transform: translate(var(--tx, 0), var(--ty, 0)) scale(1);
|
|
404
|
-
opacity: 1;
|
|
405
|
-
pointer-events: auto;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
.sat:hover,
|
|
410
|
-
.sat:focus-visible {
|
|
411
|
-
transform: translate(var(--tx, 0), var(--ty, 0)) scale(1.1);
|
|
412
|
-
outline: 2px solid var(--color-accent-400, #0078d4);
|
|
413
|
-
outline-offset: 2px;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
.sat pds-icon,
|
|
417
|
-
.sat ::slotted(pds-icon) {
|
|
418
|
-
pointer-events: none;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
/* Fallback text for satellites without icons */
|
|
422
|
-
.sat-text {
|
|
423
|
-
font-size: 1.25rem;
|
|
424
|
-
font-weight: 600;
|
|
425
|
-
user-select: none;
|
|
426
|
-
}
|
|
427
|
-
</style>
|
|
649
|
+
this.shadowRoot.innerHTML = `
|
|
428
650
|
|
|
429
651
|
<div class="wrap" role="group" aria-label="Floating actions">
|
|
430
652
|
${this.satellites.map((sat, i) => {
|
|
@@ -438,14 +660,14 @@ export class PdsFab extends HTMLElement {
|
|
|
438
660
|
<button
|
|
439
661
|
class="sat"
|
|
440
662
|
part="satellite"
|
|
441
|
-
style="--tx: ${tx}px; --ty: ${ty}px; transition-delay: ${delay}ms
|
|
663
|
+
style="--tx: ${tx}px; --ty: ${ty}px; transition-delay: ${delay}ms;${sat.bgColor ? ` --sat-bg-color: ${sat.bgColor};` : ''}${sat.iconColor ? ` --sat-icon-color: ${sat.iconColor};` : ''}"
|
|
442
664
|
data-key="${sat.key}"
|
|
443
665
|
aria-label="${sat.label || sat.key}"
|
|
444
666
|
title="${sat.label || sat.key}"
|
|
445
667
|
>
|
|
446
668
|
<slot name="satellite-${sat.key}">
|
|
447
669
|
${sat.icon
|
|
448
|
-
? `<pds-icon icon="${sat.icon}"></pds-icon>`
|
|
670
|
+
? `<pds-icon icon="${sat.icon}" size="${sat.iconSize || (isInlineMode ? 'md' : 'md')}"${sat.iconColor && !isInlineMode ? ` color="${sat.iconColor}"` : ''}></pds-icon>`
|
|
449
671
|
: `<span class="sat-text">${(sat.label || sat.key).charAt(0).toUpperCase()}</span>`
|
|
450
672
|
}
|
|
451
673
|
</slot>
|
|
@@ -454,7 +676,7 @@ export class PdsFab extends HTMLElement {
|
|
|
454
676
|
}).join('')}
|
|
455
677
|
|
|
456
678
|
<button
|
|
457
|
-
class="fab${count > 0 ? ' has-satellites' : ''}"
|
|
679
|
+
class="fab${count > 0 ? ' has-satellites' : ''}${forwardedClasses ? ' ' + forwardedClasses : ''}"
|
|
458
680
|
part="fab"
|
|
459
681
|
aria-expanded="${this.#open}"
|
|
460
682
|
aria-haspopup="menu"
|
|
@@ -476,6 +698,61 @@ export class PdsFab extends HTMLElement {
|
|
|
476
698
|
|
|
477
699
|
const wrap = this.shadowRoot.querySelector('.wrap');
|
|
478
700
|
wrap?.addEventListener('keydown', (e) => this.#onKey(e));
|
|
701
|
+
|
|
702
|
+
this.#syncFabClasses();
|
|
703
|
+
|
|
704
|
+
if (this.#behavior === 'hover') {
|
|
705
|
+
const stopTracking = () => {
|
|
706
|
+
if (this.#hoverMoveTracker) {
|
|
707
|
+
document.removeEventListener('pointermove', this.#hoverMoveTracker);
|
|
708
|
+
this.#hoverMoveTracker = null;
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
const isPointerSafe = (x, y) => {
|
|
713
|
+
const fabEl = this.shadowRoot?.querySelector('.fab');
|
|
714
|
+
const satEls = Array.from(this.shadowRoot?.querySelectorAll('.sat') ?? []);
|
|
715
|
+
const padding = 40;
|
|
716
|
+
for (const el of [fabEl, ...satEls].filter(Boolean)) {
|
|
717
|
+
const r = el.getBoundingClientRect();
|
|
718
|
+
if (x >= r.left - padding && x <= r.right + padding &&
|
|
719
|
+
y >= r.top - padding && y <= r.bottom + padding) {
|
|
720
|
+
return true;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
return false;
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
const startTracking = () => {
|
|
727
|
+
stopTracking();
|
|
728
|
+
this.#hoverMoveTracker = (e) => {
|
|
729
|
+
if (!isPointerSafe(e.clientX, e.clientY)) {
|
|
730
|
+
stopTracking();
|
|
731
|
+
this.open = false;
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
document.addEventListener('pointermove', this.#hoverMoveTracker, { passive: true });
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
wrap?.addEventListener('mouseenter', () => {
|
|
738
|
+
stopTracking();
|
|
739
|
+
if (count > 0) this.open = true;
|
|
740
|
+
});
|
|
741
|
+
|
|
742
|
+
wrap?.addEventListener('mouseleave', startTracking);
|
|
743
|
+
|
|
744
|
+
wrap?.addEventListener('focusin', () => {
|
|
745
|
+
stopTracking();
|
|
746
|
+
if (count > 0) this.open = true;
|
|
747
|
+
});
|
|
748
|
+
|
|
749
|
+
wrap?.addEventListener('focusout', (e) => {
|
|
750
|
+
if (!wrap.contains(e.relatedTarget)) {
|
|
751
|
+
stopTracking();
|
|
752
|
+
this.open = false;
|
|
753
|
+
}
|
|
754
|
+
});
|
|
755
|
+
}
|
|
479
756
|
|
|
480
757
|
// Handle icon swapping when slot content changes (main FAB slot only)
|
|
481
758
|
const fabSlot = this.shadowRoot.querySelector('.fab slot');
|
|
@@ -484,6 +761,14 @@ export class PdsFab extends HTMLElement {
|
|
|
484
761
|
requestAnimationFrame(() => this.#updateIconState());
|
|
485
762
|
}
|
|
486
763
|
|
|
764
|
+
#syncFabClasses() {
|
|
765
|
+
const fab = this.shadowRoot?.querySelector('.fab');
|
|
766
|
+
if (!fab) return;
|
|
767
|
+
const baseClasses = Array.from(fab.classList).filter((c) => c === 'fab' || c === 'has-satellites' || c === 'has-plus');
|
|
768
|
+
const forwarded = this.#fabClass.split(/\s+/).filter(Boolean);
|
|
769
|
+
fab.className = [...baseClasses, ...forwarded].join(' ');
|
|
770
|
+
}
|
|
771
|
+
|
|
487
772
|
#updateSatelliteTransitionDelays(isOpen) {
|
|
488
773
|
const sats = this.shadowRoot?.querySelectorAll('.sat');
|
|
489
774
|
if (!sats?.length) return;
|
|
@@ -1210,10 +1210,6 @@ fieldset[role="group"].buttons {
|
|
|
1210
1210
|
color: var(--color-text-primary);
|
|
1211
1211
|
}
|
|
1212
1212
|
|
|
1213
|
-
&:has([disabled]) {
|
|
1214
|
-
pointer-events: none;
|
|
1215
|
-
}
|
|
1216
|
-
|
|
1217
1213
|
&:has(input:is([type="radio"], [type="checkbox"]):checked) {
|
|
1218
1214
|
background-color: color-mix(in oklab, var(--color-primary-fill) 8%, transparent);
|
|
1219
1215
|
border-color: var(--color-primary-fill);
|
|
@@ -3215,6 +3211,20 @@ nav[data-dropdown] {
|
|
|
3215
3211
|
/* scrollbar-gutter: stable; */
|
|
3216
3212
|
}
|
|
3217
3213
|
|
|
3214
|
+
/* Disabled primitive (low specificity): usable on any element via [disabled] or aria-disabled. */
|
|
3215
|
+
:where([disabled], [aria-disabled="true"]) {
|
|
3216
|
+
opacity: var(--state-disabled-opacity, 0.7);
|
|
3217
|
+
cursor: not-allowed;
|
|
3218
|
+
pointer-events: none;
|
|
3219
|
+
}
|
|
3220
|
+
|
|
3221
|
+
/* Also dim/disable labels that contain disabled controls. */
|
|
3222
|
+
:where(label:has(:disabled), label:has([disabled])) {
|
|
3223
|
+
opacity: var(--state-disabled-opacity, 0.7);
|
|
3224
|
+
cursor: not-allowed;
|
|
3225
|
+
pointer-events: none;
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3218
3228
|
/* Button primitives */
|
|
3219
3229
|
:where(button) {
|
|
3220
3230
|
all: unset;
|
|
@@ -2908,10 +2908,6 @@ fieldset[role="group"].buttons {
|
|
|
2908
2908
|
color: var(--color-text-primary);
|
|
2909
2909
|
}
|
|
2910
2910
|
|
|
2911
|
-
&:has([disabled]) {
|
|
2912
|
-
pointer-events: none;
|
|
2913
|
-
}
|
|
2914
|
-
|
|
2915
2911
|
&:has(input:is([type="radio"], [type="checkbox"]):checked) {
|
|
2916
2912
|
background-color: color-mix(in oklab, var(--color-primary-fill) 8%, transparent);
|
|
2917
2913
|
border-color: var(--color-primary-fill);
|
|
@@ -5216,6 +5212,20 @@ nav[data-dropdown] {
|
|
|
5216
5212
|
/* scrollbar-gutter: stable; */
|
|
5217
5213
|
}
|
|
5218
5214
|
|
|
5215
|
+
/* Disabled primitive (low specificity): usable on any element via [disabled] or aria-disabled. */
|
|
5216
|
+
:where([disabled], [aria-disabled="true"]) {
|
|
5217
|
+
opacity: var(--state-disabled-opacity, 0.7);
|
|
5218
|
+
cursor: not-allowed;
|
|
5219
|
+
pointer-events: none;
|
|
5220
|
+
}
|
|
5221
|
+
|
|
5222
|
+
/* Also dim/disable labels that contain disabled controls. */
|
|
5223
|
+
:where(label:has(:disabled), label:has([disabled])) {
|
|
5224
|
+
opacity: var(--state-disabled-opacity, 0.7);
|
|
5225
|
+
cursor: not-allowed;
|
|
5226
|
+
pointer-events: none;
|
|
5227
|
+
}
|
|
5228
|
+
|
|
5219
5229
|
/* Button primitives */
|
|
5220
5230
|
:where(button) {
|
|
5221
5231
|
all: unset;
|