@axzydev/axzy_ui_system 1.8.11 → 1.8.12

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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "packageManager": "pnpm@10.34.0",
5
5
  "private": false,
6
6
  "license": "MIT",
7
- "version": "1.8.11",
7
+ "version": "1.8.12",
8
8
  "type": "module",
9
9
  "sideEffects": [
10
10
  "*.css"
@@ -97,6 +97,23 @@ export interface ITSidebarBrand {
97
97
  text?: string;
98
98
  }
99
99
 
100
+ /**
101
+ * Tarjeta de la persona al pie del sidebar (estilo bento): nombre, detalle y
102
+ * foto; en el riel queda solo la foto. El clic suele abrir el menú de la cuenta.
103
+ */
104
+ export interface ITSidebarProfile {
105
+ /** Nombre a mostrar (p. ej. "Michael Gabson"). */
106
+ name: string;
107
+ /** Línea secundaria (correo, usuario o rol). */
108
+ detail?: string;
109
+ /** URL de la foto; sin ella se muestran las iniciales. */
110
+ image?: string;
111
+ /** Nombre accesible del botón cuando solo se ve la foto. */
112
+ label?: string;
113
+ /** Clic en la tarjeta. */
114
+ onClick?: () => void;
115
+ }
116
+
100
117
  /** Props for the ITSidebar vertical navigation component. */
101
118
  export interface ITSidebarProps {
102
119
  /** Navigation structure: top-level items with optional sub-items. */
@@ -124,6 +141,14 @@ export interface ITSidebarProps {
124
141
  onSubItemClick?: (subitem: ITNavigationSubItem) => void;
125
142
  /** Visual connector style for sub-items: "dot" | "|" | "none". Default: "dot". */
126
143
  subitemConnector?: 'dot' | '|' | 'none';
144
+ /**
145
+ * Aspecto del panel: `default` es la barra pegada al borde; `bento` la dibuja
146
+ * como una tarjeta flotante con esquinas grandes y sombra suave, que es el
147
+ * lenguaje del resto de la app. @default "default"
148
+ */
149
+ variant?: "default" | "bento";
150
+ /** Tarjeta de la persona al pie (solo se usa con `variant="bento"`). */
151
+ profile?: ITSidebarProfile;
127
152
  /** Additional CSS classes on the sidebar `<aside>`. */
128
153
  className?: string;
129
154
  /**
@@ -91,9 +91,13 @@ export default function ITSidebar({
91
91
  header,
92
92
  notification,
93
93
  brand,
94
+ profile,
95
+ variant = "default",
94
96
  onToggleCollapse,
95
97
  expandOnHover = true,
96
98
  }: ITSidebarProps) {
99
+ // Bento: el panel se dibuja como tarjeta flotante (mismo lenguaje que los mosaicos).
100
+ const bentoPanel = variant === "bento";
97
101
  // Flat appearance: plain surface, no glow/accent bar, narrower panel.
98
102
  // Bento shares that structure; its tokens make the active item a neutral pill with bold ink text.
99
103
  const appearance = useITAppearance();
@@ -367,11 +371,30 @@ export default function ITSidebar({
367
371
  `}
368
372
  style={{
369
373
  zIndex: 50,
370
- backgroundColor: "var(--it-sidebar-bg, rgba(255, 255, 255, 0.90))",
371
- borderRight: bento ? "none" : "1px solid var(--it-sidebar-border, var(--color-secondary-200))",
372
- ...(flat ? {} : { WebkitBackdropFilter: 'blur(12px)', backdropFilter: 'blur(12px)' }),
374
+ backgroundColor: bentoPanel
375
+ ? "transparent"
376
+ : "var(--it-sidebar-bg, rgba(255, 255, 255, 0.90))",
377
+ borderRight: bento || bentoPanel ? "none" : "1px solid var(--it-sidebar-border, var(--color-secondary-200))",
378
+ ...(bentoPanel || !flat
379
+ ? {}
380
+ : { WebkitBackdropFilter: 'blur(12px)', backdropFilter: 'blur(12px)' }),
373
381
  }}
374
382
  >
383
+ <div
384
+ className={
385
+ bentoPanel
386
+ ? "flex h-full min-h-0 flex-col overflow-hidden rounded-[26px]"
387
+ : "flex h-full min-h-0 flex-col"
388
+ }
389
+ style={
390
+ bentoPanel
391
+ ? {
392
+ backgroundColor: "var(--it-sidebar-bg, var(--it-card-bg, #ffffff))",
393
+ boxShadow: "0 18px 44px -28px rgba(13, 47, 64, 0.45), inset 0 0 0 1px rgba(13, 47, 64, 0.05)",
394
+ }
395
+ : undefined
396
+ }
397
+ >
375
398
  {brand && (brand.logo || brand.text) && (
376
399
  <div
377
400
  className={`flex items-center flex-shrink-0 h-[64px] ${isSidebarCollapsed ? "justify-center px-2" : "gap-2.5 px-7"}`}
@@ -598,6 +621,58 @@ export default function ITSidebar({
598
621
  );})}
599
622
  </ul>
600
623
  </nav>
624
+
625
+ {/* Persona al pie (bento): tarjeta con foto, nombre y detalle */}
626
+ {bentoPanel && profile && (
627
+ <div className="flex-shrink-0 px-3 pb-3">
628
+ <button
629
+ type="button"
630
+ onClick={profile.onClick}
631
+ aria-label={profile.label ?? profile.name}
632
+ title={isSidebarCollapsed ? profile.name : undefined}
633
+ className={`flex w-full items-center gap-2.5 rounded-2xl px-2.5 py-2 text-left transition-colors hover:bg-[var(--it-sidebar-hover-bg,var(--color-secondary-100))] ${
634
+ isSidebarCollapsed ? "justify-center" : ""
635
+ }`}
636
+ >
637
+ {profile.image ? (
638
+ <img src={profile.image} alt="" className="h-9 w-9 flex-shrink-0 rounded-full object-cover" />
639
+ ) : (
640
+ <span
641
+ aria-hidden="true"
642
+ className="flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-full text-[12px] font-bold"
643
+ style={{
644
+ backgroundColor: "var(--color-primary-50)",
645
+ color: "var(--color-primary-600)",
646
+ }}
647
+ >
648
+ {profile.name
649
+ .split(" ")
650
+ .filter(Boolean)
651
+ .slice(0, 2)
652
+ .map((part) => part[0])
653
+ .join("")
654
+ .toUpperCase()}
655
+ </span>
656
+ )}
657
+ {!isSidebarCollapsed && (
658
+ <>
659
+ <span className="min-w-0 flex-1">
660
+ <ITText as="span" className="block truncate text-[13px] font-bold" style={{ color: "var(--it-sidebar-label-color, var(--color-secondary-900))" }}>
661
+ {profile.name}
662
+ </ITText>
663
+ {profile.detail && (
664
+ <ITText as="span" className="block truncate text-[11px]" style={{ color: "var(--it-sidebar-icon-color, var(--color-secondary-500))" }}>
665
+ {profile.detail}
666
+ </ITText>
667
+ )}
668
+ </span>
669
+ <FaChevronDown className="h-3 w-3 -rotate-90 opacity-50" aria-hidden="true" />
670
+ </>
671
+ )}
672
+ </button>
673
+ </div>
674
+ )}
675
+ </div>
601
676
  </aside>
602
677
  );
603
678
  }
@@ -14,6 +14,12 @@ export interface ITTopBarNavItem {
14
14
  }
15
15
 
16
16
  export interface ITTopBarProps {
17
+ /**
18
+ * Aspecto de la barra: `default` va pegada al borde superior; `bento` la
19
+ * dibuja como una tarjeta flotante con esquinas grandes y sombra suave.
20
+ * @default "default"
21
+ */
22
+ variant?: "default" | "bento";
17
23
  /** Optional logo element (e.g. an `<img>` or SVG component). */
18
24
  logo?: any;
19
25
  /** Text displayed next to the logo. */
@@ -71,6 +71,7 @@ export default function ITTopBar({
71
71
  onNavItemClick,
72
72
  hideBrandOnDesktop = false,
73
73
  showDesktopMenuButton = false,
74
+ variant = "default",
74
75
  }: ITTopBarProps) {
75
76
  // Flat appearance: plain bar (no shadow/blur), initials avatar, name before it.
76
77
  // Bento: same plain structure, blended with the canvas, pill nav and round icon buttons.
@@ -91,15 +92,21 @@ export default function ITTopBar({
91
92
 
92
93
  useClickOutside(userMenuRef, () => setIsUserMenuOpen(false));
93
94
 
95
+ // Barra flotante: tarjeta con margen, esquinas grandes y sombra suave.
96
+ const floating = variant === "bento";
94
97
  return (
95
98
  <header
96
- className={`sticky top-0 z-40 transition-all duration-300 ${flat ? "" : "backdrop-blur-md"}`}
99
+ className={`sticky top-0 z-40 transition-all duration-300 ${
100
+ floating ? "mx-2 mt-2 rounded-[22px]" : ""
101
+ } ${flat && !floating ? "" : "backdrop-blur-md"}`}
97
102
  style={{
98
- backgroundColor: bento
99
- ? "var(--it-layout-bg, #f4f4f6)"
100
- : "var(--it-topbar-bg, rgba(255, 255, 255, 0.9))",
101
- borderBottom: bento ? "none" : "1px solid var(--it-topbar-border, rgba(15, 23, 42, 0.06))",
102
- boxShadow: flat ? "none" : "var(--shadow-xs)",
103
+ backgroundColor: floating
104
+ ? "var(--it-card-bg, #ffffff)"
105
+ : bento
106
+ ? "var(--it-layout-bg, #f4f4f6)"
107
+ : "var(--it-topbar-bg, rgba(255, 255, 255, 0.9))",
108
+ borderBottom: floating || bento ? "none" : "1px solid var(--it-topbar-border, rgba(15, 23, 42, 0.06))",
109
+ boxShadow: floating ? "0 16px 40px -30px rgba(13, 47, 64, 0.45)" : flat ? "none" : "var(--shadow-xs)",
103
110
  }}
104
111
  >
105
112
  <div className={`flex items-center justify-between px-6 lg:px-8 ${flat ? "h-[64px]" : "h-[72px]"}`}>