snapflow-ui-kit 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,646 +1,23 @@
1
- import D, { clsx as u } from "clsx";
2
- import { clsx as Pn } from "clsx";
3
- import nt from "simplebar-react";
4
- import { default as zn } from "simplebar-react";
5
- import { jsxs as i, jsx as a, Fragment as ot } from "react/jsx-runtime";
6
- import { E as at, a as st, C as J, A as rt, b as ct } from "./CloseIcon-BASungOx.js";
7
- import { forwardRef as K, useId as Q, useState as L, useEffect as G, useMemo as F, useRef as U } from "react";
8
- import { DayPicker as H } from "react-day-picker";
9
- import { parse as O, isValid as P, format as R } from "date-fns";
10
- import { toast as j } from "react-hot-toast";
11
- const lt = "_button_dqki1_1", it = "_primary_dqki1_25", dt = "_secondary_dqki1_48", _t = "_outlined_dqki1_71", pt = "_text_dqki1_97", ut = "_icon_dqki1_117", $ = {
12
- button: lt,
13
- primary: it,
14
- secondary: dt,
15
- outlined: _t,
16
- text: pt,
17
- icon: ut
18
- }, xn = (t) => {
19
- const { className: e, variant: n = "primary", asLink: o, icon: s, ...r } = t, c = u($.button, $[n], e);
20
- if (o) {
21
- const { children: m, ...h } = r;
22
- return /* @__PURE__ */ i("a", { className: c, ...h, children: [
23
- s && /* @__PURE__ */ a("span", { className: $.icon, children: s }),
24
- m
25
- ] });
26
- }
27
- const { children: d, ...p } = r;
28
- return /* @__PURE__ */ i("button", { className: c, ...p, children: [
29
- s && /* @__PURE__ */ a("span", { className: $.icon, children: s }),
30
- d
31
- ] });
32
- }, mt = "_wrapper_ck06d_1", ht = "_label_ck06d_7", bt = "_disabled_ck06d_14", ft = "_inputContainer_ck06d_18", yt = "_input_ck06d_18", wt = "_error_ck06d_51", gt = "_withStartIcon_ck06d_64", Nt = "_withEndIcon_ck06d_68", vt = "_startIcon_ck06d_72", xt = "_endIcon_ck06d_73", kt = "_errorMessage_ck06d_115", Ct = "_required_ck06d_122", b = {
33
- wrapper: mt,
34
- label: ht,
35
- disabled: bt,
36
- inputContainer: ft,
37
- input: yt,
38
- error: wt,
39
- withStartIcon: gt,
40
- withEndIcon: Nt,
41
- startIcon: vt,
42
- endIcon: xt,
43
- errorMessage: kt,
44
- required: Ct
45
- }, It = K(
46
- ({
47
- label: t,
48
- errorMessage: e,
49
- startIcon: n,
50
- endIcon: o,
51
- onEndIconClick: s,
52
- allowPasswordToggle: r,
53
- disabled: c,
54
- type: d = "text",
55
- className: p,
56
- required: m,
57
- id: h,
58
- ...y
59
- }, N) => {
60
- const w = Q(), _ = h ?? w, C = e ? `${_}-error` : void 0, S = !!e, I = d === "password" && r, [x, E] = L(!1);
61
- return /* @__PURE__ */ i("div", { className: u(b.wrapper, p), children: [
62
- t && /* @__PURE__ */ i("label", { htmlFor: _, className: u(b.label, { [b.disabled]: c }), children: [
63
- t,
64
- m && /* @__PURE__ */ a("sup", { className: b.required, children: " *" })
65
- ] }),
66
- /* @__PURE__ */ i(
67
- "div",
68
- {
69
- className: u(b.inputContainer, {
70
- [b.error]: S,
71
- [b.disabled]: c,
72
- [b.withStartIcon]: !!n,
73
- [b.withEndIcon]: !!o || I
74
- }),
75
- children: [
76
- n && /* @__PURE__ */ a("span", { className: b.startIcon, children: n }),
77
- /* @__PURE__ */ a(
78
- "input",
79
- {
80
- ref: N,
81
- id: _,
82
- className: b.input,
83
- type: I && x ? "text" : d,
84
- autoComplete: d === "password" ? "current-password" : "off",
85
- required: m,
86
- disabled: c,
87
- "aria-invalid": S,
88
- "aria-describedby": C,
89
- ...y
90
- }
91
- ),
92
- I && /* @__PURE__ */ a(
93
- "button",
94
- {
95
- type: "button",
96
- className: b.endIcon,
97
- onClick: () => E((v) => !v),
98
- "aria-label": x ? "Hide password" : "Show password",
99
- disabled: c,
100
- tabIndex: -1,
101
- children: x ? /* @__PURE__ */ a(at, {}) : /* @__PURE__ */ a(st, {})
102
- }
103
- ),
104
- o && !I && /* @__PURE__ */ a(
105
- "button",
106
- {
107
- type: "button",
108
- className: b.endIcon,
109
- onClick: s,
110
- "aria-label": "Action",
111
- disabled: c,
112
- children: o
113
- }
114
- )
115
- ]
116
- }
117
- ),
118
- S && /* @__PURE__ */ a("span", { id: C, className: b.errorMessage, role: "alert", children: e })
119
- ] });
120
- }
121
- );
122
- It.displayName = "Input";
123
- const St = "_textareaWrapper_ahoiy_1", Dt = "_label_ahoiy_7", Et = "_disabled_ahoiy_14", $t = "_textarea_ahoiy_1", Bt = "_errorState_ahoiy_46", qt = "_errorMessage_ahoiy_52", Ot = "_required_ahoiy_59", k = {
124
- textareaWrapper: St,
125
- label: Dt,
126
- disabled: Et,
127
- textarea: $t,
128
- errorState: Bt,
129
- errorMessage: qt,
130
- required: Ot
131
- }, Pt = K(
132
- ({ label: t, errorMessage: e, id: n, className: o, disabled: s, minHeight: r = 84, required: c, ...d }, p) => {
133
- const m = Q(), h = n ?? m, y = e ? `${h}-error` : void 0;
134
- return /* @__PURE__ */ i("div", { className: u(k.textareaWrapper, o), children: [
135
- t && /* @__PURE__ */ i("label", { htmlFor: h, className: u(k.label, { [k.disabled]: s }), children: [
136
- t,
137
- c && /* @__PURE__ */ a("sup", { className: k.required, children: " *" })
138
- ] }),
139
- /* @__PURE__ */ a(
140
- "textarea",
141
- {
142
- ref: p,
143
- id: h,
144
- className: u(k.textarea, { [k.errorState]: !!e }),
145
- "aria-invalid": !!e,
146
- "aria-describedby": y,
147
- required: c,
148
- disabled: s,
149
- style: { minHeight: r },
150
- ...d
151
- }
152
- ),
153
- e && /* @__PURE__ */ a("span", { id: y, role: "alert", className: k.errorMessage, children: e })
154
- ] });
155
- }
156
- );
157
- Pt.displayName = "Textarea";
158
- const Rt = "_alert_5jfpm_1", zt = "_content_5jfpm_15", Tt = "_error_5jfpm_22", jt = "_success_5jfpm_28", Lt = "_closeButton_5jfpm_33", Mt = "_message_5jfpm_39", At = "_title_5jfpm_40", Wt = "_toastEnter_5jfpm_50", Ft = "_toastExit_5jfpm_54", g = {
159
- alert: Rt,
160
- content: zt,
161
- error: Tt,
162
- success: jt,
163
- closeButton: Lt,
164
- message: Mt,
165
- title: At,
166
- toastEnter: Wt,
167
- "fade-in": "_fade-in_5jfpm_1",
168
- toastExit: Ft,
169
- "fade-out": "_fade-out_5jfpm_1"
170
- }, X = ({
171
- variant: t = "error",
172
- title: e,
173
- message: n,
174
- className: o,
175
- onClose: s
176
- }) => /* @__PURE__ */ i("div", { className: D(g.alert, g[t], o), role: "alert", children: [
177
- /* @__PURE__ */ i("div", { className: g.content, children: [
178
- e && /* @__PURE__ */ a("div", { className: g.title, children: e }),
179
- /* @__PURE__ */ a("div", { className: g.message, children: n })
180
- ] }),
181
- s && /* @__PURE__ */ a("button", { type: "button", className: g.closeButton, onClick: s, "aria-label": "Close alert", children: /* @__PURE__ */ a(J, {}) })
182
- ] }), kn = (t) => {
183
- j.custom((e) => /* @__PURE__ */ a(
184
- X,
185
- {
186
- variant: "success",
187
- message: t,
188
- className: e.visible ? g.toastEnter : g.toastExit,
189
- onClose: () => j.dismiss(e.id)
190
- }
191
- ));
192
- }, Cn = (t, e = "Error!") => {
193
- j.custom((n) => /* @__PURE__ */ a(
194
- X,
195
- {
196
- variant: "error",
197
- title: e,
198
- message: t,
199
- className: n.visible ? g.toastEnter : g.toastExit,
200
- onClose: () => j.dismiss(n.id)
201
- }
202
- ));
203
- }, Vt = "_card_1ah7i_1", Gt = {
204
- card: Vt
205
- }, In = ({ className: t, children: e, ...n }) => /* @__PURE__ */ a("div", { className: u(Gt.card, t), ...n, children: e }), Ht = "_checkbox_1q28z_1", Yt = "_input_1q28z_11", Jt = "_labelSpan_1q28z_16", Kt = "_control_1q28z_23", B = {
206
- checkbox: Ht,
207
- input: Yt,
208
- labelSpan: Jt,
209
- control: Kt
210
- }, Sn = ({ children: t, className: e, checked: n, onChange: o, ...s }) => /* @__PURE__ */ i("label", { className: u(B.checkbox, e), children: [
211
- /* @__PURE__ */ a("input", { type: "checkbox", className: B.input, checked: n, onChange: o, ...s }),
212
- /* @__PURE__ */ a("span", { className: B.control }),
213
- t && /* @__PURE__ */ a("span", { className: B.labelSpan, children: t })
214
- ] }), Qt = "_label_ndvr9_1", Ut = "_required_ndvr9_5", Xt = "_srOnly_ndvr9_10", M = {
215
- label: Qt,
216
- required: Ut,
217
- srOnly: Xt
218
- }, Dn = ({
219
- text: t,
220
- textVariant: e = "text-14-medium",
221
- required: n = !1,
222
- color: o,
223
- className: s,
224
- htmlFor: r,
225
- ...c
226
- }) => /* @__PURE__ */ i(
227
- V,
228
- {
229
- as: "label",
230
- variant: e,
231
- className: D(M.label, s),
232
- htmlFor: r,
233
- style: o ? { color: o } : void 0,
234
- ...c,
235
- children: [
236
- t,
237
- n && /* @__PURE__ */ i(ot, { children: [
238
- /* @__PURE__ */ a("span", { className: M.required, "aria-hidden": "true", children: "*" }),
239
- /* @__PURE__ */ a("span", { className: M.srOnly, children: " (required)" })
240
- ] })
241
- ]
242
- }
243
- ), Zt = "_tab_78cv0_1", te = "_selected_78cv0_21", A = {
244
- tab: Zt,
245
- selected: te
246
- }, En = (t) => {
247
- const { children: e, selected: n = !1, className: o, disabled: s = !1, ...r } = t, c = u(A.tab, n && A.selected, s && A.disabled, o);
248
- return /* @__PURE__ */ a(
249
- "button",
250
- {
251
- type: "button",
252
- role: "tab",
253
- className: c,
254
- disabled: s,
255
- tabIndex: s ? -1 : 0,
256
- "aria-selected": n,
257
- "aria-disabled": s,
258
- ...r,
259
- children: e
260
- }
261
- );
262
- }, ee = "_radio_10hqy_1", ne = "_input_10hqy_12", oe = "_labelSpan_10hqy_18", ae = "_control_10hqy_26", q = {
263
- radio: ee,
264
- input: ne,
265
- labelSpan: oe,
266
- control: ae
267
- }, $n = ({ children: t, className: e, checked: n, onChange: o, ...s }) => /* @__PURE__ */ i("label", { className: u(q.radio, e), children: [
268
- /* @__PURE__ */ a("input", { type: "radio", className: q.input, checked: n, onChange: o, ...s }),
269
- /* @__PURE__ */ a("span", { className: q.control }),
270
- t && /* @__PURE__ */ a("span", { className: q.labelSpan, children: t })
271
- ] }), se = "_typography_11tbz_1", re = "_icon_11tbz_8", ce = "_large_11tbz_14", le = "_h1_11tbz_20", ie = "_h2_11tbz_26", de = "_h3_11tbz_32", _e = "_small_11tbz_68", pe = "_link_11tbz_80", W = {
272
- typography: se,
273
- icon: re,
274
- large: ce,
275
- h1: le,
276
- h2: ie,
277
- h3: de,
278
- "text-16": "_text-16_11tbz_38",
279
- "text-16-bold": "_text-16-bold_11tbz_44",
280
- "text-14": "_text-14_11tbz_50",
281
- "text-14-bold": "_text-14-bold_11tbz_56",
282
- "text-14-medium": "_text-14-medium_11tbz_62",
283
- small: _e,
284
- "small-semibold": "_small-semibold_11tbz_74",
285
- link: pe,
286
- "small-link": "_small-link_11tbz_89"
287
- }, V = (t) => {
288
- const { as: e = "span", children: n, className: o, icon: s, variant: r, ...c } = t;
289
- return /* @__PURE__ */ i(e, { className: u(W.typography, W[r], o), ...c, children: [
290
- s && /* @__PURE__ */ a("span", { className: W.icon, children: s }),
291
- n
292
- ] });
293
- }, ue = "_wrapper_l023w_1", me = "_inputContainer_l023w_5", he = "_label_l023w_11", be = "_inputWrapper_l023w_15", fe = "_trigger_l023w_22", ye = "_icon_l023w_38", we = "_placeholder_l023w_45", ge = "_clearButton_l023w_49", Ne = "_clearIcon_l023w_89", ve = "_disabledLabel_l023w_101", xe = "_error_l023w_123", ke = "_calendar_l023w_141", Ce = "_open_l023w_160", Ie = "_monthsCaption_l023w_166", Se = "_navButtonPrevious_l023w_172", De = "_navButtonNext_l023w_173", Ee = "_navIcon_l023w_193", $e = "_monthGrid_l023w_199", Be = "_dropdowns_l023w_205", qe = "_weekday_l023w_209", Oe = "_day_l023w_220", Pe = "_dayButton_l023w_227", Re = "_dayOutside_l023w_254", ze = "_dayToday_l023w_258", Te = "_daySelected_l023w_263", je = "_dayRangeStart_l023w_264", Le = "_dayRangeEnd_l023w_265", Me = "_dayRangeMiddle_l023w_266", l = {
294
- wrapper: ue,
295
- inputContainer: me,
296
- label: he,
297
- inputWrapper: be,
298
- trigger: fe,
299
- icon: ye,
300
- placeholder: we,
301
- clearButton: ge,
302
- clearIcon: Ne,
303
- disabledLabel: ve,
304
- error: xe,
305
- calendar: ke,
306
- open: Ce,
307
- monthsCaption: Ie,
308
- navButtonPrevious: Se,
309
- navButtonNext: De,
310
- navIcon: Ee,
311
- monthGrid: $e,
312
- dropdowns: Be,
313
- weekday: qe,
314
- day: Oe,
315
- dayButton: Pe,
316
- dayOutside: Re,
317
- dayToday: ze,
318
- daySelected: Te,
319
- dayRangeStart: je,
320
- dayRangeEnd: Le,
321
- dayRangeMiddle: Me
322
- }, Ae = ({
323
- ref: t,
324
- isOpen: e,
325
- onDismiss: n
326
- }) => {
327
- G(() => {
328
- if (!e) return;
329
- const o = (r) => {
330
- t.current && !t.current.contains(r.target) && n();
331
- }, s = (r) => {
332
- r.key === "Escape" && n();
333
- };
334
- return document.addEventListener("mousedown", o), document.addEventListener("touchstart", o), document.addEventListener("keydown", s), () => {
335
- document.removeEventListener("mousedown", o), document.removeEventListener("touchstart", o), document.removeEventListener("keydown", s);
336
- };
337
- }, [e, n, t]);
338
- }, z = "dd.MM.yyyy", We = (t) => {
339
- if (!t) return;
340
- const e = O(t, z, /* @__PURE__ */ new Date());
341
- return P(e) ? e : void 0;
342
- }, Fe = (t) => {
343
- if (!t) return;
344
- const e = " - ", n = t.indexOf(e);
345
- if (n === -1) {
346
- const d = O(t.trim(), z, /* @__PURE__ */ new Date());
347
- return P(d) ? { from: d, to: void 0 } : void 0;
348
- }
349
- const o = t.substring(0, n).trim(), s = t.substring(n + e.length).trim();
350
- if (!o || !s) return;
351
- const r = O(o, z, /* @__PURE__ */ new Date()), c = O(s, z, /* @__PURE__ */ new Date());
352
- if (P(r) && P(c))
353
- return { from: r, to: c };
354
- }, Z = (t, e) => {
355
- if (t)
356
- return e === "single" ? We(t) : Fe(t);
357
- }, Ve = (t, e) => {
358
- const [n, o] = L(/* @__PURE__ */ new Date());
359
- return {
360
- month: F(() => {
361
- const c = Z(t, e);
362
- if (!c) return n;
363
- if (e === "single" && c instanceof Date)
364
- return c;
365
- if (e === "range" && typeof c == "object" && "from" in c) {
366
- const d = c;
367
- if (d.from)
368
- return d.from;
369
- if (d.to)
370
- return d.to;
371
- }
372
- return n;
373
- }, [t, e, n]),
374
- setMonth: (c) => {
375
- o(c);
376
- }
377
- };
378
- }, Ge = "_container_15bt3_1", He = "_label_15bt3_7", Ye = "_select_15bt3_14", Je = "_trigger_15bt3_19", Ke = "_triggerOpen_15bt3_46", Qe = "_placeholder_15bt3_67", Ue = "_selectedContent_15bt3_71", Xe = "_optionIcon_15bt3_81", Ze = "_arrow_15bt3_87", tn = "_open_15bt3_98", en = "_dropdown_15bt3_102", nn = "_option_15bt3_81", on = "_selected_15bt3_71", f = {
379
- container: Ge,
380
- label: He,
381
- select: Ye,
382
- trigger: Je,
383
- triggerOpen: Ke,
384
- placeholder: Qe,
385
- selectedContent: Ue,
386
- optionIcon: Xe,
387
- arrow: Ze,
388
- open: tn,
389
- dropdown: en,
390
- option: nn,
391
- selected: on
392
- }, an = (t) => {
393
- const { className: e, disabled: n = !1, label: o, onChange: s, options: r, placeholder: c, value: d } = t, [p, m] = L(!1), h = U(null), y = r.find((_) => _.value === d), N = () => {
394
- n || m(!p);
395
- }, w = (_) => {
396
- s?.(_), m(!1);
397
- };
398
- return G(() => {
399
- const _ = (C) => {
400
- h.current && !h.current.contains(C.target) && m(!1);
401
- };
402
- return p && document.addEventListener("mousedown", _), () => {
403
- document.removeEventListener("mousedown", _);
404
- };
405
- }, [p]), /* @__PURE__ */ i("div", { className: u(f.container, e), children: [
406
- o && /* @__PURE__ */ a("label", { className: f.label, children: o }),
407
- /* @__PURE__ */ i("div", { className: f.select, ref: h, children: [
408
- /* @__PURE__ */ i(
409
- "button",
410
- {
411
- className: u(f.trigger, p && f.triggerOpen),
412
- disabled: n,
413
- onClick: N,
414
- type: "button",
415
- "aria-haspopup": "listbox",
416
- "aria-expanded": p,
417
- children: [
418
- /* @__PURE__ */ i("span", { className: y ? f.selectedContent : f.placeholder, children: [
419
- y?.icon && /* @__PURE__ */ a("span", { className: f.optionIcon, children: y.icon }),
420
- y ? y.label : c || "Select an option"
421
- ] }),
422
- /* @__PURE__ */ a("span", { className: u(f.arrow, p && f.open), children: /* @__PURE__ */ a(rt, {}) })
423
- ]
424
- }
425
- ),
426
- p && /* @__PURE__ */ a(nt, { className: f.dropdown, role: "listbox", style: { maxHeight: 191 }, children: r.map((_) => /* @__PURE__ */ i(
427
- "button",
428
- {
429
- className: u(f.option, _.value === d && f.selected),
430
- onClick: () => w(_.value),
431
- type: "button",
432
- role: "option",
433
- "aria-selected": _.value === d,
434
- children: [
435
- _.icon && /* @__PURE__ */ a("span", { className: f.optionIcon, children: _.icon }),
436
- _.label
437
- ]
438
- },
439
- _.value
440
- )) })
441
- ] })
442
- ] });
443
- }, tt = (t) => {
444
- const e = (o) => {
445
- if (t.onChange) {
446
- const s = {
447
- target: {
448
- value: o
449
- }
450
- };
451
- t.onChange(s);
452
- }
453
- }, n = t.options?.map((o) => ({
454
- value: o.value.toString(),
455
- label: o.label
456
- })) || [];
457
- return /* @__PURE__ */ a(
458
- an,
459
- {
460
- className: t.className,
461
- options: n,
462
- value: t.value?.toString() || "",
463
- onChange: e
464
- }
465
- );
466
- };
467
- tt.displayName = "DatePickerDropdown";
468
- const sn = {
469
- month_caption: l.monthsCaption,
470
- button_previous: l.navButtonPrevious,
471
- button_next: l.navButtonNext,
472
- chevron: l.navIcon,
473
- caption_label: l.captionLabel,
474
- dropdowns: l.dropdowns,
475
- dropdown_root: l.dropdown_root,
476
- dropdown: l.dropdown,
477
- dropdown_select_option: l.option,
478
- months_dropdown: l.monthsDropdown,
479
- years_dropdown: l.yearsDropdown,
480
- month_grid: l.monthGrid,
481
- weekday: l.weekday,
482
- day_button: l.dayButton,
483
- day: l.day,
484
- outside: l.dayOutside,
485
- selected: l.daySelected,
486
- range_start: l.dayRangeStart,
487
- range_middle: l.dayRangeMiddle,
488
- range_end: l.dayRangeEnd,
489
- today: l.dayToday
490
- }, rn = {
491
- Dropdown: tt
492
- }, cn = {
493
- weekStartsOn: 1,
494
- showOutsideDays: !0,
495
- reverseYears: !0,
496
- captionLayout: "dropdown"
497
- }, ln = {
498
- components: rn,
499
- ...cn
500
- }, dn = (t) => ({
501
- ...ln,
502
- classNames: {
503
- root: D(l.calendar, t && l.open),
504
- ...sn
505
- }
506
- }), T = "dd.MM.yyyy", _n = (t) => t ? R(t, T) : "", pn = (t) => !t || !t.from ? "" : t.to && t.from.getTime() !== t.to.getTime() ? `${R(t.from, T)} - ${R(t.to, T)}` : R(t.from, T), Y = (t, e) => t ? e === "single" && t instanceof Date ? _n(t) : e === "range" && typeof t == "object" && "from" in t ? pn(t) : "" : "", un = ({
507
- value: t,
508
- mode: e,
509
- onChange: n,
510
- setMonth: o,
511
- setIsOpen: s
512
- }) => {
513
- if (!t) {
514
- n("");
515
- return;
516
- }
517
- if (e === "single") {
518
- t instanceof Date && (o(t), n(Y(t, "single")), s(!1));
519
- return;
520
- }
521
- if (e === "range" && typeof t == "object" && "from" in t) {
522
- const r = t;
523
- r.from ? o(r.from) : r.to && o(r.to);
524
- const c = Y(r, "range");
525
- n(c), r.from && r.to && r.from.getTime() !== r.to.getTime() && s(!1);
526
- }
527
- }, mn = (t, e, n) => {
528
- if (t) {
529
- if (e === "single" && t instanceof Date) {
530
- n(t);
531
- return;
532
- }
533
- if (e === "range" && typeof t == "object" && "from" in t) {
534
- const o = t;
535
- o.from ? n(o.from) : o.to && n(o.to);
536
- }
537
- }
538
- }, Bn = ({
539
- mode: t,
540
- value: e,
541
- onChange: n,
542
- disabled: o,
543
- label: s,
544
- error: r,
545
- placeholder: c,
546
- ...d
547
- }) => {
548
- const [p, m] = L(!1), h = U(null), { month: y, setMonth: N } = Ve(e, t), w = F(() => Z(e, t), [e, t]);
549
- G(() => {
550
- mn(w, t, N);
551
- }, [w, t, N]), Ae({ ref: h, isOpen: p, onDismiss: () => {
552
- m(!1);
553
- } });
554
- const C = (v) => {
555
- v.stopPropagation(), x(void 0);
556
- }, S = () => {
557
- o || m((v) => !v);
558
- }, I = (v) => {
559
- const et = v.currentTarget.value;
560
- n(et);
561
- }, x = (v) => {
562
- un({
563
- value: v,
564
- mode: t,
565
- onChange: n,
566
- setMonth: N,
567
- setIsOpen: m
568
- });
569
- }, E = F(() => dn(p), [p]);
570
- return /* @__PURE__ */ i("div", { ref: h, className: l.wrapper, children: [
571
- /* @__PURE__ */ i("div", { className: l.inputContainer, children: [
572
- s && /* @__PURE__ */ a("span", { className: o ? l.disabledLabel : l.label, children: /* @__PURE__ */ a(V, { variant: "text-14", children: s }) }),
573
- /* @__PURE__ */ i("div", { className: l.inputWrapper, children: [
574
- /* @__PURE__ */ a(
575
- "input",
576
- {
577
- type: "text",
578
- className: D(l.trigger, r && l.error),
579
- onClick: S,
580
- value: e,
581
- onChange: I,
582
- placeholder: c,
583
- disabled: o,
584
- "aria-label": s || "Select date",
585
- "aria-expanded": p,
586
- "aria-haspopup": "dialog",
587
- "aria-invalid": r ? "true" : "false",
588
- ...d
589
- }
590
- ),
591
- e && !o && /* @__PURE__ */ a(
592
- "button",
593
- {
594
- type: "button",
595
- className: l.clearButton,
596
- onClick: C,
597
- "aria-label": "Clear date",
598
- children: /* @__PURE__ */ a(J, { className: l.clearIcon })
599
- }
600
- ),
601
- /* @__PURE__ */ a(ct, { className: D(l.icon, !e && l.placeholder) })
602
- ] }),
603
- r && /* @__PURE__ */ a(V, { variant: "small", className: l.error, children: r })
604
- ] }),
605
- t === "single" ? /* @__PURE__ */ a(
606
- H,
607
- {
608
- ...E,
609
- month: y,
610
- onMonthChange: N,
611
- mode: "single",
612
- selected: w instanceof Date ? w : void 0,
613
- onSelect: x
614
- }
615
- ) : /* @__PURE__ */ a(
616
- H,
617
- {
618
- ...E,
619
- month: y,
620
- onMonthChange: N,
621
- mode: "range",
622
- selected: w && typeof w == "object" && "from" in w ? w : void 0,
623
- onSelect: x
624
- }
625
- )
626
- ] });
627
- };
1
+ import { D as r, I as t, S as e, t as o, a as p } from "./DatePicker-SCRr57u0.js";
2
+ import { clsx as x } from "clsx";
3
+ import { default as f } from "simplebar-react";
4
+ import { A as b, B as u, C as S, a as T, L as d, R as i, T as B, b as C, c as h } from "./Radio-Dngy9qay.js";
628
5
  export {
629
- X as Alert,
630
- xn as Button,
631
- In as Card,
632
- Sn as Checkbox,
633
- Bn as DatePicker,
634
- It as Input,
635
- Dn as Label,
636
- $n as Radio,
637
- an as Select,
638
- zn as SimpleBar,
639
- En as Tab,
640
- Pt as Textarea,
641
- V as Typography,
642
- Pn as clsx,
643
- Cn as toastError,
644
- kn as toastSuccess
6
+ b as Alert,
7
+ u as Button,
8
+ S as Card,
9
+ T as Checkbox,
10
+ r as DatePicker,
11
+ t as Input,
12
+ d as Label,
13
+ i as Radio,
14
+ e as Select,
15
+ f as SimpleBar,
16
+ B as Tab,
17
+ C as Textarea,
18
+ h as Typography,
19
+ x as clsx,
20
+ o as toastError,
21
+ p as toastSuccess
645
22
  };
646
23
  //# sourceMappingURL=index.js.map