From 0ea5b46f7456b2757970f1828755b431c7209f8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=88=98=ED=98=84?= Date: Mon, 9 Nov 2026 16:08:50 +0900 Subject: [PATCH] style(storybook): refine search and date story layout --- src/components/calendar.stories.tsx | 35 +++++++----- src/components/combobox.stories.tsx | 53 ++++++++++-------- src/components/command.stories.tsx | 33 +++++++----- src/components/date-picker.stories.tsx | 75 +++++++++++++++----------- 4 files changed, 117 insertions(+), 79 deletions(-) diff --git a/src/components/calendar.stories.tsx b/src/components/calendar.stories.tsx index b288222..205df44 100644 --- a/src/components/calendar.stories.tsx +++ b/src/components/calendar.stories.tsx @@ -48,22 +48,22 @@ function TwoMonths() { return box() } -const sections = [ - { id: "single", label: "Single", node: }, - { id: "disabled", label: "Disabled dates", node: }, - { id: "range", label: "Range", node: }, - { id: "months", label: "Two months", node: }, -] +// Same 3-column track as the Form pages (1 column on narrow screens). Each cell is a one-specimen StateBoard so subtitles, dividers and +// specimen tops line up; the wide Two months specimen takes two tracks (the full row on narrow screens). +const Grid = ({ children }: { children: ReactNode }) => ( +
{children}
+) +const Cell = ({ id, label, wide, children }: { id: string; label: string; wide?: boolean; children: ReactNode }) => ( +
+ +
+) // No `component`: Calendar props are a union of selection modes, so Stories without args would not type-check. const meta = { title: "Components/Search & Date/Calendar", 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, wide: s.id === "months", children: s.node }))} /> -) - // Representative Story: the common Story page; the sections group the same specimens. export const All: Story = { name: "Calendar", @@ -71,9 +71,18 @@ export const All: Story = { render: () => ( - {board("single")} - {board("range", "months")} - {board("disabled")} + + + + + + + + + + + + ), } diff --git a/src/components/combobox.stories.tsx b/src/components/combobox.stories.tsx index 4ef6197..4f9a157 100644 --- a/src/components/combobox.stories.tsx +++ b/src/components/combobox.stories.tsx @@ -21,10 +21,11 @@ const longOptions: ComboboxOption[] = [ { value: "b", label: "짧은 옵션" }, ] -function Field({ label, id, children }: { label: string; id: string; children: ReactNode }) { +// Label 14/20/500 in the default text color; a Disabled field keeps the secondary color at 0.6 (same as the Form pages). +function Field({ label, id, disabled, children }: { label: string; id: string; disabled?: boolean; children: ReactNode }) { return (
-