import { Text } from "../text"; import { iconButtonSizes, iconButtonVariants } from "../icon-button/icon-button.styled"; import { IconButton } from "../icon-button"; import { Icons } from "../icons"; import { Box } from "../box"; import { Input } from "../input"; import { Dialog } from "."; import type { Meta, StoryObj } from "@storybook/react"; /** * Dialog is a modal component that renders a trigger and content. The content is rendered in a portal and is hidden * by default. When the trigger is clicked, the content is shown. */ const meta: Meta = { title: "Dialog", component: Dialog, tags: ["autodocs"], argTypes: { side: { options: ["center", "left", "right", "topCenter", "bottomCenter"], }, closeButtonVariant: { options: Object.keys(iconButtonVariants), }, closeButtonSize: { options: Object.keys(iconButtonSizes), }, closeProps: { table: { category: "Anatomy Props", }, }, contentProps: { table: { category: "Anatomy Props", }, }, descriptionProps: { table: { category: "Anatomy Props", }, }, overlayProps: { table: { category: "Anatomy Props", }, }, portalProps: { table: { category: "Anatomy Props", }, }, rootProps: { table: { category: "Anatomy Props", }, }, titleProps: { table: { category: "Anatomy Props", }, }, titleTextProps: { table: { category: "Anatomy Props", }, }, triggerProps: { table: { category: "Anatomy Props", }, }, }, args: { trigger: Open dialog, title: "Dialog Title", showCloseButton: true, }, }; export default meta; type Story = StoryObj; export const Default: Story = { render: (args) => ( Lorem Ipsum is simply dummy text of the printing and typesetting industry. ), }; export const WithStartItem: Story = { render: (args) => ( } variant="ghost" />}> Lorem Ipsum is simply dummy text of the printing and typesetting industry. ), }; /** * The visual container i.e the `StyledContainer` has `transform` applied to it. This can be a problem when children is rendered with `position: fixed` as they will be rendered relative the container rather than the viewport as expected. * `nonTransformedContet` is content that is rendered as a sibling to the visual container and is thus not transformed. * * This can be useful if you want to render a `ToastViewport` inside the Dialog. Keep in mind that the overlay, if enabled, is rendered in a stacking context. */ export const WithNonTransformedContent: Story = { render: (args) => ( Lorem Ipsum is simply dummy text of the printing and typesetting industry. ), args: { nonTransformedContent: ( Non transformed content ), }, }; /** * This is a little playground for bug hunting. */ export const BugsPlayground: Story = { render: (args) => ( <>