@rubenpazch/menu 0.0.0-stage → 0.1.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/README.md CHANGED
@@ -1,3 +1,30 @@
1
- # Temporary Holding Version
1
+ # @rubenpazch/menu
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <!-- catalogo:inicio (generado por pnpm catalogo, no editar) -->
4
+
5
+ Menú de acciones (role="menu") con botón ⋮ por defecto, opciones con icono, peligrosas o deshabilitadas, teclado completo.
6
+
7
+ - **Usar cuando:** Acciones secundarias de una fila o tarjeta: Editar, Duplicar, Anular, Eliminar.
8
+ - **Evitar cuando:** La acción principal: usa Button. Navegación del sitio: usa AppShell o enlaces.
9
+
10
+ Se recomienda instalar el paquete completo `@rubenpazch/ui` (incluye este). Por separado:
11
+
12
+ ```bash
13
+ npm install @rubenpazch/menu
14
+ ```
15
+
16
+ ## Menu
17
+
18
+ Menú de acciones (role="menu"): ⋮ con Editar, Duplicar, Eliminar… Flechas, Inicio, Fin,
19
+ Enter y Escape; se cierra al elegir o al hacer clic fuera.
20
+
21
+ | Prop | Tipo | Req. | Por defecto | Descripción |
22
+ | --------- | ------------------ | ---- | -------------- | ------------------------------------------------------------------------------ |
23
+ | `items` | `MenuItem[]` | sí | | Opciones del menú. |
24
+ | `align` | `"start" \| "end"` | | `end` | Alineación del panel respecto al botón: end (por defecto) o start. |
25
+ | `label` | `string` | | `Más opciones` | Texto accesible del botón por defecto (por defecto "Más opciones"). |
26
+ | `trigger` | `ReactNode` | | | Botón que lo abre. Por defecto un botón "⋮" con el texto accesible de `label`. |
27
+
28
+ Tipos: `MenuProps`, `MenuItem`.
29
+
30
+ <!-- catalogo:fin -->
package/dist/Menu.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ import React from "react";
2
+ export interface MenuItem {
3
+ /** Texto de la opción. */
4
+ label: React.ReactNode;
5
+ /** Al elegirla. */
6
+ onSelect?: () => void;
7
+ /** Si es un enlace. */
8
+ href?: string;
9
+ /** Icono a la izquierda. */
10
+ icon?: React.ReactNode;
11
+ /** Acción destructiva (en rojo). */
12
+ danger?: boolean;
13
+ disabled?: boolean;
14
+ }
15
+ export interface MenuProps {
16
+ /** Opciones del menú. */
17
+ items: MenuItem[];
18
+ /** Botón que lo abre. Por defecto un botón "⋮" con el texto accesible de `label`. */
19
+ trigger?: React.ReactElement;
20
+ /** Texto accesible del botón por defecto (por defecto "Más opciones"). */
21
+ label?: string;
22
+ /** Alineación del panel respecto al botón: end (por defecto) o start. */
23
+ align?: "start" | "end";
24
+ }
25
+ /**
26
+ * Menú de acciones (role="menu"): ⋮ con Editar, Duplicar, Eliminar… Flechas, Inicio, Fin,
27
+ * Enter y Escape; se cierra al elegir o al hacer clic fuera.
28
+ */
29
+ export default function Menu({ items, trigger, label, align, }: MenuProps): React.JSX.Element;
30
+ //# sourceMappingURL=Menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../src/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAIvD,MAAM,WAAW,QAAQ;IACvB,0BAA0B;IAC1B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,mBAAmB;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,oCAAoC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,yBAAyB;IACzB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,qFAAqF;IACrF,OAAO,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;CACzB;AAKD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAC3B,KAAK,EACL,OAAO,EACP,KAAsB,EACtB,KAAa,GACd,EAAE,SAAS,qBAwIX"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),n=require("react"),r=require("@rubenpazch/shared");var o={root:"Menu-module_root__8izH-",trigger:"Menu-module_trigger__uDD8E",menu:"Menu-module_menu__qacoM",end:"Menu-module_end__KxNES",start:"Menu-module_start__VNNFb",item:"Menu-module_item__a7GHP",danger:"Menu-module_danger__l-V4R",disabled:"Menu-module_disabled__jm-9J",icon:"Menu-module_icon__ZdGeL"};!function(e,n){void 0===n&&(n={});var r=n.insertAt;if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===r&&o.firstChild?o.insertBefore(l,o.firstChild):o.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}('.Menu-module_root__8izH- {\n position: relative;\n display: inline-flex;\n}\n\n.Menu-module_trigger__uDD8E {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2rem;\n height: 2rem;\n padding: 0;\n border: 0;\n border-radius: var(--lb-radius-md);\n background: transparent;\n color: var(--lb-color-muted-foreground);\n cursor: pointer;\n}\n\n.Menu-module_trigger__uDD8E:hover,\n.Menu-module_trigger__uDD8E[aria-expanded="true"] {\n background: var(--lb-color-muted);\n color: var(--lb-color-foreground);\n}\n\n.Menu-module_trigger__uDD8E:focus-visible {\n outline: 2px solid var(--lb-color-ring);\n outline-offset: 1px;\n}\n\n.Menu-module_menu__qacoM {\n position: absolute;\n top: calc(100% + 4px);\n z-index: 1050;\n min-width: 11rem;\n padding: var(--lb-space-1);\n border: 1px solid var(--lb-color-border);\n border-radius: var(--lb-radius-lg);\n background: var(--lb-color-background);\n box-shadow: var(--lb-shadow-lg);\n font-family: var(--lb-font-sans);\n}\n\n.Menu-module_end__KxNES { right: 0; }\n.Menu-module_start__VNNFb { left: 0; }\n\n.Menu-module_item__a7GHP {\n display: flex;\n align-items: center;\n gap: var(--lb-space-2);\n width: 100%;\n padding: var(--lb-space-2) var(--lb-space-3);\n border: 0;\n border-radius: var(--lb-radius-md);\n background: transparent;\n color: var(--lb-color-foreground);\n font: inherit;\n font-size: var(--lb-font-size-sm);\n text-align: left;\n text-decoration: none;\n cursor: pointer;\n}\n\n.Menu-module_item__a7GHP:hover,\n.Menu-module_item__a7GHP:focus {\n outline: none;\n background: var(--lb-color-muted);\n}\n\n.Menu-module_danger__l-V4R { color: var(--lb-color-danger); }\n.Menu-module_danger__l-V4R:hover, .Menu-module_danger__l-V4R:focus { background: var(--lb-color-red-subtle); }\n\n.Menu-module_disabled__jm-9J {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.Menu-module_icon__ZdGeL {\n display: inline-flex;\n color: var(--lb-color-muted-foreground);\n}\n\n.Menu-module_danger__l-V4R .Menu-module_icon__ZdGeL { color: inherit; }\n');const l=(...e)=>e.filter(Boolean).join(" ");module.exports=function({items:t,trigger:a,label:d="Más opciones",align:i="end"}){const u=n.useId(),[s,c]=n.useState(!1),m=n.useRef(null),_=n.useRef(null),b=n.useRef([]),g=(e=!0)=>{c(!1),e&&_.current?.focus()};r.useClickOutside(m,()=>c(!1),s),r.useEscapeKey(()=>g(),s);const f=t.map((e,n)=>e.disabled?-1:n).filter(e=>e>=0),p=e=>b.current[e]?.focus(),h=e=>{c(!0),requestAnimationFrame(()=>p("first"===e?f[0]:f[f.length-1]))},v={ref:e=>{_.current=e},"aria-haspopup":"menu","aria-expanded":s,"aria-controls":s?u:void 0,onClick:()=>s?g(!1):h("first"),onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),h("first")):"ArrowUp"===e.key&&(e.preventDefault(),h("last"))}};return e.jsxs("div",{ref:m,className:o.root,children:[a?n.cloneElement(a,v):e.jsx("button",{type:"button",className:o.trigger,"aria-label":d,...v,children:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",width:"18",height:"18","aria-hidden":"true",children:e.jsx("path",{d:"M10 3a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm0 5.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm1.5 7a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0Z"})})}),s&&e.jsx("div",{id:u,role:"menu",className:l(o.menu,o[i]),children:t.map((n,r)=>{const t={ref:e=>{b.current[r]=e},role:"menuitem",tabIndex:-1,"aria-disabled":n.disabled||void 0,className:l(o.item,n.danger&&o.danger,n.disabled&&o.disabled),onKeyDown:e=>((e,n)=>{const r=f.indexOf(n);let o;"ArrowDown"===e.key?o=f[(r+1)%f.length]:"ArrowUp"===e.key?o=f[(r-1+f.length)%f.length]:"Home"===e.key?o=f[0]:"End"===e.key?o=f[f.length-1]:"Tab"===e.key&&c(!1),void 0!==o&&(e.preventDefault(),p(o))})(e,r),onClick:e=>{n.disabled?e.preventDefault():(n.onSelect?.(),g())}},a=e.jsxs(e.Fragment,{children:[n.icon&&e.jsx("span",{className:o.icon,"aria-hidden":"true",children:n.icon}),n.label]});return n.href?e.jsx("a",{href:n.href,...t,children:a},r):e.jsx("button",{type:"button",...t,children:a},r)})})]})};
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../src/Menu.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React, { useId, useRef, useState } from \"react\";\nimport { useClickOutside, useEscapeKey } from \"@rubenpazch/shared\";\nimport styles from \"./Menu.module.css\";\n\nexport interface MenuItem {\n /** Texto de la opción. */\n label: React.ReactNode;\n /** Al elegirla. */\n onSelect?: () => void;\n /** Si es un enlace. */\n href?: string;\n /** Icono a la izquierda. */\n icon?: React.ReactNode;\n /** Acción destructiva (en rojo). */\n danger?: boolean;\n disabled?: boolean;\n}\n\nexport interface MenuProps {\n /** Opciones del menú. */\n items: MenuItem[];\n /** Botón que lo abre. Por defecto un botón \"⋮\" con el texto accesible de `label`. */\n trigger?: React.ReactElement;\n /** Texto accesible del botón por defecto (por defecto \"Más opciones\"). */\n label?: string;\n /** Alineación del panel respecto al botón: end (por defecto) o start. */\n align?: \"start\" | \"end\";\n}\n\nconst cx = (...c: Array<string | false | undefined>) =>\n c.filter(Boolean).join(\" \");\n\n/**\n * Menú de acciones (role=\"menu\"): ⋮ con Editar, Duplicar, Eliminar… Flechas, Inicio, Fin,\n * Enter y Escape; se cierra al elegir o al hacer clic fuera.\n */\nexport default function Menu({\n items,\n trigger,\n label = \"Más opciones\",\n align = \"end\",\n}: MenuProps) {\n const id = useId();\n const [open, setOpen] = useState(false);\n const root = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLElement | null>(null);\n const itemRefs = useRef<Array<HTMLElement | null>>([]);\n\n const close = (focusTrigger = true) => {\n setOpen(false);\n if (focusTrigger) triggerRef.current?.focus();\n };\n useClickOutside(root, () => setOpen(false), open);\n useEscapeKey(() => close(), open);\n\n const enabledIdx = items\n .map((it, i) => (it.disabled ? -1 : i))\n .filter((i) => i >= 0);\n const focusItem = (i: number) => itemRefs.current[i]?.focus();\n const openAndFocus = (which: \"first\" | \"last\") => {\n setOpen(true);\n requestAnimationFrame(() =>\n focusItem(\n which === \"first\" ? enabledIdx[0] : enabledIdx[enabledIdx.length - 1],\n ),\n );\n };\n\n const triggerProps = {\n ref: (el: HTMLElement | null) => {\n triggerRef.current = el;\n },\n \"aria-haspopup\": \"menu\" as const,\n \"aria-expanded\": open,\n \"aria-controls\": open ? id : undefined,\n onClick: () => (open ? close(false) : openAndFocus(\"first\")),\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n openAndFocus(\"first\");\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n openAndFocus(\"last\");\n }\n },\n };\n\n const onItemKey = (e: React.KeyboardEvent, i: number) => {\n const pos = enabledIdx.indexOf(i);\n let target: number | undefined;\n if (e.key === \"ArrowDown\")\n target = enabledIdx[(pos + 1) % enabledIdx.length];\n else if (e.key === \"ArrowUp\")\n target = enabledIdx[(pos - 1 + enabledIdx.length) % enabledIdx.length];\n else if (e.key === \"Home\") target = enabledIdx[0];\n else if (e.key === \"End\") target = enabledIdx[enabledIdx.length - 1];\n else if (e.key === \"Tab\") setOpen(false);\n if (target !== undefined) {\n e.preventDefault();\n focusItem(target);\n }\n };\n\n return (\n <div ref={root} className={styles.root}>\n {trigger ? (\n React.cloneElement(\n trigger as React.ReactElement<Record<string, unknown>>,\n triggerProps,\n )\n ) : (\n <button\n type=\"button\"\n className={styles.trigger}\n aria-label={label}\n {...triggerProps}\n >\n <svg\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n width=\"18\"\n height=\"18\"\n aria-hidden=\"true\"\n >\n <path d=\"M10 3a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm0 5.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm1.5 7a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0Z\" />\n </svg>\n </button>\n )}\n {open && (\n <div id={id} role=\"menu\" className={cx(styles.menu, styles[align])}>\n {items.map((item, i) => {\n const common = {\n ref: (el: HTMLElement | null) => {\n itemRefs.current[i] = el;\n },\n role: \"menuitem\",\n tabIndex: -1,\n \"aria-disabled\": item.disabled || undefined,\n className: cx(\n styles.item,\n item.danger && styles.danger,\n item.disabled && styles.disabled,\n ),\n onKeyDown: (e: React.KeyboardEvent) => onItemKey(e, i),\n onClick: (e: React.MouseEvent) => {\n if (item.disabled) {\n e.preventDefault();\n return;\n }\n item.onSelect?.();\n close();\n },\n };\n const body = (\n <>\n {item.icon && (\n <span className={styles.icon} aria-hidden=\"true\">\n {item.icon}\n </span>\n )}\n {item.label}\n </>\n );\n return item.href ? (\n <a key={i} href={item.href} {...common}>\n {body}\n </a>\n ) : (\n <button key={i} type=\"button\" {...common}>\n {body}\n </button>\n );\n })}\n </div>\n )}\n </div>\n );\n}\n"],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","cx","c","filter","Boolean","join","items","trigger","label","align","id","useId","open","setOpen","useState","root","useRef","triggerRef","itemRefs","close","focusTrigger","current","focus","useClickOutside","useEscapeKey","enabledIdx","map","it","i","disabled","focusItem","openAndFocus","which","requestAnimationFrame","length","triggerProps","el","undefined","onClick","onKeyDown","e","key","preventDefault","_jsxs","className","styles","children","React","cloneElement","_jsx","viewBox","fill","width","height","d","role","menu","item","common","tabIndex","danger","pos","indexOf","target","onItemKey","onSelect","body","_Fragment","icon","href"],"mappings":"qZAAA,SAAqBA,EAAKC,YACnBA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAM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A,IAAA,IAAA,CAAWoB,KAAMZ,EAAKY,QAAUX,WAC7BQ,GADKtC,GAIRqB,EAAAA,cAAgBvD,KAAK,YAAagE,EAAMZ,SACrCoB,GADUtC,SAS3B","x_google_ignoreList":[0]}
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+
3
+ interface MenuItem {
4
+ /** Texto de la opción. */
5
+ label: React.ReactNode;
6
+ /** Al elegirla. */
7
+ onSelect?: () => void;
8
+ /** Si es un enlace. */
9
+ href?: string;
10
+ /** Icono a la izquierda. */
11
+ icon?: React.ReactNode;
12
+ /** Acción destructiva (en rojo). */
13
+ danger?: boolean;
14
+ disabled?: boolean;
15
+ }
16
+ interface MenuProps {
17
+ /** Opciones del menú. */
18
+ items: MenuItem[];
19
+ /** Botón que lo abre. Por defecto un botón "⋮" con el texto accesible de `label`. */
20
+ trigger?: React.ReactElement;
21
+ /** Texto accesible del botón por defecto (por defecto "Más opciones"). */
22
+ label?: string;
23
+ /** Alineación del panel respecto al botón: end (por defecto) o start. */
24
+ align?: "start" | "end";
25
+ }
26
+ /**
27
+ * Menú de acciones (role="menu"): ⋮ con Editar, Duplicar, Eliminar… Flechas, Inicio, Fin,
28
+ * Enter y Escape; se cierra al elegir o al hacer clic fuera.
29
+ */
30
+ declare function Menu({ items, trigger, label, align, }: MenuProps): React.JSX.Element;
31
+
32
+ export { Menu as default };
33
+ export type { MenuItem, MenuProps };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{jsxs as e,jsx as n,Fragment as r}from"react/jsx-runtime";import o,{useId as l,useState as t,useRef as a}from"react";import{useClickOutside as d,useEscapeKey as i}from"@rubenpazch/shared";var u={root:"Menu-module_root__8izH-",trigger:"Menu-module_trigger__uDD8E",menu:"Menu-module_menu__qacoM",end:"Menu-module_end__KxNES",start:"Menu-module_start__VNNFb",item:"Menu-module_item__a7GHP",danger:"Menu-module_danger__l-V4R",disabled:"Menu-module_disabled__jm-9J",icon:"Menu-module_icon__ZdGeL"};!function(e,n){void 0===n&&(n={});var r=n.insertAt;if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===r&&o.firstChild?o.insertBefore(l,o.firstChild):o.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}('.Menu-module_root__8izH- {\n position: relative;\n display: inline-flex;\n}\n\n.Menu-module_trigger__uDD8E {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 2rem;\n height: 2rem;\n padding: 0;\n border: 0;\n border-radius: var(--lb-radius-md);\n background: transparent;\n color: var(--lb-color-muted-foreground);\n cursor: pointer;\n}\n\n.Menu-module_trigger__uDD8E:hover,\n.Menu-module_trigger__uDD8E[aria-expanded="true"] {\n background: var(--lb-color-muted);\n color: var(--lb-color-foreground);\n}\n\n.Menu-module_trigger__uDD8E:focus-visible {\n outline: 2px solid var(--lb-color-ring);\n outline-offset: 1px;\n}\n\n.Menu-module_menu__qacoM {\n position: absolute;\n top: calc(100% + 4px);\n z-index: 1050;\n min-width: 11rem;\n padding: var(--lb-space-1);\n border: 1px solid var(--lb-color-border);\n border-radius: var(--lb-radius-lg);\n background: var(--lb-color-background);\n box-shadow: var(--lb-shadow-lg);\n font-family: var(--lb-font-sans);\n}\n\n.Menu-module_end__KxNES { right: 0; }\n.Menu-module_start__VNNFb { left: 0; }\n\n.Menu-module_item__a7GHP {\n display: flex;\n align-items: center;\n gap: var(--lb-space-2);\n width: 100%;\n padding: var(--lb-space-2) var(--lb-space-3);\n border: 0;\n border-radius: var(--lb-radius-md);\n background: transparent;\n color: var(--lb-color-foreground);\n font: inherit;\n font-size: var(--lb-font-size-sm);\n text-align: left;\n text-decoration: none;\n cursor: pointer;\n}\n\n.Menu-module_item__a7GHP:hover,\n.Menu-module_item__a7GHP:focus {\n outline: none;\n background: var(--lb-color-muted);\n}\n\n.Menu-module_danger__l-V4R { color: var(--lb-color-danger); }\n.Menu-module_danger__l-V4R:hover, .Menu-module_danger__l-V4R:focus { background: var(--lb-color-red-subtle); }\n\n.Menu-module_disabled__jm-9J {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.Menu-module_icon__ZdGeL {\n display: inline-flex;\n color: var(--lb-color-muted-foreground);\n}\n\n.Menu-module_danger__l-V4R .Menu-module_icon__ZdGeL { color: inherit; }\n');const c=(...e)=>e.filter(Boolean).join(" ");function s({items:s,trigger:m,label:_="Más opciones",align:b="end"}){const g=l(),[p,f]=t(!1),h=a(null),v=a(null),M=a([]),x=(e=!0)=>{f(!1),e&&v.current?.focus()};d(h,()=>f(!1),p),i(()=>x(),p);const y=s.map((e,n)=>e.disabled?-1:n).filter(e=>e>=0),D=e=>M.current[e]?.focus(),k=e=>{f(!0),requestAnimationFrame(()=>D("first"===e?y[0]:y[y.length-1]))},w={ref:e=>{v.current=e},"aria-haspopup":"menu","aria-expanded":p,"aria-controls":p?g:void 0,onClick:()=>p?x(!1):k("first"),onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),k("first")):"ArrowUp"===e.key&&(e.preventDefault(),k("last"))}};return e("div",{ref:h,className:u.root,children:[m?o.cloneElement(m,w):n("button",{type:"button",className:u.trigger,"aria-label":_,...w,children:n("svg",{viewBox:"0 0 20 20",fill:"currentColor",width:"18",height:"18","aria-hidden":"true",children:n("path",{d:"M10 3a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm0 5.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm1.5 7a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0Z"})})}),p&&n("div",{id:g,role:"menu",className:c(u.menu,u[b]),children:s.map((o,l)=>{const t={ref:e=>{M.current[l]=e},role:"menuitem",tabIndex:-1,"aria-disabled":o.disabled||void 0,className:c(u.item,o.danger&&u.danger,o.disabled&&u.disabled),onKeyDown:e=>((e,n)=>{const r=y.indexOf(n);let o;"ArrowDown"===e.key?o=y[(r+1)%y.length]:"ArrowUp"===e.key?o=y[(r-1+y.length)%y.length]:"Home"===e.key?o=y[0]:"End"===e.key?o=y[y.length-1]:"Tab"===e.key&&f(!1),void 0!==o&&(e.preventDefault(),D(o))})(e,l),onClick:e=>{o.disabled?e.preventDefault():(o.onSelect?.(),x())}},a=e(r,{children:[o.icon&&n("span",{className:u.icon,"aria-hidden":"true",children:o.icon}),o.label]});return o.href?n("a",{href:o.href,...t,children:a},l):n("button",{type:"button",...t,children:a},l)})})]})}export{s as default};
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../src/Menu.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React, { useId, useRef, useState } from \"react\";\nimport { useClickOutside, useEscapeKey } from \"@rubenpazch/shared\";\nimport styles from \"./Menu.module.css\";\n\nexport interface MenuItem {\n /** Texto de la opción. */\n label: React.ReactNode;\n /** Al elegirla. */\n onSelect?: () => void;\n /** Si es un enlace. */\n href?: string;\n /** Icono a la izquierda. */\n icon?: React.ReactNode;\n /** Acción destructiva (en rojo). */\n danger?: boolean;\n disabled?: boolean;\n}\n\nexport interface MenuProps {\n /** Opciones del menú. */\n items: MenuItem[];\n /** Botón que lo abre. Por defecto un botón \"⋮\" con el texto accesible de `label`. */\n trigger?: React.ReactElement;\n /** Texto accesible del botón por defecto (por defecto \"Más opciones\"). */\n label?: string;\n /** Alineación del panel respecto al botón: end (por defecto) o start. */\n align?: \"start\" | \"end\";\n}\n\nconst cx = (...c: Array<string | false | undefined>) =>\n c.filter(Boolean).join(\" \");\n\n/**\n * Menú de acciones (role=\"menu\"): ⋮ con Editar, Duplicar, Eliminar… Flechas, Inicio, Fin,\n * Enter y Escape; se cierra al elegir o al hacer clic fuera.\n */\nexport default function Menu({\n items,\n trigger,\n label = \"Más opciones\",\n align = \"end\",\n}: MenuProps) {\n const id = useId();\n const [open, setOpen] = useState(false);\n const root = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLElement | null>(null);\n const itemRefs = useRef<Array<HTMLElement | null>>([]);\n\n const close = (focusTrigger = true) => {\n setOpen(false);\n if (focusTrigger) triggerRef.current?.focus();\n };\n useClickOutside(root, () => setOpen(false), open);\n useEscapeKey(() => close(), open);\n\n const enabledIdx = items\n .map((it, i) => (it.disabled ? -1 : i))\n .filter((i) => i >= 0);\n const focusItem = (i: number) => itemRefs.current[i]?.focus();\n const openAndFocus = (which: \"first\" | \"last\") => {\n setOpen(true);\n requestAnimationFrame(() =>\n focusItem(\n which === \"first\" ? enabledIdx[0] : enabledIdx[enabledIdx.length - 1],\n ),\n );\n };\n\n const triggerProps = {\n ref: (el: HTMLElement | null) => {\n triggerRef.current = el;\n },\n \"aria-haspopup\": \"menu\" as const,\n \"aria-expanded\": open,\n \"aria-controls\": open ? id : undefined,\n onClick: () => (open ? close(false) : openAndFocus(\"first\")),\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n openAndFocus(\"first\");\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n openAndFocus(\"last\");\n }\n },\n };\n\n const onItemKey = (e: React.KeyboardEvent, i: number) => {\n const pos = enabledIdx.indexOf(i);\n let target: number | undefined;\n if (e.key === \"ArrowDown\")\n target = enabledIdx[(pos + 1) % enabledIdx.length];\n else if (e.key === \"ArrowUp\")\n target = enabledIdx[(pos - 1 + enabledIdx.length) % enabledIdx.length];\n else if (e.key === \"Home\") target = enabledIdx[0];\n else if (e.key === \"End\") target = enabledIdx[enabledIdx.length - 1];\n else if (e.key === \"Tab\") setOpen(false);\n if (target !== undefined) {\n e.preventDefault();\n focusItem(target);\n }\n };\n\n return (\n <div ref={root} className={styles.root}>\n {trigger ? (\n React.cloneElement(\n trigger as React.ReactElement<Record<string, unknown>>,\n triggerProps,\n )\n ) : (\n <button\n type=\"button\"\n className={styles.trigger}\n aria-label={label}\n {...triggerProps}\n >\n <svg\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n width=\"18\"\n height=\"18\"\n aria-hidden=\"true\"\n >\n <path d=\"M10 3a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm0 5.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm1.5 7a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0Z\" />\n </svg>\n </button>\n )}\n {open && (\n <div id={id} role=\"menu\" className={cx(styles.menu, styles[align])}>\n {items.map((item, i) => {\n const common = {\n ref: (el: HTMLElement | null) => {\n itemRefs.current[i] = el;\n },\n role: \"menuitem\",\n tabIndex: -1,\n \"aria-disabled\": item.disabled || undefined,\n className: cx(\n styles.item,\n item.danger && styles.danger,\n item.disabled && styles.disabled,\n ),\n onKeyDown: (e: React.KeyboardEvent) => onItemKey(e, i),\n onClick: (e: React.MouseEvent) => {\n if (item.disabled) {\n e.preventDefault();\n return;\n }\n item.onSelect?.();\n close();\n },\n };\n const body = (\n <>\n {item.icon && (\n <span className={styles.icon} aria-hidden=\"true\">\n {item.icon}\n </span>\n )}\n {item.label}\n </>\n );\n return item.href ? (\n <a key={i} href={item.href} {...common}>\n {body}\n </a>\n ) : (\n <button key={i} type=\"button\" {...common}>\n {body}\n </button>\n );\n })}\n </div>\n )}\n </div>\n );\n}\n"],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","cx","c","filter","Boolean","join","Menu","items","trigger","label","align","id","useId","open","setOpen","useState","root","useRef","triggerRef","itemRefs","close","focusTrigger","current","focus","useClickOutside","useEscapeKey","enabledIdx","map","it","i","disabled","focusItem","openAndFocus","which","requestAnimationFrame","length","triggerProps","el","undefined","onClick","onKeyDown","e","key","preventDefault","_jsxs","className","styles","children","React","cloneElement","_jsx","viewBox","fill","width","height","d","role","menu","item","common","tabIndex","danger","pos","indexOf","target","onItemKey","onSelect","body","_Fragment","icon","href"],"mappings":"ofAAA,SAAqBA,EAAKC,YACnBA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,iiECIA,MAAMe,EAAK,IAAIC,IACbA,EAAEC,OAAOC,SAASC,KAAK,KAMX,SAAUC,GAAKC,MAC3BA,EAAKC,QACLA,EAAOC,MACPA,EAAQ,eAAcC,MACtBA,EAAQ,QAER,MAAMC,EAAKC,KACJC,EAAMC,GAAWC,GAAS,GAC3BC,EAAOC,EAAuB,MAC9BC,EAAaD,EAA2B,MACxCE,EAAWF,EAAkC,IAE7CG,EAAQ,CAACC,GAAe,KAC5BP,GAAQ,GACJO,GAAcH,EAAWI,SAASC,SAExCC,EAAgBR,EAAM,IA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AK5B,UAAYgB,EAAOhB,UAE1BU,UAAYC,GAxDN,EAACA,EAAwBZ,KACzC,MAAMiC,EAAMpC,EAAWqC,QAAQlC,GAC/B,IAAImC,EACU,cAAVvB,EAAEC,IACJsB,EAAStC,GAAYoC,EAAM,GAAKpC,EAAWS,QAC1B,YAAVM,EAAEC,IACTsB,EAAStC,GAAYoC,EAAM,EAAIpC,EAAWS,QAAUT,EAAWS,QAC9C,SAAVM,EAAEC,IAAgBsB,EAAStC,EAAW,GAC5B,QAAVe,EAAEC,IAAesB,EAAStC,EAAWA,EAAWS,OAAS,GAC/C,QAAVM,EAAEC,KAAe5B,GAAQ,QACnBwB,IAAX0B,IACFvB,EAAEE,iBACFZ,EAAUiC,KA4CqCC,CAAUxB,EAAGZ,GACpDU,QAAUE,IACJiB,EAAK5B,SACPW,EAAEE,kBAGJe,EAAKQ,aACL9C,OAGE+C,EACJvB,EAAAwB,EAAA,CAAArB,SAAA,CACGW,EAAKW,MACJnB,EAAA,OAAA,CAAML,UAAWC,EAAOuB,KAAI,cAAc,OAAMtB,SAC7CW,EAAKW,OAGTX,EAAKjD,SAGV,OAAOiD,EAAKY,KACVpB,EAAA,IAAA,CAAWoB,KAAMZ,EAAKY,QAAUX,WAC7BQ,GADKtC,GAIRqB,YAAgBxD,KAAK,YAAaiE,EAAMZ,SACrCoB,GADUtC,SAS3B","x_google_ignoreList":[0]}
package/package.json CHANGED
@@ -1,6 +1,78 @@
1
1
  {
2
2
  "name": "@rubenpazch/menu",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Menú de acciones accesible",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/rubenpazch/lbyte-ui-library.git",
8
+ "directory": "packages/menu"
9
+ },
10
+ "license": "MIT",
11
+ "main": "dist/index.cjs.js",
12
+ "module": "dist/index.esm.js",
13
+ "types": "dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.esm.js",
18
+ "require": "./dist/index.cjs.js"
19
+ }
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "sideEffects": [
25
+ "**/*.css"
26
+ ],
27
+ "peerDependencies": {
28
+ "react": "^19.2.3",
29
+ "react-dom": "^19.2.3",
30
+ "@rubenpazch/tokens": "0.4.0"
31
+ },
32
+ "dependencies": {
33
+ "@rubenpazch/shared": "5.2.0"
34
+ },
35
+ "devDependencies": {
36
+ "@rollup/plugin-commonjs": "^29.0.3",
37
+ "@rollup/plugin-node-resolve": "^16.0.3",
38
+ "@rollup/plugin-terser": "^1.0.0",
39
+ "@rollup/plugin-typescript": "^12.3.0",
40
+ "@testing-library/react": "^16.3.3",
41
+ "@types/jest": "^30.0.0",
42
+ "@types/react": "^19.2.18",
43
+ "@types/react-dom": "^19.2.5",
44
+ "autoprefixer": "^10.5.4",
45
+ "eslint": "^9.39.5",
46
+ "identity-obj-proxy": "^3.0.0",
47
+ "jest": "^30.5.0",
48
+ "jest-environment-jsdom": "^30.5.0",
49
+ "postcss": "^8.5.26",
50
+ "prettier": "^3.9.6",
51
+ "react": "^19.2.8",
52
+ "react-dom": "^19.2.8",
53
+ "rollup": "^4.63.1",
54
+ "rollup-plugin-dts": "^6.5.1",
55
+ "rollup-plugin-postcss": "^4.0.2",
56
+ "rollup-plugin-typescript2": "^0.37.0",
57
+ "tslib": "^2.8.1",
58
+ "typescript": "^6.0.3",
59
+ "@rubenpazch/eslint-config": "4.0.0",
60
+ "@rubenpazch/typescript-config": "3.0.0"
61
+ },
62
+ "publishConfig": {
63
+ "access": "public"
64
+ },
65
+ "lbyte": {
66
+ "categoria": "acciones",
67
+ "resumen": "Menú de acciones (role=\"menu\") con botón ⋮ por defecto, opciones con icono, peligrosas o deshabilitadas, teclado completo.",
68
+ "usarCuando": "Acciones secundarias de una fila o tarjeta: Editar, Duplicar, Anular, Eliminar.",
69
+ "evitarCuando": "La acción principal: usa Button. Navegación del sitio: usa AppShell o enlaces."
70
+ },
71
+ "scripts": {
72
+ "build": "rollup -c",
73
+ "test": "jest --passWithNoTests",
74
+ "test:watch": "jest --watch",
75
+ "lint": "eslint src",
76
+ "clean": "rm -rf dist"
77
+ }
6
78
  }