@motor-hero/ui-kit 0.22.1 → 0.23.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/components/multi-combobox.d.ts +32 -0
- package/dist/components/multi-combobox.d.ts.map +1 -0
- package/dist/index.cjs +297 -148
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +303 -155
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/multi-combobox.tsx +189 -0
- package/src/index.ts +2 -0
package/dist/index.cjs
CHANGED
|
@@ -42,6 +42,7 @@ __export(index_exports, {
|
|
|
42
42
|
FormField: () => FormField,
|
|
43
43
|
MobileCardList: () => MobileCardList,
|
|
44
44
|
ModeToggle: () => ModeToggle,
|
|
45
|
+
MultiCombobox: () => MultiCombobox,
|
|
45
46
|
PageHeader: () => PageHeader,
|
|
46
47
|
Pagination: () => Pagination,
|
|
47
48
|
PasswordInput: () => PasswordInput,
|
|
@@ -815,12 +816,159 @@ function Combobox({
|
|
|
815
816
|
] });
|
|
816
817
|
}
|
|
817
818
|
|
|
818
|
-
// src/components/
|
|
819
|
+
// src/components/multi-combobox.tsx
|
|
819
820
|
var PopoverPrimitive2 = __toESM(require("@radix-ui/react-popover"), 1);
|
|
821
|
+
var import_cmdk2 = require("cmdk");
|
|
820
822
|
var import_lucide_react5 = require("lucide-react");
|
|
821
823
|
var React6 = __toESM(require("react"), 1);
|
|
822
|
-
var
|
|
824
|
+
var import_vaul2 = require("vaul");
|
|
823
825
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
826
|
+
function MultiCombobox({
|
|
827
|
+
options,
|
|
828
|
+
value,
|
|
829
|
+
onChange,
|
|
830
|
+
placeholder = "Selecione...",
|
|
831
|
+
searchPlaceholder = "Buscar...",
|
|
832
|
+
emptyMessage = "Nenhum resultado encontrado.",
|
|
833
|
+
disabled,
|
|
834
|
+
id,
|
|
835
|
+
className,
|
|
836
|
+
"aria-invalid": ariaInvalid,
|
|
837
|
+
"aria-describedby": ariaDescribedby
|
|
838
|
+
}) {
|
|
839
|
+
const [open, setOpen] = React6.useState(false);
|
|
840
|
+
const isDesktop = useIsDesktop();
|
|
841
|
+
const selected = options.filter((option) => value.includes(option.value));
|
|
842
|
+
const toggleValue = (optionValue) => {
|
|
843
|
+
onChange(
|
|
844
|
+
value.includes(optionValue) ? value.filter((v) => v !== optionValue) : [...value, optionValue]
|
|
845
|
+
);
|
|
846
|
+
};
|
|
847
|
+
const removeValue = (optionValue) => {
|
|
848
|
+
onChange(value.filter((v) => v !== optionValue));
|
|
849
|
+
};
|
|
850
|
+
const trigger = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
851
|
+
"div",
|
|
852
|
+
{
|
|
853
|
+
id,
|
|
854
|
+
role: "combobox",
|
|
855
|
+
tabIndex: disabled ? -1 : 0,
|
|
856
|
+
"aria-expanded": open,
|
|
857
|
+
"aria-invalid": ariaInvalid,
|
|
858
|
+
"aria-describedby": ariaDescribedby,
|
|
859
|
+
"aria-disabled": disabled,
|
|
860
|
+
onKeyDown: (event) => {
|
|
861
|
+
if (disabled) return;
|
|
862
|
+
if (event.key === "Enter" || event.key === " " || event.key === "ArrowDown") {
|
|
863
|
+
event.preventDefault();
|
|
864
|
+
setOpen(true);
|
|
865
|
+
}
|
|
866
|
+
},
|
|
867
|
+
className: cn(
|
|
868
|
+
"flex min-h-9 w-full cursor-pointer flex-wrap items-center gap-1 rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive",
|
|
869
|
+
className
|
|
870
|
+
),
|
|
871
|
+
children: [
|
|
872
|
+
selected.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-muted-foreground", children: placeholder }) : selected.map((option) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
873
|
+
"span",
|
|
874
|
+
{
|
|
875
|
+
className: "inline-flex items-center gap-1 rounded bg-secondary px-1.5 py-0.5 text-xs text-secondary-foreground",
|
|
876
|
+
children: [
|
|
877
|
+
option.label,
|
|
878
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
879
|
+
"button",
|
|
880
|
+
{
|
|
881
|
+
type: "button",
|
|
882
|
+
tabIndex: -1,
|
|
883
|
+
"aria-label": `Remover ${option.label}`,
|
|
884
|
+
onClick: (event) => {
|
|
885
|
+
event.stopPropagation();
|
|
886
|
+
removeValue(option.value);
|
|
887
|
+
},
|
|
888
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
889
|
+
className: "rounded-sm opacity-60 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
890
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.X, { className: "h-3 w-3" })
|
|
891
|
+
}
|
|
892
|
+
)
|
|
893
|
+
]
|
|
894
|
+
},
|
|
895
|
+
option.value
|
|
896
|
+
)),
|
|
897
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.ChevronsUpDown, { className: "ml-auto h-4 w-4 shrink-0 opacity-50" })
|
|
898
|
+
]
|
|
899
|
+
}
|
|
900
|
+
);
|
|
901
|
+
const command = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_cmdk2.Command, { className: "flex h-full w-full flex-col overflow-hidden", children: [
|
|
902
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center border-b px-3", children: [
|
|
903
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react5.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
904
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
905
|
+
import_cmdk2.Command.Input,
|
|
906
|
+
{
|
|
907
|
+
placeholder: searchPlaceholder,
|
|
908
|
+
className: "flex h-11 w-full bg-transparent py-2 text-base outline-none placeholder:text-muted-foreground sm:h-9 sm:text-sm"
|
|
909
|
+
}
|
|
910
|
+
)
|
|
911
|
+
] }),
|
|
912
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_cmdk2.Command.List, { className: "max-h-[50vh] overflow-y-auto overflow-x-hidden p-1 sm:max-h-60", children: [
|
|
913
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_cmdk2.Command.Empty, { className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage }),
|
|
914
|
+
options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
915
|
+
import_cmdk2.Command.Item,
|
|
916
|
+
{
|
|
917
|
+
value: option.label,
|
|
918
|
+
disabled: option.disabled,
|
|
919
|
+
onSelect: () => toggleValue(option.value),
|
|
920
|
+
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",
|
|
921
|
+
children: [
|
|
922
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
923
|
+
import_lucide_react5.Check,
|
|
924
|
+
{
|
|
925
|
+
className: cn(
|
|
926
|
+
"h-4 w-4 shrink-0",
|
|
927
|
+
value.includes(option.value) ? "opacity-100" : "opacity-0"
|
|
928
|
+
)
|
|
929
|
+
}
|
|
930
|
+
),
|
|
931
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "truncate", children: option.label })
|
|
932
|
+
]
|
|
933
|
+
},
|
|
934
|
+
option.value
|
|
935
|
+
))
|
|
936
|
+
] })
|
|
937
|
+
] });
|
|
938
|
+
if (isDesktop) {
|
|
939
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(PopoverPrimitive2.Root, { open, onOpenChange: setOpen, modal: true, children: [
|
|
940
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PopoverPrimitive2.Trigger, { asChild: true, disabled, children: trigger }),
|
|
941
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
942
|
+
PopoverPrimitive2.Content,
|
|
943
|
+
{
|
|
944
|
+
align: "start",
|
|
945
|
+
sideOffset: 4,
|
|
946
|
+
className: "z-50 overflow-hidden rounded-md border bg-popover p-0 text-popover-foreground shadow-md",
|
|
947
|
+
style: { width: "var(--radix-popover-trigger-width)" },
|
|
948
|
+
children: command
|
|
949
|
+
}
|
|
950
|
+
) })
|
|
951
|
+
] });
|
|
952
|
+
}
|
|
953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_vaul2.Drawer.Root, { open, onOpenChange: setOpen, children: [
|
|
954
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_vaul2.Drawer.Trigger, { asChild: true, disabled, children: trigger }),
|
|
955
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_vaul2.Drawer.Portal, { children: [
|
|
956
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_vaul2.Drawer.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
|
|
957
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_vaul2.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: [
|
|
958
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_vaul2.Drawer.Title, { className: "sr-only", children: placeholder }),
|
|
959
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
|
|
960
|
+
command
|
|
961
|
+
] })
|
|
962
|
+
] })
|
|
963
|
+
] });
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
// src/components/color-picker.tsx
|
|
967
|
+
var PopoverPrimitive3 = __toESM(require("@radix-ui/react-popover"), 1);
|
|
968
|
+
var import_lucide_react6 = require("lucide-react");
|
|
969
|
+
var React7 = __toESM(require("react"), 1);
|
|
970
|
+
var import_react_colorful = require("react-colorful");
|
|
971
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
824
972
|
function ColorPicker({
|
|
825
973
|
value,
|
|
826
974
|
onChange,
|
|
@@ -831,10 +979,10 @@ function ColorPicker({
|
|
|
831
979
|
"aria-invalid": ariaInvalid,
|
|
832
980
|
"aria-describedby": ariaDescribedby
|
|
833
981
|
}) {
|
|
834
|
-
const [open, setOpen] =
|
|
982
|
+
const [open, setOpen] = React7.useState(false);
|
|
835
983
|
const color = value || "";
|
|
836
|
-
return /* @__PURE__ */ (0,
|
|
837
|
-
/* @__PURE__ */ (0,
|
|
984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(PopoverPrimitive3.Root, { open, onOpenChange: setOpen, modal: true, children: [
|
|
985
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PopoverPrimitive3.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
838
986
|
"button",
|
|
839
987
|
{
|
|
840
988
|
type: "button",
|
|
@@ -847,8 +995,8 @@ function ColorPicker({
|
|
|
847
995
|
className
|
|
848
996
|
),
|
|
849
997
|
children: [
|
|
850
|
-
/* @__PURE__ */ (0,
|
|
851
|
-
/* @__PURE__ */ (0,
|
|
998
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "flex items-center gap-2 truncate", children: [
|
|
999
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
852
1000
|
"span",
|
|
853
1001
|
{
|
|
854
1002
|
"aria-hidden": true,
|
|
@@ -861,23 +1009,23 @@ function ColorPicker({
|
|
|
861
1009
|
}
|
|
862
1010
|
}
|
|
863
1011
|
),
|
|
864
|
-
/* @__PURE__ */ (0,
|
|
1012
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: cn("truncate", !color && "text-muted-foreground"), children: color || placeholder })
|
|
865
1013
|
] }),
|
|
866
|
-
/* @__PURE__ */ (0,
|
|
1014
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.ChevronsUpDown, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
867
1015
|
]
|
|
868
1016
|
}
|
|
869
1017
|
) }),
|
|
870
|
-
/* @__PURE__ */ (0,
|
|
871
|
-
|
|
1018
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PopoverPrimitive3.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1019
|
+
PopoverPrimitive3.Content,
|
|
872
1020
|
{
|
|
873
1021
|
align: "start",
|
|
874
1022
|
sideOffset: 4,
|
|
875
1023
|
className: "z-50 w-56 rounded-md border bg-popover p-3 text-popover-foreground shadow-md",
|
|
876
|
-
children: /* @__PURE__ */ (0,
|
|
877
|
-
/* @__PURE__ */ (0,
|
|
878
|
-
/* @__PURE__ */ (0,
|
|
879
|
-
/* @__PURE__ */ (0,
|
|
880
|
-
/* @__PURE__ */ (0,
|
|
1024
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "mh-color-picker flex flex-col gap-3", children: [
|
|
1025
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_colorful.HexColorPicker, { color, onChange }),
|
|
1026
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1027
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm text-muted-foreground", children: "#" }),
|
|
1028
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
881
1029
|
import_react_colorful.HexColorInput,
|
|
882
1030
|
{
|
|
883
1031
|
color,
|
|
@@ -894,30 +1042,30 @@ function ColorPicker({
|
|
|
894
1042
|
}
|
|
895
1043
|
|
|
896
1044
|
// src/components/stat-card.tsx
|
|
897
|
-
var
|
|
1045
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
898
1046
|
function StatCard({ label, value, detail, icon, isLoading }) {
|
|
899
1047
|
if (isLoading) {
|
|
900
|
-
return /* @__PURE__ */ (0,
|
|
901
|
-
/* @__PURE__ */ (0,
|
|
902
|
-
/* @__PURE__ */ (0,
|
|
903
|
-
/* @__PURE__ */ (0,
|
|
1048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "rounded-lg border bg-card p-6 shadow-sm", children: [
|
|
1049
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center justify-between pb-2", children: [
|
|
1050
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "h-4 w-24 animate-pulse rounded bg-muted" }),
|
|
1051
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "h-4 w-4 animate-pulse rounded bg-muted" })
|
|
904
1052
|
] }),
|
|
905
|
-
/* @__PURE__ */ (0,
|
|
906
|
-
/* @__PURE__ */ (0,
|
|
1053
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "mt-2 h-7 w-16 animate-pulse rounded bg-muted" }),
|
|
1054
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "mt-1 h-4 w-20 animate-pulse rounded bg-muted" })
|
|
907
1055
|
] });
|
|
908
1056
|
}
|
|
909
|
-
return /* @__PURE__ */ (0,
|
|
910
|
-
/* @__PURE__ */ (0,
|
|
911
|
-
/* @__PURE__ */ (0,
|
|
912
|
-
icon && /* @__PURE__ */ (0,
|
|
1057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "rounded-lg border bg-card p-6 shadow-sm", children: [
|
|
1058
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center justify-between pb-2", children: [
|
|
1059
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-sm font-medium text-muted-foreground", children: label }),
|
|
1060
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-muted-foreground", children: icon })
|
|
913
1061
|
] }),
|
|
914
|
-
/* @__PURE__ */ (0,
|
|
915
|
-
detail && /* @__PURE__ */ (0,
|
|
1062
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "text-2xl font-bold", children: value }),
|
|
1063
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-xs text-muted-foreground", children: detail })
|
|
916
1064
|
] });
|
|
917
1065
|
}
|
|
918
1066
|
|
|
919
1067
|
// src/components/data-table-wrapper.tsx
|
|
920
|
-
var
|
|
1068
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
921
1069
|
function DataTableWrapper({
|
|
922
1070
|
children,
|
|
923
1071
|
isEmpty,
|
|
@@ -930,15 +1078,15 @@ function DataTableWrapper({
|
|
|
930
1078
|
hasNextPage = false,
|
|
931
1079
|
hasPreviousPage = false
|
|
932
1080
|
}) {
|
|
933
|
-
return /* @__PURE__ */ (0,
|
|
934
|
-
/* @__PURE__ */ (0,
|
|
935
|
-
!isLoading && isEmpty && /* @__PURE__ */ (0,
|
|
936
|
-
emptyIcon && /* @__PURE__ */ (0,
|
|
937
|
-
/* @__PURE__ */ (0,
|
|
938
|
-
emptyDescription && /* @__PURE__ */ (0,
|
|
1081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "space-y-4", children: [
|
|
1082
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "overflow-x-auto rounded-md border", children }),
|
|
1083
|
+
!isLoading && isEmpty && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
1084
|
+
emptyIcon && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "mb-4 text-muted-foreground", children: emptyIcon }),
|
|
1085
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h3", { className: "text-lg font-semibold tracking-tight", children: emptyTitle }),
|
|
1086
|
+
emptyDescription && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: emptyDescription })
|
|
939
1087
|
] }),
|
|
940
|
-
page !== void 0 && onPageChange && /* @__PURE__ */ (0,
|
|
941
|
-
/* @__PURE__ */ (0,
|
|
1088
|
+
page !== void 0 && onPageChange && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center justify-end gap-4", children: [
|
|
1089
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
942
1090
|
"button",
|
|
943
1091
|
{
|
|
944
1092
|
type: "button",
|
|
@@ -948,11 +1096,11 @@ function DataTableWrapper({
|
|
|
948
1096
|
children: "Anterior"
|
|
949
1097
|
}
|
|
950
1098
|
),
|
|
951
|
-
/* @__PURE__ */ (0,
|
|
1099
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "text-sm text-muted-foreground", children: [
|
|
952
1100
|
"P\xE1gina ",
|
|
953
1101
|
page
|
|
954
1102
|
] }),
|
|
955
|
-
/* @__PURE__ */ (0,
|
|
1103
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
956
1104
|
"button",
|
|
957
1105
|
{
|
|
958
1106
|
type: "button",
|
|
@@ -968,7 +1116,7 @@ function DataTableWrapper({
|
|
|
968
1116
|
|
|
969
1117
|
// src/components/mobile-card-list.tsx
|
|
970
1118
|
var import_react4 = require("react");
|
|
971
|
-
var
|
|
1119
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
972
1120
|
var SCROLL_THRESHOLD = 8;
|
|
973
1121
|
function MobileCardList({
|
|
974
1122
|
data,
|
|
@@ -999,26 +1147,26 @@ function MobileCardList({
|
|
|
999
1147
|
}
|
|
1000
1148
|
};
|
|
1001
1149
|
if (isLoading) {
|
|
1002
|
-
return /* @__PURE__ */ (0,
|
|
1003
|
-
/* @__PURE__ */ (0,
|
|
1004
|
-
/* @__PURE__ */ (0,
|
|
1005
|
-
/* @__PURE__ */ (0,
|
|
1150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: `space-y-3 ${className ?? ""}`, children: Array.from({ length: loadingCount }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "rounded-xl border p-4", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-3", children: [
|
|
1151
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex justify-between", children: [
|
|
1152
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "h-5 w-32 animate-pulse rounded bg-muted" }),
|
|
1153
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "h-5 w-16 animate-pulse rounded bg-muted" })
|
|
1006
1154
|
] }),
|
|
1007
|
-
/* @__PURE__ */ (0,
|
|
1008
|
-
/* @__PURE__ */ (0,
|
|
1009
|
-
/* @__PURE__ */ (0,
|
|
1010
|
-
/* @__PURE__ */ (0,
|
|
1155
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "h-4 w-48 animate-pulse rounded bg-muted" }),
|
|
1156
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex justify-between", children: [
|
|
1157
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "h-4 w-24 animate-pulse rounded bg-muted" }),
|
|
1158
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "h-4 w-20 animate-pulse rounded bg-muted" })
|
|
1011
1159
|
] })
|
|
1012
1160
|
] }) }, i)) });
|
|
1013
1161
|
}
|
|
1014
|
-
return /* @__PURE__ */ (0,
|
|
1162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1015
1163
|
"div",
|
|
1016
1164
|
{
|
|
1017
1165
|
className: `space-y-3 ${className ?? ""}`,
|
|
1018
1166
|
onTouchStart,
|
|
1019
1167
|
onTouchMove,
|
|
1020
1168
|
onClickCapture,
|
|
1021
|
-
children: data.map((item, index) => /* @__PURE__ */ (0,
|
|
1169
|
+
children: data.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1022
1170
|
"div",
|
|
1023
1171
|
{
|
|
1024
1172
|
className: "rounded-xl border p-4 transition-all duration-150 hover:border-foreground/20 active:scale-[0.99]",
|
|
@@ -1031,7 +1179,7 @@ function MobileCardList({
|
|
|
1031
1179
|
}
|
|
1032
1180
|
|
|
1033
1181
|
// src/components/responsive-data-view.tsx
|
|
1034
|
-
var
|
|
1182
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1035
1183
|
function ResponsiveDataView({
|
|
1036
1184
|
table,
|
|
1037
1185
|
cards,
|
|
@@ -1042,13 +1190,13 @@ function ResponsiveDataView({
|
|
|
1042
1190
|
emptyDescription,
|
|
1043
1191
|
pagination
|
|
1044
1192
|
}) {
|
|
1045
|
-
return /* @__PURE__ */ (0,
|
|
1046
|
-
/* @__PURE__ */ (0,
|
|
1047
|
-
/* @__PURE__ */ (0,
|
|
1048
|
-
!isLoading && isEmpty && /* @__PURE__ */ (0,
|
|
1049
|
-
emptyIcon && /* @__PURE__ */ (0,
|
|
1050
|
-
/* @__PURE__ */ (0,
|
|
1051
|
-
emptyDescription && /* @__PURE__ */ (0,
|
|
1193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "space-y-4", children: [
|
|
1194
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "hidden overflow-x-auto rounded-md border md:block", children: table }),
|
|
1195
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "md:hidden", children: cards }),
|
|
1196
|
+
!isLoading && isEmpty && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
1197
|
+
emptyIcon && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "mb-4 text-muted-foreground", children: emptyIcon }),
|
|
1198
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "text-lg font-semibold tracking-tight", children: emptyTitle }),
|
|
1199
|
+
emptyDescription && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: emptyDescription })
|
|
1052
1200
|
] }),
|
|
1053
1201
|
pagination
|
|
1054
1202
|
] });
|
|
@@ -1056,10 +1204,10 @@ function ResponsiveDataView({
|
|
|
1056
1204
|
|
|
1057
1205
|
// src/components/toaster.tsx
|
|
1058
1206
|
var import_sonner = require("sonner");
|
|
1059
|
-
var
|
|
1207
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1060
1208
|
function Toaster(props) {
|
|
1061
1209
|
const { theme = "system" } = useTheme();
|
|
1062
|
-
return /* @__PURE__ */ (0,
|
|
1210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1063
1211
|
import_sonner.Toaster,
|
|
1064
1212
|
{
|
|
1065
1213
|
theme,
|
|
@@ -1080,18 +1228,18 @@ function Toaster(props) {
|
|
|
1080
1228
|
}
|
|
1081
1229
|
|
|
1082
1230
|
// src/components/app-shell.tsx
|
|
1083
|
-
var
|
|
1231
|
+
var import_lucide_react8 = require("lucide-react");
|
|
1084
1232
|
var import_react7 = require("react");
|
|
1085
1233
|
|
|
1086
1234
|
// src/components/sidebar-nav.tsx
|
|
1087
1235
|
var import_react5 = require("react");
|
|
1088
1236
|
|
|
1089
1237
|
// src/components/types.tsx
|
|
1090
|
-
var
|
|
1091
|
-
var defaultRenderLink = ({ children, ...props }) => /* @__PURE__ */ (0,
|
|
1238
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1239
|
+
var defaultRenderLink = ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("a", { ...props, children });
|
|
1092
1240
|
|
|
1093
1241
|
// src/components/sidebar-nav.tsx
|
|
1094
|
-
var
|
|
1242
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1095
1243
|
function defaultIsActive(item, activePath) {
|
|
1096
1244
|
if (item.href === "/") return activePath === "/";
|
|
1097
1245
|
return activePath === item.href || activePath.startsWith(item.href + "/");
|
|
@@ -1106,7 +1254,7 @@ function SidebarNav({
|
|
|
1106
1254
|
onNavigate
|
|
1107
1255
|
}) {
|
|
1108
1256
|
const visible = items.filter((item) => !item.adminOnly || isAdmin);
|
|
1109
|
-
return /* @__PURE__ */ (0,
|
|
1257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("nav", { className: "flex flex-col gap-1", children: visible.map((item) => {
|
|
1110
1258
|
const active = isActive(item, activePath);
|
|
1111
1259
|
const link = renderLink({
|
|
1112
1260
|
href: item.href,
|
|
@@ -1118,21 +1266,21 @@ function SidebarNav({
|
|
|
1118
1266
|
active ? "bg-accent text-accent-foreground font-semibold" : "text-muted-foreground hover:bg-accent hover:text-accent-foreground",
|
|
1119
1267
|
isCollapsed && "justify-center px-2"
|
|
1120
1268
|
),
|
|
1121
|
-
children: /* @__PURE__ */ (0,
|
|
1122
|
-
item.icon && /* @__PURE__ */ (0,
|
|
1123
|
-
!isCollapsed && /* @__PURE__ */ (0,
|
|
1269
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
1270
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "shrink-0", children: item.icon }),
|
|
1271
|
+
!isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "truncate", children: item.label })
|
|
1124
1272
|
] })
|
|
1125
1273
|
});
|
|
1126
|
-
return /* @__PURE__ */ (0,
|
|
1274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react5.Fragment, { children: link }, item.href);
|
|
1127
1275
|
}) });
|
|
1128
1276
|
}
|
|
1129
1277
|
|
|
1130
1278
|
// src/components/user-menu.tsx
|
|
1131
1279
|
var DropdownMenu2 = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
1132
|
-
var
|
|
1280
|
+
var import_lucide_react7 = require("lucide-react");
|
|
1133
1281
|
var import_react6 = require("react");
|
|
1134
|
-
var
|
|
1135
|
-
var
|
|
1282
|
+
var import_vaul3 = require("vaul");
|
|
1283
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1136
1284
|
function initials(user) {
|
|
1137
1285
|
const source = user?.name?.trim() || user?.email?.trim();
|
|
1138
1286
|
if (!source) return "";
|
|
@@ -1153,50 +1301,50 @@ function UserMenu({
|
|
|
1153
1301
|
const isDesktop = useIsDesktop();
|
|
1154
1302
|
const [open, setOpen] = (0, import_react6.useState)(false);
|
|
1155
1303
|
const label = initials(user);
|
|
1156
|
-
const trigger = /* @__PURE__ */ (0,
|
|
1304
|
+
const trigger = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1157
1305
|
"button",
|
|
1158
1306
|
{
|
|
1159
1307
|
type: "button",
|
|
1160
1308
|
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",
|
|
1161
1309
|
"aria-label": "Menu do usu\xE1rio",
|
|
1162
1310
|
"data-testid": "user-menu",
|
|
1163
|
-
children: user?.avatarUrl ? /* @__PURE__ */ (0,
|
|
1311
|
+
children: user?.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1164
1312
|
"img",
|
|
1165
1313
|
{
|
|
1166
1314
|
src: user.avatarUrl,
|
|
1167
1315
|
alt: user.name ?? user.email ?? "Avatar",
|
|
1168
1316
|
className: "h-full w-full object-cover"
|
|
1169
1317
|
}
|
|
1170
|
-
) : label ? /* @__PURE__ */ (0,
|
|
1318
|
+
) : label ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: label }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react7.User, { className: "h-4 w-4" })
|
|
1171
1319
|
}
|
|
1172
1320
|
);
|
|
1173
|
-
const userInfo = (user?.name || user?.email) && /* @__PURE__ */ (0,
|
|
1174
|
-
user.name && /* @__PURE__ */ (0,
|
|
1175
|
-
user.email && /* @__PURE__ */ (0,
|
|
1321
|
+
const userInfo = (user?.name || user?.email) && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "px-2 py-1.5", children: [
|
|
1322
|
+
user.name && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "truncate text-sm font-medium", children: user.name }),
|
|
1323
|
+
user.email && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "truncate text-xs text-muted-foreground", children: user.email })
|
|
1176
1324
|
] });
|
|
1177
1325
|
if (isDesktop) {
|
|
1178
|
-
return /* @__PURE__ */ (0,
|
|
1179
|
-
/* @__PURE__ */ (0,
|
|
1180
|
-
/* @__PURE__ */ (0,
|
|
1326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(DropdownMenu2.Root, { open, onOpenChange: setOpen, children: [
|
|
1327
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DropdownMenu2.Trigger, { asChild: true, children: trigger }),
|
|
1328
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DropdownMenu2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1181
1329
|
DropdownMenu2.Content,
|
|
1182
1330
|
{
|
|
1183
1331
|
align,
|
|
1184
1332
|
sideOffset: 6,
|
|
1185
1333
|
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",
|
|
1186
1334
|
children: [
|
|
1187
|
-
userInfo && /* @__PURE__ */ (0,
|
|
1335
|
+
userInfo && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
1188
1336
|
userInfo,
|
|
1189
|
-
/* @__PURE__ */ (0,
|
|
1337
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DropdownMenu2.Separator, { className: "-mx-1 my-1 h-px bg-border" })
|
|
1190
1338
|
] }),
|
|
1191
1339
|
items.map(
|
|
1192
|
-
(item) => item.href ? /* @__PURE__ */ (0,
|
|
1340
|
+
(item) => item.href ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DropdownMenu2.Item, { asChild: true, children: renderLink({
|
|
1193
1341
|
href: item.href,
|
|
1194
1342
|
className: itemClass,
|
|
1195
|
-
children: /* @__PURE__ */ (0,
|
|
1343
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
1196
1344
|
item.icon,
|
|
1197
1345
|
item.label
|
|
1198
1346
|
] })
|
|
1199
|
-
}) }, item.label) : /* @__PURE__ */ (0,
|
|
1347
|
+
}) }, item.label) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1200
1348
|
DropdownMenu2.Item,
|
|
1201
1349
|
{
|
|
1202
1350
|
className: itemClass,
|
|
@@ -1209,9 +1357,9 @@ function UserMenu({
|
|
|
1209
1357
|
item.label
|
|
1210
1358
|
)
|
|
1211
1359
|
),
|
|
1212
|
-
onLogout && /* @__PURE__ */ (0,
|
|
1213
|
-
items.length > 0 && /* @__PURE__ */ (0,
|
|
1214
|
-
/* @__PURE__ */ (0,
|
|
1360
|
+
onLogout && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
1361
|
+
items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DropdownMenu2.Separator, { className: "-mx-1 my-1 h-px bg-border" }),
|
|
1362
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1215
1363
|
DropdownMenu2.Item,
|
|
1216
1364
|
{
|
|
1217
1365
|
className: cn(
|
|
@@ -1220,7 +1368,7 @@ function UserMenu({
|
|
|
1220
1368
|
),
|
|
1221
1369
|
onClick: onLogout,
|
|
1222
1370
|
children: [
|
|
1223
|
-
/* @__PURE__ */ (0,
|
|
1371
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react7.LogOut, { className: "h-4 w-4" }),
|
|
1224
1372
|
logoutLabel
|
|
1225
1373
|
]
|
|
1226
1374
|
}
|
|
@@ -1231,19 +1379,19 @@ function UserMenu({
|
|
|
1231
1379
|
) })
|
|
1232
1380
|
] });
|
|
1233
1381
|
}
|
|
1234
|
-
return /* @__PURE__ */ (0,
|
|
1235
|
-
/* @__PURE__ */ (0,
|
|
1236
|
-
/* @__PURE__ */ (0,
|
|
1237
|
-
/* @__PURE__ */ (0,
|
|
1238
|
-
/* @__PURE__ */ (0,
|
|
1239
|
-
/* @__PURE__ */ (0,
|
|
1240
|
-
/* @__PURE__ */ (0,
|
|
1241
|
-
userInfo && /* @__PURE__ */ (0,
|
|
1382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_vaul3.Drawer.Root, { open, onOpenChange: setOpen, children: [
|
|
1383
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_vaul3.Drawer.Trigger, { asChild: true, children: trigger }),
|
|
1384
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_vaul3.Drawer.Portal, { children: [
|
|
1385
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_vaul3.Drawer.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
|
|
1386
|
+
/* @__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: [
|
|
1387
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_vaul3.Drawer.Title, { className: "sr-only", children: "Menu do usu\xE1rio" }),
|
|
1388
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
|
|
1389
|
+
userInfo && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
1242
1390
|
userInfo,
|
|
1243
|
-
/* @__PURE__ */ (0,
|
|
1391
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "-mx-1 my-1 h-px bg-border" })
|
|
1244
1392
|
] }),
|
|
1245
1393
|
items.map(
|
|
1246
|
-
(item) => item.href ? /* @__PURE__ */ (0,
|
|
1394
|
+
(item) => item.href ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1247
1395
|
"span",
|
|
1248
1396
|
{
|
|
1249
1397
|
onClick: () => setOpen(false),
|
|
@@ -1251,14 +1399,14 @@ function UserMenu({
|
|
|
1251
1399
|
children: renderLink({
|
|
1252
1400
|
href: item.href,
|
|
1253
1401
|
className: sheetItemClass,
|
|
1254
|
-
children: /* @__PURE__ */ (0,
|
|
1402
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
1255
1403
|
item.icon,
|
|
1256
1404
|
item.label
|
|
1257
1405
|
] })
|
|
1258
1406
|
})
|
|
1259
1407
|
},
|
|
1260
1408
|
item.label
|
|
1261
|
-
) : /* @__PURE__ */ (0,
|
|
1409
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1262
1410
|
"button",
|
|
1263
1411
|
{
|
|
1264
1412
|
type: "button",
|
|
@@ -1275,9 +1423,9 @@ function UserMenu({
|
|
|
1275
1423
|
item.label
|
|
1276
1424
|
)
|
|
1277
1425
|
),
|
|
1278
|
-
onLogout && /* @__PURE__ */ (0,
|
|
1279
|
-
items.length > 0 && /* @__PURE__ */ (0,
|
|
1280
|
-
/* @__PURE__ */ (0,
|
|
1426
|
+
onLogout && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
1427
|
+
items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "-mx-1 my-1 h-px bg-border" }),
|
|
1428
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1281
1429
|
"button",
|
|
1282
1430
|
{
|
|
1283
1431
|
type: "button",
|
|
@@ -1287,7 +1435,7 @@ function UserMenu({
|
|
|
1287
1435
|
setOpen(false);
|
|
1288
1436
|
},
|
|
1289
1437
|
children: [
|
|
1290
|
-
/* @__PURE__ */ (0,
|
|
1438
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react7.LogOut, { className: "h-4 w-4" }),
|
|
1291
1439
|
logoutLabel
|
|
1292
1440
|
]
|
|
1293
1441
|
}
|
|
@@ -1299,7 +1447,7 @@ function UserMenu({
|
|
|
1299
1447
|
}
|
|
1300
1448
|
|
|
1301
1449
|
// src/components/app-shell.tsx
|
|
1302
|
-
var
|
|
1450
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1303
1451
|
function AppShell({
|
|
1304
1452
|
brand,
|
|
1305
1453
|
brandCollapsed,
|
|
@@ -1318,7 +1466,7 @@ function AppShell({
|
|
|
1318
1466
|
}) {
|
|
1319
1467
|
const [collapsed, setCollapsed] = (0, import_react7.useState)(defaultCollapsed);
|
|
1320
1468
|
const [mobileOpen, setMobileOpen] = (0, import_react7.useState)(false);
|
|
1321
|
-
const nav = (isCollapsed, onNavigate) => /* @__PURE__ */ (0,
|
|
1469
|
+
const nav = (isCollapsed, onNavigate) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1322
1470
|
SidebarNav,
|
|
1323
1471
|
{
|
|
1324
1472
|
items: navItems,
|
|
@@ -1330,8 +1478,8 @@ function AppShell({
|
|
|
1330
1478
|
onNavigate
|
|
1331
1479
|
}
|
|
1332
1480
|
);
|
|
1333
|
-
return /* @__PURE__ */ (0,
|
|
1334
|
-
/* @__PURE__ */ (0,
|
|
1481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex h-screen overflow-hidden bg-background", children: [
|
|
1482
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1335
1483
|
"aside",
|
|
1336
1484
|
{
|
|
1337
1485
|
className: cn(
|
|
@@ -1339,22 +1487,22 @@ function AppShell({
|
|
|
1339
1487
|
collapsed ? "w-16" : "w-60"
|
|
1340
1488
|
),
|
|
1341
1489
|
children: [
|
|
1342
|
-
/* @__PURE__ */ (0,
|
|
1343
|
-
/* @__PURE__ */ (0,
|
|
1344
|
-
collapsible && /* @__PURE__ */ (0,
|
|
1490
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex h-14 shrink-0 items-center border-b px-4", children: collapsed ? brandCollapsed ?? brand : brand }),
|
|
1491
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex-1 overflow-y-auto px-2 py-4", children: nav(collapsed) }),
|
|
1492
|
+
collapsible && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "border-t p-2", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1345
1493
|
"button",
|
|
1346
1494
|
{
|
|
1347
1495
|
type: "button",
|
|
1348
1496
|
onClick: () => setCollapsed((v) => !v),
|
|
1349
1497
|
className: "flex w-full items-center justify-center rounded-md px-2 py-2 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
1350
1498
|
"aria-label": collapsed ? "Expandir menu" : "Recolher menu",
|
|
1351
|
-
children: collapsed ? /* @__PURE__ */ (0,
|
|
1499
|
+
children: collapsed ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react8.ChevronRight, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react8.ChevronLeft, { className: "h-4 w-4" })
|
|
1352
1500
|
}
|
|
1353
1501
|
) })
|
|
1354
1502
|
]
|
|
1355
1503
|
}
|
|
1356
1504
|
),
|
|
1357
|
-
/* @__PURE__ */ (0,
|
|
1505
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1358
1506
|
"div",
|
|
1359
1507
|
{
|
|
1360
1508
|
className: cn(
|
|
@@ -1363,8 +1511,8 @@ function AppShell({
|
|
|
1363
1511
|
),
|
|
1364
1512
|
onClick: () => setMobileOpen(false),
|
|
1365
1513
|
children: [
|
|
1366
|
-
/* @__PURE__ */ (0,
|
|
1367
|
-
/* @__PURE__ */ (0,
|
|
1514
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "absolute inset-0 bg-black/50" }),
|
|
1515
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1368
1516
|
"div",
|
|
1369
1517
|
{
|
|
1370
1518
|
className: cn(
|
|
@@ -1373,42 +1521,42 @@ function AppShell({
|
|
|
1373
1521
|
),
|
|
1374
1522
|
onClick: (e) => e.stopPropagation(),
|
|
1375
1523
|
children: [
|
|
1376
|
-
/* @__PURE__ */ (0,
|
|
1377
|
-
/* @__PURE__ */ (0,
|
|
1524
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex h-14 shrink-0 items-center border-b px-4", children: brand }),
|
|
1525
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex-1 overflow-y-auto px-2 py-4", children: nav(false, () => setMobileOpen(false)) })
|
|
1378
1526
|
]
|
|
1379
1527
|
}
|
|
1380
1528
|
)
|
|
1381
1529
|
]
|
|
1382
1530
|
}
|
|
1383
1531
|
),
|
|
1384
|
-
/* @__PURE__ */ (0,
|
|
1385
|
-
/* @__PURE__ */ (0,
|
|
1386
|
-
/* @__PURE__ */ (0,
|
|
1532
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
1533
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("header", { className: "flex h-14 shrink-0 items-center gap-2 border-b bg-background px-4", children: [
|
|
1534
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1387
1535
|
"button",
|
|
1388
1536
|
{
|
|
1389
1537
|
type: "button",
|
|
1390
1538
|
onClick: () => setMobileOpen(true),
|
|
1391
1539
|
className: "inline-flex h-9 w-9 items-center justify-center rounded-md border border-input bg-background shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground md:hidden",
|
|
1392
1540
|
"aria-label": "Abrir menu",
|
|
1393
|
-
children: /* @__PURE__ */ (0,
|
|
1541
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react8.Menu, { className: "h-4 w-4" })
|
|
1394
1542
|
}
|
|
1395
1543
|
),
|
|
1396
|
-
/* @__PURE__ */ (0,
|
|
1544
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
1397
1545
|
headerActions,
|
|
1398
|
-
(user || onLogout) && /* @__PURE__ */ (0,
|
|
1546
|
+
(user || onLogout) && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(UserMenu, { user, items: userMenuItems, onLogout, renderLink })
|
|
1399
1547
|
] })
|
|
1400
1548
|
] }),
|
|
1401
|
-
/* @__PURE__ */ (0,
|
|
1549
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("main", { className: "flex-1 overflow-y-auto", children })
|
|
1402
1550
|
] })
|
|
1403
1551
|
] });
|
|
1404
1552
|
}
|
|
1405
1553
|
|
|
1406
1554
|
// src/components/row-actions-menu.tsx
|
|
1407
1555
|
var DropdownMenu3 = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
1408
|
-
var
|
|
1556
|
+
var import_lucide_react9 = require("lucide-react");
|
|
1409
1557
|
var import_react8 = require("react");
|
|
1410
|
-
var
|
|
1411
|
-
var
|
|
1558
|
+
var import_vaul4 = require("vaul");
|
|
1559
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1412
1560
|
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";
|
|
1413
1561
|
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";
|
|
1414
1562
|
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";
|
|
@@ -1422,20 +1570,20 @@ function RowActionsMenu({
|
|
|
1422
1570
|
const isDesktop = useIsDesktop();
|
|
1423
1571
|
const [open, setOpen] = (0, import_react8.useState)(false);
|
|
1424
1572
|
if (actions.length === 0) return null;
|
|
1425
|
-
const trigger = /* @__PURE__ */ (0,
|
|
1573
|
+
const trigger = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1426
1574
|
"button",
|
|
1427
1575
|
{
|
|
1428
1576
|
type: "button",
|
|
1429
1577
|
disabled,
|
|
1430
1578
|
"aria-label": label,
|
|
1431
1579
|
className: triggerClass,
|
|
1432
|
-
children: /* @__PURE__ */ (0,
|
|
1580
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react9.MoreVertical, { className: "h-4 w-4" })
|
|
1433
1581
|
}
|
|
1434
1582
|
);
|
|
1435
1583
|
if (isDesktop) {
|
|
1436
|
-
return /* @__PURE__ */ (0,
|
|
1437
|
-
/* @__PURE__ */ (0,
|
|
1438
|
-
/* @__PURE__ */ (0,
|
|
1584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(DropdownMenu3.Root, { open, onOpenChange: setOpen, modal: false, children: [
|
|
1585
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DropdownMenu3.Trigger, { asChild: true, children: trigger }),
|
|
1586
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DropdownMenu3.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1439
1587
|
DropdownMenu3.Content,
|
|
1440
1588
|
{
|
|
1441
1589
|
align,
|
|
@@ -1446,7 +1594,7 @@ function RowActionsMenu({
|
|
|
1446
1594
|
itemClass2,
|
|
1447
1595
|
action.destructive && "text-destructive focus:bg-destructive/10"
|
|
1448
1596
|
);
|
|
1449
|
-
return action.href ? /* @__PURE__ */ (0,
|
|
1597
|
+
return action.href ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1450
1598
|
DropdownMenu3.Item,
|
|
1451
1599
|
{
|
|
1452
1600
|
asChild: true,
|
|
@@ -1454,14 +1602,14 @@ function RowActionsMenu({
|
|
|
1454
1602
|
children: renderLink({
|
|
1455
1603
|
href: action.href,
|
|
1456
1604
|
className: cls,
|
|
1457
|
-
children: /* @__PURE__ */ (0,
|
|
1605
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
1458
1606
|
action.icon,
|
|
1459
1607
|
action.label
|
|
1460
1608
|
] })
|
|
1461
1609
|
})
|
|
1462
1610
|
},
|
|
1463
1611
|
action.label
|
|
1464
|
-
) : /* @__PURE__ */ (0,
|
|
1612
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1465
1613
|
DropdownMenu3.Item,
|
|
1466
1614
|
{
|
|
1467
1615
|
className: cls,
|
|
@@ -1479,23 +1627,23 @@ function RowActionsMenu({
|
|
|
1479
1627
|
) })
|
|
1480
1628
|
] });
|
|
1481
1629
|
}
|
|
1482
|
-
return /* @__PURE__ */ (0,
|
|
1483
|
-
/* @__PURE__ */ (0,
|
|
1484
|
-
/* @__PURE__ */ (0,
|
|
1485
|
-
/* @__PURE__ */ (0,
|
|
1486
|
-
/* @__PURE__ */ (0,
|
|
1487
|
-
/* @__PURE__ */ (0,
|
|
1488
|
-
/* @__PURE__ */ (0,
|
|
1630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_vaul4.Drawer.Root, { open, onOpenChange: setOpen, children: [
|
|
1631
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_vaul4.Drawer.Trigger, { asChild: true, children: trigger }),
|
|
1632
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_vaul4.Drawer.Portal, { children: [
|
|
1633
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_vaul4.Drawer.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
|
|
1634
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_vaul4.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: [
|
|
1635
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_vaul4.Drawer.Title, { className: "sr-only", children: label }),
|
|
1636
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
|
|
1489
1637
|
actions.map((action) => {
|
|
1490
1638
|
const cls = cn(
|
|
1491
1639
|
sheetItemClass2,
|
|
1492
1640
|
action.destructive && "text-destructive"
|
|
1493
1641
|
);
|
|
1494
|
-
const inner = /* @__PURE__ */ (0,
|
|
1642
|
+
const inner = /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
1495
1643
|
action.icon,
|
|
1496
1644
|
action.label
|
|
1497
1645
|
] });
|
|
1498
|
-
return action.href ? /* @__PURE__ */ (0,
|
|
1646
|
+
return action.href ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1499
1647
|
"span",
|
|
1500
1648
|
{
|
|
1501
1649
|
onClick: () => setOpen(false),
|
|
@@ -1507,7 +1655,7 @@ function RowActionsMenu({
|
|
|
1507
1655
|
})
|
|
1508
1656
|
},
|
|
1509
1657
|
action.label
|
|
1510
|
-
) : /* @__PURE__ */ (0,
|
|
1658
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1511
1659
|
"button",
|
|
1512
1660
|
{
|
|
1513
1661
|
type: "button",
|
|
@@ -1585,6 +1733,7 @@ function useCustomToast() {
|
|
|
1585
1733
|
FormField,
|
|
1586
1734
|
MobileCardList,
|
|
1587
1735
|
ModeToggle,
|
|
1736
|
+
MultiCombobox,
|
|
1588
1737
|
PageHeader,
|
|
1589
1738
|
Pagination,
|
|
1590
1739
|
PasswordInput,
|