@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.
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/auth-divider-3t_-R0sL.cjs +1 -0
- package/dist/{auth-divider-BQIhr3-R.js → auth-divider-Cp3xGpHr.js} +14 -14
- package/dist/beatui.css +36 -15
- package/dist/beatui.tailwind.css +36 -15
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +6 -6
- package/dist/{deep-merge-EkjEgK0N.cjs → deep-merge-Bz9HHpRt.cjs} +1 -1
- package/dist/{deep-merge-BzIheQtH.js → deep-merge-Da602mAN.js} +1 -1
- package/dist/{duration-input-DGzmIImj.js → duration-input-HM1i6RRY.js} +2 -2
- package/dist/{duration-input-ClgYjeBa.cjs → duration-input-g-cQ3cs1.cjs} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +5394 -5251
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +5 -5
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +3 -3
- package/dist/notice-BNghd0oS.cjs +1 -0
- package/dist/notice-Dtz7ADVH.js +211 -0
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/text-input-DL9FvpTZ.cjs +1 -0
- package/dist/text-input-dDUEUmlC.js +57 -0
- package/dist/types/components/data/data-table-context.d.ts +4 -3
- package/dist/types/components/data/data-table-types.d.ts +31 -17
- package/dist/types/components/data/data-table.d.ts +3 -3
- package/dist/types/components/data/sortable-header.d.ts +4 -2
- package/dist/types/components/form/input/bigint-input.d.ts +3 -3
- package/dist/types/components/form/input/color-input.d.ts +3 -1
- package/dist/types/components/form/input/create-nullable-string-input.d.ts +2 -2
- package/dist/types/components/form/input/date-time-input.d.ts +4 -4
- package/dist/types/components/form/input/email-input.d.ts +4 -4
- package/dist/types/components/form/input/input-options.d.ts +3 -1
- package/dist/types/components/form/input/nullable-bigint-input.d.ts +3 -3
- package/dist/types/components/form/input/nullable-date-time-input.d.ts +2 -2
- package/dist/types/components/form/input/nullable-email-input.d.ts +3 -3
- package/dist/types/components/form/input/nullable-plain-date-input.d.ts +1 -0
- package/dist/types/components/form/input/nullable-plain-date-time-input.d.ts +1 -0
- package/dist/types/components/form/input/nullable-plain-time-input.d.ts +1 -0
- package/dist/types/components/form/input/nullable-plain-year-month-input.d.ts +1 -0
- package/dist/types/components/form/input/plain-date-input.d.ts +1 -0
- package/dist/types/components/form/input/plain-date-time-input.d.ts +1 -0
- package/dist/types/components/form/input/plain-time-input.d.ts +1 -0
- package/dist/types/components/form/input/plain-year-month-input.d.ts +1 -0
- package/dist/types/components/form/input/slider-input.d.ts +24 -6
- package/dist/types/components/form/input/switch.d.ts +3 -1
- package/dist/types/components/overlay/dialogs.d.ts +10 -2
- package/dist/widget-customization-DOWmUuPU.cjs +1 -0
- package/dist/{widget-customization-Dkx7kNSe.js → widget-customization-YhVcA-KM.js} +350 -341
- package/package.json +1 -1
- package/dist/auth-divider-DvnUModP.cjs +0 -1
- package/dist/notice-E19wu9lA.js +0 -209
- package/dist/notice-_9XhdrFw.cjs +0 -1
- package/dist/text-input-DfqXolVe.js +0 -55
- package/dist/text-input-X_q01NsY.cjs +0 -1
- package/dist/widget-customization-DgW1SXN6.cjs +0 -1
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { Value as p, prop as
|
|
2
|
-
import { F as
|
|
3
|
-
import { decodeBase64 as
|
|
4
|
-
import { I as
|
|
5
|
-
import { C as O, m as
|
|
6
|
-
import { B as
|
|
7
|
-
import { AutoSelect as
|
|
8
|
-
import {
|
|
9
|
-
import { s as
|
|
10
|
-
import { r as
|
|
11
|
-
function
|
|
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
|
|
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
|
|
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
|
|
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
|
|
38
|
-
return
|
|
37
|
+
function de(t) {
|
|
38
|
+
return ht(t) || Nt(t) || Rt(t) || Bt(t);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
if (!
|
|
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
|
|
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
|
|
53
|
-
const e =
|
|
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
|
|
63
|
-
const a =
|
|
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,
|
|
66
|
-
const [
|
|
67
|
-
return 0.2126 *
|
|
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
|
|
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),
|
|
80
|
-
return [d,
|
|
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),
|
|
91
|
-
return [d,
|
|
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),
|
|
95
|
-
return [d,
|
|
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]),
|
|
118
|
-
return [
|
|
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,
|
|
125
|
-
return [
|
|
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]),
|
|
132
|
-
return [
|
|
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 =
|
|
134
|
+
const i = H(t);
|
|
135
135
|
return i ? [i.r, i.g, i.b, 1] : [0, 0, 0, 1];
|
|
136
136
|
}
|
|
137
|
-
function
|
|
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
|
|
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
|
|
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
|
|
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] =
|
|
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
|
|
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
|
|
187
|
-
const [n] =
|
|
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
|
|
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
|
|
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 =
|
|
204
|
-
|
|
205
|
-
|
|
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
|
|
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] =
|
|
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] =
|
|
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] =
|
|
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] =
|
|
233
|
-
return s || n < 1 ? `oklch(${l} ${d} ${
|
|
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
|
|
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(
|
|
250
|
+
return Promise.all(t.map(zt));
|
|
251
251
|
}
|
|
252
|
-
function
|
|
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
|
|
269
|
-
const e =
|
|
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
|
|
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((
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
),
|
|
284
|
-
return new File([
|
|
285
|
-
})), c = (d) => (
|
|
286
|
-
d && Ht(
|
|
287
|
-
for (const [
|
|
288
|
-
s.set(
|
|
289
|
-
d(
|
|
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
|
|
292
|
+
return yt({
|
|
293
293
|
...r,
|
|
294
294
|
value: o,
|
|
295
295
|
onChange: i,
|
|
296
296
|
onInput: l
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
|
-
function
|
|
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
|
|
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
|
|
319
|
-
const [a, n, r] = t, s = a << 16 ^ n << 8 ^ r, o =
|
|
320
|
-
for (let
|
|
321
|
-
const
|
|
322
|
-
l.push({ x:
|
|
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,
|
|
325
|
-
let
|
|
326
|
-
for (let
|
|
327
|
-
const
|
|
328
|
-
|
|
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
|
|
330
|
+
return w += " Z", w;
|
|
331
331
|
}
|
|
332
|
-
const
|
|
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 =
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
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
|
-
|
|
351
|
-
|
|
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
|
-
([
|
|
354
|
-
),
|
|
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
|
-
(
|
|
357
|
-
),
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
)((
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
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
|
-
([
|
|
366
|
-
),
|
|
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
|
-
|
|
371
|
-
(
|
|
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
|
-
|
|
385
|
+
ot.svg(
|
|
379
386
|
u.class("bc-color-swatch-input__svg"),
|
|
380
|
-
|
|
381
|
-
|
|
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(
|
|
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) :
|
|
393
|
-
n != null ? I.change((
|
|
394
|
-
const x =
|
|
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 } =
|
|
397
|
-
p.get(
|
|
398
|
-
p.get(
|
|
399
|
-
),
|
|
400
|
-
n(
|
|
401
|
-
}) :
|
|
402
|
-
r != null ? I.input((
|
|
403
|
-
const x =
|
|
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 } =
|
|
406
|
-
p.get(
|
|
407
|
-
p.get(
|
|
408
|
-
),
|
|
409
|
-
r(
|
|
410
|
-
}) :
|
|
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
|
-
),
|
|
413
|
-
|
|
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(
|
|
427
|
+
u.value(p.map(f, (m) => String(m ?? 1))),
|
|
421
428
|
u.disabled(t.disabled),
|
|
422
|
-
I.input((
|
|
423
|
-
const x = parseFloat(
|
|
424
|
-
|
|
425
|
-
const [C, v, N] = p.get(
|
|
426
|
-
p.get(
|
|
427
|
-
p.get(
|
|
428
|
-
), V = U(C, v, N, x,
|
|
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((
|
|
432
|
-
const x = parseFloat(
|
|
433
|
-
|
|
434
|
-
const [C, v, N] = p.get(
|
|
435
|
-
p.get(
|
|
436
|
-
p.get(
|
|
437
|
-
), V = U(C, v, N, x,
|
|
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:
|
|
443
|
-
displayValue:
|
|
444
|
-
withAlpha:
|
|
445
|
-
colorTextFormat:
|
|
449
|
+
swatchSize: Y,
|
|
450
|
+
displayValue: G,
|
|
451
|
+
withAlpha: q,
|
|
452
|
+
colorTextFormat: rt,
|
|
446
453
|
...K
|
|
447
454
|
} = t;
|
|
448
|
-
return
|
|
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:
|
|
460
|
+
input: S,
|
|
454
461
|
// If caller provided an `after`, append RGB before it
|
|
455
462
|
after: j(
|
|
456
|
-
|
|
463
|
+
z(
|
|
457
464
|
s ?? !1,
|
|
458
|
-
() => _.span(u.class("bc-color-swatch-input__rgb"),
|
|
465
|
+
() => _.span(u.class("bc-color-swatch-input__rgb"), F)
|
|
459
466
|
),
|
|
460
|
-
|
|
467
|
+
k,
|
|
461
468
|
t.after
|
|
462
469
|
)
|
|
463
470
|
});
|
|
464
|
-
},
|
|
465
|
-
function
|
|
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 =
|
|
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
|
|
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 =
|
|
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
|
-
|
|
495
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
540
|
+
ft(kt, (i) => R.label(i.$.editLabel)),
|
|
534
541
|
I.click(() => s.set(!0)),
|
|
535
|
-
|
|
542
|
+
et({ icon: "line-md/pencil", color: "neutral" })
|
|
536
543
|
)
|
|
537
544
|
)
|
|
538
545
|
)
|
|
539
546
|
)
|
|
540
547
|
);
|
|
541
|
-
},
|
|
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
|
|
550
|
+
return P({
|
|
544
551
|
...t,
|
|
545
|
-
input:
|
|
552
|
+
input: pt.date(
|
|
546
553
|
O(t),
|
|
547
554
|
u.valueAsDate(e),
|
|
548
555
|
u.class("bc-input"),
|
|
549
|
-
a != null ? I.blur(
|
|
550
|
-
n != null ? I.change(
|
|
551
|
-
r != null ? I.input(
|
|
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
|
-
},
|
|
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
|
-
},
|
|
559
|
-
const { value: e, onBlur: a, onChange: n, onInput: r, after: s, disabled: o } = t, c = p.map(e, (l) => l != null ?
|
|
560
|
-
return
|
|
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:
|
|
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(
|
|
567
|
-
n != null ? I.change(
|
|
568
|
-
r != null ? I.input(
|
|
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
|
-
},
|
|
573
|
-
|
|
574
|
-
),
|
|
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:
|
|
593
|
+
matchInputHeight: h = !0,
|
|
594
|
+
ariaLabel: w
|
|
587
595
|
}) => {
|
|
588
|
-
const
|
|
589
|
-
function
|
|
590
|
-
const
|
|
596
|
+
const f = i ?? At("switch");
|
|
597
|
+
function g(M, b) {
|
|
598
|
+
const $ = [
|
|
591
599
|
"bc-switch",
|
|
592
|
-
`bc-switch--size-${
|
|
593
|
-
`bc-switch--${
|
|
600
|
+
`bc-switch--size-${b}`,
|
|
601
|
+
`bc-switch--${b}`
|
|
594
602
|
];
|
|
595
|
-
return
|
|
603
|
+
return h && $.push("bc-switch--match-input"), M && $.push("bc-switch--disabled"), $.join(" ");
|
|
596
604
|
}
|
|
597
|
-
function
|
|
598
|
-
const
|
|
599
|
-
return
|
|
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
|
-
|
|
602
|
-
), Array.from(
|
|
609
|
+
Ft(b, "dark")
|
|
610
|
+
), Array.from($.entries()).map(([Y, G]) => `${Y}: ${G}`).join("; ");
|
|
603
611
|
}
|
|
604
|
-
const
|
|
612
|
+
const F = () => {
|
|
605
613
|
p.get(o) || (e?.(!p.get(t)), a?.(!p.get(t)));
|
|
606
|
-
},
|
|
607
|
-
p.get(o) || (
|
|
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
|
-
(
|
|
623
|
+
(M, b) => g(M ?? !1, b ?? "md")
|
|
616
624
|
)
|
|
617
625
|
),
|
|
618
626
|
u.style(
|
|
619
627
|
D(l)(
|
|
620
|
-
(
|
|
628
|
+
(M) => y(M)
|
|
621
629
|
)
|
|
622
630
|
),
|
|
623
|
-
u.id(
|
|
631
|
+
u.id(f),
|
|
624
632
|
u.role("switch"),
|
|
625
633
|
u.tabindex(
|
|
626
634
|
D(
|
|
627
635
|
o ?? !1,
|
|
628
636
|
d
|
|
629
|
-
)((
|
|
637
|
+
)((M, b) => M ? -1 : b ?? 0)
|
|
630
638
|
),
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
I.
|
|
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
|
-
(
|
|
650
|
+
(M) => M ? "bc-switch__track--on" : "bc-switch__track--off"
|
|
642
651
|
)
|
|
643
652
|
),
|
|
644
653
|
r != null ? _.div(
|
|
645
|
-
|
|
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
|
-
(
|
|
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
|
-
(
|
|
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
|
-
(
|
|
679
|
+
(M) => M ? "bc-switch__thumb--on" : "bc-switch__thumb--off"
|
|
671
680
|
)
|
|
672
681
|
)
|
|
673
682
|
)
|
|
674
683
|
)
|
|
675
684
|
);
|
|
676
|
-
},
|
|
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 =
|
|
686
|
-
inactiveIcon: l =
|
|
694
|
+
activeIcon: i = Jt,
|
|
695
|
+
inactiveIcon: l = Zt,
|
|
687
696
|
size: d = "md",
|
|
688
|
-
onBlur:
|
|
689
|
-
rounding:
|
|
690
|
-
} = t,
|
|
691
|
-
const
|
|
692
|
-
return
|
|
693
|
-
},
|
|
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 =
|
|
696
|
-
a?.(
|
|
697
|
-
},
|
|
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
|
|
708
|
+
const $ = f(), S = p.get(e) ?? 0;
|
|
700
709
|
let k;
|
|
701
|
-
switch (
|
|
710
|
+
switch (b.key) {
|
|
702
711
|
case "ArrowRight":
|
|
703
712
|
case "ArrowUp":
|
|
704
|
-
k =
|
|
713
|
+
k = g(S + $);
|
|
705
714
|
break;
|
|
706
715
|
case "ArrowLeft":
|
|
707
716
|
case "ArrowDown":
|
|
708
|
-
k =
|
|
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
|
-
|
|
720
|
-
},
|
|
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(
|
|
723
|
-
|
|
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(
|
|
735
|
-
|
|
736
|
-
p.map(e, (
|
|
737
|
-
const k = Math.floor(
|
|
738
|
-
return k >
|
|
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
|
-
|
|
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
|
|
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, (
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
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
|
-
)((
|
|
779
|
-
const
|
|
780
|
-
return `${String(
|
|
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
|
-
|
|
786
|
-
|
|
793
|
+
I.keydown(F),
|
|
794
|
+
h != null ? I.blur(h) : null,
|
|
795
|
+
mt(s, M)
|
|
787
796
|
)
|
|
788
797
|
});
|
|
789
|
-
},
|
|
790
|
-
const { after: e, disabled: a } = t, n =
|
|
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
|
|
808
|
+
return te({
|
|
800
809
|
...n,
|
|
801
810
|
after: e != null ? j(r, e) : r
|
|
802
811
|
});
|
|
803
|
-
},
|
|
812
|
+
}, Fe = (t) => {
|
|
804
813
|
const { value: e, step: a, min: n, max: r, onBlur: s, onChange: o, onInput: c } = t;
|
|
805
|
-
return
|
|
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)) :
|
|
819
|
-
o != null ? I.change(E(o)) :
|
|
820
|
-
c != null ? I.input(E(c)) :
|
|
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
|
-
},
|
|
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
|
|
827
|
-
return typeof
|
|
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
|
|
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)) :
|
|
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
|
-
) :
|
|
859
|
+
) : A,
|
|
851
860
|
c != null ? I.input(
|
|
852
861
|
E((d) => {
|
|
853
862
|
c(d);
|
|
854
863
|
})
|
|
855
|
-
) :
|
|
864
|
+
) : A
|
|
856
865
|
)
|
|
857
866
|
});
|
|
858
|
-
},
|
|
859
|
-
class
|
|
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 =
|
|
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
|
|
952
|
-
function
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
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
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
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
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1063
|
+
he as x,
|
|
1064
|
+
H as y,
|
|
1065
|
+
gt as z
|
|
1057
1066
|
};
|