@axzydev/axzy_ui_system 1.2.6 → 1.2.8
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 +777 -535
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +1470 -87
- package/dist/index.d.ts +1470 -87
- package/dist/index.js +799 -555
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/App.tsx +19 -54
- package/src/components/alert/alert.doc.mdx +48 -0
- package/src/components/alert/alert.props.ts +7 -0
- package/src/components/alert/alert.tsx +8 -0
- package/src/components/avatar/avatar.doc.mdx +48 -0
- package/src/components/avatar/avatar.props.ts +8 -0
- package/src/components/avatar/avatar.tsx +25 -5
- package/src/components/badget/badget.doc.mdx +46 -0
- package/src/components/badget/badget.props.ts +6 -0
- package/src/components/badget/badget.tsx +11 -0
- package/src/components/breadcrumbs/breadcrumbs.doc.mdx +57 -0
- package/src/components/breadcrumbs/breadcrumbs.props.ts +6 -0
- package/src/components/breadcrumbs/breadcrumbs.tsx +12 -0
- package/src/components/button/button.doc.mdx +59 -0
- package/src/components/button/button.props.ts +12 -0
- package/src/components/button/button.tsx +11 -0
- package/src/components/calendar/calendar.doc.mdx +75 -0
- package/src/components/calendar/calendar.props.ts +27 -7
- package/src/components/calendar/calendar.tsx +13 -0
- package/src/components/card/card.doc.mdx +54 -0
- package/src/components/card/card.props.ts +11 -0
- package/src/components/card/card.tsx +13 -0
- package/src/components/checkbox/checkbox.doc.mdx +54 -0
- package/src/components/checkbox/checkbox.props.ts +7 -0
- package/src/components/checkbox/checkbox.tsx +9 -0
- package/src/components/confirm-dialog/confirm-dialog.doc.mdx +60 -0
- package/src/components/confirm-dialog/confirm-dialog.props.ts +9 -0
- package/src/components/confirm-dialog/confirm-dialog.tsx +19 -0
- package/src/components/data-table/ITDataTable.doc.mdx +59 -0
- package/src/components/data-table/dataTable.props.ts +15 -0
- package/src/components/data-table/dataTable.tsx +178 -73
- package/src/components/date-picker/date-picker.doc.mdx +65 -0
- package/src/components/date-picker/date-picker.props.ts +17 -0
- package/src/components/date-picker/datePicker.tsx +31 -1
- package/src/components/dialog/dialog.doc.mdx +54 -0
- package/src/components/dialog/dialog.props.ts +7 -0
- package/src/components/dialog/dialog.tsx +26 -0
- package/src/components/divider/divider.doc.mdx +42 -0
- package/src/components/divider/divider.props.ts +5 -0
- package/src/components/divider/divider.tsx +16 -0
- package/src/components/drawer/drawer.doc.mdx +59 -0
- package/src/components/drawer/drawer.props.ts +9 -0
- package/src/components/drawer/drawer.tsx +20 -0
- package/src/components/dropfile/dropfile.doc.mdx +59 -0
- package/src/components/dropfile/dropfile.props.ts +41 -0
- package/src/components/dropfile/dropfile.tsx +21 -33
- package/src/components/empty-state/empty-state.doc.mdx +50 -0
- package/src/components/empty-state/empty-state.props.ts +5 -0
- package/src/components/empty-state/empty-state.tsx +16 -0
- package/src/components/flex/flex.doc.mdx +59 -0
- package/src/components/flex/flex.props.ts +13 -0
- package/src/components/flex/flex.tsx +15 -0
- package/src/components/form-builder/fieldRenderer.tsx +52 -2
- package/src/components/form-builder/formBuilder.doc.mdx +124 -0
- package/src/components/form-builder/formBuilder.props.ts +12 -2
- package/src/components/form-builder/formBuilder.tsx +31 -0
- package/src/components/form-header/form-header.doc.mdx +38 -0
- package/src/components/form-header/form-header.props.ts +3 -0
- package/src/components/form-header/form-header.stories.tsx +53 -0
- package/src/components/form-header/form-header.tsx +11 -0
- package/src/components/grid/grid.doc.mdx +54 -0
- package/src/components/grid/grid.props.ts +13 -0
- package/src/components/grid/grid.tsx +26 -2
- package/src/components/image/image.doc.mdx +44 -0
- package/src/components/image/image.props.ts +5 -0
- package/src/components/image/image.stories.tsx +49 -0
- package/src/components/image/image.tsx +19 -0
- package/src/components/input/input.doc.mdx +70 -0
- package/src/components/input/input.props.ts +34 -2
- package/src/components/input/input.tsx +29 -0
- package/src/components/layout/layout.doc.mdx +51 -0
- package/src/components/layout/layout.props.ts +5 -0
- package/src/components/layout/layout.tsx +41 -17
- package/src/components/loader/loader.doc.mdx +43 -0
- package/src/components/loader/loader.props.ts +4 -0
- package/src/components/loader/loader.tsx +17 -0
- package/src/components/navbar/navbar.doc.mdx +77 -0
- package/src/components/navbar/navbar.props.ts +37 -1
- package/src/components/navbar/navbar.stories.tsx +84 -0
- package/src/components/navbar/navbar.tsx +78 -46
- package/src/components/page/page.doc.mdx +80 -0
- package/src/components/page/page.props.ts +25 -0
- package/src/components/page/page.tsx +35 -7
- package/src/components/page-header/page-header.doc.mdx +54 -0
- package/src/components/page-header/page-header.props.ts +11 -0
- package/src/components/page-header/page-header.stories.tsx +14 -0
- package/src/components/page-header/page-header.tsx +50 -15
- package/src/components/pagination/pagination.doc.mdx +62 -0
- package/src/components/pagination/pagination.props.ts +11 -32
- package/src/components/pagination/pagination.tsx +17 -0
- package/src/components/popover/popover.doc.mdx +53 -0
- package/src/components/popover/popover.props.ts +8 -0
- package/src/components/popover/popover.tsx +13 -0
- package/src/components/progress/progress.doc.mdx +48 -0
- package/src/components/progress/progress.props.ts +8 -0
- package/src/components/progress/progress.tsx +9 -0
- package/src/components/radio/radio.doc.mdx +62 -0
- package/src/components/radio/radio.props.ts +11 -0
- package/src/components/radio/radio.tsx +18 -0
- package/src/components/search-select/search-select.doc.mdx +72 -0
- package/src/components/search-select/search-select.props.ts +23 -18
- package/src/components/search-select/search-select.tsx +27 -2
- package/src/components/searchTable/searchTable.doc.mdx +79 -0
- package/src/components/searchTable/searchTable.props.ts +42 -3
- package/src/components/searchTable/searchTable.stories.tsx +74 -0
- package/src/components/searchTable/searchTable.tsx +23 -0
- package/src/components/segmented-control/segmented-control.doc.mdx +60 -0
- package/src/components/segmented-control/segmented-control.props.ts +12 -0
- package/src/components/segmented-control/segmented-control.tsx +15 -0
- package/src/components/select/select.doc.mdx +75 -0
- package/src/components/select/select.props.ts +22 -0
- package/src/components/select/select.tsx +2 -5
- package/src/components/sidebar/sidebar.doc.mdx +86 -0
- package/src/components/sidebar/sidebar.props.ts +22 -0
- package/src/components/sidebar/sidebar.tsx +22 -0
- package/src/components/skeleton/skeleton.doc.mdx +43 -0
- package/src/components/skeleton/skeleton.props.ts +8 -0
- package/src/components/skeleton/skeleton.tsx +10 -0
- package/src/components/slide/slide.doc.mdx +46 -0
- package/src/components/slide/slide.props.ts +11 -24
- package/src/components/slide/slide.tsx +10 -1
- package/src/components/slider/slider.doc.mdx +49 -0
- package/src/components/slider/slider.props.ts +9 -0
- package/src/components/slider/slider.tsx +15 -0
- package/src/components/stack/stack.doc.mdx +126 -0
- package/src/components/stack/stack.props.ts +18 -0
- package/src/components/stack/stack.stories.tsx +221 -16
- package/src/components/stack/stack.tsx +21 -0
- package/src/components/stat-card/stat-card.doc.mdx +48 -0
- package/src/components/stat-card/stat-card.props.ts +9 -0
- package/src/components/stat-card/stat-card.tsx +10 -0
- package/src/components/stepper/stepper.doc.mdx +54 -0
- package/src/components/stepper/stepper.props.ts +11 -1
- package/src/components/stepper/stepper.tsx +15 -0
- package/src/components/table/table.doc.mdx +58 -0
- package/src/components/table/table.props.ts +17 -0
- package/src/components/table/table.tsx +199 -84
- package/src/components/tabs/tabs.doc.mdx +52 -0
- package/src/components/tabs/tabs.props.ts +11 -0
- package/src/components/tabs/tabs.tsx +14 -0
- package/src/components/text/text.doc.mdx +41 -0
- package/src/components/text/text.props.ts +5 -0
- package/src/components/text/text.stories.tsx +67 -0
- package/src/components/text/text.tsx +10 -0
- package/src/components/textarea/textarea.doc.mdx +64 -0
- package/src/components/textarea/textarea.props.ts +11 -0
- package/src/components/textarea/textarea.tsx +16 -0
- package/src/components/theme-provider/themeProvider.doc.mdx +75 -0
- package/src/components/theme-provider/themeProvider.props.ts +3 -0
- package/src/components/theme-provider/themeProvider.stories.tsx +59 -0
- package/src/components/theme-provider/themeProvider.tsx +14 -0
- package/src/components/time-picker/timePicker.doc.mdx +68 -0
- package/src/components/time-picker/timePicker.props.ts +14 -0
- package/src/components/time-picker/timePicker.tsx +22 -1
- package/src/components/toast/toast.doc.mdx +50 -0
- package/src/components/toast/toast.props.ts +5 -0
- package/src/components/toast/toast.tsx +21 -0
- package/src/components/tooltip/tooltip.doc.mdx +47 -0
- package/src/components/tooltip/tooltip.props.ts +6 -0
- package/src/components/tooltip/tooltip.tsx +19 -0
- package/src/components/topbar/topbar.doc.mdx +69 -0
- package/src/components/topbar/topbar.props.ts +15 -0
- package/src/components/topbar/topbar.tsx +38 -0
- package/src/components/triple-filter/tripleFilter.doc.mdx +62 -0
- package/src/components/triple-filter/tripleFilter.props.ts +7 -0
- package/src/components/triple-filter/tripleFilter.tsx +32 -0
- package/src/index.css +17 -0
- package/src/showcases/DataShowcases.tsx +529 -45
- package/src/showcases/FormShowcases.tsx +399 -29
- package/src/showcases/HomeShowcase.tsx +252 -272
- package/src/showcases/LayoutPrimitivesShowcases.tsx +1224 -248
- package/src/showcases/PageShowcases.tsx +868 -151
- package/src/showcases/ShowcaseLayout.tsx +237 -73
- package/src/showcases/StructureShowcases.tsx +1039 -97
- package/src/types/table.types.ts +1 -1
- package/src/utils/styles.ts +2 -1
package/dist/index.cjs
CHANGED
|
@@ -440,21 +440,31 @@ var sizeMap = {
|
|
|
440
440
|
lg: { container: "w-12 h-12", text: "text-base" },
|
|
441
441
|
xl: { container: "w-16 h-16", text: "text-xl" }
|
|
442
442
|
};
|
|
443
|
+
var DEFAULT_COLOR = "bg-primary-600";
|
|
444
|
+
var DEFAULT_BG = "var(--color-primary-600)";
|
|
445
|
+
var DEFAULT_SHADOW = "0 4px 14px 0 rgba(37, 99, 235, 0.35)";
|
|
443
446
|
function ITAvatar({
|
|
444
447
|
src,
|
|
445
448
|
alt = "",
|
|
446
449
|
initials,
|
|
447
450
|
size = "md",
|
|
448
|
-
color =
|
|
451
|
+
color = DEFAULT_COLOR,
|
|
449
452
|
className,
|
|
450
453
|
badge,
|
|
451
454
|
onClick
|
|
452
455
|
}) {
|
|
453
456
|
const { container, text } = sizeMap[size];
|
|
457
|
+
const useInlineStyle = !color || color === DEFAULT_COLOR;
|
|
454
458
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
455
459
|
"div",
|
|
456
460
|
{
|
|
457
|
-
className: (0, import_clsx2.default)(
|
|
461
|
+
className: (0, import_clsx2.default)(
|
|
462
|
+
"relative inline-flex items-center justify-center rounded-full flex-shrink-0 overflow-hidden text-white font-bold tracking-wide",
|
|
463
|
+
container,
|
|
464
|
+
!useInlineStyle && color,
|
|
465
|
+
className
|
|
466
|
+
),
|
|
467
|
+
style: useInlineStyle ? { backgroundColor: DEFAULT_BG, boxShadow: DEFAULT_SHADOW } : void 0,
|
|
458
468
|
onClick,
|
|
459
469
|
role: onClick ? "button" : void 0,
|
|
460
470
|
tabIndex: onClick ? 0 : void 0,
|
|
@@ -469,7 +479,7 @@ function ITAvatar({
|
|
|
469
479
|
e.currentTarget.style.display = "none";
|
|
470
480
|
}
|
|
471
481
|
}
|
|
472
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("
|
|
482
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: (0, import_clsx2.default)("flex items-center justify-center w-full h-full", text), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ITText, { as: "span", className: "text-white", children: initials || alt.charAt(0).toUpperCase() || "?" }) }),
|
|
473
483
|
badge && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "absolute -bottom-0.5 -right-0.5", children: badge })
|
|
474
484
|
]
|
|
475
485
|
}
|
|
@@ -1812,7 +1822,7 @@ function ITConfirmDialog({
|
|
|
1812
1822
|
// src/types/table.types.ts
|
|
1813
1823
|
var variantStyles = {
|
|
1814
1824
|
default: "",
|
|
1815
|
-
striped: "
|
|
1825
|
+
striped: "",
|
|
1816
1826
|
bordered: "border border-gray-200"
|
|
1817
1827
|
};
|
|
1818
1828
|
var sizeStyles = {
|
|
@@ -1855,6 +1865,7 @@ function getGridColsClass(columns) {
|
|
|
1855
1865
|
return gridColsClasses[columns] || "grid-cols-12";
|
|
1856
1866
|
}
|
|
1857
1867
|
function getColSpanClass(span, maxCols) {
|
|
1868
|
+
if (span == null) return `col-span-${maxCols}`;
|
|
1858
1869
|
if (typeof span === "number") {
|
|
1859
1870
|
return `col-span-${Math.min(span, maxCols)}`;
|
|
1860
1871
|
}
|
|
@@ -2405,8 +2416,8 @@ function ITSelect({
|
|
|
2405
2416
|
borderStyle: "solid",
|
|
2406
2417
|
transition: "all 0.2s",
|
|
2407
2418
|
color: "var(--input-text-color, var(--color-secondary-900))",
|
|
2408
|
-
appearance: "none"
|
|
2409
|
-
|
|
2419
|
+
appearance: "none",
|
|
2420
|
+
colorScheme: "light dark"
|
|
2410
2421
|
};
|
|
2411
2422
|
if (disabled) {
|
|
2412
2423
|
style.backgroundColor = inputTheme.disabled?.backgroundColor || style.backgroundColor;
|
|
@@ -2684,8 +2695,13 @@ function ITTable({
|
|
|
2684
2695
|
size = "md",
|
|
2685
2696
|
itemsPerPageOptions = [5, 10, 20],
|
|
2686
2697
|
defaultItemsPerPage = 10,
|
|
2687
|
-
title
|
|
2698
|
+
title,
|
|
2699
|
+
renderCard,
|
|
2700
|
+
defaultView = "table",
|
|
2701
|
+
showVerticalBorder = true,
|
|
2702
|
+
verticalBorderClassname
|
|
2688
2703
|
}) {
|
|
2704
|
+
const [viewMode, setViewMode] = (0, import_react11.useState)(defaultView);
|
|
2689
2705
|
const {
|
|
2690
2706
|
currentPage,
|
|
2691
2707
|
itemsPerPage,
|
|
@@ -2885,25 +2901,91 @@ function ITTable({
|
|
|
2885
2901
|
return value;
|
|
2886
2902
|
}
|
|
2887
2903
|
};
|
|
2904
|
+
const renderDefaultCard = (row) => {
|
|
2905
|
+
const dataCols = columns.filter((c) => c.type !== "actions");
|
|
2906
|
+
const actionCol = columns.find((c) => c.type === "actions");
|
|
2907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.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: [
|
|
2908
|
+
dataCols.map((col) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2909
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-[10px] font-bold uppercase tracking-wider text-slate-400 whitespace-nowrap flex-shrink-0 min-w-[70px]", children: col.label }),
|
|
2910
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-sm font-medium text-slate-800 dark:text-white text-right truncate", children: renderCellContent(col, row) })
|
|
2911
|
+
] }, col.key)),
|
|
2912
|
+
actionCol?.actions && /* @__PURE__ */ (0, import_jsx_runtime14.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) })
|
|
2913
|
+
] });
|
|
2914
|
+
};
|
|
2888
2915
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: (0, import_clsx14.default)("space-y-4 w-full", containerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "rounded-xl shadow-sm overflow-hidden", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
|
|
2889
|
-
title && /* @__PURE__ */ (0, import_jsx_runtime14.
|
|
2890
|
-
|
|
2916
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "px-6 py-5 flex items-center justify-between", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
|
|
2917
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ITText, { as: "h2", className: "text-xl font-bold text-secondary-900 leading-tight", children: title }),
|
|
2918
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.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: [
|
|
2919
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2920
|
+
"button",
|
|
2921
|
+
{
|
|
2922
|
+
onClick: () => setViewMode("table"),
|
|
2923
|
+
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${viewMode === "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"}`,
|
|
2924
|
+
children: [
|
|
2925
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_fa7.FaTable, { size: 11 }),
|
|
2926
|
+
"Table"
|
|
2927
|
+
]
|
|
2928
|
+
}
|
|
2929
|
+
),
|
|
2930
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2931
|
+
"button",
|
|
2932
|
+
{
|
|
2933
|
+
onClick: () => setViewMode("cards"),
|
|
2934
|
+
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${viewMode === "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"}`,
|
|
2935
|
+
children: [
|
|
2936
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_fa7.FaThLarge, { size: 11 }),
|
|
2937
|
+
"Cards"
|
|
2938
|
+
]
|
|
2939
|
+
}
|
|
2940
|
+
)
|
|
2941
|
+
] })
|
|
2942
|
+
] }),
|
|
2943
|
+
!title && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex justify-end px-4 pt-3", children: /* @__PURE__ */ (0, import_jsx_runtime14.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: [
|
|
2944
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2945
|
+
"button",
|
|
2946
|
+
{
|
|
2947
|
+
onClick: () => setViewMode("table"),
|
|
2948
|
+
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${viewMode === "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"}`,
|
|
2949
|
+
children: [
|
|
2950
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_fa7.FaTable, { size: 11 }),
|
|
2951
|
+
"Table"
|
|
2952
|
+
]
|
|
2953
|
+
}
|
|
2954
|
+
),
|
|
2955
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2956
|
+
"button",
|
|
2957
|
+
{
|
|
2958
|
+
onClick: () => setViewMode("cards"),
|
|
2959
|
+
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${viewMode === "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"}`,
|
|
2960
|
+
children: [
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_fa7.FaThLarge, { size: 11 }),
|
|
2962
|
+
"Cards"
|
|
2963
|
+
]
|
|
2964
|
+
}
|
|
2965
|
+
)
|
|
2966
|
+
] }) }),
|
|
2967
|
+
viewMode === "cards" ? /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)("div", { children: renderCard ? renderCard(row) : renderDefaultCard(row) }, i)) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-secondary-400", children: [
|
|
2968
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
|
|
2969
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
|
|
2970
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2891
2971
|
"table",
|
|
2892
2972
|
{
|
|
2893
2973
|
className: (0, import_clsx14.default)(
|
|
2894
2974
|
"min-w-max w-full text-sm text-left text-secondary-600",
|
|
2975
|
+
showVerticalBorder && "[&_th]:border-r [&_th:last-child]:border-r-0 [&_td]:border-r [&_td:last-child]:border-r-0",
|
|
2976
|
+
showVerticalBorder && (verticalBorderClassname || "[&_th]:border-slate-100 dark:[&_th]:border-slate-700/30 [&_td]:border-slate-100 dark:[&_td]:border-slate-700/30"),
|
|
2895
2977
|
variantStyles[variant],
|
|
2896
2978
|
sizeStyles[size]
|
|
2897
2979
|
),
|
|
2898
2980
|
children: [
|
|
2899
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tr", { className: "bg-secondary-50
|
|
2981
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tr", { className: "bg-secondary-50 text-xs uppercase tracking-wider font-semibold text-slate-700 dark:text-slate-200", children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2900
2982
|
"th",
|
|
2901
2983
|
{
|
|
2902
2984
|
scope: "col",
|
|
2903
2985
|
className: (0, import_clsx14.default)("px-4 py-4 align-top", col.className),
|
|
2904
2986
|
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col gap-3 min-w-[150px]", children: [
|
|
2905
2987
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2906
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ITText, { as: "span", className: "text-
|
|
2988
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ITText, { as: "span", className: "text-slate-900 dark:text-white font-bold", children: col.label }),
|
|
2907
2989
|
col.sortable && col.type !== "actions" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2908
2990
|
"button",
|
|
2909
2991
|
{
|
|
@@ -2919,10 +3001,10 @@ function ITTable({
|
|
|
2919
3001
|
},
|
|
2920
3002
|
col.key
|
|
2921
3003
|
)) }) }),
|
|
2922
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tbody", { className: "divide-y divide-
|
|
3004
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tbody", { className: "divide-y divide-slate-100 dark:divide-slate-700/30", children: currentData.length > 0 ? currentData.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2923
3005
|
"tr",
|
|
2924
3006
|
{
|
|
2925
|
-
className: "hover:bg-secondary-50/50 transition-colors duration-150 group",
|
|
3007
|
+
className: (0, import_clsx14.default)("hover:bg-secondary-50/50 transition-colors duration-150 group", variant === "striped" && "odd:bg-secondary-50/40 dark:odd:bg-slate-800/20"),
|
|
2926
3008
|
children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2927
3009
|
"td",
|
|
2928
3010
|
{
|
|
@@ -2940,7 +3022,7 @@ function ITTable({
|
|
|
2940
3022
|
]
|
|
2941
3023
|
}
|
|
2942
3024
|
) }),
|
|
2943
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "rounded-b-xl
|
|
3025
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "rounded-b-xl px-6 py-4", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2944
3026
|
ITPagination,
|
|
2945
3027
|
{
|
|
2946
3028
|
currentPage,
|
|
@@ -2976,8 +3058,13 @@ function ITDataTable({
|
|
|
2976
3058
|
size = "md",
|
|
2977
3059
|
itemsPerPageOptions = [5, 10, 20],
|
|
2978
3060
|
defaultItemsPerPage = 10,
|
|
2979
|
-
title
|
|
3061
|
+
title,
|
|
3062
|
+
renderCard,
|
|
3063
|
+
defaultView,
|
|
3064
|
+
showVerticalBorder = true,
|
|
3065
|
+
verticalBorderClassname
|
|
2980
3066
|
}) {
|
|
3067
|
+
const [viewMode, setViewMode] = (0, import_react12.useState)(defaultView || "table");
|
|
2981
3068
|
const [data, setData] = (0, import_react12.useState)([]);
|
|
2982
3069
|
const [totalItems, setTotalItems] = (0, import_react12.useState)(0);
|
|
2983
3070
|
const [isLoading, setIsLoading] = (0, import_react12.useState)(fetchOnMount);
|
|
@@ -3121,31 +3208,70 @@ function ITDataTable({
|
|
|
3121
3208
|
return value;
|
|
3122
3209
|
}
|
|
3123
3210
|
};
|
|
3211
|
+
const renderDefaultCard = (row) => {
|
|
3212
|
+
const dataCols = columns.filter((c) => c.type !== "actions");
|
|
3213
|
+
const actionCol = columns.find((c) => c.type === "actions");
|
|
3214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.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: [
|
|
3215
|
+
dataCols.map((col) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
3216
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-[10px] font-bold uppercase tracking-wider text-slate-400 whitespace-nowrap flex-shrink-0 min-w-[70px]", children: col.label }),
|
|
3217
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "text-sm font-medium text-slate-800 dark:text-white text-right truncate", children: renderCellContent(col, row) })
|
|
3218
|
+
] }, col.key)),
|
|
3219
|
+
actionCol?.actions && /* @__PURE__ */ (0, import_jsx_runtime15.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) })
|
|
3220
|
+
] });
|
|
3221
|
+
};
|
|
3222
|
+
const segCtrlClass = (mode) => `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${viewMode === mode ? "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"}`;
|
|
3124
3223
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: (0, import_clsx15.default)("space-y-4 w-full relative", containerClassName), children: [
|
|
3125
3224
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "rounded-xl shadow-sm overflow-hidden", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
|
|
3126
|
-
title && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "px-6 py-5
|
|
3225
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "px-6 py-5 flex items-center justify-between", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
|
|
3127
3226
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ITText, { as: "h2", className: "text-xl font-bold text-secondary-900 leading-tight", children: title }),
|
|
3128
|
-
|
|
3227
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
3228
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "text-secondary-400", children: loadingIndicator || /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_fa8.FaSpinner, { className: "animate-spin text-primary-500 text-xl" }) }),
|
|
3229
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.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: [
|
|
3230
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { onClick: () => setViewMode("table"), className: segCtrlClass("table"), children: [
|
|
3231
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_fa8.FaTable, { size: 11 }),
|
|
3232
|
+
"Table"
|
|
3233
|
+
] }),
|
|
3234
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { onClick: () => setViewMode("cards"), className: segCtrlClass("cards"), children: [
|
|
3235
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_fa8.FaThLarge, { size: 11 }),
|
|
3236
|
+
"Cards"
|
|
3237
|
+
] })
|
|
3238
|
+
] })
|
|
3239
|
+
] })
|
|
3129
3240
|
] }),
|
|
3241
|
+
!title && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex justify-end px-4 pt-3", children: /* @__PURE__ */ (0, import_jsx_runtime15.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: [
|
|
3242
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { onClick: () => setViewMode("table"), className: segCtrlClass("table"), children: [
|
|
3243
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_fa8.FaTable, { size: 11 }),
|
|
3244
|
+
"Table"
|
|
3245
|
+
] }),
|
|
3246
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { onClick: () => setViewMode("cards"), className: segCtrlClass("cards"), children: [
|
|
3247
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_fa8.FaThLarge, { size: 11 }),
|
|
3248
|
+
"Cards"
|
|
3249
|
+
] })
|
|
3250
|
+
] }) }),
|
|
3130
3251
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "overflow-x-auto relative min-h-[200px]", children: [
|
|
3131
3252
|
isLoading && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "absolute inset-0 z-20 flex items-center justify-center bg-white/40 backdrop-blur-[2px] transition-all duration-300", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-col items-center gap-3 p-6 rounded-2xl shadow-xl border border-secondary-100 animate-in fade-in zoom-in duration-300", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: loadingIndicator || /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
3132
3253
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_fa8.FaSpinner, { className: "animate-spin text-primary-500 text-4xl" }),
|
|
3133
3254
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ITText, { as: "span", className: "text-sm font-semibold text-secondary-600 animate-pulse", children: "Cargando datos..." })
|
|
3134
3255
|
] }) }) }),
|
|
3135
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3256
|
+
viewMode === "cards" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "p-4 space-y-3 max-h-[400px] overflow-y-auto", children: data.length > 0 ? data.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: renderCard ? renderCard(row) : renderDefaultCard(row) }, i)) : !isLoading && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-secondary-400", children: [
|
|
3257
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
|
|
3258
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
|
|
3259
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3136
3260
|
"table",
|
|
3137
3261
|
{
|
|
3138
3262
|
className: (0, import_clsx15.default)(
|
|
3139
3263
|
"min-w-max w-full text-sm text-left text-secondary-600 transition-opacity duration-300",
|
|
3264
|
+
showVerticalBorder && "[&_th]:border-r [&_th:last-child]:border-r-0 [&_td]:border-r [&_td:last-child]:border-r-0",
|
|
3265
|
+
showVerticalBorder && (verticalBorderClassname || "[&_th]:border-slate-100 dark:[&_th]:border-slate-700/30 [&_td]:border-slate-100 dark:[&_td]:border-slate-700/30"),
|
|
3140
3266
|
isLoading ? "opacity-50" : "opacity-100",
|
|
3141
3267
|
variantStyles[variant],
|
|
3142
3268
|
sizeStyles[size],
|
|
3143
3269
|
className
|
|
3144
3270
|
),
|
|
3145
3271
|
children: [
|
|
3146
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tr", { className: "bg-
|
|
3272
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tr", { className: "bg-secondary-50 text-xs uppercase tracking-wider font-semibold text-slate-700 dark:text-slate-200", children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("th", { scope: "col", className: (0, import_clsx15.default)("px-4 py-4 align-top", col.className), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col gap-3 min-w-[150px]", children: [
|
|
3147
3273
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
3148
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ITText, { as: "span", className: "text-
|
|
3274
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ITText, { as: "span", className: "text-slate-900 dark:text-white font-bold", children: col.label }),
|
|
3149
3275
|
col.sortable && col.type !== "actions" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3150
3276
|
"button",
|
|
3151
3277
|
{
|
|
@@ -3159,7 +3285,7 @@ function ITDataTable({
|
|
|
3159
3285
|
] }),
|
|
3160
3286
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "w-full", children: col.filter ? renderFilterInput(col) : null })
|
|
3161
3287
|
] }) }, col.key)) }) }),
|
|
3162
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tbody", { className: "divide-y divide-
|
|
3288
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tbody", { className: "divide-y divide-slate-100 dark:divide-slate-700/30", children: data.length > 0 ? data.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tr", { className: (0, import_clsx15.default)("hover:bg-secondary-50/50 transition-colors duration-150 group", variant === "striped" && "odd:bg-secondary-50/40 dark:odd:bg-slate-800/20"), children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: (0, import_clsx15.default)("px-4 py-3 align-middle", col.className), children: col.type === "actions" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex items-center justify-center gap-2", children: renderCellContent(col, row) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "text-secondary-700 font-medium", children: renderCellContent(col, row) }) }, `${rowIndex}-${col.key}`)) }, rowIndex)) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { colSpan: columns.length, className: "px-6 py-12 text-center", children: !isLoading && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col items-center justify-center text-secondary-400", children: [
|
|
3163
3289
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
|
|
3164
3290
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
|
|
3165
3291
|
] }) }) }) })
|
|
@@ -3168,7 +3294,7 @@ function ITDataTable({
|
|
|
3168
3294
|
)
|
|
3169
3295
|
] })
|
|
3170
3296
|
] }),
|
|
3171
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "rounded-b-xl
|
|
3297
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "rounded-b-xl px-6 py-4", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
3172
3298
|
ITPagination,
|
|
3173
3299
|
{
|
|
3174
3300
|
currentPage,
|
|
@@ -3394,7 +3520,7 @@ function ITDatePicker({
|
|
|
3394
3520
|
import_fa9.FaCalendarAlt,
|
|
3395
3521
|
{
|
|
3396
3522
|
onClick: handleIconClick,
|
|
3397
|
-
className: "text-slate-
|
|
3523
|
+
className: "text-slate-500 dark:text-slate-400 cursor-pointer"
|
|
3398
3524
|
}
|
|
3399
3525
|
) }),
|
|
3400
3526
|
variant,
|
|
@@ -5642,7 +5768,7 @@ function ITFlex({
|
|
|
5642
5768
|
}
|
|
5643
5769
|
|
|
5644
5770
|
// src/components/form-builder/formBuilder.tsx
|
|
5645
|
-
var
|
|
5771
|
+
var import_react23 = require("react");
|
|
5646
5772
|
|
|
5647
5773
|
// src/components/form-builder/formBuilder.context.tsx
|
|
5648
5774
|
var import_react18 = __toESM(require("react"), 1);
|
|
@@ -5686,8 +5812,8 @@ var useITFormBuilderContext = () => {
|
|
|
5686
5812
|
};
|
|
5687
5813
|
|
|
5688
5814
|
// src/components/form-builder/fieldRenderer.tsx
|
|
5689
|
-
var
|
|
5690
|
-
var
|
|
5815
|
+
var import_react22 = require("react");
|
|
5816
|
+
var import_clsx25 = __toESM(require("clsx"), 1);
|
|
5691
5817
|
|
|
5692
5818
|
// src/components/time-picker/timePicker.tsx
|
|
5693
5819
|
var import_clsx23 = __toESM(require("clsx"), 1);
|
|
@@ -5849,7 +5975,7 @@ function ITTimePicker({
|
|
|
5849
5975
|
},
|
|
5850
5976
|
className: (0, import_clsx23.default)(
|
|
5851
5977
|
"cursor-pointer transition-colors",
|
|
5852
|
-
disabled ? "text-slate-400 cursor-not-allowed" : "text-slate-
|
|
5978
|
+
disabled ? "text-slate-400 cursor-not-allowed" : "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"
|
|
5853
5979
|
)
|
|
5854
5980
|
}
|
|
5855
5981
|
)
|
|
@@ -5956,27 +6082,204 @@ function ITTimePicker({
|
|
|
5956
6082
|
] });
|
|
5957
6083
|
}
|
|
5958
6084
|
|
|
5959
|
-
// src/components/
|
|
6085
|
+
// src/components/search-select/search-select.tsx
|
|
5960
6086
|
var import_react20 = require("react");
|
|
6087
|
+
var import_clsx24 = __toESM(require("clsx"), 1);
|
|
6088
|
+
var import_fa15 = require("react-icons/fa");
|
|
6089
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
6090
|
+
function ITSearchSelect({
|
|
6091
|
+
name,
|
|
6092
|
+
options = [],
|
|
6093
|
+
label,
|
|
6094
|
+
placeholder = "Selecciona una opci\xF3n",
|
|
6095
|
+
valueField = "value",
|
|
6096
|
+
labelField = "label",
|
|
6097
|
+
value,
|
|
6098
|
+
onChange,
|
|
6099
|
+
onBlur,
|
|
6100
|
+
disabled = false,
|
|
6101
|
+
className,
|
|
6102
|
+
touched,
|
|
6103
|
+
required,
|
|
6104
|
+
error,
|
|
6105
|
+
readOnly = false,
|
|
6106
|
+
onSearch,
|
|
6107
|
+
isLoading = false,
|
|
6108
|
+
noResultsMessage = "No se encontraron resultados"
|
|
6109
|
+
}) {
|
|
6110
|
+
const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
|
|
6111
|
+
const [searchTerm, setSearchTerm] = (0, import_react20.useState)("");
|
|
6112
|
+
const [isFocused, setIsFocused] = (0, import_react20.useState)(false);
|
|
6113
|
+
const [localTouched, setLocalTouched] = (0, import_react20.useState)(false);
|
|
6114
|
+
const containerRef = (0, import_react20.useRef)(null);
|
|
6115
|
+
const timeoutRef = (0, import_react20.useRef)(null);
|
|
6116
|
+
const selectedOption = (0, import_react20.useMemo)(() => {
|
|
6117
|
+
return options.find((opt) => opt[valueField] === value);
|
|
6118
|
+
}, [options, value, valueField]);
|
|
6119
|
+
(0, import_react20.useEffect)(() => {
|
|
6120
|
+
if (!isFocused) {
|
|
6121
|
+
setSearchTerm(selectedOption ? String(selectedOption[labelField]) : "");
|
|
6122
|
+
}
|
|
6123
|
+
}, [selectedOption, isFocused, labelField]);
|
|
6124
|
+
(0, import_react20.useEffect)(() => {
|
|
6125
|
+
function handleClickOutside(event) {
|
|
6126
|
+
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
6127
|
+
setIsOpen(false);
|
|
6128
|
+
}
|
|
6129
|
+
}
|
|
6130
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
6131
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
6132
|
+
}, []);
|
|
6133
|
+
const filteredOptions = (0, import_react20.useMemo)(() => {
|
|
6134
|
+
if (onSearch) return options;
|
|
6135
|
+
if (!searchTerm || !isFocused) return options;
|
|
6136
|
+
return options.filter(
|
|
6137
|
+
(opt) => String(opt[labelField]).toLowerCase().includes(searchTerm.toLowerCase())
|
|
6138
|
+
);
|
|
6139
|
+
}, [options, searchTerm, onSearch, labelField, isFocused]);
|
|
6140
|
+
const handleInputChange = (e) => {
|
|
6141
|
+
const query = e.target.value;
|
|
6142
|
+
setSearchTerm(query);
|
|
6143
|
+
setIsOpen(true);
|
|
6144
|
+
if (onSearch) {
|
|
6145
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
6146
|
+
timeoutRef.current = setTimeout(() => {
|
|
6147
|
+
onSearch(query);
|
|
6148
|
+
}, 500);
|
|
6149
|
+
}
|
|
6150
|
+
};
|
|
6151
|
+
const handleSelect = (option) => {
|
|
6152
|
+
if (onChange) {
|
|
6153
|
+
onChange(option[valueField], option);
|
|
6154
|
+
}
|
|
6155
|
+
setSearchTerm(String(option[labelField]));
|
|
6156
|
+
setIsOpen(false);
|
|
6157
|
+
};
|
|
6158
|
+
const handleFocus = () => {
|
|
6159
|
+
if (disabled || readOnly) return;
|
|
6160
|
+
setIsFocused(true);
|
|
6161
|
+
setIsOpen(true);
|
|
6162
|
+
};
|
|
6163
|
+
const handleInputBlur = (e) => {
|
|
6164
|
+
setTimeout(() => {
|
|
6165
|
+
setIsFocused(false);
|
|
6166
|
+
setLocalTouched(true);
|
|
6167
|
+
onBlur?.(e);
|
|
6168
|
+
}, 200);
|
|
6169
|
+
};
|
|
6170
|
+
const inputTheme = theme.input || {};
|
|
6171
|
+
const isTouched = touched !== void 0 ? touched : localTouched;
|
|
6172
|
+
const isEmpty = value === void 0 || value === null || String(value).trim() === "";
|
|
6173
|
+
const effectiveError = error !== void 0 && error !== false ? error === true ? "Este campo es requerido" : error : required && isEmpty ? "Este campo es requerido" : void 0;
|
|
6174
|
+
const hasError = isTouched && !!effectiveError;
|
|
6175
|
+
const errorMessage = typeof effectiveError === "string" ? effectiveError : "Este campo es requerido";
|
|
6176
|
+
const getInputStyle = () => {
|
|
6177
|
+
const style = {
|
|
6178
|
+
backgroundColor: inputTheme.backgroundColor || "#ffffff",
|
|
6179
|
+
borderColor: inputTheme.borderColor || "#e2e8f0",
|
|
6180
|
+
borderRadius: inputTheme.borderRadius || "0.5rem",
|
|
6181
|
+
padding: inputTheme.padding || "0.5rem 0.75rem",
|
|
6182
|
+
fontSize: inputTheme.fontSize || "0.875rem",
|
|
6183
|
+
borderWidth: "1px",
|
|
6184
|
+
borderStyle: "solid",
|
|
6185
|
+
transition: "all 0.2s",
|
|
6186
|
+
color: "var(--input-text-color, var(--color-secondary-900))",
|
|
6187
|
+
width: "100%"
|
|
6188
|
+
};
|
|
6189
|
+
if (disabled) {
|
|
6190
|
+
style.backgroundColor = inputTheme.disabled?.backgroundColor || "#f1f5f9";
|
|
6191
|
+
style.borderColor = inputTheme.disabled?.borderColor || "#e2e8f0";
|
|
6192
|
+
style.opacity = 0.7;
|
|
6193
|
+
style.cursor = "not-allowed";
|
|
6194
|
+
}
|
|
6195
|
+
if (hasError) {
|
|
6196
|
+
style.borderColor = inputTheme.error?.borderColor || "red";
|
|
6197
|
+
if (isFocused) {
|
|
6198
|
+
style.boxShadow = inputTheme.error?.ring;
|
|
6199
|
+
}
|
|
6200
|
+
} else if (isFocused && !readOnly) {
|
|
6201
|
+
style.boxShadow = inputTheme.focus?.ring;
|
|
6202
|
+
style.borderColor = inputTheme.focus?.borderColor;
|
|
6203
|
+
}
|
|
6204
|
+
return style;
|
|
6205
|
+
};
|
|
6206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: (0, import_clsx24.default)("w-full flex flex-col gap-1.5", className, isOpen && "relative z-30"), ref: containerRef, children: [
|
|
6207
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
6208
|
+
ITText,
|
|
6209
|
+
{
|
|
6210
|
+
as: "label",
|
|
6211
|
+
className: (0, import_clsx24.default)("text-sm font-medium text-gray-700 dark:text-slate-300", {
|
|
6212
|
+
"text-red-500": hasError
|
|
6213
|
+
}),
|
|
6214
|
+
children: [
|
|
6215
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ITText, { as: "span", children: label }),
|
|
6216
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ITText, { as: "span", className: "text-red-500 ml-1", children: "*" })
|
|
6217
|
+
]
|
|
6218
|
+
}
|
|
6219
|
+
),
|
|
6220
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "relative", children: [
|
|
6221
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "relative flex items-center", children: [
|
|
6222
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
6223
|
+
"input",
|
|
6224
|
+
{
|
|
6225
|
+
type: "text",
|
|
6226
|
+
name,
|
|
6227
|
+
value: searchTerm,
|
|
6228
|
+
onChange: handleInputChange,
|
|
6229
|
+
onFocus: handleFocus,
|
|
6230
|
+
onBlur: handleInputBlur,
|
|
6231
|
+
disabled,
|
|
6232
|
+
readOnly,
|
|
6233
|
+
placeholder,
|
|
6234
|
+
className: "outline-none pr-10",
|
|
6235
|
+
style: getInputStyle(),
|
|
6236
|
+
autoComplete: "off"
|
|
6237
|
+
}
|
|
6238
|
+
),
|
|
6239
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "absolute right-3 flex items-center gap-2 text-gray-400 pointer-events-none", children: [
|
|
6240
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "animate-spin h-4 w-4 border-2 border-primary-500 border-t-transparent rounded-full" }),
|
|
6241
|
+
!isLoading && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_fa15.FaSearch, { size: 14, className: (0, import_clsx24.default)({ "text-primary-500": isFocused }) })
|
|
6242
|
+
] })
|
|
6243
|
+
] }),
|
|
6244
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "absolute z-50 w-full mt-1 bg-white dark:bg-slate-900 border border-gray-200 dark:border-slate-800 rounded-lg shadow-xl overflow-hidden animate-in fade-in zoom-in duration-200 origin-top", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "max-h-60 overflow-y-auto", children: filteredOptions.length > 0 ? filteredOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
6245
|
+
ITText,
|
|
6246
|
+
{
|
|
6247
|
+
as: "div",
|
|
6248
|
+
onClick: () => handleSelect(option),
|
|
6249
|
+
className: (0, import_clsx24.default)(
|
|
6250
|
+
"px-4 py-2 text-sm cursor-pointer transition-colors",
|
|
6251
|
+
value === option[valueField] ? "bg-primary-50 dark:bg-primary-950/40 text-primary-700 dark:text-primary-300 font-medium" : "hover:bg-gray-50 dark:hover:bg-slate-800 text-gray-700 dark:text-slate-300"
|
|
6252
|
+
),
|
|
6253
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ITText, { as: "span", children: option[labelField] })
|
|
6254
|
+
},
|
|
6255
|
+
option[valueField]
|
|
6256
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ITText, { as: "div", className: "px-4 py-6 text-sm text-center text-gray-500 italic", children: isLoading ? "Cargando..." : noResultsMessage }) }) })
|
|
6257
|
+
] }),
|
|
6258
|
+
hasError && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ITText, { as: "p", className: "text-red-500 text-xs mt-1", children: errorMessage })
|
|
6259
|
+
] });
|
|
6260
|
+
}
|
|
6261
|
+
|
|
6262
|
+
// src/components/form-builder/useFormBuilder.ts
|
|
6263
|
+
var import_react21 = require("react");
|
|
5961
6264
|
var useFieldRules = (config2, dependentValues) => {
|
|
5962
6265
|
const { getFieldConfig } = useITFormBuilderContext();
|
|
5963
6266
|
const fieldConfig = getFieldConfig(config2.name) || config2;
|
|
5964
|
-
const isVisible = (0,
|
|
6267
|
+
const isVisible = (0, import_react21.useMemo)(() => {
|
|
5965
6268
|
if (!fieldConfig.renderWhen) return true;
|
|
5966
6269
|
return fieldConfig.renderWhen(dependentValues);
|
|
5967
6270
|
}, [fieldConfig.renderWhen, dependentValues]);
|
|
5968
|
-
const dynamicProps = (0,
|
|
6271
|
+
const dynamicProps = (0, import_react21.useMemo)(() => {
|
|
5969
6272
|
if (!fieldConfig.dynamicProps) return {};
|
|
5970
6273
|
return fieldConfig.dynamicProps(dependentValues);
|
|
5971
6274
|
}, [fieldConfig.dynamicProps, dependentValues]);
|
|
5972
|
-
const isRequired = (0,
|
|
6275
|
+
const isRequired = (0, import_react21.useMemo)(() => {
|
|
5973
6276
|
if (typeof dynamicProps.required !== "undefined") return dynamicProps.required;
|
|
5974
6277
|
if (typeof fieldConfig.required === "function") {
|
|
5975
6278
|
return fieldConfig.required(dependentValues);
|
|
5976
6279
|
}
|
|
5977
6280
|
return fieldConfig.required || false;
|
|
5978
6281
|
}, [fieldConfig.required, dynamicProps.required, dependentValues]);
|
|
5979
|
-
const isDisabled = (0,
|
|
6282
|
+
const isDisabled = (0, import_react21.useMemo)(() => {
|
|
5980
6283
|
if (typeof dynamicProps.disabled !== "undefined") return dynamicProps.disabled;
|
|
5981
6284
|
if (typeof fieldConfig.disabled === "function") {
|
|
5982
6285
|
return fieldConfig.disabled(dependentValues);
|
|
@@ -5987,7 +6290,24 @@ var useFieldRules = (config2, dependentValues) => {
|
|
|
5987
6290
|
};
|
|
5988
6291
|
|
|
5989
6292
|
// src/components/form-builder/fieldRenderer.tsx
|
|
5990
|
-
var
|
|
6293
|
+
var import_fa16 = require("react-icons/fa");
|
|
6294
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
6295
|
+
function useAsyncOptions(options, depends) {
|
|
6296
|
+
const [resolved, setResolved] = (0, import_react22.useState)([]);
|
|
6297
|
+
const [loading, setLoading] = (0, import_react22.useState)(false);
|
|
6298
|
+
(0, import_react22.useEffect)(() => {
|
|
6299
|
+
if (typeof options === "function") {
|
|
6300
|
+
setLoading(true);
|
|
6301
|
+
options().then((result) => {
|
|
6302
|
+
setResolved(result.map((o) => ({ value: String(o.value), label: o.label })));
|
|
6303
|
+
setLoading(false);
|
|
6304
|
+
});
|
|
6305
|
+
} else if (Array.isArray(options)) {
|
|
6306
|
+
setResolved(options.map((o) => ({ value: String(o.value), label: o.label })));
|
|
6307
|
+
}
|
|
6308
|
+
}, depends);
|
|
6309
|
+
return { options: resolved, loading };
|
|
6310
|
+
}
|
|
5991
6311
|
var ITFieldRenderer = ({
|
|
5992
6312
|
config: config2,
|
|
5993
6313
|
columns = 12,
|
|
@@ -6001,7 +6321,7 @@ var ITFieldRenderer = ({
|
|
|
6001
6321
|
config2,
|
|
6002
6322
|
dependentValues
|
|
6003
6323
|
);
|
|
6004
|
-
(0,
|
|
6324
|
+
(0, import_react22.useEffect)(() => {
|
|
6005
6325
|
context.registerField(config2.name, config2);
|
|
6006
6326
|
return () => {
|
|
6007
6327
|
context.unregisterField(config2.name);
|
|
@@ -6027,7 +6347,8 @@ var ITFieldRenderer = ({
|
|
|
6027
6347
|
leftIcon,
|
|
6028
6348
|
rightIcon
|
|
6029
6349
|
} = activeConfig;
|
|
6030
|
-
const
|
|
6350
|
+
const { options: resolvedOptions, loading: optionsLoading } = useAsyncOptions(options, [options, dependentValues]);
|
|
6351
|
+
const handleChangeWrapper = (0, import_react22.useCallback)(
|
|
6031
6352
|
async (val) => {
|
|
6032
6353
|
const finalValue = val?.target ? val.target.value : val;
|
|
6033
6354
|
await context.setFieldValue(name, finalValue);
|
|
@@ -6043,7 +6364,7 @@ var ITFieldRenderer = ({
|
|
|
6043
6364
|
case "password":
|
|
6044
6365
|
case "number":
|
|
6045
6366
|
case "email":
|
|
6046
|
-
return /* @__PURE__ */ (0,
|
|
6367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
6047
6368
|
ITInput,
|
|
6048
6369
|
{
|
|
6049
6370
|
type: type === "email" ? "text" : type,
|
|
@@ -6068,10 +6389,36 @@ var ITFieldRenderer = ({
|
|
|
6068
6389
|
}
|
|
6069
6390
|
);
|
|
6070
6391
|
case "select":
|
|
6071
|
-
|
|
6392
|
+
if (optionsLoading) {
|
|
6393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-2 py-3", children: [
|
|
6394
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_fa16.FaSpinner, { className: "animate-spin text-primary-500" }),
|
|
6395
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ITText, { as: "span", className: "text-sm text-slate-500", children: "Cargando opciones..." })
|
|
6396
|
+
] });
|
|
6397
|
+
}
|
|
6398
|
+
if (typeof options === "function") {
|
|
6399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
6400
|
+
ITSearchSelect,
|
|
6401
|
+
{
|
|
6402
|
+
options: resolvedOptions,
|
|
6403
|
+
name,
|
|
6404
|
+
disabled: isDisabled,
|
|
6405
|
+
label: label || "",
|
|
6406
|
+
placeholder,
|
|
6407
|
+
value: value !== void 0 ? value : activeConfig.defaultValue || "",
|
|
6408
|
+
valueField: valueField || "value",
|
|
6409
|
+
labelField: labelField || "label",
|
|
6410
|
+
onChange: (val) => handleChangeWrapper(val),
|
|
6411
|
+
onBlur: context.handleBlur,
|
|
6412
|
+
touched,
|
|
6413
|
+
error,
|
|
6414
|
+
required: isRequired
|
|
6415
|
+
}
|
|
6416
|
+
);
|
|
6417
|
+
}
|
|
6418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
6072
6419
|
ITSelect,
|
|
6073
6420
|
{
|
|
6074
|
-
options:
|
|
6421
|
+
options: resolvedOptions,
|
|
6075
6422
|
name,
|
|
6076
6423
|
disabled: isDisabled,
|
|
6077
6424
|
label: label || "",
|
|
@@ -6087,7 +6434,7 @@ var ITFieldRenderer = ({
|
|
|
6087
6434
|
}
|
|
6088
6435
|
);
|
|
6089
6436
|
case "date":
|
|
6090
|
-
return /* @__PURE__ */ (0,
|
|
6437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
6091
6438
|
ITDatePicker,
|
|
6092
6439
|
{
|
|
6093
6440
|
name,
|
|
@@ -6103,7 +6450,7 @@ var ITFieldRenderer = ({
|
|
|
6103
6450
|
}
|
|
6104
6451
|
);
|
|
6105
6452
|
case "time":
|
|
6106
|
-
return /* @__PURE__ */ (0,
|
|
6453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
6107
6454
|
ITTimePicker,
|
|
6108
6455
|
{
|
|
6109
6456
|
name,
|
|
@@ -6121,7 +6468,7 @@ var ITFieldRenderer = ({
|
|
|
6121
6468
|
case "custom":
|
|
6122
6469
|
if (activeConfig.component) {
|
|
6123
6470
|
const CustomComponent = activeConfig.component;
|
|
6124
|
-
return /* @__PURE__ */ (0,
|
|
6471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
6125
6472
|
CustomComponent,
|
|
6126
6473
|
{
|
|
6127
6474
|
...activeConfig,
|
|
@@ -6136,9 +6483,9 @@ var ITFieldRenderer = ({
|
|
|
6136
6483
|
}
|
|
6137
6484
|
return null;
|
|
6138
6485
|
case "section":
|
|
6139
|
-
return /* @__PURE__ */ (0,
|
|
6140
|
-
label && /* @__PURE__ */ (0,
|
|
6141
|
-
/* @__PURE__ */ (0,
|
|
6486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: (0, import_clsx25.default)("w-full col-span-full", activeConfig.className), children: [
|
|
6487
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ITText, { as: "h4", className: "text-lg font-semibold text-gray-800 mb-4", children: label }),
|
|
6488
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: (0, import_clsx25.default)("grid gap-y-6 gap-x-5", getGridColsClass(columns)), children: activeConfig.fields?.map((childConfig) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
6142
6489
|
ITFieldRenderer,
|
|
6143
6490
|
{
|
|
6144
6491
|
config: childConfig,
|
|
@@ -6148,7 +6495,7 @@ var ITFieldRenderer = ({
|
|
|
6148
6495
|
)) })
|
|
6149
6496
|
] });
|
|
6150
6497
|
case "array":
|
|
6151
|
-
return /* @__PURE__ */ (0,
|
|
6498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "p-4 border-2 border-dashed border-gray-200 rounded-xl", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(ITText, { as: "p", className: "text-sm text-gray-500 text-center", children: [
|
|
6152
6499
|
"Array Field: ",
|
|
6153
6500
|
label
|
|
6154
6501
|
] }) });
|
|
@@ -6156,12 +6503,12 @@ var ITFieldRenderer = ({
|
|
|
6156
6503
|
return null;
|
|
6157
6504
|
}
|
|
6158
6505
|
};
|
|
6159
|
-
return /* @__PURE__ */ (0,
|
|
6506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: (0, import_clsx25.default)(getColSpanClass(activeConfig.column, columns), activeConfig.className), children: renderField() });
|
|
6160
6507
|
};
|
|
6161
|
-
var fieldRenderer_default = (0,
|
|
6508
|
+
var fieldRenderer_default = (0, import_react22.memo)(ITFieldRenderer);
|
|
6162
6509
|
|
|
6163
6510
|
// src/components/form-builder/formBuilder.tsx
|
|
6164
|
-
var
|
|
6511
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
6165
6512
|
function buildDependentValues(dependsOn, values) {
|
|
6166
6513
|
if (!dependsOn || dependsOn.length === 0) return {};
|
|
6167
6514
|
const deps = {};
|
|
@@ -6185,11 +6532,11 @@ function ITFormBuilder({
|
|
|
6185
6532
|
},
|
|
6186
6533
|
isSubmitting = false
|
|
6187
6534
|
}) {
|
|
6188
|
-
const [mounted, setMounted] = (0,
|
|
6189
|
-
(0,
|
|
6535
|
+
const [mounted, setMounted] = (0, import_react23.useState)(false);
|
|
6536
|
+
(0, import_react23.useEffect)(() => {
|
|
6190
6537
|
setMounted(true);
|
|
6191
6538
|
}, []);
|
|
6192
|
-
const providerValue = (0,
|
|
6539
|
+
const providerValue = (0, import_react23.useMemo)(() => ({
|
|
6193
6540
|
config: config2 || [],
|
|
6194
6541
|
values: values || {},
|
|
6195
6542
|
errors: errors || {},
|
|
@@ -6205,7 +6552,7 @@ function ITFormBuilder({
|
|
|
6205
6552
|
submitCount: 0
|
|
6206
6553
|
}), [config2, values, errors, touched, handleChange, handleBlur, setFieldValue, setFieldTouched, setFieldError, isSubmitting]);
|
|
6207
6554
|
if (config2) {
|
|
6208
|
-
return /* @__PURE__ */ (0,
|
|
6555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ITFormBuilderProvider, { value: providerValue, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: formGrid(columns), children: config2.map((fieldConfig) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6209
6556
|
fieldRenderer_default,
|
|
6210
6557
|
{
|
|
6211
6558
|
config: fieldConfig,
|
|
@@ -6218,7 +6565,7 @@ function ITFormBuilder({
|
|
|
6218
6565
|
fieldConfig.name
|
|
6219
6566
|
)) }) });
|
|
6220
6567
|
}
|
|
6221
|
-
return /* @__PURE__ */ (0,
|
|
6568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: formGrid(columns), children: fields?.map(({
|
|
6222
6569
|
name,
|
|
6223
6570
|
label,
|
|
6224
6571
|
type = "text",
|
|
@@ -6233,12 +6580,12 @@ function ITFormBuilder({
|
|
|
6233
6580
|
formatNumber = true,
|
|
6234
6581
|
onChangeAction,
|
|
6235
6582
|
...props
|
|
6236
|
-
}) => /* @__PURE__ */ (0,
|
|
6583
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: getColSpanClass(column, columns), children: (() => {
|
|
6237
6584
|
switch (type) {
|
|
6238
6585
|
case "text":
|
|
6239
6586
|
case "number":
|
|
6240
6587
|
case "password":
|
|
6241
|
-
return /* @__PURE__ */ (0,
|
|
6588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6242
6589
|
ITInput,
|
|
6243
6590
|
{
|
|
6244
6591
|
type,
|
|
@@ -6268,7 +6615,7 @@ function ITFormBuilder({
|
|
|
6268
6615
|
}
|
|
6269
6616
|
);
|
|
6270
6617
|
case "select":
|
|
6271
|
-
return /* @__PURE__ */ (0,
|
|
6618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6272
6619
|
ITSelect,
|
|
6273
6620
|
{
|
|
6274
6621
|
options: options || [],
|
|
@@ -6292,7 +6639,7 @@ function ITFormBuilder({
|
|
|
6292
6639
|
}
|
|
6293
6640
|
);
|
|
6294
6641
|
case "date":
|
|
6295
|
-
return /* @__PURE__ */ (0,
|
|
6642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6296
6643
|
ITDatePicker,
|
|
6297
6644
|
{
|
|
6298
6645
|
name,
|
|
@@ -6319,8 +6666,8 @@ function ITFormBuilder({
|
|
|
6319
6666
|
}
|
|
6320
6667
|
|
|
6321
6668
|
// src/components/grid/grid.tsx
|
|
6322
|
-
var
|
|
6323
|
-
var
|
|
6669
|
+
var import_clsx26 = __toESM(require("clsx"), 1);
|
|
6670
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
6324
6671
|
function colSpanClass(span, cols) {
|
|
6325
6672
|
if (span === void 0) return void 0;
|
|
6326
6673
|
const clamped = Math.min(Math.max(Math.round(span), 1), cols);
|
|
@@ -6331,6 +6678,10 @@ function breakpointSpan(span, bp, cols) {
|
|
|
6331
6678
|
const clamped = Math.min(Math.max(Math.round(span), 1), cols);
|
|
6332
6679
|
return `${bp}:col-span-${clamped}`;
|
|
6333
6680
|
}
|
|
6681
|
+
function gridColsClass(cols) {
|
|
6682
|
+
const clamped = Math.min(Math.max(cols, 1), 12);
|
|
6683
|
+
return `grid-cols-${clamped}`;
|
|
6684
|
+
}
|
|
6334
6685
|
function ITGrid({
|
|
6335
6686
|
children,
|
|
6336
6687
|
container,
|
|
@@ -6347,12 +6698,11 @@ function ITGrid({
|
|
|
6347
6698
|
as: Component = "div"
|
|
6348
6699
|
}) {
|
|
6349
6700
|
if (container) {
|
|
6350
|
-
return /* @__PURE__ */ (0,
|
|
6701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6351
6702
|
Component,
|
|
6352
6703
|
{
|
|
6353
|
-
className: (0,
|
|
6704
|
+
className: (0, import_clsx26.default)("grid", gridColsClass(columns), className),
|
|
6354
6705
|
style: {
|
|
6355
|
-
gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,
|
|
6356
6706
|
gap: spacing > 0 ? `${spacing * 0.25}rem` : void 0,
|
|
6357
6707
|
...style
|
|
6358
6708
|
},
|
|
@@ -6361,10 +6711,11 @@ function ITGrid({
|
|
|
6361
6711
|
);
|
|
6362
6712
|
}
|
|
6363
6713
|
if (item) {
|
|
6364
|
-
return /* @__PURE__ */ (0,
|
|
6714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6365
6715
|
Component,
|
|
6366
6716
|
{
|
|
6367
|
-
className: (0,
|
|
6717
|
+
className: (0, import_clsx26.default)(
|
|
6718
|
+
"col-span-full",
|
|
6368
6719
|
colSpanClass(xs ?? sm, columns),
|
|
6369
6720
|
sm !== void 0 && breakpointSpan(sm, "sm", columns),
|
|
6370
6721
|
md !== void 0 && breakpointSpan(md, "md", columns),
|
|
@@ -6377,34 +6728,34 @@ function ITGrid({
|
|
|
6377
6728
|
}
|
|
6378
6729
|
);
|
|
6379
6730
|
}
|
|
6380
|
-
return /* @__PURE__ */ (0,
|
|
6731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Component, { className, style, children });
|
|
6381
6732
|
}
|
|
6382
6733
|
|
|
6383
6734
|
// src/components/image/image.tsx
|
|
6384
|
-
var
|
|
6385
|
-
var
|
|
6735
|
+
var import_react24 = require("react");
|
|
6736
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
6386
6737
|
var ITImage = ({
|
|
6387
6738
|
src,
|
|
6388
6739
|
alt,
|
|
6389
6740
|
className = "",
|
|
6390
6741
|
fallback = ""
|
|
6391
6742
|
}) => {
|
|
6392
|
-
const [imageError, setImageError] = (0,
|
|
6743
|
+
const [imageError, setImageError] = (0, import_react24.useState)(false);
|
|
6393
6744
|
const handleImageError = () => {
|
|
6394
6745
|
setImageError(true);
|
|
6395
6746
|
};
|
|
6396
|
-
return /* @__PURE__ */ (0,
|
|
6747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6397
6748
|
"div",
|
|
6398
6749
|
{
|
|
6399
6750
|
className: `${className} flex items-center justify-center bg-transparent`,
|
|
6400
|
-
children: imageError ? /* @__PURE__ */ (0,
|
|
6751
|
+
children: imageError ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6401
6752
|
"img",
|
|
6402
6753
|
{
|
|
6403
6754
|
src: fallback,
|
|
6404
6755
|
alt: "Fallback",
|
|
6405
6756
|
className: "w-full h-full object-cover"
|
|
6406
6757
|
}
|
|
6407
|
-
) : /* @__PURE__ */ (0,
|
|
6758
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6408
6759
|
"img",
|
|
6409
6760
|
{
|
|
6410
6761
|
src,
|
|
@@ -6419,9 +6770,9 @@ var ITImage = ({
|
|
|
6419
6770
|
var image_default = ITImage;
|
|
6420
6771
|
|
|
6421
6772
|
// src/components/navbar/navbar.tsx
|
|
6422
|
-
var
|
|
6423
|
-
var
|
|
6424
|
-
var
|
|
6773
|
+
var import_react25 = require("react");
|
|
6774
|
+
var import_fa17 = require("react-icons/fa");
|
|
6775
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
6425
6776
|
function ITNavbar({
|
|
6426
6777
|
logo,
|
|
6427
6778
|
logoText,
|
|
@@ -6434,9 +6785,9 @@ function ITNavbar({
|
|
|
6434
6785
|
showSidebarOnMobile = false,
|
|
6435
6786
|
sidebarItems
|
|
6436
6787
|
}) {
|
|
6437
|
-
const [isUserMenuOpen, setIsUserMenuOpen] = (0,
|
|
6438
|
-
const [expandedItems, setExpandedItems] = (0,
|
|
6439
|
-
const userMenuRef = (0,
|
|
6788
|
+
const [isUserMenuOpen, setIsUserMenuOpen] = (0, import_react25.useState)(false);
|
|
6789
|
+
const [expandedItems, setExpandedItems] = (0, import_react25.useState)(/* @__PURE__ */ new Set());
|
|
6790
|
+
const userMenuRef = (0, import_react25.useRef)(null);
|
|
6440
6791
|
useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
|
|
6441
6792
|
const toggleUserMenu = () => {
|
|
6442
6793
|
setIsUserMenuOpen(!isUserMenuOpen);
|
|
@@ -6459,42 +6810,42 @@ function ITNavbar({
|
|
|
6459
6810
|
};
|
|
6460
6811
|
const shouldUseLegacy = !navigationItems.length && (navItems || sidebarItems);
|
|
6461
6812
|
if (shouldUseLegacy) {
|
|
6462
|
-
return /* @__PURE__ */ (0,
|
|
6463
|
-
/* @__PURE__ */ (0,
|
|
6464
|
-
/* @__PURE__ */ (0,
|
|
6465
|
-
logo && /* @__PURE__ */ (0,
|
|
6466
|
-
logoText && /* @__PURE__ */ (0,
|
|
6813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col h-screen", children: [
|
|
6814
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("nav", { className: "bg-white border-b border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center justify-between mx-auto p-4", children: [
|
|
6815
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-3 rtl:space-x-reverse", children: [
|
|
6816
|
+
logo && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "h-8", children: logo }),
|
|
6817
|
+
logoText && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ITText, { as: "span", className: "self-center text-2xl font-semibold whitespace-nowrap text-gray-900", children: logoText })
|
|
6467
6818
|
] }),
|
|
6468
|
-
/* @__PURE__ */ (0,
|
|
6469
|
-
/* @__PURE__ */ (0,
|
|
6470
|
-
userMenu && /* @__PURE__ */ (0,
|
|
6471
|
-
/* @__PURE__ */ (0,
|
|
6819
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex items-center justify-end w-full md:w-auto md:order-2", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center space-x-4 md:order-2", children: [
|
|
6820
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("ul", { className: "hidden md:flex space-x-4", children: navItems }),
|
|
6821
|
+
userMenu && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "relative", children: [
|
|
6822
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6472
6823
|
"button",
|
|
6473
6824
|
{
|
|
6474
6825
|
type: "button",
|
|
6475
6826
|
className: "flex text-sm bg-gray-200 rounded-full md:me-0 focus:ring-4 focus:ring-gray-300",
|
|
6476
6827
|
onClick: toggleUserMenu,
|
|
6477
|
-
children: userMenu.userImage ? /* @__PURE__ */ (0,
|
|
6828
|
+
children: userMenu.userImage ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6478
6829
|
"img",
|
|
6479
6830
|
{
|
|
6480
6831
|
className: "w-8 h-8 rounded-full",
|
|
6481
6832
|
src: userMenu.userImage,
|
|
6482
6833
|
alt: "user photo"
|
|
6483
6834
|
}
|
|
6484
|
-
) : /* @__PURE__ */ (0,
|
|
6835
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_fa17.FaUserCircle, { className: "w-8 h-8 text-gray-500" })
|
|
6485
6836
|
}
|
|
6486
6837
|
),
|
|
6487
|
-
isUserMenuOpen && /* @__PURE__ */ (0,
|
|
6838
|
+
isUserMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
6488
6839
|
"div",
|
|
6489
6840
|
{
|
|
6490
6841
|
ref: userMenuRef,
|
|
6491
6842
|
className: "z-50 absolute right-0 mt-2 text-base list-none bg-white divide-y divide-gray-100 rounded-lg shadow-sm",
|
|
6492
6843
|
children: [
|
|
6493
|
-
/* @__PURE__ */ (0,
|
|
6494
|
-
/* @__PURE__ */ (0,
|
|
6495
|
-
/* @__PURE__ */ (0,
|
|
6844
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "px-4 py-3", children: [
|
|
6845
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ITText, { as: "span", className: "block text-sm text-gray-900", children: userMenu.userName }),
|
|
6846
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ITText, { as: "span", className: "block text-sm text-gray-500 truncate", children: userMenu.userEmail })
|
|
6496
6847
|
] }),
|
|
6497
|
-
/* @__PURE__ */ (0,
|
|
6848
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("ul", { className: "py-2", children: userMenu.menuItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6498
6849
|
"button",
|
|
6499
6850
|
{
|
|
6500
6851
|
onClick: () => {
|
|
@@ -6502,7 +6853,7 @@ function ITNavbar({
|
|
|
6502
6853
|
setIsUserMenuOpen(false);
|
|
6503
6854
|
},
|
|
6504
6855
|
className: "block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 w-full text-left",
|
|
6505
|
-
children: /* @__PURE__ */ (0,
|
|
6856
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ITText, { as: "span", children: item.label })
|
|
6506
6857
|
}
|
|
6507
6858
|
) }, index)) })
|
|
6508
6859
|
]
|
|
@@ -6511,191 +6862,233 @@ function ITNavbar({
|
|
|
6511
6862
|
] })
|
|
6512
6863
|
] }) })
|
|
6513
6864
|
] }) }),
|
|
6514
|
-
/* @__PURE__ */ (0,
|
|
6515
|
-
(showSidebar || showSidebarOnMobile) && /* @__PURE__ */ (0,
|
|
6516
|
-
/* @__PURE__ */ (0,
|
|
6865
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex-1 flex overflow-hidden relative", children: [
|
|
6866
|
+
(showSidebar || showSidebarOnMobile) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("aside", { className: "fixed inset-y-0 left-0 w-64 bg-gray-50 transform transition-transform duration-300 ease-in-out z-50 shadow-lg md:static md:transform-none md:shadow-none md:border-r md:border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "h-full overflow-y-auto py-4 px-3", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("ul", { className: "space-y-2 font-medium", children: sidebarItems }) }) }),
|
|
6867
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("main", { className: "flex-1 bg-gray-100 overflow-y-auto", children })
|
|
6517
6868
|
] })
|
|
6518
6869
|
] });
|
|
6519
6870
|
}
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
{
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6871
|
+
const sidebar = theme.sidebar;
|
|
6872
|
+
const topbar = theme.topbar;
|
|
6873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex h-screen font-sans", style: { backgroundColor: theme.layout.backgroundColor }, children: [
|
|
6874
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
6875
|
+
"aside",
|
|
6876
|
+
{
|
|
6877
|
+
className: "w-72 shadow-xl flex flex-col transition-all duration-300 ease-in-out",
|
|
6878
|
+
style: { backgroundColor: sidebar.backgroundColor, borderRight: `1px solid ${sidebar.borderColor}` },
|
|
6879
|
+
children: [
|
|
6880
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "p-6 flex items-center gap-3", style: { borderBottom: `1px solid ${sidebar.borderColor}` }, children: [
|
|
6881
|
+
logo && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "h-8 w-auto object-contain transition-transform hover:scale-105", children: logo }),
|
|
6882
|
+
logoText && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ITText, { as: "span", className: "text-lg font-bold tracking-wide", style: { color: sidebar.active.color }, children: logoText })
|
|
6883
|
+
] }),
|
|
6884
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("nav", { className: "flex-1 px-4 py-6 overflow-y-auto custom-scrollbar", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("ul", { className: "flex flex-col gap-1.5", children: navigationItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("li", { children: [
|
|
6885
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
6886
|
+
"div",
|
|
6887
|
+
{
|
|
6888
|
+
className: `group flex items-center justify-between px-4 py-3 rounded-xl cursor-pointer transition-all duration-200 border-l-4 ${item.isActive ? "shadow-sm" : "hover:shadow-sm"}`,
|
|
6889
|
+
onClick: () => handleItemClick(item),
|
|
6890
|
+
style: {
|
|
6891
|
+
backgroundColor: item.isActive ? sidebar.active.backgroundColor : "transparent",
|
|
6892
|
+
borderColor: item.isActive ? sidebar.active.iconColor : "transparent",
|
|
6893
|
+
color: item.isActive ? sidebar.active.color : sidebar.label.color
|
|
6894
|
+
},
|
|
6895
|
+
onMouseEnter: (e) => {
|
|
6896
|
+
if (!item.isActive) {
|
|
6897
|
+
e.currentTarget.style.backgroundColor = sidebar.hover.backgroundColor;
|
|
6898
|
+
e.currentTarget.style.color = sidebar.active.color;
|
|
6899
|
+
}
|
|
6900
|
+
},
|
|
6901
|
+
onMouseLeave: (e) => {
|
|
6902
|
+
if (!item.isActive) {
|
|
6903
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
6904
|
+
e.currentTarget.style.color = sidebar.label.color;
|
|
6905
|
+
}
|
|
6906
|
+
},
|
|
6907
|
+
children: [
|
|
6908
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
6909
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "text-xl transition-colors", style: {
|
|
6910
|
+
color: item.isActive ? sidebar.active.iconColor : sidebar.icon.color
|
|
6911
|
+
}, children: item.icon }),
|
|
6912
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ITText, { as: "span", className: `font-medium text-sm ${item.isActive ? "font-semibold" : ""}`, children: item.label })
|
|
6913
|
+
] }),
|
|
6914
|
+
item.subitems && item.subitems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "transition-transform", style: { color: sidebar.icon.color }, children: expandedItems.has(item.id) ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_fa17.FaChevronDown, { className: "w-3 h-3" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_fa17.FaChevronRight, { className: "w-3 h-3" }) })
|
|
6915
|
+
]
|
|
6547
6916
|
}
|
|
6548
|
-
|
|
6549
|
-
children:
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
onMouseEnter: (e) => {
|
|
6570
|
-
if (!subitem.isActive) {
|
|
6571
|
-
e.currentTarget.style.backgroundColor = "var(--sidebar-hover-bg, rgba(255,255,255,0.05))";
|
|
6917
|
+
),
|
|
6918
|
+
item.subitems && item.subitems.length > 0 && expandedItems.has(item.id) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("ul", { className: "mt-1 ml-4 pl-4 space-y-1", style: { borderLeft: `1px solid ${sidebar.borderColor}` }, children: item.subitems.map((subitem) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6919
|
+
"button",
|
|
6920
|
+
{
|
|
6921
|
+
onClick: subitem.action,
|
|
6922
|
+
className: "block w-full text-left px-4 py-2.5 rounded-lg text-sm transition-all duration-200",
|
|
6923
|
+
style: {
|
|
6924
|
+
color: subitem.isActive ? sidebar.active.color : sidebar.label.color,
|
|
6925
|
+
backgroundColor: subitem.isActive ? sidebar.active.backgroundColor : "transparent"
|
|
6926
|
+
},
|
|
6927
|
+
onMouseEnter: (e) => {
|
|
6928
|
+
if (!subitem.isActive) {
|
|
6929
|
+
e.currentTarget.style.backgroundColor = sidebar.hover.backgroundColor;
|
|
6930
|
+
}
|
|
6931
|
+
},
|
|
6932
|
+
onMouseLeave: (e) => {
|
|
6933
|
+
if (!subitem.isActive) {
|
|
6934
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
6935
|
+
}
|
|
6936
|
+
},
|
|
6937
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ITText, { as: "span", children: subitem.label })
|
|
6572
6938
|
}
|
|
6573
|
-
},
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6939
|
+
) }, subitem.id)) })
|
|
6940
|
+
] }, item.id)) }) }),
|
|
6941
|
+
userMenu && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "p-4", style: { borderTop: `1px solid ${sidebar.borderColor}` }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "relative", children: [
|
|
6942
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
6943
|
+
"button",
|
|
6944
|
+
{
|
|
6945
|
+
type: "button",
|
|
6946
|
+
className: "flex items-center gap-3 w-full p-3 rounded-xl transition-colors duration-200 group",
|
|
6947
|
+
style: { color: sidebar.label.color },
|
|
6948
|
+
onMouseEnter: (e) => {
|
|
6949
|
+
e.currentTarget.style.backgroundColor = sidebar.hover.backgroundColor;
|
|
6950
|
+
e.currentTarget.style.color = sidebar.active.color;
|
|
6951
|
+
},
|
|
6952
|
+
onMouseLeave: (e) => {
|
|
6953
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
6954
|
+
e.currentTarget.style.color = sidebar.label.color;
|
|
6955
|
+
},
|
|
6956
|
+
onClick: toggleUserMenu,
|
|
6957
|
+
children: [
|
|
6958
|
+
userMenu.userImage ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6959
|
+
"img",
|
|
6960
|
+
{
|
|
6961
|
+
className: "w-10 h-10 rounded-full border-2 transition-colors",
|
|
6962
|
+
src: userMenu.userImage,
|
|
6963
|
+
alt: "user photo",
|
|
6964
|
+
style: { borderColor: sidebar.borderColor }
|
|
6965
|
+
}
|
|
6966
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6967
|
+
"div",
|
|
6968
|
+
{
|
|
6969
|
+
className: "w-10 h-10 rounded-full flex items-center justify-center transition-colors",
|
|
6970
|
+
style: { backgroundColor: sidebar.hover.backgroundColor, color: sidebar.icon.color },
|
|
6971
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_fa17.FaUserCircle, { className: "w-6 h-6" })
|
|
6972
|
+
}
|
|
6973
|
+
),
|
|
6974
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex-1 text-left overflow-hidden", children: [
|
|
6975
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ITText, { as: "div", className: "font-medium text-sm truncate", style: { color: sidebar.active.color }, children: userMenu.userName }),
|
|
6976
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ITText, { as: "div", className: "text-xs truncate", style: { color: sidebar.label.color }, children: userMenu.userEmail })
|
|
6977
|
+
] }),
|
|
6978
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_fa17.FaChevronRight, { className: "w-3 h-3", style: { color: sidebar.icon.color } })
|
|
6979
|
+
]
|
|
6577
6980
|
}
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
),
|
|
6617
|
-
isUserMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
6618
|
-
"div",
|
|
6619
|
-
{
|
|
6620
|
-
ref: userMenuRef,
|
|
6621
|
-
className: "absolute bottom-full left-0 mb-3 w-full rounded-xl shadow-2xl overflow-hidden transform transition-all duration-200 origin-bottom",
|
|
6622
|
-
style: { backgroundColor: "var(--topbar-user-dropdown-bg, #ffffff)", border: "1px solid var(--topbar-user-dropdown-border, #e2e8f0)" },
|
|
6623
|
-
children: [
|
|
6624
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "px-4 py-3", style: { backgroundColor: "var(--topbar-user-bg, #f8fafc)", borderBottom: "1px solid var(--topbar-user-dropdown-border, #e2e8f0)" }, children: [
|
|
6625
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ITText, { as: "span", className: "block text-sm font-semibold", style: { color: "var(--topbar-user-text, #0f172a)" }, children: userMenu.userName }),
|
|
6626
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ITText, { as: "span", className: "block text-xs truncate", style: { color: "var(--topbar-user-subtitle, #64748b)" }, children: userMenu.userEmail })
|
|
6627
|
-
] }),
|
|
6628
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("ul", { className: "py-1", children: userMenu.menuItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6629
|
-
"button",
|
|
6630
|
-
{
|
|
6631
|
-
onClick: () => {
|
|
6632
|
-
item.onClick();
|
|
6633
|
-
setIsUserMenuOpen(false);
|
|
6634
|
-
},
|
|
6635
|
-
className: "flex items-center w-full px-4 py-2.5 text-sm transition-colors",
|
|
6636
|
-
style: { color: "var(--topbar-user-text, #334155)" },
|
|
6637
|
-
onMouseEnter: (e) => {
|
|
6638
|
-
e.currentTarget.style.backgroundColor = "var(--topbar-user-item-hover, #f8fafc)";
|
|
6639
|
-
},
|
|
6640
|
-
onMouseLeave: (e) => {
|
|
6641
|
-
e.currentTarget.style.backgroundColor = "transparent";
|
|
6642
|
-
},
|
|
6643
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ITText, { as: "span", children: item.label })
|
|
6644
|
-
}
|
|
6645
|
-
) }, index)) })
|
|
6646
|
-
]
|
|
6647
|
-
}
|
|
6648
|
-
)
|
|
6649
|
-
] }) })
|
|
6650
|
-
] }),
|
|
6651
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("main", { className: "flex-1 overflow-y-auto relative", style: { backgroundColor: "var(--layout-bg, #f8fafc)" }, children })
|
|
6981
|
+
),
|
|
6982
|
+
isUserMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
6983
|
+
"div",
|
|
6984
|
+
{
|
|
6985
|
+
ref: userMenuRef,
|
|
6986
|
+
className: "absolute bottom-full left-0 mb-3 w-full rounded-xl shadow-2xl overflow-hidden transform transition-all duration-200 origin-bottom",
|
|
6987
|
+
style: { backgroundColor: topbar.userMenu.dropdown.backgroundColor, border: `1px solid ${topbar.userMenu.dropdown.borderColor}` },
|
|
6988
|
+
children: [
|
|
6989
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "px-4 py-3", style: { backgroundColor: topbar.userMenu.backgroundColor, borderBottom: `1px solid ${topbar.userMenu.dropdown.borderColor}` }, children: [
|
|
6990
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ITText, { as: "span", className: "block text-sm font-semibold", style: { color: topbar.userMenu.textColor }, children: userMenu.userName }),
|
|
6991
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ITText, { as: "span", className: "block text-xs truncate", style: { color: topbar.userMenu.subtitleColor }, children: userMenu.userEmail })
|
|
6992
|
+
] }),
|
|
6993
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("ul", { className: "py-1", children: userMenu.menuItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6994
|
+
"button",
|
|
6995
|
+
{
|
|
6996
|
+
onClick: () => {
|
|
6997
|
+
item.onClick();
|
|
6998
|
+
setIsUserMenuOpen(false);
|
|
6999
|
+
},
|
|
7000
|
+
className: "flex items-center w-full px-4 py-2.5 text-sm transition-colors",
|
|
7001
|
+
style: { color: topbar.userMenu.textColor },
|
|
7002
|
+
onMouseEnter: (e) => {
|
|
7003
|
+
e.currentTarget.style.backgroundColor = topbar.userMenu.dropdown.itemHoverBackground;
|
|
7004
|
+
},
|
|
7005
|
+
onMouseLeave: (e) => {
|
|
7006
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
7007
|
+
},
|
|
7008
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ITText, { as: "span", children: item.label })
|
|
7009
|
+
}
|
|
7010
|
+
) }, index)) })
|
|
7011
|
+
]
|
|
7012
|
+
}
|
|
7013
|
+
)
|
|
7014
|
+
] }) })
|
|
7015
|
+
]
|
|
7016
|
+
}
|
|
7017
|
+
),
|
|
7018
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("main", { className: "flex-1 overflow-y-auto relative", style: { backgroundColor: theme.layout.backgroundColor }, children })
|
|
6652
7019
|
] });
|
|
6653
7020
|
}
|
|
6654
7021
|
|
|
6655
7022
|
// src/components/page/page.tsx
|
|
6656
|
-
var
|
|
7023
|
+
var import_clsx29 = __toESM(require("clsx"), 1);
|
|
6657
7024
|
|
|
6658
7025
|
// src/components/page-header/page-header.tsx
|
|
6659
|
-
var
|
|
6660
|
-
var
|
|
7026
|
+
var import_fa18 = require("react-icons/fa");
|
|
7027
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
6661
7028
|
function ITPageHeader({
|
|
6662
7029
|
title,
|
|
6663
7030
|
description,
|
|
6664
7031
|
breadcrumbs,
|
|
6665
7032
|
actions,
|
|
6666
7033
|
backAction,
|
|
7034
|
+
icon,
|
|
7035
|
+
iconColor,
|
|
6667
7036
|
className
|
|
6668
7037
|
}) {
|
|
6669
7038
|
const showTopRow = breadcrumbs?.length || backAction;
|
|
6670
|
-
return /* @__PURE__ */ (0,
|
|
6671
|
-
showTopRow && /* @__PURE__ */ (0,
|
|
6672
|
-
/* @__PURE__ */ (0,
|
|
6673
|
-
backAction && /* @__PURE__ */ (0,
|
|
7039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: `${className} space-y-3`, children: [
|
|
7040
|
+
showTopRow && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
7041
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
7042
|
+
backAction && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6674
7043
|
"button",
|
|
6675
7044
|
{
|
|
6676
7045
|
onClick: backAction,
|
|
6677
|
-
className: "
|
|
7046
|
+
className: "flex items-center justify-center w-9 h-9 rounded-full border border-slate-200 dark:border-slate-700 text-slate-400 hover:text-slate-700 dark:hover:text-slate-200 hover:border-slate-300 dark:hover:border-slate-600 hover:bg-slate-50 dark:hover:bg-slate-800/60 transition-all duration-200 flex-shrink-0",
|
|
6678
7047
|
"aria-label": "Volver",
|
|
6679
|
-
children: /* @__PURE__ */ (0,
|
|
7048
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_fa18.FaChevronLeft, { size: 14 })
|
|
6680
7049
|
}
|
|
6681
7050
|
),
|
|
6682
|
-
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ (0,
|
|
7051
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ITBreadcrumbs, { items: breadcrumbs })
|
|
6683
7052
|
] }),
|
|
6684
|
-
actions && /* @__PURE__ */ (0,
|
|
7053
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex items-center gap-3 flex-shrink-0", children: actions })
|
|
6685
7054
|
] }),
|
|
6686
|
-
/* @__PURE__ */ (0,
|
|
6687
|
-
/* @__PURE__ */ (0,
|
|
6688
|
-
/* @__PURE__ */ (0,
|
|
6689
|
-
|
|
7055
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-start justify-between gap-6", children: [
|
|
7056
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-start gap-4 min-w-0", children: [
|
|
7057
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
7058
|
+
"div",
|
|
7059
|
+
{
|
|
7060
|
+
className: "flex items-center justify-center w-12 h-12 rounded-full border border-slate-200 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-800/50 text-slate-600 dark:text-slate-300 flex-shrink-0 transition-all duration-200 hover:border-slate-300 dark:hover:border-slate-500 hover:shadow-sm",
|
|
7061
|
+
style: iconColor ? { color: iconColor } : void 0,
|
|
7062
|
+
children: icon
|
|
7063
|
+
}
|
|
7064
|
+
),
|
|
7065
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "min-w-0", children: [
|
|
7066
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
7067
|
+
ITText,
|
|
7068
|
+
{
|
|
7069
|
+
as: "h1",
|
|
7070
|
+
className: "text-3xl font-bold text-slate-800 dark:text-white tracking-tight leading-tight",
|
|
7071
|
+
children: title
|
|
7072
|
+
}
|
|
7073
|
+
),
|
|
7074
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
7075
|
+
ITText,
|
|
7076
|
+
{
|
|
7077
|
+
as: "p",
|
|
7078
|
+
className: "text-sm font-light text-slate-500 dark:text-slate-400 mt-1 leading-relaxed",
|
|
7079
|
+
children: description
|
|
7080
|
+
}
|
|
7081
|
+
)
|
|
7082
|
+
] })
|
|
6690
7083
|
] }),
|
|
6691
|
-
!showTopRow && actions && /* @__PURE__ */ (0,
|
|
7084
|
+
!showTopRow && actions && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex items-center gap-3 flex-shrink-0", children: actions })
|
|
6692
7085
|
] })
|
|
6693
7086
|
] });
|
|
6694
7087
|
}
|
|
6695
7088
|
|
|
6696
7089
|
// src/components/skeleton/skeleton.tsx
|
|
6697
|
-
var
|
|
6698
|
-
var
|
|
7090
|
+
var import_clsx27 = __toESM(require("clsx"), 1);
|
|
7091
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
6699
7092
|
var variantClasses = {
|
|
6700
7093
|
text: "rounded-md h-4 w-full",
|
|
6701
7094
|
circular: "rounded-full",
|
|
@@ -6715,10 +7108,10 @@ function ITSkeleton({
|
|
|
6715
7108
|
...style
|
|
6716
7109
|
};
|
|
6717
7110
|
const items = Array.from({ length: count }, (_, i) => i);
|
|
6718
|
-
return /* @__PURE__ */ (0,
|
|
7111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_jsx_runtime35.Fragment, { children: items.map((i) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6719
7112
|
"div",
|
|
6720
7113
|
{
|
|
6721
|
-
className: (0,
|
|
7114
|
+
className: (0, import_clsx27.default)(
|
|
6722
7115
|
"animate-pulse bg-slate-200 dark:bg-slate-700",
|
|
6723
7116
|
variantClasses[variant],
|
|
6724
7117
|
variant === "text" && count > 1 && i < count - 1 && "mb-2",
|
|
@@ -6734,9 +7127,9 @@ function ITSkeleton({
|
|
|
6734
7127
|
}
|
|
6735
7128
|
|
|
6736
7129
|
// src/components/stack/stack.tsx
|
|
6737
|
-
var
|
|
6738
|
-
var
|
|
6739
|
-
var
|
|
7130
|
+
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
7131
|
+
var import_react26 = require("react");
|
|
7132
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
6740
7133
|
var directionMap2 = {
|
|
6741
7134
|
row: "flex-row",
|
|
6742
7135
|
column: "flex-col",
|
|
@@ -6776,15 +7169,15 @@ function ITStack({
|
|
|
6776
7169
|
as: Component = "div"
|
|
6777
7170
|
}) {
|
|
6778
7171
|
const hasDivider = divider !== void 0;
|
|
6779
|
-
const items =
|
|
7172
|
+
const items = import_react26.Children.toArray(children);
|
|
6780
7173
|
const resolvedStyle = {
|
|
6781
7174
|
gap: spacing > 0 ? `${spacing * 0.25}rem` : void 0,
|
|
6782
7175
|
...style
|
|
6783
7176
|
};
|
|
6784
|
-
return /* @__PURE__ */ (0,
|
|
7177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6785
7178
|
Component,
|
|
6786
7179
|
{
|
|
6787
|
-
className: (0,
|
|
7180
|
+
className: (0, import_clsx28.default)(
|
|
6788
7181
|
"flex",
|
|
6789
7182
|
directionMap2[direction],
|
|
6790
7183
|
alignItems && alignMap2[alignItems],
|
|
@@ -6793,27 +7186,29 @@ function ITStack({
|
|
|
6793
7186
|
className
|
|
6794
7187
|
),
|
|
6795
7188
|
style: resolvedStyle,
|
|
6796
|
-
children: hasDivider ? items.map((child, index) => /* @__PURE__ */ (0,
|
|
7189
|
+
children: hasDivider ? items.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_react26.Fragment, { children: [
|
|
6797
7190
|
child,
|
|
6798
|
-
index < items.length - 1 && (0,
|
|
7191
|
+
index < items.length - 1 && (0, import_react26.isValidElement)(divider) ? (0, import_react26.cloneElement)(divider, { key: `divider-${index}` }) : null
|
|
6799
7192
|
] }, index)) : children
|
|
6800
7193
|
}
|
|
6801
7194
|
);
|
|
6802
7195
|
}
|
|
6803
7196
|
|
|
6804
7197
|
// src/components/page/page.tsx
|
|
6805
|
-
var
|
|
6806
|
-
var hasHeader = (props) => !!(props.title || props.description || props.breadcrumbs || props.actions || props.backAction);
|
|
7198
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
7199
|
+
var hasHeader = (props) => !!(props.title || props.description || props.breadcrumbs || props.actions || props.backAction || props.icon);
|
|
6807
7200
|
var renderHeader = (props) => {
|
|
6808
7201
|
if (!hasHeader(props)) return null;
|
|
6809
|
-
return /* @__PURE__ */ (0,
|
|
7202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6810
7203
|
ITPageHeader,
|
|
6811
7204
|
{
|
|
6812
7205
|
title: props.title || "",
|
|
6813
7206
|
description: props.description,
|
|
6814
7207
|
breadcrumbs: props.breadcrumbs,
|
|
6815
7208
|
actions: props.actions,
|
|
6816
|
-
backAction: props.backAction
|
|
7209
|
+
backAction: props.backAction,
|
|
7210
|
+
icon: props.icon,
|
|
7211
|
+
iconColor: props.iconColor
|
|
6817
7212
|
}
|
|
6818
7213
|
);
|
|
6819
7214
|
};
|
|
@@ -6829,28 +7224,36 @@ function ITPage(props) {
|
|
|
6829
7224
|
emptyDescription,
|
|
6830
7225
|
emptyAction,
|
|
6831
7226
|
className,
|
|
6832
|
-
children
|
|
7227
|
+
children,
|
|
7228
|
+
maxWidth = "7xl",
|
|
7229
|
+
noPadding = false
|
|
6833
7230
|
} = props;
|
|
6834
|
-
const wrapperClass = (0,
|
|
7231
|
+
const wrapperClass = (0, import_clsx29.default)(
|
|
7232
|
+
"mx-auto w-full",
|
|
7233
|
+
!noPadding && "px-4 sm:px-6 lg:px-8 py-6",
|
|
7234
|
+
`max-w-${maxWidth}`,
|
|
7235
|
+
"space-y-8",
|
|
7236
|
+
className
|
|
7237
|
+
);
|
|
6835
7238
|
if (loading) {
|
|
6836
|
-
return /* @__PURE__ */ (0,
|
|
7239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: wrapperClass, children: [
|
|
6837
7240
|
renderHeader(props),
|
|
6838
|
-
/* @__PURE__ */ (0,
|
|
6839
|
-
/* @__PURE__ */ (0,
|
|
6840
|
-
/* @__PURE__ */ (0,
|
|
6841
|
-
/* @__PURE__ */ (0,
|
|
7241
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(ITStack, { spacing: 6, children: [
|
|
7242
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ITSkeleton, { variant: "rectangular", height: 40, width: "40%", className: "rounded-lg" }),
|
|
7243
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ITSkeleton, { variant: "rectangular", height: 200, className: "rounded-lg" }),
|
|
7244
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ITSkeleton, { variant: "rectangular", height: 200, className: "rounded-lg" })
|
|
6842
7245
|
] })
|
|
6843
7246
|
] });
|
|
6844
7247
|
}
|
|
6845
7248
|
if (error) {
|
|
6846
|
-
return /* @__PURE__ */ (0,
|
|
7249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: wrapperClass, children: [
|
|
6847
7250
|
renderHeader(props),
|
|
6848
|
-
/* @__PURE__ */ (0,
|
|
7251
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6849
7252
|
ITEmptyState,
|
|
6850
7253
|
{
|
|
6851
7254
|
title: errorTitle || "Error",
|
|
6852
7255
|
description: error,
|
|
6853
|
-
action: onRetry ? /* @__PURE__ */ (0,
|
|
7256
|
+
action: onRetry ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6854
7257
|
ITButton,
|
|
6855
7258
|
{
|
|
6856
7259
|
label: errorActionLabel || "Reintentar",
|
|
@@ -6863,9 +7266,9 @@ function ITPage(props) {
|
|
|
6863
7266
|
] });
|
|
6864
7267
|
}
|
|
6865
7268
|
if (empty) {
|
|
6866
|
-
return /* @__PURE__ */ (0,
|
|
7269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: wrapperClass, children: [
|
|
6867
7270
|
renderHeader(props),
|
|
6868
|
-
/* @__PURE__ */ (0,
|
|
7271
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6869
7272
|
ITEmptyState,
|
|
6870
7273
|
{
|
|
6871
7274
|
title: emptyTitle || "Sin datos",
|
|
@@ -6875,16 +7278,16 @@ function ITPage(props) {
|
|
|
6875
7278
|
)
|
|
6876
7279
|
] });
|
|
6877
7280
|
}
|
|
6878
|
-
return /* @__PURE__ */ (0,
|
|
7281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: wrapperClass, children: [
|
|
6879
7282
|
renderHeader(props),
|
|
6880
7283
|
children
|
|
6881
7284
|
] });
|
|
6882
7285
|
}
|
|
6883
7286
|
|
|
6884
7287
|
// src/components/popover/popover.tsx
|
|
6885
|
-
var
|
|
6886
|
-
var
|
|
6887
|
-
var
|
|
7288
|
+
var import_react27 = require("react");
|
|
7289
|
+
var import_clsx30 = __toESM(require("clsx"), 1);
|
|
7290
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
6888
7291
|
var positionClasses = {
|
|
6889
7292
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
6890
7293
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
@@ -6899,23 +7302,23 @@ function ITPopover({
|
|
|
6899
7302
|
onClose,
|
|
6900
7303
|
className
|
|
6901
7304
|
}) {
|
|
6902
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
7305
|
+
const [internalOpen, setInternalOpen] = (0, import_react27.useState)(false);
|
|
6903
7306
|
const isControlled = controlledOpen !== void 0;
|
|
6904
7307
|
const open = isControlled ? controlledOpen : internalOpen;
|
|
6905
|
-
const ref = (0,
|
|
7308
|
+
const ref = (0, import_react27.useRef)(null);
|
|
6906
7309
|
useClickOutside_default(ref, () => {
|
|
6907
7310
|
if (isControlled) onClose?.();
|
|
6908
7311
|
else setInternalOpen(false);
|
|
6909
7312
|
});
|
|
6910
|
-
return /* @__PURE__ */ (0,
|
|
6911
|
-
/* @__PURE__ */ (0,
|
|
6912
|
-
open && /* @__PURE__ */ (0,
|
|
7313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { ref, className: (0, import_clsx30.default)("relative inline-flex", className), children: [
|
|
7314
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { onClick: () => isControlled ? onClose?.() : setInternalOpen((p) => !p), className: "cursor-pointer", children: trigger }),
|
|
7315
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: (0, import_clsx30.default)("absolute z-[200]", positionClasses[position]), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "bg-white dark:bg-slate-800 rounded-xl shadow-xl border border-slate-200 dark:border-slate-700 p-3 min-w-[160px]", children }) })
|
|
6913
7316
|
] });
|
|
6914
7317
|
}
|
|
6915
7318
|
|
|
6916
7319
|
// src/components/progress/progress.tsx
|
|
6917
|
-
var
|
|
6918
|
-
var
|
|
7320
|
+
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
7321
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
6919
7322
|
var colorMap = {
|
|
6920
7323
|
primary: "bg-primary-500",
|
|
6921
7324
|
secondary: "bg-secondary-500",
|
|
@@ -6942,18 +7345,18 @@ function ITProgress({
|
|
|
6942
7345
|
style
|
|
6943
7346
|
}) {
|
|
6944
7347
|
const pct = Math.min(Math.max(value / max * 100, 0), 100);
|
|
6945
|
-
return /* @__PURE__ */ (0,
|
|
7348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6946
7349
|
"div",
|
|
6947
7350
|
{
|
|
6948
|
-
className: (0,
|
|
7351
|
+
className: (0, import_clsx31.default)("w-full bg-slate-200 dark:bg-slate-700 rounded-full overflow-hidden", sizeMap3[size], className),
|
|
6949
7352
|
style,
|
|
6950
7353
|
role: "progressbar",
|
|
6951
7354
|
"aria-valuenow": variant === "determinate" ? value : void 0,
|
|
6952
7355
|
"aria-valuemax": max,
|
|
6953
|
-
children: /* @__PURE__ */ (0,
|
|
7356
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6954
7357
|
"div",
|
|
6955
7358
|
{
|
|
6956
|
-
className: (0,
|
|
7359
|
+
className: (0, import_clsx31.default)(
|
|
6957
7360
|
"h-full rounded-full transition-all duration-500",
|
|
6958
7361
|
colorMap[color],
|
|
6959
7362
|
variant === "indeterminate" && "animate-pulse w-1/2"
|
|
@@ -6966,8 +7369,8 @@ function ITProgress({
|
|
|
6966
7369
|
}
|
|
6967
7370
|
|
|
6968
7371
|
// src/components/radio/radio.tsx
|
|
6969
|
-
var
|
|
6970
|
-
var
|
|
7372
|
+
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
7373
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
6971
7374
|
function ITRadioGroup({
|
|
6972
7375
|
name,
|
|
6973
7376
|
value,
|
|
@@ -6977,25 +7380,25 @@ function ITRadioGroup({
|
|
|
6977
7380
|
direction = "column",
|
|
6978
7381
|
className
|
|
6979
7382
|
}) {
|
|
6980
|
-
return /* @__PURE__ */ (0,
|
|
7383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6981
7384
|
"div",
|
|
6982
7385
|
{
|
|
6983
|
-
className: (0,
|
|
7386
|
+
className: (0, import_clsx32.default)(
|
|
6984
7387
|
"flex gap-3",
|
|
6985
7388
|
direction === "row" ? "flex-row flex-wrap" : "flex-col",
|
|
6986
7389
|
className
|
|
6987
7390
|
),
|
|
6988
7391
|
children: options.map((opt) => {
|
|
6989
7392
|
const isSelected = opt.value === value;
|
|
6990
|
-
return /* @__PURE__ */ (0,
|
|
7393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6991
7394
|
"label",
|
|
6992
7395
|
{
|
|
6993
|
-
className: (0,
|
|
7396
|
+
className: (0, import_clsx32.default)(
|
|
6994
7397
|
"inline-flex items-center gap-2 cursor-pointer select-none",
|
|
6995
7398
|
disabled && "opacity-50 cursor-not-allowed"
|
|
6996
7399
|
),
|
|
6997
7400
|
children: [
|
|
6998
|
-
/* @__PURE__ */ (0,
|
|
7401
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6999
7402
|
"input",
|
|
7000
7403
|
{
|
|
7001
7404
|
type: "radio",
|
|
@@ -7007,18 +7410,18 @@ function ITRadioGroup({
|
|
|
7007
7410
|
className: "peer sr-only"
|
|
7008
7411
|
}
|
|
7009
7412
|
),
|
|
7010
|
-
/* @__PURE__ */ (0,
|
|
7413
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7011
7414
|
"div",
|
|
7012
7415
|
{
|
|
7013
|
-
className: (0,
|
|
7416
|
+
className: (0, import_clsx32.default)(
|
|
7014
7417
|
"w-4 h-4 rounded-full border-2 flex items-center justify-center transition-all",
|
|
7015
7418
|
isSelected ? "border-primary-500" : "border-slate-300 dark:border-slate-600",
|
|
7016
7419
|
!disabled && "peer-focus:ring-2 peer-focus:ring-primary-200"
|
|
7017
7420
|
),
|
|
7018
|
-
children: isSelected && /* @__PURE__ */ (0,
|
|
7421
|
+
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-2 h-2 rounded-full bg-primary-500" })
|
|
7019
7422
|
}
|
|
7020
7423
|
),
|
|
7021
|
-
/* @__PURE__ */ (0,
|
|
7424
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ITText, { as: "span", className: "text-sm text-slate-700 dark:text-slate-300", children: opt.label })
|
|
7022
7425
|
]
|
|
7023
7426
|
},
|
|
7024
7427
|
opt.value
|
|
@@ -7028,189 +7431,12 @@ function ITRadioGroup({
|
|
|
7028
7431
|
);
|
|
7029
7432
|
}
|
|
7030
7433
|
|
|
7031
|
-
// src/components/search-select/search-select.tsx
|
|
7032
|
-
var import_react27 = require("react");
|
|
7033
|
-
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
7034
|
-
var import_fa17 = require("react-icons/fa");
|
|
7035
|
-
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
7036
|
-
function ITSearchSelect({
|
|
7037
|
-
name,
|
|
7038
|
-
options = [],
|
|
7039
|
-
label,
|
|
7040
|
-
placeholder = "Selecciona una opci\xF3n",
|
|
7041
|
-
valueField = "value",
|
|
7042
|
-
labelField = "label",
|
|
7043
|
-
value,
|
|
7044
|
-
onChange,
|
|
7045
|
-
onBlur,
|
|
7046
|
-
disabled = false,
|
|
7047
|
-
className,
|
|
7048
|
-
touched,
|
|
7049
|
-
required,
|
|
7050
|
-
error,
|
|
7051
|
-
readOnly = false,
|
|
7052
|
-
onSearch,
|
|
7053
|
-
isLoading = false,
|
|
7054
|
-
noResultsMessage = "No se encontraron resultados"
|
|
7055
|
-
}) {
|
|
7056
|
-
const [isOpen, setIsOpen] = (0, import_react27.useState)(false);
|
|
7057
|
-
const [searchTerm, setSearchTerm] = (0, import_react27.useState)("");
|
|
7058
|
-
const [isFocused, setIsFocused] = (0, import_react27.useState)(false);
|
|
7059
|
-
const [localTouched, setLocalTouched] = (0, import_react27.useState)(false);
|
|
7060
|
-
const containerRef = (0, import_react27.useRef)(null);
|
|
7061
|
-
const timeoutRef = (0, import_react27.useRef)(null);
|
|
7062
|
-
const selectedOption = (0, import_react27.useMemo)(() => {
|
|
7063
|
-
return options.find((opt) => opt[valueField] === value);
|
|
7064
|
-
}, [options, value, valueField]);
|
|
7065
|
-
(0, import_react27.useEffect)(() => {
|
|
7066
|
-
if (!isFocused) {
|
|
7067
|
-
setSearchTerm(selectedOption ? String(selectedOption[labelField]) : "");
|
|
7068
|
-
}
|
|
7069
|
-
}, [selectedOption, isFocused, labelField]);
|
|
7070
|
-
(0, import_react27.useEffect)(() => {
|
|
7071
|
-
function handleClickOutside(event) {
|
|
7072
|
-
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
7073
|
-
setIsOpen(false);
|
|
7074
|
-
}
|
|
7075
|
-
}
|
|
7076
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
7077
|
-
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
7078
|
-
}, []);
|
|
7079
|
-
const filteredOptions = (0, import_react27.useMemo)(() => {
|
|
7080
|
-
if (onSearch) return options;
|
|
7081
|
-
if (!searchTerm || !isFocused) return options;
|
|
7082
|
-
return options.filter(
|
|
7083
|
-
(opt) => String(opt[labelField]).toLowerCase().includes(searchTerm.toLowerCase())
|
|
7084
|
-
);
|
|
7085
|
-
}, [options, searchTerm, onSearch, labelField, isFocused]);
|
|
7086
|
-
const handleInputChange = (e) => {
|
|
7087
|
-
const query = e.target.value;
|
|
7088
|
-
setSearchTerm(query);
|
|
7089
|
-
setIsOpen(true);
|
|
7090
|
-
if (onSearch) {
|
|
7091
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
7092
|
-
timeoutRef.current = setTimeout(() => {
|
|
7093
|
-
onSearch(query);
|
|
7094
|
-
}, 500);
|
|
7095
|
-
}
|
|
7096
|
-
};
|
|
7097
|
-
const handleSelect = (option) => {
|
|
7098
|
-
if (onChange) {
|
|
7099
|
-
onChange(option[valueField], option);
|
|
7100
|
-
}
|
|
7101
|
-
setSearchTerm(String(option[labelField]));
|
|
7102
|
-
setIsOpen(false);
|
|
7103
|
-
};
|
|
7104
|
-
const handleFocus = () => {
|
|
7105
|
-
if (disabled || readOnly) return;
|
|
7106
|
-
setIsFocused(true);
|
|
7107
|
-
setIsOpen(true);
|
|
7108
|
-
};
|
|
7109
|
-
const handleInputBlur = (e) => {
|
|
7110
|
-
setTimeout(() => {
|
|
7111
|
-
setIsFocused(false);
|
|
7112
|
-
setLocalTouched(true);
|
|
7113
|
-
onBlur?.(e);
|
|
7114
|
-
}, 200);
|
|
7115
|
-
};
|
|
7116
|
-
const inputTheme = theme.input || {};
|
|
7117
|
-
const isTouched = touched !== void 0 ? touched : localTouched;
|
|
7118
|
-
const isEmpty = value === void 0 || value === null || String(value).trim() === "";
|
|
7119
|
-
const effectiveError = error !== void 0 && error !== false ? error === true ? "Este campo es requerido" : error : required && isEmpty ? "Este campo es requerido" : void 0;
|
|
7120
|
-
const hasError = isTouched && !!effectiveError;
|
|
7121
|
-
const errorMessage = typeof effectiveError === "string" ? effectiveError : "Este campo es requerido";
|
|
7122
|
-
const getInputStyle = () => {
|
|
7123
|
-
const style = {
|
|
7124
|
-
backgroundColor: inputTheme.backgroundColor || "#ffffff",
|
|
7125
|
-
borderColor: inputTheme.borderColor || "#e2e8f0",
|
|
7126
|
-
borderRadius: inputTheme.borderRadius || "0.5rem",
|
|
7127
|
-
padding: inputTheme.padding || "0.5rem 0.75rem",
|
|
7128
|
-
fontSize: inputTheme.fontSize || "0.875rem",
|
|
7129
|
-
borderWidth: "1px",
|
|
7130
|
-
borderStyle: "solid",
|
|
7131
|
-
transition: "all 0.2s",
|
|
7132
|
-
color: "var(--input-text-color, var(--color-secondary-900))",
|
|
7133
|
-
width: "100%"
|
|
7134
|
-
};
|
|
7135
|
-
if (disabled) {
|
|
7136
|
-
style.backgroundColor = inputTheme.disabled?.backgroundColor || "#f1f5f9";
|
|
7137
|
-
style.borderColor = inputTheme.disabled?.borderColor || "#e2e8f0";
|
|
7138
|
-
style.opacity = 0.7;
|
|
7139
|
-
style.cursor = "not-allowed";
|
|
7140
|
-
}
|
|
7141
|
-
if (hasError) {
|
|
7142
|
-
style.borderColor = inputTheme.error?.borderColor || "red";
|
|
7143
|
-
if (isFocused) {
|
|
7144
|
-
style.boxShadow = inputTheme.error?.ring;
|
|
7145
|
-
}
|
|
7146
|
-
} else if (isFocused && !readOnly) {
|
|
7147
|
-
style.boxShadow = inputTheme.focus?.ring;
|
|
7148
|
-
style.borderColor = inputTheme.focus?.borderColor;
|
|
7149
|
-
}
|
|
7150
|
-
return style;
|
|
7151
|
-
};
|
|
7152
|
-
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: (0, import_clsx32.default)("w-full flex flex-col gap-1.5", className, isOpen && "relative z-30"), ref: containerRef, children: [
|
|
7153
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
7154
|
-
ITText,
|
|
7155
|
-
{
|
|
7156
|
-
as: "label",
|
|
7157
|
-
className: (0, import_clsx32.default)("text-sm font-medium text-gray-700 dark:text-slate-300", {
|
|
7158
|
-
"text-red-500": hasError
|
|
7159
|
-
}),
|
|
7160
|
-
children: [
|
|
7161
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ITText, { as: "span", children: label }),
|
|
7162
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ITText, { as: "span", className: "text-red-500 ml-1", children: "*" })
|
|
7163
|
-
]
|
|
7164
|
-
}
|
|
7165
|
-
),
|
|
7166
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "relative", children: [
|
|
7167
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "relative flex items-center", children: [
|
|
7168
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7169
|
-
"input",
|
|
7170
|
-
{
|
|
7171
|
-
type: "text",
|
|
7172
|
-
name,
|
|
7173
|
-
value: searchTerm,
|
|
7174
|
-
onChange: handleInputChange,
|
|
7175
|
-
onFocus: handleFocus,
|
|
7176
|
-
onBlur: handleInputBlur,
|
|
7177
|
-
disabled,
|
|
7178
|
-
readOnly,
|
|
7179
|
-
placeholder,
|
|
7180
|
-
className: "outline-none pr-10",
|
|
7181
|
-
style: getInputStyle(),
|
|
7182
|
-
autoComplete: "off"
|
|
7183
|
-
}
|
|
7184
|
-
),
|
|
7185
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "absolute right-3 flex items-center gap-2 text-gray-400 pointer-events-none", children: [
|
|
7186
|
-
isLoading && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "animate-spin h-4 w-4 border-2 border-primary-500 border-t-transparent rounded-full" }),
|
|
7187
|
-
!isLoading && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_fa17.FaSearch, { size: 14, className: (0, import_clsx32.default)({ "text-primary-500": isFocused }) })
|
|
7188
|
-
] })
|
|
7189
|
-
] }),
|
|
7190
|
-
isOpen && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "absolute z-50 w-full mt-1 bg-white dark:bg-slate-900 border border-gray-200 dark:border-slate-800 rounded-lg shadow-xl overflow-hidden animate-in fade-in zoom-in duration-200 origin-top", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "max-h-60 overflow-y-auto", children: filteredOptions.length > 0 ? filteredOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7191
|
-
ITText,
|
|
7192
|
-
{
|
|
7193
|
-
as: "div",
|
|
7194
|
-
onClick: () => handleSelect(option),
|
|
7195
|
-
className: (0, import_clsx32.default)(
|
|
7196
|
-
"px-4 py-2 text-sm cursor-pointer transition-colors",
|
|
7197
|
-
value === option[valueField] ? "bg-primary-50 dark:bg-primary-950/40 text-primary-700 dark:text-primary-300 font-medium" : "hover:bg-gray-50 dark:hover:bg-slate-800 text-gray-700 dark:text-slate-300"
|
|
7198
|
-
),
|
|
7199
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ITText, { as: "span", children: option[labelField] })
|
|
7200
|
-
},
|
|
7201
|
-
option[valueField]
|
|
7202
|
-
)) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ITText, { as: "div", className: "px-4 py-6 text-sm text-center text-gray-500 italic", children: isLoading ? "Cargando..." : noResultsMessage }) }) })
|
|
7203
|
-
] }),
|
|
7204
|
-
hasError && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ITText, { as: "p", className: "text-red-500 text-xs mt-1", children: errorMessage })
|
|
7205
|
-
] });
|
|
7206
|
-
}
|
|
7207
|
-
|
|
7208
7434
|
// src/components/searchTable/searchTable.tsx
|
|
7209
7435
|
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
7210
7436
|
var import_react28 = require("react");
|
|
7211
7437
|
|
|
7212
7438
|
// src/components/searchTable/components/SearchInput.tsx
|
|
7213
|
-
var
|
|
7439
|
+
var import_fa19 = require("react-icons/fa");
|
|
7214
7440
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
7215
7441
|
function SearchInput({
|
|
7216
7442
|
placeholder = "Buscar en todos los campos...",
|
|
@@ -7219,7 +7445,7 @@ function SearchInput({
|
|
|
7219
7445
|
className = ""
|
|
7220
7446
|
}) {
|
|
7221
7447
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: `relative flex-1 ${className}`, children: [
|
|
7222
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7448
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_fa19.FaSearch, { className: "h-5 w-5 text-gray-400" }) }),
|
|
7223
7449
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7224
7450
|
ITInput,
|
|
7225
7451
|
{
|
|
@@ -7236,7 +7462,7 @@ function SearchInput({
|
|
|
7236
7462
|
}
|
|
7237
7463
|
|
|
7238
7464
|
// src/components/searchTable/components/SortButton.tsx
|
|
7239
|
-
var
|
|
7465
|
+
var import_fa20 = require("react-icons/fa");
|
|
7240
7466
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
7241
7467
|
function SortButton({
|
|
7242
7468
|
sortConfig,
|
|
@@ -7251,7 +7477,7 @@ function SortButton({
|
|
|
7251
7477
|
"aria-label": `Ordenar tabla ${sortConfig ? sortConfig.direction === "asc" ? "descendente" : "ascendente" : "ascendente"}`,
|
|
7252
7478
|
title: "Ordenar tabla",
|
|
7253
7479
|
children: [
|
|
7254
|
-
sortConfig ? sortConfig.direction === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7480
|
+
sortConfig ? sortConfig.direction === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_fa20.FaSortUp, { className: "w-4 h-4 text-slate-500" }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_fa20.FaSortDown, { className: "w-4 h-4 text-slate-500" }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_fa20.FaSort, { className: "w-4 h-4 text-gray-500" }),
|
|
7255
7481
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ITText, { as: "span", className: "text-sm font-medium text-gray-700", children: sortConfig ? sortConfig.direction === "asc" ? "Asc \u2191" : "Desc \u2193" : "Ordenar" })
|
|
7256
7482
|
]
|
|
7257
7483
|
}
|
|
@@ -7354,7 +7580,7 @@ var getNestedValue4 = (obj, path) => {
|
|
|
7354
7580
|
|
|
7355
7581
|
// src/components/searchTable/components/TableRow.tsx
|
|
7356
7582
|
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
7357
|
-
var
|
|
7583
|
+
var import_fa21 = require("react-icons/fa");
|
|
7358
7584
|
|
|
7359
7585
|
// src/components/searchTable/components/EditableCell.tsx
|
|
7360
7586
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
@@ -7510,13 +7736,13 @@ function TableRow({
|
|
|
7510
7736
|
return typeof value === "number" && col.currencyMX ? formatCurrencyMX2(value) : value;
|
|
7511
7737
|
case "boolean":
|
|
7512
7738
|
return value ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7513
|
-
|
|
7739
|
+
import_fa21.FaCheck,
|
|
7514
7740
|
{
|
|
7515
7741
|
className: "text-green-500",
|
|
7516
7742
|
"aria-label": "Verdadero",
|
|
7517
7743
|
title: "Verdadero"
|
|
7518
7744
|
}
|
|
7519
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7745
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_fa21.FaTimes, { className: "text-red-500", "aria-label": "Falso", title: "Falso" });
|
|
7520
7746
|
case "actions":
|
|
7521
7747
|
if (isEditing && col.saveActions) {
|
|
7522
7748
|
return col.saveActions(rowData, {
|
|
@@ -7590,7 +7816,7 @@ function TableEmptyState({
|
|
|
7590
7816
|
}
|
|
7591
7817
|
|
|
7592
7818
|
// src/components/searchTable/components/PaginationControls.tsx
|
|
7593
|
-
var
|
|
7819
|
+
var import_fa22 = require("react-icons/fa");
|
|
7594
7820
|
|
|
7595
7821
|
// src/components/searchTable/components/PaginationInfo.tsx
|
|
7596
7822
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
@@ -7656,7 +7882,7 @@ function PaginationControls({
|
|
|
7656
7882
|
className: "min-w-[32px]",
|
|
7657
7883
|
ariaLabel: "P\xE1gina anterior",
|
|
7658
7884
|
title: "Ir a la p\xE1gina anterior",
|
|
7659
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7885
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_fa22.FaArrowLeft, { "aria-hidden": "true" })
|
|
7660
7886
|
}
|
|
7661
7887
|
),
|
|
7662
7888
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(ITText, { as: "span", className: "px-4 py-2 text-sm text-gray-700", "aria-live": "polite", children: [
|
|
@@ -7675,7 +7901,7 @@ function PaginationControls({
|
|
|
7675
7901
|
className: "min-w-[32px]",
|
|
7676
7902
|
ariaLabel: "P\xE1gina siguiente",
|
|
7677
7903
|
title: "Ir a la p\xE1gina siguiente",
|
|
7678
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7904
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_fa22.FaArrowRight, { "aria-hidden": "true" })
|
|
7679
7905
|
}
|
|
7680
7906
|
)
|
|
7681
7907
|
] })
|
|
@@ -7827,7 +8053,7 @@ function ITSearchTable({
|
|
|
7827
8053
|
|
|
7828
8054
|
// src/components/sidebar/sidebar.tsx
|
|
7829
8055
|
var import_react29 = require("react");
|
|
7830
|
-
var
|
|
8056
|
+
var import_fa23 = require("react-icons/fa");
|
|
7831
8057
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
7832
8058
|
function ITSidebar({
|
|
7833
8059
|
navigationItems = [],
|
|
@@ -7987,7 +8213,7 @@ function ITSidebar({
|
|
|
7987
8213
|
{
|
|
7988
8214
|
className: `flex-shrink-0 transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)] ${expandedItems.has(item.id) ? "rotate-180" : ""}`,
|
|
7989
8215
|
style: { color: item.isActive ? "var(--sidebar-active-color, #0f172a)" : "var(--sidebar-icon-color, #64748b)", opacity: 0.7 },
|
|
7990
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
8216
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_fa23.FaChevronDown, { className: "w-3 h-3" })
|
|
7991
8217
|
}
|
|
7992
8218
|
),
|
|
7993
8219
|
item.badge && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
@@ -8395,7 +8621,7 @@ var positionStyles = {
|
|
|
8395
8621
|
// src/components/toast/toast.tsx
|
|
8396
8622
|
var import_clsx40 = __toESM(require("clsx"), 1);
|
|
8397
8623
|
var import_react31 = require("react");
|
|
8398
|
-
var
|
|
8624
|
+
var import_fa24 = require("react-icons/fa");
|
|
8399
8625
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
8400
8626
|
function ITToast({
|
|
8401
8627
|
message,
|
|
@@ -8425,15 +8651,15 @@ function ITToast({
|
|
|
8425
8651
|
const TypeIcon = () => {
|
|
8426
8652
|
switch (type) {
|
|
8427
8653
|
case "success":
|
|
8428
|
-
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_fa24.FaCheckCircle, { className: "w-5 h-5 flex-shrink-0" });
|
|
8429
8655
|
case "error":
|
|
8430
8656
|
case "danger":
|
|
8431
|
-
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_fa24.FaTimesCircle, { className: "w-5 h-5 flex-shrink-0" });
|
|
8432
8658
|
case "warning":
|
|
8433
|
-
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_fa24.FaExclamationTriangle, { className: "w-5 h-5 flex-shrink-0" });
|
|
8434
8660
|
case "info":
|
|
8435
8661
|
default:
|
|
8436
|
-
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_fa24.FaInfoCircle, { className: "w-5 h-5 flex-shrink-0" });
|
|
8437
8663
|
}
|
|
8438
8664
|
};
|
|
8439
8665
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
@@ -8462,7 +8688,7 @@ function ITToast({
|
|
|
8462
8688
|
onClick: handleClose,
|
|
8463
8689
|
className: "p-1.5 rounded-full hover:bg-black/15 transition-colors focus:outline-none focus:ring-2 focus:ring-white/50",
|
|
8464
8690
|
"aria-label": "Close notification",
|
|
8465
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8691
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_fa24.FaTimes, { className: "w-4 h-4" })
|
|
8466
8692
|
}
|
|
8467
8693
|
)
|
|
8468
8694
|
]
|
|
@@ -8474,7 +8700,8 @@ function ITToast({
|
|
|
8474
8700
|
var import_react32 = require("react");
|
|
8475
8701
|
var import_react_dropzone = require("react-dropzone");
|
|
8476
8702
|
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
8477
|
-
|
|
8703
|
+
|
|
8704
|
+
// src/components/dropfile/dropfile.props.ts
|
|
8478
8705
|
var FileTypeEnum = /* @__PURE__ */ ((FileTypeEnum2) => {
|
|
8479
8706
|
FileTypeEnum2["PDF"] = "application/pdf";
|
|
8480
8707
|
FileTypeEnum2["XLS"] = "application/vnd.ms-excel";
|
|
@@ -8492,6 +8719,9 @@ var UploadStatus = /* @__PURE__ */ ((UploadStatus2) => {
|
|
|
8492
8719
|
UploadStatus2["ERROR"] = "error";
|
|
8493
8720
|
return UploadStatus2;
|
|
8494
8721
|
})(UploadStatus || {});
|
|
8722
|
+
|
|
8723
|
+
// src/components/dropfile/dropfile.tsx
|
|
8724
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
8495
8725
|
var ITDropfile = ({
|
|
8496
8726
|
onFileSelect,
|
|
8497
8727
|
onCancel,
|
|
@@ -8787,7 +9017,7 @@ var import_react34 = require("react");
|
|
|
8787
9017
|
var import_clsx42 = __toESM(require("clsx"), 1);
|
|
8788
9018
|
|
|
8789
9019
|
// src/components/topbar/topbar.tsx
|
|
8790
|
-
var
|
|
9020
|
+
var import_fa25 = require("react-icons/fa");
|
|
8791
9021
|
var import_react33 = require("react");
|
|
8792
9022
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
8793
9023
|
function ITTopBar({
|
|
@@ -8823,7 +9053,7 @@ function ITTopBar({
|
|
|
8823
9053
|
onMouseEnter: (e) => e.currentTarget.style.backgroundColor = "var(--topbar-user-hover, #f1f5f9)",
|
|
8824
9054
|
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "transparent",
|
|
8825
9055
|
onClick: onToggleMobileMenu,
|
|
8826
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9056
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_fa25.FaBars, { className: "w-[1.125rem] h-[1.125rem]" })
|
|
8827
9057
|
}
|
|
8828
9058
|
),
|
|
8829
9059
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
@@ -8885,7 +9115,7 @@ function ITTopBar({
|
|
|
8885
9115
|
src: userMenu.userImage,
|
|
8886
9116
|
alt: "Current user"
|
|
8887
9117
|
}
|
|
8888
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime60.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_runtime60.jsx)(
|
|
9118
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime60.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_runtime60.jsx)(import_fa25.FaUserCircle, { className: "w-6 h-6", style: { color: "var(--topbar-icon, #94a3b8)" } }) }),
|
|
8889
9119
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "absolute bottom-0 right-0 w-2.5 h-2.5 bg-green-500 border-2 border-white rounded-full" })
|
|
8890
9120
|
] }),
|
|
8891
9121
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "hidden sm:flex flex-col text-left py-0.5", children: [
|
|
@@ -8970,8 +9200,13 @@ function ITLayout({
|
|
|
8970
9200
|
className = "",
|
|
8971
9201
|
contentClassName = ""
|
|
8972
9202
|
}) {
|
|
8973
|
-
const [
|
|
9203
|
+
const [internalCollapsed, setInternalCollapsed] = (0, import_react34.useState)(true);
|
|
8974
9204
|
const [mobileSidebarOpen, setMobileSidebarOpen] = (0, import_react34.useState)(false);
|
|
9205
|
+
const isControlled = sidebar.isCollapsed !== void 0;
|
|
9206
|
+
const desktopCollapsed = isControlled ? sidebar.isCollapsed : internalCollapsed;
|
|
9207
|
+
const handleToggleCollapse = isControlled ? sidebar.onToggleCollapse ?? (() => {
|
|
9208
|
+
}) : () => setInternalCollapsed((v) => !v);
|
|
9209
|
+
const layoutTokens = theme.layout;
|
|
8975
9210
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: `flex flex-col h-screen overflow-hidden w-full ${className}`, children: [
|
|
8976
9211
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
8977
9212
|
ITTopBar,
|
|
@@ -8981,48 +9216,55 @@ function ITLayout({
|
|
|
8981
9216
|
onToggleMobileMenu: () => setMobileSidebarOpen((v) => !v)
|
|
8982
9217
|
}
|
|
8983
9218
|
),
|
|
8984
|
-
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
|
|
9219
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
9220
|
+
"div",
|
|
9221
|
+
{
|
|
9222
|
+
className: "flex flex-1 overflow-hidden relative",
|
|
9223
|
+
style: { backgroundColor: layoutTokens.backgroundColor },
|
|
9224
|
+
children: [
|
|
9225
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "hidden lg:block relative z-40 h-full", children: [
|
|
9226
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "w-[88px] h-full flex-shrink-0" }),
|
|
9227
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "absolute top-0 left-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9228
|
+
ITSidebar,
|
|
9229
|
+
{
|
|
9230
|
+
...sidebar,
|
|
9231
|
+
isCollapsed: desktopCollapsed,
|
|
9232
|
+
onToggleCollapse: handleToggleCollapse,
|
|
9233
|
+
visibleOnMobile: false,
|
|
9234
|
+
className: "h-full drop-shadow-2xl transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] flex-shrink-0"
|
|
9235
|
+
}
|
|
9236
|
+
) })
|
|
9237
|
+
] }),
|
|
9238
|
+
mobileSidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9004
9239
|
"div",
|
|
9005
9240
|
{
|
|
9006
|
-
className: "
|
|
9007
|
-
onClick: (
|
|
9241
|
+
className: "lg:hidden fixed inset-0 z-50 transition-opacity duration-300 backdrop-blur-sm bg-black/40",
|
|
9242
|
+
onClick: () => setMobileSidebarOpen(false),
|
|
9008
9243
|
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9009
|
-
|
|
9244
|
+
"div",
|
|
9010
9245
|
{
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
|
|
9246
|
+
className: "h-full w-fit flex transform transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)]",
|
|
9247
|
+
onClick: (e) => e.stopPropagation(),
|
|
9248
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9249
|
+
ITSidebar,
|
|
9250
|
+
{
|
|
9251
|
+
...sidebar,
|
|
9252
|
+
isCollapsed: false,
|
|
9253
|
+
visibleOnMobile: true,
|
|
9254
|
+
className: "h-full shadow-2xl relative z-[60]",
|
|
9255
|
+
onToggleCollapse: () => setMobileSidebarOpen(false),
|
|
9256
|
+
onItemClick: () => setMobileSidebarOpen(false),
|
|
9257
|
+
onSubItemClick: () => setMobileSidebarOpen(false)
|
|
9258
|
+
}
|
|
9259
|
+
)
|
|
9018
9260
|
}
|
|
9019
9261
|
)
|
|
9020
9262
|
}
|
|
9021
|
-
)
|
|
9022
|
-
|
|
9023
|
-
|
|
9024
|
-
|
|
9025
|
-
|
|
9263
|
+
),
|
|
9264
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("main", { className: "flex-1 overflow-y-auto w-full custom-scrollbar relative z-0", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: (0, import_clsx42.default)("mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8 py-6 h-full", contentClassName), children }) })
|
|
9265
|
+
]
|
|
9266
|
+
}
|
|
9267
|
+
)
|
|
9026
9268
|
] });
|
|
9027
9269
|
}
|
|
9028
9270
|
|
|
@@ -9114,7 +9356,7 @@ function ITLoader({
|
|
|
9114
9356
|
// src/components/stepper/stepper.tsx
|
|
9115
9357
|
var import_clsx43 = __toESM(require("clsx"), 1);
|
|
9116
9358
|
var import_react35 = require("react");
|
|
9117
|
-
var
|
|
9359
|
+
var import_fa26 = require("react-icons/fa");
|
|
9118
9360
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
9119
9361
|
function ITStepper({
|
|
9120
9362
|
steps,
|
|
@@ -9182,7 +9424,7 @@ function ITStepper({
|
|
|
9182
9424
|
const renderStepContent = (index, isCompleted, isActive) => {
|
|
9183
9425
|
const step = steps[index];
|
|
9184
9426
|
if (isCompleted) {
|
|
9185
|
-
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
9427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_fa26.FaCheck, { className: "w-4 h-4" });
|
|
9186
9428
|
}
|
|
9187
9429
|
if (step.icon && useIcons) {
|
|
9188
9430
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex items-center justify-center w-5 h-5", children: step.icon });
|
|
@@ -9278,7 +9520,7 @@ function ITStepper({
|
|
|
9278
9520
|
disabled: currentStep === 0,
|
|
9279
9521
|
onClick: prevStep,
|
|
9280
9522
|
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9281
|
-
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
9523
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_fa26.FaChevronLeft, {}),
|
|
9282
9524
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ITText, { as: "span", children: "Atr\xE1s" })
|
|
9283
9525
|
] })
|
|
9284
9526
|
}
|
|
@@ -9299,7 +9541,7 @@ function ITStepper({
|
|
|
9299
9541
|
onClick: nextStep,
|
|
9300
9542
|
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9301
9543
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ITText, { as: "span", children: currentStep === steps.length - 1 ? "Finalizar" : "Siguiente" }),
|
|
9302
|
-
currentStep === steps.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
9544
|
+
currentStep === steps.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_fa26.FaCheck, {}) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_fa26.FaChevronRight, {})
|
|
9303
9545
|
] })
|
|
9304
9546
|
}
|
|
9305
9547
|
)
|