From a5f184d8e3de830f6615f259f8159120b5f8a688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Wed, 15 Jul 2026 13:26:44 +0200 Subject: [PATCH] Add stories for Dialog and Toaster MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cover the new v2 kit primitives in Storybook: the Dialog (uncontrolled trigger, controlled open state, and skeleton) and the Toaster (title-only toasts as the common case, plus a title+description variant). Signed-off-by: Émile Ré --- packages/ui/src/v2/Dialog/Dialog.stories.tsx | 106 +++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 packages/ui/src/v2/Dialog/Dialog.stories.tsx diff --git a/packages/ui/src/v2/Dialog/Dialog.stories.tsx b/packages/ui/src/v2/Dialog/Dialog.stories.tsx new file mode 100644 index 000000000..2f615a365 --- /dev/null +++ b/packages/ui/src/v2/Dialog/Dialog.stories.tsx @@ -0,0 +1,106 @@ +// Copyright (c) 2026 Probo Inc . +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +import { useState } from "react"; + +import { Button } from "../Button/Button"; +import { Text } from "../typography/Text"; + +import { Dialog } from "./Dialog"; +import { DialogBody } from "./DialogBody"; +import { DialogClose } from "./DialogClose"; +import { DialogDescription } from "./DialogDescription"; +import { DialogFooter } from "./DialogFooter"; +import { DialogHeader } from "./DialogHeader"; +import { DialogPopup } from "./DialogPopup"; +import { DialogSkeleton } from "./DialogSkeleton"; +import { DialogTitle } from "./DialogTitle"; +import { DialogTrigger } from "./DialogTrigger"; + +export default { + title: "v2/Dialog", + component: Dialog, +}; + +export function Default() { + return ( + + Open dialog} /> + + + Sign in to continue + + Access protected resources or submit a request. + + + + + Dialog body content lives here — a form, a message, or any other + slot the surrounding page composes. + + + + Cancel} /> + Confirm} /> + + + + ); +} + +export function Controlled() { + const [open, setOpen] = useState(false); + + return ( +
+ + {open ? "open" : "closed"} + + + + + Delete third party + + This action cannot be undone. + + + + + + + + +
+ ); +} + +export function Skeleton() { + return ( +
+ +
+ ); +}