import type { Meta, StoryObj } from "@storybook/react-vite" import { RadioGroup } from "@hm-design/ui" import { StoryPage, StoryPageHeader } from "@/components/story-page" import { Group, RadioGroupSections } from "./radio-group-examples" // Current HM Radio Group. The specimens live in ./radio-group-examples and are also shown on the Selection Controls // representative page ("선택 컨트롤", Checkbox / Radio Group / Switch), the single sidebar item for the three. Every Story here // keeps its ID and direct URL but is hidden from the sidebar (tag `verification`). const meta = { title: "Components/Form/Radio Group", component: RadioGroup, parameters: { layout: "padded", docs: { description: { component: "현재 HM 규격: 18px 원, border 1px(stroke), Checked/Selected는 state-active 테두리 + 8px state-active dot, group gap 12(horizontal 16). Radix RadioGroup의 roving focus, 방향키 선택, ARIA를 유지합니다. ui-viz에는 Radio 규격이 없어 참고만 했습니다.", }, }, }, } satisfies Meta export default meta type Story = StoryObj // Former representative Story: kept for its ID and direct URL; hidden from the sidebar (tag `verification`) since the Selection // Controls page shows the same sections. export const All: Story = { tags: ["verification"], name: "Radio Group", parameters: { layout: "fullscreen", controls: { disable: true } }, render: () => ( ), play: async ({ canvasElement }) => { // preventScroll: the page opens at its header, not at the States section. canvasElement.querySelector('[data-overview-state="focus"] [role="radio"][data-state="checked"]')?.focus({ preventScroll: true }) }, } export const Vertical: Story = { tags: ["verification"], render: () => } export const Horizontal: Story = { tags: ["verification"], render: () => } export const Disabled: Story = { tags: ["verification"], render: () => } export const Error: Story = { tags: ["verification"], render: () => }