@pure-ds/core 0.6.1 → 0.6.2
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.
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
* keeps its UI in sync with programmatic theme changes.
|
|
4
4
|
*
|
|
5
5
|
* @element pds-theme
|
|
6
|
-
* @attr {string} label - Optional legend text (defaults to "Theme").
|
|
7
6
|
*/
|
|
8
7
|
declare const THEME_OPTIONS: {
|
|
9
8
|
value: string;
|
|
10
9
|
label: string;
|
|
11
10
|
icon: string;
|
|
12
11
|
}[];
|
|
13
|
-
declare const DEFAULT_LABEL: "Theme";
|
|
14
12
|
declare const LAYERS: string[];
|
|
15
13
|
declare const DEFAULT_THEMES: string[];
|
|
16
14
|
declare const VALID_THEMES: Set<string>;
|
|
@@ -18,16 +16,8 @@ declare function normalizePresetThemes(preset: any): any;
|
|
|
18
16
|
declare function resolveThemePreference(preference: any): string;
|
|
19
17
|
declare function isPresetThemeCompatible(preset: any, themePreference: any): any;
|
|
20
18
|
declare class PdsTheme extends HTMLElement {
|
|
21
|
-
static get observedAttributes(): string[];
|
|
22
19
|
connectedCallback(): void;
|
|
23
20
|
disconnectedCallback(): void;
|
|
24
|
-
attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
|
|
25
|
-
set label(value: string);
|
|
26
|
-
/**
|
|
27
|
-
* Gets the legend/aria-label text to display.
|
|
28
|
-
* @returns {string}
|
|
29
|
-
*/
|
|
30
|
-
get label(): string;
|
|
31
21
|
#private;
|
|
32
22
|
}
|
|
33
23
|
//# sourceMappingURL=pds-theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-theme.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-theme.js"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pds-theme.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-theme.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH;;;;IAIE;AAEF,+BAAmE;AACnE,uCAAyC;AACzC,wCAA6C;AAE7C,yDAMC;AAED,iEAeC;AAED,iFAIC;AAED;IAUE,0BAOC;IAED,6BAEC;;CAqHF"}
|
package/package.json
CHANGED
package/public/assets/js/app.js
CHANGED
|
@@ -29,7 +29,7 @@ var Ke=Object.defineProperty;var Ze=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ee=(e,t)=>{
|
|
|
29
29
|
</footer>
|
|
30
30
|
</form>
|
|
31
31
|
`;let u=i.querySelector("#msg-container");re(u,e)}i.addEventListener("click",u=>{u.target.closest('button[value="cancel"]')&&(i.close(),n(!1))});let o=()=>{let u=i.querySelector("form");u?u.addEventListener("submit",p=>{p.preventDefault();let a;t.useForm&&p.submitter.value==="ok"?(console.log("Found form:",u),console.log("Form elements:",u?Array.from(u.elements):"no form"),a=new FormData(u),console.log("FormData entries:",Array.from(a.entries()))):a=p.submitter.value==="ok",i.close(),n(a)}):requestAnimationFrame(o)};o(),i.addEventListener("close",()=>{setTimeout(()=>i.remove(),200)}),document.body.appendChild(i),typeof t.rendered=="function"&&t.rendered(i),i.showModal()})}async function Je(){let e=document.querySelector("pds-toaster");return e||(e=document.createElement("pds-toaster"),document.body.appendChild(e),await customElements.whenDefined("pds-toaster")),e}async function M(e,t={}){return(await Je()).toast(e,t)}M.success=async function(e,t={}){return M(e,{...t,type:"success"})};M.error=async function(e,t={}){return M(e,{...t,type:"error"})};M.warning=async function(e,t={}){return M(e,{...t,type:"warning"})};M.info=async function(e,t={}){return M(e,{...t,type:"information"})};var Ye=[{selector:".accordion"},{selector:"nav[data-dropdown]"},{selector:"label[data-toggle]"},{selector:'input[type="range"]'},{selector:"form[data-required]"},{selector:"fieldset[role=group][data-open]"},{selector:"[data-clip]"},{selector:"button, a[class*='btn-']"}];function Xe(e){e.dataset.enhancedAccordion||(e.dataset.enhancedAccordion="true",e.addEventListener("toggle",t=>{t.target.open&&t.target.parentElement===e&&e.querySelectorAll(":scope > details[open]").forEach(s=>{s!==t.target&&(s.open=!1)})},!0))}function et(e){if(e.dataset.enhancedDropdown)return;e.dataset.enhancedDropdown="true";let t=e.lastElementChild;if(!t)return;let s=e.querySelector("[data-dropdown-toggle]")||e.querySelector("button");s&&!s.hasAttribute("type")&&s.setAttribute("type","button"),t.id||(t.id=`dropdown-${Math.random().toString(36).slice(2,9)}`),t.tagName?.toLowerCase()==="menu"&&!t.hasAttribute("role")&&t.setAttribute("role","menu"),t.hasAttribute("aria-hidden")||t.setAttribute("aria-hidden","true"),s&&(s.setAttribute("aria-haspopup","true"),s.setAttribute("aria-controls",t.id),s.setAttribute("aria-expanded","false"));let i=()=>{let a=(e.getAttribute("data-direction")||e.getAttribute("data-dropdown-direction")||e.getAttribute("data-mode")||"auto").toLowerCase();if(a==="up"||a==="down")return a;let d=e.getBoundingClientRect(),l=t?.getBoundingClientRect?.()||{height:0},h=Math.max(t?.offsetHeight||0,t?.scrollHeight||0,l.height||0,200),m=Math.max(0,window.innerHeight-d.bottom),S=Math.max(0,d.top);return m>=h?"down":S>=h||S>m?"up":"down"},r=()=>{let a=(e.getAttribute("data-align")||e.getAttribute("data-dropdown-align")||"auto").toLowerCase();if(a==="left"||a==="right"||a==="start"||a==="end")return a==="start"?"left":a==="end"?"right":a;let d=e.getBoundingClientRect(),l=t?.getBoundingClientRect?.()||{width:0},h=Math.max(t?.offsetWidth||0,t?.scrollWidth||0,l.width||0,240),m=Math.max(0,window.innerWidth-d.left),S=Math.max(0,d.right);return m>=h?"left":S>=h||S>m?"right":"left"},o=()=>{e.dataset.dropdownDirection=i(),e.dataset.dropdownAlign=r(),t.setAttribute("aria-hidden","false"),s?.setAttribute("aria-expanded","true")},u=()=>{t.setAttribute("aria-hidden","true"),s?.setAttribute("aria-expanded","false")},p=()=>{t.getAttribute("aria-hidden")==="false"?u():o()};s?.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),p()}),document.addEventListener("click",a=>{e.contains(a.target)||u()}),e.addEventListener("keydown",a=>{a.key==="Escape"&&(u(),s?.focus())}),e.addEventListener("focusout",a=>{(!a.relatedTarget||!e.contains(a.relatedTarget))&&u()})}function tt(e){if(e.dataset.enhancedToggle)return;e.dataset.enhancedToggle="true";let t=e.querySelector('input[type="checkbox"]');if(!t)return;e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),e.setAttribute("role","switch"),e.setAttribute("aria-checked",t.checked?"true":"false");let s=document.createElement("span");s.className="toggle-switch",s.setAttribute("role","presentation"),s.setAttribute("aria-hidden","true");let n=document.createElement("span");n.className="toggle-knob",s.appendChild(n),e.insertBefore(s,t.nextSibling);let i=()=>{e.setAttribute("aria-checked",t.checked?"true":"false")},r=()=>{t.disabled||(t.checked=!t.checked,i(),t.dispatchEvent(new Event("change",{bubbles:!0})))};e.addEventListener("click",o=>{o.preventDefault(),r()}),e.addEventListener("keydown",o=>{(o.key===" "||o.key==="Enter")&&(o.preventDefault(),r())}),t.addEventListener("change",i)}function st(e){if(e.dataset.enhancedRange)return;let t=e.closest("label"),s=t?.classList.contains("range-output"),n=e.id||`range-${Math.random().toString(36).substring(2,11)}`,i=`${n}-output`;if(e.id=n,s){let r=t.querySelector("span");if(r&&!r.classList.contains("range-output-wrapper")){let o=document.createElement("span");o.className="range-output-wrapper",o.style.display="flex",o.style.justifyContent="space-between",o.style.alignItems="center";let u=document.createElement("span");u.textContent=r.textContent,o.appendChild(u);let p=document.createElement("output");p.id=i,p.setAttribute("for",n),p.style.color="var(--surface-text-secondary, var(--color-text-secondary))",p.style.fontSize="0.875rem",p.textContent=e.value,o.appendChild(p),r.textContent="",r.appendChild(o);let a=()=>{p.textContent=e.value};e.addEventListener("input",a)}}else{let r=e.closest(".range-container");r||(r=document.createElement("div"),r.className="range-container",e.parentNode?.insertBefore(r,e),r.appendChild(e)),r.style.position="relative";let o=document.createElement("output");o.id=i,o.setAttribute("for",n),o.className="range-bubble",o.setAttribute("aria-live","polite"),r.appendChild(o);let u=()=>{let d=parseFloat(e.min)||0,l=parseFloat(e.max)||100,h=parseFloat(e.value),m=(h-d)/(l-d);o.style.left=`calc(${m*100}% )`,o.textContent=String(h)},p=()=>o.classList.add("visible"),a=()=>o.classList.remove("visible");e.addEventListener("input",u),e.addEventListener("pointerdown",p),e.addEventListener("pointerup",a),e.addEventListener("pointerleave",a),e.addEventListener("focus",p),e.addEventListener("blur",a),u()}e.dataset.enhancedRange="1"}function nt(e){if(e.dataset.enhancedRequired)return;e.dataset.enhancedRequired="true";let t=s=>{let n;if(s.closest("[role$=group]")?n=s.closest("[role$=group]").querySelector("legend"):n=s.closest("label"),!n||n.querySelector(".required-asterisk"))return;let i=document.createElement("span");i.classList.add("required-asterisk"),i.textContent="*",i.style.marginLeft="4px";let r=n.querySelector("span, [data-label]");if(r)r.appendChild(i);else{let u=n.querySelector("input, select, textarea");u?n.insertBefore(i,u):n.appendChild(i)}let o=s.closest("form");if(o&&!o.querySelector(".required-legend")){let u=document.createElement("small");u.classList.add("required-legend"),u.textContent="* Required fields",o.insertBefore(u,o.querySelector(".form-actions")||o.lastElementChild)}};e.querySelectorAll("[required]").forEach(s=>{t(s)})}function rt(e){if(e.dataset.enhancedOpenGroup)return;e.dataset.enhancedOpenGroup="true",e.classList.add("flex","flex-wrap","buttons");let t=document.createElement("input");t.type="text",t.placeholder="Add item...",t.classList.add("input-text","input-sm"),t.style.width="auto";let s=e.querySelector('input[type="radio"], input[type="checkbox"]');e.appendChild(t),t.addEventListener("keydown",n=>{if(n.key==="Enter"||n.key==="Tab"){let i=t.value.trim();if(i){n.preventDefault();let r=s.type==="radio"?"radio":"checkbox",o=`open-group-${Math.random().toString(36).substring(2,11)}`,u=document.createElement("label"),p=document.createElement("span");p.setAttribute("data-label",""),p.textContent=i;let a=document.createElement("input");a.type=r,a.name=s.name||e.getAttribute("data-name")||"open-group",a.value=i,a.id=o,u.appendChild(p),u.appendChild(a),e.insertBefore(u,t),t.value=""}}else if(n.key==="Backspace"&&t.value===""){n.preventDefault();let i=e.querySelectorAll("label");i.length>0&&i[i.length-1].remove()}})}function it(e){if(e.dataset.enhancedClip)return;e.dataset.enhancedClip="true",e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),e.hasAttribute("role")||e.setAttribute("role","button");let t=()=>{let n=e.getAttribute("data-clip-open")==="true";e.setAttribute("aria-expanded",n?"true":"false")},s=()=>{let n=e.getAttribute("data-clip-open")==="true";e.setAttribute("data-clip-open",n?"false":"true"),t()};e.addEventListener("click",n=>{n.defaultPrevented||s()}),e.addEventListener("keydown",n=>{(n.key===" "||n.key==="Enter")&&(n.preventDefault(),s())}),t()}function ot(e){if(e.dataset.enhancedBtnWorking)return;e.dataset.enhancedBtnWorking="true";let t=null,s=!1;new MutationObserver(i=>{i.forEach(r=>{if(r.attributeName==="class"){let o=e.classList.contains("btn-working"),u=e.querySelector("pds-icon");if(o)if(u)t||(t=u.getAttribute("icon")),u.setAttribute("icon","circle-notch");else{let p=document.createElement("pds-icon");p.setAttribute("icon","circle-notch"),p.setAttribute("size","sm"),e.insertBefore(p,e.firstChild),s=!0}else r.oldValue?.includes("btn-working")&&u&&(s?(u.remove(),s=!1):t&&(u.setAttribute("icon",t),t=null))}})}).observe(e,{attributes:!0,attributeFilter:["class"],attributeOldValue:!0})}var at=new Map([[".accordion",Xe],["nav[data-dropdown]",et],["label[data-toggle]",tt],['input[type="range"]',st],["form[data-required]",nt],["fieldset[role=group][data-open]",rt],["[data-clip]",it],["button, a[class*='btn-']",ot]]),ie=Ye.map(e=>({...e,run:at.get(e.selector)||(()=>{})}));var Pe="pds",ct=/^([a-z][a-z0-9+\-.]*:)?\/\//i,ze=/^[a-z]:/i;function H(e=""){return e.endsWith("/")?e:`${e}/`}function lt(e="",t=Pe){let s=e.replace(/\/+$/,"");return new RegExp(`(?:^|/)${t}$`,"i").test(s)?s:`${s}/${t}`}function dt(e){return e.replace(/^\.\/+/,"")}function ut(e){return ze.test(e)?e.replace(ze,"").replace(/^\/+/,""):e}function pt(e){return e.startsWith("public/")?e.substring(7):e}function oe(e,t={}){let s=t.segment||Pe,n=t.defaultRoot||`/assets/${s}/`,i=e?.public&&e.public?.root||e?.static&&e.static?.root||null;if(!i||typeof i!="string")return H(n);let r=i.trim();return r?(r=r.replace(/\\/g,"/"),r=lt(r,s),r=H(r),ct.test(r)?r:(r=dt(r),r=ut(r),r.startsWith("/")||(r=pt(r),r.startsWith("/")||(r=`/${r}`),r=r.replace(/\/+/g,(o,u)=>u===0?o:"/")),H(r))):H(n)}var F="any",le={type:"object",allowUnknown:!1,properties:{id:{type:"string"},name:{type:"string"},tags:{type:"array",items:{type:"string"}},description:{type:"string"},options:{type:"object",allowUnknown:!0},form:{type:"object",allowUnknown:!0},colors:{type:"object",allowUnknown:!1,properties:{primary:{type:"string",relations:{tokens:["--color-primary-*","--color-primary-fill","--color-primary-text","--background-mesh-*"]}},secondary:{type:"string",relations:{tokens:["--color-secondary-*","--color-gray-*","--background-mesh-*"]}},accent:{type:"string",relations:{tokens:["--color-accent-*","--background-mesh-*"]}},background:{type:"string",relations:{tokens:["--color-surface-*","--color-surface-translucent-*","--surface-*-bg","--surface-*-text","--surface-*-text-secondary","--surface-*-text-muted","--surface-*-icon","--surface-*-icon-subtle","--surface-*-shadow","--surface-*-border"]}},success:{type:["string","null"],relations:{tokens:["--color-success-*"]}},warning:{type:["string","null"],relations:{tokens:["--color-warning-*"]}},danger:{type:["string","null"],relations:{tokens:["--color-danger-*"]}},info:{type:["string","null"],relations:{tokens:["--color-info-*"]}},gradientStops:{type:"number"},elevationOpacity:{type:"number",relations:{tokens:["--surface-*-shadow"]}},darkMode:{type:"object",allowUnknown:!0,properties:{background:{type:"string",relations:{theme:"dark",tokens:["--color-surface-*","--color-surface-translucent-*","--surface-*-bg","--surface-*-text","--surface-*-text-secondary","--surface-*-text-muted","--surface-*-icon","--surface-*-icon-subtle","--surface-*-shadow","--surface-*-border"]}},primary:{type:"string",relations:{theme:"dark",tokens:["--color-primary-*","--color-primary-fill","--color-primary-text"]}},secondary:{type:"string",relations:{theme:"dark",tokens:["--color-secondary-*","--color-gray-*"]}},accent:{type:"string",relations:{theme:"dark",tokens:["--color-accent-*"]}}}}}},typography:{type:"object",allowUnknown:!1,properties:{fontFamilyHeadings:{type:"string",relations:{tokens:["--font-family-headings"]}},fontFamilyBody:{type:"string",relations:{tokens:["--font-family-body"]}},fontFamilyMono:{type:"string",relations:{tokens:["--font-family-mono"]}},baseFontSize:{type:"number",relations:{tokens:["--font-size-*"]}},fontScale:{type:"number",relations:{tokens:["--font-size-*"]}},fontWeightLight:{type:["string","number"],relations:{tokens:["--font-weight-light"]}},fontWeightNormal:{type:["string","number"],relations:{tokens:["--font-weight-normal"]}},fontWeightMedium:{type:["string","number"],relations:{tokens:["--font-weight-medium"]}},fontWeightSemibold:{type:["string","number"],relations:{tokens:["--font-weight-semibold"]}},fontWeightBold:{type:["string","number"],relations:{tokens:["--font-weight-bold"]}},lineHeightTight:{type:["string","number"],relations:{tokens:["--font-line-height-tight"]}},lineHeightNormal:{type:["string","number"],relations:{tokens:["--font-line-height-normal"]}},lineHeightRelaxed:{type:["string","number"],relations:{tokens:["--font-line-height-relaxed"]}},letterSpacingTight:{type:"number"},letterSpacingNormal:{type:"number"},letterSpacingWide:{type:"number"}}},spatialRhythm:{type:"object",allowUnknown:!1,properties:{baseUnit:{type:"number",relations:{tokens:["--spacing-*"]}},scaleRatio:{type:"number"},maxSpacingSteps:{type:"number",relations:{tokens:["--spacing-*"]}},containerMaxWidth:{type:["number","string"]},containerPadding:{type:"number"},inputPadding:{type:"number",relations:{rules:[{selectors:["input","textarea","select"],properties:["padding"]}]}},buttonPadding:{type:"number",relations:{rules:[{selectors:["button",".btn"],properties:["padding"]}]}},sectionSpacing:{type:"number",relations:{rules:[{selectors:["section"],properties:["margin","padding"]}]}}}},shape:{type:"object",allowUnknown:!1,properties:{radiusSize:{type:["string","number"],relations:{tokens:["--radius-*"]}},customRadius:{type:["string","number","null"]},borderWidth:{type:["string","number"],relations:{tokens:["--border-width-*"]}}}},behavior:{type:"object",allowUnknown:!1,properties:{transitionSpeed:{type:["string","number"],relations:{tokens:["--transition-*"]}},animationEasing:{type:"string"},customTransitionSpeed:{type:["number","null"]},customEasing:{type:["string","null"]},focusRingWidth:{type:"number",relations:{rules:[{selectors:[":focus-visible"],properties:["outline-width","box-shadow"]}]}},focusRingOpacity:{type:"number",relations:{rules:[{selectors:[":focus-visible"],properties:["box-shadow","outline-color"]}]}},hoverOpacity:{type:"number"}}},layout:{type:"object",allowUnknown:!1,properties:{maxWidth:{type:["number","string"],relations:{tokens:["--layout-max-width","--layout-max-width-*"]}},maxWidths:{type:"object",allowUnknown:!1,properties:{sm:{type:["number","string"],relations:{tokens:["--layout-max-width-sm"]}},md:{type:["number","string"],relations:{tokens:["--layout-max-width-md"]}},lg:{type:["number","string"],relations:{tokens:["--layout-max-width-lg"]}},xl:{type:["number","string"],relations:{tokens:["--layout-max-width-xl"]}}}},containerPadding:{type:["number","string"],relations:{tokens:["--layout-container-padding"]}},breakpoints:{type:"object",allowUnknown:!1,properties:{sm:{type:"number"},md:{type:"number"},lg:{type:"number"},xl:{type:"number"}}},gridColumns:{type:"number"},gridGutter:{type:"number"},densityCompact:{type:"number"},densityNormal:{type:"number"},densityComfortable:{type:"number"},buttonMinHeight:{type:"number"},inputMinHeight:{type:"number"},baseShadowOpacity:{type:"number",relations:{tokens:["--shadow-*"]}},darkMode:{type:"object",allowUnknown:!0,properties:{baseShadowOpacity:{type:"number",relations:{theme:"dark",tokens:["--shadow-*"]}}}},utilities:{type:"object",allowUnknown:!0},gridSystem:{type:"object",allowUnknown:!0},containerMaxWidth:{type:["number","string"]}}},layers:{type:"object",allowUnknown:!1,properties:{baseShadowOpacity:{type:"number",relations:{tokens:["--shadow-*"]}},shadowBlurMultiplier:{type:"number",relations:{tokens:["--shadow-*"]}},shadowOffsetMultiplier:{type:"number",relations:{tokens:["--shadow-*"]}},shadowDepth:{type:"string"},blurLight:{type:"number"},blurMedium:{type:"number"},blurHeavy:{type:"number"},baseZIndex:{type:"number",relations:{tokens:["--z-*"]}},zIndexStep:{type:"number",relations:{tokens:["--z-*"]}},zIndexBase:{type:"number"},zIndexDropdown:{type:"number"},zIndexSticky:{type:"number"},zIndexFixed:{type:"number"},zIndexModal:{type:"number"},zIndexPopover:{type:"number"},zIndexTooltip:{type:"number"},zIndexNotification:{type:"number"},darkMode:{type:"object",allowUnknown:!0,properties:{baseShadowOpacity:{type:"number",relations:{theme:"dark",tokens:["--shadow-*"]}}}}}},advanced:{type:"object",allowUnknown:!0},a11y:{type:"object",allowUnknown:!0},icons:{type:"object",allowUnknown:!1,properties:{set:{type:"string"},weight:{type:"string"},defaultSize:{type:"number",relations:{tokens:["--icon-size"]}},sizes:{type:"object",allowUnknown:!0},spritePath:{type:"string"},externalPath:{type:"string"},include:{type:"object",allowUnknown:!0}}},components:{type:"object",allowUnknown:!0},gap:{type:"number"},debug:{type:"boolean"}}},ht={type:"object",allowUnknown:!0,properties:{mode:{type:"string"},preset:{type:"string"},design:le,enhancers:{type:["object","array"]},applyGlobalStyles:{type:"boolean"},manageTheme:{type:"boolean"},themeStorageKey:{type:"string"},preloadStyles:{type:"boolean"},criticalLayers:{type:"array",items:{type:"string"}},autoDefine:{type:"object",allowUnknown:!1,properties:{predefine:{type:"array",items:{type:"string"}},mapper:{type:F},enhancers:{type:["object","array"]},scanExisting:{type:"boolean"},observeShadows:{type:"boolean"},patchAttachShadow:{type:"boolean"},debounceMs:{type:"number"},onError:{type:F},baseURL:{type:"string"}}},managerURL:{type:"string"},manager:{type:F},liveEdit:{type:"boolean"},log:{type:F}}};function ae(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function ft(e,t){if(t===F)return!0;let s=ae(e);return Array.isArray(t)?t.includes(s):s===t}function Z(e,t,s,n){if(!t)return;let i=t.type||F;if(!ft(e,i)){n.push({path:s,expected:i,actual:ae(e),message:`Expected ${i} but got ${ae(e)}`});return}if(i==="array"&&t.items&&Array.isArray(e)&&e.forEach((r,o)=>{Z(r,t.items,`${s}[${o}]`,n)}),i==="object"&&e&&typeof e=="object"){let r=t.properties||{};for(let[o,u]of Object.entries(e)){if(!Object.prototype.hasOwnProperty.call(r,o)){t.allowUnknown||n.push({path:`${s}.${o}`,expected:"known property",actual:"unknown",message:`Unknown property "${o}"`});continue}Z(u,r[o],`${s}.${o}`,n)}}}function ce(e,t="",s={}){if(!e||typeof e!="object")return s;if(e.relations&&t&&(s[t]=e.relations),e.type==="object"&&e.properties&&Object.entries(e.properties).forEach(([n,i])=>{let r=t?`${t}.${n}`:n;ce(i,r,s)}),e.type==="array"&&e.items){let n=`${t}[]`;ce(e.items,n,s)}return s}var Nt=ce(le,"");function de(e,{log:t,context:s="PDS config"}={}){if(!e||typeof e!="object")return[];let n=[];return Z(e,le,"design",n),n.length&&typeof t=="function"&&n.forEach(i=>{t("warn",`[${s}] ${i.message} at ${i.path}`)}),n}function Ue(e,{log:t,context:s="PDS config"}={}){if(!e||typeof e!="object")return[];let n=[];return Z(e,ht,"config",n),n.length&&typeof t=="function"&&n.forEach(i=>{t("warn",`[${s}] ${i.message} at ${i.path}`)}),n}var mt={"ocean-breeze":{id:"ocean-breeze",name:"Ocean Breeze",tags:["playful"],description:"Fresh and calming ocean-inspired palette with professional undertones",options:{liquidGlassEffects:!0,backgroundMesh:3},colors:{primary:"#0891b2",secondary:"#64748b",accent:"#06b6d4",background:"#f0f9ff",darkMode:{background:"#0c1821",secondary:"#94a3b8",primary:"#0891b2"}},typography:{baseFontSize:17,fontScale:1.5,fontFamilyHeadings:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontFamilyBody:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif'},spatialRhythm:{baseUnit:6,scaleRatio:1.2},shape:{radiusSize:c.RadiusSizes.xxlarge}},"midnight-steel":{id:"midnight-steel",name:"Midnight Steel",description:"Bold industrial aesthetic with sharp contrasts and urban edge",colors:{primary:"#3b82f6",secondary:"#52525b",accent:"#f59e0b",background:"#fafaf9",darkMode:{background:"#18181b",secondary:"#71717a",primary:"#3b82f6"}},typography:{baseFontSize:16,fontScale:1.333,fontFamilyHeadings:"'IBM Plex Sans', system-ui, -apple-system, sans-serif",fontFamilyBody:"'Inter', system-ui, -apple-system, sans-serif",fontWeightSemibold:600},spatialRhythm:{baseUnit:4,scaleRatio:1.25},shape:{radiusSize:c.RadiusSizes.small,borderWidth:c.BorderWidths.thin}},"neural-glow":{id:"neural-glow",name:"Neural Glow",description:"AI-inspired with vibrant purple-blue gradients and futuristic vibes",colors:{primary:"#8b5cf6",secondary:"#6366f1",accent:"#ec4899",background:"#faf5ff",darkMode:{background:"#0f0a1a",secondary:"#818cf8",primary:"#8b5cf6"}},typography:{baseFontSize:16,fontScale:1.618,fontFamilyHeadings:"'Space Grotesk', system-ui, sans-serif",fontFamilyBody:"'Space Grotesk', system-ui, sans-serif"},spatialRhythm:{baseUnit:4,scaleRatio:1.5},shape:{radiusSize:c.RadiusSizes.xlarge,borderWidth:c.BorderWidths.medium},behavior:{transitionSpeed:c.TransitionSpeeds.fast}},"paper-and-ink":{id:"paper-and-ink",name:"Paper & Ink",tags:["app","featured"],themes:["light"],description:"Ultra-minimal design with focus on typography and whitespace",colors:{primary:"#171717",secondary:"#737373",accent:"#525252",background:"#ffffff",darkMode:{background:"#0a0a0a",secondary:"#a3a3a3",primary:"#737373"}},typography:{baseFontSize:18,fontScale:1.333,fontFamilyHeadings:"'Helvetica Neue', 'Arial', sans-serif",fontFamilyBody:"'Georgia', 'Times New Roman', serif",fontWeightNormal:400,fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.2},shape:{radiusSize:c.RadiusSizes.none,borderWidth:c.BorderWidths.thin}},"sunset-paradise":{id:"sunset-paradise",name:"Sunset Paradise",description:"Warm tropical colors evoking golden hour by the beach",options:{liquidGlassEffects:!0,backgroundMesh:2},colors:{primary:"#ea580c",secondary:"#d4a373",accent:"#fb923c",background:"#fffbeb",darkMode:{background:"#1a0f0a",secondary:"#c9a482",primary:"#f97316"}},typography:{baseFontSize:16,fontScale:1.5,fontFamilyHeadings:"'Quicksand', 'Comfortaa', sans-serif",fontFamilyBody:"'Quicksand', 'Comfortaa', sans-serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.5},shape:{radiusSize:c.RadiusSizes.xxlarge,borderWidth:c.BorderWidths.medium}},"retro-wave":{id:"retro-wave",name:"Retro Wave",description:"Nostalgic 80s-inspired palette with neon undertones",colors:{primary:"#c026d3",secondary:"#a78bfa",accent:"#22d3ee",background:"#fef3ff",darkMode:{background:"#1a0a1f",secondary:"#c4b5fd",primary:"#d946ef"}},typography:{baseFontSize:15,fontScale:1.5,fontFamilyHeadings:"'Orbitron', 'Impact', monospace",fontFamilyBody:"'Courier New', 'Courier', monospace",fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.25},shape:{radiusSize:c.RadiusSizes.none,borderWidth:c.BorderWidths.thick},behavior:{transitionSpeed:c.TransitionSpeeds.instant}},"forest-canopy":{id:"forest-canopy",name:"Forest Canopy",description:"Natural earth tones with organic, calming green hues",colors:{primary:"#059669",secondary:"#78716c",accent:"#84cc16",background:"#f0fdf4",darkMode:{background:"#0a1410",secondary:"#a8a29e",primary:"#10b981"}},typography:{baseFontSize:16,fontScale:1.414,fontFamilyHeadings:"'Merriweather Sans', 'Arial', sans-serif",fontFamilyBody:"'Merriweather', 'Georgia', serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.3},shape:{radiusSize:c.RadiusSizes.medium,borderWidth:c.BorderWidths.thin}},"ruby-elegance":{id:"ruby-elegance",name:"Ruby Elegance",description:"Sophisticated palette with rich ruby reds and warm accents",colors:{primary:"#dc2626",secondary:"#9ca3af",accent:"#be123c",background:"#fef2f2",darkMode:{background:"#1b0808",secondary:"#d1d5db",primary:"#ef4444"}},typography:{baseFontSize:17,fontScale:1.5,fontFamilyHeadings:"'Playfair Display', 'Georgia', serif",fontFamilyBody:"'Crimson Text', 'Garamond', serif",fontWeightNormal:400,fontWeightSemibold:600},spatialRhythm:{baseUnit:4,scaleRatio:1.333},shape:{radiusSize:c.RadiusSizes.small,borderWidth:c.BorderWidths.thin}},"desert-dawn":{id:"desert-dawn",name:"Desert Dawn",description:"Sun-baked neutrals with grounded terracotta and cool oasis accents",colors:{primary:"#b45309",secondary:"#a8a29e",accent:"#0ea5a8",background:"#fcf6ef",darkMode:{background:"#12100e",secondary:"#d1d5db",primary:"#f59e0b"}},typography:{baseFontSize:16,fontScale:1.414,fontFamilyHeadings:"'Source Sans Pro', system-ui, -apple-system, sans-serif",fontFamilyBody:"'Source Serif Pro', Georgia, serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.3},shape:{radiusSize:c.RadiusSizes.medium,borderWidth:c.BorderWidths.medium}},"contrast-pro":{id:"contrast-pro",name:"Contrast Pro",description:"Accessibility-first, high-contrast UI with assertive clarity",colors:{primary:"#1f2937",secondary:"#111827",accent:"#eab308",background:"#ffffff",darkMode:{background:"#0b0f14",secondary:"#9ca3af",primary:"#9ca3af"}},typography:{baseFontSize:17,fontScale:1.2,fontFamilyHeadings:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontFamilyBody:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontWeightBold:700},spatialRhythm:{baseUnit:3,scaleRatio:1.2},shape:{radiusSize:c.RadiusSizes.small,borderWidth:c.BorderWidths.thick},behavior:{transitionSpeed:c.TransitionSpeeds.fast,focusRingWidth:4}},"pastel-play":{id:"pastel-play",name:"Pastel Play",themes:["light"],description:"Playful pastels with soft surfaces and friendly rounded shapes",colors:{primary:"#db2777",secondary:"#a78bfa",accent:"#34d399",background:"#fff7fa",darkMode:{background:"#1a1016",secondary:"#c4b5fd",primary:"#ec4899"}},typography:{baseFontSize:16,fontScale:1.333,fontFamilyHeadings:"'Nunito', system-ui, -apple-system, sans-serif",fontFamilyBody:"'Nunito', system-ui, -apple-system, sans-serif",lineHeightRelaxed:c.LineHeights.relaxed},spatialRhythm:{baseUnit:6,scaleRatio:1.4},shape:{radiusSize:c.RadiusSizes.xxlarge,borderWidth:c.BorderWidths.thin},behavior:{transitionSpeed:c.TransitionSpeeds.slow,animationEasing:c.AnimationEasings["ease-out"]}},"brutalist-tech":{id:"brutalist-tech",name:"Brutalist Tech",description:"Stark grayscale with engineered accents and unapologetically bold structure",colors:{primary:"#111111",secondary:"#4b5563",accent:"#06b6d4",background:"#f8fafc",darkMode:{background:"#0c0c0c",secondary:"#9ca3af",primary:"#06b6d4"}},typography:{baseFontSize:15,fontScale:1.25,fontFamilyHeadings:"'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace",fontFamilyBody:"'Inter', system-ui, -apple-system, sans-serif",letterSpacingTight:-.02},spatialRhythm:{baseUnit:4,scaleRatio:1.25},shape:{radiusSize:c.RadiusSizes.none,borderWidth:c.BorderWidths.thick},behavior:{transitionSpeed:c.TransitionSpeeds.instant}},"zen-garden":{id:"zen-garden",name:"Zen Garden",description:"Soft botanicals with contemplative spacing and balanced motion",colors:{primary:"#3f6212",secondary:"#6b7280",accent:"#7c3aed",background:"#f7fbef",darkMode:{background:"#0d130a",secondary:"#a3a3a3",primary:"#84cc16"}},typography:{baseFontSize:17,fontScale:1.414,fontFamilyHeadings:"'Merriweather', Georgia, serif",fontFamilyBody:"'Noto Sans', system-ui, -apple-system, sans-serif"},spatialRhythm:{baseUnit:6,scaleRatio:1.35},shape:{radiusSize:c.RadiusSizes.large,borderWidth:c.BorderWidths.medium},behavior:{transitionSpeed:c.TransitionSpeeds.normal,animationEasing:c.AnimationEasings.ease}},"fitness-pro":{id:"fitness-pro",name:"Fitness Pro",tags:["app","featured"],description:"Health and fitness tracking aesthetic with data-driven dark surfaces and vibrant accent rings",options:{liquidGlassEffects:!0,backgroundMesh:2},colors:{primary:"#e91e63",secondary:"#78909c",accent:"#ab47bc",background:"#fafafa",darkMode:{background:"#1a1d21",secondary:"#78909c",primary:"#0a4ca4"}},typography:{baseFontSize:15,fontScale:1.25,fontFamilyHeadings:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightNormal:c.LineHeights.tight},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerPadding:1.25,sectionSpacing:2.5},shape:{radiusSize:c.RadiusSizes.large,borderWidth:c.BorderWidths.thin},layers:{shadowDepth:"medium",blurMedium:12},behavior:{transitionSpeed:c.TransitionSpeeds.fast,animationEasing:c.AnimationEasings["ease-out"],focusRingWidth:2}},"travel-market":{id:"travel-market",name:"Travel Market",description:"Hospitality marketplace design with clean cards, subtle shadows, and trust-building neutrals",options:{liquidGlassEffects:!0,backgroundMesh:3},colors:{primary:"#d93251",secondary:"#717171",accent:"#144990",background:"#ffffff",darkMode:{background:"#222222",secondary:"#b0b0b0",primary:"#ff5a7a"}},typography:{baseFontSize:16,fontScale:1.2,fontFamilyHeadings:"'Circular', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Circular', system-ui, -apple-system, 'Segoe UI', sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightRelaxed:c.LineHeights.relaxed},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:1440,containerPadding:1.5,sectionSpacing:3},shape:{radiusSize:c.RadiusSizes.medium,borderWidth:c.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:8},behavior:{transitionSpeed:c.TransitionSpeeds.normal,animationEasing:c.AnimationEasings["ease-in-out"],hoverOpacity:.9}},"mobility-app":{id:"mobility-app",name:"Mobility App",tags:["app","featured"],description:"On-demand service platform with bold typography, map-ready colors, and action-driven UI",options:{liquidGlassEffects:!0,backgroundMesh:0},colors:{primary:"#000000",secondary:"#545454",accent:"#06c167",background:"#f6f6f6",darkMode:{background:"#0f0f0f",secondary:"#8a8a8a",primary:"#06c167"}},typography:{baseFontSize:16,fontScale:1.3,fontFamilyHeadings:"'UberMove', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'UberMove', system-ui, -apple-system, 'Segoe UI', sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.25,buttonPadding:1.25,inputPadding:1},shape:{radiusSize:c.RadiusSizes.small,borderWidth:c.BorderWidths.medium},behavior:{transitionSpeed:c.TransitionSpeeds.fast,animationEasing:c.AnimationEasings["ease-out"],focusRingWidth:3},a11y:{minTouchTarget:c.TouchTargetSizes.comfortable,focusStyle:c.FocusStyles.ring}},"fintech-secure":{id:"fintech-secure",name:"Fintech Secure",description:"Financial services app UI with trust-building blues, precise spacing, and security-first design",options:{liquidGlassEffects:!1,backgroundMesh:0},colors:{primary:"#0a2540",secondary:"#425466",accent:"#00d4ff",background:"#f7fafc",darkMode:{background:"#0a1929",secondary:"#8796a5",primary:"#00d4ff"}},typography:{baseFontSize:16,fontScale:1.25,fontFamilyHeadings:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyMono:"'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:1280,sectionSpacing:2.5},shape:{radiusSize:c.RadiusSizes.medium,borderWidth:c.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:6},behavior:{transitionSpeed:c.TransitionSpeeds.fast,animationEasing:c.AnimationEasings["ease-in-out"],focusRingWidth:3,focusRingOpacity:.4},a11y:{minTouchTarget:c.TouchTargetSizes.standard,focusStyle:c.FocusStyles.ring}},"social-feed":{id:"social-feed",name:"Social Feed",tags:["app","featured"],description:"Content-first social platform with minimal chrome, bold actions, and vibrant media presentation",options:{liquidGlassEffects:!0,backgroundMesh:4},colors:{primary:"#1877f2",secondary:"#65676b",accent:"#fe2c55",background:"#ffffff",darkMode:{background:"#18191a",secondary:"#b0b3b8",primary:"#2d88ff"}},typography:{baseFontSize:15,fontScale:1.2,fontFamilyHeadings:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontFamilyBody:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightNormal:c.LineHeights.relaxed},spatialRhythm:{baseUnit:4,scaleRatio:1.25,containerMaxWidth:680,sectionSpacing:1.5},shape:{radiusSize:c.RadiusSizes.medium,borderWidth:c.BorderWidths.thin},behavior:{transitionSpeed:c.TransitionSpeeds.fast,animationEasing:c.AnimationEasings["ease-out"],hoverOpacity:.85}},"enterprise-dash":{id:"enterprise-dash",tags:["app","featured"],name:"Enterprise Dashboard",description:"Data-dense business intelligence app interface with organized hierarchy and professional polish",options:{liquidGlassEffects:!1},colors:{primary:"#0066cc",secondary:"#5f6368",accent:"#1a73e8",background:"#ffffff",success:"#34a853",warning:"#fbbc04",danger:"#ea4335",darkMode:{background:"#202124",secondary:"#9aa0a6",primary:"#8ab4f8"}},typography:{baseFontSize:14,fontScale:1.2,fontFamilyHeadings:"'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyBody:"'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif",fontFamilyMono:"'Roboto Mono', ui-monospace, Consolas, monospace",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeightNormal:c.LineHeights.tight},spatialRhythm:{baseUnit:4,scaleRatio:1.2,containerMaxWidth:1600,containerPadding:1.5,sectionSpacing:2},shape:{radiusSize:c.RadiusSizes.small,borderWidth:c.BorderWidths.thin},layers:{shadowDepth:"light",blurLight:4},behavior:{transitionSpeed:c.TransitionSpeeds.fast,animationEasing:c.AnimationEasings["ease-in-out"],focusRingWidth:2},layout:{densityCompact:.85,gridColumns:12}}};mt.default={id:"default",name:"Default",tags:["app","featured"],description:"Fresh and modern design system with balanced aesthetics and usability",options:{liquidGlassEffects:!0,backgroundMesh:4},form:{options:{widgets:{booleans:"toggle",numbers:"input",selects:"standard"},layouts:{fieldsets:"default",arrays:"default"},enhancements:{icons:!0,datalists:!0,rangeOutput:!0},validation:{showErrors:!0,validateOnChange:!1}}},colors:{primary:"#0e7490",secondary:"#a99b95",accent:"#e54271",background:"#e7e6de",darkMode:{background:"#16171a",secondary:"#8b9199",primary:"#06b6d4"},success:null,warning:"#B38600",danger:null,info:null,gradientStops:3,elevationOpacity:.05},typography:{baseFontSize:16,fontScale:1.2,fontFamilyHeadings:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontFamilyBody:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',fontFamilyMono:'ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace',fontWeightLight:c.FontWeights.light,fontWeightNormal:c.FontWeights.normal,fontWeightMedium:c.FontWeights.medium,fontWeightSemibold:c.FontWeights.semibold,fontWeightBold:c.FontWeights.bold,lineHeightTight:c.LineHeights.tight,lineHeightNormal:c.LineHeights.normal,lineHeightRelaxed:c.LineHeights.relaxed,letterSpacingTight:-.025,letterSpacingNormal:0,letterSpacingWide:.025},spatialRhythm:{baseUnit:4,scaleRatio:1.25,maxSpacingSteps:32,containerMaxWidth:1200,containerPadding:1,inputPadding:.75,buttonPadding:1,sectionSpacing:2},layers:{shadowDepth:"medium",blurLight:4,blurMedium:8,blurHeavy:16,zIndexBase:0,zIndexDropdown:1e3,zIndexSticky:1020,zIndexFixed:1030,zIndexModal:1040,zIndexPopover:1050,zIndexTooltip:1060,zIndexNotification:1070},shape:{radiusSize:c.RadiusSizes.large,borderWidth:c.BorderWidths.medium,customRadius:null},behavior:{transitionSpeed:c.TransitionSpeeds.normal,animationEasing:c.AnimationEasings["ease-out"],customTransitionSpeed:null,customEasing:null,focusRingWidth:3,focusRingOpacity:.3,hoverOpacity:.8},layout:{gridColumns:12,gridGutter:1,baseShadowOpacity:.1,darkMode:{baseShadowOpacity:.25},breakpoints:{sm:640,md:768,lg:1024,xl:1280},densityCompact:.8,densityNormal:1,densityComfortable:1.2,buttonMinHeight:c.TouchTargetSizes.standard,inputMinHeight:40,utilities:{grid:!0,flex:!0,spacing:!0,container:!0},gridSystem:{columns:[1,2,3,4,6],autoFitBreakpoints:{sm:"150px",md:"250px",lg:"350px",xl:"450px"},enableGapUtilities:!0},containerMaxWidth:"1400px",containerPadding:"var(--spacing-6)"},advanced:{linkStyle:c.LinkStyles.inline,colorDerivation:"hsl"},a11y:{minTouchTarget:c.TouchTargetSizes.standard,prefersReducedMotion:!0,focusStyle:c.FocusStyles.ring},icons:{set:"phosphor",weight:"regular",defaultSize:24,externalPath:"/assets/img/icons/",sizes:c.IconSizes,include:{navigation:["arrow-left","arrow-right","arrow-up","arrow-down","arrow-counter-clockwise","caret-left","caret-right","caret-down","caret-up","x","list","list-dashes","dots-three-vertical","dots-three","house","gear","magnifying-glass","funnel","tabs","sidebar"],actions:["plus","minus","check","trash","pencil","floppy-disk","copy","download","upload","share","link","eye","eye-slash","heart","star","bookmark","note-pencil","cursor-click","clipboard","magic-wand","sparkle"],communication:["envelope","bell","bell-ringing","bell-simple","chat-circle","phone","paper-plane-tilt","user","users","user-gear","at"],content:["image","file","file-text","file-css","file-js","folder","folder-open","book-open","camera","video-camera","play","pause","microphone","brackets-curly","code","folder-simple","grid-four","briefcase","chart-line","chart-bar","database","map-pin"],status:["info","warning","check-circle","x-circle","question","shield","shield-check","shield-warning","lock","lock-open","fingerprint","circle-notch"],time:["calendar","clock","timer","hourglass"],commerce:["shopping-cart","credit-card","currency-dollar","tag","receipt","storefront"],formatting:["text-align-left","text-align-center","text-align-right","text-b","text-italic","text-underline","list-bullets","list-numbers","text-aa"],system:["cloud","cloud-arrow-up","cloud-arrow-down","desktop","device-mobile","globe","wifi-high","battery-charging","sun","moon","moon-stars","palette","rocket","feather","square","circle","squares-four","lightning","wrench"]},spritePath:"public/assets/pds/icons/pds-icons.svg"},gap:4,debug:!1};var gt=/^[a-z][a-z0-9+\-.]*:\/\//i,N=(()=>{try{return import.meta.url}catch{return}})(),J=e=>typeof e=="string"&&e.length&&!e.endsWith("/")?`${e}/`:e;function Y(e,t={}){if(!e||gt.test(e))return e;let{preferModule:s=!0}=t,n=()=>{if(!N)return null;try{return new URL(e,N).href}catch{return null}},i=()=>{if(typeof window>"u"||!window.location?.origin)return null;try{return new URL(e,window.location.origin).href}catch{return null}};return(s?n()||i():i()||n())||e}var Fe=(()=>{if(N)try{let e=new URL(N);if(/\/public\/assets\/js\//.test(e.pathname))return new URL("../pds/",N).href}catch{return}})(),_e=!1;function Be(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 he(e={},t={}){if(!t||typeof t!="object")return e;let s=Array.isArray(e)?[...e]:{...e};for(let[n,i]of Object.entries(t))i&&typeof i=="object"&&!Array.isArray(i)?s[n]=he(s[n]&&typeof s[n]=="object"?s[n]:{},i):s[n]=i;return s}function pe(e=""){return String(e).toLowerCase().replace(/&/g," and ").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function I(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=>I(s)).filter(s=>s!==void 0);let t={};for(let s in e)if(e.hasOwnProperty(s)){let n=e[s];if(typeof n!="function"){let i=I(n);i!==void 0&&(t[s]=i)}}return t}function He(e={},t={},{presets:s,defaultLog:n}){let i=e&&typeof e.log=="function"?e.log:n,r=typeof e=="object"&&("colors"in e||"typography"in e||"spatialRhythm"in e||"shape"in e||"behavior"in e||"layout"in e||"advanced"in e||"a11y"in e||"components"in e||"icons"in e),o=e&&e.enhancers;o&&!Array.isArray(o)&&(o=Object.values(o));let u=o??t.enhancers??[],p=e&&e.preset,a=e&&e.design,d=e&&e.icons&&typeof e.icons=="object"?e.icons:null,l="preset"in(e||{})||"design"in(e||{})||"enhancers"in(e||{});e&&typeof e=="object"&&Ue(e,{log:i,context:"PDS.start"});let h,m=null;if(l){a&&typeof a=="object"&&de(a,{log:i,context:"PDS.start"});let S=String(p||"default").toLowerCase(),k=s?.[S]||Object.values(s||{}).find(y=>pe(y.name)===S||String(y.name||"").toLowerCase()===S);if(!k)throw new Error(`PDS preset not found: "${p||"default"}"`);m={id:k.id||pe(k.name),name:k.name||k.id||String(S)};let b=structuredClone(k);if(a&&typeof a=="object"||d){let y=a?I(a):{},g=d?I(d):null,A=g?he(y,{icons:g}):y;b=he(b,structuredClone(A))}let{mode:x,autoDefine:z,applyGlobalStyles:L,manageTheme:T,themeStorageKey:C,preloadStyles:_,criticalLayers:P,managerURL:q,manager:R,preset:D,design:B,enhancers:v,log:U,...f}=e;h={...f,design:b,preset:m.name,log:U||n}}else if(r){de(e,{log:i,context:"PDS.start"});let{log:S,...k}=e;h={design:structuredClone(k),log:S||n}}else{let S=s?.default||Object.values(s||{}).find(k=>pe(k.name)==="default");if(!S)throw new Error("PDS default preset not available");m={id:S.id||"default",name:S.name||"Default"},h={design:structuredClone(S),preset:m.name,log:n}}return{generatorConfig:h,enhancers:u,presetInfo:m}}function Ne({manageTheme:e,themeStorageKey:t,applyResolvedTheme:s,setupSystemListenerIfNeeded:n}){let i="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"?i=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":i=r:i=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return{resolvedTheme:i,storedTheme:r}}function fe(e,{resolvePublicAssetURL:t}){let s=!!(e?.public?.root||e?.static?.root),n=t(e);return!s&&Fe&&(n=Fe),J(Y(n))}async function Oe(e,{baseEnhancers:t=[]}={}){let{autoDefineBaseURL:s="/auto-define/",autoDefinePreload:n=[],autoDefineMapper:i=null,enhancers:r=[],autoDefineOverrides:o=null,autoDefinePreferModule:u=!0}=e,p=(()=>{let d=new Map;return(t||[]).forEach(l=>d.set(l.selector,l)),(r||[]).forEach(l=>d.set(l.selector,l)),Array.from(d.values())})(),a=null;if(typeof window<"u"&&typeof document<"u"){let d=null;try{let b=await Promise.resolve().then(()=>(je(),$e));d=b?.AutoDefiner||b?.default?.AutoDefiner||b?.default||null}catch(b){console.warn("AutoDefiner not available:",b?.message||b)}let l=b=>{switch(b){case"pds-tabpanel":return"pds-tabstrip.js";default:return`${b}.js`}},{mapper:h,...m}=o&&typeof o=="object"?o:{},k={baseURL:s&&J(Y(s,{preferModule:u})),predefine:n,scanExisting:!0,observeShadows:!0,patchAttachShadow:!0,debounceMs:16,enhancers:p,onError:(b,x)=>{if(typeof b=="string"&&b.startsWith("pds-")){let L=["pds-form","pds-drawer"].includes(b),T=x?.message?.includes("#pds/lit")||x?.message?.includes("Failed to resolve module specifier");L&&T?console.error(`\u274C PDS component <${b}> requires Lit but #pds/lit is not in import map.
|
|
32
|
-
See: https://github.com/Pure-Web-Foundation/pure-ds/blob/main/readme.md#lit-components-not-working`):console.warn(`\u26A0\uFE0F PDS component <${b}> not found. Assets may not be installed.`)}else console.error(`\u274C Auto-define error for <${b}>:`,x)},...m,mapper:b=>{if(customElements.get(b))return null;if(typeof i=="function")try{let x=i(b);return x===void 0?l(b):x}catch(x){return console.warn("Custom autoDefine.mapper error; falling back to default:",x?.message||x),l(b)}return l(b)}};d&&(a=new d(k),n.length>0&&typeof d.define=="function"&&await d.define(...n,{baseURL:s,mapper:k.mapper,onError:k.onError}))}return{autoDefiner:a,mergedEnhancers:p}}var me=["light","dark"],ye=new Set(me);function bt(e){let s=(Array.isArray(e?.themes)?e.themes.map(n=>String(n).toLowerCase()):me).filter(n=>ye.has(n));return s.length?s:me}function ge(e,{preferDocument:t=!0}={}){let s=String(e||"").toLowerCase();if(ye.has(s))return s;if(t&&typeof document<"u"){let n=document.documentElement?.getAttribute("data-theme");if(ye.has(n))return n}return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function qe(e,t){let s=ge(t);return bt(e).includes(s)}var Se=class extends EventTarget{},w=new Se;w.initializing=!1;w.currentPreset=null;w.debug=!1;var Ge=(e="")=>String(e).toLowerCase().replace(/&/g," and ").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),be=function(e="log",t,...s){let n=!!(w.registry&&!w.registry.isLive),i=(this?.debug||this?.design?.debug||w.debug||!1)===!0;if(n){if(!w.debug)return}else if(!i&&e!=="error"&&e!=="warn")return;let r=console[e]||console.log;s.length>0?r(t,...s):r(t)};async function wt(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}}w.registry=j;w.enums=c;w.adoptLayers=Te;w.adoptPrimitives=Me;w.parse=se;w.createStylesheet=De;w.isLiveMode=()=>j.isLive;w.ask=We;w.toast=M;w.common=ne;w.AutoComplete=V;function Ve(e){let t=typeof CustomEvent=="function";try{let s=t?new CustomEvent("pds:ready",{detail:e}):new Event("pds:ready");w.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{}}}typeof window<"u"&&(window.PDS=w);var we="pure-ds-theme",W=null,O=null;function ke(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 xe(e){try{if(W&&O){try{typeof W.removeEventListener=="function"?W.removeEventListener("change",O):typeof W.removeListener=="function"&&W.removeListener(O)}catch{}W=null,O=null}if(e==="system"&&typeof window<"u"&&window.matchMedia){let t=window.matchMedia("(prefers-color-scheme: dark)"),s=n=>{let i=n?.matches===void 0?t.matches:n.matches;try{let r=i?"dark":"light";document.documentElement.setAttribute("data-theme",r),w.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,source:"system"}}))}catch{}};W=t,O=s,typeof t.addEventListener=="function"?t.addEventListener("change",s):typeof t.addListener=="function"&&t.addListener(s)}}catch{}}Object.defineProperty(w,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(we)||null}catch{return null}},set(e){try{if(typeof window>"u")return;let t=w.currentConfig?.design||null,s=ge(e);if(t&&!qe(t,s)){let n=t?.name||w.currentPreset?.name||w.currentConfig?.preset||"current preset";console.warn(`PDS theme "${s}" not supported by preset "${n}".`),w.dispatchEvent(new CustomEvent("pds:theme:blocked",{detail:{theme:e,resolvedTheme:s,preset:n}}));return}e==null?localStorage.removeItem(we):localStorage.setItem(we,e),ke(e),xe(e),w.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:e,source:"api"}}))}catch{}}});w.defaultEnhancers=ie;async function St(e){let t=e&&e.mode||"live",{mode:s,...n}=e||{};if(t==="static")return kt(n);let i=fe(n,{resolvePublicAssetURL:oe}),r=n?.managerURL||n?.public?.managerURL||n?.manager?.url||new URL("core/pds-manager.js",i).href||new URL("./pds-manager.js",import.meta.url).href,{startLive:o}=await import(r);return o(w,n,{emitReady:Ve,applyResolvedTheme:ke,setupSystemListenerIfNeeded:xe})}w.start=St;async function kt(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",i=e.staticPaths??{},r=fe(e,{resolvePublicAssetURL:oe}),o=e&&e.autoDefine||null,u;o&&o.baseURL?u=J(Y(o.baseURL,{preferModule:!1})):u=`${r}components/`;let p=o&&Array.isArray(o.predefine)&&o.predefine||[],a=o&&typeof o.mapper=="function"&&o.mapper||null;try{Be(w);let{resolvedTheme:d}=Ne({manageTheme:s,themeStorageKey:n,applyResolvedTheme:ke,setupSystemListenerIfNeeded:xe}),l=await wt(r,e),h=l?.config?.design||l?.design||null,m=l?.config?.preset||l?.preset||"default",S=l?.presetId||Ge(m)||"default",k=h?{[String(S).toLowerCase()]:h,...String(S).toLowerCase()!=="default"?{default:h}:{}}:null,b=e?.design&&typeof e.design=="object"?I(e.design):null,x=Ge(e?.preset||"default")||"default",z=b?{[String(x).toLowerCase()]:b,...String(x).toLowerCase()!=="default"?{default:b}:{}}:null,L=k||e?.presets||z||{};if(!Object.keys(L||{}).length)throw new Error("PDS static mode requires preset data. Run pds:build or provide config.presets/config.design.");let T=l?.config?{...l.config,...e,preset:e?.preset||S,design:b||h||l?.config?.design}:e,C=He(T,{},{presets:L,defaultLog:be}),_=C.enhancers,P={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`},q=l?.paths||{};if(i={...P,...q,...i},w.registry.setStaticMode(i),t&&typeof document<"u")try{let v=await w.registry.getStylesheet("styles");if(v){v._pds=!0;let U=(document.adoptedStyleSheets||[]).filter(f=>f._pds!==!0);document.adoptedStyleSheets=[...U,v]}}catch(v){be.call(w,"warn","Failed to apply static styles:",v)}let R=null,D=[];try{let v=await Oe({autoDefineBaseURL:u,autoDefinePreload:p,autoDefineMapper:a,enhancers:_,autoDefineOverrides:o||null,autoDefinePreferModule:!(o&&o.baseURL)},{baseEnhancers:ie});R=v.autoDefiner,D=v.mergedEnhancers||[]}catch(v){be.call(w,"error","\u274C Failed to initialize AutoDefiner/Enhancers (static):",v)}let B=I(e);return w.currentConfig=Object.freeze({mode:"static",...structuredClone(B),design:structuredClone(C.generatorConfig.design),preset:C.generatorConfig.preset,theme:d,enhancers:D}),Ve({mode:"static",config:C.generatorConfig,theme:d,autoDefiner:R}),{config:C.generatorConfig,theme:d,autoDefiner:R}}catch(d){throw w.dispatchEvent(new CustomEvent("pds:error",{detail:{error:d}})),d}}var E={name:"@pure-ds/core",shortname:"pds",version:"0.6.1",description:"Pure Design System - 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/js/pds.js",module:"./public/assets/js/pds.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-setup-copilot":"packages/pds-cli/bin/pds-setup-copilot.js","pds-init-config":"packages/pds-cli/bin/pds-init-config.js","pds-bootstrap":"packages/pds-cli/bin/pds-bootstrap.js"},exports:{".":{types:"./src/js/pds.d.ts",import:"./public/assets/js/pds.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/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-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:dx":"node packages/pds-cli/bin/pds-dx.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.30"},customElements:"custom-elements.json"};await w.start(Q);var vt=new Date,Et=vt.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}),Qe=typeof E.repository=="string"?E.repository:E.repository?.url,ve=Qe?Qe.replace(/^git\+/,"").replace(/\.git$/,""):"",Lt=E.homepage||ve,At=E.bugs?.url||"";document.body.innerHTML=`
|
|
32
|
+
See: https://github.com/Pure-Web-Foundation/pure-ds/blob/main/readme.md#lit-components-not-working`):console.warn(`\u26A0\uFE0F PDS component <${b}> not found. Assets may not be installed.`)}else console.error(`\u274C Auto-define error for <${b}>:`,x)},...m,mapper:b=>{if(customElements.get(b))return null;if(typeof i=="function")try{let x=i(b);return x===void 0?l(b):x}catch(x){return console.warn("Custom autoDefine.mapper error; falling back to default:",x?.message||x),l(b)}return l(b)}};d&&(a=new d(k),n.length>0&&typeof d.define=="function"&&await d.define(...n,{baseURL:s,mapper:k.mapper,onError:k.onError}))}return{autoDefiner:a,mergedEnhancers:p}}var me=["light","dark"],ye=new Set(me);function bt(e){let s=(Array.isArray(e?.themes)?e.themes.map(n=>String(n).toLowerCase()):me).filter(n=>ye.has(n));return s.length?s:me}function ge(e,{preferDocument:t=!0}={}){let s=String(e||"").toLowerCase();if(ye.has(s))return s;if(t&&typeof document<"u"){let n=document.documentElement?.getAttribute("data-theme");if(ye.has(n))return n}return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function qe(e,t){let s=ge(t);return bt(e).includes(s)}var Se=class extends EventTarget{},w=new Se;w.initializing=!1;w.currentPreset=null;w.debug=!1;var Ge=(e="")=>String(e).toLowerCase().replace(/&/g," and ").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),be=function(e="log",t,...s){let n=!!(w.registry&&!w.registry.isLive),i=(this?.debug||this?.design?.debug||w.debug||!1)===!0;if(n){if(!w.debug)return}else if(!i&&e!=="error"&&e!=="warn")return;let r=console[e]||console.log;s.length>0?r(t,...s):r(t)};async function wt(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}}w.registry=j;w.enums=c;w.adoptLayers=Te;w.adoptPrimitives=Me;w.parse=se;w.createStylesheet=De;w.isLiveMode=()=>j.isLive;w.ask=We;w.toast=M;w.common=ne;w.AutoComplete=V;function Ve(e){let t=typeof CustomEvent=="function";try{let s=t?new CustomEvent("pds:ready",{detail:e}):new Event("pds:ready");w.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{}}}typeof window<"u"&&(window.PDS=w);var we="pure-ds-theme",W=null,O=null;function ke(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 xe(e){try{if(W&&O){try{typeof W.removeEventListener=="function"?W.removeEventListener("change",O):typeof W.removeListener=="function"&&W.removeListener(O)}catch{}W=null,O=null}if(e==="system"&&typeof window<"u"&&window.matchMedia){let t=window.matchMedia("(prefers-color-scheme: dark)"),s=n=>{let i=n?.matches===void 0?t.matches:n.matches;try{let r=i?"dark":"light";document.documentElement.setAttribute("data-theme",r),w.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:r,source:"system"}}))}catch{}};W=t,O=s,typeof t.addEventListener=="function"?t.addEventListener("change",s):typeof t.addListener=="function"&&t.addListener(s)}}catch{}}Object.defineProperty(w,"theme",{get(){try{return typeof window>"u"?null:localStorage.getItem(we)||null}catch{return null}},set(e){try{if(typeof window>"u")return;let t=w.currentConfig?.design||null,s=ge(e);if(t&&!qe(t,s)){let n=t?.name||w.currentPreset?.name||w.currentConfig?.preset||"current preset";console.warn(`PDS theme "${s}" not supported by preset "${n}".`),w.dispatchEvent(new CustomEvent("pds:theme:blocked",{detail:{theme:e,resolvedTheme:s,preset:n}}));return}e==null?localStorage.removeItem(we):localStorage.setItem(we,e),ke(e),xe(e),w.dispatchEvent(new CustomEvent("pds:theme:changed",{detail:{theme:e,source:"api"}}))}catch{}}});w.defaultEnhancers=ie;async function St(e){let t=e&&e.mode||"live",{mode:s,...n}=e||{};if(t==="static")return kt(n);let i=fe(n,{resolvePublicAssetURL:oe}),r=n?.managerURL||n?.public?.managerURL||n?.manager?.url||new URL("core/pds-manager.js",i).href||new URL("./pds-manager.js",import.meta.url).href,{startLive:o}=await import(r);return o(w,n,{emitReady:Ve,applyResolvedTheme:ke,setupSystemListenerIfNeeded:xe})}w.start=St;async function kt(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",i=e.staticPaths??{},r=fe(e,{resolvePublicAssetURL:oe}),o=e&&e.autoDefine||null,u;o&&o.baseURL?u=J(Y(o.baseURL,{preferModule:!1})):u=`${r}components/`;let p=o&&Array.isArray(o.predefine)&&o.predefine||[],a=o&&typeof o.mapper=="function"&&o.mapper||null;try{Be(w);let{resolvedTheme:d}=Ne({manageTheme:s,themeStorageKey:n,applyResolvedTheme:ke,setupSystemListenerIfNeeded:xe}),l=await wt(r,e),h=l?.config?.design||l?.design||null,m=l?.config?.preset||l?.preset||"default",S=l?.presetId||Ge(m)||"default",k=h?{[String(S).toLowerCase()]:h,...String(S).toLowerCase()!=="default"?{default:h}:{}}:null,b=e?.design&&typeof e.design=="object"?I(e.design):null,x=Ge(e?.preset||"default")||"default",z=b?{[String(x).toLowerCase()]:b,...String(x).toLowerCase()!=="default"?{default:b}:{}}:null,L=k||e?.presets||z||{};if(!Object.keys(L||{}).length)throw new Error("PDS static mode requires preset data. Run pds:build or provide config.presets/config.design.");let T=l?.config?{...l.config,...e,preset:e?.preset||S,design:b||h||l?.config?.design}:e,C=He(T,{},{presets:L,defaultLog:be}),_=C.enhancers,P={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`},q=l?.paths||{};if(i={...P,...q,...i},w.registry.setStaticMode(i),t&&typeof document<"u")try{let v=await w.registry.getStylesheet("styles");if(v){v._pds=!0;let U=(document.adoptedStyleSheets||[]).filter(f=>f._pds!==!0);document.adoptedStyleSheets=[...U,v]}}catch(v){be.call(w,"warn","Failed to apply static styles:",v)}let R=null,D=[];try{let v=await Oe({autoDefineBaseURL:u,autoDefinePreload:p,autoDefineMapper:a,enhancers:_,autoDefineOverrides:o||null,autoDefinePreferModule:!(o&&o.baseURL)},{baseEnhancers:ie});R=v.autoDefiner,D=v.mergedEnhancers||[]}catch(v){be.call(w,"error","\u274C Failed to initialize AutoDefiner/Enhancers (static):",v)}let B=I(e);return w.currentConfig=Object.freeze({mode:"static",...structuredClone(B),design:structuredClone(C.generatorConfig.design),preset:C.generatorConfig.preset,theme:d,enhancers:D}),Ve({mode:"static",config:C.generatorConfig,theme:d,autoDefiner:R}),{config:C.generatorConfig,theme:d,autoDefiner:R}}catch(d){throw w.dispatchEvent(new CustomEvent("pds:error",{detail:{error:d}})),d}}var E={name:"@pure-ds/core",shortname:"pds",version:"0.6.2",description:"Pure Design System - 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/js/pds.js",module:"./public/assets/js/pds.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-setup-copilot":"packages/pds-cli/bin/pds-setup-copilot.js","pds-init-config":"packages/pds-cli/bin/pds-init-config.js","pds-bootstrap":"packages/pds-cli/bin/pds-bootstrap.js"},exports:{".":{types:"./src/js/pds.d.ts",import:"./public/assets/js/pds.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/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-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:dx":"node packages/pds-cli/bin/pds-dx.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.30"},customElements:"custom-elements.json"};await w.start(Q);var vt=new Date,Et=vt.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}),Qe=typeof E.repository=="string"?E.repository:E.repository?.url,ve=Qe?Qe.replace(/^git\+/,"").replace(/\.git$/,""):"",Lt=E.homepage||ve,At=E.bugs?.url||"";document.body.innerHTML=`
|
|
33
33
|
<header class="container section">
|
|
34
34
|
<div class="stack-sm">
|
|
35
35
|
<pds-toaster id="global-toaster"></pds-toaster>
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* keeps its UI in sync with programmatic theme changes.
|
|
4
4
|
*
|
|
5
5
|
* @element pds-theme
|
|
6
|
-
* @attr {string} label - Optional legend text (defaults to "Theme").
|
|
7
6
|
*/
|
|
8
7
|
const THEME_OPTIONS = [
|
|
9
8
|
{ value: "system", label: "System", icon: "moon-stars" },
|
|
@@ -11,7 +10,6 @@ const THEME_OPTIONS = [
|
|
|
11
10
|
{ value: "dark", label: "Dark", icon: "moon" },
|
|
12
11
|
];
|
|
13
12
|
|
|
14
|
-
const DEFAULT_LABEL = "Theme";
|
|
15
13
|
const LAYERS = ["tokens", "primitives", "components", "utilities"];
|
|
16
14
|
const DEFAULT_THEMES = ["light", "dark"];
|
|
17
15
|
const VALID_THEMES = new Set(DEFAULT_THEMES);
|
|
@@ -48,9 +46,6 @@ const isPresetThemeCompatible = (preset, themePreference) => {
|
|
|
48
46
|
};
|
|
49
47
|
|
|
50
48
|
class PdsTheme extends HTMLElement {
|
|
51
|
-
static get observedAttributes() {
|
|
52
|
-
return ["label"];
|
|
53
|
-
}
|
|
54
49
|
|
|
55
50
|
#observer;
|
|
56
51
|
#listening = false;
|
|
@@ -65,7 +60,6 @@ class PdsTheme extends HTMLElement {
|
|
|
65
60
|
void this.#setup();
|
|
66
61
|
} else {
|
|
67
62
|
this.#attachObserver();
|
|
68
|
-
this.#syncLegend();
|
|
69
63
|
this.#syncCheckedState();
|
|
70
64
|
}
|
|
71
65
|
}
|
|
@@ -74,29 +68,6 @@ class PdsTheme extends HTMLElement {
|
|
|
74
68
|
this.#teardownObserver();
|
|
75
69
|
}
|
|
76
70
|
|
|
77
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
78
|
-
if (oldValue === newValue) return;
|
|
79
|
-
if (name === "label") {
|
|
80
|
-
this.#syncLegend();
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Gets the legend/aria-label text to display.
|
|
86
|
-
* @returns {string}
|
|
87
|
-
*/
|
|
88
|
-
get label() {
|
|
89
|
-
return this.getAttribute("label")?.trim() || DEFAULT_LABEL;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
set label(value) {
|
|
93
|
-
if (value == null || value === "") {
|
|
94
|
-
this.removeAttribute("label");
|
|
95
|
-
} else {
|
|
96
|
-
this.setAttribute("label", value);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
71
|
async #setup() {
|
|
101
72
|
const componentStyles = PDS.createStylesheet(`
|
|
102
73
|
:host {
|
|
@@ -120,7 +91,6 @@ class PdsTheme extends HTMLElement {
|
|
|
120
91
|
}
|
|
121
92
|
|
|
122
93
|
this.#attachObserver();
|
|
123
|
-
this.#syncLegend();
|
|
124
94
|
this.#syncCheckedState();
|
|
125
95
|
}
|
|
126
96
|
|
|
@@ -138,8 +108,7 @@ class PdsTheme extends HTMLElement {
|
|
|
138
108
|
|
|
139
109
|
return /*html*/`
|
|
140
110
|
<form part="form">
|
|
141
|
-
<fieldset part="fieldset" role="radiogroup"
|
|
142
|
-
<legend part="legend">${DEFAULT_LABEL}</legend>
|
|
111
|
+
<fieldset part="fieldset" role="radiogroup" class="buttons">
|
|
143
112
|
${optionsMarkup}
|
|
144
113
|
</fieldset>
|
|
145
114
|
</form>`;
|
|
@@ -196,13 +165,6 @@ class PdsTheme extends HTMLElement {
|
|
|
196
165
|
this.#observer = undefined;
|
|
197
166
|
}
|
|
198
167
|
|
|
199
|
-
#syncLegend() {
|
|
200
|
-
const legend = this.shadowRoot.querySelector("legend");
|
|
201
|
-
const fieldset = this.shadowRoot.querySelector("fieldset");
|
|
202
|
-
if (legend) legend.textContent = this.label;
|
|
203
|
-
if (fieldset) fieldset.setAttribute("aria-label", this.label);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
168
|
#syncCheckedState() {
|
|
207
169
|
const currentTheme = PDS.theme || "system";
|
|
208
170
|
const currentPreset = PDS.currentConfig?.design || null;
|