@pibit.ai/cure-design-system 0.6.4 → 0.6.5
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/applications/date-picker/calendar.d.ts +1 -1
- package/dist/applications/date-picker/calendar.d.ts.map +1 -1
- package/dist/applications/date-picker/calendar.js +162 -157
- package/dist/applications/date-picker/cell.d.ts.map +1 -1
- package/dist/applications/date-picker/cell.js +58 -51
- package/dist/applications/date-picker/date-input.d.ts +2 -2
- package/dist/applications/date-picker/date-input.d.ts.map +1 -1
- package/dist/applications/date-picker/date-input.js +21 -17
- package/dist/applications/date-picker/date-picker.d.ts +4 -1
- package/dist/applications/date-picker/date-picker.d.ts.map +1 -1
- package/dist/applications/date-picker/date-picker.js +136 -116
- package/dist/applications/date-picker/date-range-picker.d.ts +4 -0
- package/dist/applications/date-picker/date-range-picker.d.ts.map +1 -1
- package/dist/applications/date-picker/date-range-picker.js +245 -197
- package/dist/applications/date-picker/date-time-calendar.d.ts +1 -1
- package/dist/applications/date-picker/date-time-calendar.d.ts.map +1 -1
- package/dist/applications/date-picker/date-time-calendar.js +70 -60
- package/dist/applications/date-picker/range-calendar.d.ts +1 -1
- package/dist/applications/date-picker/range-calendar.d.ts.map +1 -1
- package/dist/applications/date-picker/range-calendar.js +99 -90
- package/dist/applications/date-picker/range-preset.d.ts +4 -1
- package/dist/applications/date-picker/range-preset.d.ts.map +1 -1
- package/dist/applications/date-picker/range-preset.js +23 -17
- package/dist/applications/date-picker/sizes.d.ts +12 -0
- package/dist/applications/date-picker/sizes.d.ts.map +1 -0
- package/dist/applications/date-picker/sizes.js +22 -0
- package/dist/applications/date-picker/styles.js +1 -1
- package/dist/applications/date-picker/time-field.js +21 -21
- package/dist/primitives/select/multi-select.d.ts.map +1 -1
- package/dist/primitives/select/multi-select.js +419 -422
- package/dist/styles/components.css +1 -1
- package/package.json +1 -1
|
@@ -1,80 +1,87 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { getDayOfWeek as
|
|
3
|
-
import { useLocale as
|
|
1
|
+
import { jsx as x, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { getDayOfWeek as T, isToday as B, getLocalTimeZone as W } from "@internationalized/date";
|
|
3
|
+
import { useLocale as q, useSlottedContext as F, RangeCalendarContext as I, CalendarCell as Z } from "react-aria-components";
|
|
4
4
|
import { cx as u } from "../../utils/cn.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import { dayCellSizes as $ } from "./sizes.js";
|
|
6
|
+
const K = ({
|
|
7
|
+
date: t,
|
|
8
|
+
isHighlighted: y,
|
|
9
|
+
size: d = "xs",
|
|
9
10
|
onDateSelect: g,
|
|
10
11
|
...O
|
|
11
12
|
}) => {
|
|
12
|
-
var b,
|
|
13
|
-
const { locale:
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
13
|
+
var b, p;
|
|
14
|
+
const { locale: C } = q(), h = T(t, C), o = F(I), n = !!o, f = (b = o == null ? void 0 : o.value) == null ? void 0 : b.start, l = (p = o == null ? void 0 : o.value) == null ? void 0 : p.end, R = f ? t.compare(f) > 0 : !0, w = l ? t.compare(l) < 0 : !0, k = f && t.compare(f) >= 0, L = l && t.compare(l) <= 0, _ = k && L, j = new Date(t.year, t.month, 0).getDate(), z = t.day === j, A = t.day === 1, v = B(t, W());
|
|
15
|
+
return /* @__PURE__ */ x(
|
|
16
|
+
Z,
|
|
16
17
|
{
|
|
17
18
|
...O,
|
|
18
|
-
date:
|
|
19
|
+
date: t,
|
|
19
20
|
className: ({
|
|
20
|
-
isDisabled:
|
|
21
|
-
isFocusVisible:
|
|
22
|
-
isSelectionStart:
|
|
23
|
-
isSelectionEnd:
|
|
21
|
+
isDisabled: e,
|
|
22
|
+
isFocusVisible: c,
|
|
23
|
+
isSelectionStart: a,
|
|
24
|
+
isSelectionEnd: s,
|
|
24
25
|
isSelected: r,
|
|
25
|
-
isOutsideMonth:
|
|
26
|
-
}) =>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
isOutsideMonth: m
|
|
27
|
+
}) => {
|
|
28
|
+
const i = a || h === 0, M = s || h === 6;
|
|
29
|
+
return u(
|
|
30
|
+
"relative focus:outline-none",
|
|
31
|
+
"w-full",
|
|
32
|
+
$[d],
|
|
33
|
+
i && "rounded-l-full",
|
|
34
|
+
M && "rounded-r-full",
|
|
35
|
+
_ && e && "bg-active",
|
|
36
|
+
// The cell can be wider than its circle, so the band starts and stops at
|
|
37
|
+
// the circle's centre on the range ends instead of filling the whole cell.
|
|
38
|
+
r && n && (a && s ? "" : a ? "bg-gradient-to-r from-transparent from-50% to-bg-active to-50%" : s ? "bg-gradient-to-l from-transparent from-50% to-bg-active to-50%" : "bg-active"),
|
|
39
|
+
e ? "pointer-events-none" : "cursor-pointer",
|
|
40
|
+
c ? "z-10" : "z-0",
|
|
41
|
+
n && m && "hidden",
|
|
42
|
+
// Show gradient on last day of month if it's within the selected range.
|
|
43
|
+
z && r && w && n && "after:absolute after:inset-0 after:translate-x-full after:bg-gradient-to-l after:from-transparent after:to-bg-active in-[[role=gridcell]:last-child]:after:hidden",
|
|
44
|
+
// Show gradient on first day of month if it's within the selected range.
|
|
45
|
+
A && r && R && n && "after:absolute after:inset-0 after:-translate-x-full after:bg-gradient-to-r after:from-transparent after:to-bg-active in-[[role=gridcell]:first-child]:after:hidden"
|
|
46
|
+
);
|
|
47
|
+
},
|
|
41
48
|
children: ({
|
|
42
|
-
isDisabled:
|
|
43
|
-
isFocusVisible:
|
|
44
|
-
isSelectionStart:
|
|
45
|
-
isSelectionEnd:
|
|
49
|
+
isDisabled: e,
|
|
50
|
+
isFocusVisible: c,
|
|
51
|
+
isSelectionStart: a,
|
|
52
|
+
isSelectionEnd: s,
|
|
46
53
|
isSelected: r,
|
|
47
|
-
formattedDate:
|
|
54
|
+
formattedDate: m
|
|
48
55
|
}) => {
|
|
49
|
-
const
|
|
50
|
-
return /* @__PURE__ */
|
|
56
|
+
const i = a || s || r && !e && !n;
|
|
57
|
+
return /* @__PURE__ */ N(
|
|
51
58
|
"div",
|
|
52
59
|
{
|
|
53
60
|
onClick: () => {
|
|
54
|
-
!
|
|
61
|
+
!e && g && g(t);
|
|
55
62
|
},
|
|
56
63
|
className: u(
|
|
57
|
-
"relative flex
|
|
58
|
-
|
|
64
|
+
"relative mx-auto flex aspect-square h-full items-center justify-center rounded-full",
|
|
65
|
+
d === "xs" ? "text-xs" : "text-sm",
|
|
59
66
|
// Disabled state.
|
|
60
|
-
|
|
67
|
+
e ? "text-disabled" : "text-secondary hover:text-secondary_hover",
|
|
61
68
|
// Focus ring, visible while the cell has keyboard focus.
|
|
62
|
-
|
|
69
|
+
c ? "outline-2 outline-offset-2 outline-focus-ring" : "",
|
|
63
70
|
// Hover state for cells in the middle of the range.
|
|
64
|
-
r && !
|
|
65
|
-
|
|
71
|
+
r && !e && n ? "font-medium" : "",
|
|
72
|
+
i && "bg-brand-solid font-medium text-white hover:bg-brand-solid_hover hover:text-white",
|
|
66
73
|
// Hover state for non-selected cells.
|
|
67
|
-
!r && !
|
|
74
|
+
!r && !e ? "hover:bg-primary_hover hover:font-medium!" : "",
|
|
68
75
|
!r && v ? "bg-active font-medium hover:bg-secondary_hover" : ""
|
|
69
76
|
),
|
|
70
77
|
children: [
|
|
71
|
-
|
|
72
|
-
(
|
|
78
|
+
m,
|
|
79
|
+
(y || v) && /* @__PURE__ */ x(
|
|
73
80
|
"div",
|
|
74
81
|
{
|
|
75
82
|
className: u(
|
|
76
83
|
"absolute bottom-1 left-1/2 size-1.25 -translate-x-1/2 rounded-full",
|
|
77
|
-
|
|
84
|
+
e ? "bg-fg-disabled" : i ? "bg-fg-white" : "bg-fg-brand-primary"
|
|
78
85
|
)
|
|
79
86
|
}
|
|
80
87
|
)
|
|
@@ -86,5 +93,5 @@ const H = ({
|
|
|
86
93
|
);
|
|
87
94
|
};
|
|
88
95
|
export {
|
|
89
|
-
|
|
96
|
+
K as CalendarCell
|
|
90
97
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DateInputProps as AriaDateInputProps } from 'react-aria-components';
|
|
2
2
|
export interface DateInputProps extends Omit<AriaDateInputProps, "children"> {
|
|
3
|
-
/** Input size: "sm" (
|
|
4
|
-
size?: "sm" | "md";
|
|
3
|
+
/** Input size: "xs" (28px, 12px text; default), "sm" (32px, 14px text) or "md" (40px). */
|
|
4
|
+
size?: "xs" | "sm" | "md";
|
|
5
5
|
}
|
|
6
6
|
export declare const DateInput: ({ size, ...props }: DateInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
//# sourceMappingURL=date-input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-input.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/date-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AA0BlF,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC;IAC1E,
|
|
1
|
+
{"version":3,"file":"date-input.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/date-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AA0BlF,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC;IAC1E,0FAA0F;IAC1F,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAQD,eAAO,MAAM,SAAS,GAAI,oBAA2B,cAAc,4CA+BlE,CAAC"}
|
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { DateInput as
|
|
3
|
-
import { cx as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
const { type: e, text: t, isPlaceholder:
|
|
7
|
-
return
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { DateInput as i, DateSegment as d } from "react-aria-components";
|
|
3
|
+
import { cx as s } from "../../utils/cn.js";
|
|
4
|
+
const c = /* @__PURE__ */ new Set(["day", "month", "hour"]);
|
|
5
|
+
function x(r) {
|
|
6
|
+
const { type: e, text: t, isPlaceholder: a } = r;
|
|
7
|
+
return a || !c.has(e) ? t : t.length === 1 && /^\d$/.test(t) ? `0${t}` : t;
|
|
8
8
|
}
|
|
9
|
-
const
|
|
10
|
-
|
|
9
|
+
const n = {
|
|
10
|
+
xs: { root: "px-2 py-[5px] text-xs rounded-md", segment: "text-xs" },
|
|
11
|
+
sm: { root: "px-2 py-1.5 text-sm rounded-md", segment: "text-sm" },
|
|
12
|
+
md: { root: "px-2.5 py-2.5 text-md", segment: "text-sm" }
|
|
13
|
+
}, u = ({ size: r = "xs", ...e }) => /* @__PURE__ */ o(
|
|
14
|
+
i,
|
|
11
15
|
{
|
|
12
16
|
...e,
|
|
13
|
-
className:
|
|
17
|
+
className: s(
|
|
14
18
|
"flex rounded-lg bg-primary shadow-xs ring-1 ring-secondary ring-inset focus-within:ring-2 focus-within:ring-brand",
|
|
15
|
-
r
|
|
19
|
+
n[r].root,
|
|
16
20
|
typeof e.className == "string" && e.className
|
|
17
21
|
),
|
|
18
|
-
children: (t) => /* @__PURE__ */
|
|
19
|
-
|
|
22
|
+
children: (t) => /* @__PURE__ */ o(
|
|
23
|
+
d,
|
|
20
24
|
{
|
|
21
25
|
segment: t,
|
|
22
|
-
className:
|
|
26
|
+
className: s(
|
|
23
27
|
"rounded px-0.5 text-primary caret-transparent focus:bg-brand-solid focus:font-medium focus:text-white focus:outline-hidden",
|
|
24
|
-
r
|
|
28
|
+
n[r].segment,
|
|
25
29
|
// The placeholder segment.
|
|
26
30
|
t.isPlaceholder && "text-placeholder uppercase",
|
|
27
31
|
// The separator "/" segment.
|
|
@@ -29,11 +33,11 @@ const p = ({ size: r = "md", ...e }) => /* @__PURE__ */ a(
|
|
|
29
33
|
// "pm" rather than "PM", matching the time list.
|
|
30
34
|
t.type === "dayPeriod" && !t.isPlaceholder && "lowercase"
|
|
31
35
|
),
|
|
32
|
-
children:
|
|
36
|
+
children: x(t)
|
|
33
37
|
}
|
|
34
38
|
)
|
|
35
39
|
}
|
|
36
40
|
);
|
|
37
41
|
export {
|
|
38
|
-
|
|
42
|
+
u as DateInput
|
|
39
43
|
};
|
|
@@ -20,7 +20,10 @@ declare const sizes: {
|
|
|
20
20
|
};
|
|
21
21
|
export type DatePickerSize = keyof typeof sizes;
|
|
22
22
|
export interface DatePickerProps extends AriaDatePickerProps<DateValue> {
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Size of the trigger and of everything in the popover (calendar, inputs, footer buttons).
|
|
25
|
+
* "xs" (28px days, 12px text), "sm" (36px days, 14px text) or "md" (40px days). Defaults to "xs".
|
|
26
|
+
*/
|
|
24
27
|
size?: DatePickerSize;
|
|
25
28
|
/** The function to call when the apply button is clicked. */
|
|
26
29
|
onApply?: (value?: DateValue) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/date-picker.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EACV,eAAe,IAAI,mBAAmB,EACtC,SAAS,EACT,SAAS,EACV,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/date-picker.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EACV,eAAe,IAAI,mBAAmB,EACtC,SAAS,EACT,SAAS,EACV,MAAM,uBAAuB,CAAC;AAuB/B,mFAAmF;AACnF,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;CAIA,CAAC;AAEZ,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,KAAK,CAAC;AAEhD,MAAM,WAAW,eAAgB,SAAQ,mBAAmB,CAAC,SAAS,CAAC;IACrE;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,SAAS,KAAK,IAAI,CAAC;IACtC,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,iEAAiE;IACjE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kFAAkF;IAClF,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uGAAuG;IACvG,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB;AAiCD,eAAO,MAAM,UAAU,GAAI,oRAsBxB,eAAe,4CA+PjB,CAAC"}
|
|
@@ -1,118 +1,122 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { getLocalTimeZone as
|
|
3
|
-
import { useControlledState as
|
|
4
|
-
import { Calendar as $, XClose as
|
|
5
|
-
import { useState as
|
|
6
|
-
import { useDateFormatter as
|
|
7
|
-
import { DatePicker as
|
|
8
|
-
import { cx as r, sortCx as
|
|
9
|
-
import { ControlledCalendarContextProvider as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { DateTimeCalendar as
|
|
12
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as u, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { getLocalTimeZone as F, toCalendarDateTime as ee, today as te } from "@internationalized/date";
|
|
3
|
+
import { useControlledState as oe } from "@react-stately/utils";
|
|
4
|
+
import { Calendar as $, XClose as ne } from "@untitledui/icons";
|
|
5
|
+
import { useState as re, useCallback as ie, useEffect as le } from "react";
|
|
6
|
+
import { useDateFormatter as ae, I18nProvider as se } from "react-aria";
|
|
7
|
+
import { DatePicker as de, Group as ce, ButtonContext as me, Popover as ue, Dialog as he } from "react-aria-components";
|
|
8
|
+
import { cx as r, sortCx as fe } from "../../utils/cn.js";
|
|
9
|
+
import { ControlledCalendarContextProvider as pe, Calendar as q } from "./calendar.js";
|
|
10
|
+
import { Button as y } from "../../primitives/button/button.js";
|
|
11
|
+
import { DateTimeCalendar as ge } from "./date-time-calendar.js";
|
|
12
|
+
const S = [te(F())], E = {
|
|
13
|
+
xs: "py-[5px]",
|
|
14
|
+
sm: "py-1.5",
|
|
15
|
+
md: void 0
|
|
16
|
+
}, d = fe({
|
|
13
17
|
xs: { button: "xs", text: "text-xs", icon: "size-3!" },
|
|
14
18
|
sm: { button: "xs", text: "text-sm", icon: "size-3.5!" },
|
|
15
19
|
md: { button: "sm", text: "text-md", icon: "size-4!" }
|
|
16
|
-
}),
|
|
17
|
-
function
|
|
20
|
+
}), ye = (t) => t === "hour" || t === "minute" || t === "second", k = (t) => t && !("hour" in t) ? ee(t) : t;
|
|
21
|
+
function xe({
|
|
18
22
|
committedValue: t,
|
|
19
|
-
onSync:
|
|
23
|
+
onSync: x
|
|
20
24
|
}) {
|
|
21
|
-
return
|
|
22
|
-
|
|
25
|
+
return le(() => {
|
|
26
|
+
x(t);
|
|
23
27
|
}, []), null;
|
|
24
28
|
}
|
|
25
|
-
const
|
|
29
|
+
const Te = ({
|
|
26
30
|
value: t,
|
|
27
|
-
defaultValue:
|
|
28
|
-
onChange:
|
|
31
|
+
defaultValue: x,
|
|
32
|
+
onChange: I,
|
|
29
33
|
onApply: b,
|
|
30
|
-
onCancel:
|
|
34
|
+
onCancel: v,
|
|
31
35
|
className: C,
|
|
32
|
-
showFooter:
|
|
33
|
-
triggerClassName:
|
|
34
|
-
clearable:
|
|
35
|
-
endAdornment:
|
|
36
|
+
showFooter: w = !0,
|
|
37
|
+
triggerClassName: z,
|
|
38
|
+
clearable: U = !1,
|
|
39
|
+
endAdornment: N,
|
|
36
40
|
isDisabled: O,
|
|
37
41
|
size: i = "xs",
|
|
38
|
-
granularity:
|
|
42
|
+
granularity: h,
|
|
39
43
|
minValue: T,
|
|
40
44
|
maxValue: V,
|
|
41
45
|
isDateUnavailable: j,
|
|
42
|
-
firstDayOfWeek:
|
|
43
|
-
hourCycle:
|
|
44
|
-
timeStep:
|
|
45
|
-
defaultTime:
|
|
46
|
-
...
|
|
46
|
+
firstDayOfWeek: _,
|
|
47
|
+
hourCycle: X,
|
|
48
|
+
timeStep: Z,
|
|
49
|
+
defaultTime: H,
|
|
50
|
+
...B
|
|
47
51
|
}) => {
|
|
48
|
-
const
|
|
52
|
+
const l = ye(h), n = i, G = {
|
|
49
53
|
minValue: T,
|
|
50
54
|
maxValue: V,
|
|
51
55
|
isDateUnavailable: j,
|
|
52
|
-
firstDayOfWeek:
|
|
53
|
-
isReadOnly:
|
|
54
|
-
},
|
|
56
|
+
firstDayOfWeek: _,
|
|
57
|
+
isReadOnly: B.isReadOnly
|
|
58
|
+
}, f = X ?? (l ? 12 : void 0), J = ae({
|
|
55
59
|
month: "short",
|
|
56
60
|
day: "numeric",
|
|
57
61
|
year: "numeric",
|
|
58
|
-
...
|
|
62
|
+
...l && {
|
|
59
63
|
hour: "numeric",
|
|
60
64
|
minute: "2-digit",
|
|
61
|
-
second:
|
|
62
|
-
hourCycle:
|
|
65
|
+
second: h === "second" ? "2-digit" : void 0,
|
|
66
|
+
hourCycle: f === 24 ? "h23" : f === 12 ? "h12" : void 0
|
|
63
67
|
}
|
|
64
|
-
}), [
|
|
68
|
+
}), [c, m] = oe(
|
|
65
69
|
t,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
), D =
|
|
70
|
+
x || null,
|
|
71
|
+
I
|
|
72
|
+
), D = c ?? null, [p, P] = re(
|
|
69
73
|
D
|
|
70
|
-
), o =
|
|
71
|
-
} :
|
|
72
|
-
o && (
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
}, [
|
|
76
|
-
return /* @__PURE__ */ e(
|
|
77
|
-
|
|
74
|
+
), o = w, a = o ? D : c, K = o ? () => {
|
|
75
|
+
} : m, L = a ? J.format(a.toDate(F())) : l ? "Select date and time" : "Select date", g = typeof C == "string" && C.includes("w-full"), Q = (s) => {
|
|
76
|
+
o && (m(p), b == null || b(p ?? void 0)), s();
|
|
77
|
+
}, W = ie(() => {
|
|
78
|
+
m(null);
|
|
79
|
+
}, [m]), M = U && D != null && !O, R = N ? "pr-8" : void 0;
|
|
80
|
+
return /* @__PURE__ */ e(se, { locale: "en-US", children: /* @__PURE__ */ u(
|
|
81
|
+
de,
|
|
78
82
|
{
|
|
79
|
-
shouldCloseOnSelect: !
|
|
80
|
-
...
|
|
83
|
+
shouldCloseOnSelect: !w && !l,
|
|
84
|
+
...B,
|
|
81
85
|
minValue: T,
|
|
82
86
|
maxValue: V,
|
|
83
87
|
isDateUnavailable: j,
|
|
84
|
-
firstDayOfWeek:
|
|
85
|
-
granularity:
|
|
86
|
-
hourCycle:
|
|
88
|
+
firstDayOfWeek: _,
|
|
89
|
+
granularity: h,
|
|
90
|
+
hourCycle: f,
|
|
87
91
|
isDisabled: O,
|
|
88
92
|
className: C,
|
|
89
|
-
value:
|
|
90
|
-
onChange:
|
|
93
|
+
value: l ? k(o ? a : c) : o ? a : c,
|
|
94
|
+
onChange: K,
|
|
91
95
|
children: [
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
M ? /* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ u(ce, { className: r("relative", g && "w-full"), children: [
|
|
97
|
+
M ? /* @__PURE__ */ u(
|
|
94
98
|
"div",
|
|
95
99
|
{
|
|
96
100
|
className: r(
|
|
97
101
|
"flex min-w-0 overflow-hidden rounded-md bg-primary ring-1 ring-secondary ring-inset border border-secondary",
|
|
98
|
-
|
|
102
|
+
g && "w-full"
|
|
99
103
|
),
|
|
100
104
|
children: [
|
|
101
105
|
/* @__PURE__ */ e(
|
|
102
|
-
|
|
106
|
+
y,
|
|
103
107
|
{
|
|
104
|
-
size:
|
|
108
|
+
size: d[i].button,
|
|
105
109
|
color: "secondary",
|
|
106
110
|
iconLeading: $,
|
|
107
111
|
className: r(
|
|
108
112
|
"min-w-0 flex-1 rounded-none ring-0 shadow-none",
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
d[i].text,
|
|
114
|
+
g && "justify-start",
|
|
111
115
|
R,
|
|
112
|
-
|
|
116
|
+
z
|
|
113
117
|
),
|
|
114
|
-
leadingClassName:
|
|
115
|
-
children:
|
|
118
|
+
leadingClassName: d[i].icon,
|
|
119
|
+
children: L
|
|
116
120
|
}
|
|
117
121
|
),
|
|
118
122
|
/* @__PURE__ */ e(
|
|
@@ -120,107 +124,123 @@ const Oe = ({
|
|
|
120
124
|
{
|
|
121
125
|
type: "button",
|
|
122
126
|
"aria-label": "Clear date",
|
|
123
|
-
onClick:
|
|
127
|
+
onClick: W,
|
|
124
128
|
className: r(
|
|
125
129
|
"flex w-9 shrink-0 items-center justify-center bg-primary text-fg-quaternary",
|
|
126
130
|
"transition-colors hover:bg-primary_hover hover:text-secondary",
|
|
127
131
|
"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-inset"
|
|
128
132
|
),
|
|
129
|
-
children: /* @__PURE__ */ e(
|
|
133
|
+
children: /* @__PURE__ */ e(ne, { "aria-hidden": !0, className: "size-4 shrink-0" })
|
|
130
134
|
}
|
|
131
135
|
)
|
|
132
136
|
]
|
|
133
137
|
}
|
|
134
138
|
) : /* @__PURE__ */ e(
|
|
135
|
-
|
|
139
|
+
y,
|
|
136
140
|
{
|
|
137
|
-
size:
|
|
141
|
+
size: d[i].button,
|
|
138
142
|
color: "secondary",
|
|
139
143
|
iconLeading: $,
|
|
140
144
|
className: r(
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
d[i].text,
|
|
146
|
+
g && "w-full min-w-0 justify-start",
|
|
143
147
|
R,
|
|
144
|
-
|
|
148
|
+
z
|
|
145
149
|
),
|
|
146
|
-
leadingClassName:
|
|
147
|
-
children:
|
|
150
|
+
leadingClassName: d[i].icon,
|
|
151
|
+
children: L
|
|
148
152
|
}
|
|
149
153
|
),
|
|
150
|
-
|
|
154
|
+
N ? /* @__PURE__ */ e(me.Provider, { value: null, children: /* @__PURE__ */ e(
|
|
151
155
|
"div",
|
|
152
156
|
{
|
|
153
157
|
className: r(
|
|
154
158
|
"absolute top-1/2 z-10 -translate-y-1/2",
|
|
155
159
|
M ? "right-9" : "right-1"
|
|
156
160
|
),
|
|
157
|
-
children:
|
|
161
|
+
children: N
|
|
158
162
|
}
|
|
159
163
|
) }) : null
|
|
160
164
|
] }),
|
|
161
165
|
/* @__PURE__ */ e(
|
|
162
|
-
|
|
166
|
+
ue,
|
|
163
167
|
{
|
|
164
168
|
offset: 8,
|
|
165
169
|
placement: "bottom right",
|
|
166
|
-
containerPadding:
|
|
167
|
-
className: ({ isEntering:
|
|
168
|
-
"origin-(--trigger-anchor-point) will-change-transform overflow-y-auto",
|
|
169
|
-
|
|
170
|
-
|
|
170
|
+
containerPadding: 8,
|
|
171
|
+
className: ({ isEntering: s, isExiting: Y }) => r(
|
|
172
|
+
"origin-(--trigger-anchor-point) will-change-transform overflow-y-auto rounded-2xl border border-secondary bg-primary shadow-[0_0_24px_rgba(10,13,18,0.12)]",
|
|
173
|
+
s && "duration-150 ease-out animate-in fade-in placement-right:slide-in-from-left-0.5 placement-top:slide-in-from-bottom-0.5 placement-bottom:slide-in-from-top-0.5",
|
|
174
|
+
Y && "duration-100 ease-in animate-out fade-out placement-right:slide-out-to-left-0.5 placement-top:slide-out-to-bottom-0.5 placement-bottom:slide-out-to-top-0.5"
|
|
171
175
|
),
|
|
172
|
-
children: /* @__PURE__ */ e(
|
|
176
|
+
children: /* @__PURE__ */ e(he, { className: "rounded-2xl outline-hidden", children: ({ close: s }) => /* @__PURE__ */ u(A, { children: [
|
|
173
177
|
o && /* @__PURE__ */ e(
|
|
174
|
-
|
|
178
|
+
xe,
|
|
175
179
|
{
|
|
176
|
-
committedValue:
|
|
177
|
-
onSync:
|
|
180
|
+
committedValue: l ? k(a) ?? null : a,
|
|
181
|
+
onSync: P
|
|
178
182
|
}
|
|
179
183
|
),
|
|
180
|
-
/* @__PURE__ */ e(
|
|
181
|
-
|
|
184
|
+
/* @__PURE__ */ e(
|
|
185
|
+
"div",
|
|
182
186
|
{
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
187
|
+
className: r("flex", n === "md" ? "p-5" : "p-4"),
|
|
188
|
+
children: l ? /* @__PURE__ */ e(
|
|
189
|
+
ge,
|
|
190
|
+
{
|
|
191
|
+
value: o ? p : k(c) ?? null,
|
|
192
|
+
onChange: o ? P : m,
|
|
193
|
+
...G,
|
|
194
|
+
highlightedDates: S,
|
|
195
|
+
timeStep: Z,
|
|
196
|
+
hourCycle: f,
|
|
197
|
+
timeGranularity: h,
|
|
198
|
+
defaultTime: H,
|
|
199
|
+
size: n
|
|
200
|
+
}
|
|
201
|
+
) : o ? /* @__PURE__ */ e(
|
|
202
|
+
pe,
|
|
203
|
+
{
|
|
204
|
+
value: p,
|
|
205
|
+
onChange: P,
|
|
206
|
+
children: /* @__PURE__ */ e(
|
|
207
|
+
q,
|
|
208
|
+
{
|
|
209
|
+
...G,
|
|
210
|
+
highlightedDates: S,
|
|
211
|
+
size: n
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
) : /* @__PURE__ */ e(
|
|
198
216
|
q,
|
|
199
217
|
{
|
|
200
|
-
|
|
201
|
-
|
|
218
|
+
highlightedDates: S,
|
|
219
|
+
size: n
|
|
202
220
|
}
|
|
203
221
|
)
|
|
204
222
|
}
|
|
205
|
-
)
|
|
206
|
-
|
|
223
|
+
),
|
|
224
|
+
w && /* @__PURE__ */ u("div", { className: "grid grid-cols-2 gap-2 border-t border-secondary px-4 py-3", children: [
|
|
207
225
|
/* @__PURE__ */ e(
|
|
208
|
-
|
|
226
|
+
y,
|
|
209
227
|
{
|
|
210
|
-
size:
|
|
228
|
+
size: n,
|
|
229
|
+
className: E[n],
|
|
211
230
|
color: "secondary",
|
|
212
231
|
onClick: () => {
|
|
213
|
-
|
|
232
|
+
v == null || v(), s();
|
|
214
233
|
},
|
|
215
234
|
children: "Cancel"
|
|
216
235
|
}
|
|
217
236
|
),
|
|
218
237
|
/* @__PURE__ */ e(
|
|
219
|
-
|
|
238
|
+
y,
|
|
220
239
|
{
|
|
221
|
-
size:
|
|
240
|
+
size: n,
|
|
241
|
+
className: E[n],
|
|
222
242
|
color: "primary",
|
|
223
|
-
onClick: () =>
|
|
243
|
+
onClick: () => Q(s),
|
|
224
244
|
children: "Apply"
|
|
225
245
|
}
|
|
226
246
|
)
|
|
@@ -233,5 +253,5 @@ const Oe = ({
|
|
|
233
253
|
) });
|
|
234
254
|
};
|
|
235
255
|
export {
|
|
236
|
-
|
|
256
|
+
Te as DatePicker
|
|
237
257
|
};
|
|
@@ -36,6 +36,10 @@ export interface DateRangePickerProps extends AriaDateRangePickerProps<DateValue
|
|
|
36
36
|
endTime: string;
|
|
37
37
|
}) => void;
|
|
38
38
|
showFieldDropdown?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Size of the trigger and of everything in the popover (calendars, presets, inputs, footer buttons).
|
|
41
|
+
* "xs" (28px days, 12px text), "sm" (36px days, 14px text), "md" or "lg" (40px days). Defaults to "xs".
|
|
42
|
+
*/
|
|
39
43
|
size?: "xs" | "sm" | "md" | "lg";
|
|
40
44
|
buttonClassName?: string;
|
|
41
45
|
iconClassName?: string;
|