@tempots/beatui 0.74.0 → 0.76.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.
@@ -1,5 +1,5 @@
1
- import { Value as p, prop as ot, computedOf as D, html as _, attr as u, svg as et, svgAttr as Y, on as $, Empty as A, When as j, Fragment as E, aria as R, emitValue as tt, Use as ct, input as it, emitValueAsNullableDate as nt, emitValueAsNullableDateTime as st, style as lt, Repeat as gt, emit as dt, emitValueAsNumber as B } from "@tempots/dom";
2
- import { F as mt, $ as ht, N as X, T as ft, U as bt, a as yt } from "./deep-merge-CQQCMLwG.js";
1
+ import { Value as p, prop as ot, computedOf as D, html as _, attr as u, svg as et, svgAttr as Y, on as $, Empty as A, When as W, Fragment as E, aria as N, emitValue as tt, Use as ct, input as it, emitValueAsNullableDate as nt, emitValueAsNullableDateTime as st, style as lt, Repeat as gt, emit as dt, emitValueAsNumber as B } from "@tempots/dom";
2
+ import { F as ht, $ as mt, N as X, T as ft, U as bt, a as yt } from "./deep-merge-CQQCMLwG.js";
3
3
  import { C as V, b as U, a as wt, c as Q, T as xt, L as $t, d as rt, e as Mt } from "./translations-DQxouiBG.js";
4
4
  import { AutoSelect as It, ElementRect as _t } from "@tempots/ui";
5
5
  import { E as kt, P as Tt } from "./notice-Cqq8g17n.js";
@@ -58,13 +58,13 @@ function H(t) {
58
58
  function ie(t, e) {
59
59
  const s = H(t), n = H(e);
60
60
  if (!s || !n) return null;
61
- const a = (l, g, h) => {
62
- const [b, d, w] = [l, g, h].map((x) => (x = x / 255, x <= 0.03928 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4)));
61
+ const a = (l, g, m) => {
62
+ const [b, d, w] = [l, g, m].map((x) => (x = x / 255, x <= 0.03928 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4)));
63
63
  return 0.2126 * b + 0.7152 * d + 0.0722 * w;
64
64
  }, r = a(s.r, s.g, s.b), o = a(n.r, n.g, n.b), c = Math.max(r, o), i = Math.min(r, o);
65
65
  return (c + 0.05) / (i + 0.05);
66
66
  }
67
- function Nt(t) {
67
+ function Rt(t) {
68
68
  if (!t) return [0, 0, 0, 1];
69
69
  const s = t.trim().match(
70
70
  /^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/
@@ -72,8 +72,8 @@ function Nt(t) {
72
72
  if (s) {
73
73
  const l = s[1];
74
74
  if (l.length === 8) {
75
- const g = parseInt(l.slice(0, 2), 16), h = parseInt(l.slice(2, 4), 16), b = parseInt(l.slice(4, 6), 16), d = parseInt(l.slice(6, 8), 16) / 255;
76
- return [g, h, b, d];
75
+ const g = parseInt(l.slice(0, 2), 16), m = parseInt(l.slice(2, 4), 16), b = parseInt(l.slice(4, 6), 16), d = parseInt(l.slice(6, 8), 16) / 255;
76
+ return [g, m, b, d];
77
77
  }
78
78
  if (l.length === 6)
79
79
  return [
@@ -83,12 +83,12 @@ function Nt(t) {
83
83
  1
84
84
  ];
85
85
  if (l.length === 4) {
86
- const g = parseInt(l[0] + l[0], 16), h = parseInt(l[1] + l[1], 16), b = parseInt(l[2] + l[2], 16), d = parseInt(l[3] + l[3], 16) / 255;
87
- return [g, h, b, d];
86
+ const g = parseInt(l[0] + l[0], 16), m = parseInt(l[1] + l[1], 16), b = parseInt(l[2] + l[2], 16), d = parseInt(l[3] + l[3], 16) / 255;
87
+ return [g, m, b, d];
88
88
  }
89
89
  if (l.length === 3) {
90
- const g = parseInt(l[0] + l[0], 16), h = parseInt(l[1] + l[1], 16), b = parseInt(l[2] + l[2], 16);
91
- return [g, h, b, 1];
90
+ const g = parseInt(l[0] + l[0], 16), m = parseInt(l[1] + l[1], 16), b = parseInt(l[2] + l[2], 16);
91
+ return [g, m, b, 1];
92
92
  }
93
93
  }
94
94
  const n = t.match(
@@ -110,27 +110,27 @@ function Nt(t) {
110
110
  /^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i
111
111
  );
112
112
  if (r) {
113
- const l = parseFloat(r[1]), g = parseFloat(r[2]), h = parseFloat(r[3]), b = r[4] != null ? parseFloat(r[4]) : 1, [d, w, x] = pt(l, g / 100, h / 100);
113
+ const l = parseFloat(r[1]), g = parseFloat(r[2]), m = parseFloat(r[3]), b = r[4] != null ? parseFloat(r[4]) : 1, [d, w, x] = pt(l, g / 100, m / 100);
114
114
  return [d, w, x, b];
115
115
  }
116
116
  const o = t.match(
117
117
  /^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i
118
118
  );
119
119
  if (o) {
120
- const l = parseFloat(o[1]), g = parseFloat(o[2]) / 100, h = parseFloat(o[3]) / 100, b = o[4] != null ? parseFloat(o[4]) : 1, [d, w, x] = Lt(l, g, h);
120
+ const l = parseFloat(o[1]), g = parseFloat(o[2]) / 100, m = parseFloat(o[3]) / 100, b = o[4] != null ? parseFloat(o[4]) : 1, [d, w, x] = Lt(l, g, m);
121
121
  return [d, w, x, b];
122
122
  }
123
123
  const c = t.match(
124
124
  /^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i
125
125
  );
126
126
  if (c) {
127
- const l = c[1], g = parseFloat(c[2]), h = parseFloat(c[3]), b = c[4] != null ? parseFloat(c[4]) : 1, d = l.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(l) / 100)) : Math.max(0, Math.min(1, parseFloat(l))), [w, x, y] = Et(d, g, h);
127
+ const l = c[1], g = parseFloat(c[2]), m = parseFloat(c[3]), b = c[4] != null ? parseFloat(c[4]) : 1, d = l.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(l) / 100)) : Math.max(0, Math.min(1, parseFloat(l))), [w, x, y] = Et(d, g, m);
128
128
  return [w, x, y, b];
129
129
  }
130
130
  const i = H(t);
131
131
  return i ? [i.r, i.g, i.b, 1] : [0, 0, 0, 1];
132
132
  }
133
- function Rt(t, e, s, n) {
133
+ function Nt(t, e, s, n) {
134
134
  return `rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(s)}, ${Math.max(
135
135
  0,
136
136
  Math.min(1, Math.round(n * 100) / 100)
@@ -156,7 +156,7 @@ function Lt(t, e, s) {
156
156
  t = (t % 360 + 360) % 360;
157
157
  const n = e + s;
158
158
  n > 1 && (e /= n, s /= n);
159
- const [a, r, o] = pt(t, 1, 0.5).map((h) => h / 255), c = 1 - e - s, i = a * c + e, l = r * c + e, g = o * c + e;
159
+ const [a, r, o] = pt(t, 1, 0.5).map((m) => m / 255), c = 1 - e - s, i = a * c + e, l = r * c + e, g = o * c + e;
160
160
  return [Math.round(i * 255), Math.round(l * 255), Math.round(g * 255)];
161
161
  }
162
162
  function Z(t, e, s) {
@@ -192,11 +192,11 @@ function K(t) {
192
192
  return Math.round(Math.max(0, Math.min(1, e)) * 255);
193
193
  }
194
194
  function Et(t, e, s) {
195
- const n = s * Math.PI / 180, a = Math.cos(n) * e, r = Math.sin(n) * e, o = t + 0.3963377774 * a + 0.2158037573 * r, c = t - 0.1055613458 * a - 0.0638541728 * r, i = t - 0.0894841775 * a - 1.291485548 * r, l = o * o * o, g = c * c * c, h = i * i * i, b = 4.0767416621 * l - 3.3077115913 * g + 0.2309699292 * h, d = -1.2684380046 * l + 2.6097574011 * g - 0.3413193965 * h, w = -0.0041960863 * l - 0.7034186147 * g + 1.707614701 * h;
195
+ const n = s * Math.PI / 180, a = Math.cos(n) * e, r = Math.sin(n) * e, o = t + 0.3963377774 * a + 0.2158037573 * r, c = t - 0.1055613458 * a - 0.0638541728 * r, i = t - 0.0894841775 * a - 1.291485548 * r, l = o * o * o, g = c * c * c, m = i * i * i, b = 4.0767416621 * l - 3.3077115913 * g + 0.2309699292 * m, d = -1.2684380046 * l + 2.6097574011 * g - 0.3413193965 * m, w = -0.0041960863 * l - 0.7034186147 * g + 1.707614701 * m;
196
196
  return [K(b), K(d), K(w)];
197
197
  }
198
198
  function Vt(t, e, s) {
199
- const n = G(t), a = G(e), r = G(s), o = 0.4122214708 * n + 0.5363325363 * a + 0.0514459929 * r, c = 0.2119034982 * n + 0.6806995451 * a + 0.1073969566 * r, i = 0.0883024619 * n + 0.2817188376 * a + 0.6299787005 * r, l = Math.cbrt(o), g = Math.cbrt(c), h = Math.cbrt(i), b = 0.2104542553 * l + 0.793617785 * g - 0.0040720468 * h, d = 1.9779984951 * l - 2.428592205 * g + 0.4505937099 * h, w = 0.0259040371 * l + 0.7827717662 * g - 0.808675766 * h, x = Math.sqrt(d * d + w * w);
199
+ const n = G(t), a = G(e), r = G(s), o = 0.4122214708 * n + 0.5363325363 * a + 0.0514459929 * r, c = 0.2119034982 * n + 0.6806995451 * a + 0.1073969566 * r, i = 0.0883024619 * n + 0.2817188376 * a + 0.6299787005 * r, l = Math.cbrt(o), g = Math.cbrt(c), m = Math.cbrt(i), b = 0.2104542553 * l + 0.793617785 * g - 0.0040720468 * m, d = 1.9779984951 * l - 2.428592205 * g + 0.4505937099 * m, w = 0.0259040371 * l + 0.7827717662 * g - 0.808675766 * m, x = Math.sqrt(d * d + w * w);
200
200
  let y = Math.atan2(w, d) * 180 / Math.PI;
201
201
  return y < 0 && (y += 360), [b, x, y];
202
202
  }
@@ -225,12 +225,12 @@ function P(t, e, s, n, a, r) {
225
225
  return n < 1 ? `hwb(${o} ${c}% ${i}% / ${Math.round(n * 100) / 100})` : `hwb(${o} ${c}% ${i}%)`;
226
226
  }
227
227
  case "oklch": {
228
- const [o, c, i] = Vt(t, e, s), l = (Math.round(o * 1e3) / 1e3).toFixed(3), g = (Math.round(c * 1e3) / 1e3).toFixed(3), h = (Math.round(i * 10) / 10).toFixed(1), b = Math.round(n * 100) / 100;
229
- return r || n < 1 ? `oklch(${l} ${g} ${h} / ${b})` : `oklch(${l} ${g} ${h})`;
228
+ const [o, c, i] = Vt(t, e, s), l = (Math.round(o * 1e3) / 1e3).toFixed(3), g = (Math.round(c * 1e3) / 1e3).toFixed(3), m = (Math.round(i * 10) / 10).toFixed(1), b = Math.round(n * 100) / 100;
229
+ return r || n < 1 ? `oklch(${l} ${g} ${m} / ${b})` : `oklch(${l} ${g} ${m})`;
230
230
  }
231
231
  }
232
232
  }
233
- function W(t, e) {
233
+ function j(t, e) {
234
234
  return e ? t === "rgb" ? "rgba" : t === "hsl" ? "hsla" : t : t === "rgba" ? "rgb" : t === "hsla" ? "hsl" : t;
235
235
  }
236
236
  async function Ut(t) {
@@ -261,31 +261,31 @@ function Pt(t) {
261
261
  }
262
262
  return "application/octet-stream";
263
263
  }
264
- function Wt(t) {
265
- const e = ht(t ?? ""), s = e.length, n = new Uint8Array(s);
264
+ function jt(t) {
265
+ const e = mt(t ?? ""), s = e.length, n = new Uint8Array(s);
266
266
  for (let a = 0; a < s; a++) n[a] = e.charCodeAt(a);
267
267
  return n;
268
268
  }
269
- function jt(t) {
269
+ function Wt(t) {
270
270
  const {
271
271
  value: e,
272
272
  onChange: s,
273
273
  onInput: n,
274
274
  ...a
275
- } = t, r = /* @__PURE__ */ new Map(), o = p.toSignal(e).map((g) => g.map((h, b) => {
276
- const d = r.get(h), w = Wt(h ?? ""), x = d?.type || Pt(w), y = d?.name ?? `file-${b}`, I = w.buffer.slice(
275
+ } = t, r = /* @__PURE__ */ new Map(), o = p.toSignal(e).map((g) => g.map((m, b) => {
276
+ const d = r.get(m), w = jt(m ?? ""), x = d?.type || Pt(w), y = d?.name ?? `file-${b}`, I = w.buffer.slice(
277
277
  w.byteOffset,
278
278
  w.byteOffset + w.byteLength
279
279
  ), f = new Blob([I], { type: x });
280
280
  return new File([f], y, { type: x });
281
- })), c = (g) => (h) => {
282
- g && Ot(h).then((b) => {
281
+ })), c = (g) => (m) => {
282
+ g && Ot(m).then((b) => {
283
283
  for (const [d, w] of b.entries())
284
- r.set(w, { name: h[d].name, type: h[d].type });
284
+ r.set(w, { name: m[d].name, type: m[d].type });
285
285
  g(b);
286
286
  });
287
287
  }, i = c(s), l = c(n);
288
- return mt({
288
+ return ht({
289
289
  ...a,
290
290
  value: o,
291
291
  onChange: i,
@@ -299,7 +299,7 @@ function le(t) {
299
299
  onChange: n,
300
300
  ...a
301
301
  } = t;
302
- return jt({
302
+ return Wt({
303
303
  ...a,
304
304
  maxFiles: 1,
305
305
  value: p.map(e, (r) => r == null ? [] : [r]),
@@ -317,8 +317,8 @@ function Ht(t, e) {
317
317
  const w = d / c * Math.PI * 2, x = e * (1 + (o() * 2 - 1) * i), y = Math.cos(w) * x, I = Math.sin(w) * x;
318
318
  l.push({ x: y, y: I });
319
319
  }
320
- const g = (l[0].x + l[c - 1].x) / 2, h = (l[0].y + l[c - 1].y) / 2;
321
- let b = `M ${g.toFixed(3)} ${h.toFixed(3)}`;
320
+ const g = (l[0].x + l[c - 1].x) / 2, m = (l[0].y + l[c - 1].y) / 2;
321
+ let b = `M ${g.toFixed(3)} ${m.toFixed(3)}`;
322
322
  for (let d = 0; d < c; d++) {
323
323
  const w = l[d], x = l[(d + 1) % c], y = (w.x + x.x) / 2, I = (w.y + x.y) / 2;
324
324
  b += ` Q ${w.x.toFixed(3)} ${w.y.toFixed(3)} ${y.toFixed(3)} ${I.toFixed(3)}`;
@@ -326,41 +326,41 @@ function Ht(t, e) {
326
326
  return b += " Z", b;
327
327
  }
328
328
  const ue = (t) => {
329
- const { value: e, onBlur: s, onChange: n, onInput: a, displayValue: r, size: o, withAlpha: c } = t, i = p.map(o ?? 32, (m) => m), l = p.map(e, (m) => Nt(m ?? "#000000")), g = p.map(
329
+ const { value: e, onBlur: s, onChange: n, onInput: a, displayValue: r, size: o, withAlpha: c } = t, i = p.map(o ?? 32, (h) => h), l = p.map(e, (h) => Rt(h ?? "#000000")), g = p.map(
330
330
  l,
331
- ([m, M, T]) => [m, M, T]
332
- ), h = p.map(l, ([, , , m]) => m), b = ot(p.get(h) ?? 1), d = p.map(c ?? !1, (m) => m), w = p.map(
331
+ ([h, M, T]) => [h, M, T]
332
+ ), m = p.map(l, ([, , , h]) => h), b = ot(p.get(m) ?? 1), d = p.map(c ?? !1, (h) => h), w = p.map(
333
333
  t.colorTextFormat ?? "rgb",
334
- (m) => m
334
+ (h) => h
335
335
  ), x = D(
336
336
  g,
337
337
  b,
338
338
  w,
339
339
  d
340
340
  )(
341
- ([m, M, T], v, S, N) => P(m, M, T, v ?? 1, W(S, N), N)
341
+ ([h, M, T], v, S, R) => P(h, M, T, v ?? 1, j(S, R), R)
342
342
  ), y = p.map(
343
343
  t.colorTextFormat ?? "hex",
344
- (m) => m
345
- ), I = p.map(i, (m) => `${-m / 2} ${-m / 2} ${m} ${m}`), f = D(
344
+ (h) => h
345
+ ), I = p.map(i, (h) => `${-h / 2} ${-h / 2} ${h} ${h}`), f = D(
346
346
  g,
347
347
  i
348
- )((m, M) => Ht(m, M / 2)), F = D(
348
+ )((h, M) => Ht(h, M / 2)), F = D(
349
349
  g,
350
350
  b,
351
351
  d
352
352
  )(
353
- ([m, M, T], v, S) => S || v < 1 ? Rt(m, M, T, v) : J(m, M, T)
353
+ ([h, M, T], v, S) => S || v < 1 ? Nt(h, M, T, v) : J(h, M, T)
354
354
  ), C = _.div(
355
355
  u.class("bc-color-swatch-input__control"),
356
356
  u.class(
357
357
  p.map(
358
358
  d,
359
- (m) => m ? "bc-color-swatch-input__control--alpha" : ""
359
+ (h) => h ? "bc-color-swatch-input__control--alpha" : ""
360
360
  )
361
361
  ),
362
362
  u.style(
363
- D(i)((m) => `min-width:${m + 2}px;height:${m + 2}px`)
363
+ D(i)((h) => `min-width:${h + 2}px;height:${h + 2}px`)
364
364
  ),
365
365
  // The SVG blob preview
366
366
  et.svg(
@@ -373,31 +373,31 @@ const ue = (t) => {
373
373
  u.type("color"),
374
374
  V(t),
375
375
  // Native color input needs hex without alpha
376
- u.value(p.map(g, ([m, M, T]) => J(m, M, T))),
376
+ u.value(p.map(g, ([h, M, T]) => J(h, M, T))),
377
377
  u.class(
378
378
  "bc-input bc-color-swatch-input bc-color-swatch-input__native"
379
379
  ),
380
380
  s != null ? $.blur(s) : A,
381
- n != null ? $.change((m) => {
382
- const M = m.target.value;
381
+ n != null ? $.change((h) => {
382
+ const M = h.target.value;
383
383
  if (!n) return;
384
- const { r: T, g: v, b: S } = H(M) ?? { r: 0, g: 0, b: 0 }, N = p.get(b) ?? 1, L = W(
384
+ const { r: T, g: v, b: S } = H(M) ?? { r: 0, g: 0, b: 0 }, R = p.get(b) ?? 1, L = j(
385
385
  p.get(y),
386
386
  p.get(d)
387
- ), z = P(T, v, S, N, L, p.get(d));
387
+ ), z = P(T, v, S, R, L, p.get(d));
388
388
  n(z);
389
389
  }) : A,
390
- a != null ? $.input((m) => {
391
- const M = m.target.value;
390
+ a != null ? $.input((h) => {
391
+ const M = h.target.value;
392
392
  if (!a) return;
393
- const { r: T, g: v, b: S } = H(M) ?? { r: 0, g: 0, b: 0 }, N = p.get(b) ?? 1, L = W(
393
+ const { r: T, g: v, b: S } = H(M) ?? { r: 0, g: 0, b: 0 }, R = p.get(b) ?? 1, L = j(
394
394
  p.get(y),
395
395
  p.get(d)
396
- ), z = P(T, v, S, N, L, p.get(d));
396
+ ), z = P(T, v, S, R, L, p.get(d));
397
397
  a(z);
398
398
  }) : A
399
399
  )
400
- ), k = j(
400
+ ), k = W(
401
401
  d,
402
402
  () => _.input(
403
403
  u.type("range"),
@@ -405,24 +405,24 @@ const ue = (t) => {
405
405
  u.min(0),
406
406
  u.max(1),
407
407
  u.step(0.01),
408
- u.value(p.map(b, (m) => String(m ?? 1))),
408
+ u.value(p.map(b, (h) => String(h ?? 1))),
409
409
  u.disabled(t.disabled),
410
- $.input((m) => {
411
- const M = parseFloat(m.target.value);
410
+ $.input((h) => {
411
+ const M = parseFloat(h.target.value);
412
412
  b.set(M);
413
- const [T, v, S] = p.get(g), N = W(
413
+ const [T, v, S] = p.get(g), R = j(
414
414
  p.get(y),
415
415
  p.get(d)
416
- ), L = P(T, v, S, M, N, p.get(d));
416
+ ), L = P(T, v, S, M, R, p.get(d));
417
417
  a?.(L);
418
418
  }),
419
- $.change((m) => {
420
- const M = parseFloat(m.target.value);
419
+ $.change((h) => {
420
+ const M = parseFloat(h.target.value);
421
421
  b.set(M);
422
- const [T, v, S] = p.get(g), N = W(
422
+ const [T, v, S] = p.get(g), R = j(
423
423
  p.get(y),
424
424
  p.get(d)
425
- ), L = P(T, v, S, M, N, p.get(d));
425
+ ), L = P(T, v, S, M, R, p.get(d));
426
426
  n?.(L);
427
427
  })
428
428
  )
@@ -435,7 +435,7 @@ const ue = (t) => {
435
435
  input: C,
436
436
  // If caller provided an `after`, append RGB before it
437
437
  after: E(
438
- j(
438
+ W(
439
439
  r ?? !1,
440
440
  () => _.span(u.class("bc-color-swatch-input__rgb"), x)
441
441
  ),
@@ -482,8 +482,8 @@ const ge = ({
482
482
  (i) => i ? "bc-editable-text--disabled" : ""
483
483
  )
484
484
  ),
485
- R.disabled(c),
486
- j(
485
+ N.disabled(c),
486
+ W(
487
487
  r,
488
488
  () => _.input(
489
489
  u.placeholder(n),
@@ -508,7 +508,7 @@ const ge = ({
508
508
  p.get(c) || r.set(!0);
509
509
  }),
510
510
  u.class("bc-editable-text__display"),
511
- j(
511
+ W(
512
512
  p.map(e, (i) => i != null && i.trim() !== ""),
513
513
  () => _.span(u.class("bc-editable-text__text"), e),
514
514
  () => _.span(
@@ -516,12 +516,12 @@ const ge = ({
516
516
  n
517
517
  )
518
518
  ),
519
- j(
519
+ W(
520
520
  p.map(c, (i) => !i),
521
521
  () => _.button(
522
522
  u.type("button"),
523
523
  u.class("bc-editable-text__edit-button"),
524
- ct(wt, (i) => R.label(i.$.editLabel)),
524
+ ct(wt, (i) => N.label(i.$.editLabel)),
525
525
  $.click(() => r.set(!0)),
526
526
  Q({ icon: "line-md/pencil", color: "neutral" })
527
527
  )
@@ -546,7 +546,7 @@ const ge = ({
546
546
  }, zt = (t) => {
547
547
  const e = t.getFullYear(), s = t.getMonth() + 1, n = t.getDate(), a = t.getHours(), r = t.getMinutes(), o = t.getSeconds();
548
548
  return `${e}-${s.toString().padStart(2, "0")}-${n.toString().padStart(2, "0")}T${a.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}:${o.toString().padStart(2, "0")}`;
549
- }, me = (t) => {
549
+ }, he = (t) => {
550
550
  const { value: e, onBlur: s, onChange: n, onInput: a, after: r, disabled: o } = t, c = p.map(e, (l) => l != null ? zt(l) : null), i = X(e, o, n ?? a);
551
551
  return U({
552
552
  ...t,
@@ -575,7 +575,7 @@ function O(t) {
575
575
  });
576
576
  };
577
577
  }
578
- const he = O(kt), fe = O(xt), be = O(Tt), ye = O(
578
+ const me = O(kt), fe = O(xt), be = O(Tt), ye = O(
579
579
  ft
580
580
  ), we = ({
581
581
  value: t,
@@ -590,7 +590,7 @@ const he = O(kt), fe = O(xt), be = O(Tt), ye = O(
590
590
  color: l = "primary",
591
591
  tabIndex: g = 0
592
592
  }) => {
593
- const h = i ?? Ct("switch");
593
+ const m = i ?? Ct("switch");
594
594
  function b(y, I) {
595
595
  const f = [
596
596
  "bc-switch",
@@ -604,7 +604,7 @@ const he = O(kt), fe = O(xt), be = O(Tt), ye = O(
604
604
  return f.set("--switch-track-on-bg", F.backgroundColor), f.set("--switch-track-on-label", F.textColor), f.set("--switch-track-on-bg-dark", C.backgroundColor), f.set("--switch-track-on-label-dark", C.textColor), f.set(
605
605
  "--switch-track-on-border-dark",
606
606
  Mt(I, "dark")
607
- ), Array.from(f.entries()).map(([k, m]) => `${k}: ${m}`).join("; ");
607
+ ), Array.from(f.entries()).map(([k, h]) => `${k}: ${h}`).join("; ");
608
608
  }
609
609
  const w = () => {
610
610
  p.get(o) || (e?.(!p.get(t)), s?.(!p.get(t)));
@@ -625,7 +625,7 @@ const he = O(kt), fe = O(xt), be = O(Tt), ye = O(
625
625
  (y) => d(y)
626
626
  )
627
627
  ),
628
- u.id(h),
628
+ u.id(m),
629
629
  u.role("switch"),
630
630
  u.tabindex(
631
631
  D(
@@ -633,8 +633,8 @@ const he = O(kt), fe = O(xt), be = O(Tt), ye = O(
633
633
  g
634
634
  )((y, I) => y ? -1 : I ?? 0)
635
635
  ),
636
- R.checked(t),
637
- R.disabled(o),
636
+ N.checked(t),
637
+ N.disabled(o),
638
638
  $.click(w),
639
639
  $.keydown(x),
640
640
  n != null ? $.blur(n) : null,
@@ -647,7 +647,7 @@ const he = O(kt), fe = O(xt), be = O(Tt), ye = O(
647
647
  )
648
648
  ),
649
649
  a != null ? _.div(
650
- R.hidden(!0),
650
+ N.hidden(!0),
651
651
  u.class("bc-switch__track-label bc-switch__track-label--off"),
652
652
  u.class(
653
653
  p.map(
@@ -685,7 +685,7 @@ const he = O(kt), fe = O(xt), be = O(Tt), ye = O(
685
685
  c,
686
686
  I
687
687
  )((f, { width: F }, C, k) => {
688
- const m = (() => {
688
+ const h = (() => {
689
689
  switch (C) {
690
690
  case "xs":
691
691
  return 5;
@@ -698,7 +698,7 @@ const he = O(kt), fe = O(xt), be = O(Tt), ye = O(
698
698
  case "xl":
699
699
  return 8;
700
700
  }
701
- })(), M = k === "rtl" ? `calc((var(--spacing-base) * ${m}) - ${F}px)` : `calc(${F}px - (var(--spacing-base) * ${m}))`;
701
+ })(), M = k === "rtl" ? `calc((var(--spacing-base) * ${h}) - ${F}px)` : `calc(${F}px - (var(--spacing-base) * ${h}))`;
702
702
  return f ? `translateX(${M})` : "translateX(0)";
703
703
  })
704
704
  )
@@ -719,13 +719,13 @@ const he = O(kt), fe = O(xt), be = O(Tt), ye = O(
719
719
  emptyIcon: i = Kt,
720
720
  size: l = "md",
721
721
  onBlur: g,
722
- rounding: h = 1
722
+ rounding: m = 1
723
723
  } = t, b = () => {
724
- const f = p.get(h);
724
+ const f = p.get(m);
725
725
  return f > 0 ? f : 1;
726
726
  }, d = (f) => Math.min(Math.max(f, 0), p.get(a)), w = (f, F) => {
727
727
  if (p.get(n ?? !1)) return;
728
- const k = f.currentTarget.getBoundingClientRect(), m = (f.clientX - k.left) / k.width, M = F - 1 + m, T = b(), v = Math.ceil(M / T) * T, S = d(v);
728
+ const k = f.currentTarget.getBoundingClientRect(), h = (f.clientX - k.left) / k.width, M = F - 1 + h, T = b(), v = Math.ceil(M / T) * T, S = d(v);
729
729
  s?.(S);
730
730
  }, x = (f) => {
731
731
  if (p.get(n ?? !1)) return;
@@ -800,11 +800,11 @@ const he = O(kt), fe = O(xt), be = O(Tt), ye = O(
800
800
  // ARIA slider semantics
801
801
  u.role("slider"),
802
802
  u.tabindex(p.map(n ?? !1, (f) => f ? -1 : 0)),
803
- R.disabled(n ?? !1),
804
- R.valuemin(0),
805
- R.valuemax(p.map(a, (f) => f ?? 0)),
806
- R.valuenow(p.map(e, (f) => f ?? 0)),
807
- R.valuetext(
803
+ N.disabled(n ?? !1),
804
+ N.valuemin(0),
805
+ N.valuemax(p.map(a, (f) => f ?? 0)),
806
+ N.valuenow(p.map(e, (f) => f ?? 0)),
807
+ N.valuetext(
808
808
  D(
809
809
  e,
810
810
  a
@@ -854,8 +854,8 @@ const he = O(kt), fe = O(xt), be = O(Tt), ye = O(
854
854
  }, Ie = (t) => {
855
855
  const { value: e, step: s, min: n, max: a, onBlur: r, onChange: o, onInput: c } = t, i = p.map(e, (g) => {
856
856
  if (g != null) return g;
857
- const h = n != null ? p.get(n) : void 0;
858
- return typeof h == "number" ? h : 0;
857
+ const m = n != null ? p.get(n) : void 0;
858
+ return typeof m == "number" ? m : 0;
859
859
  }), l = X(
860
860
  e,
861
861
  t.disabled,
@@ -1086,9 +1086,12 @@ class te {
1086
1086
  const ke = new te();
1087
1087
  function Te(t, e, s) {
1088
1088
  return {
1089
- name: t,
1090
1089
  factory: e,
1091
- displayName: s?.displayName || t,
1090
+ matcher: (n) => {
1091
+ const r = n.definition["x:ui"];
1092
+ return r === t || typeof r == "object" && r !== null && r.widget === t;
1093
+ },
1094
+ displayName: s?.displayName ?? t,
1092
1095
  priority: s?.priority ?? 100,
1093
1096
  // High priority for explicit matches
1094
1097
  ...s
@@ -1096,31 +1099,28 @@ function Te(t, e, s) {
1096
1099
  }
1097
1100
  function Ce(t, e, s) {
1098
1101
  return {
1099
- name: s?.name || `custom-${t}`,
1100
1102
  factory: e,
1101
- displayName: s?.displayName || `${t} widget`,
1102
- priority: s?.priority ?? 75,
1103
1103
  matcher: (n) => n.definition.format === t,
1104
+ displayName: s?.displayName ?? `${t} widget`,
1105
+ priority: s?.priority ?? 75,
1104
1106
  ...s
1105
1107
  };
1106
1108
  }
1107
1109
  function Fe(t, e, s, n) {
1108
1110
  return {
1109
- name: n?.name || `custom-${t}-${e}`,
1110
1111
  factory: s,
1111
- displayName: n?.displayName || `${t}:${e} widget`,
1112
- priority: n?.priority ?? 80,
1113
1112
  matcher: (a) => {
1114
1113
  const r = a.definition;
1115
1114
  return r.type === t && r.format === e;
1116
1115
  },
1116
+ displayName: n?.displayName ?? `${t}:${e} widget`,
1117
+ priority: n?.priority ?? 80,
1117
1118
  ...n
1118
1119
  };
1119
1120
  }
1120
1121
  function Ae(t) {
1121
1122
  const e = t?.logPrefix ?? "WIDGET_DIAG", s = t?.filterFn ?? (() => !0);
1122
1123
  return {
1123
- name: "__diagnostic-widget__",
1124
1124
  factory: () => null,
1125
1125
  displayName: "Diagnostic Widget (never matches)",
1126
1126
  priority: -1e3,
@@ -1144,9 +1144,9 @@ export {
1144
1144
  ie as A,
1145
1145
  le as B,
1146
1146
  ue as C,
1147
- Nt as D,
1147
+ Rt as D,
1148
1148
  ge as E,
1149
- Rt as F,
1149
+ Nt as F,
1150
1150
  Dt as G,
1151
1151
  pt as H,
1152
1152
  Lt as I,
@@ -1160,7 +1160,7 @@ export {
1160
1160
  P as Q,
1161
1161
  qt as R,
1162
1162
  we as S,
1163
- W as T,
1163
+ j as T,
1164
1164
  ke as U,
1165
1165
  Zt as V,
1166
1166
  Jt as W,
@@ -1173,10 +1173,10 @@ export {
1173
1173
  at as e,
1174
1174
  Te as f,
1175
1175
  Ut as g,
1176
- jt as h,
1176
+ Wt as h,
1177
1177
  ce as i,
1178
- me as j,
1179
- he as k,
1178
+ he as j,
1179
+ me as k,
1180
1180
  be as l,
1181
1181
  ye as m,
1182
1182
  Yt as n,