import { Meta, StoryObj } from "@storybook/react"; import { Modal } from "."; import { IconButton } from "../../Buttons/IconButton"; import { Button } from "../../Buttons/Button"; import { MaterialIcon } from "../../Icons/MaterialIcon"; import { OverlayTrigger } from "../OverlayTrigger"; import { Text } from "@components/Typography/Text"; import { DimensionsArgTypes, OverflowArgTypes, OverlayTriggerArgTypes, PositionArgTypes, RenderPropsArgTypes, SpacingArgTypes, } from "@sb/helpers"; const meta: Meta = { title: "Overlays/Modals/Modal", component: Modal, parameters: { docs: { story: { inline: false, height: "400px", }, }, }, argTypes: { ...RenderPropsArgTypes, ...SpacingArgTypes, ...DimensionsArgTypes, ...PositionArgTypes, ...OverflowArgTypes, ...OverlayTriggerArgTypes, }, }; export default meta; type Story = StoryObj; // NOTE: rendering these stories inline causes the code display to break, so we // provide the source manually. Ideally this would be fixed in the future. In the meantime // we can use the `parameters.docs.source` to provide the source code manually. Make sure // to update the source code if the component changes. export const Primary: Story = { args: { isOpen: true, children: [ Title , This is the content of the modal , , ], }, }; export const WithOverlayTrigger: Story = { render: (args) => { return ( {(close) => ( <> Modal Title Modal Body )} ); }, parameters: { docs: { source: { language: "jsx", code: ` {(close) => ( <> Modal Title Modal Body )} `, }, }, }, }; export const PopupModal: Story = { args: { ...Primary.args, $width: "400px", children: ( <> Your Download is Ready! Your download is ready! Click the button below to download your file. ), }, }; export const WithCustomContent: Story = { args: { ...Primary.args, children: ( You are able to put whatever content you'd like into the modal, the helper components are there for the common use cases. ), }, };