import React, { useState } from 'react' import { type Meta, type StoryObj } from '@storybook/react' import { fn } from '@storybook/test' import isChromatic from 'chromatic' import { AddImage } from '~components/Illustration' import { ModalAccessibleDescription } from '~components/Modal/GenericModal/subcomponents/ModalAccessibleDescription' import { Text } from '~components/Text' import { chromaticModalSettings } from '../../_docs/controls' import { ContextModal } from '../index' const IS_CHROMATIC = isChromatic() const meta = { title: 'Components/Modals/ContextModal', component: ContextModal, args: { isOpen: false, title: 'Context modal title', children: undefined, onDismiss: fn(), }, argTypes: { children: { control: { disable: true, }, }, }, } satisfies Meta export default meta type Story = StoryObj const ContextModalTemplate: Story = { render: (args) => { const [isOpen, setIsOpen] = useState(IS_CHROMATIC) const handleOpen = (): void => setIsOpen(true) const handleClose = (): void => setIsOpen(false) return ( <> } > Intro defining what the modal is trying to explain or depict. Intro defining what the modal is trying to explain or depict.
  • Key point to the benefits of the feature
  • Key point to the benefits of the feature
  • Key point to the benefits of the feature
More information to conclude can go here. More information to conclude can go here. More information to conclude can go here.
) }, } export const Playground: Story = { ...ContextModalTemplate, parameters: { docs: { canvas: { sourceState: 'shown', }, }, }, } export const Portrait: Story = { ...ContextModalTemplate, args: { layout: 'portrait' }, ...chromaticModalSettings, } export const Landscape: Story = { ...ContextModalTemplate, args: { layout: 'landscape' }, ...chromaticModalSettings, } export const Unpadded: Story = { ...ContextModalTemplate, args: { unpadded: true }, ...chromaticModalSettings, }