@xsolla/xui-toast 0.225.0 → 0.226.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -27,7 +27,7 @@ A toast is a short, non-blocking message that appears temporarily to inform the
27
27
  ### Behaviour guidelines
28
28
  - Toasts appear at the top of the viewport, offset from the status bar or navigation
29
29
  - They auto-dismiss after a set duration (typically 3–5 seconds) — the exact timing is set at the product layer
30
- - The description is not truncated: the toast grows to fit its content. Opt into a line limit with `descriptionLines` only when the layout cannot absorb the extra height
30
+ - Neither the title nor the description is truncated: long text wraps onto multiple lines and the toast grows in height to fit it, while the icon, action and close button stay vertically centred. Opt into a line limit with `titleLines` / `descriptionLines` only when the layout cannot absorb the extra height
31
31
  - When Button=False, a close (×) icon is shown — tapping it dismisses the toast immediately
32
32
  - When Button=True, the action button replaces the close icon — the toast can be dismissed by tapping the button or waiting for auto-dismiss
33
33
  - Multiple toasts stack in a ToastGroup — see below
@@ -118,7 +118,8 @@ The individual toast cell. Used internally by `ToastGroup`, but can be rendered
118
118
  | ------------------ | ------------------------------------------------ | ----------- | ------------------------------------------------------------------ |
119
119
  | `id` | `string` | - | Required unique identifier. |
120
120
  | `type` | `"alert" \| "success" \| "neutral" \| "warning"` | `"neutral"` | Visual and accessibility type. |
121
- | `title` | `string` | - | Short primary text, ideally 1 to 5 words. Always clamped to one line. |
121
+ | `title` | `string` | - | Short primary text, ideally 1 to 5 words. Not clamped by default — a long title wraps and the toast grows to fit. |
122
+ | `titleLines` | `number` | - | Clamp the title to this many lines, cutting overflow with an ellipsis. Omitted = no clamp; the toast grows to fit. |
122
123
  | `description` | `string` | - | Optional supporting text. Not clamped by default. |
123
124
  | `descriptionLines` | `number` | - | Clamp the description to this many lines, cutting overflow with an ellipsis. Omitted = no clamp; the toast grows to fit. |
124
125
  | `icon` | `boolean \| ReactNode` | `true` | Show the default icon, hide it with `false`, or pass a custom one. |
@@ -163,7 +164,8 @@ Hook that returns toast helpers. Throws if called outside a `ToastProvider`.
163
164
  | Property | Type | Default | Description |
164
165
  | ------------------ | ------------------------------------------------ | ---------------------------- | ------------------------------------------------------------------ |
165
166
  | `type` | `"alert" \| "success" \| "neutral" \| "warning"` | `"neutral"` | Visual and accessibility type. |
166
- | `title` | `string` | - | Short primary text. |
167
+ | `title` | `string` | - | Short primary text. Not clamped by default. |
168
+ | `titleLines` | `number` | - | Clamp the title to this many lines. Omitted = no clamp. |
167
169
  | `description` | `string` | - | Optional supporting text. Not clamped by default. |
168
170
  | `descriptionLines` | `number` | - | Clamp the description to this many lines. Omitted = no clamp. |
169
171
  | `icon` | `boolean \| ReactNode` | `true` | Show, hide, or override the icon. |
@@ -181,6 +183,7 @@ Internal shape exposed via `ToastContext.toasts`.
181
183
  | `id` | `string` | Unique identifier generated by the provider. |
182
184
  | `type` | `ToastType` | Toast type. |
183
185
  | `title` | `string` | Primary text. |
186
+ | `titleLines` | `number` | Optional title line clamp. |
184
187
  | `description` | `string` | Supporting text. |
185
188
  | `descriptionLines` | `number` | Optional description line clamp. |
186
189
  | `duration` | `number` | Auto-dismiss duration. |
@@ -272,6 +275,34 @@ export default function LongDescription() {
272
275
  }
273
276
  ```
274
277
 
278
+ ### Long titles and single-sentence messages
279
+
280
+ The title wraps onto several lines and the toast grows to fit, so a
281
+ single-sentence message can be passed as the title alone — no description
282
+ needed. Pass `titleLines` only when the layout cannot absorb a taller toast;
283
+ `titleLines: 1` restores the single-line ellipsis.
284
+
285
+ ```tsx
286
+ import * as React from "react";
287
+ import { useToast } from "@xsolla/xui-toast";
288
+
289
+ export default function LongTitle() {
290
+ const toast = useToast();
291
+ return (
292
+ <button
293
+ onClick={() =>
294
+ toast.success({
295
+ title:
296
+ "Quest activated — complete all three daily tasks before midnight to claim your reward",
297
+ })
298
+ }
299
+ >
300
+ Show single-sentence toast
301
+ </button>
302
+ );
303
+ }
304
+ ```
305
+
275
306
  ### Standalone Toast With Action
276
307
 
277
308
  ```tsx
@@ -362,6 +393,7 @@ export default function BottomRight() {
362
393
 
363
394
  - **"useToast must be used within a ToastProvider"** - ensure the calling component is a descendant of `ToastProvider`.
364
395
  - **Description text is cut off with an ellipsis** - a `descriptionLines` value is clamping it. Remove the prop to let the toast grow to fit, or raise the limit.
396
+ - **Title text is cut off with an ellipsis** - a `titleLines` value is clamping it. Remove the prop to let the title wrap, or raise the limit.
365
397
  - **Toasts hidden on React Native** - wrap content in `<View style={{ flex: 1 }}>` inside `ToastProvider`.
366
398
  - **Toasts appear behind a modal (web)** - `ToastGroup` uses `z-index: 9999`. Place `ToastProvider` above the modal in the tree, or adjust z-index.
367
399
  - **Auto-dismiss not working** - `duration: 0` disables auto-dismiss; check both per-toast and provider defaults.
@@ -9,6 +9,7 @@ interface ToastData {
9
9
  id: string;
10
10
  type: ToastType;
11
11
  title?: string;
12
+ titleLines?: number;
12
13
  description?: string;
13
14
  descriptionLines?: number;
14
15
  icon?: boolean | ReactNode;
@@ -30,6 +31,13 @@ interface ToastProps extends ThemeOverrideProps {
30
31
  id: string;
31
32
  type?: ToastType;
32
33
  title?: string;
34
+ /**
35
+ * Clamp the title to this many lines. Omitted (the default) means no clamp:
36
+ * a long title wraps onto several lines and the toast grows to fit it, as
37
+ * specified in the Figma toast "Content behaviour" section. Opt into a limit
38
+ * only when the surrounding layout genuinely cannot absorb the extra height.
39
+ */
40
+ titleLines?: number;
33
41
  description?: string;
34
42
  /**
35
43
  * Clamp the description to this many lines. Omitted (the default) means no
@@ -51,6 +59,8 @@ interface ToastProps extends ThemeOverrideProps {
51
59
  interface ToastOptions {
52
60
  type?: ToastType;
53
61
  title?: string;
62
+ /** Clamp the title to this many lines. Omitted = no clamp. */
63
+ titleLines?: number;
54
64
  description?: string;
55
65
  /** Clamp the description to this many lines. Omitted = no clamp. */
56
66
  descriptionLines?: number;
package/native/index.d.ts CHANGED
@@ -9,6 +9,7 @@ interface ToastData {
9
9
  id: string;
10
10
  type: ToastType;
11
11
  title?: string;
12
+ titleLines?: number;
12
13
  description?: string;
13
14
  descriptionLines?: number;
14
15
  icon?: boolean | ReactNode;
@@ -30,6 +31,13 @@ interface ToastProps extends ThemeOverrideProps {
30
31
  id: string;
31
32
  type?: ToastType;
32
33
  title?: string;
34
+ /**
35
+ * Clamp the title to this many lines. Omitted (the default) means no clamp:
36
+ * a long title wraps onto several lines and the toast grows to fit it, as
37
+ * specified in the Figma toast "Content behaviour" section. Opt into a limit
38
+ * only when the surrounding layout genuinely cannot absorb the extra height.
39
+ */
40
+ titleLines?: number;
33
41
  description?: string;
34
42
  /**
35
43
  * Clamp the description to this many lines. Omitted (the default) means no
@@ -51,6 +59,8 @@ interface ToastProps extends ThemeOverrideProps {
51
59
  interface ToastOptions {
52
60
  type?: ToastType;
53
61
  title?: string;
62
+ /** Clamp the title to this many lines. Omitted = no clamp. */
63
+ titleLines?: number;
54
64
  description?: string;
55
65
  /** Clamp the description to this many lines. Omitted = no clamp. */
56
66
  descriptionLines?: number;
package/native/index.js CHANGED
@@ -456,6 +456,11 @@ var Toast = ({
456
456
  id,
457
457
  type = "neutral",
458
458
  title,
459
+ // No clamp by default: a long title wraps onto several lines and the toast
460
+ // grows to fit it, per the Figma "Content behaviour" spec. A hardcoded
461
+ // single-line clamp cut single-sentence messages off with an ellipsis
462
+ // (XUITSD-118). Consumers that genuinely need a cap opt in via `titleLines`.
463
+ titleLines,
459
464
  description,
460
465
  // No clamp by default: the toast grows to fit the description. A hardcoded
461
466
  // line limit silently truncated real error copy at narrow widths (XUITSD-20),
@@ -575,11 +580,12 @@ var Toast = ({
575
580
  title && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
576
581
  Text,
577
582
  {
583
+ testID: "toast-title",
578
584
  color: colorScheme.text,
579
585
  fontSize: config.fontSize,
580
586
  lineHeight: config.lineHeight,
581
587
  fontWeight: "500",
582
- numberOfLines: 1,
588
+ numberOfLines: titleLines,
583
589
  children: title
584
590
  }
585
591
  ),
@@ -722,6 +728,7 @@ var ToastGroup = (0, import_react3.memo)(
722
728
  id: toast.id,
723
729
  type: toast.type,
724
730
  title: toast.title,
731
+ titleLines: toast.titleLines,
725
732
  description: toast.description,
726
733
  descriptionLines: toast.descriptionLines,
727
734
  icon: toast.icon,
@@ -777,6 +784,7 @@ var ToastProvider = ({
777
784
  id,
778
785
  type: options.type ?? "neutral",
779
786
  title: options.title,
787
+ titleLines: options.titleLines,
780
788
  description: options.description,
781
789
  descriptionLines: options.descriptionLines,
782
790
  icon: options.icon,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx","../../src/Toast.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/Text.tsx","../../../../foundation/primitives-native/src/Icon.tsx","../../src/ToastGroup.native.tsx","../../src/ToastProvider.tsx","../../src/ToastContext.tsx","../../src/useToast.ts"],"sourcesContent":["export { Toast } from \"./Toast\";\nexport { ToastGroup } from \"./ToastGroup\";\nexport { ToastProvider } from \"./ToastProvider\";\nexport { ToastContext } from \"./ToastContext\";\nexport { useToast } from \"./useToast\";\nexport type { UseToastReturn } from \"./useToast\";\nexport * from \"./types\";\n","import React, {\n cloneElement,\n isValidElement,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme } from \"@xsolla/xui-core\";\nimport {\n CheckCr,\n ExclamationMarkCr,\n InfoCr,\n Remove,\n Warning as WarningIcon,\n} from \"@xsolla/xui-icons-base\";\nimport type { ToastColorScheme, ToastProps, ToastType } from \"./types\";\n\nconst TOAST_COLORS: Record<ToastType, string> = {\n alert: \"#ff553d\",\n success: \"#47d94a\",\n neutral: \"#7899a1\",\n warning: \"#ffb95c\",\n};\nconst DEFAULT_COLOR_SCHEME: ToastColorScheme = {\n background: \"#34474b\",\n text: \"#ffffff\",\n descriptionText: \"rgba(255, 255, 255, 0.7)\",\n divider: \"rgba(255, 255, 255, 0.16)\",\n actionText: \"#ffffff\",\n};\n\nconst getDefaultIcon = (\n type: ToastType,\n size: number,\n color: string\n): React.ReactNode => {\n switch (type) {\n case \"success\":\n return (\n <CheckCr\n variant=\"solid\"\n size={size}\n color={color}\n data-testid=\"toast-icon-success\"\n />\n );\n case \"neutral\":\n return (\n <InfoCr\n variant=\"solid\"\n size={size}\n color={color}\n data-testid=\"toast-icon-neutral\"\n />\n );\n case \"warning\":\n return (\n <WarningIcon\n variant=\"solid\"\n size={size}\n color={color}\n data-testid=\"toast-icon-warning\"\n />\n );\n case \"alert\":\n default:\n return (\n <ExclamationMarkCr\n variant=\"solid\"\n size={size}\n color={color}\n data-testid=\"toast-icon-alert\"\n />\n );\n }\n};\n\nconst ANIMATION_DURATION = 200;\nconst PROGRESS_HEIGHT = 4;\nconst TOAST_CONFIG = {\n minHeight: 56,\n paddingHorizontal: 16,\n paddingVertical: 12,\n gap: 12,\n iconSize: 24,\n closeButtonSize: 24,\n closeIconSize: 20,\n fontSize: 16,\n lineHeight: 20,\n maxWidth: 440,\n};\n\ntype ActionProps = {\n children?: React.ReactNode;\n size?: \"xs\";\n variant?: \"inverse\";\n background?: boolean;\n themeMode?: ToastProps[\"themeMode\"];\n themeProductContext?: ToastProps[\"themeProductContext\"];\n};\n\nexport const Toast: React.FC<ToastProps> = ({\n id,\n type = \"neutral\",\n title,\n description,\n // No clamp by default: the toast grows to fit the description. A hardcoded\n // line limit silently truncated real error copy at narrow widths (XUITSD-20),\n // and translations only make the strings longer. Consumers that genuinely\n // need a cap opt in via `descriptionLines`.\n descriptionLines,\n icon = true,\n action,\n showCloseButton = true,\n progress = false,\n duration,\n onClose,\n colorScheme = DEFAULT_COLOR_SCHEME,\n testID,\n themeMode,\n themeProductContext,\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const config = TOAST_CONFIG;\n const [visible, setVisible] = useState(false);\n const [dismissing, setDismissing] = useState(false);\n const [progressComplete, setProgressComplete] = useState(false);\n\n // Hold the latest `onClose` in a ref so `handleClose` can stay referentially\n // stable. `ToastGroup` renders every toast with\n // `onClose={() => onDismiss(toast.id)}` — a brand new closure on each render.\n // Depending on it directly would re-run the auto-dismiss effect (and restart\n // the countdown) every time the toast list changed, so a newly added toast\n // would reset the timers of the ones already on screen. See FEP-861.\n const onCloseRef = useRef(onClose);\n useEffect(() => {\n onCloseRef.current = onClose;\n }, [onClose]);\n\n // Re-entry guard for `handleClose`. A ref rather than the `dismissing` state\n // so the callback does not need `dismissing` in its dependency list.\n const dismissingRef = useRef(false);\n\n useEffect(() => {\n const frame = requestAnimationFrame(() => setVisible(true));\n return () => cancelAnimationFrame(frame);\n }, []);\n\n const handleClose = useCallback(() => {\n if (dismissingRef.current) return;\n dismissingRef.current = true;\n setDismissing(true);\n setTimeout(() => onCloseRef.current?.(), ANIMATION_DURATION);\n }, []);\n\n // Deliberately depends only on `duration` (and the now-stable `handleClose`):\n // each toast owns its countdown and siblings mounting or unmounting must not\n // restart it.\n useEffect(() => {\n if (!duration || duration <= 0) return;\n const timer = setTimeout(handleClose, duration);\n return () => clearTimeout(timer);\n }, [duration, handleClose]);\n\n const shouldAnimateProgress = progress && Boolean(duration && duration > 0);\n\n useEffect(() => {\n if (!shouldAnimateProgress) {\n setProgressComplete(false);\n return;\n }\n\n setProgressComplete(false);\n const frame = requestAnimationFrame(() => setProgressComplete(true));\n\n return () => cancelAnimationFrame(frame);\n }, [duration, shouldAnimateProgress]);\n\n const iconColor = TOAST_COLORS[type];\n const shouldShowIcon = icon !== false;\n const displayIcon =\n icon === true || icon === undefined\n ? getDefaultIcon(type, config.iconSize, iconColor)\n : icon;\n const renderedAction =\n isValidElement<ActionProps>(action) && typeof action.type !== \"string\"\n ? cloneElement(action, {\n size: \"xs\",\n variant: \"inverse\",\n background: false,\n themeMode: \"dark\",\n themeProductContext,\n children: (\n <span style={{ color: colorScheme.actionText }}>\n {action.props.children}\n </span>\n ),\n })\n : action;\n const hasAction = Boolean(action);\n const hasCloseButton = showCloseButton && Boolean(onClose);\n const hasActions = hasAction || hasCloseButton;\n const role = type === \"neutral\" || type === \"success\" ? \"status\" : \"alert\";\n const ariaLive =\n type === \"neutral\" || type === \"success\" ? \"polite\" : \"assertive\";\n\n return (\n <Box\n testID={testID}\n backgroundColor={colorScheme.background}\n borderRadius={theme.shape.toast.borderRadius}\n minHeight={config.minHeight}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n overflow=\"hidden\"\n width={config.maxWidth}\n maxWidth=\"100%\"\n role={role}\n aria-live={ariaLive}\n data-toast-id={id}\n style={{\n opacity: visible && !dismissing ? 1 : 0,\n transform:\n visible && !dismissing ? \"translateY(0)\" : \"translateY(-8px)\",\n transition: `opacity ${ANIMATION_DURATION}ms ease-out, transform ${ANIMATION_DURATION}ms ease-out`,\n boxShadow: colorScheme.shadow,\n backdropFilter: colorScheme.backdropFilter,\n }}\n >\n <Box\n flex={1}\n minHeight={config.minHeight}\n minWidth={0}\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={config.gap}\n paddingHorizontal={config.paddingHorizontal}\n paddingVertical={config.paddingVertical}\n >\n {shouldShowIcon && (\n <Box\n width={config.iconSize}\n height={config.iconSize}\n alignItems=\"center\"\n justifyContent=\"center\"\n flexShrink={0}\n >\n {icon === true || icon === undefined ? (\n displayIcon\n ) : (\n <Icon size={config.iconSize} color={iconColor}>\n {displayIcon}\n </Icon>\n )}\n </Box>\n )}\n\n <Box flex={1} minWidth={0} gap={2}>\n {title && (\n <Text\n color={colorScheme.text}\n fontSize={config.fontSize}\n lineHeight={config.lineHeight}\n fontWeight=\"500\"\n numberOfLines={1}\n >\n {title}\n </Text>\n )}\n {description && (\n <Text\n testID=\"toast-description\"\n color={colorScheme.descriptionText}\n fontSize={14}\n lineHeight={18}\n numberOfLines={descriptionLines}\n >\n {description}\n </Text>\n )}\n </Box>\n\n {hasActions && (\n <Box\n height={32}\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={config.gap}\n flexShrink={0}\n >\n {renderedAction}\n\n {hasAction && hasCloseButton && (\n <Box\n width={1}\n height=\"100%\"\n backgroundColor={colorScheme.divider}\n testID=\"toast-divider\"\n />\n )}\n\n {hasCloseButton && (\n <Box\n onPress={handleClose}\n width={config.closeButtonSize}\n height={config.closeButtonSize}\n alignItems=\"center\"\n justifyContent=\"center\"\n flexShrink={0}\n role=\"button\"\n aria-label=\"Dismiss notification\"\n >\n <Remove\n variant=\"line\"\n size={config.closeIconSize}\n color={colorScheme.text}\n />\n </Box>\n )}\n </Box>\n )}\n </Box>\n\n {progress && (\n <Box\n testID=\"toast-progress\"\n position=\"absolute\"\n left={0}\n right={0}\n bottom={0}\n height={PROGRESS_HEIGHT}\n overflow=\"hidden\"\n >\n <Box\n testID=\"toast-progress-bar\"\n width=\"100%\"\n height=\"100%\"\n backgroundColor={iconColor}\n style={{\n transform: `scaleX(${progressComplete ? 0 : 1})`,\n transformOrigin: \"left center\",\n transition: shouldAnimateProgress\n ? `transform ${duration}ms linear`\n : undefined,\n }}\n />\n </Box>\n )}\n </Box>\n );\n};\n\nToast.displayName = \"Toast\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n AccessibilityRole,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleToAccessibilityRole: Record<string, AccessibilityRole> = {\n button: \"button\",\n link: \"link\",\n img: \"image\",\n image: \"image\",\n summary: \"summary\",\n switch: \"switch\",\n checkbox: \"checkbox\",\n radio: \"radio\",\n heading: \"header\",\n text: \"text\",\n search: \"search\",\n alert: \"alert\",\n none: \"none\",\n presentation: \"none\",\n progressbar: \"progressbar\",\n scrollbar: \"scrollbar\",\n adjustable: \"adjustable\",\n tab: \"tab\",\n menu: \"menu\",\n menuitem: \"menuitem\",\n list: \"list\",\n timer: \"timer\",\n};\n\n/** RN ViewStyle.gap is typed as number (Yoga gap), not DimensionValue. */\nconst toGapValue = (gap: number | string | undefined): number | undefined => {\n if (gap === undefined) return undefined;\n if (typeof gap === \"number\") return gap;\n const pxMatch = /^(\\d+(?:\\.\\d+)?)px$/.exec(gap);\n if (pxMatch) return Number(pxMatch[1]);\n const asNumber = Number(gap);\n return Number.isFinite(asNumber) ? asNumber : undefined;\n};\n\n/**\n * Yoga has no inline formatting context, so RN's ViewStyle.display only\n * accepts \"flex\" | \"none\". Every inline-ish web value collapses to a plain\n * flex container — the box already fills only its content on native, which is\n * what those callers wanted on web anyway. Returning undefined (rather than\n * \"flex\") leaves RN's own default in place.\n */\nconst toNativeDisplay = (\n display: BoxProps[\"display\"]\n): ViewStyle[\"display\"] => (display === \"none\" ? \"none\" : undefined);\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 display,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n flexShrink,\n gap,\n overflow,\n opacity,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n disabled,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n opacity: opacity ?? (disabled ? 0.5 : undefined),\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n display: toNativeDisplay(display),\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n flexShrink,\n gap: toGapValue(gap),\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Map web a11y props; drop the rest of the web-only attributes before\n // spreading onto RN hosts (unknown props warn at runtime).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n className,\n \"data-testid\": _dataTestId,\n cursor: _cursor,\n type: _type,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n const accessibilityRole =\n (typeof role === \"string\" && roleToAccessibilityRole[role]) ||\n (as === \"button\" ? \"button\" : undefined);\n const isDisabled = Boolean(disabled || ariaDisabled);\n const accessibilityState = {\n disabled: isDisabled || undefined,\n busy: Boolean(ariaBusy) || undefined,\n };\n const accessibilityLiveRegion =\n ariaLive === \"polite\" || ariaLive === \"assertive\" ? ariaLive : undefined;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : alt}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n // Prefer Pressable whenever the node is interactive or explicitly a button,\n // so disabled / aria-disabled controls stay in the a11y tree as buttons.\n if (onPress || as === \"button\") {\n return (\n <Pressable\n onPress={!isDisabled && onPress ? onPress : undefined}\n disabled={isDisabled}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={\n typeof ariaLabel === \"string\" ? ariaLabel : undefined\n }\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : undefined}\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={dataTestId || testID || id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Icon: React.FC<IconProps> = ({\n children,\n color,\n size,\n testID,\n \"data-testid\": dataTestId,\n}) => {\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 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 (\n <View style={style} testID={dataTestId || testID}>\n {childrenWithProps}\n </View>\n );\n};\n","import React, { memo } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, TOAST_LAYER } from \"@xsolla/xui-core\";\nimport { Toast } from \"./Toast\";\nimport type { ToastGroupProps } from \"./types\";\n\nconst TOAST_GROUP_CONFIG = {\n containerPadding: 12,\n groupGap: 8,\n};\n\nexport const ToastGroup = memo(\n ({\n toasts,\n position = \"top\",\n maxWidth,\n onDismiss,\n testID,\n themeMode,\n themeProductContext,\n }: ToastGroupProps) => {\n useResolvedTheme({ themeMode, themeProductContext });\n const config = TOAST_GROUP_CONFIG;\n\n if (toasts.length === 0) {\n return null;\n }\n\n const positionStyles =\n position === \"top\"\n ? { top: config.containerPadding, bottom: undefined }\n : { top: undefined, bottom: config.containerPadding };\n\n return (\n <Box\n testID={testID}\n position=\"absolute\"\n left={0}\n right={0}\n zIndex={TOAST_LAYER}\n alignItems=\"center\"\n paddingHorizontal={config.containerPadding}\n pointerEvents=\"box-none\"\n {...positionStyles}\n >\n <Box\n width=\"100%\"\n maxWidth={maxWidth}\n gap={config.groupGap}\n flexDirection=\"column\"\n >\n {toasts.map((toast) => (\n <Toast\n key={toast.id}\n id={toast.id}\n type={toast.type}\n title={toast.title}\n description={toast.description}\n descriptionLines={toast.descriptionLines}\n icon={toast.icon}\n action={toast.action}\n showCloseButton={toast.showCloseButton}\n progress={toast.progress}\n duration={toast.duration}\n onClose={() => onDismiss(toast.id)}\n />\n ))}\n </Box>\n </Box>\n );\n }\n);\n\nToastGroup.displayName = \"ToastGroup\";\n","import React, { useCallback, useMemo, useState } from \"react\";\nimport { ToastContext } from \"./ToastContext\";\nimport { ToastGroup } from \"./ToastGroup\";\nimport type { ToastProviderProps, ToastData, ToastOptions } from \"./types\";\n\nlet toastIdCounter = 0;\n\nconst generateToastId = (): string => {\n return `toast-${++toastIdCounter}-${Date.now()}`;\n};\n\nexport const ToastProvider: React.FC<ToastProviderProps> = ({\n children,\n position = \"top\",\n align = \"center\",\n defaultDuration = 5000,\n maxWidth,\n testID,\n}) => {\n const [toasts, setToasts] = useState<ToastData[]>([]);\n\n const dismissToast = useCallback((id: string) => {\n setToasts((prev) => prev.filter((toast) => toast.id !== id));\n }, []);\n\n const dismissAllToasts = useCallback(() => {\n setToasts([]);\n }, []);\n\n const addToast = useCallback(\n (options: ToastOptions): string => {\n const id = generateToastId();\n const duration = options.duration ?? defaultDuration;\n\n const newToast: ToastData = {\n id,\n type: options.type ?? \"neutral\",\n title: options.title,\n description: options.description,\n descriptionLines: options.descriptionLines,\n icon: options.icon,\n action: options.action,\n showCloseButton: options.showCloseButton,\n progress: options.progress,\n duration,\n };\n\n setToasts((prev) => [...prev, newToast]);\n\n return id;\n },\n [defaultDuration]\n );\n\n const contextValue = useMemo(\n () => ({\n toasts,\n addToast,\n dismissToast,\n dismissAllToasts,\n }),\n [toasts, addToast, dismissToast, dismissAllToasts]\n );\n\n return (\n <ToastContext.Provider value={contextValue}>\n {children}\n <ToastGroup\n toasts={toasts}\n position={position}\n align={align}\n maxWidth={maxWidth}\n onDismiss={dismissToast}\n testID={testID}\n />\n </ToastContext.Provider>\n );\n};\n","import { createContext } from \"react\";\nimport type { ToastContextType } from \"./types\";\n\nexport const ToastContext = createContext<ToastContextType | null>(null);\n","import { useContext, useCallback } from \"react\";\nimport { ToastContext } from \"./ToastContext\";\nimport type { ToastOptions } from \"./types\";\n\nexport interface UseToastReturn {\n /** Show a toast with custom options */\n toast: (options: ToastOptions) => string;\n /** Show an alert toast */\n alert: (options: Omit<ToastOptions, \"type\">) => string;\n /** Show a success toast */\n success: (options: Omit<ToastOptions, \"type\">) => string;\n /** Show a neutral toast */\n neutral: (options: Omit<ToastOptions, \"type\">) => string;\n /** Show a warning toast */\n warning: (options: Omit<ToastOptions, \"type\">) => string;\n /** Dismiss a specific toast by ID */\n dismiss: (id: string) => void;\n /** Dismiss all toasts */\n dismissAll: () => void;\n}\n\nexport const useToast = (): UseToastReturn => {\n const context = useContext(ToastContext);\n\n if (!context) {\n throw new Error(\"useToast must be used within a ToastProvider\");\n }\n\n const { addToast, dismissToast, dismissAllToasts } = context;\n\n const toast = useCallback(\n (options: ToastOptions): string => {\n return addToast(options);\n },\n [addToast]\n );\n\n const alert = useCallback(\n (options: Omit<ToastOptions, \"type\">): string => {\n return addToast({ ...options, type: \"alert\" });\n },\n [addToast]\n );\n\n const success = useCallback(\n (options: Omit<ToastOptions, \"type\">): string => {\n return addToast({ ...options, type: \"success\" });\n },\n [addToast]\n );\n\n const neutral = useCallback(\n (options: Omit<ToastOptions, \"type\">): string => {\n return addToast({ ...options, type: \"neutral\" });\n },\n [addToast]\n );\n\n const warning = useCallback(\n (options: Omit<ToastOptions, \"type\">): string => {\n return addToast({ ...options, type: \"warning\" });\n },\n [addToast]\n );\n\n const dismiss = useCallback(\n (id: string): void => {\n dismissToast(id);\n },\n [dismissToast]\n );\n\n const dismissAll = useCallback((): void => {\n dismissAllToasts();\n }, [dismissAllToasts]);\n\n return {\n toast,\n alert,\n success,\n neutral,\n warning,\n dismiss,\n dismissAll,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA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A,IACjD;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,QAAM,cAAU;AAAA,IACd,CAAC,YAAgD;AAC/C,aAAO,SAAS,EAAE,GAAG,SAAS,MAAM,UAAU,CAAC;AAAA,IACjD;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,QAAM,cAAU;AAAA,IACd,CAAC,OAAqB;AACpB,mBAAa,EAAE;AAAA,IACjB;AAAA,IACA,CAAC,YAAY;AAAA,EACf;AAEA,QAAM,iBAAa,2BAAY,MAAY;AACzC,qBAAiB;AAAA,EACnB,GAAG,CAAC,gBAAgB,CAAC;AAErB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["import_react","import_react_native","import_jsx_runtime","RNText","import_react_native","import_jsx_runtime","React","import_jsx_runtime","WarningIcon","import_react","import_xui_core","import_jsx_runtime","import_react","import_react","import_jsx_runtime","import_react"]}
1
+ {"version":3,"sources":["../../src/index.tsx","../../src/Toast.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/Text.tsx","../../../../foundation/primitives-native/src/Icon.tsx","../../src/ToastGroup.native.tsx","../../src/ToastProvider.tsx","../../src/ToastContext.tsx","../../src/useToast.ts"],"sourcesContent":["export { Toast } from \"./Toast\";\nexport { ToastGroup } from \"./ToastGroup\";\nexport { ToastProvider } from \"./ToastProvider\";\nexport { ToastContext } from \"./ToastContext\";\nexport { useToast } from \"./useToast\";\nexport type { UseToastReturn } from \"./useToast\";\nexport * from \"./types\";\n","import React, {\n cloneElement,\n isValidElement,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme } from \"@xsolla/xui-core\";\nimport {\n CheckCr,\n ExclamationMarkCr,\n InfoCr,\n Remove,\n Warning as WarningIcon,\n} from \"@xsolla/xui-icons-base\";\nimport type { ToastColorScheme, ToastProps, ToastType } from \"./types\";\n\nconst TOAST_COLORS: Record<ToastType, string> = {\n alert: \"#ff553d\",\n success: \"#47d94a\",\n neutral: \"#7899a1\",\n warning: \"#ffb95c\",\n};\nconst DEFAULT_COLOR_SCHEME: ToastColorScheme = {\n background: \"#34474b\",\n text: \"#ffffff\",\n descriptionText: \"rgba(255, 255, 255, 0.7)\",\n divider: \"rgba(255, 255, 255, 0.16)\",\n actionText: \"#ffffff\",\n};\n\nconst getDefaultIcon = (\n type: ToastType,\n size: number,\n color: string\n): React.ReactNode => {\n switch (type) {\n case \"success\":\n return (\n <CheckCr\n variant=\"solid\"\n size={size}\n color={color}\n data-testid=\"toast-icon-success\"\n />\n );\n case \"neutral\":\n return (\n <InfoCr\n variant=\"solid\"\n size={size}\n color={color}\n data-testid=\"toast-icon-neutral\"\n />\n );\n case \"warning\":\n return (\n <WarningIcon\n variant=\"solid\"\n size={size}\n color={color}\n data-testid=\"toast-icon-warning\"\n />\n );\n case \"alert\":\n default:\n return (\n <ExclamationMarkCr\n variant=\"solid\"\n size={size}\n color={color}\n data-testid=\"toast-icon-alert\"\n />\n );\n }\n};\n\nconst ANIMATION_DURATION = 200;\nconst PROGRESS_HEIGHT = 4;\nconst TOAST_CONFIG = {\n minHeight: 56,\n paddingHorizontal: 16,\n paddingVertical: 12,\n gap: 12,\n iconSize: 24,\n closeButtonSize: 24,\n closeIconSize: 20,\n fontSize: 16,\n lineHeight: 20,\n maxWidth: 440,\n};\n\ntype ActionProps = {\n children?: React.ReactNode;\n size?: \"xs\";\n variant?: \"inverse\";\n background?: boolean;\n themeMode?: ToastProps[\"themeMode\"];\n themeProductContext?: ToastProps[\"themeProductContext\"];\n};\n\nexport const Toast: React.FC<ToastProps> = ({\n id,\n type = \"neutral\",\n title,\n // No clamp by default: a long title wraps onto several lines and the toast\n // grows to fit it, per the Figma \"Content behaviour\" spec. A hardcoded\n // single-line clamp cut single-sentence messages off with an ellipsis\n // (XUITSD-118). Consumers that genuinely need a cap opt in via `titleLines`.\n titleLines,\n description,\n // No clamp by default: the toast grows to fit the description. A hardcoded\n // line limit silently truncated real error copy at narrow widths (XUITSD-20),\n // and translations only make the strings longer. Consumers that genuinely\n // need a cap opt in via `descriptionLines`.\n descriptionLines,\n icon = true,\n action,\n showCloseButton = true,\n progress = false,\n duration,\n onClose,\n colorScheme = DEFAULT_COLOR_SCHEME,\n testID,\n themeMode,\n themeProductContext,\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const config = TOAST_CONFIG;\n const [visible, setVisible] = useState(false);\n const [dismissing, setDismissing] = useState(false);\n const [progressComplete, setProgressComplete] = useState(false);\n\n // Hold the latest `onClose` in a ref so `handleClose` can stay referentially\n // stable. `ToastGroup` renders every toast with\n // `onClose={() => onDismiss(toast.id)}` — a brand new closure on each render.\n // Depending on it directly would re-run the auto-dismiss effect (and restart\n // the countdown) every time the toast list changed, so a newly added toast\n // would reset the timers of the ones already on screen. See FEP-861.\n const onCloseRef = useRef(onClose);\n useEffect(() => {\n onCloseRef.current = onClose;\n }, [onClose]);\n\n // Re-entry guard for `handleClose`. A ref rather than the `dismissing` state\n // so the callback does not need `dismissing` in its dependency list.\n const dismissingRef = useRef(false);\n\n useEffect(() => {\n const frame = requestAnimationFrame(() => setVisible(true));\n return () => cancelAnimationFrame(frame);\n }, []);\n\n const handleClose = useCallback(() => {\n if (dismissingRef.current) return;\n dismissingRef.current = true;\n setDismissing(true);\n setTimeout(() => onCloseRef.current?.(), ANIMATION_DURATION);\n }, []);\n\n // Deliberately depends only on `duration` (and the now-stable `handleClose`):\n // each toast owns its countdown and siblings mounting or unmounting must not\n // restart it.\n useEffect(() => {\n if (!duration || duration <= 0) return;\n const timer = setTimeout(handleClose, duration);\n return () => clearTimeout(timer);\n }, [duration, handleClose]);\n\n const shouldAnimateProgress = progress && Boolean(duration && duration > 0);\n\n useEffect(() => {\n if (!shouldAnimateProgress) {\n setProgressComplete(false);\n return;\n }\n\n setProgressComplete(false);\n const frame = requestAnimationFrame(() => setProgressComplete(true));\n\n return () => cancelAnimationFrame(frame);\n }, [duration, shouldAnimateProgress]);\n\n const iconColor = TOAST_COLORS[type];\n const shouldShowIcon = icon !== false;\n const displayIcon =\n icon === true || icon === undefined\n ? getDefaultIcon(type, config.iconSize, iconColor)\n : icon;\n const renderedAction =\n isValidElement<ActionProps>(action) && typeof action.type !== \"string\"\n ? cloneElement(action, {\n size: \"xs\",\n variant: \"inverse\",\n background: false,\n themeMode: \"dark\",\n themeProductContext,\n children: (\n <span style={{ color: colorScheme.actionText }}>\n {action.props.children}\n </span>\n ),\n })\n : action;\n const hasAction = Boolean(action);\n const hasCloseButton = showCloseButton && Boolean(onClose);\n const hasActions = hasAction || hasCloseButton;\n const role = type === \"neutral\" || type === \"success\" ? \"status\" : \"alert\";\n const ariaLive =\n type === \"neutral\" || type === \"success\" ? \"polite\" : \"assertive\";\n\n return (\n <Box\n testID={testID}\n backgroundColor={colorScheme.background}\n borderRadius={theme.shape.toast.borderRadius}\n minHeight={config.minHeight}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n overflow=\"hidden\"\n width={config.maxWidth}\n maxWidth=\"100%\"\n role={role}\n aria-live={ariaLive}\n data-toast-id={id}\n style={{\n opacity: visible && !dismissing ? 1 : 0,\n transform:\n visible && !dismissing ? \"translateY(0)\" : \"translateY(-8px)\",\n transition: `opacity ${ANIMATION_DURATION}ms ease-out, transform ${ANIMATION_DURATION}ms ease-out`,\n boxShadow: colorScheme.shadow,\n backdropFilter: colorScheme.backdropFilter,\n }}\n >\n <Box\n flex={1}\n minHeight={config.minHeight}\n minWidth={0}\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={config.gap}\n paddingHorizontal={config.paddingHorizontal}\n paddingVertical={config.paddingVertical}\n >\n {shouldShowIcon && (\n <Box\n width={config.iconSize}\n height={config.iconSize}\n alignItems=\"center\"\n justifyContent=\"center\"\n flexShrink={0}\n >\n {icon === true || icon === undefined ? (\n displayIcon\n ) : (\n <Icon size={config.iconSize} color={iconColor}>\n {displayIcon}\n </Icon>\n )}\n </Box>\n )}\n\n <Box flex={1} minWidth={0} gap={2}>\n {title && (\n <Text\n testID=\"toast-title\"\n color={colorScheme.text}\n fontSize={config.fontSize}\n lineHeight={config.lineHeight}\n fontWeight=\"500\"\n numberOfLines={titleLines}\n >\n {title}\n </Text>\n )}\n {description && (\n <Text\n testID=\"toast-description\"\n color={colorScheme.descriptionText}\n fontSize={14}\n lineHeight={18}\n numberOfLines={descriptionLines}\n >\n {description}\n </Text>\n )}\n </Box>\n\n {hasActions && (\n <Box\n height={32}\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={config.gap}\n flexShrink={0}\n >\n {renderedAction}\n\n {hasAction && hasCloseButton && (\n <Box\n width={1}\n height=\"100%\"\n backgroundColor={colorScheme.divider}\n testID=\"toast-divider\"\n />\n )}\n\n {hasCloseButton && (\n <Box\n onPress={handleClose}\n width={config.closeButtonSize}\n height={config.closeButtonSize}\n alignItems=\"center\"\n justifyContent=\"center\"\n flexShrink={0}\n role=\"button\"\n aria-label=\"Dismiss notification\"\n >\n <Remove\n variant=\"line\"\n size={config.closeIconSize}\n color={colorScheme.text}\n />\n </Box>\n )}\n </Box>\n )}\n </Box>\n\n {progress && (\n <Box\n testID=\"toast-progress\"\n position=\"absolute\"\n left={0}\n right={0}\n bottom={0}\n height={PROGRESS_HEIGHT}\n overflow=\"hidden\"\n >\n <Box\n testID=\"toast-progress-bar\"\n width=\"100%\"\n height=\"100%\"\n backgroundColor={iconColor}\n style={{\n transform: `scaleX(${progressComplete ? 0 : 1})`,\n transformOrigin: \"left center\",\n transition: shouldAnimateProgress\n ? `transform ${duration}ms linear`\n : undefined,\n }}\n />\n </Box>\n )}\n </Box>\n );\n};\n\nToast.displayName = \"Toast\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n AccessibilityRole,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleToAccessibilityRole: Record<string, AccessibilityRole> = {\n button: \"button\",\n link: \"link\",\n img: \"image\",\n image: \"image\",\n summary: \"summary\",\n switch: \"switch\",\n checkbox: \"checkbox\",\n radio: \"radio\",\n heading: \"header\",\n text: \"text\",\n search: \"search\",\n alert: \"alert\",\n none: \"none\",\n presentation: \"none\",\n progressbar: \"progressbar\",\n scrollbar: \"scrollbar\",\n adjustable: \"adjustable\",\n tab: \"tab\",\n menu: \"menu\",\n menuitem: \"menuitem\",\n list: \"list\",\n timer: \"timer\",\n};\n\n/** RN ViewStyle.gap is typed as number (Yoga gap), not DimensionValue. */\nconst toGapValue = (gap: number | string | undefined): number | undefined => {\n if (gap === undefined) return undefined;\n if (typeof gap === \"number\") return gap;\n const pxMatch = /^(\\d+(?:\\.\\d+)?)px$/.exec(gap);\n if (pxMatch) return Number(pxMatch[1]);\n const asNumber = Number(gap);\n return Number.isFinite(asNumber) ? asNumber : undefined;\n};\n\n/**\n * Yoga has no inline formatting context, so RN's ViewStyle.display only\n * accepts \"flex\" | \"none\". Every inline-ish web value collapses to a plain\n * flex container — the box already fills only its content on native, which is\n * what those callers wanted on web anyway. Returning undefined (rather than\n * \"flex\") leaves RN's own default in place.\n */\nconst toNativeDisplay = (\n display: BoxProps[\"display\"]\n): ViewStyle[\"display\"] => (display === \"none\" ? \"none\" : undefined);\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 display,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n flexShrink,\n gap,\n overflow,\n opacity,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n disabled,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n opacity: opacity ?? (disabled ? 0.5 : undefined),\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n display: toNativeDisplay(display),\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n flexShrink,\n gap: toGapValue(gap),\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Map web a11y props; drop the rest of the web-only attributes before\n // spreading onto RN hosts (unknown props warn at runtime).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n className,\n \"data-testid\": _dataTestId,\n cursor: _cursor,\n type: _type,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n const accessibilityRole =\n (typeof role === \"string\" && roleToAccessibilityRole[role]) ||\n (as === \"button\" ? \"button\" : undefined);\n const isDisabled = Boolean(disabled || ariaDisabled);\n const accessibilityState = {\n disabled: isDisabled || undefined,\n busy: Boolean(ariaBusy) || undefined,\n };\n const accessibilityLiveRegion =\n ariaLive === \"polite\" || ariaLive === \"assertive\" ? ariaLive : undefined;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : alt}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n // Prefer Pressable whenever the node is interactive or explicitly a button,\n // so disabled / aria-disabled controls stay in the a11y tree as buttons.\n if (onPress || as === \"button\") {\n return (\n <Pressable\n onPress={!isDisabled && onPress ? onPress : undefined}\n disabled={isDisabled}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={\n typeof ariaLabel === \"string\" ? ariaLabel : undefined\n }\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : undefined}\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={dataTestId || testID || id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Icon: React.FC<IconProps> = ({\n children,\n color,\n size,\n testID,\n \"data-testid\": dataTestId,\n}) => {\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 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 (\n <View style={style} testID={dataTestId || testID}>\n {childrenWithProps}\n </View>\n );\n};\n","import React, { memo } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, TOAST_LAYER } from \"@xsolla/xui-core\";\nimport { Toast } from \"./Toast\";\nimport type { ToastGroupProps } from \"./types\";\n\nconst TOAST_GROUP_CONFIG = {\n containerPadding: 12,\n groupGap: 8,\n};\n\nexport const ToastGroup = memo(\n ({\n toasts,\n position = \"top\",\n maxWidth,\n onDismiss,\n testID,\n themeMode,\n themeProductContext,\n }: ToastGroupProps) => {\n useResolvedTheme({ themeMode, themeProductContext });\n const config = TOAST_GROUP_CONFIG;\n\n if (toasts.length === 0) {\n return null;\n }\n\n const positionStyles =\n position === \"top\"\n ? { top: config.containerPadding, bottom: undefined }\n : { top: undefined, bottom: config.containerPadding };\n\n return (\n <Box\n testID={testID}\n position=\"absolute\"\n left={0}\n right={0}\n zIndex={TOAST_LAYER}\n alignItems=\"center\"\n paddingHorizontal={config.containerPadding}\n pointerEvents=\"box-none\"\n {...positionStyles}\n >\n <Box\n width=\"100%\"\n maxWidth={maxWidth}\n gap={config.groupGap}\n flexDirection=\"column\"\n >\n {toasts.map((toast) => (\n <Toast\n key={toast.id}\n id={toast.id}\n type={toast.type}\n title={toast.title}\n titleLines={toast.titleLines}\n description={toast.description}\n descriptionLines={toast.descriptionLines}\n icon={toast.icon}\n action={toast.action}\n showCloseButton={toast.showCloseButton}\n progress={toast.progress}\n duration={toast.duration}\n onClose={() => onDismiss(toast.id)}\n />\n ))}\n </Box>\n </Box>\n );\n }\n);\n\nToastGroup.displayName = \"ToastGroup\";\n","import React, { useCallback, useMemo, useState } from \"react\";\nimport { ToastContext } from \"./ToastContext\";\nimport { ToastGroup } from \"./ToastGroup\";\nimport type { ToastProviderProps, ToastData, ToastOptions } from \"./types\";\n\nlet toastIdCounter = 0;\n\nconst generateToastId = (): string => {\n return `toast-${++toastIdCounter}-${Date.now()}`;\n};\n\nexport const ToastProvider: React.FC<ToastProviderProps> = ({\n children,\n position = \"top\",\n align = \"center\",\n defaultDuration = 5000,\n maxWidth,\n testID,\n}) => {\n const [toasts, setToasts] = useState<ToastData[]>([]);\n\n const dismissToast = useCallback((id: string) => {\n setToasts((prev) => prev.filter((toast) => toast.id !== id));\n }, []);\n\n const dismissAllToasts = useCallback(() => {\n setToasts([]);\n }, []);\n\n const addToast = useCallback(\n (options: ToastOptions): string => {\n const id = generateToastId();\n const duration = options.duration ?? defaultDuration;\n\n const newToast: ToastData = {\n id,\n type: options.type ?? \"neutral\",\n title: options.title,\n titleLines: options.titleLines,\n description: options.description,\n descriptionLines: options.descriptionLines,\n icon: options.icon,\n action: options.action,\n showCloseButton: options.showCloseButton,\n progress: options.progress,\n duration,\n };\n\n setToasts((prev) => [...prev, newToast]);\n\n return id;\n },\n [defaultDuration]\n );\n\n const contextValue = useMemo(\n () => ({\n toasts,\n addToast,\n dismissToast,\n dismissAllToasts,\n }),\n [toasts, addToast, dismissToast, dismissAllToasts]\n );\n\n return (\n <ToastContext.Provider value={contextValue}>\n {children}\n <ToastGroup\n toasts={toasts}\n position={position}\n align={align}\n maxWidth={maxWidth}\n onDismiss={dismissToast}\n testID={testID}\n />\n </ToastContext.Provider>\n );\n};\n","import { createContext } from \"react\";\nimport type { ToastContextType } from \"./types\";\n\nexport const ToastContext = createContext<ToastContextType | null>(null);\n","import { useContext, useCallback } from \"react\";\nimport { ToastContext } from \"./ToastContext\";\nimport type { ToastOptions } from \"./types\";\n\nexport interface UseToastReturn {\n /** Show a toast with custom options */\n toast: (options: ToastOptions) => string;\n /** Show an alert toast */\n alert: (options: Omit<ToastOptions, \"type\">) => string;\n /** Show a success toast */\n success: (options: Omit<ToastOptions, \"type\">) => string;\n /** Show a neutral toast */\n neutral: (options: Omit<ToastOptions, \"type\">) => string;\n /** Show a warning toast */\n warning: (options: Omit<ToastOptions, \"type\">) => string;\n /** Dismiss a specific toast by ID */\n dismiss: (id: string) => void;\n /** Dismiss all toasts */\n dismissAll: () => void;\n}\n\nexport const useToast = (): UseToastReturn => {\n const context = useContext(ToastContext);\n\n if (!context) {\n throw new Error(\"useToast must be used within a ToastProvider\");\n }\n\n const { addToast, dismissToast, dismissAllToasts } = context;\n\n const toast = useCallback(\n (options: ToastOptions): string => {\n return addToast(options);\n },\n [addToast]\n );\n\n const alert = useCallback(\n (options: Omit<ToastOptions, \"type\">): string => {\n return addToast({ ...options, type: \"alert\" });\n },\n [addToast]\n );\n\n const success = useCallback(\n (options: Omit<ToastOptions, \"type\">): string => {\n return addToast({ ...options, type: \"success\" });\n },\n [addToast]\n );\n\n const neutral = useCallback(\n (options: Omit<ToastOptions, \"type\">): string => {\n return addToast({ ...options, type: \"neutral\" });\n },\n [addToast]\n );\n\n const warning = useCallback(\n (options: Omit<ToastOptions, \"type\">): string => {\n return addToast({ ...options, type: \"warning\" });\n },\n [addToast]\n );\n\n const dismiss = useCallback(\n (id: string): void => {\n dismissToast(id);\n },\n [dismissToast]\n );\n\n const dismissAll = useCallback((): void => {\n dismissAllToasts();\n }, [dismissAllToasts]);\n\n return {\n toast,\n alert,\n success,\n neutral,\n warning,\n dismiss,\n dismissAll,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAOO;;;ACNP,0BASO;AAqND;AAlNN,IAAM,0BAA6D;AAAA,EACjE,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,cAAc;AAAA,EACd,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AACT;AAGA,IAAM,aAAa,CAAC,QAAyD;AAC3E,MAAI,QAAQ,OAAW,QAAO;AAC9B,MAAI,OAAO,QAAQ,SAAU,QAAO;AACpC,QAAM,UAAU,sBAAsB,KAAK,GAAG;AAC9C,MAAI,QAAS,QAAO,OAAO,QAAQ,CAAC,CAAC;AACrC,QAAM,WAAW,OAAO,GAAG;AAC3B,SAAO,OAAO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C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,8CAA8C;AAAA,EAChE;AAEA,QAAM,EAAE,UAAU,cAAc,iBAAiB,IAAI;AAErD,QAAM,YAAQ;AAAA,IACZ,CAAC,YAAkC;AACjC,aAAO,SAAS,OAAO;AAAA,IACzB;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,QAAM,YAAQ;AAAA,IACZ,CAAC,YAAgD;AAC/C,aAAO,SAAS,EAAE,GAAG,SAAS,MAAM,QAAQ,CAAC;AAAA,IAC/C;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,QAAM,cAAU;AAAA,IACd,CAAC,YAAgD;AAC/C,aAAO,SAAS,EAAE,GAAG,SAAS,MAAM,UAAU,CAAC;AAAA,IACjD;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,QAAM,cAAU;AAAA,IACd,CAAC,YAAgD;AAC/C,aAAO,SAAS,EAAE,GAAG,SAAS,MAAM,UAAU,CAAC;AAAA,IACjD;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,QAAM,cAAU;AAAA,IACd,CAAC,YAAgD;AAC/C,aAAO,SAAS,EAAE,GAAG,SAAS,MAAM,UAAU,CAAC;AAAA,IACjD;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,QAAM,cAAU;AAAA,IACd,CAAC,OAAqB;AACpB,mBAAa,EAAE;AAAA,IACjB;AAAA,IACA,CAAC,YAAY;AAAA,EACf;AAEA,QAAM,iBAAa,2BAAY,MAAY;AACzC,qBAAiB;AAAA,EACnB,GAAG,CAAC,gBAAgB,CAAC;AAErB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["import_react","import_react_native","import_jsx_runtime","RNText","import_react_native","import_jsx_runtime","React","import_jsx_runtime","WarningIcon","import_react","import_xui_core","import_jsx_runtime","import_react","import_react","import_jsx_runtime","import_react"]}
package/native/index.mjs CHANGED
@@ -436,6 +436,11 @@ var Toast = ({
436
436
  id,
437
437
  type = "neutral",
438
438
  title,
439
+ // No clamp by default: a long title wraps onto several lines and the toast
440
+ // grows to fit it, per the Figma "Content behaviour" spec. A hardcoded
441
+ // single-line clamp cut single-sentence messages off with an ellipsis
442
+ // (XUITSD-118). Consumers that genuinely need a cap opt in via `titleLines`.
443
+ titleLines,
439
444
  description,
440
445
  // No clamp by default: the toast grows to fit the description. A hardcoded
441
446
  // line limit silently truncated real error copy at narrow widths (XUITSD-20),
@@ -555,11 +560,12 @@ var Toast = ({
555
560
  title && /* @__PURE__ */ jsx4(
556
561
  Text,
557
562
  {
563
+ testID: "toast-title",
558
564
  color: colorScheme.text,
559
565
  fontSize: config.fontSize,
560
566
  lineHeight: config.lineHeight,
561
567
  fontWeight: "500",
562
- numberOfLines: 1,
568
+ numberOfLines: titleLines,
563
569
  children: title
564
570
  }
565
571
  ),
@@ -702,6 +708,7 @@ var ToastGroup = memo(
702
708
  id: toast.id,
703
709
  type: toast.type,
704
710
  title: toast.title,
711
+ titleLines: toast.titleLines,
705
712
  description: toast.description,
706
713
  descriptionLines: toast.descriptionLines,
707
714
  icon: toast.icon,
@@ -757,6 +764,7 @@ var ToastProvider = ({
757
764
  id,
758
765
  type: options.type ?? "neutral",
759
766
  title: options.title,
767
+ titleLines: options.titleLines,
760
768
  description: options.description,
761
769
  descriptionLines: options.descriptionLines,
762
770
  icon: options.icon,