snapflow-ui-kit 1.2.0 → 1.2.3

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,582 +1,634 @@
1
1
  "use client";
2
- import j, { clsx as g } from "clsx";
3
- import { clsx as zt } from "clsx";
4
- import U from "simplebar-react";
5
- import { default as Qt } from "simplebar-react";
6
- import { A as H, s as L, c as G } from "./Textarea-D5WrCGtg.js";
7
- import { B as Xt, C as Zt, a as en, L as tn, R as nn, T as on, b as an } from "./Textarea-D5WrCGtg.js";
8
- import { jsx as a, jsxs as _ } from "react/jsx-runtime";
9
- import { useEffect as k, useState as A, useMemo as F, useRef as V, forwardRef as X, useId as K } from "react";
10
- import { DayPicker as W } from "react-day-picker";
11
- import { parse as R, isValid as B, format as O } from "date-fns";
12
- import { A as Z, C as ee, E as te, a as ne } from "./ArrowDownIcon-jfp8BJVY.js";
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
13
  import { C as Y } from "./CloseIcon-CqK3tPnG.js";
14
14
  import * as S from "@radix-ui/react-dropdown-menu";
15
- import { createPortal as oe } from "react-dom";
16
- import { FocusTrap as ae } from "focus-trap-react";
17
- import { toast as $ } from "react-hot-toast";
18
- const Vt = (e) => {
19
- $.custom((t) => /* @__PURE__ */ a(
20
- H,
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(
20
+ K,
21
21
  {
22
22
  variant: "success",
23
23
  message: e,
24
- className: t.visible ? L.toastEnter : L.toastExit,
25
- onClose: () => $.dismiss(t.id)
24
+ className: t.visible ? j.toastEnter : j.toastExit,
25
+ onClose: () => A.dismiss(t.id)
26
26
  }
27
27
  ));
28
- }, Gt = (e, t = "Error!") => {
29
- $.custom((o) => /* @__PURE__ */ a(
30
- H,
28
+ }, nn = (e, t = "Error!") => {
29
+ A.custom((r) => /* @__PURE__ */ n(
30
+ K,
31
31
  {
32
32
  variant: "error",
33
33
  title: t,
34
34
  message: e,
35
- className: o.visible ? L.toastEnter : L.toastExit,
36
- onClose: () => $.dismiss(o.id)
35
+ className: r.visible ? j.toastEnter : j.toastExit,
36
+ onClose: () => A.dismiss(r.id)
37
37
  }
38
38
  ));
39
- }, re = "_wrapper_l023w_1", se = "_inputContainer_l023w_5", ce = "_label_l023w_11", ie = "_inputWrapper_l023w_15", le = "_trigger_l023w_22", de = "_icon_l023w_38", pe = "_placeholder_l023w_45", _e = "_clearButton_l023w_49", ue = "_clearIcon_l023w_89", me = "_disabledLabel_l023w_101", fe = "_error_l023w_123", he = "_calendar_l023w_141", we = "_open_l023w_160", ye = "_monthsCaption_l023w_166", be = "_navButtonPrevious_l023w_172", ge = "_navButtonNext_l023w_173", ve = "_navIcon_l023w_193", Ce = "_monthGrid_l023w_199", Ne = "_dropdowns_l023w_205", De = "_weekday_l023w_209", Ie = "_day_l023w_220", ke = "_dayButton_l023w_227", Ee = "_dayOutside_l023w_254", Se = "_dayToday_l023w_258", xe = "_daySelected_l023w_263", Pe = "_dayRangeStart_l023w_264", Re = "_dayRangeEnd_l023w_265", Be = "_dayRangeMiddle_l023w_266", r = {
40
- wrapper: re,
41
- inputContainer: se,
42
- label: ce,
43
- inputWrapper: ie,
44
- trigger: le,
45
- icon: de,
46
- placeholder: pe,
47
- clearButton: _e,
48
- clearIcon: ue,
49
- disabledLabel: me,
50
- error: fe,
51
- calendar: he,
52
- open: we,
53
- monthsCaption: ye,
54
- navButtonPrevious: be,
55
- navButtonNext: ge,
56
- navIcon: ve,
57
- monthGrid: Ce,
58
- dropdowns: Ne,
59
- weekday: De,
60
- day: Ie,
61
- dayButton: ke,
62
- dayOutside: Ee,
63
- dayToday: Se,
64
- daySelected: xe,
65
- dayRangeStart: Pe,
66
- dayRangeEnd: Re,
67
- dayRangeMiddle: Be
68
- }, Oe = ({
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 = ({
69
69
  ref: e,
70
70
  isOpen: t,
71
- onDismiss: o
71
+ onDismiss: r
72
72
  }) => {
73
- k(() => {
73
+ D(() => {
74
74
  if (!t) return;
75
- const n = (c) => {
76
- e.current && !e.current.contains(c.target) && o();
77
- }, i = (c) => {
78
- c.key === "Escape" && o();
75
+ const o = (s) => {
76
+ e.current && !e.current.contains(s.target) && r();
77
+ }, l = (s) => {
78
+ s.key === "Escape" && r();
79
79
  };
80
- return document.addEventListener("mousedown", n), document.addEventListener("touchstart", n), document.addEventListener("keydown", i), () => {
81
- document.removeEventListener("mousedown", n), document.removeEventListener("touchstart", n), document.removeEventListener("keydown", i);
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);
82
82
  };
83
- }, [t, o, e]);
84
- }, T = "dd.MM.yyyy", Te = (e) => {
85
- if (!e) return;
86
- const t = R(e, T, /* @__PURE__ */ new Date());
87
- return B(t) ? t : void 0;
88
- }, Me = (e) => {
89
- if (!e) return;
90
- const t = " - ", o = e.indexOf(t);
91
- if (o === -1) {
92
- const l = R(e.trim(), T, /* @__PURE__ */ new Date());
93
- return B(l) ? { from: l, to: void 0 } : void 0;
94
- }
95
- const n = e.substring(0, o).trim(), i = e.substring(o + t.length).trim();
96
- if (!n || !i) return;
97
- const c = R(n, T, /* @__PURE__ */ new Date()), s = R(i, T, /* @__PURE__ */ new Date());
98
- if (B(c) && B(s))
99
- return { from: c, to: s };
100
- }, z = (e, t) => {
101
- if (e)
102
- return t === "single" ? Te(e) : Me(e);
103
- }, Le = (e, t) => {
104
- const [o, n] = A(/* @__PURE__ */ new Date());
105
- return {
106
- month: F(() => {
107
- const s = z(e, t);
108
- if (!s) return o;
109
- if (t === "single" && s instanceof Date)
110
- return s;
111
- if (t === "range" && typeof s == "object" && "from" in s) {
112
- const l = s;
113
- if (l.from)
114
- return l.from;
115
- if (l.to)
116
- return l.to;
117
- }
118
- return o;
119
- }, [e, t, o]),
120
- setMonth: (s) => {
121
- n(s);
122
- }
123
- };
124
- }, $e = "_container_15bt3_1", Ae = "_label_15bt3_7", je = "_select_15bt3_14", Fe = "_trigger_15bt3_19", Ve = "_triggerOpen_15bt3_46", Ge = "_placeholder_15bt3_67", We = "_selectedContent_15bt3_71", qe = "_optionIcon_15bt3_81", He = "_arrow_15bt3_87", Ke = "_open_15bt3_98", Ye = "_dropdown_15bt3_102", ze = "_option_15bt3_81", Je = "_selected_15bt3_71", u = {
125
- container: $e,
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,
126
86
  label: Ae,
127
- select: je,
128
- trigger: Fe,
129
- triggerOpen: Ve,
87
+ trigger: Me,
88
+ select: We,
89
+ triggerOpen: Fe,
130
90
  placeholder: Ge,
131
- selectedContent: We,
132
- optionIcon: qe,
133
- arrow: He,
134
- open: Ke,
91
+ selectedContent: Ve,
92
+ optionIcon: He,
93
+ arrow: Ke,
94
+ open: Xe,
135
95
  dropdown: Ye,
136
96
  option: ze,
137
97
  selected: Je
138
98
  }, Qe = (e) => {
139
- const { className: t, disabled: o = !1, label: n, onChange: i, options: c, placeholder: s, value: l } = e, [d, f] = A(!1), v = V(null), w = c.find((p) => p.value === l), y = () => {
140
- o || f(!d);
141
- }, h = (p) => {
142
- i?.(p), f(!1);
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);
143
103
  };
144
- return k(() => {
145
- const p = (N) => {
146
- v.current && !v.current.contains(N.target) && f(!1);
104
+ return D(() => {
105
+ const _ = (k) => {
106
+ v.current && !v.current.contains(k.target) && h(!1);
147
107
  };
148
- return d && document.addEventListener("mousedown", p), () => {
149
- document.removeEventListener("mousedown", p);
108
+ return d && document.addEventListener("mousedown", _), () => {
109
+ document.removeEventListener("mousedown", _);
150
110
  };
151
- }, [d]), /* @__PURE__ */ _("div", { className: g(u.container, t), children: [
152
- n && /* @__PURE__ */ a("label", { className: u.label, children: n }),
153
- /* @__PURE__ */ _("div", { className: u.select, ref: v, children: [
154
- /* @__PURE__ */ _(
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: [
114
+ /* @__PURE__ */ m(
155
115
  "button",
156
116
  {
157
- className: g(u.trigger, d && u.triggerOpen),
158
- disabled: o,
159
- onClick: y,
117
+ className: w(y.trigger, d && y.triggerOpen),
118
+ disabled: r,
119
+ onClick: g,
160
120
  type: "button",
161
121
  "aria-haspopup": "listbox",
162
122
  "aria-expanded": d,
163
123
  children: [
164
- /* @__PURE__ */ _("span", { className: w ? u.selectedContent : u.placeholder, children: [
165
- w?.icon && /* @__PURE__ */ a("span", { className: u.optionIcon, children: w.icon }),
166
- w ? w.label : s || "Select an option"
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"
167
127
  ] }),
168
- /* @__PURE__ */ a("span", { className: g(u.arrow, d && u.open), children: /* @__PURE__ */ a(Z, {}) })
128
+ /* @__PURE__ */ n("span", { className: w(y.arrow, d && y.open), children: /* @__PURE__ */ n(te, {}) })
169
129
  ]
170
130
  }
171
131
  ),
172
- d && /* @__PURE__ */ a(U, { className: u.dropdown, role: "listbox", style: { maxHeight: 191 }, children: c.map((p) => /* @__PURE__ */ _(
132
+ d && /* @__PURE__ */ n(Q, { className: y.dropdown, role: "listbox", style: { maxHeight: 191 }, children: s.map((_) => /* @__PURE__ */ m(
173
133
  "button",
174
134
  {
175
- className: g(u.option, p.value === l && u.selected),
176
- onClick: () => h(p.value),
135
+ className: w(y.option, _.value === i && y.selected),
136
+ onClick: () => f(_.value),
177
137
  type: "button",
178
138
  role: "option",
179
- "aria-selected": p.value === l,
139
+ "aria-selected": _.value === i,
180
140
  children: [
181
- p.icon && /* @__PURE__ */ a("span", { className: u.optionIcon, children: p.icon }),
182
- p.label
141
+ _.icon && /* @__PURE__ */ n("span", { className: y.optionIcon, children: _.icon }),
142
+ _.label
183
143
  ]
184
144
  },
185
- p.value
145
+ _.value
186
146
  )) })
187
147
  ] })
188
148
  ] });
189
- }, J = (e) => {
190
- const t = (n) => {
149
+ }, z = (e) => {
150
+ const t = (o) => {
191
151
  if (e.onChange) {
192
- const i = {
152
+ const l = {
193
153
  target: {
194
- value: n
154
+ value: o
195
155
  }
196
156
  };
197
- e.onChange(i);
157
+ e.onChange(l);
198
158
  }
199
- }, o = e.options?.map((n) => ({
200
- value: n.value.toString(),
201
- label: n.label
159
+ }, r = e.options?.map((o) => ({
160
+ value: o.value.toString(),
161
+ label: o.label
202
162
  })) || [];
203
- return /* @__PURE__ */ a(
163
+ return /* @__PURE__ */ n(
204
164
  Qe,
205
165
  {
206
166
  className: e.className,
207
- options: o,
167
+ options: r,
208
168
  value: e.value?.toString() || "",
209
169
  onChange: t
210
170
  }
211
171
  );
212
172
  };
213
- J.displayName = "DatePickerDropdown";
173
+ z.displayName = "DatePickerDropdown";
214
174
  const Ue = {
215
- month_caption: r.monthsCaption,
216
- button_previous: r.navButtonPrevious,
217
- button_next: r.navButtonNext,
218
- chevron: r.navIcon,
219
- caption_label: r.captionLabel,
220
- dropdowns: r.dropdowns,
221
- dropdown_root: r.dropdown_root,
222
- dropdown: r.dropdown,
223
- dropdown_select_option: r.option,
224
- months_dropdown: r.monthsDropdown,
225
- years_dropdown: r.yearsDropdown,
226
- month_grid: r.monthGrid,
227
- weekday: r.weekday,
228
- day_button: r.dayButton,
229
- day: r.day,
230
- outside: r.dayOutside,
231
- selected: r.daySelected,
232
- range_start: r.dayRangeStart,
233
- range_middle: r.dayRangeMiddle,
234
- range_end: r.dayRangeEnd,
235
- today: r.dayToday
236
- }, Xe = {
237
- Dropdown: J
175
+ month_caption: a.monthsCaption,
176
+ button_previous: a.navButtonPrevious,
177
+ button_next: a.navButtonNext,
178
+ chevron: a.navIcon,
179
+ caption_label: a.captionLabel,
180
+ dropdowns: a.dropdowns,
181
+ dropdown_root: a.dropdown_root,
182
+ dropdown: a.dropdown,
183
+ dropdown_select_option: a.option,
184
+ months_dropdown: a.monthsDropdown,
185
+ years_dropdown: a.yearsDropdown,
186
+ month_grid: a.monthGrid,
187
+ weekday: a.weekday,
188
+ day_button: a.dayButton,
189
+ day: a.day,
190
+ outside: a.dayOutside,
191
+ selected: a.daySelected,
192
+ range_start: a.dayRangeStart,
193
+ range_middle: a.dayRangeMiddle,
194
+ range_end: a.dayRangeEnd,
195
+ today: a.dayToday
238
196
  }, Ze = {
197
+ Dropdown: z
198
+ }, et = {
239
199
  weekStartsOn: 1,
240
200
  showOutsideDays: !0,
241
201
  reverseYears: !0,
242
202
  captionLayout: "dropdown"
243
- }, et = {
244
- components: Xe,
245
- ...Ze
246
- }, tt = (e) => ({
247
- ...et,
203
+ }, tt = {
204
+ components: Ze,
205
+ ...et
206
+ }, nt = (e) => ({
207
+ ...tt,
248
208
  classNames: {
249
- root: j(r.calendar, e && r.open),
209
+ root: M(a.calendar, e && a.open),
250
210
  ...Ue
251
211
  }
252
- }), M = "dd.MM.yyyy", nt = (e) => e ? O(e, M) : "", ot = (e) => !e || !e.from ? "" : e.to && e.from.getTime() !== e.to.getTime() ? `${O(e.from, M)} - ${O(e.to, M)}` : O(e.from, M), q = (e, t) => e ? t === "single" && e instanceof Date ? nt(e) : t === "range" && typeof e == "object" && "from" in e ? ot(e) : "" : "", at = ({
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 = ({
253
213
  value: e,
254
214
  mode: t,
255
- onChange: o,
256
- setMonth: n,
257
- setIsOpen: i
215
+ onChange: r,
216
+ setMonth: o,
217
+ setIsOpen: l
258
218
  }) => {
259
219
  if (!e) {
260
- o("");
220
+ r("");
261
221
  return;
262
222
  }
263
223
  if (t === "single") {
264
- e instanceof Date && (n(e), o(q(e, "single")), i(!1));
224
+ e instanceof Date && (o(e), r(H(e, "single")), l(!1));
265
225
  return;
266
226
  }
267
227
  if (t === "range" && typeof e == "object" && "from" in e) {
268
- const c = e;
269
- c.from ? n(c.from) : c.to && n(c.to);
270
- const s = q(c, "range");
271
- o(s), c.from && c.to && c.from.getTime() !== c.to.getTime() && i(!1);
228
+ const s = e;
229
+ 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);
232
+ }
233
+ }, L = "dd.MM.yyyy", st = (e) => {
234
+ if (!e) return;
235
+ const t = O(e, L, /* @__PURE__ */ new Date());
236
+ return $(t) ? t : void 0;
237
+ }, ct = (e) => {
238
+ if (!e) return;
239
+ const t = " - ", r = e.indexOf(t);
240
+ if (r === -1) {
241
+ const i = O(e.trim(), L, /* @__PURE__ */ new Date());
242
+ return $(i) ? { from: i, to: void 0 } : void 0;
272
243
  }
273
- }, rt = (e, t, o) => {
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());
247
+ if ($(s) && $(c))
248
+ return { from: s, to: c };
249
+ }, it = (e, t) => {
250
+ if (e)
251
+ return t === "single" ? st(e) : ct(e);
252
+ }, lt = (e, t, r) => {
274
253
  if (e) {
275
254
  if (t === "single" && e instanceof Date) {
276
- o(e);
255
+ r(e);
277
256
  return;
278
257
  }
279
258
  if (t === "range" && typeof e == "object" && "from" in e) {
280
- const n = e;
281
- n.from ? o(n.from) : n.to && o(n.to);
259
+ const o = e;
260
+ o.from ? r(o.from) : o.to && r(o.to);
282
261
  }
283
262
  }
284
- }, Wt = ({
263
+ }, on = ({
285
264
  mode: e,
286
265
  value: t,
287
- onChange: o,
288
- disabled: n,
289
- label: i,
290
- error: c,
291
- placeholder: s,
292
- ...l
266
+ onChange: r,
267
+ disabled: o,
268
+ label: l,
269
+ error: s,
270
+ placeholder: c,
271
+ ...i
293
272
  }) => {
294
- const [d, f] = A(!1), v = V(null), { month: w, setMonth: y } = Le(t, e), h = F(() => z(t, e), [t, e]);
295
- k(() => {
296
- rt(h, e, y);
297
- }, [h, e, y]), Oe({ ref: v, isOpen: d, onDismiss: () => {
298
- f(!1);
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);
299
278
  } });
300
- const N = (b) => {
301
- b.stopPropagation(), C(void 0);
302
- }, E = () => {
303
- n || f((b) => !b);
304
- }, D = (b) => {
305
- const Q = b.currentTarget.value;
306
- o(Q);
307
- }, C = (b) => {
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) => {
308
287
  at({
309
- value: b,
288
+ value: I,
310
289
  mode: e,
311
- onChange: o,
312
- setMonth: y,
313
- setIsOpen: f
290
+ onChange: r,
291
+ setMonth: g,
292
+ setIsOpen: h
314
293
  });
315
- }, x = F(() => tt(d), [d]);
316
- return /* @__PURE__ */ _("div", { ref: v, className: r.wrapper, children: [
317
- /* @__PURE__ */ _("div", { className: r.inputContainer, children: [
318
- i && /* @__PURE__ */ a("span", { className: n ? r.disabledLabel : r.label, children: /* @__PURE__ */ a(G, { variant: "text-14", children: i }) }),
319
- /* @__PURE__ */ _("div", { className: r.inputWrapper, children: [
320
- /* @__PURE__ */ a(
294
+ }, P = G(() => nt(d), [d]);
295
+ return /* @__PURE__ */ m("div", { ref: v, className: a.wrapper, children: [
296
+ /* @__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 }) }),
298
+ /* @__PURE__ */ m("div", { className: a.inputWrapper, children: [
299
+ /* @__PURE__ */ n(
321
300
  "input",
322
301
  {
323
302
  type: "text",
324
- className: j(r.trigger, c && r.error),
325
- onClick: E,
303
+ className: M(a.trigger, s && a.error),
304
+ onClick: N,
326
305
  value: t,
327
- onChange: D,
328
- placeholder: s,
329
- disabled: n,
330
- "aria-label": i || "Select date",
306
+ onChange: p,
307
+ placeholder: c,
308
+ disabled: o,
309
+ "aria-label": l || "Select date",
331
310
  "aria-expanded": d,
332
311
  "aria-haspopup": "dialog",
333
- "aria-invalid": c ? "true" : "false",
334
- ...l
312
+ "aria-invalid": s ? "true" : "false",
313
+ ...i
335
314
  }
336
315
  ),
337
- t && !n && /* @__PURE__ */ a(
316
+ t && !o && /* @__PURE__ */ n(
338
317
  "button",
339
318
  {
340
319
  type: "button",
341
- className: r.clearButton,
342
- onClick: N,
320
+ className: a.clearButton,
321
+ onClick: k,
343
322
  "aria-label": "Clear date",
344
- children: /* @__PURE__ */ a(Y, { className: r.clearIcon })
323
+ children: /* @__PURE__ */ n(Y, { className: a.clearIcon })
345
324
  }
346
325
  ),
347
- /* @__PURE__ */ a(ee, { className: j(r.icon, !t && r.placeholder) })
326
+ /* @__PURE__ */ n(ne, { className: M(a.icon, !t && a.placeholder) })
348
327
  ] }),
349
- c && /* @__PURE__ */ a(G, { variant: "small", className: r.error, children: c })
328
+ s && /* @__PURE__ */ n(F, { variant: "small", className: a.error, children: s })
350
329
  ] }),
351
- e === "single" ? /* @__PURE__ */ a(
352
- W,
330
+ e === "single" ? /* @__PURE__ */ n(
331
+ V,
353
332
  {
354
- ...x,
355
- month: w,
356
- onMonthChange: y,
333
+ ...P,
334
+ month: u,
335
+ onMonthChange: g,
357
336
  mode: "single",
358
- selected: h instanceof Date ? h : void 0,
359
- onSelect: C
337
+ selected: f instanceof Date ? f : void 0,
338
+ onSelect: x
360
339
  }
361
- ) : /* @__PURE__ */ a(
362
- W,
340
+ ) : /* @__PURE__ */ n(
341
+ V,
363
342
  {
364
- ...x,
365
- month: w,
366
- onMonthChange: y,
343
+ ...P,
344
+ month: u,
345
+ onMonthChange: g,
367
346
  mode: "range",
368
- selected: h && typeof h == "object" && "from" in h ? h : void 0,
369
- onSelect: C
347
+ selected: f && typeof f == "object" && "from" in f ? f : void 0,
348
+ onSelect: x
370
349
  }
371
350
  )
372
351
  ] });
373
- }, st = "_content_1bas8_1", ct = "_item_1bas8_24", it = "_icon_1bas8_56", lt = "_label_1bas8_62", P = {
374
- content: st,
375
- item: ct,
376
- icon: it,
377
- label: lt
378
- }, qt = (e) => {
379
- const { children: t, items: o, className: n, align: i = "end", side: c = "bottom" } = e;
380
- return /* @__PURE__ */ _(S.Root, { children: [
381
- /* @__PURE__ */ a(S.Trigger, { asChild: !0, children: t }),
382
- /* @__PURE__ */ a(S.Portal, { children: /* @__PURE__ */ a(
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(
383
362
  S.Content,
384
363
  {
385
- align: i,
386
- className: g(P.content, n),
387
- side: c,
364
+ align: l,
365
+ className: w(R.content, o),
366
+ side: s,
388
367
  sideOffset: 4,
389
- children: o.map((s, l) => /* @__PURE__ */ _(
368
+ children: r.map((c, i) => /* @__PURE__ */ m(
390
369
  S.Item,
391
370
  {
392
- className: P.item,
393
- disabled: s.disabled,
394
- onSelect: s.onSelect,
371
+ className: R.item,
372
+ disabled: c.disabled,
373
+ onSelect: c.onSelect,
395
374
  children: [
396
- s.icon && /* @__PURE__ */ a("span", { className: P.icon, children: s.icon }),
397
- /* @__PURE__ */ a("span", { className: P.label, children: s.label })
375
+ c.icon && /* @__PURE__ */ n("span", { className: R.icon, children: c.icon }),
376
+ /* @__PURE__ */ n("span", { className: R.label, children: c.label })
398
377
  ]
399
378
  },
400
- l
379
+ i
401
380
  ))
402
381
  }
403
382
  ) })
404
383
  ] });
405
- }, dt = "_wrapper_1i0po_1", pt = "_label_1i0po_7", _t = "_disabled_1i0po_14", ut = "_inputContainer_1i0po_18", mt = "_input_1i0po_18", ft = "_error_1i0po_51", ht = "_withStartIcon_1i0po_64", wt = "_withEndIcon_1i0po_68", yt = "_startIcon_1i0po_72", bt = "_endIcon_1i0po_73", gt = "_errorMessage_1i0po_115", vt = "_required_1i0po_122", m = {
406
- wrapper: dt,
407
- label: pt,
408
- disabled: _t,
409
- inputContainer: ut,
410
- input: mt,
411
- error: ft,
412
- withStartIcon: ht,
413
- withEndIcon: wt,
414
- startIcon: yt,
415
- endIcon: bt,
416
- errorMessage: gt,
417
- required: vt
418
- }, Ct = X(
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(
419
398
  ({
420
399
  label: e,
421
400
  errorMessage: t,
422
- startIcon: o,
423
- endIcon: n,
424
- onEndIconClick: i,
425
- allowPasswordToggle: c,
426
- disabled: s,
427
- type: l = "text",
401
+ startIcon: r,
402
+ endIcon: o,
403
+ onEndIconClick: l,
404
+ allowPasswordToggle: s,
405
+ disabled: c,
406
+ type: i = "text",
428
407
  className: d,
429
- required: f,
408
+ required: h,
430
409
  id: v,
431
- ...w
432
- }, y) => {
433
- const h = K(), p = v ?? h, N = t ? `${p}-error` : void 0, E = !!t, D = l === "password" && c, [C, x] = A(!1);
434
- return /* @__PURE__ */ _("div", { className: g(m.wrapper, d), children: [
435
- e && /* @__PURE__ */ _("label", { htmlFor: p, className: g(m.label, { [m.disabled]: s }), children: [
410
+ ...u
411
+ }, 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: [
436
415
  e,
437
- f && /* @__PURE__ */ a("sup", { className: m.required, children: " *" })
416
+ h && /* @__PURE__ */ n("sup", { className: b.required, children: " *" })
438
417
  ] }),
439
- /* @__PURE__ */ _(
418
+ /* @__PURE__ */ m(
440
419
  "div",
441
420
  {
442
- className: g(m.inputContainer, {
443
- [m.error]: E,
444
- [m.disabled]: s,
445
- [m.withStartIcon]: !!o,
446
- [m.withEndIcon]: !!n || D
421
+ className: w(b.inputContainer, {
422
+ [b.error]: N,
423
+ [b.disabled]: c,
424
+ [b.withStartIcon]: !!r,
425
+ [b.withEndIcon]: !!o || p
447
426
  }),
448
427
  children: [
449
- o && /* @__PURE__ */ a("span", { className: m.startIcon, children: o }),
450
- /* @__PURE__ */ a(
428
+ r && /* @__PURE__ */ n("span", { className: b.startIcon, children: r }),
429
+ /* @__PURE__ */ n(
451
430
  "input",
452
431
  {
453
- ref: y,
454
- id: p,
455
- className: m.input,
456
- type: D && C ? "text" : l,
457
- autoComplete: l === "password" ? "current-password" : "off",
458
- required: f,
459
- disabled: s,
460
- "aria-invalid": E,
461
- "aria-describedby": N,
462
- ...w
432
+ ref: g,
433
+ id: _,
434
+ className: b.input,
435
+ type: p && x ? "text" : i,
436
+ autoComplete: i === "password" ? "current-password" : "off",
437
+ required: h,
438
+ disabled: c,
439
+ "aria-invalid": N,
440
+ "aria-describedby": k,
441
+ ...u
463
442
  }
464
443
  ),
465
- D && /* @__PURE__ */ a(
444
+ p && /* @__PURE__ */ n(
466
445
  "button",
467
446
  {
468
447
  type: "button",
469
- className: m.endIcon,
470
- onClick: () => x((b) => !b),
471
- "aria-label": C ? "Hide password" : "Show password",
472
- disabled: s,
448
+ className: b.endIcon,
449
+ onClick: () => P((I) => !I),
450
+ "aria-label": x ? "Hide password" : "Show password",
451
+ disabled: c,
473
452
  tabIndex: -1,
474
- children: C ? /* @__PURE__ */ a(te, {}) : /* @__PURE__ */ a(ne, {})
453
+ children: x ? /* @__PURE__ */ n(oe, {}) : /* @__PURE__ */ n(re, {})
475
454
  }
476
455
  ),
477
- n && !D && /* @__PURE__ */ a(
456
+ o && !p && /* @__PURE__ */ n(
478
457
  "button",
479
458
  {
480
459
  type: "button",
481
- className: m.endIcon,
482
- onClick: i,
460
+ className: b.endIcon,
461
+ onClick: l,
483
462
  "aria-label": "Action",
484
- disabled: s,
485
- children: n
463
+ disabled: c,
464
+ children: o
486
465
  }
487
466
  )
488
467
  ]
489
468
  }
490
469
  ),
491
- E && /* @__PURE__ */ a("span", { id: N, className: m.errorMessage, role: "alert", children: t })
470
+ N && /* @__PURE__ */ n("span", { id: k, className: b.errorMessage, role: "alert", children: t })
492
471
  ] });
493
472
  }
494
473
  );
495
- Ct.displayName = "Input";
496
- const Nt = "_overlay_17k3a_1", Dt = "_modal_17k3a_15", It = "_header_17k3a_29", kt = "_title_17k3a_39", Et = "_close_17k3a_52", St = "_body_17k3a_79", I = {
497
- overlay: Nt,
498
- modal: Dt,
499
- header: It,
500
- title: kt,
501
- close: Et,
502
- body: St
503
- }, Ht = ({ open: e, onClose: t, title: o, children: n, className: i }) => {
504
- const c = K(), s = V(t);
505
- if (k(() => {
506
- s.current = t;
507
- }, [t]), k(() => {
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(() => {
485
+ c.current = t;
486
+ }, [t]), D(() => {
508
487
  if (e)
509
488
  return document.body.style.overflow = "hidden", () => {
510
489
  document.body.style.overflow = "";
511
490
  };
512
- }, [e]), k(() => {
491
+ }, [e]), D(() => {
513
492
  if (!e) return;
514
- const d = (f) => {
515
- f.key === "Escape" && s.current();
493
+ const d = (h) => {
494
+ h.key === "Escape" && c.current();
516
495
  };
517
496
  return document.addEventListener("keydown", d), () => {
518
497
  document.removeEventListener("keydown", d);
519
498
  };
520
499
  }, [e]), !e || typeof document > "u") return null;
521
- const l = document.getElementById("modal-root") ?? document.body;
522
- return oe(
523
- /* @__PURE__ */ a(
524
- ae,
500
+ const i = document.getElementById("modal-root") ?? document.body;
501
+ return ce(
502
+ /* @__PURE__ */ n(
503
+ ie,
525
504
  {
526
505
  active: e,
527
506
  focusTrapOptions: {
528
507
  clickOutsideDeactivates: !0,
529
508
  returnFocusOnDeactivate: !0
530
509
  },
531
- children: /* @__PURE__ */ a("div", { className: I.overlay, onClick: () => s.current(), children: /* @__PURE__ */ _(
510
+ children: /* @__PURE__ */ n("div", { className: E.overlay, onClick: () => c.current(), children: /* @__PURE__ */ m(
532
511
  "div",
533
512
  {
534
- className: g(I.modal, i),
513
+ className: w(E.modal, l),
535
514
  onClick: (d) => d.stopPropagation(),
536
515
  role: "dialog",
537
516
  "aria-modal": "true",
538
- "aria-labelledby": c,
517
+ "aria-labelledby": s,
539
518
  children: [
540
- /* @__PURE__ */ _("header", { className: I.header, children: [
541
- /* @__PURE__ */ a("h2", { id: c, className: I.title, children: o }),
542
- /* @__PURE__ */ a(
519
+ /* @__PURE__ */ m("header", { className: E.header, children: [
520
+ /* @__PURE__ */ n("h2", { id: s, className: E.title, children: r }),
521
+ /* @__PURE__ */ n(
543
522
  "button",
544
523
  {
545
524
  type: "button",
546
- className: I.close,
525
+ className: E.close,
547
526
  "aria-label": "Close modal",
548
- onClick: () => s.current(),
549
- children: /* @__PURE__ */ a(Y, {})
527
+ onClick: () => c.current(),
528
+ children: /* @__PURE__ */ n(Y, {})
550
529
  }
551
530
  )
552
531
  ] }),
553
- /* @__PURE__ */ a("div", { className: I.body, children: n })
532
+ /* @__PURE__ */ n("div", { className: E.body, children: o })
554
533
  ]
555
534
  }
556
535
  ) })
557
536
  }
558
537
  ),
559
- l
538
+ i
560
539
  );
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 = ({
552
+ children: e,
553
+ value: t,
554
+ onValueChange: r,
555
+ autoPlayInterval: o = 0,
556
+ className: l,
557
+ hideArrowsWhenSingle: s = !0
558
+ }) => {
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);
563
+ },
564
+ [i, v, r]
565
+ );
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: [
575
+ /* @__PURE__ */ n(
576
+ "button",
577
+ {
578
+ type: "button",
579
+ className: w(C.arrow, C.arrowPrev),
580
+ onClick: f,
581
+ "aria-label": "Previous slide",
582
+ tabIndex: 0,
583
+ children: /* @__PURE__ */ n(ae, { width: 24, height: 24, "aria-hidden": !0 })
584
+ }
585
+ ),
586
+ /* @__PURE__ */ n(
587
+ "button",
588
+ {
589
+ type: "button",
590
+ className: w(C.arrow, C.arrowNext),
591
+ onClick: _,
592
+ "aria-label": "Next slide",
593
+ tabIndex: 0,
594
+ children: /* @__PURE__ */ n(se, { width: 24, height: 24, "aria-hidden": !0 })
595
+ }
596
+ )
597
+ ] }),
598
+ i > 1 && /* @__PURE__ */ n("div", { className: C.dots, role: "tablist", "aria-label": "Slide selection", children: c.map((N, p) => /* @__PURE__ */ n(
599
+ "button",
600
+ {
601
+ type: "button",
602
+ 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
608
+ },
609
+ p
610
+ )) })
611
+ ] });
561
612
  };
562
613
  export {
563
- H as Alert,
564
- Xt as Button,
565
- Zt as Card,
566
- en as Checkbox,
567
- Wt as DatePicker,
568
- qt as DropdownMenu,
569
- Ct as Input,
570
- tn as Label,
571
- Ht as Modal,
572
- nn as Radio,
614
+ 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,
573
625
  Qe as Select,
574
- Qt as SimpleBar,
575
- on as Tab,
576
- an as Textarea,
577
- G as Typography,
578
- zt as clsx,
579
- Gt as toastError,
580
- Vt as toastSuccess
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
581
633
  };
582
634
  //# sourceMappingURL=index.client.js.map