boreal-ui 0.0.895 → 0.0.896
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/{Footer-DJQW1MAv.js → Footer-Dxs6VCx2.js} +1 -1
- package/dist/core/{Footer-fVAC2wLQ.cjs → Footer-Z9Cs3krN.cjs} +1 -1
- package/dist/core/Footer.cjs.js +1 -1
- package/dist/core/Footer.js +1 -1
- package/dist/core/ThemeContext-B0vk0hrb.js +369 -0
- package/dist/core/ThemeContext-DBR6j3a_.cjs +1 -0
- package/dist/core/ThemeProvider.cjs.js +1 -1
- package/dist/core/ThemeProvider.js +1 -1
- package/dist/core/ThemeSelect-BEv_eHJd.js +71 -0
- package/dist/core/ThemeSelect-CM4xjgiQ.cjs +1 -0
- package/dist/core/ThemeSelect.cjs.js +1 -1
- package/dist/core/ThemeSelect.js +1 -1
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.js +3 -3
- package/dist/next/{Footer-DnQ6E77x.js → Footer-DOGVKSwV.js} +1 -1
- package/dist/next/Footer.js +1 -1
- package/dist/next/{NextThemeProvider-CcZFLACX.js → NextThemeProvider-IAS5JBZT.js} +1 -1
- package/dist/next/ThemeContext-FCHH6fgj.js +369 -0
- package/dist/next/ThemeProvider.js +2 -2
- package/dist/next/ThemeSelect--AgFD0mK.js +72 -0
- package/dist/next/ThemeSelect.js +1 -1
- package/dist/next/index.js +4 -4
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/Select/ThemeSelect/core/ThemeSelect.d.ts.map +1 -1
- package/dist/types/components/Select/ThemeSelect/next/ThemeSelect.d.ts.map +1 -1
- package/dist/types/context/ThemeContext.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/core/ThemeContext-BGLAV7uR.js +0 -368
- package/dist/core/ThemeContext-CTeDRtLE.cjs +0 -1
- package/dist/core/ThemeSelect-DGeevrTb.js +0 -74
- package/dist/core/ThemeSelect-gy2SszvH.cjs +0 -1
- package/dist/next/ThemeContext-DiGDDpfQ.js +0 -368
- package/dist/next/ThemeSelect-Cjr3IPGx.js +0 -75
|
@@ -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-
|
|
8
|
+
import { U as Ue } from "./ThemeSelect-BEv_eHJd.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";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-
|
|
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-CM4xjgiQ.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;
|
package/dist/core/Footer.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Footer-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Footer-Z9Cs3krN.cjs");exports.default=e.Footer;
|
package/dist/core/Footer.js
CHANGED
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { jsxs as F, jsx as D } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as G, useMemo as I, useState as O, useCallback as E, useInsertionEffect as K, useEffect as L, useLayoutEffect as U } from "react";
|
|
3
|
+
import { c as j } from "./boreal-style-config-rYvfCHLY.js";
|
|
4
|
+
import { defaultColorSchemes as W } from "./colorSchemes.js";
|
|
5
|
+
const b = "boreal:selectedSchemeName", $ = "boreal:theme-change", T = 4.5, H = 3;
|
|
6
|
+
function X(t, e = []) {
|
|
7
|
+
const r = [...t];
|
|
8
|
+
for (const o of e) {
|
|
9
|
+
const n = r.findIndex((a) => a.name === o.name);
|
|
10
|
+
n >= 0 ? r[n] = o : r.push(o);
|
|
11
|
+
}
|
|
12
|
+
return r;
|
|
13
|
+
}
|
|
14
|
+
function v(t, e) {
|
|
15
|
+
return e ? t.findIndex((r) => r.name === e) : -1;
|
|
16
|
+
}
|
|
17
|
+
function V({
|
|
18
|
+
customSchemes: t = [],
|
|
19
|
+
useOnlyCustomSchemes: e = !1
|
|
20
|
+
}) {
|
|
21
|
+
return e ? [...t] : X([...W], t);
|
|
22
|
+
}
|
|
23
|
+
function Y(t, {
|
|
24
|
+
initialSchemeName: e,
|
|
25
|
+
savedSchemeName: r
|
|
26
|
+
}) {
|
|
27
|
+
const o = v(t, e), n = v(t, r), a = v(t, j());
|
|
28
|
+
return o !== -1 ? o : n !== -1 ? n : a !== -1 ? a : 0;
|
|
29
|
+
}
|
|
30
|
+
function N(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 Q(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 Z(t, e = typeof window > "u" ? void 0 : window) {
|
|
47
|
+
e && e.dispatchEvent(
|
|
48
|
+
new CustomEvent($, {
|
|
49
|
+
detail: { schemeName: t }
|
|
50
|
+
})
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function z(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 q(t) {
|
|
58
|
+
const e = z(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);
|
|
59
|
+
let l = 0, u = 0;
|
|
60
|
+
const c = (a + i) / 2;
|
|
61
|
+
if (a !== i) {
|
|
62
|
+
const f = a - i;
|
|
63
|
+
switch (u = c > 0.5 ? f / (2 - a - i) : f / (a + i), a) {
|
|
64
|
+
case r:
|
|
65
|
+
l = (o - n) / f + (o < n ? 6 : 0);
|
|
66
|
+
break;
|
|
67
|
+
case o:
|
|
68
|
+
l = (n - r) / f + 2;
|
|
69
|
+
break;
|
|
70
|
+
case n:
|
|
71
|
+
l = (r - o) / f + 4;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
l /= 6;
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
h: Math.round(l * 360),
|
|
78
|
+
s: Math.round(u * 100),
|
|
79
|
+
l: Math.round(c * 100)
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function _(t, e, r) {
|
|
83
|
+
e /= 100, r /= 100;
|
|
84
|
+
const o = (i) => (i + t / 30) % 12, n = e * Math.min(r, 1 - r), a = (i) => Math.round(
|
|
85
|
+
255 * (r - n * Math.max(-1, Math.min(o(i) - 3, Math.min(9 - o(i), 1))))
|
|
86
|
+
);
|
|
87
|
+
return `#${[a(0), a(8), a(4)].map((i) => i.toString(16).padStart(2, "0")).join("")}`;
|
|
88
|
+
}
|
|
89
|
+
function y(t, e) {
|
|
90
|
+
const { h: r, s: o, l: n } = q(t);
|
|
91
|
+
return _(r, o, Math.min(100, Math.max(0, n + e)));
|
|
92
|
+
}
|
|
93
|
+
function R(t) {
|
|
94
|
+
const e = z(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 p(t, e) {
|
|
101
|
+
const r = R(t), o = R(e), n = Math.max(r, o), a = Math.min(r, o);
|
|
102
|
+
return (n + 0.05) / (a + 0.05);
|
|
103
|
+
}
|
|
104
|
+
function w(t, e, r = T) {
|
|
105
|
+
if (e && p(t, e) >= r)
|
|
106
|
+
return e;
|
|
107
|
+
const o = p(t, "#000000"), n = p(t, "#ffffff");
|
|
108
|
+
return o >= n ? "#000000" : "#ffffff";
|
|
109
|
+
}
|
|
110
|
+
function ee(t, e, r) {
|
|
111
|
+
const o = y(e, r);
|
|
112
|
+
return p(t, o) >= T ? o : e;
|
|
113
|
+
}
|
|
114
|
+
function J(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 (p(t, n) >= T)
|
|
119
|
+
return n;
|
|
120
|
+
}
|
|
121
|
+
return e;
|
|
122
|
+
}
|
|
123
|
+
function x(t, e, r) {
|
|
124
|
+
const o = y(t, r);
|
|
125
|
+
if (p(o, e) >= T)
|
|
126
|
+
return o;
|
|
127
|
+
const { h: n, s: a, l: i } = q(t), l = e === "#ffffff";
|
|
128
|
+
for (let u = 4; u <= 48; u += 4) {
|
|
129
|
+
const c = l ? Math.max(0, i - u) : Math.min(100, i + u), f = _(n, a, c);
|
|
130
|
+
if (p(f, e) >= T)
|
|
131
|
+
return f;
|
|
132
|
+
}
|
|
133
|
+
return t;
|
|
134
|
+
}
|
|
135
|
+
function k(t, e = 14, r = 14) {
|
|
136
|
+
const { h: o, s: n, l: a } = q(t), i = a >= 50 ? Math.max(0, a - r) : Math.min(100, a + e), l = n > 8 ? Math.max(0, n - 8) : n, u = _(o, l, i);
|
|
137
|
+
return p(t, u) >= H ? u : w(t, void 0, H);
|
|
138
|
+
}
|
|
139
|
+
function te(t) {
|
|
140
|
+
const {
|
|
141
|
+
primaryColor: e,
|
|
142
|
+
secondaryColor: r,
|
|
143
|
+
tertiaryColor: o,
|
|
144
|
+
quaternaryColor: n,
|
|
145
|
+
backgroundColor: a,
|
|
146
|
+
forceTextColor: i
|
|
147
|
+
} = t, l = w(a, i), u = w(e, i), c = w(r), f = w(o), g = w(n);
|
|
148
|
+
return {
|
|
149
|
+
"--primary-color": e,
|
|
150
|
+
"--primary-color-light": y(e, 10),
|
|
151
|
+
"--primary-color-hover": x(
|
|
152
|
+
e,
|
|
153
|
+
u,
|
|
154
|
+
-10
|
|
155
|
+
),
|
|
156
|
+
"--text-color-primary": u,
|
|
157
|
+
"--text-color-primary-contrast": l,
|
|
158
|
+
"--text-color": l,
|
|
159
|
+
"--text-color-light": J(a, l),
|
|
160
|
+
"--text-color-lighter": J(
|
|
161
|
+
a,
|
|
162
|
+
l
|
|
163
|
+
),
|
|
164
|
+
"--secondary-color": r,
|
|
165
|
+
"--secondary-color-light": y(r, 10),
|
|
166
|
+
"--secondary-color-hover": x(
|
|
167
|
+
r,
|
|
168
|
+
c,
|
|
169
|
+
-10
|
|
170
|
+
),
|
|
171
|
+
"--text-color-secondary": c,
|
|
172
|
+
"--tertiary-color": o,
|
|
173
|
+
"--tertiary-color-light": y(o, 10),
|
|
174
|
+
"--tertiary-color-hover": x(
|
|
175
|
+
o,
|
|
176
|
+
f,
|
|
177
|
+
-10
|
|
178
|
+
),
|
|
179
|
+
"--text-color-tertiary": f,
|
|
180
|
+
"--quaternary-color": n,
|
|
181
|
+
"--quaternary-color-light": y(n, 10),
|
|
182
|
+
"--quaternary-color-hover": x(
|
|
183
|
+
n,
|
|
184
|
+
g,
|
|
185
|
+
-10
|
|
186
|
+
),
|
|
187
|
+
"--text-color-quaternary": g,
|
|
188
|
+
"--background-color": a,
|
|
189
|
+
"--background-color-dark": y(a, -10),
|
|
190
|
+
"--background-color-darker": y(a, -25),
|
|
191
|
+
"--background-color-light": y(a, 10),
|
|
192
|
+
"--background-color-lighter": y(a, 20),
|
|
193
|
+
"--link-color": l,
|
|
194
|
+
"--link-hover-color": ee(
|
|
195
|
+
a,
|
|
196
|
+
l,
|
|
197
|
+
l === "#ffffff" ? -20 : 20
|
|
198
|
+
),
|
|
199
|
+
"--link-hover-color-primary": x(
|
|
200
|
+
e,
|
|
201
|
+
u,
|
|
202
|
+
-10
|
|
203
|
+
),
|
|
204
|
+
"--link-hover-color-secondary": x(
|
|
205
|
+
r,
|
|
206
|
+
c,
|
|
207
|
+
-10
|
|
208
|
+
),
|
|
209
|
+
"--link-hover-color-tertiary": x(
|
|
210
|
+
o,
|
|
211
|
+
f,
|
|
212
|
+
-10
|
|
213
|
+
),
|
|
214
|
+
"--link-hover-color-quaternary": x(
|
|
215
|
+
n,
|
|
216
|
+
g,
|
|
217
|
+
-10
|
|
218
|
+
),
|
|
219
|
+
"--focus-outline-color": l,
|
|
220
|
+
"--divider-color": k(a),
|
|
221
|
+
"--border-color": k(a),
|
|
222
|
+
"--border-color-subtle": k(a, 10, 10),
|
|
223
|
+
"--border-color-strong": k(a, 20, 20)
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function re(t, e) {
|
|
227
|
+
for (const [r, o] of Object.entries(e))
|
|
228
|
+
t.setProperty(r, o);
|
|
229
|
+
}
|
|
230
|
+
function oe(t, e = document) {
|
|
231
|
+
re(
|
|
232
|
+
e.documentElement.style,
|
|
233
|
+
te(t)
|
|
234
|
+
), e.documentElement.dataset.borealTheme = t.name;
|
|
235
|
+
}
|
|
236
|
+
function ne({
|
|
237
|
+
customSchemes: t = [],
|
|
238
|
+
initialSchemeName: e,
|
|
239
|
+
useOnlyCustomSchemes: r = !1
|
|
240
|
+
} = {}) {
|
|
241
|
+
const o = V({ customSchemes: t, useOnlyCustomSchemes: r }), n = j();
|
|
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 ae = G(
|
|
245
|
+
void 0
|
|
246
|
+
), ce = typeof window > "u" ? L : U, fe = ({
|
|
247
|
+
children: t,
|
|
248
|
+
customSchemes: e = [],
|
|
249
|
+
enableThemeScript: r = !0,
|
|
250
|
+
initialSchemeName: o,
|
|
251
|
+
useOnlyCustomSchemes: n = !1
|
|
252
|
+
}) => {
|
|
253
|
+
const a = I(
|
|
254
|
+
() => JSON.stringify(e ?? []),
|
|
255
|
+
[e]
|
|
256
|
+
), [i, l] = O(!1), u = I(() => {
|
|
257
|
+
try {
|
|
258
|
+
const s = JSON.parse(a);
|
|
259
|
+
if (Array.isArray(s))
|
|
260
|
+
return s;
|
|
261
|
+
} catch {
|
|
262
|
+
console.error("Failed to parse custom schemes");
|
|
263
|
+
}
|
|
264
|
+
return [];
|
|
265
|
+
}, [a]), c = I(
|
|
266
|
+
() => V({
|
|
267
|
+
customSchemes: u,
|
|
268
|
+
useOnlyCustomSchemes: n
|
|
269
|
+
}),
|
|
270
|
+
[u, n]
|
|
271
|
+
), f = E(
|
|
272
|
+
(s) => {
|
|
273
|
+
var m, d;
|
|
274
|
+
const h = Y(c, {
|
|
275
|
+
initialSchemeName: o,
|
|
276
|
+
savedSchemeName: s
|
|
277
|
+
});
|
|
278
|
+
return ((m = c[h]) == null ? void 0 : m.name) ?? ((d = c[0]) == null ? void 0 : d.name) ?? "";
|
|
279
|
+
},
|
|
280
|
+
[o, c]
|
|
281
|
+
), [g, M] = O(
|
|
282
|
+
() => {
|
|
283
|
+
const s = typeof window > "u" ? null : N(window.localStorage);
|
|
284
|
+
return f(s);
|
|
285
|
+
}
|
|
286
|
+
), C = I(() => {
|
|
287
|
+
const s = v(c, g);
|
|
288
|
+
return s === -1 ? 0 : s;
|
|
289
|
+
}, [c, g]), P = E(
|
|
290
|
+
(s) => {
|
|
291
|
+
M((h) => {
|
|
292
|
+
const m = typeof s == "function" ? s(h) : s;
|
|
293
|
+
return v(c, m) === -1 ? h : m;
|
|
294
|
+
});
|
|
295
|
+
},
|
|
296
|
+
[c]
|
|
297
|
+
), B = E(
|
|
298
|
+
(s) => {
|
|
299
|
+
M((h) => {
|
|
300
|
+
var S;
|
|
301
|
+
const m = v(c, h), d = typeof s == "function" ? s(m === -1 ? 0 : m) : s;
|
|
302
|
+
return ((S = c[d]) == null ? void 0 : S.name) ?? h;
|
|
303
|
+
});
|
|
304
|
+
},
|
|
305
|
+
[c]
|
|
306
|
+
);
|
|
307
|
+
return ce(() => {
|
|
308
|
+
const s = typeof window > "u" ? null : N(window.localStorage), h = v(c, s), m = f(s);
|
|
309
|
+
M((d) => o ? m : h !== -1 ? s : v(c, d) !== -1 ? d : m), l(!0);
|
|
310
|
+
}, [o, f, c]), K(() => {
|
|
311
|
+
const s = c[C] ?? c[0];
|
|
312
|
+
!s || typeof document > "u" || oe(s, document);
|
|
313
|
+
}, [C, c]), L(() => {
|
|
314
|
+
if (typeof window > "u") return;
|
|
315
|
+
const s = (d) => {
|
|
316
|
+
v(c, d) !== -1 && M(
|
|
317
|
+
(S) => S === d ? S : d
|
|
318
|
+
);
|
|
319
|
+
}, h = (d) => {
|
|
320
|
+
var A;
|
|
321
|
+
s((A = d.detail) == null ? void 0 : A.schemeName);
|
|
322
|
+
}, m = (d) => {
|
|
323
|
+
d.key === b && s(d.newValue);
|
|
324
|
+
};
|
|
325
|
+
return window.addEventListener($, h), window.addEventListener("storage", m), s(N(window.localStorage)), () => {
|
|
326
|
+
window.removeEventListener($, h), window.removeEventListener("storage", m);
|
|
327
|
+
};
|
|
328
|
+
}, [c]), L(() => {
|
|
329
|
+
if (!i) return;
|
|
330
|
+
const s = c[C] ?? c[0];
|
|
331
|
+
if (!s) return;
|
|
332
|
+
Q(
|
|
333
|
+
typeof window > "u" ? void 0 : window.localStorage,
|
|
334
|
+
s.name
|
|
335
|
+
) && Z(s.name);
|
|
336
|
+
}, [i, C, c]), /* @__PURE__ */ F(
|
|
337
|
+
ae.Provider,
|
|
338
|
+
{
|
|
339
|
+
value: {
|
|
340
|
+
selectedScheme: C,
|
|
341
|
+
selectedSchemeName: g,
|
|
342
|
+
setSelectedScheme: B,
|
|
343
|
+
setSelectedSchemeName: P,
|
|
344
|
+
schemes: c
|
|
345
|
+
},
|
|
346
|
+
children: [
|
|
347
|
+
r ? /* @__PURE__ */ D(
|
|
348
|
+
"script",
|
|
349
|
+
{
|
|
350
|
+
dangerouslySetInnerHTML: {
|
|
351
|
+
__html: ne({
|
|
352
|
+
customSchemes: u,
|
|
353
|
+
initialSchemeName: o,
|
|
354
|
+
useOnlyCustomSchemes: n
|
|
355
|
+
})
|
|
356
|
+
},
|
|
357
|
+
suppressHydrationWarning: !0
|
|
358
|
+
}
|
|
359
|
+
) : null,
|
|
360
|
+
t
|
|
361
|
+
]
|
|
362
|
+
}
|
|
363
|
+
);
|
|
364
|
+
};
|
|
365
|
+
export {
|
|
366
|
+
ae as T,
|
|
367
|
+
fe as a,
|
|
368
|
+
ne as g
|
|
369
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const _=require("react/jsx-runtime"),m=require("react"),H=require("./boreal-style-config-BB8MdwYx.cjs"),D=require("./colorSchemes.cjs.js"),T="boreal:selectedSchemeName",N="boreal:theme-change",M=4.5,A=3;function F(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 x(t,e){return e?t.findIndex(r=>r.name===e):-1}function j({customSchemes:t=[],useOnlyCustomSchemes:e=!1}){return e?[...t]:F([...D.defaultColorSchemes],t)}function G(t,{initialSchemeName:e,savedSchemeName:r}){const o=x(t,e),n=x(t,r),a=x(t,H.getDefaultColorSchemeName());return o!==-1?o:n!==-1?n:a!==-1?a:0}function E(t){if(!t)return null;try{return t.getItem(T)}catch{return console.error("Failed to load saved theme name"),null}}function K(t,e){if(!t)return!1;try{return t.getItem(T)===e?!1:(t.setItem(T,e),!0)}catch{return console.error("Failed to save theme name"),!1}}function U(t,e=typeof window>"u"?void 0:window){e&&e.dispatchEvent(new CustomEvent(N,{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 q(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 l=0,u=0;const c=(a+i)/2;if(a!==i){const f=a-i;switch(u=c>.5?f/(2-a-i):f/(a+i),a){case r:l=(o-n)/f+(o<n?6:0);break;case o:l=(n-r)/f+2;break;case n:l=(r-o)/f+4;break}l/=6}return{h:Math.round(l*360),s:Math.round(u*100),l:Math.round(c*100)}}function L(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}=q(t);return L(r,o,Math.min(100,Math.max(0,n+e)))}function R(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 p(t,e){const r=R(t),o=R(e),n=Math.max(r,o),a=Math.min(r,o);return(n+.05)/(a+.05)}function b(t,e,r=M){if(e&&p(t,e)>=r)return e;const o=p(t,"#000000"),n=p(t,"#ffffff");return o>=n?"#000000":"#ffffff"}function W(t,e,r){const o=v(e,r);return p(t,o)>=M?o:e}function O(t,e){const r=e==="#000000"?1:-1;for(let o=30;o>=0;o-=5){const n=v(e,o*r);if(p(t,n)>=M)return n}return e}function g(t,e,r){const o=v(t,r);if(p(o,e)>=M)return o;const{h:n,s:a,l:i}=q(t),l=e==="#ffffff";for(let u=4;u<=48;u+=4){const c=l?Math.max(0,i-u):Math.min(100,i+u),f=L(n,a,c);if(p(f,e)>=M)return f}return t}function k(t,e=14,r=14){const{h:o,s:n,l:a}=q(t),i=a>=50?Math.max(0,a-r):Math.min(100,a+e),l=n>8?Math.max(0,n-8):n,u=L(o,l,i);return p(t,u)>=A?u:b(t,void 0,A)}function X(t){const{primaryColor:e,secondaryColor:r,tertiaryColor:o,quaternaryColor:n,backgroundColor:a,forceTextColor:i}=t,l=b(a,i),u=b(e,i),c=b(r),f=b(o),S=b(n);return{"--primary-color":e,"--primary-color-light":v(e,10),"--primary-color-hover":g(e,u,-10),"--text-color-primary":u,"--text-color-primary-contrast":l,"--text-color":l,"--text-color-light":O(a,l),"--text-color-lighter":O(a,l),"--secondary-color":r,"--secondary-color-light":v(r,10),"--secondary-color-hover":g(r,c,-10),"--text-color-secondary":c,"--tertiary-color":o,"--tertiary-color-light":v(o,10),"--tertiary-color-hover":g(o,f,-10),"--text-color-tertiary":f,"--quaternary-color":n,"--quaternary-color-light":v(n,10),"--quaternary-color-hover":g(n,S,-10),"--text-color-quaternary":S,"--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":l,"--link-hover-color":W(a,l,l==="#ffffff"?-20:20),"--link-hover-color-primary":g(e,u,-10),"--link-hover-color-secondary":g(r,c,-10),"--link-hover-color-tertiary":g(o,f,-10),"--link-hover-color-quaternary":g(n,S,-10),"--focus-outline-color":l,"--divider-color":k(a),"--border-color":k(a),"--border-color-subtle":k(a,10,10),"--border-color-strong":k(a,20,20)}}function Y(t,e){for(const[r,o]of Object.entries(e))t.setProperty(r,o)}function Q(t,e=document){Y(e.documentElement.style,X(t)),e.documentElement.dataset.borealTheme=t.name}function z({customSchemes:t=[],initialSchemeName:e,useOnlyCustomSchemes:r=!1}={}){const o=j({customSchemes:t,useOnlyCustomSchemes:r}),n=H.getDefaultColorSchemeName();return`(function(){try{var s=${JSON.stringify(o).replace(/</g,"\\u003c")};var k=${JSON.stringify(T)};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 P=m.createContext(void 0),Z=typeof window>"u"?m.useEffect:m.useLayoutEffect,ee=({children:t,customSchemes:e=[],enableThemeScript:r=!0,initialSchemeName:o,useOnlyCustomSchemes:n=!1})=>{const a=m.useMemo(()=>JSON.stringify(e??[]),[e]),[i,l]=m.useState(!1),u=m.useMemo(()=>{try{const s=JSON.parse(a);if(Array.isArray(s))return s}catch{console.error("Failed to parse custom schemes")}return[]},[a]),c=m.useMemo(()=>j({customSchemes:u,useOnlyCustomSchemes:n}),[u,n]),f=m.useCallback(s=>{var h,d;const y=G(c,{initialSchemeName:o,savedSchemeName:s});return((h=c[y])==null?void 0:h.name)??((d=c[0])==null?void 0:d.name)??""},[o,c]),[S,I]=m.useState(()=>{const s=typeof window>"u"?null:E(window.localStorage);return f(s)}),w=m.useMemo(()=>{const s=x(c,S);return s===-1?0:s},[c,S]),V=m.useCallback(s=>{I(y=>{const h=typeof s=="function"?s(y):s;return x(c,h)===-1?y:h})},[c]),B=m.useCallback(s=>{I(y=>{var C;const h=x(c,y),d=typeof s=="function"?s(h===-1?0:h):s;return((C=c[d])==null?void 0:C.name)??y})},[c]);return Z(()=>{const s=typeof window>"u"?null:E(window.localStorage),y=x(c,s),h=f(s);I(d=>o?h:y!==-1?s:x(c,d)!==-1?d:h),l(!0)},[o,f,c]),m.useInsertionEffect(()=>{const s=c[w]??c[0];!s||typeof document>"u"||Q(s,document)},[w,c]),m.useEffect(()=>{if(typeof window>"u")return;const s=d=>{x(c,d)!==-1&&I(C=>C===d?C:d)},y=d=>{var $;s(($=d.detail)==null?void 0:$.schemeName)},h=d=>{d.key===T&&s(d.newValue)};return window.addEventListener(N,y),window.addEventListener("storage",h),s(E(window.localStorage)),()=>{window.removeEventListener(N,y),window.removeEventListener("storage",h)}},[c]),m.useEffect(()=>{if(!i)return;const s=c[w]??c[0];if(!s)return;K(typeof window>"u"?void 0:window.localStorage,s.name)&&U(s.name)},[i,w,c]),_.jsxs(P.Provider,{value:{selectedScheme:w,selectedSchemeName:S,setSelectedScheme:B,setSelectedSchemeName:V,schemes:c},children:[r?_.jsx("script",{dangerouslySetInnerHTML:{__html:z({customSchemes:u,initialSchemeName:o,useOnlyCustomSchemes:n})},suppressHydrationWarning:!0}):null,t]})};exports.ThemeContext=P;exports.ThemeProvider=ee;exports.getThemeInitializationScript=z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ThemeContext-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ThemeContext-DBR6j3a_.cjs");exports.ThemeContext=e.ThemeContext;exports.ThemeProvider=e.ThemeProvider;exports.getThemeInitializationScript=e.getThemeInitializationScript;
|
|
@@ -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-B0vk0hrb.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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),a=require("react"),M=require("./Select-BkErbR5B.cjs"),P=require("./ThemeContext-DBR6j3a_.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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./ThemeSelect-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./ThemeSelect-CM4xjgiQ.cjs");exports.default=e.UserThemeSettings;
|
package/dist/core/ThemeSelect.js
CHANGED