@rubenpazch/tooltip 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 +29 -2
- package/dist/Tooltip.d.ts +17 -0
- package/dist/Tooltip.d.ts.map +1 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -0
- package/package.json +75 -3
package/README.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @rubenpazch/tooltip
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!-- catalogo:inicio (generado por pnpm catalogo, no editar) -->
|
|
4
|
+
|
|
5
|
+
Texto de ayuda breve al pasar el mouse o enfocar con teclado (role="tooltip", aria-describedby), se cierra con Escape.
|
|
6
|
+
|
|
7
|
+
- **Usar cuando:** Explicar un botón de solo icono o un dato abreviado.
|
|
8
|
+
- **Evitar cuando:** Información importante o acciones: muéstrala en la página o usa Menu/Modal. En móvil no hay hover: no ocultes ahí lo esencial.
|
|
9
|
+
|
|
10
|
+
Se recomienda instalar el paquete completo `@rubenpazch/ui` (incluye este). Por separado:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @rubenpazch/tooltip
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Tooltip
|
|
17
|
+
|
|
18
|
+
Texto de ayuda al pasar el mouse o enfocar con el teclado; se cierra con Escape. Se asocia al
|
|
19
|
+
elemento con aria-describedby. No pongas acciones dentro: usa Menu o Modal.
|
|
20
|
+
|
|
21
|
+
| Prop | Tipo | Req. | Por defecto | Descripción |
|
|
22
|
+
| ----------- | ------------------------------------------------------------- | ---- | ----------- | ---------------------------------------------------------------------------------- |
|
|
23
|
+
| `children` | `ReactElement<unknown, string \| JSXElementConstructor<any>>` | sí | | Elemento que lo dispara (un botón, un icono con foco). Debe aceptar ref y eventos. |
|
|
24
|
+
| `content` | `ReactNode` | sí | | Texto del tooltip (breve, sin elementos interactivos). |
|
|
25
|
+
| `delay` | `number` | | `300` | Espera en ms antes de mostrarse al pasar el mouse (por defecto 300). |
|
|
26
|
+
| `placement` | `"top" \| "bottom" \| "left" \| "right"` | | `top` | Posición: top (por defecto), bottom, left o right. |
|
|
27
|
+
|
|
28
|
+
Tipos: `TooltipProps`.
|
|
29
|
+
|
|
30
|
+
<!-- catalogo:fin -->
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface TooltipProps {
|
|
3
|
+
/** Texto del tooltip (breve, sin elementos interactivos). */
|
|
4
|
+
content: React.ReactNode;
|
|
5
|
+
/** Elemento que lo dispara (un botón, un icono con foco). Debe aceptar ref y eventos. */
|
|
6
|
+
children: React.ReactElement;
|
|
7
|
+
/** Posición: top (por defecto), bottom, left o right. */
|
|
8
|
+
placement?: "top" | "bottom" | "left" | "right";
|
|
9
|
+
/** Espera en ms antes de mostrarse al pasar el mouse (por defecto 300). */
|
|
10
|
+
delay?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Texto de ayuda al pasar el mouse o enfocar con el teclado; se cierra con Escape. Se asocia al
|
|
14
|
+
* elemento con aria-describedby. No pongas acciones dentro: usa Menu o Modal.
|
|
15
|
+
*/
|
|
16
|
+
export default function Tooltip({ content, children, placement, delay, }: TooltipProps): React.JSX.Element;
|
|
17
|
+
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAIvD,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,yFAAyF;IACzF,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,yDAAyD;IACzD,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAChD,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,OAAO,EACP,QAAQ,EACR,SAAiB,EACjB,KAAW,GACZ,EAAE,YAAY,qBAwDd"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),o=require("react"),t=require("@rubenpazch/shared");var n={wrapper:"Tooltip-module_wrapper__TUOO3",tooltip:"Tooltip-module_tooltip__FWQrv",fade:"Tooltip-module_fade__KtyMf",top:"Tooltip-module_top__vVdJb",bottom:"Tooltip-module_bottom__MzYzq",left:"Tooltip-module_left__s14mq",right:"Tooltip-module_right__R9Wkp"};!function(e,o){void 0===o&&(o={});var t=o.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===t&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".Tooltip-module_wrapper__TUOO3 {\n position: relative;\n display: inline-flex;\n}\n\n.Tooltip-module_tooltip__FWQrv {\n position: absolute;\n z-index: 1100;\n max-width: 16rem;\n width: -moz-max-content;\n width: max-content;\n padding: var(--lb-space-1) var(--lb-space-2);\n border-radius: var(--lb-radius-md);\n background: var(--lb-color-neutral-900);\n color: var(--lb-color-neutral-50);\n font-family: var(--lb-font-sans);\n font-size: var(--lb-font-size-xs);\n line-height: var(--lb-line-height-snug);\n pointer-events: none;\n animation: Tooltip-module_fade__KtyMf 100ms ease-out;\n}\n\n.Tooltip-module_top__vVdJb { bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); }\n.Tooltip-module_bottom__MzYzq { top: calc(100% + 6px); left: 50%; transform: translateX(-50%); }\n.Tooltip-module_left__s14mq { right: calc(100% + 6px); top: 50%; transform: translateY(-50%); }\n.Tooltip-module_right__R9Wkp { left: calc(100% + 6px); top: 50%; transform: translateY(-50%); }\n\n@keyframes Tooltip-module_fade__KtyMf {\n from { opacity: 0; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .Tooltip-module_tooltip__FWQrv { animation: none; }\n}\n"),module.exports=function({content:r,children:l,placement:a="top",delay:i=300}){const s=o.useId(),[d,p]=o.useState(!1),u=o.useRef(null);t.useEscapeKey(()=>p(!1),d);const m=e=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>p(!0),e)},c=()=>{u.current&&clearTimeout(u.current),p(!1)},_=l,f=_.props,h=o.cloneElement(_,{"aria-describedby":[f["aria-describedby"],d?s:void 0].filter(Boolean).join(" ")||void 0,onMouseEnter:e=>{f.onMouseEnter?.(e),m(i)},onMouseLeave:e=>{f.onMouseLeave?.(e),c()},onFocus:e=>{f.onFocus?.(e),m(0)},onBlur:e=>{f.onBlur?.(e),c()}});return e.jsxs("span",{className:n.wrapper,children:[h,d&&e.jsx("span",{role:"tooltip",id:s,className:`${n.tooltip} ${n[a]}`,children: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/Tooltip.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 { useEscapeKey } from \"@rubenpazch/shared\";\nimport styles from \"./Tooltip.module.css\";\n\nexport interface TooltipProps {\n /** Texto del tooltip (breve, sin elementos interactivos). */\n content: React.ReactNode;\n /** Elemento que lo dispara (un botón, un icono con foco). Debe aceptar ref y eventos. */\n children: React.ReactElement;\n /** Posición: top (por defecto), bottom, left o right. */\n placement?: \"top\" | \"bottom\" | \"left\" | \"right\";\n /** Espera en ms antes de mostrarse al pasar el mouse (por defecto 300). */\n delay?: number;\n}\n\n/**\n * Texto de ayuda al pasar el mouse o enfocar con el teclado; se cierra con Escape. Se asocia al\n * elemento con aria-describedby. No pongas acciones dentro: usa Menu o Modal.\n */\nexport default function Tooltip({\n content,\n children,\n placement = \"top\",\n delay = 300,\n}: TooltipProps) {\n const id = useId();\n const [open, setOpen] = useState(false);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEscapeKey(() => setOpen(false), open);\n\n const show = (wait: number) => {\n if (timer.current) clearTimeout(timer.current);\n timer.current = setTimeout(() => setOpen(true), wait);\n };\n const hide = () => {\n if (timer.current) clearTimeout(timer.current);\n setOpen(false);\n };\n\n const child = children as React.ReactElement<Record<string, unknown>>;\n const props = child.props as Record<string, (e: unknown) => void> & {\n \"aria-describedby\"?: string;\n };\n const trigger = React.cloneElement(child, {\n \"aria-describedby\":\n [props[\"aria-describedby\"], open ? id : undefined]\n .filter(Boolean)\n .join(\" \") || undefined,\n onMouseEnter: (e: unknown) => {\n props.onMouseEnter?.(e);\n show(delay);\n },\n onMouseLeave: (e: unknown) => {\n props.onMouseLeave?.(e);\n hide();\n },\n onFocus: (e: unknown) => {\n props.onFocus?.(e);\n show(0);\n },\n onBlur: (e: unknown) => {\n props.onBlur?.(e);\n hide();\n },\n });\n\n return (\n <span className={styles.wrapper}>\n {trigger}\n {open && (\n <span\n role=\"tooltip\"\n id={id}\n className={`${styles.tooltip} ${styles[placement]}`}\n >\n {content}\n </span>\n )}\n </span>\n );\n}\n"],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","content","children","placement","delay","id","useId","open","setOpen","useState","timer","useRef","useEscapeKey","show","wait","current","clearTimeout","setTimeout","hide","child","props","trigger","React","cloneElement","undefined","filter","Boolean","join","onMouseEnter","e","onMouseLeave","onFocus","onBlur","_jsxs","className","styles","wrapper","_jsx","role","tooltip"],"mappings":"0WAAA,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,0qCCNc,UAAkBe,QAC9BA,EAAOC,SACPA,EAAQC,UACRA,EAAY,MAAKC,MACjBA,EAAQ,MAER,MAAMC,EAAKC,EAAAA,SACJC,EAAMC,GAAWC,EAAAA,UAAS,GAC3BC,EAAQC,EAAAA,OAA6C,MAC3DC,EAAAA,aAAa,IAAMJ,GAAQ,GAAQD,GAEnC,MAAMM,EAAQC,IACRJ,EAAMK,SAASC,aAAaN,EAAMK,SACtCL,EAAMK,QAAUE,WAAW,IAAMT,GAAQ,GAAOM,IAE5CI,EAAO,KACPR,EAAMK,SAASC,aAAaN,EAAMK,SACtCP,GAAQ,IAGJW,EAAQjB,EACRkB,EAAQD,EAAMC,MAGdC,EAAUC,EAAMC,aAAaJ,EAAO,CACxC,mBACE,CAACC,EAAM,oBAAqBb,EAAOF,OAAKmB,GACrCC,OAAOC,SACPC,KAAK,WAAQH,EAClBI,aAAeC,IACbT,EAAMQ,eAAeC,GACrBhB,EAAKT,IAEP0B,aAAeD,IACbT,EAAMU,eAAeD,GACrBX,KAEFa,QAAUF,IACRT,EAAMW,UAAUF,GAChBhB,EAAK,IAEPmB,OAASH,IACPT,EAAMY,SAASH,GACfX,OAIJ,OACEe,EAAAA,KAAA,OAAA,CAAMC,UAAWC,EAAOC,QAAOlC,SAAA,CAC5BmB,EACAd,GACC8B,EAAAA,IAAA,OAAA,CACEC,KAAK,UACLjC,GAAIA,EACJ6B,UAAW,GAAGC,EAAOI,WAAWJ,EAAOhC,KAAYD,SAElDD,MAKX","x_google_ignoreList":[0]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface TooltipProps {
|
|
4
|
+
/** Texto del tooltip (breve, sin elementos interactivos). */
|
|
5
|
+
content: React.ReactNode;
|
|
6
|
+
/** Elemento que lo dispara (un botón, un icono con foco). Debe aceptar ref y eventos. */
|
|
7
|
+
children: React.ReactElement;
|
|
8
|
+
/** Posición: top (por defecto), bottom, left o right. */
|
|
9
|
+
placement?: "top" | "bottom" | "left" | "right";
|
|
10
|
+
/** Espera en ms antes de mostrarse al pasar el mouse (por defecto 300). */
|
|
11
|
+
delay?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Texto de ayuda al pasar el mouse o enfocar con el teclado; se cierra con Escape. Se asocia al
|
|
15
|
+
* elemento con aria-describedby. No pongas acciones dentro: usa Menu o Modal.
|
|
16
|
+
*/
|
|
17
|
+
declare function Tooltip({ content, children, placement, delay, }: TooltipProps): React.JSX.Element;
|
|
18
|
+
|
|
19
|
+
export { Tooltip as default };
|
|
20
|
+
export type { TooltipProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as e,jsx as o}from"react/jsx-runtime";import t,{useId as n,useState as r,useRef as l}from"react";import{useEscapeKey as a}from"@rubenpazch/shared";var i={wrapper:"Tooltip-module_wrapper__TUOO3",tooltip:"Tooltip-module_tooltip__FWQrv",fade:"Tooltip-module_fade__KtyMf",top:"Tooltip-module_top__vVdJb",bottom:"Tooltip-module_bottom__MzYzq",left:"Tooltip-module_left__s14mq",right:"Tooltip-module_right__R9Wkp"};function p({content:p,children:d,placement:m="top",delay:s=300}){const u=n(),[c,_]=r(!1),f=l(null);a(()=>_(!1),c);const h=e=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>_(!0),e)},T=()=>{f.current&&clearTimeout(f.current),_(!1)},v=d,b=v.props,y=t.cloneElement(v,{"aria-describedby":[b["aria-describedby"],c?u:void 0].filter(Boolean).join(" ")||void 0,onMouseEnter:e=>{b.onMouseEnter?.(e),h(s)},onMouseLeave:e=>{b.onMouseLeave?.(e),T()},onFocus:e=>{b.onFocus?.(e),h(0)},onBlur:e=>{b.onBlur?.(e),T()}});return e("span",{className:i.wrapper,children:[y,c&&o("span",{role:"tooltip",id:u,className:`${i.tooltip} ${i[m]}`,children:p})]})}!function(e,o){void 0===o&&(o={});var t=o.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===t&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".Tooltip-module_wrapper__TUOO3 {\n position: relative;\n display: inline-flex;\n}\n\n.Tooltip-module_tooltip__FWQrv {\n position: absolute;\n z-index: 1100;\n max-width: 16rem;\n width: -moz-max-content;\n width: max-content;\n padding: var(--lb-space-1) var(--lb-space-2);\n border-radius: var(--lb-radius-md);\n background: var(--lb-color-neutral-900);\n color: var(--lb-color-neutral-50);\n font-family: var(--lb-font-sans);\n font-size: var(--lb-font-size-xs);\n line-height: var(--lb-line-height-snug);\n pointer-events: none;\n animation: Tooltip-module_fade__KtyMf 100ms ease-out;\n}\n\n.Tooltip-module_top__vVdJb { bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); }\n.Tooltip-module_bottom__MzYzq { top: calc(100% + 6px); left: 50%; transform: translateX(-50%); }\n.Tooltip-module_left__s14mq { right: calc(100% + 6px); top: 50%; transform: translateY(-50%); }\n.Tooltip-module_right__R9Wkp { left: calc(100% + 6px); top: 50%; transform: translateY(-50%); }\n\n@keyframes Tooltip-module_fade__KtyMf {\n from { opacity: 0; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .Tooltip-module_tooltip__FWQrv { animation: none; }\n}\n");export{p as default};
|
|
2
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/Tooltip.tsx","../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["import React, { useId, useRef, useState } from \"react\";\nimport { useEscapeKey } from \"@rubenpazch/shared\";\nimport styles from \"./Tooltip.module.css\";\n\nexport interface TooltipProps {\n /** Texto del tooltip (breve, sin elementos interactivos). */\n content: React.ReactNode;\n /** Elemento que lo dispara (un botón, un icono con foco). Debe aceptar ref y eventos. */\n children: React.ReactElement;\n /** Posición: top (por defecto), bottom, left o right. */\n placement?: \"top\" | \"bottom\" | \"left\" | \"right\";\n /** Espera en ms antes de mostrarse al pasar el mouse (por defecto 300). */\n delay?: number;\n}\n\n/**\n * Texto de ayuda al pasar el mouse o enfocar con el teclado; se cierra con Escape. Se asocia al\n * elemento con aria-describedby. No pongas acciones dentro: usa Menu o Modal.\n */\nexport default function Tooltip({\n content,\n children,\n placement = \"top\",\n delay = 300,\n}: TooltipProps) {\n const id = useId();\n const [open, setOpen] = useState(false);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEscapeKey(() => setOpen(false), open);\n\n const show = (wait: number) => {\n if (timer.current) clearTimeout(timer.current);\n timer.current = setTimeout(() => setOpen(true), wait);\n };\n const hide = () => {\n if (timer.current) clearTimeout(timer.current);\n setOpen(false);\n };\n\n const child = children as React.ReactElement<Record<string, unknown>>;\n const props = child.props as Record<string, (e: unknown) => void> & {\n \"aria-describedby\"?: string;\n };\n const trigger = React.cloneElement(child, {\n \"aria-describedby\":\n [props[\"aria-describedby\"], open ? id : undefined]\n .filter(Boolean)\n .join(\" \") || undefined,\n onMouseEnter: (e: unknown) => {\n props.onMouseEnter?.(e);\n show(delay);\n },\n onMouseLeave: (e: unknown) => {\n props.onMouseLeave?.(e);\n hide();\n },\n onFocus: (e: unknown) => {\n props.onFocus?.(e);\n show(0);\n },\n onBlur: (e: unknown) => {\n props.onBlur?.(e);\n hide();\n },\n });\n\n return (\n <span className={styles.wrapper}>\n {trigger}\n {open && (\n <span\n role=\"tooltip\"\n id={id}\n className={`${styles.tooltip} ${styles[placement]}`}\n >\n {content}\n </span>\n )}\n </span>\n );\n}\n","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"],"names":["Tooltip","content","children","placement","delay","id","useId","open","setOpen","useState","timer","useRef","useEscapeKey","show","wait","current","clearTimeout","setTimeout","hide","child","props","trigger","React","cloneElement","undefined","filter","Boolean","join","onMouseEnter","e","onMouseLeave","onFocus","onBlur","_jsxs","className","styles","wrapper","_jsx","role","tooltip","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode"],"mappings":"qaAmBc,SAAUA,GAAQC,QAC9BA,EAAOC,SACPA,EAAQC,UACRA,EAAY,MAAKC,MACjBA,EAAQ,MAER,MAAMC,EAAKC,KACJC,EAAMC,GAAWC,GAAS,GAC3BC,EAAQC,EAA6C,MAC3DC,EAAa,IAAMJ,GAAQ,GAAQD,GAEnC,MAAMM,EAAQC,IACRJ,EAAMK,SAASC,aAAaN,EAAMK,SACtCL,EAAMK,QAAUE,WAAW,IAAMT,GAAQ,GAAOM,IAE5CI,EAAO,KACPR,EAAMK,SAASC,aAAaN,EAAMK,SACtCP,GAAQ,IAGJW,EAAQjB,EACRkB,EAAQD,EAAMC,MAGdC,EAAUC,EAAMC,aAAaJ,EAAO,CACxC,mBACE,CAACC,EAAM,oBAAqBb,EAAOF,OAAKmB,GACrCC,OAAOC,SACPC,KAAK,WAAQH,EAClBI,aAAeC,IACbT,EAAMQ,eAAeC,GACrBhB,EAAKT,IAEP0B,aAAeD,IACbT,EAAMU,eAAeD,GACrBX,KAEFa,QAAUF,IACRT,EAAMW,UAAUF,GAChBhB,EAAK,IAEPmB,OAASH,IACPT,EAAMY,SAASH,GACfX,OAIJ,OACEe,EAAA,OAAA,CAAMC,UAAWC,EAAOC,QAAOlC,SAAA,CAC5BmB,EACAd,GACC8B,EAAA,OAAA,CACEC,KAAK,UACLjC,GAAIA,EACJ6B,UAAW,GAAGC,EAAOI,WAAWJ,EAAOhC,KAAYD,SAElDD,MAKX,EChFA,SAAqBuC,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","x_google_ignoreList":[1]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,78 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rubenpazch/tooltip",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Texto de ayuda al pasar el mouse o enfocar",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/rubenpazch/lbyte-ui-library.git",
|
|
8
|
+
"directory": "packages/tooltip"
|
|
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": "presentacion",
|
|
67
|
+
"resumen": "Texto de ayuda breve al pasar el mouse o enfocar con teclado (role=\"tooltip\", aria-describedby), se cierra con Escape.",
|
|
68
|
+
"usarCuando": "Explicar un botón de solo icono o un dato abreviado.",
|
|
69
|
+
"evitarCuando": "Información importante o acciones: muéstrala en la página o usa Menu/Modal. En móvil no hay hover: no ocultes ahí lo esencial."
|
|
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
|
}
|