@darthcharles/greda 1.2.0 → 1.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.js CHANGED
@@ -1,28 +1,28 @@
1
- import { jsx as o, jsxs as u } from "react/jsx-runtime";
2
- import * as i from "react";
3
- import { Slot as V } from "@radix-ui/react-slot";
4
- import { cva as x } from "class-variance-authority";
5
- import { cn as r } from "./utils.js";
6
- import * as N from "@radix-ui/react-label";
7
- import * as n from "@radix-ui/react-select";
8
- import { Check as C, ChevronDown as R, ChevronUp as j, X as T, Minus as I } from "lucide-react";
9
- import * as d from "@radix-ui/react-dialog";
10
- import * as h from "@radix-ui/react-checkbox";
11
- import * as p from "@radix-ui/react-tabs";
12
- import * as l from "@radix-ui/react-toast";
13
- import * as f from "@radix-ui/react-tooltip";
14
- import * as m from "@radix-ui/react-popover";
15
- const B = x(
16
- "comal-ui inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all active:[&:not([aria-haspopup])]:translate-y-px motion-reduce:active:[&:not([aria-haspopup])]:transform-none focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-disabled [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
1
+ import { jsx as r, jsxs as N } from "react/jsx-runtime";
2
+ import * as o from "react";
3
+ import { Slot as Ee } from "@radix-ui/react-slot";
4
+ import { cva as Y } from "class-variance-authority";
5
+ import { cn as i } from "./utils.js";
6
+ import * as pe from "@radix-ui/react-label";
7
+ import * as f from "@radix-ui/react-select";
8
+ import { Check as re, ChevronDown as ie, ChevronUp as Oe, X as ge, Minus as Ae } from "lucide-react";
9
+ import * as k from "@radix-ui/react-popover";
10
+ import * as y from "@radix-ui/react-dialog";
11
+ import * as oe from "@radix-ui/react-checkbox";
12
+ import * as B from "@radix-ui/react-tabs";
13
+ import * as h from "@radix-ui/react-toast";
14
+ import * as $ from "@radix-ui/react-tooltip";
15
+ const je = Y(
16
+ "comal-ui inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md border text-sm font-medium [&:not([aria-pressed])]:transition-all active:[&:not([aria-haspopup]):not([aria-pressed])]:translate-y-px motion-reduce:active:[&:not([aria-haspopup]):not([aria-pressed])]:transform-none focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-disabled [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
17
17
  {
18
18
  variants: {
19
19
  variant: {
20
- default: "bg-primary text-primary-foreground shadow hover:bg-primary-hover",
21
- destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
22
- outline: "border border-primary surface-primary shadow-sm hover:bg-accent hover:text-accent-foreground",
23
- secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
24
- ghost: "hover:bg-accent hover:text-accent-foreground",
25
- link: "text-action underline-offset-4 hover:underline"
20
+ default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary-hover",
21
+ destructive: "border-transparent bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
22
+ outline: "border-primary surface-primary shadow-sm hover:bg-accent hover:text-accent-foreground",
23
+ secondary: "border-transparent bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
24
+ ghost: "border-transparent hover:bg-accent hover:text-accent-foreground",
25
+ link: "border-transparent text-action underline-offset-4 hover:underline"
26
26
  },
27
27
  size: {
28
28
  default: "h-9 px-4 py-2",
@@ -36,49 +36,49 @@ const B = x(
36
36
  size: "default"
37
37
  }
38
38
  }
39
- ), L = i.forwardRef(
39
+ ), Le = o.forwardRef(
40
40
  ({
41
41
  className: e,
42
42
  variant: t,
43
43
  size: a,
44
- asChild: s = !1,
45
- loading: c = !1,
46
- disabled: g,
47
- type: v,
48
- ...y
49
- }, b) => /* @__PURE__ */ o(
50
- s ? V : "button",
44
+ asChild: l = !1,
45
+ loading: p = !1,
46
+ disabled: v,
47
+ type: b,
48
+ ...C
49
+ }, g) => /* @__PURE__ */ r(
50
+ l ? Ee : "button",
51
51
  {
52
- className: r(B({ variant: t, size: a, className: e })),
53
- ref: b,
54
- type: s ? void 0 : v ?? "button",
55
- disabled: s ? void 0 : g || c,
56
- "aria-busy": c || void 0,
57
- ...y
52
+ className: i(je({ variant: t, size: a, className: e })),
53
+ ref: g,
54
+ type: l ? void 0 : b ?? "button",
55
+ disabled: l ? void 0 : v || p,
56
+ "aria-busy": p || void 0,
57
+ ...C
58
58
  }
59
59
  )
60
60
  );
61
- L.displayName = "Button";
62
- const O = i.forwardRef(
63
- ({ className: e, type: t, ...a }, s) => /* @__PURE__ */ o(
61
+ Le.displayName = "Button";
62
+ const ve = o.forwardRef(
63
+ ({ className: e, type: t, ...a }, l) => /* @__PURE__ */ r(
64
64
  "input",
65
65
  {
66
66
  type: t,
67
- className: r(
67
+ className: i(
68
68
  "comal-ui",
69
69
  "flex h-9 w-full rounded-md border border-primary bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-disabled aria-[invalid=true]:border-destructive md:text-sm",
70
70
  e
71
71
  ),
72
- ref: s,
72
+ ref: l,
73
73
  ...a
74
74
  }
75
75
  )
76
76
  );
77
- O.displayName = "Input";
78
- const A = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
77
+ ve.displayName = "Input";
78
+ const Be = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
79
79
  "textarea",
80
80
  {
81
- className: r(
81
+ className: i(
82
82
  "comal-ui",
83
83
  "flex min-h-[60px] w-full rounded-md border border-primary bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-disabled aria-[invalid=true]:border-destructive md:text-sm",
84
84
  e
@@ -87,23 +87,23 @@ const A = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
87
87
  ...t
88
88
  }
89
89
  ));
90
- A.displayName = "Textarea";
91
- const F = x(
90
+ Be.displayName = "Textarea";
91
+ const Fe = Y(
92
92
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
93
- ), H = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
94
- N.Root,
93
+ ), Ve = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
94
+ pe.Root,
95
95
  {
96
96
  ref: a,
97
- className: r("comal-ui", F(), e),
97
+ className: i("comal-ui", Fe(), e),
98
98
  ...t
99
99
  }
100
100
  ));
101
- H.displayName = N.Root.displayName;
102
- const Re = n.Root, Te = n.Group, De = n.Value, U = i.forwardRef(({ className: e, children: t, ...a }, s) => /* @__PURE__ */ u(
103
- n.Trigger,
101
+ Ve.displayName = pe.Root.displayName;
102
+ const Pt = f.Root, St = f.Group, kt = f.Value, $e = o.forwardRef(({ className: e, children: t, ...a }, l) => /* @__PURE__ */ N(
103
+ f.Trigger,
104
104
  {
105
- ref: s,
106
- className: r(
105
+ ref: l,
106
+ className: i(
107
107
  "comal-ui",
108
108
  "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-primary bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-disabled aria-[invalid=true]:border-destructive [&>span]:line-clamp-1",
109
109
  e
@@ -111,74 +111,74 @@ const Re = n.Root, Te = n.Group, De = n.Value, U = i.forwardRef(({ className: e,
111
111
  ...a,
112
112
  children: [
113
113
  t,
114
- /* @__PURE__ */ o(n.Icon, { asChild: !0, children: /* @__PURE__ */ o(R, { className: "h-4 w-4 opacity-50" }) })
114
+ /* @__PURE__ */ r(f.Icon, { asChild: !0, children: /* @__PURE__ */ r(ie, { className: "h-4 w-4 opacity-50" }) })
115
115
  ]
116
116
  }
117
117
  ));
118
- U.displayName = n.Trigger.displayName;
119
- const D = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
120
- n.ScrollUpButton,
118
+ $e.displayName = f.Trigger.displayName;
119
+ const be = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
120
+ f.ScrollUpButton,
121
121
  {
122
122
  ref: a,
123
- className: r(
123
+ className: i(
124
124
  "comal-ui",
125
125
  "flex cursor-default items-center justify-center py-1",
126
126
  e
127
127
  ),
128
128
  ...t,
129
- children: /* @__PURE__ */ o(j, { className: "h-4 w-4" })
129
+ children: /* @__PURE__ */ r(Oe, { className: "h-4 w-4" })
130
130
  }
131
131
  ));
132
- D.displayName = n.ScrollUpButton.displayName;
133
- const P = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
134
- n.ScrollDownButton,
132
+ be.displayName = f.ScrollUpButton.displayName;
133
+ const ye = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
134
+ f.ScrollDownButton,
135
135
  {
136
136
  ref: a,
137
- className: r(
137
+ className: i(
138
138
  "comal-ui",
139
139
  "flex cursor-default items-center justify-center py-1",
140
140
  e
141
141
  ),
142
142
  ...t,
143
- children: /* @__PURE__ */ o(R, { className: "h-4 w-4" })
143
+ children: /* @__PURE__ */ r(ie, { className: "h-4 w-4" })
144
144
  }
145
145
  ));
146
- P.displayName = n.ScrollDownButton.displayName;
147
- const _ = i.forwardRef(({ className: e, container: t, children: a, position: s = "popper", ...c }, g) => /* @__PURE__ */ o(n.Portal, { container: t, children: /* @__PURE__ */ u(
148
- n.Content,
146
+ ye.displayName = f.ScrollDownButton.displayName;
147
+ const Ue = o.forwardRef(({ className: e, container: t, children: a, position: l = "popper", ...p }, v) => /* @__PURE__ */ r(f.Portal, { container: t, children: /* @__PURE__ */ N(
148
+ f.Content,
149
149
  {
150
- ref: g,
151
- className: r(
150
+ ref: v,
151
+ className: i(
152
152
  "comal-ui",
153
153
  "relative z-popover max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border surface-raised text-primary shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",
154
- s === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
154
+ l === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
155
155
  e
156
156
  ),
157
- position: s,
158
- ...c,
157
+ position: l,
158
+ ...p,
159
159
  children: [
160
- /* @__PURE__ */ o(D, {}),
161
- /* @__PURE__ */ o(
162
- n.Viewport,
160
+ /* @__PURE__ */ r(be, {}),
161
+ /* @__PURE__ */ r(
162
+ f.Viewport,
163
163
  {
164
- className: r(
164
+ className: i(
165
165
  "comal-ui",
166
166
  "p-1",
167
- s === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
167
+ l === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
168
168
  ),
169
169
  children: a
170
170
  }
171
171
  ),
172
- /* @__PURE__ */ o(P, {})
172
+ /* @__PURE__ */ r(ye, {})
173
173
  ]
174
174
  }
175
175
  ) }));
176
- _.displayName = n.Content.displayName;
177
- const G = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
178
- n.Label,
176
+ Ue.displayName = f.Content.displayName;
177
+ const qe = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
178
+ f.Label,
179
179
  {
180
180
  ref: a,
181
- className: r(
181
+ className: i(
182
182
  "comal-ui",
183
183
  "px-2 py-1.5 text-sm font-semibold",
184
184
  e
@@ -186,29 +186,29 @@ const G = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
186
186
  ...t
187
187
  }
188
188
  ));
189
- G.displayName = n.Label.displayName;
190
- const E = i.forwardRef(({ className: e, children: t, ...a }, s) => /* @__PURE__ */ u(
191
- n.Item,
189
+ qe.displayName = f.Label.displayName;
190
+ const Qe = o.forwardRef(({ className: e, children: t, ...a }, l) => /* @__PURE__ */ N(
191
+ f.Item,
192
192
  {
193
- ref: s,
194
- className: r(
193
+ ref: l,
194
+ className: i(
195
195
  "comal-ui",
196
196
  "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
197
197
  e
198
198
  ),
199
199
  ...a,
200
200
  children: [
201
- /* @__PURE__ */ o("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o(n.ItemIndicator, { children: /* @__PURE__ */ o(C, { className: "h-4 w-4" }) }) }),
202
- /* @__PURE__ */ o(n.ItemText, { children: t })
201
+ /* @__PURE__ */ r("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ r(f.ItemIndicator, { children: /* @__PURE__ */ r(re, { className: "h-4 w-4" }) }) }),
202
+ /* @__PURE__ */ r(f.ItemText, { children: t })
203
203
  ]
204
204
  }
205
205
  ));
206
- E.displayName = n.Item.displayName;
207
- const X = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
208
- n.Separator,
206
+ Qe.displayName = f.Item.displayName;
207
+ const He = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
208
+ f.Separator,
209
209
  {
210
210
  ref: a,
211
- className: r(
211
+ className: i(
212
212
  "comal-ui",
213
213
  "-mx-1 my-1 h-px bg-muted",
214
214
  e
@@ -216,12 +216,392 @@ const X = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
216
216
  ...t
217
217
  }
218
218
  ));
219
- X.displayName = n.Separator.displayName;
220
- const Pe = d.Root, Se = d.Trigger, q = d.Portal, ke = d.Close, S = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
221
- d.Overlay,
219
+ He.displayName = f.Separator.displayName;
220
+ const Me = k.Anchor, he = o.createContext({ side: "bottom", align: "center", sideOffset: 4 });
221
+ function Ke({ placement: e = "bottom", sideOffset: t = 4, ...a }) {
222
+ const [l, p = "center"] = e.split("-");
223
+ return /* @__PURE__ */ r(he.Provider, { value: { side: l, align: p, sideOffset: t }, children: /* @__PURE__ */ r(k.Root, { ...a }) });
224
+ }
225
+ const _e = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
226
+ k.Trigger,
227
+ {
228
+ ref: a,
229
+ className: i("comal-ui", e),
230
+ ...t
231
+ }
232
+ ));
233
+ _e.displayName = k.Trigger.displayName;
234
+ const xe = o.forwardRef(({ container: e, className: t, collisionPadding: a = 8, forceMount: l, ...p }, v) => {
235
+ const b = o.useContext(he), C = e && "current" in e ? e : void 0, [g, R] = o.useState(null);
236
+ if (o.useEffect(() => {
237
+ R(C?.current ?? null);
238
+ }, [C]), C && !g) return null;
239
+ const O = e && "current" in e ? g : e;
240
+ return /* @__PURE__ */ r(k.Portal, { container: O, forceMount: l, children: /* @__PURE__ */ r(
241
+ k.Content,
242
+ {
243
+ ref: v,
244
+ side: b.side,
245
+ align: b.align,
246
+ sideOffset: b.sideOffset,
247
+ collisionPadding: a,
248
+ forceMount: l,
249
+ className: i(
250
+ "comal-ui",
251
+ "z-popover w-72 max-w-[var(--radix-popover-content-available-width)] max-h-[var(--radix-popover-content-available-height)] overflow-y-auto rounded-md border bg-popover p-4 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",
252
+ t
253
+ ),
254
+ ...p
255
+ }
256
+ ) });
257
+ });
258
+ xe.displayName = k.Content.displayName;
259
+ const Ge = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
260
+ k.Close,
261
+ {
262
+ ref: a,
263
+ className: i("comal-ui", e),
264
+ ...t
265
+ }
266
+ ));
267
+ Ge.displayName = k.Close.displayName;
268
+ const we = o.createContext(null);
269
+ function Ne() {
270
+ const e = o.useContext(we);
271
+ if (!e) throw new Error("Combobox parts must be used inside Combobox.");
272
+ return e;
273
+ }
274
+ function X(e) {
275
+ return e.trim().toLocaleLowerCase();
276
+ }
277
+ const Xe = (e, t) => [e.label, ...e.keywords ?? []].some(
278
+ (a) => X(a).includes(X(t))
279
+ );
280
+ function zt({
281
+ children: e,
282
+ options: t,
283
+ value: a,
284
+ defaultValue: l = null,
285
+ onValueChange: p,
286
+ inputValue: v,
287
+ defaultInputValue: b = "",
288
+ onInputValueChange: C,
289
+ open: g,
290
+ defaultOpen: R = !1,
291
+ onOpenChange: O,
292
+ filter: x = Xe,
293
+ loading: I = !1,
294
+ error: m,
295
+ disabled: T = !1,
296
+ name: A,
297
+ form: s,
298
+ onCreate: D,
299
+ isValidNewOption: u
300
+ }) {
301
+ const P = o.useId(), [c, S] = o.useState(l), [d, w] = o.useState(b), [j, M] = o.useState(R), [J, Re] = o.useState([]), [se, K] = o.useState(null), [W, ne] = o.useState(!1), [Ie, U] = o.useState(!1), Z = o.useRef(null), Te = o.useRef(!1), de = o.useRef(null), F = o.useRef(!1), ee = o.useRef(!1), z = o.useRef(0), q = a === void 0 ? c : a, Q = v === void 0 ? d : v, E = !T && (g ?? j), te = o.useRef(E), le = (n) => `${P}-option-${encodeURIComponent(n.value)}`;
302
+ o.useEffect(() => (F.current = !0, () => {
303
+ F.current = !1, z.current += 1;
304
+ }), []), o.useEffect(() => {
305
+ z.current += 1;
306
+ }, [E, Q, q?.value]);
307
+ function ce(n) {
308
+ n !== Q && (z.current += 1, v === void 0 && w(n), C?.(n), K(null), U(!1));
309
+ }
310
+ function _(n) {
311
+ T && n || n !== E && (z.current += 1, g === void 0 && M(n), O?.(n));
312
+ }
313
+ function ue(n) {
314
+ a === void 0 && S(n), p?.(n);
315
+ }
316
+ o.useEffect(() => {
317
+ te.current && !E && (ce(""), K(null), U(!1)), te.current = E;
318
+ }, [E]), o.useEffect(() => {
319
+ const n = de.current?.form;
320
+ if (!n) return;
321
+ const L = (V) => {
322
+ queueMicrotask(() => {
323
+ V.defaultPrevented || !F.current || (z.current += 1, a === void 0 && S(l), v === void 0 && w(b), g === void 0 && (te.current = !1, M(!1)), K(null), U(!1));
324
+ });
325
+ };
326
+ return n.addEventListener("reset", L), () => n.removeEventListener("reset", L);
327
+ }, [s, a, v, g, l, b]);
328
+ const ae = x === !1 ? t : [
329
+ ...t,
330
+ ...J.filter((n) => !t.some((L) => L.value === n.value))
331
+ ], me = I || m ? [] : ae.filter(
332
+ (n) => x === !1 || x(n, Q)
333
+ ), G = Q.trim(), De = [...ae, ...q ? [q] : []].some(
334
+ (n) => X(n.label) === X(G)
335
+ ), H = D && G && !De && !I && !m && !W && (u?.(G, ae) ?? !0) ? `${P}-create` : null, fe = W ? [] : [
336
+ ...me.filter((n) => !n.disabled).map((n) => ({ id: le(n), option: n })),
337
+ ...H ? [{ id: H }] : []
338
+ ], Pe = fe.some((n) => n.id === se) ? se : null;
339
+ async function Se(n) {
340
+ if (T || Z.current?.readOnly || I || m || ee.current) return;
341
+ if (n.option) {
342
+ if (n.option.disabled) return;
343
+ ue(n.option), _(!1);
344
+ return;
345
+ }
346
+ if (!D || !H || n.id !== H) return;
347
+ const L = ++z.current;
348
+ ee.current = !0, ne(!0), U(!1);
349
+ try {
350
+ const V = await D(G);
351
+ if (!F.current || z.current !== L || Z.current?.readOnly) return;
352
+ if (V.disabled) throw new Error("The created option is disabled.");
353
+ x !== !1 && Re((ke) => [
354
+ ...ke.filter((ze) => ze.value !== V.value),
355
+ V
356
+ ]), ue(V), _(!1);
357
+ } catch {
358
+ F.current && z.current === L && U(!0);
359
+ } finally {
360
+ ee.current = !1, F.current && ne(!1);
361
+ }
362
+ }
363
+ return /* @__PURE__ */ r(we.Provider, { value: {
364
+ listId: `${P}-list`,
365
+ statusId: `${P}-status`,
366
+ selected: q,
367
+ query: Q,
368
+ open: E,
369
+ disabled: T,
370
+ loading: I,
371
+ creating: W,
372
+ creationFailed: Ie,
373
+ error: m,
374
+ options: me,
375
+ entries: fe,
376
+ activeId: Pe,
377
+ createId: H,
378
+ inputRef: Z,
379
+ composingRef: Te,
380
+ form: s,
381
+ optionId: le,
382
+ setOpen: _,
383
+ setQuery: ce,
384
+ setActiveId: K,
385
+ select: Se
386
+ }, children: /* @__PURE__ */ N(Ke, { open: E, onOpenChange: _, placement: "bottom-start", children: [
387
+ /* @__PURE__ */ r(
388
+ "input",
389
+ {
390
+ ref: de,
391
+ type: "hidden",
392
+ name: A,
393
+ form: s,
394
+ value: q?.value ?? "",
395
+ disabled: T
396
+ }
397
+ ),
398
+ e
399
+ ] }) });
400
+ }
401
+ const Ye = o.forwardRef(
402
+ ({
403
+ className: e,
404
+ onChange: t,
405
+ onFocus: a,
406
+ onClick: l,
407
+ onBlur: p,
408
+ onKeyDown: v,
409
+ onCompositionStart: b,
410
+ onCompositionEnd: C,
411
+ readOnly: g,
412
+ required: R,
413
+ form: O,
414
+ ...x
415
+ }, I) => {
416
+ const m = Ne(), T = m.composingRef, { inputRef: A, selected: s, query: D, open: u, disabled: P, creating: c } = m;
417
+ o.useEffect(() => {
418
+ A.current?.setCustomValidity(R && !s ? "Please select an option." : "");
419
+ }, [A, R, s]);
420
+ function S(d) {
421
+ if (v?.(d), !(d.defaultPrevented || T.current || d.nativeEvent.isComposing || d.keyCode === 229 || g))
422
+ if (d.key === "ArrowDown" || d.key === "ArrowUp") {
423
+ d.preventDefault(), m.setOpen(!0);
424
+ const w = m.entries, j = w.findIndex((J) => J.id === m.activeId), M = d.key === "ArrowDown" ? (j + 1) % w.length : j < 0 ? w.length - 1 : (j - 1 + w.length) % w.length;
425
+ m.setActiveId(w[M]?.id ?? null);
426
+ } else if (d.key === "Enter" && u) {
427
+ d.preventDefault();
428
+ const w = m.entries.find((j) => j.id === m.activeId);
429
+ w && m.select(w);
430
+ } else d.key === "Escape" && u && (d.preventDefault(), d.stopPropagation(), m.setOpen(!1));
431
+ }
432
+ return /* @__PURE__ */ r(Me, { asChild: !0, children: /* @__PURE__ */ N("div", { className: "comal-ui relative w-full", children: [
433
+ /* @__PURE__ */ r(
434
+ ve,
435
+ {
436
+ ...x,
437
+ ref: (d) => {
438
+ A.current = d, typeof I == "function" ? I(d) : I && (I.current = d);
439
+ },
440
+ className: i("pr-8", e),
441
+ type: "text",
442
+ role: "combobox",
443
+ autoComplete: "off",
444
+ "aria-autocomplete": "list",
445
+ "aria-haspopup": "listbox",
446
+ "aria-expanded": u,
447
+ "aria-controls": u ? m.listId : void 0,
448
+ "aria-activedescendant": u ? m.activeId ?? void 0 : void 0,
449
+ "aria-describedby": [x["aria-describedby"], u ? m.statusId : null].filter(Boolean).join(" ") || void 0,
450
+ "aria-busy": m.loading || c || x["aria-busy"],
451
+ "aria-readonly": g || c || x["aria-readonly"],
452
+ "aria-required": R || x["aria-required"],
453
+ value: u ? D : s?.label ?? "",
454
+ disabled: P,
455
+ readOnly: g,
456
+ required: R && !s,
457
+ form: O ?? m.form,
458
+ onChange: (d) => {
459
+ t?.(d), !(d.defaultPrevented || g || c) && (m.setQuery(d.target.value), m.setOpen(!0));
460
+ },
461
+ onFocus: (d) => {
462
+ a?.(d), !d.defaultPrevented && !g && m.setOpen(!0);
463
+ },
464
+ onClick: (d) => {
465
+ l?.(d), !d.defaultPrevented && !g && m.setOpen(!0);
466
+ },
467
+ onBlur: p,
468
+ onKeyDown: S,
469
+ onCompositionStart: (d) => {
470
+ T.current = !0, b?.(d);
471
+ },
472
+ onCompositionEnd: (d) => {
473
+ T.current = !1, C?.(d);
474
+ }
475
+ }
476
+ ),
477
+ /* @__PURE__ */ r(ie, { "aria-hidden": "true", className: "pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted" })
478
+ ] }) });
479
+ }
480
+ );
481
+ Ye.displayName = "ComboboxInput";
482
+ const Je = o.forwardRef(
483
+ ({
484
+ className: e,
485
+ emptyText: t = "No options found.",
486
+ loadingText: a = "Loading options…",
487
+ creatingText: l = "Creating option…",
488
+ createErrorText: p = "Could not create the option. Try again.",
489
+ renderCreateLabel: v = (s) => `Create “${s}”`,
490
+ renderOption: b = (s) => s.label,
491
+ getStatusText: C = (s, D) => `${s} ${s === 1 ? "option" : "options"} available.${D ? " You can also create an option." : ""}`,
492
+ onOpenAutoFocus: g,
493
+ onCloseAutoFocus: R,
494
+ onInteractOutside: O,
495
+ onEscapeKeyDown: x,
496
+ onPointerDown: I,
497
+ "aria-label": m = "Suggestions",
498
+ ...T
499
+ }, A) => {
500
+ const s = Ne(), D = o.useRef(s);
501
+ o.useEffect(() => {
502
+ s.open && (D.current = s);
503
+ }, [s]);
504
+ const u = s.open ? s : D.current;
505
+ o.useEffect(() => {
506
+ s.open && s.activeId && s.inputRef.current?.ownerDocument.getElementById(s.activeId)?.scrollIntoView({ block: "nearest" });
507
+ }, [s.open, s.activeId, s.inputRef]);
508
+ const P = u.creating ? l : u.loading ? a : u.error || (u.creationFailed ? p : u.options.length === 0 && !u.createId ? t : null);
509
+ return /* @__PURE__ */ N(
510
+ xe,
511
+ {
512
+ ...T,
513
+ ref: A,
514
+ role: "presentation",
515
+ className: i("w-[var(--radix-popover-trigger-width)] p-1", e),
516
+ onOpenAutoFocus: (c) => {
517
+ g?.(c), c.preventDefault();
518
+ },
519
+ onCloseAutoFocus: (c) => {
520
+ R?.(c), c.preventDefault();
521
+ },
522
+ onInteractOutside: (c) => {
523
+ O?.(c), c.target === s.inputRef.current && c.preventDefault();
524
+ },
525
+ onEscapeKeyDown: (c) => {
526
+ x?.(c), (s.composingRef.current || c.isComposing || c.keyCode === 229) && c.preventDefault();
527
+ },
528
+ onPointerDown: (c) => {
529
+ I?.(c), c.preventDefault();
530
+ },
531
+ children: [
532
+ /* @__PURE__ */ N(
533
+ "div",
534
+ {
535
+ id: s.listId,
536
+ role: "listbox",
537
+ "aria-label": m,
538
+ "aria-busy": u.loading || u.creating || void 0,
539
+ children: [
540
+ u.options.map((c) => {
541
+ const S = s.optionId(c);
542
+ return /* @__PURE__ */ N(
543
+ "div",
544
+ {
545
+ id: S,
546
+ role: "option",
547
+ "aria-selected": s.selected?.value === c.value,
548
+ "aria-disabled": c.disabled || u.creating || void 0,
549
+ "data-highlighted": u.activeId === S ? "" : void 0,
550
+ className: "comal-ui relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground aria-disabled:opacity-disabled",
551
+ onPointerMove: () => {
552
+ !c.disabled && !s.creating && s.setActiveId(S);
553
+ },
554
+ onClick: () => s.select({ id: S, option: c }),
555
+ children: [
556
+ b(c),
557
+ s.selected?.value === c.value && /* @__PURE__ */ r(re, { "aria-hidden": "true", className: "absolute right-2 h-4 w-4" })
558
+ ]
559
+ },
560
+ c.value
561
+ );
562
+ }),
563
+ u.createId && /* @__PURE__ */ r(
564
+ "div",
565
+ {
566
+ id: u.createId,
567
+ role: "option",
568
+ "aria-selected": "false",
569
+ "data-highlighted": u.activeId === u.createId ? "" : void 0,
570
+ className: "comal-ui cursor-default select-none rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
571
+ onPointerMove: () => s.setActiveId(u.createId),
572
+ onClick: () => s.select({ id: u.createId }),
573
+ children: v(u.query.trim())
574
+ }
575
+ )
576
+ ]
577
+ }
578
+ ),
579
+ /* @__PURE__ */ r(
580
+ "div",
581
+ {
582
+ id: s.statusId,
583
+ role: "status",
584
+ "aria-live": "polite",
585
+ "aria-atomic": "true",
586
+ className: i(
587
+ "comal-ui",
588
+ P ? "px-2 py-1.5 text-sm" : "sr-only",
589
+ P && (u.creationFailed ? "text-destructive" : "text-muted")
590
+ ),
591
+ children: P ?? C(u.options.length, !!u.createId)
592
+ }
593
+ )
594
+ ]
595
+ }
596
+ );
597
+ }
598
+ );
599
+ Je.displayName = "ComboboxContent";
600
+ const Et = y.Root, Ot = y.Trigger, We = y.Portal, At = y.Close, Ce = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
601
+ y.Overlay,
222
602
  {
223
603
  ref: a,
224
- className: r(
604
+ className: i(
225
605
  "comal-ui",
226
606
  "fixed inset-0 z-overlay bg-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
227
607
  e
@@ -229,37 +609,37 @@ const Pe = d.Root, Se = d.Trigger, q = d.Portal, ke = d.Close, S = i.forwardRef(
229
609
  ...t
230
610
  }
231
611
  ));
232
- S.displayName = d.Overlay.displayName;
233
- const J = i.forwardRef(({ className: e, container: t, children: a, ...s }, c) => /* @__PURE__ */ u(q, { container: t, children: [
234
- /* @__PURE__ */ o(S, {}),
235
- /* @__PURE__ */ u(
236
- d.Content,
612
+ Ce.displayName = y.Overlay.displayName;
613
+ const Ze = o.forwardRef(({ className: e, container: t, children: a, ...l }, p) => /* @__PURE__ */ N(We, { container: t, children: [
614
+ /* @__PURE__ */ r(Ce, {}),
615
+ /* @__PURE__ */ N(
616
+ y.Content,
237
617
  {
238
- ref: c,
239
- className: r(
618
+ ref: p,
619
+ className: i(
240
620
  "comal-ui",
241
621
  "fixed left-[50%] top-[50%] z-overlay grid text-primary w-[calc(100%-2rem)] max-w-lg max-h-[calc(100dvh-2rem)] overflow-y-auto translate-x-[-50%] translate-y-[-50%] gap-4 border surface-primary p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
242
622
  e
243
623
  ),
244
- ...s,
624
+ ...l,
245
625
  children: [
246
626
  a,
247
- /* @__PURE__ */ u(d.Close, { className: "comal-ui absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted", children: [
248
- /* @__PURE__ */ o(T, { className: "h-4 w-4" }),
249
- /* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
627
+ /* @__PURE__ */ N(y.Close, { className: "comal-ui absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted", children: [
628
+ /* @__PURE__ */ r(ge, { className: "h-4 w-4" }),
629
+ /* @__PURE__ */ r("span", { className: "sr-only", children: "Close" })
250
630
  ] })
251
631
  ]
252
632
  }
253
633
  )
254
634
  ] }));
255
- J.displayName = d.Content.displayName;
256
- const K = ({
635
+ Ze.displayName = y.Content.displayName;
636
+ const et = ({
257
637
  className: e,
258
638
  ...t
259
- }) => /* @__PURE__ */ o(
639
+ }) => /* @__PURE__ */ r(
260
640
  "div",
261
641
  {
262
- className: r(
642
+ className: i(
263
643
  "comal-ui",
264
644
  "flex flex-col space-y-1.5 text-center sm:text-left",
265
645
  e
@@ -267,14 +647,14 @@ const K = ({
267
647
  ...t
268
648
  }
269
649
  );
270
- K.displayName = "DialogHeader";
271
- const M = ({
650
+ et.displayName = "DialogHeader";
651
+ const tt = ({
272
652
  className: e,
273
653
  ...t
274
- }) => /* @__PURE__ */ o(
654
+ }) => /* @__PURE__ */ r(
275
655
  "div",
276
656
  {
277
- className: r(
657
+ className: i(
278
658
  "comal-ui",
279
659
  "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
280
660
  e
@@ -282,12 +662,12 @@ const M = ({
282
662
  ...t
283
663
  }
284
664
  );
285
- M.displayName = "DialogFooter";
286
- const Q = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
287
- d.Title,
665
+ tt.displayName = "DialogFooter";
666
+ const at = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
667
+ y.Title,
288
668
  {
289
669
  ref: a,
290
- className: r(
670
+ className: i(
291
671
  "comal-ui",
292
672
  "comal-heading text-lg font-semibold leading-none tracking-tight",
293
673
  e
@@ -295,21 +675,21 @@ const Q = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
295
675
  ...t
296
676
  }
297
677
  ));
298
- Q.displayName = d.Title.displayName;
299
- const W = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
300
- d.Description,
678
+ at.displayName = y.Title.displayName;
679
+ const ot = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
680
+ y.Description,
301
681
  {
302
682
  ref: a,
303
- className: r("comal-ui", "text-sm text-muted", e),
683
+ className: i("comal-ui", "text-sm text-muted", e),
304
684
  ...t
305
685
  }
306
686
  ));
307
- W.displayName = d.Description.displayName;
308
- const Y = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
687
+ ot.displayName = y.Description.displayName;
688
+ const rt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
309
689
  "div",
310
690
  {
311
691
  ref: a,
312
- className: r(
692
+ className: i(
313
693
  "comal-ui",
314
694
  "rounded-xl border surface-raised text-primary shadow",
315
695
  e
@@ -317,12 +697,12 @@ const Y = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
317
697
  ...t
318
698
  }
319
699
  ));
320
- Y.displayName = "Card";
321
- const Z = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
700
+ rt.displayName = "Card";
701
+ const it = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
322
702
  "div",
323
703
  {
324
704
  ref: a,
325
- className: r(
705
+ className: i(
326
706
  "comal-ui",
327
707
  "flex flex-col space-y-1.5 p-6",
328
708
  e
@@ -330,12 +710,12 @@ const Z = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
330
710
  ...t
331
711
  }
332
712
  ));
333
- Z.displayName = "CardHeader";
334
- const $ = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
713
+ it.displayName = "CardHeader";
714
+ const st = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
335
715
  "div",
336
716
  {
337
717
  ref: a,
338
- className: r(
718
+ className: i(
339
719
  "comal-ui",
340
720
  "comal-heading font-semibold leading-none tracking-tight",
341
721
  e
@@ -343,30 +723,30 @@ const $ = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
343
723
  ...t
344
724
  }
345
725
  ));
346
- $.displayName = "CardTitle";
347
- const ee = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
726
+ st.displayName = "CardTitle";
727
+ const nt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
348
728
  "div",
349
729
  {
350
730
  ref: a,
351
- className: r("comal-ui", "text-sm text-muted", e),
731
+ className: i("comal-ui", "text-sm text-muted", e),
352
732
  ...t
353
733
  }
354
734
  ));
355
- ee.displayName = "CardDescription";
356
- const te = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
735
+ nt.displayName = "CardDescription";
736
+ const dt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
357
737
  "div",
358
738
  {
359
739
  ref: a,
360
- className: r("comal-ui", "p-6 pt-0", e),
740
+ className: i("comal-ui", "p-6 pt-0", e),
361
741
  ...t
362
742
  }
363
743
  ));
364
- te.displayName = "CardContent";
365
- const ae = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
744
+ dt.displayName = "CardContent";
745
+ const lt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
366
746
  "div",
367
747
  {
368
748
  ref: a,
369
- className: r(
749
+ className: i(
370
750
  "comal-ui",
371
751
  "flex items-center p-6 pt-0",
372
752
  e
@@ -374,8 +754,8 @@ const ae = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
374
754
  ...t
375
755
  }
376
756
  ));
377
- ae.displayName = "CardFooter";
378
- const oe = x(
757
+ lt.displayName = "CardFooter";
758
+ const ct = Y(
379
759
  "comal-ui inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
380
760
  {
381
761
  variants: {
@@ -391,41 +771,41 @@ const oe = x(
391
771
  }
392
772
  }
393
773
  );
394
- function ze({ className: e, variant: t, ...a }) {
395
- return /* @__PURE__ */ o("div", { className: r(oe({ variant: t }), e), ...a });
774
+ function jt({ className: e, variant: t, ...a }) {
775
+ return /* @__PURE__ */ r("div", { className: i(ct({ variant: t }), e), ...a });
396
776
  }
397
- const re = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
398
- h.Root,
777
+ const ut = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
778
+ oe.Root,
399
779
  {
400
780
  ref: a,
401
- className: r(
781
+ className: i(
402
782
  "comal-ui",
403
783
  "grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-action shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-disabled aria-[invalid=true]:border-destructive data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground",
404
784
  e
405
785
  ),
406
786
  ...t,
407
- children: /* @__PURE__ */ u(
408
- h.Indicator,
787
+ children: /* @__PURE__ */ N(
788
+ oe.Indicator,
409
789
  {
410
790
  "data-slot": "checkbox-indicator",
411
- className: r(
791
+ className: i(
412
792
  "comal-ui",
413
793
  "grid place-content-center text-current"
414
794
  ),
415
795
  children: [
416
- /* @__PURE__ */ o(C, { className: "h-4 w-4", "data-check-icon": "" }),
417
- /* @__PURE__ */ o(I, { className: "h-4 w-4", "data-mixed-icon": "" })
796
+ /* @__PURE__ */ r(re, { className: "h-4 w-4", "data-check-icon": "" }),
797
+ /* @__PURE__ */ r(Ae, { className: "h-4 w-4", "data-mixed-icon": "" })
418
798
  ]
419
799
  }
420
800
  )
421
801
  }
422
802
  ));
423
- re.displayName = h.Root.displayName;
424
- const Ve = p.Root, ie = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
425
- p.List,
803
+ ut.displayName = oe.Root.displayName;
804
+ const Lt = B.Root, mt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
805
+ B.List,
426
806
  {
427
807
  ref: a,
428
- className: r(
808
+ className: i(
429
809
  "comal-ui",
430
810
  "inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted data-[orientation=vertical]:h-auto data-[orientation=vertical]:flex-col",
431
811
  e
@@ -433,12 +813,12 @@ const Ve = p.Root, ie = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__
433
813
  ...t
434
814
  }
435
815
  ));
436
- ie.displayName = p.List.displayName;
437
- const se = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
438
- p.Trigger,
816
+ mt.displayName = B.List.displayName;
817
+ const ft = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
818
+ B.Trigger,
439
819
  {
440
820
  ref: a,
441
- className: r(
821
+ className: i(
442
822
  "comal-ui",
443
823
  "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:surface-primary data-[state=active]:text-primary data-[state=active]:shadow",
444
824
  e
@@ -446,12 +826,12 @@ const se = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
446
826
  ...t
447
827
  }
448
828
  ));
449
- se.displayName = p.Trigger.displayName;
450
- const ne = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
451
- p.Content,
829
+ ft.displayName = B.Trigger.displayName;
830
+ const pt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
831
+ B.Content,
452
832
  {
453
833
  ref: a,
454
- className: r(
834
+ className: i(
455
835
  "comal-ui",
456
836
  "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
457
837
  e
@@ -459,12 +839,12 @@ const ne = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
459
839
  ...t
460
840
  }
461
841
  ));
462
- ne.displayName = p.Content.displayName;
463
- const je = l.Provider, de = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
464
- l.Viewport,
842
+ pt.displayName = B.Content.displayName;
843
+ const Bt = h.Provider, gt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
844
+ h.Viewport,
465
845
  {
466
846
  ref: a,
467
- className: r(
847
+ className: i(
468
848
  "comal-ui",
469
849
  "fixed top-0 z-toast flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[var(--toast-width)]",
470
850
  e
@@ -472,8 +852,8 @@ const je = l.Provider, de = i.forwardRef(({ className: e, ...t }, a) => /* @__PU
472
852
  ...t
473
853
  }
474
854
  ));
475
- de.displayName = l.Viewport.displayName;
476
- const le = x(
855
+ gt.displayName = h.Viewport.displayName;
856
+ const vt = Y(
477
857
  "group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
478
858
  {
479
859
  variants: {
@@ -486,20 +866,20 @@ const le = x(
486
866
  variant: "default"
487
867
  }
488
868
  }
489
- ), ce = i.forwardRef(({ className: e, variant: t, ...a }, s) => /* @__PURE__ */ o(
490
- l.Root,
869
+ ), bt = o.forwardRef(({ className: e, variant: t, ...a }, l) => /* @__PURE__ */ r(
870
+ h.Root,
491
871
  {
492
- ref: s,
493
- className: r("comal-ui", le({ variant: t }), e),
872
+ ref: l,
873
+ className: i("comal-ui", vt({ variant: t }), e),
494
874
  ...a
495
875
  }
496
876
  ));
497
- ce.displayName = l.Root.displayName;
498
- const me = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
499
- l.Action,
877
+ bt.displayName = h.Root.displayName;
878
+ const yt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
879
+ h.Action,
500
880
  {
501
881
  ref: a,
502
- className: r(
882
+ className: i(
503
883
  "comal-ui",
504
884
  "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
505
885
  e
@@ -507,12 +887,12 @@ const me = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
507
887
  ...t
508
888
  }
509
889
  ));
510
- me.displayName = l.Action.displayName;
511
- const ue = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
512
- l.Close,
890
+ yt.displayName = h.Action.displayName;
891
+ const ht = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
892
+ h.Close,
513
893
  {
514
894
  ref: a,
515
- className: r(
895
+ className: i(
516
896
  "comal-ui",
517
897
  "absolute right-1 top-1 rounded-md p-1 text-primary/50 opacity-0 transition-opacity hover:text-primary focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-destructive-foreground/80 group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive-foreground group-[.destructive]:focus:ring-offset-destructive",
518
898
  e
@@ -520,15 +900,15 @@ const ue = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
520
900
  "aria-label": "Dismiss notification",
521
901
  "toast-close": "",
522
902
  ...t,
523
- children: /* @__PURE__ */ o(T, { className: "h-4 w-4" })
903
+ children: /* @__PURE__ */ r(ge, { className: "h-4 w-4" })
524
904
  }
525
905
  ));
526
- ue.displayName = l.Close.displayName;
527
- const pe = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
528
- l.Title,
906
+ ht.displayName = h.Close.displayName;
907
+ const xt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
908
+ h.Title,
529
909
  {
530
910
  ref: a,
531
- className: r(
911
+ className: i(
532
912
  "comal-ui",
533
913
  "text-sm font-semibold [&+div]:text-xs",
534
914
  e
@@ -536,133 +916,88 @@ const pe = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
536
916
  ...t
537
917
  }
538
918
  ));
539
- pe.displayName = l.Title.displayName;
540
- const fe = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
541
- l.Description,
919
+ xt.displayName = h.Title.displayName;
920
+ const wt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
921
+ h.Description,
542
922
  {
543
923
  ref: a,
544
- className: r("comal-ui", "text-sm opacity-90", e),
924
+ className: i("comal-ui", "text-sm opacity-90", e),
545
925
  ...t
546
926
  }
547
927
  ));
548
- fe.displayName = l.Description.displayName;
549
- const Ie = f.Provider, Be = f.Root, Le = f.Trigger, ge = i.forwardRef(({ className: e, container: t, sideOffset: a = 4, ...s }, c) => /* @__PURE__ */ o(f.Portal, { container: t, children: /* @__PURE__ */ o(
550
- f.Content,
928
+ wt.displayName = h.Description.displayName;
929
+ const Ft = $.Provider, Vt = $.Root, $t = $.Trigger, Nt = o.forwardRef(({ className: e, container: t, sideOffset: a = 4, ...l }, p) => /* @__PURE__ */ r($.Portal, { container: t, children: /* @__PURE__ */ r(
930
+ $.Content,
551
931
  {
552
- ref: c,
932
+ ref: p,
553
933
  sideOffset: a,
554
- className: r(
934
+ className: i(
555
935
  "comal-ui",
556
936
  "z-popover max-w-[var(--tooltip-width)] overflow-hidden rounded-md surface-inverse px-3 py-1.5 text-xs text-inverse animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",
557
937
  e
558
938
  ),
559
- ...s
939
+ ...l
560
940
  }
561
941
  ) }));
562
- ge.displayName = f.Content.displayName;
563
- const Oe = m.Anchor, k = i.createContext({ side: "bottom", align: "center", sideOffset: 4 });
564
- function Ae({ placement: e = "bottom", sideOffset: t = 4, ...a }) {
565
- const [s, c = "center"] = e.split("-");
566
- return /* @__PURE__ */ o(k.Provider, { value: { side: s, align: c, sideOffset: t }, children: /* @__PURE__ */ o(m.Root, { ...a }) });
567
- }
568
- const ve = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
569
- m.Trigger,
570
- {
571
- ref: a,
572
- className: r("comal-ui", e),
573
- ...t
574
- }
575
- ));
576
- ve.displayName = m.Trigger.displayName;
577
- const ye = i.forwardRef(({ container: e, className: t, collisionPadding: a = 8, forceMount: s, ...c }, g) => {
578
- const v = i.useContext(k), y = e && "current" in e ? e : void 0, [b, w] = i.useState(null);
579
- if (i.useEffect(() => {
580
- w(y?.current ?? null);
581
- }, [y]), y && !b) return null;
582
- const z = e && "current" in e ? b : e;
583
- return /* @__PURE__ */ o(m.Portal, { container: z, forceMount: s, children: /* @__PURE__ */ o(
584
- m.Content,
585
- {
586
- ref: g,
587
- side: v.side,
588
- align: v.align,
589
- sideOffset: v.sideOffset,
590
- collisionPadding: a,
591
- forceMount: s,
592
- className: r(
593
- "comal-ui",
594
- "z-popover w-72 max-w-[var(--radix-popover-content-available-width)] max-h-[var(--radix-popover-content-available-height)] overflow-y-auto rounded-md border bg-popover p-4 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",
595
- t
596
- ),
597
- ...c
598
- }
599
- ) });
600
- });
601
- ye.displayName = m.Content.displayName;
602
- const be = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
603
- m.Close,
604
- {
605
- ref: a,
606
- className: r("comal-ui", e),
607
- ...t
608
- }
609
- ));
610
- be.displayName = m.Close.displayName;
942
+ Nt.displayName = $.Content.displayName;
611
943
  export {
612
- ze as Badge,
613
- L as Button,
614
- Y as Card,
615
- te as CardContent,
616
- ee as CardDescription,
617
- ae as CardFooter,
618
- Z as CardHeader,
619
- $ as CardTitle,
620
- re as Checkbox,
621
- Pe as Dialog,
622
- ke as DialogClose,
623
- J as DialogContent,
624
- W as DialogDescription,
625
- M as DialogFooter,
626
- K as DialogHeader,
627
- S as DialogOverlay,
628
- q as DialogPortal,
629
- Q as DialogTitle,
630
- Se as DialogTrigger,
631
- O as Input,
632
- H as Label,
633
- Ae as Popover,
634
- Oe as PopoverAnchor,
635
- be as PopoverClose,
636
- ye as PopoverContent,
637
- ve as PopoverTrigger,
638
- Re as Select,
639
- _ as SelectContent,
640
- Te as SelectGroup,
641
- E as SelectItem,
642
- G as SelectLabel,
643
- P as SelectScrollDownButton,
644
- D as SelectScrollUpButton,
645
- X as SelectSeparator,
646
- U as SelectTrigger,
647
- De as SelectValue,
648
- Ve as Tabs,
649
- ne as TabsContent,
650
- ie as TabsList,
651
- se as TabsTrigger,
652
- A as Textarea,
653
- ce as Toast,
654
- me as ToastAction,
655
- ue as ToastClose,
656
- fe as ToastDescription,
657
- je as ToastProvider,
658
- pe as ToastTitle,
659
- de as ToastViewport,
660
- Be as Tooltip,
661
- ge as TooltipContent,
662
- Ie as TooltipProvider,
663
- Le as TooltipTrigger,
664
- oe as badgeVariants,
665
- B as buttonVariants,
666
- r as cn
944
+ jt as Badge,
945
+ Le as Button,
946
+ rt as Card,
947
+ dt as CardContent,
948
+ nt as CardDescription,
949
+ lt as CardFooter,
950
+ it as CardHeader,
951
+ st as CardTitle,
952
+ ut as Checkbox,
953
+ zt as Combobox,
954
+ Je as ComboboxContent,
955
+ Ye as ComboboxInput,
956
+ Et as Dialog,
957
+ At as DialogClose,
958
+ Ze as DialogContent,
959
+ ot as DialogDescription,
960
+ tt as DialogFooter,
961
+ et as DialogHeader,
962
+ Ce as DialogOverlay,
963
+ We as DialogPortal,
964
+ at as DialogTitle,
965
+ Ot as DialogTrigger,
966
+ ve as Input,
967
+ Ve as Label,
968
+ Ke as Popover,
969
+ Me as PopoverAnchor,
970
+ Ge as PopoverClose,
971
+ xe as PopoverContent,
972
+ _e as PopoverTrigger,
973
+ Pt as Select,
974
+ Ue as SelectContent,
975
+ St as SelectGroup,
976
+ Qe as SelectItem,
977
+ qe as SelectLabel,
978
+ ye as SelectScrollDownButton,
979
+ be as SelectScrollUpButton,
980
+ He as SelectSeparator,
981
+ $e as SelectTrigger,
982
+ kt as SelectValue,
983
+ Lt as Tabs,
984
+ pt as TabsContent,
985
+ mt as TabsList,
986
+ ft as TabsTrigger,
987
+ Be as Textarea,
988
+ bt as Toast,
989
+ yt as ToastAction,
990
+ ht as ToastClose,
991
+ wt as ToastDescription,
992
+ Bt as ToastProvider,
993
+ xt as ToastTitle,
994
+ gt as ToastViewport,
995
+ Vt as Tooltip,
996
+ Nt as TooltipContent,
997
+ Ft as TooltipProvider,
998
+ $t as TooltipTrigger,
999
+ ct as badgeVariants,
1000
+ je as buttonVariants,
1001
+ i as cn
667
1002
  };
668
1003
  //# sourceMappingURL=index.js.map