import { expect, fn, screen, userEvent, waitFor, within } from "storybook/test"; import type { Meta, StoryObj } from "@storybook/react-vite"; import { WarningRegularIcon } from "alouette-icons/phosphor-icons/Warning"; import { type ReactElement, type ReactNode, useState } from "react"; import { Button } from "../actions/Button"; import { DecisionBar } from "../actions/DecisionBar"; import { Paragraph } from "../primitives/Text"; import { Story, accentsWithoutNeutral } from "../story-components/Story"; import { StoryGrid } from "../story-components/StoryGrid"; import { AccentScope } from "./AccentScope"; import { Modal, ModalPanel, type ModalProps } from "./Modal"; type ThisStory = StoryObj; // Stateful demo wrapper: a trigger button that opens the modal and manages the // open/close state, forwarding the props under test. interface ModalDemoProps extends Omit { triggerLabel?: string; onClose?: () => void; } function ModalDemo({ triggerLabel = "Open modal", onClose, ...props }: ModalDemoProps): ReactNode { const [visible, setVisible] = useState(false); return ( <>