@xsolla/xui-toggletip 0.64.0-pr77.1768548473 → 0.64.0-pr77.1768554224
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/native/index.d.mts +0 -3
- package/native/index.d.ts +0 -3
- package/native/index.js +2 -3
- package/native/index.js.map +1 -1
- package/native/index.mjs +2 -3
- package/native/index.mjs.map +1 -1
- package/package.json +4 -4
- package/web/index.d.mts +0 -3
- package/web/index.d.ts +0 -3
- package/web/index.js +2 -3
- package/web/index.js.map +1 -1
- package/web/index.mjs +2 -3
- package/web/index.mjs.map +1 -1
package/native/index.d.mts
CHANGED
package/native/index.d.ts
CHANGED
package/native/index.js
CHANGED
|
@@ -788,15 +788,14 @@ var Toggletip = (0, import_react5.forwardRef)(
|
|
|
788
788
|
"data-testid": dataTestId,
|
|
789
789
|
position: "absolute",
|
|
790
790
|
backgroundColor: theme.colors.background.primary,
|
|
791
|
-
borderRadius:
|
|
792
|
-
borderWidth: 1,
|
|
791
|
+
borderRadius: 4,
|
|
793
792
|
borderColor: theme.colors.border.secondary,
|
|
794
793
|
padding: 12,
|
|
795
794
|
width,
|
|
796
795
|
zIndex: 2e3,
|
|
797
796
|
style: {
|
|
798
797
|
...positionStyles,
|
|
799
|
-
boxShadow:
|
|
798
|
+
boxShadow: theme.shadow.popover
|
|
800
799
|
},
|
|
801
800
|
children: [
|
|
802
801
|
title && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box, { gap: 8, children: [
|
package/native/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/Toggletip.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/Spinner.tsx","../../../primitives-native/src/Icon.tsx","../../../primitives-native/src/Divider.tsx","../../../primitives-native/src/Input.tsx","../../../primitives-native/src/TextArea.tsx","../../src/useToggletip.ts"],"sourcesContent":["export * from \"./Toggletip\";\nexport * from \"./types\";\n","import React, { forwardRef, useState, useRef, useEffect, useMemo } from \"react\";\n// @ts-ignore - this will be resolved at build time\nimport { Box, Text, Divider } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, isNative } from \"@xsolla/xui-core\";\nimport { useToggletip } from \"./useToggletip\";\nimport type { ToggletipPlacement, ToggletipProps } from \"./types\";\n\nconst getPositionStyles = (placement: ToggletipPlacement, offset: number) => {\n switch (placement) {\n case \"bottom\":\n return {\n top: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n case \"bottom-left\":\n return { top: `calc(100% + ${offset}px)`, left: 0 };\n case \"bottom-right\":\n return { top: `calc(100% + ${offset}px)`, right: 0 };\n case \"top\":\n return {\n bottom: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n case \"top-left\":\n return { bottom: `calc(100% + ${offset}px)`, left: 0 };\n case \"top-right\":\n return { bottom: `calc(100% + ${offset}px)`, right: 0 };\n case \"left\":\n return {\n right: `calc(100% + ${offset}px)`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n };\n case \"right\":\n return {\n left: `calc(100% + ${offset}px)`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n };\n default:\n return {\n bottom: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n }\n};\n\nexport const Toggletip = forwardRef<any, ToggletipProps>(\n (\n {\n children,\n title,\n content,\n footer,\n width = \"288px\",\n direction = \"top\",\n autoDirection = true,\n offset = 12,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const [isOpen, setOpen] = useState(false);\n const containerRef = useRef<HTMLElement | null>(null);\n const { theme } = useDesignSystem();\n\n const { refs, direction: newDirection } = useToggletip({\n open: isOpen,\n direction,\n offset,\n autoDirection,\n });\n\n const toggleOpen = () => setOpen(!isOpen);\n\n useEffect(() => {\n if (!isOpen || isNative) return;\n\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n event.target instanceof Node &&\n !containerRef.current.contains(event.target)\n ) {\n setOpen(false);\n }\n };\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n setOpen(false);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"keydown\", handleEscape);\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"keydown\", handleEscape);\n };\n }, [isOpen]);\n\n const positionStyles = useMemo(\n () => getPositionStyles(newDirection, offset),\n [newDirection, offset]\n );\n\n return (\n <Box\n ref={(node: HTMLElement | null) => {\n containerRef.current = node;\n refs.setReference(node);\n }}\n display=\"inline-flex\"\n position=\"relative\"\n style={{ height: \"fit-content\" }}\n >\n <Box onPress={toggleOpen} style={{ cursor: \"pointer\" }}>\n {children}\n </Box>\n {isOpen && (\n <Box\n ref={refs.setFloating}\n data-testid={dataTestId}\n position=\"absolute\"\n backgroundColor={theme.colors.background.primary}\n borderRadius={theme.radius.card}\n borderWidth={1}\n borderColor={theme.colors.border.secondary}\n padding={12}\n width={width}\n zIndex={2000}\n style={{\n ...positionStyles,\n boxShadow: \"0 4px 12px rgba(0, 36, 77, 0.2)\",\n }}\n >\n {title && (\n <Box gap={8}>\n <Text\n color={theme.colors.content.primary}\n fontSize={24}\n lineHeight=\"28px\"\n fontWeight=\"500\"\n >\n {title}\n </Text>\n <Divider color={theme.colors.border.secondary} />\n </Box>\n )}\n {content && (\n <Box marginBottom={16} marginTop={16}>\n {typeof content === \"string\" || typeof content === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={14}\n fontWeight=\"400\"\n >\n {content}\n </Text>\n ) : (\n content\n )}\n </Box>\n )}\n {footer && (\n <Box\n marginTop={20}\n flexDirection=\"row\"\n justifyContent=\"flex-end\"\n gap={12}\n >\n {footer}\n </Box>\n )}\n </Box>\n )}\n </Box>\n );\n }\n);\n\nToggletip.displayName = \"Toggletip\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\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 alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\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 zIndex,\n height: height as DimensionValue,\n width: width 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 alignItems,\n justifyContent,\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 ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\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 className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\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 resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\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 {...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 {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport { Text as RNText, TextStyle, AccessibilityRole } from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web roles to React Native accessibility roles\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n id,\n role,\n ...props\n}) => {\n // Extract the first font name from a comma-separated list (e.g. for web-style font stacks)\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n // On native, if we don't have the custom font loaded, it's better to use the system font\n // to avoid rendering issues or missing text.\n if (resolvedFontFamily === \"Pilat Wide Bold\") {\n resolvedFontFamily = undefined;\n }\n\n const style: TextStyle = {\n 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 };\n\n // Map role to React Native accessibilityRole\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText style={style} testID={id} accessibilityRole={accessibilityRole}>\n {children}\n </RNText>\n );\n};\n","import type React from \"react\";\nimport { ActivityIndicator, View } from \"react-native\";\nimport type { SpinnerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Spinner: React.FC<SpinnerProps> = ({\n color,\n size,\n role,\n \"aria-label\": ariaLabel,\n \"aria-live\": ariaLive,\n \"aria-describedby\": ariaDescribedBy,\n testID,\n}) => {\n return (\n <View\n accessible={true}\n accessibilityRole={role === \"status\" ? \"none\" : undefined}\n accessibilityLabel={ariaLabel}\n accessibilityLiveRegion={\n ariaLive === \"polite\"\n ? \"polite\"\n : ariaLive === \"assertive\"\n ? \"assertive\"\n : \"none\"\n }\n testID={testID}\n >\n <ActivityIndicator\n color={color}\n size={typeof size === \"number\" ? size : \"small\"}\n />\n </View>\n );\n};\n\nSpinner.displayName = \"Spinner\";\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Icon: React.FC<IconProps> = ({ children, color, size }) => {\n const style: ViewStyle = {\n width: typeof size === \"number\" ? size : undefined,\n height: typeof size === \"number\" ? size : undefined,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n // On native, we try to pass the color down to children (like Text primitives)\n // to mimic the CSS inheritance behavior of the web version.\n const childrenWithProps = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n // @ts-ignore - passing color down to potential Text/Icon children\n return React.cloneElement(child, {\n color: child.props.color || color,\n // Also pass size if child seems to be an icon that needs it\n size: child.props.size || size,\n });\n }\n return child;\n });\n\n return <View style={style}>{childrenWithProps}</View>;\n};\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { DividerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Divider: React.FC<DividerProps> = ({\n color,\n height,\n width,\n vertical,\n dashStroke,\n}) => {\n const style: ViewStyle = {\n backgroundColor: dashStroke\n ? \"transparent\"\n : color || \"rgba(255, 255, 255, 0.15)\",\n width: vertical ? (typeof width === \"number\" ? width : 1) : \"100%\",\n height: vertical ? \"100%\" : typeof height === \"number\" ? height : 1,\n ...(dashStroke && {\n borderStyle: \"dashed\",\n borderColor: color || \"rgba(255, 255, 255, 0.15)\",\n borderWidth: 0,\n ...(vertical\n ? { borderLeftWidth: typeof width === \"number\" ? width : 1 }\n : { borderTopWidth: typeof height === \"number\" ? height : 1 }),\n }),\n };\n\n return <View style={style} />;\n};\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web input types to React Native keyboard types\nconst keyboardTypeMap: Record<string, any> = {\n text: \"default\",\n number: \"numeric\",\n email: \"email-address\",\n tel: \"phone-pad\",\n url: \"url\",\n decimal: \"decimal-pad\",\n};\n\n// Map web inputMode to React Native keyboard types\nconst inputModeToKeyboardType: Record<string, any> = {\n none: \"default\",\n text: \"default\",\n decimal: \"decimal-pad\",\n numeric: \"number-pad\",\n tel: \"phone-pad\",\n search: \"default\",\n email: \"email-address\",\n url: \"url\",\n};\n\n// Map web autoComplete to React Native textContentType (iOS)\nconst autoCompleteToTextContentType: Record<string, any> = {\n \"one-time-code\": \"oneTimeCode\",\n email: \"emailAddress\",\n username: \"username\",\n password: \"password\",\n \"new-password\": \"newPassword\",\n tel: \"telephoneNumber\",\n \"postal-code\": \"postalCode\",\n name: \"name\",\n};\n\nexport const InputPrimitive = forwardRef<RNTextInput, InputPrimitiveProps>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n secureTextEntry,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n name,\n type,\n inputMode,\n autoComplete,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n // Create a synthetic event for onChange compatibility\n // Include nativeEvent and no-op methods to prevent runtime errors\n // when consumers expect DOM-like event behavior\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLInputElement>;\n onChange(syntheticEvent);\n }\n };\n\n // Determine keyboard type - inputMode takes precedence over type\n const keyboardType = inputMode\n ? inputModeToKeyboardType[inputMode] || \"default\"\n : type\n ? keyboardTypeMap[type] || \"default\"\n : \"default\";\n\n // Determine textContentType for iOS autofill\n const textContentType = autoComplete\n ? autoCompleteToTextContentType[autoComplete]\n : undefined;\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n // Map onKeyPress to onKeyDown for cross-platform compatibility\n // Include preventDefault to avoid runtime errors when consumers call it\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n secureTextEntry={secureTextEntry || type === \"password\"}\n keyboardType={keyboardType}\n textContentType={textContentType}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n // React Native accessibility props\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nInputPrimitive.displayName = \"InputPrimitive\";\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { TextAreaPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nexport const TextAreaPrimitive = forwardRef<\n RNTextInput,\n TextAreaPrimitiveProps\n>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n rows,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLTextAreaElement>;\n onChange(syntheticEvent);\n }\n };\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n multiline={true}\n numberOfLines={rows || 4}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlignVertical: \"top\",\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nTextAreaPrimitive.displayName = \"TextAreaPrimitive\";\n","import { useState, useRef, useLayoutEffect, useCallback } from \"react\";\nimport type { ToggletipPlacement } from \"./types\";\n\ninterface UseToggletipOptions {\n open: boolean;\n direction: ToggletipPlacement;\n offset: number;\n autoDirection?: boolean;\n}\n\ninterface UseToggletipReturn {\n refs: {\n setReference: (node: HTMLElement | null) => void;\n setFloating: (node: HTMLElement | null) => void;\n };\n direction: ToggletipPlacement;\n}\n\nconst getScrollParent = (element: HTMLElement | null): HTMLElement => {\n if (!element || element === document.body) {\n return document.body;\n }\n\n const { overflow, overflowX, overflowY } = window.getComputedStyle(element);\n const scrollRegex = /(auto|scroll)/;\n const isScrollable =\n scrollRegex.test(overflow) ||\n scrollRegex.test(overflowX) ||\n scrollRegex.test(overflowY);\n\n if (\n isScrollable &&\n (element.scrollHeight > element.clientHeight ||\n element.scrollWidth > element.clientWidth)\n ) {\n return element;\n }\n\n return getScrollParent(element.parentElement);\n};\n\nconst getViewportBounds = (triggerElement: HTMLElement) => {\n const scrollParent = getScrollParent(triggerElement);\n\n if (scrollParent === document.body) {\n return {\n top: 0,\n left: 0,\n right: window.visualViewport?.width || window.innerWidth,\n bottom: window.visualViewport?.height || window.innerHeight,\n width: window.visualViewport?.width || window.innerWidth,\n height: window.visualViewport?.height || window.innerHeight,\n };\n }\n\n const rect = scrollParent.getBoundingClientRect();\n return {\n top: rect.top,\n left: rect.left,\n right: rect.right,\n bottom: rect.bottom,\n width: rect.width,\n height: rect.height,\n };\n};\n\nconst checkCollision = (\n triggerRect: DOMRect,\n toggletipRect: DOMRect,\n placement: ToggletipPlacement,\n offset: number,\n triggerElement: HTMLElement\n): ToggletipPlacement => {\n const viewport = getViewportBounds(triggerElement);\n const buffer = 10;\n\n const space = {\n top: triggerRect.top - viewport.top,\n bottom: viewport.bottom - triggerRect.bottom,\n left: triggerRect.left - viewport.left,\n right: viewport.right - triggerRect.right,\n };\n\n const centerY = triggerRect.top + triggerRect.height / 2;\n const centerX = triggerRect.left + triggerRect.width / 2;\n const halfWidth = toggletipRect.width / 2;\n const halfHeight = toggletipRect.height / 2;\n const minSpace = offset + buffer;\n\n const fits = {\n top:\n space.top >= toggletipRect.height + minSpace &&\n centerX - halfWidth >= viewport.left + buffer &&\n centerX + halfWidth <= viewport.right - buffer,\n bottom:\n space.bottom >= toggletipRect.height + minSpace &&\n centerX - halfWidth >= viewport.left + buffer &&\n centerX + halfWidth <= viewport.right - buffer,\n left:\n space.left >= toggletipRect.width + minSpace &&\n centerY - halfHeight >= viewport.top + buffer &&\n centerY + halfHeight <= viewport.bottom - buffer,\n right:\n space.right >= toggletipRect.width + minSpace &&\n centerY - halfHeight >= viewport.top + buffer &&\n centerY + halfHeight <= viewport.bottom - buffer,\n };\n\n const [primary, secondary] = placement.split(\"-\");\n\n // If current placement fits, keep it\n if (fits[primary as keyof typeof fits]) {\n return placement;\n }\n\n const opposites: Record<string, string> = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\",\n };\n\n const opposite = opposites[primary];\n if (opposite && fits[opposite as keyof typeof fits]) {\n return secondary\n ? (`${opposite}-${secondary}` as ToggletipPlacement)\n : (opposite as ToggletipPlacement);\n }\n\n const perpendicular =\n primary === \"top\" || primary === \"bottom\"\n ? [\"right\", \"left\"]\n : [\"bottom\", \"top\"];\n\n for (const dir of perpendicular) {\n if (fits[dir as keyof typeof fits]) {\n return dir as ToggletipPlacement;\n }\n }\n\n const best = Object.entries(space).sort(([, a], [, b]) => b - a)[0];\n return best[0] as ToggletipPlacement;\n};\n\nexport const useToggletip = ({\n open,\n direction,\n offset,\n autoDirection = true,\n}: UseToggletipOptions): UseToggletipReturn => {\n const [newDirection, setNewDirection] = useState(direction);\n const referenceRef = useRef<HTMLElement | null>(null);\n const floatingRef = useRef<HTMLElement | null>(null);\n\n const setReference = useCallback((node: HTMLElement | null) => {\n referenceRef.current = node;\n }, []);\n\n const setFloating = useCallback((node: HTMLElement | null) => {\n floatingRef.current = node;\n }, []);\n\n // Collision detection + continuous updates\n useLayoutEffect(() => {\n if (\n !open ||\n !autoDirection ||\n !referenceRef.current ||\n !floatingRef.current\n ) {\n return;\n }\n\n let rafId: number | null = null;\n\n const updatePlacement = () => {\n rafId = null;\n if (!referenceRef.current || !floatingRef.current) return;\n\n const triggerRect = referenceRef.current.getBoundingClientRect();\n const toggletipRect = floatingRef.current.getBoundingClientRect();\n const calculatedDirection = checkCollision(\n triggerRect,\n toggletipRect,\n direction,\n offset,\n referenceRef.current\n );\n\n setNewDirection((prev) =>\n prev === calculatedDirection ? prev : calculatedDirection\n );\n };\n\n const scheduleUpdate = () => {\n if (rafId != null) return;\n rafId = requestAnimationFrame(updatePlacement);\n };\n\n updatePlacement();\n\n // Attach scroll listener to the actual scroll parent for better performance\n const scrollParent = getScrollParent(referenceRef.current);\n const scrollTarget = scrollParent === document.body ? window : scrollParent;\n\n scrollTarget.addEventListener(\"scroll\", scheduleUpdate, {\n capture: true,\n passive: true,\n });\n window.addEventListener(\"resize\", scheduleUpdate);\n\n // Safe ResizeObserver usage for SSR compatibility\n let resizeObserver: ResizeObserver | null = null;\n if (typeof ResizeObserver !== \"undefined\") {\n resizeObserver = new ResizeObserver(scheduleUpdate);\n if (referenceRef.current) {\n resizeObserver.observe(referenceRef.current);\n }\n if (floatingRef.current) {\n resizeObserver.observe(floatingRef.current);\n }\n }\n\n return () => {\n if (rafId != null) cancelAnimationFrame(rafId);\n scrollTarget.removeEventListener(\"scroll\", scheduleUpdate, {\n capture: true,\n } as EventListenerOptions);\n window.removeEventListener(\"resize\", scheduleUpdate);\n if (resizeObserver) resizeObserver.disconnect();\n };\n }, [open, autoDirection, direction, offset]);\n\n // Reset direction when closed\n useLayoutEffect(() => {\n if (!open) {\n setNewDirection(direction);\n }\n }, [open, direction]);\n\n return {\n refs: {\n setReference,\n setFloating,\n },\n direction: newDirection,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAwE;;;ACCxE,0BAQO;AAmID;AAhIC,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;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,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,oBAAoB,CAAC,aAAkC;AAAA,IAC3D,iBACE,WAAW,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_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react","import_react_native","import_jsx_runtime","RNTextInput","import_react","import_react_native","import_jsx_runtime","RNTextInput","import_react","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../src/Toggletip.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/Spinner.tsx","../../../primitives-native/src/Icon.tsx","../../../primitives-native/src/Divider.tsx","../../../primitives-native/src/Input.tsx","../../../primitives-native/src/TextArea.tsx","../../src/useToggletip.ts"],"sourcesContent":["export * from \"./Toggletip\";\nexport * from \"./types\";\n","import React, { forwardRef, useState, useRef, useEffect, useMemo } from \"react\";\n// @ts-ignore - this will be resolved at build time\nimport { Box, Text, Divider } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, isNative } from \"@xsolla/xui-core\";\nimport { useToggletip } from \"./useToggletip\";\nimport type { ToggletipPlacement, ToggletipProps } from \"./types\";\n\nconst getPositionStyles = (placement: ToggletipPlacement, offset: number) => {\n switch (placement) {\n case \"bottom\":\n return {\n top: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n case \"bottom-left\":\n return { top: `calc(100% + ${offset}px)`, left: 0 };\n case \"bottom-right\":\n return { top: `calc(100% + ${offset}px)`, right: 0 };\n case \"top\":\n return {\n bottom: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n case \"top-left\":\n return { bottom: `calc(100% + ${offset}px)`, left: 0 };\n case \"top-right\":\n return { bottom: `calc(100% + ${offset}px)`, right: 0 };\n case \"left\":\n return {\n right: `calc(100% + ${offset}px)`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n };\n case \"right\":\n return {\n left: `calc(100% + ${offset}px)`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n };\n default:\n return {\n bottom: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n }\n};\n\nexport const Toggletip = forwardRef<any, ToggletipProps>(\n (\n {\n children,\n title,\n content,\n footer,\n width = \"288px\",\n direction = \"top\",\n autoDirection = true,\n offset = 12,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const [isOpen, setOpen] = useState(false);\n const containerRef = useRef<HTMLElement | null>(null);\n const { theme } = useDesignSystem();\n\n const { refs, direction: newDirection } = useToggletip({\n open: isOpen,\n direction,\n offset,\n autoDirection,\n });\n\n const toggleOpen = () => setOpen(!isOpen);\n\n useEffect(() => {\n if (!isOpen || isNative) return;\n\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n event.target instanceof Node &&\n !containerRef.current.contains(event.target)\n ) {\n setOpen(false);\n }\n };\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n setOpen(false);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"keydown\", handleEscape);\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"keydown\", handleEscape);\n };\n }, [isOpen]);\n\n const positionStyles = useMemo(\n () => getPositionStyles(newDirection, offset),\n [newDirection, offset]\n );\n\n return (\n <Box\n ref={(node: HTMLElement | null) => {\n containerRef.current = node;\n refs.setReference(node);\n }}\n display=\"inline-flex\"\n position=\"relative\"\n style={{ height: \"fit-content\" }}\n >\n <Box onPress={toggleOpen} style={{ cursor: \"pointer\" }}>\n {children}\n </Box>\n {isOpen && (\n <Box\n ref={refs.setFloating}\n data-testid={dataTestId}\n position=\"absolute\"\n backgroundColor={theme.colors.background.primary}\n borderRadius={4}\n borderColor={theme.colors.border.secondary}\n padding={12}\n width={width}\n zIndex={2000}\n style={{\n ...positionStyles,\n boxShadow: theme.shadow.popover,\n }}\n >\n {title && (\n <Box gap={8}>\n <Text\n color={theme.colors.content.primary}\n fontSize={24}\n lineHeight=\"28px\"\n fontWeight=\"500\"\n >\n {title}\n </Text>\n <Divider color={theme.colors.border.secondary} />\n </Box>\n )}\n {content && (\n <Box marginBottom={16} marginTop={16}>\n {typeof content === \"string\" || typeof content === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={14}\n fontWeight=\"400\"\n >\n {content}\n </Text>\n ) : (\n content\n )}\n </Box>\n )}\n {footer && (\n <Box\n marginTop={20}\n flexDirection=\"row\"\n justifyContent=\"flex-end\"\n gap={12}\n >\n {footer}\n </Box>\n )}\n </Box>\n )}\n </Box>\n );\n }\n);\n\nToggletip.displayName = \"Toggletip\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\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 alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\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 zIndex,\n height: height as DimensionValue,\n width: width 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 alignItems,\n justifyContent,\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 ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\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 className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\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 resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\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 {...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 {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport { Text as RNText, TextStyle, AccessibilityRole } from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web roles to React Native accessibility roles\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n id,\n role,\n ...props\n}) => {\n // Extract the first font name from a comma-separated list (e.g. for web-style font stacks)\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n // On native, if we don't have the custom font loaded, it's better to use the system font\n // to avoid rendering issues or missing text.\n if (resolvedFontFamily === \"Pilat Wide Bold\") {\n resolvedFontFamily = undefined;\n }\n\n const style: TextStyle = {\n 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 };\n\n // Map role to React Native accessibilityRole\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText style={style} testID={id} accessibilityRole={accessibilityRole}>\n {children}\n </RNText>\n );\n};\n","import type React from \"react\";\nimport { ActivityIndicator, View } from \"react-native\";\nimport type { SpinnerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Spinner: React.FC<SpinnerProps> = ({\n color,\n size,\n role,\n \"aria-label\": ariaLabel,\n \"aria-live\": ariaLive,\n \"aria-describedby\": ariaDescribedBy,\n testID,\n}) => {\n return (\n <View\n accessible={true}\n accessibilityRole={role === \"status\" ? \"none\" : undefined}\n accessibilityLabel={ariaLabel}\n accessibilityLiveRegion={\n ariaLive === \"polite\"\n ? \"polite\"\n : ariaLive === \"assertive\"\n ? \"assertive\"\n : \"none\"\n }\n testID={testID}\n >\n <ActivityIndicator\n color={color}\n size={typeof size === \"number\" ? size : \"small\"}\n />\n </View>\n );\n};\n\nSpinner.displayName = \"Spinner\";\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Icon: React.FC<IconProps> = ({ children, color, size }) => {\n const style: ViewStyle = {\n width: typeof size === \"number\" ? size : undefined,\n height: typeof size === \"number\" ? size : undefined,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n // On native, we try to pass the color down to children (like Text primitives)\n // to mimic the CSS inheritance behavior of the web version.\n const childrenWithProps = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n // @ts-ignore - passing color down to potential Text/Icon children\n return React.cloneElement(child, {\n color: child.props.color || color,\n // Also pass size if child seems to be an icon that needs it\n size: child.props.size || size,\n });\n }\n return child;\n });\n\n return <View style={style}>{childrenWithProps}</View>;\n};\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { DividerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Divider: React.FC<DividerProps> = ({\n color,\n height,\n width,\n vertical,\n dashStroke,\n}) => {\n const style: ViewStyle = {\n backgroundColor: dashStroke\n ? \"transparent\"\n : color || \"rgba(255, 255, 255, 0.15)\",\n width: vertical ? (typeof width === \"number\" ? width : 1) : \"100%\",\n height: vertical ? \"100%\" : typeof height === \"number\" ? height : 1,\n ...(dashStroke && {\n borderStyle: \"dashed\",\n borderColor: color || \"rgba(255, 255, 255, 0.15)\",\n borderWidth: 0,\n ...(vertical\n ? { borderLeftWidth: typeof width === \"number\" ? width : 1 }\n : { borderTopWidth: typeof height === \"number\" ? height : 1 }),\n }),\n };\n\n return <View style={style} />;\n};\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web input types to React Native keyboard types\nconst keyboardTypeMap: Record<string, any> = {\n text: \"default\",\n number: \"numeric\",\n email: \"email-address\",\n tel: \"phone-pad\",\n url: \"url\",\n decimal: \"decimal-pad\",\n};\n\n// Map web inputMode to React Native keyboard types\nconst inputModeToKeyboardType: Record<string, any> = {\n none: \"default\",\n text: \"default\",\n decimal: \"decimal-pad\",\n numeric: \"number-pad\",\n tel: \"phone-pad\",\n search: \"default\",\n email: \"email-address\",\n url: \"url\",\n};\n\n// Map web autoComplete to React Native textContentType (iOS)\nconst autoCompleteToTextContentType: Record<string, any> = {\n \"one-time-code\": \"oneTimeCode\",\n email: \"emailAddress\",\n username: \"username\",\n password: \"password\",\n \"new-password\": \"newPassword\",\n tel: \"telephoneNumber\",\n \"postal-code\": \"postalCode\",\n name: \"name\",\n};\n\nexport const InputPrimitive = forwardRef<RNTextInput, InputPrimitiveProps>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n secureTextEntry,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n name,\n type,\n inputMode,\n autoComplete,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n // Create a synthetic event for onChange compatibility\n // Include nativeEvent and no-op methods to prevent runtime errors\n // when consumers expect DOM-like event behavior\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLInputElement>;\n onChange(syntheticEvent);\n }\n };\n\n // Determine keyboard type - inputMode takes precedence over type\n const keyboardType = inputMode\n ? inputModeToKeyboardType[inputMode] || \"default\"\n : type\n ? keyboardTypeMap[type] || \"default\"\n : \"default\";\n\n // Determine textContentType for iOS autofill\n const textContentType = autoComplete\n ? autoCompleteToTextContentType[autoComplete]\n : undefined;\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n // Map onKeyPress to onKeyDown for cross-platform compatibility\n // Include preventDefault to avoid runtime errors when consumers call it\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n secureTextEntry={secureTextEntry || type === \"password\"}\n keyboardType={keyboardType}\n textContentType={textContentType}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n // React Native accessibility props\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nInputPrimitive.displayName = \"InputPrimitive\";\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { TextAreaPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nexport const TextAreaPrimitive = forwardRef<\n RNTextInput,\n TextAreaPrimitiveProps\n>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n rows,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLTextAreaElement>;\n onChange(syntheticEvent);\n }\n };\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n multiline={true}\n numberOfLines={rows || 4}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlignVertical: \"top\",\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nTextAreaPrimitive.displayName = \"TextAreaPrimitive\";\n","import { useState, useRef, useLayoutEffect, useCallback } from \"react\";\nimport type { ToggletipPlacement } from \"./types\";\n\ninterface UseToggletipOptions {\n open: boolean;\n direction: ToggletipPlacement;\n offset: number;\n autoDirection?: boolean;\n}\n\ninterface UseToggletipReturn {\n refs: {\n setReference: (node: HTMLElement | null) => void;\n setFloating: (node: HTMLElement | null) => void;\n };\n direction: ToggletipPlacement;\n}\n\nconst getScrollParent = (element: HTMLElement | null): HTMLElement => {\n if (!element || element === document.body) {\n return document.body;\n }\n\n const { overflow, overflowX, overflowY } = window.getComputedStyle(element);\n const scrollRegex = /(auto|scroll)/;\n const isScrollable =\n scrollRegex.test(overflow) ||\n scrollRegex.test(overflowX) ||\n scrollRegex.test(overflowY);\n\n if (\n isScrollable &&\n (element.scrollHeight > element.clientHeight ||\n element.scrollWidth > element.clientWidth)\n ) {\n return element;\n }\n\n return getScrollParent(element.parentElement);\n};\n\nconst getViewportBounds = (triggerElement: HTMLElement) => {\n const scrollParent = getScrollParent(triggerElement);\n\n if (scrollParent === document.body) {\n return {\n top: 0,\n left: 0,\n right: window.visualViewport?.width || window.innerWidth,\n bottom: window.visualViewport?.height || window.innerHeight,\n width: window.visualViewport?.width || window.innerWidth,\n height: window.visualViewport?.height || window.innerHeight,\n };\n }\n\n const rect = scrollParent.getBoundingClientRect();\n return {\n top: rect.top,\n left: rect.left,\n right: rect.right,\n bottom: rect.bottom,\n width: rect.width,\n height: rect.height,\n };\n};\n\nconst checkCollision = (\n triggerRect: DOMRect,\n toggletipRect: DOMRect,\n placement: ToggletipPlacement,\n offset: number,\n triggerElement: HTMLElement\n): ToggletipPlacement => {\n const viewport = getViewportBounds(triggerElement);\n const buffer = 10;\n\n const space = {\n top: triggerRect.top - viewport.top,\n bottom: viewport.bottom - triggerRect.bottom,\n left: triggerRect.left - viewport.left,\n right: viewport.right - triggerRect.right,\n };\n\n const centerY = triggerRect.top + triggerRect.height / 2;\n const centerX = triggerRect.left + triggerRect.width / 2;\n const halfWidth = toggletipRect.width / 2;\n const halfHeight = toggletipRect.height / 2;\n const minSpace = offset + buffer;\n\n const fits = {\n top:\n space.top >= toggletipRect.height + minSpace &&\n centerX - halfWidth >= viewport.left + buffer &&\n centerX + halfWidth <= viewport.right - buffer,\n bottom:\n space.bottom >= toggletipRect.height + minSpace &&\n centerX - halfWidth >= viewport.left + buffer &&\n centerX + halfWidth <= viewport.right - buffer,\n left:\n space.left >= toggletipRect.width + minSpace &&\n centerY - halfHeight >= viewport.top + buffer &&\n centerY + halfHeight <= viewport.bottom - buffer,\n right:\n space.right >= toggletipRect.width + minSpace &&\n centerY - halfHeight >= viewport.top + buffer &&\n centerY + halfHeight <= viewport.bottom - buffer,\n };\n\n const [primary, secondary] = placement.split(\"-\");\n\n // If current placement fits, keep it\n if (fits[primary as keyof typeof fits]) {\n return placement;\n }\n\n const opposites: Record<string, string> = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\",\n };\n\n const opposite = opposites[primary];\n if (opposite && fits[opposite as keyof typeof fits]) {\n return secondary\n ? (`${opposite}-${secondary}` as ToggletipPlacement)\n : (opposite as ToggletipPlacement);\n }\n\n const perpendicular =\n primary === \"top\" || primary === \"bottom\"\n ? [\"right\", \"left\"]\n : [\"bottom\", \"top\"];\n\n for (const dir of perpendicular) {\n if (fits[dir as keyof typeof fits]) {\n return dir as ToggletipPlacement;\n }\n }\n\n const best = Object.entries(space).sort(([, a], [, b]) => b - a)[0];\n return best[0] as ToggletipPlacement;\n};\n\nexport const useToggletip = ({\n open,\n direction,\n offset,\n autoDirection = true,\n}: UseToggletipOptions): UseToggletipReturn => {\n const [newDirection, setNewDirection] = useState(direction);\n const referenceRef = useRef<HTMLElement | null>(null);\n const floatingRef = useRef<HTMLElement | null>(null);\n\n const setReference = useCallback((node: HTMLElement | null) => {\n referenceRef.current = node;\n }, []);\n\n const setFloating = useCallback((node: HTMLElement | null) => {\n floatingRef.current = node;\n }, []);\n\n // Collision detection + continuous updates\n useLayoutEffect(() => {\n if (\n !open ||\n !autoDirection ||\n !referenceRef.current ||\n !floatingRef.current\n ) {\n return;\n }\n\n let rafId: number | null = null;\n\n const updatePlacement = () => {\n rafId = null;\n if (!referenceRef.current || !floatingRef.current) return;\n\n const triggerRect = referenceRef.current.getBoundingClientRect();\n const toggletipRect = floatingRef.current.getBoundingClientRect();\n const calculatedDirection = checkCollision(\n triggerRect,\n toggletipRect,\n direction,\n offset,\n referenceRef.current\n );\n\n setNewDirection((prev) =>\n prev === calculatedDirection ? prev : calculatedDirection\n );\n };\n\n const scheduleUpdate = () => {\n if (rafId != null) return;\n rafId = requestAnimationFrame(updatePlacement);\n };\n\n updatePlacement();\n\n // Attach scroll listener to the actual scroll parent for better performance\n const scrollParent = getScrollParent(referenceRef.current);\n const scrollTarget = scrollParent === document.body ? window : scrollParent;\n\n scrollTarget.addEventListener(\"scroll\", scheduleUpdate, {\n capture: true,\n passive: true,\n });\n window.addEventListener(\"resize\", scheduleUpdate);\n\n // Safe ResizeObserver usage for SSR compatibility\n let resizeObserver: ResizeObserver | null = null;\n if (typeof ResizeObserver !== \"undefined\") {\n resizeObserver = new ResizeObserver(scheduleUpdate);\n if (referenceRef.current) {\n resizeObserver.observe(referenceRef.current);\n }\n if (floatingRef.current) {\n resizeObserver.observe(floatingRef.current);\n }\n }\n\n return () => {\n if (rafId != null) cancelAnimationFrame(rafId);\n scrollTarget.removeEventListener(\"scroll\", scheduleUpdate, {\n capture: true,\n } as EventListenerOptions);\n window.removeEventListener(\"resize\", scheduleUpdate);\n if (resizeObserver) resizeObserver.disconnect();\n };\n }, [open, autoDirection, direction, offset]);\n\n // Reset direction when closed\n useLayoutEffect(() => {\n if (!open) {\n setNewDirection(direction);\n }\n }, [open, direction]);\n\n return {\n refs: {\n setReference,\n setFloating,\n },\n direction: newDirection,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAwE;;;ACCxE,0BAQO;AAmID;AAhIC,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;AAAA,EACA;AAAA,EACA;AAA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AAA,oBACV,YAAW;AAAA,oBAEV;AAAA;AAAA,gBACH,IAEA,SAEJ;AAAA,gBAED,UACC;AAAA,kBAAC;AAAA;AAAA,oBACC,WAAW;AAAA,oBACX,eAAc;AAAA,oBACd,gBAAe;AAAA,oBACf,KAAK;AAAA,oBAEJ;AAAA;AAAA,gBACH;AAAA;AAAA;AAAA,UAEJ;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,UAAU,cAAc;","names":["import_react","import_react_native","import_jsx_runtime","RNText","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react_native","import_jsx_runtime","import_react","import_react_native","import_jsx_runtime","RNTextInput","import_react","import_react_native","import_jsx_runtime","RNTextInput","import_react","import_jsx_runtime"]}
|
package/native/index.mjs
CHANGED
|
@@ -756,15 +756,14 @@ var Toggletip = forwardRef3(
|
|
|
756
756
|
"data-testid": dataTestId,
|
|
757
757
|
position: "absolute",
|
|
758
758
|
backgroundColor: theme.colors.background.primary,
|
|
759
|
-
borderRadius:
|
|
760
|
-
borderWidth: 1,
|
|
759
|
+
borderRadius: 4,
|
|
761
760
|
borderColor: theme.colors.border.secondary,
|
|
762
761
|
padding: 12,
|
|
763
762
|
width,
|
|
764
763
|
zIndex: 2e3,
|
|
765
764
|
style: {
|
|
766
765
|
...positionStyles,
|
|
767
|
-
boxShadow:
|
|
766
|
+
boxShadow: theme.shadow.popover
|
|
768
767
|
},
|
|
769
768
|
children: [
|
|
770
769
|
title && /* @__PURE__ */ jsxs(Box, { gap: 8, children: [
|
package/native/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Toggletip.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/Spinner.tsx","../../../primitives-native/src/Icon.tsx","../../../primitives-native/src/Divider.tsx","../../../primitives-native/src/Input.tsx","../../../primitives-native/src/TextArea.tsx","../../src/useToggletip.ts"],"sourcesContent":["import React, { forwardRef, useState, useRef, useEffect, useMemo } from \"react\";\n// @ts-ignore - this will be resolved at build time\nimport { Box, Text, Divider } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, isNative } from \"@xsolla/xui-core\";\nimport { useToggletip } from \"./useToggletip\";\nimport type { ToggletipPlacement, ToggletipProps } from \"./types\";\n\nconst getPositionStyles = (placement: ToggletipPlacement, offset: number) => {\n switch (placement) {\n case \"bottom\":\n return {\n top: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n case \"bottom-left\":\n return { top: `calc(100% + ${offset}px)`, left: 0 };\n case \"bottom-right\":\n return { top: `calc(100% + ${offset}px)`, right: 0 };\n case \"top\":\n return {\n bottom: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n case \"top-left\":\n return { bottom: `calc(100% + ${offset}px)`, left: 0 };\n case \"top-right\":\n return { bottom: `calc(100% + ${offset}px)`, right: 0 };\n case \"left\":\n return {\n right: `calc(100% + ${offset}px)`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n };\n case \"right\":\n return {\n left: `calc(100% + ${offset}px)`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n };\n default:\n return {\n bottom: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n }\n};\n\nexport const Toggletip = forwardRef<any, ToggletipProps>(\n (\n {\n children,\n title,\n content,\n footer,\n width = \"288px\",\n direction = \"top\",\n autoDirection = true,\n offset = 12,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const [isOpen, setOpen] = useState(false);\n const containerRef = useRef<HTMLElement | null>(null);\n const { theme } = useDesignSystem();\n\n const { refs, direction: newDirection } = useToggletip({\n open: isOpen,\n direction,\n offset,\n autoDirection,\n });\n\n const toggleOpen = () => setOpen(!isOpen);\n\n useEffect(() => {\n if (!isOpen || isNative) return;\n\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n event.target instanceof Node &&\n !containerRef.current.contains(event.target)\n ) {\n setOpen(false);\n }\n };\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n setOpen(false);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"keydown\", handleEscape);\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"keydown\", handleEscape);\n };\n }, [isOpen]);\n\n const positionStyles = useMemo(\n () => getPositionStyles(newDirection, offset),\n [newDirection, offset]\n );\n\n return (\n <Box\n ref={(node: HTMLElement | null) => {\n containerRef.current = node;\n refs.setReference(node);\n }}\n display=\"inline-flex\"\n position=\"relative\"\n style={{ height: \"fit-content\" }}\n >\n <Box onPress={toggleOpen} style={{ cursor: \"pointer\" }}>\n {children}\n </Box>\n {isOpen && (\n <Box\n ref={refs.setFloating}\n data-testid={dataTestId}\n position=\"absolute\"\n backgroundColor={theme.colors.background.primary}\n borderRadius={theme.radius.card}\n borderWidth={1}\n borderColor={theme.colors.border.secondary}\n padding={12}\n width={width}\n zIndex={2000}\n style={{\n ...positionStyles,\n boxShadow: \"0 4px 12px rgba(0, 36, 77, 0.2)\",\n }}\n >\n {title && (\n <Box gap={8}>\n <Text\n color={theme.colors.content.primary}\n fontSize={24}\n lineHeight=\"28px\"\n fontWeight=\"500\"\n >\n {title}\n </Text>\n <Divider color={theme.colors.border.secondary} />\n </Box>\n )}\n {content && (\n <Box marginBottom={16} marginTop={16}>\n {typeof content === \"string\" || typeof content === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={14}\n fontWeight=\"400\"\n >\n {content}\n </Text>\n ) : (\n content\n )}\n </Box>\n )}\n {footer && (\n <Box\n marginTop={20}\n flexDirection=\"row\"\n justifyContent=\"flex-end\"\n gap={12}\n >\n {footer}\n </Box>\n )}\n </Box>\n )}\n </Box>\n );\n }\n);\n\nToggletip.displayName = \"Toggletip\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\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 alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\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 zIndex,\n height: height as DimensionValue,\n width: width 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 alignItems,\n justifyContent,\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 ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\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 className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\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 resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\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 {...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 {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport { Text as RNText, TextStyle, AccessibilityRole } from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web roles to React Native accessibility roles\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n id,\n role,\n ...props\n}) => {\n // Extract the first font name from a comma-separated list (e.g. for web-style font stacks)\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n // On native, if we don't have the custom font loaded, it's better to use the system font\n // to avoid rendering issues or missing text.\n if (resolvedFontFamily === \"Pilat Wide Bold\") {\n resolvedFontFamily = undefined;\n }\n\n const style: TextStyle = {\n 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 };\n\n // Map role to React Native accessibilityRole\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText style={style} testID={id} accessibilityRole={accessibilityRole}>\n {children}\n </RNText>\n );\n};\n","import type React from \"react\";\nimport { ActivityIndicator, View } from \"react-native\";\nimport type { SpinnerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Spinner: React.FC<SpinnerProps> = ({\n color,\n size,\n role,\n \"aria-label\": ariaLabel,\n \"aria-live\": ariaLive,\n \"aria-describedby\": ariaDescribedBy,\n testID,\n}) => {\n return (\n <View\n accessible={true}\n accessibilityRole={role === \"status\" ? \"none\" : undefined}\n accessibilityLabel={ariaLabel}\n accessibilityLiveRegion={\n ariaLive === \"polite\"\n ? \"polite\"\n : ariaLive === \"assertive\"\n ? \"assertive\"\n : \"none\"\n }\n testID={testID}\n >\n <ActivityIndicator\n color={color}\n size={typeof size === \"number\" ? size : \"small\"}\n />\n </View>\n );\n};\n\nSpinner.displayName = \"Spinner\";\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Icon: React.FC<IconProps> = ({ children, color, size }) => {\n const style: ViewStyle = {\n width: typeof size === \"number\" ? size : undefined,\n height: typeof size === \"number\" ? size : undefined,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n // On native, we try to pass the color down to children (like Text primitives)\n // to mimic the CSS inheritance behavior of the web version.\n const childrenWithProps = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n // @ts-ignore - passing color down to potential Text/Icon children\n return React.cloneElement(child, {\n color: child.props.color || color,\n // Also pass size if child seems to be an icon that needs it\n size: child.props.size || size,\n });\n }\n return child;\n });\n\n return <View style={style}>{childrenWithProps}</View>;\n};\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { DividerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Divider: React.FC<DividerProps> = ({\n color,\n height,\n width,\n vertical,\n dashStroke,\n}) => {\n const style: ViewStyle = {\n backgroundColor: dashStroke\n ? \"transparent\"\n : color || \"rgba(255, 255, 255, 0.15)\",\n width: vertical ? (typeof width === \"number\" ? width : 1) : \"100%\",\n height: vertical ? \"100%\" : typeof height === \"number\" ? height : 1,\n ...(dashStroke && {\n borderStyle: \"dashed\",\n borderColor: color || \"rgba(255, 255, 255, 0.15)\",\n borderWidth: 0,\n ...(vertical\n ? { borderLeftWidth: typeof width === \"number\" ? width : 1 }\n : { borderTopWidth: typeof height === \"number\" ? height : 1 }),\n }),\n };\n\n return <View style={style} />;\n};\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web input types to React Native keyboard types\nconst keyboardTypeMap: Record<string, any> = {\n text: \"default\",\n number: \"numeric\",\n email: \"email-address\",\n tel: \"phone-pad\",\n url: \"url\",\n decimal: \"decimal-pad\",\n};\n\n// Map web inputMode to React Native keyboard types\nconst inputModeToKeyboardType: Record<string, any> = {\n none: \"default\",\n text: \"default\",\n decimal: \"decimal-pad\",\n numeric: \"number-pad\",\n tel: \"phone-pad\",\n search: \"default\",\n email: \"email-address\",\n url: \"url\",\n};\n\n// Map web autoComplete to React Native textContentType (iOS)\nconst autoCompleteToTextContentType: Record<string, any> = {\n \"one-time-code\": \"oneTimeCode\",\n email: \"emailAddress\",\n username: \"username\",\n password: \"password\",\n \"new-password\": \"newPassword\",\n tel: \"telephoneNumber\",\n \"postal-code\": \"postalCode\",\n name: \"name\",\n};\n\nexport const InputPrimitive = forwardRef<RNTextInput, InputPrimitiveProps>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n secureTextEntry,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n name,\n type,\n inputMode,\n autoComplete,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n // Create a synthetic event for onChange compatibility\n // Include nativeEvent and no-op methods to prevent runtime errors\n // when consumers expect DOM-like event behavior\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLInputElement>;\n onChange(syntheticEvent);\n }\n };\n\n // Determine keyboard type - inputMode takes precedence over type\n const keyboardType = inputMode\n ? inputModeToKeyboardType[inputMode] || \"default\"\n : type\n ? keyboardTypeMap[type] || \"default\"\n : \"default\";\n\n // Determine textContentType for iOS autofill\n const textContentType = autoComplete\n ? autoCompleteToTextContentType[autoComplete]\n : undefined;\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n // Map onKeyPress to onKeyDown for cross-platform compatibility\n // Include preventDefault to avoid runtime errors when consumers call it\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n secureTextEntry={secureTextEntry || type === \"password\"}\n keyboardType={keyboardType}\n textContentType={textContentType}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n // React Native accessibility props\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nInputPrimitive.displayName = \"InputPrimitive\";\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { TextAreaPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nexport const TextAreaPrimitive = forwardRef<\n RNTextInput,\n TextAreaPrimitiveProps\n>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n rows,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLTextAreaElement>;\n onChange(syntheticEvent);\n }\n };\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n multiline={true}\n numberOfLines={rows || 4}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlignVertical: \"top\",\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nTextAreaPrimitive.displayName = \"TextAreaPrimitive\";\n","import { useState, useRef, useLayoutEffect, useCallback } from \"react\";\nimport type { ToggletipPlacement } from \"./types\";\n\ninterface UseToggletipOptions {\n open: boolean;\n direction: ToggletipPlacement;\n offset: number;\n autoDirection?: boolean;\n}\n\ninterface UseToggletipReturn {\n refs: {\n setReference: (node: HTMLElement | null) => void;\n setFloating: (node: HTMLElement | null) => void;\n };\n direction: ToggletipPlacement;\n}\n\nconst getScrollParent = (element: HTMLElement | null): HTMLElement => {\n if (!element || element === document.body) {\n return document.body;\n }\n\n const { overflow, overflowX, overflowY } = window.getComputedStyle(element);\n const scrollRegex = /(auto|scroll)/;\n const isScrollable =\n scrollRegex.test(overflow) ||\n scrollRegex.test(overflowX) ||\n scrollRegex.test(overflowY);\n\n if (\n isScrollable &&\n (element.scrollHeight > element.clientHeight ||\n element.scrollWidth > element.clientWidth)\n ) {\n return element;\n }\n\n return getScrollParent(element.parentElement);\n};\n\nconst getViewportBounds = (triggerElement: HTMLElement) => {\n const scrollParent = getScrollParent(triggerElement);\n\n if (scrollParent === document.body) {\n return {\n top: 0,\n left: 0,\n right: window.visualViewport?.width || window.innerWidth,\n bottom: window.visualViewport?.height || window.innerHeight,\n width: window.visualViewport?.width || window.innerWidth,\n height: window.visualViewport?.height || window.innerHeight,\n };\n }\n\n const rect = scrollParent.getBoundingClientRect();\n return {\n top: rect.top,\n left: rect.left,\n right: rect.right,\n bottom: rect.bottom,\n width: rect.width,\n height: rect.height,\n };\n};\n\nconst checkCollision = (\n triggerRect: DOMRect,\n toggletipRect: DOMRect,\n placement: ToggletipPlacement,\n offset: number,\n triggerElement: HTMLElement\n): ToggletipPlacement => {\n const viewport = getViewportBounds(triggerElement);\n const buffer = 10;\n\n const space = {\n top: triggerRect.top - viewport.top,\n bottom: viewport.bottom - triggerRect.bottom,\n left: triggerRect.left - viewport.left,\n right: viewport.right - triggerRect.right,\n };\n\n const centerY = triggerRect.top + triggerRect.height / 2;\n const centerX = triggerRect.left + triggerRect.width / 2;\n const halfWidth = toggletipRect.width / 2;\n const halfHeight = toggletipRect.height / 2;\n const minSpace = offset + buffer;\n\n const fits = {\n top:\n space.top >= toggletipRect.height + minSpace &&\n centerX - halfWidth >= viewport.left + buffer &&\n centerX + halfWidth <= viewport.right - buffer,\n bottom:\n space.bottom >= toggletipRect.height + minSpace &&\n centerX - halfWidth >= viewport.left + buffer &&\n centerX + halfWidth <= viewport.right - buffer,\n left:\n space.left >= toggletipRect.width + minSpace &&\n centerY - halfHeight >= viewport.top + buffer &&\n centerY + halfHeight <= viewport.bottom - buffer,\n right:\n space.right >= toggletipRect.width + minSpace &&\n centerY - halfHeight >= viewport.top + buffer &&\n centerY + halfHeight <= viewport.bottom - buffer,\n };\n\n const [primary, secondary] = placement.split(\"-\");\n\n // If current placement fits, keep it\n if (fits[primary as keyof typeof fits]) {\n return placement;\n }\n\n const opposites: Record<string, string> = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\",\n };\n\n const opposite = opposites[primary];\n if (opposite && fits[opposite as keyof typeof fits]) {\n return secondary\n ? (`${opposite}-${secondary}` as ToggletipPlacement)\n : (opposite as ToggletipPlacement);\n }\n\n const perpendicular =\n primary === \"top\" || primary === \"bottom\"\n ? [\"right\", \"left\"]\n : [\"bottom\", \"top\"];\n\n for (const dir of perpendicular) {\n if (fits[dir as keyof typeof fits]) {\n return dir as ToggletipPlacement;\n }\n }\n\n const best = Object.entries(space).sort(([, a], [, b]) => b - a)[0];\n return best[0] as ToggletipPlacement;\n};\n\nexport const useToggletip = ({\n open,\n direction,\n offset,\n autoDirection = true,\n}: UseToggletipOptions): UseToggletipReturn => {\n const [newDirection, setNewDirection] = useState(direction);\n const referenceRef = useRef<HTMLElement | null>(null);\n const floatingRef = useRef<HTMLElement | null>(null);\n\n const setReference = useCallback((node: HTMLElement | null) => {\n referenceRef.current = node;\n }, []);\n\n const setFloating = useCallback((node: HTMLElement | null) => {\n floatingRef.current = node;\n }, []);\n\n // Collision detection + continuous updates\n useLayoutEffect(() => {\n if (\n !open ||\n !autoDirection ||\n !referenceRef.current ||\n !floatingRef.current\n ) {\n return;\n }\n\n let rafId: number | null = null;\n\n const updatePlacement = () => {\n rafId = null;\n if (!referenceRef.current || !floatingRef.current) return;\n\n const triggerRect = referenceRef.current.getBoundingClientRect();\n const toggletipRect = floatingRef.current.getBoundingClientRect();\n const calculatedDirection = checkCollision(\n triggerRect,\n toggletipRect,\n direction,\n offset,\n referenceRef.current\n );\n\n setNewDirection((prev) =>\n prev === calculatedDirection ? prev : calculatedDirection\n );\n };\n\n const scheduleUpdate = () => {\n if (rafId != null) return;\n rafId = requestAnimationFrame(updatePlacement);\n };\n\n updatePlacement();\n\n // Attach scroll listener to the actual scroll parent for better performance\n const scrollParent = getScrollParent(referenceRef.current);\n const scrollTarget = scrollParent === document.body ? window : scrollParent;\n\n scrollTarget.addEventListener(\"scroll\", scheduleUpdate, {\n capture: true,\n passive: true,\n });\n window.addEventListener(\"resize\", scheduleUpdate);\n\n // Safe ResizeObserver usage for SSR compatibility\n let resizeObserver: ResizeObserver | null = null;\n if (typeof ResizeObserver !== \"undefined\") {\n resizeObserver = new ResizeObserver(scheduleUpdate);\n if (referenceRef.current) {\n resizeObserver.observe(referenceRef.current);\n }\n if (floatingRef.current) {\n resizeObserver.observe(floatingRef.current);\n }\n }\n\n return () => {\n if (rafId != null) cancelAnimationFrame(rafId);\n scrollTarget.removeEventListener(\"scroll\", scheduleUpdate, {\n capture: true,\n } as EventListenerOptions);\n window.removeEventListener(\"resize\", scheduleUpdate);\n if (resizeObserver) resizeObserver.disconnect();\n };\n }, [open, autoDirection, direction, offset]);\n\n // Reset direction when closed\n useLayoutEffect(() => {\n if (!open) {\n setNewDirection(direction);\n }\n }, [open, direction]);\n\n return {\n refs: {\n setReference,\n setFloating,\n },\n direction: newDirection,\n };\n};\n"],"mappings":";AAAA,SAAgB,cAAAA,aAAY,YAAAC,WAAU,UAAAC,SAAQ,WAAW,eAAe;;;ACCxE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAmID;AAhIC,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;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,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,oBAAoB,CAAC,aAAkC;AAAA,IAC3D,iBACE,WAAW,YAAY,kBACnB,W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H;AAAA;AAAA;AAAA,UAEJ;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,UAAU,cAAc;","names":["forwardRef","useState","useRef","jsx","View","jsx","View","jsx","View","jsx","jsx","forwardRef","RNTextInput","jsx","jsx","forwardRef","useState","useRef"]}
|
|
1
|
+
{"version":3,"sources":["../../src/Toggletip.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx","../../../primitives-native/src/Spinner.tsx","../../../primitives-native/src/Icon.tsx","../../../primitives-native/src/Divider.tsx","../../../primitives-native/src/Input.tsx","../../../primitives-native/src/TextArea.tsx","../../src/useToggletip.ts"],"sourcesContent":["import React, { forwardRef, useState, useRef, useEffect, useMemo } from \"react\";\n// @ts-ignore - this will be resolved at build time\nimport { Box, Text, Divider } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, isNative } from \"@xsolla/xui-core\";\nimport { useToggletip } from \"./useToggletip\";\nimport type { ToggletipPlacement, ToggletipProps } from \"./types\";\n\nconst getPositionStyles = (placement: ToggletipPlacement, offset: number) => {\n switch (placement) {\n case \"bottom\":\n return {\n top: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n case \"bottom-left\":\n return { top: `calc(100% + ${offset}px)`, left: 0 };\n case \"bottom-right\":\n return { top: `calc(100% + ${offset}px)`, right: 0 };\n case \"top\":\n return {\n bottom: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n case \"top-left\":\n return { bottom: `calc(100% + ${offset}px)`, left: 0 };\n case \"top-right\":\n return { bottom: `calc(100% + ${offset}px)`, right: 0 };\n case \"left\":\n return {\n right: `calc(100% + ${offset}px)`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n };\n case \"right\":\n return {\n left: `calc(100% + ${offset}px)`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n };\n default:\n return {\n bottom: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n }\n};\n\nexport const Toggletip = forwardRef<any, ToggletipProps>(\n (\n {\n children,\n title,\n content,\n footer,\n width = \"288px\",\n direction = \"top\",\n autoDirection = true,\n offset = 12,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const [isOpen, setOpen] = useState(false);\n const containerRef = useRef<HTMLElement | null>(null);\n const { theme } = useDesignSystem();\n\n const { refs, direction: newDirection } = useToggletip({\n open: isOpen,\n direction,\n offset,\n autoDirection,\n });\n\n const toggleOpen = () => setOpen(!isOpen);\n\n useEffect(() => {\n if (!isOpen || isNative) return;\n\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n event.target instanceof Node &&\n !containerRef.current.contains(event.target)\n ) {\n setOpen(false);\n }\n };\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n setOpen(false);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"keydown\", handleEscape);\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"keydown\", handleEscape);\n };\n }, [isOpen]);\n\n const positionStyles = useMemo(\n () => getPositionStyles(newDirection, offset),\n [newDirection, offset]\n );\n\n return (\n <Box\n ref={(node: HTMLElement | null) => {\n containerRef.current = node;\n refs.setReference(node);\n }}\n display=\"inline-flex\"\n position=\"relative\"\n style={{ height: \"fit-content\" }}\n >\n <Box onPress={toggleOpen} style={{ cursor: \"pointer\" }}>\n {children}\n </Box>\n {isOpen && (\n <Box\n ref={refs.setFloating}\n data-testid={dataTestId}\n position=\"absolute\"\n backgroundColor={theme.colors.background.primary}\n borderRadius={4}\n borderColor={theme.colors.border.secondary}\n padding={12}\n width={width}\n zIndex={2000}\n style={{\n ...positionStyles,\n boxShadow: theme.shadow.popover,\n }}\n >\n {title && (\n <Box gap={8}>\n <Text\n color={theme.colors.content.primary}\n fontSize={24}\n lineHeight=\"28px\"\n fontWeight=\"500\"\n >\n {title}\n </Text>\n <Divider color={theme.colors.border.secondary} />\n </Box>\n )}\n {content && (\n <Box marginBottom={16} marginTop={16}>\n {typeof content === \"string\" || typeof content === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={14}\n fontWeight=\"400\"\n >\n {content}\n </Text>\n ) : (\n content\n )}\n </Box>\n )}\n {footer && (\n <Box\n marginTop={20}\n flexDirection=\"row\"\n justifyContent=\"flex-end\"\n gap={12}\n >\n {footer}\n </Box>\n )}\n </Box>\n )}\n </Box>\n );\n }\n);\n\nToggletip.displayName = \"Toggletip\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\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 alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\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 zIndex,\n height: height as DimensionValue,\n width: width 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 alignItems,\n justifyContent,\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 ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\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 className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\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 resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\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 {...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 {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport { Text as RNText, TextStyle, AccessibilityRole } from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web roles to React Native accessibility roles\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n id,\n role,\n ...props\n}) => {\n // Extract the first font name from a comma-separated list (e.g. for web-style font stacks)\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n // On native, if we don't have the custom font loaded, it's better to use the system font\n // to avoid rendering issues or missing text.\n if (resolvedFontFamily === \"Pilat Wide Bold\") {\n resolvedFontFamily = undefined;\n }\n\n const style: TextStyle = {\n 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 };\n\n // Map role to React Native accessibilityRole\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText style={style} testID={id} accessibilityRole={accessibilityRole}>\n {children}\n </RNText>\n );\n};\n","import type React from \"react\";\nimport { ActivityIndicator, View } from \"react-native\";\nimport type { SpinnerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Spinner: React.FC<SpinnerProps> = ({\n color,\n size,\n role,\n \"aria-label\": ariaLabel,\n \"aria-live\": ariaLive,\n \"aria-describedby\": ariaDescribedBy,\n testID,\n}) => {\n return (\n <View\n accessible={true}\n accessibilityRole={role === \"status\" ? \"none\" : undefined}\n accessibilityLabel={ariaLabel}\n accessibilityLiveRegion={\n ariaLive === \"polite\"\n ? \"polite\"\n : ariaLive === \"assertive\"\n ? \"assertive\"\n : \"none\"\n }\n testID={testID}\n >\n <ActivityIndicator\n color={color}\n size={typeof size === \"number\" ? size : \"small\"}\n />\n </View>\n );\n};\n\nSpinner.displayName = \"Spinner\";\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Icon: React.FC<IconProps> = ({ children, color, size }) => {\n const style: ViewStyle = {\n width: typeof size === \"number\" ? size : undefined,\n height: typeof size === \"number\" ? size : undefined,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n // On native, we try to pass the color down to children (like Text primitives)\n // to mimic the CSS inheritance behavior of the web version.\n const childrenWithProps = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n // @ts-ignore - passing color down to potential Text/Icon children\n return React.cloneElement(child, {\n color: child.props.color || color,\n // Also pass size if child seems to be an icon that needs it\n size: child.props.size || size,\n });\n }\n return child;\n });\n\n return <View style={style}>{childrenWithProps}</View>;\n};\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { DividerProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Divider: React.FC<DividerProps> = ({\n color,\n height,\n width,\n vertical,\n dashStroke,\n}) => {\n const style: ViewStyle = {\n backgroundColor: dashStroke\n ? \"transparent\"\n : color || \"rgba(255, 255, 255, 0.15)\",\n width: vertical ? (typeof width === \"number\" ? width : 1) : \"100%\",\n height: vertical ? \"100%\" : typeof height === \"number\" ? height : 1,\n ...(dashStroke && {\n borderStyle: \"dashed\",\n borderColor: color || \"rgba(255, 255, 255, 0.15)\",\n borderWidth: 0,\n ...(vertical\n ? { borderLeftWidth: typeof width === \"number\" ? width : 1 }\n : { borderTopWidth: typeof height === \"number\" ? height : 1 }),\n }),\n };\n\n return <View style={style} />;\n};\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\n// Map web input types to React Native keyboard types\nconst keyboardTypeMap: Record<string, any> = {\n text: \"default\",\n number: \"numeric\",\n email: \"email-address\",\n tel: \"phone-pad\",\n url: \"url\",\n decimal: \"decimal-pad\",\n};\n\n// Map web inputMode to React Native keyboard types\nconst inputModeToKeyboardType: Record<string, any> = {\n none: \"default\",\n text: \"default\",\n decimal: \"decimal-pad\",\n numeric: \"number-pad\",\n tel: \"phone-pad\",\n search: \"default\",\n email: \"email-address\",\n url: \"url\",\n};\n\n// Map web autoComplete to React Native textContentType (iOS)\nconst autoCompleteToTextContentType: Record<string, any> = {\n \"one-time-code\": \"oneTimeCode\",\n email: \"emailAddress\",\n username: \"username\",\n password: \"password\",\n \"new-password\": \"newPassword\",\n tel: \"telephoneNumber\",\n \"postal-code\": \"postalCode\",\n name: \"name\",\n};\n\nexport const InputPrimitive = forwardRef<RNTextInput, InputPrimitiveProps>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n secureTextEntry,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n name,\n type,\n inputMode,\n autoComplete,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n // Create a synthetic event for onChange compatibility\n // Include nativeEvent and no-op methods to prevent runtime errors\n // when consumers expect DOM-like event behavior\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLInputElement>;\n onChange(syntheticEvent);\n }\n };\n\n // Determine keyboard type - inputMode takes precedence over type\n const keyboardType = inputMode\n ? inputModeToKeyboardType[inputMode] || \"default\"\n : type\n ? keyboardTypeMap[type] || \"default\"\n : \"default\";\n\n // Determine textContentType for iOS autofill\n const textContentType = autoComplete\n ? autoCompleteToTextContentType[autoComplete]\n : undefined;\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n // Map onKeyPress to onKeyDown for cross-platform compatibility\n // Include preventDefault to avoid runtime errors when consumers call it\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n secureTextEntry={secureTextEntry || type === \"password\"}\n keyboardType={keyboardType}\n textContentType={textContentType}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n // React Native accessibility props\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nInputPrimitive.displayName = \"InputPrimitive\";\n","import React, { forwardRef } from \"react\";\nimport { TextInput as RNTextInput } from \"react-native\";\nimport { TextAreaPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nexport const TextAreaPrimitive = forwardRef<\n RNTextInput,\n TextAreaPrimitiveProps\n>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n rows,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const handleChangeText = (text: string) => {\n onChangeText?.(text);\n\n if (onChange) {\n const syntheticEvent = {\n target: { value: text },\n currentTarget: { value: text },\n type: \"change\",\n nativeEvent: { text },\n preventDefault: () => {},\n stopPropagation: () => {},\n isTrusted: false,\n } as unknown as React.ChangeEvent<HTMLTextAreaElement>;\n onChange(syntheticEvent);\n }\n };\n\n return (\n <RNTextInput\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChangeText={handleChangeText}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyPress={(e) => {\n if (onKeyDown) {\n onKeyDown({\n key: e.nativeEvent.key,\n preventDefault: () => {},\n } as any);\n }\n }}\n editable={!disabled}\n multiline={true}\n numberOfLines={rows || 4}\n style={[\n {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n flex: 1,\n padding: 0,\n textAlignVertical: \"top\",\n textAlign: (style as any)?.textAlign || \"left\",\n },\n style as any,\n ]}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n testID={dataTestId || id}\n accessibilityLabel={ariaLabel}\n accessibilityHint={ariaDescribedBy}\n accessibilityState={{\n disabled: disabled || ariaDisabled,\n }}\n accessible={true}\n />\n );\n }\n);\n\nTextAreaPrimitive.displayName = \"TextAreaPrimitive\";\n","import { useState, useRef, useLayoutEffect, useCallback } from \"react\";\nimport type { ToggletipPlacement } from \"./types\";\n\ninterface UseToggletipOptions {\n open: boolean;\n direction: ToggletipPlacement;\n offset: number;\n autoDirection?: boolean;\n}\n\ninterface UseToggletipReturn {\n refs: {\n setReference: (node: HTMLElement | null) => void;\n setFloating: (node: HTMLElement | null) => void;\n };\n direction: ToggletipPlacement;\n}\n\nconst getScrollParent = (element: HTMLElement | null): HTMLElement => {\n if (!element || element === document.body) {\n return document.body;\n }\n\n const { overflow, overflowX, overflowY } = window.getComputedStyle(element);\n const scrollRegex = /(auto|scroll)/;\n const isScrollable =\n scrollRegex.test(overflow) ||\n scrollRegex.test(overflowX) ||\n scrollRegex.test(overflowY);\n\n if (\n isScrollable &&\n (element.scrollHeight > element.clientHeight ||\n element.scrollWidth > element.clientWidth)\n ) {\n return element;\n }\n\n return getScrollParent(element.parentElement);\n};\n\nconst getViewportBounds = (triggerElement: HTMLElement) => {\n const scrollParent = getScrollParent(triggerElement);\n\n if (scrollParent === document.body) {\n return {\n top: 0,\n left: 0,\n right: window.visualViewport?.width || window.innerWidth,\n bottom: window.visualViewport?.height || window.innerHeight,\n width: window.visualViewport?.width || window.innerWidth,\n height: window.visualViewport?.height || window.innerHeight,\n };\n }\n\n const rect = scrollParent.getBoundingClientRect();\n return {\n top: rect.top,\n left: rect.left,\n right: rect.right,\n bottom: rect.bottom,\n width: rect.width,\n height: rect.height,\n };\n};\n\nconst checkCollision = (\n triggerRect: DOMRect,\n toggletipRect: DOMRect,\n placement: ToggletipPlacement,\n offset: number,\n triggerElement: HTMLElement\n): ToggletipPlacement => {\n const viewport = getViewportBounds(triggerElement);\n const buffer = 10;\n\n const space = {\n top: triggerRect.top - viewport.top,\n bottom: viewport.bottom - triggerRect.bottom,\n left: triggerRect.left - viewport.left,\n right: viewport.right - triggerRect.right,\n };\n\n const centerY = triggerRect.top + triggerRect.height / 2;\n const centerX = triggerRect.left + triggerRect.width / 2;\n const halfWidth = toggletipRect.width / 2;\n const halfHeight = toggletipRect.height / 2;\n const minSpace = offset + buffer;\n\n const fits = {\n top:\n space.top >= toggletipRect.height + minSpace &&\n centerX - halfWidth >= viewport.left + buffer &&\n centerX + halfWidth <= viewport.right - buffer,\n bottom:\n space.bottom >= toggletipRect.height + minSpace &&\n centerX - halfWidth >= viewport.left + buffer &&\n centerX + halfWidth <= viewport.right - buffer,\n left:\n space.left >= toggletipRect.width + minSpace &&\n centerY - halfHeight >= viewport.top + buffer &&\n centerY + halfHeight <= viewport.bottom - buffer,\n right:\n space.right >= toggletipRect.width + minSpace &&\n centerY - halfHeight >= viewport.top + buffer &&\n centerY + halfHeight <= viewport.bottom - buffer,\n };\n\n const [primary, secondary] = placement.split(\"-\");\n\n // If current placement fits, keep it\n if (fits[primary as keyof typeof fits]) {\n return placement;\n }\n\n const opposites: Record<string, string> = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\",\n };\n\n const opposite = opposites[primary];\n if (opposite && fits[opposite as keyof typeof fits]) {\n return secondary\n ? (`${opposite}-${secondary}` as ToggletipPlacement)\n : (opposite as ToggletipPlacement);\n }\n\n const perpendicular =\n primary === \"top\" || primary === \"bottom\"\n ? [\"right\", \"left\"]\n : [\"bottom\", \"top\"];\n\n for (const dir of perpendicular) {\n if (fits[dir as keyof typeof fits]) {\n return dir as ToggletipPlacement;\n }\n }\n\n const best = Object.entries(space).sort(([, a], [, b]) => b - a)[0];\n return best[0] as ToggletipPlacement;\n};\n\nexport const useToggletip = ({\n open,\n direction,\n offset,\n autoDirection = true,\n}: UseToggletipOptions): UseToggletipReturn => {\n const [newDirection, setNewDirection] = useState(direction);\n const referenceRef = useRef<HTMLElement | null>(null);\n const floatingRef = useRef<HTMLElement | null>(null);\n\n const setReference = useCallback((node: HTMLElement | null) => {\n referenceRef.current = node;\n }, []);\n\n const setFloating = useCallback((node: HTMLElement | null) => {\n floatingRef.current = node;\n }, []);\n\n // Collision detection + continuous updates\n useLayoutEffect(() => {\n if (\n !open ||\n !autoDirection ||\n !referenceRef.current ||\n !floatingRef.current\n ) {\n return;\n }\n\n let rafId: number | null = null;\n\n const updatePlacement = () => {\n rafId = null;\n if (!referenceRef.current || !floatingRef.current) return;\n\n const triggerRect = referenceRef.current.getBoundingClientRect();\n const toggletipRect = floatingRef.current.getBoundingClientRect();\n const calculatedDirection = checkCollision(\n triggerRect,\n toggletipRect,\n direction,\n offset,\n referenceRef.current\n );\n\n setNewDirection((prev) =>\n prev === calculatedDirection ? prev : calculatedDirection\n );\n };\n\n const scheduleUpdate = () => {\n if (rafId != null) return;\n rafId = requestAnimationFrame(updatePlacement);\n };\n\n updatePlacement();\n\n // Attach scroll listener to the actual scroll parent for better performance\n const scrollParent = getScrollParent(referenceRef.current);\n const scrollTarget = scrollParent === document.body ? window : scrollParent;\n\n scrollTarget.addEventListener(\"scroll\", scheduleUpdate, {\n capture: true,\n passive: true,\n });\n window.addEventListener(\"resize\", scheduleUpdate);\n\n // Safe ResizeObserver usage for SSR compatibility\n let resizeObserver: ResizeObserver | null = null;\n if (typeof ResizeObserver !== \"undefined\") {\n resizeObserver = new ResizeObserver(scheduleUpdate);\n if (referenceRef.current) {\n resizeObserver.observe(referenceRef.current);\n }\n if (floatingRef.current) {\n resizeObserver.observe(floatingRef.current);\n }\n }\n\n return () => {\n if (rafId != null) cancelAnimationFrame(rafId);\n scrollTarget.removeEventListener(\"scroll\", scheduleUpdate, {\n capture: true,\n } as EventListenerOptions);\n window.removeEventListener(\"resize\", scheduleUpdate);\n if (resizeObserver) resizeObserver.disconnect();\n };\n }, [open, autoDirection, direction, offset]);\n\n // Reset direction when closed\n useLayoutEffect(() => {\n if (!open) {\n setNewDirection(direction);\n }\n }, [open, direction]);\n\n return {\n refs: {\n setReference,\n setFloating,\n },\n direction: newDirection,\n };\n};\n"],"mappings":";AAAA,SAAgB,cAAAA,aAAY,YAAAC,WAAU,UAAAC,SAAQ,WAAW,eAAe;;;ACCxE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAmID;AAhIC,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;AAAA,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,OAAI,cAAc,IAAI,WAAW,IAC/B,iBAAO,YAAY,YAAY,OAAO,YAAY,WACjD,gBAAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,OAAO,MAAM,OAAO,QAAQ;AAAA,oBAC5B,UAAU;AAAA,oBACV,YAAW;AAAA,oBAEV;AAAA;AAAA,gBACH,IAEA,SAEJ;AAAA,gBAED,UACC,gBAAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,WAAW;AAAA,oBACX,eAAc;AAAA,oBACd,gBAAe;AAAA,oBACf,KAAK;AAAA,oBAEJ;AAAA;AAAA,gBACH;AAAA;AAAA;AAAA,UAEJ;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,UAAU,cAAc;","names":["forwardRef","useState","useRef","jsx","View","jsx","View","jsx","View","jsx","jsx","forwardRef","RNTextInput","jsx","jsx","forwardRef","useState","useRef"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-toggletip",
|
|
3
|
-
"version": "0.64.0-pr77.
|
|
3
|
+
"version": "0.64.0-pr77.1768554224",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"build:native": "PLATFORM=native tsup"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xsolla/xui-button": "0.64.0-pr77.
|
|
14
|
-
"@xsolla/xui-core": "0.64.0-pr77.
|
|
15
|
-
"@xsolla/xui-primitives-core": "0.64.0-pr77.
|
|
13
|
+
"@xsolla/xui-button": "0.64.0-pr77.1768554224",
|
|
14
|
+
"@xsolla/xui-core": "0.64.0-pr77.1768554224",
|
|
15
|
+
"@xsolla/xui-primitives-core": "0.64.0-pr77.1768554224"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"react": ">=16.8.0",
|
package/web/index.d.mts
CHANGED
package/web/index.d.ts
CHANGED
package/web/index.js
CHANGED
|
@@ -759,15 +759,14 @@ var Toggletip = (0, import_react5.forwardRef)(
|
|
|
759
759
|
"data-testid": dataTestId,
|
|
760
760
|
position: "absolute",
|
|
761
761
|
backgroundColor: theme.colors.background.primary,
|
|
762
|
-
borderRadius:
|
|
763
|
-
borderWidth: 1,
|
|
762
|
+
borderRadius: 4,
|
|
764
763
|
borderColor: theme.colors.border.secondary,
|
|
765
764
|
padding: 12,
|
|
766
765
|
width,
|
|
767
766
|
zIndex: 2e3,
|
|
768
767
|
style: {
|
|
769
768
|
...positionStyles,
|
|
770
|
-
boxShadow:
|
|
769
|
+
boxShadow: theme.shadow.popover
|
|
771
770
|
},
|
|
772
771
|
children: [
|
|
773
772
|
title && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box, { gap: 8, children: [
|
package/web/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/Toggletip.tsx","../../../primitives-web/src/Box.tsx","../../../primitives-web/src/Text.tsx","../../../primitives-web/src/Spinner.tsx","../../../primitives-web/src/Icon.tsx","../../../primitives-web/src/Divider.tsx","../../../primitives-web/src/Input.tsx","../../../primitives-web/src/TextArea.tsx","../../src/useToggletip.ts"],"sourcesContent":["export * from \"./Toggletip\";\nexport * from \"./types\";\n","import React, { forwardRef, useState, useRef, useEffect, useMemo } from \"react\";\n// @ts-ignore - this will be resolved at build time\nimport { Box, Text, Divider } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, isNative } from \"@xsolla/xui-core\";\nimport { useToggletip } from \"./useToggletip\";\nimport type { ToggletipPlacement, ToggletipProps } from \"./types\";\n\nconst getPositionStyles = (placement: ToggletipPlacement, offset: number) => {\n switch (placement) {\n case \"bottom\":\n return {\n top: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n case \"bottom-left\":\n return { top: `calc(100% + ${offset}px)`, left: 0 };\n case \"bottom-right\":\n return { top: `calc(100% + ${offset}px)`, right: 0 };\n case \"top\":\n return {\n bottom: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n case \"top-left\":\n return { bottom: `calc(100% + ${offset}px)`, left: 0 };\n case \"top-right\":\n return { bottom: `calc(100% + ${offset}px)`, right: 0 };\n case \"left\":\n return {\n right: `calc(100% + ${offset}px)`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n };\n case \"right\":\n return {\n left: `calc(100% + ${offset}px)`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n };\n default:\n return {\n bottom: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n }\n};\n\nexport const Toggletip = forwardRef<any, ToggletipProps>(\n (\n {\n children,\n title,\n content,\n footer,\n width = \"288px\",\n direction = \"top\",\n autoDirection = true,\n offset = 12,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const [isOpen, setOpen] = useState(false);\n const containerRef = useRef<HTMLElement | null>(null);\n const { theme } = useDesignSystem();\n\n const { refs, direction: newDirection } = useToggletip({\n open: isOpen,\n direction,\n offset,\n autoDirection,\n });\n\n const toggleOpen = () => setOpen(!isOpen);\n\n useEffect(() => {\n if (!isOpen || isNative) return;\n\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n event.target instanceof Node &&\n !containerRef.current.contains(event.target)\n ) {\n setOpen(false);\n }\n };\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n setOpen(false);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"keydown\", handleEscape);\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"keydown\", handleEscape);\n };\n }, [isOpen]);\n\n const positionStyles = useMemo(\n () => getPositionStyles(newDirection, offset),\n [newDirection, offset]\n );\n\n return (\n <Box\n ref={(node: HTMLElement | null) => {\n containerRef.current = node;\n refs.setReference(node);\n }}\n display=\"inline-flex\"\n position=\"relative\"\n style={{ height: \"fit-content\" }}\n >\n <Box onPress={toggleOpen} style={{ cursor: \"pointer\" }}>\n {children}\n </Box>\n {isOpen && (\n <Box\n ref={refs.setFloating}\n data-testid={dataTestId}\n position=\"absolute\"\n backgroundColor={theme.colors.background.primary}\n borderRadius={theme.radius.card}\n borderWidth={1}\n borderColor={theme.colors.border.secondary}\n padding={12}\n width={width}\n zIndex={2000}\n style={{\n ...positionStyles,\n boxShadow: \"0 4px 12px rgba(0, 36, 77, 0.2)\",\n }}\n >\n {title && (\n <Box gap={8}>\n <Text\n color={theme.colors.content.primary}\n fontSize={24}\n lineHeight=\"28px\"\n fontWeight=\"500\"\n >\n {title}\n </Text>\n <Divider color={theme.colors.border.secondary} />\n </Box>\n )}\n {content && (\n <Box marginBottom={16} marginTop={16}>\n {typeof content === \"string\" || typeof content === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={14}\n fontWeight=\"400\"\n >\n {content}\n </Text>\n ) : (\n content\n )}\n </Box>\n )}\n {footer && (\n <Box\n marginTop={20}\n flexDirection=\"row\"\n justifyContent=\"flex-end\"\n gap={12}\n >\n {footer}\n </Box>\n )}\n </Box>\n )}\n </Box>\n );\n }\n);\n\nToggletip.displayName = \"Toggletip\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledBox = styled.div<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\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 overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\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?.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 type,\n disabled,\n id,\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 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 }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n as={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 {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledText = styled.span<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 '\"Pilat Wide Bold\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif !important'};\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\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n />\n );\n};\n","import React from \"react\";\nimport styled, { keyframes } from \"styled-components\";\nimport type { SpinnerProps } from \"@xsolla/xui-primitives-core\";\n\nconst rotate = keyframes`\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n`;\n\nconst StyledSpinner = styled.div<SpinnerProps>`\n width: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n height: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n border: ${(props) => props.strokeWidth || 2}px solid\n ${(props) => props.color || \"currentColor\"};\n border-bottom-color: transparent;\n border-radius: 50%;\n display: inline-block;\n box-sizing: border-box;\n animation: ${rotate} 1s linear infinite;\n`;\n\nexport const Spinner: React.FC<SpinnerProps> = ({\n role = \"status\",\n \"aria-label\": ariaLabel,\n \"aria-live\": ariaLive = \"polite\",\n \"aria-describedby\": ariaDescribedBy,\n testID,\n ...props\n}) => {\n return (\n <StyledSpinner\n role={role}\n aria-label={ariaLabel}\n aria-live={ariaLive}\n aria-describedby={ariaDescribedBy}\n data-testid={testID}\n {...props}\n />\n );\n};\n\nSpinner.displayName = \"Spinner\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledIcon = styled.div<IconProps>`\n display: flex;\n align-items: center;\n justify-content: center;\n width: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n height: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n color: ${(props) => props.color || \"currentColor\"};\n\n svg {\n width: 100%;\n height: 100%;\n fill: none;\n stroke: currentColor;\n }\n`;\n\nexport const Icon: React.FC<IconProps> = ({ children, ...props }) => {\n return <StyledIcon {...props}>{children}</StyledIcon>;\n};\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { DividerProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledDivider = styled.div<DividerProps>`\n background-color: ${(props) =>\n props.dashStroke\n ? \"transparent\"\n : props.color || \"rgba(255, 255, 255, 0.15)\"};\n width: ${(props) =>\n props.vertical\n ? typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"1px\"\n : \"100%\"};\n height: ${(props) =>\n props.vertical\n ? \"100%\"\n : typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"1px\"};\n\n ${(props) =>\n props.dashStroke &&\n `\n border-style: dashed;\n border-color: ${props.color || \"rgba(255, 255, 255, 0.15)\"};\n border-width: 0;\n ${\n props.vertical\n ? `\n border-left-width: ${typeof props.width === \"number\" ? `${props.width}px` : props.width || \"1px\"};\n height: 100%;\n `\n : `\n border-top-width: ${typeof props.height === \"number\" ? `${props.height}px` : props.height || \"1px\"};\n width: 100%;\n `\n }\n `}\n`;\n\nexport const Divider: React.FC<DividerProps> = (props) => {\n return <StyledDivider {...props} />;\n};\n","import React, { forwardRef } from \"react\";\nimport styled from \"styled-components\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledInput = styled.input<InputPrimitiveProps>`\n background: transparent;\n border: none;\n outline: none;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\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-family: inherit;\n text-align: inherit;\n\n &::placeholder {\n color: ${(props) =>\n props.placeholderTextColor || \"rgba(255, 255, 255, 0.5)\"};\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nexport const InputPrimitive = forwardRef<HTMLInputElement, InputPrimitiveProps>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n secureTextEntry,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n name,\n type,\n inputMode,\n autoComplete,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n ...rest\n },\n ref\n ) => {\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange) {\n onChange(e);\n }\n if (onChangeText) {\n onChangeText(e.target.value);\n }\n };\n\n // Always pass value to make it a controlled input\n const inputValue = value !== undefined ? value : \"\";\n\n return (\n <StyledInput\n ref={ref}\n id={id}\n value={inputValue}\n name={name}\n placeholder={placeholder}\n onChange={handleChange}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n disabled={disabled}\n type={secureTextEntry ? \"password\" : type || \"text\"}\n inputMode={inputMode}\n autoComplete={autoComplete}\n style={style}\n color={color}\n fontSize={fontSize}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n aria-invalid={ariaInvalid}\n aria-describedby={ariaDescribedBy}\n aria-labelledby={ariaLabelledBy}\n aria-label={ariaLabel}\n aria-disabled={ariaDisabled}\n data-testid={dataTestId}\n {...rest}\n />\n );\n }\n);\n\nInputPrimitive.displayName = \"InputPrimitive\";\n","import React, { forwardRef } from \"react\";\nimport styled from \"styled-components\";\nimport { TextAreaPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledTextArea = styled.textarea<TextAreaPrimitiveProps>`\n background: transparent;\n border: none;\n outline: none;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\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-family: inherit;\n text-align: inherit;\n resize: none;\n\n &::placeholder {\n color: ${(props) =>\n props.placeholderTextColor || \"rgba(255, 255, 255, 0.5)\"};\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nexport const TextAreaPrimitive = forwardRef<\n HTMLTextAreaElement,\n TextAreaPrimitiveProps\n>(\n (\n {\n value,\n placeholder,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n rows,\n },\n ref\n ) => {\n return (\n <StyledTextArea\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChange={(e) => onChangeText?.(e.target.value)}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n disabled={disabled}\n style={style}\n color={color}\n fontSize={fontSize}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n rows={rows}\n />\n );\n }\n);\n\nTextAreaPrimitive.displayName = \"TextAreaPrimitive\";\n","import { useState, useRef, useLayoutEffect, useCallback } from \"react\";\nimport type { ToggletipPlacement } from \"./types\";\n\ninterface UseToggletipOptions {\n open: boolean;\n direction: ToggletipPlacement;\n offset: number;\n autoDirection?: boolean;\n}\n\ninterface UseToggletipReturn {\n refs: {\n setReference: (node: HTMLElement | null) => void;\n setFloating: (node: HTMLElement | null) => void;\n };\n direction: ToggletipPlacement;\n}\n\nconst getScrollParent = (element: HTMLElement | null): HTMLElement => {\n if (!element || element === document.body) {\n return document.body;\n }\n\n const { overflow, overflowX, overflowY } = window.getComputedStyle(element);\n const scrollRegex = /(auto|scroll)/;\n const isScrollable =\n scrollRegex.test(overflow) ||\n scrollRegex.test(overflowX) ||\n scrollRegex.test(overflowY);\n\n if (\n isScrollable &&\n (element.scrollHeight > element.clientHeight ||\n element.scrollWidth > element.clientWidth)\n ) {\n return element;\n }\n\n return getScrollParent(element.parentElement);\n};\n\nconst getViewportBounds = (triggerElement: HTMLElement) => {\n const scrollParent = getScrollParent(triggerElement);\n\n if (scrollParent === document.body) {\n return {\n top: 0,\n left: 0,\n right: window.visualViewport?.width || window.innerWidth,\n bottom: window.visualViewport?.height || window.innerHeight,\n width: window.visualViewport?.width || window.innerWidth,\n height: window.visualViewport?.height || window.innerHeight,\n };\n }\n\n const rect = scrollParent.getBoundingClientRect();\n return {\n top: rect.top,\n left: rect.left,\n right: rect.right,\n bottom: rect.bottom,\n width: rect.width,\n height: rect.height,\n };\n};\n\nconst checkCollision = (\n triggerRect: DOMRect,\n toggletipRect: DOMRect,\n placement: ToggletipPlacement,\n offset: number,\n triggerElement: HTMLElement\n): ToggletipPlacement => {\n const viewport = getViewportBounds(triggerElement);\n const buffer = 10;\n\n const space = {\n top: triggerRect.top - viewport.top,\n bottom: viewport.bottom - triggerRect.bottom,\n left: triggerRect.left - viewport.left,\n right: viewport.right - triggerRect.right,\n };\n\n const centerY = triggerRect.top + triggerRect.height / 2;\n const centerX = triggerRect.left + triggerRect.width / 2;\n const halfWidth = toggletipRect.width / 2;\n const halfHeight = toggletipRect.height / 2;\n const minSpace = offset + buffer;\n\n const fits = {\n top:\n space.top >= toggletipRect.height + minSpace &&\n centerX - halfWidth >= viewport.left + buffer &&\n centerX + halfWidth <= viewport.right - buffer,\n bottom:\n space.bottom >= toggletipRect.height + minSpace &&\n centerX - halfWidth >= viewport.left + buffer &&\n centerX + halfWidth <= viewport.right - buffer,\n left:\n space.left >= toggletipRect.width + minSpace &&\n centerY - halfHeight >= viewport.top + buffer &&\n centerY + halfHeight <= viewport.bottom - buffer,\n right:\n space.right >= toggletipRect.width + minSpace &&\n centerY - halfHeight >= viewport.top + buffer &&\n centerY + halfHeight <= viewport.bottom - buffer,\n };\n\n const [primary, secondary] = placement.split(\"-\");\n\n // If current placement fits, keep it\n if (fits[primary as keyof typeof fits]) {\n return placement;\n }\n\n const opposites: Record<string, string> = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\",\n };\n\n const opposite = opposites[primary];\n if (opposite && fits[opposite as keyof typeof fits]) {\n return secondary\n ? (`${opposite}-${secondary}` as ToggletipPlacement)\n : (opposite as ToggletipPlacement);\n }\n\n const perpendicular =\n primary === \"top\" || primary === \"bottom\"\n ? [\"right\", \"left\"]\n : [\"bottom\", \"top\"];\n\n for (const dir of perpendicular) {\n if (fits[dir as keyof typeof fits]) {\n return dir as ToggletipPlacement;\n }\n }\n\n const best = Object.entries(space).sort(([, a], [, b]) => b - a)[0];\n return best[0] as ToggletipPlacement;\n};\n\nexport const useToggletip = ({\n open,\n direction,\n offset,\n autoDirection = true,\n}: UseToggletipOptions): UseToggletipReturn => {\n const [newDirection, setNewDirection] = useState(direction);\n const referenceRef = useRef<HTMLElement | null>(null);\n const floatingRef = useRef<HTMLElement | null>(null);\n\n const setReference = useCallback((node: HTMLElement | null) => {\n referenceRef.current = node;\n }, []);\n\n const setFloating = useCallback((node: HTMLElement | null) => {\n floatingRef.current = node;\n }, []);\n\n // Collision detection + continuous updates\n useLayoutEffect(() => {\n if (\n !open ||\n !autoDirection ||\n !referenceRef.current ||\n !floatingRef.current\n ) {\n return;\n }\n\n let rafId: number | null = null;\n\n const updatePlacement = () => {\n rafId = null;\n if (!referenceRef.current || !floatingRef.current) return;\n\n const triggerRect = referenceRef.current.getBoundingClientRect();\n const toggletipRect = floatingRef.current.getBoundingClientRect();\n const calculatedDirection = checkCollision(\n triggerRect,\n toggletipRect,\n direction,\n offset,\n referenceRef.current\n );\n\n setNewDirection((prev) =>\n prev === calculatedDirection ? prev : calculatedDirection\n );\n };\n\n const scheduleUpdate = () => {\n if (rafId != null) return;\n rafId = requestAnimationFrame(updatePlacement);\n };\n\n updatePlacement();\n\n // Attach scroll listener to the actual scroll parent for better performance\n const scrollParent = getScrollParent(referenceRef.current);\n const scrollTarget = scrollParent === document.body ? window : scrollParent;\n\n scrollTarget.addEventListener(\"scroll\", scheduleUpdate, {\n capture: true,\n passive: true,\n });\n window.addEventListener(\"resize\", scheduleUpdate);\n\n // Safe ResizeObserver usage for SSR compatibility\n let resizeObserver: ResizeObserver | null = null;\n if (typeof ResizeObserver !== \"undefined\") {\n resizeObserver = new ResizeObserver(scheduleUpdate);\n if (referenceRef.current) {\n resizeObserver.observe(referenceRef.current);\n }\n if (floatingRef.current) {\n resizeObserver.observe(floatingRef.current);\n }\n }\n\n return () => {\n if (rafId != null) cancelAnimationFrame(rafId);\n scrollTarget.removeEventListener(\"scroll\", scheduleUpdate, {\n capture: true,\n } as EventListenerOptions);\n window.removeEventListener(\"resize\", scheduleUpdate);\n if (resizeObserver) resizeObserver.disconnect();\n };\n }, [open, autoDirection, direction, offset]);\n\n // Reset direction when closed\n useLayoutEffect(() => {\n if (!open) {\n setNewDirection(direction);\n }\n }, [open, direction]);\n\n return {\n refs: {\n setReference,\n setFloating,\n },\n direction: newDirection,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAwE;;;ACAxE,mBAAkB;AAClB,+BAAmB;AAuMX;AApMR,IAAM,YAAY,yBAAAC,QAAO;AAAA;AAAA;AAAA,sBAGH,CAAC,UAAU,MAAM,mBAAmB,aAAa;AAAA,kBACrD,CAAC,UAAU,MAAM,eAAe,aAAa;AAAA,kBAC7C,CAAC,UACf,OAAO,MAAM,gBAAgB,WACzB,GAAG,MAAM,WAAW,OACpB,MAAM,eAAe,CAAC;AAAA;AAAA,IAE1B,CAAC,UACD,MAAM,sBAAsB,UAC5B;AAAA,2BACuB,OAAO,MAAM,sBAAsB,WAAW,GAAG,MAAM,iBAAiB,OAAO,MAAM,iBAAiB;AAAA,2BACtG,MAAM,qBAAqB,MAAM,eAAe,aAAa;AAAA;AAAA,GAErF;AAAA,IACC,CAAC,UACD,MAAM,mBAAmB,UACzB;AAAA,wBACoB,OAAO,MAAM,mBAAmB,WAAW,GAAG,MAAM,cAAc,OAAO,MAAM,cAAc;AAAA,wBAC7F,MAAM,kBAAkB,MAA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AAA,YAAC;AAAA;AAAA,cACC,KAAK,KAAK;AAAA,cACV,eAAa;AAAA,cACb,UAAS;AAAA,cACT,iBAAiB,MAAM,OAAO,WAAW;AAAA,cACzC,cAAc,MAAM,OAAO;AAAA,cAC3B,aAAa;AAAA,cACb,aAAa,MAAM,OAAO,OAAO;AAAA,cACjC,SAAS;AAAA,cACT;AAAA,cACA,QAAQ;AAAA,cACR,OAAO;AAAA,gBACL,GAAG;AAAA,gBACH,WAAW;AAAA,cACb;AAAA,cAEC;AAAA,yBACC,8CAAC,OAAI,KAAK,GACR;AAAA;AAAA,oBAAC;AAAA;AAAA,sBACC,OAAO,MAAM,OAAO,QAAQ;AAAA,sBAC5B,UAAU;AAAA,sBACV,YAAW;AAAA,sBACX,YAAW;AAAA,sBAEV;AAAA;AAAA,kBACH;AAAA,kBACA,6CAAC,WAAQ,OAAO,MAAM,OAAO,OAAO,WAAW;AAAA,mBACjD;AAAA,gBAED,WACC,6CAAC,OAAI,cAAc,IAAI,WAAW,IAC/B,iBAAO,YAAY,YAAY,OAAO,YAAY,WACjD;AAAA,kBAAC;AAAA;AAAA,oBACC,OAAO,MAAM,OAAO,QAAQ;AAAA,oBAC5B,UAAU;AAAA,oBACV,YAAW;AAAA,oBAEV;AAAA;AAAA,gBACH,IAEA,SAEJ;AAAA,gBAED,UACC;AAAA,kBAAC;AAAA;AAAA,oBACC,WAAW;AAAA,oBACX,eAAc;AAAA,oBACd,gBAAe;AAAA,oBACf,KAAK;AAAA,oBAEJ;AAAA;AAAA,gBACH;AAAA;AAAA;AAAA,UAEJ;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,UAAU,cAAc;","names":["import_react","styled","React","import_styled_components","import_jsx_runtime","styled","import_styled_components","import_jsx_runtime","styled","import_styled_components","import_jsx_runtime","styled","import_styled_components","import_jsx_runtime","styled","import_react","import_styled_components","import_jsx_runtime","styled","import_react","import_styled_components","import_jsx_runtime","styled","import_react","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../src/Toggletip.tsx","../../../primitives-web/src/Box.tsx","../../../primitives-web/src/Text.tsx","../../../primitives-web/src/Spinner.tsx","../../../primitives-web/src/Icon.tsx","../../../primitives-web/src/Divider.tsx","../../../primitives-web/src/Input.tsx","../../../primitives-web/src/TextArea.tsx","../../src/useToggletip.ts"],"sourcesContent":["export * from \"./Toggletip\";\nexport * from \"./types\";\n","import React, { forwardRef, useState, useRef, useEffect, useMemo } from \"react\";\n// @ts-ignore - this will be resolved at build time\nimport { Box, Text, Divider } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, isNative } from \"@xsolla/xui-core\";\nimport { useToggletip } from \"./useToggletip\";\nimport type { ToggletipPlacement, ToggletipProps } from \"./types\";\n\nconst getPositionStyles = (placement: ToggletipPlacement, offset: number) => {\n switch (placement) {\n case \"bottom\":\n return {\n top: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n case \"bottom-left\":\n return { top: `calc(100% + ${offset}px)`, left: 0 };\n case \"bottom-right\":\n return { top: `calc(100% + ${offset}px)`, right: 0 };\n case \"top\":\n return {\n bottom: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n case \"top-left\":\n return { bottom: `calc(100% + ${offset}px)`, left: 0 };\n case \"top-right\":\n return { bottom: `calc(100% + ${offset}px)`, right: 0 };\n case \"left\":\n return {\n right: `calc(100% + ${offset}px)`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n };\n case \"right\":\n return {\n left: `calc(100% + ${offset}px)`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n };\n default:\n return {\n bottom: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n }\n};\n\nexport const Toggletip = forwardRef<any, ToggletipProps>(\n (\n {\n children,\n title,\n content,\n footer,\n width = \"288px\",\n direction = \"top\",\n autoDirection = true,\n offset = 12,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const [isOpen, setOpen] = useState(false);\n const containerRef = useRef<HTMLElement | null>(null);\n const { theme } = useDesignSystem();\n\n const { refs, direction: newDirection } = useToggletip({\n open: isOpen,\n direction,\n offset,\n autoDirection,\n });\n\n const toggleOpen = () => setOpen(!isOpen);\n\n useEffect(() => {\n if (!isOpen || isNative) return;\n\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n event.target instanceof Node &&\n !containerRef.current.contains(event.target)\n ) {\n setOpen(false);\n }\n };\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n setOpen(false);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"keydown\", handleEscape);\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"keydown\", handleEscape);\n };\n }, [isOpen]);\n\n const positionStyles = useMemo(\n () => getPositionStyles(newDirection, offset),\n [newDirection, offset]\n );\n\n return (\n <Box\n ref={(node: HTMLElement | null) => {\n containerRef.current = node;\n refs.setReference(node);\n }}\n display=\"inline-flex\"\n position=\"relative\"\n style={{ height: \"fit-content\" }}\n >\n <Box onPress={toggleOpen} style={{ cursor: \"pointer\" }}>\n {children}\n </Box>\n {isOpen && (\n <Box\n ref={refs.setFloating}\n data-testid={dataTestId}\n position=\"absolute\"\n backgroundColor={theme.colors.background.primary}\n borderRadius={4}\n borderColor={theme.colors.border.secondary}\n padding={12}\n width={width}\n zIndex={2000}\n style={{\n ...positionStyles,\n boxShadow: theme.shadow.popover,\n }}\n >\n {title && (\n <Box gap={8}>\n <Text\n color={theme.colors.content.primary}\n fontSize={24}\n lineHeight=\"28px\"\n fontWeight=\"500\"\n >\n {title}\n </Text>\n <Divider color={theme.colors.border.secondary} />\n </Box>\n )}\n {content && (\n <Box marginBottom={16} marginTop={16}>\n {typeof content === \"string\" || typeof content === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={14}\n fontWeight=\"400\"\n >\n {content}\n </Text>\n ) : (\n content\n )}\n </Box>\n )}\n {footer && (\n <Box\n marginTop={20}\n flexDirection=\"row\"\n justifyContent=\"flex-end\"\n gap={12}\n >\n {footer}\n </Box>\n )}\n </Box>\n )}\n </Box>\n );\n }\n);\n\nToggletip.displayName = \"Toggletip\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledBox = styled.div<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\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 overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\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?.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 type,\n disabled,\n id,\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 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 }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n as={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 {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledText = styled.span<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 '\"Pilat Wide Bold\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif !important'};\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\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n />\n );\n};\n","import React from \"react\";\nimport styled, { keyframes } from \"styled-components\";\nimport type { SpinnerProps } from \"@xsolla/xui-primitives-core\";\n\nconst rotate = keyframes`\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n`;\n\nconst StyledSpinner = styled.div<SpinnerProps>`\n width: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n height: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n border: ${(props) => props.strokeWidth || 2}px solid\n ${(props) => props.color || \"currentColor\"};\n border-bottom-color: transparent;\n border-radius: 50%;\n display: inline-block;\n box-sizing: border-box;\n animation: ${rotate} 1s linear infinite;\n`;\n\nexport const Spinner: React.FC<SpinnerProps> = ({\n role = \"status\",\n \"aria-label\": ariaLabel,\n \"aria-live\": ariaLive = \"polite\",\n \"aria-describedby\": ariaDescribedBy,\n testID,\n ...props\n}) => {\n return (\n <StyledSpinner\n role={role}\n aria-label={ariaLabel}\n aria-live={ariaLive}\n aria-describedby={ariaDescribedBy}\n data-testid={testID}\n {...props}\n />\n );\n};\n\nSpinner.displayName = \"Spinner\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledIcon = styled.div<IconProps>`\n display: flex;\n align-items: center;\n justify-content: center;\n width: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n height: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n color: ${(props) => props.color || \"currentColor\"};\n\n svg {\n width: 100%;\n height: 100%;\n fill: none;\n stroke: currentColor;\n }\n`;\n\nexport const Icon: React.FC<IconProps> = ({ children, ...props }) => {\n return <StyledIcon {...props}>{children}</StyledIcon>;\n};\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { DividerProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledDivider = styled.div<DividerProps>`\n background-color: ${(props) =>\n props.dashStroke\n ? \"transparent\"\n : props.color || \"rgba(255, 255, 255, 0.15)\"};\n width: ${(props) =>\n props.vertical\n ? typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"1px\"\n : \"100%\"};\n height: ${(props) =>\n props.vertical\n ? \"100%\"\n : typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"1px\"};\n\n ${(props) =>\n props.dashStroke &&\n `\n border-style: dashed;\n border-color: ${props.color || \"rgba(255, 255, 255, 0.15)\"};\n border-width: 0;\n ${\n props.vertical\n ? `\n border-left-width: ${typeof props.width === \"number\" ? `${props.width}px` : props.width || \"1px\"};\n height: 100%;\n `\n : `\n border-top-width: ${typeof props.height === \"number\" ? `${props.height}px` : props.height || \"1px\"};\n width: 100%;\n `\n }\n `}\n`;\n\nexport const Divider: React.FC<DividerProps> = (props) => {\n return <StyledDivider {...props} />;\n};\n","import React, { forwardRef } from \"react\";\nimport styled from \"styled-components\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledInput = styled.input<InputPrimitiveProps>`\n background: transparent;\n border: none;\n outline: none;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\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-family: inherit;\n text-align: inherit;\n\n &::placeholder {\n color: ${(props) =>\n props.placeholderTextColor || \"rgba(255, 255, 255, 0.5)\"};\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nexport const InputPrimitive = forwardRef<HTMLInputElement, InputPrimitiveProps>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n secureTextEntry,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n name,\n type,\n inputMode,\n autoComplete,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n ...rest\n },\n ref\n ) => {\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange) {\n onChange(e);\n }\n if (onChangeText) {\n onChangeText(e.target.value);\n }\n };\n\n // Always pass value to make it a controlled input\n const inputValue = value !== undefined ? value : \"\";\n\n return (\n <StyledInput\n ref={ref}\n id={id}\n value={inputValue}\n name={name}\n placeholder={placeholder}\n onChange={handleChange}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n disabled={disabled}\n type={secureTextEntry ? \"password\" : type || \"text\"}\n inputMode={inputMode}\n autoComplete={autoComplete}\n style={style}\n color={color}\n fontSize={fontSize}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n aria-invalid={ariaInvalid}\n aria-describedby={ariaDescribedBy}\n aria-labelledby={ariaLabelledBy}\n aria-label={ariaLabel}\n aria-disabled={ariaDisabled}\n data-testid={dataTestId}\n {...rest}\n />\n );\n }\n);\n\nInputPrimitive.displayName = \"InputPrimitive\";\n","import React, { forwardRef } from \"react\";\nimport styled from \"styled-components\";\nimport { TextAreaPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledTextArea = styled.textarea<TextAreaPrimitiveProps>`\n background: transparent;\n border: none;\n outline: none;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\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-family: inherit;\n text-align: inherit;\n resize: none;\n\n &::placeholder {\n color: ${(props) =>\n props.placeholderTextColor || \"rgba(255, 255, 255, 0.5)\"};\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nexport const TextAreaPrimitive = forwardRef<\n HTMLTextAreaElement,\n TextAreaPrimitiveProps\n>(\n (\n {\n value,\n placeholder,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n rows,\n },\n ref\n ) => {\n return (\n <StyledTextArea\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChange={(e) => onChangeText?.(e.target.value)}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n disabled={disabled}\n style={style}\n color={color}\n fontSize={fontSize}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n rows={rows}\n />\n );\n }\n);\n\nTextAreaPrimitive.displayName = \"TextAreaPrimitive\";\n","import { useState, useRef, useLayoutEffect, useCallback } from \"react\";\nimport type { ToggletipPlacement } from \"./types\";\n\ninterface UseToggletipOptions {\n open: boolean;\n direction: ToggletipPlacement;\n offset: number;\n autoDirection?: boolean;\n}\n\ninterface UseToggletipReturn {\n refs: {\n setReference: (node: HTMLElement | null) => void;\n setFloating: (node: HTMLElement | null) => void;\n };\n direction: ToggletipPlacement;\n}\n\nconst getScrollParent = (element: HTMLElement | null): HTMLElement => {\n if (!element || element === document.body) {\n return document.body;\n }\n\n const { overflow, overflowX, overflowY } = window.getComputedStyle(element);\n const scrollRegex = /(auto|scroll)/;\n const isScrollable =\n scrollRegex.test(overflow) ||\n scrollRegex.test(overflowX) ||\n scrollRegex.test(overflowY);\n\n if (\n isScrollable &&\n (element.scrollHeight > element.clientHeight ||\n element.scrollWidth > element.clientWidth)\n ) {\n return element;\n }\n\n return getScrollParent(element.parentElement);\n};\n\nconst getViewportBounds = (triggerElement: HTMLElement) => {\n const scrollParent = getScrollParent(triggerElement);\n\n if (scrollParent === document.body) {\n return {\n top: 0,\n left: 0,\n right: window.visualViewport?.width || window.innerWidth,\n bottom: window.visualViewport?.height || window.innerHeight,\n width: window.visualViewport?.width || window.innerWidth,\n height: window.visualViewport?.height || window.innerHeight,\n };\n }\n\n const rect = scrollParent.getBoundingClientRect();\n return {\n top: rect.top,\n left: rect.left,\n right: rect.right,\n bottom: rect.bottom,\n width: rect.width,\n height: rect.height,\n };\n};\n\nconst checkCollision = (\n triggerRect: DOMRect,\n toggletipRect: DOMRect,\n placement: ToggletipPlacement,\n offset: number,\n triggerElement: HTMLElement\n): ToggletipPlacement => {\n const viewport = getViewportBounds(triggerElement);\n const buffer = 10;\n\n const space = {\n top: triggerRect.top - viewport.top,\n bottom: viewport.bottom - triggerRect.bottom,\n left: triggerRect.left - viewport.left,\n right: viewport.right - triggerRect.right,\n };\n\n const centerY = triggerRect.top + triggerRect.height / 2;\n const centerX = triggerRect.left + triggerRect.width / 2;\n const halfWidth = toggletipRect.width / 2;\n const halfHeight = toggletipRect.height / 2;\n const minSpace = offset + buffer;\n\n const fits = {\n top:\n space.top >= toggletipRect.height + minSpace &&\n centerX - halfWidth >= viewport.left + buffer &&\n centerX + halfWidth <= viewport.right - buffer,\n bottom:\n space.bottom >= toggletipRect.height + minSpace &&\n centerX - halfWidth >= viewport.left + buffer &&\n centerX + halfWidth <= viewport.right - buffer,\n left:\n space.left >= toggletipRect.width + minSpace &&\n centerY - halfHeight >= viewport.top + buffer &&\n centerY + halfHeight <= viewport.bottom - buffer,\n right:\n space.right >= toggletipRect.width + minSpace &&\n centerY - halfHeight >= viewport.top + buffer &&\n centerY + halfHeight <= viewport.bottom - buffer,\n };\n\n const [primary, secondary] = placement.split(\"-\");\n\n // If current placement fits, keep it\n if (fits[primary as keyof typeof fits]) {\n return placement;\n }\n\n const opposites: Record<string, string> = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\",\n };\n\n const opposite = opposites[primary];\n if (opposite && fits[opposite as keyof typeof fits]) {\n return secondary\n ? (`${opposite}-${secondary}` as ToggletipPlacement)\n : (opposite as ToggletipPlacement);\n }\n\n const perpendicular =\n primary === \"top\" || primary === \"bottom\"\n ? [\"right\", \"left\"]\n : [\"bottom\", \"top\"];\n\n for (const dir of perpendicular) {\n if (fits[dir as keyof typeof fits]) {\n return dir as ToggletipPlacement;\n }\n }\n\n const best = Object.entries(space).sort(([, a], [, b]) => b - a)[0];\n return best[0] as ToggletipPlacement;\n};\n\nexport const useToggletip = ({\n open,\n direction,\n offset,\n autoDirection = true,\n}: UseToggletipOptions): UseToggletipReturn => {\n const [newDirection, setNewDirection] = useState(direction);\n const referenceRef = useRef<HTMLElement | null>(null);\n const floatingRef = useRef<HTMLElement | null>(null);\n\n const setReference = useCallback((node: HTMLElement | null) => {\n referenceRef.current = node;\n }, []);\n\n const setFloating = useCallback((node: HTMLElement | null) => {\n floatingRef.current = node;\n }, []);\n\n // Collision detection + continuous updates\n useLayoutEffect(() => {\n if (\n !open ||\n !autoDirection ||\n !referenceRef.current ||\n !floatingRef.current\n ) {\n return;\n }\n\n let rafId: number | null = null;\n\n const updatePlacement = () => {\n rafId = null;\n if (!referenceRef.current || !floatingRef.current) return;\n\n const triggerRect = referenceRef.current.getBoundingClientRect();\n const toggletipRect = floatingRef.current.getBoundingClientRect();\n const calculatedDirection = checkCollision(\n triggerRect,\n toggletipRect,\n direction,\n offset,\n referenceRef.current\n );\n\n setNewDirection((prev) =>\n prev === calculatedDirection ? prev : calculatedDirection\n );\n };\n\n const scheduleUpdate = () => {\n if (rafId != null) return;\n rafId = requestAnimationFrame(updatePlacement);\n };\n\n updatePlacement();\n\n // Attach scroll listener to the actual scroll parent for better performance\n const scrollParent = getScrollParent(referenceRef.current);\n const scrollTarget = scrollParent === document.body ? window : scrollParent;\n\n scrollTarget.addEventListener(\"scroll\", scheduleUpdate, {\n capture: true,\n passive: true,\n });\n window.addEventListener(\"resize\", scheduleUpdate);\n\n // Safe ResizeObserver usage for SSR compatibility\n let resizeObserver: ResizeObserver | null = null;\n if (typeof ResizeObserver !== \"undefined\") {\n resizeObserver = new ResizeObserver(scheduleUpdate);\n if (referenceRef.current) {\n resizeObserver.observe(referenceRef.current);\n }\n if (floatingRef.current) {\n resizeObserver.observe(floatingRef.current);\n }\n }\n\n return () => {\n if (rafId != null) cancelAnimationFrame(rafId);\n scrollTarget.removeEventListener(\"scroll\", scheduleUpdate, {\n capture: true,\n } as EventListenerOptions);\n window.removeEventListener(\"resize\", scheduleUpdate);\n if (resizeObserver) resizeObserver.disconnect();\n };\n }, [open, autoDirection, direction, offset]);\n\n // Reset direction when closed\n useLayoutEffect(() => {\n if (!open) {\n setNewDirection(direction);\n }\n }, [open, direction]);\n\n return {\n refs: {\n setReference,\n setFloating,\n },\n direction: newDirection,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAwE;;;ACAxE,mBAAkB;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,YAAY,WACjD;AAAA,kBAAC;AAAA;AAAA,oBACC,OAAO,MAAM,OAAO,QAAQ;AAAA,oBAC5B,UAAU;AAAA,oBACV,YAAW;AAAA,oBAEV;AAAA;AAAA,gBACH,IAEA,SAEJ;AAAA,gBAED,UACC;AAAA,kBAAC;AAAA;AAAA,oBACC,WAAW;AAAA,oBACX,eAAc;AAAA,oBACd,gBAAe;AAAA,oBACf,KAAK;AAAA,oBAEJ;AAAA;AAAA,gBACH;AAAA;AAAA;AAAA,UAEJ;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,UAAU,cAAc;","names":["import_react","styled","React","import_styled_components","import_jsx_runtime","styled","import_styled_components","import_jsx_runtime","styled","import_styled_components","import_jsx_runtime","styled","import_styled_components","import_jsx_runtime","styled","import_react","import_styled_components","import_jsx_runtime","styled","import_react","import_styled_components","import_jsx_runtime","styled","import_react","import_jsx_runtime"]}
|
package/web/index.mjs
CHANGED
|
@@ -723,15 +723,14 @@ var Toggletip = forwardRef3(
|
|
|
723
723
|
"data-testid": dataTestId,
|
|
724
724
|
position: "absolute",
|
|
725
725
|
backgroundColor: theme.colors.background.primary,
|
|
726
|
-
borderRadius:
|
|
727
|
-
borderWidth: 1,
|
|
726
|
+
borderRadius: 4,
|
|
728
727
|
borderColor: theme.colors.border.secondary,
|
|
729
728
|
padding: 12,
|
|
730
729
|
width,
|
|
731
730
|
zIndex: 2e3,
|
|
732
731
|
style: {
|
|
733
732
|
...positionStyles,
|
|
734
|
-
boxShadow:
|
|
733
|
+
boxShadow: theme.shadow.popover
|
|
735
734
|
},
|
|
736
735
|
children: [
|
|
737
736
|
title && /* @__PURE__ */ jsxs(Box, { gap: 8, children: [
|
package/web/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Toggletip.tsx","../../../primitives-web/src/Box.tsx","../../../primitives-web/src/Text.tsx","../../../primitives-web/src/Spinner.tsx","../../../primitives-web/src/Icon.tsx","../../../primitives-web/src/Divider.tsx","../../../primitives-web/src/Input.tsx","../../../primitives-web/src/TextArea.tsx","../../src/useToggletip.ts"],"sourcesContent":["import React, { forwardRef, useState, useRef, useEffect, useMemo } from \"react\";\n// @ts-ignore - this will be resolved at build time\nimport { Box, Text, Divider } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, isNative } from \"@xsolla/xui-core\";\nimport { useToggletip } from \"./useToggletip\";\nimport type { ToggletipPlacement, ToggletipProps } from \"./types\";\n\nconst getPositionStyles = (placement: ToggletipPlacement, offset: number) => {\n switch (placement) {\n case \"bottom\":\n return {\n top: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n case \"bottom-left\":\n return { top: `calc(100% + ${offset}px)`, left: 0 };\n case \"bottom-right\":\n return { top: `calc(100% + ${offset}px)`, right: 0 };\n case \"top\":\n return {\n bottom: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n case \"top-left\":\n return { bottom: `calc(100% + ${offset}px)`, left: 0 };\n case \"top-right\":\n return { bottom: `calc(100% + ${offset}px)`, right: 0 };\n case \"left\":\n return {\n right: `calc(100% + ${offset}px)`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n };\n case \"right\":\n return {\n left: `calc(100% + ${offset}px)`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n };\n default:\n return {\n bottom: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n }\n};\n\nexport const Toggletip = forwardRef<any, ToggletipProps>(\n (\n {\n children,\n title,\n content,\n footer,\n width = \"288px\",\n direction = \"top\",\n autoDirection = true,\n offset = 12,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const [isOpen, setOpen] = useState(false);\n const containerRef = useRef<HTMLElement | null>(null);\n const { theme } = useDesignSystem();\n\n const { refs, direction: newDirection } = useToggletip({\n open: isOpen,\n direction,\n offset,\n autoDirection,\n });\n\n const toggleOpen = () => setOpen(!isOpen);\n\n useEffect(() => {\n if (!isOpen || isNative) return;\n\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n event.target instanceof Node &&\n !containerRef.current.contains(event.target)\n ) {\n setOpen(false);\n }\n };\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n setOpen(false);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"keydown\", handleEscape);\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"keydown\", handleEscape);\n };\n }, [isOpen]);\n\n const positionStyles = useMemo(\n () => getPositionStyles(newDirection, offset),\n [newDirection, offset]\n );\n\n return (\n <Box\n ref={(node: HTMLElement | null) => {\n containerRef.current = node;\n refs.setReference(node);\n }}\n display=\"inline-flex\"\n position=\"relative\"\n style={{ height: \"fit-content\" }}\n >\n <Box onPress={toggleOpen} style={{ cursor: \"pointer\" }}>\n {children}\n </Box>\n {isOpen && (\n <Box\n ref={refs.setFloating}\n data-testid={dataTestId}\n position=\"absolute\"\n backgroundColor={theme.colors.background.primary}\n borderRadius={theme.radius.card}\n borderWidth={1}\n borderColor={theme.colors.border.secondary}\n padding={12}\n width={width}\n zIndex={2000}\n style={{\n ...positionStyles,\n boxShadow: \"0 4px 12px rgba(0, 36, 77, 0.2)\",\n }}\n >\n {title && (\n <Box gap={8}>\n <Text\n color={theme.colors.content.primary}\n fontSize={24}\n lineHeight=\"28px\"\n fontWeight=\"500\"\n >\n {title}\n </Text>\n <Divider color={theme.colors.border.secondary} />\n </Box>\n )}\n {content && (\n <Box marginBottom={16} marginTop={16}>\n {typeof content === \"string\" || typeof content === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={14}\n fontWeight=\"400\"\n >\n {content}\n </Text>\n ) : (\n content\n )}\n </Box>\n )}\n {footer && (\n <Box\n marginTop={20}\n flexDirection=\"row\"\n justifyContent=\"flex-end\"\n gap={12}\n >\n {footer}\n </Box>\n )}\n </Box>\n )}\n </Box>\n );\n }\n);\n\nToggletip.displayName = \"Toggletip\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledBox = styled.div<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\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 overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\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?.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 type,\n disabled,\n id,\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 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 }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n as={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 {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledText = styled.span<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 '\"Pilat Wide Bold\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif !important'};\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\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n />\n );\n};\n","import React from \"react\";\nimport styled, { keyframes } from \"styled-components\";\nimport type { SpinnerProps } from \"@xsolla/xui-primitives-core\";\n\nconst rotate = keyframes`\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n`;\n\nconst StyledSpinner = styled.div<SpinnerProps>`\n width: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n height: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n border: ${(props) => props.strokeWidth || 2}px solid\n ${(props) => props.color || \"currentColor\"};\n border-bottom-color: transparent;\n border-radius: 50%;\n display: inline-block;\n box-sizing: border-box;\n animation: ${rotate} 1s linear infinite;\n`;\n\nexport const Spinner: React.FC<SpinnerProps> = ({\n role = \"status\",\n \"aria-label\": ariaLabel,\n \"aria-live\": ariaLive = \"polite\",\n \"aria-describedby\": ariaDescribedBy,\n testID,\n ...props\n}) => {\n return (\n <StyledSpinner\n role={role}\n aria-label={ariaLabel}\n aria-live={ariaLive}\n aria-describedby={ariaDescribedBy}\n data-testid={testID}\n {...props}\n />\n );\n};\n\nSpinner.displayName = \"Spinner\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledIcon = styled.div<IconProps>`\n display: flex;\n align-items: center;\n justify-content: center;\n width: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n height: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n color: ${(props) => props.color || \"currentColor\"};\n\n svg {\n width: 100%;\n height: 100%;\n fill: none;\n stroke: currentColor;\n }\n`;\n\nexport const Icon: React.FC<IconProps> = ({ children, ...props }) => {\n return <StyledIcon {...props}>{children}</StyledIcon>;\n};\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { DividerProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledDivider = styled.div<DividerProps>`\n background-color: ${(props) =>\n props.dashStroke\n ? \"transparent\"\n : props.color || \"rgba(255, 255, 255, 0.15)\"};\n width: ${(props) =>\n props.vertical\n ? typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"1px\"\n : \"100%\"};\n height: ${(props) =>\n props.vertical\n ? \"100%\"\n : typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"1px\"};\n\n ${(props) =>\n props.dashStroke &&\n `\n border-style: dashed;\n border-color: ${props.color || \"rgba(255, 255, 255, 0.15)\"};\n border-width: 0;\n ${\n props.vertical\n ? `\n border-left-width: ${typeof props.width === \"number\" ? `${props.width}px` : props.width || \"1px\"};\n height: 100%;\n `\n : `\n border-top-width: ${typeof props.height === \"number\" ? `${props.height}px` : props.height || \"1px\"};\n width: 100%;\n `\n }\n `}\n`;\n\nexport const Divider: React.FC<DividerProps> = (props) => {\n return <StyledDivider {...props} />;\n};\n","import React, { forwardRef } from \"react\";\nimport styled from \"styled-components\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledInput = styled.input<InputPrimitiveProps>`\n background: transparent;\n border: none;\n outline: none;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\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-family: inherit;\n text-align: inherit;\n\n &::placeholder {\n color: ${(props) =>\n props.placeholderTextColor || \"rgba(255, 255, 255, 0.5)\"};\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nexport const InputPrimitive = forwardRef<HTMLInputElement, InputPrimitiveProps>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n secureTextEntry,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n name,\n type,\n inputMode,\n autoComplete,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n ...rest\n },\n ref\n ) => {\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange) {\n onChange(e);\n }\n if (onChangeText) {\n onChangeText(e.target.value);\n }\n };\n\n // Always pass value to make it a controlled input\n const inputValue = value !== undefined ? value : \"\";\n\n return (\n <StyledInput\n ref={ref}\n id={id}\n value={inputValue}\n name={name}\n placeholder={placeholder}\n onChange={handleChange}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n disabled={disabled}\n type={secureTextEntry ? \"password\" : type || \"text\"}\n inputMode={inputMode}\n autoComplete={autoComplete}\n style={style}\n color={color}\n fontSize={fontSize}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n aria-invalid={ariaInvalid}\n aria-describedby={ariaDescribedBy}\n aria-labelledby={ariaLabelledBy}\n aria-label={ariaLabel}\n aria-disabled={ariaDisabled}\n data-testid={dataTestId}\n {...rest}\n />\n );\n }\n);\n\nInputPrimitive.displayName = \"InputPrimitive\";\n","import React, { forwardRef } from \"react\";\nimport styled from \"styled-components\";\nimport { TextAreaPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledTextArea = styled.textarea<TextAreaPrimitiveProps>`\n background: transparent;\n border: none;\n outline: none;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\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-family: inherit;\n text-align: inherit;\n resize: none;\n\n &::placeholder {\n color: ${(props) =>\n props.placeholderTextColor || \"rgba(255, 255, 255, 0.5)\"};\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nexport const TextAreaPrimitive = forwardRef<\n HTMLTextAreaElement,\n TextAreaPrimitiveProps\n>(\n (\n {\n value,\n placeholder,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n rows,\n },\n ref\n ) => {\n return (\n <StyledTextArea\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChange={(e) => onChangeText?.(e.target.value)}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n disabled={disabled}\n style={style}\n color={color}\n fontSize={fontSize}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n rows={rows}\n />\n );\n }\n);\n\nTextAreaPrimitive.displayName = \"TextAreaPrimitive\";\n","import { useState, useRef, useLayoutEffect, useCallback } from \"react\";\nimport type { ToggletipPlacement } from \"./types\";\n\ninterface UseToggletipOptions {\n open: boolean;\n direction: ToggletipPlacement;\n offset: number;\n autoDirection?: boolean;\n}\n\ninterface UseToggletipReturn {\n refs: {\n setReference: (node: HTMLElement | null) => void;\n setFloating: (node: HTMLElement | null) => void;\n };\n direction: ToggletipPlacement;\n}\n\nconst getScrollParent = (element: HTMLElement | null): HTMLElement => {\n if (!element || element === document.body) {\n return document.body;\n }\n\n const { overflow, overflowX, overflowY } = window.getComputedStyle(element);\n const scrollRegex = /(auto|scroll)/;\n const isScrollable =\n scrollRegex.test(overflow) ||\n scrollRegex.test(overflowX) ||\n scrollRegex.test(overflowY);\n\n if (\n isScrollable &&\n (element.scrollHeight > element.clientHeight ||\n element.scrollWidth > element.clientWidth)\n ) {\n return element;\n }\n\n return getScrollParent(element.parentElement);\n};\n\nconst getViewportBounds = (triggerElement: HTMLElement) => {\n const scrollParent = getScrollParent(triggerElement);\n\n if (scrollParent === document.body) {\n return {\n top: 0,\n left: 0,\n right: window.visualViewport?.width || window.innerWidth,\n bottom: window.visualViewport?.height || window.innerHeight,\n width: window.visualViewport?.width || window.innerWidth,\n height: window.visualViewport?.height || window.innerHeight,\n };\n }\n\n const rect = scrollParent.getBoundingClientRect();\n return {\n top: rect.top,\n left: rect.left,\n right: rect.right,\n bottom: rect.bottom,\n width: rect.width,\n height: rect.height,\n };\n};\n\nconst checkCollision = (\n triggerRect: DOMRect,\n toggletipRect: DOMRect,\n placement: ToggletipPlacement,\n offset: number,\n triggerElement: HTMLElement\n): ToggletipPlacement => {\n const viewport = getViewportBounds(triggerElement);\n const buffer = 10;\n\n const space = {\n top: triggerRect.top - viewport.top,\n bottom: viewport.bottom - triggerRect.bottom,\n left: triggerRect.left - viewport.left,\n right: viewport.right - triggerRect.right,\n };\n\n const centerY = triggerRect.top + triggerRect.height / 2;\n const centerX = triggerRect.left + triggerRect.width / 2;\n const halfWidth = toggletipRect.width / 2;\n const halfHeight = toggletipRect.height / 2;\n const minSpace = offset + buffer;\n\n const fits = {\n top:\n space.top >= toggletipRect.height + minSpace &&\n centerX - halfWidth >= viewport.left + buffer &&\n centerX + halfWidth <= viewport.right - buffer,\n bottom:\n space.bottom >= toggletipRect.height + minSpace &&\n centerX - halfWidth >= viewport.left + buffer &&\n centerX + halfWidth <= viewport.right - buffer,\n left:\n space.left >= toggletipRect.width + minSpace &&\n centerY - halfHeight >= viewport.top + buffer &&\n centerY + halfHeight <= viewport.bottom - buffer,\n right:\n space.right >= toggletipRect.width + minSpace &&\n centerY - halfHeight >= viewport.top + buffer &&\n centerY + halfHeight <= viewport.bottom - buffer,\n };\n\n const [primary, secondary] = placement.split(\"-\");\n\n // If current placement fits, keep it\n if (fits[primary as keyof typeof fits]) {\n return placement;\n }\n\n const opposites: Record<string, string> = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\",\n };\n\n const opposite = opposites[primary];\n if (opposite && fits[opposite as keyof typeof fits]) {\n return secondary\n ? (`${opposite}-${secondary}` as ToggletipPlacement)\n : (opposite as ToggletipPlacement);\n }\n\n const perpendicular =\n primary === \"top\" || primary === \"bottom\"\n ? [\"right\", \"left\"]\n : [\"bottom\", \"top\"];\n\n for (const dir of perpendicular) {\n if (fits[dir as keyof typeof fits]) {\n return dir as ToggletipPlacement;\n }\n }\n\n const best = Object.entries(space).sort(([, a], [, b]) => b - a)[0];\n return best[0] as ToggletipPlacement;\n};\n\nexport const useToggletip = ({\n open,\n direction,\n offset,\n autoDirection = true,\n}: UseToggletipOptions): UseToggletipReturn => {\n const [newDirection, setNewDirection] = useState(direction);\n const referenceRef = useRef<HTMLElement | null>(null);\n const floatingRef = useRef<HTMLElement | null>(null);\n\n const setReference = useCallback((node: HTMLElement | null) => {\n referenceRef.current = node;\n }, []);\n\n const setFloating = useCallback((node: HTMLElement | null) => {\n floatingRef.current = node;\n }, []);\n\n // Collision detection + continuous updates\n useLayoutEffect(() => {\n if (\n !open ||\n !autoDirection ||\n !referenceRef.current ||\n !floatingRef.current\n ) {\n return;\n }\n\n let rafId: number | null = null;\n\n const updatePlacement = () => {\n rafId = null;\n if (!referenceRef.current || !floatingRef.current) return;\n\n const triggerRect = referenceRef.current.getBoundingClientRect();\n const toggletipRect = floatingRef.current.getBoundingClientRect();\n const calculatedDirection = checkCollision(\n triggerRect,\n toggletipRect,\n direction,\n offset,\n referenceRef.current\n );\n\n setNewDirection((prev) =>\n prev === calculatedDirection ? prev : calculatedDirection\n );\n };\n\n const scheduleUpdate = () => {\n if (rafId != null) return;\n rafId = requestAnimationFrame(updatePlacement);\n };\n\n updatePlacement();\n\n // Attach scroll listener to the actual scroll parent for better performance\n const scrollParent = getScrollParent(referenceRef.current);\n const scrollTarget = scrollParent === document.body ? window : scrollParent;\n\n scrollTarget.addEventListener(\"scroll\", scheduleUpdate, {\n capture: true,\n passive: true,\n });\n window.addEventListener(\"resize\", scheduleUpdate);\n\n // Safe ResizeObserver usage for SSR compatibility\n let resizeObserver: ResizeObserver | null = null;\n if (typeof ResizeObserver !== \"undefined\") {\n resizeObserver = new ResizeObserver(scheduleUpdate);\n if (referenceRef.current) {\n resizeObserver.observe(referenceRef.current);\n }\n if (floatingRef.current) {\n resizeObserver.observe(floatingRef.current);\n }\n }\n\n return () => {\n if (rafId != null) cancelAnimationFrame(rafId);\n scrollTarget.removeEventListener(\"scroll\", scheduleUpdate, {\n capture: true,\n } as EventListenerOptions);\n window.removeEventListener(\"resize\", scheduleUpdate);\n if (resizeObserver) resizeObserver.disconnect();\n };\n }, [open, autoDirection, direction, offset]);\n\n // Reset direction when closed\n useLayoutEffect(() => {\n if (!open) {\n setNewDirection(direction);\n }\n }, [open, direction]);\n\n return {\n refs: {\n setReference,\n setFloating,\n },\n direction: newDirection,\n };\n};\n"],"mappings":";AAAA,SAAgB,cAAAA,aAAY,YAAAC,WAAU,UAAAC,SAAQ,WAAW,eAAe;;;ACAxE,OAAO,WAAW;AAClB,OAAO,YAAY;AAuMX;AApMR,IAAM,YAAY,OAAO;AAAA;AAAA;AAAA,sBAGH,CAAC,UAAU,MAAM,mBAAmB,aAAa;AAAA,kBACrD,CAAC,UAAU,MAAM,eAAe,aAAa;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C5B,UAAU;AAAA,oBACV,YAAW;AAAA,oBAEV;AAAA;AAAA,gBACH,IAEA,SAEJ;AAAA,gBAED,UACC,gBAAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,WAAW;AAAA,oBACX,eAAc;AAAA,oBACd,gBAAe;AAAA,oBACf,KAAK;AAAA,oBAEJ;AAAA;AAAA,gBACH;AAAA;AAAA;AAAA,UAEJ;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,UAAU,cAAc;","names":["forwardRef","useState","useRef","styled","jsx","styled","jsx","styled","jsx","styled","jsx","styled","jsx","forwardRef","styled","jsx","jsx","forwardRef","useState","useRef"]}
|
|
1
|
+
{"version":3,"sources":["../../src/Toggletip.tsx","../../../primitives-web/src/Box.tsx","../../../primitives-web/src/Text.tsx","../../../primitives-web/src/Spinner.tsx","../../../primitives-web/src/Icon.tsx","../../../primitives-web/src/Divider.tsx","../../../primitives-web/src/Input.tsx","../../../primitives-web/src/TextArea.tsx","../../src/useToggletip.ts"],"sourcesContent":["import React, { forwardRef, useState, useRef, useEffect, useMemo } from \"react\";\n// @ts-ignore - this will be resolved at build time\nimport { Box, Text, Divider } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem, isNative } from \"@xsolla/xui-core\";\nimport { useToggletip } from \"./useToggletip\";\nimport type { ToggletipPlacement, ToggletipProps } from \"./types\";\n\nconst getPositionStyles = (placement: ToggletipPlacement, offset: number) => {\n switch (placement) {\n case \"bottom\":\n return {\n top: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n case \"bottom-left\":\n return { top: `calc(100% + ${offset}px)`, left: 0 };\n case \"bottom-right\":\n return { top: `calc(100% + ${offset}px)`, right: 0 };\n case \"top\":\n return {\n bottom: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n case \"top-left\":\n return { bottom: `calc(100% + ${offset}px)`, left: 0 };\n case \"top-right\":\n return { bottom: `calc(100% + ${offset}px)`, right: 0 };\n case \"left\":\n return {\n right: `calc(100% + ${offset}px)`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n };\n case \"right\":\n return {\n left: `calc(100% + ${offset}px)`,\n top: \"50%\",\n transform: \"translateY(-50%)\",\n };\n default:\n return {\n bottom: `calc(100% + ${offset}px)`,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n };\n }\n};\n\nexport const Toggletip = forwardRef<any, ToggletipProps>(\n (\n {\n children,\n title,\n content,\n footer,\n width = \"288px\",\n direction = \"top\",\n autoDirection = true,\n offset = 12,\n \"data-testid\": dataTestId,\n },\n ref\n ) => {\n const [isOpen, setOpen] = useState(false);\n const containerRef = useRef<HTMLElement | null>(null);\n const { theme } = useDesignSystem();\n\n const { refs, direction: newDirection } = useToggletip({\n open: isOpen,\n direction,\n offset,\n autoDirection,\n });\n\n const toggleOpen = () => setOpen(!isOpen);\n\n useEffect(() => {\n if (!isOpen || isNative) return;\n\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n event.target instanceof Node &&\n !containerRef.current.contains(event.target)\n ) {\n setOpen(false);\n }\n };\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n setOpen(false);\n }\n };\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n document.addEventListener(\"keydown\", handleEscape);\n\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n document.removeEventListener(\"keydown\", handleEscape);\n };\n }, [isOpen]);\n\n const positionStyles = useMemo(\n () => getPositionStyles(newDirection, offset),\n [newDirection, offset]\n );\n\n return (\n <Box\n ref={(node: HTMLElement | null) => {\n containerRef.current = node;\n refs.setReference(node);\n }}\n display=\"inline-flex\"\n position=\"relative\"\n style={{ height: \"fit-content\" }}\n >\n <Box onPress={toggleOpen} style={{ cursor: \"pointer\" }}>\n {children}\n </Box>\n {isOpen && (\n <Box\n ref={refs.setFloating}\n data-testid={dataTestId}\n position=\"absolute\"\n backgroundColor={theme.colors.background.primary}\n borderRadius={4}\n borderColor={theme.colors.border.secondary}\n padding={12}\n width={width}\n zIndex={2000}\n style={{\n ...positionStyles,\n boxShadow: theme.shadow.popover,\n }}\n >\n {title && (\n <Box gap={8}>\n <Text\n color={theme.colors.content.primary}\n fontSize={24}\n lineHeight=\"28px\"\n fontWeight=\"500\"\n >\n {title}\n </Text>\n <Divider color={theme.colors.border.secondary} />\n </Box>\n )}\n {content && (\n <Box marginBottom={16} marginTop={16}>\n {typeof content === \"string\" || typeof content === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={14}\n fontWeight=\"400\"\n >\n {content}\n </Text>\n ) : (\n content\n )}\n </Box>\n )}\n {footer && (\n <Box\n marginTop={20}\n flexDirection=\"row\"\n justifyContent=\"flex-end\"\n gap={12}\n >\n {footer}\n </Box>\n )}\n </Box>\n )}\n </Box>\n );\n }\n);\n\nToggletip.displayName = \"Toggletip\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledBox = styled.div<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\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 overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\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?.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 type,\n disabled,\n id,\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 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 }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n as={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 {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledText = styled.span<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 '\"Pilat Wide Bold\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif !important'};\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\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n />\n );\n};\n","import React from \"react\";\nimport styled, { keyframes } from \"styled-components\";\nimport type { SpinnerProps } from \"@xsolla/xui-primitives-core\";\n\nconst rotate = keyframes`\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n`;\n\nconst StyledSpinner = styled.div<SpinnerProps>`\n width: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n height: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n border: ${(props) => props.strokeWidth || 2}px solid\n ${(props) => props.color || \"currentColor\"};\n border-bottom-color: transparent;\n border-radius: 50%;\n display: inline-block;\n box-sizing: border-box;\n animation: ${rotate} 1s linear infinite;\n`;\n\nexport const Spinner: React.FC<SpinnerProps> = ({\n role = \"status\",\n \"aria-label\": ariaLabel,\n \"aria-live\": ariaLive = \"polite\",\n \"aria-describedby\": ariaDescribedBy,\n testID,\n ...props\n}) => {\n return (\n <StyledSpinner\n role={role}\n aria-label={ariaLabel}\n aria-live={ariaLive}\n aria-describedby={ariaDescribedBy}\n data-testid={testID}\n {...props}\n />\n );\n};\n\nSpinner.displayName = \"Spinner\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledIcon = styled.div<IconProps>`\n display: flex;\n align-items: center;\n justify-content: center;\n width: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n height: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n color: ${(props) => props.color || \"currentColor\"};\n\n svg {\n width: 100%;\n height: 100%;\n fill: none;\n stroke: currentColor;\n }\n`;\n\nexport const Icon: React.FC<IconProps> = ({ children, ...props }) => {\n return <StyledIcon {...props}>{children}</StyledIcon>;\n};\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { DividerProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledDivider = styled.div<DividerProps>`\n background-color: ${(props) =>\n props.dashStroke\n ? \"transparent\"\n : props.color || \"rgba(255, 255, 255, 0.15)\"};\n width: ${(props) =>\n props.vertical\n ? typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"1px\"\n : \"100%\"};\n height: ${(props) =>\n props.vertical\n ? \"100%\"\n : typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"1px\"};\n\n ${(props) =>\n props.dashStroke &&\n `\n border-style: dashed;\n border-color: ${props.color || \"rgba(255, 255, 255, 0.15)\"};\n border-width: 0;\n ${\n props.vertical\n ? `\n border-left-width: ${typeof props.width === \"number\" ? `${props.width}px` : props.width || \"1px\"};\n height: 100%;\n `\n : `\n border-top-width: ${typeof props.height === \"number\" ? `${props.height}px` : props.height || \"1px\"};\n width: 100%;\n `\n }\n `}\n`;\n\nexport const Divider: React.FC<DividerProps> = (props) => {\n return <StyledDivider {...props} />;\n};\n","import React, { forwardRef } from \"react\";\nimport styled from \"styled-components\";\nimport { InputPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledInput = styled.input<InputPrimitiveProps>`\n background: transparent;\n border: none;\n outline: none;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\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-family: inherit;\n text-align: inherit;\n\n &::placeholder {\n color: ${(props) =>\n props.placeholderTextColor || \"rgba(255, 255, 255, 0.5)\"};\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nexport const InputPrimitive = forwardRef<HTMLInputElement, InputPrimitiveProps>(\n (\n {\n value,\n placeholder,\n onChange,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n secureTextEntry,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n name,\n type,\n inputMode,\n autoComplete,\n id,\n \"aria-invalid\": ariaInvalid,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel,\n \"aria-disabled\": ariaDisabled,\n \"data-testid\": dataTestId,\n ...rest\n },\n ref\n ) => {\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange) {\n onChange(e);\n }\n if (onChangeText) {\n onChangeText(e.target.value);\n }\n };\n\n // Always pass value to make it a controlled input\n const inputValue = value !== undefined ? value : \"\";\n\n return (\n <StyledInput\n ref={ref}\n id={id}\n value={inputValue}\n name={name}\n placeholder={placeholder}\n onChange={handleChange}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n disabled={disabled}\n type={secureTextEntry ? \"password\" : type || \"text\"}\n inputMode={inputMode}\n autoComplete={autoComplete}\n style={style}\n color={color}\n fontSize={fontSize}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n aria-invalid={ariaInvalid}\n aria-describedby={ariaDescribedBy}\n aria-labelledby={ariaLabelledBy}\n aria-label={ariaLabel}\n aria-disabled={ariaDisabled}\n data-testid={dataTestId}\n {...rest}\n />\n );\n }\n);\n\nInputPrimitive.displayName = \"InputPrimitive\";\n","import React, { forwardRef } from \"react\";\nimport styled from \"styled-components\";\nimport { TextAreaPrimitiveProps } from \"@xsolla/xui-primitives-core\";\n\nconst StyledTextArea = styled.textarea<TextAreaPrimitiveProps>`\n background: transparent;\n border: none;\n outline: none;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\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-family: inherit;\n text-align: inherit;\n resize: none;\n\n &::placeholder {\n color: ${(props) =>\n props.placeholderTextColor || \"rgba(255, 255, 255, 0.5)\"};\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nexport const TextAreaPrimitive = forwardRef<\n HTMLTextAreaElement,\n TextAreaPrimitiveProps\n>(\n (\n {\n value,\n placeholder,\n onChangeText,\n onFocus,\n onBlur,\n onKeyDown,\n disabled,\n style,\n color,\n fontSize,\n placeholderTextColor,\n maxLength,\n rows,\n },\n ref\n ) => {\n return (\n <StyledTextArea\n ref={ref}\n value={value}\n placeholder={placeholder}\n onChange={(e) => onChangeText?.(e.target.value)}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n disabled={disabled}\n style={style}\n color={color}\n fontSize={fontSize}\n placeholderTextColor={placeholderTextColor}\n maxLength={maxLength}\n rows={rows}\n />\n );\n }\n);\n\nTextAreaPrimitive.displayName = \"TextAreaPrimitive\";\n","import { useState, useRef, useLayoutEffect, useCallback } from \"react\";\nimport type { ToggletipPlacement } from \"./types\";\n\ninterface UseToggletipOptions {\n open: boolean;\n direction: ToggletipPlacement;\n offset: number;\n autoDirection?: boolean;\n}\n\ninterface UseToggletipReturn {\n refs: {\n setReference: (node: HTMLElement | null) => void;\n setFloating: (node: HTMLElement | null) => void;\n };\n direction: ToggletipPlacement;\n}\n\nconst getScrollParent = (element: HTMLElement | null): HTMLElement => {\n if (!element || element === document.body) {\n return document.body;\n }\n\n const { overflow, overflowX, overflowY } = window.getComputedStyle(element);\n const scrollRegex = /(auto|scroll)/;\n const isScrollable =\n scrollRegex.test(overflow) ||\n scrollRegex.test(overflowX) ||\n scrollRegex.test(overflowY);\n\n if (\n isScrollable &&\n (element.scrollHeight > element.clientHeight ||\n element.scrollWidth > element.clientWidth)\n ) {\n return element;\n }\n\n return getScrollParent(element.parentElement);\n};\n\nconst getViewportBounds = (triggerElement: HTMLElement) => {\n const scrollParent = getScrollParent(triggerElement);\n\n if (scrollParent === document.body) {\n return {\n top: 0,\n left: 0,\n right: window.visualViewport?.width || window.innerWidth,\n bottom: window.visualViewport?.height || window.innerHeight,\n width: window.visualViewport?.width || window.innerWidth,\n height: window.visualViewport?.height || window.innerHeight,\n };\n }\n\n const rect = scrollParent.getBoundingClientRect();\n return {\n top: rect.top,\n left: rect.left,\n right: rect.right,\n bottom: rect.bottom,\n width: rect.width,\n height: rect.height,\n };\n};\n\nconst checkCollision = (\n triggerRect: DOMRect,\n toggletipRect: DOMRect,\n placement: ToggletipPlacement,\n offset: number,\n triggerElement: HTMLElement\n): ToggletipPlacement => {\n const viewport = getViewportBounds(triggerElement);\n const buffer = 10;\n\n const space = {\n top: triggerRect.top - viewport.top,\n bottom: viewport.bottom - triggerRect.bottom,\n left: triggerRect.left - viewport.left,\n right: viewport.right - triggerRect.right,\n };\n\n const centerY = triggerRect.top + triggerRect.height / 2;\n const centerX = triggerRect.left + triggerRect.width / 2;\n const halfWidth = toggletipRect.width / 2;\n const halfHeight = toggletipRect.height / 2;\n const minSpace = offset + buffer;\n\n const fits = {\n top:\n space.top >= toggletipRect.height + minSpace &&\n centerX - halfWidth >= viewport.left + buffer &&\n centerX + halfWidth <= viewport.right - buffer,\n bottom:\n space.bottom >= toggletipRect.height + minSpace &&\n centerX - halfWidth >= viewport.left + buffer &&\n centerX + halfWidth <= viewport.right - buffer,\n left:\n space.left >= toggletipRect.width + minSpace &&\n centerY - halfHeight >= viewport.top + buffer &&\n centerY + halfHeight <= viewport.bottom - buffer,\n right:\n space.right >= toggletipRect.width + minSpace &&\n centerY - halfHeight >= viewport.top + buffer &&\n centerY + halfHeight <= viewport.bottom - buffer,\n };\n\n const [primary, secondary] = placement.split(\"-\");\n\n // If current placement fits, keep it\n if (fits[primary as keyof typeof fits]) {\n return placement;\n }\n\n const opposites: Record<string, string> = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\",\n };\n\n const opposite = opposites[primary];\n if (opposite && fits[opposite as keyof typeof fits]) {\n return secondary\n ? (`${opposite}-${secondary}` as ToggletipPlacement)\n : (opposite as ToggletipPlacement);\n }\n\n const perpendicular =\n primary === \"top\" || primary === \"bottom\"\n ? [\"right\", \"left\"]\n : [\"bottom\", \"top\"];\n\n for (const dir of perpendicular) {\n if (fits[dir as keyof typeof fits]) {\n return dir as ToggletipPlacement;\n }\n }\n\n const best = Object.entries(space).sort(([, a], [, b]) => b - a)[0];\n return best[0] as ToggletipPlacement;\n};\n\nexport const useToggletip = ({\n open,\n direction,\n offset,\n autoDirection = true,\n}: UseToggletipOptions): UseToggletipReturn => {\n const [newDirection, setNewDirection] = useState(direction);\n const referenceRef = useRef<HTMLElement | null>(null);\n const floatingRef = useRef<HTMLElement | null>(null);\n\n const setReference = useCallback((node: HTMLElement | null) => {\n referenceRef.current = node;\n }, []);\n\n const setFloating = useCallback((node: HTMLElement | null) => {\n floatingRef.current = node;\n }, []);\n\n // Collision detection + continuous updates\n useLayoutEffect(() => {\n if (\n !open ||\n !autoDirection ||\n !referenceRef.current ||\n !floatingRef.current\n ) {\n return;\n }\n\n let rafId: number | null = null;\n\n const updatePlacement = () => {\n rafId = null;\n if (!referenceRef.current || !floatingRef.current) return;\n\n const triggerRect = referenceRef.current.getBoundingClientRect();\n const toggletipRect = floatingRef.current.getBoundingClientRect();\n const calculatedDirection = checkCollision(\n triggerRect,\n toggletipRect,\n direction,\n offset,\n referenceRef.current\n );\n\n setNewDirection((prev) =>\n prev === calculatedDirection ? prev : calculatedDirection\n );\n };\n\n const scheduleUpdate = () => {\n if (rafId != null) return;\n rafId = requestAnimationFrame(updatePlacement);\n };\n\n updatePlacement();\n\n // Attach scroll listener to the actual scroll parent for better performance\n const scrollParent = getScrollParent(referenceRef.current);\n const scrollTarget = scrollParent === document.body ? window : scrollParent;\n\n scrollTarget.addEventListener(\"scroll\", scheduleUpdate, {\n capture: true,\n passive: true,\n });\n window.addEventListener(\"resize\", scheduleUpdate);\n\n // Safe ResizeObserver usage for SSR compatibility\n let resizeObserver: ResizeObserver | null = null;\n if (typeof ResizeObserver !== \"undefined\") {\n resizeObserver = new ResizeObserver(scheduleUpdate);\n if (referenceRef.current) {\n resizeObserver.observe(referenceRef.current);\n }\n if (floatingRef.current) {\n resizeObserver.observe(floatingRef.current);\n }\n }\n\n return () => {\n if (rafId != null) cancelAnimationFrame(rafId);\n scrollTarget.removeEventListener(\"scroll\", scheduleUpdate, {\n capture: true,\n } as EventListenerOptions);\n window.removeEventListener(\"resize\", scheduleUpdate);\n if (resizeObserver) resizeObserver.disconnect();\n };\n }, [open, autoDirection, direction, offset]);\n\n // Reset direction when closed\n useLayoutEffect(() => {\n if (!open) {\n setNewDirection(direction);\n }\n }, [open, direction]);\n\n return {\n refs: {\n setReference,\n setFloating,\n },\n direction: newDirection,\n };\n};\n"],"mappings":";AAAA,SAAgB,cAAAA,aAAY,YAAAC,WAAU,UAAAC,SAAQ,WAAW,eAAe;;;ACAxE,OAAO,WAAW;AAClB,OAAO,YAAY;AAuMX;AApMR,IAAM,YAAY,OAAO;AAAA;AAAA;AAAA,sBAGH,CAAC,UAAU,MAAM,mBAAmB,aAAa;AAAA,kBACrD,CAAC,UAAU,MAAM,eAAe,aAAa;AAAA,kBAC7C,CAAC,UACf,OAAO,MAAM,gBAAgB,WACzB,GAAG,MAAM,WAAW,OACpB,MAAM,eAAe,CAAC;AAAA;AAAA,IAE1B,CAAC,UACD,MAAM,sBAAsB,UAC5B;AAAA,2BACuB,OAAO,MAAM,sBAAsB,WAAW,GAAG,MAAM,iBAAiB,OAAO,MAAM,iBAAiB;AAAA,2BACtG,MAAM,qBAAqB,MAAM,eAAe,aAAa;AAAA;AAAA,GAErF;AAAA,IACC,CAAC,UACD,MAAM,mBAAmB,UACzB;AAAA,wBACoB,OAAO,MAAM,mBAAmB,WAAW,GAAG,MAAM,cAAc,OAAO,MAAM,cAAc;AAAA,wBAC7F,MAAM,kBAAkB,MAAM,eAAe,aAAa;AAAA;AAAA,GAE/E;AAAA,IACC,CAAC,UACD,MAAM,oBAAoB,UAC1B;AAAA,yBACqB,OAAO,MAAM,oBAAoB,WAAW,GAAG,MAAM,eAAe,OAAO,MAAM,eAAe;AAAA,yBAChG,MAAM,mBAAmB,MAAM,eAAe,aAAa;AAAA;AAAA,GAEjF;AAAA,IACC,CAAC,UACD,MAAM,qBAAqB,UAC3B;AAAA,0BACsB,OAAO,MAAM,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AAW,MAAM,OAAO;AAAA,cAC1B;AAAA,cAEC;AAAA,yBACC,qBAAC,OAAI,KAAK,GACR;AAAA,kCAAAA;AAAA,oBAAC;AAAA;AAAA,sBACC,OAAO,MAAM,OAAO,QAAQ;AAAA,sBAC5B,UAAU;AAAA,sBACV,YAAW;AAAA,sBACX,YAAW;AAAA,sBAEV;AAAA;AAAA,kBACH;AAAA,kBACA,gBAAAA,KAAC,WAAQ,OAAO,MAAM,OAAO,OAAO,WAAW;AAAA,mBACjD;AAAA,gBAED,WACC,gBAAAA,KAAC,OAAI,cAAc,IAAI,WAAW,IAC/B,iBAAO,YAAY,YAAY,OAAO,YAAY,WACjD,gBAAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,OAAO,MAAM,OAAO,QAAQ;AAAA,oBAC5B,UAAU;AAAA,oBACV,YAAW;AAAA,oBAEV;AAAA;AAAA,gBACH,IAEA,SAEJ;AAAA,gBAED,UACC,gBAAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,WAAW;AAAA,oBACX,eAAc;AAAA,oBACd,gBAAe;AAAA,oBACf,KAAK;AAAA,oBAEJ;AAAA;AAAA,gBACH;AAAA;AAAA;AAAA,UAEJ;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,UAAU,cAAc;","names":["forwardRef","useState","useRef","styled","jsx","styled","jsx","styled","jsx","styled","jsx","styled","jsx","forwardRef","styled","jsx","jsx","forwardRef","useState","useRef"]}
|