@alfadocs/ui-kit 1.20.0 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/_chunks/{anamnesis-summary-rows-BPSQhxnZ.js → anamnesis-summary-rows-DwjqZgR5.js} +2 -2
  2. package/dist/_chunks/{antenatal-schedule-timeline-B1k8QkA6.js → antenatal-schedule-timeline-sXfIp5lp.js} +3 -3
  3. package/dist/_chunks/{appointment-timeline-DCn0Jx55.js → appointment-timeline-DhHwmHo1.js} +2 -2
  4. package/dist/_chunks/{balance-badge-cell-BlvFil5p.js → balance-badge-cell-Bh2QbxsZ.js} +47 -46
  5. package/dist/_chunks/{booking-DQbo6mQF.js → booking-WXKbA69C.js} +4 -4
  6. package/dist/_chunks/{calendar-workspace-D6kipuvT.js → calendar-workspace-CB6KLoF6.js} +4 -4
  7. package/dist/_chunks/{cycle-calculator-DmtYGhqq.js → cycle-calculator-DVgxBfP0.js} +3 -3
  8. package/dist/_chunks/{data-table-D7nA8OGL.js → data-table-Bw3i0753.js} +252 -248
  9. package/dist/_chunks/{date-picker-CepI_oI2.js → date-picker-B6NW_PS5.js} +3 -3
  10. package/dist/_chunks/{date-picker-variants-DfuooXEK.js → date-picker-variants-B9NLAfUK.js} +5 -2
  11. package/dist/_chunks/{date-range-picker-BD8P_rJq.js → date-range-picker-TpmECKRh.js} +197 -196
  12. package/dist/_chunks/{date-time-picker-3I2vVKGV.js → date-time-picker-DijEae25.js} +2 -2
  13. package/dist/_chunks/{due-date-calculator-BF_Ikofx.js → due-date-calculator-BtgWeFqp.js} +4 -4
  14. package/dist/_chunks/{file-manager-Bsc8-MQQ.js → file-manager-BdXjZNIc.js} +2 -2
  15. package/dist/_chunks/{gestational-age-calculator-CiOQjzgx.js → gestational-age-calculator-KdMg9z9H.js} +5 -5
  16. package/dist/_chunks/{hcg-doubling-CpU7H5rQ.js → hcg-doubling-C2fQxfXd.js} +3 -3
  17. package/dist/_chunks/{link-cell-renderer-B-xrUPew.js → link-cell-renderer-tWEOv3Sc.js} +6 -4
  18. package/dist/_chunks/{parse-MN9bGkrY.js → parse-DPqj4JtD.js} +2 -2
  19. package/dist/_chunks/{patient-details-1QDA-XOO.js → patient-details-DYAmq76G.js} +2 -2
  20. package/dist/_chunks/{pregnancy-dating-D2wchD11.js → pregnancy-dating-m-c05DOI.js} +5 -5
  21. package/dist/_chunks/{radiograph-panel.agent-C3trfWqB.js → radiograph-panel.agent-ByM9M3qm.js} +3 -3
  22. package/dist/_chunks/subDays-HPvBuvq3.js +8 -0
  23. package/dist/agent-catalog.json +1 -1
  24. package/dist/components/appointment-timeline/index.js +1 -1
  25. package/dist/components/booking/index.js +1 -1
  26. package/dist/components/cycle-calculator/index.js +1 -1
  27. package/dist/components/data-table/index.js +2 -2
  28. package/dist/components/date-picker/index.js +1 -1
  29. package/dist/components/date-range-picker/date-range-picker.d.ts +6 -0
  30. package/dist/components/date-range-picker/index.js +1 -1
  31. package/dist/components/date-time-picker/index.js +1 -1
  32. package/dist/components/due-date-calculator/index.js +2 -2
  33. package/dist/components/file-manager/index.js +1 -1
  34. package/dist/components/gestational-age-calculator/index.js +1 -1
  35. package/dist/components/hcg-doubling/index.js +1 -1
  36. package/dist/components/patient-details/index.js +1 -1
  37. package/dist/components/patient-table/columns.d.ts +10 -3
  38. package/dist/components/patient-table/index.js +1 -1
  39. package/dist/components/pregnancy-dating/index.js +1 -1
  40. package/dist/components/radiograph-panel/index.js +1 -1
  41. package/dist/index.js +19 -19
  42. package/dist/patterns/anamnesis/index.js +1 -1
  43. package/dist/patterns/calendar/index.js +1 -1
  44. package/package.json +1 -1
  45. package/dist/_chunks/subDays-BLl3y3pd.js +0 -8
@@ -1,25 +1,25 @@
1
- import { jsx as r, jsxs as c, Fragment as Ct } from "react/jsx-runtime";
2
- import { forwardRef as Et, useState as b, useRef as fe, useId as M, useCallback as We, useEffect as je, useMemo as Mt, useImperativeHandle as Ft, Fragment as Kt } from "react";
3
- import { useTranslation as At } from "react-i18next";
1
+ import { jsx as r, jsxs as c, Fragment as Mt } from "react/jsx-runtime";
2
+ import { forwardRef as Ft, useState as b, useRef as me, useId as M, useCallback as je, useEffect as qe, useMemo as Kt, useImperativeHandle as At, Fragment as Lt } from "react";
3
+ import { useTranslation as $t } from "react-i18next";
4
4
  import * as H from "@radix-ui/react-popover";
5
5
  import * as Q from "@radix-ui/react-radio-group";
6
- import { u as me } from "./use-controllable-state-BiY4xTzM.js";
7
- import { u as Lt } from "./form-field-context-B3APVHKx.js";
8
- import { S as $t } from "./switch-OILsBLWo.js";
9
- import { u as Wt } from "./registry-DvAUVLHh.js";
10
- import { h as jt, j as qt, u as _t, g as Bt, b as zt, k as qe, l as Yt, s as Ut, a as Ht, d as Qt, t as Jt, m as _e, n as Be, r as ze, p as Xt, o as Zt, D as ea, C as ta, q as aa, e as ra, v as J, f as sa, c as ge, i as na } from "./date-picker-variants-DfuooXEK.js";
11
- import { f as k, s as Ye, d as ve, b as Ue, i as oa } from "./format-4HNwNGrN.js";
12
- import { s as F } from "./subDays-BLl3y3pd.js";
13
- import { C as ia } from "./calendar-days-BGWklvE-.js";
14
- import { C as da } from "./check-DrFSN__t.js";
15
- import { p as la } from "./parse-MN9bGkrY.js";
16
- function ca(s, l, g) {
17
- return jt(s, -1, g);
6
+ import { u as ge } from "./use-controllable-state-BiY4xTzM.js";
7
+ import { u as Wt } from "./form-field-context-B3APVHKx.js";
8
+ import { S as jt } from "./switch-OILsBLWo.js";
9
+ import { u as qt } from "./registry-DvAUVLHh.js";
10
+ import { h as _t, j as Bt, u as zt, g as Yt, b as Ut, k as _e, l as Ht, s as Qt, a as Jt, d as Xt, t as Zt, m as Be, n as ze, r as Ye, p as ea, o as ta, D as aa, C as ra, q as sa, e as na, v as J, f as oa, c as ve, i as ia } from "./date-picker-variants-B9NLAfUK.js";
11
+ import { f as k, s as Ue, d as ye, b as He, i as da } from "./format-4HNwNGrN.js";
12
+ import { s as F } from "./subDays-HPvBuvq3.js";
13
+ import { C as la } from "./calendar-days-BGWklvE-.js";
14
+ import { C as ca } from "./check-DrFSN__t.js";
15
+ import { p as ua } from "./parse-DPqj4JtD.js";
16
+ function pa(s, l, g) {
17
+ return _t(s, -1, g);
18
18
  }
19
- function He(s, l, g) {
20
- return qt(s, -1, g);
19
+ function Qe(s, l, g) {
20
+ return Bt(s, -1, g);
21
21
  }
22
- const ua = {
22
+ const fa = {
23
23
  id: "date-range-picker",
24
24
  capabilities: [
25
25
  "range_pick",
@@ -211,15 +211,15 @@ const ua = {
211
211
  description: "Sourced from the id prop."
212
212
  }
213
213
  }
214
- }, Qe = [
214
+ }, Je = [
215
215
  { value: "day", fallback: "Day" },
216
216
  { value: "week", fallback: "Week" },
217
217
  { value: "month", fallback: "Month" },
218
218
  { value: "quarter", fallback: "Quarter" }
219
- ], pa = [
219
+ ], ma = [
220
220
  { value: "previous", fallback: "Previous period" },
221
221
  { value: "lastYear", fallback: "Same period last year" }
222
- ], fa = Et(
222
+ ], ga = Ft(
223
223
  ({
224
224
  value: s,
225
225
  defaultValue: l,
@@ -227,63 +227,64 @@ const ua = {
227
227
  commitMode: p = "auto",
228
228
  onApply: w,
229
229
  onCancel: I,
230
- showClear: Je = !0,
231
- numberOfMonths: Xe = 2,
232
- granularity: ye,
233
- defaultGranularity: he,
234
- onGranularityChange: Ze,
235
- allowedGranularities: X,
230
+ showClear: Xe = !0,
231
+ numberOfMonths: Ze,
232
+ compact: X = !1,
233
+ granularity: he,
234
+ defaultGranularity: be,
235
+ onGranularityChange: et,
236
+ allowedGranularities: Z,
236
237
  compare: j = !1,
237
- compareEnabled: et,
238
- defaultCompare: tt = !1,
239
- defaultCompareMode: at = "previous",
238
+ compareEnabled: tt,
239
+ defaultCompare: at = !1,
240
+ defaultCompareMode: rt = "previous",
240
241
  onCompareChange: f,
241
242
  weekStartsOn: K,
242
- minDate: Z,
243
- maxDate: ee,
244
- presets: te,
245
- mergePresets: rt = !1,
246
- size: be = "md",
247
- chrome: st = "input",
248
- disabled: nt,
249
- placeholder: ot,
250
- className: it,
251
- id: dt
252
- }, lt) => {
253
- const { t: n, i18n: ke } = At(), A = Lt(), ae = dt ?? A.id, Re = A.disabled || nt, ct = A.invalid ? "error" : "default", u = _t(ke.language), m = Bt(ke.language), ut = ot ?? n("inputs.dateRangePicker.placeholder", "Select date range"), [pt, xe] = me({
243
+ minDate: ee,
244
+ maxDate: te,
245
+ presets: ae,
246
+ mergePresets: st = !1,
247
+ size: ke = "md",
248
+ chrome: nt = "input",
249
+ disabled: ot,
250
+ placeholder: it,
251
+ className: dt,
252
+ id: lt
253
+ }, ct) => {
254
+ const { t: n, i18n: Re } = $t(), A = Wt(), re = lt ?? A.id, xe = A.disabled || ot, ut = A.invalid ? "error" : "default", u = zt(Re.language), m = Yt(Re.language), pt = it ?? n("inputs.dateRangePicker.placeholder", "Select date range"), [ft, Pe] = ge({
254
255
  value: s,
255
256
  defaultValue: l ?? {},
256
257
  onChange: g
257
- }), i = pt ?? {}, [O, R] = b(!1), [a, T] = b(i), [ft, re] = b(i.from ?? /* @__PURE__ */ new Date()), [Pe, Ne] = b(""), [De, Se] = b(""), [G, L] = b(!1), [V, $] = b(!1), q = ye !== void 0 || he !== void 0, _ = X && X.length > 0 ? X : void 0, we = _ ? Qe.filter(
258
+ }), i = ft ?? {}, [O, R] = b(!1), [a, T] = b(i), [mt, se] = b(i.from ?? /* @__PURE__ */ new Date()), [Ne, De] = b(""), [Se, we] = b(""), [G, L] = b(!1), [V, $] = b(!1), q = he !== void 0 || be !== void 0, _ = Z && Z.length > 0 ? Z : void 0, Ie = _ ? Je.filter(
258
259
  (e) => _.includes(e.value)
259
- ) : Qe, W = (e) => {
260
+ ) : Je, W = (e) => {
260
261
  var t;
261
- return !_ || _.includes(e) ? e : ((t = we[0]) == null ? void 0 : t.value) ?? e;
262
- }, [mt, se] = me({
263
- value: ye,
264
- defaultValue: W(he ?? "day"),
265
- onChange: Ze
266
- }), B = W(mt ?? "day"), [C, z] = me({
267
- value: et,
268
- defaultValue: tt
262
+ return !_ || _.includes(e) ? e : ((t = Ie[0]) == null ? void 0 : t.value) ?? e;
263
+ }, [gt, ne] = ge({
264
+ value: he,
265
+ defaultValue: W(be ?? "day"),
266
+ onChange: et
267
+ }), B = W(gt ?? "day"), [C, z] = ge({
268
+ value: tt,
269
+ defaultValue: at
269
270
  // onCompareChange needs the resolved range as its 2nd arg, so it is
270
271
  // called manually at the commit points rather than wired here.
271
272
  }), [N, E] = b(
272
273
  C ?? !1
273
- ), [Ie, gt] = b(at), vt = fe(null), D = fe(!1), Oe = M(), Te = M(), Ge = M(), Ve = M(), ne = M(), yt = M(), x = We(
274
+ ), [Oe, vt] = b(rt), yt = me(null), D = me(!1), ht = Ze ?? (X ? 1 : 2), Te = M(), Ge = M(), Ve = M(), Ce = M(), oe = M(), bt = M(), x = je(
274
275
  (e) => {
275
- xe(e);
276
+ Pe(e);
276
277
  },
277
- [xe]
278
- ), ht = zt(Z, ee), bt = (e) => (Z ? na(e, Z) : !1) || (ee ? ge(e, ee) : !1);
279
- je(() => {
278
+ [Pe]
279
+ ), kt = Ut(ee, te), Rt = (e) => (ee ? ia(e, ee) : !1) || (te ? ve(e, te) : !1);
280
+ qe(() => {
280
281
  O && (T(i), E(C ?? !1), L(!1), $(!1), D.current = !1);
281
- }, [O]), je(() => {
282
- G || Ne(
282
+ }, [O]), qe(() => {
283
+ G || De(
283
284
  a.from ? k(a.from, m, { locale: u }) : ""
284
- ), V || Se(a.to ? k(a.to, m, { locale: u }) : "");
285
+ ), V || we(a.to ? k(a.to, m, { locale: u }) : "");
285
286
  }, [a.from, a.to, m, u]);
286
- const Ce = [
287
+ const Ee = [
287
288
  {
288
289
  label: n("inputs.dateRangePicker.presets.today", "Today"),
289
290
  range: () => {
@@ -310,25 +311,25 @@ const ua = {
310
311
  range: () => ({
311
312
  // `weekStartsOn` (when set) overrides the locale's first day; when
312
313
  // undefined date-fns falls back to the locale.
313
- from: Ye(/* @__PURE__ */ new Date(), { locale: u, weekStartsOn: K }),
314
- to: qe(/* @__PURE__ */ new Date(), { locale: u, weekStartsOn: K })
314
+ from: Ue(/* @__PURE__ */ new Date(), { locale: u, weekStartsOn: K }),
315
+ to: _e(/* @__PURE__ */ new Date(), { locale: u, weekStartsOn: K })
315
316
  })
316
317
  },
317
318
  {
318
319
  label: n("inputs.dateRangePicker.presets.lastWeek", "Last week"),
319
320
  range: () => {
320
- const e = ca(/* @__PURE__ */ new Date());
321
+ const e = pa(/* @__PURE__ */ new Date());
321
322
  return {
322
- from: Ye(e, { locale: u, weekStartsOn: K }),
323
- to: qe(e, { locale: u, weekStartsOn: K })
323
+ from: Ue(e, { locale: u, weekStartsOn: K }),
324
+ to: _e(e, { locale: u, weekStartsOn: K })
324
325
  };
325
326
  }
326
327
  },
327
328
  {
328
329
  label: n("inputs.dateRangePicker.presets.thisMonth", "This month"),
329
330
  range: () => ({
330
- from: Ut(/* @__PURE__ */ new Date()),
331
- to: Yt(/* @__PURE__ */ new Date())
331
+ from: Qt(/* @__PURE__ */ new Date()),
332
+ to: Ht(/* @__PURE__ */ new Date())
332
333
  })
333
334
  },
334
335
  {
@@ -338,102 +339,102 @@ const ua = {
338
339
  to: /* @__PURE__ */ new Date()
339
340
  })
340
341
  }
341
- ], oe = te ? rt ? [...Ce, ...te] : te : Ce, Ee = (() => {
342
+ ], ie = ae ? st ? [...Ee, ...ae] : ae : Ee, Me = (() => {
342
343
  const e = [], t = /* @__PURE__ */ new Map();
343
- for (const d of oe) {
344
+ for (const d of ie) {
344
345
  const o = d.group ?? "";
345
346
  t.has(o) || (t.set(o, []), e.push(o)), t.get(o).push(d);
346
347
  }
347
348
  return e.map((d) => ({ group: d, presets: t.get(d) }));
348
- })(), kt = Ee.some((e) => e.group !== ""), y = (e, t = Ie) => {
349
+ })(), xt = Me.some((e) => e.group !== ""), y = (e, t = Oe) => {
349
350
  if (!e.from || !e.to) return;
350
351
  if (t === "lastYear")
351
- return { from: He(e.from), to: He(e.to) };
352
- const d = ve(e.to, e.from), o = F(e.from, 1);
352
+ return { from: Qe(e.from), to: Qe(e.to) };
353
+ const d = ye(e.to, e.from), o = F(e.from, 1);
353
354
  return { from: F(o, d), to: o };
354
- }, Y = j && N, Me = j && (C ?? !1), h = Y ? y(a) : void 0, Rt = (() => {
355
+ }, Y = j && N, Fe = j && (C ?? !1), h = Y ? y(a) : void 0, Pt = (() => {
355
356
  if (!(h != null && h.from) || !h.to) return;
356
357
  const e = h.from, t = h.to, d = {
357
358
  compareStart: e,
358
359
  compareEnd: t
359
360
  };
360
- return ve(t, e) >= 2 && (d.compareMiddle = { from: Ht(e, 1), to: F(t, 1) }), d;
361
- })(), Fe = (e) => {
361
+ return ye(t, e) >= 2 && (d.compareMiddle = { from: Jt(e, 1), to: F(t, 1) }), d;
362
+ })(), Ke = (e) => {
362
363
  const t = {};
363
364
  return q && (t.granularity = B), Y && (t.compareRange = y(e)), t.granularity || t.compareRange ? t : void 0;
364
- }, xt = (e) => {
365
+ }, Nt = (e) => {
365
366
  const t = e;
366
- gt(t), Y && p === "auto" && (f == null || f(!0, y(a, t)));
367
- }, Pt = (e) => {
367
+ vt(t), Y && p === "auto" && (f == null || f(!0, y(a, t)));
368
+ }, Dt = (e) => {
368
369
  E(e), p === "auto" && (z(e), f == null || f(e, e ? y(a) : void 0));
369
- }, ie = We(
370
+ }, de = je(
370
371
  (e) => {
371
372
  T(e), p === "auto" && e.from && e.to && x(e);
372
373
  },
373
374
  [p, x]
374
- ), Nt = (e) => {
375
- L(!1), $(!1), ie({ from: e == null ? void 0 : e.from, to: e == null ? void 0 : e.to });
376
- }, Dt = (e) => {
375
+ ), St = (e) => {
376
+ L(!1), $(!1), de({ from: e == null ? void 0 : e.from, to: e == null ? void 0 : e.to });
377
+ }, wt = (e) => {
377
378
  const t = e.range();
378
- L(!1), $(!1), T(t), re(t.from), p === "auto" && (x(t), w == null || w(t, Fe(t)), D.current = !0, R(!1));
379
- }, de = (e, t) => {
379
+ L(!1), $(!1), T(t), se(t.from), p === "auto" && (x(t), w == null || w(t, Ke(t)), D.current = !0, R(!1));
380
+ }, le = (e, t) => {
380
381
  const d = e === "from" ? L : $;
381
382
  if (t.trim() === "") {
382
- d(!1), ie(
383
+ d(!1), de(
383
384
  e === "from" ? { from: void 0, to: a.to } : { from: a.from, to: void 0 }
384
385
  );
385
386
  return;
386
387
  }
387
- const o = la(t, m, /* @__PURE__ */ new Date(), { locale: u });
388
- if (!oa(o) || bt(o)) {
388
+ const o = ua(t, m, /* @__PURE__ */ new Date(), { locale: u });
389
+ if (!da(o) || Rt(o)) {
389
390
  d(!0);
390
391
  return;
391
392
  }
392
393
  d(!1);
393
394
  let P;
394
- e === "from" ? P = a.to && ge(o, a.to) ? { from: o, to: void 0 } : { from: o, to: a.to } : P = a.from && ge(a.from, o) ? { from: o, to: void 0 } : { from: a.from, to: o }, re(o), ie(P);
395
- }, Ke = (e) => (t) => {
396
- t.key === "Enter" && (t.preventDefault(), de(e, e === "from" ? Pe : De));
397
- }, St = () => {
395
+ e === "from" ? P = a.to && ve(o, a.to) ? { from: o, to: void 0 } : { from: o, to: a.to } : P = a.from && ve(a.from, o) ? { from: o, to: void 0 } : { from: a.from, to: o }, se(o), de(P);
396
+ }, Ae = (e) => (t) => {
397
+ t.key === "Enter" && (t.preventDefault(), le(e, e === "from" ? Ne : Se));
398
+ }, It = () => {
398
399
  T({}), L(!1), $(!1), p === "auto" && x({});
399
- }, wt = !!(a.from && a.to), It = !a.from && !a.to, Ae = (wt || It) && !G && !V, le = () => {
400
- Ae && (x(a), j && N !== (C ?? !1) && (z(N), f == null || f(
400
+ }, Ot = !!(a.from && a.to), Tt = !a.from && !a.to, Le = (Ot || Tt) && !G && !V, ce = () => {
401
+ Le && (x(a), j && N !== (C ?? !1) && (z(N), f == null || f(
401
402
  N,
402
403
  N ? y(a) : void 0
403
- )), w == null || w(a, Fe(a))), D.current = !0, R(!1);
404
- }, Ot = () => {
404
+ )), w == null || w(a, Ke(a))), D.current = !0, R(!1);
405
+ }, Gt = () => {
405
406
  D.current = !0, R(!1);
406
- }, ce = () => {
407
+ }, ue = () => {
407
408
  p === "apply" && (I == null || I()), T(i), E(C ?? !1), R(!1);
408
- }, Tt = (e) => {
409
+ }, Vt = (e) => {
409
410
  if (e) {
410
411
  D.current = !1, R(!0);
411
412
  return;
412
413
  }
413
414
  p === "apply" && !D.current && (I == null || I()), T(i), E(C ?? !1), D.current = !1, R(!1);
414
- }, Gt = (e) => {
415
+ }, Ct = (e) => {
415
416
  if (!i.from || !i.to) return !1;
416
417
  const t = e.range();
417
- return Ue(t.from, i.from) && Ue(t.to, i.to);
418
- }, S = oe.find(Gt), Le = (() => {
418
+ return He(t.from, i.from) && He(t.to, i.to);
419
+ }, S = ie.find(Ct), $e = (() => {
419
420
  if (i.from && i.to) {
420
421
  const e = k(i.from, m, { locale: u }), t = k(i.to, m, { locale: u });
421
422
  return `${e} – ${t}`;
422
423
  }
423
424
  return i.from ? k(i.from, m, { locale: u }) : "";
424
- })(), U = a.from ? a.to ? null : "end" : "start", Vt = (() => {
425
+ })(), U = a.from ? a.to ? null : "end" : "start", Et = (() => {
425
426
  if (!a.from)
426
427
  return n("inputs.dateRangePicker.selectStart", "Select start date");
427
428
  if (!a.to)
428
429
  return n("inputs.dateRangePicker.selectEnd", "Select end date");
429
- const e = ve(a.to, a.from) + 1, t = k(a.from, m, { locale: u }), d = k(a.to, m, { locale: u }), o = n("inputs.dateRangePicker.days", { count: e });
430
+ const e = ye(a.to, a.from) + 1, t = k(a.from, m, { locale: u }), d = k(a.to, m, { locale: u }), o = n("inputs.dateRangePicker.days", { count: e });
430
431
  return `${t} – ${d} · ${o}`;
431
- })(), v = fe({
432
+ })(), v = me({
432
433
  currentValue: i,
433
434
  open: O,
434
435
  getGranularity: () => q ? B : void 0,
435
- setGranularity: (e) => se(W(e)),
436
- getCompareRange: () => Me ? y(i) : void 0,
436
+ setGranularity: (e) => ne(W(e)),
437
+ getCompareRange: () => Fe ? y(i) : void 0,
437
438
  // Imperative/agent path commits directly (like setRange/clear), so
438
439
  // toggle_compare reflects in getCompareRange immediately — not a draft.
439
440
  setCompare: (e) => {
@@ -444,15 +445,15 @@ const ua = {
444
445
  },
445
446
  getActivePreset: () => S == null ? void 0 : S.label,
446
447
  getActiveEnd: () => U,
447
- apply: () => le(),
448
- cancel: () => ce()
448
+ apply: () => ce(),
449
+ cancel: () => ue()
449
450
  });
450
451
  v.current = {
451
452
  currentValue: i,
452
453
  open: O,
453
454
  getGranularity: () => q ? B : void 0,
454
- setGranularity: (e) => se(W(e)),
455
- getCompareRange: () => Me ? y(i) : void 0,
455
+ setGranularity: (e) => ne(W(e)),
456
+ getCompareRange: () => Fe ? y(i) : void 0,
456
457
  setCompare: (e) => {
457
458
  E(e), z(e), f == null || f(
458
459
  e,
@@ -461,10 +462,10 @@ const ua = {
461
462
  },
462
463
  getActivePreset: () => S == null ? void 0 : S.label,
463
464
  getActiveEnd: () => U,
464
- apply: () => le(),
465
- cancel: () => ce()
465
+ apply: () => ce(),
466
+ cancel: () => ue()
466
467
  };
467
- const ue = Mt(
468
+ const pe = Kt(
468
469
  () => ({
469
470
  getRange: () => v.current.currentValue,
470
471
  setRange: (e) => x(e),
@@ -483,27 +484,27 @@ const ua = {
483
484
  }),
484
485
  [x]
485
486
  );
486
- Ft(lt, () => ue, [ue]), Wt(ua, ue, ae);
487
- const $e = (e) => e === "from" ? G ? "error" : U === "start" ? "active" : "default" : V ? "error" : U === "end" ? "active" : "default";
488
- return /* @__PURE__ */ r(H.Root, { open: O, onOpenChange: Tt, children: /* @__PURE__ */ c(
487
+ At(ct, () => pe, [pe]), qt(fa, pe, re);
488
+ const We = (e) => e === "from" ? G ? "error" : U === "start" ? "active" : "default" : V ? "error" : U === "end" ? "active" : "default";
489
+ return /* @__PURE__ */ r(H.Root, { open: O, onOpenChange: Vt, children: /* @__PURE__ */ c(
489
490
  "div",
490
491
  {
491
- className: it,
492
+ className: dt,
492
493
  "data-component": "date-range-picker",
493
- "data-component-id": ae,
494
+ "data-component-id": re,
494
495
  children: [
495
- /* @__PURE__ */ r(H.Trigger, { asChild: !0, disabled: Re, children: /* @__PURE__ */ c(
496
+ /* @__PURE__ */ r(H.Trigger, { asChild: !0, disabled: xe, children: /* @__PURE__ */ c(
496
497
  "button",
497
498
  {
498
- ref: vt,
499
- id: ae,
499
+ ref: yt,
500
+ id: re,
500
501
  type: "button",
501
- disabled: Re,
502
+ disabled: xe,
502
503
  "aria-describedby": A.describedBy || void 0,
503
504
  "aria-invalid": A.invalid || void 0,
504
505
  "aria-haspopup": "dialog",
505
506
  "aria-expanded": O,
506
- className: Jt({ size: be, tone: ct, chrome: st }),
507
+ className: Zt({ size: ke, tone: ut, chrome: nt }),
507
508
  children: [
508
509
  /* @__PURE__ */ r(
509
510
  "span",
@@ -515,17 +516,17 @@ const ua = {
515
516
  // lets the flex child shrink below its content width so
516
517
  // `truncate` engages.
517
518
  "ds:min-w-0 ds:flex-1 ds:truncate ds:text-start",
518
- Le ? "ds:text-foreground" : "ds:text-muted-foreground"
519
+ $e ? "ds:text-foreground" : "ds:text-muted-foreground"
519
520
  ].join(" "),
520
- children: Le || ut
521
+ children: $e || pt
521
522
  }
522
523
  ),
523
524
  /* @__PURE__ */ r(
524
525
  "span",
525
526
  {
526
527
  "aria-hidden": "true",
527
- className: Qt({ size: be }),
528
- children: /* @__PURE__ */ r(ia, {})
528
+ className: Xt({ size: ke }),
529
+ children: /* @__PURE__ */ r(la, {})
529
530
  }
530
531
  )
531
532
  ]
@@ -542,15 +543,15 @@ const ua = {
542
543
  "Select date range"
543
544
  ),
544
545
  "data-component": "date-range-picker-content",
545
- className: sa(),
546
+ className: oa(),
546
547
  children: /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
547
548
  /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
548
549
  /* @__PURE__ */ c("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
549
550
  /* @__PURE__ */ r(
550
551
  "h2",
551
552
  {
552
- id: Oe,
553
- className: "type-body-sm ds:font-semibold ds:text-foreground",
553
+ id: Te,
554
+ className: X ? "ds:sr-only" : "type-body-sm ds:font-semibold ds:text-foreground",
554
555
  children: n("inputs.dateRangePicker.title", "Select date range")
555
556
  }
556
557
  ),
@@ -558,19 +559,19 @@ const ua = {
558
559
  Q.Root,
559
560
  {
560
561
  value: B,
561
- onValueChange: (e) => se(
562
+ onValueChange: (e) => ne(
562
563
  W(e)
563
564
  ),
564
565
  "aria-label": n(
565
566
  "inputs.dateRangePicker.granularityLabel",
566
567
  "Granularity"
567
568
  ),
568
- className: Be(),
569
- children: we.map((e) => /* @__PURE__ */ r(
569
+ className: ze(),
570
+ children: Ie.map((e) => /* @__PURE__ */ r(
570
571
  Q.Item,
571
572
  {
572
573
  value: e.value,
573
- className: _e(),
574
+ className: Be(),
574
575
  children: n(
575
576
  `inputs.dateRangePicker.granularity.${e.value}`,
576
577
  e.fallback
@@ -586,7 +587,7 @@ const ua = {
586
587
  /* @__PURE__ */ r(
587
588
  "label",
588
589
  {
589
- htmlFor: Te,
590
+ htmlFor: Ge,
590
591
  className: "ds:text-[length:var(--font-size-xs)] ds:text-muted-foreground",
591
592
  children: n("inputs.dateRangePicker.startLabel", "Start date")
592
593
  }
@@ -594,18 +595,18 @@ const ua = {
594
595
  /* @__PURE__ */ r(
595
596
  "input",
596
597
  {
597
- id: Te,
598
+ id: Ge,
598
599
  type: "text",
599
600
  inputMode: "numeric",
600
- value: Pe,
601
+ value: Ne,
601
602
  placeholder: m.toUpperCase(),
602
603
  "aria-invalid": G || void 0,
603
- "aria-describedby": G ? ne : void 0,
604
- onChange: (e) => Ne(e.target.value),
605
- onBlur: (e) => de("from", e.target.value),
606
- onKeyDown: Ke("from"),
607
- className: ze({
608
- state: $e("from")
604
+ "aria-describedby": G ? oe : void 0,
605
+ onChange: (e) => De(e.target.value),
606
+ onBlur: (e) => le("from", e.target.value),
607
+ onKeyDown: Ae("from"),
608
+ className: Ye({
609
+ state: We("from")
609
610
  })
610
611
  }
611
612
  )
@@ -622,7 +623,7 @@ const ua = {
622
623
  /* @__PURE__ */ r(
623
624
  "label",
624
625
  {
625
- htmlFor: Ge,
626
+ htmlFor: Ve,
626
627
  className: "ds:text-[length:var(--font-size-xs)] ds:text-muted-foreground",
627
628
  children: n("inputs.dateRangePicker.endLabel", "End date")
628
629
  }
@@ -630,18 +631,18 @@ const ua = {
630
631
  /* @__PURE__ */ r(
631
632
  "input",
632
633
  {
633
- id: Ge,
634
+ id: Ve,
634
635
  type: "text",
635
636
  inputMode: "numeric",
636
- value: De,
637
+ value: Se,
637
638
  placeholder: m.toUpperCase(),
638
639
  "aria-invalid": V || void 0,
639
- "aria-describedby": V ? ne : void 0,
640
- onChange: (e) => Se(e.target.value),
641
- onBlur: (e) => de("to", e.target.value),
642
- onKeyDown: Ke("to"),
643
- className: ze({
644
- state: $e("to")
640
+ "aria-describedby": V ? oe : void 0,
641
+ onChange: (e) => we(e.target.value),
642
+ onBlur: (e) => le("to", e.target.value),
643
+ onKeyDown: Ae("to"),
644
+ className: Ye({
645
+ state: We("to")
645
646
  })
646
647
  }
647
648
  )
@@ -650,7 +651,7 @@ const ua = {
650
651
  G || V ? /* @__PURE__ */ r(
651
652
  "p",
652
653
  {
653
- id: ne,
654
+ id: oe,
654
655
  role: "alert",
655
656
  className: "ds:text-[length:var(--font-size-xs)] ds:text-destructive",
656
657
  children: n(
@@ -664,20 +665,20 @@ const ua = {
664
665
  ) : null
665
666
  ] }),
666
667
  /* @__PURE__ */ c("div", { className: "ds:flex ds:gap-[var(--spacing-md)]", children: [
667
- oe.length > 0 ? /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:min-w-[8rem] ds:border-e ds:border-border ds:pe-[var(--spacing-md)]", children: Ee.map((e, t) => {
668
- const d = `${Oe}-pg${t}`, o = e.presets.map((P) => {
669
- const pe = P === S;
668
+ !X && ie.length > 0 ? /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:min-w-[8rem] ds:border-e ds:border-border ds:pe-[var(--spacing-md)]", children: Me.map((e, t) => {
669
+ const d = `${Te}-pg${t}`, o = e.presets.map((P) => {
670
+ const fe = P === S;
670
671
  return /* @__PURE__ */ c(
671
672
  "button",
672
673
  {
673
674
  type: "button",
674
- "aria-pressed": pe,
675
- onClick: () => Dt(P),
676
- className: Xt({ active: pe }),
675
+ "aria-pressed": fe,
676
+ onClick: () => wt(P),
677
+ className: ea({ active: fe }),
677
678
  children: [
678
679
  /* @__PURE__ */ r("span", { className: "ds:min-w-0 ds:truncate", children: P.label }),
679
- pe ? /* @__PURE__ */ r(
680
- da,
680
+ fe ? /* @__PURE__ */ r(
681
+ ca,
681
682
  {
682
683
  "aria-hidden": "true",
683
684
  className: "ds:size-4 ds:shrink-0 ds:text-primary"
@@ -688,7 +689,7 @@ const ua = {
688
689
  P.label
689
690
  );
690
691
  });
691
- return kt && e.group ? /* @__PURE__ */ c(
692
+ return xt && e.group ? /* @__PURE__ */ c(
692
693
  "div",
693
694
  {
694
695
  role: "group",
@@ -699,7 +700,7 @@ const ua = {
699
700
  "div",
700
701
  {
701
702
  id: d,
702
- className: Zt(),
703
+ className: ta(),
703
704
  children: e.group
704
705
  }
705
706
  ),
@@ -707,45 +708,45 @@ const ua = {
707
708
  ]
708
709
  },
709
710
  e.group
710
- ) : /* @__PURE__ */ r(Kt, { children: o }, e.group || "_ungrouped");
711
+ ) : /* @__PURE__ */ r(Lt, { children: o }, e.group || "_ungrouped");
711
712
  }) }) : null,
712
- /* @__PURE__ */ c("div", { role: "region", "aria-labelledby": Ve, children: [
713
- /* @__PURE__ */ r("span", { id: Ve, className: "ds:sr-only", children: n("inputs.dateRangePicker.gridLabel", "Calendar") }),
713
+ /* @__PURE__ */ c("div", { role: "region", "aria-labelledby": Ce, children: [
714
+ /* @__PURE__ */ r("span", { id: Ce, className: "ds:sr-only", children: n("inputs.dateRangePicker.gridLabel", "Calendar") }),
714
715
  /* @__PURE__ */ r(
715
- ea,
716
+ aa,
716
717
  {
717
718
  mode: "range",
718
719
  selected: a.from ? { from: a.from, to: a.to } : void 0,
719
- onSelect: Nt,
720
- month: ft,
721
- onMonthChange: re,
722
- numberOfMonths: Xe,
720
+ onSelect: St,
721
+ month: mt,
722
+ onMonthChange: se,
723
+ numberOfMonths: ht,
723
724
  weekStartsOn: K,
724
- disabled: ht,
725
+ disabled: kt,
725
726
  locale: u,
726
727
  showOutsideDays: !0,
727
728
  fixedWeeks: !0,
728
729
  pagedNavigation: !0,
729
- classNames: ra,
730
- modifiers: Rt,
731
- modifiersClassNames: aa,
732
- components: { Chevron: ta }
730
+ classNames: na,
731
+ modifiers: Pt,
732
+ modifiersClassNames: sa,
733
+ components: { Chevron: ra }
733
734
  }
734
735
  )
735
736
  ] })
736
737
  ] }),
737
738
  j ? /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)] ds:border-t ds:border-border ds:pt-[var(--spacing-sm)]", children: [
738
739
  /* @__PURE__ */ r(
739
- $t,
740
+ jt,
740
741
  {
741
- id: yt,
742
+ id: bt,
742
743
  label: n(
743
744
  "inputs.dateRangePicker.compareLabel",
744
745
  "Compare to previous period"
745
746
  ),
746
747
  size: "sm",
747
748
  checked: N,
748
- onCheckedChange: Pt
749
+ onCheckedChange: Dt
749
750
  }
750
751
  ),
751
752
  Y && h ? /* @__PURE__ */ c("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[length:var(--font-size-xs)] ds:text-muted-foreground", children: [
@@ -761,18 +762,18 @@ const ua = {
761
762
  N ? /* @__PURE__ */ r(
762
763
  Q.Root,
763
764
  {
764
- value: Ie,
765
- onValueChange: xt,
765
+ value: Oe,
766
+ onValueChange: Nt,
766
767
  "aria-label": n(
767
768
  "inputs.dateRangePicker.compareModeLabel",
768
769
  "Comparison period"
769
770
  ),
770
- className: `${Be()} ds:ms-auto`,
771
- children: pa.map((e) => /* @__PURE__ */ r(
771
+ className: `${ze()} ds:ms-auto`,
772
+ children: ma.map((e) => /* @__PURE__ */ r(
772
773
  Q.Item,
773
774
  {
774
775
  value: e.value,
775
- className: _e(),
776
+ className: Be(),
776
777
  children: n(
777
778
  `inputs.dateRangePicker.compareMode.${e.value}`,
778
779
  e.fallback
@@ -790,25 +791,25 @@ const ua = {
790
791
  role: "status",
791
792
  "aria-live": "polite",
792
793
  className: "type-body-sm ds:min-w-0 ds:truncate ds:text-muted-foreground",
793
- children: Vt
794
+ children: Et
794
795
  }
795
796
  ),
796
797
  /* @__PURE__ */ c("div", { className: "ds:flex ds:shrink-0 ds:gap-[var(--spacing-xs)]", children: [
797
- Je ? /* @__PURE__ */ r(
798
+ Xe ? /* @__PURE__ */ r(
798
799
  "button",
799
800
  {
800
801
  type: "button",
801
- onClick: St,
802
+ onClick: It,
802
803
  className: J({ intent: "ghost" }),
803
804
  children: n("inputs.dateRangePicker.clear", "Clear")
804
805
  }
805
806
  ) : null,
806
- p === "apply" ? /* @__PURE__ */ c(Ct, { children: [
807
+ p === "apply" ? /* @__PURE__ */ c(Mt, { children: [
807
808
  /* @__PURE__ */ r(
808
809
  "button",
809
810
  {
810
811
  type: "button",
811
- onClick: ce,
812
+ onClick: ue,
812
813
  className: J({ intent: "ghost" }),
813
814
  children: n("inputs.dateRangePicker.cancel", "Cancel")
814
815
  }
@@ -817,8 +818,8 @@ const ua = {
817
818
  "button",
818
819
  {
819
820
  type: "button",
820
- disabled: !Ae,
821
- onClick: le,
821
+ disabled: !Le,
822
+ onClick: ce,
822
823
  className: J({ intent: "primary" }),
823
824
  children: n("inputs.dateRangePicker.apply", "Apply")
824
825
  }
@@ -827,7 +828,7 @@ const ua = {
827
828
  "button",
828
829
  {
829
830
  type: "button",
830
- onClick: Ot,
831
+ onClick: Gt,
831
832
  className: J({ intent: "primary" }),
832
833
  children: n("inputs.dateRangePicker.done", "Done")
833
834
  }
@@ -842,9 +843,9 @@ const ua = {
842
843
  ) });
843
844
  }
844
845
  );
845
- fa.displayName = "DateRangePicker";
846
+ ga.displayName = "DateRangePicker";
846
847
  export {
847
- fa as D,
848
- ua as d
848
+ ga as D,
849
+ fa as d
849
850
  };
850
- //# sourceMappingURL=date-range-picker-BD8P_rJq.js.map
851
+ //# sourceMappingURL=date-range-picker-TpmECKRh.js.map