@pure-ds/storybook 0.7.41 → 0.7.46
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/.storybook/docs.css +6 -3
- package/.storybook/htmlPreview.css +14 -8
- package/.storybook/preview.js +66 -7
- package/.storybook/shiki.js +3 -1
- package/dist/pds-reference.json +62 -9
- package/package.json +2 -2
- package/public/assets/js/app.js +1 -1
- package/public/assets/js/pds-enhancers.js +1 -1
- package/public/assets/js/pds-manager.js +52 -55
- package/public/assets/pds/components/pds-drawer.js +18 -2
- package/public/assets/pds/core/pds-enhancers.js +1 -1
- package/public/assets/pds/core/pds-manager.js +52 -55
- package/public/assets/pds/external/shiki.js +1 -1
- package/src/js/external/shiki.js +1 -1
- package/src/js/pds-core/pds-enhancers-meta.js +13 -8
- package/src/js/pds-core/pds-enhancers.js +97 -122
- package/src/js/pds-core/pds-generator.js +13 -13
- package/src/js/pds-core/pds-live.js +6 -2
- package/src/js/pds-core/pds-ontology.js +8 -2
- package/stories/WhatIsPDS.md +1 -1
- package/stories/components/PdsDrawer.stories.js +554 -240
- package/stories/enhancements/Dropdowns.stories.js +19 -17
- package/stories/getting-started.md +0 -10
- package/stories/reference/pds-object-docs.js +588 -0
- package/stories/reference/reference-catalog.js +4 -7
- package/stories/reference/reference-docs.js +91 -13
- package/stories/reference/reference-helpers.js +2 -1
- package/stories/utils/PdsAsk.stories.js +4 -8
- package/stories/utils/PdsObjectApi.stories.js +43 -8
- package/stories/utils/PdsParse.stories.js +4 -8
- package/stories/utils/PdsToast.stories.js +4 -8
- package/stories/utils/pds-object-meta.js +42 -0
- package/stories/utils/shiki.js +107 -19
package/.storybook/docs.css
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
/* Override Storybook's default mono font for code panels */
|
|
4
4
|
pre, code, .docblock-source pre, .docblock-source code {
|
|
5
|
-
font-family: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
|
|
6
|
-
font-size: 13.6px;
|
|
7
|
-
line-height: 24px;
|
|
5
|
+
font-family: var(--pds-shiki-font-family, 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace) !important;
|
|
6
|
+
font-size: var(--pds-shiki-font-size, 13.6px);
|
|
7
|
+
line-height: var(--pds-shiki-line-height, 24px);
|
|
8
|
+
-webkit-font-smoothing: antialiased;
|
|
9
|
+
-moz-osx-font-smoothing: grayscale;
|
|
10
|
+
text-rendering: geometricPrecision;
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
/* Hide ALL story previews and interactive elements in Docs */
|
|
@@ -39,13 +39,16 @@
|
|
|
39
39
|
padding: var(--spacing-4, 1rem);
|
|
40
40
|
border-radius: var(--radius-md, 4px);
|
|
41
41
|
overflow-x: auto;
|
|
42
|
-
font-size: 13.6px;
|
|
43
|
-
line-height: 24px;
|
|
44
|
-
tab-size: 2;
|
|
42
|
+
font-size: var(--pds-shiki-font-size, 13.6px);
|
|
43
|
+
line-height: var(--pds-shiki-line-height, 24px);
|
|
44
|
+
tab-size: var(--pds-shiki-tab-size, 2);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.html-source-content pre code {
|
|
48
|
-
font-family: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
48
|
+
font-family: var(--pds-shiki-font-family, 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
|
|
49
|
+
-webkit-font-smoothing: antialiased;
|
|
50
|
+
-moz-osx-font-smoothing: grayscale;
|
|
51
|
+
text-rendering: geometricPrecision;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
/* Fallback pre styling (before Shiki loads) */
|
|
@@ -54,10 +57,13 @@
|
|
|
54
57
|
padding: var(--spacing-4, 1rem);
|
|
55
58
|
border-radius: var(--radius-md, 4px);
|
|
56
59
|
overflow-x: auto;
|
|
57
|
-
font-family: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
58
|
-
font-size: 13.6px;
|
|
59
|
-
line-height: 24px;
|
|
60
|
-
tab-size: 2;
|
|
60
|
+
font-family: var(--pds-shiki-font-family, 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
|
|
61
|
+
font-size: var(--pds-shiki-font-size, 13.6px);
|
|
62
|
+
line-height: var(--pds-shiki-line-height, 24px);
|
|
63
|
+
tab-size: var(--pds-shiki-tab-size, 2);
|
|
64
|
+
-webkit-font-smoothing: antialiased;
|
|
65
|
+
-moz-osx-font-smoothing: grayscale;
|
|
66
|
+
text-rendering: geometricPrecision;
|
|
61
67
|
background: var(--color-surface-raised, #282c34);
|
|
62
68
|
color: var(--color-text-primary, #abb2bf);
|
|
63
69
|
}
|
package/.storybook/preview.js
CHANGED
|
@@ -11,10 +11,14 @@ import { stripFunctions } from '@pds-src/js/pds-core/pds-start-helpers.js';
|
|
|
11
11
|
import { config as userConfig } from '@user/pds-config';
|
|
12
12
|
import { withHTMLExtractor } from './addons/html-preview/preview.js';
|
|
13
13
|
import { withDescription } from './addons/description/preview.js';
|
|
14
|
+
import { ensureSharedShikiStyles, preloadShiki } from './shiki.js';
|
|
14
15
|
import './htmlPreview.css';
|
|
15
16
|
import './docs.css';
|
|
16
17
|
import { toastFormData } from '../stories/utils/toast-utils.js';
|
|
17
18
|
|
|
19
|
+
ensureSharedShikiStyles();
|
|
20
|
+
preloadShiki();
|
|
21
|
+
|
|
18
22
|
// Expose toastFormData globally for inline event handlers
|
|
19
23
|
window.toastFormData = toastFormData;
|
|
20
24
|
|
|
@@ -209,14 +213,22 @@ function isDocsPage() {
|
|
|
209
213
|
}
|
|
210
214
|
}
|
|
211
215
|
|
|
212
|
-
function inferCodeLanguage(codeEl) {
|
|
213
|
-
if (!codeEl) return 'html';
|
|
214
|
-
|
|
216
|
+
function inferCodeLanguage(codeEl, preEl) {
|
|
217
|
+
if (!codeEl && !preEl) return 'html';
|
|
218
|
+
|
|
219
|
+
const className = codeEl?.className || '';
|
|
215
220
|
const languageMatch = className.match(/(?:language|lang)-([a-z0-9-]+)/i);
|
|
216
221
|
if (languageMatch?.[1]) {
|
|
217
222
|
return languageMatch[1].toLowerCase();
|
|
218
223
|
}
|
|
219
|
-
|
|
224
|
+
|
|
225
|
+
const preClassName = preEl?.className || '';
|
|
226
|
+
const preLanguageMatch = preClassName.match(/(?:language|lang)-([a-z0-9-]+)/i);
|
|
227
|
+
if (preLanguageMatch?.[1]) {
|
|
228
|
+
return preLanguageMatch[1].toLowerCase();
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return codeEl?.getAttribute('data-lang') || preEl?.getAttribute('data-lang') || 'html';
|
|
220
232
|
}
|
|
221
233
|
|
|
222
234
|
function upgradeLegacyCodeBlocks(root) {
|
|
@@ -228,10 +240,19 @@ function upgradeLegacyCodeBlocks(root) {
|
|
|
228
240
|
const preEl = codeEl.parentElement;
|
|
229
241
|
if (!preEl || preEl.closest('pds-code')) return;
|
|
230
242
|
|
|
243
|
+
// Keep Shiki-rendered blocks intact; they already carry correct language + theme.
|
|
244
|
+
if (
|
|
245
|
+
preEl.classList.contains('shiki') ||
|
|
246
|
+
preEl.classList.contains('pds-shiki-block') ||
|
|
247
|
+
preEl.hasAttribute('data-pds-shiki')
|
|
248
|
+
) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
|
|
231
252
|
const content = codeEl.textContent || '';
|
|
232
253
|
if (!content.trim()) return;
|
|
233
254
|
|
|
234
|
-
const lang = inferCodeLanguage(codeEl);
|
|
255
|
+
const lang = inferCodeLanguage(codeEl, preEl);
|
|
235
256
|
const pdsCode = document.createElement('pds-code');
|
|
236
257
|
pdsCode.setAttribute('lang', lang);
|
|
237
258
|
pdsCode.code = content;
|
|
@@ -239,6 +260,37 @@ function upgradeLegacyCodeBlocks(root) {
|
|
|
239
260
|
});
|
|
240
261
|
}
|
|
241
262
|
|
|
263
|
+
const observeCodeBlocks = (() => {
|
|
264
|
+
const observedRoots = new WeakSet();
|
|
265
|
+
return (root) => {
|
|
266
|
+
if (!root || observedRoots.has(root)) return;
|
|
267
|
+
|
|
268
|
+
const observer = new MutationObserver(() => {
|
|
269
|
+
upgradeLegacyCodeBlocks(root);
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
observer.observe(root, { childList: true, subtree: true });
|
|
273
|
+
observedRoots.add(root);
|
|
274
|
+
};
|
|
275
|
+
})();
|
|
276
|
+
|
|
277
|
+
function scheduleCodeBlockUpgrade(root) {
|
|
278
|
+
if (!root) return;
|
|
279
|
+
|
|
280
|
+
const runUpgrade = () => upgradeLegacyCodeBlocks(root);
|
|
281
|
+
runUpgrade();
|
|
282
|
+
requestAnimationFrame(runUpgrade);
|
|
283
|
+
setTimeout(runUpgrade, 60);
|
|
284
|
+
setTimeout(runUpgrade, 220);
|
|
285
|
+
|
|
286
|
+
void ensurePdsCodeLoaded().then(() => {
|
|
287
|
+
runUpgrade();
|
|
288
|
+
observeCodeBlocks(root);
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
observeCodeBlocks(root);
|
|
292
|
+
}
|
|
293
|
+
|
|
242
294
|
let liveGenerator = null;
|
|
243
295
|
const setLiveGenerator = (generator) => {
|
|
244
296
|
if (generator && typeof generator === 'object') {
|
|
@@ -414,7 +466,13 @@ const withPDS = (story, context) => {
|
|
|
414
466
|
const nonPdsSheets = document.adoptedStyleSheets.filter(s => !s._pds);
|
|
415
467
|
document.adoptedStyleSheets = nonPdsSheets;
|
|
416
468
|
}
|
|
417
|
-
|
|
469
|
+
const docsStory = story();
|
|
470
|
+
requestAnimationFrame(() => {
|
|
471
|
+
requestAnimationFrame(() => {
|
|
472
|
+
scheduleCodeBlockUpgrade(document.getElementById('docs-root'));
|
|
473
|
+
});
|
|
474
|
+
});
|
|
475
|
+
return docsStory;
|
|
418
476
|
}
|
|
419
477
|
|
|
420
478
|
console.log('🎬 withPDS decorator called for:', context.title);
|
|
@@ -514,7 +572,7 @@ const withPDS = (story, context) => {
|
|
|
514
572
|
|
|
515
573
|
// Initial adoption - run multiple times to catch lazy components
|
|
516
574
|
setTimeout(() => {
|
|
517
|
-
|
|
575
|
+
scheduleCodeBlockUpgrade(document.querySelector('#storybook-root'));
|
|
518
576
|
}, 0);
|
|
519
577
|
setTimeout(adoptAllShadowStyles, 0);
|
|
520
578
|
setTimeout(adoptAllShadowStyles, 100);
|
|
@@ -1581,6 +1639,7 @@ const withRelatedStories = (story, context) => {
|
|
|
1581
1639
|
requestAnimationFrame(() => {
|
|
1582
1640
|
if (context.viewMode === 'docs') {
|
|
1583
1641
|
pruneDocsStories();
|
|
1642
|
+
scheduleCodeBlockUpgrade(document.getElementById('docs-root'));
|
|
1584
1643
|
renderRelatedFooter(context);
|
|
1585
1644
|
removeRelatedOverlay();
|
|
1586
1645
|
return;
|
package/.storybook/shiki.js
CHANGED
package/dist/pds-reference.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-03-
|
|
2
|
+
"generatedAt": "2026-03-13T14:15:16.148Z",
|
|
3
3
|
"sources": {
|
|
4
4
|
"customElements": "custom-elements.json",
|
|
5
5
|
"ontology": "src\\js\\pds-core\\pds-ontology.js",
|
|
@@ -5018,6 +5018,13 @@
|
|
|
5018
5018
|
"demoHtml": null,
|
|
5019
5019
|
"source": "src\\js\\pds-core\\pds-enhancers.js"
|
|
5020
5020
|
},
|
|
5021
|
+
{
|
|
5022
|
+
"id": "dropdown-close",
|
|
5023
|
+
"selector": "[data-dropdown-close]",
|
|
5024
|
+
"description": "Declarative close marker for nav[data-dropdown] panels; clicking marked targets closes the open dropdown.",
|
|
5025
|
+
"demoHtml": null,
|
|
5026
|
+
"source": "src\\js\\pds-core\\pds-ontology.js"
|
|
5027
|
+
},
|
|
5021
5028
|
{
|
|
5022
5029
|
"id": "button-a-class-btn",
|
|
5023
5030
|
"selector": "button, a[class*='btn-']",
|
|
@@ -5913,9 +5920,23 @@
|
|
|
5913
5920
|
"tags": [
|
|
5914
5921
|
"menu",
|
|
5915
5922
|
"interactive",
|
|
5916
|
-
"navigation"
|
|
5923
|
+
"navigation",
|
|
5924
|
+
"dismiss",
|
|
5925
|
+
"close"
|
|
5917
5926
|
],
|
|
5918
|
-
"description": "Dropdown menu from nav element"
|
|
5927
|
+
"description": "Dropdown menu from nav element. Use data-dropdown-close on clickable descendants to dismiss on selection."
|
|
5928
|
+
},
|
|
5929
|
+
{
|
|
5930
|
+
"id": "dropdown-close",
|
|
5931
|
+
"selector": "[data-dropdown-close]",
|
|
5932
|
+
"tags": [
|
|
5933
|
+
"dropdown",
|
|
5934
|
+
"menu",
|
|
5935
|
+
"dismiss",
|
|
5936
|
+
"close",
|
|
5937
|
+
"attribute"
|
|
5938
|
+
],
|
|
5939
|
+
"description": "Declarative close marker for nav[data-dropdown] panels; clicking marked targets closes the open dropdown."
|
|
5919
5940
|
},
|
|
5920
5941
|
{
|
|
5921
5942
|
"id": "toggle",
|
|
@@ -8816,9 +8837,11 @@
|
|
|
8816
8837
|
"storyTitle": "Headline",
|
|
8817
8838
|
"category": null,
|
|
8818
8839
|
"name": "Headline",
|
|
8819
|
-
"description":
|
|
8840
|
+
"description": null,
|
|
8820
8841
|
"tags": [
|
|
8821
8842
|
"alert",
|
|
8843
|
+
"api",
|
|
8844
|
+
"autodocs",
|
|
8822
8845
|
"confirm",
|
|
8823
8846
|
"dialog",
|
|
8824
8847
|
"dialogs",
|
|
@@ -8827,15 +8850,33 @@
|
|
|
8827
8850
|
"modal",
|
|
8828
8851
|
"overlay",
|
|
8829
8852
|
"pds-ask",
|
|
8853
|
+
"pds-compiled",
|
|
8854
|
+
"pds-enums",
|
|
8855
|
+
"pds-object",
|
|
8856
|
+
"pds-parse",
|
|
8857
|
+
"pds-start",
|
|
8858
|
+
"pds-toast",
|
|
8830
8859
|
"popup",
|
|
8831
|
-
"prompt"
|
|
8860
|
+
"prompt",
|
|
8861
|
+
"reference",
|
|
8862
|
+
"runtime",
|
|
8863
|
+
"utilities"
|
|
8832
8864
|
],
|
|
8833
8865
|
"pdsParameters": {
|
|
8834
8866
|
"tags": [
|
|
8867
|
+
"runtime",
|
|
8868
|
+
"api",
|
|
8869
|
+
"reference",
|
|
8870
|
+
"pds-object",
|
|
8871
|
+
"pds-start",
|
|
8872
|
+
"pds-compiled",
|
|
8873
|
+
"pds-enums",
|
|
8874
|
+
"pds-ask",
|
|
8875
|
+
"pds-toast",
|
|
8876
|
+
"pds-parse",
|
|
8835
8877
|
"interaction",
|
|
8836
8878
|
"dialogs",
|
|
8837
8879
|
"forms",
|
|
8838
|
-
"pds-ask",
|
|
8839
8880
|
"modal",
|
|
8840
8881
|
"alert",
|
|
8841
8882
|
"confirm",
|
|
@@ -8852,16 +8893,19 @@
|
|
|
8852
8893
|
"storyTitle": "PDS/PDS Object",
|
|
8853
8894
|
"category": "PDS",
|
|
8854
8895
|
"name": "PDS Object",
|
|
8855
|
-
"description":
|
|
8896
|
+
"description": null,
|
|
8856
8897
|
"tags": [
|
|
8857
8898
|
"api",
|
|
8899
|
+
"autodocs",
|
|
8858
8900
|
"feedback",
|
|
8859
8901
|
"notifications",
|
|
8860
8902
|
"parse",
|
|
8903
|
+
"pds-ask",
|
|
8861
8904
|
"pds-compiled",
|
|
8862
8905
|
"pds-enums",
|
|
8863
8906
|
"pds-object",
|
|
8864
8907
|
"pds-parse",
|
|
8908
|
+
"pds-start",
|
|
8865
8909
|
"pds-toast",
|
|
8866
8910
|
"reference",
|
|
8867
8911
|
"runtime",
|
|
@@ -8870,10 +8914,19 @@
|
|
|
8870
8914
|
],
|
|
8871
8915
|
"pdsParameters": {
|
|
8872
8916
|
"tags": [
|
|
8917
|
+
"runtime",
|
|
8918
|
+
"api",
|
|
8919
|
+
"reference",
|
|
8920
|
+
"pds-object",
|
|
8921
|
+
"pds-start",
|
|
8922
|
+
"pds-compiled",
|
|
8923
|
+
"pds-enums",
|
|
8924
|
+
"pds-ask",
|
|
8925
|
+
"pds-toast",
|
|
8926
|
+
"pds-parse",
|
|
8873
8927
|
"toast",
|
|
8874
8928
|
"notifications",
|
|
8875
|
-
"feedback"
|
|
8876
|
-
"pds-toast"
|
|
8929
|
+
"feedback"
|
|
8877
8930
|
]
|
|
8878
8931
|
},
|
|
8879
8932
|
"stories": [],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pure-ds/storybook",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.46",
|
|
4
4
|
"description": "Storybook showcase for Pure Design System with live configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"pds:build-icons": "pds-build-icons"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@pure-ds/core": "^0.7.
|
|
41
|
+
"@pure-ds/core": "^0.7.46"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|
package/public/assets/js/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var rt=Object.defineProperty;var it=(e,t)=>{for(var n in t)rt(e,n,{get:t[n],enumerable:!0})};var ae=class extends EventTarget{constructor(){super(),this.mode=null,this.compiled=null,this.log=()=>{},this.logHandler=null}},je="__PURE_DS_PDS_SINGLETON__",ce=typeof globalThis<"u"?globalThis:window,ie=ce?.[je],o=ie&&typeof ie.addEventListener=="function"?ie:new ae;ce&&(ce[je]=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 le=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"}},z=new le;async function Ae(e,t=[],n=null){try{let s=n?.primitivesStylesheet?n.primitivesStylesheet:await z.getStylesheet("primitives");e.adoptedStyleSheets=[s,...t]}catch(s){let c=e.host?.tagName?.toLowerCase()||"unknown";o.log("error",`Adopter: <${c}> failed to adopt primitives:`,s),e.adoptedStyleSheets=t}}async function Pe(e,t=["primitives"],n=[],s=null){let c=Array.isArray(n)?n.filter(Boolean):[];if(c.length){let l=(Array.isArray(e.adoptedStyleSheets)?e.adoptedStyleSheets:[]).filter(g=>!c.includes(g));e.adoptedStyleSheets=[...l,...c]}try{let l=(await Promise.all(t.map(async g=>{if(s)switch(g){case"tokens":return s.tokensStylesheet;case"primitives":return s.primitivesStylesheet;case"components":return s.componentsStylesheet;case"utilities":return s.utilitiesStylesheet;default:break}return z.getStylesheet(g)}))).filter(g=>g!==null);e.adoptedStyleSheets=[...l,...c]}catch(r){let l=e.host?.tagName?.toLowerCase()||"unknown";o.log("error",`Adopter: <${l}> failed to adopt layers:`,r),e.adoptedStyleSheets=c}}function ke(e){let t=new CSSStyleSheet;return t.replaceSync(e),t}var xe={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 ue={};it(ue,{deepMerge:()=>Re,fragmentFromTemplateLike:()=>at,isObject:()=>B,parseHTML:()=>de});function B(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Re(e,t){let n={...e};return B(e)&&B(t)&&Object.keys(t).forEach(s=>{B(t[s])?s in e?n[s]=Re(e[s],t[s]):Object.assign(n,{[s]:t[s]}):Object.assign(n,{[s]:t[s]})}),n}function at(e){let t=Array.isArray(e?.strings)?e.strings:[],n=Array.isArray(e?.values)?e.values:[],s=new Set,c=[],r=/(\s)(\.[\w-]+)=\s*$/;for(let i=0;i<t.length;i+=1){let w=t[i]??"",m=w.match(r);if(m&&i<n.length){let S=m[2].slice(1),v=`pds-val-${i}`;w=w.replace(r,`$1data-pds-prop="${S}:${v}"`),s.add(i)}c.push(w),i<n.length&&!s.has(i)&&c.push(`<!--pds-val-${i}-->`)}let l=document.createElement("template");l.innerHTML=c.join("");let g=(i,w)=>{let m=i.parentNode;if(!m)return;if(w==null){m.removeChild(i);return}let _=S=>{if(S!=null){if(S instanceof Node){m.insertBefore(S,i);return}if(Array.isArray(S)){S.forEach(v=>_(v));return}m.insertBefore(document.createTextNode(String(S)),i)}};_(w),m.removeChild(i)},y=document.createTreeWalker(l.content,NodeFilter.SHOW_COMMENT),d=[];for(;y.nextNode();){let i=y.currentNode;i?.nodeValue?.startsWith("pds-val-")&&d.push(i)}return d.forEach(i=>{let w=Number(i.nodeValue.replace("pds-val-",""));g(i,n[w])}),l.content.querySelectorAll("*").forEach(i=>{let w=i.getAttribute("data-pds-prop");if(!w)return;let[m,_]=w.split(":"),S=Number(String(_).replace("pds-val-",""));m&&Number.isInteger(S)&&(i[m]=n[S]),i.removeAttribute("data-pds-prop")}),l.content}function de(e){return new DOMParser().parseFromString(e,"text/html").body.childNodes}var ze="pds",ct=/^([a-z][a-z0-9+\-.]*:)?\/\//i,De=/^[a-z]:/i;function N(e=""){return e.endsWith("/")?e:`${e}/`}function lt(e="",t=ze){let n=e.replace(/\/+$/,"");return new RegExp(`(?:^|/)${t}$`,"i").test(n)?n:`${n}/${t}`}function dt(e){return e.replace(/^\.\/+/,"")}function ut(e){return De.test(e)?e.replace(De,"").replace(/^\/+/,""):e}function pt(e){return e.startsWith("public/")?e.substring(7):e}function K(e,t={}){let n=t.segment||ze,s=t.defaultRoot||`/assets/${n}/`,c=e?.public&&e.public?.root||e?.static&&e.static?.root||null;if(!c||typeof c!="string")return N(s);let r=c.trim();return r?(r=r.replace(/\\/g,"/"),r=lt(r,n),r=N(r),ct.test(r)?r:(r=dt(r),r=ut(r),r.startsWith("/")||(r=pt(r),r.startsWith("/")||(r=`/${r}`),r=r.replace(/\/+/g,(l,g)=>g===0?l:"/")),N(r))):N(s)}async function ft(...e){let t={};e.length&&typeof e[e.length-1]=="object"&&(t=e.pop()||{});let n=e,{baseURL:s,mapper:c=d=>`${d}.js`,onError:r=(d,a)=>console.error(`[defineWebComponents] ${d}:`,a)}=t,l=s?new URL(s,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),g=d=>d.toLowerCase().replace(/(^|-)([a-z])/g,(a,i,w)=>w.toUpperCase()),y=async d=>{try{if(customElements.get(d))return{tag:d,status:"already-defined"};let a=c(d),w=await import(a instanceof URL?a.href:new URL(a,l).href),m=w?.default??w?.[g(d)];if(!m){if(customElements.get(d))return{tag:d,status:"self-defined"};throw new Error(`No export found for ${d}. Expected default export or named export "${g(d)}".`)}return customElements.get(d)?{tag:d,status:"race-already-defined"}:(customElements.define(d,m),{tag:d,status:"defined"})}catch(a){throw r(d,a),a}};return Promise.all(n.map(y))}var G=class{constructor(t={}){let{baseURL:n,mapper:s,onError:c,predicate:r=()=>!0,attributeModule:l="data-module",root:g=document,scanExisting:y=!0,debounceMs:d=16,observeShadows:a=!0,enhancers:i=[],patchAttachShadow:w=!0}=t,m=new Set,_=new Set,S=new Set,v=new Map,P=new WeakMap,E=new WeakMap,h=0,b=!1,k=null,H=u=>{if(!u||!i.length)return;let f=E.get(u);f||(f=new Set,E.set(u,f));for(let p of i)if(!(!p.selector||!p.run)&&!f.has(p.selector))try{u.matches&&u.matches(p.selector)&&(p.run(u),f.add(p.selector))}catch(j){console.warn(`[AutoDefiner] Error applying enhancer for selector "${p.selector}":`,j)}},M=(u,f)=>{if(!b&&!(!u||!u.includes("-"))&&!customElements.get(u)&&!_.has(u)&&!S.has(u)){if(f&&f.getAttribute){let p=f.getAttribute(l);p&&!v.has(u)&&v.set(u,p)}m.add(u),st()}},st=()=>{h||(h=setTimeout(_e,d))},R=u=>{if(u){if(u.nodeType===1){let f=u,p=f.tagName?.toLowerCase();p&&p.includes("-")&&!customElements.get(p)&&r(p,f)&&M(p,f),H(f),a&&f.shadowRoot&&re(f.shadowRoot)}u.querySelectorAll&&u.querySelectorAll("*").forEach(f=>{let p=f.tagName?.toLowerCase();p&&p.includes("-")&&!customElements.get(p)&&r(p,f)&&M(p,f),H(f),a&&f.shadowRoot&&re(f.shadowRoot)})}},re=u=>{if(!u||P.has(u))return;R(u);let f=new MutationObserver(p=>{for(let j of p)j.addedNodes?.forEach(D=>{R(D)}),j.type==="attributes"&&j.target&&R(j.target)});f.observe(u,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[l,...i.map(p=>p.selector).filter(p=>p.startsWith("data-"))]}),P.set(u,f)};async function _e(){if(clearTimeout(h),h=0,!m.size)return;let u=Array.from(m);m.clear(),u.forEach(f=>_.add(f));try{let f=p=>v.get(p)??(s?s(p):`${p}.js`);await ft(...u,{baseURL:n,mapper:f,onError:(p,j)=>{S.add(p),c?.(p,j)}})}catch{}finally{u.forEach(f=>_.delete(f))}}let Ee=g===document?document.documentElement:g,ve=new MutationObserver(u=>{for(let f of u)f.addedNodes?.forEach(p=>{R(p)}),f.type==="attributes"&&f.target&&R(f.target)});if(ve.observe(Ee,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[l,...i.map(u=>u.selector).filter(u=>u.startsWith("data-"))]}),a&&w&&Element.prototype.attachShadow){let u=Element.prototype.attachShadow;Element.prototype.attachShadow=function(p){let j=u.call(this,p);if(p&&p.mode==="open"){re(j);let D=this.tagName?.toLowerCase();D&&D.includes("-")&&!customElements.get(D)&&M(D,this)}return j},k=()=>Element.prototype.attachShadow=u}return y&&R(Ee),{stop(){b=!0,ve.disconnect(),k&&k(),h&&(clearTimeout(h),h=0),P.forEach(u=>u.disconnect())},flush:_e}}static async define(...t){let n={};t.length&&typeof t[t.length-1]=="object"&&(n=t.pop()||{});let s=t,{baseURL:c,mapper:r=a=>`${a}.js`,onError:l=(a,i)=>console.error(`[defineWebComponents] ${a}:`,i)}=n,g=c?new URL(c,typeof location<"u"?location.href:import.meta.url):new URL("./",import.meta.url),y=a=>a.toLowerCase().replace(/(^|-)([a-z])/g,(i,w,m)=>m.toUpperCase()),d=async a=>{try{if(customElements.get(a))return{tag:a,status:"already-defined"};let i=r(a),m=await import(i instanceof URL?i.href:new URL(i,g).href),_=m?.default??m?.[y(a)];if(!_){if(customElements.get(a))return{tag:a,status:"self-defined"};throw new Error(`No export found for ${a}. Expected default export or named export "${y(a)}".`)}return customElements.get(a)?{tag:a,status:"race-already-defined"}:(customElements.define(a,_),{tag:a,status:"defined"})}catch(i){throw l(a,i),i}};return Promise.all(s.map(d))}};var mt=/^[a-z][a-z0-9+\-.]*:\/\//i,O=(()=>{try{return import.meta.url}catch{return}})(),J=e=>typeof e=="string"&&e.length&&!e.endsWith("/")?`${e}/`:e;function q(e,t={}){if(!e||mt.test(e))return e;let{preferModule:n=!0}=t,s=()=>{if(!O)return null;try{return new URL(e,O).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(n?s()||c():c()||s())||e}var Te=(()=>{if(O)try{let e=new URL(O);if(/\/public\/assets\/js\//.test(e.pathname))return new URL("../pds/",O).href}catch{return}})(),Ce=!1;function Ue(e){Ce||typeof document>"u"||(Ce=!0,e.addEventListener("pds:ready",t=>{let n=t.detail?.mode;n&&document.documentElement.classList.add(`pds-${n}`,"pds-ready")}))}function Me({manageTheme:e,themeStorageKey:t,applyResolvedTheme:n,setupSystemListenerIfNeeded:s}){let c="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"?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 V(e,{resolvePublicAssetURL:t}){let n=!!(e?.public?.root||e?.static?.root),s=t(e);return!n&&Te&&(s=Te),J(q(s))}async function Ne(e,{baseEnhancers:t=[]}={}){let{autoDefineBaseURL:n="/auto-define/",autoDefinePreload:s=[],autoDefineMapper:c=null,enhancers:r=[],autoDefineOverrides:l=null,autoDefinePreferModule:g=!0}=e,y=(()=>{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())})(),d=null;if(typeof window<"u"&&typeof document<"u"){let a=G,i=h=>{switch(h){case"pds-tabpanel":return"pds-tabstrip.js";default:return`${h}.js`}},{mapper:w,enhancers:m,..._}=l&&typeof l=="object"?l:{},S=m?Array.isArray(m)?m:typeof m=="object"?Object.values(m):[]:[],v=(()=>{let h=new Map;return(y||[]).forEach(b=>{b?.selector&&h.set(b.selector,b)}),(S||[]).forEach(b=>{if(!b?.selector)return;let k=h.get(b.selector)||null;h.set(b.selector,{...k||{},...b,run:typeof b?.run=="function"?b.run:k?.run})}),Array.from(h.values())})(),E={baseURL:n&&J(q(n,{preferModule:g})),predefine:s,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:v,onError:(h,b)=>{if(typeof h=="string"&&h.startsWith("pds-")){let H=["pds-form","pds-drawer"].includes(h),M=b?.message?.includes("#pds/lit")||b?.message?.includes("Failed to resolve module specifier");H&&M?o.log("error",`\u274C PDS component <${h}> 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 <${h}> not found. Assets may not be installed.`)}else o.log("error",`\u274C Auto-define error for <${h}>:`,b)},..._,mapper:h=>{if(customElements.get(h))return null;if(typeof c=="function")try{let b=c(h);return b===void 0?i(h):b}catch(b){return o.log("warn","Custom autoDefine.mapper error; falling back to default:",b?.message||b),i(h)}return i(h)}};d=new a(E),s.length>0&&typeof a.define=="function"&&await a.define(...s,{baseURL:n,mapper:E.mapper,onError:E.onError})}return{autoDefiner:d,mergedEnhancers:y}}var pe=["light","dark"],fe=new Set(pe);function ht(e){let n=(Array.isArray(e?.themes)?e.themes.map(s=>String(s).toLowerCase()):pe).filter(s=>fe.has(s));return n.length?n:pe}function me(e,{preferDocument:t=!0}={}){let n=String(e||"").toLowerCase();if(fe.has(n))return n;if(t&&typeof document<"u"){let s=document.documentElement?.getAttribute("data-theme");if(fe.has(s))return s}return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Oe(e,t){let n=me(t);return ht(e).includes(n)}var yt=new Set(["log","warn","error","debug","info"]),gt="__PURE_DS_PDS_SINGLETON__",he=null,ye=null;function Ie(){try{let t=(typeof globalThis<"u"?globalThis:window)?.[gt];if(t&&typeof t=="object")return t}catch{return null}return null}function bt(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 wt(e){if(typeof e!="string")return"log";let t=e.toLowerCase();return yt.has(t)?t:"log"}function St(){if(typeof ye=="function")try{let t=bt(ye());if(t)return t}catch{}let e=Ie();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 Lt(){if(typeof he=="function")try{let t=he();if(typeof t=="function")return t}catch{}let e=Ie();return typeof e?.logHandler=="function"?e.logHandler:null}function $e(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 _t(e,t){let n=t?.debug===!0;return!(t?.mode==="static"&&!n||!n&&e!=="error"&&e!=="warn")}function Fe({getLogger:e,getContext:t}={}){he=typeof e=="function"?e:null,ye=typeof t=="function"?t:null}function We(e="log",t,...n){let s=wt(e),c=St(),r=Lt();if(r)try{r.call(c?.thisArg,s,t,...n);return}catch(l){$e("error","Custom log handler failed:",l)}_t(s,c)&&$e(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 Q=null,Y=null,Z=null,X=null,ee=null,te=null,Be="__pdsLocalizationRuntime";function T(){if(te)return te;let e=o?.[Be];return e&&typeof e=="object"?(te=e,e):null}function Et(e){let t=e&&typeof e=="object"?e:null;te=t,o[Be]=t}Fe({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)=>{We(e,t,...n)};var L={locale:"en",messages:{},hasProvider:!1},ne=new Set;function Ke(e){return!!e&&typeof e!="string"&&typeof e=="object"&&"strTag"in e}function Ge(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 vt(e,t){return String(e).replace(/\{(\d+)\}/g,(n,s)=>t(Number(s)))}function jt(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 At(e,...t){return{strTag:!0,strings:Array.from(e||[]),values:t,raw:Array.from(e?.raw||[])}}function Pt(e){if(!e)return"";if(Ke(e)){let n=Ge(e.strings||[]),s=L.messages[n]||n;return vt(s,c=>e.values?.[c])}let t=String(e);return L.messages[t]||t}function kt(e){if(!e)return;let t=Ke(e)?Ge(e.strings||[]):String(e);typeof t=="string"&&t.length>0&&ne.add(t)}function Je(e){if(!e||typeof e.msg!="function"||ne.size===0)return;let t=Array.from(ne);ne.clear();for(let n of t)try{e.msg(n)}catch{}}async function I(){let e=T();return e||(ee||(ee=import(F("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 Et(n),Je(n),n}).catch(n=>{throw ee=null,n})),ee)}var C=(e,t={})=>{let n=T();return typeof n?.msg=="function"?n.msg(e,t):(kt(e),Pt(e,t))},se=(e,...t)=>{let n=T();return typeof n?.str=="function"?n.str(e,...t):At(e,...t)},oe=(e=null)=>{let t=T();if(typeof t?.configureLocalization=="function")return t.configureLocalization(e);if(!e||typeof e!="object")return L.locale="en",L.messages={},L.hasProvider=!1,{locale:L.locale,messages:{...L.messages},hasProvider:L.hasProvider};typeof e.locale=="string"&&e.locale.trim()&&(L.locale=e.locale.trim()),Object.prototype.hasOwnProperty.call(e,"messages")&&(L.messages=jt(e.messages));let n=!!(e.provider||e.translate||e.loadLocale||e.setLocale);return L.hasProvider=n,n&&I().then(s=>{s.configureLocalization(e),Je(s)}).catch(()=>{}),{locale:L.locale,messages:{...L.messages},hasProvider:L.hasProvider}},qe=async e=>(await I()).loadLocale(e),Ve=async(e,t={})=>(await I()).setLocale(e,t),Qe=()=>{let e=T();return typeof e?.getLocalizationState=="function"?e.getLocalizationState():{locale:L.locale,messages:{...L.messages},hasProvider:L.hasProvider}},Ye=(e={})=>{let t=T();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(y=>String(y||"").trim().toLowerCase()).filter(Boolean):[],c=Array.from(new Set([n,...s])),r=null,l=async()=>(r||(r=I().then(y=>typeof y?.createJSONLocalization=="function"?y.createJSONLocalization(e):null).catch(()=>null)),r),g=async(y="loadLocale")=>{let d=await l();if(!d||typeof d!="object")return null;let a=d.provider;if(!a||typeof a!="object")return null;let i=a[y];return typeof i=="function"?i:y==="setLocale"&&typeof a.loadLocale=="function"?a.loadLocale:null};return{locale:n,locales:[...c],provider:{locales:[...c],async loadLocale(y={}){let d=await g("loadLocale");return typeof d!="function"?{}:d(y)},async setLocale(y={}){let d=await g("setLocale");return typeof d!="function"?{}:d(y)}}}};function F(e,t){return t&&typeof t=="string"?t:`${V(o.currentConfig||{},{resolvePublicAssetURL:K})}core/${e}`}async function xt(){return Array.isArray(o.defaultEnhancers)&&o.defaultEnhancers.length>0?o.defaultEnhancers:(X||(X=import(F("pds-enhancers.js",o.currentConfig?.enhancersURL)).then(t=>{let n=Array.isArray(t?.defaultPDSEnhancers)?t.defaultPDSEnhancers:[];return o.defaultEnhancers=n,n}).catch(t=>{throw X=null,t})),X)}async function Rt(){return typeof o.ask=="function"&&o.ask!==Ze?o.ask:(Y||(Y=import(F("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 Y=null,t})),Y)}async function W(){return typeof o.toast=="function"&&o.toast!==U?o.toast:(Z||(Z=import(F("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 Z=null,t})),Z)}async function Ze(...e){return(await Rt())(...e)}async function U(...e){return(await W())(...e)}U.success=async(...e)=>(await W()).success(...e);U.error=async(...e)=>(await W()).error(...e);U.warning=async(...e)=>(await W()).warning(...e);U.info=async(...e)=>(await W()).info(...e);var He=function(e="log",t,...n){o.log(e,t,...n)};function be(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=>be(n)).filter(n=>n!==void 0);let t={};for(let[n,s]of Object.entries(e)){let c=be(s);c!==void 0&&(t[n]=c)}return t}function Xe(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))Xe(e[n],t);return e}function we(e){return e==null||typeof e!="object"?e:Xe(structuredClone(be(e)))}async function Dt(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=z;o.enums=xe;o.adoptLayers=Pe;o.adoptPrimitives=Ae;o.parse=de;o.createStylesheet=ke;o.isLiveMode=()=>z.isLive;o.ask=Ze;o.toast=U;o.common=ue;o.msg=C;o.str=se;o.configureLocalization=oe;o.loadLocale=qe;o.setLocale=Ve;o.getLocalizationState=Qe;o.createJSONLocalization=Ye;o.i18n={msg:C,str:se,configure:oe,loadLocale:qe,setLocale:Ve,getState:Qe,createJSONLocalization:Ye};o.AutoComplete=null;o.loadAutoComplete=async()=>{if(o.AutoComplete&&typeof o.AutoComplete.connect=="function")return o.AutoComplete;let e=F("pds-autocomplete.js",o.currentConfig?.autoCompleteURL);return Q||(Q=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 Q=null,t})),Q};function et(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 tt(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 ge="pure-ds-theme",x=null,$=null;function Se(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(x&&$){try{typeof x.removeEventListener=="function"?x.removeEventListener("change",$):typeof x.removeListener=="function"&&x.removeListener($)}catch{}x=null,$=null}if(e==="system"&&typeof window<"u"&&window.matchMedia){let t=window.matchMedia("(prefers-color-scheme: dark)"),n=s=>{let c=s?.matches===void 0?t.matches:s.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{}};x=t,$=n,typeof t.addEventListener=="function"?t.addEventListener("change",n):typeof t.addListener=="function"&&t.addListener(n)}}catch{}}var zt=Object.getOwnPropertyDescriptor(o,"theme");zt||Object.defineProperty(o,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(ge)||null}catch{return null}},set(e){try{if(typeof window>"u")return;let t=o.currentConfig?.design||null,n=me(e);if(t&&!Oe(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(ge):localStorage.setItem(ge,e),Se(e),Le(e),o.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:e,source:"api"}}))}catch{}}});o.defaultEnhancers=[];async function Tt(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=we(s);let c=s&&typeof s.localization=="object"&&s.localization?s.localization:null;c?(await I(),oe(c)):oe(null);let r;if(t==="static")r=await Ct(s);else{let{localization:g,...y}=s||{},d=V(y,{resolvePublicAssetURL:K}),a=y?.managerURL||y?.public?.managerURL||y?.manager?.url||new URL("core/pds-manager.js",d).href||new URL("./pds-manager.js",import.meta.url).href,{startLive:i}=await import(a);r=await i(o,y,{emitReady:et,emitConfigChanged:tt,applyResolvedTheme:Se,setupSystemListenerIfNeeded:Le})}o.compiled=we(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=Tt;async function Ct(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",c=e.staticPaths??{},r=V(e,{resolvePublicAssetURL:K}),l=e&&e.autoDefine||null,g;l&&l.baseURL?g=J(q(l.baseURL,{preferModule:!1})):g=`${r}components/`;let y=l&&Array.isArray(l.predefine)&&l.predefine||[],d=l&&typeof l.mapper=="function"&&l.mapper||null;try{Ue(o);let{resolvedTheme:a}=Me({manageTheme:n,themeStorageKey:s,applyResolvedTheme:Se,setupSystemListenerIfNeeded:Le}),i=await Dt(r,e),w=Array.isArray(e?.enhancers)?e.enhancers:e?.enhancers&&typeof e.enhancers=="object"?Object.values(e.enhancers):[],m=i?.config?{...i.config,...e,design:e?.design||i.config.design,preset:e?.preset||i.config.preset}:{...e},_={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`},S=i?.paths||{};if(c={..._,...S,...c},o.registry.setStaticMode(c),t&&typeof document<"u")try{let E=await o.registry.getStylesheet("styles");if(E){E._pds=!0;let h=(document.adoptedStyleSheets||[]).filter(b=>b._pds!==!0);document.adoptedStyleSheets=[...h,E],tt({mode:"static",source:"static:styles-applied"})}}catch(E){He.call(o,"warn","Failed to apply static styles:",E)}let v=null,P=[];try{let E=await xt(),h=await Ne({autoDefineBaseURL:g,autoDefinePreload:y,autoDefineMapper:d,enhancers:w,autoDefineOverrides:l||null,autoDefinePreferModule:!(l&&l.baseURL)},{baseEnhancers:E});v=h.autoDefiner,P=h.mergedEnhancers||[]}catch(E){He.call(o,"error","\u274C Failed to initialize AutoDefiner/Enhancers (static):",E)}return o.compiled=we({mode:"static",...m,theme:a,enhancers:P}),et({mode:"static",config:m,theme:a,autoDefiner:v}),{config:m,theme:a,autoDefiner:v}}catch(a){throw o.dispatchEvent(new CustomEvent("pds:error",{detail:{error:a}})),a}}var Ut=o.createJSONLocalization({locale:"en-US",locales:["en-US","nl-NL"],aliases:{en:["en-US"],nl:["nl-NL"]},basePath:"/assets/locales"}),nt={mode:"live",liveEdit:!0,preset:"default",localization:Ut,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 A={name:"@pure-ds/core",shortname:"pds",version:"0.7.41",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(nt);document.documentElement.lang="en";var ot=typeof A.repository=="string"?A.repository:A.repository?.url,Nt=ot?ot.replace(/^git\+/,"").replace(/\.git$/,""):"",hn=A.homepage||Nt,yn=A.bugs?.url||"";document.body.innerHTML=`
|
|
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 <${h}> not found. Assets may not be installed.`)}else o.log("error",`\u274C Auto-define error for <${h}>:`,b)},..._,mapper:h=>{if(customElements.get(h))return null;if(typeof c=="function")try{let b=c(h);return b===void 0?i(h):b}catch(b){return o.log("warn","Custom autoDefine.mapper error; falling back to default:",b?.message||b),i(h)}return i(h)}};d=new a(E),s.length>0&&typeof a.define=="function"&&await a.define(...s,{baseURL:n,mapper:E.mapper,onError:E.onError})}return{autoDefiner:d,mergedEnhancers:y}}var pe=["light","dark"],fe=new Set(pe);function ht(e){let n=(Array.isArray(e?.themes)?e.themes.map(s=>String(s).toLowerCase()):pe).filter(s=>fe.has(s));return n.length?n:pe}function me(e,{preferDocument:t=!0}={}){let n=String(e||"").toLowerCase();if(fe.has(n))return n;if(t&&typeof document<"u"){let s=document.documentElement?.getAttribute("data-theme");if(fe.has(s))return s}return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Oe(e,t){let n=me(t);return ht(e).includes(n)}var yt=new Set(["log","warn","error","debug","info"]),gt="__PURE_DS_PDS_SINGLETON__",he=null,ye=null;function Ie(){try{let t=(typeof globalThis<"u"?globalThis:window)?.[gt];if(t&&typeof t=="object")return t}catch{return null}return null}function bt(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 wt(e){if(typeof e!="string")return"log";let t=e.toLowerCase();return yt.has(t)?t:"log"}function St(){if(typeof ye=="function")try{let t=bt(ye());if(t)return t}catch{}let e=Ie();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 Lt(){if(typeof he=="function")try{let t=he();if(typeof t=="function")return t}catch{}let e=Ie();return typeof e?.logHandler=="function"?e.logHandler:null}function $e(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 _t(e,t){let n=t?.debug===!0;return!(t?.mode==="static"&&!n||!n&&e!=="error"&&e!=="warn")}function Fe({getLogger:e,getContext:t}={}){he=typeof e=="function"?e:null,ye=typeof t=="function"?t:null}function We(e="log",t,...n){let s=wt(e),c=St(),r=Lt();if(r)try{r.call(c?.thisArg,s,t,...n);return}catch(l){$e("error","Custom log handler failed:",l)}_t(s,c)&&$e(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 Q=null,Y=null,Z=null,X=null,ee=null,te=null,Be="__pdsLocalizationRuntime";function T(){if(te)return te;let e=o?.[Be];return e&&typeof e=="object"?(te=e,e):null}function Et(e){let t=e&&typeof e=="object"?e:null;te=t,o[Be]=t}Fe({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)=>{We(e,t,...n)};var L={locale:"en",messages:{},hasProvider:!1},ne=new Set;function Ke(e){return!!e&&typeof e!="string"&&typeof e=="object"&&"strTag"in e}function Ge(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 vt(e,t){return String(e).replace(/\{(\d+)\}/g,(n,s)=>t(Number(s)))}function jt(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 At(e,...t){return{strTag:!0,strings:Array.from(e||[]),values:t,raw:Array.from(e?.raw||[])}}function Pt(e){if(!e)return"";if(Ke(e)){let n=Ge(e.strings||[]),s=L.messages[n]||n;return vt(s,c=>e.values?.[c])}let t=String(e);return L.messages[t]||t}function kt(e){if(!e)return;let t=Ke(e)?Ge(e.strings||[]):String(e);typeof t=="string"&&t.length>0&&ne.add(t)}function Je(e){if(!e||typeof e.msg!="function"||ne.size===0)return;let t=Array.from(ne);ne.clear();for(let n of t)try{e.msg(n)}catch{}}async function I(){let e=T();return e||(ee||(ee=import(F("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 Et(n),Je(n),n}).catch(n=>{throw ee=null,n})),ee)}var C=(e,t={})=>{let n=T();return typeof n?.msg=="function"?n.msg(e,t):(kt(e),Pt(e,t))},se=(e,...t)=>{let n=T();return typeof n?.str=="function"?n.str(e,...t):At(e,...t)},oe=(e=null)=>{let t=T();if(typeof t?.configureLocalization=="function")return t.configureLocalization(e);if(!e||typeof e!="object")return L.locale="en",L.messages={},L.hasProvider=!1,{locale:L.locale,messages:{...L.messages},hasProvider:L.hasProvider};typeof e.locale=="string"&&e.locale.trim()&&(L.locale=e.locale.trim()),Object.prototype.hasOwnProperty.call(e,"messages")&&(L.messages=jt(e.messages));let n=!!(e.provider||e.translate||e.loadLocale||e.setLocale);return L.hasProvider=n,n&&I().then(s=>{s.configureLocalization(e),Je(s)}).catch(()=>{}),{locale:L.locale,messages:{...L.messages},hasProvider:L.hasProvider}},qe=async e=>(await I()).loadLocale(e),Ve=async(e,t={})=>(await I()).setLocale(e,t),Qe=()=>{let e=T();return typeof e?.getLocalizationState=="function"?e.getLocalizationState():{locale:L.locale,messages:{...L.messages},hasProvider:L.hasProvider}},Ye=(e={})=>{let t=T();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(y=>String(y||"").trim().toLowerCase()).filter(Boolean):[],c=Array.from(new Set([n,...s])),r=null,l=async()=>(r||(r=I().then(y=>typeof y?.createJSONLocalization=="function"?y.createJSONLocalization(e):null).catch(()=>null)),r),g=async(y="loadLocale")=>{let d=await l();if(!d||typeof d!="object")return null;let a=d.provider;if(!a||typeof a!="object")return null;let i=a[y];return typeof i=="function"?i:y==="setLocale"&&typeof a.loadLocale=="function"?a.loadLocale:null};return{locale:n,locales:[...c],provider:{locales:[...c],async loadLocale(y={}){let d=await g("loadLocale");return typeof d!="function"?{}:d(y)},async setLocale(y={}){let d=await g("setLocale");return typeof d!="function"?{}:d(y)}}}};function F(e,t){return t&&typeof t=="string"?t:`${V(o.currentConfig||{},{resolvePublicAssetURL:K})}core/${e}`}async function xt(){return Array.isArray(o.defaultEnhancers)&&o.defaultEnhancers.length>0?o.defaultEnhancers:(X||(X=import(F("pds-enhancers.js",o.currentConfig?.enhancersURL)).then(t=>{let n=Array.isArray(t?.defaultPDSEnhancers)?t.defaultPDSEnhancers:[];return o.defaultEnhancers=n,n}).catch(t=>{throw X=null,t})),X)}async function Rt(){return typeof o.ask=="function"&&o.ask!==Ze?o.ask:(Y||(Y=import(F("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 Y=null,t})),Y)}async function W(){return typeof o.toast=="function"&&o.toast!==U?o.toast:(Z||(Z=import(F("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 Z=null,t})),Z)}async function Ze(...e){return(await Rt())(...e)}async function U(...e){return(await W())(...e)}U.success=async(...e)=>(await W()).success(...e);U.error=async(...e)=>(await W()).error(...e);U.warning=async(...e)=>(await W()).warning(...e);U.info=async(...e)=>(await W()).info(...e);var He=function(e="log",t,...n){o.log(e,t,...n)};function be(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=>be(n)).filter(n=>n!==void 0);let t={};for(let[n,s]of Object.entries(e)){let c=be(s);c!==void 0&&(t[n]=c)}return t}function Xe(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))Xe(e[n],t);return e}function we(e){return e==null||typeof e!="object"?e:Xe(structuredClone(be(e)))}async function Dt(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=z;o.enums=xe;o.adoptLayers=Pe;o.adoptPrimitives=Ae;o.parse=de;o.createStylesheet=ke;o.isLiveMode=()=>z.isLive;o.ask=Ze;o.toast=U;o.common=ue;o.msg=C;o.str=se;o.configureLocalization=oe;o.loadLocale=qe;o.setLocale=Ve;o.getLocalizationState=Qe;o.createJSONLocalization=Ye;o.i18n={msg:C,str:se,configure:oe,loadLocale:qe,setLocale:Ve,getState:Qe,createJSONLocalization:Ye};o.AutoComplete=null;o.loadAutoComplete=async()=>{if(o.AutoComplete&&typeof o.AutoComplete.connect=="function")return o.AutoComplete;let e=F("pds-autocomplete.js",o.currentConfig?.autoCompleteURL);return Q||(Q=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 Q=null,t})),Q};function et(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 tt(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 ge="pure-ds-theme",x=null,$=null;function Se(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(x&&$){try{typeof x.removeEventListener=="function"?x.removeEventListener("change",$):typeof x.removeListener=="function"&&x.removeListener($)}catch{}x=null,$=null}if(e==="system"&&typeof window<"u"&&window.matchMedia){let t=window.matchMedia("(prefers-color-scheme: dark)"),n=s=>{let c=s?.matches===void 0?t.matches:s.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{}};x=t,$=n,typeof t.addEventListener=="function"?t.addEventListener("change",n):typeof t.addListener=="function"&&t.addListener(n)}}catch{}}var zt=Object.getOwnPropertyDescriptor(o,"theme");zt||Object.defineProperty(o,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(ge)||null}catch{return null}},set(e){try{if(typeof window>"u")return;let t=o.currentConfig?.design||null,n=me(e);if(t&&!Oe(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(ge):localStorage.setItem(ge,e),Se(e),Le(e),o.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:e,source:"api"}}))}catch{}}});o.defaultEnhancers=[];async function Tt(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=we(s);let c=s&&typeof s.localization=="object"&&s.localization?s.localization:null;c?(await I(),oe(c)):oe(null);let r;if(t==="static")r=await Ct(s);else{let{localization:g,...y}=s||{},d=V(y,{resolvePublicAssetURL:K}),a=y?.managerURL||y?.public?.managerURL||y?.manager?.url||new URL("core/pds-manager.js",d).href||new URL("./pds-manager.js",import.meta.url).href,{startLive:i}=await import(a);r=await i(o,y,{emitReady:et,emitConfigChanged:tt,applyResolvedTheme:Se,setupSystemListenerIfNeeded:Le})}o.compiled=we(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=Tt;async function Ct(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",c=e.staticPaths??{},r=V(e,{resolvePublicAssetURL:K}),l=e&&e.autoDefine||null,g;l&&l.baseURL?g=J(q(l.baseURL,{preferModule:!1})):g=`${r}components/`;let y=l&&Array.isArray(l.predefine)&&l.predefine||[],d=l&&typeof l.mapper=="function"&&l.mapper||null;try{Ue(o);let{resolvedTheme:a}=Me({manageTheme:n,themeStorageKey:s,applyResolvedTheme:Se,setupSystemListenerIfNeeded:Le}),i=await Dt(r,e),w=Array.isArray(e?.enhancers)?e.enhancers:e?.enhancers&&typeof e.enhancers=="object"?Object.values(e.enhancers):[],m=i?.config?{...i.config,...e,design:e?.design||i.config.design,preset:e?.preset||i.config.preset}:{...e},_={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`},S=i?.paths||{};if(c={..._,...S,...c},o.registry.setStaticMode(c),t&&typeof document<"u")try{let E=await o.registry.getStylesheet("styles");if(E){E._pds=!0;let h=(document.adoptedStyleSheets||[]).filter(b=>b._pds!==!0);document.adoptedStyleSheets=[...h,E],tt({mode:"static",source:"static:styles-applied"})}}catch(E){He.call(o,"warn","Failed to apply static styles:",E)}let v=null,P=[];try{let E=await xt(),h=await Ne({autoDefineBaseURL:g,autoDefinePreload:y,autoDefineMapper:d,enhancers:w,autoDefineOverrides:l||null,autoDefinePreferModule:!(l&&l.baseURL)},{baseEnhancers:E});v=h.autoDefiner,P=h.mergedEnhancers||[]}catch(E){He.call(o,"error","\u274C Failed to initialize AutoDefiner/Enhancers (static):",E)}return o.compiled=we({mode:"static",...m,theme:a,enhancers:P}),et({mode:"static",config:m,theme:a,autoDefiner:v}),{config:m,theme:a,autoDefiner:v}}catch(a){throw o.dispatchEvent(new CustomEvent("pds:error",{detail:{error:a}})),a}}var Ut=o.createJSONLocalization({locale:"en-US",locales:["en-US","nl-NL"],aliases:{en:["en-US"],nl:["nl-NL"]},basePath:"/assets/locales"}),nt={mode:"live",liveEdit:!0,preset:"default",localization:Ut,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 A={name:"@pure-ds/core",shortname:"pds",version:"0.7.46",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(nt);document.documentElement.lang="en";var ot=typeof A.repository=="string"?A.repository:A.repository?.url,Nt=ot?ot.replace(/^git\+/,"").replace(/\.git$/,""):"",hn=A.homepage||Nt,yn=A.bugs?.url||"";document.body.innerHTML=`
|
|
3
3
|
<div class="container text-center">
|
|
4
4
|
<img src="/assets/img/pds-logo.svg" alt="PDS Logo" title="${C("PDS Logo")}" width="64" height="64" />
|
|
5
5
|
<header class="container section">
|