@zuccadev-labs/zuix-zout 0.2.0 → 0.3.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.
Files changed (70) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/README.md +11 -3
  3. package/dist/esm/dom/index.d.ts +30 -1
  4. package/dist/esm/dom/index.js +639 -10
  5. package/dist/esm/dom/index.js.map +1 -1
  6. package/dist/esm/dom/site.d.ts +3 -0
  7. package/dist/esm/dom/site.js +57 -0
  8. package/dist/esm/dom/site.js.map +1 -0
  9. package/dist/esm/edges.d.ts +6 -0
  10. package/dist/esm/edges.js +47 -0
  11. package/dist/esm/edges.js.map +1 -0
  12. package/dist/esm/index.d.ts +13 -2
  13. package/dist/esm/index.js +10 -0
  14. package/dist/esm/index.js.map +1 -1
  15. package/dist/esm/layouts/BottomNavigation.d.ts +30 -0
  16. package/dist/esm/layouts/BottomNavigation.js +13 -0
  17. package/dist/esm/layouts/BottomNavigation.js.map +1 -0
  18. package/dist/esm/layouts/Float.d.ts +18 -0
  19. package/dist/esm/layouts/Float.js +11 -0
  20. package/dist/esm/layouts/Float.js.map +1 -0
  21. package/dist/esm/layouts/FloatingPanel.d.ts +51 -0
  22. package/dist/esm/layouts/FloatingPanel.js +138 -0
  23. package/dist/esm/layouts/FloatingPanel.js.map +1 -0
  24. package/dist/esm/layouts/Navbar.d.ts +28 -0
  25. package/dist/esm/layouts/Navbar.js +22 -0
  26. package/dist/esm/layouts/Navbar.js.map +1 -0
  27. package/dist/esm/layouts/NavigationMenu.d.ts +41 -0
  28. package/dist/esm/layouts/NavigationMenu.js +37 -0
  29. package/dist/esm/layouts/NavigationMenu.js.map +1 -0
  30. package/dist/esm/layouts/Page.d.ts +6 -1
  31. package/dist/esm/layouts/Page.js +2 -2
  32. package/dist/esm/layouts/Page.js.map +1 -1
  33. package/dist/esm/layouts/PaneHeader.d.ts +25 -0
  34. package/dist/esm/layouts/PaneHeader.js +12 -0
  35. package/dist/esm/layouts/PaneHeader.js.map +1 -0
  36. package/dist/esm/layouts/PaneLayout.d.ts +46 -0
  37. package/dist/esm/layouts/PaneLayout.js +154 -0
  38. package/dist/esm/layouts/PaneLayout.js.map +1 -0
  39. package/dist/esm/layouts/SidePanel.d.ts +11 -3
  40. package/dist/esm/layouts/SidePanel.js +4 -3
  41. package/dist/esm/layouts/SidePanel.js.map +1 -1
  42. package/dist/esm/layouts/SidebarItem.d.ts +44 -0
  43. package/dist/esm/layouts/SidebarItem.js +76 -0
  44. package/dist/esm/layouts/SidebarItem.js.map +1 -0
  45. package/dist/esm/layouts/SiteFooter.d.ts +43 -0
  46. package/dist/esm/layouts/SiteFooter.js +11 -0
  47. package/dist/esm/layouts/SiteFooter.js.map +1 -0
  48. package/dist/esm/layouts/SkipLink.d.ts +11 -0
  49. package/dist/esm/layouts/SkipLink.js +16 -0
  50. package/dist/esm/layouts/SkipLink.js.map +1 -0
  51. package/dist/esm/layouts/TabStrip.d.ts +32 -2
  52. package/dist/esm/layouts/TabStrip.js +124 -15
  53. package/dist/esm/layouts/TabStrip.js.map +1 -1
  54. package/dist/esm/layouts/navbar-context.d.ts +4 -0
  55. package/dist/esm/layouts/navbar-context.js +5 -0
  56. package/dist/esm/layouts/navbar-context.js.map +1 -0
  57. package/dist/esm/layouts/sidebar-context.d.ts +6 -0
  58. package/dist/esm/layouts/sidebar-context.js +6 -0
  59. package/dist/esm/layouts/sidebar-context.js.map +1 -0
  60. package/dist/esm/logic.d.ts +130 -2
  61. package/dist/esm/logic.js +256 -6
  62. package/dist/esm/logic.js.map +1 -1
  63. package/dist/esm/site.d.ts +26 -0
  64. package/dist/esm/site.js +287 -0
  65. package/dist/esm/site.js.map +1 -0
  66. package/dist/zout.css +2012 -433
  67. package/dist/zout.dom.js +1 -1
  68. package/html.json +236 -7
  69. package/manifest.json +1197 -61
  70. package/package.json +5 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edges.js","sourceRoot":"","sources":["../../src/edges.ts"],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AI,cAAc,CAAC,MAAM,CAAC,CAAC;IACrF,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IAChB,mGAAmG;IACnG,KAAK,MAAM,KAAK,IAAI,EAAE,CAAC,QAAQ;QAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACpD,4FAA4F;IAC5F,MAAM,EAAE,GAAG,OAAO,gBAAgB,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACzF,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACrC,OAAO,GAAG,EAAE;QACV,EAAE,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACzC,EAAE,EAAE,UAAU,EAAE,CAAC;QACjB,EAAE,EAAE,UAAU,EAAE,CAAC;IACnB,CAAC,CAAC;AACJ,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,UAAU,CAAC,IAAiB;IAC1C,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC;IACvD,OAAO,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,CAAC;AACzF,CAAC","sourcesContent":["// Copia de zui/src/core/edges.ts (zout no importa el núcleo interno de zui).\n// Bordes de una tira con desplazamiento horizontal (pestañas, listas en fila): marca en `data-scroll-edges` qué lado\n// tiene contenido oculto (\"start\", \"end\" o los dos) para que la hoja difumine solo ese borde. Lógica pura más un\n// observador sin efectos al importar; lo usan el binding de React y el modo DOM.\n\nconst EDGE_SLACK = 8;\n\n/** Lados con contenido oculto. `scrollStart` es la distancia desplazada desde el inicio (positiva también en RTL). */\nexport function scrollEdges(scrollStart: number, scrollSize: number, viewSize: number): string {\n // Menos de 8 px por esconder es holgura (el hueco final de la fila, un contorno), no contenido oculto.\n const hidden = scrollSize - viewSize;\n if (hidden <= EDGE_SLACK) return \"\";\n const start = scrollStart > EDGE_SLACK;\n const end = scrollStart < hidden - EDGE_SLACK;\n return [start ? \"start\" : \"\", end ? \"end\" : \"\"].filter(Boolean).join(\" \");\n}\n\n/** Mantiene `data-scroll-edges` al día al desplazar y al cambiar de tamaño. Devuelve la función que deja de vigilar. */\nexport function trackScrollEdges(el: HTMLElement): () => void {\n const update = () => {\n const value = scrollEdges(Math.abs(el.scrollLeft), el.scrollWidth, el.clientWidth);\n if (value) el.setAttribute(\"data-scroll-edges\", value);\n else el.removeAttribute(\"data-scroll-edges\");\n };\n update();\n el.addEventListener(\"scroll\", update, { passive: true });\n const ro = typeof ResizeObserver === \"undefined\" ? null : new ResizeObserver(update);\n ro?.observe(el);\n // El contenido cambia de ancho (carga de la fuente, un título nuevo) sin que cambie el de la tira.\n for (const child of el.children) ro?.observe(child);\n // Los hijos cambian (se añade o se cierra una pestaña) sin que cambie el tamaño de la tira.\n const mo = typeof MutationObserver === \"undefined\" ? null : new MutationObserver(update);\n mo?.observe(el, { childList: true });\n return () => {\n el.removeEventListener(\"scroll\", update);\n ro?.disconnect();\n mo?.disconnect();\n };\n}\n\n/** Ancho del difuminado de una tira que desplaza (`--z-space-6`), o 0 si no desborda. */\nexport function edgeMargin(list: HTMLElement): number {\n if (list.scrollWidth <= list.clientWidth + 1) return 0;\n return Number.parseFloat(getComputedStyle(list).getPropertyValue(\"--z-space-6\")) || 24;\n}\n"]}
@@ -1,8 +1,19 @@
1
1
  export { Shell, type ShellProps, type ShellPanel, type ShellPanelMode } from "./layouts/Shell.js";
2
2
  export { Rail, RailItem, type RailProps, type RailItemProps } from "./layouts/Rail.js";
3
- export { SidePanel, Sidebar, SidebarSection, type SidePanelProps, type SidebarSectionProps } from "./layouts/SidePanel.js";
3
+ export { SidePanel, Sidebar, SidebarSection, type SidePanelProps, type SidebarProps, type SidebarSectionProps } from "./layouts/SidePanel.js";
4
+ export { SidebarItem, SidebarTrigger, type SidebarItemProps, type SidebarTriggerProps } from "./layouts/SidebarItem.js";
4
5
  export { SplitPane, Pane, type SplitPaneProps, type PaneProps } from "./layouts/SplitPane.js";
5
- export { TabStrip, type TabStripProps, type WorkTab } from "./layouts/TabStrip.js";
6
+ export { TabStrip, type TabStripProps, type WorkTab, type TabGroup, type TabGroupTone } from "./layouts/TabStrip.js";
6
7
  export { TitleBar, type TitleBarProps } from "./layouts/TitleBar.js";
8
+ export { PaneHeader, type PaneHeaderProps } from "./layouts/PaneHeader.js";
9
+ export { FloatingPanel, type FloatingPanelProps } from "./layouts/FloatingPanel.js";
10
+ export { PaneLayout, type PaneLayoutProps, type PaneInfo, type PaneLayoutLabels } from "./layouts/PaneLayout.js";
11
+ export type { PaneNode, DropEdge } from "./logic.js";
12
+ export { Float, type FloatProps, type FloatPlacement } from "./layouts/Float.js";
7
13
  export { ResizeHandle, type ResizeHandleProps } from "./layouts/ResizeHandle.js";
8
14
  export { Stack, Inline, Grid, Container, Page, PageHeader, PageSection, type StackProps, type InlineProps, type GridProps, type ContainerProps, type PageProps, type PageHeaderProps, type PageSectionProps, } from "./layouts/Page.js";
15
+ export { Navbar, type NavbarProps } from "./layouts/Navbar.js";
16
+ export { NavigationMenu, type NavigationMenuProps, type NavMenuItem, type NavMenuLink } from "./layouts/NavigationMenu.js";
17
+ export { BottomNavigation, type BottomNavigationProps, type BottomNavItem } from "./layouts/BottomNavigation.js";
18
+ export { SiteFooter, type SiteFooterProps, type SiteFooterColumn, type SiteFooterLink, type SiteFooterSocial } from "./layouts/SiteFooter.js";
19
+ export { SkipLink, type SkipLinkProps } from "./layouts/SkipLink.js";
package/dist/esm/index.js CHANGED
@@ -2,9 +2,19 @@
2
2
  export { Shell } from "./layouts/Shell.js";
3
3
  export { Rail, RailItem } from "./layouts/Rail.js";
4
4
  export { SidePanel, Sidebar, SidebarSection } from "./layouts/SidePanel.js";
5
+ export { SidebarItem, SidebarTrigger } from "./layouts/SidebarItem.js";
5
6
  export { SplitPane, Pane } from "./layouts/SplitPane.js";
6
7
  export { TabStrip } from "./layouts/TabStrip.js";
7
8
  export { TitleBar } from "./layouts/TitleBar.js";
9
+ export { PaneHeader } from "./layouts/PaneHeader.js";
10
+ export { FloatingPanel } from "./layouts/FloatingPanel.js";
11
+ export { PaneLayout } from "./layouts/PaneLayout.js";
12
+ export { Float } from "./layouts/Float.js";
8
13
  export { ResizeHandle } from "./layouts/ResizeHandle.js";
9
14
  export { Stack, Inline, Grid, Container, Page, PageHeader, PageSection, } from "./layouts/Page.js";
15
+ export { Navbar } from "./layouts/Navbar.js";
16
+ export { NavigationMenu } from "./layouts/NavigationMenu.js";
17
+ export { BottomNavigation } from "./layouts/BottomNavigation.js";
18
+ export { SiteFooter } from "./layouts/SiteFooter.js";
19
+ export { SkipLink } from "./layouts/SkipLink.js";
10
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,OAAO,EAAE,KAAK,EAAyD,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAsC,MAAM,gBAAgB,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAiD,MAAM,qBAAqB,CAAC;AACxH,OAAO,EAAE,SAAS,EAAE,IAAI,EAAuC,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAE,QAAQ,EAAoC,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAsB,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,YAAY,EAA0B,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,UAAU,EACV,WAAW,GAQZ,MAAM,gBAAgB,CAAC","sourcesContent":["// @zuccadev-labs/zuix-zout — layouts y ventanas dinámicas.\nexport { Shell, type ShellProps, type ShellPanel, type ShellPanelMode } from \"./layouts/Shell\";\nexport { Rail, RailItem, type RailProps, type RailItemProps } from \"./layouts/Rail\";\nexport { SidePanel, Sidebar, SidebarSection, type SidePanelProps, type SidebarSectionProps } from \"./layouts/SidePanel\";\nexport { SplitPane, Pane, type SplitPaneProps, type PaneProps } from \"./layouts/SplitPane\";\nexport { TabStrip, type TabStripProps, type WorkTab } from \"./layouts/TabStrip\";\nexport { TitleBar, type TitleBarProps } from \"./layouts/TitleBar\";\nexport { ResizeHandle, type ResizeHandleProps } from \"./layouts/ResizeHandle\";\nexport {\n Stack,\n Inline,\n Grid,\n Container,\n Page,\n PageHeader,\n PageSection,\n type StackProps,\n type InlineProps,\n type GridProps,\n type ContainerProps,\n type PageProps,\n type PageHeaderProps,\n type PageSectionProps,\n} from \"./layouts/Page\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,OAAO,EAAE,KAAK,EAAyD,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAsC,MAAM,gBAAgB,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAoE,MAAM,qBAAqB,CAAC;AAC3I,OAAO,EAAE,WAAW,EAAE,cAAc,EAAmD,MAAM,uBAAuB,CAAC;AACrH,OAAO,EAAE,SAAS,EAAE,IAAI,EAAuC,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAE,QAAQ,EAAsE,MAAM,oBAAoB,CAAC;AAClH,OAAO,EAAE,QAAQ,EAAsB,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAwB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,aAAa,EAA2B,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,UAAU,EAA8D,MAAM,sBAAsB,CAAC;AAE9G,OAAO,EAAE,KAAK,EAAwC,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,YAAY,EAA0B,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,UAAU,EACV,WAAW,GAQZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAoB,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAgE,MAAM,0BAA0B,CAAC;AACxH,OAAO,EAAE,gBAAgB,EAAkD,MAAM,4BAA4B,CAAC;AAC9G,OAAO,EAAE,UAAU,EAA2F,MAAM,sBAAsB,CAAC;AAC3I,OAAO,EAAE,QAAQ,EAAsB,MAAM,oBAAoB,CAAC","sourcesContent":["// @zuccadev-labs/zuix-zout — layouts y ventanas dinámicas.\nexport { Shell, type ShellProps, type ShellPanel, type ShellPanelMode } from \"./layouts/Shell\";\nexport { Rail, RailItem, type RailProps, type RailItemProps } from \"./layouts/Rail\";\nexport { SidePanel, Sidebar, SidebarSection, type SidePanelProps, type SidebarProps, type SidebarSectionProps } from \"./layouts/SidePanel\";\nexport { SidebarItem, SidebarTrigger, type SidebarItemProps, type SidebarTriggerProps } from \"./layouts/SidebarItem\";\nexport { SplitPane, Pane, type SplitPaneProps, type PaneProps } from \"./layouts/SplitPane\";\nexport { TabStrip, type TabStripProps, type WorkTab, type TabGroup, type TabGroupTone } from \"./layouts/TabStrip\";\nexport { TitleBar, type TitleBarProps } from \"./layouts/TitleBar\";\nexport { PaneHeader, type PaneHeaderProps } from \"./layouts/PaneHeader\";\nexport { FloatingPanel, type FloatingPanelProps } from \"./layouts/FloatingPanel\";\nexport { PaneLayout, type PaneLayoutProps, type PaneInfo, type PaneLayoutLabels } from \"./layouts/PaneLayout\";\nexport type { PaneNode, DropEdge } from \"./logic\";\nexport { Float, type FloatProps, type FloatPlacement } from \"./layouts/Float\";\nexport { ResizeHandle, type ResizeHandleProps } from \"./layouts/ResizeHandle\";\nexport {\n Stack,\n Inline,\n Grid,\n Container,\n Page,\n PageHeader,\n PageSection,\n type StackProps,\n type InlineProps,\n type GridProps,\n type ContainerProps,\n type PageProps,\n type PageHeaderProps,\n type PageSectionProps,\n} from \"./layouts/Page\";\nexport { Navbar, type NavbarProps } from \"./layouts/Navbar\";\nexport { NavigationMenu, type NavigationMenuProps, type NavMenuItem, type NavMenuLink } from \"./layouts/NavigationMenu\";\nexport { BottomNavigation, type BottomNavigationProps, type BottomNavItem } from \"./layouts/BottomNavigation\";\nexport { SiteFooter, type SiteFooterProps, type SiteFooterColumn, type SiteFooterLink, type SiteFooterSocial } from \"./layouts/SiteFooter\";\nexport { SkipLink, type SkipLinkProps } from \"./layouts/SkipLink\";\n"]}
@@ -0,0 +1,30 @@
1
+ import type { ReactNode } from "react";
2
+ import { type IconName } from "@zuccadev-labs/zuix-zicon/core";
3
+ export interface BottomNavItem {
4
+ /** Identificador; sin `href`, la entrada es un botón y lo recibe `onValueChange`. */
5
+ value: string;
6
+ label: string;
7
+ icon: IconName;
8
+ /** Enlace de destino. */
9
+ href?: string;
10
+ /** Contador o marca sobre el icono. */
11
+ badge?: ReactNode;
12
+ /** Texto para lectores de la insignia (p. ej. «3 unread»). */
13
+ badgeLabel?: string;
14
+ }
15
+ export interface BottomNavigationProps {
16
+ items: BottomNavItem[];
17
+ /** Entrada actual (`aria-current="page"`). */
18
+ value?: string;
19
+ onValueChange?: (value: string) => void;
20
+ /** Etiquetas siempre visibles, solo la actual o ninguna (quedan para los lectores de pantalla). */
21
+ labels?: "always" | "active" | "none";
22
+ /** `floating`: barra de cristal separada de los bordes; `bar`: de borde a borde. */
23
+ variant?: "floating" | "bar";
24
+ /** `fixed` (por defecto) pegada abajo, respetando la zona segura; `static`, en su sitio. */
25
+ position?: "fixed" | "static";
26
+ label?: string;
27
+ className?: string;
28
+ }
29
+ /** Navegación principal de móvil: de tres a cinco destinos con icono y etiqueta, abajo y al alcance del pulgar. */
30
+ export declare function BottomNavigation({ items, value, onValueChange, labels, variant, position, label, className, }: BottomNavigationProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Icon } from "@zuccadev-labs/zuix-zicon/core";
4
+ import { cx } from "../cx.js";
5
+ /** Navegación principal de móvil: de tres a cinco destinos con icono y etiqueta, abajo y al alcance del pulgar. */
6
+ export function BottomNavigation({ items, value, onValueChange, labels = "always", variant = "floating", position = "fixed", label = "Primary", className, }) {
7
+ return (_jsx("nav", { className: cx("z-bottomnav", className), "aria-label": label, "data-labels": labels, "data-variant": variant, "data-position": position, children: _jsx("ul", { className: "z-bottomnav__list", children: items.map((item) => {
8
+ const current = item.value === value;
9
+ const body = (_jsxs(_Fragment, { children: [_jsxs("span", { className: "z-bottomnav__icon", children: [_jsx(Icon, { name: item.icon, size: 22 }), item.badge !== undefined ? (_jsx("span", { className: "z-bottomnav__badge", "aria-hidden": item.badgeLabel ? true : undefined, children: item.badge })) : null] }), _jsx("span", { className: "z-bottomnav__label", children: item.label }), item.badgeLabel ? _jsx("span", { className: "z-sr-only", children: `, ${item.badgeLabel}` }) : null] }));
10
+ return (_jsx("li", { children: item.href ? (_jsx("a", { className: "z-bottomnav__item", href: item.href, "data-value": item.value, "aria-current": current ? "page" : undefined, children: body })) : (_jsx("button", { type: "button", className: "z-bottomnav__item", "data-value": item.value, "aria-current": current ? "page" : undefined, onClick: () => onValueChange?.(item.value), children: body })) }, item.value));
11
+ }) }) }));
12
+ }
13
+ //# sourceMappingURL=BottomNavigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomNavigation.js","sourceRoot":"","sources":["../../../src/layouts/BottomNavigation.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAiB,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,C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CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,YACjH,IAAI,GACH,CACL,CAAC,CAAC,CAAC,CACF,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,mBAAmB,gBACjB,IAAI,CAAC,KAAK,kBACR,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC1C,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,YAEzC,IAAI,GACE,CACV,IAfM,IAAI,CAAC,KAAK,CAgBd,CACN,CAAC;YACJ,CAAC,CAAC,GACC,GACD,CACP,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\nimport type { ReactNode } from \"react\";\nimport { Icon, type IconName } from \"@zuccadev-labs/zuix-zicon/core\";\nimport { cx } from \"../cx\";\n\nexport interface BottomNavItem {\n /** Identificador; sin `href`, la entrada es un botón y lo recibe `onValueChange`. */\n value: string;\n label: string;\n icon: IconName;\n /** Enlace de destino. */\n href?: string;\n /** Contador o marca sobre el icono. */\n badge?: ReactNode;\n /** Texto para lectores de la insignia (p. ej. «3 unread»). */\n badgeLabel?: string;\n}\n\nexport interface BottomNavigationProps {\n items: BottomNavItem[];\n /** Entrada actual (`aria-current=\"page\"`). */\n value?: string;\n onValueChange?: (value: string) => void;\n /** Etiquetas siempre visibles, solo la actual o ninguna (quedan para los lectores de pantalla). */\n labels?: \"always\" | \"active\" | \"none\";\n /** `floating`: barra de cristal separada de los bordes; `bar`: de borde a borde. */\n variant?: \"floating\" | \"bar\";\n /** `fixed` (por defecto) pegada abajo, respetando la zona segura; `static`, en su sitio. */\n position?: \"fixed\" | \"static\";\n label?: string;\n className?: string;\n}\n\n/** Navegación principal de móvil: de tres a cinco destinos con icono y etiqueta, abajo y al alcance del pulgar. */\nexport function BottomNavigation({\n items,\n value,\n onValueChange,\n labels = \"always\",\n variant = \"floating\",\n position = \"fixed\",\n label = \"Primary\",\n className,\n}: BottomNavigationProps) {\n return (\n <nav className={cx(\"z-bottomnav\", className)} aria-label={label} data-labels={labels} data-variant={variant} data-position={position}>\n <ul className=\"z-bottomnav__list\">\n {items.map((item) => {\n const current = item.value === value;\n const body = (\n <>\n <span className=\"z-bottomnav__icon\">\n <Icon name={item.icon} size={22} />\n {item.badge !== undefined ? (\n <span className=\"z-bottomnav__badge\" aria-hidden={item.badgeLabel ? true : undefined}>\n {item.badge}\n </span>\n ) : null}\n </span>\n <span className=\"z-bottomnav__label\">{item.label}</span>\n {item.badgeLabel ? <span className=\"z-sr-only\">{`, ${item.badgeLabel}`}</span> : null}\n </>\n );\n return (\n <li key={item.value}>\n {item.href ? (\n <a className=\"z-bottomnav__item\" href={item.href} data-value={item.value} aria-current={current ? \"page\" : undefined}>\n {body}\n </a>\n ) : (\n <button\n type=\"button\"\n className=\"z-bottomnav__item\"\n data-value={item.value}\n aria-current={current ? \"page\" : undefined}\n onClick={() => onValueChange?.(item.value)}\n >\n {body}\n </button>\n )}\n </li>\n );\n })}\n </ul>\n </nav>\n );\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import type { ReactNode } from "react";
2
+ export type FloatPlacement = "top-start" | "top-center" | "top-end" | "middle-start" | "middle-end" | "bottom-start" | "bottom-center" | "bottom-end";
3
+ export interface FloatProps {
4
+ /** Elemento al que se ancla (avatar, icono, botón). */
5
+ children: ReactNode;
6
+ /** Lo que flota sobre la esquina (insignia, punto, contador). */
7
+ content: ReactNode;
8
+ /** Esquina o borde, en lógicas: `start` es la izquierda en LTR y la derecha en RTL. */
9
+ placement?: FloatPlacement;
10
+ /** Desplazamiento hacia dentro (CSS: `4px`, `14%`), para anclar sobre una forma circular. */
11
+ offset?: string | number;
12
+ className?: string;
13
+ }
14
+ /**
15
+ * Pone un elemento sobre una esquina o un borde de otro, centrado en el canto (la mitad dentro, la mitad fuera).
16
+ * Solo CSS y propiedades lógicas: sirve igual en RTL. Referencia de variantes: Float de Shark UI.
17
+ */
18
+ export declare function Float({ children, content, placement, offset, className }: FloatProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cx } from "../cx.js";
3
+ /**
4
+ * Pone un elemento sobre una esquina o un borde de otro, centrado en el canto (la mitad dentro, la mitad fuera).
5
+ * Solo CSS y propiedades lógicas: sirve igual en RTL. Referencia de variantes: Float de Shark UI.
6
+ */
7
+ export function Float({ children, content, placement = "top-end", offset, className }) {
8
+ const style = offset === undefined ? undefined : { "--z-float-offset": typeof offset === "number" ? `${offset}px` : offset };
9
+ return (_jsxs("span", { className: cx("z-float", className), "data-placement": placement, style: style, children: [children, _jsx("span", { className: "z-float__item", children: content })] }));
10
+ }
11
+ //# sourceMappingURL=Float.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Float.js","sourceRoot":"","sources":["../../../src/layouts/Float.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAwB3B;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,GAAG,SAAS,EAAE,MAAM,EAAE,SAAS,EAAc;IAC/F,MAAM,KAAK,GACT,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,EAAE,kBAAkB,EAAE,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,MAAM,EAAoB,CAAC;IACpI,OAAO,CACL,gBAAM,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,oBAAkB,SAAS,EAAE,KAAK,EAAE,KAAK,aAC/E,QAAQ,EACT,eAAM,SAAS,EAAC,eAAe,YAAE,OAAO,GAAQ,IAC3C,CACR,CAAC;AACJ,CAAC","sourcesContent":["import type { CSSProperties, ReactNode } from \"react\";\nimport { cx } from \"../cx\";\n\nexport type FloatPlacement =\n | \"top-start\"\n | \"top-center\"\n | \"top-end\"\n | \"middle-start\"\n | \"middle-end\"\n | \"bottom-start\"\n | \"bottom-center\"\n | \"bottom-end\";\n\nexport interface FloatProps {\n /** Elemento al que se ancla (avatar, icono, botón). */\n children: ReactNode;\n /** Lo que flota sobre la esquina (insignia, punto, contador). */\n content: ReactNode;\n /** Esquina o borde, en lógicas: `start` es la izquierda en LTR y la derecha en RTL. */\n placement?: FloatPlacement;\n /** Desplazamiento hacia dentro (CSS: `4px`, `14%`), para anclar sobre una forma circular. */\n offset?: string | number;\n className?: string;\n}\n\n/**\n * Pone un elemento sobre una esquina o un borde de otro, centrado en el canto (la mitad dentro, la mitad fuera).\n * Solo CSS y propiedades lógicas: sirve igual en RTL. Referencia de variantes: Float de Shark UI.\n */\nexport function Float({ children, content, placement = \"top-end\", offset, className }: FloatProps) {\n const style =\n offset === undefined ? undefined : ({ \"--z-float-offset\": typeof offset === \"number\" ? `${offset}px` : offset } as CSSProperties);\n return (\n <span className={cx(\"z-float\", className)} data-placement={placement} style={style}>\n {children}\n <span className=\"z-float__item\">{content}</span>\n </span>\n );\n}\n"]}
@@ -0,0 +1,51 @@
1
+ import { type ReactNode } from "react";
2
+ export interface FloatingPanelProps {
3
+ title: ReactNode;
4
+ children: ReactNode;
5
+ footer?: ReactNode;
6
+ /** Cerrar: botón en la cabecera y Escape con el foco dentro. Sin él, no se puede cerrar desde el panel. */
7
+ onClose?: () => void;
8
+ /** Posición (controlada), en px desde la esquina superior izquierda del área. */
9
+ position?: {
10
+ x: number;
11
+ y: number;
12
+ };
13
+ defaultPosition?: {
14
+ x: number;
15
+ y: number;
16
+ };
17
+ onPositionChange?: (position: {
18
+ x: number;
19
+ y: number;
20
+ }) => void;
21
+ /** Tamaño (controlado), en px. */
22
+ size?: {
23
+ width: number;
24
+ height: number;
25
+ };
26
+ defaultSize?: {
27
+ width: number;
28
+ height: number;
29
+ };
30
+ onSizeChange?: (size: {
31
+ width: number;
32
+ height: number;
33
+ }) => void;
34
+ minWidth?: number;
35
+ minHeight?: number;
36
+ resizable?: boolean;
37
+ /** `fixed`: flota sobre la ventana. `absolute`: dentro de su contenedor posicionado (acotado a él). */
38
+ strategy?: "fixed" | "absolute";
39
+ /** Lleva el foco al panel al montarlo y lo devuelve al cerrarlo. Por defecto, true. */
40
+ autoFocus?: boolean;
41
+ moveLabel?: string;
42
+ resizeLabel?: string;
43
+ closeLabel?: string;
44
+ className?: string;
45
+ }
46
+ /**
47
+ * Ventana flotante no modal: se arrastra por su asa (o por la cabecera) y se redimensiona desde la esquina final, con
48
+ * puntero o con flechas (Mayús, pasos de 100 px). Queda siempre dentro de la ventana o de su contenedor. Escape la
49
+ * cierra con `onClose`. Origen: paneles flotantes de zutool; referencia de variantes: Floating Panel de Shark UI.
50
+ */
51
+ export declare function FloatingPanel({ title, children, footer, onClose, position, defaultPosition, onPositionChange, size, defaultSize, onSizeChange, minWidth, minHeight, resizable, strategy, autoFocus, moveLabel, resizeLabel, closeLabel, className, }: FloatingPanelProps): import("react").JSX.Element;
@@ -0,0 +1,138 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useId, useLayoutEffect, useRef, useState } from "react";
4
+ import { Icon } from "@zuccadev-labs/zuix-zicon/core";
5
+ import { cx } from "../cx.js";
6
+ import { FLOAT_STEP, clampRect, moveDelta, resizeDelta, resizeRect } from "../logic.js";
7
+ const DEFAULT_POSITION = { x: 24, y: 24 };
8
+ const DEFAULT_SIZE = { width: 320, height: 240 };
9
+ /** Área en la que se acota el panel: la ventana o su contenedor posicionado. */
10
+ function boundsOf(el, strategy) {
11
+ if (strategy === "absolute") {
12
+ const parent = el.offsetParent;
13
+ if (parent)
14
+ return { width: parent.clientWidth, height: parent.clientHeight };
15
+ }
16
+ const root = el.ownerDocument.documentElement;
17
+ return { width: root.clientWidth, height: root.clientHeight };
18
+ }
19
+ /**
20
+ * Ventana flotante no modal: se arrastra por su asa (o por la cabecera) y se redimensiona desde la esquina final, con
21
+ * puntero o con flechas (Mayús, pasos de 100 px). Queda siempre dentro de la ventana o de su contenedor. Escape la
22
+ * cierra con `onClose`. Origen: paneles flotantes de zutool; referencia de variantes: Floating Panel de Shark UI.
23
+ */
24
+ export function FloatingPanel({ title, children, footer, onClose, position, defaultPosition = DEFAULT_POSITION, onPositionChange, size, defaultSize = DEFAULT_SIZE, onSizeChange, minWidth = 200, minHeight = 120, resizable = true, strategy = "fixed", autoFocus = true, moveLabel = "Move panel (arrow keys)", resizeLabel = "Resize panel (arrow keys)", closeLabel = "Close", className, }) {
25
+ const id = useId();
26
+ const node = useRef(null);
27
+ const [innerPos, setInnerPos] = useState(defaultPosition);
28
+ const [innerSize, setInnerSize] = useState(defaultSize);
29
+ const pos = position ?? innerPos;
30
+ const dim = size ?? innerSize;
31
+ const rect = { ...pos, ...dim };
32
+ const min = { width: minWidth, height: minHeight };
33
+ const drag = useRef(null);
34
+ const commit = (next) => {
35
+ if (next.x !== pos.x || next.y !== pos.y) {
36
+ if (position === undefined)
37
+ setInnerPos({ x: next.x, y: next.y });
38
+ onPositionChange?.({ x: next.x, y: next.y });
39
+ }
40
+ if (next.width !== dim.width || next.height !== dim.height) {
41
+ if (size === undefined)
42
+ setInnerSize({ width: next.width, height: next.height });
43
+ onSizeChange?.({ width: next.width, height: next.height });
44
+ }
45
+ };
46
+ const bounds = () => (node.current ? boundsOf(node.current, strategy) : { width: Infinity, height: Infinity });
47
+ const rtl = () => (node.current ? getComputedStyle(node.current).direction === "rtl" : false);
48
+ const moveTo = (start, dx, dy) => commit(clampRect({ ...start, x: start.x + dx, y: start.y + dy }, bounds(), min));
49
+ const resizeTo = (start, dw, dh) => commit(resizeRect(start, dw, dh, bounds(), min, rtl()));
50
+ // Al montar (y si la ventana se estrecha) el panel vuelve dentro del área. El redimensionado lee la posición y el
51
+ // tamaño de ese momento, no los del montaje: si no, devolvería el panel a donde estaba al abrirse.
52
+ const fitLatest = useRef(() => { });
53
+ fitLatest.current = () => commit(clampRect(rect, bounds(), min));
54
+ useLayoutEffect(() => {
55
+ const fit = () => fitLatest.current();
56
+ fit();
57
+ window.addEventListener("resize", fit);
58
+ return () => window.removeEventListener("resize", fit);
59
+ }, []);
60
+ // El foco entra en el panel al abrirse y vuelve a donde estaba al cerrarse (si seguía dentro).
61
+ useEffect(() => {
62
+ const el = node.current;
63
+ if (!autoFocus || !el)
64
+ return;
65
+ const previous = document.activeElement instanceof HTMLElement ? document.activeElement : null;
66
+ el.focus({ preventScroll: true });
67
+ return () => {
68
+ const active = document.activeElement;
69
+ if (previous?.isConnected && (!active || active === document.body || el.contains(active)))
70
+ previous.focus({ preventScroll: true });
71
+ };
72
+ }, [autoFocus]);
73
+ const start = (mode) => (e) => {
74
+ if (e.button !== 0)
75
+ return;
76
+ // Los botones de la cabecera (cerrar) no arrastran; el asa sí.
77
+ const control = e.target.closest("button, a, input, select, textarea");
78
+ if (control && control !== e.currentTarget && !control.classList.contains("z-floatpanel__handle"))
79
+ return;
80
+ drag.current = { mode, pointerId: e.pointerId, x: e.clientX, y: e.clientY, start: rect };
81
+ try {
82
+ e.currentTarget.setPointerCapture(e.pointerId);
83
+ }
84
+ catch {
85
+ /* puntero ya liberado */
86
+ }
87
+ e.currentTarget.dataset.dragging = "";
88
+ };
89
+ const onMove = (e) => {
90
+ const d = drag.current;
91
+ if (!d || e.pointerId !== d.pointerId)
92
+ return;
93
+ const dx = e.clientX - d.x;
94
+ const dy = e.clientY - d.y;
95
+ if (d.mode === "move")
96
+ moveTo(d.start, dx, dy);
97
+ else
98
+ resizeTo(d.start, dx, dy);
99
+ };
100
+ const onEnd = (e) => {
101
+ // El último pointermove puede no llegar antes de soltar: la posición final es la del pointerup.
102
+ if (e.type === "pointerup")
103
+ onMove(e);
104
+ drag.current = null;
105
+ delete e.currentTarget.dataset.dragging;
106
+ };
107
+ const onKey = (mode) => (e) => {
108
+ const step = e.shiftKey ? FLOAT_STEP * 10 : FLOAT_STEP;
109
+ if (mode === "move") {
110
+ const d = moveDelta(e.key, step);
111
+ if (!d)
112
+ return;
113
+ e.preventDefault();
114
+ moveTo(rect, d.dx, d.dy);
115
+ }
116
+ else {
117
+ const d = resizeDelta(e.key, step);
118
+ if (!d)
119
+ return;
120
+ e.preventDefault();
121
+ resizeTo(rect, d.dw, d.dh);
122
+ }
123
+ };
124
+ const drags = (mode) => ({
125
+ onPointerDown: start(mode),
126
+ onPointerMove: onMove,
127
+ onPointerUp: onEnd,
128
+ onPointerCancel: onEnd,
129
+ onLostPointerCapture: onEnd,
130
+ });
131
+ return (_jsxs("section", { ref: node, className: cx("z-floatpanel z-liquid", className), role: "dialog", "aria-labelledby": `${id}-title`, tabIndex: -1, "data-strategy": strategy, style: { left: rect.x, top: rect.y, width: rect.width, height: rect.height }, onKeyDown: (e) => {
132
+ if (e.key !== "Escape" || !onClose || e.defaultPrevented)
133
+ return;
134
+ e.preventDefault();
135
+ onClose();
136
+ }, children: [_jsxs("header", { className: "z-floatpanel__header", ...drags("move"), children: [_jsx("button", { type: "button", className: "z-floatpanel__handle", "aria-label": moveLabel, title: moveLabel, onKeyDown: onKey("move"), children: _jsx(Icon, { name: "bars-2", size: 14 }) }), _jsx("h2", { className: "z-floatpanel__title", id: `${id}-title`, children: title }), onClose ? (_jsx("button", { type: "button", className: "z-floatpanel__close", "aria-label": closeLabel, title: closeLabel, onClick: onClose, children: _jsx(Icon, { name: "x-mark", size: 14 }) })) : null] }), _jsx("div", { className: "z-floatpanel__body", children: children }), footer ? _jsx("footer", { className: "z-floatpanel__footer", children: footer }) : null, resizable ? (_jsx("button", { type: "button", className: "z-floatpanel__resize", "aria-label": resizeLabel, title: resizeLabel, onKeyDown: onKey("resize"), ...drags("resize") })) : null] }));
137
+ }
138
+ //# sourceMappingURL=FloatingPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FloatingPanel.js","sourceRoot":"","sources":["../../../src/layouts/FloatingPanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,SA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oBAAoB,YAAE,QAAQ,GAAO,EACnD,MAAM,CAAC,CAAC,CAAC,iBAAQ,SAAS,EAAC,sBAAsB,YAAE,MAAM,GAAU,CAAC,CAAC,CAAC,IAAI,EAC1E,SAAS,CAAC,CAAC,CAAC,CACX,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,sBAAsB,gBACpB,WAAW,EACvB,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KACtB,KAAK,CAAC,QAAQ,CAAC,GACnB,CACH,CAAC,CAAC,CAAC,IAAI,IACA,CACX,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\nimport { useEffect, useId, useLayoutEffect, useRef, useState, type KeyboardEvent, type PointerEvent, type ReactNode } from \"react\";\nimport { Icon } from \"@zuccadev-labs/zuix-zicon/core\";\nimport { cx } from \"../cx\";\nimport { FLOAT_STEP, clampRect, moveDelta, resizeDelta, resizeRect, type Rect } from \"../logic\";\n\nexport interface FloatingPanelProps {\n title: ReactNode;\n children: ReactNode;\n footer?: ReactNode;\n /** Cerrar: botón en la cabecera y Escape con el foco dentro. Sin él, no se puede cerrar desde el panel. */\n onClose?: () => void;\n /** Posición (controlada), en px desde la esquina superior izquierda del área. */\n position?: { x: number; y: number };\n defaultPosition?: { x: number; y: number };\n onPositionChange?: (position: { x: number; y: number }) => void;\n /** Tamaño (controlado), en px. */\n size?: { width: number; height: number };\n defaultSize?: { width: number; height: number };\n onSizeChange?: (size: { width: number; height: number }) => void;\n minWidth?: number;\n minHeight?: number;\n resizable?: boolean;\n /** `fixed`: flota sobre la ventana. `absolute`: dentro de su contenedor posicionado (acotado a él). */\n strategy?: \"fixed\" | \"absolute\";\n /** Lleva el foco al panel al montarlo y lo devuelve al cerrarlo. Por defecto, true. */\n autoFocus?: boolean;\n moveLabel?: string;\n resizeLabel?: string;\n closeLabel?: string;\n className?: string;\n}\n\nconst DEFAULT_POSITION = { x: 24, y: 24 };\nconst DEFAULT_SIZE = { width: 320, height: 240 };\n\n/** Área en la que se acota el panel: la ventana o su contenedor posicionado. */\nfunction boundsOf(el: HTMLElement, strategy: \"fixed\" | \"absolute\") {\n if (strategy === \"absolute\") {\n const parent = el.offsetParent as HTMLElement | null;\n if (parent) return { width: parent.clientWidth, height: parent.clientHeight };\n }\n const root = el.ownerDocument.documentElement;\n return { width: root.clientWidth, height: root.clientHeight };\n}\n\n/**\n * Ventana flotante no modal: se arrastra por su asa (o por la cabecera) y se redimensiona desde la esquina final, con\n * puntero o con flechas (Mayús, pasos de 100 px). Queda siempre dentro de la ventana o de su contenedor. Escape la\n * cierra con `onClose`. Origen: paneles flotantes de zutool; referencia de variantes: Floating Panel de Shark UI.\n */\nexport function FloatingPanel({\n title,\n children,\n footer,\n onClose,\n position,\n defaultPosition = DEFAULT_POSITION,\n onPositionChange,\n size,\n defaultSize = DEFAULT_SIZE,\n onSizeChange,\n minWidth = 200,\n minHeight = 120,\n resizable = true,\n strategy = \"fixed\",\n autoFocus = true,\n moveLabel = \"Move panel (arrow keys)\",\n resizeLabel = \"Resize panel (arrow keys)\",\n closeLabel = \"Close\",\n className,\n}: FloatingPanelProps) {\n const id = useId();\n const node = useRef<HTMLElement>(null);\n const [innerPos, setInnerPos] = useState(defaultPosition);\n const [innerSize, setInnerSize] = useState(defaultSize);\n const pos = position ?? innerPos;\n const dim = size ?? innerSize;\n const rect: Rect = { ...pos, ...dim };\n const min = { width: minWidth, height: minHeight };\n const drag = useRef<{ mode: \"move\" | \"resize\"; pointerId: number; x: number; y: number; start: Rect } | null>(null);\n\n const commit = (next: Rect) => {\n if (next.x !== pos.x || next.y !== pos.y) {\n if (position === undefined) setInnerPos({ x: next.x, y: next.y });\n onPositionChange?.({ x: next.x, y: next.y });\n }\n if (next.width !== dim.width || next.height !== dim.height) {\n if (size === undefined) setInnerSize({ width: next.width, height: next.height });\n onSizeChange?.({ width: next.width, height: next.height });\n }\n };\n const bounds = () => (node.current ? boundsOf(node.current, strategy) : { width: Infinity, height: Infinity });\n const rtl = () => (node.current ? getComputedStyle(node.current).direction === \"rtl\" : false);\n const moveTo = (start: Rect, dx: number, dy: number) => commit(clampRect({ ...start, x: start.x + dx, y: start.y + dy }, bounds(), min));\n const resizeTo = (start: Rect, dw: number, dh: number) => commit(resizeRect(start, dw, dh, bounds(), min, rtl()));\n\n // Al montar (y si la ventana se estrecha) el panel vuelve dentro del área. El redimensionado lee la posición y el\n // tamaño de ese momento, no los del montaje: si no, devolvería el panel a donde estaba al abrirse.\n const fitLatest = useRef(() => {});\n fitLatest.current = () => commit(clampRect(rect, bounds(), min));\n useLayoutEffect(() => {\n const fit = () => fitLatest.current();\n fit();\n window.addEventListener(\"resize\", fit);\n return () => window.removeEventListener(\"resize\", fit);\n }, []);\n\n // El foco entra en el panel al abrirse y vuelve a donde estaba al cerrarse (si seguía dentro).\n useEffect(() => {\n const el = node.current;\n if (!autoFocus || !el) return;\n const previous = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n el.focus({ preventScroll: true });\n return () => {\n const active = document.activeElement;\n if (previous?.isConnected && (!active || active === document.body || el.contains(active))) previous.focus({ preventScroll: true });\n };\n }, [autoFocus]);\n\n const start = (mode: \"move\" | \"resize\") => (e: PointerEvent<HTMLElement>) => {\n if (e.button !== 0) return;\n // Los botones de la cabecera (cerrar) no arrastran; el asa sí.\n const control = (e.target as Element).closest(\"button, a, input, select, textarea\");\n if (control && control !== e.currentTarget && !control.classList.contains(\"z-floatpanel__handle\")) return;\n drag.current = { mode, pointerId: e.pointerId, x: e.clientX, y: e.clientY, start: rect };\n try {\n e.currentTarget.setPointerCapture(e.pointerId);\n } catch {\n /* puntero ya liberado */\n }\n e.currentTarget.dataset.dragging = \"\";\n };\n const onMove = (e: PointerEvent<HTMLElement>) => {\n const d = drag.current;\n if (!d || e.pointerId !== d.pointerId) return;\n const dx = e.clientX - d.x;\n const dy = e.clientY - d.y;\n if (d.mode === \"move\") moveTo(d.start, dx, dy);\n else resizeTo(d.start, dx, dy);\n };\n const onEnd = (e: PointerEvent<HTMLElement>) => {\n // El último pointermove puede no llegar antes de soltar: la posición final es la del pointerup.\n if (e.type === \"pointerup\") onMove(e);\n drag.current = null;\n delete e.currentTarget.dataset.dragging;\n };\n const onKey = (mode: \"move\" | \"resize\") => (e: KeyboardEvent<HTMLElement>) => {\n const step = e.shiftKey ? FLOAT_STEP * 10 : FLOAT_STEP;\n if (mode === \"move\") {\n const d = moveDelta(e.key, step);\n if (!d) return;\n e.preventDefault();\n moveTo(rect, d.dx, d.dy);\n } else {\n const d = resizeDelta(e.key, step);\n if (!d) return;\n e.preventDefault();\n resizeTo(rect, d.dw, d.dh);\n }\n };\n const drags = (mode: \"move\" | \"resize\") => ({\n onPointerDown: start(mode),\n onPointerMove: onMove,\n onPointerUp: onEnd,\n onPointerCancel: onEnd,\n onLostPointerCapture: onEnd,\n });\n\n return (\n <section\n ref={node}\n className={cx(\"z-floatpanel z-liquid\", className)}\n role=\"dialog\"\n aria-labelledby={`${id}-title`}\n tabIndex={-1}\n data-strategy={strategy}\n style={{ left: rect.x, top: rect.y, width: rect.width, height: rect.height }}\n onKeyDown={(e) => {\n if (e.key !== \"Escape\" || !onClose || e.defaultPrevented) return;\n e.preventDefault();\n onClose();\n }}\n >\n <header className=\"z-floatpanel__header\" {...drags(\"move\")}>\n <button type=\"button\" className=\"z-floatpanel__handle\" aria-label={moveLabel} title={moveLabel} onKeyDown={onKey(\"move\")}>\n <Icon name=\"bars-2\" size={14} />\n </button>\n <h2 className=\"z-floatpanel__title\" id={`${id}-title`}>\n {title}\n </h2>\n {onClose ? (\n <button type=\"button\" className=\"z-floatpanel__close\" aria-label={closeLabel} title={closeLabel} onClick={onClose}>\n <Icon name=\"x-mark\" size={14} />\n </button>\n ) : null}\n </header>\n <div className=\"z-floatpanel__body\">{children}</div>\n {footer ? <footer className=\"z-floatpanel__footer\">{footer}</footer> : null}\n {resizable ? (\n <button\n type=\"button\"\n className=\"z-floatpanel__resize\"\n aria-label={resizeLabel}\n title={resizeLabel}\n onKeyDown={onKey(\"resize\")}\n {...drags(\"resize\")}\n />\n ) : null}\n </section>\n );\n}\n"]}
@@ -0,0 +1,28 @@
1
+ import { type ReactNode } from "react";
2
+ import { type NavMenuItem } from "./NavigationMenu.js";
3
+ export interface NavbarProps {
4
+ /** Logo y nombre; suele ser un enlace a la portada. */
5
+ brand?: ReactNode;
6
+ /** Enlaces y grupos con panel (los de NavigationMenu). */
7
+ items?: NavMenuItem[];
8
+ /** Acciones al final: búsqueda, tema, llamada a la acción. Quedan fuera del cajón. */
9
+ actions?: ReactNode;
10
+ /** `floating`: dos barras de cristal separadas; `dock`: una sola barra compacta centrada; `bar`: de borde a borde. */
11
+ variant?: "floating" | "dock" | "bar";
12
+ /** `sticky` (por defecto) se queda arriba al desplazar; `fixed` flota sobre la página; `static`, en su sitio. */
13
+ position?: "sticky" | "fixed" | "static";
14
+ /** Nombre del landmark de navegación. */
15
+ label?: string;
16
+ /** Texto del botón de menú (estrecho). */
17
+ menuLabel?: string;
18
+ /** Nombre del botón que cierra el cajón. */
19
+ closeLabel?: string;
20
+ /** Prefijo de los id internos (paneles, cajón); por defecto, uno generado. */
21
+ id?: string;
22
+ className?: string;
23
+ }
24
+ /**
25
+ * Barra de navegación de un sitio, de cristal. Sin punto de corte fijo: si la fila entera no cabe, los enlaces
26
+ * pasan a un cajón (popover nativo) que abre el botón de menú. Sin JavaScript, el cajón es el modo por defecto.
27
+ */
28
+ export declare function Navbar({ brand, items, actions, variant, position, label, menuLabel, closeLabel, className, id: idProp, }: NavbarProps): import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useId, useLayoutEffect, useRef } from "react";
4
+ import { Icon } from "@zuccadev-labs/zuix-zicon/core";
5
+ import { cx } from "../cx.js";
6
+ import { wireNavbar } from "../site.js";
7
+ import { NavbarContext } from "./navbar-context.js";
8
+ import { NavigationMenu } from "./NavigationMenu.js";
9
+ const useIsoLayoutEffect = typeof document === "undefined" ? useEffect : useLayoutEffect;
10
+ /**
11
+ * Barra de navegación de un sitio, de cristal. Sin punto de corte fijo: si la fila entera no cabe, los enlaces
12
+ * pasan a un cajón (popover nativo) que abre el botón de menú. Sin JavaScript, el cajón es el modo por defecto.
13
+ */
14
+ export function Navbar({ brand, items = [], actions, variant = "floating", position = "sticky", label = "Primary", menuLabel = "Menu", closeLabel = "Close menu", className, id: idProp, }) {
15
+ const generated = useId();
16
+ const id = idProp ?? generated;
17
+ const menuId = `${id}-menu`;
18
+ const ref = useRef(null);
19
+ useIsoLayoutEffect(() => (ref.current ? wireNavbar(ref.current) : undefined), []);
20
+ return (_jsx("header", { ref: ref, className: cx("z-navbar", className), "data-variant": variant, "data-position": position, "data-collapsed": "", children: _jsxs("div", { className: "z-navbar__inner", children: [_jsxs("div", { className: "z-navbar__bar z-navbar__main", children: [brand ? _jsx("div", { className: "z-navbar__brand", children: brand }) : null, _jsxs("nav", { className: "z-navbar__nav", "aria-label": label, children: [_jsxs("button", { type: "button", className: "z-navbar__toggle", "aria-expanded": "false", "aria-controls": menuId, popoverTarget: menuId, children: [_jsx(Icon, { name: "bars-3", size: 18 }), _jsx("span", { className: "z-navbar__toggle-label", children: menuLabel })] }), _jsxs("div", { id: menuId, className: "z-navbar__menu", popover: "auto", children: [_jsxs("div", { className: "z-navbar__drawer-head", children: [_jsx("span", { className: "z-navbar__drawer-title", children: menuLabel }), _jsx("button", { type: "button", className: "z-navbar__close", popoverTarget: menuId, popoverTargetAction: "hide", "aria-label": closeLabel, children: _jsx(Icon, { name: "x-mark", size: 18 }) })] }), _jsx(NavbarContext.Provider, { value: { embedded: true }, children: _jsx(NavigationMenu, { items: items, id: `${id}-nav` }) })] })] })] }), actions ? _jsx("div", { className: "z-navbar__bar z-navbar__actions", children: actions }) : null] }) }));
21
+ }
22
+ //# sourceMappingURL=Navbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Navbar.js","sourceRoot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ReactNode } from \"react\";\nimport { Icon } from \"@zuccadev-labs/zuix-zicon/core\";\nimport { cx } from \"../cx\";\nimport { wireNavbar } from \"../site\";\nimport { NavbarContext } from \"./navbar-context\";\nimport { NavigationMenu, type NavMenuItem } from \"./NavigationMenu\";\n\nexport interface NavbarProps {\n /** Logo y nombre; suele ser un enlace a la portada. */\n brand?: ReactNode;\n /** Enlaces y grupos con panel (los de NavigationMenu). */\n items?: NavMenuItem[];\n /** Acciones al final: búsqueda, tema, llamada a la acción. Quedan fuera del cajón. */\n actions?: ReactNode;\n /** `floating`: dos barras de cristal separadas; `dock`: una sola barra compacta centrada; `bar`: de borde a borde. */\n variant?: \"floating\" | \"dock\" | \"bar\";\n /** `sticky` (por defecto) se queda arriba al desplazar; `fixed` flota sobre la página; `static`, en su sitio. */\n position?: \"sticky\" | \"fixed\" | \"static\";\n /** Nombre del landmark de navegación. */\n label?: string;\n /** Texto del botón de menú (estrecho). */\n menuLabel?: string;\n /** Nombre del botón que cierra el cajón. */\n closeLabel?: string;\n /** Prefijo de los id internos (paneles, cajón); por defecto, uno generado. */\n id?: string;\n className?: string;\n}\n\nconst useIsoLayoutEffect = typeof document === \"undefined\" ? useEffect : useLayoutEffect;\n\n/**\n * Barra de navegación de un sitio, de cristal. Sin punto de corte fijo: si la fila entera no cabe, los enlaces\n * pasan a un cajón (popover nativo) que abre el botón de menú. Sin JavaScript, el cajón es el modo por defecto.\n */\nexport function Navbar({\n brand,\n items = [],\n actions,\n variant = \"floating\",\n position = \"sticky\",\n label = \"Primary\",\n menuLabel = \"Menu\",\n closeLabel = \"Close menu\",\n className,\n id: idProp,\n}: NavbarProps) {\n const generated = useId();\n const id = idProp ?? generated;\n const menuId = `${id}-menu`;\n const ref = useRef<HTMLElement>(null);\n useIsoLayoutEffect(() => (ref.current ? wireNavbar(ref.current) : undefined), []);\n return (\n <header ref={ref} className={cx(\"z-navbar\", className)} data-variant={variant} data-position={position} data-collapsed=\"\">\n <div className=\"z-navbar__inner\">\n <div className=\"z-navbar__bar z-navbar__main\">\n {brand ? <div className=\"z-navbar__brand\">{brand}</div> : null}\n <nav className=\"z-navbar__nav\" aria-label={label}>\n <button type=\"button\" className=\"z-navbar__toggle\" aria-expanded=\"false\" aria-controls={menuId} popoverTarget={menuId}>\n <Icon name=\"bars-3\" size={18} />\n <span className=\"z-navbar__toggle-label\">{menuLabel}</span>\n </button>\n <div id={menuId} className=\"z-navbar__menu\" popover=\"auto\">\n <div className=\"z-navbar__drawer-head\">\n <span className=\"z-navbar__drawer-title\">{menuLabel}</span>\n <button type=\"button\" className=\"z-navbar__close\" popoverTarget={menuId} popoverTargetAction=\"hide\" aria-label={closeLabel}>\n <Icon name=\"x-mark\" size={18} />\n </button>\n </div>\n <NavbarContext.Provider value={{ embedded: true }}>\n <NavigationMenu items={items} id={`${id}-nav`} />\n </NavbarContext.Provider>\n </div>\n </nav>\n </div>\n {actions ? <div className=\"z-navbar__bar z-navbar__actions\">{actions}</div> : null}\n </div>\n </header>\n );\n}\n"]}
@@ -0,0 +1,41 @@
1
+ import { type ReactNode } from "react";
2
+ import { type IconName } from "@zuccadev-labs/zuix-zicon/core";
3
+ /** Enlace de un panel: título, descripción opcional e icono en baldosa. */
4
+ export interface NavMenuLink {
5
+ label: string;
6
+ href: string;
7
+ description?: string;
8
+ icon?: IconName;
9
+ /** Página actual (`aria-current="page"`). */
10
+ current?: boolean;
11
+ }
12
+ /** Entrada de primer nivel: un enlace o un grupo con su panel. */
13
+ export type NavMenuItem = {
14
+ label: string;
15
+ href: string;
16
+ current?: boolean;
17
+ } | {
18
+ label: string;
19
+ /** Enlaces del panel. */
20
+ links: NavMenuLink[];
21
+ /** Columnas del panel (1–3). */
22
+ columns?: 1 | 2 | 3;
23
+ /** Pie del panel (un enlace «ver todo», un aviso). */
24
+ footer?: ReactNode;
25
+ };
26
+ export interface NavigationMenuProps {
27
+ items: NavMenuItem[];
28
+ /** Nombre del landmark de navegación. */
29
+ label?: string;
30
+ /** Horizontal: paneles flotantes. Vertical: grupos que se despliegan en su sitio (cajón, barra lateral). */
31
+ orientation?: "horizontal" | "vertical";
32
+ /** Prefijo de los id internos (paneles, cajón); por defecto, uno generado. */
33
+ id?: string;
34
+ className?: string;
35
+ }
36
+ /**
37
+ * Menús de sitio con paneles (patrón disclosure de navegación, no menú de aplicación): enlaces y grupos cuyo botón
38
+ * abre un panel de enlaces con descripción. Horizontal, el panel flota (popover nativo, se abre también sin
39
+ * JavaScript); vertical, se despliega en su sitio.
40
+ */
41
+ export declare function NavigationMenu({ items, label, orientation, className, id: idProp }: NavigationMenuProps): import("react").JSX.Element;
@@ -0,0 +1,37 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useContext, useEffect, useId, useLayoutEffect, useRef } from "react";
4
+ import { Icon } from "@zuccadev-labs/zuix-zicon/core";
5
+ import { cx } from "../cx.js";
6
+ import { syncNavMenu, wireNavMenu } from "../site.js";
7
+ import { NavbarContext } from "./navbar-context.js";
8
+ const useIsoLayoutEffect = typeof document === "undefined" ? useEffect : useLayoutEffect;
9
+ /**
10
+ * Menús de sitio con paneles (patrón disclosure de navegación, no menú de aplicación): enlaces y grupos cuyo botón
11
+ * abre un panel de enlaces con descripción. Horizontal, el panel flota (popover nativo, se abre también sin
12
+ * JavaScript); vertical, se despliega en su sitio.
13
+ */
14
+ export function NavigationMenu({ items, label = "Main", orientation = "horizontal", className, id: idProp }) {
15
+ const generated = useId();
16
+ const id = idProp ?? generated;
17
+ const ref = useRef(null);
18
+ const embedded = useContext(NavbarContext)?.embedded ?? false;
19
+ useEffect(() => (ref.current && !embedded ? wireNavMenu(ref.current) : undefined), [embedded]);
20
+ // Tras cada render (grupos nuevos), el modo de cada panel vuelve a ser el de la orientación.
21
+ useIsoLayoutEffect(() => {
22
+ if (ref.current && !embedded)
23
+ syncNavMenu(ref.current);
24
+ });
25
+ const Tag = embedded ? "div" : "nav";
26
+ const horizontal = embedded ? false : orientation === "horizontal";
27
+ return (_jsx(Tag, { ref: (node) => {
28
+ ref.current = node;
29
+ }, className: cx("z-navmenu", className), "aria-label": embedded ? undefined : label, "data-orientation": embedded ? "vertical" : orientation, children: _jsx("ul", { className: "z-navmenu__list", children: items.map((item, i) => {
30
+ if ("href" in item)
31
+ return (_jsx("li", { className: "z-navmenu__item", children: _jsx("a", { className: "z-navmenu__link", href: item.href, "aria-current": item.current ? "page" : undefined, children: item.label }) }, item.label));
32
+ const panelId = `${id}-p${i}`;
33
+ const current = item.links.some((l) => l.current);
34
+ return (_jsxs("li", { className: "z-navmenu__item", children: [_jsxs("button", { type: "button", className: "z-navmenu__trigger", "aria-expanded": "false", "aria-controls": panelId, "data-current": current ? "" : undefined, ...(horizontal ? { popoverTarget: panelId } : {}), children: [item.label, _jsx(Icon, { name: "chevron-down-small", size: 16, className: "z-navmenu__chevron" })] }), _jsxs("div", { id: panelId, className: "z-navmenu__panel", popover: horizontal ? "auto" : undefined, children: [_jsx("ul", { className: "z-navmenu__grid", "data-columns": item.columns ?? (item.links.length > 3 ? 2 : 1), children: item.links.map((l) => (_jsx("li", { children: _jsxs("a", { className: "z-navmenu__card", href: l.href, "aria-current": l.current ? "page" : undefined, children: [l.icon ? (_jsx("span", { className: "z-navmenu__icon", children: _jsx(Icon, { name: l.icon, size: 16 }) })) : null, _jsxs("span", { className: "z-navmenu__text", children: [_jsx("span", { className: "z-navmenu__title", children: l.label }), l.description ? _jsx("span", { className: "z-navmenu__desc", children: l.description }) : null] })] }) }, l.href))) }), item.footer ? _jsx("div", { className: "z-navmenu__footer", children: item.footer }) : null] })] }, item.label));
35
+ }) }) }));
36
+ }
37
+ //# sourceMappingURL=NavigationMenu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavigationMenu.js","sourceRoot":"","sources":["../../../src/layouts/NavigationMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,MAA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,KA/BC,IAAI,CAAC,KAAK,CAgCd,CACN,CAAC;YACJ,CAAC,CAAC,GACC,GACD,CACP,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\nimport { useContext, useEffect, useId, useLayoutEffect, useRef, type ReactNode } from \"react\";\nimport { Icon, type IconName } from \"@zuccadev-labs/zuix-zicon/core\";\nimport { cx } from \"../cx\";\nimport { syncNavMenu, wireNavMenu } from \"../site\";\nimport { NavbarContext } from \"./navbar-context\";\n\n/** Enlace de un panel: título, descripción opcional e icono en baldosa. */\nexport interface NavMenuLink {\n label: string;\n href: string;\n description?: string;\n icon?: IconName;\n /** Página actual (`aria-current=\"page\"`). */\n current?: boolean;\n}\n\n/** Entrada de primer nivel: un enlace o un grupo con su panel. */\nexport type NavMenuItem =\n | { label: string; href: string; current?: boolean }\n | {\n label: string;\n /** Enlaces del panel. */\n links: NavMenuLink[];\n /** Columnas del panel (1–3). */\n columns?: 1 | 2 | 3;\n /** Pie del panel (un enlace «ver todo», un aviso). */\n footer?: ReactNode;\n };\n\nexport interface NavigationMenuProps {\n items: NavMenuItem[];\n /** Nombre del landmark de navegación. */\n label?: string;\n /** Horizontal: paneles flotantes. Vertical: grupos que se despliegan en su sitio (cajón, barra lateral). */\n orientation?: \"horizontal\" | \"vertical\";\n /** Prefijo de los id internos (paneles, cajón); por defecto, uno generado. */\n id?: string;\n className?: string;\n}\n\nconst useIsoLayoutEffect = typeof document === \"undefined\" ? useEffect : useLayoutEffect;\n\n/**\n * Menús de sitio con paneles (patrón disclosure de navegación, no menú de aplicación): enlaces y grupos cuyo botón\n * abre un panel de enlaces con descripción. Horizontal, el panel flota (popover nativo, se abre también sin\n * JavaScript); vertical, se despliega en su sitio.\n */\nexport function NavigationMenu({ items, label = \"Main\", orientation = \"horizontal\", className, id: idProp }: NavigationMenuProps) {\n const generated = useId();\n const id = idProp ?? generated;\n const ref = useRef<HTMLElement | null>(null);\n const embedded = useContext(NavbarContext)?.embedded ?? false;\n useEffect(() => (ref.current && !embedded ? wireNavMenu(ref.current) : undefined), [embedded]);\n // Tras cada render (grupos nuevos), el modo de cada panel vuelve a ser el de la orientación.\n useIsoLayoutEffect(() => {\n if (ref.current && !embedded) syncNavMenu(ref.current);\n });\n const Tag = embedded ? \"div\" : \"nav\";\n const horizontal = embedded ? false : orientation === \"horizontal\";\n return (\n <Tag\n ref={(node: HTMLElement | null) => {\n ref.current = node;\n }}\n className={cx(\"z-navmenu\", className)}\n aria-label={embedded ? undefined : label}\n data-orientation={embedded ? \"vertical\" : orientation}\n >\n <ul className=\"z-navmenu__list\">\n {items.map((item, i) => {\n if (\"href\" in item)\n return (\n <li key={item.label} className=\"z-navmenu__item\">\n <a className=\"z-navmenu__link\" href={item.href} aria-current={item.current ? \"page\" : undefined}>\n {item.label}\n </a>\n </li>\n );\n const panelId = `${id}-p${i}`;\n const current = item.links.some((l) => l.current);\n return (\n <li key={item.label} className=\"z-navmenu__item\">\n <button\n type=\"button\"\n className=\"z-navmenu__trigger\"\n aria-expanded=\"false\"\n aria-controls={panelId}\n data-current={current ? \"\" : undefined}\n {...(horizontal ? { popoverTarget: panelId } : {})}\n >\n {item.label}\n <Icon name=\"chevron-down-small\" size={16} className=\"z-navmenu__chevron\" />\n </button>\n <div id={panelId} className=\"z-navmenu__panel\" popover={horizontal ? \"auto\" : undefined}>\n <ul className=\"z-navmenu__grid\" data-columns={item.columns ?? (item.links.length > 3 ? 2 : 1)}>\n {item.links.map((l) => (\n <li key={l.href}>\n <a className=\"z-navmenu__card\" href={l.href} aria-current={l.current ? \"page\" : undefined}>\n {l.icon ? (\n <span className=\"z-navmenu__icon\">\n <Icon name={l.icon} size={16} />\n </span>\n ) : null}\n <span className=\"z-navmenu__text\">\n <span className=\"z-navmenu__title\">{l.label}</span>\n {l.description ? <span className=\"z-navmenu__desc\">{l.description}</span> : null}\n </span>\n </a>\n </li>\n ))}\n </ul>\n {item.footer ? <div className=\"z-navmenu__footer\">{item.footer}</div> : null}\n </div>\n </li>\n );\n })}\n </ul>\n </Tag>\n );\n}\n"]}
@@ -55,10 +55,15 @@ export interface PageProps {
55
55
  header?: ReactNode;
56
56
  children: ReactNode;
57
57
  width?: ContainerProps["width"];
58
+ /**
59
+ * Nombre accesible de la región desplazable. La página es enfocable (`tabindex="0"`) para que el teclado pueda
60
+ * desplazarla aunque no tenga controles. Por defecto, "Page content".
61
+ */
62
+ label?: string;
58
63
  className?: string;
59
64
  }
60
65
  /** Página con desplazamiento propio dentro del área principal del Shell. */
61
- export declare function Page({ header, children, width, className }: PageProps): import("react").JSX.Element;
66
+ export declare function Page({ header, children, width, label, className }: PageProps): import("react").JSX.Element;
62
67
  export interface PageSectionProps {
63
68
  title?: ReactNode;
64
69
  description?: ReactNode;
@@ -23,8 +23,8 @@ export function PageHeader({ title, description, eyebrow, actions, breadcrumb, h
23
23
  return (_jsxs("header", { className: cx("z-pagehead", className), children: [breadcrumb, _jsxs("div", { className: "z-pagehead__row", children: [_jsxs("div", { className: "z-pagehead__text", children: [eyebrow ? _jsx("div", { className: "z-pagehead__eyebrow", children: eyebrow }) : null, _jsx(Heading, { className: "z-pagehead__title", children: title }), description ? _jsx("p", { className: "z-pagehead__description", children: description }) : null] }), actions ? _jsx("div", { className: "z-pagehead__actions", children: actions }) : null] })] }));
24
24
  }
25
25
  /** Página con desplazamiento propio dentro del área principal del Shell. */
26
- export function Page({ header, children, width = "content", className }) {
27
- return (_jsx("div", { className: cx("z-page", className), children: _jsxs(Container, { width: width, children: [header, _jsx("div", { className: "z-page__body", children: children })] }) }));
26
+ export function Page({ header, children, width = "content", label = "Page content", className }) {
27
+ return (_jsx("div", { className: cx("z-page", className), role: "region", "aria-label": label, tabIndex: 0, children: _jsxs(Container, { width: width, children: [header, _jsx("div", { className: "z-page__body", children: children })] }) }));
28
28
  }
29
29
  /** Sección de página con título opcional. */
30
30
  export function PageSection({ title, description, actions, children, headingLevel = 2, className }) {