import type { Meta, StoryObj } from "@storybook/react-vite"
import { BoldIcon, ItalicIcon, StarIcon } from "lucide-react"
import { Toggle, ToggleGroup, ToggleGroupItem } from "@hm-design/ui"
import { StateBoard } from "@/components/story-board"
import { StoryPage, StoryPageHeader, StorySection } from "@/components/story-page"
// Toggle is a persistent pressed-state control. The representative Story shows each state with real, clickable toggles; the same
// specimens also exist as Stories tagged `verification` (hidden from the sidebar). Icon-only toggles carry an `aria-label`.
function OffOn() {
return (
Off
On
Outline off
Outline on
)
}
function WithIcon() {
return (
즐겨찾기
)
}
function Sizes() {
return (
{(["sm", "default", "lg"] as const).map((size) => (
즐겨찾기
{size}
))}
)
}
function Disabled() {
return (
Disabled off
Disabled on
)
}
const sections = [
{ id: "offon", label: "Off / On", node: },
{ id: "disabled", label: "Disabled", node: },
]
const meta = { title: "Components/Form/Toggle", component: Toggle, parameters: { layout: "padded" } } satisfies Meta
export default meta
type Story = StoryObj
const board = (...ids: string[]) => (
ids.includes(s.id)).map((s) => ({ id: s.id, label: s.label, children: s.node }))} />
)
// Representative Story: the common Story page; the sections group the same specimens.
export const All: Story = {
name: "Toggle",
parameters: { layout: "fullscreen", controls: { disable: true } },
render: () => (
{board("offon")}
알림 },
{ id: "group-single", label: "연결 그룹 · 단일 선택", children: 왼쪽가운데오른쪽 },
{ id: "group-multiple", label: "연결 그룹 · 다중 선택", children: 굵게기울임 },
]}
/>
{board("disabled")}
),
}
export const States: Story = { tags: ["verification"], render: () => }
export const IconOnly: Story = { tags: ["verification"], name: "Icon Only", render: () => }
export const DisabledToggle: Story = { tags: ["verification"], name: "Disabled", render: () => }
export const ContentNodes: Story = {
tags: ["verification"],
render: () => (
{[]}
<>>
<>즐겨찾기>
즐겨찾기
),
}