@alfadocs/ui-kit 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.
- package/dist/_chunks/apexcharts-theme-fAQXLIMW.js +67 -0
- package/dist/_chunks/{chart-CNaLgvx4.js → chart-DqxVCm1I.js} +288 -257
- package/dist/_chunks/{date-range-picker-Cc4DLAL2.js → date-range-picker-Cfv4Sr63.js} +231 -223
- package/dist/_chunks/{link-cell-renderer-DQjZeoAr.js → link-cell-renderer-_LDZhY4r.js} +2 -2
- package/dist/_chunks/{patient-table-DU_zFZoq.js → patient-table-CFM92QqU.js} +2 -2
- package/dist/_chunks/{radiograph-panel.agent-rnrQZtK3.js → radiograph-panel.agent-DDnDGVpN.js} +2 -2
- package/dist/_chunks/{sparkline-iOXYgvJe.js → sparkline-o6JH4O66.js} +2 -2
- package/dist/agent-catalog.json +9 -1
- package/dist/components/chart/chart.d.ts +20 -0
- package/dist/components/chart/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.ts +12 -0
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/sparkline/index.js +1 -1
- package/dist/index.js +6 -6
- package/dist/tokens/apexcharts-theme.d.ts +36 -1
- package/package.json +1 -1
- package/dist/_chunks/apexcharts-theme-BJigns_V.js +0 -53
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsx as r, jsxs as c, Fragment as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import { u as
|
|
7
|
-
import { u as
|
|
8
|
-
import { S as
|
|
9
|
-
import { u as
|
|
10
|
-
import { l as
|
|
11
|
-
import { s as
|
|
12
|
-
import { C as
|
|
13
|
-
import { C as
|
|
14
|
-
import { i as
|
|
15
|
-
import { p as
|
|
16
|
-
function
|
|
17
|
-
return
|
|
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
|
|
20
|
-
return
|
|
19
|
+
function Be(s, l, f) {
|
|
20
|
+
return Lt(s, -1, f);
|
|
21
21
|
}
|
|
22
|
-
const
|
|
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
|
-
},
|
|
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
|
-
],
|
|
219
|
+
], ia = [
|
|
220
220
|
{ value: "previous", fallback: "Previous period" },
|
|
221
221
|
{ value: "lastYear", fallback: "Same period last year" }
|
|
222
|
-
],
|
|
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:
|
|
231
|
-
numberOfMonths:
|
|
232
|
-
granularity:
|
|
233
|
-
defaultGranularity:
|
|
234
|
-
onGranularityChange:
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
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:
|
|
241
|
-
maxDate:
|
|
242
|
-
presets:
|
|
243
|
-
mergePresets:
|
|
244
|
-
size:
|
|
245
|
-
chrome:
|
|
246
|
-
disabled:
|
|
247
|
-
placeholder:
|
|
248
|
-
className:
|
|
249
|
-
id:
|
|
250
|
-
},
|
|
251
|
-
const { t: n, i18n:
|
|
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 =
|
|
256
|
-
value
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
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
|
-
|
|
267
|
+
be(e);
|
|
262
268
|
},
|
|
263
|
-
[
|
|
264
|
-
),
|
|
265
|
-
|
|
266
|
-
C && (
|
|
267
|
-
}, [C]),
|
|
268
|
-
|
|
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 ||
|
|
276
|
+
), I || Pe(a.to ? h(a.to, p, { locale: u }) : "");
|
|
271
277
|
}, [a.from, a.to, p, u]);
|
|
272
|
-
const
|
|
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 =
|
|
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:
|
|
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:
|
|
300
|
-
to:
|
|
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 =
|
|
312
|
+
const e = na(/* @__PURE__ */ new Date());
|
|
307
313
|
return {
|
|
308
|
-
from:
|
|
309
|
-
to:
|
|
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:
|
|
317
|
-
to:
|
|
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:
|
|
329
|
+
from: E(/* @__PURE__ */ new Date(), 29),
|
|
324
330
|
to: /* @__PURE__ */ new Date()
|
|
325
331
|
})
|
|
326
332
|
}
|
|
327
|
-
],
|
|
333
|
+
], j = Q ? Ze ? [...Oe, ...Q] : Q : Oe, Te = (() => {
|
|
328
334
|
const e = [], t = /* @__PURE__ */ new Map();
|
|
329
|
-
for (const d of
|
|
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
|
-
})(),
|
|
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:
|
|
338
|
-
const d =
|
|
339
|
-
return { from:
|
|
340
|
-
}, T =
|
|
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
|
|
347
|
-
})(),
|
|
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
|
|
350
|
-
},
|
|
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
|
-
|
|
353
|
-
},
|
|
354
|
-
|
|
355
|
-
},
|
|
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
|
-
|
|
363
|
+
S(e), m === "auto" && e.from && e.to && k(e);
|
|
358
364
|
},
|
|
359
365
|
[m, k]
|
|
360
|
-
),
|
|
361
|
-
F(!1), K(!1),
|
|
362
|
-
},
|
|
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),
|
|
365
|
-
},
|
|
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),
|
|
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 =
|
|
374
|
-
if (!
|
|
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 &&
|
|
381
|
-
},
|
|
382
|
-
t.key === "Enter" && (t.preventDefault(),
|
|
383
|
-
},
|
|
384
|
-
|
|
385
|
-
},
|
|
386
|
-
|
|
387
|
-
},
|
|
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
|
-
},
|
|
390
|
-
m === "apply" && (N == null || N()),
|
|
391
|
-
},
|
|
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()),
|
|
397
|
-
},
|
|
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
|
|
401
|
-
},
|
|
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
|
-
})(),
|
|
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 =
|
|
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 =
|
|
420
|
+
})(), g = ce({
|
|
415
421
|
currentValue: i,
|
|
416
422
|
open: C,
|
|
417
|
-
getGranularity: () =>
|
|
418
|
-
setGranularity: (e) =>
|
|
423
|
+
getGranularity: () => $ ? W : void 0,
|
|
424
|
+
setGranularity: (e) => Z(L(e)),
|
|
419
425
|
getCompareRange: () => T ? O(i) : void 0,
|
|
420
|
-
setCompare: (e) =>
|
|
426
|
+
setCompare: (e) => ae(e),
|
|
421
427
|
getActivePreset: () => {
|
|
422
428
|
var e;
|
|
423
|
-
return (e =
|
|
429
|
+
return (e = j.find(ie)) == null ? void 0 : e.label;
|
|
424
430
|
},
|
|
425
|
-
getActiveEnd: () =>
|
|
426
|
-
apply: () =>
|
|
427
|
-
cancel: () =>
|
|
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: () =>
|
|
433
|
-
setGranularity: (e) =>
|
|
438
|
+
getGranularity: () => $ ? W : void 0,
|
|
439
|
+
setGranularity: (e) => Z(L(e)),
|
|
434
440
|
getCompareRange: () => T ? O(i) : void 0,
|
|
435
|
-
setCompare: (e) =>
|
|
441
|
+
setCompare: (e) => ae(e),
|
|
436
442
|
getActivePreset: () => {
|
|
437
443
|
var e;
|
|
438
|
-
return (e =
|
|
444
|
+
return (e = j.find(ie)) == null ? void 0 : e.label;
|
|
439
445
|
},
|
|
440
|
-
getActiveEnd: () =>
|
|
441
|
-
apply: () =>
|
|
442
|
-
cancel: () =>
|
|
446
|
+
getActiveEnd: () => q,
|
|
447
|
+
apply: () => ne(),
|
|
448
|
+
cancel: () => oe()
|
|
443
449
|
};
|
|
444
|
-
const
|
|
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
|
-
|
|
464
|
-
const
|
|
465
|
-
return /* @__PURE__ */ r(
|
|
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:
|
|
474
|
+
className: rt,
|
|
469
475
|
"data-component": "date-range-picker",
|
|
470
|
-
"data-component-id":
|
|
476
|
+
"data-component-id": J,
|
|
471
477
|
children: [
|
|
472
|
-
/* @__PURE__ */ r(
|
|
478
|
+
/* @__PURE__ */ r(_.Trigger, { asChild: !0, disabled: he, children: /* @__PURE__ */ c(
|
|
473
479
|
"button",
|
|
474
480
|
{
|
|
475
|
-
ref:
|
|
476
|
-
id:
|
|
481
|
+
ref: mt,
|
|
482
|
+
id: J,
|
|
477
483
|
type: "button",
|
|
478
|
-
disabled:
|
|
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:
|
|
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
|
-
|
|
501
|
+
Ve ? "ds:text-foreground" : "ds:text-muted-foreground"
|
|
496
502
|
].join(" "),
|
|
497
|
-
children:
|
|
503
|
+
children: Ve || it
|
|
498
504
|
}
|
|
499
505
|
),
|
|
500
506
|
/* @__PURE__ */ r(
|
|
501
507
|
"span",
|
|
502
508
|
{
|
|
503
509
|
"aria-hidden": "true",
|
|
504
|
-
className:
|
|
505
|
-
children: /* @__PURE__ */ r(
|
|
510
|
+
className: zt({ size: ve }),
|
|
511
|
+
children: /* @__PURE__ */ r(aa, {})
|
|
506
512
|
}
|
|
507
513
|
)
|
|
508
514
|
]
|
|
509
515
|
}
|
|
510
516
|
) }),
|
|
511
|
-
/* @__PURE__ */ r(
|
|
512
|
-
|
|
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:
|
|
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:
|
|
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
|
-
|
|
534
|
-
|
|
539
|
+
$ ? /* @__PURE__ */ r(
|
|
540
|
+
z.Root,
|
|
535
541
|
{
|
|
536
|
-
value:
|
|
537
|
-
onValueChange: (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:
|
|
543
|
-
children:
|
|
544
|
-
|
|
550
|
+
className: qe(),
|
|
551
|
+
children: Ne.map((e) => /* @__PURE__ */ r(
|
|
552
|
+
z.Item,
|
|
545
553
|
{
|
|
546
554
|
value: e.value,
|
|
547
|
-
className:
|
|
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:
|
|
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:
|
|
579
|
+
id: Se,
|
|
572
580
|
type: "text",
|
|
573
581
|
inputMode: "numeric",
|
|
574
|
-
value:
|
|
582
|
+
value: ke,
|
|
575
583
|
placeholder: p.toUpperCase(),
|
|
576
|
-
"aria-invalid":
|
|
577
|
-
"aria-describedby":
|
|
578
|
-
onChange: (e) =>
|
|
579
|
-
onBlur: (e) =>
|
|
580
|
-
onKeyDown:
|
|
581
|
-
className:
|
|
582
|
-
state:
|
|
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:
|
|
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:
|
|
615
|
+
id: we,
|
|
608
616
|
type: "text",
|
|
609
617
|
inputMode: "numeric",
|
|
610
|
-
value:
|
|
618
|
+
value: xe,
|
|
611
619
|
placeholder: p.toUpperCase(),
|
|
612
620
|
"aria-invalid": I || void 0,
|
|
613
|
-
"aria-describedby": I ?
|
|
614
|
-
onChange: (e) =>
|
|
615
|
-
onBlur: (e) =>
|
|
616
|
-
onKeyDown:
|
|
617
|
-
className:
|
|
618
|
-
state:
|
|
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
|
-
|
|
632
|
+
w || I ? /* @__PURE__ */ r(
|
|
625
633
|
"p",
|
|
626
634
|
{
|
|
627
|
-
id:
|
|
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
|
-
|
|
642
|
-
const d = `${
|
|
643
|
-
const
|
|
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":
|
|
649
|
-
onClick: () =>
|
|
650
|
-
className:
|
|
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
|
-
|
|
654
|
-
|
|
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
|
|
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:
|
|
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(
|
|
692
|
+
) : /* @__PURE__ */ r(Gt, { children: o }, e.group || "_ungrouped");
|
|
685
693
|
}) }) : null,
|
|
686
|
-
/* @__PURE__ */ c("div", { role: "region", "aria-labelledby":
|
|
687
|
-
/* @__PURE__ */ r("span", { id:
|
|
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
|
-
|
|
697
|
+
Ht,
|
|
690
698
|
{
|
|
691
699
|
mode: "range",
|
|
692
700
|
selected: a.from ? { from: a.from, to: a.to } : void 0,
|
|
693
|
-
onSelect:
|
|
694
|
-
month:
|
|
695
|
-
onMonthChange:
|
|
696
|
-
numberOfMonths:
|
|
701
|
+
onSelect: kt,
|
|
702
|
+
month: lt,
|
|
703
|
+
onMonthChange: X,
|
|
704
|
+
numberOfMonths: He,
|
|
697
705
|
weekStartsOn: M,
|
|
698
|
-
disabled:
|
|
706
|
+
disabled: gt,
|
|
699
707
|
locale: u,
|
|
700
708
|
showOutsideDays: !0,
|
|
701
709
|
fixedWeeks: !0,
|
|
702
710
|
pagedNavigation: !0,
|
|
703
|
-
classNames:
|
|
704
|
-
modifiers:
|
|
705
|
-
modifiersClassNames:
|
|
706
|
-
components: { Chevron:
|
|
711
|
+
classNames: Xt,
|
|
712
|
+
modifiers: ht,
|
|
713
|
+
modifiersClassNames: Jt,
|
|
714
|
+
components: { Chevron: Qt }
|
|
707
715
|
}
|
|
708
716
|
)
|
|
709
717
|
] })
|
|
710
718
|
] }),
|
|
711
|
-
|
|
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
|
-
|
|
721
|
+
Vt,
|
|
714
722
|
{
|
|
715
|
-
id:
|
|
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:
|
|
722
|
-
onCheckedChange:
|
|
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
|
-
|
|
736
|
-
|
|
743
|
+
ee ? /* @__PURE__ */ r(
|
|
744
|
+
z.Root,
|
|
737
745
|
{
|
|
738
|
-
value:
|
|
739
|
-
onValueChange:
|
|
746
|
+
value: De,
|
|
747
|
+
onValueChange: bt,
|
|
740
748
|
"aria-label": n(
|
|
741
749
|
"inputs.dateRangePicker.compareModeLabel",
|
|
742
750
|
"Comparison period"
|
|
743
751
|
),
|
|
744
|
-
className: `${
|
|
745
|
-
children:
|
|
746
|
-
|
|
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:
|
|
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:
|
|
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
|
-
|
|
779
|
+
Ue ? /* @__PURE__ */ r(
|
|
772
780
|
"button",
|
|
773
781
|
{
|
|
774
782
|
type: "button",
|
|
775
|
-
onClick:
|
|
776
|
-
className:
|
|
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(
|
|
788
|
+
m === "apply" ? /* @__PURE__ */ c(wt, { children: [
|
|
781
789
|
/* @__PURE__ */ r(
|
|
782
790
|
"button",
|
|
783
791
|
{
|
|
784
792
|
type: "button",
|
|
785
|
-
onClick:
|
|
786
|
-
className:
|
|
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: !
|
|
795
|
-
onClick:
|
|
796
|
-
className:
|
|
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:
|
|
805
|
-
className:
|
|
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
|
-
|
|
827
|
+
da.displayName = "DateRangePicker";
|
|
820
828
|
export {
|
|
821
|
-
|
|
822
|
-
|
|
829
|
+
da as D,
|
|
830
|
+
oa as d
|
|
823
831
|
};
|
|
824
|
-
//# sourceMappingURL=date-range-picker-
|
|
832
|
+
//# sourceMappingURL=date-range-picker-Cfv4Sr63.js.map
|