@tempots/beatui 1.0.0 → 1.1.0

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 (57) hide show
  1. package/dist/auth/index.cjs.js +1 -1
  2. package/dist/auth/index.es.js +1 -1
  3. package/dist/auth-divider-3t_-R0sL.cjs +1 -0
  4. package/dist/{auth-divider-BQIhr3-R.js → auth-divider-Cp3xGpHr.js} +14 -14
  5. package/dist/beatui.css +36 -15
  6. package/dist/beatui.tailwind.css +36 -15
  7. package/dist/better-auth/index.cjs.js +1 -1
  8. package/dist/better-auth/index.es.js +6 -6
  9. package/dist/{deep-merge-EkjEgK0N.cjs → deep-merge-Bz9HHpRt.cjs} +1 -1
  10. package/dist/{deep-merge-BzIheQtH.js → deep-merge-Da602mAN.js} +1 -1
  11. package/dist/{duration-input-DGzmIImj.js → duration-input-HM1i6RRY.js} +2 -2
  12. package/dist/{duration-input-ClgYjeBa.cjs → duration-input-g-cQ3cs1.cjs} +1 -1
  13. package/dist/index.cjs.js +4 -4
  14. package/dist/index.es.js +5394 -5251
  15. package/dist/json-schema/index.cjs.js +1 -1
  16. package/dist/json-schema/index.es.js +5 -5
  17. package/dist/json-structure/index.cjs.js +1 -1
  18. package/dist/json-structure/index.es.js +3 -3
  19. package/dist/notice-BNghd0oS.cjs +1 -0
  20. package/dist/notice-Dtz7ADVH.js +211 -0
  21. package/dist/prosemirror/index.cjs.js +1 -1
  22. package/dist/prosemirror/index.es.js +1 -1
  23. package/dist/text-input-DL9FvpTZ.cjs +1 -0
  24. package/dist/text-input-dDUEUmlC.js +57 -0
  25. package/dist/types/components/data/data-table-context.d.ts +4 -3
  26. package/dist/types/components/data/data-table-types.d.ts +31 -17
  27. package/dist/types/components/data/data-table.d.ts +3 -3
  28. package/dist/types/components/data/sortable-header.d.ts +4 -2
  29. package/dist/types/components/form/input/bigint-input.d.ts +3 -3
  30. package/dist/types/components/form/input/color-input.d.ts +3 -1
  31. package/dist/types/components/form/input/create-nullable-string-input.d.ts +2 -2
  32. package/dist/types/components/form/input/date-time-input.d.ts +4 -4
  33. package/dist/types/components/form/input/email-input.d.ts +4 -4
  34. package/dist/types/components/form/input/input-options.d.ts +3 -1
  35. package/dist/types/components/form/input/nullable-bigint-input.d.ts +3 -3
  36. package/dist/types/components/form/input/nullable-date-time-input.d.ts +2 -2
  37. package/dist/types/components/form/input/nullable-email-input.d.ts +3 -3
  38. package/dist/types/components/form/input/nullable-plain-date-input.d.ts +1 -0
  39. package/dist/types/components/form/input/nullable-plain-date-time-input.d.ts +1 -0
  40. package/dist/types/components/form/input/nullable-plain-time-input.d.ts +1 -0
  41. package/dist/types/components/form/input/nullable-plain-year-month-input.d.ts +1 -0
  42. package/dist/types/components/form/input/plain-date-input.d.ts +1 -0
  43. package/dist/types/components/form/input/plain-date-time-input.d.ts +1 -0
  44. package/dist/types/components/form/input/plain-time-input.d.ts +1 -0
  45. package/dist/types/components/form/input/plain-year-month-input.d.ts +1 -0
  46. package/dist/types/components/form/input/slider-input.d.ts +24 -6
  47. package/dist/types/components/form/input/switch.d.ts +3 -1
  48. package/dist/types/components/overlay/dialogs.d.ts +10 -2
  49. package/dist/widget-customization-DOWmUuPU.cjs +1 -0
  50. package/dist/{widget-customization-Dkx7kNSe.js → widget-customization-YhVcA-KM.js} +350 -341
  51. package/package.json +1 -1
  52. package/dist/auth-divider-DvnUModP.cjs +0 -1
  53. package/dist/notice-E19wu9lA.js +0 -209
  54. package/dist/notice-_9XhdrFw.cjs +0 -1
  55. package/dist/text-input-DfqXolVe.js +0 -55
  56. package/dist/text-input-X_q01NsY.cjs +0 -1
  57. package/dist/widget-customization-DgW1SXN6.cjs +0 -1
@@ -1,56 +1,56 @@
1
- import { Value as p, prop as lt, computedOf as D, html as _, attr as u, svg as rt, svgAttr as Q, Empty as S, on as I, When as H, Fragment as j, aria as B, emitValue as st, Use as gt, input as ut, emitValueAsNullableDate as ot, emitValueAsNullableDateTime as ct, Repeat as ft, style as mt, emit as bt, emitValueAsNumber as E } from "@tempots/dom";
2
- import { F as wt, N as X, T as yt, U as Mt, a as It } from "./deep-merge-BzIheQtH.js";
3
- import { decodeBase64 as $t } from "@tempots/std";
4
- import { I as L } from "./input-container-BvEcp7FU.js";
5
- import { C as O, m as pt, T as xt } from "./text-input-DfqXolVe.js";
6
- import { B as _t, I as tt, b as it, a as kt } from "./translations-B1_yyDUK.js";
7
- import { AutoSelect as Ft } from "@tempots/ui";
8
- import { N as Ct, P as Tt } from "./notice-E19wu9lA.js";
9
- import { s as St } from "./session-id-3KiilioY.js";
10
- import { r as At } from "./utils-vUtP6iPG.js";
11
- function dt(t) {
1
+ import { Value as p, prop as ut, computedOf as D, html as _, attr as u, svg as ot, svgAttr as J, Empty as A, on as I, When as z, Fragment as j, aria as R, emitValue as at, Use as ft, input as pt, emitValueAsNullableDate as ct, emitValueAsNullableDateTime as it, Repeat as mt, emit as bt, style as wt, emitValueAsNumber as E } from "@tempots/dom";
2
+ import { F as yt, N as X, T as Mt, U as It, a as $t } from "./deep-merge-Da602mAN.js";
3
+ import { decodeBase64 as xt } from "@tempots/std";
4
+ import { I as P } from "./input-container-BvEcp7FU.js";
5
+ import { C as O, m as dt, T as _t } from "./text-input-dDUEUmlC.js";
6
+ import { B as kt, I as et, b as lt, a as Ft } from "./translations-B1_yyDUK.js";
7
+ import { AutoSelect as Ct } from "@tempots/ui";
8
+ import { E as Tt, P as St } from "./notice-Dtz7ADVH.js";
9
+ import { s as At } from "./session-id-3KiilioY.js";
10
+ import { r as vt } from "./utils-vUtP6iPG.js";
11
+ function ht(t) {
12
12
  if (typeof t != "string") return !1;
13
13
  const e = t.startsWith("#") ? t.slice(1) : t;
14
14
  return /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(e);
15
15
  }
16
- function vt(t) {
16
+ function Nt(t) {
17
17
  if (typeof t != "string") return !1;
18
18
  const e = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i, a = t.match(e);
19
19
  if (!a) return !1;
20
20
  const [, n, r, s] = a, o = parseInt(n, 10), c = parseInt(r, 10), i = parseInt(s, 10);
21
21
  return o >= 0 && o <= 255 && c >= 0 && c <= 255 && i >= 0 && i <= 255;
22
22
  }
23
- function Nt(t) {
23
+ function Rt(t) {
24
24
  if (typeof t != "string") return !1;
25
25
  const e = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i, a = t.match(e);
26
26
  if (!a) return !1;
27
27
  const [, n, r, s, o] = a, c = parseInt(n, 10), i = parseInt(r, 10), l = parseInt(s, 10), d = parseFloat(o);
28
28
  return c >= 0 && c <= 255 && i >= 0 && i <= 255 && l >= 0 && l <= 255 && d >= 0 && d <= 1;
29
29
  }
30
- function Rt(t) {
30
+ function Bt(t) {
31
31
  if (typeof t != "string") return !1;
32
32
  const e = /^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/i, a = t.match(e);
33
33
  if (!a) return !1;
34
34
  const [, n, r, s] = a, o = parseInt(n, 10), c = parseInt(r, 10), i = parseInt(s, 10);
35
35
  return o >= 0 && o <= 360 && c >= 0 && c <= 100 && i >= 0 && i <= 100;
36
36
  }
37
- function pe(t) {
38
- return dt(t) || vt(t) || Nt(t) || Rt(t);
37
+ function de(t) {
38
+ return ht(t) || Nt(t) || Rt(t) || Bt(t);
39
39
  }
40
- function Bt(t) {
41
- if (!dt(t)) return null;
40
+ function Dt(t) {
41
+ if (!ht(t)) return null;
42
42
  let e = t.startsWith("#") ? t.slice(1) : t;
43
43
  return e.length === 3 && (e = e.split("").map((a) => a + a).join("")), `#${e.toLowerCase()}`;
44
44
  }
45
- function et(t, e, a) {
45
+ function nt(t, e, a) {
46
46
  const n = (r) => {
47
47
  const s = Math.round(Math.max(0, Math.min(255, r))).toString(16);
48
48
  return s.length === 1 ? "0" + s : s;
49
49
  };
50
50
  return `#${n(t)}${n(e)}${n(a)}`;
51
51
  }
52
- function z(t) {
53
- const e = Bt(t);
52
+ function H(t) {
53
+ const e = Dt(t);
54
54
  if (!e) return null;
55
55
  const a = /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
56
56
  return a ? {
@@ -59,16 +59,16 @@ function z(t) {
59
59
  b: parseInt(a[3], 16)
60
60
  } : null;
61
61
  }
62
- function de(t, e) {
63
- const a = z(t), n = z(e);
62
+ function he(t, e) {
63
+ const a = H(t), n = H(e);
64
64
  if (!a || !n) return null;
65
- const r = (l, d, g) => {
66
- const [m, h, b] = [l, d, g].map((M) => (M = M / 255, M <= 0.03928 ? M / 12.92 : Math.pow((M + 0.055) / 1.055, 2.4)));
67
- return 0.2126 * m + 0.7152 * h + 0.0722 * b;
65
+ const r = (l, d, h) => {
66
+ const [w, f, g] = [l, d, h].map((y) => (y = y / 255, y <= 0.03928 ? y / 12.92 : Math.pow((y + 0.055) / 1.055, 2.4)));
67
+ return 0.2126 * w + 0.7152 * f + 0.0722 * g;
68
68
  }, s = r(a.r, a.g, a.b), o = r(n.r, n.g, n.b), c = Math.max(s, o), i = Math.min(s, o);
69
69
  return (c + 0.05) / (i + 0.05);
70
70
  }
71
- function Dt(t) {
71
+ function Vt(t) {
72
72
  if (!t) return [0, 0, 0, 1];
73
73
  const a = t.trim().match(
74
74
  /^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/
@@ -76,8 +76,8 @@ function Dt(t) {
76
76
  if (a) {
77
77
  const l = a[1];
78
78
  if (l.length === 8) {
79
- const d = parseInt(l.slice(0, 2), 16), g = parseInt(l.slice(2, 4), 16), m = parseInt(l.slice(4, 6), 16), h = parseInt(l.slice(6, 8), 16) / 255;
80
- return [d, g, m, h];
79
+ const d = parseInt(l.slice(0, 2), 16), h = parseInt(l.slice(2, 4), 16), w = parseInt(l.slice(4, 6), 16), f = parseInt(l.slice(6, 8), 16) / 255;
80
+ return [d, h, w, f];
81
81
  }
82
82
  if (l.length === 6)
83
83
  return [
@@ -87,12 +87,12 @@ function Dt(t) {
87
87
  1
88
88
  ];
89
89
  if (l.length === 4) {
90
- const d = parseInt(l[0] + l[0], 16), g = parseInt(l[1] + l[1], 16), m = parseInt(l[2] + l[2], 16), h = parseInt(l[3] + l[3], 16) / 255;
91
- return [d, g, m, h];
90
+ const d = parseInt(l[0] + l[0], 16), h = parseInt(l[1] + l[1], 16), w = parseInt(l[2] + l[2], 16), f = parseInt(l[3] + l[3], 16) / 255;
91
+ return [d, h, w, f];
92
92
  }
93
93
  if (l.length === 3) {
94
- const d = parseInt(l[0] + l[0], 16), g = parseInt(l[1] + l[1], 16), m = parseInt(l[2] + l[2], 16);
95
- return [d, g, m, 1];
94
+ const d = parseInt(l[0] + l[0], 16), h = parseInt(l[1] + l[1], 16), w = parseInt(l[2] + l[2], 16);
95
+ return [d, h, w, 1];
96
96
  }
97
97
  }
98
98
  const n = t.match(
@@ -114,39 +114,39 @@ function Dt(t) {
114
114
  /^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i
115
115
  );
116
116
  if (s) {
117
- const l = parseFloat(s[1]), d = parseFloat(s[2]), g = parseFloat(s[3]), m = s[4] != null ? parseFloat(s[4]) : 1, [h, b, M] = ht(l, d / 100, g / 100);
118
- return [h, b, M, m];
117
+ const l = parseFloat(s[1]), d = parseFloat(s[2]), h = parseFloat(s[3]), w = s[4] != null ? parseFloat(s[4]) : 1, [f, g, y] = gt(l, d / 100, h / 100);
118
+ return [f, g, y, w];
119
119
  }
120
120
  const o = t.match(
121
121
  /^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i
122
122
  );
123
123
  if (o) {
124
- const l = parseFloat(o[1]), d = parseFloat(o[2]) / 100, g = parseFloat(o[3]) / 100, m = o[4] != null ? parseFloat(o[4]) : 1, [h, b, M] = Lt(l, d, g);
125
- return [h, b, M, m];
124
+ const l = parseFloat(o[1]), d = parseFloat(o[2]) / 100, h = parseFloat(o[3]) / 100, w = o[4] != null ? parseFloat(o[4]) : 1, [f, g, y] = Ot(l, d, h);
125
+ return [f, g, y, w];
126
126
  }
127
127
  const c = t.match(
128
128
  /^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i
129
129
  );
130
130
  if (c) {
131
- const l = c[1], d = parseFloat(c[2]), g = parseFloat(c[3]), m = c[4] != null ? parseFloat(c[4]) : 1, h = l.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(l) / 100)) : Math.max(0, Math.min(1, parseFloat(l))), [b, M, $] = Pt(h, d, g);
132
- return [b, M, $, m];
131
+ const l = c[1], d = parseFloat(c[2]), h = parseFloat(c[3]), w = c[4] != null ? parseFloat(c[4]) : 1, f = l.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(l) / 100)) : Math.max(0, Math.min(1, parseFloat(l))), [g, y, F] = Ut(f, d, h);
132
+ return [g, y, F, w];
133
133
  }
134
- const i = z(t);
134
+ const i = H(t);
135
135
  return i ? [i.r, i.g, i.b, 1] : [0, 0, 0, 1];
136
136
  }
137
- function Vt(t, e, a, n) {
137
+ function Et(t, e, a, n) {
138
138
  return `rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(a)}, ${Math.max(
139
139
  0,
140
140
  Math.min(1, Math.round(n * 100) / 100)
141
141
  )})`;
142
142
  }
143
- function Et(t) {
143
+ function Pt(t) {
144
144
  let e = t + 1831565813;
145
145
  return function() {
146
146
  return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
147
147
  };
148
148
  }
149
- function ht(t, e, a) {
149
+ function gt(t, e, a) {
150
150
  t = (t % 360 + 360) % 360;
151
151
  const n = (1 - Math.abs(2 * a - 1)) * e, r = n * (1 - Math.abs(t / 60 % 2 - 1)), s = a - n / 2;
152
152
  let o, c, i;
@@ -156,14 +156,14 @@ function ht(t, e, a) {
156
156
  Math.round((i + s) * 255)
157
157
  ];
158
158
  }
159
- function Lt(t, e, a) {
159
+ function Ot(t, e, a) {
160
160
  t = (t % 360 + 360) % 360;
161
161
  const n = e + a;
162
162
  n > 1 && (e /= n, a /= n);
163
- const [r, s, o] = ht(t, 1, 0.5).map((g) => g / 255), c = 1 - e - a, i = r * c + e, l = s * c + e, d = o * c + e;
163
+ const [r, s, o] = gt(t, 1, 0.5).map((h) => h / 255), c = 1 - e - a, i = r * c + e, l = s * c + e, d = o * c + e;
164
164
  return [Math.round(i * 255), Math.round(l * 255), Math.round(d * 255)];
165
165
  }
166
- function nt(t, e, a) {
166
+ function st(t, e, a) {
167
167
  t /= 255, e /= 255, a /= 255;
168
168
  const n = Math.max(t, e, a), r = Math.min(t, e, a);
169
169
  let s = 0, o = 0;
@@ -183,26 +183,26 @@ function nt(t, e, a) {
183
183
  }
184
184
  return [Math.round(s), Math.round(o * 100), Math.round(c * 100)];
185
185
  }
186
- function Ot(t, e, a) {
187
- const [n] = nt(t, e, a), r = t / 255, s = e / 255, o = a / 255, c = Math.min(r, s, o), i = 1 - Math.max(r, s, o);
186
+ function Lt(t, e, a) {
187
+ const [n] = st(t, e, a), r = t / 255, s = e / 255, o = a / 255, c = Math.min(r, s, o), i = 1 - Math.max(r, s, o);
188
188
  return [n, Math.round(c * 100), Math.round(i * 100)];
189
189
  }
190
- function J(t) {
190
+ function Z(t) {
191
191
  const e = t / 255;
192
192
  return e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4);
193
193
  }
194
- function Z(t) {
194
+ function tt(t) {
195
195
  const e = t <= 31308e-7 ? 12.92 * t : 1.055 * Math.pow(t, 0.4166666666666667) - 0.055;
196
196
  return Math.round(Math.max(0, Math.min(1, e)) * 255);
197
197
  }
198
- function Pt(t, e, a) {
199
- const n = a * Math.PI / 180, r = Math.cos(n) * e, s = Math.sin(n) * e, o = t + 0.3963377774 * r + 0.2158037573 * s, c = t - 0.1055613458 * r - 0.0638541728 * s, i = t - 0.0894841775 * r - 1.291485548 * s, l = o * o * o, d = c * c * c, g = i * i * i, m = 4.0767416621 * l - 3.3077115913 * d + 0.2309699292 * g, h = -1.2684380046 * l + 2.6097574011 * d - 0.3413193965 * g, b = -0.0041960863 * l - 0.7034186147 * d + 1.707614701 * g;
200
- return [Z(m), Z(h), Z(b)];
201
- }
202
198
  function Ut(t, e, a) {
203
- const n = J(t), r = J(e), s = J(a), o = 0.4122214708 * n + 0.5363325363 * r + 0.0514459929 * s, c = 0.2119034982 * n + 0.6806995451 * r + 0.1073969566 * s, i = 0.0883024619 * n + 0.2817188376 * r + 0.6299787005 * s, l = Math.cbrt(o), d = Math.cbrt(c), g = Math.cbrt(i), m = 0.2104542553 * l + 0.793617785 * d - 0.0040720468 * g, h = 1.9779984951 * l - 2.428592205 * d + 0.4505937099 * g, b = 0.0259040371 * l + 0.7827717662 * d - 0.808675766 * g, M = Math.sqrt(h * h + b * b);
204
- let $ = Math.atan2(b, h) * 180 / Math.PI;
205
- return $ < 0 && ($ += 360), [m, M, $];
199
+ const n = a * Math.PI / 180, r = Math.cos(n) * e, s = Math.sin(n) * e, o = t + 0.3963377774 * r + 0.2158037573 * s, c = t - 0.1055613458 * r - 0.0638541728 * s, i = t - 0.0894841775 * r - 1.291485548 * s, l = o * o * o, d = c * c * c, h = i * i * i, w = 4.0767416621 * l - 3.3077115913 * d + 0.2309699292 * h, f = -1.2684380046 * l + 2.6097574011 * d - 0.3413193965 * h, g = -0.0041960863 * l - 0.7034186147 * d + 1.707614701 * h;
200
+ return [tt(w), tt(f), tt(g)];
201
+ }
202
+ function Wt(t, e, a) {
203
+ const n = Z(t), r = Z(e), s = Z(a), o = 0.4122214708 * n + 0.5363325363 * r + 0.0514459929 * s, c = 0.2119034982 * n + 0.6806995451 * r + 0.1073969566 * s, i = 0.0883024619 * n + 0.2817188376 * r + 0.6299787005 * s, l = Math.cbrt(o), d = Math.cbrt(c), h = Math.cbrt(i), w = 0.2104542553 * l + 0.793617785 * d - 0.0040720468 * h, f = 1.9779984951 * l - 2.428592205 * d + 0.4505937099 * h, g = 0.0259040371 * l + 0.7827717662 * d - 0.808675766 * h, y = Math.sqrt(f * f + g * g);
204
+ let F = Math.atan2(g, f) * 180 / Math.PI;
205
+ return F < 0 && (F += 360), [w, y, F];
206
206
  }
207
207
  function U(t, e, a, n, r, s) {
208
208
  switch (r) {
@@ -211,33 +211,33 @@ function U(t, e, a, n, r, s) {
211
211
  const o = (i) => i.toString(16).padStart(2, "0"), c = Math.max(0, Math.min(255, Math.round(n * 255)));
212
212
  return `#${o(t)}${o(e)}${o(a)}${o(c)}`;
213
213
  }
214
- return et(t, e, a);
214
+ return nt(t, e, a);
215
215
  case "rgb":
216
216
  return `rgb(${t}, ${e}, ${a})`;
217
217
  case "rgba":
218
218
  return `rgba(${t}, ${e}, ${a}, ${Math.round(n * 100) / 100})`;
219
219
  case "hsl": {
220
- const [o, c, i] = nt(t, e, a);
220
+ const [o, c, i] = st(t, e, a);
221
221
  return `hsl(${o}, ${c}%, ${i}%)`;
222
222
  }
223
223
  case "hsla": {
224
- const [o, c, i] = nt(t, e, a);
224
+ const [o, c, i] = st(t, e, a);
225
225
  return `hsla(${o}, ${c}%, ${i}%, ${Math.round(n * 100) / 100})`;
226
226
  }
227
227
  case "hwb": {
228
- const [o, c, i] = Ot(t, e, a);
228
+ const [o, c, i] = Lt(t, e, a);
229
229
  return n < 1 ? `hwb(${o} ${c}% ${i}% / ${Math.round(n * 100) / 100})` : `hwb(${o} ${c}% ${i}%)`;
230
230
  }
231
231
  case "oklch": {
232
- const [o, c, i] = Ut(t, e, a), l = (Math.round(o * 1e3) / 1e3).toFixed(3), d = (Math.round(c * 1e3) / 1e3).toFixed(3), g = (Math.round(i * 10) / 10).toFixed(1), m = Math.round(n * 100) / 100;
233
- return s || n < 1 ? `oklch(${l} ${d} ${g} / ${m})` : `oklch(${l} ${d} ${g})`;
232
+ const [o, c, i] = Wt(t, e, a), l = (Math.round(o * 1e3) / 1e3).toFixed(3), d = (Math.round(c * 1e3) / 1e3).toFixed(3), h = (Math.round(i * 10) / 10).toFixed(1), w = Math.round(n * 100) / 100;
233
+ return s || n < 1 ? `oklch(${l} ${d} ${h} / ${w})` : `oklch(${l} ${d} ${h})`;
234
234
  }
235
235
  }
236
236
  }
237
237
  function W(t, e) {
238
238
  return e ? t === "rgb" ? "rgba" : t === "hsl" ? "hsla" : t : t === "rgba" ? "rgb" : t === "hsla" ? "hsl" : t;
239
239
  }
240
- async function Wt(t) {
240
+ async function zt(t) {
241
241
  return new Promise((e, a) => {
242
242
  const n = new FileReader();
243
243
  n.readAsDataURL(t), n.onload = () => {
@@ -247,9 +247,9 @@ async function Wt(t) {
247
247
  });
248
248
  }
249
249
  function Ht(t) {
250
- return Promise.all(t.map(Wt));
250
+ return Promise.all(t.map(zt));
251
251
  }
252
- function zt(t) {
252
+ function jt(t) {
253
253
  if (t.length >= 4) {
254
254
  if (t[0] === 137 && t[1] === 80 && t[2] === 78 && t[3] === 71)
255
255
  return "image/png";
@@ -265,45 +265,45 @@ function zt(t) {
265
265
  }
266
266
  return "application/octet-stream";
267
267
  }
268
- function jt(t) {
269
- const e = $t(t ?? ""), a = e.length, n = new Uint8Array(a);
268
+ function Xt(t) {
269
+ const e = xt(t ?? ""), a = e.length, n = new Uint8Array(a);
270
270
  for (let r = 0; r < a; r++) n[r] = e.charCodeAt(r);
271
271
  return n;
272
272
  }
273
- function Xt(t) {
273
+ function Yt(t) {
274
274
  const {
275
275
  value: e,
276
276
  onChange: a,
277
277
  onInput: n,
278
278
  ...r
279
- } = t, s = /* @__PURE__ */ new Map(), o = p.toSignal(e).map((d) => d.map((g, m) => {
280
- const h = s.get(g), b = jt(g ?? ""), M = h?.type || zt(b), $ = h?.name ?? `file-${m}`, y = b.buffer.slice(
281
- b.byteOffset,
282
- b.byteOffset + b.byteLength
283
- ), F = new Blob([y], { type: M });
284
- return new File([F], $, { type: M });
285
- })), c = (d) => (g) => {
286
- d && Ht(g).then((m) => {
287
- for (const [h, b] of m.entries())
288
- s.set(b, { name: g[h].name, type: g[h].type });
289
- d(m);
279
+ } = t, s = /* @__PURE__ */ new Map(), o = p.toSignal(e).map((d) => d.map((h, w) => {
280
+ const f = s.get(h), g = Xt(h ?? ""), y = f?.type || jt(g), F = f?.name ?? `file-${w}`, T = g.buffer.slice(
281
+ g.byteOffset,
282
+ g.byteOffset + g.byteLength
283
+ ), M = new Blob([T], { type: y });
284
+ return new File([M], F, { type: y });
285
+ })), c = (d) => (h) => {
286
+ d && Ht(h).then((w) => {
287
+ for (const [f, g] of w.entries())
288
+ s.set(g, { name: h[f].name, type: h[f].type });
289
+ d(w);
290
290
  });
291
291
  }, i = c(a), l = c(n);
292
- return wt({
292
+ return yt({
293
293
  ...r,
294
294
  value: o,
295
295
  onChange: i,
296
296
  onInput: l
297
297
  });
298
298
  }
299
- function he(t) {
299
+ function ge(t) {
300
300
  const {
301
301
  value: e,
302
302
  onInput: a,
303
303
  onChange: n,
304
304
  ...r
305
305
  } = t;
306
- return Xt({
306
+ return Yt({
307
307
  ...r,
308
308
  maxFiles: 1,
309
309
  value: p.map(e, (s) => s == null ? [] : [s]),
@@ -315,21 +315,21 @@ function he(t) {
315
315
  }
316
316
  });
317
317
  }
318
- function Yt(t, e) {
319
- const [a, n, r] = t, s = a << 16 ^ n << 8 ^ r, o = Et(s), c = 6 + Math.floor(o() * 5), i = 0.18 + o() * 0.06, l = [];
320
- for (let h = 0; h < c; h++) {
321
- const b = h / c * Math.PI * 2, M = e * (1 + (o() * 2 - 1) * i), $ = Math.cos(b) * M, y = Math.sin(b) * M;
322
- l.push({ x: $, y });
318
+ function Gt(t, e) {
319
+ const [a, n, r] = t, s = a << 16 ^ n << 8 ^ r, o = Pt(s), c = 6 + Math.floor(o() * 5), i = 0.18 + o() * 0.06, l = [];
320
+ for (let f = 0; f < c; f++) {
321
+ const g = f / c * Math.PI * 2, y = e * (1 + (o() * 2 - 1) * i), F = Math.cos(g) * y, T = Math.sin(g) * y;
322
+ l.push({ x: F, y: T });
323
323
  }
324
- const d = (l[0].x + l[c - 1].x) / 2, g = (l[0].y + l[c - 1].y) / 2;
325
- let m = `M ${d.toFixed(3)} ${g.toFixed(3)}`;
326
- for (let h = 0; h < c; h++) {
327
- const b = l[h], M = l[(h + 1) % c], $ = (b.x + M.x) / 2, y = (b.y + M.y) / 2;
328
- m += ` Q ${b.x.toFixed(3)} ${b.y.toFixed(3)} ${$.toFixed(3)} ${y.toFixed(3)}`;
324
+ const d = (l[0].x + l[c - 1].x) / 2, h = (l[0].y + l[c - 1].y) / 2;
325
+ let w = `M ${d.toFixed(3)} ${h.toFixed(3)}`;
326
+ for (let f = 0; f < c; f++) {
327
+ const g = l[f], y = l[(f + 1) % c], F = (g.x + y.x) / 2, T = (g.y + y.y) / 2;
328
+ w += ` Q ${g.x.toFixed(3)} ${g.y.toFixed(3)} ${F.toFixed(3)} ${T.toFixed(3)}`;
329
329
  }
330
- return m += " Z", m;
330
+ return w += " Z", w;
331
331
  }
332
- const ge = (t) => {
332
+ const fe = (t) => {
333
333
  const {
334
334
  value: e,
335
335
  onBlur: a,
@@ -338,133 +338,140 @@ const ge = (t) => {
338
338
  displayValue: s,
339
339
  swatchSize: o,
340
340
  withAlpha: c
341
- } = t, i = p.map(o ?? 32, (f) => f), l = p.map(e, (f) => Dt(f ?? "#000000")), d = p.map(
342
- l,
343
- ([f, x, C]) => [f, x, C]
344
- ), g = p.map(l, ([, , , f]) => f), m = lt(p.get(g) ?? 1), h = p.map(c ?? !1, (f) => f), b = p.map(
345
- t.colorTextFormat ?? "rgb",
346
- (f) => f
347
- ), M = D(
341
+ } = t, i = {
342
+ xs: 20,
343
+ sm: 26,
344
+ md: 32,
345
+ lg: 40,
346
+ xl: 52
347
+ }, l = o != null ? p.map(o, (m) => Number(m)) : p.map(
348
+ t.size ?? "md",
349
+ (m) => i[m] ?? 32
350
+ ), d = p.map(e, (m) => Vt(m ?? "#000000")), h = p.map(
348
351
  d,
349
- m,
350
- b,
351
- h
352
+ ([m, x, C]) => [m, x, C]
353
+ ), w = p.map(d, ([, , , m]) => m), f = ut(p.get(w) ?? 1), g = p.map(c ?? !1, (m) => m), y = p.map(
354
+ t.colorTextFormat ?? "rgb",
355
+ (m) => m
356
+ ), F = D(
357
+ h,
358
+ f,
359
+ y,
360
+ g
352
361
  )(
353
- ([f, x, C], v, N, R) => U(f, x, C, v ?? 1, W(N, R), R)
354
- ), $ = p.map(
362
+ ([m, x, C], v, N, B) => U(m, x, C, v ?? 1, W(N, B), B)
363
+ ), T = p.map(
355
364
  t.colorTextFormat ?? "hex",
356
- (f) => f
357
- ), y = p.map(i, (f) => `${-f / 2} ${-f / 2} ${f} ${f}`), F = D(
358
- d,
359
- i
360
- )((f, x) => Yt(f, x / 2)), w = D(
361
- d,
362
- m,
363
- h
365
+ (m) => m
366
+ ), M = p.map(l, (m) => `${-m / 2} ${-m / 2} ${m} ${m}`), b = D(
367
+ h,
368
+ l
369
+ )((m, x) => Gt(m, x / 2)), $ = D(
370
+ h,
371
+ f,
372
+ g
364
373
  )(
365
- ([f, x, C], v, N) => N || v < 1 ? Vt(f, x, C, v) : et(f, x, C)
366
- ), A = _.div(
374
+ ([m, x, C], v, N) => N || v < 1 ? Et(m, x, C, v) : nt(m, x, C)
375
+ ), S = _.div(
367
376
  u.class("bc-color-swatch-input__control"),
368
377
  u.class(
369
378
  p.map(
370
- h,
371
- (f) => f ? "bc-color-swatch-input__control--alpha" : ""
379
+ g,
380
+ (m) => m ? "bc-color-swatch-input__control--alpha" : ""
372
381
  )
373
382
  ),
374
- u.style(
375
- D(i)((f) => `min-width:${f + 2}px;height:${f + 2}px`)
376
- ),
383
+ u.style(D(l)((m) => `width:${m + 2}px;height:${m + 2}px`)),
377
384
  // The SVG blob preview
378
- rt.svg(
385
+ ot.svg(
379
386
  u.class("bc-color-swatch-input__svg"),
380
- Q.viewBox(y),
381
- rt.path(Q.d(F), Q.fill(w))
387
+ J.viewBox(M),
388
+ ot.path(J.d(b), J.fill($))
382
389
  ),
383
390
  // Invisible native input overlays the blob for picker and accessibility
384
391
  _.input(
385
392
  u.type("color"),
386
393
  O(t),
387
394
  // Native color input needs hex without alpha
388
- u.value(p.map(d, ([f, x, C]) => et(f, x, C))),
395
+ u.value(p.map(h, ([m, x, C]) => nt(m, x, C))),
389
396
  u.class(
390
397
  "bc-input bc-color-swatch-input bc-color-swatch-input__native"
391
398
  ),
392
- a != null ? I.blur(a) : S,
393
- n != null ? I.change((f) => {
394
- const x = f.target.value;
399
+ a != null ? I.blur(a) : A,
400
+ n != null ? I.change((m) => {
401
+ const x = m.target.value;
395
402
  if (!n) return;
396
- const { r: C, g: v, b: N } = z(x) ?? { r: 0, g: 0, b: 0 }, R = p.get(m) ?? 1, V = W(
397
- p.get($),
398
- p.get(h)
399
- ), q = U(C, v, N, R, V, p.get(h));
400
- n(q);
401
- }) : S,
402
- r != null ? I.input((f) => {
403
- const x = f.target.value;
403
+ const { r: C, g: v, b: N } = H(x) ?? { r: 0, g: 0, b: 0 }, B = p.get(f) ?? 1, V = W(
404
+ p.get(T),
405
+ p.get(g)
406
+ ), Q = U(C, v, N, B, V, p.get(g));
407
+ n(Q);
408
+ }) : A,
409
+ r != null ? I.input((m) => {
410
+ const x = m.target.value;
404
411
  if (!r) return;
405
- const { r: C, g: v, b: N } = z(x) ?? { r: 0, g: 0, b: 0 }, R = p.get(m) ?? 1, V = W(
406
- p.get($),
407
- p.get(h)
408
- ), q = U(C, v, N, R, V, p.get(h));
409
- r(q);
410
- }) : S
412
+ const { r: C, g: v, b: N } = H(x) ?? { r: 0, g: 0, b: 0 }, B = p.get(f) ?? 1, V = W(
413
+ p.get(T),
414
+ p.get(g)
415
+ ), Q = U(C, v, N, B, V, p.get(g));
416
+ r(Q);
417
+ }) : A
411
418
  )
412
- ), T = H(
413
- h,
419
+ ), k = z(
420
+ g,
414
421
  () => _.input(
415
422
  u.type("range"),
416
423
  u.class("bc-color-swatch-input__alpha"),
417
424
  u.min(0),
418
425
  u.max(1),
419
426
  u.step(0.01),
420
- u.value(p.map(m, (f) => String(f ?? 1))),
427
+ u.value(p.map(f, (m) => String(m ?? 1))),
421
428
  u.disabled(t.disabled),
422
- I.input((f) => {
423
- const x = parseFloat(f.target.value);
424
- m.set(x);
425
- const [C, v, N] = p.get(d), R = W(
426
- p.get($),
427
- p.get(h)
428
- ), V = U(C, v, N, x, R, p.get(h));
429
+ I.input((m) => {
430
+ const x = parseFloat(m.target.value);
431
+ f.set(x);
432
+ const [C, v, N] = p.get(h), B = W(
433
+ p.get(T),
434
+ p.get(g)
435
+ ), V = U(C, v, N, x, B, p.get(g));
429
436
  r?.(V);
430
437
  }),
431
- I.change((f) => {
432
- const x = parseFloat(f.target.value);
433
- m.set(x);
434
- const [C, v, N] = p.get(d), R = W(
435
- p.get($),
436
- p.get(h)
437
- ), V = U(C, v, N, x, R, p.get(h));
438
+ I.change((m) => {
439
+ const x = parseFloat(m.target.value);
440
+ f.set(x);
441
+ const [C, v, N] = p.get(h), B = W(
442
+ p.get(T),
443
+ p.get(g)
444
+ ), V = U(C, v, N, x, B, p.get(g));
438
445
  n?.(V);
439
446
  })
440
447
  )
441
448
  ), {
442
- swatchSize: k,
443
- displayValue: Y,
444
- withAlpha: at,
445
- colorTextFormat: G,
449
+ swatchSize: Y,
450
+ displayValue: G,
451
+ withAlpha: q,
452
+ colorTextFormat: rt,
446
453
  ...K
447
454
  } = t;
448
- return L({
455
+ return P({
449
456
  baseContainer: !0,
450
457
  ...K,
451
458
  // ensure our control does not try to grow
452
459
  growInput: !1,
453
- input: A,
460
+ input: S,
454
461
  // If caller provided an `after`, append RGB before it
455
462
  after: j(
456
- H(
463
+ z(
457
464
  s ?? !1,
458
- () => _.span(u.class("bc-color-swatch-input__rgb"), M)
465
+ () => _.span(u.class("bc-color-swatch-input__rgb"), F)
459
466
  ),
460
- T,
467
+ k,
461
468
  t.after
462
469
  )
463
470
  });
464
- }, Gt = (t) => typeof t == "string" && t.trim() === "" ? null : t, Kt = (t) => t ?? "";
465
- function P(t) {
471
+ }, Kt = (t) => typeof t == "string" && t.trim() === "" ? null : t, qt = (t) => t ?? "";
472
+ function L(t) {
466
473
  return (e) => {
467
- const { after: a, disabled: n } = e, r = pt(e, Kt, Gt), s = X(
474
+ const { after: a, disabled: n } = e, r = dt(e, qt, Kt), s = X(
468
475
  e.value,
469
476
  n,
470
477
  e.onChange ?? e.onInput
@@ -475,14 +482,14 @@ function P(t) {
475
482
  });
476
483
  };
477
484
  }
478
- const fe = ({
485
+ const me = ({
479
486
  startEditing: t,
480
487
  value: e,
481
488
  onChange: a,
482
489
  placeholder: n,
483
490
  disabled: r
484
491
  }) => {
485
- const s = p.deriveProp(t ?? !1), o = lt(!1), c = p.map(r ?? !1, (i) => i);
492
+ const s = p.deriveProp(t ?? !1), o = ut(!1), c = p.map(r ?? !1, (i) => i);
486
493
  return _.div(
487
494
  u.class("bc-editable-text"),
488
495
  u.class(
@@ -491,19 +498,19 @@ const fe = ({
491
498
  (i) => i ? "bc-editable-text--disabled" : ""
492
499
  )
493
500
  ),
494
- B.disabled(c),
495
- H(
501
+ R.disabled(c),
502
+ z(
496
503
  s,
497
504
  () => _.input(
498
505
  u.placeholder(n),
499
506
  u.value(e),
500
507
  u.class("bc-editable-text__input"),
501
- Ft(),
508
+ Ct(),
502
509
  I.keydown((i) => {
503
510
  i.key === "Enter" ? s.set(!1) : i.key === "Escape" && (o.set(!0), s.set(!1));
504
511
  }),
505
512
  I.blur(
506
- st((i) => {
513
+ at((i) => {
507
514
  if (s.set(!1), o.value) {
508
515
  o.set(!1);
509
516
  return;
@@ -517,7 +524,7 @@ const fe = ({
517
524
  p.get(c) || s.set(!0);
518
525
  }),
519
526
  u.class("bc-editable-text__display"),
520
- H(
527
+ z(
521
528
  p.map(e, (i) => i != null && i.trim() !== ""),
522
529
  () => _.span(u.class("bc-editable-text__text"), e),
523
530
  () => _.span(
@@ -525,53 +532,53 @@ const fe = ({
525
532
  n
526
533
  )
527
534
  ),
528
- H(
535
+ z(
529
536
  p.map(c, (i) => !i),
530
537
  () => _.button(
531
538
  u.type("button"),
532
539
  u.class("bc-editable-text__edit-button"),
533
- gt(_t, (i) => B.label(i.$.editLabel)),
540
+ ft(kt, (i) => R.label(i.$.editLabel)),
534
541
  I.click(() => s.set(!0)),
535
- tt({ icon: "line-md/pencil", color: "neutral" })
542
+ et({ icon: "line-md/pencil", color: "neutral" })
536
543
  )
537
544
  )
538
545
  )
539
546
  )
540
547
  );
541
- }, me = (t) => {
548
+ }, be = (t) => {
542
549
  const { value: e, onBlur: a, onChange: n, onInput: r, after: s, disabled: o } = t, c = X(e, o, n ?? r);
543
- return L({
550
+ return P({
544
551
  ...t,
545
- input: ut.date(
552
+ input: pt.date(
546
553
  O(t),
547
554
  u.valueAsDate(e),
548
555
  u.class("bc-input"),
549
- a != null ? I.blur(st(a)) : S,
550
- n != null ? I.change(ot(n)) : S,
551
- r != null ? I.input(ot(r)) : S
556
+ a != null ? I.blur(at(a)) : A,
557
+ n != null ? I.change(ct(n)) : A,
558
+ r != null ? I.input(ct(r)) : A
552
559
  ),
553
560
  after: s != null ? j(c, s) : c
554
561
  });
555
- }, qt = (t) => {
562
+ }, Qt = (t) => {
556
563
  const e = t.getFullYear(), a = t.getMonth() + 1, n = t.getDate(), r = t.getHours(), s = t.getMinutes(), o = t.getSeconds();
557
564
  return `${e}-${a.toString().padStart(2, "0")}-${n.toString().padStart(2, "0")}T${r.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}:${o.toString().padStart(2, "0")}`;
558
- }, be = (t) => {
559
- const { value: e, onBlur: a, onChange: n, onInput: r, after: s, disabled: o } = t, c = p.map(e, (l) => l != null ? qt(l) : null), i = X(e, o, n ?? r);
560
- return L({
565
+ }, we = (t) => {
566
+ const { value: e, onBlur: a, onChange: n, onInput: r, after: s, disabled: o } = t, c = p.map(e, (l) => l != null ? Qt(l) : null), i = X(e, o, n ?? r);
567
+ return P({
561
568
  ...t,
562
- input: ut["datetime-local"](
569
+ input: pt["datetime-local"](
563
570
  O(t),
564
571
  u.value(p.map(c, (l) => l ?? null)),
565
572
  u.class("bc-input"),
566
- a != null ? I.blur(st(a)) : S,
567
- n != null ? I.change(ct(n)) : S,
568
- r != null ? I.input(ct(r)) : S
573
+ a != null ? I.blur(at(a)) : A,
574
+ n != null ? I.change(it(n)) : A,
575
+ r != null ? I.input(it(r)) : A
569
576
  ),
570
577
  after: s != null ? j(i, s) : i
571
578
  });
572
- }, we = P(Ct), ye = P(xt), Me = P(Tt), Ie = P(
573
- yt
574
- ), $e = ({
579
+ }, ye = L(Tt), Me = L(_t), Ie = L(St), $e = L(
580
+ Mt
581
+ ), xe = ({
575
582
  value: t,
576
583
  onChange: e,
577
584
  onInput: a,
@@ -583,28 +590,29 @@ const fe = ({
583
590
  id: i,
584
591
  color: l = "primary",
585
592
  tabIndex: d = 0,
586
- matchInputHeight: g = !0
593
+ matchInputHeight: h = !0,
594
+ ariaLabel: w
587
595
  }) => {
588
- const m = i ?? St("switch");
589
- function h(y, F) {
590
- const w = [
596
+ const f = i ?? At("switch");
597
+ function g(M, b) {
598
+ const $ = [
591
599
  "bc-switch",
592
- `bc-switch--size-${F}`,
593
- `bc-switch--${F}`
600
+ `bc-switch--size-${b}`,
601
+ `bc-switch--${b}`
594
602
  ];
595
- return g && w.push("bc-switch--match-input"), y && w.push("bc-switch--disabled"), w.join(" ");
603
+ return h && $.push("bc-switch--match-input"), M && $.push("bc-switch--disabled"), $.join(" ");
596
604
  }
597
- function b(y) {
598
- const F = y ?? "primary", w = /* @__PURE__ */ new Map(), A = it(F, "solid", "light"), T = it(F, "solid", "dark");
599
- return w.set("--switch-track-on-bg", A.backgroundColor), w.set("--switch-track-on-label", A.textColor), w.set("--switch-track-on-bg-dark", T.backgroundColor), w.set("--switch-track-on-label-dark", T.textColor), w.set(
605
+ function y(M) {
606
+ const b = M ?? "primary", $ = /* @__PURE__ */ new Map(), S = lt(b, "solid", "light"), k = lt(b, "solid", "dark");
607
+ return $.set("--switch-track-on-bg", S.backgroundColor), $.set("--switch-track-on-label", S.textColor), $.set("--switch-track-on-bg-dark", k.backgroundColor), $.set("--switch-track-on-label-dark", k.textColor), $.set(
600
608
  "--switch-track-on-border-dark",
601
- kt(F, "dark")
602
- ), Array.from(w.entries()).map(([k, Y]) => `${k}: ${Y}`).join("; ");
609
+ Ft(b, "dark")
610
+ ), Array.from($.entries()).map(([Y, G]) => `${Y}: ${G}`).join("; ");
603
611
  }
604
- const M = () => {
612
+ const F = () => {
605
613
  p.get(o) || (e?.(!p.get(t)), a?.(!p.get(t)));
606
- }, $ = (y) => {
607
- p.get(o) || (y.key === " " || y.key === "Enter") && (y.preventDefault(), M());
614
+ }, T = (M) => {
615
+ p.get(o) || (M.key === " " || M.key === "Enter") && (M.preventDefault(), F());
608
616
  };
609
617
  return _.div(
610
618
  u.class(
@@ -612,42 +620,43 @@ const fe = ({
612
620
  o ?? !1,
613
621
  c
614
622
  )(
615
- (y, F) => h(y ?? !1, F ?? "md")
623
+ (M, b) => g(M ?? !1, b ?? "md")
616
624
  )
617
625
  ),
618
626
  u.style(
619
627
  D(l)(
620
- (y) => b(y)
628
+ (M) => y(M)
621
629
  )
622
630
  ),
623
- u.id(m),
631
+ u.id(f),
624
632
  u.role("switch"),
625
633
  u.tabindex(
626
634
  D(
627
635
  o ?? !1,
628
636
  d
629
- )((y, F) => y ? -1 : F ?? 0)
637
+ )((M, b) => M ? -1 : b ?? 0)
630
638
  ),
631
- B.checked(t),
632
- B.disabled(o),
633
- I.click(M),
634
- I.keydown($),
639
+ R.checked(t),
640
+ R.disabled(o),
641
+ w != null ? R.label(w) : null,
642
+ I.click(F),
643
+ I.keydown(T),
635
644
  n != null ? I.blur(n) : null,
636
645
  _.div(
637
646
  u.class("bc-switch__track"),
638
647
  u.class(
639
648
  p.map(
640
649
  t,
641
- (y) => y ? "bc-switch__track--on" : "bc-switch__track--off"
650
+ (M) => M ? "bc-switch__track--on" : "bc-switch__track--off"
642
651
  )
643
652
  ),
644
653
  r != null ? _.div(
645
- B.hidden(!0),
654
+ R.hidden(!0),
646
655
  u.class("bc-switch__track-label bc-switch__track-label--off"),
647
656
  u.class(
648
657
  p.map(
649
658
  t,
650
- (y) => y ? "bc-switch__track-label--hidden" : "bc-switch__track-label--visible"
659
+ (M) => M ? "bc-switch__track-label--hidden" : "bc-switch__track-label--visible"
651
660
  )
652
661
  ),
653
662
  r
@@ -657,7 +666,7 @@ const fe = ({
657
666
  u.class(
658
667
  p.map(
659
668
  t,
660
- (y) => y ? "bc-switch__track-label--visible" : "bc-switch__track-label--hidden"
669
+ (M) => M ? "bc-switch__track-label--visible" : "bc-switch__track-label--hidden"
661
670
  )
662
671
  ),
663
672
  s
@@ -667,13 +676,13 @@ const fe = ({
667
676
  u.class(
668
677
  p.map(
669
678
  t,
670
- (y) => y ? "bc-switch__thumb--on" : "bc-switch__thumb--off"
679
+ (M) => M ? "bc-switch__thumb--on" : "bc-switch__thumb--off"
671
680
  )
672
681
  )
673
682
  )
674
683
  )
675
684
  );
676
- }, xe = P(Mt), Qt = "line-md:star-alt-filled", Jt = "line-md:star-alt", Zt = (t) => {
685
+ }, _e = L(It), Jt = "line-md:star-alt-filled", Zt = "line-md:star-alt", te = (t) => {
677
686
  const {
678
687
  value: e,
679
688
  onChange: a,
@@ -682,30 +691,30 @@ const fe = ({
682
691
  max: s = 5,
683
692
  fullColor: o = "yellow",
684
693
  emptyColor: c = "neutral",
685
- activeIcon: i = Qt,
686
- inactiveIcon: l = Jt,
694
+ activeIcon: i = Jt,
695
+ inactiveIcon: l = Zt,
687
696
  size: d = "md",
688
- onBlur: g,
689
- rounding: m = 1
690
- } = t, h = () => {
691
- const w = p.get(m);
692
- return w > 0 ? w : 1;
693
- }, b = (w) => Math.min(Math.max(w, 0), p.get(s)), M = (w, A) => {
697
+ onBlur: h,
698
+ rounding: w = 1
699
+ } = t, f = () => {
700
+ const b = p.get(w);
701
+ return b > 0 ? b : 1;
702
+ }, g = (b) => Math.min(Math.max(b, 0), p.get(s)), y = (b, $) => {
694
703
  if (p.get(r ?? !1)) return;
695
- const k = w.currentTarget.getBoundingClientRect(), Y = (w.clientX - k.left) / k.width, at = A - 1 + Y, G = h(), K = Math.ceil(at / G) * G, f = b(K);
696
- a?.(f), n?.(f);
697
- }, $ = (w) => {
704
+ const k = b.currentTarget.getBoundingClientRect(), Y = (b.clientX - k.left) / k.width, G = $ - 1 + Y, q = f(), rt = Math.ceil(G / q) * q, K = g(rt);
705
+ a?.(K), n?.(K);
706
+ }, F = (b) => {
698
707
  if (p.get(r ?? !1)) return;
699
- const A = h(), T = p.get(e) ?? 0;
708
+ const $ = f(), S = p.get(e) ?? 0;
700
709
  let k;
701
- switch (w.key) {
710
+ switch (b.key) {
702
711
  case "ArrowRight":
703
712
  case "ArrowUp":
704
- k = b(T + A);
713
+ k = g(S + $);
705
714
  break;
706
715
  case "ArrowLeft":
707
716
  case "ArrowDown":
708
- k = b(T - A);
717
+ k = g(S - $);
709
718
  break;
710
719
  case "Home":
711
720
  k = 0;
@@ -716,11 +725,17 @@ const fe = ({
716
725
  default:
717
726
  return;
718
727
  }
719
- w.preventDefault(), a?.(k), n?.(k);
720
- }, y = p.map(d, (w) => `bc-icon--${w}`), F = ({ index: w, counter: A }) => _.span(
728
+ b.preventDefault(), a?.(k), n?.(k);
729
+ }, T = p.map(d, (b) => `bc-icon--${b}`), M = ({ index: b, counter: $ }) => _.span(
721
730
  u.class("bc-rating-input__icon-container"),
722
- u.class(y),
723
- tt(
731
+ u.class(T),
732
+ I.click(
733
+ bt((S) => y(S, $), {
734
+ preventDefault: !0,
735
+ stopPropagation: !0
736
+ })
737
+ ),
738
+ et(
724
739
  {
725
740
  icon: l,
726
741
  size: d,
@@ -731,14 +746,14 @@ const fe = ({
731
746
  ),
732
747
  _.span(
733
748
  u.class("bc-rating-input__icon-clipper"),
734
- u.class(y),
735
- mt.width(
736
- p.map(e, (T) => {
737
- const k = Math.floor(T);
738
- return k > w ? "100%" : k < w ? "0%" : `${(T - w) * 100}%`;
749
+ u.class(T),
750
+ wt.width(
751
+ p.map(e, (S) => {
752
+ const k = Math.floor(S);
753
+ return k > b ? "100%" : k < b ? "0%" : `${(S - b) * 100}%`;
739
754
  })
740
755
  ),
741
- tt(
756
+ et(
742
757
  {
743
758
  icon: i,
744
759
  size: d,
@@ -747,15 +762,9 @@ const fe = ({
747
762
  },
748
763
  u.class("bc-rating-input__icon-full")
749
764
  )
750
- ),
751
- I.click(
752
- bt((T) => M(T, A), {
753
- preventDefault: !0,
754
- stopPropagation: !0
755
- })
756
765
  )
757
766
  );
758
- return L({
767
+ return P({
759
768
  baseContainer: !0,
760
769
  growInput: !1,
761
770
  focusableSelector: '[role="slider"]',
@@ -766,28 +775,28 @@ const fe = ({
766
775
  u.class("bc-rating-input"),
767
776
  // ARIA slider semantics
768
777
  u.role("slider"),
769
- u.tabindex(p.map(r ?? !1, (w) => w ? -1 : 0)),
770
- B.disabled(r ?? !1),
771
- B.valuemin(0),
772
- B.valuemax(p.map(s, (w) => w ?? 0)),
773
- B.valuenow(p.map(e, (w) => w ?? 0)),
774
- B.valuetext(
778
+ u.tabindex(p.map(r ?? !1, (b) => b ? -1 : 0)),
779
+ R.disabled(r ?? !1),
780
+ R.valuemin(0),
781
+ R.valuemax(p.map(s, (b) => b ?? 0)),
782
+ R.valuenow(p.map(e, (b) => b ?? 0)),
783
+ R.valuetext(
775
784
  D(
776
785
  e,
777
786
  s
778
- )((w, A) => {
779
- const T = w ?? 0, k = A ?? 0;
780
- return `${String(T)} / ${String(k)}`;
787
+ )((b, $) => {
788
+ const S = b ?? 0, k = $ ?? 0;
789
+ return `${String(S)} / ${String(k)}`;
781
790
  })
782
791
  ),
783
792
  // Keyboard & focus handlers
784
- I.keydown($),
785
- g != null ? I.blur(g) : null,
786
- ft(s, F)
793
+ I.keydown(F),
794
+ h != null ? I.blur(h) : null,
795
+ mt(s, M)
787
796
  )
788
797
  });
789
- }, _e = (t) => {
790
- const { after: e, disabled: a } = t, n = pt(
798
+ }, ke = (t) => {
799
+ const { after: e, disabled: a } = t, n = dt(
791
800
  t,
792
801
  (s) => s ?? 0,
793
802
  (s) => s
@@ -796,13 +805,13 @@ const fe = ({
796
805
  a,
797
806
  t.onChange ?? t.onInput
798
807
  );
799
- return Zt({
808
+ return te({
800
809
  ...n,
801
810
  after: e != null ? j(r, e) : r
802
811
  });
803
- }, ke = (t) => {
812
+ }, Fe = (t) => {
804
813
  const { value: e, step: a, min: n, max: r, onBlur: s, onChange: o, onInput: c } = t;
805
- return L({
814
+ return P({
806
815
  ...t,
807
816
  // Make sure clicks anywhere focus the range input
808
817
  focusableSelector: 'input[type="range"]',
@@ -815,22 +824,22 @@ const fe = ({
815
824
  // Using value as number to keep it in sync
816
825
  u.valueAsNumber(e),
817
826
  u.class("bc-input bc-slider-input"),
818
- s != null ? I.blur(E(s)) : S,
819
- o != null ? I.change(E(o)) : S,
820
- c != null ? I.input(E(c)) : S
827
+ s != null ? I.blur(E(s)) : A,
828
+ o != null ? I.change(E(o)) : A,
829
+ c != null ? I.input(E(c)) : A
821
830
  )
822
831
  });
823
- }, Fe = (t) => {
832
+ }, Ce = (t) => {
824
833
  const { value: e, step: a, min: n, max: r, onBlur: s, onChange: o, onInput: c } = t, i = p.map(e, (d) => {
825
834
  if (d != null) return d;
826
- const g = n != null ? p.get(n) : void 0;
827
- return typeof g == "number" ? g : 0;
835
+ const h = n != null ? p.get(n) : void 0;
836
+ return typeof h == "number" ? h : 0;
828
837
  }), l = X(
829
838
  e,
830
839
  t.disabled,
831
840
  o ?? c
832
841
  );
833
- return L({
842
+ return P({
834
843
  ...t,
835
844
  focusableSelector: 'input[type="range"]',
836
845
  after: l,
@@ -842,21 +851,21 @@ const fe = ({
842
851
  u.step(a),
843
852
  u.valueAsNumber(i),
844
853
  u.class("bc-input bc-slider-input"),
845
- s != null ? I.blur(E(s)) : S,
854
+ s != null ? I.blur(E(s)) : A,
846
855
  o != null ? I.change(
847
856
  E((d) => {
848
857
  o(d);
849
858
  })
850
- ) : S,
859
+ ) : A,
851
860
  c != null ? I.input(
852
861
  E((d) => {
853
862
  c(d);
854
863
  })
855
- ) : S
864
+ ) : A
856
865
  )
857
866
  });
858
- }, Ce = P(It);
859
- class te {
867
+ }, Te = L($t);
868
+ class ee {
860
869
  widgets = /* @__PURE__ */ new Map();
861
870
  typeMapping = /* @__PURE__ */ new Map();
862
871
  // JSON Schema type -> widget names
@@ -907,7 +916,7 @@ class te {
907
916
  * Find the best widget for a schema context
908
917
  */
909
918
  findBestWidget(e) {
910
- const a = At(e.definition, e.name);
919
+ const a = vt(e.definition, e.name);
911
920
  if (a?.widget) {
912
921
  const r = this.widgets.get(a.widget);
913
922
  if (r)
@@ -948,8 +957,8 @@ class te {
948
957
  return null;
949
958
  }
950
959
  }
951
- const Te = new te();
952
- function Se(t, e, a) {
960
+ const Se = new ee();
961
+ function Ae(t, e, a) {
953
962
  return {
954
963
  factory: e,
955
964
  matcher: (n) => {
@@ -962,7 +971,7 @@ function Se(t, e, a) {
962
971
  ...a
963
972
  };
964
973
  }
965
- function Ae(t, e, a) {
974
+ function ve(t, e, a) {
966
975
  return {
967
976
  factory: e,
968
977
  matcher: (n) => n.definition.format === t,
@@ -971,7 +980,7 @@ function Ae(t, e, a) {
971
980
  ...a
972
981
  };
973
982
  }
974
- function ve(t, e, a, n) {
983
+ function Ne(t, e, a, n) {
975
984
  return {
976
985
  factory: a,
977
986
  matcher: (r) => {
@@ -983,7 +992,7 @@ function ve(t, e, a, n) {
983
992
  ...n
984
993
  };
985
994
  }
986
- function Ne(t) {
995
+ function Re(t) {
987
996
  const e = t?.logPrefix ?? "WIDGET_DIAG", a = t?.filterFn ?? (() => !0);
988
997
  return {
989
998
  factory: () => null,
@@ -1006,52 +1015,52 @@ function Ne(t) {
1006
1015
  };
1007
1016
  }
1008
1017
  export {
1009
- Lt as A,
1010
- he as B,
1011
- ge as C,
1012
- Rt as D,
1013
- fe as E,
1014
- vt as F,
1015
- Nt as G,
1016
- Z as H,
1017
- Et as I,
1018
- Pt as J,
1019
- Dt as K,
1018
+ Ot as A,
1019
+ ge as B,
1020
+ fe as C,
1021
+ Bt as D,
1022
+ me as E,
1023
+ Nt as F,
1024
+ Rt as G,
1025
+ tt as H,
1026
+ Pt as I,
1027
+ Ut as J,
1028
+ Vt as K,
1020
1029
  W as L,
1021
- et as M,
1022
- ye as N,
1023
- nt as O,
1024
- Ot as P,
1025
- Ut as Q,
1026
- Zt as R,
1027
- ke as S,
1028
- J as T,
1029
- Vt as U,
1030
- te as W,
1031
- Ie as a,
1032
- xe as b,
1033
- Ce as c,
1034
- Me as d,
1035
- be as e,
1036
- me as f,
1037
- Te as g,
1038
- we as h,
1039
- Fe as i,
1040
- _e as j,
1041
- $e as k,
1042
- Ne as l,
1043
- Ae as m,
1044
- ve as n,
1045
- Se as o,
1046
- Gt as p,
1047
- Kt as q,
1048
- pe as r,
1049
- dt as s,
1050
- Bt as t,
1051
- Xt as u,
1052
- Wt as v,
1030
+ nt as M,
1031
+ Me as N,
1032
+ st as O,
1033
+ Lt as P,
1034
+ Wt as Q,
1035
+ te as R,
1036
+ Fe as S,
1037
+ Z as T,
1038
+ Et as U,
1039
+ ee as W,
1040
+ $e as a,
1041
+ _e as b,
1042
+ Te as c,
1043
+ Ie as d,
1044
+ we as e,
1045
+ be as f,
1046
+ Se as g,
1047
+ ye as h,
1048
+ Ce as i,
1049
+ ke as j,
1050
+ xe as k,
1051
+ Re as l,
1052
+ ve as m,
1053
+ Ne as n,
1054
+ Ae as o,
1055
+ Kt as p,
1056
+ qt as q,
1057
+ de as r,
1058
+ ht as s,
1059
+ Dt as t,
1060
+ Yt as u,
1061
+ zt as v,
1053
1062
  U as w,
1054
- de as x,
1055
- z as y,
1056
- ht as z
1063
+ he as x,
1064
+ H as y,
1065
+ gt as z
1057
1066
  };