docs(storybook): simplify Foundation Typography and Layout pages
Deploy Storybook / deploy (push) Successful in 53s

Typography: drop the page intro, section notes, the Font Stack details and
the per-specimen source path / size list that repeated the computed summary.
Layout: drop the intro, section notes, CSS source paths, the boundary and QA
preset notes, the current preview line and the Grid / Container note.
ReferencePage intro and ReferenceSection note become optional; Color keeps its text.
This commit is contained in:
shkim4 committed 2026-10-22 18:05:51 +09:00
1 parent f4ddd5ac4b
commit 625cdf0045
4 files changed
+18 -21

No files matched your search

+6 -9
View File
@@ -1,18 +1,15 @@
import { useEffect, useState } from "react"
import type { Meta, StoryObj } from "@storybook/react-vite"
import { layoutProperties, radiusReferences, spacingReferences } from "./reference-data"
import { ReferencePage, ReferenceSection, useResolvedProperties } from "./reference"
function LayoutReferencePage() {
const values = useResolvedProperties(layoutProperties)
const [desktop, setDesktop] = useState(() => matchMedia("(min-width: 1024px)").matches)
useEffect(() => { const media = matchMedia("(min-width: 1024px)"); const update = () => setDesktop(media.matches); media.addEventListener("change", update); return () => media.removeEventListener("change", update) }, [])
return <ReferencePage title="Layout" intro="현재 responsive boundary와 컴포넌트별 geometry · 전역 spacing scale / grid 없음">
<ReferenceSection title="Responsive Boundary" note="GNB · LNB · Dashboard CSS와 matchMedia 기준"><div className="hm-foundation-grid"><article className="hm-foundation-panel"><h3>≥ 1024px · Desktop</h3><p>Desktop Navigation · LNB 표시 · GNB desktop menu</p></article><article className="hm-foundation-panel"><h3>≤ 1023px · Mobile</h3><p>Mobile Navigation · LNB 숨김 · GNB mobile menu</p></article></div><p role="status">현재 preview: <strong>{desktop ? "Desktop" : "Mobile"}</strong> · GNB 높이 {values["--hm-gnb-height"]} · LNB track {values["--hm-lnb-width"]}</p><p className="hm-foundation-note">CSS는 min-width: 1024px / max-width: 1023px, GNB JS는 min-width: 1024px를 사용합니다. 표시는 기존 정수 QA 경계를 따릅니다.</p></ReferenceSection>
<ReferenceSection title="QA Reference Viewports" note="1280 / 390은 검증용 viewport이며 breakpoint token이 아닙니다."><div className="hm-foundation-grid"><div className="hm-foundation-panel"><h3>1280 × 900</h3><p>HM Desktop · QA reference</p></div><div className="hm-foundation-panel"><h3>390 × 844</h3><p>HM Mobile · QA reference</p></div></div><p className="hm-foundation-note">Boundary QA presets: 1024 × 900 / 1023 × 900</p></ReferenceSection>
<ReferenceSection title="Spacing · Current Usage Reference" note="pattern / component별 현재 사용값 · 같은 숫자도 하나의 token으로 합치지 않음"><div className="hm-foundation-grid">{spacingReferences.map(([property, name, source]) => <article className="hm-foundation-card" key={property}><h3>{name}</h3><code>{property}</code><p data-layout-value>{values[property]}</p><div className="hm-foundation-spacing" style={{ width: `var(${property})` }} aria-hidden="true" /><p className="hm-foundation-note">packages/ui/src/theme/{source}</p></article>)}</div></ReferenceSection>
<ReferenceSection title="Radius" note="역할이 다른 같은 반경은 따로 표시"><div className="hm-foundation-grid">{radiusReferences.map(property => <article className="hm-foundation-card" key={property}><div className="hm-foundation-radius" style={{ borderRadius: `var(${property})` }} /><code>{property}</code><p>{values[property]}</p></article>)}</div></ReferenceSection>
<ReferenceSection title="Layout / Container Reference" note="Dashboard 가용 폭 · 외곽 padding · 섹션 gap · Card padding 축소 specimen"><div className="hm-foundation-layout-sample" style={{ padding: "var(--hm-dashboard-padding)", gap: "var(--hm-dashboard-gap)" }}><div className="hm-foundation-layout-card" style={{ padding: "var(--hm-card-padding)" }}><strong>Dashboard content</strong><p>가용 폭을 사용하며 긴 텍스트는 내부에서 줄바꿈합니다.</p></div><div className="hm-foundation-layout-card" style={{ padding: "var(--hm-card-padding)" }}>다음 섹션 · gap: {values["--hm-dashboard-gap"]}</div></div><p className="hm-foundation-note">Grid / Container: NOT_FORMALLY_DEFINED · 공용 column 수 / max-width token은 FOLLOW_UP. src/hm-theme.css의 .hm-container는 앱 데모의 로컬 사용 규칙입니다.</p></ReferenceSection>
return <ReferencePage title="Layout">
<ReferenceSection title="Responsive Boundary"><div className="hm-foundation-grid"><article className="hm-foundation-panel"><h3>≥ 1024px · Desktop</h3><p>Desktop Navigation · LNB 표시 · GNB desktop menu</p></article><article className="hm-foundation-panel"><h3>≤ 1023px · Mobile</h3><p>Mobile Navigation · LNB 숨김 · GNB mobile menu</p></article></div></ReferenceSection>
<ReferenceSection title="QA Reference Viewports"><div className="hm-foundation-grid"><div className="hm-foundation-panel"><h3>1280 × 900</h3><p>HM Desktop · QA reference</p></div><div className="hm-foundation-panel"><h3>390 × 844</h3><p>HM Mobile · QA reference</p></div></div></ReferenceSection>
<ReferenceSection title="Spacing · Current Usage Reference"><div className="hm-foundation-grid">{spacingReferences.map(([property, name, responsive]) =><article className="hm-foundation-card" key={property}><h3>{name}</h3><code>{property}</code><p data-layout-value>{values[property]}</p><div className="hm-foundation-spacing" style={{ width: `var(${property})` }} aria-hidden="true" />{responsive ? <p className="hm-foundation-note">{responsive}</p> : null}</article>)}</div></ReferenceSection>
<ReferenceSection title="Radius"><div className="hm-foundation-grid">{radiusReferences.map(property => <article className="hm-foundation-card" key={property}><div className="hm-foundation-radius" style={{ borderRadius: `var(${property})` }} /><code>{property}</code><p>{values[property]}</p></article>)}</div></ReferenceSection>
<ReferenceSection title="Layout / Container Reference"><div className="hm-foundation-layout-sample" style={{ padding: "var(--hm-dashboard-padding)", gap: "var(--hm-dashboard-gap)" }}><div className="hm-foundation-layout-card" style={{ padding: "var(--hm-card-padding)" }}><strong>Dashboard content</strong><p>가용 폭을 사용하며 긴 텍스트는 내부에서 줄바꿈합니다.</p></div><div className="hm-foundation-layout-card" style={{ padding: "var(--hm-card-padding)" }}>다음 섹션 · gap: {values["--hm-dashboard-gap"]}</div></div></ReferenceSection>
</ReferencePage>
}
const meta = { title: "Foundation/Layout", parameters: { layout: "fullscreen" } } satisfies Meta
+6 -6
View File
@@ -54,12 +54,12 @@ export const typographyReferences = [
]
export const typographyProperties = ["--hm-font-family-base", "--hm-font-weight-medium", "--hm-font-weight-bold", "--hm-card-title-font-weight", "--hm-input-font-weight", ...typographyReferences.flatMap(item => [item.size, item.line, ...(item.weight ? [item.weight] : [])])]
export const spacingReferences = [
["--hm-dashboard-padding", "Dashboard 외곽 여백", "dashboard-layout.css · Desktop 34px / Mobile 20px"],
["--hm-dashboard-gap", "Dashboard 섹션 사이", "dashboard-layout.css"],
["--hm-card-padding", "Card 안쪽 여백", "card.css"],
["--hm-page-header-margin-bottom", "Page Header → 첫 콘텐츠", "page-header.css"],
["--hm-gnb-join", "GNB → 콘텐츠 연결", "gnb.css"],
["--hm-lnb-join", "LNB → 콘텐츠 연결", "lnb.css"],
["--hm-dashboard-padding", "Dashboard 외곽 여백", "Desktop 34px / Mobile 20px"],
["--hm-dashboard-gap", "Dashboard 섹션 사이", ""],
["--hm-card-padding", "Card 안쪽 여백", ""],
["--hm-page-header-margin-bottom", "Page Header → 첫 콘텐츠", ""],
["--hm-gnb-join", "GNB → 콘텐츠 연결", ""],
["--hm-lnb-join", "LNB → 콘텐츠 연결", ""],
] as const
export const radiusReferences = ["--hm-radius-control-md", "--hm-radius-button", "--hm-radius-input", "--hm-radius-select", "--hm-radius-container"]
export const layoutProperties = [...spacingReferences.map(([property]) => property), ...radiusReferences, "--hm-gnb-height", "--hm-lnb-width"]
+2 -2
View File
@@ -24,10 +24,10 @@ export function useResolvedProperties(properties: readonly string[]) {
}
// The page frame, title and sections are the common Story page (src/components/story-page.tsx); .hm-foundation styles the reference content.
export function ReferencePage({ title, intro, children }: { title: string; intro: string; children: ReactNode }) {
export function ReferencePage({ title, intro, children }: { title: string; intro?: string; children: ReactNode }) {
return <StoryPage className="hm-foundation"><StoryPageHeader title={title} description={intro} />{children}</StoryPage>
}
export function ReferenceSection({ title, note, children, id }: { title: string; note: string; children: ReactNode; id?: string }) {
export function ReferenceSection({ title, note, children, id }: { title: string; note?: string; children: ReactNode; id?: string }) {
return <StorySection id={id} title={title} description={note}>{children}</StorySection>
}
export function Specimen({ label, size, line, weight }: { label: string; size: string; line: string; weight?: string }) {
+4 -4
View File
@@ -9,10 +9,10 @@ const weights = [
]
function TypographyReferencePage() {
const values = useResolvedProperties(typographyProperties)
return <ReferencePage title="Typography" intro="기존 HM 컴포넌트의 실제 구현 규격 · 별도 Heading / Body / Caption token 없음">
<ReferenceSection title="Font Family" note="Noto Sans KR → 맑은 고딕 → 시스템 sans-serif"><div className="hm-foundation-panel"><p>Noto Sans KR → 맑은 고딕 → 시스템 sans-serif</p><details><summary>구현 참고 · 전체 CSS Font Stack</summary><code>--hm-font-family-base</code><p>{values["--hm-font-family-base"]}</p><p>/fonts/NotoSansKR-variable.ttf · font-weight 100–900 asset</p></details></div></ReferenceSection>
<ReferenceSection title="Font Weight" note="400(Regular) · 500(Medium) · 700(Bold) 3단계"><div className="hm-foundation-grid">{weights.map(({ property, label }) => <article className="hm-foundation-card" key={property}><code>{property}</code><p>{values[property]} — {label}</p><p style={{ fontWeight: `var(${property})` }}>한맥 프로젝트<br />Hanmac Project<br />0123456789</p></article>)}</div></ReferenceSection>
<ReferenceSection title="Component Specimens" note="specimen의 computed style 기준 · 자간 미지정은 normal"><div className="hm-foundation-specimens">{typographyReferences.map(item => <article className="hm-foundation-panel" key={item.label}><h3>{item.label}</h3><p className="hm-foundation-note">packages/ui/src/theme/{item.source}</p><dl><dt>Size</dt><dd><code>{item.size}</code> · {values[item.size]}</dd><dt>Line Height</dt><dd><code>{item.line}</code> · {values[item.line]}</dd><dt>Weight</dt><dd>{item.weight ? <><code>{item.weight}</code> · {values[item.weight]}</> : "normal · 컴포넌트에서 별도 weight 지정 없음"}</dd></dl><Specimen {...item} /></article>)}</div></ReferenceSection>
return <ReferencePage title="Typography">
<ReferenceSection title="Font Family"><div className="hm-foundation-panel"><p>Noto Sans KR → 맑은 고딕 → 시스템 sans-serif</p></div></ReferenceSection>
<ReferenceSection title="Font Weight"><div className="hm-foundation-grid">{weights.map(({ property, label }) => <article className="hm-foundation-card" key={property}><code>{property}</code><p>{values[property]} — {label}</p><p style={{ fontWeight: `var(${property})` }}>한맥 프로젝트<br />Hanmac Project<br />0123456789</p></article>)}</div></ReferenceSection>
<ReferenceSection title="Component Specimens"><div className="hm-foundation-specimens">{typographyReferences.map(item => <article className="hm-foundation-panel" key={item.label}><h3>{item.label}</h3><Specimen {...item} /></article>)}</div></ReferenceSection>
</ReferencePage>
}
const meta = { title: "Foundation/Typography", parameters: { layout: "fullscreen" } } satisfies Meta