@facter/ds-core 1.7.5 → 1.7.7
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.js +350 -359
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +327 -336
- 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;
|
|
@@ -368,8 +368,8 @@ function Sparkline({
|
|
|
368
368
|
className,
|
|
369
369
|
show = true
|
|
370
370
|
}) {
|
|
371
|
-
const gradientId =
|
|
372
|
-
const { linePath, areaPath } =
|
|
371
|
+
const gradientId = React10__namespace.useId();
|
|
372
|
+
const { linePath, areaPath } = React10__namespace.useMemo(() => {
|
|
373
373
|
if (data.length < 2) {
|
|
374
374
|
return { linePath: "", areaPath: "" };
|
|
375
375
|
}
|
|
@@ -587,7 +587,7 @@ var selectVariants = classVarianceAuthority.cva(
|
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
589
|
);
|
|
590
|
-
var Select =
|
|
590
|
+
var Select = React10__namespace.forwardRef(
|
|
591
591
|
({
|
|
592
592
|
className,
|
|
593
593
|
variant,
|
|
@@ -656,7 +656,7 @@ var Select = React49__namespace.forwardRef(
|
|
|
656
656
|
}
|
|
657
657
|
);
|
|
658
658
|
Select.displayName = "Select";
|
|
659
|
-
var SelectItem =
|
|
659
|
+
var SelectItem = React10__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
660
660
|
SelectPrimitive__namespace.Item,
|
|
661
661
|
{
|
|
662
662
|
ref,
|
|
@@ -675,7 +675,7 @@ var SelectItem = React49__namespace.forwardRef(({ className, children, ...props
|
|
|
675
675
|
));
|
|
676
676
|
SelectItem.displayName = "SelectItem";
|
|
677
677
|
var SelectGroup = SelectPrimitive__namespace.Group;
|
|
678
|
-
var SelectLabel =
|
|
678
|
+
var SelectLabel = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
679
679
|
SelectPrimitive__namespace.Label,
|
|
680
680
|
{
|
|
681
681
|
ref,
|
|
@@ -684,7 +684,7 @@ var SelectLabel = React49__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
684
684
|
}
|
|
685
685
|
));
|
|
686
686
|
SelectLabel.displayName = "SelectLabel";
|
|
687
|
-
var SelectSeparator =
|
|
687
|
+
var SelectSeparator = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
688
688
|
SelectPrimitive__namespace.Separator,
|
|
689
689
|
{
|
|
690
690
|
ref,
|
|
@@ -694,7 +694,7 @@ var SelectSeparator = React49__namespace.forwardRef(({ className, ...props }, re
|
|
|
694
694
|
));
|
|
695
695
|
SelectSeparator.displayName = "SelectSeparator";
|
|
696
696
|
var Tabs = TabsPrimitive__namespace.Root;
|
|
697
|
-
var TabsList =
|
|
697
|
+
var TabsList = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
698
698
|
TabsPrimitive__namespace.List,
|
|
699
699
|
{
|
|
700
700
|
ref,
|
|
@@ -706,7 +706,7 @@ var TabsList = React49__namespace.forwardRef(({ className, ...props }, ref) => /
|
|
|
706
706
|
}
|
|
707
707
|
));
|
|
708
708
|
TabsList.displayName = TabsPrimitive__namespace.List.displayName;
|
|
709
|
-
var TabsTrigger =
|
|
709
|
+
var TabsTrigger = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
710
710
|
TabsPrimitive__namespace.Trigger,
|
|
711
711
|
{
|
|
712
712
|
ref,
|
|
@@ -718,7 +718,7 @@ var TabsTrigger = React49__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
718
718
|
}
|
|
719
719
|
));
|
|
720
720
|
TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
|
|
721
|
-
var TabsContent =
|
|
721
|
+
var TabsContent = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
722
722
|
TabsPrimitive__namespace.Content,
|
|
723
723
|
{
|
|
724
724
|
ref,
|
|
@@ -827,7 +827,7 @@ function BarsLoader() {
|
|
|
827
827
|
i
|
|
828
828
|
)) });
|
|
829
829
|
}
|
|
830
|
-
var Loader =
|
|
830
|
+
var Loader = React10__namespace.forwardRef(
|
|
831
831
|
({
|
|
832
832
|
variant = "default",
|
|
833
833
|
message,
|
|
@@ -877,21 +877,21 @@ var Loader = React49__namespace.forwardRef(
|
|
|
877
877
|
}
|
|
878
878
|
);
|
|
879
879
|
Loader.displayName = "Loader";
|
|
880
|
-
var LoaderContext =
|
|
880
|
+
var LoaderContext = React10__namespace.createContext(
|
|
881
881
|
void 0
|
|
882
882
|
);
|
|
883
883
|
function LoaderProvider({ children }) {
|
|
884
|
-
const [isLoading, setIsLoading] =
|
|
885
|
-
const [loaderOptions, setLoaderOptions] =
|
|
886
|
-
const show =
|
|
884
|
+
const [isLoading, setIsLoading] = React10__namespace.useState(false);
|
|
885
|
+
const [loaderOptions, setLoaderOptions] = React10__namespace.useState({});
|
|
886
|
+
const show = React10__namespace.useCallback((options = {}) => {
|
|
887
887
|
setLoaderOptions(options);
|
|
888
888
|
setIsLoading(true);
|
|
889
889
|
}, []);
|
|
890
|
-
const hide =
|
|
890
|
+
const hide = React10__namespace.useCallback(() => {
|
|
891
891
|
setIsLoading(false);
|
|
892
892
|
setTimeout(() => setLoaderOptions({}), 300);
|
|
893
893
|
}, []);
|
|
894
|
-
const value =
|
|
894
|
+
const value = React10__namespace.useMemo(
|
|
895
895
|
() => ({ show, hide, isLoading }),
|
|
896
896
|
[show, hide, isLoading]
|
|
897
897
|
);
|
|
@@ -910,7 +910,7 @@ function LoaderProvider({ children }) {
|
|
|
910
910
|
] });
|
|
911
911
|
}
|
|
912
912
|
function useLoader() {
|
|
913
|
-
const context =
|
|
913
|
+
const context = React10__namespace.useContext(LoaderContext);
|
|
914
914
|
if (context === void 0) {
|
|
915
915
|
throw new Error("useLoader must be used within a LoaderProvider");
|
|
916
916
|
}
|
|
@@ -942,7 +942,7 @@ var loader = {
|
|
|
942
942
|
};
|
|
943
943
|
function GlobalLoaderController() {
|
|
944
944
|
const loaderController = useLoader();
|
|
945
|
-
|
|
945
|
+
React10__namespace.useEffect(() => {
|
|
946
946
|
setGlobalLoader(loaderController);
|
|
947
947
|
return () => {
|
|
948
948
|
setGlobalLoader(null);
|
|
@@ -1028,7 +1028,7 @@ var iconAnimation = {
|
|
|
1028
1028
|
whileHover: { scale: 1.1 },
|
|
1029
1029
|
whileTap: { scale: 0.9 }
|
|
1030
1030
|
};
|
|
1031
|
-
var EmptyStateContent =
|
|
1031
|
+
var EmptyStateContent = React10__namespace.memo(
|
|
1032
1032
|
({
|
|
1033
1033
|
message = "Nenhum item encontrado",
|
|
1034
1034
|
description,
|
|
@@ -1040,7 +1040,7 @@ var EmptyStateContent = React49__namespace.memo(
|
|
|
1040
1040
|
layout = "vertical",
|
|
1041
1041
|
className
|
|
1042
1042
|
}) => {
|
|
1043
|
-
const handleAction =
|
|
1043
|
+
const handleAction = React10__namespace.useCallback(() => {
|
|
1044
1044
|
if (onAction) {
|
|
1045
1045
|
onAction();
|
|
1046
1046
|
}
|
|
@@ -1070,7 +1070,7 @@ var EmptyStateContent = React49__namespace.memo(
|
|
|
1070
1070
|
}
|
|
1071
1071
|
);
|
|
1072
1072
|
EmptyStateContent.displayName = "EmptyStateContent";
|
|
1073
|
-
var AnimatedEmptyState =
|
|
1073
|
+
var AnimatedEmptyState = React10__namespace.memo((props) => {
|
|
1074
1074
|
const {
|
|
1075
1075
|
message = "Nenhum item encontrado",
|
|
1076
1076
|
description,
|
|
@@ -1082,7 +1082,7 @@ var AnimatedEmptyState = React49__namespace.memo((props) => {
|
|
|
1082
1082
|
layout = "vertical",
|
|
1083
1083
|
className
|
|
1084
1084
|
} = props;
|
|
1085
|
-
const handleAction =
|
|
1085
|
+
const handleAction = React10__namespace.useCallback(() => {
|
|
1086
1086
|
if (onAction) {
|
|
1087
1087
|
onAction();
|
|
1088
1088
|
}
|
|
@@ -1125,7 +1125,7 @@ var AnimatedEmptyState = React49__namespace.memo((props) => {
|
|
|
1125
1125
|
);
|
|
1126
1126
|
});
|
|
1127
1127
|
AnimatedEmptyState.displayName = "AnimatedEmptyState";
|
|
1128
|
-
var EmptyState =
|
|
1128
|
+
var EmptyState = React10__namespace.memo(
|
|
1129
1129
|
({ animated = true, ...props }) => {
|
|
1130
1130
|
if (!animated) {
|
|
1131
1131
|
return /* @__PURE__ */ jsxRuntime.jsx(EmptyStateContent, { ...props });
|
|
@@ -1141,13 +1141,13 @@ function useDataTableInternal({
|
|
|
1141
1141
|
manualPagination = false,
|
|
1142
1142
|
pageCount: externalPageCount
|
|
1143
1143
|
}) {
|
|
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] =
|
|
1144
|
+
const [rowSelection, setRowSelection] = React10__namespace.useState({});
|
|
1145
|
+
const [columnVisibility, setColumnVisibility] = React10__namespace.useState({});
|
|
1146
|
+
const [columnFilters, setColumnFilters] = React10__namespace.useState([]);
|
|
1147
|
+
const [sorting, setSorting] = React10__namespace.useState([]);
|
|
1148
|
+
const [globalFilter, setGlobalFilter] = React10__namespace.useState("");
|
|
1149
|
+
const [density, setDensity] = React10__namespace.useState("default");
|
|
1150
|
+
const [pagination, setPagination] = React10__namespace.useState({
|
|
1151
1151
|
pageIndex: 0,
|
|
1152
1152
|
pageSize: 10
|
|
1153
1153
|
});
|
|
@@ -1185,7 +1185,7 @@ function useDataTableInternal({
|
|
|
1185
1185
|
getPaginationRowModel: reactTable.getPaginationRowModel(),
|
|
1186
1186
|
getSortedRowModel: reactTable.getSortedRowModel()
|
|
1187
1187
|
});
|
|
1188
|
-
const meta =
|
|
1188
|
+
const meta = React10__namespace.useMemo(
|
|
1189
1189
|
() => ({
|
|
1190
1190
|
isLoading: false,
|
|
1191
1191
|
// Loading é controlado externamente via DataTable.Loading
|
|
@@ -1205,13 +1205,14 @@ function useDataTableInternal({
|
|
|
1205
1205
|
pageSize: pagination.pageSize
|
|
1206
1206
|
};
|
|
1207
1207
|
}
|
|
1208
|
-
var
|
|
1208
|
+
var DataTableEmptyStateConfigContext = React10__namespace.createContext(null);
|
|
1209
|
+
var DataTableInstanceContext = React10__namespace.createContext(null);
|
|
1209
1210
|
DataTableInstanceContext.displayName = "DataTableInstanceContext";
|
|
1210
|
-
var DataTableMetaContext =
|
|
1211
|
+
var DataTableMetaContext = React10__namespace.createContext(null);
|
|
1211
1212
|
DataTableMetaContext.displayName = "DataTableMetaContext";
|
|
1212
|
-
var DataTableDensityContext =
|
|
1213
|
+
var DataTableDensityContext = React10__namespace.createContext(null);
|
|
1213
1214
|
DataTableDensityContext.displayName = "DataTableDensityContext";
|
|
1214
|
-
var DataTablePaginationContext =
|
|
1215
|
+
var DataTablePaginationContext = React10__namespace.createContext(null);
|
|
1215
1216
|
DataTablePaginationContext.displayName = "DataTablePaginationContext";
|
|
1216
1217
|
function DataTableProvider({
|
|
1217
1218
|
children,
|
|
@@ -1222,26 +1223,28 @@ function DataTableProvider({
|
|
|
1222
1223
|
pageIndex,
|
|
1223
1224
|
pageSize
|
|
1224
1225
|
}) {
|
|
1225
|
-
const
|
|
1226
|
+
const [emptyStateConfig, setEmptyStateConfig] = React10__namespace.useState({});
|
|
1227
|
+
const emptyStateValue = React10__namespace.useMemo(
|
|
1228
|
+
() => ({ config: emptyStateConfig, setConfig: setEmptyStateConfig }),
|
|
1229
|
+
[emptyStateConfig]
|
|
1230
|
+
);
|
|
1231
|
+
const metaValue = React10__namespace.useMemo(
|
|
1226
1232
|
() => meta,
|
|
1227
1233
|
[meta.isLoading, meta.isEmpty, meta.selectedRowCount, meta.totalRows, meta.density]
|
|
1228
1234
|
);
|
|
1229
|
-
const densityValue =
|
|
1235
|
+
const densityValue = React10__namespace.useMemo(
|
|
1230
1236
|
() => ({ density, setDensity }),
|
|
1231
1237
|
[density, setDensity]
|
|
1232
1238
|
);
|
|
1233
|
-
const paginationValue =
|
|
1234
|
-
() => {
|
|
1235
|
-
console.log("[DataTableProvider] creating paginationValue", { pageIndex, pageSize });
|
|
1236
|
-
return { pageIndex, pageSize };
|
|
1237
|
-
},
|
|
1239
|
+
const paginationValue = React10__namespace.useMemo(
|
|
1240
|
+
() => ({ pageIndex, pageSize }),
|
|
1238
1241
|
[pageIndex, pageSize]
|
|
1239
1242
|
);
|
|
1240
1243
|
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 }) }) }) });
|
|
1244
|
+
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
1245
|
}
|
|
1243
1246
|
function useDataTable() {
|
|
1244
|
-
const context =
|
|
1247
|
+
const context = React10__namespace.useContext(DataTableInstanceContext);
|
|
1245
1248
|
if (!context) {
|
|
1246
1249
|
throw new Error(
|
|
1247
1250
|
"useDataTable must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -1250,7 +1253,7 @@ function useDataTable() {
|
|
|
1250
1253
|
return context;
|
|
1251
1254
|
}
|
|
1252
1255
|
function useDataTableMeta() {
|
|
1253
|
-
const context =
|
|
1256
|
+
const context = React10__namespace.useContext(DataTableMetaContext);
|
|
1254
1257
|
if (!context) {
|
|
1255
1258
|
throw new Error(
|
|
1256
1259
|
"useDataTableMeta must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -1268,12 +1271,12 @@ function useDataTableEmpty() {
|
|
|
1268
1271
|
}
|
|
1269
1272
|
function useDataTableSelection() {
|
|
1270
1273
|
const table = useDataTable();
|
|
1271
|
-
return
|
|
1274
|
+
return React10__namespace.useMemo(() => {
|
|
1272
1275
|
return table.getSelectedRowModel().rows.map((row) => row.original);
|
|
1273
1276
|
}, [table.getSelectedRowModel().rows]);
|
|
1274
1277
|
}
|
|
1275
1278
|
function useDataTableDensity() {
|
|
1276
|
-
const context =
|
|
1279
|
+
const context = React10__namespace.useContext(DataTableDensityContext);
|
|
1277
1280
|
if (!context) {
|
|
1278
1281
|
throw new Error(
|
|
1279
1282
|
"useDataTableDensity must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -1282,7 +1285,7 @@ function useDataTableDensity() {
|
|
|
1282
1285
|
return context;
|
|
1283
1286
|
}
|
|
1284
1287
|
function useDataTablePaginationContext() {
|
|
1285
|
-
const context =
|
|
1288
|
+
const context = React10__namespace.useContext(DataTablePaginationContext);
|
|
1286
1289
|
if (!context) {
|
|
1287
1290
|
throw new Error(
|
|
1288
1291
|
"useDataTablePagination must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -1293,7 +1296,7 @@ function useDataTablePaginationContext() {
|
|
|
1293
1296
|
function useDataTablePagination() {
|
|
1294
1297
|
const table = useDataTable();
|
|
1295
1298
|
const { pageIndex, pageSize } = useDataTablePaginationContext();
|
|
1296
|
-
return
|
|
1299
|
+
return React10__namespace.useMemo(() => {
|
|
1297
1300
|
const pageCount = table.getPageCount();
|
|
1298
1301
|
return {
|
|
1299
1302
|
pageIndex,
|
|
@@ -1313,7 +1316,7 @@ function useDataTablePagination() {
|
|
|
1313
1316
|
function useDataTableSorting() {
|
|
1314
1317
|
const table = useDataTable();
|
|
1315
1318
|
const sorting = table.getState().sorting;
|
|
1316
|
-
return
|
|
1319
|
+
return React10__namespace.useMemo(() => ({
|
|
1317
1320
|
sorting,
|
|
1318
1321
|
setSorting: table.setSorting,
|
|
1319
1322
|
clearSorting: () => table.resetSorting(),
|
|
@@ -1326,7 +1329,7 @@ function useDataTableSorting() {
|
|
|
1326
1329
|
function useDataTableColumnVisibility() {
|
|
1327
1330
|
const table = useDataTable();
|
|
1328
1331
|
const columnVisibility = table.getState().columnVisibility;
|
|
1329
|
-
return
|
|
1332
|
+
return React10__namespace.useMemo(() => ({
|
|
1330
1333
|
columnVisibility,
|
|
1331
1334
|
setColumnVisibility: table.setColumnVisibility,
|
|
1332
1335
|
toggleColumn: (columnId) => {
|
|
@@ -1336,6 +1339,15 @@ function useDataTableColumnVisibility() {
|
|
|
1336
1339
|
getAllColumns: () => table.getAllColumns().filter((col) => col.getCanHide())
|
|
1337
1340
|
}), [table, columnVisibility]);
|
|
1338
1341
|
}
|
|
1342
|
+
function useDataTableEmptyStateConfig() {
|
|
1343
|
+
const context = React10__namespace.useContext(DataTableEmptyStateConfigContext);
|
|
1344
|
+
if (!context) {
|
|
1345
|
+
throw new Error(
|
|
1346
|
+
"useDataTableEmptyStateConfig must be used within <DataTable>."
|
|
1347
|
+
);
|
|
1348
|
+
}
|
|
1349
|
+
return context;
|
|
1350
|
+
}
|
|
1339
1351
|
var useDataTableInstance = useDataTable;
|
|
1340
1352
|
var useDataTableState = useDataTableMeta;
|
|
1341
1353
|
function DataTableRoot({
|
|
@@ -1394,7 +1406,7 @@ var DENSITY_CONFIG = {
|
|
|
1394
1406
|
padding: "py-3 px-4"
|
|
1395
1407
|
}
|
|
1396
1408
|
};
|
|
1397
|
-
var Table =
|
|
1409
|
+
var Table = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1398
1410
|
"table",
|
|
1399
1411
|
{
|
|
1400
1412
|
ref,
|
|
@@ -1403,9 +1415,9 @@ var Table = React49__namespace.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
1403
1415
|
}
|
|
1404
1416
|
) }));
|
|
1405
1417
|
Table.displayName = "Table";
|
|
1406
|
-
var TableHeader =
|
|
1418
|
+
var TableHeader = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
1407
1419
|
TableHeader.displayName = "TableHeader";
|
|
1408
|
-
var TableBody =
|
|
1420
|
+
var TableBody = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1409
1421
|
"tbody",
|
|
1410
1422
|
{
|
|
1411
1423
|
ref,
|
|
@@ -1414,7 +1426,7 @@ var TableBody = React49__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
1414
1426
|
}
|
|
1415
1427
|
));
|
|
1416
1428
|
TableBody.displayName = "TableBody";
|
|
1417
|
-
var TableFooter =
|
|
1429
|
+
var TableFooter = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1418
1430
|
"tfoot",
|
|
1419
1431
|
{
|
|
1420
1432
|
ref,
|
|
@@ -1426,8 +1438,8 @@ var TableFooter = React49__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
1426
1438
|
}
|
|
1427
1439
|
));
|
|
1428
1440
|
TableFooter.displayName = "TableFooter";
|
|
1429
|
-
var TableRow =
|
|
1430
|
-
|
|
1441
|
+
var TableRow = React10__namespace.memo(
|
|
1442
|
+
React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1431
1443
|
"tr",
|
|
1432
1444
|
{
|
|
1433
1445
|
ref,
|
|
@@ -1440,7 +1452,7 @@ var TableRow = React49__namespace.memo(
|
|
|
1440
1452
|
))
|
|
1441
1453
|
);
|
|
1442
1454
|
TableRow.displayName = "TableRow";
|
|
1443
|
-
var TableHead =
|
|
1455
|
+
var TableHead = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1444
1456
|
"th",
|
|
1445
1457
|
{
|
|
1446
1458
|
ref,
|
|
@@ -1452,8 +1464,8 @@ var TableHead = React49__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
1452
1464
|
}
|
|
1453
1465
|
));
|
|
1454
1466
|
TableHead.displayName = "TableHead";
|
|
1455
|
-
var TableCell =
|
|
1456
|
-
|
|
1467
|
+
var TableCell = React10__namespace.memo(
|
|
1468
|
+
React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1457
1469
|
"td",
|
|
1458
1470
|
{
|
|
1459
1471
|
ref,
|
|
@@ -1463,7 +1475,7 @@ var TableCell = React49__namespace.memo(
|
|
|
1463
1475
|
))
|
|
1464
1476
|
);
|
|
1465
1477
|
TableCell.displayName = "TableCell";
|
|
1466
|
-
var TableCaption =
|
|
1478
|
+
var TableCaption = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1467
1479
|
"caption",
|
|
1468
1480
|
{
|
|
1469
1481
|
ref,
|
|
@@ -1472,7 +1484,7 @@ var TableCaption = React49__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
1472
1484
|
}
|
|
1473
1485
|
));
|
|
1474
1486
|
TableCaption.displayName = "TableCaption";
|
|
1475
|
-
var DataTableContent =
|
|
1487
|
+
var DataTableContent = React10__namespace.memo(function DataTableContent2({
|
|
1476
1488
|
stickyHeader = false,
|
|
1477
1489
|
stripedRows = false,
|
|
1478
1490
|
highlightOnHover = true,
|
|
@@ -1481,8 +1493,21 @@ var DataTableContent = React49__namespace.memo(function DataTableContent2({
|
|
|
1481
1493
|
const table = useDataTable();
|
|
1482
1494
|
const { isEmpty } = useDataTableMeta();
|
|
1483
1495
|
const { density } = useDataTableDensity();
|
|
1496
|
+
const { config: emptyStateConfig } = useDataTableEmptyStateConfig();
|
|
1484
1497
|
const densityStyles = DENSITY_CONFIG[density];
|
|
1485
1498
|
const cellClasses = cn(densityStyles.padding, densityStyles.fontSize);
|
|
1499
|
+
const hasRows = table.getRowModel().rows?.length > 0;
|
|
1500
|
+
if (!hasRows && isEmpty) {
|
|
1501
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1502
|
+
EmptyState,
|
|
1503
|
+
{
|
|
1504
|
+
message: emptyStateConfig.title,
|
|
1505
|
+
description: emptyStateConfig.description,
|
|
1506
|
+
icon: emptyStateConfig.icon,
|
|
1507
|
+
animated: false
|
|
1508
|
+
}
|
|
1509
|
+
);
|
|
1510
|
+
}
|
|
1486
1511
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("rounded-md border overflow-auto", className), children: /* @__PURE__ */ jsxRuntime.jsxs(Table, { children: [
|
|
1487
1512
|
/* @__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
1513
|
TableHead,
|
|
@@ -1496,7 +1521,7 @@ var DataTableContent = React49__namespace.memo(function DataTableContent2({
|
|
|
1496
1521
|
},
|
|
1497
1522
|
header.id
|
|
1498
1523
|
)) }, headerGroup.id)) }),
|
|
1499
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: table.getRowModel().rows
|
|
1524
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: table.getRowModel().rows.map((row, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1500
1525
|
TableRow,
|
|
1501
1526
|
{
|
|
1502
1527
|
"data-state": row.getIsSelected() && "selected",
|
|
@@ -1507,26 +1532,19 @@ var DataTableContent = React49__namespace.memo(function DataTableContent2({
|
|
|
1507
1532
|
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: cellClasses, children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
|
|
1508
1533
|
},
|
|
1509
1534
|
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
|
-
) }) })
|
|
1535
|
+
)) })
|
|
1518
1536
|
] }) });
|
|
1519
1537
|
});
|
|
1520
1538
|
DataTableContent.displayName = "DataTable.Content";
|
|
1521
|
-
var DataTableToolbar =
|
|
1539
|
+
var DataTableToolbar = React10__namespace.memo(function DataTableToolbar2({
|
|
1522
1540
|
className,
|
|
1523
1541
|
children
|
|
1524
1542
|
}) {
|
|
1525
1543
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex items-center justify-between gap-2", className), children });
|
|
1526
1544
|
});
|
|
1527
1545
|
function useDebounce(value, delay = 300) {
|
|
1528
|
-
const [debouncedValue, setDebouncedValue] =
|
|
1529
|
-
|
|
1546
|
+
const [debouncedValue, setDebouncedValue] = React10__namespace.useState(value);
|
|
1547
|
+
React10__namespace.useEffect(() => {
|
|
1530
1548
|
const handler = setTimeout(() => {
|
|
1531
1549
|
setDebouncedValue(value);
|
|
1532
1550
|
}, delay);
|
|
@@ -1537,12 +1555,12 @@ function useDebounce(value, delay = 300) {
|
|
|
1537
1555
|
return debouncedValue;
|
|
1538
1556
|
}
|
|
1539
1557
|
function useDebouncedCallback(callback, delay = 300) {
|
|
1540
|
-
const callbackRef =
|
|
1541
|
-
const timeoutRef =
|
|
1542
|
-
|
|
1558
|
+
const callbackRef = React10__namespace.useRef(callback);
|
|
1559
|
+
const timeoutRef = React10__namespace.useRef(null);
|
|
1560
|
+
React10__namespace.useEffect(() => {
|
|
1543
1561
|
callbackRef.current = callback;
|
|
1544
1562
|
}, [callback]);
|
|
1545
|
-
return
|
|
1563
|
+
return React10__namespace.useCallback(
|
|
1546
1564
|
(...args) => {
|
|
1547
1565
|
if (timeoutRef.current) {
|
|
1548
1566
|
clearTimeout(timeoutRef.current);
|
|
@@ -1554,7 +1572,7 @@ function useDebouncedCallback(callback, delay = 300) {
|
|
|
1554
1572
|
[delay]
|
|
1555
1573
|
);
|
|
1556
1574
|
}
|
|
1557
|
-
var DataTableSearch =
|
|
1575
|
+
var DataTableSearch = React10__namespace.memo(function DataTableSearch2({
|
|
1558
1576
|
column,
|
|
1559
1577
|
placeholder = "Buscar...",
|
|
1560
1578
|
debounce = 300,
|
|
@@ -1563,17 +1581,17 @@ var DataTableSearch = React49__namespace.memo(function DataTableSearch2({
|
|
|
1563
1581
|
}) {
|
|
1564
1582
|
const table = useDataTableInstance();
|
|
1565
1583
|
const columnInstance = table.getColumn(column);
|
|
1566
|
-
const [value, setValue] =
|
|
1584
|
+
const [value, setValue] = React10__namespace.useState(
|
|
1567
1585
|
columnInstance?.getFilterValue() ?? ""
|
|
1568
1586
|
);
|
|
1569
1587
|
const debouncedValue = useDebounce(value, debounce);
|
|
1570
|
-
|
|
1588
|
+
React10__namespace.useEffect(() => {
|
|
1571
1589
|
columnInstance?.setFilterValue(debouncedValue);
|
|
1572
1590
|
if (onSearch) {
|
|
1573
1591
|
onSearch(debouncedValue);
|
|
1574
1592
|
}
|
|
1575
1593
|
}, [debouncedValue, columnInstance, onSearch]);
|
|
1576
|
-
|
|
1594
|
+
React10__namespace.useEffect(() => {
|
|
1577
1595
|
const filterValue = columnInstance?.getFilterValue() ?? "";
|
|
1578
1596
|
if (filterValue !== value) {
|
|
1579
1597
|
setValue(filterValue);
|
|
@@ -1589,15 +1607,15 @@ var DataTableSearch = React49__namespace.memo(function DataTableSearch2({
|
|
|
1589
1607
|
}
|
|
1590
1608
|
);
|
|
1591
1609
|
});
|
|
1592
|
-
var DataTableFilters =
|
|
1610
|
+
var DataTableFilters = React10__namespace.memo(function DataTableFilters2({
|
|
1593
1611
|
onChange,
|
|
1594
1612
|
className,
|
|
1595
1613
|
children
|
|
1596
1614
|
}) {
|
|
1597
1615
|
const table = useDataTableInstance();
|
|
1598
1616
|
const filters = table.getState().columnFilters;
|
|
1599
|
-
const filtersRef =
|
|
1600
|
-
|
|
1617
|
+
const filtersRef = React10__namespace.useRef(filters);
|
|
1618
|
+
React10__namespace.useEffect(() => {
|
|
1601
1619
|
if (onChange && JSON.stringify(filters) !== JSON.stringify(filtersRef.current)) {
|
|
1602
1620
|
filtersRef.current = filters;
|
|
1603
1621
|
onChange(filters);
|
|
@@ -1605,7 +1623,7 @@ var DataTableFilters = React49__namespace.memo(function DataTableFilters2({
|
|
|
1605
1623
|
}, [filters, onChange]);
|
|
1606
1624
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex gap-2", className), children });
|
|
1607
1625
|
});
|
|
1608
|
-
var DataTableFilter =
|
|
1626
|
+
var DataTableFilter = React10__namespace.memo(function DataTableFilter2({
|
|
1609
1627
|
column: columnId,
|
|
1610
1628
|
title,
|
|
1611
1629
|
options,
|
|
@@ -1615,7 +1633,7 @@ var DataTableFilter = React49__namespace.memo(function DataTableFilter2({
|
|
|
1615
1633
|
const column = table.getColumn(columnId);
|
|
1616
1634
|
const filterValue = column?.getFilterValue() ?? [];
|
|
1617
1635
|
const currentValue = filterValue.length > 0 ? filterValue[0] : "all";
|
|
1618
|
-
const handleValueChange =
|
|
1636
|
+
const handleValueChange = React10__namespace.useCallback(
|
|
1619
1637
|
(value) => {
|
|
1620
1638
|
if (value === "all") {
|
|
1621
1639
|
column?.setFilterValue(void 0);
|
|
@@ -1640,7 +1658,7 @@ var DataTableFilter = React49__namespace.memo(function DataTableFilter2({
|
|
|
1640
1658
|
}
|
|
1641
1659
|
);
|
|
1642
1660
|
});
|
|
1643
|
-
var DataTablePagination =
|
|
1661
|
+
var DataTablePagination = React10__namespace.memo(function DataTablePagination2({
|
|
1644
1662
|
mode = "client",
|
|
1645
1663
|
pageCount: externalPageCount,
|
|
1646
1664
|
pageSizes = [10, 20, 30, 50],
|
|
@@ -1669,7 +1687,7 @@ var DataTablePagination = React49__namespace.memo(function DataTablePagination2(
|
|
|
1669
1687
|
const pageCount = mode === "server" && externalPageCount !== void 0 ? externalPageCount : internalPageCount;
|
|
1670
1688
|
const canGoPrevious = pageIndex > 0;
|
|
1671
1689
|
const canGoNext = pageIndex < pageCount - 1;
|
|
1672
|
-
const handlePageSizeChange =
|
|
1690
|
+
const handlePageSizeChange = React10__namespace.useCallback(
|
|
1673
1691
|
(value) => {
|
|
1674
1692
|
setPageSize(Number(value));
|
|
1675
1693
|
},
|
|
@@ -1772,47 +1790,20 @@ var DataTablePagination = React49__namespace.memo(function DataTablePagination2(
|
|
|
1772
1790
|
);
|
|
1773
1791
|
});
|
|
1774
1792
|
DataTablePagination.displayName = "DataTable.Pagination";
|
|
1775
|
-
var DataTableEmptyState =
|
|
1776
|
-
|
|
1793
|
+
var DataTableEmptyState = React10__namespace.memo(function DataTableEmptyState2({
|
|
1794
|
+
title,
|
|
1777
1795
|
description,
|
|
1778
1796
|
icon,
|
|
1779
|
-
action
|
|
1780
|
-
className
|
|
1797
|
+
action
|
|
1781
1798
|
}) {
|
|
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
|
-
);
|
|
1799
|
+
const { setConfig } = useDataTableEmptyStateConfig();
|
|
1800
|
+
React10__namespace.useLayoutEffect(() => {
|
|
1801
|
+
setConfig({ title, description, icon, action });
|
|
1802
|
+
return () => setConfig({});
|
|
1803
|
+
}, [title, description, icon, action, setConfig]);
|
|
1804
|
+
return null;
|
|
1815
1805
|
});
|
|
1806
|
+
DataTableEmptyState.displayName = "DataTable.EmptyState";
|
|
1816
1807
|
function SkeletonRow({ columns }) {
|
|
1817
1808
|
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
1809
|
}
|
|
@@ -1896,8 +1887,8 @@ var iconSizeMap = {
|
|
|
1896
1887
|
md: "h-4 w-4",
|
|
1897
1888
|
lg: "h-5 w-5"
|
|
1898
1889
|
};
|
|
1899
|
-
var Checkbox =
|
|
1900
|
-
|
|
1890
|
+
var Checkbox = React10__namespace.memo(
|
|
1891
|
+
React10__namespace.forwardRef(({ className, variant, size = "md", ...props }, ref) => {
|
|
1901
1892
|
const iconSize = iconSizeMap[size || "md"];
|
|
1902
1893
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1903
1894
|
CheckboxPrimitive__namespace.Root,
|
|
@@ -1921,9 +1912,9 @@ function DataTableColumnVisibility({
|
|
|
1921
1912
|
className
|
|
1922
1913
|
}) {
|
|
1923
1914
|
const table = useDataTable();
|
|
1924
|
-
const [open, setOpen] =
|
|
1925
|
-
const dropdownRef =
|
|
1926
|
-
|
|
1915
|
+
const [open, setOpen] = React10__namespace.useState(false);
|
|
1916
|
+
const dropdownRef = React10__namespace.useRef(null);
|
|
1917
|
+
React10__namespace.useEffect(() => {
|
|
1927
1918
|
function handleClickOutside(event) {
|
|
1928
1919
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1929
1920
|
setOpen(false);
|
|
@@ -2002,9 +1993,9 @@ function DataTableDensityToggle({
|
|
|
2002
1993
|
className
|
|
2003
1994
|
}) {
|
|
2004
1995
|
const { density, setDensity } = useDataTableDensity();
|
|
2005
|
-
const [open, setOpen] =
|
|
2006
|
-
const dropdownRef =
|
|
2007
|
-
|
|
1996
|
+
const [open, setOpen] = React10__namespace.useState(false);
|
|
1997
|
+
const dropdownRef = React10__namespace.useRef(null);
|
|
1998
|
+
React10__namespace.useEffect(() => {
|
|
2008
1999
|
function handleClickOutside(event) {
|
|
2009
2000
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
2010
2001
|
setOpen(false);
|
|
@@ -2183,9 +2174,9 @@ function DataTableExport({
|
|
|
2183
2174
|
className
|
|
2184
2175
|
}) {
|
|
2185
2176
|
const table = useDataTable();
|
|
2186
|
-
const [open, setOpen] =
|
|
2187
|
-
const dropdownRef =
|
|
2188
|
-
|
|
2177
|
+
const [open, setOpen] = React10__namespace.useState(false);
|
|
2178
|
+
const dropdownRef = React10__namespace.useRef(null);
|
|
2179
|
+
React10__namespace.useEffect(() => {
|
|
2189
2180
|
function handleClickOutside(event) {
|
|
2190
2181
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
2191
2182
|
setOpen(false);
|
|
@@ -2196,7 +2187,7 @@ function DataTableExport({
|
|
|
2196
2187
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
2197
2188
|
}
|
|
2198
2189
|
}, [open]);
|
|
2199
|
-
const handleExport =
|
|
2190
|
+
const handleExport = React10__namespace.useCallback((format) => {
|
|
2200
2191
|
const visibleColumns = table.getVisibleLeafColumns();
|
|
2201
2192
|
const rows = table.getFilteredRowModel().rows;
|
|
2202
2193
|
const headers = [];
|
|
@@ -2299,7 +2290,7 @@ function DataTableTabs({
|
|
|
2299
2290
|
onValueChange,
|
|
2300
2291
|
className
|
|
2301
2292
|
}) {
|
|
2302
|
-
const [internalValue, setInternalValue] =
|
|
2293
|
+
const [internalValue, setInternalValue] = React10__namespace.useState(defaultValue ?? tabs[0]?.value);
|
|
2303
2294
|
const activeValue = value ?? internalValue;
|
|
2304
2295
|
const handleTabClick = (tabValue) => {
|
|
2305
2296
|
if (value === void 0) {
|
|
@@ -2386,8 +2377,8 @@ var Dialog = DialogPrimitive__namespace.Root;
|
|
|
2386
2377
|
var DialogTrigger = DialogPrimitive__namespace.Trigger;
|
|
2387
2378
|
var DialogPortal = DialogPrimitive__namespace.Portal;
|
|
2388
2379
|
var DialogClose = DialogPrimitive__namespace.Close;
|
|
2389
|
-
var DialogOverlay =
|
|
2390
|
-
|
|
2380
|
+
var DialogOverlay = React10__namespace.memo(
|
|
2381
|
+
React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2391
2382
|
DialogPrimitive__namespace.Overlay,
|
|
2392
2383
|
{
|
|
2393
2384
|
ref,
|
|
@@ -2434,8 +2425,8 @@ var dialogContentVariants = classVarianceAuthority.cva(
|
|
|
2434
2425
|
}
|
|
2435
2426
|
}
|
|
2436
2427
|
);
|
|
2437
|
-
var DialogContent =
|
|
2438
|
-
|
|
2428
|
+
var DialogContent = React10__namespace.memo(
|
|
2429
|
+
React10__namespace.forwardRef(({ className, children, showCloseButton = true, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
|
|
2439
2430
|
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
|
|
2440
2431
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2441
2432
|
DialogPrimitive__namespace.Content,
|
|
@@ -2455,7 +2446,7 @@ var DialogContent = React49__namespace.memo(
|
|
|
2455
2446
|
] }))
|
|
2456
2447
|
);
|
|
2457
2448
|
DialogContent.displayName = DialogPrimitive__namespace.Content.displayName;
|
|
2458
|
-
var DialogHeader =
|
|
2449
|
+
var DialogHeader = React10__namespace.memo(
|
|
2459
2450
|
({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2460
2451
|
"div",
|
|
2461
2452
|
{
|
|
@@ -2468,7 +2459,7 @@ var DialogHeader = React49__namespace.memo(
|
|
|
2468
2459
|
)
|
|
2469
2460
|
);
|
|
2470
2461
|
DialogHeader.displayName = "DialogHeader";
|
|
2471
|
-
var DialogFooter =
|
|
2462
|
+
var DialogFooter = React10__namespace.memo(
|
|
2472
2463
|
({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2473
2464
|
"div",
|
|
2474
2465
|
{
|
|
@@ -2481,8 +2472,8 @@ var DialogFooter = React49__namespace.memo(
|
|
|
2481
2472
|
)
|
|
2482
2473
|
);
|
|
2483
2474
|
DialogFooter.displayName = "DialogFooter";
|
|
2484
|
-
var DialogTitle =
|
|
2485
|
-
|
|
2475
|
+
var DialogTitle = React10__namespace.memo(
|
|
2476
|
+
React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2486
2477
|
DialogPrimitive__namespace.Title,
|
|
2487
2478
|
{
|
|
2488
2479
|
ref,
|
|
@@ -2495,8 +2486,8 @@ var DialogTitle = React49__namespace.memo(
|
|
|
2495
2486
|
))
|
|
2496
2487
|
);
|
|
2497
2488
|
DialogTitle.displayName = DialogPrimitive__namespace.Title.displayName;
|
|
2498
|
-
var DialogDescription =
|
|
2499
|
-
|
|
2489
|
+
var DialogDescription = React10__namespace.memo(
|
|
2490
|
+
React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2500
2491
|
DialogPrimitive__namespace.Description,
|
|
2501
2492
|
{
|
|
2502
2493
|
ref,
|
|
@@ -2506,7 +2497,7 @@ var DialogDescription = React49__namespace.memo(
|
|
|
2506
2497
|
))
|
|
2507
2498
|
);
|
|
2508
2499
|
DialogDescription.displayName = DialogPrimitive__namespace.Description.displayName;
|
|
2509
|
-
var DialogBody =
|
|
2500
|
+
var DialogBody = React10__namespace.memo(
|
|
2510
2501
|
({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1 overflow-y-auto py-2", className), ...props })
|
|
2511
2502
|
);
|
|
2512
2503
|
DialogBody.displayName = "DialogBody";
|
|
@@ -2537,7 +2528,7 @@ var COLOR_MAP = {
|
|
|
2537
2528
|
accent: "border-accent",
|
|
2538
2529
|
muted: "border-muted"
|
|
2539
2530
|
};
|
|
2540
|
-
var RippleRing =
|
|
2531
|
+
var RippleRing = React10__namespace.memo(({ size, color, opacity }) => {
|
|
2541
2532
|
const borderColorClass = COLOR_MAP[color] || COLOR_MAP.primary;
|
|
2542
2533
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2543
2534
|
"div",
|
|
@@ -2556,7 +2547,7 @@ var RippleRing = React49__namespace.memo(({ size, color, opacity }) => {
|
|
|
2556
2547
|
);
|
|
2557
2548
|
});
|
|
2558
2549
|
RippleRing.displayName = "RippleRing";
|
|
2559
|
-
var RippleEffect =
|
|
2550
|
+
var RippleEffect = React10__namespace.memo(
|
|
2560
2551
|
({
|
|
2561
2552
|
size = "md",
|
|
2562
2553
|
color = "primary",
|
|
@@ -2568,7 +2559,7 @@ var RippleEffect = React49__namespace.memo(
|
|
|
2568
2559
|
const { base, increment } = SIZE_CONFIG[size];
|
|
2569
2560
|
const opacities = INTENSITY_CONFIG[intensity];
|
|
2570
2561
|
const positionClasses = POSITION_CONFIG[position];
|
|
2571
|
-
const rippleRings =
|
|
2562
|
+
const rippleRings = React10__namespace.useMemo(
|
|
2572
2563
|
() => Array.from({ length: rings }).map((_, index) => {
|
|
2573
2564
|
const ringSize = base + increment * (rings - index - 1);
|
|
2574
2565
|
const opacity = opacities[index] || opacities[opacities.length - 1];
|
|
@@ -2598,7 +2589,7 @@ var RippleEffect = React49__namespace.memo(
|
|
|
2598
2589
|
}
|
|
2599
2590
|
);
|
|
2600
2591
|
RippleEffect.displayName = "RippleEffect";
|
|
2601
|
-
var RippleWrapper =
|
|
2592
|
+
var RippleWrapper = React10__namespace.memo(
|
|
2602
2593
|
({ children, rippleProps, className }) => {
|
|
2603
2594
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", className), children: [
|
|
2604
2595
|
rippleProps && /* @__PURE__ */ jsxRuntime.jsx(RippleEffect, { ...rippleProps }),
|
|
@@ -2607,7 +2598,7 @@ var RippleWrapper = React49__namespace.memo(
|
|
|
2607
2598
|
}
|
|
2608
2599
|
);
|
|
2609
2600
|
RippleWrapper.displayName = "RippleWrapper";
|
|
2610
|
-
var RippleBackground =
|
|
2601
|
+
var RippleBackground = React10__namespace.memo(
|
|
2611
2602
|
({ containerClassName, ...rippleProps }) => {
|
|
2612
2603
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2613
2604
|
"div",
|
|
@@ -2673,7 +2664,7 @@ var statusIndicatorVariants = classVarianceAuthority.cva(
|
|
|
2673
2664
|
}
|
|
2674
2665
|
}
|
|
2675
2666
|
);
|
|
2676
|
-
var DialogWrapper =
|
|
2667
|
+
var DialogWrapper = React10__namespace.memo(
|
|
2677
2668
|
({
|
|
2678
2669
|
children,
|
|
2679
2670
|
className,
|
|
@@ -2686,7 +2677,7 @@ var DialogWrapper = React49__namespace.memo(
|
|
|
2686
2677
|
rippleProps,
|
|
2687
2678
|
...props
|
|
2688
2679
|
}) => {
|
|
2689
|
-
const defaultRippleProps =
|
|
2680
|
+
const defaultRippleProps = React10__namespace.useMemo(
|
|
2690
2681
|
() => ({
|
|
2691
2682
|
size: size === "sm" ? "md" : size === "lg" ? "xl" : "lg",
|
|
2692
2683
|
color: variant === "secondary" ? "secondary" : variant === "accent" ? "accent" : "primary",
|
|
@@ -2696,7 +2687,7 @@ var DialogWrapper = React49__namespace.memo(
|
|
|
2696
2687
|
}),
|
|
2697
2688
|
[size, variant, rippleProps]
|
|
2698
2689
|
);
|
|
2699
|
-
const backgroundRippleProps =
|
|
2690
|
+
const backgroundRippleProps = React10__namespace.useMemo(
|
|
2700
2691
|
() => ({
|
|
2701
2692
|
position: "top-right",
|
|
2702
2693
|
size: "xl",
|
|
@@ -2799,7 +2790,7 @@ var Toaster = ({ ...props }) => {
|
|
|
2799
2790
|
}
|
|
2800
2791
|
);
|
|
2801
2792
|
};
|
|
2802
|
-
var CustomToast =
|
|
2793
|
+
var CustomToast = React10__namespace.memo(
|
|
2803
2794
|
({ title, description, variant = "default", action, onClose }) => {
|
|
2804
2795
|
const variantStyles = toastVariants[variant];
|
|
2805
2796
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2935,8 +2926,8 @@ var thumbVariants = classVarianceAuthority.cva(
|
|
|
2935
2926
|
}
|
|
2936
2927
|
}
|
|
2937
2928
|
);
|
|
2938
|
-
var Switch =
|
|
2939
|
-
|
|
2929
|
+
var Switch = React10__namespace.memo(
|
|
2930
|
+
React10__namespace.forwardRef(({ className, variant, size = "md", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2940
2931
|
SwitchPrimitives__namespace.Root,
|
|
2941
2932
|
{
|
|
2942
2933
|
className: cn(switchVariants({ variant, size, className })),
|
|
@@ -2967,8 +2958,8 @@ var textareaVariants = classVarianceAuthority.cva(
|
|
|
2967
2958
|
}
|
|
2968
2959
|
}
|
|
2969
2960
|
);
|
|
2970
|
-
var Textarea =
|
|
2971
|
-
|
|
2961
|
+
var Textarea = React10__namespace.memo(
|
|
2962
|
+
React10__namespace.forwardRef(
|
|
2972
2963
|
({
|
|
2973
2964
|
className,
|
|
2974
2965
|
variant,
|
|
@@ -2983,12 +2974,12 @@ var Textarea = React49__namespace.memo(
|
|
|
2983
2974
|
onChange,
|
|
2984
2975
|
...props
|
|
2985
2976
|
}, ref) => {
|
|
2986
|
-
const textareaRef =
|
|
2987
|
-
|
|
2988
|
-
const focusTextarea =
|
|
2977
|
+
const textareaRef = React10__namespace.useRef(null);
|
|
2978
|
+
React10__namespace.useImperativeHandle(ref, () => textareaRef.current, []);
|
|
2979
|
+
const focusTextarea = React10__namespace.useCallback(() => {
|
|
2989
2980
|
textareaRef.current?.focus();
|
|
2990
2981
|
}, []);
|
|
2991
|
-
const handleChange =
|
|
2982
|
+
const handleChange = React10__namespace.useCallback(
|
|
2992
2983
|
(e) => {
|
|
2993
2984
|
if (autoResize && textareaRef.current) {
|
|
2994
2985
|
textareaRef.current.style.height = "auto";
|
|
@@ -2998,7 +2989,7 @@ var Textarea = React49__namespace.memo(
|
|
|
2998
2989
|
},
|
|
2999
2990
|
[autoResize, onChange]
|
|
3000
2991
|
);
|
|
3001
|
-
|
|
2992
|
+
React10__namespace.useEffect(() => {
|
|
3002
2993
|
if (autoResize && textareaRef.current) {
|
|
3003
2994
|
textareaRef.current.style.height = "auto";
|
|
3004
2995
|
textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;
|
|
@@ -3049,23 +3040,23 @@ var Textarea = React49__namespace.memo(
|
|
|
3049
3040
|
)
|
|
3050
3041
|
);
|
|
3051
3042
|
Textarea.displayName = "Textarea";
|
|
3052
|
-
var FormFieldContext =
|
|
3043
|
+
var FormFieldContext = React10__namespace.createContext(null);
|
|
3053
3044
|
function useFormFieldContext() {
|
|
3054
|
-
const context =
|
|
3045
|
+
const context = React10__namespace.useContext(FormFieldContext);
|
|
3055
3046
|
if (!context) {
|
|
3056
3047
|
throw new Error("useFormFieldContext must be used within a Form.Field");
|
|
3057
3048
|
}
|
|
3058
3049
|
return context;
|
|
3059
3050
|
}
|
|
3060
3051
|
function useFormFieldContextOptional() {
|
|
3061
|
-
return
|
|
3052
|
+
return React10__namespace.useContext(FormFieldContext);
|
|
3062
3053
|
}
|
|
3063
3054
|
function FormFieldProvider({ name, children }) {
|
|
3064
3055
|
const form = reactHookForm.useFormContext();
|
|
3065
|
-
const id =
|
|
3056
|
+
const id = React10__namespace.useId();
|
|
3066
3057
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3067
3058
|
const error = fieldState.error?.message;
|
|
3068
|
-
const value =
|
|
3059
|
+
const value = React10__namespace.useMemo(
|
|
3069
3060
|
() => ({
|
|
3070
3061
|
name,
|
|
3071
3062
|
id,
|
|
@@ -3173,7 +3164,7 @@ function FormInput({
|
|
|
3173
3164
|
const form = reactHookForm.useFormContext();
|
|
3174
3165
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3175
3166
|
const error = fieldState.error?.message;
|
|
3176
|
-
const getInputType =
|
|
3167
|
+
const getInputType = React10__namespace.useCallback(() => {
|
|
3177
3168
|
if (["money", "percent", "phone", "cpf", "cnpj", "cep"].includes(mask || "")) {
|
|
3178
3169
|
return "tel";
|
|
3179
3170
|
}
|
|
@@ -3369,7 +3360,7 @@ function FormCheckbox({
|
|
|
3369
3360
|
const form = reactHookForm.useFormContext();
|
|
3370
3361
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3371
3362
|
const error = fieldState.error?.message;
|
|
3372
|
-
const id =
|
|
3363
|
+
const id = React10__namespace.useId();
|
|
3373
3364
|
return /* @__PURE__ */ jsxRuntime.jsx(FormFieldProvider, { name, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3374
3365
|
reactHookForm.Controller,
|
|
3375
3366
|
{
|
|
@@ -3424,7 +3415,7 @@ function FormSwitch({
|
|
|
3424
3415
|
const form = reactHookForm.useFormContext();
|
|
3425
3416
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3426
3417
|
const error = fieldState.error?.message;
|
|
3427
|
-
const id =
|
|
3418
|
+
const id = React10__namespace.useId();
|
|
3428
3419
|
return /* @__PURE__ */ jsxRuntime.jsx(FormFieldProvider, { name, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3429
3420
|
reactHookForm.Controller,
|
|
3430
3421
|
{
|
|
@@ -3591,7 +3582,7 @@ function FormRadioGroup({
|
|
|
3591
3582
|
) });
|
|
3592
3583
|
}
|
|
3593
3584
|
FormRadioGroup.displayName = "Form.RadioGroup";
|
|
3594
|
-
var FormLabel =
|
|
3585
|
+
var FormLabel = React10__namespace.forwardRef(
|
|
3595
3586
|
({ className, required, children, ...props }, ref) => {
|
|
3596
3587
|
const fieldContext = useFormFieldContextOptional();
|
|
3597
3588
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3614,7 +3605,7 @@ var FormLabel = React49__namespace.forwardRef(
|
|
|
3614
3605
|
}
|
|
3615
3606
|
);
|
|
3616
3607
|
FormLabel.displayName = "Form.Label";
|
|
3617
|
-
var FormDescription =
|
|
3608
|
+
var FormDescription = React10__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
3618
3609
|
const fieldContext = useFormFieldContextOptional();
|
|
3619
3610
|
if (fieldContext?.error) {
|
|
3620
3611
|
return null;
|
|
@@ -3629,7 +3620,7 @@ var FormDescription = React49__namespace.forwardRef(({ className, ...props }, re
|
|
|
3629
3620
|
);
|
|
3630
3621
|
});
|
|
3631
3622
|
FormDescription.displayName = "Form.Description";
|
|
3632
|
-
var FormError =
|
|
3623
|
+
var FormError = React10__namespace.forwardRef(
|
|
3633
3624
|
({ className, message, children, ...props }, ref) => {
|
|
3634
3625
|
const fieldContext = useFormFieldContextOptional();
|
|
3635
3626
|
const errorMessage = message ?? fieldContext?.error;
|
|
@@ -3648,7 +3639,7 @@ var FormError = React49__namespace.forwardRef(
|
|
|
3648
3639
|
}
|
|
3649
3640
|
);
|
|
3650
3641
|
FormError.displayName = "Form.Error";
|
|
3651
|
-
var FormFieldWrapper =
|
|
3642
|
+
var FormFieldWrapper = React10__namespace.forwardRef(({ className, label, description, required, error, children, ...props }, ref) => {
|
|
3652
3643
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("space-y-1", className), ...props, children: [
|
|
3653
3644
|
label && /* @__PURE__ */ jsxRuntime.jsx(FormLabel, { required, children: label }),
|
|
3654
3645
|
children,
|
|
@@ -3691,7 +3682,7 @@ var Form = Object.assign(FormRoot, {
|
|
|
3691
3682
|
FieldWrapper: FormFieldWrapper,
|
|
3692
3683
|
Field: FormFieldProvider
|
|
3693
3684
|
});
|
|
3694
|
-
var Avatar =
|
|
3685
|
+
var Avatar = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3695
3686
|
AvatarPrimitive__namespace.Root,
|
|
3696
3687
|
{
|
|
3697
3688
|
ref,
|
|
@@ -3703,7 +3694,7 @@ var Avatar = React49__namespace.forwardRef(({ className, ...props }, ref) => /*
|
|
|
3703
3694
|
}
|
|
3704
3695
|
));
|
|
3705
3696
|
Avatar.displayName = AvatarPrimitive__namespace.Root.displayName;
|
|
3706
|
-
var AvatarImage =
|
|
3697
|
+
var AvatarImage = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3707
3698
|
AvatarPrimitive__namespace.Image,
|
|
3708
3699
|
{
|
|
3709
3700
|
ref,
|
|
@@ -3712,7 +3703,7 @@ var AvatarImage = React49__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
3712
3703
|
}
|
|
3713
3704
|
));
|
|
3714
3705
|
AvatarImage.displayName = AvatarPrimitive__namespace.Image.displayName;
|
|
3715
|
-
var AvatarFallback =
|
|
3706
|
+
var AvatarFallback = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3716
3707
|
AvatarPrimitive__namespace.Fallback,
|
|
3717
3708
|
{
|
|
3718
3709
|
ref,
|
|
@@ -3730,7 +3721,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
|
|
|
3730
3721
|
var DropdownMenuPortal = DropdownMenuPrimitive__namespace.Portal;
|
|
3731
3722
|
var DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
|
|
3732
3723
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
|
|
3733
|
-
var DropdownMenuSubTrigger =
|
|
3724
|
+
var DropdownMenuSubTrigger = React10__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3734
3725
|
DropdownMenuPrimitive__namespace.SubTrigger,
|
|
3735
3726
|
{
|
|
3736
3727
|
ref,
|
|
@@ -3747,7 +3738,7 @@ var DropdownMenuSubTrigger = React49__namespace.forwardRef(({ className, inset,
|
|
|
3747
3738
|
}
|
|
3748
3739
|
));
|
|
3749
3740
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive__namespace.SubTrigger.displayName;
|
|
3750
|
-
var DropdownMenuSubContent =
|
|
3741
|
+
var DropdownMenuSubContent = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3751
3742
|
DropdownMenuPrimitive__namespace.SubContent,
|
|
3752
3743
|
{
|
|
3753
3744
|
ref,
|
|
@@ -3759,7 +3750,7 @@ var DropdownMenuSubContent = React49__namespace.forwardRef(({ className, ...prop
|
|
|
3759
3750
|
}
|
|
3760
3751
|
));
|
|
3761
3752
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive__namespace.SubContent.displayName;
|
|
3762
|
-
var DropdownMenuContent =
|
|
3753
|
+
var DropdownMenuContent = React10__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3763
3754
|
DropdownMenuPrimitive__namespace.Content,
|
|
3764
3755
|
{
|
|
3765
3756
|
ref,
|
|
@@ -3772,7 +3763,7 @@ var DropdownMenuContent = React49__namespace.forwardRef(({ className, sideOffset
|
|
|
3772
3763
|
}
|
|
3773
3764
|
) }));
|
|
3774
3765
|
DropdownMenuContent.displayName = DropdownMenuPrimitive__namespace.Content.displayName;
|
|
3775
|
-
var DropdownMenuItem =
|
|
3766
|
+
var DropdownMenuItem = React10__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3776
3767
|
DropdownMenuPrimitive__namespace.Item,
|
|
3777
3768
|
{
|
|
3778
3769
|
ref,
|
|
@@ -3785,7 +3776,7 @@ var DropdownMenuItem = React49__namespace.forwardRef(({ className, inset, ...pro
|
|
|
3785
3776
|
}
|
|
3786
3777
|
));
|
|
3787
3778
|
DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;
|
|
3788
|
-
var DropdownMenuCheckboxItem =
|
|
3779
|
+
var DropdownMenuCheckboxItem = React10__namespace.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3789
3780
|
DropdownMenuPrimitive__namespace.CheckboxItem,
|
|
3790
3781
|
{
|
|
3791
3782
|
ref,
|
|
@@ -3802,7 +3793,7 @@ var DropdownMenuCheckboxItem = React49__namespace.forwardRef(({ className, child
|
|
|
3802
3793
|
}
|
|
3803
3794
|
));
|
|
3804
3795
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive__namespace.CheckboxItem.displayName;
|
|
3805
|
-
var DropdownMenuRadioItem =
|
|
3796
|
+
var DropdownMenuRadioItem = React10__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3806
3797
|
DropdownMenuPrimitive__namespace.RadioItem,
|
|
3807
3798
|
{
|
|
3808
3799
|
ref,
|
|
@@ -3818,7 +3809,7 @@ var DropdownMenuRadioItem = React49__namespace.forwardRef(({ className, children
|
|
|
3818
3809
|
}
|
|
3819
3810
|
));
|
|
3820
3811
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive__namespace.RadioItem.displayName;
|
|
3821
|
-
var DropdownMenuLabel =
|
|
3812
|
+
var DropdownMenuLabel = React10__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3822
3813
|
DropdownMenuPrimitive__namespace.Label,
|
|
3823
3814
|
{
|
|
3824
3815
|
ref,
|
|
@@ -3831,7 +3822,7 @@ var DropdownMenuLabel = React49__namespace.forwardRef(({ className, inset, ...pr
|
|
|
3831
3822
|
}
|
|
3832
3823
|
));
|
|
3833
3824
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive__namespace.Label.displayName;
|
|
3834
|
-
var DropdownMenuSeparator =
|
|
3825
|
+
var DropdownMenuSeparator = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3835
3826
|
DropdownMenuPrimitive__namespace.Separator,
|
|
3836
3827
|
{
|
|
3837
3828
|
ref,
|
|
@@ -3855,7 +3846,7 @@ var DropdownMenuShortcut = ({
|
|
|
3855
3846
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
3856
3847
|
var Popover = PopoverPrimitive__namespace.Root;
|
|
3857
3848
|
var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
3858
|
-
var PopoverContent =
|
|
3849
|
+
var PopoverContent = React10__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3859
3850
|
PopoverPrimitive__namespace.Content,
|
|
3860
3851
|
{
|
|
3861
3852
|
ref,
|
|
@@ -3873,7 +3864,7 @@ var TooltipProvider = TooltipPrimitive__namespace.Provider;
|
|
|
3873
3864
|
var TooltipRoot = TooltipPrimitive__namespace.Root;
|
|
3874
3865
|
var TooltipTrigger = TooltipPrimitive__namespace.Trigger;
|
|
3875
3866
|
var TooltipPortal = TooltipPrimitive__namespace.Portal;
|
|
3876
|
-
var TooltipArrow =
|
|
3867
|
+
var TooltipArrow = React10__namespace.forwardRef(({ className, variant = "light", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3877
3868
|
TooltipPrimitive__namespace.Arrow,
|
|
3878
3869
|
{
|
|
3879
3870
|
ref,
|
|
@@ -3906,7 +3897,7 @@ var tooltipContentVariants = classVarianceAuthority.cva(
|
|
|
3906
3897
|
}
|
|
3907
3898
|
}
|
|
3908
3899
|
);
|
|
3909
|
-
var TooltipContent =
|
|
3900
|
+
var TooltipContent = React10__namespace.forwardRef(
|
|
3910
3901
|
({
|
|
3911
3902
|
className,
|
|
3912
3903
|
variant = "light",
|
|
@@ -3940,11 +3931,11 @@ var TooltipContent = React49__namespace.forwardRef(
|
|
|
3940
3931
|
) })
|
|
3941
3932
|
);
|
|
3942
3933
|
TooltipContent.displayName = TooltipPrimitive__namespace.Content.displayName;
|
|
3943
|
-
var TooltipHeader =
|
|
3934
|
+
var TooltipHeader = React10__namespace.forwardRef(
|
|
3944
3935
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex flex-col gap-1", className), ...props })
|
|
3945
3936
|
);
|
|
3946
3937
|
TooltipHeader.displayName = "TooltipHeader";
|
|
3947
|
-
var TooltipTitle =
|
|
3938
|
+
var TooltipTitle = React10__namespace.forwardRef(
|
|
3948
3939
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3949
3940
|
"h4",
|
|
3950
3941
|
{
|
|
@@ -3955,7 +3946,7 @@ var TooltipTitle = React49__namespace.forwardRef(
|
|
|
3955
3946
|
)
|
|
3956
3947
|
);
|
|
3957
3948
|
TooltipTitle.displayName = "TooltipTitle";
|
|
3958
|
-
var TooltipDescription =
|
|
3949
|
+
var TooltipDescription = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3959
3950
|
"p",
|
|
3960
3951
|
{
|
|
3961
3952
|
ref,
|
|
@@ -3964,7 +3955,7 @@ var TooltipDescription = React49__namespace.forwardRef(({ className, ...props },
|
|
|
3964
3955
|
}
|
|
3965
3956
|
));
|
|
3966
3957
|
TooltipDescription.displayName = "TooltipDescription";
|
|
3967
|
-
var TooltipActions =
|
|
3958
|
+
var TooltipActions = React10__namespace.forwardRef(
|
|
3968
3959
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3969
3960
|
"div",
|
|
3970
3961
|
{
|
|
@@ -3990,7 +3981,7 @@ var tooltipActionVariants = classVarianceAuthority.cva(
|
|
|
3990
3981
|
}
|
|
3991
3982
|
}
|
|
3992
3983
|
);
|
|
3993
|
-
var TooltipAction =
|
|
3984
|
+
var TooltipAction = React10__namespace.forwardRef(
|
|
3994
3985
|
({ className, variant = "primary", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3995
3986
|
"button",
|
|
3996
3987
|
{
|
|
@@ -4001,7 +3992,7 @@ var TooltipAction = React49__namespace.forwardRef(
|
|
|
4001
3992
|
)
|
|
4002
3993
|
);
|
|
4003
3994
|
TooltipAction.displayName = "TooltipAction";
|
|
4004
|
-
var TooltipIcon =
|
|
3995
|
+
var TooltipIcon = React10__namespace.forwardRef(
|
|
4005
3996
|
({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4006
3997
|
"div",
|
|
4007
3998
|
{
|
|
@@ -4054,14 +4045,14 @@ var Tooltip = Object.assign(TooltipRoot, {
|
|
|
4054
4045
|
Icon: TooltipIcon,
|
|
4055
4046
|
Simple: SimpleTooltip
|
|
4056
4047
|
});
|
|
4057
|
-
var AuthLayoutContext =
|
|
4048
|
+
var AuthLayoutContext = React10__namespace.createContext({
|
|
4058
4049
|
imagePosition: "left"
|
|
4059
4050
|
});
|
|
4060
4051
|
function AuthLayoutRoot({ children, className }) {
|
|
4061
|
-
const [imagePosition, setImagePosition] =
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
if (
|
|
4052
|
+
const [imagePosition, setImagePosition] = React10__namespace.useState("left");
|
|
4053
|
+
React10__namespace.useEffect(() => {
|
|
4054
|
+
React10__namespace.Children.forEach(children, (child) => {
|
|
4055
|
+
if (React10__namespace.isValidElement(child) && child.type === AuthLayoutImage) {
|
|
4065
4056
|
setImagePosition(child.props.position || "left");
|
|
4066
4057
|
}
|
|
4067
4058
|
});
|
|
@@ -4259,7 +4250,7 @@ var AuthLayout = Object.assign(AuthLayoutRoot, {
|
|
|
4259
4250
|
Link: AuthLayoutLink,
|
|
4260
4251
|
Divider: AuthLayoutDivider
|
|
4261
4252
|
});
|
|
4262
|
-
var TabsContext =
|
|
4253
|
+
var TabsContext = React10__namespace.createContext(null);
|
|
4263
4254
|
function SelectionLayoutRoot({ children, className }) {
|
|
4264
4255
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("min-h-screen bg-muted/30 flex flex-col lg:flex-row", className), children });
|
|
4265
4256
|
}
|
|
@@ -4370,7 +4361,7 @@ function SelectionLayoutTab({
|
|
|
4370
4361
|
badge,
|
|
4371
4362
|
className
|
|
4372
4363
|
}) {
|
|
4373
|
-
const context =
|
|
4364
|
+
const context = React10__namespace.useContext(TabsContext);
|
|
4374
4365
|
if (!context) {
|
|
4375
4366
|
throw new Error("SelectionLayout.Tab must be used within SelectionLayout.Tabs");
|
|
4376
4367
|
}
|
|
@@ -4515,17 +4506,17 @@ var SelectionLayout = Object.assign(SelectionLayoutRoot, {
|
|
|
4515
4506
|
Card: SelectionLayoutCard,
|
|
4516
4507
|
Empty: SelectionLayoutEmpty
|
|
4517
4508
|
});
|
|
4518
|
-
var DashboardLayoutContext =
|
|
4509
|
+
var DashboardLayoutContext = React10__namespace.createContext(null);
|
|
4519
4510
|
function useDashboardLayout() {
|
|
4520
|
-
const context =
|
|
4511
|
+
const context = React10__namespace.useContext(DashboardLayoutContext);
|
|
4521
4512
|
if (!context) {
|
|
4522
4513
|
throw new Error("useDashboardLayout must be used within DashboardLayout");
|
|
4523
4514
|
}
|
|
4524
4515
|
return context;
|
|
4525
4516
|
}
|
|
4526
4517
|
function useMediaQuery(query) {
|
|
4527
|
-
const [matches, setMatches] =
|
|
4528
|
-
|
|
4518
|
+
const [matches, setMatches] = React10__namespace.useState(false);
|
|
4519
|
+
React10__namespace.useEffect(() => {
|
|
4529
4520
|
const media = window.matchMedia(query);
|
|
4530
4521
|
if (media.matches !== matches) {
|
|
4531
4522
|
setMatches(media.matches);
|
|
@@ -4542,11 +4533,11 @@ function DashboardLayoutRoot({
|
|
|
4542
4533
|
defaultExpanded = false,
|
|
4543
4534
|
defaultPinned = false
|
|
4544
4535
|
}) {
|
|
4545
|
-
const [sidebarExpanded, setSidebarExpanded] =
|
|
4546
|
-
const [sidebarPinned, setSidebarPinned] =
|
|
4547
|
-
const [mobileMenuOpen, setMobileMenuOpen] =
|
|
4536
|
+
const [sidebarExpanded, setSidebarExpanded] = React10__namespace.useState(defaultExpanded || defaultPinned);
|
|
4537
|
+
const [sidebarPinned, setSidebarPinned] = React10__namespace.useState(defaultPinned);
|
|
4538
|
+
const [mobileMenuOpen, setMobileMenuOpen] = React10__namespace.useState(false);
|
|
4548
4539
|
const isMobile = useMediaQuery("(max-width: 1024px)");
|
|
4549
|
-
|
|
4540
|
+
React10__namespace.useEffect(() => {
|
|
4550
4541
|
if (!isMobile) {
|
|
4551
4542
|
setMobileMenuOpen(false);
|
|
4552
4543
|
}
|
|
@@ -4687,7 +4678,7 @@ function DashboardLayoutSidebarNavItem({
|
|
|
4687
4678
|
};
|
|
4688
4679
|
const renderIcon4 = () => {
|
|
4689
4680
|
if (!icon) return null;
|
|
4690
|
-
if (
|
|
4681
|
+
if (React10__namespace.isValidElement(icon)) {
|
|
4691
4682
|
return icon;
|
|
4692
4683
|
}
|
|
4693
4684
|
if (typeof icon === "function" || typeof icon === "object" && "$$typeof" in icon) {
|
|
@@ -4742,7 +4733,7 @@ function DashboardLayoutSidebarNavGroup({
|
|
|
4742
4733
|
className
|
|
4743
4734
|
}) {
|
|
4744
4735
|
const { sidebarExpanded } = useDashboardLayout();
|
|
4745
|
-
const [isOpen, setIsOpen] =
|
|
4736
|
+
const [isOpen, setIsOpen] = React10__namespace.useState(defaultOpen);
|
|
4746
4737
|
const badgeColors = {
|
|
4747
4738
|
default: "bg-muted text-muted-foreground",
|
|
4748
4739
|
primary: "bg-primary/10 text-primary",
|
|
@@ -4750,7 +4741,7 @@ function DashboardLayoutSidebarNavGroup({
|
|
|
4750
4741
|
};
|
|
4751
4742
|
const renderIcon4 = () => {
|
|
4752
4743
|
if (!icon) return null;
|
|
4753
|
-
if (
|
|
4744
|
+
if (React10__namespace.isValidElement(icon)) {
|
|
4754
4745
|
return icon;
|
|
4755
4746
|
}
|
|
4756
4747
|
if (typeof icon === "function" || typeof icon === "object" && "$$typeof" in icon) {
|
|
@@ -4759,7 +4750,7 @@ function DashboardLayoutSidebarNavGroup({
|
|
|
4759
4750
|
}
|
|
4760
4751
|
return null;
|
|
4761
4752
|
};
|
|
4762
|
-
|
|
4753
|
+
React10__namespace.useEffect(() => {
|
|
4763
4754
|
if (isActive && sidebarExpanded) {
|
|
4764
4755
|
setIsOpen(true);
|
|
4765
4756
|
}
|
|
@@ -4863,7 +4854,7 @@ function DashboardLayoutHeaderUser({
|
|
|
4863
4854
|
children,
|
|
4864
4855
|
onLogout
|
|
4865
4856
|
}) {
|
|
4866
|
-
const [isOpen, setIsOpen] =
|
|
4857
|
+
const [isOpen, setIsOpen] = React10__namespace.useState(false);
|
|
4867
4858
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", className), children: [
|
|
4868
4859
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4869
4860
|
"button",
|
|
@@ -4944,7 +4935,7 @@ function DashboardLayoutBreadcrumbs({
|
|
|
4944
4935
|
return /* @__PURE__ */ jsxRuntime.jsx("nav", { className: cn("flex items-center gap-1 text-sm", className), children: items.map((item, index) => {
|
|
4945
4936
|
const Icon2 = item.icon;
|
|
4946
4937
|
const isLast = index === items.length - 1;
|
|
4947
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4938
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React10__namespace.Fragment, { children: [
|
|
4948
4939
|
item.href && !isLast ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4949
4940
|
"a",
|
|
4950
4941
|
{
|
|
@@ -5047,23 +5038,23 @@ var DashboardLayout = Object.assign(DashboardLayoutRoot, {
|
|
|
5047
5038
|
MobileNav: DashboardLayoutMobileNav,
|
|
5048
5039
|
MobileNavItem: DashboardLayoutMobileNavItem
|
|
5049
5040
|
});
|
|
5050
|
-
var SidebarContext =
|
|
5041
|
+
var SidebarContext = React10__namespace.createContext(null);
|
|
5051
5042
|
function useSidebar() {
|
|
5052
|
-
const context =
|
|
5043
|
+
const context = React10__namespace.useContext(SidebarContext);
|
|
5053
5044
|
if (!context) {
|
|
5054
5045
|
throw new Error("useSidebar must be used within a Sidebar component");
|
|
5055
5046
|
}
|
|
5056
5047
|
return context;
|
|
5057
5048
|
}
|
|
5058
5049
|
function useSidebarOptional() {
|
|
5059
|
-
return
|
|
5050
|
+
return React10__namespace.useContext(SidebarContext);
|
|
5060
5051
|
}
|
|
5061
5052
|
function SidebarProvider({ children, value }) {
|
|
5062
5053
|
return /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value, children });
|
|
5063
5054
|
}
|
|
5064
5055
|
function useMediaQuery2(query) {
|
|
5065
|
-
const [matches, setMatches] =
|
|
5066
|
-
|
|
5056
|
+
const [matches, setMatches] = React10__namespace.useState(false);
|
|
5057
|
+
React10__namespace.useEffect(() => {
|
|
5067
5058
|
if (typeof window === "undefined") return;
|
|
5068
5059
|
const mediaQuery = window.matchMedia(query);
|
|
5069
5060
|
setMatches(mediaQuery.matches);
|
|
@@ -5075,7 +5066,7 @@ function useMediaQuery2(query) {
|
|
|
5075
5066
|
}, [query]);
|
|
5076
5067
|
return matches;
|
|
5077
5068
|
}
|
|
5078
|
-
var SidebarHeader =
|
|
5069
|
+
var SidebarHeader = React10__namespace.memo(function SidebarHeader2({
|
|
5079
5070
|
logo,
|
|
5080
5071
|
collapsedLogo,
|
|
5081
5072
|
title,
|
|
@@ -5083,7 +5074,7 @@ var SidebarHeader = React49__namespace.memo(function SidebarHeader2({
|
|
|
5083
5074
|
className
|
|
5084
5075
|
}) {
|
|
5085
5076
|
const { expanded, pinned, setPinned } = useSidebar();
|
|
5086
|
-
const handleTogglePin =
|
|
5077
|
+
const handleTogglePin = React10__namespace.useCallback(() => {
|
|
5087
5078
|
setPinned(!pinned);
|
|
5088
5079
|
}, [pinned, setPinned]);
|
|
5089
5080
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5158,7 +5149,7 @@ var SidebarHeader = React49__namespace.memo(function SidebarHeader2({
|
|
|
5158
5149
|
);
|
|
5159
5150
|
});
|
|
5160
5151
|
SidebarHeader.displayName = "Sidebar.Header";
|
|
5161
|
-
var SidebarNav =
|
|
5152
|
+
var SidebarNav = React10__namespace.memo(function SidebarNav2({
|
|
5162
5153
|
children,
|
|
5163
5154
|
className
|
|
5164
5155
|
}) {
|
|
@@ -5174,7 +5165,7 @@ var SidebarNav = React49__namespace.memo(function SidebarNav2({
|
|
|
5174
5165
|
);
|
|
5175
5166
|
});
|
|
5176
5167
|
SidebarNav.displayName = "Sidebar.Nav";
|
|
5177
|
-
var SidebarSection =
|
|
5168
|
+
var SidebarSection = React10__namespace.memo(function SidebarSection2({
|
|
5178
5169
|
title,
|
|
5179
5170
|
children,
|
|
5180
5171
|
className
|
|
@@ -5198,8 +5189,8 @@ var SidebarSection = React49__namespace.memo(function SidebarSection2({
|
|
|
5198
5189
|
SidebarSection.displayName = "Sidebar.Section";
|
|
5199
5190
|
function renderIcon(icon, className) {
|
|
5200
5191
|
if (!icon) return null;
|
|
5201
|
-
if (
|
|
5202
|
-
return
|
|
5192
|
+
if (React10__namespace.isValidElement(icon)) {
|
|
5193
|
+
return React10__namespace.cloneElement(icon, { className });
|
|
5203
5194
|
}
|
|
5204
5195
|
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon) {
|
|
5205
5196
|
const IconComponent = icon;
|
|
@@ -5213,7 +5204,7 @@ var badgeVariantStyles = {
|
|
|
5213
5204
|
success: "bg-green-100 text-green-600",
|
|
5214
5205
|
warning: "bg-amber-100 text-amber-600"
|
|
5215
5206
|
};
|
|
5216
|
-
var SidebarNavItem =
|
|
5207
|
+
var SidebarNavItem = React10__namespace.memo(function SidebarNavItem2({
|
|
5217
5208
|
icon,
|
|
5218
5209
|
label,
|
|
5219
5210
|
href,
|
|
@@ -5225,7 +5216,7 @@ var SidebarNavItem = React49__namespace.memo(function SidebarNavItem2({
|
|
|
5225
5216
|
className
|
|
5226
5217
|
}) {
|
|
5227
5218
|
const { expanded } = useSidebar();
|
|
5228
|
-
const handleClick =
|
|
5219
|
+
const handleClick = React10__namespace.useCallback(() => {
|
|
5229
5220
|
if (disabled) return;
|
|
5230
5221
|
if (onClick) {
|
|
5231
5222
|
onClick();
|
|
@@ -5308,8 +5299,8 @@ var SidebarNavItem = React49__namespace.memo(function SidebarNavItem2({
|
|
|
5308
5299
|
SidebarNavItem.displayName = "Sidebar.NavItem";
|
|
5309
5300
|
function renderIcon2(icon, className) {
|
|
5310
5301
|
if (!icon) return null;
|
|
5311
|
-
if (
|
|
5312
|
-
return
|
|
5302
|
+
if (React10__namespace.isValidElement(icon)) {
|
|
5303
|
+
return React10__namespace.cloneElement(icon, { className });
|
|
5313
5304
|
}
|
|
5314
5305
|
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon) {
|
|
5315
5306
|
const IconComponent = icon;
|
|
@@ -5323,7 +5314,7 @@ var badgeVariantStyles2 = {
|
|
|
5323
5314
|
success: "bg-green-100 text-green-600",
|
|
5324
5315
|
warning: "bg-amber-100 text-amber-600"
|
|
5325
5316
|
};
|
|
5326
|
-
var SidebarNavGroup =
|
|
5317
|
+
var SidebarNavGroup = React10__namespace.memo(function SidebarNavGroup2({
|
|
5327
5318
|
icon,
|
|
5328
5319
|
label,
|
|
5329
5320
|
children,
|
|
@@ -5335,10 +5326,10 @@ var SidebarNavGroup = React49__namespace.memo(function SidebarNavGroup2({
|
|
|
5335
5326
|
className
|
|
5336
5327
|
}) {
|
|
5337
5328
|
const { expanded, activeSection, setActiveSection } = useSidebar();
|
|
5338
|
-
const [isOpen, setIsOpen] =
|
|
5329
|
+
const [isOpen, setIsOpen] = React10__namespace.useState(defaultOpen);
|
|
5339
5330
|
const groupId = id || label.toLowerCase().replace(/\s+/g, "-");
|
|
5340
5331
|
const isExpanded = expanded && (activeSection === groupId || isOpen);
|
|
5341
|
-
const handleClick =
|
|
5332
|
+
const handleClick = React10__namespace.useCallback(() => {
|
|
5342
5333
|
if (activeSection === groupId) {
|
|
5343
5334
|
setActiveSection(null);
|
|
5344
5335
|
setIsOpen(false);
|
|
@@ -5347,7 +5338,7 @@ var SidebarNavGroup = React49__namespace.memo(function SidebarNavGroup2({
|
|
|
5347
5338
|
setIsOpen(true);
|
|
5348
5339
|
}
|
|
5349
5340
|
}, [activeSection, groupId, setActiveSection]);
|
|
5350
|
-
|
|
5341
|
+
React10__namespace.useEffect(() => {
|
|
5351
5342
|
if (expanded && isActive && !isOpen) {
|
|
5352
5343
|
setIsOpen(true);
|
|
5353
5344
|
setActiveSection(groupId);
|
|
@@ -5451,18 +5442,18 @@ function isLucideIcon(icon) {
|
|
|
5451
5442
|
function getInitials(name) {
|
|
5452
5443
|
return name.split(" ").map((part) => part.charAt(0)).slice(0, 2).join("").toUpperCase();
|
|
5453
5444
|
}
|
|
5454
|
-
var SidebarFooter =
|
|
5445
|
+
var SidebarFooter = React10__namespace.memo(function SidebarFooter2({
|
|
5455
5446
|
user,
|
|
5456
5447
|
menuItems,
|
|
5457
5448
|
children,
|
|
5458
5449
|
className
|
|
5459
5450
|
}) {
|
|
5460
5451
|
const { expanded } = useSidebar();
|
|
5461
|
-
const [menuOpen, setMenuOpen] =
|
|
5462
|
-
const handleToggleMenu =
|
|
5452
|
+
const [menuOpen, setMenuOpen] = React10__namespace.useState(false);
|
|
5453
|
+
const handleToggleMenu = React10__namespace.useCallback(() => {
|
|
5463
5454
|
setMenuOpen((prev) => !prev);
|
|
5464
5455
|
}, []);
|
|
5465
|
-
|
|
5456
|
+
React10__namespace.useEffect(() => {
|
|
5466
5457
|
if (!menuOpen) return;
|
|
5467
5458
|
const handleClickOutside = (event) => {
|
|
5468
5459
|
const target = event.target;
|
|
@@ -5540,7 +5531,7 @@ var SidebarFooter = React49__namespace.memo(function SidebarFooter2({
|
|
|
5540
5531
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-1", children: menuItems.map((item, index) => {
|
|
5541
5532
|
const IconComponent = item.icon && isLucideIcon(item.icon) ? item.icon : null;
|
|
5542
5533
|
const isDestructive = item.variant === "destructive";
|
|
5543
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5534
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React10__namespace.Fragment, { children: [
|
|
5544
5535
|
isDestructive && index > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 border-t border-border" }),
|
|
5545
5536
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5546
5537
|
"button",
|
|
@@ -5577,17 +5568,17 @@ function SidebarRoot({
|
|
|
5577
5568
|
collapsedWidth = COLLAPSED_WIDTH,
|
|
5578
5569
|
expandedWidth = EXPANDED_WIDTH
|
|
5579
5570
|
}) {
|
|
5580
|
-
const [expanded, setExpanded] =
|
|
5581
|
-
const [pinned, setPinned] =
|
|
5582
|
-
const [activeSection, setActiveSection] =
|
|
5571
|
+
const [expanded, setExpanded] = React10__namespace.useState(defaultExpanded || defaultPinned);
|
|
5572
|
+
const [pinned, setPinned] = React10__namespace.useState(defaultPinned);
|
|
5573
|
+
const [activeSection, setActiveSection] = React10__namespace.useState(null);
|
|
5583
5574
|
const isMobile = useMediaQuery2("(max-width: 768px)");
|
|
5584
|
-
const handleSetPinned =
|
|
5575
|
+
const handleSetPinned = React10__namespace.useCallback((value) => {
|
|
5585
5576
|
setPinned(value);
|
|
5586
5577
|
if (value) {
|
|
5587
5578
|
setExpanded(true);
|
|
5588
5579
|
}
|
|
5589
5580
|
}, []);
|
|
5590
|
-
const contextValue =
|
|
5581
|
+
const contextValue = React10__namespace.useMemo(
|
|
5591
5582
|
() => ({
|
|
5592
5583
|
expanded,
|
|
5593
5584
|
setExpanded,
|
|
@@ -5606,13 +5597,13 @@ function SidebarRoot({
|
|
|
5606
5597
|
SidebarRoot.displayName = "SidebarRoot";
|
|
5607
5598
|
function SidebarAside({ children, className }) {
|
|
5608
5599
|
const { expanded, pinned, setExpanded, isMobile, collapsedWidth, expandedWidth } = useSidebar();
|
|
5609
|
-
const sidebarRef =
|
|
5610
|
-
const handleMouseEnter =
|
|
5600
|
+
const sidebarRef = React10__namespace.useRef(null);
|
|
5601
|
+
const handleMouseEnter = React10__namespace.useCallback(() => {
|
|
5611
5602
|
if (!pinned && !isMobile) {
|
|
5612
5603
|
setExpanded(true);
|
|
5613
5604
|
}
|
|
5614
5605
|
}, [pinned, isMobile, setExpanded]);
|
|
5615
|
-
const handleMouseLeave =
|
|
5606
|
+
const handleMouseLeave = React10__namespace.useCallback(() => {
|
|
5616
5607
|
if (!pinned && !isMobile) {
|
|
5617
5608
|
setExpanded(false);
|
|
5618
5609
|
}
|
|
@@ -5680,28 +5671,28 @@ function LegacySidebar({
|
|
|
5680
5671
|
expandedWidth = EXPANDED_WIDTH,
|
|
5681
5672
|
className
|
|
5682
5673
|
}) {
|
|
5683
|
-
const [expanded, setExpanded] =
|
|
5684
|
-
const [pinned, setPinned] =
|
|
5685
|
-
const [activeSection, setActiveSection] =
|
|
5674
|
+
const [expanded, setExpanded] = React10__namespace.useState(defaultExpanded || defaultPinned);
|
|
5675
|
+
const [pinned, setPinned] = React10__namespace.useState(defaultPinned);
|
|
5676
|
+
const [activeSection, setActiveSection] = React10__namespace.useState(null);
|
|
5686
5677
|
const isMobile = useMediaQuery2("(max-width: 768px)");
|
|
5687
|
-
const sidebarRef =
|
|
5688
|
-
const handleMouseEnter =
|
|
5678
|
+
const sidebarRef = React10__namespace.useRef(null);
|
|
5679
|
+
const handleMouseEnter = React10__namespace.useCallback(() => {
|
|
5689
5680
|
if (!pinned && !isMobile) {
|
|
5690
5681
|
setExpanded(true);
|
|
5691
5682
|
}
|
|
5692
5683
|
}, [pinned, isMobile]);
|
|
5693
|
-
const handleMouseLeave =
|
|
5684
|
+
const handleMouseLeave = React10__namespace.useCallback(() => {
|
|
5694
5685
|
if (!pinned && !isMobile) {
|
|
5695
5686
|
setExpanded(false);
|
|
5696
5687
|
}
|
|
5697
5688
|
}, [pinned, isMobile]);
|
|
5698
|
-
const handleSetPinned =
|
|
5689
|
+
const handleSetPinned = React10__namespace.useCallback((value) => {
|
|
5699
5690
|
setPinned(value);
|
|
5700
5691
|
if (value) {
|
|
5701
5692
|
setExpanded(true);
|
|
5702
5693
|
}
|
|
5703
5694
|
}, []);
|
|
5704
|
-
const contextValue =
|
|
5695
|
+
const contextValue = React10__namespace.useMemo(
|
|
5705
5696
|
() => ({
|
|
5706
5697
|
expanded,
|
|
5707
5698
|
setExpanded,
|
|
@@ -5758,8 +5749,8 @@ var Sidebar = Object.assign(LegacySidebar, {
|
|
|
5758
5749
|
});
|
|
5759
5750
|
function renderIcon3(icon, className) {
|
|
5760
5751
|
if (!icon) return null;
|
|
5761
|
-
if (
|
|
5762
|
-
return
|
|
5752
|
+
if (React10__namespace.isValidElement(icon)) {
|
|
5753
|
+
return React10__namespace.cloneElement(icon, { className });
|
|
5763
5754
|
}
|
|
5764
5755
|
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon) {
|
|
5765
5756
|
const IconComponent = icon;
|
|
@@ -5767,7 +5758,7 @@ function renderIcon3(icon, className) {
|
|
|
5767
5758
|
}
|
|
5768
5759
|
return null;
|
|
5769
5760
|
}
|
|
5770
|
-
var MobileNavItem =
|
|
5761
|
+
var MobileNavItem = React10__namespace.memo(function MobileNavItem2({
|
|
5771
5762
|
icon,
|
|
5772
5763
|
label,
|
|
5773
5764
|
isActive = false,
|
|
@@ -5805,7 +5796,7 @@ var MobileNavItem = React49__namespace.memo(function MobileNavItem2({
|
|
|
5805
5796
|
] });
|
|
5806
5797
|
});
|
|
5807
5798
|
MobileNavItem.displayName = "MobileNavItem";
|
|
5808
|
-
var MobileNav =
|
|
5799
|
+
var MobileNav = React10__namespace.memo(function MobileNav2({
|
|
5809
5800
|
items,
|
|
5810
5801
|
fabAction,
|
|
5811
5802
|
className
|
|
@@ -5873,7 +5864,7 @@ var MobileNav = React49__namespace.memo(function MobileNav2({
|
|
|
5873
5864
|
);
|
|
5874
5865
|
});
|
|
5875
5866
|
MobileNav.displayName = "MobileNav";
|
|
5876
|
-
var Navbar =
|
|
5867
|
+
var Navbar = React10__namespace.memo(function Navbar2({
|
|
5877
5868
|
children,
|
|
5878
5869
|
className,
|
|
5879
5870
|
style
|
|
@@ -5892,8 +5883,8 @@ var Navbar = React49__namespace.memo(function Navbar2({
|
|
|
5892
5883
|
});
|
|
5893
5884
|
Navbar.displayName = "Navbar";
|
|
5894
5885
|
function ThemeToggle({ className }) {
|
|
5895
|
-
const [isDark, setIsDark] =
|
|
5896
|
-
|
|
5886
|
+
const [isDark, setIsDark] = React10__namespace.useState(false);
|
|
5887
|
+
React10__namespace.useEffect(() => {
|
|
5897
5888
|
const isDarkMode = document.documentElement.classList.contains("dark");
|
|
5898
5889
|
setIsDark(isDarkMode);
|
|
5899
5890
|
}, []);
|
|
@@ -5985,7 +5976,7 @@ function NavbarNotification({
|
|
|
5985
5976
|
] });
|
|
5986
5977
|
}
|
|
5987
5978
|
NavbarNotification.displayName = "NavbarNotification";
|
|
5988
|
-
var ScrollArea =
|
|
5979
|
+
var ScrollArea = React10__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5989
5980
|
ScrollAreaPrimitive__namespace.Root,
|
|
5990
5981
|
{
|
|
5991
5982
|
ref,
|
|
@@ -5999,7 +5990,7 @@ var ScrollArea = React49__namespace.forwardRef(({ className, children, ...props
|
|
|
5999
5990
|
}
|
|
6000
5991
|
));
|
|
6001
5992
|
ScrollArea.displayName = ScrollAreaPrimitive__namespace.Root.displayName;
|
|
6002
|
-
var ScrollBar =
|
|
5993
|
+
var ScrollBar = React10__namespace.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6003
5994
|
ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
|
|
6004
5995
|
{
|
|
6005
5996
|
ref,
|
|
@@ -6015,7 +6006,7 @@ var ScrollBar = React49__namespace.forwardRef(({ className, orientation = "verti
|
|
|
6015
6006
|
}
|
|
6016
6007
|
));
|
|
6017
6008
|
ScrollBar.displayName = ScrollAreaPrimitive__namespace.ScrollAreaScrollbar.displayName;
|
|
6018
|
-
var Separator3 =
|
|
6009
|
+
var Separator3 = React10__namespace.forwardRef(
|
|
6019
6010
|
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6020
6011
|
SeparatorPrimitive__namespace.Root,
|
|
6021
6012
|
{
|
|
@@ -6083,7 +6074,7 @@ function NavbarCompanyProfile({
|
|
|
6083
6074
|
/* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { className: "h-64", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4", children: [
|
|
6084
6075
|
isLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ jsxRuntime.jsx(Loader, { variant: "spinner" }) }),
|
|
6085
6076
|
!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(
|
|
6077
|
+
companies.map((company, index) => /* @__PURE__ */ jsxRuntime.jsxs(React10__namespace.Fragment, { children: [
|
|
6087
6078
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6088
6079
|
Button,
|
|
6089
6080
|
{
|
|
@@ -6166,9 +6157,9 @@ function NavbarUserMenu({
|
|
|
6166
6157
|
] });
|
|
6167
6158
|
}
|
|
6168
6159
|
NavbarUserMenu.displayName = "NavbarUserMenu";
|
|
6169
|
-
var Breadcrumb =
|
|
6160
|
+
var Breadcrumb = React10__namespace.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
6170
6161
|
Breadcrumb.displayName = "Breadcrumb";
|
|
6171
|
-
var BreadcrumbList =
|
|
6162
|
+
var BreadcrumbList = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6172
6163
|
"ol",
|
|
6173
6164
|
{
|
|
6174
6165
|
ref,
|
|
@@ -6180,7 +6171,7 @@ var BreadcrumbList = React49__namespace.forwardRef(({ className, ...props }, ref
|
|
|
6180
6171
|
}
|
|
6181
6172
|
));
|
|
6182
6173
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
6183
|
-
var BreadcrumbItem =
|
|
6174
|
+
var BreadcrumbItem = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6184
6175
|
"li",
|
|
6185
6176
|
{
|
|
6186
6177
|
ref,
|
|
@@ -6189,7 +6180,7 @@ var BreadcrumbItem = React49__namespace.forwardRef(({ className, ...props }, ref
|
|
|
6189
6180
|
}
|
|
6190
6181
|
));
|
|
6191
6182
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
6192
|
-
var BreadcrumbLink =
|
|
6183
|
+
var BreadcrumbLink = React10__namespace.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
6193
6184
|
const Comp = asChild ? reactSlot.Slot : "a";
|
|
6194
6185
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6195
6186
|
Comp,
|
|
@@ -6201,7 +6192,7 @@ var BreadcrumbLink = React49__namespace.forwardRef(({ asChild, className, ...pro
|
|
|
6201
6192
|
);
|
|
6202
6193
|
});
|
|
6203
6194
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
6204
|
-
var BreadcrumbPage =
|
|
6195
|
+
var BreadcrumbPage = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6205
6196
|
"span",
|
|
6206
6197
|
{
|
|
6207
6198
|
ref,
|
|
@@ -6337,16 +6328,16 @@ var SectionHeader = Object.assign(SectionHeaderRoot, {
|
|
|
6337
6328
|
Actions: SectionHeaderActions,
|
|
6338
6329
|
Badge: SectionHeaderBadge
|
|
6339
6330
|
});
|
|
6340
|
-
var KanbanContext =
|
|
6331
|
+
var KanbanContext = React10__namespace.createContext(null);
|
|
6341
6332
|
function useKanban() {
|
|
6342
|
-
const context =
|
|
6333
|
+
const context = React10__namespace.useContext(KanbanContext);
|
|
6343
6334
|
if (!context) {
|
|
6344
6335
|
throw new Error("useKanban must be used within a Kanban.Board component");
|
|
6345
6336
|
}
|
|
6346
6337
|
return context;
|
|
6347
6338
|
}
|
|
6348
6339
|
function useKanbanOptional() {
|
|
6349
|
-
return
|
|
6340
|
+
return React10__namespace.useContext(KanbanContext);
|
|
6350
6341
|
}
|
|
6351
6342
|
function KanbanProvider({ children, value }) {
|
|
6352
6343
|
return /* @__PURE__ */ jsxRuntime.jsx(KanbanContext.Provider, { value, children });
|
|
@@ -6357,18 +6348,18 @@ function KanbanBoard({
|
|
|
6357
6348
|
onDragStart,
|
|
6358
6349
|
className
|
|
6359
6350
|
}) {
|
|
6360
|
-
const [isDragging, setIsDragging] =
|
|
6361
|
-
const [draggedItemId, setDraggedItemId] =
|
|
6362
|
-
const [sourceColumnId, setSourceColumnId] =
|
|
6363
|
-
const [hoveredColumnId, setHoveredColumnId] =
|
|
6364
|
-
const dropValidatorsRef =
|
|
6365
|
-
const registerDropValidator =
|
|
6351
|
+
const [isDragging, setIsDragging] = React10__namespace.useState(false);
|
|
6352
|
+
const [draggedItemId, setDraggedItemId] = React10__namespace.useState(null);
|
|
6353
|
+
const [sourceColumnId, setSourceColumnId] = React10__namespace.useState(null);
|
|
6354
|
+
const [hoveredColumnId, setHoveredColumnId] = React10__namespace.useState(null);
|
|
6355
|
+
const dropValidatorsRef = React10__namespace.useRef(/* @__PURE__ */ new Map());
|
|
6356
|
+
const registerDropValidator = React10__namespace.useCallback((columnId, validator) => {
|
|
6366
6357
|
dropValidatorsRef.current.set(columnId, validator);
|
|
6367
6358
|
}, []);
|
|
6368
|
-
const unregisterDropValidator =
|
|
6359
|
+
const unregisterDropValidator = React10__namespace.useCallback((columnId) => {
|
|
6369
6360
|
dropValidatorsRef.current.delete(columnId);
|
|
6370
6361
|
}, []);
|
|
6371
|
-
const canDropInColumn =
|
|
6362
|
+
const canDropInColumn = React10__namespace.useCallback((columnId) => {
|
|
6372
6363
|
if (!draggedItemId || !sourceColumnId) return false;
|
|
6373
6364
|
if (columnId === sourceColumnId) return false;
|
|
6374
6365
|
const validator = dropValidatorsRef.current.get(columnId);
|
|
@@ -6377,13 +6368,13 @@ function KanbanBoard({
|
|
|
6377
6368
|
}
|
|
6378
6369
|
return true;
|
|
6379
6370
|
}, [draggedItemId, sourceColumnId]);
|
|
6380
|
-
const handleDragStart =
|
|
6371
|
+
const handleDragStart = React10__namespace.useCallback((itemId, colId) => {
|
|
6381
6372
|
setIsDragging(true);
|
|
6382
6373
|
setDraggedItemId(itemId);
|
|
6383
6374
|
setSourceColumnId(colId);
|
|
6384
6375
|
onDragStart?.(itemId, colId);
|
|
6385
6376
|
}, [onDragStart]);
|
|
6386
|
-
const handleDrop =
|
|
6377
|
+
const handleDrop = React10__namespace.useCallback((destinationColumnId) => {
|
|
6387
6378
|
if (draggedItemId && sourceColumnId && destinationColumnId !== sourceColumnId) {
|
|
6388
6379
|
if (canDropInColumn(destinationColumnId)) {
|
|
6389
6380
|
const result = {
|
|
@@ -6399,13 +6390,13 @@ function KanbanBoard({
|
|
|
6399
6390
|
setSourceColumnId(null);
|
|
6400
6391
|
setHoveredColumnId(null);
|
|
6401
6392
|
}, [draggedItemId, sourceColumnId, canDropInColumn, onDragEnd]);
|
|
6402
|
-
const handleDragEnd =
|
|
6393
|
+
const handleDragEnd = React10__namespace.useCallback(() => {
|
|
6403
6394
|
setIsDragging(false);
|
|
6404
6395
|
setDraggedItemId(null);
|
|
6405
6396
|
setSourceColumnId(null);
|
|
6406
6397
|
setHoveredColumnId(null);
|
|
6407
6398
|
}, []);
|
|
6408
|
-
const contextValue =
|
|
6399
|
+
const contextValue = React10__namespace.useMemo(() => ({
|
|
6409
6400
|
isDragging,
|
|
6410
6401
|
draggedItemId,
|
|
6411
6402
|
sourceColumnId,
|
|
@@ -6430,9 +6421,9 @@ function KanbanBoard({
|
|
|
6430
6421
|
}
|
|
6431
6422
|
) });
|
|
6432
6423
|
}
|
|
6433
|
-
var KanbanBoardInternalContext =
|
|
6424
|
+
var KanbanBoardInternalContext = React10__namespace.createContext(null);
|
|
6434
6425
|
function useKanbanBoard() {
|
|
6435
|
-
const context =
|
|
6426
|
+
const context = React10__namespace.useContext(KanbanBoardInternalContext);
|
|
6436
6427
|
if (!context) {
|
|
6437
6428
|
throw new Error("useKanbanBoard must be used within a Kanban.Board component");
|
|
6438
6429
|
}
|
|
@@ -6452,7 +6443,7 @@ function KanbanColumn({
|
|
|
6452
6443
|
}) {
|
|
6453
6444
|
const { isDragging, sourceColumnId, hoveredColumnId, setHoveredColumnId, canDropInColumn, registerDropValidator, unregisterDropValidator } = useKanban();
|
|
6454
6445
|
const { handleDrop } = useKanbanBoard();
|
|
6455
|
-
|
|
6446
|
+
React10__namespace.useEffect(() => {
|
|
6456
6447
|
if (canDrop) {
|
|
6457
6448
|
registerDropValidator(id, canDrop);
|
|
6458
6449
|
return () => unregisterDropValidator(id);
|
|
@@ -6461,7 +6452,7 @@ function KanbanColumn({
|
|
|
6461
6452
|
const isValidDropTarget = isDragging && sourceColumnId !== id && canDropInColumn(id);
|
|
6462
6453
|
const isInvalidDropTarget = isDragging && sourceColumnId !== id && !canDropInColumn(id);
|
|
6463
6454
|
const isHovered = hoveredColumnId === id;
|
|
6464
|
-
const handleDragOver =
|
|
6455
|
+
const handleDragOver = React10__namespace.useCallback((e) => {
|
|
6465
6456
|
e.preventDefault();
|
|
6466
6457
|
if (isValidDropTarget) {
|
|
6467
6458
|
e.dataTransfer.dropEffect = "move";
|
|
@@ -6470,18 +6461,18 @@ function KanbanColumn({
|
|
|
6470
6461
|
e.dataTransfer.dropEffect = "none";
|
|
6471
6462
|
}
|
|
6472
6463
|
}, [isValidDropTarget, setHoveredColumnId, id]);
|
|
6473
|
-
const handleDragLeave =
|
|
6464
|
+
const handleDragLeave = React10__namespace.useCallback((e) => {
|
|
6474
6465
|
if (e.currentTarget === e.target || !e.currentTarget.contains(e.relatedTarget)) {
|
|
6475
6466
|
setHoveredColumnId(null);
|
|
6476
6467
|
}
|
|
6477
6468
|
}, [setHoveredColumnId]);
|
|
6478
|
-
const handleDropEvent =
|
|
6469
|
+
const handleDropEvent = React10__namespace.useCallback((e) => {
|
|
6479
6470
|
e.preventDefault();
|
|
6480
6471
|
if (isValidDropTarget) {
|
|
6481
6472
|
handleDrop(id);
|
|
6482
6473
|
}
|
|
6483
6474
|
}, [isValidDropTarget, handleDrop, id]);
|
|
6484
|
-
const childCount =
|
|
6475
|
+
const childCount = React10__namespace.Children.count(children);
|
|
6485
6476
|
const displayCount = count ?? childCount;
|
|
6486
6477
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6487
6478
|
"div",
|
|
@@ -6542,7 +6533,7 @@ function KanbanCard({
|
|
|
6542
6533
|
const { draggedItemId } = useKanban();
|
|
6543
6534
|
const { handleDragStart } = useKanbanBoard();
|
|
6544
6535
|
const isThisCardDragging = draggedItemId === id;
|
|
6545
|
-
const handleDragStartEvent =
|
|
6536
|
+
const handleDragStartEvent = React10__namespace.useCallback((e) => {
|
|
6546
6537
|
if (disabled) {
|
|
6547
6538
|
e.preventDefault();
|
|
6548
6539
|
return;
|
|
@@ -6602,15 +6593,15 @@ var itemCardVariants = classVarianceAuthority.cva(
|
|
|
6602
6593
|
}
|
|
6603
6594
|
}
|
|
6604
6595
|
);
|
|
6605
|
-
var ItemCardContext =
|
|
6596
|
+
var ItemCardContext = React10__namespace.createContext(null);
|
|
6606
6597
|
function useItemCard() {
|
|
6607
|
-
const context =
|
|
6598
|
+
const context = React10__namespace.useContext(ItemCardContext);
|
|
6608
6599
|
if (!context) {
|
|
6609
6600
|
throw new Error("ItemCard components must be used within ItemCard.Root");
|
|
6610
6601
|
}
|
|
6611
6602
|
return context;
|
|
6612
6603
|
}
|
|
6613
|
-
var ItemCardRoot =
|
|
6604
|
+
var ItemCardRoot = React10__namespace.forwardRef(
|
|
6614
6605
|
({
|
|
6615
6606
|
className,
|
|
6616
6607
|
variant,
|
|
@@ -6620,7 +6611,7 @@ var ItemCardRoot = React49__namespace.forwardRef(
|
|
|
6620
6611
|
children,
|
|
6621
6612
|
...props
|
|
6622
6613
|
}, ref) => {
|
|
6623
|
-
const contextValue =
|
|
6614
|
+
const contextValue = React10__namespace.useMemo(
|
|
6624
6615
|
() => ({ isSelected: selected }),
|
|
6625
6616
|
[selected]
|
|
6626
6617
|
);
|
|
@@ -6664,7 +6655,7 @@ var itemCardBadgeVariants = classVarianceAuthority.cva(
|
|
|
6664
6655
|
}
|
|
6665
6656
|
}
|
|
6666
6657
|
);
|
|
6667
|
-
var ItemCardBadge =
|
|
6658
|
+
var ItemCardBadge = React10__namespace.forwardRef(
|
|
6668
6659
|
({ className, variant, children, ...props }, ref) => {
|
|
6669
6660
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6670
6661
|
"div",
|
|
@@ -6678,7 +6669,7 @@ var ItemCardBadge = React49__namespace.forwardRef(
|
|
|
6678
6669
|
}
|
|
6679
6670
|
);
|
|
6680
6671
|
ItemCardBadge.displayName = "ItemCardBadge";
|
|
6681
|
-
var ItemCardHeader =
|
|
6672
|
+
var ItemCardHeader = React10__namespace.forwardRef(
|
|
6682
6673
|
({ className, align = "between", children, ...props }, ref) => {
|
|
6683
6674
|
const alignmentClasses = {
|
|
6684
6675
|
left: "justify-start",
|
|
@@ -6727,7 +6718,7 @@ var itemCardIconVariants = classVarianceAuthority.cva(
|
|
|
6727
6718
|
}
|
|
6728
6719
|
}
|
|
6729
6720
|
);
|
|
6730
|
-
var ItemCardIcon =
|
|
6721
|
+
var ItemCardIcon = React10__namespace.forwardRef(
|
|
6731
6722
|
({ className, size, variant, ripple = false, children, ...props }, ref) => {
|
|
6732
6723
|
const wrapperSizeClasses = {
|
|
6733
6724
|
sm: "w-10 h-10",
|
|
@@ -6769,7 +6760,7 @@ var ItemCardIcon = React49__namespace.forwardRef(
|
|
|
6769
6760
|
}
|
|
6770
6761
|
);
|
|
6771
6762
|
ItemCardIcon.displayName = "ItemCardIcon";
|
|
6772
|
-
var ItemCardTitleGroup =
|
|
6763
|
+
var ItemCardTitleGroup = React10__namespace.forwardRef(
|
|
6773
6764
|
({ className, align = "right", children, ...props }, ref) => {
|
|
6774
6765
|
const alignmentClasses = {
|
|
6775
6766
|
left: "text-left",
|
|
@@ -6788,7 +6779,7 @@ var ItemCardTitleGroup = React49__namespace.forwardRef(
|
|
|
6788
6779
|
}
|
|
6789
6780
|
);
|
|
6790
6781
|
ItemCardTitleGroup.displayName = "ItemCardTitleGroup";
|
|
6791
|
-
var ItemCardTitle =
|
|
6782
|
+
var ItemCardTitle = React10__namespace.forwardRef(
|
|
6792
6783
|
({ className, children, ...props }, ref) => {
|
|
6793
6784
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6794
6785
|
"h3",
|
|
@@ -6802,7 +6793,7 @@ var ItemCardTitle = React49__namespace.forwardRef(
|
|
|
6802
6793
|
}
|
|
6803
6794
|
);
|
|
6804
6795
|
ItemCardTitle.displayName = "ItemCardTitle";
|
|
6805
|
-
var ItemCardSubtitle =
|
|
6796
|
+
var ItemCardSubtitle = React10__namespace.forwardRef(
|
|
6806
6797
|
({ className, children, ...props }, ref) => {
|
|
6807
6798
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6808
6799
|
"p",
|
|
@@ -6816,7 +6807,7 @@ var ItemCardSubtitle = React49__namespace.forwardRef(
|
|
|
6816
6807
|
}
|
|
6817
6808
|
);
|
|
6818
6809
|
ItemCardSubtitle.displayName = "ItemCardSubtitle";
|
|
6819
|
-
var ItemCardContent =
|
|
6810
|
+
var ItemCardContent = React10__namespace.forwardRef(
|
|
6820
6811
|
({ className, muted = true, children, ...props }, ref) => {
|
|
6821
6812
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6822
6813
|
"div",
|
|
@@ -6834,7 +6825,7 @@ var ItemCardContent = React49__namespace.forwardRef(
|
|
|
6834
6825
|
}
|
|
6835
6826
|
);
|
|
6836
6827
|
ItemCardContent.displayName = "ItemCardContent";
|
|
6837
|
-
var ItemCardContentItem =
|
|
6828
|
+
var ItemCardContentItem = React10__namespace.forwardRef(
|
|
6838
6829
|
({ className, label, value, secondary, children, ...props }, ref) => {
|
|
6839
6830
|
if (children) {
|
|
6840
6831
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6869,7 +6860,7 @@ var ItemCardContentItem = React49__namespace.forwardRef(
|
|
|
6869
6860
|
}
|
|
6870
6861
|
);
|
|
6871
6862
|
ItemCardContentItem.displayName = "ItemCardContentItem";
|
|
6872
|
-
var ItemCardEmpty =
|
|
6863
|
+
var ItemCardEmpty = React10__namespace.forwardRef(
|
|
6873
6864
|
({ className, icon, message = "Nenhum item", children, ...props }, ref) => {
|
|
6874
6865
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6875
6866
|
"div",
|
|
@@ -6889,7 +6880,7 @@ var ItemCardEmpty = React49__namespace.forwardRef(
|
|
|
6889
6880
|
}
|
|
6890
6881
|
);
|
|
6891
6882
|
ItemCardEmpty.displayName = "ItemCardEmpty";
|
|
6892
|
-
var ItemCardFooter =
|
|
6883
|
+
var ItemCardFooter = React10__namespace.forwardRef(
|
|
6893
6884
|
({ className, children, ...props }, ref) => {
|
|
6894
6885
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6895
6886
|
"div",
|
|
@@ -6906,7 +6897,7 @@ var ItemCardFooter = React49__namespace.forwardRef(
|
|
|
6906
6897
|
}
|
|
6907
6898
|
);
|
|
6908
6899
|
ItemCardFooter.displayName = "ItemCardFooter";
|
|
6909
|
-
var ItemCardFooterItem =
|
|
6900
|
+
var ItemCardFooterItem = React10__namespace.forwardRef(
|
|
6910
6901
|
({ className, label, value, align = "left", ...props }, ref) => {
|
|
6911
6902
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6912
6903
|
"div",
|
|
@@ -6927,7 +6918,7 @@ var ItemCardFooterItem = React49__namespace.forwardRef(
|
|
|
6927
6918
|
}
|
|
6928
6919
|
);
|
|
6929
6920
|
ItemCardFooterItem.displayName = "ItemCardFooterItem";
|
|
6930
|
-
var ItemCardFooterDivider =
|
|
6921
|
+
var ItemCardFooterDivider = React10__namespace.forwardRef(
|
|
6931
6922
|
({ className, ...props }, ref) => {
|
|
6932
6923
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6933
6924
|
"div",
|
|
@@ -6940,7 +6931,7 @@ var ItemCardFooterDivider = React49__namespace.forwardRef(
|
|
|
6940
6931
|
}
|
|
6941
6932
|
);
|
|
6942
6933
|
ItemCardFooterDivider.displayName = "ItemCardFooterDivider";
|
|
6943
|
-
var ItemCardActions =
|
|
6934
|
+
var ItemCardActions = React10__namespace.forwardRef(
|
|
6944
6935
|
({ className, bordered = true, children, ...props }, ref) => {
|
|
6945
6936
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6946
6937
|
"div",
|
|
@@ -6958,7 +6949,7 @@ var ItemCardActions = React49__namespace.forwardRef(
|
|
|
6958
6949
|
}
|
|
6959
6950
|
);
|
|
6960
6951
|
ItemCardActions.displayName = "ItemCardActions";
|
|
6961
|
-
var ItemCardActionButton =
|
|
6952
|
+
var ItemCardActionButton = React10__namespace.forwardRef(
|
|
6962
6953
|
({
|
|
6963
6954
|
className,
|
|
6964
6955
|
showArrow = true,
|
|
@@ -6999,7 +6990,7 @@ var ItemCardActionButton = React49__namespace.forwardRef(
|
|
|
6999
6990
|
}
|
|
7000
6991
|
);
|
|
7001
6992
|
ItemCardActionButton.displayName = "ItemCardActionButton";
|
|
7002
|
-
var ItemCardActionsRow =
|
|
6993
|
+
var ItemCardActionsRow = React10__namespace.forwardRef(
|
|
7003
6994
|
({ className, children, ...props }, ref) => {
|
|
7004
6995
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7005
6996
|
"div",
|
|
@@ -7037,16 +7028,16 @@ var ItemCard = Object.assign(ItemCardRoot, {
|
|
|
7037
7028
|
ActionButton: ItemCardActionButton,
|
|
7038
7029
|
ActionsRow: ItemCardActionsRow
|
|
7039
7030
|
});
|
|
7040
|
-
var WizardContext =
|
|
7031
|
+
var WizardContext = React10.createContext(void 0);
|
|
7041
7032
|
function useWizardContext() {
|
|
7042
|
-
const context =
|
|
7033
|
+
const context = React10.useContext(WizardContext);
|
|
7043
7034
|
if (context === void 0) {
|
|
7044
7035
|
throw new Error("useWizardContext must be used within a Wizard component");
|
|
7045
7036
|
}
|
|
7046
7037
|
return context;
|
|
7047
7038
|
}
|
|
7048
7039
|
function useWizardContextOptional() {
|
|
7049
|
-
return
|
|
7040
|
+
return React10.useContext(WizardContext);
|
|
7050
7041
|
}
|
|
7051
7042
|
function WizardProvider({
|
|
7052
7043
|
children,
|
|
@@ -7057,8 +7048,8 @@ function WizardProvider({
|
|
|
7057
7048
|
validateOnNext = true,
|
|
7058
7049
|
allowJumpToStep = false
|
|
7059
7050
|
}) {
|
|
7060
|
-
const [completedSteps, setCompletedSteps] =
|
|
7061
|
-
const activeSteps =
|
|
7051
|
+
const [completedSteps, setCompletedSteps] = React10.useState(/* @__PURE__ */ new Set());
|
|
7052
|
+
const activeSteps = React10.useMemo(() => {
|
|
7062
7053
|
const formValues = form.getValues();
|
|
7063
7054
|
return steps.filter((step) => {
|
|
7064
7055
|
if (typeof step.isHidden === "function") {
|
|
@@ -7067,7 +7058,7 @@ function WizardProvider({
|
|
|
7067
7058
|
return !step.isHidden;
|
|
7068
7059
|
});
|
|
7069
7060
|
}, [steps, form]);
|
|
7070
|
-
const [currentStep, setCurrentStep] =
|
|
7061
|
+
const [currentStep, setCurrentStep] = React10.useState(() => {
|
|
7071
7062
|
return Math.min(Math.max(0, initialStep), activeSteps.length - 1);
|
|
7072
7063
|
});
|
|
7073
7064
|
const totalSteps = activeSteps.length;
|
|
@@ -7075,23 +7066,23 @@ function WizardProvider({
|
|
|
7075
7066
|
const isLastStep = currentStep === totalSteps - 1;
|
|
7076
7067
|
const progress = totalSteps > 0 ? Math.round((currentStep + 1) / totalSteps * 100) : 0;
|
|
7077
7068
|
const currentStepConfig = activeSteps[currentStep];
|
|
7078
|
-
const getStepConfig =
|
|
7069
|
+
const getStepConfig = React10.useCallback(
|
|
7079
7070
|
(index) => activeSteps[index],
|
|
7080
7071
|
[activeSteps]
|
|
7081
7072
|
);
|
|
7082
|
-
const getStepByName =
|
|
7073
|
+
const getStepByName = React10.useCallback(
|
|
7083
7074
|
(name) => activeSteps.find((step) => step.name === name || step.id === name),
|
|
7084
7075
|
[activeSteps]
|
|
7085
7076
|
);
|
|
7086
|
-
const getStepIndexByName =
|
|
7077
|
+
const getStepIndexByName = React10.useCallback(
|
|
7087
7078
|
(name) => activeSteps.findIndex((step) => step.name === name || step.id === name),
|
|
7088
7079
|
[activeSteps]
|
|
7089
7080
|
);
|
|
7090
|
-
const isStepCompleted =
|
|
7081
|
+
const isStepCompleted = React10.useCallback(
|
|
7091
7082
|
(index) => completedSteps.has(index),
|
|
7092
7083
|
[completedSteps]
|
|
7093
7084
|
);
|
|
7094
|
-
const hasStepErrors =
|
|
7085
|
+
const hasStepErrors = React10.useCallback(
|
|
7095
7086
|
(index) => {
|
|
7096
7087
|
const stepConfig = activeSteps[index];
|
|
7097
7088
|
if (!stepConfig?.fields) return false;
|
|
@@ -7103,7 +7094,7 @@ function WizardProvider({
|
|
|
7103
7094
|
},
|
|
7104
7095
|
[activeSteps, form.formState.errors]
|
|
7105
7096
|
);
|
|
7106
|
-
const validateCurrentStep =
|
|
7097
|
+
const validateCurrentStep = React10.useCallback(async () => {
|
|
7107
7098
|
const stepConfig = currentStepConfig;
|
|
7108
7099
|
if (!stepConfig?.validationSchema) {
|
|
7109
7100
|
return true;
|
|
@@ -7125,7 +7116,7 @@ function WizardProvider({
|
|
|
7125
7116
|
}
|
|
7126
7117
|
return true;
|
|
7127
7118
|
}, [currentStepConfig, form]);
|
|
7128
|
-
const goToNextStep =
|
|
7119
|
+
const goToNextStep = React10.useCallback(async () => {
|
|
7129
7120
|
if (isLastStep) {
|
|
7130
7121
|
return false;
|
|
7131
7122
|
}
|
|
@@ -7141,7 +7132,7 @@ function WizardProvider({
|
|
|
7141
7132
|
onStepChange?.(nextStep, "next");
|
|
7142
7133
|
return true;
|
|
7143
7134
|
}, [isLastStep, validateOnNext, validateCurrentStep, currentStep, onStepChange]);
|
|
7144
|
-
const goToPrevStep =
|
|
7135
|
+
const goToPrevStep = React10.useCallback(() => {
|
|
7145
7136
|
if (isFirstStep) {
|
|
7146
7137
|
return;
|
|
7147
7138
|
}
|
|
@@ -7149,7 +7140,7 @@ function WizardProvider({
|
|
|
7149
7140
|
setCurrentStep(prevStep);
|
|
7150
7141
|
onStepChange?.(prevStep, "prev");
|
|
7151
7142
|
}, [isFirstStep, currentStep, onStepChange]);
|
|
7152
|
-
const goToStep =
|
|
7143
|
+
const goToStep = React10.useCallback(
|
|
7153
7144
|
async (targetStep) => {
|
|
7154
7145
|
if (targetStep < 0 || targetStep >= totalSteps) {
|
|
7155
7146
|
return false;
|
|
@@ -7179,12 +7170,12 @@ function WizardProvider({
|
|
|
7179
7170
|
},
|
|
7180
7171
|
[totalSteps, allowJumpToStep, currentStep, completedSteps, validateOnNext, validateCurrentStep, onStepChange]
|
|
7181
7172
|
);
|
|
7182
|
-
const reset =
|
|
7173
|
+
const reset = React10.useCallback(() => {
|
|
7183
7174
|
setCurrentStep(Math.min(Math.max(0, initialStep), activeSteps.length - 1));
|
|
7184
7175
|
setCompletedSteps(/* @__PURE__ */ new Set());
|
|
7185
7176
|
form.reset();
|
|
7186
7177
|
}, [initialStep, activeSteps.length, form]);
|
|
7187
|
-
const contextValue =
|
|
7178
|
+
const contextValue = React10.useMemo(
|
|
7188
7179
|
() => ({
|
|
7189
7180
|
// State
|
|
7190
7181
|
currentStep,
|
|
@@ -7487,8 +7478,8 @@ function WizardSteps({
|
|
|
7487
7478
|
function WizardContent({ children, className }) {
|
|
7488
7479
|
const { currentStepConfig } = useWizardContext();
|
|
7489
7480
|
let activePanel = null;
|
|
7490
|
-
|
|
7491
|
-
if (!
|
|
7481
|
+
React10.Children.forEach(children, (child) => {
|
|
7482
|
+
if (!React10.isValidElement(child)) return;
|
|
7492
7483
|
const panelProps = child.props;
|
|
7493
7484
|
if (panelProps.name === currentStepConfig?.name || panelProps.name === currentStepConfig?.id) {
|
|
7494
7485
|
activePanel = child;
|
|
@@ -7528,17 +7519,17 @@ function WizardNavigation({
|
|
|
7528
7519
|
} = useWizardContext();
|
|
7529
7520
|
const isSubmitting = form.formState.isSubmitting;
|
|
7530
7521
|
const shouldShowCancel = showCancel ?? isFirstStep;
|
|
7531
|
-
const handleNext =
|
|
7522
|
+
const handleNext = React10.useCallback(async (e) => {
|
|
7532
7523
|
e.preventDefault();
|
|
7533
7524
|
e.stopPropagation();
|
|
7534
7525
|
await goToNextStep();
|
|
7535
7526
|
}, [goToNextStep]);
|
|
7536
|
-
const handlePrev =
|
|
7527
|
+
const handlePrev = React10.useCallback((e) => {
|
|
7537
7528
|
e.preventDefault();
|
|
7538
7529
|
e.stopPropagation();
|
|
7539
7530
|
goToPrevStep();
|
|
7540
7531
|
}, [goToPrevStep]);
|
|
7541
|
-
const handleCancel =
|
|
7532
|
+
const handleCancel = React10.useCallback((e) => {
|
|
7542
7533
|
e.preventDefault();
|
|
7543
7534
|
e.stopPropagation();
|
|
7544
7535
|
onCancel?.();
|
|
@@ -7748,9 +7739,9 @@ function Logo({
|
|
|
7748
7739
|
}
|
|
7749
7740
|
);
|
|
7750
7741
|
}
|
|
7751
|
-
var StatsCardContext =
|
|
7742
|
+
var StatsCardContext = React10__namespace.createContext(null);
|
|
7752
7743
|
function useStatsCard() {
|
|
7753
|
-
const context =
|
|
7744
|
+
const context = React10__namespace.useContext(StatsCardContext);
|
|
7754
7745
|
if (!context) {
|
|
7755
7746
|
throw new Error("StatsCard components must be used within StatsCard.Root");
|
|
7756
7747
|
}
|
|
@@ -7924,7 +7915,7 @@ function StatsCardChange({ type = "positive", className, children, ...props }) {
|
|
|
7924
7915
|
}
|
|
7925
7916
|
function StatsCardChart({ data, height, className, ...props }) {
|
|
7926
7917
|
const { config, variant } = useStatsCard();
|
|
7927
|
-
const gradientId =
|
|
7918
|
+
const gradientId = React10__namespace.useId();
|
|
7928
7919
|
if (variant === "mini") {
|
|
7929
7920
|
return null;
|
|
7930
7921
|
}
|
|
@@ -8018,18 +8009,18 @@ var initialState = {
|
|
|
8018
8009
|
theme: "system",
|
|
8019
8010
|
setTheme: () => null
|
|
8020
8011
|
};
|
|
8021
|
-
var ThemeProviderContext =
|
|
8012
|
+
var ThemeProviderContext = React10__namespace.createContext(initialState);
|
|
8022
8013
|
function ThemeProvider({
|
|
8023
8014
|
children,
|
|
8024
8015
|
defaultTheme = "system",
|
|
8025
8016
|
storageKey = "facter-ds-theme",
|
|
8026
8017
|
...props
|
|
8027
8018
|
}) {
|
|
8028
|
-
const [theme, setTheme] =
|
|
8019
|
+
const [theme, setTheme] = React10__namespace.useState(
|
|
8029
8020
|
() => localStorage.getItem(storageKey) || defaultTheme
|
|
8030
8021
|
);
|
|
8031
|
-
const [resolvedTheme, setResolvedTheme] =
|
|
8032
|
-
|
|
8022
|
+
const [resolvedTheme, setResolvedTheme] = React10__namespace.useState("light");
|
|
8023
|
+
React10__namespace.useEffect(() => {
|
|
8033
8024
|
const root = window.document.documentElement;
|
|
8034
8025
|
root.classList.remove("light", "dark");
|
|
8035
8026
|
if (theme === "system") {
|
|
@@ -8041,7 +8032,7 @@ function ThemeProvider({
|
|
|
8041
8032
|
root.classList.add(theme);
|
|
8042
8033
|
setResolvedTheme(theme);
|
|
8043
8034
|
}, [theme]);
|
|
8044
|
-
const value =
|
|
8035
|
+
const value = React10__namespace.useMemo(
|
|
8045
8036
|
() => ({
|
|
8046
8037
|
theme,
|
|
8047
8038
|
setTheme: (theme2) => {
|
|
@@ -8054,7 +8045,7 @@ function ThemeProvider({
|
|
|
8054
8045
|
return /* @__PURE__ */ jsxRuntime.jsx(ThemeProviderContext.Provider, { ...props, value, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: resolvedTheme, style: { minHeight: "100vh" }, children }) });
|
|
8055
8046
|
}
|
|
8056
8047
|
var useTheme = () => {
|
|
8057
|
-
const context =
|
|
8048
|
+
const context = React10__namespace.useContext(ThemeProviderContext);
|
|
8058
8049
|
if (context === void 0)
|
|
8059
8050
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
8060
8051
|
return context;
|