visits-style 2.2.10 → 2.3.1

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.es.js CHANGED
@@ -1,42 +1,42 @@
1
1
  import e from "clsx";
2
2
  import { twMerge as t } from "tailwind-merge";
3
- import { Children as n, cloneElement as r, createContext as i, createElement as a, forwardRef as o, startTransition as s, useCallback as c, useContext as l, useEffect as u, useImperativeHandle as d, useLayoutEffect as f, useMemo as p, useRef as m, useState as h } from "react";
4
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
5
- import { FloatingOverlay as y, autoUpdate as b, flip as x, offset as S, shift as C, useClick as w, useClientPoint as T, useDismiss as E, useFloating as D, useHover as O, useId as k, useInteractions as A, useTransitionStyles as j } from "@floating-ui/react";
6
- import { createPortal as M } from "react-dom";
3
+ import { createContext as n, createElement as r, forwardRef as i, startTransition as a, useCallback as o, useContext as s, useEffect as c, useImperativeHandle as l, useLayoutEffect as u, useMemo as d, useRef as f, useState as p } from "react";
4
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
5
+ import { FloatingOverlay as _, autoUpdate as v, flip as y, offset as b, shift as x, useClick as S, useClientPoint as C, useDismiss as w, useFloating as T, useHover as E, useId as D, useInteractions as O, useTransitionStyles as k } from "@floating-ui/react";
6
+ import { createPortal as A } from "react-dom";
7
7
  //#region src/utils/merge.ts
8
- var N = e;
9
- function P(e, n) {
8
+ var j = e;
9
+ function M(e, n) {
10
10
  return n ? t(e, n) : e;
11
11
  }
12
12
  //#endregion
13
13
  //#region src/elements/Base.tsx
14
- function F({ as: e, classList: t = [], className: n, override: r, ...i }) {
15
- let o = p(() => r ? n : P(N(t), n), [
14
+ function N({ as: e, classList: t = [], className: n, override: i, ...a }) {
15
+ let o = d(() => i ? n : M(j(t), n), [
16
16
  t,
17
17
  n,
18
- r
18
+ i
19
19
  ]);
20
- return a(e || "div", {
20
+ return r(e || "div", {
21
21
  className: o,
22
- ...i
22
+ ...a
23
23
  });
24
24
  }
25
- function I(e, t, n = {}) {
26
- let r = ({ className: r, ...i }) => {
27
- let o = p(() => P(t, r), [r]);
28
- return a(e, {
25
+ function P(e, t, n = {}) {
26
+ let i = ({ className: i, ...a }) => {
27
+ let o = d(() => M(t, i), [i]);
28
+ return r(e, {
29
29
  className: o,
30
30
  ...n,
31
- ...i
31
+ ...a
32
32
  });
33
33
  };
34
- return r.displayName = `Styled${typeof e == "string" ? e : "Component"}`, r;
34
+ return i.displayName = `Styled${typeof e == "string" ? e : "Component"}`, i;
35
35
  }
36
36
  //#endregion
37
37
  //#region src/forms/Field/FormLabel.tsx
38
- function L(e) {
39
- return /* @__PURE__ */ _(F, {
38
+ function F(e) {
39
+ return /* @__PURE__ */ h(N, {
40
40
  as: "label",
41
41
  classList: ["leading-none peer-disabled:opacity-70"],
42
42
  ...e
@@ -44,47 +44,40 @@ function L(e) {
44
44
  }
45
45
  //#endregion
46
46
  //#region src/forms/Field/FormField.tsx
47
- function R({ label: e, children: t, required: n, htmlFor: r, error: i, help: a, helpBefore: o, innerClass: s, ...c }) {
48
- let l = p(() => N("font-medium", n ? "after:content-[\"*\"] after:text-danger after:text-sm after:pl-0.5" : ""), [n]);
49
- return /* @__PURE__ */ v(F, {
47
+ function I({ label: e, render: t, required: n, htmlFor: r, error: i, help: a, helpBefore: o, innerClass: s, ...c }) {
48
+ let l = d(() => j("font-medium", n ? "after:content-[\"*\"] after:text-danger after:text-sm after:pl-0.5" : ""), [n]);
49
+ return /* @__PURE__ */ g(N, {
50
50
  classList: "flex flex-col space-y-2",
51
51
  ...c,
52
52
  children: [
53
- e ? /* @__PURE__ */ _(L, {
53
+ e ? /* @__PURE__ */ h(F, {
54
54
  className: l,
55
55
  htmlFor: r,
56
56
  children: e
57
57
  }) : null,
58
- a && o ? /* @__PURE__ */ _("p", {
58
+ a && o ? /* @__PURE__ */ h("p", {
59
59
  className: "text-xs text-muted pb-2",
60
60
  children: a
61
61
  }) : null,
62
- /* @__PURE__ */ _("div", {
62
+ /* @__PURE__ */ h("div", {
63
63
  className: s,
64
- children: z(t, !!i)
64
+ children: t(!!i)
65
65
  }),
66
- a && !o && !i ? /* @__PURE__ */ _("p", {
66
+ a && !o && !i ? /* @__PURE__ */ h("p", {
67
67
  className: "text-xs text-muted",
68
68
  children: a
69
69
  }) : null,
70
- i ? /* @__PURE__ */ _("p", {
70
+ i ? /* @__PURE__ */ h("p", {
71
71
  className: "text-xs text-danger",
72
72
  children: i
73
73
  }) : null
74
74
  ]
75
75
  });
76
76
  }
77
- function z(e, t) {
78
- let i = n.count(e);
79
- if (!i) return null;
80
- if (i === 1) return r(e, { error: t });
81
- let a = n.toArray(e);
82
- return a[0] = r(a[0], { error: t }), a;
83
- }
84
77
  //#endregion
85
78
  //#region src/forms/Field/InputField.tsx
86
- function ee({ error: e, ...t }) {
87
- return /* @__PURE__ */ _(F, {
79
+ function L({ error: e, ...t }) {
80
+ return /* @__PURE__ */ h(N, {
88
81
  as: "fieldset",
89
82
  classList: [
90
83
  "flex rounded-md border bg-background px-3 py-2 w-full [&_input]:placeholder:text-muted",
@@ -96,8 +89,8 @@ function ee({ error: e, ...t }) {
96
89
  }
97
90
  //#endregion
98
91
  //#region src/forms/Input/index.tsx
99
- function B({ type: e, error: t, ...n }) {
100
- return /* @__PURE__ */ _(F, {
92
+ function R({ type: e, error: t, ...n }) {
93
+ return /* @__PURE__ */ h(N, {
101
94
  as: "input",
102
95
  type: e,
103
96
  classList: [
@@ -111,8 +104,8 @@ function B({ type: e, error: t, ...n }) {
111
104
  }
112
105
  //#endregion
113
106
  //#region src/forms/Textarea/index.tsx
114
- function V({ error: e, ...t }) {
115
- return /* @__PURE__ */ _(F, {
107
+ function z({ error: e, ...t }) {
108
+ return /* @__PURE__ */ h(N, {
116
109
  as: "textarea",
117
110
  classList: [
118
111
  "flex rounded-md border bg-background px-3 py-2 w-full",
@@ -124,13 +117,13 @@ function V({ error: e, ...t }) {
124
117
  }
125
118
  //#endregion
126
119
  //#region src/forms/Checkbox/index.tsx
127
- function H() {
128
- return /* @__PURE__ */ _("svg", {
120
+ function B() {
121
+ return /* @__PURE__ */ h("svg", {
129
122
  xmlns: "http://www.w3.org/2000/svg",
130
123
  width: "30",
131
124
  height: "30",
132
125
  viewBox: "0 0 30 30",
133
- children: /* @__PURE__ */ _("rect", {
126
+ children: /* @__PURE__ */ h("rect", {
134
127
  width: "20",
135
128
  height: "3",
136
129
  y: "13.5",
@@ -141,11 +134,11 @@ function H() {
141
134
  })
142
135
  });
143
136
  }
144
- function U({ checked: e, indeterminate: t, id: n, name: r, onChange: i, value: a, checkIcon: o, error: s, ...c }) {
137
+ function V({ checked: e, indeterminate: t, id: n, name: r, onChange: i, value: a, checkIcon: o, error: s, ...c }) {
145
138
  let l = () => {
146
139
  c.disabled || i?.(!e);
147
140
  };
148
- return /* @__PURE__ */ v(F, {
141
+ return /* @__PURE__ */ g(N, {
149
142
  as: "button",
150
143
  type: "button",
151
144
  role: "checkbox",
@@ -164,8 +157,8 @@ function U({ checked: e, indeterminate: t, id: n, name: r, onChange: i, value: a
164
157
  ...c,
165
158
  children: [
166
159
  e ? o : null,
167
- t && !e ? /* @__PURE__ */ _(H, {}) : null,
168
- /* @__PURE__ */ _("input", {
160
+ t && !e ? /* @__PURE__ */ h(B, {}) : null,
161
+ /* @__PURE__ */ h("input", {
169
162
  type: "checkbox",
170
163
  "aria-hidden": "true",
171
164
  name: r,
@@ -188,52 +181,52 @@ function U({ checked: e, indeterminate: t, id: n, name: r, onChange: i, value: a
188
181
  }
189
182
  //#endregion
190
183
  //#region src/hooks/useIsomorphicLayoutEffect.ts
191
- var W = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? f : u;
184
+ var H = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? u : c;
192
185
  //#endregion
193
186
  //#region src/components/Portal/index.tsx
194
- function G({ children: e, container: t, disabled: n }) {
195
- let [r, i] = h(null);
196
- return W(() => {
187
+ function U({ children: e, container: t, disabled: n }) {
188
+ let [r, i] = p(null);
189
+ return H(() => {
197
190
  if (!t) {
198
191
  let e = document.getElementById("visits-style-portals");
199
192
  return e || (e = document.createElement("div"), e.id = "visits-style-portals", document.body.appendChild(e)), i(e);
200
193
  }
201
194
  i(t);
202
- }, [t]), n || !r ? null : M(e, r);
195
+ }, [t]), n || !r ? null : A(e, r);
203
196
  }
204
197
  //#endregion
205
198
  //#region src/utils/stopPropagation.ts
206
- function K(e) {
199
+ function W(e) {
207
200
  e && (e.stopPropagation(), e.preventDefault());
208
201
  }
209
202
  //#endregion
210
203
  //#region src/components/Popover/index.tsx
211
- var te = {
204
+ var ee = {
212
205
  open: 150,
213
206
  close: 75
214
207
  };
215
- function q({ ref: e, position: t, label: i, children: a, disabled: o, offset: s = {
208
+ function G({ ref: e, position: t, render: n, children: r, disabled: i, offset: a = {
216
209
  x: 0,
217
210
  y: 6
218
- }, onOpen: l, onClose: f, onManualClose: p, timeout: T = te, override: E, zIndex: O = 9996, role: M, ...N }) {
219
- let [P, F] = h(!1), I = k(), L = m(l), R = m(f), { refs: z, floatingStyles: ee, context: B } = D({
220
- nodeId: I,
211
+ }, onOpen: s, onClose: u, onManualClose: d, timeout: C = ee, override: w, zIndex: E = 9996, role: A, ...j }) {
212
+ let [M, N] = p(!1), P = D(), F = f(s), I = f(u), { refs: L, floatingStyles: R, context: z } = T({
213
+ nodeId: P,
221
214
  placement: t,
222
215
  middleware: [
223
- C(),
224
- x({ fallbackAxisSideDirection: "end" }),
225
- S({
226
- mainAxis: s.y,
227
- crossAxis: s.x
216
+ x(),
217
+ y({ fallbackAxisSideDirection: "end" }),
218
+ b({
219
+ mainAxis: a.y,
220
+ crossAxis: a.x
228
221
  })
229
222
  ],
230
- open: P,
223
+ open: M,
231
224
  onOpenChange: (e) => {
232
- e ? L.current?.(z.reference.current, z.floating.current) : R.current?.(z.reference.current, z.floating.current), F(e);
225
+ e ? F.current?.(L.reference.current, L.floating.current) : I.current?.(L.reference.current, L.floating.current), N(e);
233
226
  },
234
- whileElementsMounted: b
235
- }), { isMounted: V, styles: H } = j(B, {
236
- duration: T,
227
+ whileElementsMounted: v
228
+ }), { isMounted: B, styles: V } = k(z, {
229
+ duration: C,
237
230
  initial({ side: e }) {
238
231
  let t = "";
239
232
  return t = e === "top" ? "translateY(5%) scale(0.95)" : e === "bottom" ? "translateY(-5%) scale(0.95)" : e === "left" ? "translateX(5%) scale(0.95)" : "translateX(-5%) scale(0.95)", {
@@ -241,54 +234,53 @@ function q({ ref: e, position: t, label: i, children: a, disabled: o, offset: s
241
234
  transform: t
242
235
  };
243
236
  }
244
- }), U = c((e) => {
245
- if (K(e), p) return p();
246
- F(!1), R.current?.(z.reference.current, z.floating.current);
247
- }, [p]);
248
- u(() => {
249
- if (o && P) return F(!1);
250
- }, [o, P]), d(e, () => ({
237
+ }), H = o((e) => {
238
+ if (W(e), d) return d();
239
+ N(!1), I.current?.(L.reference.current, L.floating.current);
240
+ }, [d]);
241
+ c(() => {
242
+ if (i && M) return N(!1);
243
+ }, [i, M]), l(e, () => ({
251
244
  open: () => {
252
- F(!0), L.current?.(z.reference.current, z.floating.current);
245
+ N(!0), F.current?.(L.reference.current, L.floating.current);
253
246
  },
254
247
  close: () => {
255
- F(!1), R.current?.(z.reference.current, z.floating.current);
248
+ N(!1), I.current?.(L.reference.current, L.floating.current);
256
249
  }
257
250
  }), []);
258
- let { getFloatingProps: W, getReferenceProps: q } = A([w(B, { enabled: !o })]);
259
- return L.current = l, R.current = f, /* @__PURE__ */ v(g, { children: [r(n.only(i), q({
260
- ref: z.setReference,
251
+ let { getFloatingProps: G, getReferenceProps: K } = O([S(z, { enabled: !i })]);
252
+ return F.current = s, I.current = u, /* @__PURE__ */ g(m, { children: [n(K({
253
+ ref: L.setReference,
261
254
  tabIndex: 0,
262
- role: "button",
263
- "aria-expanded": P,
264
- disabled: o,
265
- onClick: K
266
- })), /* @__PURE__ */ _(G, {
267
- disabled: o || !V,
268
- children: /* @__PURE__ */ _(y, {
255
+ "aria-expanded": M,
256
+ "aria-disabled": i,
257
+ onClick: W
258
+ })), /* @__PURE__ */ h(U, {
259
+ disabled: i || !B,
260
+ children: /* @__PURE__ */ h(_, {
269
261
  "data-testid": "vs-popover-shadow",
270
- onClick: U,
271
- style: { zIndex: O },
262
+ onClick: H,
263
+ style: { zIndex: E },
272
264
  autoFocus: !0,
273
- children: /* @__PURE__ */ _("div", {
274
- role: M || "region",
275
- ref: z.setFloating,
276
- style: ee,
277
- children: /* @__PURE__ */ _(ne, {
278
- override: E,
279
- styles: H,
280
- ...W({
281
- ...N,
282
- onClick: K
265
+ children: /* @__PURE__ */ h("div", {
266
+ role: A || "region",
267
+ ref: L.setFloating,
268
+ style: R,
269
+ children: /* @__PURE__ */ h(te, {
270
+ override: w,
271
+ styles: V,
272
+ ...G({
273
+ ...j,
274
+ onClick: W
283
275
  }),
284
- children: a
276
+ children: r
285
277
  })
286
278
  })
287
279
  })
288
280
  })] });
289
281
  }
290
- function ne({ override: e, styles: t, style: n = {}, ...r }) {
291
- return /* @__PURE__ */ _(F, {
282
+ function te({ override: e, styles: t, style: n = {}, ...r }) {
283
+ return /* @__PURE__ */ h(N, {
292
284
  classList: ["z-20 w-auto h-auto outline-none transition-transform ease-in-out", e ? null : "border border-accent rounded-md shadow-lg p-1 bg-background"],
293
285
  style: {
294
286
  ...t,
@@ -299,77 +291,75 @@ function ne({ override: e, styles: t, style: n = {}, ...r }) {
299
291
  }
300
292
  //#endregion
301
293
  //#region src/forms/Select/index.tsx
302
- function re({ ref: e, className: t, placeholder: n = "", options: r = [], error: i, disabled: a, value: o, maxHeight: s = 408, arrowIcon: l, closeIcon: u, checkIcon: f, onChange: g, onClear: y, renderItem: b, sectionLabelStyle: x, buttonAreaStyle: S, clearLabelText: C, optionStyle: w, popoverStyle: T, popoverPosition: E, labelStyle: D, ...O }) {
303
- let k = m(null), [A, j] = h(0), M = p(() => Array.isArray(o), []), N = c((e, t) => {
304
- g?.(e, t), M || k.current?.close();
305
- }, [g, M]), P = c((e) => Array.isArray(o) ? o.indexOf(e) > -1 : o === e, [o]), I = p(() => {
294
+ function K({ ref: e, className: t, placeholder: n = "", options: r = [], error: i, disabled: a, value: s, maxHeight: c = 408, arrowIcon: u, closeIcon: m, checkIcon: _, onChange: v, onClear: y, renderItem: b, sectionLabelStyle: x, buttonAreaStyle: S, clearLabelText: C, optionStyle: w, popover: T = {}, buttonRef: E, labelStyle: D, ...O }) {
295
+ let k = f(null), [A, P] = p(0), F = d(() => Array.isArray(s), []), I = o((e, t) => {
296
+ v?.(e, t), F || k.current?.close();
297
+ }, [v, F]), L = o((e) => Array.isArray(s) ? s.indexOf(e) > -1 : s === e, [s]), R = d(() => {
306
298
  let e = {}, t = r.filter((e) => typeof e != "string");
307
299
  for (let n = 0, r = t.length; n < r; n += 1) {
308
300
  let r = t[n];
309
301
  e[`${r.value}`] = r.label;
310
302
  }
311
303
  return e;
312
- }, [r]), L = p(() => {
313
- if (!o) return n;
314
- if (Array.isArray(o)) {
315
- if (!o.length) return n;
316
- let e = [...o].sort(), t = [];
317
- for (let n = 0, r = e.length; n < r; n += 1) t[n] = I[`${e[n]}`] || "";
304
+ }, [r]), z = d(() => {
305
+ if (!s) return n;
306
+ if (Array.isArray(s)) {
307
+ if (!s.length) return n;
308
+ let e = [...s].sort(), t = [];
309
+ for (let n = 0, r = e.length; n < r; n += 1) t[n] = R[`${e[n]}`] || "";
318
310
  return t.filter(Boolean).join(",") || n;
319
311
  }
320
- return I[`${o}`] || n;
312
+ return R[`${s}`] || n;
321
313
  }, [
322
314
  n,
323
- o,
324
- I
325
- ]), R = p(() => o == null ? !0 : Array.isArray(o) ? !o.length : !1, [o]), z = c((e, t) => b ? typeof e == "string" ? b(e, {
315
+ s,
316
+ R
317
+ ]), B = d(() => s == null ? !0 : Array.isArray(s) ? !s.length : !1, [s]), V = o((e, t) => b ? typeof e == "string" ? b(e, {
326
318
  index: t,
327
319
  selected: !1,
328
320
  onChange: () => {}
329
321
  }) : b(e, {
330
322
  index: t,
331
- selected: P(e.value),
332
- onChange: () => N(e.value, e)
333
- }) : typeof e == "string" ? /* @__PURE__ */ _(F, {
323
+ selected: L(e.value),
324
+ onChange: () => I(e.value, e)
325
+ }) : typeof e == "string" ? /* @__PURE__ */ h(N, {
334
326
  as: "h5",
335
327
  classList: ["font-normal py-1 px-2 text-muted"],
336
328
  className: x,
337
329
  children: e
338
- }, `optionheader-${t}`) : /* @__PURE__ */ _(ie, {
339
- selected: P(e.value),
340
- onChange: N,
341
- checkIcon: f,
330
+ }, `optionheader-${t}`) : /* @__PURE__ */ h(ne, {
331
+ selected: L(e.value),
332
+ onChange: I,
333
+ checkIcon: _,
342
334
  className: w,
343
335
  data: e
344
336
  }, e.label), [
345
337
  b,
346
- N,
347
- P,
338
+ I,
339
+ L,
348
340
  x,
349
341
  w,
350
- f
342
+ _
351
343
  ]);
352
- return d(e, () => k.current, []), /* @__PURE__ */ _(q, {
353
- label: /* @__PURE__ */ v(F, {
354
- as: "button",
344
+ return l(e, () => k.current, []), /* @__PURE__ */ h(G, {
345
+ render: (e) => /* @__PURE__ */ g("button", {
355
346
  type: "button",
356
- classList: [
357
- "flex items-center justify-between rounded-md border bg-background px-3 py-2 w-full overflow-hidden cursor-pointer",
358
- "disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",
359
- i ? "border-danger hover:border-danger-fore" : "border-input not-disabled:hover:border-input-fore"
360
- ],
361
- className: t,
347
+ className: M(j("flex items-center justify-between rounded-md border bg-background px-3 py-2 w-full overflow-hidden cursor-pointer", "disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring", i ? "border-danger hover:border-danger-fore" : "border-input not-disabled:hover:border-input-fore"), t),
362
348
  disabled: a,
349
+ ...e,
350
+ ref: (t) => {
351
+ e.ref?.(t), typeof E == "function" && E?.(t);
352
+ },
363
353
  ...O,
364
- children: [/* @__PURE__ */ _(F, {
354
+ children: [/* @__PURE__ */ h(N, {
365
355
  as: "span",
366
- classList: ["overflow-hidden text-ellipsis whitespace-nowrap", R ? "text-muted" : "text-text"],
356
+ classList: ["overflow-hidden text-ellipsis whitespace-nowrap", B ? "text-muted" : "text-text"],
367
357
  className: D,
368
- children: L
369
- }), /* @__PURE__ */ v(F, {
358
+ children: z
359
+ }), /* @__PURE__ */ g(N, {
370
360
  classList: "relative flex items-center space-x-2",
371
361
  className: S,
372
- children: [y && !R ? /* @__PURE__ */ _("div", {
362
+ children: [y && !B ? /* @__PURE__ */ h("div", {
373
363
  tabIndex: -1,
374
364
  role: "button",
375
365
  className: "size-6 p-1.5 rounded hover:bg-accent cursor-pointer",
@@ -380,29 +370,28 @@ function re({ ref: e, className: t, placeholder: n = "", options: r = [], error:
380
370
  onClick: (e) => {
381
371
  e.stopPropagation(), y();
382
372
  },
383
- children: u
384
- }) : null, l]
373
+ children: m
374
+ }) : null, u]
385
375
  })]
386
376
  }),
387
377
  ref: k,
388
- onOpen: (e) => j(e?.getBoundingClientRect().width || 0),
389
- className: T,
390
- position: E,
378
+ onOpen: (e) => P(e?.getBoundingClientRect().width || 0),
391
379
  disabled: a,
392
- children: /* @__PURE__ */ _("div", {
380
+ ...T,
381
+ children: /* @__PURE__ */ h("div", {
393
382
  className: "overflow-y-auto flex flex-col",
394
383
  role: "listbox",
395
384
  style: {
396
385
  minWidth: A,
397
386
  maxWidth: "calc(100vw - 3rem)",
398
- maxHeight: s
387
+ maxHeight: c
399
388
  },
400
- children: r.map(z)
389
+ children: r.map(V)
401
390
  })
402
391
  });
403
392
  }
404
- function ie({ className: e, data: t, selected: n, checkIcon: r, onChange: i }) {
405
- return /* @__PURE__ */ v(F, {
393
+ function ne({ className: e, data: t, selected: n, checkIcon: r, onChange: i }) {
394
+ return /* @__PURE__ */ g(N, {
406
395
  as: "button",
407
396
  type: "button",
408
397
  role: "option",
@@ -410,16 +399,16 @@ function ie({ className: e, data: t, selected: n, checkIcon: r, onChange: i }) {
410
399
  className: e,
411
400
  "aria-selected": n,
412
401
  onClick: () => i?.(t.value, t),
413
- children: [r === null || n && r ? r : /* @__PURE__ */ _("div", { className: "w-5 h-1 mr-1" }), t.label]
402
+ children: [r === null || n && r ? r : /* @__PURE__ */ h("div", { className: "w-5 h-1 mr-1" }), t.label]
414
403
  });
415
404
  }
416
405
  //#endregion
417
406
  //#region src/forms/Radio/index.tsx
418
- function ae({ checked: e, className: t, id: n, name: r, onChange: i, value: a, error: o, ...s }) {
407
+ function re({ checked: e, className: t, id: n, name: r, onChange: i, value: a, error: o, ...s }) {
419
408
  let c = () => {
420
409
  s.disabled || i?.(!e);
421
410
  };
422
- return /* @__PURE__ */ v(F, {
411
+ return /* @__PURE__ */ g(N, {
423
412
  as: "button",
424
413
  type: "button",
425
414
  role: "radio",
@@ -434,13 +423,13 @@ function ae({ checked: e, className: t, id: n, name: r, onChange: i, value: a, e
434
423
  onClick: c,
435
424
  "aria-checked": e,
436
425
  ...s,
437
- children: [/* @__PURE__ */ _("i", {
426
+ children: [/* @__PURE__ */ h("i", {
438
427
  className: "block w-2.5 h-2.5 rounded-full transition-transform",
439
428
  style: {
440
429
  transform: e ? "" : "scale(0.8)",
441
430
  opacity: +!!e
442
431
  }
443
- }), /* @__PURE__ */ _("input", {
432
+ }), /* @__PURE__ */ h("input", {
444
433
  type: "radio",
445
434
  "aria-hidden": "true",
446
435
  name: r,
@@ -462,11 +451,11 @@ function ae({ checked: e, className: t, id: n, name: r, onChange: i, value: a, e
462
451
  }
463
452
  //#endregion
464
453
  //#region src/forms/Switch/index.tsx
465
- function oe({ checked: e, onChange: t, value: n, id: r, name: i, error: a, ref: o, ...s }) {
454
+ function ie({ checked: e, onChange: t, value: n, id: r, name: i, error: a, ref: o, ...s }) {
466
455
  let c = () => {
467
456
  s.disabled || t?.(!e);
468
457
  };
469
- return /* @__PURE__ */ v(F, {
458
+ return /* @__PURE__ */ g(N, {
470
459
  as: "button",
471
460
  type: "button",
472
461
  role: "switch",
@@ -481,10 +470,10 @@ function oe({ checked: e, onChange: t, value: n, id: r, name: i, error: a, ref:
481
470
  "aria-checked": e,
482
471
  "aria-invalid": a,
483
472
  ...s,
484
- children: [/* @__PURE__ */ _("span", {
473
+ children: [/* @__PURE__ */ h("span", {
485
474
  className: "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",
486
475
  style: { transform: e ? "translateX(100%)" : "" }
487
- }), /* @__PURE__ */ _("input", {
476
+ }), /* @__PURE__ */ h("input", {
488
477
  ref: o,
489
478
  type: "checkbox",
490
479
  "aria-hidden": "true",
@@ -507,14 +496,14 @@ function oe({ checked: e, onChange: t, value: n, id: r, name: i, error: a, ref:
507
496
  }
508
497
  //#endregion
509
498
  //#region src/components/Accordion/index.tsx
510
- function se({ header: e, show: t, children: n, timeout: r = 300, ...i }) {
511
- let a = m(null), o = m(0), s = m(0), c = m(!0);
512
- return u(() => {
499
+ function ae({ header: e, show: t, children: n, timeout: r = 300, ...i }) {
500
+ let a = f(null), o = f(0), s = f(0), l = f(!0);
501
+ return c(() => {
513
502
  s.current = r;
514
- }, [r]), W(() => {
503
+ }, [r]), H(() => {
515
504
  if (!a.current) return;
516
- if (a.current.style.overflow = "hidden", a.current.style.opacity = "1", c.current) {
517
- c.current = !1, a.current.style.height = t ? "auto" : "0px", t ? window.requestAnimationFrame(() => {
505
+ if (a.current.style.overflow = "hidden", a.current.style.opacity = "1", l.current) {
506
+ l.current = !1, a.current.style.height = t ? "auto" : "0px", t ? window.requestAnimationFrame(() => {
518
507
  a.current && (o.current = a.current.offsetHeight);
519
508
  }) : (window.requestAnimationFrame(() => {
520
509
  a.current && (a.current.style.height = "auto", o.current = a.current.offsetHeight, a.current.style.height = "0px");
@@ -536,9 +525,9 @@ function se({ header: e, show: t, children: n, timeout: r = 300, ...i }) {
536
525
  return s.current === 0 ? r() : n = window.setTimeout(r, s.current), () => {
537
526
  e.forEach(window.cancelAnimationFrame), n && window.clearTimeout(n);
538
527
  };
539
- }, [t]), /* @__PURE__ */ v("div", {
528
+ }, [t]), /* @__PURE__ */ g("div", {
540
529
  ...i,
541
- children: [e, /* @__PURE__ */ _("div", {
530
+ children: [e, /* @__PURE__ */ h("div", {
542
531
  className: "transition-all ease-in-out overflow-hidden",
543
532
  role: "region",
544
533
  "aria-hidden": !t,
@@ -550,72 +539,70 @@ function se({ header: e, show: t, children: n, timeout: r = 300, ...i }) {
550
539
  }
551
540
  //#endregion
552
541
  //#region src/components/Tooltip/index.tsx
553
- var J = o(({ children: e, position: t = "bottom", label: i, className: a, timeout: o = 150, offset: s = {
542
+ var q = i(({ render: e, position: t = "bottom", label: n, className: r, timeout: i = 150, offset: a = {
554
543
  x: 0,
555
544
  y: 6
556
- }, clientPoint: c = !1, disabled: l }, f) => {
557
- let [p, m] = h(!1), y = k(), { refs: w, floatingStyles: E, context: M } = D({
558
- nodeId: y,
559
- open: p,
545
+ }, clientPoint: o = !1, disabled: s }, u) => {
546
+ let [d, f] = p(!1), _ = D(), { refs: S, floatingStyles: w, context: A } = T({
547
+ nodeId: _,
548
+ open: d,
560
549
  placement: t,
561
550
  middleware: [
562
- C(),
563
551
  x(),
564
- S({
565
- mainAxis: s.y,
566
- crossAxis: s.x
552
+ y(),
553
+ b({
554
+ mainAxis: a.y,
555
+ crossAxis: a.x
567
556
  })
568
557
  ],
569
- whileElementsMounted: l ? void 0 : b,
570
- onOpenChange: m
571
- }), { getReferenceProps: N, getFloatingProps: P } = A([O(M, { enabled: !l }), T(M, { enabled: c })]), { isMounted: F, styles: I } = j(M, {
572
- duration: o,
558
+ whileElementsMounted: s ? void 0 : v,
559
+ onOpenChange: f
560
+ }), { getReferenceProps: j, getFloatingProps: M } = O([E(A, { enabled: !s }), C(A, { enabled: o })]), { isMounted: N, styles: P } = k(A, {
561
+ duration: i,
573
562
  initial: {
574
563
  opacity: 0,
575
564
  transform: "scale(0.8)"
576
565
  }
577
566
  });
578
- d(f, () => ({
579
- floating: w.floating,
580
- reference: w.reference,
581
- open: () => m(!0),
582
- close: () => m(!1)
583
- })), u(() => {
584
- l && m(!1);
585
- }, [l]);
586
- let L = typeof e == "string" ? /* @__PURE__ */ _("span", { children: e }) : e;
587
- return /* @__PURE__ */ v(g, { children: [r(n.only(L), {
588
- ref: w.setReference,
589
- ...N()
590
- }), /* @__PURE__ */ _(G, {
591
- disabled: l || !F,
592
- children: /* @__PURE__ */ _("div", {
567
+ return l(u, () => ({
568
+ floating: S.floating,
569
+ reference: S.reference,
570
+ open: () => f(!0),
571
+ close: () => f(!1)
572
+ })), c(() => {
573
+ s && f(!1);
574
+ }, [s]), /* @__PURE__ */ g(m, { children: [e({
575
+ ref: S.setReference,
576
+ ...j()
577
+ }), /* @__PURE__ */ h(U, {
578
+ disabled: s || !N,
579
+ children: /* @__PURE__ */ h("div", {
593
580
  role: "tooltip",
594
581
  className: "z-9999",
595
- ref: w.setFloating,
596
- ...P({ style: E }),
597
- children: /* @__PURE__ */ _(Y, {
598
- className: a,
599
- style: I,
600
- children: i
582
+ ref: S.setFloating,
583
+ ...M({ style: w }),
584
+ children: /* @__PURE__ */ h(J, {
585
+ className: r,
586
+ style: P,
587
+ children: n
601
588
  })
602
589
  })
603
590
  })] });
604
591
  });
605
- J.displayName = "Tooltip";
606
- var Y = o(({ className: e, custom: t, ...n }, r) => {
607
- let i = p(() => P(N("relative w-auto h-auto outline-none transition-transform ease-in-out whitespace-pre", t ? null : "border border-accent rounded shadow-md px-3 py-1 bg-background"), e), [e, t]);
608
- return /* @__PURE__ */ _("div", {
592
+ q.displayName = "Tooltip";
593
+ var J = i(({ className: e, custom: t, ...n }, r) => {
594
+ let i = d(() => M(j("relative w-auto h-auto outline-none transition-transform ease-in-out whitespace-pre", t ? null : "border border-accent rounded shadow-md px-3 py-1 bg-background"), e), [e, t]);
595
+ return /* @__PURE__ */ h("div", {
609
596
  ref: r,
610
597
  className: i,
611
598
  ...n
612
599
  });
613
600
  });
614
- Y.displayName = "TooltipContent";
601
+ J.displayName = "TooltipContent";
615
602
  //#endregion
616
603
  //#region src/elements/Button/index.tsx
617
- function X({ variant: e, size: t }) {
618
- return N("inline-flex items-center justify-center whitespace-nowrap transition-colors rounded-md cursor-pointer", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-auto", {
604
+ function Y({ variant: e, size: t }) {
605
+ return j("inline-flex items-center justify-center whitespace-nowrap transition-colors rounded-md cursor-pointer", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-auto", {
619
606
  "bg-primary text-inverted hover:bg-primary-fore": !e || e === "primary",
620
607
  "bg-info text-inverted hover:bg-info-fore": e === "info",
621
608
  "bg-warn text-inverted hover:bg-warn-fore": e === "warn",
@@ -628,8 +615,8 @@ function X({ variant: e, size: t }) {
628
615
  "p-1.5": t === "icon"
629
616
  });
630
617
  }
631
- function ce({ size: e, variant: t, className: n, ...r }) {
632
- let i = p(() => P(X({
618
+ function oe({ size: e, variant: t, className: n, ...r }) {
619
+ let i = d(() => M(Y({
633
620
  size: e,
634
621
  variant: t
635
622
  }), n), [
@@ -637,7 +624,7 @@ function ce({ size: e, variant: t, className: n, ...r }) {
637
624
  t,
638
625
  n
639
626
  ]);
640
- return /* @__PURE__ */ _("button", {
627
+ return /* @__PURE__ */ h("button", {
641
628
  className: i,
642
629
  type: "button",
643
630
  ...r
@@ -645,57 +632,57 @@ function ce({ size: e, variant: t, className: n, ...r }) {
645
632
  }
646
633
  //#endregion
647
634
  //#region src/components/Dialog/index.tsx
648
- var le = {
635
+ var se = {
649
636
  open: 150,
650
637
  close: 75
651
638
  };
652
- function ue({ open: e, children: t, timeout: n = le, padding: r = "0.85rem", verticalAlign: i = "center", closeOnOverlay: a, closeOnEsc: o, onExited: s, className: l, onOpenChange: d, size: f, ...h }) {
653
- let g = m(s), v = m(!1), b = k(), { refs: x, context: S } = D({
639
+ function ce({ open: e, children: t, timeout: n = se, padding: r = "0.85rem", verticalAlign: i = "center", closeOnOverlay: a, closeOnEsc: s, onExited: l, className: u, onOpenChange: p, size: m, ...g }) {
640
+ let v = f(l), y = f(!1), b = D(), { refs: x, context: S } = T({
654
641
  open: e,
655
- onOpenChange: d,
642
+ onOpenChange: p,
656
643
  nodeId: b
657
- }), { getFloatingProps: C } = A([E(S, {
658
- enabled: o,
659
- escapeKey: o,
644
+ }), { getFloatingProps: C } = O([w(S, {
645
+ enabled: s,
646
+ escapeKey: s,
660
647
  outsidePress: !1
661
- })]), { isMounted: w, styles: T } = j(S, {
648
+ })]), { isMounted: E, styles: A } = k(S, {
662
649
  duration: n,
663
650
  initial: {
664
651
  opacity: 0,
665
652
  transform: "scale(0.8)"
666
653
  }
667
654
  });
668
- u(() => {
669
- v.current !== w && (v.current = w, !w && g.current?.());
670
- }, [w]);
671
- let O = c(() => {
672
- a && d?.(!1);
673
- }, [d, a]);
674
- g.current = s;
675
- let M = p(() => N("grid bg-backdrop z-40 justify-items-center transition ease-in-out", {
655
+ c(() => {
656
+ y.current !== E && (y.current = E, !E && v.current?.());
657
+ }, [E]);
658
+ let M = o(() => {
659
+ a && p?.(!1);
660
+ }, [p, a]);
661
+ v.current = l;
662
+ let N = d(() => j("grid bg-backdrop z-40 justify-items-center transition ease-in-out", {
676
663
  "place-items-start items-start": i === "start",
677
664
  "place-items-end": i === "end",
678
665
  "place-items-center": i === "center" || !i
679
666
  }), [i]);
680
- return /* @__PURE__ */ _(G, {
681
- disabled: !w,
682
- children: /* @__PURE__ */ _(y, {
683
- className: M,
667
+ return /* @__PURE__ */ h(U, {
668
+ disabled: !E,
669
+ children: /* @__PURE__ */ h(_, {
670
+ className: N,
684
671
  "data-testid": "vs-dialog-overlay",
685
- onClick: O,
672
+ onClick: M,
686
673
  style: {
687
674
  padding: r,
688
- opacity: T.opacity
675
+ opacity: A.opacity
689
676
  },
690
677
  lockScroll: !0,
691
- children: /* @__PURE__ */ _(de, {
678
+ children: /* @__PURE__ */ h(le, {
692
679
  ref: x.setFloating,
693
- className: l,
680
+ className: u,
694
681
  role: "dialog",
695
- size: f,
682
+ size: m,
696
683
  ...C({
697
- ...h,
698
- style: T,
684
+ ...g,
685
+ style: A,
699
686
  onClick: (e) => e?.stopPropagation()
700
687
  }),
701
688
  children: t
@@ -703,8 +690,8 @@ function ue({ open: e, children: t, timeout: n = le, padding: r = "0.85rem", ver
703
690
  })
704
691
  });
705
692
  }
706
- function de({ size: e, ...t }) {
707
- return /* @__PURE__ */ _(F, {
693
+ function le({ size: e, ...t }) {
694
+ return /* @__PURE__ */ h(N, {
708
695
  classList: [e ? "flex flex-col bg-background shadow-lg p-5 rounded" : null, {
709
696
  "w-full max-w-dialog-sm": e === "small",
710
697
  "w-full max-w-dialog-md": e === "medium",
@@ -715,16 +702,16 @@ function de({ size: e, ...t }) {
715
702
  }
716
703
  //#endregion
717
704
  //#region src/elements/Skeleton/index.tsx
718
- function fe(e) {
719
- return /* @__PURE__ */ _(F, {
705
+ function ue(e) {
706
+ return /* @__PURE__ */ h(N, {
720
707
  classList: "inline-block animate-pulse rounded-md bg-accent",
721
708
  ...e
722
709
  });
723
710
  }
724
711
  //#endregion
725
712
  //#region src/elements/Button/ButtonGroup.tsx
726
- function pe(e) {
727
- return /* @__PURE__ */ _(F, {
713
+ function de(e) {
714
+ return /* @__PURE__ */ h(N, {
728
715
  role: "group",
729
716
  classList: [
730
717
  "flex items-center justify-center",
@@ -736,8 +723,8 @@ function pe(e) {
736
723
  }
737
724
  //#endregion
738
725
  //#region src/elements/Spinner/index.tsx
739
- function me({ label: e = "Loading...", ...t }) {
740
- return /* @__PURE__ */ v(F, {
726
+ function fe({ label: e = "Loading...", ...t }) {
727
+ return /* @__PURE__ */ g(N, {
741
728
  as: "svg",
742
729
  classList: "fill-accent animate-spin text-primary",
743
730
  "aria-label": e,
@@ -748,10 +735,10 @@ function me({ label: e = "Loading...", ...t }) {
748
735
  fill: "none",
749
736
  xmlns: "http://www.w3.org/2000/svg",
750
737
  ...t,
751
- children: [/* @__PURE__ */ _("path", {
738
+ children: [/* @__PURE__ */ h("path", {
752
739
  d: "M100 50.6a50 50 0 1 1-100 0 50 50 0 0 1 100 0Zm-91 0a41 41 0 1 0 82 0 41 41 0 0 0-82 0Z",
753
740
  fill: "currentFill"
754
- }), /* @__PURE__ */ _("path", {
741
+ }), /* @__PURE__ */ h("path", {
755
742
  d: "M94 39a4.2 4.2 0 0 0 3-5.4A50 50 0 0 0 41.7 1.3c-2.4.4-3.9 2.9-3.2 5.3a5 5 0 0 0 5.6 3.5A41 41 0 0 1 88 36 5 5 0 0 0 94 39Z",
756
743
  fill: "currentColor"
757
744
  })]
@@ -759,15 +746,15 @@ function me({ label: e = "Loading...", ...t }) {
759
746
  }
760
747
  //#endregion
761
748
  //#region src/elements/Progress/index.tsx
762
- function he({ value: e, max: t, ...n }) {
763
- let r = p(() => e ? Math.min(100, Math.round(e / t * 100)) : 0, [e, t]);
764
- return /* @__PURE__ */ _(F, {
749
+ function pe({ value: e, max: t, ...n }) {
750
+ let r = d(() => e ? Math.min(100, Math.round(e / t * 100)) : 0, [e, t]);
751
+ return /* @__PURE__ */ h(N, {
765
752
  role: "progressbar",
766
753
  classList: "relative overflow-hidden rounded-full bg-primary",
767
754
  "aria-valuemax": t,
768
755
  "aria-valuemin": 0,
769
756
  ...n,
770
- children: /* @__PURE__ */ _(F, {
757
+ children: /* @__PURE__ */ h(N, {
771
758
  className: "h-full w-full flex-1 bg-input transition-all origin-right",
772
759
  style: { transform: `translateX(${r}%)` }
773
760
  })
@@ -775,8 +762,8 @@ function he({ value: e, max: t, ...n }) {
775
762
  }
776
763
  //#endregion
777
764
  //#region src/elements/Divider/index.tsx
778
- function ge({ orientation: e = "horizontal", ...t }) {
779
- return /* @__PURE__ */ _(F, {
765
+ function me({ orientation: e = "horizontal", ...t }) {
766
+ return /* @__PURE__ */ h(N, {
780
767
  as: "hr",
781
768
  role: "none",
782
769
  classList: ["border-0 p-0 shrink-0 bg-input", e === "horizontal" ? "h-px w-full" : "w-px h-full"],
@@ -785,16 +772,16 @@ function ge({ orientation: e = "horizontal", ...t }) {
785
772
  }
786
773
  //#endregion
787
774
  //#region src/components/Sheet/index.tsx
788
- var _e = {
775
+ var he = {
789
776
  open: 250,
790
777
  close: 150
791
778
  };
792
- function ve({ open: e, timeout: t = _e, onOpenChange: n, position: r = "right", overlay: i, onExited: a, onOpen: o, ...s }) {
793
- let c = k(), l = m(!1), d = m(o), f = m(a), { refs: p, context: h } = D({
779
+ function ge({ open: e, timeout: t = he, onOpenChange: n, position: r = "right", overlay: i, onExited: a, onOpen: o, ...s }) {
780
+ let l = D(), u = f(!1), d = f(o), p = f(a), { refs: m, context: v } = T({
794
781
  open: e,
795
782
  onOpenChange: n,
796
- nodeId: c
797
- }), { isMounted: g, styles: b } = j(h, {
783
+ nodeId: l
784
+ }), { isMounted: y, styles: b } = k(v, {
798
785
  duration: t,
799
786
  initial() {
800
787
  let e = "translateX(75%)";
@@ -804,22 +791,22 @@ function ve({ open: e, timeout: t = _e, onOpenChange: n, position: r = "right",
804
791
  };
805
792
  }
806
793
  });
807
- return u(() => {
808
- if (l.current !== g) {
809
- if (l.current = g, g) {
794
+ return c(() => {
795
+ if (u.current !== y) {
796
+ if (u.current = y, y) {
810
797
  d.current?.();
811
798
  return;
812
799
  }
813
- f.current?.();
800
+ p.current?.();
814
801
  }
815
- }, [g]), f.current = a, d.current = o, /* @__PURE__ */ v(G, {
816
- disabled: !g,
817
- children: [i ? /* @__PURE__ */ _(y, {
802
+ }, [y]), p.current = a, d.current = o, /* @__PURE__ */ g(U, {
803
+ disabled: !y,
804
+ children: [i ? /* @__PURE__ */ h(_, {
818
805
  className: i === "transparent" ? "" : "bg-backdrop",
819
806
  style: { opacity: b.opacity },
820
807
  onClick: () => n?.(!1)
821
- }) : null, /* @__PURE__ */ _(F, {
822
- ref: p.setFloating,
808
+ }) : null, /* @__PURE__ */ h(N, {
809
+ ref: m.setFloating,
823
810
  role: "complementary",
824
811
  classList: ["fixed transition-transform z-1", {
825
812
  "top-0 right-0 h-full max-h-screen": r === "right",
@@ -828,23 +815,23 @@ function ve({ open: e, timeout: t = _e, onOpenChange: n, position: r = "right",
828
815
  "bottom-0 left-0 right-0 w-full max-w-screen": r === "bottom"
829
816
  }],
830
817
  style: b,
831
- children: /* @__PURE__ */ _(ye, { ...s })
818
+ children: /* @__PURE__ */ h(_e, { ...s })
832
819
  })]
833
820
  });
834
821
  }
835
- function ye(e) {
836
- return /* @__PURE__ */ _(F, {
822
+ function _e(e) {
823
+ return /* @__PURE__ */ h(N, {
837
824
  classList: "relative bg-background min-w-full min-h-full border border-input shadow-lg",
838
825
  ...e
839
826
  });
840
827
  }
841
828
  //#endregion
842
829
  //#region src/components/Toast/ToastItem.tsx
843
- function Z({ type: e, label: t, message: n }) {
844
- let { icons: r } = Se();
845
- return /* @__PURE__ */ v("div", {
830
+ function X({ type: e, label: t, message: n }) {
831
+ let { icons: r } = ye();
832
+ return /* @__PURE__ */ g("div", {
846
833
  className: "flex items-center px-4 py-3 w-80 text-sm bg-background border border-input rounded-lg shadow-md m-2",
847
- children: [e ? /* @__PURE__ */ v("figure", {
834
+ children: [e ? /* @__PURE__ */ g("figure", {
848
835
  className: "mr-2",
849
836
  children: [
850
837
  e === "success" && r?.success ? r.success : null,
@@ -853,23 +840,23 @@ function Z({ type: e, label: t, message: n }) {
853
840
  e === "warn" && r?.warn ? r.warn : null,
854
841
  e === "loading" ? r?.loading : null
855
842
  ]
856
- }) : null, /* @__PURE__ */ v("div", {
843
+ }) : null, /* @__PURE__ */ g("div", {
857
844
  className: "space-y-2",
858
- children: [/* @__PURE__ */ _("p", {
845
+ children: [/* @__PURE__ */ h("p", {
859
846
  className: "font-medium leading-none",
860
847
  children: t
861
- }), n ? /* @__PURE__ */ _("p", { children: n }) : null]
848
+ }), n ? /* @__PURE__ */ h("p", { children: n }) : null]
862
849
  })]
863
850
  });
864
851
  }
865
852
  //#endregion
866
853
  //#region src/components/Toast/observer.ts
867
- function Q() {}
868
- var $ = new class {
869
- notify = Q;
854
+ function Z() {}
855
+ var Q = new class {
856
+ notify = Z;
870
857
  lastId = 0;
871
858
  subscribe = (e) => (this.notify = e, () => {
872
- this.notify = Q;
859
+ this.notify = Z;
873
860
  });
874
861
  add = (e, t = {}) => {
875
862
  this.lastId += 1;
@@ -903,96 +890,96 @@ var $ = new class {
903
890
  }();
904
891
  //#endregion
905
892
  //#region src/components/Toast/ToastFloat.tsx
906
- function be({ id: t, type: n, index: r, duration: i = 5e3, className: a, children: o, inverted: s, timeout: l = 250, max: d = 3 }) {
907
- let g = m(!1), [v, y] = h(!1), { context: b, refs: x } = D({
893
+ function ve({ id: t, type: n, index: r, duration: i = 5e3, className: a, children: s, inverted: l, timeout: m = 250, max: g = 3 }) {
894
+ let _ = f(!1), [v, y] = p(!1), { context: b, refs: x } = T({
908
895
  open: v,
909
896
  onOpenChange: y,
910
897
  nodeId: t
911
- }), { isMounted: S, styles: C } = j(b, {
912
- duration: l,
898
+ }), { isMounted: S, styles: C } = k(b, {
899
+ duration: m,
913
900
  initial: {
914
901
  opacity: 0,
915
- transform: `translateY(${s ? "" : "-"}50%)`
902
+ transform: `translateY(${l ? "" : "-"}50%)`
916
903
  }
917
904
  });
918
- f(() => {
919
- y(r <= d);
920
- }, [r, d]), u(() => {
921
- g.current !== S && (S || $.remove(t), g.current = S);
922
- }, [S, t]), u(() => {
905
+ u(() => {
906
+ y(r <= g);
907
+ }, [r, g]), c(() => {
908
+ _.current !== S && (S || Q.remove(t), _.current = S);
909
+ }, [S, t]), c(() => {
923
910
  if (!i) return;
924
911
  let e = window.setTimeout(() => y(!1), i);
925
912
  return () => window.clearTimeout(e);
926
913
  }, [i, t]);
927
- let w = c(() => {
914
+ let w = o(() => {
928
915
  n !== "loading" && y(!1);
929
- }, [n]), T = p(() => e("relative flex w-fit transition-transform ease-in-out cursor-pointer", a), [a]);
930
- return S ? /* @__PURE__ */ _("li", {
916
+ }, [n]), E = d(() => e("relative flex w-fit transition-transform ease-in-out cursor-pointer", a), [a]);
917
+ return S ? /* @__PURE__ */ h("li", {
931
918
  role: "log",
932
919
  tabIndex: -1,
933
920
  ref: x.setFloating,
934
- className: T,
921
+ className: E,
935
922
  style: C,
936
923
  onClick: w,
937
- children: o
924
+ children: s
938
925
  }) : null;
939
926
  }
940
927
  //#endregion
941
928
  //#region src/components/Toast/index.tsx
942
- var xe = i({});
943
- function Se() {
944
- return l(xe);
929
+ var $ = n({});
930
+ function ye() {
931
+ return s($);
945
932
  }
946
- function Ce({ className: t, offset: n = {}, position: r = "top-left", max: i, ListItem: o = Z, icons: c }) {
947
- let l = p(() => {
933
+ function be({ className: t, offset: n = {}, position: i = "top-left", max: o, ListItem: s = X, icons: c }) {
934
+ let l = d(() => {
948
935
  let e = {
949
936
  position: "fixed",
950
937
  ...n
951
938
  };
952
- return Object.keys(n).length || (r.indexOf("top") > -1 ? e.top = "16px" : r.indexOf("bottom") > -1 && (e.bottom = "16px"), r.indexOf("left") > -1 ? e.left = "16px" : r.indexOf("right") > -1 && (e.right = "16px")), r.indexOf("left") > -1 ? e.alignItems = "flex-start" : r.indexOf("right") > -1 ? e.alignItems = "flex-end" : (e.left = "50%", e.alignItems = "center", e.transform = "translateX(-50%)"), e;
953
- }, [n, r]), u = p(() => e("flex flex-col z-40 overflow-hidden", t), [t]), d = p(() => r?.startsWith("bottom") || !1, [r]), f = m(/* @__PURE__ */ new Map()), [g, v] = h([]), y = h(0)[1];
954
- W(() => $.subscribe((e) => {
955
- s(() => {
956
- if (e.type === "add") f.current.set(e.id, e.config), v((t) => [...t, e.id]);
939
+ return Object.keys(n).length || (i.indexOf("top") > -1 ? e.top = "16px" : i.indexOf("bottom") > -1 && (e.bottom = "16px"), i.indexOf("left") > -1 ? e.left = "16px" : i.indexOf("right") > -1 && (e.right = "16px")), i.indexOf("left") > -1 ? e.alignItems = "flex-start" : i.indexOf("right") > -1 ? e.alignItems = "flex-end" : (e.left = "50%", e.alignItems = "center", e.transform = "translateX(-50%)"), e;
940
+ }, [n, i]), u = d(() => e("flex flex-col z-40 overflow-hidden", t), [t]), m = d(() => i?.startsWith("bottom") || !1, [i]), g = f(/* @__PURE__ */ new Map()), [_, v] = p([]), y = p(0)[1];
941
+ H(() => Q.subscribe((e) => {
942
+ a(() => {
943
+ if (e.type === "add") g.current.set(e.id, e.config), v((t) => [...t, e.id]);
957
944
  else if (e.type === "remove") {
958
- if (!f.current.delete(e.id)) return;
945
+ if (!g.current.delete(e.id)) return;
959
946
  v((t) => {
960
947
  let n = new Set(t);
961
948
  return n.has(e.id) ? (n.delete(e.id), Array.from(n)) : t;
962
949
  });
963
950
  } else if (e.type === "update") {
964
- let t = f.current.get(e.id);
951
+ let t = g.current.get(e.id);
965
952
  if (!t) return;
966
- f.current.set(e.id, {
953
+ g.current.set(e.id, {
967
954
  ...t,
968
955
  ...e.config
969
956
  }), y((e) => e + 1);
970
957
  }
971
958
  });
972
959
  }), []);
973
- let b = p(() => ({ icons: c }), [c]), x = g.length;
974
- return /* @__PURE__ */ _(G, { children: /* @__PURE__ */ _("ol", {
960
+ let b = d(() => ({ icons: c }), [c]), x = _.length;
961
+ return /* @__PURE__ */ h(U, { children: /* @__PURE__ */ h("ol", {
975
962
  className: u,
976
963
  style: l,
977
964
  "aria-live": "polite",
978
- children: /* @__PURE__ */ _(xe.Provider, {
965
+ children: /* @__PURE__ */ h($.Provider, {
979
966
  value: b,
980
- children: g.map((e, t) => {
981
- let n = f.current.get(e);
967
+ children: _.map((e, t) => {
968
+ let n = g.current.get(e);
982
969
  if (!n) return null;
983
- let { className: r, duration: s, ...c } = n;
984
- return /* @__PURE__ */ _(be, {
970
+ let { className: i, duration: a, ...c } = n;
971
+ return /* @__PURE__ */ h(ve, {
985
972
  id: e,
986
973
  index: x - t,
987
- className: r,
988
- duration: s,
989
- inverted: d,
990
- max: i,
991
- children: a(o, c)
974
+ className: i,
975
+ duration: a,
976
+ inverted: m,
977
+ max: o,
978
+ children: r(s, c)
992
979
  }, e);
993
980
  })
994
981
  })
995
982
  }) });
996
983
  }
997
984
  //#endregion
998
- export { se as Accordion, F as Base, ce as Button, pe as ButtonGroup, U as Checkbox, ue as Dialog, ge as Divider, R as FormField, L as FormLabel, B as Input, ee as InputField, q as Popover, G as Portal, he as Progress, ae as Radio, re as Select, ve as Sheet, fe as Skeleton, me as Spinner, oe as Switch, V as Textarea, Ce as Toast, Z as ToastItem, J as Tooltip, N as cn, I as element, P as merge, $ as toast, X as varientButton };
985
+ export { ae as Accordion, N as Base, oe as Button, de as ButtonGroup, V as Checkbox, ce as Dialog, me as Divider, I as FormField, F as FormLabel, R as Input, L as InputField, G as Popover, U as Portal, pe as Progress, re as Radio, K as Select, ge as Sheet, ue as Skeleton, fe as Spinner, ie as Switch, z as Textarea, be as Toast, X as ToastItem, q as Tooltip, j as cn, P as element, M as merge, Q as toast, Y as varientButton };