import { createContext, type ReactNode } from "react"
import "./story-page.css"
// Storybook presentation only (not part of @hm-design/ui): the common frame of a representative Story page.
// Page → Header (title, description) → Sections (title, description, specimen). It never styles the component being reviewed.
// Inner and title follow Foundation / Color; the section header → content split follows Center Graphic / 교량.
// A Story using it sets `parameters.layout: "fullscreen"` so the page owns its inner padding.
// Lets StateBoard render its specimen labels one level below the section heading.
export const StorySectionContext = createContext(false)
export function StoryPage({ className, children }: { className?: string; children: ReactNode }) {
return
}
// Representative (sidebar) Stories omit `kicker`: the sidebar path already names the category.
// Hidden verification Stories keep passing it so their page structure stays unchanged.
export function StoryPageHeader({ kicker, title, description }: { kicker?: string; title: string; description?: ReactNode }) {
return (
{kicker ? {kicker}
: null}
{title}
{description ? {description}
: null}
)
}
// Headings and specimens share StoryPage's single Inner. Wide specimens own their local scroll frame.
export function StorySection({
title,
description,
id,
children,
}: {
title: string
description?: ReactNode
id?: string
children: ReactNode
}) {
return (
{title}
{description ? {description}
: null}
{children}
)
}
export const STORY_KICKER = {
foundation: "HM DESIGN SYSTEM / FOUNDATION",
components: "HM DESIGN SYSTEM / COMPONENTS",
patterns: "HM DESIGN SYSTEM / PATTERNS",
center: "HM DESIGN SYSTEM / CENTER GRAPHIC",
} as const