boreal-ui 0.0.892 → 0.0.893

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.
@@ -1,5 +1,5 @@
1
1
  import "./globals.js";
2
- import { T as Z, a as ee, g as te } from "./ThemeContext-DRXOWRyX.js";
2
+ import { T as Z, a as ee, g as te } from "./ThemeContext-xujmsbbI.js";
3
3
  import { registerColorScheme as re } from "./registerColorScheme.js";
4
4
  import { defaultColorSchemes as se } from "./colorSchemes.js";
5
5
  import { i as oe, j as le, s as de } from "./boreal-style-config-rYvfCHLY.js";
@@ -10,7 +10,7 @@ import { S as me } from "./ScrollToTop-B5Db9dTW.js";
10
10
  import { T as qe } from "./TextInput-6X1gVpit.js";
11
11
  import { T as we } from "./TextArea-DGt2Gg8V.js";
12
12
  import { S as ke } from "./Select-BtEKKotT.js";
13
- import { U as xe } from "./ThemeSelect-DxmyeZm_.js";
13
+ import { U as xe } from "./ThemeSelect-BuKiPMK0.js";
14
14
  import { F as Ae } from "./FileUpload-qZoUPMhI.js";
15
15
  import { T as Ce } from "./TagInput-HtNd4Geh.js";
16
16
  import { a as Se, R as Ne } from "./RadioGroup-D1nlf4NZ.js";
@@ -33,7 +33,7 @@ import { T as pt } from "./Tooltip-B7qNyJVE.js";
33
33
  import { M as ft } from "./MessagePopup-BVffuAo9.js";
34
34
  import { P as gt } from "./PopOver-wXCdMjo1.js";
35
35
  import { N as yt } from "./NavBar-BRHva7SR.js";
36
- import { F as bt } from "./Footer-CoFPqecX.js";
36
+ import { F as bt } from "./Footer-_sn6Lt4E.js";
37
37
  import { B as vt } from "./Breadcrumbs-BbKsTJYG.js";
38
38
  import { T as Vt } from "./Tabs-Blwnvx8m.js";
39
39
  import { S as Tt } from "./Stepper-GCqlEAH7.js";
@@ -7,7 +7,7 @@ import { c as o } from "./classNames-Dz0_huu_.js";
7
7
  import { g as Pt, f as Ut } from "./boreal-style-config-rYvfCHLY.js";
8
8
  import { c as T } from "./capitalize-D_pj4b3P.js";
9
9
  import { I as Rt } from "./IconButton-DZg1dNRI.js";
10
- import { U as Wt } from "./ThemeSelect-BdFqSfT_.js";
10
+ import { U as Wt } from "./ThemeSelect-C-YFhG7Y.js";
11
11
  import './Footer.css';const j = (_) => _.toLowerCase().trim().replace(/\s+/g, "-"), st = ({
12
12
  theme: _ = Pt(),
13
13
  glass: h = Ut(),
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { F as f } from "./Footer-D78Lzvjg.js";
2
+ import { F as f } from "./Footer-f4QC8dxP.js";
3
3
  export {
4
4
  f as default
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { a as o } from "./ThemeContext-19HbcfZg.js";
2
+ import { a as o } from "./ThemeContext-Cdq5ypM0.js";
3
3
  function i(e) {
4
4
  return /* @__PURE__ */ r(o, { enableThemeScript: !1, ...e });
5
5
  }
@@ -1,8 +1,8 @@
1
1
  import { jsxs as J, jsx as j } from "react/jsx-runtime";
2
- import { useMemo as k, useState as V, useRef as z, useEffect as I, useInsertionEffect as P, createContext as F } from "react";
2
+ import { useMemo as I, useState as V, useRef as z, useEffect as k, useInsertionEffect as P, createContext as F } from "react";
3
3
  import { c as O } from "./boreal-style-config-rYvfCHLY.js";
4
4
  import { defaultColorSchemes as B } from "./colorSchemes.js";
5
- const S = "boreal:selectedSchemeName", E = "boreal:theme-change", w = 4.5, L = 3;
5
+ const w = "boreal:selectedSchemeName", E = "boreal:theme-change", b = 4.5, L = 3;
6
6
  function D(t, e = []) {
7
7
  const r = [...t];
8
8
  for (const o of e) {
@@ -11,7 +11,7 @@ function D(t, e = []) {
11
11
  }
12
12
  return r;
13
13
  }
14
- function C(t, e) {
14
+ function p(t, e) {
15
15
  return e ? t.findIndex((r) => r.name === e) : -1;
16
16
  }
17
17
  function R({
@@ -24,13 +24,13 @@ function q(t, {
24
24
  initialSchemeName: e,
25
25
  savedSchemeName: r
26
26
  }) {
27
- const o = C(t, e), n = C(t, r), a = C(t, O());
27
+ const o = p(t, e), n = p(t, r), a = p(t, O());
28
28
  return o !== -1 ? o : n !== -1 ? n : a !== -1 ? a : 0;
29
29
  }
30
30
  function T(t) {
31
31
  if (!t) return null;
32
32
  try {
33
- return t.getItem(S);
33
+ return t.getItem(w);
34
34
  } catch {
35
35
  return console.error("Failed to load saved theme name"), null;
36
36
  }
@@ -38,7 +38,7 @@ function T(t) {
38
38
  function G(t, e) {
39
39
  if (!t) return !1;
40
40
  try {
41
- return t.getItem(S) === e ? !1 : (t.setItem(S, e), !0);
41
+ return t.getItem(w) === e ? !1 : (t.setItem(w, e), !0);
42
42
  } catch {
43
43
  return console.error("Failed to save theme name"), !1;
44
44
  }
@@ -86,7 +86,7 @@ function $(t, e, r) {
86
86
  );
87
87
  return `#${[a(0), a(8), a(4)].map((s) => s.toString(16).padStart(2, "0")).join("")}`;
88
88
  }
89
- function d(t, e) {
89
+ function m(t, e) {
90
90
  const { h: r, s: o, l: n } = N(t);
91
91
  return $(r, o, Math.min(100, Math.max(0, n + e)));
92
92
  }
@@ -101,40 +101,40 @@ function v(t, e) {
101
101
  const r = _(t), o = _(e), n = Math.max(r, o), a = Math.min(r, o);
102
102
  return (n + 0.05) / (a + 0.05);
103
103
  }
104
- function x(t, e, r = w) {
104
+ function g(t, e, r = b) {
105
105
  if (e && v(t, e) >= r)
106
106
  return e;
107
107
  const o = v(t, "#000000"), n = v(t, "#ffffff");
108
108
  return o >= n ? "#000000" : "#ffffff";
109
109
  }
110
110
  function U(t, e, r) {
111
- const o = d(e, r);
112
- return v(t, o) >= w ? o : e;
111
+ const o = m(e, r);
112
+ return v(t, o) >= b ? o : e;
113
113
  }
114
114
  function A(t, e) {
115
115
  const r = e === "#000000" ? 1 : -1;
116
116
  for (let o = 30; o >= 0; o -= 5) {
117
- const n = d(e, o * r);
118
- if (v(t, n) >= w)
117
+ const n = m(e, o * r);
118
+ if (v(t, n) >= b)
119
119
  return n;
120
120
  }
121
121
  return e;
122
122
  }
123
123
  function y(t, e, r) {
124
- const o = d(t, r);
125
- if (v(o, e) >= w)
124
+ const o = m(t, r);
125
+ if (v(o, e) >= b)
126
126
  return o;
127
127
  const { h: n, s: a, l: s } = N(t), c = e === "#ffffff";
128
128
  for (let i = 4; i <= 48; i += 4) {
129
129
  const f = c ? Math.max(0, s - i) : Math.min(100, s + i), u = $(n, a, f);
130
- if (v(u, e) >= w)
130
+ if (v(u, e) >= b)
131
131
  return u;
132
132
  }
133
133
  return t;
134
134
  }
135
135
  function M(t, e = 14, r = 14) {
136
136
  const { h: o, s: n, l: a } = N(t), s = a >= 50 ? Math.max(0, a - r) : Math.min(100, a + e), c = n > 8 ? Math.max(0, n - 8) : n, i = $(o, c, s);
137
- return v(t, i) >= L ? i : x(t, void 0, L);
137
+ return v(t, i) >= L ? i : g(t, void 0, L);
138
138
  }
139
139
  function W(t) {
140
140
  const {
@@ -144,10 +144,10 @@ function W(t) {
144
144
  quaternaryColor: n,
145
145
  backgroundColor: a,
146
146
  forceTextColor: s
147
- } = t, c = x(a, s), i = x(e, s), f = x(r), u = x(o), l = x(n);
147
+ } = t, c = g(a, s), i = g(e, s), f = g(r), u = g(o), l = g(n);
148
148
  return {
149
149
  "--primary-color": e,
150
- "--primary-color-light": d(e, 10),
150
+ "--primary-color-light": m(e, 10),
151
151
  "--primary-color-hover": y(
152
152
  e,
153
153
  i,
@@ -162,7 +162,7 @@ function W(t) {
162
162
  c
163
163
  ),
164
164
  "--secondary-color": r,
165
- "--secondary-color-light": d(r, 10),
165
+ "--secondary-color-light": m(r, 10),
166
166
  "--secondary-color-hover": y(
167
167
  r,
168
168
  f,
@@ -170,7 +170,7 @@ function W(t) {
170
170
  ),
171
171
  "--text-color-secondary": f,
172
172
  "--tertiary-color": o,
173
- "--tertiary-color-light": d(o, 10),
173
+ "--tertiary-color-light": m(o, 10),
174
174
  "--tertiary-color-hover": y(
175
175
  o,
176
176
  u,
@@ -178,7 +178,7 @@ function W(t) {
178
178
  ),
179
179
  "--text-color-tertiary": u,
180
180
  "--quaternary-color": n,
181
- "--quaternary-color-light": d(n, 10),
181
+ "--quaternary-color-light": m(n, 10),
182
182
  "--quaternary-color-hover": y(
183
183
  n,
184
184
  l,
@@ -186,10 +186,10 @@ function W(t) {
186
186
  ),
187
187
  "--text-color-quaternary": l,
188
188
  "--background-color": a,
189
- "--background-color-dark": d(a, -10),
190
- "--background-color-darker": d(a, -25),
191
- "--background-color-light": d(a, 10),
192
- "--background-color-lighter": d(a, 20),
189
+ "--background-color-dark": m(a, -10),
190
+ "--background-color-darker": m(a, -25),
191
+ "--background-color-light": m(a, 10),
192
+ "--background-color-lighter": m(a, 20),
193
193
  "--link-color": c,
194
194
  "--link-hover-color": U(
195
195
  a,
@@ -239,7 +239,7 @@ function Q({
239
239
  useOnlyCustomSchemes: r = !1
240
240
  } = {}) {
241
241
  const o = R({ customSchemes: t, useOnlyCustomSchemes: r }), n = O();
242
- return `(function(){try{var s=${JSON.stringify(o).replace(/</g, "\\u003c")};var k=${JSON.stringify(S)};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){}})();`;
242
+ 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){}})();`;
243
243
  }
244
244
  const Z = F(
245
245
  void 0
@@ -250,10 +250,10 @@ const Z = F(
250
250
  initialSchemeName: o,
251
251
  useOnlyCustomSchemes: n = !1
252
252
  }) => {
253
- const a = k(
253
+ const a = I(
254
254
  () => JSON.stringify(e ?? []),
255
255
  [e]
256
- ), s = k(() => {
256
+ ), s = I(() => {
257
257
  try {
258
258
  const l = JSON.parse(a);
259
259
  if (Array.isArray(l))
@@ -262,7 +262,7 @@ const Z = F(
262
262
  console.error("Failed to parse custom schemes");
263
263
  }
264
264
  return [];
265
- }, [a]), c = k(
265
+ }, [a]), c = I(
266
266
  () => R({
267
267
  customSchemes: s,
268
268
  useOnlyCustomSchemes: n
@@ -274,37 +274,37 @@ const Z = F(
274
274
  savedSchemeName: typeof window > "u" ? null : T(window.localStorage)
275
275
  })
276
276
  ), u = z(!1);
277
- return I(() => {
278
- const l = q(c, {
277
+ return k(() => {
278
+ const l = typeof window > "u" ? null : T(window.localStorage), h = p(c, l), x = q(c, {
279
279
  initialSchemeName: o,
280
- savedSchemeName: typeof window > "u" ? null : T(window.localStorage)
280
+ savedSchemeName: l
281
281
  });
282
- f((h) => o ? l : c[h] ? h : l);
282
+ f((d) => o ? x : h !== -1 ? h : c[d] ? d : x);
283
283
  }, [c, o]), P(() => {
284
284
  const l = c[i] ?? c[0];
285
285
  !l || typeof document > "u" || Y(l, document);
286
- }, [i, c]), I(() => {
286
+ }, [i, c]), k(() => {
287
287
  if (typeof window > "u") return;
288
- const l = (m) => {
289
- const g = C(c, m);
290
- g !== -1 && f(
291
- (p) => p === g ? p : g
288
+ const l = (d) => {
289
+ const C = p(c, d);
290
+ C !== -1 && f(
291
+ (S) => S === C ? S : C
292
292
  );
293
- }, h = (m) => {
294
- var p;
295
- l((p = m.detail) == null ? void 0 : p.schemeName);
296
- }, b = (m) => {
297
- m.key === S && l(m.newValue);
293
+ }, h = (d) => {
294
+ var S;
295
+ l((S = d.detail) == null ? void 0 : S.schemeName);
296
+ }, x = (d) => {
297
+ d.key === w && l(d.newValue);
298
298
  };
299
- return window.addEventListener(E, h), window.addEventListener("storage", b), l(T(window.localStorage)), () => {
300
- window.removeEventListener(E, h), window.removeEventListener("storage", b);
299
+ return window.addEventListener(E, h), window.addEventListener("storage", x), l(T(window.localStorage)), () => {
300
+ window.removeEventListener(E, h), window.removeEventListener("storage", x);
301
301
  };
302
- }, [c]), I(() => {
302
+ }, [c]), k(() => {
303
303
  const l = c[i] ?? c[0];
304
304
  if (!l) return;
305
- const h = typeof window > "u" ? void 0 : window.localStorage, b = T(h), m = C(c, b);
306
- if (!u.current && !o && m !== -1 && m !== i) {
307
- u.current = !0, f(m);
305
+ const h = typeof window > "u" ? void 0 : window.localStorage, x = T(h), d = p(c, x);
306
+ if (!u.current && !o && d !== -1 && d !== i) {
307
+ u.current = !0, f(d);
308
308
  return;
309
309
  }
310
310
  u.current = !0, G(h, l.name) && K(l.name);
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { N as i } from "./NextThemeProvider-NpALBYoC.js";
3
- import { g as t } from "./ThemeContext-19HbcfZg.js";
2
+ import { N as i } from "./NextThemeProvider-DqpRUO1w.js";
3
+ import { g as t } from "./ThemeContext-Cdq5ypM0.js";
4
4
  export {
5
5
  i as ThemeProvider,
6
6
  t as getThemeInitializationScript
@@ -3,7 +3,7 @@ import { forwardRef as U, useContext as q, useMemo as R } from "react";
3
3
  import "./globals.js";
4
4
  import { g as j, a as E, b as M } from "./boreal-style-config-rYvfCHLY.js";
5
5
  import { S as P } from "./Select-BJoe21vP.js";
6
- import { T as W } from "./ThemeContext-19HbcfZg.js";
6
+ import { T as W } from "./ThemeContext-Cdq5ypM0.js";
7
7
  const k = U(
8
8
  ({
9
9
  theme: n = j(),
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { U as f } from "./ThemeSelect-BdFqSfT_.js";
2
+ import { U as f } from "./ThemeSelect-C-YFhG7Y.js";
3
3
  export {
4
4
  f as default
5
5
  };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import "./globals.js";
3
- import { N as Z } from "./NextThemeProvider-NpALBYoC.js";
4
- import { g as te } from "./ThemeContext-19HbcfZg.js";
3
+ import { N as Z } from "./NextThemeProvider-DqpRUO1w.js";
4
+ import { g as te } from "./ThemeContext-Cdq5ypM0.js";
5
5
  import { registerColorScheme as re } from "./registerColorScheme.js";
6
6
  import { defaultColorSchemes as se } from "./colorSchemes.js";
7
7
  import { i as oe, j as le, s as de } from "./boreal-style-config-rYvfCHLY.js";
@@ -12,7 +12,7 @@ import { S as me } from "./ScrollToTop-MaejIn4U.js";
12
12
  import { T as qe } from "./TextInput-BQ5K5T5P.js";
13
13
  import { T as we } from "./TextArea-CN4jvDmU.js";
14
14
  import { S as ke } from "./Select-BJoe21vP.js";
15
- import { U as xe } from "./ThemeSelect-BdFqSfT_.js";
15
+ import { U as xe } from "./ThemeSelect-C-YFhG7Y.js";
16
16
  import { F as Ae } from "./FileUpload-5jVycHrE.js";
17
17
  import { T as Ce } from "./TagInput-44YuRj4h.js";
18
18
  import { R as Se } from "./RadioButton-BHoW7U55.js";
@@ -36,7 +36,7 @@ import { T as ct } from "./Tooltip-CEclPNYV.js";
36
36
  import { M as ut } from "./MessagePopup-BIgiY8CG.js";
37
37
  import { P as ht } from "./PopOver-L_eZPELu.js";
38
38
  import { N as mt } from "./NavBar-B-xlWKdF.js";
39
- import { F as qt } from "./Footer-D78Lzvjg.js";
39
+ import { F as qt } from "./Footer-f4QC8dxP.js";
40
40
  import { B as wt } from "./Breadcrumbs-DKGek98b.js";
41
41
  import { T as kt } from "./Tabs-Drw-uDfV.js";
42
42
  import { S as xt } from "./Stepper-u3qlCX3g.js";