@xsolla/xui-toast 0.206.2 → 0.208.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 +80 -32
- package/native/index.d.mts +10 -0
- package/native/index.d.ts +10 -0
- package/native/index.js +9 -1
- package/native/index.js.map +1 -1
- package/native/index.mjs +9 -1
- package/native/index.mjs.map +1 -1
- package/package.json +5 -5
- package/web/index.d.mts +10 -0
- package/web/index.d.ts +10 -0
- package/web/index.js +9 -1
- package/web/index.js.map +1 -1
- package/web/index.mjs +9 -1
- package/web/index.mjs.map +1 -1
package/README.md
CHANGED
|
@@ -27,15 +27,16 @@ 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
31
|
- When Button=False, a close (×) icon is shown — tapping it dismisses the toast immediately
|
|
31
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
|
|
32
33
|
- Multiple toasts stack in a ToastGroup — see below
|
|
33
34
|
- Toasts do not block interaction with the rest of the screen
|
|
34
35
|
|
|
35
36
|
### Accessibility
|
|
36
|
-
- Use
|
|
37
|
-
- Use
|
|
38
|
-
- The close button must have
|
|
37
|
+
- Use role=*"status"* for Neutral and Success toasts — screen readers announce them without interrupting the user
|
|
38
|
+
- Use role=*"alert"* for Warning and Alert toasts — these are announced immediately
|
|
39
|
+
- The close button must have aria-label=*"Dismiss notification"*
|
|
39
40
|
- Do not rely on color alone to convey the type — the icon and text must also communicate it
|
|
40
41
|
<!-- END:xui-mcp-instructions:toast -->
|
|
41
42
|
|
|
@@ -113,18 +114,19 @@ Root provider. Manages toast state, auto-dismiss timers, and renders the `ToastG
|
|
|
113
114
|
|
|
114
115
|
The individual toast cell. Used internally by `ToastGroup`, but can be rendered standalone for static display.
|
|
115
116
|
|
|
116
|
-
| Prop
|
|
117
|
-
|
|
|
118
|
-
| `id`
|
|
119
|
-
| `type`
|
|
120
|
-
| `title`
|
|
121
|
-
| `description`
|
|
122
|
-
| `
|
|
123
|
-
| `
|
|
124
|
-
| `
|
|
125
|
-
| `
|
|
126
|
-
| `
|
|
127
|
-
| `
|
|
117
|
+
| Prop | Type | Default | Description |
|
|
118
|
+
| ------------------ | ------------------------------------------------ | ----------- | ------------------------------------------------------------------ |
|
|
119
|
+
| `id` | `string` | - | Required unique identifier. |
|
|
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. |
|
|
122
|
+
| `description` | `string` | - | Optional supporting text. Not clamped by default. |
|
|
123
|
+
| `descriptionLines` | `number` | - | Clamp the description to this many lines, cutting overflow with an ellipsis. Omitted = no clamp; the toast grows to fit. |
|
|
124
|
+
| `icon` | `boolean \| ReactNode` | `true` | Show the default icon, hide it with `false`, or pass a custom one. |
|
|
125
|
+
| `action` | `ReactElement` | - | Optional action element, typically a `FlexButton`. |
|
|
126
|
+
| `showCloseButton` | `boolean` | `true` | Show the trailing dismiss control when `onClose` is provided. |
|
|
127
|
+
| `progress` | `boolean` | `false` | Show a bottom countdown strip when `duration` is positive; sticky toasts keep a static strip. |
|
|
128
|
+
| `duration` | `number` | - | Auto-dismiss duration in ms. `0` or omitted = no auto-dismiss. |
|
|
129
|
+
| `onClose` | `() => void` | - | Close handler. Required for the close button to render. |
|
|
128
130
|
|
|
129
131
|
Inherits `ThemeOverrideProps` (`themeMode`, `themeProductContext`).
|
|
130
132
|
|
|
@@ -158,28 +160,30 @@ Hook that returns toast helpers. Throws if called outside a `ToastProvider`.
|
|
|
158
160
|
|
|
159
161
|
### `ToastOptions`
|
|
160
162
|
|
|
161
|
-
| Property
|
|
162
|
-
|
|
|
163
|
-
| `type`
|
|
164
|
-
| `title`
|
|
165
|
-
| `description`
|
|
166
|
-
| `
|
|
167
|
-
| `
|
|
168
|
-
| `
|
|
169
|
-
| `
|
|
170
|
-
| `
|
|
163
|
+
| Property | Type | Default | Description |
|
|
164
|
+
| ------------------ | ------------------------------------------------ | ---------------------------- | ------------------------------------------------------------------ |
|
|
165
|
+
| `type` | `"alert" \| "success" \| "neutral" \| "warning"` | `"neutral"` | Visual and accessibility type. |
|
|
166
|
+
| `title` | `string` | - | Short primary text. |
|
|
167
|
+
| `description` | `string` | - | Optional supporting text. Not clamped by default. |
|
|
168
|
+
| `descriptionLines` | `number` | - | Clamp the description to this many lines. Omitted = no clamp. |
|
|
169
|
+
| `icon` | `boolean \| ReactNode` | `true` | Show, hide, or override the icon. |
|
|
170
|
+
| `action` | `ReactElement` | - | Optional action element. |
|
|
171
|
+
| `showCloseButton` | `boolean` | `true` | Show the close button when the toast is dismissible. |
|
|
172
|
+
| `progress` | `boolean` | `false` | Show a bottom countdown strip when `duration` is positive; sticky toasts keep a static strip. |
|
|
173
|
+
| `duration` | `number` | provider's `defaultDuration` | Auto-dismiss duration. `0` keeps the toast until dismissed manually. |
|
|
171
174
|
|
|
172
175
|
### `ToastData`
|
|
173
176
|
|
|
174
177
|
Internal shape exposed via `ToastContext.toasts`.
|
|
175
178
|
|
|
176
|
-
| Property
|
|
177
|
-
|
|
|
178
|
-
| `id`
|
|
179
|
-
| `type`
|
|
180
|
-
| `title`
|
|
181
|
-
| `description`
|
|
182
|
-
| `
|
|
179
|
+
| Property | Type | Description |
|
|
180
|
+
| ------------------ | ----------- | -------------------------------------------- |
|
|
181
|
+
| `id` | `string` | Unique identifier generated by the provider. |
|
|
182
|
+
| `type` | `ToastType` | Toast type. |
|
|
183
|
+
| `title` | `string` | Primary text. |
|
|
184
|
+
| `description` | `string` | Supporting text. |
|
|
185
|
+
| `descriptionLines` | `number` | Optional description line clamp. |
|
|
186
|
+
| `duration` | `number` | Auto-dismiss duration. |
|
|
183
187
|
|
|
184
188
|
### `ToastContext`
|
|
185
189
|
|
|
@@ -225,6 +229,49 @@ export default function Types() {
|
|
|
225
229
|
}
|
|
226
230
|
```
|
|
227
231
|
|
|
232
|
+
### Long descriptions
|
|
233
|
+
|
|
234
|
+
The description grows to fit its content, so a long or localised message is
|
|
235
|
+
shown in full rather than cut off. Pass `descriptionLines` only when the
|
|
236
|
+
surrounding layout cannot absorb a taller toast — translations run longer than
|
|
237
|
+
their English source, so a clamp that fits today may truncate tomorrow.
|
|
238
|
+
|
|
239
|
+
```tsx
|
|
240
|
+
import * as React from "react";
|
|
241
|
+
import { useToast } from "@xsolla/xui-toast";
|
|
242
|
+
|
|
243
|
+
export default function LongDescription() {
|
|
244
|
+
const toast = useToast();
|
|
245
|
+
return (
|
|
246
|
+
<div style={{ display: "flex", gap: 8 }}>
|
|
247
|
+
<button
|
|
248
|
+
onClick={() =>
|
|
249
|
+
toast.alert({
|
|
250
|
+
title: "Could not link account",
|
|
251
|
+
description:
|
|
252
|
+
"This account is already connected to a different Xsolla ID. Try a different account.",
|
|
253
|
+
})
|
|
254
|
+
}
|
|
255
|
+
>
|
|
256
|
+
Full message (default)
|
|
257
|
+
</button>
|
|
258
|
+
<button
|
|
259
|
+
onClick={() =>
|
|
260
|
+
toast.alert({
|
|
261
|
+
title: "Could not link account",
|
|
262
|
+
description:
|
|
263
|
+
"This account is already connected to a different Xsolla ID. Try a different account.",
|
|
264
|
+
descriptionLines: 2,
|
|
265
|
+
})
|
|
266
|
+
}
|
|
267
|
+
>
|
|
268
|
+
Clamped to 2 lines
|
|
269
|
+
</button>
|
|
270
|
+
</div>
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
228
275
|
### Standalone Toast With Action
|
|
229
276
|
|
|
230
277
|
```tsx
|
|
@@ -314,6 +361,7 @@ export default function BottomRight() {
|
|
|
314
361
|
## Troubleshooting
|
|
315
362
|
|
|
316
363
|
- **"useToast must be used within a ToastProvider"** - ensure the calling component is a descendant of `ToastProvider`.
|
|
364
|
+
- **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.
|
|
317
365
|
- **Toasts hidden on React Native** - wrap content in `<View style={{ flex: 1 }}>` inside `ToastProvider`.
|
|
318
366
|
- **Toasts appear behind a modal (web)** - `ToastGroup` uses `z-index: 9999`. Place `ToastProvider` above the modal in the tree, or adjust z-index.
|
|
319
367
|
- **Auto-dismiss not working** - `duration: 0` disables auto-dismiss; check both per-toast and provider defaults.
|
package/native/index.d.mts
CHANGED
|
@@ -10,6 +10,7 @@ interface ToastData {
|
|
|
10
10
|
type: ToastType;
|
|
11
11
|
title?: string;
|
|
12
12
|
description?: string;
|
|
13
|
+
descriptionLines?: number;
|
|
13
14
|
icon?: boolean | ReactNode;
|
|
14
15
|
action?: ReactElement;
|
|
15
16
|
showCloseButton?: boolean;
|
|
@@ -30,6 +31,13 @@ interface ToastProps extends ThemeOverrideProps {
|
|
|
30
31
|
type?: ToastType;
|
|
31
32
|
title?: string;
|
|
32
33
|
description?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Clamp the description to this many lines. Omitted (the default) means no
|
|
36
|
+
* clamp: the toast grows to fit the whole description. Localised strings run
|
|
37
|
+
* longer than their English source, so opt into a limit only when the
|
|
38
|
+
* surrounding layout genuinely cannot absorb the extra height.
|
|
39
|
+
*/
|
|
40
|
+
descriptionLines?: number;
|
|
33
41
|
icon?: boolean | ReactNode;
|
|
34
42
|
action?: ReactElement;
|
|
35
43
|
showCloseButton?: boolean;
|
|
@@ -44,6 +52,8 @@ interface ToastOptions {
|
|
|
44
52
|
type?: ToastType;
|
|
45
53
|
title?: string;
|
|
46
54
|
description?: string;
|
|
55
|
+
/** Clamp the description to this many lines. Omitted = no clamp. */
|
|
56
|
+
descriptionLines?: number;
|
|
47
57
|
icon?: boolean | ReactNode;
|
|
48
58
|
action?: ReactElement;
|
|
49
59
|
showCloseButton?: boolean;
|
package/native/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ interface ToastData {
|
|
|
10
10
|
type: ToastType;
|
|
11
11
|
title?: string;
|
|
12
12
|
description?: string;
|
|
13
|
+
descriptionLines?: number;
|
|
13
14
|
icon?: boolean | ReactNode;
|
|
14
15
|
action?: ReactElement;
|
|
15
16
|
showCloseButton?: boolean;
|
|
@@ -30,6 +31,13 @@ interface ToastProps extends ThemeOverrideProps {
|
|
|
30
31
|
type?: ToastType;
|
|
31
32
|
title?: string;
|
|
32
33
|
description?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Clamp the description to this many lines. Omitted (the default) means no
|
|
36
|
+
* clamp: the toast grows to fit the whole description. Localised strings run
|
|
37
|
+
* longer than their English source, so opt into a limit only when the
|
|
38
|
+
* surrounding layout genuinely cannot absorb the extra height.
|
|
39
|
+
*/
|
|
40
|
+
descriptionLines?: number;
|
|
33
41
|
icon?: boolean | ReactNode;
|
|
34
42
|
action?: ReactElement;
|
|
35
43
|
showCloseButton?: boolean;
|
|
@@ -44,6 +52,8 @@ interface ToastOptions {
|
|
|
44
52
|
type?: ToastType;
|
|
45
53
|
title?: string;
|
|
46
54
|
description?: string;
|
|
55
|
+
/** Clamp the description to this many lines. Omitted = no clamp. */
|
|
56
|
+
descriptionLines?: number;
|
|
47
57
|
icon?: boolean | ReactNode;
|
|
48
58
|
action?: ReactElement;
|
|
49
59
|
showCloseButton?: boolean;
|
package/native/index.js
CHANGED
|
@@ -454,6 +454,11 @@ var Toast = ({
|
|
|
454
454
|
type = "neutral",
|
|
455
455
|
title,
|
|
456
456
|
description,
|
|
457
|
+
// No clamp by default: the toast grows to fit the description. A hardcoded
|
|
458
|
+
// line limit silently truncated real error copy at narrow widths (XUITSD-20),
|
|
459
|
+
// and translations only make the strings longer. Consumers that genuinely
|
|
460
|
+
// need a cap opt in via `descriptionLines`.
|
|
461
|
+
descriptionLines,
|
|
457
462
|
icon = true,
|
|
458
463
|
action,
|
|
459
464
|
showCloseButton = true,
|
|
@@ -578,10 +583,11 @@ var Toast = ({
|
|
|
578
583
|
description && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
579
584
|
Text,
|
|
580
585
|
{
|
|
586
|
+
testID: "toast-description",
|
|
581
587
|
color: colorScheme.descriptionText,
|
|
582
588
|
fontSize: 14,
|
|
583
589
|
lineHeight: 18,
|
|
584
|
-
numberOfLines:
|
|
590
|
+
numberOfLines: descriptionLines,
|
|
585
591
|
children: description
|
|
586
592
|
}
|
|
587
593
|
)
|
|
@@ -714,6 +720,7 @@ var ToastGroup = (0, import_react3.memo)(
|
|
|
714
720
|
type: toast.type,
|
|
715
721
|
title: toast.title,
|
|
716
722
|
description: toast.description,
|
|
723
|
+
descriptionLines: toast.descriptionLines,
|
|
717
724
|
icon: toast.icon,
|
|
718
725
|
action: toast.action,
|
|
719
726
|
showCloseButton: toast.showCloseButton,
|
|
@@ -768,6 +775,7 @@ var ToastProvider = ({
|
|
|
768
775
|
type: options.type ?? "neutral",
|
|
769
776
|
title: options.title,
|
|
770
777
|
description: options.description,
|
|
778
|
+
descriptionLines: options.descriptionLines,
|
|
771
779
|
icon: options.icon,
|
|
772
780
|
action: options.action,
|
|
773
781
|
showCloseButton: options.showCloseButton,
|
package/native/index.js.map
CHANGED
|
@@ -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 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 color={colorScheme.descriptionText}\n fontSize={14}\n lineHeight={18}\n numberOfLines={2}\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\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n flexShrink,\n gap,\n overflow,\n opacity,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n disabled,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n opacity: opacity ?? (disabled ? 0.5 : undefined),\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n flexShrink,\n gap: toGapValue(gap),\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Map web a11y props; drop the rest of the web-only attributes before\n // spreading onto RN hosts (unknown props warn at runtime).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n className,\n \"data-testid\": _dataTestId,\n cursor: _cursor,\n type: _type,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n const accessibilityRole =\n (typeof role === \"string\" && roleToAccessibilityRole[role]) ||\n (as === \"button\" ? \"button\" : undefined);\n const isDisabled = Boolean(disabled || ariaDisabled);\n const accessibilityState = {\n disabled: isDisabled || undefined,\n busy: Boolean(ariaBusy) || undefined,\n };\n const accessibilityLiveRegion =\n ariaLive === \"polite\" || ariaLive === \"assertive\" ? ariaLive : undefined;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : alt}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n // Prefer Pressable whenever the node is interactive or explicitly a button,\n // so disabled / aria-disabled controls stay in the a11y tree as buttons.\n if (onPress || as === \"button\") {\n return (\n <Pressable\n onPress={!isDisabled && onPress ? onPress : undefined}\n disabled={isDisabled}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={\n typeof ariaLabel === \"string\" ? ariaLabel : undefined\n }\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : undefined}\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={dataTestId || testID || id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n","import 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 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 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 d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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 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\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n flexShrink,\n gap,\n overflow,\n opacity,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n disabled,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n opacity: opacity ?? (disabled ? 0.5 : undefined),\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n flexShrink,\n gap: toGapValue(gap),\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Map web a11y props; drop the rest of the web-only attributes before\n // spreading onto RN hosts (unknown props warn at runtime).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n className,\n \"data-testid\": _dataTestId,\n cursor: _cursor,\n type: _type,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n const accessibilityRole =\n (typeof role === \"string\" && roleToAccessibilityRole[role]) ||\n (as === \"button\" ? \"button\" : undefined);\n const isDisabled = Boolean(disabled || ariaDisabled);\n const accessibilityState = {\n disabled: isDisabled || undefined,\n busy: Boolean(ariaBusy) || undefined,\n };\n const accessibilityLiveRegion =\n ariaLive === \"polite\" || ariaLive === \"assertive\" ? ariaLive : undefined;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : alt}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n // Prefer Pressable whenever the node is interactive or explicitly a button,\n // so disabled / aria-disabled controls stay in the a11y tree as buttons.\n if (onPress || as === \"button\") {\n return (\n <Pressable\n onPress={!isDisabled && onPress ? onPress : undefined}\n disabled={isDisabled}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={\n typeof ariaLabel === \"string\" ? ariaLabel : undefined\n }\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : undefined}\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={dataTestId || testID || id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n","import 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;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAOO;;;ACNP,0BASO;AAwMD;AAr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Q;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
|
@@ -434,6 +434,11 @@ var Toast = ({
|
|
|
434
434
|
type = "neutral",
|
|
435
435
|
title,
|
|
436
436
|
description,
|
|
437
|
+
// No clamp by default: the toast grows to fit the description. A hardcoded
|
|
438
|
+
// line limit silently truncated real error copy at narrow widths (XUITSD-20),
|
|
439
|
+
// and translations only make the strings longer. Consumers that genuinely
|
|
440
|
+
// need a cap opt in via `descriptionLines`.
|
|
441
|
+
descriptionLines,
|
|
437
442
|
icon = true,
|
|
438
443
|
action,
|
|
439
444
|
showCloseButton = true,
|
|
@@ -558,10 +563,11 @@ var Toast = ({
|
|
|
558
563
|
description && /* @__PURE__ */ jsx4(
|
|
559
564
|
Text,
|
|
560
565
|
{
|
|
566
|
+
testID: "toast-description",
|
|
561
567
|
color: colorScheme.descriptionText,
|
|
562
568
|
fontSize: 14,
|
|
563
569
|
lineHeight: 18,
|
|
564
|
-
numberOfLines:
|
|
570
|
+
numberOfLines: descriptionLines,
|
|
565
571
|
children: description
|
|
566
572
|
}
|
|
567
573
|
)
|
|
@@ -694,6 +700,7 @@ var ToastGroup = memo(
|
|
|
694
700
|
type: toast.type,
|
|
695
701
|
title: toast.title,
|
|
696
702
|
description: toast.description,
|
|
703
|
+
descriptionLines: toast.descriptionLines,
|
|
697
704
|
icon: toast.icon,
|
|
698
705
|
action: toast.action,
|
|
699
706
|
showCloseButton: toast.showCloseButton,
|
|
@@ -748,6 +755,7 @@ var ToastProvider = ({
|
|
|
748
755
|
type: options.type ?? "neutral",
|
|
749
756
|
title: options.title,
|
|
750
757
|
description: options.description,
|
|
758
|
+
descriptionLines: options.descriptionLines,
|
|
751
759
|
icon: options.icon,
|
|
752
760
|
action: options.action,
|
|
753
761
|
showCloseButton: options.showCloseButton,
|