import { NAME, pattern, UI, type VNode, Writable } from "commonfabric"; import { Controls, SelectControl, SwitchControl, TextControl, } from "../ui/controls/index.ts"; // deno-lint-ignore no-empty-interface interface AlertStoryInput {} export interface AlertStoryOutput { [NAME]: string; [UI]: VNode; controls: VNode; } export default pattern(() => { const status = new Writable<"info" | "success" | "warning" | "error">("info"); const dismissible = new Writable(false); const icon = new Writable("i"); const showIcon = new Writable(true); const title = new Writable("Alert title"); const description = new Writable("This is alert description text."); const body = new Writable(""); return { [NAME]: "cf-alert Story", [UI]: (
{showIcon.get() ? {icon} : null} {title} {description} {body}
Dismissible alerts emit cf-dismiss when the close button is clicked.
), controls: ( <> ), }; });