snapflow-ui-kit 1.2.2 → 1.2.4
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/Textarea-6m6FiIv5.js +179 -0
- package/dist/{Textarea-D5WrCGtg.js.map → Textarea-6m6FiIv5.js.map} +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.types.d.ts +3 -0
- package/dist/components/Select/SelectDropdownContent.d.ts +15 -0
- package/dist/components/Select/useDebouncedValue.d.ts +1 -0
- package/dist/index.client.js +446 -403
- package/dist/index.client.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/index.server.js +1 -1
- package/package.json +1 -1
- package/dist/Textarea-D5WrCGtg.js +0 -179
- package/dist/components/DatePicker/hooks/useDatePickerState.d.ts +0 -4
package/dist/index.client.js
CHANGED
|
@@ -1,207 +1,231 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import { clsx as
|
|
4
|
-
import
|
|
5
|
-
import { default as
|
|
6
|
-
import { A as K, s as
|
|
7
|
-
import { B as
|
|
8
|
-
import { jsx as n, jsxs as
|
|
9
|
-
import { useEffect as x, useState as
|
|
10
|
-
import { A as
|
|
11
|
-
import { DayPicker as
|
|
12
|
-
import {
|
|
13
|
-
import { C as
|
|
14
|
-
import * as
|
|
15
|
-
import { createPortal as
|
|
16
|
-
import { FocusTrap as
|
|
17
|
-
import { toast as
|
|
18
|
-
const
|
|
19
|
-
|
|
2
|
+
import V, { clsx as v } from "clsx";
|
|
3
|
+
import { clsx as bn } from "clsx";
|
|
4
|
+
import oe from "simplebar-react";
|
|
5
|
+
import { default as vn } from "simplebar-react";
|
|
6
|
+
import { A as K, s as M, c as G } from "./Textarea-6m6FiIv5.js";
|
|
7
|
+
import { B as Cn, C as In, a as kn, L as Dn, R as xn, T as Sn, b as En } from "./Textarea-6m6FiIv5.js";
|
|
8
|
+
import { jsx as n, jsxs as m, Fragment as X } from "react/jsx-runtime";
|
|
9
|
+
import { useEffect as x, useState as j, useRef as W, useCallback as Y, useMemo as Q, forwardRef as re, useId as J } from "react";
|
|
10
|
+
import { A as ae, C as se, E as ce, a as ie, b as le, c as de } from "./ArrowRightIcon-D0SDyfKt.js";
|
|
11
|
+
import { DayPicker as H } from "react-day-picker";
|
|
12
|
+
import { format as T, parse as B, isValid as $ } from "date-fns";
|
|
13
|
+
import { C as U } from "./CloseIcon-CqK3tPnG.js";
|
|
14
|
+
import * as P from "@radix-ui/react-dropdown-menu";
|
|
15
|
+
import { createPortal as ue } from "react-dom";
|
|
16
|
+
import { FocusTrap as _e } from "focus-trap-react";
|
|
17
|
+
import { toast as F } from "react-hot-toast";
|
|
18
|
+
const un = (e) => {
|
|
19
|
+
F.custom((t) => /* @__PURE__ */ n(
|
|
20
20
|
K,
|
|
21
21
|
{
|
|
22
22
|
variant: "success",
|
|
23
23
|
message: e,
|
|
24
|
-
className: t.visible ?
|
|
25
|
-
onClose: () =>
|
|
24
|
+
className: t.visible ? M.toastEnter : M.toastExit,
|
|
25
|
+
onClose: () => F.dismiss(t.id)
|
|
26
26
|
}
|
|
27
27
|
));
|
|
28
|
-
},
|
|
29
|
-
|
|
28
|
+
}, _n = (e, t = "Error!") => {
|
|
29
|
+
F.custom((r) => /* @__PURE__ */ n(
|
|
30
30
|
K,
|
|
31
31
|
{
|
|
32
32
|
variant: "error",
|
|
33
33
|
title: t,
|
|
34
34
|
message: e,
|
|
35
|
-
className: r.visible ?
|
|
36
|
-
onClose: () =>
|
|
35
|
+
className: r.visible ? M.toastEnter : M.toastExit,
|
|
36
|
+
onClose: () => F.dismiss(r.id)
|
|
37
37
|
}
|
|
38
38
|
));
|
|
39
|
-
},
|
|
40
|
-
wrapper:
|
|
41
|
-
inputContainer:
|
|
42
|
-
label:
|
|
43
|
-
inputWrapper:
|
|
44
|
-
trigger:
|
|
45
|
-
icon:
|
|
46
|
-
placeholder:
|
|
47
|
-
clearButton:
|
|
48
|
-
clearIcon:
|
|
49
|
-
disabledLabel:
|
|
50
|
-
error:
|
|
51
|
-
calendar:
|
|
52
|
-
open:
|
|
53
|
-
monthsCaption:
|
|
54
|
-
navButtonPrevious:
|
|
55
|
-
navButtonNext:
|
|
56
|
-
navIcon:
|
|
57
|
-
monthGrid:
|
|
58
|
-
dropdowns:
|
|
59
|
-
weekday:
|
|
39
|
+
}, pe = "_wrapper_8euq6_1", me = "_inputContainer_8euq6_5", he = "_label_8euq6_11", ge = "_inputWrapper_8euq6_15", fe = "_trigger_8euq6_22", ye = "_icon_8euq6_36", be = "_placeholder_8euq6_43", we = "_clearButton_8euq6_47", ve = "_clearIcon_8euq6_87", Ne = "_disabledLabel_8euq6_99", Ce = "_error_8euq6_121", Ie = "_calendar_8euq6_139", ke = "_open_8euq6_159", De = "_monthsCaption_8euq6_165", xe = "_navButtonPrevious_8euq6_171", Se = "_navButtonNext_8euq6_172", Ee = "_navIcon_8euq6_192", je = "_monthGrid_8euq6_198", qe = "_dropdowns_8euq6_204", Oe = "_weekday_8euq6_208", Pe = "_day_8euq6_219", Re = "_dayButton_8euq6_226", Te = "_dayOutside_8euq6_253", Be = "_dayToday_8euq6_257", $e = "_daySelected_8euq6_262", Le = "_dayRangeStart_8euq6_263", Ae = "_dayRangeEnd_8euq6_264", Me = "_dayRangeMiddle_8euq6_265", a = {
|
|
40
|
+
wrapper: pe,
|
|
41
|
+
inputContainer: me,
|
|
42
|
+
label: he,
|
|
43
|
+
inputWrapper: ge,
|
|
44
|
+
trigger: fe,
|
|
45
|
+
icon: ye,
|
|
46
|
+
placeholder: be,
|
|
47
|
+
clearButton: we,
|
|
48
|
+
clearIcon: ve,
|
|
49
|
+
disabledLabel: Ne,
|
|
50
|
+
error: Ce,
|
|
51
|
+
calendar: Ie,
|
|
52
|
+
open: ke,
|
|
53
|
+
monthsCaption: De,
|
|
54
|
+
navButtonPrevious: xe,
|
|
55
|
+
navButtonNext: Se,
|
|
56
|
+
navIcon: Ee,
|
|
57
|
+
monthGrid: je,
|
|
58
|
+
dropdowns: qe,
|
|
59
|
+
weekday: Oe,
|
|
60
60
|
day: Pe,
|
|
61
61
|
dayButton: Re,
|
|
62
|
-
dayOutside:
|
|
63
|
-
dayToday:
|
|
62
|
+
dayOutside: Te,
|
|
63
|
+
dayToday: Be,
|
|
64
64
|
daySelected: $e,
|
|
65
|
-
dayRangeStart:
|
|
66
|
-
dayRangeEnd:
|
|
67
|
-
dayRangeMiddle:
|
|
68
|
-
},
|
|
65
|
+
dayRangeStart: Le,
|
|
66
|
+
dayRangeEnd: Ae,
|
|
67
|
+
dayRangeMiddle: Me
|
|
68
|
+
}, We = ({
|
|
69
69
|
ref: e,
|
|
70
70
|
isOpen: t,
|
|
71
71
|
onDismiss: r
|
|
72
72
|
}) => {
|
|
73
73
|
x(() => {
|
|
74
74
|
if (!t) return;
|
|
75
|
-
const o = (
|
|
76
|
-
e.current && !e.current.contains(
|
|
77
|
-
},
|
|
78
|
-
|
|
75
|
+
const o = (s) => {
|
|
76
|
+
e.current && !e.current.contains(s.target) && r();
|
|
77
|
+
}, i = (s) => {
|
|
78
|
+
s.key === "Escape" && r();
|
|
79
79
|
};
|
|
80
|
-
return document.addEventListener("mousedown", o), document.addEventListener("touchstart", o), document.addEventListener("keydown",
|
|
81
|
-
document.removeEventListener("mousedown", o), document.removeEventListener("touchstart", o), document.removeEventListener("keydown",
|
|
80
|
+
return document.addEventListener("mousedown", o), document.addEventListener("touchstart", o), document.addEventListener("keydown", i), () => {
|
|
81
|
+
document.removeEventListener("mousedown", o), document.removeEventListener("touchstart", o), document.removeEventListener("keydown", i);
|
|
82
82
|
};
|
|
83
83
|
}, [t, r, e]);
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
const t = O(e, T, /* @__PURE__ */ new Date());
|
|
87
|
-
return $(t) ? t : void 0;
|
|
88
|
-
}, je = (e) => {
|
|
89
|
-
if (!e) return;
|
|
90
|
-
const t = " - ", r = e.indexOf(t);
|
|
91
|
-
if (r === -1) {
|
|
92
|
-
const i = O(e.trim(), T, /* @__PURE__ */ new Date());
|
|
93
|
-
return $(i) ? { from: i, to: void 0 } : void 0;
|
|
94
|
-
}
|
|
95
|
-
const o = e.substring(0, r).trim(), l = e.substring(r + t.length).trim();
|
|
96
|
-
if (!o || !l) return;
|
|
97
|
-
const c = O(o, T, /* @__PURE__ */ new Date()), a = O(l, T, /* @__PURE__ */ new Date());
|
|
98
|
-
if ($(c) && $(a))
|
|
99
|
-
return { from: c, to: a };
|
|
100
|
-
}, z = (e, t) => {
|
|
101
|
-
if (e)
|
|
102
|
-
return t === "single" ? We(e) : je(e);
|
|
103
|
-
}, Fe = (e, t) => {
|
|
104
|
-
const [r, o] = P(/* @__PURE__ */ new Date());
|
|
105
|
-
return {
|
|
106
|
-
month: F(() => {
|
|
107
|
-
const a = z(e, t);
|
|
108
|
-
if (!a) return r;
|
|
109
|
-
if (t === "single" && a instanceof Date)
|
|
110
|
-
return a;
|
|
111
|
-
if (t === "range" && typeof a == "object" && "from" in a) {
|
|
112
|
-
const i = a;
|
|
113
|
-
if (i.from)
|
|
114
|
-
return i.from;
|
|
115
|
-
if (i.to)
|
|
116
|
-
return i.to;
|
|
117
|
-
}
|
|
118
|
-
return r;
|
|
119
|
-
}, [e, t, r]),
|
|
120
|
-
setMonth: (a) => {
|
|
121
|
-
o(a);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
}, Ge = "_container_15bt3_1", Ve = "_label_15bt3_7", qe = "_select_15bt3_14", He = "_trigger_15bt3_19", Ke = "_triggerOpen_15bt3_46", Xe = "_placeholder_15bt3_67", Ye = "_selectedContent_15bt3_71", ze = "_optionIcon_15bt3_81", Je = "_arrow_15bt3_87", Qe = "_open_15bt3_98", Ue = "_dropdown_15bt3_102", Ze = "_option_15bt3_81", et = "_selected_15bt3_71", g = {
|
|
125
|
-
container: Ge,
|
|
84
|
+
}, Fe = "_container_sn15j_1", Ve = "_label_sn15j_7", Ge = "_trigger_sn15j_14", Qe = "_select_sn15j_18", He = "_triggerOpen_sn15j_50", ze = "_placeholder_sn15j_71", Ke = "_selectedContent_sn15j_75", Xe = "_optionIcon_sn15j_85", Ye = "_arrow_sn15j_91", Je = "_open_sn15j_106", Ue = "_dropdown_sn15j_110", Ze = "_searchContainer_sn15j_131", et = "_searchInput_sn15j_141", tt = "_option_sn15j_85", nt = "_selected_sn15j_75", ot = "_noOptions_sn15j_202", h = {
|
|
85
|
+
container: Fe,
|
|
126
86
|
label: Ve,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
triggerOpen:
|
|
130
|
-
placeholder:
|
|
131
|
-
selectedContent:
|
|
132
|
-
optionIcon:
|
|
133
|
-
arrow:
|
|
134
|
-
open:
|
|
87
|
+
trigger: Ge,
|
|
88
|
+
select: Qe,
|
|
89
|
+
triggerOpen: He,
|
|
90
|
+
placeholder: ze,
|
|
91
|
+
selectedContent: Ke,
|
|
92
|
+
optionIcon: Xe,
|
|
93
|
+
arrow: Ye,
|
|
94
|
+
open: Je,
|
|
135
95
|
dropdown: Ue,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
96
|
+
searchContainer: Ze,
|
|
97
|
+
searchInput: et,
|
|
98
|
+
option: tt,
|
|
99
|
+
selected: nt,
|
|
100
|
+
noOptions: ot
|
|
101
|
+
}, rt = ({
|
|
102
|
+
filteredOptions: e,
|
|
103
|
+
noOptionsText: t,
|
|
104
|
+
onSearchChange: r,
|
|
105
|
+
onSelect: o,
|
|
106
|
+
searchInputRef: i,
|
|
107
|
+
searchPlaceholder: s,
|
|
108
|
+
searchQuery: c,
|
|
109
|
+
searchable: l,
|
|
110
|
+
value: p
|
|
111
|
+
}) => /* @__PURE__ */ m(X, { children: [
|
|
112
|
+
l && /* @__PURE__ */ n("div", { className: h.searchContainer, children: /* @__PURE__ */ n(
|
|
113
|
+
"input",
|
|
114
|
+
{
|
|
115
|
+
ref: i,
|
|
116
|
+
className: h.searchInput,
|
|
117
|
+
onChange: (d) => r(d.currentTarget.value),
|
|
118
|
+
placeholder: s,
|
|
119
|
+
type: "text",
|
|
120
|
+
value: c
|
|
121
|
+
}
|
|
122
|
+
) }),
|
|
123
|
+
e.length ? e.map((d) => /* @__PURE__ */ m(
|
|
124
|
+
"button",
|
|
125
|
+
{
|
|
126
|
+
className: v(h.option, d.value === p && h.selected),
|
|
127
|
+
onClick: () => o(d.value),
|
|
128
|
+
type: "button",
|
|
129
|
+
role: "option",
|
|
130
|
+
"aria-selected": d.value === p,
|
|
131
|
+
children: [
|
|
132
|
+
d.icon && /* @__PURE__ */ n("span", { className: h.optionIcon, children: d.icon }),
|
|
133
|
+
d.label
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
d.value
|
|
137
|
+
)) : /* @__PURE__ */ n("p", { className: h.noOptions, children: t })
|
|
138
|
+
] }), at = (e, t) => {
|
|
139
|
+
const [r, o] = j(e);
|
|
140
|
+
return x(() => {
|
|
141
|
+
const i = setTimeout(() => {
|
|
142
|
+
o(e);
|
|
143
|
+
}, t);
|
|
144
|
+
return () => {
|
|
145
|
+
clearTimeout(i);
|
|
146
|
+
};
|
|
147
|
+
}, [t, e]), r;
|
|
148
|
+
}, st = (e) => {
|
|
149
|
+
const {
|
|
150
|
+
className: t,
|
|
151
|
+
disabled: r = !1,
|
|
152
|
+
label: o,
|
|
153
|
+
noOptionsText: i = "No options found",
|
|
154
|
+
onChange: s,
|
|
155
|
+
options: c,
|
|
156
|
+
placeholder: l,
|
|
157
|
+
searchPlaceholder: p = "Search...",
|
|
158
|
+
searchable: d = !1,
|
|
159
|
+
value: N
|
|
160
|
+
} = e, [u, g] = j(!1), [f, k] = j(""), D = W(null), y = W(null), _ = at(f, 180), w = c.find((S) => S.value === N), E = _.trim().toLowerCase(), C = E ? c.filter((S) => S.label.toLowerCase().includes(E)) : c, q = Y(() => {
|
|
161
|
+
g(!1), k("");
|
|
162
|
+
}, []), ee = () => {
|
|
163
|
+
r || (u ? q() : (k(""), g(!0)));
|
|
164
|
+
}, te = (S) => {
|
|
165
|
+
s?.(S), q();
|
|
143
166
|
};
|
|
144
167
|
return x(() => {
|
|
145
|
-
const
|
|
146
|
-
|
|
168
|
+
const S = (ne) => {
|
|
169
|
+
D.current && !D.current.contains(ne.target) && q();
|
|
147
170
|
};
|
|
148
|
-
return
|
|
149
|
-
document.removeEventListener("mousedown",
|
|
171
|
+
return u && document.addEventListener("mousedown", S), () => {
|
|
172
|
+
document.removeEventListener("mousedown", S);
|
|
150
173
|
};
|
|
151
|
-
}, [
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
174
|
+
}, [q, u]), x(() => {
|
|
175
|
+
u && d && y.current?.focus();
|
|
176
|
+
}, [u, d]), /* @__PURE__ */ m("div", { className: v(h.container, t), children: [
|
|
177
|
+
o && /* @__PURE__ */ n("label", { className: h.label, children: o }),
|
|
178
|
+
/* @__PURE__ */ m("div", { className: h.select, ref: D, children: [
|
|
179
|
+
/* @__PURE__ */ m(
|
|
155
180
|
"button",
|
|
156
181
|
{
|
|
157
|
-
className:
|
|
182
|
+
className: v(h.trigger, u && h.triggerOpen),
|
|
158
183
|
disabled: r,
|
|
159
|
-
onClick:
|
|
184
|
+
onClick: ee,
|
|
160
185
|
type: "button",
|
|
161
186
|
"aria-haspopup": "listbox",
|
|
162
|
-
"aria-expanded":
|
|
187
|
+
"aria-expanded": u,
|
|
163
188
|
children: [
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
|
|
166
|
-
|
|
189
|
+
/* @__PURE__ */ m("span", { className: w ? h.selectedContent : h.placeholder, children: [
|
|
190
|
+
w?.icon && /* @__PURE__ */ n("span", { className: h.optionIcon, children: w.icon }),
|
|
191
|
+
w ? w.label : l || "Select an option"
|
|
167
192
|
] }),
|
|
168
|
-
/* @__PURE__ */ n("span", { className:
|
|
193
|
+
/* @__PURE__ */ n("span", { className: v(h.arrow, u && h.open), children: /* @__PURE__ */ n(ae, {}) })
|
|
169
194
|
]
|
|
170
195
|
}
|
|
171
196
|
),
|
|
172
|
-
|
|
173
|
-
|
|
197
|
+
u && /* @__PURE__ */ n(oe, { className: h.dropdown, role: "listbox", style: { maxHeight: 191 }, children: /* @__PURE__ */ n(
|
|
198
|
+
rt,
|
|
174
199
|
{
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
)) })
|
|
200
|
+
filteredOptions: C,
|
|
201
|
+
noOptionsText: i,
|
|
202
|
+
onSearchChange: k,
|
|
203
|
+
onSelect: te,
|
|
204
|
+
searchInputRef: y,
|
|
205
|
+
searchPlaceholder: p,
|
|
206
|
+
searchQuery: f,
|
|
207
|
+
searchable: d,
|
|
208
|
+
value: N
|
|
209
|
+
}
|
|
210
|
+
) })
|
|
187
211
|
] })
|
|
188
212
|
] });
|
|
189
|
-
},
|
|
213
|
+
}, Z = (e) => {
|
|
190
214
|
const t = (o) => {
|
|
191
215
|
if (e.onChange) {
|
|
192
|
-
const
|
|
216
|
+
const i = {
|
|
193
217
|
target: {
|
|
194
218
|
value: o
|
|
195
219
|
}
|
|
196
220
|
};
|
|
197
|
-
e.onChange(
|
|
221
|
+
e.onChange(i);
|
|
198
222
|
}
|
|
199
223
|
}, r = e.options?.map((o) => ({
|
|
200
224
|
value: o.value.toString(),
|
|
201
225
|
label: o.label
|
|
202
226
|
})) || [];
|
|
203
227
|
return /* @__PURE__ */ n(
|
|
204
|
-
|
|
228
|
+
st,
|
|
205
229
|
{
|
|
206
230
|
className: e.className,
|
|
207
231
|
options: r,
|
|
@@ -210,67 +234,86 @@ const nn = (e) => {
|
|
|
210
234
|
}
|
|
211
235
|
);
|
|
212
236
|
};
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
month_caption:
|
|
216
|
-
button_previous:
|
|
217
|
-
button_next:
|
|
218
|
-
chevron:
|
|
219
|
-
caption_label:
|
|
220
|
-
dropdowns:
|
|
221
|
-
dropdown_root:
|
|
222
|
-
dropdown:
|
|
223
|
-
dropdown_select_option:
|
|
224
|
-
months_dropdown:
|
|
225
|
-
years_dropdown:
|
|
226
|
-
month_grid:
|
|
227
|
-
weekday:
|
|
228
|
-
day_button:
|
|
229
|
-
day:
|
|
230
|
-
outside:
|
|
231
|
-
selected:
|
|
232
|
-
range_start:
|
|
233
|
-
range_middle:
|
|
234
|
-
range_end:
|
|
235
|
-
today:
|
|
236
|
-
},
|
|
237
|
-
Dropdown:
|
|
238
|
-
},
|
|
237
|
+
Z.displayName = "DatePickerDropdown";
|
|
238
|
+
const ct = {
|
|
239
|
+
month_caption: a.monthsCaption,
|
|
240
|
+
button_previous: a.navButtonPrevious,
|
|
241
|
+
button_next: a.navButtonNext,
|
|
242
|
+
chevron: a.navIcon,
|
|
243
|
+
caption_label: a.captionLabel,
|
|
244
|
+
dropdowns: a.dropdowns,
|
|
245
|
+
dropdown_root: a.dropdown_root,
|
|
246
|
+
dropdown: a.dropdown,
|
|
247
|
+
dropdown_select_option: a.option,
|
|
248
|
+
months_dropdown: a.monthsDropdown,
|
|
249
|
+
years_dropdown: a.yearsDropdown,
|
|
250
|
+
month_grid: a.monthGrid,
|
|
251
|
+
weekday: a.weekday,
|
|
252
|
+
day_button: a.dayButton,
|
|
253
|
+
day: a.day,
|
|
254
|
+
outside: a.dayOutside,
|
|
255
|
+
selected: a.daySelected,
|
|
256
|
+
range_start: a.dayRangeStart,
|
|
257
|
+
range_middle: a.dayRangeMiddle,
|
|
258
|
+
range_end: a.dayRangeEnd,
|
|
259
|
+
today: a.dayToday
|
|
260
|
+
}, it = {
|
|
261
|
+
Dropdown: Z
|
|
262
|
+
}, lt = {
|
|
239
263
|
weekStartsOn: 1,
|
|
240
264
|
showOutsideDays: !0,
|
|
241
265
|
reverseYears: !0,
|
|
242
266
|
captionLayout: "dropdown"
|
|
243
|
-
},
|
|
244
|
-
components:
|
|
245
|
-
...
|
|
246
|
-
},
|
|
247
|
-
...
|
|
267
|
+
}, dt = {
|
|
268
|
+
components: it,
|
|
269
|
+
...lt
|
|
270
|
+
}, ut = (e) => ({
|
|
271
|
+
...dt,
|
|
248
272
|
classNames: {
|
|
249
|
-
root:
|
|
250
|
-
...
|
|
273
|
+
root: V(a.calendar, e && a.open),
|
|
274
|
+
...ct
|
|
251
275
|
}
|
|
252
|
-
}), L = "dd.MM.yyyy",
|
|
276
|
+
}), L = "dd.MM.yyyy", _t = (e) => e ? T(e, L) : "", pt = (e) => !e || !e.from ? "" : e.to && e.from.getTime() !== e.to.getTime() ? `${T(e.from, L)} - ${T(e.to, L)}` : T(e.from, L), z = (e, t) => e ? t === "single" && e instanceof Date ? _t(e) : t === "range" && typeof e == "object" && "from" in e ? pt(e) : "" : "", mt = ({
|
|
253
277
|
value: e,
|
|
254
278
|
mode: t,
|
|
255
279
|
onChange: r,
|
|
256
280
|
setMonth: o,
|
|
257
|
-
setIsOpen:
|
|
281
|
+
setIsOpen: i
|
|
258
282
|
}) => {
|
|
259
283
|
if (!e) {
|
|
260
284
|
r("");
|
|
261
285
|
return;
|
|
262
286
|
}
|
|
263
287
|
if (t === "single") {
|
|
264
|
-
e instanceof Date && (o(e), r(
|
|
288
|
+
e instanceof Date && (o(e), r(z(e, "single")), i(!1));
|
|
265
289
|
return;
|
|
266
290
|
}
|
|
267
291
|
if (t === "range" && typeof e == "object" && "from" in e) {
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
const
|
|
271
|
-
r(
|
|
292
|
+
const s = e;
|
|
293
|
+
s.from ? o(s.from) : s.to && o(s.to);
|
|
294
|
+
const c = z(s, "range");
|
|
295
|
+
r(c), s.from && s.to && s.from.getTime() !== s.to.getTime() && i(!1);
|
|
272
296
|
}
|
|
273
|
-
},
|
|
297
|
+
}, A = "dd.MM.yyyy", ht = (e) => {
|
|
298
|
+
if (!e) return;
|
|
299
|
+
const t = B(e, A, /* @__PURE__ */ new Date());
|
|
300
|
+
return $(t) ? t : void 0;
|
|
301
|
+
}, gt = (e) => {
|
|
302
|
+
if (!e) return;
|
|
303
|
+
const t = " - ", r = e.indexOf(t);
|
|
304
|
+
if (r === -1) {
|
|
305
|
+
const l = B(e.trim(), A, /* @__PURE__ */ new Date());
|
|
306
|
+
return $(l) ? { from: l, to: void 0 } : void 0;
|
|
307
|
+
}
|
|
308
|
+
const o = e.substring(0, r).trim(), i = e.substring(r + t.length).trim();
|
|
309
|
+
if (!o || !i) return;
|
|
310
|
+
const s = B(o, A, /* @__PURE__ */ new Date()), c = B(i, A, /* @__PURE__ */ new Date());
|
|
311
|
+
if ($(s) && $(c))
|
|
312
|
+
return { from: s, to: c };
|
|
313
|
+
}, ft = (e, t) => {
|
|
314
|
+
if (e)
|
|
315
|
+
return t === "single" ? ht(e) : gt(e);
|
|
316
|
+
}, yt = (e, t, r) => {
|
|
274
317
|
if (e) {
|
|
275
318
|
if (t === "single" && e instanceof Date) {
|
|
276
319
|
r(e);
|
|
@@ -281,229 +324,229 @@ const nt = {
|
|
|
281
324
|
o.from ? r(o.from) : o.to && r(o.to);
|
|
282
325
|
}
|
|
283
326
|
}
|
|
284
|
-
},
|
|
327
|
+
}, pn = ({
|
|
285
328
|
mode: e,
|
|
286
329
|
value: t,
|
|
287
330
|
onChange: r,
|
|
288
331
|
disabled: o,
|
|
289
|
-
label:
|
|
290
|
-
error:
|
|
291
|
-
placeholder:
|
|
292
|
-
...
|
|
332
|
+
label: i,
|
|
333
|
+
error: s,
|
|
334
|
+
placeholder: c,
|
|
335
|
+
...l
|
|
293
336
|
}) => {
|
|
294
|
-
const [
|
|
337
|
+
const [p, d] = j(!1), N = W(null), [u, g] = j(/* @__PURE__ */ new Date()), f = Q(() => ft(t, e), [t, e]);
|
|
295
338
|
x(() => {
|
|
296
|
-
|
|
297
|
-
}, [
|
|
298
|
-
|
|
339
|
+
yt(f, e, g);
|
|
340
|
+
}, [f, e, g]), We({ ref: N, isOpen: p, onDismiss: () => {
|
|
341
|
+
d(!1);
|
|
299
342
|
} });
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
},
|
|
303
|
-
o ||
|
|
304
|
-
},
|
|
305
|
-
const
|
|
306
|
-
r(
|
|
307
|
-
},
|
|
308
|
-
|
|
309
|
-
value:
|
|
343
|
+
const D = (C) => {
|
|
344
|
+
C.stopPropagation(), w(void 0);
|
|
345
|
+
}, y = () => {
|
|
346
|
+
o || d((C) => !C);
|
|
347
|
+
}, _ = (C) => {
|
|
348
|
+
const q = C.currentTarget.value;
|
|
349
|
+
r(q);
|
|
350
|
+
}, w = (C) => {
|
|
351
|
+
mt({
|
|
352
|
+
value: C,
|
|
310
353
|
mode: e,
|
|
311
354
|
onChange: r,
|
|
312
|
-
setMonth:
|
|
313
|
-
setIsOpen:
|
|
355
|
+
setMonth: g,
|
|
356
|
+
setIsOpen: d
|
|
314
357
|
});
|
|
315
|
-
},
|
|
316
|
-
return /* @__PURE__ */
|
|
317
|
-
/* @__PURE__ */
|
|
318
|
-
|
|
319
|
-
/* @__PURE__ */
|
|
358
|
+
}, E = Q(() => ut(p), [p]);
|
|
359
|
+
return /* @__PURE__ */ m("div", { ref: N, className: a.wrapper, children: [
|
|
360
|
+
/* @__PURE__ */ m("div", { className: a.inputContainer, children: [
|
|
361
|
+
i && /* @__PURE__ */ n("span", { className: o ? a.disabledLabel : a.label, children: /* @__PURE__ */ n(G, { variant: "text-14", children: i }) }),
|
|
362
|
+
/* @__PURE__ */ m("div", { className: a.inputWrapper, children: [
|
|
320
363
|
/* @__PURE__ */ n(
|
|
321
364
|
"input",
|
|
322
365
|
{
|
|
323
366
|
type: "text",
|
|
324
|
-
className:
|
|
325
|
-
onClick:
|
|
367
|
+
className: V(a.trigger, s && a.error),
|
|
368
|
+
onClick: y,
|
|
326
369
|
value: t,
|
|
327
|
-
onChange:
|
|
328
|
-
placeholder:
|
|
370
|
+
onChange: _,
|
|
371
|
+
placeholder: c,
|
|
329
372
|
disabled: o,
|
|
330
|
-
"aria-label":
|
|
331
|
-
"aria-expanded":
|
|
373
|
+
"aria-label": i || "Select date",
|
|
374
|
+
"aria-expanded": p,
|
|
332
375
|
"aria-haspopup": "dialog",
|
|
333
|
-
"aria-invalid":
|
|
334
|
-
...
|
|
376
|
+
"aria-invalid": s ? "true" : "false",
|
|
377
|
+
...l
|
|
335
378
|
}
|
|
336
379
|
),
|
|
337
380
|
t && !o && /* @__PURE__ */ n(
|
|
338
381
|
"button",
|
|
339
382
|
{
|
|
340
383
|
type: "button",
|
|
341
|
-
className:
|
|
342
|
-
onClick:
|
|
384
|
+
className: a.clearButton,
|
|
385
|
+
onClick: D,
|
|
343
386
|
"aria-label": "Clear date",
|
|
344
|
-
children: /* @__PURE__ */ n(
|
|
387
|
+
children: /* @__PURE__ */ n(U, { className: a.clearIcon })
|
|
345
388
|
}
|
|
346
389
|
),
|
|
347
|
-
/* @__PURE__ */ n(
|
|
390
|
+
/* @__PURE__ */ n(se, { className: V(a.icon, !t && a.placeholder) })
|
|
348
391
|
] }),
|
|
349
|
-
|
|
392
|
+
s && /* @__PURE__ */ n(G, { variant: "small", className: a.error, children: s })
|
|
350
393
|
] }),
|
|
351
394
|
e === "single" ? /* @__PURE__ */ n(
|
|
352
|
-
|
|
395
|
+
H,
|
|
353
396
|
{
|
|
354
|
-
...
|
|
355
|
-
month:
|
|
356
|
-
onMonthChange:
|
|
397
|
+
...E,
|
|
398
|
+
month: u,
|
|
399
|
+
onMonthChange: g,
|
|
357
400
|
mode: "single",
|
|
358
|
-
selected:
|
|
359
|
-
onSelect:
|
|
401
|
+
selected: f instanceof Date ? f : void 0,
|
|
402
|
+
onSelect: w
|
|
360
403
|
}
|
|
361
404
|
) : /* @__PURE__ */ n(
|
|
362
|
-
|
|
405
|
+
H,
|
|
363
406
|
{
|
|
364
|
-
...
|
|
365
|
-
month:
|
|
366
|
-
onMonthChange:
|
|
407
|
+
...E,
|
|
408
|
+
month: u,
|
|
409
|
+
onMonthChange: g,
|
|
367
410
|
mode: "range",
|
|
368
|
-
selected:
|
|
369
|
-
onSelect:
|
|
411
|
+
selected: f && typeof f == "object" && "from" in f ? f : void 0,
|
|
412
|
+
onSelect: w
|
|
370
413
|
}
|
|
371
414
|
)
|
|
372
415
|
] });
|
|
373
|
-
},
|
|
374
|
-
content:
|
|
375
|
-
item:
|
|
376
|
-
icon:
|
|
377
|
-
label:
|
|
378
|
-
},
|
|
379
|
-
const { children: t, items: r, className: o, align:
|
|
380
|
-
return /* @__PURE__ */
|
|
381
|
-
/* @__PURE__ */ n(
|
|
382
|
-
/* @__PURE__ */ n(
|
|
383
|
-
|
|
416
|
+
}, bt = "_content_1bas8_1", wt = "_item_1bas8_24", vt = "_icon_1bas8_56", Nt = "_label_1bas8_62", R = {
|
|
417
|
+
content: bt,
|
|
418
|
+
item: wt,
|
|
419
|
+
icon: vt,
|
|
420
|
+
label: Nt
|
|
421
|
+
}, mn = (e) => {
|
|
422
|
+
const { children: t, items: r, className: o, align: i = "end", side: s = "bottom" } = e;
|
|
423
|
+
return /* @__PURE__ */ m(P.Root, { children: [
|
|
424
|
+
/* @__PURE__ */ n(P.Trigger, { asChild: !0, children: t }),
|
|
425
|
+
/* @__PURE__ */ n(P.Portal, { children: /* @__PURE__ */ n(
|
|
426
|
+
P.Content,
|
|
384
427
|
{
|
|
385
|
-
align:
|
|
386
|
-
className:
|
|
387
|
-
side:
|
|
428
|
+
align: i,
|
|
429
|
+
className: v(R.content, o),
|
|
430
|
+
side: s,
|
|
388
431
|
sideOffset: 4,
|
|
389
|
-
children: r.map((
|
|
390
|
-
|
|
432
|
+
children: r.map((c, l) => /* @__PURE__ */ m(
|
|
433
|
+
P.Item,
|
|
391
434
|
{
|
|
392
|
-
className:
|
|
393
|
-
disabled:
|
|
394
|
-
onSelect:
|
|
435
|
+
className: R.item,
|
|
436
|
+
disabled: c.disabled,
|
|
437
|
+
onSelect: c.onSelect,
|
|
395
438
|
children: [
|
|
396
|
-
|
|
397
|
-
/* @__PURE__ */ n("span", { className:
|
|
439
|
+
c.icon && /* @__PURE__ */ n("span", { className: R.icon, children: c.icon }),
|
|
440
|
+
/* @__PURE__ */ n("span", { className: R.label, children: c.label })
|
|
398
441
|
]
|
|
399
442
|
},
|
|
400
|
-
|
|
443
|
+
l
|
|
401
444
|
))
|
|
402
445
|
}
|
|
403
446
|
) })
|
|
404
447
|
] });
|
|
405
|
-
},
|
|
406
|
-
wrapper:
|
|
407
|
-
label:
|
|
408
|
-
disabled:
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
error:
|
|
412
|
-
withStartIcon:
|
|
413
|
-
withEndIcon:
|
|
414
|
-
startIcon:
|
|
415
|
-
endIcon:
|
|
416
|
-
errorMessage:
|
|
417
|
-
required:
|
|
418
|
-
},
|
|
448
|
+
}, Ct = "_wrapper_gp2gj_1", It = "_label_gp2gj_7", kt = "_disabled_gp2gj_14", Dt = "_input_gp2gj_18", xt = "_inputContainer_gp2gj_22", St = "_error_gp2gj_47", Et = "_withStartIcon_gp2gj_64", jt = "_withEndIcon_gp2gj_68", qt = "_startIcon_gp2gj_85", Ot = "_endIcon_gp2gj_86", Pt = "_errorMessage_gp2gj_137", Rt = "_required_gp2gj_144", b = {
|
|
449
|
+
wrapper: Ct,
|
|
450
|
+
label: It,
|
|
451
|
+
disabled: kt,
|
|
452
|
+
input: Dt,
|
|
453
|
+
inputContainer: xt,
|
|
454
|
+
error: St,
|
|
455
|
+
withStartIcon: Et,
|
|
456
|
+
withEndIcon: jt,
|
|
457
|
+
startIcon: qt,
|
|
458
|
+
endIcon: Ot,
|
|
459
|
+
errorMessage: Pt,
|
|
460
|
+
required: Rt
|
|
461
|
+
}, Tt = re(
|
|
419
462
|
({
|
|
420
463
|
label: e,
|
|
421
464
|
errorMessage: t,
|
|
422
465
|
startIcon: r,
|
|
423
466
|
endIcon: o,
|
|
424
|
-
onEndIconClick:
|
|
425
|
-
allowPasswordToggle:
|
|
426
|
-
disabled:
|
|
427
|
-
type:
|
|
428
|
-
className:
|
|
429
|
-
required:
|
|
430
|
-
id:
|
|
431
|
-
...
|
|
432
|
-
},
|
|
433
|
-
const
|
|
434
|
-
return /* @__PURE__ */
|
|
435
|
-
e && /* @__PURE__ */
|
|
467
|
+
onEndIconClick: i,
|
|
468
|
+
allowPasswordToggle: s,
|
|
469
|
+
disabled: c,
|
|
470
|
+
type: l = "text",
|
|
471
|
+
className: p,
|
|
472
|
+
required: d,
|
|
473
|
+
id: N,
|
|
474
|
+
...u
|
|
475
|
+
}, g) => {
|
|
476
|
+
const f = J(), k = N ?? f, D = t ? `${k}-error` : void 0, y = !!t, _ = l === "password" && s, [w, E] = j(!1);
|
|
477
|
+
return /* @__PURE__ */ m("div", { className: v(b.wrapper, p), children: [
|
|
478
|
+
e && /* @__PURE__ */ m("label", { htmlFor: k, className: v(b.label, { [b.disabled]: c }), children: [
|
|
436
479
|
e,
|
|
437
|
-
|
|
480
|
+
d && /* @__PURE__ */ n("sup", { className: b.required, children: " *" })
|
|
438
481
|
] }),
|
|
439
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ m(
|
|
440
483
|
"div",
|
|
441
484
|
{
|
|
442
|
-
className:
|
|
443
|
-
[
|
|
444
|
-
[
|
|
445
|
-
[
|
|
446
|
-
[
|
|
485
|
+
className: v(b.inputContainer, {
|
|
486
|
+
[b.error]: y,
|
|
487
|
+
[b.disabled]: c,
|
|
488
|
+
[b.withStartIcon]: !!r,
|
|
489
|
+
[b.withEndIcon]: !!o || _
|
|
447
490
|
}),
|
|
448
491
|
children: [
|
|
449
|
-
r && /* @__PURE__ */ n("span", { className:
|
|
492
|
+
r && /* @__PURE__ */ n("span", { className: b.startIcon, children: r }),
|
|
450
493
|
/* @__PURE__ */ n(
|
|
451
494
|
"input",
|
|
452
495
|
{
|
|
453
|
-
ref:
|
|
454
|
-
id:
|
|
455
|
-
className:
|
|
456
|
-
type:
|
|
457
|
-
autoComplete:
|
|
458
|
-
required:
|
|
459
|
-
disabled:
|
|
460
|
-
"aria-invalid":
|
|
461
|
-
"aria-describedby":
|
|
462
|
-
...
|
|
496
|
+
ref: g,
|
|
497
|
+
id: k,
|
|
498
|
+
className: b.input,
|
|
499
|
+
type: _ && w ? "text" : l,
|
|
500
|
+
autoComplete: l === "password" ? "current-password" : "off",
|
|
501
|
+
required: d,
|
|
502
|
+
disabled: c,
|
|
503
|
+
"aria-invalid": y,
|
|
504
|
+
"aria-describedby": D,
|
|
505
|
+
...u
|
|
463
506
|
}
|
|
464
507
|
),
|
|
465
|
-
|
|
508
|
+
_ && /* @__PURE__ */ n(
|
|
466
509
|
"button",
|
|
467
510
|
{
|
|
468
511
|
type: "button",
|
|
469
|
-
className:
|
|
470
|
-
onClick: () =>
|
|
471
|
-
"aria-label":
|
|
472
|
-
disabled:
|
|
512
|
+
className: b.endIcon,
|
|
513
|
+
onClick: () => E((C) => !C),
|
|
514
|
+
"aria-label": w ? "Hide password" : "Show password",
|
|
515
|
+
disabled: c,
|
|
473
516
|
tabIndex: -1,
|
|
474
|
-
children:
|
|
517
|
+
children: w ? /* @__PURE__ */ n(ce, {}) : /* @__PURE__ */ n(ie, {})
|
|
475
518
|
}
|
|
476
519
|
),
|
|
477
|
-
o && !
|
|
520
|
+
o && !_ && /* @__PURE__ */ n(
|
|
478
521
|
"button",
|
|
479
522
|
{
|
|
480
523
|
type: "button",
|
|
481
|
-
className:
|
|
482
|
-
onClick:
|
|
524
|
+
className: b.endIcon,
|
|
525
|
+
onClick: i,
|
|
483
526
|
"aria-label": "Action",
|
|
484
|
-
disabled:
|
|
527
|
+
disabled: c,
|
|
485
528
|
children: o
|
|
486
529
|
}
|
|
487
530
|
)
|
|
488
531
|
]
|
|
489
532
|
}
|
|
490
533
|
),
|
|
491
|
-
|
|
534
|
+
y && /* @__PURE__ */ n("span", { id: D, className: b.errorMessage, role: "alert", children: t })
|
|
492
535
|
] });
|
|
493
536
|
}
|
|
494
537
|
);
|
|
495
|
-
|
|
496
|
-
const
|
|
497
|
-
overlay:
|
|
498
|
-
modal:
|
|
499
|
-
header:
|
|
500
|
-
title:
|
|
501
|
-
close:
|
|
502
|
-
body:
|
|
503
|
-
},
|
|
504
|
-
const
|
|
538
|
+
Tt.displayName = "Input";
|
|
539
|
+
const Bt = "_overlay_17k3a_1", $t = "_modal_17k3a_15", Lt = "_header_17k3a_29", At = "_title_17k3a_39", Mt = "_close_17k3a_52", Wt = "_body_17k3a_79", O = {
|
|
540
|
+
overlay: Bt,
|
|
541
|
+
modal: $t,
|
|
542
|
+
header: Lt,
|
|
543
|
+
title: At,
|
|
544
|
+
close: Mt,
|
|
545
|
+
body: Wt
|
|
546
|
+
}, hn = ({ open: e, onClose: t, title: r, children: o, className: i }) => {
|
|
547
|
+
const s = J(), c = W(t);
|
|
505
548
|
if (x(() => {
|
|
506
|
-
|
|
549
|
+
c.current = t;
|
|
507
550
|
}, [t]), x(() => {
|
|
508
551
|
if (e)
|
|
509
552
|
return document.body.style.overflow = "hidden", () => {
|
|
@@ -511,145 +554,145 @@ const Et = "_overlay_17k3a_1", St = "_modal_17k3a_15", Pt = "_header_17k3a_29",
|
|
|
511
554
|
};
|
|
512
555
|
}, [e]), x(() => {
|
|
513
556
|
if (!e) return;
|
|
514
|
-
const
|
|
515
|
-
|
|
557
|
+
const p = (d) => {
|
|
558
|
+
d.key === "Escape" && c.current();
|
|
516
559
|
};
|
|
517
|
-
return document.addEventListener("keydown",
|
|
518
|
-
document.removeEventListener("keydown",
|
|
560
|
+
return document.addEventListener("keydown", p), () => {
|
|
561
|
+
document.removeEventListener("keydown", p);
|
|
519
562
|
};
|
|
520
563
|
}, [e]), !e || typeof document > "u") return null;
|
|
521
|
-
const
|
|
522
|
-
return
|
|
564
|
+
const l = document.getElementById("modal-root") ?? document.body;
|
|
565
|
+
return ue(
|
|
523
566
|
/* @__PURE__ */ n(
|
|
524
|
-
|
|
567
|
+
_e,
|
|
525
568
|
{
|
|
526
569
|
active: e,
|
|
527
570
|
focusTrapOptions: {
|
|
528
571
|
clickOutsideDeactivates: !0,
|
|
529
572
|
returnFocusOnDeactivate: !0
|
|
530
573
|
},
|
|
531
|
-
children: /* @__PURE__ */ n("div", { className:
|
|
574
|
+
children: /* @__PURE__ */ n("div", { className: O.overlay, onClick: () => c.current(), children: /* @__PURE__ */ m(
|
|
532
575
|
"div",
|
|
533
576
|
{
|
|
534
|
-
className:
|
|
535
|
-
onClick: (
|
|
577
|
+
className: v(O.modal, i),
|
|
578
|
+
onClick: (p) => p.stopPropagation(),
|
|
536
579
|
role: "dialog",
|
|
537
580
|
"aria-modal": "true",
|
|
538
|
-
"aria-labelledby":
|
|
581
|
+
"aria-labelledby": s,
|
|
539
582
|
children: [
|
|
540
|
-
/* @__PURE__ */
|
|
541
|
-
/* @__PURE__ */ n("h2", { id:
|
|
583
|
+
/* @__PURE__ */ m("header", { className: O.header, children: [
|
|
584
|
+
/* @__PURE__ */ n("h2", { id: s, className: O.title, children: r }),
|
|
542
585
|
/* @__PURE__ */ n(
|
|
543
586
|
"button",
|
|
544
587
|
{
|
|
545
588
|
type: "button",
|
|
546
|
-
className:
|
|
589
|
+
className: O.close,
|
|
547
590
|
"aria-label": "Close modal",
|
|
548
|
-
onClick: () =>
|
|
549
|
-
children: /* @__PURE__ */ n(
|
|
591
|
+
onClick: () => c.current(),
|
|
592
|
+
children: /* @__PURE__ */ n(U, {})
|
|
550
593
|
}
|
|
551
594
|
)
|
|
552
595
|
] }),
|
|
553
|
-
/* @__PURE__ */ n("div", { className:
|
|
596
|
+
/* @__PURE__ */ n("div", { className: O.body, children: o })
|
|
554
597
|
]
|
|
555
598
|
}
|
|
556
599
|
) })
|
|
557
600
|
}
|
|
558
601
|
),
|
|
559
|
-
|
|
602
|
+
l
|
|
560
603
|
);
|
|
561
|
-
},
|
|
562
|
-
root:
|
|
563
|
-
trackWrapper:
|
|
564
|
-
track:
|
|
565
|
-
slide:
|
|
566
|
-
arrow:
|
|
567
|
-
arrowPrev:
|
|
568
|
-
arrowNext:
|
|
569
|
-
dots:
|
|
570
|
-
dot:
|
|
571
|
-
dotActive:
|
|
572
|
-
},
|
|
604
|
+
}, Ft = "_root_ggtcs_1", Vt = "_trackWrapper_ggtcs_16", Gt = "_track_ggtcs_16", Qt = "_slide_ggtcs_32", Ht = "_arrow_ggtcs_56", zt = "_arrowPrev_ggtcs_98", Kt = "_arrowNext_ggtcs_102", Xt = "_dots_ggtcs_107", Yt = "_dot_ggtcs_107", Jt = "_dotActive_ggtcs_143", I = {
|
|
605
|
+
root: Ft,
|
|
606
|
+
trackWrapper: Vt,
|
|
607
|
+
track: Gt,
|
|
608
|
+
slide: Qt,
|
|
609
|
+
arrow: Ht,
|
|
610
|
+
arrowPrev: zt,
|
|
611
|
+
arrowNext: Kt,
|
|
612
|
+
dots: Xt,
|
|
613
|
+
dot: Yt,
|
|
614
|
+
dotActive: Jt
|
|
615
|
+
}, gn = ({
|
|
573
616
|
children: e,
|
|
574
617
|
value: t,
|
|
575
618
|
onValueChange: r,
|
|
576
619
|
autoPlayInterval: o = 0,
|
|
577
|
-
className:
|
|
578
|
-
hideArrowsWhenSingle:
|
|
620
|
+
className: i,
|
|
621
|
+
hideArrowsWhenSingle: s = !0
|
|
579
622
|
}) => {
|
|
580
|
-
const
|
|
581
|
-
(
|
|
582
|
-
const
|
|
583
|
-
|
|
623
|
+
const c = Array.isArray(e) ? e : [e], l = c.length, [p, d] = j(0), N = t !== void 0, u = N ? Math.min(Math.max(0, t), l - 1) : p, g = Y(
|
|
624
|
+
(y) => {
|
|
625
|
+
const _ = (y + l) % l;
|
|
626
|
+
N || d(_), r?.(_);
|
|
584
627
|
},
|
|
585
|
-
[
|
|
628
|
+
[l, N, r]
|
|
586
629
|
);
|
|
587
630
|
if (x(() => {
|
|
588
|
-
if (o <= 0 ||
|
|
589
|
-
const
|
|
590
|
-
return () => clearInterval(
|
|
591
|
-
}, [o,
|
|
592
|
-
const
|
|
593
|
-
return /* @__PURE__ */
|
|
594
|
-
/* @__PURE__ */ n("div", { className:
|
|
595
|
-
|
|
631
|
+
if (o <= 0 || l <= 1) return;
|
|
632
|
+
const y = setInterval(() => g(u + 1), o);
|
|
633
|
+
return () => clearInterval(y);
|
|
634
|
+
}, [o, l, u, g]), l === 0) return null;
|
|
635
|
+
const f = () => g(u - 1), k = () => g(u + 1), D = !s || l > 1;
|
|
636
|
+
return /* @__PURE__ */ m("div", { className: v(I.root, i), role: "region", "aria-label": "Carousel", children: [
|
|
637
|
+
/* @__PURE__ */ n("div", { className: I.trackWrapper, children: /* @__PURE__ */ n("div", { className: I.track, style: { transform: `translateX(-${u * 100}%)` }, children: c.map((y, _) => /* @__PURE__ */ n("div", { className: I.slide, children: y }, _)) }) }),
|
|
638
|
+
D && /* @__PURE__ */ m(X, { children: [
|
|
596
639
|
/* @__PURE__ */ n(
|
|
597
640
|
"button",
|
|
598
641
|
{
|
|
599
642
|
type: "button",
|
|
600
|
-
className:
|
|
601
|
-
onClick:
|
|
643
|
+
className: v(I.arrow, I.arrowPrev),
|
|
644
|
+
onClick: f,
|
|
602
645
|
"aria-label": "Previous slide",
|
|
603
646
|
tabIndex: 0,
|
|
604
|
-
children: /* @__PURE__ */ n(
|
|
647
|
+
children: /* @__PURE__ */ n(le, { width: 24, height: 24, "aria-hidden": !0 })
|
|
605
648
|
}
|
|
606
649
|
),
|
|
607
650
|
/* @__PURE__ */ n(
|
|
608
651
|
"button",
|
|
609
652
|
{
|
|
610
653
|
type: "button",
|
|
611
|
-
className:
|
|
612
|
-
onClick:
|
|
654
|
+
className: v(I.arrow, I.arrowNext),
|
|
655
|
+
onClick: k,
|
|
613
656
|
"aria-label": "Next slide",
|
|
614
657
|
tabIndex: 0,
|
|
615
|
-
children: /* @__PURE__ */ n(
|
|
658
|
+
children: /* @__PURE__ */ n(de, { width: 24, height: 24, "aria-hidden": !0 })
|
|
616
659
|
}
|
|
617
660
|
)
|
|
618
661
|
] }),
|
|
619
|
-
|
|
662
|
+
l > 1 && /* @__PURE__ */ n("div", { className: I.dots, role: "tablist", "aria-label": "Slide selection", children: c.map((y, _) => /* @__PURE__ */ n(
|
|
620
663
|
"button",
|
|
621
664
|
{
|
|
622
665
|
type: "button",
|
|
623
666
|
role: "tab",
|
|
624
|
-
"aria-selected":
|
|
625
|
-
"aria-label": `Slide ${
|
|
626
|
-
className:
|
|
627
|
-
onClick: () =>
|
|
628
|
-
tabIndex:
|
|
667
|
+
"aria-selected": _ === u,
|
|
668
|
+
"aria-label": `Slide ${_ + 1}`,
|
|
669
|
+
className: v(I.dot, _ === u && I.dotActive),
|
|
670
|
+
onClick: () => g(_),
|
|
671
|
+
tabIndex: _ === u ? 0 : -1
|
|
629
672
|
},
|
|
630
|
-
|
|
673
|
+
_
|
|
631
674
|
)) })
|
|
632
675
|
] });
|
|
633
676
|
};
|
|
634
677
|
export {
|
|
635
678
|
K as Alert,
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
679
|
+
Cn as Button,
|
|
680
|
+
In as Card,
|
|
681
|
+
gn as Carousel,
|
|
682
|
+
kn as Checkbox,
|
|
683
|
+
pn as DatePicker,
|
|
684
|
+
mn as DropdownMenu,
|
|
685
|
+
Tt as Input,
|
|
686
|
+
Dn as Label,
|
|
687
|
+
hn as Modal,
|
|
688
|
+
xn as Radio,
|
|
689
|
+
st as Select,
|
|
690
|
+
vn as SimpleBar,
|
|
691
|
+
Sn as Tab,
|
|
692
|
+
En as Textarea,
|
|
693
|
+
G as Typography,
|
|
694
|
+
bn as clsx,
|
|
695
|
+
_n as toastError,
|
|
696
|
+
un as toastSuccess
|
|
654
697
|
};
|
|
655
698
|
//# sourceMappingURL=index.client.js.map
|