@axzydev/axzy_ui_system 1.3.1 → 1.3.2

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 (45) hide show
  1. package/README.md +6 -2
  2. package/dist/index.cjs +930 -544
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.css +1 -1
  5. package/dist/index.d.cts +187 -9
  6. package/dist/index.d.ts +187 -9
  7. package/dist/index.js +881 -495
  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 +177 -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 +240 -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/dev.css +58 -1
  32. package/src/hooks/useElementSize.ts +46 -0
  33. package/src/hooks/useVirtualRows.ts +123 -0
  34. package/src/index.ts +2 -0
  35. package/src/sandbox/LandingShowcase.tsx +465 -0
  36. package/src/sandbox/NotFoundShowcase.tsx +70 -0
  37. package/src/sandbox/TopbarSearch.tsx +85 -0
  38. package/src/sandbox/navigation.ts +148 -0
  39. package/src/sandbox/useHashRoute.ts +149 -0
  40. package/src/showcases/DataShowcases.tsx +321 -24
  41. package/src/showcases/PageShowcases.tsx +31 -0
  42. package/src/showcases/StructureShowcases.tsx +42 -4
  43. package/src/types/table.types.ts +48 -0
  44. package/src/utils/styles.ts +9 -4
  45. 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,15 @@ 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
2183
  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);
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
+ function tableCell(className, density = "normal") {
2187
+ return (0, import_clsx11.default)(densityStyles[density].cell, "align-middle", className);
2158
2188
  }
2159
2189
  var tableActionsCell = "flex items-center justify-center gap-2";
2160
2190
  var tableCellText = "text-secondary-700 font-medium";
@@ -3571,32 +3601,99 @@ function ITConfirmDialog({
3571
3601
  ] });
3572
3602
  }
3573
3603
 
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
- };
3604
+ // src/hooks/useElementSize.ts
3605
+ var import_react15 = require("react");
3606
+ function useElementSize() {
3607
+ const ref = (0, import_react15.useRef)(null);
3608
+ const [size, setSize] = (0, import_react15.useState)({ width: 0, height: 0 });
3609
+ (0, import_react15.useLayoutEffect)(() => {
3610
+ const element = ref.current;
3611
+ if (!element) return;
3612
+ const update = () => {
3613
+ const rect = element.getBoundingClientRect();
3614
+ setSize({ width: rect.width, height: rect.height });
3615
+ };
3616
+ update();
3617
+ const observer = new ResizeObserver(update);
3618
+ observer.observe(element);
3619
+ return () => observer.disconnect();
3620
+ }, []);
3621
+ return { ref, width: size.width, height: size.height };
3622
+ }
3623
+
3624
+ // src/hooks/useVirtualRows.ts
3625
+ var import_react16 = require("react");
3626
+ function useVirtualRows({
3627
+ count,
3628
+ rowHeight,
3629
+ overscan = 5,
3630
+ enabled = true,
3631
+ resetKey
3632
+ }) {
3633
+ const scrollRef = (0, import_react16.useRef)(null);
3634
+ const [scrollTop, setScrollTop] = (0, import_react16.useState)(0);
3635
+ const [viewportHeight, setViewportHeight] = (0, import_react16.useState)(0);
3636
+ const scrollToTop = (0, import_react16.useCallback)(() => {
3637
+ setScrollTop(0);
3638
+ const element = scrollRef.current;
3639
+ if (element) element.scrollTop = 0;
3640
+ }, []);
3641
+ (0, import_react16.useLayoutEffect)(() => {
3642
+ if (!enabled) return;
3643
+ const element = scrollRef.current;
3644
+ if (!element) return;
3645
+ const onScroll = () => setScrollTop(element.scrollTop);
3646
+ const measure = () => setViewportHeight(element.clientHeight);
3647
+ measure();
3648
+ setScrollTop(element.scrollTop);
3649
+ element.addEventListener("scroll", onScroll, { passive: true });
3650
+ const observer = new ResizeObserver(measure);
3651
+ observer.observe(element);
3652
+ return () => {
3653
+ element.removeEventListener("scroll", onScroll);
3654
+ observer.disconnect();
3655
+ };
3656
+ }, [enabled]);
3657
+ (0, import_react16.useLayoutEffect)(() => {
3658
+ if (!enabled) return;
3659
+ const element = scrollRef.current;
3660
+ if (element) element.scrollTop = 0;
3661
+ setScrollTop(0);
3662
+ }, [resetKey, enabled]);
3663
+ const valid = enabled && rowHeight > 0 && count > 0;
3664
+ const safeScrollTop = valid ? scrollTop : 0;
3665
+ const startIndex = valid ? Math.min(count - 1, Math.max(0, Math.floor(safeScrollTop / rowHeight) - overscan)) : 0;
3666
+ const endIndex = valid ? Math.min(
3667
+ count - 1,
3668
+ Math.ceil((safeScrollTop + viewportHeight) / rowHeight) + overscan
3669
+ ) : Math.max(0, count - 1);
3670
+ const topSpacerHeight = valid ? startIndex * rowHeight : 0;
3671
+ const bottomSpacerHeight = valid ? Math.max(0, (count - 1 - endIndex) * rowHeight) : 0;
3672
+ return {
3673
+ scrollRef,
3674
+ startIndex,
3675
+ endIndex,
3676
+ topSpacerHeight,
3677
+ bottomSpacerHeight,
3678
+ scrollTop: safeScrollTop,
3679
+ scrollToTop
3680
+ };
3681
+ }
3585
3682
 
3586
3683
  // src/components/organisms/data-table/dataTable.tsx
3587
3684
  var import_clsx21 = __toESM(require("clsx"), 1);
3588
- var import_react17 = require("react");
3685
+ var import_react19 = require("react");
3589
3686
  var import_fa11 = require("react-icons/fa");
3590
3687
  var import_md = require("react-icons/md");
3591
3688
 
3592
3689
  // src/components/molecules/pagination/pagination.tsx
3593
- var import_react16 = __toESM(require("react"), 1);
3690
+ var import_react18 = __toESM(require("react"), 1);
3594
3691
  var import_clsx20 = __toESM(require("clsx"), 1);
3595
3692
  var import_fa10 = require("react-icons/fa");
3596
3693
 
3597
3694
  // src/components/molecules/select/select.tsx
3598
3695
  var import_clsx19 = __toESM(require("clsx"), 1);
3599
- var import_react15 = require("react");
3696
+ var import_react17 = require("react");
3600
3697
  var import_fa9 = require("react-icons/fa");
3601
3698
  var import_jsx_runtime19 = require("react/jsx-runtime");
3602
3699
  function ITSelect({
@@ -3617,8 +3714,8 @@ function ITSelect({
3617
3714
  readOnly = false,
3618
3715
  size = "md"
3619
3716
  }) {
3620
- const [isFocused, setIsFocused] = (0, import_react15.useState)(false);
3621
- const [localTouched, setLocalTouched] = (0, import_react15.useState)(false);
3717
+ const [isFocused, setIsFocused] = (0, import_react17.useState)(false);
3718
+ const [localTouched, setLocalTouched] = (0, import_react17.useState)(false);
3622
3719
  const inputTheme = theme.input || {};
3623
3720
  const isTouched = touched !== void 0 ? touched : localTouched;
3624
3721
  const isEmpty = value === void 0 || value === null || String(value).trim() === "";
@@ -3712,7 +3809,7 @@ var usePagination = ({
3712
3809
  currentPage,
3713
3810
  siblingCount = 1
3714
3811
  }) => {
3715
- return import_react16.default.useMemo(() => {
3812
+ return import_react18.default.useMemo(() => {
3716
3813
  const totalPageNumbers = siblingCount + 5;
3717
3814
  if (totalPageNumbers >= totalPages) {
3718
3815
  return Array.from({ length: totalPages }, (_, i) => i + 1);
@@ -3889,6 +3986,14 @@ var formatCurrencyMX = (value) => {
3889
3986
  var getNestedValue = (obj, path) => {
3890
3987
  return path.split(".").reduce((acc, part) => acc && acc[part], obj);
3891
3988
  };
3989
+ var ROW_CLICK_IGNORE_SELECTOR = 'button, a, input, select, textarea, [role="button"], [role="link"], [data-row-click-ignore]';
3990
+ function isInteractiveTarget(target, boundary = null) {
3991
+ if (!(target instanceof Element)) return false;
3992
+ const interactive = target.closest(ROW_CLICK_IGNORE_SELECTOR);
3993
+ if (!interactive) return false;
3994
+ if (boundary instanceof Node && interactive === boundary) return false;
3995
+ return true;
3996
+ }
3892
3997
 
3893
3998
  // src/components/organisms/data-table/dataTable.tsx
3894
3999
  var import_jsx_runtime21 = require("react/jsx-runtime");
@@ -3914,12 +4019,32 @@ function ITDataTable({
3914
4019
  renderCard,
3915
4020
  defaultView,
3916
4021
  showVerticalBorder = true,
3917
- verticalBorderClassname
4022
+ verticalBorderClassname,
4023
+ onRowClick,
4024
+ layout = "auto",
4025
+ density = "normal",
4026
+ autoCardBreakpoint = 0,
4027
+ virtualized = false,
4028
+ virtualizedMaxHeight = 400,
4029
+ rowHeight,
4030
+ overscan = 5,
4031
+ stickyHeader = false
3918
4032
  }) {
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);
4033
+ const [viewMode, setViewMode] = (0, import_react19.useState)(defaultView || "table");
4034
+ const { ref: rootRef, width: containerWidth } = useElementSize();
4035
+ const [data, setData] = (0, import_react19.useState)([]);
4036
+ const [totalItems, setTotalItems] = (0, import_react19.useState)(0);
4037
+ const [isLoading, setIsLoading] = (0, import_react19.useState)(fetchOnMount);
4038
+ const isFixed = layout === "fixed";
4039
+ const forcedCards = autoCardBreakpoint > 0 && containerWidth > 0 && containerWidth < autoCardBreakpoint;
4040
+ const effectiveView = forcedCards ? "cards" : viewMode;
4041
+ const hasColumnWidths = columns.some((col) => col.width != null);
4042
+ 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";
4043
+ const isTableVirtual = virtualized && effectiveView === "table";
4044
+ const isStickyHeader = stickyHeader && isTableVirtual;
4045
+ const resolvedRowHeight = rowHeight ?? getRowHeight(size, density);
4046
+ const columnCount = columns.length;
4047
+ const scrollOuterClass = isTableVirtual ? "relative min-h-[200px]" : "overflow-x-auto relative min-h-[200px]";
3923
4048
  const {
3924
4049
  currentPage,
3925
4050
  itemsPerPage,
@@ -3930,15 +4055,29 @@ function ITDataTable({
3930
4055
  handleSort,
3931
4056
  handleItemsPerPageChange
3932
4057
  } = 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);
4058
+ const {
4059
+ scrollRef,
4060
+ startIndex,
4061
+ endIndex,
4062
+ topSpacerHeight,
4063
+ bottomSpacerHeight
4064
+ } = useVirtualRows({
4065
+ count: data.length,
4066
+ rowHeight: resolvedRowHeight,
4067
+ overscan,
4068
+ enabled: isTableVirtual,
4069
+ resetKey: `${currentPage}-${itemsPerPage}`
4070
+ });
4071
+ const windowData = isTableVirtual ? data.slice(startIndex, endIndex + 1) : data;
4072
+ const debounceTimerRef = (0, import_react19.useRef)(null);
4073
+ const hasFetchedRef = (0, import_react19.useRef)(false);
4074
+ const fetchDataRef = (0, import_react19.useRef)(fetchData);
3936
4075
  fetchDataRef.current = fetchData;
3937
- const externalFiltersRef = (0, import_react17.useRef)(externalFilters);
4076
+ const externalFiltersRef = (0, import_react19.useRef)(externalFilters);
3938
4077
  externalFiltersRef.current = externalFilters;
3939
4078
  const externalKey = JSON.stringify(externalFilters);
3940
4079
  const computedTotalPages = Math.ceil(totalItems / itemsPerPage) || 1;
3941
- const performFetch = (0, import_react17.useCallback)(async () => {
4080
+ const performFetch = (0, import_react19.useCallback)(async () => {
3942
4081
  setIsLoading(true);
3943
4082
  try {
3944
4083
  const response = await fetchDataRef.current({
@@ -3959,9 +4098,9 @@ function ITDataTable({
3959
4098
  setIsLoading(false);
3960
4099
  }
3961
4100
  }, [currentPage, itemsPerPage, filters, sortConfig]);
3962
- const performFetchRef = (0, import_react17.useRef)(performFetch);
4101
+ const performFetchRef = (0, import_react19.useRef)(performFetch);
3963
4102
  performFetchRef.current = performFetch;
3964
- (0, import_react17.useEffect)(() => {
4103
+ (0, import_react19.useEffect)(() => {
3965
4104
  if (!fetchOnMount && !hasFetchedRef.current) return;
3966
4105
  if (debounceTimerRef.current) clearTimeout(debounceTimerRef.current);
3967
4106
  debounceTimerRef.current = setTimeout(() => {
@@ -4080,15 +4219,132 @@ function ITDataTable({
4080
4219
  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
4220
  ] });
4082
4221
  };
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: [
4222
+ 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"}`;
4223
+ const handleRowClick = (row) => (event) => {
4224
+ if (!onRowClick || isLoading || isInteractiveTarget(event.target, event.currentTarget)) return;
4225
+ onRowClick(row, event);
4226
+ };
4227
+ const handleRowKeyDown = (row) => (event) => {
4228
+ if (!onRowClick || isLoading) return;
4229
+ if (event.target !== event.currentTarget) return;
4230
+ if (event.key !== "Enter" && event.key !== " ") return;
4231
+ event.preventDefault();
4232
+ onRowClick(row, event);
4233
+ };
4234
+ const tableEl = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
4235
+ "table",
4236
+ {
4237
+ className: (0, import_clsx21.default)(
4238
+ tableLayoutClass,
4239
+ showVerticalBorder && "[&_th]:border-r [&_th:last-child]:border-r-0 [&_td]:border-r [&_td:last-child]:border-r-0",
4240
+ showVerticalBorder && (verticalBorderClassname || "[&_th]:border-slate-100 dark:[&_th]:border-slate-700/30 [&_td]:border-slate-100 dark:[&_td]:border-slate-700/30"),
4241
+ isLoading ? "opacity-50" : "opacity-100",
4242
+ variantStyles[variant],
4243
+ sizeStyles[size],
4244
+ className
4245
+ ),
4246
+ style: isFixed ? { tableLayout: "fixed" } : void 0,
4247
+ "aria-rowcount": isTableVirtual ? data.length + 1 : void 0,
4248
+ children: [
4249
+ hasColumnWidths && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("colgroup", { children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4250
+ "col",
4251
+ {
4252
+ style: col.width != null ? { width: typeof col.width === "number" ? `${col.width}px` : col.width } : void 0
4253
+ },
4254
+ col.key
4255
+ )) }),
4256
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4257
+ "tr",
4258
+ {
4259
+ className: (0, import_clsx21.default)(tableHeaderRow, "dark:text-slate-200"),
4260
+ "aria-rowindex": isTableVirtual ? 1 : void 0,
4261
+ children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4262
+ "th",
4263
+ {
4264
+ scope: "col",
4265
+ className: (0, import_clsx21.default)(
4266
+ tableHeaderCell(col.className, density),
4267
+ col.align && tableAlignClasses[col.align],
4268
+ isStickyHeader && "sticky top-0 z-10 bg-secondary-50"
4269
+ ),
4270
+ style: col.minWidth != null || isStickyHeader ? {
4271
+ ...col.minWidth != null ? { minWidth: `${col.minWidth}px` } : {},
4272
+ ...isStickyHeader ? { backgroundColor: "var(--color-table-headerBg, #f8fafc)" } : {}
4273
+ } : void 0,
4274
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: isFixed ? "flex flex-col gap-3" : "flex flex-col gap-3 min-w-[150px]", children: [
4275
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
4276
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ITText, { as: "span", className: "text-slate-900 dark:text-white font-bold", children: col.label }),
4277
+ col.sortable && col.type !== "actions" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4278
+ "button",
4279
+ {
4280
+ onClick: () => handleSort(col.key),
4281
+ disabled: isLoading,
4282
+ 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`,
4283
+ title: `Ordenar por ${col.label}`,
4284
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_md.MdOutlineSwapVert, { className: "w-4 h-4", "aria-hidden": "true" })
4285
+ }
4286
+ )
4287
+ ] }),
4288
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "w-full", children: col.filter ? renderFilterInput(col) : null })
4289
+ ] })
4290
+ },
4291
+ col.key
4292
+ ))
4293
+ }
4294
+ ) }),
4295
+ /* @__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: [
4296
+ 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 } }) }),
4297
+ windowData.map((row, windowIndex) => {
4298
+ const absoluteIndex = isTableVirtual ? startIndex + windowIndex : windowIndex;
4299
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4300
+ "tr",
4301
+ {
4302
+ "aria-rowindex": isTableVirtual ? absoluteIndex + 2 : void 0,
4303
+ className: (0, import_clsx21.default)(
4304
+ tableRow,
4305
+ variant === "striped" && absoluteIndex % 2 === 0 && "bg-secondary-50/40 dark:bg-slate-800/20",
4306
+ onRowClick && !isLoading && tableRowClickable
4307
+ ),
4308
+ tabIndex: onRowClick && !isLoading ? 0 : void 0,
4309
+ onClick: onRowClick && !isLoading ? handleRowClick(row) : void 0,
4310
+ onKeyDown: onRowClick && !isLoading ? handleRowKeyDown(row) : void 0,
4311
+ children: columns.map((col) => {
4312
+ const rawValue = getNestedValue2(row, col.key);
4313
+ const truncateTitle = col.truncate && (typeof rawValue === "string" || typeof rawValue === "number") ? String(rawValue) : void 0;
4314
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4315
+ "td",
4316
+ {
4317
+ className: (0, import_clsx21.default)(
4318
+ tableCell(col.className, density),
4319
+ col.align && tableAlignClasses[col.align]
4320
+ ),
4321
+ style: col.minWidth != null ? { minWidth: `${col.minWidth}px` } : void 0,
4322
+ title: truncateTitle,
4323
+ 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) })
4324
+ },
4325
+ `${absoluteIndex}-${col.key}`
4326
+ );
4327
+ })
4328
+ },
4329
+ absoluteIndex
4330
+ );
4331
+ }),
4332
+ 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 } }) })
4333
+ ] }) : /* @__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: [
4334
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
4335
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
4336
+ ] }) }) }) })
4337
+ ]
4338
+ }
4339
+ );
4340
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { ref: rootRef, className: (0, import_clsx21.default)("space-y-4 w-full relative", containerClassName), children: [
4085
4341
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: tableContainer, style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
4086
4342
  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
4343
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ITText, { as: "h2", className: "text-xl font-bold text-secondary-900 leading-tight", children: title }),
4088
4344
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-3", children: [
4089
4345
  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
4346
  /* @__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: [
4347
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("button", { onClick: () => setViewMode("table"), disabled: forcedCards, className: segCtrlClass("table"), children: [
4092
4348
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_fa11.FaTable, { size: 11 }),
4093
4349
  "Table"
4094
4350
  ] }),
@@ -4100,7 +4356,7 @@ function ITDataTable({
4100
4356
  ] })
4101
4357
  ] }),
4102
4358
  !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: [
4359
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("button", { onClick: () => setViewMode("table"), disabled: forcedCards, className: segCtrlClass("table"), children: [
4104
4360
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_fa11.FaTable, { size: 11 }),
4105
4361
  "Table"
4106
4362
  ] }),
@@ -4109,50 +4365,34 @@ function ITDataTable({
4109
4365
  "Cards"
4110
4366
  ] })
4111
4367
  ] }) }),
4112
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "overflow-x-auto relative min-h-[200px]", children: [
4368
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: scrollOuterClass, children: [
4113
4369
  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
4370
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_fa11.FaSpinner, { className: "animate-spin text-primary-500 text-4xl" }),
4115
4371
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ITText, { as: "span", className: "text-sm font-semibold text-secondary-600 animate-pulse", children: "Cargando datos..." })
4116
4372
  ] }) }) }),
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: [
4373
+ 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)(
4374
+ "div",
4375
+ {
4376
+ className: (0, import_clsx21.default)(onRowClick && !isLoading && tableCardClickable),
4377
+ role: onRowClick && !isLoading ? "button" : void 0,
4378
+ tabIndex: onRowClick && !isLoading ? 0 : void 0,
4379
+ onClick: onRowClick && !isLoading ? handleRowClick(row) : void 0,
4380
+ onKeyDown: onRowClick && !isLoading ? handleRowKeyDown(row) : void 0,
4381
+ children: renderCard ? renderCard(row) : renderDefaultCard(row)
4382
+ },
4383
+ i
4384
+ )) : !isLoading && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: (0, import_clsx21.default)(tableEmptyContent, "py-12"), children: [
4118
4385
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
4119
4386
  /* @__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",
4387
+ ] }) }) : isTableVirtual ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4388
+ "div",
4122
4389
  {
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
- ]
4390
+ ref: scrollRef,
4391
+ className: "overflow-x-auto overflow-y-auto",
4392
+ style: { maxHeight: virtualizedMaxHeight },
4393
+ children: tableEl
4154
4394
  }
4155
- )
4395
+ ) : tableEl
4156
4396
  ] })
4157
4397
  ] }),
4158
4398
  /* @__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 +4413,7 @@ function ITDataTable({
4173
4413
 
4174
4414
  // src/components/molecules/date-picker/datePicker.tsx
4175
4415
  var import_clsx22 = __toESM(require("clsx"), 1);
4176
- var import_react18 = __toESM(require("react"), 1);
4416
+ var import_react20 = __toESM(require("react"), 1);
4177
4417
  var import_react_dom3 = require("react-dom");
4178
4418
  var import_fa12 = require("react-icons/fa");
4179
4419
  var import_date_fns2 = require("date-fns");
@@ -4197,16 +4437,16 @@ function ITDatePicker({
4197
4437
  maxDate,
4198
4438
  range = false
4199
4439
  }) {
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);
4440
+ const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
4441
+ const [inputValue, setInputValue] = (0, import_react20.useState)("");
4442
+ const [isValidDate, setIsValidDate] = (0, import_react20.useState)(true);
4443
+ const [internalRange, setInternalRange] = (0, import_react20.useState)([null, null]);
4444
+ const wrapperRef = (0, import_react20.useRef)(null);
4205
4445
  const { panelRef, style: panelStyle } = useFloatingPanel(wrapperRef, isOpen, {
4206
4446
  estimatedHeight: 360,
4207
4447
  matchWidth: false
4208
4448
  });
4209
- const dateRange = import_react18.default.useMemo(() => {
4449
+ const dateRange = import_react20.default.useMemo(() => {
4210
4450
  if (range) {
4211
4451
  if (Array.isArray(value)) return value;
4212
4452
  return internalRange;
@@ -4214,7 +4454,7 @@ function ITDatePicker({
4214
4454
  return [value instanceof Date ? value : null, null];
4215
4455
  }, [value, range, internalRange]);
4216
4456
  const [startDate, endDate] = dateRange;
4217
- (0, import_react18.useEffect)(() => {
4457
+ (0, import_react20.useEffect)(() => {
4218
4458
  if (range) {
4219
4459
  if (startDate && endDate) {
4220
4460
  setInputValue(`${formatDate(startDate)} - ${formatDate(endDate)}`);
@@ -4231,7 +4471,7 @@ function ITDatePicker({
4231
4471
  }
4232
4472
  }
4233
4473
  }, [startDate, endDate, range]);
4234
- (0, import_react18.useEffect)(() => {
4474
+ (0, import_react20.useEffect)(() => {
4235
4475
  const handleClickOutside = (event) => {
4236
4476
  const target = event.target;
4237
4477
  const inWrapper = wrapperRef.current?.contains(target);
@@ -4426,24 +4666,24 @@ function ITDatePicker({
4426
4666
 
4427
4667
  // src/components/organisms/dialog/dialog.tsx
4428
4668
  var import_react_dom4 = require("react-dom");
4429
- var import_react20 = require("react");
4669
+ var import_react22 = require("react");
4430
4670
  var import_fa14 = require("react-icons/fa");
4431
4671
 
4432
4672
  // src/components/molecules/form-header/form-header.tsx
4433
4673
  var import_fa13 = require("react-icons/fa");
4434
4674
 
4435
4675
  // src/theme/theme-context.ts
4436
- var import_react19 = require("react");
4437
- var ITThemeContext = (0, import_react19.createContext)(void 0);
4676
+ var import_react21 = require("react");
4677
+ var ITThemeContext = (0, import_react21.createContext)(void 0);
4438
4678
  var useITTheme = () => {
4439
- const context = (0, import_react19.useContext)(ITThemeContext);
4679
+ const context = (0, import_react21.useContext)(ITThemeContext);
4440
4680
  if (!context) {
4441
4681
  throw new Error("useITTheme must be used within an ITThemeProvider");
4442
4682
  }
4443
4683
  return context;
4444
4684
  };
4445
4685
  var useITThemeSafe = () => {
4446
- return (0, import_react19.useContext)(ITThemeContext);
4686
+ return (0, import_react21.useContext)(ITThemeContext);
4447
4687
  };
4448
4688
 
4449
4689
  // src/utils/color.utils.ts
@@ -4563,9 +4803,9 @@ function ITDialog({
4563
4803
  useFormHeader = false,
4564
4804
  fullScreen = false
4565
4805
  }) {
4566
- const modalRef = (0, import_react20.useRef)(null);
4806
+ const modalRef = (0, import_react22.useRef)(null);
4567
4807
  useClickOutside_default(modalRef, onClose);
4568
- (0, import_react20.useEffect)(() => {
4808
+ (0, import_react22.useEffect)(() => {
4569
4809
  const handleEscape = (event) => {
4570
4810
  if (event.key === "Escape") {
4571
4811
  onClose();
@@ -4646,7 +4886,7 @@ function ITDivider({
4646
4886
  // src/components/organisms/drawer/drawer.tsx
4647
4887
  var import_clsx24 = __toESM(require("clsx"), 1);
4648
4888
  var import_fa15 = require("react-icons/fa");
4649
- var import_react21 = require("react");
4889
+ var import_react23 = require("react");
4650
4890
  var import_jsx_runtime26 = require("react/jsx-runtime");
4651
4891
  function ITDrawer({
4652
4892
  isOpen,
@@ -4658,7 +4898,7 @@ function ITDrawer({
4658
4898
  className,
4659
4899
  style
4660
4900
  }) {
4661
- const panelRef = (0, import_react21.useRef)(null);
4901
+ const panelRef = (0, import_react23.useRef)(null);
4662
4902
  useClickOutside_default(panelRef, onClose);
4663
4903
  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
4904
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "absolute inset-0 bg-black/40 backdrop-blur-sm transition-opacity" }),
@@ -4781,36 +5021,36 @@ function ITFlex({
4781
5021
  }
4782
5022
 
4783
5023
  // src/components/organisms/form-builder/formBuilder.tsx
4784
- var import_react27 = require("react");
5024
+ var import_react29 = require("react");
4785
5025
 
4786
5026
  // src/components/organisms/form-builder/formBuilder.context.tsx
4787
- var import_react22 = __toESM(require("react"), 1);
5027
+ var import_react24 = __toESM(require("react"), 1);
4788
5028
  var import_jsx_runtime29 = require("react/jsx-runtime");
4789
- var ITFormBuilderContext = (0, import_react22.createContext)(void 0);
5029
+ var ITFormBuilderContext = (0, import_react24.createContext)(void 0);
4790
5030
  var ITFormBuilderProvider = ({
4791
5031
  children,
4792
5032
  value
4793
5033
  }) => {
4794
- const [fieldRegistry, setFieldRegistry] = (0, import_react22.useState)({});
4795
- const registerField = import_react22.default.useCallback((name, config2) => {
5034
+ const [fieldRegistry, setFieldRegistry] = (0, import_react24.useState)({});
5035
+ const registerField = import_react24.default.useCallback((name, config2) => {
4796
5036
  setFieldRegistry((prev) => ({ ...prev, [name]: config2 }));
4797
5037
  }, []);
4798
- const unregisterField = import_react22.default.useCallback((name) => {
5038
+ const unregisterField = import_react24.default.useCallback((name) => {
4799
5039
  setFieldRegistry((prev) => {
4800
5040
  const next = { ...prev };
4801
5041
  delete next[name];
4802
5042
  return next;
4803
5043
  });
4804
5044
  }, []);
4805
- const getFieldConfig = import_react22.default.useCallback(
5045
+ const getFieldConfig = import_react24.default.useCallback(
4806
5046
  (name) => fieldRegistry[name],
4807
5047
  [fieldRegistry]
4808
5048
  );
4809
- const getAllFieldConfigs = import_react22.default.useCallback(
5049
+ const getAllFieldConfigs = import_react24.default.useCallback(
4810
5050
  () => Object.values(fieldRegistry),
4811
5051
  [fieldRegistry]
4812
5052
  );
4813
- const contextValue = import_react22.default.useMemo(
5053
+ const contextValue = import_react24.default.useMemo(
4814
5054
  () => ({
4815
5055
  ...value,
4816
5056
  registerField,
@@ -4823,7 +5063,7 @@ var ITFormBuilderProvider = ({
4823
5063
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ITFormBuilderContext.Provider, { value: contextValue, children });
4824
5064
  };
4825
5065
  var useITFormBuilderContext = () => {
4826
- const context = (0, import_react22.useContext)(ITFormBuilderContext);
5066
+ const context = (0, import_react24.useContext)(ITFormBuilderContext);
4827
5067
  if (!context) {
4828
5068
  throw new Error("useITFormBuilderContext must be used within an ITFormBuilderProvider");
4829
5069
  }
@@ -4831,12 +5071,12 @@ var useITFormBuilderContext = () => {
4831
5071
  };
4832
5072
 
4833
5073
  // src/components/organisms/form-builder/fieldRenderer.tsx
4834
- var import_react26 = require("react");
5074
+ var import_react28 = require("react");
4835
5075
  var import_clsx29 = __toESM(require("clsx"), 1);
4836
5076
 
4837
5077
  // src/components/molecules/time-picker/timePicker.tsx
4838
5078
  var import_clsx27 = __toESM(require("clsx"), 1);
4839
- var import_react23 = require("react");
5079
+ var import_react25 = require("react");
4840
5080
  var import_react_dom5 = require("react-dom");
4841
5081
  var import_fa17 = require("react-icons/fa");
4842
5082
  var import_jsx_runtime30 = require("react/jsx-runtime");
@@ -4856,12 +5096,12 @@ function ITTimePicker({
4856
5096
  variant = "primary",
4857
5097
  color = "primary"
4858
5098
  }) {
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);
5099
+ const [isOpen, setIsOpen] = (0, import_react25.useState)(false);
5100
+ const [inputValue, setInputValue] = (0, import_react25.useState)(value || "");
5101
+ const [isValidTime, setIsValidTime] = (0, import_react25.useState)(true);
5102
+ const wrapperRef = (0, import_react25.useRef)(null);
5103
+ const hoursRef = (0, import_react25.useRef)(null);
5104
+ const minutesRef = (0, import_react25.useRef)(null);
4865
5105
  const { panelRef: dropdownRef, style: panelStyle } = useFloatingPanel(
4866
5106
  wrapperRef,
4867
5107
  isOpen && !disabled,
@@ -4875,7 +5115,7 @@ function ITTimePicker({
4875
5115
  const isThemeColor = color in theme.colors;
4876
5116
  const highlightColor = isThemeColor ? theme.colors[color][50] : "#f3f4f6";
4877
5117
  const activeColor = isThemeColor ? theme.colors[color][100] : "#e5e7eb";
4878
- (0, import_react23.useEffect)(() => {
5118
+ (0, import_react25.useEffect)(() => {
4879
5119
  setInputValue(value || "");
4880
5120
  }, [value]);
4881
5121
  const validateTime = (timeString) => {
@@ -4884,7 +5124,7 @@ function ITTimePicker({
4884
5124
  };
4885
5125
  const currentHour = validateTime(inputValue) ? inputValue.split(":")[0] : null;
4886
5126
  const currentMinute = validateTime(inputValue) ? inputValue.split(":")[1] : null;
4887
- (0, import_react23.useEffect)(() => {
5127
+ (0, import_react25.useEffect)(() => {
4888
5128
  if (isOpen) {
4889
5129
  setTimeout(() => {
4890
5130
  if (hoursRef.current && currentHour) {
@@ -5090,7 +5330,7 @@ function ITTimePicker({
5090
5330
  }
5091
5331
 
5092
5332
  // src/components/molecules/search-select/search-select.tsx
5093
- var import_react24 = require("react");
5333
+ var import_react26 = require("react");
5094
5334
  var import_react_dom6 = require("react-dom");
5095
5335
  var import_clsx28 = __toESM(require("clsx"), 1);
5096
5336
  var import_fa18 = require("react-icons/fa");
@@ -5119,26 +5359,26 @@ function ITSearchSelect({
5119
5359
  clearable = true,
5120
5360
  onClear
5121
5361
  }) {
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);
5362
+ const [isOpen, setIsOpen] = (0, import_react26.useState)(false);
5363
+ const [searchTerm, setSearchTerm] = (0, import_react26.useState)("");
5364
+ const [isFocused, setIsFocused] = (0, import_react26.useState)(false);
5365
+ const [localTouched, setLocalTouched] = (0, import_react26.useState)(false);
5366
+ const containerRef = (0, import_react26.useRef)(null);
5367
+ const inputWrapperRef = (0, import_react26.useRef)(null);
5368
+ const timeoutRef = (0, import_react26.useRef)(null);
5129
5369
  const { panelRef, style: panelStyle } = useFloatingPanel(inputWrapperRef, isOpen, {
5130
5370
  estimatedHeight: 260,
5131
5371
  matchWidth: true
5132
5372
  });
5133
- const selectedOption = (0, import_react24.useMemo)(() => {
5373
+ const selectedOption = (0, import_react26.useMemo)(() => {
5134
5374
  return options.find((opt) => opt[valueField] === value);
5135
5375
  }, [options, value, valueField]);
5136
- (0, import_react24.useEffect)(() => {
5376
+ (0, import_react26.useEffect)(() => {
5137
5377
  if (!isFocused) {
5138
5378
  setSearchTerm(selectedOption ? String(selectedOption[labelField]) : "");
5139
5379
  }
5140
5380
  }, [selectedOption, isFocused, labelField]);
5141
- (0, import_react24.useEffect)(() => {
5381
+ (0, import_react26.useEffect)(() => {
5142
5382
  function handleClickOutside(event) {
5143
5383
  const target = event.target;
5144
5384
  const inContainer = containerRef.current?.contains(target);
@@ -5151,7 +5391,7 @@ function ITSearchSelect({
5151
5391
  return () => document.removeEventListener("mousedown", handleClickOutside);
5152
5392
  }, []);
5153
5393
  const selectedLabel = selectedOption ? String(selectedOption[labelField]) : "";
5154
- const filteredOptions = (0, import_react24.useMemo)(() => {
5394
+ const filteredOptions = (0, import_react26.useMemo)(() => {
5155
5395
  if (onSearch) return options;
5156
5396
  if (!searchTerm || !isFocused || searchTerm === selectedLabel) return options;
5157
5397
  return options.filter(
@@ -5320,26 +5560,26 @@ function ITSearchSelect({
5320
5560
  }
5321
5561
 
5322
5562
  // src/components/organisms/form-builder/useFormBuilder.ts
5323
- var import_react25 = require("react");
5563
+ var import_react27 = require("react");
5324
5564
  var useFieldRules = (config2, dependentValues) => {
5325
5565
  const { getFieldConfig } = useITFormBuilderContext();
5326
5566
  const fieldConfig = getFieldConfig(config2.name) || config2;
5327
- const isVisible = (0, import_react25.useMemo)(() => {
5567
+ const isVisible = (0, import_react27.useMemo)(() => {
5328
5568
  if (!fieldConfig.renderWhen) return true;
5329
5569
  return fieldConfig.renderWhen(dependentValues);
5330
5570
  }, [fieldConfig, dependentValues]);
5331
- const dynamicProps = (0, import_react25.useMemo)(() => {
5571
+ const dynamicProps = (0, import_react27.useMemo)(() => {
5332
5572
  if (!fieldConfig.dynamicProps) return {};
5333
5573
  return fieldConfig.dynamicProps(dependentValues);
5334
5574
  }, [fieldConfig, dependentValues]);
5335
- const isRequired = (0, import_react25.useMemo)(() => {
5575
+ const isRequired = (0, import_react27.useMemo)(() => {
5336
5576
  if (typeof dynamicProps.required !== "undefined") return dynamicProps.required;
5337
5577
  if (typeof fieldConfig.required === "function") {
5338
5578
  return fieldConfig.required(dependentValues);
5339
5579
  }
5340
5580
  return !!fieldConfig.required;
5341
5581
  }, [fieldConfig, dynamicProps.required, dependentValues]);
5342
- const isDisabled = (0, import_react25.useMemo)(() => {
5582
+ const isDisabled = (0, import_react27.useMemo)(() => {
5343
5583
  if (typeof dynamicProps.disabled !== "undefined") return dynamicProps.disabled;
5344
5584
  if (typeof fieldConfig.disabled === "function") {
5345
5585
  return fieldConfig.disabled(dependentValues);
@@ -5353,11 +5593,11 @@ var useFieldRules = (config2, dependentValues) => {
5353
5593
  var import_fa19 = require("react-icons/fa");
5354
5594
  var import_jsx_runtime32 = require("react/jsx-runtime");
5355
5595
  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);
5596
+ const [resolved, setResolved] = (0, import_react28.useState)([]);
5597
+ const [loading, setLoading] = (0, import_react28.useState)(false);
5598
+ const optionsRef = (0, import_react28.useRef)(options);
5359
5599
  optionsRef.current = options;
5360
- (0, import_react26.useEffect)(() => {
5600
+ (0, import_react28.useEffect)(() => {
5361
5601
  const opts = optionsRef.current;
5362
5602
  let cancelled = false;
5363
5603
  if (typeof opts === "function") {
@@ -5400,13 +5640,13 @@ var ITFieldRenderer = ({
5400
5640
  config2,
5401
5641
  dependentValues
5402
5642
  );
5403
- (0, import_react26.useEffect)(() => {
5643
+ (0, import_react28.useEffect)(() => {
5404
5644
  context.registerField(config2.name, config2);
5405
5645
  return () => {
5406
5646
  context.unregisterField(config2.name);
5407
5647
  };
5408
5648
  }, [config2.name]);
5409
- const activeConfig = (0, import_react26.useMemo)(
5649
+ const activeConfig = (0, import_react28.useMemo)(
5410
5650
  () => ({
5411
5651
  ...config2,
5412
5652
  ...dynamicProps,
@@ -5432,7 +5672,7 @@ var ITFieldRenderer = ({
5432
5672
  options,
5433
5673
  [options, dependentValues]
5434
5674
  );
5435
- const handleChangeWrapper = (0, import_react26.useCallback)(
5675
+ const handleChangeWrapper = (0, import_react28.useCallback)(
5436
5676
  async (val) => {
5437
5677
  const finalValue = val && typeof val === "object" && "target" in val ? val.target.value : val;
5438
5678
  await context.setFieldValue(name, finalValue);
@@ -5646,7 +5886,7 @@ var ITFieldRenderer = ({
5646
5886
  }
5647
5887
  );
5648
5888
  };
5649
- var fieldRenderer_default = (0, import_react26.memo)(ITFieldRenderer);
5889
+ var fieldRenderer_default = (0, import_react28.memo)(ITFieldRenderer);
5650
5890
 
5651
5891
  // src/components/organisms/form-builder/formBuilder.tsx
5652
5892
  var import_jsx_runtime33 = require("react/jsx-runtime");
@@ -5677,7 +5917,7 @@ function ITFormBuilder({
5677
5917
  isSubmitting = false,
5678
5918
  children
5679
5919
  }) {
5680
- const providerValue = (0, import_react27.useMemo)(
5920
+ const providerValue = (0, import_react29.useMemo)(
5681
5921
  () => ({
5682
5922
  config: config2 || [],
5683
5923
  values: values || {},
@@ -5894,7 +6134,7 @@ function ITGrid({
5894
6134
  }
5895
6135
 
5896
6136
  // src/components/atoms/image/image.tsx
5897
- var import_react28 = require("react");
6137
+ var import_react30 = require("react");
5898
6138
  var import_jsx_runtime35 = require("react/jsx-runtime");
5899
6139
  var ITImage = ({
5900
6140
  src,
@@ -5902,7 +6142,7 @@ var ITImage = ({
5902
6142
  className = "",
5903
6143
  fallback = ""
5904
6144
  }) => {
5905
- const [imageError, setImageError] = (0, import_react28.useState)(false);
6145
+ const [imageError, setImageError] = (0, import_react30.useState)(false);
5906
6146
  const handleImageError = () => {
5907
6147
  setImageError(true);
5908
6148
  };
@@ -5932,7 +6172,7 @@ var ITImage = ({
5932
6172
  var image_default = ITImage;
5933
6173
 
5934
6174
  // src/components/organisms/navbar/navbar.tsx
5935
- var import_react29 = require("react");
6175
+ var import_react31 = require("react");
5936
6176
  var import_fa20 = require("react-icons/fa");
5937
6177
  var import_jsx_runtime36 = require("react/jsx-runtime");
5938
6178
  function ITNavbar({
@@ -5947,9 +6187,9 @@ function ITNavbar({
5947
6187
  showSidebarOnMobile = false,
5948
6188
  sidebarItems
5949
6189
  }) {
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);
6190
+ const [isUserMenuOpen, setIsUserMenuOpen] = (0, import_react31.useState)(false);
6191
+ const [expandedItems, setExpandedItems] = (0, import_react31.useState)(/* @__PURE__ */ new Set());
6192
+ const userMenuRef = (0, import_react31.useRef)(null);
5953
6193
  useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
5954
6194
  const toggleUserMenu = () => {
5955
6195
  setIsUserMenuOpen(!isUserMenuOpen);
@@ -6290,7 +6530,7 @@ function ITSkeleton({
6290
6530
 
6291
6531
  // src/components/atoms/stack/stack.tsx
6292
6532
  var import_clsx32 = __toESM(require("clsx"), 1);
6293
- var import_react30 = require("react");
6533
+ var import_react32 = require("react");
6294
6534
  var import_jsx_runtime39 = require("react/jsx-runtime");
6295
6535
  var directionMap2 = {
6296
6536
  row: "flex-row",
@@ -6331,7 +6571,7 @@ function ITStack({
6331
6571
  as: Component = "div"
6332
6572
  }) {
6333
6573
  const hasDivider = divider !== void 0;
6334
- const items = import_react30.Children.toArray(children);
6574
+ const items = import_react32.Children.toArray(children);
6335
6575
  const resolvedStyle = {
6336
6576
  gap: spacing > 0 ? `${spacing * 0.25}rem` : void 0,
6337
6577
  ...style
@@ -6348,9 +6588,9 @@ function ITStack({
6348
6588
  className
6349
6589
  ),
6350
6590
  style: resolvedStyle,
6351
- children: hasDivider ? items.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_react30.Fragment, { children: [
6591
+ children: hasDivider ? items.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_react32.Fragment, { children: [
6352
6592
  child,
6353
- index < items.length - 1 && (0, import_react30.isValidElement)(divider) ? (0, import_react30.cloneElement)(divider, { key: `divider-${index}` }) : null
6593
+ index < items.length - 1 && (0, import_react32.isValidElement)(divider) ? (0, import_react32.cloneElement)(divider, { key: `divider-${index}` }) : null
6354
6594
  ] }, index)) : children
6355
6595
  }
6356
6596
  );
@@ -6388,11 +6628,13 @@ function ITPage(props) {
6388
6628
  className,
6389
6629
  children,
6390
6630
  maxWidth = "7xl",
6391
- noPadding = false
6631
+ noPadding = false,
6632
+ horizontalPadding = "px-4 sm:px-6 lg:px-8"
6392
6633
  } = props;
6393
6634
  const wrapperClass = (0, import_clsx33.default)(
6394
6635
  "mx-auto w-full",
6395
- !noPadding && "px-4 sm:px-6 lg:px-8 py-6",
6636
+ !noPadding && horizontalPadding,
6637
+ !noPadding && "py-6",
6396
6638
  `max-w-${maxWidth}`,
6397
6639
  "space-y-8",
6398
6640
  className
@@ -6447,7 +6689,7 @@ function ITPage(props) {
6447
6689
  }
6448
6690
 
6449
6691
  // src/components/atoms/popover/popover.tsx
6450
- var import_react31 = require("react");
6692
+ var import_react33 = require("react");
6451
6693
  var import_clsx34 = __toESM(require("clsx"), 1);
6452
6694
  var import_jsx_runtime41 = require("react/jsx-runtime");
6453
6695
  var positionClasses = {
@@ -6464,10 +6706,10 @@ function ITPopover({
6464
6706
  onClose,
6465
6707
  className
6466
6708
  }) {
6467
- const [internalOpen, setInternalOpen] = (0, import_react31.useState)(false);
6709
+ const [internalOpen, setInternalOpen] = (0, import_react33.useState)(false);
6468
6710
  const isControlled = controlledOpen !== void 0;
6469
6711
  const open = isControlled ? controlledOpen : internalOpen;
6470
- const ref = (0, import_react31.useRef)(null);
6712
+ const ref = (0, import_react33.useRef)(null);
6471
6713
  useClickOutside_default(ref, () => {
6472
6714
  if (isControlled) onClose?.();
6473
6715
  else setInternalOpen(false);
@@ -6595,7 +6837,7 @@ function ITRadioGroup({
6595
6837
 
6596
6838
  // src/components/organisms/searchTable/searchTable.tsx
6597
6839
  var import_clsx38 = __toESM(require("clsx"), 1);
6598
- var import_react32 = require("react");
6840
+ var import_react34 = require("react");
6599
6841
 
6600
6842
  // src/components/organisms/searchTable/components/SearchInput.tsx
6601
6843
  var import_fa22 = require("react-icons/fa");
@@ -7088,7 +7330,7 @@ function ITSearchTable({
7088
7330
  onSave,
7089
7331
  onCancel
7090
7332
  }) {
7091
- const [itemsPerPage, setItemsPerPage] = (0, import_react32.useState)(defaultItemsPerPage);
7333
+ const [itemsPerPage, setItemsPerPage] = (0, import_react34.useState)(defaultItemsPerPage);
7092
7334
  const { searchTerm, handleSearchChange, handleClearSearch } = useDebouncedSearch({
7093
7335
  initialValue: searchTermInitial,
7094
7336
  onSearch: (value) => {
@@ -7251,7 +7493,7 @@ function ITSegmentedControl({
7251
7493
  }
7252
7494
 
7253
7495
  // src/components/organisms/sidebar/sidebar.tsx
7254
- var import_react33 = require("react");
7496
+ var import_react35 = require("react");
7255
7497
  var import_fa26 = require("react-icons/fa");
7256
7498
  var import_jsx_runtime56 = require("react/jsx-runtime");
7257
7499
  function ITSidebar({
@@ -7261,14 +7503,15 @@ function ITSidebar({
7261
7503
  visibleOnMobile = false,
7262
7504
  onItemClick,
7263
7505
  onSubItemClick,
7264
- subitemConnector = "dot"
7506
+ subitemConnector = "dot",
7507
+ header
7265
7508
  }) {
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)(() => {
7509
+ const [expandedItems, setExpandedItems] = (0, import_react35.useState)(/* @__PURE__ */ new Set());
7510
+ const [isHovering, setIsHovering] = (0, import_react35.useState)(false);
7511
+ const sidebarRef = (0, import_react35.useRef)(null);
7512
+ const hoverTimeoutRef = (0, import_react35.useRef)(null);
7513
+ const leaveTimeoutRef = (0, import_react35.useRef)(null);
7514
+ (0, import_react35.useEffect)(() => {
7272
7515
  const hoverTimer = hoverTimeoutRef.current;
7273
7516
  const leaveTimer = leaveTimeoutRef.current;
7274
7517
  const handleMouseEnter = () => {
@@ -7295,7 +7538,7 @@ function ITSidebar({
7295
7538
  if (leaveTimer) clearTimeout(leaveTimer);
7296
7539
  };
7297
7540
  }, [isCollapsed]);
7298
- (0, import_react33.useEffect)(() => {
7541
+ (0, import_react35.useEffect)(() => {
7299
7542
  const activeParents = /* @__PURE__ */ new Set();
7300
7543
  navigationItems.forEach((item) => {
7301
7544
  if (item.subitems && item.subitems.some((sub) => sub.isActive)) {
@@ -7332,7 +7575,7 @@ function ITSidebar({
7332
7575
  };
7333
7576
  const isSidebarCollapsed = visibleOnMobile ? false : !isHovering && isCollapsed;
7334
7577
  const sidebarWidth = isSidebarCollapsed ? "w-[88px]" : "w-[280px]";
7335
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7578
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
7336
7579
  "aside",
7337
7580
  {
7338
7581
  ref: sidebarRef,
@@ -7351,196 +7594,215 @@ function ITSidebar({
7351
7594
  WebkitBackdropFilter: "blur(12px)",
7352
7595
  backdropFilter: "blur(12px)"
7353
7596
  },
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
7597
+ children: [
7598
+ header && !isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "px-4 pt-4 pb-1 flex-shrink-0", children: header }),
7599
+ /* @__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) => {
7600
+ const hasSubmenu = !!item.subitems && item.subitems.length > 0;
7601
+ const submenuId = `it-sidebar-submenu-${item.id}`;
7602
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("li", { className: "relative group/navitem", children: [
7603
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
7604
+ "div",
7605
+ {
7606
+ role: "button",
7607
+ tabIndex: 0,
7608
+ "aria-label": item.label,
7609
+ "aria-expanded": hasSubmenu ? expandedItems.has(item.id) : void 0,
7610
+ "aria-controls": hasSubmenu ? submenuId : void 0,
7611
+ className: `flex items-center cursor-pointer
7359
7612
  transition-all duration-300 ease-[cubic-bezier(0.2,0,0,1)]
7360
7613
  rounded-xl relative overflow-visible
7361
7614
  ${isSidebarCollapsed ? "justify-center p-2 mb-1" : "justify-between px-3 py-2 mb-0.5"}
7362
7615
  `,
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
7616
  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"
7617
+ backgroundColor: item.isActive ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
7618
+ boxShadow: item.isActive ? "var(--shadow-xs)" : "none",
7619
+ border: item.isActive ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "1px solid transparent"
7498
7620
  },
7499
7621
  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
- }
7622
+ if (!item.isActive) e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
7504
7623
  },
7505
7624
  onMouseLeave: (e) => {
7506
- if (!subitem.isActive) {
7507
- e.currentTarget.style.backgroundColor = "transparent";
7508
- e.currentTarget.style.transform = "translateX(0)";
7625
+ if (!item.isActive) e.currentTarget.style.backgroundColor = "transparent";
7626
+ },
7627
+ onClick: () => handleItemClick(item),
7628
+ onKeyDown: (e) => {
7629
+ if (e.key === "Enter" || e.key === " ") {
7630
+ e.preventDefault();
7631
+ handleItemClick(item);
7509
7632
  }
7510
7633
  },
7511
7634
  children: [
7512
- subitem.isActive && subitemConnector === "|" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7635
+ item.isActive && !isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7513
7636
  "div",
7514
7637
  {
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)"
7638
+ className: "absolute left-0 top-1/4 bottom-1/4 w-[3px] rounded-r-full transition-all",
7639
+ style: { backgroundColor: "var(--it-sidebar-active-icon, var(--color-primary-500))", boxShadow: "0 0 10px var(--it-sidebar-active-icon, var(--color-primary-500))" }
7640
+ }
7641
+ ),
7642
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: `flex items-center ${!isSidebarCollapsed ? "gap-2.5" : "justify-center"} relative z-10 w-full`, children: [
7643
+ item.icon && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7644
+ "div",
7645
+ {
7646
+ className: `transition-all duration-300 flex-shrink-0 flex items-center justify-center`,
7647
+ style: {
7648
+ color: item.isActive ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, #9ca3af)",
7649
+ opacity: item.isActive ? 1 : 0.8,
7650
+ fontSize: item.isActive ? "1.12rem" : "1.05rem",
7651
+ filter: item.isActive ? "drop-shadow(0 0 8px rgba(255,255,255,0.2))" : "none"
7652
+ },
7653
+ children: item.icon
7519
7654
  }
7655
+ ),
7656
+ !isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7657
+ ITText,
7658
+ {
7659
+ as: "span",
7660
+ className: `transition-all duration-300 truncate tracking-wide`,
7661
+ style: {
7662
+ color: item.isActive ? "var(--it-sidebar-active-color, #ffffff)" : "var(--it-sidebar-label-color, var(--color-secondary-300))",
7663
+ fontSize: "0.8rem",
7664
+ fontWeight: item.isActive ? "600" : "500"
7665
+ },
7666
+ children: item.label
7667
+ }
7668
+ )
7669
+ ] }),
7670
+ !isSidebarCollapsed && item.subitems && item.subitems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7671
+ "div",
7672
+ {
7673
+ className: `flex-shrink-0 transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)] ${expandedItems.has(item.id) ? "rotate-180" : ""}`,
7674
+ 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 },
7675
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_fa26.FaChevronDown, { className: "w-3 h-3" })
7520
7676
  }
7521
7677
  ),
7522
- subitemConnector === "dot" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7678
+ item.badge && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7523
7679
  "span",
7524
7680
  {
7525
- className: `w-1.5 h-1.5 rounded-full flex-shrink-0 transition-all duration-300 ${subitem.isActive ? "scale-125" : ""}`,
7681
+ className: `
7682
+ absolute flex items-center justify-center font-bold shadow-md
7683
+ ${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"}
7684
+ `,
7526
7685
  style: {
7527
- backgroundColor: subitem.isActive ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, var(--color-secondary-400))"
7528
- }
7686
+ backgroundColor: "var(--it-sidebar-badge-bg, var(--color-primary-500))",
7687
+ color: "var(--it-sidebar-badge-color, #ffffff)",
7688
+ boxShadow: isSidebarCollapsed ? "0 0 0 2px var(--it-sidebar-bg, var(--color-secondary-900))" : "none"
7689
+ },
7690
+ children: isSidebarCollapsed ? "" : item.badge
7529
7691
  }
7530
- ),
7531
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ITText, { as: "span", className: "truncate", children: subitem.label })
7692
+ )
7532
7693
  ]
7533
7694
  }
7534
- ) }, subitem.id))
7535
- }
7536
- ) })
7537
- ] }, item.id)) }) })
7695
+ ),
7696
+ isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
7697
+ "div",
7698
+ {
7699
+ 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)]",
7700
+ style: {
7701
+ backgroundColor: "var(--it-sidebar-bg, #ffffff)",
7702
+ border: "1px solid var(--it-sidebar-border, var(--color-secondary-200))",
7703
+ WebkitBackdropFilter: "blur(16px)",
7704
+ backdropFilter: "blur(16px)"
7705
+ },
7706
+ children: [
7707
+ /* @__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: [
7708
+ 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 }),
7709
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ITText, { as: "span", className: "tracking-wide text-[15px]", children: item.label })
7710
+ ] }),
7711
+ 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)(
7712
+ "div",
7713
+ {
7714
+ className: `px-5 py-2.5 text-sm flex items-center gap-3 transition-colors relative`,
7715
+ children: [
7716
+ subitem.isActive && subitemConnector === "|" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7717
+ "div",
7718
+ {
7719
+ className: "absolute left-0 top-1/3 bottom-1/3 w-[2.5px] rounded-r-full",
7720
+ style: {
7721
+ backgroundColor: "var(--it-sidebar-active-icon, var(--color-primary-500))",
7722
+ boxShadow: "0 0 6px color-mix(in srgb, var(--it-sidebar-active-icon, var(--color-primary-500)) 25%, transparent)"
7723
+ }
7724
+ }
7725
+ ),
7726
+ /* @__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))" } }),
7727
+ /* @__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 })
7728
+ ]
7729
+ },
7730
+ subitem.id
7731
+ )) }) : /* @__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" })
7732
+ ]
7733
+ }
7734
+ ),
7735
+ !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)(
7736
+ "ul",
7737
+ {
7738
+ className: "ml-4 flex flex-col gap-0 py-0.5",
7739
+ style: {
7740
+ borderLeft: subitemConnector === "|" ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "none"
7741
+ },
7742
+ children: item.subitems.map((subitem) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("li", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
7743
+ "button",
7744
+ {
7745
+ "aria-current": subitem.isActive ? "page" : void 0,
7746
+ onClick: () => {
7747
+ if (subitem.action) subitem.action();
7748
+ if (onSubItemClick) onSubItemClick(subitem);
7749
+ },
7750
+ className: `flex items-center gap-2 w-full text-left px-3 py-1.5 rounded-xl transition-all duration-300`,
7751
+ style: {
7752
+ color: subitem.isActive ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-label-color, var(--color-secondary-600))",
7753
+ backgroundColor: subitem.isActive ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
7754
+ fontSize: "0.78rem",
7755
+ fontWeight: subitem.isActive ? 600 : 500,
7756
+ letterSpacing: "0.01em",
7757
+ marginLeft: subitemConnector === "|" ? "-1px" : "0"
7758
+ },
7759
+ onMouseEnter: (e) => {
7760
+ if (!subitem.isActive) {
7761
+ e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
7762
+ e.currentTarget.style.transform = "translateX(3px)";
7763
+ }
7764
+ },
7765
+ onMouseLeave: (e) => {
7766
+ if (!subitem.isActive) {
7767
+ e.currentTarget.style.backgroundColor = "transparent";
7768
+ e.currentTarget.style.transform = "translateX(0)";
7769
+ }
7770
+ },
7771
+ children: [
7772
+ subitem.isActive && subitemConnector === "|" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7773
+ "div",
7774
+ {
7775
+ className: "absolute left-0 top-1/3 bottom-1/3 w-[2.5px] rounded-r-full transition-all",
7776
+ style: {
7777
+ backgroundColor: "var(--it-sidebar-active-icon, var(--color-primary-500))",
7778
+ boxShadow: "0 0 6px color-mix(in srgb, var(--it-sidebar-active-icon, var(--color-primary-500)) 25%, transparent)"
7779
+ }
7780
+ }
7781
+ ),
7782
+ subitemConnector === "dot" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7783
+ "span",
7784
+ {
7785
+ className: `w-1.5 h-1.5 rounded-full flex-shrink-0 transition-all duration-300 ${subitem.isActive ? "scale-125" : ""}`,
7786
+ style: {
7787
+ backgroundColor: subitem.isActive ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, var(--color-secondary-400))"
7788
+ }
7789
+ }
7790
+ ),
7791
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ITText, { as: "span", className: "truncate", children: subitem.label })
7792
+ ]
7793
+ }
7794
+ ) }, subitem.id))
7795
+ }
7796
+ ) })
7797
+ ] }, item.id);
7798
+ }) }) })
7799
+ ]
7538
7800
  }
7539
7801
  );
7540
7802
  }
7541
7803
 
7542
7804
  // src/components/atoms/slide/slide.tsx
7543
- var import_react34 = require("react");
7805
+ var import_react36 = require("react");
7544
7806
  var import_clsx40 = __toESM(require("clsx"), 1);
7545
7807
  var import_jsx_runtime57 = require("react/jsx-runtime");
7546
7808
  function ITSlideToggle({
@@ -7555,8 +7817,8 @@ function ITSlideToggle({
7555
7817
  className = ""
7556
7818
  }) {
7557
7819
  const isControlled = controlledIsOn !== void 0;
7558
- const [internalIsOn, setInternalIsOn] = (0, import_react34.useState)(initialState);
7559
- (0, import_react34.useEffect)(() => {
7820
+ const [internalIsOn, setInternalIsOn] = (0, import_react36.useState)(initialState);
7821
+ (0, import_react36.useEffect)(() => {
7560
7822
  if (isControlled) {
7561
7823
  setInternalIsOn(controlledIsOn);
7562
7824
  }
@@ -7720,7 +7982,7 @@ function ITStatCard({
7720
7982
 
7721
7983
  // src/components/molecules/table/table.tsx
7722
7984
  var import_clsx43 = __toESM(require("clsx"), 1);
7723
- var import_react35 = __toESM(require("react"), 1);
7985
+ var import_react37 = __toESM(require("react"), 1);
7724
7986
  var import_fa27 = require("react-icons/fa");
7725
7987
  var import_md2 = require("react-icons/md");
7726
7988
  var import_jsx_runtime60 = require("react/jsx-runtime");
@@ -7736,9 +7998,24 @@ function ITTable({
7736
7998
  renderCard,
7737
7999
  defaultView = "table",
7738
8000
  showVerticalBorder = true,
7739
- verticalBorderClassname
8001
+ verticalBorderClassname,
8002
+ onRowClick,
8003
+ layout = "auto",
8004
+ density = "normal",
8005
+ autoCardBreakpoint = 0,
8006
+ virtualized = false,
8007
+ virtualizedMaxHeight = 400,
8008
+ rowHeight,
8009
+ overscan = 5,
8010
+ stickyHeader = false
7740
8011
  }) {
7741
- const [viewMode, setViewMode] = (0, import_react35.useState)(defaultView);
8012
+ const [viewMode, setViewMode] = (0, import_react37.useState)(defaultView);
8013
+ const { ref: rootRef, width: containerWidth } = useElementSize();
8014
+ const isFixed = layout === "fixed";
8015
+ const forcedCards = autoCardBreakpoint > 0 && containerWidth > 0 && containerWidth < autoCardBreakpoint;
8016
+ const effectiveView = forcedCards ? "cards" : viewMode;
8017
+ const hasColumnWidths = columns.some((col) => col.width != null);
8018
+ 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
8019
  const {
7743
8020
  currentPage,
7744
8021
  itemsPerPage,
@@ -7749,7 +8026,7 @@ function ITTable({
7749
8026
  handleSort,
7750
8027
  handleItemsPerPageChange
7751
8028
  } = useTableState({ defaultItemsPerPage });
7752
- const sortedData = import_react35.default.useMemo(() => {
8029
+ const sortedData = import_react37.default.useMemo(() => {
7753
8030
  const safeData = Array.isArray(data) ? data : [];
7754
8031
  if (!sortConfig) return safeData;
7755
8032
  return [...safeData].sort((a, b) => {
@@ -7818,6 +8095,24 @@ function ITTable({
7818
8095
  (currentPage - 1) * itemsPerPage,
7819
8096
  currentPage * itemsPerPage
7820
8097
  );
8098
+ const isTableVirtual = virtualized && effectiveView === "table";
8099
+ const isStickyHeader = stickyHeader && isTableVirtual;
8100
+ const resolvedRowHeight = rowHeight ?? getRowHeight(size, density);
8101
+ const columnCount = columns.length;
8102
+ const {
8103
+ scrollRef,
8104
+ startIndex,
8105
+ endIndex,
8106
+ topSpacerHeight,
8107
+ bottomSpacerHeight
8108
+ } = useVirtualRows({
8109
+ count: currentData.length,
8110
+ rowHeight: resolvedRowHeight,
8111
+ overscan,
8112
+ enabled: isTableVirtual,
8113
+ resetKey: `${currentPage}-${itemsPerPage}`
8114
+ });
8115
+ const windowData = isTableVirtual ? currentData.slice(startIndex, endIndex + 1) : currentData;
7821
8116
  const renderFilterInput = (col) => {
7822
8117
  if (!col.filter) return null;
7823
8118
  if (col.type === "boolean") {
@@ -7949,7 +8244,18 @@ function ITTable({
7949
8244
  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
8245
  ] });
7951
8246
  };
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: [
8247
+ const handleRowClick = (row) => (event) => {
8248
+ if (!onRowClick || isInteractiveTarget(event.target, event.currentTarget)) return;
8249
+ onRowClick(row, event);
8250
+ };
8251
+ const handleRowKeyDown = (row) => (event) => {
8252
+ if (!onRowClick) return;
8253
+ if (event.target !== event.currentTarget) return;
8254
+ if (event.key !== "Enter" && event.key !== " ") return;
8255
+ event.preventDefault();
8256
+ onRowClick(row, event);
8257
+ };
8258
+ 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
8259
  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
8260
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ITText, { as: "h2", className: "text-xl font-bold text-secondary-900 leading-tight", children: title }),
7955
8261
  /* @__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 +8263,8 @@ function ITTable({
7957
8263
  "button",
7958
8264
  {
7959
8265
  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"}`,
8266
+ disabled: forcedCards,
8267
+ 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
8268
  children: [
7962
8269
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_fa27.FaTable, { size: 11 }),
7963
8270
  "Table"
@@ -7968,7 +8275,7 @@ function ITTable({
7968
8275
  "button",
7969
8276
  {
7970
8277
  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"}`,
8278
+ 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
8279
  children: [
7973
8280
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_fa27.FaThLarge, { size: 11 }),
7974
8281
  "Cards"
@@ -7982,7 +8289,8 @@ function ITTable({
7982
8289
  "button",
7983
8290
  {
7984
8291
  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"}`,
8292
+ disabled: forcedCards,
8293
+ 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
8294
  children: [
7987
8295
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_fa27.FaTable, { size: 11 }),
7988
8296
  "Table"
@@ -7993,7 +8301,7 @@ function ITTable({
7993
8301
  "button",
7994
8302
  {
7995
8303
  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"}`,
8304
+ 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
8305
  children: [
7998
8306
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_fa27.FaThLarge, { size: 11 }),
7999
8307
  "Cards"
@@ -8001,64 +8309,131 @@ function ITTable({
8001
8309
  }
8002
8310
  )
8003
8311
  ] }) }),
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: [
8312
+ 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)(
8313
+ "div",
8314
+ {
8315
+ className: (0, import_clsx43.default)(onRowClick && tableCardClickable),
8316
+ role: onRowClick ? "button" : void 0,
8317
+ tabIndex: onRowClick ? 0 : void 0,
8318
+ onClick: onRowClick ? handleRowClick(row) : void 0,
8319
+ onKeyDown: onRowClick ? handleRowKeyDown(row) : void 0,
8320
+ children: renderCard ? renderCard(row) : renderDefaultCard(row)
8321
+ },
8322
+ i
8323
+ )) : /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: (0, import_clsx43.default)(tableEmptyContent, "py-12"), children: [
8005
8324
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
8006
8325
  /* @__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",
8326
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8327
+ "div",
8009
8328
  {
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",
8329
+ ref: isTableVirtual ? scrollRef : void 0,
8330
+ className: isTableVirtual ? "overflow-x-auto overflow-y-auto" : "overflow-x-auto",
8331
+ style: isTableVirtual ? { maxHeight: virtualizedMaxHeight } : void 0,
8332
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
8333
+ "table",
8334
+ {
8335
+ className: (0, import_clsx43.default)(
8336
+ tableLayoutClass,
8337
+ showVerticalBorder && "[&_th]:border-r [&_th:last-child]:border-r-0 [&_td]:border-r [&_td:last-child]:border-r-0",
8338
+ showVerticalBorder && (verticalBorderClassname || "[&_th]:border-slate-100 dark:[&_th]:border-slate-700/30 [&_td]:border-slate-100 dark:[&_td]:border-slate-700/30"),
8339
+ variantStyles[variant],
8340
+ sizeStyles[size]
8341
+ ),
8342
+ style: isFixed ? { tableLayout: "fixed" } : void 0,
8343
+ "aria-rowcount": isTableVirtual ? currentData.length + 1 : void 0,
8344
+ children: [
8345
+ hasColumnWidths && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("colgroup", { children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8346
+ "col",
8047
8347
  {
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) })
8348
+ style: col.width != null ? { width: typeof col.width === "number" ? `${col.width}px` : col.width } : void 0
8050
8349
  },
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
- ]
8350
+ col.key
8351
+ )) }),
8352
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8353
+ "tr",
8354
+ {
8355
+ className: (0, import_clsx43.default)(tableHeaderRow, "dark:text-slate-200"),
8356
+ "aria-rowindex": isTableVirtual ? 1 : void 0,
8357
+ children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8358
+ "th",
8359
+ {
8360
+ scope: "col",
8361
+ className: (0, import_clsx43.default)(
8362
+ tableHeaderCell(col.className, density),
8363
+ col.align && tableAlignClasses[col.align],
8364
+ isStickyHeader && "sticky top-0 z-10 bg-secondary-50"
8365
+ ),
8366
+ style: col.minWidth != null || isStickyHeader ? {
8367
+ ...col.minWidth != null ? { minWidth: `${col.minWidth}px` } : {},
8368
+ ...isStickyHeader ? { backgroundColor: "var(--color-table-headerBg, #f8fafc)" } : {}
8369
+ } : void 0,
8370
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: isFixed ? "flex flex-col gap-3" : "flex flex-col gap-3 min-w-[150px]", children: [
8371
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
8372
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ITText, { as: "span", className: "text-slate-900 dark:text-white font-bold", children: col.label }),
8373
+ col.sortable && col.type !== "actions" && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8374
+ "button",
8375
+ {
8376
+ onClick: () => handleSort(col.key),
8377
+ 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"}`,
8378
+ title: `Ordenar por ${col.label}`,
8379
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_md2.MdOutlineSwapVert, { className: "w-4 h-4", "aria-hidden": "true" })
8380
+ }
8381
+ )
8382
+ ] }),
8383
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "w-full", children: col.filter ? renderFilterInput(col) : null })
8384
+ ] })
8385
+ },
8386
+ col.key
8387
+ ))
8388
+ }
8389
+ ) }),
8390
+ /* @__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: [
8391
+ 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 } }) }),
8392
+ windowData.map((row, windowIndex) => {
8393
+ const absoluteIndex = isTableVirtual ? startIndex + windowIndex : windowIndex;
8394
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8395
+ "tr",
8396
+ {
8397
+ "aria-rowindex": isTableVirtual ? absoluteIndex + 2 : void 0,
8398
+ className: (0, import_clsx43.default)(
8399
+ tableRow,
8400
+ variant === "striped" && absoluteIndex % 2 === 0 && "bg-secondary-50/40 dark:bg-slate-800/20",
8401
+ onRowClick && tableRowClickable
8402
+ ),
8403
+ tabIndex: onRowClick ? 0 : void 0,
8404
+ onClick: onRowClick ? handleRowClick(row) : void 0,
8405
+ onKeyDown: onRowClick ? handleRowKeyDown(row) : void 0,
8406
+ children: columns.map((col) => {
8407
+ const rawValue = getNestedValue(row, col.key);
8408
+ const truncateTitle = col.truncate && (typeof rawValue === "string" || typeof rawValue === "number") ? String(rawValue) : void 0;
8409
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8410
+ "td",
8411
+ {
8412
+ className: (0, import_clsx43.default)(
8413
+ tableCell(col.className, density),
8414
+ col.align && tableAlignClasses[col.align]
8415
+ ),
8416
+ style: col.minWidth != null ? { minWidth: `${col.minWidth}px` } : void 0,
8417
+ title: truncateTitle,
8418
+ 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) })
8419
+ },
8420
+ `${absoluteIndex}-${col.key}`
8421
+ );
8422
+ })
8423
+ },
8424
+ absoluteIndex
8425
+ );
8426
+ }),
8427
+ 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 } }) })
8428
+ ] }) : /* @__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: [
8429
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
8430
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
8431
+ ] }) }) }) })
8432
+ ]
8433
+ }
8434
+ )
8060
8435
  }
8061
- ) }),
8436
+ ),
8062
8437
  /* @__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
8438
  ITPagination,
8064
8439
  {
@@ -8124,7 +8499,7 @@ function ITTextarea({
8124
8499
  }
8125
8500
 
8126
8501
  // src/components/molecules/tabs/tabs.tsx
8127
- var import_react36 = require("react");
8502
+ var import_react38 = require("react");
8128
8503
  var import_clsx45 = require("clsx");
8129
8504
  var import_jsx_runtime62 = require("react/jsx-runtime");
8130
8505
  var ITTabs = ({
@@ -8135,7 +8510,7 @@ var ITTabs = ({
8135
8510
  className = "",
8136
8511
  containerClassName = ""
8137
8512
  }) => {
8138
- const [activeId, setActiveId] = (0, import_react36.useState)(defaultActiveId || items[0]?.id);
8513
+ const [activeId, setActiveId] = (0, import_react38.useState)(defaultActiveId || items[0]?.id);
8139
8514
  const handleTabClick = (id, disabled) => {
8140
8515
  if (disabled) return;
8141
8516
  setActiveId(id);
@@ -8235,7 +8610,7 @@ var positionStyles = {
8235
8610
 
8236
8611
  // src/components/organisms/toast/toast.tsx
8237
8612
  var import_clsx47 = __toESM(require("clsx"), 1);
8238
- var import_react37 = require("react");
8613
+ var import_react39 = require("react");
8239
8614
  var import_fa28 = require("react-icons/fa");
8240
8615
  var import_jsx_runtime64 = require("react/jsx-runtime");
8241
8616
  function ITToast({
@@ -8245,8 +8620,8 @@ function ITToast({
8245
8620
  position = "top-right",
8246
8621
  onClose
8247
8622
  }) {
8248
- const [isVisible, setIsVisible] = (0, import_react37.useState)(true);
8249
- (0, import_react37.useEffect)(() => {
8623
+ const [isVisible, setIsVisible] = (0, import_react39.useState)(true);
8624
+ (0, import_react39.useEffect)(() => {
8250
8625
  const timer = setTimeout(() => {
8251
8626
  setIsVisible(false);
8252
8627
  setTimeout(() => {
@@ -8312,7 +8687,7 @@ function ITToast({
8312
8687
  }
8313
8688
 
8314
8689
  // src/components/molecules/wysiwyg/wysiwyg.tsx
8315
- var import_react39 = require("react");
8690
+ var import_react41 = require("react");
8316
8691
  var import_clsx49 = __toESM(require("clsx"), 1);
8317
8692
  var import_fa29 = require("react-icons/fa");
8318
8693
 
@@ -8328,7 +8703,7 @@ var toolbarActions = [
8328
8703
  ];
8329
8704
 
8330
8705
  // src/components/atoms/tooltip/tooltip.tsx
8331
- var import_react38 = require("react");
8706
+ var import_react40 = require("react");
8332
8707
  var import_clsx48 = __toESM(require("clsx"), 1);
8333
8708
  var import_jsx_runtime65 = require("react/jsx-runtime");
8334
8709
  var positionClasses2 = {
@@ -8350,7 +8725,7 @@ function ITTooltip({
8350
8725
  delay = 200,
8351
8726
  className
8352
8727
  }) {
8353
- const [visible, setVisible] = (0, import_react38.useState)(false);
8728
+ const [visible, setVisible] = (0, import_react40.useState)(false);
8354
8729
  let timeout;
8355
8730
  const handleMouseEnter = () => {
8356
8731
  timeout = setTimeout(() => setVisible(true), delay);
@@ -8403,12 +8778,12 @@ function ITWysiwyg({
8403
8778
  toolbar = toolbarActions,
8404
8779
  className
8405
8780
  }) {
8406
- const editorRef = (0, import_react39.useRef)(null);
8407
- const focusedRef = (0, import_react39.useRef)(false);
8408
- const [active, setActive] = (0, import_react39.useState)({});
8781
+ const editorRef = (0, import_react41.useRef)(null);
8782
+ const focusedRef = (0, import_react41.useRef)(false);
8783
+ const [active, setActive] = (0, import_react41.useState)({});
8409
8784
  const isLocked = disabled || readOnly;
8410
8785
  const sizeConfig = inputSizeTokens[size] ?? inputSizeTokens.md;
8411
- const findAncestor = (0, import_react39.useCallback)(
8786
+ const findAncestor = (0, import_react41.useCallback)(
8412
8787
  (node, predicate) => {
8413
8788
  const editor = editorRef.current;
8414
8789
  if (!editor) return null;
@@ -8421,7 +8796,7 @@ function ITWysiwyg({
8421
8796
  },
8422
8797
  []
8423
8798
  );
8424
- const isInlineTag = (0, import_react39.useCallback)((el, tag) => {
8799
+ const isInlineTag = (0, import_react41.useCallback)((el, tag) => {
8425
8800
  if (tag === "STRONG" || tag === "B") {
8426
8801
  return el.tagName === "STRONG" || el.tagName === "B";
8427
8802
  }
@@ -8430,7 +8805,7 @@ function ITWysiwyg({
8430
8805
  }
8431
8806
  return el.tagName === tag;
8432
8807
  }, []);
8433
- const getTextNodesInRange = (0, import_react39.useCallback)((range) => {
8808
+ const getTextNodesInRange = (0, import_react41.useCallback)((range) => {
8434
8809
  const editor = editorRef.current;
8435
8810
  if (!editor) return [];
8436
8811
  const out = [];
@@ -8441,7 +8816,7 @@ function ITWysiwyg({
8441
8816
  }
8442
8817
  return out;
8443
8818
  }, []);
8444
- const placeCaretAtEnd = (0, import_react39.useCallback)((target) => {
8819
+ const placeCaretAtEnd = (0, import_react41.useCallback)((target) => {
8445
8820
  const editor = editorRef.current;
8446
8821
  const sel = window.getSelection();
8447
8822
  if (!editor || !sel) return;
@@ -8452,11 +8827,11 @@ function ITWysiwyg({
8452
8827
  sel.addRange(range);
8453
8828
  if (document.activeElement !== editor) editor.focus();
8454
8829
  }, []);
8455
- const emitChange = (0, import_react39.useCallback)(() => {
8830
+ const emitChange = (0, import_react41.useCallback)(() => {
8456
8831
  const editor = editorRef.current;
8457
8832
  if (editor) onChange?.(editor.innerHTML);
8458
8833
  }, [onChange]);
8459
- const updateActive = (0, import_react39.useCallback)(() => {
8834
+ const updateActive = (0, import_react41.useCallback)(() => {
8460
8835
  const editor = editorRef.current;
8461
8836
  const sel = window.getSelection();
8462
8837
  const node = sel?.anchorNode ?? null;
@@ -8475,13 +8850,13 @@ function ITWysiwyg({
8475
8850
  (prev) => JSON.stringify(prev) === JSON.stringify(next) ? prev : next
8476
8851
  );
8477
8852
  }, [findAncestor, isInlineTag]);
8478
- const unwrapElement = (0, import_react39.useCallback)((el) => {
8853
+ const unwrapElement = (0, import_react41.useCallback)((el) => {
8479
8854
  const parent = el.parentNode;
8480
8855
  if (!parent) return;
8481
8856
  while (el.firstChild) parent.insertBefore(el.firstChild, el);
8482
8857
  el.remove();
8483
8858
  }, []);
8484
- const applyInline = (0, import_react39.useCallback)(
8859
+ const applyInline = (0, import_react41.useCallback)(
8485
8860
  (tag, prepare) => {
8486
8861
  const editor = editorRef.current;
8487
8862
  const sel = window.getSelection();
@@ -8563,7 +8938,7 @@ function ITWysiwyg({
8563
8938
  updateActive
8564
8939
  ]
8565
8940
  );
8566
- const normalizeBlocks = (0, import_react39.useCallback)(() => {
8941
+ const normalizeBlocks = (0, import_react41.useCallback)(() => {
8567
8942
  const editor = editorRef.current;
8568
8943
  if (!editor) return;
8569
8944
  const children = Array.from(editor.childNodes);
@@ -8585,7 +8960,7 @@ function ITWysiwyg({
8585
8960
  }
8586
8961
  flush();
8587
8962
  }, []);
8588
- const convertLiToDiv = (0, import_react39.useCallback)((li) => {
8963
+ const convertLiToDiv = (0, import_react41.useCallback)((li) => {
8589
8964
  const list = li.parentElement;
8590
8965
  if (!list || !list.parentNode) return;
8591
8966
  const div = document.createElement("div");
@@ -8593,20 +8968,20 @@ function ITWysiwyg({
8593
8968
  list.parentNode.insertBefore(div, list);
8594
8969
  li.remove();
8595
8970
  }, []);
8596
- const cleanupEmptyLists = (0, import_react39.useCallback)(() => {
8971
+ const cleanupEmptyLists = (0, import_react41.useCallback)(() => {
8597
8972
  const editor = editorRef.current;
8598
8973
  if (!editor) return;
8599
8974
  editor.querySelectorAll("ul, ol").forEach((list) => {
8600
8975
  if (!list.querySelector("li")) list.remove();
8601
8976
  });
8602
8977
  }, []);
8603
- const retagList = (0, import_react39.useCallback)((list, type) => {
8978
+ const retagList = (0, import_react41.useCallback)((list, type) => {
8604
8979
  if (!list.parentNode) return;
8605
8980
  const nl = document.createElement(type);
8606
8981
  while (list.firstChild) nl.appendChild(list.firstChild);
8607
8982
  list.parentNode.replaceChild(nl, list);
8608
8983
  }, []);
8609
- const toggleList = (0, import_react39.useCallback)(
8984
+ const toggleList = (0, import_react41.useCallback)(
8610
8985
  (type) => {
8611
8986
  const editor = editorRef.current;
8612
8987
  const sel = window.getSelection();
@@ -8704,7 +9079,7 @@ function ITWysiwyg({
8704
9079
  updateActive
8705
9080
  ]
8706
9081
  );
8707
- const clearFormatting = (0, import_react39.useCallback)(() => {
9082
+ const clearFormatting = (0, import_react41.useCallback)(() => {
8708
9083
  const editor = editorRef.current;
8709
9084
  const sel = window.getSelection();
8710
9085
  if (!editor || !sel || sel.rangeCount === 0) return;
@@ -8738,7 +9113,7 @@ function ITWysiwyg({
8738
9113
  emitChange,
8739
9114
  updateActive
8740
9115
  ]);
8741
- (0, import_react39.useEffect)(() => {
9116
+ (0, import_react41.useEffect)(() => {
8742
9117
  const editor = editorRef.current;
8743
9118
  if (!editor) return;
8744
9119
  if (!focusedRef.current) {
@@ -8746,7 +9121,7 @@ function ITWysiwyg({
8746
9121
  if (editor.innerHTML !== next) editor.innerHTML = next;
8747
9122
  }
8748
9123
  }, [value]);
8749
- (0, import_react39.useEffect)(() => {
9124
+ (0, import_react41.useEffect)(() => {
8750
9125
  const onSelectionChange = () => {
8751
9126
  const editor = editorRef.current;
8752
9127
  const sel = window.getSelection();
@@ -8885,7 +9260,7 @@ function ITWysiwyg({
8885
9260
  }
8886
9261
 
8887
9262
  // src/components/organisms/dropfile/dropfile.tsx
8888
- var import_react40 = require("react");
9263
+ var import_react42 = require("react");
8889
9264
  var import_react_dropzone = require("react-dropzone");
8890
9265
  var import_clsx50 = __toESM(require("clsx"), 1);
8891
9266
 
@@ -8931,15 +9306,15 @@ var ITDropfile = ({
8931
9306
  buttonLabel = "Subir archivo",
8932
9307
  modalTitle
8933
9308
  }) => {
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)(
9309
+ const [isModalOpen, setIsModalOpen] = (0, import_react42.useState)(false);
9310
+ const [selectedFile, setSelectedFile] = (0, import_react42.useState)(null);
9311
+ const [fileType, setFileType] = (0, import_react42.useState)(null);
9312
+ const [imagePreview, setImagePreview] = (0, import_react42.useState)(initialPreviewUrl || null);
9313
+ const [isConfirmed, setIsConfirmed] = (0, import_react42.useState)(false);
9314
+ const [internalUploadStatus, setInternalUploadStatus] = (0, import_react42.useState)(
8940
9315
  initialPreviewUrl ? "subido" /* UPLOADED */ : "pendiente" /* PENDING */
8941
9316
  );
8942
- (0, import_react40.useEffect)(() => {
9317
+ (0, import_react42.useEffect)(() => {
8943
9318
  if (initialPreviewUrl && !selectedFile) {
8944
9319
  setImagePreview(initialPreviewUrl);
8945
9320
  if (externalStatus === void 0) setInternalUploadStatus("subido" /* UPLOADED */);
@@ -9088,12 +9463,12 @@ var ITDropfile = ({
9088
9463
  accept: getAcceptedFileTypes(),
9089
9464
  maxFiles: 1
9090
9465
  });
9091
- (0, import_react40.useEffect)(() => {
9466
+ (0, import_react42.useEffect)(() => {
9092
9467
  const renderPDF = async () => {
9093
9468
  };
9094
9469
  renderPDF();
9095
9470
  }, [selectedFile, fileType]);
9096
- (0, import_react40.useEffect)(() => {
9471
+ (0, import_react42.useEffect)(() => {
9097
9472
  return () => {
9098
9473
  if (imagePreview) {
9099
9474
  URL.revokeObjectURL(imagePreview);
@@ -9130,7 +9505,7 @@ var ITDropfile = ({
9130
9505
  const handleDelete = () => {
9131
9506
  handleCancel();
9132
9507
  };
9133
- (0, import_react40.useEffect)(() => {
9508
+ (0, import_react42.useEffect)(() => {
9134
9509
  if (view === "button" && isConfirmed && uploadStatus === "subido" /* UPLOADED */) {
9135
9510
  const timeout = setTimeout(() => {
9136
9511
  setIsModalOpen(false);
@@ -9284,24 +9659,26 @@ var ITDropfile = ({
9284
9659
  var dropfile_default = ITDropfile;
9285
9660
 
9286
9661
  // src/components/templates/layout/layout.tsx
9287
- var import_react42 = require("react");
9662
+ var import_react44 = require("react");
9288
9663
  var import_clsx51 = __toESM(require("clsx"), 1);
9289
9664
 
9290
9665
  // src/components/organisms/topbar/topbar.tsx
9291
9666
  var import_fa30 = require("react-icons/fa");
9292
- var import_react41 = require("react");
9667
+ var import_react43 = require("react");
9293
9668
  var import_jsx_runtime68 = require("react/jsx-runtime");
9294
9669
  function ITTopBar({
9295
9670
  logo,
9296
9671
  logoText,
9672
+ centerContent,
9297
9673
  userMenu,
9674
+ children,
9298
9675
  showMobileMenuButton,
9299
9676
  onToggleMobileMenu,
9300
9677
  navItems,
9301
9678
  onNavItemClick
9302
9679
  }) {
9303
- const [isUserMenuOpen, setIsUserMenuOpen] = (0, import_react41.useState)(false);
9304
- const userMenuRef = (0, import_react41.useRef)(null);
9680
+ const [isUserMenuOpen, setIsUserMenuOpen] = (0, import_react43.useState)(false);
9681
+ const userMenuRef = (0, import_react43.useRef)(null);
9305
9682
  useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
9306
9683
  return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
9307
9684
  "header",
@@ -9361,101 +9738,105 @@ function ITTopBar({
9361
9738
  item.id
9362
9739
  )) })
9363
9740
  ] }),
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" }),
9741
+ 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 }) }),
9742
+ (children || userMenu) && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex items-center gap-2", children: [
9743
+ children,
9744
+ userMenu && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "relative", children: [
9745
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
9746
+ "button",
9747
+ {
9748
+ type: "button",
9749
+ 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",
9750
+ style: {
9751
+ backgroundColor: isUserMenuOpen ? "var(--it-topbar-user-hover, #f1f5f9)" : "transparent"
9752
+ },
9753
+ onMouseEnter: (e) => {
9754
+ if (!isUserMenuOpen) e.currentTarget.style.backgroundColor = "var(--it-topbar-user-hover, #f1f5f9)";
9755
+ },
9756
+ onMouseLeave: (e) => {
9757
+ if (!isUserMenuOpen) e.currentTarget.style.backgroundColor = "transparent";
9758
+ },
9759
+ onClick: () => setIsUserMenuOpen(!isUserMenuOpen),
9760
+ children: [
9761
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "relative", children: [
9762
+ userMenu.userImage ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
9763
+ "img",
9764
+ {
9765
+ className: "w-9 h-9 rounded-full object-cover ring-2 ring-white shadow-sm",
9766
+ src: userMenu.userImage,
9767
+ alt: "Current user"
9768
+ }
9769
+ ) : /* @__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)" } }) }),
9770
+ /* @__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" })
9771
+ ] }),
9772
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "hidden sm:flex flex-col text-left py-0.5", children: [
9436
9773
  /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
9437
- "button",
9774
+ ITText,
9438
9775
  {
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 })
9776
+ as: "span",
9777
+ className: "font-semibold text-[0.85rem] leading-tight",
9778
+ style: { color: "var(--it-topbar-user-text, #0f172a)" },
9779
+ children: userMenu.userName
9780
+ }
9781
+ ),
9782
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
9783
+ ITText,
9784
+ {
9785
+ as: "span",
9786
+ className: "text-[0.7rem] font-medium",
9787
+ style: { color: "var(--it-topbar-user-subtitle, #64748b)" },
9788
+ children: userMenu.userEmail
9452
9789
  }
9453
9790
  )
9454
- ] }, i);
9455
- }) })
9456
- ]
9457
- }
9458
- )
9791
+ ] })
9792
+ ]
9793
+ }
9794
+ ),
9795
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
9796
+ "div",
9797
+ {
9798
+ ref: userMenuRef,
9799
+ className: `
9800
+ 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)]
9801
+ ${isUserMenuOpen ? "scale-100 opacity-100 translate-y-0" : "scale-95 opacity-0 -translate-y-2 pointer-events-none"}
9802
+ `,
9803
+ style: {
9804
+ backgroundColor: "var(--it-topbar-user-dropdown-bg, #ffffff)",
9805
+ border: "1px solid var(--it-topbar-user-dropdown-border, #f1f5f9)"
9806
+ },
9807
+ children: [
9808
+ /* @__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: [
9809
+ /* @__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 }),
9810
+ /* @__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 })
9811
+ ] }),
9812
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("ul", { className: "py-2", children: userMenu.menuItems.map((m, i) => {
9813
+ const isDestructive = m.label.toLowerCase().includes("salir") || m.label.toLowerCase().includes("cerrar") || m.label.toLowerCase().includes("logout");
9814
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("li", { className: "px-2", children: [
9815
+ 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" }),
9816
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
9817
+ "button",
9818
+ {
9819
+ onClick: () => {
9820
+ m.onClick();
9821
+ setIsUserMenuOpen(false);
9822
+ },
9823
+ className: "block w-full text-left px-3 py-2.5 rounded-xl text-[0.875rem] font-medium transition-colors duration-150",
9824
+ style: { color: isDestructive ? "var(--color-danger-500)" : "var(--it-topbar-user-text, #334155)" },
9825
+ onMouseEnter: (e) => {
9826
+ e.currentTarget.style.backgroundColor = isDestructive ? "var(--color-danger-50)" : "var(--it-topbar-user-item-hover, #f8fafc)";
9827
+ },
9828
+ onMouseLeave: (e) => {
9829
+ e.currentTarget.style.backgroundColor = "transparent";
9830
+ },
9831
+ children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ITText, { as: "span", children: m.label })
9832
+ }
9833
+ )
9834
+ ] }, i);
9835
+ }) })
9836
+ ]
9837
+ }
9838
+ )
9839
+ ] })
9459
9840
  ] })
9460
9841
  ] })
9461
9842
  }
@@ -9471,8 +9852,8 @@ function ITLayout({
9471
9852
  className = "",
9472
9853
  contentClassName = ""
9473
9854
  }) {
9474
- const [internalCollapsed, setInternalCollapsed] = (0, import_react42.useState)(true);
9475
- const [mobileSidebarOpen, setMobileSidebarOpen] = (0, import_react42.useState)(false);
9855
+ const [internalCollapsed, setInternalCollapsed] = (0, import_react44.useState)(true);
9856
+ const [mobileSidebarOpen, setMobileSidebarOpen] = (0, import_react44.useState)(false);
9476
9857
  const isControlled = sidebar.isCollapsed !== void 0;
9477
9858
  const desktopCollapsed = isControlled ? sidebar.isCollapsed : internalCollapsed;
9478
9859
  const handleToggleCollapse = isControlled ? sidebar.onToggleCollapse ?? (() => {
@@ -9494,7 +9875,12 @@ function ITLayout({
9494
9875
  style: { backgroundColor: layoutTokens.backgroundColor },
9495
9876
  children: [
9496
9877
  /* @__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" }),
9878
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
9879
+ "div",
9880
+ {
9881
+ className: `${desktopCollapsed ? "w-[88px]" : "w-[280px]"} h-full flex-shrink-0`
9882
+ }
9883
+ ),
9498
9884
  /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "absolute top-0 left-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
9499
9885
  ITSidebar,
9500
9886
  {
@@ -9626,7 +10012,7 @@ function ITLoader({
9626
10012
 
9627
10013
  // src/components/molecules/stepper/stepper.tsx
9628
10014
  var import_clsx52 = __toESM(require("clsx"), 1);
9629
- var import_react43 = require("react");
10015
+ var import_react45 = require("react");
9630
10016
  var import_fa31 = require("react-icons/fa");
9631
10017
  var import_jsx_runtime71 = require("react/jsx-runtime");
9632
10018
  function ITStepper({
@@ -9643,15 +10029,15 @@ function ITStepper({
9643
10029
  maxContentHeight = "400px",
9644
10030
  color = "primary"
9645
10031
  }) {
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);
10032
+ const [direction, setDirection] = (0, import_react45.useState)("next");
10033
+ const contentRef = (0, import_react45.useRef)(null);
10034
+ const progressRef = (0, import_react45.useRef)(null);
9649
10035
  const isThemeColor = color in theme.colors;
9650
10036
  const resolvedColor = isThemeColor ? theme.colors[color][500] : color;
9651
- (0, import_react43.useEffect)(() => {
10037
+ (0, import_react45.useEffect)(() => {
9652
10038
  onStepChange?.(currentStep);
9653
10039
  }, [currentStep, onStepChange]);
9654
- (0, import_react43.useEffect)(() => {
10040
+ (0, import_react45.useEffect)(() => {
9655
10041
  const pct = currentStep / Math.max(1, steps.length - 1) * 100;
9656
10042
  if (progressRef.current) {
9657
10043
  progressRef.current.style.width = `${pct}%`;
@@ -9822,7 +10208,7 @@ function ITStepper({
9822
10208
  }
9823
10209
 
9824
10210
  // src/components/theme-provider/themeProvider.tsx
9825
- var import_react44 = require("react");
10211
+ var import_react46 = require("react");
9826
10212
  var import_md3 = require("react-icons/md");
9827
10213
 
9828
10214
  // src/components/theme-provider/themePresets.ts
@@ -10087,7 +10473,7 @@ function ITThemeProvider({
10087
10473
  radius,
10088
10474
  shadow
10089
10475
  }) {
10090
- const [palette2, setPaletteState] = (0, import_react44.useState)(() => {
10476
+ const [palette2, setPaletteState] = (0, import_react46.useState)(() => {
10091
10477
  const basePalette = {
10092
10478
  ...DEFAULT_PALETTE,
10093
10479
  ...theme2,
@@ -10113,8 +10499,8 @@ function ITThemeProvider({
10113
10499
  }
10114
10500
  return basePalette;
10115
10501
  });
10116
- const [isOpen, setIsOpen] = (0, import_react44.useState)(false);
10117
- const [customPresets, setCustomPresets] = (0, import_react44.useState)(() => {
10502
+ const [isOpen, setIsOpen] = (0, import_react46.useState)(false);
10503
+ const [customPresets, setCustomPresets] = (0, import_react46.useState)(() => {
10118
10504
  try {
10119
10505
  const saved = localStorage.getItem("it-theme-custom-presets");
10120
10506
  return saved ? JSON.parse(saved) : [];
@@ -10123,8 +10509,8 @@ function ITThemeProvider({
10123
10509
  return [];
10124
10510
  }
10125
10511
  });
10126
- const [newPresetName, setNewPresetName] = (0, import_react44.useState)("");
10127
- const [isSavingPreset, setIsSavingPreset] = (0, import_react44.useState)(false);
10512
+ const [newPresetName, setNewPresetName] = (0, import_react46.useState)("");
10513
+ const [isSavingPreset, setIsSavingPreset] = (0, import_react46.useState)(false);
10128
10514
  const handleSavePreset = () => {
10129
10515
  if (!newPresetName.trim()) return;
10130
10516
  const newPreset = {
@@ -10143,8 +10529,8 @@ function ITThemeProvider({
10143
10529
  setCustomPresets(updated);
10144
10530
  localStorage.setItem("it-theme-custom-presets", JSON.stringify(updated));
10145
10531
  };
10146
- const [resolvedTheme, setResolvedTheme] = (0, import_react44.useState)("light");
10147
- const [darkModeMode, setDarkModeMode] = (0, import_react44.useState)(
10532
+ const [resolvedTheme, setResolvedTheme] = (0, import_react46.useState)("light");
10533
+ const [darkModeMode, setDarkModeMode] = (0, import_react46.useState)(
10148
10534
  () => {
10149
10535
  const saved = localStorage.getItem("it-theme-dark-mode");
10150
10536
  if (saved === "light" || saved === "dark" || saved === "system") {
@@ -10153,7 +10539,7 @@ function ITThemeProvider({
10153
10539
  return "system";
10154
10540
  }
10155
10541
  );
10156
- (0, import_react44.useEffect)(() => {
10542
+ (0, import_react46.useEffect)(() => {
10157
10543
  localStorage.setItem("it-theme-dark-mode", darkModeMode);
10158
10544
  const applyDarkMode = (isDark) => {
10159
10545
  if (isDark) {
@@ -10178,7 +10564,7 @@ function ITThemeProvider({
10178
10564
  applyDarkMode(darkModeMode === "dark");
10179
10565
  }
10180
10566
  }, [darkModeMode]);
10181
- (0, import_react44.useEffect)(() => {
10567
+ (0, import_react46.useEffect)(() => {
10182
10568
  if (!showFab) {
10183
10569
  setPaletteState({
10184
10570
  ...DEFAULT_PALETTE,
@@ -10188,7 +10574,7 @@ function ITThemeProvider({
10188
10574
  });
10189
10575
  }
10190
10576
  }, [theme2, showFab]);
10191
- (0, import_react44.useLayoutEffect)(() => {
10577
+ (0, import_react46.useLayoutEffect)(() => {
10192
10578
  const root = document.documentElement;
10193
10579
  const scale = typeof density === "number" && isFinite(density) ? Math.min(Math.max(density, 0.5), 1.5) : 1;
10194
10580
  root.style.setProperty("--it-density", String(scale));
@@ -10198,7 +10584,7 @@ function ITThemeProvider({
10198
10584
  root.style.fontSize = "";
10199
10585
  };
10200
10586
  }, [density]);
10201
- (0, import_react44.useLayoutEffect)(() => {
10587
+ (0, import_react46.useLayoutEffect)(() => {
10202
10588
  const root = document.documentElement;
10203
10589
  const radiusTokens = ["xs", "sm", "md", "lg", "xl", "2xl", "3xl"];
10204
10590
  if (typeof radius === "number" && isFinite(radius)) {
@@ -10230,7 +10616,7 @@ function ITThemeProvider({
10230
10616
  surfaceStyle?.remove();
10231
10617
  };
10232
10618
  }, [radius, shadow]);
10233
- (0, import_react44.useEffect)(() => {
10619
+ (0, import_react46.useEffect)(() => {
10234
10620
  const injectStyles = (obj, prefix = "") => {
10235
10621
  Object.entries(obj).forEach(([key, val]) => {
10236
10622
  if (typeof val === "object" && val !== null) {