@facter/ds-core 1.7.5 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +359 -362
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +336 -339
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
2
|
+
import * as React10 from 'react';
|
|
3
3
|
import { createContext, useCallback, Children, isValidElement, useState, useMemo, useContext } from 'react';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
@@ -57,7 +57,7 @@ var buttonVariants = cva(
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
);
|
|
60
|
-
var Button =
|
|
60
|
+
var Button = React10.forwardRef(
|
|
61
61
|
({ className, variant, size, ...props }, ref) => {
|
|
62
62
|
return /* @__PURE__ */ jsx(
|
|
63
63
|
"button",
|
|
@@ -150,7 +150,7 @@ var inputVariants = cva(
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
);
|
|
153
|
-
var Input =
|
|
153
|
+
var Input = React10.forwardRef(
|
|
154
154
|
({
|
|
155
155
|
className,
|
|
156
156
|
variant,
|
|
@@ -164,13 +164,13 @@ var Input = React49.forwardRef(
|
|
|
164
164
|
labelClassName,
|
|
165
165
|
...props
|
|
166
166
|
}, ref) => {
|
|
167
|
-
const inputRef =
|
|
168
|
-
const [showPassword, setShowPassword] =
|
|
169
|
-
|
|
170
|
-
const focusInput =
|
|
167
|
+
const inputRef = React10.useRef(null);
|
|
168
|
+
const [showPassword, setShowPassword] = React10.useState(false);
|
|
169
|
+
React10.useImperativeHandle(ref, () => inputRef.current, []);
|
|
170
|
+
const focusInput = React10.useCallback(() => {
|
|
171
171
|
inputRef.current?.focus();
|
|
172
172
|
}, []);
|
|
173
|
-
const togglePasswordVisibility =
|
|
173
|
+
const togglePasswordVisibility = React10.useCallback(() => {
|
|
174
174
|
setShowPassword((prev) => !prev);
|
|
175
175
|
}, []);
|
|
176
176
|
const inputType = type === "password" ? showPassword ? "text" : "password" : type;
|
|
@@ -191,6 +191,7 @@ var Input = React49.forwardRef(
|
|
|
191
191
|
variant: error ? "error" : variant,
|
|
192
192
|
inputSize
|
|
193
193
|
}),
|
|
194
|
+
!label && "h-9 pt-0 pb-0 py-2",
|
|
194
195
|
Icon2 && "pl-10",
|
|
195
196
|
type === "password" && "pr-11",
|
|
196
197
|
className
|
|
@@ -337,8 +338,8 @@ function Sparkline({
|
|
|
337
338
|
className,
|
|
338
339
|
show = true
|
|
339
340
|
}) {
|
|
340
|
-
const gradientId =
|
|
341
|
-
const { linePath, areaPath } =
|
|
341
|
+
const gradientId = React10.useId();
|
|
342
|
+
const { linePath, areaPath } = React10.useMemo(() => {
|
|
342
343
|
if (data.length < 2) {
|
|
343
344
|
return { linePath: "", areaPath: "" };
|
|
344
345
|
}
|
|
@@ -556,7 +557,7 @@ var selectVariants = cva(
|
|
|
556
557
|
}
|
|
557
558
|
}
|
|
558
559
|
);
|
|
559
|
-
var Select =
|
|
560
|
+
var Select = React10.forwardRef(
|
|
560
561
|
({
|
|
561
562
|
className,
|
|
562
563
|
variant,
|
|
@@ -583,6 +584,7 @@ var Select = React49.forwardRef(
|
|
|
583
584
|
variant: error ? "error" : variant,
|
|
584
585
|
selectSize
|
|
585
586
|
}),
|
|
587
|
+
!label && "h-9 pt-0 pb-0 py-2",
|
|
586
588
|
Icon2 && "pl-10",
|
|
587
589
|
"flex items-center justify-between",
|
|
588
590
|
className
|
|
@@ -625,7 +627,7 @@ var Select = React49.forwardRef(
|
|
|
625
627
|
}
|
|
626
628
|
);
|
|
627
629
|
Select.displayName = "Select";
|
|
628
|
-
var SelectItem =
|
|
630
|
+
var SelectItem = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
629
631
|
SelectPrimitive.Item,
|
|
630
632
|
{
|
|
631
633
|
ref,
|
|
@@ -644,7 +646,7 @@ var SelectItem = React49.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
644
646
|
));
|
|
645
647
|
SelectItem.displayName = "SelectItem";
|
|
646
648
|
var SelectGroup = SelectPrimitive.Group;
|
|
647
|
-
var SelectLabel =
|
|
649
|
+
var SelectLabel = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
648
650
|
SelectPrimitive.Label,
|
|
649
651
|
{
|
|
650
652
|
ref,
|
|
@@ -653,7 +655,7 @@ var SelectLabel = React49.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
653
655
|
}
|
|
654
656
|
));
|
|
655
657
|
SelectLabel.displayName = "SelectLabel";
|
|
656
|
-
var SelectSeparator =
|
|
658
|
+
var SelectSeparator = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
657
659
|
SelectPrimitive.Separator,
|
|
658
660
|
{
|
|
659
661
|
ref,
|
|
@@ -663,7 +665,7 @@ var SelectSeparator = React49.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
663
665
|
));
|
|
664
666
|
SelectSeparator.displayName = "SelectSeparator";
|
|
665
667
|
var Tabs = TabsPrimitive.Root;
|
|
666
|
-
var TabsList =
|
|
668
|
+
var TabsList = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
667
669
|
TabsPrimitive.List,
|
|
668
670
|
{
|
|
669
671
|
ref,
|
|
@@ -675,7 +677,7 @@ var TabsList = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
675
677
|
}
|
|
676
678
|
));
|
|
677
679
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
678
|
-
var TabsTrigger =
|
|
680
|
+
var TabsTrigger = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
679
681
|
TabsPrimitive.Trigger,
|
|
680
682
|
{
|
|
681
683
|
ref,
|
|
@@ -687,7 +689,7 @@ var TabsTrigger = React49.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
687
689
|
}
|
|
688
690
|
));
|
|
689
691
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
690
|
-
var TabsContent =
|
|
692
|
+
var TabsContent = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
691
693
|
TabsPrimitive.Content,
|
|
692
694
|
{
|
|
693
695
|
ref,
|
|
@@ -796,7 +798,7 @@ function BarsLoader() {
|
|
|
796
798
|
i
|
|
797
799
|
)) });
|
|
798
800
|
}
|
|
799
|
-
var Loader =
|
|
801
|
+
var Loader = React10.forwardRef(
|
|
800
802
|
({
|
|
801
803
|
variant = "default",
|
|
802
804
|
message,
|
|
@@ -846,21 +848,21 @@ var Loader = React49.forwardRef(
|
|
|
846
848
|
}
|
|
847
849
|
);
|
|
848
850
|
Loader.displayName = "Loader";
|
|
849
|
-
var LoaderContext =
|
|
851
|
+
var LoaderContext = React10.createContext(
|
|
850
852
|
void 0
|
|
851
853
|
);
|
|
852
854
|
function LoaderProvider({ children }) {
|
|
853
|
-
const [isLoading, setIsLoading] =
|
|
854
|
-
const [loaderOptions, setLoaderOptions] =
|
|
855
|
-
const show =
|
|
855
|
+
const [isLoading, setIsLoading] = React10.useState(false);
|
|
856
|
+
const [loaderOptions, setLoaderOptions] = React10.useState({});
|
|
857
|
+
const show = React10.useCallback((options = {}) => {
|
|
856
858
|
setLoaderOptions(options);
|
|
857
859
|
setIsLoading(true);
|
|
858
860
|
}, []);
|
|
859
|
-
const hide =
|
|
861
|
+
const hide = React10.useCallback(() => {
|
|
860
862
|
setIsLoading(false);
|
|
861
863
|
setTimeout(() => setLoaderOptions({}), 300);
|
|
862
864
|
}, []);
|
|
863
|
-
const value =
|
|
865
|
+
const value = React10.useMemo(
|
|
864
866
|
() => ({ show, hide, isLoading }),
|
|
865
867
|
[show, hide, isLoading]
|
|
866
868
|
);
|
|
@@ -879,7 +881,7 @@ function LoaderProvider({ children }) {
|
|
|
879
881
|
] });
|
|
880
882
|
}
|
|
881
883
|
function useLoader() {
|
|
882
|
-
const context =
|
|
884
|
+
const context = React10.useContext(LoaderContext);
|
|
883
885
|
if (context === void 0) {
|
|
884
886
|
throw new Error("useLoader must be used within a LoaderProvider");
|
|
885
887
|
}
|
|
@@ -911,7 +913,7 @@ var loader = {
|
|
|
911
913
|
};
|
|
912
914
|
function GlobalLoaderController() {
|
|
913
915
|
const loaderController = useLoader();
|
|
914
|
-
|
|
916
|
+
React10.useEffect(() => {
|
|
915
917
|
setGlobalLoader(loaderController);
|
|
916
918
|
return () => {
|
|
917
919
|
setGlobalLoader(null);
|
|
@@ -997,7 +999,7 @@ var iconAnimation = {
|
|
|
997
999
|
whileHover: { scale: 1.1 },
|
|
998
1000
|
whileTap: { scale: 0.9 }
|
|
999
1001
|
};
|
|
1000
|
-
var EmptyStateContent =
|
|
1002
|
+
var EmptyStateContent = React10.memo(
|
|
1001
1003
|
({
|
|
1002
1004
|
message = "Nenhum item encontrado",
|
|
1003
1005
|
description,
|
|
@@ -1009,7 +1011,7 @@ var EmptyStateContent = React49.memo(
|
|
|
1009
1011
|
layout = "vertical",
|
|
1010
1012
|
className
|
|
1011
1013
|
}) => {
|
|
1012
|
-
const handleAction =
|
|
1014
|
+
const handleAction = React10.useCallback(() => {
|
|
1013
1015
|
if (onAction) {
|
|
1014
1016
|
onAction();
|
|
1015
1017
|
}
|
|
@@ -1039,7 +1041,7 @@ var EmptyStateContent = React49.memo(
|
|
|
1039
1041
|
}
|
|
1040
1042
|
);
|
|
1041
1043
|
EmptyStateContent.displayName = "EmptyStateContent";
|
|
1042
|
-
var AnimatedEmptyState =
|
|
1044
|
+
var AnimatedEmptyState = React10.memo((props) => {
|
|
1043
1045
|
const {
|
|
1044
1046
|
message = "Nenhum item encontrado",
|
|
1045
1047
|
description,
|
|
@@ -1051,7 +1053,7 @@ var AnimatedEmptyState = React49.memo((props) => {
|
|
|
1051
1053
|
layout = "vertical",
|
|
1052
1054
|
className
|
|
1053
1055
|
} = props;
|
|
1054
|
-
const handleAction =
|
|
1056
|
+
const handleAction = React10.useCallback(() => {
|
|
1055
1057
|
if (onAction) {
|
|
1056
1058
|
onAction();
|
|
1057
1059
|
}
|
|
@@ -1094,7 +1096,7 @@ var AnimatedEmptyState = React49.memo((props) => {
|
|
|
1094
1096
|
);
|
|
1095
1097
|
});
|
|
1096
1098
|
AnimatedEmptyState.displayName = "AnimatedEmptyState";
|
|
1097
|
-
var EmptyState =
|
|
1099
|
+
var EmptyState = React10.memo(
|
|
1098
1100
|
({ animated = true, ...props }) => {
|
|
1099
1101
|
if (!animated) {
|
|
1100
1102
|
return /* @__PURE__ */ jsx(EmptyStateContent, { ...props });
|
|
@@ -1110,13 +1112,13 @@ function useDataTableInternal({
|
|
|
1110
1112
|
manualPagination = false,
|
|
1111
1113
|
pageCount: externalPageCount
|
|
1112
1114
|
}) {
|
|
1113
|
-
const [rowSelection, setRowSelection] =
|
|
1114
|
-
const [columnVisibility, setColumnVisibility] =
|
|
1115
|
-
const [columnFilters, setColumnFilters] =
|
|
1116
|
-
const [sorting, setSorting] =
|
|
1117
|
-
const [globalFilter, setGlobalFilter] =
|
|
1118
|
-
const [density, setDensity] =
|
|
1119
|
-
const [pagination, setPagination] =
|
|
1115
|
+
const [rowSelection, setRowSelection] = React10.useState({});
|
|
1116
|
+
const [columnVisibility, setColumnVisibility] = React10.useState({});
|
|
1117
|
+
const [columnFilters, setColumnFilters] = React10.useState([]);
|
|
1118
|
+
const [sorting, setSorting] = React10.useState([]);
|
|
1119
|
+
const [globalFilter, setGlobalFilter] = React10.useState("");
|
|
1120
|
+
const [density, setDensity] = React10.useState("default");
|
|
1121
|
+
const [pagination, setPagination] = React10.useState({
|
|
1120
1122
|
pageIndex: 0,
|
|
1121
1123
|
pageSize: 10
|
|
1122
1124
|
});
|
|
@@ -1154,7 +1156,7 @@ function useDataTableInternal({
|
|
|
1154
1156
|
getPaginationRowModel: getPaginationRowModel(),
|
|
1155
1157
|
getSortedRowModel: getSortedRowModel()
|
|
1156
1158
|
});
|
|
1157
|
-
const meta =
|
|
1159
|
+
const meta = React10.useMemo(
|
|
1158
1160
|
() => ({
|
|
1159
1161
|
isLoading: false,
|
|
1160
1162
|
// Loading é controlado externamente via DataTable.Loading
|
|
@@ -1174,13 +1176,14 @@ function useDataTableInternal({
|
|
|
1174
1176
|
pageSize: pagination.pageSize
|
|
1175
1177
|
};
|
|
1176
1178
|
}
|
|
1177
|
-
var
|
|
1179
|
+
var DataTableEmptyStateConfigContext = React10.createContext(null);
|
|
1180
|
+
var DataTableInstanceContext = React10.createContext(null);
|
|
1178
1181
|
DataTableInstanceContext.displayName = "DataTableInstanceContext";
|
|
1179
|
-
var DataTableMetaContext =
|
|
1182
|
+
var DataTableMetaContext = React10.createContext(null);
|
|
1180
1183
|
DataTableMetaContext.displayName = "DataTableMetaContext";
|
|
1181
|
-
var DataTableDensityContext =
|
|
1184
|
+
var DataTableDensityContext = React10.createContext(null);
|
|
1182
1185
|
DataTableDensityContext.displayName = "DataTableDensityContext";
|
|
1183
|
-
var DataTablePaginationContext =
|
|
1186
|
+
var DataTablePaginationContext = React10.createContext(null);
|
|
1184
1187
|
DataTablePaginationContext.displayName = "DataTablePaginationContext";
|
|
1185
1188
|
function DataTableProvider({
|
|
1186
1189
|
children,
|
|
@@ -1191,26 +1194,28 @@ function DataTableProvider({
|
|
|
1191
1194
|
pageIndex,
|
|
1192
1195
|
pageSize
|
|
1193
1196
|
}) {
|
|
1194
|
-
const
|
|
1197
|
+
const [emptyStateConfig, setEmptyStateConfig] = React10.useState({});
|
|
1198
|
+
const emptyStateValue = React10.useMemo(
|
|
1199
|
+
() => ({ config: emptyStateConfig, setConfig: setEmptyStateConfig }),
|
|
1200
|
+
[emptyStateConfig]
|
|
1201
|
+
);
|
|
1202
|
+
const metaValue = React10.useMemo(
|
|
1195
1203
|
() => meta,
|
|
1196
1204
|
[meta.isLoading, meta.isEmpty, meta.selectedRowCount, meta.totalRows, meta.density]
|
|
1197
1205
|
);
|
|
1198
|
-
const densityValue =
|
|
1206
|
+
const densityValue = React10.useMemo(
|
|
1199
1207
|
() => ({ density, setDensity }),
|
|
1200
1208
|
[density, setDensity]
|
|
1201
1209
|
);
|
|
1202
|
-
const paginationValue =
|
|
1203
|
-
() => {
|
|
1204
|
-
console.log("[DataTableProvider] creating paginationValue", { pageIndex, pageSize });
|
|
1205
|
-
return { pageIndex, pageSize };
|
|
1206
|
-
},
|
|
1210
|
+
const paginationValue = React10.useMemo(
|
|
1211
|
+
() => ({ pageIndex, pageSize }),
|
|
1207
1212
|
[pageIndex, pageSize]
|
|
1208
1213
|
);
|
|
1209
1214
|
const tableValue = table;
|
|
1210
|
-
return /* @__PURE__ */ jsx(DataTableInstanceContext.Provider, { value: tableValue, children: /* @__PURE__ */ jsx(DataTableMetaContext.Provider, { value: metaValue, children: /* @__PURE__ */ jsx(DataTableDensityContext.Provider, { value: densityValue, children: /* @__PURE__ */ jsx(DataTablePaginationContext.Provider, { value: paginationValue, children }) }) }) });
|
|
1215
|
+
return /* @__PURE__ */ jsx(DataTableEmptyStateConfigContext.Provider, { value: emptyStateValue, children: /* @__PURE__ */ jsx(DataTableInstanceContext.Provider, { value: tableValue, children: /* @__PURE__ */ jsx(DataTableMetaContext.Provider, { value: metaValue, children: /* @__PURE__ */ jsx(DataTableDensityContext.Provider, { value: densityValue, children: /* @__PURE__ */ jsx(DataTablePaginationContext.Provider, { value: paginationValue, children }) }) }) }) });
|
|
1211
1216
|
}
|
|
1212
1217
|
function useDataTable() {
|
|
1213
|
-
const context =
|
|
1218
|
+
const context = React10.useContext(DataTableInstanceContext);
|
|
1214
1219
|
if (!context) {
|
|
1215
1220
|
throw new Error(
|
|
1216
1221
|
"useDataTable must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -1219,7 +1224,7 @@ function useDataTable() {
|
|
|
1219
1224
|
return context;
|
|
1220
1225
|
}
|
|
1221
1226
|
function useDataTableMeta() {
|
|
1222
|
-
const context =
|
|
1227
|
+
const context = React10.useContext(DataTableMetaContext);
|
|
1223
1228
|
if (!context) {
|
|
1224
1229
|
throw new Error(
|
|
1225
1230
|
"useDataTableMeta must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -1237,12 +1242,12 @@ function useDataTableEmpty() {
|
|
|
1237
1242
|
}
|
|
1238
1243
|
function useDataTableSelection() {
|
|
1239
1244
|
const table = useDataTable();
|
|
1240
|
-
return
|
|
1245
|
+
return React10.useMemo(() => {
|
|
1241
1246
|
return table.getSelectedRowModel().rows.map((row) => row.original);
|
|
1242
1247
|
}, [table.getSelectedRowModel().rows]);
|
|
1243
1248
|
}
|
|
1244
1249
|
function useDataTableDensity() {
|
|
1245
|
-
const context =
|
|
1250
|
+
const context = React10.useContext(DataTableDensityContext);
|
|
1246
1251
|
if (!context) {
|
|
1247
1252
|
throw new Error(
|
|
1248
1253
|
"useDataTableDensity must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -1251,7 +1256,7 @@ function useDataTableDensity() {
|
|
|
1251
1256
|
return context;
|
|
1252
1257
|
}
|
|
1253
1258
|
function useDataTablePaginationContext() {
|
|
1254
|
-
const context =
|
|
1259
|
+
const context = React10.useContext(DataTablePaginationContext);
|
|
1255
1260
|
if (!context) {
|
|
1256
1261
|
throw new Error(
|
|
1257
1262
|
"useDataTablePagination must be used within <DataTable>. Make sure your component is wrapped with DataTable."
|
|
@@ -1262,7 +1267,7 @@ function useDataTablePaginationContext() {
|
|
|
1262
1267
|
function useDataTablePagination() {
|
|
1263
1268
|
const table = useDataTable();
|
|
1264
1269
|
const { pageIndex, pageSize } = useDataTablePaginationContext();
|
|
1265
|
-
return
|
|
1270
|
+
return React10.useMemo(() => {
|
|
1266
1271
|
const pageCount = table.getPageCount();
|
|
1267
1272
|
return {
|
|
1268
1273
|
pageIndex,
|
|
@@ -1282,7 +1287,7 @@ function useDataTablePagination() {
|
|
|
1282
1287
|
function useDataTableSorting() {
|
|
1283
1288
|
const table = useDataTable();
|
|
1284
1289
|
const sorting = table.getState().sorting;
|
|
1285
|
-
return
|
|
1290
|
+
return React10.useMemo(() => ({
|
|
1286
1291
|
sorting,
|
|
1287
1292
|
setSorting: table.setSorting,
|
|
1288
1293
|
clearSorting: () => table.resetSorting(),
|
|
@@ -1295,7 +1300,7 @@ function useDataTableSorting() {
|
|
|
1295
1300
|
function useDataTableColumnVisibility() {
|
|
1296
1301
|
const table = useDataTable();
|
|
1297
1302
|
const columnVisibility = table.getState().columnVisibility;
|
|
1298
|
-
return
|
|
1303
|
+
return React10.useMemo(() => ({
|
|
1299
1304
|
columnVisibility,
|
|
1300
1305
|
setColumnVisibility: table.setColumnVisibility,
|
|
1301
1306
|
toggleColumn: (columnId) => {
|
|
@@ -1305,6 +1310,15 @@ function useDataTableColumnVisibility() {
|
|
|
1305
1310
|
getAllColumns: () => table.getAllColumns().filter((col) => col.getCanHide())
|
|
1306
1311
|
}), [table, columnVisibility]);
|
|
1307
1312
|
}
|
|
1313
|
+
function useDataTableEmptyStateConfig() {
|
|
1314
|
+
const context = React10.useContext(DataTableEmptyStateConfigContext);
|
|
1315
|
+
if (!context) {
|
|
1316
|
+
throw new Error(
|
|
1317
|
+
"useDataTableEmptyStateConfig must be used within <DataTable>."
|
|
1318
|
+
);
|
|
1319
|
+
}
|
|
1320
|
+
return context;
|
|
1321
|
+
}
|
|
1308
1322
|
var useDataTableInstance = useDataTable;
|
|
1309
1323
|
var useDataTableState = useDataTableMeta;
|
|
1310
1324
|
function DataTableRoot({
|
|
@@ -1363,7 +1377,7 @@ var DENSITY_CONFIG = {
|
|
|
1363
1377
|
padding: "py-3 px-4"
|
|
1364
1378
|
}
|
|
1365
1379
|
};
|
|
1366
|
-
var Table =
|
|
1380
|
+
var Table = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx(
|
|
1367
1381
|
"table",
|
|
1368
1382
|
{
|
|
1369
1383
|
ref,
|
|
@@ -1372,9 +1386,9 @@ var Table = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
1372
1386
|
}
|
|
1373
1387
|
) }));
|
|
1374
1388
|
Table.displayName = "Table";
|
|
1375
|
-
var TableHeader =
|
|
1389
|
+
var TableHeader = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
1376
1390
|
TableHeader.displayName = "TableHeader";
|
|
1377
|
-
var TableBody =
|
|
1391
|
+
var TableBody = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1378
1392
|
"tbody",
|
|
1379
1393
|
{
|
|
1380
1394
|
ref,
|
|
@@ -1383,7 +1397,7 @@ var TableBody = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
1383
1397
|
}
|
|
1384
1398
|
));
|
|
1385
1399
|
TableBody.displayName = "TableBody";
|
|
1386
|
-
var TableFooter =
|
|
1400
|
+
var TableFooter = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1387
1401
|
"tfoot",
|
|
1388
1402
|
{
|
|
1389
1403
|
ref,
|
|
@@ -1395,8 +1409,8 @@ var TableFooter = React49.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1395
1409
|
}
|
|
1396
1410
|
));
|
|
1397
1411
|
TableFooter.displayName = "TableFooter";
|
|
1398
|
-
var TableRow =
|
|
1399
|
-
|
|
1412
|
+
var TableRow = React10.memo(
|
|
1413
|
+
React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1400
1414
|
"tr",
|
|
1401
1415
|
{
|
|
1402
1416
|
ref,
|
|
@@ -1409,7 +1423,7 @@ var TableRow = React49.memo(
|
|
|
1409
1423
|
))
|
|
1410
1424
|
);
|
|
1411
1425
|
TableRow.displayName = "TableRow";
|
|
1412
|
-
var TableHead =
|
|
1426
|
+
var TableHead = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1413
1427
|
"th",
|
|
1414
1428
|
{
|
|
1415
1429
|
ref,
|
|
@@ -1421,8 +1435,8 @@ var TableHead = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
1421
1435
|
}
|
|
1422
1436
|
));
|
|
1423
1437
|
TableHead.displayName = "TableHead";
|
|
1424
|
-
var TableCell =
|
|
1425
|
-
|
|
1438
|
+
var TableCell = React10.memo(
|
|
1439
|
+
React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1426
1440
|
"td",
|
|
1427
1441
|
{
|
|
1428
1442
|
ref,
|
|
@@ -1432,7 +1446,7 @@ var TableCell = React49.memo(
|
|
|
1432
1446
|
))
|
|
1433
1447
|
);
|
|
1434
1448
|
TableCell.displayName = "TableCell";
|
|
1435
|
-
var TableCaption =
|
|
1449
|
+
var TableCaption = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1436
1450
|
"caption",
|
|
1437
1451
|
{
|
|
1438
1452
|
ref,
|
|
@@ -1441,17 +1455,31 @@ var TableCaption = React49.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
1441
1455
|
}
|
|
1442
1456
|
));
|
|
1443
1457
|
TableCaption.displayName = "TableCaption";
|
|
1444
|
-
var DataTableContent =
|
|
1458
|
+
var DataTableContent = React10.memo(function DataTableContent2({
|
|
1445
1459
|
stickyHeader = false,
|
|
1446
1460
|
stripedRows = false,
|
|
1447
1461
|
highlightOnHover = true,
|
|
1462
|
+
onRowClick,
|
|
1448
1463
|
className
|
|
1449
1464
|
}) {
|
|
1450
1465
|
const table = useDataTable();
|
|
1451
1466
|
const { isEmpty } = useDataTableMeta();
|
|
1452
1467
|
const { density } = useDataTableDensity();
|
|
1468
|
+
const { config: emptyStateConfig } = useDataTableEmptyStateConfig();
|
|
1453
1469
|
const densityStyles = DENSITY_CONFIG[density];
|
|
1454
1470
|
const cellClasses = cn(densityStyles.padding, densityStyles.fontSize);
|
|
1471
|
+
const hasRows = table.getRowModel().rows?.length > 0;
|
|
1472
|
+
if (!hasRows && isEmpty) {
|
|
1473
|
+
return /* @__PURE__ */ jsx(
|
|
1474
|
+
EmptyState,
|
|
1475
|
+
{
|
|
1476
|
+
message: emptyStateConfig.title,
|
|
1477
|
+
description: emptyStateConfig.description,
|
|
1478
|
+
icon: emptyStateConfig.icon,
|
|
1479
|
+
animated: false
|
|
1480
|
+
}
|
|
1481
|
+
);
|
|
1482
|
+
}
|
|
1455
1483
|
return /* @__PURE__ */ jsx("div", { className: cn("rounded-md border overflow-auto", className), children: /* @__PURE__ */ jsxs(Table, { children: [
|
|
1456
1484
|
/* @__PURE__ */ jsx(TableHeader, { className: cn(stickyHeader && "sticky top-0 z-10 bg-background"), children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(TableRow, { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx(
|
|
1457
1485
|
TableHead,
|
|
@@ -1465,37 +1493,32 @@ var DataTableContent = React49.memo(function DataTableContent2({
|
|
|
1465
1493
|
},
|
|
1466
1494
|
header.id
|
|
1467
1495
|
)) }, headerGroup.id)) }),
|
|
1468
|
-
/* @__PURE__ */ jsx(TableBody, { children: table.getRowModel().rows
|
|
1496
|
+
/* @__PURE__ */ jsx(TableBody, { children: table.getRowModel().rows.map((row, index) => /* @__PURE__ */ jsx(
|
|
1469
1497
|
TableRow,
|
|
1470
1498
|
{
|
|
1471
1499
|
"data-state": row.getIsSelected() && "selected",
|
|
1472
1500
|
className: cn(
|
|
1473
1501
|
highlightOnHover && "hover:bg-muted/50",
|
|
1474
|
-
stripedRows && index % 2 === 1 && "bg-muted/30"
|
|
1502
|
+
stripedRows && index % 2 === 1 && "bg-muted/30",
|
|
1503
|
+
onRowClick && "cursor-pointer"
|
|
1475
1504
|
),
|
|
1505
|
+
onClick: onRowClick ? () => onRowClick(row) : void 0,
|
|
1476
1506
|
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(TableCell, { className: cellClasses, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
|
|
1477
1507
|
},
|
|
1478
1508
|
row.id
|
|
1479
|
-
))
|
|
1480
|
-
TableCell,
|
|
1481
|
-
{
|
|
1482
|
-
colSpan: table.getAllColumns().length,
|
|
1483
|
-
className: "h-24 text-center text-muted-foreground",
|
|
1484
|
-
children: isEmpty ? "Nenhum resultado encontrado." : "Carregando..."
|
|
1485
|
-
}
|
|
1486
|
-
) }) })
|
|
1509
|
+
)) })
|
|
1487
1510
|
] }) });
|
|
1488
1511
|
});
|
|
1489
1512
|
DataTableContent.displayName = "DataTable.Content";
|
|
1490
|
-
var DataTableToolbar =
|
|
1513
|
+
var DataTableToolbar = React10.memo(function DataTableToolbar2({
|
|
1491
1514
|
className,
|
|
1492
1515
|
children
|
|
1493
1516
|
}) {
|
|
1494
|
-
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-between gap-2", className), children });
|
|
1517
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-between gap-2 bg-accent/50 p-4 rounded-t-lg", className), children });
|
|
1495
1518
|
});
|
|
1496
1519
|
function useDebounce(value, delay = 300) {
|
|
1497
|
-
const [debouncedValue, setDebouncedValue] =
|
|
1498
|
-
|
|
1520
|
+
const [debouncedValue, setDebouncedValue] = React10.useState(value);
|
|
1521
|
+
React10.useEffect(() => {
|
|
1499
1522
|
const handler = setTimeout(() => {
|
|
1500
1523
|
setDebouncedValue(value);
|
|
1501
1524
|
}, delay);
|
|
@@ -1506,12 +1529,12 @@ function useDebounce(value, delay = 300) {
|
|
|
1506
1529
|
return debouncedValue;
|
|
1507
1530
|
}
|
|
1508
1531
|
function useDebouncedCallback(callback, delay = 300) {
|
|
1509
|
-
const callbackRef =
|
|
1510
|
-
const timeoutRef =
|
|
1511
|
-
|
|
1532
|
+
const callbackRef = React10.useRef(callback);
|
|
1533
|
+
const timeoutRef = React10.useRef(null);
|
|
1534
|
+
React10.useEffect(() => {
|
|
1512
1535
|
callbackRef.current = callback;
|
|
1513
1536
|
}, [callback]);
|
|
1514
|
-
return
|
|
1537
|
+
return React10.useCallback(
|
|
1515
1538
|
(...args) => {
|
|
1516
1539
|
if (timeoutRef.current) {
|
|
1517
1540
|
clearTimeout(timeoutRef.current);
|
|
@@ -1523,7 +1546,7 @@ function useDebouncedCallback(callback, delay = 300) {
|
|
|
1523
1546
|
[delay]
|
|
1524
1547
|
);
|
|
1525
1548
|
}
|
|
1526
|
-
var DataTableSearch =
|
|
1549
|
+
var DataTableSearch = React10.memo(function DataTableSearch2({
|
|
1527
1550
|
column,
|
|
1528
1551
|
placeholder = "Buscar...",
|
|
1529
1552
|
debounce = 300,
|
|
@@ -1532,17 +1555,17 @@ var DataTableSearch = React49.memo(function DataTableSearch2({
|
|
|
1532
1555
|
}) {
|
|
1533
1556
|
const table = useDataTableInstance();
|
|
1534
1557
|
const columnInstance = table.getColumn(column);
|
|
1535
|
-
const [value, setValue] =
|
|
1558
|
+
const [value, setValue] = React10.useState(
|
|
1536
1559
|
columnInstance?.getFilterValue() ?? ""
|
|
1537
1560
|
);
|
|
1538
1561
|
const debouncedValue = useDebounce(value, debounce);
|
|
1539
|
-
|
|
1562
|
+
React10.useEffect(() => {
|
|
1540
1563
|
columnInstance?.setFilterValue(debouncedValue);
|
|
1541
1564
|
if (onSearch) {
|
|
1542
1565
|
onSearch(debouncedValue);
|
|
1543
1566
|
}
|
|
1544
1567
|
}, [debouncedValue, columnInstance, onSearch]);
|
|
1545
|
-
|
|
1568
|
+
React10.useEffect(() => {
|
|
1546
1569
|
const filterValue = columnInstance?.getFilterValue() ?? "";
|
|
1547
1570
|
if (filterValue !== value) {
|
|
1548
1571
|
setValue(filterValue);
|
|
@@ -1558,15 +1581,15 @@ var DataTableSearch = React49.memo(function DataTableSearch2({
|
|
|
1558
1581
|
}
|
|
1559
1582
|
);
|
|
1560
1583
|
});
|
|
1561
|
-
var DataTableFilters =
|
|
1584
|
+
var DataTableFilters = React10.memo(function DataTableFilters2({
|
|
1562
1585
|
onChange,
|
|
1563
1586
|
className,
|
|
1564
1587
|
children
|
|
1565
1588
|
}) {
|
|
1566
1589
|
const table = useDataTableInstance();
|
|
1567
1590
|
const filters = table.getState().columnFilters;
|
|
1568
|
-
const filtersRef =
|
|
1569
|
-
|
|
1591
|
+
const filtersRef = React10.useRef(filters);
|
|
1592
|
+
React10.useEffect(() => {
|
|
1570
1593
|
if (onChange && JSON.stringify(filters) !== JSON.stringify(filtersRef.current)) {
|
|
1571
1594
|
filtersRef.current = filters;
|
|
1572
1595
|
onChange(filters);
|
|
@@ -1574,7 +1597,7 @@ var DataTableFilters = React49.memo(function DataTableFilters2({
|
|
|
1574
1597
|
}, [filters, onChange]);
|
|
1575
1598
|
return /* @__PURE__ */ jsx("div", { className: cn("flex gap-2", className), children });
|
|
1576
1599
|
});
|
|
1577
|
-
var DataTableFilter =
|
|
1600
|
+
var DataTableFilter = React10.memo(function DataTableFilter2({
|
|
1578
1601
|
column: columnId,
|
|
1579
1602
|
title,
|
|
1580
1603
|
options,
|
|
@@ -1584,7 +1607,7 @@ var DataTableFilter = React49.memo(function DataTableFilter2({
|
|
|
1584
1607
|
const column = table.getColumn(columnId);
|
|
1585
1608
|
const filterValue = column?.getFilterValue() ?? [];
|
|
1586
1609
|
const currentValue = filterValue.length > 0 ? filterValue[0] : "all";
|
|
1587
|
-
const handleValueChange =
|
|
1610
|
+
const handleValueChange = React10.useCallback(
|
|
1588
1611
|
(value) => {
|
|
1589
1612
|
if (value === "all") {
|
|
1590
1613
|
column?.setFilterValue(void 0);
|
|
@@ -1609,7 +1632,7 @@ var DataTableFilter = React49.memo(function DataTableFilter2({
|
|
|
1609
1632
|
}
|
|
1610
1633
|
);
|
|
1611
1634
|
});
|
|
1612
|
-
var DataTablePagination =
|
|
1635
|
+
var DataTablePagination = React10.memo(function DataTablePagination2({
|
|
1613
1636
|
mode = "client",
|
|
1614
1637
|
pageCount: externalPageCount,
|
|
1615
1638
|
pageSizes = [10, 20, 30, 50],
|
|
@@ -1638,7 +1661,7 @@ var DataTablePagination = React49.memo(function DataTablePagination2({
|
|
|
1638
1661
|
const pageCount = mode === "server" && externalPageCount !== void 0 ? externalPageCount : internalPageCount;
|
|
1639
1662
|
const canGoPrevious = pageIndex > 0;
|
|
1640
1663
|
const canGoNext = pageIndex < pageCount - 1;
|
|
1641
|
-
const handlePageSizeChange =
|
|
1664
|
+
const handlePageSizeChange = React10.useCallback(
|
|
1642
1665
|
(value) => {
|
|
1643
1666
|
setPageSize(Number(value));
|
|
1644
1667
|
},
|
|
@@ -1741,47 +1764,20 @@ var DataTablePagination = React49.memo(function DataTablePagination2({
|
|
|
1741
1764
|
);
|
|
1742
1765
|
});
|
|
1743
1766
|
DataTablePagination.displayName = "DataTable.Pagination";
|
|
1744
|
-
var DataTableEmptyState =
|
|
1745
|
-
|
|
1767
|
+
var DataTableEmptyState = React10.memo(function DataTableEmptyState2({
|
|
1768
|
+
title,
|
|
1746
1769
|
description,
|
|
1747
1770
|
icon,
|
|
1748
|
-
action
|
|
1749
|
-
className
|
|
1771
|
+
action
|
|
1750
1772
|
}) {
|
|
1751
|
-
const
|
|
1752
|
-
|
|
1753
|
-
{
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
stroke: "currentColor",
|
|
1758
|
-
children: /* @__PURE__ */ jsx(
|
|
1759
|
-
"path",
|
|
1760
|
-
{
|
|
1761
|
-
strokeLinecap: "round",
|
|
1762
|
-
strokeLinejoin: "round",
|
|
1763
|
-
strokeWidth: 1.5,
|
|
1764
|
-
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"
|
|
1765
|
-
}
|
|
1766
|
-
)
|
|
1767
|
-
}
|
|
1768
|
-
);
|
|
1769
|
-
return /* @__PURE__ */ jsx(
|
|
1770
|
-
"div",
|
|
1771
|
-
{
|
|
1772
|
-
className: cn(
|
|
1773
|
-
"flex min-h-[400px] flex-col items-center justify-center rounded-md border border-dashed p-8 text-center",
|
|
1774
|
-
className
|
|
1775
|
-
),
|
|
1776
|
-
children: /* @__PURE__ */ jsxs("div", { className: "mx-auto flex max-w-[420px] flex-col items-center justify-center text-center", children: [
|
|
1777
|
-
icon ?? defaultIcon,
|
|
1778
|
-
/* @__PURE__ */ jsx("h3", { className: "mt-4 text-lg font-semibold", children: message }),
|
|
1779
|
-
description && /* @__PURE__ */ jsx("p", { className: "mb-4 mt-2 text-sm text-muted-foreground", children: description }),
|
|
1780
|
-
action && /* @__PURE__ */ jsx("div", { className: "mt-4", children: action })
|
|
1781
|
-
] })
|
|
1782
|
-
}
|
|
1783
|
-
);
|
|
1773
|
+
const { setConfig } = useDataTableEmptyStateConfig();
|
|
1774
|
+
React10.useLayoutEffect(() => {
|
|
1775
|
+
setConfig({ title, description, icon, action });
|
|
1776
|
+
return () => setConfig({});
|
|
1777
|
+
}, [title, description, icon, action, setConfig]);
|
|
1778
|
+
return null;
|
|
1784
1779
|
});
|
|
1780
|
+
DataTableEmptyState.displayName = "DataTable.EmptyState";
|
|
1785
1781
|
function SkeletonRow({ columns }) {
|
|
1786
1782
|
return /* @__PURE__ */ jsx(TableRow, { className: "animate-pulse", children: Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ jsx(TableCell, { className: "py-4", children: /* @__PURE__ */ jsx("div", { className: "h-4 bg-muted rounded w-3/4" }) }, index)) });
|
|
1787
1783
|
}
|
|
@@ -1845,6 +1841,7 @@ var checkboxVariants = cva(
|
|
|
1845
1841
|
variants: {
|
|
1846
1842
|
variant: {
|
|
1847
1843
|
default: "border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
1844
|
+
muted: "border-muted-foreground/40 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
1848
1845
|
secondary: "border-secondary data-[state=checked]:bg-secondary data-[state=checked]:text-secondary-foreground",
|
|
1849
1846
|
outline: "border-border data-[state=checked]:bg-background data-[state=checked]:text-primary data-[state=checked]:border-primary"
|
|
1850
1847
|
},
|
|
@@ -1865,8 +1862,8 @@ var iconSizeMap = {
|
|
|
1865
1862
|
md: "h-4 w-4",
|
|
1866
1863
|
lg: "h-5 w-5"
|
|
1867
1864
|
};
|
|
1868
|
-
var Checkbox =
|
|
1869
|
-
|
|
1865
|
+
var Checkbox = React10.memo(
|
|
1866
|
+
React10.forwardRef(({ className, variant, size = "md", ...props }, ref) => {
|
|
1870
1867
|
const iconSize = iconSizeMap[size || "md"];
|
|
1871
1868
|
return /* @__PURE__ */ jsx(
|
|
1872
1869
|
CheckboxPrimitive.Root,
|
|
@@ -1890,9 +1887,9 @@ function DataTableColumnVisibility({
|
|
|
1890
1887
|
className
|
|
1891
1888
|
}) {
|
|
1892
1889
|
const table = useDataTable();
|
|
1893
|
-
const [open, setOpen] =
|
|
1894
|
-
const dropdownRef =
|
|
1895
|
-
|
|
1890
|
+
const [open, setOpen] = React10.useState(false);
|
|
1891
|
+
const dropdownRef = React10.useRef(null);
|
|
1892
|
+
React10.useEffect(() => {
|
|
1896
1893
|
function handleClickOutside(event) {
|
|
1897
1894
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1898
1895
|
setOpen(false);
|
|
@@ -1971,9 +1968,9 @@ function DataTableDensityToggle({
|
|
|
1971
1968
|
className
|
|
1972
1969
|
}) {
|
|
1973
1970
|
const { density, setDensity } = useDataTableDensity();
|
|
1974
|
-
const [open, setOpen] =
|
|
1975
|
-
const dropdownRef =
|
|
1976
|
-
|
|
1971
|
+
const [open, setOpen] = React10.useState(false);
|
|
1972
|
+
const dropdownRef = React10.useRef(null);
|
|
1973
|
+
React10.useEffect(() => {
|
|
1977
1974
|
function handleClickOutside(event) {
|
|
1978
1975
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1979
1976
|
setOpen(false);
|
|
@@ -2152,9 +2149,9 @@ function DataTableExport({
|
|
|
2152
2149
|
className
|
|
2153
2150
|
}) {
|
|
2154
2151
|
const table = useDataTable();
|
|
2155
|
-
const [open, setOpen] =
|
|
2156
|
-
const dropdownRef =
|
|
2157
|
-
|
|
2152
|
+
const [open, setOpen] = React10.useState(false);
|
|
2153
|
+
const dropdownRef = React10.useRef(null);
|
|
2154
|
+
React10.useEffect(() => {
|
|
2158
2155
|
function handleClickOutside(event) {
|
|
2159
2156
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
2160
2157
|
setOpen(false);
|
|
@@ -2165,7 +2162,7 @@ function DataTableExport({
|
|
|
2165
2162
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
2166
2163
|
}
|
|
2167
2164
|
}, [open]);
|
|
2168
|
-
const handleExport =
|
|
2165
|
+
const handleExport = React10.useCallback((format) => {
|
|
2169
2166
|
const visibleColumns = table.getVisibleLeafColumns();
|
|
2170
2167
|
const rows = table.getFilteredRowModel().rows;
|
|
2171
2168
|
const headers = [];
|
|
@@ -2268,7 +2265,7 @@ function DataTableTabs({
|
|
|
2268
2265
|
onValueChange,
|
|
2269
2266
|
className
|
|
2270
2267
|
}) {
|
|
2271
|
-
const [internalValue, setInternalValue] =
|
|
2268
|
+
const [internalValue, setInternalValue] = React10.useState(defaultValue ?? tabs[0]?.value);
|
|
2272
2269
|
const activeValue = value ?? internalValue;
|
|
2273
2270
|
const handleTabClick = (tabValue) => {
|
|
2274
2271
|
if (value === void 0) {
|
|
@@ -2279,7 +2276,7 @@ function DataTableTabs({
|
|
|
2279
2276
|
return /* @__PURE__ */ jsx(
|
|
2280
2277
|
"div",
|
|
2281
2278
|
{
|
|
2282
|
-
className: cn("flex items-center gap-1
|
|
2279
|
+
className: cn("flex items-center gap-1", className),
|
|
2283
2280
|
role: "tablist",
|
|
2284
2281
|
"aria-label": "Filtros",
|
|
2285
2282
|
children: tabs.map((tab) => {
|
|
@@ -2355,8 +2352,8 @@ var Dialog = DialogPrimitive.Root;
|
|
|
2355
2352
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
2356
2353
|
var DialogPortal = DialogPrimitive.Portal;
|
|
2357
2354
|
var DialogClose = DialogPrimitive.Close;
|
|
2358
|
-
var DialogOverlay =
|
|
2359
|
-
|
|
2355
|
+
var DialogOverlay = React10.memo(
|
|
2356
|
+
React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2360
2357
|
DialogPrimitive.Overlay,
|
|
2361
2358
|
{
|
|
2362
2359
|
ref,
|
|
@@ -2403,8 +2400,8 @@ var dialogContentVariants = cva(
|
|
|
2403
2400
|
}
|
|
2404
2401
|
}
|
|
2405
2402
|
);
|
|
2406
|
-
var DialogContent =
|
|
2407
|
-
|
|
2403
|
+
var DialogContent = React10.memo(
|
|
2404
|
+
React10.forwardRef(({ className, children, showCloseButton = true, size, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
2408
2405
|
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
2409
2406
|
/* @__PURE__ */ jsxs(
|
|
2410
2407
|
DialogPrimitive.Content,
|
|
@@ -2424,7 +2421,7 @@ var DialogContent = React49.memo(
|
|
|
2424
2421
|
] }))
|
|
2425
2422
|
);
|
|
2426
2423
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
2427
|
-
var DialogHeader =
|
|
2424
|
+
var DialogHeader = React10.memo(
|
|
2428
2425
|
({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
2429
2426
|
"div",
|
|
2430
2427
|
{
|
|
@@ -2437,7 +2434,7 @@ var DialogHeader = React49.memo(
|
|
|
2437
2434
|
)
|
|
2438
2435
|
);
|
|
2439
2436
|
DialogHeader.displayName = "DialogHeader";
|
|
2440
|
-
var DialogFooter =
|
|
2437
|
+
var DialogFooter = React10.memo(
|
|
2441
2438
|
({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
2442
2439
|
"div",
|
|
2443
2440
|
{
|
|
@@ -2450,8 +2447,8 @@ var DialogFooter = React49.memo(
|
|
|
2450
2447
|
)
|
|
2451
2448
|
);
|
|
2452
2449
|
DialogFooter.displayName = "DialogFooter";
|
|
2453
|
-
var DialogTitle =
|
|
2454
|
-
|
|
2450
|
+
var DialogTitle = React10.memo(
|
|
2451
|
+
React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2455
2452
|
DialogPrimitive.Title,
|
|
2456
2453
|
{
|
|
2457
2454
|
ref,
|
|
@@ -2464,8 +2461,8 @@ var DialogTitle = React49.memo(
|
|
|
2464
2461
|
))
|
|
2465
2462
|
);
|
|
2466
2463
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
2467
|
-
var DialogDescription =
|
|
2468
|
-
|
|
2464
|
+
var DialogDescription = React10.memo(
|
|
2465
|
+
React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2469
2466
|
DialogPrimitive.Description,
|
|
2470
2467
|
{
|
|
2471
2468
|
ref,
|
|
@@ -2475,7 +2472,7 @@ var DialogDescription = React49.memo(
|
|
|
2475
2472
|
))
|
|
2476
2473
|
);
|
|
2477
2474
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
2478
|
-
var DialogBody =
|
|
2475
|
+
var DialogBody = React10.memo(
|
|
2479
2476
|
({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn("flex-1 overflow-y-auto py-2", className), ...props })
|
|
2480
2477
|
);
|
|
2481
2478
|
DialogBody.displayName = "DialogBody";
|
|
@@ -2506,7 +2503,7 @@ var COLOR_MAP = {
|
|
|
2506
2503
|
accent: "border-accent",
|
|
2507
2504
|
muted: "border-muted"
|
|
2508
2505
|
};
|
|
2509
|
-
var RippleRing =
|
|
2506
|
+
var RippleRing = React10.memo(({ size, color, opacity }) => {
|
|
2510
2507
|
const borderColorClass = COLOR_MAP[color] || COLOR_MAP.primary;
|
|
2511
2508
|
return /* @__PURE__ */ jsx(
|
|
2512
2509
|
"div",
|
|
@@ -2525,7 +2522,7 @@ var RippleRing = React49.memo(({ size, color, opacity }) => {
|
|
|
2525
2522
|
);
|
|
2526
2523
|
});
|
|
2527
2524
|
RippleRing.displayName = "RippleRing";
|
|
2528
|
-
var RippleEffect =
|
|
2525
|
+
var RippleEffect = React10.memo(
|
|
2529
2526
|
({
|
|
2530
2527
|
size = "md",
|
|
2531
2528
|
color = "primary",
|
|
@@ -2537,7 +2534,7 @@ var RippleEffect = React49.memo(
|
|
|
2537
2534
|
const { base, increment } = SIZE_CONFIG[size];
|
|
2538
2535
|
const opacities = INTENSITY_CONFIG[intensity];
|
|
2539
2536
|
const positionClasses = POSITION_CONFIG[position];
|
|
2540
|
-
const rippleRings =
|
|
2537
|
+
const rippleRings = React10.useMemo(
|
|
2541
2538
|
() => Array.from({ length: rings }).map((_, index) => {
|
|
2542
2539
|
const ringSize = base + increment * (rings - index - 1);
|
|
2543
2540
|
const opacity = opacities[index] || opacities[opacities.length - 1];
|
|
@@ -2567,7 +2564,7 @@ var RippleEffect = React49.memo(
|
|
|
2567
2564
|
}
|
|
2568
2565
|
);
|
|
2569
2566
|
RippleEffect.displayName = "RippleEffect";
|
|
2570
|
-
var RippleWrapper =
|
|
2567
|
+
var RippleWrapper = React10.memo(
|
|
2571
2568
|
({ children, rippleProps, className }) => {
|
|
2572
2569
|
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
2573
2570
|
rippleProps && /* @__PURE__ */ jsx(RippleEffect, { ...rippleProps }),
|
|
@@ -2576,7 +2573,7 @@ var RippleWrapper = React49.memo(
|
|
|
2576
2573
|
}
|
|
2577
2574
|
);
|
|
2578
2575
|
RippleWrapper.displayName = "RippleWrapper";
|
|
2579
|
-
var RippleBackground =
|
|
2576
|
+
var RippleBackground = React10.memo(
|
|
2580
2577
|
({ containerClassName, ...rippleProps }) => {
|
|
2581
2578
|
return /* @__PURE__ */ jsx(
|
|
2582
2579
|
"div",
|
|
@@ -2642,7 +2639,7 @@ var statusIndicatorVariants = cva(
|
|
|
2642
2639
|
}
|
|
2643
2640
|
}
|
|
2644
2641
|
);
|
|
2645
|
-
var DialogWrapper =
|
|
2642
|
+
var DialogWrapper = React10.memo(
|
|
2646
2643
|
({
|
|
2647
2644
|
children,
|
|
2648
2645
|
className,
|
|
@@ -2655,7 +2652,7 @@ var DialogWrapper = React49.memo(
|
|
|
2655
2652
|
rippleProps,
|
|
2656
2653
|
...props
|
|
2657
2654
|
}) => {
|
|
2658
|
-
const defaultRippleProps =
|
|
2655
|
+
const defaultRippleProps = React10.useMemo(
|
|
2659
2656
|
() => ({
|
|
2660
2657
|
size: size === "sm" ? "md" : size === "lg" ? "xl" : "lg",
|
|
2661
2658
|
color: variant === "secondary" ? "secondary" : variant === "accent" ? "accent" : "primary",
|
|
@@ -2665,7 +2662,7 @@ var DialogWrapper = React49.memo(
|
|
|
2665
2662
|
}),
|
|
2666
2663
|
[size, variant, rippleProps]
|
|
2667
2664
|
);
|
|
2668
|
-
const backgroundRippleProps =
|
|
2665
|
+
const backgroundRippleProps = React10.useMemo(
|
|
2669
2666
|
() => ({
|
|
2670
2667
|
position: "top-right",
|
|
2671
2668
|
size: "xl",
|
|
@@ -2768,7 +2765,7 @@ var Toaster = ({ ...props }) => {
|
|
|
2768
2765
|
}
|
|
2769
2766
|
);
|
|
2770
2767
|
};
|
|
2771
|
-
var CustomToast =
|
|
2768
|
+
var CustomToast = React10.memo(
|
|
2772
2769
|
({ title, description, variant = "default", action, onClose }) => {
|
|
2773
2770
|
const variantStyles = toastVariants[variant];
|
|
2774
2771
|
return /* @__PURE__ */ jsxs(
|
|
@@ -2904,8 +2901,8 @@ var thumbVariants = cva(
|
|
|
2904
2901
|
}
|
|
2905
2902
|
}
|
|
2906
2903
|
);
|
|
2907
|
-
var Switch =
|
|
2908
|
-
|
|
2904
|
+
var Switch = React10.memo(
|
|
2905
|
+
React10.forwardRef(({ className, variant, size = "md", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2909
2906
|
SwitchPrimitives.Root,
|
|
2910
2907
|
{
|
|
2911
2908
|
className: cn(switchVariants({ variant, size, className })),
|
|
@@ -2936,8 +2933,8 @@ var textareaVariants = cva(
|
|
|
2936
2933
|
}
|
|
2937
2934
|
}
|
|
2938
2935
|
);
|
|
2939
|
-
var Textarea =
|
|
2940
|
-
|
|
2936
|
+
var Textarea = React10.memo(
|
|
2937
|
+
React10.forwardRef(
|
|
2941
2938
|
({
|
|
2942
2939
|
className,
|
|
2943
2940
|
variant,
|
|
@@ -2952,12 +2949,12 @@ var Textarea = React49.memo(
|
|
|
2952
2949
|
onChange,
|
|
2953
2950
|
...props
|
|
2954
2951
|
}, ref) => {
|
|
2955
|
-
const textareaRef =
|
|
2956
|
-
|
|
2957
|
-
const focusTextarea =
|
|
2952
|
+
const textareaRef = React10.useRef(null);
|
|
2953
|
+
React10.useImperativeHandle(ref, () => textareaRef.current, []);
|
|
2954
|
+
const focusTextarea = React10.useCallback(() => {
|
|
2958
2955
|
textareaRef.current?.focus();
|
|
2959
2956
|
}, []);
|
|
2960
|
-
const handleChange =
|
|
2957
|
+
const handleChange = React10.useCallback(
|
|
2961
2958
|
(e) => {
|
|
2962
2959
|
if (autoResize && textareaRef.current) {
|
|
2963
2960
|
textareaRef.current.style.height = "auto";
|
|
@@ -2967,7 +2964,7 @@ var Textarea = React49.memo(
|
|
|
2967
2964
|
},
|
|
2968
2965
|
[autoResize, onChange]
|
|
2969
2966
|
);
|
|
2970
|
-
|
|
2967
|
+
React10.useEffect(() => {
|
|
2971
2968
|
if (autoResize && textareaRef.current) {
|
|
2972
2969
|
textareaRef.current.style.height = "auto";
|
|
2973
2970
|
textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;
|
|
@@ -3018,23 +3015,23 @@ var Textarea = React49.memo(
|
|
|
3018
3015
|
)
|
|
3019
3016
|
);
|
|
3020
3017
|
Textarea.displayName = "Textarea";
|
|
3021
|
-
var FormFieldContext =
|
|
3018
|
+
var FormFieldContext = React10.createContext(null);
|
|
3022
3019
|
function useFormFieldContext() {
|
|
3023
|
-
const context =
|
|
3020
|
+
const context = React10.useContext(FormFieldContext);
|
|
3024
3021
|
if (!context) {
|
|
3025
3022
|
throw new Error("useFormFieldContext must be used within a Form.Field");
|
|
3026
3023
|
}
|
|
3027
3024
|
return context;
|
|
3028
3025
|
}
|
|
3029
3026
|
function useFormFieldContextOptional() {
|
|
3030
|
-
return
|
|
3027
|
+
return React10.useContext(FormFieldContext);
|
|
3031
3028
|
}
|
|
3032
3029
|
function FormFieldProvider({ name, children }) {
|
|
3033
3030
|
const form = useFormContext();
|
|
3034
|
-
const id =
|
|
3031
|
+
const id = React10.useId();
|
|
3035
3032
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3036
3033
|
const error = fieldState.error?.message;
|
|
3037
|
-
const value =
|
|
3034
|
+
const value = React10.useMemo(
|
|
3038
3035
|
() => ({
|
|
3039
3036
|
name,
|
|
3040
3037
|
id,
|
|
@@ -3142,7 +3139,7 @@ function FormInput({
|
|
|
3142
3139
|
const form = useFormContext();
|
|
3143
3140
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3144
3141
|
const error = fieldState.error?.message;
|
|
3145
|
-
const getInputType =
|
|
3142
|
+
const getInputType = React10.useCallback(() => {
|
|
3146
3143
|
if (["money", "percent", "phone", "cpf", "cnpj", "cep"].includes(mask || "")) {
|
|
3147
3144
|
return "tel";
|
|
3148
3145
|
}
|
|
@@ -3338,7 +3335,7 @@ function FormCheckbox({
|
|
|
3338
3335
|
const form = useFormContext();
|
|
3339
3336
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3340
3337
|
const error = fieldState.error?.message;
|
|
3341
|
-
const id =
|
|
3338
|
+
const id = React10.useId();
|
|
3342
3339
|
return /* @__PURE__ */ jsx(FormFieldProvider, { name, children: /* @__PURE__ */ jsx(
|
|
3343
3340
|
Controller,
|
|
3344
3341
|
{
|
|
@@ -3393,7 +3390,7 @@ function FormSwitch({
|
|
|
3393
3390
|
const form = useFormContext();
|
|
3394
3391
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3395
3392
|
const error = fieldState.error?.message;
|
|
3396
|
-
const id =
|
|
3393
|
+
const id = React10.useId();
|
|
3397
3394
|
return /* @__PURE__ */ jsx(FormFieldProvider, { name, children: /* @__PURE__ */ jsx(
|
|
3398
3395
|
Controller,
|
|
3399
3396
|
{
|
|
@@ -3560,7 +3557,7 @@ function FormRadioGroup({
|
|
|
3560
3557
|
) });
|
|
3561
3558
|
}
|
|
3562
3559
|
FormRadioGroup.displayName = "Form.RadioGroup";
|
|
3563
|
-
var FormLabel =
|
|
3560
|
+
var FormLabel = React10.forwardRef(
|
|
3564
3561
|
({ className, required, children, ...props }, ref) => {
|
|
3565
3562
|
const fieldContext = useFormFieldContextOptional();
|
|
3566
3563
|
return /* @__PURE__ */ jsxs(
|
|
@@ -3583,7 +3580,7 @@ var FormLabel = React49.forwardRef(
|
|
|
3583
3580
|
}
|
|
3584
3581
|
);
|
|
3585
3582
|
FormLabel.displayName = "Form.Label";
|
|
3586
|
-
var FormDescription =
|
|
3583
|
+
var FormDescription = React10.forwardRef(({ className, ...props }, ref) => {
|
|
3587
3584
|
const fieldContext = useFormFieldContextOptional();
|
|
3588
3585
|
if (fieldContext?.error) {
|
|
3589
3586
|
return null;
|
|
@@ -3598,7 +3595,7 @@ var FormDescription = React49.forwardRef(({ className, ...props }, ref) => {
|
|
|
3598
3595
|
);
|
|
3599
3596
|
});
|
|
3600
3597
|
FormDescription.displayName = "Form.Description";
|
|
3601
|
-
var FormError =
|
|
3598
|
+
var FormError = React10.forwardRef(
|
|
3602
3599
|
({ className, message, children, ...props }, ref) => {
|
|
3603
3600
|
const fieldContext = useFormFieldContextOptional();
|
|
3604
3601
|
const errorMessage = message ?? fieldContext?.error;
|
|
@@ -3617,7 +3614,7 @@ var FormError = React49.forwardRef(
|
|
|
3617
3614
|
}
|
|
3618
3615
|
);
|
|
3619
3616
|
FormError.displayName = "Form.Error";
|
|
3620
|
-
var FormFieldWrapper =
|
|
3617
|
+
var FormFieldWrapper = React10.forwardRef(({ className, label, description, required, error, children, ...props }, ref) => {
|
|
3621
3618
|
return /* @__PURE__ */ jsxs("div", { ref, className: cn("space-y-1", className), ...props, children: [
|
|
3622
3619
|
label && /* @__PURE__ */ jsx(FormLabel, { required, children: label }),
|
|
3623
3620
|
children,
|
|
@@ -3660,7 +3657,7 @@ var Form = Object.assign(FormRoot, {
|
|
|
3660
3657
|
FieldWrapper: FormFieldWrapper,
|
|
3661
3658
|
Field: FormFieldProvider
|
|
3662
3659
|
});
|
|
3663
|
-
var Avatar =
|
|
3660
|
+
var Avatar = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3664
3661
|
AvatarPrimitive.Root,
|
|
3665
3662
|
{
|
|
3666
3663
|
ref,
|
|
@@ -3672,7 +3669,7 @@ var Avatar = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
3672
3669
|
}
|
|
3673
3670
|
));
|
|
3674
3671
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
3675
|
-
var AvatarImage =
|
|
3672
|
+
var AvatarImage = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3676
3673
|
AvatarPrimitive.Image,
|
|
3677
3674
|
{
|
|
3678
3675
|
ref,
|
|
@@ -3681,7 +3678,7 @@ var AvatarImage = React49.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3681
3678
|
}
|
|
3682
3679
|
));
|
|
3683
3680
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
3684
|
-
var AvatarFallback =
|
|
3681
|
+
var AvatarFallback = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3685
3682
|
AvatarPrimitive.Fallback,
|
|
3686
3683
|
{
|
|
3687
3684
|
ref,
|
|
@@ -3699,7 +3696,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
|
3699
3696
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
3700
3697
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
3701
3698
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
3702
|
-
var DropdownMenuSubTrigger =
|
|
3699
|
+
var DropdownMenuSubTrigger = React10.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3703
3700
|
DropdownMenuPrimitive.SubTrigger,
|
|
3704
3701
|
{
|
|
3705
3702
|
ref,
|
|
@@ -3716,7 +3713,7 @@ var DropdownMenuSubTrigger = React49.forwardRef(({ className, inset, children, .
|
|
|
3716
3713
|
}
|
|
3717
3714
|
));
|
|
3718
3715
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
3719
|
-
var DropdownMenuSubContent =
|
|
3716
|
+
var DropdownMenuSubContent = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3720
3717
|
DropdownMenuPrimitive.SubContent,
|
|
3721
3718
|
{
|
|
3722
3719
|
ref,
|
|
@@ -3728,7 +3725,7 @@ var DropdownMenuSubContent = React49.forwardRef(({ className, ...props }, ref) =
|
|
|
3728
3725
|
}
|
|
3729
3726
|
));
|
|
3730
3727
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
3731
|
-
var DropdownMenuContent =
|
|
3728
|
+
var DropdownMenuContent = React10.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
3732
3729
|
DropdownMenuPrimitive.Content,
|
|
3733
3730
|
{
|
|
3734
3731
|
ref,
|
|
@@ -3741,7 +3738,7 @@ var DropdownMenuContent = React49.forwardRef(({ className, sideOffset = 4, ...pr
|
|
|
3741
3738
|
}
|
|
3742
3739
|
) }));
|
|
3743
3740
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
3744
|
-
var DropdownMenuItem =
|
|
3741
|
+
var DropdownMenuItem = React10.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3745
3742
|
DropdownMenuPrimitive.Item,
|
|
3746
3743
|
{
|
|
3747
3744
|
ref,
|
|
@@ -3754,7 +3751,7 @@ var DropdownMenuItem = React49.forwardRef(({ className, inset, ...props }, ref)
|
|
|
3754
3751
|
}
|
|
3755
3752
|
));
|
|
3756
3753
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
3757
|
-
var DropdownMenuCheckboxItem =
|
|
3754
|
+
var DropdownMenuCheckboxItem = React10.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3758
3755
|
DropdownMenuPrimitive.CheckboxItem,
|
|
3759
3756
|
{
|
|
3760
3757
|
ref,
|
|
@@ -3771,7 +3768,7 @@ var DropdownMenuCheckboxItem = React49.forwardRef(({ className, children, checke
|
|
|
3771
3768
|
}
|
|
3772
3769
|
));
|
|
3773
3770
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
3774
|
-
var DropdownMenuRadioItem =
|
|
3771
|
+
var DropdownMenuRadioItem = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3775
3772
|
DropdownMenuPrimitive.RadioItem,
|
|
3776
3773
|
{
|
|
3777
3774
|
ref,
|
|
@@ -3787,7 +3784,7 @@ var DropdownMenuRadioItem = React49.forwardRef(({ className, children, ...props
|
|
|
3787
3784
|
}
|
|
3788
3785
|
));
|
|
3789
3786
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
3790
|
-
var DropdownMenuLabel =
|
|
3787
|
+
var DropdownMenuLabel = React10.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3791
3788
|
DropdownMenuPrimitive.Label,
|
|
3792
3789
|
{
|
|
3793
3790
|
ref,
|
|
@@ -3800,7 +3797,7 @@ var DropdownMenuLabel = React49.forwardRef(({ className, inset, ...props }, ref)
|
|
|
3800
3797
|
}
|
|
3801
3798
|
));
|
|
3802
3799
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
3803
|
-
var DropdownMenuSeparator =
|
|
3800
|
+
var DropdownMenuSeparator = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3804
3801
|
DropdownMenuPrimitive.Separator,
|
|
3805
3802
|
{
|
|
3806
3803
|
ref,
|
|
@@ -3824,7 +3821,7 @@ var DropdownMenuShortcut = ({
|
|
|
3824
3821
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
3825
3822
|
var Popover = PopoverPrimitive.Root;
|
|
3826
3823
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
3827
|
-
var PopoverContent =
|
|
3824
|
+
var PopoverContent = React10.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
3828
3825
|
PopoverPrimitive.Content,
|
|
3829
3826
|
{
|
|
3830
3827
|
ref,
|
|
@@ -3842,7 +3839,7 @@ var TooltipProvider = TooltipPrimitive.Provider;
|
|
|
3842
3839
|
var TooltipRoot = TooltipPrimitive.Root;
|
|
3843
3840
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
3844
3841
|
var TooltipPortal = TooltipPrimitive.Portal;
|
|
3845
|
-
var TooltipArrow =
|
|
3842
|
+
var TooltipArrow = React10.forwardRef(({ className, variant = "light", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3846
3843
|
TooltipPrimitive.Arrow,
|
|
3847
3844
|
{
|
|
3848
3845
|
ref,
|
|
@@ -3875,7 +3872,7 @@ var tooltipContentVariants = cva(
|
|
|
3875
3872
|
}
|
|
3876
3873
|
}
|
|
3877
3874
|
);
|
|
3878
|
-
var TooltipContent =
|
|
3875
|
+
var TooltipContent = React10.forwardRef(
|
|
3879
3876
|
({
|
|
3880
3877
|
className,
|
|
3881
3878
|
variant = "light",
|
|
@@ -3909,11 +3906,11 @@ var TooltipContent = React49.forwardRef(
|
|
|
3909
3906
|
) })
|
|
3910
3907
|
);
|
|
3911
3908
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
3912
|
-
var TooltipHeader =
|
|
3909
|
+
var TooltipHeader = React10.forwardRef(
|
|
3913
3910
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex flex-col gap-1", className), ...props })
|
|
3914
3911
|
);
|
|
3915
3912
|
TooltipHeader.displayName = "TooltipHeader";
|
|
3916
|
-
var TooltipTitle =
|
|
3913
|
+
var TooltipTitle = React10.forwardRef(
|
|
3917
3914
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3918
3915
|
"h4",
|
|
3919
3916
|
{
|
|
@@ -3924,7 +3921,7 @@ var TooltipTitle = React49.forwardRef(
|
|
|
3924
3921
|
)
|
|
3925
3922
|
);
|
|
3926
3923
|
TooltipTitle.displayName = "TooltipTitle";
|
|
3927
|
-
var TooltipDescription =
|
|
3924
|
+
var TooltipDescription = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3928
3925
|
"p",
|
|
3929
3926
|
{
|
|
3930
3927
|
ref,
|
|
@@ -3933,7 +3930,7 @@ var TooltipDescription = React49.forwardRef(({ className, ...props }, ref) => /*
|
|
|
3933
3930
|
}
|
|
3934
3931
|
));
|
|
3935
3932
|
TooltipDescription.displayName = "TooltipDescription";
|
|
3936
|
-
var TooltipActions =
|
|
3933
|
+
var TooltipActions = React10.forwardRef(
|
|
3937
3934
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3938
3935
|
"div",
|
|
3939
3936
|
{
|
|
@@ -3959,7 +3956,7 @@ var tooltipActionVariants = cva(
|
|
|
3959
3956
|
}
|
|
3960
3957
|
}
|
|
3961
3958
|
);
|
|
3962
|
-
var TooltipAction =
|
|
3959
|
+
var TooltipAction = React10.forwardRef(
|
|
3963
3960
|
({ className, variant = "primary", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3964
3961
|
"button",
|
|
3965
3962
|
{
|
|
@@ -3970,7 +3967,7 @@ var TooltipAction = React49.forwardRef(
|
|
|
3970
3967
|
)
|
|
3971
3968
|
);
|
|
3972
3969
|
TooltipAction.displayName = "TooltipAction";
|
|
3973
|
-
var TooltipIcon =
|
|
3970
|
+
var TooltipIcon = React10.forwardRef(
|
|
3974
3971
|
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3975
3972
|
"div",
|
|
3976
3973
|
{
|
|
@@ -4023,14 +4020,14 @@ var Tooltip = Object.assign(TooltipRoot, {
|
|
|
4023
4020
|
Icon: TooltipIcon,
|
|
4024
4021
|
Simple: SimpleTooltip
|
|
4025
4022
|
});
|
|
4026
|
-
var AuthLayoutContext =
|
|
4023
|
+
var AuthLayoutContext = React10.createContext({
|
|
4027
4024
|
imagePosition: "left"
|
|
4028
4025
|
});
|
|
4029
4026
|
function AuthLayoutRoot({ children, className }) {
|
|
4030
|
-
const [imagePosition, setImagePosition] =
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
if (
|
|
4027
|
+
const [imagePosition, setImagePosition] = React10.useState("left");
|
|
4028
|
+
React10.useEffect(() => {
|
|
4029
|
+
React10.Children.forEach(children, (child) => {
|
|
4030
|
+
if (React10.isValidElement(child) && child.type === AuthLayoutImage) {
|
|
4034
4031
|
setImagePosition(child.props.position || "left");
|
|
4035
4032
|
}
|
|
4036
4033
|
});
|
|
@@ -4228,7 +4225,7 @@ var AuthLayout = Object.assign(AuthLayoutRoot, {
|
|
|
4228
4225
|
Link: AuthLayoutLink,
|
|
4229
4226
|
Divider: AuthLayoutDivider
|
|
4230
4227
|
});
|
|
4231
|
-
var TabsContext =
|
|
4228
|
+
var TabsContext = React10.createContext(null);
|
|
4232
4229
|
function SelectionLayoutRoot({ children, className }) {
|
|
4233
4230
|
return /* @__PURE__ */ jsx("div", { className: cn("min-h-screen bg-muted/30 flex flex-col lg:flex-row", className), children });
|
|
4234
4231
|
}
|
|
@@ -4339,7 +4336,7 @@ function SelectionLayoutTab({
|
|
|
4339
4336
|
badge,
|
|
4340
4337
|
className
|
|
4341
4338
|
}) {
|
|
4342
|
-
const context =
|
|
4339
|
+
const context = React10.useContext(TabsContext);
|
|
4343
4340
|
if (!context) {
|
|
4344
4341
|
throw new Error("SelectionLayout.Tab must be used within SelectionLayout.Tabs");
|
|
4345
4342
|
}
|
|
@@ -4484,17 +4481,17 @@ var SelectionLayout = Object.assign(SelectionLayoutRoot, {
|
|
|
4484
4481
|
Card: SelectionLayoutCard,
|
|
4485
4482
|
Empty: SelectionLayoutEmpty
|
|
4486
4483
|
});
|
|
4487
|
-
var DashboardLayoutContext =
|
|
4484
|
+
var DashboardLayoutContext = React10.createContext(null);
|
|
4488
4485
|
function useDashboardLayout() {
|
|
4489
|
-
const context =
|
|
4486
|
+
const context = React10.useContext(DashboardLayoutContext);
|
|
4490
4487
|
if (!context) {
|
|
4491
4488
|
throw new Error("useDashboardLayout must be used within DashboardLayout");
|
|
4492
4489
|
}
|
|
4493
4490
|
return context;
|
|
4494
4491
|
}
|
|
4495
4492
|
function useMediaQuery(query) {
|
|
4496
|
-
const [matches, setMatches] =
|
|
4497
|
-
|
|
4493
|
+
const [matches, setMatches] = React10.useState(false);
|
|
4494
|
+
React10.useEffect(() => {
|
|
4498
4495
|
const media = window.matchMedia(query);
|
|
4499
4496
|
if (media.matches !== matches) {
|
|
4500
4497
|
setMatches(media.matches);
|
|
@@ -4511,11 +4508,11 @@ function DashboardLayoutRoot({
|
|
|
4511
4508
|
defaultExpanded = false,
|
|
4512
4509
|
defaultPinned = false
|
|
4513
4510
|
}) {
|
|
4514
|
-
const [sidebarExpanded, setSidebarExpanded] =
|
|
4515
|
-
const [sidebarPinned, setSidebarPinned] =
|
|
4516
|
-
const [mobileMenuOpen, setMobileMenuOpen] =
|
|
4511
|
+
const [sidebarExpanded, setSidebarExpanded] = React10.useState(defaultExpanded || defaultPinned);
|
|
4512
|
+
const [sidebarPinned, setSidebarPinned] = React10.useState(defaultPinned);
|
|
4513
|
+
const [mobileMenuOpen, setMobileMenuOpen] = React10.useState(false);
|
|
4517
4514
|
const isMobile = useMediaQuery("(max-width: 1024px)");
|
|
4518
|
-
|
|
4515
|
+
React10.useEffect(() => {
|
|
4519
4516
|
if (!isMobile) {
|
|
4520
4517
|
setMobileMenuOpen(false);
|
|
4521
4518
|
}
|
|
@@ -4656,7 +4653,7 @@ function DashboardLayoutSidebarNavItem({
|
|
|
4656
4653
|
};
|
|
4657
4654
|
const renderIcon4 = () => {
|
|
4658
4655
|
if (!icon) return null;
|
|
4659
|
-
if (
|
|
4656
|
+
if (React10.isValidElement(icon)) {
|
|
4660
4657
|
return icon;
|
|
4661
4658
|
}
|
|
4662
4659
|
if (typeof icon === "function" || typeof icon === "object" && "$$typeof" in icon) {
|
|
@@ -4711,7 +4708,7 @@ function DashboardLayoutSidebarNavGroup({
|
|
|
4711
4708
|
className
|
|
4712
4709
|
}) {
|
|
4713
4710
|
const { sidebarExpanded } = useDashboardLayout();
|
|
4714
|
-
const [isOpen, setIsOpen] =
|
|
4711
|
+
const [isOpen, setIsOpen] = React10.useState(defaultOpen);
|
|
4715
4712
|
const badgeColors = {
|
|
4716
4713
|
default: "bg-muted text-muted-foreground",
|
|
4717
4714
|
primary: "bg-primary/10 text-primary",
|
|
@@ -4719,7 +4716,7 @@ function DashboardLayoutSidebarNavGroup({
|
|
|
4719
4716
|
};
|
|
4720
4717
|
const renderIcon4 = () => {
|
|
4721
4718
|
if (!icon) return null;
|
|
4722
|
-
if (
|
|
4719
|
+
if (React10.isValidElement(icon)) {
|
|
4723
4720
|
return icon;
|
|
4724
4721
|
}
|
|
4725
4722
|
if (typeof icon === "function" || typeof icon === "object" && "$$typeof" in icon) {
|
|
@@ -4728,7 +4725,7 @@ function DashboardLayoutSidebarNavGroup({
|
|
|
4728
4725
|
}
|
|
4729
4726
|
return null;
|
|
4730
4727
|
};
|
|
4731
|
-
|
|
4728
|
+
React10.useEffect(() => {
|
|
4732
4729
|
if (isActive && sidebarExpanded) {
|
|
4733
4730
|
setIsOpen(true);
|
|
4734
4731
|
}
|
|
@@ -4832,7 +4829,7 @@ function DashboardLayoutHeaderUser({
|
|
|
4832
4829
|
children,
|
|
4833
4830
|
onLogout
|
|
4834
4831
|
}) {
|
|
4835
|
-
const [isOpen, setIsOpen] =
|
|
4832
|
+
const [isOpen, setIsOpen] = React10.useState(false);
|
|
4836
4833
|
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
4837
4834
|
/* @__PURE__ */ jsxs(
|
|
4838
4835
|
"button",
|
|
@@ -4913,7 +4910,7 @@ function DashboardLayoutBreadcrumbs({
|
|
|
4913
4910
|
return /* @__PURE__ */ jsx("nav", { className: cn("flex items-center gap-1 text-sm", className), children: items.map((item, index) => {
|
|
4914
4911
|
const Icon2 = item.icon;
|
|
4915
4912
|
const isLast = index === items.length - 1;
|
|
4916
|
-
return /* @__PURE__ */ jsxs(
|
|
4913
|
+
return /* @__PURE__ */ jsxs(React10.Fragment, { children: [
|
|
4917
4914
|
item.href && !isLast ? /* @__PURE__ */ jsxs(
|
|
4918
4915
|
"a",
|
|
4919
4916
|
{
|
|
@@ -5016,23 +5013,23 @@ var DashboardLayout = Object.assign(DashboardLayoutRoot, {
|
|
|
5016
5013
|
MobileNav: DashboardLayoutMobileNav,
|
|
5017
5014
|
MobileNavItem: DashboardLayoutMobileNavItem
|
|
5018
5015
|
});
|
|
5019
|
-
var SidebarContext =
|
|
5016
|
+
var SidebarContext = React10.createContext(null);
|
|
5020
5017
|
function useSidebar() {
|
|
5021
|
-
const context =
|
|
5018
|
+
const context = React10.useContext(SidebarContext);
|
|
5022
5019
|
if (!context) {
|
|
5023
5020
|
throw new Error("useSidebar must be used within a Sidebar component");
|
|
5024
5021
|
}
|
|
5025
5022
|
return context;
|
|
5026
5023
|
}
|
|
5027
5024
|
function useSidebarOptional() {
|
|
5028
|
-
return
|
|
5025
|
+
return React10.useContext(SidebarContext);
|
|
5029
5026
|
}
|
|
5030
5027
|
function SidebarProvider({ children, value }) {
|
|
5031
5028
|
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value, children });
|
|
5032
5029
|
}
|
|
5033
5030
|
function useMediaQuery2(query) {
|
|
5034
|
-
const [matches, setMatches] =
|
|
5035
|
-
|
|
5031
|
+
const [matches, setMatches] = React10.useState(false);
|
|
5032
|
+
React10.useEffect(() => {
|
|
5036
5033
|
if (typeof window === "undefined") return;
|
|
5037
5034
|
const mediaQuery = window.matchMedia(query);
|
|
5038
5035
|
setMatches(mediaQuery.matches);
|
|
@@ -5044,7 +5041,7 @@ function useMediaQuery2(query) {
|
|
|
5044
5041
|
}, [query]);
|
|
5045
5042
|
return matches;
|
|
5046
5043
|
}
|
|
5047
|
-
var SidebarHeader =
|
|
5044
|
+
var SidebarHeader = React10.memo(function SidebarHeader2({
|
|
5048
5045
|
logo,
|
|
5049
5046
|
collapsedLogo,
|
|
5050
5047
|
title,
|
|
@@ -5052,7 +5049,7 @@ var SidebarHeader = React49.memo(function SidebarHeader2({
|
|
|
5052
5049
|
className
|
|
5053
5050
|
}) {
|
|
5054
5051
|
const { expanded, pinned, setPinned } = useSidebar();
|
|
5055
|
-
const handleTogglePin =
|
|
5052
|
+
const handleTogglePin = React10.useCallback(() => {
|
|
5056
5053
|
setPinned(!pinned);
|
|
5057
5054
|
}, [pinned, setPinned]);
|
|
5058
5055
|
return /* @__PURE__ */ jsxs(
|
|
@@ -5127,7 +5124,7 @@ var SidebarHeader = React49.memo(function SidebarHeader2({
|
|
|
5127
5124
|
);
|
|
5128
5125
|
});
|
|
5129
5126
|
SidebarHeader.displayName = "Sidebar.Header";
|
|
5130
|
-
var SidebarNav =
|
|
5127
|
+
var SidebarNav = React10.memo(function SidebarNav2({
|
|
5131
5128
|
children,
|
|
5132
5129
|
className
|
|
5133
5130
|
}) {
|
|
@@ -5143,7 +5140,7 @@ var SidebarNav = React49.memo(function SidebarNav2({
|
|
|
5143
5140
|
);
|
|
5144
5141
|
});
|
|
5145
5142
|
SidebarNav.displayName = "Sidebar.Nav";
|
|
5146
|
-
var SidebarSection =
|
|
5143
|
+
var SidebarSection = React10.memo(function SidebarSection2({
|
|
5147
5144
|
title,
|
|
5148
5145
|
children,
|
|
5149
5146
|
className
|
|
@@ -5167,8 +5164,8 @@ var SidebarSection = React49.memo(function SidebarSection2({
|
|
|
5167
5164
|
SidebarSection.displayName = "Sidebar.Section";
|
|
5168
5165
|
function renderIcon(icon, className) {
|
|
5169
5166
|
if (!icon) return null;
|
|
5170
|
-
if (
|
|
5171
|
-
return
|
|
5167
|
+
if (React10.isValidElement(icon)) {
|
|
5168
|
+
return React10.cloneElement(icon, { className });
|
|
5172
5169
|
}
|
|
5173
5170
|
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon) {
|
|
5174
5171
|
const IconComponent = icon;
|
|
@@ -5182,7 +5179,7 @@ var badgeVariantStyles = {
|
|
|
5182
5179
|
success: "bg-green-100 text-green-600",
|
|
5183
5180
|
warning: "bg-amber-100 text-amber-600"
|
|
5184
5181
|
};
|
|
5185
|
-
var SidebarNavItem =
|
|
5182
|
+
var SidebarNavItem = React10.memo(function SidebarNavItem2({
|
|
5186
5183
|
icon,
|
|
5187
5184
|
label,
|
|
5188
5185
|
href,
|
|
@@ -5194,7 +5191,7 @@ var SidebarNavItem = React49.memo(function SidebarNavItem2({
|
|
|
5194
5191
|
className
|
|
5195
5192
|
}) {
|
|
5196
5193
|
const { expanded } = useSidebar();
|
|
5197
|
-
const handleClick =
|
|
5194
|
+
const handleClick = React10.useCallback(() => {
|
|
5198
5195
|
if (disabled) return;
|
|
5199
5196
|
if (onClick) {
|
|
5200
5197
|
onClick();
|
|
@@ -5277,8 +5274,8 @@ var SidebarNavItem = React49.memo(function SidebarNavItem2({
|
|
|
5277
5274
|
SidebarNavItem.displayName = "Sidebar.NavItem";
|
|
5278
5275
|
function renderIcon2(icon, className) {
|
|
5279
5276
|
if (!icon) return null;
|
|
5280
|
-
if (
|
|
5281
|
-
return
|
|
5277
|
+
if (React10.isValidElement(icon)) {
|
|
5278
|
+
return React10.cloneElement(icon, { className });
|
|
5282
5279
|
}
|
|
5283
5280
|
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon) {
|
|
5284
5281
|
const IconComponent = icon;
|
|
@@ -5292,7 +5289,7 @@ var badgeVariantStyles2 = {
|
|
|
5292
5289
|
success: "bg-green-100 text-green-600",
|
|
5293
5290
|
warning: "bg-amber-100 text-amber-600"
|
|
5294
5291
|
};
|
|
5295
|
-
var SidebarNavGroup =
|
|
5292
|
+
var SidebarNavGroup = React10.memo(function SidebarNavGroup2({
|
|
5296
5293
|
icon,
|
|
5297
5294
|
label,
|
|
5298
5295
|
children,
|
|
@@ -5304,10 +5301,10 @@ var SidebarNavGroup = React49.memo(function SidebarNavGroup2({
|
|
|
5304
5301
|
className
|
|
5305
5302
|
}) {
|
|
5306
5303
|
const { expanded, activeSection, setActiveSection } = useSidebar();
|
|
5307
|
-
const [isOpen, setIsOpen] =
|
|
5304
|
+
const [isOpen, setIsOpen] = React10.useState(defaultOpen);
|
|
5308
5305
|
const groupId = id || label.toLowerCase().replace(/\s+/g, "-");
|
|
5309
5306
|
const isExpanded = expanded && (activeSection === groupId || isOpen);
|
|
5310
|
-
const handleClick =
|
|
5307
|
+
const handleClick = React10.useCallback(() => {
|
|
5311
5308
|
if (activeSection === groupId) {
|
|
5312
5309
|
setActiveSection(null);
|
|
5313
5310
|
setIsOpen(false);
|
|
@@ -5316,7 +5313,7 @@ var SidebarNavGroup = React49.memo(function SidebarNavGroup2({
|
|
|
5316
5313
|
setIsOpen(true);
|
|
5317
5314
|
}
|
|
5318
5315
|
}, [activeSection, groupId, setActiveSection]);
|
|
5319
|
-
|
|
5316
|
+
React10.useEffect(() => {
|
|
5320
5317
|
if (expanded && isActive && !isOpen) {
|
|
5321
5318
|
setIsOpen(true);
|
|
5322
5319
|
setActiveSection(groupId);
|
|
@@ -5420,18 +5417,18 @@ function isLucideIcon(icon) {
|
|
|
5420
5417
|
function getInitials(name) {
|
|
5421
5418
|
return name.split(" ").map((part) => part.charAt(0)).slice(0, 2).join("").toUpperCase();
|
|
5422
5419
|
}
|
|
5423
|
-
var SidebarFooter =
|
|
5420
|
+
var SidebarFooter = React10.memo(function SidebarFooter2({
|
|
5424
5421
|
user,
|
|
5425
5422
|
menuItems,
|
|
5426
5423
|
children,
|
|
5427
5424
|
className
|
|
5428
5425
|
}) {
|
|
5429
5426
|
const { expanded } = useSidebar();
|
|
5430
|
-
const [menuOpen, setMenuOpen] =
|
|
5431
|
-
const handleToggleMenu =
|
|
5427
|
+
const [menuOpen, setMenuOpen] = React10.useState(false);
|
|
5428
|
+
const handleToggleMenu = React10.useCallback(() => {
|
|
5432
5429
|
setMenuOpen((prev) => !prev);
|
|
5433
5430
|
}, []);
|
|
5434
|
-
|
|
5431
|
+
React10.useEffect(() => {
|
|
5435
5432
|
if (!menuOpen) return;
|
|
5436
5433
|
const handleClickOutside = (event) => {
|
|
5437
5434
|
const target = event.target;
|
|
@@ -5509,7 +5506,7 @@ var SidebarFooter = React49.memo(function SidebarFooter2({
|
|
|
5509
5506
|
children: /* @__PURE__ */ jsx("div", { className: "py-1", children: menuItems.map((item, index) => {
|
|
5510
5507
|
const IconComponent = item.icon && isLucideIcon(item.icon) ? item.icon : null;
|
|
5511
5508
|
const isDestructive = item.variant === "destructive";
|
|
5512
|
-
return /* @__PURE__ */ jsxs(
|
|
5509
|
+
return /* @__PURE__ */ jsxs(React10.Fragment, { children: [
|
|
5513
5510
|
isDestructive && index > 0 && /* @__PURE__ */ jsx("div", { className: "my-1 border-t border-border" }),
|
|
5514
5511
|
/* @__PURE__ */ jsxs(
|
|
5515
5512
|
"button",
|
|
@@ -5546,17 +5543,17 @@ function SidebarRoot({
|
|
|
5546
5543
|
collapsedWidth = COLLAPSED_WIDTH,
|
|
5547
5544
|
expandedWidth = EXPANDED_WIDTH
|
|
5548
5545
|
}) {
|
|
5549
|
-
const [expanded, setExpanded] =
|
|
5550
|
-
const [pinned, setPinned] =
|
|
5551
|
-
const [activeSection, setActiveSection] =
|
|
5546
|
+
const [expanded, setExpanded] = React10.useState(defaultExpanded || defaultPinned);
|
|
5547
|
+
const [pinned, setPinned] = React10.useState(defaultPinned);
|
|
5548
|
+
const [activeSection, setActiveSection] = React10.useState(null);
|
|
5552
5549
|
const isMobile = useMediaQuery2("(max-width: 768px)");
|
|
5553
|
-
const handleSetPinned =
|
|
5550
|
+
const handleSetPinned = React10.useCallback((value) => {
|
|
5554
5551
|
setPinned(value);
|
|
5555
5552
|
if (value) {
|
|
5556
5553
|
setExpanded(true);
|
|
5557
5554
|
}
|
|
5558
5555
|
}, []);
|
|
5559
|
-
const contextValue =
|
|
5556
|
+
const contextValue = React10.useMemo(
|
|
5560
5557
|
() => ({
|
|
5561
5558
|
expanded,
|
|
5562
5559
|
setExpanded,
|
|
@@ -5575,13 +5572,13 @@ function SidebarRoot({
|
|
|
5575
5572
|
SidebarRoot.displayName = "SidebarRoot";
|
|
5576
5573
|
function SidebarAside({ children, className }) {
|
|
5577
5574
|
const { expanded, pinned, setExpanded, isMobile, collapsedWidth, expandedWidth } = useSidebar();
|
|
5578
|
-
const sidebarRef =
|
|
5579
|
-
const handleMouseEnter =
|
|
5575
|
+
const sidebarRef = React10.useRef(null);
|
|
5576
|
+
const handleMouseEnter = React10.useCallback(() => {
|
|
5580
5577
|
if (!pinned && !isMobile) {
|
|
5581
5578
|
setExpanded(true);
|
|
5582
5579
|
}
|
|
5583
5580
|
}, [pinned, isMobile, setExpanded]);
|
|
5584
|
-
const handleMouseLeave =
|
|
5581
|
+
const handleMouseLeave = React10.useCallback(() => {
|
|
5585
5582
|
if (!pinned && !isMobile) {
|
|
5586
5583
|
setExpanded(false);
|
|
5587
5584
|
}
|
|
@@ -5649,28 +5646,28 @@ function LegacySidebar({
|
|
|
5649
5646
|
expandedWidth = EXPANDED_WIDTH,
|
|
5650
5647
|
className
|
|
5651
5648
|
}) {
|
|
5652
|
-
const [expanded, setExpanded] =
|
|
5653
|
-
const [pinned, setPinned] =
|
|
5654
|
-
const [activeSection, setActiveSection] =
|
|
5649
|
+
const [expanded, setExpanded] = React10.useState(defaultExpanded || defaultPinned);
|
|
5650
|
+
const [pinned, setPinned] = React10.useState(defaultPinned);
|
|
5651
|
+
const [activeSection, setActiveSection] = React10.useState(null);
|
|
5655
5652
|
const isMobile = useMediaQuery2("(max-width: 768px)");
|
|
5656
|
-
const sidebarRef =
|
|
5657
|
-
const handleMouseEnter =
|
|
5653
|
+
const sidebarRef = React10.useRef(null);
|
|
5654
|
+
const handleMouseEnter = React10.useCallback(() => {
|
|
5658
5655
|
if (!pinned && !isMobile) {
|
|
5659
5656
|
setExpanded(true);
|
|
5660
5657
|
}
|
|
5661
5658
|
}, [pinned, isMobile]);
|
|
5662
|
-
const handleMouseLeave =
|
|
5659
|
+
const handleMouseLeave = React10.useCallback(() => {
|
|
5663
5660
|
if (!pinned && !isMobile) {
|
|
5664
5661
|
setExpanded(false);
|
|
5665
5662
|
}
|
|
5666
5663
|
}, [pinned, isMobile]);
|
|
5667
|
-
const handleSetPinned =
|
|
5664
|
+
const handleSetPinned = React10.useCallback((value) => {
|
|
5668
5665
|
setPinned(value);
|
|
5669
5666
|
if (value) {
|
|
5670
5667
|
setExpanded(true);
|
|
5671
5668
|
}
|
|
5672
5669
|
}, []);
|
|
5673
|
-
const contextValue =
|
|
5670
|
+
const contextValue = React10.useMemo(
|
|
5674
5671
|
() => ({
|
|
5675
5672
|
expanded,
|
|
5676
5673
|
setExpanded,
|
|
@@ -5727,8 +5724,8 @@ var Sidebar = Object.assign(LegacySidebar, {
|
|
|
5727
5724
|
});
|
|
5728
5725
|
function renderIcon3(icon, className) {
|
|
5729
5726
|
if (!icon) return null;
|
|
5730
|
-
if (
|
|
5731
|
-
return
|
|
5727
|
+
if (React10.isValidElement(icon)) {
|
|
5728
|
+
return React10.cloneElement(icon, { className });
|
|
5732
5729
|
}
|
|
5733
5730
|
if (typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon) {
|
|
5734
5731
|
const IconComponent = icon;
|
|
@@ -5736,7 +5733,7 @@ function renderIcon3(icon, className) {
|
|
|
5736
5733
|
}
|
|
5737
5734
|
return null;
|
|
5738
5735
|
}
|
|
5739
|
-
var MobileNavItem =
|
|
5736
|
+
var MobileNavItem = React10.memo(function MobileNavItem2({
|
|
5740
5737
|
icon,
|
|
5741
5738
|
label,
|
|
5742
5739
|
isActive = false,
|
|
@@ -5774,7 +5771,7 @@ var MobileNavItem = React49.memo(function MobileNavItem2({
|
|
|
5774
5771
|
] });
|
|
5775
5772
|
});
|
|
5776
5773
|
MobileNavItem.displayName = "MobileNavItem";
|
|
5777
|
-
var MobileNav =
|
|
5774
|
+
var MobileNav = React10.memo(function MobileNav2({
|
|
5778
5775
|
items,
|
|
5779
5776
|
fabAction,
|
|
5780
5777
|
className
|
|
@@ -5842,7 +5839,7 @@ var MobileNav = React49.memo(function MobileNav2({
|
|
|
5842
5839
|
);
|
|
5843
5840
|
});
|
|
5844
5841
|
MobileNav.displayName = "MobileNav";
|
|
5845
|
-
var Navbar =
|
|
5842
|
+
var Navbar = React10.memo(function Navbar2({
|
|
5846
5843
|
children,
|
|
5847
5844
|
className,
|
|
5848
5845
|
style
|
|
@@ -5861,8 +5858,8 @@ var Navbar = React49.memo(function Navbar2({
|
|
|
5861
5858
|
});
|
|
5862
5859
|
Navbar.displayName = "Navbar";
|
|
5863
5860
|
function ThemeToggle({ className }) {
|
|
5864
|
-
const [isDark, setIsDark] =
|
|
5865
|
-
|
|
5861
|
+
const [isDark, setIsDark] = React10.useState(false);
|
|
5862
|
+
React10.useEffect(() => {
|
|
5866
5863
|
const isDarkMode = document.documentElement.classList.contains("dark");
|
|
5867
5864
|
setIsDark(isDarkMode);
|
|
5868
5865
|
}, []);
|
|
@@ -5954,7 +5951,7 @@ function NavbarNotification({
|
|
|
5954
5951
|
] });
|
|
5955
5952
|
}
|
|
5956
5953
|
NavbarNotification.displayName = "NavbarNotification";
|
|
5957
|
-
var ScrollArea =
|
|
5954
|
+
var ScrollArea = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
5958
5955
|
ScrollAreaPrimitive.Root,
|
|
5959
5956
|
{
|
|
5960
5957
|
ref,
|
|
@@ -5968,7 +5965,7 @@ var ScrollArea = React49.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
5968
5965
|
}
|
|
5969
5966
|
));
|
|
5970
5967
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
5971
|
-
var ScrollBar =
|
|
5968
|
+
var ScrollBar = React10.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5972
5969
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
5973
5970
|
{
|
|
5974
5971
|
ref,
|
|
@@ -5984,7 +5981,7 @@ var ScrollBar = React49.forwardRef(({ className, orientation = "vertical", ...pr
|
|
|
5984
5981
|
}
|
|
5985
5982
|
));
|
|
5986
5983
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
5987
|
-
var Separator3 =
|
|
5984
|
+
var Separator3 = React10.forwardRef(
|
|
5988
5985
|
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5989
5986
|
SeparatorPrimitive.Root,
|
|
5990
5987
|
{
|
|
@@ -6052,7 +6049,7 @@ function NavbarCompanyProfile({
|
|
|
6052
6049
|
/* @__PURE__ */ jsx(ScrollArea, { className: "h-64", children: /* @__PURE__ */ jsxs("div", { className: "p-4", children: [
|
|
6053
6050
|
isLoading && /* @__PURE__ */ jsx("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ jsx(Loader, { variant: "spinner" }) }),
|
|
6054
6051
|
!isLoading && companies.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-center text-muted-foreground", children: "Nenhuma empresa encontrada." }),
|
|
6055
|
-
companies.map((company, index) => /* @__PURE__ */ jsxs(
|
|
6052
|
+
companies.map((company, index) => /* @__PURE__ */ jsxs(React10.Fragment, { children: [
|
|
6056
6053
|
/* @__PURE__ */ jsx(
|
|
6057
6054
|
Button,
|
|
6058
6055
|
{
|
|
@@ -6135,9 +6132,9 @@ function NavbarUserMenu({
|
|
|
6135
6132
|
] });
|
|
6136
6133
|
}
|
|
6137
6134
|
NavbarUserMenu.displayName = "NavbarUserMenu";
|
|
6138
|
-
var Breadcrumb =
|
|
6135
|
+
var Breadcrumb = React10.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
6139
6136
|
Breadcrumb.displayName = "Breadcrumb";
|
|
6140
|
-
var BreadcrumbList =
|
|
6137
|
+
var BreadcrumbList = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6141
6138
|
"ol",
|
|
6142
6139
|
{
|
|
6143
6140
|
ref,
|
|
@@ -6149,7 +6146,7 @@ var BreadcrumbList = React49.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
6149
6146
|
}
|
|
6150
6147
|
));
|
|
6151
6148
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
6152
|
-
var BreadcrumbItem =
|
|
6149
|
+
var BreadcrumbItem = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6153
6150
|
"li",
|
|
6154
6151
|
{
|
|
6155
6152
|
ref,
|
|
@@ -6158,7 +6155,7 @@ var BreadcrumbItem = React49.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
6158
6155
|
}
|
|
6159
6156
|
));
|
|
6160
6157
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
6161
|
-
var BreadcrumbLink =
|
|
6158
|
+
var BreadcrumbLink = React10.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
6162
6159
|
const Comp = asChild ? Slot : "a";
|
|
6163
6160
|
return /* @__PURE__ */ jsx(
|
|
6164
6161
|
Comp,
|
|
@@ -6170,7 +6167,7 @@ var BreadcrumbLink = React49.forwardRef(({ asChild, className, ...props }, ref)
|
|
|
6170
6167
|
);
|
|
6171
6168
|
});
|
|
6172
6169
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
6173
|
-
var BreadcrumbPage =
|
|
6170
|
+
var BreadcrumbPage = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6174
6171
|
"span",
|
|
6175
6172
|
{
|
|
6176
6173
|
ref,
|
|
@@ -6306,16 +6303,16 @@ var SectionHeader = Object.assign(SectionHeaderRoot, {
|
|
|
6306
6303
|
Actions: SectionHeaderActions,
|
|
6307
6304
|
Badge: SectionHeaderBadge
|
|
6308
6305
|
});
|
|
6309
|
-
var KanbanContext =
|
|
6306
|
+
var KanbanContext = React10.createContext(null);
|
|
6310
6307
|
function useKanban() {
|
|
6311
|
-
const context =
|
|
6308
|
+
const context = React10.useContext(KanbanContext);
|
|
6312
6309
|
if (!context) {
|
|
6313
6310
|
throw new Error("useKanban must be used within a Kanban.Board component");
|
|
6314
6311
|
}
|
|
6315
6312
|
return context;
|
|
6316
6313
|
}
|
|
6317
6314
|
function useKanbanOptional() {
|
|
6318
|
-
return
|
|
6315
|
+
return React10.useContext(KanbanContext);
|
|
6319
6316
|
}
|
|
6320
6317
|
function KanbanProvider({ children, value }) {
|
|
6321
6318
|
return /* @__PURE__ */ jsx(KanbanContext.Provider, { value, children });
|
|
@@ -6326,18 +6323,18 @@ function KanbanBoard({
|
|
|
6326
6323
|
onDragStart,
|
|
6327
6324
|
className
|
|
6328
6325
|
}) {
|
|
6329
|
-
const [isDragging, setIsDragging] =
|
|
6330
|
-
const [draggedItemId, setDraggedItemId] =
|
|
6331
|
-
const [sourceColumnId, setSourceColumnId] =
|
|
6332
|
-
const [hoveredColumnId, setHoveredColumnId] =
|
|
6333
|
-
const dropValidatorsRef =
|
|
6334
|
-
const registerDropValidator =
|
|
6326
|
+
const [isDragging, setIsDragging] = React10.useState(false);
|
|
6327
|
+
const [draggedItemId, setDraggedItemId] = React10.useState(null);
|
|
6328
|
+
const [sourceColumnId, setSourceColumnId] = React10.useState(null);
|
|
6329
|
+
const [hoveredColumnId, setHoveredColumnId] = React10.useState(null);
|
|
6330
|
+
const dropValidatorsRef = React10.useRef(/* @__PURE__ */ new Map());
|
|
6331
|
+
const registerDropValidator = React10.useCallback((columnId, validator) => {
|
|
6335
6332
|
dropValidatorsRef.current.set(columnId, validator);
|
|
6336
6333
|
}, []);
|
|
6337
|
-
const unregisterDropValidator =
|
|
6334
|
+
const unregisterDropValidator = React10.useCallback((columnId) => {
|
|
6338
6335
|
dropValidatorsRef.current.delete(columnId);
|
|
6339
6336
|
}, []);
|
|
6340
|
-
const canDropInColumn =
|
|
6337
|
+
const canDropInColumn = React10.useCallback((columnId) => {
|
|
6341
6338
|
if (!draggedItemId || !sourceColumnId) return false;
|
|
6342
6339
|
if (columnId === sourceColumnId) return false;
|
|
6343
6340
|
const validator = dropValidatorsRef.current.get(columnId);
|
|
@@ -6346,13 +6343,13 @@ function KanbanBoard({
|
|
|
6346
6343
|
}
|
|
6347
6344
|
return true;
|
|
6348
6345
|
}, [draggedItemId, sourceColumnId]);
|
|
6349
|
-
const handleDragStart =
|
|
6346
|
+
const handleDragStart = React10.useCallback((itemId, colId) => {
|
|
6350
6347
|
setIsDragging(true);
|
|
6351
6348
|
setDraggedItemId(itemId);
|
|
6352
6349
|
setSourceColumnId(colId);
|
|
6353
6350
|
onDragStart?.(itemId, colId);
|
|
6354
6351
|
}, [onDragStart]);
|
|
6355
|
-
const handleDrop =
|
|
6352
|
+
const handleDrop = React10.useCallback((destinationColumnId) => {
|
|
6356
6353
|
if (draggedItemId && sourceColumnId && destinationColumnId !== sourceColumnId) {
|
|
6357
6354
|
if (canDropInColumn(destinationColumnId)) {
|
|
6358
6355
|
const result = {
|
|
@@ -6368,13 +6365,13 @@ function KanbanBoard({
|
|
|
6368
6365
|
setSourceColumnId(null);
|
|
6369
6366
|
setHoveredColumnId(null);
|
|
6370
6367
|
}, [draggedItemId, sourceColumnId, canDropInColumn, onDragEnd]);
|
|
6371
|
-
const handleDragEnd =
|
|
6368
|
+
const handleDragEnd = React10.useCallback(() => {
|
|
6372
6369
|
setIsDragging(false);
|
|
6373
6370
|
setDraggedItemId(null);
|
|
6374
6371
|
setSourceColumnId(null);
|
|
6375
6372
|
setHoveredColumnId(null);
|
|
6376
6373
|
}, []);
|
|
6377
|
-
const contextValue =
|
|
6374
|
+
const contextValue = React10.useMemo(() => ({
|
|
6378
6375
|
isDragging,
|
|
6379
6376
|
draggedItemId,
|
|
6380
6377
|
sourceColumnId,
|
|
@@ -6399,9 +6396,9 @@ function KanbanBoard({
|
|
|
6399
6396
|
}
|
|
6400
6397
|
) });
|
|
6401
6398
|
}
|
|
6402
|
-
var KanbanBoardInternalContext =
|
|
6399
|
+
var KanbanBoardInternalContext = React10.createContext(null);
|
|
6403
6400
|
function useKanbanBoard() {
|
|
6404
|
-
const context =
|
|
6401
|
+
const context = React10.useContext(KanbanBoardInternalContext);
|
|
6405
6402
|
if (!context) {
|
|
6406
6403
|
throw new Error("useKanbanBoard must be used within a Kanban.Board component");
|
|
6407
6404
|
}
|
|
@@ -6421,7 +6418,7 @@ function KanbanColumn({
|
|
|
6421
6418
|
}) {
|
|
6422
6419
|
const { isDragging, sourceColumnId, hoveredColumnId, setHoveredColumnId, canDropInColumn, registerDropValidator, unregisterDropValidator } = useKanban();
|
|
6423
6420
|
const { handleDrop } = useKanbanBoard();
|
|
6424
|
-
|
|
6421
|
+
React10.useEffect(() => {
|
|
6425
6422
|
if (canDrop) {
|
|
6426
6423
|
registerDropValidator(id, canDrop);
|
|
6427
6424
|
return () => unregisterDropValidator(id);
|
|
@@ -6430,7 +6427,7 @@ function KanbanColumn({
|
|
|
6430
6427
|
const isValidDropTarget = isDragging && sourceColumnId !== id && canDropInColumn(id);
|
|
6431
6428
|
const isInvalidDropTarget = isDragging && sourceColumnId !== id && !canDropInColumn(id);
|
|
6432
6429
|
const isHovered = hoveredColumnId === id;
|
|
6433
|
-
const handleDragOver =
|
|
6430
|
+
const handleDragOver = React10.useCallback((e) => {
|
|
6434
6431
|
e.preventDefault();
|
|
6435
6432
|
if (isValidDropTarget) {
|
|
6436
6433
|
e.dataTransfer.dropEffect = "move";
|
|
@@ -6439,18 +6436,18 @@ function KanbanColumn({
|
|
|
6439
6436
|
e.dataTransfer.dropEffect = "none";
|
|
6440
6437
|
}
|
|
6441
6438
|
}, [isValidDropTarget, setHoveredColumnId, id]);
|
|
6442
|
-
const handleDragLeave =
|
|
6439
|
+
const handleDragLeave = React10.useCallback((e) => {
|
|
6443
6440
|
if (e.currentTarget === e.target || !e.currentTarget.contains(e.relatedTarget)) {
|
|
6444
6441
|
setHoveredColumnId(null);
|
|
6445
6442
|
}
|
|
6446
6443
|
}, [setHoveredColumnId]);
|
|
6447
|
-
const handleDropEvent =
|
|
6444
|
+
const handleDropEvent = React10.useCallback((e) => {
|
|
6448
6445
|
e.preventDefault();
|
|
6449
6446
|
if (isValidDropTarget) {
|
|
6450
6447
|
handleDrop(id);
|
|
6451
6448
|
}
|
|
6452
6449
|
}, [isValidDropTarget, handleDrop, id]);
|
|
6453
|
-
const childCount =
|
|
6450
|
+
const childCount = React10.Children.count(children);
|
|
6454
6451
|
const displayCount = count ?? childCount;
|
|
6455
6452
|
return /* @__PURE__ */ jsxs(
|
|
6456
6453
|
"div",
|
|
@@ -6511,7 +6508,7 @@ function KanbanCard({
|
|
|
6511
6508
|
const { draggedItemId } = useKanban();
|
|
6512
6509
|
const { handleDragStart } = useKanbanBoard();
|
|
6513
6510
|
const isThisCardDragging = draggedItemId === id;
|
|
6514
|
-
const handleDragStartEvent =
|
|
6511
|
+
const handleDragStartEvent = React10.useCallback((e) => {
|
|
6515
6512
|
if (disabled) {
|
|
6516
6513
|
e.preventDefault();
|
|
6517
6514
|
return;
|
|
@@ -6571,15 +6568,15 @@ var itemCardVariants = cva(
|
|
|
6571
6568
|
}
|
|
6572
6569
|
}
|
|
6573
6570
|
);
|
|
6574
|
-
var ItemCardContext =
|
|
6571
|
+
var ItemCardContext = React10.createContext(null);
|
|
6575
6572
|
function useItemCard() {
|
|
6576
|
-
const context =
|
|
6573
|
+
const context = React10.useContext(ItemCardContext);
|
|
6577
6574
|
if (!context) {
|
|
6578
6575
|
throw new Error("ItemCard components must be used within ItemCard.Root");
|
|
6579
6576
|
}
|
|
6580
6577
|
return context;
|
|
6581
6578
|
}
|
|
6582
|
-
var ItemCardRoot =
|
|
6579
|
+
var ItemCardRoot = React10.forwardRef(
|
|
6583
6580
|
({
|
|
6584
6581
|
className,
|
|
6585
6582
|
variant,
|
|
@@ -6589,7 +6586,7 @@ var ItemCardRoot = React49.forwardRef(
|
|
|
6589
6586
|
children,
|
|
6590
6587
|
...props
|
|
6591
6588
|
}, ref) => {
|
|
6592
|
-
const contextValue =
|
|
6589
|
+
const contextValue = React10.useMemo(
|
|
6593
6590
|
() => ({ isSelected: selected }),
|
|
6594
6591
|
[selected]
|
|
6595
6592
|
);
|
|
@@ -6633,7 +6630,7 @@ var itemCardBadgeVariants = cva(
|
|
|
6633
6630
|
}
|
|
6634
6631
|
}
|
|
6635
6632
|
);
|
|
6636
|
-
var ItemCardBadge =
|
|
6633
|
+
var ItemCardBadge = React10.forwardRef(
|
|
6637
6634
|
({ className, variant, children, ...props }, ref) => {
|
|
6638
6635
|
return /* @__PURE__ */ jsx(
|
|
6639
6636
|
"div",
|
|
@@ -6647,7 +6644,7 @@ var ItemCardBadge = React49.forwardRef(
|
|
|
6647
6644
|
}
|
|
6648
6645
|
);
|
|
6649
6646
|
ItemCardBadge.displayName = "ItemCardBadge";
|
|
6650
|
-
var ItemCardHeader =
|
|
6647
|
+
var ItemCardHeader = React10.forwardRef(
|
|
6651
6648
|
({ className, align = "between", children, ...props }, ref) => {
|
|
6652
6649
|
const alignmentClasses = {
|
|
6653
6650
|
left: "justify-start",
|
|
@@ -6696,7 +6693,7 @@ var itemCardIconVariants = cva(
|
|
|
6696
6693
|
}
|
|
6697
6694
|
}
|
|
6698
6695
|
);
|
|
6699
|
-
var ItemCardIcon =
|
|
6696
|
+
var ItemCardIcon = React10.forwardRef(
|
|
6700
6697
|
({ className, size, variant, ripple = false, children, ...props }, ref) => {
|
|
6701
6698
|
const wrapperSizeClasses = {
|
|
6702
6699
|
sm: "w-10 h-10",
|
|
@@ -6738,7 +6735,7 @@ var ItemCardIcon = React49.forwardRef(
|
|
|
6738
6735
|
}
|
|
6739
6736
|
);
|
|
6740
6737
|
ItemCardIcon.displayName = "ItemCardIcon";
|
|
6741
|
-
var ItemCardTitleGroup =
|
|
6738
|
+
var ItemCardTitleGroup = React10.forwardRef(
|
|
6742
6739
|
({ className, align = "right", children, ...props }, ref) => {
|
|
6743
6740
|
const alignmentClasses = {
|
|
6744
6741
|
left: "text-left",
|
|
@@ -6757,7 +6754,7 @@ var ItemCardTitleGroup = React49.forwardRef(
|
|
|
6757
6754
|
}
|
|
6758
6755
|
);
|
|
6759
6756
|
ItemCardTitleGroup.displayName = "ItemCardTitleGroup";
|
|
6760
|
-
var ItemCardTitle =
|
|
6757
|
+
var ItemCardTitle = React10.forwardRef(
|
|
6761
6758
|
({ className, children, ...props }, ref) => {
|
|
6762
6759
|
return /* @__PURE__ */ jsx(
|
|
6763
6760
|
"h3",
|
|
@@ -6771,7 +6768,7 @@ var ItemCardTitle = React49.forwardRef(
|
|
|
6771
6768
|
}
|
|
6772
6769
|
);
|
|
6773
6770
|
ItemCardTitle.displayName = "ItemCardTitle";
|
|
6774
|
-
var ItemCardSubtitle =
|
|
6771
|
+
var ItemCardSubtitle = React10.forwardRef(
|
|
6775
6772
|
({ className, children, ...props }, ref) => {
|
|
6776
6773
|
return /* @__PURE__ */ jsx(
|
|
6777
6774
|
"p",
|
|
@@ -6785,7 +6782,7 @@ var ItemCardSubtitle = React49.forwardRef(
|
|
|
6785
6782
|
}
|
|
6786
6783
|
);
|
|
6787
6784
|
ItemCardSubtitle.displayName = "ItemCardSubtitle";
|
|
6788
|
-
var ItemCardContent =
|
|
6785
|
+
var ItemCardContent = React10.forwardRef(
|
|
6789
6786
|
({ className, muted = true, children, ...props }, ref) => {
|
|
6790
6787
|
return /* @__PURE__ */ jsx(
|
|
6791
6788
|
"div",
|
|
@@ -6803,7 +6800,7 @@ var ItemCardContent = React49.forwardRef(
|
|
|
6803
6800
|
}
|
|
6804
6801
|
);
|
|
6805
6802
|
ItemCardContent.displayName = "ItemCardContent";
|
|
6806
|
-
var ItemCardContentItem =
|
|
6803
|
+
var ItemCardContentItem = React10.forwardRef(
|
|
6807
6804
|
({ className, label, value, secondary, children, ...props }, ref) => {
|
|
6808
6805
|
if (children) {
|
|
6809
6806
|
return /* @__PURE__ */ jsx(
|
|
@@ -6838,7 +6835,7 @@ var ItemCardContentItem = React49.forwardRef(
|
|
|
6838
6835
|
}
|
|
6839
6836
|
);
|
|
6840
6837
|
ItemCardContentItem.displayName = "ItemCardContentItem";
|
|
6841
|
-
var ItemCardEmpty =
|
|
6838
|
+
var ItemCardEmpty = React10.forwardRef(
|
|
6842
6839
|
({ className, icon, message = "Nenhum item", children, ...props }, ref) => {
|
|
6843
6840
|
return /* @__PURE__ */ jsxs(
|
|
6844
6841
|
"div",
|
|
@@ -6858,7 +6855,7 @@ var ItemCardEmpty = React49.forwardRef(
|
|
|
6858
6855
|
}
|
|
6859
6856
|
);
|
|
6860
6857
|
ItemCardEmpty.displayName = "ItemCardEmpty";
|
|
6861
|
-
var ItemCardFooter =
|
|
6858
|
+
var ItemCardFooter = React10.forwardRef(
|
|
6862
6859
|
({ className, children, ...props }, ref) => {
|
|
6863
6860
|
return /* @__PURE__ */ jsx(
|
|
6864
6861
|
"div",
|
|
@@ -6875,7 +6872,7 @@ var ItemCardFooter = React49.forwardRef(
|
|
|
6875
6872
|
}
|
|
6876
6873
|
);
|
|
6877
6874
|
ItemCardFooter.displayName = "ItemCardFooter";
|
|
6878
|
-
var ItemCardFooterItem =
|
|
6875
|
+
var ItemCardFooterItem = React10.forwardRef(
|
|
6879
6876
|
({ className, label, value, align = "left", ...props }, ref) => {
|
|
6880
6877
|
return /* @__PURE__ */ jsxs(
|
|
6881
6878
|
"div",
|
|
@@ -6896,7 +6893,7 @@ var ItemCardFooterItem = React49.forwardRef(
|
|
|
6896
6893
|
}
|
|
6897
6894
|
);
|
|
6898
6895
|
ItemCardFooterItem.displayName = "ItemCardFooterItem";
|
|
6899
|
-
var ItemCardFooterDivider =
|
|
6896
|
+
var ItemCardFooterDivider = React10.forwardRef(
|
|
6900
6897
|
({ className, ...props }, ref) => {
|
|
6901
6898
|
return /* @__PURE__ */ jsx(
|
|
6902
6899
|
"div",
|
|
@@ -6909,7 +6906,7 @@ var ItemCardFooterDivider = React49.forwardRef(
|
|
|
6909
6906
|
}
|
|
6910
6907
|
);
|
|
6911
6908
|
ItemCardFooterDivider.displayName = "ItemCardFooterDivider";
|
|
6912
|
-
var ItemCardActions =
|
|
6909
|
+
var ItemCardActions = React10.forwardRef(
|
|
6913
6910
|
({ className, bordered = true, children, ...props }, ref) => {
|
|
6914
6911
|
return /* @__PURE__ */ jsx(
|
|
6915
6912
|
"div",
|
|
@@ -6927,7 +6924,7 @@ var ItemCardActions = React49.forwardRef(
|
|
|
6927
6924
|
}
|
|
6928
6925
|
);
|
|
6929
6926
|
ItemCardActions.displayName = "ItemCardActions";
|
|
6930
|
-
var ItemCardActionButton =
|
|
6927
|
+
var ItemCardActionButton = React10.forwardRef(
|
|
6931
6928
|
({
|
|
6932
6929
|
className,
|
|
6933
6930
|
showArrow = true,
|
|
@@ -6968,7 +6965,7 @@ var ItemCardActionButton = React49.forwardRef(
|
|
|
6968
6965
|
}
|
|
6969
6966
|
);
|
|
6970
6967
|
ItemCardActionButton.displayName = "ItemCardActionButton";
|
|
6971
|
-
var ItemCardActionsRow =
|
|
6968
|
+
var ItemCardActionsRow = React10.forwardRef(
|
|
6972
6969
|
({ className, children, ...props }, ref) => {
|
|
6973
6970
|
return /* @__PURE__ */ jsx(
|
|
6974
6971
|
"div",
|
|
@@ -7717,9 +7714,9 @@ function Logo({
|
|
|
7717
7714
|
}
|
|
7718
7715
|
);
|
|
7719
7716
|
}
|
|
7720
|
-
var StatsCardContext =
|
|
7717
|
+
var StatsCardContext = React10.createContext(null);
|
|
7721
7718
|
function useStatsCard() {
|
|
7722
|
-
const context =
|
|
7719
|
+
const context = React10.useContext(StatsCardContext);
|
|
7723
7720
|
if (!context) {
|
|
7724
7721
|
throw new Error("StatsCard components must be used within StatsCard.Root");
|
|
7725
7722
|
}
|
|
@@ -7893,7 +7890,7 @@ function StatsCardChange({ type = "positive", className, children, ...props }) {
|
|
|
7893
7890
|
}
|
|
7894
7891
|
function StatsCardChart({ data, height, className, ...props }) {
|
|
7895
7892
|
const { config, variant } = useStatsCard();
|
|
7896
|
-
const gradientId =
|
|
7893
|
+
const gradientId = React10.useId();
|
|
7897
7894
|
if (variant === "mini") {
|
|
7898
7895
|
return null;
|
|
7899
7896
|
}
|
|
@@ -7987,18 +7984,18 @@ var initialState = {
|
|
|
7987
7984
|
theme: "system",
|
|
7988
7985
|
setTheme: () => null
|
|
7989
7986
|
};
|
|
7990
|
-
var ThemeProviderContext =
|
|
7987
|
+
var ThemeProviderContext = React10.createContext(initialState);
|
|
7991
7988
|
function ThemeProvider({
|
|
7992
7989
|
children,
|
|
7993
7990
|
defaultTheme = "system",
|
|
7994
7991
|
storageKey = "facter-ds-theme",
|
|
7995
7992
|
...props
|
|
7996
7993
|
}) {
|
|
7997
|
-
const [theme, setTheme] =
|
|
7994
|
+
const [theme, setTheme] = React10.useState(
|
|
7998
7995
|
() => localStorage.getItem(storageKey) || defaultTheme
|
|
7999
7996
|
);
|
|
8000
|
-
const [resolvedTheme, setResolvedTheme] =
|
|
8001
|
-
|
|
7997
|
+
const [resolvedTheme, setResolvedTheme] = React10.useState("light");
|
|
7998
|
+
React10.useEffect(() => {
|
|
8002
7999
|
const root = window.document.documentElement;
|
|
8003
8000
|
root.classList.remove("light", "dark");
|
|
8004
8001
|
if (theme === "system") {
|
|
@@ -8010,7 +8007,7 @@ function ThemeProvider({
|
|
|
8010
8007
|
root.classList.add(theme);
|
|
8011
8008
|
setResolvedTheme(theme);
|
|
8012
8009
|
}, [theme]);
|
|
8013
|
-
const value =
|
|
8010
|
+
const value = React10.useMemo(
|
|
8014
8011
|
() => ({
|
|
8015
8012
|
theme,
|
|
8016
8013
|
setTheme: (theme2) => {
|
|
@@ -8023,7 +8020,7 @@ function ThemeProvider({
|
|
|
8023
8020
|
return /* @__PURE__ */ jsx(ThemeProviderContext.Provider, { ...props, value, children: /* @__PURE__ */ jsx("div", { className: resolvedTheme, style: { minHeight: "100vh" }, children }) });
|
|
8024
8021
|
}
|
|
8025
8022
|
var useTheme = () => {
|
|
8026
|
-
const context =
|
|
8023
|
+
const context = React10.useContext(ThemeProviderContext);
|
|
8027
8024
|
if (context === void 0)
|
|
8028
8025
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
8029
8026
|
return context;
|