laif-ds 0.1.86 → 0.1.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,18 @@
1
1
  "use client";
2
- import { jsxs as n, jsx as e } from "react/jsx-runtime";
3
- import * as Y from "react";
4
- import { useState as i, useEffect as k, useCallback as D } from "react";
5
- import { useDebounce as Z } from "../../hooks/use-debounce.js";
6
- import { cva as _ } from "../../node_modules/class-variance-authority/dist/index.js";
7
- import { cn as z } from "../../lib/utils.js";
8
- import { Button as V } from "./button.js";
9
- import { Label as ee } from "./label.js";
10
- import { Command as te, CommandInput as oe, CommandList as ne, CommandEmpty as se, CommandGroup as O, CommandItem as R } from "./command.js";
11
- import { Popover as re, PopoverTrigger as ae, PopoverContent as ie } from "./popover.js";
12
- import ce from "../../node_modules/lucide-react/dist/esm/icons/x.js";
13
- import le from "../../node_modules/lucide-react/dist/esm/icons/chevrons-up-down.js";
14
- import de from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
15
- import me from "../../node_modules/lucide-react/dist/esm/icons/check.js";
16
- const fe = _(
17
- "flex items-center justify-between whitespace-nowrap rounded-md border border-input bg-d-input px-3 py-2 shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
2
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
3
+ import * as p from "react";
4
+ import { useState as a, useEffect as h, useCallback as A } from "react";
5
+ import { useDebounce as re } from "../../hooks/use-debounce.js";
6
+ import { cva as oe } from "../../node_modules/class-variance-authority/dist/index.js";
7
+ import { cn as S } from "../../lib/utils.js";
8
+ import { Label as le } from "./label.js";
9
+ import { Popover as ae, PopoverTrigger as ie, PopoverContent as ce } from "./popover.js";
10
+ import { Command as de, CommandInput as fe, CommandList as me, CommandEmpty as ue, CommandGroup as G, CommandItem as M } from "./command.js";
11
+ import { Icon as B } from "./icon.js";
12
+ import pe from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
13
+ import he from "../../node_modules/lucide-react/dist/esm/icons/check.js";
14
+ const ge = oe(
15
+ "flex items-center justify-between whitespace-nowrap rounded-md border border-d-input bg-d-input px-3 py-2 shadow-sm data-[placeholder]:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 ",
18
16
  {
19
17
  variants: {
20
18
  size: {
@@ -28,196 +26,228 @@ const fe = _(
28
26
  }
29
27
  }
30
28
  );
31
- function ke({
29
+ function Te({
32
30
  fetcher: c,
33
- preload: m,
34
- filterFn: y,
35
- renderOption: A,
36
- getOptionValue: a,
37
- getDisplayValue: b,
38
- notFound: F,
39
- loadingSkeleton: $,
40
- label: l,
41
- labelClassName: B,
42
- placeholder: G = "Select...",
43
- value: s = "",
44
- onChange: u,
45
- disabled: v = !1,
46
- width: E = "200px",
47
- className: M,
48
- triggerClassName: U,
49
- noResultsMessage: X,
50
- clearable: w = !0,
51
- size: q
31
+ preload: f,
32
+ filterFn: R,
33
+ renderOption: k,
34
+ getOptionValue: i,
35
+ getDisplayValue: g,
36
+ notFound: U,
37
+ loadingSkeleton: X,
38
+ label: z,
39
+ labelClassName: $,
40
+ placeholder: O = "Select...",
41
+ value: r = "",
42
+ onChange: x,
43
+ disabled: W = !1,
44
+ width: m = "200px",
45
+ triggerClassName: q,
46
+ noResultsMessage: H,
47
+ clearable: L = !0,
48
+ size: J
52
49
  }) {
53
- const [p, N] = i(!1), [r, d] = i([]), [C, h] = i(!1), [S, g] = i(null), [L, x] = i(null), [I, H] = i(""), f = Z(I, m ? 0 : 300), [j, P] = i([]);
54
- k(() => ((async () => {
50
+ const [l, j] = a(!1), w = m === "auto", I = p.useRef(null), T = p.useRef(null), K = p.useRef(null), Q = p.useRef(null), [y, v] = a(!1), [N, b] = a(null), [E, C] = a(null), [D, Y] = a(""), u = re(D, f ? 0 : 300), [P, F] = a([]), [n, d] = a([]), [Z, _] = a(
51
+ void 0
52
+ );
53
+ h(() => ((async () => {
55
54
  try {
56
- if (h(!0), g(null), m) {
57
- console.log(
58
- "[AsyncSelect] Preload attivo: caricamento completo dei dati"
59
- );
60
- const o = await c("");
61
- P(o), d(o);
55
+ if (v(!0), b(null), f) {
56
+ const s = await c("");
57
+ F(s), d(s);
62
58
  } else {
63
- const o = await c(s);
64
- d(o);
59
+ const s = await c(r);
60
+ d(s);
65
61
  }
66
- } catch (o) {
67
- g(
68
- o instanceof Error ? o.message : "Failed to fetch options"
62
+ } catch (s) {
63
+ b(
64
+ s instanceof Error ? s.message : "Failed to fetch options"
69
65
  );
70
66
  } finally {
71
- h(!1);
67
+ v(!1);
72
68
  }
73
69
  })(), () => {
74
- d([]), P([]);
75
- }), [c, s, m]), k(() => {
76
- if (p)
77
- if (m)
78
- if (f) {
79
- const t = j.filter(
80
- (o) => y ? y(o, f) : String(b(o)).toLowerCase().includes(f.toLowerCase())
70
+ d([]), F([]);
71
+ }), [c, r, f]), h(() => {
72
+ if (l)
73
+ if (f)
74
+ if (u) {
75
+ const t = P.filter(
76
+ (s) => R ? R(s, u) : String(g(s)).toLowerCase().includes(u.toLowerCase())
81
77
  );
82
78
  d(t);
83
79
  } else
84
- d(j);
80
+ d(P);
85
81
  else
86
82
  (async () => {
87
83
  try {
88
- h(!0), g(null);
89
- const o = await c(f);
90
- d(o);
91
- } catch (o) {
92
- g(
93
- o instanceof Error ? o.message : "Failed to fetch options"
84
+ v(!0), b(null);
85
+ const s = await c(u);
86
+ d(s);
87
+ } catch (s) {
88
+ b(
89
+ s instanceof Error ? s.message : "Failed to fetch options"
94
90
  );
95
91
  } finally {
96
- h(!1);
92
+ v(!1);
97
93
  }
98
94
  })();
99
95
  }, [
100
- p,
96
+ l,
97
+ u,
101
98
  f,
102
- m,
103
- y,
104
- j,
105
- b
106
- ]), k(() => {
107
- if (s && r.length > 0) {
108
- const t = r.find((o) => a(o) === s);
109
- x(t || null);
110
- } else s || x(null);
111
- }, [s, r, a]);
112
- const J = D(
99
+ R,
100
+ P,
101
+ g
102
+ ]), h(() => {
103
+ if (r && n.length > 0) {
104
+ const t = n.find((s) => i(s) === r);
105
+ C(t || null);
106
+ } else r || C(null);
107
+ }, [r, n, i]), h(() => {
108
+ l && I.current && I.current.focus();
109
+ }, [l]), h(() => {
110
+ if (l && T.current) {
111
+ const t = T.current.getBoundingClientRect();
112
+ _(t.width);
113
+ }
114
+ }, [l]);
115
+ const V = A(
113
116
  (t) => {
114
- const o = w && t === s ? "" : t, Q = r.find((W) => a(W) === o) || null;
115
- x(Q), u(o), N(!1);
117
+ const s = L && t === r ? "" : t, se = n.find((ne) => i(ne) === s) || null;
118
+ C(se), x(s), j(!1);
116
119
  },
117
- [s, u, w, r, a]
118
- ), K = D(
120
+ [r, x, L, n, i]
121
+ ), ee = A(
119
122
  (t) => {
120
- t.stopPropagation(), t.preventDefault(), x(null), u(""), N(!1);
123
+ t.stopPropagation(), t.preventDefault(), C(null), x(""), j(!1);
121
124
  },
122
- [u]
123
- ), T = Y.useId();
124
- return /* @__PURE__ */ n("div", { className: "space-y-1.5", children: [
125
- l && /* @__PURE__ */ e(ee, { htmlFor: T, className: B, children: l }),
126
- /* @__PURE__ */ n(re, { open: p, onOpenChange: N, children: [
127
- /* @__PURE__ */ e(ae, { disabled: v, children: /* @__PURE__ */ e(
128
- V,
125
+ [x]
126
+ ), te = p.useId();
127
+ return /* @__PURE__ */ o("div", { className: S("space-y-1.5", w && "w-full"), children: [
128
+ z && /* @__PURE__ */ e(le, { className: $, children: z }),
129
+ /* @__PURE__ */ e("div", { ref: K, className: "relative", "data-slot": "async-select", children: /* @__PURE__ */ o(ae, { open: l, onOpenChange: j, children: [
130
+ /* @__PURE__ */ e(ie, { asChild: !0, children: /* @__PURE__ */ e(
131
+ "button",
129
132
  {
130
- id: T,
133
+ id: te,
131
134
  type: "button",
132
- variant: "ghost",
133
- role: "combobox",
134
- "aria-expanded": p,
135
- className: z(
136
- fe({ size: q }),
137
- v && "cursor-not-allowed opacity-50",
138
- U,
139
- "font-normal"
135
+ disabled: W,
136
+ className: S(
137
+ ge({ size: J }),
138
+ W && "cursor-not-allowed opacity-50",
139
+ q,
140
+ "font-normal",
141
+ w && "w-full",
142
+ "focus-visible:ring-d-ring focus-visible:ring-1",
143
+ l && "ring-d-ring ring-1"
140
144
  ),
141
- style: { width: E },
142
- disabled: v,
143
- children: /* @__PURE__ */ n("div", { className: "flex flex-1 items-center justify-between overflow-hidden", children: [
144
- L ? /* @__PURE__ */ e("div", { className: "truncate", children: b(L) }) : /* @__PURE__ */ e("span", { className: "text-d-muted-foreground hover:text-d-foreground", children: G }),
145
- /* @__PURE__ */ n("div", { className: "flex items-center gap-1", children: [
146
- w && L && /* @__PURE__ */ e(
145
+ style: w ? void 0 : { width: m },
146
+ ref: T,
147
+ children: /* @__PURE__ */ o("div", { className: "flex w-full flex-1 items-center justify-between overflow-hidden", children: [
148
+ E ? /* @__PURE__ */ e("div", { className: "truncate", children: g(E) }) : /* @__PURE__ */ e("span", { className: "text-d-muted-foreground hover:text-d-foreground", children: O }),
149
+ /* @__PURE__ */ o("div", { className: "flex w-full items-center justify-end gap-1", children: [
150
+ L && E && /* @__PURE__ */ e(
147
151
  "div",
148
152
  {
149
- className: "bg-d-input hover:bg-d-input/30 border-d-border z-20 flex cursor-pointer items-center justify-center rounded-full border p-1",
150
- onClick: K,
153
+ className: "border-d-input bg-d-accent cursor-pointer rounded-full p-1",
154
+ onClick: ee,
151
155
  onMouseDown: (t) => t.preventDefault(),
152
156
  "aria-label": "Clear selection",
153
- children: /* @__PURE__ */ e(ce, { size: 8, className: "text-d-foreground" })
157
+ children: /* @__PURE__ */ e(
158
+ B,
159
+ {
160
+ name: "X",
161
+ size: "xs",
162
+ className: "!text-d-foreground opacity-50"
163
+ }
164
+ )
154
165
  }
155
166
  ),
156
- /* @__PURE__ */ e(le, { className: "opacity-50", size: 10 })
167
+ /* @__PURE__ */ e(
168
+ B,
169
+ {
170
+ name: "ChevronsUpDown",
171
+ size: "xs",
172
+ className: "!text-d-foreground opacity-50"
173
+ }
174
+ )
157
175
  ] })
158
176
  ] })
159
177
  }
160
178
  ) }),
161
179
  /* @__PURE__ */ e(
162
- ie,
180
+ ce,
163
181
  {
164
- style: { width: E },
165
- className: z("p-0", M),
166
- children: /* @__PURE__ */ n(te, { shouldFilter: !1, children: [
167
- /* @__PURE__ */ n("div", { className: "border-d-border relative w-full border-b", children: [
168
- /* @__PURE__ */ e(
169
- oe,
170
- {
171
- className: "!focus:outline-none !focus-visible:outline-none !focus:ring-0 !focus:ring-offset-0 !focus-visible:ring-0 !focus-visible:ring-offset-0 !border-none !outline-none",
172
- placeholder: `Search ${typeof l == "string" ? l.toLowerCase() : "options"}...`,
173
- value: I,
174
- onValueChange: (t) => {
175
- H(t);
182
+ className: S("p-0"),
183
+ style: {
184
+ width: w ? Z : typeof m == "number" ? `${m}px` : m
185
+ },
186
+ align: "start",
187
+ side: "bottom",
188
+ sideOffset: 4,
189
+ onWheel: (t) => t.stopPropagation(),
190
+ avoidCollisions: !1,
191
+ children: /* @__PURE__ */ o(
192
+ de,
193
+ {
194
+ shouldFilter: !1,
195
+ className: "w-full border-none shadow-lg",
196
+ children: [
197
+ /* @__PURE__ */ e(
198
+ fe,
199
+ {
200
+ ref: I,
201
+ placeholder: O,
202
+ value: D,
203
+ onValueChange: Y
176
204
  }
177
- }
178
- ),
179
- C && r.length > 0 && /* @__PURE__ */ e("div", { className: "absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center", children: /* @__PURE__ */ e(de, { className: "h-4 w-4 animate-spin" }) })
180
- ] }),
181
- /* @__PURE__ */ n(ne, { children: [
182
- S && /* @__PURE__ */ e("div", { className: "text-d-destructive p-3 text-center", children: S }),
183
- C && r.length === 0 && ($ || /* @__PURE__ */ e(ue, {})),
184
- !C && !S && r.length === 0 && (F || /* @__PURE__ */ e(se, { children: X ?? `No ${typeof l == "string" ? l.toLowerCase() : "options"} found.` })),
185
- /* @__PURE__ */ e(O, { children: r.map((t) => /* @__PURE__ */ n(
186
- R,
187
- {
188
- value: a(t),
189
- onSelect: J,
190
- children: [
191
- A(t),
192
- /* @__PURE__ */ e(
193
- me,
194
- {
195
- className: z(
196
- "ml-auto h-3 w-3",
197
- s === a(t) ? "opacity-100" : "opacity-0"
205
+ ),
206
+ y && n.length > 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center p-2", children: /* @__PURE__ */ e(pe, { className: "h-4 w-4 animate-spin" }) }),
207
+ /* @__PURE__ */ o(me, { ref: Q, children: [
208
+ N && /* @__PURE__ */ e("div", { className: "text-d-destructive p-3 text-center", children: N }),
209
+ y && n.length === 0 && (X || /* @__PURE__ */ e(xe, {})),
210
+ !y && !N && n.length === 0 && (U || /* @__PURE__ */ e(ue, { children: H || "No results found." })),
211
+ !y && !N && n.length > 0 && /* @__PURE__ */ e(G, { children: n.map((t) => /* @__PURE__ */ o(
212
+ M,
213
+ {
214
+ value: i(t),
215
+ onSelect: V,
216
+ className: "cursor-pointer",
217
+ children: [
218
+ k ? k(t) : /* @__PURE__ */ e("span", { children: g(t) }),
219
+ /* @__PURE__ */ e(
220
+ he,
221
+ {
222
+ className: S(
223
+ "ml-auto h-4 w-4",
224
+ r === i(t) ? "opacity-100" : "opacity-0"
225
+ )
226
+ }
198
227
  )
199
- }
200
- )
201
- ]
202
- },
203
- a(t)
204
- )) })
205
- ] })
206
- ] })
228
+ ]
229
+ },
230
+ i(t)
231
+ )) })
232
+ ] })
233
+ ]
234
+ }
235
+ )
207
236
  }
208
237
  )
209
- ] })
238
+ ] }) })
210
239
  ] });
211
240
  }
212
- function ue() {
213
- return /* @__PURE__ */ e(O, { children: [1, 2, 3].map((c) => /* @__PURE__ */ e(R, { disabled: !0, children: /* @__PURE__ */ n("div", { className: "flex w-full items-center gap-2", children: [
241
+ function xe() {
242
+ return /* @__PURE__ */ e(G, { children: [1, 2, 3].map((c) => /* @__PURE__ */ e(M, { disabled: !0, children: /* @__PURE__ */ o("div", { className: "flex w-full items-center gap-2", children: [
214
243
  /* @__PURE__ */ e("div", { className: "bg-d-secondary h-6 w-6 animate-pulse rounded-full" }),
215
- /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col gap-1", children: [
244
+ /* @__PURE__ */ o("div", { className: "flex flex-1 flex-col gap-1", children: [
216
245
  /* @__PURE__ */ e("div", { className: "bg-d-secondary h-4 w-24 animate-pulse rounded" }),
217
246
  /* @__PURE__ */ e("div", { className: "bg-d-secondary h-3 w-16 animate-pulse rounded" })
218
247
  ] })
219
248
  ] }) }, c)) });
220
249
  }
221
250
  export {
222
- ke as AsyncSelect
251
+ Te as AsyncSelect,
252
+ ge as asyncSelectTriggerVariants
223
253
  };
@@ -1,19 +1,19 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import { jsx as r, jsxs as c } from "react/jsx-runtime";
3
3
  import { Root as v } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
4
- import { cva as h } from "../../node_modules/class-variance-authority/dist/index.js";
4
+ import { cva as m } from "../../node_modules/class-variance-authority/dist/index.js";
5
5
  import { cn as l } from "../../lib/utils.js";
6
6
  import { Icon as u } from "./icon.js";
7
- const m = h(
8
- "cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-d-ring focus-visible:ring-d-ring/50 focus-visible:ring-[3px] aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive transition-all duration-200",
7
+ const b = m(
8
+ "cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-d-ring focus-visible:ring-d-ring/50 focus-visible:ring-[3px] aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive transition-all duration-200 ease-out transform-gpu active:scale-[0.98] active:shadow-sm overflow-hidden relative group",
9
9
  {
10
10
  variants: {
11
11
  variant: {
12
- default: "bg-d-primary text-d-primary-foreground shadow-xs hover:bg-d-primary/90",
13
- destructive: "bg-d-destructive text-white shadow-xs hover:bg-d-destructive/90 focus-visible:ring-d-destructive/20 dark:focus-visible:ring-d-destructive/40 dark:bg-d-destructive/60",
14
- outline: "border bg-d-background shadow-xs hover:bg-d-accent hover:text-d-accent-foreground dark:bg-d-input/30 dark:border-d-input dark:hover:bg-d-input/50",
15
- "outline-primary": "border !border-d-primary bg-d-background shadow-xs text-d-primary/80 hover:!text-d-primary",
16
- secondary: "bg-d-secondary text-d-secondary-foreground shadow-xs hover:bg-d-secondary/80 hover:text-d-secondary-foreground",
12
+ default: "bg-d-primary text-d-primary-foreground shadow-xs hover:bg-d-primary/90 hover:shadow-d-primary/25 before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-white/20 before:to-transparent before:translate-x-[-100%] hover:before:translate-x-[100%] before:transition-transform before:duration-700 before:ease-out",
13
+ destructive: "bg-d-destructive text-white shadow-xs hover:bg-d-destructive/90 hover:shadow-d-destructive/25 focus-visible:ring-d-destructive/20 dark:focus-visible:ring-d-destructive/40 dark:bg-d-destructive/60 before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-white/20 before:to-transparent before:translate-x-[-100%] hover:before:translate-x-[100%] before:transition-transform before:duration-700 before:ease-out",
14
+ outline: "border bg-d-background shadow-xs hover:bg-d-accent hover:text-d-accent-foreground hover:border-d-accent dark:bg-d-input/30 dark:border-d-input dark:hover:bg-d-input/50",
15
+ "outline-primary": "border !border-d-primary bg-d-background shadow-xs text-d-primary/80 hover:!text-d-primary hover:bg-d-primary/5 hover:border-d-primary/80 ",
16
+ secondary: "bg-d-secondary text-d-secondary-foreground shadow-xs hover:bg-d-secondary/80 hover:text-d-secondary-foreground ",
17
17
  ghost: "hover:bg-d-accent hover:text-d-accent-foreground dark:hover:bg-d-accent",
18
18
  link: "text-d-primary underline-offset-4 hover:underline"
19
19
  },
@@ -30,42 +30,42 @@ const m = h(
30
30
  }
31
31
  }
32
32
  );
33
- function k({
34
- className: d,
35
- variant: o,
36
- size: r,
37
- asChild: a = !1,
33
+ function w({
34
+ className: o,
35
+ variant: a,
36
+ size: e,
37
+ asChild: d = !1,
38
38
  iconLeft: n,
39
- iconRight: i,
40
- isLoading: g = !1,
39
+ iconRight: s,
40
+ isLoading: f = !1,
41
41
  ...t
42
42
  }) {
43
- const s = a ? v : "button";
44
- return a ? /* @__PURE__ */ e(
45
- s,
43
+ const i = d ? v : "button";
44
+ return d ? /* @__PURE__ */ r(
45
+ i,
46
46
  {
47
47
  "data-slot": "button",
48
- className: l(m({ variant: o, size: r, className: d })),
48
+ className: l(b({ variant: a, size: e, className: o })),
49
49
  ...t
50
50
  }
51
51
  ) : /* @__PURE__ */ c(
52
- s,
52
+ i,
53
53
  {
54
54
  "data-slot": "button",
55
- className: l(m({ variant: o, size: r, className: d }), "relative"),
55
+ className: l(b({ variant: a, size: e, className: o }), "relative"),
56
56
  ...t,
57
57
  children: [
58
- g ? /* @__PURE__ */ c(
58
+ f ? /* @__PURE__ */ c(
59
59
  "svg",
60
60
  {
61
61
  className: "mr-1 -ml-1 animate-spin",
62
62
  xmlns: "http://www.w3.org/2000/svg",
63
63
  fill: "none",
64
64
  viewBox: "0 0 24 24",
65
- width: r === "sm" ? 14 : r === "lg" ? 20 : 16,
66
- height: r === "sm" ? 14 : r === "lg" ? 20 : 16,
65
+ width: e === "sm" ? 14 : e === "lg" ? 20 : 16,
66
+ height: e === "sm" ? 14 : e === "lg" ? 20 : 16,
67
67
  children: [
68
- /* @__PURE__ */ e(
68
+ /* @__PURE__ */ r(
69
69
  "circle",
70
70
  {
71
71
  className: "opacity-25",
@@ -76,7 +76,7 @@ function k({
76
76
  strokeWidth: "4"
77
77
  }
78
78
  ),
79
- /* @__PURE__ */ e(
79
+ /* @__PURE__ */ r(
80
80
  "path",
81
81
  {
82
82
  className: "opacity-75",
@@ -86,19 +86,19 @@ function k({
86
86
  )
87
87
  ]
88
88
  }
89
- ) : n && /* @__PURE__ */ e(
89
+ ) : n && /* @__PURE__ */ r(
90
90
  u,
91
91
  {
92
92
  name: n,
93
- size: r === "default" ? "md" : r === "sm" ? "xs" : "sm"
93
+ size: e === "default" ? "md" : e === "sm" ? "xs" : "sm"
94
94
  }
95
95
  ),
96
96
  t.children,
97
- i && /* @__PURE__ */ e(
97
+ s && /* @__PURE__ */ r(
98
98
  u,
99
99
  {
100
- name: i,
101
- size: r === "default" ? "md" : r === "sm" ? "xs" : "sm"
100
+ name: s,
101
+ size: e === "default" ? "md" : e === "sm" ? "xs" : "sm"
102
102
  }
103
103
  )
104
104
  ]
@@ -106,6 +106,6 @@ function k({
106
106
  );
107
107
  }
108
108
  export {
109
- k as Button,
110
- m as buttonVariants
109
+ w as Button,
110
+ b as buttonVariants
111
111
  };
@@ -64,7 +64,7 @@ function B({
64
64
  t.dropdowns
65
65
  ),
66
66
  dropdown_root: e(
67
- "relative has-focus:border-ring border border-d-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
67
+ "relative has-focus:border-ring border border-d-input shadow-xs has-focus:ring-d-ring/50 has-focus:ring-[3px] rounded-md",
68
68
  t.dropdown_root
69
69
  ),
70
70
  dropdown: e("absolute inset-0 opacity-0", t.dropdown),
@@ -159,7 +159,7 @@ function v({
159
159
  "data-range-end": r.range_end,
160
160
  "data-range-middle": r.range_middle,
161
161
  className: e(
162
- "data-[selected-single=true]:bg-d-primary data-[selected-single=true]:text-d-primary-foreground data-[range-middle=true]:bg-d-accent data-[range-middle=true]:text-d-accent-foreground data-[range-start=true]:bg-d-primary data-[range-start=true]:text-d-primary-foreground data-[range-end=true]:bg-d-primary data-[range-end=true]:text-d-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-d-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[1px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
162
+ "data-[selected-single=true]:bg-d-primary data-[selected-single=true]:text-d-primary-foreground data-[range-middle=true]:bg-d-accent data-[range-middle=true]:text-d-accent-foreground data-[range-start=true]:bg-d-primary data-[range-start=true]:text-d-primary-foreground data-[range-end=true]:bg-d-primary data-[range-end=true]:text-d-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-d-ring/50 dark:hover:text-d-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[1px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
163
163
  s.day,
164
164
  c
165
165
  ),
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { jsxs as c, jsx as e } from "react/jsx-runtime";
3
- import * as d from "react";
2
+ import { jsxs as d, jsx as e } from "react/jsx-runtime";
3
+ import * as c from "react";
4
4
  import { cn as g } from "../../lib/utils.js";
5
5
  import { buttonVariants as x } from "./button.js";
6
6
  import { Icon as h } from "./icon.js";
@@ -17,20 +17,20 @@ function E({
17
17
  disabled: t = !1,
18
18
  size: o = "default"
19
19
  }) {
20
- const [r, i] = d.useState(n);
21
- d.useEffect(() => {
20
+ const [r, i] = c.useState(n);
21
+ c.useEffect(() => {
22
22
  i(n);
23
23
  }, [n]);
24
24
  const p = (s) => {
25
25
  i(s), a && a(s);
26
26
  };
27
- return /* @__PURE__ */ c(w, { open: t ? !1 : void 0, children: [
27
+ return /* @__PURE__ */ d(w, { open: t ? !1 : void 0, children: [
28
28
  /* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ e(
29
29
  "div",
30
30
  {
31
31
  className: g(
32
32
  x({ variant: u, size: o }),
33
- "border-d-input text-d-foreground hover:bg-d-accent bg-d-input ring-offset-background data-[placeholder]:text-d-muted-foreground focus:ring-ring flex items-center justify-between border px-3 py-2 font-normal whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none [&>span]:line-clamp-1",
33
+ "border-d-input text-d-foreground hover:bg-d-accent bg-d-input ring-offset-background data-[placeholder]:text-d-muted-foreground focus:ring-d-ring flex items-center justify-between border px-3 py-2 font-normal whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none [&>span]:line-clamp-1",
34
34
  !r && "text-d-muted-foreground",
35
35
  t && "cursor-not-allowed opacity-50",
36
36
  f,
@@ -42,7 +42,7 @@ function E({
42
42
  tabIndex: t ? -1 : 0,
43
43
  onClick: t ? void 0 : () => {
44
44
  },
45
- children: /* @__PURE__ */ c("div", { className: "flex w-full items-center justify-between gap-2", children: [
45
+ children: /* @__PURE__ */ d("div", { className: "flex w-full items-center justify-between gap-2", children: [
46
46
  /* @__PURE__ */ e(
47
47
  h,
48
48
  {