boreal-ui 0.0.892 → 0.0.894

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.
Files changed (33) hide show
  1. package/dist/core/{Footer-CmpLvoZb.cjs → Footer-CqEL5lCo.cjs} +1 -1
  2. package/dist/core/{Footer-CoFPqecX.js → Footer-W9ItlBXS.js} +1 -1
  3. package/dist/core/Footer.cjs.js +1 -1
  4. package/dist/core/Footer.js +1 -1
  5. package/dist/core/ThemeContext-BNZ28nPu.cjs +1 -0
  6. package/dist/core/ThemeContext-wbHzxDs2.js +367 -0
  7. package/dist/core/ThemeProvider.cjs.js +1 -1
  8. package/dist/core/ThemeProvider.js +1 -1
  9. package/dist/core/ThemeSelect-B7LNF0B5.cjs +1 -0
  10. package/dist/core/ThemeSelect-C8cxeht_.js +71 -0
  11. package/dist/core/ThemeSelect.cjs.js +1 -1
  12. package/dist/core/ThemeSelect.js +1 -1
  13. package/dist/core/index.cjs.js +1 -1
  14. package/dist/core/index.js +3 -3
  15. package/dist/next/{Footer-D78Lzvjg.js → Footer-1gaUlUeU.js} +1 -1
  16. package/dist/next/Footer.js +1 -1
  17. package/dist/next/{NextThemeProvider-NpALBYoC.js → NextThemeProvider-Dy9dtA1A.js} +1 -1
  18. package/dist/next/ThemeContext-BdDCc3xM.js +367 -0
  19. package/dist/next/ThemeProvider.js +2 -2
  20. package/dist/next/ThemeSelect-8AG_tLAW.js +72 -0
  21. package/dist/next/ThemeSelect.js +1 -1
  22. package/dist/next/index.js +4 -4
  23. package/dist/tsconfig.build.tsbuildinfo +1 -1
  24. package/dist/types/context/ThemeContext.d.ts.map +1 -1
  25. package/dist/types/context/ThemeContext.types.d.ts +5 -1
  26. package/dist/types/context/ThemeContext.types.d.ts.map +1 -1
  27. package/package.json +1 -1
  28. package/dist/core/ThemeContext-D1VVOPG1.cjs +0 -1
  29. package/dist/core/ThemeContext-DRXOWRyX.js +0 -342
  30. package/dist/core/ThemeSelect-CPpf-wbN.cjs +0 -1
  31. package/dist/core/ThemeSelect-DxmyeZm_.js +0 -71
  32. package/dist/next/ThemeContext-19HbcfZg.js +0 -342
  33. package/dist/next/ThemeSelect-BdFqSfT_.js +0 -72
@@ -1 +1 @@
1
- "use strict";require('./Footer.css');const t=require("react/jsx-runtime"),ie=require("./propAliases-Bfsf5cJN.cjs"),Be=require("react"),r=require("./classNames-C7V3kfBj.cjs"),se=require("./boreal-style-config-BB8MdwYx.cjs"),y=require("./capitalize-CnTiekgk.cjs"),Ge=require("./IconButton-O0x6cSnS.cjs"),Re=require("./ThemeSelect-CPpf-wbN.cjs"),k=c=>c.toLowerCase().trim().replace(/\s+/g,"-"),le=({theme:c=se.getDefaultTheme(),glass:v=se.getDefaultGlass(),attachment:ce="static",shadow:S="none",rounding:w="none",layout:m="inline",className:z="","data-testid":me,testId:n=me??"footer",copyright:i,copyrightInBottom:he,links:b=[],sections:q,logo:l,brandTitle:u,brandDescription:B,brandHref:G,brandTarget:R,brandRel:fe,socialLinks:N=[],showThemeSelect:E=!1,themeSelectLabel:be="Theme",bottomEnd:F,contentClassName:L,leftClassName:P,linksClassName:ue,linkClassName:Ne,logoClassName:T,socialClassName:xe,themeToggleClassName:je,brandClassName:_e,brandLinkClassName:U,brandTitleClassName:ge,brandDescriptionClassName:$e,sectionsClassName:Ce,sectionTitleClassName:H,actionsClassName:ye,actionGroupClassName:ve,bottomClassName:Se,bottomCopyrightClassName:we,bottomEndClassName:qe,copyrightClassName:J,IconButton:Fe,ImageComponent:K="img",ThemeSelect:Te,classMap:o,LinkWrapper:O=({href:j,children:_,...A})=>t.jsx("a",{href:j,...A,children:_}),"aria-label":Q,"aria-labelledby":V,"aria-describedby":W,navAriaLabel:X="Footer site links",socialNavAriaLabel:pe="Social media",themeSelectAriaLabel:Y="Theme selector",logoAriaLabel:x="Logo",logoDecorative:d=!1,labelId:f,...Z})=>{const j=ie.resolvePropAlias(ce),_=Be.useMemo(()=>r.combineClassNames(o.footer,o[c],v&&o.glass,m!=="inline"&&o[`layout${y.capitalize(m)}`],S!=="none"&&o[`shadow${y.capitalize(S)}`],w!=="none"&&o[`round${y.capitalize(w)}`],o[`attachment${y.capitalize(j)}`],z),[o,c,v,m,S,w,j,z]),D=typeof l=="string"||(e=>typeof e=="object"&&e!==null&&"src"in e)(l),a=D?typeof l=="string"?{src:l}:l:void 0,p=a==null?void 0:a.src,I=(a==null?void 0:a.width)??20,M=(a==null?void 0:a.height)??20,ee=q&&q.length>0?q:b.length>0?[{title:"Links",links:b,"aria-label":X,testId:"links"}]:[],te=he??m==="columns",oe=()=>D&&p?typeof K=="string"?t.jsx("img",{className:r.combineClassNames(o.logo,T),"data-testid":`${n}-logo`,loading:"lazy",src:p,alt:d?"":x,"aria-hidden":d?!0:void 0,height:M,width:I}):t.jsx(K,{className:r.combineClassNames(o.logo,T),"data-testid":`${n}-logo`,src:p,alt:d?"":x,"aria-hidden":d?!0:void 0,height:M,width:I}):l?t.jsx("span",{className:r.combineClassNames(o.logo,T),role:d?void 0:"img","aria-label":d?void 0:x,"aria-hidden":d?!0:void 0,"data-testid":`${n}-logo`,children:l}):null,re=(e,s,g)=>{const h=k(e.label||e.href||`link-${s}`),$=`${e.href??h}-${s}`,C=r.combineClassNames(o.link,g);return e.disabled?t.jsx("li",{children:t.jsx("span",{className:C,"data-testid":`${n}-link-${h}`,"aria-disabled":"true",title:e.title,children:e.label})},$):t.jsx("li",{children:t.jsx(O,{href:e.href,className:C,"data-testid":`${n}-link-${h}`,"aria-label":e["aria-label"],"aria-current":e["aria-current"],title:e.title,rel:e.rel,target:e.target,children:e.label})},$)},ne=()=>N.length===0?null:t.jsx("nav",{className:r.combineClassNames(o.social,xe),"aria-label":pe,"data-testid":`${n}-social`,children:N.map((e,s)=>t.jsx(Fe,{icon:e.icon,href:e.href,isExternal:e.isExternal??!0,shadow:"none","aria-label":e["aria-label"]??e.title,title:e.tooltip??e.title,theme:"clear",glass:v,disabled:e.disabled,rel:e.rel,target:e.target,"data-testid":`${n}-social-${k(e.title)}`},`${e.href??e.title}-${s}`))}),ae=()=>E?t.jsx("div",{className:r.combineClassNames(o.themeToggle,je),"data-testid":`${n}-theme-select`,"aria-label":Y,children:t.jsx(Te,{theme:"clear",label:be,labelPosition:m==="columns"?"top":"left",shadow:"none","aria-label":Y})}):null,ke=()=>{const e=t.jsxs(t.Fragment,{children:[oe(),u&&t.jsx("span",{className:r.combineClassNames(o.brandTitle,ge),"data-testid":`${n}-brand-title`,children:u})]});return t.jsxs("div",{className:r.combineClassNames(o.brand,_e),"data-testid":`${n}-brand`,children:[G?t.jsx(O,{href:G,className:r.combineClassNames(o.brandLink,U),target:R,rel:fe??(R==="_blank"?"noopener noreferrer":void 0),"aria-label":typeof u=="string"?u:x,children:e}):t.jsx("div",{className:r.combineClassNames(o.brandLink,U),children:e}),B&&t.jsx("p",{className:r.combineClassNames(o.brandDescription,$e),"data-testid":`${n}-brand-description`,children:B}),i&&!te&&t.jsx("div",{className:r.combineClassNames(o.copyright,J),"data-testid":`${n}-copyright`,children:t.jsx("p",{id:f,children:i})})]})},ze=()=>ee.length===0?null:t.jsx("div",{className:r.combineClassNames(o.sections,Ce),"data-testid":`${n}-sections`,children:ee.map((e,s)=>{const g=typeof e.title=="string"?e.title:`section-${s+1}`,h=e.testId??k(g);return t.jsxs("nav",{className:r.combineClassNames(o.section,e.className),"aria-label":e["aria-label"]??`${g} links`,"data-testid":`${n}-section-${h}`,children:[t.jsx("h2",{className:r.combineClassNames(o.sectionTitle,H,e.titleClassName),children:e.title}),t.jsx("ul",{className:r.combineClassNames(o.sectionList,e.listClassName),children:e.links.map(($,C)=>re($,C,e.linkClassName))})]},h)})});return m==="columns"?t.jsxs("footer",{className:_,"data-testid":n,role:"contentinfo","aria-label":Q,"aria-labelledby":V??f,"aria-describedby":W,...Z,children:[t.jsxs("div",{className:r.combineClassNames(o.content,L),children:[ke(),ze(),(N.length>0||E)&&t.jsxs("div",{className:r.combineClassNames(o.actions,ye),"data-testid":`${n}-actions`,children:[N.length>0&&t.jsxs("div",{className:r.combineClassNames(o.actionGroup,ve),children:[t.jsx("h2",{className:r.combineClassNames(o.sectionTitle,H),children:"Connect"}),ne()]}),ae()]})]}),(i||F)&&t.jsxs("div",{className:r.combineClassNames(o.bottom,Se),"data-testid":`${n}-bottom`,children:[i&&te&&t.jsx("p",{id:f,className:r.combineClassNames(o.bottomCopyright,we),"data-testid":`${n}-copyright`,children:i}),F&&t.jsx("div",{className:r.combineClassNames(o.bottomEnd,qe),"data-testid":`${n}-bottom-end`,children:F})]})]}):t.jsx("footer",{className:_,"data-testid":n,role:"contentinfo","aria-label":Q,"aria-labelledby":V??f,"aria-describedby":W,...Z,children:t.jsxs("div",{className:r.combineClassNames(o.content,L),children:[t.jsxs("div",{className:r.combineClassNames(o.left,P),"data-testid":`${n}-left`,children:[oe(),i&&t.jsx("div",{className:r.combineClassNames(o.copyright,J)??r.combineClassNames(o.left,P),"data-testid":`${n}-copyright`,children:t.jsx("p",{id:f,children:i})})]}),b.length>0&&t.jsx("nav",{className:r.combineClassNames(o.links,ue),"aria-label":X,"data-testid":`${n}-nav`,children:t.jsx("ul",{children:b.map((e,s)=>re(e,s,Ne))})}),ae(),ne()]})})};le.displayName="FooterBase";const Ee={footer:"footer",glass:"footer_glass",primary:"footer_primary",secondary:"footer_secondary",tertiary:"footer_tertiary",quaternary:"footer_quaternary",clear:"footer_clear",layoutColumns:"footer_layout-columns",shadowNone:"footer_shadow-None",shadowLight:"footer_shadow-Light",shadowMedium:"footer_shadow-Medium",shadowStrong:"footer_shadow-Strong",shadowIntense:"footer_shadow-Intense",roundNone:"footer_round-None",roundSmall:"footer_round-Small",roundMedium:"footer_round-Medium",roundLarge:"footer_round-Large",attachmentStatic:"footer_attachment-static",attachmentFixed:"footer_attachment-fixed",attachmentSticky:"footer_attachment-sticky",content:"footer_content",logo:"footer_logo",left:"footer_left",links:"footer_links",link:"footer_link",social:"footer_social",themeToggle:"footer_theme-toggle",copyright:"footer_copyright",brand:"footer_brand",brandLink:"footer_brand-link",brandTitle:"footer_brand-title",brandDescription:"footer_brand-description",sections:"footer_sections",section:"footer_section",sectionTitle:"footer_section-title",sectionList:"footer_section-list",actions:"footer_actions",actionGroup:"footer_action-group",bottom:"footer_bottom",bottomCopyright:"footer_bottom-copyright",bottomEnd:"footer_bottom-end"},de=c=>t.jsx(le,{...c,IconButton:Ge.IconButton,ThemeSelect:Re.UserThemeSettings,classMap:ie.expandClassMap(Ee)});de.displayName="Footer";exports.Footer=de;
1
+ "use strict";require('./Footer.css');const t=require("react/jsx-runtime"),ie=require("./propAliases-Bfsf5cJN.cjs"),Be=require("react"),r=require("./classNames-C7V3kfBj.cjs"),se=require("./boreal-style-config-BB8MdwYx.cjs"),y=require("./capitalize-CnTiekgk.cjs"),Ge=require("./IconButton-O0x6cSnS.cjs"),Re=require("./ThemeSelect-B7LNF0B5.cjs"),k=c=>c.toLowerCase().trim().replace(/\s+/g,"-"),le=({theme:c=se.getDefaultTheme(),glass:v=se.getDefaultGlass(),attachment:ce="static",shadow:S="none",rounding:w="none",layout:m="inline",className:z="","data-testid":me,testId:n=me??"footer",copyright:i,copyrightInBottom:he,links:b=[],sections:q,logo:l,brandTitle:u,brandDescription:B,brandHref:G,brandTarget:R,brandRel:fe,socialLinks:N=[],showThemeSelect:E=!1,themeSelectLabel:be="Theme",bottomEnd:F,contentClassName:L,leftClassName:P,linksClassName:ue,linkClassName:Ne,logoClassName:T,socialClassName:xe,themeToggleClassName:je,brandClassName:_e,brandLinkClassName:U,brandTitleClassName:ge,brandDescriptionClassName:$e,sectionsClassName:Ce,sectionTitleClassName:H,actionsClassName:ye,actionGroupClassName:ve,bottomClassName:Se,bottomCopyrightClassName:we,bottomEndClassName:qe,copyrightClassName:J,IconButton:Fe,ImageComponent:K="img",ThemeSelect:Te,classMap:o,LinkWrapper:O=({href:j,children:_,...A})=>t.jsx("a",{href:j,...A,children:_}),"aria-label":Q,"aria-labelledby":V,"aria-describedby":W,navAriaLabel:X="Footer site links",socialNavAriaLabel:pe="Social media",themeSelectAriaLabel:Y="Theme selector",logoAriaLabel:x="Logo",logoDecorative:d=!1,labelId:f,...Z})=>{const j=ie.resolvePropAlias(ce),_=Be.useMemo(()=>r.combineClassNames(o.footer,o[c],v&&o.glass,m!=="inline"&&o[`layout${y.capitalize(m)}`],S!=="none"&&o[`shadow${y.capitalize(S)}`],w!=="none"&&o[`round${y.capitalize(w)}`],o[`attachment${y.capitalize(j)}`],z),[o,c,v,m,S,w,j,z]),D=typeof l=="string"||(e=>typeof e=="object"&&e!==null&&"src"in e)(l),a=D?typeof l=="string"?{src:l}:l:void 0,p=a==null?void 0:a.src,I=(a==null?void 0:a.width)??20,M=(a==null?void 0:a.height)??20,ee=q&&q.length>0?q:b.length>0?[{title:"Links",links:b,"aria-label":X,testId:"links"}]:[],te=he??m==="columns",oe=()=>D&&p?typeof K=="string"?t.jsx("img",{className:r.combineClassNames(o.logo,T),"data-testid":`${n}-logo`,loading:"lazy",src:p,alt:d?"":x,"aria-hidden":d?!0:void 0,height:M,width:I}):t.jsx(K,{className:r.combineClassNames(o.logo,T),"data-testid":`${n}-logo`,src:p,alt:d?"":x,"aria-hidden":d?!0:void 0,height:M,width:I}):l?t.jsx("span",{className:r.combineClassNames(o.logo,T),role:d?void 0:"img","aria-label":d?void 0:x,"aria-hidden":d?!0:void 0,"data-testid":`${n}-logo`,children:l}):null,re=(e,s,g)=>{const h=k(e.label||e.href||`link-${s}`),$=`${e.href??h}-${s}`,C=r.combineClassNames(o.link,g);return e.disabled?t.jsx("li",{children:t.jsx("span",{className:C,"data-testid":`${n}-link-${h}`,"aria-disabled":"true",title:e.title,children:e.label})},$):t.jsx("li",{children:t.jsx(O,{href:e.href,className:C,"data-testid":`${n}-link-${h}`,"aria-label":e["aria-label"],"aria-current":e["aria-current"],title:e.title,rel:e.rel,target:e.target,children:e.label})},$)},ne=()=>N.length===0?null:t.jsx("nav",{className:r.combineClassNames(o.social,xe),"aria-label":pe,"data-testid":`${n}-social`,children:N.map((e,s)=>t.jsx(Fe,{icon:e.icon,href:e.href,isExternal:e.isExternal??!0,shadow:"none","aria-label":e["aria-label"]??e.title,title:e.tooltip??e.title,theme:"clear",glass:v,disabled:e.disabled,rel:e.rel,target:e.target,"data-testid":`${n}-social-${k(e.title)}`},`${e.href??e.title}-${s}`))}),ae=()=>E?t.jsx("div",{className:r.combineClassNames(o.themeToggle,je),"data-testid":`${n}-theme-select`,"aria-label":Y,children:t.jsx(Te,{theme:"clear",label:be,labelPosition:m==="columns"?"top":"left",shadow:"none","aria-label":Y})}):null,ke=()=>{const e=t.jsxs(t.Fragment,{children:[oe(),u&&t.jsx("span",{className:r.combineClassNames(o.brandTitle,ge),"data-testid":`${n}-brand-title`,children:u})]});return t.jsxs("div",{className:r.combineClassNames(o.brand,_e),"data-testid":`${n}-brand`,children:[G?t.jsx(O,{href:G,className:r.combineClassNames(o.brandLink,U),target:R,rel:fe??(R==="_blank"?"noopener noreferrer":void 0),"aria-label":typeof u=="string"?u:x,children:e}):t.jsx("div",{className:r.combineClassNames(o.brandLink,U),children:e}),B&&t.jsx("p",{className:r.combineClassNames(o.brandDescription,$e),"data-testid":`${n}-brand-description`,children:B}),i&&!te&&t.jsx("div",{className:r.combineClassNames(o.copyright,J),"data-testid":`${n}-copyright`,children:t.jsx("p",{id:f,children:i})})]})},ze=()=>ee.length===0?null:t.jsx("div",{className:r.combineClassNames(o.sections,Ce),"data-testid":`${n}-sections`,children:ee.map((e,s)=>{const g=typeof e.title=="string"?e.title:`section-${s+1}`,h=e.testId??k(g);return t.jsxs("nav",{className:r.combineClassNames(o.section,e.className),"aria-label":e["aria-label"]??`${g} links`,"data-testid":`${n}-section-${h}`,children:[t.jsx("h2",{className:r.combineClassNames(o.sectionTitle,H,e.titleClassName),children:e.title}),t.jsx("ul",{className:r.combineClassNames(o.sectionList,e.listClassName),children:e.links.map(($,C)=>re($,C,e.linkClassName))})]},h)})});return m==="columns"?t.jsxs("footer",{className:_,"data-testid":n,role:"contentinfo","aria-label":Q,"aria-labelledby":V??f,"aria-describedby":W,...Z,children:[t.jsxs("div",{className:r.combineClassNames(o.content,L),children:[ke(),ze(),(N.length>0||E)&&t.jsxs("div",{className:r.combineClassNames(o.actions,ye),"data-testid":`${n}-actions`,children:[N.length>0&&t.jsxs("div",{className:r.combineClassNames(o.actionGroup,ve),children:[t.jsx("h2",{className:r.combineClassNames(o.sectionTitle,H),children:"Connect"}),ne()]}),ae()]})]}),(i||F)&&t.jsxs("div",{className:r.combineClassNames(o.bottom,Se),"data-testid":`${n}-bottom`,children:[i&&te&&t.jsx("p",{id:f,className:r.combineClassNames(o.bottomCopyright,we),"data-testid":`${n}-copyright`,children:i}),F&&t.jsx("div",{className:r.combineClassNames(o.bottomEnd,qe),"data-testid":`${n}-bottom-end`,children:F})]})]}):t.jsx("footer",{className:_,"data-testid":n,role:"contentinfo","aria-label":Q,"aria-labelledby":V??f,"aria-describedby":W,...Z,children:t.jsxs("div",{className:r.combineClassNames(o.content,L),children:[t.jsxs("div",{className:r.combineClassNames(o.left,P),"data-testid":`${n}-left`,children:[oe(),i&&t.jsx("div",{className:r.combineClassNames(o.copyright,J)??r.combineClassNames(o.left,P),"data-testid":`${n}-copyright`,children:t.jsx("p",{id:f,children:i})})]}),b.length>0&&t.jsx("nav",{className:r.combineClassNames(o.links,ue),"aria-label":X,"data-testid":`${n}-nav`,children:t.jsx("ul",{children:b.map((e,s)=>re(e,s,Ne))})}),ae(),ne()]})})};le.displayName="FooterBase";const Ee={footer:"footer",glass:"footer_glass",primary:"footer_primary",secondary:"footer_secondary",tertiary:"footer_tertiary",quaternary:"footer_quaternary",clear:"footer_clear",layoutColumns:"footer_layout-columns",shadowNone:"footer_shadow-None",shadowLight:"footer_shadow-Light",shadowMedium:"footer_shadow-Medium",shadowStrong:"footer_shadow-Strong",shadowIntense:"footer_shadow-Intense",roundNone:"footer_round-None",roundSmall:"footer_round-Small",roundMedium:"footer_round-Medium",roundLarge:"footer_round-Large",attachmentStatic:"footer_attachment-static",attachmentFixed:"footer_attachment-fixed",attachmentSticky:"footer_attachment-sticky",content:"footer_content",logo:"footer_logo",left:"footer_left",links:"footer_links",link:"footer_link",social:"footer_social",themeToggle:"footer_theme-toggle",copyright:"footer_copyright",brand:"footer_brand",brandLink:"footer_brand-link",brandTitle:"footer_brand-title",brandDescription:"footer_brand-description",sections:"footer_sections",section:"footer_section",sectionTitle:"footer_section-title",sectionList:"footer_section-list",actions:"footer_actions",actionGroup:"footer_action-group",bottom:"footer_bottom",bottomCopyright:"footer_bottom-copyright",bottomEnd:"footer_bottom-end"},de=c=>t.jsx(le,{...c,IconButton:Ge.IconButton,ThemeSelect:Re.UserThemeSettings,classMap:ie.expandClassMap(Ee)});de.displayName="Footer";exports.Footer=de;
@@ -5,7 +5,7 @@ import { c as o } from "./classNames-Dz0_huu_.js";
5
5
  import { g as Ee, f as Le } from "./boreal-style-config-rYvfCHLY.js";
6
6
  import { c as p } from "./capitalize-D_pj4b3P.js";
7
7
  import { I as Pe } from "./IconButton-Dq8m4yuP.js";
8
- import { U as Ue } from "./ThemeSelect-DxmyeZm_.js";
8
+ import { U as Ue } from "./ThemeSelect-C8cxeht_.js";
9
9
  import './Footer.css';const B = (h) => h.toLowerCase().trim().replace(/\s+/g, "-"), de = ({
10
10
  theme: h = Ee(),
11
11
  glass: F = Le(),
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Footer-CmpLvoZb.cjs");exports.default=e.Footer;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Footer-CqEL5lCo.cjs");exports.default=e.Footer;
@@ -1,4 +1,4 @@
1
- import { F as f } from "./Footer-CoFPqecX.js";
1
+ import { F as f } from "./Footer-W9ItlBXS.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -0,0 +1 @@
1
+ "use strict";const $=require("react/jsx-runtime"),h=require("react"),O=require("./boreal-style-config-BB8MdwYx.cjs"),V=require("./colorSchemes.cjs.js"),w="boreal:selectedSchemeName",I="boreal:theme-change",T=4.5,L=3;function D(t,e=[]){const r=[...t];for(const o of e){const n=r.findIndex(a=>a.name===o.name);n>=0?r[n]=o:r.push(o)}return r}function g(t,e){return e?t.findIndex(r=>r.name===e):-1}function R({customSchemes:t=[],useOnlyCustomSchemes:e=!1}){return e?[...t]:D([...V.defaultColorSchemes],t)}function F(t,{initialSchemeName:e,savedSchemeName:r}){const o=g(t,e),n=g(t,r),a=g(t,O.getDefaultColorSchemeName());return o!==-1?o:n!==-1?n:a!==-1?a:0}function k(t){if(!t)return null;try{return t.getItem(w)}catch{return console.error("Failed to load saved theme name"),null}}function B(t,e){if(!t)return!1;try{return t.getItem(w)===e?!1:(t.setItem(w,e),!0)}catch{return console.error("Failed to save theme name"),!1}}function G(t,e=typeof window>"u"?void 0:window){e&&e.dispatchEvent(new CustomEvent(I,{detail:{schemeName:t}}))}function j(t){const e=t.trim(),r=/^#([\da-f])([\da-f])([\da-f])$/i.exec(e);return r?`#${r[1]}${r[1]}${r[2]}${r[2]}${r[3]}${r[3]}`.toLowerCase():/^#[\da-f]{6}([\da-f]{2})?$/i.exec(e)?e.slice(0,7).toLowerCase():null}function E(t){const e=j(t)??"#000000",r=parseInt(e.slice(1,3),16)/255,o=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255,a=Math.max(r,o,n),i=Math.min(r,o,n);let c=0,l=0;const y=(a+i)/2;if(a!==i){const u=a-i;switch(l=y>.5?u/(2-a-i):u/(a+i),a){case r:c=(o-n)/u+(o<n?6:0);break;case o:c=(n-r)/u+2;break;case n:c=(r-o)/u+4;break}c/=6}return{h:Math.round(c*360),s:Math.round(l*100),l:Math.round(y*100)}}function N(t,e,r){e/=100,r/=100;const o=i=>(i+t/30)%12,n=e*Math.min(r,1-r),a=i=>Math.round(255*(r-n*Math.max(-1,Math.min(o(i)-3,Math.min(9-o(i),1)))));return`#${[a(0),a(8),a(4)].map(i=>i.toString(16).padStart(2,"0")).join("")}`}function v(t,e){const{h:r,s:o,l:n}=E(t);return N(r,o,Math.min(100,Math.max(0,n+e)))}function _(t){const e=j(t)??"#000000",r=[1,3,5].map(o=>{const n=parseInt(e.slice(o,o+2),16)/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)});return .2126*r[0]+.7152*r[1]+.0722*r[2]}function S(t,e){const r=_(t),o=_(e),n=Math.max(r,o),a=Math.min(r,o);return(n+.05)/(a+.05)}function b(t,e,r=T){if(e&&S(t,e)>=r)return e;const o=S(t,"#000000"),n=S(t,"#ffffff");return o>=n?"#000000":"#ffffff"}function K(t,e,r){const o=v(e,r);return S(t,o)>=T?o:e}function A(t,e){const r=e==="#000000"?1:-1;for(let o=30;o>=0;o-=5){const n=v(e,o*r);if(S(t,n)>=T)return n}return e}function p(t,e,r){const o=v(t,r);if(S(o,e)>=T)return o;const{h:n,s:a,l:i}=E(t),c=e==="#ffffff";for(let l=4;l<=48;l+=4){const y=c?Math.max(0,i-l):Math.min(100,i+l),u=N(n,a,y);if(S(u,e)>=T)return u}return t}function M(t,e=14,r=14){const{h:o,s:n,l:a}=E(t),i=a>=50?Math.max(0,a-r):Math.min(100,a+e),c=n>8?Math.max(0,n-8):n,l=N(o,c,i);return S(t,l)>=L?l:b(t,void 0,L)}function U(t){const{primaryColor:e,secondaryColor:r,tertiaryColor:o,quaternaryColor:n,backgroundColor:a,forceTextColor:i}=t,c=b(a,i),l=b(e,i),y=b(r),u=b(o),x=b(n);return{"--primary-color":e,"--primary-color-light":v(e,10),"--primary-color-hover":p(e,l,-10),"--text-color-primary":l,"--text-color-primary-contrast":c,"--text-color":c,"--text-color-light":A(a,c),"--text-color-lighter":A(a,c),"--secondary-color":r,"--secondary-color-light":v(r,10),"--secondary-color-hover":p(r,y,-10),"--text-color-secondary":y,"--tertiary-color":o,"--tertiary-color-light":v(o,10),"--tertiary-color-hover":p(o,u,-10),"--text-color-tertiary":u,"--quaternary-color":n,"--quaternary-color-light":v(n,10),"--quaternary-color-hover":p(n,x,-10),"--text-color-quaternary":x,"--background-color":a,"--background-color-dark":v(a,-10),"--background-color-darker":v(a,-25),"--background-color-light":v(a,10),"--background-color-lighter":v(a,20),"--link-color":c,"--link-hover-color":K(a,c,c==="#ffffff"?-20:20),"--link-hover-color-primary":p(e,l,-10),"--link-hover-color-secondary":p(r,y,-10),"--link-hover-color-tertiary":p(o,u,-10),"--link-hover-color-quaternary":p(n,x,-10),"--focus-outline-color":c,"--divider-color":M(a),"--border-color":M(a),"--border-color-subtle":M(a,10,10),"--border-color-strong":M(a,20,20)}}function W(t,e){for(const[r,o]of Object.entries(e))t.setProperty(r,o)}function X(t,e=document){W(e.documentElement.style,U(t)),e.documentElement.dataset.borealTheme=t.name}function H({customSchemes:t=[],initialSchemeName:e,useOnlyCustomSchemes:r=!1}={}){const o=R({customSchemes:t,useOnlyCustomSchemes:r}),n=O.getDefaultColorSchemeName();return`(function(){try{var s=${JSON.stringify(o).replace(/</g,"\\u003c")};var k=${JSON.stringify(w)};var initial=${JSON.stringify(e??null)};var fallback=${JSON.stringify(n)};var saved=null;try{saved=localStorage.getItem(k)}catch(e){}var name=initial||saved||fallback;var scheme=s.find(function(x){return x.name===name})||s.find(function(x){return x.name===fallback})||s[0];if(!scheme)return;var d=document.documentElement.style;var hex=function(v){v=String(v||"").trim();var m=/^#([\\da-f])([\\da-f])([\\da-f])$/i.exec(v);if(m)return("#"+m[1]+m[1]+m[2]+m[2]+m[3]+m[3]).toLowerCase();return /^#[\\da-f]{6}([\\da-f]{2})?$/i.test(v)?v.slice(0,7).toLowerCase():"#000000"};var lum=function(v){v=hex(v);var r=[1,3,5].map(function(i){var c=parseInt(v.slice(i,i+2),16)/255;return c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4)});return .2126*r[0]+.7152*r[1]+.0722*r[2]};var contrast=function(a,b){var x=lum(a),y=lum(b),l=Math.max(x,y),q=Math.min(x,y);return(l+.05)/(q+.05)};var text=function(bg,preferred,min){min=min||4.5;if(preferred&&contrast(bg,preferred)>=min)return preferred;return contrast(bg,"#000000")>=contrast(bg,"#ffffff")?"#000000":"#ffffff"};var set=function(n,v){d.setProperty(n,v)};var page=text(scheme.backgroundColor,scheme.forceTextColor);set("--primary-color",scheme.primaryColor);set("--secondary-color",scheme.secondaryColor);set("--tertiary-color",scheme.tertiaryColor);set("--quaternary-color",scheme.quaternaryColor);set("--background-color",scheme.backgroundColor);set("--text-color",page);set("--text-color-primary",text(scheme.primaryColor,scheme.forceTextColor));set("--text-color-primary-contrast",page);set("--text-color-secondary",text(scheme.secondaryColor));set("--text-color-tertiary",text(scheme.tertiaryColor));set("--text-color-quaternary",text(scheme.quaternaryColor));set("--link-color",page);set("--focus-outline-color",page);document.documentElement.dataset.borealTheme=scheme.name}catch(e){}})();`}const J=h.createContext(void 0),Y=({children:t,customSchemes:e=[],enableThemeScript:r=!0,initialSchemeName:o,useOnlyCustomSchemes:n=!1})=>{const a=h.useMemo(()=>JSON.stringify(e??[]),[e]),i=h.useMemo(()=>{try{const s=JSON.parse(a);if(Array.isArray(s))return s}catch{console.error("Failed to parse custom schemes")}return[]},[a]),c=h.useMemo(()=>R({customSchemes:i,useOnlyCustomSchemes:n}),[i,n]),l=h.useCallback(s=>{var d,f;const m=F(c,{initialSchemeName:o,savedSchemeName:s});return((d=c[m])==null?void 0:d.name)??((f=c[0])==null?void 0:f.name)??""},[o,c]),[y,u]=h.useState(()=>l(typeof window>"u"?null:k(window.localStorage))),x=h.useMemo(()=>{const s=g(c,y);return s===-1?0:s},[c,y]),z=h.useCallback(s=>{u(m=>{const d=typeof s=="function"?s(m):s;return g(c,d)===-1?m:d})},[c]),P=h.useCallback(s=>{u(m=>{var C;const d=g(c,m),f=typeof s=="function"?s(d===-1?0:d):s;return((C=c[f])==null?void 0:C.name)??m})},[c]);return h.useEffect(()=>{const s=typeof window>"u"?null:k(window.localStorage),m=g(c,s),d=l(s);u(f=>o?d:m!==-1?s:g(c,f)!==-1?f:d)},[o,l,c]),h.useInsertionEffect(()=>{const s=c[x]??c[0];!s||typeof document>"u"||X(s,document)},[x,c]),h.useEffect(()=>{if(typeof window>"u")return;const s=f=>{g(c,f)!==-1&&u(C=>C===f?C:f)},m=f=>{var q;s((q=f.detail)==null?void 0:q.schemeName)},d=f=>{f.key===w&&s(f.newValue)};return window.addEventListener(I,m),window.addEventListener("storage",d),s(k(window.localStorage)),()=>{window.removeEventListener(I,m),window.removeEventListener("storage",d)}},[c]),h.useEffect(()=>{const s=c[x]??c[0];if(!s)return;B(typeof window>"u"?void 0:window.localStorage,s.name)&&G(s.name)},[x,c]),$.jsxs(J.Provider,{value:{selectedScheme:x,selectedSchemeName:y,setSelectedScheme:P,setSelectedSchemeName:z,schemes:c},children:[r?$.jsx("script",{dangerouslySetInnerHTML:{__html:H({customSchemes:i,initialSchemeName:o,useOnlyCustomSchemes:n})},suppressHydrationWarning:!0}):null,t]})};exports.ThemeContext=J;exports.ThemeProvider=Y;exports.getThemeInitializationScript=H;
@@ -0,0 +1,367 @@
1
+ import { jsxs as z, jsx as P } from "react/jsx-runtime";
2
+ import { createContext as F, useMemo as T, useCallback as k, useState as B, useEffect as I, useInsertionEffect as D } from "react";
3
+ import { c as H } from "./boreal-style-config-rYvfCHLY.js";
4
+ import { defaultColorSchemes as G } from "./colorSchemes.js";
5
+ const b = "boreal:selectedSchemeName", N = "boreal:theme-change", w = 4.5, _ = 3;
6
+ function K(t, e = []) {
7
+ const r = [...t];
8
+ for (const o of e) {
9
+ const n = r.findIndex((c) => c.name === o.name);
10
+ n >= 0 ? r[n] = o : r.push(o);
11
+ }
12
+ return r;
13
+ }
14
+ function x(t, e) {
15
+ return e ? t.findIndex((r) => r.name === e) : -1;
16
+ }
17
+ function J({
18
+ customSchemes: t = [],
19
+ useOnlyCustomSchemes: e = !1
20
+ }) {
21
+ return e ? [...t] : K([...G], t);
22
+ }
23
+ function U(t, {
24
+ initialSchemeName: e,
25
+ savedSchemeName: r
26
+ }) {
27
+ const o = x(t, e), n = x(t, r), c = x(t, H());
28
+ return o !== -1 ? o : n !== -1 ? n : c !== -1 ? c : 0;
29
+ }
30
+ function E(t) {
31
+ if (!t) return null;
32
+ try {
33
+ return t.getItem(b);
34
+ } catch {
35
+ return console.error("Failed to load saved theme name"), null;
36
+ }
37
+ }
38
+ function W(t, e) {
39
+ if (!t) return !1;
40
+ try {
41
+ return t.getItem(b) === e ? !1 : (t.setItem(b, e), !0);
42
+ } catch {
43
+ return console.error("Failed to save theme name"), !1;
44
+ }
45
+ }
46
+ function X(t, e = typeof window > "u" ? void 0 : window) {
47
+ e && e.dispatchEvent(
48
+ new CustomEvent(N, {
49
+ detail: { schemeName: t }
50
+ })
51
+ );
52
+ }
53
+ function j(t) {
54
+ const e = t.trim(), r = /^#([\da-f])([\da-f])([\da-f])$/i.exec(e);
55
+ return r ? `#${r[1]}${r[1]}${r[2]}${r[2]}${r[3]}${r[3]}`.toLowerCase() : /^#[\da-f]{6}([\da-f]{2})?$/i.exec(e) ? e.slice(0, 7).toLowerCase() : null;
56
+ }
57
+ function $(t) {
58
+ const e = j(t) ?? "#000000", r = parseInt(e.slice(1, 3), 16) / 255, o = parseInt(e.slice(3, 5), 16) / 255, n = parseInt(e.slice(5, 7), 16) / 255, c = Math.max(r, o, n), i = Math.min(r, o, n);
59
+ let a = 0, l = 0;
60
+ const h = (c + i) / 2;
61
+ if (c !== i) {
62
+ const u = c - i;
63
+ switch (l = h > 0.5 ? u / (2 - c - i) : u / (c + i), c) {
64
+ case r:
65
+ a = (o - n) / u + (o < n ? 6 : 0);
66
+ break;
67
+ case o:
68
+ a = (n - r) / u + 2;
69
+ break;
70
+ case n:
71
+ a = (r - o) / u + 4;
72
+ break;
73
+ }
74
+ a /= 6;
75
+ }
76
+ return {
77
+ h: Math.round(a * 360),
78
+ s: Math.round(l * 100),
79
+ l: Math.round(h * 100)
80
+ };
81
+ }
82
+ function L(t, e, r) {
83
+ e /= 100, r /= 100;
84
+ const o = (i) => (i + t / 30) % 12, n = e * Math.min(r, 1 - r), c = (i) => Math.round(
85
+ 255 * (r - n * Math.max(-1, Math.min(o(i) - 3, Math.min(9 - o(i), 1))))
86
+ );
87
+ return `#${[c(0), c(8), c(4)].map((i) => i.toString(16).padStart(2, "0")).join("")}`;
88
+ }
89
+ function y(t, e) {
90
+ const { h: r, s: o, l: n } = $(t);
91
+ return L(r, o, Math.min(100, Math.max(0, n + e)));
92
+ }
93
+ function A(t) {
94
+ const e = j(t) ?? "#000000", r = [1, 3, 5].map((o) => {
95
+ const n = parseInt(e.slice(o, o + 2), 16) / 255;
96
+ return n <= 0.03928 ? n / 12.92 : Math.pow((n + 0.055) / 1.055, 2.4);
97
+ });
98
+ return 0.2126 * r[0] + 0.7152 * r[1] + 0.0722 * r[2];
99
+ }
100
+ function g(t, e) {
101
+ const r = A(t), o = A(e), n = Math.max(r, o), c = Math.min(r, o);
102
+ return (n + 0.05) / (c + 0.05);
103
+ }
104
+ function C(t, e, r = w) {
105
+ if (e && g(t, e) >= r)
106
+ return e;
107
+ const o = g(t, "#000000"), n = g(t, "#ffffff");
108
+ return o >= n ? "#000000" : "#ffffff";
109
+ }
110
+ function Y(t, e, r) {
111
+ const o = y(e, r);
112
+ return g(t, o) >= w ? o : e;
113
+ }
114
+ function O(t, e) {
115
+ const r = e === "#000000" ? 1 : -1;
116
+ for (let o = 30; o >= 0; o -= 5) {
117
+ const n = y(e, o * r);
118
+ if (g(t, n) >= w)
119
+ return n;
120
+ }
121
+ return e;
122
+ }
123
+ function p(t, e, r) {
124
+ const o = y(t, r);
125
+ if (g(o, e) >= w)
126
+ return o;
127
+ const { h: n, s: c, l: i } = $(t), a = e === "#ffffff";
128
+ for (let l = 4; l <= 48; l += 4) {
129
+ const h = a ? Math.max(0, i - l) : Math.min(100, i + l), u = L(n, c, h);
130
+ if (g(u, e) >= w)
131
+ return u;
132
+ }
133
+ return t;
134
+ }
135
+ function M(t, e = 14, r = 14) {
136
+ const { h: o, s: n, l: c } = $(t), i = c >= 50 ? Math.max(0, c - r) : Math.min(100, c + e), a = n > 8 ? Math.max(0, n - 8) : n, l = L(o, a, i);
137
+ return g(t, l) >= _ ? l : C(t, void 0, _);
138
+ }
139
+ function Q(t) {
140
+ const {
141
+ primaryColor: e,
142
+ secondaryColor: r,
143
+ tertiaryColor: o,
144
+ quaternaryColor: n,
145
+ backgroundColor: c,
146
+ forceTextColor: i
147
+ } = t, a = C(c, i), l = C(e, i), h = C(r), u = C(o), v = C(n);
148
+ return {
149
+ "--primary-color": e,
150
+ "--primary-color-light": y(e, 10),
151
+ "--primary-color-hover": p(
152
+ e,
153
+ l,
154
+ -10
155
+ ),
156
+ "--text-color-primary": l,
157
+ "--text-color-primary-contrast": a,
158
+ "--text-color": a,
159
+ "--text-color-light": O(c, a),
160
+ "--text-color-lighter": O(
161
+ c,
162
+ a
163
+ ),
164
+ "--secondary-color": r,
165
+ "--secondary-color-light": y(r, 10),
166
+ "--secondary-color-hover": p(
167
+ r,
168
+ h,
169
+ -10
170
+ ),
171
+ "--text-color-secondary": h,
172
+ "--tertiary-color": o,
173
+ "--tertiary-color-light": y(o, 10),
174
+ "--tertiary-color-hover": p(
175
+ o,
176
+ u,
177
+ -10
178
+ ),
179
+ "--text-color-tertiary": u,
180
+ "--quaternary-color": n,
181
+ "--quaternary-color-light": y(n, 10),
182
+ "--quaternary-color-hover": p(
183
+ n,
184
+ v,
185
+ -10
186
+ ),
187
+ "--text-color-quaternary": v,
188
+ "--background-color": c,
189
+ "--background-color-dark": y(c, -10),
190
+ "--background-color-darker": y(c, -25),
191
+ "--background-color-light": y(c, 10),
192
+ "--background-color-lighter": y(c, 20),
193
+ "--link-color": a,
194
+ "--link-hover-color": Y(
195
+ c,
196
+ a,
197
+ a === "#ffffff" ? -20 : 20
198
+ ),
199
+ "--link-hover-color-primary": p(
200
+ e,
201
+ l,
202
+ -10
203
+ ),
204
+ "--link-hover-color-secondary": p(
205
+ r,
206
+ h,
207
+ -10
208
+ ),
209
+ "--link-hover-color-tertiary": p(
210
+ o,
211
+ u,
212
+ -10
213
+ ),
214
+ "--link-hover-color-quaternary": p(
215
+ n,
216
+ v,
217
+ -10
218
+ ),
219
+ "--focus-outline-color": a,
220
+ "--divider-color": M(c),
221
+ "--border-color": M(c),
222
+ "--border-color-subtle": M(c, 10, 10),
223
+ "--border-color-strong": M(c, 20, 20)
224
+ };
225
+ }
226
+ function Z(t, e) {
227
+ for (const [r, o] of Object.entries(e))
228
+ t.setProperty(r, o);
229
+ }
230
+ function ee(t, e = document) {
231
+ Z(
232
+ e.documentElement.style,
233
+ Q(t)
234
+ ), e.documentElement.dataset.borealTheme = t.name;
235
+ }
236
+ function te({
237
+ customSchemes: t = [],
238
+ initialSchemeName: e,
239
+ useOnlyCustomSchemes: r = !1
240
+ } = {}) {
241
+ const o = J({ customSchemes: t, useOnlyCustomSchemes: r }), n = H();
242
+ return `(function(){try{var s=${JSON.stringify(o).replace(/</g, "\\u003c")};var k=${JSON.stringify(b)};var initial=${JSON.stringify(e ?? null)};var fallback=${JSON.stringify(n)};var saved=null;try{saved=localStorage.getItem(k)}catch(e){}var name=initial||saved||fallback;var scheme=s.find(function(x){return x.name===name})||s.find(function(x){return x.name===fallback})||s[0];if(!scheme)return;var d=document.documentElement.style;var hex=function(v){v=String(v||"").trim();var m=/^#([\\da-f])([\\da-f])([\\da-f])$/i.exec(v);if(m)return("#"+m[1]+m[1]+m[2]+m[2]+m[3]+m[3]).toLowerCase();return /^#[\\da-f]{6}([\\da-f]{2})?$/i.test(v)?v.slice(0,7).toLowerCase():"#000000"};var lum=function(v){v=hex(v);var r=[1,3,5].map(function(i){var c=parseInt(v.slice(i,i+2),16)/255;return c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4)});return .2126*r[0]+.7152*r[1]+.0722*r[2]};var contrast=function(a,b){var x=lum(a),y=lum(b),l=Math.max(x,y),q=Math.min(x,y);return(l+.05)/(q+.05)};var text=function(bg,preferred,min){min=min||4.5;if(preferred&&contrast(bg,preferred)>=min)return preferred;return contrast(bg,"#000000")>=contrast(bg,"#ffffff")?"#000000":"#ffffff"};var set=function(n,v){d.setProperty(n,v)};var page=text(scheme.backgroundColor,scheme.forceTextColor);set("--primary-color",scheme.primaryColor);set("--secondary-color",scheme.secondaryColor);set("--tertiary-color",scheme.tertiaryColor);set("--quaternary-color",scheme.quaternaryColor);set("--background-color",scheme.backgroundColor);set("--text-color",page);set("--text-color-primary",text(scheme.primaryColor,scheme.forceTextColor));set("--text-color-primary-contrast",page);set("--text-color-secondary",text(scheme.secondaryColor));set("--text-color-tertiary",text(scheme.tertiaryColor));set("--text-color-quaternary",text(scheme.quaternaryColor));set("--link-color",page);set("--focus-outline-color",page);document.documentElement.dataset.borealTheme=scheme.name}catch(e){}})();`;
243
+ }
244
+ const re = F(
245
+ void 0
246
+ ), se = ({
247
+ children: t,
248
+ customSchemes: e = [],
249
+ enableThemeScript: r = !0,
250
+ initialSchemeName: o,
251
+ useOnlyCustomSchemes: n = !1
252
+ }) => {
253
+ const c = T(
254
+ () => JSON.stringify(e ?? []),
255
+ [e]
256
+ ), i = T(() => {
257
+ try {
258
+ const s = JSON.parse(c);
259
+ if (Array.isArray(s))
260
+ return s;
261
+ } catch {
262
+ console.error("Failed to parse custom schemes");
263
+ }
264
+ return [];
265
+ }, [c]), a = T(
266
+ () => J({
267
+ customSchemes: i,
268
+ useOnlyCustomSchemes: n
269
+ }),
270
+ [i, n]
271
+ ), l = k(
272
+ (s) => {
273
+ var f, d;
274
+ const m = U(a, {
275
+ initialSchemeName: o,
276
+ savedSchemeName: s
277
+ });
278
+ return ((f = a[m]) == null ? void 0 : f.name) ?? ((d = a[0]) == null ? void 0 : d.name) ?? "";
279
+ },
280
+ [o, a]
281
+ ), [h, u] = B(
282
+ () => l(
283
+ typeof window > "u" ? null : E(window.localStorage)
284
+ )
285
+ ), v = T(() => {
286
+ const s = x(a, h);
287
+ return s === -1 ? 0 : s;
288
+ }, [a, h]), R = k(
289
+ (s) => {
290
+ u((m) => {
291
+ const f = typeof s == "function" ? s(m) : s;
292
+ return x(a, f) === -1 ? m : f;
293
+ });
294
+ },
295
+ [a]
296
+ ), V = k(
297
+ (s) => {
298
+ u((m) => {
299
+ var S;
300
+ const f = x(a, m), d = typeof s == "function" ? s(f === -1 ? 0 : f) : s;
301
+ return ((S = a[d]) == null ? void 0 : S.name) ?? m;
302
+ });
303
+ },
304
+ [a]
305
+ );
306
+ return I(() => {
307
+ const s = typeof window > "u" ? null : E(window.localStorage), m = x(a, s), f = l(s);
308
+ u((d) => o ? f : m !== -1 ? s : x(a, d) !== -1 ? d : f);
309
+ }, [o, l, a]), D(() => {
310
+ const s = a[v] ?? a[0];
311
+ !s || typeof document > "u" || ee(s, document);
312
+ }, [v, a]), I(() => {
313
+ if (typeof window > "u") return;
314
+ const s = (d) => {
315
+ x(a, d) !== -1 && u(
316
+ (S) => S === d ? S : d
317
+ );
318
+ }, m = (d) => {
319
+ var q;
320
+ s((q = d.detail) == null ? void 0 : q.schemeName);
321
+ }, f = (d) => {
322
+ d.key === b && s(d.newValue);
323
+ };
324
+ return window.addEventListener(N, m), window.addEventListener("storage", f), s(E(window.localStorage)), () => {
325
+ window.removeEventListener(N, m), window.removeEventListener("storage", f);
326
+ };
327
+ }, [a]), I(() => {
328
+ const s = a[v] ?? a[0];
329
+ if (!s) return;
330
+ W(
331
+ typeof window > "u" ? void 0 : window.localStorage,
332
+ s.name
333
+ ) && X(s.name);
334
+ }, [v, a]), /* @__PURE__ */ z(
335
+ re.Provider,
336
+ {
337
+ value: {
338
+ selectedScheme: v,
339
+ selectedSchemeName: h,
340
+ setSelectedScheme: V,
341
+ setSelectedSchemeName: R,
342
+ schemes: a
343
+ },
344
+ children: [
345
+ r ? /* @__PURE__ */ P(
346
+ "script",
347
+ {
348
+ dangerouslySetInnerHTML: {
349
+ __html: te({
350
+ customSchemes: i,
351
+ initialSchemeName: o,
352
+ useOnlyCustomSchemes: n
353
+ })
354
+ },
355
+ suppressHydrationWarning: !0
356
+ }
357
+ ) : null,
358
+ t
359
+ ]
360
+ }
361
+ );
362
+ };
363
+ export {
364
+ re as T,
365
+ se as a,
366
+ te as g
367
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ThemeContext-D1VVOPG1.cjs");exports.ThemeContext=e.ThemeContext;exports.ThemeProvider=e.ThemeProvider;exports.getThemeInitializationScript=e.getThemeInitializationScript;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ThemeContext-BNZ28nPu.cjs");exports.ThemeContext=e.ThemeContext;exports.ThemeProvider=e.ThemeProvider;exports.getThemeInitializationScript=e.getThemeInitializationScript;
@@ -1,4 +1,4 @@
1
- import { T as a, a as i, g as o } from "./ThemeContext-DRXOWRyX.js";
1
+ import { T as a, a as i, g as o } from "./ThemeContext-wbHzxDs2.js";
2
2
  export {
3
3
  a as ThemeContext,
4
4
  i as ThemeProvider,
@@ -0,0 +1 @@
1
+ "use strict";const s=require("react/jsx-runtime"),a=require("react"),M=require("./Select-BkErbR5B.cjs"),P=require("./ThemeContext-BNZ28nPu.cjs"),r=require("./boreal-style-config-BB8MdwYx.cjs"),o=a.forwardRef(({theme:l=r.getDefaultTheme(),glass:c,shadow:d=r.getDefaultShadow(),rounding:m=r.getDefaultRounding(),"data-testid":h,testId:u=h??"theme-select",state:S="","aria-label":b="Select Theme","aria-description":g,"aria-labelledby":f,"aria-describedby":x,"aria-invalid":T,"aria-required":q,disabled:C,label:p,labelPosition:v,name:y,id:w},N)=>{const i=a.useContext(P.ThemeContext);if(!i)throw new Error("ThemeContext is undefined. Wrap with ThemeProvider.");const{selectedSchemeName:R,setSelectedSchemeName:j,schemes:t}=i,D=a.useMemo(()=>t.map(e=>({value:e.name,label:e.name})),[t]),U=e=>{const n=String(e);t.some(E=>E.name===n)&&j(n)};return s.jsx("div",{className:"control-container",children:s.jsx(M.Select,{ref:N,theme:l,glass:c,state:S,shadow:d,rounding:m,options:D,"data-testid":u,value:R,"aria-label":b,"aria-description":g,"aria-labelledby":f,"aria-describedby":x,"aria-invalid":T,"aria-required":q,disabled:C,label:p,labelPosition:v,name:y,id:w,onChange:U})})});o.displayName="UserThemeSettings";exports.UserThemeSettings=o;
@@ -0,0 +1,71 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { forwardRef as q, useContext as R, useMemo as j } from "react";
3
+ import { S as E } from "./Select-BtEKKotT.js";
4
+ import { T as M } from "./ThemeContext-wbHzxDs2.js";
5
+ import { g as P, a as W, b as k } from "./boreal-style-config-rYvfCHLY.js";
6
+ const z = q(
7
+ ({
8
+ theme: n = P(),
9
+ glass: o,
10
+ shadow: s = W(),
11
+ rounding: m = k(),
12
+ "data-testid": l,
13
+ testId: d = l ?? "theme-select",
14
+ state: c = "",
15
+ "aria-label": h = "Select Theme",
16
+ "aria-description": f,
17
+ "aria-labelledby": u,
18
+ "aria-describedby": b,
19
+ "aria-invalid": p,
20
+ "aria-required": g,
21
+ disabled: S,
22
+ label: T,
23
+ labelPosition: x,
24
+ name: v,
25
+ id: C
26
+ }, w) => {
27
+ const t = R(M);
28
+ if (!t)
29
+ throw new Error("ThemeContext is undefined. Wrap with ThemeProvider.");
30
+ const { selectedSchemeName: y, setSelectedSchemeName: N, schemes: a } = t, D = j(
31
+ () => a.map((e) => ({
32
+ value: e.name,
33
+ label: e.name
34
+ })),
35
+ [a]
36
+ );
37
+ return /* @__PURE__ */ i("div", { className: "control-container", children: /* @__PURE__ */ i(
38
+ E,
39
+ {
40
+ ref: w,
41
+ theme: n,
42
+ glass: o,
43
+ state: c,
44
+ shadow: s,
45
+ rounding: m,
46
+ options: D,
47
+ "data-testid": d,
48
+ value: y,
49
+ "aria-label": h,
50
+ "aria-description": f,
51
+ "aria-labelledby": u,
52
+ "aria-describedby": b,
53
+ "aria-invalid": p,
54
+ "aria-required": g,
55
+ disabled: S,
56
+ label: T,
57
+ labelPosition: x,
58
+ name: v,
59
+ id: C,
60
+ onChange: (e) => {
61
+ const r = String(e);
62
+ a.some((U) => U.name === r) && N(r);
63
+ }
64
+ }
65
+ ) });
66
+ }
67
+ );
68
+ z.displayName = "UserThemeSettings";
69
+ export {
70
+ z as U
71
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./ThemeSelect-CPpf-wbN.cjs");exports.default=e.UserThemeSettings;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./ThemeSelect-B7LNF0B5.cjs");exports.default=e.UserThemeSettings;
@@ -1,4 +1,4 @@
1
- import { U as f } from "./ThemeSelect-DxmyeZm_.js";
1
+ import { U as f } from "./ThemeSelect-C8cxeht_.js";
2
2
  export {
3
3
  f as default
4
4
  };