import type { Meta, StoryObj } from "@storybook/react-vite"
import { AspectRatio, Card, CardContent } from "@hm-design/ui"
import { StateBoard } from "@/components/story-board"
import { STORY_KICKER, StoryPage, StoryPageHeader, StorySection } from "@/components/story-page"
// AspectRatio is a layout primitive: it keeps the ratio and nothing else. The image styling (object-fit, radius) in these Stories is
// the consumer's composition on the child, not part of AspectRatio. Images are inline data URIs (no network). The Card example only
// shows how a consumer can compose it; AspectRatio does not depend on Card.
const svg = (label: string, fill: string) =>
"data:image/svg+xml;utf8," +
encodeURIComponent(
``
)
function Image({ ratio, label }: { ratio: number; label: string }) {
return (
)
}
function Placeholder() {
return (
영상 영역 16:9
)
}
function InCard() {
return (
)
}
const sections = [
{ id: "r169", label: "16:9", node: },
{ id: "r43", label: "4:3", node: },
{ id: "r11", label: "1:1", node: },
{ id: "video", label: "Video-like placeholder", node: },
{ id: "card", label: "Composed in a Card (consumer composition)", node: },
]
const meta = { title: "Components/Data & Display/Aspect Ratio", component: AspectRatio, 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: "Aspect Ratio",
parameters: { layout: "fullscreen", controls: { disable: true } },
render: () => (
{board("r169")}{board("r43", "r11", "video")}{board("card")}
),
}
export const Wide: Story = { tags: ["verification"], name: "16:9", render: () => }
export const Square: Story = { tags: ["verification"], name: "1:1", render: () => }