@doscientos/ui 0.1.8 → 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 +211 -98
- 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 +204 -87
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
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,
|
|
@@ -368,17 +364,75 @@ 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
|
+
);
|
|
404
|
+
}
|
|
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
|
+
);
|
|
379
417
|
}
|
|
380
|
-
function AppShellContent({
|
|
381
|
-
|
|
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
|
|
@@ -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
|
|
@@ -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 import_react6 = require("react");
|
|
653
|
+
// src/ui/modal-dialog/modal-dialog.tsx
|
|
601
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
|
|
838
|
+
var import_react7 = require("react");
|
|
722
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]);
|
|
@@ -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;
|
|
@@ -1037,12 +1154,12 @@ function Separator({ className, orientation = "horizontal", ...props }) {
|
|
|
1037
1154
|
|
|
1038
1155
|
// src/ui/sidebar/sidebar.tsx
|
|
1039
1156
|
var import_lucide_react10 = require("lucide-react");
|
|
1040
|
-
var
|
|
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,
|
|
@@ -1393,7 +1510,7 @@ function TabsContent({ className, ...props }) {
|
|
|
1393
1510
|
}
|
|
1394
1511
|
|
|
1395
1512
|
// src/ui/toast/toast.tsx
|
|
1396
|
-
var
|
|
1513
|
+
var import_react11 = require("react");
|
|
1397
1514
|
var import_lucide_react12 = require("lucide-react");
|
|
1398
1515
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1399
1516
|
var records = [];
|
|
@@ -1457,12 +1574,12 @@ 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);
|
|
@@ -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,
|