@facter/ds-core 1.7.5 → 1.8.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.d.mts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +359 -362
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +336 -339
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var React10 = require('react');
|
|
5
5
|
var classVarianceAuthority = require('class-variance-authority');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
7
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -44,7 +44,7 @@ function _interopNamespace(e) {
|
|
|
44
44
|
return Object.freeze(n);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
var
|
|
47
|
+
var React10__namespace = /*#__PURE__*/_interopNamespace(React10);
|
|
48
48
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
49
49
|
var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
|
|
50
50
|
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
@@ -88,7 +88,7 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
);
|
|
91
|
-
var Button =
|
|
91
|
+
var Button = React10__namespace.forwardRef(
|
|
92
92
|
({ className, variant, size, ...props }, ref) => {
|
|
93
93
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
94
94
|
"button",
|
|
@@ -181,7 +181,7 @@ var inputVariants = classVarianceAuthority.cva(
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
);
|
|
184
|
-
var Input =
|
|
184
|
+
var Input = React10__namespace.forwardRef(
|
|
185
185
|
({
|
|
186
186
|
className,
|
|
187
187
|
variant,
|
|
@@ -195,13 +195,13 @@ var Input = React49__namespace.forwardRef(
|
|
|
195
195
|
labelClassName,
|
|
196
196
|
...props
|
|
197
197
|
}, ref) => {
|
|
198
|
-
const inputRef =
|
|
199
|
-
const [showPassword, setShowPassword] =
|
|
200
|
-
|
|
201
|
-
const focusInput =
|
|
198
|
+
const inputRef = React10__namespace.useRef(null);
|
|
199
|
+
const [showPassword, setShowPassword] = React10__namespace.useState(false);
|
|
200
|
+
React10__namespace.useImperativeHandle(ref, () => inputRef.current, []);
|
|
201
|
+
const focusInput = React10__namespace.useCallback(() => {
|
|
202
202
|
inputRef.current?.focus();
|
|
203
203
|
}, []);
|
|
204
|
-
const togglePasswordVisibility =
|
|
204
|
+
const togglePasswordVisibility = React10__namespace.useCallback(() => {
|
|
205
205
|
setShowPassword((prev) => !prev);
|
|
206
206
|
}, []);
|
|
207
207
|
const inputType = type === "password" ? showPassword ? "text" : "password" : type;
|
|
@@ -222,6 +222,7 @@ var Input = React49__namespace.forwardRef(
|
|
|
222
222
|
variant: error ? "error" : variant,
|
|
223
223
|
inputSize
|
|
224
224
|
}),
|
|
225
|
+
!label && "h-9 pt-0 pb-0 py-2",
|
|
225
226
|
Icon2 && "pl-10",
|
|
226
227
|
type === "password" && "pr-11",
|
|
227
228
|
className
|
|
@@ -368,8 +369,8 @@ function Sparkline({
|
|
|
368
369
|
className,
|
|
369
370
|
show = true
|
|
370
371
|
}) {
|
|
371
|
-
const gradientId =
|
|
372
|
-
const { linePath, areaPath } =
|
|
372
|
+
const gradientId = React10__namespace.useId();
|
|
373
|
+
const { linePath, areaPath } = React10__namespace.useMemo(() => {
|
|
373
374
|
if (data.length < 2) {
|
|
374
375
|
return { linePath: "", areaPath: "" };
|
|
375
376
|
}
|
|
@@ -587,7 +588,7 @@ var selectVariants = classVarianceAuthority.cva(
|
|
|
587
588
|
}
|
|
588
589
|
}
|
|
589
590
|
);
|
|
590
|
-
var Select =
|
|
591
|
+
var Select = React10__namespace.forwardRef(
|
|
591
592
|
({
|
|
592
593
|
className,
|
|
593
594
|
variant,
|
|
@@ -614,6 +615,7 @@ var Select = React49__namespace.forwardRef(
|
|
|
614
615
|
variant: error ? "error" : variant,
|
|
615
616
|
selectSize
|
|
616
617
|
}),
|
|
618
|
+
!label && "h-9 pt-0 pb-0 py-2",
|
|
617
619
|
Icon2 && "pl-10",
|
|
618
620
|
"flex items-center justify-between",
|
|
619
621
|
className
|
|
@@ -656,7 +658,7 @@ var Select = React49__namespace.forwardRef(
|
|
|
656
658
|
}
|
|
657
659
|
);
|
|
658
660
|
Select.displayName = "Select";
|
|
659
|
-
var SelectItem =
|
|
661
|
+
var SelectItem = React10__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
660
662
|
SelectPrimitive__namespace.Item,
|
|
661
663
|
{
|
|
662
664
|
ref,
|
|
@@ -675,7 +677,7 @@ var SelectItem = React49__namespace.forwardRef(({ className, children, ...props
|
|
|
675
677
|
));
|
|
676
678
|
SelectItem.displayName = "SelectItem";
|
|
677
679
|
var SelectGroup = SelectPrimitive__namespace.Group;
|
|
678
|
-
var SelectLabel =
|
|
680
|
+
var SelectLabel = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
679
681
|
SelectPrimitive__namespace.Label,
|
|
680
682
|
{
|
|
681
683
|
ref,
|
|
@@ -684,7 +686,7 @@ var SelectLabel = React49__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
684
686
|
}
|
|
685
687
|
));
|
|
686
688
|
SelectLabel.displayName = "SelectLabel";
|
|
687
|
-
var SelectSeparator =
|
|
689
|
+
var SelectSeparator = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
688
690
|
SelectPrimitive__namespace.Separator,
|
|
689
691
|
{
|
|
690
692
|
ref,
|
|
@@ -694,7 +696,7 @@ var SelectSeparator = React49__namespace.forwardRef(({ className, ...props }, re
|
|
|
694
696
|
));
|
|
695
697
|
SelectSeparator.displayName = "SelectSeparator";
|
|
696
698
|
var Tabs = TabsPrimitive__namespace.Root;
|
|
697
|
-
var TabsList =
|
|
699
|
+
var TabsList = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
698
700
|
TabsPrimitive__namespace.List,
|
|
699
701
|
{
|
|
700
702
|
ref,
|
|
@@ -706,7 +708,7 @@ var TabsList = React49__namespace.forwardRef(({ className, ...props }, ref) => /
|
|
|
706
708
|
}
|
|
707
709
|
));
|
|
708
710
|
TabsList.displayName = TabsPrimitive__namespace.List.displayName;
|
|
709
|
-
var TabsTrigger =
|
|
711
|
+
var TabsTrigger = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
710
712
|
TabsPrimitive__namespace.Trigger,
|
|
711
713
|
{
|
|
712
714
|
ref,
|
|
@@ -718,7 +720,7 @@ var TabsTrigger = React49__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
718
720
|
}
|
|
719
721
|
));
|
|
720
722
|
TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
|
|
721
|
-
var TabsContent =
|
|
723
|
+
var TabsContent = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
722
724
|
TabsPrimitive__namespace.Content,
|
|
723
725
|
{
|
|
724
726
|
ref,
|
|
@@ -827,7 +829,7 @@ function BarsLoader() {
|
|
|
827
829
|
i
|
|
828
830
|
)) });
|
|
829
831
|
}
|
|
830
|
-
var Loader =
|
|
832
|
+
var Loader = React10__namespace.forwardRef(
|
|
831
833
|
({
|
|
832
834
|
variant = "default",
|
|
833
835
|
message,
|
|
@@ -877,21 +879,21 @@ var Loader = React49__namespace.forwardRef(
|
|
|
877
879
|
}
|
|
878
880
|
);
|
|
879
881
|
Loader.displayName = "Loader";
|
|
880
|
-
var LoaderContext =
|
|
882
|
+
var LoaderContext = React10__namespace.createContext(
|
|
881
883
|
void 0
|
|
882
884
|
);
|
|
883
885
|
function LoaderProvider({ children }) {
|
|
884
|
-
const [isLoading, setIsLoading] =
|
|
885
|
-
const [loaderOptions, setLoaderOptions] =
|
|
886
|
-
const show =
|
|
886
|
+
const [isLoading, setIsLoading] = React10__namespace.useState(false);
|
|
887
|
+
const [loaderOptions, setLoaderOptions] = React10__namespace.useState({});
|
|
888
|
+
const show = React10__namespace.useCallback((options = {}) => {
|
|
887
889
|
setLoaderOptions(options);
|
|
888
890
|
setIsLoading(true);
|
|
889
891
|
}, []);
|
|
890
|
-
const hide =
|
|
892
|
+
const hide = React10__namespace.useCallback(() => {
|
|
891
893
|
setIsLoading(false);
|
|
892
894
|
setTimeout(() => setLoaderOptions({}), 300);
|
|
893
895
|
}, []);
|
|
894
|
-
const value =
|
|
896
|
+
const value = React10__namespace.useMemo(
|
|
895
897
|
() => ({ show, hide, isLoading }),
|
|
896
898
|
[show, hide, isLoading]
|
|
897
899
|
);
|
|
@@ -910,7 +912,7 @@ function LoaderProvider({ children }) {
|
|
|
910
912
|
] });
|
|
911
913
|
}
|
|
912
914
|
function useLoader() {
|
|
913
|
-
const context =
|
|
915
|
+
const context = React10__namespace.useContext(LoaderContext);
|
|
914
916
|
if (context === void 0) {
|
|
915
917
|
throw new Error("useLoader must be used within a LoaderProvider");
|
|
916
918
|
}
|
|
@@ -942,7 +944,7 @@ var loader = {
|
|
|
942
944
|
};
|
|
943
945
|
function GlobalLoaderController() {
|
|
944
946
|
const loaderController = useLoader();
|
|
945
|
-
|
|
947
|
+
React10__namespace.useEffect(() => {
|
|
946
948
|
setGlobalLoader(loaderController);
|
|
947
949
|
return () => {
|
|
948
950
|
setGlobalLoader(null);
|
|
@@ -1028,7 +1030,7 @@ var iconAnimation = {
|
|
|
1028
1030
|
whileHover: { scale: 1.1 },
|
|
1029
1031
|
whileTap: { scale: 0.9 }
|
|
1030
1032
|
};
|
|
1031
|
-
var EmptyStateContent =
|
|
1033
|
+
var EmptyStateContent = React10__namespace.memo(
|
|
1032
1034
|
({
|
|
1033
1035
|
message = "Nenhum item encontrado",
|
|
1034
1036
|
description,
|
|
@@ -1040,7 +1042,7 @@ var EmptyStateContent = React49__namespace.memo(
|
|
|
1040
1042
|
layout = "vertical",
|
|
1041
1043
|
className
|
|
1042
1044
|
}) => {
|
|
1043
|
-
const handleAction =
|
|
1045
|
+
const handleAction = React10__namespace.useCallback(() => {
|
|
1044
1046
|
if (onAction) {
|
|
1045
1047
|
onAction();
|
|
1046
1048
|
}
|
|
@@ -1070,7 +1072,7 @@ var EmptyStateContent = React49__namespace.memo(
|
|
|
1070
1072
|
}
|
|
1071
1073
|
);
|
|
1072
1074
|
EmptyStateContent.displayName = "EmptyStateContent";
|
|
1073
|
-
var AnimatedEmptyState =
|
|
1075
|
+
var AnimatedEmptyState = React10__namespace.memo((props) => {
|
|
1074
1076
|
const {
|
|
1075
1077
|
message = "Nenhum item encontrado",
|
|
1076
1078
|
description,
|
|
@@ -1082,7 +1084,7 @@ var AnimatedEmptyState = React49__namespace.memo((props) => {
|
|
|
1082
1084
|
layout = "vertical",
|
|
1083
1085
|
className
|
|
1084
1086
|
} = props;
|
|
1085
|
-
const handleAction =
|
|
1087
|
+
const handleAction = React10__namespace.useCallback(() => {
|
|
1086
1088
|
if (onAction) {
|
|
1087
1089
|
onAction();
|
|
1088
1090
|
}
|
|
@@ -1125,7 +1127,7 @@ var AnimatedEmptyState = React49__namespace.memo((props) => {
|
|
|
1125
1127
|
);
|
|
1126
1128
|
});
|
|
1127
1129
|
AnimatedEmptyState.displayName = "AnimatedEmptyState";
|
|
1128
|
-
var EmptyState =
|
|
1130
|
+
var EmptyState = React10__namespace.memo(
|
|
1129
1131
|
({ animated = true, ...props }) => {
|
|
1130
1132
|
if (!animated) {
|
|
1131
1133
|
return /* @__PURE__ */ jsxRuntime.jsx(EmptyStateContent, { ...props });
|
|
@@ -1141,13 +1143,13 @@ function useDataTableInternal({
|
|
|
1141
1143
|
manualPagination = false,
|
|
1142
1144
|
pageCount: externalPageCount
|
|
1143
1145
|
}) {
|
|
1144
|
-
const [rowSelection, setRowSelection] =
|
|
1145
|
-
const [columnVisibility, setColumnVisibility] =
|
|
1146
|
-
const [columnFilters, setColumnFilters] =
|
|
1147
|
-
const [sorting, setSorting] =
|
|
1148
|
-
const [globalFilter, setGlobalFilter] =
|
|
1149
|
-
const [density, setDensity] =
|
|
1150
|
-
const [pagination, setPagination] =
|
|
1146
|
+
const [rowSelection, setRowSelection] = React10__namespace.useState({});
|
|
1147
|
+
const [columnVisibility, setColumnVisibility] = React10__namespace.useState({});
|
|
1148
|
+
const [columnFilters, setColumnFilters] = React10__namespace.useState([]);
|
|
1149
|
+
const [sorting, setSorting] = React10__namespace.useState([]);
|
|
1150
|
+
const [globalFilter, setGlobalFilter] = React10__namespace.useState("");
|
|
1151
|
+
const [density, setDensity] = React10__namespace.useState("default");
|
|
1152
|
+
const [pagination, setPagination] = React10__namespace.useState({
|
|
1151
1153
|
pageIndex: 0,
|
|
1152
1154
|
pageSize: 10
|
|
1153
1155
|
});
|
|
@@ -1185,7 +1187,7 @@ function useDataTableInternal({
|
|
|
1185
1187
|
getPaginationRowModel: reactTable.getPaginationRowModel(),
|
|
1186
1188
|
getSortedRowModel: reactTable.getSortedRowModel()
|
|
1187
1189
|
});
|
|
1188
|
-
const meta =
|
|
1190
|
+
const meta = React10__namespace.useMemo(
|
|
1189
1191
|
() => ({
|
|
1190
1192
|
isLoading: false,
|
|
1191
1193
|
// Loading é controlado externamente via DataTable.Loading
|
|
@@ -1205,13 +1207,14 @@ function useDataTableInternal({
|
|
|
1205
1207
|
pageSize: pagination.pageSize
|
|
1206
1208
|
};
|
|
1207
1209
|
}
|
|
1208
|
-
var
|
|
1210
|
+
var DataTableEmptyStateConfigContext = React10__namespace.createContext(null);
|
|
1211
|
+
var DataTableInstanceContext = React10__namespace.createContext(null);
|
|
1209
1212
|
DataTableInstanceContext.displayName = "DataTableInstanceContext";
|
|
1210
|
-
var DataTableMetaContext =
|
|
1213
|
+
var DataTableMetaContext = React10__namespace.createContext(null);
|
|
1211
1214
|
DataTableMetaContext.displayName = "DataTableMetaContext";
|
|
1212
|
-
var DataTableDensityContext =
|
|
1215
|
+
var DataTableDensityContext = React10__namespace.createContext(null);
|
|
1213
1216
|
DataTableDensityContext.displayName = "DataTableDensityContext";
|
|
1214
|
-
var DataTablePaginationContext =
|
|
1217
|
+
var DataTablePaginationContext = React10__namespace.createContext(null);
|
|
1215
1218
|
DataTablePaginationContext.displayName = "DataTablePaginationContext";
|
|
1216
1219
|
function DataTableProvider({
|
|
1217
1220
|
children,
|
|
@@ -1222,26 +1225,28 @@ function DataTableProvider({
|
|
|
1222
1225
|
pageIndex,
|
|
1223
1226
|
pageSize
|
|
1224
1227
|
}) {
|
|
1225
|
-
const
|
|
1228
|
+
const [emptyStateConfig, setEmptyStateConfig] = React10__namespace.useState({});
|
|
1229
|
+
const emptyStateValue = React10__namespace.useMemo(
|
|
1230
|
+
() => ({ config: emptyStateConfig, setConfig: setEmptyStateConfig }),
|
|
1231
|
+
[emptyStateConfig]
|
|
1232
|
+
);
|
|
1233
|
+
const metaValue = React10__namespace.useMemo(
|
|
1226
1234
|
() => meta,
|
|
1227
1235
|
[meta.isLoading, meta.isEmpty, meta.selectedRowCount, meta.totalRows, meta.density]
|
|
1228
1236
|
);
|
|
1229
|
-
const densityValue =
|
|
1237
|
+
const densityValue = React10__namespace.useMemo(
|
|
1230
1238
|
() => ({ density, setDensity }),
|
|
1231
1239
|
[density, setDensity]
|
|
1232
1240
|
);
|
|
1233
|
-
const paginationValue =
|
|
1234
|
-
() => {
|
|
1235
|
-
console.log("[DataTableProvider] creating paginationValue", { pageIndex, pageSize });
|
|
1236
|
-
return { pageIndex, pageSize };
|
|
1237
|
-
},
|
|
1241
|
+
const paginationValue = React10__namespace.useMemo(
|
|
1242
|
+
() => ({ pageIndex, pageSize }),
|
|
1238
1243
|
[pageIndex, pageSize]
|
|
1239
1244
|
);
|
|
1240
1245
|
const tableValue = table;
|
|
1241
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DataTableInstanceContext.Provider, { value: tableValue, children: /* @__PURE__ */ jsxRuntime.jsx(DataTableMetaContext.Provider, { value: metaValue, children: /* @__PURE__ */ jsxRuntime.jsx(DataTableDensityContext.Provider, { value: densityValue, children: /* @__PURE__ */ jsxRuntime.jsx(DataTablePaginationContext.Provider, { value: paginationValue, children }) }) }) });
|
|
1246
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DataTableEmptyStateConfigContext.Provider, { value: emptyStateValue, children: /* @__PURE__ */ jsxRuntime.jsx(DataTableInstanceContext.Provider, { value: tableValue, children: /* @__PURE__ */ jsxRuntime.jsx(DataTableMetaContext.Provider, { value: metaValue, children: /* @__PURE__ */ jsxRuntime.jsx(DataTableDensityContext.Provider, { value: densityValue, children: /* @__PURE__ */ jsxRuntime.jsx(DataTablePaginationContext.Provider, { value: paginationValue, children }) }) }) }) });
|
|
1242
1247
|
}
|
|
1243
1248
|
function useDataTable() {
|
|
1244
|
-
const context =
|
|
1249
|
+
const context = React10__namespace.useContext(DataTableInstanceContext);
|
|
1245
1250
|
if (!context) {
|
|
1246
1251
|
throw new Error(
|
|
1247
1252
|
"useDataTable must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -1250,7 +1255,7 @@ function useDataTable() {
|
|
|
1250
1255
|
return context;
|
|
1251
1256
|
}
|
|
1252
1257
|
function useDataTableMeta() {
|
|
1253
|
-
const context =
|
|
1258
|
+
const context = React10__namespace.useContext(DataTableMetaContext);
|
|
1254
1259
|
if (!context) {
|
|
1255
1260
|
throw new Error(
|
|
1256
1261
|
"useDataTableMeta must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -1268,12 +1273,12 @@ function useDataTableEmpty() {
|
|
|
1268
1273
|
}
|
|
1269
1274
|
function useDataTableSelection() {
|
|
1270
1275
|
const table = useDataTable();
|
|
1271
|
-
return
|
|
1276
|
+
return React10__namespace.useMemo(() => {
|
|
1272
1277
|
return table.getSelectedRowModel().rows.map((row) => row.original);
|
|
1273
1278
|
}, [table.getSelectedRowModel().rows]);
|
|
1274
1279
|
}
|
|
1275
1280
|
function useDataTableDensity() {
|
|
1276
|
-
const context =
|
|
1281
|
+
const context = React10__namespace.useContext(DataTableDensityContext);
|
|
1277
1282
|
if (!context) {
|
|
1278
1283
|
throw new Error(
|
|
1279
1284
|
"useDataTableDensity must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -1282,7 +1287,7 @@ function useDataTableDensity() {
|
|
|
1282
1287
|
return context;
|
|
1283
1288
|
}
|
|
1284
1289
|
function useDataTablePaginationContext() {
|
|
1285
|
-
const context =
|
|
1290
|
+
const context = React10__namespace.useContext(DataTablePaginationContext);
|
|
1286
1291
|
if (!context) {
|
|
1287
1292
|
throw new Error(
|
|
1288
1293
|
"useDataTablePagination must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -1293,7 +1298,7 @@ function useDataTablePaginationContext() {
|
|
|
1293
1298
|
function useDataTablePagination() {
|
|
1294
1299
|
const table = useDataTable();
|
|
1295
1300
|
const { pageIndex, pageSize } = useDataTablePaginationContext();
|
|
1296
|
-
return
|
|
1301
|
+
return React10__namespace.useMemo(() => {
|
|
1297
1302
|
const pageCount = table.getPageCount();
|
|
1298
1303
|
return {
|
|
1299
1304
|
pageIndex,
|
|
@@ -1313,7 +1318,7 @@ function useDataTablePagination() {
|
|
|
1313
1318
|
function useDataTableSorting() {
|
|
1314
1319
|
const table = useDataTable();
|
|
1315
1320
|
const sorting = table.getState().sorting;
|
|
1316
|
-
return
|
|
1321
|
+
return React10__namespace.useMemo(() => ({
|
|
1317
1322
|
sorting,
|
|
1318
1323
|
setSorting: table.setSorting,
|
|
1319
1324
|
clearSorting: () => table.resetSorting(),
|
|
@@ -1326,7 +1331,7 @@ function useDataTableSorting() {
|
|
|
1326
1331
|
function useDataTableColumnVisibility() {
|
|
1327
1332
|
const table = useDataTable();
|
|
1328
1333
|
const columnVisibility = table.getState().columnVisibility;
|
|
1329
|
-
return
|
|
1334
|
+
return React10__namespace.useMemo(() => ({
|
|
1330
1335
|
columnVisibility,
|
|
1331
1336
|
setColumnVisibility: table.setColumnVisibility,
|
|
1332
1337
|
toggleColumn: (columnId) => {
|
|
@@ -1336,6 +1341,15 @@ function useDataTableColumnVisibility() {
|
|
|
1336
1341
|
getAllColumns: () => table.getAllColumns().filter((col) => col.getCanHide())
|
|
1337
1342
|
}), [table, columnVisibility]);
|
|
1338
1343
|
}
|
|
1344
|
+
function useDataTableEmptyStateConfig() {
|
|
1345
|
+
const context = React10__namespace.useContext(DataTableEmptyStateConfigContext);
|
|
1346
|
+
if (!context) {
|
|
1347
|
+
throw new Error(
|
|
1348
|
+
"useDataTableEmptyStateConfig must be used within <DataTable>."
|
|
1349
|
+
);
|
|
1350
|
+
}
|
|
1351
|
+
return context;
|
|
1352
|
+
}
|
|
1339
1353
|
var useDataTableInstance = useDataTable;
|
|
1340
1354
|
var useDataTableState = useDataTableMeta;
|
|
1341
1355
|
function DataTableRoot({
|
|
@@ -1394,7 +1408,7 @@ var DENSITY_CONFIG = {
|
|
|
1394
1408
|
padding: "py-3 px-4"
|
|
1395
1409
|
}
|
|
1396
1410
|
};
|
|
1397
|
-
var Table =
|
|
1411
|
+
var Table = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1398
1412
|
"table",
|
|
1399
1413
|
{
|
|
1400
1414
|
ref,
|
|
@@ -1403,9 +1417,9 @@ var Table = React49__namespace.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
1403
1417
|
}
|
|
1404
1418
|
) }));
|
|
1405
1419
|
Table.displayName = "Table";
|
|
1406
|
-
var TableHeader =
|
|
1420
|
+
var TableHeader = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
1407
1421
|
TableHeader.displayName = "TableHeader";
|
|
1408
|
-
var TableBody =
|
|
1422
|
+
var TableBody = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1409
1423
|
"tbody",
|
|
1410
1424
|
{
|
|
1411
1425
|
ref,
|
|
@@ -1414,7 +1428,7 @@ var TableBody = React49__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
1414
1428
|
}
|
|
1415
1429
|
));
|
|
1416
1430
|
TableBody.displayName = "TableBody";
|
|
1417
|
-
var TableFooter =
|
|
1431
|
+
var TableFooter = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1418
1432
|
"tfoot",
|
|
1419
1433
|
{
|
|
1420
1434
|
ref,
|
|
@@ -1426,8 +1440,8 @@ var TableFooter = React49__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
1426
1440
|
}
|
|
1427
1441
|
));
|
|
1428
1442
|
TableFooter.displayName = "TableFooter";
|
|
1429
|
-
var TableRow =
|
|
1430
|
-
|
|
1443
|
+
var TableRow = React10__namespace.memo(
|
|
1444
|
+
React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1431
1445
|
"tr",
|
|
1432
1446
|
{
|
|
1433
1447
|
ref,
|
|
@@ -1440,7 +1454,7 @@ var TableRow = React49__namespace.memo(
|
|
|
1440
1454
|
))
|
|
1441
1455
|
);
|
|
1442
1456
|
TableRow.displayName = "TableRow";
|
|
1443
|
-
var TableHead =
|
|
1457
|
+
var TableHead = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1444
1458
|
"th",
|
|
1445
1459
|
{
|
|
1446
1460
|
ref,
|
|
@@ -1452,8 +1466,8 @@ var TableHead = React49__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
1452
1466
|
}
|
|
1453
1467
|
));
|
|
1454
1468
|
TableHead.displayName = "TableHead";
|
|
1455
|
-
var TableCell =
|
|
1456
|
-
|
|
1469
|
+
var TableCell = React10__namespace.memo(
|
|
1470
|
+
React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1457
1471
|
"td",
|
|
1458
1472
|
{
|
|
1459
1473
|
ref,
|
|
@@ -1463,7 +1477,7 @@ var TableCell = React49__namespace.memo(
|
|
|
1463
1477
|
))
|
|
1464
1478
|
);
|
|
1465
1479
|
TableCell.displayName = "TableCell";
|
|
1466
|
-
var TableCaption =
|
|
1480
|
+
var TableCaption = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1467
1481
|
"caption",
|
|
1468
1482
|
{
|
|
1469
1483
|
ref,
|
|
@@ -1472,17 +1486,31 @@ var TableCaption = React49__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
1472
1486
|
}
|
|
1473
1487
|
));
|
|
1474
1488
|
TableCaption.displayName = "TableCaption";
|
|
1475
|
-
var DataTableContent =
|
|
1489
|
+
var DataTableContent = React10__namespace.memo(function DataTableContent2({
|
|
1476
1490
|
stickyHeader = false,
|
|
1477
1491
|
stripedRows = false,
|
|
1478
1492
|
highlightOnHover = true,
|
|
1493
|
+
onRowClick,
|
|
1479
1494
|
className
|
|
1480
1495
|
}) {
|
|
1481
1496
|
const table = useDataTable();
|
|
1482
1497
|
const { isEmpty } = useDataTableMeta();
|
|
1483
1498
|
const { density } = useDataTableDensity();
|
|
1499
|
+
const { config: emptyStateConfig } = useDataTableEmptyStateConfig();
|
|
1484
1500
|
const densityStyles = DENSITY_CONFIG[density];
|
|
1485
1501
|
const cellClasses = cn(densityStyles.padding, densityStyles.fontSize);
|
|
1502
|
+
const hasRows = table.getRowModel().rows?.length > 0;
|
|
1503
|
+
if (!hasRows && isEmpty) {
|
|
1504
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1505
|
+
EmptyState,
|
|
1506
|
+
{
|
|
1507
|
+
message: emptyStateConfig.title,
|
|
1508
|
+
description: emptyStateConfig.description,
|
|
1509
|
+
icon: emptyStateConfig.icon,
|
|
1510
|
+
animated: false
|
|
1511
|
+
}
|
|
1512
|
+
);
|
|
1513
|
+
}
|
|
1486
1514
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("rounded-md border overflow-auto", className), children: /* @__PURE__ */ jsxRuntime.jsxs(Table, { children: [
|
|
1487
1515
|
/* @__PURE__ */ jsxRuntime.jsx(TableHeader, { className: cn(stickyHeader && "sticky top-0 z-10 bg-background"), children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1488
1516
|
TableHead,
|
|
@@ -1496,37 +1524,32 @@ var DataTableContent = React49__namespace.memo(function DataTableContent2({
|
|
|
1496
1524
|
},
|
|
1497
1525
|
header.id
|
|
1498
1526
|
)) }, headerGroup.id)) }),
|
|
1499
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: table.getRowModel().rows
|
|
1527
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: table.getRowModel().rows.map((row, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1500
1528
|
TableRow,
|
|
1501
1529
|
{
|
|
1502
1530
|
"data-state": row.getIsSelected() && "selected",
|
|
1503
1531
|
className: cn(
|
|
1504
1532
|
highlightOnHover && "hover:bg-muted/50",
|
|
1505
|
-
stripedRows && index % 2 === 1 && "bg-muted/30"
|
|
1533
|
+
stripedRows && index % 2 === 1 && "bg-muted/30",
|
|
1534
|
+
onRowClick && "cursor-pointer"
|
|
1506
1535
|
),
|
|
1536
|
+
onClick: onRowClick ? () => onRowClick(row) : void 0,
|
|
1507
1537
|
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: cellClasses, children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
|
|
1508
1538
|
},
|
|
1509
1539
|
row.id
|
|
1510
|
-
))
|
|
1511
|
-
TableCell,
|
|
1512
|
-
{
|
|
1513
|
-
colSpan: table.getAllColumns().length,
|
|
1514
|
-
className: "h-24 text-center text-muted-foreground",
|
|
1515
|
-
children: isEmpty ? "Nenhum resultado encontrado." : "Carregando..."
|
|
1516
|
-
}
|
|
1517
|
-
) }) })
|
|
1540
|
+
)) })
|
|
1518
1541
|
] }) });
|
|
1519
1542
|
});
|
|
1520
1543
|
DataTableContent.displayName = "DataTable.Content";
|
|
1521
|
-
var DataTableToolbar =
|
|
1544
|
+
var DataTableToolbar = React10__namespace.memo(function DataTableToolbar2({
|
|
1522
1545
|
className,
|
|
1523
1546
|
children
|
|
1524
1547
|
}) {
|
|
1525
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex items-center justify-between gap-2", className), children });
|
|
1548
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex items-center justify-between gap-2 bg-accent/50 p-4 rounded-t-lg", className), children });
|
|
1526
1549
|
});
|
|
1527
1550
|
function useDebounce(value, delay = 300) {
|
|
1528
|
-
const [debouncedValue, setDebouncedValue] =
|
|
1529
|
-
|
|
1551
|
+
const [debouncedValue, setDebouncedValue] = React10__namespace.useState(value);
|
|
1552
|
+
React10__namespace.useEffect(() => {
|
|
1530
1553
|
const handler = setTimeout(() => {
|
|
1531
1554
|
setDebouncedValue(value);
|
|
1532
1555
|
}, delay);
|
|
@@ -1537,12 +1560,12 @@ function useDebounce(value, delay = 300) {
|
|
|
1537
1560
|
return debouncedValue;
|
|
1538
1561
|
}
|
|
1539
1562
|
function useDebouncedCallback(callback, delay = 300) {
|
|
1540
|
-
const callbackRef =
|
|
1541
|
-
const timeoutRef =
|
|
1542
|
-
|
|
1563
|
+
const callbackRef = React10__namespace.useRef(callback);
|
|
1564
|
+
const timeoutRef = React10__namespace.useRef(null);
|
|
1565
|
+
React10__namespace.useEffect(() => {
|
|
1543
1566
|
callbackRef.current = callback;
|
|
1544
1567
|
}, [callback]);
|
|
1545
|
-
return
|
|
1568
|
+
return React10__namespace.useCallback(
|
|
1546
1569
|
(...args) => {
|
|
1547
1570
|
if (timeoutRef.current) {
|
|
1548
1571
|
clearTimeout(timeoutRef.current);
|
|
@@ -1554,7 +1577,7 @@ function useDebouncedCallback(callback, delay = 300) {
|
|
|
1554
1577
|
[delay]
|
|
1555
1578
|
);
|
|
1556
1579
|
}
|
|
1557
|
-
var DataTableSearch =
|
|
1580
|
+
var DataTableSearch = React10__namespace.memo(function DataTableSearch2({
|
|
1558
1581
|
column,
|
|
1559
1582
|
placeholder = "Buscar...",
|
|
1560
1583
|
debounce = 300,
|
|
@@ -1563,17 +1586,17 @@ var DataTableSearch = React49__namespace.memo(function DataTableSearch2({
|
|
|
1563
1586
|
}) {
|
|
1564
1587
|
const table = useDataTableInstance();
|
|
1565
1588
|
const columnInstance = table.getColumn(column);
|
|
1566
|
-
const [value, setValue] =
|
|
1589
|
+
const [value, setValue] = React10__namespace.useState(
|
|
1567
1590
|
columnInstance?.getFilterValue() ?? ""
|
|
1568
1591
|
);
|
|
1569
1592
|
const debouncedValue = useDebounce(value, debounce);
|
|
1570
|
-
|
|
1593
|
+
React10__namespace.useEffect(() => {
|
|
1571
1594
|
columnInstance?.setFilterValue(debouncedValue);
|
|
1572
1595
|
if (onSearch) {
|
|
1573
1596
|
onSearch(debouncedValue);
|
|
1574
1597
|
}
|
|
1575
1598
|
}, [debouncedValue, columnInstance, onSearch]);
|
|
1576
|
-
|
|
1599
|
+
React10__namespace.useEffect(() => {
|
|
1577
1600
|
const filterValue = columnInstance?.getFilterValue() ?? "";
|
|
1578
1601
|
if (filterValue !== value) {
|
|
1579
1602
|
setValue(filterValue);
|
|
@@ -1589,15 +1612,15 @@ var DataTableSearch = React49__namespace.memo(function DataTableSearch2({
|
|
|
1589
1612
|
}
|
|
1590
1613
|
);
|
|
1591
1614
|
});
|
|
1592
|
-
var DataTableFilters =
|
|
1615
|
+
var DataTableFilters = React10__namespace.memo(function DataTableFilters2({
|
|
1593
1616
|
onChange,
|
|
1594
1617
|
className,
|
|
1595
1618
|
children
|
|
1596
1619
|
}) {
|
|
1597
1620
|
const table = useDataTableInstance();
|
|
1598
1621
|
const filters = table.getState().columnFilters;
|
|
1599
|
-
const filtersRef =
|
|
1600
|
-
|
|
1622
|
+
const filtersRef = React10__namespace.useRef(filters);
|
|
1623
|
+
React10__namespace.useEffect(() => {
|
|
1601
1624
|
if (onChange && JSON.stringify(filters) !== JSON.stringify(filtersRef.current)) {
|
|
1602
1625
|
filtersRef.current = filters;
|
|
1603
1626
|
onChange(filters);
|
|
@@ -1605,7 +1628,7 @@ var DataTableFilters = React49__namespace.memo(function DataTableFilters2({
|
|
|
1605
1628
|
}, [filters, onChange]);
|
|
1606
1629
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex gap-2", className), children });
|
|
1607
1630
|
});
|
|
1608
|
-
var DataTableFilter =
|
|
1631
|
+
var DataTableFilter = React10__namespace.memo(function DataTableFilter2({
|
|
1609
1632
|
column: columnId,
|
|
1610
1633
|
title,
|
|
1611
1634
|
options,
|
|
@@ -1615,7 +1638,7 @@ var DataTableFilter = React49__namespace.memo(function DataTableFilter2({
|
|
|
1615
1638
|
const column = table.getColumn(columnId);
|
|
1616
1639
|
const filterValue = column?.getFilterValue() ?? [];
|
|
1617
1640
|
const currentValue = filterValue.length > 0 ? filterValue[0] : "all";
|
|
1618
|
-
const handleValueChange =
|
|
1641
|
+
const handleValueChange = React10__namespace.useCallback(
|
|
1619
1642
|
(value) => {
|
|
1620
1643
|
if (value === "all") {
|
|
1621
1644
|
column?.setFilterValue(void 0);
|
|
@@ -1640,7 +1663,7 @@ var DataTableFilter = React49__namespace.memo(function DataTableFilter2({
|
|
|
1640
1663
|
}
|
|
1641
1664
|
);
|
|
1642
1665
|
});
|
|
1643
|
-
var DataTablePagination =
|
|
1666
|
+
var DataTablePagination = React10__namespace.memo(function DataTablePagination2({
|
|
1644
1667
|
mode = "client",
|
|
1645
1668
|
pageCount: externalPageCount,
|
|
1646
1669
|
pageSizes = [10, 20, 30, 50],
|
|
@@ -1669,7 +1692,7 @@ var DataTablePagination = React49__namespace.memo(function DataTablePagination2(
|
|
|
1669
1692
|
const pageCount = mode === "server" && externalPageCount !== void 0 ? externalPageCount : internalPageCount;
|
|
1670
1693
|
const canGoPrevious = pageIndex > 0;
|
|
1671
1694
|
const canGoNext = pageIndex < pageCount - 1;
|
|
1672
|
-
const handlePageSizeChange =
|
|
1695
|
+
const handlePageSizeChange = React10__namespace.useCallback(
|
|
1673
1696
|
(value) => {
|
|
1674
1697
|
setPageSize(Number(value));
|
|
1675
1698
|
},
|
|
@@ -1772,47 +1795,20 @@ var DataTablePagination = React49__namespace.memo(function DataTablePagination2(
|
|
|
1772
1795
|
);
|
|
1773
1796
|
});
|
|
1774
1797
|
DataTablePagination.displayName = "DataTable.Pagination";
|
|
1775
|
-
var DataTableEmptyState =
|
|
1776
|
-
|
|
1798
|
+
var DataTableEmptyState = React10__namespace.memo(function DataTableEmptyState2({
|
|
1799
|
+
title,
|
|
1777
1800
|
description,
|
|
1778
1801
|
icon,
|
|
1779
|
-
action
|
|
1780
|
-
className
|
|
1802
|
+
action
|
|
1781
1803
|
}) {
|
|
1782
|
-
const
|
|
1783
|
-
|
|
1784
|
-
{
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
stroke: "currentColor",
|
|
1789
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1790
|
-
"path",
|
|
1791
|
-
{
|
|
1792
|
-
strokeLinecap: "round",
|
|
1793
|
-
strokeLinejoin: "round",
|
|
1794
|
-
strokeWidth: 1.5,
|
|
1795
|
-
d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
|
|
1796
|
-
}
|
|
1797
|
-
)
|
|
1798
|
-
}
|
|
1799
|
-
);
|
|
1800
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1801
|
-
"div",
|
|
1802
|
-
{
|
|
1803
|
-
className: cn(
|
|
1804
|
-
"flex min-h-[400px] flex-col items-center justify-center rounded-md border border-dashed p-8 text-center",
|
|
1805
|
-
className
|
|
1806
|
-
),
|
|
1807
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto flex max-w-[420px] flex-col items-center justify-center text-center", children: [
|
|
1808
|
-
icon ?? defaultIcon,
|
|
1809
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mt-4 text-lg font-semibold", children: message }),
|
|
1810
|
-
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-4 mt-2 text-sm text-muted-foreground", children: description }),
|
|
1811
|
-
action && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4", children: action })
|
|
1812
|
-
] })
|
|
1813
|
-
}
|
|
1814
|
-
);
|
|
1804
|
+
const { setConfig } = useDataTableEmptyStateConfig();
|
|
1805
|
+
React10__namespace.useLayoutEffect(() => {
|
|
1806
|
+
setConfig({ title, description, icon, action });
|
|
1807
|
+
return () => setConfig({});
|
|
1808
|
+
}, [title, description, icon, action, setConfig]);
|
|
1809
|
+
return null;
|
|
1815
1810
|
});
|
|
1811
|
+
DataTableEmptyState.displayName = "DataTable.EmptyState";
|
|
1816
1812
|
function SkeletonRow({ columns }) {
|
|
1817
1813
|
return /* @__PURE__ */ jsxRuntime.jsx(TableRow, { className: "animate-pulse", children: Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "py-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 bg-muted rounded w-3/4" }) }, index)) });
|
|
1818
1814
|
}
|
|
@@ -1876,6 +1872,7 @@ var checkboxVariants = classVarianceAuthority.cva(
|
|
|
1876
1872
|
variants: {
|
|
1877
1873
|
variant: {
|
|
1878
1874
|
default: "border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
1875
|
+
muted: "border-muted-foreground/40 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
1879
1876
|
secondary: "border-secondary data-[state=checked]:bg-secondary data-[state=checked]:text-secondary-foreground",
|
|
1880
1877
|
outline: "border-border data-[state=checked]:bg-background data-[state=checked]:text-primary data-[state=checked]:border-primary"
|
|
1881
1878
|
},
|
|
@@ -1896,8 +1893,8 @@ var iconSizeMap = {
|
|
|
1896
1893
|
md: "h-4 w-4",
|
|
1897
1894
|
lg: "h-5 w-5"
|
|
1898
1895
|
};
|
|
1899
|
-
var Checkbox =
|
|
1900
|
-
|
|
1896
|
+
var Checkbox = React10__namespace.memo(
|
|
1897
|
+
React10__namespace.forwardRef(({ className, variant, size = "md", ...props }, ref) => {
|
|
1901
1898
|
const iconSize = iconSizeMap[size || "md"];
|
|
1902
1899
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1903
1900
|
CheckboxPrimitive__namespace.Root,
|
|
@@ -1921,9 +1918,9 @@ function DataTableColumnVisibility({
|
|
|
1921
1918
|
className
|
|
1922
1919
|
}) {
|
|
1923
1920
|
const table = useDataTable();
|
|
1924
|
-
const [open, setOpen] =
|
|
1925
|
-
const dropdownRef =
|
|
1926
|
-
|
|
1921
|
+
const [open, setOpen] = React10__namespace.useState(false);
|
|
1922
|
+
const dropdownRef = React10__namespace.useRef(null);
|
|
1923
|
+
React10__namespace.useEffect(() => {
|
|
1927
1924
|
function handleClickOutside(event) {
|
|
1928
1925
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1929
1926
|
setOpen(false);
|
|
@@ -2002,9 +1999,9 @@ function DataTableDensityToggle({
|
|
|
2002
1999
|
className
|
|
2003
2000
|
}) {
|
|
2004
2001
|
const { density, setDensity } = useDataTableDensity();
|
|
2005
|
-
const [open, setOpen] =
|
|
2006
|
-
const dropdownRef =
|
|
2007
|
-
|
|
2002
|
+
const [open, setOpen] = React10__namespace.useState(false);
|
|
2003
|
+
const dropdownRef = React10__namespace.useRef(null);
|
|
2004
|
+
React10__namespace.useEffect(() => {
|
|
2008
2005
|
function handleClickOutside(event) {
|
|
2009
2006
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
2010
2007
|
setOpen(false);
|
|
@@ -2183,9 +2180,9 @@ function DataTableExport({
|
|
|
2183
2180
|
className
|
|
2184
2181
|
}) {
|
|
2185
2182
|
const table = useDataTable();
|
|
2186
|
-
const [open, setOpen] =
|
|
2187
|
-
const dropdownRef =
|
|
2188
|
-
|
|
2183
|
+
const [open, setOpen] = React10__namespace.useState(false);
|
|
2184
|
+
const dropdownRef = React10__namespace.useRef(null);
|
|
2185
|
+
React10__namespace.useEffect(() => {
|
|
2189
2186
|
function handleClickOutside(event) {
|
|
2190
2187
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
2191
2188
|
setOpen(false);
|
|
@@ -2196,7 +2193,7 @@ function DataTableExport({
|
|
|
2196
2193
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
2197
2194
|
}
|
|
2198
2195
|
}, [open]);
|
|
2199
|
-
const handleExport =
|
|
2196
|
+
const handleExport = React10__namespace.useCallback((format) => {
|
|
2200
2197
|
const visibleColumns = table.getVisibleLeafColumns();
|
|
2201
2198
|
const rows = table.getFilteredRowModel().rows;
|
|
2202
2199
|
const headers = [];
|
|
@@ -2299,7 +2296,7 @@ function DataTableTabs({
|
|
|
2299
2296
|
onValueChange,
|
|
2300
2297
|
className
|
|
2301
2298
|
}) {
|
|
2302
|
-
const [internalValue, setInternalValue] =
|
|
2299
|
+
const [internalValue, setInternalValue] = React10__namespace.useState(defaultValue ?? tabs[0]?.value);
|
|
2303
2300
|
const activeValue = value ?? internalValue;
|
|
2304
2301
|
const handleTabClick = (tabValue) => {
|
|
2305
2302
|
if (value === void 0) {
|
|
@@ -2310,7 +2307,7 @@ function DataTableTabs({
|
|
|
2310
2307
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2311
2308
|
"div",
|
|
2312
2309
|
{
|
|
2313
|
-
className: cn("flex items-center gap-1
|
|
2310
|
+
className: cn("flex items-center gap-1", className),
|
|
2314
2311
|
role: "tablist",
|
|
2315
2312
|
"aria-label": "Filtros",
|
|
2316
2313
|
children: tabs.map((tab) => {
|
|
@@ -2386,8 +2383,8 @@ var Dialog = DialogPrimitive__namespace.Root;
|
|
|
2386
2383
|
var DialogTrigger = DialogPrimitive__namespace.Trigger;
|
|
2387
2384
|
var DialogPortal = DialogPrimitive__namespace.Portal;
|
|
2388
2385
|
var DialogClose = DialogPrimitive__namespace.Close;
|
|
2389
|
-
var DialogOverlay =
|
|
2390
|
-
|
|
2386
|
+
var DialogOverlay = React10__namespace.memo(
|
|
2387
|
+
React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2391
2388
|
DialogPrimitive__namespace.Overlay,
|
|
2392
2389
|
{
|
|
2393
2390
|
ref,
|
|
@@ -2434,8 +2431,8 @@ var dialogContentVariants = classVarianceAuthority.cva(
|
|
|
2434
2431
|
}
|
|
2435
2432
|
}
|
|
2436
2433
|
);
|
|
2437
|
-
var DialogContent =
|
|
2438
|
-
|
|
2434
|
+
var DialogContent = React10__namespace.memo(
|
|
2435
|
+
React10__namespace.forwardRef(({ className, children, showCloseButton = true, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
|
|
2439
2436
|
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
|
|
2440
2437
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2441
2438
|
DialogPrimitive__namespace.Content,
|
|
@@ -2455,7 +2452,7 @@ var DialogContent = React49__namespace.memo(
|
|
|
2455
2452
|
] }))
|
|
2456
2453
|
);
|
|
2457
2454
|
DialogContent.displayName = DialogPrimitive__namespace.Content.displayName;
|
|
2458
|
-
var DialogHeader =
|
|
2455
|
+
var DialogHeader = React10__namespace.memo(
|
|
2459
2456
|
({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2460
2457
|
"div",
|
|
2461
2458
|
{
|
|
@@ -2468,7 +2465,7 @@ var DialogHeader = React49__namespace.memo(
|
|
|
2468
2465
|
)
|
|
2469
2466
|
);
|
|
2470
2467
|
DialogHeader.displayName = "DialogHeader";
|
|
2471
|
-
var DialogFooter =
|
|
2468
|
+
var DialogFooter = React10__namespace.memo(
|
|
2472
2469
|
({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2473
2470
|
"div",
|
|
2474
2471
|
{
|
|
@@ -2481,8 +2478,8 @@ var DialogFooter = React49__namespace.memo(
|
|
|
2481
2478
|
)
|
|
2482
2479
|
);
|
|
2483
2480
|
DialogFooter.displayName = "DialogFooter";
|
|
2484
|
-
var DialogTitle =
|
|
2485
|
-
|
|
2481
|
+
var DialogTitle = React10__namespace.memo(
|
|
2482
|
+
React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2486
2483
|
DialogPrimitive__namespace.Title,
|
|
2487
2484
|
{
|
|
2488
2485
|
ref,
|
|
@@ -2495,8 +2492,8 @@ var DialogTitle = React49__namespace.memo(
|
|
|
2495
2492
|
))
|
|
2496
2493
|
);
|
|
2497
2494
|
DialogTitle.displayName = DialogPrimitive__namespace.Title.displayName;
|
|
2498
|
-
var DialogDescription =
|
|
2499
|
-
|
|
2495
|
+
var DialogDescription = React10__namespace.memo(
|
|
2496
|
+
React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2500
2497
|
DialogPrimitive__namespace.Description,
|
|
2501
2498
|
{
|
|
2502
2499
|
ref,
|
|
@@ -2506,7 +2503,7 @@ var DialogDescription = React49__namespace.memo(
|
|
|
2506
2503
|
))
|
|
2507
2504
|
);
|
|
2508
2505
|
DialogDescription.displayName = DialogPrimitive__namespace.Description.displayName;
|
|
2509
|
-
var DialogBody =
|
|
2506
|
+
var DialogBody = React10__namespace.memo(
|
|
2510
2507
|
({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1 overflow-y-auto py-2", className), ...props })
|
|
2511
2508
|
);
|
|
2512
2509
|
DialogBody.displayName = "DialogBody";
|
|
@@ -2537,7 +2534,7 @@ var COLOR_MAP = {
|
|
|
2537
2534
|
accent: "border-accent",
|
|
2538
2535
|
muted: "border-muted"
|
|
2539
2536
|
};
|
|
2540
|
-
var RippleRing =
|
|
2537
|
+
var RippleRing = React10__namespace.memo(({ size, color, opacity }) => {
|
|
2541
2538
|
const borderColorClass = COLOR_MAP[color] || COLOR_MAP.primary;
|
|
2542
2539
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2543
2540
|
"div",
|
|
@@ -2556,7 +2553,7 @@ var RippleRing = React49__namespace.memo(({ size, color, opacity }) => {
|
|
|
2556
2553
|
);
|
|
2557
2554
|
});
|
|
2558
2555
|
RippleRing.displayName = "RippleRing";
|
|
2559
|
-
var RippleEffect =
|
|
2556
|
+
var RippleEffect = React10__namespace.memo(
|
|
2560
2557
|
({
|
|
2561
2558
|
size = "md",
|
|
2562
2559
|
color = "primary",
|
|
@@ -2568,7 +2565,7 @@ var RippleEffect = React49__namespace.memo(
|
|
|
2568
2565
|
const { base, increment } = SIZE_CONFIG[size];
|
|
2569
2566
|
const opacities = INTENSITY_CONFIG[intensity];
|
|
2570
2567
|
const positionClasses = POSITION_CONFIG[position];
|
|
2571
|
-
const rippleRings =
|
|
2568
|
+
const rippleRings = React10__namespace.useMemo(
|
|
2572
2569
|
() => Array.from({ length: rings }).map((_, index) => {
|
|
2573
2570
|
const ringSize = base + increment * (rings - index - 1);
|
|
2574
2571
|
const opacity = opacities[index] || opacities[opacities.length - 1];
|
|
@@ -2598,7 +2595,7 @@ var RippleEffect = React49__namespace.memo(
|
|
|
2598
2595
|
}
|
|
2599
2596
|
);
|
|
2600
2597
|
RippleEffect.displayName = "RippleEffect";
|
|
2601
|
-
var RippleWrapper =
|
|
2598
|
+
var RippleWrapper = React10__namespace.memo(
|
|
2602
2599
|
({ children, rippleProps, className }) => {
|
|
2603
2600
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", className), children: [
|
|
2604
2601
|
rippleProps && /* @__PURE__ */ jsxRuntime.jsx(RippleEffect, { ...rippleProps }),
|
|
@@ -2607,7 +2604,7 @@ var RippleWrapper = React49__namespace.memo(
|
|
|
2607
2604
|
}
|
|
2608
2605
|
);
|
|
2609
2606
|
RippleWrapper.displayName = "RippleWrapper";
|
|
2610
|
-
var RippleBackground =
|
|
2607
|
+
var RippleBackground = React10__namespace.memo(
|
|
2611
2608
|
({ containerClassName, ...rippleProps }) => {
|
|
2612
2609
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2613
2610
|
"div",
|
|
@@ -2673,7 +2670,7 @@ var statusIndicatorVariants = classVarianceAuthority.cva(
|
|
|
2673
2670
|
}
|
|
2674
2671
|
}
|
|
2675
2672
|
);
|
|
2676
|
-
var DialogWrapper =
|
|
2673
|
+
var DialogWrapper = React10__namespace.memo(
|
|
2677
2674
|
({
|
|
2678
2675
|
children,
|
|
2679
2676
|
className,
|
|
@@ -2686,7 +2683,7 @@ var DialogWrapper = React49__namespace.memo(
|
|
|
2686
2683
|
rippleProps,
|
|
2687
2684
|
...props
|
|
2688
2685
|
}) => {
|
|
2689
|
-
const defaultRippleProps =
|
|
2686
|
+
const defaultRippleProps = React10__namespace.useMemo(
|
|
2690
2687
|
() => ({
|
|
2691
2688
|
size: size === "sm" ? "md" : size === "lg" ? "xl" : "lg",
|
|
2692
2689
|
color: variant === "secondary" ? "secondary" : variant === "accent" ? "accent" : "primary",
|
|
@@ -2696,7 +2693,7 @@ var DialogWrapper = React49__namespace.memo(
|
|
|
2696
2693
|
}),
|
|
2697
2694
|
[size, variant, rippleProps]
|
|
2698
2695
|
);
|
|
2699
|
-
const backgroundRippleProps =
|
|
2696
|
+
const backgroundRippleProps = React10__namespace.useMemo(
|
|
2700
2697
|
() => ({
|
|
2701
2698
|
position: "top-right",
|
|
2702
2699
|
size: "xl",
|
|
@@ -2799,7 +2796,7 @@ var Toaster = ({ ...props }) => {
|
|
|
2799
2796
|
}
|
|
2800
2797
|
);
|
|
2801
2798
|
};
|
|
2802
|
-
var CustomToast =
|
|
2799
|
+
var CustomToast = React10__namespace.memo(
|
|
2803
2800
|
({ title, description, variant = "default", action, onClose }) => {
|
|
2804
2801
|
const variantStyles = toastVariants[variant];
|
|
2805
2802
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2935,8 +2932,8 @@ var thumbVariants = classVarianceAuthority.cva(
|
|
|
2935
2932
|
}
|
|
2936
2933
|
}
|
|
2937
2934
|
);
|
|
2938
|
-
var Switch =
|
|
2939
|
-
|
|
2935
|
+
var Switch = React10__namespace.memo(
|
|
2936
|
+
React10__namespace.forwardRef(({ className, variant, size = "md", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2940
2937
|
SwitchPrimitives__namespace.Root,
|
|
2941
2938
|
{
|
|
2942
2939
|
className: cn(switchVariants({ variant, size, className })),
|
|
@@ -2967,8 +2964,8 @@ var textareaVariants = classVarianceAuthority.cva(
|
|
|
2967
2964
|
}
|
|
2968
2965
|
}
|
|
2969
2966
|
);
|
|
2970
|
-
var Textarea =
|
|
2971
|
-
|
|
2967
|
+
var Textarea = React10__namespace.memo(
|
|
2968
|
+
React10__namespace.forwardRef(
|
|
2972
2969
|
({
|
|
2973
2970
|
className,
|
|
2974
2971
|
variant,
|
|
@@ -2983,12 +2980,12 @@ var Textarea = React49__namespace.memo(
|
|
|
2983
2980
|
onChange,
|
|
2984
2981
|
...props
|
|
2985
2982
|
}, ref) => {
|
|
2986
|
-
const textareaRef =
|
|
2987
|
-
|
|
2988
|
-
const focusTextarea =
|
|
2983
|
+
const textareaRef = React10__namespace.useRef(null);
|
|
2984
|
+
React10__namespace.useImperativeHandle(ref, () => textareaRef.current, []);
|
|
2985
|
+
const focusTextarea = React10__namespace.useCallback(() => {
|
|
2989
2986
|
textareaRef.current?.focus();
|
|
2990
2987
|
}, []);
|
|
2991
|
-
const handleChange =
|
|
2988
|
+
const handleChange = React10__namespace.useCallback(
|
|
2992
2989
|
(e) => {
|
|
2993
2990
|
if (autoResize && textareaRef.current) {
|
|
2994
2991
|
textareaRef.current.style.height = "auto";
|
|
@@ -2998,7 +2995,7 @@ var Textarea = React49__namespace.memo(
|
|
|
2998
2995
|
},
|
|
2999
2996
|
[autoResize, onChange]
|
|
3000
2997
|
);
|
|
3001
|
-
|
|
2998
|
+
React10__namespace.useEffect(() => {
|
|
3002
2999
|
if (autoResize && textareaRef.current) {
|
|
3003
3000
|
textareaRef.current.style.height = "auto";
|
|
3004
3001
|
textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;
|
|
@@ -3049,23 +3046,23 @@ var Textarea = React49__namespace.memo(
|
|
|
3049
3046
|
)
|
|
3050
3047
|
);
|
|
3051
3048
|
Textarea.displayName = "Textarea";
|
|
3052
|
-
var FormFieldContext =
|
|
3049
|
+
var FormFieldContext = React10__namespace.createContext(null);
|
|
3053
3050
|
function useFormFieldContext() {
|
|
3054
|
-
const context =
|
|
3051
|
+
const context = React10__namespace.useContext(FormFieldContext);
|
|
3055
3052
|
if (!context) {
|
|
3056
3053
|
throw new Error("useFormFieldContext must be used within a Form.Field");
|
|
3057
3054
|
}
|
|
3058
3055
|
return context;
|
|
3059
3056
|
}
|
|
3060
3057
|
function useFormFieldContextOptional() {
|
|
3061
|
-
return
|
|
3058
|
+
return React10__namespace.useContext(FormFieldContext);
|
|
3062
3059
|
}
|
|
3063
3060
|
function FormFieldProvider({ name, children }) {
|
|
3064
3061
|
const form = reactHookForm.useFormContext();
|
|
3065
|
-
const id =
|
|
3062
|
+
const id = React10__namespace.useId();
|
|
3066
3063
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3067
3064
|
const error = fieldState.error?.message;
|
|
3068
|
-
const value =
|
|
3065
|
+
const value = React10__namespace.useMemo(
|
|
3069
3066
|
() => ({
|
|
3070
3067
|
name,
|
|
3071
3068
|
id,
|
|
@@ -3173,7 +3170,7 @@ function FormInput({
|
|
|
3173
3170
|
const form = reactHookForm.useFormContext();
|
|
3174
3171
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3175
3172
|
const error = fieldState.error?.message;
|
|
3176
|
-
const getInputType =
|
|
3173
|
+
const getInputType = React10__namespace.useCallback(() => {
|
|
3177
3174
|
if (["money", "percent", "phone", "cpf", "cnpj", "cep"].includes(mask || "")) {
|
|
3178
3175
|
return "tel";
|
|
3179
3176
|
}
|
|
@@ -3369,7 +3366,7 @@ function FormCheckbox({
|
|
|
3369
3366
|
const form = reactHookForm.useFormContext();
|
|
3370
3367
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3371
3368
|
const error = fieldState.error?.message;
|
|
3372
|
-
const id =
|
|
3369
|
+
const id = React10__namespace.useId();
|
|
3373
3370
|
return /* @__PURE__ */ jsxRuntime.jsx(FormFieldProvider, { name, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3374
3371
|
reactHookForm.Controller,
|
|
3375
3372
|
{
|
|
@@ -3424,7 +3421,7 @@ function FormSwitch({
|
|
|
3424
3421
|
const form = reactHookForm.useFormContext();
|
|
3425
3422
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3426
3423
|
const error = fieldState.error?.message;
|
|
3427
|
-
const id =
|
|
3424
|
+
const id = React10__namespace.useId();
|
|
3428
3425
|
return /* @__PURE__ */ jsxRuntime.jsx(FormFieldProvider, { name, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3429
3426
|
reactHookForm.Controller,
|
|
3430
3427
|
{
|
|
@@ -3591,7 +3588,7 @@ function FormRadioGroup({
|
|
|
3591
3588
|
) });
|
|
3592
3589
|
}
|
|
3593
3590
|
FormRadioGroup.displayName = "Form.RadioGroup";
|
|
3594
|
-
var FormLabel =
|
|
3591
|
+
var FormLabel = React10__namespace.forwardRef(
|
|
3595
3592
|
({ className, required, children, ...props }, ref) => {
|
|
3596
3593
|
const fieldContext = useFormFieldContextOptional();
|
|
3597
3594
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3614,7 +3611,7 @@ var FormLabel = React49__namespace.forwardRef(
|
|
|
3614
3611
|
}
|
|
3615
3612
|
);
|
|
3616
3613
|
FormLabel.displayName = "Form.Label";
|
|
3617
|
-
var FormDescription =
|
|
3614
|
+
var FormDescription = React10__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
3618
3615
|
const fieldContext = useFormFieldContextOptional();
|
|
3619
3616
|
if (fieldContext?.error) {
|
|
3620
3617
|
return null;
|
|
@@ -3629,7 +3626,7 @@ var FormDescription = React49__namespace.forwardRef(({ className, ...props }, re
|
|
|
3629
3626
|
);
|
|
3630
3627
|
});
|
|
3631
3628
|
FormDescription.displayName = "Form.Description";
|
|
3632
|
-
var FormError =
|
|
3629
|
+
var FormError = React10__namespace.forwardRef(
|
|
3633
3630
|
({ className, message, children, ...props }, ref) => {
|
|
3634
3631
|
const fieldContext = useFormFieldContextOptional();
|
|
3635
3632
|
const errorMessage = message ?? fieldContext?.error;
|
|
@@ -3648,7 +3645,7 @@ var FormError = React49__namespace.forwardRef(
|
|
|
3648
3645
|
}
|
|
3649
3646
|
);
|
|
3650
3647
|
FormError.displayName = "Form.Error";
|
|
3651
|
-
var FormFieldWrapper =
|
|
3648
|
+
var FormFieldWrapper = React10__namespace.forwardRef(({ className, label, description, required, error, children, ...props }, ref) => {
|
|
3652
3649
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("space-y-1", className), ...props, children: [
|
|
3653
3650
|
label && /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { required, children: label }),
|
|
3654
3651
|
children,
|
|
@@ -3691,7 +3688,7 @@ var Form = Object.assign(FormRoot, {
|
|
|
3691
3688
|
FieldWrapper: FormFieldWrapper,
|
|
3692
3689
|
Field: FormFieldProvider
|
|
3693
3690
|
});
|
|
3694
|
-
var Avatar =
|
|
3691
|
+
var Avatar = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3695
3692
|
AvatarPrimitive__namespace.Root,
|
|
3696
3693
|
{
|
|
3697
3694
|
ref,
|
|
@@ -3703,7 +3700,7 @@ var Avatar = React49__namespace.forwardRef(({ className, ...props }, ref) => /*
|
|
|
3703
3700
|
}
|
|
3704
3701
|
));
|
|
3705
3702
|
Avatar.displayName = AvatarPrimitive__namespace.Root.displayName;
|
|
3706
|
-
var AvatarImage =
|
|
3703
|
+
var AvatarImage = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3707
3704
|
AvatarPrimitive__namespace.Image,
|
|
3708
3705
|
{
|
|
3709
3706
|
ref,
|
|
@@ -3712,7 +3709,7 @@ var AvatarImage = React49__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
3712
3709
|
}
|
|
3713
3710
|
));
|
|
3714
3711
|
AvatarImage.displayName = AvatarPrimitive__namespace.Image.displayName;
|
|
3715
|
-
var AvatarFallback =
|
|
3712
|
+
var AvatarFallback = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3716
3713
|
AvatarPrimitive__namespace.Fallback,
|
|
3717
3714
|
{
|
|
3718
3715
|
ref,
|
|
@@ -3730,7 +3727,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
|
|
|
3730
3727
|
var DropdownMenuPortal = DropdownMenuPrimitive__namespace.Portal;
|
|
3731
3728
|
var DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
|
|
3732
3729
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
|
|
3733
|
-
var DropdownMenuSubTrigger =
|
|
3730
|
+
var DropdownMenuSubTrigger = React10__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3734
3731
|
DropdownMenuPrimitive__namespace.SubTrigger,
|
|
3735
3732
|
{
|
|
3736
3733
|
ref,
|
|
@@ -3747,7 +3744,7 @@ var DropdownMenuSubTrigger = React49__namespace.forwardRef(({ className, inset,
|
|
|
3747
3744
|
}
|
|
3748
3745
|
));
|
|
3749
3746
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive__namespace.SubTrigger.displayName;
|
|
3750
|
-
var DropdownMenuSubContent =
|
|
3747
|
+
var DropdownMenuSubContent = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3751
3748
|
DropdownMenuPrimitive__namespace.SubContent,
|
|
3752
3749
|
{
|
|
3753
3750
|
ref,
|
|
@@ -3759,7 +3756,7 @@ var DropdownMenuSubContent = React49__namespace.forwardRef(({ className, ...prop
|
|
|
3759
3756
|
}
|
|
3760
3757
|
));
|
|
3761
3758
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive__namespace.SubContent.displayName;
|
|
3762
|
-
var DropdownMenuContent =
|
|
3759
|
+
var DropdownMenuContent = React10__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3763
3760
|
DropdownMenuPrimitive__namespace.Content,
|
|
3764
3761
|
{
|
|
3765
3762
|
ref,
|
|
@@ -3772,7 +3769,7 @@ var DropdownMenuContent = React49__namespace.forwardRef(({ className, sideOffset
|
|
|
3772
3769
|
}
|
|
3773
3770
|
) }));
|
|
3774
3771
|
DropdownMenuContent.displayName = DropdownMenuPrimitive__namespace.Content.displayName;
|
|
3775
|
-
var DropdownMenuItem =
|
|
3772
|
+
var DropdownMenuItem = React10__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3776
3773
|
DropdownMenuPrimitive__namespace.Item,
|
|
3777
3774
|
{
|
|
3778
3775
|
ref,
|
|
@@ -3785,7 +3782,7 @@ var DropdownMenuItem = React49__namespace.forwardRef(({ className, inset, ...pro
|
|
|
3785
3782
|
}
|
|
3786
3783
|
));
|
|
3787
3784
|
DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;
|
|
3788
|
-
var DropdownMenuCheckboxItem =
|
|
3785
|
+
var DropdownMenuCheckboxItem = React10__namespace.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3789
3786
|
DropdownMenuPrimitive__namespace.CheckboxItem,
|
|
3790
3787
|
{
|
|
3791
3788
|
ref,
|
|
@@ -3802,7 +3799,7 @@ var DropdownMenuCheckboxItem = React49__namespace.forwardRef(({ className, child
|
|
|
3802
3799
|
}
|
|
3803
3800
|
));
|
|
3804
3801
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive__namespace.CheckboxItem.displayName;
|
|
3805
|
-
var DropdownMenuRadioItem =
|
|
3802
|
+
var DropdownMenuRadioItem = React10__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3806
3803
|
DropdownMenuPrimitive__namespace.RadioItem,
|
|
3807
3804
|
{
|
|
3808
3805
|
ref,
|
|
@@ -3818,7 +3815,7 @@ var DropdownMenuRadioItem = React49__namespace.forwardRef(({ className, children
|
|
|
3818
3815
|
}
|
|
3819
3816
|
));
|
|
3820
3817
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive__namespace.RadioItem.displayName;
|
|
3821
|
-
var DropdownMenuLabel =
|
|
3818
|
+
var DropdownMenuLabel = React10__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3822
3819
|
DropdownMenuPrimitive__namespace.Label,
|
|
3823
3820
|
{
|
|
3824
3821
|
ref,
|
|
@@ -3831,7 +3828,7 @@ var DropdownMenuLabel = React49__namespace.forwardRef(({ className, inset, ...pr
|
|
|
3831
3828
|
}
|
|
3832
3829
|
));
|
|
3833
3830
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive__namespace.Label.displayName;
|
|
3834
|
-
var DropdownMenuSeparator =
|
|
3831
|
+
var DropdownMenuSeparator = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3835
3832
|
DropdownMenuPrimitive__namespace.Separator,
|
|
3836
3833
|
{
|
|
3837
3834
|
ref,
|
|
@@ -3855,7 +3852,7 @@ var DropdownMenuShortcut = ({
|
|
|
3855
3852
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
3856
3853
|
var Popover = PopoverPrimitive__namespace.Root;
|
|
3857
3854
|
var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
3858
|
-
var PopoverContent =
|
|
3855
|
+
var PopoverContent = React10__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3859
3856
|
PopoverPrimitive__namespace.Content,
|
|
3860
3857
|
{
|
|
3861
3858
|
ref,
|
|
@@ -3873,7 +3870,7 @@ var TooltipProvider = TooltipPrimitive__namespace.Provider;
|
|
|
3873
3870
|
var TooltipRoot = TooltipPrimitive__namespace.Root;
|
|
3874
3871
|
var TooltipTrigger = TooltipPrimitive__namespace.Trigger;
|
|
3875
3872
|
var TooltipPortal = TooltipPrimitive__namespace.Portal;
|
|
3876
|
-
var TooltipArrow =
|
|
3873
|
+
var TooltipArrow = React10__namespace.forwardRef(({ className, variant = "light", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3877
3874
|
TooltipPrimitive__namespace.Arrow,
|
|
3878
3875
|
{
|
|
3879
3876
|
ref,
|
|
@@ -3906,7 +3903,7 @@ var tooltipContentVariants = classVarianceAuthority.cva(
|
|
|
3906
3903
|
}
|
|
3907
3904
|
}
|
|
3908
3905
|
);
|
|
3909
|
-
var TooltipContent =
|
|
3906
|
+
var TooltipContent = React10__namespace.forwardRef(
|
|
3910
3907
|
({
|
|
3911
3908
|
className,
|
|
3912
3909
|
variant = "light",
|
|
@@ -3940,11 +3937,11 @@ var TooltipContent = React49__namespace.forwardRef(
|
|
|
3940
3937
|
) })
|
|
3941
3938
|
);
|
|
3942
3939
|
TooltipContent.displayName = TooltipPrimitive__namespace.Content.displayName;
|
|
3943
|
-
var TooltipHeader =
|
|
3940
|
+
var TooltipHeader = React10__namespace.forwardRef(
|
|
3944
3941
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex flex-col gap-1", className), ...props })
|
|
3945
3942
|
);
|
|
3946
3943
|
TooltipHeader.displayName = "TooltipHeader";
|
|
3947
|
-
var TooltipTitle =
|
|
3944
|
+
var TooltipTitle = React10__namespace.forwardRef(
|
|
3948
3945
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3949
3946
|
"h4",
|
|
3950
3947
|
{
|
|
@@ -3955,7 +3952,7 @@ var TooltipTitle = React49__namespace.forwardRef(
|
|
|
3955
3952
|
)
|
|
3956
3953
|
);
|
|
3957
3954
|
TooltipTitle.displayName = "TooltipTitle";
|
|
3958
|
-
var TooltipDescription =
|
|
3955
|
+
var TooltipDescription = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3959
3956
|
"p",
|
|
3960
3957
|
{
|
|
3961
3958
|
ref,
|
|
@@ -3964,7 +3961,7 @@ var TooltipDescription = React49__namespace.forwardRef(({ className, ...props },
|
|
|
3964
3961
|
}
|
|
3965
3962
|
));
|
|
3966
3963
|
TooltipDescription.displayName = "TooltipDescription";
|
|
3967
|
-
var TooltipActions =
|
|
3964
|
+
var TooltipActions = React10__namespace.forwardRef(
|
|
3968
3965
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3969
3966
|
"div",
|
|
3970
3967
|
{
|
|
@@ -3990,7 +3987,7 @@ var tooltipActionVariants = classVarianceAuthority.cva(
|
|
|
3990
3987
|
}
|
|
3991
3988
|
}
|
|
3992
3989
|
);
|
|
3993
|
-
var TooltipAction =
|
|
3990
|
+
var TooltipAction = React10__namespace.forwardRef(
|
|
3994
3991
|
({ className, variant = "primary", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3995
3992
|
"button",
|
|
3996
3993
|
{
|
|
@@ -4001,7 +3998,7 @@ var TooltipAction = React49__namespace.forwardRef(
|
|
|
4001
3998
|
)
|
|
4002
3999
|
);
|
|
4003
4000
|
TooltipAction.displayName = "TooltipAction";
|
|
4004
|
-
var TooltipIcon =
|
|
4001
|
+
var TooltipIcon = React10__namespace.forwardRef(
|
|
4005
4002
|
({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4006
4003
|
"div",
|
|
4007
4004
|
{
|
|
@@ -4054,14 +4051,14 @@ var Tooltip = Object.assign(TooltipRoot, {
|
|
|
4054
4051
|
Icon: TooltipIcon,
|
|
4055
4052
|
Simple: SimpleTooltip
|
|
4056
4053
|
});
|
|
4057
|
-
var AuthLayoutContext =
|
|
4054
|
+
var AuthLayoutContext = React10__namespace.createContext({
|
|
4058
4055
|
imagePosition: "left"
|
|
4059
4056
|
});
|
|
4060
4057
|
function AuthLayoutRoot({ children, className }) {
|
|
4061
|
-
const [imagePosition, setImagePosition] =
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
if (
|
|
4058
|
+
const [imagePosition, setImagePosition] = React10__namespace.useState("left");
|
|
4059
|
+
React10__namespace.useEffect(() => {
|
|
4060
|
+
React10__namespace.Children.forEach(children, (child) => {
|
|
4061
|
+
if (React10__namespace.isValidElement(child) && child.type === AuthLayoutImage) {
|
|
4065
4062
|
setImagePosition(child.props.position || "left");
|
|
4066
4063
|
}
|
|
4067
4064
|
});
|
|
@@ -4259,7 +4256,7 @@ var AuthLayout = Object.assign(AuthLayoutRoot, {
|
|
|
4259
4256
|
Link: AuthLayoutLink,
|
|
4260
4257
|
Divider: AuthLayoutDivider
|
|
4261
4258
|
});
|
|
4262
|
-
var TabsContext =
|
|
4259
|
+
var TabsContext = React10__namespace.createContext(null);
|
|
4263
4260
|
function SelectionLayoutRoot({ children, className }) {
|
|
4264
4261
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("min-h-screen bg-muted/30 flex flex-col lg:flex-row", className), children });
|
|
4265
4262
|
}
|
|
@@ -4370,7 +4367,7 @@ function SelectionLayoutTab({
|
|
|
4370
4367
|
badge,
|
|
4371
4368
|
className
|
|
4372
4369
|
}) {
|
|
4373
|
-
const context =
|
|
4370
|
+
const context = React10__namespace.useContext(TabsContext);
|
|
4374
4371
|
if (!context) {
|
|
4375
4372
|
throw new Error("SelectionLayout.Tab must be used within SelectionLayout.Tabs");
|
|
4376
4373
|
}
|
|
@@ -4515,17 +4512,17 @@ var SelectionLayout = Object.assign(SelectionLayoutRoot, {
|
|
|
4515
4512
|
Card: SelectionLayoutCard,
|
|
4516
4513
|
Empty: SelectionLayoutEmpty
|
|
4517
4514
|
});
|
|
4518
|
-
var DashboardLayoutContext =
|
|
4515
|
+
var DashboardLayoutContext = React10__namespace.createContext(null);
|
|
4519
4516
|
function useDashboardLayout() {
|
|
4520
|
-
const context =
|
|
4517
|
+
const context = React10__namespace.useContext(DashboardLayoutContext);
|
|
4521
4518
|
if (!context) {
|
|
4522
4519
|
throw new Error("useDashboardLayout must be used within DashboardLayout");
|
|
4523
4520
|
}
|
|
4524
4521
|
return context;
|
|
4525
4522
|
}
|
|
4526
4523
|
function useMediaQuery(query) {
|
|
4527
|
-
const [matches, setMatches] =
|
|
4528
|
-
|
|
4524
|
+
const [matches, setMatches] = React10__namespace.useState(false);
|
|
4525
|
+
React10__namespace.useEffect(() => {
|
|
4529
4526
|
const media = window.matchMedia(query);
|
|
4530
4527
|
if (media.matches !== matches) {
|
|
4531
4528
|
setMatches(media.matches);
|
|
@@ -4542,11 +4539,11 @@ function DashboardLayoutRoot({
|
|
|
4542
4539
|
defaultExpanded = false,
|
|
4543
4540
|
defaultPinned = false
|
|
4544
4541
|
}) {
|
|
4545
|
-
const [sidebarExpanded, setSidebarExpanded] =
|
|
4546
|
-
const [sidebarPinned, setSidebarPinned] =
|
|
4547
|
-
const [mobileMenuOpen, setMobileMenuOpen] =
|
|
4542
|
+
const [sidebarExpanded, setSidebarExpanded] = React10__namespace.useState(defaultExpanded || defaultPinned);
|
|
4543
|
+
const [sidebarPinned, setSidebarPinned] = React10__namespace.useState(defaultPinned);
|
|
4544
|
+
const [mobileMenuOpen, setMobileMenuOpen] = React10__namespace.useState(false);
|
|
4548
4545
|
const isMobile = useMediaQuery("(max-width: 1024px)");
|
|
4549
|
-
|
|
4546
|
+
React10__namespace.useEffect(() => {
|
|
4550
4547
|
if (!isMobile) {
|
|
4551
4548
|
setMobileMenuOpen(false);
|
|
4552
4549
|
}
|
|
@@ -4687,7 +4684,7 @@ function DashboardLayoutSidebarNavItem({
|
|
|
4687
4684
|
};
|
|
4688
4685
|
const renderIcon4 = () => {
|
|
4689
4686
|
if (!icon) return null;
|
|
4690
|
-
if (
|
|
4687
|
+
if (React10__namespace.isValidElement(icon)) {
|
|
4691
4688
|
return icon;
|
|
4692
4689
|
}
|
|
4693
4690
|
if (typeof icon === "function" || typeof icon === "object" && "$$typeof" in icon) {
|
|
@@ -4742,7 +4739,7 @@ function DashboardLayoutSidebarNavGroup({
|
|
|
4742
4739
|
className
|
|
4743
4740
|
}) {
|
|
4744
4741
|
const { sidebarExpanded } = useDashboardLayout();
|
|
4745
|
-
const [isOpen, setIsOpen] =
|
|
4742
|
+
const [isOpen, setIsOpen] = React10__namespace.useState(defaultOpen);
|
|
4746
4743
|
const badgeColors = {
|
|
4747
4744
|
default: "bg-muted text-muted-foreground",
|
|
4748
4745
|
primary: "bg-primary/10 text-primary",
|
|
@@ -4750,7 +4747,7 @@ function DashboardLayoutSidebarNavGroup({
|
|
|
4750
4747
|
};
|
|
4751
4748
|
const renderIcon4 = () => {
|
|
4752
4749
|
if (!icon) return null;
|
|
4753
|
-
if (
|
|
4750
|
+
if (React10__namespace.isValidElement(icon)) {
|
|
4754
4751
|
return icon;
|
|
4755
4752
|
}
|
|
4756
4753
|
if (typeof icon === "function" || typeof icon === "object" && "$$typeof" in icon) {
|
|
@@ -4759,7 +4756,7 @@ function DashboardLayoutSidebarNavGroup({
|
|
|
4759
4756
|
}
|
|
4760
4757
|
return null;
|
|
4761
4758
|
};
|
|
4762
|
-
|
|
4759
|
+
React10__namespace.useEffect(() => {
|
|
4763
4760
|
if (isActive && sidebarExpanded) {
|
|
4764
4761
|
setIsOpen(true);
|
|
4765
4762
|
}
|
|
@@ -4863,7 +4860,7 @@ function DashboardLayoutHeaderUser({
|
|
|
4863
4860
|
children,
|
|
4864
4861
|
onLogout
|
|
4865
4862
|
}) {
|
|
4866
|
-
const [isOpen, setIsOpen] =
|
|
4863
|
+
const [isOpen, setIsOpen] = React10__namespace.useState(false);
|
|
4867
4864
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", className), children: [
|
|
4868
4865
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4869
4866
|
"button",
|
|
@@ -4944,7 +4941,7 @@ function DashboardLayoutBreadcrumbs({
|
|
|
4944
4941
|
return /* @__PURE__ */ jsxRuntime.jsx("nav", { className: cn("flex items-center gap-1 text-sm", className), children: items.map((item, index) => {
|
|
4945
4942
|
const Icon2 = item.icon;
|
|
4946
4943
|
const isLast = index === items.length - 1;
|
|
4947
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4944
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React10__namespace.Fragment, { children: [
|
|
4948
4945
|
item.href && !isLast ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4949
4946
|
"a",
|
|
4950
4947
|
{
|
|
@@ -5047,23 +5044,23 @@ var DashboardLayout = Object.assign(DashboardLayoutRoot, {
|
|
|
5047
5044
|
MobileNav: DashboardLayoutMobileNav,
|
|
5048
5045
|
MobileNavItem: DashboardLayoutMobileNavItem
|
|
5049
5046
|
});
|
|
5050
|
-
var SidebarContext =
|
|
5047
|
+
var SidebarContext = React10__namespace.createContext(null);
|
|
5051
5048
|
function useSidebar() {
|
|
5052
|
-
const context =
|
|
5049
|
+
const context = React10__namespace.useContext(SidebarContext);
|
|
5053
5050
|
if (!context) {
|
|
5054
5051
|
throw new Error("useSidebar must be used within a Sidebar component");
|
|
5055
5052
|
}
|
|
5056
5053
|
return context;
|
|
5057
5054
|
}
|
|
5058
5055
|
function useSidebarOptional() {
|
|
5059
|
-
return
|
|
5056
|
+
return React10__namespace.useContext(SidebarContext);
|
|
5060
5057
|
}
|
|
5061
5058
|
function SidebarProvider({ children, value }) {
|
|
5062
5059
|
return /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value, children });
|
|
5063
5060
|
}
|
|
5064
5061
|
function useMediaQuery2(query) {
|
|
5065
|
-
const [matches, setMatches] =
|
|
5066
|
-
|
|
5062
|
+
const [matches, setMatches] = React10__namespace.useState(false);
|
|
5063
|
+
React10__namespace.useEffect(() => {
|
|
5067
5064
|
if (typeof window === "undefined") return;
|
|
5068
5065
|
const mediaQuery = window.matchMedia(query);
|
|
5069
5066
|
setMatches(mediaQuery.matches);
|
|
@@ -5075,7 +5072,7 @@ function useMediaQuery2(query) {
|
|
|
5075
5072
|
}, [query]);
|
|
5076
5073
|
return matches;
|
|
5077
5074
|
}
|
|
5078
|
-
var SidebarHeader =
|
|
5075
|
+
var SidebarHeader = React10__namespace.memo(function SidebarHeader2({
|
|
5079
5076
|
logo,
|
|
5080
5077
|
collapsedLogo,
|
|
5081
5078
|
title,
|
|
@@ -5083,7 +5080,7 @@ var SidebarHeader = React49__namespace.memo(function SidebarHeader2({
|
|
|
5083
5080
|
className
|
|
5084
5081
|
}) {
|
|
5085
5082
|
const { expanded, pinned, setPinned } = useSidebar();
|
|
5086
|
-
const handleTogglePin =
|
|
5083
|
+
const handleTogglePin = React10__namespace.useCallback(() => {
|
|
5087
5084
|
setPinned(!pinned);
|
|
5088
5085
|
}, [pinned, setPinned]);
|
|
5089
5086
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5158,7 +5155,7 @@ var SidebarHeader = React49__namespace.memo(function SidebarHeader2({
|
|
|
5158
5155
|
);
|
|
5159
5156
|
});
|
|
5160
5157
|
SidebarHeader.displayName = "Sidebar.Header";
|
|
5161
|
-
var SidebarNav =
|
|
5158
|
+
var SidebarNav = React10__namespace.memo(function SidebarNav2({
|
|
5162
5159
|
children,
|
|
5163
5160
|
className
|
|
5164
5161
|
}) {
|
|
@@ -5174,7 +5171,7 @@ var SidebarNav = React49__namespace.memo(function SidebarNav2({
|
|
|
5174
5171
|
);
|
|
5175
5172
|
});
|
|
5176
5173
|
SidebarNav.displayName = "Sidebar.Nav";
|
|
5177
|
-
var SidebarSection =
|
|
5174
|
+
var SidebarSection = React10__namespace.memo(function SidebarSection2({
|
|
5178
5175
|
title,
|
|
5179
5176
|
children,
|
|
5180
5177
|
className
|
|
@@ -5198,8 +5195,8 @@ var SidebarSection = React49__namespace.memo(function SidebarSection2({
|
|
|
5198
5195
|
SidebarSection.displayName = "Sidebar.Section";
|
|
5199
5196
|
function renderIcon(icon, className) {
|
|
5200
5197
|
if (!icon) return null;
|
|
5201
|
-
if (
|
|
5202
|
-
return
|
|
5198
|
+
if (React10__namespace.isValidElement(icon)) {
|
|
5199
|
+
return React10__namespace.cloneElement(icon, { className });
|
|
5203
5200
|
}
|
|
5204
5201
|
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon) {
|
|
5205
5202
|
const IconComponent = icon;
|
|
@@ -5213,7 +5210,7 @@ var badgeVariantStyles = {
|
|
|
5213
5210
|
success: "bg-green-100 text-green-600",
|
|
5214
5211
|
warning: "bg-amber-100 text-amber-600"
|
|
5215
5212
|
};
|
|
5216
|
-
var SidebarNavItem =
|
|
5213
|
+
var SidebarNavItem = React10__namespace.memo(function SidebarNavItem2({
|
|
5217
5214
|
icon,
|
|
5218
5215
|
label,
|
|
5219
5216
|
href,
|
|
@@ -5225,7 +5222,7 @@ var SidebarNavItem = React49__namespace.memo(function SidebarNavItem2({
|
|
|
5225
5222
|
className
|
|
5226
5223
|
}) {
|
|
5227
5224
|
const { expanded } = useSidebar();
|
|
5228
|
-
const handleClick =
|
|
5225
|
+
const handleClick = React10__namespace.useCallback(() => {
|
|
5229
5226
|
if (disabled) return;
|
|
5230
5227
|
if (onClick) {
|
|
5231
5228
|
onClick();
|
|
@@ -5308,8 +5305,8 @@ var SidebarNavItem = React49__namespace.memo(function SidebarNavItem2({
|
|
|
5308
5305
|
SidebarNavItem.displayName = "Sidebar.NavItem";
|
|
5309
5306
|
function renderIcon2(icon, className) {
|
|
5310
5307
|
if (!icon) return null;
|
|
5311
|
-
if (
|
|
5312
|
-
return
|
|
5308
|
+
if (React10__namespace.isValidElement(icon)) {
|
|
5309
|
+
return React10__namespace.cloneElement(icon, { className });
|
|
5313
5310
|
}
|
|
5314
5311
|
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon) {
|
|
5315
5312
|
const IconComponent = icon;
|
|
@@ -5323,7 +5320,7 @@ var badgeVariantStyles2 = {
|
|
|
5323
5320
|
success: "bg-green-100 text-green-600",
|
|
5324
5321
|
warning: "bg-amber-100 text-amber-600"
|
|
5325
5322
|
};
|
|
5326
|
-
var SidebarNavGroup =
|
|
5323
|
+
var SidebarNavGroup = React10__namespace.memo(function SidebarNavGroup2({
|
|
5327
5324
|
icon,
|
|
5328
5325
|
label,
|
|
5329
5326
|
children,
|
|
@@ -5335,10 +5332,10 @@ var SidebarNavGroup = React49__namespace.memo(function SidebarNavGroup2({
|
|
|
5335
5332
|
className
|
|
5336
5333
|
}) {
|
|
5337
5334
|
const { expanded, activeSection, setActiveSection } = useSidebar();
|
|
5338
|
-
const [isOpen, setIsOpen] =
|
|
5335
|
+
const [isOpen, setIsOpen] = React10__namespace.useState(defaultOpen);
|
|
5339
5336
|
const groupId = id || label.toLowerCase().replace(/\s+/g, "-");
|
|
5340
5337
|
const isExpanded = expanded && (activeSection === groupId || isOpen);
|
|
5341
|
-
const handleClick =
|
|
5338
|
+
const handleClick = React10__namespace.useCallback(() => {
|
|
5342
5339
|
if (activeSection === groupId) {
|
|
5343
5340
|
setActiveSection(null);
|
|
5344
5341
|
setIsOpen(false);
|
|
@@ -5347,7 +5344,7 @@ var SidebarNavGroup = React49__namespace.memo(function SidebarNavGroup2({
|
|
|
5347
5344
|
setIsOpen(true);
|
|
5348
5345
|
}
|
|
5349
5346
|
}, [activeSection, groupId, setActiveSection]);
|
|
5350
|
-
|
|
5347
|
+
React10__namespace.useEffect(() => {
|
|
5351
5348
|
if (expanded && isActive && !isOpen) {
|
|
5352
5349
|
setIsOpen(true);
|
|
5353
5350
|
setActiveSection(groupId);
|
|
@@ -5451,18 +5448,18 @@ function isLucideIcon(icon) {
|
|
|
5451
5448
|
function getInitials(name) {
|
|
5452
5449
|
return name.split(" ").map((part) => part.charAt(0)).slice(0, 2).join("").toUpperCase();
|
|
5453
5450
|
}
|
|
5454
|
-
var SidebarFooter =
|
|
5451
|
+
var SidebarFooter = React10__namespace.memo(function SidebarFooter2({
|
|
5455
5452
|
user,
|
|
5456
5453
|
menuItems,
|
|
5457
5454
|
children,
|
|
5458
5455
|
className
|
|
5459
5456
|
}) {
|
|
5460
5457
|
const { expanded } = useSidebar();
|
|
5461
|
-
const [menuOpen, setMenuOpen] =
|
|
5462
|
-
const handleToggleMenu =
|
|
5458
|
+
const [menuOpen, setMenuOpen] = React10__namespace.useState(false);
|
|
5459
|
+
const handleToggleMenu = React10__namespace.useCallback(() => {
|
|
5463
5460
|
setMenuOpen((prev) => !prev);
|
|
5464
5461
|
}, []);
|
|
5465
|
-
|
|
5462
|
+
React10__namespace.useEffect(() => {
|
|
5466
5463
|
if (!menuOpen) return;
|
|
5467
5464
|
const handleClickOutside = (event) => {
|
|
5468
5465
|
const target = event.target;
|
|
@@ -5540,7 +5537,7 @@ var SidebarFooter = React49__namespace.memo(function SidebarFooter2({
|
|
|
5540
5537
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-1", children: menuItems.map((item, index) => {
|
|
5541
5538
|
const IconComponent = item.icon && isLucideIcon(item.icon) ? item.icon : null;
|
|
5542
5539
|
const isDestructive = item.variant === "destructive";
|
|
5543
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5540
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React10__namespace.Fragment, { children: [
|
|
5544
5541
|
isDestructive && index > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 border-t border-border" }),
|
|
5545
5542
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5546
5543
|
"button",
|
|
@@ -5577,17 +5574,17 @@ function SidebarRoot({
|
|
|
5577
5574
|
collapsedWidth = COLLAPSED_WIDTH,
|
|
5578
5575
|
expandedWidth = EXPANDED_WIDTH
|
|
5579
5576
|
}) {
|
|
5580
|
-
const [expanded, setExpanded] =
|
|
5581
|
-
const [pinned, setPinned] =
|
|
5582
|
-
const [activeSection, setActiveSection] =
|
|
5577
|
+
const [expanded, setExpanded] = React10__namespace.useState(defaultExpanded || defaultPinned);
|
|
5578
|
+
const [pinned, setPinned] = React10__namespace.useState(defaultPinned);
|
|
5579
|
+
const [activeSection, setActiveSection] = React10__namespace.useState(null);
|
|
5583
5580
|
const isMobile = useMediaQuery2("(max-width: 768px)");
|
|
5584
|
-
const handleSetPinned =
|
|
5581
|
+
const handleSetPinned = React10__namespace.useCallback((value) => {
|
|
5585
5582
|
setPinned(value);
|
|
5586
5583
|
if (value) {
|
|
5587
5584
|
setExpanded(true);
|
|
5588
5585
|
}
|
|
5589
5586
|
}, []);
|
|
5590
|
-
const contextValue =
|
|
5587
|
+
const contextValue = React10__namespace.useMemo(
|
|
5591
5588
|
() => ({
|
|
5592
5589
|
expanded,
|
|
5593
5590
|
setExpanded,
|
|
@@ -5606,13 +5603,13 @@ function SidebarRoot({
|
|
|
5606
5603
|
SidebarRoot.displayName = "SidebarRoot";
|
|
5607
5604
|
function SidebarAside({ children, className }) {
|
|
5608
5605
|
const { expanded, pinned, setExpanded, isMobile, collapsedWidth, expandedWidth } = useSidebar();
|
|
5609
|
-
const sidebarRef =
|
|
5610
|
-
const handleMouseEnter =
|
|
5606
|
+
const sidebarRef = React10__namespace.useRef(null);
|
|
5607
|
+
const handleMouseEnter = React10__namespace.useCallback(() => {
|
|
5611
5608
|
if (!pinned && !isMobile) {
|
|
5612
5609
|
setExpanded(true);
|
|
5613
5610
|
}
|
|
5614
5611
|
}, [pinned, isMobile, setExpanded]);
|
|
5615
|
-
const handleMouseLeave =
|
|
5612
|
+
const handleMouseLeave = React10__namespace.useCallback(() => {
|
|
5616
5613
|
if (!pinned && !isMobile) {
|
|
5617
5614
|
setExpanded(false);
|
|
5618
5615
|
}
|
|
@@ -5680,28 +5677,28 @@ function LegacySidebar({
|
|
|
5680
5677
|
expandedWidth = EXPANDED_WIDTH,
|
|
5681
5678
|
className
|
|
5682
5679
|
}) {
|
|
5683
|
-
const [expanded, setExpanded] =
|
|
5684
|
-
const [pinned, setPinned] =
|
|
5685
|
-
const [activeSection, setActiveSection] =
|
|
5680
|
+
const [expanded, setExpanded] = React10__namespace.useState(defaultExpanded || defaultPinned);
|
|
5681
|
+
const [pinned, setPinned] = React10__namespace.useState(defaultPinned);
|
|
5682
|
+
const [activeSection, setActiveSection] = React10__namespace.useState(null);
|
|
5686
5683
|
const isMobile = useMediaQuery2("(max-width: 768px)");
|
|
5687
|
-
const sidebarRef =
|
|
5688
|
-
const handleMouseEnter =
|
|
5684
|
+
const sidebarRef = React10__namespace.useRef(null);
|
|
5685
|
+
const handleMouseEnter = React10__namespace.useCallback(() => {
|
|
5689
5686
|
if (!pinned && !isMobile) {
|
|
5690
5687
|
setExpanded(true);
|
|
5691
5688
|
}
|
|
5692
5689
|
}, [pinned, isMobile]);
|
|
5693
|
-
const handleMouseLeave =
|
|
5690
|
+
const handleMouseLeave = React10__namespace.useCallback(() => {
|
|
5694
5691
|
if (!pinned && !isMobile) {
|
|
5695
5692
|
setExpanded(false);
|
|
5696
5693
|
}
|
|
5697
5694
|
}, [pinned, isMobile]);
|
|
5698
|
-
const handleSetPinned =
|
|
5695
|
+
const handleSetPinned = React10__namespace.useCallback((value) => {
|
|
5699
5696
|
setPinned(value);
|
|
5700
5697
|
if (value) {
|
|
5701
5698
|
setExpanded(true);
|
|
5702
5699
|
}
|
|
5703
5700
|
}, []);
|
|
5704
|
-
const contextValue =
|
|
5701
|
+
const contextValue = React10__namespace.useMemo(
|
|
5705
5702
|
() => ({
|
|
5706
5703
|
expanded,
|
|
5707
5704
|
setExpanded,
|
|
@@ -5758,8 +5755,8 @@ var Sidebar = Object.assign(LegacySidebar, {
|
|
|
5758
5755
|
});
|
|
5759
5756
|
function renderIcon3(icon, className) {
|
|
5760
5757
|
if (!icon) return null;
|
|
5761
|
-
if (
|
|
5762
|
-
return
|
|
5758
|
+
if (React10__namespace.isValidElement(icon)) {
|
|
5759
|
+
return React10__namespace.cloneElement(icon, { className });
|
|
5763
5760
|
}
|
|
5764
5761
|
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon) {
|
|
5765
5762
|
const IconComponent = icon;
|
|
@@ -5767,7 +5764,7 @@ function renderIcon3(icon, className) {
|
|
|
5767
5764
|
}
|
|
5768
5765
|
return null;
|
|
5769
5766
|
}
|
|
5770
|
-
var MobileNavItem =
|
|
5767
|
+
var MobileNavItem = React10__namespace.memo(function MobileNavItem2({
|
|
5771
5768
|
icon,
|
|
5772
5769
|
label,
|
|
5773
5770
|
isActive = false,
|
|
@@ -5805,7 +5802,7 @@ var MobileNavItem = React49__namespace.memo(function MobileNavItem2({
|
|
|
5805
5802
|
] });
|
|
5806
5803
|
});
|
|
5807
5804
|
MobileNavItem.displayName = "MobileNavItem";
|
|
5808
|
-
var MobileNav =
|
|
5805
|
+
var MobileNav = React10__namespace.memo(function MobileNav2({
|
|
5809
5806
|
items,
|
|
5810
5807
|
fabAction,
|
|
5811
5808
|
className
|
|
@@ -5873,7 +5870,7 @@ var MobileNav = React49__namespace.memo(function MobileNav2({
|
|
|
5873
5870
|
);
|
|
5874
5871
|
});
|
|
5875
5872
|
MobileNav.displayName = "MobileNav";
|
|
5876
|
-
var Navbar =
|
|
5873
|
+
var Navbar = React10__namespace.memo(function Navbar2({
|
|
5877
5874
|
children,
|
|
5878
5875
|
className,
|
|
5879
5876
|
style
|
|
@@ -5892,8 +5889,8 @@ var Navbar = React49__namespace.memo(function Navbar2({
|
|
|
5892
5889
|
});
|
|
5893
5890
|
Navbar.displayName = "Navbar";
|
|
5894
5891
|
function ThemeToggle({ className }) {
|
|
5895
|
-
const [isDark, setIsDark] =
|
|
5896
|
-
|
|
5892
|
+
const [isDark, setIsDark] = React10__namespace.useState(false);
|
|
5893
|
+
React10__namespace.useEffect(() => {
|
|
5897
5894
|
const isDarkMode = document.documentElement.classList.contains("dark");
|
|
5898
5895
|
setIsDark(isDarkMode);
|
|
5899
5896
|
}, []);
|
|
@@ -5985,7 +5982,7 @@ function NavbarNotification({
|
|
|
5985
5982
|
] });
|
|
5986
5983
|
}
|
|
5987
5984
|
NavbarNotification.displayName = "NavbarNotification";
|
|
5988
|
-
var ScrollArea =
|
|
5985
|
+
var ScrollArea = React10__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5989
5986
|
ScrollAreaPrimitive__namespace.Root,
|
|
5990
5987
|
{
|
|
5991
5988
|
ref,
|
|
@@ -5999,7 +5996,7 @@ var ScrollArea = React49__namespace.forwardRef(({ className, children, ...props
|
|
|
5999
5996
|
}
|
|
6000
5997
|
));
|
|
6001
5998
|
ScrollArea.displayName = ScrollAreaPrimitive__namespace.Root.displayName;
|
|
6002
|
-
var ScrollBar =
|
|
5999
|
+
var ScrollBar = React10__namespace.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6003
6000
|
ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
|
|
6004
6001
|
{
|
|
6005
6002
|
ref,
|
|
@@ -6015,7 +6012,7 @@ var ScrollBar = React49__namespace.forwardRef(({ className, orientation = "verti
|
|
|
6015
6012
|
}
|
|
6016
6013
|
));
|
|
6017
6014
|
ScrollBar.displayName = ScrollAreaPrimitive__namespace.ScrollAreaScrollbar.displayName;
|
|
6018
|
-
var Separator3 =
|
|
6015
|
+
var Separator3 = React10__namespace.forwardRef(
|
|
6019
6016
|
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6020
6017
|
SeparatorPrimitive__namespace.Root,
|
|
6021
6018
|
{
|
|
@@ -6083,7 +6080,7 @@ function NavbarCompanyProfile({
|
|
|
6083
6080
|
/* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "h-64", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4", children: [
|
|
6084
6081
|
isLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ jsxRuntime.jsx(Loader, { variant: "spinner" }) }),
|
|
6085
6082
|
!isLoading && companies.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-center text-muted-foreground", children: "Nenhuma empresa encontrada." }),
|
|
6086
|
-
companies.map((company, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6083
|
+
companies.map((company, index) => /* @__PURE__ */ jsxRuntime.jsxs(React10__namespace.Fragment, { children: [
|
|
6087
6084
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6088
6085
|
Button,
|
|
6089
6086
|
{
|
|
@@ -6166,9 +6163,9 @@ function NavbarUserMenu({
|
|
|
6166
6163
|
] });
|
|
6167
6164
|
}
|
|
6168
6165
|
NavbarUserMenu.displayName = "NavbarUserMenu";
|
|
6169
|
-
var Breadcrumb =
|
|
6166
|
+
var Breadcrumb = React10__namespace.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
6170
6167
|
Breadcrumb.displayName = "Breadcrumb";
|
|
6171
|
-
var BreadcrumbList =
|
|
6168
|
+
var BreadcrumbList = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6172
6169
|
"ol",
|
|
6173
6170
|
{
|
|
6174
6171
|
ref,
|
|
@@ -6180,7 +6177,7 @@ var BreadcrumbList = React49__namespace.forwardRef(({ className, ...props }, ref
|
|
|
6180
6177
|
}
|
|
6181
6178
|
));
|
|
6182
6179
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
6183
|
-
var BreadcrumbItem =
|
|
6180
|
+
var BreadcrumbItem = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6184
6181
|
"li",
|
|
6185
6182
|
{
|
|
6186
6183
|
ref,
|
|
@@ -6189,7 +6186,7 @@ var BreadcrumbItem = React49__namespace.forwardRef(({ className, ...props }, ref
|
|
|
6189
6186
|
}
|
|
6190
6187
|
));
|
|
6191
6188
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
6192
|
-
var BreadcrumbLink =
|
|
6189
|
+
var BreadcrumbLink = React10__namespace.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
6193
6190
|
const Comp = asChild ? reactSlot.Slot : "a";
|
|
6194
6191
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6195
6192
|
Comp,
|
|
@@ -6201,7 +6198,7 @@ var BreadcrumbLink = React49__namespace.forwardRef(({ asChild, className, ...pro
|
|
|
6201
6198
|
);
|
|
6202
6199
|
});
|
|
6203
6200
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
6204
|
-
var BreadcrumbPage =
|
|
6201
|
+
var BreadcrumbPage = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6205
6202
|
"span",
|
|
6206
6203
|
{
|
|
6207
6204
|
ref,
|
|
@@ -6337,16 +6334,16 @@ var SectionHeader = Object.assign(SectionHeaderRoot, {
|
|
|
6337
6334
|
Actions: SectionHeaderActions,
|
|
6338
6335
|
Badge: SectionHeaderBadge
|
|
6339
6336
|
});
|
|
6340
|
-
var KanbanContext =
|
|
6337
|
+
var KanbanContext = React10__namespace.createContext(null);
|
|
6341
6338
|
function useKanban() {
|
|
6342
|
-
const context =
|
|
6339
|
+
const context = React10__namespace.useContext(KanbanContext);
|
|
6343
6340
|
if (!context) {
|
|
6344
6341
|
throw new Error("useKanban must be used within a Kanban.Board component");
|
|
6345
6342
|
}
|
|
6346
6343
|
return context;
|
|
6347
6344
|
}
|
|
6348
6345
|
function useKanbanOptional() {
|
|
6349
|
-
return
|
|
6346
|
+
return React10__namespace.useContext(KanbanContext);
|
|
6350
6347
|
}
|
|
6351
6348
|
function KanbanProvider({ children, value }) {
|
|
6352
6349
|
return /* @__PURE__ */ jsxRuntime.jsx(KanbanContext.Provider, { value, children });
|
|
@@ -6357,18 +6354,18 @@ function KanbanBoard({
|
|
|
6357
6354
|
onDragStart,
|
|
6358
6355
|
className
|
|
6359
6356
|
}) {
|
|
6360
|
-
const [isDragging, setIsDragging] =
|
|
6361
|
-
const [draggedItemId, setDraggedItemId] =
|
|
6362
|
-
const [sourceColumnId, setSourceColumnId] =
|
|
6363
|
-
const [hoveredColumnId, setHoveredColumnId] =
|
|
6364
|
-
const dropValidatorsRef =
|
|
6365
|
-
const registerDropValidator =
|
|
6357
|
+
const [isDragging, setIsDragging] = React10__namespace.useState(false);
|
|
6358
|
+
const [draggedItemId, setDraggedItemId] = React10__namespace.useState(null);
|
|
6359
|
+
const [sourceColumnId, setSourceColumnId] = React10__namespace.useState(null);
|
|
6360
|
+
const [hoveredColumnId, setHoveredColumnId] = React10__namespace.useState(null);
|
|
6361
|
+
const dropValidatorsRef = React10__namespace.useRef(/* @__PURE__ */ new Map());
|
|
6362
|
+
const registerDropValidator = React10__namespace.useCallback((columnId, validator) => {
|
|
6366
6363
|
dropValidatorsRef.current.set(columnId, validator);
|
|
6367
6364
|
}, []);
|
|
6368
|
-
const unregisterDropValidator =
|
|
6365
|
+
const unregisterDropValidator = React10__namespace.useCallback((columnId) => {
|
|
6369
6366
|
dropValidatorsRef.current.delete(columnId);
|
|
6370
6367
|
}, []);
|
|
6371
|
-
const canDropInColumn =
|
|
6368
|
+
const canDropInColumn = React10__namespace.useCallback((columnId) => {
|
|
6372
6369
|
if (!draggedItemId || !sourceColumnId) return false;
|
|
6373
6370
|
if (columnId === sourceColumnId) return false;
|
|
6374
6371
|
const validator = dropValidatorsRef.current.get(columnId);
|
|
@@ -6377,13 +6374,13 @@ function KanbanBoard({
|
|
|
6377
6374
|
}
|
|
6378
6375
|
return true;
|
|
6379
6376
|
}, [draggedItemId, sourceColumnId]);
|
|
6380
|
-
const handleDragStart =
|
|
6377
|
+
const handleDragStart = React10__namespace.useCallback((itemId, colId) => {
|
|
6381
6378
|
setIsDragging(true);
|
|
6382
6379
|
setDraggedItemId(itemId);
|
|
6383
6380
|
setSourceColumnId(colId);
|
|
6384
6381
|
onDragStart?.(itemId, colId);
|
|
6385
6382
|
}, [onDragStart]);
|
|
6386
|
-
const handleDrop =
|
|
6383
|
+
const handleDrop = React10__namespace.useCallback((destinationColumnId) => {
|
|
6387
6384
|
if (draggedItemId && sourceColumnId && destinationColumnId !== sourceColumnId) {
|
|
6388
6385
|
if (canDropInColumn(destinationColumnId)) {
|
|
6389
6386
|
const result = {
|
|
@@ -6399,13 +6396,13 @@ function KanbanBoard({
|
|
|
6399
6396
|
setSourceColumnId(null);
|
|
6400
6397
|
setHoveredColumnId(null);
|
|
6401
6398
|
}, [draggedItemId, sourceColumnId, canDropInColumn, onDragEnd]);
|
|
6402
|
-
const handleDragEnd =
|
|
6399
|
+
const handleDragEnd = React10__namespace.useCallback(() => {
|
|
6403
6400
|
setIsDragging(false);
|
|
6404
6401
|
setDraggedItemId(null);
|
|
6405
6402
|
setSourceColumnId(null);
|
|
6406
6403
|
setHoveredColumnId(null);
|
|
6407
6404
|
}, []);
|
|
6408
|
-
const contextValue =
|
|
6405
|
+
const contextValue = React10__namespace.useMemo(() => ({
|
|
6409
6406
|
isDragging,
|
|
6410
6407
|
draggedItemId,
|
|
6411
6408
|
sourceColumnId,
|
|
@@ -6430,9 +6427,9 @@ function KanbanBoard({
|
|
|
6430
6427
|
}
|
|
6431
6428
|
) });
|
|
6432
6429
|
}
|
|
6433
|
-
var KanbanBoardInternalContext =
|
|
6430
|
+
var KanbanBoardInternalContext = React10__namespace.createContext(null);
|
|
6434
6431
|
function useKanbanBoard() {
|
|
6435
|
-
const context =
|
|
6432
|
+
const context = React10__namespace.useContext(KanbanBoardInternalContext);
|
|
6436
6433
|
if (!context) {
|
|
6437
6434
|
throw new Error("useKanbanBoard must be used within a Kanban.Board component");
|
|
6438
6435
|
}
|
|
@@ -6452,7 +6449,7 @@ function KanbanColumn({
|
|
|
6452
6449
|
}) {
|
|
6453
6450
|
const { isDragging, sourceColumnId, hoveredColumnId, setHoveredColumnId, canDropInColumn, registerDropValidator, unregisterDropValidator } = useKanban();
|
|
6454
6451
|
const { handleDrop } = useKanbanBoard();
|
|
6455
|
-
|
|
6452
|
+
React10__namespace.useEffect(() => {
|
|
6456
6453
|
if (canDrop) {
|
|
6457
6454
|
registerDropValidator(id, canDrop);
|
|
6458
6455
|
return () => unregisterDropValidator(id);
|
|
@@ -6461,7 +6458,7 @@ function KanbanColumn({
|
|
|
6461
6458
|
const isValidDropTarget = isDragging && sourceColumnId !== id && canDropInColumn(id);
|
|
6462
6459
|
const isInvalidDropTarget = isDragging && sourceColumnId !== id && !canDropInColumn(id);
|
|
6463
6460
|
const isHovered = hoveredColumnId === id;
|
|
6464
|
-
const handleDragOver =
|
|
6461
|
+
const handleDragOver = React10__namespace.useCallback((e) => {
|
|
6465
6462
|
e.preventDefault();
|
|
6466
6463
|
if (isValidDropTarget) {
|
|
6467
6464
|
e.dataTransfer.dropEffect = "move";
|
|
@@ -6470,18 +6467,18 @@ function KanbanColumn({
|
|
|
6470
6467
|
e.dataTransfer.dropEffect = "none";
|
|
6471
6468
|
}
|
|
6472
6469
|
}, [isValidDropTarget, setHoveredColumnId, id]);
|
|
6473
|
-
const handleDragLeave =
|
|
6470
|
+
const handleDragLeave = React10__namespace.useCallback((e) => {
|
|
6474
6471
|
if (e.currentTarget === e.target || !e.currentTarget.contains(e.relatedTarget)) {
|
|
6475
6472
|
setHoveredColumnId(null);
|
|
6476
6473
|
}
|
|
6477
6474
|
}, [setHoveredColumnId]);
|
|
6478
|
-
const handleDropEvent =
|
|
6475
|
+
const handleDropEvent = React10__namespace.useCallback((e) => {
|
|
6479
6476
|
e.preventDefault();
|
|
6480
6477
|
if (isValidDropTarget) {
|
|
6481
6478
|
handleDrop(id);
|
|
6482
6479
|
}
|
|
6483
6480
|
}, [isValidDropTarget, handleDrop, id]);
|
|
6484
|
-
const childCount =
|
|
6481
|
+
const childCount = React10__namespace.Children.count(children);
|
|
6485
6482
|
const displayCount = count ?? childCount;
|
|
6486
6483
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6487
6484
|
"div",
|
|
@@ -6542,7 +6539,7 @@ function KanbanCard({
|
|
|
6542
6539
|
const { draggedItemId } = useKanban();
|
|
6543
6540
|
const { handleDragStart } = useKanbanBoard();
|
|
6544
6541
|
const isThisCardDragging = draggedItemId === id;
|
|
6545
|
-
const handleDragStartEvent =
|
|
6542
|
+
const handleDragStartEvent = React10__namespace.useCallback((e) => {
|
|
6546
6543
|
if (disabled) {
|
|
6547
6544
|
e.preventDefault();
|
|
6548
6545
|
return;
|
|
@@ -6602,15 +6599,15 @@ var itemCardVariants = classVarianceAuthority.cva(
|
|
|
6602
6599
|
}
|
|
6603
6600
|
}
|
|
6604
6601
|
);
|
|
6605
|
-
var ItemCardContext =
|
|
6602
|
+
var ItemCardContext = React10__namespace.createContext(null);
|
|
6606
6603
|
function useItemCard() {
|
|
6607
|
-
const context =
|
|
6604
|
+
const context = React10__namespace.useContext(ItemCardContext);
|
|
6608
6605
|
if (!context) {
|
|
6609
6606
|
throw new Error("ItemCard components must be used within ItemCard.Root");
|
|
6610
6607
|
}
|
|
6611
6608
|
return context;
|
|
6612
6609
|
}
|
|
6613
|
-
var ItemCardRoot =
|
|
6610
|
+
var ItemCardRoot = React10__namespace.forwardRef(
|
|
6614
6611
|
({
|
|
6615
6612
|
className,
|
|
6616
6613
|
variant,
|
|
@@ -6620,7 +6617,7 @@ var ItemCardRoot = React49__namespace.forwardRef(
|
|
|
6620
6617
|
children,
|
|
6621
6618
|
...props
|
|
6622
6619
|
}, ref) => {
|
|
6623
|
-
const contextValue =
|
|
6620
|
+
const contextValue = React10__namespace.useMemo(
|
|
6624
6621
|
() => ({ isSelected: selected }),
|
|
6625
6622
|
[selected]
|
|
6626
6623
|
);
|
|
@@ -6664,7 +6661,7 @@ var itemCardBadgeVariants = classVarianceAuthority.cva(
|
|
|
6664
6661
|
}
|
|
6665
6662
|
}
|
|
6666
6663
|
);
|
|
6667
|
-
var ItemCardBadge =
|
|
6664
|
+
var ItemCardBadge = React10__namespace.forwardRef(
|
|
6668
6665
|
({ className, variant, children, ...props }, ref) => {
|
|
6669
6666
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6670
6667
|
"div",
|
|
@@ -6678,7 +6675,7 @@ var ItemCardBadge = React49__namespace.forwardRef(
|
|
|
6678
6675
|
}
|
|
6679
6676
|
);
|
|
6680
6677
|
ItemCardBadge.displayName = "ItemCardBadge";
|
|
6681
|
-
var ItemCardHeader =
|
|
6678
|
+
var ItemCardHeader = React10__namespace.forwardRef(
|
|
6682
6679
|
({ className, align = "between", children, ...props }, ref) => {
|
|
6683
6680
|
const alignmentClasses = {
|
|
6684
6681
|
left: "justify-start",
|
|
@@ -6727,7 +6724,7 @@ var itemCardIconVariants = classVarianceAuthority.cva(
|
|
|
6727
6724
|
}
|
|
6728
6725
|
}
|
|
6729
6726
|
);
|
|
6730
|
-
var ItemCardIcon =
|
|
6727
|
+
var ItemCardIcon = React10__namespace.forwardRef(
|
|
6731
6728
|
({ className, size, variant, ripple = false, children, ...props }, ref) => {
|
|
6732
6729
|
const wrapperSizeClasses = {
|
|
6733
6730
|
sm: "w-10 h-10",
|
|
@@ -6769,7 +6766,7 @@ var ItemCardIcon = React49__namespace.forwardRef(
|
|
|
6769
6766
|
}
|
|
6770
6767
|
);
|
|
6771
6768
|
ItemCardIcon.displayName = "ItemCardIcon";
|
|
6772
|
-
var ItemCardTitleGroup =
|
|
6769
|
+
var ItemCardTitleGroup = React10__namespace.forwardRef(
|
|
6773
6770
|
({ className, align = "right", children, ...props }, ref) => {
|
|
6774
6771
|
const alignmentClasses = {
|
|
6775
6772
|
left: "text-left",
|
|
@@ -6788,7 +6785,7 @@ var ItemCardTitleGroup = React49__namespace.forwardRef(
|
|
|
6788
6785
|
}
|
|
6789
6786
|
);
|
|
6790
6787
|
ItemCardTitleGroup.displayName = "ItemCardTitleGroup";
|
|
6791
|
-
var ItemCardTitle =
|
|
6788
|
+
var ItemCardTitle = React10__namespace.forwardRef(
|
|
6792
6789
|
({ className, children, ...props }, ref) => {
|
|
6793
6790
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6794
6791
|
"h3",
|
|
@@ -6802,7 +6799,7 @@ var ItemCardTitle = React49__namespace.forwardRef(
|
|
|
6802
6799
|
}
|
|
6803
6800
|
);
|
|
6804
6801
|
ItemCardTitle.displayName = "ItemCardTitle";
|
|
6805
|
-
var ItemCardSubtitle =
|
|
6802
|
+
var ItemCardSubtitle = React10__namespace.forwardRef(
|
|
6806
6803
|
({ className, children, ...props }, ref) => {
|
|
6807
6804
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6808
6805
|
"p",
|
|
@@ -6816,7 +6813,7 @@ var ItemCardSubtitle = React49__namespace.forwardRef(
|
|
|
6816
6813
|
}
|
|
6817
6814
|
);
|
|
6818
6815
|
ItemCardSubtitle.displayName = "ItemCardSubtitle";
|
|
6819
|
-
var ItemCardContent =
|
|
6816
|
+
var ItemCardContent = React10__namespace.forwardRef(
|
|
6820
6817
|
({ className, muted = true, children, ...props }, ref) => {
|
|
6821
6818
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6822
6819
|
"div",
|
|
@@ -6834,7 +6831,7 @@ var ItemCardContent = React49__namespace.forwardRef(
|
|
|
6834
6831
|
}
|
|
6835
6832
|
);
|
|
6836
6833
|
ItemCardContent.displayName = "ItemCardContent";
|
|
6837
|
-
var ItemCardContentItem =
|
|
6834
|
+
var ItemCardContentItem = React10__namespace.forwardRef(
|
|
6838
6835
|
({ className, label, value, secondary, children, ...props }, ref) => {
|
|
6839
6836
|
if (children) {
|
|
6840
6837
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6869,7 +6866,7 @@ var ItemCardContentItem = React49__namespace.forwardRef(
|
|
|
6869
6866
|
}
|
|
6870
6867
|
);
|
|
6871
6868
|
ItemCardContentItem.displayName = "ItemCardContentItem";
|
|
6872
|
-
var ItemCardEmpty =
|
|
6869
|
+
var ItemCardEmpty = React10__namespace.forwardRef(
|
|
6873
6870
|
({ className, icon, message = "Nenhum item", children, ...props }, ref) => {
|
|
6874
6871
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6875
6872
|
"div",
|
|
@@ -6889,7 +6886,7 @@ var ItemCardEmpty = React49__namespace.forwardRef(
|
|
|
6889
6886
|
}
|
|
6890
6887
|
);
|
|
6891
6888
|
ItemCardEmpty.displayName = "ItemCardEmpty";
|
|
6892
|
-
var ItemCardFooter =
|
|
6889
|
+
var ItemCardFooter = React10__namespace.forwardRef(
|
|
6893
6890
|
({ className, children, ...props }, ref) => {
|
|
6894
6891
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6895
6892
|
"div",
|
|
@@ -6906,7 +6903,7 @@ var ItemCardFooter = React49__namespace.forwardRef(
|
|
|
6906
6903
|
}
|
|
6907
6904
|
);
|
|
6908
6905
|
ItemCardFooter.displayName = "ItemCardFooter";
|
|
6909
|
-
var ItemCardFooterItem =
|
|
6906
|
+
var ItemCardFooterItem = React10__namespace.forwardRef(
|
|
6910
6907
|
({ className, label, value, align = "left", ...props }, ref) => {
|
|
6911
6908
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6912
6909
|
"div",
|
|
@@ -6927,7 +6924,7 @@ var ItemCardFooterItem = React49__namespace.forwardRef(
|
|
|
6927
6924
|
}
|
|
6928
6925
|
);
|
|
6929
6926
|
ItemCardFooterItem.displayName = "ItemCardFooterItem";
|
|
6930
|
-
var ItemCardFooterDivider =
|
|
6927
|
+
var ItemCardFooterDivider = React10__namespace.forwardRef(
|
|
6931
6928
|
({ className, ...props }, ref) => {
|
|
6932
6929
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6933
6930
|
"div",
|
|
@@ -6940,7 +6937,7 @@ var ItemCardFooterDivider = React49__namespace.forwardRef(
|
|
|
6940
6937
|
}
|
|
6941
6938
|
);
|
|
6942
6939
|
ItemCardFooterDivider.displayName = "ItemCardFooterDivider";
|
|
6943
|
-
var ItemCardActions =
|
|
6940
|
+
var ItemCardActions = React10__namespace.forwardRef(
|
|
6944
6941
|
({ className, bordered = true, children, ...props }, ref) => {
|
|
6945
6942
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6946
6943
|
"div",
|
|
@@ -6958,7 +6955,7 @@ var ItemCardActions = React49__namespace.forwardRef(
|
|
|
6958
6955
|
}
|
|
6959
6956
|
);
|
|
6960
6957
|
ItemCardActions.displayName = "ItemCardActions";
|
|
6961
|
-
var ItemCardActionButton =
|
|
6958
|
+
var ItemCardActionButton = React10__namespace.forwardRef(
|
|
6962
6959
|
({
|
|
6963
6960
|
className,
|
|
6964
6961
|
showArrow = true,
|
|
@@ -6999,7 +6996,7 @@ var ItemCardActionButton = React49__namespace.forwardRef(
|
|
|
6999
6996
|
}
|
|
7000
6997
|
);
|
|
7001
6998
|
ItemCardActionButton.displayName = "ItemCardActionButton";
|
|
7002
|
-
var ItemCardActionsRow =
|
|
6999
|
+
var ItemCardActionsRow = React10__namespace.forwardRef(
|
|
7003
7000
|
({ className, children, ...props }, ref) => {
|
|
7004
7001
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7005
7002
|
"div",
|
|
@@ -7037,16 +7034,16 @@ var ItemCard = Object.assign(ItemCardRoot, {
|
|
|
7037
7034
|
ActionButton: ItemCardActionButton,
|
|
7038
7035
|
ActionsRow: ItemCardActionsRow
|
|
7039
7036
|
});
|
|
7040
|
-
var WizardContext =
|
|
7037
|
+
var WizardContext = React10.createContext(void 0);
|
|
7041
7038
|
function useWizardContext() {
|
|
7042
|
-
const context =
|
|
7039
|
+
const context = React10.useContext(WizardContext);
|
|
7043
7040
|
if (context === void 0) {
|
|
7044
7041
|
throw new Error("useWizardContext must be used within a Wizard component");
|
|
7045
7042
|
}
|
|
7046
7043
|
return context;
|
|
7047
7044
|
}
|
|
7048
7045
|
function useWizardContextOptional() {
|
|
7049
|
-
return
|
|
7046
|
+
return React10.useContext(WizardContext);
|
|
7050
7047
|
}
|
|
7051
7048
|
function WizardProvider({
|
|
7052
7049
|
children,
|
|
@@ -7057,8 +7054,8 @@ function WizardProvider({
|
|
|
7057
7054
|
validateOnNext = true,
|
|
7058
7055
|
allowJumpToStep = false
|
|
7059
7056
|
}) {
|
|
7060
|
-
const [completedSteps, setCompletedSteps] =
|
|
7061
|
-
const activeSteps =
|
|
7057
|
+
const [completedSteps, setCompletedSteps] = React10.useState(/* @__PURE__ */ new Set());
|
|
7058
|
+
const activeSteps = React10.useMemo(() => {
|
|
7062
7059
|
const formValues = form.getValues();
|
|
7063
7060
|
return steps.filter((step) => {
|
|
7064
7061
|
if (typeof step.isHidden === "function") {
|
|
@@ -7067,7 +7064,7 @@ function WizardProvider({
|
|
|
7067
7064
|
return !step.isHidden;
|
|
7068
7065
|
});
|
|
7069
7066
|
}, [steps, form]);
|
|
7070
|
-
const [currentStep, setCurrentStep] =
|
|
7067
|
+
const [currentStep, setCurrentStep] = React10.useState(() => {
|
|
7071
7068
|
return Math.min(Math.max(0, initialStep), activeSteps.length - 1);
|
|
7072
7069
|
});
|
|
7073
7070
|
const totalSteps = activeSteps.length;
|
|
@@ -7075,23 +7072,23 @@ function WizardProvider({
|
|
|
7075
7072
|
const isLastStep = currentStep === totalSteps - 1;
|
|
7076
7073
|
const progress = totalSteps > 0 ? Math.round((currentStep + 1) / totalSteps * 100) : 0;
|
|
7077
7074
|
const currentStepConfig = activeSteps[currentStep];
|
|
7078
|
-
const getStepConfig =
|
|
7075
|
+
const getStepConfig = React10.useCallback(
|
|
7079
7076
|
(index) => activeSteps[index],
|
|
7080
7077
|
[activeSteps]
|
|
7081
7078
|
);
|
|
7082
|
-
const getStepByName =
|
|
7079
|
+
const getStepByName = React10.useCallback(
|
|
7083
7080
|
(name) => activeSteps.find((step) => step.name === name || step.id === name),
|
|
7084
7081
|
[activeSteps]
|
|
7085
7082
|
);
|
|
7086
|
-
const getStepIndexByName =
|
|
7083
|
+
const getStepIndexByName = React10.useCallback(
|
|
7087
7084
|
(name) => activeSteps.findIndex((step) => step.name === name || step.id === name),
|
|
7088
7085
|
[activeSteps]
|
|
7089
7086
|
);
|
|
7090
|
-
const isStepCompleted =
|
|
7087
|
+
const isStepCompleted = React10.useCallback(
|
|
7091
7088
|
(index) => completedSteps.has(index),
|
|
7092
7089
|
[completedSteps]
|
|
7093
7090
|
);
|
|
7094
|
-
const hasStepErrors =
|
|
7091
|
+
const hasStepErrors = React10.useCallback(
|
|
7095
7092
|
(index) => {
|
|
7096
7093
|
const stepConfig = activeSteps[index];
|
|
7097
7094
|
if (!stepConfig?.fields) return false;
|
|
@@ -7103,7 +7100,7 @@ function WizardProvider({
|
|
|
7103
7100
|
},
|
|
7104
7101
|
[activeSteps, form.formState.errors]
|
|
7105
7102
|
);
|
|
7106
|
-
const validateCurrentStep =
|
|
7103
|
+
const validateCurrentStep = React10.useCallback(async () => {
|
|
7107
7104
|
const stepConfig = currentStepConfig;
|
|
7108
7105
|
if (!stepConfig?.validationSchema) {
|
|
7109
7106
|
return true;
|
|
@@ -7125,7 +7122,7 @@ function WizardProvider({
|
|
|
7125
7122
|
}
|
|
7126
7123
|
return true;
|
|
7127
7124
|
}, [currentStepConfig, form]);
|
|
7128
|
-
const goToNextStep =
|
|
7125
|
+
const goToNextStep = React10.useCallback(async () => {
|
|
7129
7126
|
if (isLastStep) {
|
|
7130
7127
|
return false;
|
|
7131
7128
|
}
|
|
@@ -7141,7 +7138,7 @@ function WizardProvider({
|
|
|
7141
7138
|
onStepChange?.(nextStep, "next");
|
|
7142
7139
|
return true;
|
|
7143
7140
|
}, [isLastStep, validateOnNext, validateCurrentStep, currentStep, onStepChange]);
|
|
7144
|
-
const goToPrevStep =
|
|
7141
|
+
const goToPrevStep = React10.useCallback(() => {
|
|
7145
7142
|
if (isFirstStep) {
|
|
7146
7143
|
return;
|
|
7147
7144
|
}
|
|
@@ -7149,7 +7146,7 @@ function WizardProvider({
|
|
|
7149
7146
|
setCurrentStep(prevStep);
|
|
7150
7147
|
onStepChange?.(prevStep, "prev");
|
|
7151
7148
|
}, [isFirstStep, currentStep, onStepChange]);
|
|
7152
|
-
const goToStep =
|
|
7149
|
+
const goToStep = React10.useCallback(
|
|
7153
7150
|
async (targetStep) => {
|
|
7154
7151
|
if (targetStep < 0 || targetStep >= totalSteps) {
|
|
7155
7152
|
return false;
|
|
@@ -7179,12 +7176,12 @@ function WizardProvider({
|
|
|
7179
7176
|
},
|
|
7180
7177
|
[totalSteps, allowJumpToStep, currentStep, completedSteps, validateOnNext, validateCurrentStep, onStepChange]
|
|
7181
7178
|
);
|
|
7182
|
-
const reset =
|
|
7179
|
+
const reset = React10.useCallback(() => {
|
|
7183
7180
|
setCurrentStep(Math.min(Math.max(0, initialStep), activeSteps.length - 1));
|
|
7184
7181
|
setCompletedSteps(/* @__PURE__ */ new Set());
|
|
7185
7182
|
form.reset();
|
|
7186
7183
|
}, [initialStep, activeSteps.length, form]);
|
|
7187
|
-
const contextValue =
|
|
7184
|
+
const contextValue = React10.useMemo(
|
|
7188
7185
|
() => ({
|
|
7189
7186
|
// State
|
|
7190
7187
|
currentStep,
|
|
@@ -7487,8 +7484,8 @@ function WizardSteps({
|
|
|
7487
7484
|
function WizardContent({ children, className }) {
|
|
7488
7485
|
const { currentStepConfig } = useWizardContext();
|
|
7489
7486
|
let activePanel = null;
|
|
7490
|
-
|
|
7491
|
-
if (!
|
|
7487
|
+
React10.Children.forEach(children, (child) => {
|
|
7488
|
+
if (!React10.isValidElement(child)) return;
|
|
7492
7489
|
const panelProps = child.props;
|
|
7493
7490
|
if (panelProps.name === currentStepConfig?.name || panelProps.name === currentStepConfig?.id) {
|
|
7494
7491
|
activePanel = child;
|
|
@@ -7528,17 +7525,17 @@ function WizardNavigation({
|
|
|
7528
7525
|
} = useWizardContext();
|
|
7529
7526
|
const isSubmitting = form.formState.isSubmitting;
|
|
7530
7527
|
const shouldShowCancel = showCancel ?? isFirstStep;
|
|
7531
|
-
const handleNext =
|
|
7528
|
+
const handleNext = React10.useCallback(async (e) => {
|
|
7532
7529
|
e.preventDefault();
|
|
7533
7530
|
e.stopPropagation();
|
|
7534
7531
|
await goToNextStep();
|
|
7535
7532
|
}, [goToNextStep]);
|
|
7536
|
-
const handlePrev =
|
|
7533
|
+
const handlePrev = React10.useCallback((e) => {
|
|
7537
7534
|
e.preventDefault();
|
|
7538
7535
|
e.stopPropagation();
|
|
7539
7536
|
goToPrevStep();
|
|
7540
7537
|
}, [goToPrevStep]);
|
|
7541
|
-
const handleCancel =
|
|
7538
|
+
const handleCancel = React10.useCallback((e) => {
|
|
7542
7539
|
e.preventDefault();
|
|
7543
7540
|
e.stopPropagation();
|
|
7544
7541
|
onCancel?.();
|
|
@@ -7748,9 +7745,9 @@ function Logo({
|
|
|
7748
7745
|
}
|
|
7749
7746
|
);
|
|
7750
7747
|
}
|
|
7751
|
-
var StatsCardContext =
|
|
7748
|
+
var StatsCardContext = React10__namespace.createContext(null);
|
|
7752
7749
|
function useStatsCard() {
|
|
7753
|
-
const context =
|
|
7750
|
+
const context = React10__namespace.useContext(StatsCardContext);
|
|
7754
7751
|
if (!context) {
|
|
7755
7752
|
throw new Error("StatsCard components must be used within StatsCard.Root");
|
|
7756
7753
|
}
|
|
@@ -7924,7 +7921,7 @@ function StatsCardChange({ type = "positive", className, children, ...props }) {
|
|
|
7924
7921
|
}
|
|
7925
7922
|
function StatsCardChart({ data, height, className, ...props }) {
|
|
7926
7923
|
const { config, variant } = useStatsCard();
|
|
7927
|
-
const gradientId =
|
|
7924
|
+
const gradientId = React10__namespace.useId();
|
|
7928
7925
|
if (variant === "mini") {
|
|
7929
7926
|
return null;
|
|
7930
7927
|
}
|
|
@@ -8018,18 +8015,18 @@ var initialState = {
|
|
|
8018
8015
|
theme: "system",
|
|
8019
8016
|
setTheme: () => null
|
|
8020
8017
|
};
|
|
8021
|
-
var ThemeProviderContext =
|
|
8018
|
+
var ThemeProviderContext = React10__namespace.createContext(initialState);
|
|
8022
8019
|
function ThemeProvider({
|
|
8023
8020
|
children,
|
|
8024
8021
|
defaultTheme = "system",
|
|
8025
8022
|
storageKey = "facter-ds-theme",
|
|
8026
8023
|
...props
|
|
8027
8024
|
}) {
|
|
8028
|
-
const [theme, setTheme] =
|
|
8025
|
+
const [theme, setTheme] = React10__namespace.useState(
|
|
8029
8026
|
() => localStorage.getItem(storageKey) || defaultTheme
|
|
8030
8027
|
);
|
|
8031
|
-
const [resolvedTheme, setResolvedTheme] =
|
|
8032
|
-
|
|
8028
|
+
const [resolvedTheme, setResolvedTheme] = React10__namespace.useState("light");
|
|
8029
|
+
React10__namespace.useEffect(() => {
|
|
8033
8030
|
const root = window.document.documentElement;
|
|
8034
8031
|
root.classList.remove("light", "dark");
|
|
8035
8032
|
if (theme === "system") {
|
|
@@ -8041,7 +8038,7 @@ function ThemeProvider({
|
|
|
8041
8038
|
root.classList.add(theme);
|
|
8042
8039
|
setResolvedTheme(theme);
|
|
8043
8040
|
}, [theme]);
|
|
8044
|
-
const value =
|
|
8041
|
+
const value = React10__namespace.useMemo(
|
|
8045
8042
|
() => ({
|
|
8046
8043
|
theme,
|
|
8047
8044
|
setTheme: (theme2) => {
|
|
@@ -8054,7 +8051,7 @@ function ThemeProvider({
|
|
|
8054
8051
|
return /* @__PURE__ */ jsxRuntime.jsx(ThemeProviderContext.Provider, { ...props, value, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: resolvedTheme, style: { minHeight: "100vh" }, children }) });
|
|
8055
8052
|
}
|
|
8056
8053
|
var useTheme = () => {
|
|
8057
|
-
const context =
|
|
8054
|
+
const context = React10__namespace.useContext(ThemeProviderContext);
|
|
8058
8055
|
if (context === void 0)
|
|
8059
8056
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
8060
8057
|
return context;
|