@darthcharles/greda 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,17 +1,18 @@
1
- import { jsx as o, jsxs as m } from "react/jsx-runtime";
2
- import * as i from "react";
3
- import { Slot as S } from "@radix-ui/react-slot";
4
- import { cva as f } from "class-variance-authority";
5
- import { cn as r } from "./utils.js";
6
- import * as y from "@radix-ui/react-label";
7
- import * as s from "@radix-ui/react-select";
8
- import { Check as b, ChevronDown as x, ChevronUp as k, X as h, Minus as P } from "lucide-react";
9
- import * as n from "@radix-ui/react-dialog";
10
- import * as v from "@radix-ui/react-checkbox";
11
- import * as u from "@radix-ui/react-tabs";
12
- import * as l from "@radix-ui/react-toast";
13
- import * as p from "@radix-ui/react-tooltip";
14
- const z = f(
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(
15
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",
16
17
  {
17
18
  variants: {
@@ -35,49 +36,49 @@ const z = f(
35
36
  size: "default"
36
37
  }
37
38
  }
38
- ), V = i.forwardRef(
39
+ ), Le = o.forwardRef(
39
40
  ({
40
41
  className: e,
41
42
  variant: t,
42
43
  size: a,
43
- asChild: d = !1,
44
- loading: c = !1,
45
- disabled: g,
46
- type: C,
47
- ...T
48
- }, D) => /* @__PURE__ */ o(
49
- d ? S : "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",
50
51
  {
51
- className: r(z({ variant: t, size: a, className: e })),
52
- ref: D,
53
- type: d ? void 0 : C ?? "button",
54
- disabled: d ? void 0 : g || c,
55
- "aria-busy": c || void 0,
56
- ...T
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
57
58
  }
58
59
  )
59
60
  );
60
- V.displayName = "Button";
61
- const j = i.forwardRef(
62
- ({ className: e, type: t, ...a }, d) => /* @__PURE__ */ o(
61
+ Le.displayName = "Button";
62
+ const ve = o.forwardRef(
63
+ ({ className: e, type: t, ...a }, l) => /* @__PURE__ */ r(
63
64
  "input",
64
65
  {
65
66
  type: t,
66
- className: r(
67
+ className: i(
67
68
  "comal-ui",
68
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",
69
70
  e
70
71
  ),
71
- ref: d,
72
+ ref: l,
72
73
  ...a
73
74
  }
74
75
  )
75
76
  );
76
- j.displayName = "Input";
77
- const I = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
77
+ ve.displayName = "Input";
78
+ const Be = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
78
79
  "textarea",
79
80
  {
80
- className: r(
81
+ className: i(
81
82
  "comal-ui",
82
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",
83
84
  e
@@ -86,23 +87,23 @@ const I = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
86
87
  ...t
87
88
  }
88
89
  ));
89
- I.displayName = "Textarea";
90
- const B = f(
90
+ Be.displayName = "Textarea";
91
+ const Fe = Y(
91
92
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
92
- ), L = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
93
- y.Root,
93
+ ), Ve = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
94
+ pe.Root,
94
95
  {
95
96
  ref: a,
96
- className: r("comal-ui", B(), e),
97
+ className: i("comal-ui", Fe(), e),
97
98
  ...t
98
99
  }
99
100
  ));
100
- L.displayName = y.Root.displayName;
101
- const be = s.Root, xe = s.Group, he = s.Value, F = i.forwardRef(({ className: e, children: t, ...a }, d) => /* @__PURE__ */ m(
102
- s.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,
103
104
  {
104
- ref: d,
105
- className: r(
105
+ ref: l,
106
+ className: i(
106
107
  "comal-ui",
107
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",
108
109
  e
@@ -110,74 +111,74 @@ const be = s.Root, xe = s.Group, he = s.Value, F = i.forwardRef(({ className: e,
110
111
  ...a,
111
112
  children: [
112
113
  t,
113
- /* @__PURE__ */ o(s.Icon, { asChild: !0, children: /* @__PURE__ */ o(x, { 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" }) })
114
115
  ]
115
116
  }
116
117
  ));
117
- F.displayName = s.Trigger.displayName;
118
- const w = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
119
- s.ScrollUpButton,
118
+ $e.displayName = f.Trigger.displayName;
119
+ const be = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
120
+ f.ScrollUpButton,
120
121
  {
121
122
  ref: a,
122
- className: r(
123
+ className: i(
123
124
  "comal-ui",
124
125
  "flex cursor-default items-center justify-center py-1",
125
126
  e
126
127
  ),
127
128
  ...t,
128
- children: /* @__PURE__ */ o(k, { className: "h-4 w-4" })
129
+ children: /* @__PURE__ */ r(Oe, { className: "h-4 w-4" })
129
130
  }
130
131
  ));
131
- w.displayName = s.ScrollUpButton.displayName;
132
- const N = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
133
- s.ScrollDownButton,
132
+ be.displayName = f.ScrollUpButton.displayName;
133
+ const ye = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
134
+ f.ScrollDownButton,
134
135
  {
135
136
  ref: a,
136
- className: r(
137
+ className: i(
137
138
  "comal-ui",
138
139
  "flex cursor-default items-center justify-center py-1",
139
140
  e
140
141
  ),
141
142
  ...t,
142
- children: /* @__PURE__ */ o(x, { className: "h-4 w-4" })
143
+ children: /* @__PURE__ */ r(ie, { className: "h-4 w-4" })
143
144
  }
144
145
  ));
145
- N.displayName = s.ScrollDownButton.displayName;
146
- const H = i.forwardRef(({ className: e, container: t, children: a, position: d = "popper", ...c }, g) => /* @__PURE__ */ o(s.Portal, { container: t, children: /* @__PURE__ */ m(
147
- s.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,
148
149
  {
149
- ref: g,
150
- className: r(
150
+ ref: v,
151
+ className: i(
151
152
  "comal-ui",
152
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]",
153
- d === "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",
154
155
  e
155
156
  ),
156
- position: d,
157
- ...c,
157
+ position: l,
158
+ ...p,
158
159
  children: [
159
- /* @__PURE__ */ o(w, {}),
160
- /* @__PURE__ */ o(
161
- s.Viewport,
160
+ /* @__PURE__ */ r(be, {}),
161
+ /* @__PURE__ */ r(
162
+ f.Viewport,
162
163
  {
163
- className: r(
164
+ className: i(
164
165
  "comal-ui",
165
166
  "p-1",
166
- d === "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)]"
167
168
  ),
168
169
  children: a
169
170
  }
170
171
  ),
171
- /* @__PURE__ */ o(N, {})
172
+ /* @__PURE__ */ r(ye, {})
172
173
  ]
173
174
  }
174
175
  ) }));
175
- H.displayName = s.Content.displayName;
176
- const U = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
177
- s.Label,
176
+ Ue.displayName = f.Content.displayName;
177
+ const qe = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
178
+ f.Label,
178
179
  {
179
180
  ref: a,
180
- className: r(
181
+ className: i(
181
182
  "comal-ui",
182
183
  "px-2 py-1.5 text-sm font-semibold",
183
184
  e
@@ -185,29 +186,29 @@ const U = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
185
186
  ...t
186
187
  }
187
188
  ));
188
- U.displayName = s.Label.displayName;
189
- const A = i.forwardRef(({ className: e, children: t, ...a }, d) => /* @__PURE__ */ m(
190
- s.Item,
189
+ qe.displayName = f.Label.displayName;
190
+ const Qe = o.forwardRef(({ className: e, children: t, ...a }, l) => /* @__PURE__ */ N(
191
+ f.Item,
191
192
  {
192
- ref: d,
193
- className: r(
193
+ ref: l,
194
+ className: i(
194
195
  "comal-ui",
195
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",
196
197
  e
197
198
  ),
198
199
  ...a,
199
200
  children: [
200
- /* @__PURE__ */ o("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o(s.ItemIndicator, { children: /* @__PURE__ */ o(b, { className: "h-4 w-4" }) }) }),
201
- /* @__PURE__ */ o(s.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 })
202
203
  ]
203
204
  }
204
205
  ));
205
- A.displayName = s.Item.displayName;
206
- const O = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
207
- s.Separator,
206
+ Qe.displayName = f.Item.displayName;
207
+ const He = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
208
+ f.Separator,
208
209
  {
209
210
  ref: a,
210
- className: r(
211
+ className: i(
211
212
  "comal-ui",
212
213
  "-mx-1 my-1 h-px bg-muted",
213
214
  e
@@ -215,12 +216,392 @@ const O = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
215
216
  ...t
216
217
  }
217
218
  ));
218
- O.displayName = s.Separator.displayName;
219
- const we = n.Root, Ne = n.Trigger, _ = n.Portal, Re = n.Close, R = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
220
- n.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,
221
602
  {
222
603
  ref: a,
223
- className: r(
604
+ className: i(
224
605
  "comal-ui",
225
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",
226
607
  e
@@ -228,37 +609,37 @@ const we = n.Root, Ne = n.Trigger, _ = n.Portal, Re = n.Close, R = i.forwardRef(
228
609
  ...t
229
610
  }
230
611
  ));
231
- R.displayName = n.Overlay.displayName;
232
- const G = i.forwardRef(({ className: e, container: t, children: a, ...d }, c) => /* @__PURE__ */ m(_, { container: t, children: [
233
- /* @__PURE__ */ o(R, {}),
234
- /* @__PURE__ */ m(
235
- n.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,
236
617
  {
237
- ref: c,
238
- className: r(
618
+ ref: p,
619
+ className: i(
239
620
  "comal-ui",
240
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",
241
622
  e
242
623
  ),
243
- ...d,
624
+ ...l,
244
625
  children: [
245
626
  a,
246
- /* @__PURE__ */ m(n.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: [
247
- /* @__PURE__ */ o(h, { className: "h-4 w-4" }),
248
- /* @__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" })
249
630
  ] })
250
631
  ]
251
632
  }
252
633
  )
253
634
  ] }));
254
- G.displayName = n.Content.displayName;
255
- const M = ({
635
+ Ze.displayName = y.Content.displayName;
636
+ const et = ({
256
637
  className: e,
257
638
  ...t
258
- }) => /* @__PURE__ */ o(
639
+ }) => /* @__PURE__ */ r(
259
640
  "div",
260
641
  {
261
- className: r(
642
+ className: i(
262
643
  "comal-ui",
263
644
  "flex flex-col space-y-1.5 text-center sm:text-left",
264
645
  e
@@ -266,14 +647,14 @@ const M = ({
266
647
  ...t
267
648
  }
268
649
  );
269
- M.displayName = "DialogHeader";
270
- const X = ({
650
+ et.displayName = "DialogHeader";
651
+ const tt = ({
271
652
  className: e,
272
653
  ...t
273
- }) => /* @__PURE__ */ o(
654
+ }) => /* @__PURE__ */ r(
274
655
  "div",
275
656
  {
276
- className: r(
657
+ className: i(
277
658
  "comal-ui",
278
659
  "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
279
660
  e
@@ -281,12 +662,12 @@ const X = ({
281
662
  ...t
282
663
  }
283
664
  );
284
- X.displayName = "DialogFooter";
285
- const q = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
286
- n.Title,
665
+ tt.displayName = "DialogFooter";
666
+ const at = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
667
+ y.Title,
287
668
  {
288
669
  ref: a,
289
- className: r(
670
+ className: i(
290
671
  "comal-ui",
291
672
  "comal-heading text-lg font-semibold leading-none tracking-tight",
292
673
  e
@@ -294,21 +675,21 @@ const q = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
294
675
  ...t
295
676
  }
296
677
  ));
297
- q.displayName = n.Title.displayName;
298
- const E = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
299
- n.Description,
678
+ at.displayName = y.Title.displayName;
679
+ const ot = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
680
+ y.Description,
300
681
  {
301
682
  ref: a,
302
- className: r("comal-ui", "text-sm text-muted", e),
683
+ className: i("comal-ui", "text-sm text-muted", e),
303
684
  ...t
304
685
  }
305
686
  ));
306
- E.displayName = n.Description.displayName;
307
- const J = 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(
308
689
  "div",
309
690
  {
310
691
  ref: a,
311
- className: r(
692
+ className: i(
312
693
  "comal-ui",
313
694
  "rounded-xl border surface-raised text-primary shadow",
314
695
  e
@@ -316,12 +697,12 @@ const J = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
316
697
  ...t
317
698
  }
318
699
  ));
319
- J.displayName = "Card";
320
- const K = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
700
+ rt.displayName = "Card";
701
+ const it = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
321
702
  "div",
322
703
  {
323
704
  ref: a,
324
- className: r(
705
+ className: i(
325
706
  "comal-ui",
326
707
  "flex flex-col space-y-1.5 p-6",
327
708
  e
@@ -329,12 +710,12 @@ const K = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
329
710
  ...t
330
711
  }
331
712
  ));
332
- K.displayName = "CardHeader";
333
- const Q = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
713
+ it.displayName = "CardHeader";
714
+ const st = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
334
715
  "div",
335
716
  {
336
717
  ref: a,
337
- className: r(
718
+ className: i(
338
719
  "comal-ui",
339
720
  "comal-heading font-semibold leading-none tracking-tight",
340
721
  e
@@ -342,30 +723,30 @@ const Q = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
342
723
  ...t
343
724
  }
344
725
  ));
345
- Q.displayName = "CardTitle";
346
- const W = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
726
+ st.displayName = "CardTitle";
727
+ const nt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
347
728
  "div",
348
729
  {
349
730
  ref: a,
350
- className: r("comal-ui", "text-sm text-muted", e),
731
+ className: i("comal-ui", "text-sm text-muted", e),
351
732
  ...t
352
733
  }
353
734
  ));
354
- W.displayName = "CardDescription";
355
- const Y = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
735
+ nt.displayName = "CardDescription";
736
+ const dt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
356
737
  "div",
357
738
  {
358
739
  ref: a,
359
- className: r("comal-ui", "p-6 pt-0", e),
740
+ className: i("comal-ui", "p-6 pt-0", e),
360
741
  ...t
361
742
  }
362
743
  ));
363
- Y.displayName = "CardContent";
364
- const Z = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
744
+ dt.displayName = "CardContent";
745
+ const lt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
365
746
  "div",
366
747
  {
367
748
  ref: a,
368
- className: r(
749
+ className: i(
369
750
  "comal-ui",
370
751
  "flex items-center p-6 pt-0",
371
752
  e
@@ -373,8 +754,8 @@ const Z = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
373
754
  ...t
374
755
  }
375
756
  ));
376
- Z.displayName = "CardFooter";
377
- const $ = f(
757
+ lt.displayName = "CardFooter";
758
+ const ct = Y(
378
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",
379
760
  {
380
761
  variants: {
@@ -390,41 +771,41 @@ const $ = f(
390
771
  }
391
772
  }
392
773
  );
393
- function Ce({ className: e, variant: t, ...a }) {
394
- return /* @__PURE__ */ o("div", { className: r($({ variant: t }), e), ...a });
774
+ function jt({ className: e, variant: t, ...a }) {
775
+ return /* @__PURE__ */ r("div", { className: i(ct({ variant: t }), e), ...a });
395
776
  }
396
- const ee = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
397
- v.Root,
777
+ const ut = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
778
+ oe.Root,
398
779
  {
399
780
  ref: a,
400
- className: r(
781
+ className: i(
401
782
  "comal-ui",
402
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",
403
784
  e
404
785
  ),
405
786
  ...t,
406
- children: /* @__PURE__ */ m(
407
- v.Indicator,
787
+ children: /* @__PURE__ */ N(
788
+ oe.Indicator,
408
789
  {
409
790
  "data-slot": "checkbox-indicator",
410
- className: r(
791
+ className: i(
411
792
  "comal-ui",
412
793
  "grid place-content-center text-current"
413
794
  ),
414
795
  children: [
415
- /* @__PURE__ */ o(b, { className: "h-4 w-4", "data-check-icon": "" }),
416
- /* @__PURE__ */ o(P, { 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": "" })
417
798
  ]
418
799
  }
419
800
  )
420
801
  }
421
802
  ));
422
- ee.displayName = v.Root.displayName;
423
- const Te = u.Root, te = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
424
- u.List,
803
+ ut.displayName = oe.Root.displayName;
804
+ const Lt = B.Root, mt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
805
+ B.List,
425
806
  {
426
807
  ref: a,
427
- className: r(
808
+ className: i(
428
809
  "comal-ui",
429
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",
430
811
  e
@@ -432,12 +813,12 @@ const Te = u.Root, te = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__
432
813
  ...t
433
814
  }
434
815
  ));
435
- te.displayName = u.List.displayName;
436
- const ae = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
437
- u.Trigger,
816
+ mt.displayName = B.List.displayName;
817
+ const ft = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
818
+ B.Trigger,
438
819
  {
439
820
  ref: a,
440
- className: r(
821
+ className: i(
441
822
  "comal-ui",
442
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",
443
824
  e
@@ -445,12 +826,12 @@ const ae = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
445
826
  ...t
446
827
  }
447
828
  ));
448
- ae.displayName = u.Trigger.displayName;
449
- const oe = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
450
- u.Content,
829
+ ft.displayName = B.Trigger.displayName;
830
+ const pt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
831
+ B.Content,
451
832
  {
452
833
  ref: a,
453
- className: r(
834
+ className: i(
454
835
  "comal-ui",
455
836
  "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
456
837
  e
@@ -458,12 +839,12 @@ const oe = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
458
839
  ...t
459
840
  }
460
841
  ));
461
- oe.displayName = u.Content.displayName;
462
- const De = l.Provider, re = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
463
- 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,
464
845
  {
465
846
  ref: a,
466
- className: r(
847
+ className: i(
467
848
  "comal-ui",
468
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)]",
469
850
  e
@@ -471,8 +852,8 @@ const De = l.Provider, re = i.forwardRef(({ className: e, ...t }, a) => /* @__PU
471
852
  ...t
472
853
  }
473
854
  ));
474
- re.displayName = l.Viewport.displayName;
475
- const ie = f(
855
+ gt.displayName = h.Viewport.displayName;
856
+ const vt = Y(
476
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",
477
858
  {
478
859
  variants: {
@@ -485,20 +866,20 @@ const ie = f(
485
866
  variant: "default"
486
867
  }
487
868
  }
488
- ), se = i.forwardRef(({ className: e, variant: t, ...a }, d) => /* @__PURE__ */ o(
489
- l.Root,
869
+ ), bt = o.forwardRef(({ className: e, variant: t, ...a }, l) => /* @__PURE__ */ r(
870
+ h.Root,
490
871
  {
491
- ref: d,
492
- className: r("comal-ui", ie({ variant: t }), e),
872
+ ref: l,
873
+ className: i("comal-ui", vt({ variant: t }), e),
493
874
  ...a
494
875
  }
495
876
  ));
496
- se.displayName = l.Root.displayName;
497
- const de = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
498
- l.Action,
877
+ bt.displayName = h.Root.displayName;
878
+ const yt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
879
+ h.Action,
499
880
  {
500
881
  ref: a,
501
- className: r(
882
+ className: i(
502
883
  "comal-ui",
503
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",
504
885
  e
@@ -506,12 +887,12 @@ const de = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
506
887
  ...t
507
888
  }
508
889
  ));
509
- de.displayName = l.Action.displayName;
510
- const ne = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
511
- l.Close,
890
+ yt.displayName = h.Action.displayName;
891
+ const ht = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
892
+ h.Close,
512
893
  {
513
894
  ref: a,
514
- className: r(
895
+ className: i(
515
896
  "comal-ui",
516
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",
517
898
  e
@@ -519,15 +900,15 @@ const ne = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
519
900
  "aria-label": "Dismiss notification",
520
901
  "toast-close": "",
521
902
  ...t,
522
- children: /* @__PURE__ */ o(h, { className: "h-4 w-4" })
903
+ children: /* @__PURE__ */ r(ge, { className: "h-4 w-4" })
523
904
  }
524
905
  ));
525
- ne.displayName = l.Close.displayName;
526
- const le = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
527
- l.Title,
906
+ ht.displayName = h.Close.displayName;
907
+ const xt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
908
+ h.Title,
528
909
  {
529
910
  ref: a,
530
- className: r(
911
+ className: i(
531
912
  "comal-ui",
532
913
  "text-sm font-semibold [&+div]:text-xs",
533
914
  e
@@ -535,80 +916,88 @@ const le = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
535
916
  ...t
536
917
  }
537
918
  ));
538
- le.displayName = l.Title.displayName;
539
- const ce = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
540
- l.Description,
919
+ xt.displayName = h.Title.displayName;
920
+ const wt = o.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ r(
921
+ h.Description,
541
922
  {
542
923
  ref: a,
543
- className: r("comal-ui", "text-sm opacity-90", e),
924
+ className: i("comal-ui", "text-sm opacity-90", e),
544
925
  ...t
545
926
  }
546
927
  ));
547
- ce.displayName = l.Description.displayName;
548
- const Se = p.Provider, ke = p.Root, Pe = p.Trigger, me = i.forwardRef(({ className: e, container: t, sideOffset: a = 4, ...d }, c) => /* @__PURE__ */ o(p.Portal, { container: t, children: /* @__PURE__ */ o(
549
- p.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,
550
931
  {
551
- ref: c,
932
+ ref: p,
552
933
  sideOffset: a,
553
- className: r(
934
+ className: i(
554
935
  "comal-ui",
555
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]",
556
937
  e
557
938
  ),
558
- ...d
939
+ ...l
559
940
  }
560
941
  ) }));
561
- me.displayName = p.Content.displayName;
942
+ Nt.displayName = $.Content.displayName;
562
943
  export {
563
- Ce as Badge,
564
- V as Button,
565
- J as Card,
566
- Y as CardContent,
567
- W as CardDescription,
568
- Z as CardFooter,
569
- K as CardHeader,
570
- Q as CardTitle,
571
- ee as Checkbox,
572
- we as Dialog,
573
- Re as DialogClose,
574
- G as DialogContent,
575
- E as DialogDescription,
576
- X as DialogFooter,
577
- M as DialogHeader,
578
- R as DialogOverlay,
579
- _ as DialogPortal,
580
- q as DialogTitle,
581
- Ne as DialogTrigger,
582
- j as Input,
583
- L as Label,
584
- be as Select,
585
- H as SelectContent,
586
- xe as SelectGroup,
587
- A as SelectItem,
588
- U as SelectLabel,
589
- N as SelectScrollDownButton,
590
- w as SelectScrollUpButton,
591
- O as SelectSeparator,
592
- F as SelectTrigger,
593
- he as SelectValue,
594
- Te as Tabs,
595
- oe as TabsContent,
596
- te as TabsList,
597
- ae as TabsTrigger,
598
- I as Textarea,
599
- se as Toast,
600
- de as ToastAction,
601
- ne as ToastClose,
602
- ce as ToastDescription,
603
- De as ToastProvider,
604
- le as ToastTitle,
605
- re as ToastViewport,
606
- ke as Tooltip,
607
- me as TooltipContent,
608
- Se as TooltipProvider,
609
- Pe as TooltipTrigger,
610
- $ as badgeVariants,
611
- z as buttonVariants,
612
- 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
613
1002
  };
614
1003
  //# sourceMappingURL=index.js.map