@xsolla/xui-b2b-toast 0.157.0 → 0.158.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-b2b-toast",
3
- "version": "0.157.0",
3
+ "version": "0.158.0",
4
4
  "main": "./web/index.js",
5
5
  "module": "./web/index.mjs",
6
6
  "types": "./web/index.d.ts",
@@ -13,11 +13,11 @@
13
13
  "test:coverage": "vitest run --coverage"
14
14
  },
15
15
  "dependencies": {
16
- "@xsolla/xui-button": "0.157.0",
17
- "@xsolla/xui-core": "0.157.0",
18
- "@xsolla/xui-icons-base": "0.157.0",
19
- "@xsolla/xui-primitives-core": "0.157.0",
20
- "@xsolla/xui-typography": "0.157.0"
16
+ "@xsolla/xui-button": "0.158.0",
17
+ "@xsolla/xui-core": "0.158.0",
18
+ "@xsolla/xui-icons-base": "0.158.0",
19
+ "@xsolla/xui-primitives-core": "0.158.0",
20
+ "@xsolla/xui-typography": "0.158.0"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "react": ">=16.8.0",
package/web/index.js CHANGED
@@ -251,7 +251,8 @@ var Box = import_react2.default.forwardRef(
251
251
  top: typeof props.top === "number" ? `${props.top}px` : props.top,
252
252
  left: typeof props.left === "number" ? `${props.left}px` : props.left,
253
253
  right: typeof props.right === "number" ? `${props.right}px` : props.right,
254
- bottom: typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom
254
+ bottom: typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom,
255
+ ...props.style
255
256
  }
256
257
  }
257
258
  );
package/web/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx","../../src/Toast.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../src/ToastProvider.web.tsx"],"sourcesContent":["export { Toast } from \"./Toast\";\nexport type { ToastProps, ToastType, ToastActionElement } from \"./Toast\";\n\nexport { ToastProvider, useToast } from \"./ToastProvider\";\nexport type {\n ToastProviderProps,\n ToastApi,\n ToastOptions,\n ToastPosition,\n ToastQueueItem,\n ToastVariant,\n} from \"./ToastProvider\";\n","import React, { cloneElement, isValidElement } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, type ThemeOverrideProps } from \"@xsolla/xui-core\";\nimport {\n IconButton,\n type ButtonProps,\n type IconButtonProps,\n} from \"@xsolla/xui-button\";\nimport { Typography } from \"@xsolla/xui-typography\";\nimport { Remove } from \"@xsolla/xui-icons-base\";\n\nexport type ToastType = \"alert\" | \"success\" | \"warning\" | \"info\";\n\nexport type ToastActionElement = React.ReactElement<\n ButtonProps | IconButtonProps\n>;\n\nexport interface ToastProps extends ThemeOverrideProps {\n /** Visual variant/tone of the toast */\n type?: ToastType;\n /** Title text (required for accessibility) */\n title?: string;\n /** Optional description text shown beneath the title */\n description?: string;\n /**\n * Action element (Button/IconButton). The toast will inject\n * `size=\"xs\"`, `variant=\"tertiary\"`, and a tone matching the toast type.\n */\n action?: React.ReactElement;\n /** Show/hide close button */\n showCloseButton?: boolean;\n /** Close button click handler */\n onClose?: () => void;\n /** Test ID for testing frameworks */\n testID?: string;\n}\n\nconst TYPE_TO_BUTTON_TONE: Record<\n ToastType,\n \"alert\" | \"brandExtra\" | \"brand\" | \"mono\"\n> = {\n alert: \"alert\",\n success: \"brandExtra\",\n warning: \"mono\",\n info: \"brand\",\n};\n\nexport const Toast: React.FC<ToastProps> = ({\n type = \"info\",\n title,\n description,\n action,\n showCloseButton = true,\n onClose,\n testID,\n themeMode,\n themeProductContext,\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const config = theme.sizing.toast();\n\n const stripeColor: Record<ToastType, string> = {\n alert: theme.colors.content.alert.primary,\n success: theme.colors.content.success.secondary,\n warning: theme.colors.content.warning.secondary,\n info: theme.colors.content.brand.secondary,\n };\n\n const hasActions = Boolean(action) || showCloseButton;\n\n return (\n <Box\n backgroundColor={theme.colors.background.primary}\n borderRadius={config.borderRadius}\n flexDirection=\"row\"\n alignItems=\"stretch\"\n overflow=\"hidden\"\n width={440}\n style={{ boxShadow: theme.shadow.surface }}\n testID={testID}\n role={type === \"alert\" ? \"alert\" : \"status\"}\n aria-live={type === \"alert\" ? \"assertive\" : \"polite\"}\n aria-label={`${type} toast`}\n >\n {/* Colored left stripe */}\n <Box backgroundColor={stripeColor[type]} width={4} alignSelf=\"stretch\" />\n\n {/* Body */}\n <Box\n flex={1}\n flexDirection=\"row\"\n alignItems=\"center\"\n paddingHorizontal={16}\n paddingVertical={12}\n gap={16}\n >\n {/* Text */}\n <Box flex={1} gap={2}>\n {title && (\n <Typography\n variant=\"bodyMdAccent\"\n color={theme.colors.content.primary}\n >\n {title}\n </Typography>\n )}\n {description && (\n <Typography variant=\"bodySm\" color={theme.colors.content.tertiary}>\n {description}\n </Typography>\n )}\n </Box>\n\n {/* Actions */}\n {hasActions && (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n alignSelf=\"stretch\"\n gap={config.groupGap ?? 4}\n >\n {isValidElement(action) &&\n cloneElement(action as ToastActionElement, {\n size: \"xs\",\n variant: \"tertiary\",\n tone: TYPE_TO_BUTTON_TONE[type],\n })}\n\n {action && showCloseButton && (\n <Box\n width={1}\n alignSelf=\"stretch\"\n backgroundColor={theme.colors.border.secondary}\n />\n )}\n\n {showCloseButton && (\n <IconButton\n variant=\"tertiary\"\n tone=\"mono\"\n size=\"xs\"\n onPress={onClose}\n aria-label=\"Close toast\"\n icon={<Remove size={18} />}\n hoverBackground=\"none\"\n />\n )}\n </Box>\n )}\n </Box>\n </Box>\n );\n};\n\nToast.displayName = \"Toast\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import React, {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Toast, type ToastProps, type ToastType } from \"./Toast\";\n\nexport type ToastPosition =\n | \"top-right\"\n | \"top-left\"\n | \"top-center\"\n | \"bottom-right\"\n | \"bottom-left\"\n | \"bottom-center\";\n\nexport type ToastVariant = \"default\" | \"sonner\";\n\nexport interface ToastOptions extends Omit<\n ToastProps,\n \"type\" | \"onClose\" | \"testID\"\n> {\n /**\n * Auto-dismiss duration in ms. Pass 0 to disable auto-dismiss.\n * Defaults derived from `type`: success 4500, info/warning 6500, alert 9000.\n */\n duration?: number;\n /** Stable id — if provided and a toast with that id already exists, it's replaced. */\n id?: string;\n /** Called when the toast is dismissed (auto or manual). */\n onDismiss?: () => void;\n}\n\nexport interface ToastQueueItem extends ToastOptions {\n id: string;\n type: ToastType;\n createdAt: number;\n}\n\nexport interface ToastApi {\n alert: (options: ToastOptions) => string;\n success: (options: ToastOptions) => string;\n warning: (options: ToastOptions) => string;\n info: (options: ToastOptions) => string;\n show: (type: ToastType, options: ToastOptions) => string;\n dismiss: (id: string) => void;\n dismissAll: () => void;\n}\n\ninterface ToastContextValue {\n api: ToastApi;\n}\n\nconst ToastContext = createContext<ToastContextValue | null>(null);\n\nconst DEFAULT_DURATIONS: Record<ToastType, number> = {\n success: 4500,\n info: 6500,\n warning: 6500,\n alert: 9000,\n};\n\nconst POSITION_STYLES: Record<ToastPosition, React.CSSProperties> = {\n \"top-right\": { top: 16, right: 16, alignItems: \"flex-end\" },\n \"top-left\": { top: 16, left: 16, alignItems: \"flex-start\" },\n \"top-center\": {\n top: 16,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n alignItems: \"center\",\n },\n \"bottom-right\": { bottom: 16, right: 16, alignItems: \"flex-end\" },\n \"bottom-left\": { bottom: 16, left: 16, alignItems: \"flex-start\" },\n \"bottom-center\": {\n bottom: 16,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n alignItems: \"center\",\n },\n};\n\nexport interface ToastProviderProps {\n children: React.ReactNode;\n /** Where toasts appear on screen. Defaults to top-right. */\n position?: ToastPosition;\n /** Maximum number of simultaneously visible toasts. Defaults to 3. */\n limit?: number;\n /** DOM node to portal the viewport into. Defaults to document.body. */\n container?: HTMLElement | null;\n /**\n * Enable enter & exit animations. Defaults to `true`.\n * When `false`, toasts appear and disappear instantly.\n */\n animated?: boolean;\n /** Animation duration in ms. Defaults to 220 (default variant) / 400 (sonner). */\n animationDuration?: number;\n /**\n * Visual variant.\n * - `\"default\"` — toasts slide in from the edge and stack vertically.\n * - `\"sonner\"` — shadcn/sonner-style stacked-cards: toasts overlap as a deck\n * with back cards scaled & peeking; hovering the stack expands it.\n */\n variant?: ToastVariant;\n}\n\n// Off-screen transform used as the enter start / exit end state, derived\n// from the viewport position (slides in from the closest edge).\nconst enterTransform = (position: ToastPosition): string => {\n if (position.endsWith(\"right\")) return \"translateX(110%)\";\n if (position.endsWith(\"left\")) return \"translateX(-110%)\";\n return position.startsWith(\"top\") ? \"translateY(-110%)\" : \"translateY(110%)\";\n};\n\n// CSS to anchor an absolutely-positioned sonner item to the viewport corner.\nconst SONNER_ANCHOR: Record<ToastPosition, React.CSSProperties> = {\n \"top-right\": { top: 0, right: 0 },\n \"top-left\": { top: 0, left: 0 },\n \"top-center\": { top: 0, left: \"50%\", marginLeft: -220 },\n \"bottom-right\": { bottom: 0, right: 0 },\n \"bottom-left\": { bottom: 0, left: 0 },\n \"bottom-center\": { bottom: 0, left: \"50%\", marginLeft: -220 },\n};\n\nconst SONNER_GAP = 8;\nconst SONNER_PEEK = 6;\nconst SONNER_SCALE_STEP = 0.06;\nconst MAX_VISIBLE_BACK = 2; // beyond this index, toasts fade to zero\n\ninterface ToastItemProps {\n item: ToastQueueItem;\n position: ToastPosition;\n variant: ToastVariant;\n animated: boolean;\n animationDuration: number;\n exiting: boolean;\n // Sonner-specific\n frontIndex: number;\n expanded: boolean;\n cumulativeOffset: number;\n reportHeight: (id: string, h: number) => void;\n // Common\n onClose: () => void;\n onPause: () => void;\n onResume: () => void;\n onHoverIn: (id: string) => void;\n onHoverOut: (id: string) => void;\n}\n\nconst ToastItem: React.FC<ToastItemProps> = ({\n item,\n position,\n variant,\n animated,\n animationDuration,\n exiting,\n frontIndex,\n expanded,\n cumulativeOffset,\n reportHeight,\n onClose,\n onPause,\n onResume,\n onHoverIn,\n onHoverOut,\n}) => {\n const [entered, setEntered] = useState(!animated);\n const ref = useRef<HTMLDivElement | null>(null);\n const hoveredRef = useRef(false);\n\n useEffect(() => {\n if (!animated) return;\n let raf2 = 0;\n const raf1 = window.requestAnimationFrame(() => {\n raf2 = window.requestAnimationFrame(() => setEntered(true));\n });\n return () => {\n window.cancelAnimationFrame(raf1);\n window.cancelAnimationFrame(raf2);\n };\n }, [animated]);\n\n // Guarantee hover state is cleaned up if the item unmounts while hovered\n // (mouseLeave doesn't fire on disappearing elements).\n useEffect(\n () => () => {\n if (hoveredRef.current) {\n hoveredRef.current = false;\n onHoverOut(item.id);\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n );\n\n // Measure height for sonner stacking math.\n useLayoutEffect(() => {\n if (variant !== \"sonner\" || !ref.current) return;\n const el = ref.current;\n const report = () =>\n reportHeight(item.id, el.getBoundingClientRect().height);\n report();\n if (typeof ResizeObserver === \"undefined\") return;\n const ro = new ResizeObserver(report);\n ro.observe(el);\n return () => ro.disconnect();\n }, [variant, item.id, reportHeight]);\n\n const isSonner = variant === \"sonner\";\n const isBottom = position.startsWith(\"bottom\");\n const isCenter = position.endsWith(\"center\");\n const dir = isBottom ? -1 : 1; // direction items move to \"stack back\"\n\n let transform: string;\n let opacity = 1;\n let zIndex = 1000 - frontIndex;\n\n const offTransform = enterTransform(position);\n const showOff = animated && (!entered || exiting);\n\n if (isSonner) {\n // Horizontal centering baseline for *-center positions\n const xBase = \"\"; // marginLeft handles centering for sonner-anchored items\n\n if (showOff) {\n transform = `${xBase} ${offTransform}`.trim();\n opacity = 0;\n } else if (frontIndex === 0) {\n transform = `${xBase} translateY(0) scale(1)`;\n } else if (expanded) {\n // Spread out using measured cumulative offsets\n transform = `${xBase} translateY(${dir * cumulativeOffset}px) scale(1)`;\n } else {\n // Collapsed stack: peek behind front, scaled down\n const peek = SONNER_PEEK * frontIndex;\n const scale = Math.max(0.7, 1 - SONNER_SCALE_STEP * frontIndex);\n transform = `${xBase} translateY(${dir * peek}px) scale(${scale})`;\n if (frontIndex > MAX_VISIBLE_BACK) opacity = 0;\n }\n } else {\n // Default variant: simple slide-in / slide-out\n transform = showOff ? offTransform : \"translateX(0) translateY(0)\";\n opacity = showOff ? 0 : 1;\n }\n\n const style: React.CSSProperties = {\n pointerEvents: opacity === 0 ? \"none\" : \"auto\",\n transform,\n opacity,\n zIndex,\n transition: animated\n ? `transform ${animationDuration}ms cubic-bezier(0.16, 1, 0.3, 1), opacity ${animationDuration}ms ease`\n : undefined,\n willChange: animated ? \"transform, opacity\" : undefined,\n transformOrigin: isSonner\n ? isCenter\n ? isBottom\n ? \"bottom center\"\n : \"top center\"\n : isBottom\n ? `bottom ${position.endsWith(\"right\") ? \"right\" : \"left\"}`\n : `top ${position.endsWith(\"right\") ? \"right\" : \"left\"}`\n : undefined,\n ...(isSonner\n ? {\n position: \"absolute\" as const,\n width: 440,\n ...SONNER_ANCHOR[position],\n }\n : null),\n };\n\n return (\n <div\n ref={ref}\n style={style}\n onMouseEnter={() => {\n onPause();\n if (!hoveredRef.current) {\n hoveredRef.current = true;\n onHoverIn(item.id);\n }\n }}\n onMouseLeave={() => {\n onResume();\n if (hoveredRef.current) {\n hoveredRef.current = false;\n onHoverOut(item.id);\n }\n }}\n // Ignore focus moves between descendants (e.g. action → close button) —\n // those are still inside the toast and shouldn't toggle the timer.\n onFocus={(e) => {\n if (e.currentTarget.contains(e.relatedTarget as Node | null)) return;\n onPause();\n if (!hoveredRef.current) {\n hoveredRef.current = true;\n onHoverIn(item.id);\n }\n }}\n onBlur={(e) => {\n if (e.currentTarget.contains(e.relatedTarget as Node | null)) return;\n onResume();\n if (hoveredRef.current) {\n hoveredRef.current = false;\n onHoverOut(item.id);\n }\n }}\n >\n <Toast\n type={item.type}\n title={item.title}\n description={item.description}\n action={item.action}\n showCloseButton={item.showCloseButton}\n onClose={onClose}\n themeMode={item.themeMode}\n themeProductContext={item.themeProductContext}\n />\n </div>\n );\n};\n\nlet idCounter = 0;\nconst nextId = () => `toast-${Date.now()}-${++idCounter}`;\n\nexport const ToastProvider: React.FC<ToastProviderProps> = ({\n children,\n position = \"top-right\",\n limit = 3,\n container,\n animated = true,\n animationDuration,\n variant = \"default\",\n}) => {\n const isSonner = variant === \"sonner\";\n const effectiveDuration = animationDuration ?? (isSonner ? 400 : 220);\n\n const [toasts, setToasts] = useState<ToastQueueItem[]>([]);\n const [exiting, setExiting] = useState<Set<string>>(() => new Set());\n const [heights, setHeights] = useState<Record<string, number>>({});\n const [hoveredIds, setHoveredIds] = useState<Set<string>>(() => new Set());\n const exitTimeoutsRef = useRef<Map<string, number>>(new Map());\n const timersRef = useRef<\n Map<string, { remaining: number; startedAt: number; timeoutId: number }>\n >(new Map());\n const onDismissRef = useRef<Map<string, () => void>>(new Map());\n const dismissRef = useRef<(id: string) => void>(() => {});\n\n const reportHeight = useCallback((id: string, h: number) => {\n setHeights((prev) => (prev[id] === h ? prev : { ...prev, [id]: h }));\n }, []);\n\n const clearTimer = useCallback((id: string) => {\n const entry = timersRef.current.get(id);\n if (entry) {\n window.clearTimeout(entry.timeoutId);\n timersRef.current.delete(id);\n }\n }, []);\n\n const removeNow = useCallback((id: string) => {\n const cb = onDismissRef.current.get(id);\n onDismissRef.current.delete(id);\n setToasts((prev) => prev.filter((t) => t.id !== id));\n setExiting((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n setHeights((prev) => {\n if (!(id in prev)) return prev;\n const next = { ...prev };\n delete next[id];\n return next;\n });\n setHoveredIds((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n cb?.();\n }, []);\n\n const dismiss = useCallback(\n (id: string) => {\n clearTimer(id);\n if (!animated) {\n removeNow(id);\n return;\n }\n if (exitTimeoutsRef.current.has(id)) return;\n setExiting((prev) => {\n const next = new Set(prev);\n next.add(id);\n return next;\n });\n const timeoutId = window.setTimeout(() => {\n exitTimeoutsRef.current.delete(id);\n removeNow(id);\n }, effectiveDuration);\n exitTimeoutsRef.current.set(id, timeoutId);\n },\n [clearTimer, animated, effectiveDuration, removeNow]\n );\n\n useEffect(() => {\n dismissRef.current = dismiss;\n }, [dismiss]);\n\n const startTimer = useCallback((id: string, duration: number) => {\n if (duration <= 0) return;\n const timeoutId = window.setTimeout(() => {\n dismissRef.current(id);\n }, duration);\n timersRef.current.set(id, {\n remaining: duration,\n startedAt: Date.now(),\n timeoutId,\n });\n }, []);\n\n const pauseTimer = useCallback((id: string) => {\n const entry = timersRef.current.get(id);\n if (!entry) return;\n const elapsed = Date.now() - entry.startedAt;\n const remaining = Math.max(0, entry.remaining - elapsed);\n window.clearTimeout(entry.timeoutId);\n timersRef.current.set(id, {\n remaining,\n startedAt: Date.now(),\n timeoutId: 0,\n });\n }, []);\n\n const resumeTimer = useCallback(\n (id: string) => {\n const entry = timersRef.current.get(id);\n if (!entry || entry.timeoutId !== 0) return;\n startTimer(id, entry.remaining);\n },\n [startTimer]\n );\n\n // Fire any registered onDismiss for `id` and clear all per-toast bookkeeping.\n // Used when a toast is replaced (same id re-issued) or evicted by limit\n // overflow — both are documented dismissal paths.\n const cleanupDroppedToast = useCallback(\n (id: string) => {\n clearTimer(id);\n const exitTimeoutId = exitTimeoutsRef.current.get(id);\n if (exitTimeoutId) {\n window.clearTimeout(exitTimeoutId);\n exitTimeoutsRef.current.delete(id);\n }\n setExiting((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n const cb = onDismissRef.current.get(id);\n onDismissRef.current.delete(id);\n cb?.();\n },\n [clearTimer]\n );\n\n const show = useCallback(\n (type: ToastType, options: ToastOptions): string => {\n const id = options.id ?? nextId();\n const duration = options.duration ?? DEFAULT_DURATIONS[type];\n const item: ToastQueueItem = {\n ...options,\n id,\n type,\n createdAt: Date.now(),\n };\n\n // If this id is currently exiting (replacement during exit animation),\n // cancel the pending exit so the new toast doesn't get marked exiting\n // and the old timeout doesn't remove it.\n const pendingExit = exitTimeoutsRef.current.get(id);\n if (pendingExit) {\n window.clearTimeout(pendingExit);\n exitTimeoutsRef.current.delete(id);\n setExiting((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n }\n\n // Manage the onDismiss slot atomically: replacing without a new\n // callback should not leave the previous one registered.\n if (options.onDismiss) {\n onDismissRef.current.set(id, options.onDismiss);\n } else {\n onDismissRef.current.delete(id);\n }\n\n setToasts((prev) => {\n const replaced = prev.filter((t) => t.id === id);\n const withoutDup = prev.filter((t) => t.id !== id);\n const next = [...withoutDup, item];\n const overflow =\n next.length > limit ? next.slice(0, next.length - limit) : [];\n\n // Replaced toasts: their onDismiss has already been overwritten\n // above, so just clear timers (no callback to fire).\n replaced.forEach((t) => {\n clearTimer(t.id);\n const ex = exitTimeoutsRef.current.get(t.id);\n if (ex) {\n window.clearTimeout(ex);\n exitTimeoutsRef.current.delete(t.id);\n }\n });\n\n // Overflow toasts: fire onDismiss and clean up.\n overflow.forEach((t) => {\n if (t.id === id) return; // never the freshly-added one\n cleanupDroppedToast(t.id);\n });\n\n return next.length > limit ? next.slice(next.length - limit) : next;\n });\n\n clearTimer(id);\n startTimer(id, duration);\n\n return id;\n },\n [clearTimer, startTimer, limit, cleanupDroppedToast]\n );\n\n const dismissAll = useCallback(() => {\n const ids = Array.from(timersRef.current.keys());\n ids.forEach((id) => dismiss(id));\n setToasts((prev) => {\n prev.forEach((t) => {\n if (!ids.includes(t.id)) dismiss(t.id);\n });\n return prev;\n });\n }, [dismiss]);\n\n const api = useMemo<ToastApi>(\n () => ({\n alert: (options) => show(\"alert\", options),\n success: (options) => show(\"success\", options),\n warning: (options) => show(\"warning\", options),\n info: (options) => show(\"info\", options),\n show,\n dismiss,\n dismissAll,\n }),\n [show, dismiss, dismissAll]\n );\n\n useEffect(\n () => () => {\n timersRef.current.forEach((entry) =>\n window.clearTimeout(entry.timeoutId)\n );\n timersRef.current.clear();\n exitTimeoutsRef.current.forEach((id) => window.clearTimeout(id));\n exitTimeoutsRef.current.clear();\n },\n []\n );\n\n const portalTarget =\n container ?? (typeof document !== \"undefined\" ? document.body : null);\n\n const isBottom = position.startsWith(\"bottom\");\n\n // Build the render list with frontIndex (0 = newest = front of stack).\n // toasts[] is oldest → newest. For default variant the visual order is:\n // top-*: newest first in DOM (so it appears at the top edge)\n // bottom-*: newest last in DOM (so it appears at the bottom edge)\n // For sonner the DOM order doesn't affect visual stacking (all absolute,\n // controlled by z-index), but for tab order we keep front-first in DOM.\n const orderedItems = (() => {\n if (isSonner) {\n // newest first\n return [...toasts].reverse().map((item, i) => ({ item, frontIndex: i }));\n }\n // default\n if (isBottom) {\n // newest last → frontIndex 0 is the last item\n return toasts.map((item, i) => ({\n item,\n frontIndex: toasts.length - 1 - i,\n }));\n }\n return [...toasts].reverse().map((item, i) => ({ item, frontIndex: i }));\n })();\n\n // Cumulative offset used by sonner-expanded layout: sum of heights of items\n // closer to the front (smaller frontIndex) plus gap.\n const offsetByFrontIndex = useMemo(() => {\n const map: Record<number, number> = { 0: 0 };\n let cumulative = 0;\n // Walk in front-first order.\n const sorted = [...orderedItems].sort(\n (a, b) => a.frontIndex - b.frontIndex\n );\n for (let i = 0; i < sorted.length; i++) {\n const fi = sorted[i].frontIndex;\n if (fi === 0) continue;\n const prev = sorted[i - 1];\n cumulative += (heights[prev.item.id] ?? 64) + SONNER_GAP;\n map[fi] = cumulative;\n }\n return map;\n }, [orderedItems, heights]);\n\n const expanded = isSonner && hoveredIds.size > 0;\n\n // For sonner: keep the viewport sized so it captures hover even when only\n // the front toast is visible.\n const frontHeight = (() => {\n const front = orderedItems.find((x) => x.frontIndex === 0);\n return front ? (heights[front.item.id] ?? 64) : 0;\n })();\n\n const sonnerExpandedHeight =\n frontHeight +\n orderedItems\n .filter((x) => x.frontIndex > 0)\n .reduce((sum, x) => sum + (heights[x.item.id] ?? 64) + SONNER_GAP, 0);\n\n return (\n <ToastContext.Provider value={{ api }}>\n {children}\n {portalTarget &&\n createPortal(\n <div\n data-toast-viewport=\"\"\n data-variant={variant}\n data-expanded={expanded ? \"\" : undefined}\n style={{\n position: \"fixed\",\n zIndex: 9999,\n pointerEvents: \"none\",\n maxWidth: \"calc(100vw - 32px)\",\n ...(isSonner\n ? {\n width: 440,\n height: expanded ? sonnerExpandedHeight : frontHeight,\n transition: animated\n ? `height ${effectiveDuration}ms cubic-bezier(0.16, 1, 0.3, 1)`\n : undefined,\n ...POSITION_STYLES[position],\n // override flex (we use absolute children in sonner mode)\n display: \"block\",\n }\n : {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n ...POSITION_STYLES[position],\n }),\n }}\n >\n {orderedItems.map(({ item, frontIndex }) => (\n <ToastItem\n key={item.id}\n item={item}\n position={position}\n variant={variant}\n animated={animated}\n animationDuration={effectiveDuration}\n exiting={exiting.has(item.id)}\n frontIndex={frontIndex}\n expanded={expanded}\n cumulativeOffset={offsetByFrontIndex[frontIndex] ?? 0}\n reportHeight={reportHeight}\n onClose={() => dismiss(item.id)}\n onPause={() => pauseTimer(item.id)}\n onResume={() => resumeTimer(item.id)}\n onHoverIn={(id) => {\n if (!isSonner) return;\n setHoveredIds((prev) => {\n if (prev.has(id)) return prev;\n const next = new Set(prev);\n next.add(id);\n return next;\n });\n }}\n onHoverOut={(id) => {\n if (!isSonner) return;\n setHoveredIds((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n }}\n />\n ))}\n </div>,\n portalTarget\n )}\n </ToastContext.Provider>\n );\n};\n\nToastProvider.displayName = \"ToastProvider\";\n\nexport const useToast = (): ToastApi => {\n const ctx = useContext(ToastContext);\n if (!ctx) {\n throw new Error(\"useToast must be used within a <ToastProvider />\");\n }\n return ctx.api;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAoD;;;ACApD,IAAAC,gBAAkB;AAClB,+BAAmB;;;ACDnB,mBAAkB;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAAI,kBAAkB;AAEtB,IAAI,QAAQ;AAAA,EAAQ,SAAU,MAAM;AAClC,WAAO,gBAAgB,KAAK,IAAI,KAAK,KAAK,WAAW,CAAC,MAAM,OAEzD,KAAK,WAAW,CAAC,MAAM,OAEvB,KAAK,WAA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AA,UAEC,uBAAa,IAAI,CAAC,EAAE,MAAM,WAAW,MACpC;AAAA,YAAC;AAAA;AAAA,cAEC;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA,mBAAmB;AAAA,cACnB,SAAS,QAAQ,IAAI,KAAK,EAAE;AAAA,cAC5B;AAAA,cACA;AAAA,cACA,kBAAkB,mBAAmB,UAAU,KAAK;AAAA,cACpD;AAAA,cACA,SAAS,MAAM,QAAQ,KAAK,EAAE;AAAA,cAC9B,SAAS,MAAM,WAAW,KAAK,EAAE;AAAA,cACjC,UAAU,MAAM,YAAY,KAAK,EAAE;AAAA,cACnC,WAAW,CAAC,OAAO;AACjB,oBAAI,CAAC,SAAU;AACf,8BAAc,CAAC,SAAS;AACtB,sBAAI,KAAK,IAAI,EAAE,EAAG,QAAO;AACzB,wBAAM,OAAO,IAAI,IAAI,IAAI;AACzB,uBAAK,IAAI,EAAE;AACX,yBAAO;AAAA,gBACT,CAAC;AAAA,cACH;AAAA,cACA,YAAY,CAAC,OAAO;AAClB,oBAAI,CAAC,SAAU;AACf,8BAAc,CAAC,SAAS;AACtB,sBAAI,CAAC,KAAK,IAAI,EAAE,EAAG,QAAO;AAC1B,wBAAM,OAAO,IAAI,IAAI,IAAI;AACzB,uBAAK,OAAO,EAAE;AACd,yBAAO;AAAA,gBACT,CAAC;AAAA,cACH;AAAA;AAAA,YA/BK,KAAK;AAAA,UAgCZ,CACD;AAAA;AAAA,MACH;AAAA,MACA;AAAA,IACF;AAAA,KACJ;AAEJ;AAEA,cAAc,cAAc;AAErB,IAAM,WAAW,MAAgB;AACtC,QAAM,UAAM,0BAAW,YAAY;AACnC,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AACA,SAAO,IAAI;AACb;","names":["import_react","import_react","React","styled","React","import_jsx_runtime","import_react","import_jsx_runtime"]}
1
+ {"version":3,"sources":["../../src/index.tsx","../../src/Toast.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../src/ToastProvider.web.tsx"],"sourcesContent":["export { Toast } from \"./Toast\";\nexport type { ToastProps, ToastType, ToastActionElement } from \"./Toast\";\n\nexport { ToastProvider, useToast } from \"./ToastProvider\";\nexport type {\n ToastProviderProps,\n ToastApi,\n ToastOptions,\n ToastPosition,\n ToastQueueItem,\n ToastVariant,\n} from \"./ToastProvider\";\n","import React, { cloneElement, isValidElement } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, type ThemeOverrideProps } from \"@xsolla/xui-core\";\nimport {\n IconButton,\n type ButtonProps,\n type IconButtonProps,\n} from \"@xsolla/xui-button\";\nimport { Typography } from \"@xsolla/xui-typography\";\nimport { Remove } from \"@xsolla/xui-icons-base\";\n\nexport type ToastType = \"alert\" | \"success\" | \"warning\" | \"info\";\n\nexport type ToastActionElement = React.ReactElement<\n ButtonProps | IconButtonProps\n>;\n\nexport interface ToastProps extends ThemeOverrideProps {\n /** Visual variant/tone of the toast */\n type?: ToastType;\n /** Title text (required for accessibility) */\n title?: string;\n /** Optional description text shown beneath the title */\n description?: string;\n /**\n * Action element (Button/IconButton). The toast will inject\n * `size=\"xs\"`, `variant=\"tertiary\"`, and a tone matching the toast type.\n */\n action?: React.ReactElement;\n /** Show/hide close button */\n showCloseButton?: boolean;\n /** Close button click handler */\n onClose?: () => void;\n /** Test ID for testing frameworks */\n testID?: string;\n}\n\nconst TYPE_TO_BUTTON_TONE: Record<\n ToastType,\n \"alert\" | \"brandExtra\" | \"brand\" | \"mono\"\n> = {\n alert: \"alert\",\n success: \"brandExtra\",\n warning: \"mono\",\n info: \"brand\",\n};\n\nexport const Toast: React.FC<ToastProps> = ({\n type = \"info\",\n title,\n description,\n action,\n showCloseButton = true,\n onClose,\n testID,\n themeMode,\n themeProductContext,\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const config = theme.sizing.toast();\n\n const stripeColor: Record<ToastType, string> = {\n alert: theme.colors.content.alert.primary,\n success: theme.colors.content.success.secondary,\n warning: theme.colors.content.warning.secondary,\n info: theme.colors.content.brand.secondary,\n };\n\n const hasActions = Boolean(action) || showCloseButton;\n\n return (\n <Box\n backgroundColor={theme.colors.background.primary}\n borderRadius={config.borderRadius}\n flexDirection=\"row\"\n alignItems=\"stretch\"\n overflow=\"hidden\"\n width={440}\n style={{ boxShadow: theme.shadow.surface }}\n testID={testID}\n role={type === \"alert\" ? \"alert\" : \"status\"}\n aria-live={type === \"alert\" ? \"assertive\" : \"polite\"}\n aria-label={`${type} toast`}\n >\n {/* Colored left stripe */}\n <Box backgroundColor={stripeColor[type]} width={4} alignSelf=\"stretch\" />\n\n {/* Body */}\n <Box\n flex={1}\n flexDirection=\"row\"\n alignItems=\"center\"\n paddingHorizontal={16}\n paddingVertical={12}\n gap={16}\n >\n {/* Text */}\n <Box flex={1} gap={2}>\n {title && (\n <Typography\n variant=\"bodyMdAccent\"\n color={theme.colors.content.primary}\n >\n {title}\n </Typography>\n )}\n {description && (\n <Typography variant=\"bodySm\" color={theme.colors.content.tertiary}>\n {description}\n </Typography>\n )}\n </Box>\n\n {/* Actions */}\n {hasActions && (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n alignSelf=\"stretch\"\n gap={config.groupGap ?? 4}\n >\n {isValidElement(action) &&\n cloneElement(action as ToastActionElement, {\n size: \"xs\",\n variant: \"tertiary\",\n tone: TYPE_TO_BUTTON_TONE[type],\n })}\n\n {action && showCloseButton && (\n <Box\n width={1}\n alignSelf=\"stretch\"\n backgroundColor={theme.colors.border.secondary}\n />\n )}\n\n {showCloseButton && (\n <IconButton\n variant=\"tertiary\"\n tone=\"mono\"\n size=\"xs\"\n onPress={onClose}\n aria-label=\"Close toast\"\n icon={<Remove size={18} />}\n hoverBackground=\"none\"\n />\n )}\n </Box>\n )}\n </Box>\n </Box>\n );\n};\n\nToast.displayName = \"Toast\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import React, {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Toast, type ToastProps, type ToastType } from \"./Toast\";\n\nexport type ToastPosition =\n | \"top-right\"\n | \"top-left\"\n | \"top-center\"\n | \"bottom-right\"\n | \"bottom-left\"\n | \"bottom-center\";\n\nexport type ToastVariant = \"default\" | \"sonner\";\n\nexport interface ToastOptions extends Omit<\n ToastProps,\n \"type\" | \"onClose\" | \"testID\"\n> {\n /**\n * Auto-dismiss duration in ms. Pass 0 to disable auto-dismiss.\n * Defaults derived from `type`: success 4500, info/warning 6500, alert 9000.\n */\n duration?: number;\n /** Stable id — if provided and a toast with that id already exists, it's replaced. */\n id?: string;\n /** Called when the toast is dismissed (auto or manual). */\n onDismiss?: () => void;\n}\n\nexport interface ToastQueueItem extends ToastOptions {\n id: string;\n type: ToastType;\n createdAt: number;\n}\n\nexport interface ToastApi {\n alert: (options: ToastOptions) => string;\n success: (options: ToastOptions) => string;\n warning: (options: ToastOptions) => string;\n info: (options: ToastOptions) => string;\n show: (type: ToastType, options: ToastOptions) => string;\n dismiss: (id: string) => void;\n dismissAll: () => void;\n}\n\ninterface ToastContextValue {\n api: ToastApi;\n}\n\nconst ToastContext = createContext<ToastContextValue | null>(null);\n\nconst DEFAULT_DURATIONS: Record<ToastType, number> = {\n success: 4500,\n info: 6500,\n warning: 6500,\n alert: 9000,\n};\n\nconst POSITION_STYLES: Record<ToastPosition, React.CSSProperties> = {\n \"top-right\": { top: 16, right: 16, alignItems: \"flex-end\" },\n \"top-left\": { top: 16, left: 16, alignItems: \"flex-start\" },\n \"top-center\": {\n top: 16,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n alignItems: \"center\",\n },\n \"bottom-right\": { bottom: 16, right: 16, alignItems: \"flex-end\" },\n \"bottom-left\": { bottom: 16, left: 16, alignItems: \"flex-start\" },\n \"bottom-center\": {\n bottom: 16,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n alignItems: \"center\",\n },\n};\n\nexport interface ToastProviderProps {\n children: React.ReactNode;\n /** Where toasts appear on screen. Defaults to top-right. */\n position?: ToastPosition;\n /** Maximum number of simultaneously visible toasts. Defaults to 3. */\n limit?: number;\n /** DOM node to portal the viewport into. Defaults to document.body. */\n container?: HTMLElement | null;\n /**\n * Enable enter & exit animations. Defaults to `true`.\n * When `false`, toasts appear and disappear instantly.\n */\n animated?: boolean;\n /** Animation duration in ms. Defaults to 220 (default variant) / 400 (sonner). */\n animationDuration?: number;\n /**\n * Visual variant.\n * - `\"default\"` — toasts slide in from the edge and stack vertically.\n * - `\"sonner\"` — shadcn/sonner-style stacked-cards: toasts overlap as a deck\n * with back cards scaled & peeking; hovering the stack expands it.\n */\n variant?: ToastVariant;\n}\n\n// Off-screen transform used as the enter start / exit end state, derived\n// from the viewport position (slides in from the closest edge).\nconst enterTransform = (position: ToastPosition): string => {\n if (position.endsWith(\"right\")) return \"translateX(110%)\";\n if (position.endsWith(\"left\")) return \"translateX(-110%)\";\n return position.startsWith(\"top\") ? \"translateY(-110%)\" : \"translateY(110%)\";\n};\n\n// CSS to anchor an absolutely-positioned sonner item to the viewport corner.\nconst SONNER_ANCHOR: Record<ToastPosition, React.CSSProperties> = {\n \"top-right\": { top: 0, right: 0 },\n \"top-left\": { top: 0, left: 0 },\n \"top-center\": { top: 0, left: \"50%\", marginLeft: -220 },\n \"bottom-right\": { bottom: 0, right: 0 },\n \"bottom-left\": { bottom: 0, left: 0 },\n \"bottom-center\": { bottom: 0, left: \"50%\", marginLeft: -220 },\n};\n\nconst SONNER_GAP = 8;\nconst SONNER_PEEK = 6;\nconst SONNER_SCALE_STEP = 0.06;\nconst MAX_VISIBLE_BACK = 2; // beyond this index, toasts fade to zero\n\ninterface ToastItemProps {\n item: ToastQueueItem;\n position: ToastPosition;\n variant: ToastVariant;\n animated: boolean;\n animationDuration: number;\n exiting: boolean;\n // Sonner-specific\n frontIndex: number;\n expanded: boolean;\n cumulativeOffset: number;\n reportHeight: (id: string, h: number) => void;\n // Common\n onClose: () => void;\n onPause: () => void;\n onResume: () => void;\n onHoverIn: (id: string) => void;\n onHoverOut: (id: string) => void;\n}\n\nconst ToastItem: React.FC<ToastItemProps> = ({\n item,\n position,\n variant,\n animated,\n animationDuration,\n exiting,\n frontIndex,\n expanded,\n cumulativeOffset,\n reportHeight,\n onClose,\n onPause,\n onResume,\n onHoverIn,\n onHoverOut,\n}) => {\n const [entered, setEntered] = useState(!animated);\n const ref = useRef<HTMLDivElement | null>(null);\n const hoveredRef = useRef(false);\n\n useEffect(() => {\n if (!animated) return;\n let raf2 = 0;\n const raf1 = window.requestAnimationFrame(() => {\n raf2 = window.requestAnimationFrame(() => setEntered(true));\n });\n return () => {\n window.cancelAnimationFrame(raf1);\n window.cancelAnimationFrame(raf2);\n };\n }, [animated]);\n\n // Guarantee hover state is cleaned up if the item unmounts while hovered\n // (mouseLeave doesn't fire on disappearing elements).\n useEffect(\n () => () => {\n if (hoveredRef.current) {\n hoveredRef.current = false;\n onHoverOut(item.id);\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n );\n\n // Measure height for sonner stacking math.\n useLayoutEffect(() => {\n if (variant !== \"sonner\" || !ref.current) return;\n const el = ref.current;\n const report = () =>\n reportHeight(item.id, el.getBoundingClientRect().height);\n report();\n if (typeof ResizeObserver === \"undefined\") return;\n const ro = new ResizeObserver(report);\n ro.observe(el);\n return () => ro.disconnect();\n }, [variant, item.id, reportHeight]);\n\n const isSonner = variant === \"sonner\";\n const isBottom = position.startsWith(\"bottom\");\n const isCenter = position.endsWith(\"center\");\n const dir = isBottom ? -1 : 1; // direction items move to \"stack back\"\n\n let transform: string;\n let opacity = 1;\n let zIndex = 1000 - frontIndex;\n\n const offTransform = enterTransform(position);\n const showOff = animated && (!entered || exiting);\n\n if (isSonner) {\n // Horizontal centering baseline for *-center positions\n const xBase = \"\"; // marginLeft handles centering for sonner-anchored items\n\n if (showOff) {\n transform = `${xBase} ${offTransform}`.trim();\n opacity = 0;\n } else if (frontIndex === 0) {\n transform = `${xBase} translateY(0) scale(1)`;\n } else if (expanded) {\n // Spread out using measured cumulative offsets\n transform = `${xBase} translateY(${dir * cumulativeOffset}px) scale(1)`;\n } else {\n // Collapsed stack: peek behind front, scaled down\n const peek = SONNER_PEEK * frontIndex;\n const scale = Math.max(0.7, 1 - SONNER_SCALE_STEP * frontIndex);\n transform = `${xBase} translateY(${dir * peek}px) scale(${scale})`;\n if (frontIndex > MAX_VISIBLE_BACK) opacity = 0;\n }\n } else {\n // Default variant: simple slide-in / slide-out\n transform = showOff ? offTransform : \"translateX(0) translateY(0)\";\n opacity = showOff ? 0 : 1;\n }\n\n const style: React.CSSProperties = {\n pointerEvents: opacity === 0 ? \"none\" : \"auto\",\n transform,\n opacity,\n zIndex,\n transition: animated\n ? `transform ${animationDuration}ms cubic-bezier(0.16, 1, 0.3, 1), opacity ${animationDuration}ms ease`\n : undefined,\n willChange: animated ? \"transform, opacity\" : undefined,\n transformOrigin: isSonner\n ? isCenter\n ? isBottom\n ? \"bottom center\"\n : \"top center\"\n : isBottom\n ? `bottom ${position.endsWith(\"right\") ? \"right\" : \"left\"}`\n : `top ${position.endsWith(\"right\") ? \"right\" : \"left\"}`\n : undefined,\n ...(isSonner\n ? {\n position: \"absolute\" as const,\n width: 440,\n ...SONNER_ANCHOR[position],\n }\n : null),\n };\n\n return (\n <div\n ref={ref}\n style={style}\n onMouseEnter={() => {\n onPause();\n if (!hoveredRef.current) {\n hoveredRef.current = true;\n onHoverIn(item.id);\n }\n }}\n onMouseLeave={() => {\n onResume();\n if (hoveredRef.current) {\n hoveredRef.current = false;\n onHoverOut(item.id);\n }\n }}\n // Ignore focus moves between descendants (e.g. action → close button) —\n // those are still inside the toast and shouldn't toggle the timer.\n onFocus={(e) => {\n if (e.currentTarget.contains(e.relatedTarget as Node | null)) return;\n onPause();\n if (!hoveredRef.current) {\n hoveredRef.current = true;\n onHoverIn(item.id);\n }\n }}\n onBlur={(e) => {\n if (e.currentTarget.contains(e.relatedTarget as Node | null)) return;\n onResume();\n if (hoveredRef.current) {\n hoveredRef.current = false;\n onHoverOut(item.id);\n }\n }}\n >\n <Toast\n type={item.type}\n title={item.title}\n description={item.description}\n action={item.action}\n showCloseButton={item.showCloseButton}\n onClose={onClose}\n themeMode={item.themeMode}\n themeProductContext={item.themeProductContext}\n />\n </div>\n );\n};\n\nlet idCounter = 0;\nconst nextId = () => `toast-${Date.now()}-${++idCounter}`;\n\nexport const ToastProvider: React.FC<ToastProviderProps> = ({\n children,\n position = \"top-right\",\n limit = 3,\n container,\n animated = true,\n animationDuration,\n variant = \"default\",\n}) => {\n const isSonner = variant === \"sonner\";\n const effectiveDuration = animationDuration ?? (isSonner ? 400 : 220);\n\n const [toasts, setToasts] = useState<ToastQueueItem[]>([]);\n const [exiting, setExiting] = useState<Set<string>>(() => new Set());\n const [heights, setHeights] = useState<Record<string, number>>({});\n const [hoveredIds, setHoveredIds] = useState<Set<string>>(() => new Set());\n const exitTimeoutsRef = useRef<Map<string, number>>(new Map());\n const timersRef = useRef<\n Map<string, { remaining: number; startedAt: number; timeoutId: number }>\n >(new Map());\n const onDismissRef = useRef<Map<string, () => void>>(new Map());\n const dismissRef = useRef<(id: string) => void>(() => {});\n\n const reportHeight = useCallback((id: string, h: number) => {\n setHeights((prev) => (prev[id] === h ? prev : { ...prev, [id]: h }));\n }, []);\n\n const clearTimer = useCallback((id: string) => {\n const entry = timersRef.current.get(id);\n if (entry) {\n window.clearTimeout(entry.timeoutId);\n timersRef.current.delete(id);\n }\n }, []);\n\n const removeNow = useCallback((id: string) => {\n const cb = onDismissRef.current.get(id);\n onDismissRef.current.delete(id);\n setToasts((prev) => prev.filter((t) => t.id !== id));\n setExiting((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n setHeights((prev) => {\n if (!(id in prev)) return prev;\n const next = { ...prev };\n delete next[id];\n return next;\n });\n setHoveredIds((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n cb?.();\n }, []);\n\n const dismiss = useCallback(\n (id: string) => {\n clearTimer(id);\n if (!animated) {\n removeNow(id);\n return;\n }\n if (exitTimeoutsRef.current.has(id)) return;\n setExiting((prev) => {\n const next = new Set(prev);\n next.add(id);\n return next;\n });\n const timeoutId = window.setTimeout(() => {\n exitTimeoutsRef.current.delete(id);\n removeNow(id);\n }, effectiveDuration);\n exitTimeoutsRef.current.set(id, timeoutId);\n },\n [clearTimer, animated, effectiveDuration, removeNow]\n );\n\n useEffect(() => {\n dismissRef.current = dismiss;\n }, [dismiss]);\n\n const startTimer = useCallback((id: string, duration: number) => {\n if (duration <= 0) return;\n const timeoutId = window.setTimeout(() => {\n dismissRef.current(id);\n }, duration);\n timersRef.current.set(id, {\n remaining: duration,\n startedAt: Date.now(),\n timeoutId,\n });\n }, []);\n\n const pauseTimer = useCallback((id: string) => {\n const entry = timersRef.current.get(id);\n if (!entry) return;\n const elapsed = Date.now() - entry.startedAt;\n const remaining = Math.max(0, entry.remaining - elapsed);\n window.clearTimeout(entry.timeoutId);\n timersRef.current.set(id, {\n remaining,\n startedAt: Date.now(),\n timeoutId: 0,\n });\n }, []);\n\n const resumeTimer = useCallback(\n (id: string) => {\n const entry = timersRef.current.get(id);\n if (!entry || entry.timeoutId !== 0) return;\n startTimer(id, entry.remaining);\n },\n [startTimer]\n );\n\n // Fire any registered onDismiss for `id` and clear all per-toast bookkeeping.\n // Used when a toast is replaced (same id re-issued) or evicted by limit\n // overflow — both are documented dismissal paths.\n const cleanupDroppedToast = useCallback(\n (id: string) => {\n clearTimer(id);\n const exitTimeoutId = exitTimeoutsRef.current.get(id);\n if (exitTimeoutId) {\n window.clearTimeout(exitTimeoutId);\n exitTimeoutsRef.current.delete(id);\n }\n setExiting((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n const cb = onDismissRef.current.get(id);\n onDismissRef.current.delete(id);\n cb?.();\n },\n [clearTimer]\n );\n\n const show = useCallback(\n (type: ToastType, options: ToastOptions): string => {\n const id = options.id ?? nextId();\n const duration = options.duration ?? DEFAULT_DURATIONS[type];\n const item: ToastQueueItem = {\n ...options,\n id,\n type,\n createdAt: Date.now(),\n };\n\n // If this id is currently exiting (replacement during exit animation),\n // cancel the pending exit so the new toast doesn't get marked exiting\n // and the old timeout doesn't remove it.\n const pendingExit = exitTimeoutsRef.current.get(id);\n if (pendingExit) {\n window.clearTimeout(pendingExit);\n exitTimeoutsRef.current.delete(id);\n setExiting((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n }\n\n // Manage the onDismiss slot atomically: replacing without a new\n // callback should not leave the previous one registered.\n if (options.onDismiss) {\n onDismissRef.current.set(id, options.onDismiss);\n } else {\n onDismissRef.current.delete(id);\n }\n\n setToasts((prev) => {\n const replaced = prev.filter((t) => t.id === id);\n const withoutDup = prev.filter((t) => t.id !== id);\n const next = [...withoutDup, item];\n const overflow =\n next.length > limit ? next.slice(0, next.length - limit) : [];\n\n // Replaced toasts: their onDismiss has already been overwritten\n // above, so just clear timers (no callback to fire).\n replaced.forEach((t) => {\n clearTimer(t.id);\n const ex = exitTimeoutsRef.current.get(t.id);\n if (ex) {\n window.clearTimeout(ex);\n exitTimeoutsRef.current.delete(t.id);\n }\n });\n\n // Overflow toasts: fire onDismiss and clean up.\n overflow.forEach((t) => {\n if (t.id === id) return; // never the freshly-added one\n cleanupDroppedToast(t.id);\n });\n\n return next.length > limit ? next.slice(next.length - limit) : next;\n });\n\n clearTimer(id);\n startTimer(id, duration);\n\n return id;\n },\n [clearTimer, startTimer, limit, cleanupDroppedToast]\n );\n\n const dismissAll = useCallback(() => {\n const ids = Array.from(timersRef.current.keys());\n ids.forEach((id) => dismiss(id));\n setToasts((prev) => {\n prev.forEach((t) => {\n if (!ids.includes(t.id)) dismiss(t.id);\n });\n return prev;\n });\n }, [dismiss]);\n\n const api = useMemo<ToastApi>(\n () => ({\n alert: (options) => show(\"alert\", options),\n success: (options) => show(\"success\", options),\n warning: (options) => show(\"warning\", options),\n info: (options) => show(\"info\", options),\n show,\n dismiss,\n dismissAll,\n }),\n [show, dismiss, dismissAll]\n );\n\n useEffect(\n () => () => {\n timersRef.current.forEach((entry) =>\n window.clearTimeout(entry.timeoutId)\n );\n timersRef.current.clear();\n exitTimeoutsRef.current.forEach((id) => window.clearTimeout(id));\n exitTimeoutsRef.current.clear();\n },\n []\n );\n\n const portalTarget =\n container ?? (typeof document !== \"undefined\" ? document.body : null);\n\n const isBottom = position.startsWith(\"bottom\");\n\n // Build the render list with frontIndex (0 = newest = front of stack).\n // toasts[] is oldest → newest. For default variant the visual order is:\n // top-*: newest first in DOM (so it appears at the top edge)\n // bottom-*: newest last in DOM (so it appears at the bottom edge)\n // For sonner the DOM order doesn't affect visual stacking (all absolute,\n // controlled by z-index), but for tab order we keep front-first in DOM.\n const orderedItems = (() => {\n if (isSonner) {\n // newest first\n return [...toasts].reverse().map((item, i) => ({ item, frontIndex: i }));\n }\n // default\n if (isBottom) {\n // newest last → frontIndex 0 is the last item\n return toasts.map((item, i) => ({\n item,\n frontIndex: toasts.length - 1 - i,\n }));\n }\n return [...toasts].reverse().map((item, i) => ({ item, frontIndex: i }));\n })();\n\n // Cumulative offset used by sonner-expanded layout: sum of heights of items\n // closer to the front (smaller frontIndex) plus gap.\n const offsetByFrontIndex = useMemo(() => {\n const map: Record<number, number> = { 0: 0 };\n let cumulative = 0;\n // Walk in front-first order.\n const sorted = [...orderedItems].sort(\n (a, b) => a.frontIndex - b.frontIndex\n );\n for (let i = 0; i < sorted.length; i++) {\n const fi = sorted[i].frontIndex;\n if (fi === 0) continue;\n const prev = sorted[i - 1];\n cumulative += (heights[prev.item.id] ?? 64) + SONNER_GAP;\n map[fi] = cumulative;\n }\n return map;\n }, [orderedItems, heights]);\n\n const expanded = isSonner && hoveredIds.size > 0;\n\n // For sonner: keep the viewport sized so it captures hover even when only\n // the front toast is visible.\n const frontHeight = (() => {\n const front = orderedItems.find((x) => x.frontIndex === 0);\n return front ? (heights[front.item.id] ?? 64) : 0;\n })();\n\n const sonnerExpandedHeight =\n frontHeight +\n orderedItems\n .filter((x) => x.frontIndex > 0)\n .reduce((sum, x) => sum + (heights[x.item.id] ?? 64) + SONNER_GAP, 0);\n\n return (\n <ToastContext.Provider value={{ api }}>\n {children}\n {portalTarget &&\n createPortal(\n <div\n data-toast-viewport=\"\"\n data-variant={variant}\n data-expanded={expanded ? \"\" : undefined}\n style={{\n position: \"fixed\",\n zIndex: 9999,\n pointerEvents: \"none\",\n maxWidth: \"calc(100vw - 32px)\",\n ...(isSonner\n ? {\n width: 440,\n height: expanded ? sonnerExpandedHeight : frontHeight,\n transition: animated\n ? `height ${effectiveDuration}ms cubic-bezier(0.16, 1, 0.3, 1)`\n : undefined,\n ...POSITION_STYLES[position],\n // override flex (we use absolute children in sonner mode)\n display: \"block\",\n }\n : {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n ...POSITION_STYLES[position],\n }),\n }}\n >\n {orderedItems.map(({ item, frontIndex }) => (\n <ToastItem\n key={item.id}\n item={item}\n position={position}\n variant={variant}\n animated={animated}\n animationDuration={effectiveDuration}\n exiting={exiting.has(item.id)}\n frontIndex={frontIndex}\n expanded={expanded}\n cumulativeOffset={offsetByFrontIndex[frontIndex] ?? 0}\n reportHeight={reportHeight}\n onClose={() => dismiss(item.id)}\n onPause={() => pauseTimer(item.id)}\n onResume={() => resumeTimer(item.id)}\n onHoverIn={(id) => {\n if (!isSonner) return;\n setHoveredIds((prev) => {\n if (prev.has(id)) return prev;\n const next = new Set(prev);\n next.add(id);\n return next;\n });\n }}\n onHoverOut={(id) => {\n if (!isSonner) return;\n setHoveredIds((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n }}\n />\n ))}\n </div>,\n portalTarget\n )}\n </ToastContext.Provider>\n );\n};\n\nToastProvider.displayName = \"ToastProvider\";\n\nexport const useToast = (): ToastApi => {\n const ctx = useContext(ToastContext);\n if (!ctx) {\n throw new Error(\"useToast must be used within a <ToastProvider />\");\n }\n return ctx.api;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAoD;;;ACApD,IAAAC,gBAAkB;AAClB,+BAAmB;;;ACDnB,mBAAkB;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAAI,kBAAkB;AAEtB,IAAI,QAAQ;AAAA,EAAQ,SAAU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AAO,IAAI;AACb;","names":["import_react","import_react","React","styled","React","import_jsx_runtime","import_react","import_jsx_runtime"]}
package/web/index.mjs CHANGED
@@ -213,7 +213,8 @@ var Box = React2.forwardRef(
213
213
  top: typeof props.top === "number" ? `${props.top}px` : props.top,
214
214
  left: typeof props.left === "number" ? `${props.left}px` : props.left,
215
215
  right: typeof props.right === "number" ? `${props.right}px` : props.right,
216
- bottom: typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom
216
+ bottom: typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom,
217
+ ...props.style
217
218
  }
218
219
  }
219
220
  );
package/web/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Toast.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../src/ToastProvider.web.tsx"],"sourcesContent":["import React, { cloneElement, isValidElement } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, type ThemeOverrideProps } from \"@xsolla/xui-core\";\nimport {\n IconButton,\n type ButtonProps,\n type IconButtonProps,\n} from \"@xsolla/xui-button\";\nimport { Typography } from \"@xsolla/xui-typography\";\nimport { Remove } from \"@xsolla/xui-icons-base\";\n\nexport type ToastType = \"alert\" | \"success\" | \"warning\" | \"info\";\n\nexport type ToastActionElement = React.ReactElement<\n ButtonProps | IconButtonProps\n>;\n\nexport interface ToastProps extends ThemeOverrideProps {\n /** Visual variant/tone of the toast */\n type?: ToastType;\n /** Title text (required for accessibility) */\n title?: string;\n /** Optional description text shown beneath the title */\n description?: string;\n /**\n * Action element (Button/IconButton). The toast will inject\n * `size=\"xs\"`, `variant=\"tertiary\"`, and a tone matching the toast type.\n */\n action?: React.ReactElement;\n /** Show/hide close button */\n showCloseButton?: boolean;\n /** Close button click handler */\n onClose?: () => void;\n /** Test ID for testing frameworks */\n testID?: string;\n}\n\nconst TYPE_TO_BUTTON_TONE: Record<\n ToastType,\n \"alert\" | \"brandExtra\" | \"brand\" | \"mono\"\n> = {\n alert: \"alert\",\n success: \"brandExtra\",\n warning: \"mono\",\n info: \"brand\",\n};\n\nexport const Toast: React.FC<ToastProps> = ({\n type = \"info\",\n title,\n description,\n action,\n showCloseButton = true,\n onClose,\n testID,\n themeMode,\n themeProductContext,\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const config = theme.sizing.toast();\n\n const stripeColor: Record<ToastType, string> = {\n alert: theme.colors.content.alert.primary,\n success: theme.colors.content.success.secondary,\n warning: theme.colors.content.warning.secondary,\n info: theme.colors.content.brand.secondary,\n };\n\n const hasActions = Boolean(action) || showCloseButton;\n\n return (\n <Box\n backgroundColor={theme.colors.background.primary}\n borderRadius={config.borderRadius}\n flexDirection=\"row\"\n alignItems=\"stretch\"\n overflow=\"hidden\"\n width={440}\n style={{ boxShadow: theme.shadow.surface }}\n testID={testID}\n role={type === \"alert\" ? \"alert\" : \"status\"}\n aria-live={type === \"alert\" ? \"assertive\" : \"polite\"}\n aria-label={`${type} toast`}\n >\n {/* Colored left stripe */}\n <Box backgroundColor={stripeColor[type]} width={4} alignSelf=\"stretch\" />\n\n {/* Body */}\n <Box\n flex={1}\n flexDirection=\"row\"\n alignItems=\"center\"\n paddingHorizontal={16}\n paddingVertical={12}\n gap={16}\n >\n {/* Text */}\n <Box flex={1} gap={2}>\n {title && (\n <Typography\n variant=\"bodyMdAccent\"\n color={theme.colors.content.primary}\n >\n {title}\n </Typography>\n )}\n {description && (\n <Typography variant=\"bodySm\" color={theme.colors.content.tertiary}>\n {description}\n </Typography>\n )}\n </Box>\n\n {/* Actions */}\n {hasActions && (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n alignSelf=\"stretch\"\n gap={config.groupGap ?? 4}\n >\n {isValidElement(action) &&\n cloneElement(action as ToastActionElement, {\n size: \"xs\",\n variant: \"tertiary\",\n tone: TYPE_TO_BUTTON_TONE[type],\n })}\n\n {action && showCloseButton && (\n <Box\n width={1}\n alignSelf=\"stretch\"\n backgroundColor={theme.colors.border.secondary}\n />\n )}\n\n {showCloseButton && (\n <IconButton\n variant=\"tertiary\"\n tone=\"mono\"\n size=\"xs\"\n onPress={onClose}\n aria-label=\"Close toast\"\n icon={<Remove size={18} />}\n hoverBackground=\"none\"\n />\n )}\n </Box>\n )}\n </Box>\n </Box>\n );\n};\n\nToast.displayName = \"Toast\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import React, {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Toast, type ToastProps, type ToastType } from \"./Toast\";\n\nexport type ToastPosition =\n | \"top-right\"\n | \"top-left\"\n | \"top-center\"\n | \"bottom-right\"\n | \"bottom-left\"\n | \"bottom-center\";\n\nexport type ToastVariant = \"default\" | \"sonner\";\n\nexport interface ToastOptions extends Omit<\n ToastProps,\n \"type\" | \"onClose\" | \"testID\"\n> {\n /**\n * Auto-dismiss duration in ms. Pass 0 to disable auto-dismiss.\n * Defaults derived from `type`: success 4500, info/warning 6500, alert 9000.\n */\n duration?: number;\n /** Stable id — if provided and a toast with that id already exists, it's replaced. */\n id?: string;\n /** Called when the toast is dismissed (auto or manual). */\n onDismiss?: () => void;\n}\n\nexport interface ToastQueueItem extends ToastOptions {\n id: string;\n type: ToastType;\n createdAt: number;\n}\n\nexport interface ToastApi {\n alert: (options: ToastOptions) => string;\n success: (options: ToastOptions) => string;\n warning: (options: ToastOptions) => string;\n info: (options: ToastOptions) => string;\n show: (type: ToastType, options: ToastOptions) => string;\n dismiss: (id: string) => void;\n dismissAll: () => void;\n}\n\ninterface ToastContextValue {\n api: ToastApi;\n}\n\nconst ToastContext = createContext<ToastContextValue | null>(null);\n\nconst DEFAULT_DURATIONS: Record<ToastType, number> = {\n success: 4500,\n info: 6500,\n warning: 6500,\n alert: 9000,\n};\n\nconst POSITION_STYLES: Record<ToastPosition, React.CSSProperties> = {\n \"top-right\": { top: 16, right: 16, alignItems: \"flex-end\" },\n \"top-left\": { top: 16, left: 16, alignItems: \"flex-start\" },\n \"top-center\": {\n top: 16,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n alignItems: \"center\",\n },\n \"bottom-right\": { bottom: 16, right: 16, alignItems: \"flex-end\" },\n \"bottom-left\": { bottom: 16, left: 16, alignItems: \"flex-start\" },\n \"bottom-center\": {\n bottom: 16,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n alignItems: \"center\",\n },\n};\n\nexport interface ToastProviderProps {\n children: React.ReactNode;\n /** Where toasts appear on screen. Defaults to top-right. */\n position?: ToastPosition;\n /** Maximum number of simultaneously visible toasts. Defaults to 3. */\n limit?: number;\n /** DOM node to portal the viewport into. Defaults to document.body. */\n container?: HTMLElement | null;\n /**\n * Enable enter & exit animations. Defaults to `true`.\n * When `false`, toasts appear and disappear instantly.\n */\n animated?: boolean;\n /** Animation duration in ms. Defaults to 220 (default variant) / 400 (sonner). */\n animationDuration?: number;\n /**\n * Visual variant.\n * - `\"default\"` — toasts slide in from the edge and stack vertically.\n * - `\"sonner\"` — shadcn/sonner-style stacked-cards: toasts overlap as a deck\n * with back cards scaled & peeking; hovering the stack expands it.\n */\n variant?: ToastVariant;\n}\n\n// Off-screen transform used as the enter start / exit end state, derived\n// from the viewport position (slides in from the closest edge).\nconst enterTransform = (position: ToastPosition): string => {\n if (position.endsWith(\"right\")) return \"translateX(110%)\";\n if (position.endsWith(\"left\")) return \"translateX(-110%)\";\n return position.startsWith(\"top\") ? \"translateY(-110%)\" : \"translateY(110%)\";\n};\n\n// CSS to anchor an absolutely-positioned sonner item to the viewport corner.\nconst SONNER_ANCHOR: Record<ToastPosition, React.CSSProperties> = {\n \"top-right\": { top: 0, right: 0 },\n \"top-left\": { top: 0, left: 0 },\n \"top-center\": { top: 0, left: \"50%\", marginLeft: -220 },\n \"bottom-right\": { bottom: 0, right: 0 },\n \"bottom-left\": { bottom: 0, left: 0 },\n \"bottom-center\": { bottom: 0, left: \"50%\", marginLeft: -220 },\n};\n\nconst SONNER_GAP = 8;\nconst SONNER_PEEK = 6;\nconst SONNER_SCALE_STEP = 0.06;\nconst MAX_VISIBLE_BACK = 2; // beyond this index, toasts fade to zero\n\ninterface ToastItemProps {\n item: ToastQueueItem;\n position: ToastPosition;\n variant: ToastVariant;\n animated: boolean;\n animationDuration: number;\n exiting: boolean;\n // Sonner-specific\n frontIndex: number;\n expanded: boolean;\n cumulativeOffset: number;\n reportHeight: (id: string, h: number) => void;\n // Common\n onClose: () => void;\n onPause: () => void;\n onResume: () => void;\n onHoverIn: (id: string) => void;\n onHoverOut: (id: string) => void;\n}\n\nconst ToastItem: React.FC<ToastItemProps> = ({\n item,\n position,\n variant,\n animated,\n animationDuration,\n exiting,\n frontIndex,\n expanded,\n cumulativeOffset,\n reportHeight,\n onClose,\n onPause,\n onResume,\n onHoverIn,\n onHoverOut,\n}) => {\n const [entered, setEntered] = useState(!animated);\n const ref = useRef<HTMLDivElement | null>(null);\n const hoveredRef = useRef(false);\n\n useEffect(() => {\n if (!animated) return;\n let raf2 = 0;\n const raf1 = window.requestAnimationFrame(() => {\n raf2 = window.requestAnimationFrame(() => setEntered(true));\n });\n return () => {\n window.cancelAnimationFrame(raf1);\n window.cancelAnimationFrame(raf2);\n };\n }, [animated]);\n\n // Guarantee hover state is cleaned up if the item unmounts while hovered\n // (mouseLeave doesn't fire on disappearing elements).\n useEffect(\n () => () => {\n if (hoveredRef.current) {\n hoveredRef.current = false;\n onHoverOut(item.id);\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n );\n\n // Measure height for sonner stacking math.\n useLayoutEffect(() => {\n if (variant !== \"sonner\" || !ref.current) return;\n const el = ref.current;\n const report = () =>\n reportHeight(item.id, el.getBoundingClientRect().height);\n report();\n if (typeof ResizeObserver === \"undefined\") return;\n const ro = new ResizeObserver(report);\n ro.observe(el);\n return () => ro.disconnect();\n }, [variant, item.id, reportHeight]);\n\n const isSonner = variant === \"sonner\";\n const isBottom = position.startsWith(\"bottom\");\n const isCenter = position.endsWith(\"center\");\n const dir = isBottom ? -1 : 1; // direction items move to \"stack back\"\n\n let transform: string;\n let opacity = 1;\n let zIndex = 1000 - frontIndex;\n\n const offTransform = enterTransform(position);\n const showOff = animated && (!entered || exiting);\n\n if (isSonner) {\n // Horizontal centering baseline for *-center positions\n const xBase = \"\"; // marginLeft handles centering for sonner-anchored items\n\n if (showOff) {\n transform = `${xBase} ${offTransform}`.trim();\n opacity = 0;\n } else if (frontIndex === 0) {\n transform = `${xBase} translateY(0) scale(1)`;\n } else if (expanded) {\n // Spread out using measured cumulative offsets\n transform = `${xBase} translateY(${dir * cumulativeOffset}px) scale(1)`;\n } else {\n // Collapsed stack: peek behind front, scaled down\n const peek = SONNER_PEEK * frontIndex;\n const scale = Math.max(0.7, 1 - SONNER_SCALE_STEP * frontIndex);\n transform = `${xBase} translateY(${dir * peek}px) scale(${scale})`;\n if (frontIndex > MAX_VISIBLE_BACK) opacity = 0;\n }\n } else {\n // Default variant: simple slide-in / slide-out\n transform = showOff ? offTransform : \"translateX(0) translateY(0)\";\n opacity = showOff ? 0 : 1;\n }\n\n const style: React.CSSProperties = {\n pointerEvents: opacity === 0 ? \"none\" : \"auto\",\n transform,\n opacity,\n zIndex,\n transition: animated\n ? `transform ${animationDuration}ms cubic-bezier(0.16, 1, 0.3, 1), opacity ${animationDuration}ms ease`\n : undefined,\n willChange: animated ? \"transform, opacity\" : undefined,\n transformOrigin: isSonner\n ? isCenter\n ? isBottom\n ? \"bottom center\"\n : \"top center\"\n : isBottom\n ? `bottom ${position.endsWith(\"right\") ? \"right\" : \"left\"}`\n : `top ${position.endsWith(\"right\") ? \"right\" : \"left\"}`\n : undefined,\n ...(isSonner\n ? {\n position: \"absolute\" as const,\n width: 440,\n ...SONNER_ANCHOR[position],\n }\n : null),\n };\n\n return (\n <div\n ref={ref}\n style={style}\n onMouseEnter={() => {\n onPause();\n if (!hoveredRef.current) {\n hoveredRef.current = true;\n onHoverIn(item.id);\n }\n }}\n onMouseLeave={() => {\n onResume();\n if (hoveredRef.current) {\n hoveredRef.current = false;\n onHoverOut(item.id);\n }\n }}\n // Ignore focus moves between descendants (e.g. action → close button) —\n // those are still inside the toast and shouldn't toggle the timer.\n onFocus={(e) => {\n if (e.currentTarget.contains(e.relatedTarget as Node | null)) return;\n onPause();\n if (!hoveredRef.current) {\n hoveredRef.current = true;\n onHoverIn(item.id);\n }\n }}\n onBlur={(e) => {\n if (e.currentTarget.contains(e.relatedTarget as Node | null)) return;\n onResume();\n if (hoveredRef.current) {\n hoveredRef.current = false;\n onHoverOut(item.id);\n }\n }}\n >\n <Toast\n type={item.type}\n title={item.title}\n description={item.description}\n action={item.action}\n showCloseButton={item.showCloseButton}\n onClose={onClose}\n themeMode={item.themeMode}\n themeProductContext={item.themeProductContext}\n />\n </div>\n );\n};\n\nlet idCounter = 0;\nconst nextId = () => `toast-${Date.now()}-${++idCounter}`;\n\nexport const ToastProvider: React.FC<ToastProviderProps> = ({\n children,\n position = \"top-right\",\n limit = 3,\n container,\n animated = true,\n animationDuration,\n variant = \"default\",\n}) => {\n const isSonner = variant === \"sonner\";\n const effectiveDuration = animationDuration ?? (isSonner ? 400 : 220);\n\n const [toasts, setToasts] = useState<ToastQueueItem[]>([]);\n const [exiting, setExiting] = useState<Set<string>>(() => new Set());\n const [heights, setHeights] = useState<Record<string, number>>({});\n const [hoveredIds, setHoveredIds] = useState<Set<string>>(() => new Set());\n const exitTimeoutsRef = useRef<Map<string, number>>(new Map());\n const timersRef = useRef<\n Map<string, { remaining: number; startedAt: number; timeoutId: number }>\n >(new Map());\n const onDismissRef = useRef<Map<string, () => void>>(new Map());\n const dismissRef = useRef<(id: string) => void>(() => {});\n\n const reportHeight = useCallback((id: string, h: number) => {\n setHeights((prev) => (prev[id] === h ? prev : { ...prev, [id]: h }));\n }, []);\n\n const clearTimer = useCallback((id: string) => {\n const entry = timersRef.current.get(id);\n if (entry) {\n window.clearTimeout(entry.timeoutId);\n timersRef.current.delete(id);\n }\n }, []);\n\n const removeNow = useCallback((id: string) => {\n const cb = onDismissRef.current.get(id);\n onDismissRef.current.delete(id);\n setToasts((prev) => prev.filter((t) => t.id !== id));\n setExiting((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n setHeights((prev) => {\n if (!(id in prev)) return prev;\n const next = { ...prev };\n delete next[id];\n return next;\n });\n setHoveredIds((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n cb?.();\n }, []);\n\n const dismiss = useCallback(\n (id: string) => {\n clearTimer(id);\n if (!animated) {\n removeNow(id);\n return;\n }\n if (exitTimeoutsRef.current.has(id)) return;\n setExiting((prev) => {\n const next = new Set(prev);\n next.add(id);\n return next;\n });\n const timeoutId = window.setTimeout(() => {\n exitTimeoutsRef.current.delete(id);\n removeNow(id);\n }, effectiveDuration);\n exitTimeoutsRef.current.set(id, timeoutId);\n },\n [clearTimer, animated, effectiveDuration, removeNow]\n );\n\n useEffect(() => {\n dismissRef.current = dismiss;\n }, [dismiss]);\n\n const startTimer = useCallback((id: string, duration: number) => {\n if (duration <= 0) return;\n const timeoutId = window.setTimeout(() => {\n dismissRef.current(id);\n }, duration);\n timersRef.current.set(id, {\n remaining: duration,\n startedAt: Date.now(),\n timeoutId,\n });\n }, []);\n\n const pauseTimer = useCallback((id: string) => {\n const entry = timersRef.current.get(id);\n if (!entry) return;\n const elapsed = Date.now() - entry.startedAt;\n const remaining = Math.max(0, entry.remaining - elapsed);\n window.clearTimeout(entry.timeoutId);\n timersRef.current.set(id, {\n remaining,\n startedAt: Date.now(),\n timeoutId: 0,\n });\n }, []);\n\n const resumeTimer = useCallback(\n (id: string) => {\n const entry = timersRef.current.get(id);\n if (!entry || entry.timeoutId !== 0) return;\n startTimer(id, entry.remaining);\n },\n [startTimer]\n );\n\n // Fire any registered onDismiss for `id` and clear all per-toast bookkeeping.\n // Used when a toast is replaced (same id re-issued) or evicted by limit\n // overflow — both are documented dismissal paths.\n const cleanupDroppedToast = useCallback(\n (id: string) => {\n clearTimer(id);\n const exitTimeoutId = exitTimeoutsRef.current.get(id);\n if (exitTimeoutId) {\n window.clearTimeout(exitTimeoutId);\n exitTimeoutsRef.current.delete(id);\n }\n setExiting((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n const cb = onDismissRef.current.get(id);\n onDismissRef.current.delete(id);\n cb?.();\n },\n [clearTimer]\n );\n\n const show = useCallback(\n (type: ToastType, options: ToastOptions): string => {\n const id = options.id ?? nextId();\n const duration = options.duration ?? DEFAULT_DURATIONS[type];\n const item: ToastQueueItem = {\n ...options,\n id,\n type,\n createdAt: Date.now(),\n };\n\n // If this id is currently exiting (replacement during exit animation),\n // cancel the pending exit so the new toast doesn't get marked exiting\n // and the old timeout doesn't remove it.\n const pendingExit = exitTimeoutsRef.current.get(id);\n if (pendingExit) {\n window.clearTimeout(pendingExit);\n exitTimeoutsRef.current.delete(id);\n setExiting((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n }\n\n // Manage the onDismiss slot atomically: replacing without a new\n // callback should not leave the previous one registered.\n if (options.onDismiss) {\n onDismissRef.current.set(id, options.onDismiss);\n } else {\n onDismissRef.current.delete(id);\n }\n\n setToasts((prev) => {\n const replaced = prev.filter((t) => t.id === id);\n const withoutDup = prev.filter((t) => t.id !== id);\n const next = [...withoutDup, item];\n const overflow =\n next.length > limit ? next.slice(0, next.length - limit) : [];\n\n // Replaced toasts: their onDismiss has already been overwritten\n // above, so just clear timers (no callback to fire).\n replaced.forEach((t) => {\n clearTimer(t.id);\n const ex = exitTimeoutsRef.current.get(t.id);\n if (ex) {\n window.clearTimeout(ex);\n exitTimeoutsRef.current.delete(t.id);\n }\n });\n\n // Overflow toasts: fire onDismiss and clean up.\n overflow.forEach((t) => {\n if (t.id === id) return; // never the freshly-added one\n cleanupDroppedToast(t.id);\n });\n\n return next.length > limit ? next.slice(next.length - limit) : next;\n });\n\n clearTimer(id);\n startTimer(id, duration);\n\n return id;\n },\n [clearTimer, startTimer, limit, cleanupDroppedToast]\n );\n\n const dismissAll = useCallback(() => {\n const ids = Array.from(timersRef.current.keys());\n ids.forEach((id) => dismiss(id));\n setToasts((prev) => {\n prev.forEach((t) => {\n if (!ids.includes(t.id)) dismiss(t.id);\n });\n return prev;\n });\n }, [dismiss]);\n\n const api = useMemo<ToastApi>(\n () => ({\n alert: (options) => show(\"alert\", options),\n success: (options) => show(\"success\", options),\n warning: (options) => show(\"warning\", options),\n info: (options) => show(\"info\", options),\n show,\n dismiss,\n dismissAll,\n }),\n [show, dismiss, dismissAll]\n );\n\n useEffect(\n () => () => {\n timersRef.current.forEach((entry) =>\n window.clearTimeout(entry.timeoutId)\n );\n timersRef.current.clear();\n exitTimeoutsRef.current.forEach((id) => window.clearTimeout(id));\n exitTimeoutsRef.current.clear();\n },\n []\n );\n\n const portalTarget =\n container ?? (typeof document !== \"undefined\" ? document.body : null);\n\n const isBottom = position.startsWith(\"bottom\");\n\n // Build the render list with frontIndex (0 = newest = front of stack).\n // toasts[] is oldest → newest. For default variant the visual order is:\n // top-*: newest first in DOM (so it appears at the top edge)\n // bottom-*: newest last in DOM (so it appears at the bottom edge)\n // For sonner the DOM order doesn't affect visual stacking (all absolute,\n // controlled by z-index), but for tab order we keep front-first in DOM.\n const orderedItems = (() => {\n if (isSonner) {\n // newest first\n return [...toasts].reverse().map((item, i) => ({ item, frontIndex: i }));\n }\n // default\n if (isBottom) {\n // newest last → frontIndex 0 is the last item\n return toasts.map((item, i) => ({\n item,\n frontIndex: toasts.length - 1 - i,\n }));\n }\n return [...toasts].reverse().map((item, i) => ({ item, frontIndex: i }));\n })();\n\n // Cumulative offset used by sonner-expanded layout: sum of heights of items\n // closer to the front (smaller frontIndex) plus gap.\n const offsetByFrontIndex = useMemo(() => {\n const map: Record<number, number> = { 0: 0 };\n let cumulative = 0;\n // Walk in front-first order.\n const sorted = [...orderedItems].sort(\n (a, b) => a.frontIndex - b.frontIndex\n );\n for (let i = 0; i < sorted.length; i++) {\n const fi = sorted[i].frontIndex;\n if (fi === 0) continue;\n const prev = sorted[i - 1];\n cumulative += (heights[prev.item.id] ?? 64) + SONNER_GAP;\n map[fi] = cumulative;\n }\n return map;\n }, [orderedItems, heights]);\n\n const expanded = isSonner && hoveredIds.size > 0;\n\n // For sonner: keep the viewport sized so it captures hover even when only\n // the front toast is visible.\n const frontHeight = (() => {\n const front = orderedItems.find((x) => x.frontIndex === 0);\n return front ? (heights[front.item.id] ?? 64) : 0;\n })();\n\n const sonnerExpandedHeight =\n frontHeight +\n orderedItems\n .filter((x) => x.frontIndex > 0)\n .reduce((sum, x) => sum + (heights[x.item.id] ?? 64) + SONNER_GAP, 0);\n\n return (\n <ToastContext.Provider value={{ api }}>\n {children}\n {portalTarget &&\n createPortal(\n <div\n data-toast-viewport=\"\"\n data-variant={variant}\n data-expanded={expanded ? \"\" : undefined}\n style={{\n position: \"fixed\",\n zIndex: 9999,\n pointerEvents: \"none\",\n maxWidth: \"calc(100vw - 32px)\",\n ...(isSonner\n ? {\n width: 440,\n height: expanded ? sonnerExpandedHeight : frontHeight,\n transition: animated\n ? `height ${effectiveDuration}ms cubic-bezier(0.16, 1, 0.3, 1)`\n : undefined,\n ...POSITION_STYLES[position],\n // override flex (we use absolute children in sonner mode)\n display: \"block\",\n }\n : {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n ...POSITION_STYLES[position],\n }),\n }}\n >\n {orderedItems.map(({ item, frontIndex }) => (\n <ToastItem\n key={item.id}\n item={item}\n position={position}\n variant={variant}\n animated={animated}\n animationDuration={effectiveDuration}\n exiting={exiting.has(item.id)}\n frontIndex={frontIndex}\n expanded={expanded}\n cumulativeOffset={offsetByFrontIndex[frontIndex] ?? 0}\n reportHeight={reportHeight}\n onClose={() => dismiss(item.id)}\n onPause={() => pauseTimer(item.id)}\n onResume={() => resumeTimer(item.id)}\n onHoverIn={(id) => {\n if (!isSonner) return;\n setHoveredIds((prev) => {\n if (prev.has(id)) return prev;\n const next = new Set(prev);\n next.add(id);\n return next;\n });\n }}\n onHoverOut={(id) => {\n if (!isSonner) return;\n setHoveredIds((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n }}\n />\n ))}\n </div>,\n portalTarget\n )}\n </ToastContext.Provider>\n );\n};\n\nToastProvider.displayName = \"ToastProvider\";\n\nexport const useToast = (): ToastApi => {\n const ctx = useContext(ToastContext);\n if (!ctx) {\n throw new Error(\"useToast must be used within a <ToastProvider />\");\n }\n return ctx.api;\n};\n"],"mappings":";AAAA,SAAgB,cAAc,sBAAsB;;;ACApD,OAAOA,YAAW;AAClB,OAAO,YAAY;;;ACDnB,OAAO,WAAW;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAA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I,IAAI,IAAI;AACzB,uBAAK,OAAO,EAAE;AACd,yBAAO;AAAA,gBACT,CAAC;AAAA,cACH;AAAA;AAAA,YA/BK,KAAK;AAAA,UAgCZ,CACD;AAAA;AAAA,MACH;AAAA,MACA;AAAA,IACF;AAAA,KACJ;AAEJ;AAEA,cAAc,cAAc;AAErB,IAAM,WAAW,MAAgB;AACtC,QAAM,MAAM,WAAW,YAAY;AACnC,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AACA,SAAO,IAAI;AACb;","names":["React","React","jsx","jsx","jsxs"]}
1
+ {"version":3,"sources":["../../src/Toast.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../src/ToastProvider.web.tsx"],"sourcesContent":["import React, { cloneElement, isValidElement } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, type ThemeOverrideProps } from \"@xsolla/xui-core\";\nimport {\n IconButton,\n type ButtonProps,\n type IconButtonProps,\n} from \"@xsolla/xui-button\";\nimport { Typography } from \"@xsolla/xui-typography\";\nimport { Remove } from \"@xsolla/xui-icons-base\";\n\nexport type ToastType = \"alert\" | \"success\" | \"warning\" | \"info\";\n\nexport type ToastActionElement = React.ReactElement<\n ButtonProps | IconButtonProps\n>;\n\nexport interface ToastProps extends ThemeOverrideProps {\n /** Visual variant/tone of the toast */\n type?: ToastType;\n /** Title text (required for accessibility) */\n title?: string;\n /** Optional description text shown beneath the title */\n description?: string;\n /**\n * Action element (Button/IconButton). The toast will inject\n * `size=\"xs\"`, `variant=\"tertiary\"`, and a tone matching the toast type.\n */\n action?: React.ReactElement;\n /** Show/hide close button */\n showCloseButton?: boolean;\n /** Close button click handler */\n onClose?: () => void;\n /** Test ID for testing frameworks */\n testID?: string;\n}\n\nconst TYPE_TO_BUTTON_TONE: Record<\n ToastType,\n \"alert\" | \"brandExtra\" | \"brand\" | \"mono\"\n> = {\n alert: \"alert\",\n success: \"brandExtra\",\n warning: \"mono\",\n info: \"brand\",\n};\n\nexport const Toast: React.FC<ToastProps> = ({\n type = \"info\",\n title,\n description,\n action,\n showCloseButton = true,\n onClose,\n testID,\n themeMode,\n themeProductContext,\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const config = theme.sizing.toast();\n\n const stripeColor: Record<ToastType, string> = {\n alert: theme.colors.content.alert.primary,\n success: theme.colors.content.success.secondary,\n warning: theme.colors.content.warning.secondary,\n info: theme.colors.content.brand.secondary,\n };\n\n const hasActions = Boolean(action) || showCloseButton;\n\n return (\n <Box\n backgroundColor={theme.colors.background.primary}\n borderRadius={config.borderRadius}\n flexDirection=\"row\"\n alignItems=\"stretch\"\n overflow=\"hidden\"\n width={440}\n style={{ boxShadow: theme.shadow.surface }}\n testID={testID}\n role={type === \"alert\" ? \"alert\" : \"status\"}\n aria-live={type === \"alert\" ? \"assertive\" : \"polite\"}\n aria-label={`${type} toast`}\n >\n {/* Colored left stripe */}\n <Box backgroundColor={stripeColor[type]} width={4} alignSelf=\"stretch\" />\n\n {/* Body */}\n <Box\n flex={1}\n flexDirection=\"row\"\n alignItems=\"center\"\n paddingHorizontal={16}\n paddingVertical={12}\n gap={16}\n >\n {/* Text */}\n <Box flex={1} gap={2}>\n {title && (\n <Typography\n variant=\"bodyMdAccent\"\n color={theme.colors.content.primary}\n >\n {title}\n </Typography>\n )}\n {description && (\n <Typography variant=\"bodySm\" color={theme.colors.content.tertiary}>\n {description}\n </Typography>\n )}\n </Box>\n\n {/* Actions */}\n {hasActions && (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n alignSelf=\"stretch\"\n gap={config.groupGap ?? 4}\n >\n {isValidElement(action) &&\n cloneElement(action as ToastActionElement, {\n size: \"xs\",\n variant: \"tertiary\",\n tone: TYPE_TO_BUTTON_TONE[type],\n })}\n\n {action && showCloseButton && (\n <Box\n width={1}\n alignSelf=\"stretch\"\n backgroundColor={theme.colors.border.secondary}\n />\n )}\n\n {showCloseButton && (\n <IconButton\n variant=\"tertiary\"\n tone=\"mono\"\n size=\"xs\"\n onPress={onClose}\n aria-label=\"Close toast\"\n icon={<Remove size={18} />}\n hoverBackground=\"none\"\n />\n )}\n </Box>\n )}\n </Box>\n </Box>\n );\n};\n\nToast.displayName = \"Toast\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import React, {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Toast, type ToastProps, type ToastType } from \"./Toast\";\n\nexport type ToastPosition =\n | \"top-right\"\n | \"top-left\"\n | \"top-center\"\n | \"bottom-right\"\n | \"bottom-left\"\n | \"bottom-center\";\n\nexport type ToastVariant = \"default\" | \"sonner\";\n\nexport interface ToastOptions extends Omit<\n ToastProps,\n \"type\" | \"onClose\" | \"testID\"\n> {\n /**\n * Auto-dismiss duration in ms. Pass 0 to disable auto-dismiss.\n * Defaults derived from `type`: success 4500, info/warning 6500, alert 9000.\n */\n duration?: number;\n /** Stable id — if provided and a toast with that id already exists, it's replaced. */\n id?: string;\n /** Called when the toast is dismissed (auto or manual). */\n onDismiss?: () => void;\n}\n\nexport interface ToastQueueItem extends ToastOptions {\n id: string;\n type: ToastType;\n createdAt: number;\n}\n\nexport interface ToastApi {\n alert: (options: ToastOptions) => string;\n success: (options: ToastOptions) => string;\n warning: (options: ToastOptions) => string;\n info: (options: ToastOptions) => string;\n show: (type: ToastType, options: ToastOptions) => string;\n dismiss: (id: string) => void;\n dismissAll: () => void;\n}\n\ninterface ToastContextValue {\n api: ToastApi;\n}\n\nconst ToastContext = createContext<ToastContextValue | null>(null);\n\nconst DEFAULT_DURATIONS: Record<ToastType, number> = {\n success: 4500,\n info: 6500,\n warning: 6500,\n alert: 9000,\n};\n\nconst POSITION_STYLES: Record<ToastPosition, React.CSSProperties> = {\n \"top-right\": { top: 16, right: 16, alignItems: \"flex-end\" },\n \"top-left\": { top: 16, left: 16, alignItems: \"flex-start\" },\n \"top-center\": {\n top: 16,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n alignItems: \"center\",\n },\n \"bottom-right\": { bottom: 16, right: 16, alignItems: \"flex-end\" },\n \"bottom-left\": { bottom: 16, left: 16, alignItems: \"flex-start\" },\n \"bottom-center\": {\n bottom: 16,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n alignItems: \"center\",\n },\n};\n\nexport interface ToastProviderProps {\n children: React.ReactNode;\n /** Where toasts appear on screen. Defaults to top-right. */\n position?: ToastPosition;\n /** Maximum number of simultaneously visible toasts. Defaults to 3. */\n limit?: number;\n /** DOM node to portal the viewport into. Defaults to document.body. */\n container?: HTMLElement | null;\n /**\n * Enable enter & exit animations. Defaults to `true`.\n * When `false`, toasts appear and disappear instantly.\n */\n animated?: boolean;\n /** Animation duration in ms. Defaults to 220 (default variant) / 400 (sonner). */\n animationDuration?: number;\n /**\n * Visual variant.\n * - `\"default\"` — toasts slide in from the edge and stack vertically.\n * - `\"sonner\"` — shadcn/sonner-style stacked-cards: toasts overlap as a deck\n * with back cards scaled & peeking; hovering the stack expands it.\n */\n variant?: ToastVariant;\n}\n\n// Off-screen transform used as the enter start / exit end state, derived\n// from the viewport position (slides in from the closest edge).\nconst enterTransform = (position: ToastPosition): string => {\n if (position.endsWith(\"right\")) return \"translateX(110%)\";\n if (position.endsWith(\"left\")) return \"translateX(-110%)\";\n return position.startsWith(\"top\") ? \"translateY(-110%)\" : \"translateY(110%)\";\n};\n\n// CSS to anchor an absolutely-positioned sonner item to the viewport corner.\nconst SONNER_ANCHOR: Record<ToastPosition, React.CSSProperties> = {\n \"top-right\": { top: 0, right: 0 },\n \"top-left\": { top: 0, left: 0 },\n \"top-center\": { top: 0, left: \"50%\", marginLeft: -220 },\n \"bottom-right\": { bottom: 0, right: 0 },\n \"bottom-left\": { bottom: 0, left: 0 },\n \"bottom-center\": { bottom: 0, left: \"50%\", marginLeft: -220 },\n};\n\nconst SONNER_GAP = 8;\nconst SONNER_PEEK = 6;\nconst SONNER_SCALE_STEP = 0.06;\nconst MAX_VISIBLE_BACK = 2; // beyond this index, toasts fade to zero\n\ninterface ToastItemProps {\n item: ToastQueueItem;\n position: ToastPosition;\n variant: ToastVariant;\n animated: boolean;\n animationDuration: number;\n exiting: boolean;\n // Sonner-specific\n frontIndex: number;\n expanded: boolean;\n cumulativeOffset: number;\n reportHeight: (id: string, h: number) => void;\n // Common\n onClose: () => void;\n onPause: () => void;\n onResume: () => void;\n onHoverIn: (id: string) => void;\n onHoverOut: (id: string) => void;\n}\n\nconst ToastItem: React.FC<ToastItemProps> = ({\n item,\n position,\n variant,\n animated,\n animationDuration,\n exiting,\n frontIndex,\n expanded,\n cumulativeOffset,\n reportHeight,\n onClose,\n onPause,\n onResume,\n onHoverIn,\n onHoverOut,\n}) => {\n const [entered, setEntered] = useState(!animated);\n const ref = useRef<HTMLDivElement | null>(null);\n const hoveredRef = useRef(false);\n\n useEffect(() => {\n if (!animated) return;\n let raf2 = 0;\n const raf1 = window.requestAnimationFrame(() => {\n raf2 = window.requestAnimationFrame(() => setEntered(true));\n });\n return () => {\n window.cancelAnimationFrame(raf1);\n window.cancelAnimationFrame(raf2);\n };\n }, [animated]);\n\n // Guarantee hover state is cleaned up if the item unmounts while hovered\n // (mouseLeave doesn't fire on disappearing elements).\n useEffect(\n () => () => {\n if (hoveredRef.current) {\n hoveredRef.current = false;\n onHoverOut(item.id);\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n );\n\n // Measure height for sonner stacking math.\n useLayoutEffect(() => {\n if (variant !== \"sonner\" || !ref.current) return;\n const el = ref.current;\n const report = () =>\n reportHeight(item.id, el.getBoundingClientRect().height);\n report();\n if (typeof ResizeObserver === \"undefined\") return;\n const ro = new ResizeObserver(report);\n ro.observe(el);\n return () => ro.disconnect();\n }, [variant, item.id, reportHeight]);\n\n const isSonner = variant === \"sonner\";\n const isBottom = position.startsWith(\"bottom\");\n const isCenter = position.endsWith(\"center\");\n const dir = isBottom ? -1 : 1; // direction items move to \"stack back\"\n\n let transform: string;\n let opacity = 1;\n let zIndex = 1000 - frontIndex;\n\n const offTransform = enterTransform(position);\n const showOff = animated && (!entered || exiting);\n\n if (isSonner) {\n // Horizontal centering baseline for *-center positions\n const xBase = \"\"; // marginLeft handles centering for sonner-anchored items\n\n if (showOff) {\n transform = `${xBase} ${offTransform}`.trim();\n opacity = 0;\n } else if (frontIndex === 0) {\n transform = `${xBase} translateY(0) scale(1)`;\n } else if (expanded) {\n // Spread out using measured cumulative offsets\n transform = `${xBase} translateY(${dir * cumulativeOffset}px) scale(1)`;\n } else {\n // Collapsed stack: peek behind front, scaled down\n const peek = SONNER_PEEK * frontIndex;\n const scale = Math.max(0.7, 1 - SONNER_SCALE_STEP * frontIndex);\n transform = `${xBase} translateY(${dir * peek}px) scale(${scale})`;\n if (frontIndex > MAX_VISIBLE_BACK) opacity = 0;\n }\n } else {\n // Default variant: simple slide-in / slide-out\n transform = showOff ? offTransform : \"translateX(0) translateY(0)\";\n opacity = showOff ? 0 : 1;\n }\n\n const style: React.CSSProperties = {\n pointerEvents: opacity === 0 ? \"none\" : \"auto\",\n transform,\n opacity,\n zIndex,\n transition: animated\n ? `transform ${animationDuration}ms cubic-bezier(0.16, 1, 0.3, 1), opacity ${animationDuration}ms ease`\n : undefined,\n willChange: animated ? \"transform, opacity\" : undefined,\n transformOrigin: isSonner\n ? isCenter\n ? isBottom\n ? \"bottom center\"\n : \"top center\"\n : isBottom\n ? `bottom ${position.endsWith(\"right\") ? \"right\" : \"left\"}`\n : `top ${position.endsWith(\"right\") ? \"right\" : \"left\"}`\n : undefined,\n ...(isSonner\n ? {\n position: \"absolute\" as const,\n width: 440,\n ...SONNER_ANCHOR[position],\n }\n : null),\n };\n\n return (\n <div\n ref={ref}\n style={style}\n onMouseEnter={() => {\n onPause();\n if (!hoveredRef.current) {\n hoveredRef.current = true;\n onHoverIn(item.id);\n }\n }}\n onMouseLeave={() => {\n onResume();\n if (hoveredRef.current) {\n hoveredRef.current = false;\n onHoverOut(item.id);\n }\n }}\n // Ignore focus moves between descendants (e.g. action → close button) —\n // those are still inside the toast and shouldn't toggle the timer.\n onFocus={(e) => {\n if (e.currentTarget.contains(e.relatedTarget as Node | null)) return;\n onPause();\n if (!hoveredRef.current) {\n hoveredRef.current = true;\n onHoverIn(item.id);\n }\n }}\n onBlur={(e) => {\n if (e.currentTarget.contains(e.relatedTarget as Node | null)) return;\n onResume();\n if (hoveredRef.current) {\n hoveredRef.current = false;\n onHoverOut(item.id);\n }\n }}\n >\n <Toast\n type={item.type}\n title={item.title}\n description={item.description}\n action={item.action}\n showCloseButton={item.showCloseButton}\n onClose={onClose}\n themeMode={item.themeMode}\n themeProductContext={item.themeProductContext}\n />\n </div>\n );\n};\n\nlet idCounter = 0;\nconst nextId = () => `toast-${Date.now()}-${++idCounter}`;\n\nexport const ToastProvider: React.FC<ToastProviderProps> = ({\n children,\n position = \"top-right\",\n limit = 3,\n container,\n animated = true,\n animationDuration,\n variant = \"default\",\n}) => {\n const isSonner = variant === \"sonner\";\n const effectiveDuration = animationDuration ?? (isSonner ? 400 : 220);\n\n const [toasts, setToasts] = useState<ToastQueueItem[]>([]);\n const [exiting, setExiting] = useState<Set<string>>(() => new Set());\n const [heights, setHeights] = useState<Record<string, number>>({});\n const [hoveredIds, setHoveredIds] = useState<Set<string>>(() => new Set());\n const exitTimeoutsRef = useRef<Map<string, number>>(new Map());\n const timersRef = useRef<\n Map<string, { remaining: number; startedAt: number; timeoutId: number }>\n >(new Map());\n const onDismissRef = useRef<Map<string, () => void>>(new Map());\n const dismissRef = useRef<(id: string) => void>(() => {});\n\n const reportHeight = useCallback((id: string, h: number) => {\n setHeights((prev) => (prev[id] === h ? prev : { ...prev, [id]: h }));\n }, []);\n\n const clearTimer = useCallback((id: string) => {\n const entry = timersRef.current.get(id);\n if (entry) {\n window.clearTimeout(entry.timeoutId);\n timersRef.current.delete(id);\n }\n }, []);\n\n const removeNow = useCallback((id: string) => {\n const cb = onDismissRef.current.get(id);\n onDismissRef.current.delete(id);\n setToasts((prev) => prev.filter((t) => t.id !== id));\n setExiting((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n setHeights((prev) => {\n if (!(id in prev)) return prev;\n const next = { ...prev };\n delete next[id];\n return next;\n });\n setHoveredIds((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n cb?.();\n }, []);\n\n const dismiss = useCallback(\n (id: string) => {\n clearTimer(id);\n if (!animated) {\n removeNow(id);\n return;\n }\n if (exitTimeoutsRef.current.has(id)) return;\n setExiting((prev) => {\n const next = new Set(prev);\n next.add(id);\n return next;\n });\n const timeoutId = window.setTimeout(() => {\n exitTimeoutsRef.current.delete(id);\n removeNow(id);\n }, effectiveDuration);\n exitTimeoutsRef.current.set(id, timeoutId);\n },\n [clearTimer, animated, effectiveDuration, removeNow]\n );\n\n useEffect(() => {\n dismissRef.current = dismiss;\n }, [dismiss]);\n\n const startTimer = useCallback((id: string, duration: number) => {\n if (duration <= 0) return;\n const timeoutId = window.setTimeout(() => {\n dismissRef.current(id);\n }, duration);\n timersRef.current.set(id, {\n remaining: duration,\n startedAt: Date.now(),\n timeoutId,\n });\n }, []);\n\n const pauseTimer = useCallback((id: string) => {\n const entry = timersRef.current.get(id);\n if (!entry) return;\n const elapsed = Date.now() - entry.startedAt;\n const remaining = Math.max(0, entry.remaining - elapsed);\n window.clearTimeout(entry.timeoutId);\n timersRef.current.set(id, {\n remaining,\n startedAt: Date.now(),\n timeoutId: 0,\n });\n }, []);\n\n const resumeTimer = useCallback(\n (id: string) => {\n const entry = timersRef.current.get(id);\n if (!entry || entry.timeoutId !== 0) return;\n startTimer(id, entry.remaining);\n },\n [startTimer]\n );\n\n // Fire any registered onDismiss for `id` and clear all per-toast bookkeeping.\n // Used when a toast is replaced (same id re-issued) or evicted by limit\n // overflow — both are documented dismissal paths.\n const cleanupDroppedToast = useCallback(\n (id: string) => {\n clearTimer(id);\n const exitTimeoutId = exitTimeoutsRef.current.get(id);\n if (exitTimeoutId) {\n window.clearTimeout(exitTimeoutId);\n exitTimeoutsRef.current.delete(id);\n }\n setExiting((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n const cb = onDismissRef.current.get(id);\n onDismissRef.current.delete(id);\n cb?.();\n },\n [clearTimer]\n );\n\n const show = useCallback(\n (type: ToastType, options: ToastOptions): string => {\n const id = options.id ?? nextId();\n const duration = options.duration ?? DEFAULT_DURATIONS[type];\n const item: ToastQueueItem = {\n ...options,\n id,\n type,\n createdAt: Date.now(),\n };\n\n // If this id is currently exiting (replacement during exit animation),\n // cancel the pending exit so the new toast doesn't get marked exiting\n // and the old timeout doesn't remove it.\n const pendingExit = exitTimeoutsRef.current.get(id);\n if (pendingExit) {\n window.clearTimeout(pendingExit);\n exitTimeoutsRef.current.delete(id);\n setExiting((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n }\n\n // Manage the onDismiss slot atomically: replacing without a new\n // callback should not leave the previous one registered.\n if (options.onDismiss) {\n onDismissRef.current.set(id, options.onDismiss);\n } else {\n onDismissRef.current.delete(id);\n }\n\n setToasts((prev) => {\n const replaced = prev.filter((t) => t.id === id);\n const withoutDup = prev.filter((t) => t.id !== id);\n const next = [...withoutDup, item];\n const overflow =\n next.length > limit ? next.slice(0, next.length - limit) : [];\n\n // Replaced toasts: their onDismiss has already been overwritten\n // above, so just clear timers (no callback to fire).\n replaced.forEach((t) => {\n clearTimer(t.id);\n const ex = exitTimeoutsRef.current.get(t.id);\n if (ex) {\n window.clearTimeout(ex);\n exitTimeoutsRef.current.delete(t.id);\n }\n });\n\n // Overflow toasts: fire onDismiss and clean up.\n overflow.forEach((t) => {\n if (t.id === id) return; // never the freshly-added one\n cleanupDroppedToast(t.id);\n });\n\n return next.length > limit ? next.slice(next.length - limit) : next;\n });\n\n clearTimer(id);\n startTimer(id, duration);\n\n return id;\n },\n [clearTimer, startTimer, limit, cleanupDroppedToast]\n );\n\n const dismissAll = useCallback(() => {\n const ids = Array.from(timersRef.current.keys());\n ids.forEach((id) => dismiss(id));\n setToasts((prev) => {\n prev.forEach((t) => {\n if (!ids.includes(t.id)) dismiss(t.id);\n });\n return prev;\n });\n }, [dismiss]);\n\n const api = useMemo<ToastApi>(\n () => ({\n alert: (options) => show(\"alert\", options),\n success: (options) => show(\"success\", options),\n warning: (options) => show(\"warning\", options),\n info: (options) => show(\"info\", options),\n show,\n dismiss,\n dismissAll,\n }),\n [show, dismiss, dismissAll]\n );\n\n useEffect(\n () => () => {\n timersRef.current.forEach((entry) =>\n window.clearTimeout(entry.timeoutId)\n );\n timersRef.current.clear();\n exitTimeoutsRef.current.forEach((id) => window.clearTimeout(id));\n exitTimeoutsRef.current.clear();\n },\n []\n );\n\n const portalTarget =\n container ?? (typeof document !== \"undefined\" ? document.body : null);\n\n const isBottom = position.startsWith(\"bottom\");\n\n // Build the render list with frontIndex (0 = newest = front of stack).\n // toasts[] is oldest → newest. For default variant the visual order is:\n // top-*: newest first in DOM (so it appears at the top edge)\n // bottom-*: newest last in DOM (so it appears at the bottom edge)\n // For sonner the DOM order doesn't affect visual stacking (all absolute,\n // controlled by z-index), but for tab order we keep front-first in DOM.\n const orderedItems = (() => {\n if (isSonner) {\n // newest first\n return [...toasts].reverse().map((item, i) => ({ item, frontIndex: i }));\n }\n // default\n if (isBottom) {\n // newest last → frontIndex 0 is the last item\n return toasts.map((item, i) => ({\n item,\n frontIndex: toasts.length - 1 - i,\n }));\n }\n return [...toasts].reverse().map((item, i) => ({ item, frontIndex: i }));\n })();\n\n // Cumulative offset used by sonner-expanded layout: sum of heights of items\n // closer to the front (smaller frontIndex) plus gap.\n const offsetByFrontIndex = useMemo(() => {\n const map: Record<number, number> = { 0: 0 };\n let cumulative = 0;\n // Walk in front-first order.\n const sorted = [...orderedItems].sort(\n (a, b) => a.frontIndex - b.frontIndex\n );\n for (let i = 0; i < sorted.length; i++) {\n const fi = sorted[i].frontIndex;\n if (fi === 0) continue;\n const prev = sorted[i - 1];\n cumulative += (heights[prev.item.id] ?? 64) + SONNER_GAP;\n map[fi] = cumulative;\n }\n return map;\n }, [orderedItems, heights]);\n\n const expanded = isSonner && hoveredIds.size > 0;\n\n // For sonner: keep the viewport sized so it captures hover even when only\n // the front toast is visible.\n const frontHeight = (() => {\n const front = orderedItems.find((x) => x.frontIndex === 0);\n return front ? (heights[front.item.id] ?? 64) : 0;\n })();\n\n const sonnerExpandedHeight =\n frontHeight +\n orderedItems\n .filter((x) => x.frontIndex > 0)\n .reduce((sum, x) => sum + (heights[x.item.id] ?? 64) + SONNER_GAP, 0);\n\n return (\n <ToastContext.Provider value={{ api }}>\n {children}\n {portalTarget &&\n createPortal(\n <div\n data-toast-viewport=\"\"\n data-variant={variant}\n data-expanded={expanded ? \"\" : undefined}\n style={{\n position: \"fixed\",\n zIndex: 9999,\n pointerEvents: \"none\",\n maxWidth: \"calc(100vw - 32px)\",\n ...(isSonner\n ? {\n width: 440,\n height: expanded ? sonnerExpandedHeight : frontHeight,\n transition: animated\n ? `height ${effectiveDuration}ms cubic-bezier(0.16, 1, 0.3, 1)`\n : undefined,\n ...POSITION_STYLES[position],\n // override flex (we use absolute children in sonner mode)\n display: \"block\",\n }\n : {\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n ...POSITION_STYLES[position],\n }),\n }}\n >\n {orderedItems.map(({ item, frontIndex }) => (\n <ToastItem\n key={item.id}\n item={item}\n position={position}\n variant={variant}\n animated={animated}\n animationDuration={effectiveDuration}\n exiting={exiting.has(item.id)}\n frontIndex={frontIndex}\n expanded={expanded}\n cumulativeOffset={offsetByFrontIndex[frontIndex] ?? 0}\n reportHeight={reportHeight}\n onClose={() => dismiss(item.id)}\n onPause={() => pauseTimer(item.id)}\n onResume={() => resumeTimer(item.id)}\n onHoverIn={(id) => {\n if (!isSonner) return;\n setHoveredIds((prev) => {\n if (prev.has(id)) return prev;\n const next = new Set(prev);\n next.add(id);\n return next;\n });\n }}\n onHoverOut={(id) => {\n if (!isSonner) return;\n setHoveredIds((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n }}\n />\n ))}\n </div>,\n portalTarget\n )}\n </ToastContext.Provider>\n );\n};\n\nToastProvider.displayName = \"ToastProvider\";\n\nexport const useToast = (): ToastApi => {\n const ctx = useContext(ToastContext);\n if (!ctx) {\n throw new Error(\"useToast must be used within a <ToastProvider />\");\n }\n return ctx.api;\n};\n"],"mappings":";AAAA,SAAgB,cAAc,sBAAsB;;;ACApD,OAAOA,YAAW;AAClB,OAAO,YAAY;;;ACDnB,OAAO,WAAW;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM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