diff --git a/packages/web-react/src/components/Toast/stories/UncontrolledToast.stories.tsx b/packages/web-react/src/components/Toast/stories/UncontrolledToast.stories.tsx index 5efd7795bd..724f56d498 100644 --- a/packages/web-react/src/components/Toast/stories/UncontrolledToast.stories.tsx +++ b/packages/web-react/src/components/Toast/stories/UncontrolledToast.stories.tsx @@ -1,19 +1,22 @@ -import React from 'react'; import { Markdown } from '@storybook/blocks'; import type { Meta, StoryObj } from '@storybook/react'; +import React from 'react'; -import { ToastColorType, UncontrolledToastProps } from '../../../types'; +import { ToastProvider, UncontrolledToast } from '..'; import { AlignmentX, EmotionColors } from '../../../constants'; +import { ToastColorType, UncontrolledToastProps } from '../../../types'; import { Button } from '../../Button'; import ReadMe from '../README.md'; +import { TOAST_AUTOCLOSE_TIMEOUT } from '../constants'; import { useToast } from '../useToast'; -import { ToastProvider, UncontrolledToast } from '..'; interface UncontrolledToastPlaygroundProps extends UncontrolledToastProps { color: ToastColorType; hasIcon: boolean; isDismissible: boolean; iconName: string; + enableAutoClose: boolean; + autoCloseInterval: number; } const meta: Meta = { @@ -64,6 +67,12 @@ const meta: Meta = { isCollapsible: { control: 'boolean', }, + enableAutoClose: { + control: 'boolean', + }, + autoCloseInterval: { + control: 'number', + }, }, args: { children: 'Hello, World!', @@ -75,6 +84,8 @@ const meta: Meta = { color: 'inverted', iconName: '', isCollapsible: true, + enableAutoClose: true, + autoCloseInterval: TOAST_AUTOCLOSE_TIMEOUT, }, }; @@ -87,15 +98,26 @@ const ShowButton = (props: { hasIcon: boolean; isDismissible: boolean; iconName: string; + enableAutoClose: boolean; + autoCloseInterval: number; }) => { - const { text, color, hasIcon, isDismissible, iconName } = props; + const { text, color, hasIcon, isDismissible, iconName, enableAutoClose, autoCloseInterval } = props; const { show, clear } = useToast(); return ( <>