@pure-ds/core 0.7.21 → 0.7.23
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/pds.d.ts +2 -2
- package/dist/types/public/assets/js/pds-manager.d.ts +16 -16
- package/dist/types/public/assets/js/pds-manager.d.ts.map +1 -1
- package/dist/types/public/assets/js/pds.d.ts +4 -8
- package/dist/types/public/assets/js/pds.d.ts.map +1 -1
- package/dist/types/public/assets/pds/components/pds-icon.d.ts +12 -0
- package/dist/types/public/assets/pds/components/pds-icon.d.ts.map +1 -1
- package/dist/types/src/js/pds-core/pds-live.d.ts.map +1 -1
- package/dist/types/src/js/pds.d.ts +1 -39
- package/dist/types/src/js/pds.d.ts.map +1 -1
- package/package.json +1 -1
- package/public/assets/js/app.js +4 -4
- package/public/assets/js/pds-manager.js +26 -26
- package/public/assets/js/pds.js +2 -2
- package/public/assets/pds/components/pds-icon.js +77 -26
- package/public/assets/pds/core/pds-manager.js +26 -26
- package/public/assets/pds/core.js +2 -2
- package/src/js/pds-core/pds-live.js +54 -21
- package/src/js/pds.d.ts +2 -2
- package/src/js/pds.js +142 -76
package/dist/types/pds.d.ts
CHANGED
|
@@ -279,14 +279,14 @@ export class PDS extends EventTarget {
|
|
|
279
279
|
* Current configuration after PDS.start() completes - read-only, frozen after initialization.
|
|
280
280
|
* Contains the complete configuration used to initialize PDS, including mode, design, preset, and theme.
|
|
281
281
|
*/
|
|
282
|
-
static readonly currentConfig: any;
|
|
282
|
+
static readonly currentConfig: any | null;
|
|
283
283
|
|
|
284
284
|
/**
|
|
285
285
|
* Compiled design system state - provides structured access to all generated tokens,
|
|
286
286
|
* layers, and metadata. Available in live mode when a generator is active.
|
|
287
287
|
* Returns null if not in live mode or if no generator is present.
|
|
288
288
|
*/
|
|
289
|
-
static readonly compiled
|
|
289
|
+
static readonly compiled: CompiledState | Record<string, any> | null;
|
|
290
290
|
|
|
291
291
|
// Static EventTarget-like facade for default instance
|
|
292
292
|
static addEventListener<K extends keyof PDSEventMap>(type: K, listener: (ev: PDSEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
declare function
|
|
1
|
+
declare function _a(): Promise<void>;
|
|
2
|
+
declare function Ut(t?: {}): {
|
|
3
3
|
source: string;
|
|
4
4
|
type: string;
|
|
5
5
|
confidence: number;
|
|
@@ -25,7 +25,7 @@ declare function it(t?: {}): {
|
|
|
25
25
|
template: any;
|
|
26
26
|
meta: any;
|
|
27
27
|
};
|
|
28
|
-
declare function
|
|
28
|
+
declare function _(t?: {}): {
|
|
29
29
|
source: string;
|
|
30
30
|
type: string;
|
|
31
31
|
confidence: number;
|
|
@@ -38,23 +38,23 @@ declare function O(t?: {}): {
|
|
|
38
38
|
template: any;
|
|
39
39
|
meta: any;
|
|
40
40
|
};
|
|
41
|
-
declare function
|
|
41
|
+
declare function sa(): {
|
|
42
42
|
directMappings: any;
|
|
43
43
|
ignoredPatterns: any;
|
|
44
44
|
nonPdsClassPatterns: any;
|
|
45
45
|
rulesJsonPath: string;
|
|
46
46
|
};
|
|
47
|
-
declare function
|
|
48
|
-
declare function
|
|
47
|
+
declare function Ba(t: any): Promise<any>;
|
|
48
|
+
declare function La(): {
|
|
49
49
|
id: string;
|
|
50
50
|
name: string;
|
|
51
51
|
}[];
|
|
52
|
-
declare function
|
|
53
|
-
declare function
|
|
54
|
-
declare function
|
|
55
|
-
declare function
|
|
52
|
+
declare function Zn(t: any): boolean;
|
|
53
|
+
declare function ja(t?: {}): Promise<any>;
|
|
54
|
+
declare function Cr(t?: {}): Promise<any>;
|
|
55
|
+
declare function mr(t: any, e?: {}): Promise<any>;
|
|
56
56
|
declare function Ze(t?: {}): Promise<any>;
|
|
57
|
-
declare function
|
|
57
|
+
declare function Ra(t?: {}): Promise<{
|
|
58
58
|
source: string;
|
|
59
59
|
type: string;
|
|
60
60
|
confidence: number;
|
|
@@ -67,7 +67,7 @@ declare function $a(t?: {}): Promise<{
|
|
|
67
67
|
template: any;
|
|
68
68
|
meta: any;
|
|
69
69
|
}>;
|
|
70
|
-
declare function
|
|
70
|
+
declare function Na(t?: {}): Promise<{
|
|
71
71
|
createdAt: number;
|
|
72
72
|
createdAtIso: string;
|
|
73
73
|
sourceType: string;
|
|
@@ -95,7 +95,7 @@ declare function Ea(t?: {}): Promise<{
|
|
|
95
95
|
resultSnapshot: any;
|
|
96
96
|
id: any;
|
|
97
97
|
}>;
|
|
98
|
-
declare function
|
|
98
|
+
declare function Yn(t: any, e: any, { emitReady: r, emitConfigChanged: n, applyResolvedTheme: o, setupSystemListenerIfNeeded: a }: {
|
|
99
99
|
emitReady: any;
|
|
100
100
|
emitConfigChanged: any;
|
|
101
101
|
applyResolvedTheme: any;
|
|
@@ -751,7 +751,7 @@ declare function Dn(t: any, e: any, { emitReady: r, emitConfigChanged: n, applyR
|
|
|
751
751
|
generateSpacingTokens(e: any): {
|
|
752
752
|
0: string;
|
|
753
753
|
};
|
|
754
|
-
"__#private@#
|
|
754
|
+
"__#private@#_"(e: any): {
|
|
755
755
|
none: string;
|
|
756
756
|
xs: string;
|
|
757
757
|
sm: string;
|
|
@@ -760,7 +760,7 @@ declare function Dn(t: any, e: any, { emitReady: r, emitConfigChanged: n, applyR
|
|
|
760
760
|
xl: string;
|
|
761
761
|
full: string;
|
|
762
762
|
};
|
|
763
|
-
"__#private@#
|
|
763
|
+
"__#private@#O"(e: any): {
|
|
764
764
|
hairline: string;
|
|
765
765
|
thin: string;
|
|
766
766
|
medium: string;
|
|
@@ -1481,5 +1481,5 @@ declare function Dn(t: any, e: any, { emitReady: r, emitConfigChanged: n, applyR
|
|
|
1481
1481
|
theme: string;
|
|
1482
1482
|
autoDefiner: {};
|
|
1483
1483
|
}>;
|
|
1484
|
-
export {
|
|
1484
|
+
export { _a as clearLiveImportHistory, Ut as convertBrandGuidelinesToPatch, it as convertTailwindHtmlToPds, _ as createImportResult, sa as describeTailwindConversionRules, Ba as getLiveImportHistoryEntry, La as getLiveImportSources, Zn as isImportResult, ja as listLiveImportHistory, Cr as listLiveTemplates, mr as loadGoogleFont, Ze as loadLiveTemplateCatalog, Ra as runLiveImport, Na as saveLiveImportHistory, Yn as startLive };
|
|
1485
1485
|
//# sourceMappingURL=pds-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-manager.d.ts","sourceRoot":"","sources":["../../../../../public/assets/js/pds-manager.js"],"names":[],"mappings":"AAmiHg2b,qCAAwH;AAAjsO;;;;;;;;;;;;EAAwsB;AAA9kC;;;;;;;;;;;;EAAsY;
|
|
1
|
+
{"version":3,"file":"pds-manager.d.ts","sourceRoot":"","sources":["../../../../../public/assets/js/pds-manager.js"],"names":[],"mappings":"AAmiHg2b,qCAAwH;AAAjsO;;;;;;;;;;;;EAAwsB;AAA9kC;;;;;;;;;;;;EAAsY;AAf1jJ;;;;;;;;;;;;EAAkW;AAcl1D;;;;;EAAoO;AACmtZ,0CAA4L;AAAvtJ;;;IAAoS;AAf92N,qCAA4H;AAeqtV,0CAAoR;AAf73R,0CAAkK;AAtEvoH,kDAAq8B;AAsEw8E,0CAAwF;AAesoJ;;;;;;;;;;;;GAAi5D;AAA07D;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAwJ;AAnBjna;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAIqqD"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
declare var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
declare function at(e: any): void;
|
|
7
|
-
declare function it(e: any): void;
|
|
8
|
-
export { o as PDS, at as applyResolvedTheme, it as setupSystemListenerIfNeeded };
|
|
1
|
+
declare var s: any;
|
|
2
|
+
declare function pt(e: any): void;
|
|
3
|
+
declare function ft(e: any): void;
|
|
4
|
+
export { s as PDS, pt as applyResolvedTheme, ft as setupSystemListenerIfNeeded };
|
|
9
5
|
//# sourceMappingURL=pds.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds.d.ts","sourceRoot":"","sources":["../../../../../public/assets/js/pds.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pds.d.ts","sourceRoot":"","sources":["../../../../../public/assets/js/pds.js"],"names":[],"mappings":"AACuzC,mBAAsD;AAAk5H,kCAAiX;AAAA,kCAAupB"}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
export class SvgIcon extends HTMLElement {
|
|
22
22
|
static observedAttributes: string[];
|
|
23
|
+
static "__#private@#configListenersAttached": boolean;
|
|
23
24
|
static "__#private@#fallbackIcons": {
|
|
24
25
|
x: string;
|
|
25
26
|
house: string;
|
|
@@ -45,6 +46,17 @@ export class SvgIcon extends HTMLElement {
|
|
|
45
46
|
* @returns {string} The base path for external SVG icons
|
|
46
47
|
*/
|
|
47
48
|
private static getExternalIconPath;
|
|
49
|
+
/**
|
|
50
|
+
* Returns true when externalPath is explicitly present in runtime config.
|
|
51
|
+
* @private
|
|
52
|
+
* @returns {boolean}
|
|
53
|
+
*/
|
|
54
|
+
private static hasConfiguredExternalIconPath;
|
|
55
|
+
/**
|
|
56
|
+
* Ensures one-time config lifecycle listeners so icons re-render when config becomes available.
|
|
57
|
+
* @private
|
|
58
|
+
*/
|
|
59
|
+
private static ensureConfigListeners;
|
|
48
60
|
/**
|
|
49
61
|
* Normalize the external icon path to make cache keys and URL joining stable.
|
|
50
62
|
* @private
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-icon.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-icon.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;IACE,oCAAkF;
|
|
1
|
+
{"version":3,"file":"pds-icon.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-icon.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;IACE,oCAAkF;IAClF,sDAAwC;IAGxC;;;;;;;;;;MAkBE;IAEF,qCAAkC;IAClC,oCAAiC;IAGjC,wCAAqC;IAErC,2CAAwC;IAExC,yCAA2C;IAE3C,2BAA6B;IAE7B,4CAA8B;IAO9B,oDA4CC;IA0dD;;;;OAIG;IACH,mCAWC;IAED;;;;OAIG;IACH,6CAOC;IAED;;;OAGG;IACH,qCAYC;IAED;;;;;OAKG;IACH,yCAOC;IAED;;;;;;OAMG;IACH,uCAEC;IAED;;;;;;OAMG;IACH,kCAUC;IAED;;;;OAIG;IACH,qCAOC;IAED;;;;OAIG;IACH,mCAHW,MAAM,kBACJ,OAAO,CAAC,OAAO,CAAC,CAgH5B;IAED,wDA8EC;IACD,+BAMC;IA5wBC,kBAAwB;IACxB,kBAAwB;IACxB,mBAAsB;IACtB,iBAAuB;IACvB,wBAA2B;IAC3B,kBAAoB;IACpB,mBAAqB;IACrB,mBAAqB;IACrB,yBAA2B;IAC3B,yBAA2B;IAG7B,0BAIC;IAED,6BAGC;IAED,wEAmBC;IAED,eAqQC;IA0JD;;;;;OAKG;IACH,0BAFa,OAAO,CAInB;;CA0TF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-live.d.ts","sourceRoot":"","sources":["../../../../../src/js/pds-core/pds-live.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pds-live.d.ts","sourceRoot":"","sources":["../../../../../src/js/pds-core/pds-live.js"],"names":[],"mappings":"AA23BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiSC;0BAxpCyB,oBAAoB"}
|
|
@@ -42,43 +42,5 @@ export type PDSAPI = {
|
|
|
42
42
|
*/
|
|
43
43
|
createStylesheet: (css: string) => CSSStyleSheet;
|
|
44
44
|
};
|
|
45
|
-
|
|
46
|
-
export const PDS: PDSAPI & PDSBase;
|
|
47
|
-
/**
|
|
48
|
-
* Public PDS runtime object exported to consumers.
|
|
49
|
-
*
|
|
50
|
-
* This object exposes the core runtime building blocks for the Pure Design System.
|
|
51
|
-
* It intentionally provides a small, stable surface area so consuming apps can:
|
|
52
|
-
* - programmatically generate design system artifacts (via `getGenerator()` in live mode),
|
|
53
|
-
* - adopt styles into Shadow DOM (via `adoptLayers` / `adoptPrimitives`),
|
|
54
|
-
* - query runtime mode and obtain constructable stylesheets (via `registry`).
|
|
55
|
-
*
|
|
56
|
-
* Common events in the PDS ecosystem (emitted by other packages/components):
|
|
57
|
-
* - `design-updated` — emitted by the designer component when the in-memory design changes (detail: { config }).
|
|
58
|
-
* - `pds-generated` — emitted by the PDS configurator when generation completes (detail: { modules, meta }).
|
|
59
|
-
* - `pds-error` — emitted by the PDS configurator when generation fails (detail: Error).
|
|
60
|
-
*
|
|
61
|
-
* Error handling notes:
|
|
62
|
-
* - Methods that perform dynamic imports (e.g. `adoptLayers` via the registry) may log and return fallbacks
|
|
63
|
-
* rather than throwing; consumers should check return values (e.g. null) and listen for `pds-error` in UI flows.
|
|
64
|
-
* - `createStylesheet(css)` will throw synchronously if the provided CSS cannot be parsed by the browser's
|
|
65
|
-
* `CSSStyleSheet.replaceSync()` — callers should guard invalid input or wrap calls in try/catch.
|
|
66
|
-
*
|
|
67
|
-
* @typedef {Object} PDSAPI
|
|
68
|
-
* @property {import("./pds-core/pds-registry.js").PDSRegistry} registry - Singleton runtime registry for live/static mode
|
|
69
|
-
* @property {(generator?: import("./pds-core/pds-generator.js").Generator) => void} applyStyles - Apply generated styles to the document (live-only)
|
|
70
|
-
* @property {(shadowRoot: ShadowRoot, layers?: string[], additionalSheets?: CSSStyleSheet[]) => Promise<void>} adoptLayers - Adopt multiple layers into a ShadowRoot. May log errors and fallback to additionalSheets when static imports fail.
|
|
71
|
-
* @property {(shadowRoot: ShadowRoot, additionalSheets?: CSSStyleSheet[]) => Promise<void>} adoptPrimitives - Adopt primitives layer into a ShadowRoot. Designed as a convenience for components.
|
|
72
|
-
* @property {(css:string) => CSSStyleSheet} createStylesheet - Create a constructable stylesheet from CSS text. @throws {DOMException} on invalid CSS in some browsers.
|
|
73
|
-
* @property {() => boolean} isLiveMode - Returns true when running in live/designer-backed mode
|
|
74
|
-
* @property {() => Promise<typeof import("./pds-core/pds-generator.js").Generator>} getGenerator - Live-only accessor for the Generator class
|
|
75
|
-
*/
|
|
76
|
-
/**
|
|
77
|
-
* Workspace for the Pure Design System runtime API
|
|
78
|
-
* PDS is now an EventTarget so consumers can subscribe to a single, consistent
|
|
79
|
-
* event bus instead of listening on window/document or individual elements.
|
|
80
|
-
*/
|
|
81
|
-
declare class PDSBase extends EventTarget {
|
|
82
|
-
}
|
|
83
|
-
export {};
|
|
45
|
+
export const PDS: any;
|
|
84
46
|
//# sourceMappingURL=pds.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds.d.ts","sourceRoot":"","sources":["../../../../src/js/pds.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pds.d.ts","sourceRoot":"","sources":["../../../../src/js/pds.js"],"names":[],"mappings":"AAkaA,mDAsBC;AAGD,4DAuCC;;;;;;;;;;;;;;;;;;;;;;;;;cA3ca,OAAO,4BAA4B,EAAE,WAAW;;;;iBAChD,CAAC,SAAS,CAAC,EAAE,OAAO,6BAA6B,EAAE,SAAS,KAAK,IAAI;;;;iBACrE,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,gBAAgB,CAAC,EAAE,aAAa,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC;;;;qBAChG,CAAC,UAAU,EAAE,UAAU,EAAE,gBAAgB,CAAC,EAAE,aAAa,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC;;;;sBAC7E,CAAC,GAAG,EAAC,MAAM,KAAK,aAAa;;AAe3C,sBAGoB"}
|
package/package.json
CHANGED
package/public/assets/js/app.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var Pe=Object.defineProperty;var Me=(e,t)=>{for(var s in t)Pe(e,s,{get:t[s],enumerable:!0})};var X=class{constructor(){this._mode="static",this._staticPaths={tokens:"/assets/pds/styles/pds-tokens.css.js",primitives:"/assets/pds/styles/pds-primitives.css.js",components:"/assets/pds/styles/pds-components.css.js",utilities:"/assets/pds/styles/pds-utilities.css.js",styles:"/assets/pds/styles/pds-styles.css.js"}}setLiveMode(){this._mode="live"}setStaticMode(t={}){this._mode="static",this._staticPaths={...this._staticPaths,...t}}async getStylesheet(t){if(this._mode==="live")return null;try{return(await import(this._staticPaths[t]))[t]}catch(s){console.error(`[PDS Registry] Failed to load static ${t}:`,s),console.error(`[PDS Registry] Looking for: ${this._staticPaths[t]}`),console.error("[PDS Registry] Make sure you've run 'npm run pds:build' and configured PDS.start() with the correct static.root path");let n=new CSSStyleSheet;return n.replaceSync("/* Failed to load "+t+" */"),n}}get mode(){return this._mode}get isLive(){return this._mode==="live"}},P=new X;async function pe(e,t=[],s=null){try{let n=s?.primitivesStylesheet?s.primitivesStylesheet:await P.getStylesheet("primitives");e.adoptedStyleSheets=[n,...t]}catch(n){let c=e.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${c}> failed to adopt primitives:`,n),e.adoptedStyleSheets=t}}async function ue(e,t=["primitives"],s=[],n=null){let c=Array.isArray(s)?s.filter(Boolean):[];if(c.length){let d=(Array.isArray(e.adoptedStyleSheets)?e.adoptedStyleSheets:[]).filter(b=>!c.includes(b));e.adoptedStyleSheets=[...d,...c]}try{let d=(await Promise.all(t.map(async b=>{if(n)switch(b){case"tokens":return n.tokensStylesheet;case"primitives":return n.primitivesStylesheet;case"components":return n.componentsStylesheet;case"utilities":return n.utilitiesStylesheet;default:break}return P.getStylesheet(b)}))).filter(b=>b!==null);e.adoptedStyleSheets=[...d,...c]}catch(r){let d=e.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${d}> failed to adopt layers:`,r),e.adoptedStyleSheets=c}}function me(e){let t=new CSSStyleSheet;return t.replaceSync(e),t}var fe={FontWeights:{light:300,normal:400,medium:500,semibold:600,bold:700},LineHeights:{tight:1.25,normal:1.5,relaxed:1.75},BorderWidths:{hairline:.5,thin:1,medium:2,thick:3},RadiusSizes:{none:0,small:4,medium:8,large:16,xlarge:24,xxlarge:32},ShadowDepths:{none:"none",light:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",medium:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",deep:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",extreme:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},TransitionSpeeds:{fast:150,normal:250,slow:350},AnimationEasings:{linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},TouchTargetSizes:{compact:36,standard:44,comfortable:48,spacious:56},LinkStyles:{inline:"inline",block:"block",button:"button"},FocusStyles:{ring:"ring",outline:"outline",border:"border",glow:"glow"},TabSizes:{compact:2,standard:4,wide:8},SelectIcons:{chevron:"chevron",arrow:"arrow",caret:"caret",none:"none"},IconSizes:{xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64,"3xl":96}};var Z={};Me(Z,{deepMerge:()=>he,fragmentFromTemplateLike:()=>Te,isObject:()=>O,parseHTML:()=>Y});function O(e){return e&&typeof e=="object"&&!Array.isArray(e)}function he(e,t){let s={...e};return O(e)&&O(t)&&Object.keys(t).forEach(n=>{O(t[n])?n in e?s[n]=he(e[n],t[n]):Object.assign(s,{[n]:t[n]}):Object.assign(s,{[n]:t[n]})}),s}function Te(e){let t=Array.isArray(e?.strings)?e.strings:[],s=Array.isArray(e?.values)?e.values:[],n=new Set,c=[],r=/(\s)(\.[\w-]+)=\s*$/;for(let i=0;i<t.length;i+=1){let g=t[i]??"",f=g.match(r);if(f&&i<s.length){let w=f[2].slice(1),v=`pds-val-${i}`;g=g.replace(r,`$1data-pds-prop="${w}:${v}"`),n.add(i)}c.push(g),i<s.length&&!n.has(i)&&c.push(`<!--pds-val-${i}-->`)}let d=document.createElement("template");d.innerHTML=c.join("");let b=(i,g)=>{let f=i.parentNode;if(!f)return;if(g==null){f.removeChild(i);return}let S=w=>{if(w!=null){if(w instanceof Node){f.insertBefore(w,i);return}if(Array.isArray(w)){w.forEach(v=>S(v));return}f.insertBefore(document.createTextNode(String(w)),i)}};S(g),f.removeChild(i)},E=document.createTreeWalker(d.content,NodeFilter.SHOW_COMMENT),h=[];for(;E.nextNode();){let i=E.currentNode;i?.nodeValue?.startsWith("pds-val-")&&h.push(i)}return h.forEach(i=>{let g=Number(i.nodeValue.replace("pds-val-",""));b(i,s[g])}),d.content.querySelectorAll("*").forEach(i=>{let g=i.getAttribute("data-pds-prop");if(!g)return;let[f,S]=g.split(":"),w=Number(String(S).replace("pds-val-",""));f&&Number.isInteger(w)&&(i[f]=s[w]),i.removeAttribute("data-pds-prop")}),d.content}function Y(e){return new DOMParser().parseFromString(e,"text/html").body.childNodes}var be="pds",Ue=/^([a-z][a-z0-9+\-.]*:)?\/\//i,ye=/^[a-z]:/i;function U(e=""){return e.endsWith("/")?e:`${e}/`}function Ce(e="",t=be){let s=e.replace(/\/+$/,"");return new RegExp(`(?:^|/)${t}$`,"i").test(s)?s:`${s}/${t}`}function $e(e){return e.replace(/^\.\/+/,"")}function Ie(e){return ye.test(e)?e.replace(ye,"").replace(/^\/+/,""):e}function Ne(e){return e.startsWith("public/")?e.substring(7):e}function z(e,t={}){let s=t.segment||be,n=t.defaultRoot||`/assets/${s}/`,c=e?.public&&e.public?.root||e?.static&&e.static?.root||null;if(!c||typeof c!="string")return U(n);let r=c.trim();return r?(r=r.replace(/\\/g,"/"),r=Ce(r,s),r=U(r),Ue.test(r)?r:(r=$e(r),r=Ie(r),r.startsWith("/")||(r=Ne(r),r.startsWith("/")||(r=`/${r}`),r=r.replace(/\/+/g,(d,b)=>b===0?d:"/")),U(r))):U(n)}async function Oe(...e){let t={};e.length&&typeof e[e.length-1]=="object"&&(t=e.pop()||{});let s=e,{baseURL:n,mapper:c=h=>`${h}.js`,onError:r=(h,a)=>console.error(`[defineWebComponents] ${h}:`,a)}=t,d=n?new URL(n,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),b=h=>h.toLowerCase().replace(/(^|-)([a-z])/g,(a,i,g)=>g.toUpperCase()),E=async h=>{try{if(customElements.get(h))return{tag:h,status:"already-defined"};let a=c(h),g=await import(a instanceof URL?a.href:new URL(a,d).href),f=g?.default??g?.[b(h)];if(!f){if(customElements.get(h))return{tag:h,status:"self-defined"};throw new Error(`No export found for ${h}. Expected default export or named export "${b(h)}".`)}return customElements.get(h)?{tag:h,status:"race-already-defined"}:(customElements.define(h,f),{tag:h,status:"defined"})}catch(a){throw r(h,a),a}};return Promise.all(s.map(E))}var F=class{constructor(t={}){let{baseURL:s,mapper:n,onError:c,predicate:r=()=>!0,attributeModule:d="data-module",root:b=document,scanExisting:E=!0,debounceMs:h=16,observeShadows:a=!0,enhancers:i=[],patchAttachShadow:g=!0}=t,f=new Set,S=new Set,w=new Set,v=new Map,x=new WeakMap,_=new WeakMap,u=0,y=!1,A=null,N=l=>{if(!l||!i.length)return;let m=_.get(l);m||(m=new Set,_.set(l,m));for(let p of i)if(!(!p.selector||!p.run)&&!m.has(p.selector))try{l.matches&&l.matches(p.selector)&&(p.run(l),m.add(p.selector))}catch(L){console.warn(`[AutoDefiner] Error applying enhancer for selector "${p.selector}":`,L)}},T=(l,m)=>{if(!y&&!(!l||!l.includes("-"))&&!customElements.get(l)&&!S.has(l)&&!w.has(l)){if(m&&m.getAttribute){let p=m.getAttribute(d);p&&!v.has(l)&&v.set(l,p)}f.add(l),De()}},De=()=>{u||(u=setTimeout(ce,h))},R=l=>{if(l){if(l.nodeType===1){let m=l,p=m.tagName?.toLowerCase();p&&p.includes("-")&&!customElements.get(p)&&r(p,m)&&T(p,m),N(m),a&&m.shadowRoot&&J(m.shadowRoot)}l.querySelectorAll&&l.querySelectorAll("*").forEach(m=>{let p=m.tagName?.toLowerCase();p&&p.includes("-")&&!customElements.get(p)&&r(p,m)&&T(p,m),N(m),a&&m.shadowRoot&&J(m.shadowRoot)})}},J=l=>{if(!l||x.has(l))return;R(l);let m=new MutationObserver(p=>{for(let L of p)L.addedNodes?.forEach(D=>{R(D)}),L.type==="attributes"&&L.target&&R(L.target)});m.observe(l,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[d,...i.map(p=>p.selector).filter(p=>p.startsWith("data-"))]}),x.set(l,m)};async function ce(){if(clearTimeout(u),u=0,!f.size)return;let l=Array.from(f);f.clear(),l.forEach(m=>S.add(m));try{let m=p=>v.get(p)??(n?n(p):`${p}.js`);await Oe(...l,{baseURL:s,mapper:m,onError:(p,L)=>{w.add(p),c?.(p,L)}})}catch{}finally{l.forEach(m=>S.delete(m))}}let de=b===document?document.documentElement:b,le=new MutationObserver(l=>{for(let m of l)m.addedNodes?.forEach(p=>{R(p)}),m.type==="attributes"&&m.target&&R(m.target)});if(le.observe(de,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[d,...i.map(l=>l.selector).filter(l=>l.startsWith("data-"))]}),a&&g&&Element.prototype.attachShadow){let l=Element.prototype.attachShadow;Element.prototype.attachShadow=function(p){let L=l.call(this,p);if(p&&p.mode==="open"){J(L);let D=this.tagName?.toLowerCase();D&&D.includes("-")&&!customElements.get(D)&&T(D,this)}return L},A=()=>Element.prototype.attachShadow=l}return E&&R(de),{stop(){y=!0,le.disconnect(),A&&A(),u&&(clearTimeout(u),u=0),x.forEach(l=>l.disconnect())},flush:ce}}static async define(...t){let s={};t.length&&typeof t[t.length-1]=="object"&&(s=t.pop()||{});let n=t,{baseURL:c,mapper:r=a=>`${a}.js`,onError:d=(a,i)=>console.error(`[defineWebComponents] ${a}:`,i)}=s,b=c?new URL(c,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),E=a=>a.toLowerCase().replace(/(^|-)([a-z])/g,(i,g,f)=>f.toUpperCase()),h=async a=>{try{if(customElements.get(a))return{tag:a,status:"already-defined"};let i=r(a),f=await import(i instanceof URL?i.href:new URL(i,b).href),S=f?.default??f?.[E(a)];if(!S){if(customElements.get(a))return{tag:a,status:"self-defined"};throw new Error(`No export found for ${a}. Expected default export or named export "${E(a)}".`)}return customElements.get(a)?{tag:a,status:"race-already-defined"}:(customElements.define(a,S),{tag:a,status:"defined"})}catch(i){throw d(a,i),i}};return Promise.all(n.map(h))}};var ze=/^[a-z][a-z0-9+\-.]*:\/\//i,C=(()=>{try{return import.meta.url}catch{return}})(),W=e=>typeof e=="string"&&e.length&&!e.endsWith("/")?`${e}/`:e;function B(e,t={}){if(!e||ze.test(e))return e;let{preferModule:s=!0}=t,n=()=>{if(!C)return null;try{return new URL(e,C).href}catch{return null}},c=()=>{if(typeof window>"u"||!window.location?.origin)return null;try{return new URL(e,window.location.origin).href}catch{return null}};return(s?n()||c():c()||n())||e}var ge=(()=>{if(C)try{let e=new URL(C);if(/\/public\/assets\/js\//.test(e.pathname))return new URL("../pds/",C).href}catch{return}})(),we=!1;function Se(e){we||typeof document>"u"||(we=!0,e.addEventListener("pds:ready",t=>{let s=t.detail?.mode;s&&document.documentElement.classList.add(`pds-${s}`,"pds-ready")}))}function Ee({manageTheme:e,themeStorageKey:t,applyResolvedTheme:s,setupSystemListenerIfNeeded:n}){let c="light",r=null;if(e&&typeof window<"u"){try{r=localStorage.getItem(t)||null}catch{r=null}try{s?.(r),n?.(r)}catch{}r?r==="system"?c=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":c=r:c=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return{resolvedTheme:c,storedTheme:r}}function q(e,{resolvePublicAssetURL:t}){let s=!!(e?.public?.root||e?.static?.root),n=t(e);return!s&&ge&&(n=ge),W(B(n))}async function ve(e,{baseEnhancers:t=[]}={}){let{autoDefineBaseURL:s="/auto-define/",autoDefinePreload:n=[],autoDefineMapper:c=null,enhancers:r=[],autoDefineOverrides:d=null,autoDefinePreferModule:b=!0}=e,E=(()=>{let a=new Map;return(t||[]).forEach(i=>a.set(i.selector,i)),(r||[]).forEach(i=>a.set(i.selector,i)),Array.from(a.values())})(),h=null;if(typeof window<"u"&&typeof document<"u"){let a=F,i=u=>{switch(u){case"pds-tabpanel":return"pds-tabstrip.js";default:return`${u}.js`}},{mapper:g,enhancers:f,...S}=d&&typeof d=="object"?d:{},w=f?Array.isArray(f)?f:typeof f=="object"?Object.values(f):[]:[],v=(()=>{let u=new Map;return(E||[]).forEach(y=>{y?.selector&&u.set(y.selector,y)}),(w||[]).forEach(y=>{if(!y?.selector)return;let A=u.get(y.selector)||null;u.set(y.selector,{...A||{},...y,run:typeof y?.run=="function"?y.run:A?.run})}),Array.from(u.values())})(),_={baseURL:s&&W(B(s,{preferModule:b})),predefine:n,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:v,onError:(u,y)=>{if(typeof u=="string"&&u.startsWith("pds-")){let N=["pds-form","pds-drawer"].includes(u),T=y?.message?.includes("#pds/lit")||y?.message?.includes("Failed to resolve module specifier");N&&T?console.error(`\u274C PDS component <${u}> requires Lit but #pds/lit is not in import map.
|
|
2
|
-
See: https://github.com/Pure-Web-Foundation/pure-ds/blob/main/readme.md#lit-components-not-working`):console.warn(`\u26A0\uFE0F PDS component <${u}> not found. Assets may not be installed.`)}else console.error(`\u274C Auto-define error for <${u}>:`,y)},...S,mapper:u=>{if(customElements.get(u))return null;if(typeof c=="function")try{let y=c(u);return y===void 0?i(u):y}catch(y){return console.warn("Custom autoDefine.mapper error; falling back to default:",y?.message||y),i(u)}return i(u)}};h=new a(_),n.length>0&&typeof a.define=="function"&&await a.define(...n,{baseURL:s,mapper:_.mapper,onError:_.onError})}return{autoDefiner:h,mergedEnhancers:E}}var ee=["light","dark"],te=new Set(ee);function Fe(e){let s=(Array.isArray(e?.themes)?e.themes.map(n=>String(n).toLowerCase()):ee).filter(n=>te.has(n));return s.length?s:ee}function se(e,{preferDocument:t=!0}={}){let s=String(e||"").toLowerCase();if(te.has(s))return s;if(t&&typeof document<"u"){let n=document.documentElement?.getAttribute("data-theme");if(te.has(n))return n}return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Le(e,t){let s=se(t);return Fe(e).includes(s)}var re=class extends EventTarget{},o=new re;o.initializing=!1;o.currentPreset=null;o.debug=!1;var H=null,V=null,K=null,G=null;function Q(e,t){return t&&typeof t=="string"?t:`${q(o.currentConfig||{},{resolvePublicAssetURL:z})}core/${e}`}async function We(){return Array.isArray(o.defaultEnhancers)&&o.defaultEnhancers.length>0?o.defaultEnhancers:(G||(G=import(Q("pds-enhancers.js",o.currentConfig?.enhancersURL)).then(t=>{let s=Array.isArray(t?.defaultPDSEnhancers)?t.defaultPDSEnhancers:[];return o.defaultEnhancers=s,s}).catch(t=>{throw G=null,t})),G)}async function Be(){return typeof o.ask=="function"&&o.ask!==ke?o.ask:(V||(V=import(Q("pds-ask.js",o.currentConfig?.askURL)).then(t=>{let s=t?.ask;if(typeof s!="function")throw new Error("Failed to load ask helper");return o.ask=s,s}).catch(t=>{throw V=null,t})),V)}async function I(){return typeof o.toast=="function"&&o.toast!==M?o.toast:(K||(K=import(Q("pds-toast.js",o.currentConfig?.toastURL)).then(t=>{let s=t?.toast;if(typeof s!="function")throw new Error("Failed to load toast helper");return o.toast=s,s}).catch(t=>{throw K=null,t})),K)}async function ke(...e){return(await Be())(...e)}async function M(...e){return(await I())(...e)}M.success=async(...e)=>(await I()).success(...e);M.error=async(...e)=>(await I()).error(...e);M.warning=async(...e)=>(await I()).warning(...e);M.info=async(...e)=>(await I()).info(...e);var Ae=function(e="log",t,...s){let n=!!(o.registry&&!o.registry.isLive),c=(this?.debug||this?.design?.debug||o.debug||!1)===!0;if(n){if(!o.debug)return}else if(!c&&e!=="error"&&e!=="warn")return;let r=console[e]||console.log;s.length>0?r(t,...s):r(t)};function oe(e){if(e==null)return e;if(typeof e=="function")return;if(typeof e!="object")return e;if(Array.isArray(e))return e.map(s=>oe(s)).filter(s=>s!==void 0);let t={};for(let[s,n]of Object.entries(e)){let c=oe(n);c!==void 0&&(t[s]=c)}return t}async function qe(e,t={}){if(t?.runtimeConfig===!1||typeof fetch!="function")return null;let s=t?.runtimeConfigURL||`${e}pds-runtime-config.json`;try{let n=await fetch(s,{cache:"no-store"});return n.ok?await n.json():null}catch{return null}}o.registry=P;o.enums=fe;o.adoptLayers=ue;o.adoptPrimitives=pe;o.parse=Y;o.createStylesheet=me;o.isLiveMode=()=>P.isLive;o.ask=ke;o.toast=M;o.common=Z;o.AutoComplete=null;o.loadAutoComplete=async()=>{if(o.AutoComplete&&typeof o.AutoComplete.connect=="function")return o.AutoComplete;let e=Q("pds-autocomplete.js",o.currentConfig?.autoCompleteURL);return H||(H=import(e).then(t=>{let s=t?.AutoComplete||t?.default?.AutoComplete||t?.default||null;if(!s)throw new Error("AutoComplete export not found in module");return o.AutoComplete=s,s}).catch(t=>{throw H=null,t})),H};function _e(e){let t=typeof CustomEvent=="function";try{let s=t?new CustomEvent("pds:ready",{detail:e}):new Event("pds:ready");o.dispatchEvent(s)}catch{}if(typeof document<"u")if(t){let s={detail:e,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:ready",s))}catch{}try{document.dispatchEvent(new CustomEvent("pds-ready",s))}catch{}}else{try{document.dispatchEvent(new Event("pds:ready"))}catch{}try{document.dispatchEvent(new Event("pds-ready"))}catch{}}}function xe(e={}){let t=typeof CustomEvent=="function",s={at:Date.now(),...e};try{let n=t?new CustomEvent("pds:config-changed",{detail:s}):new Event("pds:config-changed");o.dispatchEvent(n)}catch{}if(typeof document<"u")if(t){let n={detail:s,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:config-changed",n))}catch{}}else try{document.dispatchEvent(new Event("pds:config-changed"))}catch{}}var ne="pure-ds-theme",j=null,$=null;function ie(e){try{if(typeof document>"u")return;let t="light";e?e==="system"?t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t=e:t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",document.documentElement.setAttribute("data-theme",t)}catch{}}function ae(e){try{if(j&&$){try{typeof j.removeEventListener=="function"?j.removeEventListener("change",$):typeof j.removeListener=="function"&&j.removeListener($)}catch{}j=null,$=null}if(e==="system"&&typeof window<"u"&&window.matchMedia){let t=window.matchMedia("(prefers-color-scheme: dark)"),s=n=>{let c=n?.matches===void 0?t.matches:n.matches;try{let r=c?"dark":"light";document.documentElement.setAttribute("data-theme",r),o.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,source:"system"}}))}catch{}};j=t,$=s,typeof t.addEventListener=="function"?t.addEventListener("change",s):typeof t.addListener=="function"&&t.addListener(s)}}catch{}}Object.defineProperty(o,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(ne)||null}catch{return null}},set(e){try{if(typeof window>"u")return;let t=o.currentConfig?.design||null,s=se(e);if(t&&!Le(t,s)){let n=t?.name||o.currentPreset?.name||o.currentConfig?.preset||"current preset";console.warn(`PDS theme "${s}" not supported by preset "${n}".`),o.dispatchEvent(new CustomEvent("pds:theme:blocked",{detail:{theme:e,resolvedTheme:s,preset:n}}));return}e==null?localStorage.removeItem(ne):localStorage.setItem(ne,e),ie(e),ae(e),o.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:e,source:"api"}}))}catch{}}});o.defaultEnhancers=[];async function He(e){let t=e&&e.mode||"live",{mode:s,...n}=e||{};if(t==="static")return Ve(n);let c=q(n,{resolvePublicAssetURL:z}),r=n?.managerURL||n?.public?.managerURL||n?.manager?.url||new URL("core/pds-manager.js",c).href||new URL("./pds-manager.js",import.meta.url).href,{startLive:d}=await import(r);return d(o,n,{emitReady:_e,emitConfigChanged:xe,applyResolvedTheme:ie,setupSystemListenerIfNeeded:ae})}o.start=He;async function Ve(e){if(!e||typeof e!="object")throw new Error("PDS.start({ mode: 'static', ... }) requires a valid configuration object");let t=e.applyGlobalStyles??!0,s=e.manageTheme??!0,n=e.themeStorageKey??"pure-ds-theme",c=e.staticPaths??{},r=q(e,{resolvePublicAssetURL:z}),d=e&&e.autoDefine||null,b;d&&d.baseURL?b=W(B(d.baseURL,{preferModule:!1})):b=`${r}components/`;let E=d&&Array.isArray(d.predefine)&&d.predefine||[],h=d&&typeof d.mapper=="function"&&d.mapper||null;try{Se(o);let{resolvedTheme:a}=Ee({manageTheme:s,themeStorageKey:n,applyResolvedTheme:ie,setupSystemListenerIfNeeded:ae}),i=await qe(r,e),g=Array.isArray(e?.enhancers)?e.enhancers:e?.enhancers&&typeof e.enhancers=="object"?Object.values(e.enhancers):[],f=i?.config?{...i.config,...e,design:e?.design||i.config.design,preset:e?.preset||i.config.preset}:{...e},S={tokens:`${r}styles/pds-tokens.css.js`,primitives:`${r}styles/pds-primitives.css.js`,components:`${r}styles/pds-components.css.js`,utilities:`${r}styles/pds-utilities.css.js`,styles:`${r}styles/pds-styles.css.js`},w=i?.paths||{};if(c={...S,...w,...c},o.registry.setStaticMode(c),t&&typeof document<"u")try{let u=await o.registry.getStylesheet("styles");if(u){u._pds=!0;let y=(document.adoptedStyleSheets||[]).filter(A=>A._pds!==!0);document.adoptedStyleSheets=[...y,u],xe({mode:"static",source:"static:styles-applied"})}}catch(u){Ae.call(o,"warn","Failed to apply static styles:",u)}let v=null,x=[];try{let u=await We(),y=await ve({autoDefineBaseURL:b,autoDefinePreload:E,autoDefineMapper:h,enhancers:g,autoDefineOverrides:d||null,autoDefinePreferModule:!(d&&d.baseURL)},{baseEnhancers:u});v=y.autoDefiner,x=y.mergedEnhancers||[]}catch(u){Ae.call(o,"error","\u274C Failed to initialize AutoDefiner/Enhancers (static):",u)}let _=oe(e);return o.currentConfig=Object.freeze({mode:"static",...structuredClone(_),design:structuredClone(f.design||{}),preset:f.preset,theme:a,enhancers:x}),_e({mode:"static",config:f,theme:a,autoDefiner:v}),{config:f,theme:a,autoDefiner:v}}catch(a){throw o.dispatchEvent(new CustomEvent("pds:error",{detail:{error:a}})),a}}var je={mode:"live",liveEdit:!0,preset:"default",autoDefine:{predefine:["pds-icon","pds-drawer","pds-toaster"]},log(e,t,...s){console[e](t,...s)}};var k={name:"@pure-ds/core",shortname:"pds",version:"0.7.21",description:"Why develop a Design System when you can generate one?",repository:{type:"git",url:"git+https://github.com/Pure-Web-Foundation/pure-ds.git"},bugs:{url:"https://github.com/Pure-Web-Foundation/pure-ds/issues"},homepage:"https://puredesignsystem.z6.web.core.windows.net/",keywords:["design-system","css","web-components","lit","constructable-stylesheets","tokens","utilities","a11y"],type:"module",main:"./public/assets/pds/core.js",module:"./public/assets/pds/core.js",types:"./dist/types/pds.d.ts",bin:{"pds-build":"packages/pds-cli/bin/pds-static.js","pds-sync-assets":"packages/pds-cli/bin/sync-assets.js","pds-build-icons":"packages/pds-cli/bin/pds-build-icons.js","pds-import":"packages/pds-cli/bin/pds-import.js","pds-setup-copilot":"packages/pds-cli/bin/pds-setup-copilot.js","pds-setup-mcp":"packages/pds-cli/bin/pds-setup-mcp.js","pds-init-config":"packages/pds-cli/bin/pds-init-config.js","pds-bootstrap":"packages/pds-cli/bin/pds-bootstrap.js","pds-mcp-server":"packages/pds-cli/bin/pds-mcp-server.js","pds-mcp-health":"packages/pds-cli/bin/pds-mcp-health.js","pds-mcp-eval":"packages/pds-cli/bin/pds-mcp-eval.js"},exports:{".":{types:"./src/js/pds.d.ts",import:"./public/assets/pds/core.js"},"./pds-core":"./src/js/pds.js","./auto-define/*":"./public/auto-define/*"},files:[".github/copilot-instructions.md",".cursorrules","dist/types/","public/assets/js/","public/assets/pds/components/","public/assets/pds/templates/","public/assets/pds/core.js","public/assets/pds/core/","public/assets/pds/external/","public/assets/pds/vscode-custom-data.json","public/assets/pds/pds.css-data.json","public/assets/pds/pds-css-complete.json","public/auto-define/","public/pds/components/","public/assets/pds/icons/pds-icons.svg","packages/pds-cli/bin/","packages/pds-cli/lib/","src/js/pds.d.ts","src/js/pds.js","src/js/pds-live-manager/","src/js/pds-core/","custom-elements.json","custom-elements-manifest.config.js","pds.html-data.json","pds.css-data.json","readme.md","INTELLISENSE.md","CSS-INTELLISENSE-LIMITATION.md","CSS-INTELLISENSE-QUICK-REF.md"],scripts:{test:'echo "Error: no test specified" && exit 1',dev:"node esbuild-dev.js",prebuild:"npm run types",build:"node esbuild-build.js",types:"tsc -p tsconfig.json && node scripts/sync-types.mjs",postinstall:"node packages/pds-cli/bin/postinstall.mjs","prepds:build":"npm run types","pds:build":"node packages/pds-cli/bin/pds-static.js","pds:build-icons":"node packages/pds-cli/bin/pds-build-icons.js","pds:bootstrap":"node packages/pds-cli/bin/pds-bootstrap.js","pds:manifest":"node packages/pds-cli/bin/generate-manifest.js","pds:css-data":"node packages/pds-cli/bin/generate-css-data.js","pds:import":"node packages/pds-cli/bin/pds-import.js","pds:dx":"node packages/pds-cli/bin/pds-dx.js","pds:mcp:server":"node packages/pds-cli/bin/pds-mcp-server.js","pds:mcp:health":"node packages/pds-cli/bin/pds-mcp-health.js","pds:mcp:eval":"node packages/pds-cli/bin/pds-mcp-eval.js","storybook:generate":"cd packages/pds-storybook && npm run generate-stories","storybook:dev":"cd packages/pds-storybook && npm run storybook:dev","storybook:build":"cd packages/pds-storybook && npm run storybook:build"},author:"Marc van Neerven",license:"ISC",engines:{node:">=18"},publishConfig:{access:"public"},devDependencies:{"@custom-elements-manifest/analyzer":"^0.9.9",esbuild:"^0.19.0","fs-extra":"^11.1.1",typescript:"^5.6.3","@types/node":"^22.10.2"},dependencies:{lit:"^3.3.1","pure-web":"1.1.32"},customElements:"custom-elements.json"};await o.start(je);var Re=typeof k.repository=="string"?k.repository:k.repository?.url,Ge=Re?Re.replace(/^git\+/,"").replace(/\.git$/,""):"",bt=k.homepage||Ge,gt=k.bugs?.url||"";document.body.innerHTML=`
|
|
1
|
+
var $e=Object.defineProperty;var Ie=(e,t)=>{for(var s in t)$e(e,s,{get:t[s],enumerable:!0})};var J=class{constructor(){this._mode="static",this._staticPaths={tokens:"/assets/pds/styles/pds-tokens.css.js",primitives:"/assets/pds/styles/pds-primitives.css.js",components:"/assets/pds/styles/pds-components.css.js",utilities:"/assets/pds/styles/pds-utilities.css.js",styles:"/assets/pds/styles/pds-styles.css.js"}}setLiveMode(){this._mode="live"}setStaticMode(t={}){this._mode="static",this._staticPaths={...this._staticPaths,...t}}async getStylesheet(t){if(this._mode==="live")return null;try{return(await import(this._staticPaths[t]))[t]}catch(s){console.error(`[PDS Registry] Failed to load static ${t}:`,s),console.error(`[PDS Registry] Looking for: ${this._staticPaths[t]}`),console.error("[PDS Registry] Make sure you've run 'npm run pds:build' and configured PDS.start() with the correct static.root path");let n=new CSSStyleSheet;return n.replaceSync("/* Failed to load "+t+" */"),n}}get mode(){return this._mode}get isLive(){return this._mode==="live"}},P=new J;async function me(e,t=[],s=null){try{let n=s?.primitivesStylesheet?s.primitivesStylesheet:await P.getStylesheet("primitives");e.adoptedStyleSheets=[n,...t]}catch(n){let a=e.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${a}> failed to adopt primitives:`,n),e.adoptedStyleSheets=t}}async function he(e,t=["primitives"],s=[],n=null){let a=Array.isArray(s)?s.filter(Boolean):[];if(a.length){let d=(Array.isArray(e.adoptedStyleSheets)?e.adoptedStyleSheets:[]).filter(y=>!a.includes(y));e.adoptedStyleSheets=[...d,...a]}try{let d=(await Promise.all(t.map(async y=>{if(n)switch(y){case"tokens":return n.tokensStylesheet;case"primitives":return n.primitivesStylesheet;case"components":return n.componentsStylesheet;case"utilities":return n.utilitiesStylesheet;default:break}return P.getStylesheet(y)}))).filter(y=>y!==null);e.adoptedStyleSheets=[...d,...a]}catch(o){let d=e.host?.tagName?.toLowerCase()||"unknown";console.error(`[PDS Adopter] <${d}> failed to adopt layers:`,o),e.adoptedStyleSheets=a}}function ye(e){let t=new CSSStyleSheet;return t.replaceSync(e),t}var be={FontWeights:{light:300,normal:400,medium:500,semibold:600,bold:700},LineHeights:{tight:1.25,normal:1.5,relaxed:1.75},BorderWidths:{hairline:.5,thin:1,medium:2,thick:3},RadiusSizes:{none:0,small:4,medium:8,large:16,xlarge:24,xxlarge:32},ShadowDepths:{none:"none",light:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",medium:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",deep:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",extreme:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},TransitionSpeeds:{fast:150,normal:250,slow:350},AnimationEasings:{linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},TouchTargetSizes:{compact:36,standard:44,comfortable:48,spacious:56},LinkStyles:{inline:"inline",block:"block",button:"button"},FocusStyles:{ring:"ring",outline:"outline",border:"border",glow:"glow"},TabSizes:{compact:2,standard:4,wide:8},SelectIcons:{chevron:"chevron",arrow:"arrow",caret:"caret",none:"none"},IconSizes:{xs:16,sm:20,md:24,lg:32,xl:48,"2xl":64,"3xl":96}};var Z={};Ie(Z,{deepMerge:()=>ge,fragmentFromTemplateLike:()=>Ne,isObject:()=>O,parseHTML:()=>X});function O(e){return e&&typeof e=="object"&&!Array.isArray(e)}function ge(e,t){let s={...e};return O(e)&&O(t)&&Object.keys(t).forEach(n=>{O(t[n])?n in e?s[n]=ge(e[n],t[n]):Object.assign(s,{[n]:t[n]}):Object.assign(s,{[n]:t[n]})}),s}function Ne(e){let t=Array.isArray(e?.strings)?e.strings:[],s=Array.isArray(e?.values)?e.values:[],n=new Set,a=[],o=/(\s)(\.[\w-]+)=\s*$/;for(let i=0;i<t.length;i+=1){let g=t[i]??"",f=g.match(o);if(f&&i<s.length){let w=f[2].slice(1),L=`pds-val-${i}`;g=g.replace(o,`$1data-pds-prop="${w}:${L}"`),n.add(i)}a.push(g),i<s.length&&!n.has(i)&&a.push(`<!--pds-val-${i}-->`)}let d=document.createElement("template");d.innerHTML=a.join("");let y=(i,g)=>{let f=i.parentNode;if(!f)return;if(g==null){f.removeChild(i);return}let E=w=>{if(w!=null){if(w instanceof Node){f.insertBefore(w,i);return}if(Array.isArray(w)){w.forEach(L=>E(L));return}f.insertBefore(document.createTextNode(String(w)),i)}};E(g),f.removeChild(i)},S=document.createTreeWalker(d.content,NodeFilter.SHOW_COMMENT),h=[];for(;S.nextNode();){let i=S.currentNode;i?.nodeValue?.startsWith("pds-val-")&&h.push(i)}return h.forEach(i=>{let g=Number(i.nodeValue.replace("pds-val-",""));y(i,s[g])}),d.content.querySelectorAll("*").forEach(i=>{let g=i.getAttribute("data-pds-prop");if(!g)return;let[f,E]=g.split(":"),w=Number(String(E).replace("pds-val-",""));f&&Number.isInteger(w)&&(i[f]=s[w]),i.removeAttribute("data-pds-prop")}),d.content}function X(e){return new DOMParser().parseFromString(e,"text/html").body.childNodes}var Se="pds",Oe=/^([a-z][a-z0-9+\-.]*:)?\/\//i,we=/^[a-z]:/i;function U(e=""){return e.endsWith("/")?e:`${e}/`}function ze(e="",t=Se){let s=e.replace(/\/+$/,"");return new RegExp(`(?:^|/)${t}$`,"i").test(s)?s:`${s}/${t}`}function Fe(e){return e.replace(/^\.\/+/,"")}function We(e){return we.test(e)?e.replace(we,"").replace(/^\/+/,""):e}function Be(e){return e.startsWith("public/")?e.substring(7):e}function z(e,t={}){let s=t.segment||Se,n=t.defaultRoot||`/assets/${s}/`,a=e?.public&&e.public?.root||e?.static&&e.static?.root||null;if(!a||typeof a!="string")return U(n);let o=a.trim();return o?(o=o.replace(/\\/g,"/"),o=ze(o,s),o=U(o),Oe.test(o)?o:(o=Fe(o),o=We(o),o.startsWith("/")||(o=Be(o),o.startsWith("/")||(o=`/${o}`),o=o.replace(/\/+/g,(d,y)=>y===0?d:"/")),U(o))):U(n)}async function qe(...e){let t={};e.length&&typeof e[e.length-1]=="object"&&(t=e.pop()||{});let s=e,{baseURL:n,mapper:a=h=>`${h}.js`,onError:o=(h,c)=>console.error(`[defineWebComponents] ${h}:`,c)}=t,d=n?new URL(n,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),y=h=>h.toLowerCase().replace(/(^|-)([a-z])/g,(c,i,g)=>g.toUpperCase()),S=async h=>{try{if(customElements.get(h))return{tag:h,status:"already-defined"};let c=a(h),g=await import(c instanceof URL?c.href:new URL(c,d).href),f=g?.default??g?.[y(h)];if(!f){if(customElements.get(h))return{tag:h,status:"self-defined"};throw new Error(`No export found for ${h}. Expected default export or named export "${y(h)}".`)}return customElements.get(h)?{tag:h,status:"race-already-defined"}:(customElements.define(h,f),{tag:h,status:"defined"})}catch(c){throw o(h,c),c}};return Promise.all(s.map(S))}var F=class{constructor(t={}){let{baseURL:s,mapper:n,onError:a,predicate:o=()=>!0,attributeModule:d="data-module",root:y=document,scanExisting:S=!0,debounceMs:h=16,observeShadows:c=!0,enhancers:i=[],patchAttachShadow:g=!0}=t,f=new Set,E=new Set,w=new Set,L=new Map,k=new WeakMap,_=new WeakMap,m=0,b=!1,x=null,N=l=>{if(!l||!i.length)return;let u=_.get(l);u||(u=new Set,_.set(l,u));for(let p of i)if(!(!p.selector||!p.run)&&!u.has(p.selector))try{l.matches&&l.matches(p.selector)&&(p.run(l),u.add(p.selector))}catch(v){console.warn(`[AutoDefiner] Error applying enhancer for selector "${p.selector}":`,v)}},M=(l,u)=>{if(!b&&!(!l||!l.includes("-"))&&!customElements.get(l)&&!E.has(l)&&!w.has(l)){if(u&&u.getAttribute){let p=u.getAttribute(d);p&&!L.has(l)&&L.set(l,p)}f.add(l),Ce()}},Ce=()=>{m||(m=setTimeout(pe,h))},R=l=>{if(l){if(l.nodeType===1){let u=l,p=u.tagName?.toLowerCase();p&&p.includes("-")&&!customElements.get(p)&&o(p,u)&&M(p,u),N(u),c&&u.shadowRoot&&Y(u.shadowRoot)}l.querySelectorAll&&l.querySelectorAll("*").forEach(u=>{let p=u.tagName?.toLowerCase();p&&p.includes("-")&&!customElements.get(p)&&o(p,u)&&M(p,u),N(u),c&&u.shadowRoot&&Y(u.shadowRoot)})}},Y=l=>{if(!l||k.has(l))return;R(l);let u=new MutationObserver(p=>{for(let v of p)v.addedNodes?.forEach(D=>{R(D)}),v.type==="attributes"&&v.target&&R(v.target)});u.observe(l,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[d,...i.map(p=>p.selector).filter(p=>p.startsWith("data-"))]}),k.set(l,u)};async function pe(){if(clearTimeout(m),m=0,!f.size)return;let l=Array.from(f);f.clear(),l.forEach(u=>E.add(u));try{let u=p=>L.get(p)??(n?n(p):`${p}.js`);await qe(...l,{baseURL:s,mapper:u,onError:(p,v)=>{w.add(p),a?.(p,v)}})}catch{}finally{l.forEach(u=>E.delete(u))}}let ue=y===document?document.documentElement:y,fe=new MutationObserver(l=>{for(let u of l)u.addedNodes?.forEach(p=>{R(p)}),u.type==="attributes"&&u.target&&R(u.target)});if(fe.observe(ue,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[d,...i.map(l=>l.selector).filter(l=>l.startsWith("data-"))]}),c&&g&&Element.prototype.attachShadow){let l=Element.prototype.attachShadow;Element.prototype.attachShadow=function(p){let v=l.call(this,p);if(p&&p.mode==="open"){Y(v);let D=this.tagName?.toLowerCase();D&&D.includes("-")&&!customElements.get(D)&&M(D,this)}return v},x=()=>Element.prototype.attachShadow=l}return S&&R(ue),{stop(){b=!0,fe.disconnect(),x&&x(),m&&(clearTimeout(m),m=0),k.forEach(l=>l.disconnect())},flush:pe}}static async define(...t){let s={};t.length&&typeof t[t.length-1]=="object"&&(s=t.pop()||{});let n=t,{baseURL:a,mapper:o=c=>`${c}.js`,onError:d=(c,i)=>console.error(`[defineWebComponents] ${c}:`,i)}=s,y=a?new URL(a,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),S=c=>c.toLowerCase().replace(/(^|-)([a-z])/g,(i,g,f)=>f.toUpperCase()),h=async c=>{try{if(customElements.get(c))return{tag:c,status:"already-defined"};let i=o(c),f=await import(i instanceof URL?i.href:new URL(i,y).href),E=f?.default??f?.[S(c)];if(!E){if(customElements.get(c))return{tag:c,status:"self-defined"};throw new Error(`No export found for ${c}. Expected default export or named export "${S(c)}".`)}return customElements.get(c)?{tag:c,status:"race-already-defined"}:(customElements.define(c,E),{tag:c,status:"defined"})}catch(i){throw d(c,i),i}};return Promise.all(n.map(h))}};var He=/^[a-z][a-z0-9+\-.]*:\/\//i,C=(()=>{try{return import.meta.url}catch{return}})(),W=e=>typeof e=="string"&&e.length&&!e.endsWith("/")?`${e}/`:e;function B(e,t={}){if(!e||He.test(e))return e;let{preferModule:s=!0}=t,n=()=>{if(!C)return null;try{return new URL(e,C).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(s?n()||a():a()||n())||e}var Ee=(()=>{if(C)try{let e=new URL(C);if(/\/public\/assets\/js\//.test(e.pathname))return new URL("../pds/",C).href}catch{return}})(),_e=!1;function Le(e){_e||typeof document>"u"||(_e=!0,e.addEventListener("pds:ready",t=>{let s=t.detail?.mode;s&&document.documentElement.classList.add(`pds-${s}`,"pds-ready")}))}function ve({manageTheme:e,themeStorageKey:t,applyResolvedTheme:s,setupSystemListenerIfNeeded:n}){let a="light",o=null;if(e&&typeof window<"u"){try{o=localStorage.getItem(t)||null}catch{o=null}try{s?.(o),n?.(o)}catch{}o?o==="system"?a=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a=o:a=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return{resolvedTheme:a,storedTheme:o}}function q(e,{resolvePublicAssetURL:t}){let s=!!(e?.public?.root||e?.static?.root),n=t(e);return!s&&Ee&&(n=Ee),W(B(n))}async function Ae(e,{baseEnhancers:t=[]}={}){let{autoDefineBaseURL:s="/auto-define/",autoDefinePreload:n=[],autoDefineMapper:a=null,enhancers:o=[],autoDefineOverrides:d=null,autoDefinePreferModule:y=!0}=e,S=(()=>{let c=new Map;return(t||[]).forEach(i=>c.set(i.selector,i)),(o||[]).forEach(i=>c.set(i.selector,i)),Array.from(c.values())})(),h=null;if(typeof window<"u"&&typeof document<"u"){let c=F,i=m=>{switch(m){case"pds-tabpanel":return"pds-tabstrip.js";default:return`${m}.js`}},{mapper:g,enhancers:f,...E}=d&&typeof d=="object"?d:{},w=f?Array.isArray(f)?f:typeof f=="object"?Object.values(f):[]:[],L=(()=>{let m=new Map;return(S||[]).forEach(b=>{b?.selector&&m.set(b.selector,b)}),(w||[]).forEach(b=>{if(!b?.selector)return;let x=m.get(b.selector)||null;m.set(b.selector,{...x||{},...b,run:typeof b?.run=="function"?b.run:x?.run})}),Array.from(m.values())})(),_={baseURL:s&&W(B(s,{preferModule:y})),predefine:n,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:L,onError:(m,b)=>{if(typeof m=="string"&&m.startsWith("pds-")){let N=["pds-form","pds-drawer"].includes(m),M=b?.message?.includes("#pds/lit")||b?.message?.includes("Failed to resolve module specifier");N&&M?console.error(`\u274C PDS component <${m}> requires Lit but #pds/lit is not in import map.
|
|
2
|
+
See: https://github.com/Pure-Web-Foundation/pure-ds/blob/main/readme.md#lit-components-not-working`):console.warn(`\u26A0\uFE0F PDS component <${m}> not found. Assets may not be installed.`)}else console.error(`\u274C Auto-define error for <${m}>:`,b)},...E,mapper:m=>{if(customElements.get(m))return null;if(typeof a=="function")try{let b=a(m);return b===void 0?i(m):b}catch(b){return console.warn("Custom autoDefine.mapper error; falling back to default:",b?.message||b),i(m)}return i(m)}};h=new c(_),n.length>0&&typeof c.define=="function"&&await c.define(...n,{baseURL:s,mapper:_.mapper,onError:_.onError})}return{autoDefiner:h,mergedEnhancers:S}}var ee=["light","dark"],te=new Set(ee);function Ve(e){let s=(Array.isArray(e?.themes)?e.themes.map(n=>String(n).toLowerCase()):ee).filter(n=>te.has(n));return s.length?s:ee}function se(e,{preferDocument:t=!0}={}){let s=String(e||"").toLowerCase();if(te.has(s))return s;if(t&&typeof document<"u"){let n=document.documentElement?.getAttribute("data-theme");if(te.has(n))return n}return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ke(e,t){let s=se(t);return Ve(e).includes(s)}var oe=class extends EventTarget{},je="__PURE_DS_PDS_SINGLETON__",ie=typeof globalThis<"u"?globalThis:window,ne=ie?.[je],r=ne&&typeof ne.addEventListener=="function"?ne:new oe;ie&&(ie[je]=r);typeof r.initializing!="boolean"&&(r.initializing=!1);"currentPreset"in r||(r.currentPreset=null);typeof r.debug!="boolean"&&(r.debug=!1);"currentConfig"in r||(r.currentConfig=null);"compiled"in r||(r.compiled=null);var H=null,V=null,K=null,G=null;function Q(e,t){return t&&typeof t=="string"?t:`${q(r.currentConfig||{},{resolvePublicAssetURL:z})}core/${e}`}async function Ke(){return Array.isArray(r.defaultEnhancers)&&r.defaultEnhancers.length>0?r.defaultEnhancers:(G||(G=import(Q("pds-enhancers.js",r.currentConfig?.enhancersURL)).then(t=>{let s=Array.isArray(t?.defaultPDSEnhancers)?t.defaultPDSEnhancers:[];return r.defaultEnhancers=s,s}).catch(t=>{throw G=null,t})),G)}async function Ge(){return typeof r.ask=="function"&&r.ask!==Re?r.ask:(V||(V=import(Q("pds-ask.js",r.currentConfig?.askURL)).then(t=>{let s=t?.ask;if(typeof s!="function")throw new Error("Failed to load ask helper");return r.ask=s,s}).catch(t=>{throw V=null,t})),V)}async function I(){return typeof r.toast=="function"&&r.toast!==T?r.toast:(K||(K=import(Q("pds-toast.js",r.currentConfig?.toastURL)).then(t=>{let s=t?.toast;if(typeof s!="function")throw new Error("Failed to load toast helper");return r.toast=s,s}).catch(t=>{throw K=null,t})),K)}async function Re(...e){return(await Ge())(...e)}async function T(...e){return(await I())(...e)}T.success=async(...e)=>(await I()).success(...e);T.error=async(...e)=>(await I()).error(...e);T.warning=async(...e)=>(await I()).warning(...e);T.info=async(...e)=>(await I()).info(...e);var xe=function(e="log",t,...s){let n=!!(r.registry&&!r.registry.isLive),a=(this?.debug||this?.design?.debug||r.debug||!1)===!0;if(n){if(!r.debug)return}else if(!a&&e!=="error"&&e!=="warn")return;let o=console[e]||console.log;s.length>0?o(t,...s):o(t)};function ae(e){if(e==null)return e;if(typeof e=="function")return;if(typeof e!="object")return e;if(Array.isArray(e))return e.map(s=>ae(s)).filter(s=>s!==void 0);let t={};for(let[s,n]of Object.entries(e)){let a=ae(n);a!==void 0&&(t[s]=a)}return t}function De(e,t=new WeakSet){if(!e||typeof e!="object"||t.has(e))return e;t.add(e),Object.freeze(e);for(let s of Object.keys(e))De(e[s],t);return e}function ce(e){return e==null||typeof e!="object"?e:De(structuredClone(ae(e)))}async function Qe(e,t={}){if(t?.runtimeConfig===!1||typeof fetch!="function")return null;let s=t?.runtimeConfigURL||`${e}pds-runtime-config.json`;try{let n=await fetch(s,{cache:"no-store"});return n.ok?await n.json():null}catch{return null}}r.registry=P;r.enums=be;r.adoptLayers=he;r.adoptPrimitives=me;r.parse=X;r.createStylesheet=ye;r.isLiveMode=()=>P.isLive;r.ask=Re;r.toast=T;r.common=Z;r.AutoComplete=null;r.loadAutoComplete=async()=>{if(r.AutoComplete&&typeof r.AutoComplete.connect=="function")return r.AutoComplete;let e=Q("pds-autocomplete.js",r.currentConfig?.autoCompleteURL);return H||(H=import(e).then(t=>{let s=t?.AutoComplete||t?.default?.AutoComplete||t?.default||null;if(!s)throw new Error("AutoComplete export not found in module");return r.AutoComplete=s,s}).catch(t=>{throw H=null,t})),H};function Pe(e){let t=typeof CustomEvent=="function";try{let s=t?new CustomEvent("pds:ready",{detail:e}):new Event("pds:ready");r.dispatchEvent(s)}catch{}if(typeof document<"u")if(t){let s={detail:e,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:ready",s))}catch{}try{document.dispatchEvent(new CustomEvent("pds-ready",s))}catch{}}else{try{document.dispatchEvent(new Event("pds:ready"))}catch{}try{document.dispatchEvent(new Event("pds-ready"))}catch{}}}function Te(e={}){let t=typeof CustomEvent=="function",s={at:Date.now(),...e};try{let n=t?new CustomEvent("pds:config-changed",{detail:s}):new Event("pds:config-changed");r.dispatchEvent(n)}catch{}if(typeof document<"u")if(t){let n={detail:s,bubbles:!0,composed:!0};try{document.dispatchEvent(new CustomEvent("pds:config-changed",n))}catch{}}else try{document.dispatchEvent(new Event("pds:config-changed"))}catch{}}var re="pure-ds-theme",j=null,$=null;function de(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 le(e){try{if(j&&$){try{typeof j.removeEventListener=="function"?j.removeEventListener("change",$):typeof j.removeListener=="function"&&j.removeListener($)}catch{}j=null,$=null}if(e==="system"&&typeof window<"u"&&window.matchMedia){let t=window.matchMedia("(prefers-color-scheme: dark)"),s=n=>{let a=n?.matches===void 0?t.matches:n.matches;try{let o=a?"dark":"light";document.documentElement.setAttribute("data-theme",o),r.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:o,source:"system"}}))}catch{}};j=t,$=s,typeof t.addEventListener=="function"?t.addEventListener("change",s):typeof t.addListener=="function"&&t.addListener(s)}}catch{}}var Ye=Object.getOwnPropertyDescriptor(r,"theme");Ye||Object.defineProperty(r,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(re)||null}catch{return null}},set(e){try{if(typeof window>"u")return;let t=r.currentConfig?.design||null,s=se(e);if(t&&!ke(t,s)){let n=t?.name||r.currentPreset?.name||r.currentConfig?.preset||"current preset";console.warn(`PDS theme "${s}" not supported by preset "${n}".`),r.dispatchEvent(new CustomEvent("pds:theme:blocked",{detail:{theme:e,resolvedTheme:s,preset:n}}));return}e==null?localStorage.removeItem(re):localStorage.setItem(re,e),de(e),le(e),r.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:e,source:"api"}}))}catch{}}});r.defaultEnhancers=[];async function Je(e){r.initializing=!0;try{let t=e&&e.mode||"live",{mode:s,...n}=e||{};r.currentConfig=ce(n);let a;if(t==="static")a=await Xe(n);else{let d=q(n,{resolvePublicAssetURL:z}),y=n?.managerURL||n?.public?.managerURL||n?.manager?.url||new URL("core/pds-manager.js",d).href||new URL("./pds-manager.js",import.meta.url).href,{startLive:S}=await import(y);a=await S(r,n,{emitReady:Pe,emitConfigChanged:Te,applyResolvedTheme:de,setupSystemListenerIfNeeded:le})}r.compiled=ce(a?.config||null);let o=r?.compiled?.design?.icons?.externalPath||"/assets/img/icons/";return typeof console<"u"&&typeof console.info=="function"&&console.info(`[PDS] startup ready; external icon path: ${o}`),a}finally{r.initializing=!1}}r.start=Je;async function Xe(e){if(!e||typeof e!="object")throw new Error("PDS.start({ mode: 'static', ... }) requires a valid configuration object");let t=e.applyGlobalStyles??!0,s=e.manageTheme??!0,n=e.themeStorageKey??"pure-ds-theme",a=e.staticPaths??{},o=q(e,{resolvePublicAssetURL:z}),d=e&&e.autoDefine||null,y;d&&d.baseURL?y=W(B(d.baseURL,{preferModule:!1})):y=`${o}components/`;let S=d&&Array.isArray(d.predefine)&&d.predefine||[],h=d&&typeof d.mapper=="function"&&d.mapper||null;try{Le(r);let{resolvedTheme:c}=ve({manageTheme:s,themeStorageKey:n,applyResolvedTheme:de,setupSystemListenerIfNeeded:le}),i=await Qe(o,e),g=Array.isArray(e?.enhancers)?e.enhancers:e?.enhancers&&typeof e.enhancers=="object"?Object.values(e.enhancers):[],f=i?.config?{...i.config,...e,design:e?.design||i.config.design,preset:e?.preset||i.config.preset}:{...e},E={tokens:`${o}styles/pds-tokens.css.js`,primitives:`${o}styles/pds-primitives.css.js`,components:`${o}styles/pds-components.css.js`,utilities:`${o}styles/pds-utilities.css.js`,styles:`${o}styles/pds-styles.css.js`},w=i?.paths||{};if(a={...E,...w,...a},r.registry.setStaticMode(a),t&&typeof document<"u")try{let _=await r.registry.getStylesheet("styles");if(_){_._pds=!0;let m=(document.adoptedStyleSheets||[]).filter(b=>b._pds!==!0);document.adoptedStyleSheets=[...m,_],Te({mode:"static",source:"static:styles-applied"})}}catch(_){xe.call(r,"warn","Failed to apply static styles:",_)}let L=null,k=[];try{let _=await Ke(),m=await Ae({autoDefineBaseURL:y,autoDefinePreload:S,autoDefineMapper:h,enhancers:g,autoDefineOverrides:d||null,autoDefinePreferModule:!(d&&d.baseURL)},{baseEnhancers:_});L=m.autoDefiner,k=m.mergedEnhancers||[]}catch(_){xe.call(r,"error","\u274C Failed to initialize AutoDefiner/Enhancers (static):",_)}return r.compiled=ce({mode:"static",...f,theme:c,enhancers:k}),Pe({mode:"static",config:f,theme:c,autoDefiner:L}),{config:f,theme:c,autoDefiner:L}}catch(c){throw r.dispatchEvent(new CustomEvent("pds:error",{detail:{error:c}})),c}}var Me={mode:"live",liveEdit:!0,preset:"default",autoDefine:{predefine:["pds-icon","pds-drawer","pds-toaster"]},log(e,t,...s){console[e](t,...s)}};var A={name:"@pure-ds/core",shortname:"pds",version:"0.7.23",description:"Why develop a Design System when you can generate one?",repository:{type:"git",url:"git+https://github.com/Pure-Web-Foundation/pure-ds.git"},bugs:{url:"https://github.com/Pure-Web-Foundation/pure-ds/issues"},homepage:"https://puredesignsystem.z6.web.core.windows.net/",keywords:["design-system","css","web-components","lit","constructable-stylesheets","tokens","utilities","a11y"],type:"module",main:"./public/assets/pds/core.js",module:"./public/assets/pds/core.js",types:"./dist/types/pds.d.ts",bin:{"pds-build":"packages/pds-cli/bin/pds-static.js","pds-sync-assets":"packages/pds-cli/bin/sync-assets.js","pds-build-icons":"packages/pds-cli/bin/pds-build-icons.js","pds-import":"packages/pds-cli/bin/pds-import.js","pds-setup-copilot":"packages/pds-cli/bin/pds-setup-copilot.js","pds-setup-mcp":"packages/pds-cli/bin/pds-setup-mcp.js","pds-init-config":"packages/pds-cli/bin/pds-init-config.js","pds-bootstrap":"packages/pds-cli/bin/pds-bootstrap.js","pds-mcp-server":"packages/pds-cli/bin/pds-mcp-server.js","pds-mcp-health":"packages/pds-cli/bin/pds-mcp-health.js","pds-mcp-eval":"packages/pds-cli/bin/pds-mcp-eval.js"},exports:{".":{types:"./src/js/pds.d.ts",import:"./public/assets/pds/core.js"},"./pds-core":"./src/js/pds.js","./auto-define/*":"./public/auto-define/*"},files:[".github/copilot-instructions.md",".cursorrules","dist/types/","public/assets/js/","public/assets/pds/components/","public/assets/pds/templates/","public/assets/pds/core.js","public/assets/pds/core/","public/assets/pds/external/","public/assets/pds/vscode-custom-data.json","public/assets/pds/pds.css-data.json","public/assets/pds/pds-css-complete.json","public/auto-define/","public/pds/components/","public/assets/pds/icons/pds-icons.svg","packages/pds-cli/bin/","packages/pds-cli/lib/","src/js/pds.d.ts","src/js/pds.js","src/js/pds-live-manager/","src/js/pds-core/","custom-elements.json","custom-elements-manifest.config.js","pds.html-data.json","pds.css-data.json","readme.md","INTELLISENSE.md","CSS-INTELLISENSE-LIMITATION.md","CSS-INTELLISENSE-QUICK-REF.md"],scripts:{test:'echo "Error: no test specified" && exit 1',dev:"node esbuild-dev.js",prebuild:"npm run types",build:"node esbuild-build.js",types:"tsc -p tsconfig.json && node scripts/sync-types.mjs",postinstall:"node packages/pds-cli/bin/postinstall.mjs","prepds:build":"npm run types","pds:build":"node packages/pds-cli/bin/pds-static.js","pds:build-icons":"node packages/pds-cli/bin/pds-build-icons.js","pds:bootstrap":"node packages/pds-cli/bin/pds-bootstrap.js","pds:manifest":"node packages/pds-cli/bin/generate-manifest.js","pds:css-data":"node packages/pds-cli/bin/generate-css-data.js","pds:import":"node packages/pds-cli/bin/pds-import.js","pds:dx":"node packages/pds-cli/bin/pds-dx.js","pds:mcp:server":"node packages/pds-cli/bin/pds-mcp-server.js","pds:mcp:health":"node packages/pds-cli/bin/pds-mcp-health.js","pds:mcp:eval":"node packages/pds-cli/bin/pds-mcp-eval.js","storybook:generate":"cd packages/pds-storybook && npm run generate-stories","storybook:dev":"cd packages/pds-storybook && npm run storybook:dev","storybook:build":"cd packages/pds-storybook && npm run storybook:build"},author:"Marc van Neerven",license:"ISC",engines:{node:">=18"},publishConfig:{access:"public"},devDependencies:{"@custom-elements-manifest/analyzer":"^0.9.9",esbuild:"^0.19.0","fs-extra":"^11.1.1",typescript:"^5.6.3","@types/node":"^22.10.2"},dependencies:{lit:"^3.3.1","pure-web":"1.1.32"},customElements:"custom-elements.json"};await r.start(Me);var Ue=typeof A.repository=="string"?A.repository:A.repository?.url,et=Ue?Ue.replace(/^git\+/,"").replace(/\.git$/,""):"",Lt=A.homepage||et,vt=A.bugs?.url||"";document.body.innerHTML=`
|
|
3
3
|
<pds-toaster id="global-toaster"></pds-toaster>
|
|
4
4
|
|
|
5
5
|
<div class="container text-center">
|
|
6
6
|
<img src="/assets/img/pds-logo.svg" alt="PDS Logo" width="64" height="64" />
|
|
7
7
|
<header class="container section">
|
|
8
|
-
<h1>${
|
|
9
|
-
<small class="text-muted">${
|
|
8
|
+
<h1>${A.name} ${A.version}</h1>
|
|
9
|
+
<small class="text-muted">${A.description}</small>
|
|
10
10
|
</header>
|
|
11
11
|
</div>
|
|
12
12
|
`;
|