asheeui 0.6.5 → 0.6.7
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/components/accordion/Accordion.js +10 -10
- package/dist/components/autocomplete/Autocomplete.d.ts +8 -0
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +120 -118
- package/dist/components/autocomplete/autocomplete-config.d.ts +27 -1
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-config.js +14 -6
- package/dist/components/date-picker/DatePicker.d.ts +20 -0
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +230 -229
- package/dist/components/date-picker/date-picker-config.d.ts +16 -0
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +14 -10
- package/dist/components/keyboard/OnScreenKeyboard.d.ts +16 -6
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +96 -90
- package/dist/components/keyboard/index.js +1 -0
- package/dist/components/keyboard/keyboard-config.d.ts +27 -1
- package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
- package/dist/components/keyboard/keyboard-config.js +12 -8
- package/dist/components/keyboard/keyboard-context.d.ts +4 -7
- package/dist/components/keyboard/keyboard-context.d.ts.map +1 -1
- package/dist/components/keyboard/keyboard-context.js +61 -58
- package/dist/components/keyboard/keyboard-styles.d.ts +13 -0
- package/dist/components/keyboard/keyboard-styles.d.ts.map +1 -0
- package/dist/components/keyboard/keyboard-styles.js +14 -0
- package/dist/components/multi-select/MultiSelect.d.ts +8 -0
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +186 -184
- package/dist/components/multi-select/multi-select-config.d.ts +18 -0
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +14 -10
- package/dist/components/resizable-screen/ResizableScreen.d.ts +23 -11
- package/dist/components/resizable-screen/ResizableScreen.d.ts.map +1 -1
- package/dist/components/resizable-screen/ResizableScreen.js +69 -60
- package/dist/components/select/Select.d.ts +8 -6
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +135 -135
- package/dist/components/select/select-config.d.ts +27 -1
- package/dist/components/select/select-config.d.ts.map +1 -1
- package/dist/components/select/select-config.js +14 -6
- package/dist/components/select-menu/SelectMenu.d.ts +23 -1
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +72 -67
- package/dist/components/select-menu/index.d.ts +1 -0
- package/dist/components/select-menu/index.d.ts.map +1 -1
- package/dist/components/select-menu/index.js +1 -0
- package/dist/components/select-menu/select-menu-config.d.ts +1 -1
- package/dist/components/select-menu/select-menu-config.js +3 -3
- package/dist/components/select-menu/use-select-floating.d.ts +95 -0
- package/dist/components/select-menu/use-select-floating.d.ts.map +1 -0
- package/dist/components/select-menu/use-select-floating.js +36 -0
- package/dist/components/toast/toast-config.d.ts +11 -0
- package/dist/components/toast/toast-config.d.ts.map +1 -1
- package/dist/components/toast/toast-config.js +4 -2
- package/dist/components/toast/toast-context.d.ts +21 -1
- package/dist/components/toast/toast-context.d.ts.map +1 -1
- package/dist/components/toast/toast-context.js +134 -114
- package/dist/config/resolve-config.d.ts.map +1 -1
- package/dist/utils/merge-object.d.ts +7 -1
- package/dist/utils/merge-object.d.ts.map +1 -1
- package/dist/utils/types.d.ts +16 -4
- package/dist/utils/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import {
|
|
4
|
-
import { forwardRef as
|
|
2
|
+
import { jsx as r, jsxs as h, Fragment as xe } from "react/jsx-runtime";
|
|
3
|
+
import { useClick as ve, useDismiss as ye, useRole as Se, useInteractions as we, FloatingFocusManager as De } from "@floating-ui/react";
|
|
4
|
+
import { forwardRef as Ne, useId as Me, useState as R, useCallback as U, useMemo as Ae } from "react";
|
|
5
|
+
import { createPortal as ke } from "react-dom";
|
|
5
6
|
import { CalendarIcon as Ie } from "../../icons/CalendarIcon.js";
|
|
6
7
|
import { ChevronLeftIcon as Fe } from "../../icons/ChevronLeftIcon.js";
|
|
7
|
-
import { ChevronRightIcon as
|
|
8
|
-
import { ClearIcon as
|
|
9
|
-
import { ClockIcon as
|
|
10
|
-
import { useAsheeConfig as
|
|
11
|
-
import { resolveCascade as
|
|
12
|
-
import { FieldShell as
|
|
13
|
-
import { FALLBACK_DATE_PICKER_CONFIG as
|
|
14
|
-
import { CALENDAR_COLOR_CLASSES as
|
|
15
|
-
import { resolveVariantClass as
|
|
8
|
+
import { ChevronRightIcon as _e } from "../../icons/ChevronRightIcon.js";
|
|
9
|
+
import { ClearIcon as Re } from "../../icons/ClearIcon.js";
|
|
10
|
+
import { ClockIcon as Te } from "../../icons/ClockIcon.js";
|
|
11
|
+
import { useAsheeConfig as Ce } from "../../libs/context.js";
|
|
12
|
+
import { resolveCascade as I, resolveRadiusKey as Pe, resolveClassKey as ee } from "../../utils/resolve-token.js";
|
|
13
|
+
import { FieldShell as Ee } from "../field/FieldShell.js";
|
|
14
|
+
import { FALLBACK_DATE_PICKER_CONFIG as p } from "./date-picker-config.js";
|
|
15
|
+
import { CALENDAR_COLOR_CLASSES as O, DATE_PICKER_CELL_SIZE_CLASS as $e, DATE_PICKER_STATUS_BORDER_CLASS as Le, DATE_PICKER_SIZE_CLASS as Ye } from "./date-picker-styles.js";
|
|
16
|
+
import { resolveVariantClass as Ke } from "../../shared/variant.js";
|
|
16
17
|
import { RADIUS_CLASS as te } from "../../shared/radius.js";
|
|
18
|
+
import { useSelectFloating as je } from "../select-menu/use-select-floating.js";
|
|
17
19
|
import { cn as d } from "../../utils/cn.js";
|
|
18
|
-
const
|
|
20
|
+
const Oe = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], ze = [
|
|
19
21
|
"January",
|
|
20
22
|
"February",
|
|
21
23
|
"March",
|
|
@@ -29,21 +31,21 @@ const Ke = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], Oe = [
|
|
|
29
31
|
"November",
|
|
30
32
|
"December"
|
|
31
33
|
];
|
|
32
|
-
function
|
|
34
|
+
function T(e) {
|
|
33
35
|
return String(e).padStart(2, "0");
|
|
34
36
|
}
|
|
35
|
-
function
|
|
36
|
-
const
|
|
37
|
+
function He(e, n) {
|
|
38
|
+
const i = T(e.getDate()), m = T(e.getMonth() + 1), l = e.getFullYear(), a = T(e.getHours()), u = T(e.getMinutes());
|
|
37
39
|
switch (n) {
|
|
38
40
|
case "date":
|
|
39
|
-
return `${
|
|
41
|
+
return `${i}/${m}/${l}`;
|
|
40
42
|
case "time":
|
|
41
|
-
return `${
|
|
43
|
+
return `${a}:${u}`;
|
|
42
44
|
case "datetime":
|
|
43
|
-
return `${
|
|
45
|
+
return `${i}/${m}/${l} ${a}:${u}`;
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
|
-
function
|
|
48
|
+
function Ve(e) {
|
|
47
49
|
switch (e) {
|
|
48
50
|
case "date":
|
|
49
51
|
return "Select date...";
|
|
@@ -53,167 +55,167 @@ function He(e) {
|
|
|
53
55
|
return "Select date & time...";
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
|
-
function
|
|
57
|
-
const
|
|
58
|
+
function Je(e, n) {
|
|
59
|
+
const i = new Date(e, n + 1, 0).getDate(), m = new Date(e, n, 1).getDay(), l = [
|
|
58
60
|
...Array(m).fill(null),
|
|
59
|
-
...Array.from({ length:
|
|
61
|
+
...Array.from({ length: i }, (a, u) => u + 1)
|
|
60
62
|
];
|
|
61
|
-
for (;
|
|
62
|
-
return
|
|
63
|
+
for (; l.length % 7 !== 0; ) l.push(null);
|
|
64
|
+
return l;
|
|
63
65
|
}
|
|
64
66
|
function oe({
|
|
65
67
|
value: e,
|
|
66
68
|
max: n,
|
|
67
|
-
label:
|
|
69
|
+
label: i,
|
|
68
70
|
onChange: m,
|
|
69
|
-
resolvedColor:
|
|
70
|
-
radiusClass:
|
|
71
|
+
resolvedColor: l,
|
|
72
|
+
radiusClass: a
|
|
71
73
|
}) {
|
|
72
|
-
const u = () => m(e >= n ? 0 : e + 1),
|
|
74
|
+
const u = () => m(e >= n ? 0 : e + 1), y = () => m(e <= 0 ? n : e - 1), S = O[l] ?? O.primary;
|
|
73
75
|
return /* @__PURE__ */ h("div", { className: "flex flex-col items-center gap-0.5", children: [
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ r("span", { className: "text-[10px] uppercase tracking-widest text-foreground/70 select-none", children: i }),
|
|
77
|
+
/* @__PURE__ */ r(
|
|
76
78
|
"button",
|
|
77
79
|
{
|
|
78
80
|
type: "button",
|
|
79
81
|
className: d(
|
|
80
82
|
"w-10 h-7 flex items-center justify-center text-xs text-foreground/70 transition-colors",
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
a,
|
|
84
|
+
S.hover
|
|
83
85
|
),
|
|
84
86
|
onClick: u,
|
|
85
|
-
"aria-label": `Increment ${
|
|
87
|
+
"aria-label": `Increment ${i}`,
|
|
86
88
|
children: "▲"
|
|
87
89
|
}
|
|
88
90
|
),
|
|
89
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ r(
|
|
90
92
|
"div",
|
|
91
93
|
{
|
|
92
94
|
className: d(
|
|
93
95
|
"w-10 h-10 flex items-center justify-center text-base font-mono font-bold text-foreground bg-background border border-border select-none",
|
|
94
|
-
|
|
96
|
+
a
|
|
95
97
|
),
|
|
96
|
-
children:
|
|
98
|
+
children: T(e)
|
|
97
99
|
}
|
|
98
100
|
),
|
|
99
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ r(
|
|
100
102
|
"button",
|
|
101
103
|
{
|
|
102
104
|
type: "button",
|
|
103
105
|
className: d(
|
|
104
106
|
"w-10 h-7 flex items-center justify-center text-xs text-foreground/70 transition-colors",
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
a,
|
|
108
|
+
S.hover
|
|
107
109
|
),
|
|
108
|
-
onClick:
|
|
109
|
-
"aria-label": `Decrement ${
|
|
110
|
+
onClick: y,
|
|
111
|
+
"aria-label": `Decrement ${i}`,
|
|
110
112
|
children: "▼"
|
|
111
113
|
}
|
|
112
114
|
)
|
|
113
115
|
] });
|
|
114
116
|
}
|
|
115
|
-
function
|
|
117
|
+
function Be({
|
|
116
118
|
selected: e,
|
|
117
119
|
mode: n,
|
|
118
|
-
isClearable:
|
|
120
|
+
isClearable: i,
|
|
119
121
|
resolvedSizeKey: m,
|
|
120
|
-
resolvedColor:
|
|
121
|
-
radiusClass:
|
|
122
|
+
resolvedColor: l,
|
|
123
|
+
radiusClass: a,
|
|
122
124
|
onSelect: u,
|
|
123
|
-
onClose:
|
|
124
|
-
disableFuture:
|
|
125
|
+
onClose: y,
|
|
126
|
+
disableFuture: S = !1
|
|
125
127
|
}) {
|
|
126
|
-
const c = /* @__PURE__ */ new Date(), [g,
|
|
128
|
+
const c = /* @__PURE__ */ new Date(), [g, C] = R(
|
|
127
129
|
(e == null ? void 0 : e.getFullYear()) ?? c.getFullYear()
|
|
128
|
-
), [f,
|
|
130
|
+
), [f, N] = R(
|
|
129
131
|
(e == null ? void 0 : e.getMonth()) ?? c.getMonth()
|
|
130
|
-
), [b,
|
|
131
|
-
function
|
|
132
|
-
const
|
|
132
|
+
), [b, P] = R((e == null ? void 0 : e.getHours()) ?? 0), [F, z] = R((e == null ? void 0 : e.getMinutes()) ?? 0), x = O[l] ?? O.primary;
|
|
133
|
+
function E(t, s) {
|
|
134
|
+
const _ = e ?? /* @__PURE__ */ new Date();
|
|
133
135
|
u(
|
|
134
|
-
new Date(
|
|
136
|
+
new Date(_.getFullYear(), _.getMonth(), _.getDate(), t, s, 0, 0)
|
|
135
137
|
);
|
|
136
138
|
}
|
|
137
|
-
function
|
|
138
|
-
|
|
139
|
+
function H(t) {
|
|
140
|
+
P(t), E(t, F);
|
|
139
141
|
}
|
|
140
|
-
function
|
|
141
|
-
|
|
142
|
+
function V(t) {
|
|
143
|
+
z(t), E(b, t);
|
|
142
144
|
}
|
|
143
|
-
function
|
|
144
|
-
u(new Date(g, f, t, b,
|
|
145
|
+
function J(t) {
|
|
146
|
+
u(new Date(g, f, t, b, F, 0, 0)), n === "date" && y();
|
|
145
147
|
}
|
|
146
|
-
function
|
|
147
|
-
f === 0 ? (
|
|
148
|
+
function M() {
|
|
149
|
+
f === 0 ? (N(11), C((t) => t - 1)) : N((t) => t - 1);
|
|
148
150
|
}
|
|
149
|
-
function
|
|
150
|
-
f === 11 ? (
|
|
151
|
+
function A() {
|
|
152
|
+
f === 11 ? (N(0), C((t) => t + 1)) : N((t) => t + 1);
|
|
151
153
|
}
|
|
152
|
-
function
|
|
154
|
+
function o(t) {
|
|
153
155
|
return !!e && e.getFullYear() === g && e.getMonth() === f && e.getDate() === t;
|
|
154
156
|
}
|
|
155
|
-
function
|
|
157
|
+
function B(t) {
|
|
156
158
|
return c.getFullYear() === g && c.getMonth() === f && c.getDate() === t;
|
|
157
159
|
}
|
|
158
|
-
const
|
|
160
|
+
const G = new Date(
|
|
159
161
|
c.getFullYear(),
|
|
160
162
|
c.getMonth(),
|
|
161
163
|
c.getDate()
|
|
162
164
|
);
|
|
163
|
-
function
|
|
164
|
-
return
|
|
165
|
+
function w(t) {
|
|
166
|
+
return S ? new Date(g, f, t) > G : !1;
|
|
165
167
|
}
|
|
166
|
-
const
|
|
167
|
-
key: t !== null ? `day-${t}` : `empty-slot-${
|
|
168
|
+
const $ = !S || g < c.getFullYear() || g === c.getFullYear() && f < c.getMonth(), L = n === "date" || n === "datetime", Y = n === "time" || n === "datetime", K = n !== "date" || i && !!e, k = Je(g, f), v = Ae(() => k.map((t, s) => ({
|
|
169
|
+
key: t !== null ? `day-${t}` : `empty-slot-${s}`,
|
|
168
170
|
day: t
|
|
169
|
-
})), [
|
|
171
|
+
})), [k]);
|
|
170
172
|
return /* @__PURE__ */ h(
|
|
171
173
|
"div",
|
|
172
174
|
{
|
|
173
175
|
className: d(
|
|
174
176
|
"bg-background border border-border shadow-xl select-none p-3 min-w-70",
|
|
175
|
-
|
|
177
|
+
a
|
|
176
178
|
),
|
|
177
179
|
children: [
|
|
178
|
-
|
|
180
|
+
L && /* @__PURE__ */ h(xe, { children: [
|
|
179
181
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between pb-2 mb-2 border-b border-border", children: [
|
|
180
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ r(
|
|
181
183
|
"button",
|
|
182
184
|
{
|
|
183
185
|
type: "button",
|
|
184
|
-
onClick:
|
|
186
|
+
onClick: M,
|
|
185
187
|
"aria-label": "Previous month",
|
|
186
188
|
className: d(
|
|
187
189
|
"p-1 text-foreground transition-colors",
|
|
188
|
-
|
|
190
|
+
a,
|
|
189
191
|
x.hover
|
|
190
192
|
),
|
|
191
|
-
children: /* @__PURE__ */
|
|
193
|
+
children: /* @__PURE__ */ r(Fe, {})
|
|
192
194
|
}
|
|
193
195
|
),
|
|
194
196
|
/* @__PURE__ */ h("span", { className: "font-medium text-sm text-foreground", children: [
|
|
195
|
-
|
|
197
|
+
ze[f],
|
|
196
198
|
" ",
|
|
197
199
|
g
|
|
198
200
|
] }),
|
|
199
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ r(
|
|
200
202
|
"button",
|
|
201
203
|
{
|
|
202
204
|
type: "button",
|
|
203
|
-
onClick:
|
|
204
|
-
disabled:
|
|
205
|
+
onClick: A,
|
|
206
|
+
disabled: !$,
|
|
205
207
|
"aria-label": "Next month",
|
|
206
208
|
className: d(
|
|
207
209
|
"p-1 text-foreground transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
|
|
208
|
-
|
|
210
|
+
a,
|
|
209
211
|
x.hover
|
|
210
212
|
),
|
|
211
|
-
children: /* @__PURE__ */
|
|
213
|
+
children: /* @__PURE__ */ r(_e, {})
|
|
212
214
|
}
|
|
213
215
|
)
|
|
214
216
|
] }),
|
|
215
217
|
/* @__PURE__ */ h("div", { className: "grid grid-cols-7 gap-1 text-center", children: [
|
|
216
|
-
|
|
218
|
+
Oe.map((t) => /* @__PURE__ */ r(
|
|
217
219
|
"div",
|
|
218
220
|
{
|
|
219
221
|
className: "text-xs font-semibold text-foreground/70 py-1",
|
|
@@ -221,71 +223,71 @@ function Je({
|
|
|
221
223
|
},
|
|
222
224
|
t
|
|
223
225
|
)),
|
|
224
|
-
|
|
225
|
-
({ key: t, day:
|
|
226
|
+
v.map(
|
|
227
|
+
({ key: t, day: s }) => s === null ? /* @__PURE__ */ r("div", {}, t) : /* @__PURE__ */ r(
|
|
226
228
|
"button",
|
|
227
229
|
{
|
|
228
230
|
type: "button",
|
|
229
|
-
onClick: () =>
|
|
230
|
-
disabled:
|
|
231
|
+
onClick: () => J(s),
|
|
232
|
+
disabled: w(s),
|
|
231
233
|
className: d(
|
|
232
234
|
"w-full flex items-center justify-center font-medium transition-colors",
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
235
|
+
$e[m],
|
|
236
|
+
a,
|
|
237
|
+
w(s) ? "opacity-30 cursor-not-allowed text-foreground/70" : o(s) ? d(x.bg, "font-semibold") : B(s) ? d("border", x.border, x.text) : d("text-foreground", x.hover)
|
|
236
238
|
),
|
|
237
|
-
children:
|
|
239
|
+
children: s
|
|
238
240
|
},
|
|
239
|
-
|
|
241
|
+
s
|
|
240
242
|
)
|
|
241
243
|
)
|
|
242
244
|
] })
|
|
243
245
|
] }),
|
|
244
|
-
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
+
Y && /* @__PURE__ */ h("div", { className: "flex items-center justify-center gap-4 py-3 border-t border-border mt-2", children: [
|
|
247
|
+
/* @__PURE__ */ r(
|
|
246
248
|
oe,
|
|
247
249
|
{
|
|
248
250
|
value: b,
|
|
249
251
|
max: 23,
|
|
250
252
|
label: "HH",
|
|
251
|
-
onChange:
|
|
252
|
-
resolvedColor:
|
|
253
|
-
radiusClass:
|
|
253
|
+
onChange: H,
|
|
254
|
+
resolvedColor: l,
|
|
255
|
+
radiusClass: a
|
|
254
256
|
}
|
|
255
257
|
),
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ r("span", { className: "text-xl font-bold text-foreground/70 select-none pt-3", children: ":" }),
|
|
259
|
+
/* @__PURE__ */ r(
|
|
258
260
|
oe,
|
|
259
261
|
{
|
|
260
|
-
value:
|
|
262
|
+
value: F,
|
|
261
263
|
max: 59,
|
|
262
264
|
label: "MM",
|
|
263
|
-
onChange:
|
|
264
|
-
resolvedColor:
|
|
265
|
-
radiusClass:
|
|
265
|
+
onChange: V,
|
|
266
|
+
resolvedColor: l,
|
|
267
|
+
radiusClass: a
|
|
266
268
|
}
|
|
267
269
|
)
|
|
268
270
|
] }),
|
|
269
|
-
|
|
270
|
-
|
|
271
|
+
K && /* @__PURE__ */ h("div", { className: "flex items-center justify-between border-t border-border pt-2 mt-2", children: [
|
|
272
|
+
i && e && /* @__PURE__ */ r(
|
|
271
273
|
"button",
|
|
272
274
|
{
|
|
273
275
|
type: "button",
|
|
274
276
|
onClick: () => {
|
|
275
|
-
u(null),
|
|
277
|
+
u(null), y();
|
|
276
278
|
},
|
|
277
279
|
className: "text-xs text-foreground/70 hover:text-danger transition-colors",
|
|
278
280
|
children: "Clear"
|
|
279
281
|
}
|
|
280
282
|
),
|
|
281
|
-
n !== "date" && /* @__PURE__ */
|
|
283
|
+
n !== "date" && /* @__PURE__ */ r(
|
|
282
284
|
"button",
|
|
283
285
|
{
|
|
284
286
|
type: "button",
|
|
285
|
-
onClick:
|
|
287
|
+
onClick: y,
|
|
286
288
|
className: d(
|
|
287
289
|
"ml-auto text-xs font-medium px-3 py-1.5 hover:opacity-90 transition-opacity",
|
|
288
|
-
|
|
290
|
+
a,
|
|
289
291
|
x.bg
|
|
290
292
|
),
|
|
291
293
|
children: "Done"
|
|
@@ -296,186 +298,185 @@ function Je({
|
|
|
296
298
|
}
|
|
297
299
|
);
|
|
298
300
|
}
|
|
299
|
-
const
|
|
301
|
+
const Ge = Ne(
|
|
300
302
|
({
|
|
301
303
|
selected: e,
|
|
302
304
|
onChange: n,
|
|
303
|
-
mode:
|
|
305
|
+
mode: i,
|
|
304
306
|
size: m,
|
|
305
|
-
radius:
|
|
306
|
-
variant:
|
|
307
|
+
radius: l,
|
|
308
|
+
variant: a,
|
|
307
309
|
color: u,
|
|
308
|
-
status:
|
|
309
|
-
label:
|
|
310
|
+
status: y,
|
|
311
|
+
label: S,
|
|
310
312
|
labelAlign: c,
|
|
311
313
|
description: g,
|
|
312
|
-
message:
|
|
314
|
+
message: C,
|
|
313
315
|
required: f,
|
|
314
|
-
isLoading:
|
|
316
|
+
isLoading: N,
|
|
315
317
|
disabled: b,
|
|
316
|
-
isClearable:
|
|
317
|
-
disableFuture:
|
|
318
|
-
placeholder:
|
|
318
|
+
isClearable: P = !1,
|
|
319
|
+
disableFuture: F = !1,
|
|
320
|
+
placeholder: z,
|
|
319
321
|
className: x,
|
|
320
|
-
id:
|
|
321
|
-
style:
|
|
322
|
-
|
|
322
|
+
id: E,
|
|
323
|
+
style: H,
|
|
324
|
+
portal: V,
|
|
325
|
+
portalTarget: J
|
|
326
|
+
}, M) => {
|
|
323
327
|
var X;
|
|
324
|
-
const
|
|
325
|
-
open: F,
|
|
326
|
-
onOpenChange: (p) => !b && P(p),
|
|
327
|
-
placement: "bottom-start",
|
|
328
|
-
whileElementsMounted: he,
|
|
329
|
-
middleware: [
|
|
330
|
-
ge(4),
|
|
331
|
-
be(),
|
|
332
|
-
xe({ padding: 8 }),
|
|
333
|
-
ye({
|
|
334
|
-
apply({ availableHeight: p, elements: me }) {
|
|
335
|
-
Object.assign(me.floating.style, {
|
|
336
|
-
maxHeight: `${p}px`
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
})
|
|
340
|
-
]
|
|
341
|
-
}), U = ve(A, { enabled: !b }), B = we(A), T = Se(A, { role: "dialog" }), { getReferenceProps: G, getFloatingProps: t } = De([
|
|
342
|
-
U,
|
|
343
|
-
B,
|
|
344
|
-
T
|
|
345
|
-
]), i = j(
|
|
328
|
+
const A = Ce(), o = (X = A.components) == null ? void 0 : X.datePicker, B = Me(), G = E ?? B, [w, $] = R(!1), L = I(
|
|
346
329
|
m,
|
|
347
|
-
|
|
330
|
+
o == null ? void 0 : o.size,
|
|
348
331
|
void 0,
|
|
349
|
-
|
|
350
|
-
),
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
),
|
|
332
|
+
p.size
|
|
333
|
+
), Y = I(
|
|
334
|
+
a,
|
|
335
|
+
o == null ? void 0 : o.variant,
|
|
336
|
+
A.defaultVariant,
|
|
337
|
+
p.variant
|
|
338
|
+
), K = I(
|
|
356
339
|
u,
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
),
|
|
361
|
-
typeof
|
|
362
|
-
typeof (
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
),
|
|
340
|
+
o == null ? void 0 : o.color,
|
|
341
|
+
A.defaultColor,
|
|
342
|
+
p.color
|
|
343
|
+
), k = Pe(
|
|
344
|
+
typeof l == "string" ? l : void 0,
|
|
345
|
+
typeof (o == null ? void 0 : o.radius) == "string" ? o.radius : void 0,
|
|
346
|
+
A.defaultRadius,
|
|
347
|
+
p.radius
|
|
348
|
+
), v = y ?? p.status, t = I(
|
|
366
349
|
c,
|
|
367
|
-
|
|
350
|
+
o == null ? void 0 : o.labelAlign,
|
|
368
351
|
void 0,
|
|
369
|
-
|
|
370
|
-
),
|
|
352
|
+
p.labelAlign
|
|
353
|
+
), s = i ?? (o == null ? void 0 : o.mode) ?? p.mode, _ = I(
|
|
354
|
+
V,
|
|
355
|
+
o == null ? void 0 : o.portal,
|
|
356
|
+
void 0,
|
|
357
|
+
p.portal
|
|
358
|
+
), re = I(
|
|
359
|
+
J,
|
|
360
|
+
o == null ? void 0 : o.portalTarget,
|
|
361
|
+
void 0,
|
|
362
|
+
p.portalTarget
|
|
363
|
+
), ne = Ke(
|
|
364
|
+
Y,
|
|
365
|
+
v === "error" ? "danger" : v === "success" ? "success" : v === "warning" ? "warning" : K
|
|
366
|
+
), ae = v !== "default" ? Le[v] : "", se = Y === "underlined" ? "rounded-none" : ee(
|
|
371
367
|
k,
|
|
372
|
-
S === "error" ? "danger" : S === "success" ? "success" : S === "warning" ? "warning" : q
|
|
373
|
-
), se = S !== "default" ? Te[S] : "", ae = k === "underlined" ? "rounded-none" : ee(
|
|
374
|
-
W,
|
|
375
368
|
te,
|
|
376
|
-
|
|
377
|
-
),
|
|
378
|
-
|
|
369
|
+
p.radius
|
|
370
|
+
), le = ee(
|
|
371
|
+
k === "full" ? "xl" : k,
|
|
379
372
|
te,
|
|
380
|
-
|
|
381
|
-
),
|
|
382
|
-
|
|
373
|
+
p.radius
|
|
374
|
+
), { refs: W, floatingStyles: ie, context: j } = je({
|
|
375
|
+
isOpen: w,
|
|
376
|
+
onOpenChange: $,
|
|
377
|
+
disabled: b
|
|
378
|
+
}), ce = ve(j, { enabled: !b }), ue = ye(j), de = Se(j, { role: "dialog" }), { getReferenceProps: me, getFloatingProps: fe } = we([
|
|
379
|
+
ce,
|
|
380
|
+
ue,
|
|
381
|
+
de
|
|
382
|
+
]), pe = U(
|
|
383
|
+
(D) => n == null ? void 0 : n(D),
|
|
383
384
|
[n]
|
|
384
|
-
),
|
|
385
|
-
(
|
|
386
|
-
|
|
385
|
+
), he = U(() => $(!1), []), ge = U(
|
|
386
|
+
(D) => {
|
|
387
|
+
D.stopPropagation(), n == null || n(null);
|
|
387
388
|
},
|
|
388
389
|
[n]
|
|
389
|
-
),
|
|
390
|
-
|
|
391
|
-
|
|
390
|
+
), be = z ?? Ve(s), Z = e ? He(e, s) : null, q = w ? /* @__PURE__ */ r(De, { context: j, modal: !1, children: /* @__PURE__ */ r(
|
|
391
|
+
"div",
|
|
392
|
+
{
|
|
393
|
+
ref: W.setFloating,
|
|
394
|
+
style: { ...ie, zIndex: 999999 },
|
|
395
|
+
className: "outline-none",
|
|
396
|
+
...fe(),
|
|
397
|
+
children: /* @__PURE__ */ r("div", { className: "animate-in fade-in-0 zoom-in-95 duration-150 ease-out", children: /* @__PURE__ */ r(
|
|
398
|
+
Be,
|
|
399
|
+
{
|
|
400
|
+
selected: e,
|
|
401
|
+
mode: s,
|
|
402
|
+
isClearable: P,
|
|
403
|
+
resolvedSizeKey: L,
|
|
404
|
+
onSelect: pe,
|
|
405
|
+
onClose: he,
|
|
406
|
+
disableFuture: F,
|
|
407
|
+
resolvedColor: K,
|
|
408
|
+
radiusClass: le
|
|
409
|
+
}
|
|
410
|
+
) })
|
|
411
|
+
}
|
|
412
|
+
) }) : null, Q = re ?? (typeof document < "u" ? document.body : null);
|
|
413
|
+
return /* @__PURE__ */ r(
|
|
414
|
+
Ee,
|
|
392
415
|
{
|
|
393
|
-
id:
|
|
394
|
-
label:
|
|
395
|
-
labelAlign:
|
|
416
|
+
id: G,
|
|
417
|
+
label: S,
|
|
418
|
+
labelAlign: t,
|
|
396
419
|
description: g,
|
|
397
|
-
message:
|
|
398
|
-
status:
|
|
420
|
+
message: C,
|
|
421
|
+
status: v,
|
|
399
422
|
required: f,
|
|
400
|
-
isLoading:
|
|
423
|
+
isLoading: N,
|
|
401
424
|
children: /* @__PURE__ */ h("div", { className: "w-full relative inline-block", children: [
|
|
402
425
|
/* @__PURE__ */ h(
|
|
403
426
|
"div",
|
|
404
427
|
{
|
|
405
|
-
ref: (
|
|
406
|
-
|
|
428
|
+
ref: (D) => {
|
|
429
|
+
W.setReference(D), typeof M == "function" ? M(D) : M && (M.current = D);
|
|
407
430
|
},
|
|
408
431
|
role: "combobox",
|
|
409
432
|
tabIndex: b ? -1 : 0,
|
|
410
|
-
"aria-expanded":
|
|
433
|
+
"aria-expanded": w,
|
|
411
434
|
"aria-haspopup": "dialog",
|
|
412
|
-
"aria-invalid":
|
|
435
|
+
"aria-invalid": v === "error",
|
|
413
436
|
"aria-disabled": b,
|
|
414
437
|
className: d(
|
|
415
438
|
"w-full flex items-center justify-between cursor-pointer text-foreground outline-none transition-colors select-none shrink-0",
|
|
416
439
|
"focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
417
440
|
b && "pointer-events-none opacity-50 cursor-not-allowed",
|
|
418
|
-
Ye[
|
|
419
|
-
|
|
420
|
-
se,
|
|
441
|
+
Ye[L],
|
|
442
|
+
ne,
|
|
421
443
|
ae,
|
|
444
|
+
se,
|
|
422
445
|
x
|
|
423
446
|
),
|
|
424
|
-
style:
|
|
425
|
-
...
|
|
447
|
+
style: H,
|
|
448
|
+
...me(),
|
|
426
449
|
children: [
|
|
427
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ r(
|
|
428
451
|
"span",
|
|
429
452
|
{
|
|
430
|
-
className:
|
|
431
|
-
children:
|
|
453
|
+
className: Z ? "text-foreground" : "text-foreground/70",
|
|
454
|
+
children: Z ?? be
|
|
432
455
|
}
|
|
433
456
|
),
|
|
434
457
|
/* @__PURE__ */ h("div", { className: "flex items-center gap-1.5 ml-2 shrink-0", children: [
|
|
435
|
-
|
|
458
|
+
P && e && !b && /* @__PURE__ */ r(
|
|
436
459
|
"button",
|
|
437
460
|
{
|
|
438
461
|
type: "button",
|
|
439
|
-
onClick:
|
|
462
|
+
onClick: ge,
|
|
440
463
|
"aria-label": "Clear selection",
|
|
441
464
|
className: "p-0.5 rounded text-foreground/70 hover:text-foreground transition-colors",
|
|
442
|
-
children: /* @__PURE__ */
|
|
465
|
+
children: /* @__PURE__ */ r(Re, { className: "size-3.5" })
|
|
443
466
|
}
|
|
444
467
|
),
|
|
445
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ r("span", { className: "text-foreground/70 pointer-events-none", children: s === "time" ? /* @__PURE__ */ r(Te, {}) : /* @__PURE__ */ r(Ie, {}) })
|
|
446
469
|
] })
|
|
447
470
|
]
|
|
448
471
|
}
|
|
449
472
|
),
|
|
450
|
-
|
|
451
|
-
"div",
|
|
452
|
-
{
|
|
453
|
-
ref: C.setFloating,
|
|
454
|
-
style: { ...J, zIndex: 99999 },
|
|
455
|
-
className: "outline-none",
|
|
456
|
-
...t(),
|
|
457
|
-
children: /* @__PURE__ */ o("div", { className: "animate-in fade-in-0 zoom-in-95 duration-150 ease-out", children: /* @__PURE__ */ o(
|
|
458
|
-
Je,
|
|
459
|
-
{
|
|
460
|
-
selected: e,
|
|
461
|
-
mode: Y,
|
|
462
|
-
isClearable: $,
|
|
463
|
-
resolvedSizeKey: i,
|
|
464
|
-
onSelect: le,
|
|
465
|
-
onClose: ce,
|
|
466
|
-
disableFuture: I,
|
|
467
|
-
resolvedColor: q,
|
|
468
|
-
radiusClass: ie
|
|
469
|
-
}
|
|
470
|
-
) })
|
|
471
|
-
}
|
|
472
|
-
) })
|
|
473
|
+
w && (_ && Q ? ke(q, Q) : q)
|
|
473
474
|
] })
|
|
474
475
|
}
|
|
475
476
|
);
|
|
476
477
|
}
|
|
477
478
|
);
|
|
478
|
-
|
|
479
|
+
Ge.displayName = "DatePicker";
|
|
479
480
|
export {
|
|
480
|
-
|
|
481
|
+
Ge as DatePicker
|
|
481
482
|
};
|