snapflow-ui-kit 1.2.0 → 1.2.2

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