@axzydev/axzy_ui_system 1.4.3 → 1.4.5
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.cjs +548 -378
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +57 -3
- package/dist/index.d.ts +57 -3
- package/dist/index.js +511 -342
- package/dist/index.js.map +1 -1
- package/dist/layered.css +3 -0
- package/package.json +1 -1
- package/src/components/molecules/line-bar-chart/line-bar-chart.props.ts +28 -0
- package/src/components/molecules/line-bar-chart/line-bar-chart.tsx +169 -0
- package/src/components/organisms/sidebar/sidebar.doc.mdx +1 -0
- package/src/components/organisms/sidebar/sidebar.props.ts +12 -1
- package/src/components/organisms/sidebar/sidebar.tsx +53 -22
- package/src/components/organisms/topbar/topbar.props.ts +6 -0
- package/src/components/organisms/topbar/topbar.tsx +4 -1
- package/src/components/templates/layout/layout.tsx +13 -3
- package/src/index.ts +4 -2
package/dist/index.cjs
CHANGED
|
@@ -59,6 +59,7 @@ __export(index_exports, {
|
|
|
59
59
|
ITInput: () => ITInput,
|
|
60
60
|
ITInputNumber: () => ITInputNumber,
|
|
61
61
|
ITLayout: () => ITLayout,
|
|
62
|
+
ITLineBarChart: () => line_bar_chart_default,
|
|
62
63
|
ITLoader: () => ITLoader,
|
|
63
64
|
ITMaskedInput: () => ITMaskedInput,
|
|
64
65
|
ITMultiSelect: () => ITMultiSelect,
|
|
@@ -7695,7 +7696,9 @@ function ITSidebar({
|
|
|
7695
7696
|
subitemConnector = "dot",
|
|
7696
7697
|
header,
|
|
7697
7698
|
notification,
|
|
7698
|
-
brand
|
|
7699
|
+
brand,
|
|
7700
|
+
onToggleCollapse,
|
|
7701
|
+
expandOnHover = true
|
|
7699
7702
|
}) {
|
|
7700
7703
|
const flat = useITFlatAppearance();
|
|
7701
7704
|
const [expandedItems, setExpandedItems] = (0, import_react35.useState)(/* @__PURE__ */ new Set());
|
|
@@ -7751,6 +7754,9 @@ function ITSidebar({
|
|
|
7751
7754
|
});
|
|
7752
7755
|
}
|
|
7753
7756
|
}, [navigationItems]);
|
|
7757
|
+
const isSidebarCollapsed = visibleOnMobile ? false : isCollapsed && !(expandOnHover && isHovering);
|
|
7758
|
+
const sidebarWidth = isSidebarCollapsed ? flat ? "w-[72px]" : "w-[88px]" : flat ? "w-[248px]" : "w-[280px]";
|
|
7759
|
+
const fixedRail = isSidebarCollapsed && !expandOnHover;
|
|
7754
7760
|
const toggleExpanded = (itemId) => {
|
|
7755
7761
|
const newExpanded = new Set(expandedItems);
|
|
7756
7762
|
if (newExpanded.has(itemId)) newExpanded.delete(itemId);
|
|
@@ -7759,14 +7765,17 @@ function ITSidebar({
|
|
|
7759
7765
|
};
|
|
7760
7766
|
const handleItemClick = (item) => {
|
|
7761
7767
|
if (item.subitems && item.subitems.length > 0) {
|
|
7762
|
-
|
|
7768
|
+
if (isSidebarCollapsed && !expandOnHover) {
|
|
7769
|
+
setExpandedItems((prev) => new Set(prev).add(item.id));
|
|
7770
|
+
onToggleCollapse?.();
|
|
7771
|
+
} else {
|
|
7772
|
+
toggleExpanded(item.id);
|
|
7773
|
+
}
|
|
7763
7774
|
} else {
|
|
7764
7775
|
if (item.action) item.action();
|
|
7765
7776
|
if (onItemClick) onItemClick(item);
|
|
7766
7777
|
}
|
|
7767
7778
|
};
|
|
7768
|
-
const isSidebarCollapsed = visibleOnMobile ? false : !isHovering && isCollapsed;
|
|
7769
|
-
const sidebarWidth = isSidebarCollapsed ? "w-[88px]" : flat ? "w-[248px]" : "w-[280px]";
|
|
7770
7779
|
const renderSubItem = (subitem) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("li", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
7771
7780
|
"button",
|
|
7772
7781
|
{
|
|
@@ -7779,7 +7788,7 @@ function ITSidebar({
|
|
|
7779
7788
|
style: {
|
|
7780
7789
|
color: subitem.isActive ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-label-color, var(--color-secondary-600))",
|
|
7781
7790
|
backgroundColor: subitem.isActive ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
|
|
7782
|
-
fontSize: "0.78rem",
|
|
7791
|
+
fontSize: flat ? "0.84rem" : "0.78rem",
|
|
7783
7792
|
fontWeight: subitem.isActive ? 600 : 500,
|
|
7784
7793
|
letterSpacing: "0.01em",
|
|
7785
7794
|
marginLeft: subitemConnector === "|" ? "-1px" : "0"
|
|
@@ -7797,7 +7806,7 @@ function ITSidebar({
|
|
|
7797
7806
|
}
|
|
7798
7807
|
},
|
|
7799
7808
|
children: [
|
|
7800
|
-
subitem.isActive && subitemConnector === "|" && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7809
|
+
subitem.isActive && subitemConnector === "|" && !flat && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7801
7810
|
"div",
|
|
7802
7811
|
{
|
|
7803
7812
|
className: "absolute left-0 top-1/3 bottom-1/3 w-[2.5px] rounded-r-full transition-all",
|
|
@@ -7961,10 +7970,11 @@ function ITSidebar({
|
|
|
7961
7970
|
),
|
|
7962
7971
|
header && !isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "px-4 pt-4 pb-1 flex-shrink-0", children: header }),
|
|
7963
7972
|
notification && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "px-4 pt-3 flex-shrink-0", children: renderNotification() }),
|
|
7964
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("nav", { "aria-label": "Componentes de la librer\xEDa", className:
|
|
7973
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("nav", { "aria-label": "Componentes de la librer\xEDa", className: `flex-1 py-4 custom-scrollbar ${fixedRail ? "overflow-visible" : "overflow-y-auto overflow-x-hidden"} ${flat && isSidebarCollapsed ? "px-3" : "px-4"}`, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("ul", { className: "space-y-1", children: navigationItems.map((item) => {
|
|
7965
7974
|
const hasSubmenu = !!item.subitems && item.subitems.length > 0;
|
|
7966
7975
|
const submenuId = `it-sidebar-submenu-${item.id}`;
|
|
7967
7976
|
const { className: badgeClassName, ...badgeRest } = item.badgeProps ?? {};
|
|
7977
|
+
const active = !!item.isActive && !(flat && hasSubmenu && !isSidebarCollapsed);
|
|
7968
7978
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("li", { className: "relative group/navitem", children: [
|
|
7969
7979
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
7970
7980
|
"div",
|
|
@@ -7977,18 +7987,18 @@ function ITSidebar({
|
|
|
7977
7987
|
className: `flex items-center cursor-pointer
|
|
7978
7988
|
transition-all duration-300 ease-[cubic-bezier(0.2,0,0,1)]
|
|
7979
7989
|
rounded-xl relative overflow-visible
|
|
7980
|
-
${isSidebarCollapsed ? "justify-center p-2 mb-1" : "justify-between px-3 py-2 mb-0.5"}
|
|
7990
|
+
${isSidebarCollapsed ? flat ? "justify-center h-10 mb-1" : "justify-center p-2 mb-1" : "justify-between px-3 py-2 mb-0.5"}
|
|
7981
7991
|
`,
|
|
7982
7992
|
style: {
|
|
7983
|
-
backgroundColor:
|
|
7984
|
-
boxShadow:
|
|
7985
|
-
border:
|
|
7993
|
+
backgroundColor: active ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
|
|
7994
|
+
boxShadow: active && !flat ? "var(--shadow-xs)" : "none",
|
|
7995
|
+
border: active && !flat ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "1px solid transparent"
|
|
7986
7996
|
},
|
|
7987
7997
|
onMouseEnter: (e) => {
|
|
7988
|
-
if (!
|
|
7998
|
+
if (!active) e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
|
|
7989
7999
|
},
|
|
7990
8000
|
onMouseLeave: (e) => {
|
|
7991
|
-
if (!
|
|
8001
|
+
if (!active) e.currentTarget.style.backgroundColor = "transparent";
|
|
7992
8002
|
},
|
|
7993
8003
|
onClick: () => handleItemClick(item),
|
|
7994
8004
|
onKeyDown: (e) => {
|
|
@@ -7998,7 +8008,7 @@ function ITSidebar({
|
|
|
7998
8008
|
}
|
|
7999
8009
|
},
|
|
8000
8010
|
children: [
|
|
8001
|
-
|
|
8011
|
+
active && !isSidebarCollapsed && !flat && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8002
8012
|
"div",
|
|
8003
8013
|
{
|
|
8004
8014
|
className: "absolute left-0 top-1/4 bottom-1/4 w-[3px] rounded-r-full transition-all",
|
|
@@ -8011,10 +8021,10 @@ function ITSidebar({
|
|
|
8011
8021
|
{
|
|
8012
8022
|
className: `transition-all duration-300 flex-shrink-0 flex items-center justify-center`,
|
|
8013
8023
|
style: {
|
|
8014
|
-
color:
|
|
8015
|
-
opacity:
|
|
8016
|
-
fontSize: flat ? "1rem" :
|
|
8017
|
-
filter:
|
|
8024
|
+
color: active ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, #9ca3af)",
|
|
8025
|
+
opacity: active ? 1 : 0.8,
|
|
8026
|
+
fontSize: flat ? "1rem" : active ? "1.12rem" : "1.05rem",
|
|
8027
|
+
filter: active && !flat ? "drop-shadow(0 0 8px rgba(255,255,255,0.2))" : "none"
|
|
8018
8028
|
},
|
|
8019
8029
|
children: item.icon
|
|
8020
8030
|
}
|
|
@@ -8025,9 +8035,9 @@ function ITSidebar({
|
|
|
8025
8035
|
as: "span",
|
|
8026
8036
|
className: `transition-all duration-300 truncate tracking-wide`,
|
|
8027
8037
|
style: {
|
|
8028
|
-
color:
|
|
8038
|
+
color: active ? "var(--it-sidebar-active-color, #ffffff)" : "var(--it-sidebar-label-color, var(--color-secondary-300))",
|
|
8029
8039
|
fontSize: flat ? "0.875rem" : "0.8rem",
|
|
8030
|
-
fontWeight:
|
|
8040
|
+
fontWeight: active ? "600" : "500"
|
|
8031
8041
|
},
|
|
8032
8042
|
children: item.label
|
|
8033
8043
|
}
|
|
@@ -8037,7 +8047,7 @@ function ITSidebar({
|
|
|
8037
8047
|
"div",
|
|
8038
8048
|
{
|
|
8039
8049
|
className: `flex-shrink-0 transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)] ${expandedItems.has(item.id) ? "rotate-180" : ""}`,
|
|
8040
|
-
style: { color:
|
|
8050
|
+
style: { color: active ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-icon-color, var(--color-secondary-500))", opacity: 0.7 },
|
|
8041
8051
|
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_fa26.FaChevronDown, { className: "w-3 h-3" })
|
|
8042
8052
|
}
|
|
8043
8053
|
),
|
|
@@ -8058,7 +8068,21 @@ function ITSidebar({
|
|
|
8058
8068
|
]
|
|
8059
8069
|
}
|
|
8060
8070
|
),
|
|
8061
|
-
isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime57.
|
|
8071
|
+
isSidebarCollapsed && flat && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8072
|
+
"div",
|
|
8073
|
+
{
|
|
8074
|
+
role: "tooltip",
|
|
8075
|
+
className: "absolute left-full top-1/2 -translate-y-1/2 ml-3 px-2.5 py-1.5 rounded-lg whitespace-nowrap opacity-0 invisible group-hover/navitem:opacity-100 group-hover/navitem:visible transition-opacity duration-150 pointer-events-none z-[70]",
|
|
8076
|
+
style: {
|
|
8077
|
+
backgroundColor: "var(--it-sidebar-tooltip-bg, var(--color-secondary-900))",
|
|
8078
|
+
color: "var(--it-sidebar-tooltip-color, #ffffff)",
|
|
8079
|
+
fontSize: "0.78rem",
|
|
8080
|
+
fontWeight: 500
|
|
8081
|
+
},
|
|
8082
|
+
children: item.label
|
|
8083
|
+
}
|
|
8084
|
+
),
|
|
8085
|
+
isSidebarCollapsed && !flat && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
8062
8086
|
"div",
|
|
8063
8087
|
{
|
|
8064
8088
|
className: "absolute left-full top-0 ml-4 rounded-2xl opacity-0 invisible group-hover/navitem:opacity-100 group-hover/navitem:visible transition-all duration-300 pointer-events-none z-[70] min-w-[220px] overflow-hidden -translate-x-2 group-hover/navitem:translate-x-0 shadow-[0_10px_40px_-10px_rgba(0,0,0,0.15)]",
|
|
@@ -8100,7 +8124,7 @@ function ITSidebar({
|
|
|
8100
8124
|
!isSidebarCollapsed && item.subitems && item.subitems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { id: submenuId, role: "group", "aria-label": item.label, className: `overflow-hidden transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] ${expandedItems.has(item.id) ? "max-h-[1000px] opacity-100 mt-1" : "max-h-0 opacity-0"}`, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8101
8125
|
"ul",
|
|
8102
8126
|
{
|
|
8103
|
-
className: "ml-4 flex flex-col gap-0 py-0.5
|
|
8127
|
+
className: `${flat && subitemConnector === "|" ? "ml-[21px] pl-2" : "ml-4"} flex flex-col gap-0 py-0.5`,
|
|
8104
8128
|
style: {
|
|
8105
8129
|
borderLeft: subitemConnector === "|" ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "none"
|
|
8106
8130
|
},
|
|
@@ -8295,13 +8319,149 @@ function ITStatCard({
|
|
|
8295
8319
|
);
|
|
8296
8320
|
}
|
|
8297
8321
|
|
|
8322
|
+
// src/components/molecules/line-bar-chart/line-bar-chart.tsx
|
|
8323
|
+
var import_react37 = require("react");
|
|
8324
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
8325
|
+
var compact = (value) => new Intl.NumberFormat("es-MX", { notation: "compact", maximumFractionDigits: 1 }).format(value);
|
|
8326
|
+
var plain = (value) => new Intl.NumberFormat("es-MX").format(value);
|
|
8327
|
+
function ITLineBarChart({
|
|
8328
|
+
data,
|
|
8329
|
+
ariaLabel,
|
|
8330
|
+
lineLabel = "Serie A",
|
|
8331
|
+
barLabel = "Serie B",
|
|
8332
|
+
lineColor = "#10b981",
|
|
8333
|
+
barColor = "#3b82f6",
|
|
8334
|
+
height = 240,
|
|
8335
|
+
formatValue = plain,
|
|
8336
|
+
formatAxis = compact,
|
|
8337
|
+
className = ""
|
|
8338
|
+
}) {
|
|
8339
|
+
const gradientId = (0, import_react37.useId)().replace(/[:]/g, "");
|
|
8340
|
+
const [hover, setHover] = (0, import_react37.useState)(null);
|
|
8341
|
+
const width = 720;
|
|
8342
|
+
const padding = { top: 16, right: 16, bottom: 28, left: 52 };
|
|
8343
|
+
const plotWidth = width - padding.left - padding.right;
|
|
8344
|
+
const plotHeight = height - padding.top - padding.bottom;
|
|
8345
|
+
const max = (0, import_react37.useMemo)(
|
|
8346
|
+
() => Math.max(...data.flatMap((d) => [d.line, d.bar]), 1),
|
|
8347
|
+
[data]
|
|
8348
|
+
);
|
|
8349
|
+
const gridValues = [0, 0.25, 0.5, 0.75, 1].map((f) => max * f);
|
|
8350
|
+
const step = data.length > 0 ? plotWidth / data.length : plotWidth;
|
|
8351
|
+
const barWidth = Math.max(Math.min(step * 0.42, 26), 4);
|
|
8352
|
+
const x = (index) => padding.left + step * index + step / 2;
|
|
8353
|
+
const y = (value) => padding.top + plotHeight - value / max * plotHeight;
|
|
8354
|
+
const linePoints = data.map((d, i) => `${x(i)},${y(d.line)}`).join(" ");
|
|
8355
|
+
const areaPath = data.length > 0 ? `M ${x(0)} ${y(data[0].line)} ` + data.slice(1).map((d, i) => `L ${x(i + 1)} ${y(d.line)}`).join(" ") + ` L ${x(data.length - 1)} ${padding.top + plotHeight} L ${x(0)} ${padding.top + plotHeight} Z` : "";
|
|
8356
|
+
const active = hover !== null ? data[hover] : null;
|
|
8357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: `flex flex-col gap-3 ${className}`.trim(), children: [
|
|
8358
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
8359
|
+
"svg",
|
|
8360
|
+
{
|
|
8361
|
+
role: "img",
|
|
8362
|
+
"aria-label": ariaLabel,
|
|
8363
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
8364
|
+
style: { height, width: "100%" },
|
|
8365
|
+
onMouseLeave: () => setHover(null),
|
|
8366
|
+
children: [
|
|
8367
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("linearGradient", { id: `area-${gradientId}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
8368
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("stop", { offset: "0%", stopColor: lineColor, stopOpacity: "0.22" }),
|
|
8369
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("stop", { offset: "100%", stopColor: lineColor, stopOpacity: "0.02" })
|
|
8370
|
+
] }) }),
|
|
8371
|
+
gridValues.map((value, i) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("g", { children: [
|
|
8372
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
8373
|
+
"line",
|
|
8374
|
+
{
|
|
8375
|
+
x1: padding.left,
|
|
8376
|
+
x2: width - padding.right,
|
|
8377
|
+
y1: y(value),
|
|
8378
|
+
y2: y(value),
|
|
8379
|
+
stroke: "#e2e8f0",
|
|
8380
|
+
strokeWidth: 1,
|
|
8381
|
+
strokeDasharray: i === 0 ? void 0 : "3 4"
|
|
8382
|
+
}
|
|
8383
|
+
),
|
|
8384
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("text", { x: padding.left - 8, y: y(value) + 3, textAnchor: "end", fontSize: 10, fill: "#94a3b8", children: formatAxis(Math.round(value)) })
|
|
8385
|
+
] }, i)),
|
|
8386
|
+
data.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
8387
|
+
"rect",
|
|
8388
|
+
{
|
|
8389
|
+
x: x(i) - barWidth / 2,
|
|
8390
|
+
y: y(d.bar),
|
|
8391
|
+
width: barWidth,
|
|
8392
|
+
height: Math.max(padding.top + plotHeight - y(d.bar), 1),
|
|
8393
|
+
rx: 3,
|
|
8394
|
+
fill: barColor,
|
|
8395
|
+
opacity: hover === null || hover === i ? 0.85 : 0.35
|
|
8396
|
+
},
|
|
8397
|
+
`bar-${d.label}`
|
|
8398
|
+
)),
|
|
8399
|
+
areaPath && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("path", { d: areaPath, fill: `url(#area-${gradientId})` }),
|
|
8400
|
+
data.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
8401
|
+
"polyline",
|
|
8402
|
+
{
|
|
8403
|
+
points: linePoints,
|
|
8404
|
+
fill: "none",
|
|
8405
|
+
stroke: lineColor,
|
|
8406
|
+
strokeWidth: 2.5,
|
|
8407
|
+
strokeLinecap: "round",
|
|
8408
|
+
strokeLinejoin: "round"
|
|
8409
|
+
}
|
|
8410
|
+
),
|
|
8411
|
+
data.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
8412
|
+
"circle",
|
|
8413
|
+
{
|
|
8414
|
+
cx: x(i),
|
|
8415
|
+
cy: y(d.line),
|
|
8416
|
+
r: hover === i ? 4.5 : 3,
|
|
8417
|
+
fill: "#ffffff",
|
|
8418
|
+
stroke: lineColor,
|
|
8419
|
+
strokeWidth: 2
|
|
8420
|
+
},
|
|
8421
|
+
`dot-${d.label}`
|
|
8422
|
+
)),
|
|
8423
|
+
data.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("g", { onMouseEnter: () => setHover(i), children: [
|
|
8424
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("rect", { x: padding.left + step * i, y: padding.top, width: step, height: plotHeight, fill: "transparent" }),
|
|
8425
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("text", { x: x(i), y: height - 8, textAnchor: "middle", fontSize: 10, fill: "#64748b", children: d.label })
|
|
8426
|
+
] }, `hit-${d.label}`)),
|
|
8427
|
+
active && hover !== null && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("g", { transform: `translate(${Math.min(Math.max(x(hover) - 62, 4), width - 132)}, ${padding.top + 4})`, children: [
|
|
8428
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("rect", { width: 128, height: 46, rx: 6, fill: "#0f172a", opacity: 0.9 }),
|
|
8429
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("text", { x: 10, y: 18, fontSize: 10, fill: "#e2e8f0", children: active.label }),
|
|
8430
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("text", { x: 10, y: 32, fontSize: 10, fill: lineColor, children: [
|
|
8431
|
+
lineLabel,
|
|
8432
|
+
": ",
|
|
8433
|
+
formatValue(active.line)
|
|
8434
|
+
] }),
|
|
8435
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("text", { x: 10, y: 44, fontSize: 10, fill: "#93c5fd", children: [
|
|
8436
|
+
barLabel,
|
|
8437
|
+
": ",
|
|
8438
|
+
formatValue(active.bar)
|
|
8439
|
+
] })
|
|
8440
|
+
] })
|
|
8441
|
+
]
|
|
8442
|
+
}
|
|
8443
|
+
),
|
|
8444
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("ul", { className: "flex flex-wrap items-center gap-4 text-[11px]", style: { color: "#475569" }, children: [
|
|
8445
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("li", { children: [
|
|
8446
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "h-2.5 w-2.5 rounded-sm", style: { background: lineColor }, "aria-hidden": true }),
|
|
8447
|
+
lineLabel
|
|
8448
|
+
] }),
|
|
8449
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("li", { children: [
|
|
8450
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "h-2.5 w-2.5 rounded-sm", style: { background: barColor }, "aria-hidden": true }),
|
|
8451
|
+
barLabel
|
|
8452
|
+
] })
|
|
8453
|
+
] })
|
|
8454
|
+
] });
|
|
8455
|
+
}
|
|
8456
|
+
var line_bar_chart_default = ITLineBarChart;
|
|
8457
|
+
|
|
8298
8458
|
// src/components/molecules/table/table.tsx
|
|
8299
8459
|
var import_clsx44 = __toESM(require("clsx"), 1);
|
|
8300
|
-
var
|
|
8460
|
+
var import_react38 = __toESM(require("react"), 1);
|
|
8301
8461
|
var import_fa27 = require("react-icons/fa");
|
|
8302
8462
|
var import_md2 = require("react-icons/md");
|
|
8303
8463
|
var import_date_fns3 = require("date-fns");
|
|
8304
|
-
var
|
|
8464
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
8305
8465
|
function ITTable({
|
|
8306
8466
|
columns,
|
|
8307
8467
|
data = [],
|
|
@@ -8325,7 +8485,7 @@ function ITTable({
|
|
|
8325
8485
|
overscan = 5,
|
|
8326
8486
|
stickyHeader = false
|
|
8327
8487
|
}) {
|
|
8328
|
-
const [viewMode, setViewMode] = (0,
|
|
8488
|
+
const [viewMode, setViewMode] = (0, import_react38.useState)(defaultView);
|
|
8329
8489
|
const { ref: rootRef, width: containerWidth } = useElementSize();
|
|
8330
8490
|
const isFixed = layout === "fixed";
|
|
8331
8491
|
const forcedCards = autoCardBreakpoint > 0 && containerWidth > 0 && containerWidth < autoCardBreakpoint;
|
|
@@ -8342,7 +8502,7 @@ function ITTable({
|
|
|
8342
8502
|
handleSort,
|
|
8343
8503
|
handleItemsPerPageChange
|
|
8344
8504
|
} = useTableState({ defaultItemsPerPage });
|
|
8345
|
-
const sortedData =
|
|
8505
|
+
const sortedData = import_react38.default.useMemo(() => {
|
|
8346
8506
|
const safeData = Array.isArray(data) ? data : [];
|
|
8347
8507
|
if (!sortConfig) return safeData;
|
|
8348
8508
|
return [...safeData].sort((a, b) => {
|
|
@@ -8432,7 +8592,7 @@ function ITTable({
|
|
|
8432
8592
|
const isStickyHeader = stickyHeader && isTableVirtual;
|
|
8433
8593
|
const resolvedRowHeight = rowHeight ?? getRowHeight(size, density);
|
|
8434
8594
|
const columnCount = columns.length;
|
|
8435
|
-
const pinnedMeta =
|
|
8595
|
+
const pinnedMeta = import_react38.default.useMemo(() => getPinnedColumnMeta(columns), [columns]);
|
|
8436
8596
|
const {
|
|
8437
8597
|
scrollRef,
|
|
8438
8598
|
startIndex,
|
|
@@ -8457,14 +8617,14 @@ function ITTable({
|
|
|
8457
8617
|
if (currentValue === true) return "Filtrar solo verdaderos";
|
|
8458
8618
|
return "Filtrar solo falsos";
|
|
8459
8619
|
};
|
|
8460
|
-
return /* @__PURE__ */ (0,
|
|
8620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8461
8621
|
"button",
|
|
8462
8622
|
{
|
|
8463
8623
|
className: "flex items-center justify-center cursor-pointer focus:outline-none focus:ring-2 focus:ring-slate-400 focus:ring-offset-2 rounded-full p-1 transition-all duration-200",
|
|
8464
8624
|
onClick: () => handleFilterChange(col.key, nextValue),
|
|
8465
8625
|
"aria-label": `${getToggleLabel()} para ${col.label}`,
|
|
8466
8626
|
title: `${getToggleLabel()} para ${col.label}`,
|
|
8467
|
-
children: /* @__PURE__ */ (0,
|
|
8627
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "relative w-10 h-5 bg-secondary-300 rounded-full", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8468
8628
|
"div",
|
|
8469
8629
|
{
|
|
8470
8630
|
className: (0, import_clsx44.default)(
|
|
@@ -8482,7 +8642,7 @@ function ITTable({
|
|
|
8482
8642
|
}
|
|
8483
8643
|
if (col.filter === "catalog" && col.catalogOptions) {
|
|
8484
8644
|
if (col.catalogOptions.loading) {
|
|
8485
|
-
return /* @__PURE__ */ (0,
|
|
8645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8486
8646
|
import_fa27.FaSpinner,
|
|
8487
8647
|
{
|
|
8488
8648
|
className: "animate-spin",
|
|
@@ -8492,9 +8652,9 @@ function ITTable({
|
|
|
8492
8652
|
);
|
|
8493
8653
|
}
|
|
8494
8654
|
if (col.catalogOptions.error) {
|
|
8495
|
-
return /* @__PURE__ */ (0,
|
|
8655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ITText, { as: "span", className: "text-danger-500 text-xs", children: "Error cargando" });
|
|
8496
8656
|
}
|
|
8497
|
-
return /* @__PURE__ */ (0,
|
|
8657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8498
8658
|
ITSelect,
|
|
8499
8659
|
{
|
|
8500
8660
|
name: `filter-${col.key}`,
|
|
@@ -8518,7 +8678,7 @@ function ITTable({
|
|
|
8518
8678
|
}
|
|
8519
8679
|
if (col.filter === "search" && col.catalogOptions) {
|
|
8520
8680
|
if (col.catalogOptions.loading) {
|
|
8521
|
-
return /* @__PURE__ */ (0,
|
|
8681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8522
8682
|
import_fa27.FaSpinner,
|
|
8523
8683
|
{
|
|
8524
8684
|
className: "animate-spin",
|
|
@@ -8528,10 +8688,10 @@ function ITTable({
|
|
|
8528
8688
|
);
|
|
8529
8689
|
}
|
|
8530
8690
|
if (col.catalogOptions.error) {
|
|
8531
|
-
return /* @__PURE__ */ (0,
|
|
8691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ITText, { as: "span", className: "text-danger-500 text-xs", children: "Error cargando" });
|
|
8532
8692
|
}
|
|
8533
8693
|
const searchValue = filters[col.key];
|
|
8534
|
-
return /* @__PURE__ */ (0,
|
|
8694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8535
8695
|
ITSearchSelect,
|
|
8536
8696
|
{
|
|
8537
8697
|
name: `filter-${col.key}`,
|
|
@@ -8554,7 +8714,7 @@ function ITTable({
|
|
|
8554
8714
|
}
|
|
8555
8715
|
if (col.filter === "date") {
|
|
8556
8716
|
const dateValue = filters[col.key];
|
|
8557
|
-
return /* @__PURE__ */ (0,
|
|
8717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8558
8718
|
ITDatePicker,
|
|
8559
8719
|
{
|
|
8560
8720
|
name: `filter-${col.key}`,
|
|
@@ -8570,7 +8730,7 @@ function ITTable({
|
|
|
8570
8730
|
}
|
|
8571
8731
|
if (col.filter === "date-range") {
|
|
8572
8732
|
const rangeValue = filters[col.key];
|
|
8573
|
-
return /* @__PURE__ */ (0,
|
|
8733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8574
8734
|
ITDatePicker,
|
|
8575
8735
|
{
|
|
8576
8736
|
name: `filter-${col.key}`,
|
|
@@ -8585,7 +8745,7 @@ function ITTable({
|
|
|
8585
8745
|
}
|
|
8586
8746
|
);
|
|
8587
8747
|
}
|
|
8588
|
-
return /* @__PURE__ */ (0,
|
|
8748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8589
8749
|
ITInput,
|
|
8590
8750
|
{
|
|
8591
8751
|
name: `filter-${col.key}`,
|
|
@@ -8607,14 +8767,14 @@ function ITTable({
|
|
|
8607
8767
|
case "number":
|
|
8608
8768
|
return typeof value === "number" && col.currencyMX ? formatCurrencyMX(value) : value;
|
|
8609
8769
|
case "boolean":
|
|
8610
|
-
return value ? /* @__PURE__ */ (0,
|
|
8770
|
+
return value ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8611
8771
|
import_fa27.FaCheck,
|
|
8612
8772
|
{
|
|
8613
8773
|
className: "text-success-500",
|
|
8614
8774
|
"aria-label": "Verdadero",
|
|
8615
8775
|
title: "Verdadero"
|
|
8616
8776
|
}
|
|
8617
|
-
) : /* @__PURE__ */ (0,
|
|
8777
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8618
8778
|
import_fa27.FaTimes,
|
|
8619
8779
|
{
|
|
8620
8780
|
className: "text-danger-500",
|
|
@@ -8639,12 +8799,12 @@ function ITTable({
|
|
|
8639
8799
|
const renderDefaultCard = (row) => {
|
|
8640
8800
|
const dataCols = columns.filter((c) => c.type !== "actions");
|
|
8641
8801
|
const actionCol = columns.find((c) => c.type === "actions");
|
|
8642
|
-
return /* @__PURE__ */ (0,
|
|
8643
|
-
dataCols.map((col) => /* @__PURE__ */ (0,
|
|
8644
|
-
/* @__PURE__ */ (0,
|
|
8645
|
-
/* @__PURE__ */ (0,
|
|
8802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "bg-white dark:bg-slate-800 rounded-lg border border-slate-200 dark:border-slate-700 p-3 space-y-2 shadow-sm", children: [
|
|
8803
|
+
dataCols.map((col) => /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
8804
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "text-[10px] font-bold uppercase tracking-wider text-slate-400 whitespace-nowrap flex-shrink-0 min-w-[70px]", children: col.label }),
|
|
8805
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "text-sm font-medium text-slate-800 dark:text-white text-right truncate", children: renderCellContent(col, row) })
|
|
8646
8806
|
] }, col.key)),
|
|
8647
|
-
actionCol?.actions && /* @__PURE__ */ (0,
|
|
8807
|
+
actionCol?.actions && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex items-center justify-end gap-2 pt-2 border-t border-slate-100 dark:border-slate-700", children: actionCol.actions(row) })
|
|
8648
8808
|
] });
|
|
8649
8809
|
};
|
|
8650
8810
|
const handleRowClick = (row) => (event) => {
|
|
@@ -8658,61 +8818,61 @@ function ITTable({
|
|
|
8658
8818
|
event.preventDefault();
|
|
8659
8819
|
onRowClick(row, event);
|
|
8660
8820
|
};
|
|
8661
|
-
return /* @__PURE__ */ (0,
|
|
8662
|
-
title && /* @__PURE__ */ (0,
|
|
8663
|
-
/* @__PURE__ */ (0,
|
|
8664
|
-
/* @__PURE__ */ (0,
|
|
8665
|
-
/* @__PURE__ */ (0,
|
|
8821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { ref: rootRef, className: (0, import_clsx44.default)("space-y-4 w-full", containerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: tableContainer, style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
|
|
8822
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "px-6 py-5 flex items-center justify-between", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
|
|
8823
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ITText, { as: "h2", className: "text-xl font-bold text-secondary-900 leading-tight", children: title }),
|
|
8824
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center bg-slate-100 dark:bg-slate-800/80 rounded-lg p-0.5 border border-slate-200 dark:border-slate-700/50", children: [
|
|
8825
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
8666
8826
|
"button",
|
|
8667
8827
|
{
|
|
8668
8828
|
onClick: () => setViewMode("table"),
|
|
8669
8829
|
disabled: forcedCards,
|
|
8670
8830
|
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${effectiveView === "table" ? "bg-white dark:bg-slate-900 text-slate-900 dark:text-white shadow-sm border border-slate-200/50 dark:border-slate-700" : "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"}`,
|
|
8671
8831
|
children: [
|
|
8672
|
-
/* @__PURE__ */ (0,
|
|
8832
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_fa27.FaTable, { size: 11 }),
|
|
8673
8833
|
"Table"
|
|
8674
8834
|
]
|
|
8675
8835
|
}
|
|
8676
8836
|
),
|
|
8677
|
-
/* @__PURE__ */ (0,
|
|
8837
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
8678
8838
|
"button",
|
|
8679
8839
|
{
|
|
8680
8840
|
onClick: () => setViewMode("cards"),
|
|
8681
8841
|
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${effectiveView === "cards" ? "bg-white dark:bg-slate-900 text-slate-900 dark:text-white shadow-sm border border-slate-200/50 dark:border-slate-700" : "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"}`,
|
|
8682
8842
|
children: [
|
|
8683
|
-
/* @__PURE__ */ (0,
|
|
8843
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_fa27.FaThLarge, { size: 11 }),
|
|
8684
8844
|
"Cards"
|
|
8685
8845
|
]
|
|
8686
8846
|
}
|
|
8687
8847
|
)
|
|
8688
8848
|
] })
|
|
8689
8849
|
] }),
|
|
8690
|
-
!title && /* @__PURE__ */ (0,
|
|
8691
|
-
/* @__PURE__ */ (0,
|
|
8850
|
+
!title && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex justify-end px-4 pt-3", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center bg-slate-100 dark:bg-slate-800/80 rounded-lg p-0.5 border border-slate-200 dark:border-slate-700/50", children: [
|
|
8851
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
8692
8852
|
"button",
|
|
8693
8853
|
{
|
|
8694
8854
|
onClick: () => setViewMode("table"),
|
|
8695
8855
|
disabled: forcedCards,
|
|
8696
8856
|
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${effectiveView === "table" ? "bg-white dark:bg-slate-900 text-slate-900 dark:text-white shadow-sm border border-slate-200/50 dark:border-slate-700" : "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"}`,
|
|
8697
8857
|
children: [
|
|
8698
|
-
/* @__PURE__ */ (0,
|
|
8858
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_fa27.FaTable, { size: 11 }),
|
|
8699
8859
|
"Table"
|
|
8700
8860
|
]
|
|
8701
8861
|
}
|
|
8702
8862
|
),
|
|
8703
|
-
/* @__PURE__ */ (0,
|
|
8863
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
8704
8864
|
"button",
|
|
8705
8865
|
{
|
|
8706
8866
|
onClick: () => setViewMode("cards"),
|
|
8707
8867
|
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${effectiveView === "cards" ? "bg-white dark:bg-slate-900 text-slate-900 dark:text-white shadow-sm border border-slate-200/50 dark:border-slate-700" : "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"}`,
|
|
8708
8868
|
children: [
|
|
8709
|
-
/* @__PURE__ */ (0,
|
|
8869
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_fa27.FaThLarge, { size: 11 }),
|
|
8710
8870
|
"Cards"
|
|
8711
8871
|
]
|
|
8712
8872
|
}
|
|
8713
8873
|
)
|
|
8714
8874
|
] }) }),
|
|
8715
|
-
effectiveView === "cards" ? /* @__PURE__ */ (0,
|
|
8875
|
+
effectiveView === "cards" ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "p-4 space-y-3 max-h-[400px] overflow-y-auto", children: currentData.length > 0 ? currentData.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8716
8876
|
"div",
|
|
8717
8877
|
{
|
|
8718
8878
|
className: (0, import_clsx44.default)(tableCardHover, onRowClick && tableCardClickable),
|
|
@@ -8723,16 +8883,16 @@ function ITTable({
|
|
|
8723
8883
|
children: renderCard ? renderCard(row) : renderDefaultCard(row)
|
|
8724
8884
|
},
|
|
8725
8885
|
i
|
|
8726
|
-
)) : /* @__PURE__ */ (0,
|
|
8727
|
-
/* @__PURE__ */ (0,
|
|
8728
|
-
/* @__PURE__ */ (0,
|
|
8729
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
8886
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: (0, import_clsx44.default)(tableEmptyContent, "py-12"), children: [
|
|
8887
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
|
|
8888
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
|
|
8889
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8730
8890
|
"div",
|
|
8731
8891
|
{
|
|
8732
8892
|
ref: isTableVirtual ? scrollRef : void 0,
|
|
8733
8893
|
className: isTableVirtual ? "overflow-x-auto overflow-y-auto" : "overflow-x-auto",
|
|
8734
8894
|
style: isTableVirtual ? { maxHeight: virtualizedMaxHeight } : void 0,
|
|
8735
|
-
children: /* @__PURE__ */ (0,
|
|
8895
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
8736
8896
|
"table",
|
|
8737
8897
|
{
|
|
8738
8898
|
className: (0, import_clsx44.default)(
|
|
@@ -8745,14 +8905,14 @@ function ITTable({
|
|
|
8745
8905
|
style: isFixed ? { tableLayout: "fixed" } : void 0,
|
|
8746
8906
|
"aria-rowcount": isTableVirtual ? currentData.length + 1 : void 0,
|
|
8747
8907
|
children: [
|
|
8748
|
-
hasColumnWidths && /* @__PURE__ */ (0,
|
|
8908
|
+
hasColumnWidths && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("colgroup", { children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8749
8909
|
"col",
|
|
8750
8910
|
{
|
|
8751
8911
|
style: col.width != null ? { width: typeof col.width === "number" ? `${col.width}px` : col.width } : void 0
|
|
8752
8912
|
},
|
|
8753
8913
|
col.key
|
|
8754
8914
|
)) }),
|
|
8755
|
-
/* @__PURE__ */ (0,
|
|
8915
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8756
8916
|
"tr",
|
|
8757
8917
|
{
|
|
8758
8918
|
className: (0, import_clsx44.default)(tableHeaderRow, "dark:text-slate-200"),
|
|
@@ -8760,7 +8920,7 @@ function ITTable({
|
|
|
8760
8920
|
children: columns.map((col) => {
|
|
8761
8921
|
const pin = pinnedMeta[col.key];
|
|
8762
8922
|
const isPinned = pin != null;
|
|
8763
|
-
return /* @__PURE__ */ (0,
|
|
8923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8764
8924
|
"th",
|
|
8765
8925
|
{
|
|
8766
8926
|
scope: "col",
|
|
@@ -8777,20 +8937,20 @@ function ITTable({
|
|
|
8777
8937
|
...isStickyHeader || isPinned ? { backgroundColor: "var(--color-table-headerBg, #f8fafc)" } : {},
|
|
8778
8938
|
...isPinned ? pin.side === "left" ? { left: pin.offset } : { right: pin.offset } : {}
|
|
8779
8939
|
} : void 0,
|
|
8780
|
-
children: /* @__PURE__ */ (0,
|
|
8781
|
-
/* @__PURE__ */ (0,
|
|
8782
|
-
/* @__PURE__ */ (0,
|
|
8783
|
-
col.sortable && col.type !== "actions" && /* @__PURE__ */ (0,
|
|
8940
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: isFixed ? "flex flex-col gap-3" : "flex flex-col gap-3 min-w-[150px]", children: [
|
|
8941
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
8942
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ITText, { as: "span", className: "text-slate-900 dark:text-white font-bold", children: col.label }),
|
|
8943
|
+
col.sortable && col.type !== "actions" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8784
8944
|
"button",
|
|
8785
8945
|
{
|
|
8786
8946
|
onClick: () => handleSort(col.key),
|
|
8787
8947
|
className: `p-1 rounded-md transition-colors ${sortConfig?.key === col.key ? "bg-secondary-200 text-secondary-900" : "hover:bg-secondary-200 text-secondary-400 hover:text-secondary-700"}`,
|
|
8788
8948
|
title: `Ordenar por ${col.label}`,
|
|
8789
|
-
children: /* @__PURE__ */ (0,
|
|
8949
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_md2.MdOutlineSwapVert, { className: "w-4 h-4", "aria-hidden": "true" })
|
|
8790
8950
|
}
|
|
8791
8951
|
)
|
|
8792
8952
|
] }),
|
|
8793
|
-
/* @__PURE__ */ (0,
|
|
8953
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "w-full", children: col.filter ? renderFilterInput(col) : null })
|
|
8794
8954
|
] })
|
|
8795
8955
|
},
|
|
8796
8956
|
col.key
|
|
@@ -8798,11 +8958,11 @@ function ITTable({
|
|
|
8798
8958
|
})
|
|
8799
8959
|
}
|
|
8800
8960
|
) }),
|
|
8801
|
-
/* @__PURE__ */ (0,
|
|
8802
|
-
isTableVirtual && topSpacerHeight > 0 && /* @__PURE__ */ (0,
|
|
8961
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("tbody", { className: (0, import_clsx44.default)(tableBody, "dark:divide-slate-700/30"), children: currentData.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
|
|
8962
|
+
isTableVirtual && topSpacerHeight > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("tr", { "aria-hidden": "true", style: { height: topSpacerHeight }, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("td", { colSpan: columnCount, style: { padding: 0, border: 0 } }) }),
|
|
8803
8963
|
windowData.map((row, windowIndex) => {
|
|
8804
8964
|
const absoluteIndex = isTableVirtual ? startIndex + windowIndex : windowIndex;
|
|
8805
|
-
return /* @__PURE__ */ (0,
|
|
8965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8806
8966
|
"tr",
|
|
8807
8967
|
{
|
|
8808
8968
|
"aria-rowindex": isTableVirtual ? absoluteIndex + 2 : void 0,
|
|
@@ -8819,7 +8979,7 @@ function ITTable({
|
|
|
8819
8979
|
const truncateTitle = col.truncate && (typeof rawValue === "string" || typeof rawValue === "number") ? String(rawValue) : void 0;
|
|
8820
8980
|
const pin = pinnedMeta[col.key];
|
|
8821
8981
|
const isPinned = pin != null;
|
|
8822
|
-
return /* @__PURE__ */ (0,
|
|
8982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8823
8983
|
"td",
|
|
8824
8984
|
{
|
|
8825
8985
|
className: (0, import_clsx44.default)(
|
|
@@ -8834,7 +8994,7 @@ function ITTable({
|
|
|
8834
8994
|
...isPinned ? pin.side === "left" ? { left: pin.offset } : { right: pin.offset } : {}
|
|
8835
8995
|
} : void 0,
|
|
8836
8996
|
title: truncateTitle,
|
|
8837
|
-
children: col.type === "actions" ? /* @__PURE__ */ (0,
|
|
8997
|
+
children: col.type === "actions" ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: tableActionsCell, children: renderCellContent(col, row) }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: (0, import_clsx44.default)(tableCellText, col.truncate && "truncate"), children: renderCellContent(col, row) })
|
|
8838
8998
|
},
|
|
8839
8999
|
`${absoluteIndex}-${col.key}`
|
|
8840
9000
|
);
|
|
@@ -8843,17 +9003,17 @@ function ITTable({
|
|
|
8843
9003
|
absoluteIndex
|
|
8844
9004
|
);
|
|
8845
9005
|
}),
|
|
8846
|
-
isTableVirtual && bottomSpacerHeight > 0 && /* @__PURE__ */ (0,
|
|
8847
|
-
] }) : /* @__PURE__ */ (0,
|
|
8848
|
-
/* @__PURE__ */ (0,
|
|
8849
|
-
/* @__PURE__ */ (0,
|
|
9006
|
+
isTableVirtual && bottomSpacerHeight > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("tr", { "aria-hidden": "true", style: { height: bottomSpacerHeight }, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("td", { colSpan: columnCount, style: { padding: 0, border: 0 } }) })
|
|
9007
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("td", { colSpan: columns.length, className: "px-6 py-12 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: tableEmptyContent, children: [
|
|
9008
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
|
|
9009
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
|
|
8850
9010
|
] }) }) }) })
|
|
8851
9011
|
]
|
|
8852
9012
|
}
|
|
8853
9013
|
)
|
|
8854
9014
|
}
|
|
8855
9015
|
),
|
|
8856
|
-
/* @__PURE__ */ (0,
|
|
9016
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "rounded-b-xl px-6 py-4", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8857
9017
|
ITPagination,
|
|
8858
9018
|
{
|
|
8859
9019
|
currentPage,
|
|
@@ -8871,7 +9031,7 @@ function ITTable({
|
|
|
8871
9031
|
|
|
8872
9032
|
// src/components/atoms/textarea/textarea.tsx
|
|
8873
9033
|
var import_clsx45 = __toESM(require("clsx"), 1);
|
|
8874
|
-
var
|
|
9034
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
8875
9035
|
var resizeMap = {
|
|
8876
9036
|
none: "resize-none",
|
|
8877
9037
|
vertical: "resize-y",
|
|
@@ -8891,9 +9051,9 @@ function ITTextarea({
|
|
|
8891
9051
|
maxLength,
|
|
8892
9052
|
resize = "vertical"
|
|
8893
9053
|
}) {
|
|
8894
|
-
return /* @__PURE__ */ (0,
|
|
8895
|
-
label && /* @__PURE__ */ (0,
|
|
8896
|
-
/* @__PURE__ */ (0,
|
|
9054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: (0, import_clsx45.default)("flex flex-col gap-1.5", className), children: [
|
|
9055
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ITText, { as: "label", className: inputLabel(!!error), htmlFor: name, children: label }),
|
|
9056
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
8897
9057
|
"textarea",
|
|
8898
9058
|
{
|
|
8899
9059
|
id: name,
|
|
@@ -8913,14 +9073,14 @@ function ITTextarea({
|
|
|
8913
9073
|
)
|
|
8914
9074
|
}
|
|
8915
9075
|
),
|
|
8916
|
-
error && /* @__PURE__ */ (0,
|
|
9076
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ITText, { as: "span", className: inputError, children: error })
|
|
8917
9077
|
] });
|
|
8918
9078
|
}
|
|
8919
9079
|
|
|
8920
9080
|
// src/components/molecules/tabs/tabs.tsx
|
|
8921
|
-
var
|
|
9081
|
+
var import_react39 = require("react");
|
|
8922
9082
|
var import_clsx46 = require("clsx");
|
|
8923
|
-
var
|
|
9083
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
8924
9084
|
var ITTabs = ({
|
|
8925
9085
|
items,
|
|
8926
9086
|
defaultActiveId,
|
|
@@ -8929,21 +9089,21 @@ var ITTabs = ({
|
|
|
8929
9089
|
className = "",
|
|
8930
9090
|
containerClassName = ""
|
|
8931
9091
|
}) => {
|
|
8932
|
-
const [activeId, setActiveId] = (0,
|
|
9092
|
+
const [activeId, setActiveId] = (0, import_react39.useState)(defaultActiveId || items[0]?.id);
|
|
8933
9093
|
const handleTabClick = (id, disabled) => {
|
|
8934
9094
|
if (disabled) return;
|
|
8935
9095
|
setActiveId(id);
|
|
8936
9096
|
if (onChange) onChange(id);
|
|
8937
9097
|
};
|
|
8938
9098
|
const activeContent = items.find((item) => item.id === activeId)?.content;
|
|
8939
|
-
return /* @__PURE__ */ (0,
|
|
8940
|
-
/* @__PURE__ */ (0,
|
|
9099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: (0, import_clsx46.clsx)("w-full", containerClassName), children: [
|
|
9100
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: (0, import_clsx46.clsx)(
|
|
8941
9101
|
"flex border-secondary-200 mb-4",
|
|
8942
9102
|
variant === "line" ? "border-b" : "gap-2 p-1 bg-secondary-100 rounded-lg w-fit",
|
|
8943
9103
|
className
|
|
8944
9104
|
), children: items.map((item) => {
|
|
8945
9105
|
const isActive = item.id === activeId;
|
|
8946
|
-
return /* @__PURE__ */ (0,
|
|
9106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
8947
9107
|
"button",
|
|
8948
9108
|
{
|
|
8949
9109
|
onClick: () => handleTabClick(item.id, item.disabled),
|
|
@@ -8963,21 +9123,21 @@ var ITTabs = ({
|
|
|
8963
9123
|
item.disabled && "opacity-50 cursor-not-allowed"
|
|
8964
9124
|
),
|
|
8965
9125
|
children: [
|
|
8966
|
-
item.icon && /* @__PURE__ */ (0,
|
|
8967
|
-
/* @__PURE__ */ (0,
|
|
9126
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "w-4 h-4", children: item.icon }),
|
|
9127
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ITText, { as: "span", children: item.label })
|
|
8968
9128
|
]
|
|
8969
9129
|
},
|
|
8970
9130
|
item.id
|
|
8971
9131
|
);
|
|
8972
9132
|
}) }),
|
|
8973
|
-
/* @__PURE__ */ (0,
|
|
9133
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "tab-content animate-fadeIn", children: activeContent })
|
|
8974
9134
|
] });
|
|
8975
9135
|
};
|
|
8976
9136
|
var tabs_default = ITTabs;
|
|
8977
9137
|
|
|
8978
9138
|
// src/components/organisms/triple-filter/tripleFilter.tsx
|
|
8979
9139
|
var import_clsx47 = __toESM(require("clsx"), 1);
|
|
8980
|
-
var
|
|
9140
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
8981
9141
|
var colorMap2 = {
|
|
8982
9142
|
primary: "text-primary-600",
|
|
8983
9143
|
secondary: "text-secondary-600",
|
|
@@ -8996,11 +9156,11 @@ var ITTripleFilter = ({
|
|
|
8996
9156
|
color = "primary",
|
|
8997
9157
|
className
|
|
8998
9158
|
}) => {
|
|
8999
|
-
return /* @__PURE__ */ (0,
|
|
9159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
9000
9160
|
"div",
|
|
9001
9161
|
{
|
|
9002
9162
|
className: (0, import_clsx47.default)("flex bg-slate-100 p-1 rounded-xl gap-1 w-fit", className),
|
|
9003
|
-
children: options.map((option) => /* @__PURE__ */ (0,
|
|
9163
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
9004
9164
|
"button",
|
|
9005
9165
|
{
|
|
9006
9166
|
onClick: () => onChange(option.value),
|
|
@@ -9008,7 +9168,7 @@ var ITTripleFilter = ({
|
|
|
9008
9168
|
"px-4 py-1.5 rounded-lg text-[10px] font-bold uppercase tracking-wider transition-all duration-200 whitespace-nowrap",
|
|
9009
9169
|
value === option.value ? (0, import_clsx47.default)("bg-white shadow-sm", colorMap2[color]) : "text-slate-400 hover:text-slate-600"
|
|
9010
9170
|
),
|
|
9011
|
-
children: /* @__PURE__ */ (0,
|
|
9171
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(ITText, { as: "span", children: option.label })
|
|
9012
9172
|
},
|
|
9013
9173
|
String(option.value)
|
|
9014
9174
|
))
|
|
@@ -9029,9 +9189,9 @@ var positionStyles = {
|
|
|
9029
9189
|
|
|
9030
9190
|
// src/components/organisms/toast/toast.tsx
|
|
9031
9191
|
var import_clsx48 = __toESM(require("clsx"), 1);
|
|
9032
|
-
var
|
|
9192
|
+
var import_react40 = require("react");
|
|
9033
9193
|
var import_fa28 = require("react-icons/fa");
|
|
9034
|
-
var
|
|
9194
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
9035
9195
|
function ITToast({
|
|
9036
9196
|
message,
|
|
9037
9197
|
type = "info",
|
|
@@ -9039,8 +9199,8 @@ function ITToast({
|
|
|
9039
9199
|
position = "top-right",
|
|
9040
9200
|
onClose
|
|
9041
9201
|
}) {
|
|
9042
|
-
const [isVisible, setIsVisible] = (0,
|
|
9043
|
-
(0,
|
|
9202
|
+
const [isVisible, setIsVisible] = (0, import_react40.useState)(true);
|
|
9203
|
+
(0, import_react40.useEffect)(() => {
|
|
9044
9204
|
const timer = setTimeout(() => {
|
|
9045
9205
|
setIsVisible(false);
|
|
9046
9206
|
setTimeout(() => {
|
|
@@ -9060,18 +9220,18 @@ function ITToast({
|
|
|
9060
9220
|
const TypeIcon = () => {
|
|
9061
9221
|
switch (type) {
|
|
9062
9222
|
case "success":
|
|
9063
|
-
return /* @__PURE__ */ (0,
|
|
9223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_fa28.FaCheckCircle, { className: "w-5 h-5 flex-shrink-0" });
|
|
9064
9224
|
case "error":
|
|
9065
9225
|
case "danger":
|
|
9066
|
-
return /* @__PURE__ */ (0,
|
|
9226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_fa28.FaTimesCircle, { className: "w-5 h-5 flex-shrink-0" });
|
|
9067
9227
|
case "warning":
|
|
9068
|
-
return /* @__PURE__ */ (0,
|
|
9228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_fa28.FaExclamationTriangle, { className: "w-5 h-5 flex-shrink-0" });
|
|
9069
9229
|
case "info":
|
|
9070
9230
|
default:
|
|
9071
|
-
return /* @__PURE__ */ (0,
|
|
9231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_fa28.FaInfoCircle, { className: "w-5 h-5 flex-shrink-0" });
|
|
9072
9232
|
}
|
|
9073
9233
|
};
|
|
9074
|
-
return /* @__PURE__ */ (0,
|
|
9234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
9075
9235
|
"div",
|
|
9076
9236
|
{
|
|
9077
9237
|
className: (0, import_clsx48.default)(
|
|
@@ -9087,17 +9247,17 @@ function ITToast({
|
|
|
9087
9247
|
style: { backgroundColor },
|
|
9088
9248
|
role: "alert",
|
|
9089
9249
|
children: [
|
|
9090
|
-
/* @__PURE__ */ (0,
|
|
9091
|
-
/* @__PURE__ */ (0,
|
|
9092
|
-
/* @__PURE__ */ (0,
|
|
9250
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
9251
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TypeIcon, {}),
|
|
9252
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ITText, { as: "span", className: "font-medium text-sm sm:text-base leading-snug", children: message })
|
|
9093
9253
|
] }),
|
|
9094
|
-
/* @__PURE__ */ (0,
|
|
9254
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
9095
9255
|
"button",
|
|
9096
9256
|
{
|
|
9097
9257
|
onClick: handleClose,
|
|
9098
9258
|
className: "p-1.5 rounded-full hover:bg-black/15 transition-colors focus:outline-none focus:ring-2 focus:ring-white/50",
|
|
9099
9259
|
"aria-label": "Close notification",
|
|
9100
|
-
children: /* @__PURE__ */ (0,
|
|
9260
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_fa28.FaTimes, { className: "w-4 h-4" })
|
|
9101
9261
|
}
|
|
9102
9262
|
)
|
|
9103
9263
|
]
|
|
@@ -9106,7 +9266,7 @@ function ITToast({
|
|
|
9106
9266
|
}
|
|
9107
9267
|
|
|
9108
9268
|
// src/components/molecules/wysiwyg/wysiwyg.tsx
|
|
9109
|
-
var
|
|
9269
|
+
var import_react42 = require("react");
|
|
9110
9270
|
var import_clsx50 = __toESM(require("clsx"), 1);
|
|
9111
9271
|
var import_fa29 = require("react-icons/fa");
|
|
9112
9272
|
|
|
@@ -9122,9 +9282,9 @@ var toolbarActions = [
|
|
|
9122
9282
|
];
|
|
9123
9283
|
|
|
9124
9284
|
// src/components/atoms/tooltip/tooltip.tsx
|
|
9125
|
-
var
|
|
9285
|
+
var import_react41 = require("react");
|
|
9126
9286
|
var import_clsx49 = __toESM(require("clsx"), 1);
|
|
9127
|
-
var
|
|
9287
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
9128
9288
|
var positionClasses2 = {
|
|
9129
9289
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
9130
9290
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
@@ -9144,7 +9304,7 @@ function ITTooltip({
|
|
|
9144
9304
|
delay = 200,
|
|
9145
9305
|
className
|
|
9146
9306
|
}) {
|
|
9147
|
-
const [visible, setVisible] = (0,
|
|
9307
|
+
const [visible, setVisible] = (0, import_react41.useState)(false);
|
|
9148
9308
|
let timeout;
|
|
9149
9309
|
const handleMouseEnter = () => {
|
|
9150
9310
|
timeout = setTimeout(() => setVisible(true), delay);
|
|
@@ -9153,7 +9313,7 @@ function ITTooltip({
|
|
|
9153
9313
|
clearTimeout(timeout);
|
|
9154
9314
|
setVisible(false);
|
|
9155
9315
|
};
|
|
9156
|
-
return /* @__PURE__ */ (0,
|
|
9316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
9157
9317
|
"div",
|
|
9158
9318
|
{
|
|
9159
9319
|
className: (0, import_clsx49.default)("relative inline-flex", className),
|
|
@@ -9161,9 +9321,9 @@ function ITTooltip({
|
|
|
9161
9321
|
onMouseLeave: handleMouseLeave,
|
|
9162
9322
|
children: [
|
|
9163
9323
|
children,
|
|
9164
|
-
visible && /* @__PURE__ */ (0,
|
|
9165
|
-
/* @__PURE__ */ (0,
|
|
9166
|
-
/* @__PURE__ */ (0,
|
|
9324
|
+
visible && /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: (0, import_clsx49.default)("absolute z-[70] pointer-events-none", positionClasses2[position]), children: [
|
|
9325
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "bg-slate-800 dark:bg-slate-700 text-white text-xs rounded-lg px-2.5 py-1.5 whitespace-nowrap shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(ITText, { as: "span", children: content }) }),
|
|
9326
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: (0, import_clsx49.default)("absolute", arrowClasses[position]) })
|
|
9167
9327
|
] })
|
|
9168
9328
|
]
|
|
9169
9329
|
}
|
|
@@ -9171,16 +9331,16 @@ function ITTooltip({
|
|
|
9171
9331
|
}
|
|
9172
9332
|
|
|
9173
9333
|
// src/components/molecules/wysiwyg/wysiwyg.tsx
|
|
9174
|
-
var
|
|
9334
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
9175
9335
|
var INLINE_TAGS = /* @__PURE__ */ new Set(["STRONG", "B", "EM", "I", "U", "MARK"]);
|
|
9176
9336
|
var ACTION_META = {
|
|
9177
|
-
bold: { label: "Negrita", icon: /* @__PURE__ */ (0,
|
|
9178
|
-
italic: { label: "It\xE1lica", icon: /* @__PURE__ */ (0,
|
|
9179
|
-
underline: { label: "Subrayado", icon: /* @__PURE__ */ (0,
|
|
9180
|
-
highlight: { label: "Marcador", icon: /* @__PURE__ */ (0,
|
|
9181
|
-
ul: { label: "Lista con vi\xF1etas", icon: /* @__PURE__ */ (0,
|
|
9182
|
-
ol: { label: "Lista numerada", icon: /* @__PURE__ */ (0,
|
|
9183
|
-
clear: { label: "Limpiar formato", icon: /* @__PURE__ */ (0,
|
|
9337
|
+
bold: { label: "Negrita", icon: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_fa29.FaBold, {}) },
|
|
9338
|
+
italic: { label: "It\xE1lica", icon: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_fa29.FaItalic, {}) },
|
|
9339
|
+
underline: { label: "Subrayado", icon: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_fa29.FaUnderline, {}) },
|
|
9340
|
+
highlight: { label: "Marcador", icon: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_fa29.FaHighlighter, {}) },
|
|
9341
|
+
ul: { label: "Lista con vi\xF1etas", icon: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_fa29.FaListUl, {}) },
|
|
9342
|
+
ol: { label: "Lista numerada", icon: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_fa29.FaListOl, {}) },
|
|
9343
|
+
clear: { label: "Limpiar formato", icon: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_fa29.FaEraser, {}) }
|
|
9184
9344
|
};
|
|
9185
9345
|
function ITWysiwyg({
|
|
9186
9346
|
value,
|
|
@@ -9197,12 +9357,12 @@ function ITWysiwyg({
|
|
|
9197
9357
|
toolbar = toolbarActions,
|
|
9198
9358
|
className
|
|
9199
9359
|
}) {
|
|
9200
|
-
const editorRef = (0,
|
|
9201
|
-
const focusedRef = (0,
|
|
9202
|
-
const [active, setActive] = (0,
|
|
9360
|
+
const editorRef = (0, import_react42.useRef)(null);
|
|
9361
|
+
const focusedRef = (0, import_react42.useRef)(false);
|
|
9362
|
+
const [active, setActive] = (0, import_react42.useState)({});
|
|
9203
9363
|
const isLocked = disabled || readOnly;
|
|
9204
9364
|
const sizeConfig = inputSizeTokens[size] ?? inputSizeTokens.md;
|
|
9205
|
-
const findAncestor = (0,
|
|
9365
|
+
const findAncestor = (0, import_react42.useCallback)(
|
|
9206
9366
|
(node, predicate) => {
|
|
9207
9367
|
const editor = editorRef.current;
|
|
9208
9368
|
if (!editor) return null;
|
|
@@ -9215,7 +9375,7 @@ function ITWysiwyg({
|
|
|
9215
9375
|
},
|
|
9216
9376
|
[]
|
|
9217
9377
|
);
|
|
9218
|
-
const isInlineTag = (0,
|
|
9378
|
+
const isInlineTag = (0, import_react42.useCallback)((el, tag) => {
|
|
9219
9379
|
if (tag === "STRONG" || tag === "B") {
|
|
9220
9380
|
return el.tagName === "STRONG" || el.tagName === "B";
|
|
9221
9381
|
}
|
|
@@ -9224,7 +9384,7 @@ function ITWysiwyg({
|
|
|
9224
9384
|
}
|
|
9225
9385
|
return el.tagName === tag;
|
|
9226
9386
|
}, []);
|
|
9227
|
-
const getTextNodesInRange = (0,
|
|
9387
|
+
const getTextNodesInRange = (0, import_react42.useCallback)((range) => {
|
|
9228
9388
|
const editor = editorRef.current;
|
|
9229
9389
|
if (!editor) return [];
|
|
9230
9390
|
const out = [];
|
|
@@ -9235,7 +9395,7 @@ function ITWysiwyg({
|
|
|
9235
9395
|
}
|
|
9236
9396
|
return out;
|
|
9237
9397
|
}, []);
|
|
9238
|
-
const placeCaretAtEnd = (0,
|
|
9398
|
+
const placeCaretAtEnd = (0, import_react42.useCallback)((target) => {
|
|
9239
9399
|
const editor = editorRef.current;
|
|
9240
9400
|
const sel = window.getSelection();
|
|
9241
9401
|
if (!editor || !sel) return;
|
|
@@ -9246,11 +9406,11 @@ function ITWysiwyg({
|
|
|
9246
9406
|
sel.addRange(range);
|
|
9247
9407
|
if (document.activeElement !== editor) editor.focus();
|
|
9248
9408
|
}, []);
|
|
9249
|
-
const emitChange = (0,
|
|
9409
|
+
const emitChange = (0, import_react42.useCallback)(() => {
|
|
9250
9410
|
const editor = editorRef.current;
|
|
9251
9411
|
if (editor) onChange?.(editor.innerHTML);
|
|
9252
9412
|
}, [onChange]);
|
|
9253
|
-
const updateActive = (0,
|
|
9413
|
+
const updateActive = (0, import_react42.useCallback)(() => {
|
|
9254
9414
|
const editor = editorRef.current;
|
|
9255
9415
|
const sel = window.getSelection();
|
|
9256
9416
|
const node = sel?.anchorNode ?? null;
|
|
@@ -9269,13 +9429,13 @@ function ITWysiwyg({
|
|
|
9269
9429
|
(prev) => JSON.stringify(prev) === JSON.stringify(next) ? prev : next
|
|
9270
9430
|
);
|
|
9271
9431
|
}, [findAncestor, isInlineTag]);
|
|
9272
|
-
const unwrapElement = (0,
|
|
9432
|
+
const unwrapElement = (0, import_react42.useCallback)((el) => {
|
|
9273
9433
|
const parent = el.parentNode;
|
|
9274
9434
|
if (!parent) return;
|
|
9275
9435
|
while (el.firstChild) parent.insertBefore(el.firstChild, el);
|
|
9276
9436
|
el.remove();
|
|
9277
9437
|
}, []);
|
|
9278
|
-
const applyInline = (0,
|
|
9438
|
+
const applyInline = (0, import_react42.useCallback)(
|
|
9279
9439
|
(tag, prepare) => {
|
|
9280
9440
|
const editor = editorRef.current;
|
|
9281
9441
|
const sel = window.getSelection();
|
|
@@ -9357,7 +9517,7 @@ function ITWysiwyg({
|
|
|
9357
9517
|
updateActive
|
|
9358
9518
|
]
|
|
9359
9519
|
);
|
|
9360
|
-
const normalizeBlocks = (0,
|
|
9520
|
+
const normalizeBlocks = (0, import_react42.useCallback)(() => {
|
|
9361
9521
|
const editor = editorRef.current;
|
|
9362
9522
|
if (!editor) return;
|
|
9363
9523
|
const children = Array.from(editor.childNodes);
|
|
@@ -9379,7 +9539,7 @@ function ITWysiwyg({
|
|
|
9379
9539
|
}
|
|
9380
9540
|
flush();
|
|
9381
9541
|
}, []);
|
|
9382
|
-
const convertLiToDiv = (0,
|
|
9542
|
+
const convertLiToDiv = (0, import_react42.useCallback)((li) => {
|
|
9383
9543
|
const list = li.parentElement;
|
|
9384
9544
|
if (!list || !list.parentNode) return;
|
|
9385
9545
|
const div = document.createElement("div");
|
|
@@ -9387,20 +9547,20 @@ function ITWysiwyg({
|
|
|
9387
9547
|
list.parentNode.insertBefore(div, list);
|
|
9388
9548
|
li.remove();
|
|
9389
9549
|
}, []);
|
|
9390
|
-
const cleanupEmptyLists = (0,
|
|
9550
|
+
const cleanupEmptyLists = (0, import_react42.useCallback)(() => {
|
|
9391
9551
|
const editor = editorRef.current;
|
|
9392
9552
|
if (!editor) return;
|
|
9393
9553
|
editor.querySelectorAll("ul, ol").forEach((list) => {
|
|
9394
9554
|
if (!list.querySelector("li")) list.remove();
|
|
9395
9555
|
});
|
|
9396
9556
|
}, []);
|
|
9397
|
-
const retagList = (0,
|
|
9557
|
+
const retagList = (0, import_react42.useCallback)((list, type) => {
|
|
9398
9558
|
if (!list.parentNode) return;
|
|
9399
9559
|
const nl = document.createElement(type);
|
|
9400
9560
|
while (list.firstChild) nl.appendChild(list.firstChild);
|
|
9401
9561
|
list.parentNode.replaceChild(nl, list);
|
|
9402
9562
|
}, []);
|
|
9403
|
-
const toggleList = (0,
|
|
9563
|
+
const toggleList = (0, import_react42.useCallback)(
|
|
9404
9564
|
(type) => {
|
|
9405
9565
|
const editor = editorRef.current;
|
|
9406
9566
|
const sel = window.getSelection();
|
|
@@ -9498,7 +9658,7 @@ function ITWysiwyg({
|
|
|
9498
9658
|
updateActive
|
|
9499
9659
|
]
|
|
9500
9660
|
);
|
|
9501
|
-
const clearFormatting = (0,
|
|
9661
|
+
const clearFormatting = (0, import_react42.useCallback)(() => {
|
|
9502
9662
|
const editor = editorRef.current;
|
|
9503
9663
|
const sel = window.getSelection();
|
|
9504
9664
|
if (!editor || !sel || sel.rangeCount === 0) return;
|
|
@@ -9532,7 +9692,7 @@ function ITWysiwyg({
|
|
|
9532
9692
|
emitChange,
|
|
9533
9693
|
updateActive
|
|
9534
9694
|
]);
|
|
9535
|
-
(0,
|
|
9695
|
+
(0, import_react42.useEffect)(() => {
|
|
9536
9696
|
const editor = editorRef.current;
|
|
9537
9697
|
if (!editor) return;
|
|
9538
9698
|
if (!focusedRef.current) {
|
|
@@ -9540,7 +9700,7 @@ function ITWysiwyg({
|
|
|
9540
9700
|
if (editor.innerHTML !== next) editor.innerHTML = next;
|
|
9541
9701
|
}
|
|
9542
9702
|
}, [value]);
|
|
9543
|
-
(0,
|
|
9703
|
+
(0, import_react42.useEffect)(() => {
|
|
9544
9704
|
const onSelectionChange = () => {
|
|
9545
9705
|
const editor = editorRef.current;
|
|
9546
9706
|
const sel = window.getSelection();
|
|
@@ -9596,7 +9756,7 @@ function ITWysiwyg({
|
|
|
9596
9756
|
}) => {
|
|
9597
9757
|
const meta = ACTION_META[action];
|
|
9598
9758
|
const isActive = !!active[action];
|
|
9599
|
-
return /* @__PURE__ */ (0,
|
|
9759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ITTooltip, { content: meta.label, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
9600
9760
|
"button",
|
|
9601
9761
|
{
|
|
9602
9762
|
type: "button",
|
|
@@ -9616,9 +9776,9 @@ function ITWysiwyg({
|
|
|
9616
9776
|
}
|
|
9617
9777
|
) });
|
|
9618
9778
|
};
|
|
9619
|
-
return /* @__PURE__ */ (0,
|
|
9620
|
-
label && /* @__PURE__ */ (0,
|
|
9621
|
-
/* @__PURE__ */ (0,
|
|
9779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: inputWrapper(className), children: [
|
|
9780
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ITText, { as: "label", className: inputLabel(!!error), htmlFor: name, children: label }),
|
|
9781
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
9622
9782
|
"div",
|
|
9623
9783
|
{
|
|
9624
9784
|
className: (0, import_clsx50.default)(
|
|
@@ -9627,20 +9787,20 @@ function ITWysiwyg({
|
|
|
9627
9787
|
isLocked && "opacity-50 cursor-not-allowed bg-secondary-100 dark:bg-slate-800"
|
|
9628
9788
|
),
|
|
9629
9789
|
children: [
|
|
9630
|
-
/* @__PURE__ */ (0,
|
|
9790
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
9631
9791
|
"div",
|
|
9632
9792
|
{
|
|
9633
9793
|
className: (0, import_clsx50.default)(
|
|
9634
9794
|
"flex flex-wrap items-center gap-0.5 px-1.5 py-1 border-b border-secondary-200 bg-secondary-50 dark:bg-slate-800",
|
|
9635
9795
|
isLocked && "bg-secondary-100 dark:bg-slate-900"
|
|
9636
9796
|
),
|
|
9637
|
-
children: toolbar.map((action, i) => /* @__PURE__ */ (0,
|
|
9638
|
-
i > 0 && (action === "ul" || action === "ol" || action === "clear") && /* @__PURE__ */ (0,
|
|
9639
|
-
/* @__PURE__ */ (0,
|
|
9797
|
+
children: toolbar.map((action, i) => /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("span", { className: "flex items-center", children: [
|
|
9798
|
+
i > 0 && (action === "ul" || action === "ol" || action === "clear") && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "mx-1 h-4 w-px bg-secondary-200 dark:bg-slate-600" }),
|
|
9799
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ToolbarButton, { action })
|
|
9640
9800
|
] }, action))
|
|
9641
9801
|
}
|
|
9642
9802
|
),
|
|
9643
|
-
/* @__PURE__ */ (0,
|
|
9803
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
9644
9804
|
"div",
|
|
9645
9805
|
{
|
|
9646
9806
|
id: name,
|
|
@@ -9674,12 +9834,12 @@ function ITWysiwyg({
|
|
|
9674
9834
|
]
|
|
9675
9835
|
}
|
|
9676
9836
|
),
|
|
9677
|
-
error && /* @__PURE__ */ (0,
|
|
9837
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ITText, { as: "span", className: inputError, children: error })
|
|
9678
9838
|
] });
|
|
9679
9839
|
}
|
|
9680
9840
|
|
|
9681
9841
|
// src/components/organisms/dropfile/dropfile.tsx
|
|
9682
|
-
var
|
|
9842
|
+
var import_react43 = require("react");
|
|
9683
9843
|
var import_react_dropzone = require("react-dropzone");
|
|
9684
9844
|
var import_clsx51 = __toESM(require("clsx"), 1);
|
|
9685
9845
|
|
|
@@ -9709,7 +9869,7 @@ var UploadStatus = /* @__PURE__ */ ((UploadStatus2) => {
|
|
|
9709
9869
|
})(UploadStatus || {});
|
|
9710
9870
|
|
|
9711
9871
|
// src/components/organisms/dropfile/dropfile.tsx
|
|
9712
|
-
var
|
|
9872
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
9713
9873
|
var ITDropfile = ({
|
|
9714
9874
|
onFileSelect,
|
|
9715
9875
|
onCancel,
|
|
@@ -9725,15 +9885,15 @@ var ITDropfile = ({
|
|
|
9725
9885
|
buttonLabel = "Subir archivo",
|
|
9726
9886
|
modalTitle
|
|
9727
9887
|
}) => {
|
|
9728
|
-
const [isModalOpen, setIsModalOpen] = (0,
|
|
9729
|
-
const [selectedFile, setSelectedFile] = (0,
|
|
9730
|
-
const [fileType, setFileType] = (0,
|
|
9731
|
-
const [imagePreview, setImagePreview] = (0,
|
|
9732
|
-
const [isConfirmed, setIsConfirmed] = (0,
|
|
9733
|
-
const [internalUploadStatus, setInternalUploadStatus] = (0,
|
|
9888
|
+
const [isModalOpen, setIsModalOpen] = (0, import_react43.useState)(false);
|
|
9889
|
+
const [selectedFile, setSelectedFile] = (0, import_react43.useState)(null);
|
|
9890
|
+
const [fileType, setFileType] = (0, import_react43.useState)(null);
|
|
9891
|
+
const [imagePreview, setImagePreview] = (0, import_react43.useState)(initialPreviewUrl || null);
|
|
9892
|
+
const [isConfirmed, setIsConfirmed] = (0, import_react43.useState)(false);
|
|
9893
|
+
const [internalUploadStatus, setInternalUploadStatus] = (0, import_react43.useState)(
|
|
9734
9894
|
initialPreviewUrl ? "subido" /* UPLOADED */ : "pendiente" /* PENDING */
|
|
9735
9895
|
);
|
|
9736
|
-
(0,
|
|
9896
|
+
(0, import_react43.useEffect)(() => {
|
|
9737
9897
|
if (initialPreviewUrl && !selectedFile) {
|
|
9738
9898
|
setImagePreview(initialPreviewUrl);
|
|
9739
9899
|
if (externalStatus === void 0) setInternalUploadStatus("subido" /* UPLOADED */);
|
|
@@ -9848,9 +10008,9 @@ var ITDropfile = ({
|
|
|
9848
10008
|
}
|
|
9849
10009
|
};
|
|
9850
10010
|
const { label, color, dotColor } = config2[status];
|
|
9851
|
-
return /* @__PURE__ */ (0,
|
|
9852
|
-
/* @__PURE__ */ (0,
|
|
9853
|
-
/* @__PURE__ */ (0,
|
|
10011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: `inline-flex items-center gap-2 px-2.5 py-1 rounded-full border ${color}`, children: [
|
|
10012
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: `w-2 h-2 rounded-full ${dotColor}` }),
|
|
10013
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ITText, { as: "span", className: "text-xs font-medium flex items-center gap-1.5", children: label })
|
|
9854
10014
|
] });
|
|
9855
10015
|
};
|
|
9856
10016
|
const onDrop = (acceptedFiles) => {
|
|
@@ -9882,12 +10042,12 @@ var ITDropfile = ({
|
|
|
9882
10042
|
accept: getAcceptedFileTypes(),
|
|
9883
10043
|
maxFiles: 1
|
|
9884
10044
|
});
|
|
9885
|
-
(0,
|
|
10045
|
+
(0, import_react43.useEffect)(() => {
|
|
9886
10046
|
const renderPDF = async () => {
|
|
9887
10047
|
};
|
|
9888
10048
|
renderPDF();
|
|
9889
10049
|
}, [selectedFile, fileType]);
|
|
9890
|
-
(0,
|
|
10050
|
+
(0, import_react43.useEffect)(() => {
|
|
9891
10051
|
return () => {
|
|
9892
10052
|
if (imagePreview) {
|
|
9893
10053
|
URL.revokeObjectURL(imagePreview);
|
|
@@ -9924,7 +10084,7 @@ var ITDropfile = ({
|
|
|
9924
10084
|
const handleDelete = () => {
|
|
9925
10085
|
handleCancel();
|
|
9926
10086
|
};
|
|
9927
|
-
(0,
|
|
10087
|
+
(0, import_react43.useEffect)(() => {
|
|
9928
10088
|
if (view === "button" && isConfirmed && uploadStatus === "subido" /* UPLOADED */) {
|
|
9929
10089
|
const timeout = setTimeout(() => {
|
|
9930
10090
|
setIsModalOpen(false);
|
|
@@ -9941,18 +10101,18 @@ var ITDropfile = ({
|
|
|
9941
10101
|
return () => clearTimeout(timeout);
|
|
9942
10102
|
}
|
|
9943
10103
|
}, [view, isConfirmed, uploadStatus, externalStatus, onStatusChange]);
|
|
9944
|
-
const headerRow = /* @__PURE__ */ (0,
|
|
9945
|
-
/* @__PURE__ */ (0,
|
|
9946
|
-
/* @__PURE__ */ (0,
|
|
9947
|
-
/* @__PURE__ */ (0,
|
|
10104
|
+
const headerRow = /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center justify-between mb-2", children: [
|
|
10105
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("label", { className: "block text-sm font-semibold text-secondary-700", children: [
|
|
10106
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ITText, { as: "span", children: "Subir archivo " }),
|
|
10107
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(ITText, { as: "span", className: "text-secondary-400 font-normal text-xs", children: [
|
|
9948
10108
|
"(",
|
|
9949
10109
|
getFileExtensions(),
|
|
9950
10110
|
")"
|
|
9951
10111
|
] })
|
|
9952
10112
|
] }),
|
|
9953
|
-
showStatusBadge && selectedFile && /* @__PURE__ */ (0,
|
|
10113
|
+
showStatusBadge && selectedFile && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(StatusBadge, { status: uploadStatus })
|
|
9954
10114
|
] });
|
|
9955
|
-
const dropZoneOrPreview = /* @__PURE__ */ (0,
|
|
10115
|
+
const dropZoneOrPreview = /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: !selectedFile && !imagePreview ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
9956
10116
|
"div",
|
|
9957
10117
|
{
|
|
9958
10118
|
...getRootProps(),
|
|
@@ -9962,41 +10122,41 @@ var ITDropfile = ({
|
|
|
9962
10122
|
${isDragActive ? "border-primary-500 bg-primary-50 scale-[1.01]" : "border-secondary-300 bg-white hover:border-primary-400 hover:bg-secondary-50"}
|
|
9963
10123
|
`,
|
|
9964
10124
|
children: [
|
|
9965
|
-
/* @__PURE__ */ (0,
|
|
9966
|
-
/* @__PURE__ */ (0,
|
|
10125
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("input", { ...getInputProps() }),
|
|
10126
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: `mb-3 p-3 rounded-full transition-colors duration-300 ${isDragActive ? "bg-primary-100" : "bg-secondary-100 group-hover:bg-primary-50"}`, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
9967
10127
|
"svg",
|
|
9968
10128
|
{
|
|
9969
10129
|
className: `w-6 h-6 transition-colors duration-300 ${isDragActive ? "text-primary-600" : "text-secondary-400 group-hover:text-primary-500"}`,
|
|
9970
10130
|
fill: "none",
|
|
9971
10131
|
viewBox: "0 0 24 24",
|
|
9972
10132
|
stroke: "currentColor",
|
|
9973
|
-
children: /* @__PURE__ */ (0,
|
|
10133
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" })
|
|
9974
10134
|
}
|
|
9975
10135
|
) }),
|
|
9976
|
-
/* @__PURE__ */ (0,
|
|
10136
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "text-center space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ITText, { as: "p", className: `text-sm font-medium transition-colors duration-300 ${isDragActive ? "text-primary-700" : "text-secondary-700"}`, children: isDragActive ? "\xA1Suelta aqu\xED!" : "Haz clic o arrastra" }) })
|
|
9977
10137
|
]
|
|
9978
10138
|
}
|
|
9979
|
-
) : /* @__PURE__ */ (0,
|
|
9980
|
-
/* @__PURE__ */ (0,
|
|
9981
|
-
/* @__PURE__ */ (0,
|
|
9982
|
-
/* @__PURE__ */ (0,
|
|
9983
|
-
/* @__PURE__ */ (0,
|
|
9984
|
-
/* @__PURE__ */ (0,
|
|
10139
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "w-full bg-white border border-secondary-200 rounded-xl shadow-sm overflow-hidden animate-fade-in", children: [
|
|
10140
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "flex items-center justify-between p-3 bg-secondary-50 border-b border-secondary-100", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
10141
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "flex-shrink-0 w-8 h-8 rounded-lg bg-primary-100 flex items-center justify-center text-primary-600", children: selectedFile && fileType?.startsWith("image/") || !selectedFile && imagePreview ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, 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" }) }) }),
|
|
10142
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "min-w-0", children: [
|
|
10143
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ITText, { as: "p", className: "text-xs font-medium text-secondary-900 truncate", title: selectedFile?.name || "Imagen cargada", children: selectedFile?.name || "Imagen cargada" }),
|
|
10144
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ITText, { as: "p", className: "text-[10px] text-secondary-500", children: selectedFile ? (selectedFile.size / 1024 / 1024).toFixed(2) + " MB" : "" })
|
|
9985
10145
|
] })
|
|
9986
10146
|
] }) }),
|
|
9987
|
-
/* @__PURE__ */ (0,
|
|
10147
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: (0, import_clsx51.default)("relative bg-secondary-100 flex items-center justify-center", !contentClassName ? "max-h-[200px] min-h-[100px] overflow-auto" : contentClassName), children: selectedFile && fileType?.startsWith("image/") || !selectedFile && imagePreview ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
9988
10148
|
"img",
|
|
9989
10149
|
{
|
|
9990
10150
|
src: imagePreview,
|
|
9991
10151
|
alt: "Vista previa",
|
|
9992
10152
|
className: "w-full h-full object-contain max-h-[200px]"
|
|
9993
10153
|
}
|
|
9994
|
-
) : /* @__PURE__ */ (0,
|
|
9995
|
-
/* @__PURE__ */ (0,
|
|
9996
|
-
/* @__PURE__ */ (0,
|
|
10154
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "py-8 flex flex-col items-center text-secondary-400", children: [
|
|
10155
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("svg", { className: "w-10 h-10 mb-2 opacity-50", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z" }) }),
|
|
10156
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ITText, { as: "span", className: "text-xs", children: "Sin vista previa" })
|
|
9997
10157
|
] }) }),
|
|
9998
|
-
/* @__PURE__ */ (0,
|
|
9999
|
-
/* @__PURE__ */ (0,
|
|
10158
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "px-3 py-2 bg-white border-t border-secondary-100 flex justify-end gap-2", children: !isConfirmed ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
10159
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10000
10160
|
ITButton,
|
|
10001
10161
|
{
|
|
10002
10162
|
type: "button",
|
|
@@ -10004,10 +10164,10 @@ var ITDropfile = ({
|
|
|
10004
10164
|
color: "secondary",
|
|
10005
10165
|
size: "sm",
|
|
10006
10166
|
onClick: handleCancel,
|
|
10007
|
-
children: /* @__PURE__ */ (0,
|
|
10167
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ITText, { children: "Cancelar" })
|
|
10008
10168
|
}
|
|
10009
10169
|
),
|
|
10010
|
-
/* @__PURE__ */ (0,
|
|
10170
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10011
10171
|
ITButton,
|
|
10012
10172
|
{
|
|
10013
10173
|
type: "button",
|
|
@@ -10015,13 +10175,13 @@ var ITDropfile = ({
|
|
|
10015
10175
|
color: "primary",
|
|
10016
10176
|
size: "sm",
|
|
10017
10177
|
onClick: handleConfirm,
|
|
10018
|
-
children: /* @__PURE__ */ (0,
|
|
10019
|
-
/* @__PURE__ */ (0,
|
|
10020
|
-
/* @__PURE__ */ (0,
|
|
10178
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
10179
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ITText, { children: "Confirmar" }),
|
|
10180
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) })
|
|
10021
10181
|
] })
|
|
10022
10182
|
}
|
|
10023
10183
|
)
|
|
10024
|
-
] }) : /* @__PURE__ */ (0,
|
|
10184
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
10025
10185
|
ITButton,
|
|
10026
10186
|
{
|
|
10027
10187
|
type: "button",
|
|
@@ -10030,12 +10190,12 @@ var ITDropfile = ({
|
|
|
10030
10190
|
size: "sm",
|
|
10031
10191
|
onClick: handleDelete,
|
|
10032
10192
|
children: [
|
|
10033
|
-
/* @__PURE__ */ (0,
|
|
10034
|
-
/* @__PURE__ */ (0,
|
|
10193
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }) }),
|
|
10194
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ITText, { children: "Eliminar" })
|
|
10035
10195
|
]
|
|
10036
10196
|
}
|
|
10037
10197
|
) }),
|
|
10038
|
-
uploadStatus === "subiendo" /* UPLOADING */ && /* @__PURE__ */ (0,
|
|
10198
|
+
uploadStatus === "subiendo" /* UPLOADING */ && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "px-4 pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "w-full bg-secondary-200 rounded-full h-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10039
10199
|
"div",
|
|
10040
10200
|
{
|
|
10041
10201
|
className: "bg-primary-600 h-1.5 rounded-full transition-all duration-1000 ease-out",
|
|
@@ -10048,8 +10208,8 @@ var ITDropfile = ({
|
|
|
10048
10208
|
] }) });
|
|
10049
10209
|
if (view === "button") {
|
|
10050
10210
|
const hasFile = Boolean(selectedFile || imagePreview);
|
|
10051
|
-
return /* @__PURE__ */ (0,
|
|
10052
|
-
/* @__PURE__ */ (0,
|
|
10211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: (0, import_clsx51.default)("inline-block", containerClassName), children: [
|
|
10212
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10053
10213
|
ITButton,
|
|
10054
10214
|
{
|
|
10055
10215
|
type: "button",
|
|
@@ -10057,20 +10217,20 @@ var ITDropfile = ({
|
|
|
10057
10217
|
color: hasFile ? "primary" : "secondary",
|
|
10058
10218
|
size: "sm",
|
|
10059
10219
|
onClick: () => setIsModalOpen(true),
|
|
10060
|
-
children: /* @__PURE__ */ (0,
|
|
10061
|
-
/* @__PURE__ */ (0,
|
|
10062
|
-
/* @__PURE__ */ (0,
|
|
10063
|
-
showStatusBadge && hasFile && /* @__PURE__ */ (0,
|
|
10220
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-2 max-w-[220px]", children: [
|
|
10221
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" }) }),
|
|
10222
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ITText, { className: "truncate", children: selectedFile?.name || (hasFile ? "Archivo cargado" : buttonLabel) }),
|
|
10223
|
+
showStatusBadge && hasFile && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(StatusBadge, { status: uploadStatus })
|
|
10064
10224
|
] })
|
|
10065
10225
|
}
|
|
10066
10226
|
),
|
|
10067
|
-
/* @__PURE__ */ (0,
|
|
10227
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ITDialog, { isOpen: isModalOpen, onClose: () => setIsModalOpen(false), title: modalTitle ?? buttonLabel, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "w-full transition-all duration-300", children: [
|
|
10068
10228
|
headerRow,
|
|
10069
10229
|
dropZoneOrPreview
|
|
10070
10230
|
] }) })
|
|
10071
10231
|
] });
|
|
10072
10232
|
}
|
|
10073
|
-
return /* @__PURE__ */ (0,
|
|
10233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: (0, import_clsx51.default)("w-full transition-all duration-300", containerClassName), children: [
|
|
10074
10234
|
headerRow,
|
|
10075
10235
|
dropZoneOrPreview
|
|
10076
10236
|
] });
|
|
@@ -10078,13 +10238,13 @@ var ITDropfile = ({
|
|
|
10078
10238
|
var dropfile_default = ITDropfile;
|
|
10079
10239
|
|
|
10080
10240
|
// src/components/templates/layout/layout.tsx
|
|
10081
|
-
var
|
|
10241
|
+
var import_react45 = require("react");
|
|
10082
10242
|
var import_clsx52 = __toESM(require("clsx"), 1);
|
|
10083
10243
|
|
|
10084
10244
|
// src/components/organisms/topbar/topbar.tsx
|
|
10085
10245
|
var import_fa30 = require("react-icons/fa");
|
|
10086
|
-
var
|
|
10087
|
-
var
|
|
10246
|
+
var import_react44 = require("react");
|
|
10247
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
10088
10248
|
function ITTopBar({
|
|
10089
10249
|
logo,
|
|
10090
10250
|
logoText,
|
|
@@ -10095,14 +10255,15 @@ function ITTopBar({
|
|
|
10095
10255
|
onToggleMobileMenu,
|
|
10096
10256
|
navItems,
|
|
10097
10257
|
onNavItemClick,
|
|
10098
|
-
hideBrandOnDesktop = false
|
|
10258
|
+
hideBrandOnDesktop = false,
|
|
10259
|
+
showDesktopMenuButton = false
|
|
10099
10260
|
}) {
|
|
10100
10261
|
const flat = useITFlatAppearance();
|
|
10101
10262
|
const initials = (userMenu?.userName ?? "").trim().split(/\s+/).slice(0, 2).map((word) => word.charAt(0).toUpperCase()).join("");
|
|
10102
|
-
const [isUserMenuOpen, setIsUserMenuOpen] = (0,
|
|
10103
|
-
const userMenuRef = (0,
|
|
10263
|
+
const [isUserMenuOpen, setIsUserMenuOpen] = (0, import_react44.useState)(false);
|
|
10264
|
+
const userMenuRef = (0, import_react44.useRef)(null);
|
|
10104
10265
|
useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
|
|
10105
|
-
return /* @__PURE__ */ (0,
|
|
10266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10106
10267
|
"header",
|
|
10107
10268
|
{
|
|
10108
10269
|
className: `sticky top-0 z-40 transition-all duration-300 ${flat ? "" : "backdrop-blur-md"}`,
|
|
@@ -10111,24 +10272,26 @@ function ITTopBar({
|
|
|
10111
10272
|
borderBottom: "1px solid var(--it-topbar-border, rgba(15, 23, 42, 0.06))",
|
|
10112
10273
|
boxShadow: flat ? "none" : "var(--shadow-xs)"
|
|
10113
10274
|
},
|
|
10114
|
-
children: /* @__PURE__ */ (0,
|
|
10115
|
-
/* @__PURE__ */ (0,
|
|
10116
|
-
showMobileMenuButton && /* @__PURE__ */ (0,
|
|
10275
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: `flex items-center justify-between px-6 lg:px-8 ${flat ? "h-[64px]" : "h-[72px]"}`, children: [
|
|
10276
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex items-center gap-5", children: [
|
|
10277
|
+
showMobileMenuButton && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10117
10278
|
"button",
|
|
10118
10279
|
{
|
|
10119
|
-
|
|
10280
|
+
type: "button",
|
|
10281
|
+
"aria-label": "Men\xFA",
|
|
10282
|
+
className: `${showDesktopMenuButton ? "" : "lg:hidden"} p-2.5 -ml-2.5 rounded-xl transition-colors duration-200`,
|
|
10120
10283
|
style: {
|
|
10121
10284
|
color: "var(--it-topbar-icon, #64748b)"
|
|
10122
10285
|
},
|
|
10123
10286
|
onMouseEnter: (e) => e.currentTarget.style.backgroundColor = "var(--it-topbar-user-hover, #f1f5f9)",
|
|
10124
10287
|
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "transparent",
|
|
10125
10288
|
onClick: onToggleMobileMenu,
|
|
10126
|
-
children: /* @__PURE__ */ (0,
|
|
10289
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_fa30.FaBars, { className: "w-[1.125rem] h-[1.125rem]" })
|
|
10127
10290
|
}
|
|
10128
10291
|
),
|
|
10129
|
-
/* @__PURE__ */ (0,
|
|
10130
|
-
logo && /* @__PURE__ */ (0,
|
|
10131
|
-
logoText && /* @__PURE__ */ (0,
|
|
10292
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: `items-center gap-3 ${hideBrandOnDesktop ? "flex lg:hidden" : "flex"}`, children: [
|
|
10293
|
+
logo && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "flex-shrink-0 drop-shadow-sm", children: logo }),
|
|
10294
|
+
logoText && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10132
10295
|
ITText,
|
|
10133
10296
|
{
|
|
10134
10297
|
as: "span",
|
|
@@ -10138,7 +10301,7 @@ function ITTopBar({
|
|
|
10138
10301
|
}
|
|
10139
10302
|
)
|
|
10140
10303
|
] }),
|
|
10141
|
-
navItems && navItems.length > 0 && /* @__PURE__ */ (0,
|
|
10304
|
+
navItems && navItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("nav", { className: "hidden md:flex ml-8 space-x-1 border-l pl-8", style: { borderColor: "var(--it-topbar-border, rgba(15, 23, 42, 0.06))" }, children: navItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10142
10305
|
"button",
|
|
10143
10306
|
{
|
|
10144
10307
|
onClick: () => onNavItemClick?.(item.id),
|
|
@@ -10152,19 +10315,19 @@ function ITTopBar({
|
|
|
10152
10315
|
e.currentTarget.style.color = "var(--it-topbar-text, #475569)";
|
|
10153
10316
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
10154
10317
|
},
|
|
10155
|
-
children: /* @__PURE__ */ (0,
|
|
10156
|
-
item.icon && /* @__PURE__ */ (0,
|
|
10157
|
-
/* @__PURE__ */ (0,
|
|
10318
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
10319
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "opacity-70", children: item.icon }),
|
|
10320
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ITText, { as: "span", children: item.label })
|
|
10158
10321
|
] })
|
|
10159
10322
|
},
|
|
10160
10323
|
item.id
|
|
10161
10324
|
)) })
|
|
10162
10325
|
] }),
|
|
10163
|
-
centerContent && /* @__PURE__ */ (0,
|
|
10164
|
-
(children || userMenu) && /* @__PURE__ */ (0,
|
|
10326
|
+
centerContent && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: `hidden lg:flex flex-1 min-w-0 items-center ${hideBrandOnDesktop ? "justify-start pr-4" : "justify-center px-4"}`, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "w-full max-w-[420px]", children: centerContent }) }),
|
|
10327
|
+
(children || userMenu) && /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
10165
10328
|
children,
|
|
10166
|
-
userMenu && /* @__PURE__ */ (0,
|
|
10167
|
-
/* @__PURE__ */ (0,
|
|
10329
|
+
userMenu && /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "relative", children: [
|
|
10330
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
10168
10331
|
"button",
|
|
10169
10332
|
{
|
|
10170
10333
|
type: "button",
|
|
@@ -10180,15 +10343,15 @@ function ITTopBar({
|
|
|
10180
10343
|
},
|
|
10181
10344
|
onClick: () => setIsUserMenuOpen(!isUserMenuOpen),
|
|
10182
10345
|
children: [
|
|
10183
|
-
/* @__PURE__ */ (0,
|
|
10184
|
-
userMenu.userImage ? /* @__PURE__ */ (0,
|
|
10346
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "relative", children: [
|
|
10347
|
+
userMenu.userImage ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10185
10348
|
"img",
|
|
10186
10349
|
{
|
|
10187
10350
|
className: "w-9 h-9 rounded-full object-cover ring-2 ring-white shadow-sm",
|
|
10188
10351
|
src: userMenu.userImage,
|
|
10189
10352
|
alt: "Current user"
|
|
10190
10353
|
}
|
|
10191
|
-
) : flat && initials ? /* @__PURE__ */ (0,
|
|
10354
|
+
) : flat && initials ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10192
10355
|
"div",
|
|
10193
10356
|
{
|
|
10194
10357
|
"aria-hidden": "true",
|
|
@@ -10199,11 +10362,11 @@ function ITTopBar({
|
|
|
10199
10362
|
},
|
|
10200
10363
|
children: initials
|
|
10201
10364
|
}
|
|
10202
|
-
) : /* @__PURE__ */ (0,
|
|
10203
|
-
!flat && /* @__PURE__ */ (0,
|
|
10365
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "w-9 h-9 rounded-full bg-slate-100 flex items-center justify-center ring-2 ring-white shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_fa30.FaUserCircle, { className: "w-6 h-6", style: { color: "var(--it-topbar-icon, #94a3b8)" } }) }),
|
|
10366
|
+
!flat && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "absolute bottom-0 right-0 w-2.5 h-2.5 bg-green-500 border-2 border-white rounded-full" })
|
|
10204
10367
|
] }),
|
|
10205
|
-
/* @__PURE__ */ (0,
|
|
10206
|
-
/* @__PURE__ */ (0,
|
|
10368
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: `hidden sm:flex flex-col py-0.5 ${flat ? "text-right" : "text-left"}`, children: [
|
|
10369
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10207
10370
|
ITText,
|
|
10208
10371
|
{
|
|
10209
10372
|
as: "span",
|
|
@@ -10212,7 +10375,7 @@ function ITTopBar({
|
|
|
10212
10375
|
children: userMenu.userName
|
|
10213
10376
|
}
|
|
10214
10377
|
),
|
|
10215
|
-
/* @__PURE__ */ (0,
|
|
10378
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10216
10379
|
ITText,
|
|
10217
10380
|
{
|
|
10218
10381
|
as: "span",
|
|
@@ -10225,7 +10388,7 @@ function ITTopBar({
|
|
|
10225
10388
|
]
|
|
10226
10389
|
}
|
|
10227
10390
|
),
|
|
10228
|
-
/* @__PURE__ */ (0,
|
|
10391
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
10229
10392
|
"div",
|
|
10230
10393
|
{
|
|
10231
10394
|
ref: userMenuRef,
|
|
@@ -10238,15 +10401,15 @@ function ITTopBar({
|
|
|
10238
10401
|
border: "1px solid var(--it-topbar-user-dropdown-border, #f1f5f9)"
|
|
10239
10402
|
},
|
|
10240
10403
|
children: [
|
|
10241
|
-
/* @__PURE__ */ (0,
|
|
10242
|
-
/* @__PURE__ */ (0,
|
|
10243
|
-
/* @__PURE__ */ (0,
|
|
10404
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "px-5 py-4 border-b", style: { borderColor: "var(--it-topbar-user-dropdown-border, #f1f5f9)", backgroundColor: "var(--it-topbar-user-bg, #f8fafc)" }, children: [
|
|
10405
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ITText, { as: "span", className: "block font-bold text-[0.9rem]", style: { color: "var(--it-topbar-user-text, #0f172a)" }, children: userMenu.userName }),
|
|
10406
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ITText, { as: "span", className: "block text-xs font-medium truncate mt-0.5", style: { color: "var(--it-topbar-user-subtitle, #64748b)" }, children: userMenu.userEmail })
|
|
10244
10407
|
] }),
|
|
10245
|
-
/* @__PURE__ */ (0,
|
|
10408
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("ul", { className: "py-2", children: userMenu.menuItems.map((m, i) => {
|
|
10246
10409
|
const isDestructive = m.label.toLowerCase().includes("salir") || m.label.toLowerCase().includes("cerrar") || m.label.toLowerCase().includes("logout");
|
|
10247
|
-
return /* @__PURE__ */ (0,
|
|
10248
|
-
i === userMenu.menuItems.length - 1 && isDestructive && i > 0 && /* @__PURE__ */ (0,
|
|
10249
|
-
/* @__PURE__ */ (0,
|
|
10410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("li", { className: "px-2", children: [
|
|
10411
|
+
i === userMenu.menuItems.length - 1 && isDestructive && i > 0 && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "h-px bg-slate-100 my-1 mx-2" }),
|
|
10412
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10250
10413
|
"button",
|
|
10251
10414
|
{
|
|
10252
10415
|
onClick: () => {
|
|
@@ -10261,7 +10424,7 @@ function ITTopBar({
|
|
|
10261
10424
|
onMouseLeave: (e) => {
|
|
10262
10425
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
10263
10426
|
},
|
|
10264
|
-
children: /* @__PURE__ */ (0,
|
|
10427
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ITText, { as: "span", children: m.label })
|
|
10265
10428
|
}
|
|
10266
10429
|
)
|
|
10267
10430
|
] }, i);
|
|
@@ -10277,7 +10440,7 @@ function ITTopBar({
|
|
|
10277
10440
|
}
|
|
10278
10441
|
|
|
10279
10442
|
// src/components/templates/layout/layout.tsx
|
|
10280
|
-
var
|
|
10443
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
10281
10444
|
function ITLayout({
|
|
10282
10445
|
topBar,
|
|
10283
10446
|
sidebar,
|
|
@@ -10286,31 +10449,37 @@ function ITLayout({
|
|
|
10286
10449
|
contentClassName = "",
|
|
10287
10450
|
sidebarFullHeight = false
|
|
10288
10451
|
}) {
|
|
10289
|
-
const [internalCollapsed, setInternalCollapsed] = (0,
|
|
10290
|
-
const [mobileSidebarOpen, setMobileSidebarOpen] = (0,
|
|
10452
|
+
const [internalCollapsed, setInternalCollapsed] = (0, import_react45.useState)(true);
|
|
10453
|
+
const [mobileSidebarOpen, setMobileSidebarOpen] = (0, import_react45.useState)(false);
|
|
10291
10454
|
const flat = useITFlatAppearance();
|
|
10292
10455
|
const isControlled = sidebar.isCollapsed !== void 0;
|
|
10293
10456
|
const desktopCollapsed = isControlled ? sidebar.isCollapsed : internalCollapsed;
|
|
10294
10457
|
const handleToggleCollapse = isControlled ? sidebar.onToggleCollapse ?? (() => {
|
|
10295
10458
|
}) : () => setInternalCollapsed((v) => !v);
|
|
10296
10459
|
const layoutTokens = theme.layout;
|
|
10297
|
-
const reservedWidth = desktopCollapsed ? "w-[88px]" : flat ? "w-[248px]" : "w-[280px]";
|
|
10460
|
+
const reservedWidth = desktopCollapsed ? flat ? "w-[72px]" : "w-[88px]" : flat ? "w-[248px]" : "w-[280px]";
|
|
10461
|
+
const toggleByButton = sidebar.expandOnHover === false;
|
|
10462
|
+
const handleMenuButton = () => {
|
|
10463
|
+
if (toggleByButton && window.matchMedia("(min-width: 1024px)").matches) handleToggleCollapse();
|
|
10464
|
+
else setMobileSidebarOpen((v) => !v);
|
|
10465
|
+
};
|
|
10298
10466
|
const brand = sidebarFullHeight ? sidebar.brand ?? { logo: topBar.logo, text: topBar.logoText } : sidebar.brand;
|
|
10299
|
-
const topBarNode = /* @__PURE__ */ (0,
|
|
10467
|
+
const topBarNode = /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
10300
10468
|
ITTopBar,
|
|
10301
10469
|
{
|
|
10302
10470
|
...topBar,
|
|
10303
10471
|
hideBrandOnDesktop: sidebarFullHeight || topBar.hideBrandOnDesktop,
|
|
10304
10472
|
showMobileMenuButton: true,
|
|
10305
|
-
|
|
10473
|
+
showDesktopMenuButton: toggleByButton || topBar.showDesktopMenuButton,
|
|
10474
|
+
onToggleMobileMenu: handleMenuButton
|
|
10306
10475
|
}
|
|
10307
10476
|
);
|
|
10308
10477
|
const desktopSidebar = (
|
|
10309
10478
|
// Full-height: the sidebar sits beside the top bar, so it needs to win the
|
|
10310
10479
|
// stacking order when the collapsed rail expands over the content on hover.
|
|
10311
|
-
/* @__PURE__ */ (0,
|
|
10312
|
-
/* @__PURE__ */ (0,
|
|
10313
|
-
/* @__PURE__ */ (0,
|
|
10480
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: `hidden lg:block relative h-full ${sidebarFullHeight ? "z-50" : "z-40"}`, children: [
|
|
10481
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: `${reservedWidth} h-full flex-shrink-0` }),
|
|
10482
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "absolute top-0 left-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
10314
10483
|
ITSidebar,
|
|
10315
10484
|
{
|
|
10316
10485
|
...sidebar,
|
|
@@ -10323,17 +10492,17 @@ function ITLayout({
|
|
|
10323
10492
|
) })
|
|
10324
10493
|
] })
|
|
10325
10494
|
);
|
|
10326
|
-
const mobileSidebar = mobileSidebarOpen && /* @__PURE__ */ (0,
|
|
10495
|
+
const mobileSidebar = mobileSidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
10327
10496
|
"div",
|
|
10328
10497
|
{
|
|
10329
10498
|
className: "lg:hidden fixed inset-0 z-[40] transition-opacity duration-300 backdrop-blur-sm bg-black/40",
|
|
10330
10499
|
onClick: () => setMobileSidebarOpen(false),
|
|
10331
|
-
children: /* @__PURE__ */ (0,
|
|
10500
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
10332
10501
|
"div",
|
|
10333
10502
|
{
|
|
10334
10503
|
className: "h-full w-fit flex transform transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)]",
|
|
10335
10504
|
onClick: (e) => e.stopPropagation(),
|
|
10336
|
-
children: /* @__PURE__ */ (0,
|
|
10505
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
10337
10506
|
ITSidebar,
|
|
10338
10507
|
{
|
|
10339
10508
|
...sidebar,
|
|
@@ -10350,16 +10519,16 @@ function ITLayout({
|
|
|
10350
10519
|
)
|
|
10351
10520
|
}
|
|
10352
10521
|
);
|
|
10353
|
-
const main = /* @__PURE__ */ (0,
|
|
10522
|
+
const main = /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("main", { className: "flex-1 overflow-y-auto w-full custom-scrollbar relative z-0", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: (0, import_clsx52.default)("mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8 py-6 h-full", contentClassName), children }) });
|
|
10354
10523
|
if (sidebarFullHeight) {
|
|
10355
|
-
return /* @__PURE__ */ (0,
|
|
10524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
10356
10525
|
"div",
|
|
10357
10526
|
{
|
|
10358
10527
|
className: `flex h-screen overflow-hidden w-full relative ${className}`,
|
|
10359
10528
|
style: { backgroundColor: layoutTokens.backgroundColor },
|
|
10360
10529
|
children: [
|
|
10361
10530
|
desktopSidebar,
|
|
10362
|
-
/* @__PURE__ */ (0,
|
|
10531
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "flex flex-col flex-1 min-w-0 overflow-hidden", children: [
|
|
10363
10532
|
topBarNode,
|
|
10364
10533
|
main
|
|
10365
10534
|
] }),
|
|
@@ -10368,9 +10537,9 @@ function ITLayout({
|
|
|
10368
10537
|
}
|
|
10369
10538
|
);
|
|
10370
10539
|
}
|
|
10371
|
-
return /* @__PURE__ */ (0,
|
|
10540
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: `flex flex-col h-screen overflow-hidden w-full ${className}`, children: [
|
|
10372
10541
|
topBarNode,
|
|
10373
|
-
/* @__PURE__ */ (0,
|
|
10542
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
10374
10543
|
"div",
|
|
10375
10544
|
{
|
|
10376
10545
|
className: "flex flex-1 overflow-hidden relative",
|
|
@@ -10394,7 +10563,7 @@ var sizeClasses = {
|
|
|
10394
10563
|
};
|
|
10395
10564
|
|
|
10396
10565
|
// src/components/atoms/loader/loader.tsx
|
|
10397
|
-
var
|
|
10566
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
10398
10567
|
function ITLoader({
|
|
10399
10568
|
size = "md",
|
|
10400
10569
|
variant = "spinner",
|
|
@@ -10409,22 +10578,22 @@ function ITLoader({
|
|
|
10409
10578
|
const bgStyle = isCssValue ? { backgroundColor: resolvedColor } : {};
|
|
10410
10579
|
const colorClass = !isCssValue ? color : "";
|
|
10411
10580
|
if (variant === "spinner") {
|
|
10412
|
-
return /* @__PURE__ */ (0,
|
|
10581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
10413
10582
|
"div",
|
|
10414
10583
|
{
|
|
10415
10584
|
className: `inline-block ${sizeClasses[size]} animate-spin rounded-full border-2 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite] ${colorClass} ${className}`,
|
|
10416
10585
|
role: "status",
|
|
10417
10586
|
style,
|
|
10418
|
-
children: /* @__PURE__ */ (0,
|
|
10587
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ITText, { as: "span", className: "!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]", children: "Loading..." })
|
|
10419
10588
|
}
|
|
10420
10589
|
);
|
|
10421
10590
|
}
|
|
10422
10591
|
if (variant === "dots") {
|
|
10423
|
-
return /* @__PURE__ */ (0,
|
|
10592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
10424
10593
|
"div",
|
|
10425
10594
|
{
|
|
10426
10595
|
className: `flex items-center justify-center space-x-2 ${className}`,
|
|
10427
|
-
children: [...Array(3)].map((_, i) => /* @__PURE__ */ (0,
|
|
10596
|
+
children: [...Array(3)].map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
10428
10597
|
"div",
|
|
10429
10598
|
{
|
|
10430
10599
|
className: `${sizeClasses[size.replace(/l|g/, "")]} animate-bounce rounded-full ${colorClass}`,
|
|
@@ -10439,11 +10608,11 @@ function ITLoader({
|
|
|
10439
10608
|
);
|
|
10440
10609
|
}
|
|
10441
10610
|
if (variant === "bar") {
|
|
10442
|
-
return /* @__PURE__ */ (0,
|
|
10611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
10443
10612
|
"div",
|
|
10444
10613
|
{
|
|
10445
10614
|
className: `w-full ${size === "sm" ? "h-1" : size === "md" ? "h-1.5" : size === "lg" ? "h-2" : "h-2.5"} bg-secondary-200 rounded-full overflow-hidden ${className}`,
|
|
10446
|
-
children: /* @__PURE__ */ (0,
|
|
10615
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
10447
10616
|
"div",
|
|
10448
10617
|
{
|
|
10449
10618
|
className: `h-full animate-progress ${colorClass}`,
|
|
@@ -10459,7 +10628,7 @@ function ITLoader({
|
|
|
10459
10628
|
);
|
|
10460
10629
|
}
|
|
10461
10630
|
if (variant === "pulse") {
|
|
10462
|
-
return /* @__PURE__ */ (0,
|
|
10631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
10463
10632
|
"div",
|
|
10464
10633
|
{
|
|
10465
10634
|
className: `rounded-full ${sizeClasses[size]} animate-pulse ${colorClass} ${className}`,
|
|
@@ -10472,9 +10641,9 @@ function ITLoader({
|
|
|
10472
10641
|
|
|
10473
10642
|
// src/components/molecules/stepper/stepper.tsx
|
|
10474
10643
|
var import_clsx53 = __toESM(require("clsx"), 1);
|
|
10475
|
-
var
|
|
10644
|
+
var import_react46 = require("react");
|
|
10476
10645
|
var import_fa31 = require("react-icons/fa");
|
|
10477
|
-
var
|
|
10646
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
10478
10647
|
function ITStepper({
|
|
10479
10648
|
steps,
|
|
10480
10649
|
currentStep,
|
|
@@ -10489,15 +10658,15 @@ function ITStepper({
|
|
|
10489
10658
|
maxContentHeight = "400px",
|
|
10490
10659
|
color = "primary"
|
|
10491
10660
|
}) {
|
|
10492
|
-
const [direction, setDirection] = (0,
|
|
10493
|
-
const contentRef = (0,
|
|
10494
|
-
const progressRef = (0,
|
|
10661
|
+
const [direction, setDirection] = (0, import_react46.useState)("next");
|
|
10662
|
+
const contentRef = (0, import_react46.useRef)(null);
|
|
10663
|
+
const progressRef = (0, import_react46.useRef)(null);
|
|
10495
10664
|
const isThemeColor = color in theme.colors;
|
|
10496
10665
|
const resolvedColor = isThemeColor ? theme.colors[color][500] : color;
|
|
10497
|
-
(0,
|
|
10666
|
+
(0, import_react46.useEffect)(() => {
|
|
10498
10667
|
onStepChange?.(currentStep);
|
|
10499
10668
|
}, [currentStep, onStepChange]);
|
|
10500
|
-
(0,
|
|
10669
|
+
(0, import_react46.useEffect)(() => {
|
|
10501
10670
|
const pct = currentStep / Math.max(1, steps.length - 1) * 100;
|
|
10502
10671
|
if (progressRef.current) {
|
|
10503
10672
|
progressRef.current.style.width = `${pct}%`;
|
|
@@ -10541,23 +10710,23 @@ function ITStepper({
|
|
|
10541
10710
|
const renderStepContent = (index, isCompleted) => {
|
|
10542
10711
|
const step = steps[index];
|
|
10543
10712
|
if (isCompleted) {
|
|
10544
|
-
return /* @__PURE__ */ (0,
|
|
10713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_fa31.FaCheck, { className: "w-4 h-4" });
|
|
10545
10714
|
}
|
|
10546
10715
|
if (step.icon && useIcons) {
|
|
10547
|
-
return /* @__PURE__ */ (0,
|
|
10716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "flex items-center justify-center w-5 h-5", children: step.icon });
|
|
10548
10717
|
}
|
|
10549
|
-
return /* @__PURE__ */ (0,
|
|
10718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ITText, { as: "span", className: "text-sm font-semibold", children: index + 1 });
|
|
10550
10719
|
};
|
|
10551
|
-
return /* @__PURE__ */ (0,
|
|
10552
|
-
/* @__PURE__ */ (0,
|
|
10553
|
-
/* @__PURE__ */ (0,
|
|
10720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: (0, import_clsx53.default)("w-full max-w-5xl mx-auto px-4", containerClassName), children: [
|
|
10721
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "relative mb-8", children: [
|
|
10722
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
10554
10723
|
"div",
|
|
10555
10724
|
{
|
|
10556
10725
|
className: "absolute left-6 right-6 top-5 h-1 bg-secondary-200 rounded-full z-0",
|
|
10557
10726
|
"aria-hidden": true
|
|
10558
10727
|
}
|
|
10559
10728
|
),
|
|
10560
|
-
/* @__PURE__ */ (0,
|
|
10729
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
10561
10730
|
"div",
|
|
10562
10731
|
{
|
|
10563
10732
|
ref: progressRef,
|
|
@@ -10565,11 +10734,11 @@ function ITStepper({
|
|
|
10565
10734
|
"aria-hidden": true
|
|
10566
10735
|
}
|
|
10567
10736
|
),
|
|
10568
|
-
/* @__PURE__ */ (0,
|
|
10737
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "flex items-start justify-between space-x-2 relative z-20", children: steps.map((step, idx) => {
|
|
10569
10738
|
const isActive = idx === currentStep;
|
|
10570
10739
|
const isCompleted = idx < currentStep;
|
|
10571
10740
|
const hasIcon = step.icon && useIcons;
|
|
10572
|
-
return /* @__PURE__ */ (0,
|
|
10741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
10573
10742
|
"button",
|
|
10574
10743
|
{
|
|
10575
10744
|
type: "button",
|
|
@@ -10579,8 +10748,8 @@ function ITStepper({
|
|
|
10579
10748
|
"aria-label": `Paso ${idx + 1} ${step.label}`,
|
|
10580
10749
|
className: "flex-1 group",
|
|
10581
10750
|
title: step.label,
|
|
10582
|
-
children: /* @__PURE__ */ (0,
|
|
10583
|
-
/* @__PURE__ */ (0,
|
|
10751
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex flex-col items-center", children: [
|
|
10752
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
10584
10753
|
"div",
|
|
10585
10754
|
{
|
|
10586
10755
|
className: (0, import_clsx53.default)(
|
|
@@ -10594,7 +10763,7 @@ function ITStepper({
|
|
|
10594
10763
|
children: renderStepContent(idx, isCompleted)
|
|
10595
10764
|
}
|
|
10596
10765
|
),
|
|
10597
|
-
/* @__PURE__ */ (0,
|
|
10766
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
10598
10767
|
ITText,
|
|
10599
10768
|
{
|
|
10600
10769
|
as: "span",
|
|
@@ -10612,7 +10781,7 @@ function ITStepper({
|
|
|
10612
10781
|
);
|
|
10613
10782
|
}) })
|
|
10614
10783
|
] }),
|
|
10615
|
-
/* @__PURE__ */ (0,
|
|
10784
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
10616
10785
|
"div",
|
|
10617
10786
|
{
|
|
10618
10787
|
ref: contentRef,
|
|
@@ -10628,37 +10797,37 @@ function ITStepper({
|
|
|
10628
10797
|
children: steps[currentStep].content
|
|
10629
10798
|
}
|
|
10630
10799
|
),
|
|
10631
|
-
/* @__PURE__ */ (0,
|
|
10632
|
-
/* @__PURE__ */ (0,
|
|
10800
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex justify-between items-center mt-6", children: [
|
|
10801
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
10633
10802
|
ITButton,
|
|
10634
10803
|
{
|
|
10635
10804
|
variant: "outlined",
|
|
10636
10805
|
color: "secondary",
|
|
10637
10806
|
disabled: currentStep === 0,
|
|
10638
10807
|
onClick: prevStep,
|
|
10639
|
-
children: /* @__PURE__ */ (0,
|
|
10640
|
-
/* @__PURE__ */ (0,
|
|
10641
|
-
/* @__PURE__ */ (0,
|
|
10808
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
10809
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_fa31.FaChevronLeft, {}),
|
|
10810
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ITText, { as: "span", children: "Atr\xE1s" })
|
|
10642
10811
|
] })
|
|
10643
10812
|
}
|
|
10644
10813
|
),
|
|
10645
|
-
/* @__PURE__ */ (0,
|
|
10646
|
-
/* @__PURE__ */ (0,
|
|
10814
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
10815
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(ITText, { as: "div", className: "text-sm text-secondary-500 mr-2 hidden sm:block", children: [
|
|
10647
10816
|
"Paso ",
|
|
10648
10817
|
currentStep + 1,
|
|
10649
10818
|
" de ",
|
|
10650
10819
|
steps.length
|
|
10651
10820
|
] }),
|
|
10652
|
-
/* @__PURE__ */ (0,
|
|
10821
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
10653
10822
|
ITButton,
|
|
10654
10823
|
{
|
|
10655
10824
|
variant: "solid",
|
|
10656
10825
|
color,
|
|
10657
10826
|
disabled: disableNext,
|
|
10658
10827
|
onClick: nextStep,
|
|
10659
|
-
children: /* @__PURE__ */ (0,
|
|
10660
|
-
/* @__PURE__ */ (0,
|
|
10661
|
-
currentStep === steps.length - 1 ? /* @__PURE__ */ (0,
|
|
10828
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
10829
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ITText, { as: "span", children: currentStep === steps.length - 1 ? "Finalizar" : "Siguiente" }),
|
|
10830
|
+
currentStep === steps.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_fa31.FaCheck, {}) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_fa31.FaChevronRight, {})
|
|
10662
10831
|
] })
|
|
10663
10832
|
}
|
|
10664
10833
|
)
|
|
@@ -10668,7 +10837,7 @@ function ITStepper({
|
|
|
10668
10837
|
}
|
|
10669
10838
|
|
|
10670
10839
|
// src/components/theme-provider/themeProvider.tsx
|
|
10671
|
-
var
|
|
10840
|
+
var import_react47 = require("react");
|
|
10672
10841
|
var import_md3 = require("react-icons/md");
|
|
10673
10842
|
|
|
10674
10843
|
// src/components/theme-provider/themePresets.ts
|
|
@@ -10846,7 +11015,7 @@ var PRESETS = [
|
|
|
10846
11015
|
];
|
|
10847
11016
|
|
|
10848
11017
|
// src/components/theme-provider/themeProvider.tsx
|
|
10849
|
-
var
|
|
11018
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
10850
11019
|
var STORAGE_KEY = "it-theme-palette";
|
|
10851
11020
|
var SHADOW_LEVELS = {
|
|
10852
11021
|
0: {
|
|
@@ -10941,7 +11110,7 @@ function ITThemeProvider({
|
|
|
10941
11110
|
shadow,
|
|
10942
11111
|
appearance = "soft"
|
|
10943
11112
|
}) {
|
|
10944
|
-
const [palette2, setPaletteState] = (0,
|
|
11113
|
+
const [palette2, setPaletteState] = (0, import_react47.useState)(() => {
|
|
10945
11114
|
const basePalette = {
|
|
10946
11115
|
...DEFAULT_PALETTE,
|
|
10947
11116
|
...theme2,
|
|
@@ -10967,8 +11136,8 @@ function ITThemeProvider({
|
|
|
10967
11136
|
}
|
|
10968
11137
|
return basePalette;
|
|
10969
11138
|
});
|
|
10970
|
-
const [isOpen, setIsOpen] = (0,
|
|
10971
|
-
const [customPresets, setCustomPresets] = (0,
|
|
11139
|
+
const [isOpen, setIsOpen] = (0, import_react47.useState)(false);
|
|
11140
|
+
const [customPresets, setCustomPresets] = (0, import_react47.useState)(() => {
|
|
10972
11141
|
try {
|
|
10973
11142
|
const saved = localStorage.getItem("it-theme-custom-presets");
|
|
10974
11143
|
return saved ? JSON.parse(saved) : [];
|
|
@@ -10977,8 +11146,8 @@ function ITThemeProvider({
|
|
|
10977
11146
|
return [];
|
|
10978
11147
|
}
|
|
10979
11148
|
});
|
|
10980
|
-
const [newPresetName, setNewPresetName] = (0,
|
|
10981
|
-
const [isSavingPreset, setIsSavingPreset] = (0,
|
|
11149
|
+
const [newPresetName, setNewPresetName] = (0, import_react47.useState)("");
|
|
11150
|
+
const [isSavingPreset, setIsSavingPreset] = (0, import_react47.useState)(false);
|
|
10982
11151
|
const handleSavePreset = () => {
|
|
10983
11152
|
if (!newPresetName.trim()) return;
|
|
10984
11153
|
const newPreset = {
|
|
@@ -10997,8 +11166,8 @@ function ITThemeProvider({
|
|
|
10997
11166
|
setCustomPresets(updated);
|
|
10998
11167
|
localStorage.setItem("it-theme-custom-presets", JSON.stringify(updated));
|
|
10999
11168
|
};
|
|
11000
|
-
const [resolvedTheme, setResolvedTheme] = (0,
|
|
11001
|
-
const [darkModeMode, setDarkModeMode] = (0,
|
|
11169
|
+
const [resolvedTheme, setResolvedTheme] = (0, import_react47.useState)("light");
|
|
11170
|
+
const [darkModeMode, setDarkModeMode] = (0, import_react47.useState)(
|
|
11002
11171
|
() => {
|
|
11003
11172
|
const saved = localStorage.getItem("it-theme-dark-mode");
|
|
11004
11173
|
if (saved === "light" || saved === "dark" || saved === "system") {
|
|
@@ -11007,7 +11176,7 @@ function ITThemeProvider({
|
|
|
11007
11176
|
return "system";
|
|
11008
11177
|
}
|
|
11009
11178
|
);
|
|
11010
|
-
(0,
|
|
11179
|
+
(0, import_react47.useEffect)(() => {
|
|
11011
11180
|
localStorage.setItem("it-theme-dark-mode", darkModeMode);
|
|
11012
11181
|
const applyDarkMode = (isDark) => {
|
|
11013
11182
|
if (isDark) {
|
|
@@ -11032,7 +11201,7 @@ function ITThemeProvider({
|
|
|
11032
11201
|
applyDarkMode(darkModeMode === "dark");
|
|
11033
11202
|
}
|
|
11034
11203
|
}, [darkModeMode]);
|
|
11035
|
-
(0,
|
|
11204
|
+
(0, import_react47.useEffect)(() => {
|
|
11036
11205
|
if (!showFab) {
|
|
11037
11206
|
setPaletteState({
|
|
11038
11207
|
...DEFAULT_PALETTE,
|
|
@@ -11042,7 +11211,7 @@ function ITThemeProvider({
|
|
|
11042
11211
|
});
|
|
11043
11212
|
}
|
|
11044
11213
|
}, [theme2, showFab]);
|
|
11045
|
-
(0,
|
|
11214
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
11046
11215
|
const root = document.documentElement;
|
|
11047
11216
|
const scale = typeof density === "number" && isFinite(density) ? Math.min(Math.max(density, 0.5), 1.5) : 1;
|
|
11048
11217
|
root.style.setProperty("--it-density", String(scale));
|
|
@@ -11052,12 +11221,12 @@ function ITThemeProvider({
|
|
|
11052
11221
|
root.style.fontSize = "";
|
|
11053
11222
|
};
|
|
11054
11223
|
}, [density]);
|
|
11055
|
-
(0,
|
|
11224
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
11056
11225
|
const root = document.documentElement;
|
|
11057
11226
|
root.setAttribute("data-it-appearance", appearance);
|
|
11058
11227
|
return () => root.removeAttribute("data-it-appearance");
|
|
11059
11228
|
}, [appearance]);
|
|
11060
|
-
(0,
|
|
11229
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
11061
11230
|
const root = document.documentElement;
|
|
11062
11231
|
const radiusTokens = ["xs", "sm", "md", "lg", "xl", "2xl", "3xl"];
|
|
11063
11232
|
if (typeof radius === "number" && isFinite(radius)) {
|
|
@@ -11089,7 +11258,7 @@ function ITThemeProvider({
|
|
|
11089
11258
|
surfaceStyle?.remove();
|
|
11090
11259
|
};
|
|
11091
11260
|
}, [radius, shadow]);
|
|
11092
|
-
(0,
|
|
11261
|
+
(0, import_react47.useEffect)(() => {
|
|
11093
11262
|
const injectStyles = (obj, prefix = "") => {
|
|
11094
11263
|
Object.entries(obj).forEach(([key, val]) => {
|
|
11095
11264
|
if (typeof val === "object" && val !== null) {
|
|
@@ -12243,14 +12412,14 @@ function ITThemeProvider({
|
|
|
12243
12412
|
const isNested = colorKey.includes(".");
|
|
12244
12413
|
const label = isNested ? colorKey.split(".")[1] : colorKey;
|
|
12245
12414
|
const value = getNestedValue3(palette2, colorKey);
|
|
12246
|
-
return /* @__PURE__ */ (0,
|
|
12415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
12247
12416
|
"div",
|
|
12248
12417
|
{
|
|
12249
12418
|
className: "flex items-center justify-between p-3 rounded-xl border border-slate-100 dark:border-slate-800 bg-white dark:bg-slate-900/50 gap-3 hover:border-slate-200 dark:hover:border-slate-700 transition-colors",
|
|
12250
12419
|
children: [
|
|
12251
|
-
/* @__PURE__ */ (0,
|
|
12252
|
-
/* @__PURE__ */ (0,
|
|
12253
|
-
/* @__PURE__ */ (0,
|
|
12420
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
|
|
12421
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "relative w-10 h-10 rounded-xl border-2 border-slate-200 dark:border-slate-700 overflow-hidden cursor-pointer flex-shrink-0 shadow-sm hover:scale-105 transition-transform", children: [
|
|
12422
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
12254
12423
|
"input",
|
|
12255
12424
|
{
|
|
12256
12425
|
type: "color",
|
|
@@ -12259,23 +12428,23 @@ function ITThemeProvider({
|
|
|
12259
12428
|
className: "absolute inset-0 opacity-0 cursor-pointer w-full h-full"
|
|
12260
12429
|
}
|
|
12261
12430
|
),
|
|
12262
|
-
/* @__PURE__ */ (0,
|
|
12431
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "w-full h-full", style: { backgroundColor: value } })
|
|
12263
12432
|
] }),
|
|
12264
|
-
/* @__PURE__ */ (0,
|
|
12265
|
-
/* @__PURE__ */ (0,
|
|
12266
|
-
/* @__PURE__ */ (0,
|
|
12267
|
-
/* @__PURE__ */ (0,
|
|
12433
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex flex-col min-w-0", children: [
|
|
12434
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ITText, { as: "span", className: "text-xs font-bold text-slate-700 dark:text-slate-300 truncate capitalize", children: label.replace(/([A-Z])/g, " $1").trim() }),
|
|
12435
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex items-center gap-2 mt-0.5", children: [
|
|
12436
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
12268
12437
|
"span",
|
|
12269
12438
|
{
|
|
12270
12439
|
className: "w-3 h-3 rounded-full border border-slate-200 dark:border-slate-600",
|
|
12271
12440
|
style: { backgroundColor: value }
|
|
12272
12441
|
}
|
|
12273
12442
|
),
|
|
12274
|
-
/* @__PURE__ */ (0,
|
|
12443
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ITText, { as: "span", className: "font-mono text-[11px] text-slate-400", children: value })
|
|
12275
12444
|
] })
|
|
12276
12445
|
] })
|
|
12277
12446
|
] }),
|
|
12278
|
-
/* @__PURE__ */ (0,
|
|
12447
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
12279
12448
|
"input",
|
|
12280
12449
|
{
|
|
12281
12450
|
type: "text",
|
|
@@ -12294,14 +12463,14 @@ function ITThemeProvider({
|
|
|
12294
12463
|
isCustom
|
|
12295
12464
|
}) => {
|
|
12296
12465
|
const isSelected = JSON.stringify(preset.colors) === JSON.stringify(palette2);
|
|
12297
|
-
return /* @__PURE__ */ (0,
|
|
12466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
12298
12467
|
"button",
|
|
12299
12468
|
{
|
|
12300
12469
|
type: "button",
|
|
12301
12470
|
onClick: () => applyPreset(preset.colors),
|
|
12302
12471
|
className: `relative flex flex-col items-start p-2.5 rounded-xl border text-left transition-all group ${isSelected ? "border-primary-500 bg-primary-500/5 shadow-sm ring-1 ring-primary-500/20" : "border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-900/50 hover:border-slate-300 dark:hover:border-slate-600"}`,
|
|
12303
12472
|
children: [
|
|
12304
|
-
isCustom && /* @__PURE__ */ (0,
|
|
12473
|
+
isCustom && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
12305
12474
|
"span",
|
|
12306
12475
|
{
|
|
12307
12476
|
onClick: (e) => {
|
|
@@ -12310,11 +12479,11 @@ function ITThemeProvider({
|
|
|
12310
12479
|
},
|
|
12311
12480
|
className: "absolute top-1.5 right-1.5 opacity-0 group-hover:opacity-100 p-0.5 rounded-md hover:bg-danger-500/10 hover:text-danger-500 text-slate-400 dark:text-slate-500 cursor-pointer transition-all z-10",
|
|
12312
12481
|
title: "Eliminar",
|
|
12313
|
-
children: /* @__PURE__ */ (0,
|
|
12482
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_md3.MdClose, { size: 12 })
|
|
12314
12483
|
}
|
|
12315
12484
|
),
|
|
12316
|
-
/* @__PURE__ */ (0,
|
|
12317
|
-
/* @__PURE__ */ (0,
|
|
12485
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ITText, { as: "span", className: "text-xs font-semibold truncate w-full mb-1.5 pr-4 text-slate-700 dark:text-slate-300", children: preset.name }),
|
|
12486
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "flex gap-1", children: ["primary", "secondary", "ternary", "success"].map((c) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
12318
12487
|
"span",
|
|
12319
12488
|
{
|
|
12320
12489
|
className: "w-3 h-3 rounded-full border border-black/10",
|
|
@@ -12326,7 +12495,7 @@ function ITThemeProvider({
|
|
|
12326
12495
|
}
|
|
12327
12496
|
);
|
|
12328
12497
|
};
|
|
12329
|
-
return /* @__PURE__ */ (0,
|
|
12498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
12330
12499
|
ITThemeContext.Provider,
|
|
12331
12500
|
{
|
|
12332
12501
|
value: {
|
|
@@ -12343,28 +12512,28 @@ function ITThemeProvider({
|
|
|
12343
12512
|
},
|
|
12344
12513
|
children: [
|
|
12345
12514
|
children,
|
|
12346
|
-
showFab && /* @__PURE__ */ (0,
|
|
12515
|
+
showFab && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
12347
12516
|
"button",
|
|
12348
12517
|
{
|
|
12349
12518
|
onClick: () => setIsOpen((prev) => !prev),
|
|
12350
12519
|
className: "it-theme-fab it-theme-bounce",
|
|
12351
12520
|
style: { backgroundColor: "var(--color-primary)" },
|
|
12352
12521
|
"aria-label": "Configurar Paleta de Colores",
|
|
12353
|
-
children: /* @__PURE__ */ (0,
|
|
12522
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_md3.MdPalette, { size: 28 })
|
|
12354
12523
|
}
|
|
12355
12524
|
),
|
|
12356
|
-
showFab && /* @__PURE__ */ (0,
|
|
12525
|
+
showFab && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
12357
12526
|
ITDialog,
|
|
12358
12527
|
{
|
|
12359
12528
|
isOpen,
|
|
12360
12529
|
onClose: () => setIsOpen(false),
|
|
12361
12530
|
title: "Dise\xF1ador de Temas",
|
|
12362
12531
|
useFormHeader: true,
|
|
12363
|
-
children: /* @__PURE__ */ (0,
|
|
12364
|
-
/* @__PURE__ */ (0,
|
|
12365
|
-
/* @__PURE__ */ (0,
|
|
12366
|
-
/* @__PURE__ */ (0,
|
|
12367
|
-
/* @__PURE__ */ (0,
|
|
12532
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex gap-6 h-[580px]", children: [
|
|
12533
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "w-64 flex-shrink-0 flex flex-col gap-5 overflow-y-auto pr-1", children: [
|
|
12534
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { children: [
|
|
12535
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ITText, { as: "span", className: "text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500 mb-2.5 block", children: "Apariencia" }),
|
|
12536
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
12368
12537
|
ITSegmentedControl,
|
|
12369
12538
|
{
|
|
12370
12539
|
options: [
|
|
@@ -12378,16 +12547,16 @@ function ITThemeProvider({
|
|
|
12378
12547
|
}
|
|
12379
12548
|
)
|
|
12380
12549
|
] }),
|
|
12381
|
-
/* @__PURE__ */ (0,
|
|
12382
|
-
/* @__PURE__ */ (0,
|
|
12383
|
-
/* @__PURE__ */ (0,
|
|
12550
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { children: [
|
|
12551
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "flex items-center justify-between mb-2.5", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ITText, { as: "span", className: "text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500", children: "Presets" }) }),
|
|
12552
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "grid grid-cols-2 gap-2", children: PRESETS.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(PresetCard, { preset }, preset.name)) })
|
|
12384
12553
|
] }),
|
|
12385
|
-
customPresets.length > 0 && /* @__PURE__ */ (0,
|
|
12386
|
-
/* @__PURE__ */ (0,
|
|
12387
|
-
/* @__PURE__ */ (0,
|
|
12554
|
+
customPresets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { children: [
|
|
12555
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ITText, { as: "span", className: "text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500 mb-2.5 block", children: "Mis Temas" }),
|
|
12556
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "flex flex-col gap-1.5", children: customPresets.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(PresetCard, { preset, isCustom: true }, preset.name)) })
|
|
12388
12557
|
] }),
|
|
12389
|
-
isSavingPreset && /* @__PURE__ */ (0,
|
|
12390
|
-
/* @__PURE__ */ (0,
|
|
12558
|
+
isSavingPreset && /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex flex-col gap-2 p-3 rounded-xl border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-900/50", children: [
|
|
12559
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
12391
12560
|
ITInput,
|
|
12392
12561
|
{
|
|
12393
12562
|
name: "presetName",
|
|
@@ -12405,8 +12574,8 @@ function ITThemeProvider({
|
|
|
12405
12574
|
}
|
|
12406
12575
|
}
|
|
12407
12576
|
),
|
|
12408
|
-
/* @__PURE__ */ (0,
|
|
12409
|
-
/* @__PURE__ */ (0,
|
|
12577
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex gap-2", children: [
|
|
12578
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
12410
12579
|
ITButton,
|
|
12411
12580
|
{
|
|
12412
12581
|
label: "Guardar",
|
|
@@ -12417,7 +12586,7 @@ function ITThemeProvider({
|
|
|
12417
12586
|
className: "flex-1"
|
|
12418
12587
|
}
|
|
12419
12588
|
),
|
|
12420
|
-
/* @__PURE__ */ (0,
|
|
12589
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
12421
12590
|
ITButton,
|
|
12422
12591
|
{
|
|
12423
12592
|
label: "X",
|
|
@@ -12431,31 +12600,31 @@ function ITThemeProvider({
|
|
|
12431
12600
|
)
|
|
12432
12601
|
] })
|
|
12433
12602
|
] }),
|
|
12434
|
-
!isSavingPreset && /* @__PURE__ */ (0,
|
|
12603
|
+
!isSavingPreset && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
12435
12604
|
ITButton,
|
|
12436
12605
|
{
|
|
12437
12606
|
variant: "outlined",
|
|
12438
|
-
icon: /* @__PURE__ */ (0,
|
|
12607
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_md3.MdPalette, { size: 14 }),
|
|
12439
12608
|
label: "Guardar actual",
|
|
12440
12609
|
onClick: () => setIsSavingPreset(true),
|
|
12441
12610
|
size: "sm"
|
|
12442
12611
|
}
|
|
12443
12612
|
),
|
|
12444
|
-
/* @__PURE__ */ (0,
|
|
12613
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
12445
12614
|
ITButton,
|
|
12446
12615
|
{
|
|
12447
12616
|
variant: "outlined",
|
|
12448
12617
|
color: "danger",
|
|
12449
|
-
icon: /* @__PURE__ */ (0,
|
|
12618
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_md3.MdRefresh, { size: 14 }),
|
|
12450
12619
|
label: "Restaurar default",
|
|
12451
12620
|
onClick: resetTheme,
|
|
12452
12621
|
size: "sm"
|
|
12453
12622
|
}
|
|
12454
12623
|
)
|
|
12455
12624
|
] }),
|
|
12456
|
-
/* @__PURE__ */ (0,
|
|
12457
|
-
/* @__PURE__ */ (0,
|
|
12458
|
-
/* @__PURE__ */ (0,
|
|
12625
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ITDivider, { orientation: "vertical" }),
|
|
12626
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex-1 flex flex-col min-w-0", children: [
|
|
12627
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
12459
12628
|
tabs_default,
|
|
12460
12629
|
{
|
|
12461
12630
|
variant: "pill",
|
|
@@ -12463,7 +12632,7 @@ function ITThemeProvider({
|
|
|
12463
12632
|
{
|
|
12464
12633
|
id: "brand",
|
|
12465
12634
|
label: "Marca",
|
|
12466
|
-
content: /* @__PURE__ */ (0,
|
|
12635
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 max-h-[480px] overflow-y-auto pr-2 mt-3", children: [
|
|
12467
12636
|
"primary",
|
|
12468
12637
|
"secondary",
|
|
12469
12638
|
"ternary",
|
|
@@ -12472,35 +12641,35 @@ function ITThemeProvider({
|
|
|
12472
12641
|
"info",
|
|
12473
12642
|
"alert",
|
|
12474
12643
|
"warning"
|
|
12475
|
-
].map((key) => /* @__PURE__ */ (0,
|
|
12644
|
+
].map((key) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ColorRow, { colorKey: key }, key)) })
|
|
12476
12645
|
},
|
|
12477
12646
|
{
|
|
12478
12647
|
id: "layout",
|
|
12479
12648
|
label: "Nav & Sidebar",
|
|
12480
|
-
content: /* @__PURE__ */ (0,
|
|
12649
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 max-h-[480px] overflow-y-auto pr-2 mt-3", children: [
|
|
12481
12650
|
"layout.sidebarBg",
|
|
12482
12651
|
"layout.sidebarText",
|
|
12483
12652
|
"layout.navbarBg",
|
|
12484
12653
|
"layout.navbarText"
|
|
12485
|
-
].map((key) => /* @__PURE__ */ (0,
|
|
12654
|
+
].map((key) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ColorRow, { colorKey: key }, key)) })
|
|
12486
12655
|
},
|
|
12487
12656
|
{
|
|
12488
12657
|
id: "tables",
|
|
12489
12658
|
label: "Tablas",
|
|
12490
|
-
content: /* @__PURE__ */ (0,
|
|
12659
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 max-h-[480px] overflow-y-auto pr-2 mt-3", children: [
|
|
12491
12660
|
"table.headerBg",
|
|
12492
12661
|
"table.headerText",
|
|
12493
12662
|
"table.rowBg",
|
|
12494
12663
|
"table.rowText",
|
|
12495
12664
|
"table.rowHover"
|
|
12496
|
-
].map((key) => /* @__PURE__ */ (0,
|
|
12665
|
+
].map((key) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ColorRow, { colorKey: key }, key)) })
|
|
12497
12666
|
}
|
|
12498
12667
|
]
|
|
12499
12668
|
}
|
|
12500
12669
|
),
|
|
12501
|
-
/* @__PURE__ */ (0,
|
|
12502
|
-
/* @__PURE__ */ (0,
|
|
12503
|
-
/* @__PURE__ */ (0,
|
|
12670
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex items-center justify-end gap-3 mt-auto pt-4 border-t border-slate-100 dark:border-slate-800", children: [
|
|
12671
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ITText, { as: "p", className: "text-[11px] text-slate-400 mr-auto", children: "Los cambios se guardan autom\xE1ticamente" }),
|
|
12672
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
12504
12673
|
ITButton,
|
|
12505
12674
|
{
|
|
12506
12675
|
label: "Cerrar",
|
|
@@ -12561,6 +12730,7 @@ var createValidationSchema = (fields) => Yup.object().shape(
|
|
|
12561
12730
|
ITInput,
|
|
12562
12731
|
ITInputNumber,
|
|
12563
12732
|
ITLayout,
|
|
12733
|
+
ITLineBarChart,
|
|
12564
12734
|
ITLoader,
|
|
12565
12735
|
ITMaskedInput,
|
|
12566
12736
|
ITMultiSelect,
|