@axzydev/axzy_ui_system 1.2.7 → 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 +576 -398
- 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 +1463 -86
- package/dist/index.d.ts +1463 -86
- package/dist/index.js +597 -417
- 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 +19 -0
- 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 +29 -2
- 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 +27 -0
- package/src/components/page/page.doc.mdx +80 -0
- package/src/components/page/page.props.ts +21 -0
- package/src/components/page/page.tsx +18 -0
- package/src/components/page-header/page-header.doc.mdx +54 -0
- package/src/components/page-header/page-header.props.ts +9 -0
- package/src/components/page-header/page-header.tsx +15 -0
- 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 +2 -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 +688 -391
- package/src/showcases/ShowcaseLayout.tsx +237 -73
- package/src/showcases/StructureShowcases.tsx +846 -73
- package/src/types/table.types.ts +1 -1
- package/src/utils/styles.ts +2 -1
package/dist/index.js
CHANGED
|
@@ -344,21 +344,31 @@ var sizeMap = {
|
|
|
344
344
|
lg: { container: "w-12 h-12", text: "text-base" },
|
|
345
345
|
xl: { container: "w-16 h-16", text: "text-xl" }
|
|
346
346
|
};
|
|
347
|
+
var DEFAULT_COLOR = "bg-primary-600";
|
|
348
|
+
var DEFAULT_BG = "var(--color-primary-600)";
|
|
349
|
+
var DEFAULT_SHADOW = "0 4px 14px 0 rgba(37, 99, 235, 0.35)";
|
|
347
350
|
function ITAvatar({
|
|
348
351
|
src,
|
|
349
352
|
alt = "",
|
|
350
353
|
initials,
|
|
351
354
|
size = "md",
|
|
352
|
-
color =
|
|
355
|
+
color = DEFAULT_COLOR,
|
|
353
356
|
className,
|
|
354
357
|
badge,
|
|
355
358
|
onClick
|
|
356
359
|
}) {
|
|
357
360
|
const { container, text } = sizeMap[size];
|
|
361
|
+
const useInlineStyle = !color || color === DEFAULT_COLOR;
|
|
358
362
|
return /* @__PURE__ */ jsxs2(
|
|
359
363
|
"div",
|
|
360
364
|
{
|
|
361
|
-
className: clsx2(
|
|
365
|
+
className: clsx2(
|
|
366
|
+
"relative inline-flex items-center justify-center rounded-full flex-shrink-0 overflow-hidden text-white font-bold tracking-wide",
|
|
367
|
+
container,
|
|
368
|
+
!useInlineStyle && color,
|
|
369
|
+
className
|
|
370
|
+
),
|
|
371
|
+
style: useInlineStyle ? { backgroundColor: DEFAULT_BG, boxShadow: DEFAULT_SHADOW } : void 0,
|
|
362
372
|
onClick,
|
|
363
373
|
role: onClick ? "button" : void 0,
|
|
364
374
|
tabIndex: onClick ? 0 : void 0,
|
|
@@ -373,7 +383,7 @@ function ITAvatar({
|
|
|
373
383
|
e.currentTarget.style.display = "none";
|
|
374
384
|
}
|
|
375
385
|
}
|
|
376
|
-
) : /* @__PURE__ */ jsx3("
|
|
386
|
+
) : /* @__PURE__ */ jsx3("span", { className: clsx2("flex items-center justify-center w-full h-full", text), children: /* @__PURE__ */ jsx3(ITText, { as: "span", className: "text-white", children: initials || alt.charAt(0).toUpperCase() || "?" }) }),
|
|
377
387
|
badge && /* @__PURE__ */ jsx3("div", { className: "absolute -bottom-0.5 -right-0.5", children: badge })
|
|
378
388
|
]
|
|
379
389
|
}
|
|
@@ -1734,7 +1744,7 @@ function ITConfirmDialog({
|
|
|
1734
1744
|
// src/types/table.types.ts
|
|
1735
1745
|
var variantStyles = {
|
|
1736
1746
|
default: "",
|
|
1737
|
-
striped: "
|
|
1747
|
+
striped: "",
|
|
1738
1748
|
bordered: "border border-gray-200"
|
|
1739
1749
|
};
|
|
1740
1750
|
var sizeStyles = {
|
|
@@ -1745,8 +1755,8 @@ var sizeStyles = {
|
|
|
1745
1755
|
|
|
1746
1756
|
// src/components/data-table/dataTable.tsx
|
|
1747
1757
|
import clsx15 from "clsx";
|
|
1748
|
-
import { useState as
|
|
1749
|
-
import { FaCheck as FaCheck2, FaSpinner as FaSpinner2, FaTimes as FaTimes3 } from "react-icons/fa";
|
|
1758
|
+
import { useState as useState10, useEffect as useEffect5, useCallback as useCallback5, useRef as useRef4 } from "react";
|
|
1759
|
+
import { FaCheck as FaCheck2, FaSpinner as FaSpinner2, FaTimes as FaTimes3, FaTable as FaTable2, FaThLarge as FaThLarge2 } from "react-icons/fa";
|
|
1750
1760
|
import { MdOutlineSwapVert as MdOutlineSwapVert2 } from "react-icons/md";
|
|
1751
1761
|
|
|
1752
1762
|
// src/components/input/input.tsx
|
|
@@ -1777,6 +1787,7 @@ function getGridColsClass(columns) {
|
|
|
1777
1787
|
return gridColsClasses[columns] || "grid-cols-12";
|
|
1778
1788
|
}
|
|
1779
1789
|
function getColSpanClass(span, maxCols) {
|
|
1790
|
+
if (span == null) return `col-span-${maxCols}`;
|
|
1780
1791
|
if (typeof span === "number") {
|
|
1781
1792
|
return `col-span-${Math.min(span, maxCols)}`;
|
|
1782
1793
|
}
|
|
@@ -2327,8 +2338,8 @@ function ITSelect({
|
|
|
2327
2338
|
borderStyle: "solid",
|
|
2328
2339
|
transition: "all 0.2s",
|
|
2329
2340
|
color: "var(--input-text-color, var(--color-secondary-900))",
|
|
2330
|
-
appearance: "none"
|
|
2331
|
-
|
|
2341
|
+
appearance: "none",
|
|
2342
|
+
colorScheme: "light dark"
|
|
2332
2343
|
};
|
|
2333
2344
|
if (disabled) {
|
|
2334
2345
|
style.backgroundColor = inputTheme.disabled?.backgroundColor || style.backgroundColor;
|
|
@@ -2584,11 +2595,13 @@ function ITPagination({
|
|
|
2584
2595
|
|
|
2585
2596
|
// src/components/table/table.tsx
|
|
2586
2597
|
import clsx14 from "clsx";
|
|
2587
|
-
import React3 from "react";
|
|
2598
|
+
import React3, { useState as useState9 } from "react";
|
|
2588
2599
|
import {
|
|
2589
2600
|
FaCheck,
|
|
2590
2601
|
FaSpinner,
|
|
2591
|
-
FaTimes as FaTimes2
|
|
2602
|
+
FaTimes as FaTimes2,
|
|
2603
|
+
FaTable,
|
|
2604
|
+
FaThLarge
|
|
2592
2605
|
} from "react-icons/fa";
|
|
2593
2606
|
import { MdOutlineSwapVert } from "react-icons/md";
|
|
2594
2607
|
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
@@ -2610,8 +2623,13 @@ function ITTable({
|
|
|
2610
2623
|
size = "md",
|
|
2611
2624
|
itemsPerPageOptions = [5, 10, 20],
|
|
2612
2625
|
defaultItemsPerPage = 10,
|
|
2613
|
-
title
|
|
2626
|
+
title,
|
|
2627
|
+
renderCard,
|
|
2628
|
+
defaultView = "table",
|
|
2629
|
+
showVerticalBorder = true,
|
|
2630
|
+
verticalBorderClassname
|
|
2614
2631
|
}) {
|
|
2632
|
+
const [viewMode, setViewMode] = useState9(defaultView);
|
|
2615
2633
|
const {
|
|
2616
2634
|
currentPage,
|
|
2617
2635
|
itemsPerPage,
|
|
@@ -2811,25 +2829,91 @@ function ITTable({
|
|
|
2811
2829
|
return value;
|
|
2812
2830
|
}
|
|
2813
2831
|
};
|
|
2832
|
+
const renderDefaultCard = (row) => {
|
|
2833
|
+
const dataCols = columns.filter((c) => c.type !== "actions");
|
|
2834
|
+
const actionCol = columns.find((c) => c.type === "actions");
|
|
2835
|
+
return /* @__PURE__ */ jsxs12("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: [
|
|
2836
|
+
dataCols.map((col) => /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2837
|
+
/* @__PURE__ */ jsx14("span", { className: "text-[10px] font-bold uppercase tracking-wider text-slate-400 whitespace-nowrap flex-shrink-0 min-w-[70px]", children: col.label }),
|
|
2838
|
+
/* @__PURE__ */ jsx14("span", { className: "text-sm font-medium text-slate-800 dark:text-white text-right truncate", children: renderCellContent(col, row) })
|
|
2839
|
+
] }, col.key)),
|
|
2840
|
+
actionCol?.actions && /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-end gap-2 pt-2 border-t border-slate-100 dark:border-slate-700", children: actionCol.actions(row) })
|
|
2841
|
+
] });
|
|
2842
|
+
};
|
|
2814
2843
|
return /* @__PURE__ */ jsx14("div", { className: clsx14("space-y-4 w-full", containerClassName), children: /* @__PURE__ */ jsxs12("div", { className: "rounded-xl shadow-sm overflow-hidden", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
|
|
2815
|
-
title && /* @__PURE__ */
|
|
2816
|
-
|
|
2844
|
+
title && /* @__PURE__ */ jsxs12("div", { className: "px-6 py-5 flex items-center justify-between", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
|
|
2845
|
+
/* @__PURE__ */ jsx14(ITText, { as: "h2", className: "text-xl font-bold text-secondary-900 leading-tight", children: title }),
|
|
2846
|
+
/* @__PURE__ */ jsxs12("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: [
|
|
2847
|
+
/* @__PURE__ */ jsxs12(
|
|
2848
|
+
"button",
|
|
2849
|
+
{
|
|
2850
|
+
onClick: () => setViewMode("table"),
|
|
2851
|
+
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"}`,
|
|
2852
|
+
children: [
|
|
2853
|
+
/* @__PURE__ */ jsx14(FaTable, { size: 11 }),
|
|
2854
|
+
"Table"
|
|
2855
|
+
]
|
|
2856
|
+
}
|
|
2857
|
+
),
|
|
2858
|
+
/* @__PURE__ */ jsxs12(
|
|
2859
|
+
"button",
|
|
2860
|
+
{
|
|
2861
|
+
onClick: () => setViewMode("cards"),
|
|
2862
|
+
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"}`,
|
|
2863
|
+
children: [
|
|
2864
|
+
/* @__PURE__ */ jsx14(FaThLarge, { size: 11 }),
|
|
2865
|
+
"Cards"
|
|
2866
|
+
]
|
|
2867
|
+
}
|
|
2868
|
+
)
|
|
2869
|
+
] })
|
|
2870
|
+
] }),
|
|
2871
|
+
!title && /* @__PURE__ */ jsx14("div", { className: "flex justify-end px-4 pt-3", children: /* @__PURE__ */ jsxs12("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: [
|
|
2872
|
+
/* @__PURE__ */ jsxs12(
|
|
2873
|
+
"button",
|
|
2874
|
+
{
|
|
2875
|
+
onClick: () => setViewMode("table"),
|
|
2876
|
+
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"}`,
|
|
2877
|
+
children: [
|
|
2878
|
+
/* @__PURE__ */ jsx14(FaTable, { size: 11 }),
|
|
2879
|
+
"Table"
|
|
2880
|
+
]
|
|
2881
|
+
}
|
|
2882
|
+
),
|
|
2883
|
+
/* @__PURE__ */ jsxs12(
|
|
2884
|
+
"button",
|
|
2885
|
+
{
|
|
2886
|
+
onClick: () => setViewMode("cards"),
|
|
2887
|
+
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"}`,
|
|
2888
|
+
children: [
|
|
2889
|
+
/* @__PURE__ */ jsx14(FaThLarge, { size: 11 }),
|
|
2890
|
+
"Cards"
|
|
2891
|
+
]
|
|
2892
|
+
}
|
|
2893
|
+
)
|
|
2894
|
+
] }) }),
|
|
2895
|
+
viewMode === "cards" ? /* @__PURE__ */ jsx14("div", { className: "p-4 space-y-3 max-h-[400px] overflow-y-auto", children: currentData.length > 0 ? currentData.map((row, i) => /* @__PURE__ */ jsx14("div", { children: renderCard ? renderCard(row) : renderDefaultCard(row) }, i)) : /* @__PURE__ */ jsxs12("div", { className: "flex flex-col items-center justify-center py-12 text-secondary-400", children: [
|
|
2896
|
+
/* @__PURE__ */ jsx14(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
|
|
2897
|
+
/* @__PURE__ */ jsx14(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
|
|
2898
|
+
] }) }) : /* @__PURE__ */ jsx14("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs12(
|
|
2817
2899
|
"table",
|
|
2818
2900
|
{
|
|
2819
2901
|
className: clsx14(
|
|
2820
2902
|
"min-w-max w-full text-sm text-left text-secondary-600",
|
|
2903
|
+
showVerticalBorder && "[&_th]:border-r [&_th:last-child]:border-r-0 [&_td]:border-r [&_td:last-child]:border-r-0",
|
|
2904
|
+
showVerticalBorder && (verticalBorderClassname || "[&_th]:border-slate-100 dark:[&_th]:border-slate-700/30 [&_td]:border-slate-100 dark:[&_td]:border-slate-700/30"),
|
|
2821
2905
|
variantStyles[variant],
|
|
2822
2906
|
sizeStyles[size]
|
|
2823
2907
|
),
|
|
2824
2908
|
children: [
|
|
2825
|
-
/* @__PURE__ */ jsx14("thead", { children: /* @__PURE__ */ jsx14("tr", { className: "bg-secondary-50
|
|
2909
|
+
/* @__PURE__ */ jsx14("thead", { children: /* @__PURE__ */ jsx14("tr", { className: "bg-secondary-50 text-xs uppercase tracking-wider font-semibold text-slate-700 dark:text-slate-200", children: columns.map((col) => /* @__PURE__ */ jsx14(
|
|
2826
2910
|
"th",
|
|
2827
2911
|
{
|
|
2828
2912
|
scope: "col",
|
|
2829
2913
|
className: clsx14("px-4 py-4 align-top", col.className),
|
|
2830
2914
|
children: /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-3 min-w-[150px]", children: [
|
|
2831
2915
|
/* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2832
|
-
/* @__PURE__ */ jsx14(ITText, { as: "span", className: "text-
|
|
2916
|
+
/* @__PURE__ */ jsx14(ITText, { as: "span", className: "text-slate-900 dark:text-white font-bold", children: col.label }),
|
|
2833
2917
|
col.sortable && col.type !== "actions" && /* @__PURE__ */ jsx14(
|
|
2834
2918
|
"button",
|
|
2835
2919
|
{
|
|
@@ -2845,10 +2929,10 @@ function ITTable({
|
|
|
2845
2929
|
},
|
|
2846
2930
|
col.key
|
|
2847
2931
|
)) }) }),
|
|
2848
|
-
/* @__PURE__ */ jsx14("tbody", { className: "divide-y divide-
|
|
2932
|
+
/* @__PURE__ */ jsx14("tbody", { className: "divide-y divide-slate-100 dark:divide-slate-700/30", children: currentData.length > 0 ? currentData.map((row, rowIndex) => /* @__PURE__ */ jsx14(
|
|
2849
2933
|
"tr",
|
|
2850
2934
|
{
|
|
2851
|
-
className: "hover:bg-secondary-50/50 transition-colors duration-150 group",
|
|
2935
|
+
className: clsx14("hover:bg-secondary-50/50 transition-colors duration-150 group", variant === "striped" && "odd:bg-secondary-50/40 dark:odd:bg-slate-800/20"),
|
|
2852
2936
|
children: columns.map((col) => /* @__PURE__ */ jsx14(
|
|
2853
2937
|
"td",
|
|
2854
2938
|
{
|
|
@@ -2866,7 +2950,7 @@ function ITTable({
|
|
|
2866
2950
|
]
|
|
2867
2951
|
}
|
|
2868
2952
|
) }),
|
|
2869
|
-
/* @__PURE__ */ jsx14("div", { className: "rounded-b-xl
|
|
2953
|
+
/* @__PURE__ */ jsx14("div", { className: "rounded-b-xl px-6 py-4", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: /* @__PURE__ */ jsx14(
|
|
2870
2954
|
ITPagination,
|
|
2871
2955
|
{
|
|
2872
2956
|
currentPage,
|
|
@@ -2902,11 +2986,16 @@ function ITDataTable({
|
|
|
2902
2986
|
size = "md",
|
|
2903
2987
|
itemsPerPageOptions = [5, 10, 20],
|
|
2904
2988
|
defaultItemsPerPage = 10,
|
|
2905
|
-
title
|
|
2989
|
+
title,
|
|
2990
|
+
renderCard,
|
|
2991
|
+
defaultView,
|
|
2992
|
+
showVerticalBorder = true,
|
|
2993
|
+
verticalBorderClassname
|
|
2906
2994
|
}) {
|
|
2907
|
-
const [
|
|
2908
|
-
const [
|
|
2909
|
-
const [
|
|
2995
|
+
const [viewMode, setViewMode] = useState10(defaultView || "table");
|
|
2996
|
+
const [data, setData] = useState10([]);
|
|
2997
|
+
const [totalItems, setTotalItems] = useState10(0);
|
|
2998
|
+
const [isLoading, setIsLoading] = useState10(fetchOnMount);
|
|
2910
2999
|
const {
|
|
2911
3000
|
currentPage,
|
|
2912
3001
|
itemsPerPage,
|
|
@@ -3047,31 +3136,70 @@ function ITDataTable({
|
|
|
3047
3136
|
return value;
|
|
3048
3137
|
}
|
|
3049
3138
|
};
|
|
3139
|
+
const renderDefaultCard = (row) => {
|
|
3140
|
+
const dataCols = columns.filter((c) => c.type !== "actions");
|
|
3141
|
+
const actionCol = columns.find((c) => c.type === "actions");
|
|
3142
|
+
return /* @__PURE__ */ jsxs13("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: [
|
|
3143
|
+
dataCols.map((col) => /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between gap-2", children: [
|
|
3144
|
+
/* @__PURE__ */ jsx15("span", { className: "text-[10px] font-bold uppercase tracking-wider text-slate-400 whitespace-nowrap flex-shrink-0 min-w-[70px]", children: col.label }),
|
|
3145
|
+
/* @__PURE__ */ jsx15("span", { className: "text-sm font-medium text-slate-800 dark:text-white text-right truncate", children: renderCellContent(col, row) })
|
|
3146
|
+
] }, col.key)),
|
|
3147
|
+
actionCol?.actions && /* @__PURE__ */ jsx15("div", { className: "flex items-center justify-end gap-2 pt-2 border-t border-slate-100 dark:border-slate-700", children: actionCol.actions(row) })
|
|
3148
|
+
] });
|
|
3149
|
+
};
|
|
3150
|
+
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"}`;
|
|
3050
3151
|
return /* @__PURE__ */ jsxs13("div", { className: clsx15("space-y-4 w-full relative", containerClassName), children: [
|
|
3051
3152
|
/* @__PURE__ */ jsxs13("div", { className: "rounded-xl shadow-sm overflow-hidden", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
|
|
3052
|
-
title && /* @__PURE__ */ jsxs13("div", { className: "px-6 py-5
|
|
3153
|
+
title && /* @__PURE__ */ jsxs13("div", { className: "px-6 py-5 flex items-center justify-between", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
|
|
3053
3154
|
/* @__PURE__ */ jsx15(ITText, { as: "h2", className: "text-xl font-bold text-secondary-900 leading-tight", children: title }),
|
|
3054
|
-
|
|
3155
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-3", children: [
|
|
3156
|
+
isLoading && /* @__PURE__ */ jsx15("div", { className: "text-secondary-400", children: loadingIndicator || /* @__PURE__ */ jsx15(FaSpinner2, { className: "animate-spin text-primary-500 text-xl" }) }),
|
|
3157
|
+
/* @__PURE__ */ jsxs13("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: [
|
|
3158
|
+
/* @__PURE__ */ jsxs13("button", { onClick: () => setViewMode("table"), className: segCtrlClass("table"), children: [
|
|
3159
|
+
/* @__PURE__ */ jsx15(FaTable2, { size: 11 }),
|
|
3160
|
+
"Table"
|
|
3161
|
+
] }),
|
|
3162
|
+
/* @__PURE__ */ jsxs13("button", { onClick: () => setViewMode("cards"), className: segCtrlClass("cards"), children: [
|
|
3163
|
+
/* @__PURE__ */ jsx15(FaThLarge2, { size: 11 }),
|
|
3164
|
+
"Cards"
|
|
3165
|
+
] })
|
|
3166
|
+
] })
|
|
3167
|
+
] })
|
|
3055
3168
|
] }),
|
|
3169
|
+
!title && /* @__PURE__ */ jsx15("div", { className: "flex justify-end px-4 pt-3", children: /* @__PURE__ */ jsxs13("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: [
|
|
3170
|
+
/* @__PURE__ */ jsxs13("button", { onClick: () => setViewMode("table"), className: segCtrlClass("table"), children: [
|
|
3171
|
+
/* @__PURE__ */ jsx15(FaTable2, { size: 11 }),
|
|
3172
|
+
"Table"
|
|
3173
|
+
] }),
|
|
3174
|
+
/* @__PURE__ */ jsxs13("button", { onClick: () => setViewMode("cards"), className: segCtrlClass("cards"), children: [
|
|
3175
|
+
/* @__PURE__ */ jsx15(FaThLarge2, { size: 11 }),
|
|
3176
|
+
"Cards"
|
|
3177
|
+
] })
|
|
3178
|
+
] }) }),
|
|
3056
3179
|
/* @__PURE__ */ jsxs13("div", { className: "overflow-x-auto relative min-h-[200px]", children: [
|
|
3057
3180
|
isLoading && /* @__PURE__ */ jsx15("div", { className: "absolute inset-0 z-20 flex items-center justify-center bg-white/40 backdrop-blur-[2px] transition-all duration-300", children: /* @__PURE__ */ jsx15("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__ */ jsxs13(Fragment3, { children: [
|
|
3058
3181
|
/* @__PURE__ */ jsx15(FaSpinner2, { className: "animate-spin text-primary-500 text-4xl" }),
|
|
3059
3182
|
/* @__PURE__ */ jsx15(ITText, { as: "span", className: "text-sm font-semibold text-secondary-600 animate-pulse", children: "Cargando datos..." })
|
|
3060
3183
|
] }) }) }),
|
|
3061
|
-
/* @__PURE__ */ jsxs13(
|
|
3184
|
+
viewMode === "cards" ? /* @__PURE__ */ jsx15("div", { className: "p-4 space-y-3 max-h-[400px] overflow-y-auto", children: data.length > 0 ? data.map((row, i) => /* @__PURE__ */ jsx15("div", { children: renderCard ? renderCard(row) : renderDefaultCard(row) }, i)) : !isLoading && /* @__PURE__ */ jsxs13("div", { className: "flex flex-col items-center justify-center py-12 text-secondary-400", children: [
|
|
3185
|
+
/* @__PURE__ */ jsx15(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
|
|
3186
|
+
/* @__PURE__ */ jsx15(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
|
|
3187
|
+
] }) }) : /* @__PURE__ */ jsxs13(
|
|
3062
3188
|
"table",
|
|
3063
3189
|
{
|
|
3064
3190
|
className: clsx15(
|
|
3065
3191
|
"min-w-max w-full text-sm text-left text-secondary-600 transition-opacity duration-300",
|
|
3192
|
+
showVerticalBorder && "[&_th]:border-r [&_th:last-child]:border-r-0 [&_td]:border-r [&_td:last-child]:border-r-0",
|
|
3193
|
+
showVerticalBorder && (verticalBorderClassname || "[&_th]:border-slate-100 dark:[&_th]:border-slate-700/30 [&_td]:border-slate-100 dark:[&_td]:border-slate-700/30"),
|
|
3066
3194
|
isLoading ? "opacity-50" : "opacity-100",
|
|
3067
3195
|
variantStyles[variant],
|
|
3068
3196
|
sizeStyles[size],
|
|
3069
3197
|
className
|
|
3070
3198
|
),
|
|
3071
3199
|
children: [
|
|
3072
|
-
/* @__PURE__ */ jsx15("thead", { children: /* @__PURE__ */ jsx15("tr", { className: "bg-
|
|
3200
|
+
/* @__PURE__ */ jsx15("thead", { children: /* @__PURE__ */ jsx15("tr", { className: "bg-secondary-50 text-xs uppercase tracking-wider font-semibold text-slate-700 dark:text-slate-200", children: columns.map((col) => /* @__PURE__ */ jsx15("th", { scope: "col", className: clsx15("px-4 py-4 align-top", col.className), children: /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-3 min-w-[150px]", children: [
|
|
3073
3201
|
/* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between gap-2", children: [
|
|
3074
|
-
/* @__PURE__ */ jsx15(ITText, { as: "span", className: "text-
|
|
3202
|
+
/* @__PURE__ */ jsx15(ITText, { as: "span", className: "text-slate-900 dark:text-white font-bold", children: col.label }),
|
|
3075
3203
|
col.sortable && col.type !== "actions" && /* @__PURE__ */ jsx15(
|
|
3076
3204
|
"button",
|
|
3077
3205
|
{
|
|
@@ -3085,7 +3213,7 @@ function ITDataTable({
|
|
|
3085
3213
|
] }),
|
|
3086
3214
|
/* @__PURE__ */ jsx15("div", { className: "w-full", children: col.filter ? renderFilterInput(col) : null })
|
|
3087
3215
|
] }) }, col.key)) }) }),
|
|
3088
|
-
/* @__PURE__ */ jsx15("tbody", { className: "divide-y divide-
|
|
3216
|
+
/* @__PURE__ */ jsx15("tbody", { className: "divide-y divide-slate-100 dark:divide-slate-700/30", children: data.length > 0 ? data.map((row, rowIndex) => /* @__PURE__ */ jsx15("tr", { className: clsx15("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__ */ jsx15("td", { className: clsx15("px-4 py-3 align-middle", col.className), children: col.type === "actions" ? /* @__PURE__ */ jsx15("div", { className: "flex items-center justify-center gap-2", children: renderCellContent(col, row) }) : /* @__PURE__ */ jsx15("div", { className: "text-secondary-700 font-medium", children: renderCellContent(col, row) }) }, `${rowIndex}-${col.key}`)) }, rowIndex)) : /* @__PURE__ */ jsx15("tr", { children: /* @__PURE__ */ jsx15("td", { colSpan: columns.length, className: "px-6 py-12 text-center", children: !isLoading && /* @__PURE__ */ jsxs13("div", { className: "flex flex-col items-center justify-center text-secondary-400", children: [
|
|
3089
3217
|
/* @__PURE__ */ jsx15(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
|
|
3090
3218
|
/* @__PURE__ */ jsx15(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
|
|
3091
3219
|
] }) }) }) })
|
|
@@ -3094,7 +3222,7 @@ function ITDataTable({
|
|
|
3094
3222
|
)
|
|
3095
3223
|
] })
|
|
3096
3224
|
] }),
|
|
3097
|
-
/* @__PURE__ */ jsx15("div", { className: "rounded-b-xl
|
|
3225
|
+
/* @__PURE__ */ jsx15("div", { className: "rounded-b-xl px-6 py-4", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: /* @__PURE__ */ jsx15(
|
|
3098
3226
|
ITPagination,
|
|
3099
3227
|
{
|
|
3100
3228
|
currentPage,
|
|
@@ -3112,7 +3240,7 @@ function ITDataTable({
|
|
|
3112
3240
|
|
|
3113
3241
|
// src/components/date-picker/datePicker.tsx
|
|
3114
3242
|
import clsx16 from "clsx";
|
|
3115
|
-
import React5, { useEffect as useEffect6, useRef as useRef5, useState as
|
|
3243
|
+
import React5, { useEffect as useEffect6, useRef as useRef5, useState as useState11 } from "react";
|
|
3116
3244
|
import { FaCalendarAlt } from "react-icons/fa";
|
|
3117
3245
|
import { isBefore as isBefore2 } from "date-fns";
|
|
3118
3246
|
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
@@ -3135,12 +3263,12 @@ function ITDatePicker({
|
|
|
3135
3263
|
maxDate,
|
|
3136
3264
|
range = false
|
|
3137
3265
|
}) {
|
|
3138
|
-
const [isOpen, setIsOpen] =
|
|
3139
|
-
const [inputValue, setInputValue] =
|
|
3140
|
-
const [isValidDate, setIsValidDate] =
|
|
3141
|
-
const [internalRange, setInternalRange] =
|
|
3266
|
+
const [isOpen, setIsOpen] = useState11(false);
|
|
3267
|
+
const [inputValue, setInputValue] = useState11("");
|
|
3268
|
+
const [isValidDate, setIsValidDate] = useState11(true);
|
|
3269
|
+
const [internalRange, setInternalRange] = useState11([null, null]);
|
|
3142
3270
|
const wrapperRef = useRef5(null);
|
|
3143
|
-
const [calendarPosition, setCalendarPosition] =
|
|
3271
|
+
const [calendarPosition, setCalendarPosition] = useState11({ top: 0, left: 0 });
|
|
3144
3272
|
const dateRange = React5.useMemo(() => {
|
|
3145
3273
|
if (range) {
|
|
3146
3274
|
if (Array.isArray(value)) return value;
|
|
@@ -3320,7 +3448,7 @@ function ITDatePicker({
|
|
|
3320
3448
|
FaCalendarAlt,
|
|
3321
3449
|
{
|
|
3322
3450
|
onClick: handleIconClick,
|
|
3323
|
-
className: "text-slate-
|
|
3451
|
+
className: "text-slate-500 dark:text-slate-400 cursor-pointer"
|
|
3324
3452
|
}
|
|
3325
3453
|
) }),
|
|
3326
3454
|
variant,
|
|
@@ -3379,11 +3507,11 @@ import { FaRegTimesCircle } from "react-icons/fa";
|
|
|
3379
3507
|
import { FaTimes as FaTimes4 } from "react-icons/fa";
|
|
3380
3508
|
|
|
3381
3509
|
// src/components/theme-provider/themeProvider.tsx
|
|
3382
|
-
import { createContext, useContext, useState as
|
|
3510
|
+
import { createContext, useContext, useState as useState13, useEffect as useEffect7 } from "react";
|
|
3383
3511
|
import { MdPalette, MdClose, MdRefresh } from "react-icons/md";
|
|
3384
3512
|
|
|
3385
3513
|
// src/components/tabs/tabs.tsx
|
|
3386
|
-
import { useState as
|
|
3514
|
+
import { useState as useState12 } from "react";
|
|
3387
3515
|
import { clsx as clsx17 } from "clsx";
|
|
3388
3516
|
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3389
3517
|
var ITTabs = ({
|
|
@@ -3394,7 +3522,7 @@ var ITTabs = ({
|
|
|
3394
3522
|
className = "",
|
|
3395
3523
|
containerClassName = ""
|
|
3396
3524
|
}) => {
|
|
3397
|
-
const [activeId, setActiveId] =
|
|
3525
|
+
const [activeId, setActiveId] = useState12(defaultActiveId || items[0]?.id);
|
|
3398
3526
|
const handleTabClick = (id, disabled) => {
|
|
3399
3527
|
if (disabled) return;
|
|
3400
3528
|
setActiveId(id);
|
|
@@ -3736,7 +3864,7 @@ function ITThemeProvider({
|
|
|
3736
3864
|
theme: theme2,
|
|
3737
3865
|
showFab = true
|
|
3738
3866
|
}) {
|
|
3739
|
-
const [palette2, setPaletteState] =
|
|
3867
|
+
const [palette2, setPaletteState] = useState13(() => {
|
|
3740
3868
|
const basePalette = {
|
|
3741
3869
|
...DEFAULT_PALETTE,
|
|
3742
3870
|
...theme2,
|
|
@@ -3762,8 +3890,8 @@ function ITThemeProvider({
|
|
|
3762
3890
|
}
|
|
3763
3891
|
return basePalette;
|
|
3764
3892
|
});
|
|
3765
|
-
const [isOpen, setIsOpen] =
|
|
3766
|
-
const [customPresets, setCustomPresets] =
|
|
3893
|
+
const [isOpen, setIsOpen] = useState13(false);
|
|
3894
|
+
const [customPresets, setCustomPresets] = useState13(() => {
|
|
3767
3895
|
try {
|
|
3768
3896
|
const saved = localStorage.getItem("it-theme-custom-presets");
|
|
3769
3897
|
return saved ? JSON.parse(saved) : [];
|
|
@@ -3772,8 +3900,8 @@ function ITThemeProvider({
|
|
|
3772
3900
|
return [];
|
|
3773
3901
|
}
|
|
3774
3902
|
});
|
|
3775
|
-
const [newPresetName, setNewPresetName] =
|
|
3776
|
-
const [isSavingPreset, setIsSavingPreset] =
|
|
3903
|
+
const [newPresetName, setNewPresetName] = useState13("");
|
|
3904
|
+
const [isSavingPreset, setIsSavingPreset] = useState13(false);
|
|
3777
3905
|
const handleSavePreset = () => {
|
|
3778
3906
|
if (!newPresetName.trim()) return;
|
|
3779
3907
|
const newPreset = {
|
|
@@ -3792,8 +3920,8 @@ function ITThemeProvider({
|
|
|
3792
3920
|
setCustomPresets(updated);
|
|
3793
3921
|
localStorage.setItem("it-theme-custom-presets", JSON.stringify(updated));
|
|
3794
3922
|
};
|
|
3795
|
-
const [resolvedTheme, setResolvedTheme] =
|
|
3796
|
-
const [darkModeMode, setDarkModeMode] =
|
|
3923
|
+
const [resolvedTheme, setResolvedTheme] = useState13("light");
|
|
3924
|
+
const [darkModeMode, setDarkModeMode] = useState13(
|
|
3797
3925
|
() => {
|
|
3798
3926
|
const saved = localStorage.getItem("it-theme-dark-mode");
|
|
3799
3927
|
if (saved === "light" || saved === "dark" || saved === "system") {
|
|
@@ -5568,17 +5696,17 @@ function ITFlex({
|
|
|
5568
5696
|
}
|
|
5569
5697
|
|
|
5570
5698
|
// src/components/form-builder/formBuilder.tsx
|
|
5571
|
-
import { useEffect as
|
|
5699
|
+
import { useEffect as useEffect13, useState as useState18, useMemo as useMemo6 } from "react";
|
|
5572
5700
|
|
|
5573
5701
|
// src/components/form-builder/formBuilder.context.tsx
|
|
5574
|
-
import React8, { createContext as createContext2, useContext as useContext2, useState as
|
|
5702
|
+
import React8, { createContext as createContext2, useContext as useContext2, useState as useState14 } from "react";
|
|
5575
5703
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
5576
5704
|
var ITFormBuilderContext = createContext2(void 0);
|
|
5577
5705
|
var ITFormBuilderProvider = ({
|
|
5578
5706
|
children,
|
|
5579
5707
|
value
|
|
5580
5708
|
}) => {
|
|
5581
|
-
const [fieldRegistry, setFieldRegistry] =
|
|
5709
|
+
const [fieldRegistry, setFieldRegistry] = useState14({});
|
|
5582
5710
|
const registerField = React8.useCallback((name, config2) => {
|
|
5583
5711
|
setFieldRegistry((prev) => ({ ...prev, [name]: config2 }));
|
|
5584
5712
|
}, []);
|
|
@@ -5612,12 +5740,12 @@ var useITFormBuilderContext = () => {
|
|
|
5612
5740
|
};
|
|
5613
5741
|
|
|
5614
5742
|
// src/components/form-builder/fieldRenderer.tsx
|
|
5615
|
-
import { memo, useCallback as useCallback6, useEffect as
|
|
5616
|
-
import
|
|
5743
|
+
import { memo, useCallback as useCallback6, useEffect as useEffect12, useState as useState17 } from "react";
|
|
5744
|
+
import clsx25 from "clsx";
|
|
5617
5745
|
|
|
5618
5746
|
// src/components/time-picker/timePicker.tsx
|
|
5619
5747
|
import clsx23 from "clsx";
|
|
5620
|
-
import { useEffect as useEffect10, useRef as useRef8, useState as
|
|
5748
|
+
import { useEffect as useEffect10, useRef as useRef8, useState as useState15 } from "react";
|
|
5621
5749
|
import { FaClock } from "react-icons/fa";
|
|
5622
5750
|
import { jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5623
5751
|
function ITTimePicker({
|
|
@@ -5636,10 +5764,10 @@ function ITTimePicker({
|
|
|
5636
5764
|
variant = "primary",
|
|
5637
5765
|
color = "primary"
|
|
5638
5766
|
}) {
|
|
5639
|
-
const [isOpen, setIsOpen] =
|
|
5640
|
-
const [inputValue, setInputValue] =
|
|
5641
|
-
const [isValidTime, setIsValidTime] =
|
|
5642
|
-
const [dropdownPosition, setDropdownPosition] =
|
|
5767
|
+
const [isOpen, setIsOpen] = useState15(false);
|
|
5768
|
+
const [inputValue, setInputValue] = useState15(value || "");
|
|
5769
|
+
const [isValidTime, setIsValidTime] = useState15(true);
|
|
5770
|
+
const [dropdownPosition, setDropdownPosition] = useState15({ top: 0, left: 0 });
|
|
5643
5771
|
const wrapperRef = useRef8(null);
|
|
5644
5772
|
const dropdownRef = useRef8(null);
|
|
5645
5773
|
const hoursRef = useRef8(null);
|
|
@@ -5775,7 +5903,7 @@ function ITTimePicker({
|
|
|
5775
5903
|
},
|
|
5776
5904
|
className: clsx23(
|
|
5777
5905
|
"cursor-pointer transition-colors",
|
|
5778
|
-
disabled ? "text-slate-400 cursor-not-allowed" : "text-slate-
|
|
5906
|
+
disabled ? "text-slate-400 cursor-not-allowed" : "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"
|
|
5779
5907
|
)
|
|
5780
5908
|
}
|
|
5781
5909
|
)
|
|
@@ -5882,27 +6010,204 @@ function ITTimePicker({
|
|
|
5882
6010
|
] });
|
|
5883
6011
|
}
|
|
5884
6012
|
|
|
6013
|
+
// src/components/search-select/search-select.tsx
|
|
6014
|
+
import { useState as useState16, useEffect as useEffect11, useRef as useRef9, useMemo as useMemo4 } from "react";
|
|
6015
|
+
import clsx24 from "clsx";
|
|
6016
|
+
import { FaSearch } from "react-icons/fa";
|
|
6017
|
+
import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
6018
|
+
function ITSearchSelect({
|
|
6019
|
+
name,
|
|
6020
|
+
options = [],
|
|
6021
|
+
label,
|
|
6022
|
+
placeholder = "Selecciona una opci\xF3n",
|
|
6023
|
+
valueField = "value",
|
|
6024
|
+
labelField = "label",
|
|
6025
|
+
value,
|
|
6026
|
+
onChange,
|
|
6027
|
+
onBlur,
|
|
6028
|
+
disabled = false,
|
|
6029
|
+
className,
|
|
6030
|
+
touched,
|
|
6031
|
+
required,
|
|
6032
|
+
error,
|
|
6033
|
+
readOnly = false,
|
|
6034
|
+
onSearch,
|
|
6035
|
+
isLoading = false,
|
|
6036
|
+
noResultsMessage = "No se encontraron resultados"
|
|
6037
|
+
}) {
|
|
6038
|
+
const [isOpen, setIsOpen] = useState16(false);
|
|
6039
|
+
const [searchTerm, setSearchTerm] = useState16("");
|
|
6040
|
+
const [isFocused, setIsFocused] = useState16(false);
|
|
6041
|
+
const [localTouched, setLocalTouched] = useState16(false);
|
|
6042
|
+
const containerRef = useRef9(null);
|
|
6043
|
+
const timeoutRef = useRef9(null);
|
|
6044
|
+
const selectedOption = useMemo4(() => {
|
|
6045
|
+
return options.find((opt) => opt[valueField] === value);
|
|
6046
|
+
}, [options, value, valueField]);
|
|
6047
|
+
useEffect11(() => {
|
|
6048
|
+
if (!isFocused) {
|
|
6049
|
+
setSearchTerm(selectedOption ? String(selectedOption[labelField]) : "");
|
|
6050
|
+
}
|
|
6051
|
+
}, [selectedOption, isFocused, labelField]);
|
|
6052
|
+
useEffect11(() => {
|
|
6053
|
+
function handleClickOutside(event) {
|
|
6054
|
+
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
6055
|
+
setIsOpen(false);
|
|
6056
|
+
}
|
|
6057
|
+
}
|
|
6058
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
6059
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
6060
|
+
}, []);
|
|
6061
|
+
const filteredOptions = useMemo4(() => {
|
|
6062
|
+
if (onSearch) return options;
|
|
6063
|
+
if (!searchTerm || !isFocused) return options;
|
|
6064
|
+
return options.filter(
|
|
6065
|
+
(opt) => String(opt[labelField]).toLowerCase().includes(searchTerm.toLowerCase())
|
|
6066
|
+
);
|
|
6067
|
+
}, [options, searchTerm, onSearch, labelField, isFocused]);
|
|
6068
|
+
const handleInputChange = (e) => {
|
|
6069
|
+
const query = e.target.value;
|
|
6070
|
+
setSearchTerm(query);
|
|
6071
|
+
setIsOpen(true);
|
|
6072
|
+
if (onSearch) {
|
|
6073
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
6074
|
+
timeoutRef.current = setTimeout(() => {
|
|
6075
|
+
onSearch(query);
|
|
6076
|
+
}, 500);
|
|
6077
|
+
}
|
|
6078
|
+
};
|
|
6079
|
+
const handleSelect = (option) => {
|
|
6080
|
+
if (onChange) {
|
|
6081
|
+
onChange(option[valueField], option);
|
|
6082
|
+
}
|
|
6083
|
+
setSearchTerm(String(option[labelField]));
|
|
6084
|
+
setIsOpen(false);
|
|
6085
|
+
};
|
|
6086
|
+
const handleFocus = () => {
|
|
6087
|
+
if (disabled || readOnly) return;
|
|
6088
|
+
setIsFocused(true);
|
|
6089
|
+
setIsOpen(true);
|
|
6090
|
+
};
|
|
6091
|
+
const handleInputBlur = (e) => {
|
|
6092
|
+
setTimeout(() => {
|
|
6093
|
+
setIsFocused(false);
|
|
6094
|
+
setLocalTouched(true);
|
|
6095
|
+
onBlur?.(e);
|
|
6096
|
+
}, 200);
|
|
6097
|
+
};
|
|
6098
|
+
const inputTheme = theme.input || {};
|
|
6099
|
+
const isTouched = touched !== void 0 ? touched : localTouched;
|
|
6100
|
+
const isEmpty = value === void 0 || value === null || String(value).trim() === "";
|
|
6101
|
+
const effectiveError = error !== void 0 && error !== false ? error === true ? "Este campo es requerido" : error : required && isEmpty ? "Este campo es requerido" : void 0;
|
|
6102
|
+
const hasError = isTouched && !!effectiveError;
|
|
6103
|
+
const errorMessage = typeof effectiveError === "string" ? effectiveError : "Este campo es requerido";
|
|
6104
|
+
const getInputStyle = () => {
|
|
6105
|
+
const style = {
|
|
6106
|
+
backgroundColor: inputTheme.backgroundColor || "#ffffff",
|
|
6107
|
+
borderColor: inputTheme.borderColor || "#e2e8f0",
|
|
6108
|
+
borderRadius: inputTheme.borderRadius || "0.5rem",
|
|
6109
|
+
padding: inputTheme.padding || "0.5rem 0.75rem",
|
|
6110
|
+
fontSize: inputTheme.fontSize || "0.875rem",
|
|
6111
|
+
borderWidth: "1px",
|
|
6112
|
+
borderStyle: "solid",
|
|
6113
|
+
transition: "all 0.2s",
|
|
6114
|
+
color: "var(--input-text-color, var(--color-secondary-900))",
|
|
6115
|
+
width: "100%"
|
|
6116
|
+
};
|
|
6117
|
+
if (disabled) {
|
|
6118
|
+
style.backgroundColor = inputTheme.disabled?.backgroundColor || "#f1f5f9";
|
|
6119
|
+
style.borderColor = inputTheme.disabled?.borderColor || "#e2e8f0";
|
|
6120
|
+
style.opacity = 0.7;
|
|
6121
|
+
style.cursor = "not-allowed";
|
|
6122
|
+
}
|
|
6123
|
+
if (hasError) {
|
|
6124
|
+
style.borderColor = inputTheme.error?.borderColor || "red";
|
|
6125
|
+
if (isFocused) {
|
|
6126
|
+
style.boxShadow = inputTheme.error?.ring;
|
|
6127
|
+
}
|
|
6128
|
+
} else if (isFocused && !readOnly) {
|
|
6129
|
+
style.boxShadow = inputTheme.focus?.ring;
|
|
6130
|
+
style.borderColor = inputTheme.focus?.borderColor;
|
|
6131
|
+
}
|
|
6132
|
+
return style;
|
|
6133
|
+
};
|
|
6134
|
+
return /* @__PURE__ */ jsxs23("div", { className: clsx24("w-full flex flex-col gap-1.5", className, isOpen && "relative z-30"), ref: containerRef, children: [
|
|
6135
|
+
label && /* @__PURE__ */ jsxs23(
|
|
6136
|
+
ITText,
|
|
6137
|
+
{
|
|
6138
|
+
as: "label",
|
|
6139
|
+
className: clsx24("text-sm font-medium text-gray-700 dark:text-slate-300", {
|
|
6140
|
+
"text-red-500": hasError
|
|
6141
|
+
}),
|
|
6142
|
+
children: [
|
|
6143
|
+
/* @__PURE__ */ jsx28(ITText, { as: "span", children: label }),
|
|
6144
|
+
required && /* @__PURE__ */ jsx28(ITText, { as: "span", className: "text-red-500 ml-1", children: "*" })
|
|
6145
|
+
]
|
|
6146
|
+
}
|
|
6147
|
+
),
|
|
6148
|
+
/* @__PURE__ */ jsxs23("div", { className: "relative", children: [
|
|
6149
|
+
/* @__PURE__ */ jsxs23("div", { className: "relative flex items-center", children: [
|
|
6150
|
+
/* @__PURE__ */ jsx28(
|
|
6151
|
+
"input",
|
|
6152
|
+
{
|
|
6153
|
+
type: "text",
|
|
6154
|
+
name,
|
|
6155
|
+
value: searchTerm,
|
|
6156
|
+
onChange: handleInputChange,
|
|
6157
|
+
onFocus: handleFocus,
|
|
6158
|
+
onBlur: handleInputBlur,
|
|
6159
|
+
disabled,
|
|
6160
|
+
readOnly,
|
|
6161
|
+
placeholder,
|
|
6162
|
+
className: "outline-none pr-10",
|
|
6163
|
+
style: getInputStyle(),
|
|
6164
|
+
autoComplete: "off"
|
|
6165
|
+
}
|
|
6166
|
+
),
|
|
6167
|
+
/* @__PURE__ */ jsxs23("div", { className: "absolute right-3 flex items-center gap-2 text-gray-400 pointer-events-none", children: [
|
|
6168
|
+
isLoading && /* @__PURE__ */ jsx28("div", { className: "animate-spin h-4 w-4 border-2 border-primary-500 border-t-transparent rounded-full" }),
|
|
6169
|
+
!isLoading && /* @__PURE__ */ jsx28(FaSearch, { size: 14, className: clsx24({ "text-primary-500": isFocused }) })
|
|
6170
|
+
] })
|
|
6171
|
+
] }),
|
|
6172
|
+
isOpen && /* @__PURE__ */ jsx28("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__ */ jsx28("div", { className: "max-h-60 overflow-y-auto", children: filteredOptions.length > 0 ? filteredOptions.map((option) => /* @__PURE__ */ jsx28(
|
|
6173
|
+
ITText,
|
|
6174
|
+
{
|
|
6175
|
+
as: "div",
|
|
6176
|
+
onClick: () => handleSelect(option),
|
|
6177
|
+
className: clsx24(
|
|
6178
|
+
"px-4 py-2 text-sm cursor-pointer transition-colors",
|
|
6179
|
+
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"
|
|
6180
|
+
),
|
|
6181
|
+
children: /* @__PURE__ */ jsx28(ITText, { as: "span", children: option[labelField] })
|
|
6182
|
+
},
|
|
6183
|
+
option[valueField]
|
|
6184
|
+
)) : /* @__PURE__ */ jsx28(ITText, { as: "div", className: "px-4 py-6 text-sm text-center text-gray-500 italic", children: isLoading ? "Cargando..." : noResultsMessage }) }) })
|
|
6185
|
+
] }),
|
|
6186
|
+
hasError && /* @__PURE__ */ jsx28(ITText, { as: "p", className: "text-red-500 text-xs mt-1", children: errorMessage })
|
|
6187
|
+
] });
|
|
6188
|
+
}
|
|
6189
|
+
|
|
5885
6190
|
// src/components/form-builder/useFormBuilder.ts
|
|
5886
|
-
import { useMemo as
|
|
6191
|
+
import { useMemo as useMemo5 } from "react";
|
|
5887
6192
|
var useFieldRules = (config2, dependentValues) => {
|
|
5888
6193
|
const { getFieldConfig } = useITFormBuilderContext();
|
|
5889
6194
|
const fieldConfig = getFieldConfig(config2.name) || config2;
|
|
5890
|
-
const isVisible =
|
|
6195
|
+
const isVisible = useMemo5(() => {
|
|
5891
6196
|
if (!fieldConfig.renderWhen) return true;
|
|
5892
6197
|
return fieldConfig.renderWhen(dependentValues);
|
|
5893
6198
|
}, [fieldConfig.renderWhen, dependentValues]);
|
|
5894
|
-
const dynamicProps =
|
|
6199
|
+
const dynamicProps = useMemo5(() => {
|
|
5895
6200
|
if (!fieldConfig.dynamicProps) return {};
|
|
5896
6201
|
return fieldConfig.dynamicProps(dependentValues);
|
|
5897
6202
|
}, [fieldConfig.dynamicProps, dependentValues]);
|
|
5898
|
-
const isRequired =
|
|
6203
|
+
const isRequired = useMemo5(() => {
|
|
5899
6204
|
if (typeof dynamicProps.required !== "undefined") return dynamicProps.required;
|
|
5900
6205
|
if (typeof fieldConfig.required === "function") {
|
|
5901
6206
|
return fieldConfig.required(dependentValues);
|
|
5902
6207
|
}
|
|
5903
6208
|
return fieldConfig.required || false;
|
|
5904
6209
|
}, [fieldConfig.required, dynamicProps.required, dependentValues]);
|
|
5905
|
-
const isDisabled =
|
|
6210
|
+
const isDisabled = useMemo5(() => {
|
|
5906
6211
|
if (typeof dynamicProps.disabled !== "undefined") return dynamicProps.disabled;
|
|
5907
6212
|
if (typeof fieldConfig.disabled === "function") {
|
|
5908
6213
|
return fieldConfig.disabled(dependentValues);
|
|
@@ -5913,7 +6218,24 @@ var useFieldRules = (config2, dependentValues) => {
|
|
|
5913
6218
|
};
|
|
5914
6219
|
|
|
5915
6220
|
// src/components/form-builder/fieldRenderer.tsx
|
|
5916
|
-
import {
|
|
6221
|
+
import { FaSpinner as FaSpinner3 } from "react-icons/fa";
|
|
6222
|
+
import { jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
6223
|
+
function useAsyncOptions(options, depends) {
|
|
6224
|
+
const [resolved, setResolved] = useState17([]);
|
|
6225
|
+
const [loading, setLoading] = useState17(false);
|
|
6226
|
+
useEffect12(() => {
|
|
6227
|
+
if (typeof options === "function") {
|
|
6228
|
+
setLoading(true);
|
|
6229
|
+
options().then((result) => {
|
|
6230
|
+
setResolved(result.map((o) => ({ value: String(o.value), label: o.label })));
|
|
6231
|
+
setLoading(false);
|
|
6232
|
+
});
|
|
6233
|
+
} else if (Array.isArray(options)) {
|
|
6234
|
+
setResolved(options.map((o) => ({ value: String(o.value), label: o.label })));
|
|
6235
|
+
}
|
|
6236
|
+
}, depends);
|
|
6237
|
+
return { options: resolved, loading };
|
|
6238
|
+
}
|
|
5917
6239
|
var ITFieldRenderer = ({
|
|
5918
6240
|
config: config2,
|
|
5919
6241
|
columns = 12,
|
|
@@ -5927,7 +6249,7 @@ var ITFieldRenderer = ({
|
|
|
5927
6249
|
config2,
|
|
5928
6250
|
dependentValues
|
|
5929
6251
|
);
|
|
5930
|
-
|
|
6252
|
+
useEffect12(() => {
|
|
5931
6253
|
context.registerField(config2.name, config2);
|
|
5932
6254
|
return () => {
|
|
5933
6255
|
context.unregisterField(config2.name);
|
|
@@ -5953,6 +6275,7 @@ var ITFieldRenderer = ({
|
|
|
5953
6275
|
leftIcon,
|
|
5954
6276
|
rightIcon
|
|
5955
6277
|
} = activeConfig;
|
|
6278
|
+
const { options: resolvedOptions, loading: optionsLoading } = useAsyncOptions(options, [options, dependentValues]);
|
|
5956
6279
|
const handleChangeWrapper = useCallback6(
|
|
5957
6280
|
async (val) => {
|
|
5958
6281
|
const finalValue = val?.target ? val.target.value : val;
|
|
@@ -5969,7 +6292,7 @@ var ITFieldRenderer = ({
|
|
|
5969
6292
|
case "password":
|
|
5970
6293
|
case "number":
|
|
5971
6294
|
case "email":
|
|
5972
|
-
return /* @__PURE__ */
|
|
6295
|
+
return /* @__PURE__ */ jsx29(
|
|
5973
6296
|
ITInput,
|
|
5974
6297
|
{
|
|
5975
6298
|
type: type === "email" ? "text" : type,
|
|
@@ -5994,10 +6317,36 @@ var ITFieldRenderer = ({
|
|
|
5994
6317
|
}
|
|
5995
6318
|
);
|
|
5996
6319
|
case "select":
|
|
5997
|
-
|
|
6320
|
+
if (optionsLoading) {
|
|
6321
|
+
return /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-2 py-3", children: [
|
|
6322
|
+
/* @__PURE__ */ jsx29(FaSpinner3, { className: "animate-spin text-primary-500" }),
|
|
6323
|
+
/* @__PURE__ */ jsx29(ITText, { as: "span", className: "text-sm text-slate-500", children: "Cargando opciones..." })
|
|
6324
|
+
] });
|
|
6325
|
+
}
|
|
6326
|
+
if (typeof options === "function") {
|
|
6327
|
+
return /* @__PURE__ */ jsx29(
|
|
6328
|
+
ITSearchSelect,
|
|
6329
|
+
{
|
|
6330
|
+
options: resolvedOptions,
|
|
6331
|
+
name,
|
|
6332
|
+
disabled: isDisabled,
|
|
6333
|
+
label: label || "",
|
|
6334
|
+
placeholder,
|
|
6335
|
+
value: value !== void 0 ? value : activeConfig.defaultValue || "",
|
|
6336
|
+
valueField: valueField || "value",
|
|
6337
|
+
labelField: labelField || "label",
|
|
6338
|
+
onChange: (val) => handleChangeWrapper(val),
|
|
6339
|
+
onBlur: context.handleBlur,
|
|
6340
|
+
touched,
|
|
6341
|
+
error,
|
|
6342
|
+
required: isRequired
|
|
6343
|
+
}
|
|
6344
|
+
);
|
|
6345
|
+
}
|
|
6346
|
+
return /* @__PURE__ */ jsx29(
|
|
5998
6347
|
ITSelect,
|
|
5999
6348
|
{
|
|
6000
|
-
options:
|
|
6349
|
+
options: resolvedOptions,
|
|
6001
6350
|
name,
|
|
6002
6351
|
disabled: isDisabled,
|
|
6003
6352
|
label: label || "",
|
|
@@ -6013,7 +6362,7 @@ var ITFieldRenderer = ({
|
|
|
6013
6362
|
}
|
|
6014
6363
|
);
|
|
6015
6364
|
case "date":
|
|
6016
|
-
return /* @__PURE__ */
|
|
6365
|
+
return /* @__PURE__ */ jsx29(
|
|
6017
6366
|
ITDatePicker,
|
|
6018
6367
|
{
|
|
6019
6368
|
name,
|
|
@@ -6029,7 +6378,7 @@ var ITFieldRenderer = ({
|
|
|
6029
6378
|
}
|
|
6030
6379
|
);
|
|
6031
6380
|
case "time":
|
|
6032
|
-
return /* @__PURE__ */
|
|
6381
|
+
return /* @__PURE__ */ jsx29(
|
|
6033
6382
|
ITTimePicker,
|
|
6034
6383
|
{
|
|
6035
6384
|
name,
|
|
@@ -6047,7 +6396,7 @@ var ITFieldRenderer = ({
|
|
|
6047
6396
|
case "custom":
|
|
6048
6397
|
if (activeConfig.component) {
|
|
6049
6398
|
const CustomComponent = activeConfig.component;
|
|
6050
|
-
return /* @__PURE__ */
|
|
6399
|
+
return /* @__PURE__ */ jsx29(
|
|
6051
6400
|
CustomComponent,
|
|
6052
6401
|
{
|
|
6053
6402
|
...activeConfig,
|
|
@@ -6062,9 +6411,9 @@ var ITFieldRenderer = ({
|
|
|
6062
6411
|
}
|
|
6063
6412
|
return null;
|
|
6064
6413
|
case "section":
|
|
6065
|
-
return /* @__PURE__ */
|
|
6066
|
-
label && /* @__PURE__ */
|
|
6067
|
-
/* @__PURE__ */
|
|
6414
|
+
return /* @__PURE__ */ jsxs24("div", { className: clsx25("w-full col-span-full", activeConfig.className), children: [
|
|
6415
|
+
label && /* @__PURE__ */ jsx29(ITText, { as: "h4", className: "text-lg font-semibold text-gray-800 mb-4", children: label }),
|
|
6416
|
+
/* @__PURE__ */ jsx29("div", { className: clsx25("grid gap-y-6 gap-x-5", getGridColsClass(columns)), children: activeConfig.fields?.map((childConfig) => /* @__PURE__ */ jsx29(
|
|
6068
6417
|
ITFieldRenderer,
|
|
6069
6418
|
{
|
|
6070
6419
|
config: childConfig,
|
|
@@ -6074,7 +6423,7 @@ var ITFieldRenderer = ({
|
|
|
6074
6423
|
)) })
|
|
6075
6424
|
] });
|
|
6076
6425
|
case "array":
|
|
6077
|
-
return /* @__PURE__ */
|
|
6426
|
+
return /* @__PURE__ */ jsx29("div", { className: "p-4 border-2 border-dashed border-gray-200 rounded-xl", children: /* @__PURE__ */ jsxs24(ITText, { as: "p", className: "text-sm text-gray-500 text-center", children: [
|
|
6078
6427
|
"Array Field: ",
|
|
6079
6428
|
label
|
|
6080
6429
|
] }) });
|
|
@@ -6082,12 +6431,12 @@ var ITFieldRenderer = ({
|
|
|
6082
6431
|
return null;
|
|
6083
6432
|
}
|
|
6084
6433
|
};
|
|
6085
|
-
return /* @__PURE__ */
|
|
6434
|
+
return /* @__PURE__ */ jsx29("div", { className: clsx25(getColSpanClass(activeConfig.column, columns), activeConfig.className), children: renderField() });
|
|
6086
6435
|
};
|
|
6087
6436
|
var fieldRenderer_default = memo(ITFieldRenderer);
|
|
6088
6437
|
|
|
6089
6438
|
// src/components/form-builder/formBuilder.tsx
|
|
6090
|
-
import { jsx as
|
|
6439
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
6091
6440
|
function buildDependentValues(dependsOn, values) {
|
|
6092
6441
|
if (!dependsOn || dependsOn.length === 0) return {};
|
|
6093
6442
|
const deps = {};
|
|
@@ -6111,11 +6460,11 @@ function ITFormBuilder({
|
|
|
6111
6460
|
},
|
|
6112
6461
|
isSubmitting = false
|
|
6113
6462
|
}) {
|
|
6114
|
-
const [mounted, setMounted] =
|
|
6115
|
-
|
|
6463
|
+
const [mounted, setMounted] = useState18(false);
|
|
6464
|
+
useEffect13(() => {
|
|
6116
6465
|
setMounted(true);
|
|
6117
6466
|
}, []);
|
|
6118
|
-
const providerValue =
|
|
6467
|
+
const providerValue = useMemo6(() => ({
|
|
6119
6468
|
config: config2 || [],
|
|
6120
6469
|
values: values || {},
|
|
6121
6470
|
errors: errors || {},
|
|
@@ -6131,7 +6480,7 @@ function ITFormBuilder({
|
|
|
6131
6480
|
submitCount: 0
|
|
6132
6481
|
}), [config2, values, errors, touched, handleChange, handleBlur, setFieldValue, setFieldTouched, setFieldError, isSubmitting]);
|
|
6133
6482
|
if (config2) {
|
|
6134
|
-
return /* @__PURE__ */
|
|
6483
|
+
return /* @__PURE__ */ jsx30(ITFormBuilderProvider, { value: providerValue, children: /* @__PURE__ */ jsx30("div", { className: formGrid(columns), children: config2.map((fieldConfig) => /* @__PURE__ */ jsx30(
|
|
6135
6484
|
fieldRenderer_default,
|
|
6136
6485
|
{
|
|
6137
6486
|
config: fieldConfig,
|
|
@@ -6144,7 +6493,7 @@ function ITFormBuilder({
|
|
|
6144
6493
|
fieldConfig.name
|
|
6145
6494
|
)) }) });
|
|
6146
6495
|
}
|
|
6147
|
-
return /* @__PURE__ */
|
|
6496
|
+
return /* @__PURE__ */ jsx30("div", { className: formGrid(columns), children: fields?.map(({
|
|
6148
6497
|
name,
|
|
6149
6498
|
label,
|
|
6150
6499
|
type = "text",
|
|
@@ -6159,12 +6508,12 @@ function ITFormBuilder({
|
|
|
6159
6508
|
formatNumber = true,
|
|
6160
6509
|
onChangeAction,
|
|
6161
6510
|
...props
|
|
6162
|
-
}) => /* @__PURE__ */
|
|
6511
|
+
}) => /* @__PURE__ */ jsx30("div", { className: getColSpanClass(column, columns), children: (() => {
|
|
6163
6512
|
switch (type) {
|
|
6164
6513
|
case "text":
|
|
6165
6514
|
case "number":
|
|
6166
6515
|
case "password":
|
|
6167
|
-
return /* @__PURE__ */
|
|
6516
|
+
return /* @__PURE__ */ jsx30(
|
|
6168
6517
|
ITInput,
|
|
6169
6518
|
{
|
|
6170
6519
|
type,
|
|
@@ -6194,7 +6543,7 @@ function ITFormBuilder({
|
|
|
6194
6543
|
}
|
|
6195
6544
|
);
|
|
6196
6545
|
case "select":
|
|
6197
|
-
return /* @__PURE__ */
|
|
6546
|
+
return /* @__PURE__ */ jsx30(
|
|
6198
6547
|
ITSelect,
|
|
6199
6548
|
{
|
|
6200
6549
|
options: options || [],
|
|
@@ -6218,7 +6567,7 @@ function ITFormBuilder({
|
|
|
6218
6567
|
}
|
|
6219
6568
|
);
|
|
6220
6569
|
case "date":
|
|
6221
|
-
return /* @__PURE__ */
|
|
6570
|
+
return /* @__PURE__ */ jsx30(
|
|
6222
6571
|
ITDatePicker,
|
|
6223
6572
|
{
|
|
6224
6573
|
name,
|
|
@@ -6245,8 +6594,8 @@ function ITFormBuilder({
|
|
|
6245
6594
|
}
|
|
6246
6595
|
|
|
6247
6596
|
// src/components/grid/grid.tsx
|
|
6248
|
-
import
|
|
6249
|
-
import { jsx as
|
|
6597
|
+
import clsx26 from "clsx";
|
|
6598
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
6250
6599
|
function colSpanClass(span, cols) {
|
|
6251
6600
|
if (span === void 0) return void 0;
|
|
6252
6601
|
const clamped = Math.min(Math.max(Math.round(span), 1), cols);
|
|
@@ -6277,10 +6626,10 @@ function ITGrid({
|
|
|
6277
6626
|
as: Component = "div"
|
|
6278
6627
|
}) {
|
|
6279
6628
|
if (container) {
|
|
6280
|
-
return /* @__PURE__ */
|
|
6629
|
+
return /* @__PURE__ */ jsx31(
|
|
6281
6630
|
Component,
|
|
6282
6631
|
{
|
|
6283
|
-
className:
|
|
6632
|
+
className: clsx26("grid", gridColsClass(columns), className),
|
|
6284
6633
|
style: {
|
|
6285
6634
|
gap: spacing > 0 ? `${spacing * 0.25}rem` : void 0,
|
|
6286
6635
|
...style
|
|
@@ -6290,10 +6639,10 @@ function ITGrid({
|
|
|
6290
6639
|
);
|
|
6291
6640
|
}
|
|
6292
6641
|
if (item) {
|
|
6293
|
-
return /* @__PURE__ */
|
|
6642
|
+
return /* @__PURE__ */ jsx31(
|
|
6294
6643
|
Component,
|
|
6295
6644
|
{
|
|
6296
|
-
className:
|
|
6645
|
+
className: clsx26(
|
|
6297
6646
|
"col-span-full",
|
|
6298
6647
|
colSpanClass(xs ?? sm, columns),
|
|
6299
6648
|
sm !== void 0 && breakpointSpan(sm, "sm", columns),
|
|
@@ -6307,34 +6656,34 @@ function ITGrid({
|
|
|
6307
6656
|
}
|
|
6308
6657
|
);
|
|
6309
6658
|
}
|
|
6310
|
-
return /* @__PURE__ */
|
|
6659
|
+
return /* @__PURE__ */ jsx31(Component, { className, style, children });
|
|
6311
6660
|
}
|
|
6312
6661
|
|
|
6313
6662
|
// src/components/image/image.tsx
|
|
6314
|
-
import { useState as
|
|
6315
|
-
import { jsx as
|
|
6663
|
+
import { useState as useState19 } from "react";
|
|
6664
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
6316
6665
|
var ITImage = ({
|
|
6317
6666
|
src,
|
|
6318
6667
|
alt,
|
|
6319
6668
|
className = "",
|
|
6320
6669
|
fallback = ""
|
|
6321
6670
|
}) => {
|
|
6322
|
-
const [imageError, setImageError] =
|
|
6671
|
+
const [imageError, setImageError] = useState19(false);
|
|
6323
6672
|
const handleImageError = () => {
|
|
6324
6673
|
setImageError(true);
|
|
6325
6674
|
};
|
|
6326
|
-
return /* @__PURE__ */
|
|
6675
|
+
return /* @__PURE__ */ jsx32(
|
|
6327
6676
|
"div",
|
|
6328
6677
|
{
|
|
6329
6678
|
className: `${className} flex items-center justify-center bg-transparent`,
|
|
6330
|
-
children: imageError ? /* @__PURE__ */
|
|
6679
|
+
children: imageError ? /* @__PURE__ */ jsx32(
|
|
6331
6680
|
"img",
|
|
6332
6681
|
{
|
|
6333
6682
|
src: fallback,
|
|
6334
6683
|
alt: "Fallback",
|
|
6335
6684
|
className: "w-full h-full object-cover"
|
|
6336
6685
|
}
|
|
6337
|
-
) : /* @__PURE__ */
|
|
6686
|
+
) : /* @__PURE__ */ jsx32(
|
|
6338
6687
|
"img",
|
|
6339
6688
|
{
|
|
6340
6689
|
src,
|
|
@@ -6349,9 +6698,9 @@ var ITImage = ({
|
|
|
6349
6698
|
var image_default = ITImage;
|
|
6350
6699
|
|
|
6351
6700
|
// src/components/navbar/navbar.tsx
|
|
6352
|
-
import { useRef as
|
|
6701
|
+
import { useRef as useRef10, useState as useState20 } from "react";
|
|
6353
6702
|
import { FaChevronDown, FaChevronRight as FaChevronRight4, FaUserCircle } from "react-icons/fa";
|
|
6354
|
-
import { jsx as
|
|
6703
|
+
import { jsx as jsx33, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
6355
6704
|
function ITNavbar({
|
|
6356
6705
|
logo,
|
|
6357
6706
|
logoText,
|
|
@@ -6364,9 +6713,9 @@ function ITNavbar({
|
|
|
6364
6713
|
showSidebarOnMobile = false,
|
|
6365
6714
|
sidebarItems
|
|
6366
6715
|
}) {
|
|
6367
|
-
const [isUserMenuOpen, setIsUserMenuOpen] =
|
|
6368
|
-
const [expandedItems, setExpandedItems] =
|
|
6369
|
-
const userMenuRef =
|
|
6716
|
+
const [isUserMenuOpen, setIsUserMenuOpen] = useState20(false);
|
|
6717
|
+
const [expandedItems, setExpandedItems] = useState20(/* @__PURE__ */ new Set());
|
|
6718
|
+
const userMenuRef = useRef10(null);
|
|
6370
6719
|
useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
|
|
6371
6720
|
const toggleUserMenu = () => {
|
|
6372
6721
|
setIsUserMenuOpen(!isUserMenuOpen);
|
|
@@ -6389,42 +6738,42 @@ function ITNavbar({
|
|
|
6389
6738
|
};
|
|
6390
6739
|
const shouldUseLegacy = !navigationItems.length && (navItems || sidebarItems);
|
|
6391
6740
|
if (shouldUseLegacy) {
|
|
6392
|
-
return /* @__PURE__ */
|
|
6393
|
-
/* @__PURE__ */
|
|
6394
|
-
/* @__PURE__ */
|
|
6395
|
-
logo && /* @__PURE__ */
|
|
6396
|
-
logoText && /* @__PURE__ */
|
|
6741
|
+
return /* @__PURE__ */ jsxs25("div", { className: "flex flex-col h-screen", children: [
|
|
6742
|
+
/* @__PURE__ */ jsx33("nav", { className: "bg-white border-b border-gray-200", children: /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between mx-auto p-4", children: [
|
|
6743
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-center space-x-3 rtl:space-x-reverse", children: [
|
|
6744
|
+
logo && /* @__PURE__ */ jsx33("div", { className: "h-8", children: logo }),
|
|
6745
|
+
logoText && /* @__PURE__ */ jsx33(ITText, { as: "span", className: "self-center text-2xl font-semibold whitespace-nowrap text-gray-900", children: logoText })
|
|
6397
6746
|
] }),
|
|
6398
|
-
/* @__PURE__ */
|
|
6399
|
-
/* @__PURE__ */
|
|
6400
|
-
userMenu && /* @__PURE__ */
|
|
6401
|
-
/* @__PURE__ */
|
|
6747
|
+
/* @__PURE__ */ jsx33("div", { className: "flex items-center justify-end w-full md:w-auto md:order-2", children: /* @__PURE__ */ jsxs25("div", { className: "flex items-center space-x-4 md:order-2", children: [
|
|
6748
|
+
/* @__PURE__ */ jsx33("ul", { className: "hidden md:flex space-x-4", children: navItems }),
|
|
6749
|
+
userMenu && /* @__PURE__ */ jsxs25("div", { className: "relative", children: [
|
|
6750
|
+
/* @__PURE__ */ jsx33(
|
|
6402
6751
|
"button",
|
|
6403
6752
|
{
|
|
6404
6753
|
type: "button",
|
|
6405
6754
|
className: "flex text-sm bg-gray-200 rounded-full md:me-0 focus:ring-4 focus:ring-gray-300",
|
|
6406
6755
|
onClick: toggleUserMenu,
|
|
6407
|
-
children: userMenu.userImage ? /* @__PURE__ */
|
|
6756
|
+
children: userMenu.userImage ? /* @__PURE__ */ jsx33(
|
|
6408
6757
|
"img",
|
|
6409
6758
|
{
|
|
6410
6759
|
className: "w-8 h-8 rounded-full",
|
|
6411
6760
|
src: userMenu.userImage,
|
|
6412
6761
|
alt: "user photo"
|
|
6413
6762
|
}
|
|
6414
|
-
) : /* @__PURE__ */
|
|
6763
|
+
) : /* @__PURE__ */ jsx33(FaUserCircle, { className: "w-8 h-8 text-gray-500" })
|
|
6415
6764
|
}
|
|
6416
6765
|
),
|
|
6417
|
-
isUserMenuOpen && /* @__PURE__ */
|
|
6766
|
+
isUserMenuOpen && /* @__PURE__ */ jsxs25(
|
|
6418
6767
|
"div",
|
|
6419
6768
|
{
|
|
6420
6769
|
ref: userMenuRef,
|
|
6421
6770
|
className: "z-50 absolute right-0 mt-2 text-base list-none bg-white divide-y divide-gray-100 rounded-lg shadow-sm",
|
|
6422
6771
|
children: [
|
|
6423
|
-
/* @__PURE__ */
|
|
6424
|
-
/* @__PURE__ */
|
|
6425
|
-
/* @__PURE__ */
|
|
6772
|
+
/* @__PURE__ */ jsxs25("div", { className: "px-4 py-3", children: [
|
|
6773
|
+
/* @__PURE__ */ jsx33(ITText, { as: "span", className: "block text-sm text-gray-900", children: userMenu.userName }),
|
|
6774
|
+
/* @__PURE__ */ jsx33(ITText, { as: "span", className: "block text-sm text-gray-500 truncate", children: userMenu.userEmail })
|
|
6426
6775
|
] }),
|
|
6427
|
-
/* @__PURE__ */
|
|
6776
|
+
/* @__PURE__ */ jsx33("ul", { className: "py-2", children: userMenu.menuItems.map((item, index) => /* @__PURE__ */ jsx33("li", { children: /* @__PURE__ */ jsx33(
|
|
6428
6777
|
"button",
|
|
6429
6778
|
{
|
|
6430
6779
|
onClick: () => {
|
|
@@ -6432,7 +6781,7 @@ function ITNavbar({
|
|
|
6432
6781
|
setIsUserMenuOpen(false);
|
|
6433
6782
|
},
|
|
6434
6783
|
className: "block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 w-full text-left",
|
|
6435
|
-
children: /* @__PURE__ */
|
|
6784
|
+
children: /* @__PURE__ */ jsx33(ITText, { as: "span", children: item.label })
|
|
6436
6785
|
}
|
|
6437
6786
|
) }, index)) })
|
|
6438
6787
|
]
|
|
@@ -6441,27 +6790,27 @@ function ITNavbar({
|
|
|
6441
6790
|
] })
|
|
6442
6791
|
] }) })
|
|
6443
6792
|
] }) }),
|
|
6444
|
-
/* @__PURE__ */
|
|
6445
|
-
(showSidebar || showSidebarOnMobile) && /* @__PURE__ */
|
|
6446
|
-
/* @__PURE__ */
|
|
6793
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex-1 flex overflow-hidden relative", children: [
|
|
6794
|
+
(showSidebar || showSidebarOnMobile) && /* @__PURE__ */ jsx33("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__ */ jsx33("div", { className: "h-full overflow-y-auto py-4 px-3", children: /* @__PURE__ */ jsx33("ul", { className: "space-y-2 font-medium", children: sidebarItems }) }) }),
|
|
6795
|
+
/* @__PURE__ */ jsx33("main", { className: "flex-1 bg-gray-100 overflow-y-auto", children })
|
|
6447
6796
|
] })
|
|
6448
6797
|
] });
|
|
6449
6798
|
}
|
|
6450
6799
|
const sidebar = theme.sidebar;
|
|
6451
6800
|
const topbar = theme.topbar;
|
|
6452
|
-
return /* @__PURE__ */
|
|
6453
|
-
/* @__PURE__ */
|
|
6801
|
+
return /* @__PURE__ */ jsxs25("div", { className: "flex h-screen font-sans", style: { backgroundColor: theme.layout.backgroundColor }, children: [
|
|
6802
|
+
/* @__PURE__ */ jsxs25(
|
|
6454
6803
|
"aside",
|
|
6455
6804
|
{
|
|
6456
6805
|
className: "w-72 shadow-xl flex flex-col transition-all duration-300 ease-in-out",
|
|
6457
6806
|
style: { backgroundColor: sidebar.backgroundColor, borderRight: `1px solid ${sidebar.borderColor}` },
|
|
6458
6807
|
children: [
|
|
6459
|
-
/* @__PURE__ */
|
|
6460
|
-
logo && /* @__PURE__ */
|
|
6461
|
-
logoText && /* @__PURE__ */
|
|
6808
|
+
/* @__PURE__ */ jsxs25("div", { className: "p-6 flex items-center gap-3", style: { borderBottom: `1px solid ${sidebar.borderColor}` }, children: [
|
|
6809
|
+
logo && /* @__PURE__ */ jsx33("div", { className: "h-8 w-auto object-contain transition-transform hover:scale-105", children: logo }),
|
|
6810
|
+
logoText && /* @__PURE__ */ jsx33(ITText, { as: "span", className: "text-lg font-bold tracking-wide", style: { color: sidebar.active.color }, children: logoText })
|
|
6462
6811
|
] }),
|
|
6463
|
-
/* @__PURE__ */
|
|
6464
|
-
/* @__PURE__ */
|
|
6812
|
+
/* @__PURE__ */ jsx33("nav", { className: "flex-1 px-4 py-6 overflow-y-auto custom-scrollbar", children: /* @__PURE__ */ jsx33("ul", { className: "flex flex-col gap-1.5", children: navigationItems.map((item) => /* @__PURE__ */ jsxs25("li", { children: [
|
|
6813
|
+
/* @__PURE__ */ jsxs25(
|
|
6465
6814
|
"div",
|
|
6466
6815
|
{
|
|
6467
6816
|
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"}`,
|
|
@@ -6484,17 +6833,17 @@ function ITNavbar({
|
|
|
6484
6833
|
}
|
|
6485
6834
|
},
|
|
6486
6835
|
children: [
|
|
6487
|
-
/* @__PURE__ */
|
|
6488
|
-
item.icon && /* @__PURE__ */
|
|
6836
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-3", children: [
|
|
6837
|
+
item.icon && /* @__PURE__ */ jsx33("div", { className: "text-xl transition-colors", style: {
|
|
6489
6838
|
color: item.isActive ? sidebar.active.iconColor : sidebar.icon.color
|
|
6490
6839
|
}, children: item.icon }),
|
|
6491
|
-
/* @__PURE__ */
|
|
6840
|
+
/* @__PURE__ */ jsx33(ITText, { as: "span", className: `font-medium text-sm ${item.isActive ? "font-semibold" : ""}`, children: item.label })
|
|
6492
6841
|
] }),
|
|
6493
|
-
item.subitems && item.subitems.length > 0 && /* @__PURE__ */
|
|
6842
|
+
item.subitems && item.subitems.length > 0 && /* @__PURE__ */ jsx33("div", { className: "transition-transform", style: { color: sidebar.icon.color }, children: expandedItems.has(item.id) ? /* @__PURE__ */ jsx33(FaChevronDown, { className: "w-3 h-3" }) : /* @__PURE__ */ jsx33(FaChevronRight4, { className: "w-3 h-3" }) })
|
|
6494
6843
|
]
|
|
6495
6844
|
}
|
|
6496
6845
|
),
|
|
6497
|
-
item.subitems && item.subitems.length > 0 && expandedItems.has(item.id) && /* @__PURE__ */
|
|
6846
|
+
item.subitems && item.subitems.length > 0 && expandedItems.has(item.id) && /* @__PURE__ */ jsx33("ul", { className: "mt-1 ml-4 pl-4 space-y-1", style: { borderLeft: `1px solid ${sidebar.borderColor}` }, children: item.subitems.map((subitem) => /* @__PURE__ */ jsx33("li", { children: /* @__PURE__ */ jsx33(
|
|
6498
6847
|
"button",
|
|
6499
6848
|
{
|
|
6500
6849
|
onClick: subitem.action,
|
|
@@ -6513,12 +6862,12 @@ function ITNavbar({
|
|
|
6513
6862
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
6514
6863
|
}
|
|
6515
6864
|
},
|
|
6516
|
-
children: /* @__PURE__ */
|
|
6865
|
+
children: /* @__PURE__ */ jsx33(ITText, { as: "span", children: subitem.label })
|
|
6517
6866
|
}
|
|
6518
6867
|
) }, subitem.id)) })
|
|
6519
6868
|
] }, item.id)) }) }),
|
|
6520
|
-
userMenu && /* @__PURE__ */
|
|
6521
|
-
/* @__PURE__ */
|
|
6869
|
+
userMenu && /* @__PURE__ */ jsx33("div", { className: "p-4", style: { borderTop: `1px solid ${sidebar.borderColor}` }, children: /* @__PURE__ */ jsxs25("div", { className: "relative", children: [
|
|
6870
|
+
/* @__PURE__ */ jsxs25(
|
|
6522
6871
|
"button",
|
|
6523
6872
|
{
|
|
6524
6873
|
type: "button",
|
|
@@ -6534,7 +6883,7 @@ function ITNavbar({
|
|
|
6534
6883
|
},
|
|
6535
6884
|
onClick: toggleUserMenu,
|
|
6536
6885
|
children: [
|
|
6537
|
-
userMenu.userImage ? /* @__PURE__ */
|
|
6886
|
+
userMenu.userImage ? /* @__PURE__ */ jsx33(
|
|
6538
6887
|
"img",
|
|
6539
6888
|
{
|
|
6540
6889
|
className: "w-10 h-10 rounded-full border-2 transition-colors",
|
|
@@ -6542,34 +6891,34 @@ function ITNavbar({
|
|
|
6542
6891
|
alt: "user photo",
|
|
6543
6892
|
style: { borderColor: sidebar.borderColor }
|
|
6544
6893
|
}
|
|
6545
|
-
) : /* @__PURE__ */
|
|
6894
|
+
) : /* @__PURE__ */ jsx33(
|
|
6546
6895
|
"div",
|
|
6547
6896
|
{
|
|
6548
6897
|
className: "w-10 h-10 rounded-full flex items-center justify-center transition-colors",
|
|
6549
6898
|
style: { backgroundColor: sidebar.hover.backgroundColor, color: sidebar.icon.color },
|
|
6550
|
-
children: /* @__PURE__ */
|
|
6899
|
+
children: /* @__PURE__ */ jsx33(FaUserCircle, { className: "w-6 h-6" })
|
|
6551
6900
|
}
|
|
6552
6901
|
),
|
|
6553
|
-
/* @__PURE__ */
|
|
6554
|
-
/* @__PURE__ */
|
|
6555
|
-
/* @__PURE__ */
|
|
6902
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex-1 text-left overflow-hidden", children: [
|
|
6903
|
+
/* @__PURE__ */ jsx33(ITText, { as: "div", className: "font-medium text-sm truncate", style: { color: sidebar.active.color }, children: userMenu.userName }),
|
|
6904
|
+
/* @__PURE__ */ jsx33(ITText, { as: "div", className: "text-xs truncate", style: { color: sidebar.label.color }, children: userMenu.userEmail })
|
|
6556
6905
|
] }),
|
|
6557
|
-
/* @__PURE__ */
|
|
6906
|
+
/* @__PURE__ */ jsx33(FaChevronRight4, { className: "w-3 h-3", style: { color: sidebar.icon.color } })
|
|
6558
6907
|
]
|
|
6559
6908
|
}
|
|
6560
6909
|
),
|
|
6561
|
-
isUserMenuOpen && /* @__PURE__ */
|
|
6910
|
+
isUserMenuOpen && /* @__PURE__ */ jsxs25(
|
|
6562
6911
|
"div",
|
|
6563
6912
|
{
|
|
6564
6913
|
ref: userMenuRef,
|
|
6565
6914
|
className: "absolute bottom-full left-0 mb-3 w-full rounded-xl shadow-2xl overflow-hidden transform transition-all duration-200 origin-bottom",
|
|
6566
6915
|
style: { backgroundColor: topbar.userMenu.dropdown.backgroundColor, border: `1px solid ${topbar.userMenu.dropdown.borderColor}` },
|
|
6567
6916
|
children: [
|
|
6568
|
-
/* @__PURE__ */
|
|
6569
|
-
/* @__PURE__ */
|
|
6570
|
-
/* @__PURE__ */
|
|
6917
|
+
/* @__PURE__ */ jsxs25("div", { className: "px-4 py-3", style: { backgroundColor: topbar.userMenu.backgroundColor, borderBottom: `1px solid ${topbar.userMenu.dropdown.borderColor}` }, children: [
|
|
6918
|
+
/* @__PURE__ */ jsx33(ITText, { as: "span", className: "block text-sm font-semibold", style: { color: topbar.userMenu.textColor }, children: userMenu.userName }),
|
|
6919
|
+
/* @__PURE__ */ jsx33(ITText, { as: "span", className: "block text-xs truncate", style: { color: topbar.userMenu.subtitleColor }, children: userMenu.userEmail })
|
|
6571
6920
|
] }),
|
|
6572
|
-
/* @__PURE__ */
|
|
6921
|
+
/* @__PURE__ */ jsx33("ul", { className: "py-1", children: userMenu.menuItems.map((item, index) => /* @__PURE__ */ jsx33("li", { children: /* @__PURE__ */ jsx33(
|
|
6573
6922
|
"button",
|
|
6574
6923
|
{
|
|
6575
6924
|
onClick: () => {
|
|
@@ -6584,7 +6933,7 @@ function ITNavbar({
|
|
|
6584
6933
|
onMouseLeave: (e) => {
|
|
6585
6934
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
6586
6935
|
},
|
|
6587
|
-
children: /* @__PURE__ */
|
|
6936
|
+
children: /* @__PURE__ */ jsx33(ITText, { as: "span", children: item.label })
|
|
6588
6937
|
}
|
|
6589
6938
|
) }, index)) })
|
|
6590
6939
|
]
|
|
@@ -6594,16 +6943,16 @@ function ITNavbar({
|
|
|
6594
6943
|
]
|
|
6595
6944
|
}
|
|
6596
6945
|
),
|
|
6597
|
-
/* @__PURE__ */
|
|
6946
|
+
/* @__PURE__ */ jsx33("main", { className: "flex-1 overflow-y-auto relative", style: { backgroundColor: theme.layout.backgroundColor }, children })
|
|
6598
6947
|
] });
|
|
6599
6948
|
}
|
|
6600
6949
|
|
|
6601
6950
|
// src/components/page/page.tsx
|
|
6602
|
-
import
|
|
6951
|
+
import clsx29 from "clsx";
|
|
6603
6952
|
|
|
6604
6953
|
// src/components/page-header/page-header.tsx
|
|
6605
6954
|
import { FaChevronLeft as FaChevronLeft3 } from "react-icons/fa";
|
|
6606
|
-
import { jsx as
|
|
6955
|
+
import { jsx as jsx34, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
6607
6956
|
function ITPageHeader({
|
|
6608
6957
|
title,
|
|
6609
6958
|
description,
|
|
@@ -6615,25 +6964,25 @@ function ITPageHeader({
|
|
|
6615
6964
|
className
|
|
6616
6965
|
}) {
|
|
6617
6966
|
const showTopRow = breadcrumbs?.length || backAction;
|
|
6618
|
-
return /* @__PURE__ */
|
|
6619
|
-
showTopRow && /* @__PURE__ */
|
|
6620
|
-
/* @__PURE__ */
|
|
6621
|
-
backAction && /* @__PURE__ */
|
|
6967
|
+
return /* @__PURE__ */ jsxs26("div", { className: `${className} space-y-3`, children: [
|
|
6968
|
+
showTopRow && /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between gap-4", children: [
|
|
6969
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
6970
|
+
backAction && /* @__PURE__ */ jsx34(
|
|
6622
6971
|
"button",
|
|
6623
6972
|
{
|
|
6624
6973
|
onClick: backAction,
|
|
6625
6974
|
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",
|
|
6626
6975
|
"aria-label": "Volver",
|
|
6627
|
-
children: /* @__PURE__ */
|
|
6976
|
+
children: /* @__PURE__ */ jsx34(FaChevronLeft3, { size: 14 })
|
|
6628
6977
|
}
|
|
6629
6978
|
),
|
|
6630
|
-
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */
|
|
6979
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx34(ITBreadcrumbs, { items: breadcrumbs })
|
|
6631
6980
|
] }),
|
|
6632
|
-
actions && /* @__PURE__ */
|
|
6981
|
+
actions && /* @__PURE__ */ jsx34("div", { className: "flex items-center gap-3 flex-shrink-0", children: actions })
|
|
6633
6982
|
] }),
|
|
6634
|
-
/* @__PURE__ */
|
|
6635
|
-
/* @__PURE__ */
|
|
6636
|
-
icon && /* @__PURE__ */
|
|
6983
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex items-start justify-between gap-6", children: [
|
|
6984
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex items-start gap-4 min-w-0", children: [
|
|
6985
|
+
icon && /* @__PURE__ */ jsx34(
|
|
6637
6986
|
"div",
|
|
6638
6987
|
{
|
|
6639
6988
|
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",
|
|
@@ -6641,8 +6990,8 @@ function ITPageHeader({
|
|
|
6641
6990
|
children: icon
|
|
6642
6991
|
}
|
|
6643
6992
|
),
|
|
6644
|
-
/* @__PURE__ */
|
|
6645
|
-
/* @__PURE__ */
|
|
6993
|
+
/* @__PURE__ */ jsxs26("div", { className: "min-w-0", children: [
|
|
6994
|
+
/* @__PURE__ */ jsx34(
|
|
6646
6995
|
ITText,
|
|
6647
6996
|
{
|
|
6648
6997
|
as: "h1",
|
|
@@ -6650,7 +6999,7 @@ function ITPageHeader({
|
|
|
6650
6999
|
children: title
|
|
6651
7000
|
}
|
|
6652
7001
|
),
|
|
6653
|
-
description && /* @__PURE__ */
|
|
7002
|
+
description && /* @__PURE__ */ jsx34(
|
|
6654
7003
|
ITText,
|
|
6655
7004
|
{
|
|
6656
7005
|
as: "p",
|
|
@@ -6660,14 +7009,14 @@ function ITPageHeader({
|
|
|
6660
7009
|
)
|
|
6661
7010
|
] })
|
|
6662
7011
|
] }),
|
|
6663
|
-
!showTopRow && actions && /* @__PURE__ */
|
|
7012
|
+
!showTopRow && actions && /* @__PURE__ */ jsx34("div", { className: "flex items-center gap-3 flex-shrink-0", children: actions })
|
|
6664
7013
|
] })
|
|
6665
7014
|
] });
|
|
6666
7015
|
}
|
|
6667
7016
|
|
|
6668
7017
|
// src/components/skeleton/skeleton.tsx
|
|
6669
|
-
import
|
|
6670
|
-
import { Fragment as Fragment6, jsx as
|
|
7018
|
+
import clsx27 from "clsx";
|
|
7019
|
+
import { Fragment as Fragment6, jsx as jsx35 } from "react/jsx-runtime";
|
|
6671
7020
|
var variantClasses = {
|
|
6672
7021
|
text: "rounded-md h-4 w-full",
|
|
6673
7022
|
circular: "rounded-full",
|
|
@@ -6687,10 +7036,10 @@ function ITSkeleton({
|
|
|
6687
7036
|
...style
|
|
6688
7037
|
};
|
|
6689
7038
|
const items = Array.from({ length: count }, (_, i) => i);
|
|
6690
|
-
return /* @__PURE__ */
|
|
7039
|
+
return /* @__PURE__ */ jsx35(Fragment6, { children: items.map((i) => /* @__PURE__ */ jsx35(
|
|
6691
7040
|
"div",
|
|
6692
7041
|
{
|
|
6693
|
-
className:
|
|
7042
|
+
className: clsx27(
|
|
6694
7043
|
"animate-pulse bg-slate-200 dark:bg-slate-700",
|
|
6695
7044
|
variantClasses[variant],
|
|
6696
7045
|
variant === "text" && count > 1 && i < count - 1 && "mb-2",
|
|
@@ -6706,9 +7055,9 @@ function ITSkeleton({
|
|
|
6706
7055
|
}
|
|
6707
7056
|
|
|
6708
7057
|
// src/components/stack/stack.tsx
|
|
6709
|
-
import
|
|
7058
|
+
import clsx28 from "clsx";
|
|
6710
7059
|
import { Children, cloneElement, isValidElement, Fragment as Fragment7 } from "react";
|
|
6711
|
-
import { jsx as
|
|
7060
|
+
import { jsx as jsx36, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
6712
7061
|
var directionMap2 = {
|
|
6713
7062
|
row: "flex-row",
|
|
6714
7063
|
column: "flex-col",
|
|
@@ -6753,10 +7102,10 @@ function ITStack({
|
|
|
6753
7102
|
gap: spacing > 0 ? `${spacing * 0.25}rem` : void 0,
|
|
6754
7103
|
...style
|
|
6755
7104
|
};
|
|
6756
|
-
return /* @__PURE__ */
|
|
7105
|
+
return /* @__PURE__ */ jsx36(
|
|
6757
7106
|
Component,
|
|
6758
7107
|
{
|
|
6759
|
-
className:
|
|
7108
|
+
className: clsx28(
|
|
6760
7109
|
"flex",
|
|
6761
7110
|
directionMap2[direction],
|
|
6762
7111
|
alignItems && alignMap2[alignItems],
|
|
@@ -6765,7 +7114,7 @@ function ITStack({
|
|
|
6765
7114
|
className
|
|
6766
7115
|
),
|
|
6767
7116
|
style: resolvedStyle,
|
|
6768
|
-
children: hasDivider ? items.map((child, index) => /* @__PURE__ */
|
|
7117
|
+
children: hasDivider ? items.map((child, index) => /* @__PURE__ */ jsxs27(Fragment7, { children: [
|
|
6769
7118
|
child,
|
|
6770
7119
|
index < items.length - 1 && isValidElement(divider) ? cloneElement(divider, { key: `divider-${index}` }) : null
|
|
6771
7120
|
] }, index)) : children
|
|
@@ -6774,11 +7123,11 @@ function ITStack({
|
|
|
6774
7123
|
}
|
|
6775
7124
|
|
|
6776
7125
|
// src/components/page/page.tsx
|
|
6777
|
-
import { jsx as
|
|
7126
|
+
import { jsx as jsx37, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
6778
7127
|
var hasHeader = (props) => !!(props.title || props.description || props.breadcrumbs || props.actions || props.backAction || props.icon);
|
|
6779
7128
|
var renderHeader = (props) => {
|
|
6780
7129
|
if (!hasHeader(props)) return null;
|
|
6781
|
-
return /* @__PURE__ */
|
|
7130
|
+
return /* @__PURE__ */ jsx37(
|
|
6782
7131
|
ITPageHeader,
|
|
6783
7132
|
{
|
|
6784
7133
|
title: props.title || "",
|
|
@@ -6807,7 +7156,7 @@ function ITPage(props) {
|
|
|
6807
7156
|
maxWidth = "7xl",
|
|
6808
7157
|
noPadding = false
|
|
6809
7158
|
} = props;
|
|
6810
|
-
const wrapperClass =
|
|
7159
|
+
const wrapperClass = clsx29(
|
|
6811
7160
|
"mx-auto w-full",
|
|
6812
7161
|
!noPadding && "px-4 sm:px-6 lg:px-8 py-6",
|
|
6813
7162
|
`max-w-${maxWidth}`,
|
|
@@ -6815,24 +7164,24 @@ function ITPage(props) {
|
|
|
6815
7164
|
className
|
|
6816
7165
|
);
|
|
6817
7166
|
if (loading) {
|
|
6818
|
-
return /* @__PURE__ */
|
|
7167
|
+
return /* @__PURE__ */ jsxs28("div", { className: wrapperClass, children: [
|
|
6819
7168
|
renderHeader(props),
|
|
6820
|
-
/* @__PURE__ */
|
|
6821
|
-
/* @__PURE__ */
|
|
6822
|
-
/* @__PURE__ */
|
|
6823
|
-
/* @__PURE__ */
|
|
7169
|
+
/* @__PURE__ */ jsxs28(ITStack, { spacing: 6, children: [
|
|
7170
|
+
/* @__PURE__ */ jsx37(ITSkeleton, { variant: "rectangular", height: 40, width: "40%", className: "rounded-lg" }),
|
|
7171
|
+
/* @__PURE__ */ jsx37(ITSkeleton, { variant: "rectangular", height: 200, className: "rounded-lg" }),
|
|
7172
|
+
/* @__PURE__ */ jsx37(ITSkeleton, { variant: "rectangular", height: 200, className: "rounded-lg" })
|
|
6824
7173
|
] })
|
|
6825
7174
|
] });
|
|
6826
7175
|
}
|
|
6827
7176
|
if (error) {
|
|
6828
|
-
return /* @__PURE__ */
|
|
7177
|
+
return /* @__PURE__ */ jsxs28("div", { className: wrapperClass, children: [
|
|
6829
7178
|
renderHeader(props),
|
|
6830
|
-
/* @__PURE__ */
|
|
7179
|
+
/* @__PURE__ */ jsx37(
|
|
6831
7180
|
ITEmptyState,
|
|
6832
7181
|
{
|
|
6833
7182
|
title: errorTitle || "Error",
|
|
6834
7183
|
description: error,
|
|
6835
|
-
action: onRetry ? /* @__PURE__ */
|
|
7184
|
+
action: onRetry ? /* @__PURE__ */ jsx37(
|
|
6836
7185
|
ITButton,
|
|
6837
7186
|
{
|
|
6838
7187
|
label: errorActionLabel || "Reintentar",
|
|
@@ -6845,9 +7194,9 @@ function ITPage(props) {
|
|
|
6845
7194
|
] });
|
|
6846
7195
|
}
|
|
6847
7196
|
if (empty) {
|
|
6848
|
-
return /* @__PURE__ */
|
|
7197
|
+
return /* @__PURE__ */ jsxs28("div", { className: wrapperClass, children: [
|
|
6849
7198
|
renderHeader(props),
|
|
6850
|
-
/* @__PURE__ */
|
|
7199
|
+
/* @__PURE__ */ jsx37(
|
|
6851
7200
|
ITEmptyState,
|
|
6852
7201
|
{
|
|
6853
7202
|
title: emptyTitle || "Sin datos",
|
|
@@ -6857,16 +7206,16 @@ function ITPage(props) {
|
|
|
6857
7206
|
)
|
|
6858
7207
|
] });
|
|
6859
7208
|
}
|
|
6860
|
-
return /* @__PURE__ */
|
|
7209
|
+
return /* @__PURE__ */ jsxs28("div", { className: wrapperClass, children: [
|
|
6861
7210
|
renderHeader(props),
|
|
6862
7211
|
children
|
|
6863
7212
|
] });
|
|
6864
7213
|
}
|
|
6865
7214
|
|
|
6866
7215
|
// src/components/popover/popover.tsx
|
|
6867
|
-
import { useState as
|
|
6868
|
-
import
|
|
6869
|
-
import { jsx as
|
|
7216
|
+
import { useState as useState21, useRef as useRef11 } from "react";
|
|
7217
|
+
import clsx30 from "clsx";
|
|
7218
|
+
import { jsx as jsx38, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
6870
7219
|
var positionClasses = {
|
|
6871
7220
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
6872
7221
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
@@ -6881,23 +7230,23 @@ function ITPopover({
|
|
|
6881
7230
|
onClose,
|
|
6882
7231
|
className
|
|
6883
7232
|
}) {
|
|
6884
|
-
const [internalOpen, setInternalOpen] =
|
|
7233
|
+
const [internalOpen, setInternalOpen] = useState21(false);
|
|
6885
7234
|
const isControlled = controlledOpen !== void 0;
|
|
6886
7235
|
const open = isControlled ? controlledOpen : internalOpen;
|
|
6887
|
-
const ref =
|
|
7236
|
+
const ref = useRef11(null);
|
|
6888
7237
|
useClickOutside_default(ref, () => {
|
|
6889
7238
|
if (isControlled) onClose?.();
|
|
6890
7239
|
else setInternalOpen(false);
|
|
6891
7240
|
});
|
|
6892
|
-
return /* @__PURE__ */
|
|
6893
|
-
/* @__PURE__ */
|
|
6894
|
-
open && /* @__PURE__ */
|
|
7241
|
+
return /* @__PURE__ */ jsxs29("div", { ref, className: clsx30("relative inline-flex", className), children: [
|
|
7242
|
+
/* @__PURE__ */ jsx38("div", { onClick: () => isControlled ? onClose?.() : setInternalOpen((p) => !p), className: "cursor-pointer", children: trigger }),
|
|
7243
|
+
open && /* @__PURE__ */ jsx38("div", { className: clsx30("absolute z-[200]", positionClasses[position]), children: /* @__PURE__ */ jsx38("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 }) })
|
|
6895
7244
|
] });
|
|
6896
7245
|
}
|
|
6897
7246
|
|
|
6898
7247
|
// src/components/progress/progress.tsx
|
|
6899
|
-
import
|
|
6900
|
-
import { jsx as
|
|
7248
|
+
import clsx31 from "clsx";
|
|
7249
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
6901
7250
|
var colorMap = {
|
|
6902
7251
|
primary: "bg-primary-500",
|
|
6903
7252
|
secondary: "bg-secondary-500",
|
|
@@ -6924,18 +7273,18 @@ function ITProgress({
|
|
|
6924
7273
|
style
|
|
6925
7274
|
}) {
|
|
6926
7275
|
const pct = Math.min(Math.max(value / max * 100, 0), 100);
|
|
6927
|
-
return /* @__PURE__ */
|
|
7276
|
+
return /* @__PURE__ */ jsx39(
|
|
6928
7277
|
"div",
|
|
6929
7278
|
{
|
|
6930
|
-
className:
|
|
7279
|
+
className: clsx31("w-full bg-slate-200 dark:bg-slate-700 rounded-full overflow-hidden", sizeMap3[size], className),
|
|
6931
7280
|
style,
|
|
6932
7281
|
role: "progressbar",
|
|
6933
7282
|
"aria-valuenow": variant === "determinate" ? value : void 0,
|
|
6934
7283
|
"aria-valuemax": max,
|
|
6935
|
-
children: /* @__PURE__ */
|
|
7284
|
+
children: /* @__PURE__ */ jsx39(
|
|
6936
7285
|
"div",
|
|
6937
7286
|
{
|
|
6938
|
-
className:
|
|
7287
|
+
className: clsx31(
|
|
6939
7288
|
"h-full rounded-full transition-all duration-500",
|
|
6940
7289
|
colorMap[color],
|
|
6941
7290
|
variant === "indeterminate" && "animate-pulse w-1/2"
|
|
@@ -6948,8 +7297,8 @@ function ITProgress({
|
|
|
6948
7297
|
}
|
|
6949
7298
|
|
|
6950
7299
|
// src/components/radio/radio.tsx
|
|
6951
|
-
import
|
|
6952
|
-
import { jsx as
|
|
7300
|
+
import clsx32 from "clsx";
|
|
7301
|
+
import { jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6953
7302
|
function ITRadioGroup({
|
|
6954
7303
|
name,
|
|
6955
7304
|
value,
|
|
@@ -6959,25 +7308,25 @@ function ITRadioGroup({
|
|
|
6959
7308
|
direction = "column",
|
|
6960
7309
|
className
|
|
6961
7310
|
}) {
|
|
6962
|
-
return /* @__PURE__ */
|
|
7311
|
+
return /* @__PURE__ */ jsx40(
|
|
6963
7312
|
"div",
|
|
6964
7313
|
{
|
|
6965
|
-
className:
|
|
7314
|
+
className: clsx32(
|
|
6966
7315
|
"flex gap-3",
|
|
6967
7316
|
direction === "row" ? "flex-row flex-wrap" : "flex-col",
|
|
6968
7317
|
className
|
|
6969
7318
|
),
|
|
6970
7319
|
children: options.map((opt) => {
|
|
6971
7320
|
const isSelected = opt.value === value;
|
|
6972
|
-
return /* @__PURE__ */
|
|
7321
|
+
return /* @__PURE__ */ jsxs30(
|
|
6973
7322
|
"label",
|
|
6974
7323
|
{
|
|
6975
|
-
className:
|
|
7324
|
+
className: clsx32(
|
|
6976
7325
|
"inline-flex items-center gap-2 cursor-pointer select-none",
|
|
6977
7326
|
disabled && "opacity-50 cursor-not-allowed"
|
|
6978
7327
|
),
|
|
6979
7328
|
children: [
|
|
6980
|
-
/* @__PURE__ */
|
|
7329
|
+
/* @__PURE__ */ jsx40(
|
|
6981
7330
|
"input",
|
|
6982
7331
|
{
|
|
6983
7332
|
type: "radio",
|
|
@@ -6989,18 +7338,18 @@ function ITRadioGroup({
|
|
|
6989
7338
|
className: "peer sr-only"
|
|
6990
7339
|
}
|
|
6991
7340
|
),
|
|
6992
|
-
/* @__PURE__ */
|
|
7341
|
+
/* @__PURE__ */ jsx40(
|
|
6993
7342
|
"div",
|
|
6994
7343
|
{
|
|
6995
|
-
className:
|
|
7344
|
+
className: clsx32(
|
|
6996
7345
|
"w-4 h-4 rounded-full border-2 flex items-center justify-center transition-all",
|
|
6997
7346
|
isSelected ? "border-primary-500" : "border-slate-300 dark:border-slate-600",
|
|
6998
7347
|
!disabled && "peer-focus:ring-2 peer-focus:ring-primary-200"
|
|
6999
7348
|
),
|
|
7000
|
-
children: isSelected && /* @__PURE__ */
|
|
7349
|
+
children: isSelected && /* @__PURE__ */ jsx40("div", { className: "w-2 h-2 rounded-full bg-primary-500" })
|
|
7001
7350
|
}
|
|
7002
7351
|
),
|
|
7003
|
-
/* @__PURE__ */
|
|
7352
|
+
/* @__PURE__ */ jsx40(ITText, { as: "span", className: "text-sm text-slate-700 dark:text-slate-300", children: opt.label })
|
|
7004
7353
|
]
|
|
7005
7354
|
},
|
|
7006
7355
|
opt.value
|
|
@@ -7010,186 +7359,9 @@ function ITRadioGroup({
|
|
|
7010
7359
|
);
|
|
7011
7360
|
}
|
|
7012
7361
|
|
|
7013
|
-
// src/components/search-select/search-select.tsx
|
|
7014
|
-
import { useState as useState19, useEffect as useEffect13, useRef as useRef11, useMemo as useMemo6 } from "react";
|
|
7015
|
-
import clsx32 from "clsx";
|
|
7016
|
-
import { FaSearch } from "react-icons/fa";
|
|
7017
|
-
import { jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
7018
|
-
function ITSearchSelect({
|
|
7019
|
-
name,
|
|
7020
|
-
options = [],
|
|
7021
|
-
label,
|
|
7022
|
-
placeholder = "Selecciona una opci\xF3n",
|
|
7023
|
-
valueField = "value",
|
|
7024
|
-
labelField = "label",
|
|
7025
|
-
value,
|
|
7026
|
-
onChange,
|
|
7027
|
-
onBlur,
|
|
7028
|
-
disabled = false,
|
|
7029
|
-
className,
|
|
7030
|
-
touched,
|
|
7031
|
-
required,
|
|
7032
|
-
error,
|
|
7033
|
-
readOnly = false,
|
|
7034
|
-
onSearch,
|
|
7035
|
-
isLoading = false,
|
|
7036
|
-
noResultsMessage = "No se encontraron resultados"
|
|
7037
|
-
}) {
|
|
7038
|
-
const [isOpen, setIsOpen] = useState19(false);
|
|
7039
|
-
const [searchTerm, setSearchTerm] = useState19("");
|
|
7040
|
-
const [isFocused, setIsFocused] = useState19(false);
|
|
7041
|
-
const [localTouched, setLocalTouched] = useState19(false);
|
|
7042
|
-
const containerRef = useRef11(null);
|
|
7043
|
-
const timeoutRef = useRef11(null);
|
|
7044
|
-
const selectedOption = useMemo6(() => {
|
|
7045
|
-
return options.find((opt) => opt[valueField] === value);
|
|
7046
|
-
}, [options, value, valueField]);
|
|
7047
|
-
useEffect13(() => {
|
|
7048
|
-
if (!isFocused) {
|
|
7049
|
-
setSearchTerm(selectedOption ? String(selectedOption[labelField]) : "");
|
|
7050
|
-
}
|
|
7051
|
-
}, [selectedOption, isFocused, labelField]);
|
|
7052
|
-
useEffect13(() => {
|
|
7053
|
-
function handleClickOutside(event) {
|
|
7054
|
-
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
7055
|
-
setIsOpen(false);
|
|
7056
|
-
}
|
|
7057
|
-
}
|
|
7058
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
7059
|
-
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
7060
|
-
}, []);
|
|
7061
|
-
const filteredOptions = useMemo6(() => {
|
|
7062
|
-
if (onSearch) return options;
|
|
7063
|
-
if (!searchTerm || !isFocused) return options;
|
|
7064
|
-
return options.filter(
|
|
7065
|
-
(opt) => String(opt[labelField]).toLowerCase().includes(searchTerm.toLowerCase())
|
|
7066
|
-
);
|
|
7067
|
-
}, [options, searchTerm, onSearch, labelField, isFocused]);
|
|
7068
|
-
const handleInputChange = (e) => {
|
|
7069
|
-
const query = e.target.value;
|
|
7070
|
-
setSearchTerm(query);
|
|
7071
|
-
setIsOpen(true);
|
|
7072
|
-
if (onSearch) {
|
|
7073
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
7074
|
-
timeoutRef.current = setTimeout(() => {
|
|
7075
|
-
onSearch(query);
|
|
7076
|
-
}, 500);
|
|
7077
|
-
}
|
|
7078
|
-
};
|
|
7079
|
-
const handleSelect = (option) => {
|
|
7080
|
-
if (onChange) {
|
|
7081
|
-
onChange(option[valueField], option);
|
|
7082
|
-
}
|
|
7083
|
-
setSearchTerm(String(option[labelField]));
|
|
7084
|
-
setIsOpen(false);
|
|
7085
|
-
};
|
|
7086
|
-
const handleFocus = () => {
|
|
7087
|
-
if (disabled || readOnly) return;
|
|
7088
|
-
setIsFocused(true);
|
|
7089
|
-
setIsOpen(true);
|
|
7090
|
-
};
|
|
7091
|
-
const handleInputBlur = (e) => {
|
|
7092
|
-
setTimeout(() => {
|
|
7093
|
-
setIsFocused(false);
|
|
7094
|
-
setLocalTouched(true);
|
|
7095
|
-
onBlur?.(e);
|
|
7096
|
-
}, 200);
|
|
7097
|
-
};
|
|
7098
|
-
const inputTheme = theme.input || {};
|
|
7099
|
-
const isTouched = touched !== void 0 ? touched : localTouched;
|
|
7100
|
-
const isEmpty = value === void 0 || value === null || String(value).trim() === "";
|
|
7101
|
-
const effectiveError = error !== void 0 && error !== false ? error === true ? "Este campo es requerido" : error : required && isEmpty ? "Este campo es requerido" : void 0;
|
|
7102
|
-
const hasError = isTouched && !!effectiveError;
|
|
7103
|
-
const errorMessage = typeof effectiveError === "string" ? effectiveError : "Este campo es requerido";
|
|
7104
|
-
const getInputStyle = () => {
|
|
7105
|
-
const style = {
|
|
7106
|
-
backgroundColor: inputTheme.backgroundColor || "#ffffff",
|
|
7107
|
-
borderColor: inputTheme.borderColor || "#e2e8f0",
|
|
7108
|
-
borderRadius: inputTheme.borderRadius || "0.5rem",
|
|
7109
|
-
padding: inputTheme.padding || "0.5rem 0.75rem",
|
|
7110
|
-
fontSize: inputTheme.fontSize || "0.875rem",
|
|
7111
|
-
borderWidth: "1px",
|
|
7112
|
-
borderStyle: "solid",
|
|
7113
|
-
transition: "all 0.2s",
|
|
7114
|
-
color: "var(--input-text-color, var(--color-secondary-900))",
|
|
7115
|
-
width: "100%"
|
|
7116
|
-
};
|
|
7117
|
-
if (disabled) {
|
|
7118
|
-
style.backgroundColor = inputTheme.disabled?.backgroundColor || "#f1f5f9";
|
|
7119
|
-
style.borderColor = inputTheme.disabled?.borderColor || "#e2e8f0";
|
|
7120
|
-
style.opacity = 0.7;
|
|
7121
|
-
style.cursor = "not-allowed";
|
|
7122
|
-
}
|
|
7123
|
-
if (hasError) {
|
|
7124
|
-
style.borderColor = inputTheme.error?.borderColor || "red";
|
|
7125
|
-
if (isFocused) {
|
|
7126
|
-
style.boxShadow = inputTheme.error?.ring;
|
|
7127
|
-
}
|
|
7128
|
-
} else if (isFocused && !readOnly) {
|
|
7129
|
-
style.boxShadow = inputTheme.focus?.ring;
|
|
7130
|
-
style.borderColor = inputTheme.focus?.borderColor;
|
|
7131
|
-
}
|
|
7132
|
-
return style;
|
|
7133
|
-
};
|
|
7134
|
-
return /* @__PURE__ */ jsxs30("div", { className: clsx32("w-full flex flex-col gap-1.5", className, isOpen && "relative z-30"), ref: containerRef, children: [
|
|
7135
|
-
label && /* @__PURE__ */ jsxs30(
|
|
7136
|
-
ITText,
|
|
7137
|
-
{
|
|
7138
|
-
as: "label",
|
|
7139
|
-
className: clsx32("text-sm font-medium text-gray-700 dark:text-slate-300", {
|
|
7140
|
-
"text-red-500": hasError
|
|
7141
|
-
}),
|
|
7142
|
-
children: [
|
|
7143
|
-
/* @__PURE__ */ jsx40(ITText, { as: "span", children: label }),
|
|
7144
|
-
required && /* @__PURE__ */ jsx40(ITText, { as: "span", className: "text-red-500 ml-1", children: "*" })
|
|
7145
|
-
]
|
|
7146
|
-
}
|
|
7147
|
-
),
|
|
7148
|
-
/* @__PURE__ */ jsxs30("div", { className: "relative", children: [
|
|
7149
|
-
/* @__PURE__ */ jsxs30("div", { className: "relative flex items-center", children: [
|
|
7150
|
-
/* @__PURE__ */ jsx40(
|
|
7151
|
-
"input",
|
|
7152
|
-
{
|
|
7153
|
-
type: "text",
|
|
7154
|
-
name,
|
|
7155
|
-
value: searchTerm,
|
|
7156
|
-
onChange: handleInputChange,
|
|
7157
|
-
onFocus: handleFocus,
|
|
7158
|
-
onBlur: handleInputBlur,
|
|
7159
|
-
disabled,
|
|
7160
|
-
readOnly,
|
|
7161
|
-
placeholder,
|
|
7162
|
-
className: "outline-none pr-10",
|
|
7163
|
-
style: getInputStyle(),
|
|
7164
|
-
autoComplete: "off"
|
|
7165
|
-
}
|
|
7166
|
-
),
|
|
7167
|
-
/* @__PURE__ */ jsxs30("div", { className: "absolute right-3 flex items-center gap-2 text-gray-400 pointer-events-none", children: [
|
|
7168
|
-
isLoading && /* @__PURE__ */ jsx40("div", { className: "animate-spin h-4 w-4 border-2 border-primary-500 border-t-transparent rounded-full" }),
|
|
7169
|
-
!isLoading && /* @__PURE__ */ jsx40(FaSearch, { size: 14, className: clsx32({ "text-primary-500": isFocused }) })
|
|
7170
|
-
] })
|
|
7171
|
-
] }),
|
|
7172
|
-
isOpen && /* @__PURE__ */ jsx40("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__ */ jsx40("div", { className: "max-h-60 overflow-y-auto", children: filteredOptions.length > 0 ? filteredOptions.map((option) => /* @__PURE__ */ jsx40(
|
|
7173
|
-
ITText,
|
|
7174
|
-
{
|
|
7175
|
-
as: "div",
|
|
7176
|
-
onClick: () => handleSelect(option),
|
|
7177
|
-
className: clsx32(
|
|
7178
|
-
"px-4 py-2 text-sm cursor-pointer transition-colors",
|
|
7179
|
-
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"
|
|
7180
|
-
),
|
|
7181
|
-
children: /* @__PURE__ */ jsx40(ITText, { as: "span", children: option[labelField] })
|
|
7182
|
-
},
|
|
7183
|
-
option[valueField]
|
|
7184
|
-
)) : /* @__PURE__ */ jsx40(ITText, { as: "div", className: "px-4 py-6 text-sm text-center text-gray-500 italic", children: isLoading ? "Cargando..." : noResultsMessage }) }) })
|
|
7185
|
-
] }),
|
|
7186
|
-
hasError && /* @__PURE__ */ jsx40(ITText, { as: "p", className: "text-red-500 text-xs mt-1", children: errorMessage })
|
|
7187
|
-
] });
|
|
7188
|
-
}
|
|
7189
|
-
|
|
7190
7362
|
// src/components/searchTable/searchTable.tsx
|
|
7191
7363
|
import clsx34 from "clsx";
|
|
7192
|
-
import { useState as
|
|
7364
|
+
import { useState as useState22 } from "react";
|
|
7193
7365
|
|
|
7194
7366
|
// src/components/searchTable/components/SearchInput.tsx
|
|
7195
7367
|
import { FaSearch as FaSearch2 } from "react-icons/fa";
|
|
@@ -7695,7 +7867,7 @@ function ITSearchTable({
|
|
|
7695
7867
|
onSave,
|
|
7696
7868
|
onCancel
|
|
7697
7869
|
}) {
|
|
7698
|
-
const [itemsPerPage, setItemsPerPage] =
|
|
7870
|
+
const [itemsPerPage, setItemsPerPage] = useState22(defaultItemsPerPage);
|
|
7699
7871
|
const { searchTerm, handleSearchChange, handleClearSearch } = useDebouncedSearch({
|
|
7700
7872
|
initialValue: searchTermInitial,
|
|
7701
7873
|
onSearch: (value) => {
|
|
@@ -7808,7 +7980,7 @@ function ITSearchTable({
|
|
|
7808
7980
|
}
|
|
7809
7981
|
|
|
7810
7982
|
// src/components/sidebar/sidebar.tsx
|
|
7811
|
-
import { useEffect as useEffect14, useRef as useRef12, useState as
|
|
7983
|
+
import { useEffect as useEffect14, useRef as useRef12, useState as useState23 } from "react";
|
|
7812
7984
|
import { FaChevronDown as FaChevronDown2 } from "react-icons/fa";
|
|
7813
7985
|
import { jsx as jsx51, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
7814
7986
|
function ITSidebar({
|
|
@@ -7821,8 +7993,8 @@ function ITSidebar({
|
|
|
7821
7993
|
onSubItemClick,
|
|
7822
7994
|
subitemConnector = "dot"
|
|
7823
7995
|
}) {
|
|
7824
|
-
const [expandedItems, setExpandedItems] =
|
|
7825
|
-
const [isHovering, setIsHovering] =
|
|
7996
|
+
const [expandedItems, setExpandedItems] = useState23(/* @__PURE__ */ new Set());
|
|
7997
|
+
const [isHovering, setIsHovering] = useState23(false);
|
|
7826
7998
|
const sidebarRef = useRef12(null);
|
|
7827
7999
|
const hoverTimeoutRef = useRef12(null);
|
|
7828
8000
|
const leaveTimeoutRef = useRef12(null);
|
|
@@ -8096,7 +8268,7 @@ function ITSidebar({
|
|
|
8096
8268
|
}
|
|
8097
8269
|
|
|
8098
8270
|
// src/components/slide/slide.tsx
|
|
8099
|
-
import { useState as
|
|
8271
|
+
import { useState as useState24, useEffect as useEffect15 } from "react";
|
|
8100
8272
|
import clsx35 from "clsx";
|
|
8101
8273
|
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
8102
8274
|
function ITSlideToggle({
|
|
@@ -8111,7 +8283,7 @@ function ITSlideToggle({
|
|
|
8111
8283
|
className = ""
|
|
8112
8284
|
}) {
|
|
8113
8285
|
const isControlled = controlledIsOn !== void 0;
|
|
8114
|
-
const [internalIsOn, setInternalIsOn] =
|
|
8286
|
+
const [internalIsOn, setInternalIsOn] = useState24(initialState);
|
|
8115
8287
|
useEffect15(() => {
|
|
8116
8288
|
if (isControlled) {
|
|
8117
8289
|
setInternalIsOn(controlledIsOn);
|
|
@@ -8376,7 +8548,7 @@ var positionStyles = {
|
|
|
8376
8548
|
|
|
8377
8549
|
// src/components/toast/toast.tsx
|
|
8378
8550
|
import clsx40 from "clsx";
|
|
8379
|
-
import { useEffect as useEffect16, useState as
|
|
8551
|
+
import { useEffect as useEffect16, useState as useState25 } from "react";
|
|
8380
8552
|
import { FaTimesCircle as FaTimesCircle2, FaCheckCircle as FaCheckCircle2, FaExclamationTriangle as FaExclamationTriangle3, FaInfoCircle as FaInfoCircle2, FaTimes as FaTimes8 } from "react-icons/fa";
|
|
8381
8553
|
import { jsx as jsx57, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
8382
8554
|
function ITToast({
|
|
@@ -8386,7 +8558,7 @@ function ITToast({
|
|
|
8386
8558
|
position = "top-right",
|
|
8387
8559
|
onClose
|
|
8388
8560
|
}) {
|
|
8389
|
-
const [isVisible, setIsVisible] =
|
|
8561
|
+
const [isVisible, setIsVisible] = useState25(true);
|
|
8390
8562
|
useEffect16(() => {
|
|
8391
8563
|
const timer = setTimeout(() => {
|
|
8392
8564
|
setIsVisible(false);
|
|
@@ -8453,10 +8625,11 @@ function ITToast({
|
|
|
8453
8625
|
}
|
|
8454
8626
|
|
|
8455
8627
|
// src/components/dropfile/dropfile.tsx
|
|
8456
|
-
import { useState as
|
|
8628
|
+
import { useState as useState26, useEffect as useEffect17, useRef as useRef13 } from "react";
|
|
8457
8629
|
import { useDropzone } from "react-dropzone";
|
|
8458
8630
|
import clsx41 from "clsx";
|
|
8459
|
-
|
|
8631
|
+
|
|
8632
|
+
// src/components/dropfile/dropfile.props.ts
|
|
8460
8633
|
var FileTypeEnum = /* @__PURE__ */ ((FileTypeEnum2) => {
|
|
8461
8634
|
FileTypeEnum2["PDF"] = "application/pdf";
|
|
8462
8635
|
FileTypeEnum2["XLS"] = "application/vnd.ms-excel";
|
|
@@ -8474,6 +8647,9 @@ var UploadStatus = /* @__PURE__ */ ((UploadStatus2) => {
|
|
|
8474
8647
|
UploadStatus2["ERROR"] = "error";
|
|
8475
8648
|
return UploadStatus2;
|
|
8476
8649
|
})(UploadStatus || {});
|
|
8650
|
+
|
|
8651
|
+
// src/components/dropfile/dropfile.tsx
|
|
8652
|
+
import { Fragment as Fragment8, jsx as jsx58, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
8477
8653
|
var ITDropfile = ({
|
|
8478
8654
|
onFileSelect,
|
|
8479
8655
|
onCancel,
|
|
@@ -8486,11 +8662,11 @@ var ITDropfile = ({
|
|
|
8486
8662
|
onStatusChange,
|
|
8487
8663
|
initialPreviewUrl
|
|
8488
8664
|
}) => {
|
|
8489
|
-
const [selectedFile, setSelectedFile] =
|
|
8490
|
-
const [fileType, setFileType] =
|
|
8491
|
-
const [imagePreview, setImagePreview] =
|
|
8492
|
-
const [isConfirmed, setIsConfirmed] =
|
|
8493
|
-
const [internalUploadStatus, setInternalUploadStatus] =
|
|
8665
|
+
const [selectedFile, setSelectedFile] = useState26(null);
|
|
8666
|
+
const [fileType, setFileType] = useState26(null);
|
|
8667
|
+
const [imagePreview, setImagePreview] = useState26(initialPreviewUrl || null);
|
|
8668
|
+
const [isConfirmed, setIsConfirmed] = useState26(false);
|
|
8669
|
+
const [internalUploadStatus, setInternalUploadStatus] = useState26(
|
|
8494
8670
|
initialPreviewUrl ? "subido" /* UPLOADED */ : "pendiente" /* PENDING */
|
|
8495
8671
|
);
|
|
8496
8672
|
const canvasRef = useRef13(null);
|
|
@@ -8765,12 +8941,12 @@ var ITDropfile = ({
|
|
|
8765
8941
|
var dropfile_default = ITDropfile;
|
|
8766
8942
|
|
|
8767
8943
|
// src/components/layout/layout.tsx
|
|
8768
|
-
import { useState as
|
|
8944
|
+
import { useState as useState28 } from "react";
|
|
8769
8945
|
import clsx42 from "clsx";
|
|
8770
8946
|
|
|
8771
8947
|
// src/components/topbar/topbar.tsx
|
|
8772
8948
|
import { FaUserCircle as FaUserCircle2, FaBars } from "react-icons/fa";
|
|
8773
|
-
import { useRef as useRef14, useState as
|
|
8949
|
+
import { useRef as useRef14, useState as useState27 } from "react";
|
|
8774
8950
|
import { jsx as jsx59, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
8775
8951
|
function ITTopBar({
|
|
8776
8952
|
logo,
|
|
@@ -8781,7 +8957,7 @@ function ITTopBar({
|
|
|
8781
8957
|
navItems,
|
|
8782
8958
|
onNavItemClick
|
|
8783
8959
|
}) {
|
|
8784
|
-
const [isUserMenuOpen, setIsUserMenuOpen] =
|
|
8960
|
+
const [isUserMenuOpen, setIsUserMenuOpen] = useState27(false);
|
|
8785
8961
|
const userMenuRef = useRef14(null);
|
|
8786
8962
|
useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
|
|
8787
8963
|
return /* @__PURE__ */ jsx59(
|
|
@@ -8952,8 +9128,12 @@ function ITLayout({
|
|
|
8952
9128
|
className = "",
|
|
8953
9129
|
contentClassName = ""
|
|
8954
9130
|
}) {
|
|
8955
|
-
const [
|
|
8956
|
-
const [mobileSidebarOpen, setMobileSidebarOpen] =
|
|
9131
|
+
const [internalCollapsed, setInternalCollapsed] = useState28(true);
|
|
9132
|
+
const [mobileSidebarOpen, setMobileSidebarOpen] = useState28(false);
|
|
9133
|
+
const isControlled = sidebar.isCollapsed !== void 0;
|
|
9134
|
+
const desktopCollapsed = isControlled ? sidebar.isCollapsed : internalCollapsed;
|
|
9135
|
+
const handleToggleCollapse = isControlled ? sidebar.onToggleCollapse ?? (() => {
|
|
9136
|
+
}) : () => setInternalCollapsed((v) => !v);
|
|
8957
9137
|
const layoutTokens = theme.layout;
|
|
8958
9138
|
return /* @__PURE__ */ jsxs46("div", { className: `flex flex-col h-screen overflow-hidden w-full ${className}`, children: [
|
|
8959
9139
|
/* @__PURE__ */ jsx60(
|
|
@@ -8977,7 +9157,7 @@ function ITLayout({
|
|
|
8977
9157
|
{
|
|
8978
9158
|
...sidebar,
|
|
8979
9159
|
isCollapsed: desktopCollapsed,
|
|
8980
|
-
onToggleCollapse:
|
|
9160
|
+
onToggleCollapse: handleToggleCollapse,
|
|
8981
9161
|
visibleOnMobile: false,
|
|
8982
9162
|
className: "h-full drop-shadow-2xl transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] flex-shrink-0"
|
|
8983
9163
|
}
|
|
@@ -9103,7 +9283,7 @@ function ITLoader({
|
|
|
9103
9283
|
|
|
9104
9284
|
// src/components/stepper/stepper.tsx
|
|
9105
9285
|
import clsx43 from "clsx";
|
|
9106
|
-
import { useEffect as useEffect18, useRef as useRef15, useState as
|
|
9286
|
+
import { useEffect as useEffect18, useRef as useRef15, useState as useState29 } from "react";
|
|
9107
9287
|
import { FaChevronLeft as FaChevronLeft4, FaChevronRight as FaChevronRight5, FaCheck as FaCheck4 } from "react-icons/fa";
|
|
9108
9288
|
import { jsx as jsx62, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
9109
9289
|
function ITStepper({
|
|
@@ -9120,7 +9300,7 @@ function ITStepper({
|
|
|
9120
9300
|
maxContentHeight = "400px",
|
|
9121
9301
|
color = "primary"
|
|
9122
9302
|
}) {
|
|
9123
|
-
const [direction, setDirection] =
|
|
9303
|
+
const [direction, setDirection] = useState29("next");
|
|
9124
9304
|
const contentRef = useRef15(null);
|
|
9125
9305
|
const progressRef = useRef15(null);
|
|
9126
9306
|
const isThemeColor = color in theme.colors;
|