import type { Meta, StoryObj } from "@storybook/react-vite"
import { AspectRatio, Card, CardContent } from "@hm-design/ui"
import { StateBoard } from "@/components/story-board"
import { 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", node: },
{ id: "card", label: "Card", node: },
]
const meta = { title: "Components/Data & Display/Aspect Ratio", component: AspectRatio, parameters: { layout: "padded" } } satisfies Meta
export default meta
type Story = StoryObj
// Representative-page layout (Storybook presentation only): equal columns on PC (iframe width 1000px and up), fewer below that
// (200px minimum). Each specimen sits in its own single-column StateBoard (min larger than any column), so every subtitle and divider
// has the width of its column; a section with fewer specimens than columns leaves the remaining columns empty.
// The Card example spans two columns (about its previous width); the ratio boxes fill their column by design.
const specimenColumns = {
2: "min-[1000px]:grid-cols-2",
3: "min-[1000px]:grid-cols-3",
4: "min-[1000px]:grid-cols-4",
} as const
function SpecimenGrid({ ids, columns, spans = {} }: { ids: string[]; columns: 2 | 3 | 4; spans?: Record }) {
return (