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