From 4c29894e561b58ea5942a246cbc0d1de9684ae2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=88=98=ED=98=84?= Date: Fri, 23 Oct 2026 00:28:05 +0900 Subject: [PATCH] refactor(storybook): simplify component and preview examples Drop page / section descriptions, state notes and repeated captions from the representative Stories of 44 components, the Patterns, Center Graphic and OrgChart pages. Value readouts, spec lists and captions hide only on the representative page; hidden verification Stories keep them. Tabs Default API and the Filter Bar draft / applied counts move to the hidden DefaultApi and DraftApplied Stories; Center Overview is hidden with its direct URL kept. Story IDs are unchanged. Align the component, pattern and OrgChart docs with the pages, point the quality reference check at the DraftApplied Story, and make the P8 styles check expect no section header on the preview-only Expanded page. --- docs/center-graphic/README.md | 2 +- docs/components/carousel.md | 2 +- docs/components/checkbox.md | 2 +- docs/components/combobox.md | 2 +- docs/components/command.md | 2 +- docs/components/date-picker.md | 2 +- docs/components/input.md | 2 +- docs/components/radio-group.md | 2 +- docs/components/select.md | 2 +- docs/components/switch.md | 2 +- docs/components/table.md | 2 +- docs/components/tabs.md | 6 +- docs/components/textarea.md | 2 +- docs/components/toggle-group.md | 2 +- docs/components/toggle.md | 2 +- .../guidelines/component-pattern-reference.md | 2 +- docs/org-chart/expanded-usage.md | 4 + docs/patterns/data-table.md | 4 +- docs/patterns/filter-bar.md | 6 +- .../storybook-ui-simplification-2026-10-22.md | 12 +++ examples/org-chart/verify-p8.mjs | 7 +- packages/org-chart/README.md | 8 +- scripts/verify-quality-reference.mjs | 2 +- src/center/center-facility.stories.tsx | 20 +---- src/center/center-information.stories.tsx | 9 +-- src/center/center-overview.stories.tsx | 8 +- src/center/center-spatial.stories.tsx | 9 +-- src/center/center-title.stories.tsx | 9 +-- src/components/accordion.stories.tsx | 17 ++-- src/components/alert-dialog.stories.tsx | 9 +-- src/components/alert.stories.tsx | 5 +- src/components/aspect-ratio.stories.tsx | 13 ++-- src/components/avatar.stories.tsx | 16 ++-- src/components/badge.stories.tsx | 11 +-- src/components/breadcrumb.stories.tsx | 17 ++-- src/components/button.stories.tsx | 68 +++++++++------- src/components/calendar.stories.tsx | 18 ++--- src/components/card.stories.tsx | 15 ++-- src/components/carousel.stories.tsx | 24 +++--- src/components/checkbox.stories.tsx | 25 +++--- src/components/collapsible.stories.tsx | 9 +-- src/components/combobox.stories.tsx | 33 ++++---- src/components/command.stories.tsx | 16 ++-- src/components/context-menu.stories.tsx | 7 +- src/components/date-picker.stories.tsx | 24 +++--- src/components/dialog.stories.tsx | 6 +- src/components/drawer.stories.tsx | 9 +-- src/components/dropdown-menu.stories.tsx | 2 +- src/components/hover-card.stories.tsx | 7 +- src/components/input.stories.tsx | 60 +++++++-------- src/components/label.stories.tsx | 17 ++-- src/components/menubar.stories.tsx | 7 +- src/components/navigation-menu.stories.tsx | 9 +-- src/components/pagination.stories.tsx | 22 +++--- src/components/popover.stories.tsx | 7 +- src/components/progress.stories.tsx | 16 ++-- src/components/radio-group.stories.tsx | 18 ++--- src/components/resizable.stories.tsx | 6 +- src/components/scroll-area.stories.tsx | 5 +- src/components/select.stories.tsx | 77 ++++++++----------- src/components/separator.stories.tsx | 11 +-- src/components/sheet.stories.tsx | 4 +- src/components/skeleton.stories.tsx | 5 +- src/components/slider.stories.tsx | 7 +- src/components/sonner.stories.tsx | 9 +-- src/components/switch.stories.tsx | 25 +++--- src/components/table.stories.tsx | 21 +++-- src/components/tabs.stories.tsx | 44 +++++------ src/components/textarea.stories.tsx | 13 +--- src/components/toggle-group.stories.tsx | 44 +++++------ src/components/toggle.stories.tsx | 50 +++--------- src/components/tooltip.stories.tsx | 7 +- src/org-chart/org-chart-expanded.stories.tsx | 30 ++++++-- src/org-chart/org-chart-page-previews.tsx | 12 +-- src/patterns/dashboard-layout.stories.tsx | 10 +-- src/patterns/data-table.stories.tsx | 22 +++--- src/patterns/filter-bar.stories.tsx | 29 ++++--- src/patterns/gnb.stories.tsx | 57 +++++--------- src/patterns/lnb.stories.tsx | 42 ++++------ src/patterns/loading-screen.stories.tsx | 5 +- src/patterns/page-header.stories.tsx | 15 ++-- 81 files changed, 520 insertions(+), 671 deletions(-) diff --git a/docs/center-graphic/README.md b/docs/center-graphic/README.md index ff6abbc..1be453f 100644 --- a/docs/center-graphic/README.md +++ b/docs/center-graphic/README.md @@ -73,7 +73,7 @@ import { CenterTitleReferenceDemo } from "@hm-design/center-graphic/reference" ## 7. Storybook -`Center Graphic` 그룹(기본 sidebar): `Overview`, `Title`, `Information`, `Spatial`, `Facility`(터널 · 교량 · 교차로 · 분기점 · 나들목 · 휴게소·졸음쉼터 · 연계 시설물), verification 숨김: Title `Playground`, Facility `직접 테스트 (터널)`. 제작 대상 해상도는 주소 `?centerResolution=3840x2160`으로 지정한다. +`Center Graphic` 그룹(기본 sidebar): `Title`, `Information`, `Spatial`, `Facility`(터널 · 교량 · 교차로 · 분기점 · 나들목 · 휴게소·졸음쉼터 · 연계 시설물), verification 숨김: `Overview`(배율 규칙·상태 표, 직접 URL `center-graphic-overview--overview` 유지), Title `Playground`, Facility `직접 테스트 (터널)`. 제작 대상 해상도는 주소 `?centerResolution=3840x2160`으로 지정한다. ## 8. 미확정 / 보류 (원본 기준) diff --git a/docs/components/carousel.md b/docs/components/carousel.md index ea00295..69a278c 100644 --- a/docs/components/carousel.md +++ b/docs/components/carousel.md @@ -70,7 +70,7 @@ pointer drag/swipe와 snap, loop·align·dragFree·skipSnaps 등 options, plugin ## 9. Storybook -- 대표 Story `All`("Carousel"): Basic(한 개 + `setApi`로 `slide n / 5` 표시), Multiple items(`basis-1/2`), Loop(3개), Vertical(세로), Media(AspectRatio 조합)를 한 페이지에 둔다. Card와 AspectRatio는 Story 조합이며 Carousel은 둘을 import하지 않는다. +- 대표 Story `All`("Carousel"): Basic(한 개, `setApi` 사용. `slide n / 5` 표시는 숨김 `Basic`에만 둔다), Multiple items(`basis-1/2`), Loop(3개), Vertical(세로), Media(AspectRatio 조합)를 한 페이지에 둔다. Card와 AspectRatio는 Story 조합이며 Carousel은 둘을 import하지 않는다. - verification: `Basic`, `Multiple Items`, `Loop`, `Vertical`. ## 10. 소비자 확장성 diff --git a/docs/components/checkbox.md b/docs/components/checkbox.md index acedf4d..b7b1bc8 100644 --- a/docs/components/checkbox.md +++ b/docs/components/checkbox.md @@ -100,7 +100,7 @@ Radix 구조·ARIA(`role=checkbox`, `aria-checked`)·키보드, `data-slot`, `cn ## 9. Storybook -- 대표 Story `All`("Checkbox"): `unchecked`, `checked`, `indeterminate`, `interactive`(controlled), `hover`, `focus`, `error`, `disabled`, `long`. Focus는 `play`로 실제 focus. +- 대표 Story `All`("Checkbox"): `unchecked`, `checked`, `indeterminate`, `hover`, `focus`, `error`, `disabled`, `long`. Focus는 `play`로 실제 focus. `indeterminate`는 controlled 예시를 겸해 클릭하면 checked가 된다(Radix, 2026-10-22 별도 `interactive` 구역 통합). `hover`는 Unchecked·Checked를 Storybook 전용 `data-sb-hover`(`.storybook/pseudo-states.ts`)로 고정해 보여 준다. Checkbox API가 아니며 소비 코드에 붙이지 않는다. - verification: `Unchecked`, `Checked`, `Indeterminate`, `Disabled`, `Error`, `Playground`. ## 10. 사용자 확정 결정 diff --git a/docs/components/combobox.md b/docs/components/combobox.md index 44b08be..36217ff 100644 --- a/docs/components/combobox.md +++ b/docs/components/combobox.md @@ -102,7 +102,7 @@ Popover: Portal, collision, Escape, 바깥 클릭 닫힘, trigger focus 복귀. ## 10. Storybook -- 대표 Story `All`("Combobox"): Empty placeholder + search(Remix는 disabled option), Selected(controlled, 값 표시), Medium, Long option, Disabled를 한 페이지에 둔다. Label은 Story 조합이다. +- 대표 Story `All`("Combobox"): Overview(Placeholder + search, Remix는 disabled option), Sizes(Medium, 같은 size의 Select / Combobox 비교), States(Selected(controlled), Disabled), Usage(Long option). Label은 Story 조합이다. 대표 화면은 선택값 표시(`value = …`)를 숨기며 숨김 `Controlled`는 유지한다. - verification: `Empty`, `Controlled`, `Long Option`. ## 11. 사용자 확정 결정 / 보류 diff --git a/docs/components/command.md b/docs/components/command.md index 083619e..179aafc 100644 --- a/docs/components/command.md +++ b/docs/components/command.md @@ -69,7 +69,7 @@ Component Mapping 위치: `packages/ui/src/theme/command.css` (`--hm-command-*`) ## 9. Storybook -- 대표 Story `All`("Command"): Search + disabled item(선택 로그), Groups·icons·shortcut(`CalendarIcon`, `UserIcon`, `SettingsIcon`), Long list(30개, List가 scroll)를 한 페이지에 둔다. 테두리 박스는 Story 조합이다. +- 대표 Story `All`("Command"): Search + disabled item(선택 로그는 숨김 `Search`에만 표시), Groups·icons·shortcut(`CalendarIcon`, `UserIcon`, `SettingsIcon`), Long list(30개, List가 scroll)를 한 페이지에 둔다. 테두리 박스는 Story 조합이다. - verification: `Search`, `Grouped`. ## 10. 사용자 확정 결정 diff --git a/docs/components/date-picker.md b/docs/components/date-picker.md index 7f1b1d3..f10b236 100644 --- a/docs/components/date-picker.md +++ b/docs/components/date-picker.md @@ -90,7 +90,7 @@ Popover: Portal, collision 처리, Escape, 바깥 클릭 닫힘, trigger focus ## 9. Storybook -- 대표 Story `All`("Date Picker"): Empty, Selected(`2026.10.06`), 기본 형식(`2026.01.09`)/custom override, Controlled(값 표시), Medium, Disabled dates(5일 이전·일요일), Disabled를 한 페이지에 둔다. Label은 Story 조합이며 `today`는 Calendar prop으로 2026-10-02에 고정. +- 대표 Story `All`("Date Picker"): Empty, Selected(`2026.10.06`), 기본 형식(`2026.01.09`)/custom override, Controlled(대표 화면은 값 표시 숨김, 숨김 `Controlled`는 표시), Medium, Disabled dates(5일 이전·일요일), Disabled를 한 페이지에 둔다. Label은 Story 조합이며 `today`는 Calendar prop으로 2026-10-02에 고정. - verification: `Empty`, `Selected`, `Controlled`. ## 10. 사용자 확정 결정 diff --git a/docs/components/input.md b/docs/components/input.md index 0770935..7e6d5a4 100644 --- a/docs/components/input.md +++ b/docs/components/input.md @@ -84,7 +84,7 @@ native `` 동작 전체(`type`, `file:` 스타일 class, `placeholder`), ## 9. Storybook -- 대표 Story `All`("Input"): 구역 `sizes`, `default`, `focus`, `error`, `error-message`, `disabled`, `readonly`. Focus는 `play` 함수로 실제 focus를 준다. +- 대표 Story `All`("Input"): Sizes(Small / Medium / Large 비교) → States(`focus`, `disabled`, `readonly`) → Validation(`error`, `error-message`). Focus는 `play` 함수로 실제 focus를 준다. 2026-10-22 Overview(`default`, size 생략 = Large)는 Sizes의 Large와 같아 대표 화면에서 뺐고, 크기별 수치 목록·설명은 숨김 `Sizes`("Compare Sizes")에 남겼다. size 생략 시 Large(§5)는 그대로다. - verification(`tags: ["verification"]`): `Default`, `Focus`, `Error`, `InvalidFocus`, `ErrorMessage`, `Required`, `Disabled`, `Readonly`, `Sizes`("Compare Sizes"), `Small`, `Medium`, `Large`, `Playground`(HM 전용). - Error Message·Required 표시는 Story 안의 조합 예시이며 Input 컴포넌트의 일부가 아니다. - sidebar는 `All` 하나만 보이는 1뎁스. 운영 규칙은 지침 §6.3, §7 참조. diff --git a/docs/components/radio-group.md b/docs/components/radio-group.md index 30d6954..d207cc1 100644 --- a/docs/components/radio-group.md +++ b/docs/components/radio-group.md @@ -57,7 +57,7 @@ shadcn `size-4 border-input text-primary shadow-xs dark:` class 제거 → theme ## 9. Storybook -대표 Story `All`: `vertical`, `horizontal`, `hover`, `focus`, `error`, `disabled-item`, `disabled-group`. Focus는 `play`로 실제 focus. verification: `Vertical`, `Horizontal`, `Disabled`, `Error`. +대표 Story `All`: `vertical`, `horizontal`, `hover`, `focus`, `error`, `disabled-item`, `disabled-group`. Focus는 `play`로 실제 focus. `hover`는 첫 항목을 Storybook 전용 `data-sb-hover`로 고정해 보여 주며 RadioGroupItem API가 아니다. verification: `Vertical`, `Horizontal`, `Disabled`, `Error`. ## 10. 사용자 확정 결정 diff --git a/docs/components/select.md b/docs/components/select.md index caa2bf7..6a0052d 100644 --- a/docs/components/select.md +++ b/docs/components/select.md @@ -98,7 +98,7 @@ Radix Root/Trigger/Portal/Content/Viewport/Item/ItemText 구조, 키보드 조 ## 9. Storybook -- 대표 Story `All`("Select"): 구역 `default`(Large, size 생략), `selected`, `disabled`, `open`. +- 대표 Story `All`("Select"): Sizes(Medium / Large 비교, 각 Trigger로 실제 목록 열기) → States(`selected`, `disabled`, `disabled-placeholder`) → Invalid / Focus(`invalid`, `invalid-disabled`). 2026-10-22 Overview의 `default`·로드 시 열린 `open` 예시는 대표 화면에서 뺐다. 열린 목록은 숨김 `Open`, 크기별 수치 목록은 숨김 `Sizes`("Compare Sizes")에서 확인한다. size 생략 시 Large(§5)는 그대로다. - verification(`tags: ["verification"]`): `Default`, `Open`, `Selected`, `Disabled`, `Sizes`("Compare Sizes"), `Medium`, `Large`, `LongContent`, `Scroll`, `Playground`(HM 전용). - `Disabled` Story 구성: Trigger 비활성 상태들(placeholder 포함). - `InvalidFocus` verification Story: 앞/뒤 버튼 사이의 Invalid Trigger와 Disabled Invalid Trigger. Tab / Shift+Tab, Enter / Space, Escape 및 focus return을 실제 키보드로 확인한다. diff --git a/docs/components/switch.md b/docs/components/switch.md index 26c7e22..f73be9a 100644 --- a/docs/components/switch.md +++ b/docs/components/switch.md @@ -56,7 +56,7 @@ shadcn의 `h-[1.15rem] w-8`, `border`, `shadow-xs`, `dark:` class 제거 → the ## 9. Storybook -대표 Story `All`: `off`, `on`, `interactive`(controlled), `hover`, `focus`, `disabled`. Focus는 `play`로 실제 focus. verification: `Off`, `On`, `Disabled`. +대표 Story `All`: `off`, `on`, `hover`, `focus`, `disabled`(2026-10-22 `interactive` 구역 제거, 모든 예시가 실제 클릭으로 토글). `hover`는 Off·On을 Storybook 전용 `data-sb-hover`로 고정해 보여 주며 Switch API가 아니다. Focus는 `play`로 실제 focus. verification: `Off`, `On`, `Disabled`. ## 10. 사용자 확정 결정 diff --git a/docs/components/table.md b/docs/components/table.md index b1e1f4e..ec48935 100644 --- a/docs/components/table.md +++ b/docs/components/table.md @@ -69,7 +69,7 @@ container(`overflow-x-auto`)와 table 구조, `caption-bottom`, Head/Cell의 che ## 9. Storybook -- 대표 Story `All`("Table"): Basic(Badge, 숫자 열, footer, caption), Selected row(Checkbox, local state), Long text, Horizontal overflow(1100px 표)를 한 페이지에 둔다. +- 대표 Story `All`("Table"): Basic(Badge, 숫자 열, footer. 대표 화면은 보이는 caption 대신 `aria-label`로 표 이름을 주고, `TableCaption` 예시는 숨김 `Basic`에 남긴다), Selected row(Checkbox, local state), Long text, Horizontal overflow(1100px 표)를 한 페이지에 둔다. - verification: `Basic`, `Selected`, `Long Text`, `Horizontal Overflow`. - Checkbox·Badge는 Story 조합이다. Story의 폭 wrapper에는 `minWidth: 0`이 필요하다(grid item의 `min-width:auto`가 Table 최소 폭만큼 부모를 넓힘). diff --git a/docs/components/tabs.md b/docs/components/tabs.md index 0f0103f..f297244 100644 --- a/docs/components/tabs.md +++ b/docs/components/tabs.md @@ -126,12 +126,12 @@ Radix Tabs 구조·ARIA(`role=tablist/tab/tabpanel`, `aria-selected`)·roving ta ## 9. Storybook -- 대표 Story `All`("Tabs"): **Overview**는 fill / panelSurface를 생략한 기본 Primary, **Default API**는 `fill`만 명시한 Primary와 `fill` + `panelSurface="content"`를 명시한 Primary를 비교한다. **Variants**는 명시적 Secondary, **States**는 기본 Primary + 8개 탭 + 260px wrapper Overflow다. 기존 대표 Story ID와 메뉴를 유지한다. Hover는 실제 포인터로 확인한다. -- verification(`tags: ["verification"]`): `Secondary`, `SelectedFirst`, `SelectedLast`, `Focus`, `Disabled`, `Overflow`, `SecondaryOverflow`, `LongLabel`. Primary 기준이며 Secondary는 같은 CSS 경로를 쓴다. Focus는 `play`로 실제 focus를 준다. +- 대표 Story `All`("Tabs"): **Overview**는 fill / panelSurface를 생략한 기본 Primary다. 같은 Primary가 반복되던 **Default API** 구역(`fill`만, `fill` + `panelSurface="content"` 명시)은 2026-10-22 숨김 verification `DefaultApi`로 옮겼다. **Variants**는 명시적 Secondary, **States**는 기본 Primary + 8개 탭 + 260px wrapper Overflow다. 기존 대표 Story ID와 메뉴를 유지한다. Hover는 실제 포인터로 확인한다. +- verification(`tags: ["verification"]`): `DefaultApi`, `Secondary`, `SelectedFirst`, `SelectedLast`, `Focus`, `Disabled`, `Overflow`, `SecondaryOverflow`, `LongLabel`. Primary 기준이며 Secondary는 같은 CSS 경로를 쓴다. Focus는 `play`로 실제 focus를 준다. - `LongLabel`은 짧은 라벨, 긴 라벨 1개, 긴 라벨 여러 개, 260px 좁은 container를 함께 검증한다. 라벨은 `nowrap`·무말줄임이며 실제 필요 폭이 넘을 때 이동 버튼으로 전환한다. - non-fill Story(`Selected`, `SelectedMiddle`, `Fill`, `FillContent`, `FillOverflow`와 대표의 non-fill 구역)는 2026-10-06에 제거했다. API(`fill=false`, Legacy profile CSS)는 유지한다(§10). - 2026-10-08 숨김 `Compatibility`(`verification` 태그 + **VERIFICATION ONLY** 표시)는 Legacy `fill={false}` / `fill={false} panelSurface="surface"` 동일성과 `panelSurface="surface"`만 명시한 경우의 Secondary 전환을 확인한다. 일반 Story 메뉴를 추가하지 않는다. -- Overview / Default API / Variants / States 및 Fill verification 예제의 콘텐츠 panel은 `px-0 py-6`로 통일해 D-01을 실제로 반영한다. Primary는 상위 content 면, Secondary는 상위 surface 면에 연결하며 내부 패널의 별도 border·배경·radius를 제거한다. Compatibility의 Legacy non-fill 두 예제만 이전 `border bg-card rounded-b p-4`를 보존한다. +- Overview / Variants / States, `DefaultApi` 및 Fill verification 예제의 콘텐츠 panel은 `px-0 py-6`로 통일해 D-01을 실제로 반영한다. Primary는 상위 content 면, Secondary는 상위 surface 면에 연결하며 내부 패널의 별도 border·배경·radius를 제거한다. Compatibility의 Legacy non-fill 두 예제만 이전 `border bg-card rounded-b p-4`를 보존한다. - **Usage**(2026-10-09 추가)는 공개 Card / Input / Textarea / Table을 조합해 Card 내부 Secondary와 페이지 content 면 위 Primary를 보여준다. 두 예제 모두 `TabsContent`는 `px-0 py-6`이며 별도 배경·border·radius를 추가하지 않는다. 대표 Story ID·기존 구역·verification Story는 유지한다. ## 10. 사용자 확정 결정 diff --git a/docs/components/textarea.md b/docs/components/textarea.md index fe5b458..6c4865d 100644 --- a/docs/components/textarea.md +++ b/docs/components/textarea.md @@ -86,7 +86,7 @@ native `