@techzyapp/ui-library 1.0.39 → 1.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AdminRoot-B2lwjQig.cjs → AdminRoot-CRTBGUxq.cjs} +2 -2
- package/dist/{AdminRoot-B2lwjQig.cjs.map → AdminRoot-CRTBGUxq.cjs.map} +1 -1
- package/dist/{AdminRoot-BTPLhufU.js → AdminRoot-JOgiNkJA.js} +3 -3
- package/dist/{AdminRoot-BTPLhufU.js.map → AdminRoot-JOgiNkJA.js.map} +1 -1
- package/dist/{CodeBlock-BbIC5BRK.cjs → CodeBlock-C3mG_seZ.cjs} +2 -2
- package/dist/{CodeBlock-BbIC5BRK.cjs.map → CodeBlock-C3mG_seZ.cjs.map} +1 -1
- package/dist/{CodeBlock-C8A6E-tJ.js → CodeBlock-DrWRSRmO.js} +2 -2
- package/dist/{CodeBlock-C8A6E-tJ.js.map → CodeBlock-DrWRSRmO.js.map} +1 -1
- package/dist/{ColorRamp-B_-ZPqMa.cjs → ColorRamp-D9_5JULy.cjs} +2 -2
- package/dist/{ColorRamp-B_-ZPqMa.cjs.map → ColorRamp-D9_5JULy.cjs.map} +1 -1
- package/dist/{ColorRamp-CCfImssD.js → ColorRamp-Mp_ddhmb.js} +2 -2
- package/dist/{ColorRamp-CCfImssD.js.map → ColorRamp-Mp_ddhmb.js.map} +1 -1
- package/dist/{CopyButton-CUEEp_Na.cjs → CopyButton-DZeYcG68.cjs} +2 -2
- package/dist/CopyButton-DZeYcG68.cjs.map +1 -0
- package/dist/{CopyButton-BD5sN32G.js → CopyButton-Yg5ZVTiX.js} +2 -2
- package/dist/CopyButton-Yg5ZVTiX.js.map +1 -0
- package/dist/{DescriptionList-BD65gv7C.js → DescriptionList-CG08_qwT.js} +2 -2
- package/dist/{DescriptionList-BD65gv7C.js.map → DescriptionList-CG08_qwT.js.map} +1 -1
- package/dist/{DescriptionList-BlAJIabM.cjs → DescriptionList-S9C6Tp90.cjs} +2 -2
- package/dist/{DescriptionList-BlAJIabM.cjs.map → DescriptionList-S9C6Tp90.cjs.map} +1 -1
- package/dist/{ErrorBoundary-sQY2sFdu.js → ErrorBoundary-BILk_3fM.js} +2 -2
- package/dist/{ErrorBoundary-sQY2sFdu.js.map → ErrorBoundary-BILk_3fM.js.map} +1 -1
- package/dist/{ErrorBoundary-6HvsCoJ8.cjs → ErrorBoundary-JCNa0_Ys.cjs} +2 -2
- package/dist/{ErrorBoundary-6HvsCoJ8.cjs.map → ErrorBoundary-JCNa0_Ys.cjs.map} +1 -1
- package/dist/{ErrorState-DdxOeZy2.js → ErrorState-DI28ZCJN.js} +3 -3
- package/dist/{ErrorState-DdxOeZy2.js.map → ErrorState-DI28ZCJN.js.map} +1 -1
- package/dist/{ErrorState-To_MAOf4.cjs → ErrorState-MQBeyF2n.cjs} +2 -2
- package/dist/{ErrorState-To_MAOf4.cjs.map → ErrorState-MQBeyF2n.cjs.map} +1 -1
- package/dist/{FileUploader-CWH-RS-z.js → FileUploader-DwAl3UXI.js} +2 -2
- package/dist/{FileUploader-CWH-RS-z.js.map → FileUploader-DwAl3UXI.js.map} +1 -1
- package/dist/{FileUploader-H4k4Cm5B.cjs → FileUploader-FMVbj7rz.cjs} +2 -2
- package/dist/{FileUploader-H4k4Cm5B.cjs.map → FileUploader-FMVbj7rz.cjs.map} +1 -1
- package/dist/{LocationPicker-CHGJkMXl.js → LocationPicker-Ce8aLubZ.js} +3 -3
- package/dist/{LocationPicker-CHGJkMXl.js.map → LocationPicker-Ce8aLubZ.js.map} +1 -1
- package/dist/{LocationPicker-CgzZnTFE.cjs → LocationPicker-D-sT4rSe.cjs} +2 -2
- package/dist/{LocationPicker-CgzZnTFE.cjs.map → LocationPicker-D-sT4rSe.cjs.map} +1 -1
- package/dist/Modal-DTnB_mGg.js +206 -0
- package/dist/Modal-DTnB_mGg.js.map +1 -0
- package/dist/Modal-DjSOhZqd.cjs +2 -0
- package/dist/Modal-DjSOhZqd.cjs.map +1 -0
- package/dist/{PageError-9tfvBssn.js → PageError-BORFaxGW.js} +2 -2
- package/dist/{PageError-9tfvBssn.js.map → PageError-BORFaxGW.js.map} +1 -1
- package/dist/{PageError-CJHOUfCa.cjs → PageError-aUV0vUfB.cjs} +2 -2
- package/dist/{PageError-CJHOUfCa.cjs.map → PageError-aUV0vUfB.cjs.map} +1 -1
- package/dist/{PaletteField-AMZpUMID.js → PaletteField-ChG2VQtS.js} +2 -2
- package/dist/{PaletteField-AMZpUMID.js.map → PaletteField-ChG2VQtS.js.map} +1 -1
- package/dist/{PaletteField-ClCvXFdN.cjs → PaletteField-DQ1OvXqe.cjs} +2 -2
- package/dist/{PaletteField-ClCvXFdN.cjs.map → PaletteField-DQ1OvXqe.cjs.map} +1 -1
- package/dist/{RemoveDialog-yEZm6JaC.cjs → RemoveDialog-B_Y18MeJ.cjs} +2 -2
- package/dist/{RemoveDialog-yEZm6JaC.cjs.map → RemoveDialog-B_Y18MeJ.cjs.map} +1 -1
- package/dist/{RemoveDialog-BfPTOs1y.js → RemoveDialog-ayAfGXpB.js} +2 -2
- package/dist/{RemoveDialog-BfPTOs1y.js.map → RemoveDialog-ayAfGXpB.js.map} +1 -1
- package/dist/{RichTextEditor-CitILCiw.cjs → RichTextEditor-DSvSaszc.cjs} +2 -2
- package/dist/{RichTextEditor-CitILCiw.cjs.map → RichTextEditor-DSvSaszc.cjs.map} +1 -1
- package/dist/{RichTextEditor-CgItVhAR.js → RichTextEditor-itYD1PfE.js} +2 -2
- package/dist/{RichTextEditor-CgItVhAR.js.map → RichTextEditor-itYD1PfE.js.map} +1 -1
- package/dist/{RootLayout-CVYEk7Wi.js → RootLayout-BlYjYAYk.js} +3 -3
- package/dist/{RootLayout-CVYEk7Wi.js.map → RootLayout-BlYjYAYk.js.map} +1 -1
- package/dist/{RootLayout-DJ2Xv35m.cjs → RootLayout-D5nlzYlH.cjs} +2 -2
- package/dist/{RootLayout-DJ2Xv35m.cjs.map → RootLayout-D5nlzYlH.cjs.map} +1 -1
- package/dist/{SpeedDial-C2hkC_8p.js → SpeedDial-CEBAWIYo.js} +2 -2
- package/dist/{SpeedDial-C2hkC_8p.js.map → SpeedDial-CEBAWIYo.js.map} +1 -1
- package/dist/{SpeedDial-DRSIilyC.cjs → SpeedDial-D6me6w_m.cjs} +2 -2
- package/dist/{SpeedDial-DRSIilyC.cjs.map → SpeedDial-D6me6w_m.cjs.map} +1 -1
- package/dist/{Table-DDPzTA1H.cjs → Table-CFl3OYlo.cjs} +2 -2
- package/dist/{Table-DDPzTA1H.cjs.map → Table-CFl3OYlo.cjs.map} +1 -1
- package/dist/{Table-AXMp0eiw.js → Table-DChIfjqj.js} +2 -2
- package/dist/{Table-AXMp0eiw.js.map → Table-DChIfjqj.js.map} +1 -1
- package/dist/Tooltip-BbT0uNzy.js +152 -0
- package/dist/Tooltip-BbT0uNzy.js.map +1 -0
- package/dist/Tooltip-DmMq5R1x.cjs +2 -0
- package/dist/Tooltip-DmMq5R1x.cjs.map +1 -0
- package/dist/components/CodeBlock/index.cjs +1 -1
- package/dist/components/CodeBlock/index.js +1 -1
- package/dist/components/ColorRamp/index.cjs +1 -1
- package/dist/components/ColorRamp/index.js +1 -1
- package/dist/components/CopyButton/CopyButton.d.cts +1 -1
- package/dist/components/CopyButton/CopyButton.d.ts +1 -1
- package/dist/components/CopyButton/index.cjs +1 -1
- package/dist/components/CopyButton/index.js +1 -1
- package/dist/components/DescriptionList/index.cjs +1 -1
- package/dist/components/DescriptionList/index.js +1 -1
- package/dist/components/ErrorState/index.cjs +1 -1
- package/dist/components/ErrorState/index.js +2 -2
- package/dist/components/FileUploader/index.cjs +1 -1
- package/dist/components/FileUploader/index.js +1 -1
- package/dist/components/LocationPicker/index.cjs +1 -1
- package/dist/components/LocationPicker/index.js +1 -1
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/PageError/index.cjs +1 -1
- package/dist/components/PageError/index.js +1 -1
- package/dist/components/PaletteField/index.cjs +1 -1
- package/dist/components/PaletteField/index.js +1 -1
- package/dist/components/RemoveDialog/index.cjs +1 -1
- package/dist/components/RemoveDialog/index.js +1 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/RootLayout/index.cjs +1 -1
- package/dist/components/RootLayout/index.js +1 -1
- package/dist/components/SpeedDial/index.cjs +1 -1
- package/dist/components/SpeedDial/index.js +1 -1
- package/dist/components/Table/index.cjs +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.cts +5 -3
- package/dist/components/Tooltip/Tooltip.d.ts +5 -3
- package/dist/components/Tooltip/index.cjs +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/entries/app.cjs +1 -1
- package/dist/entries/app.js +1 -1
- package/dist/entries/components.cjs +1 -1
- package/dist/entries/components.js +17 -17
- package/dist/index.cjs +1 -1
- package/dist/index.js +18 -18
- package/package.json +1 -1
- package/dist/CopyButton-BD5sN32G.js.map +0 -1
- package/dist/CopyButton-CUEEp_Na.cjs.map +0 -1
- package/dist/Modal-BkO_6afj.js +0 -195
- package/dist/Modal-BkO_6afj.js.map +0 -1
- package/dist/Modal-D8V-JZBg.cjs +0 -2
- package/dist/Modal-D8V-JZBg.cjs.map +0 -1
- package/dist/Tooltip-Bw-1Xk2Z.cjs +0 -2
- package/dist/Tooltip-Bw-1Xk2Z.cjs.map +0 -1
- package/dist/Tooltip-DsDv4NOq.js +0 -135
- package/dist/Tooltip-DsDv4NOq.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip-Bw-1Xk2Z.cjs","sources":["../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import {\n cloneElement,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport { clsx } from 'clsx'\nimport type { ThemeColor } from '../../theme'\nimport styles from './Tooltip.module.css'\n\nexport type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right'\n\nexport interface TooltipProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'content' | 'color'> {\n /** The tooltip text/content shown on hover or focus. Empty content renders no tooltip. */\n content: ReactNode\n /**\n * Which side of the trigger the tooltip appears on. Defaults to `top`. Flips to the opposite side when\n * the preferred one has no room in the viewport.\n */\n placement?: TooltipPlacement\n /** Theme palette token for the fill (label uses its contrast color). Defaults to `primary`. */\n color?: ThemeColor\n /** A single focusable element to attach the tooltip to (e.g. a `Button` or `IconButton`). */\n children: ReactElement\n}\n\n/** Bubble ↔ trigger gap (the CSS margin, `--tz-space-xs`) — used here only to decide whether a side fits. */\nconst GAP = 8\n/** Minimum distance kept between the bubble and the viewport edge. */\nconst EDGE = 8\nconst OPPOSITE: Record<TooltipPlacement, TooltipPlacement> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n}\n\ninterface TooltipGeometry {\n side: TooltipPlacement\n /** The anchor point on the trigger's edge (viewport px) — CSS offsets the bubble from it. */\n x: number\n y: number\n /** Cross-axis nudge that keeps the bubble inside the viewport (the arrow counter-shifts). */\n shift: number\n}\n\n/**\n * Where the bubble goes: the preferred side unless only the opposite one fits, anchored at the middle of\n * that trigger edge, nudged along the cross axis so it never runs off-screen.\n */\nfunction computeGeometry(\n trigger: DOMRect,\n bubble: { width: number; height: number },\n placement: TooltipPlacement,\n): TooltipGeometry {\n const vw = window.innerWidth\n const vh = window.innerHeight\n const fits = (side: TooltipPlacement) =>\n side === 'top'\n ? trigger.top - GAP - bubble.height >= EDGE\n : side === 'bottom'\n ? trigger.bottom + GAP + bubble.height <= vh - EDGE\n : side === 'left'\n ? trigger.left - GAP - bubble.width >= EDGE\n : trigger.right + GAP + bubble.width <= vw - EDGE\n const side = !fits(placement) && fits(OPPOSITE[placement]) ? OPPOSITE[placement] : placement\n\n const clampShift = (center: number, half: number, size: number) =>\n center - half < EDGE\n ? EDGE - (center - half)\n : center + half > size - EDGE\n ? size - EDGE - (center + half)\n : 0\n\n if (side === 'top' || side === 'bottom') {\n const x = trigger.left + trigger.width / 2\n return {\n side,\n x,\n y: side === 'top' ? trigger.top : trigger.bottom,\n shift: clampShift(x, bubble.width / 2, vw),\n }\n }\n const y = trigger.top + trigger.height / 2\n return {\n side,\n x: side === 'left' ? trigger.left : trigger.right,\n y,\n shift: clampShift(y, bubble.height / 2, vh),\n }\n}\n\n/**\n * Shows a small floating label on hover or keyboard focus of its child, with an arrow pointing at\n * the trigger. Wrap a single element: `<Tooltip content=\"Save\"><IconButton…/></Tooltip>`. Opens on\n * `mouseenter`/`focus`, closes on `mouseleave`/`blur`/`Escape`. The child gets `aria-describedby`\n * while open (the label has `role=\"tooltip\"`). The bubble is **portaled to `<body>`** with fixed\n * positioning, so a scrolling / `overflow: hidden` ancestor (a `Table`'s scroll area, a `Modal` body)\n * never clips it; it flips to the opposite side when the preferred one has no room, stays inside the\n * viewport, follows the trigger on scroll / resize, and is mounted only while shown. Token-only styling\n * via the shared `--tz-btn-rgb` pattern — `color` (default `primary`) sets the fill and its contrast\n * label, flipping with the theme.\n */\nexport function Tooltip({\n content,\n placement = 'top',\n color = 'primary',\n children,\n className,\n style,\n onKeyDown,\n ...props\n}: TooltipProps) {\n const tooltipId = `${useId()}-tooltip`\n const [open, setOpen] = useState(false)\n // mounted spans the fade-out too; `shown` drives the CSS fade (one frame after the first measure)\n const [mounted, setMounted] = useState(false)\n const [shown, setShown] = useState(false)\n const [geometry, setGeometry] = useState<TooltipGeometry | null>(null)\n const rootRef = useRef<HTMLSpanElement | null>(null)\n const bubbleRef = useRef<HTMLSpanElement | null>(null)\n const hasContent = content !== null && content !== undefined && content !== ''\n\n const measure = useCallback(() => {\n const root = rootRef.current\n const bubble = bubbleRef.current\n if (!root || !bubble) return\n setGeometry(\n computeGeometry(\n root.getBoundingClientRect(),\n { width: bubble.offsetWidth, height: bubble.offsetHeight },\n placement,\n ),\n )\n }, [placement])\n\n useEffect(() => {\n if (open) setMounted(true)\n else setShown(false)\n }, [open])\n\n // measure before paint, then fade in on the next frame (so the bubble never flashes at 0,0)\n useLayoutEffect(() => {\n if (!open || !mounted) return\n measure()\n const frame = requestAnimationFrame(() => setShown(true))\n return () => cancelAnimationFrame(frame)\n }, [open, mounted, measure, content])\n\n // follow the trigger while open — any scroll (capture: a table's scroll area too) or resize\n useEffect(() => {\n if (!open) return\n window.addEventListener('scroll', measure, true)\n window.addEventListener('resize', measure)\n return () => {\n window.removeEventListener('scroll', measure, true)\n window.removeEventListener('resize', measure)\n }\n }, [open, measure])\n\n // unmount once faded out; the timer covers a transition that never fires (no CSS, reduced motion)\n useEffect(() => {\n if (open || !mounted) return\n const timer = window.setTimeout(() => setMounted(false), 400)\n return () => window.clearTimeout(timer)\n }, [open, mounted])\n\n const handleKeyDown = (event: KeyboardEvent<HTMLSpanElement>) => {\n if (event.key === 'Escape') setOpen(false)\n onKeyDown?.(event)\n }\n\n if (!hasContent) return children\n\n const tint = {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n } as CSSProperties\n const side = geometry?.side ?? placement\n // the bubble is portaled out of the wrapper, so CSS variables set through `style` (e.g. a custom\n // `--tz-btn-rgb` / `--tz-btn-on` tint, as CodeBlock's white pill does) are copied onto it explicitly\n const bubbleVars = Object.fromEntries(\n Object.entries(style ?? {}).filter(([property]) => property.startsWith('--')),\n ) as CSSProperties\n\n return (\n <span\n ref={rootRef}\n className={clsx(styles.root, className)}\n style={{ ...tint, ...style }}\n onMouseEnter={() => setOpen(true)}\n onMouseLeave={() => setOpen(false)}\n onFocus={() => setOpen(true)}\n onBlur={() => setOpen(false)}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {open\n ? cloneElement(children as ReactElement<{ 'aria-describedby'?: string }>, {\n 'aria-describedby': tooltipId,\n })\n : children}\n {mounted &&\n typeof document !== 'undefined' &&\n createPortal(\n <span\n ref={bubbleRef}\n role=\"tooltip\"\n id={tooltipId}\n className={clsx(styles.tooltip, styles[side])}\n data-open={open && shown ? 'true' : 'false'}\n style={\n {\n ...tint,\n ...bubbleVars,\n top: geometry?.y ?? 0,\n left: geometry?.x ?? 0,\n '--tz-tooltip-shift': `${geometry?.shift ?? 0}px`,\n } as CSSProperties\n }\n onTransitionEnd={() => {\n if (!open) setMounted(false)\n }}\n >\n {content}\n <span className={styles.arrow} aria-hidden=\"true\" />\n </span>,\n document.body,\n )}\n </span>\n )\n}\n"],"names":["GAP","EDGE","OPPOSITE","computeGeometry","trigger","bubble","placement","vw","vh","fits","side","clampShift","center","half","size","x","y","Tooltip","content","color","children","className","style","onKeyDown","props","tooltipId","useId","open","setOpen","useState","mounted","setMounted","shown","setShown","geometry","setGeometry","rootRef","useRef","bubbleRef","hasContent","measure","useCallback","root","useEffect","useLayoutEffect","frame","timer","handleKeyDown","event","tint","bubbleVars","property","jsxs","clsx","styles","cloneElement","createPortal"],"mappings":"mTAoCMA,EAAM,EAENC,EAAO,EACPC,EAAuD,CAC3D,IAAK,SACL,OAAQ,MACR,KAAM,QACN,MAAO,MACT,EAeA,SAASC,EACPC,EACAC,EACAC,EACiB,CACjB,MAAMC,EAAK,OAAO,WACZC,EAAK,OAAO,YACZC,EAAQC,GACZA,IAAS,MACLN,EAAQ,IAAMJ,EAAMK,EAAO,QAAUJ,EACrCS,IAAS,SACPN,EAAQ,OAASJ,EAAMK,EAAO,QAAUG,EAAKP,EAC7CS,IAAS,OACPN,EAAQ,KAAOJ,EAAMK,EAAO,OAASJ,EACrCG,EAAQ,MAAQJ,EAAMK,EAAO,OAASE,EAAKN,EAC/CS,EAAO,CAACD,EAAKH,CAAS,GAAKG,EAAKP,EAASI,CAAS,CAAC,EAAIJ,EAASI,CAAS,EAAIA,EAE7EK,EAAa,CAACC,EAAgBC,EAAcC,IAChDF,EAASC,EAAOZ,E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hB,EACL,UAAWiB,EAAAA,KAAKC,EAAO,KAAMjC,CAAS,EACtC,MAAO,CAAE,GAAG4B,EAAM,GAAG3B,CAAA,EACrB,aAAc,IAAMM,EAAQ,EAAI,EAChC,aAAc,IAAMA,EAAQ,EAAK,EACjC,QAAS,IAAMA,EAAQ,EAAI,EAC3B,OAAQ,IAAMA,EAAQ,EAAK,EAC3B,UAAWmB,EACV,GAAGvB,EAEH,SAAA,CAAAG,EACG4B,EAAAA,aAAanC,EAA2D,CACtE,mBAAoBK,CAAA,CACrB,EACDL,EACHU,GACC,OAAO,SAAa,KACpB0B,EAAAA,aACEJ,EAAAA,KAAC,OAAA,CACC,IAAKd,EACL,KAAK,UACL,GAAIb,EACJ,UAAW4B,EAAAA,KAAKC,EAAO,QAASA,EAAO5C,CAAI,CAAC,EAC5C,YAAWiB,GAAQK,EAAQ,OAAS,QACpC,MACE,CACE,GAAGiB,EACH,GAAGC,EACH,KAAKhB,GAAA,YAAAA,EAAU,IAAK,EACpB,MAAMA,GAAA,YAAAA,EAAU,IAAK,EACrB,qBAAsB,IAAGA,GAAA,YAAAA,EAAU,QAAS,CAAC,IAAA,EAGjD,gBAAiB,IAAM,CAChBP,GAAMI,EAAW,EAAK,CAC7B,EAEC,SAAA,CAAAb,QACA,OAAA,CAAK,UAAWoC,EAAO,MAAO,cAAY,MAAA,CAAO,CAAA,CAAA,CAAA,EAEpD,SAAS,IAAA,CACX,CAAA,CAAA,CAGR"}
|
package/dist/Tooltip-DsDv4NOq.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { jsxs as j, jsx as I } from "react/jsx-runtime";
|
|
2
|
-
import { useId as M, useState as w, useRef as y, useCallback as N, useEffect as x, useLayoutEffect as W, cloneElement as k } from "react";
|
|
3
|
-
import { createPortal as B } from "react-dom";
|
|
4
|
-
import { clsx as G } from "clsx";
|
|
5
|
-
const H = "_root_1i027_4", q = "_tooltip_1i027_13", V = "_arrow_1i027_41", J = "_top_1i027_49", Q = "_bottom_1i027_59", U = "_left_1i027_69", X = "_right_1i027_79", _ = {
|
|
6
|
-
root: H,
|
|
7
|
-
tooltip: q,
|
|
8
|
-
arrow: V,
|
|
9
|
-
top: J,
|
|
10
|
-
bottom: Q,
|
|
11
|
-
left: U,
|
|
12
|
-
right: X
|
|
13
|
-
}, E = 8, c = 8, P = {
|
|
14
|
-
top: "bottom",
|
|
15
|
-
bottom: "top",
|
|
16
|
-
left: "right",
|
|
17
|
-
right: "left"
|
|
18
|
-
};
|
|
19
|
-
function Y(o, n, l) {
|
|
20
|
-
const u = window.innerWidth, p = window.innerHeight, d = (t) => t === "top" ? o.top - E - n.height >= c : t === "bottom" ? o.bottom + E + n.height <= p - c : t === "left" ? o.left - E - n.width >= c : o.right + E + n.width <= u - c, i = !d(l) && d(P[l]) ? P[l] : l, m = (t, r, f) => t - r < c ? c - (t - r) : t + r > f - c ? f - c - (t + r) : 0;
|
|
21
|
-
if (i === "top" || i === "bottom") {
|
|
22
|
-
const t = o.left + o.width / 2;
|
|
23
|
-
return {
|
|
24
|
-
side: i,
|
|
25
|
-
x: t,
|
|
26
|
-
y: i === "top" ? o.top : o.bottom,
|
|
27
|
-
shift: m(t, n.width / 2, u)
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
const h = o.top + o.height / 2;
|
|
31
|
-
return {
|
|
32
|
-
side: i,
|
|
33
|
-
x: i === "left" ? o.left : o.right,
|
|
34
|
-
y: h,
|
|
35
|
-
shift: m(h, n.height / 2, p)
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function tt({
|
|
39
|
-
content: o,
|
|
40
|
-
placement: n = "top",
|
|
41
|
-
color: l = "primary",
|
|
42
|
-
children: u,
|
|
43
|
-
className: p,
|
|
44
|
-
style: d,
|
|
45
|
-
onKeyDown: i,
|
|
46
|
-
...m
|
|
47
|
-
}) {
|
|
48
|
-
const h = `${M()}-tooltip`, [t, r] = w(!1), [f, b] = w(!1), [R, z] = w(!1), [s, S] = w(null), L = y(null), T = y(null), $ = o != null && o !== "", a = N(() => {
|
|
49
|
-
const e = L.current, v = T.current;
|
|
50
|
-
!e || !v || S(
|
|
51
|
-
Y(
|
|
52
|
-
e.getBoundingClientRect(),
|
|
53
|
-
{ width: v.offsetWidth, height: v.offsetHeight },
|
|
54
|
-
n
|
|
55
|
-
)
|
|
56
|
-
);
|
|
57
|
-
}, [n]);
|
|
58
|
-
x(() => {
|
|
59
|
-
t ? b(!0) : z(!1);
|
|
60
|
-
}, [t]), W(() => {
|
|
61
|
-
if (!t || !f) return;
|
|
62
|
-
a();
|
|
63
|
-
const e = requestAnimationFrame(() => z(!0));
|
|
64
|
-
return () => cancelAnimationFrame(e);
|
|
65
|
-
}, [t, f, a, o]), x(() => {
|
|
66
|
-
if (t)
|
|
67
|
-
return window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
|
|
68
|
-
window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
|
|
69
|
-
};
|
|
70
|
-
}, [t, a]), x(() => {
|
|
71
|
-
if (t || !f) return;
|
|
72
|
-
const e = window.setTimeout(() => b(!1), 400);
|
|
73
|
-
return () => window.clearTimeout(e);
|
|
74
|
-
}, [t, f]);
|
|
75
|
-
const A = (e) => {
|
|
76
|
-
e.key === "Escape" && r(!1), i == null || i(e);
|
|
77
|
-
};
|
|
78
|
-
if (!$) return u;
|
|
79
|
-
const O = {
|
|
80
|
-
"--tz-btn-rgb": `var(--tz-color-${l}-rgb)`,
|
|
81
|
-
"--tz-btn-on": `var(--tz-color-${l}-contrast, #fff)`
|
|
82
|
-
}, C = (s == null ? void 0 : s.side) ?? n, F = Object.fromEntries(
|
|
83
|
-
Object.entries(d ?? {}).filter(([e]) => e.startsWith("--"))
|
|
84
|
-
);
|
|
85
|
-
return /* @__PURE__ */ j(
|
|
86
|
-
"span",
|
|
87
|
-
{
|
|
88
|
-
ref: L,
|
|
89
|
-
className: G(_.root, p),
|
|
90
|
-
style: { ...O, ...d },
|
|
91
|
-
onMouseEnter: () => r(!0),
|
|
92
|
-
onMouseLeave: () => r(!1),
|
|
93
|
-
onFocus: () => r(!0),
|
|
94
|
-
onBlur: () => r(!1),
|
|
95
|
-
onKeyDown: A,
|
|
96
|
-
...m,
|
|
97
|
-
children: [
|
|
98
|
-
t ? k(u, {
|
|
99
|
-
"aria-describedby": h
|
|
100
|
-
}) : u,
|
|
101
|
-
f && typeof document < "u" && B(
|
|
102
|
-
/* @__PURE__ */ j(
|
|
103
|
-
"span",
|
|
104
|
-
{
|
|
105
|
-
ref: T,
|
|
106
|
-
role: "tooltip",
|
|
107
|
-
id: h,
|
|
108
|
-
className: G(_.tooltip, _[C]),
|
|
109
|
-
"data-open": t && R ? "true" : "false",
|
|
110
|
-
style: {
|
|
111
|
-
...O,
|
|
112
|
-
...F,
|
|
113
|
-
top: (s == null ? void 0 : s.y) ?? 0,
|
|
114
|
-
left: (s == null ? void 0 : s.x) ?? 0,
|
|
115
|
-
"--tz-tooltip-shift": `${(s == null ? void 0 : s.shift) ?? 0}px`
|
|
116
|
-
},
|
|
117
|
-
onTransitionEnd: () => {
|
|
118
|
-
t || b(!1);
|
|
119
|
-
},
|
|
120
|
-
children: [
|
|
121
|
-
o,
|
|
122
|
-
/* @__PURE__ */ I("span", { className: _.arrow, "aria-hidden": "true" })
|
|
123
|
-
]
|
|
124
|
-
}
|
|
125
|
-
),
|
|
126
|
-
document.body
|
|
127
|
-
)
|
|
128
|
-
]
|
|
129
|
-
}
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
export {
|
|
133
|
-
tt as T
|
|
134
|
-
};
|
|
135
|
-
//# sourceMappingURL=Tooltip-DsDv4NOq.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip-DsDv4NOq.js","sources":["../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import {\n cloneElement,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport { clsx } from 'clsx'\nimport type { ThemeColor } from '../../theme'\nimport styles from './Tooltip.module.css'\n\nexport type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right'\n\nexport interface TooltipProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'content' | 'color'> {\n /** The tooltip text/content shown on hover or focus. Empty content renders no tooltip. */\n content: ReactNode\n /**\n * Which side of the trigger the tooltip appears on. Defaults to `top`. Flips to the opposite side when\n * the preferred one has no room in the viewport.\n */\n placement?: TooltipPlacement\n /** Theme palette token for the fill (label uses its contrast color). Defaults to `primary`. */\n color?: ThemeColor\n /** A single focusable element to attach the tooltip to (e.g. a `Button` or `IconButton`). */\n children: ReactElement\n}\n\n/** Bubble ↔ trigger gap (the CSS margin, `--tz-space-xs`) — used here only to decide whether a side fits. */\nconst GAP = 8\n/** Minimum distance kept between the bubble and the viewport edge. */\nconst EDGE = 8\nconst OPPOSITE: Record<TooltipPlacement, TooltipPlacement> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n}\n\ninterface TooltipGeometry {\n side: TooltipPlacement\n /** The anchor point on the trigger's edge (viewport px) — CSS offsets the bubble from it. */\n x: number\n y: number\n /** Cross-axis nudge that keeps the bubble inside the viewport (the arrow counter-shifts). */\n shift: number\n}\n\n/**\n * Where the bubble goes: the preferred side unless only the opposite one fits, anchored at the middle of\n * that trigger edge, nudged along the cross axis so it never runs off-screen.\n */\nfunction computeGeometry(\n trigger: DOMRect,\n bubble: { width: number; height: number },\n placement: TooltipPlacement,\n): TooltipGeometry {\n const vw = window.innerWidth\n const vh = window.innerHeight\n const fits = (side: TooltipPlacement) =>\n side === 'top'\n ? trigger.top - GAP - bubble.height >= EDGE\n : side === 'bottom'\n ? trigger.bottom + GAP + bubble.height <= vh - EDGE\n : side === 'left'\n ? trigger.left - GAP - bubble.width >= EDGE\n : trigger.right + GAP + bubble.width <= vw - EDGE\n const side = !fits(placement) && fits(OPPOSITE[placement]) ? OPPOSITE[placement] : placement\n\n const clampShift = (center: number, half: number, size: number) =>\n center - half < EDGE\n ? EDGE - (center - half)\n : center + half > size - EDGE\n ? size - EDGE - (center + half)\n : 0\n\n if (side === 'top' || side === 'bottom') {\n const x = trigger.left + trigger.width / 2\n return {\n side,\n x,\n y: side === 'top' ? trigger.top : trigger.bottom,\n shift: clampShift(x, bubble.width / 2, vw),\n }\n }\n const y = trigger.top + trigger.height / 2\n return {\n side,\n x: side === 'left' ? trigger.left : trigger.right,\n y,\n shift: clampShift(y, bubble.height / 2, vh),\n }\n}\n\n/**\n * Shows a small floating label on hover or keyboard focus of its child, with an arrow pointing at\n * the trigger. Wrap a single element: `<Tooltip content=\"Save\"><IconButton…/></Tooltip>`. Opens on\n * `mouseenter`/`focus`, closes on `mouseleave`/`blur`/`Escape`. The child gets `aria-describedby`\n * while open (the label has `role=\"tooltip\"`). The bubble is **portaled to `<body>`** with fixed\n * positioning, so a scrolling / `overflow: hidden` ancestor (a `Table`'s scroll area, a `Modal` body)\n * never clips it; it flips to the opposite side when the preferred one has no room, stays inside the\n * viewport, follows the trigger on scroll / resize, and is mounted only while shown. Token-only styling\n * via the shared `--tz-btn-rgb` pattern — `color` (default `primary`) sets the fill and its contrast\n * label, flipping with the theme.\n */\nexport function Tooltip({\n content,\n placement = 'top',\n color = 'primary',\n children,\n className,\n style,\n onKeyDown,\n ...props\n}: TooltipProps) {\n const tooltipId = `${useId()}-tooltip`\n const [open, setOpen] = useState(false)\n // mounted spans the fade-out too; `shown` drives the CSS fade (one frame after the first measure)\n const [mounted, setMounted] = useState(false)\n const [shown, setShown] = useState(false)\n const [geometry, setGeometry] = useState<TooltipGeometry | null>(null)\n const rootRef = useRef<HTMLSpanElement | null>(null)\n const bubbleRef = useRef<HTMLSpanElement | null>(null)\n const hasContent = content !== null && content !== undefined && content !== ''\n\n const measure = useCallback(() => {\n const root = rootRef.current\n const bubble = bubbleRef.current\n if (!root || !bubble) return\n setGeometry(\n computeGeometry(\n root.getBoundingClientRect(),\n { width: bubble.offsetWidth, height: bubble.offsetHeight },\n placement,\n ),\n )\n }, [placement])\n\n useEffect(() => {\n if (open) setMounted(true)\n else setShown(false)\n }, [open])\n\n // measure before paint, then fade in on the next frame (so the bubble never flashes at 0,0)\n useLayoutEffect(() => {\n if (!open || !mounted) return\n measure()\n const frame = requestAnimationFrame(() => setShown(true))\n return () => cancelAnimationFrame(frame)\n }, [open, mounted, measure, content])\n\n // follow the trigger while open — any scroll (capture: a table's scroll area too) or resize\n useEffect(() => {\n if (!open) return\n window.addEventListener('scroll', measure, true)\n window.addEventListener('resize', measure)\n return () => {\n window.removeEventListener('scroll', measure, true)\n window.removeEventListener('resize', measure)\n }\n }, [open, measure])\n\n // unmount once faded out; the timer covers a transition that never fires (no CSS, reduced motion)\n useEffect(() => {\n if (open || !mounted) return\n const timer = window.setTimeout(() => setMounted(false), 400)\n return () => window.clearTimeout(timer)\n }, [open, mounted])\n\n const handleKeyDown = (event: KeyboardEvent<HTMLSpanElement>) => {\n if (event.key === 'Escape') setOpen(false)\n onKeyDown?.(event)\n }\n\n if (!hasContent) return children\n\n const tint = {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n } as CSSProperties\n const side = geometry?.side ?? placement\n // the bubble is portaled out of the wrapper, so CSS variables set through `style` (e.g. a custom\n // `--tz-btn-rgb` / `--tz-btn-on` tint, as CodeBlock's white pill does) are copied onto it explicitly\n const bubbleVars = Object.fromEntries(\n Object.entries(style ?? {}).filter(([property]) => property.startsWith('--')),\n ) as CSSProperties\n\n return (\n <span\n ref={rootRef}\n className={clsx(styles.root, className)}\n style={{ ...tint, ...style }}\n onMouseEnter={() => setOpen(true)}\n onMouseLeave={() => setOpen(false)}\n onFocus={() => setOpen(true)}\n onBlur={() => setOpen(false)}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {open\n ? cloneElement(children as ReactElement<{ 'aria-describedby'?: string }>, {\n 'aria-describedby': tooltipId,\n })\n : children}\n {mounted &&\n typeof document !== 'undefined' &&\n createPortal(\n <span\n ref={bubbleRef}\n role=\"tooltip\"\n id={tooltipId}\n className={clsx(styles.tooltip, styles[side])}\n data-open={open && shown ? 'true' : 'false'}\n style={\n {\n ...tint,\n ...bubbleVars,\n top: geometry?.y ?? 0,\n left: geometry?.x ?? 0,\n '--tz-tooltip-shift': `${geometry?.shift ?? 0}px`,\n } as CSSProperties\n }\n onTransitionEnd={() => {\n if (!open) setMounted(false)\n }}\n >\n {content}\n <span className={styles.arrow} aria-hidden=\"true\" />\n </span>,\n document.body,\n )}\n </span>\n )\n}\n"],"names":["GAP","EDGE","OPPOSITE","computeGeometry","trigger","bubble","placement","vw","vh","fits","side","clampShift","center","half","size","x","y","Tooltip","content","color","children","className","style","onKeyDown","props","tooltipId","useId","open","setOpen","useState","mounted","setMounted","shown","setShown","geometry","setGeometry","rootRef","useRef","bubbleRef","hasContent","measure","useCallback","root","useEffect","useLayoutEffect","frame","timer","handleKeyDown","event","tint","bubbleVars","property","jsxs","clsx","styles","cloneElement","createPortal"],"mappings":";;;;;;;;;;;;GAoCMA,IAAM,GAENC,IAAO,GACPC,IAAuD;AAAA,EAC3D,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AACT;AAeA,SAASC,EACPC,GACAC,GACAC,GACiB;AACjB,QAAMC,IAAK,OAAO,YACZC,IAAK,OAAO,aACZC,IAAO,CAACC,MACZA,MAAS,QACLN,EAAQ,MAAMJ,IAAMK,EAAO,UAAUJ,IACrCS,MAAS,WACPN,EAAQ,SAASJ,IAAMK,EAAO,UAAUG,IAAKP,IAC7CS,MAAS,SACPN,EAAQ,OAAOJ,IAAMK,EAAO,SAASJ,IACrCG,EAAQ,QAAQJ,IAAMK,EAAO,SAASE,IAAKN,GAC/CS,IAAO,CAACD,EAAKH,CAAS,KAAKG,EAAKP,EAASI,C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