se-design 1.0.84-dev.0 → 1.0.85-dev.1

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.
@@ -40,6 +40,11 @@ export interface ButtonProps extends NativeButtonProps {
40
40
  * Loading state - will disable button and show spinner
41
41
  */
42
42
  loading?: boolean;
43
+ /**
44
+ * Custom label shown (both visually and announced to screen readers) when loading is true.
45
+ * When omitted, the original label remains visible and SR announcement is "${label}, loading".
46
+ */
47
+ loadingLabel?: string;
43
48
  /**
44
49
  * Optional click handler (called for pointer/mouse activations)
45
50
  */
package/dist/index16.js CHANGED
@@ -1,4 +1,4 @@
1
- import p, { useState as N, useRef as $, useEffect as P } from "react";
1
+ import m, { useState as N, useRef as $, useEffect as P } from "react";
2
2
  import Z, { flushSync as O } from "react-dom";
3
3
  import { useStableId as ee } from "./index205.js";
4
4
  import { useDismissOnFocusOut as te } from "./index80.js";
@@ -26,25 +26,25 @@ const ce = ({
26
26
  tooltipOffset: u = 8,
27
27
  automationId: _ = ""
28
28
  }) => {
29
- const [L, m] = N(!1), M = $(null), K = $(null), k = w || K, [q, U] = N({}), [E, S] = N(!1), A = $(null), D = typeof x == "string", g = ee(void 0, "tooltip-content"), T = () => {
29
+ const [L, p] = N(!1), M = $(null), K = $(null), k = w || K, [q, U] = N({}), [E, S] = N(!1), A = $(null), D = typeof x == "string", g = ee(void 0, "tooltip-content"), T = () => {
30
30
  A.current && (clearTimeout(A.current), A.current = null);
31
31
  }, C = () => {
32
- i !== "always-on" && (T(), A.current = setTimeout(() => m(!1), 150));
32
+ i !== "always-on" && (T(), A.current = setTimeout(() => p(!1), 150));
33
33
  }, H = () => {
34
- T(), m(!0);
34
+ T(), p(!0);
35
35
  }, V = (e) => {
36
36
  if (y) {
37
37
  if (e.key === "Escape") {
38
- e.preventDefault(), m(!1);
38
+ e.preventDefault(), p(!1);
39
39
  return;
40
40
  }
41
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), m((t) => !t));
41
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), p((t) => !t));
42
42
  }
43
43
  }, W = te({
44
44
  disabled: y,
45
45
  onFocusIn: H,
46
46
  onFocusOut: C,
47
- onEscape: () => m(!1)
47
+ onEscape: () => p(!1)
48
48
  });
49
49
  P(() => {
50
50
  const e = M.current;
@@ -53,19 +53,19 @@ const ce = ({
53
53
  const e = M.current;
54
54
  e && (L ? e.classList.remove("invisible") : e.classList.add("invisible"));
55
55
  }, [L]), P(() => {
56
- i === "always-on" && m(!0);
56
+ i === "always-on" && p(!0);
57
57
  }, [i]);
58
58
  const G = () => {
59
- i == "click" && m((e) => !e);
59
+ i == "click" && p((e) => !e);
60
60
  }, J = {
61
61
  ...i === "click" && {
62
62
  onClick: () => {
63
- m((e) => !e);
63
+ p((e) => !e);
64
64
  }
65
65
  },
66
66
  ...i === "hover" && {
67
- onMouseEnter: () => m(!0),
68
- onMouseLeave: () => m(!1)
67
+ onMouseEnter: () => p(!0),
68
+ onMouseLeave: () => p(!1)
69
69
  }
70
70
  }, Q = () => {
71
71
  const e = k.current;
@@ -140,7 +140,7 @@ const ce = ({
140
140
  });
141
141
  }, t = setTimeout(e, w ? 60 : 10), n = (h) => {
142
142
  const r = document.getElementById(g), l = k.current, a = h.target;
143
- r && l && !r.contains(a) && !l.contains(a) && m(!1);
143
+ r && l && !r.contains(a) && !l.contains(a) && p(!1);
144
144
  }, c = i !== "always-on";
145
145
  c && document.body.addEventListener("click", n, !0), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e);
146
146
  let o = null;
@@ -153,7 +153,7 @@ const ce = ({
153
153
  clearTimeout(t), T(), c && document.body.removeEventListener("click", n, !0), window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e), o && o.disconnect();
154
154
  };
155
155
  }, [L, F, s, i, w, g]);
156
- const R = !y && /* @__PURE__ */ p.isValidElement(v) ? /* @__PURE__ */ p.cloneElement(v, {
156
+ const R = !y && /* @__PURE__ */ m.isValidElement(v) ? /* @__PURE__ */ m.cloneElement(v, {
157
157
  "aria-describedby": g,
158
158
  ...typeof v.type != "string" && {
159
159
  ariaDescribedBy: g
@@ -167,17 +167,17 @@ const ce = ({
167
167
  onBlur: C,
168
168
  onKeyDown: V
169
169
  } : void 0, Y = y ? void 0 : W;
170
- return F ? /* @__PURE__ */ p.createElement("div", I({
171
- className: "se-design-tooltip group relative inline-flex items-center"
172
- }, J, X, Y), /* @__PURE__ */ p.createElement("div", {
173
- className: "cursor-pointer flex items-center",
170
+ return F ? /* @__PURE__ */ m.createElement("div", I({
171
+ className: "se-design-tooltip group relative inline-flex items-center min-w-0"
172
+ }, J, X, Y), /* @__PURE__ */ m.createElement("div", {
173
+ className: "cursor-pointer flex items-center min-w-0",
174
174
  ref: w ? void 0 : k,
175
175
  onMouseEnter: i === "always-on" ? void 0 : T,
176
176
  onMouseLeave: C
177
- }, R), L && /* @__PURE__ */ Z.createPortal(/* @__PURE__ */ p.createElement(p.Fragment, null, /* @__PURE__ */ p.createElement("style", null, `#${g}::before {
177
+ }, R), L && /* @__PURE__ */ Z.createPortal(/* @__PURE__ */ m.createElement(m.Fragment, null, /* @__PURE__ */ m.createElement("style", null, `#${g}::before {
178
178
  left: var(--arrow-left, 0);
179
179
  top: var(--arrow-top, 0);
180
- }`), /* @__PURE__ */ p.createElement("div", {
180
+ }`), /* @__PURE__ */ m.createElement("div", {
181
181
  id: g,
182
182
  role: "tooltip",
183
183
  className: `flex justify-center px-3 py-2 min-w-24 bg-[var(--color-gray-800)] text-[var(--color-white)] text-base rounded-[3px]
@@ -201,14 +201,14 @@ const ce = ({
201
201
  },
202
202
  onMouseEnter: i === "always-on" ? void 0 : T,
203
203
  onMouseLeave: C
204
- }, D ? /* @__PURE__ */ p.createElement("p", {
204
+ }, D ? /* @__PURE__ */ m.createElement("p", {
205
205
  className: "leading-normal"
206
- }, x) : x)), document.body)) : /* @__PURE__ */ p.createElement("div", I({
207
- className: "se-design-tooltip group relative inline-flex items-center",
206
+ }, x) : x)), document.body)) : /* @__PURE__ */ m.createElement("div", I({
207
+ className: "se-design-tooltip group relative inline-flex items-center min-w-0",
208
208
  onClick: G
209
- }, X, Y), /* @__PURE__ */ p.createElement("div", {
210
- className: "cursor-pointer flex items-center"
211
- }, R), /* @__PURE__ */ p.createElement("div", {
209
+ }, X, Y), /* @__PURE__ */ m.createElement("div", {
210
+ className: "cursor-pointer flex items-center min-w-0"
211
+ }, R), /* @__PURE__ */ m.createElement("div", {
212
212
  ref: M,
213
213
  id: g,
214
214
  role: "tooltip",
@@ -217,7 +217,7 @@ const ce = ({
217
217
  before:content-[' '] before:w-3.5 before:h-3.5 before:bg-[var(--color-gray-800)] before:inline-block
218
218
  before:absolute before:rounded-tl-sm before:rotate-45`,
219
219
  "data-automation-id": _ || "tooltip-content"
220
- }, D ? /* @__PURE__ */ p.createElement("p", {
220
+ }, D ? /* @__PURE__ */ m.createElement("p", {
221
221
  className: "leading-normal"
222
222
  }, x) : x));
223
223
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index16.js","sources":["../src/components/Tooltip/index.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from 'react';\nimport ReactDOM, { flushSync } from 'react-dom';\nimport { useStableId } from '../../utils/useStableId';\nimport { useDismissOnFocusOut } from '../../utils/a11y';\n\nexport interface TooltipProps {\n /**\n * Tooltip contents\n */\n content: string | React.ReactNode;\n /**\n * Tooltip position\n */\n position?:\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right'\n | 'left-top'\n | 'left-center'\n | 'left-bottom'\n | 'right-top'\n | 'right-center'\n | 'right-bottom';\n /**\n * Display tooltip on Hover, Click or Always\n */\n displayOn?: 'hover' | 'click' | 'always-on';\n /**\n * Tooltip trigger contents\n */\n tooltipSrc?: React.ReactNode;\n /**\n * Tooltip trigger contents ref\n */\n tooltipSrcRef?: React.RefObject<HTMLElement>;\n /**\n * When true, the real trigger is disabled and cannot receive focus.\n * Tooltip will make its wrapper focusable and treat it as a \"button\" that reveals tooltip content.\n */\n isTriggerDisabled?: boolean;\n /**\n * Required when isTriggerDisabled is true. Provides an accessible name for the focusable wrapper trigger.\n */\n disabledTriggerAriaLabel?: string;\n /**\n * Max width of the tooltip content\n */\n maxWidth?: number;\n /**\n * Whether to use portal for the tooltip content\n */\n isWithPortal?: boolean;\n /**\n * Tooltip content classes\n */\n tooltipContentClasses?: string;\n /**\n * Tooltip offset\n */\n tooltipOffset?: number;\n /**\n * Automation ID for testing\n */\n automationId?: string;\n}\n\nexport const Tooltip = ({\n content,\n tooltipSrc,\n position = 'bottom-center',\n displayOn = 'hover',\n maxWidth = 240,\n isWithPortal = false,\n tooltipSrcRef = undefined,\n isTriggerDisabled = false,\n disabledTriggerAriaLabel = undefined,\n tooltipContentClasses = '',\n tooltipOffset = 8,\n automationId = ''\n}: TooltipProps) => {\n const [displayTooltip, setDisplayTooltip] = useState(false);\n const tooltipContentRef = useRef<HTMLDivElement>(null);\n // Support for external ref when provided\n const internalToolTipSrcRef = useRef<HTMLDivElement>(null);\n const tooltipSourceRef = (tooltipSrcRef || internalToolTipSrcRef) as React.RefObject<HTMLElement>;\n const [tooltipPortalStyle, setTooltipPortalStyle] = useState({});\n const [isPortalPositioned, setIsPortalPositioned] = useState(false);\n const hideTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const isContentString = typeof content === 'string';\n const tooltipContentId = useStableId(undefined, 'tooltip-content');\n\n // Helper to clear hide timeout\n const clearHideTimeout = () => {\n if (hideTimeoutRef.current) {\n clearTimeout(hideTimeoutRef.current);\n hideTimeoutRef.current = null;\n }\n };\n\n // Helper to schedule hide\n const scheduleHide = () => {\n if (displayOn !== 'always-on') {\n clearHideTimeout();\n hideTimeoutRef.current = setTimeout(() => setDisplayTooltip(false), 150);\n }\n };\n\n const showTooltip = () => {\n clearHideTimeout();\n setDisplayTooltip(true);\n };\n\n const onDisabledTriggerKeyDown = (e: React.KeyboardEvent) => {\n if (!isTriggerDisabled) return;\n if (e.key === 'Escape') {\n e.preventDefault();\n setDisplayTooltip(false);\n return;\n }\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n setDisplayTooltip((prev) => !prev);\n }\n };\n\n // Enabled trigger: use React focus/blur capture handlers (no native event listeners).\n // This keeps the tooltip open while focus stays anywhere inside the tooltip wrapper.\n const dismissOnFocusOutProps = useDismissOnFocusOut<HTMLDivElement>({\n disabled: isTriggerDisabled,\n onFocusIn: showTooltip,\n onFocusOut: scheduleHide,\n onEscape: () => setDisplayTooltip(false)\n });\n\n useEffect(() => {\n const tooltipContent = tooltipContentRef.current;\n\n if (!tooltipContent) {\n return;\n }\n\n if (position == 'bottom-center') {\n tooltipContent.setAttribute('style', `left: 50%;transform: translateX(-50%);`);\n tooltipContent.classList.add(`before:left-[calc(50%-7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if (position == 'bottom-left') {\n tooltipContent.classList.add(`before:left-[calc(10%-7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if (position == 'bottom-right') {\n tooltipContent.setAttribute('style', `right: 0;`);\n tooltipContent.classList.add(`before:right-[calc(10%+7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if (position == 'top-center') {\n tooltipContent.setAttribute('style', `left: 50%;transform: translateX(-50%);bottom: calc(100% + 8px);`);\n tooltipContent.classList.add(`before:left-[calc(50%-7px)]`);\n tooltipContent.classList.add(`before:bottom-[-7px]`);\n } else if (position == 'top-left') {\n tooltipContent.setAttribute('style', `bottom: calc(100% + 8px);`);\n tooltipContent.classList.add(`before:left-[calc(10%-7px)]`);\n tooltipContent.classList.add(`before:bottom-[-7px]`);\n } else if (position == 'top-right') {\n tooltipContent.setAttribute('style', `right: 0;bottom: calc(100% + 8px);`);\n tooltipContent.classList.add(`before:right-[calc(10%+7px)]`);\n tooltipContent.classList.add(`before:bottom-[-7px]`);\n } else if (position == 'left-top') {\n tooltipContent.setAttribute('style', `right: calc(100% + 10px);top:0;`);\n tooltipContent.classList.add(`before:right-[-6px]`);\n tooltipContent.classList.add(`before:top-[7px]`);\n } else if (position == 'left-center') {\n tooltipContent.setAttribute('style', `right: calc(100% + 10px);top: 50%;transform: translateY(-50%);`);\n tooltipContent.classList.add(`before:right-[-6px]`);\n tooltipContent.classList.add(`before:top-[calc(50%-7px)]`);\n } else if (position == 'left-bottom') {\n tooltipContent.setAttribute('style', `right: calc(100% + 10px);bottom:0;`);\n tooltipContent.classList.add(`before:right-[-6px]`);\n tooltipContent.classList.add(`before:bottom-[7px]`);\n } else if (position == 'right-top') {\n tooltipContent.setAttribute('style', `left: calc(100% + 10px);top:0;`);\n tooltipContent.classList.add(`before:left-[-6px]`);\n tooltipContent.classList.add(`before:top-[7px]`);\n } else if (position == 'right-center') {\n tooltipContent.setAttribute('style', `left: calc(100% + 10px);top: 50%;transform: translateY(-50%);`);\n tooltipContent.classList.add(`before:left-[-6px]`);\n tooltipContent.classList.add(`before:top-[calc(50%-7px)]`);\n } else if (position == 'right-bottom') {\n tooltipContent.setAttribute('style', `left: calc(100% + 10px);bottom:0;`);\n tooltipContent.classList.add(`before:left-[-6px]`);\n tooltipContent.classList.add(`before:bottom-[7px]`);\n }\n\n if (displayOn == 'hover') {\n tooltipContent.classList.add(`group-hover:visible`);\n }\n }, [content]);\n\n useEffect(() => {\n const tooltipContent = tooltipContentRef.current;\n\n if (!tooltipContent) {\n return;\n }\n if (displayTooltip) {\n tooltipContent.classList.remove(`invisible`);\n } else {\n tooltipContent.classList.add(`invisible`);\n }\n }, [displayTooltip]);\n\n // Ensure tooltip stays open when displayOn is always-on\n useEffect(() => {\n if (displayOn === 'always-on') {\n setDisplayTooltip(true);\n }\n }, [displayOn]);\n\n const onTooltipSrcClick = () => {\n if (displayOn == 'click') {\n setDisplayTooltip((displayTooltip) => !displayTooltip);\n }\n };\n\n const toggleTooltip = () => {\n setDisplayTooltip((displayTooltip) => !displayTooltip);\n };\n\n const events = {\n ...(displayOn === 'click' && { onClick: toggleTooltip }),\n ...(displayOn === 'hover' && {\n onMouseEnter: () => setDisplayTooltip(true),\n onMouseLeave: () => setDisplayTooltip(false)\n })\n };\n\n const calculateTooltipPortalStyle = () => {\n const refToUse = tooltipSourceRef.current;\n if (!refToUse) {\n return {};\n }\n\n const srcRect = refToUse.getBoundingClientRect();\n const scrollX = window.scrollX || window.pageXOffset;\n const scrollY = window.scrollY || window.pageYOffset;\n const arrowSize = 14; // 14px (3.5 * 4 = 14px in Tailwind)\n\n // Get tooltip content dimensions if available\n const tooltipElement = document.getElementById(tooltipContentId);\n const tooltipWidth = tooltipElement?.offsetWidth || 0;\n const tooltipHeight = tooltipElement?.offsetHeight || 0;\n\n let top = 0;\n let left = 0;\n let arrowLeft = 0;\n let arrowTop = 0;\n\n switch (position) {\n case 'bottom-center':\n top = srcRect.bottom + scrollY + tooltipOffset;\n left = srcRect.left + scrollX + srcRect.width / 2 - tooltipWidth / 2;\n arrowLeft = tooltipWidth / 2 - arrowSize / 2;\n arrowTop = -arrowSize / 2;\n break;\n case 'bottom-left':\n top = srcRect.bottom + scrollY + tooltipOffset;\n left = srcRect.left + scrollX;\n arrowLeft = tooltipWidth * 0.1 - arrowSize / 2;\n arrowTop = -arrowSize / 2;\n break;\n case 'bottom-right':\n top = srcRect.bottom + scrollY + tooltipOffset;\n left = srcRect.right + scrollX - tooltipWidth;\n arrowLeft = tooltipWidth - tooltipWidth * 0.1 - arrowSize / 2;\n arrowTop = -arrowSize / 2;\n break;\n case 'top-center':\n top = srcRect.top + scrollY - tooltipHeight - tooltipOffset;\n left = srcRect.left + scrollX + srcRect.width / 2 - tooltipWidth / 2;\n arrowLeft = tooltipWidth / 2 - arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n case 'top-left':\n top = srcRect.top + scrollY - tooltipHeight - tooltipOffset;\n left = srcRect.left + scrollX;\n arrowLeft = tooltipWidth * 0.1 - arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n case 'top-right':\n top = srcRect.top + scrollY - tooltipHeight - tooltipOffset;\n left = srcRect.right + scrollX - tooltipWidth;\n arrowLeft = tooltipWidth - tooltipWidth * 0.1 - arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n case 'left-top':\n top = srcRect.top + scrollY;\n left = srcRect.left + scrollX - tooltipWidth - tooltipOffset;\n arrowLeft = tooltipWidth - arrowSize / 2;\n arrowTop = arrowSize / 2;\n break;\n case 'left-center':\n top = srcRect.top + scrollY + srcRect.height / 2 - tooltipHeight / 2;\n left = srcRect.left + scrollX - tooltipWidth - tooltipOffset;\n arrowLeft = tooltipWidth - arrowSize / 2;\n arrowTop = tooltipHeight / 2 - arrowSize / 2;\n break;\n case 'left-bottom':\n top = srcRect.bottom + scrollY - tooltipHeight;\n left = srcRect.left + scrollX - tooltipWidth - tooltipOffset;\n arrowLeft = tooltipWidth - arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n case 'right-top':\n top = srcRect.top + scrollY;\n left = srcRect.right + scrollX + tooltipOffset;\n arrowLeft = -arrowSize / 2;\n arrowTop = arrowSize / 2;\n break;\n case 'right-center':\n top = srcRect.top + scrollY + srcRect.height / 2 - tooltipHeight / 2;\n left = srcRect.right + scrollX + tooltipOffset;\n arrowLeft = -arrowSize / 2;\n arrowTop = tooltipHeight / 2 - arrowSize / 2;\n break;\n case 'right-bottom':\n top = srcRect.bottom + scrollY - tooltipHeight;\n left = srcRect.right + scrollX + tooltipOffset;\n arrowLeft = -arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n default:\n top = srcRect.bottom + scrollY + tooltipOffset;\n left = srcRect.left + scrollX + srcRect.width / 2 - tooltipWidth / 2;\n arrowLeft = tooltipWidth / 2 - arrowSize / 2;\n arrowTop = -arrowSize / 2;\n break;\n }\n\n return {\n position: 'absolute',\n top: `${top}px`,\n left: `${left}px`,\n zIndex: 9999,\n '--arrow-left': `${arrowLeft}px`,\n '--arrow-top': `${arrowTop}px`\n } as React.CSSProperties & { '--arrow-left': string; '--arrow-top': string };\n };\n\n useEffect(() => {\n if (!displayTooltip || !isWithPortal) {\n setIsPortalPositioned(false);\n return;\n }\n\n const updatePosition = () => {\n const tooltipElement = document.getElementById(tooltipContentId);\n\n // Wait for tooltip to be rendered and have valid dimensions\n if (!tooltipElement || tooltipElement.offsetHeight === 0) {\n requestAnimationFrame(updatePosition);\n return;\n }\n\n const calculatedStyle = calculateTooltipPortalStyle();\n \n // Batch both state updates into a single synchronous render using flushSync\n flushSync(() => {\n setTooltipPortalStyle(calculatedStyle);\n setIsPortalPositioned(true);\n });\n };\n\n // Initial position calculation\n const timeout = setTimeout(updatePosition, tooltipSrcRef ? 60 : 10);\n\n const handleClick = (e: MouseEvent) => {\n const tooltip = document.getElementById(tooltipContentId);\n const source = tooltipSourceRef.current;\n const target = e.target as Node;\n\n if (tooltip && source && !tooltip.contains(target) && !source.contains(target)) {\n setDisplayTooltip(false);\n }\n };\n\n // Only add click listener if not always-on\n const shouldAddClickListener = displayOn !== 'always-on';\n if (shouldAddClickListener) {\n document.body.addEventListener('click', handleClick, true);\n }\n window.addEventListener('scroll', updatePosition, true);\n window.addEventListener('resize', updatePosition);\n\n // Watch for style changes on the source element when tooltipSrcRef is provided\n // This ensures the tooltip position updates when the blocker is repositioned\n let mutationObserver: MutationObserver | null = null;\n if (tooltipSrcRef && tooltipSourceRef.current) {\n mutationObserver = new MutationObserver(() => {\n updatePosition();\n });\n mutationObserver.observe(tooltipSourceRef.current, {\n attributes: true,\n attributeFilter: ['style', 'class']\n });\n }\n\n return () => {\n clearTimeout(timeout);\n clearHideTimeout();\n if (shouldAddClickListener) {\n document.body.removeEventListener('click', handleClick, true);\n }\n window.removeEventListener('scroll', updatePosition, true);\n window.removeEventListener('resize', updatePosition);\n if (mutationObserver) {\n mutationObserver.disconnect();\n }\n };\n }, [displayTooltip, isWithPortal, position, displayOn, tooltipSrcRef, tooltipContentId]);\n\n // For enabled triggers: link trigger to tooltip content via aria-describedby so screen\n // readers announce tooltip text on focus. Native elements need kebab-case only;\n // se-design components (Icon, Button) also accept camelCase ariaDescribedBy prop.\n // Disabled trigger already wires aria-describedby in disabledTriggerProps.\n const linkedTooltipSrc =\n !isTriggerDisabled && React.isValidElement(tooltipSrc)\n ? React.cloneElement(tooltipSrc as React.ReactElement<any>, {\n 'aria-describedby': tooltipContentId,\n ...(typeof tooltipSrc.type !== 'string' && { ariaDescribedBy: tooltipContentId })\n })\n : tooltipSrc;\n\n const disabledTriggerProps = isTriggerDisabled\n ? {\n tabIndex: 0,\n role: 'button' as const,\n 'aria-label': disabledTriggerAriaLabel,\n 'aria-describedby': tooltipContentId,\n onFocus: showTooltip,\n onBlur: scheduleHide,\n onKeyDown: onDisabledTriggerKeyDown\n }\n : undefined;\n\n const enabledTriggerProps = !isTriggerDisabled\n ? dismissOnFocusOutProps\n : undefined;\n\n return !isWithPortal ? (\n <div\n className=\"se-design-tooltip group relative inline-flex items-center\"\n onClick={onTooltipSrcClick}\n {...disabledTriggerProps}\n {...enabledTriggerProps}\n >\n <div className=\"cursor-pointer flex items-center\">\n {linkedTooltipSrc}\n </div>\n <div\n ref={tooltipContentRef}\n id={tooltipContentId}\n role=\"tooltip\"\n className={`flex justify-center px-3 py-2 min-w-24 max-w-[${maxWidth}px]\n absolute top-[calc(100%+8px)] w-max bg-[var(--color-gray-800)] text-[var(--color-white)] text-base rounded-[3px]\n before:content-[' '] before:w-3.5 before:h-3.5 before:bg-[var(--color-gray-800)] before:inline-block\n before:absolute before:rounded-tl-sm before:rotate-45`}\n data-automation-id={automationId || 'tooltip-content'}\n >\n {isContentString ? <p className=\"leading-normal\">{content}</p> : content}\n </div>\n </div>\n ) : (\n <div\n className=\"se-design-tooltip group relative inline-flex items-center\"\n {...events}\n {...disabledTriggerProps}\n {...enabledTriggerProps}\n >\n <div\n className=\"cursor-pointer flex items-center\"\n ref={tooltipSrcRef ? undefined : (tooltipSourceRef as React.RefObject<HTMLDivElement>)}\n onMouseEnter={displayOn === 'always-on' ? undefined : clearHideTimeout}\n onMouseLeave={scheduleHide}\n >\n {linkedTooltipSrc}\n </div>\n {displayTooltip &&\n ReactDOM.createPortal(\n <>\n <style>\n {`#${tooltipContentId}::before {\n left: var(--arrow-left, 0);\n top: var(--arrow-top, 0);\n }`}\n </style>\n <div\n id={tooltipContentId}\n role=\"tooltip\"\n className={`flex justify-center px-3 py-2 min-w-24 bg-[var(--color-gray-800)] text-[var(--color-white)] text-base rounded-[3px]\n before:content-[' '] before:w-3.5 before:h-3.5 before:bg-[var(--color-gray-800)] before:inline-block\n before:absolute before:rounded-tl-sm before:rotate-45 ${tooltipContentClasses}`}\n style={{\n ...tooltipPortalStyle,\n maxWidth: `${maxWidth}px`,\n wordBreak: 'break-word',\n overflowWrap: 'break-word',\n visibility: isPortalPositioned ? 'visible' : 'hidden',\n opacity: isPortalPositioned ? 1 : 0,\n pointerEvents: isPortalPositioned ? 'auto' : 'none',\n transition: isPortalPositioned ? 'opacity 0.15s ease-in' : 'none',\n // Ensure it stays at 0,0 until positioned to avoid any visual flash\n ...(isPortalPositioned ? {} : { position: 'fixed', top: '0px', left: '0px' })\n }}\n onMouseEnter={displayOn === 'always-on' ? undefined : clearHideTimeout}\n onMouseLeave={scheduleHide}\n >\n {isContentString ? <p className=\"leading-normal\">{content}</p> : content}\n </div>\n </>,\n document.body\n )}\n </div>\n );\n};\n"],"names":["Tooltip","content","tooltipSrc","position","displayOn","maxWidth","isWithPortal","tooltipSrcRef","undefined","isTriggerDisabled","disabledTriggerAriaLabel","tooltipContentClasses","tooltipOffset","automationId","displayTooltip","setDisplayTooltip","useState","tooltipContentRef","useRef","internalToolTipSrcRef","tooltipSourceRef","tooltipPortalStyle","setTooltipPortalStyle","isPortalPositioned","setIsPortalPositioned","hideTimeoutRef","isContentString","tooltipContentId","useStableId","clearHideTimeout","current","clearTimeout","scheduleHide","setTimeout","showTooltip","onDisabledTriggerKeyDown","e","key","preventDefault","prev","dismissOnFocusOutProps","useDismissOnFocusOut","disabled","onFocusIn","onFocusOut","onEscape","useEffect","tooltipContent","setAttribute","classList","add","remove","onTooltipSrcClick","events","onClick","toggleTooltip","onMouseEnter","onMouseLeave","calculateTooltipPortalStyle","refToUse","srcRect","getBoundingClientRect","scrollX","window","pageXOffset","scrollY","pageYOffset","arrowSize","tooltipElement","document","getElementById","tooltipWidth","offsetWidth","tooltipHeight","offsetHeight","top","left","arrowLeft","arrowTop","bottom","width","right","height","zIndex","updatePosition","requestAnimationFrame","calculatedStyle","flushSync","timeout","handleClick","tooltip","source","target","contains","shouldAddClickListener","body","addEventListener","mutationObserver","MutationObserver","observe","attributes","attributeFilter","removeEventListener","disconnect","linkedTooltipSrc","React","isValidElement","cloneElement","type","ariaDescribedBy","disabledTriggerProps","tabIndex","role","onFocus","onBlur","onKeyDown","enabledTriggerProps","createElement","_extends","className","ref","ReactDOM","createPortal","Fragment","id","style","wordBreak","overflowWrap","visibility","opacity","pointerEvents","transition"],"mappings":";;;;;;;;;;;;;;AAqEO,MAAMA,KAAUA,CAAC;AAAA,EACtBC,SAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,WAAAA,IAAY;AAAA,EACZC,UAAAA,IAAW;AAAA,EACXC,cAAAA,IAAe;AAAA,EACfC,eAAAA,IAAgBC;AAAAA,EAChBC,mBAAAA,IAAoB;AAAA,EACpBC,0BAAAA,IAA2BF;AAAAA,EAC3BG,uBAAAA,IAAwB;AAAA,EACxBC,eAAAA,IAAgB;AAAA,EAChBC,cAAAA,IAAe;AACH,MAAM;AAClB,QAAM,CAACC,GAAgBC,CAAiB,IAAIC,EAAS,EAAK,GACpDC,IAAoBC,EAAuB,IAAI,GAE/CC,IAAwBD,EAAuB,IAAI,GACnDE,IAAoBb,KAAiBY,GACrC,CAACE,GAAoBC,CAAqB,IAAIN,EAAS,CAAA,CAAE,GACzD,CAACO,GAAoBC,CAAqB,IAAIR,EAAS,EAAK,GAC5DS,IAAiBP,EAA6C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;AAAAA,MACHhB,UAAU,GAAGA,CAAQ;AAAA,MACrByH,WAAW;AAAA,MACXC,cAAc;AAAA,MACdC,YAAYzG,IAAqB,YAAY;AAAA,MAC7C0G,SAAS1G,IAAqB,IAAI;AAAA,MAClC2G,eAAe3G,IAAqB,SAAS;AAAA,MAC7C4G,YAAY5G,IAAqB,0BAA0B;AAAA;AAAA,MAE3D,GAAIA,IAAqB,CAAA,IAAK;AAAA,QAAEpB,UAAU;AAAA,QAASwE,KAAK;AAAA,QAAOC,MAAM;AAAA,MAAA;AAAA,IAAM;AAAA,IAE7EpB,cAAcpD,MAAc,cAAcI,SAAYqB;AAAAA,IACtD4B,cAAczB;AAAAA,EAAAA,GAEbN,IAAkB+E,gBAAAA,EAAAY,cAAA,KAAA;AAAA,IAAGE,WAAU;AAAA,EAAA,GAAkBtH,CAAW,IAAIA,CAC9D,CACL,GACFoE,SAAS0B,IACX,CACC,IAxELU,gBAAAA,EAAAY,qBAAAC,EAAA;AAAA,IACEC,WAAU;AAAA,IACVjE,SAASF;AAAAA,EAAAA,GACL0D,GACAM,CAAmB,GAEvBX,gBAAAA,EAAAY,cAAA,OAAA;AAAA,IAAKE,WAAU;AAAA,EAAA,GACZf,CACE,GACLC,gBAAAA,EAAAY,cAAA,OAAA;AAAA,IACEG,KAAKvG;AAAAA,IACL2G,IAAIjG;AAAAA,IACJqF,MAAK;AAAA,IACLO,WAAW,iDAAiDlH,CAAQ;AAAA;AAAA;AAAA;AAAA,IAIpE,sBAAoBQ,KAAgB;AAAA,EAAA,GAEnCa,IAAkB+E,gBAAAA,EAAAY,cAAA,KAAA;AAAA,IAAGE,WAAU;AAAA,EAAA,GAAkBtH,CAAW,IAAIA,CAC9D,CACF;AAqDT;"}
1
+ {"version":3,"file":"index16.js","sources":["../src/components/Tooltip/index.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from 'react';\nimport ReactDOM, { flushSync } from 'react-dom';\nimport { useStableId } from '../../utils/useStableId';\nimport { useDismissOnFocusOut } from '../../utils/a11y';\n\nexport interface TooltipProps {\n /**\n * Tooltip contents\n */\n content: string | React.ReactNode;\n /**\n * Tooltip position\n */\n position?:\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right'\n | 'left-top'\n | 'left-center'\n | 'left-bottom'\n | 'right-top'\n | 'right-center'\n | 'right-bottom';\n /**\n * Display tooltip on Hover, Click or Always\n */\n displayOn?: 'hover' | 'click' | 'always-on';\n /**\n * Tooltip trigger contents\n */\n tooltipSrc?: React.ReactNode;\n /**\n * Tooltip trigger contents ref\n */\n tooltipSrcRef?: React.RefObject<HTMLElement>;\n /**\n * When true, the real trigger is disabled and cannot receive focus.\n * Tooltip will make its wrapper focusable and treat it as a \"button\" that reveals tooltip content.\n */\n isTriggerDisabled?: boolean;\n /**\n * Required when isTriggerDisabled is true. Provides an accessible name for the focusable wrapper trigger.\n */\n disabledTriggerAriaLabel?: string;\n /**\n * Max width of the tooltip content\n */\n maxWidth?: number;\n /**\n * Whether to use portal for the tooltip content\n */\n isWithPortal?: boolean;\n /**\n * Tooltip content classes\n */\n tooltipContentClasses?: string;\n /**\n * Tooltip offset\n */\n tooltipOffset?: number;\n /**\n * Automation ID for testing\n */\n automationId?: string;\n}\n\nexport const Tooltip = ({\n content,\n tooltipSrc,\n position = 'bottom-center',\n displayOn = 'hover',\n maxWidth = 240,\n isWithPortal = false,\n tooltipSrcRef = undefined,\n isTriggerDisabled = false,\n disabledTriggerAriaLabel = undefined,\n tooltipContentClasses = '',\n tooltipOffset = 8,\n automationId = ''\n}: TooltipProps) => {\n const [displayTooltip, setDisplayTooltip] = useState(false);\n const tooltipContentRef = useRef<HTMLDivElement>(null);\n // Support for external ref when provided\n const internalToolTipSrcRef = useRef<HTMLDivElement>(null);\n const tooltipSourceRef = (tooltipSrcRef || internalToolTipSrcRef) as React.RefObject<HTMLElement>;\n const [tooltipPortalStyle, setTooltipPortalStyle] = useState({});\n const [isPortalPositioned, setIsPortalPositioned] = useState(false);\n const hideTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const isContentString = typeof content === 'string';\n const tooltipContentId = useStableId(undefined, 'tooltip-content');\n\n // Helper to clear hide timeout\n const clearHideTimeout = () => {\n if (hideTimeoutRef.current) {\n clearTimeout(hideTimeoutRef.current);\n hideTimeoutRef.current = null;\n }\n };\n\n // Helper to schedule hide\n const scheduleHide = () => {\n if (displayOn !== 'always-on') {\n clearHideTimeout();\n hideTimeoutRef.current = setTimeout(() => setDisplayTooltip(false), 150);\n }\n };\n\n const showTooltip = () => {\n clearHideTimeout();\n setDisplayTooltip(true);\n };\n\n const onDisabledTriggerKeyDown = (e: React.KeyboardEvent) => {\n if (!isTriggerDisabled) return;\n if (e.key === 'Escape') {\n e.preventDefault();\n setDisplayTooltip(false);\n return;\n }\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n setDisplayTooltip((prev) => !prev);\n }\n };\n\n // Enabled trigger: use React focus/blur capture handlers (no native event listeners).\n // This keeps the tooltip open while focus stays anywhere inside the tooltip wrapper.\n const dismissOnFocusOutProps = useDismissOnFocusOut<HTMLDivElement>({\n disabled: isTriggerDisabled,\n onFocusIn: showTooltip,\n onFocusOut: scheduleHide,\n onEscape: () => setDisplayTooltip(false)\n });\n\n useEffect(() => {\n const tooltipContent = tooltipContentRef.current;\n\n if (!tooltipContent) {\n return;\n }\n\n if (position == 'bottom-center') {\n tooltipContent.setAttribute('style', `left: 50%;transform: translateX(-50%);`);\n tooltipContent.classList.add(`before:left-[calc(50%-7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if (position == 'bottom-left') {\n tooltipContent.classList.add(`before:left-[calc(10%-7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if (position == 'bottom-right') {\n tooltipContent.setAttribute('style', `right: 0;`);\n tooltipContent.classList.add(`before:right-[calc(10%+7px)]`);\n tooltipContent.classList.add(`before:top-[-7px]`);\n } else if (position == 'top-center') {\n tooltipContent.setAttribute('style', `left: 50%;transform: translateX(-50%);bottom: calc(100% + 8px);`);\n tooltipContent.classList.add(`before:left-[calc(50%-7px)]`);\n tooltipContent.classList.add(`before:bottom-[-7px]`);\n } else if (position == 'top-left') {\n tooltipContent.setAttribute('style', `bottom: calc(100% + 8px);`);\n tooltipContent.classList.add(`before:left-[calc(10%-7px)]`);\n tooltipContent.classList.add(`before:bottom-[-7px]`);\n } else if (position == 'top-right') {\n tooltipContent.setAttribute('style', `right: 0;bottom: calc(100% + 8px);`);\n tooltipContent.classList.add(`before:right-[calc(10%+7px)]`);\n tooltipContent.classList.add(`before:bottom-[-7px]`);\n } else if (position == 'left-top') {\n tooltipContent.setAttribute('style', `right: calc(100% + 10px);top:0;`);\n tooltipContent.classList.add(`before:right-[-6px]`);\n tooltipContent.classList.add(`before:top-[7px]`);\n } else if (position == 'left-center') {\n tooltipContent.setAttribute('style', `right: calc(100% + 10px);top: 50%;transform: translateY(-50%);`);\n tooltipContent.classList.add(`before:right-[-6px]`);\n tooltipContent.classList.add(`before:top-[calc(50%-7px)]`);\n } else if (position == 'left-bottom') {\n tooltipContent.setAttribute('style', `right: calc(100% + 10px);bottom:0;`);\n tooltipContent.classList.add(`before:right-[-6px]`);\n tooltipContent.classList.add(`before:bottom-[7px]`);\n } else if (position == 'right-top') {\n tooltipContent.setAttribute('style', `left: calc(100% + 10px);top:0;`);\n tooltipContent.classList.add(`before:left-[-6px]`);\n tooltipContent.classList.add(`before:top-[7px]`);\n } else if (position == 'right-center') {\n tooltipContent.setAttribute('style', `left: calc(100% + 10px);top: 50%;transform: translateY(-50%);`);\n tooltipContent.classList.add(`before:left-[-6px]`);\n tooltipContent.classList.add(`before:top-[calc(50%-7px)]`);\n } else if (position == 'right-bottom') {\n tooltipContent.setAttribute('style', `left: calc(100% + 10px);bottom:0;`);\n tooltipContent.classList.add(`before:left-[-6px]`);\n tooltipContent.classList.add(`before:bottom-[7px]`);\n }\n\n if (displayOn == 'hover') {\n tooltipContent.classList.add(`group-hover:visible`);\n }\n }, [content]);\n\n useEffect(() => {\n const tooltipContent = tooltipContentRef.current;\n\n if (!tooltipContent) {\n return;\n }\n if (displayTooltip) {\n tooltipContent.classList.remove(`invisible`);\n } else {\n tooltipContent.classList.add(`invisible`);\n }\n }, [displayTooltip]);\n\n // Ensure tooltip stays open when displayOn is always-on\n useEffect(() => {\n if (displayOn === 'always-on') {\n setDisplayTooltip(true);\n }\n }, [displayOn]);\n\n const onTooltipSrcClick = () => {\n if (displayOn == 'click') {\n setDisplayTooltip((displayTooltip) => !displayTooltip);\n }\n };\n\n const toggleTooltip = () => {\n setDisplayTooltip((displayTooltip) => !displayTooltip);\n };\n\n const events = {\n ...(displayOn === 'click' && { onClick: toggleTooltip }),\n ...(displayOn === 'hover' && {\n onMouseEnter: () => setDisplayTooltip(true),\n onMouseLeave: () => setDisplayTooltip(false)\n })\n };\n\n const calculateTooltipPortalStyle = () => {\n const refToUse = tooltipSourceRef.current;\n if (!refToUse) {\n return {};\n }\n\n const srcRect = refToUse.getBoundingClientRect();\n const scrollX = window.scrollX || window.pageXOffset;\n const scrollY = window.scrollY || window.pageYOffset;\n const arrowSize = 14; // 14px (3.5 * 4 = 14px in Tailwind)\n\n // Get tooltip content dimensions if available\n const tooltipElement = document.getElementById(tooltipContentId);\n const tooltipWidth = tooltipElement?.offsetWidth || 0;\n const tooltipHeight = tooltipElement?.offsetHeight || 0;\n\n let top = 0;\n let left = 0;\n let arrowLeft = 0;\n let arrowTop = 0;\n\n switch (position) {\n case 'bottom-center':\n top = srcRect.bottom + scrollY + tooltipOffset;\n left = srcRect.left + scrollX + srcRect.width / 2 - tooltipWidth / 2;\n arrowLeft = tooltipWidth / 2 - arrowSize / 2;\n arrowTop = -arrowSize / 2;\n break;\n case 'bottom-left':\n top = srcRect.bottom + scrollY + tooltipOffset;\n left = srcRect.left + scrollX;\n arrowLeft = tooltipWidth * 0.1 - arrowSize / 2;\n arrowTop = -arrowSize / 2;\n break;\n case 'bottom-right':\n top = srcRect.bottom + scrollY + tooltipOffset;\n left = srcRect.right + scrollX - tooltipWidth;\n arrowLeft = tooltipWidth - tooltipWidth * 0.1 - arrowSize / 2;\n arrowTop = -arrowSize / 2;\n break;\n case 'top-center':\n top = srcRect.top + scrollY - tooltipHeight - tooltipOffset;\n left = srcRect.left + scrollX + srcRect.width / 2 - tooltipWidth / 2;\n arrowLeft = tooltipWidth / 2 - arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n case 'top-left':\n top = srcRect.top + scrollY - tooltipHeight - tooltipOffset;\n left = srcRect.left + scrollX;\n arrowLeft = tooltipWidth * 0.1 - arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n case 'top-right':\n top = srcRect.top + scrollY - tooltipHeight - tooltipOffset;\n left = srcRect.right + scrollX - tooltipWidth;\n arrowLeft = tooltipWidth - tooltipWidth * 0.1 - arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n case 'left-top':\n top = srcRect.top + scrollY;\n left = srcRect.left + scrollX - tooltipWidth - tooltipOffset;\n arrowLeft = tooltipWidth - arrowSize / 2;\n arrowTop = arrowSize / 2;\n break;\n case 'left-center':\n top = srcRect.top + scrollY + srcRect.height / 2 - tooltipHeight / 2;\n left = srcRect.left + scrollX - tooltipWidth - tooltipOffset;\n arrowLeft = tooltipWidth - arrowSize / 2;\n arrowTop = tooltipHeight / 2 - arrowSize / 2;\n break;\n case 'left-bottom':\n top = srcRect.bottom + scrollY - tooltipHeight;\n left = srcRect.left + scrollX - tooltipWidth - tooltipOffset;\n arrowLeft = tooltipWidth - arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n case 'right-top':\n top = srcRect.top + scrollY;\n left = srcRect.right + scrollX + tooltipOffset;\n arrowLeft = -arrowSize / 2;\n arrowTop = arrowSize / 2;\n break;\n case 'right-center':\n top = srcRect.top + scrollY + srcRect.height / 2 - tooltipHeight / 2;\n left = srcRect.right + scrollX + tooltipOffset;\n arrowLeft = -arrowSize / 2;\n arrowTop = tooltipHeight / 2 - arrowSize / 2;\n break;\n case 'right-bottom':\n top = srcRect.bottom + scrollY - tooltipHeight;\n left = srcRect.right + scrollX + tooltipOffset;\n arrowLeft = -arrowSize / 2;\n arrowTop = tooltipHeight - arrowSize / 2;\n break;\n default:\n top = srcRect.bottom + scrollY + tooltipOffset;\n left = srcRect.left + scrollX + srcRect.width / 2 - tooltipWidth / 2;\n arrowLeft = tooltipWidth / 2 - arrowSize / 2;\n arrowTop = -arrowSize / 2;\n break;\n }\n\n return {\n position: 'absolute',\n top: `${top}px`,\n left: `${left}px`,\n zIndex: 9999,\n '--arrow-left': `${arrowLeft}px`,\n '--arrow-top': `${arrowTop}px`\n } as React.CSSProperties & { '--arrow-left': string; '--arrow-top': string };\n };\n\n useEffect(() => {\n if (!displayTooltip || !isWithPortal) {\n setIsPortalPositioned(false);\n return;\n }\n\n const updatePosition = () => {\n const tooltipElement = document.getElementById(tooltipContentId);\n\n // Wait for tooltip to be rendered and have valid dimensions\n if (!tooltipElement || tooltipElement.offsetHeight === 0) {\n requestAnimationFrame(updatePosition);\n return;\n }\n\n const calculatedStyle = calculateTooltipPortalStyle();\n \n // Batch both state updates into a single synchronous render using flushSync\n flushSync(() => {\n setTooltipPortalStyle(calculatedStyle);\n setIsPortalPositioned(true);\n });\n };\n\n // Initial position calculation\n const timeout = setTimeout(updatePosition, tooltipSrcRef ? 60 : 10);\n\n const handleClick = (e: MouseEvent) => {\n const tooltip = document.getElementById(tooltipContentId);\n const source = tooltipSourceRef.current;\n const target = e.target as Node;\n\n if (tooltip && source && !tooltip.contains(target) && !source.contains(target)) {\n setDisplayTooltip(false);\n }\n };\n\n // Only add click listener if not always-on\n const shouldAddClickListener = displayOn !== 'always-on';\n if (shouldAddClickListener) {\n document.body.addEventListener('click', handleClick, true);\n }\n window.addEventListener('scroll', updatePosition, true);\n window.addEventListener('resize', updatePosition);\n\n // Watch for style changes on the source element when tooltipSrcRef is provided\n // This ensures the tooltip position updates when the blocker is repositioned\n let mutationObserver: MutationObserver | null = null;\n if (tooltipSrcRef && tooltipSourceRef.current) {\n mutationObserver = new MutationObserver(() => {\n updatePosition();\n });\n mutationObserver.observe(tooltipSourceRef.current, {\n attributes: true,\n attributeFilter: ['style', 'class']\n });\n }\n\n return () => {\n clearTimeout(timeout);\n clearHideTimeout();\n if (shouldAddClickListener) {\n document.body.removeEventListener('click', handleClick, true);\n }\n window.removeEventListener('scroll', updatePosition, true);\n window.removeEventListener('resize', updatePosition);\n if (mutationObserver) {\n mutationObserver.disconnect();\n }\n };\n }, [displayTooltip, isWithPortal, position, displayOn, tooltipSrcRef, tooltipContentId]);\n\n // For enabled triggers: link trigger to tooltip content via aria-describedby so screen\n // readers announce tooltip text on focus. Native elements need kebab-case only;\n // se-design components (Icon, Button) also accept camelCase ariaDescribedBy prop.\n // Disabled trigger already wires aria-describedby in disabledTriggerProps.\n const linkedTooltipSrc =\n !isTriggerDisabled && React.isValidElement(tooltipSrc)\n ? React.cloneElement(tooltipSrc as React.ReactElement<any>, {\n 'aria-describedby': tooltipContentId,\n ...(typeof tooltipSrc.type !== 'string' && { ariaDescribedBy: tooltipContentId })\n })\n : tooltipSrc;\n\n const disabledTriggerProps = isTriggerDisabled\n ? {\n tabIndex: 0,\n role: 'button' as const,\n 'aria-label': disabledTriggerAriaLabel,\n 'aria-describedby': tooltipContentId,\n onFocus: showTooltip,\n onBlur: scheduleHide,\n onKeyDown: onDisabledTriggerKeyDown\n }\n : undefined;\n\n const enabledTriggerProps = !isTriggerDisabled\n ? dismissOnFocusOutProps\n : undefined;\n\n return !isWithPortal ? (\n <div\n className=\"se-design-tooltip group relative inline-flex items-center min-w-0\"\n onClick={onTooltipSrcClick}\n {...disabledTriggerProps}\n {...enabledTriggerProps}\n >\n <div className=\"cursor-pointer flex items-center min-w-0\">\n {linkedTooltipSrc}\n </div>\n <div\n ref={tooltipContentRef}\n id={tooltipContentId}\n role=\"tooltip\"\n className={`flex justify-center px-3 py-2 min-w-24 max-w-[${maxWidth}px]\n absolute top-[calc(100%+8px)] w-max bg-[var(--color-gray-800)] text-[var(--color-white)] text-base rounded-[3px]\n before:content-[' '] before:w-3.5 before:h-3.5 before:bg-[var(--color-gray-800)] before:inline-block\n before:absolute before:rounded-tl-sm before:rotate-45`}\n data-automation-id={automationId || 'tooltip-content'}\n >\n {isContentString ? <p className=\"leading-normal\">{content}</p> : content}\n </div>\n </div>\n ) : (\n <div\n className=\"se-design-tooltip group relative inline-flex items-center min-w-0\"\n {...events}\n {...disabledTriggerProps}\n {...enabledTriggerProps}\n >\n <div\n className=\"cursor-pointer flex items-center min-w-0\"\n ref={tooltipSrcRef ? undefined : (tooltipSourceRef as React.RefObject<HTMLDivElement>)}\n onMouseEnter={displayOn === 'always-on' ? undefined : clearHideTimeout}\n onMouseLeave={scheduleHide}\n >\n {linkedTooltipSrc}\n </div>\n {displayTooltip &&\n ReactDOM.createPortal(\n <>\n <style>\n {`#${tooltipContentId}::before {\n left: var(--arrow-left, 0);\n top: var(--arrow-top, 0);\n }`}\n </style>\n <div\n id={tooltipContentId}\n role=\"tooltip\"\n className={`flex justify-center px-3 py-2 min-w-24 bg-[var(--color-gray-800)] text-[var(--color-white)] text-base rounded-[3px]\n before:content-[' '] before:w-3.5 before:h-3.5 before:bg-[var(--color-gray-800)] before:inline-block\n before:absolute before:rounded-tl-sm before:rotate-45 ${tooltipContentClasses}`}\n style={{\n ...tooltipPortalStyle,\n maxWidth: `${maxWidth}px`,\n wordBreak: 'break-word',\n overflowWrap: 'break-word',\n visibility: isPortalPositioned ? 'visible' : 'hidden',\n opacity: isPortalPositioned ? 1 : 0,\n pointerEvents: isPortalPositioned ? 'auto' : 'none',\n transition: isPortalPositioned ? 'opacity 0.15s ease-in' : 'none',\n // Ensure it stays at 0,0 until positioned to avoid any visual flash\n ...(isPortalPositioned ? {} : { position: 'fixed', top: '0px', left: '0px' })\n }}\n onMouseEnter={displayOn === 'always-on' ? undefined : clearHideTimeout}\n onMouseLeave={scheduleHide}\n >\n {isContentString ? <p className=\"leading-normal\">{content}</p> : content}\n </div>\n </>,\n document.body\n )}\n </div>\n );\n};\n"],"names":["Tooltip","content","tooltipSrc","position","displayOn","maxWidth","isWithPortal","tooltipSrcRef","undefined","isTriggerDisabled","disabledTriggerAriaLabel","tooltipContentClasses","tooltipOffset","automationId","displayTooltip","setDisplayTooltip","useState","tooltipContentRef","useRef","internalToolTipSrcRef","tooltipSourceRef","tooltipPortalStyle","setTooltipPortalStyle","isPortalPositioned","setIsPortalPositioned","hideTimeoutRef","isContentString","tooltipContentId","useStableId","clearHideTimeout","current","clearTimeout","scheduleHide","setTimeout","showTooltip","onDisabledTriggerKeyDown","e","key","preventDefault","prev","dismissOnFocusOutProps","useDismissOnFocusOut","disabled","onFocusIn","onFocusOut","onEscape","useEffect","tooltipContent","setAttribute","classList","add","remove","onTooltipSrcClick","events","onClick","toggleTooltip","onMouseEnter","onMouseLeave","calculateTooltipPortalStyle","refToUse","srcRect","getBoundingClientRect","scrollX","window","pageXOffset","scrollY","pageYOffset","arrowSize","tooltipElement","document","getElementById","tooltipWidth","offsetWidth","tooltipHeight","offsetHeight","top","left","arrowLeft","arrowTop","bottom","width","right","height","zIndex","updatePosition","requestAnimationFrame","calculatedStyle","flushSync","timeout","handleClick","tooltip","source","target","contains","shouldAddClickListener","body","addEventListener","mutationObserver","MutationObserver","observe","attributes","attributeFilter","removeEventListener","disconnect","linkedTooltipSrc","React","isValidElement","cloneElement","type","ariaDescribedBy","disabledTriggerProps","tabIndex","role","onFocus","onBlur","onKeyDown","enabledTriggerProps","createElement","_extends","className","ref","ReactDOM","createPortal","Fragment","id","style","wordBreak","overflowWrap","visibility","opacity","pointerEvents","transition"],"mappings":";;;;;;;;;;;;;;AAqEO,MAAMA,KAAUA,CAAC;AAAA,EACtBC,SAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,WAAAA,IAAY;AAAA,EACZC,U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