@axzydev/axzy_ui_system 1.3.1 → 1.3.3

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.
Files changed (50) hide show
  1. package/README.md +6 -2
  2. package/dist/index.cjs +957 -554
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.css +1 -1
  5. package/dist/index.d.cts +191 -9
  6. package/dist/index.d.ts +191 -9
  7. package/dist/index.js +908 -505
  8. package/dist/index.js.map +1 -1
  9. package/package.json +1 -1
  10. package/src/App.tsx +150 -154
  11. package/src/components/molecules/table/table.doc.mdx +64 -21
  12. package/src/components/molecules/table/table.props.ts +81 -2
  13. package/src/components/molecules/table/table.stories.tsx +155 -0
  14. package/src/components/molecules/table/table.tsx +178 -36
  15. package/src/components/organisms/data-table/ITDataTable.doc.mdx +37 -3
  16. package/src/components/organisms/data-table/ITDataTable.stories.tsx +43 -0
  17. package/src/components/organisms/data-table/dataTable.props.ts +64 -0
  18. package/src/components/organisms/data-table/dataTable.tsx +241 -82
  19. package/src/components/organisms/sidebar/sidebar.doc.mdx +5 -0
  20. package/src/components/organisms/sidebar/sidebar.props.ts +5 -0
  21. package/src/components/organisms/sidebar/sidebar.stories.tsx +1 -1
  22. package/src/components/organisms/sidebar/sidebar.tsx +27 -7
  23. package/src/components/organisms/topbar/topbar.doc.mdx +3 -0
  24. package/src/components/organisms/topbar/topbar.props.ts +16 -0
  25. package/src/components/organisms/topbar/topbar.tsx +133 -98
  26. package/src/components/templates/layout/layout.doc.mdx +2 -0
  27. package/src/components/templates/layout/layout.tsx +7 -1
  28. package/src/components/templates/page/page.doc.mdx +8 -2
  29. package/src/components/templates/page/page.props.ts +11 -1
  30. package/src/components/templates/page/page.tsx +11 -1
  31. package/src/components/theme-provider/themePresets.ts +6 -0
  32. package/src/components/theme-provider/themeProvider.doc.mdx +1 -0
  33. package/src/components/theme-provider/themeProvider.props.ts +2 -0
  34. package/src/components/theme-provider/themeProvider.tsx +13 -2
  35. package/src/dev.css +58 -1
  36. package/src/hooks/useElementSize.ts +46 -0
  37. package/src/hooks/useVirtualRows.ts +123 -0
  38. package/src/index.ts +2 -0
  39. package/src/sandbox/LandingShowcase.tsx +654 -0
  40. package/src/sandbox/NotFoundShowcase.tsx +70 -0
  41. package/src/sandbox/TopbarSearch.tsx +85 -0
  42. package/src/sandbox/navigation.ts +148 -0
  43. package/src/sandbox/useHashRoute.ts +149 -0
  44. package/src/showcases/DataShowcases.tsx +321 -24
  45. package/src/showcases/PageShowcases.tsx +31 -0
  46. package/src/showcases/StructureShowcases.tsx +42 -4
  47. package/src/theme/theme.types.ts +2 -0
  48. package/src/types/table.types.ts +48 -0
  49. package/src/utils/styles.ts +12 -5
  50. package/src/utils/table.utils.ts +31 -0
package/dist/index.cjs CHANGED
@@ -2119,6 +2119,34 @@ var import_react10 = require("react");
2119
2119
 
2120
2120
  // src/utils/styles.ts
2121
2121
  var import_clsx11 = __toESM(require("clsx"), 1);
2122
+
2123
+ // src/types/table.types.ts
2124
+ var variantStyles = {
2125
+ default: "",
2126
+ striped: "",
2127
+ bordered: "border border-gray-200"
2128
+ };
2129
+ var sizeStyles = {
2130
+ sm: "text-xs",
2131
+ md: "text-sm",
2132
+ lg: "text-lg"
2133
+ };
2134
+ var densityStyles = {
2135
+ compact: { header: "px-3 py-2", cell: "px-3 py-1.5", rowHeight: 33 },
2136
+ normal: { header: "px-4 py-4", cell: "px-4 py-3", rowHeight: 45 },
2137
+ comfortable: { header: "px-4 py-5", cell: "px-4 py-4", rowHeight: 53 }
2138
+ };
2139
+ var sizeLineHeights = { sm: 16, md: 20, lg: 28 };
2140
+ function getRowHeight(size, density) {
2141
+ return densityStyles[density].rowHeight - sizeLineHeights.md + sizeLineHeights[size];
2142
+ }
2143
+ var tableAlignClasses = {
2144
+ left: "text-left",
2145
+ center: "text-center",
2146
+ right: "text-right"
2147
+ };
2148
+
2149
+ // src/utils/styles.ts
2122
2150
  function inputFieldStyle(inputTheme, size = "md", extra) {
2123
2151
  const sizeConfig = inputSizeTokens[size] ?? inputSizeTokens.md;
2124
2152
  return {
@@ -2148,13 +2176,16 @@ var iconAbsoluteLeft = "absolute inset-y-0 left-0 flex items-center pl-3 z-10";
2148
2176
  var iconAbsoluteRight = "absolute inset-y-0 right-0 flex items-center pr-3 z-10";
2149
2177
  var tableContainer = "rounded-xl shadow-sm border border-secondary-200 overflow-hidden";
2150
2178
  var tableHeaderRow = "bg-secondary-50 border-b border-secondary-200 text-xs uppercase tracking-wider font-semibold text-secondary-500";
2151
- function tableHeaderCell(className) {
2152
- return (0, import_clsx11.default)("px-4 py-4 align-top", className);
2179
+ function tableHeaderCell(className, density = "normal") {
2180
+ return (0, import_clsx11.default)(densityStyles[density].header, "align-top", className);
2153
2181
  }
2154
2182
  var tableBody = "divide-y divide-secondary-100";
2155
- var tableRow = "hover:bg-secondary-50/50 transition-colors duration-150 group";
2156
- function tableCell(className) {
2157
- return (0, import_clsx11.default)("px-4 py-3 align-middle", className);
2183
+ var tableRow = "hover:bg-[var(--color-table-rowHover,var(--color-secondary-50))] transition-colors duration-150 group";
2184
+ var tableRowClickable = "cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-inset";
2185
+ var tableCardClickable = "cursor-pointer rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500";
2186
+ var tableCardHover = "hover:bg-[var(--color-table-rowHover,var(--color-secondary-50))] transition-colors duration-150";
2187
+ function tableCell(className, density = "normal") {
2188
+ return (0, import_clsx11.default)(densityStyles[density].cell, "align-middle", className);
2158
2189
  }
2159
2190
  var tableActionsCell = "flex items-center justify-center gap-2";
2160
2191
  var tableCellText = "text-secondary-700 font-medium";
@@ -3571,32 +3602,99 @@ function ITConfirmDialog({
3571
3602
  ] });
3572
3603
  }
3573
3604
 
3574
- // src/types/table.types.ts
3575
- var variantStyles = {
3576
- default: "",
3577
- striped: "",
3578
- bordered: "border border-gray-200"
3579
- };
3580
- var sizeStyles = {
3581
- sm: "text-xs",
3582
- md: "text-sm",
3583
- lg: "text-lg"
3584
- };
3605
+ // src/hooks/useElementSize.ts
3606
+ var import_react15 = require("react");
3607
+ function useElementSize() {
3608
+ const ref = (0, import_react15.useRef)(null);
3609
+ const [size, setSize] = (0, import_react15.useState)({ width: 0, height: 0 });
3610
+ (0, import_react15.useLayoutEffect)(() => {
3611
+ const element = ref.current;
3612
+ if (!element) return;
3613
+ const update = () => {
3614
+ const rect = element.getBoundingClientRect();
3615
+ setSize({ width: rect.width, height: rect.height });
3616
+ };
3617
+ update();
3618
+ const observer = new ResizeObserver(update);
3619
+ observer.observe(element);
3620
+ return () => observer.disconnect();
3621
+ }, []);
3622
+ return { ref, width: size.width, height: size.height };
3623
+ }
3624
+
3625
+ // src/hooks/useVirtualRows.ts
3626
+ var import_react16 = require("react");
3627
+ function useVirtualRows({
3628
+ count,
3629
+ rowHeight,
3630
+ overscan = 5,
3631
+ enabled = true,
3632
+ resetKey
3633
+ }) {
3634
+ const scrollRef = (0, import_react16.useRef)(null);
3635
+ const [scrollTop, setScrollTop] = (0, import_react16.useState)(0);
3636
+ const [viewportHeight, setViewportHeight] = (0, import_react16.useState)(0);
3637
+ const scrollToTop = (0, import_react16.useCallback)(() => {
3638
+ setScrollTop(0);
3639
+ const element = scrollRef.current;
3640
+ if (element) element.scrollTop = 0;
3641
+ }, []);
3642
+ (0, import_react16.useLayoutEffect)(() => {
3643
+ if (!enabled) return;
3644
+ const element = scrollRef.current;
3645
+ if (!element) return;
3646
+ const onScroll = () => setScrollTop(element.scrollTop);
3647
+ const measure = () => setViewportHeight(element.clientHeight);
3648
+ measure();
3649
+ setScrollTop(element.scrollTop);
3650
+ element.addEventListener("scroll", onScroll, { passive: true });
3651
+ const observer = new ResizeObserver(measure);
3652
+ observer.observe(element);
3653
+ return () => {
3654
+ element.removeEventListener("scroll", onScroll);
3655
+ observer.disconnect();
3656
+ };
3657
+ }, [enabled]);
3658
+ (0, import_react16.useLayoutEffect)(() => {
3659
+ if (!enabled) return;
3660
+ const element = scrollRef.current;
3661
+ if (element) element.scrollTop = 0;
3662
+ setScrollTop(0);
3663
+ }, [resetKey, enabled]);
3664
+ const valid = enabled && rowHeight > 0 && count > 0;
3665
+ const safeScrollTop = valid ? scrollTop : 0;
3666
+ const startIndex = valid ? Math.min(count - 1, Math.max(0, Math.floor(safeScrollTop / rowHeight) - overscan)) : 0;
3667
+ const endIndex = valid ? Math.min(
3668
+ count - 1,
3669
+ Math.ceil((safeScrollTop + viewportHeight) / rowHeight) + overscan
3670
+ ) : Math.max(0, count - 1);
3671
+ const topSpacerHeight = valid ? startIndex * rowHeight : 0;
3672
+ const bottomSpacerHeight = valid ? Math.max(0, (count - 1 - endIndex) * rowHeight) : 0;
3673
+ return {
3674
+ scrollRef,
3675
+ startIndex,
3676
+ endIndex,
3677
+ topSpacerHeight,
3678
+ bottomSpacerHeight,
3679
+ scrollTop: safeScrollTop,
3680
+ scrollToTop
3681
+ };
3682
+ }
3585
3683
 
3586
3684
  // src/components/organisms/data-table/dataTable.tsx
3587
3685
  var import_clsx21 = __toESM(require("clsx"), 1);
3588
- var import_react17 = require("react");
3686
+ var import_react19 = require("react");
3589
3687
  var import_fa11 = require("react-icons/fa");
3590
3688
  var import_md = require("react-icons/md");
3591
3689
 
3592
3690
  // src/components/molecules/pagination/pagination.tsx
3593
- var import_react16 = __toESM(require("react"), 1);
3691
+ var import_react18 = __toESM(require("react"), 1);
3594
3692
  var import_clsx20 = __toESM(require("clsx"), 1);
3595
3693
  var import_fa10 = require("react-icons/fa");
3596
3694
 
3597
3695
  // src/components/molecules/select/select.tsx
3598
3696
  var import_clsx19 = __toESM(require("clsx"), 1);
3599
- var import_react15 = require("react");
3697
+ var import_react17 = require("react");
3600
3698
  var import_fa9 = require("react-icons/fa");
3601
3699
  var import_jsx_runtime19 = require("react/jsx-runtime");
3602
3700
  function ITSelect({
@@ -3617,8 +3715,8 @@ function ITSelect({
3617
3715
  readOnly = false,
3618
3716
  size = "md"
3619
3717
  }) {
3620
- const [isFocused, setIsFocused] = (0, import_react15.useState)(false);
3621
- const [localTouched, setLocalTouched] = (0, import_react15.useState)(false);
3718
+ const [isFocused, setIsFocused] = (0, import_react17.useState)(false);
3719
+ const [localTouched, setLocalTouched] = (0, import_react17.useState)(false);
3622
3720
  const inputTheme = theme.input || {};
3623
3721
  const isTouched = touched !== void 0 ? touched : localTouched;
3624
3722
  const isEmpty = value === void 0 || value === null || String(value).trim() === "";
@@ -3712,7 +3810,7 @@ var usePagination = ({
3712
3810
  currentPage,
3713
3811
  siblingCount = 1
3714
3812
  }) => {
3715
- return import_react16.default.useMemo(() => {
3813
+ return import_react18.default.useMemo(() => {
3716
3814
  const totalPageNumbers = siblingCount + 5;
3717
3815
  if (totalPageNumbers >= totalPages) {
3718
3816
  return Array.from({ length: totalPages }, (_, i) => i + 1);
@@ -3889,6 +3987,14 @@ var formatCurrencyMX = (value) => {
3889
3987
  var getNestedValue = (obj, path) => {
3890
3988
  return path.split(".").reduce((acc, part) => acc && acc[part], obj);
3891
3989
  };
3990
+ var ROW_CLICK_IGNORE_SELECTOR = 'button, a, input, select, textarea, [role="button"], [role="link"], [data-row-click-ignore]';
3991
+ function isInteractiveTarget(target, boundary = null) {
3992
+ if (!(target instanceof Element)) return false;
3993
+ const interactive = target.closest(ROW_CLICK_IGNORE_SELECTOR);
3994
+ if (!interactive) return false;
3995
+ if (boundary instanceof Node && interactive === boundary) return false;
3996
+ return true;
3997
+ }
3892
3998
 
3893
3999
  // src/components/organisms/data-table/dataTable.tsx
3894
4000
  var import_jsx_runtime21 = require("react/jsx-runtime");
@@ -3914,12 +4020,32 @@ function ITDataTable({
3914
4020
  renderCard,
3915
4021
  defaultView,
3916
4022
  showVerticalBorder = true,
3917
- verticalBorderClassname
4023
+ verticalBorderClassname,
4024
+ onRowClick,
4025
+ layout = "auto",
4026
+ density = "normal",
4027
+ autoCardBreakpoint = 0,
4028
+ virtualized = false,
4029
+ virtualizedMaxHeight = 400,
4030
+ rowHeight,
4031
+ overscan = 5,
4032
+ stickyHeader = false
3918
4033
  }) {
3919
- const [viewMode, setViewMode] = (0, import_react17.useState)(defaultView || "table");
3920
- const [data, setData] = (0, import_react17.useState)([]);
3921
- const [totalItems, setTotalItems] = (0, import_react17.useState)(0);
3922
- const [isLoading, setIsLoading] = (0, import_react17.useState)(fetchOnMount);
4034
+ const [viewMode, setViewMode] = (0, import_react19.useState)(defaultView || "table");
4035
+ const { ref: rootRef, width: containerWidth } = useElementSize();
4036
+ const [data, setData] = (0, import_react19.useState)([]);
4037
+ const [totalItems, setTotalItems] = (0, import_react19.useState)(0);
4038
+ const [isLoading, setIsLoading] = (0, import_react19.useState)(fetchOnMount);
4039
+ const isFixed = layout === "fixed";
4040
+ const forcedCards = autoCardBreakpoint > 0 && containerWidth > 0 && containerWidth < autoCardBreakpoint;
4041
+ const effectiveView = forcedCards ? "cards" : viewMode;
4042
+ const hasColumnWidths = columns.some((col) => col.width != null);
4043
+ const tableLayoutClass = isFixed ? "w-full text-sm text-left text-secondary-600 transition-opacity duration-300" : "min-w-max w-full text-sm text-left text-secondary-600 transition-opacity duration-300";
4044
+ const isTableVirtual = virtualized && effectiveView === "table";
4045
+ const isStickyHeader = stickyHeader && isTableVirtual;
4046
+ const resolvedRowHeight = rowHeight ?? getRowHeight(size, density);
4047
+ const columnCount = columns.length;
4048
+ const scrollOuterClass = isTableVirtual ? "relative min-h-[200px]" : "overflow-x-auto relative min-h-[200px]";
3923
4049
  const {
3924
4050
  currentPage,
3925
4051
  itemsPerPage,
@@ -3930,15 +4056,29 @@ function ITDataTable({
3930
4056
  handleSort,
3931
4057
  handleItemsPerPageChange
3932
4058
  } = useTableState({ defaultItemsPerPage });
3933
- const debounceTimerRef = (0, import_react17.useRef)(null);
3934
- const hasFetchedRef = (0, import_react17.useRef)(false);
3935
- const fetchDataRef = (0, import_react17.useRef)(fetchData);
4059
+ const {
4060
+ scrollRef,
4061
+ startIndex,
4062
+ endIndex,
4063
+ topSpacerHeight,
4064
+ bottomSpacerHeight
4065
+ } = useVirtualRows({
4066
+ count: data.length,
4067
+ rowHeight: resolvedRowHeight,
4068
+ overscan,
4069
+ enabled: isTableVirtual,
4070
+ resetKey: `${currentPage}-${itemsPerPage}`
4071
+ });
4072
+ const windowData = isTableVirtual ? data.slice(startIndex, endIndex + 1) : data;
4073
+ const debounceTimerRef = (0, import_react19.useRef)(null);
4074
+ const hasFetchedRef = (0, import_react19.useRef)(false);
4075
+ const fetchDataRef = (0, import_react19.useRef)(fetchData);
3936
4076
  fetchDataRef.current = fetchData;
3937
- const externalFiltersRef = (0, import_react17.useRef)(externalFilters);
4077
+ const externalFiltersRef = (0, import_react19.useRef)(externalFilters);
3938
4078
  externalFiltersRef.current = externalFilters;
3939
4079
  const externalKey = JSON.stringify(externalFilters);
3940
4080
  const computedTotalPages = Math.ceil(totalItems / itemsPerPage) || 1;
3941
- const performFetch = (0, import_react17.useCallback)(async () => {
4081
+ const performFetch = (0, import_react19.useCallback)(async () => {
3942
4082
  setIsLoading(true);
3943
4083
  try {
3944
4084
  const response = await fetchDataRef.current({
@@ -3959,9 +4099,9 @@ function ITDataTable({
3959
4099
  setIsLoading(false);
3960
4100
  }
3961
4101
  }, [currentPage, itemsPerPage, filters, sortConfig]);
3962
- const performFetchRef = (0, import_react17.useRef)(performFetch);
4102
+ const performFetchRef = (0, import_react19.useRef)(performFetch);
3963
4103
  performFetchRef.current = performFetch;
3964
- (0, import_react17.useEffect)(() => {
4104
+ (0, import_react19.useEffect)(() => {
3965
4105
  if (!fetchOnMount && !hasFetchedRef.current) return;
3966
4106
  if (debounceTimerRef.current) clearTimeout(debounceTimerRef.current);
3967
4107
  debounceTimerRef.current = setTimeout(() => {
@@ -4080,15 +4220,132 @@ function ITDataTable({
4080
4220
  actionCol?.actions && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex items-center justify-end gap-2 pt-2 border-t border-slate-100 dark:border-slate-700", children: actionCol.actions(row) })
4081
4221
  ] });
4082
4222
  };
4083
- 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"}`;
4084
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: (0, import_clsx21.default)("space-y-4 w-full relative", containerClassName), children: [
4223
+ const segCtrlClass = (mode) => `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${effectiveView === 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"}`;
4224
+ const handleRowClick = (row) => (event) => {
4225
+ if (!onRowClick || isLoading || isInteractiveTarget(event.target, event.currentTarget)) return;
4226
+ onRowClick(row, event);
4227
+ };
4228
+ const handleRowKeyDown = (row) => (event) => {
4229
+ if (!onRowClick || isLoading) return;
4230
+ if (event.target !== event.currentTarget) return;
4231
+ if (event.key !== "Enter" && event.key !== " ") return;
4232
+ event.preventDefault();
4233
+ onRowClick(row, event);
4234
+ };
4235
+ const tableEl = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
4236
+ "table",
4237
+ {
4238
+ className: (0, import_clsx21.default)(
4239
+ tableLayoutClass,
4240
+ showVerticalBorder && "[&_th]:border-r [&_th:last-child]:border-r-0 [&_td]:border-r [&_td:last-child]:border-r-0",
4241
+ showVerticalBorder && (verticalBorderClassname || "[&_th]:border-slate-100 dark:[&_th]:border-slate-700/30 [&_td]:border-slate-100 dark:[&_td]:border-slate-700/30"),
4242
+ isLoading ? "opacity-50" : "opacity-100",
4243
+ variantStyles[variant],
4244
+ sizeStyles[size],
4245
+ className
4246
+ ),
4247
+ style: isFixed ? { tableLayout: "fixed" } : void 0,
4248
+ "aria-rowcount": isTableVirtual ? data.length + 1 : void 0,
4249
+ children: [
4250
+ hasColumnWidths && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("colgroup", { children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4251
+ "col",
4252
+ {
4253
+ style: col.width != null ? { width: typeof col.width === "number" ? `${col.width}px` : col.width } : void 0
4254
+ },
4255
+ col.key
4256
+ )) }),
4257
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4258
+ "tr",
4259
+ {
4260
+ className: (0, import_clsx21.default)(tableHeaderRow, "dark:text-slate-200"),
4261
+ "aria-rowindex": isTableVirtual ? 1 : void 0,
4262
+ children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4263
+ "th",
4264
+ {
4265
+ scope: "col",
4266
+ className: (0, import_clsx21.default)(
4267
+ tableHeaderCell(col.className, density),
4268
+ col.align && tableAlignClasses[col.align],
4269
+ isStickyHeader && "sticky top-0 z-10 bg-secondary-50"
4270
+ ),
4271
+ style: col.minWidth != null || isStickyHeader ? {
4272
+ ...col.minWidth != null ? { minWidth: `${col.minWidth}px` } : {},
4273
+ ...isStickyHeader ? { backgroundColor: "var(--color-table-headerBg, #f8fafc)" } : {}
4274
+ } : void 0,
4275
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: isFixed ? "flex flex-col gap-3" : "flex flex-col gap-3 min-w-[150px]", children: [
4276
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
4277
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ITText, { as: "span", className: "text-slate-900 dark:text-white font-bold", children: col.label }),
4278
+ col.sortable && col.type !== "actions" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4279
+ "button",
4280
+ {
4281
+ onClick: () => handleSort(col.key),
4282
+ disabled: isLoading,
4283
+ className: `p-1 rounded-md transition-colors ${sortConfig?.key === col.key ? "bg-secondary-200 text-secondary-900" : "hover:bg-secondary-200 text-secondary-400 hover:text-secondary-700"} disabled:opacity-50`,
4284
+ title: `Ordenar por ${col.label}`,
4285
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_md.MdOutlineSwapVert, { className: "w-4 h-4", "aria-hidden": "true" })
4286
+ }
4287
+ )
4288
+ ] }),
4289
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "w-full", children: col.filter ? renderFilterInput(col) : null })
4290
+ ] })
4291
+ },
4292
+ col.key
4293
+ ))
4294
+ }
4295
+ ) }),
4296
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tbody", { className: (0, import_clsx21.default)(tableBody, "dark:divide-slate-700/30"), children: data.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
4297
+ isTableVirtual && topSpacerHeight > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { "aria-hidden": "true", style: { height: topSpacerHeight }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { colSpan: columnCount, style: { padding: 0, border: 0 } }) }),
4298
+ windowData.map((row, windowIndex) => {
4299
+ const absoluteIndex = isTableVirtual ? startIndex + windowIndex : windowIndex;
4300
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4301
+ "tr",
4302
+ {
4303
+ "aria-rowindex": isTableVirtual ? absoluteIndex + 2 : void 0,
4304
+ className: (0, import_clsx21.default)(
4305
+ tableRow,
4306
+ variant === "striped" && absoluteIndex % 2 === 0 && "bg-secondary-50/40 dark:bg-slate-800/20",
4307
+ onRowClick && !isLoading && tableRowClickable
4308
+ ),
4309
+ tabIndex: onRowClick && !isLoading ? 0 : void 0,
4310
+ onClick: onRowClick && !isLoading ? handleRowClick(row) : void 0,
4311
+ onKeyDown: onRowClick && !isLoading ? handleRowKeyDown(row) : void 0,
4312
+ children: columns.map((col) => {
4313
+ const rawValue = getNestedValue2(row, col.key);
4314
+ const truncateTitle = col.truncate && (typeof rawValue === "string" || typeof rawValue === "number") ? String(rawValue) : void 0;
4315
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4316
+ "td",
4317
+ {
4318
+ className: (0, import_clsx21.default)(
4319
+ tableCell(col.className, density),
4320
+ col.align && tableAlignClasses[col.align]
4321
+ ),
4322
+ style: col.minWidth != null ? { minWidth: `${col.minWidth}px` } : void 0,
4323
+ title: truncateTitle,
4324
+ children: col.type === "actions" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: tableActionsCell, children: renderCellContent(col, row) }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: (0, import_clsx21.default)(tableCellText, col.truncate && "truncate"), children: renderCellContent(col, row) })
4325
+ },
4326
+ `${absoluteIndex}-${col.key}`
4327
+ );
4328
+ })
4329
+ },
4330
+ absoluteIndex
4331
+ );
4332
+ }),
4333
+ isTableVirtual && bottomSpacerHeight > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { "aria-hidden": "true", style: { height: bottomSpacerHeight }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { colSpan: columnCount, style: { padding: 0, border: 0 } }) })
4334
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { colSpan: columns.length, className: "px-6 py-12 text-center", children: !isLoading && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: tableEmptyContent, children: [
4335
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
4336
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
4337
+ ] }) }) }) })
4338
+ ]
4339
+ }
4340
+ );
4341
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { ref: rootRef, className: (0, import_clsx21.default)("space-y-4 w-full relative", containerClassName), children: [
4085
4342
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: tableContainer, style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
4086
4343
  title && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "px-6 py-5 flex items-center justify-between", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
4087
4344
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ITText, { as: "h2", className: "text-xl font-bold text-secondary-900 leading-tight", children: title }),
4088
4345
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-3", children: [
4089
4346
  isLoading && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "text-secondary-400", children: loadingIndicator || /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_fa11.FaSpinner, { className: "animate-spin text-primary-500 text-xl" }) }),
4090
4347
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center bg-slate-100 dark:bg-slate-800/80 rounded-lg p-0.5 border border-slate-200 dark:border-slate-700/50", children: [
4091
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("button", { onClick: () => setViewMode("table"), className: segCtrlClass("table"), children: [
4348
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("button", { onClick: () => setViewMode("table"), disabled: forcedCards, className: segCtrlClass("table"), children: [
4092
4349
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_fa11.FaTable, { size: 11 }),
4093
4350
  "Table"
4094
4351
  ] }),
@@ -4100,7 +4357,7 @@ function ITDataTable({
4100
4357
  ] })
4101
4358
  ] }),
4102
4359
  !title && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex justify-end px-4 pt-3", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center bg-slate-100 dark:bg-slate-800/80 rounded-lg p-0.5 border border-slate-200 dark:border-slate-700/50", children: [
4103
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("button", { onClick: () => setViewMode("table"), className: segCtrlClass("table"), children: [
4360
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("button", { onClick: () => setViewMode("table"), disabled: forcedCards, className: segCtrlClass("table"), children: [
4104
4361
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_fa11.FaTable, { size: 11 }),
4105
4362
  "Table"
4106
4363
  ] }),
@@ -4109,50 +4366,34 @@ function ITDataTable({
4109
4366
  "Cards"
4110
4367
  ] })
4111
4368
  ] }) }),
4112
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "overflow-x-auto relative min-h-[200px]", children: [
4369
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: scrollOuterClass, children: [
4113
4370
  isLoading && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "absolute inset-0 z-20 flex items-center justify-center bg-white/40 backdrop-blur-[2px] transition-all duration-300", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex flex-col items-center gap-3 p-6 rounded-2xl shadow-xl border border-secondary-100 animate-in fade-in zoom-in duration-300", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: loadingIndicator || /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
4114
4371
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_fa11.FaSpinner, { className: "animate-spin text-primary-500 text-4xl" }),
4115
4372
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ITText, { as: "span", className: "text-sm font-semibold text-secondary-600 animate-pulse", children: "Cargando datos..." })
4116
4373
  ] }) }) }),
4117
- viewMode === "cards" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "p-4 space-y-3 max-h-[400px] overflow-y-auto", children: data.length > 0 ? data.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { children: renderCard ? renderCard(row) : renderDefaultCard(row) }, i)) : !isLoading && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: (0, import_clsx21.default)(tableEmptyContent, "py-12"), children: [
4374
+ effectiveView === "cards" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "p-4 space-y-3 max-h-[400px] overflow-y-auto", children: data.length > 0 ? data.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4375
+ "div",
4376
+ {
4377
+ className: (0, import_clsx21.default)(tableCardHover, onRowClick && !isLoading && tableCardClickable),
4378
+ role: onRowClick && !isLoading ? "button" : void 0,
4379
+ tabIndex: onRowClick && !isLoading ? 0 : void 0,
4380
+ onClick: onRowClick && !isLoading ? handleRowClick(row) : void 0,
4381
+ onKeyDown: onRowClick && !isLoading ? handleRowKeyDown(row) : void 0,
4382
+ children: renderCard ? renderCard(row) : renderDefaultCard(row)
4383
+ },
4384
+ i
4385
+ )) : !isLoading && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: (0, import_clsx21.default)(tableEmptyContent, "py-12"), children: [
4118
4386
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
4119
4387
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
4120
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
4121
- "table",
4388
+ ] }) }) : isTableVirtual ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4389
+ "div",
4122
4390
  {
4123
- className: (0, import_clsx21.default)(
4124
- "min-w-max w-full text-sm text-left text-secondary-600 transition-opacity duration-300",
4125
- showVerticalBorder && "[&_th]:border-r [&_th:last-child]:border-r-0 [&_td]:border-r [&_td:last-child]:border-r-0",
4126
- showVerticalBorder && (verticalBorderClassname || "[&_th]:border-slate-100 dark:[&_th]:border-slate-700/30 [&_td]:border-slate-100 dark:[&_td]:border-slate-700/30"),
4127
- isLoading ? "opacity-50" : "opacity-100",
4128
- variantStyles[variant],
4129
- sizeStyles[size],
4130
- className
4131
- ),
4132
- children: [
4133
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { className: (0, import_clsx21.default)(tableHeaderRow, "dark:text-slate-200"), children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("th", { scope: "col", className: tableHeaderCell(col.className), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex flex-col gap-3 min-w-[150px]", children: [
4134
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
4135
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ITText, { as: "span", className: "text-slate-900 dark:text-white font-bold", children: col.label }),
4136
- col.sortable && col.type !== "actions" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4137
- "button",
4138
- {
4139
- onClick: () => handleSort(col.key),
4140
- disabled: isLoading,
4141
- className: `p-1 rounded-md transition-colors ${sortConfig?.key === col.key ? "bg-secondary-200 text-secondary-900" : "hover:bg-secondary-200 text-secondary-400 hover:text-secondary-700"} disabled:opacity-50`,
4142
- title: `Ordenar por ${col.label}`,
4143
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_md.MdOutlineSwapVert, { className: "w-4 h-4", "aria-hidden": "true" })
4144
- }
4145
- )
4146
- ] }),
4147
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "w-full", children: col.filter ? renderFilterInput(col) : null })
4148
- ] }) }, col.key)) }) }),
4149
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tbody", { className: (0, import_clsx21.default)(tableBody, "dark:divide-slate-700/30"), children: data.length > 0 ? data.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { className: (0, import_clsx21.default)(tableRow, variant === "striped" && "odd:bg-secondary-50/40 dark:odd:bg-slate-800/20"), children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: tableCell(col.className), children: col.type === "actions" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: tableActionsCell, children: renderCellContent(col, row) }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: tableCellText, children: renderCellContent(col, row) }) }, `${rowIndex}-${col.key}`)) }, rowIndex)) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { colSpan: columns.length, className: "px-6 py-12 text-center", children: !isLoading && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: tableEmptyContent, children: [
4150
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
4151
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
4152
- ] }) }) }) })
4153
- ]
4391
+ ref: scrollRef,
4392
+ className: "overflow-x-auto overflow-y-auto",
4393
+ style: { maxHeight: virtualizedMaxHeight },
4394
+ children: tableEl
4154
4395
  }
4155
- )
4396
+ ) : tableEl
4156
4397
  ] })
4157
4398
  ] }),
4158
4399
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "rounded-b-xl px-6 py-4", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
@@ -4173,7 +4414,7 @@ function ITDataTable({
4173
4414
 
4174
4415
  // src/components/molecules/date-picker/datePicker.tsx
4175
4416
  var import_clsx22 = __toESM(require("clsx"), 1);
4176
- var import_react18 = __toESM(require("react"), 1);
4417
+ var import_react20 = __toESM(require("react"), 1);
4177
4418
  var import_react_dom3 = require("react-dom");
4178
4419
  var import_fa12 = require("react-icons/fa");
4179
4420
  var import_date_fns2 = require("date-fns");
@@ -4197,16 +4438,16 @@ function ITDatePicker({
4197
4438
  maxDate,
4198
4439
  range = false
4199
4440
  }) {
4200
- const [isOpen, setIsOpen] = (0, import_react18.useState)(false);
4201
- const [inputValue, setInputValue] = (0, import_react18.useState)("");
4202
- const [isValidDate, setIsValidDate] = (0, import_react18.useState)(true);
4203
- const [internalRange, setInternalRange] = (0, import_react18.useState)([null, null]);
4204
- const wrapperRef = (0, import_react18.useRef)(null);
4441
+ const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
4442
+ const [inputValue, setInputValue] = (0, import_react20.useState)("");
4443
+ const [isValidDate, setIsValidDate] = (0, import_react20.useState)(true);
4444
+ const [internalRange, setInternalRange] = (0, import_react20.useState)([null, null]);
4445
+ const wrapperRef = (0, import_react20.useRef)(null);
4205
4446
  const { panelRef, style: panelStyle } = useFloatingPanel(wrapperRef, isOpen, {
4206
4447
  estimatedHeight: 360,
4207
4448
  matchWidth: false
4208
4449
  });
4209
- const dateRange = import_react18.default.useMemo(() => {
4450
+ const dateRange = import_react20.default.useMemo(() => {
4210
4451
  if (range) {
4211
4452
  if (Array.isArray(value)) return value;
4212
4453
  return internalRange;
@@ -4214,7 +4455,7 @@ function ITDatePicker({
4214
4455
  return [value instanceof Date ? value : null, null];
4215
4456
  }, [value, range, internalRange]);
4216
4457
  const [startDate, endDate] = dateRange;
4217
- (0, import_react18.useEffect)(() => {
4458
+ (0, import_react20.useEffect)(() => {
4218
4459
  if (range) {
4219
4460
  if (startDate && endDate) {
4220
4461
  setInputValue(`${formatDate(startDate)} - ${formatDate(endDate)}`);
@@ -4231,7 +4472,7 @@ function ITDatePicker({
4231
4472
  }
4232
4473
  }
4233
4474
  }, [startDate, endDate, range]);
4234
- (0, import_react18.useEffect)(() => {
4475
+ (0, import_react20.useEffect)(() => {
4235
4476
  const handleClickOutside = (event) => {
4236
4477
  const target = event.target;
4237
4478
  const inWrapper = wrapperRef.current?.contains(target);
@@ -4426,24 +4667,24 @@ function ITDatePicker({
4426
4667
 
4427
4668
  // src/components/organisms/dialog/dialog.tsx
4428
4669
  var import_react_dom4 = require("react-dom");
4429
- var import_react20 = require("react");
4670
+ var import_react22 = require("react");
4430
4671
  var import_fa14 = require("react-icons/fa");
4431
4672
 
4432
4673
  // src/components/molecules/form-header/form-header.tsx
4433
4674
  var import_fa13 = require("react-icons/fa");
4434
4675
 
4435
4676
  // src/theme/theme-context.ts
4436
- var import_react19 = require("react");
4437
- var ITThemeContext = (0, import_react19.createContext)(void 0);
4677
+ var import_react21 = require("react");
4678
+ var ITThemeContext = (0, import_react21.createContext)(void 0);
4438
4679
  var useITTheme = () => {
4439
- const context = (0, import_react19.useContext)(ITThemeContext);
4680
+ const context = (0, import_react21.useContext)(ITThemeContext);
4440
4681
  if (!context) {
4441
4682
  throw new Error("useITTheme must be used within an ITThemeProvider");
4442
4683
  }
4443
4684
  return context;
4444
4685
  };
4445
4686
  var useITThemeSafe = () => {
4446
- return (0, import_react19.useContext)(ITThemeContext);
4687
+ return (0, import_react21.useContext)(ITThemeContext);
4447
4688
  };
4448
4689
 
4449
4690
  // src/utils/color.utils.ts
@@ -4563,9 +4804,9 @@ function ITDialog({
4563
4804
  useFormHeader = false,
4564
4805
  fullScreen = false
4565
4806
  }) {
4566
- const modalRef = (0, import_react20.useRef)(null);
4807
+ const modalRef = (0, import_react22.useRef)(null);
4567
4808
  useClickOutside_default(modalRef, onClose);
4568
- (0, import_react20.useEffect)(() => {
4809
+ (0, import_react22.useEffect)(() => {
4569
4810
  const handleEscape = (event) => {
4570
4811
  if (event.key === "Escape") {
4571
4812
  onClose();
@@ -4646,7 +4887,7 @@ function ITDivider({
4646
4887
  // src/components/organisms/drawer/drawer.tsx
4647
4888
  var import_clsx24 = __toESM(require("clsx"), 1);
4648
4889
  var import_fa15 = require("react-icons/fa");
4649
- var import_react21 = require("react");
4890
+ var import_react23 = require("react");
4650
4891
  var import_jsx_runtime26 = require("react/jsx-runtime");
4651
4892
  function ITDrawer({
4652
4893
  isOpen,
@@ -4658,7 +4899,7 @@ function ITDrawer({
4658
4899
  className,
4659
4900
  style
4660
4901
  }) {
4661
- const panelRef = (0, import_react21.useRef)(null);
4902
+ const panelRef = (0, import_react23.useRef)(null);
4662
4903
  useClickOutside_default(panelRef, onClose);
4663
4904
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "fixed inset-0 z-[50] flex", children: [
4664
4905
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "absolute inset-0 bg-black/40 backdrop-blur-sm transition-opacity" }),
@@ -4781,36 +5022,36 @@ function ITFlex({
4781
5022
  }
4782
5023
 
4783
5024
  // src/components/organisms/form-builder/formBuilder.tsx
4784
- var import_react27 = require("react");
5025
+ var import_react29 = require("react");
4785
5026
 
4786
5027
  // src/components/organisms/form-builder/formBuilder.context.tsx
4787
- var import_react22 = __toESM(require("react"), 1);
5028
+ var import_react24 = __toESM(require("react"), 1);
4788
5029
  var import_jsx_runtime29 = require("react/jsx-runtime");
4789
- var ITFormBuilderContext = (0, import_react22.createContext)(void 0);
5030
+ var ITFormBuilderContext = (0, import_react24.createContext)(void 0);
4790
5031
  var ITFormBuilderProvider = ({
4791
5032
  children,
4792
5033
  value
4793
5034
  }) => {
4794
- const [fieldRegistry, setFieldRegistry] = (0, import_react22.useState)({});
4795
- const registerField = import_react22.default.useCallback((name, config2) => {
5035
+ const [fieldRegistry, setFieldRegistry] = (0, import_react24.useState)({});
5036
+ const registerField = import_react24.default.useCallback((name, config2) => {
4796
5037
  setFieldRegistry((prev) => ({ ...prev, [name]: config2 }));
4797
5038
  }, []);
4798
- const unregisterField = import_react22.default.useCallback((name) => {
5039
+ const unregisterField = import_react24.default.useCallback((name) => {
4799
5040
  setFieldRegistry((prev) => {
4800
5041
  const next = { ...prev };
4801
5042
  delete next[name];
4802
5043
  return next;
4803
5044
  });
4804
5045
  }, []);
4805
- const getFieldConfig = import_react22.default.useCallback(
5046
+ const getFieldConfig = import_react24.default.useCallback(
4806
5047
  (name) => fieldRegistry[name],
4807
5048
  [fieldRegistry]
4808
5049
  );
4809
- const getAllFieldConfigs = import_react22.default.useCallback(
5050
+ const getAllFieldConfigs = import_react24.default.useCallback(
4810
5051
  () => Object.values(fieldRegistry),
4811
5052
  [fieldRegistry]
4812
5053
  );
4813
- const contextValue = import_react22.default.useMemo(
5054
+ const contextValue = import_react24.default.useMemo(
4814
5055
  () => ({
4815
5056
  ...value,
4816
5057
  registerField,
@@ -4823,7 +5064,7 @@ var ITFormBuilderProvider = ({
4823
5064
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ITFormBuilderContext.Provider, { value: contextValue, children });
4824
5065
  };
4825
5066
  var useITFormBuilderContext = () => {
4826
- const context = (0, import_react22.useContext)(ITFormBuilderContext);
5067
+ const context = (0, import_react24.useContext)(ITFormBuilderContext);
4827
5068
  if (!context) {
4828
5069
  throw new Error("useITFormBuilderContext must be used within an ITFormBuilderProvider");
4829
5070
  }
@@ -4831,12 +5072,12 @@ var useITFormBuilderContext = () => {
4831
5072
  };
4832
5073
 
4833
5074
  // src/components/organisms/form-builder/fieldRenderer.tsx
4834
- var import_react26 = require("react");
5075
+ var import_react28 = require("react");
4835
5076
  var import_clsx29 = __toESM(require("clsx"), 1);
4836
5077
 
4837
5078
  // src/components/molecules/time-picker/timePicker.tsx
4838
5079
  var import_clsx27 = __toESM(require("clsx"), 1);
4839
- var import_react23 = require("react");
5080
+ var import_react25 = require("react");
4840
5081
  var import_react_dom5 = require("react-dom");
4841
5082
  var import_fa17 = require("react-icons/fa");
4842
5083
  var import_jsx_runtime30 = require("react/jsx-runtime");
@@ -4856,12 +5097,12 @@ function ITTimePicker({
4856
5097
  variant = "primary",
4857
5098
  color = "primary"
4858
5099
  }) {
4859
- const [isOpen, setIsOpen] = (0, import_react23.useState)(false);
4860
- const [inputValue, setInputValue] = (0, import_react23.useState)(value || "");
4861
- const [isValidTime, setIsValidTime] = (0, import_react23.useState)(true);
4862
- const wrapperRef = (0, import_react23.useRef)(null);
4863
- const hoursRef = (0, import_react23.useRef)(null);
4864
- const minutesRef = (0, import_react23.useRef)(null);
5100
+ const [isOpen, setIsOpen] = (0, import_react25.useState)(false);
5101
+ const [inputValue, setInputValue] = (0, import_react25.useState)(value || "");
5102
+ const [isValidTime, setIsValidTime] = (0, import_react25.useState)(true);
5103
+ const wrapperRef = (0, import_react25.useRef)(null);
5104
+ const hoursRef = (0, import_react25.useRef)(null);
5105
+ const minutesRef = (0, import_react25.useRef)(null);
4865
5106
  const { panelRef: dropdownRef, style: panelStyle } = useFloatingPanel(
4866
5107
  wrapperRef,
4867
5108
  isOpen && !disabled,
@@ -4875,7 +5116,7 @@ function ITTimePicker({
4875
5116
  const isThemeColor = color in theme.colors;
4876
5117
  const highlightColor = isThemeColor ? theme.colors[color][50] : "#f3f4f6";
4877
5118
  const activeColor = isThemeColor ? theme.colors[color][100] : "#e5e7eb";
4878
- (0, import_react23.useEffect)(() => {
5119
+ (0, import_react25.useEffect)(() => {
4879
5120
  setInputValue(value || "");
4880
5121
  }, [value]);
4881
5122
  const validateTime = (timeString) => {
@@ -4884,7 +5125,7 @@ function ITTimePicker({
4884
5125
  };
4885
5126
  const currentHour = validateTime(inputValue) ? inputValue.split(":")[0] : null;
4886
5127
  const currentMinute = validateTime(inputValue) ? inputValue.split(":")[1] : null;
4887
- (0, import_react23.useEffect)(() => {
5128
+ (0, import_react25.useEffect)(() => {
4888
5129
  if (isOpen) {
4889
5130
  setTimeout(() => {
4890
5131
  if (hoursRef.current && currentHour) {
@@ -5090,7 +5331,7 @@ function ITTimePicker({
5090
5331
  }
5091
5332
 
5092
5333
  // src/components/molecules/search-select/search-select.tsx
5093
- var import_react24 = require("react");
5334
+ var import_react26 = require("react");
5094
5335
  var import_react_dom6 = require("react-dom");
5095
5336
  var import_clsx28 = __toESM(require("clsx"), 1);
5096
5337
  var import_fa18 = require("react-icons/fa");
@@ -5119,26 +5360,26 @@ function ITSearchSelect({
5119
5360
  clearable = true,
5120
5361
  onClear
5121
5362
  }) {
5122
- const [isOpen, setIsOpen] = (0, import_react24.useState)(false);
5123
- const [searchTerm, setSearchTerm] = (0, import_react24.useState)("");
5124
- const [isFocused, setIsFocused] = (0, import_react24.useState)(false);
5125
- const [localTouched, setLocalTouched] = (0, import_react24.useState)(false);
5126
- const containerRef = (0, import_react24.useRef)(null);
5127
- const inputWrapperRef = (0, import_react24.useRef)(null);
5128
- const timeoutRef = (0, import_react24.useRef)(null);
5363
+ const [isOpen, setIsOpen] = (0, import_react26.useState)(false);
5364
+ const [searchTerm, setSearchTerm] = (0, import_react26.useState)("");
5365
+ const [isFocused, setIsFocused] = (0, import_react26.useState)(false);
5366
+ const [localTouched, setLocalTouched] = (0, import_react26.useState)(false);
5367
+ const containerRef = (0, import_react26.useRef)(null);
5368
+ const inputWrapperRef = (0, import_react26.useRef)(null);
5369
+ const timeoutRef = (0, import_react26.useRef)(null);
5129
5370
  const { panelRef, style: panelStyle } = useFloatingPanel(inputWrapperRef, isOpen, {
5130
5371
  estimatedHeight: 260,
5131
5372
  matchWidth: true
5132
5373
  });
5133
- const selectedOption = (0, import_react24.useMemo)(() => {
5374
+ const selectedOption = (0, import_react26.useMemo)(() => {
5134
5375
  return options.find((opt) => opt[valueField] === value);
5135
5376
  }, [options, value, valueField]);
5136
- (0, import_react24.useEffect)(() => {
5377
+ (0, import_react26.useEffect)(() => {
5137
5378
  if (!isFocused) {
5138
5379
  setSearchTerm(selectedOption ? String(selectedOption[labelField]) : "");
5139
5380
  }
5140
5381
  }, [selectedOption, isFocused, labelField]);
5141
- (0, import_react24.useEffect)(() => {
5382
+ (0, import_react26.useEffect)(() => {
5142
5383
  function handleClickOutside(event) {
5143
5384
  const target = event.target;
5144
5385
  const inContainer = containerRef.current?.contains(target);
@@ -5151,7 +5392,7 @@ function ITSearchSelect({
5151
5392
  return () => document.removeEventListener("mousedown", handleClickOutside);
5152
5393
  }, []);
5153
5394
  const selectedLabel = selectedOption ? String(selectedOption[labelField]) : "";
5154
- const filteredOptions = (0, import_react24.useMemo)(() => {
5395
+ const filteredOptions = (0, import_react26.useMemo)(() => {
5155
5396
  if (onSearch) return options;
5156
5397
  if (!searchTerm || !isFocused || searchTerm === selectedLabel) return options;
5157
5398
  return options.filter(
@@ -5320,26 +5561,26 @@ function ITSearchSelect({
5320
5561
  }
5321
5562
 
5322
5563
  // src/components/organisms/form-builder/useFormBuilder.ts
5323
- var import_react25 = require("react");
5564
+ var import_react27 = require("react");
5324
5565
  var useFieldRules = (config2, dependentValues) => {
5325
5566
  const { getFieldConfig } = useITFormBuilderContext();
5326
5567
  const fieldConfig = getFieldConfig(config2.name) || config2;
5327
- const isVisible = (0, import_react25.useMemo)(() => {
5568
+ const isVisible = (0, import_react27.useMemo)(() => {
5328
5569
  if (!fieldConfig.renderWhen) return true;
5329
5570
  return fieldConfig.renderWhen(dependentValues);
5330
5571
  }, [fieldConfig, dependentValues]);
5331
- const dynamicProps = (0, import_react25.useMemo)(() => {
5572
+ const dynamicProps = (0, import_react27.useMemo)(() => {
5332
5573
  if (!fieldConfig.dynamicProps) return {};
5333
5574
  return fieldConfig.dynamicProps(dependentValues);
5334
5575
  }, [fieldConfig, dependentValues]);
5335
- const isRequired = (0, import_react25.useMemo)(() => {
5576
+ const isRequired = (0, import_react27.useMemo)(() => {
5336
5577
  if (typeof dynamicProps.required !== "undefined") return dynamicProps.required;
5337
5578
  if (typeof fieldConfig.required === "function") {
5338
5579
  return fieldConfig.required(dependentValues);
5339
5580
  }
5340
5581
  return !!fieldConfig.required;
5341
5582
  }, [fieldConfig, dynamicProps.required, dependentValues]);
5342
- const isDisabled = (0, import_react25.useMemo)(() => {
5583
+ const isDisabled = (0, import_react27.useMemo)(() => {
5343
5584
  if (typeof dynamicProps.disabled !== "undefined") return dynamicProps.disabled;
5344
5585
  if (typeof fieldConfig.disabled === "function") {
5345
5586
  return fieldConfig.disabled(dependentValues);
@@ -5353,11 +5594,11 @@ var useFieldRules = (config2, dependentValues) => {
5353
5594
  var import_fa19 = require("react-icons/fa");
5354
5595
  var import_jsx_runtime32 = require("react/jsx-runtime");
5355
5596
  function useAsyncOptions(options, deps) {
5356
- const [resolved, setResolved] = (0, import_react26.useState)([]);
5357
- const [loading, setLoading] = (0, import_react26.useState)(false);
5358
- const optionsRef = (0, import_react26.useRef)(options);
5597
+ const [resolved, setResolved] = (0, import_react28.useState)([]);
5598
+ const [loading, setLoading] = (0, import_react28.useState)(false);
5599
+ const optionsRef = (0, import_react28.useRef)(options);
5359
5600
  optionsRef.current = options;
5360
- (0, import_react26.useEffect)(() => {
5601
+ (0, import_react28.useEffect)(() => {
5361
5602
  const opts = optionsRef.current;
5362
5603
  let cancelled = false;
5363
5604
  if (typeof opts === "function") {
@@ -5400,13 +5641,13 @@ var ITFieldRenderer = ({
5400
5641
  config2,
5401
5642
  dependentValues
5402
5643
  );
5403
- (0, import_react26.useEffect)(() => {
5644
+ (0, import_react28.useEffect)(() => {
5404
5645
  context.registerField(config2.name, config2);
5405
5646
  return () => {
5406
5647
  context.unregisterField(config2.name);
5407
5648
  };
5408
5649
  }, [config2.name]);
5409
- const activeConfig = (0, import_react26.useMemo)(
5650
+ const activeConfig = (0, import_react28.useMemo)(
5410
5651
  () => ({
5411
5652
  ...config2,
5412
5653
  ...dynamicProps,
@@ -5432,7 +5673,7 @@ var ITFieldRenderer = ({
5432
5673
  options,
5433
5674
  [options, dependentValues]
5434
5675
  );
5435
- const handleChangeWrapper = (0, import_react26.useCallback)(
5676
+ const handleChangeWrapper = (0, import_react28.useCallback)(
5436
5677
  async (val) => {
5437
5678
  const finalValue = val && typeof val === "object" && "target" in val ? val.target.value : val;
5438
5679
  await context.setFieldValue(name, finalValue);
@@ -5646,7 +5887,7 @@ var ITFieldRenderer = ({
5646
5887
  }
5647
5888
  );
5648
5889
  };
5649
- var fieldRenderer_default = (0, import_react26.memo)(ITFieldRenderer);
5890
+ var fieldRenderer_default = (0, import_react28.memo)(ITFieldRenderer);
5650
5891
 
5651
5892
  // src/components/organisms/form-builder/formBuilder.tsx
5652
5893
  var import_jsx_runtime33 = require("react/jsx-runtime");
@@ -5677,7 +5918,7 @@ function ITFormBuilder({
5677
5918
  isSubmitting = false,
5678
5919
  children
5679
5920
  }) {
5680
- const providerValue = (0, import_react27.useMemo)(
5921
+ const providerValue = (0, import_react29.useMemo)(
5681
5922
  () => ({
5682
5923
  config: config2 || [],
5683
5924
  values: values || {},
@@ -5894,7 +6135,7 @@ function ITGrid({
5894
6135
  }
5895
6136
 
5896
6137
  // src/components/atoms/image/image.tsx
5897
- var import_react28 = require("react");
6138
+ var import_react30 = require("react");
5898
6139
  var import_jsx_runtime35 = require("react/jsx-runtime");
5899
6140
  var ITImage = ({
5900
6141
  src,
@@ -5902,7 +6143,7 @@ var ITImage = ({
5902
6143
  className = "",
5903
6144
  fallback = ""
5904
6145
  }) => {
5905
- const [imageError, setImageError] = (0, import_react28.useState)(false);
6146
+ const [imageError, setImageError] = (0, import_react30.useState)(false);
5906
6147
  const handleImageError = () => {
5907
6148
  setImageError(true);
5908
6149
  };
@@ -5932,7 +6173,7 @@ var ITImage = ({
5932
6173
  var image_default = ITImage;
5933
6174
 
5934
6175
  // src/components/organisms/navbar/navbar.tsx
5935
- var import_react29 = require("react");
6176
+ var import_react31 = require("react");
5936
6177
  var import_fa20 = require("react-icons/fa");
5937
6178
  var import_jsx_runtime36 = require("react/jsx-runtime");
5938
6179
  function ITNavbar({
@@ -5947,9 +6188,9 @@ function ITNavbar({
5947
6188
  showSidebarOnMobile = false,
5948
6189
  sidebarItems
5949
6190
  }) {
5950
- const [isUserMenuOpen, setIsUserMenuOpen] = (0, import_react29.useState)(false);
5951
- const [expandedItems, setExpandedItems] = (0, import_react29.useState)(/* @__PURE__ */ new Set());
5952
- const userMenuRef = (0, import_react29.useRef)(null);
6191
+ const [isUserMenuOpen, setIsUserMenuOpen] = (0, import_react31.useState)(false);
6192
+ const [expandedItems, setExpandedItems] = (0, import_react31.useState)(/* @__PURE__ */ new Set());
6193
+ const userMenuRef = (0, import_react31.useRef)(null);
5953
6194
  useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
5954
6195
  const toggleUserMenu = () => {
5955
6196
  setIsUserMenuOpen(!isUserMenuOpen);
@@ -6290,7 +6531,7 @@ function ITSkeleton({
6290
6531
 
6291
6532
  // src/components/atoms/stack/stack.tsx
6292
6533
  var import_clsx32 = __toESM(require("clsx"), 1);
6293
- var import_react30 = require("react");
6534
+ var import_react32 = require("react");
6294
6535
  var import_jsx_runtime39 = require("react/jsx-runtime");
6295
6536
  var directionMap2 = {
6296
6537
  row: "flex-row",
@@ -6331,7 +6572,7 @@ function ITStack({
6331
6572
  as: Component = "div"
6332
6573
  }) {
6333
6574
  const hasDivider = divider !== void 0;
6334
- const items = import_react30.Children.toArray(children);
6575
+ const items = import_react32.Children.toArray(children);
6335
6576
  const resolvedStyle = {
6336
6577
  gap: spacing > 0 ? `${spacing * 0.25}rem` : void 0,
6337
6578
  ...style
@@ -6348,9 +6589,9 @@ function ITStack({
6348
6589
  className
6349
6590
  ),
6350
6591
  style: resolvedStyle,
6351
- children: hasDivider ? items.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_react30.Fragment, { children: [
6592
+ children: hasDivider ? items.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_react32.Fragment, { children: [
6352
6593
  child,
6353
- index < items.length - 1 && (0, import_react30.isValidElement)(divider) ? (0, import_react30.cloneElement)(divider, { key: `divider-${index}` }) : null
6594
+ index < items.length - 1 && (0, import_react32.isValidElement)(divider) ? (0, import_react32.cloneElement)(divider, { key: `divider-${index}` }) : null
6354
6595
  ] }, index)) : children
6355
6596
  }
6356
6597
  );
@@ -6388,11 +6629,13 @@ function ITPage(props) {
6388
6629
  className,
6389
6630
  children,
6390
6631
  maxWidth = "7xl",
6391
- noPadding = false
6632
+ noPadding = false,
6633
+ horizontalPadding = "px-4 sm:px-6 lg:px-8"
6392
6634
  } = props;
6393
6635
  const wrapperClass = (0, import_clsx33.default)(
6394
6636
  "mx-auto w-full",
6395
- !noPadding && "px-4 sm:px-6 lg:px-8 py-6",
6637
+ !noPadding && horizontalPadding,
6638
+ !noPadding && "py-6",
6396
6639
  `max-w-${maxWidth}`,
6397
6640
  "space-y-8",
6398
6641
  className
@@ -6447,7 +6690,7 @@ function ITPage(props) {
6447
6690
  }
6448
6691
 
6449
6692
  // src/components/atoms/popover/popover.tsx
6450
- var import_react31 = require("react");
6693
+ var import_react33 = require("react");
6451
6694
  var import_clsx34 = __toESM(require("clsx"), 1);
6452
6695
  var import_jsx_runtime41 = require("react/jsx-runtime");
6453
6696
  var positionClasses = {
@@ -6464,10 +6707,10 @@ function ITPopover({
6464
6707
  onClose,
6465
6708
  className
6466
6709
  }) {
6467
- const [internalOpen, setInternalOpen] = (0, import_react31.useState)(false);
6710
+ const [internalOpen, setInternalOpen] = (0, import_react33.useState)(false);
6468
6711
  const isControlled = controlledOpen !== void 0;
6469
6712
  const open = isControlled ? controlledOpen : internalOpen;
6470
- const ref = (0, import_react31.useRef)(null);
6713
+ const ref = (0, import_react33.useRef)(null);
6471
6714
  useClickOutside_default(ref, () => {
6472
6715
  if (isControlled) onClose?.();
6473
6716
  else setInternalOpen(false);
@@ -6595,7 +6838,7 @@ function ITRadioGroup({
6595
6838
 
6596
6839
  // src/components/organisms/searchTable/searchTable.tsx
6597
6840
  var import_clsx38 = __toESM(require("clsx"), 1);
6598
- var import_react32 = require("react");
6841
+ var import_react34 = require("react");
6599
6842
 
6600
6843
  // src/components/organisms/searchTable/components/SearchInput.tsx
6601
6844
  var import_fa22 = require("react-icons/fa");
@@ -7088,7 +7331,7 @@ function ITSearchTable({
7088
7331
  onSave,
7089
7332
  onCancel
7090
7333
  }) {
7091
- const [itemsPerPage, setItemsPerPage] = (0, import_react32.useState)(defaultItemsPerPage);
7334
+ const [itemsPerPage, setItemsPerPage] = (0, import_react34.useState)(defaultItemsPerPage);
7092
7335
  const { searchTerm, handleSearchChange, handleClearSearch } = useDebouncedSearch({
7093
7336
  initialValue: searchTermInitial,
7094
7337
  onSearch: (value) => {
@@ -7251,7 +7494,7 @@ function ITSegmentedControl({
7251
7494
  }
7252
7495
 
7253
7496
  // src/components/organisms/sidebar/sidebar.tsx
7254
- var import_react33 = require("react");
7497
+ var import_react35 = require("react");
7255
7498
  var import_fa26 = require("react-icons/fa");
7256
7499
  var import_jsx_runtime56 = require("react/jsx-runtime");
7257
7500
  function ITSidebar({
@@ -7261,14 +7504,15 @@ function ITSidebar({
7261
7504
  visibleOnMobile = false,
7262
7505
  onItemClick,
7263
7506
  onSubItemClick,
7264
- subitemConnector = "dot"
7507
+ subitemConnector = "dot",
7508
+ header
7265
7509
  }) {
7266
- const [expandedItems, setExpandedItems] = (0, import_react33.useState)(/* @__PURE__ */ new Set());
7267
- const [isHovering, setIsHovering] = (0, import_react33.useState)(false);
7268
- const sidebarRef = (0, import_react33.useRef)(null);
7269
- const hoverTimeoutRef = (0, import_react33.useRef)(null);
7270
- const leaveTimeoutRef = (0, import_react33.useRef)(null);
7271
- (0, import_react33.useEffect)(() => {
7510
+ const [expandedItems, setExpandedItems] = (0, import_react35.useState)(/* @__PURE__ */ new Set());
7511
+ const [isHovering, setIsHovering] = (0, import_react35.useState)(false);
7512
+ const sidebarRef = (0, import_react35.useRef)(null);
7513
+ const hoverTimeoutRef = (0, import_react35.useRef)(null);
7514
+ const leaveTimeoutRef = (0, import_react35.useRef)(null);
7515
+ (0, import_react35.useEffect)(() => {
7272
7516
  const hoverTimer = hoverTimeoutRef.current;
7273
7517
  const leaveTimer = leaveTimeoutRef.current;
7274
7518
  const handleMouseEnter = () => {
@@ -7295,7 +7539,7 @@ function ITSidebar({
7295
7539
  if (leaveTimer) clearTimeout(leaveTimer);
7296
7540
  };
7297
7541
  }, [isCollapsed]);
7298
- (0, import_react33.useEffect)(() => {
7542
+ (0, import_react35.useEffect)(() => {
7299
7543
  const activeParents = /* @__PURE__ */ new Set();
7300
7544
  navigationItems.forEach((item) => {
7301
7545
  if (item.subitems && item.subitems.some((sub) => sub.isActive)) {
@@ -7332,7 +7576,7 @@ function ITSidebar({
7332
7576
  };
7333
7577
  const isSidebarCollapsed = visibleOnMobile ? false : !isHovering && isCollapsed;
7334
7578
  const sidebarWidth = isSidebarCollapsed ? "w-[88px]" : "w-[280px]";
7335
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7579
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
7336
7580
  "aside",
7337
7581
  {
7338
7582
  ref: sidebarRef,
@@ -7351,196 +7595,215 @@ function ITSidebar({
7351
7595
  WebkitBackdropFilter: "blur(12px)",
7352
7596
  backdropFilter: "blur(12px)"
7353
7597
  },
7354
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("nav", { className: "flex-1 py-4 overflow-y-auto overflow-x-hidden custom-scrollbar px-4", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("ul", { className: "space-y-1", children: navigationItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("li", { className: "relative group/navitem", children: [
7355
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
7356
- "div",
7357
- {
7358
- className: `flex items-center cursor-pointer
7598
+ children: [
7599
+ header && !isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "px-4 pt-4 pb-1 flex-shrink-0", children: header }),
7600
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("nav", { "aria-label": "Componentes de la librer\xEDa", className: "flex-1 py-4 overflow-y-auto overflow-x-hidden custom-scrollbar px-4", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("ul", { className: "space-y-1", children: navigationItems.map((item) => {
7601
+ const hasSubmenu = !!item.subitems && item.subitems.length > 0;
7602
+ const submenuId = `it-sidebar-submenu-${item.id}`;
7603
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("li", { className: "relative group/navitem", children: [
7604
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
7605
+ "div",
7606
+ {
7607
+ role: "button",
7608
+ tabIndex: 0,
7609
+ "aria-label": item.label,
7610
+ "aria-expanded": hasSubmenu ? expandedItems.has(item.id) : void 0,
7611
+ "aria-controls": hasSubmenu ? submenuId : void 0,
7612
+ className: `flex items-center cursor-pointer
7359
7613
  transition-all duration-300 ease-[cubic-bezier(0.2,0,0,1)]
7360
7614
  rounded-xl relative overflow-visible
7361
7615
  ${isSidebarCollapsed ? "justify-center p-2 mb-1" : "justify-between px-3 py-2 mb-0.5"}
7362
7616
  `,
7363
- style: {
7364
- backgroundColor: item.isActive ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
7365
- boxShadow: item.isActive ? "var(--shadow-xs)" : "none",
7366
- border: item.isActive ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "1px solid transparent"
7367
- },
7368
- onMouseEnter: (e) => {
7369
- if (!item.isActive) e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
7370
- },
7371
- onMouseLeave: (e) => {
7372
- if (!item.isActive) e.currentTarget.style.backgroundColor = "transparent";
7373
- },
7374
- onClick: () => handleItemClick(item),
7375
- children: [
7376
- item.isActive && !isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7377
- "div",
7378
- {
7379
- className: "absolute left-0 top-1/4 bottom-1/4 w-[3px] rounded-r-full transition-all",
7380
- style: { backgroundColor: "var(--it-sidebar-active-icon, var(--color-primary-500))", boxShadow: "0 0 10px var(--it-sidebar-active-icon, var(--color-primary-500))" }
7381
- }
7382
- ),
7383
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: `flex items-center ${!isSidebarCollapsed ? "gap-2.5" : "justify-center"} relative z-10 w-full`, children: [
7384
- item.icon && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7385
- "div",
7386
- {
7387
- className: `transition-all duration-300 flex-shrink-0 flex items-center justify-center`,
7388
- style: {
7389
- color: item.isActive ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, #9ca3af)",
7390
- opacity: item.isActive ? 1 : 0.8,
7391
- fontSize: item.isActive ? "1.12rem" : "1.05rem",
7392
- filter: item.isActive ? "drop-shadow(0 0 8px rgba(255,255,255,0.2))" : "none"
7393
- },
7394
- children: item.icon
7395
- }
7396
- ),
7397
- !isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7398
- ITText,
7399
- {
7400
- as: "span",
7401
- className: `transition-all duration-300 truncate tracking-wide`,
7402
- style: {
7403
- color: item.isActive ? "var(--it-sidebar-active-color, #ffffff)" : "var(--it-sidebar-label-color, var(--color-secondary-300))",
7404
- fontSize: "0.8rem",
7405
- fontWeight: item.isActive ? "600" : "500"
7406
- },
7407
- children: item.label
7408
- }
7409
- )
7410
- ] }),
7411
- !isSidebarCollapsed && item.subitems && item.subitems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7412
- "div",
7413
- {
7414
- className: `flex-shrink-0 transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)] ${expandedItems.has(item.id) ? "rotate-180" : ""}`,
7415
- style: { color: item.isActive ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-icon-color, var(--color-secondary-500))", opacity: 0.7 },
7416
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_fa26.FaChevronDown, { className: "w-3 h-3" })
7417
- }
7418
- ),
7419
- item.badge && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7420
- "span",
7421
- {
7422
- className: `
7423
- absolute flex items-center justify-center font-bold shadow-md
7424
- ${isSidebarCollapsed ? "top-1 right-1 w-2.5 h-2.5 rounded-full ring-2 ring-white" : "right-3 top-1/2 transform -translate-y-1/2 px-1.5 py-0 text-[9px] rounded-full backdrop-blur-sm"}
7425
- `,
7426
- style: {
7427
- backgroundColor: "var(--it-sidebar-badge-bg, var(--color-primary-500))",
7428
- color: "var(--it-sidebar-badge-color, #ffffff)",
7429
- boxShadow: isSidebarCollapsed ? "0 0 0 2px var(--it-sidebar-bg, var(--color-secondary-900))" : "none"
7430
- },
7431
- children: isSidebarCollapsed ? "" : item.badge
7432
- }
7433
- )
7434
- ]
7435
- }
7436
- ),
7437
- isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
7438
- "div",
7439
- {
7440
- className: "absolute left-full top-0 ml-4 rounded-2xl opacity-0 invisible group-hover/navitem:opacity-100 group-hover/navitem:visible transition-all duration-300 pointer-events-none z-[70] min-w-[220px] overflow-hidden -translate-x-2 group-hover/navitem:translate-x-0 shadow-[0_10px_40px_-10px_rgba(0,0,0,0.15)]",
7441
- style: {
7442
- backgroundColor: "var(--it-sidebar-bg, #ffffff)",
7443
- border: "1px solid var(--it-sidebar-border, var(--color-secondary-200))",
7444
- WebkitBackdropFilter: "blur(16px)",
7445
- backdropFilter: "blur(16px)"
7446
- },
7447
- children: [
7448
- /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "px-5 py-4 flex items-center gap-3 font-semibold border-b", style: { borderColor: "var(--it-sidebar-border, var(--color-secondary-200))", color: "var(--it-sidebar-active-color, var(--color-secondary-900))" }, children: [
7449
- item.icon && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { style: { color: "var(--it-sidebar-active-icon, var(--color-primary-500))" }, className: "text-xl drop-shadow-sm", children: item.icon }),
7450
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ITText, { as: "span", className: "tracking-wide text-[15px]", children: item.label })
7451
- ] }),
7452
- item.subitems && item.subitems.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "py-2", children: item.subitems.map((subitem) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
7453
- "div",
7454
- {
7455
- className: `px-5 py-2.5 text-sm flex items-center gap-3 transition-colors relative`,
7456
- children: [
7457
- subitem.isActive && subitemConnector === "|" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7458
- "div",
7459
- {
7460
- className: "absolute left-0 top-1/3 bottom-1/3 w-[2.5px] rounded-r-full",
7461
- style: {
7462
- backgroundColor: "var(--it-sidebar-active-icon, var(--color-primary-500))",
7463
- boxShadow: "0 0 6px color-mix(in srgb, var(--it-sidebar-active-icon, var(--color-primary-500)) 25%, transparent)"
7464
- }
7465
- }
7466
- ),
7467
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: `w-1.5 h-1.5 rounded-full transition-all ${subitem.isActive ? "scale-125" : ""}`, style: { backgroundColor: subitem.isActive ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, var(--color-secondary-400))" } }),
7468
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ITText, { as: "span", style: { color: subitem.isActive ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-label-color, var(--color-secondary-600))", fontWeight: subitem.isActive ? 600 : 500 }, children: subitem.label })
7469
- ]
7470
- },
7471
- subitem.id
7472
- )) }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ITText, { as: "div", className: "px-5 py-3 text-sm italic", style: { color: "var(--it-sidebar-label-color, var(--color-secondary-400))" }, children: "No hay submen\xFA" })
7473
- ]
7474
- }
7475
- ),
7476
- !isSidebarCollapsed && item.subitems && item.subitems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: `overflow-hidden transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] ${expandedItems.has(item.id) ? "max-h-[500px] opacity-100 mt-1" : "max-h-0 opacity-0"}`, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7477
- "ul",
7478
- {
7479
- className: "ml-4 flex flex-col gap-0 py-0.5",
7480
- style: {
7481
- borderLeft: subitemConnector === "|" ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "none"
7482
- },
7483
- children: item.subitems.map((subitem) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("li", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
7484
- "button",
7485
- {
7486
- onClick: () => {
7487
- if (subitem.action) subitem.action();
7488
- if (onSubItemClick) onSubItemClick(subitem);
7489
- },
7490
- className: `flex items-center gap-2 w-full text-left px-3 py-1.5 rounded-xl transition-all duration-300`,
7491
7617
  style: {
7492
- color: subitem.isActive ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-label-color, var(--color-secondary-600))",
7493
- backgroundColor: subitem.isActive ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
7494
- fontSize: "0.78rem",
7495
- fontWeight: subitem.isActive ? 600 : 500,
7496
- letterSpacing: "0.01em",
7497
- marginLeft: subitemConnector === "|" ? "-1px" : "0"
7618
+ backgroundColor: item.isActive ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
7619
+ boxShadow: item.isActive ? "var(--shadow-xs)" : "none",
7620
+ border: item.isActive ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "1px solid transparent"
7498
7621
  },
7499
7622
  onMouseEnter: (e) => {
7500
- if (!subitem.isActive) {
7501
- e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
7502
- e.currentTarget.style.transform = "translateX(3px)";
7503
- }
7623
+ if (!item.isActive) e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
7504
7624
  },
7505
7625
  onMouseLeave: (e) => {
7506
- if (!subitem.isActive) {
7507
- e.currentTarget.style.backgroundColor = "transparent";
7508
- e.currentTarget.style.transform = "translateX(0)";
7626
+ if (!item.isActive) e.currentTarget.style.backgroundColor = "transparent";
7627
+ },
7628
+ onClick: () => handleItemClick(item),
7629
+ onKeyDown: (e) => {
7630
+ if (e.key === "Enter" || e.key === " ") {
7631
+ e.preventDefault();
7632
+ handleItemClick(item);
7509
7633
  }
7510
7634
  },
7511
7635
  children: [
7512
- subitem.isActive && subitemConnector === "|" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7636
+ item.isActive && !isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7513
7637
  "div",
7514
7638
  {
7515
- className: "absolute left-0 top-1/3 bottom-1/3 w-[2.5px] rounded-r-full transition-all",
7516
- style: {
7517
- backgroundColor: "var(--it-sidebar-active-icon, var(--color-primary-500))",
7518
- boxShadow: "0 0 6px color-mix(in srgb, var(--it-sidebar-active-icon, var(--color-primary-500)) 25%, transparent)"
7639
+ className: "absolute left-0 top-1/4 bottom-1/4 w-[3px] rounded-r-full transition-all",
7640
+ style: { backgroundColor: "var(--it-sidebar-active-icon, var(--color-primary-500))", boxShadow: "0 0 10px var(--it-sidebar-active-icon, var(--color-primary-500))" }
7641
+ }
7642
+ ),
7643
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: `flex items-center ${!isSidebarCollapsed ? "gap-2.5" : "justify-center"} relative z-10 w-full`, children: [
7644
+ item.icon && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7645
+ "div",
7646
+ {
7647
+ className: `transition-all duration-300 flex-shrink-0 flex items-center justify-center`,
7648
+ style: {
7649
+ color: item.isActive ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, #9ca3af)",
7650
+ opacity: item.isActive ? 1 : 0.8,
7651
+ fontSize: item.isActive ? "1.12rem" : "1.05rem",
7652
+ filter: item.isActive ? "drop-shadow(0 0 8px rgba(255,255,255,0.2))" : "none"
7653
+ },
7654
+ children: item.icon
7519
7655
  }
7656
+ ),
7657
+ !isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7658
+ ITText,
7659
+ {
7660
+ as: "span",
7661
+ className: `transition-all duration-300 truncate tracking-wide`,
7662
+ style: {
7663
+ color: item.isActive ? "var(--it-sidebar-active-color, #ffffff)" : "var(--it-sidebar-label-color, var(--color-secondary-300))",
7664
+ fontSize: "0.8rem",
7665
+ fontWeight: item.isActive ? "600" : "500"
7666
+ },
7667
+ children: item.label
7668
+ }
7669
+ )
7670
+ ] }),
7671
+ !isSidebarCollapsed && item.subitems && item.subitems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7672
+ "div",
7673
+ {
7674
+ className: `flex-shrink-0 transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)] ${expandedItems.has(item.id) ? "rotate-180" : ""}`,
7675
+ style: { color: item.isActive ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-icon-color, var(--color-secondary-500))", opacity: 0.7 },
7676
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_fa26.FaChevronDown, { className: "w-3 h-3" })
7520
7677
  }
7521
7678
  ),
7522
- subitemConnector === "dot" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7679
+ item.badge && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7523
7680
  "span",
7524
7681
  {
7525
- className: `w-1.5 h-1.5 rounded-full flex-shrink-0 transition-all duration-300 ${subitem.isActive ? "scale-125" : ""}`,
7682
+ className: `
7683
+ absolute flex items-center justify-center font-bold shadow-md
7684
+ ${isSidebarCollapsed ? "top-1 right-1 w-2.5 h-2.5 rounded-full ring-2 ring-white" : "right-3 top-1/2 transform -translate-y-1/2 px-1.5 py-0 text-[9px] rounded-full backdrop-blur-sm"}
7685
+ `,
7526
7686
  style: {
7527
- backgroundColor: subitem.isActive ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, var(--color-secondary-400))"
7528
- }
7687
+ backgroundColor: "var(--it-sidebar-badge-bg, var(--color-primary-500))",
7688
+ color: "var(--it-sidebar-badge-color, #ffffff)",
7689
+ boxShadow: isSidebarCollapsed ? "0 0 0 2px var(--it-sidebar-bg, var(--color-secondary-900))" : "none"
7690
+ },
7691
+ children: isSidebarCollapsed ? "" : item.badge
7529
7692
  }
7530
- ),
7531
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ITText, { as: "span", className: "truncate", children: subitem.label })
7693
+ )
7532
7694
  ]
7533
7695
  }
7534
- ) }, subitem.id))
7535
- }
7536
- ) })
7537
- ] }, item.id)) }) })
7696
+ ),
7697
+ isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
7698
+ "div",
7699
+ {
7700
+ className: "absolute left-full top-0 ml-4 rounded-2xl opacity-0 invisible group-hover/navitem:opacity-100 group-hover/navitem:visible transition-all duration-300 pointer-events-none z-[70] min-w-[220px] overflow-hidden -translate-x-2 group-hover/navitem:translate-x-0 shadow-[0_10px_40px_-10px_rgba(0,0,0,0.15)]",
7701
+ style: {
7702
+ backgroundColor: "var(--it-sidebar-bg, #ffffff)",
7703
+ border: "1px solid var(--it-sidebar-border, var(--color-secondary-200))",
7704
+ WebkitBackdropFilter: "blur(16px)",
7705
+ backdropFilter: "blur(16px)"
7706
+ },
7707
+ children: [
7708
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "px-5 py-4 flex items-center gap-3 font-semibold border-b", style: { borderColor: "var(--it-sidebar-border, var(--color-secondary-200))", color: "var(--it-sidebar-active-color, var(--color-secondary-900))" }, children: [
7709
+ item.icon && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { style: { color: "var(--it-sidebar-active-icon, var(--color-primary-500))" }, className: "text-xl drop-shadow-sm", children: item.icon }),
7710
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ITText, { as: "span", className: "tracking-wide text-[15px]", children: item.label })
7711
+ ] }),
7712
+ item.subitems && item.subitems.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "py-2", children: item.subitems.map((subitem) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
7713
+ "div",
7714
+ {
7715
+ className: `px-5 py-2.5 text-sm flex items-center gap-3 transition-colors relative`,
7716
+ children: [
7717
+ subitem.isActive && subitemConnector === "|" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7718
+ "div",
7719
+ {
7720
+ className: "absolute left-0 top-1/3 bottom-1/3 w-[2.5px] rounded-r-full",
7721
+ style: {
7722
+ backgroundColor: "var(--it-sidebar-active-icon, var(--color-primary-500))",
7723
+ boxShadow: "0 0 6px color-mix(in srgb, var(--it-sidebar-active-icon, var(--color-primary-500)) 25%, transparent)"
7724
+ }
7725
+ }
7726
+ ),
7727
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: `w-1.5 h-1.5 rounded-full transition-all ${subitem.isActive ? "scale-125" : ""}`, style: { backgroundColor: subitem.isActive ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, var(--color-secondary-400))" } }),
7728
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ITText, { as: "span", style: { color: subitem.isActive ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-label-color, var(--color-secondary-600))", fontWeight: subitem.isActive ? 600 : 500 }, children: subitem.label })
7729
+ ]
7730
+ },
7731
+ subitem.id
7732
+ )) }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ITText, { as: "div", className: "px-5 py-3 text-sm italic", style: { color: "var(--it-sidebar-label-color, var(--color-secondary-400))" }, children: "No hay submen\xFA" })
7733
+ ]
7734
+ }
7735
+ ),
7736
+ !isSidebarCollapsed && item.subitems && item.subitems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { id: submenuId, role: "group", "aria-label": item.label, className: `overflow-hidden transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] ${expandedItems.has(item.id) ? "max-h-[500px] opacity-100 mt-1" : "max-h-0 opacity-0"}`, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7737
+ "ul",
7738
+ {
7739
+ className: "ml-4 flex flex-col gap-0 py-0.5",
7740
+ style: {
7741
+ borderLeft: subitemConnector === "|" ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "none"
7742
+ },
7743
+ children: item.subitems.map((subitem) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("li", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
7744
+ "button",
7745
+ {
7746
+ "aria-current": subitem.isActive ? "page" : void 0,
7747
+ onClick: () => {
7748
+ if (subitem.action) subitem.action();
7749
+ if (onSubItemClick) onSubItemClick(subitem);
7750
+ },
7751
+ className: `flex items-center gap-2 w-full text-left px-3 py-1.5 rounded-xl transition-all duration-300`,
7752
+ style: {
7753
+ color: subitem.isActive ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-label-color, var(--color-secondary-600))",
7754
+ backgroundColor: subitem.isActive ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
7755
+ fontSize: "0.78rem",
7756
+ fontWeight: subitem.isActive ? 600 : 500,
7757
+ letterSpacing: "0.01em",
7758
+ marginLeft: subitemConnector === "|" ? "-1px" : "0"
7759
+ },
7760
+ onMouseEnter: (e) => {
7761
+ if (!subitem.isActive) {
7762
+ e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
7763
+ e.currentTarget.style.transform = "translateX(3px)";
7764
+ }
7765
+ },
7766
+ onMouseLeave: (e) => {
7767
+ if (!subitem.isActive) {
7768
+ e.currentTarget.style.backgroundColor = "transparent";
7769
+ e.currentTarget.style.transform = "translateX(0)";
7770
+ }
7771
+ },
7772
+ children: [
7773
+ subitem.isActive && subitemConnector === "|" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7774
+ "div",
7775
+ {
7776
+ className: "absolute left-0 top-1/3 bottom-1/3 w-[2.5px] rounded-r-full transition-all",
7777
+ style: {
7778
+ backgroundColor: "var(--it-sidebar-active-icon, var(--color-primary-500))",
7779
+ boxShadow: "0 0 6px color-mix(in srgb, var(--it-sidebar-active-icon, var(--color-primary-500)) 25%, transparent)"
7780
+ }
7781
+ }
7782
+ ),
7783
+ subitemConnector === "dot" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7784
+ "span",
7785
+ {
7786
+ className: `w-1.5 h-1.5 rounded-full flex-shrink-0 transition-all duration-300 ${subitem.isActive ? "scale-125" : ""}`,
7787
+ style: {
7788
+ backgroundColor: subitem.isActive ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, var(--color-secondary-400))"
7789
+ }
7790
+ }
7791
+ ),
7792
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ITText, { as: "span", className: "truncate", children: subitem.label })
7793
+ ]
7794
+ }
7795
+ ) }, subitem.id))
7796
+ }
7797
+ ) })
7798
+ ] }, item.id);
7799
+ }) }) })
7800
+ ]
7538
7801
  }
7539
7802
  );
7540
7803
  }
7541
7804
 
7542
7805
  // src/components/atoms/slide/slide.tsx
7543
- var import_react34 = require("react");
7806
+ var import_react36 = require("react");
7544
7807
  var import_clsx40 = __toESM(require("clsx"), 1);
7545
7808
  var import_jsx_runtime57 = require("react/jsx-runtime");
7546
7809
  function ITSlideToggle({
@@ -7555,8 +7818,8 @@ function ITSlideToggle({
7555
7818
  className = ""
7556
7819
  }) {
7557
7820
  const isControlled = controlledIsOn !== void 0;
7558
- const [internalIsOn, setInternalIsOn] = (0, import_react34.useState)(initialState);
7559
- (0, import_react34.useEffect)(() => {
7821
+ const [internalIsOn, setInternalIsOn] = (0, import_react36.useState)(initialState);
7822
+ (0, import_react36.useEffect)(() => {
7560
7823
  if (isControlled) {
7561
7824
  setInternalIsOn(controlledIsOn);
7562
7825
  }
@@ -7720,7 +7983,7 @@ function ITStatCard({
7720
7983
 
7721
7984
  // src/components/molecules/table/table.tsx
7722
7985
  var import_clsx43 = __toESM(require("clsx"), 1);
7723
- var import_react35 = __toESM(require("react"), 1);
7986
+ var import_react37 = __toESM(require("react"), 1);
7724
7987
  var import_fa27 = require("react-icons/fa");
7725
7988
  var import_md2 = require("react-icons/md");
7726
7989
  var import_jsx_runtime60 = require("react/jsx-runtime");
@@ -7736,9 +7999,24 @@ function ITTable({
7736
7999
  renderCard,
7737
8000
  defaultView = "table",
7738
8001
  showVerticalBorder = true,
7739
- verticalBorderClassname
8002
+ verticalBorderClassname,
8003
+ onRowClick,
8004
+ layout = "auto",
8005
+ density = "normal",
8006
+ autoCardBreakpoint = 0,
8007
+ virtualized = false,
8008
+ virtualizedMaxHeight = 400,
8009
+ rowHeight,
8010
+ overscan = 5,
8011
+ stickyHeader = false
7740
8012
  }) {
7741
- const [viewMode, setViewMode] = (0, import_react35.useState)(defaultView);
8013
+ const [viewMode, setViewMode] = (0, import_react37.useState)(defaultView);
8014
+ const { ref: rootRef, width: containerWidth } = useElementSize();
8015
+ const isFixed = layout === "fixed";
8016
+ const forcedCards = autoCardBreakpoint > 0 && containerWidth > 0 && containerWidth < autoCardBreakpoint;
8017
+ const effectiveView = forcedCards ? "cards" : viewMode;
8018
+ const hasColumnWidths = columns.some((col) => col.width != null);
8019
+ const tableLayoutClass = isFixed ? "w-full text-sm text-left text-secondary-600" : "min-w-max w-full text-sm text-left text-secondary-600";
7742
8020
  const {
7743
8021
  currentPage,
7744
8022
  itemsPerPage,
@@ -7749,7 +8027,7 @@ function ITTable({
7749
8027
  handleSort,
7750
8028
  handleItemsPerPageChange
7751
8029
  } = useTableState({ defaultItemsPerPage });
7752
- const sortedData = import_react35.default.useMemo(() => {
8030
+ const sortedData = import_react37.default.useMemo(() => {
7753
8031
  const safeData = Array.isArray(data) ? data : [];
7754
8032
  if (!sortConfig) return safeData;
7755
8033
  return [...safeData].sort((a, b) => {
@@ -7818,6 +8096,24 @@ function ITTable({
7818
8096
  (currentPage - 1) * itemsPerPage,
7819
8097
  currentPage * itemsPerPage
7820
8098
  );
8099
+ const isTableVirtual = virtualized && effectiveView === "table";
8100
+ const isStickyHeader = stickyHeader && isTableVirtual;
8101
+ const resolvedRowHeight = rowHeight ?? getRowHeight(size, density);
8102
+ const columnCount = columns.length;
8103
+ const {
8104
+ scrollRef,
8105
+ startIndex,
8106
+ endIndex,
8107
+ topSpacerHeight,
8108
+ bottomSpacerHeight
8109
+ } = useVirtualRows({
8110
+ count: currentData.length,
8111
+ rowHeight: resolvedRowHeight,
8112
+ overscan,
8113
+ enabled: isTableVirtual,
8114
+ resetKey: `${currentPage}-${itemsPerPage}`
8115
+ });
8116
+ const windowData = isTableVirtual ? currentData.slice(startIndex, endIndex + 1) : currentData;
7821
8117
  const renderFilterInput = (col) => {
7822
8118
  if (!col.filter) return null;
7823
8119
  if (col.type === "boolean") {
@@ -7949,7 +8245,18 @@ function ITTable({
7949
8245
  actionCol?.actions && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex items-center justify-end gap-2 pt-2 border-t border-slate-100 dark:border-slate-700", children: actionCol.actions(row) })
7950
8246
  ] });
7951
8247
  };
7952
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: (0, import_clsx43.default)("space-y-4 w-full", containerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: tableContainer, style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
8248
+ const handleRowClick = (row) => (event) => {
8249
+ if (!onRowClick || isInteractiveTarget(event.target, event.currentTarget)) return;
8250
+ onRowClick(row, event);
8251
+ };
8252
+ const handleRowKeyDown = (row) => (event) => {
8253
+ if (!onRowClick) return;
8254
+ if (event.target !== event.currentTarget) return;
8255
+ if (event.key !== "Enter" && event.key !== " ") return;
8256
+ event.preventDefault();
8257
+ onRowClick(row, event);
8258
+ };
8259
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { ref: rootRef, className: (0, import_clsx43.default)("space-y-4 w-full", containerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: tableContainer, style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
7953
8260
  title && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "px-6 py-5 flex items-center justify-between", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
7954
8261
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ITText, { as: "h2", className: "text-xl font-bold text-secondary-900 leading-tight", children: title }),
7955
8262
  /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex items-center bg-slate-100 dark:bg-slate-800/80 rounded-lg p-0.5 border border-slate-200 dark:border-slate-700/50", children: [
@@ -7957,7 +8264,8 @@ function ITTable({
7957
8264
  "button",
7958
8265
  {
7959
8266
  onClick: () => setViewMode("table"),
7960
- 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"}`,
8267
+ disabled: forcedCards,
8268
+ className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${effectiveView === "table" ? "bg-white dark:bg-slate-900 text-slate-900 dark:text-white shadow-sm border border-slate-200/50 dark:border-slate-700" : "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"}`,
7961
8269
  children: [
7962
8270
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_fa27.FaTable, { size: 11 }),
7963
8271
  "Table"
@@ -7968,7 +8276,7 @@ function ITTable({
7968
8276
  "button",
7969
8277
  {
7970
8278
  onClick: () => setViewMode("cards"),
7971
- 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"}`,
8279
+ className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${effectiveView === "cards" ? "bg-white dark:bg-slate-900 text-slate-900 dark:text-white shadow-sm border border-slate-200/50 dark:border-slate-700" : "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"}`,
7972
8280
  children: [
7973
8281
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_fa27.FaThLarge, { size: 11 }),
7974
8282
  "Cards"
@@ -7982,7 +8290,8 @@ function ITTable({
7982
8290
  "button",
7983
8291
  {
7984
8292
  onClick: () => setViewMode("table"),
7985
- 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"}`,
8293
+ disabled: forcedCards,
8294
+ className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${effectiveView === "table" ? "bg-white dark:bg-slate-900 text-slate-900 dark:text-white shadow-sm border border-slate-200/50 dark:border-slate-700" : "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"}`,
7986
8295
  children: [
7987
8296
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_fa27.FaTable, { size: 11 }),
7988
8297
  "Table"
@@ -7993,7 +8302,7 @@ function ITTable({
7993
8302
  "button",
7994
8303
  {
7995
8304
  onClick: () => setViewMode("cards"),
7996
- 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"}`,
8305
+ className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${effectiveView === "cards" ? "bg-white dark:bg-slate-900 text-slate-900 dark:text-white shadow-sm border border-slate-200/50 dark:border-slate-700" : "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"}`,
7997
8306
  children: [
7998
8307
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_fa27.FaThLarge, { size: 11 }),
7999
8308
  "Cards"
@@ -8001,64 +8310,131 @@ function ITTable({
8001
8310
  }
8002
8311
  )
8003
8312
  ] }) }),
8004
- viewMode === "cards" ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "p-4 space-y-3 max-h-[400px] overflow-y-auto", children: currentData.length > 0 ? currentData.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { children: renderCard ? renderCard(row) : renderDefaultCard(row) }, i)) : /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: (0, import_clsx43.default)(tableEmptyContent, "py-12"), children: [
8313
+ effectiveView === "cards" ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "p-4 space-y-3 max-h-[400px] overflow-y-auto", children: currentData.length > 0 ? currentData.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8314
+ "div",
8315
+ {
8316
+ className: (0, import_clsx43.default)(tableCardHover, onRowClick && tableCardClickable),
8317
+ role: onRowClick ? "button" : void 0,
8318
+ tabIndex: onRowClick ? 0 : void 0,
8319
+ onClick: onRowClick ? handleRowClick(row) : void 0,
8320
+ onKeyDown: onRowClick ? handleRowKeyDown(row) : void 0,
8321
+ children: renderCard ? renderCard(row) : renderDefaultCard(row)
8322
+ },
8323
+ i
8324
+ )) : /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: (0, import_clsx43.default)(tableEmptyContent, "py-12"), children: [
8005
8325
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
8006
8326
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
8007
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
8008
- "table",
8327
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8328
+ "div",
8009
8329
  {
8010
- className: (0, import_clsx43.default)(
8011
- "min-w-max w-full text-sm text-left text-secondary-600",
8012
- showVerticalBorder && "[&_th]:border-r [&_th:last-child]:border-r-0 [&_td]:border-r [&_td:last-child]:border-r-0",
8013
- showVerticalBorder && (verticalBorderClassname || "[&_th]:border-slate-100 dark:[&_th]:border-slate-700/30 [&_td]:border-slate-100 dark:[&_td]:border-slate-700/30"),
8014
- variantStyles[variant],
8015
- sizeStyles[size]
8016
- ),
8017
- children: [
8018
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tr", { className: (0, import_clsx43.default)(tableHeaderRow, "dark:text-slate-200"), children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8019
- "th",
8020
- {
8021
- scope: "col",
8022
- className: tableHeaderCell(col.className),
8023
- children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex flex-col gap-3 min-w-[150px]", children: [
8024
- /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
8025
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ITText, { as: "span", className: "text-slate-900 dark:text-white font-bold", children: col.label }),
8026
- col.sortable && col.type !== "actions" && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8027
- "button",
8028
- {
8029
- onClick: () => handleSort(col.key),
8030
- className: `p-1 rounded-md transition-colors ${sortConfig?.key === col.key ? "bg-secondary-200 text-secondary-900" : "hover:bg-secondary-200 text-secondary-400 hover:text-secondary-700"}`,
8031
- title: `Ordenar por ${col.label}`,
8032
- children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_md2.MdOutlineSwapVert, { className: "w-4 h-4", "aria-hidden": "true" })
8033
- }
8034
- )
8035
- ] }),
8036
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "w-full", children: col.filter ? renderFilterInput(col) : null })
8037
- ] })
8038
- },
8039
- col.key
8040
- )) }) }),
8041
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tbody", { className: (0, import_clsx43.default)(tableBody, "dark:divide-slate-700/30"), children: currentData.length > 0 ? currentData.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8042
- "tr",
8043
- {
8044
- className: (0, import_clsx43.default)(tableRow, variant === "striped" && "odd:bg-secondary-50/40 dark:odd:bg-slate-800/20"),
8045
- children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8046
- "td",
8330
+ ref: isTableVirtual ? scrollRef : void 0,
8331
+ className: isTableVirtual ? "overflow-x-auto overflow-y-auto" : "overflow-x-auto",
8332
+ style: isTableVirtual ? { maxHeight: virtualizedMaxHeight } : void 0,
8333
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
8334
+ "table",
8335
+ {
8336
+ className: (0, import_clsx43.default)(
8337
+ tableLayoutClass,
8338
+ showVerticalBorder && "[&_th]:border-r [&_th:last-child]:border-r-0 [&_td]:border-r [&_td:last-child]:border-r-0",
8339
+ showVerticalBorder && (verticalBorderClassname || "[&_th]:border-slate-100 dark:[&_th]:border-slate-700/30 [&_td]:border-slate-100 dark:[&_td]:border-slate-700/30"),
8340
+ variantStyles[variant],
8341
+ sizeStyles[size]
8342
+ ),
8343
+ style: isFixed ? { tableLayout: "fixed" } : void 0,
8344
+ "aria-rowcount": isTableVirtual ? currentData.length + 1 : void 0,
8345
+ children: [
8346
+ hasColumnWidths && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("colgroup", { children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8347
+ "col",
8047
8348
  {
8048
- className: tableCell(col.className),
8049
- children: col.type === "actions" ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: tableActionsCell, children: renderCellContent(col, row) }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: tableCellText, children: renderCellContent(col, row) })
8349
+ style: col.width != null ? { width: typeof col.width === "number" ? `${col.width}px` : col.width } : void 0
8050
8350
  },
8051
- `${rowIndex}-${col.key}`
8052
- ))
8053
- },
8054
- rowIndex
8055
- )) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("td", { colSpan: columns.length, className: "px-6 py-12 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: tableEmptyContent, children: [
8056
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
8057
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
8058
- ] }) }) }) })
8059
- ]
8351
+ col.key
8352
+ )) }),
8353
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8354
+ "tr",
8355
+ {
8356
+ className: (0, import_clsx43.default)(tableHeaderRow, "dark:text-slate-200"),
8357
+ "aria-rowindex": isTableVirtual ? 1 : void 0,
8358
+ children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8359
+ "th",
8360
+ {
8361
+ scope: "col",
8362
+ className: (0, import_clsx43.default)(
8363
+ tableHeaderCell(col.className, density),
8364
+ col.align && tableAlignClasses[col.align],
8365
+ isStickyHeader && "sticky top-0 z-10 bg-secondary-50"
8366
+ ),
8367
+ style: col.minWidth != null || isStickyHeader ? {
8368
+ ...col.minWidth != null ? { minWidth: `${col.minWidth}px` } : {},
8369
+ ...isStickyHeader ? { backgroundColor: "var(--color-table-headerBg, #f8fafc)" } : {}
8370
+ } : void 0,
8371
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: isFixed ? "flex flex-col gap-3" : "flex flex-col gap-3 min-w-[150px]", children: [
8372
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
8373
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ITText, { as: "span", className: "text-slate-900 dark:text-white font-bold", children: col.label }),
8374
+ col.sortable && col.type !== "actions" && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8375
+ "button",
8376
+ {
8377
+ onClick: () => handleSort(col.key),
8378
+ className: `p-1 rounded-md transition-colors ${sortConfig?.key === col.key ? "bg-secondary-200 text-secondary-900" : "hover:bg-secondary-200 text-secondary-400 hover:text-secondary-700"}`,
8379
+ title: `Ordenar por ${col.label}`,
8380
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_md2.MdOutlineSwapVert, { className: "w-4 h-4", "aria-hidden": "true" })
8381
+ }
8382
+ )
8383
+ ] }),
8384
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "w-full", children: col.filter ? renderFilterInput(col) : null })
8385
+ ] })
8386
+ },
8387
+ col.key
8388
+ ))
8389
+ }
8390
+ ) }),
8391
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tbody", { className: (0, import_clsx43.default)(tableBody, "dark:divide-slate-700/30"), children: currentData.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
8392
+ isTableVirtual && topSpacerHeight > 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tr", { "aria-hidden": "true", style: { height: topSpacerHeight }, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("td", { colSpan: columnCount, style: { padding: 0, border: 0 } }) }),
8393
+ windowData.map((row, windowIndex) => {
8394
+ const absoluteIndex = isTableVirtual ? startIndex + windowIndex : windowIndex;
8395
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8396
+ "tr",
8397
+ {
8398
+ "aria-rowindex": isTableVirtual ? absoluteIndex + 2 : void 0,
8399
+ className: (0, import_clsx43.default)(
8400
+ tableRow,
8401
+ variant === "striped" && absoluteIndex % 2 === 0 && "bg-secondary-50/40 dark:bg-slate-800/20",
8402
+ onRowClick && tableRowClickable
8403
+ ),
8404
+ tabIndex: onRowClick ? 0 : void 0,
8405
+ onClick: onRowClick ? handleRowClick(row) : void 0,
8406
+ onKeyDown: onRowClick ? handleRowKeyDown(row) : void 0,
8407
+ children: columns.map((col) => {
8408
+ const rawValue = getNestedValue(row, col.key);
8409
+ const truncateTitle = col.truncate && (typeof rawValue === "string" || typeof rawValue === "number") ? String(rawValue) : void 0;
8410
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8411
+ "td",
8412
+ {
8413
+ className: (0, import_clsx43.default)(
8414
+ tableCell(col.className, density),
8415
+ col.align && tableAlignClasses[col.align]
8416
+ ),
8417
+ style: col.minWidth != null ? { minWidth: `${col.minWidth}px` } : void 0,
8418
+ title: truncateTitle,
8419
+ children: col.type === "actions" ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: tableActionsCell, children: renderCellContent(col, row) }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: (0, import_clsx43.default)(tableCellText, col.truncate && "truncate"), children: renderCellContent(col, row) })
8420
+ },
8421
+ `${absoluteIndex}-${col.key}`
8422
+ );
8423
+ })
8424
+ },
8425
+ absoluteIndex
8426
+ );
8427
+ }),
8428
+ isTableVirtual && bottomSpacerHeight > 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tr", { "aria-hidden": "true", style: { height: bottomSpacerHeight }, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("td", { colSpan: columnCount, style: { padding: 0, border: 0 } }) })
8429
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("td", { colSpan: columns.length, className: "px-6 py-12 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: tableEmptyContent, children: [
8430
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
8431
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
8432
+ ] }) }) }) })
8433
+ ]
8434
+ }
8435
+ )
8060
8436
  }
8061
- ) }),
8437
+ ),
8062
8438
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "rounded-b-xl px-6 py-4", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8063
8439
  ITPagination,
8064
8440
  {
@@ -8124,7 +8500,7 @@ function ITTextarea({
8124
8500
  }
8125
8501
 
8126
8502
  // src/components/molecules/tabs/tabs.tsx
8127
- var import_react36 = require("react");
8503
+ var import_react38 = require("react");
8128
8504
  var import_clsx45 = require("clsx");
8129
8505
  var import_jsx_runtime62 = require("react/jsx-runtime");
8130
8506
  var ITTabs = ({
@@ -8135,7 +8511,7 @@ var ITTabs = ({
8135
8511
  className = "",
8136
8512
  containerClassName = ""
8137
8513
  }) => {
8138
- const [activeId, setActiveId] = (0, import_react36.useState)(defaultActiveId || items[0]?.id);
8514
+ const [activeId, setActiveId] = (0, import_react38.useState)(defaultActiveId || items[0]?.id);
8139
8515
  const handleTabClick = (id, disabled) => {
8140
8516
  if (disabled) return;
8141
8517
  setActiveId(id);
@@ -8235,7 +8611,7 @@ var positionStyles = {
8235
8611
 
8236
8612
  // src/components/organisms/toast/toast.tsx
8237
8613
  var import_clsx47 = __toESM(require("clsx"), 1);
8238
- var import_react37 = require("react");
8614
+ var import_react39 = require("react");
8239
8615
  var import_fa28 = require("react-icons/fa");
8240
8616
  var import_jsx_runtime64 = require("react/jsx-runtime");
8241
8617
  function ITToast({
@@ -8245,8 +8621,8 @@ function ITToast({
8245
8621
  position = "top-right",
8246
8622
  onClose
8247
8623
  }) {
8248
- const [isVisible, setIsVisible] = (0, import_react37.useState)(true);
8249
- (0, import_react37.useEffect)(() => {
8624
+ const [isVisible, setIsVisible] = (0, import_react39.useState)(true);
8625
+ (0, import_react39.useEffect)(() => {
8250
8626
  const timer = setTimeout(() => {
8251
8627
  setIsVisible(false);
8252
8628
  setTimeout(() => {
@@ -8312,7 +8688,7 @@ function ITToast({
8312
8688
  }
8313
8689
 
8314
8690
  // src/components/molecules/wysiwyg/wysiwyg.tsx
8315
- var import_react39 = require("react");
8691
+ var import_react41 = require("react");
8316
8692
  var import_clsx49 = __toESM(require("clsx"), 1);
8317
8693
  var import_fa29 = require("react-icons/fa");
8318
8694
 
@@ -8328,7 +8704,7 @@ var toolbarActions = [
8328
8704
  ];
8329
8705
 
8330
8706
  // src/components/atoms/tooltip/tooltip.tsx
8331
- var import_react38 = require("react");
8707
+ var import_react40 = require("react");
8332
8708
  var import_clsx48 = __toESM(require("clsx"), 1);
8333
8709
  var import_jsx_runtime65 = require("react/jsx-runtime");
8334
8710
  var positionClasses2 = {
@@ -8350,7 +8726,7 @@ function ITTooltip({
8350
8726
  delay = 200,
8351
8727
  className
8352
8728
  }) {
8353
- const [visible, setVisible] = (0, import_react38.useState)(false);
8729
+ const [visible, setVisible] = (0, import_react40.useState)(false);
8354
8730
  let timeout;
8355
8731
  const handleMouseEnter = () => {
8356
8732
  timeout = setTimeout(() => setVisible(true), delay);
@@ -8403,12 +8779,12 @@ function ITWysiwyg({
8403
8779
  toolbar = toolbarActions,
8404
8780
  className
8405
8781
  }) {
8406
- const editorRef = (0, import_react39.useRef)(null);
8407
- const focusedRef = (0, import_react39.useRef)(false);
8408
- const [active, setActive] = (0, import_react39.useState)({});
8782
+ const editorRef = (0, import_react41.useRef)(null);
8783
+ const focusedRef = (0, import_react41.useRef)(false);
8784
+ const [active, setActive] = (0, import_react41.useState)({});
8409
8785
  const isLocked = disabled || readOnly;
8410
8786
  const sizeConfig = inputSizeTokens[size] ?? inputSizeTokens.md;
8411
- const findAncestor = (0, import_react39.useCallback)(
8787
+ const findAncestor = (0, import_react41.useCallback)(
8412
8788
  (node, predicate) => {
8413
8789
  const editor = editorRef.current;
8414
8790
  if (!editor) return null;
@@ -8421,7 +8797,7 @@ function ITWysiwyg({
8421
8797
  },
8422
8798
  []
8423
8799
  );
8424
- const isInlineTag = (0, import_react39.useCallback)((el, tag) => {
8800
+ const isInlineTag = (0, import_react41.useCallback)((el, tag) => {
8425
8801
  if (tag === "STRONG" || tag === "B") {
8426
8802
  return el.tagName === "STRONG" || el.tagName === "B";
8427
8803
  }
@@ -8430,7 +8806,7 @@ function ITWysiwyg({
8430
8806
  }
8431
8807
  return el.tagName === tag;
8432
8808
  }, []);
8433
- const getTextNodesInRange = (0, import_react39.useCallback)((range) => {
8809
+ const getTextNodesInRange = (0, import_react41.useCallback)((range) => {
8434
8810
  const editor = editorRef.current;
8435
8811
  if (!editor) return [];
8436
8812
  const out = [];
@@ -8441,7 +8817,7 @@ function ITWysiwyg({
8441
8817
  }
8442
8818
  return out;
8443
8819
  }, []);
8444
- const placeCaretAtEnd = (0, import_react39.useCallback)((target) => {
8820
+ const placeCaretAtEnd = (0, import_react41.useCallback)((target) => {
8445
8821
  const editor = editorRef.current;
8446
8822
  const sel = window.getSelection();
8447
8823
  if (!editor || !sel) return;
@@ -8452,11 +8828,11 @@ function ITWysiwyg({
8452
8828
  sel.addRange(range);
8453
8829
  if (document.activeElement !== editor) editor.focus();
8454
8830
  }, []);
8455
- const emitChange = (0, import_react39.useCallback)(() => {
8831
+ const emitChange = (0, import_react41.useCallback)(() => {
8456
8832
  const editor = editorRef.current;
8457
8833
  if (editor) onChange?.(editor.innerHTML);
8458
8834
  }, [onChange]);
8459
- const updateActive = (0, import_react39.useCallback)(() => {
8835
+ const updateActive = (0, import_react41.useCallback)(() => {
8460
8836
  const editor = editorRef.current;
8461
8837
  const sel = window.getSelection();
8462
8838
  const node = sel?.anchorNode ?? null;
@@ -8475,13 +8851,13 @@ function ITWysiwyg({
8475
8851
  (prev) => JSON.stringify(prev) === JSON.stringify(next) ? prev : next
8476
8852
  );
8477
8853
  }, [findAncestor, isInlineTag]);
8478
- const unwrapElement = (0, import_react39.useCallback)((el) => {
8854
+ const unwrapElement = (0, import_react41.useCallback)((el) => {
8479
8855
  const parent = el.parentNode;
8480
8856
  if (!parent) return;
8481
8857
  while (el.firstChild) parent.insertBefore(el.firstChild, el);
8482
8858
  el.remove();
8483
8859
  }, []);
8484
- const applyInline = (0, import_react39.useCallback)(
8860
+ const applyInline = (0, import_react41.useCallback)(
8485
8861
  (tag, prepare) => {
8486
8862
  const editor = editorRef.current;
8487
8863
  const sel = window.getSelection();
@@ -8563,7 +8939,7 @@ function ITWysiwyg({
8563
8939
  updateActive
8564
8940
  ]
8565
8941
  );
8566
- const normalizeBlocks = (0, import_react39.useCallback)(() => {
8942
+ const normalizeBlocks = (0, import_react41.useCallback)(() => {
8567
8943
  const editor = editorRef.current;
8568
8944
  if (!editor) return;
8569
8945
  const children = Array.from(editor.childNodes);
@@ -8585,7 +8961,7 @@ function ITWysiwyg({
8585
8961
  }
8586
8962
  flush();
8587
8963
  }, []);
8588
- const convertLiToDiv = (0, import_react39.useCallback)((li) => {
8964
+ const convertLiToDiv = (0, import_react41.useCallback)((li) => {
8589
8965
  const list = li.parentElement;
8590
8966
  if (!list || !list.parentNode) return;
8591
8967
  const div = document.createElement("div");
@@ -8593,20 +8969,20 @@ function ITWysiwyg({
8593
8969
  list.parentNode.insertBefore(div, list);
8594
8970
  li.remove();
8595
8971
  }, []);
8596
- const cleanupEmptyLists = (0, import_react39.useCallback)(() => {
8972
+ const cleanupEmptyLists = (0, import_react41.useCallback)(() => {
8597
8973
  const editor = editorRef.current;
8598
8974
  if (!editor) return;
8599
8975
  editor.querySelectorAll("ul, ol").forEach((list) => {
8600
8976
  if (!list.querySelector("li")) list.remove();
8601
8977
  });
8602
8978
  }, []);
8603
- const retagList = (0, import_react39.useCallback)((list, type) => {
8979
+ const retagList = (0, import_react41.useCallback)((list, type) => {
8604
8980
  if (!list.parentNode) return;
8605
8981
  const nl = document.createElement(type);
8606
8982
  while (list.firstChild) nl.appendChild(list.firstChild);
8607
8983
  list.parentNode.replaceChild(nl, list);
8608
8984
  }, []);
8609
- const toggleList = (0, import_react39.useCallback)(
8985
+ const toggleList = (0, import_react41.useCallback)(
8610
8986
  (type) => {
8611
8987
  const editor = editorRef.current;
8612
8988
  const sel = window.getSelection();
@@ -8704,7 +9080,7 @@ function ITWysiwyg({
8704
9080
  updateActive
8705
9081
  ]
8706
9082
  );
8707
- const clearFormatting = (0, import_react39.useCallback)(() => {
9083
+ const clearFormatting = (0, import_react41.useCallback)(() => {
8708
9084
  const editor = editorRef.current;
8709
9085
  const sel = window.getSelection();
8710
9086
  if (!editor || !sel || sel.rangeCount === 0) return;
@@ -8738,7 +9114,7 @@ function ITWysiwyg({
8738
9114
  emitChange,
8739
9115
  updateActive
8740
9116
  ]);
8741
- (0, import_react39.useEffect)(() => {
9117
+ (0, import_react41.useEffect)(() => {
8742
9118
  const editor = editorRef.current;
8743
9119
  if (!editor) return;
8744
9120
  if (!focusedRef.current) {
@@ -8746,7 +9122,7 @@ function ITWysiwyg({
8746
9122
  if (editor.innerHTML !== next) editor.innerHTML = next;
8747
9123
  }
8748
9124
  }, [value]);
8749
- (0, import_react39.useEffect)(() => {
9125
+ (0, import_react41.useEffect)(() => {
8750
9126
  const onSelectionChange = () => {
8751
9127
  const editor = editorRef.current;
8752
9128
  const sel = window.getSelection();
@@ -8885,7 +9261,7 @@ function ITWysiwyg({
8885
9261
  }
8886
9262
 
8887
9263
  // src/components/organisms/dropfile/dropfile.tsx
8888
- var import_react40 = require("react");
9264
+ var import_react42 = require("react");
8889
9265
  var import_react_dropzone = require("react-dropzone");
8890
9266
  var import_clsx50 = __toESM(require("clsx"), 1);
8891
9267
 
@@ -8931,15 +9307,15 @@ var ITDropfile = ({
8931
9307
  buttonLabel = "Subir archivo",
8932
9308
  modalTitle
8933
9309
  }) => {
8934
- const [isModalOpen, setIsModalOpen] = (0, import_react40.useState)(false);
8935
- const [selectedFile, setSelectedFile] = (0, import_react40.useState)(null);
8936
- const [fileType, setFileType] = (0, import_react40.useState)(null);
8937
- const [imagePreview, setImagePreview] = (0, import_react40.useState)(initialPreviewUrl || null);
8938
- const [isConfirmed, setIsConfirmed] = (0, import_react40.useState)(false);
8939
- const [internalUploadStatus, setInternalUploadStatus] = (0, import_react40.useState)(
9310
+ const [isModalOpen, setIsModalOpen] = (0, import_react42.useState)(false);
9311
+ const [selectedFile, setSelectedFile] = (0, import_react42.useState)(null);
9312
+ const [fileType, setFileType] = (0, import_react42.useState)(null);
9313
+ const [imagePreview, setImagePreview] = (0, import_react42.useState)(initialPreviewUrl || null);
9314
+ const [isConfirmed, setIsConfirmed] = (0, import_react42.useState)(false);
9315
+ const [internalUploadStatus, setInternalUploadStatus] = (0, import_react42.useState)(
8940
9316
  initialPreviewUrl ? "subido" /* UPLOADED */ : "pendiente" /* PENDING */
8941
9317
  );
8942
- (0, import_react40.useEffect)(() => {
9318
+ (0, import_react42.useEffect)(() => {
8943
9319
  if (initialPreviewUrl && !selectedFile) {
8944
9320
  setImagePreview(initialPreviewUrl);
8945
9321
  if (externalStatus === void 0) setInternalUploadStatus("subido" /* UPLOADED */);
@@ -9088,12 +9464,12 @@ var ITDropfile = ({
9088
9464
  accept: getAcceptedFileTypes(),
9089
9465
  maxFiles: 1
9090
9466
  });
9091
- (0, import_react40.useEffect)(() => {
9467
+ (0, import_react42.useEffect)(() => {
9092
9468
  const renderPDF = async () => {
9093
9469
  };
9094
9470
  renderPDF();
9095
9471
  }, [selectedFile, fileType]);
9096
- (0, import_react40.useEffect)(() => {
9472
+ (0, import_react42.useEffect)(() => {
9097
9473
  return () => {
9098
9474
  if (imagePreview) {
9099
9475
  URL.revokeObjectURL(imagePreview);
@@ -9130,7 +9506,7 @@ var ITDropfile = ({
9130
9506
  const handleDelete = () => {
9131
9507
  handleCancel();
9132
9508
  };
9133
- (0, import_react40.useEffect)(() => {
9509
+ (0, import_react42.useEffect)(() => {
9134
9510
  if (view === "button" && isConfirmed && uploadStatus === "subido" /* UPLOADED */) {
9135
9511
  const timeout = setTimeout(() => {
9136
9512
  setIsModalOpen(false);
@@ -9284,24 +9660,26 @@ var ITDropfile = ({
9284
9660
  var dropfile_default = ITDropfile;
9285
9661
 
9286
9662
  // src/components/templates/layout/layout.tsx
9287
- var import_react42 = require("react");
9663
+ var import_react44 = require("react");
9288
9664
  var import_clsx51 = __toESM(require("clsx"), 1);
9289
9665
 
9290
9666
  // src/components/organisms/topbar/topbar.tsx
9291
9667
  var import_fa30 = require("react-icons/fa");
9292
- var import_react41 = require("react");
9668
+ var import_react43 = require("react");
9293
9669
  var import_jsx_runtime68 = require("react/jsx-runtime");
9294
9670
  function ITTopBar({
9295
9671
  logo,
9296
9672
  logoText,
9673
+ centerContent,
9297
9674
  userMenu,
9675
+ children,
9298
9676
  showMobileMenuButton,
9299
9677
  onToggleMobileMenu,
9300
9678
  navItems,
9301
9679
  onNavItemClick
9302
9680
  }) {
9303
- const [isUserMenuOpen, setIsUserMenuOpen] = (0, import_react41.useState)(false);
9304
- const userMenuRef = (0, import_react41.useRef)(null);
9681
+ const [isUserMenuOpen, setIsUserMenuOpen] = (0, import_react43.useState)(false);
9682
+ const userMenuRef = (0, import_react43.useRef)(null);
9305
9683
  useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
9306
9684
  return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
9307
9685
  "header",
@@ -9361,101 +9739,105 @@ function ITTopBar({
9361
9739
  item.id
9362
9740
  )) })
9363
9741
  ] }),
9364
- userMenu && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "relative", children: [
9365
- /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
9366
- "button",
9367
- {
9368
- type: "button",
9369
- className: "flex items-center gap-3 rounded-full pl-2 pr-4 py-1.5 transition-all duration-200 ease-[cubic-bezier(0.2,0,0,1)] border border-transparent hover:border-secondary-200",
9370
- style: {
9371
- backgroundColor: isUserMenuOpen ? "var(--it-topbar-user-hover, #f1f5f9)" : "transparent"
9372
- },
9373
- onMouseEnter: (e) => {
9374
- if (!isUserMenuOpen) e.currentTarget.style.backgroundColor = "var(--it-topbar-user-hover, #f1f5f9)";
9375
- },
9376
- onMouseLeave: (e) => {
9377
- if (!isUserMenuOpen) e.currentTarget.style.backgroundColor = "transparent";
9378
- },
9379
- onClick: () => setIsUserMenuOpen(!isUserMenuOpen),
9380
- children: [
9381
- /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "relative", children: [
9382
- userMenu.userImage ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
9383
- "img",
9384
- {
9385
- className: "w-9 h-9 rounded-full object-cover ring-2 ring-white shadow-sm",
9386
- src: userMenu.userImage,
9387
- alt: "Current user"
9388
- }
9389
- ) : /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "w-9 h-9 rounded-full bg-slate-100 flex items-center justify-center ring-2 ring-white shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_fa30.FaUserCircle, { className: "w-6 h-6", style: { color: "var(--it-topbar-icon, #94a3b8)" } }) }),
9390
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "absolute bottom-0 right-0 w-2.5 h-2.5 bg-green-500 border-2 border-white rounded-full" })
9391
- ] }),
9392
- /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "hidden sm:flex flex-col text-left py-0.5", children: [
9393
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
9394
- ITText,
9395
- {
9396
- as: "span",
9397
- className: "font-semibold text-[0.85rem] leading-tight",
9398
- style: { color: "var(--it-topbar-user-text, #0f172a)" },
9399
- children: userMenu.userName
9400
- }
9401
- ),
9402
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
9403
- ITText,
9404
- {
9405
- as: "span",
9406
- className: "text-[0.7rem] font-medium",
9407
- style: { color: "var(--it-topbar-user-subtitle, #64748b)" },
9408
- children: userMenu.userEmail
9409
- }
9410
- )
9411
- ] })
9412
- ]
9413
- }
9414
- ),
9415
- /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
9416
- "div",
9417
- {
9418
- ref: userMenuRef,
9419
- className: `
9420
- absolute right-0 mt-3 w-64 rounded-2xl shadow-[0_10px_40px_-10px_rgba(0,0,0,0.15)] z-[70] overflow-hidden transform origin-top-right transition-all duration-200 ease-[cubic-bezier(0.2,0,0,1)]
9421
- ${isUserMenuOpen ? "scale-100 opacity-100 translate-y-0" : "scale-95 opacity-0 -translate-y-2 pointer-events-none"}
9422
- `,
9423
- style: {
9424
- backgroundColor: "var(--it-topbar-user-dropdown-bg, #ffffff)",
9425
- border: "1px solid var(--it-topbar-user-dropdown-border, #f1f5f9)"
9426
- },
9427
- children: [
9428
- /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "px-5 py-4 border-b", style: { borderColor: "var(--it-topbar-user-dropdown-border, #f1f5f9)", backgroundColor: "var(--it-topbar-user-bg, #f8fafc)" }, children: [
9429
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ITText, { as: "span", className: "block font-bold text-[0.9rem]", style: { color: "var(--it-topbar-user-text, #0f172a)" }, children: userMenu.userName }),
9430
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ITText, { as: "span", className: "block text-xs font-medium truncate mt-0.5", style: { color: "var(--it-topbar-user-subtitle, #64748b)" }, children: userMenu.userEmail })
9431
- ] }),
9432
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("ul", { className: "py-2", children: userMenu.menuItems.map((m, i) => {
9433
- const isDestructive = m.label.toLowerCase().includes("salir") || m.label.toLowerCase().includes("cerrar") || m.label.toLowerCase().includes("logout");
9434
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("li", { className: "px-2", children: [
9435
- i === userMenu.menuItems.length - 1 && isDestructive && i > 0 && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "h-px bg-slate-100 my-1 mx-2" }),
9742
+ centerContent && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "hidden lg:flex flex-1 min-w-0 items-center justify-center px-4", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "w-full max-w-[420px]", children: centerContent }) }),
9743
+ (children || userMenu) && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center gap-2", children: [
9744
+ children,
9745
+ userMenu && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "relative", children: [
9746
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
9747
+ "button",
9748
+ {
9749
+ type: "button",
9750
+ className: "flex items-center gap-3 rounded-full pl-2 pr-4 py-1.5 transition-all duration-200 ease-[cubic-bezier(0.2,0,0,1)] border border-transparent hover:border-secondary-200",
9751
+ style: {
9752
+ backgroundColor: isUserMenuOpen ? "var(--it-topbar-user-hover, #f1f5f9)" : "transparent"
9753
+ },
9754
+ onMouseEnter: (e) => {
9755
+ if (!isUserMenuOpen) e.currentTarget.style.backgroundColor = "var(--it-topbar-user-hover, #f1f5f9)";
9756
+ },
9757
+ onMouseLeave: (e) => {
9758
+ if (!isUserMenuOpen) e.currentTarget.style.backgroundColor = "transparent";
9759
+ },
9760
+ onClick: () => setIsUserMenuOpen(!isUserMenuOpen),
9761
+ children: [
9762
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "relative", children: [
9763
+ userMenu.userImage ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
9764
+ "img",
9765
+ {
9766
+ className: "w-9 h-9 rounded-full object-cover ring-2 ring-white shadow-sm",
9767
+ src: userMenu.userImage,
9768
+ alt: "Current user"
9769
+ }
9770
+ ) : /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "w-9 h-9 rounded-full bg-slate-100 flex items-center justify-center ring-2 ring-white shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_fa30.FaUserCircle, { className: "w-6 h-6", style: { color: "var(--it-topbar-icon, #94a3b8)" } }) }),
9771
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "absolute bottom-0 right-0 w-2.5 h-2.5 bg-green-500 border-2 border-white rounded-full" })
9772
+ ] }),
9773
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "hidden sm:flex flex-col text-left py-0.5", children: [
9436
9774
  /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
9437
- "button",
9775
+ ITText,
9438
9776
  {
9439
- onClick: () => {
9440
- m.onClick();
9441
- setIsUserMenuOpen(false);
9442
- },
9443
- className: "block w-full text-left px-3 py-2.5 rounded-xl text-[0.875rem] font-medium transition-colors duration-150",
9444
- style: { color: isDestructive ? "var(--color-danger-500)" : "var(--it-topbar-user-text, #334155)" },
9445
- onMouseEnter: (e) => {
9446
- e.currentTarget.style.backgroundColor = isDestructive ? "var(--color-danger-50)" : "var(--it-topbar-user-item-hover, #f8fafc)";
9447
- },
9448
- onMouseLeave: (e) => {
9449
- e.currentTarget.style.backgroundColor = "transparent";
9450
- },
9451
- children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ITText, { as: "span", children: m.label })
9777
+ as: "span",
9778
+ className: "font-semibold text-[0.85rem] leading-tight",
9779
+ style: { color: "var(--it-topbar-user-text, #0f172a)" },
9780
+ children: userMenu.userName
9781
+ }
9782
+ ),
9783
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
9784
+ ITText,
9785
+ {
9786
+ as: "span",
9787
+ className: "text-[0.7rem] font-medium",
9788
+ style: { color: "var(--it-topbar-user-subtitle, #64748b)" },
9789
+ children: userMenu.userEmail
9452
9790
  }
9453
9791
  )
9454
- ] }, i);
9455
- }) })
9456
- ]
9457
- }
9458
- )
9792
+ ] })
9793
+ ]
9794
+ }
9795
+ ),
9796
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
9797
+ "div",
9798
+ {
9799
+ ref: userMenuRef,
9800
+ className: `
9801
+ absolute right-0 mt-3 w-64 rounded-2xl shadow-[0_10px_40px_-10px_rgba(0,0,0,0.15)] z-[70] overflow-hidden transform origin-top-right transition-all duration-200 ease-[cubic-bezier(0.2,0,0,1)]
9802
+ ${isUserMenuOpen ? "scale-100 opacity-100 translate-y-0" : "scale-95 opacity-0 -translate-y-2 pointer-events-none"}
9803
+ `,
9804
+ style: {
9805
+ backgroundColor: "var(--it-topbar-user-dropdown-bg, #ffffff)",
9806
+ border: "1px solid var(--it-topbar-user-dropdown-border, #f1f5f9)"
9807
+ },
9808
+ children: [
9809
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "px-5 py-4 border-b", style: { borderColor: "var(--it-topbar-user-dropdown-border, #f1f5f9)", backgroundColor: "var(--it-topbar-user-bg, #f8fafc)" }, children: [
9810
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ITText, { as: "span", className: "block font-bold text-[0.9rem]", style: { color: "var(--it-topbar-user-text, #0f172a)" }, children: userMenu.userName }),
9811
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ITText, { as: "span", className: "block text-xs font-medium truncate mt-0.5", style: { color: "var(--it-topbar-user-subtitle, #64748b)" }, children: userMenu.userEmail })
9812
+ ] }),
9813
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("ul", { className: "py-2", children: userMenu.menuItems.map((m, i) => {
9814
+ const isDestructive = m.label.toLowerCase().includes("salir") || m.label.toLowerCase().includes("cerrar") || m.label.toLowerCase().includes("logout");
9815
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("li", { className: "px-2", children: [
9816
+ i === userMenu.menuItems.length - 1 && isDestructive && i > 0 && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "h-px bg-slate-100 my-1 mx-2" }),
9817
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
9818
+ "button",
9819
+ {
9820
+ onClick: () => {
9821
+ m.onClick();
9822
+ setIsUserMenuOpen(false);
9823
+ },
9824
+ className: "block w-full text-left px-3 py-2.5 rounded-xl text-[0.875rem] font-medium transition-colors duration-150",
9825
+ style: { color: isDestructive ? "var(--color-danger-500)" : "var(--it-topbar-user-text, #334155)" },
9826
+ onMouseEnter: (e) => {
9827
+ e.currentTarget.style.backgroundColor = isDestructive ? "var(--color-danger-50)" : "var(--it-topbar-user-item-hover, #f8fafc)";
9828
+ },
9829
+ onMouseLeave: (e) => {
9830
+ e.currentTarget.style.backgroundColor = "transparent";
9831
+ },
9832
+ children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ITText, { as: "span", children: m.label })
9833
+ }
9834
+ )
9835
+ ] }, i);
9836
+ }) })
9837
+ ]
9838
+ }
9839
+ )
9840
+ ] })
9459
9841
  ] })
9460
9842
  ] })
9461
9843
  }
@@ -9471,8 +9853,8 @@ function ITLayout({
9471
9853
  className = "",
9472
9854
  contentClassName = ""
9473
9855
  }) {
9474
- const [internalCollapsed, setInternalCollapsed] = (0, import_react42.useState)(true);
9475
- const [mobileSidebarOpen, setMobileSidebarOpen] = (0, import_react42.useState)(false);
9856
+ const [internalCollapsed, setInternalCollapsed] = (0, import_react44.useState)(true);
9857
+ const [mobileSidebarOpen, setMobileSidebarOpen] = (0, import_react44.useState)(false);
9476
9858
  const isControlled = sidebar.isCollapsed !== void 0;
9477
9859
  const desktopCollapsed = isControlled ? sidebar.isCollapsed : internalCollapsed;
9478
9860
  const handleToggleCollapse = isControlled ? sidebar.onToggleCollapse ?? (() => {
@@ -9494,7 +9876,12 @@ function ITLayout({
9494
9876
  style: { backgroundColor: layoutTokens.backgroundColor },
9495
9877
  children: [
9496
9878
  /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "hidden lg:block relative z-40 h-full", children: [
9497
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "w-[88px] h-full flex-shrink-0" }),
9879
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
9880
+ "div",
9881
+ {
9882
+ className: `${desktopCollapsed ? "w-[88px]" : "w-[280px]"} h-full flex-shrink-0`
9883
+ }
9884
+ ),
9498
9885
  /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "absolute top-0 left-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
9499
9886
  ITSidebar,
9500
9887
  {
@@ -9626,7 +10013,7 @@ function ITLoader({
9626
10013
 
9627
10014
  // src/components/molecules/stepper/stepper.tsx
9628
10015
  var import_clsx52 = __toESM(require("clsx"), 1);
9629
- var import_react43 = require("react");
10016
+ var import_react45 = require("react");
9630
10017
  var import_fa31 = require("react-icons/fa");
9631
10018
  var import_jsx_runtime71 = require("react/jsx-runtime");
9632
10019
  function ITStepper({
@@ -9643,15 +10030,15 @@ function ITStepper({
9643
10030
  maxContentHeight = "400px",
9644
10031
  color = "primary"
9645
10032
  }) {
9646
- const [direction, setDirection] = (0, import_react43.useState)("next");
9647
- const contentRef = (0, import_react43.useRef)(null);
9648
- const progressRef = (0, import_react43.useRef)(null);
10033
+ const [direction, setDirection] = (0, import_react45.useState)("next");
10034
+ const contentRef = (0, import_react45.useRef)(null);
10035
+ const progressRef = (0, import_react45.useRef)(null);
9649
10036
  const isThemeColor = color in theme.colors;
9650
10037
  const resolvedColor = isThemeColor ? theme.colors[color][500] : color;
9651
- (0, import_react43.useEffect)(() => {
10038
+ (0, import_react45.useEffect)(() => {
9652
10039
  onStepChange?.(currentStep);
9653
10040
  }, [currentStep, onStepChange]);
9654
- (0, import_react43.useEffect)(() => {
10041
+ (0, import_react45.useEffect)(() => {
9655
10042
  const pct = currentStep / Math.max(1, steps.length - 1) * 100;
9656
10043
  if (progressRef.current) {
9657
10044
  progressRef.current.style.width = `${pct}%`;
@@ -9822,7 +10209,7 @@ function ITStepper({
9822
10209
  }
9823
10210
 
9824
10211
  // src/components/theme-provider/themeProvider.tsx
9825
- var import_react44 = require("react");
10212
+ var import_react46 = require("react");
9826
10213
  var import_md3 = require("react-icons/md");
9827
10214
 
9828
10215
  // src/components/theme-provider/themePresets.ts
@@ -9860,8 +10247,10 @@ var DEFAULT_PALETTE = {
9860
10247
  // Slate-700
9861
10248
  rowBg: "#ffffff",
9862
10249
  // White
9863
- rowText: "#1e293b"
10250
+ rowText: "#1e293b",
9864
10251
  // Slate-800
10252
+ rowHover: "#f1f5f9"
10253
+ // Slate-100
9865
10254
  }
9866
10255
  };
9867
10256
  var PRESETS = [
@@ -9886,7 +10275,8 @@ var PRESETS = [
9886
10275
  headerBg: "#f1f5f9",
9887
10276
  headerText: "#334155",
9888
10277
  rowBg: "#ffffff",
9889
- rowText: "#0f172a"
10278
+ rowText: "#0f172a",
10279
+ rowHover: "#1e293b"
9890
10280
  }
9891
10281
  }
9892
10282
  },
@@ -9911,7 +10301,8 @@ var PRESETS = [
9911
10301
  headerBg: "#fff1f2",
9912
10302
  headerText: "#881337",
9913
10303
  rowBg: "#ffffff",
9914
- rowText: "#1c1212"
10304
+ rowText: "#1c1212",
10305
+ rowHover: "#fff1f2"
9915
10306
  }
9916
10307
  }
9917
10308
  },
@@ -9936,7 +10327,8 @@ var PRESETS = [
9936
10327
  headerBg: "#f0fdfa",
9937
10328
  headerText: "#115e59",
9938
10329
  rowBg: "#ffffff",
9939
- rowText: "#042f2e"
10330
+ rowText: "#042f2e",
10331
+ rowHover: "#f0fdfa"
9940
10332
  }
9941
10333
  }
9942
10334
  },
@@ -9961,7 +10353,8 @@ var PRESETS = [
9961
10353
  headerBg: "#fefce8",
9962
10354
  headerText: "#713f12",
9963
10355
  rowBg: "#ffffff",
9964
- rowText: "#292524"
10356
+ rowText: "#292524",
10357
+ rowHover: "#fefce8"
9965
10358
  }
9966
10359
  }
9967
10360
  },
@@ -9986,7 +10379,8 @@ var PRESETS = [
9986
10379
  headerBg: "#f0fdf4",
9987
10380
  headerText: "#166534",
9988
10381
  rowBg: "#ffffff",
9989
- rowText: "#052e16"
10382
+ rowText: "#052e16",
10383
+ rowHover: "#f0fdf4"
9990
10384
  }
9991
10385
  }
9992
10386
  }
@@ -10087,7 +10481,7 @@ function ITThemeProvider({
10087
10481
  radius,
10088
10482
  shadow
10089
10483
  }) {
10090
- const [palette2, setPaletteState] = (0, import_react44.useState)(() => {
10484
+ const [palette2, setPaletteState] = (0, import_react46.useState)(() => {
10091
10485
  const basePalette = {
10092
10486
  ...DEFAULT_PALETTE,
10093
10487
  ...theme2,
@@ -10113,8 +10507,8 @@ function ITThemeProvider({
10113
10507
  }
10114
10508
  return basePalette;
10115
10509
  });
10116
- const [isOpen, setIsOpen] = (0, import_react44.useState)(false);
10117
- const [customPresets, setCustomPresets] = (0, import_react44.useState)(() => {
10510
+ const [isOpen, setIsOpen] = (0, import_react46.useState)(false);
10511
+ const [customPresets, setCustomPresets] = (0, import_react46.useState)(() => {
10118
10512
  try {
10119
10513
  const saved = localStorage.getItem("it-theme-custom-presets");
10120
10514
  return saved ? JSON.parse(saved) : [];
@@ -10123,8 +10517,8 @@ function ITThemeProvider({
10123
10517
  return [];
10124
10518
  }
10125
10519
  });
10126
- const [newPresetName, setNewPresetName] = (0, import_react44.useState)("");
10127
- const [isSavingPreset, setIsSavingPreset] = (0, import_react44.useState)(false);
10520
+ const [newPresetName, setNewPresetName] = (0, import_react46.useState)("");
10521
+ const [isSavingPreset, setIsSavingPreset] = (0, import_react46.useState)(false);
10128
10522
  const handleSavePreset = () => {
10129
10523
  if (!newPresetName.trim()) return;
10130
10524
  const newPreset = {
@@ -10143,8 +10537,8 @@ function ITThemeProvider({
10143
10537
  setCustomPresets(updated);
10144
10538
  localStorage.setItem("it-theme-custom-presets", JSON.stringify(updated));
10145
10539
  };
10146
- const [resolvedTheme, setResolvedTheme] = (0, import_react44.useState)("light");
10147
- const [darkModeMode, setDarkModeMode] = (0, import_react44.useState)(
10540
+ const [resolvedTheme, setResolvedTheme] = (0, import_react46.useState)("light");
10541
+ const [darkModeMode, setDarkModeMode] = (0, import_react46.useState)(
10148
10542
  () => {
10149
10543
  const saved = localStorage.getItem("it-theme-dark-mode");
10150
10544
  if (saved === "light" || saved === "dark" || saved === "system") {
@@ -10153,7 +10547,7 @@ function ITThemeProvider({
10153
10547
  return "system";
10154
10548
  }
10155
10549
  );
10156
- (0, import_react44.useEffect)(() => {
10550
+ (0, import_react46.useEffect)(() => {
10157
10551
  localStorage.setItem("it-theme-dark-mode", darkModeMode);
10158
10552
  const applyDarkMode = (isDark) => {
10159
10553
  if (isDark) {
@@ -10178,7 +10572,7 @@ function ITThemeProvider({
10178
10572
  applyDarkMode(darkModeMode === "dark");
10179
10573
  }
10180
10574
  }, [darkModeMode]);
10181
- (0, import_react44.useEffect)(() => {
10575
+ (0, import_react46.useEffect)(() => {
10182
10576
  if (!showFab) {
10183
10577
  setPaletteState({
10184
10578
  ...DEFAULT_PALETTE,
@@ -10188,7 +10582,7 @@ function ITThemeProvider({
10188
10582
  });
10189
10583
  }
10190
10584
  }, [theme2, showFab]);
10191
- (0, import_react44.useLayoutEffect)(() => {
10585
+ (0, import_react46.useLayoutEffect)(() => {
10192
10586
  const root = document.documentElement;
10193
10587
  const scale = typeof density === "number" && isFinite(density) ? Math.min(Math.max(density, 0.5), 1.5) : 1;
10194
10588
  root.style.setProperty("--it-density", String(scale));
@@ -10198,7 +10592,7 @@ function ITThemeProvider({
10198
10592
  root.style.fontSize = "";
10199
10593
  };
10200
10594
  }, [density]);
10201
- (0, import_react44.useLayoutEffect)(() => {
10595
+ (0, import_react46.useLayoutEffect)(() => {
10202
10596
  const root = document.documentElement;
10203
10597
  const radiusTokens = ["xs", "sm", "md", "lg", "xl", "2xl", "3xl"];
10204
10598
  if (typeof radius === "number" && isFinite(radius)) {
@@ -10230,7 +10624,7 @@ function ITThemeProvider({
10230
10624
  surfaceStyle?.remove();
10231
10625
  };
10232
10626
  }, [radius, shadow]);
10233
- (0, import_react44.useEffect)(() => {
10627
+ (0, import_react46.useEffect)(() => {
10234
10628
  const injectStyles = (obj, prefix = "") => {
10235
10629
  Object.entries(obj).forEach(([key, val]) => {
10236
10630
  if (typeof val === "object" && val !== null) {
@@ -10266,6 +10660,7 @@ function ITThemeProvider({
10266
10660
  let tableRowText = palette2.table.rowText;
10267
10661
  let tableHeaderBg = palette2.table.headerBg;
10268
10662
  let tableHeaderText = palette2.table.headerText;
10663
+ let tableRowHover = palette2.table.rowHover;
10269
10664
  let navbarBg = palette2.layout.navbarBg;
10270
10665
  let navbarText = palette2.layout.navbarText;
10271
10666
  let sidebarBg = palette2.layout.sidebarBg;
@@ -10283,6 +10678,9 @@ function ITThemeProvider({
10283
10678
  if (!isLightColor2(tableHeaderText)) {
10284
10679
  tableHeaderText = `color-mix(in srgb, ${palette2.table.headerText} 20%, #f9fafb)`;
10285
10680
  }
10681
+ if (isLightColor2(tableRowHover)) {
10682
+ tableRowHover = `color-mix(in srgb, ${palette2.table.rowHover} 12%, #1f2937)`;
10683
+ }
10286
10684
  if (isLightColor2(navbarBg)) {
10287
10685
  navbarBg = `color-mix(in srgb, ${palette2.layout.navbarBg} 8%, #111827)`;
10288
10686
  }
@@ -10308,7 +10706,10 @@ function ITThemeProvider({
10308
10706
  }
10309
10707
  if (isLightColor2(tableHeaderText)) {
10310
10708
  tableHeaderText = `color-mix(in srgb, ${palette2.table.headerText} 30%, #334155)`;
10311
- } else if (!isLightColor2(tableHeaderText) && isVeryDarkColor(palette2.table.headerText)) {
10709
+ } else if (!isLightColor2(tableHeaderText) && isVeryDarkColor(tableHeaderText)) {
10710
+ }
10711
+ if (!isLightColor2(tableRowHover)) {
10712
+ tableRowHover = isVeryDarkColor(palette2.table.rowHover) ? "#f1f5f9" : `color-mix(in srgb, ${palette2.table.rowHover} 12%, #f8fafc)`;
10312
10713
  }
10313
10714
  if (!isLightColor2(navbarBg)) {
10314
10715
  navbarBg = isVeryDarkColor(palette2.layout.navbarBg) ? "#ffffff" : `color-mix(in srgb, ${palette2.layout.navbarBg} 8%, #ffffff)`;
@@ -10518,6 +10919,7 @@ function ITThemeProvider({
10518
10919
  --color-table-headerText: ${tableHeaderText} !important;
10519
10920
  --color-table-rowBg: ${tableRowBg} !important;
10520
10921
  --color-table-rowText: ${tableRowText} !important;
10922
+ --color-table-rowHover: ${tableRowHover} !important;
10521
10923
 
10522
10924
  /* Native library variables integration */
10523
10925
  --it-sidebar-bg: var(--color-sidebarBg);
@@ -10861,7 +11263,7 @@ function ITThemeProvider({
10861
11263
  color: var(--color-table-rowText) !important;
10862
11264
  }
10863
11265
  tbody tr:hover {
10864
- background-color: color-mix(in srgb, var(--color-primary) 8%, var(--color-table-rowBg)) !important;
11266
+ background-color: var(--color-table-rowHover) !important;
10865
11267
  }
10866
11268
 
10867
11269
  /* Animation for Saved Indicator */
@@ -11623,7 +12025,8 @@ function ITThemeProvider({
11623
12025
  "table.headerBg",
11624
12026
  "table.headerText",
11625
12027
  "table.rowBg",
11626
- "table.rowText"
12028
+ "table.rowText",
12029
+ "table.rowHover"
11627
12030
  ].map((key) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ColorRow, { colorKey: key }, key)) })
11628
12031
  }
11629
12032
  ]