@epam/ai-dial-ui-kit 0.16.0-dev.62 → 0.16.0-dev.66
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/README.md +3 -2
- package/dist/CHANGELOG.md +6 -0
- package/dist/components/New/Calendar/Calendar.js +245 -228
- package/dist/components/New/ErrorBoundary/ErrorBoundary.js +67 -0
- package/dist/components/Spinner/Spinner.js +16 -11
- package/dist/components-manifest.json +105 -7
- package/dist/dial-ui-kit.cjs +3 -3
- package/dist/dial-ui-kit.js +78 -76
- package/dist/index.css +1 -1
- package/dist/src/components/New/Calendar/Calendar.d.ts +32 -1
- package/dist/src/components/New/ErrorBoundary/ErrorBoundary.d.ts +78 -0
- package/dist/src/components/Spinner/Spinner.d.ts +27 -1
- package/dist/src/index.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1,69 +1,70 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useFloating as
|
|
3
|
-
import { IconChevronDown as
|
|
4
|
-
import { useId as
|
|
5
|
-
import { Label as
|
|
6
|
-
import { StaticIconButton as
|
|
7
|
-
import { DIAL_KIT_ICON_STROKE as
|
|
8
|
-
import { DIAL_ICON_SIZE as
|
|
9
|
-
import { CalendarMode as
|
|
10
|
-
import { ElementSize as
|
|
11
|
-
import { useThemeScope as
|
|
12
|
-
import { mergeClasses as
|
|
13
|
-
import { getTimezoneLabel as
|
|
14
|
-
import { DEFAULT_CALENDAR_LOCALE as
|
|
15
|
-
import { getWeekdayShortLabels as
|
|
16
|
-
import { DIAL_KIT_CLASS as
|
|
17
|
-
import { TimePickerPanel as
|
|
18
|
-
const
|
|
19
|
-
id:
|
|
1
|
+
import { jsx as e, jsxs as m, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import { useFloatingNodeId as ne, useFloating as se, autoUpdate as oe, offset as re, flip as ie, shift as ce, useDismiss as de, useRole as me, useInteractions as pe, FloatingPortal as ue, FloatingFocusManager as fe, FloatingTree as Se, useClick as Te, FloatingNode as Me } from "@floating-ui/react";
|
|
3
|
+
import { IconChevronDown as Oe, IconClock as ke } from "@tabler/icons-react";
|
|
4
|
+
import { useId as we, useState as V, useMemo as E, useEffect as Pe } from "react";
|
|
5
|
+
import { Label as Ae } from "../Label/Label.js";
|
|
6
|
+
import { StaticIconButton as q } from "../IconButton/IconButtonWrappers.js";
|
|
7
|
+
import { DIAL_KIT_ICON_STROKE as he } from "../constants/icon.js";
|
|
8
|
+
import { DIAL_ICON_SIZE as ge } from "../../../constants/icon.js";
|
|
9
|
+
import { CalendarMode as T } from "../../../types/calendar.js";
|
|
10
|
+
import { ElementSize as H } from "../../../types/size.js";
|
|
11
|
+
import { useThemeScope as be } from "../ThemeScope/ThemeScope.js";
|
|
12
|
+
import { mergeClasses as o } from "../../../utils/merge-classes.js";
|
|
13
|
+
import { getTimezoneLabel as Ee } from "../../../utils/timezone.js";
|
|
14
|
+
import { DEFAULT_CALENDAR_LOCALE as _e, calendarModeDefaultPlaceholder as Be, calendarFieldIconClassName as Re, calendarNavIcons as J, calendarDaySelectedClassName as ze, calendarDayTodayClassName as Ve, calendarDayOutsideClassName as $e, calendarDayButtonBaseClassName as je, calendarIcon as Ke, calendarFieldDisabledClassName as ye, calendarFieldInvalidClassName as xe, calendarFieldBaseClassName as ve, timePickerButtonClassName as We, timePickerPopoverClassName as Ue, calendarPopoverClassName as Ye } from "./constants.js";
|
|
15
|
+
import { getWeekdayShortLabels as Ge, getWeekdayOptions as Ze, getMonthGrid as qe, formatTimeLabel as R, formatMonthLabel as He, isSameDay as Q, isDateOutOfRange as X, formatDayAriaLabel as Je, sanitizeTimeInput as Qe, isCompleteTimeString as Xe, setTimeOnDate as ee, formatDateLabel as te } from "./utils.js";
|
|
16
|
+
import { DIAL_KIT_CLASS as j } from "../../../constants/public-class-names.js";
|
|
17
|
+
import { TimePickerPanel as et } from "./TimePickerPanel.js";
|
|
18
|
+
const tt = ({
|
|
19
|
+
id: r,
|
|
20
20
|
disabled: l,
|
|
21
21
|
invalid: g,
|
|
22
|
-
trigger:
|
|
23
|
-
panelClassName:
|
|
24
|
-
fieldClassName:
|
|
25
|
-
panel:
|
|
26
|
-
labelledBy:
|
|
27
|
-
describedBy:
|
|
22
|
+
trigger: F,
|
|
23
|
+
panelClassName: i,
|
|
24
|
+
fieldClassName: M,
|
|
25
|
+
panel: v,
|
|
26
|
+
labelledBy: N,
|
|
27
|
+
describedBy: L,
|
|
28
28
|
panelLabel: O
|
|
29
29
|
}) => {
|
|
30
|
-
const b =
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const b = be(), [C, p] = V(!1), n = ne(), { refs: y, floatingStyles: D, context: f } = se({
|
|
31
|
+
nodeId: n,
|
|
32
|
+
open: C,
|
|
33
|
+
onOpenChange: (c) => p(l ? !1 : c),
|
|
33
34
|
placement: "bottom-start",
|
|
34
|
-
whileElementsMounted:
|
|
35
|
-
middleware: [
|
|
36
|
-
}), I =
|
|
35
|
+
whileElementsMounted: oe,
|
|
36
|
+
middleware: [re(8), ie({ padding: 8 }), ce({ padding: 8 })]
|
|
37
|
+
}), I = Te(f, { enabled: !l }), k = de(f), h = me(f, { role: "dialog" }), { getReferenceProps: a, getFloatingProps: w } = pe([
|
|
37
38
|
I,
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
k,
|
|
40
|
+
h
|
|
40
41
|
]);
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ m(Me, { id: n, children: [
|
|
42
43
|
/* @__PURE__ */ e(
|
|
43
44
|
"div",
|
|
44
45
|
{
|
|
45
|
-
id:
|
|
46
|
-
ref:
|
|
46
|
+
id: r,
|
|
47
|
+
ref: y.setReference,
|
|
47
48
|
role: "button",
|
|
48
49
|
"aria-haspopup": "dialog",
|
|
49
|
-
"aria-expanded":
|
|
50
|
+
"aria-expanded": C,
|
|
50
51
|
"aria-disabled": l,
|
|
51
|
-
"aria-labelledby":
|
|
52
|
-
"aria-describedby":
|
|
52
|
+
"aria-labelledby": N,
|
|
53
|
+
"aria-describedby": L,
|
|
53
54
|
tabIndex: l ? -1 : 0,
|
|
54
|
-
className:
|
|
55
|
-
|
|
55
|
+
className: o(
|
|
56
|
+
ve,
|
|
56
57
|
"focus-visible:outline focus-visible:outline-focus",
|
|
57
|
-
g &&
|
|
58
|
-
l &&
|
|
59
|
-
|
|
58
|
+
g && xe,
|
|
59
|
+
l && ye,
|
|
60
|
+
M
|
|
60
61
|
),
|
|
61
|
-
...
|
|
62
|
-
children:
|
|
62
|
+
...a(),
|
|
63
|
+
children: F
|
|
63
64
|
}
|
|
64
65
|
),
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
C && /* @__PURE__ */ e(ue, { children: /* @__PURE__ */ e(
|
|
67
|
+
fe,
|
|
67
68
|
{
|
|
68
69
|
context: f,
|
|
69
70
|
modal: !1,
|
|
@@ -72,92 +73,94 @@ const Q = ({
|
|
|
72
73
|
children: /* @__PURE__ */ e(
|
|
73
74
|
"div",
|
|
74
75
|
{
|
|
75
|
-
ref:
|
|
76
|
-
style:
|
|
76
|
+
ref: y.setFloating,
|
|
77
|
+
style: D,
|
|
77
78
|
"aria-label": O,
|
|
78
|
-
className:
|
|
79
|
-
|
|
79
|
+
className: o(
|
|
80
|
+
Ye,
|
|
80
81
|
b,
|
|
81
|
-
|
|
82
|
+
i
|
|
82
83
|
),
|
|
83
|
-
...
|
|
84
|
-
children:
|
|
84
|
+
...w(),
|
|
85
|
+
children: v(() => p(!1))
|
|
85
86
|
}
|
|
86
87
|
)
|
|
87
88
|
}
|
|
88
89
|
) })
|
|
89
90
|
] });
|
|
90
|
-
},
|
|
91
|
-
id:
|
|
91
|
+
}, ae = (r) => /* @__PURE__ */ e(Se, { children: /* @__PURE__ */ e(tt, { ...r }) }), le = ({
|
|
92
|
+
id: r,
|
|
92
93
|
value: l,
|
|
93
94
|
onChange: g,
|
|
94
|
-
onBlur:
|
|
95
|
-
disabled:
|
|
96
|
-
invalid:
|
|
97
|
-
className:
|
|
98
|
-
ariaLabel:
|
|
99
|
-
describedBy:
|
|
95
|
+
onBlur: F,
|
|
96
|
+
disabled: i,
|
|
97
|
+
invalid: M,
|
|
98
|
+
className: v,
|
|
99
|
+
ariaLabel: N,
|
|
100
|
+
describedBy: L,
|
|
100
101
|
placeholder: O = "--:--",
|
|
101
102
|
timezoneLabel: b,
|
|
102
|
-
timezoneLabelClassName:
|
|
103
|
-
picker: p = !1
|
|
103
|
+
timezoneLabelClassName: C,
|
|
104
|
+
picker: p = !1,
|
|
105
|
+
pickerButtonClassName: n
|
|
104
106
|
}) => {
|
|
105
|
-
const [
|
|
107
|
+
const [y, D] = V(l), [f, I] = V(!1), k = be(), h = ne(), { refs: a, floatingStyles: w, context: c } = se({
|
|
108
|
+
nodeId: h,
|
|
106
109
|
open: f,
|
|
107
|
-
onOpenChange: (
|
|
110
|
+
onOpenChange: (d) => I(i ? !1 : d),
|
|
108
111
|
placement: "bottom-start",
|
|
109
|
-
whileElementsMounted:
|
|
110
|
-
middleware: [
|
|
111
|
-
}),
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
whileElementsMounted: oe,
|
|
113
|
+
middleware: [re(8), ie({ padding: 8 }), ce({ padding: 8 })]
|
|
114
|
+
}), _ = de(c), $ = me(c, { role: "dialog" }), { getFloatingProps: P } = pe([_, $]);
|
|
115
|
+
Pe(() => {
|
|
116
|
+
D(l);
|
|
114
117
|
}, [l]);
|
|
115
|
-
const
|
|
118
|
+
const A = /* @__PURE__ */ e(
|
|
116
119
|
"input",
|
|
117
120
|
{
|
|
118
|
-
id:
|
|
121
|
+
id: r,
|
|
119
122
|
type: "text",
|
|
120
123
|
inputMode: "numeric",
|
|
121
124
|
autoComplete: "off",
|
|
122
|
-
"aria-label":
|
|
123
|
-
"aria-describedby":
|
|
124
|
-
"aria-invalid":
|
|
125
|
+
"aria-label": N,
|
|
126
|
+
"aria-describedby": L,
|
|
127
|
+
"aria-invalid": M || void 0,
|
|
125
128
|
placeholder: O,
|
|
126
|
-
disabled:
|
|
127
|
-
value:
|
|
128
|
-
onChange: (
|
|
129
|
-
const u =
|
|
130
|
-
|
|
129
|
+
disabled: i,
|
|
130
|
+
value: y,
|
|
131
|
+
onChange: (d) => {
|
|
132
|
+
const u = Qe(d.target.value);
|
|
133
|
+
D(u), Xe(u) && g(u);
|
|
131
134
|
},
|
|
132
|
-
onBlur:
|
|
133
|
-
className:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
onBlur: F,
|
|
136
|
+
className: o(
|
|
137
|
+
ve,
|
|
138
|
+
M && xe,
|
|
139
|
+
i && ye,
|
|
137
140
|
p && "pe-12",
|
|
138
|
-
|
|
141
|
+
v
|
|
139
142
|
)
|
|
140
143
|
}
|
|
141
144
|
);
|
|
142
|
-
return !b && !p ?
|
|
145
|
+
return !b && !p ? A : /* @__PURE__ */ m(
|
|
143
146
|
"div",
|
|
144
147
|
{
|
|
145
148
|
ref: p ? a.setReference : void 0,
|
|
146
149
|
className: "relative w-full",
|
|
147
150
|
children: [
|
|
148
|
-
|
|
151
|
+
A,
|
|
149
152
|
b && /* @__PURE__ */ e(
|
|
150
153
|
"span",
|
|
151
154
|
{
|
|
152
|
-
className:
|
|
155
|
+
className: o(
|
|
153
156
|
"dial-small-paragraph-text pointer-events-none absolute end-4 top-1/2 -translate-y-1/2 truncate text-secondary",
|
|
154
157
|
p && "end-12",
|
|
155
|
-
|
|
158
|
+
C
|
|
156
159
|
),
|
|
157
160
|
children: b
|
|
158
161
|
}
|
|
159
162
|
),
|
|
160
|
-
p && /* @__PURE__ */
|
|
163
|
+
p && /* @__PURE__ */ m(z, { children: [
|
|
161
164
|
/* @__PURE__ */ e(
|
|
162
165
|
"button",
|
|
163
166
|
{
|
|
@@ -165,23 +168,26 @@ const Q = ({
|
|
|
165
168
|
"aria-label": "Choose time",
|
|
166
169
|
"aria-haspopup": "dialog",
|
|
167
170
|
"aria-expanded": f,
|
|
168
|
-
disabled:
|
|
169
|
-
className:
|
|
170
|
-
|
|
171
|
+
disabled: i,
|
|
172
|
+
className: o(
|
|
173
|
+
We,
|
|
174
|
+
n
|
|
175
|
+
),
|
|
176
|
+
onClick: () => I((d) => !d),
|
|
171
177
|
children: /* @__PURE__ */ e(
|
|
172
|
-
|
|
178
|
+
ke,
|
|
173
179
|
{
|
|
174
|
-
size:
|
|
175
|
-
stroke:
|
|
180
|
+
size: ge.MD,
|
|
181
|
+
stroke: he,
|
|
176
182
|
"aria-hidden": "true"
|
|
177
183
|
}
|
|
178
184
|
)
|
|
179
185
|
}
|
|
180
186
|
),
|
|
181
|
-
f && /* @__PURE__ */ e(
|
|
182
|
-
|
|
187
|
+
f && /* @__PURE__ */ e(ue, { children: /* @__PURE__ */ e(
|
|
188
|
+
fe,
|
|
183
189
|
{
|
|
184
|
-
context:
|
|
190
|
+
context: c,
|
|
185
191
|
modal: !1,
|
|
186
192
|
initialFocus: -1,
|
|
187
193
|
returnFocus: !0,
|
|
@@ -189,19 +195,19 @@ const Q = ({
|
|
|
189
195
|
"div",
|
|
190
196
|
{
|
|
191
197
|
ref: a.setFloating,
|
|
192
|
-
style:
|
|
198
|
+
style: w,
|
|
193
199
|
"aria-label": "Choose time",
|
|
194
|
-
className:
|
|
195
|
-
|
|
196
|
-
|
|
200
|
+
className: o(
|
|
201
|
+
Ue,
|
|
202
|
+
k
|
|
197
203
|
),
|
|
198
|
-
...
|
|
204
|
+
...P(),
|
|
199
205
|
children: /* @__PURE__ */ e(
|
|
200
|
-
|
|
206
|
+
et,
|
|
201
207
|
{
|
|
202
|
-
value:
|
|
203
|
-
onSelect: (
|
|
204
|
-
|
|
208
|
+
value: y,
|
|
209
|
+
onSelect: (d, u) => {
|
|
210
|
+
D(d), g(d), u && I(!1);
|
|
205
211
|
}
|
|
206
212
|
}
|
|
207
213
|
)
|
|
@@ -213,106 +219,109 @@ const Q = ({
|
|
|
213
219
|
]
|
|
214
220
|
}
|
|
215
221
|
);
|
|
216
|
-
},
|
|
217
|
-
mode:
|
|
222
|
+
}, xt = ({
|
|
223
|
+
mode: r = T.Date,
|
|
218
224
|
value: l,
|
|
219
225
|
onChange: g,
|
|
220
|
-
onBlur:
|
|
221
|
-
labelProps:
|
|
222
|
-
placeholder:
|
|
223
|
-
disabled:
|
|
224
|
-
invalid:
|
|
225
|
-
ariaDescribedBy:
|
|
226
|
+
onBlur: F,
|
|
227
|
+
labelProps: i,
|
|
228
|
+
placeholder: M,
|
|
229
|
+
disabled: v = !1,
|
|
230
|
+
invalid: N = !1,
|
|
231
|
+
ariaDescribedBy: L,
|
|
226
232
|
id: O,
|
|
227
233
|
className: b,
|
|
228
|
-
minDate:
|
|
234
|
+
minDate: C,
|
|
229
235
|
maxDate: p,
|
|
230
|
-
locale: n =
|
|
236
|
+
locale: n = _e,
|
|
231
237
|
fieldClassName: y,
|
|
232
|
-
showTimezone:
|
|
233
|
-
showTimePicker:
|
|
238
|
+
showTimezone: D = !1,
|
|
239
|
+
showTimePicker: f = !0,
|
|
240
|
+
renderTimeField: I,
|
|
241
|
+
pickerButtonClassName: k
|
|
234
242
|
}) => {
|
|
235
|
-
const h =
|
|
243
|
+
const h = M ?? Be[r], a = l instanceof Date ? l : null, w = we(), c = O ?? w, _ = i?.id ?? `${c}-label`, $ = !!i?.label, P = typeof i?.label == "string" ? i.label : void 0, A = $ ? `${_} ${c}` : void 0, d = i ? /* @__PURE__ */ e(Ae, { ...i, id: _, htmlFor: c }) : null, [u, Ne] = V(
|
|
236
244
|
() => a ?? /* @__PURE__ */ new Date()
|
|
237
|
-
),
|
|
238
|
-
() =>
|
|
239
|
-
[
|
|
240
|
-
),
|
|
241
|
-
() =>
|
|
245
|
+
), Ce = E(() => /* @__PURE__ */ new Date(), []), B = E(
|
|
246
|
+
() => D ? Ee({ locale: n }) : null,
|
|
247
|
+
[D, n]
|
|
248
|
+
), De = E(
|
|
249
|
+
() => Ge(n),
|
|
242
250
|
[n]
|
|
243
|
-
),
|
|
244
|
-
() =>
|
|
251
|
+
), K = E(() => Ze(n), [n]), Ie = E(
|
|
252
|
+
() => qe(u.getFullYear(), u.getMonth()),
|
|
245
253
|
[u]
|
|
246
|
-
),
|
|
247
|
-
|
|
254
|
+
), W = (s) => {
|
|
255
|
+
Ne(
|
|
248
256
|
(t) => new Date(t.getFullYear(), t.getMonth() + s, 1)
|
|
249
257
|
);
|
|
250
|
-
},
|
|
251
|
-
if (
|
|
252
|
-
const
|
|
253
|
-
g?.(
|
|
254
|
-
},
|
|
255
|
-
g?.(
|
|
256
|
-
},
|
|
257
|
-
if (
|
|
258
|
-
const s = typeof l == "string" ? l : a ?
|
|
259
|
-
return /* @__PURE__ */
|
|
258
|
+
}, Fe = (s, t) => {
|
|
259
|
+
if (X(s, C, p)) return;
|
|
260
|
+
const S = r === T.DateTime && a ? ee(s, R(a)) : s;
|
|
261
|
+
g?.(S), r === T.Date && t();
|
|
262
|
+
}, U = a ? R(a) : "", Y = (s) => {
|
|
263
|
+
g?.(ee(a ?? /* @__PURE__ */ new Date(), s));
|
|
264
|
+
}, Le = () => a ? r === T.DateTime ? `${te(a, n)}, ${R(a)}` : te(a, n) : h;
|
|
265
|
+
if (r === T.Time) {
|
|
266
|
+
const s = typeof l == "string" ? l : a ? R(a) : "";
|
|
267
|
+
return /* @__PURE__ */ m(
|
|
260
268
|
"div",
|
|
261
269
|
{
|
|
262
|
-
className:
|
|
270
|
+
className: o(
|
|
263
271
|
"flex flex-col gap-y-3",
|
|
264
272
|
b,
|
|
265
|
-
|
|
273
|
+
j.calendar
|
|
266
274
|
),
|
|
267
275
|
children: [
|
|
268
|
-
|
|
276
|
+
d,
|
|
269
277
|
/* @__PURE__ */ e(
|
|
270
|
-
|
|
278
|
+
le,
|
|
271
279
|
{
|
|
272
|
-
id:
|
|
280
|
+
id: c,
|
|
273
281
|
value: s,
|
|
274
282
|
onChange: (t) => g?.(t),
|
|
275
|
-
onBlur:
|
|
276
|
-
disabled:
|
|
277
|
-
invalid:
|
|
278
|
-
describedBy:
|
|
283
|
+
onBlur: F,
|
|
284
|
+
disabled: v,
|
|
285
|
+
invalid: N,
|
|
286
|
+
describedBy: L,
|
|
279
287
|
placeholder: h,
|
|
280
288
|
className: y,
|
|
281
|
-
timezoneLabel:
|
|
282
|
-
picker:
|
|
289
|
+
timezoneLabel: B,
|
|
290
|
+
picker: f,
|
|
291
|
+
pickerButtonClassName: k
|
|
283
292
|
}
|
|
284
293
|
)
|
|
285
294
|
]
|
|
286
295
|
}
|
|
287
296
|
);
|
|
288
297
|
}
|
|
289
|
-
if (
|
|
290
|
-
const s = typeof l == "string" ? l : void 0, t =
|
|
291
|
-
return /* @__PURE__ */
|
|
298
|
+
if (r === T.Weekday) {
|
|
299
|
+
const s = typeof l == "string" ? l : void 0, t = K.find((S) => S.value === s);
|
|
300
|
+
return /* @__PURE__ */ m(
|
|
292
301
|
"div",
|
|
293
302
|
{
|
|
294
|
-
className:
|
|
303
|
+
className: o(
|
|
295
304
|
"flex flex-col gap-y-3",
|
|
296
305
|
b,
|
|
297
|
-
|
|
306
|
+
j.calendar
|
|
298
307
|
),
|
|
299
308
|
children: [
|
|
300
|
-
|
|
309
|
+
d,
|
|
301
310
|
/* @__PURE__ */ e(
|
|
302
|
-
|
|
311
|
+
ae,
|
|
303
312
|
{
|
|
304
|
-
id:
|
|
305
|
-
disabled:
|
|
306
|
-
invalid:
|
|
307
|
-
labelledBy:
|
|
308
|
-
describedBy:
|
|
309
|
-
panelLabel:
|
|
313
|
+
id: c,
|
|
314
|
+
disabled: v,
|
|
315
|
+
invalid: N,
|
|
316
|
+
labelledBy: A,
|
|
317
|
+
describedBy: L,
|
|
318
|
+
panelLabel: P ?? h,
|
|
310
319
|
fieldClassName: y,
|
|
311
|
-
trigger: /* @__PURE__ */
|
|
320
|
+
trigger: /* @__PURE__ */ m(z, { children: [
|
|
312
321
|
/* @__PURE__ */ e(
|
|
313
322
|
"span",
|
|
314
323
|
{
|
|
315
|
-
className:
|
|
324
|
+
className: o(
|
|
316
325
|
"truncate",
|
|
317
326
|
!t && "text-secondary"
|
|
318
327
|
),
|
|
@@ -320,34 +329,34 @@ const Q = ({
|
|
|
320
329
|
}
|
|
321
330
|
),
|
|
322
331
|
/* @__PURE__ */ e(
|
|
323
|
-
|
|
332
|
+
Oe,
|
|
324
333
|
{
|
|
325
|
-
size:
|
|
326
|
-
stroke:
|
|
334
|
+
size: ge.MD,
|
|
335
|
+
stroke: he,
|
|
327
336
|
"aria-hidden": "true",
|
|
328
|
-
className:
|
|
337
|
+
className: Re
|
|
329
338
|
}
|
|
330
339
|
)
|
|
331
340
|
] }),
|
|
332
|
-
panel: (
|
|
341
|
+
panel: (S) => /* @__PURE__ */ e(
|
|
333
342
|
"div",
|
|
334
343
|
{
|
|
335
344
|
role: "listbox",
|
|
336
|
-
"aria-label":
|
|
345
|
+
"aria-label": P ?? h,
|
|
337
346
|
className: "flex flex-col gap-0.5",
|
|
338
|
-
children:
|
|
347
|
+
children: K.map((x) => /* @__PURE__ */ e(
|
|
339
348
|
"button",
|
|
340
349
|
{
|
|
341
350
|
type: "button",
|
|
342
351
|
role: "option",
|
|
343
352
|
"aria-selected": x.value === s,
|
|
344
|
-
className:
|
|
353
|
+
className: o(
|
|
345
354
|
"flex w-full items-center rounded-lg px-3 py-2 text-left dial-small-text text-primary hover:bg-control-accent-alpha-hover",
|
|
346
355
|
"focus-visible:outline focus-visible:outline-focus",
|
|
347
356
|
x.value === s && "bg-control-accent-alpha-hover"
|
|
348
357
|
),
|
|
349
358
|
onClick: () => {
|
|
350
|
-
g?.(x.value),
|
|
359
|
+
g?.(x.value), S();
|
|
351
360
|
},
|
|
352
361
|
children: x.label
|
|
353
362
|
},
|
|
@@ -361,48 +370,48 @@ const Q = ({
|
|
|
361
370
|
}
|
|
362
371
|
);
|
|
363
372
|
}
|
|
364
|
-
return /* @__PURE__ */
|
|
373
|
+
return /* @__PURE__ */ m(
|
|
365
374
|
"div",
|
|
366
375
|
{
|
|
367
|
-
className:
|
|
376
|
+
className: o(
|
|
368
377
|
"flex flex-col gap-y-3",
|
|
369
378
|
b,
|
|
370
|
-
|
|
379
|
+
j.calendar
|
|
371
380
|
),
|
|
372
381
|
children: [
|
|
373
|
-
|
|
382
|
+
d,
|
|
374
383
|
/* @__PURE__ */ e(
|
|
375
|
-
|
|
384
|
+
ae,
|
|
376
385
|
{
|
|
377
|
-
id:
|
|
378
|
-
disabled:
|
|
379
|
-
invalid:
|
|
380
|
-
labelledBy:
|
|
381
|
-
describedBy:
|
|
382
|
-
panelLabel:
|
|
386
|
+
id: c,
|
|
387
|
+
disabled: v,
|
|
388
|
+
invalid: N,
|
|
389
|
+
labelledBy: A,
|
|
390
|
+
describedBy: L,
|
|
391
|
+
panelLabel: P ?? h,
|
|
383
392
|
fieldClassName: y,
|
|
384
|
-
trigger: /* @__PURE__ */
|
|
393
|
+
trigger: /* @__PURE__ */ m(z, { children: [
|
|
385
394
|
/* @__PURE__ */ e(
|
|
386
395
|
"span",
|
|
387
396
|
{
|
|
388
|
-
className:
|
|
397
|
+
className: o(
|
|
389
398
|
"truncate",
|
|
390
399
|
!a && "text-secondary"
|
|
391
400
|
),
|
|
392
|
-
children:
|
|
401
|
+
children: Le()
|
|
393
402
|
}
|
|
394
403
|
),
|
|
395
|
-
|
|
404
|
+
Ke
|
|
396
405
|
] }),
|
|
397
|
-
panel: (s) => /* @__PURE__ */
|
|
398
|
-
/* @__PURE__ */
|
|
406
|
+
panel: (s) => /* @__PURE__ */ m(z, { children: [
|
|
407
|
+
/* @__PURE__ */ m("div", { className: "flex items-center justify-between", children: [
|
|
399
408
|
/* @__PURE__ */ e(
|
|
400
|
-
|
|
409
|
+
q,
|
|
401
410
|
{
|
|
402
411
|
"aria-label": "Previous month",
|
|
403
|
-
icon:
|
|
404
|
-
size:
|
|
405
|
-
onClick: () =>
|
|
412
|
+
icon: J.prev,
|
|
413
|
+
size: H.Small,
|
|
414
|
+
onClick: () => W(-1)
|
|
406
415
|
}
|
|
407
416
|
),
|
|
408
417
|
/* @__PURE__ */ e(
|
|
@@ -410,21 +419,21 @@ const Q = ({
|
|
|
410
419
|
{
|
|
411
420
|
className: "dial-small-semi-text text-primary",
|
|
412
421
|
"aria-live": "polite",
|
|
413
|
-
children:
|
|
422
|
+
children: He(u, n)
|
|
414
423
|
}
|
|
415
424
|
),
|
|
416
425
|
/* @__PURE__ */ e(
|
|
417
|
-
|
|
426
|
+
q,
|
|
418
427
|
{
|
|
419
428
|
"aria-label": "Next month",
|
|
420
|
-
icon:
|
|
421
|
-
size:
|
|
422
|
-
onClick: () =>
|
|
429
|
+
icon: J.next,
|
|
430
|
+
size: H.Small,
|
|
431
|
+
onClick: () => W(1)
|
|
423
432
|
}
|
|
424
433
|
)
|
|
425
434
|
] }),
|
|
426
|
-
/* @__PURE__ */
|
|
427
|
-
|
|
435
|
+
/* @__PURE__ */ m("div", { className: "grid grid-cols-7 gap-y-1 text-center", children: [
|
|
436
|
+
De.map((t) => /* @__PURE__ */ e(
|
|
428
437
|
"div",
|
|
429
438
|
{
|
|
430
439
|
"aria-hidden": "true",
|
|
@@ -433,44 +442,52 @@ const Q = ({
|
|
|
433
442
|
},
|
|
434
443
|
t
|
|
435
444
|
)),
|
|
436
|
-
|
|
437
|
-
const
|
|
445
|
+
Ie.map((t) => {
|
|
446
|
+
const S = t.getMonth() !== u.getMonth(), x = Q(t, a), G = Q(t, Ce), Z = X(t, C, p);
|
|
438
447
|
return /* @__PURE__ */ e(
|
|
439
448
|
"button",
|
|
440
449
|
{
|
|
441
450
|
type: "button",
|
|
442
|
-
disabled:
|
|
443
|
-
"aria-label":
|
|
451
|
+
disabled: Z,
|
|
452
|
+
"aria-label": Je(t, n),
|
|
444
453
|
"aria-pressed": x,
|
|
445
|
-
"aria-current":
|
|
446
|
-
className:
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
x &&
|
|
451
|
-
|
|
454
|
+
"aria-current": G ? "date" : void 0,
|
|
455
|
+
className: o(
|
|
456
|
+
je,
|
|
457
|
+
S && $e,
|
|
458
|
+
G && !x && Ve,
|
|
459
|
+
x && ze,
|
|
460
|
+
Z && "cursor-not-allowed opacity-40 hover:bg-transparent"
|
|
452
461
|
),
|
|
453
|
-
onClick: () =>
|
|
462
|
+
onClick: () => Fe(t, s),
|
|
454
463
|
children: t.getDate()
|
|
455
464
|
},
|
|
456
465
|
t.toISOString()
|
|
457
466
|
);
|
|
458
467
|
})
|
|
459
468
|
] }),
|
|
460
|
-
|
|
469
|
+
r === T.DateTime && /* @__PURE__ */ m("div", { className: "flex items-center justify-between gap-3 border-t border-secondary pt-3", children: [
|
|
461
470
|
/* @__PURE__ */ e("span", { className: "dial-small-text text-primary", children: "Time" }),
|
|
462
|
-
|
|
463
|
-
|
|
471
|
+
I ? I({
|
|
472
|
+
value: U,
|
|
473
|
+
onChange: Y,
|
|
474
|
+
onBlur: F,
|
|
475
|
+
disabled: v,
|
|
476
|
+
invalid: N,
|
|
477
|
+
ariaLabel: "Time",
|
|
478
|
+
timezoneLabel: B
|
|
479
|
+
}) : /* @__PURE__ */ e(
|
|
480
|
+
le,
|
|
464
481
|
{
|
|
465
482
|
ariaLabel: "Time",
|
|
466
|
-
value:
|
|
467
|
-
onChange:
|
|
468
|
-
onBlur:
|
|
469
|
-
className:
|
|
470
|
-
!
|
|
483
|
+
value: U,
|
|
484
|
+
onChange: Y,
|
|
485
|
+
onBlur: F,
|
|
486
|
+
className: o(
|
|
487
|
+
!B && "w-[120px]",
|
|
471
488
|
"px-3 py-1.5"
|
|
472
489
|
),
|
|
473
|
-
timezoneLabel:
|
|
490
|
+
timezoneLabel: B,
|
|
474
491
|
timezoneLabelClassName: "end-3 max-w-[60%]"
|
|
475
492
|
}
|
|
476
493
|
)
|
|
@@ -483,5 +500,5 @@ const Q = ({
|
|
|
483
500
|
);
|
|
484
501
|
};
|
|
485
502
|
export {
|
|
486
|
-
|
|
503
|
+
xt as Calendar
|
|
487
504
|
};
|