import { useId, type ComponentProps, type ReactNode } from "react" import type { Meta, StoryObj } from "@storybook/react-vite" import { Textarea } from "@hm-design/ui" import { StateBoard } from "@/components/story-board" import { STORY_KICKER, StoryPage, StoryPageHeader, StorySection } from "@/components/story-page" // Story structure follows Input: one representative "Textarea" Story shows every state on one page; the same specimens // also exist as separate Stories tagged `verification`, hidden from the sidebar by default (see .storybook/main.ts). // ui_viz docs/components/textarea.md §6 Reference Viewer: Default, Hover, Focus, Error, Error + Focus, Readonly, Disabled and Multiline. // // Label, Required star and Helper/Error message are not part of the Textarea component. Specimen composes them with plain // elements and shadcn Token utilities, the way a consumer would: Label 14/20/500 and Helper 12/18/400 in the secondary // text color, Error message 11/18 in the destructive color, field gap 8. function Specimen({ label = "Description", message, error, required, id, ...textarea }: ComponentProps & { label?: string; message?: string; error?: boolean }) { const uid = useId() const fieldId = id ?? `textarea-${uid}` const messageId = `${fieldId}-message` return (