@rpcbase/ui 0.263.0 → 0.265.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/index302.js CHANGED
@@ -140,47 +140,47 @@ function b({ direction: e, viewportRef: n, speed: i = 400, className: s }) {
140
140
  function x({ id: e, value: n, onChange: a, onValueUpdate: o, options: d, placeholder: f = "Select time", className: p, inputClassName: m, disabled: h, readOnly: g, open: _, onOpenChange: v, triggerTestId: ee, contentTestId: te, isHydrated: x }) {
141
141
  let S = r.useId(), C = e ?? `hours-picker-${S}`, T = r.useRef(null), E = r.useRef(null), D = r.useCallback((e) => {
142
142
  E.current = e;
143
- }, []), O = r.useRef(null), k = r.useRef(!1), [A, j] = r.useState(null), M = r.useRef(null), N = r.useRef(null), P = r.useRef(null), [F, ne] = r.useState(() => ({
143
+ }, []), O = r.useRef(null), k = r.useRef(!1), [A, j] = r.useState(null), M = r.useRef(null), N = r.useRef(null), P = r.useRef(null), [F, I] = r.useState(() => ({
144
144
  left: 0,
145
145
  top: 0,
146
146
  width: 0
147
- })), [I, re] = r.useState(!1), L = _ ?? I, R = v ?? re, z = r.useRef(!1);
148
- z.current = L, r.useEffect(() => {
149
- if (!L || h || g) return;
147
+ })), [L, R] = r.useState(!1), z = _ ?? L, B = v ?? R, V = r.useRef(!1);
148
+ V.current = z, r.useEffect(() => {
149
+ if (!z || h || g) return;
150
150
  let e = T.current;
151
151
  e instanceof HTMLInputElement && (typeof document < "u" && document.activeElement === e || e.focus({ preventScroll: !0 }));
152
152
  }, [
153
153
  h,
154
- L,
154
+ z,
155
155
  g
156
156
  ]);
157
- let B = r.useCallback((e) => {
157
+ let H = r.useCallback((e) => {
158
158
  O.current = e, j(e);
159
- }, []), ie = r.useCallback(() => {
159
+ }, []), U = r.useCallback(() => {
160
160
  k.current = !0;
161
161
  }, []);
162
162
  r.useEffect(() => {
163
- if (!L) return;
163
+ if (!z) return;
164
164
  let e = d.find((e) => e.value === n);
165
165
  if (e && y(e)) {
166
- B(e.value);
166
+ H(e.value);
167
167
  return;
168
168
  }
169
169
  let t = d.find((e) => y(e));
170
- B(t?.value ?? null);
170
+ H(t?.value ?? null);
171
171
  }, [
172
- L,
172
+ z,
173
173
  d,
174
- B,
174
+ H,
175
175
  n
176
176
  ]);
177
- let ae = r.useCallback((e) => {
177
+ let ne = r.useCallback((e) => {
178
178
  if (e === null) {
179
179
  o && o(null);
180
180
  return;
181
181
  }
182
182
  y(d.find((t) => t.value === e)) && o && o(e);
183
- }, [o, d]), V = r.useCallback((e) => {
183
+ }, [o, d]), W = r.useCallback((e) => {
184
184
  if (e === null) {
185
185
  o && o(null), a(null);
186
186
  return;
@@ -192,24 +192,24 @@ function x({ id: e, value: n, onChange: a, onValueUpdate: o, options: d, placeho
192
192
  d
193
193
  ]);
194
194
  r.useEffect(() => {
195
- if (!L) return;
195
+ if (!z) return;
196
196
  let e = M.current?.ownerDocument ?? document, t = e.defaultView ?? window, n = (e) => {
197
197
  let t = e.target;
198
198
  if (!(t instanceof Node)) return;
199
199
  let n = M.current;
200
- n && (n.contains(t) || N.current?.contains(t) || R(!1));
200
+ n && (n.contains(t) || N.current?.contains(t) || B(!1));
201
201
  }, r = (e) => {
202
- if (e.key !== "Escape" || !z.current) return;
202
+ if (e.key !== "Escape" || !V.current) return;
203
203
  let t = e.target;
204
204
  if (!(t instanceof Node)) return;
205
205
  let n = M.current, r = N.current;
206
- !n?.contains(t) && !r?.contains(t) || (e.preventDefault(), e.stopPropagation(), R(!1));
206
+ !n?.contains(t) && !r?.contains(t) || (e.preventDefault(), e.stopPropagation(), B(!1));
207
207
  };
208
208
  return e.addEventListener("pointerdown", n, !0), t.addEventListener("keydown", r, !0), () => {
209
209
  e.removeEventListener("pointerdown", n, !0), t.removeEventListener("keydown", r, !0);
210
210
  };
211
- }, [L, R]), r.useEffect(() => {
212
- if (!L) return;
211
+ }, [z, B]), r.useEffect(() => {
212
+ if (!z) return;
213
213
  let e = N.current;
214
214
  if (!e) return;
215
215
  let t = (e) => {
@@ -227,50 +227,50 @@ function x({ id: e, value: n, onChange: a, onValueUpdate: o, options: d, placeho
227
227
  return e.addEventListener("wheel", t, { passive: !1 }), () => {
228
228
  e.removeEventListener("wheel", t);
229
229
  };
230
- }, [L]), r.useEffect(() => {
231
- if (!L || _ !== void 0 && !v || typeof window > "u" || !("IntersectionObserver" in window)) return;
230
+ }, [z]), r.useEffect(() => {
231
+ if (!z || _ !== void 0 && !v || typeof window > "u" || !("IntersectionObserver" in window)) return;
232
232
  let e = T.current;
233
233
  if (!(e instanceof HTMLElement)) return;
234
234
  let t = !0, n = new IntersectionObserver((e) => {
235
235
  if (!t) return;
236
236
  let n = e[0];
237
- n && !n.isIntersecting && R(!1);
237
+ n && !n.isIntersecting && B(!1);
238
238
  });
239
239
  return n.observe(e), () => {
240
240
  t = !1, n.disconnect();
241
241
  };
242
242
  }, [
243
243
  v,
244
- L,
244
+ z,
245
245
  _,
246
- R
246
+ B
247
247
  ]);
248
- let H = r.useCallback(() => {
248
+ let G = r.useCallback(() => {
249
249
  if (typeof window > "u") return;
250
250
  let e = T.current, t = N.current;
251
251
  if (!(e instanceof HTMLElement) || !t) return;
252
252
  let n = e.getBoundingClientRect(), r = t.offsetHeight, i = window.innerWidth ?? 0, a = window.innerHeight ?? 0, o = n.width, s = n.left;
253
253
  s + o > i - 8 && (s = Math.max(8, i - o - 8)), s < 8 && (s = 8);
254
254
  let c = n.bottom + 8, l = c + r > a - 8, u = n.top - r - 8;
255
- l && u >= 8 && (c = u), c < 8 && (c = 8), c + r > a - 8 && (c = Math.max(8, a - r - 8)), ne({
255
+ l && u >= 8 && (c = u), c < 8 && (c = 8), c + r > a - 8 && (c = Math.max(8, a - r - 8)), I({
256
256
  left: s,
257
257
  top: c,
258
258
  width: o
259
259
  });
260
260
  }, []);
261
- return r.useLayoutEffect(() => {
262
- if (!L || h || typeof window > "u") return;
263
- H();
264
- let e = window.requestAnimationFrame(H);
265
- return window.addEventListener("scroll", H, !0), window.addEventListener("resize", H), () => {
266
- window.cancelAnimationFrame(e), window.removeEventListener("scroll", H, !0), window.removeEventListener("resize", H);
261
+ r.useLayoutEffect(() => {
262
+ if (!z || h || typeof window > "u") return;
263
+ G();
264
+ let e = window.requestAnimationFrame(G);
265
+ return window.addEventListener("scroll", G, !0), window.addEventListener("resize", G), () => {
266
+ window.cancelAnimationFrame(e), window.removeEventListener("scroll", G, !0), window.removeEventListener("resize", G);
267
267
  };
268
268
  }, [
269
269
  h,
270
- L,
271
- H
270
+ z,
271
+ G
272
272
  ]), r.useEffect(() => {
273
- if (!L) return;
273
+ if (!z) return;
274
274
  let e = P.current;
275
275
  if (!e) return;
276
276
  let t = requestAnimationFrame(() => {
@@ -299,8 +299,8 @@ function x({ id: e, value: n, onChange: a, onValueUpdate: o, options: d, placeho
299
299
  e.scrollTop = a;
300
300
  });
301
301
  return () => cancelAnimationFrame(t);
302
- }, [L, d]), r.useEffect(() => {
303
- if (!L || !A || !k.current) return;
302
+ }, [z, d]), r.useEffect(() => {
303
+ if (!z || !A || !k.current) return;
304
304
  let e = P.current;
305
305
  if (!e) return;
306
306
  let t = e.querySelector(`[role="option"][data-value="${A}"]`);
@@ -311,7 +311,9 @@ function x({ id: e, value: n, onChange: a, onValueUpdate: o, options: d, placeho
311
311
  return;
312
312
  }
313
313
  r > e.scrollTop + e.clientHeight && (e.scrollTop = Math.max(0, r - e.clientHeight));
314
- }, [A, L]), /* @__PURE__ */ c("div", {
314
+ }, [A, z]);
315
+ let re = d.find((e) => e.value === n);
316
+ return /* @__PURE__ */ c("div", {
315
317
  "data-slot": "hours-picker-input",
316
318
  className: t("w-[150px]", p),
317
319
  ref: M,
@@ -321,24 +323,25 @@ function x({ id: e, value: n, onChange: a, onValueUpdate: o, options: d, placeho
321
323
  id: C,
322
324
  placeholder: f,
323
325
  value: n,
324
- onValueUpdate: ae,
325
- onCommit: V,
326
+ onValueUpdate: ne,
327
+ onCommit: W,
326
328
  options: d,
329
+ selectedLabel: re?.selectedLabel,
327
330
  disabled: h,
328
331
  readOnly: g,
329
- open: L,
330
- setOpen: R,
332
+ open: z,
333
+ setOpen: B,
331
334
  inputClassName: m,
332
335
  triggerTestId: ee,
333
336
  isHydrated: x,
334
337
  highlightedValueRef: O,
335
- setHighlightedValue: B,
336
- markKeyboardNavigation: ie,
338
+ setHighlightedValue: H,
339
+ markKeyboardNavigation: U,
337
340
  inputRef: (e) => {
338
341
  T.current = e;
339
342
  },
340
343
  onDraftValueHandlerChange: D
341
- }), L ? (() => {
344
+ }), z ? (() => {
342
345
  let e = /* @__PURE__ */ c(s, { children: /* @__PURE__ */ l("div", {
343
346
  ref: N,
344
347
  "data-testid": te,
@@ -371,13 +374,13 @@ function x({ id: e, value: n, onChange: a, onValueUpdate: o, options: d, placeho
371
374
  e.preventDefault();
372
375
  },
373
376
  onClick: () => {
374
- e.disabled || (E.current?.(e.value), B(e.value), T.current?.focus({ preventScroll: !0 }), V(e.value), R(!1));
377
+ e.disabled || (E.current?.(e.value), H(e.value), T.current?.focus({ preventScroll: !0 }), W(e.value), B(!1));
375
378
  },
376
379
  onPointerEnter: () => {
377
- k.current || (k.current = !1, B(e.value));
380
+ k.current || (k.current = !1, H(e.value));
378
381
  },
379
382
  onPointerMove: (t) => {
380
- k.current && t.movementX === 0 && t.movementY === 0 || (k.current = !1, B(e.value));
383
+ k.current && t.movementX === 0 && t.movementY === 0 || (k.current = !1, H(e.value));
381
384
  },
382
385
  children: [/* @__PURE__ */ c("span", {
383
386
  className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
@@ -415,13 +418,13 @@ function S({ id: e, value: n, onChange: o, onValueUpdate: d, options: f, placeho
415
418
  width: 0
416
419
  })), [j, M] = r.useState(!1), N = v ?? j, P = ee ?? M, F = r.useRef(!1);
417
420
  F.current = N;
418
- let ne = r.useCallback((e) => {
421
+ let I = r.useCallback((e) => {
419
422
  y(f.find((t) => t.value === e)) && (d && d(e), o(e));
420
423
  }, [
421
424
  o,
422
425
  d,
423
426
  f
424
- ]), I = r.useCallback(() => {
427
+ ]), L = r.useCallback(() => {
425
428
  if (typeof window > "u") return;
426
429
  let e = T.current, t = D.current;
427
430
  if (!(e instanceof HTMLElement) || !t) return;
@@ -436,15 +439,15 @@ function S({ id: e, value: n, onChange: o, onValueUpdate: d, options: f, placeho
436
439
  }, []);
437
440
  r.useLayoutEffect(() => {
438
441
  if (!N || g || typeof window > "u") return;
439
- I();
440
- let e = window.requestAnimationFrame(I);
441
- return window.addEventListener("scroll", I, !0), window.addEventListener("resize", I), () => {
442
- window.cancelAnimationFrame(e), window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I);
442
+ L();
443
+ let e = window.requestAnimationFrame(L);
444
+ return window.addEventListener("scroll", L, !0), window.addEventListener("resize", L), () => {
445
+ window.cancelAnimationFrame(e), window.removeEventListener("scroll", L, !0), window.removeEventListener("resize", L);
443
446
  };
444
447
  }, [
445
448
  g,
446
449
  N,
447
- I
450
+ L
448
451
  ]), r.useEffect(() => {
449
452
  if (!N) return;
450
453
  let e = E.current?.ownerDocument ?? document, t = e.defaultView ?? window, n = (e) => {
@@ -461,7 +464,7 @@ function S({ id: e, value: n, onChange: o, onValueUpdate: d, options: f, placeho
461
464
  e.removeEventListener("pointerdown", n, !0), t.removeEventListener("keydown", r, !0);
462
465
  };
463
466
  }, [N, P]);
464
- let re = f.find((e) => e.value === n);
467
+ let R = f.find((e) => e.value === n), z = R?.selectedLabel ?? R?.label;
465
468
  return /* @__PURE__ */ l("div", {
466
469
  "data-slot": "hours-picker-field",
467
470
  className: t("w-[150px]", m),
@@ -482,7 +485,7 @@ function S({ id: e, value: n, onChange: o, onValueUpdate: d, options: f, placeho
482
485
  },
483
486
  children: [/* @__PURE__ */ c("span", {
484
487
  className: "line-clamp-1 text-left",
485
- children: re ? re.label : p
488
+ children: R ? z : p
486
489
  }), /* @__PURE__ */ c(a, {
487
490
  "aria-hidden": !0,
488
491
  className: "h-4 w-4 shrink-0 opacity-50"
@@ -521,7 +524,7 @@ function S({ id: e, value: n, onChange: o, onValueUpdate: d, options: f, placeho
521
524
  e.preventDefault();
522
525
  },
523
526
  onClick: () => {
524
- e.disabled || _ || (ne(e.value), P(!1), T.current?.focus({ preventScroll: !0 }));
527
+ e.disabled || _ || (I(e.value), P(!1), T.current?.focus({ preventScroll: !0 }));
525
528
  },
526
529
  children: [/* @__PURE__ */ c("span", {
527
530
  className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
@@ -561,219 +564,233 @@ function C(t) {
561
564
  }
562
565
  C.displayName = "HourPickerField";
563
566
  function w(e) {
564
- let i = n(93), { id: o, placeholder: s, value: u, onValueUpdate: f, onCommit: p, options: m, disabled: g, readOnly: b, open: x, setOpen: S, inputClassName: C, triggerTestId: w, isHydrated: O, highlightedValueRef: k, setHighlightedValue: A, markKeyboardNavigation: j, inputRef: M, onDraftValueHandlerChange: N } = e, P = r.useRef(!1), F = r.useRef(!1), ne = r.useRef(!1), I = r.useRef(null), re = r.useRef(null), L = r.useRef(!1), R;
565
- i[0] === u ? R = i[1] : (R = () => u || "", i[0] = u, i[1] = R);
566
- let [z, B] = r.useState(R), ie, ae;
567
- i[2] === N ? (ie = i[3], ae = i[4]) : (ie = () => (N((e) => {
568
- B(e);
567
+ let i = n(99), { id: o, placeholder: s, value: u, onValueUpdate: f, onCommit: p, options: m, selectedLabel: g, disabled: b, readOnly: x, open: S, setOpen: C, inputClassName: w, triggerTestId: O, isHydrated: k, highlightedValueRef: A, setHighlightedValue: j, markKeyboardNavigation: M, inputRef: N, onDraftValueHandlerChange: P } = e, F = r.useRef(!1), I = r.useRef(!1), L = r.useRef(!1), R = r.useRef(null), z = r.useRef(null), B = r.useRef(!1), V;
568
+ i[0] === u ? V = i[1] : (V = () => u || "", i[0] = u, i[1] = V);
569
+ let [H, U] = r.useState(V), ne, W;
570
+ i[2] === P ? (ne = i[3], W = i[4]) : (ne = () => (P((e) => {
571
+ U(e);
569
572
  }), () => {
570
- N(null);
571
- }), ae = [N], i[2] = N, i[3] = ie, i[4] = ae), r.useEffect(ie, ae);
572
- let V;
573
- i[5] !== k || i[6] !== f || i[7] !== m || i[8] !== A || i[9] !== u ? (V = (e) => {
574
- let t = k.current ?? u ?? "", n = m.findIndex((e) => e.value === t);
573
+ P(null);
574
+ }), W = [P], i[2] = P, i[3] = ne, i[4] = W), r.useEffect(ne, W);
575
+ let G;
576
+ i[5] !== A || i[6] !== f || i[7] !== m || i[8] !== j || i[9] !== u ? (G = (e) => {
577
+ let t = A.current ?? u ?? "", n = m.findIndex((e) => e.value === t);
575
578
  n === -1 && (n = e === 1 ? -1 : m.length);
576
579
  for (let t = n + e; t >= 0 && t < m.length; t += e) {
577
580
  let e = m[t];
578
581
  if (y(e)) {
579
- A(e.value), I.current = e.value, B(e.value), f(e.value);
582
+ j(e.value), R.current = e.value, U(e.value), f(e.value);
580
583
  return;
581
584
  }
582
585
  }
583
- }, i[5] = k, i[6] = f, i[7] = m, i[8] = A, i[9] = u, i[10] = V) : V = i[10];
584
- let H = V, oe, se;
585
- i[11] === u ? (oe = i[12], se = i[13]) : (oe = () => {
586
- P.current || B(u || "");
587
- }, se = [u], i[11] = u, i[12] = oe, i[13] = se), r.useEffect(oe, se);
586
+ }, i[5] = A, i[6] = f, i[7] = m, i[8] = j, i[9] = u, i[10] = G) : G = i[10];
587
+ let re = G, ie, ae;
588
+ i[11] === u ? (ie = i[12], ae = i[13]) : (ie = () => {
589
+ F.current || U(u || "");
590
+ }, ae = [u], i[11] = u, i[12] = ie, i[13] = ae), r.useEffect(ie, ae);
591
+ let oe, se;
592
+ i[14] === H ? (oe = i[15], se = i[16]) : (oe = () => {
593
+ z.current = _(H);
594
+ }, se = [H], i[14] = H, i[15] = oe, i[16] = se), r.useEffect(oe, se);
588
595
  let ce, le;
589
- i[14] === z ? (ce = i[15], le = i[16]) : (ce = () => {
590
- re.current = _(z);
591
- }, le = [z], i[14] = z, i[15] = ce, i[16] = le), r.useEffect(ce, le);
592
- let ue, de;
593
- i[17] === u ? (ue = i[18], de = i[19]) : (de = () => {
594
- u === null && (L.current = !1);
595
- }, ue = [u], i[17] = u, i[18] = ue, i[19] = de), r.useEffect(de, ue);
596
- let fe = !z && "text-muted-foreground", pe = x && "ring-2 ring-primary ring-offset-2", me;
597
- i[20] !== C || i[21] !== fe || i[22] !== pe ? (me = t("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 pr-10 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "transition-colors group-hover:bg-accent group-hover:text-accent-foreground", fe, pe, "[&_[data-slot='description']]:hidden", C), i[20] = C, i[21] = fe, i[22] = pe, i[23] = me) : me = i[23];
598
- let he = me, ge = O ? "true" : void 0, _e;
599
- i[24] === Symbol.for("react.memo_cache_sentinel") ? (_e = [{
596
+ i[17] === u ? (ce = i[18], le = i[19]) : (le = () => {
597
+ u === null && (B.current = !1);
598
+ }, ce = [u], i[17] = u, i[18] = ce, i[19] = le), r.useEffect(le, ce);
599
+ let ue = !H && "text-muted-foreground", de = S && "ring-2 ring-primary ring-offset-2", fe = u && g != null && "text-transparent focus:text-foreground", pe;
600
+ i[20] !== w || i[21] !== ue || i[22] !== de || i[23] !== fe ? (pe = t("peer flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 pr-10 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "transition-colors group-hover:bg-accent group-hover:text-accent-foreground", ue, de, "[&_[data-slot='description']]:hidden", w, fe), i[20] = w, i[21] = ue, i[22] = de, i[23] = fe, i[24] = pe) : pe = i[24];
601
+ let me = pe, he = k ? "true" : void 0, ge;
602
+ i[25] === Symbol.for("react.memo_cache_sentinel") ? (ge = [{
600
603
  mask: "00:00",
601
604
  lazy: !0
602
605
  }, {
603
606
  mask: "0:00",
604
607
  lazy: !0
605
- }], i[24] = _e) : _e = i[24];
606
- let U;
607
- i[25] === m ? U = i[26] : (U = (e, t) => {
608
+ }], i[25] = ge) : ge = i[25];
609
+ let K;
610
+ i[26] === m ? K = i[27] : (K = (e, t) => {
608
611
  let n = (t.value + e).replace(/\D/g, "");
609
612
  if (n.length <= 2 || n.length >= 4) return t.compiledMasks[0];
610
613
  let r = h(Number(n.slice(0, 2)));
611
614
  return m.some((e) => e.value.startsWith(`${r}:`)) ? t.compiledMasks[0] : t.compiledMasks[1];
612
- }, i[25] = m, i[26] = U);
613
- let W;
614
- i[27] !== p || i[28] !== u ? (W = (e, t, n) => {
615
+ }, i[26] = m, i[27] = K);
616
+ let q;
617
+ i[28] !== p || i[29] !== u ? (q = (e, t, n) => {
615
618
  if (!n) return;
616
619
  let r = typeof e == "string" ? e : String(e ?? ""), i = r.replace(/\D/g, ""), a = _(r);
617
- if (re.current !== a) {
618
- if (re.current = a, B(r), i.length !== 0) {
619
- L.current = !1;
620
+ if (z.current !== a) {
621
+ if (z.current = a, U(r), i.length !== 0) {
622
+ B.current = !1;
620
623
  return;
621
624
  }
622
- u && !L.current && (L.current = !0, p(null));
625
+ u && !B.current && (B.current = !0, p(null));
623
626
  }
624
- }, i[27] = p, i[28] = u, i[29] = W) : W = i[29];
625
- let G;
626
- i[30] !== p || i[31] !== m || i[32] !== A || i[33] !== u ? (G = (e, t, n) => {
627
+ }, i[28] = p, i[29] = u, i[30] = q) : q = i[30];
628
+ let J;
629
+ i[31] !== p || i[32] !== m || i[33] !== j || i[34] !== u ? (J = (e, t, n) => {
627
630
  if (!n) return;
628
631
  let r = typeof e == "string" ? e : String(e ?? "");
629
- if (I.current === r) {
630
- I.current = null;
632
+ if (R.current === r) {
633
+ R.current = null;
631
634
  return;
632
635
  }
633
636
  let i = v(r, m);
634
637
  if (!i) return;
635
638
  if (i.selectableValue) {
636
- if (A(i.selectableValue), B(i.selectableValue), u === i.selectableValue) return;
639
+ if (j(i.selectableValue), U(i.selectableValue), u === i.selectableValue) return;
637
640
  p(i.selectableValue);
638
641
  return;
639
642
  }
640
643
  let a = ee(i.parsed);
641
644
  if (a == null) return;
642
645
  let o = te(a, m);
643
- o && A(o.value);
644
- }, i[30] = p, i[31] = m, i[32] = A, i[33] = u, i[34] = G) : G = i[34];
645
- let K, q, J;
646
- i[35] !== g || i[36] !== x || i[37] !== S ? (K = () => {
647
- F.current = !0, !g && (x || S(!0));
648
- }, q = (e) => {
649
- F.current = !0, ne.current = typeof document < "u" && document.activeElement === e.currentTarget, !g && (x || S(!0));
650
- }, J = () => {
651
- g || x || S(!0);
652
- }, i[35] = g, i[36] = x, i[37] = S, i[38] = K, i[39] = q, i[40] = J) : (K = i[38], q = i[39], J = i[40]);
653
- let Y;
654
- i[41] !== g || i[42] !== z || i[43] !== k || i[44] !== j || i[45] !== H || i[46] !== p || i[47] !== x || i[48] !== m || i[49] !== A || i[50] !== S ? (Y = (e) => {
655
- if (!g) {
656
- if (e.key === "Tab" && x && !e.defaultPrevented) {
657
- S(!1);
646
+ o && j(o.value);
647
+ }, i[31] = p, i[32] = m, i[33] = j, i[34] = u, i[35] = J) : J = i[35];
648
+ let Y, X, Z;
649
+ i[36] !== b || i[37] !== S || i[38] !== C ? (Y = () => {
650
+ I.current = !0, !b && (S || C(!0));
651
+ }, X = (e) => {
652
+ I.current = !0, L.current = typeof document < "u" && document.activeElement === e.currentTarget, !b && (S || C(!0));
653
+ }, Z = () => {
654
+ b || S || C(!0);
655
+ }, i[36] = b, i[37] = S, i[38] = C, i[39] = Y, i[40] = X, i[41] = Z) : (Y = i[39], X = i[40], Z = i[41]);
656
+ let Q;
657
+ i[42] !== b || i[43] !== H || i[44] !== A || i[45] !== M || i[46] !== re || i[47] !== p || i[48] !== S || i[49] !== m || i[50] !== j || i[51] !== C ? (Q = (e) => {
658
+ if (!b) {
659
+ if (e.key === "Tab" && S && !e.defaultPrevented) {
660
+ C(!1);
658
661
  return;
659
662
  }
660
663
  if (e.key === "Escape") {
661
- if (!x) return;
662
- e.preventDefault(), S(!1);
664
+ if (!S) return;
665
+ e.preventDefault(), C(!1);
663
666
  return;
664
667
  }
665
- if (!x && !e.defaultPrevented && (e.key.length === 1 || e.key === "Backspace" || e.key === "Delete") && !e.ctrlKey && !e.metaKey && !e.altKey && S(!0), e.key === "ArrowDown" || e.key === "ArrowUp") {
666
- if (j(), e.preventDefault(), !x) {
667
- S(!0);
668
+ if (!S && !e.defaultPrevented && (e.key.length === 1 || e.key === "Backspace" || e.key === "Delete") && !e.ctrlKey && !e.metaKey && !e.altKey && C(!0), e.key === "ArrowDown" || e.key === "ArrowUp") {
669
+ if (M(), e.preventDefault(), !S) {
670
+ C(!0);
668
671
  return;
669
672
  }
670
- H(e.key === "ArrowDown" ? 1 : -1);
673
+ re(e.key === "ArrowDown" ? 1 : -1);
671
674
  return;
672
675
  }
673
676
  if (e.key === "Enter") {
674
- j();
675
- let t = v(z, m);
677
+ M();
678
+ let t = v(H, m);
676
679
  if (!t) {
677
- if (!x || z.trim() !== "") return;
678
- let t = m.find((e) => e.value === k.current), n = (y(t) ? t?.value : void 0) ?? m.find(D)?.value;
680
+ if (!S || H.trim() !== "") return;
681
+ let t = m.find((e) => e.value === A.current), n = (y(t) ? t?.value : void 0) ?? m.find(D)?.value;
679
682
  if (!n) return;
680
- e.preventDefault(), A(n), B(n), p(n), S(!1);
683
+ e.preventDefault(), j(n), U(n), p(n), C(!1);
681
684
  return;
682
685
  }
683
686
  if (t.selectableValue) {
684
- e.preventDefault(), A(t.selectableValue), B(t.selectableValue), p(t.selectableValue), S(!1);
687
+ e.preventDefault(), j(t.selectableValue), U(t.selectableValue), p(t.selectableValue), C(!1);
685
688
  return;
686
689
  }
687
690
  let n = ee(t.parsed);
688
691
  if (n == null) return;
689
692
  let r = te(n, m);
690
693
  if (!r) return;
691
- e.preventDefault(), A(r.value), B(r.value), p(r.value), S(!1);
694
+ e.preventDefault(), j(r.value), U(r.value), p(r.value), C(!1);
692
695
  return;
693
696
  }
694
697
  }
695
- }, i[41] = g, i[42] = z, i[43] = k, i[44] = j, i[45] = H, i[46] = p, i[47] = x, i[48] = m, i[49] = A, i[50] = S, i[51] = Y) : Y = i[51];
696
- let X;
697
- i[52] !== g || i[53] !== x || i[54] !== S ? (X = (e) => {
698
- let t = !F.current || !ne.current;
699
- if (F.current = !1, ne.current = !1, P.current = !0, t) {
698
+ }, i[42] = b, i[43] = H, i[44] = A, i[45] = M, i[46] = re, i[47] = p, i[48] = S, i[49] = m, i[50] = j, i[51] = C, i[52] = Q) : Q = i[52];
699
+ let $;
700
+ i[53] !== b || i[54] !== S || i[55] !== C ? ($ = (e) => {
701
+ let t = !I.current || !L.current;
702
+ if (I.current = !1, L.current = !1, F.current = !0, t) {
700
703
  let t = e.currentTarget;
701
704
  requestAnimationFrame(() => t.select());
702
705
  }
703
- g || x || S(!0);
704
- }, i[52] = g, i[53] = x, i[54] = S, i[55] = X) : X = i[55];
705
- let Z;
706
- i[56] !== z || i[57] !== p || i[58] !== m || i[59] !== u ? (Z = () => {
707
- P.current = !1;
708
- let e = z.trim();
706
+ b || S || C(!0);
707
+ }, i[53] = b, i[54] = S, i[55] = C, i[56] = $) : $ = i[56];
708
+ let _e;
709
+ i[57] !== H || i[58] !== p || i[59] !== m || i[60] !== u ? (_e = () => {
710
+ F.current = !1;
711
+ let e = H.trim();
709
712
  if (!e) {
710
- B(u || "");
713
+ U(u || "");
711
714
  return;
712
715
  }
713
716
  let t = v(e, m);
714
717
  if (!t) {
715
- B(u || "");
718
+ U(u || "");
716
719
  return;
717
720
  }
718
721
  if (!t.selectableValue) {
719
- B(u || "");
722
+ U(u || "");
720
723
  return;
721
724
  }
722
- B(t.selectableValue), u !== t.selectableValue && p(t.selectableValue);
723
- }, i[56] = z, i[57] = p, i[58] = m, i[59] = u, i[60] = Z) : Z = i[60];
724
- let Q;
725
- i[61] !== g || i[62] !== z || i[63] !== o || i[64] !== M || i[65] !== s || i[66] !== b || i[67] !== ge || i[68] !== U || i[69] !== W || i[70] !== G || i[71] !== K || i[72] !== q || i[73] !== J || i[74] !== Y || i[75] !== X || i[76] !== Z || i[77] !== he || i[78] !== w ? (Q = /* @__PURE__ */ c(d, {
725
+ U(t.selectableValue), u !== t.selectableValue && p(t.selectableValue);
726
+ }, i[57] = H, i[58] = p, i[59] = m, i[60] = u, i[61] = _e) : _e = i[61];
727
+ let ve;
728
+ i[62] !== b || i[63] !== H || i[64] !== o || i[65] !== N || i[66] !== s || i[67] !== x || i[68] !== he || i[69] !== K || i[70] !== q || i[71] !== J || i[72] !== Y || i[73] !== X || i[74] !== Z || i[75] !== Q || i[76] !== $ || i[77] !== _e || i[78] !== me || i[79] !== O ? (ve = /* @__PURE__ */ c(d, {
726
729
  id: o,
727
- "data-testid": w,
728
- "data-hydrated": ge,
730
+ "data-testid": O,
731
+ "data-hydrated": he,
729
732
  type: "text",
730
- disabled: g,
731
- readOnly: b,
732
- inputRef: M,
733
+ disabled: b,
734
+ readOnly: x,
735
+ inputRef: N,
733
736
  autoComplete: "off",
734
- mask: _e,
735
- dispatch: U,
737
+ mask: ge,
738
+ dispatch: K,
736
739
  placeholder: s,
737
- value: z,
738
- className: he,
739
- onAccept: W,
740
- onComplete: G,
741
- onPointerDown: K,
742
- onMouseDown: q,
743
- onClick: J,
744
- onKeyDown: Y,
745
- onFocus: X,
746
- onBlur: Z
747
- }), i[61] = g, i[62] = z, i[63] = o, i[64] = M, i[65] = s, i[66] = b, i[67] = ge, i[68] = U, i[69] = W, i[70] = G, i[71] = K, i[72] = q, i[73] = J, i[74] = Y, i[75] = X, i[76] = Z, i[77] = he, i[78] = w, i[79] = Q) : Q = i[79];
748
- let ve;
749
- i[80] === Symbol.for("react.memo_cache_sentinel") ? (ve = t("absolute right-1 top-1/2 inline-flex size-8 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"), i[80] = ve) : ve = i[80];
750
- let ye = x ? "Close time picker" : "Open time picker", $;
751
- i[81] !== g || i[82] !== x || i[83] !== S ? ($ = () => {
752
- g || S(!x);
753
- }, i[81] = g, i[82] = x, i[83] = S, i[84] = $) : $ = i[84];
740
+ value: H,
741
+ className: me,
742
+ onAccept: q,
743
+ onComplete: J,
744
+ onPointerDown: Y,
745
+ onMouseDown: X,
746
+ onClick: Z,
747
+ onKeyDown: Q,
748
+ onFocus: $,
749
+ onBlur: _e
750
+ }), i[62] = b, i[63] = H, i[64] = o, i[65] = N, i[66] = s, i[67] = x, i[68] = he, i[69] = K, i[70] = q, i[71] = J, i[72] = Y, i[73] = X, i[74] = Z, i[75] = Q, i[76] = $, i[77] = _e, i[78] = me, i[79] = O, i[80] = ve) : ve = i[80];
751
+ let ye;
752
+ i[81] !== b || i[82] !== g || i[83] !== u ? (ye = u && g != null ? /* @__PURE__ */ c("span", {
753
+ "aria-hidden": "true",
754
+ "data-slot": "hours-picker-input-selected-label",
755
+ className: t("pointer-events-none absolute inset-y-0 left-3 right-10 flex min-w-0 items-center text-base peer-focus:hidden md:text-sm", b && "opacity-50"),
756
+ children: /* @__PURE__ */ c("span", {
757
+ className: "min-w-0 truncate",
758
+ children: g
759
+ })
760
+ }) : null, i[81] = b, i[82] = g, i[83] = u, i[84] = ye) : ye = i[84];
754
761
  let be;
755
- i[85] === Symbol.for("react.memo_cache_sentinel") ? (be = /* @__PURE__ */ c(a, {
762
+ i[85] === Symbol.for("react.memo_cache_sentinel") ? (be = t("absolute right-1 top-1/2 inline-flex size-8 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"), i[85] = be) : be = i[85];
763
+ let xe = S ? "Close time picker" : "Open time picker", Se;
764
+ i[86] !== b || i[87] !== S || i[88] !== C ? (Se = () => {
765
+ b || C(!S);
766
+ }, i[86] = b, i[87] = S, i[88] = C, i[89] = Se) : Se = i[89];
767
+ let Ce;
768
+ i[90] === Symbol.for("react.memo_cache_sentinel") ? (Ce = /* @__PURE__ */ c(a, {
756
769
  "aria-hidden": !0,
757
770
  className: "size-4"
758
- }), i[85] = be) : be = i[85];
759
- let xe;
760
- i[86] !== g || i[87] !== ye || i[88] !== $ ? (xe = /* @__PURE__ */ c("button", {
771
+ }), i[90] = Ce) : Ce = i[90];
772
+ let we;
773
+ i[91] !== b || i[92] !== xe || i[93] !== Se ? (we = /* @__PURE__ */ c("button", {
761
774
  type: "button",
762
775
  tabIndex: -1,
763
- disabled: g,
776
+ disabled: b,
764
777
  "data-slot": "hours-picker-input-toggle",
765
- className: ve,
766
- "aria-label": ye,
778
+ className: be,
779
+ "aria-label": xe,
767
780
  onPointerDown: E,
768
781
  onMouseDown: T,
769
- onClick: $,
770
- children: be
771
- }), i[86] = g, i[87] = ye, i[88] = $, i[89] = xe) : xe = i[89];
772
- let Se;
773
- return i[90] !== Q || i[91] !== xe ? (Se = /* @__PURE__ */ l("div", {
782
+ onClick: Se,
783
+ children: Ce
784
+ }), i[91] = b, i[92] = xe, i[93] = Se, i[94] = we) : we = i[94];
785
+ let Te;
786
+ return i[95] !== ve || i[96] !== ye || i[97] !== we ? (Te = /* @__PURE__ */ l("div", {
774
787
  className: "relative group",
775
- children: [Q, xe]
776
- }), i[90] = Q, i[91] = xe, i[92] = Se) : Se = i[92], Se;
788
+ children: [
789
+ ve,
790
+ ye,
791
+ we
792
+ ]
793
+ }), i[95] = ve, i[96] = ye, i[97] = we, i[98] = Te) : Te = i[98], Te;
777
794
  }
778
795
  function T(e) {
779
796
  e.preventDefault();