import type { Meta, StoryObj } from "@storybook/react-vite"
import { Card, CardContent, CardHeader, Skeleton } from "@hm-design/ui"
import { StateBoard } from "@/components/story-board"
import { STORY_KICKER, StoryPage, StoryPageHeader, StorySection } from "@/components/story-page"
// Skeleton is a visual placeholder; size and shape come from `className` (layout classes here are Story composition).
// There is no data fetching. The representative Story shows text lines, an avatar, and a card / list loading composition.
function TextLines() {
return (
)
}
function AvatarRow() {
return (
)
}
function CardLoading() {
return (
)
}
const sections = [
{ id: "text", label: "Text", node: },
{ id: "avatar", label: "Avatar + text", node: },
{ id: "card", label: "Card / list loading", node: },
]
const meta = { title: "Components/Data & Display/Skeleton", component: Skeleton, 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: "Skeleton",
parameters: { layout: "fullscreen", controls: { disable: true } },
render: () => (
{board("text")}
{board("avatar", "card")}
),
}
export const Text: Story = { tags: ["verification"], render: () => }
export const CardList: Story = { tags: ["verification"], name: "Card List", render: () => }