@atom63/cli 0.1.0-beta.4 → 0.1.0-beta.5

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.
@@ -3550,6 +3550,13 @@
3550
3550
  "carouselSlots",
3551
3551
  "carouselStates",
3552
3552
  "carouselVisualArchetypes",
3553
+ "chartColors",
3554
+ "chartContract",
3555
+ "chartSizes",
3556
+ "chartSlots",
3557
+ "chartStates",
3558
+ "chartTypes",
3559
+ "chartVisualArchetypes",
3553
3560
  "chatComposerContract",
3554
3561
  "chatComposerLayouts",
3555
3562
  "chatComposerSlots",
@@ -4412,6 +4419,14 @@
4412
4419
  ],
4413
4420
  "sections": {}
4414
4421
  },
4422
+ {
4423
+ "module": "@atom63/ui-react/chart",
4424
+ "docs": "component-overview",
4425
+ "values": [
4426
+ "Chart"
4427
+ ],
4428
+ "sections": {}
4429
+ },
4415
4430
  {
4416
4431
  "module": "@atom63/ui-react/layout",
4417
4432
  "docs": "pattern-layout",
@@ -5653,6 +5668,7 @@
5653
5668
  "file": "packages/ui-react/src/components/autocomplete/autocomplete.stories.tsx",
5654
5669
  "names": [
5655
5670
  "Playground",
5671
+ "TriggerAndClearWithValue",
5656
5672
  "MenuAnatomy",
5657
5673
  "Empty",
5658
5674
  "Loading",
@@ -5664,7 +5680,7 @@
5664
5680
  "Endpoints",
5665
5681
  "ContractMetadata"
5666
5682
  ],
5667
- "source": "import { autocompleteContract, themes } from '@atom63/ui-foundation'\nimport {\n Autocomplete,\n AutocompleteEmpty,\n AutocompleteGroup,\n AutocompleteGroupLabel,\n AutocompleteInput,\n AutocompleteItem,\n AutocompleteList,\n AutocompletePopup,\n AutocompleteSeparator,\n AutocompleteStatus,\n UIProvider,\n} from '@atom63/ui-react'\nimport '@atom63/ui-react/styles.css'\nimport type { Meta, StoryObj } from '@storybook/react-vite'\n\nconst meta = {\n title: 'UI React/Autocomplete',\n component: Autocomplete,\n decorators: [\n Story => (\n <div style={{ padding: 'clamp(12px, 8vw, 48px)', width: 'min(320px, 100%)' }}>\n <Story />\n </div>\n ),\n ],\n} satisfies Meta<typeof Autocomplete>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst fruits = [\n 'Apple',\n 'Apricot',\n 'Banana',\n 'Blackberry',\n 'Blueberry',\n 'Cherry',\n 'Grape',\n 'Mango',\n 'Orange',\n 'Peach',\n]\n\nconst groupedFruits = {\n Recent: ['Apple', 'Banana', 'Cherry'],\n Citrus: ['Grapefruit', 'Lemon', 'Orange'],\n Berries: ['Blackberry', 'Blueberry', 'Strawberry'],\n}\n\nfunction Demo({\n disabled,\n invalid,\n size,\n}: {\n disabled?: boolean\n invalid?: boolean\n size?: 'sm' | 'md' | 'lg' | number\n}) {\n return (\n <Autocomplete items={fruits}>\n <AutocompleteInput\n aria-label=\"Search fruit\"\n disabled={disabled}\n invalid={invalid}\n placeholder=\"Search fruit…\"\n showClear\n showTrigger\n size={size}\n />\n <AutocompletePopup>\n <AutocompleteEmpty>No fruit found.</AutocompleteEmpty>\n <AutocompleteList>\n {(fruit: string) => <AutocompleteItem key={fruit}>{fruit}</AutocompleteItem>}\n </AutocompleteList>\n </AutocompletePopup>\n </Autocomplete>\n )\n}\n\nfunction GroupedDemo({ open, size }: { open?: boolean; size?: 'sm' | 'md' | 'lg' }) {\n return (\n <Autocomplete\n autoHighlight={open ? 'always' : undefined}\n defaultOpen={open}\n items={Object.values(groupedFruits).flat()}\n >\n <AutocompleteInput placeholder=\"Search fruit…\" showClear showTrigger size={size} />\n <AutocompletePopup>\n <AutocompleteEmpty>No fruit found.</AutocompleteEmpty>\n <AutocompleteList>\n {Object.entries(groupedFruits).map(([group, values], index) => (\n <AutocompleteGroup key={group}>\n {index > 0 ? <AutocompleteSeparator /> : null}\n <AutocompleteGroupLabel>{group}</AutocompleteGroupLabel>\n {values.map(value => (\n <AutocompleteItem key={value} value={value}>\n {value}\n </AutocompleteItem>\n ))}\n </AutocompleteGroup>\n ))}\n </AutocompleteList>\n </AutocompletePopup>\n </Autocomplete>\n )\n}\n\nexport const Playground: Story = {\n render: () => <Demo />,\n}\n\n/** Open on load with the first item highlighted, so the visual and axe runs\n * capture the popup, its groups and the highlighted row. */\nexport const MenuAnatomy: Story = {\n render: () => <GroupedDemo open />,\n}\n\n/** A query with no match shows the empty message in the open popup. */\nexport const Empty: Story = {\n render: () => (\n <Autocomplete defaultOpen defaultValue=\"Kiwano\" items={fruits}>\n <AutocompleteInput aria-label=\"Search fruit\" placeholder=\"Search fruit…\" showClear />\n <AutocompletePopup>\n <AutocompleteEmpty>No fruit found.</AutocompleteEmpty>\n <AutocompleteList>\n {(fruit: string) => <AutocompleteItem key={fruit}>{fruit}</AutocompleteItem>}\n </AutocompleteList>\n </AutocompletePopup>\n </Autocomplete>\n ),\n}\n\n/** While results load, the popup shows the status line in place of the list. */\nexport const Loading: Story = {\n render: () => (\n <Autocomplete defaultOpen defaultValue=\"Ber\" items={[] as string[]}>\n <AutocompleteInput aria-label=\"Search fruit\" placeholder=\"Search fruit…\" />\n <AutocompletePopup>\n <AutocompleteStatus>Searching fruit…</AutocompleteStatus>\n <AutocompleteList>\n {(fruit: string) => <AutocompleteItem key={fruit}>{fruit}</AutocompleteItem>}\n </AutocompleteList>\n </AutocompletePopup>\n </Autocomplete>\n ),\n}\n\nexport const Disabled: Story = {\n render: () => <Demo disabled />,\n}\n\n/** `invalid` (or `aria-invalid`, which FormControl sets) draws the danger edge. */\nexport const Invalid: Story = {\n render: () => <Demo invalid />,\n}\n\n// The `size` prop on AutocompleteInput accepts named recipe sizes\n// ('sm' | 'md' | 'lg') OR a number. A numeric value is forwarded to the\n// native <input size> attribute for character-width sizing.\nexport const Sizes: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 16 }}>\n <div>\n <div style={{ fontSize: 12, color: 'var(--a63-text-secondary)', marginBottom: 6 }}>sm</div>\n <Demo size=\"sm\" />\n </div>\n <div>\n <div style={{ fontSize: 12, color: 'var(--a63-text-secondary)', marginBottom: 6 }}>md</div>\n <Demo size=\"md\" />\n </div>\n <div>\n <div style={{ fontSize: 12, color: 'var(--a63-text-secondary)', marginBottom: 6 }}>lg</div>\n <Demo size=\"lg\" />\n </div>\n <div>\n <div style={{ fontSize: 12, color: 'var(--a63-text-secondary)', marginBottom: 6 }}>\n size={'{'}12{'}'} (native char-width)\n </div>\n <Demo size={12} />\n </div>\n <div>\n <div style={{ fontSize: 12, color: 'var(--a63-text-secondary)', marginBottom: 6 }}>\n size={'{'}30{'}'} (native char-width)\n </div>\n <Demo size={30} />\n </div>\n </div>\n ),\n}\n\nexport const Themes: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {themes.map(theme =>\n (['light', 'dark'] as const).map(mode => (\n <UIProvider key={`${theme}-${mode}`} mode={mode} theme={theme}>\n <div\n style={{\n alignItems: 'center',\n background: 'var(--a63-surface-panel)',\n borderRadius: '0.75rem',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: '0.75rem',\n }}\n >\n <span style={{ fontSize: 12, color: 'var(--a63-text-secondary)', width: 96 }}>\n {theme} / {mode}\n </span>\n <Demo />\n </div>\n </UIProvider>\n ))\n )}\n </div>\n ),\n}\n\nexport const RadiusSpacing: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {[\n { label: 'Rounded items', radius: 'default' },\n { label: 'Flush square items', radius: 'none' },\n ].map(example => (\n <div\n key={example.radius}\n data-a63-radius={example.radius}\n style={{\n alignItems: 'center',\n background: 'var(--a63-surface-panel)',\n borderRadius: 'var(--radius-lg)',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: '0.75rem',\n }}\n >\n <span style={{ fontSize: 12, color: 'var(--a63-text-secondary)', width: 112 }}>\n {example.label}\n </span>\n <GroupedDemo />\n </div>\n ))}\n </div>\n ),\n}\n\n/* The same autocomplete reviewed against target host contexts. */\nexport const Endpoints: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {[\n {\n label: 'Web',\n props: { density: 'comfortable', designLanguage: 'web', input: 'pointer' } as const,\n },\n {\n label: 'iOS touch',\n props: { density: 'comfortable', designLanguage: 'ios', input: 'touch' } as const,\n },\n {\n label: 'Compact extension',\n props: {\n density: 'compact',\n designLanguage: 'web',\n input: 'pointer',\n surface: 'n2',\n } as const,\n },\n ].map(endpoint => (\n <UIProvider key={endpoint.label} {...endpoint.props}>\n <div\n style={{\n alignItems: 'center',\n background: 'var(--a63-surface-panel)',\n borderRadius: 'var(--radius-lg)',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: '0.75rem',\n }}\n >\n <span style={{ fontSize: 12, color: 'var(--a63-text-secondary)', width: 112 }}>\n {endpoint.label}\n </span>\n <GroupedDemo size={endpoint.label === 'Compact extension' ? 'sm' : 'md'} />\n </div>\n </UIProvider>\n ))}\n </div>\n ),\n}\n\nexport const ContractMetadata: Story = {\n render: () => (\n <pre style={{ fontSize: 12, margin: 0, whiteSpace: 'pre-wrap' }}>\n {JSON.stringify(autocompleteContract, null, 2)}\n </pre>\n ),\n}\n"
5683
+ "source": "import { autocompleteContract, themes } from '@atom63/ui-foundation'\nimport {\n Autocomplete,\n AutocompleteEmpty,\n AutocompleteGroup,\n AutocompleteGroupLabel,\n AutocompleteInput,\n AutocompleteItem,\n AutocompleteList,\n AutocompletePopup,\n AutocompleteSeparator,\n AutocompleteStatus,\n UIProvider,\n} from '@atom63/ui-react'\nimport '@atom63/ui-react/styles.css'\nimport type { Meta, StoryObj } from '@storybook/react-vite'\n\nconst meta = {\n title: 'UI React/Autocomplete',\n component: Autocomplete,\n decorators: [\n Story => (\n <div style={{ padding: 'clamp(12px, 8vw, 48px)', width: 'min(320px, 100%)' }}>\n <Story />\n </div>\n ),\n ],\n} satisfies Meta<typeof Autocomplete>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst fruits = [\n 'Apple',\n 'Apricot',\n 'Banana',\n 'Blackberry',\n 'Blueberry',\n 'Cherry',\n 'Grape',\n 'Mango',\n 'Orange',\n 'Peach',\n]\n\nconst groupedFruits = {\n Recent: ['Apple', 'Banana', 'Cherry'],\n Citrus: ['Grapefruit', 'Lemon', 'Orange'],\n Berries: ['Blackberry', 'Blueberry', 'Strawberry'],\n}\n\nfunction Demo({\n disabled,\n invalid,\n size,\n}: {\n disabled?: boolean\n invalid?: boolean\n size?: 'sm' | 'md' | 'lg' | number\n}) {\n return (\n <Autocomplete items={fruits}>\n <AutocompleteInput\n aria-label=\"Search fruit\"\n disabled={disabled}\n invalid={invalid}\n placeholder=\"Search fruit…\"\n showClear\n showTrigger\n size={size}\n />\n <AutocompletePopup>\n <AutocompleteEmpty>No fruit found.</AutocompleteEmpty>\n <AutocompleteList>\n {(fruit: string) => <AutocompleteItem key={fruit}>{fruit}</AutocompleteItem>}\n </AutocompleteList>\n </AutocompletePopup>\n </Autocomplete>\n )\n}\n\nfunction GroupedDemo({ open, size }: { open?: boolean; size?: 'sm' | 'md' | 'lg' }) {\n return (\n <Autocomplete\n autoHighlight={open ? 'always' : undefined}\n defaultOpen={open}\n items={Object.values(groupedFruits).flat()}\n >\n <AutocompleteInput placeholder=\"Search fruit…\" showClear showTrigger size={size} />\n <AutocompletePopup>\n <AutocompleteEmpty>No fruit found.</AutocompleteEmpty>\n <AutocompleteList>\n {Object.entries(groupedFruits).map(([group, values], index) => (\n <AutocompleteGroup key={group}>\n {index > 0 ? <AutocompleteSeparator /> : null}\n <AutocompleteGroupLabel>{group}</AutocompleteGroupLabel>\n {values.map(value => (\n <AutocompleteItem key={value} value={value}>\n {value}\n </AutocompleteItem>\n ))}\n </AutocompleteGroup>\n ))}\n </AutocompleteList>\n </AutocompletePopup>\n </Autocomplete>\n )\n}\n\nexport const Playground: Story = {\n render: () => <Demo />,\n}\n\n/** With a typed value, the clear button sits beside the trigger: neither covers the other. */\nexport const TriggerAndClearWithValue: Story = {\n render: () => (\n <Autocomplete defaultValue=\"Apple\" items={fruits}>\n <AutocompleteInput\n aria-label=\"Search fruit\"\n placeholder=\"Search fruit…\"\n showClear\n showTrigger\n />\n <AutocompletePopup>\n <AutocompleteEmpty>No fruit found.</AutocompleteEmpty>\n <AutocompleteList>\n {(fruit: string) => <AutocompleteItem key={fruit}>{fruit}</AutocompleteItem>}\n </AutocompleteList>\n </AutocompletePopup>\n </Autocomplete>\n ),\n play: async ({ canvasElement }) => {\n const trigger = canvasElement.querySelector<HTMLElement>('[data-slot=\"autocomplete-trigger\"]')\n const clear = canvasElement.querySelector<HTMLElement>('[data-slot=\"autocomplete-clear\"]')\n const input = canvasElement.querySelector<HTMLInputElement>('[data-slot=\"autocomplete-input\"]')\n if (!trigger || !clear || !input)\n throw new Error('Expected the input, trigger and clear button')\n const a = trigger.getBoundingClientRect()\n const b = clear.getBoundingClientRect()\n if (a.left < b.right - 0.5 && b.left < a.right - 0.5) {\n throw new Error(\n `Expected the clear button beside the trigger (clear ${b.left}-${b.right}, trigger ${a.left}-${a.right})`\n )\n }\n const hit = document.elementFromPoint(a.left + a.width / 2, a.top + a.height / 2)\n if (!hit || !trigger.contains(hit)) throw new Error('Expected the trigger to take the pointer')\n const text =\n input.getBoundingClientRect().right - Number.parseFloat(getComputedStyle(input).paddingRight)\n if (text > b.left + 0.5) throw new Error('Expected the input to reserve room for both buttons')\n },\n}\n\n/** Open on load with the first item highlighted, so the visual and axe runs\n * capture the popup, its groups and the highlighted row. */\nexport const MenuAnatomy: Story = {\n render: () => <GroupedDemo open />,\n}\n\n/** A query with no match shows the empty message in the open popup. */\nexport const Empty: Story = {\n render: () => (\n <Autocomplete defaultOpen defaultValue=\"Kiwano\" items={fruits}>\n <AutocompleteInput aria-label=\"Search fruit\" placeholder=\"Search fruit…\" showClear />\n <AutocompletePopup>\n <AutocompleteEmpty>No fruit found.</AutocompleteEmpty>\n <AutocompleteList>\n {(fruit: string) => <AutocompleteItem key={fruit}>{fruit}</AutocompleteItem>}\n </AutocompleteList>\n </AutocompletePopup>\n </Autocomplete>\n ),\n}\n\n/** While results load, the popup shows the status line in place of the list. */\nexport const Loading: Story = {\n render: () => (\n <Autocomplete defaultOpen defaultValue=\"Ber\" items={[] as string[]}>\n <AutocompleteInput aria-label=\"Search fruit\" placeholder=\"Search fruit…\" />\n <AutocompletePopup>\n <AutocompleteStatus>Searching fruit…</AutocompleteStatus>\n <AutocompleteList>\n {(fruit: string) => <AutocompleteItem key={fruit}>{fruit}</AutocompleteItem>}\n </AutocompleteList>\n </AutocompletePopup>\n </Autocomplete>\n ),\n}\n\nexport const Disabled: Story = {\n render: () => <Demo disabled />,\n}\n\n/** `invalid` (or `aria-invalid`, which FormControl sets) draws the danger edge. */\nexport const Invalid: Story = {\n render: () => <Demo invalid />,\n}\n\n// The `size` prop on AutocompleteInput accepts named recipe sizes\n// ('sm' | 'md' | 'lg') OR a number. A numeric value is forwarded to the\n// native <input size> attribute for character-width sizing.\nexport const Sizes: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 16 }}>\n <div>\n <div style={{ fontSize: 12, color: 'var(--a63-text-secondary)', marginBottom: 6 }}>sm</div>\n <Demo size=\"sm\" />\n </div>\n <div>\n <div style={{ fontSize: 12, color: 'var(--a63-text-secondary)', marginBottom: 6 }}>md</div>\n <Demo size=\"md\" />\n </div>\n <div>\n <div style={{ fontSize: 12, color: 'var(--a63-text-secondary)', marginBottom: 6 }}>lg</div>\n <Demo size=\"lg\" />\n </div>\n <div>\n <div style={{ fontSize: 12, color: 'var(--a63-text-secondary)', marginBottom: 6 }}>\n size={'{'}12{'}'} (native char-width)\n </div>\n <Demo size={12} />\n </div>\n <div>\n <div style={{ fontSize: 12, color: 'var(--a63-text-secondary)', marginBottom: 6 }}>\n size={'{'}30{'}'} (native char-width)\n </div>\n <Demo size={30} />\n </div>\n </div>\n ),\n}\n\nexport const Themes: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {themes.map(theme =>\n (['light', 'dark'] as const).map(mode => (\n <UIProvider key={`${theme}-${mode}`} mode={mode} theme={theme}>\n <div\n style={{\n alignItems: 'center',\n background: 'var(--a63-surface-panel)',\n borderRadius: '0.75rem',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: '0.75rem',\n }}\n >\n <span style={{ fontSize: 12, color: 'var(--a63-text-secondary)', width: 96 }}>\n {theme} / {mode}\n </span>\n <Demo />\n </div>\n </UIProvider>\n ))\n )}\n </div>\n ),\n}\n\nexport const RadiusSpacing: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {[\n { label: 'Rounded items', radius: 'default' },\n { label: 'Flush square items', radius: 'none' },\n ].map(example => (\n <div\n key={example.radius}\n data-a63-radius={example.radius}\n style={{\n alignItems: 'center',\n background: 'var(--a63-surface-panel)',\n borderRadius: 'var(--radius-lg)',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: '0.75rem',\n }}\n >\n <span style={{ fontSize: 12, color: 'var(--a63-text-secondary)', width: 112 }}>\n {example.label}\n </span>\n <GroupedDemo />\n </div>\n ))}\n </div>\n ),\n}\n\n/* The same autocomplete reviewed against target host contexts. */\nexport const Endpoints: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {[\n {\n label: 'Web',\n props: { density: 'comfortable', designLanguage: 'web', input: 'pointer' } as const,\n },\n {\n label: 'iOS touch',\n props: { density: 'comfortable', designLanguage: 'ios', input: 'touch' } as const,\n },\n {\n label: 'Compact extension',\n props: {\n density: 'compact',\n designLanguage: 'web',\n input: 'pointer',\n surface: 'n2',\n } as const,\n },\n ].map(endpoint => (\n <UIProvider key={endpoint.label} {...endpoint.props}>\n <div\n style={{\n alignItems: 'center',\n background: 'var(--a63-surface-panel)',\n borderRadius: 'var(--radius-lg)',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: '0.75rem',\n }}\n >\n <span style={{ fontSize: 12, color: 'var(--a63-text-secondary)', width: 112 }}>\n {endpoint.label}\n </span>\n <GroupedDemo size={endpoint.label === 'Compact extension' ? 'sm' : 'md'} />\n </div>\n </UIProvider>\n ))}\n </div>\n ),\n}\n\nexport const ContractMetadata: Story = {\n render: () => (\n <pre style={{ fontSize: 12, margin: 0, whiteSpace: 'pre-wrap' }}>\n {JSON.stringify(autocompleteContract, null, 2)}\n </pre>\n ),\n}\n"
5668
5684
  },
5669
5685
  "summary": "Autocomplete combines text entry with a filtered, keyboard-navigable collection.",
5670
5686
  "usage": "Use it when typing should filter available values; use Select when scanning the list is enough.",
@@ -8143,6 +8159,7 @@
8143
8159
  },
8144
8160
  "exports": {
8145
8161
  "types": [
8162
+ "CommandDialogPopupProps",
8146
8163
  "CommandInputProps"
8147
8164
  ],
8148
8165
  "values": [
@@ -8178,7 +8195,7 @@
8178
8195
  ],
8179
8196
  "importPath": "@atom63/ui-react",
8180
8197
  "label": "Command",
8181
- "markdown": "# Command\n\nCommand provides a searchable command collection that can render inline or in a dialog.\n\n**Status:** Stable\n\n## Preview\n\nThe live documentation page renders the `Inline` story maintained with the component.\n\n## Guidance\n\n- Group actions by intent, expose empty results, and keep shortcuts supplementary to labels.\n- Preserve link, menu, command, or selection semantics instead of styling generic containers.\n- Expose current location when applicable and verify alternate input paths at narrow widths.\n\n## Usage\n\n```tsx\nimport { Command, CommandInput, CommandPanel, CommandList, CommandItem } from '@atom63/ui-react'\n```\n\n## API surface\n\n**Values:** `Command`, `CommandCollection`, `CommandCreateHandle`, `CommandDialog`, `CommandDialogBackdrop`, `CommandDialogPopup`, `CommandDialogPortal`, `CommandDialogTrigger`, `CommandDialogViewport`, `CommandEmpty`, `CommandFooter`, `CommandGroup`, `CommandGroupLabel`, `CommandInput`, `CommandItem`, `CommandList`, `CommandPanel`, `CommandSeparator`, `CommandShortcut`\n\n**Types:** `CommandInputProps`\n\nTypeScript remains the source of truth for complete prop contracts.\n\n## Contract\n\nSource: `packages/ui-foundation/contracts/components/command.json` (`commandContract` in `@atom63/ui-foundation`).\n\n**Slots:** `command`, `command-dialog-trigger`, `command-dialog-backdrop`, `command-dialog-viewport`, `command-dialog-popup`, `command-input-wrapper`, `command-input`, `command-input-end`, `command-panel`, `command-list`, `command-empty`, `command-group`, `command-group-label`, `command-collection`, `command-item`, `command-separator`, `command-shortcut`, `command-footer`\n\n**States:** `closed`, `open`, `empty`, `highlighted`, `disabled`, `focus-visible`\n\n**Visual archetype:** Overlay surfaces — Floating material above the page or current surface.; Static content surfaces — In-flow containers and content surfaces that do not inherently manipulate state.; Field controls — Editable or field-like data-entry surfaces.; Menus and option lists — Dense action or selection rows inside a floating or embedded list.\n\n## Related components\n\n- [Autocomplete](/components/component-autocomplete)\n- [Dialog](/components/component-dialog)\n- [Kbd](/components/component-kbd)\n",
8198
+ "markdown": "# Command\n\nCommand provides a searchable command collection that can render inline or in a dialog.\n\n**Status:** Stable\n\n## Preview\n\nThe live documentation page renders the `Inline` story maintained with the component.\n\n## Guidance\n\n- Group actions by intent, expose empty results, and keep shortcuts supplementary to labels.\n- Preserve link, menu, command, or selection semantics instead of styling generic containers.\n- Expose current location when applicable and verify alternate input paths at narrow widths.\n\n## Usage\n\n```tsx\nimport { Command, CommandInput, CommandPanel, CommandList, CommandItem } from '@atom63/ui-react'\n```\n\n## API surface\n\n**Values:** `Command`, `CommandCollection`, `CommandCreateHandle`, `CommandDialog`, `CommandDialogBackdrop`, `CommandDialogPopup`, `CommandDialogPortal`, `CommandDialogTrigger`, `CommandDialogViewport`, `CommandEmpty`, `CommandFooter`, `CommandGroup`, `CommandGroupLabel`, `CommandInput`, `CommandItem`, `CommandList`, `CommandPanel`, `CommandSeparator`, `CommandShortcut`\n\n**Types:** `CommandDialogPopupProps`, `CommandInputProps`\n\nTypeScript remains the source of truth for complete prop contracts.\n\n## Contract\n\nSource: `packages/ui-foundation/contracts/components/command.json` (`commandContract` in `@atom63/ui-foundation`).\n\n**Slots:** `command`, `command-dialog-trigger`, `command-dialog-backdrop`, `command-dialog-viewport`, `command-dialog-popup`, `command-input-wrapper`, `command-input`, `command-input-end`, `command-panel`, `command-list`, `command-empty`, `command-group`, `command-group-label`, `command-collection`, `command-item`, `command-separator`, `command-shortcut`, `command-footer`\n\n**States:** `closed`, `open`, `empty`, `highlighted`, `disabled`, `focus-visible`\n\n**Visual archetype:** Overlay surfaces — Floating material above the page or current surface.; Static content surfaces — In-flow containers and content surfaces that do not inherently manipulate state.; Field controls — Editable or field-like data-entry surfaces.; Menus and option lists — Dense action or selection rows inside a floating or embedded list.\n\n## Related components\n\n- [Autocomplete](/components/component-autocomplete)\n- [Dialog](/components/component-dialog)\n- [Kbd](/components/component-kbd)\n",
8182
8199
  "related": [
8183
8200
  "autocomplete",
8184
8201
  "dialog",
@@ -8194,12 +8211,13 @@
8194
8211
  "ForcedColors",
8195
8212
  "InputSlots",
8196
8213
  "Dialog",
8214
+ "DialogOpen",
8197
8215
  "ProgrammaticHandle",
8198
8216
  "Themes",
8199
8217
  "Endpoints",
8200
8218
  "ContractMetadata"
8201
8219
  ],
8202
- "source": "import { commandContract, themes } from '@atom63/ui-foundation'\nimport {\n Command,\n CommandCollection,\n CommandCreateHandle,\n CommandDialog,\n CommandDialogPopup,\n CommandDialogTrigger,\n CommandEmpty,\n CommandFooter,\n CommandGroup,\n CommandGroupLabel,\n CommandInput,\n CommandItem,\n CommandList,\n CommandPanel,\n CommandSeparator,\n CommandShortcut,\n Kbd,\n UIProvider,\n} from '@atom63/ui-react'\nimport '@atom63/ui-react/styles.css'\nimport type { Meta, StoryObj } from '@storybook/react-vite'\nimport { Filter } from 'lucide-react'\nimport { Fragment, useMemo, useState } from 'react'\n\nconst meta = {\n title: 'UI React/Command',\n component: Command,\n} satisfies Meta<typeof Command>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\ntype Item = { id: string; label: string; shortcut?: string; value: string }\ntype Group = { id: string; label: string; items: Item[] }\n\nconst groups: Group[] = [\n {\n id: 'navigate',\n label: 'Navigate',\n items: [\n { id: 'home', label: 'Home', value: 'Home /' },\n { id: 'blog', label: 'Blog', value: 'Blog /blog' },\n { id: 'timeline', label: 'Timeline', value: 'Timeline /timeline' },\n ],\n },\n {\n id: 'actions',\n label: 'Actions',\n items: [{ id: 'prefs', label: 'Preferences', shortcut: '⌘,', value: 'Preferences settings' }],\n },\n]\n\nfunction Palette() {\n return (\n <Command itemToStringValue={item => (item as Item).value} items={groups}>\n <CommandInput placeholder=\"Search pages and actions…\" />\n <CommandPanel>\n <CommandEmpty>No results found.</CommandEmpty>\n <CommandList>\n {(group: Group) => (\n <Fragment key={group.id}>\n <CommandGroup items={group.items}>\n <CommandGroupLabel>{group.label}</CommandGroupLabel>\n <CommandCollection>\n {(item: Item) => (\n <CommandItem key={item.id} value={item}>\n <span style={{ flex: 1, minWidth: 0 }}>{item.label}</span>\n {item.shortcut ? <CommandShortcut>{item.shortcut}</CommandShortcut> : null}\n </CommandItem>\n )}\n </CommandCollection>\n </CommandGroup>\n {group.id !== groups.at(-1)?.id ? <CommandSeparator /> : null}\n </Fragment>\n )}\n </CommandList>\n </CommandPanel>\n <CommandFooter>\n <span style={{ alignItems: 'center', display: 'flex', gap: 6 }}>\n <Kbd>↑↓</Kbd>\n <span>Navigate</span>\n </span>\n <CommandShortcut>⌘K</CommandShortcut>\n </CommandFooter>\n </Command>\n )\n}\n\n/* The palette on its own (no dialog) — useful for inspecting the panel chrome. */\nexport const Inline: Story = {\n render: () => (\n <div\n style={{\n border: '1px solid var(--a63-border-subtle)',\n borderRadius: 'var(--radius-2xl)',\n background: 'var(--a63-surface-overlay)',\n boxShadow: 'var(--a63-overlay-shadow)',\n maxWidth: 480,\n overflow: 'hidden',\n }}\n >\n <Palette />\n </div>\n ),\n}\n\n/* Captured with forced colors on (Windows High Contrast): focus stays in the\n input, so the highlighted option, the one Enter runs, takes the system\n selection colours. */\nexport const ForcedColors: Story = { render: Inline.render }\n\n/* The input's slots: a caller's icon in place of the search glyph, and a\n shortcut hint after the field, as in a filter menu. */\nexport const InputSlots: Story = {\n render: () => (\n <div\n style={{\n border: '1px solid var(--a63-border-subtle)',\n borderRadius: 'var(--radius-2xl)',\n background: 'var(--a63-surface-overlay)',\n maxWidth: 360,\n overflow: 'hidden',\n }}\n >\n <Command itemToStringValue={item => (item as Item).value} items={groups[0].items}>\n <CommandInput endAddon={<Kbd>F</Kbd>} icon={<Filter />} placeholder=\"Add filter…\" />\n <CommandPanel>\n <CommandEmpty>No filters found.</CommandEmpty>\n <CommandList>\n {(item: Item) => (\n <CommandItem key={item.id} value={item}>\n {item.label}\n </CommandItem>\n )}\n </CommandList>\n </CommandPanel>\n </Command>\n </div>\n ),\n}\n\nconst triggerStyle = {\n border: '1px solid var(--a63-border-control)',\n borderRadius: 'var(--a63-radius-control)',\n background: 'var(--a63-surface-control)',\n color: 'var(--a63-text-primary)',\n cursor: 'pointer',\n padding: '0.5rem 0.75rem',\n} as const\n\n/* The full modal (⌘K) shell — click to open the dialog. */\nexport const Dialog: Story = {\n render: () => {\n function Demo() {\n const [open, setOpen] = useState(false)\n return (\n <>\n <button onClick={() => setOpen(true)} style={triggerStyle} type=\"button\">\n Open command palette\n </button>\n <CommandDialog onOpenChange={setOpen} open={open}>\n <CommandDialogPopup>\n <Palette />\n </CommandDialogPopup>\n </CommandDialog>\n </>\n )\n }\n return <Demo />\n },\n}\n\n/*\n * Programmatic handle — CommandCreateHandle() builds a detached DialogHandle you\n * pass to CommandDialog via `handle`. Any button can then call handle.open(null)\n * imperatively (no open state to thread), and a detached CommandDialogTrigger wired\n * to the same handle stays in sync.\n */\nexport const ProgrammaticHandle: Story = {\n render: () => {\n function Demo() {\n // Create the handle once for this mounted tree.\n const handle = useMemo(() => CommandCreateHandle(), [])\n return (\n <div style={{ alignItems: 'center', display: 'flex', gap: 12 }}>\n {/* Imperative open — fired from an arbitrary event handler. */}\n <button onClick={() => handle.open(null)} style={triggerStyle} type=\"button\">\n Open via handle.open()\n </button>\n {/* A detached trigger bound to the same handle. */}\n <CommandDialogTrigger handle={handle} style={triggerStyle}>\n Open via detached trigger\n </CommandDialogTrigger>\n <CommandDialog handle={handle}>\n <CommandDialogPopup>\n <Palette />\n </CommandDialogPopup>\n </CommandDialog>\n </div>\n )\n }\n return <Demo />\n },\n}\n\n/* Every DS theme × light/dark — the inline palette chrome reads a63 overlay tokens. */\nexport const Themes: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {themes.map(theme =>\n (['light', 'dark'] as const).map(mode => (\n <UIProvider key={`${theme}-${mode}`} mode={mode} theme={theme}>\n <div\n style={{\n alignItems: 'center',\n background: 'var(--a63-surface-panel)',\n borderRadius: '0.75rem',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: '0.75rem',\n }}\n >\n <span style={{ fontSize: 12, color: 'var(--a63-text-secondary)', width: 96 }}>\n {theme} / {mode}\n </span>\n <div\n style={{\n background: 'var(--a63-surface-overlay)',\n border: '1px solid var(--a63-border-subtle)',\n borderRadius: 'var(--radius-2xl)',\n boxShadow: 'var(--a63-overlay-shadow)',\n flex: 1,\n maxWidth: 420,\n overflow: 'hidden',\n }}\n >\n <Palette />\n </div>\n </div>\n </UIProvider>\n ))\n )}\n </div>\n ),\n}\n\n/* The same command palette reviewed against target host contexts. */\nexport const Endpoints: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {[\n {\n label: 'Web',\n props: { density: 'comfortable', designLanguage: 'web', input: 'pointer' } as const,\n },\n {\n label: 'iOS touch',\n props: { density: 'comfortable', designLanguage: 'ios', input: 'touch' } as const,\n },\n {\n label: 'Compact extension',\n props: {\n density: 'compact',\n designLanguage: 'web',\n input: 'pointer',\n surface: 'n2',\n } as const,\n },\n ].map(endpoint => (\n <UIProvider key={endpoint.label} {...endpoint.props}>\n <div\n style={{\n alignItems: 'center',\n background: 'var(--a63-surface-panel)',\n borderRadius: 'var(--radius-lg)',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: '0.75rem',\n }}\n >\n <span style={{ fontSize: 12, color: 'var(--a63-text-secondary)', width: 112 }}>\n {endpoint.label}\n </span>\n <div\n style={{\n background: 'var(--a63-surface-overlay)',\n border: '1px solid var(--a63-border-subtle)',\n borderRadius: 'var(--radius-2xl)',\n boxShadow: 'var(--a63-overlay-shadow)',\n flex: 1,\n maxWidth: 420,\n overflow: 'hidden',\n }}\n >\n <Palette />\n </div>\n </div>\n </UIProvider>\n ))}\n </div>\n ),\n}\n\nexport const ContractMetadata: Story = {\n render: () => (\n <pre style={{ fontSize: 12, margin: 0, whiteSpace: 'pre-wrap' }}>\n {JSON.stringify(commandContract, null, 2)}\n </pre>\n ),\n}\n"
8220
+ "source": "import { commandContract, themes } from '@atom63/ui-foundation'\nimport {\n Command,\n CommandCollection,\n CommandCreateHandle,\n CommandDialog,\n CommandDialogPopup,\n CommandDialogTrigger,\n CommandEmpty,\n CommandFooter,\n CommandGroup,\n CommandGroupLabel,\n CommandInput,\n CommandItem,\n CommandList,\n CommandPanel,\n CommandSeparator,\n CommandShortcut,\n Kbd,\n UIProvider,\n} from '@atom63/ui-react'\nimport '@atom63/ui-react/styles.css'\nimport type { Meta, StoryObj } from '@storybook/react-vite'\nimport { Filter } from 'lucide-react'\nimport { Fragment, useMemo, useState } from 'react'\n\nconst meta = {\n title: 'UI React/Command',\n component: Command,\n} satisfies Meta<typeof Command>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\ntype Item = { id: string; label: string; shortcut?: string; value: string }\ntype Group = { id: string; label: string; items: Item[] }\n\nconst groups: Group[] = [\n {\n id: 'navigate',\n label: 'Navigate',\n items: [\n { id: 'home', label: 'Home', value: 'Home /' },\n { id: 'blog', label: 'Blog', value: 'Blog /blog' },\n { id: 'timeline', label: 'Timeline', value: 'Timeline /timeline' },\n ],\n },\n {\n id: 'actions',\n label: 'Actions',\n items: [{ id: 'prefs', label: 'Preferences', shortcut: '⌘,', value: 'Preferences settings' }],\n },\n]\n\nfunction Palette() {\n return (\n <Command itemToStringValue={item => (item as Item).value} items={groups}>\n <CommandInput placeholder=\"Search pages and actions…\" />\n <CommandPanel>\n <CommandEmpty>No results found.</CommandEmpty>\n <CommandList>\n {(group: Group) => (\n <Fragment key={group.id}>\n <CommandGroup items={group.items}>\n <CommandGroupLabel>{group.label}</CommandGroupLabel>\n <CommandCollection>\n {(item: Item) => (\n <CommandItem key={item.id} value={item}>\n <span style={{ flex: 1, minWidth: 0 }}>{item.label}</span>\n {item.shortcut ? <CommandShortcut>{item.shortcut}</CommandShortcut> : null}\n </CommandItem>\n )}\n </CommandCollection>\n </CommandGroup>\n {group.id !== groups.at(-1)?.id ? <CommandSeparator /> : null}\n </Fragment>\n )}\n </CommandList>\n </CommandPanel>\n <CommandFooter>\n <span style={{ alignItems: 'center', display: 'flex', gap: 6 }}>\n <Kbd>↑↓</Kbd>\n <span>Navigate</span>\n </span>\n <CommandShortcut>⌘K</CommandShortcut>\n </CommandFooter>\n </Command>\n )\n}\n\n/* The palette on its own (no dialog) — useful for inspecting the panel chrome. */\nexport const Inline: Story = {\n render: () => (\n <div\n style={{\n border: '1px solid var(--a63-border-subtle)',\n borderRadius: 'var(--radius-2xl)',\n background: 'var(--a63-surface-overlay)',\n boxShadow: 'var(--a63-overlay-shadow)',\n maxWidth: 480,\n overflow: 'hidden',\n }}\n >\n <Palette />\n </div>\n ),\n}\n\n/* Captured with forced colors on (Windows High Contrast): focus stays in the\n input, so the highlighted option, the one Enter runs, takes the system\n selection colours. */\nexport const ForcedColors: Story = { render: Inline.render }\n\n/* The input's slots: a caller's icon in place of the search glyph, and a\n shortcut hint after the field, as in a filter menu. */\nexport const InputSlots: Story = {\n render: () => (\n <div\n style={{\n border: '1px solid var(--a63-border-subtle)',\n borderRadius: 'var(--radius-2xl)',\n background: 'var(--a63-surface-overlay)',\n maxWidth: 360,\n overflow: 'hidden',\n }}\n >\n <Command itemToStringValue={item => (item as Item).value} items={groups[0].items}>\n <CommandInput endAddon={<Kbd>F</Kbd>} icon={<Filter />} placeholder=\"Add filter…\" />\n <CommandPanel>\n <CommandEmpty>No filters found.</CommandEmpty>\n <CommandList>\n {(item: Item) => (\n <CommandItem key={item.id} value={item}>\n {item.label}\n </CommandItem>\n )}\n </CommandList>\n </CommandPanel>\n </Command>\n </div>\n ),\n}\n\nconst triggerStyle = {\n border: '1px solid var(--a63-border-control)',\n borderRadius: 'var(--a63-radius-control)',\n background: 'var(--a63-surface-control)',\n color: 'var(--a63-text-primary)',\n cursor: 'pointer',\n padding: '0.5rem 0.75rem',\n} as const\n\n/* The full modal (⌘K) shell — click to open the dialog. */\nexport const Dialog: Story = {\n render: () => {\n function Demo() {\n const [open, setOpen] = useState(false)\n return (\n <>\n <button onClick={() => setOpen(true)} style={triggerStyle} type=\"button\">\n Open command palette\n </button>\n <CommandDialog onOpenChange={setOpen} open={open}>\n <CommandDialogPopup>\n <Palette />\n </CommandDialogPopup>\n </CommandDialog>\n </>\n )\n }\n return <Demo />\n },\n}\n\n/** The modal palette open as an app shows it, so axe and the visual test cover the dialog. */\nexport const DialogOpen: Story = {\n render: () => (\n <CommandDialog defaultOpen>\n <CommandDialogPopup>\n <Palette />\n </CommandDialogPopup>\n </CommandDialog>\n ),\n}\n\n/*\n * Programmatic handle —CommandCreateHandle() builds a detached DialogHandle you\n * pass to CommandDialog via `handle`. Any button can then call handle.open(null)\n * imperatively (no open state to thread), and a detached CommandDialogTrigger wired\n * to the same handle stays in sync.\n */\nexport const ProgrammaticHandle: Story = {\n render: () => {\n function Demo() {\n // Create the handle once for this mounted tree.\n const handle = useMemo(() => CommandCreateHandle(), [])\n return (\n <div style={{ alignItems: 'center', display: 'flex', gap: 12 }}>\n {/* Imperative open — fired from an arbitrary event handler. */}\n <button onClick={() => handle.open(null)} style={triggerStyle} type=\"button\">\n Open via handle.open()\n </button>\n {/* A detached trigger bound to the same handle. */}\n <CommandDialogTrigger handle={handle} style={triggerStyle}>\n Open via detached trigger\n </CommandDialogTrigger>\n <CommandDialog handle={handle}>\n <CommandDialogPopup>\n <Palette />\n </CommandDialogPopup>\n </CommandDialog>\n </div>\n )\n }\n return <Demo />\n },\n}\n\n/* Every DS theme × light/dark — the inline palette chrome reads a63 overlay tokens. */\nexport const Themes: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {themes.map(theme =>\n (['light', 'dark'] as const).map(mode => (\n <UIProvider key={`${theme}-${mode}`} mode={mode} theme={theme}>\n <div\n style={{\n alignItems: 'center',\n background: 'var(--a63-surface-panel)',\n borderRadius: '0.75rem',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: '0.75rem',\n }}\n >\n <span style={{ fontSize: 12, color: 'var(--a63-text-secondary)', width: 96 }}>\n {theme} / {mode}\n </span>\n <div\n style={{\n background: 'var(--a63-surface-overlay)',\n border: '1px solid var(--a63-border-subtle)',\n borderRadius: 'var(--radius-2xl)',\n boxShadow: 'var(--a63-overlay-shadow)',\n flex: 1,\n maxWidth: 420,\n overflow: 'hidden',\n }}\n >\n <Palette />\n </div>\n </div>\n </UIProvider>\n ))\n )}\n </div>\n ),\n}\n\n/* The same command palette reviewed against target host contexts. */\nexport const Endpoints: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {[\n {\n label: 'Web',\n props: { density: 'comfortable', designLanguage: 'web', input: 'pointer' } as const,\n },\n {\n label: 'iOS touch',\n props: { density: 'comfortable', designLanguage: 'ios', input: 'touch' } as const,\n },\n {\n label: 'Compact extension',\n props: {\n density: 'compact',\n designLanguage: 'web',\n input: 'pointer',\n surface: 'n2',\n } as const,\n },\n ].map(endpoint => (\n <UIProvider key={endpoint.label} {...endpoint.props}>\n <div\n style={{\n alignItems: 'center',\n background: 'var(--a63-surface-panel)',\n borderRadius: 'var(--radius-lg)',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: '0.75rem',\n }}\n >\n <span style={{ fontSize: 12, color: 'var(--a63-text-secondary)', width: 112 }}>\n {endpoint.label}\n </span>\n <div\n style={{\n background: 'var(--a63-surface-overlay)',\n border: '1px solid var(--a63-border-subtle)',\n borderRadius: 'var(--radius-2xl)',\n boxShadow: 'var(--a63-overlay-shadow)',\n flex: 1,\n maxWidth: 420,\n overflow: 'hidden',\n }}\n >\n <Palette />\n </div>\n </div>\n </UIProvider>\n ))}\n </div>\n ),\n}\n\nexport const ContractMetadata: Story = {\n render: () => (\n <pre style={{ fontSize: 12, margin: 0, whiteSpace: 'pre-wrap' }}>\n {JSON.stringify(commandContract, null, 2)}\n </pre>\n ),\n}\n"
8203
8221
  },
8204
8222
  "summary": "Command provides a searchable command collection that can render inline or in a dialog.",
8205
8223
  "usage": "Group actions by intent, expose empty results, and keep shortcuts supplementary to labels.",
@@ -8778,7 +8796,8 @@
8778
8796
  "source": "packages/ui-foundation/contracts/components/pagination.json",
8779
8797
  "states": [
8780
8798
  "rest",
8781
- "current"
8799
+ "current",
8800
+ "disabled"
8782
8801
  ],
8783
8802
  "tokenSlots": []
8784
8803
  },
@@ -8813,7 +8832,7 @@
8813
8832
  ],
8814
8833
  "importPath": "@atom63/ui-react",
8815
8834
  "label": "Pagination",
8816
- "markdown": "# Pagination\n\nPagination provides a navigation landmark and consistent previous, next, and page links.\n\n**Status:** Stable\n\n## Preview\n\nThe live documentation page renders the `Playground` story maintained with the component.\n\n## Guidance\n\n- Expose the current page and real link destinations so navigation works without client state.\n- Preserve link, menu, command, or selection semantics instead of styling generic containers.\n- Expose current location when applicable and verify alternate input paths at narrow widths.\n\n## Usage\n\n```tsx\nimport { Pagination, PaginationContent, PaginationItem, PaginationLink } from '@atom63/ui-react'\n```\n\n## API surface\n\n**Values:** `Pagination`, `PaginationContent`, `PaginationEllipsis`, `PaginationItem`, `PaginationLink`, `PaginationNext`, `PaginationPrevious`\n\n**Types:** `PaginationContentProps`, `PaginationEllipsisProps`, `PaginationItemProps`, `PaginationLinkProps`, `PaginationNextProps`, `PaginationPreviousProps`, `PaginationProps`\n\nTypeScript remains the source of truth for complete prop contracts.\n\n## Contract\n\nSource: `packages/ui-foundation/contracts/components/pagination.json` (`paginationContract` in `@atom63/ui-foundation`).\n\n| Axis | Values | Default |\n| --- | --- | --- |\n| `linkSizes` | `xs`, `sm`, `md`, `lg`, `xl`, `tile`, `icon-xs`, `icon-sm`, `icon`, `icon-lg`, `icon-xl` | `icon` |\n\n**Slots:** `pagination`, `pagination-content`, `pagination-item`, `pagination-link`, `pagination-ellipsis`\n\n**States:** `rest`, `current`\n\n**Visual archetype:** Action controls — Momentary controls that perform an action now.\n\n## Related components\n\n- [Breadcrumb](/components/component-breadcrumb)\n- [Button](/components/component-button)\n",
8835
+ "markdown": "# Pagination\n\nPagination provides a navigation landmark and consistent previous, next, and page links.\n\n**Status:** Stable\n\n## Preview\n\nThe live documentation page renders the `Playground` story maintained with the component.\n\n## Guidance\n\n- Expose the current page and real link destinations so navigation works without client state.\n- Preserve link, menu, command, or selection semantics instead of styling generic containers.\n- Expose current location when applicable and verify alternate input paths at narrow widths.\n\n## Usage\n\n```tsx\nimport { Pagination, PaginationContent, PaginationItem, PaginationLink } from '@atom63/ui-react'\n```\n\n## API surface\n\n**Values:** `Pagination`, `PaginationContent`, `PaginationEllipsis`, `PaginationItem`, `PaginationLink`, `PaginationNext`, `PaginationPrevious`\n\n**Types:** `PaginationContentProps`, `PaginationEllipsisProps`, `PaginationItemProps`, `PaginationLinkProps`, `PaginationNextProps`, `PaginationPreviousProps`, `PaginationProps`\n\nTypeScript remains the source of truth for complete prop contracts.\n\n## Contract\n\nSource: `packages/ui-foundation/contracts/components/pagination.json` (`paginationContract` in `@atom63/ui-foundation`).\n\n| Axis | Values | Default |\n| --- | --- | --- |\n| `linkSizes` | `xs`, `sm`, `md`, `lg`, `xl`, `tile`, `icon-xs`, `icon-sm`, `icon`, `icon-lg`, `icon-xl` | `icon` |\n\n**Slots:** `pagination`, `pagination-content`, `pagination-item`, `pagination-link`, `pagination-ellipsis`\n\n**States:** `rest`, `current`, `disabled`\n\n**Visual archetype:** Action controls — Momentary controls that perform an action now.\n\n## Related components\n\n- [Breadcrumb](/components/component-breadcrumb)\n- [Button](/components/component-button)\n",
8817
8836
  "related": [
8818
8837
  "breadcrumb",
8819
8838
  "button"
@@ -8825,11 +8844,12 @@
8825
8844
  "file": "packages/ui-react/src/components/pagination/pagination.stories.tsx",
8826
8845
  "names": [
8827
8846
  "Playground",
8847
+ "FirstPage",
8828
8848
  "Themes",
8829
8849
  "Endpoints",
8830
8850
  "ContractMetadata"
8831
8851
  ],
8832
- "source": "import { paginationContract, themes } from '@atom63/ui-foundation'\nimport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n UIProvider,\n} from '@atom63/ui-react'\nimport '@atom63/ui-react/styles.css'\nimport type { Meta, StoryObj } from '@storybook/react-vite'\nimport { repeatedLandmarks } from '../story-probes'\n\nfunction Demo() {\n return (\n <Pagination>\n <PaginationContent>\n <PaginationItem>\n <PaginationPrevious href=\"#previous\" />\n </PaginationItem>\n <PaginationItem>\n <PaginationLink href=\"#page-1\">1</PaginationLink>\n </PaginationItem>\n <PaginationItem>\n <PaginationLink href=\"#page-2\" isActive>\n 2\n </PaginationLink>\n </PaginationItem>\n <PaginationItem>\n <PaginationLink href=\"#page-3\">3</PaginationLink>\n </PaginationItem>\n <PaginationItem>\n <PaginationEllipsis />\n </PaginationItem>\n <PaginationItem>\n <PaginationNext href=\"#next\" />\n </PaginationItem>\n </PaginationContent>\n </Pagination>\n )\n}\n\nconst meta = {\n title: 'UI React/Pagination',\n component: Pagination,\n} satisfies Meta<typeof Pagination>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nexport const Playground: Story = {\n render: () => <Demo />,\n}\n\nexport const Themes: Story = {\n parameters: repeatedLandmarks,\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {themes.map(theme =>\n (['light', 'dark'] as const).map(mode => (\n <UIProvider key={`${theme}-${mode}`} mode={mode} theme={theme}>\n <div\n style={{\n alignItems: 'center',\n background: 'var(--a63-surface-panel)',\n borderRadius: 'var(--a63-surface-radius, var(--radius-lg))',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: '0.75rem',\n }}\n >\n <span style={{ fontSize: 12, color: 'var(--a63-text-secondary)', width: 96 }}>\n {theme} / {mode}\n </span>\n <Demo />\n </div>\n </UIProvider>\n ))\n )}\n </div>\n ),\n}\n\nexport const Endpoints: Story = {\n parameters: repeatedLandmarks,\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n <UIProvider designLanguage=\"web\" input=\"pointer\">\n <EndpointPagination label=\"Web\" />\n </UIProvider>\n <UIProvider designLanguage=\"ios\" input=\"touch\">\n <EndpointPagination label=\"iOS touch\" />\n </UIProvider>\n <UIProvider density=\"compact\" designLanguage=\"web\" input=\"pointer\">\n <EndpointPagination label=\"Compact extension\" />\n </UIProvider>\n </div>\n ),\n}\n\nexport const ContractMetadata: Story = {\n render: () => (\n <pre style={{ fontSize: 12, margin: 0, whiteSpace: 'pre-wrap' }}>\n {JSON.stringify(paginationContract, null, 2)}\n </pre>\n ),\n}\n\nfunction EndpointPagination({ label }: { label: string }) {\n return (\n <div\n style={{\n alignItems: 'center',\n background: 'var(--a63-surface-panel)',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: 12,\n }}\n >\n <span style={{ fontSize: 12, color: 'var(--a63-text-secondary)', width: 112 }}>{label}</span>\n <div style={{ flex: 1 }}>\n <Demo />\n </div>\n </div>\n )\n}\n"
8852
+ "source": "import { paginationContract, themes } from '@atom63/ui-foundation'\nimport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n UIProvider,\n} from '@atom63/ui-react'\nimport '@atom63/ui-react/styles.css'\nimport type { Meta, StoryObj } from '@storybook/react-vite'\nimport { repeatedLandmarks } from '../story-probes'\n\nfunction Demo() {\n return (\n <Pagination>\n <PaginationContent>\n <PaginationItem>\n <PaginationPrevious href=\"#previous\" />\n </PaginationItem>\n <PaginationItem>\n <PaginationLink href=\"#page-1\">1</PaginationLink>\n </PaginationItem>\n <PaginationItem>\n <PaginationLink href=\"#page-2\" isActive>\n 2\n </PaginationLink>\n </PaginationItem>\n <PaginationItem>\n <PaginationLink href=\"#page-3\">3</PaginationLink>\n </PaginationItem>\n <PaginationItem>\n <PaginationEllipsis />\n </PaginationItem>\n <PaginationItem>\n <PaginationNext href=\"#next\" />\n </PaginationItem>\n </PaginationContent>\n </Pagination>\n )\n}\n\nconst meta = {\n title: 'UI React/Pagination',\n component: Pagination,\n} satisfies Meta<typeof Pagination>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nexport const Playground: Story = {\n render: () => <Demo />,\n}\n\n/** On the first page, Previous is disabled: no href, out of the tab order, announced as disabled. */\nexport const FirstPage: Story = {\n render: () => (\n <Pagination>\n <PaginationContent>\n <PaginationItem>\n <PaginationPrevious disabled />\n </PaginationItem>\n <PaginationItem>\n <PaginationLink href=\"#page-1\" isActive>\n 1\n </PaginationLink>\n </PaginationItem>\n <PaginationItem>\n <PaginationLink href=\"#page-2\">2</PaginationLink>\n </PaginationItem>\n <PaginationItem>\n <PaginationNext href=\"#next\" />\n </PaginationItem>\n </PaginationContent>\n </Pagination>\n ),\n play: async ({ canvasElement }) => {\n const previous = canvasElement.querySelector<HTMLElement>('[aria-label=\"Go to previous page\"]')\n if (!previous) throw new Error('Expected the Previous control')\n if (previous.hasAttribute('href')) throw new Error('Expected a disabled Previous without href')\n if (previous.getAttribute('aria-disabled') !== 'true') {\n throw new Error('Expected aria-disabled=\"true\" on the disabled Previous')\n }\n previous.focus()\n if (document.activeElement === previous) throw new Error('Expected Previous to be unfocusable')\n },\n}\n\nexport const Themes: Story = {\n parameters: repeatedLandmarks,\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {themes.map(theme =>\n (['light', 'dark'] as const).map(mode => (\n <UIProvider key={`${theme}-${mode}`} mode={mode} theme={theme}>\n <div\n style={{\n alignItems: 'center',\n background: 'var(--a63-surface-panel)',\n borderRadius: 'var(--a63-surface-radius, var(--radius-lg))',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: '0.75rem',\n }}\n >\n <span style={{ fontSize: 12, color: 'var(--a63-text-secondary)', width: 96 }}>\n {theme} / {mode}\n </span>\n <Demo />\n </div>\n </UIProvider>\n ))\n )}\n </div>\n ),\n}\n\nexport const Endpoints: Story = {\n parameters: repeatedLandmarks,\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n <UIProvider designLanguage=\"web\" input=\"pointer\">\n <EndpointPagination label=\"Web\" />\n </UIProvider>\n <UIProvider designLanguage=\"ios\" input=\"touch\">\n <EndpointPagination label=\"iOS touch\" />\n </UIProvider>\n <UIProvider density=\"compact\" designLanguage=\"web\" input=\"pointer\">\n <EndpointPagination label=\"Compact extension\" />\n </UIProvider>\n </div>\n ),\n}\n\nexport const ContractMetadata: Story = {\n render: () => (\n <pre style={{ fontSize: 12, margin: 0, whiteSpace: 'pre-wrap' }}>\n {JSON.stringify(paginationContract, null, 2)}\n </pre>\n ),\n}\n\nfunction EndpointPagination({ label }: { label: string }) {\n return (\n <div\n style={{\n alignItems: 'center',\n background: 'var(--a63-surface-panel)',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: 12,\n }}\n >\n <span style={{ fontSize: 12, color: 'var(--a63-text-secondary)', width: 112 }}>{label}</span>\n <div style={{ flex: 1 }}>\n <Demo />\n </div>\n </div>\n )\n}\n"
8833
8853
  },
8834
8854
  "summary": "Pagination provides a navigation landmark and consistent previous, next, and page links.",
8835
8855
  "usage": "Expose the current page and real link destinations so navigation works without client state.",
@@ -9803,6 +9823,7 @@
9803
9823
  "file": "packages/ui-react/src/components/drawer/drawer.stories.tsx",
9804
9824
  "names": [
9805
9825
  "Playground",
9826
+ "Open",
9806
9827
  "PersistentSheet",
9807
9828
  "Directions",
9808
9829
  "RightToLeft",
@@ -9810,7 +9831,7 @@
9810
9831
  "Endpoints",
9811
9832
  "ContractMetadata"
9812
9833
  ],
9813
- "source": "import { drawerContract, drawerDirections, themes } from '@atom63/ui-foundation'\nimport {\n Button,\n Drawer,\n DrawerBody,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerTitle,\n DrawerTrigger,\n UIProvider,\n} from '@atom63/ui-react'\nimport '@atom63/ui-react/styles.css'\nimport type { Meta, StoryObj } from '@storybook/react-vite'\nimport { type ComponentProps, useState } from 'react'\n\nconst meta = {\n title: 'UI React/Drawer',\n component: Drawer,\n argTypes: {\n direction: { control: 'inline-radio', options: drawerDirections },\n },\n args: { direction: 'bottom' },\n} satisfies Meta<typeof Drawer>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nfunction DrawerDemo({ portalContainer }: { portalContainer?: HTMLElement | null }) {\n return (\n <Drawer>\n <DrawerTrigger render={<Button variant=\"secondary\">Open drawer</Button>} />\n <DrawerContent portalProps={{ container: portalContainer }}>\n <DrawerHeader>\n <DrawerTitle>Appearance</DrawerTitle>\n <DrawerDescription>Drag the handle down to dismiss.</DrawerDescription>\n </DrawerHeader>\n <DrawerBody>\n The drawer body owns scrolling and keeps the header and actions anchored.\n </DrawerBody>\n <DrawerFooter>\n <DrawerClose render={<Button variant=\"primary\">Done</Button>} />\n </DrawerFooter>\n </DrawerContent>\n </Drawer>\n )\n}\n\ntype ProviderProps = Omit<ComponentProps<typeof UIProvider>, 'children'>\n\nfunction ReviewCell({ label, providerProps }: { label: string; providerProps: ProviderProps }) {\n const [portalContainer, setPortalContainer] = useState<HTMLDivElement | null>(null)\n\n return (\n <UIProvider {...providerProps}>\n <div\n ref={setPortalContainer}\n style={{\n alignItems: 'center',\n background: 'var(--a63-surface-panel)',\n borderRadius: 'var(--radius-lg)',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: '0.75rem',\n }}\n >\n <span style={{ fontSize: 12, color: 'var(--a63-text-secondary)', width: 112 }}>\n {label}\n </span>\n <DrawerDemo portalContainer={portalContainer} />\n </div>\n </UIProvider>\n )\n}\n\nexport const Playground: Story = {\n render: args => (\n <Drawer {...args}>\n <DrawerTrigger render={<Button variant=\"secondary\">Open drawer</Button>} />\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>Appearance</DrawerTitle>\n <DrawerDescription>Drag the handle down to dismiss.</DrawerDescription>\n </DrawerHeader>\n <DrawerBody style={{ color: 'var(--a63-text-secondary)' }}>\n The sheet is a raised overlay surface. Content scrolls inside.\n </DrawerBody>\n <DrawerFooter>\n <DrawerClose render={<Button variant=\"primary\">Done</Button>} />\n </DrawerFooter>\n </DrawerContent>\n </Drawer>\n ),\n}\n\n/* A persistent bottom sheet over a map or photo: modal={false} keeps the page\n usable behind it, and snapPoints let it rest at a peek height or open fully. */\nexport const PersistentSheet: Story = {\n render: () => (\n <div\n style={{\n background: 'var(--a63-surface-muted)',\n borderRadius: 'var(--radius-xl)',\n color: 'var(--a63-text-secondary)',\n height: 420,\n padding: 16,\n width: 360,\n }}\n >\n The map stays usable behind the sheet.\n <Drawer defaultOpen modal={false} snapPoints={['148px', 1]}>\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>Choose a ride</DrawerTitle>\n <DrawerDescription>Drag up for all options.</DrawerDescription>\n </DrawerHeader>\n <DrawerBody style={{ color: 'var(--a63-text-secondary)' }}>\n Standard · 4 min away\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n </div>\n ),\n}\n\n/* The four drawer directions. */\nexport const Directions: Story = {\n render: () => (\n <div style={{ display: 'flex', gap: 12 }}>\n {drawerDirections.map(direction => (\n <Drawer direction={direction} key={direction}>\n <DrawerTrigger render={<Button variant=\"secondary\">{direction}</Button>} />\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>{direction} drawer</DrawerTitle>\n </DrawerHeader>\n <DrawerBody>Direction: {direction}</DrawerBody>\n </DrawerContent>\n </Drawer>\n ))}\n </div>\n ),\n}\n\n/* Right-to-left: `left` and `right` are screen edges, so a left drawer still\n docks to the left edge, slides in from it and swipes back towards it, while\n its content reads right to left. */\nexport const RightToLeft: Story = {\n render: () => {\n const [portalContainer, setPortalContainer] = useState<HTMLDivElement | null>(null)\n return (\n <UIProvider dir=\"rtl\" lang=\"ar\" ref={setPortalContainer}>\n <Drawer defaultOpen direction=\"left\">\n <DrawerTrigger render={<Button variant=\"secondary\">فتح الدرج</Button>} />\n <DrawerContent portalProps={{ container: portalContainer }}>\n <DrawerHeader>\n <DrawerTitle>المظهر</DrawerTitle>\n <DrawerDescription>اسحب نحو الحافة اليسرى للإغلاق.</DrawerDescription>\n </DrawerHeader>\n <DrawerBody>يقرأ المحتوى من اليمين إلى اليسار.</DrawerBody>\n <DrawerFooter>\n <DrawerClose render={<Button variant=\"primary\">تم</Button>} />\n </DrawerFooter>\n </DrawerContent>\n </Drawer>\n </UIProvider>\n )\n },\n}\n\n/*\n * The drawer content renders in a portal (raised overlay surface), so a matrix of\n * open sheets would stack over the whole page rather than read per-theme. The\n * always-visible, in-flow part is the trigger, so each theme cell renders a live\n * drawer whose trigger shows the token-driven chrome across all 4 DS themes.\n */\nexport const Themes: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {themes.map(theme =>\n (['light', 'dark'] as const).map(mode => (\n <ReviewCell\n key={`${theme}-${mode}`}\n label={`${theme} / ${mode}`}\n providerProps={{ mode, theme }}\n />\n ))\n )}\n </div>\n ),\n}\n\nexport const Endpoints: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n <ReviewCell\n label=\"Web\"\n providerProps={{ density: 'comfortable', designLanguage: 'web', input: 'pointer' }}\n />\n <ReviewCell\n label=\"iOS touch\"\n providerProps={{ density: 'comfortable', designLanguage: 'ios', input: 'touch' }}\n />\n <ReviewCell\n label=\"Compact extension\"\n providerProps={{\n density: 'compact',\n designLanguage: 'web',\n input: 'pointer',\n surface: 'n2',\n }}\n />\n </div>\n ),\n}\n\nexport const ContractMetadata: Story = {\n render: () => (\n <pre style={{ fontSize: 12, margin: 0, whiteSpace: 'pre-wrap' }}>\n {JSON.stringify(drawerContract, null, 2)}\n </pre>\n ),\n}\n"
9834
+ "source": "import { drawerContract, drawerDirections, themes } from '@atom63/ui-foundation'\nimport {\n Button,\n Drawer,\n DrawerBody,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerTitle,\n DrawerTrigger,\n UIProvider,\n} from '@atom63/ui-react'\nimport '@atom63/ui-react/styles.css'\nimport type { Meta, StoryObj } from '@storybook/react-vite'\nimport { type ComponentProps, useState } from 'react'\n\nconst meta = {\n title: 'UI React/Drawer',\n component: Drawer,\n argTypes: {\n direction: { control: 'inline-radio', options: drawerDirections },\n },\n args: { direction: 'bottom' },\n} satisfies Meta<typeof Drawer>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nfunction DrawerDemo({ portalContainer }: { portalContainer?: HTMLElement | null }) {\n return (\n <Drawer>\n <DrawerTrigger render={<Button variant=\"secondary\">Open drawer</Button>} />\n <DrawerContent portalProps={{ container: portalContainer }}>\n <DrawerHeader>\n <DrawerTitle>Appearance</DrawerTitle>\n <DrawerDescription>Drag the handle down to dismiss.</DrawerDescription>\n </DrawerHeader>\n <DrawerBody>\n The drawer body owns scrolling and keeps the header and actions anchored.\n </DrawerBody>\n <DrawerFooter>\n <DrawerClose render={<Button variant=\"primary\">Done</Button>} />\n </DrawerFooter>\n </DrawerContent>\n </Drawer>\n )\n}\n\ntype ProviderProps = Omit<ComponentProps<typeof UIProvider>, 'children'>\n\nfunction ReviewCell({ label, providerProps }: { label: string; providerProps: ProviderProps }) {\n const [portalContainer, setPortalContainer] = useState<HTMLDivElement | null>(null)\n\n return (\n <UIProvider {...providerProps}>\n <div\n ref={setPortalContainer}\n style={{\n alignItems: 'center',\n background: 'var(--a63-surface-panel)',\n borderRadius: 'var(--radius-lg)',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: '0.75rem',\n }}\n >\n <span style={{ fontSize: 12, color: 'var(--a63-text-secondary)', width: 112 }}>\n {label}\n </span>\n <DrawerDemo portalContainer={portalContainer} />\n </div>\n </UIProvider>\n )\n}\n\nexport const Playground: Story = {\n render: args => (\n <Drawer {...args}>\n <DrawerTrigger render={<Button variant=\"secondary\">Open drawer</Button>} />\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>Appearance</DrawerTitle>\n <DrawerDescription>Drag the handle down to dismiss.</DrawerDescription>\n </DrawerHeader>\n <DrawerBody style={{ color: 'var(--a63-text-secondary)' }}>\n The sheet is a raised overlay surface. Content scrolls inside.\n </DrawerBody>\n <DrawerFooter>\n <DrawerClose render={<Button variant=\"primary\">Done</Button>} />\n </DrawerFooter>\n </DrawerContent>\n </Drawer>\n ),\n}\n\n/** The drawer open as an app shows it: modal, over the whole page. */\nexport const Open: Story = {\n render: args => (\n <Drawer {...args} defaultOpen>\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>Appearance</DrawerTitle>\n <DrawerDescription>Drag the handle down to dismiss.</DrawerDescription>\n </DrawerHeader>\n <DrawerBody style={{ color: 'var(--a63-text-secondary)' }}>\n The sheet is a raised overlay surface. Content scrolls inside.\n </DrawerBody>\n <DrawerFooter>\n <DrawerClose render={<Button variant=\"primary\">Done</Button>} />\n </DrawerFooter>\n </DrawerContent>\n </Drawer>\n ),\n}\n\n/* A persistent bottom sheet over a map or photo: modal={false} keeps the page\n usable behind it, and snapPoints let it rest at a peek height or open fully. */\nexport const PersistentSheet: Story = {\n render: () => (\n <div\n style={{\n background: 'var(--a63-surface-muted)',\n borderRadius: 'var(--radius-xl)',\n color: 'var(--a63-text-secondary)',\n height: 420,\n padding: 16,\n width: 360,\n }}\n >\n The map stays usable behind the sheet.\n <Drawer defaultOpen modal={false} snapPoints={['148px', 1]}>\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>Choose a ride</DrawerTitle>\n <DrawerDescription>Drag up for all options.</DrawerDescription>\n </DrawerHeader>\n <DrawerBody style={{ color: 'var(--a63-text-secondary)' }}>\n Standard · 4 min away\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n </div>\n ),\n}\n\n/* The four drawer directions. */\nexport const Directions: Story = {\n render: () => (\n <div style={{ display: 'flex', gap: 12 }}>\n {drawerDirections.map(direction => (\n <Drawer direction={direction} key={direction}>\n <DrawerTrigger render={<Button variant=\"secondary\">{direction}</Button>} />\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>{direction} drawer</DrawerTitle>\n </DrawerHeader>\n <DrawerBody>Direction: {direction}</DrawerBody>\n </DrawerContent>\n </Drawer>\n ))}\n </div>\n ),\n}\n\n/* Right-to-left: `left` and `right` are screen edges, so a left drawer still\n docks to the left edge, slides in from it and swipes back towards it, while\n its content reads right to left. */\nexport const RightToLeft: Story = {\n render: () => {\n const [portalContainer, setPortalContainer] = useState<HTMLDivElement | null>(null)\n return (\n <UIProvider dir=\"rtl\" lang=\"ar\" ref={setPortalContainer}>\n <Drawer defaultOpen direction=\"left\">\n <DrawerTrigger render={<Button variant=\"secondary\">فتح الدرج</Button>} />\n <DrawerContent portalProps={{ container: portalContainer }}>\n <DrawerHeader>\n <DrawerTitle>المظهر</DrawerTitle>\n <DrawerDescription>اسحب نحو الحافة اليسرى للإغلاق.</DrawerDescription>\n </DrawerHeader>\n <DrawerBody>يقرأ المحتوى من اليمين إلى اليسار.</DrawerBody>\n <DrawerFooter>\n <DrawerClose render={<Button variant=\"primary\">تم</Button>} />\n </DrawerFooter>\n </DrawerContent>\n </Drawer>\n </UIProvider>\n )\n },\n}\n\n/*\n * The drawer content renders in a portal (raised overlay surface), so a matrix of\n * open sheets would stack over the whole page rather than read per-theme. The\n * always-visible, in-flow part is the trigger, so each theme cell renders a live\n * drawer whose trigger shows the token-driven chrome across all 4 DS themes.\n */\nexport const Themes: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {themes.map(theme =>\n (['light', 'dark'] as const).map(mode => (\n <ReviewCell\n key={`${theme}-${mode}`}\n label={`${theme} / ${mode}`}\n providerProps={{ mode, theme }}\n />\n ))\n )}\n </div>\n ),\n}\n\nexport const Endpoints: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n <ReviewCell\n label=\"Web\"\n providerProps={{ density: 'comfortable', designLanguage: 'web', input: 'pointer' }}\n />\n <ReviewCell\n label=\"iOS touch\"\n providerProps={{ density: 'comfortable', designLanguage: 'ios', input: 'touch' }}\n />\n <ReviewCell\n label=\"Compact extension\"\n providerProps={{\n density: 'compact',\n designLanguage: 'web',\n input: 'pointer',\n surface: 'n2',\n }}\n />\n </div>\n ),\n}\n\nexport const ContractMetadata: Story = {\n render: () => (\n <pre style={{ fontSize: 12, margin: 0, whiteSpace: 'pre-wrap' }}>\n {JSON.stringify(drawerContract, null, 2)}\n </pre>\n ),\n}\n"
9814
9835
  },
9815
9836
  "summary": "Drawer presents modal content from a viewport edge with drag-aware behavior.",
9816
9837
  "usage": "Use it for a temporary edge surface, not as a replacement for persistent page navigation.",
@@ -11660,6 +11681,122 @@
11660
11681
  "CarouselNext"
11661
11682
  ]
11662
11683
  },
11684
+ {
11685
+ "axisGuidance": {
11686
+ "size": {
11687
+ "md": "A 240px plot with five y-axis ticks, for a chart that leads a section.",
11688
+ "sm": "A 160px plot with three ticks, for a compact card."
11689
+ },
11690
+ "state": {
11691
+ "current": "A category picked by the pointer or the arrow keys; the tooltip shows its values.",
11692
+ "rest": "No category picked; only the marks, axes and legend show."
11693
+ }
11694
+ },
11695
+ "contract": {
11696
+ "archetypes": [
11697
+ {
11698
+ "description": "In-flow containers and content surfaces that do not inherently manipulate state.",
11699
+ "id": "surface",
11700
+ "label": "Static content surfaces"
11701
+ }
11702
+ ],
11703
+ "axes": [
11704
+ {
11705
+ "name": "types",
11706
+ "values": [
11707
+ "line",
11708
+ "area",
11709
+ "bar"
11710
+ ],
11711
+ "default": "line"
11712
+ },
11713
+ {
11714
+ "name": "sizes",
11715
+ "values": [
11716
+ "sm",
11717
+ "md"
11718
+ ],
11719
+ "default": "md"
11720
+ },
11721
+ {
11722
+ "name": "colors",
11723
+ "values": [
11724
+ "1",
11725
+ "2",
11726
+ "3",
11727
+ "4",
11728
+ "5"
11729
+ ]
11730
+ }
11731
+ ],
11732
+ "exportName": "chartContract",
11733
+ "slots": [
11734
+ "chart",
11735
+ "chart-legend",
11736
+ "chart-plot",
11737
+ "chart-y-axis",
11738
+ "chart-x-axis",
11739
+ "chart-tooltip",
11740
+ "chart-table",
11741
+ "chart-table-toggle"
11742
+ ],
11743
+ "source": "packages/ui-foundation/contracts/components/chart.json",
11744
+ "states": [
11745
+ "rest",
11746
+ "current"
11747
+ ],
11748
+ "tokenSlots": []
11749
+ },
11750
+ "exports": {
11751
+ "types": [
11752
+ "ChartLabels",
11753
+ "ChartProps",
11754
+ "ChartSeries"
11755
+ ],
11756
+ "values": [
11757
+ "Chart"
11758
+ ]
11759
+ },
11760
+ "group": {
11761
+ "id": "content-and-surfaces",
11762
+ "title": "Content and surfaces"
11763
+ },
11764
+ "guidance": [
11765
+ "Pass a `label`, the `categories` and up to five `series`; set `type` to line, area or bar and `stacked` to stack bars or areas. Series take --a63-chart-1 to 5 in order, which keep apart from the brand on every brand; give a series `color` to pin it. The plot is one tab stop: arrow keys, Home and End pick a category and show its tooltip. Every chart carries a data table of the same numbers, visually hidden unless `table=\"toggle\"` adds a button that shows it. For big or live data, zooming, scatter or pie charts, or values below zero, use a charting library; when the exact numbers matter more than the shape, use a Table.",
11766
+ "Keep product data and fetching outside the presentational component.",
11767
+ "Test long, empty, and narrow content before adding local layout overrides."
11768
+ ],
11769
+ "importPath": "@atom63/ui-react/chart",
11770
+ "label": "Chart",
11771
+ "markdown": "# Chart\n\nChart draws a small line, area or bar chart (grouped or stacked) of a few series over a categorical axis, with a tooltip, a legend and a data table for screen readers.\n\n**Status:** Preview\n\n## Preview\n\nThe live documentation page renders the `Playground` story maintained with the component.\n\n## Guidance\n\n- Pass a `label`, the `categories` and up to five `series`; set `type` to line, area or bar and `stacked` to stack bars or areas. Series take --a63-chart-1 to 5 in order, which keep apart from the brand on every brand; give a series `color` to pin it. The plot is one tab stop: arrow keys, Home and End pick a category and show its tooltip. Every chart carries a data table of the same numbers, visually hidden unless `table=\"toggle\"` adds a button that shows it. For big or live data, zooming, scatter or pie charts, or values below zero, use a charting library; when the exact numbers matter more than the shape, use a Table.\n- Keep product data and fetching outside the presentational component.\n- Test long, empty, and narrow content before adding local layout overrides.\n\n## Variants, sizes and states\n\n| Axis | Value | Guidance |\n| --- | --- | --- |\n| Size | `md` | A 240px plot with five y-axis ticks, for a chart that leads a section. |\n| Size | `sm` | A 160px plot with three ticks, for a compact card. |\n| State | `current` | A category picked by the pointer or the arrow keys; the tooltip shows its values. |\n| State | `rest` | No category picked; only the marks, axes and legend show. |\n\n## Usage\n\n```tsx\nimport { Chart } from '@atom63/ui-react/chart'\n```\n\n## API surface\n\n**Values:** `Chart`\n\n**Types:** `ChartLabels`, `ChartProps`, `ChartSeries`\n\nTypeScript remains the source of truth for complete prop contracts.\n\n## Contract\n\nSource: `packages/ui-foundation/contracts/components/chart.json` (`chartContract` in `@atom63/ui-foundation`).\n\n| Axis | Values | Default |\n| --- | --- | --- |\n| `types` | `line`, `area`, `bar` | `line` |\n| `sizes` | `sm`, `md` | `md` |\n| `colors` | `1`, `2`, `3`, `4`, `5` | — |\n\n**Slots:** `chart`, `chart-legend`, `chart-plot`, `chart-y-axis`, `chart-x-axis`, `chart-tooltip`, `chart-table`, `chart-table-toggle`\n\n**States:** `rest`, `current`\n\n**Visual archetype:** Static content surfaces — In-flow containers and content surfaces that do not inherently manipulate state.\n\n## Related components\n\n- [Table](/components/component-table)\n- [Progress](/components/component-progress)\n- [Card](/components/component-card)\n",
11772
+ "related": [
11773
+ "table",
11774
+ "progress",
11775
+ "card"
11776
+ ],
11777
+ "route": "/components/component-chart",
11778
+ "slug": "chart",
11779
+ "status": "preview",
11780
+ "stories": {
11781
+ "file": "packages/ui-react/src/components/chart/chart.stories.tsx",
11782
+ "names": [
11783
+ "Playground",
11784
+ "Types",
11785
+ "Keyboard",
11786
+ "DataTable",
11787
+ "Brands",
11788
+ "Themes",
11789
+ "ForcedColors",
11790
+ "RightToLeft"
11791
+ ],
11792
+ "source": "import { chartSizes, chartTypes, themes } from '@atom63/ui-foundation'\nimport { UIProvider } from '@atom63/ui-react'\nimport { Chart } from '@atom63/ui-react/chart'\nimport '@atom63/ui-react/styles.css'\nimport type { Meta, StoryObj } from '@storybook/react-vite'\n\nconst months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\nconst usd = new Intl.NumberFormat('en-US', {\n currency: 'USD',\n maximumFractionDigits: 0,\n style: 'currency',\n})\nconst compact = new Intl.NumberFormat('en-US', {\n currency: 'USD',\n maximumFractionDigits: 1,\n notation: 'compact',\n style: 'currency',\n})\n\nconst mrr = [42, 44, 47, 46, 51, 55, 58, 61, 60, 66, 71, 74].map(value => value * 1000)\nconst movement = [\n { label: 'New', values: [6, 5, 7, 4, 8, 7, 6, 8, 5, 9, 8, 7].map(value => value * 1000) },\n { label: 'Expansion', values: [2, 3, 2, 3, 3, 4, 3, 2, 4, 3, 4, 5].map(value => value * 1000) },\n { label: 'Churned', values: [3, 2, 4, 5, 3, 3, 3, 2, 6, 3, 3, 4].map(value => value * 1000) },\n]\nconst plans = [\n { label: 'Starter', values: [8, 9, 9, 10] },\n { label: 'Growth', values: [12, 13, 15, 16] },\n { label: 'Scale', values: [9, 10, 10, 12] },\n { label: 'Enterprise', values: [14, 14, 16, 19] },\n { label: 'Partner', values: [3, 4, 4, 5] },\n]\n\nconst meta = {\n title: 'UI React/Chart',\n component: Chart,\n argTypes: {\n size: { control: 'inline-radio', options: chartSizes },\n type: { control: 'inline-radio', options: chartTypes },\n stacked: { control: 'boolean' },\n table: { control: 'inline-radio', options: ['hidden', 'toggle'] },\n },\n args: {\n categories: months,\n categoryLabel: 'Month',\n description: 'New revenue outpaces churn in every month but September.',\n formatTick: compact.format,\n formatValue: usd.format,\n label: 'MRR movement by month',\n series: movement,\n size: 'md',\n type: 'bar',\n },\n decorators: [\n Story => (\n <div style={{ maxWidth: 640 }}>\n <Story />\n </div>\n ),\n ],\n} satisfies Meta<typeof Chart>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nexport const Playground: Story = {}\n\n/* Line, area, grouped bars and stacked bars, each from the same contract. */\nexport const Types: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 32 }}>\n <Chart\n categories={months}\n formatTick={compact.format}\n formatValue={usd.format}\n label=\"MRR by month\"\n series={[{ label: 'MRR', values: mrr }]}\n type=\"line\"\n />\n <Chart\n categories={months}\n formatTick={compact.format}\n formatValue={usd.format}\n label=\"MRR by month, as an area\"\n series={[{ label: 'MRR', values: mrr }]}\n type=\"area\"\n />\n <Chart\n categories={months}\n formatTick={compact.format}\n formatValue={usd.format}\n label=\"MRR movement by month\"\n series={movement}\n type=\"bar\"\n />\n <Chart\n categories={['Q1', 'Q2', 'Q3', 'Q4']}\n label=\"Accounts by plan and quarter\"\n series={plans}\n size=\"sm\"\n stacked\n type=\"bar\"\n />\n </div>\n ),\n}\n\n/* Pressing an arrow key on the plot picks a category and shows its tooltip. */\nexport const Keyboard: Story = {\n args: { type: 'line', series: movement.slice(0, 2) },\n play: ({ canvasElement }) => {\n const plot = canvasElement.querySelector<HTMLElement>('[data-slot=\"chart-plot\"]')\n if (!plot) throw new Error('The chart has no plot')\n plot.focus()\n plot.dispatchEvent(new KeyboardEvent('keydown', { bubbles: true, key: 'End' }))\n return new Promise<void>(resolve => requestAnimationFrame(() => resolve())).then(() => {\n const tooltip = canvasElement.querySelector('[data-slot=\"chart-tooltip\"]')\n if (!tooltip?.textContent?.includes('Dec')) {\n throw new Error(`Expected the tooltip to show Dec, got \"${tooltip?.textContent ?? ''}\"`)\n }\n })\n },\n}\n\n/* The data table, shown with the toggle. */\nexport const DataTable: Story = {\n args: { categories: months.slice(0, 4), series: movement, table: 'toggle' },\n}\n\n/* Five series on each brand: series 2 to 5 turn from the brand's hue, so none\n of them lands on it, the violet brand (b5) included. */\nexport const Brands: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {(['b1', 'b2', 'b3', 'b4', 'b5', 'b6'] as const).map(brand => (\n <UIProvider brand={brand} key={brand}>\n <div style={{ background: 'var(--a63-surface-panel)', padding: '0.75rem' }}>\n <Chart\n categories={['Q1', 'Q2', 'Q3', 'Q4']}\n label={`Accounts by plan, brand ${brand}`}\n series={plans}\n size=\"sm\"\n type=\"bar\"\n />\n </div>\n </UIProvider>\n ))}\n </div>\n ),\n}\n\nexport const Themes: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {themes.map(theme =>\n (['light', 'dark'] as const).map(mode => (\n <UIProvider key={`${theme}-${mode}`} mode={mode} theme={theme}>\n <div style={{ background: 'var(--a63-surface-panel)', padding: '0.75rem' }}>\n <Chart\n categories={months.slice(0, 6)}\n label={`MRR movement, ${theme} ${mode}`}\n series={movement}\n size=\"sm\"\n type=\"bar\"\n />\n <Chart\n categories={months.slice(0, 6)}\n label={`MRR, ${theme} ${mode}`}\n series={[{ label: 'MRR', values: mrr.slice(0, 6) }, movement[0]!]}\n size=\"sm\"\n type=\"area\"\n />\n </div>\n </UIProvider>\n ))\n )}\n </div>\n ),\n}\n\n/* Forced colours drop the series colours; lines dash and bars outline in a\n different pattern per series, and the legend keys follow. */\nexport const ForcedColors: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 24 }}>\n <Chart\n categories={months.slice(0, 6)}\n label=\"MRR movement\"\n series={movement}\n size=\"sm\"\n type=\"line\"\n />\n <Chart\n categories={['Q1', 'Q2', 'Q3', 'Q4']}\n label=\"Accounts by plan\"\n series={plans}\n size=\"sm\"\n type=\"bar\"\n />\n </div>\n ),\n}\n\n/* Right to left: the categories run from the right, and the arrow keys follow. */\nexport const RightToLeft: Story = {\n render: args => (\n <UIProvider dir=\"rtl\">\n <Chart {...args} />\n </UIProvider>\n ),\n}\n"
11793
+ },
11794
+ "summary": "Chart draws a small line, area or bar chart (grouped or stacked) of a few series over a categorical axis, with a tooltip, a legend and a data table for screen readers.",
11795
+ "usage": "Pass a `label`, the `categories` and up to five `series`; set `type` to line, area or bar and `stacked` to stack bars or areas. Series take --a63-chart-1 to 5 in order, which keep apart from the brand on every brand; give a series `color` to pin it. The plot is one tab stop: arrow keys, Home and End pick a category and show its tooltip. Every chart carries a data table of the same numbers, visually hidden unless `table=\"toggle\"` adds a button that shows it. For big or live data, zooming, scatter or pie charts, or values below zero, use a charting library; when the exact numbers matter more than the shape, use a Table.",
11796
+ "usageExports": [
11797
+ "Chart"
11798
+ ]
11799
+ },
11663
11800
  {
11664
11801
  "axisGuidance": null,
11665
11802
  "contract": {
@@ -13152,13 +13289,16 @@
13152
13289
  "table-row",
13153
13290
  "table-head",
13154
13291
  "table-cell",
13155
- "table-caption"
13292
+ "table-caption",
13293
+ "table-sort-button"
13156
13294
  ],
13157
13295
  "source": "packages/ui-foundation/contracts/components/table.json",
13158
13296
  "states": [
13159
13297
  "rest",
13160
13298
  "row-hover",
13161
- "row-selected"
13299
+ "row-selected",
13300
+ "sort-ascending",
13301
+ "sort-descending"
13162
13302
  ],
13163
13303
  "tokenSlots": []
13164
13304
  },
@@ -13171,7 +13311,9 @@
13171
13311
  "TableHeadProps",
13172
13312
  "TableHeaderProps",
13173
13313
  "TableProps",
13174
- "TableRowProps"
13314
+ "TableRowProps",
13315
+ "TableSort",
13316
+ "TableSortDirection"
13175
13317
  ],
13176
13318
  "values": [
13177
13319
  "Table",
@@ -13195,7 +13337,7 @@
13195
13337
  ],
13196
13338
  "importPath": "@atom63/ui-react",
13197
13339
  "label": "Table",
13198
- "markdown": "# Table\n\nTable provides semantic table regions with shared typography, spacing, and states.\n\n**Status:** Stable\n\n## Preview\n\nThe live documentation page renders the `Playground` story maintained with the component.\n\n## Guidance\n\n- Keep header relationships intact and add horizontal containment for genuinely wide data. For a dense table (admin, payments, issues), pass size=\"sm\": rows are 33px, and a row checkbox or a 24px row menu (size=\"icon-xs\") keeps its hit area without making the row taller.\n- Keep product data and fetching outside the presentational component.\n- Test long, empty, and narrow content before adding local layout overrides.\n\n## Usage\n\n```tsx\nimport { Table, TableHeader, TableBody, TableRow, TableHead, TableCell } from '@atom63/ui-react'\n```\n\n## API surface\n\n**Values:** `Table`, `TableBody`, `TableCaption`, `TableCell`, `TableFooter`, `TableHead`, `TableHeader`, `TableRow`\n\n**Types:** `TableBodyProps`, `TableCaptionProps`, `TableCellProps`, `TableFooterProps`, `TableHeadProps`, `TableHeaderProps`, `TableProps`, `TableRowProps`\n\nTypeScript remains the source of truth for complete prop contracts.\n\n## Contract\n\nSource: `packages/ui-foundation/contracts/components/table.json` (`tableContract` in `@atom63/ui-foundation`).\n\n| Axis | Values | Default |\n| --- | --- | --- |\n| `variants` | `default`, `plain` | `default` |\n| `sizes` | `md`, `sm` | `md` |\n| `stickyEdges` | `start`, `end` | — |\n| `tones` | `neutral`, `accent` | `neutral` |\n\n**Deprecated aliases:** `default` → `md` (sizes)\n\n**Slots:** `table-container`, `table`, `table-header`, `table-body`, `table-footer`, `table-row`, `table-head`, `table-cell`, `table-caption`\n\n**States:** `rest`, `row-hover`, `row-selected`\n\n**Visual archetype:** Static content surfaces — In-flow containers and content surfaces that do not inherently manipulate state.\n\n## Related components\n\n- [Pagination](/components/component-pagination)\n- [Scroll Area](/components/component-scroll-area)\n",
13340
+ "markdown": "# Table\n\nTable provides semantic table regions with shared typography, spacing, and states.\n\n**Status:** Stable\n\n## Preview\n\nThe live documentation page renders the `Playground` story maintained with the component.\n\n## Guidance\n\n- Keep header relationships intact and add horizontal containment for genuinely wide data. For a dense table (admin, payments, issues), pass size=\"sm\": rows are 33px, and a row checkbox or a 24px row menu (size=\"icon-xs\") keeps its hit area without making the row taller.\n- Keep product data and fetching outside the presentational component.\n- Test long, empty, and narrow content before adding local layout overrides.\n\n## Usage\n\n```tsx\nimport { Table, TableHeader, TableBody, TableRow, TableHead, TableCell } from '@atom63/ui-react'\n```\n\n## API surface\n\n**Values:** `Table`, `TableBody`, `TableCaption`, `TableCell`, `TableFooter`, `TableHead`, `TableHeader`, `TableRow`\n\n**Types:** `TableBodyProps`, `TableCaptionProps`, `TableCellProps`, `TableFooterProps`, `TableHeadProps`, `TableHeaderProps`, `TableProps`, `TableRowProps`, `TableSort`, `TableSortDirection`\n\nTypeScript remains the source of truth for complete prop contracts.\n\n## Contract\n\nSource: `packages/ui-foundation/contracts/components/table.json` (`tableContract` in `@atom63/ui-foundation`).\n\n| Axis | Values | Default |\n| --- | --- | --- |\n| `variants` | `default`, `plain` | `default` |\n| `sizes` | `md`, `sm` | `md` |\n| `stickyEdges` | `start`, `end` | — |\n| `tones` | `neutral`, `accent` | `neutral` |\n\n**Deprecated aliases:** `default` → `md` (sizes)\n\n**Slots:** `table-container`, `table`, `table-header`, `table-body`, `table-footer`, `table-row`, `table-head`, `table-cell`, `table-caption`, `table-sort-button`\n\n**States:** `rest`, `row-hover`, `row-selected`, `sort-ascending`, `sort-descending`\n\n**Visual archetype:** Static content surfaces — In-flow containers and content surfaces that do not inherently manipulate state.\n\n## Related components\n\n- [Pagination](/components/component-pagination)\n- [Scroll Area](/components/component-scroll-area)\n",
13199
13341
  "related": [
13200
13342
  "pagination",
13201
13343
  "scroll-area"
@@ -13207,6 +13349,7 @@
13207
13349
  "file": "packages/ui-react/src/components/table/table.stories.tsx",
13208
13350
  "names": [
13209
13351
  "Playground",
13352
+ "SortableColumns",
13210
13353
  "Framed",
13211
13354
  "Sizes",
13212
13355
  "Plain",
@@ -13218,7 +13361,7 @@
13218
13361
  "Endpoints",
13219
13362
  "ContractMetadata"
13220
13363
  ],
13221
- "source": "import { tableContract, tableTones, themes } from '@atom63/ui-foundation'\nimport {\n Button,\n Checkbox,\n Table,\n TableBody,\n TableCaption,\n TableCell,\n TableFooter,\n TableHead,\n TableHeader,\n TableRow,\n UIProvider,\n} from '@atom63/ui-react'\nimport '@atom63/ui-react/styles.css'\nimport type { Meta, StoryObj } from '@storybook/react-vite'\nimport { Ellipsis } from 'lucide-react'\n\nconst meta = {\n title: 'UI React/Table',\n component: Table,\n} satisfies Meta<typeof Table>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst rows = [\n { amount: '$250.00', invoice: 'INV001', method: 'Credit Card', status: 'Paid' },\n { amount: '$150.00', invoice: 'INV002', method: 'PayPal', status: 'Pending' },\n { amount: '$350.00', invoice: 'INV003', method: 'Bank Transfer', status: 'Unpaid' },\n]\n\nexport const Playground: Story = {\n render: () => (\n <div style={{ width: 480 }}>\n <Table>\n <TableCaption>A list of recent invoices.</TableCaption>\n <TableHeader>\n <TableRow>\n <TableHead>Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Method</TableHead>\n <TableHead>Amount</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice} data-state={r.invoice === 'INV002' ? 'selected' : undefined}>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.method}</TableCell>\n <TableCell>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n <TableFooter>\n <TableRow>\n <TableCell>Total</TableCell>\n <TableCell />\n <TableCell />\n <TableCell>$750.00</TableCell>\n </TableRow>\n </TableFooter>\n </Table>\n </div>\n ),\n}\n\n/* A compact three-row table reused by the theme matrix. */\nfunction DemoTable() {\n return (\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead>Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Amount</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice} data-state={r.invoice === 'INV002' ? 'selected' : undefined}>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n )\n}\n\n/* Wrapping in a data-slot=\"frame\" ancestor switches on the bordered card. */\nexport const Framed: Story = {\n render: () => (\n <div data-slot=\"frame\" style={{ width: 480 }}>\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead>Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Amount</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice}>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n ),\n}\n\n/* `sm` takes its row padding from the density contract: compare it with the\n default rows, then under compact density. */\nexport const Sizes: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 24, width: 480 }}>\n {tableContract.sizes.map(size => (\n <div key={size}>\n <span style={{ color: 'var(--a63-text-secondary)', fontSize: 12 }}>size={size}</span>\n <Table size={size}>\n <TableHeader>\n <TableRow>\n <TableHead>Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Amount</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice}>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n ))}\n <UIProvider density=\"compact\">\n <span style={{ color: 'var(--a63-text-secondary)', fontSize: 12 }}>\n size=sm, compact density\n </span>\n <Table size=\"sm\">\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice}>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </UIProvider>\n </div>\n ),\n}\n\n/* `plain` drops the dividers between body rows, for lists such as a track list. */\nexport const Plain: Story = {\n render: () => (\n <div style={{ width: 480 }}>\n <Table variant=\"plain\">\n <TableHeader>\n <TableRow>\n <TableHead>Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Amount</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice}>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n ),\n}\n\n/* size=\"sm\" with row checkboxes: the checkbox keeps its hit area but no longer\n sets the row height. */\nexport const SelectableRows: Story = {\n render: () => (\n <div style={{ width: 480 }}>\n <Table size=\"sm\">\n <TableHeader>\n <TableRow>\n <TableHead>\n <Checkbox aria-label=\"Select all invoices\" />\n </TableHead>\n <TableHead>Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Amount</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice}>\n <TableCell>\n <Checkbox aria-label={`Select ${r.invoice}`} />\n </TableCell>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n ),\n}\n\n/* size=\"sm\" with a row menu in each row: the 24px button keeps its size and hit\n area but counts as 1rem in the row, so the rows stay as dense as checkbox rows. */\nexport const DenseRowActions: Story = {\n render: () => (\n <div style={{ width: 480 }}>\n <Table size=\"sm\">\n <TableHeader>\n <TableRow>\n <TableHead>\n <Checkbox aria-label=\"Select all invoices\" />\n </TableHead>\n <TableHead>Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Amount</TableHead>\n <TableHead>\n <span className=\"sr-only\">Actions</span>\n </TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice}>\n <TableCell>\n <Checkbox aria-label={`Select ${r.invoice}`} />\n </TableCell>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.amount}</TableCell>\n <TableCell style={{ textAlign: 'end' }}>\n <Button aria-label={`More actions for ${r.invoice}`} size=\"icon-xs\" variant=\"ghost\">\n <Ellipsis />\n </Button>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n ),\n play: ({ canvasElement }) => {\n const row = canvasElement.querySelector<HTMLElement>('[data-slot=\"table-body\"] tr')\n const button = row?.querySelector<HTMLElement>('button[aria-label^=\"More actions\"]')\n if (!row || !button) throw new Error('Expected a body row with a row menu')\n const rowHeight = row.getBoundingClientRect().height\n const buttonHeight = button.getBoundingClientRect().height\n if (rowHeight < 32 || rowHeight > 36) {\n throw new Error(`Expected a 32-36px dense row, got ${rowHeight}px`)\n }\n if (buttonHeight < 24) throw new Error(`Expected a 24px row button, got ${buttonHeight}px`)\n },\n}\n\n/* tone colours selected rows (data-state=\"selected\"): neutral (the default) is a\n muted fill with primary text, accent is the opt-in primary wash. */\nexport const Tones: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 24, width: 480 }}>\n {tableTones.map(tone => (\n <Table key={tone} size=\"sm\" tone={tone}>\n <TableCaption>tone=&quot;{tone}&quot;</TableCaption>\n <TableHeader>\n <TableRow>\n <TableHead>Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Amount</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.slice(0, 3).map((r, index) => (\n <TableRow data-state={index === 1 ? 'selected' : undefined} key={r.invoice}>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n ))}\n </div>\n ),\n}\n\nconst wideColumns = ['Customer', 'Method', 'Created', 'Refunded', 'Dispute', 'Reason']\n\n/* A table wider than its container: the invoice stays pinned at the start and\n the row menu at the end while the middle scrolls. */\nexport const StickyColumns: Story = {\n render: () => (\n <div style={{ width: 420 }}>\n <Table size=\"sm\">\n <TableHeader>\n <TableRow>\n <TableHead sticky=\"start\">Invoice</TableHead>\n {wideColumns.map(column => (\n <TableHead key={column}>{column}</TableHead>\n ))}\n <TableHead sticky=\"end\">Actions</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice} data-state={r.invoice === 'INV002' ? 'selected' : undefined}>\n <TableCell sticky=\"start\">{r.invoice}</TableCell>\n {wideColumns.map(column => (\n <TableCell key={column}>{column === 'Method' ? r.method : '—'}</TableCell>\n ))}\n <TableCell sticky=\"end\">\n <Button aria-label={`Actions for ${r.invoice}`} size=\"icon-xs\" variant=\"ghost\">\n …\n </Button>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n ),\n}\n\nexport const Themes: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {themes.map(theme =>\n (['light', 'dark'] as const).map(mode => (\n <UIProvider key={`${theme}-${mode}`} mode={mode} theme={theme}>\n <div\n style={{\n alignItems: 'flex-start',\n background: 'var(--a63-surface-panel)',\n borderRadius: 'var(--radius-lg)',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: '0.75rem',\n }}\n >\n <span\n style={{\n flexShrink: 0,\n fontSize: 12,\n color: 'var(--a63-text-secondary)',\n width: 96,\n }}\n >\n {theme} / {mode}\n </span>\n <div data-slot=\"frame\" style={{ width: 360 }}>\n <DemoTable />\n </div>\n </div>\n </UIProvider>\n ))\n )}\n </div>\n ),\n}\n\nexport const Endpoints: Story = {\n render: () => (\n <div\n style={{\n display: 'grid',\n gap: '1rem',\n gridTemplateColumns: 'repeat(auto-fit, minmax(20rem, 1fr))',\n }}\n >\n <UIProvider designLanguage=\"web\" input=\"pointer\">\n <div style={{ background: 'var(--a63-surface-panel)', padding: '1rem' }}>\n <span style={{ color: 'var(--a63-text-secondary)', fontSize: 12 }}>web / pointer</span>\n <DemoTable />\n </div>\n </UIProvider>\n <UIProvider designLanguage=\"ios\" input=\"touch\">\n <div style={{ background: 'var(--a63-surface-panel)', padding: '1rem' }}>\n <span style={{ color: 'var(--a63-text-secondary)', fontSize: 12 }}>ios / touch</span>\n <DemoTable />\n </div>\n </UIProvider>\n <UIProvider density=\"compact\" designLanguage=\"web\" input=\"pointer\">\n <div style={{ background: 'var(--a63-surface-panel)', padding: '1rem' }}>\n <span style={{ color: 'var(--a63-text-secondary)', fontSize: 12 }}>\n extension / compact\n </span>\n <DemoTable />\n </div>\n </UIProvider>\n </div>\n ),\n}\n\nexport const ContractMetadata: Story = {\n render: () => (\n <pre style={{ fontSize: 12, margin: 0, whiteSpace: 'pre-wrap' }}>\n {JSON.stringify(tableContract, null, 2)}\n </pre>\n ),\n}\n"
13364
+ "source": "import { tableContract, tableTones, themes } from '@atom63/ui-foundation'\nimport {\n Button,\n Checkbox,\n Table,\n TableBody,\n TableCaption,\n TableCell,\n TableFooter,\n TableHead,\n TableHeader,\n TableRow,\n type TableSort,\n UIProvider,\n} from '@atom63/ui-react'\nimport '@atom63/ui-react/styles.css'\nimport type { Meta, StoryObj } from '@storybook/react-vite'\nimport { Ellipsis } from 'lucide-react'\nimport { useState } from 'react'\n\nconst meta = {\n title: 'UI React/Table',\n component: Table,\n} satisfies Meta<typeof Table>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst rows = [\n { amount: '$250.00', invoice: 'INV001', method: 'Credit Card', status: 'Paid' },\n { amount: '$150.00', invoice: 'INV002', method: 'PayPal', status: 'Pending' },\n { amount: '$350.00', invoice: 'INV003', method: 'Bank Transfer', status: 'Unpaid' },\n]\n\nexport const Playground: Story = {\n render: () => (\n <div style={{ width: 480 }}>\n <Table>\n <TableCaption>A list of recent invoices.</TableCaption>\n <TableHeader>\n <TableRow>\n <TableHead>Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Method</TableHead>\n <TableHead>Amount</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice} data-state={r.invoice === 'INV002' ? 'selected' : undefined}>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.method}</TableCell>\n <TableCell>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n <TableFooter>\n <TableRow>\n <TableCell>Total</TableCell>\n <TableCell />\n <TableCell />\n <TableCell>$750.00</TableCell>\n </TableRow>\n </TableFooter>\n </Table>\n </div>\n ),\n}\n\nconst amountOf = (row: (typeof rows)[number]) => Number(row.amount.replace(/[^0-9.]/g, ''))\n\nfunction SortableTable() {\n const [sort, setSort] = useState<TableSort | null>({ column: 'amount', direction: 'descending' })\n const sign = sort?.direction === 'ascending' ? 1 : -1\n const sorted = [...rows].sort((a, b) =>\n sort?.column === 'invoice'\n ? a.invoice.localeCompare(b.invoice) * sign\n : sort?.column === 'amount'\n ? (amountOf(a) - amountOf(b)) * sign\n : 0\n )\n return (\n <div style={{ width: 480 }}>\n <Table aria-label=\"Invoices\" onSortChange={setSort} sort={sort}>\n <TableHeader>\n <TableRow>\n <TableHead sortKey=\"invoice\">Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead\n firstSortDirection=\"descending\"\n sortKey=\"amount\"\n style={{ textAlign: 'end' }}\n >\n Amount\n </TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {sorted.map(r => (\n <TableRow key={r.invoice}>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell style={{ textAlign: 'end' }}>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n )\n}\n\n/** Sortable heads: the caller owns `sort` and sorts the rows; the head shows the direction\n * with an icon and `aria-sort`, and pressing it asks for the next sort. */\nexport const SortableColumns: Story = {\n render: () => <SortableTable />,\n play: async ({ canvasElement }) => {\n const heads = canvasElement.querySelectorAll('th')\n if (heads[2]?.getAttribute('aria-sort') !== 'descending') {\n throw new Error('Expected the Amount column sorted descending')\n }\n const invoice = heads[0]?.querySelector('button')\n if (!invoice) throw new Error('Expected a sort button in the Invoice head')\n invoice.click()\n await new Promise(resolve => setTimeout(resolve, 0))\n if (\n heads[0]?.getAttribute('aria-sort') !== 'ascending' ||\n heads[2]?.hasAttribute('aria-sort')\n ) {\n throw new Error('Expected pressing Invoice to sort by it, ascending')\n }\n invoice.click()\n await new Promise(resolve => setTimeout(resolve, 0))\n const first = canvasElement.querySelector('tbody td')?.textContent\n if (first !== 'INV003') throw new Error(`Expected INV003 first when descending, got ${first}`)\n canvasElement.querySelector<HTMLButtonElement>('th:nth-child(3) button')?.click()\n },\n}\n\n/* A compact three-row table reused by the theme matrix. */\nfunction DemoTable() {\n return (\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead>Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Amount</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice} data-state={r.invoice === 'INV002' ? 'selected' : undefined}>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n )\n}\n\n/* Wrapping in a data-slot=\"frame\" ancestor switches on the bordered card. */\nexport const Framed: Story = {\n render: () => (\n <div data-slot=\"frame\" style={{ width: 480 }}>\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead>Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Amount</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice}>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n ),\n}\n\n/* `sm` takes its row padding from the density contract: compare it with the\n default rows, then under compact density. */\nexport const Sizes: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 24, width: 480 }}>\n {tableContract.sizes.map(size => (\n <div key={size}>\n <span style={{ color: 'var(--a63-text-secondary)', fontSize: 12 }}>size={size}</span>\n <Table size={size}>\n <TableHeader>\n <TableRow>\n <TableHead>Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Amount</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice}>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n ))}\n <UIProvider density=\"compact\">\n <span style={{ color: 'var(--a63-text-secondary)', fontSize: 12 }}>\n size=sm, compact density\n </span>\n <Table size=\"sm\">\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice}>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </UIProvider>\n </div>\n ),\n}\n\n/* `plain` drops the dividers between body rows, for lists such as a track list. */\nexport const Plain: Story = {\n render: () => (\n <div style={{ width: 480 }}>\n <Table variant=\"plain\">\n <TableHeader>\n <TableRow>\n <TableHead>Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Amount</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice}>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n ),\n}\n\n/* size=\"sm\" with row checkboxes: the checkbox keeps its hit area but no longer\n sets the row height. */\nexport const SelectableRows: Story = {\n render: () => (\n <div style={{ width: 480 }}>\n <Table size=\"sm\">\n <TableHeader>\n <TableRow>\n <TableHead>\n <Checkbox aria-label=\"Select all invoices\" />\n </TableHead>\n <TableHead>Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Amount</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice}>\n <TableCell>\n <Checkbox aria-label={`Select ${r.invoice}`} />\n </TableCell>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n ),\n}\n\n/* size=\"sm\" with a row menu in each row: the 24px button keeps its size and hit\n area but counts as 1rem in the row, so the rows stay as dense as checkbox rows. */\nexport const DenseRowActions: Story = {\n render: () => (\n <div style={{ width: 480 }}>\n <Table size=\"sm\">\n <TableHeader>\n <TableRow>\n <TableHead>\n <Checkbox aria-label=\"Select all invoices\" />\n </TableHead>\n <TableHead>Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Amount</TableHead>\n <TableHead>\n <span className=\"sr-only\">Actions</span>\n </TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice}>\n <TableCell>\n <Checkbox aria-label={`Select ${r.invoice}`} />\n </TableCell>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.amount}</TableCell>\n <TableCell style={{ textAlign: 'end' }}>\n <Button aria-label={`More actions for ${r.invoice}`} size=\"icon-xs\" variant=\"ghost\">\n <Ellipsis />\n </Button>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n ),\n play: ({ canvasElement }) => {\n const row = canvasElement.querySelector<HTMLElement>('[data-slot=\"table-body\"] tr')\n const button = row?.querySelector<HTMLElement>('button[aria-label^=\"More actions\"]')\n if (!row || !button) throw new Error('Expected a body row with a row menu')\n const rowHeight = row.getBoundingClientRect().height\n const buttonHeight = button.getBoundingClientRect().height\n if (rowHeight < 32 || rowHeight > 36) {\n throw new Error(`Expected a 32-36px dense row, got ${rowHeight}px`)\n }\n if (buttonHeight < 24) throw new Error(`Expected a 24px row button, got ${buttonHeight}px`)\n },\n}\n\n/* tone colours selected rows (data-state=\"selected\"): neutral (the default) is a\n muted fill with primary text, accent is the opt-in primary wash. */\nexport const Tones: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 24, width: 480 }}>\n {tableTones.map(tone => (\n <Table key={tone} size=\"sm\" tone={tone}>\n <TableCaption>tone=&quot;{tone}&quot;</TableCaption>\n <TableHeader>\n <TableRow>\n <TableHead>Invoice</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Amount</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.slice(0, 3).map((r, index) => (\n <TableRow data-state={index === 1 ? 'selected' : undefined} key={r.invoice}>\n <TableCell>{r.invoice}</TableCell>\n <TableCell>{r.status}</TableCell>\n <TableCell>{r.amount}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n ))}\n </div>\n ),\n}\n\nconst wideColumns = ['Customer', 'Method', 'Created', 'Refunded', 'Dispute', 'Reason']\n\n/* A table wider than its container: the invoice stays pinned at the start and\n the row menu at the end while the middle scrolls. */\nexport const StickyColumns: Story = {\n render: () => (\n <div style={{ width: 420 }}>\n <Table size=\"sm\">\n <TableHeader>\n <TableRow>\n <TableHead sticky=\"start\">Invoice</TableHead>\n {wideColumns.map(column => (\n <TableHead key={column}>{column}</TableHead>\n ))}\n <TableHead sticky=\"end\">Actions</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(r => (\n <TableRow key={r.invoice} data-state={r.invoice === 'INV002' ? 'selected' : undefined}>\n <TableCell sticky=\"start\">{r.invoice}</TableCell>\n {wideColumns.map(column => (\n <TableCell key={column}>{column === 'Method' ? r.method : '—'}</TableCell>\n ))}\n <TableCell sticky=\"end\">\n <Button aria-label={`Actions for ${r.invoice}`} size=\"icon-xs\" variant=\"ghost\">\n …\n </Button>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n ),\n}\n\nexport const Themes: Story = {\n render: () => (\n <div style={{ display: 'grid', gap: 12 }}>\n {themes.map(theme =>\n (['light', 'dark'] as const).map(mode => (\n <UIProvider key={`${theme}-${mode}`} mode={mode} theme={theme}>\n <div\n style={{\n alignItems: 'flex-start',\n background: 'var(--a63-surface-panel)',\n borderRadius: 'var(--radius-lg)',\n color: 'var(--a63-text-primary)',\n display: 'flex',\n gap: 12,\n padding: '0.75rem',\n }}\n >\n <span\n style={{\n flexShrink: 0,\n fontSize: 12,\n color: 'var(--a63-text-secondary)',\n width: 96,\n }}\n >\n {theme} / {mode}\n </span>\n <div data-slot=\"frame\" style={{ width: 360 }}>\n <DemoTable />\n </div>\n </div>\n </UIProvider>\n ))\n )}\n </div>\n ),\n}\n\nexport const Endpoints: Story = {\n render: () => (\n <div\n style={{\n display: 'grid',\n gap: '1rem',\n gridTemplateColumns: 'repeat(auto-fit, minmax(20rem, 1fr))',\n }}\n >\n <UIProvider designLanguage=\"web\" input=\"pointer\">\n <div style={{ background: 'var(--a63-surface-panel)', padding: '1rem' }}>\n <span style={{ color: 'var(--a63-text-secondary)', fontSize: 12 }}>web / pointer</span>\n <DemoTable />\n </div>\n </UIProvider>\n <UIProvider designLanguage=\"ios\" input=\"touch\">\n <div style={{ background: 'var(--a63-surface-panel)', padding: '1rem' }}>\n <span style={{ color: 'var(--a63-text-secondary)', fontSize: 12 }}>ios / touch</span>\n <DemoTable />\n </div>\n </UIProvider>\n <UIProvider density=\"compact\" designLanguage=\"web\" input=\"pointer\">\n <div style={{ background: 'var(--a63-surface-panel)', padding: '1rem' }}>\n <span style={{ color: 'var(--a63-text-secondary)', fontSize: 12 }}>\n extension / compact\n </span>\n <DemoTable />\n </div>\n </UIProvider>\n </div>\n ),\n}\n\nexport const ContractMetadata: Story = {\n render: () => (\n <pre style={{ fontSize: 12, margin: 0, whiteSpace: 'pre-wrap' }}>\n {JSON.stringify(tableContract, null, 2)}\n </pre>\n ),\n}\n"
13222
13365
  },
13223
13366
  "summary": "Table provides semantic table regions with shared typography, spacing, and states.",
13224
13367
  "usage": "Keep header relationships intact and add horizontal containment for genuinely wide data. For a dense table (admin, payments, issues), pass size=\"sm\": rows are 33px, and a row checkbox or a 24px row menu (size=\"icon-xs\") keeps its hit area without making the row taller.",
@@ -14372,7 +14515,7 @@
14372
14515
  {
14373
14516
  "area": "foundations",
14374
14517
  "label": "Colors",
14375
- "markdown": "# Colors\n\nThe color system is built around executable indirection. **Foundation** owns the literal palette (`tokens/foundation/*`). **Semantics** (`--a63-*`) name UI jobs. **App JSX** may sketch with Tailwind/shadcn role utilities (`bg-background`, `text-muted-foreground`) because those adapters re-reference `--a63-*`. **Shared package recipes** consume `--a63-*` (and family contracts), not primitives and not raw shadcn CSS variables.\n\nAuthoring lanes: `docs/design-system/authoring-surfaces.md`.\n\nThe goal is simple: components describe the job a color performs, while `@atom63/styles` owns how that job resolves across mode, brand, neutral-surface, surface-tint, and theme axes.\n\n## Design intent\n\nThe Atom63-specific palette has six brand hues, six neutral families, and four status families. Foundation also carries the Tailwind named palette for fixed-hue cases. Both sit behind enough structure that changing an appearance axis does not require auditing every component:\n\n- **Foundation primitives** define stable palette material (the only place for new color dictionaries).\n- **Aliases** (brand / surface axes) select which primitive families a mood uses.\n- **Semantic roles** expose stable UI decisions through `--a63-*` variables.\n- **Themes** remap material/role resolution; they do not invent new palette ramps.\n- **Component recipes** consume those roles in React and CSS.\n\n## Layer stack\n\nImported in order from `@atom63/styles`:\n\n## Mental model\n\nColor moves from stable to contextual:\n\n```txt\nfoundation palette -> brand/surface alias -> a63 semantic role -> component recipe\n (values) (which family) (UI job) (wiring)\n```\n\nProduct theme skins (`modern` / `aqua` / …) sit beside this chain: they remap contract/semantic knobs, they are not a second palette dictionary.\n\nEach layer answers a different question:\n\n| Layer | Question | Example |\n|-------|----------|---------|\n| Foundation | What raw color exists? | `--color-b1-500`, `--color-n1-light-3` |\n| Alias | Which palette family does this mood use? | brand and surface aliases |\n| Semantic | What UI job does this color perform? | `--a63-surface-panel`, `--a63-action-primary`, `--a63-border-control` |\n| Component | How does the role appear in context? | button fill, input border, dialog surface |\n\nThis is the reason component code should feel boring. A component should say \"I need the primary action color\" or \"I need the subtle border color\", not \"I need this exact blue.\"\n\n## How the scale works\n\n### Semantic roles\n\nComponents use the `--a63-*` semantic layer. These variables are the design-system API for product UI.\n\n### Surface scale\n\n12-step neutral ramps (`surface-light-*` / `surface-dark-*`) form the backbone of the UI. Semantic tokens like `--a63-surface-page`, `--a63-surface-panel`, and `--a63-border-subtle` reference the appropriate steps. The default surface family is `n1`, a true neutral gray with no color cast.\n\n### Brand primitives\n\nSix brand hues (`b1`–`b6`), each with steps `50`–`950`, provide enough range for product accents, visualization, and expressive surfaces. The default primary action resolves through the brand alias layer rather than hardcoding a primitive in a component.\n\n### Neutral families\n\nSix neutral palettes (`n1`–`n6`) give the system different neutral personalities without creating one-off product palettes. The `data-a63-surface` axis remaps the aliases; components keep consuming the same semantic roles. Themes may separately re-skin semantic surfaces when material character requires it.\n\n### Status primitives\n\n`danger`, `success`, `warning`, and `info` carry fixed meaning. They can be tuned for contrast across modes, but they should not be repurposed as decorative brand colors.\n\n {STATUS_PRIMITIVES.map(({ id, utility }) => (\n ))}\n\n### Gradients\n\nFour gradient tokens follow the theme, brand and mode, so a hero or banner never needs a hand-written gradient:\n\n| Token | Draws | Use |\n|-------|-------|-----|\n| `--a63-gradient-brand` | Brand 500 to 700 at 135° | A saturated brand banner or card |\n| `--a63-gradient-brand-subtle` | Brand 50 to 100 at 135° | A quiet illustration or card background |\n| `--a63-gradient-brand-fade` | Brand 800 at the top, brand 700 at the end of the dark zone, then `--a63-surface-page` at the bottom | A hero that runs into the page, such as a banking home or a shop header |\n| `--a63-gradient-scrim` | Transparent to 60% black, top to bottom | Text laid over the foot of a photo |\n\n`--a63-gradient-brand-fade` has a **dark zone**: the top `--a63-gradient-brand-fade-dark-zone` (50%) of the hero, which stays at brand 700 or darker. White on-media text and overlay controls reach WCAG AA there on every brand, so the balance, its label and the row of round `overlay` buttons with their labels go in that zone. Below it the hero fades into the page: content there uses the page tokens (`--a63-text-primary`, `--a63-surface-panel`) and the default button variants, on its own `--a63-surface-panel` card while the fade is still running, since text straight on the mid-fade has neither the page's contrast nor the dark zone's. An `overlay` button or `--a63-on-media-foreground` label on the faded part becomes white on near white and disappears. Size the hero with a definite height so the zone lines up with its content, for example a grid with `grid-template-rows: var(--a63-gradient-brand-fade-dark-zone) 1fr`. The Button story `RoundOnBrandFade` shows the pattern. On iOS, `AtomThemeColors.brandFadeGradient(for:)` draws the same gradient and `AtomTokens.Gradient.brandFadeDarkZone` holds the zone.\n\nOverlay and on-media controls belong over dark or busy media (photos, video, `--a63-gradient-brand`, the dark zone of the fade), never over a light or faded background.\n\nThe gradient tokens hold whole `linear-gradient()` values, so they go in `background-image`\n(`bg-(image:--a63-gradient-brand)` in Tailwind), never in `background-color`. Text over a photo with\nthe scrim takes `--a63-on-media-foreground`. For a large amount on a hero, pair a gradient with the\ndisplay text roles on the Typography page.\n\n## Compatibility\n\nThe shadcn vocabulary (`background`, `primary`, `muted-foreground`, …) is an **opt-in adapter** (`@atom63/styles/compat/shadcn` + Tailwind theme keys). It re-references `--a63-*`; it does not own values (mirror rule).\n\nBoth the Tailwind theme keys and the compat variables are generated from one role table, `packages/styles/src/tailwind/roles.json` (`pnpm --filter @atom63/styles generate:roles`). Beyond the shadcn defaults it adds `destructive-foreground`, `info`/`success`/`warning` with `-foreground`, `surface-sunken`, `selected` with `-foreground` (the neutral selection) and `selected-accent` with `-foreground` (the opt-in accent selection), and `chart-1`–`chart-5`. Tinted chips use the `-subtle` pairs: `destructive-subtle`, `info-subtle`, `success-subtle` and `warning-subtle`, each with `-subtle-foreground`, and `category-<hue>` with `-subtle` and `-subtle-foreground` for the 22 palette hues (amber shares the warning ramp). Every tint is the same 14% wash. Media chrome uses `media-stage`, `media-surface` (an opaque dark neutral that does not follow the mode), `media-scrim` and the `on-media-*` roles, so controls over images need no arbitrary `bg-(--…)` classes. `accent` is the neutral hover and highlight plate, not the brand color; use `primary` for the brand.\n\n| Surface | Prefer | Avoid |\n|---------|--------|-------|\n| App / page JSX | Tailwind utilities: `bg-background`, `text-foreground`, `bg-primary`, … | Hardcoded hex; reaching into `--a63-control-*` for sketching |\n| Shared package recipes (`ui-react`, widgets, …) | `--a63-*` roles (+ family contracts) | Baking `var(--background)` / `var(--primary)` into package CSS |\n| Third-party / copy-pasted shadcn CSS | Compat aliases OK at the consumer boundary | Treating `--primary` as the system SSOT |\n\nCanonical design-system contract for shared UI is `--a63-*`. Tailwind/shadcn names are the **human design dialect** for product screens — not “legacy only.” See Designing in code and `docs/design-system/authoring-surfaces.md`.\n\n## Decisions worth knowing\n\n### Semantic-first, not palette-first\n\nShared components never use primitive color values directly. Not `--color-b1-500`, not `--color-n1-light-3`, and not one-off hex values. Shared UI consumes semantic roles such as `--a63-action-primary`, `--a63-text-primary`, `--a63-border-subtle`, and `--a63-surface-panel`. App JSX may use the equivalent Tailwind role utilities.\n\nThe exception is deliberate brand or visualization work that needs a fixed hue regardless of theme. Those cases should be explicit and rare. **Adding** a new hue step still happens in foundation.\n\n### Six neutrals, not one\n\nMost systems ship one neutral ramp. Atom63 has six because portfolio, docs, OS, and learning surfaces can need different neutral personalities. Having six families pre-built makes theme creation alias reassignment rather than palette generation.\n\n### Contrast as a contract\n\nEvery semantic foreground/background pair is designed together. `--a63-action-primary` and `--a63-action-primary-foreground` are a pair. Text roles and surface roles are reviewed together. If a component introduces a new semantic pair, the pair needs contrast review before it becomes part of the shared system.\n\n### Color should express role before personality\n\nThe palette can be expressive, but role comes first. A primary button is primary because it is the main action, not because blue looks good in that location. A muted panel is muted because it is secondary to the current task, not because the screen needs another shade.\n\n## Usage guidance\n\n| Need | In app JSX | In package recipes |\n|------|------------|--------------------|\n| App surfaces | `bg-background`, `bg-card`, `bg-muted` | `--a63-surface-page`, `--a63-surface-panel`, `--a63-surface-muted` |\n| Text | `text-foreground`, `text-muted-foreground`, `text-(--a63-text-tertiary)` | `--a63-text-primary`, `--a63-text-secondary`, `--a63-text-tertiary` |\n| Borders | `border-border` | `--a63-border-subtle`, `--a63-border-control` |\n| Primary actions | `bg-primary`, `text-primary-foreground` | `--a63-action-primary`, `--a63-action-primary-foreground` |\n| Feedback states | `text-destructive`, status utilities | `--a63-status-*`, `--a63-action-danger` |\n| Brand moments (fixed hue) | `bg-b1-500`, … | foundation `--color-b*` only when intentional |\n| Hero fading into the page | `bg-(image:--a63-gradient-brand-fade)` | `--a63-gradient-brand-fade`, controls in its dark zone |\n\nThere are three text greys. `--a63-text-primary` is for content, `--a63-text-secondary` for supporting text that is still content (descriptions, labels), and `--a63-text-tertiary` for placeholders, meta and timestamps. Tertiary keeps WCAG AA 4.5:1 on the page, the panel, the field fill and the muted fill in every theme and mode; every field placeholder uses it.\n\nFor a warm paper or document product (docs, notes, an editor), pick the warm `n6` neutral (`data-a63-surface=\"n6\"`) and put the content on a white page (`--a63-surface-panel` as the page ground) instead of the default grey `--a63-surface-page`.\n\n## Anti-patterns\n\n```tsx\n// Avoid: component owns a palette decision.\n<Button style={{ backgroundColor: 'var(--color-b1-500)' }} />\n```\n\nThe button now depends on one theme's brand hue and one foreground assumption.\n\n```tsx\n// Prefer: component owns a semantic role.\n<Button style={{ backgroundColor: 'var(--a63-action-primary)', color: 'var(--a63-action-primary-foreground)' }} />\n```\n\nThe component can survive theme changes because the semantic pair owns contrast.\n\n## Review checklist\n\nWhen reviewing color usage, ask:\n\n1. Is this a semantic role (Tailwind/shadcn utility or `--a63-*`), or a foundation palette value?\n2. If adding a new literal color, does it live in `tokens/foundation/*`?\n3. Does the foreground/background pair have a contrast contract?\n4. Would this still work if the brand hue changed?\n5. Is a status color being used for real status meaning?\n6. Is color the only cue for the state?",
14518
+ "markdown": "# Colors\n\nThe color system is built around executable indirection. **Foundation** owns the literal palette (`tokens/foundation/*`). **Semantics** (`--a63-*`) name UI jobs. **App JSX** may sketch with Tailwind/shadcn role utilities (`bg-background`, `text-muted-foreground`) because those adapters re-reference `--a63-*`. **Shared package recipes** consume `--a63-*` (and family contracts), not primitives and not raw shadcn CSS variables.\n\nAuthoring lanes: `docs/design-system/authoring-surfaces.md`.\n\nThe goal is simple: components describe the job a color performs, while `@atom63/styles` owns how that job resolves across mode, brand, neutral-surface, surface-tint, and theme axes.\n\n## Design intent\n\nThe Atom63-specific palette has six brand hues, six neutral families, and four status families. Foundation also carries the Tailwind named palette for fixed-hue cases. Both sit behind enough structure that changing an appearance axis does not require auditing every component:\n\n- **Foundation primitives** define stable palette material (the only place for new color dictionaries).\n- **Aliases** (brand / surface axes) select which primitive families a mood uses.\n- **Semantic roles** expose stable UI decisions through `--a63-*` variables.\n- **Themes** remap material/role resolution; they do not invent new palette ramps.\n- **Component recipes** consume those roles in React and CSS.\n\n## Layer stack\n\nImported in order from `@atom63/styles`:\n\n## Mental model\n\nColor moves from stable to contextual:\n\n```txt\nfoundation palette -> brand/surface alias -> a63 semantic role -> component recipe\n (values) (which family) (UI job) (wiring)\n```\n\nProduct theme skins (`modern` / `aqua` / …) sit beside this chain: they remap contract/semantic knobs, they are not a second palette dictionary.\n\nEach layer answers a different question:\n\n| Layer | Question | Example |\n|-------|----------|---------|\n| Foundation | What raw color exists? | `--color-b1-500`, `--color-n1-light-3` |\n| Alias | Which palette family does this mood use? | brand and surface aliases |\n| Semantic | What UI job does this color perform? | `--a63-surface-panel`, `--a63-action-primary`, `--a63-border-control` |\n| Component | How does the role appear in context? | button fill, input border, dialog surface |\n\nThis is the reason component code should feel boring. A component should say \"I need the primary action color\" or \"I need the subtle border color\", not \"I need this exact blue.\"\n\n## How the scale works\n\n### Semantic roles\n\nComponents use the `--a63-*` semantic layer. These variables are the design-system API for product UI.\n\n### Surface scale\n\n12-step neutral ramps (`surface-light-*` / `surface-dark-*`) form the backbone of the UI. Semantic tokens like `--a63-surface-page`, `--a63-surface-panel`, and `--a63-border-subtle` reference the appropriate steps. The default surface family is `n1`, a true neutral gray with no color cast.\n\n### Brand primitives\n\nSix brand hues (`b1`–`b6`), each with steps `50`–`950`, provide enough range for product accents, visualization, and expressive surfaces. The default primary action resolves through the brand alias layer rather than hardcoding a primitive in a component.\n\n### Neutral families\n\nSix neutral palettes (`n1`–`n6`) give the system different neutral personalities without creating one-off product palettes. The `data-a63-surface` axis remaps the aliases; components keep consuming the same semantic roles. Themes may separately re-skin semantic surfaces when material character requires it.\n\n### Status primitives\n\n`danger`, `success`, `warning`, and `info` carry fixed meaning. They can be tuned for contrast across modes, but they should not be repurposed as decorative brand colors.\n\n {STATUS_PRIMITIVES.map(({ id, utility }) => (\n ))}\n\n### Chart series\n\n`--a63-chart-1` to `--a63-chart-5` colour the series of a chart (the `Chart` component reads them in order). Series 1 is the brand: the primary on light surfaces, the brand's 400 step on dark ones. Series 2 to 5 turn the brand's hue by fixed steps at a set lightness and chroma, so none of them lands on the brand whatever it is, a violet brand or a wallpaper (`auto`) brand included. Each series reaches 3:1 against the page and the panel in every theme and mode; `chart-palette.browser.test.ts` checks that, and that every pair of series and every series and the brand stay apart, across brands × themes × modes.\n\n### Gradients\n\nFour gradient tokens follow the theme, brand and mode, so a hero or banner never needs a hand-written gradient:\n\n| Token | Draws | Use |\n|-------|-------|-----|\n| `--a63-gradient-brand` | Brand 500 to 700 at 135° | A saturated brand banner or card |\n| `--a63-gradient-brand-subtle` | Brand 50 to 100 at 135° | A quiet illustration or card background |\n| `--a63-gradient-brand-fade` | Brand 800 at the top, brand 700 at the end of the dark zone, then `--a63-surface-page` at the bottom | A hero that runs into the page, such as a banking home or a shop header |\n| `--a63-gradient-scrim` | Transparent to 60% black, top to bottom | Text laid over the foot of a photo |\n\n`--a63-gradient-brand-fade` has a **dark zone**: the top `--a63-gradient-brand-fade-dark-zone` (50%) of the hero, which stays at brand 700 or darker. White on-media text and overlay controls reach WCAG AA there on every brand, so the balance, its label and the row of round `overlay` buttons with their labels go in that zone. Below it the hero fades into the page: content there uses the page tokens (`--a63-text-primary`, `--a63-surface-panel`) and the default button variants, on its own `--a63-surface-panel` card while the fade is still running, since text straight on the mid-fade has neither the page's contrast nor the dark zone's. An `overlay` button or `--a63-on-media-foreground` label on the faded part becomes white on near white and disappears. Size the hero with a definite height so the zone lines up with its content, for example a grid with `grid-template-rows: var(--a63-gradient-brand-fade-dark-zone) 1fr`. The Button story `RoundOnBrandFade` shows the pattern. On iOS, `AtomThemeColors.brandFadeGradient(for:)` draws the same gradient and `AtomTokens.Gradient.brandFadeDarkZone` holds the zone.\n\nOverlay and on-media controls belong over dark or busy media (photos, video, `--a63-gradient-brand`, the dark zone of the fade), never over a light or faded background.\n\nThe gradient tokens hold whole `linear-gradient()` values, so they go in `background-image`\n(`bg-(image:--a63-gradient-brand)` in Tailwind), never in `background-color`. Text over a photo with\nthe scrim takes `--a63-on-media-foreground`. For a large amount on a hero, pair a gradient with the\ndisplay text roles on the Typography page.\n\n## Compatibility\n\nThe shadcn vocabulary (`background`, `primary`, `muted-foreground`, …) is an **opt-in adapter** (`@atom63/styles/compat/shadcn` + Tailwind theme keys). It re-references `--a63-*`; it does not own values (mirror rule).\n\nBoth the Tailwind theme keys and the compat variables are generated from one role table, `packages/styles/src/tailwind/roles.json` (`pnpm --filter @atom63/styles generate:roles`). Beyond the shadcn defaults it adds `destructive-foreground`, `info`/`success`/`warning` with `-foreground`, `surface-sunken`, `selected` with `-foreground` (the neutral selection) and `selected-accent` with `-foreground` (the opt-in accent selection), and `chart-1`–`chart-5`. Tinted chips use the `-subtle` pairs: `destructive-subtle`, `info-subtle`, `success-subtle` and `warning-subtle`, each with `-subtle-foreground`, and `category-<hue>` with `-subtle` and `-subtle-foreground` for the 22 palette hues (amber shares the warning ramp). Every tint is the same 14% wash. Media chrome uses `media-stage`, `media-surface` (an opaque dark neutral that does not follow the mode), `media-scrim` and the `on-media-*` roles, so controls over images need no arbitrary `bg-(--…)` classes. `accent` is the neutral hover and highlight plate, not the brand color; use `primary` for the brand.\n\n| Surface | Prefer | Avoid |\n|---------|--------|-------|\n| App / page JSX | Tailwind utilities: `bg-background`, `text-foreground`, `bg-primary`, … | Hardcoded hex; reaching into `--a63-control-*` for sketching |\n| Shared package recipes (`ui-react`, widgets, …) | `--a63-*` roles (+ family contracts) | Baking `var(--background)` / `var(--primary)` into package CSS |\n| Third-party / copy-pasted shadcn CSS | Compat aliases OK at the consumer boundary | Treating `--primary` as the system SSOT |\n\nCanonical design-system contract for shared UI is `--a63-*`. Tailwind/shadcn names are the **human design dialect** for product screens — not “legacy only.” See Designing in code and `docs/design-system/authoring-surfaces.md`.\n\n## Decisions worth knowing\n\n### Semantic-first, not palette-first\n\nShared components never use primitive color values directly. Not `--color-b1-500`, not `--color-n1-light-3`, and not one-off hex values. Shared UI consumes semantic roles such as `--a63-action-primary`, `--a63-text-primary`, `--a63-border-subtle`, and `--a63-surface-panel`. App JSX may use the equivalent Tailwind role utilities.\n\nThe exception is deliberate brand or visualization work that needs a fixed hue regardless of theme. Those cases should be explicit and rare. **Adding** a new hue step still happens in foundation.\n\n### Six neutrals, not one\n\nMost systems ship one neutral ramp. Atom63 has six because portfolio, docs, OS, and learning surfaces can need different neutral personalities. Having six families pre-built makes theme creation alias reassignment rather than palette generation.\n\n### Contrast as a contract\n\nEvery semantic foreground/background pair is designed together. `--a63-action-primary` and `--a63-action-primary-foreground` are a pair. Text roles and surface roles are reviewed together. If a component introduces a new semantic pair, the pair needs contrast review before it becomes part of the shared system.\n\n### Color should express role before personality\n\nThe palette can be expressive, but role comes first. A primary button is primary because it is the main action, not because blue looks good in that location. A muted panel is muted because it is secondary to the current task, not because the screen needs another shade.\n\n## Usage guidance\n\n| Need | In app JSX | In package recipes |\n|------|------------|--------------------|\n| App surfaces | `bg-background`, `bg-card`, `bg-muted` | `--a63-surface-page`, `--a63-surface-panel`, `--a63-surface-muted` |\n| Text | `text-foreground`, `text-muted-foreground`, `text-(--a63-text-tertiary)` | `--a63-text-primary`, `--a63-text-secondary`, `--a63-text-tertiary` |\n| Borders | `border-border` | `--a63-border-subtle`, `--a63-border-control` |\n| Primary actions | `bg-primary`, `text-primary-foreground` | `--a63-action-primary`, `--a63-action-primary-foreground` |\n| Feedback states | `text-destructive`, status utilities | `--a63-status-*`, `--a63-action-danger` |\n| Brand moments (fixed hue) | `bg-b1-500`, … | foundation `--color-b*` only when intentional |\n| Hero fading into the page | `bg-(image:--a63-gradient-brand-fade)` | `--a63-gradient-brand-fade`, controls in its dark zone |\n\nThere are three text greys. `--a63-text-primary` is for content, `--a63-text-secondary` for supporting text that is still content (descriptions, labels), and `--a63-text-tertiary` for placeholders, meta and timestamps. Tertiary keeps WCAG AA 4.5:1 on the page, the panel, the field fill and the muted fill in every theme and mode; every field placeholder uses it.\n\nFor a warm paper or document product (docs, notes, an editor), pick the warm `n6` neutral (`data-a63-surface=\"n6\"`) and put the content on a white page (`--a63-surface-panel` as the page ground) instead of the default grey `--a63-surface-page`.\n\n## Anti-patterns\n\n```tsx\n// Avoid: component owns a palette decision.\n<Button style={{ backgroundColor: 'var(--color-b1-500)' }} />\n```\n\nThe button now depends on one theme's brand hue and one foreground assumption.\n\n```tsx\n// Prefer: component owns a semantic role.\n<Button style={{ backgroundColor: 'var(--a63-action-primary)', color: 'var(--a63-action-primary-foreground)' }} />\n```\n\nThe component can survive theme changes because the semantic pair owns contrast.\n\n## Review checklist\n\nWhen reviewing color usage, ask:\n\n1. Is this a semantic role (Tailwind/shadcn utility or `--a63-*`), or a foundation palette value?\n2. If adding a new literal color, does it live in `tokens/foundation/*`?\n3. Does the foreground/background pair have a contrast contract?\n4. Would this still work if the brand hue changed?\n5. Is a status color being used for real status meaning?\n6. Is color the only cue for the state?",
14376
14519
  "route": "/foundations/foundation-colors",
14377
14520
  "slug": "foundation-colors"
14378
14521
  },
@@ -14593,7 +14736,7 @@
14593
14736
  "files": [
14594
14737
  {
14595
14738
  "path": "pages/app-view/app-view.tsx",
14596
- "source": "import {\n Avatar,\n AvatarFallback,\n Button,\n Item,\n ItemContent,\n ItemDescription,\n ItemGroup,\n ItemTitle,\n SearchField,\n Slider,\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n Toggle,\n} from '@atom63/ui-react'\nimport { AppView } from '@atom63/ui-react/layout'\nimport {\n Bell,\n House,\n Library,\n ListMusic,\n Pause,\n Play,\n Repeat,\n Search,\n Shuffle,\n SkipBack,\n SkipForward,\n Volume2,\n} from 'lucide-react'\nimport { useState } from 'react'\n\nimport { TabBar } from '../../blocks/tab-bar/tab-bar'\n\nexport const template = {\n id: 'app-view',\n kind: 'page',\n title: 'App view',\n description:\n 'A full-window product view with no site header or footer, built on the AppView frame from @atom63/ui-react/layout: a top bar across the window, a side panel and the main region below it, and an optional bar docked at the bottom, such as a media player or a status bar. chrome=\"flush\" runs the columns to the window edges, split by borders, instead of rounded cards. layout=\"phone\" makes it a phone app screen: edge to edge, the top bar optional, safe-area aware, phone-sized type and controls (body 17px, 44px controls), and the tab-bar block docked at the bottom. overlay floats content over the main region, such as a scroll-to-bottom button. For a dense product view (a table, an inbox, an issue tracker, an admin dashboard, a file list), wrap it in <UIProvider density=\"compact\">. Import AppView; copy only the sample pages to adapt them.',\n category: 'layout',\n tags: [\n 'app',\n 'full window',\n 'workspace',\n 'library',\n 'player',\n 'media',\n 'docked bar',\n 'side panel',\n 'top bar',\n 'layout',\n 'phone',\n 'mobile',\n 'phone app',\n 'edge to edge',\n 'tab bar',\n 'bottom navigation',\n 'safe area',\n ],\n readiness: 'draft',\n} as const\n\nconst library = [\n { current: false, kind: 'Playlist', title: 'Morning rotation' },\n { current: true, kind: 'Album', title: 'Quiet hours' },\n { current: false, kind: 'Playlist', title: 'Late drive' },\n { current: false, kind: 'Artist', title: 'Mara Vale' },\n { current: false, kind: 'Album', title: 'Paper lanterns' },\n]\n\nconst tracks = [\n { length: '3:12', title: 'First light' },\n { length: '2:48', title: 'Low tide' },\n { length: '4:05', title: 'Window seat' },\n { length: '3:31', title: 'Long way home' },\n { length: '2:57', title: 'Afterglow' },\n]\n\n/* A sample app view: a music library with a docked player. */\nexport function AppViewPage() {\n const [query, setQuery] = useState('')\n const [playing, setPlaying] = useState(false)\n const [position, setPosition] = useState(35)\n const [volume, setVolume] = useState(70)\n\n return (\n <AppView\n bottomBar={\n <>\n <div className=\"hidden min-w-0 flex-1 sm:block\">\n <p className=\"truncate text-sm font-medium\">First light</p>\n <p className=\"text-muted-foreground truncate text-xs\">Mara Vale</p>\n </div>\n <div className=\"flex flex-[2] flex-col items-center gap-1\">\n <div className=\"flex items-center gap-1\">\n <Toggle aria-label=\"Shuffle\" size=\"sm\">\n <Shuffle aria-hidden />\n </Toggle>\n <Button aria-label=\"Previous track\" size=\"icon-sm\" variant=\"ghost\">\n <SkipBack aria-hidden />\n </Button>\n <Button\n aria-label={playing ? 'Pause' : 'Play'}\n onClick={() => setPlaying(!playing)}\n size=\"icon\"\n variant=\"primary\"\n >\n {playing ? <Pause aria-hidden /> : <Play aria-hidden />}\n </Button>\n <Button aria-label=\"Next track\" size=\"icon-sm\" variant=\"ghost\">\n <SkipForward aria-hidden />\n </Button>\n <Toggle aria-label=\"Repeat\" size=\"sm\">\n <Repeat aria-hidden />\n </Toggle>\n </div>\n <Slider\n aria-label=\"Position\"\n className=\"w-full max-w-md\"\n max={100}\n min={0}\n onValueChange={value => setPosition(Number(value))}\n value={position}\n />\n </div>\n <div className=\"hidden flex-1 items-center justify-end gap-2 md:flex\">\n <Volume2 aria-hidden className=\"text-muted-foreground size-4\" />\n <Slider\n aria-label=\"Volume\"\n className=\"w-28\"\n max={100}\n min={0}\n onValueChange={value => setVolume(Number(value))}\n value={volume}\n />\n </div>\n </>\n }\n panel={\n <>\n <h2 className=\"flex items-center gap-2 px-2 py-1 text-sm font-semibold\">\n <ListMusic aria-hidden className=\"size-4\" />\n Your library\n </h2>\n <ItemGroup>\n {library.map(entry => (\n <Item\n key={entry.title}\n render={\n <a aria-current={entry.current ? 'page' : undefined} href={`#${entry.title}`}>\n <ItemContent>\n <ItemTitle>{entry.title}</ItemTitle>\n <ItemDescription>{entry.kind}</ItemDescription>\n </ItemContent>\n </a>\n }\n size=\"xs\"\n />\n ))}\n </ItemGroup>\n </>\n }\n tabBar={\n <TabBar\n items={[\n { href: '#home', icon: <House aria-hidden />, label: 'Home' },\n { href: '#search', icon: <Search aria-hidden />, label: 'Search' },\n { current: true, href: '#library', icon: <Library aria-hidden />, label: 'Library' },\n ]}\n />\n }\n topBar={\n <>\n <Button aria-label=\"Home\" size=\"icon\" variant=\"ghost\">\n <House aria-hidden />\n </Button>\n <form\n className=\"max-w-md flex-1\"\n onSubmit={event => event.preventDefault()}\n role=\"search\"\n >\n <SearchField\n aria-label=\"Search the library\"\n onValueChange={setQuery}\n placeholder=\"What do you want to play?\"\n value={query}\n />\n </form>\n <div className=\"ms-auto flex items-center gap-2\">\n <Button aria-label=\"Notifications\" size=\"icon\" variant=\"ghost\">\n <Bell aria-hidden />\n </Button>\n <Avatar>\n <AvatarFallback>JL</AvatarFallback>\n </Avatar>\n </div>\n </>\n }\n >\n <div className=\"flex flex-col gap-6 p-6\">\n <div>\n <p className=\"text-muted-foreground text-sm\">Album · 2024 · 5 songs</p>\n <h1 className=\"font-heading text-3xl font-semibold\">Quiet hours</h1>\n </div>\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead>#</TableHead>\n <TableHead>Title</TableHead>\n <TableHead className=\"text-end\">Length</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {tracks.map((track, index) => (\n <TableRow key={track.title}>\n <TableCell className=\"text-muted-foreground\">{index + 1}</TableCell>\n <TableCell>{track.title}</TableCell>\n <TableCell className=\"text-muted-foreground text-end tabular-nums\">\n {track.length}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n </AppView>\n )\n}\n\n/*\n * The same app as a phone screen: layout=\"phone\" with no top bar, so the album\n * header reaches the top edge and pads itself for the status bar; a mini\n * player and the tab bar dock at the bottom.\n */\nexport function AppViewPhonePage() {\n const [playing, setPlaying] = useState(false)\n\n return (\n <AppView\n bottomBar={\n <>\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium\">First light</p>\n <p className=\"text-muted-foreground truncate text-xs\">Mara Vale</p>\n </div>\n <Button\n aria-label={playing ? 'Pause' : 'Play'}\n onClick={() => setPlaying(!playing)}\n size=\"icon\"\n variant=\"primary\"\n >\n {playing ? <Pause aria-hidden /> : <Play aria-hidden />}\n </Button>\n <Button aria-label=\"Next track\" size=\"icon\" variant=\"ghost\">\n <SkipForward aria-hidden />\n </Button>\n </>\n }\n layout=\"phone\"\n tabBar={\n <TabBar\n items={[\n { href: '#home', icon: <House aria-hidden />, label: 'Home' },\n { href: '#search', icon: <Search aria-hidden />, label: 'Search' },\n { current: true, href: '#library', icon: <Library aria-hidden />, label: 'Library' },\n ]}\n />\n }\n >\n <div className=\"flex flex-col gap-2 pt-[env(safe-area-inset-top)]\">\n <div className=\"px-4 pt-6\">\n <p className=\"text-muted-foreground text-sm\">Album · 2024 · 5 songs</p>\n <h1 className=\"font-heading text-3xl font-semibold\">Quiet hours</h1>\n </div>\n <ItemGroup>\n {tracks.map((track, index) => (\n <Item\n key={track.title}\n render={\n <a href={`#${track.title}`}>\n <ItemContent>\n <ItemTitle>{track.title}</ItemTitle>\n <ItemDescription>\n {index + 1} · {track.length}\n </ItemDescription>\n </ItemContent>\n </a>\n }\n size=\"sm\"\n />\n ))}\n </ItemGroup>\n </div>\n </AppView>\n )\n}\n"
14739
+ "source": "import {\n Avatar,\n AvatarFallback,\n Button,\n Item,\n ItemContent,\n ItemDescription,\n ItemGroup,\n ItemTitle,\n SearchField,\n Slider,\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n Toggle,\n} from '@atom63/ui-react'\nimport { AppView } from '@atom63/ui-react/layout'\nimport {\n Bell,\n House,\n Library,\n ListMusic,\n Pause,\n Play,\n Repeat,\n Search,\n Shuffle,\n SkipBack,\n SkipForward,\n Volume2,\n} from 'lucide-react'\nimport { useState } from 'react'\n\nimport { TabBar } from '../../blocks/tab-bar/tab-bar'\n\nexport const template = {\n id: 'app-view',\n kind: 'page',\n title: 'App view',\n description:\n 'A full-window product view with no site header or footer, built on the AppView frame from @atom63/ui-react/layout: a top bar across the window, a side panel and the main region below it, and an optional bar docked at the bottom, such as a media player or a status bar. chrome=\"flush\" runs the columns to the window edges, split by borders, instead of rounded cards. layout=\"phone\" makes it a phone app screen: edge to edge, the top bar optional, safe-area aware, phone-sized type and controls (body 17px, 44px controls), and the tab-bar block docked at the bottom. overlay floats content over the main region, such as a scroll-to-bottom button. For a dense product view (a table, an inbox, an issue tracker, an admin dashboard, a file list), wrap it in <UIProvider density=\"compact\">. Import AppView; copy only the sample pages to adapt them.',\n category: 'layout',\n tags: [\n 'app',\n 'full window',\n 'workspace',\n 'library',\n 'player',\n 'media',\n 'docked bar',\n 'side panel',\n 'top bar',\n 'layout',\n 'phone',\n 'mobile',\n 'phone app',\n 'edge to edge',\n 'tab bar',\n 'bottom navigation',\n 'safe area',\n ],\n readiness: 'draft',\n} as const\n\nconst library = [\n { current: false, kind: 'Playlist', title: 'Morning rotation' },\n { current: true, kind: 'Album', title: 'Quiet hours' },\n { current: false, kind: 'Playlist', title: 'Late drive' },\n { current: false, kind: 'Artist', title: 'Mara Vale' },\n { current: false, kind: 'Album', title: 'Paper lanterns' },\n]\n\nconst tracks = [\n { length: '3:12', title: 'First light' },\n { length: '2:48', title: 'Low tide' },\n { length: '4:05', title: 'Window seat' },\n { length: '3:31', title: 'Long way home' },\n { length: '2:57', title: 'Afterglow' },\n]\n\n/* A sample app view: a music library with a docked player. */\nexport function AppViewPage() {\n const [query, setQuery] = useState('')\n const [playing, setPlaying] = useState(false)\n const [position, setPosition] = useState(35)\n const [volume, setVolume] = useState(70)\n\n return (\n <AppView\n bottomBar={\n <>\n <div className=\"hidden min-w-0 flex-1 sm:block\">\n <p className=\"truncate text-sm font-medium\">First light</p>\n <p className=\"text-muted-foreground truncate text-xs\">Mara Vale</p>\n </div>\n <div className=\"flex flex-[2] flex-col items-center gap-1\">\n <div className=\"flex items-center gap-1\">\n <Toggle aria-label=\"Shuffle\" size=\"sm\">\n <Shuffle aria-hidden />\n </Toggle>\n <Button aria-label=\"Previous track\" size=\"icon-sm\" tone=\"muted\" variant=\"ghost\">\n <SkipBack aria-hidden />\n </Button>\n <Button\n aria-label={playing ? 'Pause' : 'Play'}\n onClick={() => setPlaying(!playing)}\n size=\"icon\"\n variant=\"primary\"\n >\n {playing ? <Pause aria-hidden /> : <Play aria-hidden />}\n </Button>\n <Button aria-label=\"Next track\" size=\"icon-sm\" tone=\"muted\" variant=\"ghost\">\n <SkipForward aria-hidden />\n </Button>\n <Toggle aria-label=\"Repeat\" size=\"sm\">\n <Repeat aria-hidden />\n </Toggle>\n </div>\n <Slider\n aria-label=\"Position\"\n className=\"w-full max-w-md\"\n max={100}\n min={0}\n onValueChange={value => setPosition(Number(value))}\n value={position}\n />\n </div>\n <div className=\"hidden flex-1 items-center justify-end gap-2 md:flex\">\n <Volume2 aria-hidden className=\"text-muted-foreground size-4\" />\n <Slider\n aria-label=\"Volume\"\n className=\"w-28\"\n max={100}\n min={0}\n onValueChange={value => setVolume(Number(value))}\n value={volume}\n />\n </div>\n </>\n }\n panel={\n <>\n <h2 className=\"flex items-center gap-2 px-2 py-1 text-sm font-semibold\">\n <ListMusic aria-hidden className=\"size-4\" />\n Your library\n </h2>\n <ItemGroup>\n {library.map(entry => (\n <Item\n key={entry.title}\n render={\n <a aria-current={entry.current ? 'page' : undefined} href={`#${entry.title}`}>\n <ItemContent>\n <ItemTitle>{entry.title}</ItemTitle>\n <ItemDescription>{entry.kind}</ItemDescription>\n </ItemContent>\n </a>\n }\n size=\"xs\"\n />\n ))}\n </ItemGroup>\n </>\n }\n tabBar={\n <TabBar\n items={[\n { href: '#home', icon: <House aria-hidden />, label: 'Home' },\n { href: '#search', icon: <Search aria-hidden />, label: 'Search' },\n { current: true, href: '#library', icon: <Library aria-hidden />, label: 'Library' },\n ]}\n />\n }\n topBar={\n <>\n <Button aria-label=\"Home\" size=\"icon\" tone=\"muted\" variant=\"ghost\">\n <House aria-hidden />\n </Button>\n <form\n className=\"max-w-md flex-1\"\n onSubmit={event => event.preventDefault()}\n role=\"search\"\n >\n <SearchField\n aria-label=\"Search the library\"\n onValueChange={setQuery}\n placeholder=\"What do you want to play?\"\n value={query}\n />\n </form>\n <div className=\"ms-auto flex items-center gap-2\">\n <Button aria-label=\"Notifications\" size=\"icon\" tone=\"muted\" variant=\"ghost\">\n <Bell aria-hidden />\n </Button>\n <Avatar>\n <AvatarFallback>JL</AvatarFallback>\n </Avatar>\n </div>\n </>\n }\n >\n <div className=\"flex flex-col gap-6 p-6\">\n <div>\n <p className=\"text-muted-foreground text-sm\">Album · 2024 · 5 songs</p>\n <h1 className=\"font-heading text-3xl font-semibold\">Quiet hours</h1>\n </div>\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead>#</TableHead>\n <TableHead>Title</TableHead>\n <TableHead className=\"text-end\">Length</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {tracks.map((track, index) => (\n <TableRow key={track.title}>\n <TableCell className=\"text-muted-foreground\">{index + 1}</TableCell>\n <TableCell>{track.title}</TableCell>\n <TableCell className=\"text-muted-foreground text-end tabular-nums\">\n {track.length}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n </AppView>\n )\n}\n\n/*\n * The same app as a phone screen: layout=\"phone\" with no top bar, so the album\n * header reaches the top edge and pads itself for the status bar; a mini\n * player and the tab bar dock at the bottom.\n */\nexport function AppViewPhonePage() {\n const [playing, setPlaying] = useState(false)\n\n return (\n <AppView\n bottomBar={\n <>\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium\">First light</p>\n <p className=\"text-muted-foreground truncate text-xs\">Mara Vale</p>\n </div>\n <Button\n aria-label={playing ? 'Pause' : 'Play'}\n onClick={() => setPlaying(!playing)}\n size=\"icon\"\n variant=\"default\"\n >\n {playing ? <Pause aria-hidden /> : <Play aria-hidden />}\n </Button>\n <Button aria-label=\"Next track\" size=\"icon\" tone=\"muted\" variant=\"ghost\">\n <SkipForward aria-hidden />\n </Button>\n </>\n }\n layout=\"phone\"\n tabBar={\n <TabBar\n items={[\n { href: '#home', icon: <House aria-hidden />, label: 'Home' },\n { href: '#search', icon: <Search aria-hidden />, label: 'Search' },\n { current: true, href: '#library', icon: <Library aria-hidden />, label: 'Library' },\n ]}\n />\n }\n >\n <div className=\"flex flex-col gap-2 pt-[env(safe-area-inset-top)]\">\n <div className=\"px-4 pt-6\">\n <p className=\"text-muted-foreground text-sm\">Album · 2024 · 5 songs</p>\n <h1 className=\"font-heading text-3xl font-semibold\">Quiet hours</h1>\n </div>\n <ItemGroup>\n {tracks.map((track, index) => (\n <Item\n key={track.title}\n render={\n <a href={`#${track.title}`}>\n <ItemContent>\n <ItemTitle>{track.title}</ItemTitle>\n <ItemDescription>\n {index + 1} · {track.length}\n </ItemDescription>\n </ItemContent>\n </a>\n }\n size=\"sm\"\n />\n ))}\n </ItemGroup>\n </div>\n </AppView>\n )\n}\n"
14597
14740
  }
14598
14741
  ]
14599
14742
  },
@@ -14633,7 +14776,7 @@
14633
14776
  "files": [
14634
14777
  {
14635
14778
  "path": "pages/chat-page/chat-page.tsx",
14636
- "source": "import type { ChatComposerStatus } from '@atom63/ui-foundation'\nimport {\n Button,\n Sidebar,\n SidebarContent,\n SidebarGroup,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInset,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarProvider,\n SidebarTrigger,\n} from '@atom63/ui-react'\nimport { SquarePen } from 'lucide-react'\nimport type { AnchorHTMLAttributes, ReactElement } from 'react'\n\nimport { type ChatPanelMessage, ChatThread } from '../../blocks/chat-panel/chat-panel'\n\nexport const template = {\n id: 'chat-page',\n kind: 'page',\n title: 'Chat page',\n description:\n 'A full-page AI assistant: past conversations in the sidebar with a new chat button, the open conversation in a 48rem reading column with replies at its full width, and the one-row composer at the bottom of the same column. With no messages it is the start screen: a large greeting, the composer and suggestion chips. Uses the chat-panel block for the conversation; wire it to @atom63/agent or any runtime through props.',\n category: 'ai',\n tags: [\n 'chat',\n 'assistant',\n 'ai',\n 'ai assistant',\n 'agent',\n 'copilot',\n 'conversation',\n 'history',\n 'start screen',\n 'suggestions',\n 'prompt',\n ],\n readiness: 'draft',\n} as const\n\nexport interface ChatConversation {\n current?: boolean\n href: string\n title: string\n}\n\nexport type ChatPageLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & { href: string }\n\nexport interface ChatPageProps {\n /** Past conversations, newest first. */\n conversations: readonly ChatConversation[]\n messages: readonly ChatPanelMessage[]\n onNewChat?: () => void\n onSend: (text: string) => void\n onStop?: () => void\n /** The product name at the top of the sidebar. */\n productName?: string\n /** Renders a conversation link, for a router's own link component; a plain anchor by default. */\n renderLink?: (props: ChatPageLinkProps) => ReactElement\n status?: ChatComposerStatus\n suggestions?: readonly string[]\n}\n\nconst anchor = ({ children, ...props }: ChatPageLinkProps) => <a {...props}>{children}</a>\n\n/*\n * The assistant as the whole page. On a phone the history becomes a sheet the\n * top-bar toggle opens. The open conversation is marked with aria-current.\n * The page holds no conversation state; see ChatThread for how to feed it.\n *\n * Each safe-area inset has one owner, as in AppView: the top bar takes the top\n * inset, and the page column takes the inline insets and the bottom one, so\n * the composer clears the home indicator.\n */\nexport function ChatPage({\n conversations,\n messages,\n onNewChat,\n onSend,\n onStop,\n productName = 'Assistant',\n renderLink = anchor,\n status,\n suggestions,\n}: ChatPageProps) {\n const current = conversations.find(conversation => conversation.current)\n return (\n <SidebarProvider>\n <Sidebar>\n <nav aria-label=\"Conversations\" className=\"contents\">\n <SidebarHeader>\n <div className=\"flex items-center gap-2 px-2\">\n <span className=\"font-heading text-foreground truncate font-semibold\">\n {productName}\n </span>\n <Button\n aria-label=\"New chat\"\n className=\"ms-auto\"\n onClick={onNewChat}\n size=\"icon-sm\"\n variant=\"ghost\"\n >\n <SquarePen aria-hidden />\n </Button>\n </div>\n </SidebarHeader>\n <SidebarContent>\n <SidebarGroup>\n <SidebarGroupLabel>Recent</SidebarGroupLabel>\n <SidebarGroupContent>\n <SidebarMenu>\n {conversations.map(conversation => (\n <SidebarMenuItem key={conversation.href}>\n <SidebarMenuButton\n isActive={conversation.current}\n render={renderLink({\n 'aria-current': conversation.current ? 'page' : undefined,\n children: <span className=\"truncate\">{conversation.title}</span>,\n href: conversation.href,\n })}\n />\n </SidebarMenuItem>\n ))}\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n </SidebarContent>\n </nav>\n </Sidebar>\n <SidebarInset className=\"flex h-svh min-h-0 flex-col px-[max(var(--a63-safe-area-left),var(--a63-safe-area-right))] pb-[var(--a63-safe-area-bottom)]\">\n <header className=\"border-border box-content flex h-14 shrink-0 items-center gap-2 border-b px-4 pt-[var(--a63-safe-area-top)]\">\n <SidebarTrigger />\n <h1 className=\"text-foreground truncate text-sm font-semibold\">\n {messages.length ? (current?.title ?? 'Chat') : 'New chat'}\n </h1>\n </header>\n <ChatThread\n greeting=\"What can I help with?\"\n layout=\"page\"\n messages={messages}\n onSend={onSend}\n onStop={onStop}\n status={status}\n suggestions={suggestions}\n />\n </SidebarInset>\n </SidebarProvider>\n )\n}\n"
14779
+ "source": "import type { ChatComposerStatus } from '@atom63/ui-foundation'\nimport {\n Button,\n Sidebar,\n SidebarContent,\n SidebarGroup,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInset,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarProvider,\n SidebarTrigger,\n} from '@atom63/ui-react'\nimport { SquarePen } from 'lucide-react'\nimport type { AnchorHTMLAttributes, ReactElement } from 'react'\n\nimport { type ChatPanelMessage, ChatThread } from '../../blocks/chat-panel/chat-panel'\n\nexport const template = {\n id: 'chat-page',\n kind: 'page',\n title: 'Chat page',\n description:\n 'A full-page AI assistant: past conversations in the sidebar with a new chat button, the open conversation in a 48rem reading column with replies at its full width, and the one-row composer at the bottom of the same column. With no messages it is the start screen: a large greeting, the composer and suggestion chips. Uses the chat-panel block for the conversation; wire it to @atom63/agent or any runtime through props.',\n category: 'ai',\n tags: [\n 'chat',\n 'assistant',\n 'ai',\n 'ai assistant',\n 'agent',\n 'copilot',\n 'conversation',\n 'history',\n 'start screen',\n 'suggestions',\n 'prompt',\n ],\n readiness: 'draft',\n} as const\n\nexport interface ChatConversation {\n current?: boolean\n href: string\n title: string\n}\n\nexport type ChatPageLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & { href: string }\n\nexport interface ChatPageProps {\n /** Past conversations, newest first. */\n conversations: readonly ChatConversation[]\n messages: readonly ChatPanelMessage[]\n onNewChat?: () => void\n onSend: (text: string) => void\n onStop?: () => void\n /** The product name at the top of the sidebar. */\n productName?: string\n /** Renders a conversation link, for a router's own link component; a plain anchor by default. */\n renderLink?: (props: ChatPageLinkProps) => ReactElement\n status?: ChatComposerStatus\n suggestions?: readonly string[]\n}\n\nconst anchor = ({ children, ...props }: ChatPageLinkProps) => <a {...props}>{children}</a>\n\n/*\n * The assistant as the whole page. On a phone the history becomes a sheet the\n * top-bar toggle opens. The open conversation is marked with aria-current.\n * The page holds no conversation state; see ChatThread for how to feed it.\n *\n * Each safe-area inset has one owner, as in AppView: the top bar takes the top\n * inset, and the page column takes the inline insets and the bottom one, so\n * the composer clears the home indicator.\n */\nexport function ChatPage({\n conversations,\n messages,\n onNewChat,\n onSend,\n onStop,\n productName = 'Assistant',\n renderLink = anchor,\n status,\n suggestions,\n}: ChatPageProps) {\n const current = conversations.find(conversation => conversation.current)\n return (\n <SidebarProvider>\n <Sidebar>\n <nav aria-label=\"Conversations\" className=\"contents\">\n <SidebarHeader>\n <div className=\"flex items-center gap-2 px-2\">\n <span className=\"font-heading text-foreground truncate font-semibold\">\n {productName}\n </span>\n <Button\n aria-label=\"New chat\"\n className=\"ms-auto\"\n onClick={onNewChat}\n size=\"icon-sm\"\n tone=\"muted\"\n variant=\"ghost\"\n >\n <SquarePen aria-hidden />\n </Button>\n </div>\n </SidebarHeader>\n <SidebarContent>\n <SidebarGroup>\n <SidebarGroupLabel>Recent</SidebarGroupLabel>\n <SidebarGroupContent>\n <SidebarMenu>\n {conversations.map(conversation => (\n <SidebarMenuItem key={conversation.href}>\n <SidebarMenuButton\n isActive={conversation.current}\n render={renderLink({\n 'aria-current': conversation.current ? 'page' : undefined,\n children: <span className=\"truncate\">{conversation.title}</span>,\n href: conversation.href,\n })}\n />\n </SidebarMenuItem>\n ))}\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n </SidebarContent>\n </nav>\n </Sidebar>\n <SidebarInset className=\"flex h-svh min-h-0 flex-col px-[max(var(--a63-safe-area-left),var(--a63-safe-area-right))] pb-[var(--a63-safe-area-bottom)]\">\n <header className=\"border-border box-content flex h-14 shrink-0 items-center gap-2 border-b px-4 pt-[var(--a63-safe-area-top)]\">\n <SidebarTrigger />\n <h1 className=\"text-foreground truncate text-sm font-semibold\">\n {messages.length ? (current?.title ?? 'Chat') : 'New chat'}\n </h1>\n </header>\n <ChatThread\n greeting=\"What can I help with?\"\n layout=\"page\"\n messages={messages}\n onSend={onSend}\n onStop={onStop}\n status={status}\n suggestions={suggestions}\n />\n </SidebarInset>\n </SidebarProvider>\n )\n}\n"
14637
14780
  }
14638
14781
  ]
14639
14782
  },
@@ -14673,7 +14816,7 @@
14673
14816
  "files": [
14674
14817
  {
14675
14818
  "path": "pages/dashboard-page/dashboard-page.tsx",
14676
- "source": "import { Badge, Button } from '@atom63/ui-react'\nimport { Container, SectionHeader } from '@atom63/ui-react/layout'\nimport { FileText, LayoutDashboard, Plus, Settings } from 'lucide-react'\n\nimport { type ActivityItem, ActivityList } from '../../blocks/activity-list/activity-list'\nimport { AppShell } from '../../blocks/app-shell/app-shell'\nimport {\n type DataTableColumn,\n DataTableSection,\n} from '../../blocks/data-table-section/data-table-section'\nimport { PageHeader } from '../../blocks/page-header/page-header'\nimport { type Stat, StatRow } from '../../blocks/stat-row/stat-row'\nimport { type Invoice, invoices } from '../list-page/list-page-data'\n\nexport const template = {\n id: 'dashboard-page',\n kind: 'page',\n title: 'Dashboard page',\n description:\n 'An overview inside the app shell: headline numbers, the most recent records and an activity feed, with one primary action.',\n category: 'data',\n tags: ['dashboard', 'overview', 'home', 'stats', 'metrics', 'activity', 'app shell'],\n readiness: 'ready',\n} as const\n\nconst nav = [\n { current: true, href: '#overview', icon: <LayoutDashboard aria-hidden />, label: 'Overview' },\n { href: '#invoices', icon: <FileText aria-hidden />, label: 'Invoices' },\n { href: '#settings', icon: <Settings aria-hidden />, label: 'Settings' },\n]\n\nconst stats: readonly Stat[] = [\n { change: { direction: 'up', text: '12%', tone: 'good' }, label: 'Revenue', value: '$48,200' },\n { change: { direction: 'down', text: '3', tone: 'good' }, label: 'Open invoices', value: '14' },\n { change: { direction: 'up', text: '2', tone: 'bad' }, label: 'Overdue', value: '5' },\n { label: 'Customers', value: '128' },\n]\n\nconst activity: readonly ActivityItem[] = [\n {\n action: 'paid',\n actor: 'Northwind Traders',\n dateTime: '2026-09-27T09:12:00Z',\n id: 'a1',\n target: 'INV-1042',\n time: '2 hours ago',\n },\n {\n action: 'sent',\n actor: 'Ada Park',\n dateTime: '2026-09-27T07:40:00Z',\n id: 'a2',\n target: 'INV-1049',\n time: '4 hours ago',\n },\n {\n action: 'added the customer',\n actor: 'Ada Park',\n dateTime: '2026-09-26T16:05:00Z',\n id: 'a3',\n target: 'Summit Outfitters',\n time: 'Yesterday',\n },\n {\n action: 'marked as overdue',\n actor: 'Tally',\n dateTime: '2026-09-26T00:00:00Z',\n id: 'a4',\n target: 'INV-1047',\n time: 'Yesterday',\n },\n]\n\nconst currency = new Intl.NumberFormat('en-US', { currency: 'USD', style: 'currency' })\nconst statusLabel = { open: 'Open', overdue: 'Overdue', paid: 'Paid' } as const\nconst statusVariant = { open: 'info', overdue: 'error', paid: 'success' } as const\n\nconst columns: readonly DataTableColumn<Invoice>[] = [\n { cell: invoice => invoice.id, header: 'Invoice', key: 'id' },\n { cell: invoice => invoice.customer, header: 'Customer', key: 'customer' },\n {\n cell: invoice => (\n <Badge variant={statusVariant[invoice.status]}>{statusLabel[invoice.status]}</Badge>\n ),\n header: 'Status',\n key: 'status',\n },\n {\n align: 'end',\n cell: invoice => currency.format(invoice.amount),\n header: 'Amount',\n key: 'amount',\n },\n]\n\nconst recent = [...invoices].sort((a, b) => b.issued.localeCompare(a.issued)).slice(0, 4)\n\nexport function DashboardContent() {\n return (\n <Container maxWidth=\"wide\" padding=\"none\">\n <PageHeader\n actions={\n <Button variant=\"primary\">\n <Plus aria-hidden />\n New invoice\n </Button>\n }\n description=\"September 2026 at a glance.\"\n title=\"Overview\"\n />\n <StatRow comparison=\"vs. August\" stats={stats} />\n <div className=\"grid gap-8 lg:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]\">\n <section className=\"flex flex-col gap-4\">\n <SectionHeader level={2} title=\"Recent invoices\" variant=\"muted\" />\n <DataTableSection\n columns={columns}\n empty={{\n action: <Button variant=\"primary\">New invoice</Button>,\n description: 'Invoices you create appear here.',\n title: 'No invoices yet',\n }}\n getRowKey={invoice => invoice.id}\n headingLevel={3}\n label=\"Recent invoices\"\n rows={recent}\n summary={`The ${recent.length} most recent of ${invoices.length}`}\n />\n </section>\n <section className=\"flex flex-col gap-4\">\n <SectionHeader level={2} title=\"Activity\" variant=\"muted\" />\n <ActivityList items={activity} label=\"Recent activity\" />\n </section>\n </div>\n </Container>\n )\n}\n\n/* The page in its app shell. An app that renders the shell once, around its\n routes, renders `DashboardContent` inside it instead. */\nexport function DashboardPage() {\n return (\n <AppShell navItems={nav} productName=\"Tally\">\n <DashboardContent />\n </AppShell>\n )\n}\n"
14819
+ "source": "import { Badge, Button } from '@atom63/ui-react'\nimport { Container, SectionHeader } from '@atom63/ui-react/layout'\nimport { FileText, LayoutDashboard, Plus, Settings } from 'lucide-react'\n\nimport { type ActivityItem, ActivityList } from '../../blocks/activity-list/activity-list'\nimport { AppShell } from '../../blocks/app-shell/app-shell'\nimport {\n type DataTableColumn,\n DataTableSection,\n} from '../../blocks/data-table-section/data-table-section'\nimport { PageHeader } from '../../blocks/page-header/page-header'\nimport { type Stat, StatRow } from '../../blocks/stat-row/stat-row'\nimport { type Invoice, invoices } from '../list-page/list-page-data'\n\nexport const template = {\n id: 'dashboard-page',\n kind: 'page',\n title: 'Dashboard page',\n description:\n 'An overview inside the app shell: headline numbers, the most recent records and an activity feed, with one primary action.',\n category: 'data',\n tags: ['dashboard', 'overview', 'home', 'stats', 'metrics', 'activity', 'app shell'],\n readiness: 'ready',\n} as const\n\nconst nav = [\n { current: true, href: '#overview', icon: <LayoutDashboard aria-hidden />, label: 'Overview' },\n { href: '#invoices', icon: <FileText aria-hidden />, label: 'Invoices' },\n { href: '#settings', icon: <Settings aria-hidden />, label: 'Settings' },\n]\n\nconst stats: readonly Stat[] = [\n { change: { direction: 'up', text: '12%', tone: 'good' }, label: 'Revenue', value: '$48,200' },\n { change: { direction: 'down', text: '3', tone: 'good' }, label: 'Open invoices', value: '14' },\n { change: { direction: 'up', text: '2', tone: 'bad' }, label: 'Overdue', value: '5' },\n { label: 'Customers', value: '128' },\n]\n\nconst activity: readonly ActivityItem[] = [\n {\n action: 'paid',\n actor: 'Northwind Traders',\n dateTime: '2026-09-27T09:12:00Z',\n id: 'a1',\n target: 'INV-1042',\n time: '2 hours ago',\n },\n {\n action: 'sent',\n actor: 'Ada Park',\n dateTime: '2026-09-27T07:40:00Z',\n id: 'a2',\n target: 'INV-1049',\n time: '4 hours ago',\n },\n {\n action: 'added the customer',\n actor: 'Ada Park',\n dateTime: '2026-09-26T16:05:00Z',\n id: 'a3',\n target: 'Summit Outfitters',\n time: 'Yesterday',\n },\n {\n action: 'marked as overdue',\n actor: 'Tally',\n dateTime: '2026-09-26T00:00:00Z',\n id: 'a4',\n target: 'INV-1047',\n time: 'Yesterday',\n },\n]\n\nconst currency = new Intl.NumberFormat('en-US', { currency: 'USD', style: 'currency' })\nconst statusLabel = { open: 'Open', overdue: 'Overdue', paid: 'Paid' } as const\nconst statusVariant = { open: 'info', overdue: 'error', paid: 'success' } as const\n\nconst columns: readonly DataTableColumn<Invoice>[] = [\n { cell: invoice => invoice.id, header: 'Invoice', key: 'id' },\n { cell: invoice => invoice.customer, header: 'Customer', key: 'customer' },\n {\n cell: invoice => (\n <Badge variant={statusVariant[invoice.status]}>{statusLabel[invoice.status]}</Badge>\n ),\n header: 'Status',\n key: 'status',\n },\n {\n align: 'end',\n cell: invoice => currency.format(invoice.amount),\n header: 'Amount',\n key: 'amount',\n },\n]\n\nconst recent = [...invoices].sort((a, b) => b.issued.localeCompare(a.issued)).slice(0, 4)\n\nexport function DashboardContent() {\n return (\n <Container maxWidth=\"wide\" padding=\"none\">\n <PageHeader\n actions={\n <Button variant=\"primary\">\n <Plus aria-hidden />\n New invoice\n </Button>\n }\n description=\"September 2026 at a glance.\"\n title=\"Overview\"\n />\n <StatRow comparison=\"vs. August\" stats={stats} />\n <div className=\"grid gap-8 lg:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]\">\n <section className=\"flex flex-col gap-4\">\n <SectionHeader level={2} title=\"Recent invoices\" variant=\"muted\" />\n <DataTableSection\n columns={columns}\n empty={{\n action: <Button variant=\"outline\">New invoice</Button>,\n description: 'Invoices you create appear here.',\n title: 'No invoices yet',\n }}\n getRowKey={invoice => invoice.id}\n headingLevel={3}\n label=\"Recent invoices\"\n rows={recent}\n summary={`The ${recent.length} most recent of ${invoices.length}`}\n />\n </section>\n <section className=\"flex flex-col gap-4\">\n <SectionHeader level={2} title=\"Activity\" variant=\"muted\" />\n <ActivityList items={activity} label=\"Recent activity\" />\n </section>\n </div>\n </Container>\n )\n}\n\n/* The page in its app shell. An app that renders the shell once, around its\n routes, renders `DashboardContent` inside it instead. */\nexport function DashboardPage() {\n return (\n <AppShell navItems={nav} productName=\"Tally\">\n <DashboardContent />\n </AppShell>\n )\n}\n"
14677
14820
  },
14678
14821
  {
14679
14822
  "path": "pages/list-page/list-page-data.ts",
@@ -14725,7 +14868,7 @@
14725
14868
  },
14726
14869
  {
14727
14870
  "path": "pages/list-page/list-page.tsx",
14728
- "source": "import {\n Badge,\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n Item,\n ItemActions,\n ItemContent,\n ItemDescription,\n ItemTitle,\n} from '@atom63/ui-react'\nimport { Container } from '@atom63/ui-react/layout'\nimport { ChevronRight, Ellipsis, FileText, LayoutDashboard, Plus, Settings } from 'lucide-react'\nimport { useState, type ReactNode } from 'react'\n\nimport { AppShell } from '../../blocks/app-shell/app-shell'\nimport {\n type DataTableColumn,\n DataTableSection,\n} from '../../blocks/data-table-section/data-table-section'\nimport { DetailPanel } from '../../blocks/detail-panel/detail-panel'\nimport { FilterBar } from '../../blocks/filter-bar/filter-bar'\nimport { PageHeader } from '../../blocks/page-header/page-header'\nimport { type Invoice, type InvoiceStatus, invoices as sampleInvoices } from './list-page-data'\n\nexport const template = {\n id: 'list-page',\n kind: 'page',\n title: 'List page',\n description:\n 'A filterable collection page inside the app shell: a header with one primary action, a search and status filter, a table that becomes stacked rows on phones, and a detail sheet for one row.',\n category: 'collections',\n tags: ['list', 'detail', 'table', 'index', 'invoice', 'invoices', 'orders', 'filter', 'search'],\n readiness: 'ready',\n} as const\n\nconst nav = [\n { href: '#overview', icon: <LayoutDashboard aria-hidden />, label: 'Overview' },\n { current: true, href: '#invoices', icon: <FileText aria-hidden />, label: 'Invoices' },\n { href: '#settings', icon: <Settings aria-hidden />, label: 'Settings' },\n]\n\nconst statusOptions = [\n { label: 'All statuses', value: 'all' },\n { label: 'Paid', value: 'paid' },\n { label: 'Open', value: 'open' },\n { label: 'Overdue', value: 'overdue' },\n] as const\n\nconst statusBadge: Record<InvoiceStatus, { label: string; variant: 'success' | 'info' | 'error' }> =\n {\n paid: { label: 'Paid', variant: 'success' },\n open: { label: 'Open', variant: 'info' },\n overdue: { label: 'Overdue', variant: 'error' },\n }\n\nconst currency = new Intl.NumberFormat('en-US', { currency: 'USD', style: 'currency' })\nconst date = new Intl.DateTimeFormat('en-US', { dateStyle: 'medium', timeZone: 'UTC' })\n\nfunction StatusBadge({ status }: { status: InvoiceStatus }) {\n return <Badge variant={statusBadge[status].variant}>{statusBadge[status].label}</Badge>\n}\n\nconst columns: readonly DataTableColumn<Invoice>[] = [\n { cell: invoice => invoice.id, header: 'Invoice', key: 'id' },\n { cell: invoice => invoice.customer, header: 'Customer', key: 'customer' },\n { cell: invoice => <StatusBadge status={invoice.status} />, header: 'Status', key: 'status' },\n {\n cell: invoice => date.format(new Date(invoice.issued)),\n header: 'Issued',\n key: 'issued',\n showFrom: 'md',\n },\n {\n align: 'end',\n cell: invoice => currency.format(invoice.amount),\n header: 'Amount',\n key: 'amount',\n showFrom: 'lg',\n },\n]\n\nexport interface ListPageProps {\n /** Initial record shown in the detail sheet, useful for a routed selection. */\n defaultOpenId?: string\n /** Initial search text, useful when the URL restores filter state. */\n defaultQuery?: string\n /** The rows to list; the page filters them in memory. */\n invoices?: readonly Invoice[]\n /** A transient operation surface such as import progress or completion. */\n operationStatus?: ReactNode\n}\n\nexport function ListContent({\n defaultOpenId,\n defaultQuery = '',\n invoices = sampleInvoices,\n operationStatus,\n}: ListPageProps) {\n const [query, setQuery] = useState(defaultQuery)\n const [status, setStatus] = useState('all')\n const [openId, setOpenId] = useState<string | null>(defaultOpenId ?? null)\n const open = invoices.find(invoice => invoice.id === openId)\n\n const needle = query.trim().toLowerCase()\n const visible = invoices.filter(\n invoice =>\n (status === 'all' || invoice.status === status) &&\n (needle === '' ||\n invoice.id.toLowerCase().includes(needle) ||\n invoice.customer.toLowerCase().includes(needle))\n )\n const filtered = needle !== '' || status !== 'all'\n const clear = () => {\n setQuery('')\n setStatus('all')\n }\n const rowMenu = (invoice: Invoice) => (\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n <Button aria-label={`Actions for ${invoice.id}`} size=\"icon-sm\" variant=\"ghost\">\n <Ellipsis aria-hidden />\n </Button>\n }\n />\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem onClick={() => setOpenId(invoice.id)}>View invoice</DropdownMenuItem>\n <DropdownMenuItem>Download PDF</DropdownMenuItem>\n {invoice.status === 'paid' ? null : <DropdownMenuItem>Mark as paid</DropdownMenuItem>}\n <DropdownMenuSeparator />\n <DropdownMenuItem variant=\"destructive\">Void invoice</DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n\n return (\n <>\n <Container maxWidth=\"wide\" padding=\"none\">\n <PageHeader\n actions={\n <Button variant=\"primary\">\n <Plus aria-hidden />\n New invoice\n </Button>\n }\n description=\"Track what customers owe and what has been paid.\"\n title=\"Invoices\"\n />\n <FilterBar\n filterLabel=\"Status\"\n filterOptions={statusOptions}\n filterValue={status}\n onClear={clear}\n onFilterChange={setStatus}\n onQueryChange={setQuery}\n query={query}\n searchLabel=\"Search invoices\"\n searchPlaceholder=\"Invoice number or customer\"\n showClear={filtered}\n />\n <DataTableSection\n columns={columns}\n empty={\n invoices.length === 0\n ? {\n action: <Button variant=\"primary\">New invoice</Button>,\n description: 'Invoices you create appear here, with their status and amount.',\n title: 'No invoices yet',\n }\n : {\n action: (\n <Button onClick={clear} variant=\"outline\">\n Clear filters\n </Button>\n ),\n description:\n 'No invoice matches this search and status. Clear the filters to see every invoice.',\n title: 'No matching invoices',\n }\n }\n getRowKey={invoice => invoice.id}\n label=\"Invoices\"\n renderPhoneRow={invoice => (\n <Item\n className=\"rounded-none\"\n data-selected={openId === invoice.id ? '' : undefined}\n size=\"sm\"\n >\n <ItemContent>\n <ItemTitle>{invoice.customer}</ItemTitle>\n <ItemDescription>\n {invoice.id} · {date.format(new Date(invoice.issued))}\n </ItemDescription>\n </ItemContent>\n <ItemActions className=\"gap-1\">\n <StatusBadge status={invoice.status} />\n <Button\n aria-label={`View ${invoice.id}`}\n onClick={() => setOpenId(invoice.id)}\n size=\"icon-sm\"\n variant=\"ghost\"\n >\n <ChevronRight aria-hidden />\n </Button>\n {rowMenu(invoice)}\n </ItemActions>\n </Item>\n )}\n rowActions={rowMenu}\n rows={visible}\n selectedRowKey={openId ?? undefined}\n summary={\n filtered\n ? `${visible.length} of ${invoices.length} invoices`\n : `${invoices.length} invoices`\n }\n />\n </Container>\n <DetailPanel\n actions={\n <>\n <Button variant=\"outline\">Download PDF</Button>\n {open?.status === 'paid' ? null : <Button variant=\"primary\">Mark as paid</Button>}\n </>\n }\n description={open?.customer}\n fields={\n open\n ? [\n { label: 'Status', value: <StatusBadge status={open.status} /> },\n { label: 'Issued', value: date.format(new Date(open.issued)) },\n { label: 'Amount', value: currency.format(open.amount) },\n ]\n : []\n }\n onOpenChange={next => {\n if (!next) setOpenId(null)\n }}\n open={open !== undefined}\n title={open?.id ?? ''}\n />\n {operationStatus}\n </>\n )\n}\n\n/* The page in its app shell. An app that renders the shell once, around its\n routes, renders `ListContent` inside it instead. */\nexport function ListPage(props: ListPageProps) {\n return (\n <AppShell navItems={nav} productName=\"Tally\">\n <ListContent {...props} />\n </AppShell>\n )\n}\n"
14871
+ "source": "import {\n Badge,\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n Item,\n ItemActions,\n ItemContent,\n ItemDescription,\n ItemTitle,\n} from '@atom63/ui-react'\nimport { Container } from '@atom63/ui-react/layout'\nimport { ChevronRight, Ellipsis, FileText, LayoutDashboard, Plus, Settings } from 'lucide-react'\nimport { useState, type ReactNode } from 'react'\n\nimport { AppShell } from '../../blocks/app-shell/app-shell'\nimport {\n type DataTableColumn,\n DataTableSection,\n} from '../../blocks/data-table-section/data-table-section'\nimport { DetailPanel } from '../../blocks/detail-panel/detail-panel'\nimport { FilterBar } from '../../blocks/filter-bar/filter-bar'\nimport { PageHeader } from '../../blocks/page-header/page-header'\nimport { type Invoice, type InvoiceStatus, invoices as sampleInvoices } from './list-page-data'\n\nexport const template = {\n id: 'list-page',\n kind: 'page',\n title: 'List page',\n description:\n 'A filterable collection page inside the app shell: a header with one primary action, a search and status filter, a table that becomes stacked rows on phones, and a detail sheet for one row.',\n category: 'collections',\n tags: ['list', 'detail', 'table', 'index', 'invoice', 'invoices', 'orders', 'filter', 'search'],\n readiness: 'ready',\n} as const\n\nconst nav = [\n { href: '#overview', icon: <LayoutDashboard aria-hidden />, label: 'Overview' },\n { current: true, href: '#invoices', icon: <FileText aria-hidden />, label: 'Invoices' },\n { href: '#settings', icon: <Settings aria-hidden />, label: 'Settings' },\n]\n\nconst statusOptions = [\n { label: 'All statuses', value: 'all' },\n { label: 'Paid', value: 'paid' },\n { label: 'Open', value: 'open' },\n { label: 'Overdue', value: 'overdue' },\n] as const\n\nconst statusBadge: Record<InvoiceStatus, { label: string; variant: 'success' | 'info' | 'error' }> =\n {\n paid: { label: 'Paid', variant: 'success' },\n open: { label: 'Open', variant: 'info' },\n overdue: { label: 'Overdue', variant: 'error' },\n }\n\nconst currency = new Intl.NumberFormat('en-US', { currency: 'USD', style: 'currency' })\nconst date = new Intl.DateTimeFormat('en-US', { dateStyle: 'medium', timeZone: 'UTC' })\n\nfunction StatusBadge({ status }: { status: InvoiceStatus }) {\n return <Badge variant={statusBadge[status].variant}>{statusBadge[status].label}</Badge>\n}\n\nconst columns: readonly DataTableColumn<Invoice>[] = [\n { cell: invoice => invoice.id, header: 'Invoice', key: 'id' },\n { cell: invoice => invoice.customer, header: 'Customer', key: 'customer' },\n { cell: invoice => <StatusBadge status={invoice.status} />, header: 'Status', key: 'status' },\n {\n cell: invoice => date.format(new Date(invoice.issued)),\n header: 'Issued',\n key: 'issued',\n showFrom: 'md',\n },\n {\n align: 'end',\n cell: invoice => currency.format(invoice.amount),\n header: 'Amount',\n key: 'amount',\n showFrom: 'lg',\n },\n]\n\nexport interface ListPageProps {\n /** Initial record shown in the detail sheet, useful for a routed selection. */\n defaultOpenId?: string\n /** Initial search text, useful when the URL restores filter state. */\n defaultQuery?: string\n /** The rows to list; the page filters them in memory. */\n invoices?: readonly Invoice[]\n /** A transient operation surface such as import progress or completion. */\n operationStatus?: ReactNode\n}\n\nexport function ListContent({\n defaultOpenId,\n defaultQuery = '',\n invoices = sampleInvoices,\n operationStatus,\n}: ListPageProps) {\n const [query, setQuery] = useState(defaultQuery)\n const [status, setStatus] = useState('all')\n const [openId, setOpenId] = useState<string | null>(defaultOpenId ?? null)\n const open = invoices.find(invoice => invoice.id === openId)\n\n const needle = query.trim().toLowerCase()\n const visible = invoices.filter(\n invoice =>\n (status === 'all' || invoice.status === status) &&\n (needle === '' ||\n invoice.id.toLowerCase().includes(needle) ||\n invoice.customer.toLowerCase().includes(needle))\n )\n const filtered = needle !== '' || status !== 'all'\n const clear = () => {\n setQuery('')\n setStatus('all')\n }\n const rowMenu = (invoice: Invoice) => (\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n <Button\n aria-label={`Actions for ${invoice.id}`}\n size=\"icon-sm\"\n tone=\"muted\"\n variant=\"ghost\"\n >\n <Ellipsis aria-hidden />\n </Button>\n }\n />\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem onClick={() => setOpenId(invoice.id)}>View invoice</DropdownMenuItem>\n <DropdownMenuItem>Download PDF</DropdownMenuItem>\n {invoice.status === 'paid' ? null : <DropdownMenuItem>Mark as paid</DropdownMenuItem>}\n <DropdownMenuSeparator />\n <DropdownMenuItem variant=\"destructive\">Void invoice</DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n\n return (\n <>\n <Container maxWidth=\"wide\" padding=\"none\">\n <PageHeader\n actions={\n <Button variant=\"primary\">\n <Plus aria-hidden />\n New invoice\n </Button>\n }\n description=\"Track what customers owe and what has been paid.\"\n title=\"Invoices\"\n />\n <FilterBar\n filterLabel=\"Status\"\n filterOptions={statusOptions}\n filterValue={status}\n onClear={clear}\n onFilterChange={setStatus}\n onQueryChange={setQuery}\n query={query}\n searchLabel=\"Search invoices\"\n searchPlaceholder=\"Invoice number or customer\"\n showClear={filtered}\n />\n <DataTableSection\n columns={columns}\n empty={\n invoices.length === 0\n ? {\n action: <Button variant=\"outline\">New invoice</Button>,\n description: 'Invoices you create appear here, with their status and amount.',\n title: 'No invoices yet',\n }\n : {\n action: (\n <Button onClick={clear} variant=\"outline\">\n Clear filters\n </Button>\n ),\n description:\n 'No invoice matches this search and status. Clear the filters to see every invoice.',\n title: 'No matching invoices',\n }\n }\n getRowKey={invoice => invoice.id}\n label=\"Invoices\"\n renderPhoneRow={invoice => (\n <Item\n className=\"rounded-none\"\n data-selected={openId === invoice.id ? '' : undefined}\n size=\"sm\"\n >\n <ItemContent>\n <ItemTitle>{invoice.customer}</ItemTitle>\n <ItemDescription>\n {invoice.id} · {date.format(new Date(invoice.issued))}\n </ItemDescription>\n </ItemContent>\n <ItemActions className=\"gap-1\">\n <StatusBadge status={invoice.status} />\n <Button\n aria-label={`View ${invoice.id}`}\n onClick={() => setOpenId(invoice.id)}\n size=\"icon-sm\"\n tone=\"muted\"\n variant=\"ghost\"\n >\n <ChevronRight aria-hidden />\n </Button>\n {rowMenu(invoice)}\n </ItemActions>\n </Item>\n )}\n rowActions={rowMenu}\n rows={visible}\n selectedRowKey={openId ?? undefined}\n summary={\n filtered\n ? `${visible.length} of ${invoices.length} invoices`\n : `${invoices.length} invoices`\n }\n />\n </Container>\n <DetailPanel\n actions={\n <>\n <Button variant=\"outline\">Download PDF</Button>\n {open?.status === 'paid' ? null : <Button variant=\"default\">Mark as paid</Button>}\n </>\n }\n description={open?.customer}\n fields={\n open\n ? [\n { label: 'Status', value: <StatusBadge status={open.status} /> },\n { label: 'Issued', value: date.format(new Date(open.issued)) },\n { label: 'Amount', value: currency.format(open.amount) },\n ]\n : []\n }\n onOpenChange={next => {\n if (!next) setOpenId(null)\n }}\n open={open !== undefined}\n title={open?.id ?? ''}\n />\n {operationStatus}\n </>\n )\n}\n\n/* The page in its app shell. An app that renders the shell once, around its\n routes, renders `ListContent` inside it instead. */\nexport function ListPage(props: ListPageProps) {\n return (\n <AppShell navItems={nav} productName=\"Tally\">\n <ListContent {...props} />\n </AppShell>\n )\n}\n"
14729
14872
  }
14730
14873
  ]
14731
14874
  },
@@ -14766,6 +14909,48 @@
14766
14909
  }
14767
14910
  ]
14768
14911
  },
14912
+ {
14913
+ "id": "reading-page",
14914
+ "kind": "page",
14915
+ "title": "Reading page",
14916
+ "description": "A long-form reading page for an article, a blog post or a docs page, built on ReaderLayout from @atom63/ui-react/layout: Page owns the main landmark, Container the width, Section the space around the document, and ReaderLayout a centred reading column with a table-of-contents rail beside it on wide screens. reserveAside keeps the column the same width on pages with no rail. Inside an app shell, give Page render={<div />} so the document keeps one main landmark.",
14917
+ "category": "layout",
14918
+ "tags": [
14919
+ "reading",
14920
+ "reader",
14921
+ "article",
14922
+ "blog",
14923
+ "blog post",
14924
+ "post",
14925
+ "docs",
14926
+ "documentation",
14927
+ "guide",
14928
+ "long-form",
14929
+ "essay",
14930
+ "table of contents",
14931
+ "rail",
14932
+ "reader layout",
14933
+ "prose"
14934
+ ],
14935
+ "readiness": "draft",
14936
+ "componentsUsed": [
14937
+ "Container",
14938
+ "Page",
14939
+ "ReaderLayout",
14940
+ "Section",
14941
+ "separator"
14942
+ ],
14943
+ "blocksUsed": [],
14944
+ "packages": [
14945
+ "@atom63/ui-react"
14946
+ ],
14947
+ "files": [
14948
+ {
14949
+ "path": "pages/reading-page/reading-page.tsx",
14950
+ "source": "import { Separator } from '@atom63/ui-react'\nimport { Container, Page, ReaderLayout, Section } from '@atom63/ui-react/layout'\n\nexport const template = {\n id: 'reading-page',\n kind: 'page',\n title: 'Reading page',\n description:\n 'A long-form reading page for an article, a blog post or a docs page, built on ReaderLayout from @atom63/ui-react/layout: Page owns the main landmark, Container the width, Section the space around the document, and ReaderLayout a centred reading column with a table-of-contents rail beside it on wide screens. reserveAside keeps the column the same width on pages with no rail. Inside an app shell, give Page render={<div />} so the document keeps one main landmark.',\n category: 'layout',\n tags: [\n 'reading',\n 'reader',\n 'article',\n 'blog',\n 'blog post',\n 'post',\n 'docs',\n 'documentation',\n 'guide',\n 'long-form',\n 'essay',\n 'table of contents',\n 'rail',\n 'reader layout',\n 'prose',\n ],\n readiness: 'draft',\n} as const\n\nexport interface ReadingSection {\n body: readonly string[]\n id: string\n title: string\n}\n\nconst sampleSections: readonly ReadingSection[] = [\n {\n body: [\n 'An invoice is a request to be paid. It names who owes what, for which work, and by when. Tally keeps every invoice you send in one list, with its status beside it, so you can see at a glance what is still open.',\n 'This guide walks through the life of one invoice, from the draft to the day it is paid.',\n ],\n id: 'overview',\n title: 'Overview',\n },\n {\n body: [\n 'Start from a customer, add the lines you are billing for, and set a due date. A draft stays private until you send it, so you can come back to it as often as you need.',\n 'Each line has a description, a quantity and a price. Tally adds the lines up and applies the tax rate you set for the customer.',\n ],\n id: 'drafting',\n title: 'Drafting an invoice',\n },\n {\n body: [\n 'When you send an invoice, the customer gets an email with a link to pay it. The invoice moves from draft to open, and its due date starts to count down.',\n 'If the due date passes before it is paid, the invoice is marked overdue and Tally sends one polite reminder.',\n ],\n id: 'sending',\n title: 'Sending and reminders',\n },\n {\n body: [\n 'A payment through the link marks the invoice as paid on its own. A payment that arrives another way, such as a bank transfer, you mark as paid yourself from the invoice.',\n ],\n id: 'getting-paid',\n title: 'Getting paid',\n },\n]\n\nexport interface ReadingPageProps {\n /** The article's sections; each one gets a heading and a link in the rail. */\n sections?: readonly ReadingSection[]\n}\n\n/* A sample reading page: a guide with a table-of-contents rail. */\nexport function ReadingPage({ sections = sampleSections }: ReadingPageProps) {\n return (\n <Page noPadding>\n <Container maxWidth=\"widest\" padding=\"none\">\n <Section gap={false} removeTopSpacing={false} spacing=\"tight\">\n <ReaderLayout\n aside={\n <nav aria-label=\"On this page\" className=\"sticky top-8 flex flex-col gap-3\">\n <p className=\"text-foreground text-sm font-semibold\">On this page</p>\n <ul className=\"flex flex-col gap-2\">\n {sections.map(section => (\n <li key={section.id}>\n <a\n className=\"text-muted-foreground hover:text-foreground focus-visible:outline-ring text-sm transition-colors focus-visible:outline-2 focus-visible:outline-offset-2\"\n href={`#${section.id}`}\n >\n {section.title}\n </a>\n </li>\n ))}\n </ul>\n </nav>\n }\n >\n <header className=\"flex flex-col gap-4\">\n <p className=\"text-muted-foreground text-sm font-medium\">Guides</p>\n <h1 className=\"font-heading text-foreground text-4xl font-semibold tracking-tight\">\n How invoicing works\n </h1>\n <p className=\"text-muted-foreground max-w-2xl text-lg leading-relaxed\">\n From the first draft to the day it is paid: what happens to an invoice, and what you\n can do at each step.\n </p>\n <p className=\"text-muted-foreground text-sm\">\n Updated 12 September 2026 · 4 min read\n </p>\n </header>\n <Separator />\n {sections.map(section => (\n <section className=\"flex flex-col gap-4\" key={section.id}>\n <h2\n className=\"font-heading text-foreground scroll-mt-8 text-2xl font-semibold\"\n id={section.id}\n >\n {section.title}\n </h2>\n {section.body.map(paragraph => (\n <p className=\"text-foreground max-w-2xl leading-relaxed\" key={paragraph}>\n {paragraph}\n </p>\n ))}\n </section>\n ))}\n </ReaderLayout>\n </Section>\n </Container>\n </Page>\n )\n}\n"
14951
+ }
14952
+ ]
14953
+ },
14769
14954
  {
14770
14955
  "id": "settings-page",
14771
14956
  "kind": "page",
@@ -14971,7 +15156,7 @@
14971
15156
  "files": [
14972
15157
  {
14973
15158
  "path": "blocks/chat-panel/chat-panel.tsx",
14974
- "source": "import type { ChatComposerStatus, ChatStepStatus } from '@atom63/ui-foundation'\nimport {\n Avatar,\n AvatarFallback,\n Button,\n ChatComposer,\n ChatMessage,\n ChatMessageList,\n ChatStep,\n ChatSteps,\n ChatTypingIndicator,\n CopyButton,\n} from '@atom63/ui-react'\nimport { Plus, Sparkles, SquarePen, ThumbsDown, ThumbsUp, X } from 'lucide-react'\nimport { type ReactNode, useEffect, useRef } from 'react'\n\nexport const template = {\n id: 'chat-panel',\n kind: 'block',\n title: 'Chat panel',\n description:\n 'An AI assistant beside the product: a side panel with a header, the transcript (user bubbles, plain assistant replies with tool steps, typing dots and copy and feedback actions), a start screen with suggestion chips when the conversation is empty, and the composer with send and stop and the AI disclaimer. ChatThread is the same conversation without the panel, for a full page. Wire it to @atom63/agent or any runtime through props.',\n category: 'ai',\n tags: [\n 'chat',\n 'assistant',\n 'ai',\n 'ai assistant',\n 'agent',\n 'copilot',\n 'conversation',\n 'messages',\n 'side panel',\n 'composer',\n 'prompt',\n 'suggestions',\n ],\n readiness: 'draft',\n} as const\n\nexport interface ChatPanelStep {\n label: string\n status: ChatStepStatus\n}\n\nexport interface ChatPanelMessage {\n from: 'assistant' | 'user'\n id: string\n /** Tool or thinking steps shown above an assistant reply. */\n steps?: readonly ChatPanelStep[]\n /** True while the reply is still arriving. */\n streaming?: boolean\n text: string\n}\n\nexport interface ChatThreadProps {\n /** A leading composer control, such as an attach button; a `+` button by default. */\n attach?: ReactNode\n /** The line under the composer. */\n disclaimer?: string\n /** The start screen's heading when there are no messages. */\n greeting?: string\n /**\n * `panel` fills a narrow column and gives replies an avatar; `page` centres a\n * 48rem reading column (the composer's width too) with replies at its full\n * width.\n */\n layout?: 'page' | 'panel'\n messages: readonly ChatPanelMessage[]\n /** Adds thumbs up and down to finished replies. */\n onFeedback?: (messageId: string, value: 'down' | 'up') => void\n onSend: (text: string) => void\n onStop?: () => void\n placeholder?: string\n /** `submitted` or `streaming` turns send into stop. */\n status?: ChatComposerStatus\n /** Starter prompts on the start screen; one tap sends it. */\n suggestions?: readonly string[]\n}\n\nconst assistantAvatar = (\n <Avatar size=\"sm\">\n <AvatarFallback>\n <Sparkles aria-hidden />\n </AvatarFallback>\n </Avatar>\n)\n\nfunction Reply({\n avatar,\n message,\n onFeedback,\n}: {\n avatar: boolean\n message: ChatPanelMessage\n onFeedback?: ChatThreadProps['onFeedback']\n}) {\n const running = message.steps?.some(step => step.status === 'running') ?? false\n const done = !message.streaming && message.text !== ''\n return (\n <ChatMessage\n actions={\n done ? (\n <>\n <CopyButton label=\"Copy reply\" size=\"icon-xs\" value={message.text} />\n {onFeedback ? (\n <>\n <Button\n aria-label=\"Good reply\"\n onClick={() => onFeedback(message.id, 'up')}\n size=\"icon-xs\"\n variant=\"ghost\"\n >\n <ThumbsUp aria-hidden />\n </Button>\n <Button\n aria-label=\"Bad reply\"\n onClick={() => onFeedback(message.id, 'down')}\n size=\"icon-xs\"\n variant=\"ghost\"\n >\n <ThumbsDown aria-hidden />\n </Button>\n </>\n ) : null}\n </>\n ) : null\n }\n avatar={avatar ? assistantAvatar : undefined}\n from=\"assistant\"\n streaming={message.streaming}\n >\n {message.steps?.length ? (\n <ChatSteps\n defaultOpen={running}\n label={running ? 'Working' : `Used ${message.steps.length} tools`}\n >\n {message.steps.map(step => (\n <ChatStep key={step.label} status={step.status}>\n {step.label}\n </ChatStep>\n ))}\n </ChatSteps>\n ) : null}\n {message.text === '' && message.streaming ? (\n <ChatTypingIndicator />\n ) : (\n <p className=\"whitespace-pre-wrap\">{message.text}</p>\n )}\n </ChatMessage>\n )\n}\n\n/*\n * The conversation: a scrolling transcript over the composer. With no\n * messages it shows the start screen, a greeting and suggestion chips. It\n * scrolls to the newest turn as turns arrive. It holds no conversation state:\n * the host passes the messages and status and handles send and stop, from\n * `@atom63/agent` (map each AgentMessage to { id, from: role, text:\n * getMessageText(message), streaming: status === 'streaming' }) or any other\n * runtime.\n */\nexport function ChatThread({\n attach,\n disclaimer = 'AI can make mistakes. Check important info.',\n greeting = 'How can I help?',\n layout = 'panel',\n messages,\n onFeedback,\n onSend,\n onStop,\n placeholder = 'Ask anything',\n status = 'idle',\n suggestions = [],\n}: ChatThreadProps) {\n const scroller = useRef<HTMLDivElement>(null)\n const last = messages.at(-1)\n const lastText = last?.text.length ?? 0\n\n useEffect(() => {\n const element = scroller.current\n if (element) element.scrollTop = element.scrollHeight\n }, [messages.length, lastText])\n\n const column = layout === 'page' ? 'mx-auto w-full max-w-3xl' : 'w-full'\n const composer = (\n <ChatComposer\n attach={\n attach ?? (\n <Button aria-label=\"Attach a file\" shape=\"round\" size=\"icon-sm\" variant=\"ghost\">\n <Plus aria-hidden />\n </Button>\n )\n }\n footnote={disclaimer}\n onStop={onStop}\n onSubmit={onSend}\n placeholder={placeholder}\n status={status}\n />\n )\n\n if (messages.length === 0) {\n return (\n <div className=\"flex min-h-0 flex-1 flex-col justify-center overflow-y-auto px-4 py-8\">\n <div className={`${column} flex flex-col gap-6`}>\n <h2\n className={`font-heading text-foreground text-center font-semibold ${\n layout === 'page' ? 'text-3xl' : 'text-xl'\n }`}\n >\n {greeting}\n </h2>\n {composer}\n {suggestions.length ? (\n <ul aria-label=\"Suggestions\" className=\"flex flex-wrap justify-center gap-2\">\n {suggestions.map(suggestion => (\n <li key={suggestion}>\n <Button\n onClick={() => onSend(suggestion)}\n shape=\"round\"\n size=\"sm\"\n variant=\"outline\"\n >\n {suggestion}\n </Button>\n </li>\n ))}\n </ul>\n ) : null}\n </div>\n </div>\n )\n }\n\n return (\n <div className=\"flex min-h-0 flex-1 flex-col\">\n <div className=\"min-h-0 flex-1 overflow-y-auto px-4 py-6\" ref={scroller}>\n <ChatMessageList aria-label=\"Conversation\" className={column} tabIndex={0}>\n {messages.map(message =>\n message.from === 'user' ? (\n <ChatMessage from=\"user\" key={message.id}>\n {message.text}\n </ChatMessage>\n ) : (\n <Reply\n avatar={layout === 'panel'}\n key={message.id}\n message={message}\n onFeedback={onFeedback}\n />\n )\n )}\n </ChatMessageList>\n </div>\n <div className=\"px-4 pb-4\">\n <div className={column}>{composer}</div>\n </div>\n </div>\n )\n}\n\nexport interface ChatPanelProps extends ChatThreadProps {\n /** Closes the panel; the close button is drawn only when it is given. */\n onClose?: () => void\n /** Starts a new conversation; the button is drawn only when it is given. */\n onNewChat?: () => void\n /** The panel's heading and the name of its region. */\n title?: string\n}\n\n/*\n * A side panel next to the product. The layout places it and sets its width\n * (about 24rem beside the page, or a Sheet on phones); it fills its height and\n * the transcript scrolls inside it.\n */\nexport function ChatPanel({ onClose, onNewChat, title = 'Assistant', ...thread }: ChatPanelProps) {\n return (\n <section\n aria-label={title}\n className=\"bg-background text-foreground flex h-full min-h-0 flex-col\"\n >\n <header className=\"border-border flex h-14 shrink-0 items-center gap-2 border-b px-4\">\n <Sparkles aria-hidden className=\"text-muted-foreground size-4\" />\n <h2 className=\"text-foreground text-sm font-semibold\">{title}</h2>\n <div className=\"ms-auto flex items-center gap-1\">\n {onNewChat ? (\n <Button aria-label=\"New chat\" onClick={onNewChat} size=\"icon-sm\" variant=\"ghost\">\n <SquarePen aria-hidden />\n </Button>\n ) : null}\n {onClose ? (\n <Button aria-label=\"Close assistant\" onClick={onClose} size=\"icon-sm\" variant=\"ghost\">\n <X aria-hidden />\n </Button>\n ) : null}\n </div>\n </header>\n <ChatThread {...thread} />\n </section>\n )\n}\n"
15159
+ "source": "import type { ChatComposerStatus, ChatStepStatus } from '@atom63/ui-foundation'\nimport {\n Avatar,\n AvatarFallback,\n Button,\n ChatComposer,\n ChatMessage,\n ChatMessageList,\n ChatStep,\n ChatSteps,\n ChatTypingIndicator,\n CopyButton,\n} from '@atom63/ui-react'\nimport { Plus, Sparkles, SquarePen, ThumbsDown, ThumbsUp, X } from 'lucide-react'\nimport { type ReactNode, useEffect, useRef } from 'react'\n\nexport const template = {\n id: 'chat-panel',\n kind: 'block',\n title: 'Chat panel',\n description:\n 'An AI assistant beside the product: a side panel with a header, the transcript (user bubbles, plain assistant replies with tool steps, typing dots and copy and feedback actions), a start screen with suggestion chips when the conversation is empty, and the composer with send and stop and the AI disclaimer. ChatThread is the same conversation without the panel, for a full page. Wire it to @atom63/agent or any runtime through props.',\n category: 'ai',\n tags: [\n 'chat',\n 'assistant',\n 'ai',\n 'ai assistant',\n 'agent',\n 'copilot',\n 'conversation',\n 'messages',\n 'side panel',\n 'composer',\n 'prompt',\n 'suggestions',\n ],\n readiness: 'draft',\n} as const\n\nexport interface ChatPanelStep {\n label: string\n status: ChatStepStatus\n}\n\nexport interface ChatPanelMessage {\n from: 'assistant' | 'user'\n id: string\n /** Tool or thinking steps shown above an assistant reply. */\n steps?: readonly ChatPanelStep[]\n /** True while the reply is still arriving. */\n streaming?: boolean\n text: string\n}\n\nexport interface ChatThreadProps {\n /** A leading composer control, such as an attach button; a `+` button by default. */\n attach?: ReactNode\n /** The line under the composer. */\n disclaimer?: string\n /** The start screen's heading when there are no messages. */\n greeting?: string\n /**\n * `panel` fills a narrow column and gives replies an avatar; `page` centres a\n * 48rem reading column (the composer's width too) with replies at its full\n * width.\n */\n layout?: 'page' | 'panel'\n messages: readonly ChatPanelMessage[]\n /** Adds thumbs up and down to finished replies. */\n onFeedback?: (messageId: string, value: 'down' | 'up') => void\n onSend: (text: string) => void\n onStop?: () => void\n placeholder?: string\n /** `submitted` or `streaming` turns send into stop. */\n status?: ChatComposerStatus\n /** Starter prompts on the start screen; one tap sends it. */\n suggestions?: readonly string[]\n}\n\nconst assistantAvatar = (\n <Avatar size=\"sm\">\n <AvatarFallback>\n <Sparkles aria-hidden />\n </AvatarFallback>\n </Avatar>\n)\n\nfunction Reply({\n avatar,\n message,\n onFeedback,\n}: {\n avatar: boolean\n message: ChatPanelMessage\n onFeedback?: ChatThreadProps['onFeedback']\n}) {\n const running = message.steps?.some(step => step.status === 'running') ?? false\n const done = !message.streaming && message.text !== ''\n return (\n <ChatMessage\n actions={\n done ? (\n <>\n <CopyButton label=\"Copy reply\" size=\"icon-xs\" value={message.text} />\n {onFeedback ? (\n <>\n <Button\n aria-label=\"Good reply\"\n onClick={() => onFeedback(message.id, 'up')}\n size=\"icon-xs\"\n tone=\"muted\"\n variant=\"ghost\"\n >\n <ThumbsUp aria-hidden />\n </Button>\n <Button\n aria-label=\"Bad reply\"\n onClick={() => onFeedback(message.id, 'down')}\n size=\"icon-xs\"\n tone=\"muted\"\n variant=\"ghost\"\n >\n <ThumbsDown aria-hidden />\n </Button>\n </>\n ) : null}\n </>\n ) : null\n }\n avatar={avatar ? assistantAvatar : undefined}\n from=\"assistant\"\n streaming={message.streaming}\n >\n {message.steps?.length ? (\n <ChatSteps\n defaultOpen={running}\n label={running ? 'Working' : `Used ${message.steps.length} tools`}\n >\n {message.steps.map(step => (\n <ChatStep key={step.label} status={step.status}>\n {step.label}\n </ChatStep>\n ))}\n </ChatSteps>\n ) : null}\n {message.text === '' && message.streaming ? (\n <ChatTypingIndicator />\n ) : (\n <p className=\"whitespace-pre-wrap\">{message.text}</p>\n )}\n </ChatMessage>\n )\n}\n\n/*\n * The conversation: a scrolling transcript over the composer. With no\n * messages it shows the start screen, a greeting and suggestion chips. It\n * scrolls to the newest turn as turns arrive. It holds no conversation state:\n * the host passes the messages and status and handles send and stop, from\n * `@atom63/agent` (map each AgentMessage to { id, from: role, text:\n * getMessageText(message), streaming: status === 'streaming' }) or any other\n * runtime.\n */\nexport function ChatThread({\n attach,\n disclaimer = 'AI can make mistakes. Check important info.',\n greeting = 'How can I help?',\n layout = 'panel',\n messages,\n onFeedback,\n onSend,\n onStop,\n placeholder = 'Ask anything',\n status = 'idle',\n suggestions = [],\n}: ChatThreadProps) {\n const scroller = useRef<HTMLDivElement>(null)\n const last = messages.at(-1)\n const lastText = last?.text.length ?? 0\n\n useEffect(() => {\n const element = scroller.current\n if (element) element.scrollTop = element.scrollHeight\n }, [messages.length, lastText])\n\n const column = layout === 'page' ? 'mx-auto w-full max-w-3xl' : 'w-full'\n const composer = (\n <ChatComposer\n attach={\n attach ?? (\n <Button\n aria-label=\"Attach a file\"\n shape=\"round\"\n size=\"icon-sm\"\n tone=\"muted\"\n variant=\"ghost\"\n >\n <Plus aria-hidden />\n </Button>\n )\n }\n footnote={disclaimer}\n onStop={onStop}\n onSubmit={onSend}\n placeholder={placeholder}\n status={status}\n />\n )\n\n if (messages.length === 0) {\n return (\n <div className=\"flex min-h-0 flex-1 flex-col justify-center overflow-y-auto px-4 py-8\">\n <div className={`${column} flex flex-col gap-6`}>\n <h2\n className={`font-heading text-foreground text-center font-semibold ${\n layout === 'page' ? 'text-3xl' : 'text-xl'\n }`}\n >\n {greeting}\n </h2>\n {composer}\n {suggestions.length ? (\n <ul aria-label=\"Suggestions\" className=\"flex flex-wrap justify-center gap-2\">\n {suggestions.map(suggestion => (\n <li key={suggestion}>\n <Button\n onClick={() => onSend(suggestion)}\n shape=\"round\"\n size=\"sm\"\n variant=\"outline\"\n >\n {suggestion}\n </Button>\n </li>\n ))}\n </ul>\n ) : null}\n </div>\n </div>\n )\n }\n\n return (\n <div className=\"flex min-h-0 flex-1 flex-col\">\n <div className=\"min-h-0 flex-1 overflow-y-auto px-4 py-6\" ref={scroller}>\n <ChatMessageList aria-label=\"Conversation\" className={column} tabIndex={0}>\n {messages.map(message =>\n message.from === 'user' ? (\n <ChatMessage from=\"user\" key={message.id}>\n {message.text}\n </ChatMessage>\n ) : (\n <Reply\n avatar={layout === 'panel'}\n key={message.id}\n message={message}\n onFeedback={onFeedback}\n />\n )\n )}\n </ChatMessageList>\n </div>\n <div className=\"px-4 pb-4\">\n <div className={column}>{composer}</div>\n </div>\n </div>\n )\n}\n\nexport interface ChatPanelProps extends ChatThreadProps {\n /** Closes the panel; the close button is drawn only when it is given. */\n onClose?: () => void\n /** Starts a new conversation; the button is drawn only when it is given. */\n onNewChat?: () => void\n /** The panel's heading and the name of its region. */\n title?: string\n}\n\n/*\n * A side panel next to the product. The layout places it and sets its width\n * (about 24rem beside the page, or a Sheet on phones); it fills its height and\n * the transcript scrolls inside it.\n */\nexport function ChatPanel({ onClose, onNewChat, title = 'Assistant', ...thread }: ChatPanelProps) {\n return (\n <section\n aria-label={title}\n className=\"bg-background text-foreground flex h-full min-h-0 flex-col\"\n >\n <header className=\"border-border flex h-14 shrink-0 items-center gap-2 border-b px-4\">\n <Sparkles aria-hidden className=\"text-muted-foreground size-4\" />\n <h2 className=\"text-foreground text-sm font-semibold\">{title}</h2>\n <div className=\"ms-auto flex items-center gap-1\">\n {onNewChat ? (\n <Button\n aria-label=\"New chat\"\n onClick={onNewChat}\n size=\"icon-sm\"\n tone=\"muted\"\n variant=\"ghost\"\n >\n <SquarePen aria-hidden />\n </Button>\n ) : null}\n {onClose ? (\n <Button\n aria-label=\"Close assistant\"\n onClick={onClose}\n size=\"icon-sm\"\n tone=\"muted\"\n variant=\"ghost\"\n >\n <X aria-hidden />\n </Button>\n ) : null}\n </div>\n </header>\n <ChatThread {...thread} />\n </section>\n )\n}\n"
14975
15160
  }
14976
15161
  ]
14977
15162
  },
@@ -15004,7 +15189,7 @@
15004
15189
  "files": [
15005
15190
  {
15006
15191
  "path": "blocks/data-table-section/data-table-section.tsx",
15007
- "source": "import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@atom63/ui-react'\nimport { SearchX } from 'lucide-react'\nimport type { ReactNode } from 'react'\n\nimport { EmptyState } from '../empty-state/empty-state'\n\nexport const template = {\n id: 'data-table-section',\n kind: 'block',\n title: 'Data table section',\n description:\n 'A collection shown as a table on wide screens and as stacked rows on phones, with a live result count, per-row actions and an empty state that offers a way out.',\n category: 'collections',\n tags: ['table', 'list', 'rows', 'responsive', 'empty state', 'results'],\n readiness: 'ready',\n} as const\n\nexport interface DataTableColumn<Row> {\n /** `end` for numbers and amounts, so digits line up. */\n align?: 'start' | 'end'\n cell: (row: Row) => ReactNode\n header: string\n key: string\n /** The table width at which this column first appears. */\n showFrom?: 'sm' | 'md' | 'lg'\n}\n\nexport interface DataTableEmpty {\n /** The next step, usually a button that clears the filters. */\n action?: ReactNode\n description: string\n title: string\n}\n\nexport interface DataTableSectionProps<Row> {\n /** Names the table and the phone list for assistive technology. */\n label: string\n /** The first column is the row's title in the phone layout. */\n columns: readonly DataTableColumn<Row>[]\n empty: DataTableEmpty\n getRowKey: (row: Row) => string\n /** Heading level of the empty state's title: one below the heading above the section. */\n headingLevel?: 2 | 3 | 4\n /** Product-specific phone composition; the table remains column-driven. */\n renderPhoneRow?: (row: Row) => ReactNode\n rowActions?: (row: Row) => ReactNode\n rows: readonly Row[]\n /** Highlights the open record without making the row itself interactive. */\n selectedRowKey?: string\n /** A short count such as \"12 of 25 invoices\", announced when it changes. */\n summary: string\n}\n\nconst alignClass = (align: DataTableColumn<unknown>['align']) =>\n align === 'end' ? 'text-end tabular-nums' : 'text-start'\n\nconst showFromClass = {\n sm: '',\n md: 'hidden md:table-cell',\n lg: 'hidden lg:table-cell',\n} as const\n\nconst columnClass = <Row,>(column: DataTableColumn<Row>) =>\n `${alignClass(column.align)} ${showFromClass[column.showFrom ?? 'sm']}`.trim()\n\n/*\n * A wide table does not fit a phone, so below `sm` each row becomes a stacked\n * item: the first column is its title and the rest are label and value pairs.\n * Only one layout is displayed at a time; the hidden one is out of the\n * accessibility tree.\n */\nexport function DataTableSection<Row>({\n columns,\n empty,\n getRowKey,\n headingLevel = 2,\n label,\n renderPhoneRow,\n rowActions,\n rows,\n selectedRowKey,\n summary,\n}: DataTableSectionProps<Row>) {\n const [titleColumn, ...detailColumns] = columns\n return (\n <div className=\"flex flex-col gap-3\">\n <p aria-live=\"polite\" className=\"text-muted-foreground text-sm\">\n {summary}\n </p>\n {rows.length === 0 ? (\n <EmptyState\n action={empty.action}\n description={empty.description}\n headingLevel={headingLevel}\n icon={<SearchX aria-hidden />}\n title={empty.title}\n />\n ) : (\n <>\n {/* A `frame` ancestor draws the table as a bordered card, like the phone list. */}\n <div className=\"hidden sm:block\" data-slot=\"frame\">\n <Table aria-label={label}>\n <TableHeader>\n <TableRow>\n {columns.map(column => (\n <TableHead className={columnClass(column)} key={column.key}>\n {column.header}\n </TableHead>\n ))}\n {rowActions ? (\n <TableHead className=\"w-0\">\n <span className=\"sr-only\">Actions</span>\n </TableHead>\n ) : null}\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(row => (\n <TableRow\n data-selected={getRowKey(row) === selectedRowKey ? '' : undefined}\n key={getRowKey(row)}\n >\n {columns.map(column => (\n <TableCell className={columnClass(column)} key={column.key}>\n {column.cell(row)}\n </TableCell>\n ))}\n {rowActions ? (\n <TableCell className=\"text-end\">{rowActions(row)}</TableCell>\n ) : null}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n <ul\n aria-label={label}\n className=\"divide-border border-border flex flex-col divide-y rounded-lg border sm:hidden\"\n >\n {rows.map(row => (\n <li\n className={renderPhoneRow ? undefined : 'flex items-start gap-3 p-4'}\n key={getRowKey(row)}\n >\n {renderPhoneRow ? (\n renderPhoneRow(row)\n ) : (\n <>\n <div className=\"flex min-w-0 flex-1 flex-col gap-2\">\n {titleColumn ? (\n <div className=\"text-foreground font-medium\">{titleColumn.cell(row)}</div>\n ) : null}\n <dl className=\"grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm\">\n {detailColumns.map(column => (\n <div className=\"contents\" key={column.key}>\n <dt className=\"text-muted-foreground\">{column.header}</dt>\n <dd className={column.align === 'end' ? 'tabular-nums' : undefined}>\n {column.cell(row)}\n </dd>\n </div>\n ))}\n </dl>\n </div>\n {rowActions ? rowActions(row) : null}\n </>\n )}\n </li>\n ))}\n </ul>\n </>\n )}\n </div>\n )\n}\n"
15192
+ "source": "import {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n type TableSort,\n type TableSortDirection,\n} from '@atom63/ui-react'\nimport { SearchX } from 'lucide-react'\nimport type { ReactNode } from 'react'\n\nimport { EmptyState } from '../empty-state/empty-state'\n\nexport const template = {\n id: 'data-table-section',\n kind: 'block',\n title: 'Data table section',\n description:\n 'A collection shown as a table on wide screens and as stacked rows on phones, with a live result count, per-row actions and an empty state that offers a way out.',\n category: 'collections',\n tags: ['table', 'list', 'rows', 'responsive', 'empty state', 'results'],\n readiness: 'ready',\n} as const\n\nexport interface DataTableColumn<Row> {\n /** `end` for numbers and amounts, so digits line up. */\n align?: 'start' | 'end'\n cell: (row: Row) => ReactNode\n header: string\n key: string\n /** Makes the header a sort button. Its `key` is the `sort.column` it reports; the caller\n * sorts the rows. */\n sortable?: boolean\n /** The direction a first press sorts this column in, such as `descending` for amounts. */\n firstSortDirection?: TableSortDirection\n /** The table width at which this column first appears. */\n showFrom?: 'sm' | 'md' | 'lg'\n}\n\nexport interface DataTableEmpty {\n /** The next step, usually a button that clears the filters. */\n action?: ReactNode\n description: string\n title: string\n}\n\nexport interface DataTableSectionProps<Row> {\n /** Names the table and the phone list for assistive technology. */\n label: string\n /** The first column is the row's title in the phone layout. */\n columns: readonly DataTableColumn<Row>[]\n empty: DataTableEmpty\n getRowKey: (row: Row) => string\n /** Heading level of the empty state's title: one below the heading above the section. */\n headingLevel?: 2 | 3 | 4\n /** Product-specific phone composition; the table remains column-driven. */\n renderPhoneRow?: (row: Row) => ReactNode\n rowActions?: (row: Row) => ReactNode\n rows: readonly Row[]\n /** Highlights the open record without making the row itself interactive. */\n selectedRowKey?: string\n /** A short count such as \"12 of 25 invoices\", announced when it changes. */\n summary: string\n /** The column the rows are sorted by (controlled). The caller sorts `rows`. */\n sort?: TableSort | null\n /** Called when a sortable header is pressed, with the sort to apply. */\n onSortChange?: (sort: TableSort) => void\n /** Shown under the rows in both layouts, usually a `Pagination`; the caller passes the page of\n * `rows` it shows. */\n pagination?: ReactNode\n}\n\nconst alignClass = (align: DataTableColumn<unknown>['align']) =>\n align === 'end' ? 'text-end tabular-nums' : 'text-start'\n\nconst showFromClass = {\n sm: '',\n md: 'hidden md:table-cell',\n lg: 'hidden lg:table-cell',\n} as const\n\nconst columnClass = <Row,>(column: DataTableColumn<Row>) =>\n `${alignClass(column.align)} ${showFromClass[column.showFrom ?? 'sm']}`.trim()\n\n/*\n * A wide table does not fit a phone, so below `sm` each row becomes a stacked\n * item: the first column is its title and the rest are label and value pairs.\n * Only one layout is displayed at a time; the hidden one is out of the\n * accessibility tree.\n */\nexport function DataTableSection<Row>({\n columns,\n empty,\n getRowKey,\n headingLevel = 2,\n label,\n onSortChange,\n pagination,\n renderPhoneRow,\n rowActions,\n rows,\n selectedRowKey,\n sort,\n summary,\n}: DataTableSectionProps<Row>) {\n const [titleColumn, ...detailColumns] = columns\n return (\n <div className=\"flex flex-col gap-3\">\n <p aria-live=\"polite\" className=\"text-muted-foreground text-sm\">\n {summary}\n </p>\n {rows.length === 0 ? (\n <EmptyState\n action={empty.action}\n description={empty.description}\n headingLevel={headingLevel}\n icon={<SearchX aria-hidden />}\n title={empty.title}\n />\n ) : (\n <>\n {/* A `frame` ancestor draws the table as a bordered card, like the phone list. */}\n <div className=\"hidden sm:block\" data-slot=\"frame\">\n <Table aria-label={label} onSortChange={onSortChange} sort={sort}>\n <TableHeader>\n <TableRow>\n {columns.map(column => (\n <TableHead\n className={columnClass(column)}\n firstSortDirection={column.firstSortDirection}\n key={column.key}\n sortKey={column.sortable ? column.key : undefined}\n >\n {column.header}\n </TableHead>\n ))}\n {rowActions ? (\n <TableHead className=\"w-0\">\n <span className=\"sr-only\">Actions</span>\n </TableHead>\n ) : null}\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map(row => (\n <TableRow\n data-selected={getRowKey(row) === selectedRowKey ? '' : undefined}\n key={getRowKey(row)}\n >\n {columns.map(column => (\n <TableCell className={columnClass(column)} key={column.key}>\n {column.cell(row)}\n </TableCell>\n ))}\n {rowActions ? (\n <TableCell className=\"text-end\">{rowActions(row)}</TableCell>\n ) : null}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n <ul\n aria-label={label}\n className=\"divide-border border-border flex flex-col divide-y rounded-lg border sm:hidden\"\n >\n {rows.map(row => (\n <li\n className={renderPhoneRow ? undefined : 'flex items-start gap-3 p-4'}\n key={getRowKey(row)}\n >\n {renderPhoneRow ? (\n renderPhoneRow(row)\n ) : (\n <>\n <div className=\"flex min-w-0 flex-1 flex-col gap-2\">\n {titleColumn ? (\n <div className=\"text-foreground font-medium\">{titleColumn.cell(row)}</div>\n ) : null}\n <dl className=\"grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm\">\n {detailColumns.map(column => (\n <div className=\"contents\" key={column.key}>\n <dt className=\"text-muted-foreground\">{column.header}</dt>\n <dd className={column.align === 'end' ? 'tabular-nums' : undefined}>\n {column.cell(row)}\n </dd>\n </div>\n ))}\n </dl>\n </div>\n {rowActions ? rowActions(row) : null}\n </>\n )}\n </li>\n ))}\n </ul>\n {pagination}\n </>\n )}\n </div>\n )\n}\n"
15008
15193
  }
15009
15194
  ]
15010
15195
  },
@@ -15095,7 +15280,7 @@
15095
15280
  "files": [
15096
15281
  {
15097
15282
  "path": "blocks/filter-bar/filter-bar.tsx",
15098
- "source": "import {\n Button,\n Field,\n FieldLabel,\n Input,\n Select,\n SelectItem,\n SelectPopup,\n SelectTrigger,\n SelectValue,\n} from '@atom63/ui-react'\nimport { useId } from 'react'\n\nexport const template = {\n id: 'filter-bar',\n kind: 'block',\n title: 'Filter bar',\n description:\n 'A labelled search field and one select filter above a collection, with a clear action that appears once a filter is set.',\n category: 'collections',\n tags: ['search', 'filter', 'toolbar', 'list', 'table'],\n readiness: 'ready',\n} as const\n\nexport interface FilterBarOption {\n label: string\n value: string\n}\n\nexport interface FilterBarProps {\n /** Shown as the filter's visible label, for example \"Status\". */\n filterLabel: string\n filterOptions: readonly FilterBarOption[]\n filterValue: string\n onClear: () => void\n onFilterChange: (value: string) => void\n onQueryChange: (query: string) => void\n query: string\n /** Shown as the search field's visible label, for example \"Search invoices\". */\n searchLabel: string\n searchPlaceholder?: string\n /** Whether any filter differs from its default; shows the clear action. */\n showClear: boolean\n}\n\n/*\n * Controls stack on a phone and sit on one row from `sm`, the search taking\n * the remaining width. Both fields keep a\n * visible label, the row is a search landmark, and the clear action is a\n * ghost button so the page's primary action stays the only strong one.\n */\nexport function FilterBar({\n filterLabel,\n filterOptions,\n filterValue,\n onClear,\n onFilterChange,\n onQueryChange,\n query,\n searchLabel,\n searchPlaceholder,\n showClear,\n}: FilterBarProps) {\n const searchId = useId()\n const filterLabelId = useId()\n return (\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-end\" role=\"search\">\n <Field className=\"sm:flex-1\">\n <FieldLabel htmlFor={searchId}>{searchLabel}</FieldLabel>\n <Input\n id={searchId}\n onChange={event => onQueryChange(event.target.value)}\n placeholder={searchPlaceholder}\n type=\"search\"\n value={query}\n />\n </Field>\n <Field className=\"sm:w-48\">\n <FieldLabel id={filterLabelId}>{filterLabel}</FieldLabel>\n <Select\n items={filterOptions}\n onValueChange={next => onFilterChange(next ?? filterOptions[0]?.value ?? '')}\n value={filterValue}\n >\n <SelectTrigger aria-labelledby={filterLabelId}>\n <SelectValue />\n </SelectTrigger>\n <SelectPopup>\n {filterOptions.map(option => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectPopup>\n </Select>\n </Field>\n {showClear ? (\n <Button onClick={onClear} variant=\"ghost\">\n Clear filters\n </Button>\n ) : null}\n </div>\n )\n}\n"
15283
+ "source": "import {\n Button,\n Field,\n FieldLabel,\n Input,\n Select,\n SelectItem,\n SelectPopup,\n SelectTrigger,\n SelectValue,\n} from '@atom63/ui-react'\nimport { useId } from 'react'\n\nexport const template = {\n id: 'filter-bar',\n kind: 'block',\n title: 'Filter bar',\n description:\n 'A labelled search field and one select filter above a collection, with a clear action that appears once a filter is set.',\n category: 'collections',\n tags: ['search', 'filter', 'toolbar', 'list', 'table'],\n readiness: 'ready',\n} as const\n\nexport interface FilterBarOption {\n label: string\n value: string\n}\n\nexport interface FilterBarProps {\n /** Shown as the filter's visible label, for example \"Status\". */\n filterLabel: string\n filterOptions: readonly FilterBarOption[]\n filterValue: string\n onClear: () => void\n onFilterChange: (value: string) => void\n onQueryChange: (query: string) => void\n query: string\n /** Shown as the search field's visible label, for example \"Search invoices\". */\n searchLabel: string\n searchPlaceholder?: string\n /** Whether any filter differs from its default; shows the clear action. */\n showClear: boolean\n}\n\n/*\n * Controls stack on a phone and sit on one row from `sm`, the search taking\n * the remaining width. Both fields keep a\n * visible label, the row is a search landmark, and the clear action is a\n * ghost button so the page's primary action stays the only strong one.\n */\nexport function FilterBar({\n filterLabel,\n filterOptions,\n filterValue,\n onClear,\n onFilterChange,\n onQueryChange,\n query,\n searchLabel,\n searchPlaceholder,\n showClear,\n}: FilterBarProps) {\n const searchId = useId()\n const filterLabelId = useId()\n return (\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-end\" role=\"search\">\n <Field className=\"sm:flex-1\">\n <FieldLabel htmlFor={searchId}>{searchLabel}</FieldLabel>\n <Input\n id={searchId}\n onChange={event => onQueryChange(event.target.value)}\n placeholder={searchPlaceholder}\n type=\"search\"\n value={query}\n />\n </Field>\n <Field className=\"sm:w-48\">\n <FieldLabel id={filterLabelId}>{filterLabel}</FieldLabel>\n <Select\n items={filterOptions}\n onValueChange={next => onFilterChange(next ?? filterOptions[0]?.value ?? '')}\n value={filterValue}\n >\n <SelectTrigger aria-labelledby={filterLabelId}>\n <SelectValue />\n </SelectTrigger>\n <SelectPopup>\n {filterOptions.map(option => (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ))}\n </SelectPopup>\n </Select>\n </Field>\n {showClear ? (\n <Button onClick={onClear} tone=\"muted\" variant=\"ghost\">\n Clear filters\n </Button>\n ) : null}\n </div>\n )\n}\n"
15099
15284
  }
15100
15285
  ]
15101
15286
  },
@@ -18648,7 +18833,7 @@
18648
18833
  "values": [
18649
18834
  {
18650
18835
  "scope": ":is(.dark, [data-a63-mode='dark'])",
18651
- "value": "var(--a63-action-primary)"
18836
+ "value": "var(--a63-brand-400)"
18652
18837
  },
18653
18838
  {
18654
18839
  "scope": ":root, .light, [data-a63-mode='light']",
@@ -18656,7 +18841,7 @@
18656
18841
  },
18657
18842
  {
18658
18843
  "scope": "[data-a63-brand], [data-a63-surface]",
18659
- "value": "var(--a63-action-primary)"
18844
+ "value": "var(--a63-if-light, var(--a63-action-primary)) var(--a63-if-dark, var(--a63-brand-400))"
18660
18845
  }
18661
18846
  ]
18662
18847
  },
@@ -18672,15 +18857,15 @@
18672
18857
  "values": [
18673
18858
  {
18674
18859
  "scope": ":is(.dark, [data-a63-mode='dark'])",
18675
- "value": "var(--color-teal-400)"
18860
+ "value": "oklch(from var(--a63-chart-1) 0.76 0.14 calc(h + 144))"
18676
18861
  },
18677
18862
  {
18678
18863
  "scope": ":root, .light, [data-a63-mode='light']",
18679
- "value": "var(--color-teal-500)"
18864
+ "value": "oklch(from var(--a63-chart-1) 0.6 0.15 calc(h + 144))"
18680
18865
  },
18681
18866
  {
18682
18867
  "scope": "[data-a63-brand], [data-a63-surface]",
18683
- "value": "var(--a63-if-light, var(--color-teal-500)) var(--a63-if-dark, var(--color-teal-400))"
18868
+ "value": "var(--a63-if-light, oklch(from var(--a63-chart-1) 0.6 0.15 calc(h + 144))) var(--a63-if-dark, oklch(from var(--a63-chart-1) 0.76 0.14 calc(h + 144)))"
18684
18869
  }
18685
18870
  ]
18686
18871
  },
@@ -18696,15 +18881,15 @@
18696
18881
  "values": [
18697
18882
  {
18698
18883
  "scope": ":is(.dark, [data-a63-mode='dark'])",
18699
- "value": "var(--color-amber-400)"
18884
+ "value": "oklch(from var(--a63-chart-1) 0.7 0.13 calc(h + 288))"
18700
18885
  },
18701
18886
  {
18702
18887
  "scope": ":root, .light, [data-a63-mode='light']",
18703
- "value": "var(--color-amber-500)"
18888
+ "value": "oklch(from var(--a63-chart-1) 0.54 0.13 calc(h + 288))"
18704
18889
  },
18705
18890
  {
18706
18891
  "scope": "[data-a63-brand], [data-a63-surface]",
18707
- "value": "var(--a63-if-light, var(--color-amber-500)) var(--a63-if-dark, var(--color-amber-400))"
18892
+ "value": "var(--a63-if-light, oklch(from var(--a63-chart-1) 0.54 0.13 calc(h + 288))) var(--a63-if-dark, oklch(from var(--a63-chart-1) 0.7 0.13 calc(h + 288)))"
18708
18893
  }
18709
18894
  ]
18710
18895
  },
@@ -18720,15 +18905,15 @@
18720
18905
  "values": [
18721
18906
  {
18722
18907
  "scope": ":is(.dark, [data-a63-mode='dark'])",
18723
- "value": "var(--color-violet-400)"
18908
+ "value": "oklch(from var(--a63-chart-1) 0.82 0.13 calc(h + 216))"
18724
18909
  },
18725
18910
  {
18726
18911
  "scope": ":root, .light, [data-a63-mode='light']",
18727
- "value": "var(--color-violet-500)"
18912
+ "value": "oklch(from var(--a63-chart-1) 0.58 0.14 calc(h + 216))"
18728
18913
  },
18729
18914
  {
18730
18915
  "scope": "[data-a63-brand], [data-a63-surface]",
18731
- "value": "var(--a63-if-light, var(--color-violet-500)) var(--a63-if-dark, var(--color-violet-400))"
18916
+ "value": "var(--a63-if-light, oklch(from var(--a63-chart-1) 0.58 0.14 calc(h + 216))) var(--a63-if-dark, oklch(from var(--a63-chart-1) 0.82 0.13 calc(h + 216)))"
18732
18917
  }
18733
18918
  ]
18734
18919
  },
@@ -18744,15 +18929,15 @@
18744
18929
  "values": [
18745
18930
  {
18746
18931
  "scope": ":is(.dark, [data-a63-mode='dark'])",
18747
- "value": "var(--color-rose-400)"
18932
+ "value": "oklch(from var(--a63-chart-1) 0.68 0.15 calc(h + 72))"
18748
18933
  },
18749
18934
  {
18750
18935
  "scope": ":root, .light, [data-a63-mode='light']",
18751
- "value": "var(--color-rose-500)"
18936
+ "value": "oklch(from var(--a63-chart-1) 0.5 0.16 calc(h + 72))"
18752
18937
  },
18753
18938
  {
18754
18939
  "scope": "[data-a63-brand], [data-a63-surface]",
18755
- "value": "var(--a63-if-light, var(--color-rose-500)) var(--a63-if-dark, var(--color-rose-400))"
18940
+ "value": "var(--a63-if-light, oklch(from var(--a63-chart-1) 0.5 0.16 calc(h + 72))) var(--a63-if-dark, oklch(from var(--a63-chart-1) 0.68 0.15 calc(h + 72)))"
18756
18941
  }
18757
18942
  ]
18758
18943
  },
@@ -23469,15 +23654,15 @@
23469
23654
  },
23470
23655
  {
23471
23656
  "scope": ":is(.dark, [data-a63-mode='dark'])",
23472
- "value": "var(--surface-dark-11)"
23657
+ "value": "color-mix( in oklab, var(--surface-dark-11) calc(100% - var(--a63-surface-tint) * 0.3), var(--a63-brand-100) calc(var(--a63-surface-tint) * 0.3) )"
23473
23658
  },
23474
23659
  {
23475
23660
  "scope": ":root, .light, [data-a63-mode='light']",
23476
- "value": "var(--surface-light-11)"
23661
+ "value": "color-mix( in oklab, var(--surface-light-11) calc(100% - var(--a63-surface-tint) * 0.3), var(--a63-brand-800) calc(var(--a63-surface-tint) * 0.3) )"
23477
23662
  },
23478
23663
  {
23479
23664
  "scope": "[data-a63-brand], [data-a63-surface]",
23480
- "value": "var(--a63-if-light, var(--surface-light-11)) var(--a63-if-dark, var(--surface-dark-11))"
23665
+ "value": "var( --a63-if-light, color-mix( in oklab, var(--surface-light-11) calc(100% - var(--a63-surface-tint) * 0.3), var(--a63-brand-800) calc(var(--a63-surface-tint) * 0.3) ) ) var( --a63-if-dark, color-mix( in oklab, var(--surface-dark-11) calc(100% - var(--a63-surface-tint) * 0.3), var(--a63-brand-100) calc(var(--a63-surface-tint) * 0.3) ) )"
23481
23666
  }
23482
23667
  ]
23483
23668
  },
@@ -23497,23 +23682,23 @@
23497
23682
  },
23498
23683
  {
23499
23684
  "scope": "[data-a63-theme='terminal']:is(.dark, [data-a63-mode='dark']), [data-a63-theme='terminal'] :is(.dark, [data-a63-mode='dark'])",
23500
- "value": "color-mix(in oklab, var(--a63-text-accent) 40%, var(--surface-dark-10))"
23685
+ "value": "color-mix( in oklab, color-mix(in oklab, var(--a63-text-accent) 40%, var(--surface-dark-10)) calc(100% - var(--a63-surface-tint) * 0.3), var(--a63-brand-100) calc(var(--a63-surface-tint) * 0.3) )"
23501
23686
  },
23502
23687
  {
23503
23688
  "scope": "[data-a63-theme='terminal']:is([data-a63-brand], [data-a63-surface]), [data-a63-theme='terminal'] :is([data-a63-brand], [data-a63-surface])",
23504
- "value": "var( --a63-if-light, color-mix(in oklch, var(--a63-action-primary) 80%, black) ) var(--a63-if-dark, color-mix(in oklab, var(--a63-text-accent) 40%, var(--surface-dark-10)))"
23689
+ "value": "var( --a63-if-light, color-mix(in oklch, var(--a63-action-primary) 80%, black) ) var( --a63-if-dark, color-mix( in oklab, color-mix(in oklab, var(--a63-text-accent) 40%, var(--surface-dark-10)) calc(100% - var(--a63-surface-tint) * 0.3), var(--a63-brand-100) calc(var(--a63-surface-tint) * 0.3) ) )"
23505
23690
  },
23506
23691
  {
23507
23692
  "scope": ":is(.dark, [data-a63-mode='dark'])",
23508
- "value": "color-mix(in oklab, var(--surface-dark-11) 30%, var(--surface-dark-10))"
23693
+ "value": "color-mix( in oklab, color-mix(in oklab, var(--surface-dark-11) 30%, var(--surface-dark-10)) calc(100% - var(--a63-surface-tint) * 0.3), var(--a63-brand-100) calc(var(--a63-surface-tint) * 0.3) )"
23509
23694
  },
23510
23695
  {
23511
23696
  "scope": ":root, .light, [data-a63-mode='light']",
23512
- "value": "color-mix(in oklab, var(--surface-light-11) 70%, var(--surface-light-10))"
23697
+ "value": "color-mix( in oklab, color-mix(in oklab, var(--surface-light-11) 70%, var(--surface-light-10)) calc(100% - var(--a63-surface-tint) * 0.3), var(--a63-brand-800) calc(var(--a63-surface-tint) * 0.3) )"
23513
23698
  },
23514
23699
  {
23515
23700
  "scope": "[data-a63-brand], [data-a63-surface]",
23516
- "value": "var( --a63-if-light, color-mix(in oklab, var(--surface-light-11) 70%, var(--surface-light-10)) ) var(--a63-if-dark, color-mix(in oklab, var(--surface-dark-11) 30%, var(--surface-dark-10)))"
23701
+ "value": "var( --a63-if-light, color-mix( in oklab, color-mix(in oklab, var(--surface-light-11) 70%, var(--surface-light-10)) calc(100% - var(--a63-surface-tint) * 0.3), var(--a63-brand-800) calc(var(--a63-surface-tint) * 0.3) ) ) var( --a63-if-dark, color-mix( in oklab, color-mix(in oklab, var(--surface-dark-11) 30%, var(--surface-dark-10)) calc(100% - var(--a63-surface-tint) * 0.3), var(--a63-brand-100) calc(var(--a63-surface-tint) * 0.3) ) )"
23517
23702
  }
23518
23703
  ]
23519
23704
  },