import { Dialog as KobalteDialog } from "@kobalte/core/dialog" import { Dialog, DialogBody, DialogFooter, DialogHeader, DialogTitle, DialogTitleGroup } from "./dialog-v2" import { ButtonV2 } from "./button-v2" const docs = `### Overview Dialog content wrapper built on Kobalte's dialog primitive with v2 styling. Compose with \`DialogHeader\`, \`DialogTitle\`, \`DialogTitleGroup\`, \`DialogBody\`, and \`DialogFooter\`. ### API - \`Dialog\`: \`size\` (normal | large | x-large), \`variant\`, \`fit\`. - \`DialogHeader\`: row container with optional \`closeLabel\` and \`hideClose\`. - \`DialogTitle\`: accessible single-line header title. - \`DialogTitleGroup\`: column with \`title\` and required \`description\`. ### Accessibility - Focus trapping and aria attributes provided by Kobalte Dialog. ### Theming/tokens - Uses \`data-component="dialog-v2"\` and slot attributes. ` export default { title: "UI V2/Dialog", id: "components-dialog-v2", component: Dialog, tags: ["autodocs"], parameters: { docs: { description: { component: docs, }, }, }, } function dialogHeader(title: string, description: string) { return ( ) } export const Basic = { render: () => ( Open dialog {dialogHeader("Dialog", "Description")} Dialog body content. ), } export const Sizes = { render: () => (
Normal {dialogHeader("Normal", "Normal size")} Normal dialog content. Large {dialogHeader("Large", "Large size")} Large dialog content. X-Large {dialogHeader("Extra large", "X-large size")} X-large dialog content.
), } export const TitleOnly = { render: () => ( Open dialog Open project Dialog body content. ), } export const HeaderControls = { render: () => ( Open dialog Help Dialog body content. ), } export const WithFooter = { render: () => ( Open dialog {dialogHeader("Save changes", "Your changes will be lost if you don't save them.")} Cancel Save ), } export const WithFooterThreeButtons = { render: () => ( Open dialog {dialogHeader("Unsaved changes", "You have unsaved changes. What would you like to do?")} Remind me later Cancel Save ), } export const Fit = { render: () => ( Open fit dialog {dialogHeader("Fit content", "Dialog fits its content.")} Dialog fits its content. ), }