@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
|
@@ -35,7 +35,7 @@ export declare const CalendarMonthYearHeader: ({ size, }: {
|
|
|
35
35
|
export interface CalendarProps extends AriaCalendarProps<DateValue> {
|
|
36
36
|
/** The dates to highlight. */
|
|
37
37
|
highlightedDates?: DateValue[];
|
|
38
|
-
/** Visual size: "xs" (compact,
|
|
38
|
+
/** Visual size: "xs" (compact, default) or "sm". */
|
|
39
39
|
size?: CalendarSize;
|
|
40
40
|
}
|
|
41
41
|
export declare const Calendar: ({ highlightedDates, size, className, ...props }: CalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,iBAAiB,EAAgB,MAAM,OAAO,CAAC;AAW7E,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,SAAS,EACV,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,iBAAiB,EAAgB,MAAM,OAAO,CAAC;AAW7E,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,SAAS,EACV,MAAM,uBAAuB,CAAC;AA8E/B,eAAO,MAAM,uBAAuB,GAAI,cAAc,iBAAiB,4CAgBtE,CAAC;AAEF,wJAAwJ;AACxJ,eAAO,MAAM,yBAAyB,kCAC5B,SAAS,KAAK,IAAI,SACrB,CAAC;AAER,mIAAmI;AACnI,MAAM,WAAW,sCAAuC,SAAQ,iBAAiB;IAC/E,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,yHAAyH;IACzH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACrC,0HAA0H;IAC1H,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5C,yOAAyO;IACzO,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,eAAO,MAAM,iCAAiC,GAAI,kEAM/C,sCAAsC,4CAmCxC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AA8ErD,MAAM,WAAW,oBAAoB;IACnC,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC;IAC/B,sDAAsD;IACtD,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CAC1C;AAED,qFAAqF;AACrF,eAAO,MAAM,eAAe,GAAI,2CAI7B,oBAAoB,4CAkCtB,CAAC;AA+DF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,WAErC;IACD,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB,4CA0EA,CAAC;AAEF,MAAM,WAAW,aAAc,SAAQ,iBAAiB,CAAC,SAAS,CAAC;IACjE,8BAA8B;IAC9B,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC;IAC/B,oDAAoD;IACpD,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAED,eAAO,MAAM,QAAQ,GAAI,iDAKtB,aAAa,4CA+Cf,CAAC"}
|
|
@@ -1,286 +1,291 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { ChevronLeft as
|
|
4
|
-
import { useSlottedContext as N, CalendarContext as b, Calendar as
|
|
5
|
-
import { useDateFormatter as w, useCalendarGrid as
|
|
6
|
-
import { today as P, getLocalTimeZone as
|
|
1
|
+
import { jsx as a, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as I, useContext as h, Fragment as W, useState as p, useMemo as k, useEffect as E, cloneElement as G } from "react";
|
|
3
|
+
import { ChevronLeft as L, ChevronRight as Y, ChevronDown as j } from "@untitledui/icons";
|
|
4
|
+
import { useSlottedContext as N, CalendarContext as b, Calendar as O, Heading as K, CalendarGrid as T, CalendarGridHeader as X, CalendarHeaderCell as Z, CalendarStateContext as g, DateField as $, RangeCalendarStateContext as q, RangeCalendarContext as V, Select as J, Button as Q, SelectValue as U, ListBox as z, ListBoxItem as ee } from "react-aria-components";
|
|
5
|
+
import { useDateFormatter as w, useCalendarGrid as te } from "react-aria";
|
|
6
|
+
import { today as P, getLocalTimeZone as re, endOfMonth as ae } from "@internationalized/date";
|
|
7
7
|
import { cx as x } from "../../utils/cn.js";
|
|
8
8
|
import { CalendarCell as ne } from "./cell.js";
|
|
9
|
-
import { DateInput as
|
|
9
|
+
import { DateInput as F } from "./date-input.js";
|
|
10
10
|
import { Button as A } from "../../primitives/button/button.js";
|
|
11
|
-
import { Popover as
|
|
12
|
-
import { pickerOptionStyles as
|
|
11
|
+
import { Popover as oe } from "../../primitives/select/popover.js";
|
|
12
|
+
import { pickerOptionStyles as se } from "./styles.js";
|
|
13
13
|
import { toSingleDate as D } from "./calendar-value.js";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
import { dayBoxSizes as le, dateInputSizeFor as M } from "./sizes.js";
|
|
15
|
+
const ce = 6;
|
|
16
|
+
function ie({
|
|
17
|
+
children: r,
|
|
18
|
+
className: e
|
|
18
19
|
}) {
|
|
19
|
-
const
|
|
20
|
+
const t = h(g), s = h(q), n = t ?? s, o = N(b), c = N(V), d = n.visibleRange.start, m = (o == null ? void 0 : o.firstDayOfWeek) ?? (c == null ? void 0 : c.firstDayOfWeek), { weeksInMonth: C } = te(
|
|
20
21
|
{
|
|
21
22
|
startDate: d,
|
|
22
|
-
endDate:
|
|
23
|
+
endDate: ae(d),
|
|
23
24
|
weekdayStyle: "short",
|
|
24
25
|
firstDayOfWeek: m
|
|
25
26
|
},
|
|
26
|
-
|
|
27
|
-
), i = Math.max(
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
(f, v) => f ?
|
|
27
|
+
n
|
|
28
|
+
), i = Math.max(ce, C);
|
|
29
|
+
return /* @__PURE__ */ a("tbody", { className: e, children: [...new Array(i).keys()].map((l) => /* @__PURE__ */ a("tr", { children: n.getDatesInWeek(l, d).map(
|
|
30
|
+
(f, v) => f ? G(r(f), { key: v }) : /* @__PURE__ */ a("td", {}, v)
|
|
30
31
|
) }, l)) });
|
|
31
32
|
}
|
|
32
|
-
const
|
|
33
|
-
const [
|
|
34
|
-
return /* @__PURE__ */
|
|
33
|
+
const de = ({ children: r }) => {
|
|
34
|
+
const [e, t] = p(null), [s, n] = p();
|
|
35
|
+
return /* @__PURE__ */ a(
|
|
35
36
|
b.Provider,
|
|
36
37
|
{
|
|
37
38
|
value: {
|
|
38
|
-
value:
|
|
39
|
-
onChange: (
|
|
39
|
+
value: e,
|
|
40
|
+
onChange: (o) => t(D(o)),
|
|
40
41
|
focusedValue: s,
|
|
41
|
-
onFocusChange:
|
|
42
|
+
onFocusChange: n
|
|
42
43
|
},
|
|
43
|
-
children:
|
|
44
|
+
children: r
|
|
44
45
|
}
|
|
45
46
|
);
|
|
46
|
-
}, H =
|
|
47
|
-
value:
|
|
48
|
-
onSelect:
|
|
49
|
-
onChange:
|
|
47
|
+
}, H = I(null), Me = ({
|
|
48
|
+
value: r,
|
|
49
|
+
onSelect: e,
|
|
50
|
+
onChange: t,
|
|
50
51
|
onlyNotifyOnGridSelect: s = !1,
|
|
51
|
-
children:
|
|
52
|
+
children: n
|
|
52
53
|
}) => {
|
|
53
|
-
const [
|
|
54
|
-
|
|
55
|
-
c(
|
|
56
|
-
}, [
|
|
54
|
+
const [o, c] = p(r), [d, m] = p();
|
|
55
|
+
E(() => {
|
|
56
|
+
c(r), r != null && m(r);
|
|
57
|
+
}, [r]);
|
|
57
58
|
const C = (l) => {
|
|
58
|
-
c(l), l && m(l),
|
|
59
|
-
}, i = s &&
|
|
60
|
-
return /* @__PURE__ */
|
|
59
|
+
c(l), l && m(l), t == null || t(l), l && !s && (e == null || e(l));
|
|
60
|
+
}, i = s && e ? e : null;
|
|
61
|
+
return /* @__PURE__ */ a(H.Provider, { value: i, children: /* @__PURE__ */ a(
|
|
61
62
|
b.Provider,
|
|
62
63
|
{
|
|
63
64
|
value: {
|
|
64
|
-
value:
|
|
65
|
+
value: o,
|
|
65
66
|
onChange: (l) => C(D(l)),
|
|
66
67
|
focusedValue: d,
|
|
67
68
|
onFocusChange: m
|
|
68
69
|
},
|
|
69
|
-
children:
|
|
70
|
+
children: n
|
|
70
71
|
}
|
|
71
72
|
) });
|
|
72
|
-
},
|
|
73
|
-
const
|
|
74
|
-
return
|
|
75
|
-
|
|
73
|
+
}, R = I("xs"), me = () => {
|
|
74
|
+
const r = h(g), e = h(R);
|
|
75
|
+
return r ? /* @__PURE__ */ a(
|
|
76
|
+
$,
|
|
76
77
|
{
|
|
77
|
-
value: D(
|
|
78
|
-
onChange: (
|
|
79
|
-
children: /* @__PURE__ */
|
|
78
|
+
value: D(r.value) ?? void 0,
|
|
79
|
+
onChange: (t) => r.setValue(t),
|
|
80
|
+
children: /* @__PURE__ */ a(F, { className: "flex-1", size: M(e) })
|
|
80
81
|
}
|
|
81
|
-
) : /* @__PURE__ */
|
|
82
|
-
},
|
|
83
|
-
value:
|
|
84
|
-
children:
|
|
85
|
-
size:
|
|
82
|
+
) : /* @__PURE__ */ a(F, { className: "flex-1", size: M(e) });
|
|
83
|
+
}, ue = ({
|
|
84
|
+
value: r,
|
|
85
|
+
children: e,
|
|
86
|
+
size: t = "xs",
|
|
86
87
|
...s
|
|
87
88
|
}) => {
|
|
88
|
-
const
|
|
89
|
-
if (!
|
|
89
|
+
const n = h(g);
|
|
90
|
+
if (!n)
|
|
90
91
|
throw new Error("Preset must be used within a Calendar component");
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ a(
|
|
92
93
|
A,
|
|
93
94
|
{
|
|
94
95
|
...s,
|
|
95
96
|
slot: null,
|
|
96
|
-
size:
|
|
97
|
+
size: t,
|
|
97
98
|
color: "secondary",
|
|
98
99
|
onClick: () => {
|
|
99
|
-
|
|
100
|
+
n.setValue(r), n.setFocusedDate(r);
|
|
100
101
|
},
|
|
101
102
|
className: x(
|
|
102
103
|
"w-full h-full bg-secondary font-semibold",
|
|
103
|
-
|
|
104
|
+
t === "xs" ? "text-xs" : "text-sm"
|
|
104
105
|
),
|
|
105
|
-
children:
|
|
106
|
+
children: e
|
|
106
107
|
}
|
|
107
108
|
);
|
|
108
109
|
}, y = ({
|
|
109
|
-
slot:
|
|
110
|
-
size:
|
|
111
|
-
}) => /* @__PURE__ */
|
|
110
|
+
slot: r,
|
|
111
|
+
size: e
|
|
112
|
+
}) => /* @__PURE__ */ a(
|
|
112
113
|
A,
|
|
113
114
|
{
|
|
114
|
-
slot:
|
|
115
|
-
iconLeading:
|
|
116
|
-
size: "sm",
|
|
115
|
+
slot: r,
|
|
116
|
+
iconLeading: r === "previous" ? L : Y,
|
|
117
|
+
size: e === "xs" ? "xs" : "sm",
|
|
117
118
|
color: "tertiary",
|
|
118
|
-
className:
|
|
119
|
+
className: e === "xs" ? "size-6" : "size-8"
|
|
119
120
|
}
|
|
120
|
-
),
|
|
121
|
-
highlightedDates:
|
|
122
|
-
size:
|
|
123
|
-
onDateSelect:
|
|
121
|
+
), fe = ({
|
|
122
|
+
highlightedDates: r,
|
|
123
|
+
size: e = "xs",
|
|
124
|
+
onDateSelect: t
|
|
124
125
|
}) => {
|
|
125
|
-
const s =
|
|
126
|
-
return /* @__PURE__ */ u(
|
|
127
|
-
/* @__PURE__ */
|
|
126
|
+
const s = e === "xs";
|
|
127
|
+
return /* @__PURE__ */ u(T, { weekdayStyle: "short", className: "w-max", children: [
|
|
128
|
+
/* @__PURE__ */ a(X, { className: "border-b-2 border-transparent", children: (n) => /* @__PURE__ */ a(Z, { className: "p-0", children: /* @__PURE__ */ a(
|
|
128
129
|
"div",
|
|
129
130
|
{
|
|
130
131
|
className: x(
|
|
131
132
|
"flex items-center justify-center font-medium text-secondary",
|
|
132
|
-
|
|
133
|
+
le[e],
|
|
134
|
+
s ? "text-xs" : "text-sm"
|
|
133
135
|
),
|
|
134
|
-
children:
|
|
136
|
+
children: n.slice(0, 2)
|
|
135
137
|
}
|
|
136
138
|
) }) }),
|
|
137
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ a(ie, { className: "[&_td]:p-0 [&_tr]:border-b-2 [&_tr]:border-transparent [&_tr:last-of-type]:border-none", children: (n) => /* @__PURE__ */ a(
|
|
138
140
|
ne,
|
|
139
141
|
{
|
|
140
|
-
date:
|
|
141
|
-
size:
|
|
142
|
-
isHighlighted:
|
|
143
|
-
(
|
|
142
|
+
date: n,
|
|
143
|
+
size: e,
|
|
144
|
+
isHighlighted: r == null ? void 0 : r.some(
|
|
145
|
+
(o) => n.compare(o) === 0
|
|
144
146
|
),
|
|
145
|
-
onDateSelect:
|
|
147
|
+
onDateSelect: t
|
|
146
148
|
}
|
|
147
149
|
) })
|
|
148
150
|
] });
|
|
149
|
-
}, _ = 100,
|
|
150
|
-
"aria-label":
|
|
151
|
-
items:
|
|
152
|
-
selectedKey:
|
|
151
|
+
}, _ = 100, B = ({
|
|
152
|
+
"aria-label": r,
|
|
153
|
+
items: e,
|
|
154
|
+
selectedKey: t,
|
|
153
155
|
onChange: s,
|
|
154
|
-
size:
|
|
156
|
+
size: n
|
|
155
157
|
}) => /* @__PURE__ */ u(
|
|
156
|
-
|
|
158
|
+
J,
|
|
157
159
|
{
|
|
158
|
-
"aria-label":
|
|
159
|
-
selectedKey:
|
|
160
|
-
onSelectionChange: (
|
|
161
|
-
|
|
160
|
+
"aria-label": r,
|
|
161
|
+
selectedKey: t,
|
|
162
|
+
onSelectionChange: (o) => {
|
|
163
|
+
o != null && s(Number(o));
|
|
162
164
|
},
|
|
163
165
|
children: [
|
|
164
166
|
/* @__PURE__ */ u(
|
|
165
|
-
|
|
167
|
+
Q,
|
|
166
168
|
{
|
|
167
|
-
className: ({ isFocusVisible:
|
|
169
|
+
className: ({ isFocusVisible: o, isPressed: c }) => x(
|
|
168
170
|
"flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 font-semibold text-fg-secondary outline-hidden transition duration-100 ease-linear hover:bg-primary_hover",
|
|
169
|
-
|
|
171
|
+
n === "xs" ? "text-xs" : "text-sm",
|
|
170
172
|
c && "bg-primary_hover",
|
|
171
|
-
|
|
173
|
+
o && "outline-2 outline-offset-2 outline-focus-ring"
|
|
172
174
|
),
|
|
173
175
|
children: [
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
|
|
176
|
+
/* @__PURE__ */ a(U, {}),
|
|
177
|
+
/* @__PURE__ */ a(
|
|
178
|
+
j,
|
|
177
179
|
{
|
|
178
180
|
"aria-hidden": "true",
|
|
179
|
-
className:
|
|
181
|
+
className: x(
|
|
182
|
+
"shrink-0 text-fg-quaternary",
|
|
183
|
+
n === "xs" ? "size-3.5" : "size-4"
|
|
184
|
+
)
|
|
180
185
|
}
|
|
181
186
|
)
|
|
182
187
|
]
|
|
183
188
|
}
|
|
184
189
|
),
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
|
|
190
|
+
/* @__PURE__ */ a(oe, { size: "sm", placement: "bottom start", className: "w-36", children: /* @__PURE__ */ a(z, { items: e, className: "outline-hidden", children: (o) => /* @__PURE__ */ a(
|
|
191
|
+
ee,
|
|
187
192
|
{
|
|
188
|
-
id:
|
|
189
|
-
textValue:
|
|
190
|
-
className:
|
|
191
|
-
children:
|
|
193
|
+
id: o.id,
|
|
194
|
+
textValue: o.label,
|
|
195
|
+
className: se,
|
|
196
|
+
children: o.label
|
|
192
197
|
}
|
|
193
198
|
) }) })
|
|
194
199
|
]
|
|
195
200
|
}
|
|
196
|
-
),
|
|
197
|
-
size:
|
|
201
|
+
), _e = ({
|
|
202
|
+
size: r = "xs"
|
|
198
203
|
}) => {
|
|
199
|
-
const
|
|
200
|
-
if (!
|
|
204
|
+
const e = h(g);
|
|
205
|
+
if (!e)
|
|
201
206
|
throw new Error(
|
|
202
207
|
"<CalendarMonthYearHeader /> must be used within a <Calendar /> component."
|
|
203
208
|
);
|
|
204
|
-
const { focusedDate:
|
|
209
|
+
const { focusedDate: t, timeZone: s, minValue: n, maxValue: o } = e, c = w({
|
|
205
210
|
month: "long",
|
|
206
|
-
calendar:
|
|
211
|
+
calendar: t.calendar.identifier,
|
|
207
212
|
timeZone: s
|
|
208
213
|
}), d = w({
|
|
209
214
|
year: "numeric",
|
|
210
|
-
calendar:
|
|
215
|
+
calendar: t.calendar.identifier,
|
|
211
216
|
timeZone: s
|
|
212
217
|
}), m = k(() => {
|
|
213
|
-
const i =
|
|
218
|
+
const i = t.calendar.getMonthsInYear(t);
|
|
214
219
|
return Array.from({ length: i }, (l, f) => ({
|
|
215
220
|
id: f + 1,
|
|
216
221
|
label: c.format(
|
|
217
|
-
|
|
222
|
+
t.set({ month: f + 1, day: 1 }).toDate(s)
|
|
218
223
|
)
|
|
219
224
|
}));
|
|
220
|
-
}, [
|
|
225
|
+
}, [t, c, s]), C = k(() => {
|
|
221
226
|
const i = P(s).year, l = Math.min(
|
|
222
|
-
(
|
|
223
|
-
|
|
227
|
+
(n == null ? void 0 : n.year) ?? i - _,
|
|
228
|
+
t.year
|
|
224
229
|
), f = Math.max(
|
|
225
|
-
(
|
|
226
|
-
|
|
230
|
+
(o == null ? void 0 : o.year) ?? i + _,
|
|
231
|
+
t.year
|
|
227
232
|
);
|
|
228
233
|
return Array.from({ length: f - l + 1 }, (v, S) => ({
|
|
229
234
|
id: l + S,
|
|
230
235
|
label: d.format(
|
|
231
|
-
|
|
236
|
+
t.set({ year: l + S, month: 1, day: 1 }).toDate(s)
|
|
232
237
|
)
|
|
233
238
|
}));
|
|
234
|
-
}, [
|
|
239
|
+
}, [t, o, n, s, d]);
|
|
235
240
|
return /* @__PURE__ */ u("header", { className: "flex items-center justify-between gap-2", children: [
|
|
236
241
|
/* @__PURE__ */ u("div", { className: "-ml-1.5 flex items-center gap-1", children: [
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
-
|
|
242
|
+
/* @__PURE__ */ a(
|
|
243
|
+
B,
|
|
239
244
|
{
|
|
240
245
|
"aria-label": "Month",
|
|
241
|
-
size:
|
|
246
|
+
size: r,
|
|
242
247
|
items: m,
|
|
243
|
-
selectedKey:
|
|
244
|
-
onChange: (i) =>
|
|
248
|
+
selectedKey: t.month,
|
|
249
|
+
onChange: (i) => e.setFocusedDate(t.set({ month: i }))
|
|
245
250
|
}
|
|
246
251
|
),
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
-
|
|
252
|
+
/* @__PURE__ */ a(
|
|
253
|
+
B,
|
|
249
254
|
{
|
|
250
255
|
"aria-label": "Year",
|
|
251
|
-
size:
|
|
256
|
+
size: r,
|
|
252
257
|
items: C,
|
|
253
|
-
selectedKey:
|
|
254
|
-
onChange: (i) =>
|
|
258
|
+
selectedKey: t.year,
|
|
259
|
+
onChange: (i) => e.setFocusedDate(t.set({ year: i }))
|
|
255
260
|
}
|
|
256
261
|
)
|
|
257
262
|
] }),
|
|
258
263
|
/* @__PURE__ */ u("div", { className: "flex items-center gap-1", children: [
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ a(y, { slot: "previous", size: r }),
|
|
265
|
+
/* @__PURE__ */ a(y, { slot: "next", size: r })
|
|
261
266
|
] })
|
|
262
267
|
] });
|
|
263
|
-
},
|
|
264
|
-
highlightedDates:
|
|
265
|
-
size:
|
|
266
|
-
className:
|
|
268
|
+
}, Be = ({
|
|
269
|
+
highlightedDates: r,
|
|
270
|
+
size: e = "xs",
|
|
271
|
+
className: t,
|
|
267
272
|
...s
|
|
268
273
|
}) => {
|
|
269
|
-
const
|
|
270
|
-
return /* @__PURE__ */ n
|
|
271
|
-
|
|
274
|
+
const n = N(b), o = h(H), c = e === "xs";
|
|
275
|
+
return /* @__PURE__ */ a(n ? W : de, { children: /* @__PURE__ */ a(R.Provider, { value: e, children: /* @__PURE__ */ u(
|
|
276
|
+
O,
|
|
272
277
|
{
|
|
273
278
|
...s,
|
|
274
279
|
className: (m) => x(
|
|
275
280
|
"flex flex-col w-max",
|
|
276
281
|
c ? "gap-2" : "gap-3",
|
|
277
|
-
typeof
|
|
282
|
+
typeof t == "function" ? t(m) : t
|
|
278
283
|
),
|
|
279
284
|
children: [
|
|
280
285
|
/* @__PURE__ */ u("header", { className: "flex items-center justify-between", children: [
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
|
|
286
|
+
/* @__PURE__ */ a(y, { slot: "previous", size: e }),
|
|
287
|
+
/* @__PURE__ */ a(
|
|
288
|
+
K,
|
|
284
289
|
{
|
|
285
290
|
className: x(
|
|
286
291
|
"font-semibold text-fg-secondary",
|
|
@@ -288,18 +293,18 @@ const ce = ({ children: t }) => {
|
|
|
288
293
|
)
|
|
289
294
|
}
|
|
290
295
|
),
|
|
291
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ a(y, { slot: "next", size: e })
|
|
292
297
|
] }),
|
|
293
298
|
/* @__PURE__ */ u("div", { className: x("flex", c ? "gap-2" : "gap-3"), children: [
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ a(me, {}),
|
|
300
|
+
/* @__PURE__ */ a(ue, { size: e, value: P(re()), children: "Today" })
|
|
296
301
|
] }),
|
|
297
|
-
/* @__PURE__ */
|
|
298
|
-
|
|
302
|
+
/* @__PURE__ */ a(
|
|
303
|
+
fe,
|
|
299
304
|
{
|
|
300
|
-
highlightedDates:
|
|
301
|
-
size:
|
|
302
|
-
onDateSelect:
|
|
305
|
+
highlightedDates: r,
|
|
306
|
+
size: e,
|
|
307
|
+
onDateSelect: o ?? void 0
|
|
303
308
|
}
|
|
304
309
|
)
|
|
305
310
|
]
|
|
@@ -307,10 +312,10 @@ const ce = ({ children: t }) => {
|
|
|
307
312
|
) }) });
|
|
308
313
|
};
|
|
309
314
|
export {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
315
|
+
Be as Calendar,
|
|
316
|
+
de as CalendarContextProvider,
|
|
317
|
+
fe as CalendarDayGrid,
|
|
313
318
|
H as CalendarGridSelectContext,
|
|
314
|
-
|
|
315
|
-
|
|
319
|
+
_e as CalendarMonthYearHeader,
|
|
320
|
+
Me as ControlledCalendarContextProvider
|
|
316
321
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/cell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAMzD,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAQxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/cell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAMzD,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAQxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAC9D,gDAAgD;IAChD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uCAAuC;IACvC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sEAAsE;IACtE,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,kIAAkI;IAClI,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CAC1C;AAED,eAAO,MAAM,YAAY,GAAI,uDAM1B,iBAAiB,4CAyInB,CAAC"}
|