@lucian-seo/lucian-ui 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/{Input-DzJm1Kv4.js → Input-Bv2FRGIe.js} +2 -2
- package/dist/lib/{Input-DzJm1Kv4.js.map → Input-Bv2FRGIe.js.map} +1 -1
- package/dist/lib/{Pagination-AWL5k5zG.js → Popover-Cq6yhJaK.js} +193 -132
- package/dist/lib/Popover-Cq6yhJaK.js.map +1 -0
- package/dist/lib/{Switch-DyKAqvde.js → Switch-DmKcoBT0.js} +3 -3
- package/dist/lib/Switch-DmKcoBT0.js.map +1 -0
- package/dist/lib/{Tag-Z8PjnJFt.js → Tag-CnNuj4nV.js} +2 -2
- package/dist/lib/{Tag-Z8PjnJFt.js.map → Tag-CnNuj4nV.js.map} +1 -1
- package/dist/lib/{TagInput-CeA0n7ax.js → TagInput-BcSSnJY_.js} +4 -4
- package/dist/lib/{TagInput-CeA0n7ax.js.map → TagInput-BcSSnJY_.js.map} +1 -1
- package/dist/lib/{ToggleButton-r73bokux.js → ToggleButton-CcST9ch9.js} +3 -3
- package/dist/lib/{ToggleButton-r73bokux.js.map → ToggleButton-CcST9ch9.js.map} +1 -1
- package/dist/lib/{Toolbar-DDOaxG3B.js → Toolbar-Cq2wF4Yg.js} +67 -127
- package/dist/lib/Toolbar-Cq2wF4Yg.js.map +1 -0
- package/dist/lib/{Tooltip-BW1-aVDg.js → Tooltip-1flxtzgM.js} +2 -2
- package/dist/lib/{Tooltip-BW1-aVDg.js.map → Tooltip-1flxtzgM.js.map} +1 -1
- package/dist/lib/{VisuallyHidden-DcE0EFpo.js → VisuallyHidden-Bht2-rdy.js} +16 -14
- package/dist/lib/VisuallyHidden-Bht2-rdy.js.map +1 -0
- package/dist/lib/{VoiceControlBar-lMPuJMcF.js → VoiceControlBar-iWzq7jiw.js} +1769 -1505
- package/dist/lib/VoiceControlBar-iWzq7jiw.js.map +1 -0
- package/dist/lib/{Waveform-EahaE6uD.js → Waveform-CtI9GetQ.js} +3 -3
- package/dist/lib/Waveform-CtI9GetQ.js.map +1 -0
- package/dist/lib/components/common/Badge/Badge.d.ts +1 -9
- package/dist/lib/components/common/Glass/Glass.d.ts +1 -3
- package/dist/lib/components/common/index.js +5 -5
- package/dist/lib/components/composed/index.js +3 -3
- package/dist/lib/components/derived/index.js +3 -3
- package/dist/lib/components/extended/DataGrid/DataGrid.clipboard.d.ts +2 -0
- package/dist/lib/components/extended/DataGrid/DataGrid.d.ts +6 -0
- package/dist/lib/components/extended/DataGrid/DataGrid.features.d.ts +2 -0
- package/dist/lib/components/extended/index.js +1 -1
- package/dist/lib/index.js +12 -12
- package/dist/lib/styles.css +1 -1
- package/dist/lib/tokens.css +29 -34
- package/docs/DATAGRID.md +111 -1
- package/package.json +1 -1
- package/dist/lib/Pagination-AWL5k5zG.js.map +0 -1
- package/dist/lib/Switch-DyKAqvde.js.map +0 -1
- package/dist/lib/Toolbar-DDOaxG3B.js.map +0 -1
- package/dist/lib/VisuallyHidden-DcE0EFpo.js.map +0 -1
- package/dist/lib/VoiceControlBar-lMPuJMcF.js.map +0 -1
- package/dist/lib/Waveform-EahaE6uD.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toolbar-Cq2wF4Yg.js","names":[],"sources":["../../src/components/composed/AppShell/AppShell.tsx","../../src/components/composed/Breadcrumb/Breadcrumb.tsx","../../src/components/composed/BulkActionBar/BulkActionBar.tsx","../../src/components/composed/Callout/Callout.tsx","../../src/components/composed/Card/Card.tsx","../../src/components/composed/Carousel/Carousel.tsx","../../src/components/composed/Combobox/Combobox.tsx","../../src/components/composed/CommandPalette/CommandPalette.tsx","../../src/components/composed/DatePicker/dates.ts","../../src/components/composed/DatePicker/Calendar.tsx","../../src/components/composed/DatePicker/DatePicker.tsx","../../src/components/composed/DateRangePicker/DateRangePicker.tsx","../../src/components/composed/Drawer/Drawer.tsx","../../src/components/composed/EmptyState/EmptyState.tsx","../../src/components/composed/FilterBar/FilterBar.tsx","../../src/components/composed/FormSection/FormSection.tsx","../../src/components/composed/ListRow/ListRow.tsx","../../src/components/composed/Modal/Modal.tsx","../../src/components/composed/PageHeader/PageHeader.tsx","../../src/components/composed/PreferenceRow/PreferenceRow.tsx","../../src/components/composed/SidePanel/SidePanel.tsx","../../src/components/composed/SidebarNav/SidebarNav.tsx","../../src/components/composed/Sheet/Sheet.tsx","../../src/components/composed/Spotlight/Spotlight.tsx","../../src/components/composed/Stepper/Stepper.tsx","../../src/components/composed/Table/Table.tsx","../../src/components/composed/Tabs/Tabs.tsx","../../src/components/composed/TimeInput/times.ts","../../src/components/composed/TimeInput/TimeInput.tsx","../../src/components/composed/Toast/Toast.tsx","../../src/components/composed/Toolbar/Toolbar.tsx"],"sourcesContent":["import { useCallback, useEffect, useId, useRef, useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport \"./AppShell.css\";\n\nexport type AppShellRailSize = \"sm\" | \"md\" | \"lg\";\nexport type AppShellFit = \"viewport\" | \"container\";\n\nexport type AppShellProps = {\n /**\n * What stands in the rail. A `SidebarNav`, usually.\n *\n * The rail is not the nav. It is the column the nav stands in, and the difference is the\n * whole reason this component exists: `SidebarNav` knows how to be a list of destinations\n * and knows nothing about being a column that collapses, becomes an overlay under a\n * breakpoint, and yields its width to the work.\n */\n rail?: ReactNode;\n /**\n * Names the way out of the rail — the scrim button under `--bp-lg` is \"«railLabel» 닫기\".\n *\n * It does not name the rail itself. The nav inside already has a name, and a wrapper with a\n * second one made assistive technology announce two labelled boxes for one column.\n */\n railLabel?: string;\n /**\n * The id of the rail's box, for a control elsewhere to point `aria-controls` at.\n *\n * `PageHeader`'s rail button is outside this component, so the id cannot be generated in\n * here and reached from out there. Given one, both ends agree; omitted, the rail still gets\n * a unique id of its own and nothing refers to it.\n */\n railId?: string;\n /**\n * Whether the rail is showing.\n *\n * Optional, and omitting it is uncontrolled: the shell keeps the state itself, opens with\n * the rail showing, and the scrim closes it. Passing it makes the shell controlled, and then\n * `onRailOpenChange` is where the state has to be kept.\n *\n * Below `--bp-lg` this stops meaning \"narrow\" and starts meaning \"over the work\": there is\n * no width at which a rail and a readable column both fit on a phone, so the rail becomes\n * a layer and the scrim behind it is what closes it.\n */\n railOpen?: boolean;\n onRailOpenChange?: (open: boolean) => void;\n railSize?: AppShellRailSize;\n /** Stays put while the work scrolls under it. A `PageHeader`, usually. */\n header?: ReactNode;\n children: ReactNode;\n /**\n * The panel docked at the end edge. A `SidePanel`, usually.\n *\n * Docked, not floating: it takes its width out of the work rather than covering it, which\n * is the entire difference between reading a source beside an answer and reading it on top\n * of one.\n */\n dock?: ReactNode;\n dockLabel?: string;\n dockOpen?: boolean;\n /**\n * What the shell is tall as.\n *\n * `viewport` is the app root: the shell owns the window and the work scrolls inside it.\n * `container` is anything else — a preview pane, a split view, a demo — where the shell\n * has to be as tall as the box it was put in.\n *\n * A decision rather than a default, because `100dvh` alone is a shell that cannot be\n * embedded: it renders at window height inside a 512px box, overflows it, and the work\n * never scrolls because it was never short. Found by putting one in a demo.\n */\n fit?: AppShellFit;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * Rail, work, and an optional dock at the end.\n *\n * The layer every component here was built to sit inside and none of them could: a\n * `SourcePanel` with nowhere to dock is a panel that has to be positioned by whoever adopts\n * it, and then the library has eighty-one parts and no opinion about where any of them go.\n *\n * Three columns in one grid rather than three positioned boxes. A positioned rail overlaps\n * the work and every child then needs to know how much to inset itself — which is how a\n * layout ends up with a magic number in forty components. Here the work is a grid track, so\n * it is whatever is left, and nothing inside it is told anything.\n *\n * It breaks on the viewport, not on itself. A shell is the thing that owns the window, so\n * `--bp-lg` here means \"this window is too narrow for a rail and a readable measure\" rather\n * than \"this box is\". An adopter who embeds one inside a box narrower than the breakpoint\n * gets the wide layout in a narrow space — a container query would answer that, and the\n * reason there is not one is that a container query for a layout nobody can render at both\n * sizes is a behaviour that ships untested. The demo runs at about 766px for this reason.\n *\n * The scroll lives in the work, not on the page. `<main>` is the scroll container so the rail\n * and the header stay where they are without `position: fixed` — fixed elements leave the\n * flow, and an element out of the flow cannot be a grid track.\n */\nexport function AppShell({\n rail,\n railLabel = \"둘러보기\",\n railId,\n railOpen,\n onRailOpenChange,\n railSize = \"md\",\n header,\n children,\n dock,\n dockLabel = \"사이드 패널\",\n dockOpen = true,\n fit = \"viewport\",\n className,\n ...rest\n}: AppShellProps) {\n const base = useId();\n const showDock = Boolean(dock) && dockOpen;\n\n /*\n * Controlled when `railOpen` is given, and holding its own state when it is not.\n *\n * There was no second branch: the prop defaulted to `true` and the only writer was the\n * adopter's callback, so a shell rendered without one had a rail that could not be closed by\n * anything. Under `--bp-lg` that is not a missing convenience — the rail is a layer over the\n * work, the scrim called a callback that was not there, and the reader was left with a\n * covered page and a dismiss button that did nothing.\n *\n * The alternative was to make the pair required by the type. It was rejected because the\n * shell has a correct answer of its own: most adopters never read the rail's state, and a\n * component that demands to be wired before it can work is one every page copies the same\n * four lines into. Passing `railOpen` still hands control over completely.\n */\n const [railOpenSelf, setRailOpenSelf] = useState(true);\n const controlled = railOpen !== undefined;\n const open = controlled ? railOpen : railOpenSelf;\n const setRailOpen = useCallback(\n (next: boolean) => {\n if (!controlled) setRailOpenSelf(next);\n onRailOpenChange?.(next);\n },\n [controlled, onRailOpenChange],\n );\n\n /*\n * When the rail stops being a column, it closes.\n *\n * Found by looking: at 620px the demo rendered as a scrim over greyed-out work, because\n * `railOpen` was still true from the width where being open was free. Under `--bp-lg` it is\n * not free — the rail is a layer, and a layer that appears over the work without the reader\n * asking is an interruption they now have to dismiss before they can read anything.\n *\n * Only on the crossing, and only downward. An adopter who opens the rail on a phone means\n * it, and this must not close it under them a moment later; and going back to a wide window\n * does not reopen what somebody closed.\n *\n * The width comes from `--bp-lg` rather than from a number written here, which is what that\n * token is for — the foundation says the breakpoints are values so they can be read in JS\n * as well as matched in CSS.\n */\n const wasNarrow = useRef<boolean | null>(null);\n useEffect(() => {\n if (!rail) return;\n const width = getComputedStyle(document.documentElement).getPropertyValue(\"--bp-lg\").trim();\n if (!width) return;\n const query = window.matchMedia(`(max-width: ${width})`);\n\n const check = () => {\n const narrow = query.matches;\n const crossed = wasNarrow.current === false && narrow;\n wasNarrow.current = narrow;\n if (crossed && open) setRailOpen(false);\n };\n\n /* The first run only records which side we are on: a shell that is *rendered* narrow was\n * not crossed into, and closing on mount would take the rail away from an adopter who\n * asked for it. */\n if (wasNarrow.current === null) wasNarrow.current = query.matches;\n query.addEventListener(\"change\", check);\n return () => query.removeEventListener(\"change\", check);\n }, [rail, open, setRailOpen]);\n\n return (\n <div\n className={`app-shell ${className ?? \"\"}`.trim()}\n data-rail={rail ? (open ? \"open\" : \"collapsed\") : \"none\"}\n data-rail-size={railSize}\n data-dock={showDock ? \"open\" : \"closed\"}\n data-fit={fit}\n {...rest}\n >\n {/*\n * A plain box, named by nothing.\n *\n * It was `role=\"group\"` with an `aria-label`, which is two mistakes: `group` is not a\n * landmark, so it did not give anyone a way to jump here, and the label sat directly\n * outside the `<nav>` that already carries one — one column announcing itself twice,\n * under two names an adopter has to keep in step. The id stays, because a control\n * outside the shell needs something to point `aria-controls` at.\n */}\n {rail ? (\n <div className=\"app-shell__rail\" id={railId ?? `${base}-rail`}>\n {rail}\n </div>\n ) : null}\n\n {/*\n * The scrim exists only under the breakpoint, where the rail is a layer over the work.\n * A button rather than a bare div: dismissing by clicking beside a thing is a mouse\n * gesture, and the keyboard equivalent has to be something the reader can reach.\n */}\n {rail && open ? (\n <button\n type=\"button\"\n className=\"app-shell__scrim\"\n aria-label={`${railLabel} 닫기`}\n onClick={() => setRailOpen(false)}\n />\n ) : null}\n\n <main className=\"app-shell__work\">\n {header ? <div className=\"app-shell__header\">{header}</div> : null}\n <div className=\"app-shell__content\">{children}</div>\n </main>\n\n {showDock ? (\n <aside className=\"app-shell__dock\" aria-label={dockLabel}>\n {dock}\n </aside>\n ) : null}\n </div>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { ChevronRight } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport \"./Breadcrumb.css\";\n\nexport type BreadcrumbItem = {\n label: ReactNode;\n /**\n * Where the level lives.\n *\n * Ignored on the last item, which is the page the reader is already on and is drawn as\n * plain text with `aria-current=\"page\"`.\n */\n href?: string;\n /**\n * Called when the level is chosen — a router push, usually.\n *\n * Ignored on the last item, for the same reason `href` is. Without `href` the level is\n * drawn as a `<button>` rather than an anchor, so it is still reachable by Tab and still\n * fires on Enter and Space; prefer giving `href` as well, so the level can be opened in a\n * new tab and read as a link.\n */\n onClick?: () => void;\n};\n\nexport type BreadcrumbProps = {\n items: BreadcrumbItem[];\n /**\n * The most levels to put on screen, the ellipsis counted as one.\n *\n * Above it the middle is folded away: the first survives because it says where the tree\n * starts, and as many of the last as still fit, because they say where the reader is and\n * what they came out of. It is a cap, so `max={3}` really does draw three.\n */\n max?: number;\n label?: string;\n size?: \"sm\" | \"md\";\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/** One rendered cell: a level, or the fold that stands in for the levels left out. */\ntype Slot = { kind: \"item\"; item: BreadcrumbItem; at: number } | { kind: \"gap\" };\n\n/**\n * Where this page sits, and the way back up.\n *\n * An ordered list, because the order is the meaning — and a named `<nav>`, because a page\n * usually has more than one navigation and \"navigation\" three times names none of them.\n *\n * The last item is not a link. It is the page the reader is on, and `aria-current=\"page\"`\n * says so; a link to where you already are is a link that does nothing.\n */\nexport function Breadcrumb({\n items,\n max = 4,\n label = \"현재 위치\",\n size = \"md\",\n className,\n ...rest\n}: BreadcrumbProps) {\n /*\n * Two is the floor. One cell cannot hold both a fold and the page the reader is on, and\n * dropping the reader's own page to honour `max={1}` would obey the number by destroying\n * the thing the component is for.\n */\n const cap = Math.max(max, 2);\n const folded = items.length > cap;\n\n let shown: Slot[];\n if (!folded) {\n shown = items.map((item, at) => ({ kind: \"item\", item, at }));\n } else if (cap >= 3) {\n const tail = cap - 2;\n shown = [\n { kind: \"item\", item: items[0], at: 0 },\n { kind: \"gap\" },\n ...items.slice(-tail).map((item, offset) => ({\n kind: \"item\" as const,\n item,\n at: items.length - tail + offset,\n })),\n ];\n } else {\n // No room for the root as well as the fold, so the fold swallows it.\n shown = [{ kind: \"gap\" }, { kind: \"item\", item: items[items.length - 1], at: items.length - 1 }];\n }\n\n const hiddenCount = items.length - shown.filter((slot) => slot.kind === \"item\").length;\n\n return (\n <nav {...rest} className={`breadcrumb ${className ?? \"\"}`.trim()} aria-label={label} data-size={size}>\n <ol className=\"breadcrumb__list\">\n {shown.map((slot, index) => {\n const last = index === shown.length - 1;\n /*\n * Keyed by the level's own position in `items`, not by where it landed on screen.\n * The render index moves under the levels the moment the trail folds — index 1 is\n * the second level in a short trail and the ellipsis in a long one — and React\n * then reuses one item's DOM for another.\n */\n const key = slot.kind === \"gap\" ? \"gap\" : `item-${slot.at}`;\n return (\n <li className=\"breadcrumb__item\" key={key}>\n {slot.kind === \"gap\" ? (\n /* The fold is not a control here. Making it one would promise a menu of the\n * hidden levels, and this component does not own a menu — `Menu` does. */\n <span className=\"breadcrumb__gap\" data-part=\"gap\">\n …\n <span className=\"visually-hidden\">{`가운데 ${hiddenCount}단계 생략`}</span>\n </span>\n ) : last ? (\n <span className=\"breadcrumb__current\" aria-current=\"page\" data-part=\"current\">\n {slot.item.label}\n </span>\n ) : slot.item.href !== undefined ? (\n <a\n className=\"breadcrumb__link\"\n href={slot.item.href}\n onClick={slot.item.onClick}\n data-part=\"link\"\n >\n {slot.item.label}\n </a>\n ) : slot.item.onClick ? (\n /*\n * A level with a handler and no address. An `<a>` without `href` is not a\n * link to anything: it leaves the tab order and reports no role, so the\n * level could only be reached with a mouse. A button is what this actually\n * is, and it says so.\n */\n <button\n type=\"button\"\n className=\"breadcrumb__link\"\n onClick={slot.item.onClick}\n data-part=\"link\"\n >\n {slot.item.label}\n </button>\n ) : (\n /* Neither an address nor a handler: a level that is named but cannot be gone\n * to. Focusing something that does nothing is a stop for no reason. */\n <span className=\"breadcrumb__label\" data-part=\"label\">\n {slot.item.label}\n </span>\n )}\n {/* The separator is a drawing of \"and then\". Read aloud it is a chevron. */}\n {last ? null : (\n <Icon icon={ChevronRight} size=\"xs\" className=\"breadcrumb__separator\" />\n )}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n}\n","import { useEffect, useRef } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { X } from \"lucide-react\";\nimport { Button } from \"../../common/Button\";\nimport { IconButton } from \"../../common/IconButton\";\nimport \"./BulkActionBar.css\";\n\nexport type BulkActionBarProps = {\n count: number;\n /** What has been chosen. \"주문\", \"사람\", \"파일\". Used in the count and in the name. */\n noun: string;\n children: ReactNode;\n onClear: () => void;\n /**\n * How many of the chosen are not in the list the reader is looking at.\n *\n * A filter narrows what is on screen and leaves the selection alone — it is a way of\n * looking, not an undo — so \"2개 주문 선택됨\" can be true while only one of them is\n * visible. The bar used to know nothing but `count` and said the number flatly, and every\n * host that cared had to write the qualification as a sentence of its own somewhere else\n * on the page. Somewhere else is not in the live region: the count is announced and that\n * sentence never was.\n *\n * A number rather than a flag, because \"몇 개가 밖에 있는가\" is what the reader decides on.\n */\n outside?: number;\n /** A count of everything, so \"전체 137개 고르기\" can be offered. */\n total?: number;\n onSelectAll?: () => void;\n clearLabel?: string;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * The bar that rises when something is chosen.\n *\n * It is a named region with a polite live count, and not a dialog: it does not trap focus,\n * does not take it, and does not stop the reader from carrying on choosing. A bar that\n * grabbed focus the moment a checkbox was ticked would make selecting three rows a fight.\n *\n * The count is announced because the bar appearing is otherwise silent — the screen changed\n * and nothing was said. It is `polite` rather than `assertive`: a reader ticking boxes is\n * mid-task, and interrupting them to say \"1개 선택됨\" after every tick is worse than saying\n * it when they pause.\n *\n * It does put focus back, though, whenever the bar going away is what took it. That is not\n * only the clear button: an action inside the bar that ends the selection — 「배송 준비」 on\n * the last chosen row — hides the bar around the button that was pressed, and focus falls to\n * `<body>`, where the next Tab starts the document over. The condition is therefore \"where is\n * the focus now\", not \"which of my buttons was pressed\". `FilterBar` has the same shape of\n * problem and the same answer: remember where the reader was, and go back there.\n */\nexport function BulkActionBar({\n count,\n noun,\n children,\n onClear,\n outside = 0,\n total,\n onSelectAll,\n clearLabel,\n className,\n ...rest\n}: BulkActionBarProps) {\n const hidden = count === 0;\n const root = useRef<HTMLDivElement>(null);\n /* Where the reader was when the bar rose — the checkbox they ticked, usually. */\n const origin = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (!hidden) {\n const at = document.activeElement as HTMLElement | null;\n if (at && at !== document.body && !root.current?.contains(at)) origin.current = at;\n return;\n }\n /*\n * Whether the focus was lost, rather than which button was pressed.\n *\n * The first version of this set a ref from the clear button's own handler and moved focus\n * only then. It missed the other way out: an action button in the bar that empties the\n * selection — 「배송 준비」 on the last chosen row — hides the bar around itself, and the\n * reader lands on `<body>` with the next Tab starting the document over.\n *\n * Not if something outside the bar already has the focus: the host may have moved it in\n * `onClear`, and taking it back would undo their choice. Inside the bar counts as lost —\n * the bar is hidden and `inert` by now, and the browser drops focus to `<body>` on its\n * own, sometimes only once the closing transition has run.\n */\n const at = document.activeElement;\n if (at && at !== document.body && !root.current?.contains(at)) return;\n\n const back = origin.current;\n origin.current = null;\n /*\n * `isConnected` is not the test. A hidden bar is still in the document and its buttons\n * are still connected — they are inside `[inert]`, and `focus()` on an inert element does\n * nothing at all and reports nothing. The reader stays on `<body>` and the call looks\n * like it worked. Anything under an inert ancestor is treated as gone.\n */\n if (!back || !back.isConnected || back.closest(\"[inert]\")) return;\n back.focus();\n }, [hidden, count]);\n\n return (\n <div\n {...rest}\n ref={root}\n className={`bulk-action-bar ${className ?? \"\"}`.trim()}\n role=\"region\"\n aria-label={`선택한 ${noun}에 적용할 작업`}\n data-empty={hidden ? \"\" : undefined}\n /* Out of the accessibility tree entirely when there is nothing chosen, so a reader\n * walking the page does not meet an empty toolbar announcing zero. */\n aria-hidden={hidden || undefined}\n inert={hidden || undefined}\n >\n <p className=\"bulk-action-bar__count\" aria-live=\"polite\">\n {hidden ? \"\" : `${count.toLocaleString(\"ko-KR\")}개 ${noun} 선택됨`}\n {/*\n * In the same paragraph, so it is one announced sentence. A host that says this\n * somewhere else on the page says it outside the live region, and the reader who is\n * told the count is exactly the reader who is not told the qualification.\n */}\n {!hidden && outside > 0 ? (\n <span className=\"bulk-action-bar__outside\" data-part=\"outside\">\n {`그중 ${outside.toLocaleString(\"ko-KR\")}개는 목록 밖에 있습니다`}\n </span>\n ) : null}\n </p>\n\n {onSelectAll && total !== undefined && count < total ? (\n <Button variant=\"plain\" size=\"sm\" onClick={onSelectAll} data-part=\"select-all\">\n {`전체 ${total.toLocaleString(\"ko-KR\")}개 고르기`}\n </Button>\n ) : null}\n\n <div className=\"bulk-action-bar__actions\">{children}</div>\n\n <IconButton\n icon={X}\n label={clearLabel ?? `${noun} 선택 해제`}\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n onClick={onClear}\n data-part=\"clear\"\n />\n </div>\n );\n}\n","import { useRef } from \"react\";\nimport type { ElementType, ReactNode } from \"react\";\nimport { AlertTriangle, CheckCircle2, Info, X, XCircle } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport { IconButton } from \"../../common/IconButton\";\nimport { handOffFocus } from \"../../../foundation/focus\";\nimport \"./Callout.css\";\n\nexport type CalloutTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\";\nexport type CalloutVariant = \"subtle\" | \"outline\";\n\nexport type CalloutProps = {\n children?: ReactNode;\n /** What it is about. A callout with only a body is a paragraph in a coloured box. */\n title?: ReactNode;\n tone?: CalloutTone;\n variant?: CalloutVariant;\n /** Overrides the glyph the tone would have chosen. */\n icon?: LucideIcon;\n /** What to do about it. One or two things, at the end. */\n actions?: ReactNode;\n onDismiss?: () => void;\n dismissLabel?: string;\n as?: ElementType;\n /**\n * Say it when it appears.\n *\n * A callout that was on the page at load has already been read in document order, and\n * announcing it again is noise. One that arrives because the reader did something has to\n * announce itself, or the screen changed and nothing was said. `assertive` interrupts and\n * is for the failure the reader cannot carry on past.\n */\n live?: \"polite\" | \"assertive\";\n className?: string;\n [key: `data-${string}`]: unknown;\n [key: `aria-${string}`]: unknown;\n};\n\nconst GLYPH: Record<CalloutTone, LucideIcon> = {\n neutral: Info,\n accent: Info,\n success: CheckCircle2,\n warning: AlertTriangle,\n danger: XCircle,\n};\n\n/**\n * A notice in the flow of the page.\n *\n * Not a toast: it stays, it can be read at leisure, and it sits next to the thing it is\n * about. Everything that has to be true after the reader looks away belongs here rather\n * than in something that leaves on a timer.\n *\n * The tone never carries the message on its own. A red box says \"this matters\" to a reader\n * who can see it and nothing at all to one who cannot — so the glyph differs by tone as well\n * as the colour, and the words have to say which of the five it is.\n */\nexport function Callout({\n children,\n title,\n tone = \"neutral\",\n variant = \"subtle\",\n icon,\n actions,\n onDismiss,\n dismissLabel,\n as: Element = \"div\",\n live,\n className,\n ...rest\n}: CalloutProps) {\n const root = useRef<HTMLElement>(null);\n\n /*\n * 닫기 버튼은 이 콜아웃 안에 있으므로, 콜아웃이 걷히면 눌린 버튼도 함께 사라지고\n * 초점이 `<body>`로 떨어집니다. 걷어내는 것은 호출부이고 무엇이 그 자리를 대신하는지도\n * 호출부만 알지만, 「읽던 자리 근처」까지는 여기서 알 수 있습니다 — 문서 순서에서\n * 이 콜아웃 뒤의 첫 컨트롤, 없으면 앞의 마지막 것입니다.\n *\n * 호출부가 `onDismiss`를 무시해 콜아웃이 그대로 남으면 초점도 닫기 버튼에 그대로\n * 있으므로 아무것도 하지 않습니다. 자세한 것은 `foundation/focus`에 적었습니다.\n */\n const dismiss = () => {\n const hand = handOffFocus(root.current);\n onDismiss?.();\n hand();\n };\n\n return (\n <Element\n {...rest}\n ref={root}\n className={`callout ${className ?? \"\"}`.trim()}\n data-tone={tone}\n data-variant={variant}\n role={live === \"assertive\" ? \"alert\" : live === \"polite\" ? \"status\" : undefined}\n aria-live={live}\n >\n {/* Decorative, and `Icon` says so itself: without a `label` it renders `aria-hidden`.\n * The tone is already said in the words, and \"check circle icon\" is not what a reader\n * needs to hear before the sentence. */}\n <Icon icon={icon ?? GLYPH[tone]} size=\"sm\" className=\"callout__glyph\" />\n <div className=\"callout__body\">\n {title ? <p className=\"callout__title\">{title}</p> : null}\n {children ? <div className=\"callout__text\">{children}</div> : null}\n {actions ? <div className=\"callout__actions\">{actions}</div> : null}\n </div>\n {onDismiss ? (\n <IconButton\n icon={X}\n label={dismissLabel ?? (typeof title === \"string\" ? `${title} 닫기` : \"알림 닫기\")}\n size=\"sm\"\n variant=\"ghost\"\n tone=\"neutral\"\n onClick={dismiss}\n data-part=\"dismiss\"\n />\n ) : null}\n </Element>\n );\n}\n","import { forwardRef, useRef, type CSSProperties, type ElementType, type ReactNode, type Ref } from \"react\";\nimport { useComposedRef, useRefraction } from \"../../common/Glass/refraction\";\nimport { Skeleton } from \"../../common/Skeleton\";\nimport \"./Card.css\";\n\nexport type CardVariant = \"outlined\" | \"elevated\" | \"filled\";\nexport type CardPadding = \"none\" | \"sm\" | \"md\" | \"lg\";\n\n/*\n * A card has content, or it is waiting for content. There is no third case, and the type says\n * so rather than leaving `children` optional for everybody — an optional `children` makes an\n * empty card, a bordered box with nothing in it and no reason, into something the compiler\n * accepts.\n *\n * `loading` draws one full-width line and three that end short at the card's own padding: the shape a card has\n * before anyone fills it. Not `children` swapped for a grey box, because that box would be\n * the height of nothing, and a grid of cards that all grow when the data lands is a page that\n * jumps once per request.\n *\n * A loading card is never interactive, whatever it was told. Pressing a placeholder opens the\n * thing it is a placeholder for, which does not exist yet.\n */\nexport type CardProps = CardBase & ({ loading: true; children?: ReactNode } | { loading?: false; children: ReactNode });\n\ntype CardBase = {\n variant?: CardVariant;\n padding?: CardPadding;\n as?: ElementType;\n /**\n * The whole card is the target, and one link inside it is what makes it one.\n *\n * Not a `<button>` or an `<a>` wrapping everything: a card almost always holds another\n * control — a menu, a \"저장\", a tag — and interactive content nested inside interactive\n * content is invalid HTML that browsers repair by dropping one of the two. So the card\n * stays a plain container, the link marked `CardLink` stretches its own hit area over it,\n * and everything else interactive is lifted above that.\n *\n * The link is what is in the tab order, once, with its own name.\n */\n interactive?: boolean;\n selected?: boolean;\n className?: string;\n /** Declared because the lens needs this node too. Both get it; see `useComposedRef`. */\n ref?: Ref<HTMLElement>;\n [key: `data-${string}`]: unknown;\n [key: `aria-${string}`]: unknown;\n};\n\nexport const Card = forwardRef<HTMLElement, CardProps>(function Card({\n children,\n variant = \"outlined\",\n padding = \"md\",\n as: Element = \"div\",\n interactive,\n selected,\n loading,\n className,\n ...rest\n}: CardProps, ref) {\n /* A card is a surface, so under the glass look it is glass — and glass without the bend is\n * the frosted-panel look this library already had. The hook draws nothing outside that look\n * and returns an empty string, which is what keeps the `backdrop-filter` list valid. */\n const pane = useRef<HTMLElement>(null);\n const lens = useRefraction(pane);\n const hold = useComposedRef(pane, ref);\n\n return (\n <Element\n ref={hold}\n {...rest}\n className={`card ${className ?? \"\"}`.trim()}\n style={lens ? ({ \"--glass-refraction\": lens } as CSSProperties) : undefined}\n data-variant={variant}\n data-padding={padding}\n data-interactive={interactive && !loading ? \"\" : undefined}\n data-selected={selected ? \"\" : undefined}\n data-loading={loading ? \"\" : undefined}\n aria-busy={loading || undefined}\n >\n {loading ? (\n <div className=\"card__waiting\" data-part=\"waiting\">\n <Skeleton shape=\"text\" lines={1} />\n <Skeleton shape=\"text\" lines={3} />\n </div>\n ) : (\n children\n )}\n </Element>\n );\n});\n\nexport type CardLinkProps = {\n children: ReactNode;\n href?: string;\n onClick?: () => void;\n className?: string;\n [key: `data-${string}`]: unknown;\n [key: `aria-${string}`]: unknown;\n};\n\n/**\n * The one control that owns the card.\n *\n * Its text is the card's name — which is why it goes around the title rather than being an\n * invisible box over the whole thing. A stretched link with no text is a link announced as\n * its own URL.\n */\nexport function CardLink({ children, href, onClick, className, ...rest }: CardLinkProps) {\n const shared = { ...rest, className: `card__link ${className ?? \"\"}`.trim(), onClick };\n if (href !== undefined) return <a {...shared} href={href}>{children}</a>;\n return <button {...shared} type=\"button\">{children}</button>;\n}\n\nexport type CardHeaderProps = {\n title: ReactNode;\n description?: ReactNode;\n /** Before the title — an avatar, an icon, a thumbnail. */\n media?: ReactNode;\n /** After it — a badge, a menu, a price. */\n aside?: ReactNode;\n as?: ElementType;\n className?: string;\n [key: `data-${string}`]: unknown;\n [key: `aria-${string}`]: unknown;\n};\n\nexport function CardHeader({\n title,\n description,\n media,\n aside,\n as: Heading = \"h3\",\n className,\n ...rest\n}: CardHeaderProps) {\n return (\n <div {...rest} className={`card__header ${className ?? \"\"}`.trim()}>\n {media ? <div className=\"card__media\">{media}</div> : null}\n <div className=\"card__heading\">\n <Heading className=\"card__title\">{title}</Heading>\n {description ? <p className=\"card__description\">{description}</p> : null}\n </div>\n {aside ? <div className=\"card__aside\">{aside}</div> : null}\n </div>\n );\n}\n\nexport type CardSlotProps = {\n children: ReactNode;\n className?: string;\n [key: `data-${string}`]: unknown;\n [key: `aria-${string}`]: unknown;\n};\n\nexport function CardBody({ children, className, ...rest }: CardSlotProps) {\n return <div {...rest} className={`card__body ${className ?? \"\"}`.trim()}>{children}</div>;\n}\n\n/** The end of the card. Divided from the body, because it is usually where the actions are. */\nexport function CardFooter({ children, className, ...rest }: CardSlotProps) {\n return <div {...rest} className={`card__footer ${className ?? \"\"}`.trim()}>{children}</div>;\n}\n","import { Children, useEffect, useRef, useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { IconButton } from \"../../common/IconButton\";\nimport { VisuallyHidden } from \"../../common/VisuallyHidden\";\nimport \"./Carousel.css\";\n\nexport type CarouselPeek = \"none\" | \"sm\" | \"md\";\nexport type CarouselIndicator = \"dots\" | \"count\" | \"none\";\ntype CarouselControls = \"bar\" | \"overlay\";\n\nexport type CarouselProps = {\n /** What the row is of. \"상품 사진\", \"추천 강좌\". Names the scroller. */\n label: string;\n children: ReactNode;\n /**\n * How much of the next item shows past the edge.\n *\n * `none` is one item filling the width, and it is the version that says nothing about\n * whether there is a second one. Every carousel in the reference set showed a sliver.\n */\n peek?: CarouselPeek;\n /** Dots, \"4 / 5\", or neither. Both are read-outs; the buttons are the controls. */\n indicator?: CarouselIndicator;\n /**\n * 화살표가 어디에 서는가.\n *\n * `bar`는 줄 아래에 이전·표시·다음을 한 줄로 놓습니다. `overlay`는 그 줄을 통째로 항목\n * 위에 겹칩니다 — 화살표는 좌우 끝에, 표시는 아래쪽 가운데에. 감추는 것이 아니라 자리를\n * 옮기는 것입니다. 사진이 판 전체인 카드가 늘어설 때 아래에 줄을 하나 더 두면 그만큼\n * 카드가 짧아지기 때문이고, 참조 구현의 카드 캐러셀이 그 모양입니다.\n */\n controls?: CarouselControls;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * A row of items, one at a time, with the next one showing.\n *\n * **The scroll is the browser's.** `scroll-snap` does the gesture — a finger, a trackpad, a\n * shift-wheel and a touchpad's momentum all work without this component hearing about any of\n * them, and each one it re-implemented would be one it got slightly wrong. What is left for\n * the component is the two things the browser has no opinion about: which item is current, and\n * how to get to the next one without a pointer.\n *\n * **The dots are a read-out, not a control.** Five dots side by side are five targets under\n * 24px, which WCAG 2.5.8 refuses and a thumb refuses before it does. Three of the five\n * reference screens put arrows *next to* the dots for exactly this reason, and the two that\n * did not left no pointer-free way through the row at all. So: dots say where you are, the\n * buttons move you, and the scroller itself takes a Tab stop so the arrow keys work on it.\n *\n * **Which item is current is measured, and it is a whole number.** That makes it a `data-*`\n * attribute rather than a custom property — the third place a value may go is for quantities\n * a finger is choosing continuously, and this is not one. An `IntersectionObserver` answers it\n * without arithmetic that would have to agree with the stylesheet's gaps and padding.\n */\nexport function Carousel({\n label,\n children,\n peek = \"sm\",\n indicator = \"dots\",\n controls = \"bar\",\n className,\n ...rest\n}: CarouselProps) {\n const track = useRef<HTMLUListElement>(null);\n const items = Children.toArray(children);\n const [current, setCurrent] = useState(0);\n const [moved, setMoved] = useState(\"\");\n const spoken = useRef(0);\n\n useEffect(() => {\n const node = track.current;\n if (!node) return;\n\n /*\n * The most visible item wins, rather than the first one over a threshold. With a peek two\n * items are always partly in view, so \"the first one that is 50% visible\" flips back and\n * forth on the boundary and the dots flicker between two.\n *\n * **The ratios are kept, not read off the callback.** `entries` holds only the items whose\n * intersection *changed* since the last call — never the whole track. The first version\n * started from zero on every call and took the maximum of whatever happened to be in that\n * batch, so a scroll that reported items 2 and 3 would move the mark to one of them while\n * item 0 was still the one filling the frame. On screen that is the pill appearing at a\n * slide the reader is not looking at, and then correcting itself a moment later.\n *\n * A `0` threshold is in the list for the same reason: an item that leaves the frame has to\n * report that it left, or its last high ratio stays in the map and keeps winning.\n */\n const seen = new Map<number, number>();\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n seen.set(Number((entry.target as HTMLElement).dataset.index), entry.intersectionRatio);\n }\n let best = -1;\n let ratio = 0;\n for (const [index, visible] of seen) {\n if (visible > ratio) {\n ratio = visible;\n best = index;\n }\n }\n if (best >= 0) setCurrent(best);\n },\n { root: node, threshold: [0, 0.25, 0.5, 0.75, 1] },\n );\n for (const item of node.querySelectorAll(\".carousel__item\")) observer.observe(item);\n return () => observer.disconnect();\n }, [items.length]);\n\n /*\n * The position, said out loud once it changes.\n *\n * The buttons and the arrow keys both move the row and neither says anything: the dots are a\n * read-out a reader has to walk to, so pressing \"다음\" left them with silence and a row that\n * was now showing something else. It stays empty until the first move, because the position\n * at load has already been read in document order.\n */\n useEffect(() => {\n // Which item was last spoken, rather than \"has this effect run before\": under StrictMode\n // the effect runs twice on mount, and a mount flag would say the row had already moved.\n if (spoken.current === current) return;\n spoken.current = current;\n setMoved(`${items.length}개 중 ${current + 1}번째`);\n }, [current, items.length]);\n\n /*\n * `scrollIntoView` rather than a computed `scrollLeft`, so the gap, the padding and the peek\n * stay facts of the stylesheet. Arithmetic here would be a second copy of the layout that\n * has to be kept in step with the first.\n *\n * Smooth or not is the stylesheet's call too — `scroll-behavior` is set there under\n * `prefers-reduced-motion`, and `behavior: \"auto\"` means \"whatever that says\" rather than\n * \"instant\".\n */\n const go = (to: number) => {\n const node = track.current;\n if (!node) return;\n const item = node.querySelector<HTMLElement>(`[data-index=\"${to}\"]`);\n item?.scrollIntoView({ behavior: \"auto\", block: \"nearest\", inline: \"start\" });\n };\n\n const last = items.length - 1;\n\n return (\n <div {...rest} className={`carousel ${className ?? \"\"}`.trim()} data-peek={peek} data-controls={controls}>\n {/*\n * Before the items, not after them. A live region has to be in the document before the\n * text it will carry, or the reader is handed a region and its first message in the same\n * frame and nothing is announced at all.\n */}\n <VisuallyHidden>\n <span role=\"status\" aria-live=\"polite\" data-part=\"live\">\n {moved}\n </span>\n </VisuallyHidden>\n\n {/*\n * A Tab stop, because a scroller that a keyboard cannot reach is a row of items a\n * keyboard cannot read — the same reason `Tabs` gives its panel one. The arrow keys\n * then scroll it natively.\n *\n * `role=\"list\"` alongside it, because `list-style: none` makes Safari drop the list\n * semantics — the row stops being \"5개 목록\" and becomes five unrelated things.\n */}\n <ul className=\"carousel__track\" role=\"list\" ref={track} tabIndex={0} aria-label={label}>\n {items.map((item, index) => (\n <li\n className=\"carousel__item\"\n key={index}\n data-index={index}\n data-part=\"item\"\n data-current={index === current ? \"\" : undefined}\n >\n {item}\n </li>\n ))}\n </ul>\n\n {/*\n * One item has nowhere to go. The bar used to survive on `indicator` alone, so a single\n * item with dots drew one dot and two buttons that were both already at their end.\n */}\n {items.length < 2 ? null : (\n <div className=\"carousel__bar\">\n <IconButton\n icon={ChevronLeft}\n label={`${label} 이전`}\n variant=\"outline\"\n size=\"sm\"\n disabled={current === 0}\n onClick={() => go(current - 1)}\n data-part=\"previous\"\n />\n\n {indicator === \"dots\" ? (\n /*\n * `aria-hidden`, and the same fact in words beside it. A dot is a colour, and the\n * reader who cannot see it gets the sentence instead — which is also what the\n * reference screens do when they print \"4 / 5\" under the dots.\n */\n <p className=\"carousel__dots\" data-part=\"dots\">\n <span className=\"carousel__dots-marks\" aria-hidden=\"true\">\n {items.map((_, index) => (\n <span className=\"carousel__dot\" key={index} data-on={index === current ? \"\" : undefined} />\n ))}\n </span>\n <VisuallyHidden>{`${items.length}개 중 ${current + 1}번째`}</VisuallyHidden>\n </p>\n ) : indicator === \"count\" ? (\n <p className=\"carousel__count\" data-part=\"count\">\n <span aria-hidden=\"true\">{`${current + 1} / ${items.length}`}</span>\n <VisuallyHidden>{`${items.length}개 중 ${current + 1}번째`}</VisuallyHidden>\n </p>\n ) : null}\n\n <IconButton\n icon={ChevronRight}\n label={`${label} 다음`}\n variant=\"outline\"\n size=\"sm\"\n disabled={current === last}\n onClick={() => go(current + 1)}\n data-part=\"next\"\n />\n </div>\n )}\n </div>\n );\n}\n","import { useId, useLayoutEffect, useRef, useState } from \"react\";\nimport type { KeyboardEvent, ReactNode } from \"react\";\nimport * as RadixPopover from \"@radix-ui/react-popover\";\nimport { Check, ChevronDown, X } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport { useListbox } from \"../../common/Select/listbox\";\nimport { IconButton } from \"../../common/IconButton\";\nimport { VisuallyHidden } from \"../../common/VisuallyHidden\";\nimport { Button } from \"../../common/Button\";\nimport \"./Combobox.css\";\n\nexport type ComboboxOption = {\n value: string;\n label: string;\n /** A second line under the label — an email, a code, a count. */\n description?: string;\n disabled?: boolean;\n};\n\nexport type ComboboxProps = {\n options: ComboboxOption[];\n value: string | null;\n onValueChange: (value: string | null) => void;\n /** What is being chosen. \"담당자\", \"도시\". Names the field. */\n label: string;\n placeholder?: string;\n /** Hide the clear button when the host always needs a selected option. */\n clearable?: boolean;\n /** What to say when nothing matches. */\n emptyMessage?: string;\n /** Reports the search text. The host owns requests and response ordering. */\n onQueryChange?: (query: string) => void;\n /** Server results are already filtered and must not be filtered again by label. */\n filterMode?: \"local\" | \"server\";\n loading?: boolean;\n error?: ReactNode;\n onRetry?: () => void;\n /** Keep the selected label available when server results no longer contain it. */\n selectedOption?: ComboboxOption | null;\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n invalid?: boolean;\n id?: string;\n /* `Field` hands these down. They belong on the input, not on the wrapper `div` the rest\n * of the props land on — a hint tied to a `div` is a hint no reader ever hears. */\n \"aria-describedby\"?: string;\n \"aria-labelledby\"?: string;\n required?: boolean;\n className?: string;\n [key: `data-${string}`]: unknown;\n [key: `aria-${string}`]: unknown;\n};\n\nconst matches = (option: ComboboxOption, query: string) =>\n option.label.toLowerCase().includes(query.toLowerCase()) ||\n (option.description ?? \"\").toLowerCase().includes(query.toLowerCase());\n\n/**\n * A field that filters a list as you type.\n *\n * The focus never leaves the input. That is the whole shape of the pattern and the thing\n * most implementations get wrong: the reader is typing, so the caret has to stay where they\n * are typing, and the list is walked with `aria-activedescendant` rather than by moving\n * focus into it. A listbox that takes the focus is a listbox the reader cannot keep typing\n * into.\n *\n * Not a `Select`. A select is a short closed list the platform draws — a wheel on iOS, the\n * operating system's own keyboard search — and there is no reason to rebuild that. This is\n * for the list too long to scroll: two hundred cities, every person in a company.\n */\nexport function Combobox({\n options,\n value,\n onValueChange,\n label,\n placeholder,\n clearable = true,\n emptyMessage = \"맞는 것이 없습니다\",\n onQueryChange,\n filterMode = \"local\",\n loading,\n error,\n onRetry,\n selectedOption,\n size = \"md\",\n disabled,\n invalid,\n id,\n \"aria-describedby\": describedBy,\n \"aria-labelledby\": labelledBy,\n required,\n className,\n ...rest\n}: ComboboxProps) {\n const base = useId();\n const fieldId = id ?? `${base}-input`;\n const listId = `${base}-list`;\n\n const field = useRef<HTMLInputElement>(null);\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState(\"\");\n\n const chosen = options.find((option) => option.value === value)\n ?? (selectedOption?.value === value ? selectedOption : null);\n const hasSelection = Boolean(chosen);\n useLayoutEffect(() => {\n // Native required checks search text; this validity checks the committed selection.\n field.current?.setCustomValidity(required && !disabled && !hasSelection\n ? \"목록에서 항목을 선택해 주세요.\" : \"\");\n }, [required, disabled, hasSelection]);\n /* While the list is shut the field shows the chosen label; while it is open it shows what\n * the reader has typed, which is what they are filtering by. */\n const shown = open ? query : chosen?.label ?? \"\";\n\n const failed = Boolean(error);\n const found = failed || loading ? [] : options.filter((option) => (\n filterMode === \"local\" && open && query ? matches(option, query) : true\n ));\n\n const optionId = (option: ComboboxOption) => `${base}-option-${option.value}`;\n\n const rows = useListbox({ rows: found, locked: (option) => Boolean(option.disabled), id: optionId });\n const { active, setActive } = rows;\n\n const openWith = (text: string) => {\n setQuery(text);\n onQueryChange?.(text);\n setActive(0);\n setOpen(true);\n };\n\n const pick = (option: ComboboxOption) => {\n if (option.disabled) return;\n onValueChange(option.value);\n setOpen(false);\n setQuery(\"\");\n onQueryChange?.(\"\");\n field.current?.focus();\n };\n\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (disabled) return;\n /* The Enter that commits a Korean syllable is the same key event as the Enter that\n * chooses a row. Composing means the reader is still spelling a word. */\n if (event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229) return;\n\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n /* Closed, an arrow opens rather than moves: there is nothing on screen to move\n * through yet, and opening is what the reader asked for. */\n if (!open) return openWith(\"\");\n rows.move(event.key === \"ArrowDown\" ? 1 : -1);\n return;\n }\n\n if (!open) return;\n\n if (event.key === \"Enter\") {\n if (failed && onRetry) {\n event.preventDefault();\n onRetry();\n return;\n }\n const option = rows.activeRow;\n if (option) {\n event.preventDefault();\n pick(option);\n }\n return;\n }\n\n /*\n * Escape is not handled here. The popover already dismisses on it, and a second handler\n * clearing the query first produced two behaviours racing: the query emptied and the\n * list closed in the same keystroke, so the \"clear, then close\" it was meant to be never\n * happened. Closing is what a reader means by Escape, and closing already puts the\n * chosen value back in the field.\n */\n\n if (event.key === \"Home\" || event.key === \"End\") {\n event.preventDefault();\n if (event.key === \"Home\") rows.first();\n else rows.last();\n }\n };\n\n return (\n <RadixPopover.Root open={open && !disabled} onOpenChange={setOpen}>\n <div\n {...rest}\n className={`combobox ${className ?? \"\"}`.trim()}\n data-size={size}\n data-invalid={invalid ? \"\" : undefined}\n data-disabled={disabled ? \"\" : undefined}\n >\n <RadixPopover.Anchor asChild>\n <div className=\"combobox__field\" onPointerDown={event => {\n if (!disabled && event.target === event.currentTarget) {\n event.preventDefault();\n field.current?.focus();\n setOpen(true);\n }\n }}>\n <input\n ref={field}\n id={fieldId}\n className=\"combobox__input\"\n type=\"text\"\n /*\n * `list` rather than `both`: the field does not write the rest of the word into\n * itself as the reader types. Inline completion means the next keystroke\n * replaces a selection the reader cannot see, and in Korean it fights the\n * input method composing a syllable.\n */\n role=\"combobox\"\n aria-expanded={open}\n aria-controls={listId}\n aria-autocomplete=\"list\"\n aria-activedescendant={open ? rows.activeId : undefined}\n /* `aria-label` would beat a visible `<label>`, so it stands down when `Field`\n * has already pointed one at this input. */\n aria-label={labelledBy ? undefined : label}\n aria-labelledby={labelledBy}\n aria-describedby={describedBy}\n required={required && !hasSelection}\n aria-required={required || undefined}\n aria-busy={(!failed && loading) || undefined}\n aria-invalid={invalid || undefined}\n autoComplete=\"off\"\n value={shown}\n placeholder={placeholder}\n disabled={disabled}\n onChange={(event) => openWith(event.target.value)}\n onKeyDown={onKeyDown}\n /* Clicking the field opens the list. A combobox that only opens from the\n * chevron or the down arrow is one most readers will decide is a text box. */\n onClick={() => setOpen(true)}\n /* Selected, not just cleared. While the list is shut the input still shows the\n * chosen label, so a reader who arrives by Tab and types would otherwise be\n * adding letters to the end of a name they never meant to edit. */\n onFocus={(event) => {\n setQuery(\"\");\n event.target.select();\n }}\n onBlur={() => setOpen(false)}\n data-part=\"input\"\n />\n {chosen && clearable && !disabled ? (\n <IconButton\n icon={X}\n label={`${label} 선택 해제`}\n size=\"sm\"\n variant=\"ghost\"\n tone=\"neutral\"\n shape=\"circle\"\n onClick={() => {\n onValueChange(null);\n setQuery(\"\");\n field.current?.focus();\n }}\n data-part=\"clear\"\n />\n ) : null}\n <button\n type=\"button\"\n className=\"combobox__toggle\"\n tabIndex={-1}\n aria-label={open ? `${label} 목록 닫기` : `${label} 목록 열기`}\n disabled={disabled}\n /*\n * `onPointerDown`, not `onClick`: by the time a click lands the field's blur and\n * the popover's outside-press have both already shut the list, so toggling then\n * only ever reopened it — the button said \"close\" and opened.\n */\n onPointerDown={(event) => {\n event.preventDefault();\n setOpen((value) => !value);\n field.current?.focus();\n }}\n data-part=\"toggle\"\n >\n <Icon icon={ChevronDown} size=\"sm\" />\n </button>\n </div>\n </RadixPopover.Anchor>\n\n {/*\n * How many are left, said quietly. Filtering a list changes what is on screen and\n * says nothing at all otherwise — a reader typing into this would hear silence\n * whether they had narrowed it to three or to none.\n */}\n <VisuallyHidden>\n <span role=\"status\" aria-live=\"polite\" data-part=\"count\">\n {open && !failed ? (loading ? \"검색 중입니다\" : found.length > 0 ? `${found.length}개 결과` : emptyMessage) : \"\"}\n </span>\n </VisuallyHidden>\n\n <RadixPopover.Portal>\n <RadixPopover.Content\n className=\"combobox__panel\"\n side=\"bottom\"\n align=\"start\"\n sideOffset={4}\n collisionPadding={12}\n /* The focus stays in the field. A listbox that takes it is a listbox the reader\n * cannot keep typing into. */\n onOpenAutoFocus={(event) => event.preventDefault()}\n onCloseAutoFocus={(event) => event.preventDefault()}\n >\n {failed ? (\n <div className=\"combobox__state\" data-part=\"error\" onMouseDown={event => event.preventDefault()}>\n <p role=\"alert\">{error}</p>\n {onRetry ? <Button size=\"sm\" variant=\"outline\" onClick={onRetry} data-part=\"retry\">다시 시도</Button> : null}\n </div>\n ) : null}\n <ul className=\"combobox__list\" id={listId} role=\"listbox\" aria-label={label} aria-busy={(!failed && loading) || undefined}>\n {found.map((option, index) => (\n <li\n key={option.value}\n id={optionId(option)}\n className=\"combobox__option\"\n role=\"option\"\n aria-selected={option.value === value}\n aria-disabled={option.disabled || undefined}\n data-active={index === active ? \"\" : undefined}\n data-part={`option-${option.value}`}\n /* `onMouseDown` and not `onClick`: a click fires after the field's blur has\n * already shut the list, so the option is gone before the click lands. */\n onMouseDown={(event) => {\n event.preventDefault();\n pick(option);\n }}\n /* Disabled rows do not take the highlight. Letting the pointer park one\n * there left `aria-activedescendant` on a row Enter refuses to pick. */\n onMouseEnter={() => { if (!option.disabled) setActive(index); }}\n >\n <span className=\"combobox__mark\" aria-hidden=\"true\">\n {option.value === value ? <Icon icon={Check} size=\"xs\" /> : null}\n </span>\n <span className=\"combobox__text\">\n <span className=\"combobox__label\">{option.label}</span>\n {option.description ? (\n <span className=\"combobox__description\">{option.description}</span>\n ) : null}\n </span>\n </li>\n ))}\n {!failed && found.length === 0 ? (\n <li className=\"combobox__empty\" role=\"presentation\" data-part=\"empty\">\n {loading ? \"검색 중입니다\" : emptyMessage}\n </li>\n ) : null}\n </ul>\n </RadixPopover.Content>\n </RadixPopover.Portal>\n </div>\n </RadixPopover.Root>\n );\n}\n","import { useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport type { KeyboardEvent } from \"react\";\nimport * as RadixDialog from \"@radix-ui/react-dialog\";\nimport { Search } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport { useListbox } from \"../../common/Select/listbox\";\nimport { VisuallyHidden } from \"../../common/VisuallyHidden\";\nimport \"./CommandPalette.css\";\n\nexport type Command = {\n id: string;\n label: string;\n /** A second line, or the shortcut this command also answers to. */\n hint?: string;\n /** Heading this command files under. Commands with none are drawn without one, in place. */\n group?: string;\n icon?: LucideIcon;\n disabled?: boolean;\n run: () => void;\n};\n\nexport type CommandPaletteProps = {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n commands: Command[];\n /** Names the dialog. */\n label?: string;\n placeholder?: string;\n emptyMessage?: string;\n /**\n * Whether ⌘K / Ctrl+K opens it from anywhere on the page.\n *\n * On by default, because a palette that does not answer the shortcut is a dialog with a\n * filter in it. Off for the adopter who already owns their keyboard map.\n */\n hotkey?: boolean;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\nconst matches = (command: Command, query: string) => {\n const q = query.trim().toLowerCase();\n if (!q) return true;\n return `${command.label} ${command.hint ?? \"\"} ${command.group ?? \"\"}`.toLowerCase().includes(q);\n};\n\n/**\n * Everything the page can do, reachable by typing part of its name.\n *\n * Not a `Combobox`, and the reason is what happens on Enter. A combobox fills a field: it\n * has a value, that value survives closing, and choosing is the last step. A palette runs\n * something and keeps no value at all — the list is verbs, not options. Folding them\n * together would mean one component whose `onValueChange` sometimes means \"the field now\n * holds this\" and sometimes means \"this just happened.\"\n *\n * What is borrowed is the technique, which `Combobox` got right: the focus never leaves the\n * input. The reader is typing, so the caret stays where they are typing and the list is\n * walked with `aria-activedescendant`. A listbox that takes the focus to show which row is\n * active is a listbox that cannot be filtered any further.\n *\n * The filter resets on open and the active row resets on every keystroke. Both are the same\n * failure avoided twice: a palette that reopens holding the last query answers a shortcut\n * with a stale list, and one that keeps its active index after the list has changed under it\n * runs whatever moved into that position.\n */\nexport function CommandPalette({\n open,\n onOpenChange,\n commands,\n label = \"명령 팔레트\",\n placeholder = \"명령 검색\",\n emptyMessage = \"맞는 명령이 없습니다\",\n hotkey = true,\n className,\n ...rest\n}: CommandPaletteProps) {\n const base = useId();\n const listId = `${base}-list`;\n const input = useRef<HTMLInputElement>(null);\n /* Who had the focus before this opened, so it can be given back. Captured in\n * `onOpenAutoFocus`, which fires while the focus is still on whatever opened it. */\n const opener = useRef<HTMLElement | null>(null);\n const list = useRef<HTMLDivElement>(null);\n const [query, setQuery] = useState(\"\");\n\n const filtered = useMemo(() => commands.filter((command) => matches(command, query)), [commands, query]);\n /*\n * Grouped for the eye, flat for the keyboard.\n *\n * `found` stays the single ordered list the arrows walk, and the groups below are a view of\n * it. Walking a nested structure means two indices and a rule about what Down does at the\n * end of a group — and every implementation that has two indices eventually disagrees with\n * itself about which one `Enter` reads.\n */\n const groups = useMemo(() => {\n /*\n * Gathered by name, kept in order of first appearance. Folding only neighbours meant a\n * `commands` array that returned to a group later drew that heading a second time — and\n * gave two `<div>`s the same React key, which is a warning and a reconciliation bug on\n * top of a duplicated heading.\n */\n const out: { name: string | null; items: Command[] }[] = [];\n const byName = new Map<string | null, Command[]>();\n for (const command of filtered) {\n const name = command.group ?? null;\n const items = byName.get(name);\n if (items) items.push(command);\n else {\n const started = [command];\n byName.set(name, started);\n out.push({ name, items: started });\n }\n }\n return out;\n }, [filtered]);\n\n /* Flat, and in the order the groups below draw them — the arrows walk this list, so a row\n * gathered up into an earlier group has to move here too or Down skips over it. */\n const found = useMemo(() => groups.flatMap((group) => group.items), [groups]);\n\n const optionId = (command: Command) => `${base}-${command.id}`;\n\n /* A disabled command is locked, not merely dimmed: the arrows have to agree with `run`,\n * which refuses it. They did not, until the four lists were given one model. */\n const rows = useListbox({ rows: found, locked: (command) => Boolean(command.disabled), id: optionId });\n const { active, setActive } = rows;\n\n useEffect(() => {\n if (!open) return;\n setQuery(\"\");\n setActive(0);\n }, [open]);\n\n useEffect(() => {\n if (!hotkey) return;\n const onKey = (event: globalThis.KeyboardEvent) => {\n if (event.key !== \"k\" && event.key !== \"K\") return;\n if (!event.metaKey && !event.ctrlKey) return;\n /* Someone nearer the event already answered it, or an input method is mid-syllable. */\n if (event.defaultPrevented || event.isComposing || event.keyCode === 229) return;\n event.preventDefault();\n onOpenChange(!open);\n };\n document.addEventListener(\"keydown\", onKey);\n return () => document.removeEventListener(\"keydown\", onKey);\n }, [hotkey, open, onOpenChange]);\n\n /* `nearest`, so a row already on screen does not jump under the reader's eye. */\n useEffect(() => {\n if (!open) return;\n const row = rows.activeRow;\n if (!row) return;\n list.current?.querySelector(`#${CSS.escape(optionId(row))}`)?.scrollIntoView({ block: \"nearest\" });\n }, [active, found, open]);\n\n const run = (command: Command) => {\n if (command.disabled) return;\n onOpenChange(false);\n command.run();\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n /* The Enter that commits a Korean syllable is the same key event as the Enter that runs a\n * command, and here running one is not undoable. */\n if (event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229) return;\n if (rows.took(event)) return;\n\n if (event.key === \"Enter\") {\n const command = rows.activeRow;\n if (command) {\n event.preventDefault();\n run(command);\n }\n }\n };\n\n return (\n <RadixDialog.Root open={open} onOpenChange={onOpenChange}>\n <RadixDialog.Portal>\n <RadixDialog.Overlay className=\"command-palette__scrim\" />\n <RadixDialog.Content\n className={`command-palette ${className ?? \"\"}`.trim()}\n aria-label={label}\n /* The input, not the panel. Here the reader's first act is always to type, so\n * arriving anywhere else costs them a Tab they did not ask for — the opposite of\n * `Drawer`, where what they need first is to hear what the dialog is. */\n onOpenAutoFocus={(event) => {\n opener.current = document.activeElement as HTMLElement | null;\n event.preventDefault();\n input.current?.focus();\n }}\n /*\n * Back to whatever opened it. `Modal` and `Drawer` both own this for the reason\n * written out there — left to the library underneath it does not happen and the\n * reader is returned to `<body>`, so their next Tab starts the document over. This\n * was the one dialog in the layer without it: measured, Escape, a press on the\n * scrim and running a command all landed on `<body>`.\n *\n * Nothing to give back is a real case rather than a failure — the palette opened by\n * its hotkey from a page where nothing was focused has no place to return to, and\n * inventing one would move the reader somewhere they never were.\n */\n onCloseAutoFocus={(event) => {\n const back = opener.current;\n if (!back || back === document.body || !back.isConnected) return;\n event.preventDefault();\n back.focus();\n }}\n {...rest}\n >\n <RadixDialog.Title asChild>\n <VisuallyHidden>{label}</VisuallyHidden>\n </RadixDialog.Title>\n\n <div className=\"command-palette__search\">\n <Icon icon={Search} size=\"sm\" tone=\"muted\" />\n <input\n ref={input}\n className=\"command-palette__input\"\n type=\"text\"\n role=\"combobox\"\n aria-expanded\n aria-controls={listId}\n aria-activedescendant={rows.activeId}\n aria-label={placeholder}\n autoComplete=\"off\"\n placeholder={placeholder}\n value={query}\n onChange={(event) => {\n setQuery(event.target.value);\n setActive(0);\n }}\n onKeyDown={onKeyDown}\n data-part=\"input\"\n />\n </div>\n\n {/*\n * Outside the listbox, and mounted whether or not it has anything to say. A\n * `role=\"listbox\"` may only hold options and groups, and a live region created at\n * the same moment as its own text announces nothing in several screen readers.\n */}\n <p className=\"command-palette__empty\" role=\"status\" data-part=\"empty\">\n {found.length === 0 ? emptyMessage : \"\"}\n </p>\n\n <div className=\"command-palette__list\" id={listId} role=\"listbox\" aria-label={label} ref={list}>\n {groups.map((group) => (\n <div\n key={group.name ?? \"_\"}\n className=\"command-palette__group\"\n role=\"group\"\n aria-label={group.name ?? undefined}\n >\n {group.name ? <p className=\"command-palette__group-name\">{group.name}</p> : null}\n {group.items.map((command) => (\n <div\n key={command.id}\n id={optionId(command)}\n className=\"command-palette__item\"\n role=\"option\"\n aria-selected={rows.activeRow?.id === command.id}\n aria-disabled={command.disabled || undefined}\n data-active={rows.activeRow?.id === command.id ? \"\" : undefined}\n /*\n * `onMouseDown`, not `onClick`: pressing a row would otherwise take the\n * focus off the input first, and `run` is allowed to move the focus\n * itself — the click would then land after the page had already gone.\n */\n onMouseDown={(event) => {\n event.preventDefault();\n run(command);\n }}\n onMouseMove={() => {\n const index = found.findIndex((entry) => entry.id === command.id);\n if (index >= 0) setActive(index);\n }}\n >\n {command.icon ? <Icon icon={command.icon} size=\"sm\" tone=\"muted\" /> : null}\n <span className=\"command-palette__label\">{command.label}</span>\n {command.hint ? <span className=\"command-palette__hint\">{command.hint}</span> : null}\n </div>\n ))}\n </div>\n ))}\n </div>\n </RadixDialog.Content>\n </RadixDialog.Portal>\n </RadixDialog.Root>\n );\n}\n","/**\n * Dates as `YYYY-MM-DD` strings, never as `Date` objects.\n *\n * A `Date` is a moment in time, and a calendar day is not one. A date-only ISO string is read\n * as midnight UTC, so `new Date(\"2026-08-25\")` is the 25th in Seoul and the 24th in New York,\n * and a birthday that moves depending on where the reader is standing is the single most\n * common bug in every date picker ever written. The string is unambiguous; `Date` is used here\n * only to ask the calendar what weekday something falls on, and never to store anything.\n */\nexport type IsoDate = string;\n\nexport const toIso = (year: number, month: number, day: number): IsoDate =>\n `${String(year).padStart(4, \"0\")}-${String(month + 1).padStart(2, \"0\")}-${String(day).padStart(2, \"0\")}`;\n\nexport function parseIso(value: string | null | undefined): { year: number; month: number; day: number } | null {\n if (!value) return null;\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(value.trim());\n if (!match) return null;\n const year = Number(match[1]);\n const month = Number(match[2]) - 1;\n const day = Number(match[3]);\n if (month < 0 || month > 11) return null;\n if (day < 1 || day > daysInMonth(year, month)) return null;\n return { year, month, day };\n}\n\nexport const daysInMonth = (year: number, month: number) => new Date(year, month + 1, 0).getDate();\n\n/** 0 is Sunday, which is where a Korean calendar week starts. */\nexport const firstWeekday = (year: number, month: number) => new Date(year, month, 1).getDay();\n\n/** Adds days and rolls over months and years, which is why it is not `day + n`. */\nexport function shift(iso: IsoDate, days: number): IsoDate {\n const parsed = parseIso(iso);\n if (!parsed) return iso;\n const moved = new Date(parsed.year, parsed.month, parsed.day + days);\n return toIso(moved.getFullYear(), moved.getMonth(), moved.getDate());\n}\n\nexport function shiftMonths(iso: IsoDate, months: number): IsoDate {\n const parsed = parseIso(iso);\n if (!parsed) return iso;\n const target = parsed.month + months;\n const year = parsed.year + Math.floor(target / 12);\n const month = ((target % 12) + 12) % 12;\n /* Clamped, so 1월 31일 plus a month is the last day of February rather than the third of\n * March — which is what a reader pressing \"next month\" means. */\n const day = Math.min(parsed.day, daysInMonth(year, month));\n return toIso(year, month, day);\n}\n\nexport function todayIso(): IsoDate {\n const now = new Date();\n return toIso(now.getFullYear(), now.getMonth(), now.getDate());\n}\n\nconst LONG = new Intl.DateTimeFormat(\"ko-KR\", { dateStyle: \"full\" });\nconst SHORT = new Intl.DateTimeFormat(\"ko-KR\", { year: \"numeric\", month: \"long\", day: \"numeric\" });\nconst MONTH = new Intl.DateTimeFormat(\"ko-KR\", { year: \"numeric\", month: \"long\" });\n\n/* `null` rather than an assertion. A value straight out of a database can be `\"2026-13-01\"`\n * or `\"2026/08/25\"`, and the formatters below have somewhere to fall back to; a thrown\n * `TypeError` inside a render does not. */\nconst asDate = (iso: IsoDate) => {\n const parsed = parseIso(iso);\n return parsed ? new Date(parsed.year, parsed.month, parsed.day) : null;\n};\n\n/** \"2026년 8월 25일 화요일\" — the whole date, for the button's accessible name. */\nexport const formatLong = (iso: IsoDate) => {\n const date = asDate(iso);\n return date ? LONG.format(date) : iso;\n};\n/** \"2026년 8월 25일\" — what goes in the field. Unreadable values are shown as they came. */\nexport const formatShort = (iso: IsoDate) => {\n const date = asDate(iso);\n return date ? SHORT.format(date) : iso;\n};\n/** \"2026년 8월\" — the caption over the grid. */\nexport const formatMonth = (year: number, month: number) => MONTH.format(new Date(year, month, 1));\n\n/**\n * Reads what a reader typed, in the shapes they actually type.\n *\n * `2026-08-25`, `2026.8.25`, `20260825` and `2026년 8월 25일` all mean the same day, and a\n * field that accepts only the first is a field most people fail on their first attempt.\n */\nexport function parseTyped(text: string): IsoDate | null {\n const digits = text.replace(/\\D/g, \"\");\n if (digits.length === 8) {\n const iso = `${digits.slice(0, 4)}-${digits.slice(4, 6)}-${digits.slice(6, 8)}`;\n return parseIso(iso) ? iso : null;\n }\n const parts = text.split(/\\D+/).filter(Boolean).map(Number);\n if (parts.length === 3 && parts[0] > 999) {\n const iso = toIso(parts[0], parts[1] - 1, parts[2]);\n return parseIso(iso) ? iso : null;\n }\n return null;\n}\n\n/** Native form validation follows the committed date, including an unfinished edit. */\nexport function dateInputMessage(\n text: string,\n value: IsoDate | null,\n min: IsoDate | undefined,\n max: IsoDate | undefined,\n required: boolean | undefined,\n): string {\n const parsed = text.trim() ? parseTyped(text) : null;\n if (text.trim() && !parsed) return \"올바른 날짜를 입력해 주세요.\";\n if (parsed && ((min && parsed < min) || (max && parsed > max))) {\n return \"선택 가능한 날짜 범위 안에서 입력해 주세요.\";\n }\n if (parsed !== value) return \"Enter를 누르거나 입력 필드 밖으로 이동해 날짜를 확정해 주세요.\";\n if (required && !value) return \"날짜를 선택해 주세요.\";\n return \"\";\n}\n\n/** 0 for Sunday. Used for the Home and End keys, which reach the ends of the week. */\nexport const weekdayOf = (iso: IsoDate) => {\n const parsed = parseIso(iso);\n if (!parsed) return 0;\n return new Date(parsed.year, parsed.month, parsed.day).getDay();\n};\n\n/**\n * How many days a range covers, counting both ends — the number a reader means by \"6일\".\n *\n * Local `Date`s and a division, not a subtraction of two ISO strings: months and years are\n * not fixed widths, and a range that crosses a daylight-saving boundary is still a whole\n * number of calendar days. Rounded for that reason.\n */\nexport function daysBetween(from: IsoDate, to: IsoDate): number {\n const a = parseIso(from);\n const b = parseIso(to);\n if (!a || !b) return 0;\n const start = new Date(a.year, a.month, a.day).getTime();\n const end = new Date(b.year, b.month, b.day).getTime();\n return Math.round((end - start) / 86_400_000) + 1;\n}\n\n/** The first day of the month `iso` falls in. */\nexport function startOfMonth(iso: IsoDate): IsoDate {\n const parsed = parseIso(iso);\n return parsed ? toIso(parsed.year, parsed.month, 1) : iso;\n}\n\n/** The last day of that month — 28, 29, 30 or 31, asked rather than assumed. */\nexport function endOfMonth(iso: IsoDate): IsoDate {\n const parsed = parseIso(iso);\n return parsed ? toIso(parsed.year, parsed.month, daysInMonth(parsed.year, parsed.month)) : iso;\n}\n","import type { KeyboardEvent, RefObject } from \"react\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { IconButton } from \"../../common/IconButton\";\nimport { VisuallyHidden } from \"../../common/VisuallyHidden\";\nimport {\n firstWeekday,\n formatLong,\n formatMonth,\n parseIso,\n shift,\n shiftMonths,\n toIso,\n weekdayOf,\n type IsoDate,\n} from \"./dates\";\nimport \"./DatePicker.css\";\n\n/**\n * The month grid, owned by nobody and used by two.\n *\n * `DatePicker` had all of this inside it and `DateRangePicker` needed the same thing: the\n * same six rows, the same one tab stop, the same `aria-current`, the same locked days. A\n * second copy would have been a second place to fix every one of those, and the copy that\n * nobody remembers is the one that stays broken — so the grid moved here and both render it.\n *\n * It holds no state. The cursor, the selection and the month all live in the caller, because\n * the two callers disagree about what a selection is: one date, or a pair with a middle.\n */\nexport type CalendarMark = {\n /** An end of the selection — filled, and `aria-selected` on its cell. */\n chosen?: boolean;\n /** Which end, when there are two. Drawn as a half-round fill. */\n edge?: \"start\" | \"end\";\n /** Between the two ends. */\n inRange?: boolean;\n /** The range that would be chosen if the reader committed here. */\n preview?: boolean;\n};\n\nexport type CalendarProps = {\n /** The day the arrow keys are standing on. Also decides which month is drawn. */\n cursor: IsoDate;\n /**\n * `key` means the reader moved it and focus has to follow; `page` means the month buttons\n * moved it and focus must stay on the button that was pressed; `focus` is the grid telling\n * the caller where focus already went.\n */\n onCursorChange: (iso: IsoDate, cause: \"key\" | \"page\" | \"focus\") => void;\n onChoose: (iso: IsoDate) => void;\n today: IsoDate;\n /** The caption's id, so the grid is named by the month it shows. */\n captionId: string;\n gridRef?: RefObject<HTMLTableElement | null>;\n blocked?: (iso: IsoDate) => boolean;\n mark?: (iso: IsoDate) => CalendarMark;\n /**\n * Appended to the day's accessible name. This is how a range says which end a day is\n * without saying it in colour.\n */\n describe?: (iso: IsoDate) => string | undefined;\n onDayEnter?: (iso: IsoDate) => void;\n onGridLeave?: () => void;\n};\n\nconst WEEKDAYS = [\n { short: \"일\", long: \"일요일\" },\n { short: \"월\", long: \"월요일\" },\n { short: \"화\", long: \"화요일\" },\n { short: \"수\", long: \"수요일\" },\n { short: \"목\", long: \"목요일\" },\n { short: \"금\", long: \"금요일\" },\n { short: \"토\", long: \"토요일\" },\n];\n\nexport function Calendar({\n cursor,\n onCursorChange,\n onChoose,\n today,\n captionId,\n gridRef,\n blocked,\n mark,\n describe,\n onDayEnter,\n onGridLeave,\n}: CalendarProps) {\n const view = parseIso(cursor) ?? parseIso(today)!;\n const locked = (iso: IsoDate) => Boolean(blocked?.(iso));\n\n const onGridKeyDown = (event: KeyboardEvent<HTMLTableElement>) => {\n const moves: Record<string, () => IsoDate> = {\n ArrowRight: () => shift(cursor, 1),\n ArrowLeft: () => shift(cursor, -1),\n ArrowDown: () => shift(cursor, 7),\n ArrowUp: () => shift(cursor, -7),\n PageDown: () => shiftMonths(cursor, 1),\n PageUp: () => shiftMonths(cursor, -1),\n Home: () => shift(cursor, -weekdayOf(cursor)),\n End: () => shift(cursor, 6 - weekdayOf(cursor)),\n };\n const next = moves[event.key];\n if (!next) return;\n event.preventDefault();\n onCursorChange(next(), \"key\");\n };\n\n /* Six rows always, so the panel does not change height as the reader pages through months\n * and the buttons do not move out from under the pointer. */\n const lead = firstWeekday(view.year, view.month);\n const cells: IsoDate[] = Array.from({ length: 42 }, (_, index) =>\n shift(toIso(view.year, view.month, 1), index - lead),\n );\n const weeks = Array.from({ length: 6 }, (_, row) => cells.slice(row * 7, row * 7 + 7));\n\n return (\n <div className=\"calendar\" onPointerLeave={onGridLeave}>\n <div className=\"calendar__head\">\n <IconButton\n icon={ChevronLeft}\n label=\"이전 달\"\n size=\"sm\"\n variant=\"ghost\"\n tone=\"neutral\"\n onClick={() => onCursorChange(shiftMonths(cursor, -1), \"page\")}\n data-part=\"previous\"\n />\n {/*\n * The caption is a live region: paging the month changes the whole grid and says\n * nothing otherwise, so a reader pressing \"이전 달\" would hear silence.\n */}\n <p className=\"calendar__caption\" id={captionId} aria-live=\"polite\" data-part=\"caption\">\n {formatMonth(view.year, view.month)}\n </p>\n <IconButton\n icon={ChevronRight}\n label=\"다음 달\"\n size=\"sm\"\n variant=\"ghost\"\n tone=\"neutral\"\n onClick={() => onCursorChange(shiftMonths(cursor, 1), \"page\")}\n data-part=\"next\"\n />\n </div>\n\n <table\n ref={gridRef}\n className=\"calendar__grid\"\n role=\"grid\"\n aria-labelledby={captionId}\n onKeyDown={onGridKeyDown}\n >\n <thead>\n <tr>\n {WEEKDAYS.map((day) => (\n <th key={day.short} scope=\"col\" className=\"calendar__weekday\">\n <span aria-hidden=\"true\">{day.short}</span>\n <VisuallyHidden>{day.long}</VisuallyHidden>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {weeks.map((week) => (\n <tr key={week[0]}>\n {week.map((iso) => {\n const day = parseIso(iso)!;\n const outside = day.month !== view.month;\n const state = mark?.(iso) ?? {};\n const said = describe?.(iso);\n return (\n <td\n key={iso}\n role=\"gridcell\"\n className=\"calendar__cell\"\n aria-selected={state.chosen || state.inRange || undefined}\n data-in-range={state.inRange ? \"\" : undefined}\n data-preview={state.preview ? \"\" : undefined}\n data-edge={state.edge}\n >\n <button\n type=\"button\"\n className=\"calendar__day\"\n /* One tab stop for the whole grid: the arrow keys are the way through\n * it, and Tab is the way out. */\n tabIndex={iso === cursor ? 0 : -1}\n data-focusable={iso === cursor ? \"true\" : undefined}\n data-outside={outside ? \"\" : undefined}\n data-today={iso === today ? \"\" : undefined}\n data-chosen={state.chosen ? \"\" : undefined}\n data-edge={state.edge}\n aria-current={iso === today ? \"date\" : undefined}\n aria-label={said ? `${formatLong(iso)}, ${said}` : formatLong(iso)}\n disabled={locked(iso)}\n onClick={() => {\n if (locked(iso)) return;\n onChoose(iso);\n }}\n onFocus={() => onCursorChange(iso, \"focus\")}\n onPointerEnter={() => onDayEnter?.(iso)}\n data-part={`day-${iso}`}\n >\n <span aria-hidden=\"true\">{day.day}</span>\n </button>\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n","import { useEffect, useId, useLayoutEffect, useRef, useState } from \"react\";\nimport * as RadixPopover from \"@radix-ui/react-popover\";\nimport { CalendarDays } from \"lucide-react\";\nimport { IconButton } from \"../../common/IconButton\";\nimport { VisuallyHidden } from \"../../common/VisuallyHidden\";\nimport { Calendar } from \"./Calendar\";\nimport { dateInputMessage, formatShort, parseTyped, todayIso, type IsoDate } from \"./dates\";\nimport \"./DatePicker.css\";\n\nexport type DatePickerProps = {\n /** `YYYY-MM-DD`, or null. Never a `Date` — see the note at the top of `dates.ts`. */\n value: IsoDate | null;\n onValueChange: (value: IsoDate | null) => void;\n /** What date this is. \"출발일\", \"마감일\". Names the field. */\n label: string;\n /** Earliest and latest selectable, both `YYYY-MM-DD`. */\n min?: IsoDate;\n max?: IsoDate;\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n invalid?: boolean;\n id?: string;\n /* `Field` hands these down. They belong on the input, not on the wrapper `div` the rest of\n * the props land on. */\n \"aria-describedby\"?: string;\n \"aria-labelledby\"?: string;\n required?: boolean;\n className?: string;\n [key: `data-${string}`]: unknown;\n [key: `aria-${string}`]: unknown;\n};\n\n/**\n * A date, typed or picked.\n *\n * Not `<input type=\"date\">`, and that is a decision rather than an oversight. The native\n * control is excellent on a phone and unusable as a design element on a desktop: its picker\n * cannot be styled at all and its layout differs in every browser. What it does well —\n * taking a typed date in whatever shape the reader types it — is copied rather than thrown\n * away: `2026-08-25`, `2026.8.25`, `20260825` and `2026년 8월 25일` all mean the same day.\n *\n * The calendar is a real `<table role=\"grid\">`, because a date grid *is* a grid: a reader\n * moves through it by row and column and every screen reader already knows how. One day is\n * in the tab order, so Tab leaves the calendar instead of walking through forty-two buttons.\n */\nexport function DatePicker({\n value,\n onValueChange,\n label,\n min,\n max,\n size = \"md\",\n disabled,\n invalid,\n id,\n \"aria-describedby\": describedBy,\n \"aria-labelledby\": labelledBy,\n required,\n className,\n ...rest\n}: DatePickerProps) {\n const base = useId();\n const fieldId = id ?? `${base}-input`;\n const captionId = `${base}-caption`;\n const today = todayIso();\n\n const [open, setOpen] = useState(false);\n const [typed, setTyped] = useState<string | null>(null);\n /*\n * The day the arrow keys are on, which is not the chosen day: a reader may walk the grid\n * without choosing anything, and the calendar has to remember where they got to.\n */\n const [cursor, setCursor] = useState<IsoDate>(value ?? today);\n const grid = useRef<HTMLTableElement>(null);\n const field = useRef<HTMLInputElement>(null);\n const wanted = useRef(false);\n\n /*\n * Focus follows the cursor only when a key moved it — never when the component merely\n * re-renders, which would drag the reader back into the grid from wherever they went.\n *\n * This handles the arrow keys and nothing else. Opening is handled in `onOpenAutoFocus`\n * below, because on the render where `open` first becomes true the panel is portalled and\n * has not mounted yet: this effect finds no grid, and there is no later render of *this*\n * component to try again on.\n */\n useEffect(() => {\n if (!open || !wanted.current) return;\n const day = grid.current?.querySelector<HTMLButtonElement>('[data-focusable=\"true\"]');\n if (!day) return;\n wanted.current = false;\n day.focus();\n });\n\n const shown = typed ?? (value ? formatShort(value) : \"\");\n const blocked = (iso: IsoDate) => (min !== undefined && iso < min) || (max !== undefined && iso > max);\n useLayoutEffect(() => {\n field.current?.setCustomValidity(disabled ? \"\" : dateInputMessage(shown, value, min, max, required));\n }, [shown, value, min, max, required, disabled]);\n\n const choose = (iso: IsoDate) => {\n if (blocked(iso)) return;\n onValueChange(iso);\n setTyped(null);\n setCursor(iso);\n setOpen(false);\n };\n\n const commit = (text: string) => {\n const parsed = parseTyped(text);\n if (text.trim() === \"\") {\n onValueChange(null);\n setTyped(null);\n return;\n }\n if (parsed && !blocked(parsed)) {\n onValueChange(parsed);\n setCursor(parsed);\n setTyped(null);\n return;\n }\n /* Left as typed rather than silently reverted. A field that throws away what a reader\n * wrote, without saying why, is one they will write into again the same way. */\n setTyped(text);\n };\n\n return (\n <RadixPopover.Root open={open && !disabled} onOpenChange={setOpen}>\n <div\n {...rest}\n className={`date-picker ${className ?? \"\"}`.trim()}\n data-size={size}\n data-invalid={invalid ? \"\" : undefined}\n data-disabled={disabled ? \"\" : undefined}\n >\n <RadixPopover.Anchor asChild>\n <div className=\"date-picker__field\" onPointerDown={event => {\n if (disabled || event.target !== event.currentTarget) return;\n event.preventDefault();\n field.current?.focus();\n }}>\n <input\n ref={field}\n id={fieldId}\n className=\"date-picker__input\"\n type=\"text\"\n inputMode=\"numeric\"\n autoComplete=\"off\"\n /* `aria-label` stands down when `Field` has already pointed a visible one here. */\n aria-label={labelledBy ? undefined : label}\n aria-labelledby={labelledBy}\n /* `Field`'s hint and error, in front of the format note — they belong on the\n * input, and `...rest` would have left them on the wrapper `div`. */\n aria-describedby={[describedBy, `${base}-format`].filter(Boolean).join(\" \")}\n required={required}\n aria-invalid={invalid || undefined}\n placeholder=\"2026년 8월 25일\"\n value={shown}\n disabled={disabled}\n onChange={(event) => setTyped(event.target.value)}\n onBlur={(event) => commit(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n event.preventDefault();\n commit(event.currentTarget.value);\n }\n }}\n data-part=\"input\"\n />\n <VisuallyHidden>\n <span id={`${base}-format`}>\n 연월일 순으로 적습니다. 2026-08-25, 2026.8.25, 20260825 모두 됩니다.\n </span>\n </VisuallyHidden>\n <RadixPopover.Trigger asChild>\n <IconButton\n icon={CalendarDays}\n label={`${label} 달력 열기`}\n size=\"sm\"\n variant=\"ghost\"\n tone=\"neutral\"\n disabled={disabled}\n onClick={() => {\n setCursor(value ?? today);\n wanted.current = true;\n }}\n data-part=\"open\"\n />\n </RadixPopover.Trigger>\n </div>\n </RadixPopover.Anchor>\n\n <RadixPopover.Portal>\n <RadixPopover.Content\n className=\"date-picker__panel\"\n side=\"bottom\"\n align=\"start\"\n sideOffset={6}\n collisionPadding={{ top: 12, bottom: 12, left: 0, right: 0 }}\n aria-label={`${label} 달력`}\n /* Fired once the panel is in the document, which is the first moment the grid\n * exists to be focused into. */\n onOpenAutoFocus={(event) => {\n event.preventDefault();\n wanted.current = false;\n grid.current?.querySelector<HTMLButtonElement>('[data-focusable=\"true\"]')?.focus();\n }}\n >\n <Calendar\n cursor={cursor}\n onCursorChange={(iso, cause) => {\n setCursor(iso);\n /* Only a key press drags focus along; the month buttons keep it, so a reader\n * paging through months is not thrown into the grid on every press. */\n if (cause === \"key\") wanted.current = true;\n }}\n onChoose={choose}\n today={today}\n captionId={captionId}\n gridRef={grid}\n blocked={blocked}\n mark={(iso) => ({ chosen: iso === value })}\n />\n\n <div className=\"date-picker__foot\">\n <button\n type=\"button\"\n className=\"date-picker__shortcut\"\n onClick={() => choose(today)}\n disabled={blocked(today)}\n data-part=\"today\"\n >\n 오늘\n </button>\n <button\n type=\"button\"\n className=\"date-picker__shortcut\"\n onClick={() => {\n onValueChange(null);\n setTyped(null);\n setOpen(false);\n }}\n data-part=\"clear\"\n >\n 지우기\n </button>\n </div>\n </RadixPopover.Content>\n </RadixPopover.Portal>\n </div>\n </RadixPopover.Root>\n );\n}\n","import { useEffect, useId, useLayoutEffect, useRef, useState } from \"react\";\nimport * as RadixPopover from \"@radix-ui/react-popover\";\nimport { CalendarRange } from \"lucide-react\";\nimport { IconButton } from \"../../common/IconButton\";\nimport { VisuallyHidden } from \"../../common/VisuallyHidden\";\nimport { Calendar } from \"../DatePicker/Calendar\";\nimport {\n dateInputMessage,\n daysBetween,\n endOfMonth,\n formatShort,\n parseTyped,\n shift,\n startOfMonth,\n todayIso,\n type IsoDate,\n} from \"../DatePicker/dates\";\nimport \"./DateRangePicker.css\";\n\nexport type DateRange = {\n /** `YYYY-MM-DD`, or null. Never a `Date` — see the note at the top of `dates.ts`. */\n start: IsoDate | null;\n end: IsoDate | null;\n};\n\nexport type DateRangePickerProps = {\n value: DateRange;\n onValueChange: (value: DateRange) => void;\n /** What period this is. \"숙박 기간\", \"조회 기간\". Names both boxes and the calendar. */\n label: string;\n /** Earliest and latest selectable, both `YYYY-MM-DD`. */\n min?: IsoDate;\n max?: IsoDate;\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n invalid?: boolean;\n id?: string;\n /* `Field` hands these down. They belong on the boxes, not on the wrapper `div` the rest of\n * the props land on. */\n \"aria-describedby\"?: string;\n \"aria-labelledby\"?: string;\n required?: boolean;\n className?: string;\n [key: `data-${string}`]: unknown;\n [key: `aria-${string}`]: unknown;\n};\n\n/** The two ends in order, whichever order they were given in. */\nconst ordered = (a: IsoDate, b: IsoDate): DateRange => (a <= b ? { start: a, end: b } : { start: b, end: a });\n\nconst between = (iso: IsoDate, from: IsoDate, to: IsoDate) => iso >= from && iso <= to;\n\n/**\n * A period: two dates that belong together.\n *\n * The calendar is `DatePicker`'s calendar — the same `Calendar`, six rows, one tab stop,\n * `aria-current` on today, the same locked days. Nothing about a range changes what a month\n * looks like, and a second copy of that grid would be a second place to fix every one of\n * those things.\n *\n * What a range adds is a middle. Three facts have to reach a reader — where it starts, where\n * it ends, and what is inside — and a band of colour carries none of them to anybody who\n * cannot see it. So each day says which part it is in its accessible name, and a live line\n * under the grid says the whole range in words as it is being built.\n */\nexport function DateRangePicker({\n value,\n onValueChange,\n label,\n min,\n max,\n size = \"md\",\n disabled,\n invalid,\n id,\n \"aria-describedby\": describedBy,\n \"aria-labelledby\": labelledBy,\n required,\n className,\n ...rest\n}: DateRangePickerProps) {\n const base = useId();\n const startId = id ?? `${base}-start`;\n const endId = `${base}-end`;\n const captionId = `${base}-caption`;\n const nameId = `${base}-label`;\n const startWordId = `${base}-start-word`;\n const endWordId = `${base}-end-word`;\n const formatId = `${base}-format`;\n const today = todayIso();\n\n const [open, setOpen] = useState(false);\n /** What is in a box while it is being typed into, before it means anything. */\n const [typed, setTyped] = useState<{ start?: string; end?: string }>({});\n const [cursor, setCursor] = useState<IsoDate>(value.start ?? today);\n /** The day the pointer is over. Null the whole time a reader is on the keyboard. */\n const [hovered, setHovered] = useState<IsoDate | null>(null);\n const grid = useRef<HTMLTableElement>(null);\n const startField = useRef<HTMLInputElement>(null);\n const endField = useRef<HTMLInputElement>(null);\n const wanted = useRef(false);\n\n /* Focus follows the cursor only when a key moved it — never on a re-render, which would\n * drag the reader back into the grid from wherever they went. */\n useEffect(() => {\n if (!open || !wanted.current) return;\n const day = grid.current?.querySelector<HTMLButtonElement>('[data-focusable=\"true\"]');\n if (!day) return;\n wanted.current = false;\n day.focus();\n });\n\n const blocked = (iso: IsoDate) => (min !== undefined && iso < min) || (max !== undefined && iso > max);\n const shownStart = typed.start ?? (value.start ? formatShort(value.start) : \"\");\n const shownEnd = typed.end ?? (value.end ? formatShort(value.end) : \"\");\n useLayoutEffect(() => {\n startField.current?.setCustomValidity(disabled ? \"\" : dateInputMessage(shownStart, value.start, min, max, required));\n endField.current?.setCustomValidity(disabled ? \"\" : dateInputMessage(shownEnd, value.end, min, max, required));\n }, [shownStart, shownEnd, value.start, value.end, min, max, required, disabled]);\n\n /*\n * A range is built in two presses, so between them the component is in a state the value\n * itself describes: a start and no end. Derived rather than stored — a second copy of\n * \"which press is next\" is a second thing that can disagree with the value.\n */\n const awaitingEnd = value.start !== null && value.end === null;\n\n /* Where the range would end if the reader committed where they are standing. The cursor,\n * not the pointer, when there is no pointer — which is what makes the preview a keyboard\n * feature rather than a hover feature. */\n const tentative = awaitingEnd ? (hovered ?? cursor) : null;\n const preview = tentative && value.start ? ordered(value.start, tentative) : null;\n\n const choose = (iso: IsoDate) => {\n if (blocked(iso)) return;\n setTyped({});\n setCursor(iso);\n if (!awaitingEnd || !value.start) {\n /* First press: the start, and the end is cleared so the panel stays open for it. */\n onValueChange({ start: iso, end: null });\n return;\n }\n /* Second press. An end before the start is not an error — it is a reader who picked the\n * two days in the order that made sense to them, and it means the same period either\n * way, so it is turned round rather than refused. */\n onValueChange(ordered(value.start, iso));\n setHovered(null);\n setOpen(false);\n };\n\n const commit = (which: \"start\" | \"end\", text: string) => {\n const other = which === \"start\" ? value.end : value.start;\n if (text.trim() === \"\") {\n onValueChange(which === \"start\" ? { start: null, end: value.end } : { start: value.start, end: null });\n setTyped((was) => ({ ...was, [which]: undefined }));\n return;\n }\n const parsed = parseTyped(text);\n if (parsed && !blocked(parsed)) {\n onValueChange(other ? ordered(parsed, other) : which === \"start\" ? { start: parsed, end: null } : { start: null, end: parsed });\n setCursor(parsed);\n setTyped((was) => ({ ...was, [which]: undefined }));\n return;\n }\n /* Left as typed rather than silently reverted. A box that throws away what a reader\n * wrote, without saying why, is one they will write into again the same way. */\n setTyped((was) => ({ ...was, [which]: text }));\n };\n\n const apply = (range: DateRange) => {\n if (range.start && blocked(range.start)) return;\n if (range.end && blocked(range.end)) return;\n onValueChange(range);\n setTyped({});\n setHovered(null);\n if (range.start) setCursor(range.start);\n setOpen(false);\n };\n\n /* Korean, and fixed. A caller who needs other periods writes their own buttons beside the\n * field — these are the four that mean the same thing in every product that has them. */\n const shortcuts: Array<{ id: string; text: string; range: DateRange }> = [\n { id: \"today\", text: \"오늘\", range: { start: today, end: today } },\n { id: \"last-7\", text: \"지난 7일\", range: { start: shift(today, -6), end: today } },\n { id: \"this-month\", text: \"이번 달\", range: { start: startOfMonth(today), end: endOfMonth(today) } },\n ];\n\n const mark = (iso: IsoDate) => {\n const isStart = iso === value.start;\n const isEnd = iso === value.end;\n const inside = value.start && value.end ? between(iso, value.start, value.end) : false;\n const inPreview = preview ? between(iso, preview.start!, preview.end!) : false;\n return {\n chosen: isStart || isEnd,\n edge: isStart ? (\"start\" as const) : isEnd ? (\"end\" as const) : undefined,\n inRange: inside && !isStart && !isEnd,\n preview: inPreview && !isStart && !isEnd,\n };\n };\n\n /*\n * The same three facts as the band, in words.\n *\n * `aria-selected` says a day is part of the selection and stops there; it cannot say which\n * end. Without this a reader walking the grid hears \"선택됨\" on eight days in a row and has\n * no way to tell the first from the last from the middle.\n */\n const describe = (iso: IsoDate) => {\n if (iso === value.start && iso === value.end) return \"기간의 시작이자 끝\";\n if (iso === value.start) return \"기간 시작\";\n if (iso === value.end) return \"기간 끝\";\n if (value.start && value.end && between(iso, value.start, value.end)) return \"기간 안\";\n if (preview && iso === tentative) return \"여기까지 고르면 기간 끝\";\n if (preview && between(iso, preview.start!, preview.end!)) return \"고르면 기간 안\";\n return undefined;\n };\n\n const summary = (() => {\n if (value.start && value.end) {\n return `${formatShort(value.start)}부터 ${formatShort(value.end)}까지 ${daysBetween(value.start, value.end)}일`;\n }\n if (value.start && preview?.end) {\n if (value.start === preview.end) return `${formatShort(value.start)}부터 종료일을 고르세요`;\n return `${formatShort(preview.start!)}부터 ${formatShort(preview.end)}까지 고르면 ${daysBetween(preview.start!, preview.end)}일입니다`;\n }\n if (value.start) return `${formatShort(value.start)}부터 종료일을 고르세요`;\n return \"시작일을 고르세요\";\n })();\n\n const box = (which: \"start\" | \"end\") => {\n const own = which === \"start\" ? value.start : value.end;\n const draft = typed[which];\n return {\n id: which === \"start\" ? startId : endId,\n value: draft ?? (own ? formatShort(own) : \"\"),\n \"aria-labelledby\": `${labelledBy ?? nameId} ${which === \"start\" ? startWordId : endWordId}`,\n \"aria-describedby\": [describedBy, formatId].filter(Boolean).join(\" \"),\n };\n };\n\n return (\n <RadixPopover.Root open={open && !disabled} onOpenChange={setOpen}>\n <div\n {...rest}\n className={`date-range-picker ${className ?? \"\"}`.trim()}\n data-size={size}\n data-invalid={invalid ? \"\" : undefined}\n data-disabled={disabled ? \"\" : undefined}\n >\n <VisuallyHidden>\n <span id={nameId}>{label}</span>\n <span id={startWordId}>시작일</span>\n <span id={endWordId}>종료일</span>\n <span id={formatId}>\n 연월일 순으로 적습니다. 2026-08-25, 2026.8.25, 20260825 모두 됩니다. 끝이 시작보다\n 앞서면 두 날짜를 서로 바꿉니다.\n </span>\n </VisuallyHidden>\n\n <RadixPopover.Anchor asChild>\n <div className=\"date-range-picker__field\" data-part=\"field\" onPointerDown={event => {\n if (disabled) return;\n const target = event.target as HTMLElement;\n if (target !== event.currentTarget && !target.classList.contains(\"date-range-picker__tilde\")) return;\n const start = startField.current;\n const end = endField.current;\n if (!start || !end) return;\n const startBox = start.getBoundingClientRect();\n const endBox = end.getBoundingClientRect();\n const distance = (box: DOMRect) => Math.abs(event.clientX - (box.left + box.right) / 2);\n event.preventDefault();\n (distance(startBox) <= distance(endBox) ? start : end).focus();\n }}>\n <input\n {...box(\"start\")}\n ref={startField}\n className=\"date-range-picker__input\"\n type=\"text\"\n inputMode=\"numeric\"\n autoComplete=\"off\"\n required={required}\n aria-invalid={invalid || undefined}\n placeholder=\"시작일\"\n disabled={disabled}\n onChange={(event) => setTyped((was) => ({ ...was, start: event.target.value }))}\n onBlur={(event) => commit(\"start\", event.target.value)}\n onKeyDown={(event) => {\n if (event.key !== \"Enter\") return;\n event.preventDefault();\n commit(\"start\", event.currentTarget.value);\n }}\n data-part=\"start\"\n />\n <span className=\"date-range-picker__tilde\" aria-hidden=\"true\">\n ~\n </span>\n <input\n {...box(\"end\")}\n ref={endField}\n className=\"date-range-picker__input\"\n type=\"text\"\n inputMode=\"numeric\"\n autoComplete=\"off\"\n required={required}\n aria-invalid={invalid || undefined}\n placeholder=\"종료일\"\n disabled={disabled}\n onChange={(event) => setTyped((was) => ({ ...was, end: event.target.value }))}\n onBlur={(event) => commit(\"end\", event.target.value)}\n onKeyDown={(event) => {\n if (event.key !== \"Enter\") return;\n event.preventDefault();\n commit(\"end\", event.currentTarget.value);\n }}\n data-part=\"end\"\n />\n <RadixPopover.Trigger asChild>\n <IconButton\n icon={CalendarRange}\n label={`${label} 달력 열기`}\n size=\"sm\"\n variant=\"ghost\"\n tone=\"neutral\"\n disabled={disabled}\n onClick={() => {\n setCursor(value.start ?? today);\n setHovered(null);\n wanted.current = true;\n }}\n data-part=\"open\"\n />\n </RadixPopover.Trigger>\n </div>\n </RadixPopover.Anchor>\n\n <RadixPopover.Portal>\n <RadixPopover.Content\n className=\"date-range-picker__panel\"\n side=\"bottom\"\n align=\"start\"\n sideOffset={6}\n collisionPadding={{ top: 12, bottom: 12, left: 0, right: 0 }}\n aria-label={`${label} 달력`}\n /* Fired once the panel is in the document, which is the first moment the grid\n * exists to be focused into. */\n onOpenAutoFocus={(event) => {\n event.preventDefault();\n wanted.current = false;\n grid.current?.querySelector<HTMLButtonElement>('[data-focusable=\"true\"]')?.focus();\n }}\n >\n <Calendar\n cursor={cursor}\n onCursorChange={(iso, cause) => {\n setCursor(iso);\n /* A moved cursor is a moved preview, and a pointer that stopped moving must\n * not go on deciding what the preview shows. */\n if (cause !== \"page\") setHovered(null);\n if (cause === \"key\") wanted.current = true;\n }}\n onChoose={choose}\n today={today}\n captionId={captionId}\n gridRef={grid}\n blocked={blocked}\n mark={mark}\n describe={describe}\n onDayEnter={(iso) => setHovered(iso)}\n onGridLeave={() => setHovered(null)}\n />\n\n {/*\n * The range in words, and it changes as the reader walks. A band that only\n * exists on the screen is a band only some readers have.\n */}\n <p className=\"date-range-picker__summary\" aria-live=\"polite\" data-part=\"summary\">\n {summary}\n </p>\n\n <div className=\"date-range-picker__foot\">\n {shortcuts.map((shortcut) => {\n const locked = blocked(shortcut.range.start!) || blocked(shortcut.range.end!);\n return (\n <button\n key={shortcut.id}\n type=\"button\"\n className=\"date-range-picker__shortcut\"\n aria-disabled={locked || undefined}\n onClick={() => {\n if (locked) return;\n apply(shortcut.range);\n }}\n data-part={shortcut.id}\n >\n {shortcut.text}\n </button>\n );\n })}\n <button\n type=\"button\"\n className=\"date-range-picker__shortcut\"\n onClick={() => apply({ start: null, end: null })}\n data-part=\"clear\"\n >\n 지우기\n </button>\n </div>\n </RadixPopover.Content>\n </RadixPopover.Portal>\n </div>\n </RadixPopover.Root>\n );\n}\n","import { useId, useRef } from \"react\";\nimport type { ReactElement, ReactNode } from \"react\";\nimport * as RadixDialog from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\nimport { IconButton } from \"../../common/IconButton\";\nimport \"./Drawer.css\";\n\nexport type DrawerSide = \"start\" | \"end\" | \"bottom\";\nexport type DrawerSize = \"sm\" | \"md\" | \"lg\";\n\nexport type DrawerProps = {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n trigger?: ReactElement;\n /** What the panel is about. Required, for the same reason `Modal`'s is. */\n title: string;\n description?: ReactNode;\n children: ReactNode;\n footer?: ReactNode;\n /**\n * Which edge it comes from.\n *\n * `start` and `end` rather than left and right: in a right-to-left layout a panel that\n * came from \"right\" would arrive on the side the reader reads *from*, which is the wrong\n * side of the page in the same way it is in English.\n */\n side?: DrawerSide;\n size?: DrawerSize;\n dismissOnOutside?: boolean;\n className?: string;\n /* Test hooks and host state, on the panel itself. Every other component here takes\n * these; the layered three were the exception. */\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * A panel from the edge, with the page inert behind it.\n *\n * The same Radix dialog `Modal` uses and deliberately not the same component: a modal is a\n * window over the page that interrupts, and a drawer is a second column that arrives beside\n * the work. The difference is not a `placement` prop — it is what the reader is meant to do\n * next, and folding both into one component would mean every use of it choosing between two\n * unrelated behaviours.\n *\n * A drawer holding a form should set `dismissOnOutside={false}`: a stray click on the page\n * behind it otherwise throws away everything the reader typed.\n */\nexport function Drawer({\n open,\n onOpenChange,\n trigger,\n title,\n description,\n children,\n footer,\n side = \"end\",\n size = \"md\",\n dismissOnOutside = true,\n className,\n ...rest\n}: DrawerProps) {\n const base = useId();\n const panel = useRef<HTMLDivElement>(null);\n /*\n * Who had the focus before this opened, so it can be given back.\n *\n * Owned here rather than left to the library underneath, because it was not happening: the\n * reader was returned to `<body>`, which means their next Tab starts at the top of the\n * document. Captured in `onOpenAutoFocus`, which fires while the focus is still on\n * whatever opened the panel.\n */\n const opener = useRef<HTMLElement | null>(null);\n\n return (\n <RadixDialog.Root open={open} onOpenChange={onOpenChange}>\n {trigger ? <RadixDialog.Trigger asChild>{trigger}</RadixDialog.Trigger> : null}\n <RadixDialog.Portal>\n <RadixDialog.Overlay className=\"drawer__scrim\" />\n <RadixDialog.Content\n {...rest}\n ref={panel}\n className={`drawer ${className ?? \"\"}`.trim()}\n /*\n * The panel itself takes the focus, not the first thing inside it.\n *\n * Left alone, the first focusable is the close button in the corner — so a reader\n * arriving at a dialog hears \"닫기, 버튼\" before they hear what the dialog is. With\n * the panel focused they hear its name and its description, and Tab takes them in\n * from there with nothing pre-armed. That matters most for the one asking a\n * question that cannot be undone.\n */\n onOpenAutoFocus={(event) => {\n opener.current = document.activeElement as HTMLElement | null;\n event.preventDefault();\n panel.current?.focus();\n }}\n onCloseAutoFocus={(event) => {\n const back = opener.current;\n /*\n * Nothing to give back is a real case and not a failure: on macOS a button does\n * not take focus when it is clicked, so a mouse user never had a place here. What\n * must not happen is inventing one.\n */\n if (!back || back === document.body || !back.isConnected) return;\n event.preventDefault();\n back.focus();\n }}\n data-side={side}\n data-size={size}\n aria-labelledby={`${base}-title`}\n aria-describedby={description ? `${base}-description` : undefined}\n onInteractOutside={(event) => {\n if (!dismissOnOutside) event.preventDefault();\n }}\n >\n <header className=\"drawer__head\">\n <div className=\"drawer__heading\">\n <RadixDialog.Title className=\"drawer__title\" id={`${base}-title`}>\n {title}\n </RadixDialog.Title>\n {description ? (\n <RadixDialog.Description className=\"drawer__description\" id={`${base}-description`}>\n {description}\n </RadixDialog.Description>\n ) : null}\n </div>\n <RadixDialog.Close asChild>\n <IconButton icon={X} label={`${title} 닫기`} variant=\"ghost\" tone=\"neutral\" data-part=\"close\" />\n </RadixDialog.Close>\n </header>\n\n <div className=\"drawer__body\">{children}</div>\n\n {footer ? <footer className=\"drawer__foot\">{footer}</footer> : null}\n </RadixDialog.Content>\n </RadixDialog.Portal>\n </RadixDialog.Root>\n );\n}\n","import type { ElementType, ReactNode } from \"react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport \"./EmptyState.css\";\n\nexport type EmptyStateSize = \"sm\" | \"md\" | \"lg\";\nexport type EmptyStateTone = \"neutral\" | \"danger\";\n\nexport type EmptyStateProps = {\n title: ReactNode;\n description?: ReactNode;\n icon?: LucideIcon;\n /** An illustration instead of a glyph. Decorative either way — the title says it. */\n media?: ReactNode;\n /** What to do about it. The first one is the way out; the rest are alternatives. */\n actions?: ReactNode;\n as?: ElementType;\n size?: EmptyStateSize;\n tone?: EmptyStateTone;\n /**\n * Say it when it appears.\n *\n * For an empty state that replaces a list after a search or a filter: the results changed\n * and nothing on screen moved for a reader who cannot see it. Off by default, because an\n * empty state that was there when the page loaded has already been read in document order\n * and announcing it again is noise.\n *\n * How loudly is `tone`'s call, not a second flag: an absence waits its turn, a failure\n * interrupts. Two knobs would let a caller draw a failure in red and announce it politely.\n */\n announce?: boolean;\n className?: string;\n [key: `data-${string}`]: unknown;\n [key: `aria-${string}`]: unknown;\n};\n\n/**\n * Nothing here — and what to do about it.\n *\n * A title that says what is missing, not that something is missing. \"결과가 없습니다\" tells\n * a reader the machine worked; \"'김민수'와 맞는 주문이 없습니다\" tells them what to change.\n *\n * `tone=\"danger\"` is the one that is a failure rather than an absence, and it changes what is\n * said as well as what is painted: with `announce` it is an `alert` that interrupts, because a\n * list that could not be loaded is not news that can wait for the reader to finish a sentence.\n */\nexport function EmptyState({\n title,\n description,\n icon,\n media,\n actions,\n as: Heading = \"h3\",\n size = \"md\",\n tone = \"neutral\",\n announce,\n className,\n ...rest\n}: EmptyStateProps) {\n return (\n <div\n {...rest}\n className={`empty-state ${className ?? \"\"}`.trim()}\n data-size={size}\n data-tone={tone}\n role={announce ? (tone === \"danger\" ? \"alert\" : \"status\") : undefined}\n aria-live={announce ? (tone === \"danger\" ? \"assertive\" : \"polite\") : undefined}\n >\n {/*\n * `inert` as well as `aria-hidden`, because the two have to agree. `media` is an\n * arbitrary node: a link or a button inside it would be missing from the reader's\n * document and still reachable by Tab — a focus stop that announces nothing at all.\n */}\n {media ? (\n <div className=\"empty-state__media\" aria-hidden=\"true\" inert>{media}</div>\n ) : icon ? (\n <div className=\"empty-state__glyph\" aria-hidden=\"true\">\n <Icon icon={icon} size={size === \"sm\" ? \"md\" : \"lg\"} />\n </div>\n ) : null}\n <Heading className=\"empty-state__title\">{title}</Heading>\n {description ? <p className=\"empty-state__description\">{description}</p> : null}\n {actions ? <div className=\"empty-state__actions\">{actions}</div> : null}\n </div>\n );\n}\n","import { useEffect, useRef } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { Plus } from \"lucide-react\";\nimport { Button } from \"../../common/Button\";\nimport { Tag } from \"../../derived/Tag\";\nimport { VisuallyHidden } from \"../../common/VisuallyHidden\";\nimport \"./FilterBar.css\";\n\nexport type AppliedFilter = {\n id: string;\n /** The facet. \"상태\", \"담당자\". */\n field: string;\n /** The chosen value, in words. \"배송 중\", \"김민수\". */\n value: string;\n};\n\nexport type FilterBarProps = {\n filters: AppliedFilter[];\n onRemove: (id: string) => void;\n onClear: () => void;\n /** What the filters apply to. \"주문 목록\". Names the group. */\n label: string;\n /** The control that adds one — a `Menu` or a `Popover` trigger. */\n add?: ReactNode;\n /**\n * How many things are left after filtering.\n *\n * Announced politely when it changes, because removing a chip changes a list somewhere\n * else on the page and nothing else says so.\n */\n count?: { value: number; noun: string };\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * The filters that are on, and the ways to change them.\n *\n * Each chip says its facet as well as its value. \"김민수\" on its own is a chip a reader has\n * to guess at — the assignee? the creator? the last person to touch it? — and the guess is\n * free to be wrong. \"담당자: 김민수\" is not.\n *\n * \"모두 지우기\" appears only when there is something to clear. A permanently visible control\n * that does nothing most of the time is one a reader learns to stop reading.\n */\nexport function FilterBar({\n filters,\n onRemove,\n onClear,\n label,\n add,\n count,\n className,\n ...rest\n}: FilterBarProps) {\n const root = useRef<HTMLDivElement>(null);\n /*\n * Every control in this bar removes itself. A remove button goes away with its chip, and\n * \"모두 지우기\" is the last thing to disappear when it empties the row — and focus with it,\n * onto the body, which is where a keyboard reader loses their place entirely.\n */\n const leaving = useRef(false);\n\n useEffect(() => {\n if (!leaving.current) return;\n leaving.current = false;\n /* Only if the pressed control really did go. If the host ignored the callback the focus\n * is still on a live button and moving it would be the rude thing. */\n if (document.activeElement !== document.body) return;\n const next = root.current?.querySelector<HTMLElement>(\n '[data-part=\"clear\"], .filter-bar__add button, .filter-bar__add [tabindex], button',\n );\n (next ?? root.current)?.focus();\n }, [filters]);\n\n return (\n <div\n {...rest}\n ref={root}\n tabIndex={-1}\n className={`filter-bar ${className ?? \"\"}`.trim()}\n role=\"group\"\n aria-label={label}\n >\n <ul className=\"filter-bar__list\">\n {filters.map((filter) => (\n <li key={filter.id}>\n <Tag\n shape=\"pill\"\n /*\n * `md`, not `sm`. These chips share a row with two `Button`s, and the two\n * components' size scales are not the same scale: `Tag`'s `sm` is a 12px label\n * on `--space-1` of padding and stands 22px, while `Button`'s `sm` is 14px on a\n * `--space-8` box and stands 32px. Nothing had ever measured them against each\n * other, so the row carried three heights and two type sizes. `md` puts the chip\n * at 14px like its neighbours, and takes the remove button's target — which\n * stretches to the chip — from 24x20 to 24x24, which is the floor WCAG 2.5.8\n * sets and this one was under.\n */\n size=\"md\"\n onRemove={() => {\n leaving.current = true;\n onRemove(filter.id);\n }}\n removeLabel={`${filter.field} 조건 ${filter.value} 지우기`}\n data-part={`chip-${filter.id}`}\n >\n <span className=\"filter-bar__field\">{filter.field}</span>\n {filter.value}\n </Tag>\n </li>\n ))}\n </ul>\n\n {add ? <div className=\"filter-bar__add\">{add}</div> : null}\n\n {filters.length > 0 ? (\n <Button variant=\"plain\" tone=\"neutral\" size=\"sm\" shape=\"pill\" onClick={() => {\n leaving.current = true;\n onClear();\n }}\n data-part=\"clear\">\n 모두 지우기\n </Button>\n ) : null}\n\n {count ? (\n <p className=\"filter-bar__count\" aria-live=\"polite\" data-part=\"count\">\n {`${count.value.toLocaleString(\"ko-KR\")}개 ${count.noun}`}\n <VisuallyHidden>\n {filters.length > 0 ? ` · 조건 ${filters.length}개 적용됨` : \" · 조건 없음\"}\n </VisuallyHidden>\n </p>\n ) : null}\n </div>\n );\n}\n\nexport type FilterBarAddProps = {\n children?: ReactNode;\n onClick?: () => void;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * The default \"조건 추가\" button.\n *\n * `plain`, not `outline`, and that is a hierarchy fix rather than a taste one. The chips\n * are what the reader is looking at: each one is a condition currently narrowing the\n * answer, and the row exists to show them. An outlined button beside a soft chip reads as\n * the heavier of the two, so the screen put its bordered pill on the affordance and its\n * faint one on the state. Objects are filled here and actions are not — `모두 지우기` was\n * already plain, and this puts the two actions on the same footing beneath the state.\n */\nexport function FilterBarAdd({ children = \"조건 추가\", onClick, className, ...rest }: FilterBarAddProps) {\n return (\n <Button\n {...rest}\n variant=\"plain\"\n tone=\"neutral\"\n size=\"sm\"\n shape=\"pill\"\n iconStart={Plus}\n onClick={onClick}\n className={className}\n >\n {children}\n </Button>\n );\n}\n","import { useId } from \"react\";\nimport type { ElementType, ReactNode } from \"react\";\nimport \"./FormSection.css\";\n\nexport type FormSectionProps = {\n title: ReactNode;\n children: ReactNode;\n description?: ReactNode;\n /**\n * The heading element. `h3` because a form section is usually inside a page that already\n * has an `h1` and an `h2` — but the level belongs to the page, not to this component, and\n * a component that hard-coded it would build a broken outline everywhere else.\n */\n as?: ElementType;\n /** The end of the title's own line — a badge, a count, a \"모두 지우기\". */\n aside?: ReactNode;\n /** A rule above the section, for a form that is a run of them. */\n divided?: boolean;\n columns?: 1 | 2;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * A few fields that belong to one question.\n *\n * `role=\"group\"` with a real heading, and not a `<fieldset>` — which is where this started.\n * Two things stopped it. A `<legend>` is not laid out with the rest of the fieldset's\n * contents: it is taken out of the normal flow and rendered against the border, so it cannot\n * share a row with anything, and a badge meant to sit at the end of the title line ends up\n * underneath it. And a legend does not put the section in the document's heading outline,\n * which for a page of settings is the thing a reader navigates by.\n *\n * What a fieldset would have given — entering the group announces its name — `role=\"group\"`\n * with `aria-labelledby` gives too. `<section>` is avoided on purpose: a named section is a\n * landmark, and a form of six of them is six landmarks announced as regions.\n */\nexport function FormSection({\n title,\n children,\n description,\n as: Heading = \"h3\",\n aside,\n divided,\n columns = 1,\n className,\n ...rest\n}: FormSectionProps) {\n const base = useId();\n const titleId = `${base}-title`;\n const descriptionId = `${base}-description`;\n\n return (\n <div\n {...rest}\n className={`form-section ${className ?? \"\"}`.trim()}\n role=\"group\"\n aria-labelledby={titleId}\n aria-describedby={description ? descriptionId : undefined}\n data-divided={divided ? \"\" : undefined}\n data-columns={columns}\n >\n <div className=\"form-section__head\">\n <Heading className=\"form-section__title\" id={titleId}>{title}</Heading>\n {aside ? <div className=\"form-section__aside\">{aside}</div> : null}\n </div>\n {description ? (\n <p className=\"form-section__description\" id={descriptionId}>\n {description}\n </p>\n ) : null}\n <div className=\"form-section__body\">{children}</div>\n </div>\n );\n}\n","import { useRef, useState } from \"react\";\nimport type { CSSProperties, ElementType, PointerEvent, ReactNode } from \"react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport { Skeleton } from \"../../common/Skeleton\";\nimport \"./ListRow.css\";\n\nexport type ListRowDensity = \"comfortable\" | \"compact\";\nexport type ListRowActionTone = \"neutral\" | \"warning\" | \"danger\";\n\nexport type ListRowAction = {\n id: string;\n /** What it does, in words. Shown and announced — an icon alone is a guess. */\n label: string;\n icon?: LucideIcon;\n tone?: ListRowActionTone;\n onAction: () => void;\n};\n\n/** How far the finger travels before the direction is settled. */\nconst AXIS_SLOP = 8;\n\nexport type ListRowProps = {\n title: ReactNode;\n /** Under the title. One line by default — a list row is scanned, not read. */\n description?: ReactNode;\n /** Before the title — an avatar, an icon, a checkbox, a drag handle. */\n media?: ReactNode;\n /** After the description — a timestamp, a count, a status. Never a control. */\n meta?: ReactNode;\n /** The end of the row, where the controls go. */\n actions?: ReactNode;\n as?: ElementType;\n /**\n * The whole row is one target, by the same construction `Card` uses: a link inside it\n * stretches over the row rather than the row becoming a link.\n */\n interactive?: boolean;\n selected?: boolean;\n disabled?: boolean;\n /**\n * Row density, and it reaches the DOM as `data-row-density` rather than `data-density`.\n *\n * `[data-density]` is the page-level scope that rescales `--space-*` for everything under\n * it. If this component minted the same attribute, `<ListRow density=\"compact\">` would match\n * that scope too and rescale the whole subtree — the rows would compact once here and\n * again through every token inside them, and a badge in a compact row would shrink for a\n * reason nobody could find. The two are different variations: one is how much room this\n * component gives its rows, the other is how much room the page gives everything.\n */\n density?: ListRowDensity;\n /**\n * The row is waiting for what goes in it.\n *\n * A row knows its own shape — media, title, description, meta — so it draws that shape\n * rather than a grey bar. An adopter rebuilding it out of `Skeleton` gets a placeholder\n * that jumps to a different height the moment the real row arrives, and a list of twenty of\n * them reflows twenty times.\n */\n loading?: boolean;\n /** Truncate the description to one line instead of letting it wrap. */\n clamp?: boolean;\n /**\n * What a swipe from the trailing edge reveals. Three at most.\n *\n * Past three, the row is a menu that happens to open sideways: the labels stop fitting, the\n * targets fall under the 24px a thumb needs, and a reader has to swipe carefully to land on\n * the right one. A row with more to offer has a menu.\n */\n swipeActions?: ListRowAction[];\n className?: string;\n [key: `data-${string}`]: unknown;\n [key: `aria-${string}`]: unknown;\n};\n\n/**\n * One thing in a list of things.\n *\n * The same shape as a card laid on its side, and deliberately not the same component: a card\n * is a surface with its own edge and a row is a band in something else's. Sharing them would\n * mean every row carrying a border it has to turn off.\n */\nexport function ListRow({\n title,\n description,\n media,\n meta,\n actions,\n as: Element = \"div\",\n interactive,\n selected,\n disabled,\n density = \"comfortable\",\n loading,\n clamp,\n swipeActions,\n className,\n ...rest\n}: ListRowProps) {\n const swipeable = Boolean(swipeActions?.length) && !loading && !disabled;\n const shelf = useRef<HTMLDivElement>(null);\n const drag = useRef<{ x: number; y: number; axis: \"\" | \"x\" | \"y\"; from: number; resist: number } | null>(null);\n /*\n * How far the row is pulled, in pixels, and the third place a value may go.\n *\n * A finger choosing a distance forty times a second is exactly what a `data-*` attribute\n * cannot hold and what an element attribute has no slot for, so it is a custom property the\n * component writes and its own stylesheet spends. It is not a paint declaration: the rule\n * that reads it is still in the stylesheet, and an adopter can still change what that rule\n * does with it.\n */\n const [pulled, setPulled] = useState(0);\n const [swiping, setSwiping] = useState(false);\n\n const reach = () => shelf.current?.offsetWidth ?? 0;\n\n const start = (event: PointerEvent<HTMLElement>) => {\n if (!swipeable || (event.pointerType === \"mouse\" && event.button !== 0)) return;\n /*\n * `--drag-resist` is read once, here, rather than on every move. It is the token's number\n * and reading it keeps the rubber in the token layer, where the other two gesture values\n * already are.\n */\n const resist = Number.parseFloat(\n getComputedStyle(event.currentTarget).getPropertyValue(\"--drag-resist\"),\n );\n drag.current = { x: event.clientX, y: event.clientY, axis: \"\", from: pulled, resist: resist || 0.5 };\n };\n\n const move = (event: PointerEvent<HTMLElement>) => {\n const held = drag.current;\n if (!held) return;\n const dx = event.clientX - held.x;\n const dy = event.clientY - held.y;\n\n /*\n * The direction is decided once and never revisited.\n *\n * A row's swipe and the page's scroll are the same finger, and `touch-action: pan-y` hands\n * the vertical half to the browser — but a trackpad and a mouse send neither, so the first\n * eight pixels settle it here too. Deciding per-move instead would let a diagonal drag\n * flip between scrolling the page and opening the row.\n */\n if (!held.axis) {\n if (Math.abs(dx) < AXIS_SLOP && Math.abs(dy) < AXIS_SLOP) return;\n if (Math.abs(dy) >= Math.abs(dx)) {\n drag.current = null;\n return;\n }\n held.axis = \"x\";\n event.currentTarget.setPointerCapture(event.pointerId);\n setSwiping(true);\n }\n\n const far = reach();\n let next = held.from + dx;\n /* Rubber at both ends. A wall says nothing about whether the gesture was understood. */\n if (next > 0) next *= held.resist;\n else if (next < -far) next = -far + (next + far) * held.resist;\n setPulled(next);\n };\n\n const release = () => {\n const held = drag.current;\n drag.current = null;\n setSwiping(false);\n if (!held || held.axis !== \"x\") return;\n const far = reach();\n /*\n * Halfway, and then all the way open or all the way shut. There is no third resting place:\n * a row left at forty percent is a row showing half a word.\n *\n * **Reaching the end does not run the action.** iOS runs it, and iOS also has an undo\n * shelf and a decade of muscle memory. Here the swipe reveals and the tap commits, so a\n * flick that went further than intended costs nothing.\n */\n setPulled((was) => (was <= -far / 2 ? -far : 0));\n };\n\n const shut = () => setPulled(0);\n\n return (\n <Element\n {...rest}\n className={`list-row ${className ?? \"\"}`.trim()}\n data-swipeable={swipeable ? \"\" : undefined}\n data-swiping={swiping ? \"\" : undefined}\n data-pulled={swipeable && pulled !== 0 ? \"\" : undefined}\n style={swipeable ? ({ \"--row-pull\": `${pulled}px` } as CSSProperties) : undefined}\n onPointerDown={swipeable ? start : undefined}\n onPointerMove={swipeable ? move : undefined}\n onPointerUp={swipeable ? release : undefined}\n onPointerCancel={swipeable ? release : undefined}\n data-row-density={density}\n data-interactive={interactive ? \"\" : undefined}\n data-selected={selected ? \"\" : undefined}\n data-disabled={disabled ? \"\" : undefined}\n data-clamp={clamp ? \"\" : undefined}\n data-loading={loading ? \"\" : undefined}\n aria-busy={loading || undefined}\n >\n {(() => {\n const body = (\n <>\n {/*\n * The placeholder takes the slots the row was given, not every slot the row has. A\n * waiting row that draws a media circle where the real one has none is a row that\n * moves sideways when the data lands.\n */}\n {media ? (\n <div className=\"list-row__media\">{loading ? <Skeleton shape=\"circle\" size=\"md\" /> : media}</div>\n ) : null}\n <div className=\"list-row__text\">\n <span className=\"list-row__title\">{loading ? <Skeleton shape=\"text\" lines={1} /> : title}</span>\n {description ? (\n <span className=\"list-row__description\">\n {loading ? <Skeleton shape=\"text\" lines={1} /> : description}\n </span>\n ) : null}\n </div>\n {meta ? <div className=\"list-row__meta\">{loading ? <Skeleton shape=\"text\" lines={1} /> : meta}</div> : null}\n {actions && !loading ? <div className=\"list-row__actions\">{actions}</div> : null}\n </>\n );\n\n /* No shelf, no pane: a row with nothing to reveal keeps the DOM it always had. */\n if (!swipeable) return body;\n\n return (\n <>\n <div\n className=\"list-row__pane\"\n /*\n * An open row swallows the first press and shuts instead.\n *\n * Without this the row underneath is still a link, so the tap meant to put the\n * actions away opens the thing the reader was about to act on. Capture, because\n * the link is a descendant and it would otherwise get there first.\n */\n onClickCapture={\n pulled !== 0\n ? (event) => {\n event.preventDefault();\n event.stopPropagation();\n shut();\n }\n : undefined\n }\n >\n {body}\n </div>\n\n {/*\n * The shelf is in the document at rest, not conditionally rendered — that is the\n * whole pointer-free path. It sits outside the row's clip until it is pulled in,\n * so a keyboard can Tab straight to it and the row opens to meet the focus.\n * `visibility: hidden` would have hidden it from the Tab key too, and a\n * destructive action a keyboard cannot reach is a destructive action that only\n * exists for people with a working pointer.\n */}\n <div\n className=\"list-row__shelf\"\n ref={shelf}\n data-part=\"shelf\"\n onFocus={() => setPulled(-reach())}\n onBlur={(event) => {\n if (!event.currentTarget.contains(event.relatedTarget as Node | null)) shut();\n }}\n >\n {swipeActions!.slice(0, 3).map((action) => (\n <button\n key={action.id}\n type=\"button\"\n className=\"list-row__shelf-action\"\n data-tone={action.tone ?? \"neutral\"}\n data-part={action.id}\n onClick={() => {\n shut();\n action.onAction();\n }}\n >\n {action.icon ? <Icon icon={action.icon} size=\"sm\" aria-hidden=\"true\" /> : null}\n {action.label}\n </button>\n ))}\n </div>\n </>\n );\n })()}\n </Element>\n );\n}\n\nexport type ListRowLinkProps = {\n children: ReactNode;\n href?: string;\n onClick?: () => void;\n className?: string;\n [key: `data-${string}`]: unknown;\n [key: `aria-${string}`]: unknown;\n};\n\n/** The one control that owns the row. Its text is the row's name. */\nexport function ListRowLink({ children, href, onClick, className, ...rest }: ListRowLinkProps) {\n const shared = { ...rest, className: `list-row__link ${className ?? \"\"}`.trim(), onClick };\n if (href !== undefined) return <a {...shared} href={href}>{children}</a>;\n return <button {...shared} type=\"button\">{children}</button>;\n}\n","import { useId, useRef } from \"react\";\nimport type { ReactElement, ReactNode } from \"react\";\nimport * as RadixDialog from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\nimport { IconButton } from \"../../common/IconButton\";\nimport \"./Modal.css\";\n\nexport type ModalSize = \"sm\" | \"md\" | \"lg\";\n/** What a dialog becomes when the window is too narrow to centre one. */\nexport type ModalNarrow = \"centred\" | \"bottom\";\n\nexport type ModalProps = {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** The control that opens it, when the modal owns its own state. */\n trigger?: ReactElement;\n /**\n * What the dialog is about. Required.\n *\n * A dialog with no name is announced as \"dialog\" and nothing else: the reader is told they\n * have arrived somewhere and not told where, with the rest of the page now inert behind\n * them.\n */\n title: string;\n description?: ReactNode;\n children: ReactNode;\n /** The actions. Convention is the safe one first, the committing one last. */\n footer?: ReactNode;\n size?: ModalSize;\n /**\n * What it does on a phone.\n *\n * `bottom` moves the dialog to the bottom edge, full width, with the top corners rounded —\n * the shape a phone expects, and the one a thumb can reach the buttons of. `centred` keeps it\n * in the middle at every width.\n *\n * **It stays a dialog.** `docs/최신-UI-신규-컴포넌트.md` 4.2 describes this as a dialog\n * becoming a sheet, and building it that way would be wrong here: `Sheet` deliberately does\n * not trap focus, does not make the page inert and has no scrim, because a sheet is an index\n * to the page behind it. Swapping one for the other at a breakpoint would change what the\n * component *is* halfway across a resize — a form that traps focus on a laptop and does not\n * on a phone. This is a shape, not a second behaviour, so it is CSS and there is one DOM.\n */\n narrow?: ModalNarrow;\n /**\n * A decision rather than a task.\n *\n * `role=\"alertdialog\"`, which tells a screen reader to read the description immediately\n * instead of waiting to be asked, and turns off dismissal by clicking outside — a stray\n * click should not answer a question the dialog was asked to put.\n */\n urgent?: boolean;\n /**\n * Clicking outside closes it. On by default, and worth turning off for a dialog holding\n * anything the reader has typed: a misclick then costs them their work.\n */\n dismissOnOutside?: boolean;\n className?: string;\n /* Test hooks and host state, on the panel itself. Every other component here takes\n * these; the layered three were the exception. */\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * A window over the page, with the page inert behind it.\n *\n * Radix rather than hand-rolled. A dialog has to trap focus without trapping it forever,\n * return it to whatever opened it, mark the rest of the document `aria-hidden`, lock the\n * page's scroll without the layout jumping as the scrollbar goes, close on Escape, and\n * portal to the end of the body so no ancestor's `overflow` or `transform` can clip or\n * reposition it. Every one of those is invisible in a screenshot and wrong in most\n * hand-written dialogs.\n */\nexport function Modal({\n open,\n onOpenChange,\n trigger,\n title,\n description,\n children,\n footer,\n size = \"md\",\n narrow = \"centred\",\n urgent,\n dismissOnOutside = true,\n className,\n ...rest\n}: ModalProps) {\n const base = useId();\n const panel = useRef<HTMLDivElement>(null);\n /*\n * Who had the focus before this opened, so it can be given back.\n *\n * Owned here rather than left to the library underneath, because it was not happening: the\n * reader was returned to `<body>`, which means their next Tab starts at the top of the\n * document. Captured in `onOpenAutoFocus`, which fires while the focus is still on\n * whatever opened the panel.\n */\n const opener = useRef<HTMLElement | null>(null);\n\n return (\n <RadixDialog.Root open={open} onOpenChange={onOpenChange}>\n {trigger ? <RadixDialog.Trigger asChild>{trigger}</RadixDialog.Trigger> : null}\n <RadixDialog.Portal>\n <RadixDialog.Overlay className=\"modal__scrim\" />\n <RadixDialog.Content\n {...rest}\n ref={panel}\n className={`modal ${className ?? \"\"}`.trim()}\n data-narrow={narrow}\n /*\n * The panel itself takes the focus, not the first thing inside it.\n *\n * Left alone, the first focusable is the close button in the corner — so a reader\n * arriving at a dialog hears \"닫기, 버튼\" before they hear what the dialog is. With\n * the panel focused they hear its name and its description, and Tab takes them in\n * from there with nothing pre-armed. That matters most for the one asking a\n * question that cannot be undone.\n */\n onOpenAutoFocus={(event) => {\n opener.current = document.activeElement as HTMLElement | null;\n event.preventDefault();\n panel.current?.focus();\n }}\n onCloseAutoFocus={(event) => {\n const back = opener.current;\n /*\n * Nothing to give back is a real case and not a failure: on macOS a button does\n * not take focus when it is clicked, so a mouse user never had a place here. What\n * must not happen is inventing one.\n */\n if (!back || back === document.body || !back.isConnected) return;\n event.preventDefault();\n back.focus();\n }}\n data-size={size}\n /*\n * Spread conditionally, never `role={urgent ? \"alertdialog\" : undefined}`.\n *\n * Radix sets `role=\"dialog\"` itself and then spreads these props over its own, so\n * an explicit `undefined` does not mean \"leave it alone\" — it overwrites the role\n * with nothing, and React drops the attribute. The dialog opened, looked perfect,\n * and had no role at all.\n */\n {...(urgent ? ({ role: \"alertdialog\" } as const) : {})}\n aria-labelledby={`${base}-title`}\n aria-describedby={description ? `${base}-description` : undefined}\n onInteractOutside={(event) => {\n if (urgent || !dismissOnOutside) event.preventDefault();\n }}\n >\n <header className=\"modal__head\">\n <div className=\"modal__heading\">\n <RadixDialog.Title className=\"modal__title\" id={`${base}-title`}>\n {title}\n </RadixDialog.Title>\n {description ? (\n <RadixDialog.Description className=\"modal__description\" id={`${base}-description`}>\n {description}\n </RadixDialog.Description>\n ) : null}\n </div>\n {/* Always there, even when an outside click will not close it. Escape is not\n * discoverable, and a dialog with no visible way out is one a reader can be\n * stuck in front of. */}\n <RadixDialog.Close asChild>\n <IconButton icon={X} label={`${title} 닫기`} variant=\"ghost\" tone=\"neutral\" data-part=\"close\" />\n </RadixDialog.Close>\n </header>\n\n {/* The body scrolls; the head and the foot stay. A dialog that scrolls as a whole\n * takes its own actions off the screen exactly when the reader has finished\n * reading and wants them. */}\n <div className=\"modal__body\">{children}</div>\n\n {footer ? <footer className=\"modal__foot\">{footer}</footer> : null}\n </RadixDialog.Content>\n </RadixDialog.Portal>\n </RadixDialog.Root>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { Menu as MenuIcon } from \"lucide-react\";\nimport { IconButton } from \"../../common/IconButton\";\nimport { Text } from \"../../common/Text\";\nimport \"./PageHeader.css\";\n\n/*\n * The rail button's three props travel together or not at all.\n *\n * `onRailToggle` alone was allowed, and then the button had no way to know what it was doing:\n * it was named \"… 열기\" whether the rail was open or shut, and a reader who opened the rail\n * was told to open it again. The state is not something this component can work out — the\n * rail belongs to the shell — so the type asks for it rather than guessing, and a header with\n * no toggle is still allowed to say nothing about any of it.\n */\nexport type PageHeaderRail =\n | { onRailToggle?: undefined; railOpen?: undefined; railLabel?: string; railId?: undefined }\n | {\n onRailToggle: () => void;\n /** Whether the rail is showing right now. Names the button and sets `aria-expanded`. */\n railOpen: boolean;\n railLabel?: string;\n /** The id of the rail the button opens, for `aria-controls`. `AppShell` takes `railId`. */\n railId?: string;\n };\n\nexport type PageHeaderProps = PageHeaderRail & {\n title: string;\n /** A `Breadcrumb`, usually. Sits above the title because that is where the reader looks for it. */\n breadcrumb?: ReactNode;\n /** One line under the title. Longer than that belongs in the page. */\n description?: ReactNode;\n /**\n * What is true about this page right now — a `Badge`, a `StatusDot`, a saved-at time.\n *\n * Beside the title rather than in the actions, because a status is something the reader\n * reads and an action is something they press, and a row that mixes the two makes the\n * reader test each item to find out which it is.\n */\n status?: ReactNode;\n /** The page's own buttons. The primary one goes last, where the reader's hand already is. */\n actions?: ReactNode;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * The band at the top of a page that says where you are and what you can do here.\n *\n * Written because every demo in this repository was drawing its own: a title, a row of\n * buttons, a divider, each with its own spacing and its own idea of what happens when the\n * title is long. Eighty-one of those is not a design system, it is eighty-one headers.\n *\n * The title truncates and the actions do not. When the room runs out it is the sentence that\n * gives way, never the buttons — a clipped label on a destructive action is how the wrong\n * button gets pressed. On a phone the actions drop to their own row instead of competing.\n */\nexport function PageHeader({\n title,\n breadcrumb,\n description,\n status,\n actions,\n onRailToggle,\n railOpen,\n railId,\n railLabel = \"둘러보기\",\n className,\n ...rest\n}: PageHeaderProps) {\n return (\n <header className={`page-header ${className ?? \"\"}`.trim()} {...rest}>\n {breadcrumb ? <div className=\"page-header__crumbs\">{breadcrumb}</div> : null}\n\n <div className=\"page-header__bar\">\n {onRailToggle ? (\n <IconButton\n icon={MenuIcon}\n label={`${railLabel} ${railOpen ? \"닫기\" : \"열기\"}`}\n variant=\"ghost\"\n tone=\"neutral\"\n onClick={onRailToggle}\n aria-expanded={railOpen}\n aria-controls={railId}\n data-part=\"rail-toggle\"\n />\n ) : null}\n\n <div className=\"page-header__heading\">\n <div className=\"page-header__titles\">\n <Text as=\"h1\" size=\"xl\" weight=\"bold\" className=\"page-header__title\">\n {title}\n </Text>\n {status ? <div className=\"page-header__status\">{status}</div> : null}\n </div>\n {description ? (\n <Text size=\"sm\" tone=\"muted\" className=\"page-header__description\">\n {description}\n </Text>\n ) : null}\n </div>\n\n {actions ? <div className=\"page-header__actions\">{actions}</div> : null}\n </div>\n </header>\n );\n}\n","import { useId } from \"react\";\nimport type { ReactNode } from \"react\";\nimport \"./PreferenceRow.css\";\n\n/**\n * What the control on the right needs in order to be named by the text on the left.\n *\n * Handed over rather than cloned on, the same as `Field`. A switch with no name is announced\n * as \"switch, on\" and a reader has no idea what is on.\n */\nexport type PreferenceControl = {\n \"aria-labelledby\": string;\n \"aria-describedby\": string | undefined;\n id: string;\n};\n\nexport type PreferenceRowProps = {\n title: ReactNode;\n control: (preference: PreferenceControl) => ReactNode;\n description?: ReactNode;\n /** Something under the description that appears when the setting is on. */\n children?: ReactNode;\n icon?: ReactNode;\n /**\n * 아이콘이 없는 줄도 아이콘 칸을 비워 둡니다.\n *\n * 아이콘이 있는 줄과 없는 줄이 섞인 목록에서만 씁니다. 줄마다 자기 격자라 서로 폭을\n * 맞추지 못하므로, 없는 쪽에 이걸 켜고 감싸는 요소에서 `--preference-row-lead`로 폭을\n * 한 번 정합니다.\n */\n lead?: boolean;\n /** The control goes under the text instead of beside it, for a long setting. */\n stacked?: boolean;\n disabled?: boolean;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * One setting: what it is, what it does, and the control that changes it.\n *\n * The row is not a label and does not become one. A `Switch` renders its own `<label>`, and a\n * label inside a label is invalid HTML that browsers repair by choosing for themselves which\n * input the outer one points at — so the text names the control by id instead, and the\n * control's own hit area is the target.\n */\nexport function PreferenceRow({\n title,\n control,\n description,\n children,\n icon,\n lead,\n stacked,\n disabled,\n className,\n ...rest\n}: PreferenceRowProps) {\n const base = useId();\n const titleId = `${base}-title`;\n const descriptionId = `${base}-description`;\n\n return (\n <div\n {...rest}\n className={`preference-row ${className ?? \"\"}`.trim()}\n data-lead={icon || lead ? \"\" : undefined}\n data-stacked={stacked ? \"\" : undefined}\n data-disabled={disabled ? \"\" : undefined}\n >\n {icon ? <span className=\"preference-row__icon\" aria-hidden=\"true\">{icon}</span> : null}\n <div className=\"preference-row__body\">\n <span className=\"preference-row__title\" id={titleId}>{title}</span>\n {description ? (\n <span className=\"preference-row__description\" id={descriptionId}>{description}</span>\n ) : null}\n </div>\n <div className=\"preference-row__control\">\n {control({\n \"aria-labelledby\": titleId,\n \"aria-describedby\": description ? descriptionId : undefined,\n id: `${base}-control`,\n })}\n </div>\n {children ? <div className=\"preference-row__extra\">{children}</div> : null}\n </div>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { X } from \"lucide-react\";\nimport { IconButton } from \"../../common/IconButton\";\nimport { Text } from \"../../common/Text\";\nimport \"./SidePanel.css\";\n\nexport type SidePanelProps = {\n /** What the panel is about. Required — an unnamed landmark is one a reader skips past. */\n title: string;\n /** A count, a status, a filter — whatever sits beside the title rather than under it. */\n meta?: ReactNode;\n children: ReactNode;\n footer?: ReactNode;\n /** Rendered only when given, so a panel that cannot be dismissed shows no button that lies. */\n onClose?: () => void;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * A second column beside the work, not a layer over it.\n *\n * That sentence is the whole difference from `Drawer`, and it is a difference in what the\n * reader is doing rather than in where the box sits. A drawer interrupts: the page behind it\n * goes inert, the focus is trapped, and the reader is expected to finish and leave. A side\n * panel is read *while* working — a source beside the answer it supports, the row you are\n * editing beside the grid it came from — so nothing is trapped and nothing behind it is\n * disabled.\n *\n * There is no `mode=\"overlay\"`. It was in the plan and it collapsed on contact: a side panel\n * that covers the work, traps the focus and dims what is behind is not a mode of this\n * component, it is `Drawer`. What remains is the responsive fact — under `--bp-lg` there is\n * no room for a second column, so the shell stacks the panel *below* the work rather than\n * over it. It still pushes. It never covers.\n *\n * It brings no width of its own. The panel is whatever its container gives it, which is what\n * lets `AppShell` own the track and this own the contents.\n */\nexport function SidePanel({ title, meta, children, footer, onClose, className, ...rest }: SidePanelProps) {\n return (\n <section className={`side-panel ${className ?? \"\"}`.trim()} aria-label={title} {...rest}>\n <header className=\"side-panel__head\">\n <div className=\"side-panel__heading\">\n <Text as=\"h2\" size=\"sm\" weight=\"semibold\" className=\"side-panel__title\">\n {title}\n </Text>\n {meta ? <div className=\"side-panel__meta\">{meta}</div> : null}\n </div>\n {onClose ? (\n <IconButton icon={X} label={`${title} 닫기`} variant=\"ghost\" tone=\"neutral\" size=\"sm\" onClick={onClose} data-part=\"close\" />\n ) : null}\n </header>\n\n <div className=\"side-panel__body\">{children}</div>\n\n {footer ? <footer className=\"side-panel__foot\">{footer}</footer> : null}\n </section>\n );\n}\n","import { useId, useState } from \"react\";\nimport type { MouseEvent, ReactNode } from \"react\";\nimport { ChevronDown } from \"lucide-react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport { Tooltip } from \"../../common/Tooltip\";\nimport { VisuallyHidden } from \"../../common/VisuallyHidden\";\nimport \"./SidebarNav.css\";\n\nexport type SidebarNavItem = {\n value: string;\n label: string;\n icon?: LucideIcon;\n /** Where the item goes. Without one the item is drawn as a button rather than a link. */\n href?: string;\n /**\n * The event is passed, so `preventDefault()` is reachable.\n *\n * The first version typed this `() => void`, which meant a router-driven item could not stop\n * the anchor from navigating — and since the anchor fell back to `href=\"#\"`, every click left\n * a `#` on the URL that nothing the adopter could write would prevent.\n */\n onClick?: (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;\n /** A count or a dot at the end of the row. Decorative — say what it means in the label. */\n badge?: ReactNode;\n disabled?: boolean;\n};\n\nexport type SidebarNavGroup = {\n /** Omitted for a run of items with no heading of their own. */\n title?: string;\n items: SidebarNavItem[];\n /** The group can be folded away, and starts folded or not. */\n collapsible?: boolean;\n defaultOpen?: boolean;\n /**\n * One control at the end of the heading — \"새 모음\", \"가져오기\".\n *\n * A heading is where a reader looks for what to do with the whole group, and a rail with a\n * \"Collections\" heading and no way to add one sends them to a settings page to do it. One,\n * and at the end: two is a toolbar, and a toolbar wants a row of its own.\n *\n * Never on a collapsible heading. That heading is already a button, and a button inside a\n * button is invalid HTML that browsers repair by dropping one of the two.\n */\n action?: ReactNode;\n};\n\nexport type SidebarNavEmphasis = \"soft\" | \"solid\";\nexport type SidebarNavIconStyle = \"bare\" | \"tile\";\nexport type SidebarNavVariant = \"plain\" | \"outlined\" | \"filled\" | \"elevated\";\n\nexport type SidebarNavProps = {\n groups: SidebarNavGroup[];\n /** Which item the reader is on. Becomes `aria-current=\"page\"`. */\n value?: string;\n /** What this navigation is. \"주요 메뉴\", \"설정\". A page has more than one `<nav>`. */\n label: string;\n /** Icons only, with the labels moved into tooltips. */\n collapsed?: boolean;\n /**\n * How loudly the current item is marked.\n *\n * `soft` is a tinted row and reads as \"you are here\" among peers. `solid` fills it with the\n * accent and puts the reverse ink on it, which is what a rail that is the whole navigation\n * of a product needs — a tint on a page with a tinted table and a tinted badge is not the\n * loudest thing on screen, and the one place a reader is standing has to be.\n */\n emphasis?: SidebarNavEmphasis;\n /**\n * Whether an icon sits on a ground of its own.\n *\n * `tile` is the difference between a rail and a list of words. A bare glyph beside a label\n * is read as punctuation; the same glyph on a tinted square is read as the thing the row is\n * about. It costs the row four pixels of height and it is why a product rail looks like one.\n */\n icons?: SidebarNavIconStyle;\n /** How the navigation container is separated from its surroundings. */\n variant?: SidebarNavVariant;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/*\n * A group's identity, not its position.\n *\n * Folding was keyed by array index, so inserting a group at the top moved every fold down one\n * and the reader's folded \"설정\" became a folded \"조직\". The title alone is not enough either —\n * two groups may legitimately share one, and `key={group.title ?? index}` then collides and\n * React reuses one group's state for the other. The item values settle it: they are already\n * unique inside a rail, because they are what `value` is matched against.\n */\nfunction groupKey(group: SidebarNavGroup): string {\n return `${group.title ?? \"\"}::${group.items.map((item) => item.value).join(\"|\")}`;\n}\n\n/**\n * The side of the page: groups, items, and where the reader is.\n *\n * `aria-current=\"page\"` and not a class alone. A rail drawn down the left of the chosen item\n * tells a reader who can see it where they are and tells everyone else nothing; the\n * attribute is the part that is read.\n *\n * Collapsed, the labels move into tooltips *and stay in the accessibility tree*. A tooltip\n * cannot be reached by touch and cannot be selected, so an item whose name exists only in\n * its tooltip has no name on a phone — the visible text goes, the accessible name does not.\n */\nexport function SidebarNav({\n groups,\n value,\n label,\n collapsed,\n emphasis = \"soft\",\n icons = \"bare\",\n variant = \"plain\",\n className,\n ...rest\n}: SidebarNavProps) {\n /*\n * `useId`, not a literal prefix.\n *\n * The first version generated `sidebar-nav-group-1`, which is unique inside one component\n * and a duplicate the moment a page holds two — a settings page with a rail and a folded\n * copy of it, say. Two elements with the same id means `aria-controls` points at whichever\n * the browser finds first, and the heading in the second rail quietly controls the list in\n * the first.\n */\n const base = useId();\n /*\n * Only what the reader has changed lives here, and `defaultOpen` is read every render.\n *\n * A `useState` initialiser runs once, so a group that arrived later — a section that appears\n * when its permissions load — was folded according to a `groups` array it was not in.\n */\n const [overrides, setOverrides] = useState<Record<string, boolean>>({});\n\n return (\n <nav\n {...rest}\n className={`sidebar-nav ${className ?? \"\"}`.trim()}\n aria-label={label}\n data-collapsed={collapsed ? \"\" : undefined}\n data-emphasis={emphasis}\n data-icons={icons}\n data-variant={variant}\n >\n {groups.map((group, index) => {\n const key = groupKey(group);\n const shut = overrides[key] ?? (group.collapsible ? group.defaultOpen === false : false);\n const listId = `${base}-group-${index}`;\n\n return (\n <div\n className=\"sidebar-nav__group\"\n key={key}\n /* Only a folding group indents; see the guide-line rule in the stylesheet. */\n data-collapsible={group.collapsible && !collapsed ? \"\" : undefined}\n >\n {/*\n * The fold outlives collapsing, so the control that undoes it has to as well.\n *\n * Dropping the heading at `collapsed` opened every folded group without being\n * asked and left nothing to fold it again with. Collapsed, the heading keeps its\n * chevron and loses only its text — to `VisuallyHidden`, so the button is still\n * named for a reader who cannot see the icon.\n */}\n {group.title && group.collapsible ? (\n <button\n type=\"button\"\n className=\"sidebar-nav__heading\"\n aria-expanded={!shut}\n aria-controls={listId}\n onClick={() => setOverrides((current) => ({ ...current, [key]: !shut }))}\n data-part={`group-${index}`}\n >\n <Icon icon={ChevronDown} size=\"xs\" className=\"sidebar-nav__chevron\" />\n {collapsed ? <VisuallyHidden>{group.title}</VisuallyHidden> : group.title}\n </button>\n ) : null}\n\n {group.title && !group.collapsible && !collapsed ? (\n <div className=\"sidebar-nav__heading\" data-static=\"\">\n <h3 className=\"sidebar-nav__heading-text\">{group.title}</h3>\n {group.action ? <span className=\"sidebar-nav__heading-action\">{group.action}</span> : null}\n </div>\n ) : null}\n\n {/* A separator where a titled group would have had a heading, so a collapsed rail\n * still reads as groups rather than as one long column. */}\n {group.title && collapsed && index > 0 ? (\n <span className=\"sidebar-nav__divider\" aria-hidden=\"true\" />\n ) : null}\n\n <ul className=\"sidebar-nav__list\" id={listId} hidden={shut}>\n {group.items.map((item) => {\n const current = item.value === value;\n const press = (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n if (item.disabled) {\n event.preventDefault();\n return;\n }\n item.onClick?.(event);\n };\n\n /*\n * A link when it goes somewhere, a button when it does something.\n *\n * `href={item.href ?? \"#\"}` made every handler-only item a link to the top of\n * the page: the handler ran, the fragment landed in the address bar, and the\n * back button then walked history entries that were never navigations. An\n * element with no destination is not a link.\n */\n const inner = (\n <>\n {item.icon ? (\n /* The tile is a wrapper rather than a variant of `Icon`: the ground\n * belongs to the row's idea of the item, not to the glyph, and an `Icon`\n * that grew a background would carry it into every other component. */\n <span className=\"sidebar-nav__glyph\">\n <Icon icon={item.icon} size=\"sm\" className=\"sidebar-nav__icon\" />\n </span>\n ) : null}\n {collapsed ? (\n <VisuallyHidden>{item.label}</VisuallyHidden>\n ) : (\n <span className=\"sidebar-nav__label\">{item.label}</span>\n )}\n {/*\n * A count survives collapsing, because collapsing is what makes it worth\n * having. Dropped here, a rail of icons said the same thing whether four\n * things were waiting or none, and the one sample in the book whose whole\n * subject was the count rendered five bare glyphs. Beside the label it is\n * a pill at the end of the row; without a label it moves onto the corner\n * of the glyph, which is the only place left that is still the item.\n */}\n {item.badge !== undefined ? (\n <span className=\"sidebar-nav__badge\">{item.badge}</span>\n ) : null}\n </>\n );\n\n const body =\n item.href !== undefined ? (\n <a\n className=\"sidebar-nav__item\"\n href={item.href}\n aria-current={current ? \"page\" : undefined}\n aria-disabled={item.disabled || undefined}\n data-part={`item-${item.value}`}\n onClick={press}\n >\n {inner}\n </a>\n ) : (\n <button\n type=\"button\"\n className=\"sidebar-nav__item\"\n aria-current={current ? \"page\" : undefined}\n aria-disabled={item.disabled || undefined}\n data-part={`item-${item.value}`}\n onClick={press}\n >\n {inner}\n </button>\n );\n\n return (\n <li key={item.value}>\n {collapsed ? (\n <Tooltip content={item.label} side=\"right\">\n {body}\n </Tooltip>\n ) : (\n body\n )}\n </li>\n );\n })}\n </ul>\n </div>\n );\n })}\n </nav>\n );\n}\n","import { useRef, useState } from \"react\";\nimport type { CSSProperties, PointerEvent, ReactNode } from \"react\";\nimport \"./Sheet.css\";\n\nexport type SheetDetent = \"peek\" | \"half\" | \"full\";\n\nexport type SheetProps = {\n /** What the sheet is about. Named, for the same reason `Drawer`'s is. */\n title: string;\n children: ReactNode;\n /** Which heights this sheet has, smallest first. Two is the common shape; three is the most. */\n detents?: SheetDetent[];\n /** Which one it is at. Controlled, because the page above it usually has an opinion. */\n detent: SheetDetent;\n onDetentChange: (detent: SheetDetent) => void;\n /**\n * The viewport, or the box it was put in.\n *\n * `AppShell` learned this one first: a panel with `100dvh` welded into it cannot be embedded,\n * demonstrated, or put in a gallery. The decision is enumerated rather than assumed.\n */\n fit?: \"viewport\" | \"container\";\n /** Under the body, out of the scroll — a confirm, a total, a pair of buttons. */\n footer?: ReactNode;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/** How far the finger travels before the direction is settled. */\nconst SLOP = 6;\n/** A flick this fast moves a detent however short it was, in px per millisecond. */\nconst FLICK = 0.5;\n\n/**\n * A panel from the bottom edge that stops at heights, over a page that keeps working.\n *\n * **This is not a `Drawer` with a `size` prop, and the difference is the page behind it.** A\n * drawer is a dialog: it takes the focus, makes the page inert, and asks to be finished with.\n * Every sheet in the reference set — Strava, Grab, Fi, Bump, Google Photos — sits over a map\n * the reader is still panning, and the sheet is the *index* to that map rather than a thing\n * interrupting it. Folding the two into one component would mean every use of it choosing\n * between two unrelated behaviours, which is the same reason `SidePanel` and `Drawer` are two\n * components.\n *\n * So: nothing here traps focus, nothing here goes inert, and there is no scrim. What a sheet\n * has instead is heights.\n *\n * **The heights are enumerated and the drag between them is not.** `data-detent` is a discrete\n * state and the stylesheet owns what each one is worth; `--sheet-pull` is the distance under a\n * finger, which no attribute can hold. That is the third place a value may go, and this and\n * `ListRow` are the two components that need it.\n *\n * **Only the handle drags.** A sheet whose body also dragged would be a sheet that cannot be\n * scrolled: the two gestures are the same finger on the same box, and the rule that tells them\n * apart — \"drag the sheet only when the body is already scrolled to the top\" — is a rule\n * readers discover by failing at it. The handle is a target that means one thing.\n *\n * **The handle is a button.** It steps to the next height and says which one it will land on,\n * so every detent is reachable without a pointer. A sheet that can only be resized by dragging\n * is a sheet with one height for a keyboard.\n */\nexport function Sheet({\n title,\n children,\n detents = [\"peek\", \"full\"],\n detent,\n onDetentChange,\n fit = \"viewport\",\n footer,\n className,\n ...rest\n}: SheetProps) {\n const panel = useRef<HTMLElement>(null);\n const drag = useRef<{ y: number; at: number; last: number; time: number; before: number; axis: boolean; resist: number } | null>(null);\n const [pull, setPull] = useState(0);\n const [dragging, setDragging] = useState(false);\n /*\n * A drag ends in a click, and the click would step again.\n *\n * `pointerup` is followed by `click` on the same element, so a drag to the next height\n * arrived there and then immediately went one further — two heights for one gesture, and\n * from `full` it wrapped back to `peek`. The handle is deliberately one target that means\n * two things, and this is the seam between them.\n */\n const dragged = useRef(false);\n\n const order = detents.length ? detents : ([\"peek\", \"full\"] as SheetDetent[]);\n const index = Math.max(0, order.indexOf(detent));\n const next = order[(index + 1) % order.length];\n\n const step = (by: number) => {\n const to = order[Math.min(order.length - 1, Math.max(0, index + by))];\n if (to !== detent) onDetentChange(to);\n };\n\n const start = (event: PointerEvent<HTMLButtonElement>) => {\n if (event.pointerType === \"mouse\" && event.button !== 0) return;\n /*\n * Captured here rather than once the direction is settled, and the handle's shape is why.\n *\n * `ListRow` waits: a row is tall enough that the first eight pixels are still inside it, so\n * the moves arrive either way. This handle is a twenty-pixel strip, and the first move of a\n * drag upward is already off it — the pointer left before there was anything to capture,\n * and the sheet received exactly one `pointerdown` and nothing else. Capturing on the press\n * costs nothing: `touch-action: none` is on this element alone, and a press that turns out\n * not to be a drag still ends in the click that steps.\n */\n event.currentTarget.setPointerCapture(event.pointerId);\n const resist = Number.parseFloat(\n getComputedStyle(event.currentTarget).getPropertyValue(\"--drag-resist\"),\n );\n drag.current = {\n y: event.clientY,\n at: event.clientY,\n last: event.clientY,\n time: event.timeStamp,\n before: event.timeStamp,\n axis: false,\n resist: resist || 0.5,\n };\n };\n\n const move = (event: PointerEvent<HTMLButtonElement>) => {\n const held = drag.current;\n if (!held) return;\n const dy = event.clientY - held.y;\n if (!held.axis) {\n if (Math.abs(dy) < SLOP) return;\n held.axis = true;\n setDragging(true);\n }\n held.last = held.at;\n held.at = event.clientY;\n held.before = held.time;\n held.time = event.timeStamp;\n\n /*\n * Down is positive and grows the pull; up shrinks the sheet's remaining travel. Both ends\n * rubber rather than stop: a boundary with no give reads as a dropped touch, and the token\n * that says how much give is the same one `ListRow` reads.\n */\n const room = panel.current?.offsetHeight ?? 0;\n let offset = dy;\n if (index === 0 && offset > 0) offset *= held.resist;\n if (index === order.length - 1 && offset < 0) offset *= held.resist;\n setPull(Math.max(-room, Math.min(room, offset)));\n };\n\n const release = (event: PointerEvent<HTMLButtonElement>) => {\n const held = drag.current;\n drag.current = null;\n setDragging(false);\n setPull(0);\n if (!held || !held.axis) return;\n /* Only a real release swallows the click that follows it. `pointercancel` is not followed\n * by one, so setting the flag there left it standing and ate the reader's next press. */\n if (event.type === \"pointerup\") dragged.current = true;\n\n const dy = event.clientY - held.y;\n const room = panel.current?.offsetHeight ?? 0;\n /*\n * Distance or speed, and speed is why the second half of this exists. A quarter of the\n * sheet is a long way to drag on a phone; a flick that never gets there still means \"more\"\n * or \"less\", and a sheet that ignores it feels stuck.\n */\n /*\n * Both halves of the speed come from the same two moves. Dividing the last move's distance\n * by the time since `pointerup` mixed two intervals: a release straight after a move gave\n * a one-millisecond denominator and turned almost every drag into a flick, and a finger\n * that paused before lifting read as motionless however fast it had been travelling.\n */\n const elapsed = Math.max(1, held.time - held.before);\n const speed = (held.at - held.last) / elapsed;\n const far = Math.abs(dy) > room / 4;\n const fast = Math.abs(speed) > FLICK;\n if (!far && !fast) return;\n /* A flick goes where the flick went. `dy` is the whole gesture, and a drag up that ends in\n * a downward flick means the downward one — that is the direction the hand last chose. */\n const toward = fast ? speed : dy;\n step(toward > 0 ? -1 : 1);\n };\n\n return (\n <section\n {...rest}\n ref={panel}\n className={`sheet ${className ?? \"\"}`.trim()}\n data-detent={detent}\n data-fit={fit}\n data-dragging={dragging ? \"\" : undefined}\n style={{ \"--sheet-pull\": `${pull}px` } as CSSProperties}\n aria-label={title}\n >\n {/*\n * One target that means one thing: it drags, and it is also the button that steps.\n * `aria-expanded` is deliberately absent — with three heights the sheet is not open or\n * shut, and a control that reports two states for three is a control that lies to a\n * screen reader once per press. The name carries the destination instead.\n */}\n <button\n type=\"button\"\n className=\"sheet__handle\"\n data-part=\"handle\"\n onPointerDown={start}\n onPointerMove={move}\n onPointerUp={release}\n onPointerCancel={release}\n onClick={() => {\n if (dragged.current) {\n dragged.current = false;\n return;\n }\n onDetentChange(next);\n }}\n >\n <span className=\"sheet__grip\" aria-hidden=\"true\" />\n <span className=\"sheet__handle-label\">{`${title} — ${LABEL[next]}`}</span>\n </button>\n\n <div className=\"sheet__head\">\n <h2 className=\"sheet__title\">{title}</h2>\n </div>\n\n {/*\n * The body scrolls and the scroll stops here. Without `overscroll-behavior: contain` a\n * flick that reaches the end of the sheet carries on into the page underneath, which is\n * the map the reader was looking at — so the sheet's last item and the map's position\n * are lost in the same gesture.\n */}\n <div className=\"sheet__body\" data-part=\"body\">\n {children}\n </div>\n\n {footer ? <div className=\"sheet__foot\">{footer}</div> : null}\n </section>\n );\n}\n\nconst LABEL: Record<SheetDetent, string> = {\n peek: \"살짝 열기\",\n half: \"반쯤 열기\",\n full: \"끝까지 열기\",\n};\n","import { useCallback, useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { Button } from \"../../common/Button\";\nimport \"./Spotlight.css\";\n\nexport type SpotlightSide = \"top\" | \"bottom\";\n\nexport type SpotlightStep = {\n /** This step's own name. Reaches the DOM as `data-step`, so a page can style or test one step. */\n id: string;\n /**\n * The mark on the thing this step is about — `data-spotlight=\"filters\"` on that element.\n *\n * A mark rather than a selector. A selector is a string that can match anything on the page,\n * and the failure mode of the wrong one is a hole cut somewhere nobody meant: it does not\n * throw, it just highlights the wrong thing. A mark is opt-in on the target, greppable, and\n * a step whose mark is not on the page is a step this component can see is unanchored.\n */\n target: string;\n title: string;\n body?: ReactNode;\n side?: SpotlightSide;\n};\n\nexport type SpotlightProps = {\n steps: SpotlightStep[];\n /** Which step, by index. `null` is closed. Controlled, because a tour is the page's state. */\n step: number | null;\n onStepChange: (step: number | null) => void;\n /** What the tour is. \"새 기능 안내\". Names the dialog. */\n label: string;\n /** The last step's button. \"완료\", \"시작하기\". */\n finishLabel?: string;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\ntype Hole = { x: number; y: number; width: number; height: number };\n\n/* What the browser will stop on inside the bubble. The bubble itself is `tabindex=\"-1\"`, so it\n * can be focused when a step opens without joining the cycle. */\nconst FOCUSABLE = 'a[href], button, input, select, textarea, [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * One thing on the page, lit, with a sentence about it.\n *\n * **The counter is not decoration.** Three of the five reference screens print \"3 of 3\" or\n * \"2/3\", and the two that did not are the ones that feel endless. A coach mark is an\n * interruption the reader did not ask for, and an interruption is bearable exactly as long as\n * its end is visible. So the count is required — there is no prop to turn it off.\n *\n * **The hole is measured, and the measurement is the third place a value may go.** An\n * arbitrary element's rectangle is four numbers that cannot be enumerated and have no element\n * attribute to live in, so the component writes them as its own custom properties and the\n * stylesheet decides what to do with them. Nothing here paints from a `style` attribute.\n *\n * **The scrim takes the presses.** Every reference dims the page and none of them lets the\n * highlighted control be used — a coach mark explains, and a reader who can press the thing\n * being explained is a reader halfway into a flow the tour was about to describe. Escape\n * leaves, which is the same door the skip button opens.\n *\n * **And because the scrim takes the presses, the focus has to stay off the page.** The bubble\n * is `aria-modal`, which tells a screen reader that everything outside it is hidden; a Tab that\n * walked out of it landed on controls the scrim will not let anyone press, so the reading order\n * and the focus disagreed and the keyboard reader was the one left holding nothing. Focus moves\n * into the bubble when a step opens, cycles inside it, and goes back to whatever opened the tour\n * when it closes.\n */\nexport function Spotlight({\n steps,\n step,\n onStepChange,\n label,\n finishLabel = \"완료\",\n className,\n ...rest\n}: SpotlightProps) {\n const current = step === null ? null : steps[step];\n const [hole, setHole] = useState<Hole | null>(null);\n /* The bubble's own height, because the vertical clamp below needs a number CSS cannot ask for:\n * `100% - <the height of this box>` has no form in a stylesheet. */\n const [bubbleHeight, setBubbleHeight] = useState(0);\n const bubbleRef = useRef<HTMLDivElement | null>(null);\n const returnTo = useRef<HTMLElement | null>(null);\n const open = step !== null;\n\n const measure = useCallback(() => {\n if (!current) return;\n const node = document.querySelector(`[data-spotlight=\"${CSS.escape(current.target)}\"]`);\n if (!node) {\n /* Unanchored rather than wrong: the sentence still shows, in the middle, with no hole.\n * A step whose mark has been renamed should still say what it came to say. */\n setHole(null);\n return;\n }\n const box = node.getBoundingClientRect();\n setHole({ x: box.x, y: box.y, width: box.width, height: box.height });\n }, [current]);\n\n useLayoutEffect(() => {\n if (!current) {\n setHole(null);\n return;\n }\n const node = document.querySelector(`[data-spotlight=\"${CSS.escape(current.target)}\"]`);\n node?.scrollIntoView({ block: \"nearest\", behavior: \"auto\" });\n measure();\n\n /*\n * The page under a tour is not still. A resize reflows it, a scroll moves it, and a hole\n * that was cut once is a hole over whatever ended up there — which is worse than no hole,\n * because it is confidently wrong. `capture` on the scroll listener because the thing that\n * scrolled is usually a container rather than the window.\n */\n window.addEventListener(\"resize\", measure);\n window.addEventListener(\"scroll\", measure, true);\n\n /*\n * The window can hold still while the subject does not. Content arrives, a label wraps at a\n * width nothing changed, a webfont swaps in and every box on the row grows a pixel — none of\n * that is a resize or a scroll, and the hole would stay on the rectangle the target used to\n * have. That is the confidently-wrong hole again, this time over the right element.\n */\n const observer = new ResizeObserver(measure);\n /* The border box, because that is the rectangle the hole is cut to. The default is the\n * content box, and padding appearing under a target that grew is exactly the change this\n * was added for — one the content box does not report. */\n if (node) observer.observe(node, { box: \"border-box\" });\n return () => {\n window.removeEventListener(\"resize\", measure);\n window.removeEventListener(\"scroll\", measure, true);\n observer.disconnect();\n };\n }, [current, measure]);\n\n /* The bubble measures itself for the same reason, and for one more: its height changes with the\n * step's own words, so the clamp that keeps it on screen has to be re-read per step. */\n useLayoutEffect(() => {\n const bubble = bubbleRef.current;\n if (!bubble) return;\n const read = () => setBubbleHeight(bubble.getBoundingClientRect().height);\n read();\n const observer = new ResizeObserver(read);\n observer.observe(bubble, { box: \"border-box\" });\n return () => observer.disconnect();\n }, [current]);\n\n /*\n * Where the focus was before the tour took it, and where it goes back to.\n *\n * Recorded once per opening rather than per step: the button that started the tour is where a\n * reader expects to be standing again afterwards, not the \"다음\" button of the step they were\n * on, which no longer exists.\n */\n useEffect(() => {\n if (!open) return;\n returnTo.current = document.activeElement as HTMLElement | null;\n return () => {\n const back = returnTo.current;\n returnTo.current = null;\n if (back?.isConnected) back.focus();\n };\n }, [open]);\n\n /* Into the bubble, on every step. The sentence is the thing that changed, and a reader who\n * cannot see the screen has to be standing on it to be told so. */\n useEffect(() => {\n if (step === null) return;\n bubbleRef.current?.focus();\n }, [step]);\n\n useEffect(() => {\n if (step === null) return;\n const key = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n onStepChange(null);\n return;\n }\n if (event.key !== \"Tab\") return;\n const bubble = bubbleRef.current;\n if (!bubble) return;\n\n /*\n * The cycle is closed by hand because nothing else closes it. `inert` on the rest of the\n * page is the other way, and it means reaching for every sibling of a component that does\n * not own the page it is drawn over.\n */\n const stops = Array.from(bubble.querySelectorAll<HTMLElement>(FOCUSABLE)).filter(\n (node) => !node.hasAttribute(\"disabled\") && node.getAttribute(\"aria-disabled\") !== \"true\",\n );\n if (stops.length === 0) {\n event.preventDefault();\n bubble.focus();\n return;\n }\n const first = stops[0];\n const last = stops[stops.length - 1];\n const here = document.activeElement;\n const inside = bubble.contains(here);\n if (event.shiftKey ? here === first || !inside || here === bubble : here === last || !inside) {\n event.preventDefault();\n (event.shiftKey ? last : first).focus();\n }\n };\n document.addEventListener(\"keydown\", key);\n return () => document.removeEventListener(\"keydown\", key);\n }, [step, onStepChange]);\n\n if (step === null || !current) return null;\n\n const last = step === steps.length - 1;\n const side = current.side ?? \"bottom\";\n\n return (\n <div\n {...rest}\n className={`spotlight ${className ?? \"\"}`.trim()}\n data-anchored={hole ? \"\" : undefined}\n data-side={side}\n /* Which step is showing, by the name the caller gave it. */\n data-step={current.id}\n style={\n hole\n ? ({\n \"--spot-x\": `${hole.x}px`,\n \"--spot-y\": `${hole.y}px`,\n \"--spot-w\": `${hole.width}px`,\n \"--spot-h\": `${hole.height}px`,\n \"--spot-bubble-h\": `${bubbleHeight}px`,\n } as CSSProperties)\n : undefined\n }\n >\n {/*\n * The scrim is one box with an enormous spread shadow, so the hole is the box itself and\n * the dark is the shadow around it. Four dimmed rectangles around a gap is the other way\n * to do it, and it cannot round the corners of the thing it is lighting.\n */}\n <div className=\"spotlight__scrim\" data-part=\"scrim\" />\n\n <div\n /* Keyed by the step, so one step's bubble is never the previous step's box with new words\n * in it — the height this component measures would otherwise be read a frame late. */\n key={current.id}\n ref={bubbleRef}\n className=\"spotlight__bubble\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={label}\n /* Focusable but not in the cycle: a step opens with the focus here, on the sentence. */\n tabIndex={-1}\n data-part=\"bubble\"\n >\n <p className=\"spotlight__title\">{current.title}</p>\n {current.body ? <p className=\"spotlight__body\">{current.body}</p> : null}\n\n <div className=\"spotlight__foot\">\n {/*\n * The end, in a number. Required, not a prop — see the note on the component.\n * `tabular-nums` so \"9 / 12\" does not shuffle sideways on the way to \"10 / 12\".\n */}\n <p className=\"spotlight__count\" data-part=\"count\">\n {`${step + 1} / ${steps.length}`}\n </p>\n <Button variant=\"plain\" size=\"sm\" tone=\"neutral\" onClick={() => onStepChange(null)} data-part=\"skip\">\n 건너뛰기\n </Button>\n {step > 0 ? (\n <Button variant=\"outline\" size=\"sm\" onClick={() => onStepChange(step - 1)} data-part=\"back\">\n 이전\n </Button>\n ) : null}\n <Button\n variant=\"solid\"\n size=\"sm\"\n onClick={() => onStepChange(last ? null : step + 1)}\n data-part=\"next\"\n >\n {last ? finishLabel : \"다음\"}\n </Button>\n </div>\n </div>\n </div>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { Check } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport { VisuallyHidden } from \"../../common/VisuallyHidden\";\nimport \"./Stepper.css\";\n\nexport type StepStatus = \"done\" | \"current\" | \"upcoming\" | \"error\";\nexport type StepperOrientation = \"horizontal\" | \"vertical\";\n\nexport type Step = {\n value: string;\n label: ReactNode;\n description?: ReactNode;\n /** Only a finished step can be gone back to. An unfinished one has nothing to show. */\n onClick?: () => void;\n};\n\nexport type StepperProps = {\n steps: Step[];\n /** The step the reader is on. Everything before it is done, everything after is to come. */\n current: string;\n /** Steps that were finished but came back wrong. Drawn as errors wherever they are. */\n errors?: string[];\n /** What the sequence is. \"주문 절차\", \"가입 단계\". Names the list. */\n label: string;\n orientation?: StepperOrientation;\n size?: \"sm\" | \"md\";\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * Where the reader is in a sequence, and how much is left.\n *\n * An ordered list, because a stepper is a list of steps in order and a reader is told how\n * many there are before walking them. `aria-current=\"step\"` marks the one they are on —\n * `\"step\"` and not `\"true\"`, which is the difference between \"this step\" and \"this thing\".\n *\n * The state is said in words as well as drawn. A tick, a filled circle and an empty one are\n * three states to a reader who can see them and one to everybody else, so each marker\n * carries its status as hidden text.\n */\nexport function Stepper({\n steps,\n current,\n errors = [],\n label,\n orientation = \"horizontal\",\n size = \"md\",\n className,\n ...rest\n}: StepperProps) {\n const index = steps.findIndex((step) => step.value === current);\n\n /*\n * A `current` that matches nothing is a stepper with no current step: every step draws as\n * `upcoming` and no `aria-current=\"step\"` is written anywhere. Nothing throws and the screen\n * looks plausible, so it has to be said out loud where it can still be fixed. Development\n * only — a shipped page gains nothing from a console it has no reader for.\n */\n if (import.meta.env.DEV && index < 0) {\n console.error(\n `Stepper: current=\"${current}\" matches no step (${steps.map((step) => step.value).join(\", \")}). ` +\n \"No step is marked as the current one.\",\n );\n }\n\n const statusOf = (step: Step, position: number): StepStatus => {\n if (errors.includes(step.value)) return \"error\";\n if (position < index) return \"done\";\n if (position === index) return \"current\";\n return \"upcoming\";\n };\n\n const WORD: Record<StepStatus, string> = {\n done: \"완료\",\n current: \"진행 중\",\n upcoming: \"남음\",\n error: \"확인 필요\",\n };\n\n return (\n /*\n * `role=\"list\"` on a list: `list-style: none` makes Safari drop the list semantics, so the\n * sequence stops being \"4단계 목록\" and becomes four loose lines.\n */\n <ol\n {...rest}\n role=\"list\"\n className={`stepper ${className ?? \"\"}`.trim()}\n aria-label={label}\n data-orientation={orientation}\n data-size={size}\n >\n {steps.map((step, position) => {\n const status = statusOf(step, position);\n /*\n * Position decides, not status. `errors` is a drawing — a step can be marked wrong\n * wherever it is — and it used to make the step a button too, which handed the reader\n * a way to skip forward into a step they had not reached.\n */\n const reachable = Boolean(step.onClick) && position < index;\n\n const body = (\n <>\n <span className=\"stepper__marker\" aria-hidden=\"true\">\n {status === \"done\" ? <Icon icon={Check} size=\"xs\" /> : position + 1}\n </span>\n <span className=\"stepper__text\">\n <span className=\"stepper__label\">\n {step.label}\n <VisuallyHidden>{` — ${WORD[status]}`}</VisuallyHidden>\n </span>\n {step.description ? (\n <span className=\"stepper__description\">{step.description}</span>\n ) : null}\n </span>\n </>\n );\n\n return (\n <li\n className=\"stepper__step\"\n key={step.value}\n data-status={status}\n aria-current={status === \"current\" ? \"step\" : undefined}\n data-part={`step-${step.value}`}\n >\n {reachable ? (\n <button type=\"button\" className=\"stepper__back\" onClick={step.onClick}>\n {body}\n </button>\n ) : (\n <span className=\"stepper__still\">{body}</span>\n )}\n {/* The line to the next step. A drawing of \"and then\", so it says nothing. */}\n {position < steps.length - 1 ? (\n <span className=\"stepper__line\" aria-hidden=\"true\" />\n ) : null}\n </li>\n );\n })}\n </ol>\n );\n}\n","import { useState } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { ArrowDown, ArrowUp, ChevronsUpDown } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport { Checkbox } from \"../../common/Checkbox\";\nimport { Skeleton } from \"../../common/Skeleton\";\nimport { VisuallyHidden } from \"../../common/VisuallyHidden\";\nimport \"./Table.css\";\n\nexport type TableAlign = \"start\" | \"center\" | \"end\";\nexport type TableWidth = \"auto\" | \"hug\" | \"grow\";\nexport type SortDirection = \"ascending\" | \"descending\";\n\nexport type TableColumn<T> = {\n key: string;\n header: ReactNode;\n cell: (row: T) => ReactNode;\n align?: TableAlign;\n /**\n * Figures that sit in a column and must not shift as they change.\n *\n * Also aligns the column to its end, because a number is read from its last digit: a\n * column of 9, 84 and 1,203 ranged left is a column whose magnitudes cannot be compared at\n * a glance.\n */\n numeric?: boolean;\n sortable?: boolean;\n /**\n * `hug` shrinks the column to its content, `grow` gives it whatever is left.\n *\n * Enumerated rather than taken as a length, because a length from a prop can only reach\n * the element as a style attribute — the one place in this library a value cannot be moved\n * from. An adopter who needs an exact width sets it from their own stylesheet.\n */\n width?: TableWidth;\n};\n\nexport type TableProps<T> = {\n columns: TableColumn<T>[];\n rows: T[];\n rowKey: (row: T) => string;\n /**\n * What the table is a table of. Required.\n *\n * Becomes the `<caption>`, which is the only thing that names a table to a reader who\n * lands on it out of context — and every table on a page of three is otherwise \"table with\n * 5 columns, 12 rows\".\n */\n caption: ReactNode;\n captionHidden?: boolean;\n sort?: { key: string; direction: SortDirection };\n onSortChange?: (sort: { key: string; direction: SortDirection }) => void;\n selectedKeys?: string[];\n onSelectionChange?: (keys: string[]) => void;\n /** Names the selection checkbox for each row: \"김민수 고르기\". */\n rowLabel?: (row: T) => string;\n /** The header stays put while the body scrolls under it. */\n stickyHeader?: boolean;\n /**\n * 줄 하나하나에 붙는 속성.\n *\n * 표 스스로 가질 수 없는 동작 — 놓을 자리를 받는 것, 줄을 여는 것 — 을 표를 쓰는 쪽이\n * 붙이는 자리입니다. `style`은 받지 않습니다: 값을 스타일 속성으로 옮기는 것은 이\n * 저장소가 막는 것이고, 여기를 열면 그 규칙에 구멍이 납니다.\n */\n rowProps?: (row: T) => Omit<HTMLAttributes<HTMLTableRowElement>, \"style\" | \"className\">;\n /**\n * Row density, and it reaches the DOM as `data-row-density` rather than `data-density`.\n *\n * `[data-density]` is the page-level scope that rescales `--space-*` for everything under\n * it. If this component minted the same attribute, `<Table density=\"compact\">` would match\n * that scope too and rescale the whole subtree — the rows would compact once here and\n * again through every token inside them, and a badge in a compact row would shrink for a\n * reason nobody could find. The two are different variations: one is how much room this\n * component gives its rows, the other is how much room the page gives everything.\n */\n density?: \"comfortable\" | \"compact\";\n /**\n * Which cells changed under the reader, and what makes each change distinct.\n *\n * Returns a token for a cell that changed without this reader doing it — an updated-at, a\n * version, the new value itself — and `undefined` for one that did not. The cell flashes\n * once each time the token it is given differs from the one it was drawn with.\n *\n * A token rather than a boolean, because a flag cannot say \"and again\": a cell that is\n * still `true` when the same value is pushed twice has no way to announce the second, and\n * a host flipping the flag back would be running a timer against an animation that already\n * owns one. And a token rather than the component diffing what it rendered — only the host\n * knows whether a value is different because a colleague edited it or because the page\n * refetched the same answer, and flashing a whole table after a refresh is worse than\n * flashing nothing.\n *\n * Nothing flashes on the first paint, and that falls out rather than being guarded: on the\n * first paint nothing has changed, so a host that answers honestly returns `undefined`\n * everywhere.\n */\n changed?: (row: T, column: TableColumn<T>) => string | number | undefined;\n /** What to show instead of an empty `<tbody>`. */\n empty?: ReactNode;\n /**\n * The table is waiting for its rows.\n *\n * It draws its own skeleton — the right number of columns, at the right widths, at the\n * height a row will be — because it is the only thing that knows them. `Skeleton` has\n * existed the whole time and every adopter still had to rebuild this table's shape out of\n * it, which means every adopter's waiting state was a slightly different table.\n *\n * A table is drawn before its data in production every single time. This is not an edge.\n */\n loading?: boolean;\n /** How many placeholder rows. Enough to look like a table, few enough not to look like data. */\n loadingRows?: number;\n /**\n * What went wrong, in words the reader can act on.\n *\n * With no rows it takes the table over: error, then loading, then empty. A table that failed\n * to load is not an empty table, and telling the reader \"결과가 없습니다\" when the request\n * threw is the failure that ordering exists to prevent — they change the filter, try again,\n * fail again, and nothing ever says why.\n *\n * With rows it is drawn **above** them instead of instead of them, because a host that hands\n * over both is saying those rows survived the failure. The table cannot work that out on its\n * own — only the host knows where a row came from — so the pair is the sentence: rows that\n * did not survive are not passed. An upload screen is the case that named this: the server's\n * listing failed while the reader's own files were still going up, and wiping the table took\n * an upload in progress off the screen. A host with nothing left to show passes `rows={[]}`\n * and gets the whole table back.\n */\n error?: ReactNode;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * Rows and columns, in a real `<table>`.\n *\n * Not a grid of divs with roles bolted on. A table element gives a reader the row and column\n * count, the header a cell belongs to, and the table navigation commands every screen reader\n * has — and every one of those has to be rebuilt, by hand and usually wrongly, the moment it\n * becomes a `<div role=\"table\">`.\n *\n * The scroll container is focusable on purpose. A region that scrolls sideways and cannot be\n * focused cannot be scrolled by anyone using a keyboard, which is the failure this pattern\n * exists to avoid — and it needs a name, or it is announced as an unlabelled group.\n */\nexport function Table<T>({\n columns,\n rows,\n rowKey,\n caption,\n captionHidden,\n sort,\n onSortChange,\n selectedKeys,\n onSelectionChange,\n rowLabel,\n stickyHeader,\n rowProps,\n density = \"comfortable\",\n changed,\n empty,\n loading,\n loadingRows = 3,\n error,\n className,\n ...rest\n}: TableProps<T>) {\n const selectable = Boolean(onSelectionChange);\n const selected = new Set(selectedKeys ?? []);\n const allKeys = rows.map(rowKey);\n const every = allKeys.length > 0 && allKeys.every((key) => selected.has(key));\n const some = allKeys.some((key) => selected.has(key));\n\n /*\n * One state, decided once: error, then loading, then empty, then rows.\n *\n * The rows used to be drawn whenever `loading` was false, so a table that failed kept the\n * rows it had before the request threw sitting under the alert — the reader is told it\n * failed and shown values anyway, with nothing saying which of the two to believe.\n *\n * Which is why the failure only takes the table over when there is nothing else in it. A\n * host that passes rows *and* an error is not handing over the stale ones — it has already\n * dropped those — it is saying these came from somewhere the failure did not reach. The\n * error is then said above them rather than in place of them. Wiping the table instead took\n * a reader's own uploads off the screen because a listing request they never made failed.\n */\n const failed = Boolean(error);\n const state = failed && rows.length === 0 ? \"error\" : loading ? \"loading\" : rows.length === 0 ? \"empty\" : \"rows\";\n /* Said above the rows, never at the same time as the state below. */\n const [scrolled, setScrolled] = useState(false);\n\n const banner = failed && state === \"rows\";\n\n /*\n * Select-all adds or removes this page's keys and leaves the rest of the selection alone.\n *\n * Replacing the whole array is what a one-page table looks like from the inside, and it\n * silently drops everything the reader chose on the pages before this one.\n */\n const toggleAll = () => {\n const next = new Set(selected);\n for (const key of allKeys) {\n if (every) next.delete(key);\n else next.add(key);\n }\n onSelectionChange?.([...next]);\n };\n\n const toggleRow = (key: string) => {\n const next = new Set(selected);\n if (next.has(key)) next.delete(key);\n else next.add(key);\n onSelectionChange?.([...next]);\n };\n\n /* A column is sortable here only if it is flagged *and* somebody is listening. */\n const sortableHere = (column: TableColumn<T>) => Boolean(column.sortable && onSortChange);\n\n const nextDirection = (key: string): SortDirection =>\n sort?.key === key && sort.direction === \"ascending\" ? \"descending\" : \"ascending\";\n\n return (\n <div\n {...rest}\n className={`table ${className ?? \"\"}`.trim()}\n data-row-density={density}\n data-sticky={stickyHeader ? \"\" : undefined}\n >\n {banner ? (\n <div className=\"table__state\" data-part=\"error\" data-place=\"above\" role=\"alert\">\n {error}\n </div>\n ) : null}\n <div\n className=\"table__scroll\"\n tabIndex={0}\n /*\n * 내용이 머리 줄 아래로 지나가기 시작하면 그림자가 생깁니다.\n *\n * 붙어 있는 머리 줄은 붙어 있다는 말을 스스로 해야 합니다 — 선 하나만 늘 그려 두면\n * 처음부터 그 자리였던 것과 구별되지 않습니다. 참조 구현도 스크롤이 시작될 때만\n * 그림자를 답니다.\n */\n data-scrolled={scrolled ? \"\" : undefined}\n onScroll={(event) => {\n const now = event.currentTarget.scrollTop > 0;\n if (now !== scrolled) setScrolled(now);\n }}\n role=\"group\"\n /*\n * The name says which way the region actually scrolls. `[data-sticky]` caps the box\n * and turns on `overflow-y` as well, and a region announced as \"scrolls sideways\"\n * that also scrolls down tells a keyboard reader the arrow key they need is the one\n * that does nothing.\n */\n aria-label={`${typeof caption === \"string\" ? caption : \"표\"} — ${\n stickyHeader ? \"가로·세로로 스크롤\" : \"가로로 스크롤\"\n }`}\n >\n <table className=\"table__grid\">\n <caption className=\"table__caption\">\n {captionHidden ? <VisuallyHidden>{caption}</VisuallyHidden> : caption}\n </caption>\n <thead className=\"table__head\">\n <tr>\n {selectable ? (\n <th scope=\"col\" className=\"table__cell\" data-width=\"hug\">\n <Checkbox\n checked={every}\n indeterminate={some && !every}\n onChange={toggleAll}\n /* One name, whatever the state. Checked is already announced as checked,\n * and a control that renames itself as it is pressed is a different\n * control every time a reader comes back to it. */\n aria-label=\"모두 고르기\"\n data-part=\"select-all\"\n />\n </th>\n ) : null}\n {columns.map((column) => {\n const active = sort?.key === column.key;\n return (\n <th\n key={column.key}\n scope=\"col\"\n className=\"table__cell\"\n data-align={column.align ?? (column.numeric ? \"end\" : \"start\")}\n data-width={column.width ?? \"auto\"}\n data-numeric={column.numeric ? \"\" : undefined}\n /* `none` rather than omitted on the other sortable columns: it is what\n * tells a reader the column *can* be sorted and currently is not.\n *\n * Only when the column can actually be sorted, which needs a handler as\n * well as the flag. A table given `sortable` columns and no\n * `onSortChange` drew four header buttons that took a tab stop, said\n * `aria-sort=\"none\"` and did nothing when pressed — a promise the caller\n * never wired. `ScrollArea` settled the same question the same way: a tab\n * stop that goes nowhere is worse than no tab stop. */\n aria-sort={sortableHere(column) ? (active ? sort!.direction : \"none\") : undefined}\n >\n {sortableHere(column) ? (\n <button\n type=\"button\"\n className=\"table__sort\"\n onClick={() => onSortChange!({ key: column.key, direction: nextDirection(column.key) })}\n data-part={`sort-${column.key}`}\n >\n <span className=\"table__sort-label\">{column.header}</span>\n <Icon\n icon={active ? (sort!.direction === \"ascending\" ? ArrowUp : ArrowDown) : ChevronsUpDown}\n size=\"xs\"\n className=\"table__sort-mark\"\n />\n </button>\n ) : (\n column.header\n )}\n </th>\n );\n })}\n </tr>\n </thead>\n <tbody className=\"table__body\" aria-busy={state === \"loading\" || undefined}>\n {state === \"loading\"\n ? Array.from({ length: loadingRows }, (_, index) => (\n <tr key={`waiting-${index}`} className=\"table__row\" data-part=\"waiting-row\">\n {selectable ? (\n <td className=\"table__cell\" data-width=\"hug\">\n <Skeleton shape=\"rect\" size=\"sm\" />\n </td>\n ) : null}\n {columns.map((column) => (\n <td\n key={column.key}\n className=\"table__cell\"\n data-align={column.align ?? (column.numeric ? \"end\" : \"start\")}\n data-width={column.width ?? \"auto\"}\n >\n <Skeleton shape=\"text\" lines={1} />\n </td>\n ))}\n </tr>\n ))\n : null}\n {state === \"loading\" || state === \"error\" ? null : rows.map((row) => {\n const key = rowKey(row);\n return (\n <tr\n key={key}\n {...rowProps?.(row)}\n className=\"table__row\"\n data-selected={selected.has(key) ? \"\" : undefined}\n >\n {selectable ? (\n <td className=\"table__cell\" data-width=\"hug\">\n <Checkbox\n checked={selected.has(key)}\n onChange={() => toggleRow(key)}\n aria-label={rowLabel ? `${rowLabel(row)} 고르기` : \"이 줄 고르기\"}\n data-part=\"select-row\"\n />\n </td>\n ) : null}\n {columns.map((column) => (\n <td\n key={column.key}\n className=\"table__cell\"\n data-align={column.align ?? (column.numeric ? \"end\" : \"start\")}\n data-width={column.width ?? \"auto\"}\n data-numeric={column.numeric ? \"\" : undefined}\n >\n {/*\n * Keyed by the token, so the element re-mounts — and its animation\n * runs again — every time the cell is told something else. Behind the\n * text rather than over it: a tint laid on top would wash out the very\n * value it is pointing at.\n */}\n {(() => {\n const token = changed?.(row, column);\n return token === undefined ? null : (\n <span\n key={token}\n className=\"table__flash\"\n data-part=\"flash\"\n aria-hidden=\"true\"\n />\n );\n })()}\n {column.cell(row)}\n </td>\n ))}\n </tr>\n );\n })}\n </tbody>\n </table>\n </div>\n {/*\n * One place, one order: error, then loading, then empty. Two of these on screen at\n * once is a table that failed *and* has no rows, which is one fact told twice.\n */}\n {state === \"error\" ? (\n <div className=\"table__state\" role=\"alert\" data-part=\"error\">\n {error}\n </div>\n ) : state === \"empty\" && empty ? (\n <div className=\"table__state\" data-part=\"empty\">{empty}</div>\n ) : null}\n </div>\n );\n}\n","import { useEffect, useId, useLayoutEffect, useRef, useState } from \"react\";\nimport type { CSSProperties, KeyboardEvent, ReactNode } from \"react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport type { IconSize } from \"../../common/Icon\";\nimport \"./Tabs.css\";\n\nexport type TabsVariant = \"underline\" | \"pill\" | \"soft\" | \"enclosed\";\nexport type TabsActivation = \"automatic\" | \"manual\";\nexport type TabsLevel = 1 | 2 | 3;\nexport type TabsSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"xxl\";\n\nconst ICON_SIZE: Record<TabsSize, IconSize> = {\n xs: \"xs\",\n sm: \"sm\",\n md: \"sm\",\n lg: \"md\",\n xl: \"lg\",\n xxl: \"lg\",\n};\n\nexport type TabItem = {\n value: string;\n label: ReactNode;\n icon?: LucideIcon;\n /** A count or a dot at the end of the tab. Decorative — the label says what the tab is. */\n badge?: ReactNode;\n disabled?: boolean;\n};\n\nexport type TabsProps = {\n tabs: TabItem[];\n value: string;\n onValueChange: (value: string) => void;\n /** What the tabs choose between. \"주문 보기\", \"설정 구역\". Names the tab list. */\n label: string;\n children: ReactNode;\n /**\n * Arrow keys change the tab, or only move the focus.\n *\n * `automatic` is right when the panel is already loaded — a reader arrowing across four\n * tabs sees four panels and that is what they asked for. `manual` is right when a tab\n * costs a request: arrowing across four would fire four of them, and three would be\n * thrown away.\n */\n activation?: TabsActivation;\n variant?: TabsVariant;\n size?: TabsSize;\n /** Indentation and panel spacing for nested lists. Does not override size. */\n level?: TabsLevel;\n /** The tabs share the width equally instead of hugging their labels. */\n fitted?: boolean;\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * A few panels, one at a time.\n *\n * Roving tabindex: the whole tab list is one stop on the Tab key and the arrow keys move\n * within it. That is the pattern a reader expects from a tab list and the reason it differs\n * from `ButtonGroup`, where every button keeps its own stop — a group of separate actions\n * has no \"current\" one to return to, and a tab list does.\n */\nexport function Tabs({\n tabs,\n value,\n onValueChange,\n label,\n children,\n activation = \"automatic\",\n variant = \"underline\",\n size = \"md\",\n level = 1,\n fitted,\n className,\n ...rest\n}: TabsProps) {\n const base = useId();\n const list = useRef<HTMLDivElement>(null);\n\n /*\n * Where the underline is, measured.\n *\n * The tab list is the one place in this library where a position cannot be enumerated the\n * way `SegmentedControl`'s thumb is: its segments are equal fractions of a track, and these\n * are labels of whatever length the adopter passed. So this is the third place a value may\n * go — a custom property the component writes and its own stylesheet reads — and the first\n * use of it. It is not a paint declaration, so the adopter can still change what the rule\n * that reads it does.\n *\n * `offsetLeft` against `offsetWidth`, and the stylesheet spends them on physical `left` and\n * `width` rather than the logical pair. `SegmentedControl` avoids `translateX` because the\n * value it writes is direction-agnostic and a physical property would send it the wrong way\n * in a right-to-left page. This value is the opposite: it is measured in the offset parent's\n * physical coordinates, so a physical property is the one that agrees with it, in both\n * directions.\n */\n const [rail, setRail] = useState<{ start: number; size: number } | null>(null);\n const [armed, setArmed] = useState(false);\n\n useLayoutEffect(() => {\n if (variant !== \"underline\") return;\n const node = list.current;\n if (!node) return;\n\n const measure = () => {\n const tab = node.querySelector<HTMLElement>(`[data-value=\"${CSS.escape(value)}\"]`);\n if (tab) setRail({ start: tab.offsetLeft, size: tab.offsetWidth });\n };\n measure();\n\n /*\n * The tabs are watched, not only the list. A web font arriving changes every label's width\n * without changing the list's, and the underline would sit under where the text used to\n * be until something else happened to move it.\n */\n const observer = new ResizeObserver(measure);\n observer.observe(node);\n for (const tab of node.querySelectorAll<HTMLElement>(\".tabs__tab\")) observer.observe(tab);\n return () => observer.disconnect();\n }, [value, tabs, variant, size, level, fitted]);\n\n /*\n * Armed one paint after the first measurement, so the underline does not travel in from\n * nowhere on mount — a component that animates itself into existence is a component that\n * looks broken in a list of eight of them. Until then the chosen tab keeps the static rule\n * it has always had, which is also what a reader gets if this never measures at all.\n */\n useEffect(() => {\n if (rail && !armed) setArmed(true);\n }, [rail, armed]);\n\n const enabled = tabs.filter((tab) => !tab.disabled);\n const move = (from: string, step: number) => {\n if (enabled.length === 0) return;\n const index = enabled.findIndex((tab) => tab.value === from);\n /* Wraps, like a native radio group and like every tab list a reader has met. */\n const next = enabled[(index + step + enabled.length) % enabled.length];\n list.current?.querySelector<HTMLButtonElement>(`[data-value=\"${CSS.escape(next.value)}\"]`)?.focus();\n if (activation === \"automatic\") onValueChange(next.value);\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n const current = (event.target as HTMLElement).dataset.value;\n if (!current) return;\n const keys: Record<string, () => void> = {\n ArrowRight: () => move(current, 1),\n ArrowLeft: () => move(current, -1),\n Home: () => move(enabled[0]?.value ?? current, 0),\n End: () => move(enabled.at(-1)?.value ?? current, 0),\n };\n const handler = keys[event.key];\n if (!handler) return;\n event.preventDefault();\n handler();\n };\n\n return (\n <div\n {...rest}\n className={`tabs ${className ?? \"\"}`.trim()}\n data-variant={variant}\n data-size={size}\n data-level={level}\n data-fitted={fitted ? \"\" : undefined}\n >\n <div\n ref={list}\n className=\"tabs__list\"\n role=\"tablist\"\n aria-label={label}\n onKeyDown={onKeyDown}\n data-armed={armed ? \"\" : undefined}\n style={\n rail\n ? ({\n \"--tabs-indicator-start\": `${rail.start}px`,\n \"--tabs-indicator-size\": `${rail.size}px`,\n } as CSSProperties)\n : undefined\n }\n >\n {tabs.map((tab) => {\n const active = tab.value === value;\n return (\n <button\n key={tab.value}\n type=\"button\"\n role=\"tab\"\n className=\"tabs__tab\"\n id={`${base}-${tab.value}`}\n data-value={tab.value}\n aria-selected={active}\n aria-controls={`${base}-panel`}\n /* One stop for the list. Every other tab is out of the Tab order, which is\n * what makes the arrow keys the way through it. */\n tabIndex={active ? 0 : -1}\n disabled={tab.disabled}\n onClick={() => onValueChange(tab.value)}\n >\n {tab.icon ? <Icon icon={tab.icon} size={ICON_SIZE[size]} /> : null}\n <span className=\"tabs__label\">{tab.label}</span>\n {tab.badge !== undefined ? <span className=\"tabs__badge\">{tab.badge}</span> : null}\n </button>\n );\n })}\n\n {/* Decoration for the state `aria-selected` already carries, so it is hidden. */}\n {variant === \"underline\" ? <span className=\"tabs__indicator\" aria-hidden=\"true\" /> : null}\n </div>\n\n {/*\n * `tabindex=0` on the panel, so a panel of plain text can be reached and scrolled by a\n * keyboard. A panel whose first child is focusable does not strictly need it, and a\n * component cannot know which it has been given.\n */}\n <div\n className=\"tabs__panel\"\n role=\"tabpanel\"\n id={`${base}-panel`}\n aria-labelledby={`${base}-${value}`}\n tabIndex={0}\n >\n {children}\n </div>\n </div>\n );\n}\n","/**\n * Times of day as `HH:mm` strings, never as `Date` objects.\n *\n * The same rule `dates.ts` states for calendar days, for the same reason: a `Date` is a\n * moment, and \"회의는 9시 30분\" is not one. `new Date(\"2026-08-25T09:30\")` is a different\n * instant in every time zone, and the hour a reader typed is not supposed to move when they\n * fly somewhere. Nothing here builds a `Date` at all — a time of day is arithmetic on\n * minutes, and minutes are integers.\n *\n * Inside, a time is the number of minutes since midnight: 0 to 1439. That makes every\n * question below one subtraction — is it inside the window, is it on the step grid, what is\n * the next one up — instead of two-field carrying.\n */\nexport type Time = string;\n\nexport const DAY = 24 * 60;\n\n/** Minutes since midnight → `HH:mm`. Values outside the day are brought back inside it. */\nexport function toTime(minutes: number): Time {\n const total = ((Math.round(minutes) % DAY) + DAY) % DAY;\n return `${String(Math.floor(total / 60)).padStart(2, \"0\")}:${String(total % 60).padStart(2, \"0\")}`;\n}\n\n/**\n * `HH:mm` → minutes since midnight, or null.\n *\n * `null` rather than a throw: a value straight out of a database can be `\"9:5\"` or `\"25:00\"`,\n * and everything below has somewhere to fall back to where a `TypeError` inside a render\n * does not.\n */\nexport function parseTime(value: string | null | undefined): number | null {\n if (!value) return null;\n const match = /^(\\d{2}):(\\d{2})$/.exec(value.trim());\n if (!match) return null;\n const hour = Number(match[1]);\n const minute = Number(match[2]);\n if (hour > 23 || minute > 59) return null;\n return hour * 60 + minute;\n}\n\n/** The window a value is allowed in, in minutes. */\nexport function timeWindow(min?: Time, max?: Time): [number, number] {\n return [parseTime(min) ?? 0, parseTime(max) ?? DAY - 1];\n}\n\nexport const clampTime = (minutes: number, lo: number, hi: number) => Math.min(Math.max(minutes, lo), hi);\n\n/**\n * The nearest time `step` allows, counted from `origin`.\n *\n * `step` is minutes, and the grid it makes starts at `min` when there is one — which is what\n * `<input type=\"time\">` does, and the only choice that makes a 09:00 opening hour with a\n * 90-minute step land on 09:00, 10:30, 12:00 rather than on 09:00, 10:00, 11:30.\n *\n * Ties go down, so a reader who types 07 with a ten-minute step gets 05 rather than 10 —\n * both are equally near, and the earlier one is the one they can still fix by pressing up.\n */\nexport function snapTime(minutes: number, step: number, origin: number): number {\n if (step <= 1) return Math.round(minutes);\n const offset = minutes - origin;\n const below = Math.floor(offset / step) * step;\n const above = below + step;\n return origin + (offset - below <= above - offset ? below : above);\n}\n\n/** The next time up or down the grid, from wherever the value is now. */\nexport function stepTime(minutes: number, step: number, origin: number, direction: 1 | -1): number {\n const size = Math.max(1, Math.round(step));\n const offset = minutes - origin;\n const next =\n direction === 1 ? Math.floor(offset / size) * size + size : Math.ceil(offset / size) * size - size;\n return origin + next;\n}\n\n/** Whether a time sits on the grid `step` makes. Off-grid values are what gets filtered. */\nexport const onGrid = (minutes: number, step: number, origin: number) =>\n step <= 1 || (((minutes - origin) % step) + step) % step === 0;\n\n/** \"오후 2:30\" — the twelve-hour reading, which is how a Korean reader says the time aloud. */\nexport function format12(minutes: number): string {\n const hour = Math.floor(minutes / 60);\n const half = hour < 12 ? \"오전\" : \"오후\";\n const shown = hour % 12 === 0 ? 12 : hour % 12;\n return `${half} ${shown}:${String(minutes % 60).padStart(2, \"0\")}`;\n}\n\n/** \"14시, 오후 2시 30분\" — both readings, for the segment a screen reader is sitting on. */\nexport function speak(minutes: number): string {\n const hour = Math.floor(minutes / 60);\n const half = hour < 12 ? \"오전\" : \"오후\";\n const shown = hour % 12 === 0 ? 12 : hour % 12;\n return `${hour}시 ${minutes % 60}분, ${half} ${shown}시 ${minutes % 60}분`;\n}\n","import { useId, useRef, useState } from \"react\";\nimport type { ChangeEvent, FocusEvent, KeyboardEvent } from \"react\";\nimport { VisuallyHidden } from \"../../common/VisuallyHidden\";\nimport {\n clampTime,\n format12,\n onGrid,\n parseTime,\n speak,\n snapTime,\n stepTime,\n timeWindow,\n toTime,\n type Time,\n} from \"./times\";\nimport \"./TimeInput.css\";\n\nexport type TimeInputProps = {\n /** `HH:mm`, or null. 24-hour, and never a `Date` — see the note at the top of `times.ts`. */\n value: Time | null;\n onValueChange: (value: Time | null) => void;\n /** What time this is. \"시작 시각\", \"알림\". Names both boxes. */\n label: string;\n /** Earliest and latest allowed, both `HH:mm`. */\n min?: Time;\n max?: Time;\n /** Minutes between one allowed time and the next. The grid starts at `min`. */\n step?: number;\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n invalid?: boolean;\n id?: string;\n /** Puts a hidden `input` in the form carrying `HH:mm`. */\n name?: string;\n /* `Field` hands these down. They belong on the boxes, not on the wrapper `div` the rest of\n * the props land on. */\n \"aria-describedby\"?: string;\n \"aria-labelledby\"?: string;\n required?: boolean;\n className?: string;\n [key: `data-${string}`]: unknown;\n [key: `aria-${string}`]: unknown;\n};\n\ntype Segment = \"hour\" | \"minute\";\nconst LIMIT: Record<Segment, number> = { hour: 23, minute: 59 };\nconst pad = (value: number) => String(value).padStart(2, \"0\");\n\n/**\n * A time of day, in two boxes.\n *\n * Not `<input type=\"time\">`, and for the reason `Select` gave up on `<select>`: the native\n * control paints itself. Its segments, its spinner, its clock icon and its AM/PM box are\n * different in every browser and reachable by no stylesheet, so a form built out of them has\n * one field that does not belong to the design system and cannot be made to.\n *\n * What the native control gets right is copied. The digits are 24-hour, because `14` is one\n * unambiguous thing to type where \"2, then afternoon\" is two; the twelve-hour reading a\n * Korean reader says aloud is shown beside them and spoken with every segment, so nobody has\n * to convert in their head. Each box is a `spinbutton`, so the arrow keys work the way they\n * work in the native one, and `step` is what they move by.\n */\nexport function TimeInput({\n value,\n onValueChange,\n label,\n min,\n max,\n step = 1,\n size = \"md\",\n disabled,\n invalid,\n id,\n name,\n \"aria-describedby\": describedBy,\n \"aria-labelledby\": labelledBy,\n required,\n className,\n ...rest\n}: TimeInputProps) {\n const base = useId();\n const hourId = id ?? `${base}-hour`;\n const minuteId = `${base}-minute`;\n const nameId = `${base}-label`;\n const noteId = `${base}-note`;\n const words: Record<Segment, string> = { hour: `${base}-hour-word`, minute: `${base}-minute-word` };\n\n const grain = Math.max(1, Math.round(step));\n const [lo, hi] = timeWindow(min, max);\n const origin = lo;\n\n const committed = parseTime(value);\n /*\n * What is in the boxes while only one of them has been filled in.\n *\n * A time is not a value until both halves are known, so a reader typing the hour has\n * nothing to emit yet — and emitting `09:00` the moment they type `09` would be inventing\n * a minute they have not chosen.\n */\n const [half, setHalf] = useState<{ hour: number | null; minute: number | null } | null>(null);\n const [active, setActive] = useState<Segment>(\"hour\");\n const boxes = useRef<Record<Segment, HTMLInputElement | null>>({ hour: null, minute: null });\n\n const shown: Record<Segment, number | null> = half ?? {\n hour: committed === null ? null : Math.floor(committed / 60),\n minute: committed === null ? null : committed % 60,\n };\n\n const emit = (minutes: number) => {\n const next = toTime(minutes);\n if (next !== value) onValueChange(next);\n };\n\n const write = (segment: Segment, next: number | null) => {\n const hour = segment === \"hour\" ? next : shown.hour;\n const minute = segment === \"minute\" ? next : shown.minute;\n if (hour === null && minute === null) {\n setHalf(null);\n if (value !== null) onValueChange(null);\n return;\n }\n if (hour === null || minute === null) {\n setHalf({ hour, minute });\n return;\n }\n setHalf(null);\n /*\n * Emitted as typed, not clamped and not snapped. A reader whose window opens at 09:00 and\n * who has just typed the `0` of `09` should not watch the box jump to 09 under their\n * hands — the tidying happens once, when they leave the field.\n */\n emit(hour * 60 + minute);\n };\n\n /** Where the arrow keys start from when there is nothing in the boxes yet. */\n const total = () => {\n if (shown.hour !== null && shown.minute !== null) return shown.hour * 60 + shown.minute;\n return snapTime(clampTime(committed ?? lo, lo, hi), grain, origin);\n };\n\n /** The last time the grid allows inside the window — `snapTime` can round past the end. */\n const highest = () => {\n const top = snapTime(hi, grain, origin);\n return top > hi ? top - grain : top;\n };\n\n const move = (minutes: number) => {\n const next = clampTime(minutes, lo, hi);\n setHalf(null);\n emit(next);\n };\n\n const onSegmentKeyDown = (segment: Segment) => (event: KeyboardEvent<HTMLInputElement>) => {\n const now = total();\n const keys: Record<string, () => void> = {\n ArrowUp: () =>\n move(segment === \"hour\" ? now + 60 : stepTime(now, grain, origin, 1)),\n ArrowDown: () =>\n move(segment === \"hour\" ? now - 60 : stepTime(now, grain, origin, -1)),\n Home: () => move(lo),\n End: () => move(highest()),\n ArrowRight: () => boxes.current.minute?.focus(),\n ArrowLeft: () => boxes.current.hour?.focus(),\n Backspace: () => write(segment, null),\n Delete: () => write(segment, null),\n };\n const action = keys[event.key];\n if (!action) return;\n event.preventDefault();\n action();\n };\n\n /*\n * Digits arrive through `change` rather than through `keydown`.\n *\n * A software keyboard on a phone reports `Unidentified` for every key, so a component that\n * reads `event.key` is a component that cannot be typed into on a phone. What the box holds\n * afterwards is read instead: the last two digits if they make a legal number, the last one\n * if they do not — which is what makes `1` then `2` mean twelve and `9` mean nine.\n */\n const onSegmentChange = (segment: Segment) => (event: ChangeEvent<HTMLInputElement>) => {\n const digits = event.target.value.replace(/\\D/g, \"\");\n if (digits === \"\") {\n write(segment, null);\n return;\n }\n const pair = Number(digits.slice(-2));\n const single = Number(digits.slice(-1));\n const next = pair <= LIMIT[segment] && digits.length > 1 ? pair : single;\n write(segment, next);\n /* Off to the minutes once the hour cannot take another digit. */\n if (segment === \"hour\" && (next > 2 || digits.length > 1)) boxes.current.minute?.focus();\n };\n\n /*\n * Leaving the field is where a typed time is tidied: brought inside `min`/`max` and moved\n * onto the grid `step` makes. A half-filled pair goes back to the last committed value,\n * because an hour with no minute is not a time and there is nothing to guess.\n */\n const onFieldBlur = (event: FocusEvent<HTMLDivElement>) => {\n if (event.currentTarget.contains(event.relatedTarget as Node | null)) return;\n if (shown.hour === null || shown.minute === null) {\n setHalf(null);\n return;\n }\n const tidied = clampTime(snapTime(clampTime(shown.hour * 60 + shown.minute, lo, hi), grain, origin), lo, hi);\n setHalf(null);\n emit(tidied);\n };\n\n const spinbutton = (segment: Segment) => {\n const held = shown[segment];\n const both = shown.hour !== null && shown.minute !== null;\n const said =\n held === null\n ? \"비어 있음\"\n : segment === \"hour\" && both\n ? speak(shown.hour! * 60 + shown.minute!)\n : segment === \"hour\"\n ? `${held}시`\n : `${held}분`;\n return {\n id: segment === \"hour\" ? hourId : minuteId,\n ref: (node: HTMLInputElement | null) => {\n boxes.current[segment] = node;\n },\n className: \"time-input__segment\",\n type: \"text\" as const,\n role: \"spinbutton\",\n inputMode: \"numeric\" as const,\n autoComplete: \"off\",\n /* One tab stop for the pair: the arrow keys are the way between them, and Tab is the\n * way out — the same shape the calendar grid uses. */\n tabIndex: active === segment ? 0 : -1,\n \"aria-labelledby\": `${labelledBy ?? nameId} ${words[segment]}`,\n \"aria-describedby\": [describedBy, noteId].filter(Boolean).join(\" \"),\n \"aria-valuenow\": held ?? undefined,\n \"aria-valuemin\": 0,\n \"aria-valuemax\": LIMIT[segment],\n \"aria-valuetext\": said,\n \"aria-invalid\": invalid || undefined,\n required,\n disabled,\n placeholder: \"--\",\n value: held === null ? \"\" : pad(held),\n onChange: onSegmentChange(segment),\n onKeyDown: onSegmentKeyDown(segment),\n onFocus: (event: FocusEvent<HTMLInputElement>) => {\n setActive(segment);\n /* Selected on arrival, so the first digit replaces what is there rather than landing\n * beside it. */\n event.target.select();\n },\n \"data-part\": segment,\n };\n };\n\n const complete = shown.hour !== null && shown.minute !== null ? shown.hour * 60 + shown.minute : null;\n\n return (\n <div\n {...rest}\n className={`time-input ${className ?? \"\"}`.trim()}\n data-size={size}\n data-invalid={invalid ? \"\" : undefined}\n data-disabled={disabled ? \"\" : undefined}\n >\n <VisuallyHidden>\n <span id={nameId}>{label}</span>\n <span id={words.hour}>시</span>\n <span id={words.minute}>분</span>\n <span id={noteId}>\n 24시간 표기입니다. 14는 오후 2시입니다. 위아래 화살표로{\" \"}\n {grain === 1 ? \"1분씩\" : `${grain}분씩`} 옮깁니다.\n </span>\n </VisuallyHidden>\n\n <div className=\"time-input__field\" onBlur={onFieldBlur} data-part=\"field\">\n <input {...spinbutton(\"hour\")} />\n <span className=\"time-input__colon\" aria-hidden=\"true\">\n :\n </span>\n <input {...spinbutton(\"minute\")} />\n {/* The twelve-hour reading, for the eyes. The same words are in every segment's\n * `aria-valuetext`, so nobody is reading it here for the first time. */}\n <span className=\"time-input__meridiem\" aria-hidden=\"true\" data-part=\"meridiem\">\n {complete === null ? \"\" : format12(complete)}\n </span>\n </div>\n\n {name ? <input type=\"hidden\" name={name} value={value ?? \"\"} disabled={disabled} /> : null}\n\n {/*\n * What `step` filters. Mounted whether or not there is anything to say, and empty when\n * there is not: a live region that appears at the same moment as its text announces\n * nothing in several screen readers.\n */}\n <VisuallyHidden>\n <span aria-live=\"polite\" data-part=\"off-grid\">\n {complete !== null && !onGrid(complete, grain, origin) ? `${grain}분 간격이 아닙니다` : \"\"}\n </span>\n </VisuallyHidden>\n </div>\n );\n}\n","import { useEffect, useRef, useState } from \"react\";\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { AlertTriangle, CheckCircle2, Info, X, XCircle } from \"lucide-react\";\nimport { Icon } from \"../../common/Icon\";\nimport { IconButton } from \"../../common/IconButton\";\nimport \"./Toast.css\";\n\nexport type ToastTone = \"neutral\" | \"success\" | \"warning\" | \"danger\";\n\nexport type ToastItem = {\n id: string;\n title: ReactNode;\n description?: ReactNode;\n tone?: ToastTone;\n /** One thing to do about it — \"되돌리기\", \"다시 시도\". Never the only way to do it. */\n action?: ReactNode;\n /** Milliseconds before it goes. `null` keeps it until it is dismissed. */\n duration?: number | null;\n};\n\nexport type ToastViewportProps = {\n toasts: ToastItem[];\n onDismiss: (id: string) => void;\n /** Names the region. \"알림\", \"저장 상태\". */\n label?: string;\n placement?: \"top\" | \"bottom\";\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\nconst GLYPH = {\n neutral: Info,\n success: CheckCircle2,\n warning: AlertTriangle,\n danger: XCircle,\n} as const;\n\n/**\n * A message that arrives on its own and leaves on its own.\n *\n * Two rules shape all of it.\n *\n * A toast is never the only place something is said. It is gone in six seconds, it cannot be\n * reached by a reader who was looking elsewhere, and on a phone it may be covered by the\n * keyboard. Whatever it reports has to be true of the page as well.\n *\n * And it has to be pausable. WCAG 2.2.1 asks that anything which moves, blinks or disappears\n * on a timer can be paused, stopped or extended — a message that vanishes after six seconds\n * fails that outright for anyone who reads slowly, so the timer stops while the pointer is\n * over the stack or the focus is inside it, and starts again when they leave.\n */\nexport function ToastViewport({\n toasts,\n onDismiss,\n label = \"알림\",\n placement = \"bottom\",\n className,\n ...rest\n}: ToastViewportProps) {\n const [held, setHeld] = useState(false);\n\n return (\n <div\n {...rest}\n className={`toast-viewport ${className ?? \"\"}`.trim()}\n data-placement={placement}\n /*\n * A region rather than a live region. Each toast carries its own `role`, because the\n * urgency belongs to the message: a save confirmation is `status` and a failure is\n * `alert`, and a viewport that announced everything the same way would either\n * interrupt the reader for nothing or fail to interrupt them for something.\n */\n role=\"region\"\n aria-label={label}\n onPointerEnter={() => setHeld(true)}\n onPointerLeave={() => setHeld(false)}\n onFocusCapture={() => setHeld(true)}\n onBlurCapture={(event) => {\n if (!event.currentTarget.contains(event.relatedTarget as Node)) setHeld(false);\n }}\n data-held={held ? \"\" : undefined}\n >\n {toasts.map((toast) => (\n <Toast key={toast.id} toast={toast} held={held} onDismiss={onDismiss} />\n ))}\n </div>\n );\n}\n\ntype ToastProps = {\n toast: ToastItem;\n held: boolean;\n onDismiss: (id: string) => void;\n};\n\nfunction Toast({ toast, held, onDismiss }: ToastProps) {\n const tone = toast.tone ?? \"neutral\";\n const duration = toast.duration === undefined ? 6000 : toast.duration;\n\n /*\n * The remaining time, not the elapsed time. A timer that restarted from the top every time\n * the pointer crossed the stack would keep a toast on screen forever; one that resumed from\n * where it stopped is what \"pause\" means.\n */\n const left = useRef(duration ?? 0);\n const startedAt = useRef<number | null>(null);\n /*\n * The duration the remaining time was measured against, so a change to it can be told from a\n * pause. `useRef(duration)` alone is read once, at the first render: a toast mounted with\n * `duration: null` and later given a number kept a remainder of zero and left immediately,\n * and one moved from one number to another kept counting the old one while the rail was\n * redrawn with the new one — the clock on screen and the clock that fires disagreeing.\n */\n const declared = useRef(duration);\n\n useEffect(() => {\n if (declared.current !== duration) {\n /* A new deadline, not a resumed one. The cleanup below has already folded the elapsed\n * time into `left`, and that remainder belongs to a duration nobody asked for any more. */\n declared.current = duration;\n left.current = duration ?? 0;\n startedAt.current = null;\n }\n if (duration === null || held) {\n if (startedAt.current !== null) {\n left.current -= performance.now() - startedAt.current;\n startedAt.current = null;\n }\n return;\n }\n startedAt.current = performance.now();\n const timer = window.setTimeout(() => onDismiss(toast.id), Math.max(0, left.current));\n return () => {\n window.clearTimeout(timer);\n if (startedAt.current !== null) {\n left.current -= performance.now() - startedAt.current;\n startedAt.current = null;\n }\n };\n }, [duration, held, onDismiss, toast.id]);\n\n return (\n <div\n className=\"toast\"\n data-tone={tone}\n /*\n * `alert` interrupts and `status` waits for a pause. A failure has to interrupt; a\n * save confirmation does not, and interrupting for one trains the reader to ignore\n * both.\n */\n role={tone === \"danger\" ? \"alert\" : \"status\"}\n aria-live={tone === \"danger\" ? \"assertive\" : \"polite\"}\n data-part={`toast-${toast.id}`}\n style={duration === null ? undefined : ({ \"--toast-life\": `${duration}ms` } as CSSProperties)}\n >\n {/*\n * How much time is left, drawn.\n *\n * The timer was already pausable — WCAG 2.2.1 asks for that and this component has done\n * it since it was written. What it did not have was the other half: a reader could stop\n * the clock and still not know whether they had six seconds or a tenth of one. A\n * message that offers to undo something is a message whose window is the whole point,\n * and an undo button with an invisible deadline is a button people press too late.\n *\n * The rail is a CSS animation rather than a number this component counts down, so the\n * browser owns the clock and `animation-play-state` is the same pause the timer takes.\n * Two clocks would drift, and the one that drifted would be the one on screen.\n *\n * `--toast-life` is a datum with no element attribute to live in — `<progress value>`\n * is the slot rule 2 points at for a value, and there is no such slot for how long an\n * animation runs. Written when the deadline is set, not per frame.\n */}\n {duration === null ? null : (\n /* Keyed by the duration so a new deadline draws a new rail. Changing `animation-duration`\n * on a running animation keeps the elapsed time and rescales the progress, which would\n * leave the bar somewhere the timer is not. */\n <span key={duration} className=\"toast__rail\" data-part=\"rail\" aria-hidden=\"true\" />\n )}\n <Icon icon={GLYPH[tone]} size=\"sm\" className=\"toast__glyph\" />\n <div className=\"toast__text\">\n <p className=\"toast__title\">{toast.title}</p>\n {toast.description ? <p className=\"toast__description\">{toast.description}</p> : null}\n </div>\n {toast.action ? <div className=\"toast__action\">{toast.action}</div> : null}\n <IconButton\n icon={X}\n label=\"알림 닫기\"\n size=\"sm\"\n variant=\"ghost\"\n tone=\"neutral\"\n onClick={() => onDismiss(toast.id)}\n data-part=\"dismiss\"\n />\n </div>\n );\n}\n","import { createContext, useCallback, useContext, useEffect, useRef, useState } from \"react\";\nimport type { KeyboardEvent, ReactNode } from \"react\";\nimport \"./Toolbar.css\";\n\nexport type ToolbarOrientation = \"horizontal\" | \"vertical\";\n\nexport type ToolbarProps = {\n children: ReactNode;\n /** What the toolbar acts on. \"본문 서식\", \"표 작업\". A `role=\"toolbar\"` with no name is a\n * container a reader is told they have entered and not told the purpose of. */\n label: string;\n orientation?: ToolbarOrientation;\n /** A rule and a gap where a group of controls ends and the next begins. */\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/*\n * Candidates for the roving stop.\n *\n * `[tabindex]` is deliberately unqualified rather than `:not([tabindex=\"-1\"])`. This\n * component writes `tabindex=\"-1\"` onto every child that is not the current stop, so a\n * selector that excluded `-1` would drop each child the moment the roving touched it, and a\n * `<div tabindex=\"0\">` handed in by an adopter would leave the rotation after one keypress.\n * Which `-1`s are ours and which are the child's own is decided in `items()`.\n */\nconst FOCUSABLE = \"button, [href], input, select, textarea, [tabindex]\";\n\n/*\n * Controls that keep the keys this toolbar would otherwise take.\n *\n * Tag names alone are not enough. `Select` reports itself with `role=\"combobox\"` on a\n * `<button>`, so a tag-name test let the toolbar steal Home, End and the arrow keys from a\n * control whose own list those keys drive. What matters is what the control *is* to a\n * reader, and that is the role.\n */\nconst FIELD = [\n \"input\",\n \"textarea\",\n \"select\",\n '[role=\"combobox\"]',\n '[role=\"listbox\"]',\n '[role=\"searchbox\"]',\n '[role=\"spinbutton\"]',\n '[role=\"textbox\"]',\n].join(\", \");\n\n/** The orientation the rules between groups should report: across the bar, not along it. */\nconst ToolbarOrientationContext = createContext<ToolbarOrientation>(\"horizontal\");\n\n/**\n * A row of controls that is one stop on the Tab key.\n *\n * This is the whole difference between a toolbar and a `ButtonGroup`. A group of buttons is\n * a set of separate actions that happen to be adjacent, and taking their tab stops away\n * would hide all but one of them from a keyboard. A toolbar is a destination: a reader tabs\n * to it once and arrows through it, the way they do in every editor they have ever used.\n *\n * The roving is done by writing `tabindex` onto the children after they render, which means\n * reaching into DOM React owns. It is deliberate: the alternative is a `Toolbar.Item`\n * wrapper every child has to be put inside, and a toolbar that only accepts its own item\n * component cannot hold a `Select`, a `SegmentedControl` or anything an adopter brings.\n * Nothing in this library sets `tabindex` on a button, so nothing here is being fought over.\n */\nexport function Toolbar({\n children,\n label,\n orientation = \"horizontal\",\n className,\n ...rest\n}: ToolbarProps) {\n const root = useRef<HTMLDivElement>(null);\n const [active, setActive] = useState(0);\n\n /*\n * The children this toolbar has written a tabindex onto.\n *\n * `tabindex=\"-1\"` says two different things inside this bar. On a child we have already\n * touched it means \"the stop is somewhere else right now\"; on a child we have not it means\n * \"keep me out of the tab order\", which is its author's decision and not ours to reverse.\n * `Select` parks a `<select aria-hidden=\"true\" tabindex=\"-1\">` in the DOM to carry the form\n * value, and without this distinction that invisible element became a rotation slot — a\n * toolbar whose only tab stop can be a control nobody can see.\n */\n const roving = useRef(new WeakSet<HTMLElement>());\n\n const items = useCallback(\n () =>\n Array.from(root.current?.querySelectorAll<HTMLElement>(FOCUSABLE) ?? []).filter((node) => {\n if (node.hasAttribute(\"disabled\") || node.getAttribute(\"aria-disabled\") === \"true\") return false;\n // Hidden from assistive technology, so it is not somewhere a reader can be sent.\n if (node.closest('[aria-hidden=\"true\"]')) return false;\n return node.getAttribute(\"tabindex\") !== \"-1\" || roving.current.has(node);\n }),\n [],\n );\n\n /*\n * After every render, because the children are the adopter's and may come and go. An\n * index that no longer exists falls back to the first item rather than leaving the toolbar\n * with no tab stop at all — which would take it out of the keyboard's reach entirely.\n */\n useEffect(() => {\n const list = items();\n if (list.length === 0) return;\n const index = Math.min(active, list.length - 1);\n list.forEach((node, position) => {\n roving.current.add(node);\n node.tabIndex = position === index ? 0 : -1;\n });\n });\n\n const move = (step: number) => {\n const list = items();\n if (list.length === 0) return;\n const from = list.findIndex((node) => node === document.activeElement);\n /*\n * Focus outside the rotation — the bar was reached by clicking its padding, say. Forward\n * should then mean the first control and back the last. Treating \"nowhere\" as index -1\n * and stepping from it gave the first for forward and the second from the end for back,\n * which is a control the reader has no reason to expect.\n */\n const at = from === -1 ? (step > 0 ? -1 : 0) : from;\n const next = (at + step + list.length) % list.length;\n setActive(next);\n list[next].focus();\n };\n\n const jump = (to: \"first\" | \"last\") => {\n const list = items();\n if (list.length === 0) return;\n const index = to === \"first\" ? 0 : list.length - 1;\n setActive(index);\n list[index].focus();\n };\n\n const forward = orientation === \"horizontal\" ? \"ArrowRight\" : \"ArrowDown\";\n const back = orientation === \"horizontal\" ? \"ArrowLeft\" : \"ArrowUp\";\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n /*\n * A field inside a toolbar keeps every key this component would otherwise take.\n *\n * In a text box the arrow keys move the caret and Home and End go to the ends of the\n * line; in a combobox the arrows walk the list. All of those are what the reader means\n * by those keys while they are in the field, and a toolbar that took them would make the\n * field unusable to save them one way of leaving it. Tab still leaves.\n */\n const target = event.target as HTMLElement;\n if (target.matches(FIELD)) return;\n\n const keys: Record<string, () => void> = {\n [forward]: () => move(1),\n [back]: () => move(-1),\n Home: () => jump(\"first\"),\n End: () => jump(\"last\"),\n };\n const handler = keys[event.key];\n if (!handler) return;\n event.preventDefault();\n handler();\n };\n\n return (\n <ToolbarOrientationContext.Provider value={orientation}>\n <div\n {...rest}\n ref={root}\n className={`toolbar ${className ?? \"\"}`.trim()}\n role=\"toolbar\"\n aria-label={label}\n aria-orientation={orientation}\n data-orientation={orientation}\n onKeyDown={onKeyDown}\n onFocus={(event) => {\n const list = items();\n const index = list.findIndex((node) => node === event.target);\n if (index >= 0) setActive(index);\n }}\n >\n {children}\n </div>\n </ToolbarOrientationContext.Provider>\n );\n}\n\nexport type ToolbarSeparatorProps = {\n className?: string;\n [key: `data-${string}`]: unknown;\n};\n\n/**\n * A rule between groups of controls.\n *\n * `role=\"separator\"` rather than `aria-hidden`: the grouping is real. A reader who cannot see\n * the line is told the same thing a reader who can is told — that one set of controls ended\n * and another began — and a non-focusable separator costs them nothing to pass.\n *\n * It reports the orientation of the line itself, which is across the bar and not along it: a\n * vertical rule in a horizontal toolbar, a horizontal one in a vertical toolbar. The\n * stylesheet already lays the line down that way, and a fixed `vertical` told assistive\n * technology the opposite of what was on the screen.\n */\nexport function ToolbarSeparator({ className, ...rest }: ToolbarSeparatorProps) {\n const orientation = useContext(ToolbarOrientationContext);\n return (\n <span\n {...rest}\n className={`toolbar__separator ${className ?? \"\"}`.trim()}\n role=\"separator\"\n aria-orientation={orientation === \"horizontal\" ? \"vertical\" : \"horizontal\"}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;AAkGA,SAAgB,EAAS,EACvB,SACA,eAAY,QACZ,WACA,aACA,qBACA,cAAW,MACX,WACA,aACA,SACA,eAAY,UACZ,cAAW,IACX,SAAM,YACN,cACA,GAAG,KACa;CAChB,IAAM,IAAO,EAAM,GACb,IAAW,EAAQ,KAAS,GAgB5B,CAAC,GAAc,KAAmB,EAAS,EAAI,GAC/C,IAAa,MAAa,KAAA,GAC1B,IAAO,IAAa,IAAW,GAC/B,IAAc,GACjB,MAAkB;EAEjB,AADK,KAAY,EAAgB,CAAI,GACrC,IAAmB,CAAI;CACzB,GACA,CAAC,GA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