// @ts-nocheck import { onMount } from "solid-js" import * as mod from "./dialog" import { Button } from "./button" import { useDialog } from "../context/dialog" const docs = `### Overview Dialog content wrapper used with the DialogProvider for modal flows. Provide concise title/description and keep body focused. ### API - Optional: \`title\`, \`description\`, \`action\`. - \`size\`: normal | large | x-large. - \`fit\` and \`transition\` control layout and animation. ### Variants and states - Sizes and optional header/action controls. ### Behavior - Intended to be rendered via \`useDialog().show\`. ### Accessibility - TODO: confirm focus trapping and aria attributes from Kobalte Dialog. ### Theming/tokens - Uses \`data-component="dialog"\` and slot attributes. ` export default { title: "UI/Dialog", id: "components-dialog", component: mod.Dialog, tags: ["autodocs"], parameters: { docs: { description: { component: docs, }, }, }, } export const Basic = { render: () => { const dialog = useDialog() const open = () => dialog.show(() => ( Dialog body content. )) onMount(open) return ( ) }, } export const Sizes = { render: () => { const dialog = useDialog() return (
) }, } export const Transition = { render: () => { const dialog = useDialog() return ( ) }, } export const CustomAction = { render: () => { const dialog = useDialog() return ( } > Dialog body content. )) } > Open action dialog ) }, } export const Fit = { render: () => { const dialog = useDialog() return ( ) }, }