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