@sth87/shadcn-design-system 0.2.11 → 0.3.0
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 +2 -3
- package/dist/AI_CONTEXT.md +4 -4
- package/dist/cjs/components/Calendar/Calendar.cjs +1 -1
- package/dist/cjs/components/Calendar/index.cjs +1 -1
- package/dist/cjs/components/Checkbox/Checkbox.cjs +1 -1
- package/dist/cjs/components/Checkbox/Confetti.cjs +1 -0
- package/dist/cjs/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/cjs/components/DatePicker/RangePicker.cjs +1 -1
- package/dist/cjs/components/DatePicker/TimePicker.cjs +1 -1
- package/dist/cjs/components/Slider/Slider.cjs +1 -1
- package/dist/cjs/components/Slider/SpecSliderLabel.cjs +1 -0
- package/dist/cjs/components/Table/TableFilter/data-table-filter-popover.cjs +1 -1
- package/dist/cjs/components/Table/data-table.cjs +1 -1
- package/dist/cjs/components/Tabs/Tabs.cjs +1 -1
- package/dist/cjs/components/Tooltip/SpecTooltip.cjs +1 -0
- package/dist/cjs/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/packages/ui/src/components/calendar-logic.cjs +1 -0
- package/dist/cjs/packages/ui/src/components/calendar.cjs +1 -1
- package/dist/cjs/styles/index.css +1 -1
- package/dist/cjs/utils/animations.cjs +1 -1
- package/dist/cjs/utils/data-table.cjs +1 -1
- package/dist/cjs/utils/date-format.cjs +1 -0
- package/dist/esm/components/Calendar/Calendar.js +23 -19
- package/dist/esm/components/Calendar/index.js +7 -3
- package/dist/esm/components/Checkbox/Checkbox.js +46 -44
- package/dist/esm/components/Checkbox/Confetti.js +28 -0
- package/dist/esm/components/DatePicker/DatePicker.js +78 -81
- package/dist/esm/components/DatePicker/RangePicker.js +121 -124
- package/dist/esm/components/DatePicker/TimePicker.js +122 -124
- package/dist/esm/components/Slider/Slider.js +140 -199
- package/dist/esm/components/Slider/SpecSliderLabel.js +60 -0
- package/dist/esm/components/Table/TableFilter/data-table-filter-popover.js +30 -26
- package/dist/esm/components/Table/data-table.js +51 -47
- package/dist/esm/components/Tabs/Tabs.js +80 -91
- package/dist/esm/components/Tooltip/SpecTooltip.js +69 -0
- package/dist/esm/components/Tooltip/Tooltip.js +42 -85
- package/dist/esm/index.js +162 -158
- package/dist/esm/packages/ui/src/components/calendar-logic.js +83 -0
- package/dist/esm/packages/ui/src/components/calendar.js +459 -184
- package/dist/esm/styles/index.css +1 -1
- package/dist/esm/utils/animations.js +36 -44
- package/dist/esm/utils/data-table.js +6 -0
- package/dist/esm/utils/date-format.js +162 -0
- package/dist/types/components/Calendar/Calendar.d.ts +5 -5
- package/dist/types/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/types/components/Calendar/index.d.ts +1 -1
- package/dist/types/components/Calendar/index.d.ts.map +1 -1
- package/dist/types/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/types/components/Checkbox/Confetti.d.ts +2 -0
- package/dist/types/components/Checkbox/Confetti.d.ts.map +1 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/types/components/DatePicker/RangePicker.d.ts.map +1 -1
- package/dist/types/components/DatePicker/TimePicker.d.ts.map +1 -1
- package/dist/types/components/Marquee/Marquee.d.ts +1 -1
- package/dist/types/components/Slider/Slider.d.ts +1 -1
- package/dist/types/components/Slider/Slider.d.ts.map +1 -1
- package/dist/types/components/Slider/SpecSliderLabel.d.ts +14 -0
- package/dist/types/components/Slider/SpecSliderLabel.d.ts.map +1 -0
- package/dist/types/components/Table/TableFilter/data-table-filter-popover.d.ts.map +1 -1
- package/dist/types/components/Table/data-table.d.ts.map +1 -1
- package/dist/types/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/types/components/Tooltip/SpecTooltip.d.ts +11 -0
- package/dist/types/components/Tooltip/SpecTooltip.d.ts.map +1 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/components/Upload/Upload.d.ts +1 -1
- package/dist/types/packages/ui/src/components/badge.d.ts +2 -2
- package/dist/types/packages/ui/src/components/button.d.ts +1 -1
- package/dist/types/packages/ui/src/components/calendar-logic.d.ts +72 -0
- package/dist/types/packages/ui/src/components/calendar-logic.d.ts.map +1 -0
- package/dist/types/packages/ui/src/components/calendar.d.ts +95 -6
- package/dist/types/packages/ui/src/components/calendar.d.ts.map +1 -1
- package/dist/types/utils/animations.d.ts +0 -19
- package/dist/types/utils/animations.d.ts.map +1 -1
- package/dist/types/utils/data-table.d.ts.map +1 -1
- package/dist/types/utils/date-format.d.ts +24 -0
- package/dist/types/utils/date-format.d.ts.map +1 -0
- package/package.json +2 -3
- package/dist/cjs/utils/css.cjs +0 -1
- package/dist/esm/utils/css.js +0 -24
- package/dist/types/utils/css.d.ts +0 -4
- package/dist/types/utils/css.d.ts.map +0 -1
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as E, useEffect as Ne, useRef as U, useMemo as _, useCallback as V, memo as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Popover as
|
|
5
|
-
import { Drawer as
|
|
1
|
+
import { jsxs as w, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as E, useEffect as Ne, useRef as U, useMemo as _, useCallback as V, memo as $e } from "react";
|
|
3
|
+
import { cn as H } from "../../packages/ui/src/lib/utils.js";
|
|
4
|
+
import { Popover as ze, PopoverTrigger as Ee, PopoverContent as Ue } from "../../packages/ui/src/components/popover.js";
|
|
5
|
+
import { Drawer as qe, DrawerTrigger as Ae, DrawerContent as Ge, DrawerHeader as Je, DrawerTitle as Ke, DrawerDescription as Qe } from "../../packages/ui/src/components/drawer.js";
|
|
6
6
|
import { isMobile as De } from "react-device-detect";
|
|
7
|
-
import { Clock as
|
|
7
|
+
import { Clock as We } from "lucide-react";
|
|
8
8
|
import { TimeColumnwheel as B } from "../WheelColumn.js";
|
|
9
|
-
import { TimeGridView as
|
|
10
|
-
import {
|
|
9
|
+
import { TimeGridView as Xe } from "../TimeGridView.js";
|
|
10
|
+
import { parseDate as Ye, isValidDate as Ze, formatDate as _e } from "../../utils/date-format.js";
|
|
11
11
|
import Be from "../Select/Select.js";
|
|
12
12
|
import L from "../Button/Button.js";
|
|
13
13
|
import Le from "../Input/Input.js";
|
|
14
|
-
const ee = (
|
|
15
|
-
const
|
|
16
|
-
for (let
|
|
17
|
-
|
|
18
|
-
return
|
|
19
|
-
}, q = (
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
if (Me(v))
|
|
23
|
-
return v;
|
|
14
|
+
const ee = (i, m = 1) => {
|
|
15
|
+
const b = [];
|
|
16
|
+
for (let C = 0; C < i; C += m)
|
|
17
|
+
b.push(C);
|
|
18
|
+
return b;
|
|
19
|
+
}, q = (i) => String(i).padStart(2, "0"), Se = (i, m = "HH:mm") => Ze(i) ? _e(i, m) : "", ye = (i, m = "HH:mm") => {
|
|
20
|
+
if (i)
|
|
21
|
+
return Ye(i, m, /* @__PURE__ */ new Date());
|
|
24
22
|
};
|
|
25
|
-
function es(
|
|
26
|
-
return
|
|
23
|
+
function es(i) {
|
|
24
|
+
return i.replace(/HH|mm|ss/g, (m) => {
|
|
27
25
|
switch (m) {
|
|
28
26
|
case "HH":
|
|
29
27
|
case "mm":
|
|
@@ -35,20 +33,20 @@ function es(o) {
|
|
|
35
33
|
}).replace(/H|m|s/g, () => "9");
|
|
36
34
|
}
|
|
37
35
|
function hs({
|
|
38
|
-
value:
|
|
36
|
+
value: i,
|
|
39
37
|
onChange: m,
|
|
40
|
-
onSelect:
|
|
41
|
-
showHours:
|
|
38
|
+
onSelect: b,
|
|
39
|
+
showHours: C = !0,
|
|
42
40
|
showMinutes: se = !0,
|
|
43
41
|
showSeconds: P = !1,
|
|
44
|
-
disabled:
|
|
42
|
+
disabled: v = !1,
|
|
45
43
|
className: te,
|
|
46
44
|
timeLabel: c,
|
|
47
45
|
mask: A,
|
|
48
46
|
format: y,
|
|
49
47
|
mode: l = "wheel",
|
|
50
|
-
hourInterval:
|
|
51
|
-
minuteInterval:
|
|
48
|
+
hourInterval: ne = 1,
|
|
49
|
+
minuteInterval: re = 1,
|
|
52
50
|
secondInterval: oe = 1,
|
|
53
51
|
disabledTimes: ie = [],
|
|
54
52
|
disabledTimeRanges: ce = [],
|
|
@@ -56,38 +54,38 @@ function hs({
|
|
|
56
54
|
nowButtonLabel: de = "Now",
|
|
57
55
|
standalone: O = !0,
|
|
58
56
|
desktopMode: ae = "popover",
|
|
59
|
-
mobileMode:
|
|
57
|
+
mobileMode: Me = "drawer",
|
|
60
58
|
color: R = "primary",
|
|
61
59
|
isOpen: ue,
|
|
62
|
-
...
|
|
60
|
+
...ke
|
|
63
61
|
}) {
|
|
64
62
|
let x, T;
|
|
65
63
|
typeof y == "string" ? (x = y, T = y) : y ? (x = y.input, T = y.output) : (x = P ? "HH:mm:ss" : "HH:mm", T = P ? "HH:mm:ss" : "HH:mm");
|
|
66
64
|
const [f, N] = E(void 0), [p, D] = E(void 0), [g, S] = E(void 0), [$, me] = E(!1);
|
|
67
65
|
Ne(() => {
|
|
68
|
-
if (
|
|
69
|
-
const e = ye(
|
|
66
|
+
if (i) {
|
|
67
|
+
const e = ye(i, x);
|
|
70
68
|
e && (N(e.getHours()), D(e.getMinutes()), S(e.getSeconds()));
|
|
71
69
|
} else
|
|
72
70
|
N(void 0), D(void 0), S(void 0);
|
|
73
|
-
}, [
|
|
71
|
+
}, [i, x]);
|
|
74
72
|
const G = U(null), J = U(null), K = U(null), Q = U(null), M = _(
|
|
75
|
-
() => ee(24,
|
|
76
|
-
[re]
|
|
77
|
-
), k = _(
|
|
78
|
-
() => ee(60, ne),
|
|
73
|
+
() => ee(24, ne),
|
|
79
74
|
[ne]
|
|
75
|
+
), k = _(
|
|
76
|
+
() => ee(60, re),
|
|
77
|
+
[re]
|
|
80
78
|
), j = _(
|
|
81
79
|
() => ee(60, oe),
|
|
82
80
|
[oe]
|
|
83
81
|
), d = V(
|
|
84
82
|
(e, s, t = 0) => {
|
|
85
|
-
const
|
|
86
|
-
if (ie.includes(
|
|
83
|
+
const r = `${q(e ?? 0)}:${q(s ?? 0)}${P ? `:${q(t ?? 0)}` : ""}`;
|
|
84
|
+
if (ie.includes(r))
|
|
87
85
|
return !0;
|
|
88
86
|
for (const a of ce) {
|
|
89
|
-
const [u,
|
|
90
|
-
if (Te >=
|
|
87
|
+
const [u, o, h = 0] = a.from.split(":").map(Number), [z, Ie, Fe = 0] = a.to.split(":").map(Number), Te = (e ?? 0) * 3600 + (s ?? 0) * 60 + (t ?? 0), Oe = u * 3600 + o * 60 + h, Re = z * 3600 + Ie * 60 + Fe;
|
|
88
|
+
if (Te >= Oe && Te <= Re)
|
|
91
89
|
return !0;
|
|
92
90
|
}
|
|
93
91
|
return !1;
|
|
@@ -99,40 +97,40 @@ function hs({
|
|
|
99
97
|
return typeof c == "boolean" ? c ? e === "hours" ? "Hour" : e === "minutes" ? "Minute" : "Second" : void 0 : typeof c == "string" ? c : e === "hours" ? c.hours || "Hour" : e === "minutes" ? c.minutes || "Minute" : c.seconds || "Second";
|
|
100
98
|
},
|
|
101
99
|
[c]
|
|
102
|
-
), fe = typeof c == "string" && /* @__PURE__ */
|
|
100
|
+
), fe = typeof c == "string" && /* @__PURE__ */ n(
|
|
103
101
|
"div",
|
|
104
102
|
{
|
|
105
103
|
className: "ds:text-xs ds:font-semibold ds:text-muted-foreground ds:uppercase ds:p-2 ds:border-b ds:w-full ds:text-center",
|
|
106
104
|
children: c
|
|
107
105
|
},
|
|
108
106
|
"common-label"
|
|
109
|
-
),
|
|
107
|
+
), Ve = V(
|
|
110
108
|
(e, s, t = 0) => {
|
|
111
|
-
const
|
|
112
|
-
(
|
|
109
|
+
const r = M.reduce(
|
|
110
|
+
(o, h) => Math.abs(h - e) < Math.abs(o - e) ? h : o
|
|
113
111
|
), a = k.reduce(
|
|
114
|
-
(
|
|
112
|
+
(o, h) => Math.abs(h - s) < Math.abs(o - s) ? h : o
|
|
115
113
|
), u = j.reduce(
|
|
116
|
-
(
|
|
114
|
+
(o, h) => Math.abs(h - t) < Math.abs(o - t) ? h : o
|
|
117
115
|
);
|
|
118
|
-
if (d(
|
|
119
|
-
for (const
|
|
116
|
+
if (d(r, a, u)) {
|
|
117
|
+
for (const o of M)
|
|
120
118
|
for (const h of k)
|
|
121
119
|
for (const z of j)
|
|
122
|
-
if (!d(
|
|
123
|
-
return { h:
|
|
120
|
+
if (!d(o, h, z))
|
|
121
|
+
return { h: o, m: h, s: z };
|
|
124
122
|
}
|
|
125
|
-
return { h:
|
|
123
|
+
return { h: r, m: a, s: u };
|
|
126
124
|
},
|
|
127
125
|
[M, k, j, d]
|
|
128
126
|
), I = V(
|
|
129
127
|
(e, s, t) => {
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
const a = Se(
|
|
133
|
-
m?.(void 0, a,
|
|
128
|
+
const r = /* @__PURE__ */ new Date();
|
|
129
|
+
r.setHours(e, s, t, 0);
|
|
130
|
+
const a = Se(r, T);
|
|
131
|
+
m?.(void 0, a, r), b?.(r, a);
|
|
134
132
|
},
|
|
135
|
-
[T, m,
|
|
133
|
+
[T, m, b]
|
|
136
134
|
), pe = (e) => {
|
|
137
135
|
d(e, p, g) || (N(e), I(e, p ?? 0, g ?? 0));
|
|
138
136
|
}, he = (e) => {
|
|
@@ -146,9 +144,9 @@ function hs({
|
|
|
146
144
|
"[data-selected]"
|
|
147
145
|
);
|
|
148
146
|
if (s) {
|
|
149
|
-
const t = e.current,
|
|
147
|
+
const t = e.current, r = t.clientHeight, a = s.offsetTop, u = s.clientHeight, o = a - r / 2 + u / 2;
|
|
150
148
|
t.scrollTo({
|
|
151
|
-
top:
|
|
149
|
+
top: o,
|
|
152
150
|
behavior: "smooth"
|
|
153
151
|
});
|
|
154
152
|
}
|
|
@@ -158,12 +156,12 @@ function hs({
|
|
|
158
156
|
), X = V(() => {
|
|
159
157
|
l === "wheel" ? (F(G), F(J), F(K)) : l === "compact" && F(Q);
|
|
160
158
|
}, [G, J, K, Q, l, F]), ve = () => {
|
|
161
|
-
const e = /* @__PURE__ */ new Date(), { h: s, m: t, s:
|
|
159
|
+
const e = /* @__PURE__ */ new Date(), { h: s, m: t, s: r } = Ve(
|
|
162
160
|
e.getHours(),
|
|
163
161
|
e.getMinutes(),
|
|
164
162
|
e.getSeconds()
|
|
165
163
|
);
|
|
166
|
-
N(s), D(t), S(
|
|
164
|
+
N(s), D(t), S(r), I(s, t, r), setTimeout(() => X(), 100);
|
|
167
165
|
};
|
|
168
166
|
Ne(() => {
|
|
169
167
|
if ((O ? $ : ue) || (f !== void 0 || p !== void 0 || g !== void 0)) {
|
|
@@ -180,57 +178,57 @@ function hs({
|
|
|
180
178
|
p,
|
|
181
179
|
g
|
|
182
180
|
]);
|
|
183
|
-
const Y =
|
|
181
|
+
const Y = $e(
|
|
184
182
|
({
|
|
185
183
|
items: e,
|
|
186
184
|
value: s,
|
|
187
185
|
onChange: t,
|
|
188
|
-
timeLabel:
|
|
186
|
+
timeLabel: r,
|
|
189
187
|
type: a
|
|
190
|
-
}) => /* @__PURE__ */
|
|
191
|
-
|
|
192
|
-
/* @__PURE__ */
|
|
188
|
+
}) => /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-2", children: [
|
|
189
|
+
r && /* @__PURE__ */ n("div", { className: "ds:text-xs ds:font-semibold ds:text-muted-foreground ds:uppercase ds:p-2 ds:border-b ds:w-full ds:text-center", children: r }),
|
|
190
|
+
/* @__PURE__ */ n("div", { className: "ds:p-2", children: /* @__PURE__ */ n(
|
|
193
191
|
Be,
|
|
194
192
|
{
|
|
195
193
|
value: s?.toString() || "",
|
|
196
194
|
onValueChange: (u) => t(Number(u)),
|
|
197
|
-
disabled:
|
|
195
|
+
disabled: v,
|
|
198
196
|
clearable: !1,
|
|
199
197
|
search: !1,
|
|
200
198
|
options: e.map((u) => {
|
|
201
|
-
const
|
|
199
|
+
const o = a === "hours" && d(u, p, g) || a === "minutes" && d(f, u, g) || a === "seconds" && d(f, p, u);
|
|
202
200
|
return {
|
|
203
201
|
label: q(u),
|
|
204
202
|
value: u.toString(),
|
|
205
|
-
disabled:
|
|
203
|
+
disabled: o
|
|
206
204
|
};
|
|
207
205
|
})
|
|
208
206
|
}
|
|
209
207
|
) })
|
|
210
208
|
] })
|
|
211
|
-
),
|
|
209
|
+
), Pe = (e, s) => {
|
|
212
210
|
d(e, s, 0) || (N(e), D(s), S(0), I(e, s, 0));
|
|
213
211
|
}, we = () => {
|
|
214
212
|
const e = [];
|
|
215
213
|
if (l === "compact")
|
|
216
|
-
return /* @__PURE__ */
|
|
217
|
-
|
|
214
|
+
return /* @__PURE__ */ n(
|
|
215
|
+
Xe,
|
|
218
216
|
{
|
|
219
217
|
HOURS: M,
|
|
220
218
|
MINUTES: k,
|
|
221
219
|
hours: f,
|
|
222
220
|
minutes: p,
|
|
223
|
-
disabled:
|
|
221
|
+
disabled: v,
|
|
224
222
|
isTimeDisabled: d,
|
|
225
|
-
onTimeSelect:
|
|
223
|
+
onTimeSelect: Pe,
|
|
226
224
|
ref: Q,
|
|
227
225
|
color: R
|
|
228
226
|
}
|
|
229
227
|
);
|
|
230
|
-
if (
|
|
228
|
+
if (C) {
|
|
231
229
|
const s = typeof c == "string" ? void 0 : W("hours");
|
|
232
230
|
l === "wheel" ? e.push(
|
|
233
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ n(
|
|
234
232
|
B,
|
|
235
233
|
{
|
|
236
234
|
ref: G,
|
|
@@ -239,13 +237,13 @@ function hs({
|
|
|
239
237
|
onChange: pe,
|
|
240
238
|
timeLabel: s,
|
|
241
239
|
isItemDisabled: (t) => d(t, p, g),
|
|
242
|
-
disabled:
|
|
240
|
+
disabled: v,
|
|
243
241
|
color: R
|
|
244
242
|
},
|
|
245
243
|
"hours"
|
|
246
244
|
)
|
|
247
245
|
) : l === "select" && e.push(
|
|
248
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ n(
|
|
249
247
|
Y,
|
|
250
248
|
{
|
|
251
249
|
items: M,
|
|
@@ -261,7 +259,7 @@ function hs({
|
|
|
261
259
|
if (se) {
|
|
262
260
|
const s = typeof c == "string" ? void 0 : W("minutes");
|
|
263
261
|
l === "wheel" ? e.push(
|
|
264
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ n(
|
|
265
263
|
B,
|
|
266
264
|
{
|
|
267
265
|
ref: J,
|
|
@@ -269,15 +267,15 @@ function hs({
|
|
|
269
267
|
value: p,
|
|
270
268
|
onChange: he,
|
|
271
269
|
timeLabel: s,
|
|
272
|
-
itemClassName:
|
|
270
|
+
itemClassName: C ? "ds:border-l" : void 0,
|
|
273
271
|
isItemDisabled: (t) => d(f, t, g),
|
|
274
|
-
disabled:
|
|
272
|
+
disabled: v,
|
|
275
273
|
color: R
|
|
276
274
|
},
|
|
277
275
|
"minutes"
|
|
278
276
|
)
|
|
279
277
|
) : l === "select" && e.push(
|
|
280
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ n(
|
|
281
279
|
Y,
|
|
282
280
|
{
|
|
283
281
|
items: k,
|
|
@@ -293,7 +291,7 @@ function hs({
|
|
|
293
291
|
if (P) {
|
|
294
292
|
const s = typeof c == "string" ? void 0 : W("seconds");
|
|
295
293
|
l === "wheel" ? e.push(
|
|
296
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ n(
|
|
297
295
|
B,
|
|
298
296
|
{
|
|
299
297
|
ref: K,
|
|
@@ -301,15 +299,15 @@ function hs({
|
|
|
301
299
|
value: g,
|
|
302
300
|
onChange: ge,
|
|
303
301
|
timeLabel: s,
|
|
304
|
-
itemClassName: se ||
|
|
302
|
+
itemClassName: se || C ? "ds:border-l" : void 0,
|
|
305
303
|
isItemDisabled: (t) => d(f, p, t),
|
|
306
|
-
disabled:
|
|
304
|
+
disabled: v,
|
|
307
305
|
color: R
|
|
308
306
|
},
|
|
309
307
|
"seconds"
|
|
310
308
|
)
|
|
311
309
|
) : l === "select" && e.push(
|
|
312
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ n(
|
|
313
311
|
Y,
|
|
314
312
|
{
|
|
315
313
|
items: j,
|
|
@@ -325,43 +323,43 @@ function hs({
|
|
|
325
323
|
return e;
|
|
326
324
|
};
|
|
327
325
|
if (!O)
|
|
328
|
-
return /* @__PURE__ */
|
|
326
|
+
return /* @__PURE__ */ w(
|
|
329
327
|
"div",
|
|
330
328
|
{
|
|
331
|
-
className:
|
|
329
|
+
className: H("ds:flex ds:flex-col ds:gap-2 ds:h-full ds:justify-between", te),
|
|
332
330
|
children: [
|
|
333
331
|
fe,
|
|
334
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ n(
|
|
335
333
|
"div",
|
|
336
334
|
{
|
|
337
|
-
className:
|
|
335
|
+
className: H(
|
|
338
336
|
"ds:flex ds:rounded ds:overflow-clip ds:mb-auto",
|
|
339
337
|
l === "wheel" ? "ds:items-end ds:justify-center ds:p-0 ds:h-72" : "ds:items-start ds:justify-center"
|
|
340
338
|
),
|
|
341
339
|
children: we()
|
|
342
340
|
}
|
|
343
341
|
),
|
|
344
|
-
le && /* @__PURE__ */
|
|
342
|
+
le && /* @__PURE__ */ n(
|
|
345
343
|
L,
|
|
346
344
|
{
|
|
347
345
|
type: "button",
|
|
348
346
|
variant: "solid",
|
|
349
347
|
size: "xs",
|
|
350
348
|
onClick: ve,
|
|
351
|
-
disabled:
|
|
352
|
-
className:
|
|
349
|
+
disabled: v,
|
|
350
|
+
className: H("ds:rounded-none"),
|
|
353
351
|
children: de
|
|
354
352
|
}
|
|
355
353
|
)
|
|
356
354
|
]
|
|
357
355
|
}
|
|
358
356
|
);
|
|
359
|
-
const He = /* @__PURE__ */
|
|
357
|
+
const He = /* @__PURE__ */ w("div", { className: H("ds:flex ds:flex-col ds:gap-4 ds:h-full", te), children: [
|
|
360
358
|
fe,
|
|
361
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ n(
|
|
362
360
|
"div",
|
|
363
361
|
{
|
|
364
|
-
className:
|
|
362
|
+
className: H(
|
|
365
363
|
"ds:flex ds:rounded ds:overflow-clip ds:my-auto ds:mx-auto ds:max-w-sm ds:md:max-w-md ds:lg:max-w-lg ds:relative",
|
|
366
364
|
l === "wheel" ? "ds:items-end ds:justify-center ds:p-0" : "ds:items-start ds:justify-center",
|
|
367
365
|
{
|
|
@@ -372,81 +370,81 @@ function hs({
|
|
|
372
370
|
children: we()
|
|
373
371
|
}
|
|
374
372
|
),
|
|
375
|
-
le && /* @__PURE__ */
|
|
373
|
+
le && /* @__PURE__ */ n(
|
|
376
374
|
L,
|
|
377
375
|
{
|
|
378
376
|
type: "button",
|
|
379
377
|
variant: "solid",
|
|
380
378
|
size: "xs",
|
|
381
379
|
onClick: ve,
|
|
382
|
-
disabled:
|
|
383
|
-
className:
|
|
380
|
+
disabled: v,
|
|
381
|
+
className: H("ds:rounded-none"),
|
|
384
382
|
children: de
|
|
385
383
|
}
|
|
386
384
|
)
|
|
387
|
-
] }), be = /* @__PURE__ */
|
|
385
|
+
] }), be = /* @__PURE__ */ w(
|
|
388
386
|
L,
|
|
389
387
|
{
|
|
390
388
|
variant: "ghost",
|
|
391
389
|
className: "ds:!p-1 ds:!leading-0 ds:h-auto ds:rounded ds:hover:bg-accent ds:transition-colors",
|
|
392
|
-
disabled:
|
|
390
|
+
disabled: v,
|
|
393
391
|
children: [
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ n(We, { className: "ds:size-4" }),
|
|
393
|
+
/* @__PURE__ */ n("span", { className: "ds:sr-only", children: "Select time" })
|
|
396
394
|
]
|
|
397
395
|
}
|
|
398
|
-
), Ce = /* @__PURE__ */
|
|
399
|
-
/* @__PURE__ */
|
|
400
|
-
/* @__PURE__ */
|
|
401
|
-
|
|
396
|
+
), Ce = /* @__PURE__ */ w(ze, { open: $, onOpenChange: me, children: [
|
|
397
|
+
/* @__PURE__ */ n(Ee, { asChild: !0, disabled: v, children: be }),
|
|
398
|
+
/* @__PURE__ */ n(
|
|
399
|
+
Ue,
|
|
402
400
|
{
|
|
403
|
-
className:
|
|
401
|
+
className: H(
|
|
404
402
|
"ds:w-auto ds:overflow-hidden ds:p-0",
|
|
405
403
|
"ds:backdrop-blur ds:bg-background/50"
|
|
406
404
|
),
|
|
407
405
|
children: He
|
|
408
406
|
}
|
|
409
407
|
)
|
|
410
|
-
] }), xe = /* @__PURE__ */
|
|
411
|
-
/* @__PURE__ */
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
|
|
408
|
+
] }), xe = /* @__PURE__ */ w(qe, { open: $, onOpenChange: me, children: [
|
|
409
|
+
/* @__PURE__ */ n(Ae, { asChild: !0, children: be }),
|
|
410
|
+
/* @__PURE__ */ w(
|
|
411
|
+
Ge,
|
|
414
412
|
{
|
|
415
|
-
className:
|
|
413
|
+
className: H(
|
|
416
414
|
"ds:w-auto ds:overflow-hidden ds:p-0",
|
|
417
415
|
"ds:backdrop-blur ds:bg-background"
|
|
418
416
|
),
|
|
419
417
|
children: [
|
|
420
|
-
/* @__PURE__ */
|
|
421
|
-
/* @__PURE__ */
|
|
422
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ w(Je, { className: "ds:sr-only", children: [
|
|
419
|
+
/* @__PURE__ */ n(Ke, { children: "Select time" }),
|
|
420
|
+
/* @__PURE__ */ n(Qe, { children: "Choose a time" })
|
|
423
421
|
] }),
|
|
424
422
|
He
|
|
425
423
|
]
|
|
426
424
|
}
|
|
427
425
|
)
|
|
428
|
-
] }),
|
|
426
|
+
] }), je = T;
|
|
429
427
|
let Z;
|
|
430
|
-
return A === !0 ? Z = es(x) : typeof A == "string" && (Z = A), /* @__PURE__ */
|
|
428
|
+
return A === !0 ? Z = es(x) : typeof A == "string" && (Z = A), /* @__PURE__ */ n(
|
|
431
429
|
Le,
|
|
432
430
|
{
|
|
433
|
-
...
|
|
431
|
+
...ke,
|
|
434
432
|
clearable: !0,
|
|
435
|
-
value:
|
|
436
|
-
placeholder:
|
|
433
|
+
value: i || "",
|
|
434
|
+
placeholder: je,
|
|
437
435
|
mask: Z,
|
|
438
|
-
disabled:
|
|
436
|
+
disabled: v,
|
|
439
437
|
className: "ds:cursor-pointer",
|
|
440
438
|
onChange: (e) => {
|
|
441
439
|
const s = e.target.value, t = ye(s, x);
|
|
442
440
|
if (t) {
|
|
443
441
|
N(t.getHours()), D(t.getMinutes()), S(t.getSeconds());
|
|
444
|
-
const
|
|
445
|
-
m?.(e,
|
|
442
|
+
const r = Se(t, T);
|
|
443
|
+
m?.(e, r, t), b?.(t, r);
|
|
446
444
|
} else
|
|
447
|
-
N(0), D(0), S(0), m?.(e, s, void 0),
|
|
445
|
+
N(0), D(0), S(0), m?.(e, s, void 0), b?.(void 0, s);
|
|
448
446
|
},
|
|
449
|
-
suffixIcon: De ?
|
|
447
|
+
suffixIcon: De ? Me === "drawer" ? xe : Ce : ae === "drawer" ? xe : Ce
|
|
450
448
|
}
|
|
451
449
|
);
|
|
452
450
|
}
|