import { action, 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 ButtonStoryInput {} export interface ButtonStoryOutput { [NAME]: string; [UI]: VNode; controls: VNode; } export default pattern(() => { const variant = new Writable<"solid" | "outline" | "ghost">("solid"); const color = new Writable<"neutral" | "primary" | "accent" | "danger">( "primary", ); const disabled = new Writable(false); const label = new Writable("Click me"); const size = new Writable<"xs" | "sm" | "md" | "lg" | "xl" | "icon">("md"); const clickCount = new Writable(0); const handleClick = action(() => { clickCount.increment(1); }); return { [NAME]: "cf-button Story", [UI]: (
{label} Clicked {clickCount} times
), controls: ( <> ), }; });