@alfadocs/ui-kit-debug 0.93.0 → 0.94.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 (34) hide show
  1. package/dist/_chunks/apexcharts-theme-fAQXLIMW.js +67 -0
  2. package/dist/_chunks/apexcharts-theme-fAQXLIMW.js.map +1 -0
  3. package/dist/_chunks/{chart-CNaLgvx4.js → chart-DqxVCm1I.js} +288 -257
  4. package/dist/_chunks/chart-DqxVCm1I.js.map +1 -0
  5. package/dist/_chunks/{date-range-picker-Cc4DLAL2.js → date-range-picker-Cfv4Sr63.js} +231 -223
  6. package/dist/_chunks/date-range-picker-Cfv4Sr63.js.map +1 -0
  7. package/dist/_chunks/{link-cell-renderer-DQjZeoAr.js → link-cell-renderer-_LDZhY4r.js} +2 -2
  8. package/dist/_chunks/{link-cell-renderer-DQjZeoAr.js.map → link-cell-renderer-_LDZhY4r.js.map} +1 -1
  9. package/dist/_chunks/{patient-table-DU_zFZoq.js → patient-table-CFM92QqU.js} +2 -2
  10. package/dist/_chunks/{patient-table-DU_zFZoq.js.map → patient-table-CFM92QqU.js.map} +1 -1
  11. package/dist/_chunks/{radiograph-panel.agent-rnrQZtK3.js → radiograph-panel.agent-DDnDGVpN.js} +2 -2
  12. package/dist/_chunks/{radiograph-panel.agent-rnrQZtK3.js.map → radiograph-panel.agent-DDnDGVpN.js.map} +1 -1
  13. package/dist/_chunks/{sparkline-iOXYgvJe.js → sparkline-o6JH4O66.js} +2 -2
  14. package/dist/_chunks/{sparkline-iOXYgvJe.js.map → sparkline-o6JH4O66.js.map} +1 -1
  15. package/dist/agent-catalog.json +9 -1
  16. package/dist/components/chart/chart.agent.d.ts.map +1 -1
  17. package/dist/components/chart/chart.d.ts +20 -0
  18. package/dist/components/chart/chart.d.ts.map +1 -1
  19. package/dist/components/chart/index.js +1 -1
  20. package/dist/components/data-table/index.js +1 -1
  21. package/dist/components/date-range-picker/date-range-picker.d.ts +12 -0
  22. package/dist/components/date-range-picker/date-range-picker.d.ts.map +1 -1
  23. package/dist/components/date-range-picker/index.js +1 -1
  24. package/dist/components/patient-table/index.js +1 -1
  25. package/dist/components/radiograph-panel/index.js +1 -1
  26. package/dist/components/sparkline/index.js +1 -1
  27. package/dist/index.js +6 -6
  28. package/dist/tokens/apexcharts-theme.d.ts +36 -1
  29. package/dist/tokens/apexcharts-theme.d.ts.map +1 -1
  30. package/package.json +1 -1
  31. package/dist/_chunks/apexcharts-theme-BJigns_V.js +0 -53
  32. package/dist/_chunks/apexcharts-theme-BJigns_V.js.map +0 -1
  33. package/dist/_chunks/chart-CNaLgvx4.js.map +0 -1
  34. package/dist/_chunks/date-range-picker-Cc4DLAL2.js.map +0 -1
@@ -1,25 +1,25 @@
1
- import { jsx as r, jsxs as c, Fragment as xt } from "react/jsx-runtime";
2
- import { forwardRef as Pt, useState as y, useRef as ie, useId as E, useCallback as Ge, useEffect as Me, useMemo as Nt, useImperativeHandle as Dt, Fragment as Ct } from "react";
3
- import { useTranslation as wt } from "react-i18next";
4
- import * as j from "@radix-ui/react-popover";
5
- import * as q from "@radix-ui/react-radio-group";
6
- import { u as Ve } from "./use-controllable-state-BiY4xTzM.js";
7
- import { u as St } from "./form-field-context-B3APVHKx.js";
8
- import { S as It } from "./switch-OILsBLWo.js";
9
- import { u as Ot } from "./registry-DvAUVLHh.js";
10
- import { l as Tt, m as Et, u as Gt, g as Mt, b as Vt, f as h, n as Fe, s as Ke, o as Ft, q as Kt, k as de, a as Lt, d as $t, t as At, r as Le, v as $e, w as Ae, p as Wt, x as jt, D as qt, C as _t, y as zt, e as Bt, z as _, h as Yt, j as Ut, i as le, c as Ht } from "./date-picker-variants-eL6HjWvw.js";
11
- import { s as G } from "./subDays-BcNi04uf.js";
12
- import { C as Qt } from "./calendar-days-BGWklvE-.js";
13
- import { C as Jt } from "./check-DrFSN__t.js";
14
- import { i as We } from "./isSameDay-DUEiAT0G.js";
15
- import { p as Xt } from "./parse-DvA97ro9.js";
16
- function Zt(s, l, f) {
17
- return Tt(s, -1, f);
1
+ import { jsx as r, jsxs as c, Fragment as wt } from "react/jsx-runtime";
2
+ import { forwardRef as It, useState as y, useRef as ce, useId as G, useCallback as Ke, useEffect as Le, useMemo as Ot, useImperativeHandle as Tt, Fragment as Gt } from "react";
3
+ import { useTranslation as Et } from "react-i18next";
4
+ import * as _ from "@radix-ui/react-popover";
5
+ import * as z from "@radix-ui/react-radio-group";
6
+ import { u as $e } from "./use-controllable-state-BiY4xTzM.js";
7
+ import { u as Mt } from "./form-field-context-B3APVHKx.js";
8
+ import { S as Vt } from "./switch-OILsBLWo.js";
9
+ import { u as Ft } from "./registry-DvAUVLHh.js";
10
+ import { l as Kt, m as Lt, u as $t, g as At, b as Wt, f as h, n as Ae, s as We, o as jt, q as qt, k as ue, a as _t, d as zt, t as Bt, r as je, v as qe, w as _e, p as Yt, x as Ut, D as Ht, C as Qt, y as Jt, e as Xt, z as B, h as Zt, j as ea, i as pe, c as ta } from "./date-picker-variants-eL6HjWvw.js";
11
+ import { s as E } from "./subDays-BcNi04uf.js";
12
+ import { C as aa } from "./calendar-days-BGWklvE-.js";
13
+ import { C as ra } from "./check-DrFSN__t.js";
14
+ import { i as ze } from "./isSameDay-DUEiAT0G.js";
15
+ import { p as sa } from "./parse-DvA97ro9.js";
16
+ function na(s, l, f) {
17
+ return Kt(s, -1, f);
18
18
  }
19
- function je(s, l, f) {
20
- return Et(s, -1, f);
19
+ function Be(s, l, f) {
20
+ return Lt(s, -1, f);
21
21
  }
22
- const ea = {
22
+ const oa = {
23
23
  id: "date-range-picker",
24
24
  capabilities: [
25
25
  "range_pick",
@@ -211,15 +211,15 @@ const ea = {
211
211
  description: "Sourced from the id prop."
212
212
  }
213
213
  }
214
- }, ta = [
214
+ }, Ye = [
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
- ], aa = [
219
+ ], ia = [
220
220
  { value: "previous", fallback: "Previous period" },
221
221
  { value: "lastYear", fallback: "Same period last year" }
222
- ], ra = Pt(
222
+ ], da = It(
223
223
  ({
224
224
  value: s,
225
225
  defaultValue: l,
@@ -227,49 +227,55 @@ const ea = {
227
227
  commitMode: m = "auto",
228
228
  onApply: P,
229
229
  onCancel: N,
230
- showClear: qe = !0,
231
- numberOfMonths: _e = 2,
232
- granularity: ce,
233
- defaultGranularity: ue,
234
- onGranularityChange: ze,
235
- compare: pe = !1,
236
- defaultCompare: Be = !1,
237
- defaultCompareMode: Ye = "previous",
230
+ showClear: Ue = !0,
231
+ numberOfMonths: He = 2,
232
+ granularity: me,
233
+ defaultGranularity: fe,
234
+ onGranularityChange: Qe,
235
+ allowedGranularities: Y,
236
+ compare: ge = !1,
237
+ defaultCompare: Je = !1,
238
+ defaultCompareMode: Xe = "previous",
238
239
  onCompareChange: D,
239
240
  weekStartsOn: M,
240
- minDate: z,
241
- maxDate: B,
242
- presets: Y,
243
- mergePresets: Ue = !1,
244
- size: me = "md",
245
- chrome: He = "input",
246
- disabled: Qe,
247
- placeholder: Je,
248
- className: Xe,
249
- id: Ze
250
- }, et) => {
251
- const { t: n, i18n: fe } = wt(), V = St(), U = Ze ?? V.id, ge = V.disabled || Qe, tt = V.invalid ? "error" : "default", u = Gt(fe.language), p = Mt(fe.language), at = Je ?? n("inputs.dateRangePicker.placeholder", "Select date range"), [rt, ve] = Ve({
241
+ minDate: U,
242
+ maxDate: H,
243
+ presets: Q,
244
+ mergePresets: Ze = !1,
245
+ size: ve = "md",
246
+ chrome: et = "input",
247
+ disabled: tt,
248
+ placeholder: at,
249
+ className: rt,
250
+ id: st
251
+ }, nt) => {
252
+ const { t: n, i18n: ye } = Et(), V = Mt(), J = st ?? V.id, he = V.disabled || tt, ot = V.invalid ? "error" : "default", u = $t(ye.language), p = At(ye.language), it = at ?? n("inputs.dateRangePicker.placeholder", "Select date range"), [dt, be] = $e({
252
253
  value: s,
253
254
  defaultValue: l ?? {},
254
255
  onChange: f
255
- }), i = rt ?? {}, [C, b] = y(!1), [a, w] = y(i), [st, H] = y(i.from ?? /* @__PURE__ */ new Date()), [ye, he] = y(""), [be, ke] = y(""), [S, F] = y(!1), [I, K] = y(!1), L = ce !== void 0 || ue !== void 0, [$, Q] = Ve({
256
- value: ce,
257
- defaultValue: ue ?? "day",
258
- onChange: ze
259
- }), [J, nt] = y(Be), [Re, ot] = y(Ye), it = ie(null), x = ie(!1), xe = E(), Pe = E(), Ne = E(), De = E(), X = E(), dt = E(), k = Ge(
256
+ }), i = dt ?? {}, [C, b] = y(!1), [a, S] = y(i), [lt, X] = y(i.from ?? /* @__PURE__ */ new Date()), [ke, Re] = y(""), [xe, Pe] = y(""), [w, F] = y(!1), [I, K] = y(!1), $ = me !== void 0 || fe !== void 0, A = Y && Y.length > 0 ? Y : void 0, Ne = A ? Ye.filter(
257
+ (e) => A.includes(e.value)
258
+ ) : Ye, L = (e) => {
259
+ var t;
260
+ return !A || A.includes(e) ? e : ((t = Ne[0]) == null ? void 0 : t.value) ?? e;
261
+ }, [ct, Z] = $e({
262
+ value: me,
263
+ defaultValue: L(fe ?? "day"),
264
+ onChange: Qe
265
+ }), W = L(ct ?? "day"), [ee, ut] = y(Je), [De, pt] = y(Xe), mt = ce(null), x = ce(!1), Ce = G(), Se = G(), we = G(), Ie = G(), te = G(), ft = G(), k = Ke(
260
266
  (e) => {
261
- ve(e);
267
+ be(e);
262
268
  },
263
- [ve]
264
- ), lt = Vt(z, B), ct = (e) => (z ? Ht(e, z) : !1) || (B ? le(e, B) : !1);
265
- Me(() => {
266
- C && (w(i), F(!1), K(!1), x.current = !1);
267
- }, [C]), Me(() => {
268
- S || he(
269
+ [be]
270
+ ), gt = Wt(U, H), vt = (e) => (U ? ta(e, U) : !1) || (H ? pe(e, H) : !1);
271
+ Le(() => {
272
+ C && (S(i), F(!1), K(!1), x.current = !1);
273
+ }, [C]), Le(() => {
274
+ w || Re(
269
275
  a.from ? h(a.from, p, { locale: u }) : ""
270
- ), I || ke(a.to ? h(a.to, p, { locale: u }) : "");
276
+ ), I || Pe(a.to ? h(a.to, p, { locale: u }) : "");
271
277
  }, [a.from, a.to, p, u]);
272
- const Ce = [
278
+ const Oe = [
273
279
  {
274
280
  label: n("inputs.dateRangePicker.presets.today", "Today"),
275
281
  range: () => {
@@ -280,14 +286,14 @@ const ea = {
280
286
  {
281
287
  label: n("inputs.dateRangePicker.presets.yesterday", "Yesterday"),
282
288
  range: () => {
283
- const e = G(/* @__PURE__ */ new Date(), 1);
289
+ const e = E(/* @__PURE__ */ new Date(), 1);
284
290
  return { from: e, to: e };
285
291
  }
286
292
  },
287
293
  {
288
294
  label: n("inputs.dateRangePicker.presets.last7", "Last 7 days"),
289
295
  range: () => ({
290
- from: G(/* @__PURE__ */ new Date(), 6),
296
+ from: E(/* @__PURE__ */ new Date(), 6),
291
297
  to: /* @__PURE__ */ new Date()
292
298
  })
293
299
  },
@@ -296,152 +302,152 @@ const ea = {
296
302
  range: () => ({
297
303
  // `weekStartsOn` (when set) overrides the locale's first day; when
298
304
  // undefined date-fns falls back to the locale.
299
- from: Ke(/* @__PURE__ */ new Date(), { locale: u, weekStartsOn: M }),
300
- to: Fe(/* @__PURE__ */ new Date(), { locale: u, weekStartsOn: M })
305
+ from: We(/* @__PURE__ */ new Date(), { locale: u, weekStartsOn: M }),
306
+ to: Ae(/* @__PURE__ */ new Date(), { locale: u, weekStartsOn: M })
301
307
  })
302
308
  },
303
309
  {
304
310
  label: n("inputs.dateRangePicker.presets.lastWeek", "Last week"),
305
311
  range: () => {
306
- const e = Zt(/* @__PURE__ */ new Date());
312
+ const e = na(/* @__PURE__ */ new Date());
307
313
  return {
308
- from: Ke(e, { locale: u, weekStartsOn: M }),
309
- to: Fe(e, { locale: u, weekStartsOn: M })
314
+ from: We(e, { locale: u, weekStartsOn: M }),
315
+ to: Ae(e, { locale: u, weekStartsOn: M })
310
316
  };
311
317
  }
312
318
  },
313
319
  {
314
320
  label: n("inputs.dateRangePicker.presets.thisMonth", "This month"),
315
321
  range: () => ({
316
- from: Kt(/* @__PURE__ */ new Date()),
317
- to: Ft(/* @__PURE__ */ new Date())
322
+ from: qt(/* @__PURE__ */ new Date()),
323
+ to: jt(/* @__PURE__ */ new Date())
318
324
  })
319
325
  },
320
326
  {
321
327
  label: n("inputs.dateRangePicker.presets.last30", "Last 30 days"),
322
328
  range: () => ({
323
- from: G(/* @__PURE__ */ new Date(), 29),
329
+ from: E(/* @__PURE__ */ new Date(), 29),
324
330
  to: /* @__PURE__ */ new Date()
325
331
  })
326
332
  }
327
- ], A = Y ? Ue ? [...Ce, ...Y] : Y : Ce, we = (() => {
333
+ ], j = Q ? Ze ? [...Oe, ...Q] : Q : Oe, Te = (() => {
328
334
  const e = [], t = /* @__PURE__ */ new Map();
329
- for (const d of A) {
335
+ for (const d of j) {
330
336
  const o = d.group ?? "";
331
337
  t.has(o) || (t.set(o, []), e.push(o)), t.get(o).push(d);
332
338
  }
333
339
  return e.map((d) => ({ group: d, presets: t.get(d) }));
334
- })(), ut = we.some((e) => e.group !== ""), O = (e, t = Re) => {
340
+ })(), yt = Te.some((e) => e.group !== ""), O = (e, t = De) => {
335
341
  if (!e.from || !e.to) return;
336
342
  if (t === "lastYear")
337
- return { from: je(e.from), to: je(e.to) };
338
- const d = de(e.to, e.from), o = G(e.from, 1);
339
- return { from: G(o, d), to: o };
340
- }, T = pe && J, v = T ? O(a) : void 0, pt = (() => {
343
+ return { from: Be(e.from), to: Be(e.to) };
344
+ const d = ue(e.to, e.from), o = E(e.from, 1);
345
+ return { from: E(o, d), to: o };
346
+ }, T = ge && ee, v = T ? O(a) : void 0, ht = (() => {
341
347
  if (!(v != null && v.from) || !v.to) return;
342
348
  const e = v.from, t = v.to, d = {
343
349
  compareStart: e,
344
350
  compareEnd: t
345
351
  };
346
- return de(t, e) >= 2 && (d.compareMiddle = { from: Lt(e, 1), to: G(t, 1) }), d;
347
- })(), Se = (e) => {
352
+ return ue(t, e) >= 2 && (d.compareMiddle = { from: _t(e, 1), to: E(t, 1) }), d;
353
+ })(), Ge = (e) => {
348
354
  const t = {};
349
- return L && (t.granularity = $ ?? void 0), T && (t.compareRange = O(e)), t.granularity || t.compareRange ? t : void 0;
350
- }, mt = (e) => {
355
+ return $ && (t.granularity = W), T && (t.compareRange = O(e)), t.granularity || t.compareRange ? t : void 0;
356
+ }, bt = (e) => {
351
357
  const t = e;
352
- ot(t), T && (D == null || D(!0, O(a, t)));
353
- }, Z = (e) => {
354
- nt(e), D == null || D(e, e ? O(a) : void 0);
355
- }, ee = Ge(
358
+ pt(t), T && (D == null || D(!0, O(a, t)));
359
+ }, ae = (e) => {
360
+ ut(e), D == null || D(e, e ? O(a) : void 0);
361
+ }, re = Ke(
356
362
  (e) => {
357
- w(e), m === "auto" && e.from && e.to && k(e);
363
+ S(e), m === "auto" && e.from && e.to && k(e);
358
364
  },
359
365
  [m, k]
360
- ), ft = (e) => {
361
- F(!1), K(!1), ee({ from: e == null ? void 0 : e.from, to: e == null ? void 0 : e.to });
362
- }, gt = (e) => {
366
+ ), kt = (e) => {
367
+ F(!1), K(!1), re({ from: e == null ? void 0 : e.from, to: e == null ? void 0 : e.to });
368
+ }, Rt = (e) => {
363
369
  const t = e.range();
364
- F(!1), K(!1), w(t), H(t.from), m === "auto" && (k(t), P == null || P(t, Se(t)), x.current = !0, b(!1));
365
- }, te = (e, t) => {
370
+ F(!1), K(!1), S(t), X(t.from), m === "auto" && (k(t), P == null || P(t, Ge(t)), x.current = !0, b(!1));
371
+ }, se = (e, t) => {
366
372
  const d = e === "from" ? F : K;
367
373
  if (t.trim() === "") {
368
- d(!1), ee(
374
+ d(!1), re(
369
375
  e === "from" ? { from: void 0, to: a.to } : { from: a.from, to: void 0 }
370
376
  );
371
377
  return;
372
378
  }
373
- const o = Xt(t, p, /* @__PURE__ */ new Date(), { locale: u });
374
- if (!Ut(o) || ct(o)) {
379
+ const o = sa(t, p, /* @__PURE__ */ new Date(), { locale: u });
380
+ if (!ea(o) || vt(o)) {
375
381
  d(!0);
376
382
  return;
377
383
  }
378
384
  d(!1);
379
385
  let R;
380
- e === "from" ? R = a.to && le(o, a.to) ? { from: o, to: void 0 } : { from: o, to: a.to } : R = a.from && le(a.from, o) ? { from: o, to: void 0 } : { from: a.from, to: o }, H(o), ee(R);
381
- }, Ie = (e) => (t) => {
382
- t.key === "Enter" && (t.preventDefault(), te(e, e === "from" ? ye : be));
383
- }, vt = () => {
384
- w({}), F(!1), K(!1), m === "auto" && k({});
385
- }, yt = !!(a.from && a.to), ht = !a.from && !a.to, Oe = (yt || ht) && !S && !I, ae = () => {
386
- Oe && (k(a), P == null || P(a, Se(a))), x.current = !0, b(!1);
387
- }, bt = () => {
386
+ e === "from" ? R = a.to && pe(o, a.to) ? { from: o, to: void 0 } : { from: o, to: a.to } : R = a.from && pe(a.from, o) ? { from: o, to: void 0 } : { from: a.from, to: o }, X(o), re(R);
387
+ }, Ee = (e) => (t) => {
388
+ t.key === "Enter" && (t.preventDefault(), se(e, e === "from" ? ke : xe));
389
+ }, xt = () => {
390
+ S({}), F(!1), K(!1), m === "auto" && k({});
391
+ }, Pt = !!(a.from && a.to), Nt = !a.from && !a.to, Me = (Pt || Nt) && !w && !I, ne = () => {
392
+ Me && (k(a), P == null || P(a, Ge(a))), x.current = !0, b(!1);
393
+ }, Dt = () => {
388
394
  x.current = !0, b(!1);
389
- }, re = () => {
390
- m === "apply" && (N == null || N()), w(i), b(!1);
391
- }, kt = (e) => {
395
+ }, oe = () => {
396
+ m === "apply" && (N == null || N()), S(i), b(!1);
397
+ }, Ct = (e) => {
392
398
  if (e) {
393
399
  x.current = !1, b(!0);
394
400
  return;
395
401
  }
396
- m === "apply" && !x.current && (N == null || N()), w(i), x.current = !1, b(!1);
397
- }, se = (e) => {
402
+ m === "apply" && !x.current && (N == null || N()), S(i), x.current = !1, b(!1);
403
+ }, ie = (e) => {
398
404
  if (!i.from || !i.to) return !1;
399
405
  const t = e.range();
400
- return We(t.from, i.from) && We(t.to, i.to);
401
- }, Te = (() => {
406
+ return ze(t.from, i.from) && ze(t.to, i.to);
407
+ }, Ve = (() => {
402
408
  if (i.from && i.to) {
403
409
  const e = h(i.from, p, { locale: u }), t = h(i.to, p, { locale: u });
404
410
  return `${e} – ${t}`;
405
411
  }
406
412
  return i.from ? h(i.from, p, { locale: u }) : "";
407
- })(), W = a.from ? a.to ? null : "end" : "start", Rt = (() => {
413
+ })(), q = a.from ? a.to ? null : "end" : "start", St = (() => {
408
414
  if (!a.from)
409
415
  return n("inputs.dateRangePicker.selectStart", "Select start date");
410
416
  if (!a.to)
411
417
  return n("inputs.dateRangePicker.selectEnd", "Select end date");
412
- const e = de(a.to, a.from) + 1, t = h(a.from, p, { locale: u }), d = h(a.to, p, { locale: u }), o = n("inputs.dateRangePicker.days", { count: e });
418
+ const e = ue(a.to, a.from) + 1, t = h(a.from, p, { locale: u }), d = h(a.to, p, { locale: u }), o = n("inputs.dateRangePicker.days", { count: e });
413
419
  return `${t} – ${d} · ${o}`;
414
- })(), g = ie({
420
+ })(), g = ce({
415
421
  currentValue: i,
416
422
  open: C,
417
- getGranularity: () => L ? $ ?? void 0 : void 0,
418
- setGranularity: (e) => Q(e),
423
+ getGranularity: () => $ ? W : void 0,
424
+ setGranularity: (e) => Z(L(e)),
419
425
  getCompareRange: () => T ? O(i) : void 0,
420
- setCompare: (e) => Z(e),
426
+ setCompare: (e) => ae(e),
421
427
  getActivePreset: () => {
422
428
  var e;
423
- return (e = A.find(se)) == null ? void 0 : e.label;
429
+ return (e = j.find(ie)) == null ? void 0 : e.label;
424
430
  },
425
- getActiveEnd: () => W,
426
- apply: () => ae(),
427
- cancel: () => re()
431
+ getActiveEnd: () => q,
432
+ apply: () => ne(),
433
+ cancel: () => oe()
428
434
  });
429
435
  g.current = {
430
436
  currentValue: i,
431
437
  open: C,
432
- getGranularity: () => L ? $ ?? void 0 : void 0,
433
- setGranularity: (e) => Q(e),
438
+ getGranularity: () => $ ? W : void 0,
439
+ setGranularity: (e) => Z(L(e)),
434
440
  getCompareRange: () => T ? O(i) : void 0,
435
- setCompare: (e) => Z(e),
441
+ setCompare: (e) => ae(e),
436
442
  getActivePreset: () => {
437
443
  var e;
438
- return (e = A.find(se)) == null ? void 0 : e.label;
444
+ return (e = j.find(ie)) == null ? void 0 : e.label;
439
445
  },
440
- getActiveEnd: () => W,
441
- apply: () => ae(),
442
- cancel: () => re()
446
+ getActiveEnd: () => q,
447
+ apply: () => ne(),
448
+ cancel: () => oe()
443
449
  };
444
- const ne = Nt(
450
+ const de = Ot(
445
451
  () => ({
446
452
  getRange: () => g.current.currentValue,
447
453
  setRange: (e) => k(e),
@@ -460,27 +466,27 @@ const ea = {
460
466
  }),
461
467
  [k]
462
468
  );
463
- Dt(et, () => ne, [ne]), Ot(ea, ne, U);
464
- const Ee = (e) => e === "from" ? S ? "error" : W === "start" ? "active" : "default" : I ? "error" : W === "end" ? "active" : "default";
465
- return /* @__PURE__ */ r(j.Root, { open: C, onOpenChange: kt, children: /* @__PURE__ */ c(
469
+ Tt(nt, () => de, [de]), Ft(oa, de, J);
470
+ const Fe = (e) => e === "from" ? w ? "error" : q === "start" ? "active" : "default" : I ? "error" : q === "end" ? "active" : "default";
471
+ return /* @__PURE__ */ r(_.Root, { open: C, onOpenChange: Ct, children: /* @__PURE__ */ c(
466
472
  "div",
467
473
  {
468
- className: Xe,
474
+ className: rt,
469
475
  "data-component": "date-range-picker",
470
- "data-component-id": U,
476
+ "data-component-id": J,
471
477
  children: [
472
- /* @__PURE__ */ r(j.Trigger, { asChild: !0, disabled: ge, children: /* @__PURE__ */ c(
478
+ /* @__PURE__ */ r(_.Trigger, { asChild: !0, disabled: he, children: /* @__PURE__ */ c(
473
479
  "button",
474
480
  {
475
- ref: it,
476
- id: U,
481
+ ref: mt,
482
+ id: J,
477
483
  type: "button",
478
- disabled: ge,
484
+ disabled: he,
479
485
  "aria-describedby": V.describedBy || void 0,
480
486
  "aria-invalid": V.invalid || void 0,
481
487
  "aria-haspopup": "dialog",
482
488
  "aria-expanded": C,
483
- className: At({ size: me, tone: tt, chrome: He }),
489
+ className: Bt({ size: ve, tone: ot, chrome: et }),
484
490
  children: [
485
491
  /* @__PURE__ */ r(
486
492
  "span",
@@ -492,24 +498,24 @@ const ea = {
492
498
  // lets the flex child shrink below its content width so
493
499
  // `truncate` engages.
494
500
  "ds:min-w-0 ds:flex-1 ds:truncate ds:text-start",
495
- Te ? "ds:text-foreground" : "ds:text-muted-foreground"
501
+ Ve ? "ds:text-foreground" : "ds:text-muted-foreground"
496
502
  ].join(" "),
497
- children: Te || at
503
+ children: Ve || it
498
504
  }
499
505
  ),
500
506
  /* @__PURE__ */ r(
501
507
  "span",
502
508
  {
503
509
  "aria-hidden": "true",
504
- className: $t({ size: me }),
505
- children: /* @__PURE__ */ r(Qt, {})
510
+ className: zt({ size: ve }),
511
+ children: /* @__PURE__ */ r(aa, {})
506
512
  }
507
513
  )
508
514
  ]
509
515
  }
510
516
  ) }),
511
- /* @__PURE__ */ r(j.Portal, { children: /* @__PURE__ */ r(
512
- j.Content,
517
+ /* @__PURE__ */ r(_.Portal, { children: /* @__PURE__ */ r(
518
+ _.Content,
513
519
  {
514
520
  sideOffset: 4,
515
521
  align: "start",
@@ -518,33 +524,35 @@ const ea = {
518
524
  "inputs.dateRangePicker.title",
519
525
  "Select date range"
520
526
  ),
521
- className: Yt(),
527
+ className: Zt(),
522
528
  children: /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
523
529
  /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
524
530
  /* @__PURE__ */ c("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
525
531
  /* @__PURE__ */ r(
526
532
  "h2",
527
533
  {
528
- id: xe,
534
+ id: Ce,
529
535
  className: "type-body-sm ds:font-semibold ds:text-foreground",
530
536
  children: n("inputs.dateRangePicker.title", "Select date range")
531
537
  }
532
538
  ),
533
- L ? /* @__PURE__ */ r(
534
- q.Root,
539
+ $ ? /* @__PURE__ */ r(
540
+ z.Root,
535
541
  {
536
- value: $ ?? "day",
537
- onValueChange: (e) => Q(e),
542
+ value: W,
543
+ onValueChange: (e) => Z(
544
+ L(e)
545
+ ),
538
546
  "aria-label": n(
539
547
  "inputs.dateRangePicker.granularityLabel",
540
548
  "Granularity"
541
549
  ),
542
- className: $e(),
543
- children: ta.map((e) => /* @__PURE__ */ r(
544
- q.Item,
550
+ className: qe(),
551
+ children: Ne.map((e) => /* @__PURE__ */ r(
552
+ z.Item,
545
553
  {
546
554
  value: e.value,
547
- className: Le(),
555
+ className: je(),
548
556
  children: n(
549
557
  `inputs.dateRangePicker.granularity.${e.value}`,
550
558
  e.fallback
@@ -560,7 +568,7 @@ const ea = {
560
568
  /* @__PURE__ */ r(
561
569
  "label",
562
570
  {
563
- htmlFor: Pe,
571
+ htmlFor: Se,
564
572
  className: "ds:text-[length:var(--font-size-xs)] ds:text-muted-foreground",
565
573
  children: n("inputs.dateRangePicker.startLabel", "Start date")
566
574
  }
@@ -568,18 +576,18 @@ const ea = {
568
576
  /* @__PURE__ */ r(
569
577
  "input",
570
578
  {
571
- id: Pe,
579
+ id: Se,
572
580
  type: "text",
573
581
  inputMode: "numeric",
574
- value: ye,
582
+ value: ke,
575
583
  placeholder: p.toUpperCase(),
576
- "aria-invalid": S || void 0,
577
- "aria-describedby": S ? X : void 0,
578
- onChange: (e) => he(e.target.value),
579
- onBlur: (e) => te("from", e.target.value),
580
- onKeyDown: Ie("from"),
581
- className: Ae({
582
- state: Ee("from")
584
+ "aria-invalid": w || void 0,
585
+ "aria-describedby": w ? te : void 0,
586
+ onChange: (e) => Re(e.target.value),
587
+ onBlur: (e) => se("from", e.target.value),
588
+ onKeyDown: Ee("from"),
589
+ className: _e({
590
+ state: Fe("from")
583
591
  })
584
592
  }
585
593
  )
@@ -596,7 +604,7 @@ const ea = {
596
604
  /* @__PURE__ */ r(
597
605
  "label",
598
606
  {
599
- htmlFor: Ne,
607
+ htmlFor: we,
600
608
  className: "ds:text-[length:var(--font-size-xs)] ds:text-muted-foreground",
601
609
  children: n("inputs.dateRangePicker.endLabel", "End date")
602
610
  }
@@ -604,27 +612,27 @@ const ea = {
604
612
  /* @__PURE__ */ r(
605
613
  "input",
606
614
  {
607
- id: Ne,
615
+ id: we,
608
616
  type: "text",
609
617
  inputMode: "numeric",
610
- value: be,
618
+ value: xe,
611
619
  placeholder: p.toUpperCase(),
612
620
  "aria-invalid": I || void 0,
613
- "aria-describedby": I ? X : void 0,
614
- onChange: (e) => ke(e.target.value),
615
- onBlur: (e) => te("to", e.target.value),
616
- onKeyDown: Ie("to"),
617
- className: Ae({
618
- state: Ee("to")
621
+ "aria-describedby": I ? te : void 0,
622
+ onChange: (e) => Pe(e.target.value),
623
+ onBlur: (e) => se("to", e.target.value),
624
+ onKeyDown: Ee("to"),
625
+ className: _e({
626
+ state: Fe("to")
619
627
  })
620
628
  }
621
629
  )
622
630
  ] })
623
631
  ] }),
624
- S || I ? /* @__PURE__ */ r(
632
+ w || I ? /* @__PURE__ */ r(
625
633
  "p",
626
634
  {
627
- id: X,
635
+ id: te,
628
636
  role: "alert",
629
637
  className: "ds:text-[length:var(--font-size-xs)] ds:text-destructive",
630
638
  children: n(
@@ -638,20 +646,20 @@ const ea = {
638
646
  ) : null
639
647
  ] }),
640
648
  /* @__PURE__ */ c("div", { className: "ds:flex ds:gap-[var(--spacing-md)]", children: [
641
- A.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: we.map((e, t) => {
642
- const d = `${xe}-pg${t}`, o = e.presets.map((R) => {
643
- const oe = se(R);
649
+ j.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: Te.map((e, t) => {
650
+ const d = `${Ce}-pg${t}`, o = e.presets.map((R) => {
651
+ const le = ie(R);
644
652
  return /* @__PURE__ */ c(
645
653
  "button",
646
654
  {
647
655
  type: "button",
648
- "aria-pressed": oe,
649
- onClick: () => gt(R),
650
- className: Wt({ active: oe }),
656
+ "aria-pressed": le,
657
+ onClick: () => Rt(R),
658
+ className: Yt({ active: le }),
651
659
  children: [
652
660
  /* @__PURE__ */ r("span", { className: "ds:min-w-0 ds:truncate", children: R.label }),
653
- oe ? /* @__PURE__ */ r(
654
- Jt,
661
+ le ? /* @__PURE__ */ r(
662
+ ra,
655
663
  {
656
664
  "aria-hidden": "true",
657
665
  className: "ds:size-4 ds:shrink-0 ds:text-primary"
@@ -662,7 +670,7 @@ const ea = {
662
670
  R.label
663
671
  );
664
672
  });
665
- return ut && e.group ? /* @__PURE__ */ c(
673
+ return yt && e.group ? /* @__PURE__ */ c(
666
674
  "div",
667
675
  {
668
676
  role: "group",
@@ -673,7 +681,7 @@ const ea = {
673
681
  "div",
674
682
  {
675
683
  id: d,
676
- className: jt(),
684
+ className: Ut(),
677
685
  children: e.group
678
686
  }
679
687
  ),
@@ -681,45 +689,45 @@ const ea = {
681
689
  ]
682
690
  },
683
691
  e.group
684
- ) : /* @__PURE__ */ r(Ct, { children: o }, e.group || "_ungrouped");
692
+ ) : /* @__PURE__ */ r(Gt, { children: o }, e.group || "_ungrouped");
685
693
  }) }) : null,
686
- /* @__PURE__ */ c("div", { role: "region", "aria-labelledby": De, children: [
687
- /* @__PURE__ */ r("span", { id: De, className: "ds:sr-only", children: n("inputs.dateRangePicker.gridLabel", "Calendar") }),
694
+ /* @__PURE__ */ c("div", { role: "region", "aria-labelledby": Ie, children: [
695
+ /* @__PURE__ */ r("span", { id: Ie, className: "ds:sr-only", children: n("inputs.dateRangePicker.gridLabel", "Calendar") }),
688
696
  /* @__PURE__ */ r(
689
- qt,
697
+ Ht,
690
698
  {
691
699
  mode: "range",
692
700
  selected: a.from ? { from: a.from, to: a.to } : void 0,
693
- onSelect: ft,
694
- month: st,
695
- onMonthChange: H,
696
- numberOfMonths: _e,
701
+ onSelect: kt,
702
+ month: lt,
703
+ onMonthChange: X,
704
+ numberOfMonths: He,
697
705
  weekStartsOn: M,
698
- disabled: lt,
706
+ disabled: gt,
699
707
  locale: u,
700
708
  showOutsideDays: !0,
701
709
  fixedWeeks: !0,
702
710
  pagedNavigation: !0,
703
- classNames: Bt,
704
- modifiers: pt,
705
- modifiersClassNames: zt,
706
- components: { Chevron: _t }
711
+ classNames: Xt,
712
+ modifiers: ht,
713
+ modifiersClassNames: Jt,
714
+ components: { Chevron: Qt }
707
715
  }
708
716
  )
709
717
  ] })
710
718
  ] }),
711
- pe ? /* @__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: [
719
+ ge ? /* @__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: [
712
720
  /* @__PURE__ */ r(
713
- It,
721
+ Vt,
714
722
  {
715
- id: dt,
723
+ id: ft,
716
724
  label: n(
717
725
  "inputs.dateRangePicker.compareLabel",
718
726
  "Compare to previous period"
719
727
  ),
720
728
  size: "sm",
721
- checked: J,
722
- onCheckedChange: Z
729
+ checked: ee,
730
+ onCheckedChange: ae
723
731
  }
724
732
  ),
725
733
  T && v ? /* @__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: [
@@ -732,21 +740,21 @@ const ea = {
732
740
  ),
733
741
  `${h(v.from, p, { locale: u })} – ${h(v.to, p, { locale: u })}`
734
742
  ] }) : null,
735
- J ? /* @__PURE__ */ r(
736
- q.Root,
743
+ ee ? /* @__PURE__ */ r(
744
+ z.Root,
737
745
  {
738
- value: Re,
739
- onValueChange: mt,
746
+ value: De,
747
+ onValueChange: bt,
740
748
  "aria-label": n(
741
749
  "inputs.dateRangePicker.compareModeLabel",
742
750
  "Comparison period"
743
751
  ),
744
- className: `${$e()} ds:ms-auto`,
745
- children: aa.map((e) => /* @__PURE__ */ r(
746
- q.Item,
752
+ className: `${qe()} ds:ms-auto`,
753
+ children: ia.map((e) => /* @__PURE__ */ r(
754
+ z.Item,
747
755
  {
748
756
  value: e.value,
749
- className: Le(),
757
+ className: je(),
750
758
  children: n(
751
759
  `inputs.dateRangePicker.compareMode.${e.value}`,
752
760
  e.fallback
@@ -764,26 +772,26 @@ const ea = {
764
772
  role: "status",
765
773
  "aria-live": "polite",
766
774
  className: "type-body-sm ds:min-w-0 ds:truncate ds:text-muted-foreground",
767
- children: Rt
775
+ children: St
768
776
  }
769
777
  ),
770
778
  /* @__PURE__ */ c("div", { className: "ds:flex ds:shrink-0 ds:gap-[var(--spacing-xs)]", children: [
771
- qe ? /* @__PURE__ */ r(
779
+ Ue ? /* @__PURE__ */ r(
772
780
  "button",
773
781
  {
774
782
  type: "button",
775
- onClick: vt,
776
- className: _({ intent: "ghost" }),
783
+ onClick: xt,
784
+ className: B({ intent: "ghost" }),
777
785
  children: n("inputs.dateRangePicker.clear", "Clear")
778
786
  }
779
787
  ) : null,
780
- m === "apply" ? /* @__PURE__ */ c(xt, { children: [
788
+ m === "apply" ? /* @__PURE__ */ c(wt, { children: [
781
789
  /* @__PURE__ */ r(
782
790
  "button",
783
791
  {
784
792
  type: "button",
785
- onClick: re,
786
- className: _({ intent: "ghost" }),
793
+ onClick: oe,
794
+ className: B({ intent: "ghost" }),
787
795
  children: n("inputs.dateRangePicker.cancel", "Cancel")
788
796
  }
789
797
  ),
@@ -791,9 +799,9 @@ const ea = {
791
799
  "button",
792
800
  {
793
801
  type: "button",
794
- disabled: !Oe,
795
- onClick: ae,
796
- className: _({ intent: "primary" }),
802
+ disabled: !Me,
803
+ onClick: ne,
804
+ className: B({ intent: "primary" }),
797
805
  children: n("inputs.dateRangePicker.apply", "Apply")
798
806
  }
799
807
  )
@@ -801,8 +809,8 @@ const ea = {
801
809
  "button",
802
810
  {
803
811
  type: "button",
804
- onClick: bt,
805
- className: _({ intent: "primary" }),
812
+ onClick: Dt,
813
+ className: B({ intent: "primary" }),
806
814
  children: n("inputs.dateRangePicker.done", "Done")
807
815
  }
808
816
  )
@@ -816,9 +824,9 @@ const ea = {
816
824
  ) });
817
825
  }
818
826
  );
819
- ra.displayName = "DateRangePicker";
827
+ da.displayName = "DateRangePicker";
820
828
  export {
821
- ra as D,
822
- ea as d
829
+ da as D,
830
+ oa as d
823
831
  };
824
- //# sourceMappingURL=date-range-picker-Cc4DLAL2.js.map
832
+ //# sourceMappingURL=date-range-picker-Cfv4Sr63.js.map