@motor-hero/ui-kit 0.22.0 → 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/components/row-actions-menu.tsx +2 -2
- package/src/index.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -742,12 +742,159 @@ function Combobox({
|
|
|
742
742
|
] });
|
|
743
743
|
}
|
|
744
744
|
|
|
745
|
-
// src/components/
|
|
745
|
+
// src/components/multi-combobox.tsx
|
|
746
746
|
import * as PopoverPrimitive2 from "@radix-ui/react-popover";
|
|
747
|
-
import {
|
|
747
|
+
import { Command as CommandPrimitive2 } from "cmdk";
|
|
748
|
+
import { Check as Check2, ChevronsUpDown as ChevronsUpDown2, Search as Search2, X as X2 } from "lucide-react";
|
|
748
749
|
import * as React6 from "react";
|
|
749
|
-
import {
|
|
750
|
+
import { Drawer as DrawerPrimitive2 } from "vaul";
|
|
750
751
|
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
752
|
+
function MultiCombobox({
|
|
753
|
+
options,
|
|
754
|
+
value,
|
|
755
|
+
onChange,
|
|
756
|
+
placeholder = "Selecione...",
|
|
757
|
+
searchPlaceholder = "Buscar...",
|
|
758
|
+
emptyMessage = "Nenhum resultado encontrado.",
|
|
759
|
+
disabled,
|
|
760
|
+
id,
|
|
761
|
+
className,
|
|
762
|
+
"aria-invalid": ariaInvalid,
|
|
763
|
+
"aria-describedby": ariaDescribedby
|
|
764
|
+
}) {
|
|
765
|
+
const [open, setOpen] = React6.useState(false);
|
|
766
|
+
const isDesktop = useIsDesktop();
|
|
767
|
+
const selected = options.filter((option) => value.includes(option.value));
|
|
768
|
+
const toggleValue = (optionValue) => {
|
|
769
|
+
onChange(
|
|
770
|
+
value.includes(optionValue) ? value.filter((v) => v !== optionValue) : [...value, optionValue]
|
|
771
|
+
);
|
|
772
|
+
};
|
|
773
|
+
const removeValue = (optionValue) => {
|
|
774
|
+
onChange(value.filter((v) => v !== optionValue));
|
|
775
|
+
};
|
|
776
|
+
const trigger = /* @__PURE__ */ jsxs15(
|
|
777
|
+
"div",
|
|
778
|
+
{
|
|
779
|
+
id,
|
|
780
|
+
role: "combobox",
|
|
781
|
+
tabIndex: disabled ? -1 : 0,
|
|
782
|
+
"aria-expanded": open,
|
|
783
|
+
"aria-invalid": ariaInvalid,
|
|
784
|
+
"aria-describedby": ariaDescribedby,
|
|
785
|
+
"aria-disabled": disabled,
|
|
786
|
+
onKeyDown: (event) => {
|
|
787
|
+
if (disabled) return;
|
|
788
|
+
if (event.key === "Enter" || event.key === " " || event.key === "ArrowDown") {
|
|
789
|
+
event.preventDefault();
|
|
790
|
+
setOpen(true);
|
|
791
|
+
}
|
|
792
|
+
},
|
|
793
|
+
className: cn(
|
|
794
|
+
"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",
|
|
795
|
+
className
|
|
796
|
+
),
|
|
797
|
+
children: [
|
|
798
|
+
selected.length === 0 ? /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: placeholder }) : selected.map((option) => /* @__PURE__ */ jsxs15(
|
|
799
|
+
"span",
|
|
800
|
+
{
|
|
801
|
+
className: "inline-flex items-center gap-1 rounded bg-secondary px-1.5 py-0.5 text-xs text-secondary-foreground",
|
|
802
|
+
children: [
|
|
803
|
+
option.label,
|
|
804
|
+
/* @__PURE__ */ jsx17(
|
|
805
|
+
"button",
|
|
806
|
+
{
|
|
807
|
+
type: "button",
|
|
808
|
+
tabIndex: -1,
|
|
809
|
+
"aria-label": `Remover ${option.label}`,
|
|
810
|
+
onClick: (event) => {
|
|
811
|
+
event.stopPropagation();
|
|
812
|
+
removeValue(option.value);
|
|
813
|
+
},
|
|
814
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
815
|
+
className: "rounded-sm opacity-60 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
816
|
+
children: /* @__PURE__ */ jsx17(X2, { className: "h-3 w-3" })
|
|
817
|
+
}
|
|
818
|
+
)
|
|
819
|
+
]
|
|
820
|
+
},
|
|
821
|
+
option.value
|
|
822
|
+
)),
|
|
823
|
+
/* @__PURE__ */ jsx17(ChevronsUpDown2, { className: "ml-auto h-4 w-4 shrink-0 opacity-50" })
|
|
824
|
+
]
|
|
825
|
+
}
|
|
826
|
+
);
|
|
827
|
+
const command = /* @__PURE__ */ jsxs15(CommandPrimitive2, { className: "flex h-full w-full flex-col overflow-hidden", children: [
|
|
828
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center border-b px-3", children: [
|
|
829
|
+
/* @__PURE__ */ jsx17(Search2, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
830
|
+
/* @__PURE__ */ jsx17(
|
|
831
|
+
CommandPrimitive2.Input,
|
|
832
|
+
{
|
|
833
|
+
placeholder: searchPlaceholder,
|
|
834
|
+
className: "flex h-11 w-full bg-transparent py-2 text-base outline-none placeholder:text-muted-foreground sm:h-9 sm:text-sm"
|
|
835
|
+
}
|
|
836
|
+
)
|
|
837
|
+
] }),
|
|
838
|
+
/* @__PURE__ */ jsxs15(CommandPrimitive2.List, { className: "max-h-[50vh] overflow-y-auto overflow-x-hidden p-1 sm:max-h-60", children: [
|
|
839
|
+
/* @__PURE__ */ jsx17(CommandPrimitive2.Empty, { className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage }),
|
|
840
|
+
options.map((option) => /* @__PURE__ */ jsxs15(
|
|
841
|
+
CommandPrimitive2.Item,
|
|
842
|
+
{
|
|
843
|
+
value: option.label,
|
|
844
|
+
disabled: option.disabled,
|
|
845
|
+
onSelect: () => toggleValue(option.value),
|
|
846
|
+
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",
|
|
847
|
+
children: [
|
|
848
|
+
/* @__PURE__ */ jsx17(
|
|
849
|
+
Check2,
|
|
850
|
+
{
|
|
851
|
+
className: cn(
|
|
852
|
+
"h-4 w-4 shrink-0",
|
|
853
|
+
value.includes(option.value) ? "opacity-100" : "opacity-0"
|
|
854
|
+
)
|
|
855
|
+
}
|
|
856
|
+
),
|
|
857
|
+
/* @__PURE__ */ jsx17("span", { className: "truncate", children: option.label })
|
|
858
|
+
]
|
|
859
|
+
},
|
|
860
|
+
option.value
|
|
861
|
+
))
|
|
862
|
+
] })
|
|
863
|
+
] });
|
|
864
|
+
if (isDesktop) {
|
|
865
|
+
return /* @__PURE__ */ jsxs15(PopoverPrimitive2.Root, { open, onOpenChange: setOpen, modal: true, children: [
|
|
866
|
+
/* @__PURE__ */ jsx17(PopoverPrimitive2.Trigger, { asChild: true, disabled, children: trigger }),
|
|
867
|
+
/* @__PURE__ */ jsx17(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ jsx17(
|
|
868
|
+
PopoverPrimitive2.Content,
|
|
869
|
+
{
|
|
870
|
+
align: "start",
|
|
871
|
+
sideOffset: 4,
|
|
872
|
+
className: "z-50 overflow-hidden rounded-md border bg-popover p-0 text-popover-foreground shadow-md",
|
|
873
|
+
style: { width: "var(--radix-popover-trigger-width)" },
|
|
874
|
+
children: command
|
|
875
|
+
}
|
|
876
|
+
) })
|
|
877
|
+
] });
|
|
878
|
+
}
|
|
879
|
+
return /* @__PURE__ */ jsxs15(DrawerPrimitive2.Root, { open, onOpenChange: setOpen, children: [
|
|
880
|
+
/* @__PURE__ */ jsx17(DrawerPrimitive2.Trigger, { asChild: true, disabled, children: trigger }),
|
|
881
|
+
/* @__PURE__ */ jsxs15(DrawerPrimitive2.Portal, { children: [
|
|
882
|
+
/* @__PURE__ */ jsx17(DrawerPrimitive2.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
|
|
883
|
+
/* @__PURE__ */ jsxs15(DrawerPrimitive2.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: [
|
|
884
|
+
/* @__PURE__ */ jsx17(DrawerPrimitive2.Title, { className: "sr-only", children: placeholder }),
|
|
885
|
+
/* @__PURE__ */ jsx17("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
|
|
886
|
+
command
|
|
887
|
+
] })
|
|
888
|
+
] })
|
|
889
|
+
] });
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
// src/components/color-picker.tsx
|
|
893
|
+
import * as PopoverPrimitive3 from "@radix-ui/react-popover";
|
|
894
|
+
import { ChevronsUpDown as ChevronsUpDown3 } from "lucide-react";
|
|
895
|
+
import * as React7 from "react";
|
|
896
|
+
import { HexColorInput, HexColorPicker } from "react-colorful";
|
|
897
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
751
898
|
function ColorPicker({
|
|
752
899
|
value,
|
|
753
900
|
onChange,
|
|
@@ -758,10 +905,10 @@ function ColorPicker({
|
|
|
758
905
|
"aria-invalid": ariaInvalid,
|
|
759
906
|
"aria-describedby": ariaDescribedby
|
|
760
907
|
}) {
|
|
761
|
-
const [open, setOpen] =
|
|
908
|
+
const [open, setOpen] = React7.useState(false);
|
|
762
909
|
const color = value || "";
|
|
763
|
-
return /* @__PURE__ */
|
|
764
|
-
/* @__PURE__ */
|
|
910
|
+
return /* @__PURE__ */ jsxs16(PopoverPrimitive3.Root, { open, onOpenChange: setOpen, modal: true, children: [
|
|
911
|
+
/* @__PURE__ */ jsx18(PopoverPrimitive3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs16(
|
|
765
912
|
"button",
|
|
766
913
|
{
|
|
767
914
|
type: "button",
|
|
@@ -774,8 +921,8 @@ function ColorPicker({
|
|
|
774
921
|
className
|
|
775
922
|
),
|
|
776
923
|
children: [
|
|
777
|
-
/* @__PURE__ */
|
|
778
|
-
/* @__PURE__ */
|
|
924
|
+
/* @__PURE__ */ jsxs16("span", { className: "flex items-center gap-2 truncate", children: [
|
|
925
|
+
/* @__PURE__ */ jsx18(
|
|
779
926
|
"span",
|
|
780
927
|
{
|
|
781
928
|
"aria-hidden": true,
|
|
@@ -788,23 +935,23 @@ function ColorPicker({
|
|
|
788
935
|
}
|
|
789
936
|
}
|
|
790
937
|
),
|
|
791
|
-
/* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ jsx18("span", { className: cn("truncate", !color && "text-muted-foreground"), children: color || placeholder })
|
|
792
939
|
] }),
|
|
793
|
-
/* @__PURE__ */
|
|
940
|
+
/* @__PURE__ */ jsx18(ChevronsUpDown3, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
794
941
|
]
|
|
795
942
|
}
|
|
796
943
|
) }),
|
|
797
|
-
/* @__PURE__ */
|
|
798
|
-
|
|
944
|
+
/* @__PURE__ */ jsx18(PopoverPrimitive3.Portal, { children: /* @__PURE__ */ jsx18(
|
|
945
|
+
PopoverPrimitive3.Content,
|
|
799
946
|
{
|
|
800
947
|
align: "start",
|
|
801
948
|
sideOffset: 4,
|
|
802
949
|
className: "z-50 w-56 rounded-md border bg-popover p-3 text-popover-foreground shadow-md",
|
|
803
|
-
children: /* @__PURE__ */
|
|
804
|
-
/* @__PURE__ */
|
|
805
|
-
/* @__PURE__ */
|
|
806
|
-
/* @__PURE__ */
|
|
807
|
-
/* @__PURE__ */
|
|
950
|
+
children: /* @__PURE__ */ jsxs16("div", { className: "mh-color-picker flex flex-col gap-3", children: [
|
|
951
|
+
/* @__PURE__ */ jsx18(HexColorPicker, { color, onChange }),
|
|
952
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2", children: [
|
|
953
|
+
/* @__PURE__ */ jsx18("span", { className: "text-sm text-muted-foreground", children: "#" }),
|
|
954
|
+
/* @__PURE__ */ jsx18(
|
|
808
955
|
HexColorInput,
|
|
809
956
|
{
|
|
810
957
|
color,
|
|
@@ -821,30 +968,30 @@ function ColorPicker({
|
|
|
821
968
|
}
|
|
822
969
|
|
|
823
970
|
// src/components/stat-card.tsx
|
|
824
|
-
import { jsx as
|
|
971
|
+
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
825
972
|
function StatCard({ label, value, detail, icon, isLoading }) {
|
|
826
973
|
if (isLoading) {
|
|
827
|
-
return /* @__PURE__ */
|
|
828
|
-
/* @__PURE__ */
|
|
829
|
-
/* @__PURE__ */
|
|
830
|
-
/* @__PURE__ */
|
|
974
|
+
return /* @__PURE__ */ jsxs17("div", { className: "rounded-lg border bg-card p-6 shadow-sm", children: [
|
|
975
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between pb-2", children: [
|
|
976
|
+
/* @__PURE__ */ jsx19("div", { className: "h-4 w-24 animate-pulse rounded bg-muted" }),
|
|
977
|
+
/* @__PURE__ */ jsx19("div", { className: "h-4 w-4 animate-pulse rounded bg-muted" })
|
|
831
978
|
] }),
|
|
832
|
-
/* @__PURE__ */
|
|
833
|
-
/* @__PURE__ */
|
|
979
|
+
/* @__PURE__ */ jsx19("div", { className: "mt-2 h-7 w-16 animate-pulse rounded bg-muted" }),
|
|
980
|
+
/* @__PURE__ */ jsx19("div", { className: "mt-1 h-4 w-20 animate-pulse rounded bg-muted" })
|
|
834
981
|
] });
|
|
835
982
|
}
|
|
836
|
-
return /* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */
|
|
838
|
-
/* @__PURE__ */
|
|
839
|
-
icon && /* @__PURE__ */
|
|
983
|
+
return /* @__PURE__ */ jsxs17("div", { className: "rounded-lg border bg-card p-6 shadow-sm", children: [
|
|
984
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between pb-2", children: [
|
|
985
|
+
/* @__PURE__ */ jsx19("span", { className: "text-sm font-medium text-muted-foreground", children: label }),
|
|
986
|
+
icon && /* @__PURE__ */ jsx19("span", { className: "text-muted-foreground", children: icon })
|
|
840
987
|
] }),
|
|
841
|
-
/* @__PURE__ */
|
|
842
|
-
detail && /* @__PURE__ */
|
|
988
|
+
/* @__PURE__ */ jsx19("div", { className: "text-2xl font-bold", children: value }),
|
|
989
|
+
detail && /* @__PURE__ */ jsx19("p", { className: "text-xs text-muted-foreground", children: detail })
|
|
843
990
|
] });
|
|
844
991
|
}
|
|
845
992
|
|
|
846
993
|
// src/components/data-table-wrapper.tsx
|
|
847
|
-
import { jsx as
|
|
994
|
+
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
848
995
|
function DataTableWrapper({
|
|
849
996
|
children,
|
|
850
997
|
isEmpty,
|
|
@@ -857,15 +1004,15 @@ function DataTableWrapper({
|
|
|
857
1004
|
hasNextPage = false,
|
|
858
1005
|
hasPreviousPage = false
|
|
859
1006
|
}) {
|
|
860
|
-
return /* @__PURE__ */
|
|
861
|
-
/* @__PURE__ */
|
|
862
|
-
!isLoading && isEmpty && /* @__PURE__ */
|
|
863
|
-
emptyIcon && /* @__PURE__ */
|
|
864
|
-
/* @__PURE__ */
|
|
865
|
-
emptyDescription && /* @__PURE__ */
|
|
1007
|
+
return /* @__PURE__ */ jsxs18("div", { className: "space-y-4", children: [
|
|
1008
|
+
/* @__PURE__ */ jsx20("div", { className: "overflow-x-auto rounded-md border", children }),
|
|
1009
|
+
!isLoading && isEmpty && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
1010
|
+
emptyIcon && /* @__PURE__ */ jsx20("div", { className: "mb-4 text-muted-foreground", children: emptyIcon }),
|
|
1011
|
+
/* @__PURE__ */ jsx20("h3", { className: "text-lg font-semibold tracking-tight", children: emptyTitle }),
|
|
1012
|
+
emptyDescription && /* @__PURE__ */ jsx20("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: emptyDescription })
|
|
866
1013
|
] }),
|
|
867
|
-
page !== void 0 && onPageChange && /* @__PURE__ */
|
|
868
|
-
/* @__PURE__ */
|
|
1014
|
+
page !== void 0 && onPageChange && /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-end gap-4", children: [
|
|
1015
|
+
/* @__PURE__ */ jsx20(
|
|
869
1016
|
"button",
|
|
870
1017
|
{
|
|
871
1018
|
type: "button",
|
|
@@ -875,11 +1022,11 @@ function DataTableWrapper({
|
|
|
875
1022
|
children: "Anterior"
|
|
876
1023
|
}
|
|
877
1024
|
),
|
|
878
|
-
/* @__PURE__ */
|
|
1025
|
+
/* @__PURE__ */ jsxs18("span", { className: "text-sm text-muted-foreground", children: [
|
|
879
1026
|
"P\xE1gina ",
|
|
880
1027
|
page
|
|
881
1028
|
] }),
|
|
882
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ jsx20(
|
|
883
1030
|
"button",
|
|
884
1031
|
{
|
|
885
1032
|
type: "button",
|
|
@@ -895,7 +1042,7 @@ function DataTableWrapper({
|
|
|
895
1042
|
|
|
896
1043
|
// src/components/mobile-card-list.tsx
|
|
897
1044
|
import { useRef } from "react";
|
|
898
|
-
import { jsx as
|
|
1045
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
899
1046
|
var SCROLL_THRESHOLD = 8;
|
|
900
1047
|
function MobileCardList({
|
|
901
1048
|
data,
|
|
@@ -926,26 +1073,26 @@ function MobileCardList({
|
|
|
926
1073
|
}
|
|
927
1074
|
};
|
|
928
1075
|
if (isLoading) {
|
|
929
|
-
return /* @__PURE__ */
|
|
930
|
-
/* @__PURE__ */
|
|
931
|
-
/* @__PURE__ */
|
|
932
|
-
/* @__PURE__ */
|
|
1076
|
+
return /* @__PURE__ */ jsx21("div", { className: `space-y-3 ${className ?? ""}`, children: Array.from({ length: loadingCount }).map((_, i) => /* @__PURE__ */ jsx21("div", { className: "rounded-xl border p-4", children: /* @__PURE__ */ jsxs19("div", { className: "space-y-3", children: [
|
|
1077
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex justify-between", children: [
|
|
1078
|
+
/* @__PURE__ */ jsx21("div", { className: "h-5 w-32 animate-pulse rounded bg-muted" }),
|
|
1079
|
+
/* @__PURE__ */ jsx21("div", { className: "h-5 w-16 animate-pulse rounded bg-muted" })
|
|
933
1080
|
] }),
|
|
934
|
-
/* @__PURE__ */
|
|
935
|
-
/* @__PURE__ */
|
|
936
|
-
/* @__PURE__ */
|
|
937
|
-
/* @__PURE__ */
|
|
1081
|
+
/* @__PURE__ */ jsx21("div", { className: "h-4 w-48 animate-pulse rounded bg-muted" }),
|
|
1082
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex justify-between", children: [
|
|
1083
|
+
/* @__PURE__ */ jsx21("div", { className: "h-4 w-24 animate-pulse rounded bg-muted" }),
|
|
1084
|
+
/* @__PURE__ */ jsx21("div", { className: "h-4 w-20 animate-pulse rounded bg-muted" })
|
|
938
1085
|
] })
|
|
939
1086
|
] }) }, i)) });
|
|
940
1087
|
}
|
|
941
|
-
return /* @__PURE__ */
|
|
1088
|
+
return /* @__PURE__ */ jsx21(
|
|
942
1089
|
"div",
|
|
943
1090
|
{
|
|
944
1091
|
className: `space-y-3 ${className ?? ""}`,
|
|
945
1092
|
onTouchStart,
|
|
946
1093
|
onTouchMove,
|
|
947
1094
|
onClickCapture,
|
|
948
|
-
children: data.map((item, index) => /* @__PURE__ */
|
|
1095
|
+
children: data.map((item, index) => /* @__PURE__ */ jsx21(
|
|
949
1096
|
"div",
|
|
950
1097
|
{
|
|
951
1098
|
className: "rounded-xl border p-4 transition-all duration-150 hover:border-foreground/20 active:scale-[0.99]",
|
|
@@ -958,7 +1105,7 @@ function MobileCardList({
|
|
|
958
1105
|
}
|
|
959
1106
|
|
|
960
1107
|
// src/components/responsive-data-view.tsx
|
|
961
|
-
import { jsx as
|
|
1108
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
962
1109
|
function ResponsiveDataView({
|
|
963
1110
|
table,
|
|
964
1111
|
cards,
|
|
@@ -969,13 +1116,13 @@ function ResponsiveDataView({
|
|
|
969
1116
|
emptyDescription,
|
|
970
1117
|
pagination
|
|
971
1118
|
}) {
|
|
972
|
-
return /* @__PURE__ */
|
|
973
|
-
/* @__PURE__ */
|
|
974
|
-
/* @__PURE__ */
|
|
975
|
-
!isLoading && isEmpty && /* @__PURE__ */
|
|
976
|
-
emptyIcon && /* @__PURE__ */
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
emptyDescription && /* @__PURE__ */
|
|
1119
|
+
return /* @__PURE__ */ jsxs20("div", { className: "space-y-4", children: [
|
|
1120
|
+
/* @__PURE__ */ jsx22("div", { className: "hidden overflow-x-auto rounded-md border md:block", children: table }),
|
|
1121
|
+
/* @__PURE__ */ jsx22("div", { className: "md:hidden", children: cards }),
|
|
1122
|
+
!isLoading && isEmpty && /* @__PURE__ */ jsxs20("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
1123
|
+
emptyIcon && /* @__PURE__ */ jsx22("div", { className: "mb-4 text-muted-foreground", children: emptyIcon }),
|
|
1124
|
+
/* @__PURE__ */ jsx22("h3", { className: "text-lg font-semibold tracking-tight", children: emptyTitle }),
|
|
1125
|
+
emptyDescription && /* @__PURE__ */ jsx22("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: emptyDescription })
|
|
979
1126
|
] }),
|
|
980
1127
|
pagination
|
|
981
1128
|
] });
|
|
@@ -983,10 +1130,10 @@ function ResponsiveDataView({
|
|
|
983
1130
|
|
|
984
1131
|
// src/components/toaster.tsx
|
|
985
1132
|
import { Toaster as Sonner } from "sonner";
|
|
986
|
-
import { jsx as
|
|
1133
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
987
1134
|
function Toaster(props) {
|
|
988
1135
|
const { theme = "system" } = useTheme();
|
|
989
|
-
return /* @__PURE__ */
|
|
1136
|
+
return /* @__PURE__ */ jsx23(
|
|
990
1137
|
Sonner,
|
|
991
1138
|
{
|
|
992
1139
|
theme,
|
|
@@ -1008,17 +1155,17 @@ function Toaster(props) {
|
|
|
1008
1155
|
|
|
1009
1156
|
// src/components/app-shell.tsx
|
|
1010
1157
|
import { ChevronLeft, ChevronRight, Menu } from "lucide-react";
|
|
1011
|
-
import { useState as
|
|
1158
|
+
import { useState as useState9 } from "react";
|
|
1012
1159
|
|
|
1013
1160
|
// src/components/sidebar-nav.tsx
|
|
1014
1161
|
import { Fragment as Fragment3 } from "react";
|
|
1015
1162
|
|
|
1016
1163
|
// src/components/types.tsx
|
|
1017
|
-
import { jsx as
|
|
1018
|
-
var defaultRenderLink = ({ children, ...props }) => /* @__PURE__ */
|
|
1164
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1165
|
+
var defaultRenderLink = ({ children, ...props }) => /* @__PURE__ */ jsx24("a", { ...props, children });
|
|
1019
1166
|
|
|
1020
1167
|
// src/components/sidebar-nav.tsx
|
|
1021
|
-
import { Fragment as Fragment4, jsx as
|
|
1168
|
+
import { Fragment as Fragment4, jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1022
1169
|
function defaultIsActive(item, activePath) {
|
|
1023
1170
|
if (item.href === "/") return activePath === "/";
|
|
1024
1171
|
return activePath === item.href || activePath.startsWith(item.href + "/");
|
|
@@ -1033,7 +1180,7 @@ function SidebarNav({
|
|
|
1033
1180
|
onNavigate
|
|
1034
1181
|
}) {
|
|
1035
1182
|
const visible = items.filter((item) => !item.adminOnly || isAdmin);
|
|
1036
|
-
return /* @__PURE__ */
|
|
1183
|
+
return /* @__PURE__ */ jsx25("nav", { className: "flex flex-col gap-1", children: visible.map((item) => {
|
|
1037
1184
|
const active = isActive(item, activePath);
|
|
1038
1185
|
const link = renderLink({
|
|
1039
1186
|
href: item.href,
|
|
@@ -1045,21 +1192,21 @@ function SidebarNav({
|
|
|
1045
1192
|
active ? "bg-accent text-accent-foreground font-semibold" : "text-muted-foreground hover:bg-accent hover:text-accent-foreground",
|
|
1046
1193
|
isCollapsed && "justify-center px-2"
|
|
1047
1194
|
),
|
|
1048
|
-
children: /* @__PURE__ */
|
|
1049
|
-
item.icon && /* @__PURE__ */
|
|
1050
|
-
!isCollapsed && /* @__PURE__ */
|
|
1195
|
+
children: /* @__PURE__ */ jsxs21(Fragment4, { children: [
|
|
1196
|
+
item.icon && /* @__PURE__ */ jsx25("span", { className: "shrink-0", children: item.icon }),
|
|
1197
|
+
!isCollapsed && /* @__PURE__ */ jsx25("span", { className: "truncate", children: item.label })
|
|
1051
1198
|
] })
|
|
1052
1199
|
});
|
|
1053
|
-
return /* @__PURE__ */
|
|
1200
|
+
return /* @__PURE__ */ jsx25(Fragment3, { children: link }, item.href);
|
|
1054
1201
|
}) });
|
|
1055
1202
|
}
|
|
1056
1203
|
|
|
1057
1204
|
// src/components/user-menu.tsx
|
|
1058
1205
|
import * as DropdownMenu2 from "@radix-ui/react-dropdown-menu";
|
|
1059
1206
|
import { LogOut, User } from "lucide-react";
|
|
1060
|
-
import { useState as
|
|
1061
|
-
import { Drawer as
|
|
1062
|
-
import { Fragment as Fragment5, jsx as
|
|
1207
|
+
import { useState as useState8 } from "react";
|
|
1208
|
+
import { Drawer as DrawerPrimitive3 } from "vaul";
|
|
1209
|
+
import { Fragment as Fragment5, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1063
1210
|
function initials(user) {
|
|
1064
1211
|
const source = user?.name?.trim() || user?.email?.trim();
|
|
1065
1212
|
if (!source) return "";
|
|
@@ -1078,52 +1225,52 @@ function UserMenu({
|
|
|
1078
1225
|
align = "end"
|
|
1079
1226
|
}) {
|
|
1080
1227
|
const isDesktop = useIsDesktop();
|
|
1081
|
-
const [open, setOpen] =
|
|
1228
|
+
const [open, setOpen] = useState8(false);
|
|
1082
1229
|
const label = initials(user);
|
|
1083
|
-
const trigger = /* @__PURE__ */
|
|
1230
|
+
const trigger = /* @__PURE__ */ jsx26(
|
|
1084
1231
|
"button",
|
|
1085
1232
|
{
|
|
1086
1233
|
type: "button",
|
|
1087
1234
|
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",
|
|
1088
1235
|
"aria-label": "Menu do usu\xE1rio",
|
|
1089
1236
|
"data-testid": "user-menu",
|
|
1090
|
-
children: user?.avatarUrl ? /* @__PURE__ */
|
|
1237
|
+
children: user?.avatarUrl ? /* @__PURE__ */ jsx26(
|
|
1091
1238
|
"img",
|
|
1092
1239
|
{
|
|
1093
1240
|
src: user.avatarUrl,
|
|
1094
1241
|
alt: user.name ?? user.email ?? "Avatar",
|
|
1095
1242
|
className: "h-full w-full object-cover"
|
|
1096
1243
|
}
|
|
1097
|
-
) : label ? /* @__PURE__ */
|
|
1244
|
+
) : label ? /* @__PURE__ */ jsx26("span", { children: label }) : /* @__PURE__ */ jsx26(User, { className: "h-4 w-4" })
|
|
1098
1245
|
}
|
|
1099
1246
|
);
|
|
1100
|
-
const userInfo = (user?.name || user?.email) && /* @__PURE__ */
|
|
1101
|
-
user.name && /* @__PURE__ */
|
|
1102
|
-
user.email && /* @__PURE__ */
|
|
1247
|
+
const userInfo = (user?.name || user?.email) && /* @__PURE__ */ jsxs22("div", { className: "px-2 py-1.5", children: [
|
|
1248
|
+
user.name && /* @__PURE__ */ jsx26("p", { className: "truncate text-sm font-medium", children: user.name }),
|
|
1249
|
+
user.email && /* @__PURE__ */ jsx26("p", { className: "truncate text-xs text-muted-foreground", children: user.email })
|
|
1103
1250
|
] });
|
|
1104
1251
|
if (isDesktop) {
|
|
1105
|
-
return /* @__PURE__ */
|
|
1106
|
-
/* @__PURE__ */
|
|
1107
|
-
/* @__PURE__ */
|
|
1252
|
+
return /* @__PURE__ */ jsxs22(DropdownMenu2.Root, { open, onOpenChange: setOpen, children: [
|
|
1253
|
+
/* @__PURE__ */ jsx26(DropdownMenu2.Trigger, { asChild: true, children: trigger }),
|
|
1254
|
+
/* @__PURE__ */ jsx26(DropdownMenu2.Portal, { children: /* @__PURE__ */ jsxs22(
|
|
1108
1255
|
DropdownMenu2.Content,
|
|
1109
1256
|
{
|
|
1110
1257
|
align,
|
|
1111
1258
|
sideOffset: 6,
|
|
1112
1259
|
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",
|
|
1113
1260
|
children: [
|
|
1114
|
-
userInfo && /* @__PURE__ */
|
|
1261
|
+
userInfo && /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
1115
1262
|
userInfo,
|
|
1116
|
-
/* @__PURE__ */
|
|
1263
|
+
/* @__PURE__ */ jsx26(DropdownMenu2.Separator, { className: "-mx-1 my-1 h-px bg-border" })
|
|
1117
1264
|
] }),
|
|
1118
1265
|
items.map(
|
|
1119
|
-
(item) => item.href ? /* @__PURE__ */
|
|
1266
|
+
(item) => item.href ? /* @__PURE__ */ jsx26(DropdownMenu2.Item, { asChild: true, children: renderLink({
|
|
1120
1267
|
href: item.href,
|
|
1121
1268
|
className: itemClass,
|
|
1122
|
-
children: /* @__PURE__ */
|
|
1269
|
+
children: /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
1123
1270
|
item.icon,
|
|
1124
1271
|
item.label
|
|
1125
1272
|
] })
|
|
1126
|
-
}) }, item.label) : /* @__PURE__ */
|
|
1273
|
+
}) }, item.label) : /* @__PURE__ */ jsxs22(
|
|
1127
1274
|
DropdownMenu2.Item,
|
|
1128
1275
|
{
|
|
1129
1276
|
className: itemClass,
|
|
@@ -1136,9 +1283,9 @@ function UserMenu({
|
|
|
1136
1283
|
item.label
|
|
1137
1284
|
)
|
|
1138
1285
|
),
|
|
1139
|
-
onLogout && /* @__PURE__ */
|
|
1140
|
-
items.length > 0 && /* @__PURE__ */
|
|
1141
|
-
/* @__PURE__ */
|
|
1286
|
+
onLogout && /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
1287
|
+
items.length > 0 && /* @__PURE__ */ jsx26(DropdownMenu2.Separator, { className: "-mx-1 my-1 h-px bg-border" }),
|
|
1288
|
+
/* @__PURE__ */ jsxs22(
|
|
1142
1289
|
DropdownMenu2.Item,
|
|
1143
1290
|
{
|
|
1144
1291
|
className: cn(
|
|
@@ -1147,7 +1294,7 @@ function UserMenu({
|
|
|
1147
1294
|
),
|
|
1148
1295
|
onClick: onLogout,
|
|
1149
1296
|
children: [
|
|
1150
|
-
/* @__PURE__ */
|
|
1297
|
+
/* @__PURE__ */ jsx26(LogOut, { className: "h-4 w-4" }),
|
|
1151
1298
|
logoutLabel
|
|
1152
1299
|
]
|
|
1153
1300
|
}
|
|
@@ -1158,19 +1305,19 @@ function UserMenu({
|
|
|
1158
1305
|
) })
|
|
1159
1306
|
] });
|
|
1160
1307
|
}
|
|
1161
|
-
return /* @__PURE__ */
|
|
1162
|
-
/* @__PURE__ */
|
|
1163
|
-
/* @__PURE__ */
|
|
1164
|
-
/* @__PURE__ */
|
|
1165
|
-
/* @__PURE__ */
|
|
1166
|
-
/* @__PURE__ */
|
|
1167
|
-
/* @__PURE__ */
|
|
1168
|
-
userInfo && /* @__PURE__ */
|
|
1308
|
+
return /* @__PURE__ */ jsxs22(DrawerPrimitive3.Root, { open, onOpenChange: setOpen, children: [
|
|
1309
|
+
/* @__PURE__ */ jsx26(DrawerPrimitive3.Trigger, { asChild: true, children: trigger }),
|
|
1310
|
+
/* @__PURE__ */ jsxs22(DrawerPrimitive3.Portal, { children: [
|
|
1311
|
+
/* @__PURE__ */ jsx26(DrawerPrimitive3.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
|
|
1312
|
+
/* @__PURE__ */ jsxs22(DrawerPrimitive3.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: [
|
|
1313
|
+
/* @__PURE__ */ jsx26(DrawerPrimitive3.Title, { className: "sr-only", children: "Menu do usu\xE1rio" }),
|
|
1314
|
+
/* @__PURE__ */ jsx26("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
|
|
1315
|
+
userInfo && /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
1169
1316
|
userInfo,
|
|
1170
|
-
/* @__PURE__ */
|
|
1317
|
+
/* @__PURE__ */ jsx26("div", { className: "-mx-1 my-1 h-px bg-border" })
|
|
1171
1318
|
] }),
|
|
1172
1319
|
items.map(
|
|
1173
|
-
(item) => item.href ? /* @__PURE__ */
|
|
1320
|
+
(item) => item.href ? /* @__PURE__ */ jsx26(
|
|
1174
1321
|
"span",
|
|
1175
1322
|
{
|
|
1176
1323
|
onClick: () => setOpen(false),
|
|
@@ -1178,14 +1325,14 @@ function UserMenu({
|
|
|
1178
1325
|
children: renderLink({
|
|
1179
1326
|
href: item.href,
|
|
1180
1327
|
className: sheetItemClass,
|
|
1181
|
-
children: /* @__PURE__ */
|
|
1328
|
+
children: /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
1182
1329
|
item.icon,
|
|
1183
1330
|
item.label
|
|
1184
1331
|
] })
|
|
1185
1332
|
})
|
|
1186
1333
|
},
|
|
1187
1334
|
item.label
|
|
1188
|
-
) : /* @__PURE__ */
|
|
1335
|
+
) : /* @__PURE__ */ jsxs22(
|
|
1189
1336
|
"button",
|
|
1190
1337
|
{
|
|
1191
1338
|
type: "button",
|
|
@@ -1202,9 +1349,9 @@ function UserMenu({
|
|
|
1202
1349
|
item.label
|
|
1203
1350
|
)
|
|
1204
1351
|
),
|
|
1205
|
-
onLogout && /* @__PURE__ */
|
|
1206
|
-
items.length > 0 && /* @__PURE__ */
|
|
1207
|
-
/* @__PURE__ */
|
|
1352
|
+
onLogout && /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
1353
|
+
items.length > 0 && /* @__PURE__ */ jsx26("div", { className: "-mx-1 my-1 h-px bg-border" }),
|
|
1354
|
+
/* @__PURE__ */ jsxs22(
|
|
1208
1355
|
"button",
|
|
1209
1356
|
{
|
|
1210
1357
|
type: "button",
|
|
@@ -1214,7 +1361,7 @@ function UserMenu({
|
|
|
1214
1361
|
setOpen(false);
|
|
1215
1362
|
},
|
|
1216
1363
|
children: [
|
|
1217
|
-
/* @__PURE__ */
|
|
1364
|
+
/* @__PURE__ */ jsx26(LogOut, { className: "h-4 w-4" }),
|
|
1218
1365
|
logoutLabel
|
|
1219
1366
|
]
|
|
1220
1367
|
}
|
|
@@ -1226,7 +1373,7 @@ function UserMenu({
|
|
|
1226
1373
|
}
|
|
1227
1374
|
|
|
1228
1375
|
// src/components/app-shell.tsx
|
|
1229
|
-
import { jsx as
|
|
1376
|
+
import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1230
1377
|
function AppShell({
|
|
1231
1378
|
brand,
|
|
1232
1379
|
brandCollapsed,
|
|
@@ -1243,9 +1390,9 @@ function AppShell({
|
|
|
1243
1390
|
defaultCollapsed = false,
|
|
1244
1391
|
children
|
|
1245
1392
|
}) {
|
|
1246
|
-
const [collapsed, setCollapsed] =
|
|
1247
|
-
const [mobileOpen, setMobileOpen] =
|
|
1248
|
-
const nav = (isCollapsed, onNavigate) => /* @__PURE__ */
|
|
1393
|
+
const [collapsed, setCollapsed] = useState9(defaultCollapsed);
|
|
1394
|
+
const [mobileOpen, setMobileOpen] = useState9(false);
|
|
1395
|
+
const nav = (isCollapsed, onNavigate) => /* @__PURE__ */ jsx27(
|
|
1249
1396
|
SidebarNav,
|
|
1250
1397
|
{
|
|
1251
1398
|
items: navItems,
|
|
@@ -1257,8 +1404,8 @@ function AppShell({
|
|
|
1257
1404
|
onNavigate
|
|
1258
1405
|
}
|
|
1259
1406
|
);
|
|
1260
|
-
return /* @__PURE__ */
|
|
1261
|
-
/* @__PURE__ */
|
|
1407
|
+
return /* @__PURE__ */ jsxs23("div", { className: "flex h-screen overflow-hidden bg-background", children: [
|
|
1408
|
+
/* @__PURE__ */ jsxs23(
|
|
1262
1409
|
"aside",
|
|
1263
1410
|
{
|
|
1264
1411
|
className: cn(
|
|
@@ -1266,22 +1413,22 @@ function AppShell({
|
|
|
1266
1413
|
collapsed ? "w-16" : "w-60"
|
|
1267
1414
|
),
|
|
1268
1415
|
children: [
|
|
1269
|
-
/* @__PURE__ */
|
|
1270
|
-
/* @__PURE__ */
|
|
1271
|
-
collapsible && /* @__PURE__ */
|
|
1416
|
+
/* @__PURE__ */ jsx27("div", { className: "flex h-14 shrink-0 items-center border-b px-4", children: collapsed ? brandCollapsed ?? brand : brand }),
|
|
1417
|
+
/* @__PURE__ */ jsx27("div", { className: "flex-1 overflow-y-auto px-2 py-4", children: nav(collapsed) }),
|
|
1418
|
+
collapsible && /* @__PURE__ */ jsx27("div", { className: "border-t p-2", children: /* @__PURE__ */ jsx27(
|
|
1272
1419
|
"button",
|
|
1273
1420
|
{
|
|
1274
1421
|
type: "button",
|
|
1275
1422
|
onClick: () => setCollapsed((v) => !v),
|
|
1276
1423
|
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",
|
|
1277
1424
|
"aria-label": collapsed ? "Expandir menu" : "Recolher menu",
|
|
1278
|
-
children: collapsed ? /* @__PURE__ */
|
|
1425
|
+
children: collapsed ? /* @__PURE__ */ jsx27(ChevronRight, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx27(ChevronLeft, { className: "h-4 w-4" })
|
|
1279
1426
|
}
|
|
1280
1427
|
) })
|
|
1281
1428
|
]
|
|
1282
1429
|
}
|
|
1283
1430
|
),
|
|
1284
|
-
/* @__PURE__ */
|
|
1431
|
+
/* @__PURE__ */ jsxs23(
|
|
1285
1432
|
"div",
|
|
1286
1433
|
{
|
|
1287
1434
|
className: cn(
|
|
@@ -1290,8 +1437,8 @@ function AppShell({
|
|
|
1290
1437
|
),
|
|
1291
1438
|
onClick: () => setMobileOpen(false),
|
|
1292
1439
|
children: [
|
|
1293
|
-
/* @__PURE__ */
|
|
1294
|
-
/* @__PURE__ */
|
|
1440
|
+
/* @__PURE__ */ jsx27("div", { className: "absolute inset-0 bg-black/50" }),
|
|
1441
|
+
/* @__PURE__ */ jsxs23(
|
|
1295
1442
|
"div",
|
|
1296
1443
|
{
|
|
1297
1444
|
className: cn(
|
|
@@ -1300,32 +1447,32 @@ function AppShell({
|
|
|
1300
1447
|
),
|
|
1301
1448
|
onClick: (e) => e.stopPropagation(),
|
|
1302
1449
|
children: [
|
|
1303
|
-
/* @__PURE__ */
|
|
1304
|
-
/* @__PURE__ */
|
|
1450
|
+
/* @__PURE__ */ jsx27("div", { className: "flex h-14 shrink-0 items-center border-b px-4", children: brand }),
|
|
1451
|
+
/* @__PURE__ */ jsx27("div", { className: "flex-1 overflow-y-auto px-2 py-4", children: nav(false, () => setMobileOpen(false)) })
|
|
1305
1452
|
]
|
|
1306
1453
|
}
|
|
1307
1454
|
)
|
|
1308
1455
|
]
|
|
1309
1456
|
}
|
|
1310
1457
|
),
|
|
1311
|
-
/* @__PURE__ */
|
|
1312
|
-
/* @__PURE__ */
|
|
1313
|
-
/* @__PURE__ */
|
|
1458
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
1459
|
+
/* @__PURE__ */ jsxs23("header", { className: "flex h-14 shrink-0 items-center gap-2 border-b bg-background px-4", children: [
|
|
1460
|
+
/* @__PURE__ */ jsx27(
|
|
1314
1461
|
"button",
|
|
1315
1462
|
{
|
|
1316
1463
|
type: "button",
|
|
1317
1464
|
onClick: () => setMobileOpen(true),
|
|
1318
1465
|
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",
|
|
1319
1466
|
"aria-label": "Abrir menu",
|
|
1320
|
-
children: /* @__PURE__ */
|
|
1467
|
+
children: /* @__PURE__ */ jsx27(Menu, { className: "h-4 w-4" })
|
|
1321
1468
|
}
|
|
1322
1469
|
),
|
|
1323
|
-
/* @__PURE__ */
|
|
1470
|
+
/* @__PURE__ */ jsxs23("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
1324
1471
|
headerActions,
|
|
1325
|
-
(user || onLogout) && /* @__PURE__ */
|
|
1472
|
+
(user || onLogout) && /* @__PURE__ */ jsx27(UserMenu, { user, items: userMenuItems, onLogout, renderLink })
|
|
1326
1473
|
] })
|
|
1327
1474
|
] }),
|
|
1328
|
-
/* @__PURE__ */
|
|
1475
|
+
/* @__PURE__ */ jsx27("main", { className: "flex-1 overflow-y-auto", children })
|
|
1329
1476
|
] })
|
|
1330
1477
|
] });
|
|
1331
1478
|
}
|
|
@@ -1333,9 +1480,9 @@ function AppShell({
|
|
|
1333
1480
|
// src/components/row-actions-menu.tsx
|
|
1334
1481
|
import * as DropdownMenu3 from "@radix-ui/react-dropdown-menu";
|
|
1335
1482
|
import { MoreVertical } from "lucide-react";
|
|
1336
|
-
import { useState as
|
|
1337
|
-
import { Drawer as
|
|
1338
|
-
import { Fragment as Fragment6, jsx as
|
|
1483
|
+
import { useState as useState10 } from "react";
|
|
1484
|
+
import { Drawer as DrawerPrimitive4 } from "vaul";
|
|
1485
|
+
import { Fragment as Fragment6, jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1339
1486
|
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";
|
|
1340
1487
|
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";
|
|
1341
1488
|
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";
|
|
@@ -1347,22 +1494,22 @@ function RowActionsMenu({
|
|
|
1347
1494
|
renderLink = defaultRenderLink
|
|
1348
1495
|
}) {
|
|
1349
1496
|
const isDesktop = useIsDesktop();
|
|
1350
|
-
const [open, setOpen] =
|
|
1497
|
+
const [open, setOpen] = useState10(false);
|
|
1351
1498
|
if (actions.length === 0) return null;
|
|
1352
|
-
const trigger = /* @__PURE__ */
|
|
1499
|
+
const trigger = /* @__PURE__ */ jsx28(
|
|
1353
1500
|
"button",
|
|
1354
1501
|
{
|
|
1355
1502
|
type: "button",
|
|
1356
1503
|
disabled,
|
|
1357
1504
|
"aria-label": label,
|
|
1358
1505
|
className: triggerClass,
|
|
1359
|
-
children: /* @__PURE__ */
|
|
1506
|
+
children: /* @__PURE__ */ jsx28(MoreVertical, { className: "h-4 w-4" })
|
|
1360
1507
|
}
|
|
1361
1508
|
);
|
|
1362
1509
|
if (isDesktop) {
|
|
1363
|
-
return /* @__PURE__ */
|
|
1364
|
-
/* @__PURE__ */
|
|
1365
|
-
/* @__PURE__ */
|
|
1510
|
+
return /* @__PURE__ */ jsxs24(DropdownMenu3.Root, { open, onOpenChange: setOpen, modal: false, children: [
|
|
1511
|
+
/* @__PURE__ */ jsx28(DropdownMenu3.Trigger, { asChild: true, children: trigger }),
|
|
1512
|
+
/* @__PURE__ */ jsx28(DropdownMenu3.Portal, { children: /* @__PURE__ */ jsx28(
|
|
1366
1513
|
DropdownMenu3.Content,
|
|
1367
1514
|
{
|
|
1368
1515
|
align,
|
|
@@ -1373,7 +1520,7 @@ function RowActionsMenu({
|
|
|
1373
1520
|
itemClass2,
|
|
1374
1521
|
action.destructive && "text-destructive focus:bg-destructive/10"
|
|
1375
1522
|
);
|
|
1376
|
-
return action.href ? /* @__PURE__ */
|
|
1523
|
+
return action.href ? /* @__PURE__ */ jsx28(
|
|
1377
1524
|
DropdownMenu3.Item,
|
|
1378
1525
|
{
|
|
1379
1526
|
asChild: true,
|
|
@@ -1381,14 +1528,14 @@ function RowActionsMenu({
|
|
|
1381
1528
|
children: renderLink({
|
|
1382
1529
|
href: action.href,
|
|
1383
1530
|
className: cls,
|
|
1384
|
-
children: /* @__PURE__ */
|
|
1531
|
+
children: /* @__PURE__ */ jsxs24(Fragment6, { children: [
|
|
1385
1532
|
action.icon,
|
|
1386
1533
|
action.label
|
|
1387
1534
|
] })
|
|
1388
1535
|
})
|
|
1389
1536
|
},
|
|
1390
1537
|
action.label
|
|
1391
|
-
) : /* @__PURE__ */
|
|
1538
|
+
) : /* @__PURE__ */ jsxs24(
|
|
1392
1539
|
DropdownMenu3.Item,
|
|
1393
1540
|
{
|
|
1394
1541
|
className: cls,
|
|
@@ -1406,23 +1553,23 @@ function RowActionsMenu({
|
|
|
1406
1553
|
) })
|
|
1407
1554
|
] });
|
|
1408
1555
|
}
|
|
1409
|
-
return /* @__PURE__ */
|
|
1410
|
-
/* @__PURE__ */
|
|
1411
|
-
/* @__PURE__ */
|
|
1412
|
-
/* @__PURE__ */
|
|
1413
|
-
/* @__PURE__ */
|
|
1414
|
-
/* @__PURE__ */
|
|
1415
|
-
/* @__PURE__ */
|
|
1556
|
+
return /* @__PURE__ */ jsxs24(DrawerPrimitive4.Root, { open, onOpenChange: setOpen, children: [
|
|
1557
|
+
/* @__PURE__ */ jsx28(DrawerPrimitive4.Trigger, { asChild: true, children: trigger }),
|
|
1558
|
+
/* @__PURE__ */ jsxs24(DrawerPrimitive4.Portal, { children: [
|
|
1559
|
+
/* @__PURE__ */ jsx28(DrawerPrimitive4.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
|
|
1560
|
+
/* @__PURE__ */ jsxs24(DrawerPrimitive4.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: [
|
|
1561
|
+
/* @__PURE__ */ jsx28(DrawerPrimitive4.Title, { className: "sr-only", children: label }),
|
|
1562
|
+
/* @__PURE__ */ jsx28("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
|
|
1416
1563
|
actions.map((action) => {
|
|
1417
1564
|
const cls = cn(
|
|
1418
1565
|
sheetItemClass2,
|
|
1419
1566
|
action.destructive && "text-destructive"
|
|
1420
1567
|
);
|
|
1421
|
-
const inner = /* @__PURE__ */
|
|
1568
|
+
const inner = /* @__PURE__ */ jsxs24(Fragment6, { children: [
|
|
1422
1569
|
action.icon,
|
|
1423
1570
|
action.label
|
|
1424
1571
|
] });
|
|
1425
|
-
return action.href ? /* @__PURE__ */
|
|
1572
|
+
return action.href ? /* @__PURE__ */ jsx28(
|
|
1426
1573
|
"span",
|
|
1427
1574
|
{
|
|
1428
1575
|
onClick: () => setOpen(false),
|
|
@@ -1434,7 +1581,7 @@ function RowActionsMenu({
|
|
|
1434
1581
|
})
|
|
1435
1582
|
},
|
|
1436
1583
|
action.label
|
|
1437
|
-
) : /* @__PURE__ */
|
|
1584
|
+
) : /* @__PURE__ */ jsx28(
|
|
1438
1585
|
"button",
|
|
1439
1586
|
{
|
|
1440
1587
|
type: "button",
|
|
@@ -1464,9 +1611,9 @@ function extractApiError(err, fallbackMessage = "Ocorreu um erro inesperado.") {
|
|
|
1464
1611
|
}
|
|
1465
1612
|
|
|
1466
1613
|
// src/hooks/use-disclosure.ts
|
|
1467
|
-
import { useCallback, useState as
|
|
1614
|
+
import { useCallback, useState as useState11 } from "react";
|
|
1468
1615
|
function useDisclosure(initial = false) {
|
|
1469
|
-
const [open, setOpen] =
|
|
1616
|
+
const [open, setOpen] = useState11(initial);
|
|
1470
1617
|
const onOpen = useCallback(() => setOpen(true), []);
|
|
1471
1618
|
const onClose = useCallback(() => setOpen(false), []);
|
|
1472
1619
|
const onToggle = useCallback(() => setOpen((v) => !v), []);
|
|
@@ -1511,6 +1658,7 @@ export {
|
|
|
1511
1658
|
FormField,
|
|
1512
1659
|
MobileCardList,
|
|
1513
1660
|
ModeToggle,
|
|
1661
|
+
MultiCombobox,
|
|
1514
1662
|
PageHeader,
|
|
1515
1663
|
Pagination,
|
|
1516
1664
|
PasswordInput,
|