@tempots/beatui 0.83.4 → 0.85.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.
- package/dist/beatui.css +840 -428
- package/dist/beatui.tailwind.css +840 -428
- package/dist/{index-C2_iX1um.cjs → index-4GQLcxme.cjs} +1 -1
- package/dist/{index-DiEcd7ZV.js → index-BFe-x3-z.js} +2 -2
- package/dist/index-BywbRDsb.cjs +1 -0
- package/dist/{index-Bm43lZqE.cjs → index-BzRuy4V1.cjs} +3 -3
- package/dist/{index-Di1_W_7Q.js → index-D2_J_-XS.js} +46 -45
- package/dist/{index-CEqc0H3v.js → index-DfJMDwSU.js} +1 -1
- package/dist/{index-CCMjK4fD.js → index-KNk3k6NI.js} +1 -1
- package/dist/{index-BS31JX7x.cjs → index-anrXec7K.cjs} +1 -1
- package/dist/{index-C32iUFIr.js → index-vzoI95E1.js} +3 -3
- package/dist/{index-BZYWyjM_.cjs → index-yMrXbIdg.cjs} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +865 -848
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +2 -2
- package/dist/lexical/index.cjs.js +2 -2
- package/dist/lexical/index.es.js +5 -5
- package/dist/lexical.css +79 -79
- package/dist/markdown/index.cjs.js +1 -1
- package/dist/markdown/index.es.js +1 -1
- package/dist/menu-DMAhcoJ2.js +377 -0
- package/dist/menu-q8xJaBIb.cjs +1 -0
- package/dist/monaco/index.cjs.js +2 -2
- package/dist/monaco/index.es.js +2 -2
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/prosemirror.css +10 -10
- package/dist/styles-url-BSUFsmMD.cjs +1 -0
- package/dist/styles-url-BvcVGpBJ.js +4 -0
- package/dist/styles-url-BzPix7VR.cjs +1 -0
- package/dist/styles-url-CCopc5pG.js +4 -0
- package/dist/styles-url-CEDSZTyZ.cjs +1 -0
- package/dist/styles-url-CSXq0ZRz.js +4 -0
- package/dist/styles-url-DZhZ-9Bf.js +4 -0
- package/dist/styles-url-YAJ6Q1GS.cjs +1 -0
- package/dist/tailwind/preset.cjs.js +1 -1
- package/dist/tailwind/preset.es.js +18 -18
- package/dist/tailwind/vite-plugin.cjs.js +12 -15
- package/dist/tailwind/vite-plugin.es.js +178 -181
- package/dist/{theme-B5pmbvQ_.js → theme-BzpMLdvH.js} +6 -6
- package/dist/theme-DogY9oT1.cjs +1 -0
- package/dist/types/components/form/input/advanced-slider.d.ts +1 -1
- package/dist/types/components/form/input/combobox-input.d.ts +2 -0
- package/dist/types/components/form/input/switch.d.ts +2 -1
- package/dist/types/components/theme/theme.d.ts +5 -4
- package/dist/types/lexical/types.d.ts +1 -1
- package/dist/types/tailwind/preset.d.ts +1 -1
- package/dist/widget-customization-BngYjPvO.cjs +1 -0
- package/dist/{widget-customization-0is7oTeP.js → widget-customization-D-Vvr4vg.js} +300 -329
- package/package.json +1 -1
- package/dist/index-DH37GTQj.cjs +0 -1
- package/dist/menu-CX72LaZ3.cjs +0 -1
- package/dist/menu-D_slbwl8.js +0 -374
- package/dist/styles-url-B3p8AqBy.cjs +0 -1
- package/dist/styles-url-COuz9fVH.js +0 -4
- package/dist/styles-url-CVCcF0ra.cjs +0 -1
- package/dist/styles-url-CZUL_YRT.cjs +0 -1
- package/dist/styles-url-CzNVxeM7.js +0 -4
- package/dist/styles-url-D8MjxiP-.cjs +0 -1
- package/dist/styles-url-DUdp56Ts.js +0 -4
- package/dist/styles-url-DpP5gepF.js +0 -4
- package/dist/theme-Dt6lCAvY.cjs +0 -1
- package/dist/widget-customization-B-LmxkPE.cjs +0 -1
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { Value as p, prop as rt, computedOf as D, html as
|
|
1
|
+
import { Value as p, prop as rt, computedOf as D, html as k, attr as u, svg as tt, svgAttr as Y, on as M, Empty as A, When as H, Fragment as E, aria as N, emitValue as Z, Use as lt, input as ot, emitValueAsNullableDate as et, emitValueAsNullableDateTime as nt, Repeat as ut, style as pt, emit as dt, emitValueAsNumber as V } from "@tempots/dom";
|
|
2
2
|
import { F as ht, N as z, T as gt, U as ft, a as mt } from "./deep-merge-CmQoIYPC.js";
|
|
3
3
|
import { $ as bt } from "./string-DYyMxBl-.js";
|
|
4
|
-
import { I as
|
|
5
|
-
import { C as
|
|
6
|
-
import { B as yt, I as q,
|
|
7
|
-
import { AutoSelect as Mt
|
|
8
|
-
import { E as
|
|
9
|
-
import { s as
|
|
10
|
-
import { r as
|
|
11
|
-
function
|
|
4
|
+
import { I as U } from "./input-container-Nx0gMAzS.js";
|
|
5
|
+
import { C as L, T as wt } from "./text-input-CPJzUC2r.js";
|
|
6
|
+
import { B as yt, I as q, b as st, a as It } from "./translations-BGblCUBj.js";
|
|
7
|
+
import { AutoSelect as Mt } from "@tempots/ui";
|
|
8
|
+
import { E as $t, P as xt } from "./notice-Dz4nX57_.js";
|
|
9
|
+
import { s as _t } from "./session-id-3KiilioY.js";
|
|
10
|
+
import { r as kt } from "./utils-DEbsp9Q9.js";
|
|
11
|
+
function it(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
|
|
16
|
+
function Ft(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, s = t.match(e);
|
|
19
19
|
if (!s) return !1;
|
|
20
|
-
const [, n, r, a] = s, o = parseInt(n, 10),
|
|
21
|
-
return o >= 0 && o <= 255 &&
|
|
20
|
+
const [, n, r, a] = s, o = parseInt(n, 10), i = parseInt(r, 10), c = parseInt(a, 10);
|
|
21
|
+
return o >= 0 && o <= 255 && i >= 0 && i <= 255 && c >= 0 && c <= 255;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Ct(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, s = t.match(e);
|
|
26
26
|
if (!s) return !1;
|
|
27
|
-
const [, n, r, a, o] = s,
|
|
28
|
-
return
|
|
27
|
+
const [, n, r, a, o] = s, i = parseInt(n, 10), c = parseInt(r, 10), l = parseInt(a, 10), d = parseFloat(o);
|
|
28
|
+
return i >= 0 && i <= 255 && c >= 0 && c <= 255 && l >= 0 && l <= 255 && d >= 0 && d <= 1;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function Tt(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, s = t.match(e);
|
|
33
33
|
if (!s) return !1;
|
|
34
|
-
const [, n, r, a] = s, o = parseInt(n, 10),
|
|
35
|
-
return o >= 0 && o <= 360 &&
|
|
34
|
+
const [, n, r, a] = s, o = parseInt(n, 10), i = parseInt(r, 10), c = parseInt(a, 10);
|
|
35
|
+
return o >= 0 && o <= 360 && i >= 0 && i <= 100 && c >= 0 && c <= 100;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function re(t) {
|
|
38
|
+
return it(t) || Ft(t) || Ct(t) || Tt(t);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
if (!
|
|
40
|
+
function At(t) {
|
|
41
|
+
if (!it(t)) return null;
|
|
42
42
|
let e = t.startsWith("#") ? t.slice(1) : t;
|
|
43
43
|
return e.length === 3 && (e = e.split("").map((s) => s + s).join("")), `#${e.toLowerCase()}`;
|
|
44
44
|
}
|
|
@@ -50,7 +50,7 @@ function Q(t, e, s) {
|
|
|
50
50
|
return `#${n(t)}${n(e)}${n(s)}`;
|
|
51
51
|
}
|
|
52
52
|
function j(t) {
|
|
53
|
-
const e =
|
|
53
|
+
const e = At(t);
|
|
54
54
|
if (!e) return null;
|
|
55
55
|
const s = /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
|
|
56
56
|
return s ? {
|
|
@@ -59,16 +59,16 @@ function j(t) {
|
|
|
59
59
|
b: parseInt(s[3], 16)
|
|
60
60
|
} : null;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function oe(t, e) {
|
|
63
63
|
const s = j(t), n = j(e);
|
|
64
64
|
if (!s || !n) return null;
|
|
65
65
|
const r = (l, d, f) => {
|
|
66
|
-
const [m, h, w] = [l, d, f].map((
|
|
66
|
+
const [m, h, w] = [l, d, f].map((I) => (I = I / 255, I <= 0.03928 ? I / 12.92 : Math.pow((I + 0.055) / 1.055, 2.4)));
|
|
67
67
|
return 0.2126 * m + 0.7152 * h + 0.0722 * w;
|
|
68
|
-
}, a = r(s.r, s.g, s.b), o = r(n.r, n.g, n.b),
|
|
69
|
-
return (
|
|
68
|
+
}, a = r(s.r, s.g, s.b), o = r(n.r, n.g, n.b), i = Math.max(a, o), c = Math.min(a, o);
|
|
69
|
+
return (i + 0.05) / (c + 0.05);
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function St(t) {
|
|
72
72
|
if (!t) return [0, 0, 0, 1];
|
|
73
73
|
const s = t.trim().match(
|
|
74
74
|
/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/
|
|
@@ -114,78 +114,78 @@ function Rt(t) {
|
|
|
114
114
|
/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
115
115
|
);
|
|
116
116
|
if (a) {
|
|
117
|
-
const l = parseFloat(a[1]), d = parseFloat(a[2]), f = parseFloat(a[3]), m = a[4] != null ? parseFloat(a[4]) : 1, [h, w,
|
|
118
|
-
return [h, w,
|
|
117
|
+
const l = parseFloat(a[1]), d = parseFloat(a[2]), f = parseFloat(a[3]), m = a[4] != null ? parseFloat(a[4]) : 1, [h, w, I] = ct(l, d / 100, f / 100);
|
|
118
|
+
return [h, w, I, m];
|
|
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, f = parseFloat(o[3]) / 100, m = o[4] != null ? parseFloat(o[4]) : 1, [h, w,
|
|
125
|
-
return [h, w,
|
|
124
|
+
const l = parseFloat(o[1]), d = parseFloat(o[2]) / 100, f = parseFloat(o[3]) / 100, m = o[4] != null ? parseFloat(o[4]) : 1, [h, w, I] = Nt(l, d, f);
|
|
125
|
+
return [h, w, I, m];
|
|
126
126
|
}
|
|
127
|
-
const
|
|
127
|
+
const i = t.match(
|
|
128
128
|
/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i
|
|
129
129
|
);
|
|
130
|
-
if (
|
|
131
|
-
const l =
|
|
132
|
-
return [w,
|
|
130
|
+
if (i) {
|
|
131
|
+
const l = i[1], d = parseFloat(i[2]), f = parseFloat(i[3]), m = i[4] != null ? parseFloat(i[4]) : 1, h = l.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(l) / 100)) : Math.max(0, Math.min(1, parseFloat(l))), [w, I, x] = Bt(h, d, f);
|
|
132
|
+
return [w, I, x, m];
|
|
133
133
|
}
|
|
134
|
-
const
|
|
135
|
-
return
|
|
134
|
+
const c = j(t);
|
|
135
|
+
return c ? [c.r, c.g, c.b, 1] : [0, 0, 0, 1];
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function vt(t, e, s, n) {
|
|
138
138
|
return `rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(s)}, ${Math.max(
|
|
139
139
|
0,
|
|
140
140
|
Math.min(1, Math.round(n * 100) / 100)
|
|
141
141
|
)})`;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function Rt(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
|
|
149
|
+
function ct(t, e, s) {
|
|
150
150
|
t = (t % 360 + 360) % 360;
|
|
151
151
|
const n = (1 - Math.abs(2 * s - 1)) * e, r = n * (1 - Math.abs(t / 60 % 2 - 1)), a = s - n / 2;
|
|
152
|
-
let o = 0,
|
|
153
|
-
return 0 <= t && t < 60 ? [o,
|
|
152
|
+
let o = 0, i = 0, c = 0;
|
|
153
|
+
return 0 <= t && t < 60 ? [o, i, c] = [n, r, 0] : 60 <= t && t < 120 ? [o, i, c] = [r, n, 0] : 120 <= t && t < 180 ? [o, i, c] = [0, n, r] : 180 <= t && t < 240 ? [o, i, c] = [0, r, n] : 240 <= t && t < 300 ? [o, i, c] = [r, 0, n] : [o, i, c] = [n, 0, r], [
|
|
154
154
|
Math.round((o + a) * 255),
|
|
155
|
-
Math.round((
|
|
156
|
-
Math.round((
|
|
155
|
+
Math.round((i + a) * 255),
|
|
156
|
+
Math.round((c + a) * 255)
|
|
157
157
|
];
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function Nt(t, e, s) {
|
|
160
160
|
t = (t % 360 + 360) % 360;
|
|
161
161
|
const n = e + s;
|
|
162
162
|
n > 1 && (e /= n, s /= n);
|
|
163
|
-
const [r, a, o] =
|
|
164
|
-
return [Math.round(
|
|
163
|
+
const [r, a, o] = ct(t, 1, 0.5).map((f) => f / 255), i = 1 - e - s, c = r * i + e, l = a * i + e, d = o * i + e;
|
|
164
|
+
return [Math.round(c * 255), Math.round(l * 255), Math.round(d * 255)];
|
|
165
165
|
}
|
|
166
166
|
function J(t, e, s) {
|
|
167
167
|
t /= 255, e /= 255, s /= 255;
|
|
168
168
|
const n = Math.max(t, e, s), r = Math.min(t, e, s);
|
|
169
169
|
let a = 0, o = 0;
|
|
170
|
-
const
|
|
171
|
-
if (
|
|
172
|
-
switch (o =
|
|
170
|
+
const i = (n + r) / 2, c = n - r;
|
|
171
|
+
if (c !== 0) {
|
|
172
|
+
switch (o = i > 0.5 ? c / (2 - n - r) : c / (n + r), n) {
|
|
173
173
|
case t:
|
|
174
|
-
a = (e - s) /
|
|
174
|
+
a = (e - s) / c + (e < s ? 6 : 0);
|
|
175
175
|
break;
|
|
176
176
|
case e:
|
|
177
|
-
a = (s - t) /
|
|
177
|
+
a = (s - t) / c + 2;
|
|
178
178
|
break;
|
|
179
179
|
default:
|
|
180
|
-
a = (t - e) /
|
|
180
|
+
a = (t - e) / c + 4;
|
|
181
181
|
}
|
|
182
182
|
a *= 60;
|
|
183
183
|
}
|
|
184
|
-
return [Math.round(a), Math.round(o * 100), Math.round(
|
|
184
|
+
return [Math.round(a), Math.round(o * 100), Math.round(i * 100)];
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
const [n] = J(t, e, s), r = t / 255, a = e / 255, o = s / 255,
|
|
188
|
-
return [n, Math.round(
|
|
186
|
+
function Dt(t, e, s) {
|
|
187
|
+
const [n] = J(t, e, s), r = t / 255, a = e / 255, o = s / 255, i = Math.min(r, a, o), c = 1 - Math.max(r, a, o);
|
|
188
|
+
return [n, Math.round(i * 100), Math.round(c * 100)];
|
|
189
189
|
}
|
|
190
190
|
function G(t) {
|
|
191
191
|
const e = t / 255;
|
|
@@ -195,21 +195,21 @@ function K(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
|
|
199
|
-
const n = s * Math.PI / 180, r = Math.cos(n) * e, a = Math.sin(n) * e, o = t + 0.3963377774 * r + 0.2158037573 * a,
|
|
198
|
+
function Bt(t, e, s) {
|
|
199
|
+
const n = s * Math.PI / 180, r = Math.cos(n) * e, a = Math.sin(n) * e, o = t + 0.3963377774 * r + 0.2158037573 * a, i = t - 0.1055613458 * r - 0.0638541728 * a, c = t - 0.0894841775 * r - 1.291485548 * a, l = o * o * o, d = i * i * i, f = c * c * c, m = 4.0767416621 * l - 3.3077115913 * d + 0.2309699292 * f, h = -1.2684380046 * l + 2.6097574011 * d - 0.3413193965 * f, w = -0.0041960863 * l - 0.7034186147 * d + 1.707614701 * f;
|
|
200
200
|
return [K(m), K(h), K(w)];
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
const n = G(t), r = G(e), a = G(s), o = 0.4122214708 * n + 0.5363325363 * r + 0.0514459929 * a,
|
|
204
|
-
let
|
|
205
|
-
return
|
|
202
|
+
function Vt(t, e, s) {
|
|
203
|
+
const n = G(t), r = G(e), a = G(s), o = 0.4122214708 * n + 0.5363325363 * r + 0.0514459929 * a, i = 0.2119034982 * n + 0.6806995451 * r + 0.1073969566 * a, c = 0.0883024619 * n + 0.2817188376 * r + 0.6299787005 * a, l = Math.cbrt(o), d = Math.cbrt(i), f = Math.cbrt(c), m = 0.2104542553 * l + 0.793617785 * d - 0.0040720468 * f, h = 1.9779984951 * l - 2.428592205 * d + 0.4505937099 * f, w = 0.0259040371 * l + 0.7827717662 * d - 0.808675766 * f, I = Math.sqrt(h * h + w * w);
|
|
204
|
+
let x = Math.atan2(w, h) * 180 / Math.PI;
|
|
205
|
+
return x < 0 && (x += 360), [m, I, x];
|
|
206
206
|
}
|
|
207
207
|
function O(t, e, s, n, r, a) {
|
|
208
208
|
switch (r) {
|
|
209
209
|
case "hex":
|
|
210
210
|
if (a) {
|
|
211
|
-
const o = (
|
|
212
|
-
return `#${o(t)}${o(e)}${o(s)}${o(
|
|
211
|
+
const o = (c) => c.toString(16).padStart(2, "0"), i = Math.max(0, Math.min(255, Math.round(n * 255)));
|
|
212
|
+
return `#${o(t)}${o(e)}${o(s)}${o(i)}`;
|
|
213
213
|
}
|
|
214
214
|
return Q(t, e, s);
|
|
215
215
|
case "rgb":
|
|
@@ -217,19 +217,19 @@ function O(t, e, s, n, r, a) {
|
|
|
217
217
|
case "rgba":
|
|
218
218
|
return `rgba(${t}, ${e}, ${s}, ${Math.round(n * 100) / 100})`;
|
|
219
219
|
case "hsl": {
|
|
220
|
-
const [o,
|
|
221
|
-
return `hsl(${o}, ${
|
|
220
|
+
const [o, i, c] = J(t, e, s);
|
|
221
|
+
return `hsl(${o}, ${i}%, ${c}%)`;
|
|
222
222
|
}
|
|
223
223
|
case "hsla": {
|
|
224
|
-
const [o,
|
|
225
|
-
return `hsla(${o}, ${
|
|
224
|
+
const [o, i, c] = J(t, e, s);
|
|
225
|
+
return `hsla(${o}, ${i}%, ${c}%, ${Math.round(n * 100) / 100})`;
|
|
226
226
|
}
|
|
227
227
|
case "hwb": {
|
|
228
|
-
const [o,
|
|
229
|
-
return n < 1 ? `hwb(${o} ${
|
|
228
|
+
const [o, i, c] = Dt(t, e, s);
|
|
229
|
+
return n < 1 ? `hwb(${o} ${i}% ${c}% / ${Math.round(n * 100) / 100})` : `hwb(${o} ${i}% ${c}%)`;
|
|
230
230
|
}
|
|
231
231
|
case "oklch": {
|
|
232
|
-
const [o,
|
|
232
|
+
const [o, i, c] = Vt(t, e, s), l = (Math.round(o * 1e3) / 1e3).toFixed(3), d = (Math.round(i * 1e3) / 1e3).toFixed(3), f = (Math.round(c * 10) / 10).toFixed(1), m = Math.round(n * 100) / 100;
|
|
233
233
|
return a || n < 1 ? `oklch(${l} ${d} ${f} / ${m})` : `oklch(${l} ${d} ${f})`;
|
|
234
234
|
}
|
|
235
235
|
}
|
|
@@ -237,7 +237,7 @@ function O(t, e, s, n, r, a) {
|
|
|
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
|
|
240
|
+
async function Et(t) {
|
|
241
241
|
return new Promise((e, s) => {
|
|
242
242
|
const n = new FileReader();
|
|
243
243
|
n.readAsDataURL(t), n.onload = () => {
|
|
@@ -246,10 +246,10 @@ async function Ut(t) {
|
|
|
246
246
|
}, n.onerror = (r) => s(r);
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
|
-
function
|
|
250
|
-
return Promise.all(t.map(
|
|
249
|
+
function Ut(t) {
|
|
250
|
+
return Promise.all(t.map(Et));
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function Lt(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 Ot(t) {
|
|
|
265
265
|
}
|
|
266
266
|
return "application/octet-stream";
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function Pt(t) {
|
|
269
269
|
const e = bt(t ?? ""), s = e.length, n = new Uint8Array(s);
|
|
270
270
|
for (let r = 0; r < s; r++) n[r] = e.charCodeAt(r);
|
|
271
271
|
return n;
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function Ot(t) {
|
|
274
274
|
const {
|
|
275
275
|
value: e,
|
|
276
276
|
onChange: s,
|
|
277
277
|
onInput: n,
|
|
278
278
|
...r
|
|
279
279
|
} = t, a = /* @__PURE__ */ new Map(), o = p.toSignal(e).map((d) => d.map((f, m) => {
|
|
280
|
-
const h = a.get(f), w =
|
|
280
|
+
const h = a.get(f), w = Pt(f ?? ""), I = h?.type || Lt(w), x = h?.name ?? `file-${m}`, y = w.buffer.slice(
|
|
281
281
|
w.byteOffset,
|
|
282
282
|
w.byteOffset + w.byteLength
|
|
283
|
-
), b = new Blob([y], { type:
|
|
284
|
-
return new File([b],
|
|
285
|
-
})),
|
|
286
|
-
d &&
|
|
283
|
+
), b = new Blob([y], { type: I });
|
|
284
|
+
return new File([b], x, { type: I });
|
|
285
|
+
})), i = (d) => (f) => {
|
|
286
|
+
d && Ut(f).then((m) => {
|
|
287
287
|
for (const [h, w] of m.entries())
|
|
288
288
|
a.set(w, { name: f[h].name, type: f[h].type });
|
|
289
289
|
d(m);
|
|
290
290
|
});
|
|
291
|
-
},
|
|
291
|
+
}, c = i(s), l = i(n);
|
|
292
292
|
return ht({
|
|
293
293
|
...r,
|
|
294
294
|
value: o,
|
|
295
|
-
onChange:
|
|
295
|
+
onChange: c,
|
|
296
296
|
onInput: l
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function ie(t) {
|
|
300
300
|
const {
|
|
301
301
|
value: e,
|
|
302
302
|
onInput: s,
|
|
303
303
|
onChange: n,
|
|
304
304
|
...r
|
|
305
305
|
} = t;
|
|
306
|
-
return
|
|
306
|
+
return Ot({
|
|
307
307
|
...r,
|
|
308
308
|
maxFiles: 1,
|
|
309
309
|
value: p.map(e, (a) => a == null ? [] : [a]),
|
|
@@ -315,47 +315,47 @@ function le(t) {
|
|
|
315
315
|
}
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
const [s, n, r] = t, a = s << 16 ^ n << 8 ^ r, o =
|
|
320
|
-
for (let h = 0; h <
|
|
321
|
-
const w = h /
|
|
322
|
-
l.push({ x
|
|
318
|
+
function Wt(t, e) {
|
|
319
|
+
const [s, n, r] = t, a = s << 16 ^ n << 8 ^ r, o = Rt(a), i = 6 + Math.floor(o() * 5), c = 0.18 + o() * 0.06, l = [];
|
|
320
|
+
for (let h = 0; h < i; h++) {
|
|
321
|
+
const w = h / i * Math.PI * 2, I = e * (1 + (o() * 2 - 1) * c), x = Math.cos(w) * I, y = Math.sin(w) * I;
|
|
322
|
+
l.push({ x, y });
|
|
323
323
|
}
|
|
324
|
-
const d = (l[0].x + l[
|
|
324
|
+
const d = (l[0].x + l[i - 1].x) / 2, f = (l[0].y + l[i - 1].y) / 2;
|
|
325
325
|
let m = `M ${d.toFixed(3)} ${f.toFixed(3)}`;
|
|
326
|
-
for (let h = 0; h <
|
|
327
|
-
const w = l[h],
|
|
328
|
-
m += ` Q ${w.x.toFixed(3)} ${w.y.toFixed(3)} ${
|
|
326
|
+
for (let h = 0; h < i; h++) {
|
|
327
|
+
const w = l[h], I = l[(h + 1) % i], x = (w.x + I.x) / 2, y = (w.y + I.y) / 2;
|
|
328
|
+
m += ` Q ${w.x.toFixed(3)} ${w.y.toFixed(3)} ${x.toFixed(3)} ${y.toFixed(3)}`;
|
|
329
329
|
}
|
|
330
330
|
return m += " Z", m;
|
|
331
331
|
}
|
|
332
|
-
const
|
|
333
|
-
const { value: e, onBlur: s, onChange: n, onInput: r, displayValue: a, size: o, withAlpha:
|
|
332
|
+
const ce = (t) => {
|
|
333
|
+
const { value: e, onBlur: s, onChange: n, onInput: r, displayValue: a, size: o, withAlpha: i } = t, c = p.map(o ?? 32, (g) => g), l = p.map(e, (g) => St(g ?? "#000000")), d = p.map(
|
|
334
334
|
l,
|
|
335
|
-
([g,
|
|
336
|
-
), f = p.map(l, ([, , , g]) => g), m = rt(p.get(f) ?? 1), h = p.map(
|
|
335
|
+
([g, $, F]) => [g, $, F]
|
|
336
|
+
), f = p.map(l, ([, , , g]) => g), m = rt(p.get(f) ?? 1), h = p.map(i ?? !1, (g) => g), w = p.map(
|
|
337
337
|
t.colorTextFormat ?? "rgb",
|
|
338
338
|
(g) => g
|
|
339
|
-
),
|
|
339
|
+
), I = D(
|
|
340
340
|
d,
|
|
341
341
|
m,
|
|
342
342
|
w,
|
|
343
343
|
h
|
|
344
344
|
)(
|
|
345
|
-
([g,
|
|
346
|
-
),
|
|
345
|
+
([g, $, F], S, v, R) => O(g, $, F, S ?? 1, W(v, R), R)
|
|
346
|
+
), x = p.map(
|
|
347
347
|
t.colorTextFormat ?? "hex",
|
|
348
348
|
(g) => g
|
|
349
|
-
), y = p.map(
|
|
349
|
+
), y = p.map(c, (g) => `${-g / 2} ${-g / 2} ${g} ${g}`), b = D(
|
|
350
350
|
d,
|
|
351
|
-
|
|
352
|
-
)((g,
|
|
351
|
+
c
|
|
352
|
+
)((g, $) => Wt(g, $ / 2)), _ = D(
|
|
353
353
|
d,
|
|
354
354
|
m,
|
|
355
355
|
h
|
|
356
356
|
)(
|
|
357
|
-
([g,
|
|
358
|
-
), T =
|
|
357
|
+
([g, $, F], S, v) => v || S < 1 ? vt(g, $, F, S) : Q(g, $, F)
|
|
358
|
+
), T = k.div(
|
|
359
359
|
u.class("bc-color-swatch-input__control"),
|
|
360
360
|
u.class(
|
|
361
361
|
p.map(
|
|
@@ -364,46 +364,46 @@ const ue = (t) => {
|
|
|
364
364
|
)
|
|
365
365
|
),
|
|
366
366
|
u.style(
|
|
367
|
-
D(
|
|
367
|
+
D(c)((g) => `min-width:${g + 2}px;height:${g + 2}px`)
|
|
368
368
|
),
|
|
369
369
|
// The SVG blob preview
|
|
370
370
|
tt.svg(
|
|
371
371
|
u.class("bc-color-swatch-input__svg"),
|
|
372
372
|
Y.viewBox(y),
|
|
373
|
-
tt.path(Y.d(b), Y.fill(
|
|
373
|
+
tt.path(Y.d(b), Y.fill(_))
|
|
374
374
|
),
|
|
375
375
|
// Invisible native input overlays the blob for picker and accessibility
|
|
376
|
-
|
|
376
|
+
k.input(
|
|
377
377
|
u.type("color"),
|
|
378
|
-
|
|
378
|
+
L(t),
|
|
379
379
|
// Native color input needs hex without alpha
|
|
380
|
-
u.value(p.map(d, ([g,
|
|
380
|
+
u.value(p.map(d, ([g, $, F]) => Q(g, $, F))),
|
|
381
381
|
u.class(
|
|
382
382
|
"bc-input bc-color-swatch-input bc-color-swatch-input__native"
|
|
383
383
|
),
|
|
384
384
|
s != null ? M.blur(s) : A,
|
|
385
385
|
n != null ? M.change((g) => {
|
|
386
|
-
const
|
|
386
|
+
const $ = g.target.value;
|
|
387
387
|
if (!n) return;
|
|
388
|
-
const { r:
|
|
389
|
-
p.get(
|
|
388
|
+
const { r: F, g: S, b: v } = j($) ?? { r: 0, g: 0, b: 0 }, R = p.get(m) ?? 1, B = W(
|
|
389
|
+
p.get(x),
|
|
390
390
|
p.get(h)
|
|
391
|
-
), X = O(
|
|
391
|
+
), X = O(F, S, v, R, B, p.get(h));
|
|
392
392
|
n(X);
|
|
393
393
|
}) : A,
|
|
394
394
|
r != null ? M.input((g) => {
|
|
395
|
-
const
|
|
395
|
+
const $ = g.target.value;
|
|
396
396
|
if (!r) return;
|
|
397
|
-
const { r:
|
|
398
|
-
p.get(
|
|
397
|
+
const { r: F, g: S, b: v } = j($) ?? { r: 0, g: 0, b: 0 }, R = p.get(m) ?? 1, B = W(
|
|
398
|
+
p.get(x),
|
|
399
399
|
p.get(h)
|
|
400
|
-
), X = O(
|
|
400
|
+
), X = O(F, S, v, R, B, p.get(h));
|
|
401
401
|
r(X);
|
|
402
402
|
}) : A
|
|
403
403
|
)
|
|
404
|
-
),
|
|
404
|
+
), C = H(
|
|
405
405
|
h,
|
|
406
|
-
() =>
|
|
406
|
+
() => k.input(
|
|
407
407
|
u.type("range"),
|
|
408
408
|
u.class("bc-color-swatch-input__alpha"),
|
|
409
409
|
u.min(0),
|
|
@@ -412,26 +412,26 @@ const ue = (t) => {
|
|
|
412
412
|
u.value(p.map(m, (g) => String(g ?? 1))),
|
|
413
413
|
u.disabled(t.disabled),
|
|
414
414
|
M.input((g) => {
|
|
415
|
-
const
|
|
416
|
-
m.set(
|
|
417
|
-
const [
|
|
418
|
-
p.get(
|
|
415
|
+
const $ = parseFloat(g.target.value);
|
|
416
|
+
m.set($);
|
|
417
|
+
const [F, S, v] = p.get(d), R = W(
|
|
418
|
+
p.get(x),
|
|
419
419
|
p.get(h)
|
|
420
|
-
), B = O(
|
|
420
|
+
), B = O(F, S, v, $, R, p.get(h));
|
|
421
421
|
r?.(B);
|
|
422
422
|
}),
|
|
423
423
|
M.change((g) => {
|
|
424
|
-
const
|
|
425
|
-
m.set(
|
|
426
|
-
const [
|
|
427
|
-
p.get(
|
|
424
|
+
const $ = parseFloat(g.target.value);
|
|
425
|
+
m.set($);
|
|
426
|
+
const [F, S, v] = p.get(d), R = W(
|
|
427
|
+
p.get(x),
|
|
428
428
|
p.get(h)
|
|
429
|
-
), B = O(
|
|
429
|
+
), B = O(F, S, v, $, R, p.get(h));
|
|
430
430
|
n?.(B);
|
|
431
431
|
})
|
|
432
432
|
)
|
|
433
433
|
);
|
|
434
|
-
return
|
|
434
|
+
return U({
|
|
435
435
|
baseContainer: !0,
|
|
436
436
|
...t,
|
|
437
437
|
// ensure our control does not try to grow
|
|
@@ -441,68 +441,68 @@ const ue = (t) => {
|
|
|
441
441
|
after: E(
|
|
442
442
|
H(
|
|
443
443
|
a ?? !1,
|
|
444
|
-
() =>
|
|
444
|
+
() => k.span(u.class("bc-color-swatch-input__rgb"), I)
|
|
445
445
|
),
|
|
446
|
-
|
|
446
|
+
C,
|
|
447
447
|
t.after
|
|
448
448
|
)
|
|
449
449
|
});
|
|
450
|
-
},
|
|
450
|
+
}, le = ({
|
|
451
451
|
startEditing: t,
|
|
452
452
|
value: e,
|
|
453
453
|
onChange: s,
|
|
454
454
|
placeholder: n,
|
|
455
455
|
disabled: r
|
|
456
456
|
}) => {
|
|
457
|
-
const a = p.deriveProp(t ?? !1), o = rt(!1),
|
|
458
|
-
return
|
|
457
|
+
const a = p.deriveProp(t ?? !1), o = rt(!1), i = p.map(r ?? !1, (c) => c);
|
|
458
|
+
return k.div(
|
|
459
459
|
u.class("bc-editable-text"),
|
|
460
460
|
u.class(
|
|
461
461
|
p.map(
|
|
462
|
-
|
|
463
|
-
(
|
|
462
|
+
i,
|
|
463
|
+
(c) => c ? "bc-editable-text--disabled" : ""
|
|
464
464
|
)
|
|
465
465
|
),
|
|
466
|
-
N.disabled(
|
|
466
|
+
N.disabled(i),
|
|
467
467
|
H(
|
|
468
468
|
a,
|
|
469
|
-
() =>
|
|
469
|
+
() => k.input(
|
|
470
470
|
u.placeholder(n),
|
|
471
471
|
u.value(e),
|
|
472
472
|
u.class("bc-editable-text__input"),
|
|
473
473
|
Mt(),
|
|
474
|
-
M.keydown((
|
|
475
|
-
|
|
474
|
+
M.keydown((c) => {
|
|
475
|
+
c.key === "Enter" ? a.set(!1) : c.key === "Escape" && (o.set(!0), a.set(!1));
|
|
476
476
|
}),
|
|
477
477
|
M.blur(
|
|
478
|
-
Z((
|
|
478
|
+
Z((c) => {
|
|
479
479
|
if (a.set(!1), o.value) {
|
|
480
480
|
o.set(!1);
|
|
481
481
|
return;
|
|
482
482
|
}
|
|
483
|
-
s(
|
|
483
|
+
s(c);
|
|
484
484
|
})
|
|
485
485
|
)
|
|
486
486
|
),
|
|
487
|
-
() =>
|
|
487
|
+
() => k.span(
|
|
488
488
|
M.click(() => {
|
|
489
|
-
p.get(
|
|
489
|
+
p.get(i) || a.set(!0);
|
|
490
490
|
}),
|
|
491
491
|
u.class("bc-editable-text__display"),
|
|
492
492
|
H(
|
|
493
|
-
p.map(e, (
|
|
494
|
-
() =>
|
|
495
|
-
() =>
|
|
493
|
+
p.map(e, (c) => c != null && c.trim() !== ""),
|
|
494
|
+
() => k.span(u.class("bc-editable-text__text"), e),
|
|
495
|
+
() => k.span(
|
|
496
496
|
u.class("bc-editable-text__placeholder"),
|
|
497
497
|
n
|
|
498
498
|
)
|
|
499
499
|
),
|
|
500
500
|
H(
|
|
501
|
-
p.map(
|
|
502
|
-
() =>
|
|
501
|
+
p.map(i, (c) => !c),
|
|
502
|
+
() => k.button(
|
|
503
503
|
u.type("button"),
|
|
504
504
|
u.class("bc-editable-text__edit-button"),
|
|
505
|
-
|
|
505
|
+
lt(yt, (c) => N.label(c.$.editLabel)),
|
|
506
506
|
M.click(() => a.set(!0)),
|
|
507
507
|
q({ icon: "line-md/pencil", color: "neutral" })
|
|
508
508
|
)
|
|
@@ -510,45 +510,45 @@ const ue = (t) => {
|
|
|
510
510
|
)
|
|
511
511
|
)
|
|
512
512
|
);
|
|
513
|
-
},
|
|
514
|
-
const { value: e, onBlur: s, onChange: n, onInput: r, after: a, disabled: o } = t,
|
|
515
|
-
return
|
|
513
|
+
}, ue = (t) => {
|
|
514
|
+
const { value: e, onBlur: s, onChange: n, onInput: r, after: a, disabled: o } = t, i = z(e, o, n ?? r);
|
|
515
|
+
return U({
|
|
516
516
|
...t,
|
|
517
|
-
input:
|
|
518
|
-
|
|
517
|
+
input: ot.date(
|
|
518
|
+
L(t),
|
|
519
519
|
u.valueAsDate(e),
|
|
520
520
|
u.class("bc-input"),
|
|
521
521
|
s != null ? M.blur(Z(s)) : A,
|
|
522
522
|
n != null ? M.change(et(n)) : A,
|
|
523
523
|
r != null ? M.input(et(r)) : A
|
|
524
524
|
),
|
|
525
|
-
after: a != null ? E(
|
|
525
|
+
after: a != null ? E(i, a) : i
|
|
526
526
|
});
|
|
527
|
-
},
|
|
527
|
+
}, Ht = (t) => {
|
|
528
528
|
const e = t.getFullYear(), s = t.getMonth() + 1, n = t.getDate(), r = t.getHours(), a = t.getMinutes(), o = t.getSeconds();
|
|
529
529
|
return `${e}-${s.toString().padStart(2, "0")}-${n.toString().padStart(2, "0")}T${r.toString().padStart(2, "0")}:${a.toString().padStart(2, "0")}:${o.toString().padStart(2, "0")}`;
|
|
530
|
-
},
|
|
531
|
-
const { value: e, onBlur: s, onChange: n, onInput: r, after: a, disabled: o } = t,
|
|
532
|
-
return
|
|
530
|
+
}, pe = (t) => {
|
|
531
|
+
const { value: e, onBlur: s, onChange: n, onInput: r, after: a, disabled: o } = t, i = p.map(e, (l) => l != null ? Ht(l) : null), c = z(e, o, n ?? r);
|
|
532
|
+
return U({
|
|
533
533
|
...t,
|
|
534
|
-
input:
|
|
535
|
-
|
|
536
|
-
u.value(p.map(
|
|
534
|
+
input: ot["datetime-local"](
|
|
535
|
+
L(t),
|
|
536
|
+
u.value(p.map(i, (l) => l ?? null)),
|
|
537
537
|
u.class("bc-input"),
|
|
538
538
|
s != null ? M.blur(Z(s)) : A,
|
|
539
539
|
n != null ? M.change(nt(n)) : A,
|
|
540
540
|
r != null ? M.input(nt(r)) : A
|
|
541
541
|
),
|
|
542
|
-
after: a != null ? E(
|
|
542
|
+
after: a != null ? E(c, a) : c
|
|
543
543
|
});
|
|
544
|
-
}, at = (t) => typeof t == "string" && t.trim() === "" ? null : t,
|
|
544
|
+
}, at = (t) => typeof t == "string" && t.trim() === "" ? null : t, jt = (t) => t ?? "";
|
|
545
545
|
function P(t) {
|
|
546
546
|
return (e) => {
|
|
547
|
-
const { value: s, onBlur: n, onChange: r, onInput: a, after: o, disabled:
|
|
547
|
+
const { value: s, onBlur: n, onChange: r, onInput: a, after: o, disabled: i, ...c } = e, l = z(s, i, r ?? a);
|
|
548
548
|
return t({
|
|
549
|
-
...
|
|
550
|
-
disabled:
|
|
551
|
-
value: p.map(s,
|
|
549
|
+
...c,
|
|
550
|
+
disabled: i,
|
|
551
|
+
value: p.map(s, jt),
|
|
552
552
|
onChange: r != null ? (d) => r(at(d)) : void 0,
|
|
553
553
|
onInput: a != null ? (d) => a(at(d)) : void 0,
|
|
554
554
|
onBlur: n,
|
|
@@ -556,9 +556,9 @@ function P(t) {
|
|
|
556
556
|
});
|
|
557
557
|
};
|
|
558
558
|
}
|
|
559
|
-
const
|
|
559
|
+
const de = P($t), he = P(wt), ge = P(xt), fe = P(
|
|
560
560
|
gt
|
|
561
|
-
),
|
|
561
|
+
), me = ({
|
|
562
562
|
value: t,
|
|
563
563
|
onChange: e,
|
|
564
564
|
onInput: s,
|
|
@@ -566,38 +566,38 @@ const ge = P(_t), fe = P(wt), me = P(kt), be = P(
|
|
|
566
566
|
offLabel: r,
|
|
567
567
|
onLabel: a,
|
|
568
568
|
disabled: o = !1,
|
|
569
|
-
size:
|
|
570
|
-
id:
|
|
569
|
+
size: i = "md",
|
|
570
|
+
id: c,
|
|
571
571
|
color: l = "primary",
|
|
572
572
|
tabIndex: d = 0,
|
|
573
573
|
matchInputHeight: f = !0
|
|
574
574
|
}) => {
|
|
575
|
-
const m =
|
|
575
|
+
const m = c ?? _t("switch");
|
|
576
576
|
function h(y, b) {
|
|
577
|
-
const
|
|
577
|
+
const _ = [
|
|
578
578
|
"bc-switch",
|
|
579
579
|
`bc-switch--size-${b}`,
|
|
580
580
|
`bc-switch--${b}`
|
|
581
581
|
];
|
|
582
|
-
return f &&
|
|
582
|
+
return f && _.push("bc-switch--match-input"), y && _.push("bc-switch--disabled"), _.join(" ");
|
|
583
583
|
}
|
|
584
584
|
function w(y) {
|
|
585
|
-
const b = y ?? "primary",
|
|
586
|
-
return
|
|
585
|
+
const b = y ?? "primary", _ = /* @__PURE__ */ new Map(), T = st(b, "solid", "light"), C = st(b, "solid", "dark");
|
|
586
|
+
return _.set("--switch-track-on-bg", T.backgroundColor), _.set("--switch-track-on-label", T.textColor), _.set("--switch-track-on-bg-dark", C.backgroundColor), _.set("--switch-track-on-label-dark", C.textColor), _.set(
|
|
587
587
|
"--switch-track-on-border-dark",
|
|
588
588
|
It(b, "dark")
|
|
589
|
-
), Array.from(
|
|
589
|
+
), Array.from(_.entries()).map(([g, $]) => `${g}: ${$}`).join("; ");
|
|
590
590
|
}
|
|
591
|
-
const
|
|
591
|
+
const I = () => {
|
|
592
592
|
p.get(o) || (e?.(!p.get(t)), s?.(!p.get(t)));
|
|
593
|
-
},
|
|
594
|
-
p.get(o) || (y.key === " " || y.key === "Enter") && (y.preventDefault(),
|
|
593
|
+
}, x = (y) => {
|
|
594
|
+
p.get(o) || (y.key === " " || y.key === "Enter") && (y.preventDefault(), I());
|
|
595
595
|
};
|
|
596
|
-
return
|
|
596
|
+
return k.div(
|
|
597
597
|
u.class(
|
|
598
598
|
D(
|
|
599
599
|
o ?? !1,
|
|
600
|
-
|
|
600
|
+
i
|
|
601
601
|
)(
|
|
602
602
|
(y, b) => h(y ?? !1, b ?? "md")
|
|
603
603
|
)
|
|
@@ -617,10 +617,10 @@ const ge = P(_t), fe = P(wt), me = P(kt), be = P(
|
|
|
617
617
|
),
|
|
618
618
|
N.checked(t),
|
|
619
619
|
N.disabled(o),
|
|
620
|
-
M.click(
|
|
621
|
-
M.keydown(
|
|
620
|
+
M.click(I),
|
|
621
|
+
M.keydown(x),
|
|
622
622
|
n != null ? M.blur(n) : null,
|
|
623
|
-
|
|
623
|
+
k.div(
|
|
624
624
|
u.class("bc-switch__track"),
|
|
625
625
|
u.class(
|
|
626
626
|
p.map(
|
|
@@ -628,7 +628,7 @@ const ge = P(_t), fe = P(wt), me = P(kt), be = P(
|
|
|
628
628
|
(y) => y ? "bc-switch__track--on" : "bc-switch__track--off"
|
|
629
629
|
)
|
|
630
630
|
),
|
|
631
|
-
r != null ?
|
|
631
|
+
r != null ? k.div(
|
|
632
632
|
N.hidden(!0),
|
|
633
633
|
u.class("bc-switch__track-label bc-switch__track-label--off"),
|
|
634
634
|
u.class(
|
|
@@ -639,7 +639,7 @@ const ge = P(_t), fe = P(wt), me = P(kt), be = P(
|
|
|
639
639
|
),
|
|
640
640
|
r
|
|
641
641
|
) : null,
|
|
642
|
-
a != null ?
|
|
642
|
+
a != null ? k.div(
|
|
643
643
|
u.class("bc-switch__track-label bc-switch__track-label--on"),
|
|
644
644
|
u.class(
|
|
645
645
|
p.map(
|
|
@@ -649,47 +649,18 @@ const ge = P(_t), fe = P(wt), me = P(kt), be = P(
|
|
|
649
649
|
),
|
|
650
650
|
a
|
|
651
651
|
) : null,
|
|
652
|
-
|
|
653
|
-
(
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
p.map(
|
|
659
|
-
t,
|
|
660
|
-
(x) => x ? "bc-switch__thumb--on" : "bc-switch__thumb--off"
|
|
661
|
-
)
|
|
662
|
-
),
|
|
663
|
-
it.transform(
|
|
664
|
-
D(
|
|
665
|
-
t,
|
|
666
|
-
y,
|
|
667
|
-
c,
|
|
668
|
-
b
|
|
669
|
-
)((x, { width: T }, F, g) => {
|
|
670
|
-
const I = (() => {
|
|
671
|
-
switch (F) {
|
|
672
|
-
case "xs":
|
|
673
|
-
return 5;
|
|
674
|
-
case "sm":
|
|
675
|
-
return 5.5;
|
|
676
|
-
case "md":
|
|
677
|
-
return 6;
|
|
678
|
-
case "lg":
|
|
679
|
-
return 7;
|
|
680
|
-
case "xl":
|
|
681
|
-
return 8;
|
|
682
|
-
}
|
|
683
|
-
})(), k = g === "rtl" ? `calc((var(--spacing-base) * ${I}) - ${T}px)` : `calc(${T}px - (var(--spacing-base) * ${I}))`;
|
|
684
|
-
return x ? `translateX(${k})` : "translateX(0)";
|
|
685
|
-
})
|
|
686
|
-
)
|
|
652
|
+
k.div(
|
|
653
|
+
u.class("bc-switch__thumb"),
|
|
654
|
+
u.class(
|
|
655
|
+
p.map(
|
|
656
|
+
t,
|
|
657
|
+
(y) => y ? "bc-switch__thumb--on" : "bc-switch__thumb--off"
|
|
687
658
|
)
|
|
688
659
|
)
|
|
689
660
|
)
|
|
690
661
|
)
|
|
691
662
|
);
|
|
692
|
-
},
|
|
663
|
+
}, be = P(ft), zt = "line-md:star-alt-filled", Xt = "line-md:star-alt", Yt = (t) => {
|
|
693
664
|
const {
|
|
694
665
|
value: e,
|
|
695
666
|
onChange: s,
|
|
@@ -697,65 +668,65 @@ const ge = P(_t), fe = P(wt), me = P(kt), be = P(
|
|
|
697
668
|
max: r = 5,
|
|
698
669
|
fullColor: a = "yellow",
|
|
699
670
|
emptyColor: o = "neutral",
|
|
700
|
-
fullIcon:
|
|
701
|
-
emptyIcon:
|
|
671
|
+
fullIcon: i = zt,
|
|
672
|
+
emptyIcon: c = Xt,
|
|
702
673
|
size: l = "md",
|
|
703
674
|
onBlur: d,
|
|
704
675
|
rounding: f = 1
|
|
705
676
|
} = t, m = () => {
|
|
706
677
|
const b = p.get(f);
|
|
707
678
|
return b > 0 ? b : 1;
|
|
708
|
-
}, h = (b) => Math.min(Math.max(b, 0), p.get(r)), w = (b,
|
|
679
|
+
}, h = (b) => Math.min(Math.max(b, 0), p.get(r)), w = (b, _) => {
|
|
709
680
|
if (p.get(n ?? !1)) return;
|
|
710
|
-
const
|
|
681
|
+
const C = b.currentTarget.getBoundingClientRect(), g = (b.clientX - C.left) / C.width, $ = _ - 1 + g, F = m(), S = Math.ceil($ / F) * F, v = h(S);
|
|
711
682
|
s?.(v);
|
|
712
|
-
},
|
|
683
|
+
}, I = (b) => {
|
|
713
684
|
if (p.get(n ?? !1)) return;
|
|
714
|
-
const
|
|
715
|
-
let
|
|
685
|
+
const _ = m(), T = p.get(e) ?? 0;
|
|
686
|
+
let C;
|
|
716
687
|
switch (b.key) {
|
|
717
688
|
case "ArrowRight":
|
|
718
689
|
case "ArrowUp":
|
|
719
|
-
|
|
690
|
+
C = h(T + _);
|
|
720
691
|
break;
|
|
721
692
|
case "ArrowLeft":
|
|
722
693
|
case "ArrowDown":
|
|
723
|
-
|
|
694
|
+
C = h(T - _);
|
|
724
695
|
break;
|
|
725
696
|
case "Home":
|
|
726
|
-
|
|
697
|
+
C = 0;
|
|
727
698
|
break;
|
|
728
699
|
case "End":
|
|
729
|
-
|
|
700
|
+
C = p.get(r);
|
|
730
701
|
break;
|
|
731
702
|
default:
|
|
732
703
|
return;
|
|
733
704
|
}
|
|
734
|
-
b.preventDefault(), s?.(
|
|
735
|
-
},
|
|
705
|
+
b.preventDefault(), s?.(C);
|
|
706
|
+
}, x = p.map(l, (b) => `bc-icon--${b}`), y = ({ index: b, counter: _ }) => k.span(
|
|
736
707
|
u.class("bc-rating-input__icon-container"),
|
|
737
|
-
u.class(
|
|
708
|
+
u.class(x),
|
|
738
709
|
q(
|
|
739
710
|
{
|
|
740
|
-
icon:
|
|
711
|
+
icon: c,
|
|
741
712
|
size: l,
|
|
742
713
|
color: o,
|
|
743
714
|
tone: "soft"
|
|
744
715
|
},
|
|
745
716
|
u.class("bc-rating-input__icon-empty")
|
|
746
717
|
),
|
|
747
|
-
|
|
718
|
+
k.span(
|
|
748
719
|
u.class("bc-rating-input__icon-clipper"),
|
|
749
|
-
u.class(
|
|
750
|
-
|
|
720
|
+
u.class(x),
|
|
721
|
+
pt.width(
|
|
751
722
|
p.map(e, (T) => {
|
|
752
|
-
const
|
|
753
|
-
return
|
|
723
|
+
const C = Math.floor(T);
|
|
724
|
+
return C > b ? "100%" : C < b ? "0%" : `${(T - b) * 100}%`;
|
|
754
725
|
})
|
|
755
726
|
),
|
|
756
727
|
q(
|
|
757
728
|
{
|
|
758
|
-
icon:
|
|
729
|
+
icon: i,
|
|
759
730
|
size: l,
|
|
760
731
|
color: a,
|
|
761
732
|
tone: "soft"
|
|
@@ -764,20 +735,20 @@ const ge = P(_t), fe = P(wt), me = P(kt), be = P(
|
|
|
764
735
|
)
|
|
765
736
|
),
|
|
766
737
|
M.click(
|
|
767
|
-
dt((T) => w(T,
|
|
738
|
+
dt((T) => w(T, _), {
|
|
768
739
|
preventDefault: !0,
|
|
769
740
|
stopPropagation: !0
|
|
770
741
|
})
|
|
771
742
|
)
|
|
772
743
|
);
|
|
773
|
-
return
|
|
744
|
+
return U({
|
|
774
745
|
baseContainer: !0,
|
|
775
746
|
growInput: !1,
|
|
776
747
|
focusableSelector: '[role="slider"]',
|
|
777
748
|
...t,
|
|
778
|
-
input:
|
|
749
|
+
input: k.div(
|
|
779
750
|
// Common input attributes (id, required, invalid, custom classes, etc.)
|
|
780
|
-
|
|
751
|
+
L(t),
|
|
781
752
|
u.class("bc-rating-input"),
|
|
782
753
|
// ARIA slider semantics
|
|
783
754
|
u.role("slider"),
|
|
@@ -790,38 +761,38 @@ const ge = P(_t), fe = P(wt), me = P(kt), be = P(
|
|
|
790
761
|
D(
|
|
791
762
|
e,
|
|
792
763
|
r
|
|
793
|
-
)((b,
|
|
794
|
-
const T = b ?? 0,
|
|
795
|
-
return `${String(T)} / ${String(
|
|
764
|
+
)((b, _) => {
|
|
765
|
+
const T = b ?? 0, C = _ ?? 0;
|
|
766
|
+
return `${String(T)} / ${String(C)}`;
|
|
796
767
|
})
|
|
797
768
|
),
|
|
798
769
|
// Keyboard & focus handlers
|
|
799
|
-
M.keydown(
|
|
770
|
+
M.keydown(I),
|
|
800
771
|
d != null ? M.blur(d) : null,
|
|
801
|
-
|
|
772
|
+
ut(r, y)
|
|
802
773
|
)
|
|
803
774
|
});
|
|
804
|
-
},
|
|
805
|
-
const { value: e, onChange: s, onInput: n, onBlur: r, after: a, disabled: o, ...
|
|
806
|
-
return
|
|
807
|
-
...
|
|
775
|
+
}, we = (t) => {
|
|
776
|
+
const { value: e, onChange: s, onInput: n, onBlur: r, after: a, disabled: o, ...i } = t, c = z(e, o, s ?? n);
|
|
777
|
+
return Yt({
|
|
778
|
+
...i,
|
|
808
779
|
// Map null -> 0 for display so the control shows as empty when null
|
|
809
780
|
value: p.map(e, (l) => l ?? 0),
|
|
810
781
|
// Pass through numeric changes; clear button will call onChange(null)
|
|
811
782
|
onChange: s,
|
|
812
783
|
onInput: n,
|
|
813
784
|
onBlur: r,
|
|
814
|
-
after: a != null ? E(
|
|
785
|
+
after: a != null ? E(c, a) : c
|
|
815
786
|
});
|
|
816
|
-
},
|
|
817
|
-
const { value: e, step: s, min: n, max: r, onBlur: a, onChange: o, onInput:
|
|
818
|
-
return
|
|
787
|
+
}, ye = (t) => {
|
|
788
|
+
const { value: e, step: s, min: n, max: r, onBlur: a, onChange: o, onInput: i } = t;
|
|
789
|
+
return U({
|
|
819
790
|
...t,
|
|
820
791
|
// Make sure clicks anywhere focus the range input
|
|
821
792
|
focusableSelector: 'input[type="range"]',
|
|
822
|
-
input:
|
|
793
|
+
input: k.input(
|
|
823
794
|
u.type("range"),
|
|
824
|
-
|
|
795
|
+
L(t),
|
|
825
796
|
u.min(n),
|
|
826
797
|
u.max(r),
|
|
827
798
|
u.step(s),
|
|
@@ -830,31 +801,31 @@ const ge = P(_t), fe = P(wt), me = P(kt), be = P(
|
|
|
830
801
|
u.class("bc-input bc-slider-input"),
|
|
831
802
|
a != null ? M.blur(V(a)) : A,
|
|
832
803
|
o != null ? M.change(V(o)) : A,
|
|
833
|
-
|
|
804
|
+
i != null ? M.input(V(i)) : A
|
|
834
805
|
)
|
|
835
806
|
});
|
|
836
|
-
},
|
|
837
|
-
const { value: e, step: s, min: n, max: r, onBlur: a, onChange: o, onInput:
|
|
807
|
+
}, Ie = (t) => {
|
|
808
|
+
const { value: e, step: s, min: n, max: r, onBlur: a, onChange: o, onInput: i } = t, c = p.map(e, (d) => {
|
|
838
809
|
if (d != null) return d;
|
|
839
810
|
const f = n != null ? p.get(n) : void 0;
|
|
840
811
|
return typeof f == "number" ? f : 0;
|
|
841
812
|
}), l = z(
|
|
842
813
|
e,
|
|
843
814
|
t.disabled,
|
|
844
|
-
o ??
|
|
815
|
+
o ?? i
|
|
845
816
|
);
|
|
846
|
-
return
|
|
817
|
+
return U(
|
|
847
818
|
{
|
|
848
819
|
...t,
|
|
849
820
|
focusableSelector: 'input[type="range"]',
|
|
850
821
|
after: l,
|
|
851
|
-
input:
|
|
822
|
+
input: k.input(
|
|
852
823
|
u.type("range"),
|
|
853
|
-
|
|
824
|
+
L(t),
|
|
854
825
|
u.min(n),
|
|
855
826
|
u.max(r),
|
|
856
827
|
u.step(s),
|
|
857
|
-
u.valueAsNumber(
|
|
828
|
+
u.valueAsNumber(c),
|
|
858
829
|
u.class("bc-input bc-slider-input"),
|
|
859
830
|
a != null ? M.blur(V(a)) : A,
|
|
860
831
|
o != null ? M.change(
|
|
@@ -862,9 +833,9 @@ const ge = P(_t), fe = P(wt), me = P(kt), be = P(
|
|
|
862
833
|
o(d);
|
|
863
834
|
})
|
|
864
835
|
) : A,
|
|
865
|
-
|
|
836
|
+
i != null ? M.input(
|
|
866
837
|
V((d) => {
|
|
867
|
-
|
|
838
|
+
i(d);
|
|
868
839
|
})
|
|
869
840
|
) : A
|
|
870
841
|
)
|
|
@@ -872,8 +843,8 @@ const ge = P(_t), fe = P(wt), me = P(kt), be = P(
|
|
|
872
843
|
// Ensure container grows input naturally
|
|
873
844
|
E()
|
|
874
845
|
);
|
|
875
|
-
},
|
|
876
|
-
class
|
|
846
|
+
}, Me = P(mt);
|
|
847
|
+
class Gt {
|
|
877
848
|
widgets = /* @__PURE__ */ new Map();
|
|
878
849
|
typeMapping = /* @__PURE__ */ new Map();
|
|
879
850
|
// JSON Schema type -> widget names
|
|
@@ -924,7 +895,7 @@ class qt {
|
|
|
924
895
|
* Find the best widget for a schema context
|
|
925
896
|
*/
|
|
926
897
|
findBestWidget(e) {
|
|
927
|
-
const s =
|
|
898
|
+
const s = kt(e.definition, e.name);
|
|
928
899
|
if (s?.widget) {
|
|
929
900
|
const r = this.widgets.get(s.widget);
|
|
930
901
|
if (r)
|
|
@@ -965,8 +936,8 @@ class qt {
|
|
|
965
936
|
return null;
|
|
966
937
|
}
|
|
967
938
|
}
|
|
968
|
-
const
|
|
969
|
-
function
|
|
939
|
+
const $e = new Gt();
|
|
940
|
+
function xe(t, e, s) {
|
|
970
941
|
return {
|
|
971
942
|
factory: e,
|
|
972
943
|
matcher: (n) => {
|
|
@@ -979,7 +950,7 @@ function ke(t, e, s) {
|
|
|
979
950
|
...s
|
|
980
951
|
};
|
|
981
952
|
}
|
|
982
|
-
function
|
|
953
|
+
function _e(t, e, s) {
|
|
983
954
|
return {
|
|
984
955
|
factory: e,
|
|
985
956
|
matcher: (n) => n.definition.format === t,
|
|
@@ -988,7 +959,7 @@ function Fe(t, e, s) {
|
|
|
988
959
|
...s
|
|
989
960
|
};
|
|
990
961
|
}
|
|
991
|
-
function
|
|
962
|
+
function ke(t, e, s, n) {
|
|
992
963
|
return {
|
|
993
964
|
factory: s,
|
|
994
965
|
matcher: (r) => {
|
|
@@ -1000,7 +971,7 @@ function Ce(t, e, s, n) {
|
|
|
1000
971
|
...n
|
|
1001
972
|
};
|
|
1002
973
|
}
|
|
1003
|
-
function
|
|
974
|
+
function Fe(t) {
|
|
1004
975
|
const e = t?.logPrefix ?? "WIDGET_DIAG", s = t?.filterFn ?? (() => !0);
|
|
1005
976
|
return {
|
|
1006
977
|
factory: () => null,
|
|
@@ -1024,51 +995,51 @@ function Te(t) {
|
|
|
1024
995
|
}
|
|
1025
996
|
export {
|
|
1026
997
|
j as A,
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
998
|
+
ie as B,
|
|
999
|
+
ce as C,
|
|
1000
|
+
oe as D,
|
|
1001
|
+
le as E,
|
|
1002
|
+
St as F,
|
|
1003
|
+
vt as G,
|
|
1004
|
+
Rt as H,
|
|
1005
|
+
ct as I,
|
|
1006
|
+
Nt as J,
|
|
1036
1007
|
J as K,
|
|
1037
|
-
|
|
1008
|
+
Dt as L,
|
|
1038
1009
|
G as M,
|
|
1039
|
-
|
|
1010
|
+
he as N,
|
|
1040
1011
|
K as O,
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1012
|
+
Bt as P,
|
|
1013
|
+
Vt as Q,
|
|
1014
|
+
Yt as R,
|
|
1015
|
+
ye as S,
|
|
1045
1016
|
O as T,
|
|
1046
1017
|
W as U,
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1018
|
+
Gt as W,
|
|
1019
|
+
fe as a,
|
|
1020
|
+
be as b,
|
|
1021
|
+
Me as c,
|
|
1022
|
+
ge as d,
|
|
1023
|
+
pe as e,
|
|
1024
|
+
ue as f,
|
|
1025
|
+
$e as g,
|
|
1026
|
+
de as h,
|
|
1027
|
+
Ie as i,
|
|
1028
|
+
we as j,
|
|
1029
|
+
me as k,
|
|
1030
|
+
xe as l,
|
|
1031
|
+
_e as m,
|
|
1032
|
+
ke as n,
|
|
1033
|
+
Fe as o,
|
|
1063
1034
|
at as p,
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1035
|
+
jt as q,
|
|
1036
|
+
re as r,
|
|
1037
|
+
it as s,
|
|
1038
|
+
At as t,
|
|
1039
|
+
Et as u,
|
|
1040
|
+
Ot as v,
|
|
1041
|
+
Ft as w,
|
|
1042
|
+
Ct as x,
|
|
1043
|
+
Tt as y,
|
|
1073
1044
|
Q as z
|
|
1074
1045
|
};
|