@motor-hero/ui-kit 0.16.1 → 0.18.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 CHANGED
@@ -62,6 +62,7 @@ __export(index_exports, {
62
62
  toast: () => import_sonner2.toast,
63
63
  useCustomToast: () => useCustomToast,
64
64
  useDisclosure: () => useDisclosure,
65
+ useIsDesktop: () => useIsDesktop,
65
66
  useTheme: () => useTheme
66
67
  });
67
68
  module.exports = __toCommonJS(index_exports);
@@ -614,7 +615,27 @@ PasswordInput.displayName = "PasswordInput";
614
615
  var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
615
616
  var import_cmdk = require("cmdk");
616
617
  var import_lucide_react4 = require("lucide-react");
618
+ var React5 = __toESM(require("react"), 1);
619
+ var import_vaul = require("vaul");
620
+
621
+ // src/hooks/use-is-desktop.ts
617
622
  var React4 = __toESM(require("react"), 1);
623
+ var DESKTOP_QUERY = "(min-width: 640px)";
624
+ function useIsDesktop() {
625
+ const [isDesktop, setIsDesktop] = React4.useState(
626
+ () => typeof window !== "undefined" ? window.matchMedia(DESKTOP_QUERY).matches : true
627
+ );
628
+ React4.useEffect(() => {
629
+ const mql = window.matchMedia(DESKTOP_QUERY);
630
+ const onChange = () => setIsDesktop(mql.matches);
631
+ onChange();
632
+ mql.addEventListener("change", onChange);
633
+ return () => mql.removeEventListener("change", onChange);
634
+ }, []);
635
+ return isDesktop;
636
+ }
637
+
638
+ // src/components/combobox.tsx
618
639
  var import_jsx_runtime16 = require("react/jsx-runtime");
619
640
  function Combobox({
620
641
  options,
@@ -629,84 +650,94 @@ function Combobox({
629
650
  "aria-invalid": ariaInvalid,
630
651
  "aria-describedby": ariaDescribedby
631
652
  }) {
632
- const [open, setOpen] = React4.useState(false);
653
+ const [open, setOpen] = React5.useState(false);
654
+ const isDesktop = useIsDesktop();
633
655
  const selected = options.find((option) => option.value === value);
634
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(PopoverPrimitive.Root, { open, onOpenChange: setOpen, modal: true, children: [
635
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PopoverPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
636
- "button",
637
- {
638
- type: "button",
639
- id,
640
- role: "combobox",
641
- "aria-expanded": open,
642
- "aria-invalid": ariaInvalid,
643
- "aria-describedby": ariaDescribedby,
644
- disabled,
645
- className: cn(
646
- "flex h-9 w-full cursor-pointer items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive",
647
- className
648
- ),
649
- children: [
650
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
651
- "span",
652
- {
653
- className: cn("truncate", !selected && "text-muted-foreground"),
654
- children: selected ? selected.label : placeholder
655
- }
656
- ),
657
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react4.ChevronsUpDown, { className: "h-4 w-4 shrink-0 opacity-50" })
658
- ]
659
- }
660
- ) }),
661
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
662
- PopoverPrimitive.Content,
663
- {
664
- align: "start",
665
- sideOffset: 4,
666
- className: "z-50 overflow-hidden rounded-md border bg-popover p-0 text-popover-foreground shadow-md",
667
- style: { width: "var(--radix-popover-trigger-width)" },
668
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_cmdk.Command, { className: "flex h-full w-full flex-col overflow-hidden", children: [
669
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center border-b px-3", children: [
670
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react4.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
656
+ const trigger = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
657
+ "button",
658
+ {
659
+ type: "button",
660
+ id,
661
+ role: "combobox",
662
+ "aria-expanded": open,
663
+ "aria-invalid": ariaInvalid,
664
+ "aria-describedby": ariaDescribedby,
665
+ disabled,
666
+ className: cn(
667
+ "flex h-9 w-full cursor-pointer items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive",
668
+ className
669
+ ),
670
+ children: [
671
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: cn("truncate", !selected && "text-muted-foreground"), children: selected ? selected.label : placeholder }),
672
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react4.ChevronsUpDown, { className: "h-4 w-4 shrink-0 opacity-50" })
673
+ ]
674
+ }
675
+ );
676
+ const command = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_cmdk.Command, { className: "flex h-full w-full flex-col overflow-hidden", children: [
677
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center border-b px-3", children: [
678
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react4.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
679
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
680
+ import_cmdk.Command.Input,
681
+ {
682
+ placeholder: searchPlaceholder,
683
+ className: "flex h-11 w-full bg-transparent py-2 text-base outline-none placeholder:text-muted-foreground sm:h-9 sm:text-sm"
684
+ }
685
+ )
686
+ ] }),
687
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_cmdk.Command.List, { className: "max-h-[50vh] overflow-y-auto overflow-x-hidden p-1 sm:max-h-60", children: [
688
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_cmdk.Command.Empty, { className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage }),
689
+ options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
690
+ import_cmdk.Command.Item,
691
+ {
692
+ value: option.label,
693
+ disabled: option.disabled,
694
+ onSelect: () => {
695
+ onChange(option.value);
696
+ setOpen(false);
697
+ },
698
+ className: "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-2.5 text-sm outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 sm:py-1.5",
699
+ children: [
671
700
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
672
- import_cmdk.Command.Input,
701
+ import_lucide_react4.Check,
673
702
  {
674
- placeholder: searchPlaceholder,
675
- className: "flex h-9 w-full bg-transparent py-2 text-sm outline-none placeholder:text-muted-foreground"
703
+ className: cn(
704
+ "h-4 w-4 shrink-0",
705
+ value === option.value ? "opacity-100" : "opacity-0"
706
+ )
676
707
  }
677
- )
678
- ] }),
679
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_cmdk.Command.List, { className: "max-h-60 overflow-y-auto overflow-x-hidden p-1", children: [
680
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_cmdk.Command.Empty, { className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage }),
681
- options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
682
- import_cmdk.Command.Item,
683
- {
684
- value: option.label,
685
- disabled: option.disabled,
686
- onSelect: () => {
687
- onChange(option.value);
688
- setOpen(false);
689
- },
690
- className: "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",
691
- children: [
692
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
693
- import_lucide_react4.Check,
694
- {
695
- className: cn(
696
- "h-4 w-4 shrink-0",
697
- value === option.value ? "opacity-100" : "opacity-0"
698
- )
699
- }
700
- ),
701
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "truncate", children: option.label })
702
- ]
703
- },
704
- option.value
705
- ))
706
- ] })
707
- ] })
708
- }
709
- ) })
708
+ ),
709
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "truncate", children: option.label })
710
+ ]
711
+ },
712
+ option.value
713
+ ))
714
+ ] })
715
+ ] });
716
+ if (isDesktop) {
717
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(PopoverPrimitive.Root, { open, onOpenChange: setOpen, modal: true, children: [
718
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PopoverPrimitive.Trigger, { asChild: true, children: trigger }),
719
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
720
+ PopoverPrimitive.Content,
721
+ {
722
+ align: "start",
723
+ sideOffset: 4,
724
+ className: "z-50 overflow-hidden rounded-md border bg-popover p-0 text-popover-foreground shadow-md",
725
+ style: { width: "var(--radix-popover-trigger-width)" },
726
+ children: command
727
+ }
728
+ ) })
729
+ ] });
730
+ }
731
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_vaul.Drawer.Root, { open, onOpenChange: setOpen, children: [
732
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_vaul.Drawer.Trigger, { asChild: true, children: trigger }),
733
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_vaul.Drawer.Portal, { children: [
734
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_vaul.Drawer.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
735
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_vaul.Drawer.Content, { className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[85vh] flex-col rounded-t-2xl border bg-popover text-popover-foreground outline-none", children: [
736
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_vaul.Drawer.Title, { className: "sr-only", children: placeholder }),
737
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
738
+ command
739
+ ] })
740
+ ] })
710
741
  ] });
711
742
  }
712
743
 
@@ -898,7 +929,7 @@ function Toaster(props) {
898
929
 
899
930
  // src/components/app-shell.tsx
900
931
  var import_lucide_react6 = require("lucide-react");
901
- var import_react5 = require("react");
932
+ var import_react6 = require("react");
902
933
 
903
934
  // src/components/sidebar-nav.tsx
904
935
  var import_react4 = require("react");
@@ -947,6 +978,8 @@ function SidebarNav({
947
978
  // src/components/user-menu.tsx
948
979
  var DropdownMenu2 = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
949
980
  var import_lucide_react5 = require("lucide-react");
981
+ var import_react5 = require("react");
982
+ var import_vaul2 = require("vaul");
950
983
  var import_jsx_runtime24 = require("react/jsx-runtime");
951
984
  function initials(user) {
952
985
  const source = user?.name?.trim() || user?.email?.trim();
@@ -956,6 +989,7 @@ function initials(user) {
956
989
  return source.slice(0, 2).toUpperCase();
957
990
  }
958
991
  var itemClass = "flex w-full cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent";
992
+ var sheetItemClass = "flex w-full cursor-pointer select-none items-center gap-3 rounded-md px-3 py-3 text-base outline-none transition-colors hover:bg-accent active:bg-accent";
959
993
  function UserMenu({
960
994
  user,
961
995
  items = [],
@@ -964,51 +998,151 @@ function UserMenu({
964
998
  renderLink = defaultRenderLink,
965
999
  align = "end"
966
1000
  }) {
1001
+ const isDesktop = useIsDesktop();
1002
+ const [open, setOpen] = (0, import_react5.useState)(false);
967
1003
  const label = initials(user);
968
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DropdownMenu2.Root, { children: [
969
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenu2.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
970
- "button",
971
- {
972
- type: "button",
973
- className: "inline-flex h-9 w-9 items-center justify-center overflow-hidden rounded-full border border-input bg-background text-xs font-semibold shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
974
- "aria-label": "Menu do usu\xE1rio",
975
- "data-testid": "user-menu",
976
- children: user?.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("img", { src: user.avatarUrl, alt: user.name ?? user.email ?? "Avatar", className: "h-full w-full object-cover" }) : label ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: label }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react5.User, { className: "h-4 w-4" })
977
- }
978
- ) }),
979
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenu2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
980
- DropdownMenu2.Content,
981
- {
982
- align,
983
- sideOffset: 6,
984
- className: "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",
985
- children: [
986
- (user?.name || user?.email) && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
987
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "px-2 py-1.5", children: [
988
- user.name && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "truncate text-sm font-medium", children: user.name }),
989
- user.email && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "truncate text-xs text-muted-foreground", children: user.email })
1004
+ const trigger = /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1005
+ "button",
1006
+ {
1007
+ type: "button",
1008
+ className: "inline-flex h-9 w-9 items-center justify-center overflow-hidden rounded-full border border-input bg-background text-xs font-semibold shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1009
+ "aria-label": "Menu do usu\xE1rio",
1010
+ "data-testid": "user-menu",
1011
+ children: user?.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1012
+ "img",
1013
+ {
1014
+ src: user.avatarUrl,
1015
+ alt: user.name ?? user.email ?? "Avatar",
1016
+ className: "h-full w-full object-cover"
1017
+ }
1018
+ ) : label ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: label }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react5.User, { className: "h-4 w-4" })
1019
+ }
1020
+ );
1021
+ const userInfo = (user?.name || user?.email) && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "px-2 py-1.5", children: [
1022
+ user.name && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "truncate text-sm font-medium", children: user.name }),
1023
+ user.email && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "truncate text-xs text-muted-foreground", children: user.email })
1024
+ ] });
1025
+ if (isDesktop) {
1026
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DropdownMenu2.Root, { open, onOpenChange: setOpen, children: [
1027
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenu2.Trigger, { asChild: true, children: trigger }),
1028
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenu2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
1029
+ DropdownMenu2.Content,
1030
+ {
1031
+ align,
1032
+ sideOffset: 6,
1033
+ className: "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",
1034
+ children: [
1035
+ userInfo && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
1036
+ userInfo,
1037
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenu2.Separator, { className: "-mx-1 my-1 h-px bg-border" })
990
1038
  ] }),
991
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenu2.Separator, { className: "-mx-1 my-1 h-px bg-border" })
992
- ] }),
993
- items.map(
994
- (item) => item.href ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenu2.Item, { asChild: true, children: renderLink({ href: item.href, className: itemClass, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
995
- item.icon,
996
- item.label
997
- ] }) }) }, item.label) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DropdownMenu2.Item, { className: itemClass, onClick: item.onClick, children: [
998
- item.icon,
999
- item.label
1000
- ] }, item.label)
1001
- ),
1002
- onLogout && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
1003
- items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenu2.Separator, { className: "-mx-1 my-1 h-px bg-border" }),
1004
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DropdownMenu2.Item, { className: cn(itemClass, "text-destructive focus:bg-destructive/10"), onClick: onLogout, children: [
1005
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react5.LogOut, { className: "h-4 w-4" }),
1006
- logoutLabel
1039
+ items.map(
1040
+ (item) => item.href ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenu2.Item, { asChild: true, children: renderLink({
1041
+ href: item.href,
1042
+ className: itemClass,
1043
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
1044
+ item.icon,
1045
+ item.label
1046
+ ] })
1047
+ }) }, item.label) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
1048
+ DropdownMenu2.Item,
1049
+ {
1050
+ className: itemClass,
1051
+ onClick: item.onClick,
1052
+ children: [
1053
+ item.icon,
1054
+ item.label
1055
+ ]
1056
+ },
1057
+ item.label
1058
+ )
1059
+ ),
1060
+ onLogout && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
1061
+ items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DropdownMenu2.Separator, { className: "-mx-1 my-1 h-px bg-border" }),
1062
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
1063
+ DropdownMenu2.Item,
1064
+ {
1065
+ className: cn(
1066
+ itemClass,
1067
+ "text-destructive focus:bg-destructive/10"
1068
+ ),
1069
+ onClick: onLogout,
1070
+ children: [
1071
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react5.LogOut, { className: "h-4 w-4" }),
1072
+ logoutLabel
1073
+ ]
1074
+ }
1075
+ )
1007
1076
  ] })
1008
- ] })
1009
- ]
1010
- }
1011
- ) })
1077
+ ]
1078
+ }
1079
+ ) })
1080
+ ] });
1081
+ }
1082
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_vaul2.Drawer.Root, { open, onOpenChange: setOpen, children: [
1083
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_vaul2.Drawer.Trigger, { asChild: true, children: trigger }),
1084
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_vaul2.Drawer.Portal, { children: [
1085
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_vaul2.Drawer.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
1086
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_vaul2.Drawer.Content, { className: "fixed inset-x-0 bottom-0 z-50 flex flex-col rounded-t-2xl border bg-popover p-2 pb-[max(0.5rem,env(safe-area-inset-bottom))] text-popover-foreground outline-none", children: [
1087
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_vaul2.Drawer.Title, { className: "sr-only", children: "Menu do usu\xE1rio" }),
1088
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
1089
+ userInfo && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
1090
+ userInfo,
1091
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "-mx-1 my-1 h-px bg-border" })
1092
+ ] }),
1093
+ items.map(
1094
+ (item) => item.href ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1095
+ "span",
1096
+ {
1097
+ onClick: () => setOpen(false),
1098
+ onKeyDown: () => setOpen(false),
1099
+ children: renderLink({
1100
+ href: item.href,
1101
+ className: sheetItemClass,
1102
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
1103
+ item.icon,
1104
+ item.label
1105
+ ] })
1106
+ })
1107
+ },
1108
+ item.label
1109
+ ) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
1110
+ "button",
1111
+ {
1112
+ type: "button",
1113
+ className: sheetItemClass,
1114
+ onClick: () => {
1115
+ item.onClick?.();
1116
+ setOpen(false);
1117
+ },
1118
+ children: [
1119
+ item.icon,
1120
+ item.label
1121
+ ]
1122
+ },
1123
+ item.label
1124
+ )
1125
+ ),
1126
+ onLogout && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
1127
+ items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "-mx-1 my-1 h-px bg-border" }),
1128
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
1129
+ "button",
1130
+ {
1131
+ type: "button",
1132
+ className: cn(sheetItemClass, "text-destructive"),
1133
+ onClick: () => {
1134
+ onLogout();
1135
+ setOpen(false);
1136
+ },
1137
+ children: [
1138
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react5.LogOut, { className: "h-4 w-4" }),
1139
+ logoutLabel
1140
+ ]
1141
+ }
1142
+ )
1143
+ ] })
1144
+ ] })
1145
+ ] })
1012
1146
  ] });
1013
1147
  }
1014
1148
 
@@ -1030,8 +1164,8 @@ function AppShell({
1030
1164
  defaultCollapsed = false,
1031
1165
  children
1032
1166
  }) {
1033
- const [collapsed, setCollapsed] = (0, import_react5.useState)(defaultCollapsed);
1034
- const [mobileOpen, setMobileOpen] = (0, import_react5.useState)(false);
1167
+ const [collapsed, setCollapsed] = (0, import_react6.useState)(defaultCollapsed);
1168
+ const [mobileOpen, setMobileOpen] = (0, import_react6.useState)(false);
1035
1169
  const nav = (isCollapsed, onNavigate) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1036
1170
  SidebarNav,
1037
1171
  {
@@ -1120,8 +1254,12 @@ function AppShell({
1120
1254
  // src/components/row-actions-menu.tsx
1121
1255
  var DropdownMenu3 = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
1122
1256
  var import_lucide_react7 = require("lucide-react");
1257
+ var import_react7 = require("react");
1258
+ var import_vaul3 = require("vaul");
1123
1259
  var import_jsx_runtime26 = require("react/jsx-runtime");
1260
+ var triggerClass = "inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50";
1124
1261
  var itemClass2 = "flex w-full cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
1262
+ var sheetItemClass2 = "flex w-full cursor-pointer select-none items-center gap-3 rounded-md px-3 py-3 text-base outline-none transition-colors hover:bg-accent active:bg-accent disabled:pointer-events-none disabled:opacity-50";
1125
1263
  function RowActionsMenu({
1126
1264
  actions,
1127
1265
  disabled = false,
@@ -1129,49 +1267,111 @@ function RowActionsMenu({
1129
1267
  label = "A\xE7\xF5es",
1130
1268
  renderLink = defaultRenderLink
1131
1269
  }) {
1270
+ const isDesktop = useIsDesktop();
1271
+ const [open, setOpen] = (0, import_react7.useState)(false);
1132
1272
  if (actions.length === 0) return null;
1133
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(DropdownMenu3.Root, { children: [
1134
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1135
- "button",
1136
- {
1137
- type: "button",
1138
- disabled,
1139
- "aria-label": label,
1140
- className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
1141
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react7.MoreVertical, { className: "h-4 w-4" })
1142
- }
1143
- ) }),
1144
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DropdownMenu3.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1145
- DropdownMenu3.Content,
1146
- {
1147
- align,
1148
- sideOffset: 6,
1149
- className: "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",
1150
- children: actions.map((action) => {
1151
- const cls = cn(itemClass2, action.destructive && "text-destructive focus:bg-destructive/10");
1152
- return action.href ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DropdownMenu3.Item, { asChild: true, disabled: action.disabled, children: renderLink({
1153
- href: action.href,
1154
- className: cls,
1155
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
1156
- action.icon,
1273
+ const trigger = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1274
+ "button",
1275
+ {
1276
+ type: "button",
1277
+ disabled,
1278
+ "aria-label": label,
1279
+ className: triggerClass,
1280
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react7.MoreVertical, { className: "h-4 w-4" })
1281
+ }
1282
+ );
1283
+ if (isDesktop) {
1284
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(DropdownMenu3.Root, { open, onOpenChange: setOpen, children: [
1285
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DropdownMenu3.Trigger, { asChild: true, children: trigger }),
1286
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DropdownMenu3.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1287
+ DropdownMenu3.Content,
1288
+ {
1289
+ align,
1290
+ sideOffset: 6,
1291
+ className: "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",
1292
+ children: actions.map((action) => {
1293
+ const cls = cn(
1294
+ itemClass2,
1295
+ action.destructive && "text-destructive focus:bg-destructive/10"
1296
+ );
1297
+ return action.href ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1298
+ DropdownMenu3.Item,
1299
+ {
1300
+ asChild: true,
1301
+ disabled: action.disabled,
1302
+ children: renderLink({
1303
+ href: action.href,
1304
+ className: cls,
1305
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
1306
+ action.icon,
1307
+ action.label
1308
+ ] })
1309
+ })
1310
+ },
1157
1311
  action.label
1158
- ] })
1159
- }) }, action.label) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
1160
- DropdownMenu3.Item,
1312
+ ) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
1313
+ DropdownMenu3.Item,
1314
+ {
1315
+ className: cls,
1316
+ disabled: action.disabled,
1317
+ onClick: action.onClick,
1318
+ children: [
1319
+ action.icon,
1320
+ action.label
1321
+ ]
1322
+ },
1323
+ action.label
1324
+ );
1325
+ })
1326
+ }
1327
+ ) })
1328
+ ] });
1329
+ }
1330
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_vaul3.Drawer.Root, { open, onOpenChange: setOpen, children: [
1331
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_vaul3.Drawer.Trigger, { asChild: true, children: trigger }),
1332
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_vaul3.Drawer.Portal, { children: [
1333
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_vaul3.Drawer.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
1334
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_vaul3.Drawer.Content, { className: "fixed inset-x-0 bottom-0 z-50 flex flex-col rounded-t-2xl border bg-popover p-2 pb-[max(0.5rem,env(safe-area-inset-bottom))] text-popover-foreground outline-none", children: [
1335
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_vaul3.Drawer.Title, { className: "sr-only", children: label }),
1336
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
1337
+ actions.map((action) => {
1338
+ const cls = cn(
1339
+ sheetItemClass2,
1340
+ action.destructive && "text-destructive"
1341
+ );
1342
+ const inner = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
1343
+ action.icon,
1344
+ action.label
1345
+ ] });
1346
+ return action.href ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1347
+ "span",
1161
1348
  {
1162
- className: cls,
1349
+ onClick: () => setOpen(false),
1350
+ onKeyDown: () => setOpen(false),
1351
+ children: renderLink({
1352
+ href: action.href,
1353
+ className: cls,
1354
+ children: inner
1355
+ })
1356
+ },
1357
+ action.label
1358
+ ) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1359
+ "button",
1360
+ {
1361
+ type: "button",
1163
1362
  disabled: action.disabled,
1164
- onClick: action.onClick,
1165
- children: [
1166
- action.icon,
1167
- action.label
1168
- ]
1363
+ className: cls,
1364
+ onClick: () => {
1365
+ action.onClick?.();
1366
+ setOpen(false);
1367
+ },
1368
+ children: inner
1169
1369
  },
1170
1370
  action.label
1171
1371
  );
1172
1372
  })
1173
- }
1174
- ) })
1373
+ ] })
1374
+ ] })
1175
1375
  ] });
1176
1376
  }
1177
1377
 
@@ -1185,20 +1385,20 @@ function extractApiError(err, fallbackMessage = "Ocorreu um erro inesperado.") {
1185
1385
  }
1186
1386
 
1187
1387
  // src/hooks/use-disclosure.ts
1188
- var import_react6 = require("react");
1388
+ var import_react8 = require("react");
1189
1389
  function useDisclosure(initial = false) {
1190
- const [open, setOpen] = (0, import_react6.useState)(initial);
1191
- const onOpen = (0, import_react6.useCallback)(() => setOpen(true), []);
1192
- const onClose = (0, import_react6.useCallback)(() => setOpen(false), []);
1193
- const onToggle = (0, import_react6.useCallback)(() => setOpen((v) => !v), []);
1390
+ const [open, setOpen] = (0, import_react8.useState)(initial);
1391
+ const onOpen = (0, import_react8.useCallback)(() => setOpen(true), []);
1392
+ const onClose = (0, import_react8.useCallback)(() => setOpen(false), []);
1393
+ const onToggle = (0, import_react8.useCallback)(() => setOpen((v) => !v), []);
1194
1394
  return { open, onOpen, onClose, onToggle, setOpen };
1195
1395
  }
1196
1396
 
1197
1397
  // src/hooks/use-toast.ts
1198
1398
  var import_sonner2 = require("sonner");
1199
- var import_react7 = require("react");
1399
+ var import_react9 = require("react");
1200
1400
  function useCustomToast() {
1201
- const showToast = (0, import_react7.useCallback)(
1401
+ const showToast = (0, import_react9.useCallback)(
1202
1402
  (title, description, status = "success") => {
1203
1403
  switch (status) {
1204
1404
  case "success":
@@ -1253,6 +1453,7 @@ function useCustomToast() {
1253
1453
  toast,
1254
1454
  useCustomToast,
1255
1455
  useDisclosure,
1456
+ useIsDesktop,
1256
1457
  useTheme
1257
1458
  });
1258
1459
  //# sourceMappingURL=index.cjs.map