@spear-ai/spectral 1.11.3 → 1.12.1
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 +4 -0
- package/dist/.js +124 -121
- package/dist/{Accordion-CDXdSAST.js → Accordion-Cyrb2byI.js} +1 -1
- package/dist/Accordion.js +1 -1
- package/dist/Alert/AlertBase.js +1 -1
- package/dist/Alert.js +3 -3
- package/dist/{AnimatePresence-D-9jXfgI.js → AnimatePresence-D9FLxIGV.js} +1 -1
- package/dist/Avatar.js +46 -48
- package/dist/Badge.js +1 -1
- package/dist/Button.js +1 -1
- package/dist/ButtonGroup/ButtonGroupButton.js +1 -1
- package/dist/ButtonGroup.js +1 -1
- package/dist/ButtonIcon.js +1 -1
- package/dist/{Calendar-s4lyijkn.js → Calendar-2UVWeLYp.js} +4 -4
- package/dist/Checkbox/CheckboxBase.js +1 -1
- package/dist/Checkbox.d.ts +10 -3
- package/dist/Checkbox.js +55 -35
- package/dist/{es2015-YHaMV-St.js → Combination-9q50p_Vu.js} +251 -254
- package/dist/Combobox/ComboboxBase.js +492 -3
- package/dist/Combobox-Ch5Rxk5v.js +6360 -0
- package/dist/Combobox.d.ts +5 -3
- package/dist/Combobox.js +3 -143
- package/dist/ControlGroup/ControlGroupSelect.d.ts +5 -2
- package/dist/ControlGroup/ControlGroupSelect.js +32 -29
- package/dist/ControlGroup.d.ts +3 -2
- package/dist/ControlGroup.js +41 -33
- package/dist/DataCard/Card.js +1 -1
- package/dist/DataCard.js +1 -1
- package/dist/DateTimePicker/Calendar.js +1 -1
- package/dist/DateTimePicker/DateTimeDisplayInput.js +84 -83
- package/dist/DateTimePicker/DateTimeInput.js +2 -2
- package/dist/DateTimePicker/DateTimeUtils.js +1 -1
- package/dist/DateTimePicker/TimePeriodSelect.js +32 -35
- package/dist/DateTimePicker/TimePicker.js +2 -2
- package/dist/DateTimePicker.d.ts +1 -1
- package/dist/DateTimePicker.js +55 -52
- package/dist/{DateTimeUtils-DVvG6H-p.js → DateTimeUtils-DrR2JWoU.js} +1 -1
- package/dist/Dialog.js +3 -3
- package/dist/Drawer.js +1 -1
- package/dist/DropdownMenu.d.ts +61 -0
- package/dist/DropdownMenu.js +869 -0
- package/dist/{HoverCard-CYDsIiVK.js → HoverCard-BGpW6LnA.js} +3 -3
- package/dist/HoverCard.js +1 -1
- package/dist/Icons/AdjustmentsIcon.d.ts +5 -0
- package/dist/Icons/AdjustmentsIcon.js +78 -0
- package/dist/Icons/MenuDotsIcon.d.ts +5 -0
- package/dist/Icons/MenuDotsIcon.js +36 -0
- package/dist/Icons/MenuIcon.d.ts +5 -0
- package/dist/Icons/MenuIcon.js +36 -0
- package/dist/Icons/index.d.ts +3 -0
- package/dist/Icons.js +81 -78
- package/dist/IconsAnimated/PanelLeftCloseIcon.js +3 -3
- package/dist/IconsAnimated/PanelLeftOpenIcon.js +3 -3
- package/dist/Input.js +1 -1
- package/dist/InputNumeric.js +1 -1
- package/dist/{InputOTP-cVn5Bzyp.js → InputOTP-BkSw_KIB.js} +12 -10
- package/dist/InputOTP.js +1 -1
- package/dist/Kbd.js +1 -1
- package/dist/Label.js +1 -1
- package/dist/MultiSelect/MultiSelectBase.d.ts +6 -4
- package/dist/MultiSelect/MultiSelectBase.js +222 -201
- package/dist/MultiSelect.d.ts +2 -1
- package/dist/MultiSelect.js +14 -12
- package/dist/Popover.js +2 -2
- package/dist/RadioButton.js +1 -1
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +1 -1
- package/dist/RadioButtonGroup.js +1 -1
- package/dist/RadioGroup-CfjhpW5o.js +328 -0
- package/dist/RadioGroup.d.ts +7 -0
- package/dist/RadioGroup.js +1 -1
- package/dist/Select.d.ts +5 -2
- package/dist/Select.js +97 -85
- package/dist/Separator.js +1 -1
- package/dist/Skeleton.js +1 -1
- package/dist/{Slider-BzzZT3Zm.js → Slider-mODhqkCs.js} +4 -4
- package/dist/Slider.js +1 -1
- package/dist/Switch-Wj_zov--.js +144 -0
- package/dist/Switch.d.ts +12 -3
- package/dist/Switch.js +1 -1
- package/dist/Tabs/TabsBase.js +4 -4
- package/dist/Tabs.js +1 -1
- package/dist/Textarea.d.ts +3 -2
- package/dist/Textarea.js +50 -45
- package/dist/{Toast-9zqXxKKO.js → Toast-CJvzLlMD.js} +1 -1
- package/dist/Toast.js +1 -1
- package/dist/Toggle.js +1 -1
- package/dist/ToggleGroup.js +1 -1
- package/dist/{Tooltip-D1K8kY1y.js → Tooltip-DH_BzFye.js} +5 -5
- package/dist/Tooltip.js +1 -1
- package/dist/Tray.js +5 -5
- package/dist/{chunk-h9knIhTc.js → chunk-C4rFPcKS.js} +1 -1
- package/dist/dist-BMu6Dgh_.js +149 -0
- package/dist/{dist-fW81qjVl.js → dist-C9fJjxxB.js} +41 -41
- package/dist/{dist-C0Hifjgh.js → dist-Cv8I-d2q.js} +2 -2
- package/dist/{dist-B9tup-4O.js → dist-D6QANKSj.js} +5 -5
- package/dist/{dist-3Af8168y.js → dist-Tbzy5UFA.js} +1 -1
- package/dist/{dist-B2k1iWFp.js → dist-jQ7HawWM.js} +1 -1
- package/dist/{dist-BtdmHAzK.js → dist-nYKAWiy4.js} +6 -6
- package/dist/main.js +1 -1
- package/dist/primitives/button.js +1 -1
- package/dist/primitives/input-group.js +1 -1
- package/dist/primitives/input.js +1 -1
- package/dist/primitives/popover.js +2 -2
- package/dist/primitives/select.js +40 -40
- package/dist/primitives/textarea.js +1 -1
- package/dist/{proxy-Dn10Pl_g.js → proxy-CCB7C4Pu.js} +10 -10
- package/dist/styles/spectral.css +1 -1
- package/dist/{twUtils-VNWgstKL.js → twUtils-D_qzdiwM.js} +1 -1
- package/dist/{use-animation-CBUDycyW.js → use-animation-C-qL83hj.js} +1 -1
- package/dist/utils/formFieldUtils.d.ts +15 -1
- package/dist/utils/formFieldUtils.d.ts.map +1 -1
- package/dist/utils/formFieldUtils.js +35 -19
- package/dist/utils/twUtils.js +1 -1
- package/package.json +27 -22
- package/dist/ComboboxBase-qX-mQhT6.js +0 -491
- package/dist/RadioGroup-w_q6RGEK.js +0 -447
- package/dist/Switch-CVzRJ-0n.js +0 -126
- /package/dist/{dist-Bfjk-jx9.js → dist-ChNh3U3S.js} +0 -0
- /package/dist/{dist-B4FgboI8.js → dist-Cujfuel1.js} +0 -0
- /package/dist/{dist-D8Wb_MX9.js → dist-DDjUcieO.js} +0 -0
- /package/dist/{dist-s1uWaZYZ.js → dist-DFT13f_s.js} +0 -0
- /package/dist/{dist-ClmepHp4.js → dist-DIt8FP2G.js} +0 -0
- /package/dist/{dist-BK1K0g9W.js → dist-K0_i37VL.js} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../styles/main.css";
|
|
3
|
-
import { t as e } from "../twUtils-
|
|
3
|
+
import { t as e } from "../twUtils-D_qzdiwM.js";
|
|
4
4
|
import { getInputClasses as t } from "../utils/formFieldUtils.js";
|
|
5
5
|
import { useUncontrolledState as n } from "../hooks/useUncontrolledState.js";
|
|
6
6
|
import { Label as r } from "../Label.js";
|
|
7
|
-
import { S as i, b as a, f as o } from "../DateTimeUtils-
|
|
8
|
-
import { forwardRef as s, useCallback as c, useEffect as l,
|
|
9
|
-
import { jsx as
|
|
7
|
+
import { S as i, b as a, f as o } from "../DateTimeUtils-DrR2JWoU.js";
|
|
8
|
+
import { forwardRef as s, useCallback as c, useEffect as l, useId as u, useMemo as d, useRef as f } from "react";
|
|
9
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/DateTimePicker/DateTimeDisplayInput.tsx
|
|
11
|
-
var
|
|
11
|
+
var h = {
|
|
12
12
|
month: {
|
|
13
13
|
type: "month",
|
|
14
14
|
min: 1,
|
|
@@ -51,13 +51,13 @@ var m = {
|
|
|
51
51
|
max: 1,
|
|
52
52
|
length: 2
|
|
53
53
|
}
|
|
54
|
-
},
|
|
54
|
+
}, g = (e, t) => e === 2 ? t % 4 == 0 && t % 100 != 0 || t % 400 == 0 ? 29 : 28 : [
|
|
55
55
|
4,
|
|
56
56
|
6,
|
|
57
57
|
9,
|
|
58
58
|
11
|
|
59
|
-
].includes(e) ? 30 : 31,
|
|
60
|
-
let m =
|
|
59
|
+
].includes(e) ? 30 : 31, _ = ({ ariaLabel: t, config: n, disabled: r, onLeftFocus: i, onRightFocus: a, onValueChange: o, periodLabels: s, value: u }) => {
|
|
60
|
+
let m = f(null), h = f(""), g = f(!1), _ = d(() => {
|
|
61
61
|
switch (n.type) {
|
|
62
62
|
case "month": return "MM";
|
|
63
63
|
case "day": return "dd";
|
|
@@ -71,8 +71,8 @@ var m = {
|
|
|
71
71
|
n.type,
|
|
72
72
|
n.max,
|
|
73
73
|
s
|
|
74
|
-
]), v =
|
|
75
|
-
|
|
74
|
+
]), v = d(() => u === void 0 ? _ : n.type === "period" ? (u === 0 ? s?.am ?? "am" : s?.pm ?? "pm").toLowerCase() : u.toString().padStart(n.length, "0"), [
|
|
75
|
+
u,
|
|
76
76
|
n,
|
|
77
77
|
s,
|
|
78
78
|
_
|
|
@@ -107,15 +107,15 @@ var m = {
|
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
109
|
if (n.type === "period") {
|
|
110
|
-
e.preventDefault(), e.key === "ArrowUp" || e.key === "ArrowDown" ? o(
|
|
110
|
+
e.preventDefault(), e.key === "ArrowUp" || e.key === "ArrowDown" ? o(+(u === 0)) : e.key.toLowerCase() === "a" ? o(0) : e.key.toLowerCase() === "p" && o(1);
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
if (e.key === "ArrowUp") {
|
|
114
|
-
e.preventDefault(), h.current = "", g.current = !1, o(
|
|
114
|
+
e.preventDefault(), h.current = "", g.current = !1, o(u === void 0 || u >= n.max ? n.min : u + 1);
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
if (e.key === "ArrowDown") {
|
|
118
|
-
e.preventDefault(), h.current = "", g.current = !1, o(
|
|
118
|
+
e.preventDefault(), h.current = "", g.current = !1, o(u === void 0 || u <= n.min ? n.max : u - 1);
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
121
121
|
if (e.key === "Home") {
|
|
@@ -145,12 +145,12 @@ var m = {
|
|
|
145
145
|
if (e.key === "Backspace") if (e.preventDefault(), h.current) {
|
|
146
146
|
let e = h.current.slice(0, -1);
|
|
147
147
|
h.current = e, g.current = e.length > 0, m.current && (m.current.value = e || v);
|
|
148
|
-
} else
|
|
148
|
+
} else u !== void 0 && (h.current = "", g.current = !0, o(n.min), m.current && (m.current.value = _));
|
|
149
149
|
}
|
|
150
150
|
}, [
|
|
151
151
|
r,
|
|
152
152
|
n,
|
|
153
|
-
|
|
153
|
+
u,
|
|
154
154
|
v,
|
|
155
155
|
_,
|
|
156
156
|
o,
|
|
@@ -200,12 +200,12 @@ var m = {
|
|
|
200
200
|
paddingLeft: 0
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
|
-
}, [n.type]), T =
|
|
204
|
-
return /* @__PURE__ */
|
|
203
|
+
}, [n.type]), T = d(() => w(), [w]), E = d(() => u === void 0, [u]);
|
|
204
|
+
return /* @__PURE__ */ p("input", {
|
|
205
205
|
"aria-label": t,
|
|
206
206
|
"aria-valuemax": n.max,
|
|
207
207
|
"aria-valuemin": n.min,
|
|
208
|
-
"aria-valuenow":
|
|
208
|
+
"aria-valuenow": u,
|
|
209
209
|
className: e("rounded inline-flex items-center justify-center text-center tabular-nums", "border-none bg-transparent outline-none", "focus:bg-bg-tertiary focus:text-text-primary focus:ring-1 focus:ring-accent", "hover:bg-bg-secondary", r && "cursor-not-allowed opacity-50", E && "text-text-placeholder text-sm"),
|
|
210
210
|
"data-segment": n.type,
|
|
211
211
|
defaultValue: v,
|
|
@@ -220,13 +220,13 @@ var m = {
|
|
|
220
220
|
style: T,
|
|
221
221
|
tabIndex: r ? -1 : 0
|
|
222
222
|
});
|
|
223
|
-
},
|
|
224
|
-
let
|
|
223
|
+
}, v = s(({ className: s, defaultValue: l, disabled: v, endIcon: y, hourFormat: b = "12", id: x, label: S, locale: C, onChange: w, showTime: T = !0, state: E = "default", value: D, "aria-labelledby": O, date: k, onDateChange: A, ...j }, M) => {
|
|
224
|
+
let N = u(), P = x ?? `datetime-display-input-${N}`, F = `${P}-label`, I = f(null), L = [S ? F : void 0, O].filter(Boolean).join(" ") || void 0, [R, z] = n({
|
|
225
225
|
defaultValue: l,
|
|
226
|
-
onChange:
|
|
227
|
-
value:
|
|
228
|
-
}),
|
|
229
|
-
if (!
|
|
226
|
+
onChange: w ?? A,
|
|
227
|
+
value: D ?? k
|
|
228
|
+
}), B = d(() => i(C), [C]), V = d(() => a(B), [B]), H = d(() => {
|
|
229
|
+
if (!R) return {
|
|
230
230
|
month: void 0,
|
|
231
231
|
day: void 0,
|
|
232
232
|
year: void 0,
|
|
@@ -234,104 +234,105 @@ var m = {
|
|
|
234
234
|
minute: void 0,
|
|
235
235
|
period: void 0
|
|
236
236
|
};
|
|
237
|
-
let e =
|
|
238
|
-
return
|
|
239
|
-
month:
|
|
240
|
-
day:
|
|
241
|
-
year:
|
|
237
|
+
let e = R.getHours(), t, n;
|
|
238
|
+
return b === "24" ? (t = e, n = 0) : (n = +(e >= 12), t = e % 12, t === 0 && (t = 12)), {
|
|
239
|
+
month: R.getMonth() + 1,
|
|
240
|
+
day: R.getDate(),
|
|
241
|
+
year: R.getFullYear(),
|
|
242
242
|
hour: t,
|
|
243
|
-
minute:
|
|
243
|
+
minute: R.getMinutes(),
|
|
244
244
|
period: n
|
|
245
245
|
};
|
|
246
|
-
}, [
|
|
246
|
+
}, [R, b]), U = H.month !== void 0 && H.day !== void 0 && H.year !== void 0, W = c((e) => {
|
|
247
247
|
let t = {
|
|
248
|
-
...
|
|
248
|
+
...H,
|
|
249
249
|
...e
|
|
250
250
|
};
|
|
251
251
|
if (t.month === void 0 && t.day === void 0 && t.year === void 0) {
|
|
252
|
-
|
|
252
|
+
z(void 0);
|
|
253
253
|
return;
|
|
254
254
|
}
|
|
255
|
-
let n = /* @__PURE__ */ new Date(), r = (t.month ?? n.getMonth() + 1) - 1, i = t.day ?? n.getDate(), a = t.year ?? n.getFullYear(), o =
|
|
256
|
-
if (
|
|
255
|
+
let n = /* @__PURE__ */ new Date(), r = (t.month ?? n.getMonth() + 1) - 1, i = t.day ?? n.getDate(), a = t.year ?? n.getFullYear(), o = g(r + 1, a), s = Math.min(i, o), c = H.month !== void 0 && H.day !== void 0 && H.year !== void 0, l = t.month !== void 0 && t.day !== void 0 && t.year !== void 0, u = !c && l, d;
|
|
256
|
+
if (b === "24") d = u ? 0 : t.hour ?? 0;
|
|
257
257
|
else {
|
|
258
258
|
let e = u ? 12 : t.hour ?? 12, n = u ? 1 : t.period ?? 0, r = e, i = n;
|
|
259
259
|
d = r === 12 ? i === 0 ? 0 : 12 : i === 0 ? r : r + 12;
|
|
260
260
|
}
|
|
261
261
|
let f = u ? 0 : t.minute ?? 0;
|
|
262
|
-
|
|
262
|
+
z(new Date(a, r, s, d, f, 0, 0));
|
|
263
263
|
}, [
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
]),
|
|
264
|
+
H,
|
|
265
|
+
b,
|
|
266
|
+
z
|
|
267
|
+
]), G = d(() => {
|
|
268
268
|
let e = [
|
|
269
269
|
{
|
|
270
270
|
key: "month",
|
|
271
|
-
config:
|
|
271
|
+
config: h.month,
|
|
272
272
|
ariaLabel: "Month"
|
|
273
273
|
},
|
|
274
274
|
{
|
|
275
275
|
key: "day",
|
|
276
|
-
config:
|
|
276
|
+
config: h.day,
|
|
277
277
|
ariaLabel: "Day"
|
|
278
278
|
},
|
|
279
279
|
{
|
|
280
280
|
key: "year",
|
|
281
|
-
config:
|
|
281
|
+
config: h.year,
|
|
282
282
|
ariaLabel: "Year"
|
|
283
283
|
}
|
|
284
284
|
];
|
|
285
|
-
if (!
|
|
286
|
-
let t =
|
|
285
|
+
if (!T) return e;
|
|
286
|
+
let t = b === "24" ? [{
|
|
287
287
|
key: "hour",
|
|
288
|
-
config:
|
|
288
|
+
config: h.hour24,
|
|
289
289
|
ariaLabel: "Hours"
|
|
290
290
|
}, {
|
|
291
291
|
key: "minute",
|
|
292
|
-
config:
|
|
292
|
+
config: h.minute,
|
|
293
293
|
ariaLabel: "Minutes"
|
|
294
294
|
}] : [
|
|
295
295
|
{
|
|
296
296
|
key: "hour",
|
|
297
|
-
config:
|
|
297
|
+
config: h.hour12,
|
|
298
298
|
ariaLabel: "Hours"
|
|
299
299
|
},
|
|
300
300
|
{
|
|
301
301
|
key: "minute",
|
|
302
|
-
config:
|
|
302
|
+
config: h.minute,
|
|
303
303
|
ariaLabel: "Minutes"
|
|
304
304
|
},
|
|
305
305
|
{
|
|
306
306
|
key: "period",
|
|
307
|
-
config:
|
|
308
|
-
ariaLabel: o(
|
|
307
|
+
config: h.period,
|
|
308
|
+
ariaLabel: o(V, "Select {am} or {pm}")
|
|
309
309
|
}
|
|
310
310
|
];
|
|
311
311
|
return [...e, ...t];
|
|
312
312
|
}, [
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
]),
|
|
317
|
-
(
|
|
318
|
-
}, []),
|
|
319
|
-
return /* @__PURE__ */
|
|
313
|
+
T,
|
|
314
|
+
b,
|
|
315
|
+
V
|
|
316
|
+
]), K = c((e) => {
|
|
317
|
+
(I.current?.querySelectorAll("[role='spinbutton']")[e])?.focus();
|
|
318
|
+
}, []), q = t(E);
|
|
319
|
+
return /* @__PURE__ */ m("div", {
|
|
320
320
|
className: "gap-1.5 flex flex-col",
|
|
321
|
-
children: [
|
|
321
|
+
children: [S && /* @__PURE__ */ p(r, {
|
|
322
322
|
className: "text-sm font-medium text-text-primary",
|
|
323
|
-
|
|
324
|
-
children:
|
|
325
|
-
}), /* @__PURE__ */
|
|
326
|
-
className: e(
|
|
323
|
+
id: F,
|
|
324
|
+
children: S
|
|
325
|
+
}), /* @__PURE__ */ m("div", {
|
|
326
|
+
className: e(q, "relative", (v ?? E === "disabled") && "cursor-not-allowed", s),
|
|
327
327
|
"data-slot": "datetime-display-input",
|
|
328
|
-
id:
|
|
329
|
-
ref:
|
|
330
|
-
|
|
331
|
-
|
|
328
|
+
id: P,
|
|
329
|
+
ref: M ?? I,
|
|
330
|
+
"aria-labelledby": L,
|
|
331
|
+
...j,
|
|
332
|
+
children: [/* @__PURE__ */ p("div", {
|
|
332
333
|
className: "flex items-center",
|
|
333
|
-
ref:
|
|
334
|
-
children:
|
|
334
|
+
ref: I,
|
|
335
|
+
children: G.map((e, t) => {
|
|
335
336
|
let n = [
|
|
336
337
|
"month",
|
|
337
338
|
"day",
|
|
@@ -340,31 +341,31 @@ var m = {
|
|
|
340
341
|
"hour",
|
|
341
342
|
"minute",
|
|
342
343
|
"period"
|
|
343
|
-
].includes(e.key), i = e.key === "year", a = e.key === "hour", o =
|
|
344
|
-
return /* @__PURE__ */
|
|
344
|
+
].includes(e.key), i = e.key === "year", a = e.key === "hour", o = v ?? (r && !U);
|
|
345
|
+
return /* @__PURE__ */ m("span", {
|
|
345
346
|
className: "flex items-center",
|
|
346
347
|
children: [
|
|
347
|
-
a && /* @__PURE__ */
|
|
348
|
+
a && /* @__PURE__ */ p("span", {
|
|
348
349
|
"aria-hidden": "true",
|
|
349
350
|
className: "text-text-secondary select-none",
|
|
350
351
|
children: ",\xA0"
|
|
351
352
|
}),
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ p(_, {
|
|
353
354
|
ariaLabel: e.ariaLabel,
|
|
354
355
|
config: e.config,
|
|
355
356
|
disabled: o,
|
|
356
|
-
onLeftFocus: () => t > 0 &&
|
|
357
|
-
onRightFocus: () => t <
|
|
358
|
-
onValueChange: (t) =>
|
|
359
|
-
periodLabels:
|
|
360
|
-
value:
|
|
357
|
+
onLeftFocus: () => t > 0 && K(t - 1),
|
|
358
|
+
onRightFocus: () => t < G.length - 1 && K(t + 1),
|
|
359
|
+
onValueChange: (t) => W({ [e.key]: t }),
|
|
360
|
+
periodLabels: V,
|
|
361
|
+
value: H[e.key]
|
|
361
362
|
}),
|
|
362
|
-
n && !i && /* @__PURE__ */
|
|
363
|
+
n && !i && /* @__PURE__ */ p("span", {
|
|
363
364
|
"aria-hidden": "true",
|
|
364
365
|
className: "text-text-secondary select-none",
|
|
365
366
|
children: "/"
|
|
366
367
|
}),
|
|
367
|
-
a && /* @__PURE__ */
|
|
368
|
+
a && /* @__PURE__ */ p("span", {
|
|
368
369
|
"aria-hidden": "true",
|
|
369
370
|
className: "text-inherit select-none",
|
|
370
371
|
children: ":"
|
|
@@ -372,10 +373,10 @@ var m = {
|
|
|
372
373
|
]
|
|
373
374
|
}, e.key);
|
|
374
375
|
})
|
|
375
|
-
}),
|
|
376
|
+
}), y]
|
|
376
377
|
})]
|
|
377
378
|
});
|
|
378
379
|
});
|
|
379
|
-
|
|
380
|
+
v.displayName = "DateTimeDisplayInput";
|
|
380
381
|
//#endregion
|
|
381
|
-
export {
|
|
382
|
+
export { v as DateTimeDisplayInput };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../styles/main.css";
|
|
3
|
-
import { t as e } from "../twUtils-
|
|
3
|
+
import { t as e } from "../twUtils-D_qzdiwM.js";
|
|
4
4
|
import { Input as t } from "../primitives/input.js";
|
|
5
|
-
import { F as n, S as r, _ as i, g as a, h as o, m as s, p as c, t as l, v as u } from "../DateTimeUtils-
|
|
5
|
+
import { F as n, S as r, _ as i, g as a, h as o, m as s, p as c, t as l, v as u } from "../DateTimeUtils-DrR2JWoU.js";
|
|
6
6
|
import { useCallback as d, useEffect as f, useMemo as p, useRef as m } from "react";
|
|
7
7
|
import { jsx as h } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/DateTimePicker/DateTimeInput.tsx
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as e, C as t, D as n, E as r, F as i, I as a, L as o, M as s, N as c, O as l, P as u, S as d, T as f, _ as p, a as m, b as h, c as g, d as _, f as v, g as y, h as b, i as x, j as S, k as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, u as M, v as N, w as P, x as F, y as I } from "../DateTimeUtils-
|
|
1
|
+
import { A as e, C as t, D as n, E as r, F as i, I as a, L as o, M as s, N as c, O as l, P as u, S as d, T as f, _ as p, a as m, b as h, c as g, d as _, f as v, g as y, h as b, i as x, j as S, k as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, u as M, v as N, w as P, x as F, y as I } from "../DateTimeUtils-DrR2JWoU.js";
|
|
2
2
|
export { j as DEFAULT_TRANSLATIONS, E as DateTimeConfigSchema, k as HourFormatSchema, x as PICKER_TYPES, m as PeriodSchema, D as TIME_BOUNDS, A as TimePickerTypeSchema, g as TimeValueSchema, w as convert12HourTo24Hour, M as detectHourFormat, _ as display12HourValue, v as formatSelectPeriodLabel, O as formatTimeNumber, T as getAriaLabel, b as getAriaValueMinMax, y as getAriaValueNow, p as getArrowByType, N as getDateByType, I as getLocalizedPeriodLabel, h as getLocalizedPeriodLabels, F as getPeriodFromHours, d as getResolvedLocale, t as getValid12Hour, P as getValidArrow12Hour, f as getValidArrowHour, r as getValidArrowMinute, n as getValidArrowNumber, l as getValidHour, C as getValidMinute, e as getValidNumber, S as isValid12Hour, s as isValidHour, c as isValidMinute, u as set12Hours, i as setDateByType, a as setHours, o as setMinutes };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../styles/main.css";
|
|
3
|
-
import { t as e } from "../twUtils-
|
|
3
|
+
import { t as e } from "../twUtils-D_qzdiwM.js";
|
|
4
4
|
import { Select as t, SelectContent as n, SelectItem as r, SelectTrigger as i, SelectValue as a } from "../primitives/select.js";
|
|
5
5
|
import { forwardRef as o } from "react";
|
|
6
6
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
@@ -8,41 +8,38 @@ import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
|
8
8
|
var l = {
|
|
9
9
|
am: "AM",
|
|
10
10
|
pm: "PM"
|
|
11
|
-
}, u = o(({ ariaLabel: o, className: u, disabled: d, labels: f = l, onLeftFocus: p, onPeriodChange: m, onRightFocus: h, period: g, ..._ }, v) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
value: "PM",
|
|
41
|
-
children: f.pm
|
|
42
|
-
})]
|
|
11
|
+
}, u = o(({ ariaLabel: o, className: u, disabled: d, labels: f = l, onLeftFocus: p, onPeriodChange: m, onRightFocus: h, period: g, ..._ }, v) => /* @__PURE__ */ c(t, {
|
|
12
|
+
defaultValue: g,
|
|
13
|
+
disabled: d,
|
|
14
|
+
onValueChange: (e) => m(e),
|
|
15
|
+
value: g,
|
|
16
|
+
children: [/* @__PURE__ */ s(i, {
|
|
17
|
+
"aria-label": o ?? `Select ${f.am} or ${f.pm}`,
|
|
18
|
+
className: e("w-fit", u),
|
|
19
|
+
"data-slot": "time-period-select",
|
|
20
|
+
"data-testid": "spectral-time-period-select",
|
|
21
|
+
onKeyDown: (e) => {
|
|
22
|
+
e.key === "ArrowRight" && (e.preventDefault(), h?.()), e.key === "ArrowLeft" && (e.preventDefault(), p?.());
|
|
23
|
+
},
|
|
24
|
+
ref: v,
|
|
25
|
+
size: "sm",
|
|
26
|
+
..._,
|
|
27
|
+
children: /* @__PURE__ */ s(a, { children: g === "AM" ? f.am : f.pm })
|
|
28
|
+
}), /* @__PURE__ */ c(n, {
|
|
29
|
+
"data-testid": "spectral-time-period-select-content",
|
|
30
|
+
position: "popper",
|
|
31
|
+
sideOffset: 4,
|
|
32
|
+
children: [/* @__PURE__ */ s(r, {
|
|
33
|
+
"data-testid": "spectral-time-period-select-am",
|
|
34
|
+
value: "AM",
|
|
35
|
+
children: f.am
|
|
36
|
+
}), /* @__PURE__ */ s(r, {
|
|
37
|
+
"data-testid": "spectral-time-period-select-pm",
|
|
38
|
+
value: "PM",
|
|
39
|
+
children: f.pm
|
|
43
40
|
})]
|
|
44
|
-
})
|
|
45
|
-
});
|
|
41
|
+
})]
|
|
42
|
+
}));
|
|
46
43
|
u.displayName = "TimePeriodSelect";
|
|
47
44
|
//#endregion
|
|
48
45
|
export { u as TimePeriodSelect };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../styles/main.css";
|
|
3
|
-
import { t as e } from "../twUtils-
|
|
4
|
-
import { S as t, b as n, f as r, t as i, u as a, x as o } from "../DateTimeUtils-
|
|
3
|
+
import { t as e } from "../twUtils-D_qzdiwM.js";
|
|
4
|
+
import { S as t, b as n, f as r, t as i, u as a, x as o } from "../DateTimeUtils-DrR2JWoU.js";
|
|
5
5
|
import { DateTimeInput as s } from "./DateTimeInput.js";
|
|
6
6
|
import { TimePeriodSelect as c } from "./TimePeriodSelect.js";
|
|
7
7
|
import { useMemo as l, useRef as u } from "react";
|
package/dist/DateTimePicker.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface DateTimePickerProps extends Omit<ComponentProps<'div'>, 'onChan
|
|
|
20
20
|
value?: Date;
|
|
21
21
|
}
|
|
22
22
|
export declare const DateTimePicker: {
|
|
23
|
-
({ calendarProps, className, defaultValue, disabled, disablePastDates, errorMessage, hourFormat, label, locale, onChange, showTimePicker, state, timeLocale, timeTranslations, value, ...props }: DateTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
({ calendarProps, className, defaultValue, disabled, disablePastDates, errorMessage, hourFormat, label, locale, onChange, showTimePicker, state, timeLocale, timeTranslations, value, id, ...props }: DateTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
displayName: string;
|
|
25
25
|
};
|
|
26
26
|
export { Calendar } from './Calendar';
|
package/dist/DateTimePicker.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
3
|
import { CalendarIcon as e } from "./Icons/CalendarIcon.js";
|
|
4
|
-
import { t } from "./twUtils-
|
|
5
|
-
import { ErrorMessage as n } from "./utils/formFieldUtils.js";
|
|
6
|
-
import { useUncontrolledState as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { t as
|
|
9
|
-
import { A as
|
|
4
|
+
import { t } from "./twUtils-D_qzdiwM.js";
|
|
5
|
+
import { ErrorMessage as n, getErrorMessageId as r, useFormFieldId as i } from "./utils/formFieldUtils.js";
|
|
6
|
+
import { useUncontrolledState as a } from "./hooks/useUncontrolledState.js";
|
|
7
|
+
import { Popover as o, PopoverContent as s, PopoverTrigger as ee } from "./Popover.js";
|
|
8
|
+
import { t as c } from "./Calendar-2UVWeLYp.js";
|
|
9
|
+
import { A as l, C as u, D as d, E as f, F as p, I as m, L as h, M as g, N as _, O as v, P as y, S as b, T as x, _ as S, a as C, b as w, c as T, d as E, f as D, g as O, h as k, i as A, j, k as M, l as N, m as P, n as F, o as I, p as L, r as te, s as R, t as z, u as B, v as V, w as H, x as U, y as W } from "./DateTimeUtils-DrR2JWoU.js";
|
|
10
10
|
import { DateTimeDisplayInput as G } from "./DateTimePicker/DateTimeDisplayInput.js";
|
|
11
11
|
import { DateTimeInput as K } from "./DateTimePicker/DateTimeInput.js";
|
|
12
12
|
import { TimePeriodSelect as q } from "./DateTimePicker/TimePeriodSelect.js";
|
|
@@ -14,77 +14,80 @@ import { TimePicker as J } from "./DateTimePicker/TimePicker.js";
|
|
|
14
14
|
import { useCallback as Y, useMemo as X } from "react";
|
|
15
15
|
import { jsx as Z, jsxs as Q } from "react/jsx-runtime";
|
|
16
16
|
//#region src/components/DateTimePicker/DateTimePicker.tsx
|
|
17
|
-
var $ = ({ calendarProps:
|
|
18
|
-
let
|
|
19
|
-
defaultValue:
|
|
20
|
-
onChange:
|
|
21
|
-
value:
|
|
22
|
-
}),
|
|
17
|
+
var $ = ({ calendarProps: l, className: u, defaultValue: d, disabled: f = !1, disablePastDates: p = !0, errorMessage: m, hourFormat: h, label: g, locale: _, onChange: v, showTimePicker: y = !0, state: x = "default", timeLocale: S, timeTranslations: C, value: w, id: T, ...E }) => {
|
|
18
|
+
let D = i(T), O = r(D), k = x === "error" && m ? O : void 0, [A, j] = a({
|
|
19
|
+
defaultValue: d,
|
|
20
|
+
onChange: v,
|
|
21
|
+
value: w
|
|
22
|
+
}), M = X(() => b(S), [S]), N = X(() => h ?? B(M), [h, M]), P = (e) => {
|
|
23
23
|
if (!e) {
|
|
24
|
-
|
|
24
|
+
j(void 0);
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
-
|
|
27
|
+
A && e.setHours(A.getHours(), A.getMinutes(), 0, 0), j(e);
|
|
28
|
+
}, F = Y((e) => {
|
|
29
|
+
j(e);
|
|
30
|
+
}, [j]), I = (e) => {}, L = (e) => {
|
|
31
|
+
j(e);
|
|
32
32
|
};
|
|
33
|
-
return /* @__PURE__ */ Q(
|
|
34
|
-
className: t("w-full",
|
|
33
|
+
return /* @__PURE__ */ Q(o, { children: [/* @__PURE__ */ Q("div", {
|
|
34
|
+
className: t("w-full", u),
|
|
35
35
|
"data-slot": "datetime-picker",
|
|
36
36
|
"data-testid": "spectral-datetime-picker",
|
|
37
|
-
...
|
|
37
|
+
...E,
|
|
38
38
|
children: [/* @__PURE__ */ Z(G, {
|
|
39
|
-
|
|
39
|
+
"aria-describedby": k,
|
|
40
|
+
"aria-invalid": x === "error",
|
|
41
|
+
className: t("gap-4 pr-12 flex w-full justify-start", !A && "text-text-secondary"),
|
|
40
42
|
"data-testid": "spectral-datetime-picker-input",
|
|
41
|
-
disabled:
|
|
42
|
-
endIcon: /* @__PURE__ */ Z(
|
|
43
|
+
disabled: f,
|
|
44
|
+
endIcon: /* @__PURE__ */ Z(ee, {
|
|
43
45
|
asChild: !0,
|
|
44
|
-
disabled:
|
|
46
|
+
disabled: f,
|
|
45
47
|
children: /* @__PURE__ */ Z(e, {
|
|
46
48
|
"aria-label": "Open date picker",
|
|
47
|
-
className: t("right-4 text-input-icon hover:text-input-icon--hover absolute top-1/2 -translate-y-1/2 cursor-pointer focus:outline-none",
|
|
49
|
+
className: t("right-4 text-input-icon hover:text-input-icon--hover absolute top-1/2 -translate-y-1/2 cursor-pointer focus:outline-none", f ? "pointer-events-none cursor-not-allowed opacity-50" : "hover:text-input-icon--hover cursor-pointer"),
|
|
48
50
|
"data-testid": "spectral-datetime-picker-trigger",
|
|
49
|
-
disabled:
|
|
51
|
+
disabled: f
|
|
50
52
|
})
|
|
51
53
|
}),
|
|
52
|
-
hourFormat:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
hourFormat: N,
|
|
55
|
+
id: D,
|
|
56
|
+
label: g,
|
|
57
|
+
onChange: L,
|
|
58
|
+
showTime: y,
|
|
59
|
+
state: x,
|
|
60
|
+
value: A
|
|
61
|
+
}), x === "error" && m && /* @__PURE__ */ Z(n, {
|
|
60
62
|
dataTestId: "spectral-datetime-picker-error-message",
|
|
61
|
-
id:
|
|
63
|
+
id: O,
|
|
64
|
+
message: m
|
|
62
65
|
})]
|
|
63
|
-
}), /* @__PURE__ */ Q(
|
|
66
|
+
}), /* @__PURE__ */ Q(s, {
|
|
64
67
|
align: "start",
|
|
65
|
-
className: t("rounded-lg py-4 px-6 flex", !
|
|
68
|
+
className: t("rounded-lg py-4 px-6 flex", !y && "w-[330px]", y && N === "24" && "w-[486px]", y && N === "12" && "w-[560px]"),
|
|
66
69
|
"data-testid": "spectral-datetime-picker-popover",
|
|
67
70
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
68
|
-
children: [/* @__PURE__ */ Z(
|
|
69
|
-
...
|
|
70
|
-
disablePastDates:
|
|
71
|
-
locale:
|
|
71
|
+
children: [/* @__PURE__ */ Z(c, {
|
|
72
|
+
...l,
|
|
73
|
+
disablePastDates: p,
|
|
74
|
+
locale: _,
|
|
72
75
|
mode: "single",
|
|
73
|
-
onSelect:
|
|
74
|
-
selected:
|
|
75
|
-
}),
|
|
76
|
+
onSelect: P,
|
|
77
|
+
selected: A
|
|
78
|
+
}), y && /* @__PURE__ */ Z("div", {
|
|
76
79
|
className: "pl-6 border-l border-border-secondary",
|
|
77
80
|
children: /* @__PURE__ */ Z(J, {
|
|
78
|
-
date:
|
|
79
|
-
hourFormat:
|
|
80
|
-
locale:
|
|
81
|
-
onChange:
|
|
82
|
-
onPeriodChange:
|
|
83
|
-
translations:
|
|
81
|
+
date: A,
|
|
82
|
+
hourFormat: N,
|
|
83
|
+
locale: M,
|
|
84
|
+
onChange: F,
|
|
85
|
+
onPeriodChange: I,
|
|
86
|
+
translations: C
|
|
84
87
|
})
|
|
85
88
|
})]
|
|
86
89
|
})] });
|
|
87
90
|
};
|
|
88
91
|
$.displayName = "DateTimePicker";
|
|
89
92
|
//#endregion
|
|
90
|
-
export {
|
|
93
|
+
export { c as Calendar, z as DEFAULT_TRANSLATIONS, F as DateTimeConfigSchema, G as DateTimeDisplayInput, K as DateTimeInput, $ as DateTimePicker, te as HourFormatSchema, A as PICKER_TYPES, C as PeriodSchema, I as TIME_BOUNDS, q as TimePeriodSelect, J as TimePicker, R as TimePickerTypeSchema, T as TimeValueSchema, N as convert12HourTo24Hour, B as detectHourFormat, E as display12HourValue, D as formatSelectPeriodLabel, L as formatTimeNumber, P as getAriaLabel, k as getAriaValueMinMax, O as getAriaValueNow, S as getArrowByType, V as getDateByType, W as getLocalizedPeriodLabel, w as getLocalizedPeriodLabels, U as getPeriodFromHours, b as getResolvedLocale, u as getValid12Hour, H as getValidArrow12Hour, x as getValidArrowHour, f as getValidArrowMinute, d as getValidArrowNumber, v as getValidHour, M as getValidMinute, l as getValidNumber, j as isValid12Hour, g as isValidHour, _ as isValidMinute, y as set12Hours, p as setDateByType, m as setHours, h as setMinutes };
|
|
@@ -62,7 +62,7 @@ function c(e) {
|
|
|
62
62
|
return e == null;
|
|
63
63
|
}
|
|
64
64
|
function l(e) {
|
|
65
|
-
let t = e.startsWith("^")
|
|
65
|
+
let t = +!!e.startsWith("^"), n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
66
66
|
return e.slice(t, n);
|
|
67
67
|
}
|
|
68
68
|
function u(e, t) {
|
package/dist/Dialog.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./styles/main.css";
|
|
2
2
|
import { CloseIcon as e } from "./Icons/CloseIcon.js";
|
|
3
|
-
import { t } from "./twUtils-
|
|
4
|
-
import { n } from "./
|
|
5
|
-
import { a as r, c as i, i as a, n as o, o as s, r as c, s as l, t as u } from "./dist-
|
|
3
|
+
import { t } from "./twUtils-D_qzdiwM.js";
|
|
4
|
+
import { t as n } from "./Combination-9q50p_Vu.js";
|
|
5
|
+
import { a as r, c as i, i as a, n as o, o as s, r as c, s as l, t as u } from "./dist-D6QANKSj.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/Dialog/Dialog.tsx
|
package/dist/Drawer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./styles/main.css";
|
|
2
2
|
import { SpectralProvider as e } from "./SpectralProvider.js";
|
|
3
|
-
import { t } from "./dist-
|
|
3
|
+
import { t } from "./dist-Tbzy5UFA.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/Drawer/Drawer.tsx
|