@doscientos/ui 0.1.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.cjs ADDED
@@ -0,0 +1,674 @@
1
+ "use client";
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
+ Badge: () => Badge,
25
+ Button: () => Button,
26
+ Card: () => Card,
27
+ CardContent: () => CardContent,
28
+ CardDescription: () => CardDescription,
29
+ CardFooter: () => CardFooter,
30
+ CardHeader: () => CardHeader,
31
+ CardTitle: () => CardTitle,
32
+ Checkbox: () => Checkbox,
33
+ Combobox: () => Combobox,
34
+ ComboboxContent: () => ComboboxContent,
35
+ ComboboxInput: () => ComboboxInput,
36
+ ComboboxItem: () => ComboboxItem,
37
+ ComboboxList: () => ComboboxList,
38
+ ComboboxValue: () => import_react_aria_components3.ComboBoxValue,
39
+ ConfirmDialog: () => ConfirmDialog,
40
+ Dialog: () => Dialog,
41
+ DialogClose: () => DialogClose,
42
+ DialogContent: () => DialogContent,
43
+ DialogDescription: () => DialogDescription,
44
+ DialogFooter: () => DialogFooter,
45
+ DialogHeader: () => DialogHeader,
46
+ DialogTitle: () => DialogTitle,
47
+ EmptyState: () => EmptyState,
48
+ EmptyStateDescription: () => EmptyStateDescription,
49
+ EmptyStateTitle: () => EmptyStateTitle,
50
+ Field: () => Field,
51
+ FieldDescription: () => FieldDescription,
52
+ FieldError: () => FieldError,
53
+ FieldLabel: () => FieldLabel,
54
+ HighlightMatch: () => HighlightMatch,
55
+ Input: () => Input3,
56
+ Kbd: () => Kbd,
57
+ KbdGroup: () => KbdGroup,
58
+ Label: () => Label,
59
+ Menu: () => Menu,
60
+ MenuContent: () => MenuContent,
61
+ MenuItem: () => MenuItem,
62
+ MenuTrigger: () => MenuTrigger,
63
+ Popover: () => Popover3,
64
+ PopoverContent: () => PopoverContent,
65
+ PopoverTrigger: () => PopoverTrigger,
66
+ SearchClearButton: () => SearchClearButton,
67
+ SearchField: () => SearchField,
68
+ SearchInput: () => SearchInput,
69
+ Select: () => Select,
70
+ SelectContent: () => SelectContent,
71
+ SelectItem: () => SelectItem,
72
+ SelectList: () => SelectList,
73
+ SelectTrigger: () => SelectTrigger,
74
+ SelectValue: () => SelectValue,
75
+ Separator: () => Separator,
76
+ Skeleton: () => Skeleton,
77
+ Switch: () => Switch,
78
+ Table: () => Table,
79
+ TableBody: () => TableBody,
80
+ TableCaption: () => TableCaption,
81
+ TableCell: () => TableCell,
82
+ TableHead: () => TableHead,
83
+ TableHeader: () => TableHeader,
84
+ TableRow: () => TableRow,
85
+ Tabs: () => Tabs,
86
+ TabsContent: () => TabsContent,
87
+ TabsList: () => TabsList,
88
+ TabsPanels: () => TabsPanels,
89
+ TabsTrigger: () => TabsTrigger,
90
+ Textarea: () => Textarea2,
91
+ Tooltip: () => Tooltip,
92
+ TooltipContent: () => TooltipContent,
93
+ TooltipTrigger: () => TooltipTrigger,
94
+ badgeVariants: () => badgeVariants,
95
+ buttonVariants: () => buttonVariants,
96
+ cn: () => cn,
97
+ formSnapshot: () => formSnapshot,
98
+ getTextMatchParts: () => getTextMatchParts,
99
+ useAutosave: () => useAutosave,
100
+ useDebouncedValue: () => useDebouncedValue,
101
+ useFormDirty: () => useFormDirty
102
+ });
103
+ module.exports = __toCommonJS(index_exports);
104
+
105
+ // src/hooks/use-autosave.ts
106
+ var import_react = require("react");
107
+ function useAutosave({
108
+ data,
109
+ onSave,
110
+ debounceMs = 1e3,
111
+ enabled = true,
112
+ serialize = JSON.stringify
113
+ }) {
114
+ const [status, setStatus] = (0, import_react.useState)("idle");
115
+ const [error, setError] = (0, import_react.useState)(null);
116
+ const lastSaved = (0, import_react.useRef)(null);
117
+ const saveRef = (0, import_react.useRef)(onSave);
118
+ const serializeRef = (0, import_react.useRef)(serialize);
119
+ (0, import_react.useEffect)(() => {
120
+ saveRef.current = onSave;
121
+ serializeRef.current = serialize;
122
+ }, [onSave, serialize]);
123
+ const save = (0, import_react.useCallback)(async (value) => {
124
+ setStatus("saving");
125
+ setError(null);
126
+ try {
127
+ await saveRef.current(value);
128
+ lastSaved.current = serializeRef.current(value);
129
+ setStatus("saved");
130
+ } catch (cause) {
131
+ setError(cause instanceof Error ? cause : new Error("No se pudo guardar."));
132
+ setStatus("error");
133
+ }
134
+ }, []);
135
+ (0, import_react.useEffect)(() => {
136
+ if (!enabled) return;
137
+ const snapshot = serializeRef.current(data);
138
+ if (lastSaved.current === null) {
139
+ lastSaved.current = snapshot;
140
+ return;
141
+ }
142
+ if (snapshot === lastSaved.current) return;
143
+ const timeout = window.setTimeout(() => void save(data), debounceMs);
144
+ return () => window.clearTimeout(timeout);
145
+ }, [data, debounceMs, enabled, save]);
146
+ return { status, error, saveNow: () => save(data) };
147
+ }
148
+
149
+ // src/hooks/use-debounced-value.ts
150
+ var import_react2 = require("react");
151
+ function useDebouncedValue(value, delay = 250) {
152
+ const [debouncedValue, setDebouncedValue] = (0, import_react2.useState)(value);
153
+ (0, import_react2.useEffect)(() => {
154
+ const timeout = window.setTimeout(() => setDebouncedValue(value), delay);
155
+ return () => window.clearTimeout(timeout);
156
+ }, [delay, value]);
157
+ return debouncedValue;
158
+ }
159
+
160
+ // src/hooks/use-form-dirty.ts
161
+ var import_react3 = require("react");
162
+ function formSnapshot(form) {
163
+ const entries = Array.from(new FormData(form), ([key, value]) => [key, typeof value === "string" ? value : value.name]);
164
+ entries.sort(([left], [right]) => left.localeCompare(right));
165
+ return JSON.stringify(entries);
166
+ }
167
+ function useFormDirty() {
168
+ const formElement = (0, import_react3.useRef)(null);
169
+ const baseline = (0, import_react3.useRef)(null);
170
+ const [isDirty, setIsDirty] = (0, import_react3.useState)(false);
171
+ const recompute = (0, import_react3.useCallback)(() => {
172
+ if (formElement.current && baseline.current !== null) {
173
+ setIsDirty(formSnapshot(formElement.current) !== baseline.current);
174
+ }
175
+ }, []);
176
+ const reset = (0, import_react3.useCallback)(() => {
177
+ if (formElement.current) {
178
+ baseline.current = formSnapshot(formElement.current);
179
+ setIsDirty(false);
180
+ }
181
+ }, []);
182
+ const formRef = (0, import_react3.useCallback)((form) => {
183
+ if (formElement.current) {
184
+ formElement.current.removeEventListener("input", recompute);
185
+ formElement.current.removeEventListener("change", recompute);
186
+ formElement.current.removeEventListener("reset", recompute);
187
+ }
188
+ formElement.current = form;
189
+ if (form) {
190
+ baseline.current = formSnapshot(form);
191
+ setIsDirty(false);
192
+ form.addEventListener("input", recompute);
193
+ form.addEventListener("change", recompute);
194
+ form.addEventListener("reset", recompute);
195
+ }
196
+ }, [recompute]);
197
+ return { formRef, isDirty, markDirty: () => setIsDirty(true), reset };
198
+ }
199
+
200
+ // src/lib/cn.ts
201
+ var import_clsx = require("clsx");
202
+ var import_tailwind_merge = require("tailwind-merge");
203
+ function cn(...inputs) {
204
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
205
+ }
206
+
207
+ // src/lib/text-match.ts
208
+ function normalize(value) {
209
+ return value.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLocaleLowerCase();
210
+ }
211
+ function normalizedTextWithRanges(value) {
212
+ const ranges = [];
213
+ let normalized = "";
214
+ let sourceIndex = 0;
215
+ for (const character of value) {
216
+ const start = sourceIndex;
217
+ sourceIndex += character.length;
218
+ const normalizedCharacter = normalize(character);
219
+ normalized += normalizedCharacter;
220
+ for (let index = 0; index < normalizedCharacter.length; index += 1) {
221
+ ranges.push({ start, end: sourceIndex });
222
+ }
223
+ }
224
+ return { normalized, ranges };
225
+ }
226
+ function getTextMatchParts(text, query) {
227
+ const term = normalize(query.trim());
228
+ if (!term) return [{ text, match: false }];
229
+ const { normalized, ranges } = normalizedTextWithRanges(text);
230
+ const parts = [];
231
+ let sourceCursor = 0;
232
+ let index = normalized.indexOf(term);
233
+ while (index !== -1) {
234
+ const rangeStart = ranges[index]?.start;
235
+ const rangeEnd = ranges[index + term.length - 1]?.end;
236
+ if (rangeStart === void 0 || rangeEnd === void 0) break;
237
+ if (rangeStart > sourceCursor) parts.push({ text: text.slice(sourceCursor, rangeStart), match: false });
238
+ parts.push({ text: text.slice(rangeStart, rangeEnd), match: true });
239
+ sourceCursor = rangeEnd;
240
+ index = normalized.indexOf(term, index + term.length);
241
+ }
242
+ if (sourceCursor < text.length) parts.push({ text: text.slice(sourceCursor), match: false });
243
+ return parts.length ? parts : [{ text, match: false }];
244
+ }
245
+
246
+ // src/ui/badge.tsx
247
+ var import_class_variance_authority = require("class-variance-authority");
248
+ var import_jsx_runtime = require("react/jsx-runtime");
249
+ var badgeVariants = (0, import_class_variance_authority.cva)("inline-flex w-fit items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium", {
250
+ variants: {
251
+ variant: {
252
+ default: "bg-primary text-primary-foreground",
253
+ secondary: "bg-secondary text-secondary-foreground",
254
+ neutral: "bg-muted text-muted-foreground",
255
+ success: "bg-success/10 text-success",
256
+ warning: "bg-warning/10 text-warning",
257
+ destructive: "bg-destructive/10 text-destructive",
258
+ outline: "border border-border text-foreground"
259
+ }
260
+ },
261
+ defaultVariants: { variant: "default" }
262
+ });
263
+ function Badge({ className, variant, ...props }) {
264
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "data-slot": "badge", className: cn(badgeVariants({ variant }), className), ...props });
265
+ }
266
+
267
+ // src/ui/button.tsx
268
+ var import_class_variance_authority2 = require("class-variance-authority");
269
+ var import_react_aria_components = require("react-aria-components");
270
+ var import_jsx_runtime2 = require("react/jsx-runtime");
271
+ var buttonVariants = (0, import_class_variance_authority2.cva)(
272
+ "inline-flex shrink-0 items-center justify-center gap-1.5 rounded-lg border border-transparent text-sm font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
273
+ {
274
+ variants: {
275
+ variant: {
276
+ default: "bg-primary text-primary-foreground hover:bg-primary/85",
277
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
278
+ outline: "border-border bg-background text-foreground hover:bg-muted",
279
+ ghost: "text-foreground hover:bg-muted",
280
+ destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20",
281
+ link: "text-primary underline-offset-4 hover:underline"
282
+ },
283
+ size: {
284
+ xs: "h-6 px-2 text-xs",
285
+ sm: "h-7 px-2.5 text-xs",
286
+ default: "h-8 px-3",
287
+ lg: "h-10 px-4",
288
+ icon: "size-8 p-0"
289
+ }
290
+ },
291
+ defaultVariants: { variant: "default", size: "default" }
292
+ }
293
+ );
294
+ function Button({ className, variant, size, ...props }) {
295
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_aria_components.Button, { "data-slot": "button", className: cn(buttonVariants({ variant, size }), className), ...props });
296
+ }
297
+
298
+ // src/ui/card.tsx
299
+ var import_jsx_runtime3 = require("react/jsx-runtime");
300
+ function Card({ className, ...props }) {
301
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("section", { "data-slot": "card", className: cn("rounded-xl border border-border bg-card text-foreground shadow-sm", className), ...props });
302
+ }
303
+ function CardHeader({ className, ...props }) {
304
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("header", { "data-slot": "card-header", className: cn("flex flex-col gap-1.5 p-5", className), ...props });
305
+ }
306
+ function CardTitle({ className, ...props }) {
307
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h2", { "data-slot": "card-title", className: cn("text-base font-semibold", className), ...props });
308
+ }
309
+ function CardDescription({ className, ...props }) {
310
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { "data-slot": "card-description", className: cn("text-sm text-muted-foreground", className), ...props });
311
+ }
312
+ function CardContent({ className, ...props }) {
313
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { "data-slot": "card-content", className: cn("p-5 pt-0", className), ...props });
314
+ }
315
+ function CardFooter({ className, ...props }) {
316
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("footer", { "data-slot": "card-footer", className: cn("flex items-center gap-2 border-t border-border p-5", className), ...props });
317
+ }
318
+
319
+ // src/ui/checkbox.tsx
320
+ var import_react_aria_components2 = require("react-aria-components");
321
+ var import_jsx_runtime4 = require("react/jsx-runtime");
322
+ function Checkbox({ className, children, ...props }) {
323
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_aria_components2.Checkbox, { "data-slot": "checkbox", className: cn("group inline-flex items-center gap-2 text-sm text-foreground data-disabled:cursor-not-allowed data-disabled:opacity-50", className), ...props, children: (state) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
324
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": "true", className: "grid size-4 place-items-center rounded border border-border bg-background text-xs text-primary-foreground group-data-selected:border-primary group-data-selected:bg-primary group-data-focus-visible:ring-3 group-data-focus-visible:ring-ring/50", children: "\u2713" }),
325
+ typeof children === "function" ? children(state) : children
326
+ ] }) });
327
+ }
328
+
329
+ // src/ui/combobox.tsx
330
+ var import_react4 = require("react");
331
+ var import_react_aria_components3 = require("react-aria-components");
332
+ var import_jsx_runtime5 = require("react/jsx-runtime");
333
+ var Combobox = import_react_aria_components3.ComboBox;
334
+ function ComboboxInput({ className, ...props }) {
335
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_aria_components3.Input, { "data-slot": "combobox-input", className: cn("h-8 w-full rounded-lg border border-border bg-background px-2.5 text-sm text-foreground outline-none placeholder:text-muted-foreground focus-visible:ring-3 focus-visible:ring-ring/50", className), ...props });
336
+ }
337
+ function ComboboxContent({ className, ...props }) {
338
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_aria_components3.Popover, { "data-slot": "combobox-content", className: cn("max-h-72 w-(--trigger-width) overflow-hidden rounded-xl border border-border bg-background p-1.5 text-foreground shadow-lg", className), ...props });
339
+ }
340
+ function ComboboxList({ className, emptyState, ...props }) {
341
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_aria_components3.ListBox, { "data-slot": "combobox-list", className: cn("max-h-64 overflow-y-auto", className), renderEmptyState: emptyState ? () => emptyState : void 0, ...props });
342
+ }
343
+ function ComboboxItem({ className, children, ...props }) {
344
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_aria_components3.ListBoxItem, { "data-slot": "combobox-item", className: cn("flex w-full cursor-default items-center justify-between rounded-md px-2 py-1.5 text-sm outline-none data-focused:bg-muted data-disabled:pointer-events-none data-disabled:opacity-50", className), ...props, children });
345
+ }
346
+ function HighlightMatch({ text, query, className }) {
347
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className, children: getTextMatchParts(text, query).map((part, index) => part.match ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("mark", { className: "rounded bg-accent px-0.5 text-accent-foreground", children: part.text }, `${part.text}-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react4.Fragment, { children: part.text }, `${part.text}-${index}`)) });
348
+ }
349
+
350
+ // src/ui/dialog.tsx
351
+ var import_react5 = require("react");
352
+ var import_react_aria_components4 = require("react-aria-components");
353
+ var import_jsx_runtime6 = require("react/jsx-runtime");
354
+ var DialogCloseContext = (0, import_react5.createContext)(null);
355
+ function Dialog({ open, children, ...props }) {
356
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_aria_components4.ModalOverlay, { isOpen: open, className: "fixed inset-0 z-50 grid place-items-center bg-black/20 p-4 backdrop-blur-[1px]", ...props, children });
357
+ }
358
+ function DialogClose({ onPress, ...props }) {
359
+ const close = (0, import_react5.useContext)(DialogCloseContext);
360
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { onPress: (event) => {
361
+ onPress?.(event);
362
+ close?.();
363
+ }, ...props });
364
+ }
365
+ function DialogContent({ className, children, showCloseButton = true, ...props }) {
366
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_aria_components4.Modal, { className: "w-full max-w-md outline-none", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_aria_components4.Dialog, { "data-slot": "dialog-content", className: cn("relative grid max-h-[calc(100dvh-2rem)] gap-4 overflow-y-auto rounded-xl bg-background p-5 text-foreground shadow-xl outline-none", className), ...props, children: ({ close }) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(DialogCloseContext.Provider, { value: close, children: [
367
+ typeof children === "function" ? children({ close }) : children,
368
+ showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogClose, { "aria-label": "Cerrar di\xE1logo", variant: "ghost", size: "icon", className: "absolute top-2 right-2", children: "\xD7" })
369
+ ] }) }) });
370
+ }
371
+ function DialogHeader({ className, ...props }) {
372
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { "data-slot": "dialog-header", className: cn("flex flex-col gap-2", className), ...props });
373
+ }
374
+ function DialogFooter({ className, ...props }) {
375
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { "data-slot": "dialog-footer", className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props });
376
+ }
377
+ function DialogTitle({ className, ...props }) {
378
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_aria_components4.Heading, { slot: "title", className: cn("text-base font-semibold", className), ...props });
379
+ }
380
+ function DialogDescription({ className, ...props }) {
381
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_aria_components4.Text, { slot: "description", className: cn("text-sm text-muted-foreground", className), ...props });
382
+ }
383
+
384
+ // src/ui/confirm-dialog.tsx
385
+ var import_jsx_runtime7 = require("react/jsx-runtime");
386
+ function ConfirmDialog({ open, onOpenChange, title, description, confirmLabel = "Confirmar", cancelLabel = "Cancelar", destructive = false, pending = false, onConfirm }) {
387
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Dialog, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DialogContent, { showCloseButton: false, children: [
388
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DialogHeader, { children: [
389
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DialogTitle, { children: title }),
390
+ description && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DialogDescription, { children: description })
391
+ ] }),
392
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DialogFooter, { children: [
393
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "outline", isDisabled: pending, onPress: () => onOpenChange(false), children: cancelLabel }),
394
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: destructive ? "destructive" : "default", isDisabled: pending, onPress: onConfirm, children: confirmLabel })
395
+ ] })
396
+ ] }) });
397
+ }
398
+
399
+ // src/ui/empty-state.tsx
400
+ var import_jsx_runtime8 = require("react/jsx-runtime");
401
+ function EmptyState({ className, ...props }) {
402
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { "data-slot": "empty-state", className: cn("flex min-h-44 w-full flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border p-6 text-center", className), ...props });
403
+ }
404
+ function EmptyStateTitle({ className, ...props }) {
405
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { "data-slot": "empty-state-title", className: cn("text-sm font-medium text-foreground", className), ...props });
406
+ }
407
+ function EmptyStateDescription({ className, ...props }) {
408
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { "data-slot": "empty-state-description", className: cn("max-w-sm text-sm text-muted-foreground", className), ...props });
409
+ }
410
+
411
+ // src/ui/label.tsx
412
+ var import_react6 = require("react");
413
+ var import_react_aria_components5 = require("react-aria-components");
414
+ var import_jsx_runtime9 = require("react/jsx-runtime");
415
+ var Label = (0, import_react6.forwardRef)(function Label2({ className, ...props }, ref) {
416
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_aria_components5.Label, { ref, "data-slot": "label", className: cn("flex items-center gap-2 text-sm font-medium leading-none select-none", className), ...props });
417
+ });
418
+
419
+ // src/ui/field.tsx
420
+ var import_jsx_runtime10 = require("react/jsx-runtime");
421
+ function Field({ className, ...props }) {
422
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { "data-slot": "field", className: cn("flex w-full flex-col gap-2", className), ...props });
423
+ }
424
+ function FieldLabel({ className, ...props }) {
425
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Label, { "data-slot": "field-label", className: cn("text-foreground", className), ...props });
426
+ }
427
+ function FieldDescription({ className, ...props }) {
428
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { "data-slot": "field-description", className: cn("text-sm text-muted-foreground", className), ...props });
429
+ }
430
+ function FieldError({ className, children, ...props }) {
431
+ if (!children) return null;
432
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { role: "alert", "data-slot": "field-error", className: cn("text-sm text-destructive", className), ...props, children });
433
+ }
434
+
435
+ // src/ui/input.tsx
436
+ var import_react7 = require("react");
437
+ var import_react_aria_components6 = require("react-aria-components");
438
+ var import_jsx_runtime11 = require("react/jsx-runtime");
439
+ var InputImpl = (0, import_react7.forwardRef)(function Input2({ className, type, ...props }, ref) {
440
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_aria_components6.Input, { ref, type, "data-slot": "input", className: cn("h-8 w-full min-w-0 rounded-lg border border-border bg-background px-2.5 py-1 text-sm text-foreground outline-none placeholder:text-muted-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive", className), ...props });
441
+ });
442
+ var Input3 = InputImpl;
443
+
444
+ // src/ui/kbd.tsx
445
+ var import_jsx_runtime12 = require("react/jsx-runtime");
446
+ function Kbd({ className, ...props }) {
447
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("kbd", { "data-slot": "kbd", className: cn("pointer-events-none inline-flex h-5 min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none", className), ...props });
448
+ }
449
+ function KbdGroup({ className, ...props }) {
450
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { "data-slot": "kbd-group", className: cn("inline-flex items-center gap-1", className), ...props });
451
+ }
452
+
453
+ // src/ui/menu.tsx
454
+ var import_react_aria_components7 = require("react-aria-components");
455
+ var import_jsx_runtime13 = require("react/jsx-runtime");
456
+ var MenuTrigger = import_react_aria_components7.MenuTrigger;
457
+ function MenuContent({ className, ...props }) {
458
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_aria_components7.Popover, { "data-slot": "menu-content", className: cn("min-w-40 overflow-hidden rounded-xl border border-border bg-background p-1.5 text-foreground shadow-lg", className), ...props });
459
+ }
460
+ function Menu({ className, ...props }) {
461
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_aria_components7.Menu, { "data-slot": "menu", className: cn("outline-none", className), ...props });
462
+ }
463
+ function MenuItem({ className, children, ...props }) {
464
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_aria_components7.MenuItem, { "data-slot": "menu-item", className: cn("flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none data-focused:bg-muted data-disabled:pointer-events-none data-disabled:opacity-50", className), ...props, children });
465
+ }
466
+
467
+ // src/ui/popover.tsx
468
+ var import_react_aria_components8 = require("react-aria-components");
469
+ var import_jsx_runtime14 = require("react/jsx-runtime");
470
+ var PopoverTrigger = import_react_aria_components8.DialogTrigger;
471
+ function Popover3({ className, ...props }) {
472
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_aria_components8.Popover, { "data-slot": "popover", offset: 6, className: cn("min-w-48 rounded-xl border border-border bg-background p-1.5 text-foreground shadow-lg outline-none data-entering:animate-in data-entering:fade-in-0 data-entering:zoom-in-95 data-exiting:animate-out data-exiting:fade-out-0 data-exiting:zoom-out-95", className), ...props });
473
+ }
474
+ var PopoverContent = Popover3;
475
+
476
+ // src/ui/search-field.tsx
477
+ var import_react_aria_components9 = require("react-aria-components");
478
+ var import_jsx_runtime15 = require("react/jsx-runtime");
479
+ var SearchField = import_react_aria_components9.SearchField;
480
+ function SearchInput({ className, ...props }) {
481
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_aria_components9.Input, { "data-slot": "search-input", className: cn("h-8 w-full min-w-0 rounded-lg border border-border bg-background px-2.5 py-1 text-sm text-foreground outline-none placeholder:text-muted-foreground focus-visible:ring-3 focus-visible:ring-ring/50", className), ...props });
482
+ }
483
+ function SearchClearButton({ className, children = "\xD7", ...props }) {
484
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_aria_components9.Button, { slot: "clear", "data-slot": "search-clear", className: cn("absolute top-1/2 right-1 -translate-y-1/2 rounded p-1 text-muted-foreground outline-none hover:bg-muted data-focus-visible:ring-2 data-focus-visible:ring-ring", className), ...props, children });
485
+ }
486
+
487
+ // src/ui/select.tsx
488
+ var import_react_aria_components10 = require("react-aria-components");
489
+ var import_jsx_runtime16 = require("react/jsx-runtime");
490
+ var Select = import_react_aria_components10.Select;
491
+ function SelectTrigger({ className, children, ...props }) {
492
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_aria_components10.Button, { "data-slot": "select-trigger", className: cn("flex h-8 w-full min-w-36 items-center gap-2 rounded-lg border border-border bg-background px-2.5 text-left text-sm text-foreground outline-none data-focus-visible:ring-3 data-focus-visible:ring-ring/50 data-disabled:cursor-not-allowed data-disabled:opacity-50", className), ...props, children: (state) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
493
+ typeof children === "function" ? children(state) : children,
494
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { "aria-hidden": "true", className: "ml-auto text-muted-foreground", children: "\u2304" })
495
+ ] }) });
496
+ }
497
+ function SelectValue({ className, ...props }) {
498
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_aria_components10.SelectValue, { "data-slot": "select-value", className: cn("flex-1 truncate data-placeholder:text-muted-foreground", className), ...props });
499
+ }
500
+ function SelectContent({ className, ...props }) {
501
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_aria_components10.Popover, { "data-slot": "select-content", className: cn("w-(--trigger-width) overflow-hidden rounded-xl border border-border bg-background p-1.5 text-foreground shadow-lg", className), ...props });
502
+ }
503
+ function SelectList({ className, ...props }) {
504
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_aria_components10.ListBox, { "data-slot": "select-list", className: cn("max-h-64 overflow-y-auto", className), ...props });
505
+ }
506
+ function SelectItem({ className, children, ...props }) {
507
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_aria_components10.ListBoxItem, { "data-slot": "select-item", className: cn("flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none data-focused:bg-muted data-selected:bg-muted data-disabled:pointer-events-none data-disabled:opacity-50", className), ...props, children });
508
+ }
509
+
510
+ // src/ui/separator.tsx
511
+ var import_react_aria_components11 = require("react-aria-components");
512
+ var import_jsx_runtime17 = require("react/jsx-runtime");
513
+ function Separator({ className, orientation = "horizontal", ...props }) {
514
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_aria_components11.Separator, { "data-slot": "separator", orientation, className: cn("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch", className), ...props });
515
+ }
516
+
517
+ // src/ui/skeleton.tsx
518
+ var import_jsx_runtime18 = require("react/jsx-runtime");
519
+ function Skeleton({ className, ...props }) {
520
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { "aria-hidden": "true", "data-slot": "skeleton", className: cn("animate-pulse rounded-md bg-muted", className), ...props });
521
+ }
522
+
523
+ // src/ui/switch.tsx
524
+ var import_react_aria_components12 = require("react-aria-components");
525
+ var import_jsx_runtime19 = require("react/jsx-runtime");
526
+ function Switch({ className, children, ...props }) {
527
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_aria_components12.Switch, { "data-slot": "switch", className: cn("group inline-flex items-center gap-2 text-sm text-foreground data-disabled:cursor-not-allowed data-disabled:opacity-50", className), ...props, children: (state) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
528
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { "aria-hidden": "true", className: "flex h-5 w-9 items-center rounded-full bg-muted p-0.5 transition-colors group-data-selected:bg-primary group-data-focus-visible:ring-3 group-data-focus-visible:ring-ring/50", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "size-4 rounded-full bg-background shadow-sm transition-transform group-data-selected:translate-x-4" }) }),
529
+ typeof children === "function" ? children(state) : children
530
+ ] }) });
531
+ }
532
+
533
+ // src/ui/table.tsx
534
+ var import_jsx_runtime20 = require("react/jsx-runtime");
535
+ function Table({ className, ...props }) {
536
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("table", { "data-slot": "table", className: cn("w-full caption-bottom text-sm", className), ...props }) });
537
+ }
538
+ function TableHeader({ className, ...props }) {
539
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("thead", { "data-slot": "table-header", className: cn("border-b border-border", className), ...props });
540
+ }
541
+ function TableBody({ className, ...props }) {
542
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("tbody", { "data-slot": "table-body", className: cn("[&_tr:last-child]:border-0", className), ...props });
543
+ }
544
+ function TableRow({ className, ...props }) {
545
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("tr", { "data-slot": "table-row", className: cn("border-b border-border transition-colors hover:bg-muted/50", className), ...props });
546
+ }
547
+ function TableHead({ className, ...props }) {
548
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("th", { "data-slot": "table-head", className: cn("h-10 px-3 text-left align-middle text-xs font-medium text-muted-foreground", className), ...props });
549
+ }
550
+ function TableCell({ className, ...props }) {
551
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("td", { "data-slot": "table-cell", className: cn("p-3 align-middle", className), ...props });
552
+ }
553
+ function TableCaption({ className, ...props }) {
554
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("caption", { "data-slot": "table-caption", className: cn("mt-4 text-sm text-muted-foreground", className), ...props });
555
+ }
556
+
557
+ // src/ui/tabs.tsx
558
+ var import_react_aria_components13 = require("react-aria-components");
559
+ var import_jsx_runtime21 = require("react/jsx-runtime");
560
+ function Tabs({ className, ...props }) {
561
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components13.Tabs, { "data-slot": "tabs", className: (0, import_react_aria_components13.composeRenderProps)(className, (value) => cn("flex flex-col gap-2", value)), ...props });
562
+ }
563
+ function TabsList({ className, ...props }) {
564
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components13.TabList, { "data-slot": "tabs-list", className: (0, import_react_aria_components13.composeRenderProps)(className, (value) => cn("inline-flex w-fit items-center gap-1 rounded-lg bg-muted p-1 text-muted-foreground", value)), ...props });
565
+ }
566
+ function TabsTrigger({ className, ...props }) {
567
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components13.Tab, { "data-slot": "tabs-trigger", className: (0, import_react_aria_components13.composeRenderProps)(className, (value) => cn("inline-flex h-7 items-center justify-center gap-1.5 rounded-md px-2.5 text-sm font-medium outline-none transition-colors data-hovered:text-foreground data-selected:bg-background data-selected:text-foreground data-selected:shadow-sm data-focus-visible:ring-3 data-focus-visible:ring-ring/50 data-disabled:cursor-not-allowed data-disabled:opacity-50", value)), ...props });
568
+ }
569
+ function TabsPanels({ className, ...props }) {
570
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components13.TabPanels, { "data-slot": "tabs-panels", className: cn("min-w-0", className), ...props });
571
+ }
572
+ function TabsContent({ className, ...props }) {
573
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components13.TabPanel, { "data-slot": "tabs-content", className: (0, import_react_aria_components13.composeRenderProps)(className, (value) => cn("text-sm outline-none data-focus-visible:ring-3 data-focus-visible:ring-ring/50", value)), ...props });
574
+ }
575
+
576
+ // src/ui/textarea.tsx
577
+ var import_react8 = require("react");
578
+ var import_react_aria_components14 = require("react-aria-components");
579
+ var import_jsx_runtime22 = require("react/jsx-runtime");
580
+ var TextareaImpl = (0, import_react8.forwardRef)(function Textarea({ className, ...props }, ref) {
581
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_aria_components14.TextArea, { ref, "data-slot": "textarea", className: cn("min-h-20 w-full rounded-lg border border-border bg-background px-2.5 py-2 text-sm text-foreground outline-none placeholder:text-muted-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive", className), ...props });
582
+ });
583
+ var Textarea2 = TextareaImpl;
584
+
585
+ // src/ui/tooltip.tsx
586
+ var import_react_aria_components15 = require("react-aria-components");
587
+ var import_jsx_runtime23 = require("react/jsx-runtime");
588
+ var TooltipTrigger = import_react_aria_components15.TooltipTrigger;
589
+ function Tooltip({ className, ...props }) {
590
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components15.Tooltip, { "data-slot": "tooltip", offset: 6, className: cn("max-w-xs rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background shadow-md outline-none data-entering:animate-in data-entering:fade-in-0 data-entering:zoom-in-95 data-exiting:animate-out data-exiting:fade-out-0 data-exiting:zoom-out-95", className), ...props });
591
+ }
592
+ var TooltipContent = Tooltip;
593
+ // Annotate the CommonJS export names for ESM import in node:
594
+ 0 && (module.exports = {
595
+ Badge,
596
+ Button,
597
+ Card,
598
+ CardContent,
599
+ CardDescription,
600
+ CardFooter,
601
+ CardHeader,
602
+ CardTitle,
603
+ Checkbox,
604
+ Combobox,
605
+ ComboboxContent,
606
+ ComboboxInput,
607
+ ComboboxItem,
608
+ ComboboxList,
609
+ ComboboxValue,
610
+ ConfirmDialog,
611
+ Dialog,
612
+ DialogClose,
613
+ DialogContent,
614
+ DialogDescription,
615
+ DialogFooter,
616
+ DialogHeader,
617
+ DialogTitle,
618
+ EmptyState,
619
+ EmptyStateDescription,
620
+ EmptyStateTitle,
621
+ Field,
622
+ FieldDescription,
623
+ FieldError,
624
+ FieldLabel,
625
+ HighlightMatch,
626
+ Input,
627
+ Kbd,
628
+ KbdGroup,
629
+ Label,
630
+ Menu,
631
+ MenuContent,
632
+ MenuItem,
633
+ MenuTrigger,
634
+ Popover,
635
+ PopoverContent,
636
+ PopoverTrigger,
637
+ SearchClearButton,
638
+ SearchField,
639
+ SearchInput,
640
+ Select,
641
+ SelectContent,
642
+ SelectItem,
643
+ SelectList,
644
+ SelectTrigger,
645
+ SelectValue,
646
+ Separator,
647
+ Skeleton,
648
+ Switch,
649
+ Table,
650
+ TableBody,
651
+ TableCaption,
652
+ TableCell,
653
+ TableHead,
654
+ TableHeader,
655
+ TableRow,
656
+ Tabs,
657
+ TabsContent,
658
+ TabsList,
659
+ TabsPanels,
660
+ TabsTrigger,
661
+ Textarea,
662
+ Tooltip,
663
+ TooltipContent,
664
+ TooltipTrigger,
665
+ badgeVariants,
666
+ buttonVariants,
667
+ cn,
668
+ formSnapshot,
669
+ getTextMatchParts,
670
+ useAutosave,
671
+ useDebouncedValue,
672
+ useFormDirty
673
+ });
674
+ //# sourceMappingURL=index.cjs.map