@pibit.ai/cure-design-system 0.6.3 → 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/patterns/table/TableWrapper.d.ts.map +1 -1
- package/dist/patterns/table/TableWrapper.js +454 -449
- package/dist/patterns/table/integrateTableUndoRedo.d.ts +6 -2
- package/dist/patterns/table/integrateTableUndoRedo.d.ts.map +1 -1
- package/dist/patterns/table/integrateTableUndoRedo.js +19 -15
- package/dist/patterns/table/storyHelpers/useMockTableState.d.ts +1 -0
- package/dist/patterns/table/storyHelpers/useMockTableState.d.ts.map +1 -1
- package/dist/patterns/table/tableUndoRedo.d.ts +4 -0
- package/dist/patterns/table/tableUndoRedo.d.ts.map +1 -1
- package/dist/patterns/table/tableUndoRedo.js +47 -37
- package/dist/patterns/table/tableUndoRedo.test.d.ts +2 -0
- package/dist/patterns/table/tableUndoRedo.test.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts +9 -0
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.js +123 -110
- package/dist/patterns/table/types.d.ts +5 -0
- package/dist/patterns/table/types.d.ts.map +1 -1
- package/dist/patterns/table/useTableUndoRedo.d.ts +1 -1
- package/dist/patterns/table/useTableUndoRedo.d.ts.map +1 -1
- package/dist/patterns/table/useTableUndoRedo.js +179 -165
- 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,128 +1,138 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { useState as y, useMemo as
|
|
3
|
-
import { Time as w, toCalendarDateTime as
|
|
4
|
-
import { CalendarCheck01 as
|
|
5
|
-
import { CalendarContext as
|
|
6
|
-
import { cx as
|
|
7
|
-
import { CalendarMonthYearHeader as
|
|
1
|
+
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as y, useMemo as I, useRef as j, useEffect as L, useContext as M } from "react";
|
|
3
|
+
import { Time as w, toCalendarDateTime as P } from "@internationalized/date";
|
|
4
|
+
import { CalendarCheck01 as q } from "@untitledui/icons";
|
|
5
|
+
import { CalendarContext as E, Calendar as G, TimeField as H, CalendarStateContext as X, DateField as Y } from "react-aria-components";
|
|
6
|
+
import { cx as a } from "../../utils/cn.js";
|
|
7
|
+
import { CalendarMonthYearHeader as A, CalendarDayGrid as B } from "./calendar.js";
|
|
8
8
|
import { DateInput as N } from "./date-input.js";
|
|
9
9
|
import { toSingleDate as R } from "./calendar-value.js";
|
|
10
|
-
import { TimeList as
|
|
10
|
+
import { TimeList as J } from "./time-list.js";
|
|
11
|
+
import { dateInputSizeFor as b } from "./sizes.js";
|
|
11
12
|
const h = (e) => new w(e.hour, e.minute, e.second), T = (e, n) => {
|
|
12
|
-
const
|
|
13
|
+
const t = {
|
|
13
14
|
hour: n.hour,
|
|
14
15
|
minute: n.minute,
|
|
15
16
|
second: n.second,
|
|
16
17
|
millisecond: 0
|
|
17
18
|
};
|
|
18
|
-
return "hour" in e ? e.set(
|
|
19
|
-
},
|
|
20
|
-
const n =
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
|
|
19
|
+
return "hour" in e ? e.set(t) : P(e, h(n));
|
|
20
|
+
}, K = (e, n) => e === n || !!e && !!n && e.year === n.year && e.month === n.month && e.day === n.day && e.era === n.era, Q = ({ size: e }) => {
|
|
21
|
+
const n = M(X);
|
|
22
|
+
return /* @__PURE__ */ m(
|
|
23
|
+
Y,
|
|
23
24
|
{
|
|
24
25
|
"aria-label": "Date",
|
|
25
26
|
granularity: "day",
|
|
26
27
|
isDisabled: n == null ? void 0 : n.isDisabled,
|
|
27
28
|
isReadOnly: n == null ? void 0 : n.isReadOnly,
|
|
28
29
|
value: R(n == null ? void 0 : n.value),
|
|
29
|
-
onChange: (
|
|
30
|
+
onChange: (t) => n == null ? void 0 : n.setValue(t),
|
|
30
31
|
className: "relative min-w-0 flex-1",
|
|
31
32
|
children: [
|
|
32
|
-
/* @__PURE__ */ r(N, { className: "w-full pr-9", size: e === "xs" ? "sm" : "md" }),
|
|
33
33
|
/* @__PURE__ */ r(
|
|
34
|
-
|
|
34
|
+
N,
|
|
35
|
+
{
|
|
36
|
+
className: a("w-full", e === "xs" ? "pr-8" : "pr-9"),
|
|
37
|
+
size: b(e)
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ r(
|
|
41
|
+
q,
|
|
35
42
|
{
|
|
36
43
|
"aria-hidden": "true",
|
|
37
|
-
className:
|
|
44
|
+
className: a(
|
|
45
|
+
"pointer-events-none absolute top-1/2 -translate-y-1/2 text-fg-quaternary",
|
|
46
|
+
e === "xs" ? "right-2.5 size-3.5" : "right-3 size-4"
|
|
47
|
+
)
|
|
38
48
|
}
|
|
39
49
|
)
|
|
40
50
|
]
|
|
41
51
|
}
|
|
42
52
|
);
|
|
43
|
-
},
|
|
53
|
+
}, ae = ({
|
|
44
54
|
value: e,
|
|
45
55
|
onChange: n,
|
|
46
|
-
highlightedDates:
|
|
47
|
-
timeStep:
|
|
56
|
+
highlightedDates: t,
|
|
57
|
+
timeStep: F = 30,
|
|
48
58
|
hourCycle: p,
|
|
49
59
|
timeGranularity: O = "minute",
|
|
50
|
-
defaultTime:
|
|
51
|
-
size:
|
|
60
|
+
defaultTime: S,
|
|
61
|
+
size: s = "xs",
|
|
52
62
|
className: c,
|
|
53
|
-
...
|
|
63
|
+
...o
|
|
54
64
|
}) => {
|
|
55
|
-
const
|
|
65
|
+
const l = s === "xs", u = !!o.isDisabled || !!o.isReadOnly, [V, f] = y(
|
|
56
66
|
e ?? void 0
|
|
57
|
-
), [g,
|
|
67
|
+
), [g, x] = y(null), d = I(
|
|
58
68
|
() => e && "hour" in e ? h(e) : g,
|
|
59
69
|
[g, e]
|
|
60
|
-
),
|
|
61
|
-
|
|
62
|
-
!
|
|
70
|
+
), C = j(e);
|
|
71
|
+
L(() => {
|
|
72
|
+
!K(C.current, e) && e && f(e), C.current = e;
|
|
63
73
|
}, [e]);
|
|
64
|
-
const
|
|
74
|
+
const k = (i) => {
|
|
65
75
|
if (!u) {
|
|
66
76
|
if (!i) {
|
|
67
|
-
|
|
77
|
+
x(d), n(null);
|
|
68
78
|
return;
|
|
69
79
|
}
|
|
70
|
-
f(i), n(T(i,
|
|
80
|
+
f(i), n(T(i, d ?? S ?? new w()));
|
|
71
81
|
}
|
|
72
|
-
},
|
|
82
|
+
}, D = (i) => {
|
|
73
83
|
if (!(u || !i)) {
|
|
74
84
|
if (!e) {
|
|
75
|
-
|
|
85
|
+
x(h(i));
|
|
76
86
|
return;
|
|
77
87
|
}
|
|
78
88
|
n(T(e, i));
|
|
79
89
|
}
|
|
80
90
|
};
|
|
81
91
|
return /* @__PURE__ */ r(
|
|
82
|
-
|
|
92
|
+
E.Provider,
|
|
83
93
|
{
|
|
84
94
|
value: {
|
|
85
95
|
value: e,
|
|
86
|
-
onChange: (i) =>
|
|
87
|
-
focusedValue:
|
|
96
|
+
onChange: (i) => k(R(i)),
|
|
97
|
+
focusedValue: V,
|
|
88
98
|
onFocusChange: f
|
|
89
99
|
},
|
|
90
|
-
children: /* @__PURE__ */
|
|
91
|
-
|
|
100
|
+
children: /* @__PURE__ */ m(
|
|
101
|
+
G,
|
|
92
102
|
{
|
|
93
|
-
...
|
|
94
|
-
className: (i) =>
|
|
103
|
+
...o,
|
|
104
|
+
className: (i) => a(
|
|
95
105
|
"flex w-max flex-col",
|
|
96
|
-
|
|
106
|
+
l ? "gap-2" : "gap-3",
|
|
97
107
|
typeof c == "function" ? c(i) : c
|
|
98
108
|
),
|
|
99
109
|
children: [
|
|
100
|
-
/* @__PURE__ */ r(
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */ r(
|
|
110
|
+
/* @__PURE__ */ r(A, { size: s }),
|
|
111
|
+
/* @__PURE__ */ m("div", { className: a("flex", l ? "gap-2" : "gap-3"), children: [
|
|
112
|
+
/* @__PURE__ */ r(Q, { size: s }),
|
|
103
113
|
/* @__PURE__ */ r(
|
|
104
|
-
|
|
114
|
+
H,
|
|
105
115
|
{
|
|
106
116
|
"aria-label": "Time",
|
|
107
|
-
value:
|
|
108
|
-
onChange:
|
|
117
|
+
value: d,
|
|
118
|
+
onChange: D,
|
|
109
119
|
hourCycle: p,
|
|
110
120
|
granularity: O,
|
|
111
|
-
isDisabled:
|
|
112
|
-
isReadOnly:
|
|
113
|
-
className:
|
|
114
|
-
children: /* @__PURE__ */ r(N, { className: "w-full", size:
|
|
121
|
+
isDisabled: o.isDisabled,
|
|
122
|
+
isReadOnly: o.isReadOnly,
|
|
123
|
+
className: l ? "w-24" : "w-30",
|
|
124
|
+
children: /* @__PURE__ */ r(N, { className: "w-full", size: b(s) })
|
|
115
125
|
}
|
|
116
126
|
)
|
|
117
127
|
] }),
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
/* @__PURE__ */ r(
|
|
120
|
-
/* @__PURE__ */ r("div", { className:
|
|
121
|
-
|
|
128
|
+
/* @__PURE__ */ m("div", { className: a("flex", l ? "gap-2" : "gap-3"), children: [
|
|
129
|
+
/* @__PURE__ */ r(B, { highlightedDates: t, size: s }),
|
|
130
|
+
/* @__PURE__ */ r("div", { className: a("relative shrink-0", l ? "w-24" : "w-30"), children: /* @__PURE__ */ r(
|
|
131
|
+
J,
|
|
122
132
|
{
|
|
123
|
-
value:
|
|
124
|
-
onChange:
|
|
125
|
-
step:
|
|
133
|
+
value: d,
|
|
134
|
+
onChange: D,
|
|
135
|
+
step: F,
|
|
126
136
|
hourCycle: p,
|
|
127
137
|
isDisabled: u,
|
|
128
138
|
className: "absolute inset-0 pr-1"
|
|
@@ -136,6 +146,6 @@ const h = (e) => new w(e.hour, e.minute, e.second), T = (e, n) => {
|
|
|
136
146
|
);
|
|
137
147
|
};
|
|
138
148
|
export {
|
|
139
|
-
|
|
149
|
+
ae as DateTimeCalendar,
|
|
140
150
|
T as withTime
|
|
141
151
|
};
|
|
@@ -14,7 +14,7 @@ export interface RangeCalendarProps extends AriaRangeCalendarProps<DateValue> {
|
|
|
14
14
|
};
|
|
15
15
|
}>;
|
|
16
16
|
containerClassName?: string;
|
|
17
|
-
/** Visual size: "xs" (compact) or "sm"
|
|
17
|
+
/** Visual size: "xs" (compact, default) or "sm". */
|
|
18
18
|
size?: CalendarSize;
|
|
19
19
|
/** Drops the horizontal padding on the calendars' outer edges, for containers that supply their own padding. */
|
|
20
20
|
flushEdges?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-calendar.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/range-calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK/D,OAAO,KAAK,EACV,kBAAkB,IAAI,sBAAsB,EAC5C,SAAS,EACV,MAAM,uBAAuB,CAAC;AAY/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"range-calendar.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/range-calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK/D,OAAO,KAAK,EACV,kBAAkB,IAAI,sBAAsB,EAC5C,SAAS,EACV,MAAM,uBAAuB,CAAC;AAY/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAO/C,eAAO,MAAM,4BAA4B,GAAI,eAE1C,iBAAiB,4CAcnB,CAAC;AAgDF,MAAM,WAAW,kBAAmB,SAAQ,sBAAsB,CAAC,SAAS,CAAC;IAC3E,8BAA8B;IAC9B,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC;IAC/B,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,CACd,MAAM,EACN;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE;YAAE,KAAK,EAAE,SAAS,CAAC;YAAC,GAAG,EAAE,SAAS,CAAA;SAAE,CAAA;KAAE,CAC/D,CAAC;IACF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oDAAoD;IACpD,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,gHAAgH;IAChH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,GAAI,6DAM3B,kBAAkB,4CAuKpB,CAAC"}
|
|
@@ -1,89 +1,90 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { Fragment as
|
|
3
|
-
import { ChevronLeft as
|
|
4
|
-
import { useDateFormatter as
|
|
5
|
-
import { useSlottedContext as
|
|
6
|
-
import { useBreakpoint as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
1
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as D, useState as f, useContext as j } from "react";
|
|
3
|
+
import { ChevronLeft as S, ChevronRight as p } from "@untitledui/icons";
|
|
4
|
+
import { useDateFormatter as k } from "react-aria";
|
|
5
|
+
import { useSlottedContext as B, RangeCalendarContext as w, RangeCalendar as F, CalendarGrid as h, CalendarGridHeader as u, CalendarHeaderCell as b, CalendarGridBody as g, RangeCalendarStateContext as _ } from "react-aria-components";
|
|
6
|
+
import { useBreakpoint as G } from "../../hooks/use-breakpoint.js";
|
|
7
|
+
import { dateInputSizeFor as y, rangeGridMinHeights as H, dayBoxSizes as C } from "./sizes.js";
|
|
8
|
+
import { CalendarCell as N } from "./cell.js";
|
|
9
|
+
import { DateInput as v } from "./date-input.js";
|
|
10
|
+
import { cx as o } from "../../utils/cn.js";
|
|
11
|
+
import { Button as c } from "../../primitives/button/button.js";
|
|
12
|
+
const L = ({
|
|
12
13
|
children: l
|
|
13
14
|
}) => {
|
|
14
|
-
const [
|
|
15
|
+
const [r, t] = f(null), [s, m] = f();
|
|
15
16
|
return /* @__PURE__ */ e(
|
|
16
|
-
|
|
17
|
+
w.Provider,
|
|
17
18
|
{
|
|
18
|
-
value: { value:
|
|
19
|
+
value: { value: r, onChange: t, focusedValue: s, onFocusChange: m },
|
|
19
20
|
children: l
|
|
20
21
|
}
|
|
21
22
|
);
|
|
22
|
-
},
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
23
|
+
}, R = ({ part: l }) => {
|
|
24
|
+
const r = j(_);
|
|
25
|
+
if (!r)
|
|
25
26
|
throw new Error(
|
|
26
27
|
"<RangeCalendarTitle /> must be used within a <RangeCalendar /> component."
|
|
27
28
|
);
|
|
28
|
-
const
|
|
29
|
+
const t = k({
|
|
29
30
|
month: "long",
|
|
30
31
|
year: "numeric",
|
|
31
|
-
calendar:
|
|
32
|
-
timeZone:
|
|
32
|
+
calendar: r.visibleRange.start.calendar.identifier,
|
|
33
|
+
timeZone: r.timeZone
|
|
33
34
|
});
|
|
34
|
-
return l === "start" ?
|
|
35
|
-
},
|
|
35
|
+
return l === "start" ? t.format(r.visibleRange.start.toDate(r.timeZone)) : t.format(r.visibleRange.end.toDate(r.timeZone));
|
|
36
|
+
}, Z = ({
|
|
36
37
|
value: l,
|
|
37
|
-
children:
|
|
38
|
-
...
|
|
38
|
+
children: r,
|
|
39
|
+
...t
|
|
39
40
|
}) => {
|
|
40
|
-
const
|
|
41
|
+
const s = j(_);
|
|
41
42
|
return /* @__PURE__ */ e(
|
|
42
|
-
|
|
43
|
+
c,
|
|
43
44
|
{
|
|
44
|
-
...
|
|
45
|
+
...t,
|
|
45
46
|
slot: null,
|
|
46
|
-
size: "
|
|
47
|
+
size: "xs",
|
|
47
48
|
color: "link-color",
|
|
48
49
|
onClick: () => {
|
|
49
|
-
|
|
50
|
+
s == null || s.setValue(l), s == null || s.setFocusedDate(l.start);
|
|
50
51
|
},
|
|
51
|
-
children:
|
|
52
|
+
children: r
|
|
52
53
|
}
|
|
53
54
|
);
|
|
54
|
-
},
|
|
55
|
+
}, J = ({
|
|
55
56
|
presets: l,
|
|
56
|
-
containerClassName:
|
|
57
|
-
size:
|
|
58
|
-
flushEdges:
|
|
59
|
-
...
|
|
57
|
+
containerClassName: r,
|
|
58
|
+
size: t = "xs",
|
|
59
|
+
flushEdges: s = !1,
|
|
60
|
+
...m
|
|
60
61
|
}) => {
|
|
61
|
-
const d =
|
|
62
|
-
return /* @__PURE__ */ e(
|
|
63
|
-
|
|
62
|
+
const d = G("md"), z = B(w), a = t === "xs", x = H[t];
|
|
63
|
+
return /* @__PURE__ */ e(z ? D : L, { children: /* @__PURE__ */ i(
|
|
64
|
+
F,
|
|
64
65
|
{
|
|
65
|
-
className:
|
|
66
|
+
className: o("flex items-start", r),
|
|
66
67
|
visibleDuration: {
|
|
67
68
|
months: d ? 2 : 1
|
|
68
69
|
},
|
|
69
|
-
...
|
|
70
|
+
...m,
|
|
70
71
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ i(
|
|
72
73
|
"div",
|
|
73
74
|
{
|
|
74
|
-
className:
|
|
75
|
-
"flex flex-col py-1",
|
|
76
|
-
a ? "gap-2 px-
|
|
77
|
-
|
|
75
|
+
className: o(
|
|
76
|
+
"flex flex-1 flex-col py-1",
|
|
77
|
+
a ? "gap-2 px-3" : "gap-3 px-4",
|
|
78
|
+
s && (d ? "pl-0" : "px-0")
|
|
78
79
|
),
|
|
79
80
|
children: [
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ i("header", { className: "relative flex items-center justify-between md:justify-start", children: [
|
|
81
82
|
/* @__PURE__ */ e(
|
|
82
|
-
|
|
83
|
+
c,
|
|
83
84
|
{
|
|
84
85
|
slot: "previous",
|
|
85
|
-
iconLeading:
|
|
86
|
-
size: "sm",
|
|
86
|
+
iconLeading: S,
|
|
87
|
+
size: a ? "xs" : "sm",
|
|
87
88
|
color: "tertiary",
|
|
88
89
|
className: a ? "size-6" : "size-8"
|
|
89
90
|
}
|
|
@@ -91,109 +92,117 @@ const F = ({
|
|
|
91
92
|
/* @__PURE__ */ e(
|
|
92
93
|
"h2",
|
|
93
94
|
{
|
|
94
|
-
className:
|
|
95
|
+
className: o(
|
|
95
96
|
"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 font-semibold text-fg-secondary",
|
|
96
97
|
a ? "text-xs" : "text-sm"
|
|
97
98
|
),
|
|
98
|
-
children: /* @__PURE__ */ e(
|
|
99
|
+
children: /* @__PURE__ */ e(R, { part: "start" })
|
|
99
100
|
}
|
|
100
101
|
),
|
|
101
102
|
/* @__PURE__ */ e(
|
|
102
|
-
|
|
103
|
+
c,
|
|
103
104
|
{
|
|
104
105
|
slot: "next",
|
|
105
|
-
iconLeading:
|
|
106
|
-
size: "sm",
|
|
106
|
+
iconLeading: p,
|
|
107
|
+
size: a ? "xs" : "sm",
|
|
107
108
|
color: "tertiary",
|
|
108
|
-
className:
|
|
109
|
+
className: o(a ? "size-6" : "size-8", "md:hidden")
|
|
109
110
|
}
|
|
110
111
|
)
|
|
111
112
|
] }),
|
|
112
|
-
!d && /* @__PURE__ */
|
|
113
|
+
!d && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 md:hidden", children: [
|
|
113
114
|
/* @__PURE__ */ e(
|
|
114
|
-
|
|
115
|
+
v,
|
|
115
116
|
{
|
|
116
117
|
slot: "start",
|
|
117
|
-
size:
|
|
118
|
+
size: y(t),
|
|
118
119
|
className: "flex-1"
|
|
119
120
|
}
|
|
120
121
|
),
|
|
121
|
-
/* @__PURE__ */ e("div", { className: "text-md text-quaternary", children: "–" }),
|
|
122
122
|
/* @__PURE__ */ e(
|
|
123
|
-
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
className: o("text-quaternary", a ? "text-xs" : "text-md"),
|
|
126
|
+
children: "–"
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
/* @__PURE__ */ e(
|
|
130
|
+
v,
|
|
124
131
|
{
|
|
125
132
|
slot: "end",
|
|
126
|
-
size:
|
|
133
|
+
size: y(t),
|
|
127
134
|
className: "flex-1"
|
|
128
135
|
}
|
|
129
136
|
)
|
|
130
137
|
] }),
|
|
131
|
-
!d && l && /* @__PURE__ */ e("div", { className: "mt-1 flex justify-between gap-3 px-2 md:hidden", children: Object.values(l).map((
|
|
132
|
-
/* @__PURE__ */ e("div", { className: x, children: /* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */ e(u, { children: (
|
|
138
|
+
!d && l && /* @__PURE__ */ e("div", { className: "mt-1 flex justify-between gap-3 px-2 md:hidden", children: Object.values(l).map((n) => /* @__PURE__ */ e(Z, { value: n.value, children: n.label }, n.label)) }),
|
|
139
|
+
/* @__PURE__ */ e("div", { className: x, children: /* @__PURE__ */ i(h, { weekdayStyle: "short", className: "w-full", children: [
|
|
140
|
+
/* @__PURE__ */ e(u, { children: (n) => /* @__PURE__ */ e(b, { className: "border-b-2 border-transparent p-0", children: /* @__PURE__ */ e(
|
|
134
141
|
"div",
|
|
135
142
|
{
|
|
136
|
-
className:
|
|
137
|
-
"flex items-center justify-center font-medium text-secondary",
|
|
138
|
-
|
|
143
|
+
className: o(
|
|
144
|
+
"mx-auto flex items-center justify-center font-medium text-secondary",
|
|
145
|
+
C[t],
|
|
146
|
+
a ? "text-xs" : "text-sm"
|
|
139
147
|
),
|
|
140
|
-
children:
|
|
148
|
+
children: n.slice(0, 2)
|
|
141
149
|
}
|
|
142
150
|
) }) }),
|
|
143
|
-
/* @__PURE__ */ e(g, { className: "[&_td]:p-0 [&_tr]:border-b-
|
|
151
|
+
/* @__PURE__ */ e(g, { className: "[&_td]:p-0 [&_tr]:border-b-2 [&_tr]:border-transparent [&_tr:last-of-type]:border-none", children: (n) => /* @__PURE__ */ e(N, { date: n, size: t }) })
|
|
144
152
|
] }) })
|
|
145
153
|
]
|
|
146
154
|
}
|
|
147
155
|
),
|
|
148
|
-
d && /* @__PURE__ */
|
|
156
|
+
d && /* @__PURE__ */ i(
|
|
149
157
|
"div",
|
|
150
158
|
{
|
|
151
|
-
className:
|
|
152
|
-
"flex flex-col border-l border-secondary py-1",
|
|
153
|
-
a ? "gap-2 px-
|
|
154
|
-
|
|
159
|
+
className: o(
|
|
160
|
+
"flex flex-1 flex-col border-l border-secondary py-1",
|
|
161
|
+
a ? "gap-2 px-3" : "gap-3 px-4",
|
|
162
|
+
s && "pr-0"
|
|
155
163
|
),
|
|
156
164
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ i("header", { className: "relative flex items-center justify-end", children: [
|
|
158
166
|
/* @__PURE__ */ e(
|
|
159
167
|
"h2",
|
|
160
168
|
{
|
|
161
|
-
className:
|
|
169
|
+
className: o(
|
|
162
170
|
"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 font-semibold text-fg-secondary",
|
|
163
171
|
a ? "text-xs" : "text-sm"
|
|
164
172
|
),
|
|
165
|
-
children: /* @__PURE__ */ e(
|
|
173
|
+
children: /* @__PURE__ */ e(R, { part: "end" })
|
|
166
174
|
}
|
|
167
175
|
),
|
|
168
176
|
/* @__PURE__ */ e(
|
|
169
|
-
|
|
177
|
+
c,
|
|
170
178
|
{
|
|
171
179
|
slot: "next",
|
|
172
|
-
iconLeading:
|
|
173
|
-
size: "sm",
|
|
180
|
+
iconLeading: p,
|
|
181
|
+
size: a ? "xs" : "sm",
|
|
174
182
|
color: "tertiary",
|
|
175
183
|
className: a ? "size-6" : "size-8"
|
|
176
184
|
}
|
|
177
185
|
)
|
|
178
186
|
] }),
|
|
179
|
-
/* @__PURE__ */ e("div", { className: x, children: /* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ e("div", { className: x, children: /* @__PURE__ */ i(
|
|
180
188
|
h,
|
|
181
189
|
{
|
|
182
190
|
weekdayStyle: "short",
|
|
183
191
|
offset: { months: 1 },
|
|
184
|
-
className: "w-
|
|
192
|
+
className: "w-full",
|
|
185
193
|
children: [
|
|
186
|
-
/* @__PURE__ */ e(u, { children: (
|
|
194
|
+
/* @__PURE__ */ e(u, { children: (n) => /* @__PURE__ */ e(b, { className: "border-b-2 border-transparent p-0", children: /* @__PURE__ */ e(
|
|
187
195
|
"div",
|
|
188
196
|
{
|
|
189
|
-
className:
|
|
190
|
-
"flex items-center justify-center font-medium text-secondary",
|
|
191
|
-
|
|
197
|
+
className: o(
|
|
198
|
+
"mx-auto flex items-center justify-center font-medium text-secondary",
|
|
199
|
+
C[t],
|
|
200
|
+
a ? "text-xs" : "text-sm"
|
|
192
201
|
),
|
|
193
|
-
children:
|
|
202
|
+
children: n.slice(0, 2)
|
|
194
203
|
}
|
|
195
204
|
) }) }),
|
|
196
|
-
/* @__PURE__ */ e(g, { className: "[&_td]:p-0 [&_tr]:border-b-
|
|
205
|
+
/* @__PURE__ */ e(g, { className: "[&_td]:p-0 [&_tr]:border-b-2 [&_tr]:border-transparent [&_tr:last-of-type]:border-none", children: (n) => /* @__PURE__ */ e(N, { date: n, size: t }) })
|
|
197
206
|
]
|
|
198
207
|
}
|
|
199
208
|
) })
|
|
@@ -205,6 +214,6 @@ const F = ({
|
|
|
205
214
|
) });
|
|
206
215
|
};
|
|
207
216
|
export {
|
|
208
|
-
|
|
209
|
-
|
|
217
|
+
J as RangeCalendar,
|
|
218
|
+
L as RangeCalendarContextProvider
|
|
210
219
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { DateValue } from 'react-aria-components';
|
|
3
|
+
import { PopoverSize } from './sizes';
|
|
3
4
|
export interface RangePresetButtonProps extends HTMLAttributes<HTMLButtonElement> {
|
|
4
5
|
value: {
|
|
5
6
|
start: DateValue;
|
|
6
7
|
end: DateValue;
|
|
7
8
|
};
|
|
9
|
+
/** Matches the picker's popover size. Defaults to "xs". */
|
|
10
|
+
size?: PopoverSize;
|
|
8
11
|
}
|
|
9
|
-
export declare const RangePresetButton: ({ value, className, children, ...props }: RangePresetButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const RangePresetButton: ({ value, size, className, children, ...props }: RangePresetButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
13
|
//# sourceMappingURL=range-preset.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-preset.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/range-preset.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"range-preset.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/range-preset.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAQ3C,MAAM,WAAW,sBAAuB,SAAQ,cAAc,CAAC,iBAAiB,CAAC;IAC/E,KAAK,EAAE;QAAE,KAAK,EAAE,SAAS,CAAC;QAAC,GAAG,EAAE,SAAS,CAAA;KAAE,CAAC;IAC5C,2DAA2D;IAC3D,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,eAAO,MAAM,iBAAiB,GAAI,gDAM/B,sBAAsB,4CAsBxB,CAAC"}
|
|
@@ -1,27 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useSlottedContext as
|
|
3
|
-
import { cx as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useSlottedContext as x, RangeCalendarContext as p } from "react-aria-components";
|
|
3
|
+
import { cx as l } from "../../utils/cn.js";
|
|
4
|
+
const v = {
|
|
5
|
+
xs: "px-2.5 py-1 text-xs",
|
|
6
|
+
sm: "px-3 py-1.5 text-sm",
|
|
7
|
+
md: "px-3 py-2 text-sm"
|
|
8
|
+
}, b = ({
|
|
5
9
|
value: t,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
size: a = "xs",
|
|
11
|
+
className: i,
|
|
12
|
+
children: m,
|
|
13
|
+
...c
|
|
9
14
|
}) => {
|
|
10
|
-
var o, r,
|
|
11
|
-
const e =
|
|
12
|
-
return /* @__PURE__ */
|
|
15
|
+
var o, r, s, n;
|
|
16
|
+
const e = x(p), d = ((r = (o = e == null ? void 0 : e.value) == null ? void 0 : o.start) == null ? void 0 : r.compare(t.start)) === 0 && ((n = (s = e == null ? void 0 : e.value) == null ? void 0 : s.end) == null ? void 0 : n.compare(t.end)) === 0;
|
|
17
|
+
return /* @__PURE__ */ u(
|
|
13
18
|
"button",
|
|
14
19
|
{
|
|
15
|
-
...
|
|
16
|
-
className:
|
|
17
|
-
"cursor-pointer rounded-md
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
...c,
|
|
21
|
+
className: l(
|
|
22
|
+
"cursor-pointer rounded-md text-left font-medium outline-focus-ring transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
23
|
+
v[a],
|
|
24
|
+
d ? "bg-active text-secondary_hover hover:bg-secondary_hover" : "text-secondary hover:bg-primary_hover hover:text-secondary_hover",
|
|
25
|
+
i
|
|
20
26
|
),
|
|
21
|
-
children:
|
|
27
|
+
children: m
|
|
22
28
|
}
|
|
23
29
|
);
|
|
24
30
|
};
|
|
25
31
|
export {
|
|
26
|
-
|
|
32
|
+
b as RangePresetButton
|
|
27
33
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CalendarSize } from './calendar';
|
|
2
|
+
/** Size of the boxes in the popovers: "xs" (28px days, 12px text), "sm" (36px days) or "md" (40px days). */
|
|
3
|
+
export type PopoverSize = "xs" | "sm" | "md";
|
|
4
|
+
/** The weekday header box and the round day marker. */
|
|
5
|
+
export declare const dayBoxSizes: Record<CalendarSize, string>;
|
|
6
|
+
/** A day cell: as tall as its marker and at least as wide, growing to fill its column. */
|
|
7
|
+
export declare const dayCellSizes: Record<CalendarSize, string>;
|
|
8
|
+
/** Six weeks of cells plus the weekday row, so paging a range calendar never changes its height. */
|
|
9
|
+
export declare const rangeGridMinHeights: Record<CalendarSize, string>;
|
|
10
|
+
/** The DateInput size that sits beside a calendar of the given size. */
|
|
11
|
+
export declare const dateInputSizeFor: (size: CalendarSize) => "xs" | "sm" | "md";
|
|
12
|
+
//# sourceMappingURL=sizes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sizes.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/sizes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,4GAA4G;AAC5G,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE7C,uDAAuD;AACvD,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAKpD,CAAC;AAEF,0FAA0F;AAC1F,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAKrD,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAK5D,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,GAAI,MAAM,YAAY,uBACtB,CAAC"}
|