@doscientos/ui 0.1.7 → 0.1.9
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 +249 -136
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -24
- package/dist/index.d.ts +47 -24
- package/dist/index.js +239 -122
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -33,6 +33,8 @@ __export(index_exports, {
|
|
|
33
33
|
AppShellContent: () => AppShellContent,
|
|
34
34
|
AppShellHeader: () => AppShellHeader,
|
|
35
35
|
AppShellMain: () => AppShellMain,
|
|
36
|
+
AppShellMobileHeader: () => AppShellMobileHeader,
|
|
37
|
+
AppShellSidebar: () => AppShellSidebar,
|
|
36
38
|
AutocompleteCombobox: () => AutocompleteCombobox,
|
|
37
39
|
Avatar: () => Avatar,
|
|
38
40
|
AvatarBadge: () => AvatarBadge,
|
|
@@ -68,13 +70,6 @@ __export(index_exports, {
|
|
|
68
70
|
CommandItem: () => CommandItem,
|
|
69
71
|
CommandList: () => CommandList,
|
|
70
72
|
ConfirmDialog: () => ConfirmDialog,
|
|
71
|
-
Dialog: () => Dialog,
|
|
72
|
-
DialogClose: () => DialogClose,
|
|
73
|
-
DialogContent: () => DialogContent,
|
|
74
|
-
DialogDescription: () => DialogDescription,
|
|
75
|
-
DialogFooter: () => DialogFooter,
|
|
76
|
-
DialogHeader: () => DialogHeader,
|
|
77
|
-
DialogTitle: () => DialogTitle,
|
|
78
73
|
Drawer: () => Drawer,
|
|
79
74
|
DrawerDescription: () => DrawerDescription,
|
|
80
75
|
DrawerFooter: () => DrawerFooter,
|
|
@@ -111,6 +106,7 @@ __export(index_exports, {
|
|
|
111
106
|
MenuContent: () => MenuContent,
|
|
112
107
|
MenuItem: () => MenuItem,
|
|
113
108
|
MenuTrigger: () => MenuTrigger,
|
|
109
|
+
ModalDialog: () => ModalDialog,
|
|
114
110
|
PageHeader: () => PageHeader,
|
|
115
111
|
PageHeaderActions: () => PageHeaderActions,
|
|
116
112
|
PageHeaderDescription: () => PageHeaderDescription,
|
|
@@ -327,7 +323,7 @@ function getTextMatchParts(text, query) {
|
|
|
327
323
|
|
|
328
324
|
// src/ui/accordion/accordion.tsx
|
|
329
325
|
var import_react_aria_components = require("react-aria-components");
|
|
330
|
-
var
|
|
326
|
+
var import_lucide_react = require("lucide-react");
|
|
331
327
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
332
328
|
function Accordion({ className, ...props }) {
|
|
333
329
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_aria_components.DisclosureGroup, { "data-slot": "accordion", className: cn("flex w-full flex-col", className), ...props });
|
|
@@ -338,7 +334,7 @@ function AccordionItem({ className, ...props }) {
|
|
|
338
334
|
function AccordionTrigger({ className, children, ...props }) {
|
|
339
335
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_aria_components.Button, { "data-slot": "accordion-trigger", className: cn("group/accordion-trigger flex w-full items-center justify-between py-3 text-left text-sm font-medium outline-none transition-colors hover:text-primary focus-visible:ring-3 focus-visible:ring-ring/50", className), ...props, children: (values) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
340
336
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: typeof children === "function" ? children(values) : children }),
|
|
341
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
337
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronDown, { "aria-hidden": "true", className: "size-4 transition-transform group-data-expanded/accordion-trigger:rotate-180 motion-reduce:transition-none" })
|
|
342
338
|
] }) });
|
|
343
339
|
}
|
|
344
340
|
function AccordionContent({ className, ...props }) {
|
|
@@ -368,28 +364,86 @@ function AlertAction({ className, children, ...props }) {
|
|
|
368
364
|
|
|
369
365
|
// src/ui/app-shell/app-shell.tsx
|
|
370
366
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
371
|
-
function AppShell({
|
|
372
|
-
|
|
367
|
+
function AppShell({
|
|
368
|
+
className,
|
|
369
|
+
sidebarBreakpoint = "md",
|
|
370
|
+
...props
|
|
371
|
+
}) {
|
|
372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
373
|
+
"div",
|
|
374
|
+
{
|
|
375
|
+
"data-slot": "app-shell",
|
|
376
|
+
"data-sidebar-breakpoint": sidebarBreakpoint,
|
|
377
|
+
className: cn("bg-background text-foreground", className),
|
|
378
|
+
...props
|
|
379
|
+
}
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
function AppShellSidebar({ className, ...props }) {
|
|
383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
384
|
+
"aside",
|
|
385
|
+
{
|
|
386
|
+
"data-slot": "app-shell-sidebar",
|
|
387
|
+
className: cn("w-56 shrink-0 border-r border-border bg-card text-foreground", className),
|
|
388
|
+
...props
|
|
389
|
+
}
|
|
390
|
+
);
|
|
373
391
|
}
|
|
374
392
|
function AppShellMain({ className, ...props }) {
|
|
375
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("main", { "data-slot": "app-shell-main", className: cn("
|
|
393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("main", { "data-slot": "app-shell-main", className: cn("bg-background", className), ...props });
|
|
376
394
|
}
|
|
377
395
|
function AppShellHeader({ className, ...props }) {
|
|
378
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
397
|
+
"header",
|
|
398
|
+
{
|
|
399
|
+
"data-slot": "app-shell-header",
|
|
400
|
+
className: cn("border-b border-border bg-background px-4", className),
|
|
401
|
+
...props
|
|
402
|
+
}
|
|
403
|
+
);
|
|
379
404
|
}
|
|
380
|
-
function
|
|
381
|
-
|
|
405
|
+
function AppShellMobileHeader({
|
|
406
|
+
className,
|
|
407
|
+
...props
|
|
408
|
+
}) {
|
|
409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
410
|
+
"header",
|
|
411
|
+
{
|
|
412
|
+
"data-slot": "app-shell-mobile-header",
|
|
413
|
+
className: cn("h-14 shrink-0 items-center gap-2 border-b border-border bg-background px-3", className),
|
|
414
|
+
...props
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
function AppShellContent({
|
|
419
|
+
className,
|
|
420
|
+
size = "wide",
|
|
421
|
+
padded = true,
|
|
422
|
+
scrollable = true,
|
|
423
|
+
...props
|
|
424
|
+
}) {
|
|
425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
426
|
+
"div",
|
|
427
|
+
{
|
|
428
|
+
"data-slot": "app-shell-content",
|
|
429
|
+
"data-size": size,
|
|
430
|
+
"data-padded": padded || void 0,
|
|
431
|
+
"data-scrollable": scrollable || void 0,
|
|
432
|
+
className,
|
|
433
|
+
...props
|
|
434
|
+
}
|
|
435
|
+
);
|
|
382
436
|
}
|
|
383
437
|
|
|
384
438
|
// src/ui/avatar/avatar.tsx
|
|
385
|
-
var
|
|
439
|
+
var import_react4 = require("react");
|
|
386
440
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
387
441
|
var sizes = { xs: "size-5 text-[10px]", sm: "size-6 text-xs", default: "size-8 text-sm", lg: "size-10 text-base" };
|
|
388
442
|
function Avatar({ className, size = "default", ...props }) {
|
|
389
443
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { "data-slot": "avatar", "data-size": size, className: cn("group/avatar relative flex shrink-0 overflow-hidden rounded-full bg-muted text-muted-foreground", sizes[size], className), ...props });
|
|
390
444
|
}
|
|
391
445
|
function AvatarImage({ className, ...props }) {
|
|
392
|
-
const [failed, setFailed] = (0,
|
|
446
|
+
const [failed, setFailed] = (0, import_react4.useState)(false);
|
|
393
447
|
if (failed) return null;
|
|
394
448
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("img", { "data-slot": "avatar-image", className: cn("aspect-square size-full object-cover", className), onError: () => setFailed(true), ...props });
|
|
395
449
|
}
|
|
@@ -446,10 +500,19 @@ function BreadcrumbSeparator({ children = "/", className, ...props }) {
|
|
|
446
500
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { "data-slot": "breadcrumb-separator", "aria-hidden": "true", className: cn("text-muted-foreground/60", className), ...props, children });
|
|
447
501
|
}
|
|
448
502
|
|
|
503
|
+
// src/ui/button-group/button-group.tsx
|
|
504
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
505
|
+
function ButtonGroup({ className, ...props }) {
|
|
506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { role: "group", "data-slot": "button-group", className: cn("inline-flex items-center gap-2", className), ...props });
|
|
507
|
+
}
|
|
508
|
+
function ButtonGroupText({ className, ...props }) {
|
|
509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { "data-slot": "button-group-text", className: cn("text-sm text-muted-foreground", className), ...props });
|
|
510
|
+
}
|
|
511
|
+
|
|
449
512
|
// src/ui/button/button.tsx
|
|
450
513
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
451
514
|
var import_react_aria_components3 = require("react-aria-components");
|
|
452
|
-
var
|
|
515
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
453
516
|
var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
454
517
|
"inline-flex shrink-0 cursor-pointer items-center justify-center gap-1.5 rounded-lg border border-transparent text-sm font-medium whitespace-nowrap transition-[background-color,border-color,color,box-shadow,transform] duration-150 outline-none focus-visible:ring-3 focus-visible:ring-ring/50 data-pressed:scale-[0.98] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none motion-reduce:data-pressed:transform-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
455
518
|
{
|
|
@@ -474,16 +537,7 @@ var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
|
474
537
|
}
|
|
475
538
|
);
|
|
476
539
|
function Button2({ className, variant, size, ...props }) {
|
|
477
|
-
return /* @__PURE__ */ (0,
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
// src/ui/button-group/button-group.tsx
|
|
481
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
482
|
-
function ButtonGroup({ className, ...props }) {
|
|
483
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { role: "group", "data-slot": "button-group", className: cn("inline-flex items-center gap-2", className), ...props });
|
|
484
|
-
}
|
|
485
|
-
function ButtonGroupText({ className, ...props }) {
|
|
486
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { "data-slot": "button-group-text", className: cn("text-sm text-muted-foreground", className), ...props });
|
|
540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_aria_components3.Button, { "data-slot": "button", className: cn(buttonVariants({ variant, size }), className), ...props });
|
|
487
541
|
}
|
|
488
542
|
|
|
489
543
|
// src/ui/card/card.tsx
|
|
@@ -509,17 +563,17 @@ function CardFooter({ className, ...props }) {
|
|
|
509
563
|
|
|
510
564
|
// src/ui/checkbox/checkbox.tsx
|
|
511
565
|
var import_react_aria_components4 = require("react-aria-components");
|
|
512
|
-
var
|
|
566
|
+
var import_lucide_react2 = require("lucide-react");
|
|
513
567
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
514
568
|
function Checkbox({ className, children, ...props }) {
|
|
515
569
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_aria_components4.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_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
516
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { "aria-hidden": "true", className: "grid size-4 place-items-center rounded border border-border bg-background text-primary-foreground transition-colors group-data-selected:border-primary group-data-selected:bg-primary group-data-focus-visible:ring-3 group-data-focus-visible:ring-ring/50", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
570
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { "aria-hidden": "true", className: "grid size-4 place-items-center rounded border border-border bg-background text-primary-foreground transition-colors group-data-selected:border-primary group-data-selected:bg-primary group-data-focus-visible:ring-3 group-data-focus-visible:ring-ring/50", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react2.Check, { className: "size-3 opacity-0 transition-opacity group-data-selected:opacity-100 motion-reduce:transition-none" }) }),
|
|
517
571
|
typeof children === "function" ? children(state) : children
|
|
518
572
|
] }) });
|
|
519
573
|
}
|
|
520
574
|
|
|
521
575
|
// src/ui/combobox/combobox.tsx
|
|
522
|
-
var
|
|
576
|
+
var import_react5 = require("react");
|
|
523
577
|
var import_react_aria_components5 = require("react-aria-components");
|
|
524
578
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
525
579
|
var Combobox = import_react_aria_components5.ComboBox;
|
|
@@ -536,18 +590,18 @@ function ComboboxItem({ className, children, ...props }) {
|
|
|
536
590
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_aria_components5.ListBoxItem, { "data-slot": "combobox-item", className: cn("flex w-full cursor-default items-center justify-between rounded-md px-2 py-2 text-sm outline-none transition-colors data-focused:bg-muted data-focused:text-foreground data-hovered:bg-muted data-disabled:pointer-events-none data-disabled:opacity-50", className), ...props, children });
|
|
537
591
|
}
|
|
538
592
|
function HighlightMatch({ text, query, className }) {
|
|
539
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className, children: getTextMatchParts(text, query).map((part, index) => part.match ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("mark", { className: "rounded bg-accent px-0.5 text-accent-foreground", children: part.text }, `${part.text}-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className, children: getTextMatchParts(text, query).map((part, index) => part.match ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("mark", { className: "rounded bg-accent px-0.5 text-accent-foreground", children: part.text }, `${part.text}-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react5.Fragment, { children: part.text }, `${part.text}-${index}`)) });
|
|
540
594
|
}
|
|
541
595
|
function AutocompleteCombobox({ items, getItemKey, getItemLabel, renderItem, inputValue: controlledInputValue, onInputChange, selectedKey, onSelectionChange, label, description, errorMessage, emptyState = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "px-3 py-7 text-center text-sm text-muted-foreground", children: "No hay resultados." }), suggestion = true, placeholder, className, onKeyDown: _onKeyDown, ...props }) {
|
|
542
|
-
const [internalInputValue, setInternalInputValue] = (0,
|
|
596
|
+
const [internalInputValue, setInternalInputValue] = (0, import_react5.useState)("");
|
|
543
597
|
const inputValue = controlledInputValue ?? internalInputValue;
|
|
544
598
|
const setInputValue = (value) => {
|
|
545
599
|
setInternalInputValue(value);
|
|
546
600
|
onInputChange?.(value);
|
|
547
601
|
};
|
|
548
602
|
const normalizedQuery = inputValue.trim().toLocaleLowerCase();
|
|
549
|
-
const filteredItems = (0,
|
|
550
|
-
const suggestedItem = (0,
|
|
603
|
+
const filteredItems = (0, import_react5.useMemo)(() => normalizedQuery ? items.filter((item) => getItemLabel(item).toLocaleLowerCase().includes(normalizedQuery)) : [...items], [getItemLabel, items, normalizedQuery]);
|
|
604
|
+
const suggestedItem = (0, import_react5.useMemo)(() => !suggestion || !normalizedQuery ? void 0 : items.find((item) => getItemLabel(item).toLocaleLowerCase().startsWith(normalizedQuery) && getItemLabel(item).length > inputValue.length), [getItemLabel, inputValue.length, items, normalizedQuery, suggestion]);
|
|
551
605
|
const suggestionLabel = suggestedItem ? getItemLabel(suggestedItem) : void 0;
|
|
552
606
|
const acceptSuggestion = () => {
|
|
553
607
|
if (!suggestedItem || !suggestionLabel) return false;
|
|
@@ -596,54 +650,117 @@ function CommandItem({ className, ...props }) {
|
|
|
596
650
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_aria_components6.ListBoxItem, { "data-slot": "command-item", className: cn("flex cursor-default items-center 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 });
|
|
597
651
|
}
|
|
598
652
|
|
|
599
|
-
// src/ui/dialog/dialog.tsx
|
|
600
|
-
var
|
|
601
|
-
var import_react9 = require("@phosphor-icons/react");
|
|
653
|
+
// src/ui/modal-dialog/modal-dialog.tsx
|
|
654
|
+
var import_lucide_react3 = require("lucide-react");
|
|
602
655
|
var import_react_aria_components7 = require("react-aria-components");
|
|
603
656
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
604
|
-
var
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
657
|
+
var sizeClasses = {
|
|
658
|
+
sm: "w-[min(calc(100dvw-2rem),24rem)]",
|
|
659
|
+
md: "w-[min(calc(100dvw-2rem),28rem)]",
|
|
660
|
+
lg: "w-[min(calc(100dvw-2rem),36rem)]"
|
|
661
|
+
};
|
|
662
|
+
function ModalDialog({
|
|
663
|
+
open,
|
|
664
|
+
onOpenChange,
|
|
665
|
+
title,
|
|
666
|
+
description,
|
|
667
|
+
children,
|
|
668
|
+
footer,
|
|
669
|
+
size = "sm",
|
|
670
|
+
showCloseButton = true,
|
|
671
|
+
className,
|
|
672
|
+
footerClassName,
|
|
673
|
+
...props
|
|
674
|
+
}) {
|
|
675
|
+
const layoutClass = children ? footer ? "grid-rows-[auto_minmax(0,1fr)_auto]" : "grid-rows-[auto_minmax(0,1fr)]" : "grid-rows-[auto_auto]";
|
|
676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
677
|
+
import_react_aria_components7.ModalOverlay,
|
|
678
|
+
{
|
|
679
|
+
isOpen: open,
|
|
680
|
+
onOpenChange,
|
|
681
|
+
className: "fixed inset-0 z-50 grid place-items-center bg-black/20 p-4 backdrop-blur-[1px] motion-safe:data-entering:animate-ui-overlay-in motion-safe:data-exiting:animate-ui-overlay-out",
|
|
682
|
+
...props,
|
|
683
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
684
|
+
import_react_aria_components7.Modal,
|
|
685
|
+
{
|
|
686
|
+
className: cn(
|
|
687
|
+
"max-h-[calc(100dvh-2rem)] outline-none motion-safe:data-entering:animate-ui-surface-in motion-safe:data-exiting:animate-ui-surface-out",
|
|
688
|
+
sizeClasses[size],
|
|
689
|
+
className
|
|
690
|
+
),
|
|
691
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
692
|
+
import_react_aria_components7.Dialog,
|
|
693
|
+
{
|
|
694
|
+
className: cn(
|
|
695
|
+
"grid max-h-[calc(100dvh-2rem)] overflow-hidden rounded-xl bg-background text-foreground shadow-xl outline-none",
|
|
696
|
+
layoutClass
|
|
697
|
+
),
|
|
698
|
+
children: ({ close }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
699
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("header", { "data-slot": "modal-dialog-header", className: "flex items-start gap-3 border-b border-border px-5 py-4", children: [
|
|
700
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
701
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_aria_components7.Heading, { slot: "title", className: "font-heading text-base leading-none font-medium", children: title }),
|
|
702
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_aria_components7.Text, { slot: "description", className: "mt-2 text-sm text-muted-foreground", children: description }) : null
|
|
703
|
+
] }),
|
|
704
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
705
|
+
Button2,
|
|
706
|
+
{
|
|
707
|
+
"aria-label": "Cerrar di\xE1logo",
|
|
708
|
+
variant: "ghost",
|
|
709
|
+
size: "icon",
|
|
710
|
+
className: "-mr-2 -mt-1",
|
|
711
|
+
onPress: close,
|
|
712
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react3.X, { "aria-hidden": "true", className: "size-4" })
|
|
713
|
+
}
|
|
714
|
+
) : null
|
|
715
|
+
] }),
|
|
716
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { "data-slot": "modal-dialog-body", className: "min-h-0 overflow-y-auto px-5 py-4", children }) : null,
|
|
717
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
718
|
+
"footer",
|
|
719
|
+
{
|
|
720
|
+
"data-slot": "modal-dialog-footer",
|
|
721
|
+
className: cn(
|
|
722
|
+
"flex flex-col-reverse gap-2 border-t border-border bg-muted/50 px-5 py-4 sm:flex-row sm:flex-wrap sm:justify-end",
|
|
723
|
+
footerClassName
|
|
724
|
+
),
|
|
725
|
+
children: footer
|
|
726
|
+
}
|
|
727
|
+
) : null
|
|
728
|
+
] })
|
|
729
|
+
}
|
|
730
|
+
)
|
|
731
|
+
}
|
|
732
|
+
)
|
|
733
|
+
}
|
|
734
|
+
);
|
|
632
735
|
}
|
|
633
736
|
|
|
634
737
|
// src/ui/confirm-dialog/confirm-dialog.tsx
|
|
635
738
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
636
|
-
function ConfirmDialog({
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
739
|
+
function ConfirmDialog({
|
|
740
|
+
open,
|
|
741
|
+
onOpenChange,
|
|
742
|
+
title,
|
|
743
|
+
description,
|
|
744
|
+
confirmLabel = "Confirmar",
|
|
745
|
+
cancelLabel = "Cancelar",
|
|
746
|
+
destructive = false,
|
|
747
|
+
pending = false,
|
|
748
|
+
onConfirm
|
|
749
|
+
}) {
|
|
750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
751
|
+
ModalDialog,
|
|
752
|
+
{
|
|
753
|
+
open,
|
|
754
|
+
onOpenChange,
|
|
755
|
+
title,
|
|
756
|
+
description,
|
|
757
|
+
showCloseButton: false,
|
|
758
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
759
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button2, { variant: "outline", isDisabled: pending, onPress: () => onOpenChange(false), children: cancelLabel }),
|
|
760
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button2, { variant: destructive ? "destructive" : "default", isDisabled: pending, onPress: onConfirm, children: confirmLabel })
|
|
761
|
+
] })
|
|
762
|
+
}
|
|
763
|
+
);
|
|
647
764
|
}
|
|
648
765
|
|
|
649
766
|
// src/ui/drawer/drawer.tsx
|
|
@@ -694,10 +811,10 @@ function EmptyStateDescription({ className, ...props }) {
|
|
|
694
811
|
}
|
|
695
812
|
|
|
696
813
|
// src/ui/label/label.tsx
|
|
697
|
-
var
|
|
814
|
+
var import_react6 = require("react");
|
|
698
815
|
var import_react_aria_components10 = require("react-aria-components");
|
|
699
816
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
700
|
-
var Label2 = (0,
|
|
817
|
+
var Label2 = (0, import_react6.forwardRef)(function Label3({ className, ...props }, ref) {
|
|
701
818
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_aria_components10.Label, { ref, "data-slot": "label", className: cn("flex items-center gap-2 text-sm font-medium leading-none select-none", className), ...props });
|
|
702
819
|
});
|
|
703
820
|
|
|
@@ -718,32 +835,32 @@ function FieldError2({ className, children, ...props }) {
|
|
|
718
835
|
}
|
|
719
836
|
|
|
720
837
|
// src/ui/form-feedback/form-feedback.tsx
|
|
721
|
-
var
|
|
722
|
-
var
|
|
838
|
+
var import_react7 = require("react");
|
|
839
|
+
var import_lucide_react4 = require("lucide-react");
|
|
723
840
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
724
841
|
function useFormFeedback(options) {
|
|
725
842
|
const resetMs = options?.successResetMs ?? 2500;
|
|
726
|
-
const [state, setState] = (0,
|
|
727
|
-
const timer = (0,
|
|
728
|
-
const clearTimer = (0,
|
|
843
|
+
const [state, setState] = (0, import_react7.useState)({ status: "idle" });
|
|
844
|
+
const timer = (0, import_react7.useRef)(null);
|
|
845
|
+
const clearTimer = (0, import_react7.useCallback)(() => {
|
|
729
846
|
if (timer.current) clearTimeout(timer.current);
|
|
730
847
|
timer.current = null;
|
|
731
848
|
}, []);
|
|
732
|
-
(0,
|
|
733
|
-
const setPending = (0,
|
|
849
|
+
(0, import_react7.useEffect)(() => () => clearTimer(), [clearTimer]);
|
|
850
|
+
const setPending = (0, import_react7.useCallback)(() => {
|
|
734
851
|
clearTimer();
|
|
735
852
|
setState({ status: "pending" });
|
|
736
853
|
}, [clearTimer]);
|
|
737
|
-
const setSuccess = (0,
|
|
854
|
+
const setSuccess = (0, import_react7.useCallback)((message) => {
|
|
738
855
|
clearTimer();
|
|
739
856
|
setState({ status: "success", message });
|
|
740
857
|
if (resetMs > 0) timer.current = setTimeout(() => setState({ status: "idle" }), resetMs);
|
|
741
858
|
}, [clearTimer, resetMs]);
|
|
742
|
-
const setError = (0,
|
|
859
|
+
const setError = (0, import_react7.useCallback)((message) => {
|
|
743
860
|
clearTimer();
|
|
744
861
|
setState({ status: "error", message });
|
|
745
862
|
}, [clearTimer]);
|
|
746
|
-
const reset = (0,
|
|
863
|
+
const reset = (0, import_react7.useCallback)(() => {
|
|
747
864
|
clearTimer();
|
|
748
865
|
setState({ status: "idle" });
|
|
749
866
|
}, [clearTimer]);
|
|
@@ -754,9 +871,9 @@ function FormFeedback({ state, className, pendingLabel = "Guardando\u2026", succ
|
|
|
754
871
|
const error = state.status === "error";
|
|
755
872
|
const success = state.status === "success";
|
|
756
873
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { role: error ? "alert" : "status", "aria-live": "polite", className: cn("inline-flex h-5 items-center gap-1.5 text-xs", error && "text-destructive", success && "text-success", state.status === "pending" && "text-muted-foreground", className), children: [
|
|
757
|
-
state.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
758
|
-
success && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
759
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
874
|
+
state.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react4.LoaderCircle, { "aria-hidden": "true", className: "size-3.5 animate-spin" }),
|
|
875
|
+
success && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react4.CheckCircle, { "aria-hidden": "true", className: "size-3.5" }),
|
|
876
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react4.CircleAlert, { "aria-hidden": "true", className: "size-3.5" }),
|
|
760
877
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: state.status === "pending" ? pendingLabel : success ? state.message ?? successLabel : state.message })
|
|
761
878
|
] });
|
|
762
879
|
}
|
|
@@ -832,23 +949,23 @@ function IconButton({
|
|
|
832
949
|
] });
|
|
833
950
|
}
|
|
834
951
|
|
|
952
|
+
// src/ui/input-group/input-group.tsx
|
|
953
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
954
|
+
|
|
835
955
|
// src/ui/input/input.tsx
|
|
836
|
-
var
|
|
956
|
+
var import_react8 = require("react");
|
|
837
957
|
var import_react_aria_components13 = require("react-aria-components");
|
|
838
958
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
839
|
-
var InputImpl = (0,
|
|
959
|
+
var InputImpl = (0, import_react8.forwardRef)(function Input2({ className, type, ...props }, ref) {
|
|
840
960
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components13.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 });
|
|
841
961
|
});
|
|
842
962
|
var Input3 = InputImpl;
|
|
843
963
|
|
|
844
|
-
// src/ui/input-group/input-group.tsx
|
|
845
|
-
var import_class_variance_authority3 = require("class-variance-authority");
|
|
846
|
-
|
|
847
964
|
// src/ui/textarea/textarea.tsx
|
|
848
|
-
var
|
|
965
|
+
var import_react9 = require("react");
|
|
849
966
|
var import_react_aria_components14 = require("react-aria-components");
|
|
850
967
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
851
|
-
var TextareaImpl = (0,
|
|
968
|
+
var TextareaImpl = (0, import_react9.forwardRef)(function Textarea({ className, ...props }, ref) {
|
|
852
969
|
return /* @__PURE__ */ (0, import_jsx_runtime25.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 });
|
|
853
970
|
});
|
|
854
971
|
var Textarea2 = TextareaImpl;
|
|
@@ -885,11 +1002,11 @@ function KbdGroup({ className, ...props }) {
|
|
|
885
1002
|
}
|
|
886
1003
|
|
|
887
1004
|
// src/ui/loading-overlay/loading-overlay.tsx
|
|
888
|
-
var
|
|
1005
|
+
var import_lucide_react5 = require("lucide-react");
|
|
889
1006
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
890
1007
|
function LoadingOverlay({ label = "Cargando", className, ...props }) {
|
|
891
1008
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { role: "status", "aria-live": "polite", className: cn("absolute inset-0 z-10 flex items-center justify-center bg-background/70 backdrop-blur-[2px]", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-2 text-sm shadow-sm", children: [
|
|
892
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1009
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react5.LoaderCircle, { className: "animate-spin", "aria-hidden": "true" }),
|
|
893
1010
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: label })
|
|
894
1011
|
] }) });
|
|
895
1012
|
}
|
|
@@ -927,7 +1044,7 @@ function PageHeaderActions({ className, ...props }) {
|
|
|
927
1044
|
}
|
|
928
1045
|
|
|
929
1046
|
// src/ui/pagination/pagination.tsx
|
|
930
|
-
var
|
|
1047
|
+
var import_lucide_react6 = require("lucide-react");
|
|
931
1048
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
932
1049
|
function Pagination({ page, pageCount, onPageChange, className }) {
|
|
933
1050
|
const pages = Array.from({ length: pageCount }, (_, index) => index + 1);
|
|
@@ -939,9 +1056,9 @@ function Pagination({ page, pageCount, onPageChange, className }) {
|
|
|
939
1056
|
pageCount
|
|
940
1057
|
] }),
|
|
941
1058
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
942
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Button2, { "aria-label": "P\xE1gina anterior", isDisabled: page <= 1, onPress: () => onPageChange(page - 1), size: "icon", variant: "ghost", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1059
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Button2, { "aria-label": "P\xE1gina anterior", isDisabled: page <= 1, onPress: () => onPageChange(page - 1), size: "icon", variant: "ghost", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react6.ChevronLeft, {}) }),
|
|
943
1060
|
pages.map((item) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Button2, { "aria-current": item === page ? "page" : void 0, "aria-label": `P\xE1gina ${item}`, onPress: () => onPageChange(item), size: "icon", variant: item === page ? "secondary" : "ghost", children: item }, item)),
|
|
944
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Button2, { "aria-label": "P\xE1gina siguiente", isDisabled: page >= pageCount, onPress: () => onPageChange(page + 1), size: "icon", variant: "ghost", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1061
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Button2, { "aria-label": "P\xE1gina siguiente", isDisabled: page >= pageCount, onPress: () => onPageChange(page + 1), size: "icon", variant: "ghost", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react6.ChevronRight, {}) })
|
|
945
1062
|
] })
|
|
946
1063
|
] });
|
|
947
1064
|
}
|
|
@@ -956,7 +1073,7 @@ function Popover4({ className, ...props }) {
|
|
|
956
1073
|
var PopoverContent = Popover4;
|
|
957
1074
|
|
|
958
1075
|
// src/ui/quantity-input/quantity-input.tsx
|
|
959
|
-
var
|
|
1076
|
+
var import_lucide_react7 = require("lucide-react");
|
|
960
1077
|
var import_react_aria_components17 = require("react-aria-components");
|
|
961
1078
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
962
1079
|
function QuantityInput({
|
|
@@ -982,9 +1099,9 @@ function QuantityInput({
|
|
|
982
1099
|
"data-slot": "quantity-input-group",
|
|
983
1100
|
className: "flex h-8 min-w-0 items-stretch overflow-hidden rounded-lg border border-border bg-background text-foreground transition-[border-color,box-shadow] focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 group-data-invalid/quantity-input:border-destructive",
|
|
984
1101
|
children: [
|
|
985
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_aria_components17.Button, { slot: "decrement", "aria-label": decrementAriaLabel, "data-slot": "quantity-input-decrement", className: "flex size-8 shrink-0 cursor-pointer items-center justify-center border-r border-border text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground data-focus-visible:bg-muted data-pressed:bg-muted data-disabled:pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1102
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_aria_components17.Button, { slot: "decrement", "aria-label": decrementAriaLabel, "data-slot": "quantity-input-decrement", className: "flex size-8 shrink-0 cursor-pointer items-center justify-center border-r border-border text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground data-focus-visible:bg-muted data-pressed:bg-muted data-disabled:pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react7.Minus, { "aria-hidden": "true", className: "size-4" }) }),
|
|
986
1103
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_aria_components17.Input, { "data-slot": "quantity-input-value", className: cn("w-14 min-w-0 bg-transparent px-1 text-center text-sm tabular-nums outline-none", inputClassName) }),
|
|
987
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_aria_components17.Button, { slot: "increment", "aria-label": incrementAriaLabel, "data-slot": "quantity-input-increment", className: "flex size-8 shrink-0 cursor-pointer items-center justify-center border-l border-border text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground data-focus-visible:bg-muted data-pressed:bg-muted data-disabled:pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1104
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_aria_components17.Button, { slot: "increment", "aria-label": incrementAriaLabel, "data-slot": "quantity-input-increment", className: "flex size-8 shrink-0 cursor-pointer items-center justify-center border-l border-border text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground data-focus-visible:bg-muted data-pressed:bg-muted data-disabled:pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react7.Plus, { "aria-hidden": "true", className: "size-4" }) })
|
|
988
1105
|
]
|
|
989
1106
|
}
|
|
990
1107
|
)
|
|
@@ -994,25 +1111,25 @@ function QuantityInput({
|
|
|
994
1111
|
|
|
995
1112
|
// src/ui/search-field/search-field.tsx
|
|
996
1113
|
var import_react_aria_components18 = require("react-aria-components");
|
|
997
|
-
var
|
|
1114
|
+
var import_lucide_react8 = require("lucide-react");
|
|
998
1115
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
999
1116
|
var SearchField = import_react_aria_components18.SearchField;
|
|
1000
1117
|
function SearchInput({ className, ...props }) {
|
|
1001
1118
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_aria_components18.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 });
|
|
1002
1119
|
}
|
|
1003
|
-
function SearchClearButton({ className, children = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1120
|
+
function SearchClearButton({ className, children = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react8.X, { "aria-hidden": "true", className: "size-4" }), ...props }) {
|
|
1004
1121
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_aria_components18.Button, { slot: "clear", "data-slot": "search-clear", className: cn("absolute top-1/2 right-1 rounded p-1 text-muted-foreground outline-none hover:bg-muted data-focus-visible:ring-2 data-focus-visible:ring-ring", className), ...props, children });
|
|
1005
1122
|
}
|
|
1006
1123
|
|
|
1007
1124
|
// src/ui/select/select.tsx
|
|
1008
1125
|
var import_react_aria_components19 = require("react-aria-components");
|
|
1009
|
-
var
|
|
1126
|
+
var import_lucide_react9 = require("lucide-react");
|
|
1010
1127
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1011
1128
|
var Select = import_react_aria_components19.Select;
|
|
1012
1129
|
function SelectTrigger({ className, children, ...props }) {
|
|
1013
1130
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_aria_components19.Button, { "data-slot": "select-trigger", className: cn("group/select-trigger 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_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
1014
1131
|
typeof children === "function" ? children(state) : children,
|
|
1015
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1132
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react9.ChevronDown, { "aria-hidden": "true", className: "ml-auto size-4 text-muted-foreground transition-transform group-data-pressed/select-trigger:rotate-180 motion-reduce:transition-none" })
|
|
1016
1133
|
] }) });
|
|
1017
1134
|
}
|
|
1018
1135
|
function SelectValue({ className, ...props }) {
|
|
@@ -1036,13 +1153,13 @@ function Separator({ className, orientation = "horizontal", ...props }) {
|
|
|
1036
1153
|
}
|
|
1037
1154
|
|
|
1038
1155
|
// src/ui/sidebar/sidebar.tsx
|
|
1039
|
-
var
|
|
1040
|
-
var
|
|
1156
|
+
var import_lucide_react10 = require("lucide-react");
|
|
1157
|
+
var import_react10 = require("react");
|
|
1041
1158
|
var import_react_aria_components21 = require("react-aria-components");
|
|
1042
1159
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1043
|
-
var SidebarContext = (0,
|
|
1160
|
+
var SidebarContext = (0, import_react10.createContext)(null);
|
|
1044
1161
|
function useSidebar() {
|
|
1045
|
-
const context = (0,
|
|
1162
|
+
const context = (0, import_react10.useContext)(SidebarContext);
|
|
1046
1163
|
if (!context)
|
|
1047
1164
|
throw new Error("useSidebar must be used inside SidebarProvider");
|
|
1048
1165
|
return context;
|
|
@@ -1051,8 +1168,8 @@ function SidebarProvider({
|
|
|
1051
1168
|
defaultCollapsed = false,
|
|
1052
1169
|
children
|
|
1053
1170
|
}) {
|
|
1054
|
-
const [collapsed, setCollapsed] = (0,
|
|
1055
|
-
const value = (0,
|
|
1171
|
+
const [collapsed, setCollapsed] = (0, import_react10.useState)(defaultCollapsed);
|
|
1172
|
+
const value = (0, import_react10.useMemo)(
|
|
1056
1173
|
() => ({
|
|
1057
1174
|
collapsed,
|
|
1058
1175
|
setCollapsed,
|
|
@@ -1110,7 +1227,7 @@ function SidebarSearch({
|
|
|
1110
1227
|
),
|
|
1111
1228
|
...props,
|
|
1112
1229
|
children: [
|
|
1113
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1230
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react10.Search, { className: "size-4 shrink-0" }),
|
|
1114
1231
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "flex-1 text-left", children: label }),
|
|
1115
1232
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("kbd", { className: "rounded bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground", children: shortcut })
|
|
1116
1233
|
]
|
|
@@ -1237,7 +1354,7 @@ function SidebarTrigger({ className, ...props }) {
|
|
|
1237
1354
|
variant: "ghost",
|
|
1238
1355
|
className: cn("ml-auto", className),
|
|
1239
1356
|
...props,
|
|
1240
|
-
children: collapsed ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1357
|
+
children: collapsed ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react10.ChevronRight, {}) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react10.ChevronLeft, {})
|
|
1241
1358
|
}
|
|
1242
1359
|
);
|
|
1243
1360
|
}
|
|
@@ -1269,7 +1386,7 @@ function SidebarMore({ className, ...props }) {
|
|
|
1269
1386
|
variant: "ghost",
|
|
1270
1387
|
className: cn("size-7", className),
|
|
1271
1388
|
...props,
|
|
1272
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1389
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react10.Ellipsis, {})
|
|
1273
1390
|
}
|
|
1274
1391
|
);
|
|
1275
1392
|
}
|
|
@@ -1282,13 +1399,13 @@ function Skeleton({ className, ...props }) {
|
|
|
1282
1399
|
|
|
1283
1400
|
// src/ui/submit-button/submit-button.tsx
|
|
1284
1401
|
var import_react_dom = require("react-dom");
|
|
1285
|
-
var
|
|
1402
|
+
var import_lucide_react11 = require("lucide-react");
|
|
1286
1403
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1287
1404
|
function SubmitButton({ pendingLabel = "Guardando\u2026", loading = false, children, isDisabled, size = "sm", ...props }) {
|
|
1288
1405
|
const { pending } = (0, import_react_dom.useFormStatus)();
|
|
1289
1406
|
const busy = pending || loading;
|
|
1290
1407
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Button2, { type: "submit", size, isDisabled: busy || isDisabled, "aria-busy": busy || void 0, ...props, children: busy ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
1291
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1408
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react11.LoaderCircle, { "aria-hidden": "true", className: "size-3.5 animate-spin" }),
|
|
1292
1409
|
pendingLabel
|
|
1293
1410
|
] }) : children });
|
|
1294
1411
|
}
|
|
@@ -1393,8 +1510,8 @@ function TabsContent({ className, ...props }) {
|
|
|
1393
1510
|
}
|
|
1394
1511
|
|
|
1395
1512
|
// src/ui/toast/toast.tsx
|
|
1396
|
-
var
|
|
1397
|
-
var
|
|
1513
|
+
var import_react11 = require("react");
|
|
1514
|
+
var import_lucide_react12 = require("lucide-react");
|
|
1398
1515
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1399
1516
|
var records = [];
|
|
1400
1517
|
var listeners = /* @__PURE__ */ new Set();
|
|
@@ -1457,25 +1574,25 @@ function Toaster({ position = "bottom-right" }) {
|
|
|
1457
1574
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_jsx_runtime43.Fragment, { children: Object.keys(positionClasses).map((item) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ToastViewport, { position: item, visiblePosition: position }, item)) });
|
|
1458
1575
|
}
|
|
1459
1576
|
function ToastViewport({ position, visiblePosition, className }) {
|
|
1460
|
-
const toasts = (0,
|
|
1577
|
+
const toasts = (0, import_react11.useSyncExternalStore)(subscribe, snapshot, snapshot).filter((item) => item.position === position);
|
|
1461
1578
|
if (visiblePosition && position !== visiblePosition && toasts.length === 0) return null;
|
|
1462
1579
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { "aria-label": `Notificaciones ${position}`, className: cn("pointer-events-none fixed z-50 flex w-[min(24rem,calc(100vw-2rem))] flex-col gap-2", positionClasses[position], className), children: toasts.map((item) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Toast, { ...item, onDismiss: () => dismiss(item.id) }, item.id)) });
|
|
1463
1580
|
}
|
|
1464
1581
|
function Toast({ id, title, description, variant = "default", action, state = "open", duration = 0, onDismiss }) {
|
|
1465
|
-
(0,
|
|
1582
|
+
(0, import_react11.useEffect)(() => {
|
|
1466
1583
|
if (state !== "open" || duration <= 0) return;
|
|
1467
1584
|
const timeout = window.setTimeout(() => dismiss(id), duration);
|
|
1468
1585
|
return () => window.clearTimeout(timeout);
|
|
1469
1586
|
}, [duration, id, state]);
|
|
1470
|
-
const Icon = variant === "success" ?
|
|
1587
|
+
const Icon = variant === "success" ? import_lucide_react12.CheckCircle : variant === "error" ? import_lucide_react12.XCircle : variant === "warning" ? import_lucide_react12.CircleAlert : variant === "info" ? import_lucide_react12.Info : import_lucide_react12.Info;
|
|
1471
1588
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { role: variant === "error" ? "alert" : "status", "data-state": state, className: cn("pointer-events-auto w-full overflow-hidden rounded-xl border border-border/80 bg-background/95 p-3.5 text-foreground shadow-xl shadow-black/10 backdrop-blur-md animate-ui-toast-in", "data-[state=closing]:animate-ui-toast-out motion-reduce:animate-none", variant === "success" && "border-success/30", variant === "error" && "border-destructive/30", variant === "warning" && "border-warning/40"), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
1472
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Icon, { "aria-hidden": "true",
|
|
1589
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Icon, { "aria-hidden": "true", className: cn("mt-0.5 size-5 shrink-0", variant === "success" && "text-success", variant === "error" && "text-destructive", variant === "warning" && "text-warning", variant === "info" && "text-primary") }),
|
|
1473
1590
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
1474
1591
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "animate-ui-toast-title text-sm font-semibold", children: title }),
|
|
1475
1592
|
description && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "mt-1 max-h-20 animate-ui-toast-description overflow-hidden text-sm leading-5 text-muted-foreground data-[state=closing]:max-h-0", "data-state": state, children: description }),
|
|
1476
1593
|
action && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Button2, { size: "sm", variant: "link", onPress: action.onPress, className: "mt-1 h-auto px-0", children: action.label })
|
|
1477
1594
|
] }),
|
|
1478
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Button2, { "aria-label": "Cerrar notificaci\xF3n", onPress: onDismiss, size: "icon", variant: "ghost", className: "-mr-2 -mt-2 size-7", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1595
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Button2, { "aria-label": "Cerrar notificaci\xF3n", onPress: onDismiss, size: "icon", variant: "ghost", className: "-mr-2 -mt-2 size-7", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react12.X, {}) })
|
|
1479
1596
|
] }) });
|
|
1480
1597
|
}
|
|
1481
1598
|
|
|
@@ -1504,6 +1621,8 @@ function ToolbarSpacer({ className, ...props }) {
|
|
|
1504
1621
|
AppShellContent,
|
|
1505
1622
|
AppShellHeader,
|
|
1506
1623
|
AppShellMain,
|
|
1624
|
+
AppShellMobileHeader,
|
|
1625
|
+
AppShellSidebar,
|
|
1507
1626
|
AutocompleteCombobox,
|
|
1508
1627
|
Avatar,
|
|
1509
1628
|
AvatarBadge,
|
|
@@ -1539,13 +1658,6 @@ function ToolbarSpacer({ className, ...props }) {
|
|
|
1539
1658
|
CommandItem,
|
|
1540
1659
|
CommandList,
|
|
1541
1660
|
ConfirmDialog,
|
|
1542
|
-
Dialog,
|
|
1543
|
-
DialogClose,
|
|
1544
|
-
DialogContent,
|
|
1545
|
-
DialogDescription,
|
|
1546
|
-
DialogFooter,
|
|
1547
|
-
DialogHeader,
|
|
1548
|
-
DialogTitle,
|
|
1549
1661
|
Drawer,
|
|
1550
1662
|
DrawerDescription,
|
|
1551
1663
|
DrawerFooter,
|
|
@@ -1582,6 +1694,7 @@ function ToolbarSpacer({ className, ...props }) {
|
|
|
1582
1694
|
MenuContent,
|
|
1583
1695
|
MenuItem,
|
|
1584
1696
|
MenuTrigger,
|
|
1697
|
+
ModalDialog,
|
|
1585
1698
|
PageHeader,
|
|
1586
1699
|
PageHeaderActions,
|
|
1587
1700
|
PageHeaderDescription,
|