@tree-ia/design-system 1.5.8 → 1.6.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 +37 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +226 -116
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
|
-
import { AlertCircle, AlertOctagon, AlertTriangle, ArrowDown, ArrowUp, ArrowUpDown, Check, CheckCircle, ChevronDown, ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight, File, GripVertical, Image, Inbox, Info, LogOut, Monitor, Moon, Search, Sun, Upload, User, X, XCircle } from "lucide-react";
|
|
4
|
+
import { AlertCircle, AlertOctagon, AlertTriangle, ArrowDown, ArrowUp, ArrowUpDown, Check, CheckCircle, ChevronDown, ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight, Copy, File, GripVertical, Image, Inbox, Info, Lightbulb, LogOut, Monitor, Moon, Search, ShieldAlert, Sun, Upload, User, X, XCircle } from "lucide-react";
|
|
5
5
|
import { Bar, Doughnut, Line } from "react-chartjs-2";
|
|
6
6
|
import { ArcElement, BarElement, CategoryScale, Chart, Filler, Legend, LineElement, LinearScale, PointElement, Title as Title$1, Tooltip as Tooltip$1 } from "chart.js";
|
|
7
7
|
import { createColumnHelper, flexRender, getCoreRowModel, getFilteredRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from "@tanstack/react-table";
|
|
@@ -35,7 +35,7 @@ function Loading({ size = "md", className = "", text, textColor, color, variant
|
|
|
35
35
|
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/components/Button/index.tsx
|
|
38
|
-
const cn$
|
|
38
|
+
const cn$32 = (...classes) => classes.filter(Boolean).join(" ");
|
|
39
39
|
function Button({ children, variant = "primary", size = "md", isLoading = false, icon, iconPosition = "left", className, disabled, ...props }) {
|
|
40
40
|
const baseStyles = "font-medium rounded-lg transition-all duration-200 ease-out cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center justify-center focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--dashboard-primary,#2563EB)] active:scale-[0.97]";
|
|
41
41
|
const variantStyles = {
|
|
@@ -56,7 +56,7 @@ function Button({ children, variant = "primary", size = "md", isLoading = false,
|
|
|
56
56
|
};
|
|
57
57
|
const isIconOnly = !!icon && (children === void 0 || children === null || typeof children === "string" && children.trim() === "");
|
|
58
58
|
return /* @__PURE__ */ jsx("button", {
|
|
59
|
-
className: cn$
|
|
59
|
+
className: cn$32(baseStyles, variantStyles[variant], isIconOnly ? iconOnlySizeStyles[size] : sizeStyles[size], className),
|
|
60
60
|
disabled: disabled || isLoading,
|
|
61
61
|
...props,
|
|
62
62
|
children: isLoading ? /* @__PURE__ */ jsxs("span", {
|
|
@@ -81,7 +81,7 @@ function Button({ children, variant = "primary", size = "md", isLoading = false,
|
|
|
81
81
|
|
|
82
82
|
//#endregion
|
|
83
83
|
//#region src/components/Input/index.tsx
|
|
84
|
-
const cn$
|
|
84
|
+
const cn$31 = (...classes) => classes.filter(Boolean).join(" ");
|
|
85
85
|
const Input = React.forwardRef(({ className, type = "text", label, error, children, id, ...props }, ref) => {
|
|
86
86
|
const inputId = id || (label ? `input-${label.toLowerCase().replace(/\s+/g, "-")}` : void 0);
|
|
87
87
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -97,7 +97,7 @@ const Input = React.forwardRef(({ className, type = "text", label, error, childr
|
|
|
97
97
|
children: [/* @__PURE__ */ jsx("input", {
|
|
98
98
|
type,
|
|
99
99
|
id: inputId,
|
|
100
|
-
className: cn$
|
|
100
|
+
className: cn$31("flex h-10 w-full rounded-md border border-[var(--dashboard-text-secondary,#6b7280)]/30 bg-[var(--dashboard-surface,#ffffff)] px-3 py-2 text-sm text-[var(--dashboard-text-primary,#2d2d2d)] shadow-sm transition-colors duration-200 focus:border-[var(--dashboard-primary,#37a501)] placeholder:text-[var(--dashboard-text-secondary,#6b7280)] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", error ? "border-[var(--dashboard-status-danger,#EF4444)] focus:border-[var(--dashboard-status-danger,#EF4444)]" : void 0, children ? "pr-10" : void 0, className),
|
|
101
101
|
ref,
|
|
102
102
|
...props
|
|
103
103
|
}), children && /* @__PURE__ */ jsx("div", {
|
|
@@ -751,16 +751,16 @@ function FormField({ label, name, type = "text", value, onChange, error, require
|
|
|
751
751
|
|
|
752
752
|
//#endregion
|
|
753
753
|
//#region src/components/Tabs/index.tsx
|
|
754
|
-
const cn$
|
|
754
|
+
const cn$30 = (...classes) => classes.filter(Boolean).join(" ");
|
|
755
755
|
function Tabs({ tabs, activeTab, onChange, variant = "underline", className }) {
|
|
756
756
|
if (variant === "pill") return /* @__PURE__ */ jsx("div", {
|
|
757
|
-
className: cn$
|
|
757
|
+
className: cn$30("flex flex-wrap gap-2", className),
|
|
758
758
|
role: "tablist",
|
|
759
759
|
children: tabs.map((tab) => {
|
|
760
760
|
const isActive = activeTab === tab.id;
|
|
761
761
|
return /* @__PURE__ */ jsxs("button", {
|
|
762
762
|
onClick: () => onChange(tab.id),
|
|
763
|
-
className: cn$
|
|
763
|
+
className: cn$30("flex items-center gap-2 px-4 py-2 rounded-full text-sm font-medium transition-colors cursor-pointer", isActive ? "bg-[var(--dashboard-primary,#37a501)] text-white" : "bg-[var(--dashboard-text-secondary,#6b7280)]/10 text-[var(--dashboard-text-secondary,#6b7280)] hover:bg-[var(--dashboard-text-secondary,#6b7280)]/20"),
|
|
764
764
|
role: "tab",
|
|
765
765
|
"aria-selected": isActive,
|
|
766
766
|
children: [
|
|
@@ -770,7 +770,7 @@ function Tabs({ tabs, activeTab, onChange, variant = "underline", className }) {
|
|
|
770
770
|
}),
|
|
771
771
|
tab.label,
|
|
772
772
|
tab.count !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
773
|
-
className: cn$
|
|
773
|
+
className: cn$30("ml-1 text-xs rounded-full px-1.5 py-0.5", isActive ? "bg-white/20 text-white" : "bg-[var(--dashboard-text-secondary,#6b7280)]/10 text-[var(--dashboard-text-secondary,#6b7280)]"),
|
|
774
774
|
children: tab.count
|
|
775
775
|
})
|
|
776
776
|
]
|
|
@@ -778,7 +778,7 @@ function Tabs({ tabs, activeTab, onChange, variant = "underline", className }) {
|
|
|
778
778
|
})
|
|
779
779
|
});
|
|
780
780
|
return /* @__PURE__ */ jsx("div", {
|
|
781
|
-
className: cn$
|
|
781
|
+
className: cn$30("border-b border-[var(--dashboard-text-secondary,#6b7280)]/20", className),
|
|
782
782
|
children: /* @__PURE__ */ jsx("nav", {
|
|
783
783
|
className: "flex gap-6",
|
|
784
784
|
"aria-label": "Tabs",
|
|
@@ -786,7 +786,7 @@ function Tabs({ tabs, activeTab, onChange, variant = "underline", className }) {
|
|
|
786
786
|
const isActive = activeTab === tab.id;
|
|
787
787
|
return /* @__PURE__ */ jsxs("button", {
|
|
788
788
|
onClick: () => onChange(tab.id),
|
|
789
|
-
className: cn$
|
|
789
|
+
className: cn$30("relative pb-3 px-1 text-sm font-medium transition-colors border-b-2 flex items-center gap-2 cursor-pointer", isActive ? "text-[var(--dashboard-primary,#37a501)] border-[var(--dashboard-primary,#37a501)]" : "text-[var(--dashboard-text-secondary,#6b7280)] hover:text-[var(--dashboard-text-primary,#2d2d2d)] border-transparent"),
|
|
790
790
|
role: "tab",
|
|
791
791
|
"aria-selected": isActive,
|
|
792
792
|
children: [
|
|
@@ -796,7 +796,7 @@ function Tabs({ tabs, activeTab, onChange, variant = "underline", className }) {
|
|
|
796
796
|
}),
|
|
797
797
|
tab.label,
|
|
798
798
|
tab.count !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
799
|
-
className: cn$
|
|
799
|
+
className: cn$30("ml-1 text-xs rounded-full px-1.5 py-0.5", isActive ? "bg-[var(--dashboard-primary,#37a501)]/10 text-[var(--dashboard-primary,#37a501)]" : "bg-[var(--dashboard-text-secondary,#6b7280)]/10 text-[var(--dashboard-text-secondary,#6b7280)]"),
|
|
800
800
|
children: tab.count
|
|
801
801
|
})
|
|
802
802
|
]
|
|
@@ -808,7 +808,7 @@ function Tabs({ tabs, activeTab, onChange, variant = "underline", className }) {
|
|
|
808
808
|
|
|
809
809
|
//#endregion
|
|
810
810
|
//#region src/components/DateRangePicker/index.tsx
|
|
811
|
-
const cn$
|
|
811
|
+
const cn$29 = (...classes) => classes.filter(Boolean).join(" ");
|
|
812
812
|
const locales = {
|
|
813
813
|
pt: {
|
|
814
814
|
months: [
|
|
@@ -915,7 +915,7 @@ function DateRangePicker({ value, onChange, locale = "pt", className }) {
|
|
|
915
915
|
};
|
|
916
916
|
const days = getDaysInMonth(currentMonth);
|
|
917
917
|
return /* @__PURE__ */ jsxs("div", {
|
|
918
|
-
className: cn$
|
|
918
|
+
className: cn$29("w-64 bg-[var(--dashboard-surface,#ffffff)] rounded-lg p-4 shadow-sm border border-[var(--dashboard-text-secondary,#6b7280)]/20", className),
|
|
919
919
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
920
920
|
className: "flex items-center justify-between mb-4",
|
|
921
921
|
children: [
|
|
@@ -953,9 +953,9 @@ function DateRangePicker({ value, onChange, locale = "pt", className }) {
|
|
|
953
953
|
const isSelected = isStart || isEnd;
|
|
954
954
|
return /* @__PURE__ */ jsxs("div", {
|
|
955
955
|
className: "relative h-8 w-8",
|
|
956
|
-
children: [value.start && value.end && (inRange || isStart || isEnd) && /* @__PURE__ */ jsx("div", { className: cn$
|
|
956
|
+
children: [value.start && value.end && (inRange || isStart || isEnd) && /* @__PURE__ */ jsx("div", { className: cn$29("absolute inset-0 bg-[var(--dashboard-text-secondary,#6b7280)]/10", isStart && "rounded-l-full", isEnd && "rounded-r-full") }), /* @__PURE__ */ jsx("button", {
|
|
957
957
|
onClick: () => handleDayClick(day),
|
|
958
|
-
className: cn$
|
|
958
|
+
className: cn$29("relative h-8 w-8 flex items-center justify-center text-xs font-medium transition-colors z-10 rounded-full cursor-pointer", isSelected ? "bg-[var(--dashboard-primary,#37a501)] text-white hover:opacity-90" : "text-[var(--dashboard-text-primary,#2d2d2d)] hover:bg-[var(--dashboard-text-secondary,#6b7280)]/20"),
|
|
959
959
|
children: day
|
|
960
960
|
})]
|
|
961
961
|
}, day);
|
|
@@ -966,7 +966,7 @@ function DateRangePicker({ value, onChange, locale = "pt", className }) {
|
|
|
966
966
|
|
|
967
967
|
//#endregion
|
|
968
968
|
//#region src/components/Title/index.tsx
|
|
969
|
-
const cn$
|
|
969
|
+
const cn$28 = (...classes) => classes.filter(Boolean).join(" ");
|
|
970
970
|
const defaultSizeByLevel = {
|
|
971
971
|
1: "text-2xl sm:text-3xl md:text-4xl lg:text-5xl",
|
|
972
972
|
2: "text-xl sm:text-2xl md:text-3xl lg:text-4xl",
|
|
@@ -1001,7 +1001,7 @@ function Title({ children, level = 1, size, weight = "bold", align = "left", col
|
|
|
1001
1001
|
const sizeClass = size ? customSizes[size] : defaultSizeByLevel[level];
|
|
1002
1002
|
const colorClass = color || "text-[var(--dashboard-text-primary,#2d2d2d)]";
|
|
1003
1003
|
return /* @__PURE__ */ jsx(Tag, {
|
|
1004
|
-
className: cn$
|
|
1004
|
+
className: cn$28(sizeClass, weightStyles[weight], alignStyles[align], colorClass, className),
|
|
1005
1005
|
...props,
|
|
1006
1006
|
children
|
|
1007
1007
|
});
|
|
@@ -1009,7 +1009,7 @@ function Title({ children, level = 1, size, weight = "bold", align = "left", col
|
|
|
1009
1009
|
|
|
1010
1010
|
//#endregion
|
|
1011
1011
|
//#region src/components/ToggleSwitch/index.tsx
|
|
1012
|
-
const cn$
|
|
1012
|
+
const cn$27 = (...classes) => classes.filter(Boolean).join(" ");
|
|
1013
1013
|
const sizeConfig$1 = {
|
|
1014
1014
|
sm: {
|
|
1015
1015
|
track: "h-5 w-9",
|
|
@@ -1033,7 +1033,7 @@ const sizeConfig$1 = {
|
|
|
1033
1033
|
function ToggleSwitch({ enabled, onChange, disabled = false, size = "md", label, className }) {
|
|
1034
1034
|
const config = sizeConfig$1[size];
|
|
1035
1035
|
return /* @__PURE__ */ jsxs("div", {
|
|
1036
|
-
className: cn$
|
|
1036
|
+
className: cn$27("inline-flex items-center gap-2", className),
|
|
1037
1037
|
children: [/* @__PURE__ */ jsx("button", {
|
|
1038
1038
|
type: "button",
|
|
1039
1039
|
role: "switch",
|
|
@@ -1041,10 +1041,10 @@ function ToggleSwitch({ enabled, onChange, disabled = false, size = "md", label,
|
|
|
1041
1041
|
"aria-label": label,
|
|
1042
1042
|
disabled,
|
|
1043
1043
|
onClick: () => onChange(!enabled),
|
|
1044
|
-
className: cn$
|
|
1045
|
-
children: /* @__PURE__ */ jsx("span", { className: cn$
|
|
1044
|
+
className: cn$27("relative inline-flex items-center rounded-full transition-colors outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[var(--dashboard-primary,#37a501)]", config.track, enabled ? "bg-[var(--dashboard-primary,#37a501)]" : "bg-[var(--dashboard-text-secondary,#6b7280)]/30", disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"),
|
|
1045
|
+
children: /* @__PURE__ */ jsx("span", { className: cn$27("inline-block transform rounded-full bg-white shadow-sm transition-transform", config.thumb, enabled ? config.translateOn : config.translateOff) })
|
|
1046
1046
|
}), label && /* @__PURE__ */ jsx("span", {
|
|
1047
|
-
className: cn$
|
|
1047
|
+
className: cn$27("text-sm text-[var(--dashboard-text-primary,#2d2d2d)]", disabled && "opacity-50"),
|
|
1048
1048
|
children: label
|
|
1049
1049
|
})]
|
|
1050
1050
|
});
|
|
@@ -1052,7 +1052,7 @@ function ToggleSwitch({ enabled, onChange, disabled = false, size = "md", label,
|
|
|
1052
1052
|
|
|
1053
1053
|
//#endregion
|
|
1054
1054
|
//#region src/components/BadgeStatus/index.tsx
|
|
1055
|
-
const cn$
|
|
1055
|
+
const cn$26 = (...classes) => classes.filter(Boolean).join(" ");
|
|
1056
1056
|
const variantStyles = {
|
|
1057
1057
|
success: {
|
|
1058
1058
|
color: "text-[var(--dashboard-status-success,#10B981)]",
|
|
@@ -1083,7 +1083,7 @@ function BadgeStatus({ label, variant = "neutral", color, bgColor, size = "md",
|
|
|
1083
1083
|
const styles = variantStyles[variant];
|
|
1084
1084
|
const useCustomColors = color || bgColor;
|
|
1085
1085
|
return /* @__PURE__ */ jsx("span", {
|
|
1086
|
-
className: cn$
|
|
1086
|
+
className: cn$26("inline-flex items-center rounded-full font-medium whitespace-nowrap", sizeClasses$1[size], !useCustomColors && styles.color, !useCustomColors && styles.bgColor, className),
|
|
1087
1087
|
style: useCustomColors ? {
|
|
1088
1088
|
color: color || void 0,
|
|
1089
1089
|
backgroundColor: bgColor || void 0
|
|
@@ -1094,7 +1094,7 @@ function BadgeStatus({ label, variant = "neutral", color, bgColor, size = "md",
|
|
|
1094
1094
|
|
|
1095
1095
|
//#endregion
|
|
1096
1096
|
//#region src/components/Sidebar/index.tsx
|
|
1097
|
-
const cn$
|
|
1097
|
+
const cn$25 = (...classes) => classes.filter(Boolean).join(" ");
|
|
1098
1098
|
function DefaultLink({ href, className, children }) {
|
|
1099
1099
|
return /* @__PURE__ */ jsx("a", {
|
|
1100
1100
|
href,
|
|
@@ -1170,7 +1170,7 @@ function Sidebar({ menuItems, logo, collapsedLogo, currentPath, linkComponent: L
|
|
|
1170
1170
|
const isChildActive = item.children?.some((c) => currentPath === c.href);
|
|
1171
1171
|
if (hasChildren) return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("button", {
|
|
1172
1172
|
onClick: () => toggleExpand(item.id),
|
|
1173
|
-
className: cn$
|
|
1173
|
+
className: cn$25("w-full flex items-center px-4 py-3 rounded-lg text-sm font-medium cursor-pointer", collapsed && !mobile ? "justify-center" : "justify-start", isChildActive ? "text-[var(--dashboard-sidebar-active-text,#ff521d)]" : "text-[var(--dashboard-sidebar-text,#403f52)] hover:bg-[var(--dashboard-primary,#ff521d)]/10"),
|
|
1174
1174
|
style: { transition: "background-color 200ms, color 200ms" },
|
|
1175
1175
|
title: collapsed && !mobile ? item.label : void 0,
|
|
1176
1176
|
children: [/* @__PURE__ */ jsx(Icon, {
|
|
@@ -1185,7 +1185,7 @@ function Sidebar({ menuItems, logo, collapsedLogo, currentPath, linkComponent: L
|
|
|
1185
1185
|
children: item.label
|
|
1186
1186
|
}), /* @__PURE__ */ jsx(ChevronRight, {
|
|
1187
1187
|
size: 14,
|
|
1188
|
-
className: cn$
|
|
1188
|
+
className: cn$25("ml-auto flex-shrink-0 transition-transform duration-200", isExpanded ? "rotate-90" : "")
|
|
1189
1189
|
})] })]
|
|
1190
1190
|
}), (!collapsed || mobile) && /* @__PURE__ */ jsx("div", {
|
|
1191
1191
|
className: "overflow-hidden transition-all duration-200 ml-7 border-l-2 border-[var(--dashboard-sidebar-border,#e0dfe3)]",
|
|
@@ -1197,7 +1197,7 @@ function Sidebar({ menuItems, logo, collapsedLogo, currentPath, linkComponent: L
|
|
|
1197
1197
|
href: child.href,
|
|
1198
1198
|
className: "block",
|
|
1199
1199
|
children: /* @__PURE__ */ jsxs("div", {
|
|
1200
|
-
className: cn$
|
|
1200
|
+
className: cn$25("w-full flex items-center pl-4 pr-4 py-2 rounded-r-lg text-[13px] cursor-pointer", childActive ? "text-[var(--dashboard-sidebar-active-text,#ff521d)] font-semibold border-l-2 border-[var(--dashboard-primary,#ff521d)] -ml-[2px]" : "text-[var(--dashboard-sidebar-text,#403f52)] hover:text-[var(--dashboard-sidebar-active-text,#ff521d)]"),
|
|
1201
1201
|
style: { transition: "background-color 200ms, color 200ms" },
|
|
1202
1202
|
children: [/* @__PURE__ */ jsx(ChildIcon, {
|
|
1203
1203
|
size: 15,
|
|
@@ -1214,7 +1214,7 @@ function Sidebar({ menuItems, logo, collapsedLogo, currentPath, linkComponent: L
|
|
|
1214
1214
|
href: item.href,
|
|
1215
1215
|
className: "block",
|
|
1216
1216
|
children: /* @__PURE__ */ jsxs("div", {
|
|
1217
|
-
className: cn$
|
|
1217
|
+
className: cn$25("w-full flex items-center px-4 py-3 rounded-lg text-sm font-medium cursor-pointer", collapsed && !mobile ? "justify-center" : "justify-start", isActive ? "bg-[var(--dashboard-primary,#ff521d)]/25 text-[var(--dashboard-sidebar-active-text,#ff521d)]" : "text-[var(--dashboard-sidebar-text,#403f52)] hover:bg-[var(--dashboard-primary,#ff521d)]/10"),
|
|
1218
1218
|
style: { transition: "background-color 200ms, color 200ms" },
|
|
1219
1219
|
title: collapsed && !mobile ? item.label : void 0,
|
|
1220
1220
|
children: [/* @__PURE__ */ jsx(Icon, {
|
|
@@ -1308,7 +1308,7 @@ function Sidebar({ menuItems, logo, collapsedLogo, currentPath, linkComponent: L
|
|
|
1308
1308
|
})
|
|
1309
1309
|
})]
|
|
1310
1310
|
}), /* @__PURE__ */ jsxs("aside", {
|
|
1311
|
-
className: cn$
|
|
1311
|
+
className: cn$25("hidden xl:flex xl:flex-col xl:fixed xl:left-0 xl:top-0 xl:h-screen bg-[var(--dashboard-sidebar-bg,#f0f0f0)] border-r border-[var(--dashboard-sidebar-border,#e0dfe3)] overflow-visible", isCollapsed ? "xl:w-[109px]" : "xl:w-[280px]", className),
|
|
1312
1312
|
style: { transition: `width 400ms ${cubicBezier}` },
|
|
1313
1313
|
children: [onToggleCollapse && /* @__PURE__ */ jsxs("button", {
|
|
1314
1314
|
onClick: onToggleCollapse,
|
|
@@ -1382,7 +1382,7 @@ function Sidebar({ menuItems, logo, collapsedLogo, currentPath, linkComponent: L
|
|
|
1382
1382
|
children: [
|
|
1383
1383
|
user && /* @__PURE__ */ jsxs("button", {
|
|
1384
1384
|
onClick: onUserClick,
|
|
1385
|
-
className: cn$
|
|
1385
|
+
className: cn$25("w-full flex items-center px-4 py-3 rounded-lg bg-[var(--dashboard-primary,#ff521d)]/5 hover:bg-[var(--dashboard-primary,#ff521d)]/10 transition-colors cursor-pointer", isCollapsed ? "justify-center" : "justify-start"),
|
|
1386
1386
|
title: isCollapsed ? `${user.subtitle ? user.subtitle + " - " : ""}${user.name}` : void 0,
|
|
1387
1387
|
children: [/* @__PURE__ */ jsx("div", {
|
|
1388
1388
|
className: "flex items-center justify-center w-8 h-8 rounded-full bg-[var(--dashboard-primary,#ff521d)]/30 text-[var(--dashboard-sidebar-text,#403f52)] flex-shrink-0",
|
|
@@ -1415,7 +1415,7 @@ function Sidebar({ menuItems, logo, collapsedLogo, currentPath, linkComponent: L
|
|
|
1415
1415
|
footerItems?.map((item) => renderMenuItem(item, isCollapsed, false)),
|
|
1416
1416
|
onLogout && /* @__PURE__ */ jsxs("button", {
|
|
1417
1417
|
onClick: onLogout,
|
|
1418
|
-
className: cn$
|
|
1418
|
+
className: cn$25("w-full flex items-center px-4 py-3 rounded-lg text-sm font-medium cursor-pointer text-[var(--dashboard-sidebar-text,#403f52)] hover:bg-[var(--dashboard-primary,#ff521d)]/10", isCollapsed ? "justify-center" : "justify-start"),
|
|
1419
1419
|
style: { transition: "background-color 200ms" },
|
|
1420
1420
|
title: isCollapsed ? logoutLabel : void 0,
|
|
1421
1421
|
children: [/* @__PURE__ */ jsx(LogOut, {
|
|
@@ -1443,7 +1443,7 @@ function Sidebar({ menuItems, logo, collapsedLogo, currentPath, linkComponent: L
|
|
|
1443
1443
|
|
|
1444
1444
|
//#endregion
|
|
1445
1445
|
//#region src/components/ThemeSwitcher/index.tsx
|
|
1446
|
-
const cn$
|
|
1446
|
+
const cn$24 = (...classes) => classes.filter(Boolean).join(" ");
|
|
1447
1447
|
const modes = [
|
|
1448
1448
|
{
|
|
1449
1449
|
value: "light",
|
|
@@ -1463,11 +1463,11 @@ const modes = [
|
|
|
1463
1463
|
];
|
|
1464
1464
|
function ThemeSwitcher({ mode, onModeChange, className }) {
|
|
1465
1465
|
return /* @__PURE__ */ jsx("div", {
|
|
1466
|
-
className: cn$
|
|
1466
|
+
className: cn$24("inline-flex items-center gap-1 rounded-lg bg-[var(--dashboard-background,#f2f2f2)] p-1", className),
|
|
1467
1467
|
children: modes.map(({ value, icon: Icon, label }) => /* @__PURE__ */ jsxs("button", {
|
|
1468
1468
|
type: "button",
|
|
1469
1469
|
onClick: () => onModeChange(value),
|
|
1470
|
-
className: cn$
|
|
1470
|
+
className: cn$24("flex cursor-pointer items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors", mode === value ? "bg-[var(--dashboard-surface,#ffffff)] text-[var(--dashboard-text-primary,#2d2d2d)] shadow-sm" : "text-[var(--dashboard-text-secondary,#6b7280)] hover:text-[var(--dashboard-text-primary,#2d2d2d)]"),
|
|
1471
1471
|
title: label,
|
|
1472
1472
|
children: [/* @__PURE__ */ jsx(Icon, { size: 14 }), /* @__PURE__ */ jsx("span", { children: label })]
|
|
1473
1473
|
}, value))
|
|
@@ -1476,7 +1476,7 @@ function ThemeSwitcher({ mode, onModeChange, className }) {
|
|
|
1476
1476
|
|
|
1477
1477
|
//#endregion
|
|
1478
1478
|
//#region src/components/KPICard/index.tsx
|
|
1479
|
-
const cn$
|
|
1479
|
+
const cn$23 = (...classes) => classes.filter(Boolean).join(" ");
|
|
1480
1480
|
function formatValue(value, format) {
|
|
1481
1481
|
switch (format) {
|
|
1482
1482
|
case "currency": return new Intl.NumberFormat("pt-BR", {
|
|
@@ -1506,7 +1506,7 @@ function KPICard({ title, value, variation, trend, format = "number", benchmark,
|
|
|
1506
1506
|
if (isLoading) return /* @__PURE__ */ jsx(KPICardSkeleton, { className });
|
|
1507
1507
|
const trendConfig = trendConfigs[trend];
|
|
1508
1508
|
return /* @__PURE__ */ jsxs("div", {
|
|
1509
|
-
className: cn$
|
|
1509
|
+
className: cn$23("h-full w-full bg-[var(--dashboard-surface,#ffffff)] rounded-xl p-6 border border-[var(--dashboard-text-secondary,#64748B)]/12 transition-all duration-200 ease-out dashboard-shadow-sm hover:dashboard-shadow-md flex flex-col", className),
|
|
1510
1510
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
1511
1511
|
className: "flex justify-between items-start mb-4",
|
|
1512
1512
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
@@ -1523,7 +1523,7 @@ function KPICard({ title, value, variation, trend, format = "number", benchmark,
|
|
|
1523
1523
|
className: "text-3xl font-bold text-[var(--dashboard-text-primary,#0F172A)] whitespace-nowrap tracking-tight",
|
|
1524
1524
|
children: formatValue(value, format)
|
|
1525
1525
|
}), /* @__PURE__ */ jsxs("div", {
|
|
1526
|
-
className: cn$
|
|
1526
|
+
className: cn$23("inline-flex items-center gap-1 px-2 py-1 rounded-full flex-shrink-0 mb-1", trendConfig.color),
|
|
1527
1527
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1528
1528
|
className: "text-sm",
|
|
1529
1529
|
children: trendConfig.icon
|
|
@@ -1537,7 +1537,7 @@ function KPICard({ title, value, variation, trend, format = "number", benchmark,
|
|
|
1537
1537
|
}
|
|
1538
1538
|
function KPICardSkeleton({ className }) {
|
|
1539
1539
|
return /* @__PURE__ */ jsxs("div", {
|
|
1540
|
-
className: cn$
|
|
1540
|
+
className: cn$23("h-full bg-[var(--dashboard-surface,#ffffff)] rounded-xl p-6 border border-[var(--dashboard-text-secondary,#64748B)]/12 dashboard-shadow-sm animate-pulse flex flex-col", className),
|
|
1541
1541
|
children: [/* @__PURE__ */ jsx("div", { className: "h-3 bg-[var(--dashboard-text-secondary,#64748B)]/10 rounded w-2/3 mb-4" }), /* @__PURE__ */ jsxs("div", {
|
|
1542
1542
|
className: "flex items-end gap-3 flex-1",
|
|
1543
1543
|
children: [/* @__PURE__ */ jsx("div", { className: "h-8 bg-[var(--dashboard-text-secondary,#64748B)]/10 rounded w-1/2" }), /* @__PURE__ */ jsx("div", { className: "h-5 bg-[var(--dashboard-text-secondary,#64748B)]/10 rounded-full w-1/4" })]
|
|
@@ -1547,13 +1547,13 @@ function KPICardSkeleton({ className }) {
|
|
|
1547
1547
|
|
|
1548
1548
|
//#endregion
|
|
1549
1549
|
//#region src/components/PageLayout/index.tsx
|
|
1550
|
-
const cn$
|
|
1550
|
+
const cn$22 = (...classes) => classes.filter(Boolean).join(" ");
|
|
1551
1551
|
function PageLayout({ title, description, headerActions, children, contentPadding = true, sidebar, sidebarCollapsed = false, sidebarWidth = 280, sidebarCollapsedWidth = 109, className }) {
|
|
1552
1552
|
const marginLeft = sidebar ? sidebarCollapsed ? `max(0px, ${sidebarCollapsedWidth}px)` : `max(0px, ${sidebarWidth}px)` : "0px";
|
|
1553
1553
|
return /* @__PURE__ */ jsxs("div", {
|
|
1554
|
-
className: cn$
|
|
1554
|
+
className: cn$22("min-h-screen bg-[var(--dashboard-background,#f2f2f2)]", className),
|
|
1555
1555
|
children: [sidebar, /* @__PURE__ */ jsxs("main", {
|
|
1556
|
-
className: cn$
|
|
1556
|
+
className: cn$22("pt-16 xl:pt-0", !sidebar && "pt-0"),
|
|
1557
1557
|
style: {
|
|
1558
1558
|
marginLeft,
|
|
1559
1559
|
transition: "margin-left 400ms cubic-bezier(0.4, 0, 0.2, 1)"
|
|
@@ -1591,7 +1591,7 @@ function PageLayout({ title, description, headerActions, children, contentPaddin
|
|
|
1591
1591
|
//#endregion
|
|
1592
1592
|
//#region src/components/ComparisonLineChart/index.tsx
|
|
1593
1593
|
Chart.register(CategoryScale, LinearScale, PointElement, LineElement, Title$1, Tooltip$1, Legend, Filler);
|
|
1594
|
-
const cn$
|
|
1594
|
+
const cn$21 = (...classes) => classes.filter(Boolean).join(" ");
|
|
1595
1595
|
function ComparisonLineChart({ labels, currentPeriodData, previousPeriodData, currentPeriodLabel = "Período atual", previousPeriodLabel = "Período anterior", title, color, height = 300, className }) {
|
|
1596
1596
|
const primaryColor = color || (typeof document !== "undefined" ? getComputedStyle(document.documentElement).getPropertyValue("--dashboard-primary").trim() : "") || "#37a501";
|
|
1597
1597
|
const data = {
|
|
@@ -1685,7 +1685,7 @@ function ComparisonLineChart({ labels, currentPeriodData, previousPeriodData, cu
|
|
|
1685
1685
|
}
|
|
1686
1686
|
};
|
|
1687
1687
|
return /* @__PURE__ */ jsxs("div", {
|
|
1688
|
-
className: cn$
|
|
1688
|
+
className: cn$21("bg-[var(--dashboard-surface,#ffffff)] rounded-lg shadow-sm border border-[var(--dashboard-text-secondary,#6b7280)]/20 p-6", className),
|
|
1689
1689
|
children: [title && /* @__PURE__ */ jsx("h3", {
|
|
1690
1690
|
className: "text-base font-semibold mb-4 text-[var(--dashboard-text-primary,#2d2d2d)]",
|
|
1691
1691
|
children: title
|
|
@@ -1702,7 +1702,7 @@ function ComparisonLineChart({ labels, currentPeriodData, previousPeriodData, cu
|
|
|
1702
1702
|
//#endregion
|
|
1703
1703
|
//#region src/components/HorizontalBarChart/index.tsx
|
|
1704
1704
|
Chart.register(CategoryScale, LinearScale, BarElement, Title$1, Tooltip$1, Legend);
|
|
1705
|
-
const cn$
|
|
1705
|
+
const cn$20 = (...classes) => classes.filter(Boolean).join(" ");
|
|
1706
1706
|
function HorizontalBarChart({ labels, datasets, tabs, title, titleIcon, color, valueLabel = "itens", valueLabelSingular, bestItemLabel = "Melhor item", className }) {
|
|
1707
1707
|
const [activeTab, setActiveTab] = useState((tabs ? tabs.map((t) => t.id) : Object.keys(datasets))[0]);
|
|
1708
1708
|
const [isMobile, setIsMobile] = useState(false);
|
|
@@ -1777,7 +1777,7 @@ function HorizontalBarChart({ labels, datasets, tabs, title, titleIcon, color, v
|
|
|
1777
1777
|
}
|
|
1778
1778
|
};
|
|
1779
1779
|
return /* @__PURE__ */ jsxs("div", {
|
|
1780
|
-
className: cn$
|
|
1780
|
+
className: cn$20("bg-[var(--dashboard-surface,#ffffff)] rounded-lg shadow-sm border border-[var(--dashboard-text-secondary,#6b7280)]/20 p-5 sm:p-6 min-h-[850px] sm:h-full flex flex-col", className),
|
|
1781
1781
|
children: [
|
|
1782
1782
|
title && /* @__PURE__ */ jsxs("div", {
|
|
1783
1783
|
className: "flex items-center gap-2 mb-4",
|
|
@@ -1790,7 +1790,7 @@ function HorizontalBarChart({ labels, datasets, tabs, title, titleIcon, color, v
|
|
|
1790
1790
|
className: "flex gap-2 mb-4 flex-wrap",
|
|
1791
1791
|
children: tabs.map((tab) => /* @__PURE__ */ jsx("button", {
|
|
1792
1792
|
onClick: () => setActiveTab(tab.id),
|
|
1793
|
-
className: cn$
|
|
1793
|
+
className: cn$20("px-3.5 py-2 sm:px-4 sm:py-2 rounded-full text-sm font-medium transition-colors whitespace-nowrap cursor-pointer", activeTab === tab.id ? "bg-[var(--dashboard-primary,#37a501)] text-white" : "bg-[var(--dashboard-text-secondary,#6b7280)]/10 text-[var(--dashboard-text-secondary,#6b7280)] hover:bg-[var(--dashboard-text-secondary,#6b7280)]/20"),
|
|
1794
1794
|
children: tab.label
|
|
1795
1795
|
}, tab.id))
|
|
1796
1796
|
}),
|
|
@@ -1829,7 +1829,7 @@ function HorizontalBarChart({ labels, datasets, tabs, title, titleIcon, color, v
|
|
|
1829
1829
|
//#endregion
|
|
1830
1830
|
//#region src/components/VerticalBarChart/index.tsx
|
|
1831
1831
|
Chart.register(CategoryScale, LinearScale, BarElement, Title$1, Tooltip$1, Legend);
|
|
1832
|
-
const cn$
|
|
1832
|
+
const cn$19 = (...classes) => classes.filter(Boolean).join(" ");
|
|
1833
1833
|
function VerticalBarChart({ labels, data: values, title, titleIcon, color, valueLabel = "itens", valueLabelSingular, bestItemLabel = "Melhor item", labelMaxChars = 3, className }) {
|
|
1834
1834
|
const maxValue = Math.max(...values);
|
|
1835
1835
|
const bestLabel = labels[values.indexOf(maxValue)];
|
|
@@ -1892,7 +1892,7 @@ function VerticalBarChart({ labels, data: values, title, titleIcon, color, value
|
|
|
1892
1892
|
}
|
|
1893
1893
|
};
|
|
1894
1894
|
return /* @__PURE__ */ jsxs("div", {
|
|
1895
|
-
className: cn$
|
|
1895
|
+
className: cn$19("bg-[var(--dashboard-surface,#ffffff)] rounded-lg shadow-sm border border-[var(--dashboard-text-secondary,#6b7280)]/20 p-6 flex-1 flex flex-col", className),
|
|
1896
1896
|
children: [
|
|
1897
1897
|
title && /* @__PURE__ */ jsxs("div", {
|
|
1898
1898
|
className: "flex items-center gap-2 mb-4",
|
|
@@ -1948,7 +1948,7 @@ const DEFAULT_COLORS = [
|
|
|
1948
1948
|
"#EA580C",
|
|
1949
1949
|
"#4F46E5"
|
|
1950
1950
|
];
|
|
1951
|
-
const cn$
|
|
1951
|
+
const cn$18 = (...classes) => classes.filter(Boolean).join(" ");
|
|
1952
1952
|
function DoughnutChart({ items, title, titleIcon, centerLabel, centerValue, showLegend = true, formatValue, cutout = 65, height = 240, className }) {
|
|
1953
1953
|
const total = items.reduce((sum, item) => sum + item.value, 0);
|
|
1954
1954
|
const format = formatValue || ((v) => String(v));
|
|
@@ -1988,7 +1988,7 @@ function DoughnutChart({ items, title, titleIcon, centerLabel, centerValue, show
|
|
|
1988
1988
|
}
|
|
1989
1989
|
};
|
|
1990
1990
|
return /* @__PURE__ */ jsxs("div", {
|
|
1991
|
-
className: cn$
|
|
1991
|
+
className: cn$18("bg-[var(--dashboard-surface,#ffffff)] rounded-lg shadow-sm border border-[var(--dashboard-text-secondary,#6b7280)]/20 p-6", className),
|
|
1992
1992
|
children: [title && /* @__PURE__ */ jsxs("div", {
|
|
1993
1993
|
className: "flex items-center gap-2 mb-4",
|
|
1994
1994
|
children: [titleIcon, /* @__PURE__ */ jsx("h3", {
|
|
@@ -1996,7 +1996,7 @@ function DoughnutChart({ items, title, titleIcon, centerLabel, centerValue, show
|
|
|
1996
1996
|
children: title
|
|
1997
1997
|
})]
|
|
1998
1998
|
}), /* @__PURE__ */ jsxs("div", {
|
|
1999
|
-
className: cn$
|
|
1999
|
+
className: cn$18("flex items-center", showLegend ? "gap-6" : "justify-center"),
|
|
2000
2000
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
2001
2001
|
className: "relative flex-shrink-0",
|
|
2002
2002
|
style: {
|
|
@@ -2049,7 +2049,7 @@ function DoughnutChart({ items, title, titleIcon, centerLabel, centerValue, show
|
|
|
2049
2049
|
|
|
2050
2050
|
//#endregion
|
|
2051
2051
|
//#region src/components/ProgressBarList/index.tsx
|
|
2052
|
-
const cn$
|
|
2052
|
+
const cn$17 = (...classes) => classes.filter(Boolean).join(" ");
|
|
2053
2053
|
function ProgressBarList({ items, title, titleIcon, color, valueLabel = "itens", valueLabelSingular, sortByValue = true, formatValue, className }) {
|
|
2054
2054
|
const sortedItems = sortByValue ? [...items].sort((a, b) => b.value - a.value) : items;
|
|
2055
2055
|
const maxValue = Math.max(...items.map((i) => i.value));
|
|
@@ -2058,7 +2058,7 @@ function ProgressBarList({ items, title, titleIcon, color, valueLabel = "itens",
|
|
|
2058
2058
|
const defaultFormat = (v) => `${v} ${v === 1 ? singular : valueLabel}`;
|
|
2059
2059
|
const fmt = formatValue || defaultFormat;
|
|
2060
2060
|
return /* @__PURE__ */ jsxs("div", {
|
|
2061
|
-
className: cn$
|
|
2061
|
+
className: cn$17("bg-[var(--dashboard-surface,#ffffff)] rounded-lg shadow-sm border border-[var(--dashboard-text-secondary,#6b7280)]/20 p-6 flex-1 flex flex-col", className),
|
|
2062
2062
|
children: [title && /* @__PURE__ */ jsxs("div", {
|
|
2063
2063
|
className: "flex items-center gap-2 mb-4",
|
|
2064
2064
|
children: [titleIcon, /* @__PURE__ */ jsx("h3", {
|
|
@@ -2107,7 +2107,7 @@ function ProgressBarList({ items, title, titleIcon, color, valueLabel = "itens",
|
|
|
2107
2107
|
//#endregion
|
|
2108
2108
|
//#region src/components/MetricPanel/index.tsx
|
|
2109
2109
|
Chart.register(CategoryScale, LinearScale, PointElement, LineElement, Title$1, Tooltip$1, Legend, Filler);
|
|
2110
|
-
const cn$
|
|
2110
|
+
const cn$16 = (...classes) => classes.filter(Boolean).join(" ");
|
|
2111
2111
|
function MetricPanel({ title, titleIcon: TitleIcon, metrics, chartData, color, secondaryColor, onActionClick, actionLabel, isLoading = false, className }) {
|
|
2112
2112
|
const [selectedMetricKey, setSelectedMetricKey] = useState(metrics[0]?.key);
|
|
2113
2113
|
const [isMobile, setIsMobile] = useState(false);
|
|
@@ -2205,7 +2205,7 @@ function MetricPanel({ title, titleIcon: TitleIcon, metrics, chartData, color, s
|
|
|
2205
2205
|
}
|
|
2206
2206
|
};
|
|
2207
2207
|
return /* @__PURE__ */ jsxs("div", {
|
|
2208
|
-
className: cn$
|
|
2208
|
+
className: cn$16("bg-[var(--dashboard-surface,#ffffff)] rounded-lg shadow-sm border border-[var(--dashboard-text-secondary,#6b7280)]/20", className),
|
|
2209
2209
|
style: { overflow: "visible" },
|
|
2210
2210
|
children: [
|
|
2211
2211
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -2246,7 +2246,7 @@ function MetricPanel({ title, titleIcon: TitleIcon, metrics, chartData, color, s
|
|
|
2246
2246
|
const Icon = metric.icon;
|
|
2247
2247
|
return /* @__PURE__ */ jsxs("button", {
|
|
2248
2248
|
onClick: () => setSelectedMetricKey(metric.key),
|
|
2249
|
-
className: cn$
|
|
2249
|
+
className: cn$16("flex items-center gap-2 px-4 md:px-6 py-2 rounded-full text-sm font-medium transition-colors cursor-pointer", selectedMetricKey === metric.key ? "bg-[var(--dashboard-surface,#ffffff)] border-2 text-[var(--dashboard-primary,#37a501)]" : "bg-[var(--dashboard-surface,#ffffff)] border border-[var(--dashboard-text-secondary,#6b7280)]/30 text-[var(--dashboard-text-secondary,#6b7280)] hover:border-[var(--dashboard-text-secondary,#6b7280)]/50"),
|
|
2250
2250
|
style: selectedMetricKey === metric.key ? {
|
|
2251
2251
|
borderColor: primaryColor,
|
|
2252
2252
|
color: primaryColor
|
|
@@ -2294,10 +2294,10 @@ function MetricPanel({ title, titleIcon: TitleIcon, metrics, chartData, color, s
|
|
|
2294
2294
|
|
|
2295
2295
|
//#endregion
|
|
2296
2296
|
//#region src/components/FilterBar/index.tsx
|
|
2297
|
-
const cn$
|
|
2297
|
+
const cn$15 = (...classes) => classes.filter(Boolean).join(" ");
|
|
2298
2298
|
function FilterBar({ searchValue, onSearchChange, searchPlaceholder = "Buscar...", children, actions, className }) {
|
|
2299
2299
|
return /* @__PURE__ */ jsxs("div", {
|
|
2300
|
-
className: cn$
|
|
2300
|
+
className: cn$15("flex flex-col gap-3 sm:flex-row sm:items-center sm:flex-wrap", className),
|
|
2301
2301
|
children: [
|
|
2302
2302
|
onSearchChange !== void 0 && /* @__PURE__ */ jsx("div", {
|
|
2303
2303
|
className: "flex-1 min-w-[200px]",
|
|
@@ -2337,7 +2337,7 @@ function FilterBar({ searchValue, onSearchChange, searchPlaceholder = "Buscar...
|
|
|
2337
2337
|
|
|
2338
2338
|
//#endregion
|
|
2339
2339
|
//#region src/components/Checkbox/index.tsx
|
|
2340
|
-
const cn$
|
|
2340
|
+
const cn$14 = (...classes) => classes.filter(Boolean).join(" ");
|
|
2341
2341
|
const sizeConfig = {
|
|
2342
2342
|
sm: {
|
|
2343
2343
|
box: 16,
|
|
@@ -2385,7 +2385,7 @@ function Checkbox({ name, id, label, checked = false, onChange, disabled = false
|
|
|
2385
2385
|
const resolvedColor = primaryColor || "var(--dashboard-primary, #37A501)";
|
|
2386
2386
|
return /* @__PURE__ */ jsxs("label", {
|
|
2387
2387
|
htmlFor: inputId,
|
|
2388
|
-
className: cn$
|
|
2388
|
+
className: cn$14("inline-flex items-center cursor-pointer select-none", disabled && "opacity-50 cursor-not-allowed", className),
|
|
2389
2389
|
style: { gap: cfg.gap },
|
|
2390
2390
|
children: [
|
|
2391
2391
|
/* @__PURE__ */ jsx("input", {
|
|
@@ -2436,7 +2436,7 @@ function Checkbox({ name, id, label, checked = false, onChange, disabled = false
|
|
|
2436
2436
|
|
|
2437
2437
|
//#endregion
|
|
2438
2438
|
//#region src/components/AuthLayout/index.tsx
|
|
2439
|
-
const cn$
|
|
2439
|
+
const cn$13 = (...classes) => classes.filter(Boolean).join(" ");
|
|
2440
2440
|
/** Resolves a CSS color value (including var() references) to a computed hex/rgb string */
|
|
2441
2441
|
function useResolvedColor(cssValue) {
|
|
2442
2442
|
const [resolved, setResolved] = useState(cssValue);
|
|
@@ -2603,7 +2603,7 @@ function AuthLayout({ logo, title, subtitle, error, success, fields, values, onF
|
|
|
2603
2603
|
if (link.onClick) return /* @__PURE__ */ jsx("button", {
|
|
2604
2604
|
type: "button",
|
|
2605
2605
|
onClick: link.onClick,
|
|
2606
|
-
className: cn$
|
|
2606
|
+
className: cn$13("bg-transparent border-none cursor-pointer hover:opacity-80 text-sm font-semibold p-0 transition-colors", extraClass),
|
|
2607
2607
|
style,
|
|
2608
2608
|
children: link.label
|
|
2609
2609
|
});
|
|
@@ -2611,13 +2611,13 @@ function AuthLayout({ logo, title, subtitle, error, success, fields, values, onF
|
|
|
2611
2611
|
href: link.href,
|
|
2612
2612
|
target: link.target,
|
|
2613
2613
|
rel: link.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
2614
|
-
className: cn$
|
|
2614
|
+
className: cn$13("hover:opacity-80 text-sm font-semibold transition-colors", extraClass),
|
|
2615
2615
|
style,
|
|
2616
2616
|
children: link.label
|
|
2617
2617
|
});
|
|
2618
2618
|
}
|
|
2619
2619
|
return /* @__PURE__ */ jsxs("div", {
|
|
2620
|
-
className: cn$
|
|
2620
|
+
className: cn$13("fixed inset-0 flex select-none overflow-hidden", className),
|
|
2621
2621
|
style: bgCss,
|
|
2622
2622
|
children: [
|
|
2623
2623
|
branding && branding.logos.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
@@ -2900,7 +2900,7 @@ function CodeInput({ length = 6, value, onChange, disabled = false, error = fals
|
|
|
2900
2900
|
|
|
2901
2901
|
//#endregion
|
|
2902
2902
|
//#region src/components/Skeleton/index.tsx
|
|
2903
|
-
const cn$
|
|
2903
|
+
const cn$12 = (...classes) => classes.filter(Boolean).join(" ");
|
|
2904
2904
|
function Skeleton({ variant = "text", width, height, animate = true, className, lines = 1 }) {
|
|
2905
2905
|
const baseStyles = "bg-[var(--dashboard-text-secondary,#6b7280)]/10 relative overflow-hidden";
|
|
2906
2906
|
const shimmerStyles = animate ? "after:absolute after:inset-0 after:bg-gradient-to-r after:from-transparent after:via-[var(--dashboard-text-secondary,#6b7280)]/5 after:to-transparent dashboard-animate-shimmer after:content-['']" : "";
|
|
@@ -2919,9 +2919,9 @@ function Skeleton({ variant = "text", width, height, animate = true, className,
|
|
|
2919
2919
|
}
|
|
2920
2920
|
if (variant === "card" && !height) style.height = "120px";
|
|
2921
2921
|
if (variant === "text" && lines > 1) return /* @__PURE__ */ jsx("div", {
|
|
2922
|
-
className: cn$
|
|
2922
|
+
className: cn$12("flex flex-col gap-2", className),
|
|
2923
2923
|
children: Array.from({ length: lines }).map((_, i) => /* @__PURE__ */ jsx("div", {
|
|
2924
|
-
className: cn$
|
|
2924
|
+
className: cn$12(baseStyles, shimmerStyles, variantStyles.text),
|
|
2925
2925
|
style: {
|
|
2926
2926
|
...style,
|
|
2927
2927
|
width: i === lines - 1 ? "75%" : style.width || "100%"
|
|
@@ -2929,14 +2929,14 @@ function Skeleton({ variant = "text", width, height, animate = true, className,
|
|
|
2929
2929
|
}, i))
|
|
2930
2930
|
});
|
|
2931
2931
|
return /* @__PURE__ */ jsx("div", {
|
|
2932
|
-
className: cn$
|
|
2932
|
+
className: cn$12(baseStyles, shimmerStyles, variantStyles[variant], className),
|
|
2933
2933
|
style
|
|
2934
2934
|
});
|
|
2935
2935
|
}
|
|
2936
2936
|
|
|
2937
2937
|
//#endregion
|
|
2938
2938
|
//#region src/components/DataGrid/index.tsx
|
|
2939
|
-
const cn$
|
|
2939
|
+
const cn$11 = (...classes) => classes.filter(Boolean).join(" ");
|
|
2940
2940
|
function SortIcon({ sorted }) {
|
|
2941
2941
|
if (sorted === "asc") return /* @__PURE__ */ jsx(ArrowUp, { className: "h-3.5 w-3.5" });
|
|
2942
2942
|
if (sorted === "desc") return /* @__PURE__ */ jsx(ArrowDown, { className: "h-3.5 w-3.5" });
|
|
@@ -2991,7 +2991,7 @@ function VirtualRows({ table, rowHeight, onRowClick, compact }) {
|
|
|
2991
2991
|
className: "bg-[var(--dashboard-text-secondary,#6b7280)]/5 sticky top-0 z-10",
|
|
2992
2992
|
children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx("th", {
|
|
2993
2993
|
scope: "col",
|
|
2994
|
-
className: cn$
|
|
2994
|
+
className: cn$11("text-left text-xs font-semibold text-[var(--dashboard-text-secondary,#6b7280)] uppercase tracking-wider", compact ? "px-4 py-2" : "px-6 py-3", header.column.getCanSort() && "cursor-pointer select-none"),
|
|
2995
2995
|
style: { width: header.getSize() },
|
|
2996
2996
|
onClick: header.column.getToggleSortingHandler(),
|
|
2997
2997
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -3006,10 +3006,10 @@ function VirtualRows({ table, rowHeight, onRowClick, compact }) {
|
|
|
3006
3006
|
}),
|
|
3007
3007
|
visibleRows.map((row) => /* @__PURE__ */ jsx("tr", {
|
|
3008
3008
|
onClick: () => onRowClick?.(row.original),
|
|
3009
|
-
className: cn$
|
|
3009
|
+
className: cn$11("hover:bg-[var(--dashboard-text-secondary,#6b7280)]/5 transition-colors", onRowClick && "cursor-pointer", row.getIsSelected() && "bg-[var(--dashboard-primary,#37a501)]/5"),
|
|
3010
3010
|
style: { height: rowHeight },
|
|
3011
3011
|
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx("td", {
|
|
3012
|
-
className: cn$
|
|
3012
|
+
className: cn$11(cellPadding, "text-sm whitespace-nowrap"),
|
|
3013
3013
|
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
3014
3014
|
}, cell.id))
|
|
3015
3015
|
}, row.id)),
|
|
@@ -3088,7 +3088,7 @@ function DataGrid({ columns, data, isLoading = false, skeletonRows = 5, sorting:
|
|
|
3088
3088
|
const cellPadding = compact ? "px-4 py-2" : "px-6 py-4";
|
|
3089
3089
|
const headerPadding = compact ? "px-4 py-2" : "px-6 py-3";
|
|
3090
3090
|
if (enableVirtualization) return /* @__PURE__ */ jsx("div", {
|
|
3091
|
-
className: cn$
|
|
3091
|
+
className: cn$11("overflow-hidden rounded-lg bg-[var(--dashboard-surface,#ffffff)] shadow-sm", bordered && "border border-[var(--dashboard-text-secondary,#6b7280)]/20", className),
|
|
3092
3092
|
children: /* @__PURE__ */ jsx(VirtualRows, {
|
|
3093
3093
|
table,
|
|
3094
3094
|
rowHeight,
|
|
@@ -3097,16 +3097,16 @@ function DataGrid({ columns, data, isLoading = false, skeletonRows = 5, sorting:
|
|
|
3097
3097
|
})
|
|
3098
3098
|
});
|
|
3099
3099
|
return /* @__PURE__ */ jsxs("div", {
|
|
3100
|
-
className: cn$
|
|
3100
|
+
className: cn$11("overflow-hidden rounded-lg bg-[var(--dashboard-surface,#ffffff)] shadow-sm", bordered && "border border-[var(--dashboard-text-secondary,#6b7280)]/20", className),
|
|
3101
3101
|
children: [/* @__PURE__ */ jsx("div", {
|
|
3102
3102
|
className: "overflow-x-auto",
|
|
3103
3103
|
children: /* @__PURE__ */ jsxs("table", {
|
|
3104
3104
|
className: "min-w-full divide-y divide-[var(--dashboard-text-secondary,#6b7280)]/20",
|
|
3105
3105
|
children: [/* @__PURE__ */ jsx("thead", {
|
|
3106
|
-
className: cn$
|
|
3106
|
+
className: cn$11("bg-[var(--dashboard-text-secondary,#6b7280)]/5", stickyHeader && "sticky top-0 z-10"),
|
|
3107
3107
|
children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx("th", {
|
|
3108
3108
|
scope: "col",
|
|
3109
|
-
className: cn$
|
|
3109
|
+
className: cn$11("text-left text-xs font-semibold text-[var(--dashboard-text-secondary,#6b7280)] uppercase tracking-wider", headerPadding, header.column.getCanSort() && "cursor-pointer select-none"),
|
|
3110
3110
|
style: header.getSize() !== 150 ? { width: header.getSize() } : void 0,
|
|
3111
3111
|
onClick: header.column.getToggleSortingHandler(),
|
|
3112
3112
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -3143,9 +3143,9 @@ function DataGrid({ columns, data, isLoading = false, skeletonRows = 5, sorting:
|
|
|
3143
3143
|
})
|
|
3144
3144
|
}) }) : table.getRowModel().rows.map((row, rowIndex) => /* @__PURE__ */ jsx("tr", {
|
|
3145
3145
|
onClick: () => onRowClick?.(row.original),
|
|
3146
|
-
className: cn$
|
|
3146
|
+
className: cn$11("transition-colors", onRowClick && "cursor-pointer", "hover:bg-[var(--dashboard-text-secondary,#6b7280)]/5", row.getIsSelected() && "bg-[var(--dashboard-primary,#37a501)]/5", striped && rowIndex % 2 === 1 && "bg-[var(--dashboard-text-secondary,#6b7280)]/3"),
|
|
3147
3147
|
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx("td", {
|
|
3148
|
-
className: cn$
|
|
3148
|
+
className: cn$11(cellPadding, "text-sm text-[var(--dashboard-text-primary,#2d2d2d)]"),
|
|
3149
3149
|
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
3150
3150
|
}, cell.id))
|
|
3151
3151
|
}, row.id))
|
|
@@ -3206,7 +3206,7 @@ function DataGrid({ columns, data, isLoading = false, skeletonRows = 5, sorting:
|
|
|
3206
3206
|
|
|
3207
3207
|
//#endregion
|
|
3208
3208
|
//#region src/components/TreeView/index.tsx
|
|
3209
|
-
const cn$
|
|
3209
|
+
const cn$10 = (...classes) => classes.filter(Boolean).join(" ");
|
|
3210
3210
|
function TreeItem({ node, level, expanded, selectedId, draggable, indentSize, onSelect, onToggle, onMove, renderNode, dragState, setDragState }) {
|
|
3211
3211
|
const hasChildren = node.children && node.children.length > 0;
|
|
3212
3212
|
const isExpanded = expanded.has(node.id);
|
|
@@ -3271,7 +3271,7 @@ function TreeItem({ node, level, expanded, selectedId, draggable, indentSize, on
|
|
|
3271
3271
|
"aria-expanded": hasChildren ? isExpanded : void 0,
|
|
3272
3272
|
"aria-selected": isSelected,
|
|
3273
3273
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
3274
|
-
className: cn$
|
|
3274
|
+
className: cn$10("group flex items-center gap-1 rounded-md px-2 py-1.5 transition-colors", isSelected ? "bg-[var(--dashboard-primary,#37a501)]/10 text-[var(--dashboard-primary,#37a501)]" : "hover:bg-[var(--dashboard-text-secondary,#6b7280)]/10 text-[var(--dashboard-text-primary,#2d2d2d)]", isDragging && "opacity-40", isDropTarget && dragState.position === "inside" && "ring-2 ring-[var(--dashboard-primary,#37a501)] ring-inset", node.disabled && "opacity-50 cursor-not-allowed"),
|
|
3275
3275
|
style: { paddingLeft: `${level * indentSize + 4}px` },
|
|
3276
3276
|
draggable: draggable && !node.disabled,
|
|
3277
3277
|
onDragStart: handleDragStart,
|
|
@@ -3289,10 +3289,10 @@ function TreeItem({ node, level, expanded, selectedId, draggable, indentSize, on
|
|
|
3289
3289
|
/* @__PURE__ */ jsx("button", {
|
|
3290
3290
|
type: "button",
|
|
3291
3291
|
onClick: () => hasChildren && onToggle(node.id),
|
|
3292
|
-
className: cn$
|
|
3292
|
+
className: cn$10("flex-shrink-0 w-5 h-5 flex items-center justify-center rounded transition-transform", hasChildren ? "cursor-pointer" : "invisible"),
|
|
3293
3293
|
tabIndex: hasChildren ? 0 : -1,
|
|
3294
3294
|
"aria-label": isExpanded ? "Recolher" : "Expandir",
|
|
3295
|
-
children: /* @__PURE__ */ jsx(ChevronRight, { className: cn$
|
|
3295
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: cn$10("h-3.5 w-3.5 transition-transform duration-150", isExpanded && "rotate-90") })
|
|
3296
3296
|
}),
|
|
3297
3297
|
renderNode ? /* @__PURE__ */ jsx("div", {
|
|
3298
3298
|
className: "flex-1 min-w-0 cursor-pointer",
|
|
@@ -3304,7 +3304,7 @@ function TreeItem({ node, level, expanded, selectedId, draggable, indentSize, on
|
|
|
3304
3304
|
children: node.icon
|
|
3305
3305
|
}),
|
|
3306
3306
|
/* @__PURE__ */ jsx("span", {
|
|
3307
|
-
className: cn$
|
|
3307
|
+
className: cn$10("flex-1 min-w-0 text-sm truncate", !node.disabled && "cursor-pointer"),
|
|
3308
3308
|
onClick: () => !node.disabled && onSelect?.(node),
|
|
3309
3309
|
children: node.label
|
|
3310
3310
|
}),
|
|
@@ -3357,7 +3357,7 @@ function TreeView({ nodes, onSelect, onExpand, onMove, renderNode, selectedId, d
|
|
|
3357
3357
|
}, [onExpand]);
|
|
3358
3358
|
return /* @__PURE__ */ jsx("ul", {
|
|
3359
3359
|
role: "tree",
|
|
3360
|
-
className: cn$
|
|
3360
|
+
className: cn$10("select-none", className),
|
|
3361
3361
|
children: nodes.map((node) => /* @__PURE__ */ jsx(TreeItem, {
|
|
3362
3362
|
node,
|
|
3363
3363
|
level: 0,
|
|
@@ -3377,7 +3377,7 @@ function TreeView({ nodes, onSelect, onExpand, onMove, renderNode, selectedId, d
|
|
|
3377
3377
|
|
|
3378
3378
|
//#endregion
|
|
3379
3379
|
//#region src/components/Stepper/index.tsx
|
|
3380
|
-
const cn$
|
|
3380
|
+
const cn$9 = (...classes) => classes.filter(Boolean).join(" ");
|
|
3381
3381
|
function StepIcon({ step, index }) {
|
|
3382
3382
|
const status = step.status || "pending";
|
|
3383
3383
|
if (status === "completed") return /* @__PURE__ */ jsx("div", {
|
|
@@ -3421,17 +3421,17 @@ function Stepper({ steps, activeStep, onStepChange, orientation = "horizontal",
|
|
|
3421
3421
|
type: "button",
|
|
3422
3422
|
onClick: () => onStepChange?.(index),
|
|
3423
3423
|
disabled: !onStepChange,
|
|
3424
|
-
className: cn$
|
|
3424
|
+
className: cn$9("relative z-10", onStepChange && "cursor-pointer", !onStepChange && "cursor-default"),
|
|
3425
3425
|
"aria-current": step.status === "active" ? "step" : void 0,
|
|
3426
3426
|
children: /* @__PURE__ */ jsx(StepIcon, {
|
|
3427
3427
|
step,
|
|
3428
3428
|
index
|
|
3429
3429
|
})
|
|
3430
|
-
}), index < resolvedSteps.length - 1 && /* @__PURE__ */ jsx("div", { className: cn$
|
|
3430
|
+
}), index < resolvedSteps.length - 1 && /* @__PURE__ */ jsx("div", { className: cn$9("w-0.5 flex-1 min-h-[32px]", step.status === "completed" ? "bg-[var(--dashboard-primary,#37a501)]" : "bg-[var(--dashboard-text-secondary,#6b7280)]/20") })]
|
|
3431
3431
|
}), /* @__PURE__ */ jsxs("div", {
|
|
3432
|
-
className: cn$
|
|
3432
|
+
className: cn$9("pb-6", index === resolvedSteps.length - 1 && "pb-0"),
|
|
3433
3433
|
children: [/* @__PURE__ */ jsx("p", {
|
|
3434
|
-
className: cn$
|
|
3434
|
+
className: cn$9("text-sm font-medium leading-8", step.status === "active" ? "text-[var(--dashboard-primary,#37a501)]" : step.status === "completed" ? "text-[var(--dashboard-text-primary,#2d2d2d)]" : step.status === "error" ? "text-[var(--dashboard-status-danger,#EF4444)]" : "text-[var(--dashboard-text-secondary,#6b7280)]"),
|
|
3435
3435
|
children: step.label
|
|
3436
3436
|
}), step.description && /* @__PURE__ */ jsx("p", {
|
|
3437
3437
|
className: "text-xs text-[var(--dashboard-text-secondary,#6b7280)] mt-0.5",
|
|
@@ -3447,12 +3447,12 @@ function Stepper({ steps, activeStep, onStepChange, orientation = "horizontal",
|
|
|
3447
3447
|
children: /* @__PURE__ */ jsx("ol", {
|
|
3448
3448
|
className: "flex items-center",
|
|
3449
3449
|
children: resolvedSteps.map((step, index) => /* @__PURE__ */ jsxs("li", {
|
|
3450
|
-
className: cn$
|
|
3450
|
+
className: cn$9("flex items-center", index < resolvedSteps.length - 1 && "flex-1"),
|
|
3451
3451
|
children: [/* @__PURE__ */ jsxs("button", {
|
|
3452
3452
|
type: "button",
|
|
3453
3453
|
onClick: () => onStepChange?.(index),
|
|
3454
3454
|
disabled: !onStepChange,
|
|
3455
|
-
className: cn$
|
|
3455
|
+
className: cn$9("flex items-center gap-2 group", onStepChange && "cursor-pointer", !onStepChange && "cursor-default"),
|
|
3456
3456
|
"aria-current": step.status === "active" ? "step" : void 0,
|
|
3457
3457
|
children: [/* @__PURE__ */ jsx(StepIcon, {
|
|
3458
3458
|
step,
|
|
@@ -3460,14 +3460,14 @@ function Stepper({ steps, activeStep, onStepChange, orientation = "horizontal",
|
|
|
3460
3460
|
}), /* @__PURE__ */ jsxs("div", {
|
|
3461
3461
|
className: "hidden sm:block text-left",
|
|
3462
3462
|
children: [/* @__PURE__ */ jsx("p", {
|
|
3463
|
-
className: cn$
|
|
3463
|
+
className: cn$9("text-sm font-medium whitespace-nowrap", step.status === "active" ? "text-[var(--dashboard-primary,#37a501)]" : step.status === "completed" ? "text-[var(--dashboard-text-primary,#2d2d2d)]" : step.status === "error" ? "text-[var(--dashboard-status-danger,#EF4444)]" : "text-[var(--dashboard-text-secondary,#6b7280)]"),
|
|
3464
3464
|
children: step.label
|
|
3465
3465
|
}), step.description && /* @__PURE__ */ jsx("p", {
|
|
3466
3466
|
className: "text-xs text-[var(--dashboard-text-secondary,#6b7280)] whitespace-nowrap",
|
|
3467
3467
|
children: step.description
|
|
3468
3468
|
})]
|
|
3469
3469
|
})]
|
|
3470
|
-
}), index < resolvedSteps.length - 1 && /* @__PURE__ */ jsx("div", { className: cn$
|
|
3470
|
+
}), index < resolvedSteps.length - 1 && /* @__PURE__ */ jsx("div", { className: cn$9("flex-1 h-0.5 mx-3", step.status === "completed" ? "bg-[var(--dashboard-primary,#37a501)]" : "bg-[var(--dashboard-text-secondary,#6b7280)]/20") })]
|
|
3471
3471
|
}, step.id))
|
|
3472
3472
|
})
|
|
3473
3473
|
});
|
|
@@ -3475,7 +3475,7 @@ function Stepper({ steps, activeStep, onStepChange, orientation = "horizontal",
|
|
|
3475
3475
|
|
|
3476
3476
|
//#endregion
|
|
3477
3477
|
//#region src/components/FileUpload/index.tsx
|
|
3478
|
-
const cn$
|
|
3478
|
+
const cn$8 = (...classes) => classes.filter(Boolean).join(" ");
|
|
3479
3479
|
function formatSize(bytes) {
|
|
3480
3480
|
if (bytes < 1024) return `${bytes} B`;
|
|
3481
3481
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
@@ -3571,7 +3571,7 @@ function FileUpload({ accept, maxSize, multiple = false, onUpload, onRemove, pre
|
|
|
3571
3571
|
onDragOver: handleDragOver,
|
|
3572
3572
|
onDragLeave: handleDragLeave,
|
|
3573
3573
|
onClick: () => !disabled && inputRef.current?.click(),
|
|
3574
|
-
className: cn$
|
|
3574
|
+
className: cn$8("relative flex flex-col items-center justify-center rounded-lg border-2 border-dashed p-6 transition-colors", isDragging ? "border-[var(--dashboard-primary,#37a501)] bg-[var(--dashboard-primary,#37a501)]/5" : "border-[var(--dashboard-text-secondary,#6b7280)]/30 hover:border-[var(--dashboard-text-secondary,#6b7280)]/50", disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"),
|
|
3575
3575
|
role: "button",
|
|
3576
3576
|
tabIndex: disabled ? -1 : 0,
|
|
3577
3577
|
"aria-label": label,
|
|
@@ -3594,7 +3594,7 @@ function FileUpload({ accept, maxSize, multiple = false, onUpload, onRemove, pre
|
|
|
3594
3594
|
}), /* @__PURE__ */ jsxs("div", {
|
|
3595
3595
|
className: "flex flex-col items-center text-center",
|
|
3596
3596
|
children: [
|
|
3597
|
-
icon || /* @__PURE__ */ jsx(Upload, { className: cn$
|
|
3597
|
+
icon || /* @__PURE__ */ jsx(Upload, { className: cn$8("h-8 w-8 mb-3", isDragging ? "text-[var(--dashboard-primary,#37a501)]" : "text-[var(--dashboard-text-secondary,#6b7280)]") }),
|
|
3598
3598
|
/* @__PURE__ */ jsx("p", {
|
|
3599
3599
|
className: "text-sm font-medium text-[var(--dashboard-text-primary,#2d2d2d)]",
|
|
3600
3600
|
children: label
|
|
@@ -3661,7 +3661,7 @@ function FileUpload({ accept, maxSize, multiple = false, onUpload, onRemove, pre
|
|
|
3661
3661
|
|
|
3662
3662
|
//#endregion
|
|
3663
3663
|
//#region src/components/Tooltip/index.tsx
|
|
3664
|
-
const cn$
|
|
3664
|
+
const cn$7 = (...classes) => classes.filter(Boolean).join(" ");
|
|
3665
3665
|
function Tooltip({ content, position = "top", delay = 200, children, className, maxWidth = 240 }) {
|
|
3666
3666
|
const [visible, setVisible] = useState(false);
|
|
3667
3667
|
const [coords, setCoords] = useState({
|
|
@@ -3734,7 +3734,7 @@ function Tooltip({ content, position = "top", delay = 200, children, className,
|
|
|
3734
3734
|
ref: tooltipRef,
|
|
3735
3735
|
id: idRef.current,
|
|
3736
3736
|
role: "tooltip",
|
|
3737
|
-
className: cn$
|
|
3737
|
+
className: cn$7("fixed z-[10002] rounded-md px-3 py-2 text-xs font-medium", "bg-[var(--dashboard-text-primary,#2d2d2d)] text-white", "shadow-lg dashboard-animate-fade-in pointer-events-none", className),
|
|
3738
3738
|
style: {
|
|
3739
3739
|
top: coords.top,
|
|
3740
3740
|
left: coords.left,
|
|
@@ -3746,7 +3746,7 @@ function Tooltip({ content, position = "top", delay = 200, children, className,
|
|
|
3746
3746
|
|
|
3747
3747
|
//#endregion
|
|
3748
3748
|
//#region src/components/Breadcrumb/index.tsx
|
|
3749
|
-
const cn$
|
|
3749
|
+
const cn$6 = (...classes) => classes.filter(Boolean).join(" ");
|
|
3750
3750
|
function Breadcrumb({ items, separator, onNavigate, className }) {
|
|
3751
3751
|
const defaultSeparator = /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 text-[var(--dashboard-text-secondary,#6b7280)] flex-shrink-0" });
|
|
3752
3752
|
const handleClick = (e, href) => {
|
|
@@ -3768,7 +3768,7 @@ function Breadcrumb({ items, separator, onNavigate, className }) {
|
|
|
3768
3768
|
"aria-hidden": "true",
|
|
3769
3769
|
children: separator || defaultSeparator
|
|
3770
3770
|
}), isLast ? /* @__PURE__ */ jsxs("span", {
|
|
3771
|
-
className: cn$
|
|
3771
|
+
className: cn$6("flex items-center gap-1.5 text-sm font-medium", "text-[var(--dashboard-text-primary,#2d2d2d)]"),
|
|
3772
3772
|
"aria-current": "page",
|
|
3773
3773
|
children: [item.icon && /* @__PURE__ */ jsx("span", {
|
|
3774
3774
|
className: "flex-shrink-0 h-4 w-4",
|
|
@@ -3777,7 +3777,7 @@ function Breadcrumb({ items, separator, onNavigate, className }) {
|
|
|
3777
3777
|
}) : /* @__PURE__ */ jsxs("a", {
|
|
3778
3778
|
href: item.href || "#",
|
|
3779
3779
|
onClick: (e) => handleClick(e, item.href),
|
|
3780
|
-
className: cn$
|
|
3780
|
+
className: cn$6("flex items-center gap-1.5 text-sm", "text-[var(--dashboard-text-secondary,#6b7280)]", "hover:text-[var(--dashboard-primary,#37a501)] transition-colors"),
|
|
3781
3781
|
children: [item.icon && /* @__PURE__ */ jsx("span", {
|
|
3782
3782
|
className: "flex-shrink-0 h-4 w-4",
|
|
3783
3783
|
children: item.icon
|
|
@@ -3791,7 +3791,7 @@ function Breadcrumb({ items, separator, onNavigate, className }) {
|
|
|
3791
3791
|
|
|
3792
3792
|
//#endregion
|
|
3793
3793
|
//#region src/components/Combobox/index.tsx
|
|
3794
|
-
const cn$
|
|
3794
|
+
const cn$5 = (...classes) => classes.filter(Boolean).join(" ");
|
|
3795
3795
|
function Combobox({ options, value, onChange, multiple = false, searchable = true, placeholder = "Selecione...", label, error, disabled = false, renderOption, noResultsText = "Nenhum resultado encontrado", className }) {
|
|
3796
3796
|
const [isOpen, setIsOpen] = useState(false);
|
|
3797
3797
|
const [query, setQuery] = useState("");
|
|
@@ -3921,7 +3921,7 @@ function Combobox({ options, value, onChange, multiple = false, searchable = tru
|
|
|
3921
3921
|
}, [focusedIndex]);
|
|
3922
3922
|
const selectedLabels = selectedValues.map((v) => options.find((o) => o.value === v)?.label).filter(Boolean);
|
|
3923
3923
|
return /* @__PURE__ */ jsxs("div", {
|
|
3924
|
-
className: cn$
|
|
3924
|
+
className: cn$5("space-y-2", className),
|
|
3925
3925
|
children: [
|
|
3926
3926
|
label && /* @__PURE__ */ jsx("label", {
|
|
3927
3927
|
className: "block text-sm text-[var(--dashboard-text-primary,#2d2d2d)]",
|
|
@@ -3937,7 +3937,7 @@ function Combobox({ options, value, onChange, multiple = false, searchable = tru
|
|
|
3937
3937
|
"aria-controls": "combobox-listbox",
|
|
3938
3938
|
tabIndex: disabled ? -1 : 0,
|
|
3939
3939
|
onClick: () => isOpen ? close() : open(),
|
|
3940
|
-
className: cn$
|
|
3940
|
+
className: cn$5("flex min-h-[40px] w-full items-center gap-2 rounded-lg border px-3 py-2 transition-colors", isOpen ? "border-[var(--dashboard-primary,#37a501)] ring-2 ring-[var(--dashboard-primary,#37a501)]/20" : error ? "border-[var(--dashboard-status-danger,#EF4444)]" : "border-[var(--dashboard-text-secondary,#6b7280)]/30 hover:border-[var(--dashboard-text-secondary,#6b7280)]/50", disabled ? "opacity-50 cursor-not-allowed bg-[var(--dashboard-text-secondary,#6b7280)]/10" : "cursor-pointer bg-[var(--dashboard-surface,#ffffff)]"),
|
|
3941
3941
|
children: [
|
|
3942
3942
|
/* @__PURE__ */ jsx("div", {
|
|
3943
3943
|
className: "flex flex-1 flex-wrap items-center gap-1 min-w-0",
|
|
@@ -3965,7 +3965,7 @@ function Combobox({ options, value, onChange, multiple = false, searchable = tru
|
|
|
3965
3965
|
"aria-label": "Limpar seleção",
|
|
3966
3966
|
children: /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" })
|
|
3967
3967
|
}),
|
|
3968
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: cn$
|
|
3968
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: cn$5("h-4 w-4 flex-shrink-0 text-[var(--dashboard-text-secondary,#6b7280)] transition-transform", isOpen && "rotate-180") })
|
|
3969
3969
|
]
|
|
3970
3970
|
}), isOpen && typeof document !== "undefined" && createPortal(/* @__PURE__ */ jsxs("div", {
|
|
3971
3971
|
className: "dc-combobox-portal rounded-lg border border-[var(--dashboard-text-secondary,#6b7280)]/20 bg-[var(--dashboard-surface,#ffffff)] shadow-lg dashboard-animate-fade-in overflow-hidden",
|
|
@@ -4010,7 +4010,7 @@ function Combobox({ options, value, onChange, multiple = false, searchable = tru
|
|
|
4010
4010
|
onClick: () => {
|
|
4011
4011
|
if (!option.disabled) toggleOption(option.value);
|
|
4012
4012
|
},
|
|
4013
|
-
className: cn$
|
|
4013
|
+
className: cn$5("flex items-center justify-between px-3 py-2 text-sm transition-colors", option.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer", isFocused && "bg-[var(--dashboard-text-secondary,#6b7280)]/10", !isFocused && !option.disabled && "hover:bg-[var(--dashboard-text-secondary,#6b7280)]/10", isSelected ? "text-[var(--dashboard-primary,#37a501)] font-medium" : "text-[var(--dashboard-text-primary,#2d2d2d)]"),
|
|
4014
4014
|
children: renderOption ? renderOption(option, isSelected) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
4015
4015
|
className: "truncate",
|
|
4016
4016
|
children: option.label
|
|
@@ -4030,8 +4030,8 @@ function Combobox({ options, value, onChange, multiple = false, searchable = tru
|
|
|
4030
4030
|
|
|
4031
4031
|
//#endregion
|
|
4032
4032
|
//#region src/components/Alert/index.tsx
|
|
4033
|
-
const cn$
|
|
4034
|
-
const variantConfig = {
|
|
4033
|
+
const cn$4 = (...classes) => classes.filter(Boolean).join(" ");
|
|
4034
|
+
const variantConfig$1 = {
|
|
4035
4035
|
info: {
|
|
4036
4036
|
border: "border-[var(--dashboard-status-info,#3b82f6)]",
|
|
4037
4037
|
bg: "bg-[var(--dashboard-status-info,#3b82f6)]/5",
|
|
@@ -4058,26 +4058,26 @@ const variantConfig = {
|
|
|
4058
4058
|
}
|
|
4059
4059
|
};
|
|
4060
4060
|
function Alert({ variant = "info", title, description, onClose, actions, icon, className }) {
|
|
4061
|
-
const config = variantConfig[variant];
|
|
4061
|
+
const config = variantConfig$1[variant];
|
|
4062
4062
|
return /* @__PURE__ */ jsx("div", {
|
|
4063
|
-
className: cn$
|
|
4063
|
+
className: cn$4("rounded-lg border-l-4 p-4", config.border, config.bg, className),
|
|
4064
4064
|
role: "alert",
|
|
4065
4065
|
children: /* @__PURE__ */ jsxs("div", {
|
|
4066
4066
|
className: "flex gap-3",
|
|
4067
4067
|
children: [
|
|
4068
4068
|
/* @__PURE__ */ jsx("div", {
|
|
4069
|
-
className: cn$
|
|
4069
|
+
className: cn$4("flex-shrink-0 mt-0.5", config.text),
|
|
4070
4070
|
children: icon || config.icon
|
|
4071
4071
|
}),
|
|
4072
4072
|
/* @__PURE__ */ jsxs("div", {
|
|
4073
4073
|
className: "flex-1 min-w-0",
|
|
4074
4074
|
children: [
|
|
4075
4075
|
title && /* @__PURE__ */ jsx("h3", {
|
|
4076
|
-
className: cn$
|
|
4076
|
+
className: cn$4("text-sm font-semibold", "text-[var(--dashboard-text-primary,#2d2d2d)]"),
|
|
4077
4077
|
children: title
|
|
4078
4078
|
}),
|
|
4079
4079
|
description && /* @__PURE__ */ jsx("div", {
|
|
4080
|
-
className: cn$
|
|
4080
|
+
className: cn$4("text-sm text-[var(--dashboard-text-secondary,#6b7280)]", title && "mt-1"),
|
|
4081
4081
|
children: description
|
|
4082
4082
|
}),
|
|
4083
4083
|
actions && /* @__PURE__ */ jsx("div", {
|
|
@@ -4097,6 +4097,116 @@ function Alert({ variant = "info", title, description, onClose, actions, icon, c
|
|
|
4097
4097
|
});
|
|
4098
4098
|
}
|
|
4099
4099
|
|
|
4100
|
+
//#endregion
|
|
4101
|
+
//#region src/components/Callout/index.tsx
|
|
4102
|
+
const cn$3 = (...classes) => classes.filter(Boolean).join(" ");
|
|
4103
|
+
const variantConfig = {
|
|
4104
|
+
info: {
|
|
4105
|
+
border: "border-[var(--dashboard-status-info,#3b82f6)]",
|
|
4106
|
+
bg: "bg-[var(--dashboard-status-info,#3b82f6)]/5",
|
|
4107
|
+
text: "text-[var(--dashboard-status-info,#3b82f6)]",
|
|
4108
|
+
icon: /* @__PURE__ */ jsx(Info, { className: "h-4 w-4" })
|
|
4109
|
+
},
|
|
4110
|
+
warning: {
|
|
4111
|
+
border: "border-[var(--dashboard-status-warning,#f59e0b)]",
|
|
4112
|
+
bg: "bg-[var(--dashboard-status-warning,#f59e0b)]/5",
|
|
4113
|
+
text: "text-[var(--dashboard-status-warning,#f59e0b)]",
|
|
4114
|
+
icon: /* @__PURE__ */ jsx(AlertTriangle, { className: "h-4 w-4" })
|
|
4115
|
+
},
|
|
4116
|
+
tip: {
|
|
4117
|
+
border: "border-[var(--dashboard-status-success,#10B981)]",
|
|
4118
|
+
bg: "bg-[var(--dashboard-status-success,#10B981)]/5",
|
|
4119
|
+
text: "text-[var(--dashboard-status-success,#10B981)]",
|
|
4120
|
+
icon: /* @__PURE__ */ jsx(Lightbulb, { className: "h-4 w-4" })
|
|
4121
|
+
},
|
|
4122
|
+
danger: {
|
|
4123
|
+
border: "border-[var(--dashboard-status-danger,#EF4444)]",
|
|
4124
|
+
bg: "bg-[var(--dashboard-status-danger,#EF4444)]/5",
|
|
4125
|
+
text: "text-[var(--dashboard-status-danger,#EF4444)]",
|
|
4126
|
+
icon: /* @__PURE__ */ jsx(ShieldAlert, { className: "h-4 w-4" })
|
|
4127
|
+
}
|
|
4128
|
+
};
|
|
4129
|
+
function Callout({ variant = "info", title, children, icon, className }) {
|
|
4130
|
+
const config = variantConfig[variant];
|
|
4131
|
+
return /* @__PURE__ */ jsx("div", {
|
|
4132
|
+
className: cn$3("rounded-lg border-l-4 p-4 my-4", config.border, config.bg, className),
|
|
4133
|
+
role: "note",
|
|
4134
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
4135
|
+
className: "flex gap-3",
|
|
4136
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
4137
|
+
className: cn$3("flex-shrink-0 mt-0.5", config.text),
|
|
4138
|
+
children: icon || config.icon
|
|
4139
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
4140
|
+
className: "flex-1 min-w-0",
|
|
4141
|
+
children: [title && /* @__PURE__ */ jsx("p", {
|
|
4142
|
+
className: cn$3("text-sm font-semibold", "text-[var(--dashboard-text-primary,#2d2d2d)]"),
|
|
4143
|
+
children: title
|
|
4144
|
+
}), children && /* @__PURE__ */ jsx("div", {
|
|
4145
|
+
className: cn$3("text-sm text-[var(--dashboard-text-secondary,#6b7280)]", title && "mt-1"),
|
|
4146
|
+
children
|
|
4147
|
+
})]
|
|
4148
|
+
})]
|
|
4149
|
+
})
|
|
4150
|
+
});
|
|
4151
|
+
}
|
|
4152
|
+
|
|
4153
|
+
//#endregion
|
|
4154
|
+
//#region src/components/CodeBlock/index.tsx
|
|
4155
|
+
const cn$2 = (...classes) => classes.filter(Boolean).join(" ");
|
|
4156
|
+
function CodeBlock({ code, language, filename, showLineNumbers = false, className, copyLabel = "Copiar", copiedLabel = "Copiado!" }) {
|
|
4157
|
+
const [copied, setCopied] = useState(false);
|
|
4158
|
+
const handleCopy = useCallback(async () => {
|
|
4159
|
+
try {
|
|
4160
|
+
await navigator.clipboard.writeText(code);
|
|
4161
|
+
setCopied(true);
|
|
4162
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
4163
|
+
} catch {}
|
|
4164
|
+
}, [code]);
|
|
4165
|
+
const lines = code.split("\n");
|
|
4166
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
4167
|
+
className: cn$2("relative rounded-lg overflow-hidden border border-[var(--dashboard-text-secondary,#64748B)]/12 my-4", className),
|
|
4168
|
+
children: [(filename || language) && /* @__PURE__ */ jsxs("div", {
|
|
4169
|
+
className: "flex items-center justify-between px-4 py-2 bg-[var(--dashboard-text-primary,#0F172A)] border-b border-[var(--dashboard-text-secondary,#64748B)]/20",
|
|
4170
|
+
children: [
|
|
4171
|
+
filename && /* @__PURE__ */ jsx("span", {
|
|
4172
|
+
className: "text-xs text-[var(--dashboard-text-secondary,#64748B)] font-mono",
|
|
4173
|
+
children: filename
|
|
4174
|
+
}),
|
|
4175
|
+
language && !filename && /* @__PURE__ */ jsx("span", {}),
|
|
4176
|
+
language && /* @__PURE__ */ jsx("span", {
|
|
4177
|
+
className: "text-xs text-[var(--dashboard-text-secondary,#64748B)]/60",
|
|
4178
|
+
children: language
|
|
4179
|
+
})
|
|
4180
|
+
]
|
|
4181
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
4182
|
+
className: "relative",
|
|
4183
|
+
children: [/* @__PURE__ */ jsx("pre", {
|
|
4184
|
+
className: "overflow-x-auto p-4 bg-[var(--dashboard-text-primary,#0F172A)] m-0",
|
|
4185
|
+
"data-language": language,
|
|
4186
|
+
children: /* @__PURE__ */ jsx("code", {
|
|
4187
|
+
className: "text-sm font-mono leading-relaxed text-[var(--dashboard-surface,#FFFFFF)]/90",
|
|
4188
|
+
children: showLineNumbers ? lines.map((line, i) => /* @__PURE__ */ jsxs("span", {
|
|
4189
|
+
className: "table-row",
|
|
4190
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
4191
|
+
className: "table-cell pr-4 text-right select-none text-[var(--dashboard-text-secondary,#64748B)]/40 text-xs w-8",
|
|
4192
|
+
children: i + 1
|
|
4193
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
4194
|
+
className: "table-cell",
|
|
4195
|
+
children: [line, "\n"]
|
|
4196
|
+
})]
|
|
4197
|
+
}, i)) : code
|
|
4198
|
+
})
|
|
4199
|
+
}), /* @__PURE__ */ jsxs("button", {
|
|
4200
|
+
onClick: handleCopy,
|
|
4201
|
+
className: cn$2("absolute top-3 right-3 flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium transition-all duration-200 cursor-pointer", copied ? "bg-[var(--dashboard-status-success,#059669)]/20 text-[var(--dashboard-status-success,#059669)]" : "bg-[var(--dashboard-surface,#FFFFFF)]/10 text-[var(--dashboard-surface,#FFFFFF)]/60 hover:bg-[var(--dashboard-surface,#FFFFFF)]/20 hover:text-[var(--dashboard-surface,#FFFFFF)]/80"),
|
|
4202
|
+
"aria-label": copied ? copiedLabel : copyLabel,
|
|
4203
|
+
title: copied ? copiedLabel : copyLabel,
|
|
4204
|
+
children: [copied ? /* @__PURE__ */ jsx(Check, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx(Copy, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ jsx("span", { children: copied ? copiedLabel : copyLabel })]
|
|
4205
|
+
})]
|
|
4206
|
+
})]
|
|
4207
|
+
});
|
|
4208
|
+
}
|
|
4209
|
+
|
|
4100
4210
|
//#endregion
|
|
4101
4211
|
//#region src/components/EmptyState/index.tsx
|
|
4102
4212
|
const cn$1 = (...classes) => classes.filter(Boolean).join(" ");
|
|
@@ -4425,5 +4535,5 @@ function DashboardProvider({ config: configOverrides, children }) {
|
|
|
4425
4535
|
}
|
|
4426
4536
|
|
|
4427
4537
|
//#endregion
|
|
4428
|
-
export { Alert, AuthLayout, BadgeStatus, Breadcrumb, Button, Card, Checkbox, CodeInput, Combobox, ComparisonLineChart, DashboardProvider, DataGrid, DateRangePicker, DoughnutChart, Dropdown, EmptyState, FileUpload, FilterBar, FormField, HorizontalBarChart, Input, KPICard, Loading, LoadingProvider, MetricPanel, Modal, NotificationsProvider, PageLayout, Pagination, ProgressBarList, Sidebar, Skeleton, StatusBadge, Stepper, Table, TableBody, TableEmpty, TableHeader, TableSkeleton, Tabs, ThemeProvider, ThemeSwitcher, Title, Toast, ToggleSwitch, Tooltip, TreeView, VerticalBarChart, createColumnHelper, createConfig, defaultConfig, useConfig, useLoading, useNotifications, useTheme };
|
|
4538
|
+
export { Alert, AuthLayout, BadgeStatus, Breadcrumb, Button, Callout, Card, Checkbox, CodeBlock, CodeInput, Combobox, ComparisonLineChart, DashboardProvider, DataGrid, DateRangePicker, DoughnutChart, Dropdown, EmptyState, FileUpload, FilterBar, FormField, HorizontalBarChart, Input, KPICard, Loading, LoadingProvider, MetricPanel, Modal, NotificationsProvider, PageLayout, Pagination, ProgressBarList, Sidebar, Skeleton, StatusBadge, Stepper, Table, TableBody, TableEmpty, TableHeader, TableSkeleton, Tabs, ThemeProvider, ThemeSwitcher, Title, Toast, ToggleSwitch, Tooltip, TreeView, VerticalBarChart, createColumnHelper, createConfig, defaultConfig, useConfig, useLoading, useNotifications, useTheme };
|
|
4429
4539
|
//# sourceMappingURL=index.mjs.map
|