@axzydev/axzy_ui_system 1.5.3 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8113,7 +8113,7 @@ function ITSegmentedControl({
8113
8113
  import { useEffect as useEffect13, useRef as useRef20, useState as useState27 } from "react";
8114
8114
  import clsx40 from "clsx";
8115
8115
  import { FaChevronDown as FaChevronDown4 } from "react-icons/fa";
8116
- import { jsx as jsx58, jsxs as jsxs42 } from "react/jsx-runtime";
8116
+ import { Fragment as Fragment9, jsx as jsx58, jsxs as jsxs42 } from "react/jsx-runtime";
8117
8117
  function isSubItemGroup(entry) {
8118
8118
  return "items" in entry;
8119
8119
  }
@@ -8122,6 +8122,19 @@ function flattenSubItems(entries) {
8122
8122
  (entry) => isSubItemGroup(entry) ? entry.items : [entry]
8123
8123
  );
8124
8124
  }
8125
+ var RAIL_BADGE_MAX_CHARS = 3;
8126
+ function RailBadge({ value }) {
8127
+ const text = String(value);
8128
+ if (text.length <= RAIL_BADGE_MAX_CHARS) return /* @__PURE__ */ jsx58(Fragment9, { children: text });
8129
+ return /* @__PURE__ */ jsx58(
8130
+ "span",
8131
+ {
8132
+ "aria-hidden": "true",
8133
+ className: "block w-1.5 h-1.5 rounded-full",
8134
+ style: { backgroundColor: "currentColor" }
8135
+ }
8136
+ );
8137
+ }
8125
8138
  function ITSidebar({
8126
8139
  navigationItems = [],
8127
8140
  isCollapsed = false,
@@ -8192,7 +8205,9 @@ function ITSidebar({
8192
8205
  }
8193
8206
  }, [navigationItems]);
8194
8207
  const isSidebarCollapsed = visibleOnMobile ? false : isCollapsed && !(expandOnHover && isHovering);
8195
- const sidebarWidth = isSidebarCollapsed ? flat ? "w-[72px]" : "w-[88px]" : flat ? "w-[248px]" : "w-[280px]";
8208
+ const collapsedWidth = flat ? "w-[72px]" : "w-[88px]";
8209
+ const expandedWidth = flat ? "w-[248px]" : "w-[280px]";
8210
+ const sidebarWidth = isSidebarCollapsed ? collapsedWidth : expandedWidth;
8196
8211
  const fixedRail = isSidebarCollapsed && !expandOnHover;
8197
8212
  const toggleExpanded = (itemId) => {
8198
8213
  const newExpanded = new Set(expandedItems);
@@ -8304,7 +8319,7 @@ function ITSidebar({
8304
8319
  size: "sm",
8305
8320
  ...badgeRest,
8306
8321
  className: clsx40("shadow-md", badgeClassName),
8307
- children: String(count)
8322
+ children: isSidebarCollapsed ? /* @__PURE__ */ jsx58(RailBadge, { value: count }) : String(count)
8308
8323
  }
8309
8324
  );
8310
8325
  if (isSidebarCollapsed) {
@@ -8315,7 +8330,7 @@ function ITSidebar({
8315
8330
  "aria-label": label,
8316
8331
  title: label,
8317
8332
  onClick,
8318
- className: "relative flex items-center justify-center w-full p-2 mb-1 rounded-xl transition-all duration-300",
8333
+ className: `relative flex items-center w-full h-10 mb-1 rounded-xl transition-all duration-300 ${flat ? "px-3" : "px-5"}`,
8319
8334
  style: { color: "var(--it-sidebar-icon-color, var(--color-secondary-500))" },
8320
8335
  onMouseEnter: (e) => {
8321
8336
  e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
@@ -8325,7 +8340,7 @@ function ITSidebar({
8325
8340
  },
8326
8341
  children: [
8327
8342
  icon && /* @__PURE__ */ jsx58("span", { className: "flex items-center justify-center text-[1.05rem]", children: icon }),
8328
- /* @__PURE__ */ jsx58("span", { className: "absolute top-0.5 right-0.5 pointer-events-none", children: badge })
8343
+ /* @__PURE__ */ jsx58("span", { className: "absolute top-0.5 right-0.5 max-w-[2.1rem] overflow-hidden pointer-events-none", children: badge })
8329
8344
  ]
8330
8345
  }
8331
8346
  );
@@ -8337,7 +8352,7 @@ function ITSidebar({
8337
8352
  "aria-label": label,
8338
8353
  title: label,
8339
8354
  onClick,
8340
- className: "flex items-center gap-2.5 w-full text-left px-3 py-2 mb-1 rounded-xl transition-all duration-300",
8355
+ className: `flex items-center gap-2.5 w-full text-left h-10 mb-1 rounded-xl transition-all duration-300 ${flat ? "px-3" : "px-5"}`,
8341
8356
  style: { color: "var(--it-sidebar-label-color, var(--color-secondary-600))" },
8342
8357
  onMouseEnter: (e) => {
8343
8358
  e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
@@ -8405,9 +8420,9 @@ function ITSidebar({
8405
8420
  ]
8406
8421
  }
8407
8422
  ),
8408
- header && !isSidebarCollapsed && /* @__PURE__ */ jsx58("div", { className: "px-4 pt-4 pb-1 flex-shrink-0", children: header }),
8423
+ header && /* @__PURE__ */ jsx58("div", { className: `px-4 pt-4 pb-1 flex-shrink-0 ${isSidebarCollapsed ? "overflow-hidden" : ""}`, children: isSidebarCollapsed ? /* @__PURE__ */ jsx58("div", { className: `${expandedWidth} invisible`, "aria-hidden": "true", children: header }) : header }),
8409
8424
  notification && /* @__PURE__ */ jsx58("div", { className: "px-4 pt-3 flex-shrink-0", children: renderNotification() }),
8410
- /* @__PURE__ */ jsx58("nav", { "aria-label": t("sidebar.navAria"), className: `flex-1 py-4 custom-scrollbar ${fixedRail ? "overflow-visible" : "overflow-y-auto overflow-x-hidden"} ${flat && isSidebarCollapsed ? "px-3" : "px-4"}`, children: /* @__PURE__ */ jsx58("ul", { className: "space-y-1", children: navigationItems.map((item) => {
8425
+ /* @__PURE__ */ jsx58("nav", { "aria-label": t("sidebar.navAria"), className: `flex-1 py-4 px-4 custom-scrollbar ${fixedRail ? "overflow-visible" : "overflow-y-auto overflow-x-hidden"}`, children: /* @__PURE__ */ jsx58("ul", { className: "space-y-1", children: navigationItems.map((item) => {
8411
8426
  const hasSubmenu = !!item.subitems && item.subitems.length > 0;
8412
8427
  const submenuId = `it-sidebar-submenu-${item.id}`;
8413
8428
  const hasRenderedSubmenu = hasSubmenu && !isSidebarCollapsed;
@@ -8425,7 +8440,9 @@ function ITSidebar({
8425
8440
  className: `flex items-center cursor-pointer
8426
8441
  transition-all duration-300 ease-[cubic-bezier(0.2,0,0,1)]
8427
8442
  rounded-xl relative overflow-visible
8428
- ${isSidebarCollapsed ? flat ? "justify-center h-10 mb-1" : "justify-center p-2 mb-1" : "justify-between px-3 py-2 mb-0.5"}
8443
+ h-10
8444
+ ${flat ? "px-3" : "px-5"}
8445
+ ${isSidebarCollapsed ? "justify-start" : "justify-between"}
8429
8446
  `,
8430
8447
  style: {
8431
8448
  backgroundColor: active ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
@@ -8453,7 +8470,7 @@ function ITSidebar({
8453
8470
  style: { backgroundColor: "var(--it-sidebar-active-icon, var(--color-primary-500))", boxShadow: "0 0 10px var(--it-sidebar-active-icon, var(--color-primary-500))" }
8454
8471
  }
8455
8472
  ),
8456
- /* @__PURE__ */ jsxs42("div", { className: `flex items-center ${!isSidebarCollapsed ? "gap-2.5" : "justify-center"} relative z-10 w-full`, children: [
8473
+ /* @__PURE__ */ jsxs42("div", { className: "flex items-center gap-2.5 relative z-10 w-full", children: [
8457
8474
  item.icon && /* @__PURE__ */ jsx58(
8458
8475
  "div",
8459
8476
  {
@@ -8497,10 +8514,12 @@ function ITSidebar({
8497
8514
  ...badgeRest,
8498
8515
  className: clsx40(
8499
8516
  "absolute shadow-md",
8500
- isSidebarCollapsed ? "top-0.5 right-0.5" : "right-3 top-1/2 -translate-y-1/2",
8517
+ // En el riel no hay ancho para una etiqueta larga: el badge se
8518
+ // ancla a la esquina y se recorta, así nunca desborda ni tapa el icono.
8519
+ isSidebarCollapsed ? "top-0.5 right-0.5 max-w-[2.1rem] overflow-hidden" : "right-3 top-1/2 -translate-y-1/2",
8501
8520
  badgeClassName
8502
8521
  ),
8503
- children: String(item.badge)
8522
+ children: isSidebarCollapsed ? /* @__PURE__ */ jsx58(RailBadge, { value: item.badge }) : String(item.badge)
8504
8523
  }
8505
8524
  )
8506
8525
  ]
@@ -8923,7 +8942,7 @@ import {
8923
8942
  } from "react-icons/fa";
8924
8943
  import { MdOutlineSwapVert as MdOutlineSwapVert2 } from "react-icons/md";
8925
8944
  import { isSameDay as isSameDay2, startOfDay as startOfDay2, endOfDay } from "date-fns";
8926
- import { Fragment as Fragment9, jsx as jsx63, jsxs as jsxs46 } from "react/jsx-runtime";
8945
+ import { Fragment as Fragment10, jsx as jsx63, jsxs as jsxs46 } from "react/jsx-runtime";
8927
8946
  function ITTable({
8928
8947
  columns,
8929
8948
  data = [],
@@ -9461,7 +9480,7 @@ function ITTable({
9461
9480
  })
9462
9481
  }
9463
9482
  ) }),
9464
- /* @__PURE__ */ jsx63("tbody", { className: clsx44(tableBody, "dark:divide-slate-700/30"), children: currentData.length > 0 ? /* @__PURE__ */ jsxs46(Fragment9, { children: [
9483
+ /* @__PURE__ */ jsx63("tbody", { className: clsx44(tableBody, "dark:divide-slate-700/30"), children: currentData.length > 0 ? /* @__PURE__ */ jsxs46(Fragment10, { children: [
9465
9484
  isTableVirtual && topSpacerHeight > 0 && /* @__PURE__ */ jsx63("tr", { "aria-hidden": "true", style: { height: topSpacerHeight }, children: /* @__PURE__ */ jsx63("td", { colSpan: columnCount, style: { padding: 0, border: 0 } }) }),
9466
9485
  windowData.map((row, windowIndex) => {
9467
9486
  const absoluteIndex = isTableVirtual ? startIndex + windowIndex : windowIndex;
@@ -10413,7 +10432,7 @@ var UploadStatus = /* @__PURE__ */ ((UploadStatus2) => {
10413
10432
  })(UploadStatus || {});
10414
10433
 
10415
10434
  // src/components/organisms/dropfile/dropfile.tsx
10416
- import { Fragment as Fragment10, jsx as jsx70, jsxs as jsxs52 } from "react/jsx-runtime";
10435
+ import { Fragment as Fragment11, jsx as jsx70, jsxs as jsxs52 } from "react/jsx-runtime";
10417
10436
  var ITDropfile = ({
10418
10437
  onFileSelect,
10419
10438
  onCancel,
@@ -10660,7 +10679,7 @@ var ITDropfile = ({
10660
10679
  ] }),
10661
10680
  showStatusBadge && selectedFile && /* @__PURE__ */ jsx70(StatusBadge, { status: uploadStatus })
10662
10681
  ] });
10663
- const dropZoneOrPreview = /* @__PURE__ */ jsx70(Fragment10, { children: !selectedFile && !imagePreview ? /* @__PURE__ */ jsxs52(
10682
+ const dropZoneOrPreview = /* @__PURE__ */ jsx70(Fragment11, { children: !selectedFile && !imagePreview ? /* @__PURE__ */ jsxs52(
10664
10683
  "div",
10665
10684
  {
10666
10685
  ...getRootProps(),
@@ -10703,7 +10722,7 @@ var ITDropfile = ({
10703
10722
  /* @__PURE__ */ jsx70("svg", { className: "w-10 h-10 mb-2 opacity-50", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx70("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z" }) }),
10704
10723
  /* @__PURE__ */ jsx70(ITText, { as: "span", className: "text-xs", children: t("dropfile.noPreview") })
10705
10724
  ] }) }),
10706
- /* @__PURE__ */ jsx70("div", { className: "px-3 py-2 bg-white border-t border-secondary-100 flex justify-end gap-2", children: !isConfirmed ? /* @__PURE__ */ jsxs52(Fragment10, { children: [
10725
+ /* @__PURE__ */ jsx70("div", { className: "px-3 py-2 bg-white border-t border-secondary-100 flex justify-end gap-2", children: !isConfirmed ? /* @__PURE__ */ jsxs52(Fragment11, { children: [
10707
10726
  /* @__PURE__ */ jsx70(
10708
10727
  ITButton,
10709
10728
  {