@xsolla/xui-tooltip 0.211.0 → 0.212.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -83,7 +83,7 @@ export default function Example() {
83
83
 
84
84
  | Prop | Type | Default | Description |
85
85
  | ------------------- | ------------------------------ | ------- | ------------------------------------------------------------------------------------------------------------- |
86
- | `content` | `ReactNode` | — | **Required.** Tooltip content. Strings/numbers render as themed text. |
86
+ | `content` | `ReactNode` | — | **Required.** Tooltip content. Strings/numbers render as themed text; `\n` in a string is preserved as a line break (`white-space: pre-line`) while long lines still wrap normally. |
87
87
  | `children` | `ReactNode` | — | **Required.** Trigger element. |
88
88
  | `size` | `"sm" \| "md" \| "lg" \| "xl"` | `"md"` | Typography size. |
89
89
  | `placement` | `TooltipPlacement` | `"top"` | Position relative to trigger. |
@@ -217,6 +217,24 @@ export default function Delays() {
217
217
  }
218
218
  ```
219
219
 
220
+ ### Multiline content
221
+
222
+ String content preserves `\n` as line breaks (`white-space: pre-line`); long lines still wrap normally.
223
+
224
+ ```tsx
225
+ import * as React from "react";
226
+ import { Tooltip } from "@xsolla/xui-tooltip";
227
+ import { Button } from "@xsolla/xui-button";
228
+
229
+ export default function Multiline() {
230
+ return (
231
+ <Tooltip content={"First line\nSecond line"}>
232
+ <Button variant="secondary">Hover me</Button>
233
+ </Tooltip>
234
+ );
235
+ }
236
+ ```
237
+
220
238
  ### Rich content
221
239
 
222
240
  ```tsx
@@ -310,6 +328,7 @@ export default function DisabledTrigger() {
310
328
  ## Behaviour
311
329
 
312
330
  - **Hover bridge.** Moving the cursor from the trigger onto the tooltip keeps it visible — the tooltip surface is hoverable and a short `delayLeave` grace period (default 100ms) bridges the gap between trigger and tooltip, so the tooltip no longer flickers or disappears when the cursor moves toward it. The tooltip hides once the cursor leaves *both* the trigger and the tooltip.
331
+ - **Multiline content.** String/number `content` renders with `white-space: pre-line`, so `\n` characters are preserved as line breaks while long lines continue to wrap.
313
332
 
314
333
  ## Theme
315
334
 
package/native/index.js CHANGED
@@ -668,7 +668,10 @@ var Tooltip = (0, import_react.forwardRef)(
668
668
  color: theme.colors.content.primary,
669
669
  fontSize: typoStyles.fontSize,
670
670
  fontWeight: "400",
671
- style: { lineHeight: typoStyles.lineHeight },
671
+ style: {
672
+ lineHeight: typoStyles.lineHeight,
673
+ whiteSpace: "pre-line"
674
+ },
672
675
  children: content
673
676
  }
674
677
  ) : content
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx","../../src/Tooltip.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/Text.tsx","../../src/Portal.native.tsx"],"sourcesContent":["export * from \"./Tooltip\";\nexport * from \"./types\";\n","import React, { forwardRef, useState, useMemo, useEffect, useRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text } from \"@xsolla/xui-primitives\";\nimport {\n useResolvedTheme,\n useId,\n isNative,\n useModalId,\n useOverlayLayer,\n LAYER_OFFSET,\n type ThemeOverrideProps,\n} from \"@xsolla/xui-core\";\nimport type { TooltipPlacement, TooltipProps, TooltipSize } from \"./types\";\nimport { Portal } from \"./Portal\";\n\nconst TOOLTIP_OPEN_EVENT = \"xui-tooltip-open\";\ntype TooltipTheme = {\n colors: {\n layer: {\n float: string;\n };\n content: {\n primary: string;\n };\n };\n shape: {\n tooltip: Record<TooltipSize, { borderRadius: number | string }>;\n };\n};\n\nconst ARROW_SIZE = 10;\nconst ARROW_HALF = ARROW_SIZE / 2;\n// Keeps the arrow clear of the panel's corner radius (8px for `md`).\nconst ARROW_EDGE_OFFSET = 12;\nconst ARROW_CENTER_INSET = ARROW_EDGE_OFFSET + ARROW_HALF;\n\n// Re-centres the arrow on triggers too narrow for the flush inset (FEP-889).\nconst getArrowAlignmentShift = (triggerWidth: number) =>\n Math.max(0, ARROW_CENTER_INSET - triggerWidth / 2);\n\nconst getPositionStyles = (\n triggerRect: DOMRect,\n placement: TooltipPlacement,\n offset: number,\n isVisible: boolean\n) => {\n const slideDistance = 8;\n const scale = isVisible ? \"scale(1)\" : \"scale(0.95)\";\n const slideOffset = isVisible ? 0 : -slideDistance;\n const arrowShift = getArrowAlignmentShift(triggerRect.width);\n\n switch (placement) {\n case \"top\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left + triggerRect.width / 2,\n transform: `translateX(-50%) translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"top-left\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.right + arrowShift,\n transform: `translateX(-100%) translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"top-right\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left - arrowShift,\n transform: `translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"bottom\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.left + triggerRect.width / 2,\n transform: `translateX(-50%) translateY(${slideOffset}px) ${scale}`,\n };\n case \"bottom-left\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.right + arrowShift,\n transform: `translateX(-100%) translateY(${slideOffset}px) ${scale}`,\n };\n case \"bottom-right\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.left - arrowShift,\n transform: `translateY(${slideOffset}px) ${scale}`,\n };\n case \"left\":\n return {\n top: triggerRect.top + triggerRect.height / 2,\n left: triggerRect.left - offset,\n transform: `translateX(calc(-100% - ${slideOffset}px)) translateY(-50%) ${scale}`,\n };\n case \"right\":\n return {\n top: triggerRect.top + triggerRect.height / 2,\n left: triggerRect.right + offset,\n transform: `translateX(${slideOffset}px) translateY(-50%) ${scale}`,\n };\n default:\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left,\n transform: `translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n }\n};\n\nconst getTypoStyles = (size: TooltipSize) => {\n switch (size) {\n case \"sm\":\n return { fontSize: 14, lineHeight: \"16px\" };\n case \"md\":\n return { fontSize: 16, lineHeight: \"18px\" };\n case \"lg\":\n return { fontSize: 18, lineHeight: \"20px\" };\n case \"xl\":\n return { fontSize: 20, lineHeight: \"22px\" };\n default:\n return { fontSize: 16, lineHeight: \"18px\" };\n }\n};\n\nconst getArrowStyles = (placement: TooltipPlacement) => {\n const base: React.CSSProperties = {\n width: ARROW_SIZE,\n height: ARROW_SIZE,\n transform: \"rotate(45deg)\",\n borderRadius: 1,\n };\n\n const placementStyles: Record<TooltipPlacement, React.CSSProperties> = {\n top: { bottom: -ARROW_HALF, left: \"50%\", marginLeft: -ARROW_HALF },\n \"top-left\": { bottom: -ARROW_HALF, right: ARROW_EDGE_OFFSET },\n \"top-right\": { bottom: -ARROW_HALF, left: ARROW_EDGE_OFFSET },\n\n bottom: { top: -ARROW_HALF, left: \"50%\", marginLeft: -ARROW_HALF },\n \"bottom-left\": { top: -ARROW_HALF, right: ARROW_EDGE_OFFSET },\n \"bottom-right\": { top: -ARROW_HALF, left: ARROW_EDGE_OFFSET },\n\n left: { right: -ARROW_HALF, top: \"50%\", marginTop: -ARROW_HALF },\n right: { left: -ARROW_HALF, top: \"50%\", marginTop: -ARROW_HALF },\n };\n\n return { ...base, ...placementStyles[placement] };\n};\n\nexport const Tooltip = forwardRef<\n HTMLDivElement,\n TooltipProps & ThemeOverrideProps\n>(\n (\n {\n content,\n children,\n size = \"md\",\n delayEnter = 0,\n delayLeave = 100,\n offset = 12,\n placement = \"top\",\n maxWidth,\n controlledVisible,\n style,\n \"data-testid\": dataTestId,\n className,\n testID,\n themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const [isHovered, setIsHovered] = useState(false);\n const [triggerRect, setTriggerRect] = useState<DOMRect | null>(null);\n const { theme: resolvedTheme } = useResolvedTheme({\n themeMode,\n themeProductContext,\n });\n const theme = resolvedTheme as TooltipTheme;\n const enterTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const leaveTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const rafRef = useRef<number | null>(null);\n const triggerRef = useRef<HTMLDivElement>(null);\n const tooltipId = useId();\n const modalId = useModalId();\n const overlayLayer = useOverlayLayer();\n\n const isVisible =\n controlledVisible !== undefined ? controlledVisible : isHovered;\n\n const clearPendingVisibilityUpdates = () => {\n if (enterTimeoutRef.current) {\n clearTimeout(enterTimeoutRef.current);\n enterTimeoutRef.current = null;\n }\n\n if (leaveTimeoutRef.current) {\n clearTimeout(leaveTimeoutRef.current);\n leaveTimeoutRef.current = null;\n }\n\n if (rafRef.current) {\n cancelAnimationFrame(rafRef.current);\n rafRef.current = null;\n }\n };\n\n const forceHideTooltip = () => {\n clearPendingVisibilityUpdates();\n setIsHovered(false);\n };\n\n const positionStyles = useMemo(\n () =>\n triggerRect\n ? getPositionStyles(triggerRect, placement, offset, isVisible)\n : { top: 0, left: 0 },\n [triggerRect, placement, offset, isVisible]\n );\n const typoStyles = useMemo(() => getTypoStyles(size), [size]);\n const borderRadius = (theme.shape.tooltip[size] ?? theme.shape.tooltip.md)\n .borderRadius;\n const arrowStyles = useMemo(() => getArrowStyles(placement), [placement]);\n\n // Update trigger position when tooltip becomes visible and on scroll/resize\n useEffect(() => {\n if (!isVisible || isNative) return;\n\n const updatePosition = () => {\n if (triggerRef.current) {\n setTriggerRect(triggerRef.current.getBoundingClientRect());\n }\n };\n\n updatePosition();\n\n window.addEventListener(\"scroll\", updatePosition, true);\n window.addEventListener(\"resize\", updatePosition);\n\n return () => {\n window.removeEventListener(\"scroll\", updatePosition, true);\n window.removeEventListener(\"resize\", updatePosition);\n };\n }, [isVisible]);\n\n const showTooltip = () => {\n clearPendingVisibilityUpdates();\n\n if (!isNative && typeof document !== \"undefined\") {\n document.dispatchEvent(\n new CustomEvent(TOOLTIP_OPEN_EVENT, { detail: { tooltipId } })\n );\n }\n\n // Update position before showing to prevent pop-in\n if (triggerRef.current) {\n setTriggerRect(triggerRef.current.getBoundingClientRect());\n\n // Double RAF to ensure position is rendered before showing tooltip\n rafRef.current = requestAnimationFrame(() => {\n rafRef.current = requestAnimationFrame(() => {\n if (delayEnter > 0) {\n enterTimeoutRef.current = setTimeout(() => {\n setIsHovered(true);\n }, delayEnter);\n } else {\n setIsHovered(true);\n }\n });\n });\n }\n };\n\n const showTooltipOnFocus = (event: React.FocusEvent<HTMLElement>) => {\n // Only reveal the tooltip on intentional keyboard focus. Focus that the\n // browser restores to the trigger when the tab/window regains focus — as\n // well as focus from a mouse click — must not re-trigger the tooltip\n // (FEP-832). `:focus-visible` encodes exactly this heuristic: it matches\n // for keyboard navigation but not for pointer-driven or restored focus.\n const target = event.target as HTMLElement | null;\n\n if (target && typeof target.matches === \"function\") {\n let isFocusVisible: boolean;\n try {\n isFocusVisible = target.matches(\":focus-visible\");\n } catch {\n // Legacy browsers without :focus-visible support — preserve the\n // previous behaviour of showing on any focus.\n isFocusVisible = true;\n }\n\n if (!isFocusVisible) return;\n }\n\n showTooltip();\n };\n\n const hideTooltip = () => {\n clearPendingVisibilityUpdates();\n\n if (delayLeave > 0) {\n leaveTimeoutRef.current = setTimeout(() => {\n setIsHovered(false);\n }, delayLeave);\n } else {\n setIsHovered(false);\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\" && isVisible) {\n forceHideTooltip();\n }\n };\n\n const handleVisibilityChange = () => {\n if (document.visibilityState === \"hidden\") {\n forceHideTooltip();\n }\n };\n\n const handleTooltipOpen = (event: Event) => {\n const { tooltipId: activeTooltipId } =\n (event as CustomEvent).detail ?? {};\n\n if (activeTooltipId !== tooltipId) {\n forceHideTooltip();\n }\n };\n\n document.addEventListener(\"keydown\", handleEscape);\n document.addEventListener(\"visibilitychange\", handleVisibilityChange);\n document.addEventListener(TOOLTIP_OPEN_EVENT, handleTooltipOpen);\n\n return () => {\n document.removeEventListener(\"keydown\", handleEscape);\n document.removeEventListener(\n \"visibilitychange\",\n handleVisibilityChange\n );\n document.removeEventListener(TOOLTIP_OPEN_EVENT, handleTooltipOpen);\n clearPendingVisibilityUpdates();\n };\n }, [isVisible, tooltipId]);\n\n return (\n <Box\n testID={testID}\n ref={triggerRef}\n position=\"relative\"\n display=\"inline-flex\"\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n onFocus={showTooltipOnFocus}\n onBlur={hideTooltip}\n className={className}\n style={{ height: \"fit-content\" }}\n aria-describedby={isVisible ? tooltipId : undefined}\n >\n {children}\n {!isNative && triggerRect && (\n <Portal>\n <Box\n ref={ref}\n data-testid={dataTestId}\n data-modal-id={modalId}\n position=\"fixed\"\n backgroundColor={theme.colors.layer.float}\n borderRadius={borderRadius}\n paddingVertical={8}\n paddingHorizontal={12}\n zIndex={overlayLayer + LAYER_OFFSET.tooltip}\n id={tooltipId}\n role=\"tooltip\"\n aria-hidden={!isVisible}\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n style={{\n ...positionStyles,\n // https://stackoverflow.com/questions/62844007/how-to-apply-tool-tip-arrow-triangle-shadow\n filter:\n \"drop-shadow(0 6px 10px rgba(7, 7, 8, 0.1)) drop-shadow(0 2px 3px rgba(7, 7, 8, 0.2))\",\n WebkitFilter:\n \"drop-shadow(0 6px 10px rgba(7, 7, 8, 0.1)) drop-shadow(0 2px 3px rgba(7, 7, 8, 0.2))\",\n opacity: isVisible ? 1 : 0,\n visibility: isVisible ? \"visible\" : \"hidden\",\n transition:\n \"opacity 150ms cubic-bezier(.4,0,.2,1), transform 150ms cubic-bezier(.4,0,.2,1), visibility 150ms cubic-bezier(.4,0,.2,1)\",\n pointerEvents: isVisible ? \"auto\" : \"none\",\n whiteSpace: \"normal\",\n width: \"max-content\",\n maxWidth: maxWidth ?? \"none\",\n overflow: \"visible\",\n willChange: isVisible ? \"transform, opacity\" : \"auto\", // optimize rendering and ensure more stable positioning\n ...style,\n }}\n >\n <Box\n position=\"absolute\"\n backgroundColor={theme.colors.layer.float}\n style={{\n ...arrowStyles,\n backfaceVisibility: \"hidden\",\n WebkitBackfaceVisibility: \"hidden\",\n }}\n />\n <Box\n style={{\n wordWrap: \"break-word\",\n overflowWrap: \"break-word\",\n maxWidth: \"100%\",\n whiteSpace: \"normal\",\n }}\n >\n {typeof content === \"string\" || typeof content === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={typoStyles.fontSize}\n fontWeight=\"400\"\n style={{ lineHeight: typoStyles.lineHeight }}\n >\n {content}\n </Text>\n ) : (\n content\n )}\n </Box>\n </Box>\n </Portal>\n )}\n </Box>\n );\n }\n);\n\nTooltip.displayName = \"Tooltip\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n AccessibilityRole,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleToAccessibilityRole: Record<string, AccessibilityRole> = {\n button: \"button\",\n link: \"link\",\n img: \"image\",\n image: \"image\",\n summary: \"summary\",\n switch: \"switch\",\n checkbox: \"checkbox\",\n radio: \"radio\",\n heading: \"header\",\n text: \"text\",\n search: \"search\",\n alert: \"alert\",\n none: \"none\",\n presentation: \"none\",\n progressbar: \"progressbar\",\n scrollbar: \"scrollbar\",\n adjustable: \"adjustable\",\n tab: \"tab\",\n menu: \"menu\",\n menuitem: \"menuitem\",\n list: \"list\",\n timer: \"timer\",\n};\n\n/** RN ViewStyle.gap is typed as number (Yoga gap), not DimensionValue. */\nconst toGapValue = (gap: number | string | undefined): number | undefined => {\n if (gap === undefined) return undefined;\n if (typeof gap === \"number\") return gap;\n const pxMatch = /^(\\d+(?:\\.\\d+)?)px$/.exec(gap);\n if (pxMatch) return Number(pxMatch[1]);\n const asNumber = Number(gap);\n return Number.isFinite(asNumber) ? asNumber : undefined;\n};\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n flexShrink,\n gap,\n overflow,\n opacity,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n disabled,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n opacity: opacity ?? (disabled ? 0.5 : undefined),\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n flexShrink,\n gap: toGapValue(gap),\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Map web a11y props; drop the rest of the web-only attributes before\n // spreading onto RN hosts (unknown props warn at runtime).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n className,\n \"data-testid\": _dataTestId,\n cursor: _cursor,\n type: _type,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n const accessibilityRole =\n (typeof role === \"string\" && roleToAccessibilityRole[role]) ||\n (as === \"button\" ? \"button\" : undefined);\n const isDisabled = Boolean(disabled || ariaDisabled);\n const accessibilityState = {\n disabled: isDisabled || undefined,\n busy: Boolean(ariaBusy) || undefined,\n };\n const accessibilityLiveRegion =\n ariaLive === \"polite\" || ariaLive === \"assertive\" ? ariaLive : undefined;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : alt}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n // Prefer Pressable whenever the node is interactive or explicitly a button,\n // so disabled / aria-disabled controls stay in the a11y tree as buttons.\n if (onPress || as === \"button\") {\n return (\n <Pressable\n onPress={!isDisabled && onPress ? onPress : undefined}\n disabled={isDisabled}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={\n typeof ariaLabel === \"string\" ? ariaLabel : undefined\n }\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : undefined}\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={dataTestId || testID || id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n","import { ReactNode } from \"react\";\n\ninterface PortalProps {\n children: ReactNode;\n}\n\n// Portal not supported on React Native - tooltip content renders inline\nexport const Portal = ({ children }: PortalProps) => {\n return <>{children}</>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAwE;;;ACCxE,0BASO;AAwMD;AArMN,IAAM,0BAA6D;AAAA,EACjE,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,cAAc;AAAA,EACd,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;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ACd;AAAA,oBAEC,iBAAO,YAAY,YAAY,OAAO,YAAY,WACjD;AAAA,sBAAC;AAAA;AAAA,wBACC,OAAO,MAAM,OAAO,QAAQ;AAAA,wBAC5B,UAAU,WAAW;AAAA,wBACrB,YAAW;AAAA,wBACX,OAAO,EAAE,YAAY,WAAW,WAAW;AAAA,wBAE1C;AAAA;AAAA,oBACH,IAEA;AAAA;AAAA,gBAEJ;AAAA;AAAA;AAAA,UACF,GACF;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;","names":["import_react_native","import_jsx_runtime","RNText","import_jsx_runtime","import_jsx_runtime"]}
1
+ {"version":3,"sources":["../../src/index.tsx","../../src/Tooltip.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/Text.tsx","../../src/Portal.native.tsx"],"sourcesContent":["export * from \"./Tooltip\";\nexport * from \"./types\";\n","import React, { forwardRef, useState, useMemo, useEffect, useRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text } from \"@xsolla/xui-primitives\";\nimport {\n useResolvedTheme,\n useId,\n isNative,\n useModalId,\n useOverlayLayer,\n LAYER_OFFSET,\n type ThemeOverrideProps,\n} from \"@xsolla/xui-core\";\nimport type { TooltipPlacement, TooltipProps, TooltipSize } from \"./types\";\nimport { Portal } from \"./Portal\";\n\nconst TOOLTIP_OPEN_EVENT = \"xui-tooltip-open\";\ntype TooltipTheme = {\n colors: {\n layer: {\n float: string;\n };\n content: {\n primary: string;\n };\n };\n shape: {\n tooltip: Record<TooltipSize, { borderRadius: number | string }>;\n };\n};\n\nconst ARROW_SIZE = 10;\nconst ARROW_HALF = ARROW_SIZE / 2;\n// Keeps the arrow clear of the panel's corner radius (8px for `md`).\nconst ARROW_EDGE_OFFSET = 12;\nconst ARROW_CENTER_INSET = ARROW_EDGE_OFFSET + ARROW_HALF;\n\n// Re-centres the arrow on triggers too narrow for the flush inset (FEP-889).\nconst getArrowAlignmentShift = (triggerWidth: number) =>\n Math.max(0, ARROW_CENTER_INSET - triggerWidth / 2);\n\nconst getPositionStyles = (\n triggerRect: DOMRect,\n placement: TooltipPlacement,\n offset: number,\n isVisible: boolean\n) => {\n const slideDistance = 8;\n const scale = isVisible ? \"scale(1)\" : \"scale(0.95)\";\n const slideOffset = isVisible ? 0 : -slideDistance;\n const arrowShift = getArrowAlignmentShift(triggerRect.width);\n\n switch (placement) {\n case \"top\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left + triggerRect.width / 2,\n transform: `translateX(-50%) translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"top-left\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.right + arrowShift,\n transform: `translateX(-100%) translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"top-right\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left - arrowShift,\n transform: `translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"bottom\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.left + triggerRect.width / 2,\n transform: `translateX(-50%) translateY(${slideOffset}px) ${scale}`,\n };\n case \"bottom-left\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.right + arrowShift,\n transform: `translateX(-100%) translateY(${slideOffset}px) ${scale}`,\n };\n case \"bottom-right\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.left - arrowShift,\n transform: `translateY(${slideOffset}px) ${scale}`,\n };\n case \"left\":\n return {\n top: triggerRect.top + triggerRect.height / 2,\n left: triggerRect.left - offset,\n transform: `translateX(calc(-100% - ${slideOffset}px)) translateY(-50%) ${scale}`,\n };\n case \"right\":\n return {\n top: triggerRect.top + triggerRect.height / 2,\n left: triggerRect.right + offset,\n transform: `translateX(${slideOffset}px) translateY(-50%) ${scale}`,\n };\n default:\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left,\n transform: `translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n }\n};\n\nconst getTypoStyles = (size: TooltipSize) => {\n switch (size) {\n case \"sm\":\n return { fontSize: 14, lineHeight: \"16px\" };\n case \"md\":\n return { fontSize: 16, lineHeight: \"18px\" };\n case \"lg\":\n return { fontSize: 18, lineHeight: \"20px\" };\n case \"xl\":\n return { fontSize: 20, lineHeight: \"22px\" };\n default:\n return { fontSize: 16, lineHeight: \"18px\" };\n }\n};\n\nconst getArrowStyles = (placement: TooltipPlacement) => {\n const base: React.CSSProperties = {\n width: ARROW_SIZE,\n height: ARROW_SIZE,\n transform: \"rotate(45deg)\",\n borderRadius: 1,\n };\n\n const placementStyles: Record<TooltipPlacement, React.CSSProperties> = {\n top: { bottom: -ARROW_HALF, left: \"50%\", marginLeft: -ARROW_HALF },\n \"top-left\": { bottom: -ARROW_HALF, right: ARROW_EDGE_OFFSET },\n \"top-right\": { bottom: -ARROW_HALF, left: ARROW_EDGE_OFFSET },\n\n bottom: { top: -ARROW_HALF, left: \"50%\", marginLeft: -ARROW_HALF },\n \"bottom-left\": { top: -ARROW_HALF, right: ARROW_EDGE_OFFSET },\n \"bottom-right\": { top: -ARROW_HALF, left: ARROW_EDGE_OFFSET },\n\n left: { right: -ARROW_HALF, top: \"50%\", marginTop: -ARROW_HALF },\n right: { left: -ARROW_HALF, top: \"50%\", marginTop: -ARROW_HALF },\n };\n\n return { ...base, ...placementStyles[placement] };\n};\n\nexport const Tooltip = forwardRef<\n HTMLDivElement,\n TooltipProps & ThemeOverrideProps\n>(\n (\n {\n content,\n children,\n size = \"md\",\n delayEnter = 0,\n delayLeave = 100,\n offset = 12,\n placement = \"top\",\n maxWidth,\n controlledVisible,\n style,\n \"data-testid\": dataTestId,\n className,\n testID,\n themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const [isHovered, setIsHovered] = useState(false);\n const [triggerRect, setTriggerRect] = useState<DOMRect | null>(null);\n const { theme: resolvedTheme } = useResolvedTheme({\n themeMode,\n themeProductContext,\n });\n const theme = resolvedTheme as TooltipTheme;\n const enterTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const leaveTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const rafRef = useRef<number | null>(null);\n const triggerRef = useRef<HTMLDivElement>(null);\n const tooltipId = useId();\n const modalId = useModalId();\n const overlayLayer = useOverlayLayer();\n\n const isVisible =\n controlledVisible !== undefined ? controlledVisible : isHovered;\n\n const clearPendingVisibilityUpdates = () => {\n if (enterTimeoutRef.current) {\n clearTimeout(enterTimeoutRef.current);\n enterTimeoutRef.current = null;\n }\n\n if (leaveTimeoutRef.current) {\n clearTimeout(leaveTimeoutRef.current);\n leaveTimeoutRef.current = null;\n }\n\n if (rafRef.current) {\n cancelAnimationFrame(rafRef.current);\n rafRef.current = null;\n }\n };\n\n const forceHideTooltip = () => {\n clearPendingVisibilityUpdates();\n setIsHovered(false);\n };\n\n const positionStyles = useMemo(\n () =>\n triggerRect\n ? getPositionStyles(triggerRect, placement, offset, isVisible)\n : { top: 0, left: 0 },\n [triggerRect, placement, offset, isVisible]\n );\n const typoStyles = useMemo(() => getTypoStyles(size), [size]);\n const borderRadius = (theme.shape.tooltip[size] ?? theme.shape.tooltip.md)\n .borderRadius;\n const arrowStyles = useMemo(() => getArrowStyles(placement), [placement]);\n\n // Update trigger position when tooltip becomes visible and on scroll/resize\n useEffect(() => {\n if (!isVisible || isNative) return;\n\n const updatePosition = () => {\n if (triggerRef.current) {\n setTriggerRect(triggerRef.current.getBoundingClientRect());\n }\n };\n\n updatePosition();\n\n window.addEventListener(\"scroll\", updatePosition, true);\n window.addEventListener(\"resize\", updatePosition);\n\n return () => {\n window.removeEventListener(\"scroll\", updatePosition, true);\n window.removeEventListener(\"resize\", updatePosition);\n };\n }, [isVisible]);\n\n const showTooltip = () => {\n clearPendingVisibilityUpdates();\n\n if (!isNative && typeof document !== \"undefined\") {\n document.dispatchEvent(\n new CustomEvent(TOOLTIP_OPEN_EVENT, { detail: { tooltipId } })\n );\n }\n\n // Update position before showing to prevent pop-in\n if (triggerRef.current) {\n setTriggerRect(triggerRef.current.getBoundingClientRect());\n\n // Double RAF to ensure position is rendered before showing tooltip\n rafRef.current = requestAnimationFrame(() => {\n rafRef.current = requestAnimationFrame(() => {\n if (delayEnter > 0) {\n enterTimeoutRef.current = setTimeout(() => {\n setIsHovered(true);\n }, delayEnter);\n } else {\n setIsHovered(true);\n }\n });\n });\n }\n };\n\n const showTooltipOnFocus = (event: React.FocusEvent<HTMLElement>) => {\n // Only reveal the tooltip on intentional keyboard focus. Focus that the\n // browser restores to the trigger when the tab/window regains focus — as\n // well as focus from a mouse click — must not re-trigger the tooltip\n // (FEP-832). `:focus-visible` encodes exactly this heuristic: it matches\n // for keyboard navigation but not for pointer-driven or restored focus.\n const target = event.target as HTMLElement | null;\n\n if (target && typeof target.matches === \"function\") {\n let isFocusVisible: boolean;\n try {\n isFocusVisible = target.matches(\":focus-visible\");\n } catch {\n // Legacy browsers without :focus-visible support — preserve the\n // previous behaviour of showing on any focus.\n isFocusVisible = true;\n }\n\n if (!isFocusVisible) return;\n }\n\n showTooltip();\n };\n\n const hideTooltip = () => {\n clearPendingVisibilityUpdates();\n\n if (delayLeave > 0) {\n leaveTimeoutRef.current = setTimeout(() => {\n setIsHovered(false);\n }, delayLeave);\n } else {\n setIsHovered(false);\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\" && isVisible) {\n forceHideTooltip();\n }\n };\n\n const handleVisibilityChange = () => {\n if (document.visibilityState === \"hidden\") {\n forceHideTooltip();\n }\n };\n\n const handleTooltipOpen = (event: Event) => {\n const { tooltipId: activeTooltipId } =\n (event as CustomEvent).detail ?? {};\n\n if (activeTooltipId !== tooltipId) {\n forceHideTooltip();\n }\n };\n\n document.addEventListener(\"keydown\", handleEscape);\n document.addEventListener(\"visibilitychange\", handleVisibilityChange);\n document.addEventListener(TOOLTIP_OPEN_EVENT, handleTooltipOpen);\n\n return () => {\n document.removeEventListener(\"keydown\", handleEscape);\n document.removeEventListener(\n \"visibilitychange\",\n handleVisibilityChange\n );\n document.removeEventListener(TOOLTIP_OPEN_EVENT, handleTooltipOpen);\n clearPendingVisibilityUpdates();\n };\n }, [isVisible, tooltipId]);\n\n return (\n <Box\n testID={testID}\n ref={triggerRef}\n position=\"relative\"\n display=\"inline-flex\"\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n onFocus={showTooltipOnFocus}\n onBlur={hideTooltip}\n className={className}\n style={{ height: \"fit-content\" }}\n aria-describedby={isVisible ? tooltipId : undefined}\n >\n {children}\n {!isNative && triggerRect && (\n <Portal>\n <Box\n ref={ref}\n data-testid={dataTestId}\n data-modal-id={modalId}\n position=\"fixed\"\n backgroundColor={theme.colors.layer.float}\n borderRadius={borderRadius}\n paddingVertical={8}\n paddingHorizontal={12}\n zIndex={overlayLayer + LAYER_OFFSET.tooltip}\n id={tooltipId}\n role=\"tooltip\"\n aria-hidden={!isVisible}\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n style={{\n ...positionStyles,\n // https://stackoverflow.com/questions/62844007/how-to-apply-tool-tip-arrow-triangle-shadow\n filter:\n \"drop-shadow(0 6px 10px rgba(7, 7, 8, 0.1)) drop-shadow(0 2px 3px rgba(7, 7, 8, 0.2))\",\n WebkitFilter:\n \"drop-shadow(0 6px 10px rgba(7, 7, 8, 0.1)) drop-shadow(0 2px 3px rgba(7, 7, 8, 0.2))\",\n opacity: isVisible ? 1 : 0,\n visibility: isVisible ? \"visible\" : \"hidden\",\n transition:\n \"opacity 150ms cubic-bezier(.4,0,.2,1), transform 150ms cubic-bezier(.4,0,.2,1), visibility 150ms cubic-bezier(.4,0,.2,1)\",\n pointerEvents: isVisible ? \"auto\" : \"none\",\n whiteSpace: \"normal\",\n width: \"max-content\",\n maxWidth: maxWidth ?? \"none\",\n overflow: \"visible\",\n willChange: isVisible ? \"transform, opacity\" : \"auto\", // optimize rendering and ensure more stable positioning\n ...style,\n }}\n >\n <Box\n position=\"absolute\"\n backgroundColor={theme.colors.layer.float}\n style={{\n ...arrowStyles,\n backfaceVisibility: \"hidden\",\n WebkitBackfaceVisibility: \"hidden\",\n }}\n />\n <Box\n style={{\n wordWrap: \"break-word\",\n overflowWrap: \"break-word\",\n maxWidth: \"100%\",\n whiteSpace: \"normal\",\n }}\n >\n {typeof content === \"string\" || typeof content === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={typoStyles.fontSize}\n fontWeight=\"400\"\n style={{\n lineHeight: typoStyles.lineHeight,\n whiteSpace: \"pre-line\",\n }}\n >\n {content}\n </Text>\n ) : (\n content\n )}\n </Box>\n </Box>\n </Portal>\n )}\n </Box>\n );\n }\n);\n\nTooltip.displayName = \"Tooltip\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n AccessibilityRole,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleToAccessibilityRole: Record<string, AccessibilityRole> = {\n button: \"button\",\n link: \"link\",\n img: \"image\",\n image: \"image\",\n summary: \"summary\",\n switch: \"switch\",\n checkbox: \"checkbox\",\n radio: \"radio\",\n heading: \"header\",\n text: \"text\",\n search: \"search\",\n alert: \"alert\",\n none: \"none\",\n presentation: \"none\",\n progressbar: \"progressbar\",\n scrollbar: \"scrollbar\",\n adjustable: \"adjustable\",\n tab: \"tab\",\n menu: \"menu\",\n menuitem: \"menuitem\",\n list: \"list\",\n timer: \"timer\",\n};\n\n/** RN ViewStyle.gap is typed as number (Yoga gap), not DimensionValue. */\nconst toGapValue = (gap: number | string | undefined): number | undefined => {\n if (gap === undefined) return undefined;\n if (typeof gap === \"number\") return gap;\n const pxMatch = /^(\\d+(?:\\.\\d+)?)px$/.exec(gap);\n if (pxMatch) return Number(pxMatch[1]);\n const asNumber = Number(gap);\n return Number.isFinite(asNumber) ? asNumber : undefined;\n};\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n flexShrink,\n gap,\n overflow,\n opacity,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n disabled,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n opacity: opacity ?? (disabled ? 0.5 : undefined),\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n flexShrink,\n gap: toGapValue(gap),\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Map web a11y props; drop the rest of the web-only attributes before\n // spreading onto RN hosts (unknown props warn at runtime).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n className,\n \"data-testid\": _dataTestId,\n cursor: _cursor,\n type: _type,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n const accessibilityRole =\n (typeof role === \"string\" && roleToAccessibilityRole[role]) ||\n (as === \"button\" ? \"button\" : undefined);\n const isDisabled = Boolean(disabled || ariaDisabled);\n const accessibilityState = {\n disabled: isDisabled || undefined,\n busy: Boolean(ariaBusy) || undefined,\n };\n const accessibilityLiveRegion =\n ariaLive === \"polite\" || ariaLive === \"assertive\" ? ariaLive : undefined;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : alt}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n // Prefer Pressable whenever the node is interactive or explicitly a button,\n // so disabled / aria-disabled controls stay in the a11y tree as buttons.\n if (onPress || as === \"button\") {\n return (\n <Pressable\n onPress={!isDisabled && onPress ? onPress : undefined}\n disabled={isDisabled}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={\n typeof ariaLabel === \"string\" ? ariaLabel : undefined\n }\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : undefined}\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={dataTestId || testID || id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n","import { ReactNode } from \"react\";\n\ninterface PortalProps {\n children: ReactNode;\n}\n\n// Portal not supported on React Native - tooltip content renders inline\nexport const Portal = ({ children }: PortalProps) => {\n return <>{children}</>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAwE;;;ACCxE,0BASO;AAwMD;AArMN,IAAM,0BAA6D;AAAA,EACjE,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,cAAc;AAAA,E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AAA,gBACA;AAAA,kBAAC;AAAA;AAAA,oBACC,OAAO;AAAA,sBACL,UAAU;AAAA,sBACV,cAAc;AAAA,sBACd,UAAU;AAAA,sBACV,YAAY;AAAA,oBACd;AAAA,oBAEC,iBAAO,YAAY,YAAY,OAAO,YAAY,WACjD;AAAA,sBAAC;AAAA;AAAA,wBACC,OAAO,MAAM,OAAO,QAAQ;AAAA,wBAC5B,UAAU,WAAW;AAAA,wBACrB,YAAW;AAAA,wBACX,OAAO;AAAA,0BACL,YAAY,WAAW;AAAA,0BACvB,YAAY;AAAA,wBACd;AAAA,wBAEC;AAAA;AAAA,oBACH,IAEA;AAAA;AAAA,gBAEJ;AAAA;AAAA;AAAA,UACF,GACF;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;","names":["import_react_native","import_jsx_runtime","RNText","import_jsx_runtime","import_jsx_runtime"]}
package/native/index.mjs CHANGED
@@ -656,7 +656,10 @@ var Tooltip = forwardRef(
656
656
  color: theme.colors.content.primary,
657
657
  fontSize: typoStyles.fontSize,
658
658
  fontWeight: "400",
659
- style: { lineHeight: typoStyles.lineHeight },
659
+ style: {
660
+ lineHeight: typoStyles.lineHeight,
661
+ whiteSpace: "pre-line"
662
+ },
660
663
  children: content
661
664
  }
662
665
  ) : content
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Tooltip.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/Text.tsx","../../src/Portal.native.tsx"],"sourcesContent":["import React, { forwardRef, useState, useMemo, useEffect, useRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text } from \"@xsolla/xui-primitives\";\nimport {\n useResolvedTheme,\n useId,\n isNative,\n useModalId,\n useOverlayLayer,\n LAYER_OFFSET,\n type ThemeOverrideProps,\n} from \"@xsolla/xui-core\";\nimport type { TooltipPlacement, TooltipProps, TooltipSize } from \"./types\";\nimport { Portal } from \"./Portal\";\n\nconst TOOLTIP_OPEN_EVENT = \"xui-tooltip-open\";\ntype TooltipTheme = {\n colors: {\n layer: {\n float: string;\n };\n content: {\n primary: string;\n };\n };\n shape: {\n tooltip: Record<TooltipSize, { borderRadius: number | string }>;\n };\n};\n\nconst ARROW_SIZE = 10;\nconst ARROW_HALF = ARROW_SIZE / 2;\n// Keeps the arrow clear of the panel's corner radius (8px for `md`).\nconst ARROW_EDGE_OFFSET = 12;\nconst ARROW_CENTER_INSET = ARROW_EDGE_OFFSET + ARROW_HALF;\n\n// Re-centres the arrow on triggers too narrow for the flush inset (FEP-889).\nconst getArrowAlignmentShift = (triggerWidth: number) =>\n Math.max(0, ARROW_CENTER_INSET - triggerWidth / 2);\n\nconst getPositionStyles = (\n triggerRect: DOMRect,\n placement: TooltipPlacement,\n offset: number,\n isVisible: boolean\n) => {\n const slideDistance = 8;\n const scale = isVisible ? \"scale(1)\" : \"scale(0.95)\";\n const slideOffset = isVisible ? 0 : -slideDistance;\n const arrowShift = getArrowAlignmentShift(triggerRect.width);\n\n switch (placement) {\n case \"top\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left + triggerRect.width / 2,\n transform: `translateX(-50%) translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"top-left\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.right + arrowShift,\n transform: `translateX(-100%) translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"top-right\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left - arrowShift,\n transform: `translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"bottom\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.left + triggerRect.width / 2,\n transform: `translateX(-50%) translateY(${slideOffset}px) ${scale}`,\n };\n case \"bottom-left\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.right + arrowShift,\n transform: `translateX(-100%) translateY(${slideOffset}px) ${scale}`,\n };\n case \"bottom-right\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.left - arrowShift,\n transform: `translateY(${slideOffset}px) ${scale}`,\n };\n case \"left\":\n return {\n top: triggerRect.top + triggerRect.height / 2,\n left: triggerRect.left - offset,\n transform: `translateX(calc(-100% - ${slideOffset}px)) translateY(-50%) ${scale}`,\n };\n case \"right\":\n return {\n top: triggerRect.top + triggerRect.height / 2,\n left: triggerRect.right + offset,\n transform: `translateX(${slideOffset}px) translateY(-50%) ${scale}`,\n };\n default:\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left,\n transform: `translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n }\n};\n\nconst getTypoStyles = (size: TooltipSize) => {\n switch (size) {\n case \"sm\":\n return { fontSize: 14, lineHeight: \"16px\" };\n case \"md\":\n return { fontSize: 16, lineHeight: \"18px\" };\n case \"lg\":\n return { fontSize: 18, lineHeight: \"20px\" };\n case \"xl\":\n return { fontSize: 20, lineHeight: \"22px\" };\n default:\n return { fontSize: 16, lineHeight: \"18px\" };\n }\n};\n\nconst getArrowStyles = (placement: TooltipPlacement) => {\n const base: React.CSSProperties = {\n width: ARROW_SIZE,\n height: ARROW_SIZE,\n transform: \"rotate(45deg)\",\n borderRadius: 1,\n };\n\n const placementStyles: Record<TooltipPlacement, React.CSSProperties> = {\n top: { bottom: -ARROW_HALF, left: \"50%\", marginLeft: -ARROW_HALF },\n \"top-left\": { bottom: -ARROW_HALF, right: ARROW_EDGE_OFFSET },\n \"top-right\": { bottom: -ARROW_HALF, left: ARROW_EDGE_OFFSET },\n\n bottom: { top: -ARROW_HALF, left: \"50%\", marginLeft: -ARROW_HALF },\n \"bottom-left\": { top: -ARROW_HALF, right: ARROW_EDGE_OFFSET },\n \"bottom-right\": { top: -ARROW_HALF, left: ARROW_EDGE_OFFSET },\n\n left: { right: -ARROW_HALF, top: \"50%\", marginTop: -ARROW_HALF },\n right: { left: -ARROW_HALF, top: \"50%\", marginTop: -ARROW_HALF },\n };\n\n return { ...base, ...placementStyles[placement] };\n};\n\nexport const Tooltip = forwardRef<\n HTMLDivElement,\n TooltipProps & ThemeOverrideProps\n>(\n (\n {\n content,\n children,\n size = \"md\",\n delayEnter = 0,\n delayLeave = 100,\n offset = 12,\n placement = \"top\",\n maxWidth,\n controlledVisible,\n style,\n \"data-testid\": dataTestId,\n className,\n testID,\n themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const [isHovered, setIsHovered] = useState(false);\n const [triggerRect, setTriggerRect] = useState<DOMRect | null>(null);\n const { theme: resolvedTheme } = useResolvedTheme({\n themeMode,\n themeProductContext,\n });\n const theme = resolvedTheme as TooltipTheme;\n const enterTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const leaveTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const rafRef = useRef<number | null>(null);\n const triggerRef = useRef<HTMLDivElement>(null);\n const tooltipId = useId();\n const modalId = useModalId();\n const overlayLayer = useOverlayLayer();\n\n const isVisible =\n controlledVisible !== undefined ? controlledVisible : isHovered;\n\n const clearPendingVisibilityUpdates = () => {\n if (enterTimeoutRef.current) {\n clearTimeout(enterTimeoutRef.current);\n enterTimeoutRef.current = null;\n }\n\n if (leaveTimeoutRef.current) {\n clearTimeout(leaveTimeoutRef.current);\n leaveTimeoutRef.current = null;\n }\n\n if (rafRef.current) {\n cancelAnimationFrame(rafRef.current);\n rafRef.current = null;\n }\n };\n\n const forceHideTooltip = () => {\n clearPendingVisibilityUpdates();\n setIsHovered(false);\n };\n\n const positionStyles = useMemo(\n () =>\n triggerRect\n ? getPositionStyles(triggerRect, placement, offset, isVisible)\n : { top: 0, left: 0 },\n [triggerRect, placement, offset, isVisible]\n );\n const typoStyles = useMemo(() => getTypoStyles(size), [size]);\n const borderRadius = (theme.shape.tooltip[size] ?? theme.shape.tooltip.md)\n .borderRadius;\n const arrowStyles = useMemo(() => getArrowStyles(placement), [placement]);\n\n // Update trigger position when tooltip becomes visible and on scroll/resize\n useEffect(() => {\n if (!isVisible || isNative) return;\n\n const updatePosition = () => {\n if (triggerRef.current) {\n setTriggerRect(triggerRef.current.getBoundingClientRect());\n }\n };\n\n updatePosition();\n\n window.addEventListener(\"scroll\", updatePosition, true);\n window.addEventListener(\"resize\", updatePosition);\n\n return () => {\n window.removeEventListener(\"scroll\", updatePosition, true);\n window.removeEventListener(\"resize\", updatePosition);\n };\n }, [isVisible]);\n\n const showTooltip = () => {\n clearPendingVisibilityUpdates();\n\n if (!isNative && typeof document !== \"undefined\") {\n document.dispatchEvent(\n new CustomEvent(TOOLTIP_OPEN_EVENT, { detail: { tooltipId } })\n );\n }\n\n // Update position before showing to prevent pop-in\n if (triggerRef.current) {\n setTriggerRect(triggerRef.current.getBoundingClientRect());\n\n // Double RAF to ensure position is rendered before showing tooltip\n rafRef.current = requestAnimationFrame(() => {\n rafRef.current = requestAnimationFrame(() => {\n if (delayEnter > 0) {\n enterTimeoutRef.current = setTimeout(() => {\n setIsHovered(true);\n }, delayEnter);\n } else {\n setIsHovered(true);\n }\n });\n });\n }\n };\n\n const showTooltipOnFocus = (event: React.FocusEvent<HTMLElement>) => {\n // Only reveal the tooltip on intentional keyboard focus. Focus that the\n // browser restores to the trigger when the tab/window regains focus — as\n // well as focus from a mouse click — must not re-trigger the tooltip\n // (FEP-832). `:focus-visible` encodes exactly this heuristic: it matches\n // for keyboard navigation but not for pointer-driven or restored focus.\n const target = event.target as HTMLElement | null;\n\n if (target && typeof target.matches === \"function\") {\n let isFocusVisible: boolean;\n try {\n isFocusVisible = target.matches(\":focus-visible\");\n } catch {\n // Legacy browsers without :focus-visible support — preserve the\n // previous behaviour of showing on any focus.\n isFocusVisible = true;\n }\n\n if (!isFocusVisible) return;\n }\n\n showTooltip();\n };\n\n const hideTooltip = () => {\n clearPendingVisibilityUpdates();\n\n if (delayLeave > 0) {\n leaveTimeoutRef.current = setTimeout(() => {\n setIsHovered(false);\n }, delayLeave);\n } else {\n setIsHovered(false);\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\" && isVisible) {\n forceHideTooltip();\n }\n };\n\n const handleVisibilityChange = () => {\n if (document.visibilityState === \"hidden\") {\n forceHideTooltip();\n }\n };\n\n const handleTooltipOpen = (event: Event) => {\n const { tooltipId: activeTooltipId } =\n (event as CustomEvent).detail ?? {};\n\n if (activeTooltipId !== tooltipId) {\n forceHideTooltip();\n }\n };\n\n document.addEventListener(\"keydown\", handleEscape);\n document.addEventListener(\"visibilitychange\", handleVisibilityChange);\n document.addEventListener(TOOLTIP_OPEN_EVENT, handleTooltipOpen);\n\n return () => {\n document.removeEventListener(\"keydown\", handleEscape);\n document.removeEventListener(\n \"visibilitychange\",\n handleVisibilityChange\n );\n document.removeEventListener(TOOLTIP_OPEN_EVENT, handleTooltipOpen);\n clearPendingVisibilityUpdates();\n };\n }, [isVisible, tooltipId]);\n\n return (\n <Box\n testID={testID}\n ref={triggerRef}\n position=\"relative\"\n display=\"inline-flex\"\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n onFocus={showTooltipOnFocus}\n onBlur={hideTooltip}\n className={className}\n style={{ height: \"fit-content\" }}\n aria-describedby={isVisible ? tooltipId : undefined}\n >\n {children}\n {!isNative && triggerRect && (\n <Portal>\n <Box\n ref={ref}\n data-testid={dataTestId}\n data-modal-id={modalId}\n position=\"fixed\"\n backgroundColor={theme.colors.layer.float}\n borderRadius={borderRadius}\n paddingVertical={8}\n paddingHorizontal={12}\n zIndex={overlayLayer + LAYER_OFFSET.tooltip}\n id={tooltipId}\n role=\"tooltip\"\n aria-hidden={!isVisible}\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n style={{\n ...positionStyles,\n // https://stackoverflow.com/questions/62844007/how-to-apply-tool-tip-arrow-triangle-shadow\n filter:\n \"drop-shadow(0 6px 10px rgba(7, 7, 8, 0.1)) drop-shadow(0 2px 3px rgba(7, 7, 8, 0.2))\",\n WebkitFilter:\n \"drop-shadow(0 6px 10px rgba(7, 7, 8, 0.1)) drop-shadow(0 2px 3px rgba(7, 7, 8, 0.2))\",\n opacity: isVisible ? 1 : 0,\n visibility: isVisible ? \"visible\" : \"hidden\",\n transition:\n \"opacity 150ms cubic-bezier(.4,0,.2,1), transform 150ms cubic-bezier(.4,0,.2,1), visibility 150ms cubic-bezier(.4,0,.2,1)\",\n pointerEvents: isVisible ? \"auto\" : \"none\",\n whiteSpace: \"normal\",\n width: \"max-content\",\n maxWidth: maxWidth ?? \"none\",\n overflow: \"visible\",\n willChange: isVisible ? \"transform, opacity\" : \"auto\", // optimize rendering and ensure more stable positioning\n ...style,\n }}\n >\n <Box\n position=\"absolute\"\n backgroundColor={theme.colors.layer.float}\n style={{\n ...arrowStyles,\n backfaceVisibility: \"hidden\",\n WebkitBackfaceVisibility: \"hidden\",\n }}\n />\n <Box\n style={{\n wordWrap: \"break-word\",\n overflowWrap: \"break-word\",\n maxWidth: \"100%\",\n whiteSpace: \"normal\",\n }}\n >\n {typeof content === \"string\" || typeof content === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={typoStyles.fontSize}\n fontWeight=\"400\"\n style={{ lineHeight: typoStyles.lineHeight }}\n >\n {content}\n </Text>\n ) : (\n content\n )}\n </Box>\n </Box>\n </Portal>\n )}\n </Box>\n );\n }\n);\n\nTooltip.displayName = \"Tooltip\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n AccessibilityRole,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleToAccessibilityRole: Record<string, AccessibilityRole> = {\n button: \"button\",\n link: \"link\",\n img: \"image\",\n image: \"image\",\n summary: \"summary\",\n switch: \"switch\",\n checkbox: \"checkbox\",\n radio: \"radio\",\n heading: \"header\",\n text: \"text\",\n search: \"search\",\n alert: \"alert\",\n none: \"none\",\n presentation: \"none\",\n progressbar: \"progressbar\",\n scrollbar: \"scrollbar\",\n adjustable: \"adjustable\",\n tab: \"tab\",\n menu: \"menu\",\n menuitem: \"menuitem\",\n list: \"list\",\n timer: \"timer\",\n};\n\n/** RN ViewStyle.gap is typed as number (Yoga gap), not DimensionValue. */\nconst toGapValue = (gap: number | string | undefined): number | undefined => {\n if (gap === undefined) return undefined;\n if (typeof gap === \"number\") return gap;\n const pxMatch = /^(\\d+(?:\\.\\d+)?)px$/.exec(gap);\n if (pxMatch) return Number(pxMatch[1]);\n const asNumber = Number(gap);\n return Number.isFinite(asNumber) ? asNumber : undefined;\n};\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n flexShrink,\n gap,\n overflow,\n opacity,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n disabled,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n opacity: opacity ?? (disabled ? 0.5 : undefined),\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n flexShrink,\n gap: toGapValue(gap),\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Map web a11y props; drop the rest of the web-only attributes before\n // spreading onto RN hosts (unknown props warn at runtime).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n className,\n \"data-testid\": _dataTestId,\n cursor: _cursor,\n type: _type,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n const accessibilityRole =\n (typeof role === \"string\" && roleToAccessibilityRole[role]) ||\n (as === \"button\" ? \"button\" : undefined);\n const isDisabled = Boolean(disabled || ariaDisabled);\n const accessibilityState = {\n disabled: isDisabled || undefined,\n busy: Boolean(ariaBusy) || undefined,\n };\n const accessibilityLiveRegion =\n ariaLive === \"polite\" || ariaLive === \"assertive\" ? ariaLive : undefined;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : alt}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n // Prefer Pressable whenever the node is interactive or explicitly a button,\n // so disabled / aria-disabled controls stay in the a11y tree as buttons.\n if (onPress || as === \"button\") {\n return (\n <Pressable\n onPress={!isDisabled && onPress ? onPress : undefined}\n disabled={isDisabled}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={\n typeof ariaLabel === \"string\" ? ariaLabel : undefined\n }\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : undefined}\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={dataTestId || testID || id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n","import { ReactNode } from \"react\";\n\ninterface PortalProps {\n children: ReactNode;\n}\n\n// Portal not supported on React Native - tooltip content renders inline\nexport const Portal = ({ children }: PortalProps) => {\n return <>{children}</>;\n};\n"],"mappings":";AAAA,SAAg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S,YAAY,IAAI;AAAA,gBACzB,YAAY,YAAY,YAAY;AAAA,gBACpC,YACE;AAAA,gBACF,eAAe,YAAY,SAAS;AAAA,gBACpC,YAAY;AAAA,gBACZ,OAAO;AAAA,gBACP,UAAU,YAAY;AAAA,gBACtB,UAAU;AAAA,gBACV,YAAY,YAAY,uBAAuB;AAAA;AAAA,gBAC/C,GAAG;AAAA,cACL;AAAA,cAEA;AAAA,gCAAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,UAAS;AAAA,oBACT,iBAAiB,MAAM,OAAO,MAAM;AAAA,oBACpC,OAAO;AAAA,sBACL,GAAG;AAAA,sBACH,oBAAoB;AAAA,sBACpB,0BAA0B;AAAA,oBAC5B;AAAA;AAAA,gBACF;AAAA,gBACA,gBAAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,OAAO;AAAA,sBACL,UAAU;AAAA,sBACV,cAAc;AAAA,sBACd,UAAU;AAAA,sBACV,YAAY;AAAA,oBACd;AAAA,oBAEC,iBAAO,YAAY,YAAY,OAAO,YAAY,WACjD,gBAAAA;AAAA,sBAAC;AAAA;AAAA,wBACC,OAAO,MAAM,OAAO,QAAQ;AAAA,wBAC5B,UAAU,WAAW;AAAA,wBACrB,YAAW;AAAA,wBACX,OAAO,EAAE,YAAY,WAAW,WAAW;AAAA,wBAE1C;AAAA;AAAA,oBACH,IAEA;AAAA;AAAA,gBAEJ;AAAA;AAAA;AAAA,UACF,GACF;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;","names":["jsx","jsx","jsx"]}
1
+ {"version":3,"sources":["../../src/Tooltip.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/Text.tsx","../../src/Portal.native.tsx"],"sourcesContent":["import React, { forwardRef, useState, useMemo, useEffect, useRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text } from \"@xsolla/xui-primitives\";\nimport {\n useResolvedTheme,\n useId,\n isNative,\n useModalId,\n useOverlayLayer,\n LAYER_OFFSET,\n type ThemeOverrideProps,\n} from \"@xsolla/xui-core\";\nimport type { TooltipPlacement, TooltipProps, TooltipSize } from \"./types\";\nimport { Portal } from \"./Portal\";\n\nconst TOOLTIP_OPEN_EVENT = \"xui-tooltip-open\";\ntype TooltipTheme = {\n colors: {\n layer: {\n float: string;\n };\n content: {\n primary: string;\n };\n };\n shape: {\n tooltip: Record<TooltipSize, { borderRadius: number | string }>;\n };\n};\n\nconst ARROW_SIZE = 10;\nconst ARROW_HALF = ARROW_SIZE / 2;\n// Keeps the arrow clear of the panel's corner radius (8px for `md`).\nconst ARROW_EDGE_OFFSET = 12;\nconst ARROW_CENTER_INSET = ARROW_EDGE_OFFSET + ARROW_HALF;\n\n// Re-centres the arrow on triggers too narrow for the flush inset (FEP-889).\nconst getArrowAlignmentShift = (triggerWidth: number) =>\n Math.max(0, ARROW_CENTER_INSET - triggerWidth / 2);\n\nconst getPositionStyles = (\n triggerRect: DOMRect,\n placement: TooltipPlacement,\n offset: number,\n isVisible: boolean\n) => {\n const slideDistance = 8;\n const scale = isVisible ? \"scale(1)\" : \"scale(0.95)\";\n const slideOffset = isVisible ? 0 : -slideDistance;\n const arrowShift = getArrowAlignmentShift(triggerRect.width);\n\n switch (placement) {\n case \"top\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left + triggerRect.width / 2,\n transform: `translateX(-50%) translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"top-left\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.right + arrowShift,\n transform: `translateX(-100%) translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"top-right\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left - arrowShift,\n transform: `translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"bottom\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.left + triggerRect.width / 2,\n transform: `translateX(-50%) translateY(${slideOffset}px) ${scale}`,\n };\n case \"bottom-left\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.right + arrowShift,\n transform: `translateX(-100%) translateY(${slideOffset}px) ${scale}`,\n };\n case \"bottom-right\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.left - arrowShift,\n transform: `translateY(${slideOffset}px) ${scale}`,\n };\n case \"left\":\n return {\n top: triggerRect.top + triggerRect.height / 2,\n left: triggerRect.left - offset,\n transform: `translateX(calc(-100% - ${slideOffset}px)) translateY(-50%) ${scale}`,\n };\n case \"right\":\n return {\n top: triggerRect.top + triggerRect.height / 2,\n left: triggerRect.right + offset,\n transform: `translateX(${slideOffset}px) translateY(-50%) ${scale}`,\n };\n default:\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left,\n transform: `translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n }\n};\n\nconst getTypoStyles = (size: TooltipSize) => {\n switch (size) {\n case \"sm\":\n return { fontSize: 14, lineHeight: \"16px\" };\n case \"md\":\n return { fontSize: 16, lineHeight: \"18px\" };\n case \"lg\":\n return { fontSize: 18, lineHeight: \"20px\" };\n case \"xl\":\n return { fontSize: 20, lineHeight: \"22px\" };\n default:\n return { fontSize: 16, lineHeight: \"18px\" };\n }\n};\n\nconst getArrowStyles = (placement: TooltipPlacement) => {\n const base: React.CSSProperties = {\n width: ARROW_SIZE,\n height: ARROW_SIZE,\n transform: \"rotate(45deg)\",\n borderRadius: 1,\n };\n\n const placementStyles: Record<TooltipPlacement, React.CSSProperties> = {\n top: { bottom: -ARROW_HALF, left: \"50%\", marginLeft: -ARROW_HALF },\n \"top-left\": { bottom: -ARROW_HALF, right: ARROW_EDGE_OFFSET },\n \"top-right\": { bottom: -ARROW_HALF, left: ARROW_EDGE_OFFSET },\n\n bottom: { top: -ARROW_HALF, left: \"50%\", marginLeft: -ARROW_HALF },\n \"bottom-left\": { top: -ARROW_HALF, right: ARROW_EDGE_OFFSET },\n \"bottom-right\": { top: -ARROW_HALF, left: ARROW_EDGE_OFFSET },\n\n left: { right: -ARROW_HALF, top: \"50%\", marginTop: -ARROW_HALF },\n right: { left: -ARROW_HALF, top: \"50%\", marginTop: -ARROW_HALF },\n };\n\n return { ...base, ...placementStyles[placement] };\n};\n\nexport const Tooltip = forwardRef<\n HTMLDivElement,\n TooltipProps & ThemeOverrideProps\n>(\n (\n {\n content,\n children,\n size = \"md\",\n delayEnter = 0,\n delayLeave = 100,\n offset = 12,\n placement = \"top\",\n maxWidth,\n controlledVisible,\n style,\n \"data-testid\": dataTestId,\n className,\n testID,\n themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const [isHovered, setIsHovered] = useState(false);\n const [triggerRect, setTriggerRect] = useState<DOMRect | null>(null);\n const { theme: resolvedTheme } = useResolvedTheme({\n themeMode,\n themeProductContext,\n });\n const theme = resolvedTheme as TooltipTheme;\n const enterTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const leaveTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const rafRef = useRef<number | null>(null);\n const triggerRef = useRef<HTMLDivElement>(null);\n const tooltipId = useId();\n const modalId = useModalId();\n const overlayLayer = useOverlayLayer();\n\n const isVisible =\n controlledVisible !== undefined ? controlledVisible : isHovered;\n\n const clearPendingVisibilityUpdates = () => {\n if (enterTimeoutRef.current) {\n clearTimeout(enterTimeoutRef.current);\n enterTimeoutRef.current = null;\n }\n\n if (leaveTimeoutRef.current) {\n clearTimeout(leaveTimeoutRef.current);\n leaveTimeoutRef.current = null;\n }\n\n if (rafRef.current) {\n cancelAnimationFrame(rafRef.current);\n rafRef.current = null;\n }\n };\n\n const forceHideTooltip = () => {\n clearPendingVisibilityUpdates();\n setIsHovered(false);\n };\n\n const positionStyles = useMemo(\n () =>\n triggerRect\n ? getPositionStyles(triggerRect, placement, offset, isVisible)\n : { top: 0, left: 0 },\n [triggerRect, placement, offset, isVisible]\n );\n const typoStyles = useMemo(() => getTypoStyles(size), [size]);\n const borderRadius = (theme.shape.tooltip[size] ?? theme.shape.tooltip.md)\n .borderRadius;\n const arrowStyles = useMemo(() => getArrowStyles(placement), [placement]);\n\n // Update trigger position when tooltip becomes visible and on scroll/resize\n useEffect(() => {\n if (!isVisible || isNative) return;\n\n const updatePosition = () => {\n if (triggerRef.current) {\n setTriggerRect(triggerRef.current.getBoundingClientRect());\n }\n };\n\n updatePosition();\n\n window.addEventListener(\"scroll\", updatePosition, true);\n window.addEventListener(\"resize\", updatePosition);\n\n return () => {\n window.removeEventListener(\"scroll\", updatePosition, true);\n window.removeEventListener(\"resize\", updatePosition);\n };\n }, [isVisible]);\n\n const showTooltip = () => {\n clearPendingVisibilityUpdates();\n\n if (!isNative && typeof document !== \"undefined\") {\n document.dispatchEvent(\n new CustomEvent(TOOLTIP_OPEN_EVENT, { detail: { tooltipId } })\n );\n }\n\n // Update position before showing to prevent pop-in\n if (triggerRef.current) {\n setTriggerRect(triggerRef.current.getBoundingClientRect());\n\n // Double RAF to ensure position is rendered before showing tooltip\n rafRef.current = requestAnimationFrame(() => {\n rafRef.current = requestAnimationFrame(() => {\n if (delayEnter > 0) {\n enterTimeoutRef.current = setTimeout(() => {\n setIsHovered(true);\n }, delayEnter);\n } else {\n setIsHovered(true);\n }\n });\n });\n }\n };\n\n const showTooltipOnFocus = (event: React.FocusEvent<HTMLElement>) => {\n // Only reveal the tooltip on intentional keyboard focus. Focus that the\n // browser restores to the trigger when the tab/window regains focus — as\n // well as focus from a mouse click — must not re-trigger the tooltip\n // (FEP-832). `:focus-visible` encodes exactly this heuristic: it matches\n // for keyboard navigation but not for pointer-driven or restored focus.\n const target = event.target as HTMLElement | null;\n\n if (target && typeof target.matches === \"function\") {\n let isFocusVisible: boolean;\n try {\n isFocusVisible = target.matches(\":focus-visible\");\n } catch {\n // Legacy browsers without :focus-visible support — preserve the\n // previous behaviour of showing on any focus.\n isFocusVisible = true;\n }\n\n if (!isFocusVisible) return;\n }\n\n showTooltip();\n };\n\n const hideTooltip = () => {\n clearPendingVisibilityUpdates();\n\n if (delayLeave > 0) {\n leaveTimeoutRef.current = setTimeout(() => {\n setIsHovered(false);\n }, delayLeave);\n } else {\n setIsHovered(false);\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\" && isVisible) {\n forceHideTooltip();\n }\n };\n\n const handleVisibilityChange = () => {\n if (document.visibilityState === \"hidden\") {\n forceHideTooltip();\n }\n };\n\n const handleTooltipOpen = (event: Event) => {\n const { tooltipId: activeTooltipId } =\n (event as CustomEvent).detail ?? {};\n\n if (activeTooltipId !== tooltipId) {\n forceHideTooltip();\n }\n };\n\n document.addEventListener(\"keydown\", handleEscape);\n document.addEventListener(\"visibilitychange\", handleVisibilityChange);\n document.addEventListener(TOOLTIP_OPEN_EVENT, handleTooltipOpen);\n\n return () => {\n document.removeEventListener(\"keydown\", handleEscape);\n document.removeEventListener(\n \"visibilitychange\",\n handleVisibilityChange\n );\n document.removeEventListener(TOOLTIP_OPEN_EVENT, handleTooltipOpen);\n clearPendingVisibilityUpdates();\n };\n }, [isVisible, tooltipId]);\n\n return (\n <Box\n testID={testID}\n ref={triggerRef}\n position=\"relative\"\n display=\"inline-flex\"\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n onFocus={showTooltipOnFocus}\n onBlur={hideTooltip}\n className={className}\n style={{ height: \"fit-content\" }}\n aria-describedby={isVisible ? tooltipId : undefined}\n >\n {children}\n {!isNative && triggerRect && (\n <Portal>\n <Box\n ref={ref}\n data-testid={dataTestId}\n data-modal-id={modalId}\n position=\"fixed\"\n backgroundColor={theme.colors.layer.float}\n borderRadius={borderRadius}\n paddingVertical={8}\n paddingHorizontal={12}\n zIndex={overlayLayer + LAYER_OFFSET.tooltip}\n id={tooltipId}\n role=\"tooltip\"\n aria-hidden={!isVisible}\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n style={{\n ...positionStyles,\n // https://stackoverflow.com/questions/62844007/how-to-apply-tool-tip-arrow-triangle-shadow\n filter:\n \"drop-shadow(0 6px 10px rgba(7, 7, 8, 0.1)) drop-shadow(0 2px 3px rgba(7, 7, 8, 0.2))\",\n WebkitFilter:\n \"drop-shadow(0 6px 10px rgba(7, 7, 8, 0.1)) drop-shadow(0 2px 3px rgba(7, 7, 8, 0.2))\",\n opacity: isVisible ? 1 : 0,\n visibility: isVisible ? \"visible\" : \"hidden\",\n transition:\n \"opacity 150ms cubic-bezier(.4,0,.2,1), transform 150ms cubic-bezier(.4,0,.2,1), visibility 150ms cubic-bezier(.4,0,.2,1)\",\n pointerEvents: isVisible ? \"auto\" : \"none\",\n whiteSpace: \"normal\",\n width: \"max-content\",\n maxWidth: maxWidth ?? \"none\",\n overflow: \"visible\",\n willChange: isVisible ? \"transform, opacity\" : \"auto\", // optimize rendering and ensure more stable positioning\n ...style,\n }}\n >\n <Box\n position=\"absolute\"\n backgroundColor={theme.colors.layer.float}\n style={{\n ...arrowStyles,\n backfaceVisibility: \"hidden\",\n WebkitBackfaceVisibility: \"hidden\",\n }}\n />\n <Box\n style={{\n wordWrap: \"break-word\",\n overflowWrap: \"break-word\",\n maxWidth: \"100%\",\n whiteSpace: \"normal\",\n }}\n >\n {typeof content === \"string\" || typeof content === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={typoStyles.fontSize}\n fontWeight=\"400\"\n style={{\n lineHeight: typoStyles.lineHeight,\n whiteSpace: \"pre-line\",\n }}\n >\n {content}\n </Text>\n ) : (\n content\n )}\n </Box>\n </Box>\n </Portal>\n )}\n </Box>\n );\n }\n);\n\nTooltip.displayName = \"Tooltip\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n AccessibilityRole,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleToAccessibilityRole: Record<string, AccessibilityRole> = {\n button: \"button\",\n link: \"link\",\n img: \"image\",\n image: \"image\",\n summary: \"summary\",\n switch: \"switch\",\n checkbox: \"checkbox\",\n radio: \"radio\",\n heading: \"header\",\n text: \"text\",\n search: \"search\",\n alert: \"alert\",\n none: \"none\",\n presentation: \"none\",\n progressbar: \"progressbar\",\n scrollbar: \"scrollbar\",\n adjustable: \"adjustable\",\n tab: \"tab\",\n menu: \"menu\",\n menuitem: \"menuitem\",\n list: \"list\",\n timer: \"timer\",\n};\n\n/** RN ViewStyle.gap is typed as number (Yoga gap), not DimensionValue. */\nconst toGapValue = (gap: number | string | undefined): number | undefined => {\n if (gap === undefined) return undefined;\n if (typeof gap === \"number\") return gap;\n const pxMatch = /^(\\d+(?:\\.\\d+)?)px$/.exec(gap);\n if (pxMatch) return Number(pxMatch[1]);\n const asNumber = Number(gap);\n return Number.isFinite(asNumber) ? asNumber : undefined;\n};\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n flexShrink,\n gap,\n overflow,\n opacity,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n disabled,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n opacity: opacity ?? (disabled ? 0.5 : undefined),\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n flexShrink,\n gap: toGapValue(gap),\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Map web a11y props; drop the rest of the web-only attributes before\n // spreading onto RN hosts (unknown props warn at runtime).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n className,\n \"data-testid\": _dataTestId,\n cursor: _cursor,\n type: _type,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n const accessibilityRole =\n (typeof role === \"string\" && roleToAccessibilityRole[role]) ||\n (as === \"button\" ? \"button\" : undefined);\n const isDisabled = Boolean(disabled || ariaDisabled);\n const accessibilityState = {\n disabled: isDisabled || undefined,\n busy: Boolean(ariaBusy) || undefined,\n };\n const accessibilityLiveRegion =\n ariaLive === \"polite\" || ariaLive === \"assertive\" ? ariaLive : undefined;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : alt}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n // Prefer Pressable whenever the node is interactive or explicitly a button,\n // so disabled / aria-disabled controls stay in the a11y tree as buttons.\n if (onPress || as === \"button\") {\n return (\n <Pressable\n onPress={!isDisabled && onPress ? onPress : undefined}\n disabled={isDisabled}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={\n typeof ariaLabel === \"string\" ? ariaLabel : undefined\n }\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : undefined}\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={dataTestId || testID || id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n","import { ReactNode } from \"react\";\n\ninterface PortalProps {\n children: ReactNode;\n}\n\n// Portal not supported on React Native - tooltip content renders inline\nexport const Portal = ({ children }: PortalProps) => {\n return <>{children}</>;\n};\n"],"mappings":";AAAA,SAAgB,YAAY,UAAU,SAAS,WAAW,cAAc;;;ACCxE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAwMD;AArMN,IAAM,0BAA6D;AAAA,EACjE,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,cAAc;AAAA,EACd,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AACT;AAGA,IAAM,aAAa,CAAC,QAAyD;AAC3E,MAAI,QAAQ,OAAW,QAAO;AAC9B,MAAI,OAAO,QAAQ,SAAU,QAAO;AACpC,QAAM,UAAU,sBAAsB,KAAK,GAAG;AAC9C,MAAI,QAAS,QAAO,OAAO,QAAQ,CAAC,CAAC;AACrC,QAAM,WAAW,OAAO,GAAG;AAC3B,SAAO,OAAO,SAAS,QAAQ,IAAI,WAAW;AAChD;AAEO,IAAM,MAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;A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name": "@xsolla/xui-tooltip",
3
- "version": "0.211.0",
3
+ "version": "0.212.0",
4
4
  "main": "./web/index.js",
5
5
  "module": "./web/index.mjs",
6
6
  "types": "./web/index.d.ts",
@@ -13,9 +13,9 @@
13
13
  "test:coverage": "vitest run --coverage"
14
14
  },
15
15
  "dependencies": {
16
- "@xsolla/xui-button": "0.211.0",
17
- "@xsolla/xui-core": "0.211.0",
18
- "@xsolla/xui-primitives-core": "0.211.0"
16
+ "@xsolla/xui-button": "0.212.0",
17
+ "@xsolla/xui-core": "0.212.0",
18
+ "@xsolla/xui-primitives-core": "0.212.0"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "react": ">=16.8.0",
package/web/index.js CHANGED
@@ -713,7 +713,10 @@ var Tooltip = (0, import_react4.forwardRef)(
713
713
  color: theme.colors.content.primary,
714
714
  fontSize: typoStyles.fontSize,
715
715
  fontWeight: "400",
716
- style: { lineHeight: typoStyles.lineHeight },
716
+ style: {
717
+ lineHeight: typoStyles.lineHeight,
718
+ whiteSpace: "pre-line"
719
+ },
717
720
  children: content
718
721
  }
719
722
  ) : content
package/web/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx","../../src/Tooltip.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../../foundation/primitives-web/src/Text.tsx","../../../../foundation/primitives-web/src/textTruncation.ts","../../src/Portal.web.tsx"],"sourcesContent":["export * from \"./Tooltip\";\nexport * from \"./types\";\n","import React, { forwardRef, useState, useMemo, useEffect, useRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text } from \"@xsolla/xui-primitives\";\nimport {\n useResolvedTheme,\n useId,\n isNative,\n useModalId,\n useOverlayLayer,\n LAYER_OFFSET,\n type ThemeOverrideProps,\n} from \"@xsolla/xui-core\";\nimport type { TooltipPlacement, TooltipProps, TooltipSize } from \"./types\";\nimport { Portal } from \"./Portal\";\n\nconst TOOLTIP_OPEN_EVENT = \"xui-tooltip-open\";\ntype TooltipTheme = {\n colors: {\n layer: {\n float: string;\n };\n content: {\n primary: string;\n };\n };\n shape: {\n tooltip: Record<TooltipSize, { borderRadius: number | string }>;\n };\n};\n\nconst ARROW_SIZE = 10;\nconst ARROW_HALF = ARROW_SIZE / 2;\n// Keeps the arrow clear of the panel's corner radius (8px for `md`).\nconst ARROW_EDGE_OFFSET = 12;\nconst ARROW_CENTER_INSET = ARROW_EDGE_OFFSET + ARROW_HALF;\n\n// Re-centres the arrow on triggers too narrow for the flush inset (FEP-889).\nconst getArrowAlignmentShift = (triggerWidth: number) =>\n Math.max(0, ARROW_CENTER_INSET - triggerWidth / 2);\n\nconst getPositionStyles = (\n triggerRect: DOMRect,\n placement: TooltipPlacement,\n offset: number,\n isVisible: boolean\n) => {\n const slideDistance = 8;\n const scale = isVisible ? \"scale(1)\" : \"scale(0.95)\";\n const slideOffset = isVisible ? 0 : -slideDistance;\n const arrowShift = getArrowAlignmentShift(triggerRect.width);\n\n switch (placement) {\n case \"top\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left + triggerRect.width / 2,\n transform: `translateX(-50%) translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"top-left\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.right + arrowShift,\n transform: `translateX(-100%) translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"top-right\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left - arrowShift,\n transform: `translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"bottom\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.left + triggerRect.width / 2,\n transform: `translateX(-50%) translateY(${slideOffset}px) ${scale}`,\n };\n case \"bottom-left\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.right + arrowShift,\n transform: `translateX(-100%) translateY(${slideOffset}px) ${scale}`,\n };\n case \"bottom-right\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.left - arrowShift,\n transform: `translateY(${slideOffset}px) ${scale}`,\n };\n case \"left\":\n return {\n top: triggerRect.top + triggerRect.height / 2,\n left: triggerRect.left - offset,\n transform: `translateX(calc(-100% - ${slideOffset}px)) translateY(-50%) ${scale}`,\n };\n case \"right\":\n return {\n top: triggerRect.top + triggerRect.height / 2,\n left: triggerRect.right + offset,\n transform: `translateX(${slideOffset}px) translateY(-50%) ${scale}`,\n };\n default:\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left,\n transform: `translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n }\n};\n\nconst getTypoStyles = (size: TooltipSize) => {\n switch (size) {\n case \"sm\":\n return { fontSize: 14, lineHeight: \"16px\" };\n case \"md\":\n return { fontSize: 16, lineHeight: \"18px\" };\n case \"lg\":\n return { fontSize: 18, lineHeight: \"20px\" };\n case \"xl\":\n return { fontSize: 20, lineHeight: \"22px\" };\n default:\n return { fontSize: 16, lineHeight: \"18px\" };\n }\n};\n\nconst getArrowStyles = (placement: TooltipPlacement) => {\n const base: React.CSSProperties = {\n width: ARROW_SIZE,\n height: ARROW_SIZE,\n transform: \"rotate(45deg)\",\n borderRadius: 1,\n };\n\n const placementStyles: Record<TooltipPlacement, React.CSSProperties> = {\n top: { bottom: -ARROW_HALF, left: \"50%\", marginLeft: -ARROW_HALF },\n \"top-left\": { bottom: -ARROW_HALF, right: ARROW_EDGE_OFFSET },\n \"top-right\": { bottom: -ARROW_HALF, left: ARROW_EDGE_OFFSET },\n\n bottom: { top: -ARROW_HALF, left: \"50%\", marginLeft: -ARROW_HALF },\n \"bottom-left\": { top: -ARROW_HALF, right: ARROW_EDGE_OFFSET },\n \"bottom-right\": { top: -ARROW_HALF, left: ARROW_EDGE_OFFSET },\n\n left: { right: -ARROW_HALF, top: \"50%\", marginTop: -ARROW_HALF },\n right: { left: -ARROW_HALF, top: \"50%\", marginTop: -ARROW_HALF },\n };\n\n return { ...base, ...placementStyles[placement] };\n};\n\nexport const Tooltip = forwardRef<\n HTMLDivElement,\n TooltipProps & ThemeOverrideProps\n>(\n (\n {\n content,\n children,\n size = \"md\",\n delayEnter = 0,\n delayLeave = 100,\n offset = 12,\n placement = \"top\",\n maxWidth,\n controlledVisible,\n style,\n \"data-testid\": dataTestId,\n className,\n testID,\n themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const [isHovered, setIsHovered] = useState(false);\n const [triggerRect, setTriggerRect] = useState<DOMRect | null>(null);\n const { theme: resolvedTheme } = useResolvedTheme({\n themeMode,\n themeProductContext,\n });\n const theme = resolvedTheme as TooltipTheme;\n const enterTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const leaveTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const rafRef = useRef<number | null>(null);\n const triggerRef = useRef<HTMLDivElement>(null);\n const tooltipId = useId();\n const modalId = useModalId();\n const overlayLayer = useOverlayLayer();\n\n const isVisible =\n controlledVisible !== undefined ? controlledVisible : isHovered;\n\n const clearPendingVisibilityUpdates = () => {\n if (enterTimeoutRef.current) {\n clearTimeout(enterTimeoutRef.current);\n enterTimeoutRef.current = null;\n }\n\n if (leaveTimeoutRef.current) {\n clearTimeout(leaveTimeoutRef.current);\n leaveTimeoutRef.current = null;\n }\n\n if (rafRef.current) {\n cancelAnimationFrame(rafRef.current);\n rafRef.current = null;\n }\n };\n\n const forceHideTooltip = () => {\n clearPendingVisibilityUpdates();\n setIsHovered(false);\n };\n\n const positionStyles = useMemo(\n () =>\n triggerRect\n ? getPositionStyles(triggerRect, placement, offset, isVisible)\n : { top: 0, left: 0 },\n [triggerRect, placement, offset, isVisible]\n );\n const typoStyles = useMemo(() => getTypoStyles(size), [size]);\n const borderRadius = (theme.shape.tooltip[size] ?? theme.shape.tooltip.md)\n .borderRadius;\n const arrowStyles = useMemo(() => getArrowStyles(placement), [placement]);\n\n // Update trigger position when tooltip becomes visible and on scroll/resize\n useEffect(() => {\n if (!isVisible || isNative) return;\n\n const updatePosition = () => {\n if (triggerRef.current) {\n setTriggerRect(triggerRef.current.getBoundingClientRect());\n }\n };\n\n updatePosition();\n\n window.addEventListener(\"scroll\", updatePosition, true);\n window.addEventListener(\"resize\", updatePosition);\n\n return () => {\n window.removeEventListener(\"scroll\", updatePosition, true);\n window.removeEventListener(\"resize\", updatePosition);\n };\n }, [isVisible]);\n\n const showTooltip = () => {\n clearPendingVisibilityUpdates();\n\n if (!isNative && typeof document !== \"undefined\") {\n document.dispatchEvent(\n new CustomEvent(TOOLTIP_OPEN_EVENT, { detail: { tooltipId } })\n );\n }\n\n // Update position before showing to prevent pop-in\n if (triggerRef.current) {\n setTriggerRect(triggerRef.current.getBoundingClientRect());\n\n // Double RAF to ensure position is rendered before showing tooltip\n rafRef.current = requestAnimationFrame(() => {\n rafRef.current = requestAnimationFrame(() => {\n if (delayEnter > 0) {\n enterTimeoutRef.current = setTimeout(() => {\n setIsHovered(true);\n }, delayEnter);\n } else {\n setIsHovered(true);\n }\n });\n });\n }\n };\n\n const showTooltipOnFocus = (event: React.FocusEvent<HTMLElement>) => {\n // Only reveal the tooltip on intentional keyboard focus. Focus that the\n // browser restores to the trigger when the tab/window regains focus — as\n // well as focus from a mouse click — must not re-trigger the tooltip\n // (FEP-832). `:focus-visible` encodes exactly this heuristic: it matches\n // for keyboard navigation but not for pointer-driven or restored focus.\n const target = event.target as HTMLElement | null;\n\n if (target && typeof target.matches === \"function\") {\n let isFocusVisible: boolean;\n try {\n isFocusVisible = target.matches(\":focus-visible\");\n } catch {\n // Legacy browsers without :focus-visible support — preserve the\n // previous behaviour of showing on any focus.\n isFocusVisible = true;\n }\n\n if (!isFocusVisible) return;\n }\n\n showTooltip();\n };\n\n const hideTooltip = () => {\n clearPendingVisibilityUpdates();\n\n if (delayLeave > 0) {\n leaveTimeoutRef.current = setTimeout(() => {\n setIsHovered(false);\n }, delayLeave);\n } else {\n setIsHovered(false);\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\" && isVisible) {\n forceHideTooltip();\n }\n };\n\n const handleVisibilityChange = () => {\n if (document.visibilityState === \"hidden\") {\n forceHideTooltip();\n }\n };\n\n const handleTooltipOpen = (event: Event) => {\n const { tooltipId: activeTooltipId } =\n (event as CustomEvent).detail ?? {};\n\n if (activeTooltipId !== tooltipId) {\n forceHideTooltip();\n }\n };\n\n document.addEventListener(\"keydown\", handleEscape);\n document.addEventListener(\"visibilitychange\", handleVisibilityChange);\n document.addEventListener(TOOLTIP_OPEN_EVENT, handleTooltipOpen);\n\n return () => {\n document.removeEventListener(\"keydown\", handleEscape);\n document.removeEventListener(\n \"visibilitychange\",\n handleVisibilityChange\n );\n document.removeEventListener(TOOLTIP_OPEN_EVENT, handleTooltipOpen);\n clearPendingVisibilityUpdates();\n };\n }, [isVisible, tooltipId]);\n\n return (\n <Box\n testID={testID}\n ref={triggerRef}\n position=\"relative\"\n display=\"inline-flex\"\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n onFocus={showTooltipOnFocus}\n onBlur={hideTooltip}\n className={className}\n style={{ height: \"fit-content\" }}\n aria-describedby={isVisible ? tooltipId : undefined}\n >\n {children}\n {!isNative && triggerRect && (\n <Portal>\n <Box\n ref={ref}\n data-testid={dataTestId}\n data-modal-id={modalId}\n position=\"fixed\"\n backgroundColor={theme.colors.layer.float}\n borderRadius={borderRadius}\n paddingVertical={8}\n paddingHorizontal={12}\n zIndex={overlayLayer + LAYER_OFFSET.tooltip}\n id={tooltipId}\n role=\"tooltip\"\n aria-hidden={!isVisible}\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n style={{\n ...positionStyles,\n // https://stackoverflow.com/questions/62844007/how-to-apply-tool-tip-arrow-triangle-shadow\n filter:\n \"drop-shadow(0 6px 10px rgba(7, 7, 8, 0.1)) drop-shadow(0 2px 3px rgba(7, 7, 8, 0.2))\",\n WebkitFilter:\n \"drop-shadow(0 6px 10px rgba(7, 7, 8, 0.1)) drop-shadow(0 2px 3px rgba(7, 7, 8, 0.2))\",\n opacity: isVisible ? 1 : 0,\n visibility: isVisible ? \"visible\" : \"hidden\",\n transition:\n \"opacity 150ms cubic-bezier(.4,0,.2,1), transform 150ms cubic-bezier(.4,0,.2,1), visibility 150ms cubic-bezier(.4,0,.2,1)\",\n pointerEvents: isVisible ? \"auto\" : \"none\",\n whiteSpace: \"normal\",\n width: \"max-content\",\n maxWidth: maxWidth ?? \"none\",\n overflow: \"visible\",\n willChange: isVisible ? \"transform, opacity\" : \"auto\", // optimize rendering and ensure more stable positioning\n ...style,\n }}\n >\n <Box\n position=\"absolute\"\n backgroundColor={theme.colors.layer.float}\n style={{\n ...arrowStyles,\n backfaceVisibility: \"hidden\",\n WebkitBackfaceVisibility: \"hidden\",\n }}\n />\n <Box\n style={{\n wordWrap: \"break-word\",\n overflowWrap: \"break-word\",\n maxWidth: \"100%\",\n whiteSpace: \"normal\",\n }}\n >\n {typeof content === \"string\" || typeof content === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={typoStyles.fontSize}\n fontWeight=\"400\"\n style={{ lineHeight: typoStyles.lineHeight }}\n >\n {content}\n </Text>\n ) : (\n content\n )}\n </Box>\n </Box>\n </Portal>\n )}\n </Box>\n );\n }\n);\n\nTooltip.displayName = \"Tooltip\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n /* Only emit overflow-x/y when explicitly set. Defaulting them to\n visible after overflow would override the shorthand and break\n clipping (e.g. OtherCard bottom-right promo image). */\n overflow: ${(props) => props.overflow || \"visible\"};\n ${(props) =>\n props.overflowX != null ? `overflow-x: ${props.overflowX};` : \"\"}\n ${(props) =>\n props.overflowY != null ? `overflow-y: ${props.overflowY};` : \"\"}\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) =>\n props.opacity != null ? props.opacity : props.disabled ? 0.5 : 1};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n /* \\`background\\` is emitted before \\`background-color\\` so a caller passing\n both still gets backgroundColor as the winner. Use the shorthand for a\n layered fill (e.g. an overlay tint over a resting surface colour), which\n a single background-color cannot express. */\n &:hover {\n ${(props) =>\n props.hoverStyle?.background &&\n `background: ${props.hoverStyle.background};`}\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.background &&\n `background: ${props.pressStyle.background};`}\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n data-testid={dataTestId || testID}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"opacity\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n // Cross-platform layout prop that Text consumes as CSS, never as an\n // attribute. Pinned explicitly because it is now spread into the styled\n // component rather than destructured away before it can reach the DOM.\n \"numberOfLines\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\nimport { truncationStyles } from \"./textTruncation\";\n\nconst FilteredSpan = createFilteredElement(\"span\");\n\nconst StyledText = styled(FilteredSpan)<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n\n /* Keep last: single-line truncation has to win over white-space above. */\n ${(props) => truncationStyles(props.numberOfLines)}\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n data-testid={dataTestId || testID}\n />\n );\n};\n","/**\n * Web implementation of the cross-platform `numberOfLines` text prop.\n *\n * Native maps `numberOfLines` straight onto `RNText`. A web `<span>` has no\n * equivalent, so emit the CSS that produces the same result.\n *\n * Two details matter for the single-line case:\n * - `text-overflow` only takes effect on a block container, so the inline\n * `<span>` is promoted to `display: block` and capped at `max-width: 100%`.\n * - `min-width: 0` lets the text shrink below its own content width when it\n * sits in a flex row. Without it a `nowrap` label keeps its full intrinsic\n * width and pushes its siblings (icons, chevrons) out of a fixed-width field.\n *\n * Returns an empty string when there is nothing to clamp, so the declaration\n * block stays untouched for the majority of callers.\n */\nexport const truncationStyles = (numberOfLines?: number): string => {\n if (!numberOfLines || numberOfLines < 1) return \"\";\n\n if (numberOfLines === 1) {\n return `\n display: block;\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `;\n }\n\n return `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ${numberOfLines};\n line-clamp: ${numberOfLines};\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\n `;\n};\n","import { ReactNode, useEffect, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\n\ninterface PortalProps {\n children: ReactNode;\n}\n\nexport const Portal = ({ children }: PortalProps) => {\n const [mountNode, setMountNode] = useState<HTMLElement | null>(null);\n\n useEffect(() => setMountNode(document.body), []);\n\n if (!mountNode) {\n return null;\n }\n\n return createPortal(children, mountNode);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AA,sBACH,oBAAoB;AAAA,sBACpB,0BAA0B;AAAA,oBAC5B;AAAA;AAAA,gBACF;AAAA,gBACA;AAAA,kBAAC;AAAA;AAAA,oBACC,OAAO;AAAA,sBACL,UAAU;AAAA,sBACV,cAAc;AAAA,sBACd,UAAU;AAAA,sBACV,YAAY;AAAA,oBACd;AAAA,oBAEC,iBAAO,YAAY,YAAY,OAAO,YAAY,WACjD;AAAA,sBAAC;AAAA;AAAA,wBACC,OAAO,MAAM,OAAO,QAAQ;AAAA,wBAC5B,UAAU,WAAW;AAAA,wBACrB,YAAW;AAAA,wBACX,OAAO,EAAE,YAAY,WAAW,WAAW;AAAA,wBAE1C;AAAA;AAAA,oBACH,IAEA;AAAA;AAAA,gBAEJ;AAAA;AAAA;AAAA,UACF,GACF;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;","names":["import_react","import_react","React","styled","React","import_styled_components","import_jsx_runtime","styled","import_react","import_jsx_runtime"]}
1
+ {"version":3,"sources":["../../src/index.tsx","../../src/Tooltip.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../../foundation/primitives-web/src/Text.tsx","../../../../foundation/primitives-web/src/textTruncation.ts","../../src/Portal.web.tsx"],"sourcesContent":["export * from \"./Tooltip\";\nexport * from \"./types\";\n","import React, { forwardRef, useState, useMemo, useEffect, useRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text } from \"@xsolla/xui-primitives\";\nimport {\n useResolvedTheme,\n useId,\n isNative,\n useModalId,\n useOverlayLayer,\n LAYER_OFFSET,\n type ThemeOverrideProps,\n} from \"@xsolla/xui-core\";\nimport type { TooltipPlacement, TooltipProps, TooltipSize } from \"./types\";\nimport { Portal } from \"./Portal\";\n\nconst TOOLTIP_OPEN_EVENT = \"xui-tooltip-open\";\ntype TooltipTheme = {\n colors: {\n layer: {\n float: string;\n };\n content: {\n primary: string;\n };\n };\n shape: {\n tooltip: Record<TooltipSize, { borderRadius: number | string }>;\n };\n};\n\nconst ARROW_SIZE = 10;\nconst ARROW_HALF = ARROW_SIZE / 2;\n// Keeps the arrow clear of the panel's corner radius (8px for `md`).\nconst ARROW_EDGE_OFFSET = 12;\nconst ARROW_CENTER_INSET = ARROW_EDGE_OFFSET + ARROW_HALF;\n\n// Re-centres the arrow on triggers too narrow for the flush inset (FEP-889).\nconst getArrowAlignmentShift = (triggerWidth: number) =>\n Math.max(0, ARROW_CENTER_INSET - triggerWidth / 2);\n\nconst getPositionStyles = (\n triggerRect: DOMRect,\n placement: TooltipPlacement,\n offset: number,\n isVisible: boolean\n) => {\n const slideDistance = 8;\n const scale = isVisible ? \"scale(1)\" : \"scale(0.95)\";\n const slideOffset = isVisible ? 0 : -slideDistance;\n const arrowShift = getArrowAlignmentShift(triggerRect.width);\n\n switch (placement) {\n case \"top\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left + triggerRect.width / 2,\n transform: `translateX(-50%) translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"top-left\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.right + arrowShift,\n transform: `translateX(-100%) translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"top-right\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left - arrowShift,\n transform: `translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"bottom\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.left + triggerRect.width / 2,\n transform: `translateX(-50%) translateY(${slideOffset}px) ${scale}`,\n };\n case \"bottom-left\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.right + arrowShift,\n transform: `translateX(-100%) translateY(${slideOffset}px) ${scale}`,\n };\n case \"bottom-right\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.left - arrowShift,\n transform: `translateY(${slideOffset}px) ${scale}`,\n };\n case \"left\":\n return {\n top: triggerRect.top + triggerRect.height / 2,\n left: triggerRect.left - offset,\n transform: `translateX(calc(-100% - ${slideOffset}px)) translateY(-50%) ${scale}`,\n };\n case \"right\":\n return {\n top: triggerRect.top + triggerRect.height / 2,\n left: triggerRect.right + offset,\n transform: `translateX(${slideOffset}px) translateY(-50%) ${scale}`,\n };\n default:\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left,\n transform: `translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n }\n};\n\nconst getTypoStyles = (size: TooltipSize) => {\n switch (size) {\n case \"sm\":\n return { fontSize: 14, lineHeight: \"16px\" };\n case \"md\":\n return { fontSize: 16, lineHeight: \"18px\" };\n case \"lg\":\n return { fontSize: 18, lineHeight: \"20px\" };\n case \"xl\":\n return { fontSize: 20, lineHeight: \"22px\" };\n default:\n return { fontSize: 16, lineHeight: \"18px\" };\n }\n};\n\nconst getArrowStyles = (placement: TooltipPlacement) => {\n const base: React.CSSProperties = {\n width: ARROW_SIZE,\n height: ARROW_SIZE,\n transform: \"rotate(45deg)\",\n borderRadius: 1,\n };\n\n const placementStyles: Record<TooltipPlacement, React.CSSProperties> = {\n top: { bottom: -ARROW_HALF, left: \"50%\", marginLeft: -ARROW_HALF },\n \"top-left\": { bottom: -ARROW_HALF, right: ARROW_EDGE_OFFSET },\n \"top-right\": { bottom: -ARROW_HALF, left: ARROW_EDGE_OFFSET },\n\n bottom: { top: -ARROW_HALF, left: \"50%\", marginLeft: -ARROW_HALF },\n \"bottom-left\": { top: -ARROW_HALF, right: ARROW_EDGE_OFFSET },\n \"bottom-right\": { top: -ARROW_HALF, left: ARROW_EDGE_OFFSET },\n\n left: { right: -ARROW_HALF, top: \"50%\", marginTop: -ARROW_HALF },\n right: { left: -ARROW_HALF, top: \"50%\", marginTop: -ARROW_HALF },\n };\n\n return { ...base, ...placementStyles[placement] };\n};\n\nexport const Tooltip = forwardRef<\n HTMLDivElement,\n TooltipProps & ThemeOverrideProps\n>(\n (\n {\n content,\n children,\n size = \"md\",\n delayEnter = 0,\n delayLeave = 100,\n offset = 12,\n placement = \"top\",\n maxWidth,\n controlledVisible,\n style,\n \"data-testid\": dataTestId,\n className,\n testID,\n themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const [isHovered, setIsHovered] = useState(false);\n const [triggerRect, setTriggerRect] = useState<DOMRect | null>(null);\n const { theme: resolvedTheme } = useResolvedTheme({\n themeMode,\n themeProductContext,\n });\n const theme = resolvedTheme as TooltipTheme;\n const enterTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const leaveTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const rafRef = useRef<number | null>(null);\n const triggerRef = useRef<HTMLDivElement>(null);\n const tooltipId = useId();\n const modalId = useModalId();\n const overlayLayer = useOverlayLayer();\n\n const isVisible =\n controlledVisible !== undefined ? controlledVisible : isHovered;\n\n const clearPendingVisibilityUpdates = () => {\n if (enterTimeoutRef.current) {\n clearTimeout(enterTimeoutRef.current);\n enterTimeoutRef.current = null;\n }\n\n if (leaveTimeoutRef.current) {\n clearTimeout(leaveTimeoutRef.current);\n leaveTimeoutRef.current = null;\n }\n\n if (rafRef.current) {\n cancelAnimationFrame(rafRef.current);\n rafRef.current = null;\n }\n };\n\n const forceHideTooltip = () => {\n clearPendingVisibilityUpdates();\n setIsHovered(false);\n };\n\n const positionStyles = useMemo(\n () =>\n triggerRect\n ? getPositionStyles(triggerRect, placement, offset, isVisible)\n : { top: 0, left: 0 },\n [triggerRect, placement, offset, isVisible]\n );\n const typoStyles = useMemo(() => getTypoStyles(size), [size]);\n const borderRadius = (theme.shape.tooltip[size] ?? theme.shape.tooltip.md)\n .borderRadius;\n const arrowStyles = useMemo(() => getArrowStyles(placement), [placement]);\n\n // Update trigger position when tooltip becomes visible and on scroll/resize\n useEffect(() => {\n if (!isVisible || isNative) return;\n\n const updatePosition = () => {\n if (triggerRef.current) {\n setTriggerRect(triggerRef.current.getBoundingClientRect());\n }\n };\n\n updatePosition();\n\n window.addEventListener(\"scroll\", updatePosition, true);\n window.addEventListener(\"resize\", updatePosition);\n\n return () => {\n window.removeEventListener(\"scroll\", updatePosition, true);\n window.removeEventListener(\"resize\", updatePosition);\n };\n }, [isVisible]);\n\n const showTooltip = () => {\n clearPendingVisibilityUpdates();\n\n if (!isNative && typeof document !== \"undefined\") {\n document.dispatchEvent(\n new CustomEvent(TOOLTIP_OPEN_EVENT, { detail: { tooltipId } })\n );\n }\n\n // Update position before showing to prevent pop-in\n if (triggerRef.current) {\n setTriggerRect(triggerRef.current.getBoundingClientRect());\n\n // Double RAF to ensure position is rendered before showing tooltip\n rafRef.current = requestAnimationFrame(() => {\n rafRef.current = requestAnimationFrame(() => {\n if (delayEnter > 0) {\n enterTimeoutRef.current = setTimeout(() => {\n setIsHovered(true);\n }, delayEnter);\n } else {\n setIsHovered(true);\n }\n });\n });\n }\n };\n\n const showTooltipOnFocus = (event: React.FocusEvent<HTMLElement>) => {\n // Only reveal the tooltip on intentional keyboard focus. Focus that the\n // browser restores to the trigger when the tab/window regains focus — as\n // well as focus from a mouse click — must not re-trigger the tooltip\n // (FEP-832). `:focus-visible` encodes exactly this heuristic: it matches\n // for keyboard navigation but not for pointer-driven or restored focus.\n const target = event.target as HTMLElement | null;\n\n if (target && typeof target.matches === \"function\") {\n let isFocusVisible: boolean;\n try {\n isFocusVisible = target.matches(\":focus-visible\");\n } catch {\n // Legacy browsers without :focus-visible support — preserve the\n // previous behaviour of showing on any focus.\n isFocusVisible = true;\n }\n\n if (!isFocusVisible) return;\n }\n\n showTooltip();\n };\n\n const hideTooltip = () => {\n clearPendingVisibilityUpdates();\n\n if (delayLeave > 0) {\n leaveTimeoutRef.current = setTimeout(() => {\n setIsHovered(false);\n }, delayLeave);\n } else {\n setIsHovered(false);\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\" && isVisible) {\n forceHideTooltip();\n }\n };\n\n const handleVisibilityChange = () => {\n if (document.visibilityState === \"hidden\") {\n forceHideTooltip();\n }\n };\n\n const handleTooltipOpen = (event: Event) => {\n const { tooltipId: activeTooltipId } =\n (event as CustomEvent).detail ?? {};\n\n if (activeTooltipId !== tooltipId) {\n forceHideTooltip();\n }\n };\n\n document.addEventListener(\"keydown\", handleEscape);\n document.addEventListener(\"visibilitychange\", handleVisibilityChange);\n document.addEventListener(TOOLTIP_OPEN_EVENT, handleTooltipOpen);\n\n return () => {\n document.removeEventListener(\"keydown\", handleEscape);\n document.removeEventListener(\n \"visibilitychange\",\n handleVisibilityChange\n );\n document.removeEventListener(TOOLTIP_OPEN_EVENT, handleTooltipOpen);\n clearPendingVisibilityUpdates();\n };\n }, [isVisible, tooltipId]);\n\n return (\n <Box\n testID={testID}\n ref={triggerRef}\n position=\"relative\"\n display=\"inline-flex\"\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n onFocus={showTooltipOnFocus}\n onBlur={hideTooltip}\n className={className}\n style={{ height: \"fit-content\" }}\n aria-describedby={isVisible ? tooltipId : undefined}\n >\n {children}\n {!isNative && triggerRect && (\n <Portal>\n <Box\n ref={ref}\n data-testid={dataTestId}\n data-modal-id={modalId}\n position=\"fixed\"\n backgroundColor={theme.colors.layer.float}\n borderRadius={borderRadius}\n paddingVertical={8}\n paddingHorizontal={12}\n zIndex={overlayLayer + LAYER_OFFSET.tooltip}\n id={tooltipId}\n role=\"tooltip\"\n aria-hidden={!isVisible}\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n style={{\n ...positionStyles,\n // https://stackoverflow.com/questions/62844007/how-to-apply-tool-tip-arrow-triangle-shadow\n filter:\n \"drop-shadow(0 6px 10px rgba(7, 7, 8, 0.1)) drop-shadow(0 2px 3px rgba(7, 7, 8, 0.2))\",\n WebkitFilter:\n \"drop-shadow(0 6px 10px rgba(7, 7, 8, 0.1)) drop-shadow(0 2px 3px rgba(7, 7, 8, 0.2))\",\n opacity: isVisible ? 1 : 0,\n visibility: isVisible ? \"visible\" : \"hidden\",\n transition:\n \"opacity 150ms cubic-bezier(.4,0,.2,1), transform 150ms cubic-bezier(.4,0,.2,1), visibility 150ms cubic-bezier(.4,0,.2,1)\",\n pointerEvents: isVisible ? \"auto\" : \"none\",\n whiteSpace: \"normal\",\n width: \"max-content\",\n maxWidth: maxWidth ?? \"none\",\n overflow: \"visible\",\n willChange: isVisible ? \"transform, opacity\" : \"auto\", // optimize rendering and ensure more stable positioning\n ...style,\n }}\n >\n <Box\n position=\"absolute\"\n backgroundColor={theme.colors.layer.float}\n style={{\n ...arrowStyles,\n backfaceVisibility: \"hidden\",\n WebkitBackfaceVisibility: \"hidden\",\n }}\n />\n <Box\n style={{\n wordWrap: \"break-word\",\n overflowWrap: \"break-word\",\n maxWidth: \"100%\",\n whiteSpace: \"normal\",\n }}\n >\n {typeof content === \"string\" || typeof content === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={typoStyles.fontSize}\n fontWeight=\"400\"\n style={{\n lineHeight: typoStyles.lineHeight,\n whiteSpace: \"pre-line\",\n }}\n >\n {content}\n </Text>\n ) : (\n content\n )}\n </Box>\n </Box>\n </Portal>\n )}\n </Box>\n );\n }\n);\n\nTooltip.displayName = \"Tooltip\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n /* Only emit overflow-x/y when explicitly set. Defaulting them to\n visible after overflow would override the shorthand and break\n clipping (e.g. OtherCard bottom-right promo image). */\n overflow: ${(props) => props.overflow || \"visible\"};\n ${(props) =>\n props.overflowX != null ? `overflow-x: ${props.overflowX};` : \"\"}\n ${(props) =>\n props.overflowY != null ? `overflow-y: ${props.overflowY};` : \"\"}\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) =>\n props.opacity != null ? props.opacity : props.disabled ? 0.5 : 1};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n /* \\`background\\` is emitted before \\`background-color\\` so a caller passing\n both still gets backgroundColor as the winner. Use the shorthand for a\n layered fill (e.g. an overlay tint over a resting surface colour), which\n a single background-color cannot express. */\n &:hover {\n ${(props) =>\n props.hoverStyle?.background &&\n `background: ${props.hoverStyle.background};`}\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.background &&\n `background: ${props.pressStyle.background};`}\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n data-testid={dataTestId || testID}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"opacity\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n // Cross-platform layout prop that Text consumes as CSS, never as an\n // attribute. Pinned explicitly because it is now spread into the styled\n // component rather than destructured away before it can reach the DOM.\n \"numberOfLines\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\nimport { truncationStyles } from \"./textTruncation\";\n\nconst FilteredSpan = createFilteredElement(\"span\");\n\nconst StyledText = styled(FilteredSpan)<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n\n /* Keep last: single-line truncation has to win over white-space above. */\n ${(props) => truncationStyles(props.numberOfLines)}\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n data-testid={dataTestId || testID}\n />\n );\n};\n","/**\n * Web implementation of the cross-platform `numberOfLines` text prop.\n *\n * Native maps `numberOfLines` straight onto `RNText`. A web `<span>` has no\n * equivalent, so emit the CSS that produces the same result.\n *\n * Two details matter for the single-line case:\n * - `text-overflow` only takes effect on a block container, so the inline\n * `<span>` is promoted to `display: block` and capped at `max-width: 100%`.\n * - `min-width: 0` lets the text shrink below its own content width when it\n * sits in a flex row. Without it a `nowrap` label keeps its full intrinsic\n * width and pushes its siblings (icons, chevrons) out of a fixed-width field.\n *\n * Returns an empty string when there is nothing to clamp, so the declaration\n * block stays untouched for the majority of callers.\n */\nexport const truncationStyles = (numberOfLines?: number): string => {\n if (!numberOfLines || numberOfLines < 1) return \"\";\n\n if (numberOfLines === 1) {\n return `\n display: block;\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `;\n }\n\n return `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ${numberOfLines};\n line-clamp: ${numberOfLines};\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\n `;\n};\n","import { ReactNode, useEffect, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\n\ninterface PortalProps {\n children: ReactNode;\n}\n\nexport const Portal = ({ children }: PortalProps) => {\n const [mountNode, setMountNode] = useState<HTMLElement | null>(null);\n\n useEffect(() => setMountNode(document.body), []);\n\n if (!mountNode) {\n return null;\n }\n\n return createPortal(children, mountNode);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;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ACF;AAAA,gBACA;AAAA,kBAAC;AAAA;AAAA,oBACC,OAAO;AAAA,sBACL,UAAU;AAAA,sBACV,cAAc;AAAA,sBACd,UAAU;AAAA,sBACV,YAAY;AAAA,oBACd;AAAA,oBAEC,iBAAO,YAAY,YAAY,OAAO,YAAY,WACjD;AAAA,sBAAC;AAAA;AAAA,wBACC,OAAO,MAAM,OAAO,QAAQ;AAAA,wBAC5B,UAAU,WAAW;AAAA,wBACrB,YAAW;AAAA,wBACX,OAAO;AAAA,0BACL,YAAY,WAAW;AAAA,0BACvB,YAAY;AAAA,wBACd;AAAA,wBAEC;AAAA;AAAA,oBACH,IAEA;AAAA;AAAA,gBAEJ;AAAA;AAAA;AAAA,UACF,GACF;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;","names":["import_react","import_react","React","styled","React","import_styled_components","import_jsx_runtime","styled","import_react","import_jsx_runtime"]}
package/web/index.mjs CHANGED
@@ -684,7 +684,10 @@ var Tooltip = forwardRef(
684
684
  color: theme.colors.content.primary,
685
685
  fontSize: typoStyles.fontSize,
686
686
  fontWeight: "400",
687
- style: { lineHeight: typoStyles.lineHeight },
687
+ style: {
688
+ lineHeight: typoStyles.lineHeight,
689
+ whiteSpace: "pre-line"
690
+ },
688
691
  children: content
689
692
  }
690
693
  ) : content
package/web/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Tooltip.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../../foundation/primitives-web/src/Text.tsx","../../../../foundation/primitives-web/src/textTruncation.ts","../../src/Portal.web.tsx"],"sourcesContent":["import React, { forwardRef, useState, useMemo, useEffect, useRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text } from \"@xsolla/xui-primitives\";\nimport {\n useResolvedTheme,\n useId,\n isNative,\n useModalId,\n useOverlayLayer,\n LAYER_OFFSET,\n type ThemeOverrideProps,\n} from \"@xsolla/xui-core\";\nimport type { TooltipPlacement, TooltipProps, TooltipSize } from \"./types\";\nimport { Portal } from \"./Portal\";\n\nconst TOOLTIP_OPEN_EVENT = \"xui-tooltip-open\";\ntype TooltipTheme = {\n colors: {\n layer: {\n float: string;\n };\n content: {\n primary: string;\n };\n };\n shape: {\n tooltip: Record<TooltipSize, { borderRadius: number | string }>;\n };\n};\n\nconst ARROW_SIZE = 10;\nconst ARROW_HALF = ARROW_SIZE / 2;\n// Keeps the arrow clear of the panel's corner radius (8px for `md`).\nconst ARROW_EDGE_OFFSET = 12;\nconst ARROW_CENTER_INSET = ARROW_EDGE_OFFSET + ARROW_HALF;\n\n// Re-centres the arrow on triggers too narrow for the flush inset (FEP-889).\nconst getArrowAlignmentShift = (triggerWidth: number) =>\n Math.max(0, ARROW_CENTER_INSET - triggerWidth / 2);\n\nconst getPositionStyles = (\n triggerRect: DOMRect,\n placement: TooltipPlacement,\n offset: number,\n isVisible: boolean\n) => {\n const slideDistance = 8;\n const scale = isVisible ? \"scale(1)\" : \"scale(0.95)\";\n const slideOffset = isVisible ? 0 : -slideDistance;\n const arrowShift = getArrowAlignmentShift(triggerRect.width);\n\n switch (placement) {\n case \"top\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left + triggerRect.width / 2,\n transform: `translateX(-50%) translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"top-left\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.right + arrowShift,\n transform: `translateX(-100%) translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"top-right\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left - arrowShift,\n transform: `translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"bottom\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.left + triggerRect.width / 2,\n transform: `translateX(-50%) translateY(${slideOffset}px) ${scale}`,\n };\n case \"bottom-left\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.right + arrowShift,\n transform: `translateX(-100%) translateY(${slideOffset}px) ${scale}`,\n };\n case \"bottom-right\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.left - arrowShift,\n transform: `translateY(${slideOffset}px) ${scale}`,\n };\n case \"left\":\n return {\n top: triggerRect.top + triggerRect.height / 2,\n left: triggerRect.left - offset,\n transform: `translateX(calc(-100% - ${slideOffset}px)) translateY(-50%) ${scale}`,\n };\n case \"right\":\n return {\n top: triggerRect.top + triggerRect.height / 2,\n left: triggerRect.right + offset,\n transform: `translateX(${slideOffset}px) translateY(-50%) ${scale}`,\n };\n default:\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left,\n transform: `translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n }\n};\n\nconst getTypoStyles = (size: TooltipSize) => {\n switch (size) {\n case \"sm\":\n return { fontSize: 14, lineHeight: \"16px\" };\n case \"md\":\n return { fontSize: 16, lineHeight: \"18px\" };\n case \"lg\":\n return { fontSize: 18, lineHeight: \"20px\" };\n case \"xl\":\n return { fontSize: 20, lineHeight: \"22px\" };\n default:\n return { fontSize: 16, lineHeight: \"18px\" };\n }\n};\n\nconst getArrowStyles = (placement: TooltipPlacement) => {\n const base: React.CSSProperties = {\n width: ARROW_SIZE,\n height: ARROW_SIZE,\n transform: \"rotate(45deg)\",\n borderRadius: 1,\n };\n\n const placementStyles: Record<TooltipPlacement, React.CSSProperties> = {\n top: { bottom: -ARROW_HALF, left: \"50%\", marginLeft: -ARROW_HALF },\n \"top-left\": { bottom: -ARROW_HALF, right: ARROW_EDGE_OFFSET },\n \"top-right\": { bottom: -ARROW_HALF, left: ARROW_EDGE_OFFSET },\n\n bottom: { top: -ARROW_HALF, left: \"50%\", marginLeft: -ARROW_HALF },\n \"bottom-left\": { top: -ARROW_HALF, right: ARROW_EDGE_OFFSET },\n \"bottom-right\": { top: -ARROW_HALF, left: ARROW_EDGE_OFFSET },\n\n left: { right: -ARROW_HALF, top: \"50%\", marginTop: -ARROW_HALF },\n right: { left: -ARROW_HALF, top: \"50%\", marginTop: -ARROW_HALF },\n };\n\n return { ...base, ...placementStyles[placement] };\n};\n\nexport const Tooltip = forwardRef<\n HTMLDivElement,\n TooltipProps & ThemeOverrideProps\n>(\n (\n {\n content,\n children,\n size = \"md\",\n delayEnter = 0,\n delayLeave = 100,\n offset = 12,\n placement = \"top\",\n maxWidth,\n controlledVisible,\n style,\n \"data-testid\": dataTestId,\n className,\n testID,\n themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const [isHovered, setIsHovered] = useState(false);\n const [triggerRect, setTriggerRect] = useState<DOMRect | null>(null);\n const { theme: resolvedTheme } = useResolvedTheme({\n themeMode,\n themeProductContext,\n });\n const theme = resolvedTheme as TooltipTheme;\n const enterTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const leaveTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const rafRef = useRef<number | null>(null);\n const triggerRef = useRef<HTMLDivElement>(null);\n const tooltipId = useId();\n const modalId = useModalId();\n const overlayLayer = useOverlayLayer();\n\n const isVisible =\n controlledVisible !== undefined ? controlledVisible : isHovered;\n\n const clearPendingVisibilityUpdates = () => {\n if (enterTimeoutRef.current) {\n clearTimeout(enterTimeoutRef.current);\n enterTimeoutRef.current = null;\n }\n\n if (leaveTimeoutRef.current) {\n clearTimeout(leaveTimeoutRef.current);\n leaveTimeoutRef.current = null;\n }\n\n if (rafRef.current) {\n cancelAnimationFrame(rafRef.current);\n rafRef.current = null;\n }\n };\n\n const forceHideTooltip = () => {\n clearPendingVisibilityUpdates();\n setIsHovered(false);\n };\n\n const positionStyles = useMemo(\n () =>\n triggerRect\n ? getPositionStyles(triggerRect, placement, offset, isVisible)\n : { top: 0, left: 0 },\n [triggerRect, placement, offset, isVisible]\n );\n const typoStyles = useMemo(() => getTypoStyles(size), [size]);\n const borderRadius = (theme.shape.tooltip[size] ?? theme.shape.tooltip.md)\n .borderRadius;\n const arrowStyles = useMemo(() => getArrowStyles(placement), [placement]);\n\n // Update trigger position when tooltip becomes visible and on scroll/resize\n useEffect(() => {\n if (!isVisible || isNative) return;\n\n const updatePosition = () => {\n if (triggerRef.current) {\n setTriggerRect(triggerRef.current.getBoundingClientRect());\n }\n };\n\n updatePosition();\n\n window.addEventListener(\"scroll\", updatePosition, true);\n window.addEventListener(\"resize\", updatePosition);\n\n return () => {\n window.removeEventListener(\"scroll\", updatePosition, true);\n window.removeEventListener(\"resize\", updatePosition);\n };\n }, [isVisible]);\n\n const showTooltip = () => {\n clearPendingVisibilityUpdates();\n\n if (!isNative && typeof document !== \"undefined\") {\n document.dispatchEvent(\n new CustomEvent(TOOLTIP_OPEN_EVENT, { detail: { tooltipId } })\n );\n }\n\n // Update position before showing to prevent pop-in\n if (triggerRef.current) {\n setTriggerRect(triggerRef.current.getBoundingClientRect());\n\n // Double RAF to ensure position is rendered before showing tooltip\n rafRef.current = requestAnimationFrame(() => {\n rafRef.current = requestAnimationFrame(() => {\n if (delayEnter > 0) {\n enterTimeoutRef.current = setTimeout(() => {\n setIsHovered(true);\n }, delayEnter);\n } else {\n setIsHovered(true);\n }\n });\n });\n }\n };\n\n const showTooltipOnFocus = (event: React.FocusEvent<HTMLElement>) => {\n // Only reveal the tooltip on intentional keyboard focus. Focus that the\n // browser restores to the trigger when the tab/window regains focus — as\n // well as focus from a mouse click — must not re-trigger the tooltip\n // (FEP-832). `:focus-visible` encodes exactly this heuristic: it matches\n // for keyboard navigation but not for pointer-driven or restored focus.\n const target = event.target as HTMLElement | null;\n\n if (target && typeof target.matches === \"function\") {\n let isFocusVisible: boolean;\n try {\n isFocusVisible = target.matches(\":focus-visible\");\n } catch {\n // Legacy browsers without :focus-visible support — preserve the\n // previous behaviour of showing on any focus.\n isFocusVisible = true;\n }\n\n if (!isFocusVisible) return;\n }\n\n showTooltip();\n };\n\n const hideTooltip = () => {\n clearPendingVisibilityUpdates();\n\n if (delayLeave > 0) {\n leaveTimeoutRef.current = setTimeout(() => {\n setIsHovered(false);\n }, delayLeave);\n } else {\n setIsHovered(false);\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\" && isVisible) {\n forceHideTooltip();\n }\n };\n\n const handleVisibilityChange = () => {\n if (document.visibilityState === \"hidden\") {\n forceHideTooltip();\n }\n };\n\n const handleTooltipOpen = (event: Event) => {\n const { tooltipId: activeTooltipId } =\n (event as CustomEvent).detail ?? {};\n\n if (activeTooltipId !== tooltipId) {\n forceHideTooltip();\n }\n };\n\n document.addEventListener(\"keydown\", handleEscape);\n document.addEventListener(\"visibilitychange\", handleVisibilityChange);\n document.addEventListener(TOOLTIP_OPEN_EVENT, handleTooltipOpen);\n\n return () => {\n document.removeEventListener(\"keydown\", handleEscape);\n document.removeEventListener(\n \"visibilitychange\",\n handleVisibilityChange\n );\n document.removeEventListener(TOOLTIP_OPEN_EVENT, handleTooltipOpen);\n clearPendingVisibilityUpdates();\n };\n }, [isVisible, tooltipId]);\n\n return (\n <Box\n testID={testID}\n ref={triggerRef}\n position=\"relative\"\n display=\"inline-flex\"\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n onFocus={showTooltipOnFocus}\n onBlur={hideTooltip}\n className={className}\n style={{ height: \"fit-content\" }}\n aria-describedby={isVisible ? tooltipId : undefined}\n >\n {children}\n {!isNative && triggerRect && (\n <Portal>\n <Box\n ref={ref}\n data-testid={dataTestId}\n data-modal-id={modalId}\n position=\"fixed\"\n backgroundColor={theme.colors.layer.float}\n borderRadius={borderRadius}\n paddingVertical={8}\n paddingHorizontal={12}\n zIndex={overlayLayer + LAYER_OFFSET.tooltip}\n id={tooltipId}\n role=\"tooltip\"\n aria-hidden={!isVisible}\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n style={{\n ...positionStyles,\n // https://stackoverflow.com/questions/62844007/how-to-apply-tool-tip-arrow-triangle-shadow\n filter:\n \"drop-shadow(0 6px 10px rgba(7, 7, 8, 0.1)) drop-shadow(0 2px 3px rgba(7, 7, 8, 0.2))\",\n WebkitFilter:\n \"drop-shadow(0 6px 10px rgba(7, 7, 8, 0.1)) drop-shadow(0 2px 3px rgba(7, 7, 8, 0.2))\",\n opacity: isVisible ? 1 : 0,\n visibility: isVisible ? \"visible\" : \"hidden\",\n transition:\n \"opacity 150ms cubic-bezier(.4,0,.2,1), transform 150ms cubic-bezier(.4,0,.2,1), visibility 150ms cubic-bezier(.4,0,.2,1)\",\n pointerEvents: isVisible ? \"auto\" : \"none\",\n whiteSpace: \"normal\",\n width: \"max-content\",\n maxWidth: maxWidth ?? \"none\",\n overflow: \"visible\",\n willChange: isVisible ? \"transform, opacity\" : \"auto\", // optimize rendering and ensure more stable positioning\n ...style,\n }}\n >\n <Box\n position=\"absolute\"\n backgroundColor={theme.colors.layer.float}\n style={{\n ...arrowStyles,\n backfaceVisibility: \"hidden\",\n WebkitBackfaceVisibility: \"hidden\",\n }}\n />\n <Box\n style={{\n wordWrap: \"break-word\",\n overflowWrap: \"break-word\",\n maxWidth: \"100%\",\n whiteSpace: \"normal\",\n }}\n >\n {typeof content === \"string\" || typeof content === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={typoStyles.fontSize}\n fontWeight=\"400\"\n style={{ lineHeight: typoStyles.lineHeight }}\n >\n {content}\n </Text>\n ) : (\n content\n )}\n </Box>\n </Box>\n </Portal>\n )}\n </Box>\n );\n }\n);\n\nTooltip.displayName = \"Tooltip\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n /* Only emit overflow-x/y when explicitly set. Defaulting them to\n visible after overflow would override the shorthand and break\n clipping (e.g. OtherCard bottom-right promo image). */\n overflow: ${(props) => props.overflow || \"visible\"};\n ${(props) =>\n props.overflowX != null ? `overflow-x: ${props.overflowX};` : \"\"}\n ${(props) =>\n props.overflowY != null ? `overflow-y: ${props.overflowY};` : \"\"}\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) =>\n props.opacity != null ? props.opacity : props.disabled ? 0.5 : 1};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n /* \\`background\\` is emitted before \\`background-color\\` so a caller passing\n both still gets backgroundColor as the winner. Use the shorthand for a\n layered fill (e.g. an overlay tint over a resting surface colour), which\n a single background-color cannot express. */\n &:hover {\n ${(props) =>\n props.hoverStyle?.background &&\n `background: ${props.hoverStyle.background};`}\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.background &&\n `background: ${props.pressStyle.background};`}\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n data-testid={dataTestId || testID}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"opacity\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n // Cross-platform layout prop that Text consumes as CSS, never as an\n // attribute. Pinned explicitly because it is now spread into the styled\n // component rather than destructured away before it can reach the DOM.\n \"numberOfLines\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\nimport { truncationStyles } from \"./textTruncation\";\n\nconst FilteredSpan = createFilteredElement(\"span\");\n\nconst StyledText = styled(FilteredSpan)<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n\n /* Keep last: single-line truncation has to win over white-space above. */\n ${(props) => truncationStyles(props.numberOfLines)}\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n data-testid={dataTestId || testID}\n />\n );\n};\n","/**\n * Web implementation of the cross-platform `numberOfLines` text prop.\n *\n * Native maps `numberOfLines` straight onto `RNText`. A web `<span>` has no\n * equivalent, so emit the CSS that produces the same result.\n *\n * Two details matter for the single-line case:\n * - `text-overflow` only takes effect on a block container, so the inline\n * `<span>` is promoted to `display: block` and capped at `max-width: 100%`.\n * - `min-width: 0` lets the text shrink below its own content width when it\n * sits in a flex row. Without it a `nowrap` label keeps its full intrinsic\n * width and pushes its siblings (icons, chevrons) out of a fixed-width field.\n *\n * Returns an empty string when there is nothing to clamp, so the declaration\n * block stays untouched for the majority of callers.\n */\nexport const truncationStyles = (numberOfLines?: number): string => {\n if (!numberOfLines || numberOfLines < 1) return \"\";\n\n if (numberOfLines === 1) {\n return `\n display: block;\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `;\n }\n\n return `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ${numberOfLines};\n line-clamp: ${numberOfLines};\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\n `;\n};\n","import { ReactNode, useEffect, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\n\ninterface PortalProps {\n children: ReactNode;\n}\n\nexport const Portal = ({ children }: PortalProps) => {\n const [mountNode, setMountNode] = useState<HTMLElement | null>(null);\n\n useEffect(() => setMountNode(document.body), []);\n\n if (!mountNode) {\n return null;\n }\n\n return createPortal(children, mountNode);\n};\n"],"mappings":";AAAA,SAAgB,YAAY,YAAAA,WAAU,SAAS,aAAAC,YAAW,cAAc;;;ACAxE,OAAOC,YAAW;AAClB,OAAO,YAAY;;;ACDnB,OAAO,WAAW;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAAI,kBAAkB;AAEtB,IAAI,QAAQ;AAAA,EAAQ,SAAU,MAAM;AAClC,WAAO,gBAAgB,KAAK,IAAI,KAAK,KAAK,WAAW,CAAC,MAAM,OAEzD,KAAK,WAAW,CAAC,MAAM,OAEvB,KAAK,WAAW,CAAC,IAAI;AAAA,EAC1B;AAAA;AAEA;AAEA,IAAO,4BAAQ;;;AFRR,IAAM,2BAA2B,oBAAI,IAAI;AAAA;AAAA,EAE9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAIA;AACF,CAAC;AAED,SAAS,kBAAkB,KAAsB;AAC/C,MAAI,yBAAyB,IAAI,GAAG,EAAG,QAAO;AAC9C,SAAO,0BAAY,GAAG;AACxB;AAgBO,SAAS,sBAAsB,YAAoB;AACxD,QAAM,YAAY,MAAM;AAAA,IACtB,CAAC,EAAE,UAAU,aAAa,GAAG,MAAM,GAAG,QAAQ;AAC5C,YAAM,MAAO,eAA0B;AACvC,YAAM,YAAqC,CAAC;AAC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,cAEA;AAAA,gCAAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,UAAS;AAAA,oBACT,iBAAiB,MAAM,OAAO,MAAM;AAAA,oBACpC,OAAO;AAAA,sBACL,GAAG;AAAA,sBACH,oBAAoB;AAAA,sBACpB,0BAA0B;AAAA,oBAC5B;AAAA;AAAA,gBACF;AAAA,gBACA,gBAAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,OAAO;AAAA,sBACL,UAAU;AAAA,sBACV,cAAc;AAAA,sBACd,UAAU;AAAA,sBACV,YAAY;AAAA,oBACd;AAAA,oBAEC,iBAAO,YAAY,YAAY,OAAO,YAAY,WACjD,gBAAAA;AAAA,sBAAC;AAAA;AAAA,wBACC,OAAO,MAAM,OAAO,QAAQ;AAAA,wBAC5B,UAAU,WAAW;AAAA,wBACrB,YAAW;AAAA,wBACX,OAAO,EAAE,YAAY,WAAW,WAAW;AAAA,wBAE1C;AAAA;AAAA,oBACH,IAEA;AAAA;AAAA,gBAEJ;AAAA;AAAA;AAAA,UACF,GACF;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;","names":["useState","useEffect","React","React","styled","jsx","styled","jsx","useState","useEffect"]}
1
+ {"version":3,"sources":["../../src/Tooltip.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../../foundation/primitives-web/src/Text.tsx","../../../../foundation/primitives-web/src/textTruncation.ts","../../src/Portal.web.tsx"],"sourcesContent":["import React, { forwardRef, useState, useMemo, useEffect, useRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text } from \"@xsolla/xui-primitives\";\nimport {\n useResolvedTheme,\n useId,\n isNative,\n useModalId,\n useOverlayLayer,\n LAYER_OFFSET,\n type ThemeOverrideProps,\n} from \"@xsolla/xui-core\";\nimport type { TooltipPlacement, TooltipProps, TooltipSize } from \"./types\";\nimport { Portal } from \"./Portal\";\n\nconst TOOLTIP_OPEN_EVENT = \"xui-tooltip-open\";\ntype TooltipTheme = {\n colors: {\n layer: {\n float: string;\n };\n content: {\n primary: string;\n };\n };\n shape: {\n tooltip: Record<TooltipSize, { borderRadius: number | string }>;\n };\n};\n\nconst ARROW_SIZE = 10;\nconst ARROW_HALF = ARROW_SIZE / 2;\n// Keeps the arrow clear of the panel's corner radius (8px for `md`).\nconst ARROW_EDGE_OFFSET = 12;\nconst ARROW_CENTER_INSET = ARROW_EDGE_OFFSET + ARROW_HALF;\n\n// Re-centres the arrow on triggers too narrow for the flush inset (FEP-889).\nconst getArrowAlignmentShift = (triggerWidth: number) =>\n Math.max(0, ARROW_CENTER_INSET - triggerWidth / 2);\n\nconst getPositionStyles = (\n triggerRect: DOMRect,\n placement: TooltipPlacement,\n offset: number,\n isVisible: boolean\n) => {\n const slideDistance = 8;\n const scale = isVisible ? \"scale(1)\" : \"scale(0.95)\";\n const slideOffset = isVisible ? 0 : -slideDistance;\n const arrowShift = getArrowAlignmentShift(triggerRect.width);\n\n switch (placement) {\n case \"top\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left + triggerRect.width / 2,\n transform: `translateX(-50%) translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"top-left\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.right + arrowShift,\n transform: `translateX(-100%) translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"top-right\":\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left - arrowShift,\n transform: `translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n case \"bottom\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.left + triggerRect.width / 2,\n transform: `translateX(-50%) translateY(${slideOffset}px) ${scale}`,\n };\n case \"bottom-left\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.right + arrowShift,\n transform: `translateX(-100%) translateY(${slideOffset}px) ${scale}`,\n };\n case \"bottom-right\":\n return {\n top: triggerRect.bottom + offset,\n left: triggerRect.left - arrowShift,\n transform: `translateY(${slideOffset}px) ${scale}`,\n };\n case \"left\":\n return {\n top: triggerRect.top + triggerRect.height / 2,\n left: triggerRect.left - offset,\n transform: `translateX(calc(-100% - ${slideOffset}px)) translateY(-50%) ${scale}`,\n };\n case \"right\":\n return {\n top: triggerRect.top + triggerRect.height / 2,\n left: triggerRect.right + offset,\n transform: `translateX(${slideOffset}px) translateY(-50%) ${scale}`,\n };\n default:\n return {\n top: triggerRect.top - offset,\n left: triggerRect.left,\n transform: `translateY(calc(-100% - ${slideOffset}px)) ${scale}`,\n };\n }\n};\n\nconst getTypoStyles = (size: TooltipSize) => {\n switch (size) {\n case \"sm\":\n return { fontSize: 14, lineHeight: \"16px\" };\n case \"md\":\n return { fontSize: 16, lineHeight: \"18px\" };\n case \"lg\":\n return { fontSize: 18, lineHeight: \"20px\" };\n case \"xl\":\n return { fontSize: 20, lineHeight: \"22px\" };\n default:\n return { fontSize: 16, lineHeight: \"18px\" };\n }\n};\n\nconst getArrowStyles = (placement: TooltipPlacement) => {\n const base: React.CSSProperties = {\n width: ARROW_SIZE,\n height: ARROW_SIZE,\n transform: \"rotate(45deg)\",\n borderRadius: 1,\n };\n\n const placementStyles: Record<TooltipPlacement, React.CSSProperties> = {\n top: { bottom: -ARROW_HALF, left: \"50%\", marginLeft: -ARROW_HALF },\n \"top-left\": { bottom: -ARROW_HALF, right: ARROW_EDGE_OFFSET },\n \"top-right\": { bottom: -ARROW_HALF, left: ARROW_EDGE_OFFSET },\n\n bottom: { top: -ARROW_HALF, left: \"50%\", marginLeft: -ARROW_HALF },\n \"bottom-left\": { top: -ARROW_HALF, right: ARROW_EDGE_OFFSET },\n \"bottom-right\": { top: -ARROW_HALF, left: ARROW_EDGE_OFFSET },\n\n left: { right: -ARROW_HALF, top: \"50%\", marginTop: -ARROW_HALF },\n right: { left: -ARROW_HALF, top: \"50%\", marginTop: -ARROW_HALF },\n };\n\n return { ...base, ...placementStyles[placement] };\n};\n\nexport const Tooltip = forwardRef<\n HTMLDivElement,\n TooltipProps & ThemeOverrideProps\n>(\n (\n {\n content,\n children,\n size = \"md\",\n delayEnter = 0,\n delayLeave = 100,\n offset = 12,\n placement = \"top\",\n maxWidth,\n controlledVisible,\n style,\n \"data-testid\": dataTestId,\n className,\n testID,\n themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const [isHovered, setIsHovered] = useState(false);\n const [triggerRect, setTriggerRect] = useState<DOMRect | null>(null);\n const { theme: resolvedTheme } = useResolvedTheme({\n themeMode,\n themeProductContext,\n });\n const theme = resolvedTheme as TooltipTheme;\n const enterTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const leaveTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const rafRef = useRef<number | null>(null);\n const triggerRef = useRef<HTMLDivElement>(null);\n const tooltipId = useId();\n const modalId = useModalId();\n const overlayLayer = useOverlayLayer();\n\n const isVisible =\n controlledVisible !== undefined ? controlledVisible : isHovered;\n\n const clearPendingVisibilityUpdates = () => {\n if (enterTimeoutRef.current) {\n clearTimeout(enterTimeoutRef.current);\n enterTimeoutRef.current = null;\n }\n\n if (leaveTimeoutRef.current) {\n clearTimeout(leaveTimeoutRef.current);\n leaveTimeoutRef.current = null;\n }\n\n if (rafRef.current) {\n cancelAnimationFrame(rafRef.current);\n rafRef.current = null;\n }\n };\n\n const forceHideTooltip = () => {\n clearPendingVisibilityUpdates();\n setIsHovered(false);\n };\n\n const positionStyles = useMemo(\n () =>\n triggerRect\n ? getPositionStyles(triggerRect, placement, offset, isVisible)\n : { top: 0, left: 0 },\n [triggerRect, placement, offset, isVisible]\n );\n const typoStyles = useMemo(() => getTypoStyles(size), [size]);\n const borderRadius = (theme.shape.tooltip[size] ?? theme.shape.tooltip.md)\n .borderRadius;\n const arrowStyles = useMemo(() => getArrowStyles(placement), [placement]);\n\n // Update trigger position when tooltip becomes visible and on scroll/resize\n useEffect(() => {\n if (!isVisible || isNative) return;\n\n const updatePosition = () => {\n if (triggerRef.current) {\n setTriggerRect(triggerRef.current.getBoundingClientRect());\n }\n };\n\n updatePosition();\n\n window.addEventListener(\"scroll\", updatePosition, true);\n window.addEventListener(\"resize\", updatePosition);\n\n return () => {\n window.removeEventListener(\"scroll\", updatePosition, true);\n window.removeEventListener(\"resize\", updatePosition);\n };\n }, [isVisible]);\n\n const showTooltip = () => {\n clearPendingVisibilityUpdates();\n\n if (!isNative && typeof document !== \"undefined\") {\n document.dispatchEvent(\n new CustomEvent(TOOLTIP_OPEN_EVENT, { detail: { tooltipId } })\n );\n }\n\n // Update position before showing to prevent pop-in\n if (triggerRef.current) {\n setTriggerRect(triggerRef.current.getBoundingClientRect());\n\n // Double RAF to ensure position is rendered before showing tooltip\n rafRef.current = requestAnimationFrame(() => {\n rafRef.current = requestAnimationFrame(() => {\n if (delayEnter > 0) {\n enterTimeoutRef.current = setTimeout(() => {\n setIsHovered(true);\n }, delayEnter);\n } else {\n setIsHovered(true);\n }\n });\n });\n }\n };\n\n const showTooltipOnFocus = (event: React.FocusEvent<HTMLElement>) => {\n // Only reveal the tooltip on intentional keyboard focus. Focus that the\n // browser restores to the trigger when the tab/window regains focus — as\n // well as focus from a mouse click — must not re-trigger the tooltip\n // (FEP-832). `:focus-visible` encodes exactly this heuristic: it matches\n // for keyboard navigation but not for pointer-driven or restored focus.\n const target = event.target as HTMLElement | null;\n\n if (target && typeof target.matches === \"function\") {\n let isFocusVisible: boolean;\n try {\n isFocusVisible = target.matches(\":focus-visible\");\n } catch {\n // Legacy browsers without :focus-visible support — preserve the\n // previous behaviour of showing on any focus.\n isFocusVisible = true;\n }\n\n if (!isFocusVisible) return;\n }\n\n showTooltip();\n };\n\n const hideTooltip = () => {\n clearPendingVisibilityUpdates();\n\n if (delayLeave > 0) {\n leaveTimeoutRef.current = setTimeout(() => {\n setIsHovered(false);\n }, delayLeave);\n } else {\n setIsHovered(false);\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\" && isVisible) {\n forceHideTooltip();\n }\n };\n\n const handleVisibilityChange = () => {\n if (document.visibilityState === \"hidden\") {\n forceHideTooltip();\n }\n };\n\n const handleTooltipOpen = (event: Event) => {\n const { tooltipId: activeTooltipId } =\n (event as CustomEvent).detail ?? {};\n\n if (activeTooltipId !== tooltipId) {\n forceHideTooltip();\n }\n };\n\n document.addEventListener(\"keydown\", handleEscape);\n document.addEventListener(\"visibilitychange\", handleVisibilityChange);\n document.addEventListener(TOOLTIP_OPEN_EVENT, handleTooltipOpen);\n\n return () => {\n document.removeEventListener(\"keydown\", handleEscape);\n document.removeEventListener(\n \"visibilitychange\",\n handleVisibilityChange\n );\n document.removeEventListener(TOOLTIP_OPEN_EVENT, handleTooltipOpen);\n clearPendingVisibilityUpdates();\n };\n }, [isVisible, tooltipId]);\n\n return (\n <Box\n testID={testID}\n ref={triggerRef}\n position=\"relative\"\n display=\"inline-flex\"\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n onFocus={showTooltipOnFocus}\n onBlur={hideTooltip}\n className={className}\n style={{ height: \"fit-content\" }}\n aria-describedby={isVisible ? tooltipId : undefined}\n >\n {children}\n {!isNative && triggerRect && (\n <Portal>\n <Box\n ref={ref}\n data-testid={dataTestId}\n data-modal-id={modalId}\n position=\"fixed\"\n backgroundColor={theme.colors.layer.float}\n borderRadius={borderRadius}\n paddingVertical={8}\n paddingHorizontal={12}\n zIndex={overlayLayer + LAYER_OFFSET.tooltip}\n id={tooltipId}\n role=\"tooltip\"\n aria-hidden={!isVisible}\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n style={{\n ...positionStyles,\n // https://stackoverflow.com/questions/62844007/how-to-apply-tool-tip-arrow-triangle-shadow\n filter:\n \"drop-shadow(0 6px 10px rgba(7, 7, 8, 0.1)) drop-shadow(0 2px 3px rgba(7, 7, 8, 0.2))\",\n WebkitFilter:\n \"drop-shadow(0 6px 10px rgba(7, 7, 8, 0.1)) drop-shadow(0 2px 3px rgba(7, 7, 8, 0.2))\",\n opacity: isVisible ? 1 : 0,\n visibility: isVisible ? \"visible\" : \"hidden\",\n transition:\n \"opacity 150ms cubic-bezier(.4,0,.2,1), transform 150ms cubic-bezier(.4,0,.2,1), visibility 150ms cubic-bezier(.4,0,.2,1)\",\n pointerEvents: isVisible ? \"auto\" : \"none\",\n whiteSpace: \"normal\",\n width: \"max-content\",\n maxWidth: maxWidth ?? \"none\",\n overflow: \"visible\",\n willChange: isVisible ? \"transform, opacity\" : \"auto\", // optimize rendering and ensure more stable positioning\n ...style,\n }}\n >\n <Box\n position=\"absolute\"\n backgroundColor={theme.colors.layer.float}\n style={{\n ...arrowStyles,\n backfaceVisibility: \"hidden\",\n WebkitBackfaceVisibility: \"hidden\",\n }}\n />\n <Box\n style={{\n wordWrap: \"break-word\",\n overflowWrap: \"break-word\",\n maxWidth: \"100%\",\n whiteSpace: \"normal\",\n }}\n >\n {typeof content === \"string\" || typeof content === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={typoStyles.fontSize}\n fontWeight=\"400\"\n style={{\n lineHeight: typoStyles.lineHeight,\n whiteSpace: \"pre-line\",\n }}\n >\n {content}\n </Text>\n ) : (\n content\n )}\n </Box>\n </Box>\n </Portal>\n )}\n </Box>\n );\n }\n);\n\nTooltip.displayName = \"Tooltip\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n /* Only emit overflow-x/y when explicitly set. Defaulting them to\n visible after overflow would override the shorthand and break\n clipping (e.g. OtherCard bottom-right promo image). */\n overflow: ${(props) => props.overflow || \"visible\"};\n ${(props) =>\n props.overflowX != null ? `overflow-x: ${props.overflowX};` : \"\"}\n ${(props) =>\n props.overflowY != null ? `overflow-y: ${props.overflowY};` : \"\"}\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) =>\n props.opacity != null ? props.opacity : props.disabled ? 0.5 : 1};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n /* \\`background\\` is emitted before \\`background-color\\` so a caller passing\n both still gets backgroundColor as the winner. Use the shorthand for a\n layered fill (e.g. an overlay tint over a resting surface colour), which\n a single background-color cannot express. */\n &:hover {\n ${(props) =>\n props.hoverStyle?.background &&\n `background: ${props.hoverStyle.background};`}\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.background &&\n `background: ${props.pressStyle.background};`}\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n data-testid={dataTestId || testID}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"opacity\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n // Cross-platform layout prop that Text consumes as CSS, never as an\n // attribute. Pinned explicitly because it is now spread into the styled\n // component rather than destructured away before it can reach the DOM.\n \"numberOfLines\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\nimport { truncationStyles } from \"./textTruncation\";\n\nconst FilteredSpan = createFilteredElement(\"span\");\n\nconst StyledText = styled(FilteredSpan)<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n\n /* Keep last: single-line truncation has to win over white-space above. */\n ${(props) => truncationStyles(props.numberOfLines)}\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n data-testid={dataTestId || testID}\n />\n );\n};\n","/**\n * Web implementation of the cross-platform `numberOfLines` text prop.\n *\n * Native maps `numberOfLines` straight onto `RNText`. A web `<span>` has no\n * equivalent, so emit the CSS that produces the same result.\n *\n * Two details matter for the single-line case:\n * - `text-overflow` only takes effect on a block container, so the inline\n * `<span>` is promoted to `display: block` and capped at `max-width: 100%`.\n * - `min-width: 0` lets the text shrink below its own content width when it\n * sits in a flex row. Without it a `nowrap` label keeps its full intrinsic\n * width and pushes its siblings (icons, chevrons) out of a fixed-width field.\n *\n * Returns an empty string when there is nothing to clamp, so the declaration\n * block stays untouched for the majority of callers.\n */\nexport const truncationStyles = (numberOfLines?: number): string => {\n if (!numberOfLines || numberOfLines < 1) return \"\";\n\n if (numberOfLines === 1) {\n return `\n display: block;\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `;\n }\n\n return `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ${numberOfLines};\n line-clamp: ${numberOfLines};\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\n `;\n};\n","import { ReactNode, useEffect, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\n\ninterface PortalProps {\n children: ReactNode;\n}\n\nexport const Portal = ({ children }: PortalProps) => {\n const [mountNode, setMountNode] = useState<HTMLElement | null>(null);\n\n useEffect(() => setMountNode(document.body), []);\n\n if (!mountNode) {\n return null;\n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