@contui/ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +30 -0
- package/README.md +150 -2
- package/cli/contui.mjs +250 -0
- package/dist/charts/area-chart.d.ts +8 -0
- package/dist/charts/area-chart.js +9 -0
- package/dist/charts/bar-chart.d.ts +9 -0
- package/dist/charts/bar-chart.js +10 -0
- package/dist/charts/bubble-chart.d.ts +60 -0
- package/dist/charts/bubble-chart.js +392 -0
- package/dist/charts/bullet-chart.d.ts +53 -0
- package/dist/charts/bullet-chart.js +123 -0
- package/dist/charts/candlestick-chart.d.ts +77 -0
- package/dist/charts/candlestick-chart.js +558 -0
- package/dist/charts/cartesian.d.ts +121 -0
- package/dist/charts/cartesian.js +625 -0
- package/dist/charts/chart-card.d.ts +80 -0
- package/dist/charts/chart-card.js +114 -0
- package/dist/charts/donut-chart.d.ts +40 -0
- package/dist/charts/donut-chart.js +88 -0
- package/dist/charts/funnel-chart.d.ts +16 -0
- package/dist/charts/funnel-chart.js +164 -0
- package/dist/charts/horizontal-bar-chart.d.ts +67 -0
- package/dist/charts/horizontal-bar-chart.js +481 -0
- package/dist/charts/index.d.ts +21 -0
- package/dist/charts/index.js +32 -0
- package/dist/charts/legend.d.ts +23 -0
- package/dist/charts/legend.js +22 -0
- package/dist/charts/lib/candlestick-window.d.ts +15 -0
- package/dist/charts/lib/candlestick-window.js +23 -0
- package/dist/charts/lib/color.d.ts +39 -0
- package/dist/charts/lib/color.js +83 -0
- package/dist/charts/lib/format.d.ts +11 -0
- package/dist/charts/lib/format.js +33 -0
- package/dist/charts/lib/frame.d.ts +6 -0
- package/dist/charts/lib/frame.js +6 -0
- package/dist/charts/lib/layout.d.ts +11 -0
- package/dist/charts/lib/layout.js +71 -0
- package/dist/charts/lib/path.d.ts +35 -0
- package/dist/charts/lib/path.js +203 -0
- package/dist/charts/lib/scale.d.ts +41 -0
- package/dist/charts/lib/scale.js +80 -0
- package/dist/charts/lib/use-active.d.ts +18 -0
- package/dist/charts/lib/use-active.js +71 -0
- package/dist/charts/lib/use-size.d.ts +9 -0
- package/dist/charts/lib/use-size.js +40 -0
- package/dist/charts/line-chart.d.ts +7 -0
- package/dist/charts/line-chart.js +8 -0
- package/dist/charts/radar-chart.d.ts +27 -0
- package/dist/charts/radar-chart.js +165 -0
- package/dist/charts/rose-chart.d.ts +35 -0
- package/dist/charts/rose-chart.js +242 -0
- package/dist/charts/sparkline.d.ts +35 -0
- package/dist/charts/sparkline.js +110 -0
- package/dist/charts/tooltip.d.ts +35 -0
- package/dist/charts/tooltip.js +22 -0
- package/dist/charts/treemap.d.ts +28 -0
- package/dist/charts/treemap.js +103 -0
- package/dist/charts/uptime-strip.d.ts +40 -0
- package/dist/charts/uptime-strip.js +178 -0
- package/dist/components/accordion.d.ts +31 -0
- package/dist/components/accordion.js +34 -0
- package/dist/components/activity-item.d.ts +12 -0
- package/dist/components/activity-item.js +6 -0
- package/dist/components/alert.d.ts +21 -0
- package/dist/components/alert.js +58 -0
- package/dist/components/assistant-answer.d.ts +52 -0
- package/dist/components/assistant-answer.js +40 -0
- package/dist/components/assistant-prompt.d.ts +63 -0
- package/dist/components/assistant-prompt.js +122 -0
- package/dist/components/avatar.d.ts +28 -0
- package/dist/components/avatar.js +75 -0
- package/dist/components/badge.d.ts +16 -0
- package/dist/components/badge.js +33 -0
- package/dist/components/bar-list.d.ts +65 -0
- package/dist/components/bar-list.js +119 -0
- package/dist/components/block-slider.d.ts +43 -0
- package/dist/components/block-slider.js +63 -0
- package/dist/components/branch-graph.d.ts +87 -0
- package/dist/components/branch-graph.js +231 -0
- package/dist/components/breadcrumb.d.ts +41 -0
- package/dist/components/breadcrumb.js +53 -0
- package/dist/components/button.d.ts +23 -0
- package/dist/components/button.js +108 -0
- package/dist/components/calendar.d.ts +5 -0
- package/dist/components/calendar.js +90 -0
- package/dist/components/card.d.ts +65 -0
- package/dist/components/card.js +104 -0
- package/dist/components/chat-attachment.d.ts +47 -0
- package/dist/components/chat-attachment.js +63 -0
- package/dist/components/chat-event.d.ts +7 -0
- package/dist/components/chat-event.js +7 -0
- package/dist/components/chat-message.d.ts +59 -0
- package/dist/components/chat-message.js +91 -0
- package/dist/components/chat-reference.d.ts +20 -0
- package/dist/components/chat-reference.js +41 -0
- package/dist/components/chat-shared.d.ts +21 -0
- package/dist/components/chat-shared.js +23 -0
- package/dist/components/chat-suggestions.d.ts +59 -0
- package/dist/components/chat-suggestions.js +88 -0
- package/dist/components/chat-thread.d.ts +39 -0
- package/dist/components/chat-thread.js +172 -0
- package/dist/components/chat-typing.d.ts +35 -0
- package/dist/components/chat-typing.js +66 -0
- package/dist/components/checkbox.d.ts +18 -0
- package/dist/components/checkbox.js +33 -0
- package/dist/components/checklist.d.ts +26 -0
- package/dist/components/checklist.js +18 -0
- package/dist/components/chip.d.ts +29 -0
- package/dist/components/chip.js +61 -0
- package/dist/components/code-input.d.ts +40 -0
- package/dist/components/code-input.js +285 -0
- package/dist/components/color-picker.d.ts +38 -0
- package/dist/components/color-picker.js +855 -0
- package/dist/components/combobox.d.ts +75 -0
- package/dist/components/combobox.js +112 -0
- package/dist/components/command-menu.d.ts +58 -0
- package/dist/components/command-menu.js +166 -0
- package/dist/components/copy-button.d.ts +16 -0
- package/dist/components/copy-button.js +31 -0
- package/dist/components/data-grid.d.ts +50 -0
- package/dist/components/data-grid.js +599 -0
- package/dist/components/date-picker.d.ts +109 -0
- package/dist/components/date-picker.js +268 -0
- package/dist/components/description-list.d.ts +12 -0
- package/dist/components/description-list.js +10 -0
- package/dist/components/dialog.d.ts +57 -0
- package/dist/components/dialog.js +140 -0
- package/dist/components/dock.d.ts +45 -0
- package/dist/components/dock.js +79 -0
- package/dist/components/drop-zone.d.ts +46 -0
- package/dist/components/drop-zone.js +101 -0
- package/dist/components/dropdown-menu.d.ts +50 -0
- package/dist/components/dropdown-menu.js +78 -0
- package/dist/components/editable-cell.d.ts +34 -0
- package/dist/components/editable-cell.js +89 -0
- package/dist/components/empty-state.d.ts +17 -0
- package/dist/components/empty-state.js +9 -0
- package/dist/components/field.d.ts +43 -0
- package/dist/components/field.js +75 -0
- package/dist/components/filter-condition.d.ts +188 -0
- package/dist/components/filter-condition.js +113 -0
- package/dist/components/filter-menu.d.ts +57 -0
- package/dist/components/filter-menu.js +46 -0
- package/dist/components/header-bar.d.ts +84 -0
- package/dist/components/header-bar.js +94 -0
- package/dist/components/hold-button.d.ts +15 -0
- package/dist/components/hold-button.js +88 -0
- package/dist/components/icon-tile.d.ts +12 -0
- package/dist/components/icon-tile.js +29 -0
- package/dist/components/info-tip.d.ts +13 -0
- package/dist/components/info-tip.js +26 -0
- package/dist/components/input.d.ts +17 -0
- package/dist/components/input.js +83 -0
- package/dist/components/kbd.d.ts +6 -0
- package/dist/components/kbd.js +7 -0
- package/dist/components/menu-item.d.ts +56 -0
- package/dist/components/menu-item.js +94 -0
- package/dist/components/message-composer.d.ts +75 -0
- package/dist/components/message-composer.js +199 -0
- package/dist/components/nav-rail.d.ts +31 -0
- package/dist/components/nav-rail.js +85 -0
- package/dist/components/notice.d.ts +45 -0
- package/dist/components/notice.js +66 -0
- package/dist/components/optimistic-undo.d.ts +28 -0
- package/dist/components/optimistic-undo.js +43 -0
- package/dist/components/option-row.d.ts +15 -0
- package/dist/components/option-row.js +14 -0
- package/dist/components/page-content.d.ts +11 -0
- package/dist/components/page-content.js +31 -0
- package/dist/components/pagination.d.ts +34 -0
- package/dist/components/pagination.js +41 -0
- package/dist/components/popover.d.ts +27 -0
- package/dist/components/popover.js +25 -0
- package/dist/components/progress.d.ts +33 -0
- package/dist/components/progress.js +75 -0
- package/dist/components/radio-group.d.ts +7 -0
- package/dist/components/radio-group.js +33 -0
- package/dist/components/readonly-field.d.ts +33 -0
- package/dist/components/readonly-field.js +80 -0
- package/dist/components/segmented-control.d.ts +21 -0
- package/dist/components/segmented-control.js +108 -0
- package/dist/components/select.d.ts +42 -0
- package/dist/components/select.js +86 -0
- package/dist/components/separator.d.ts +10 -0
- package/dist/components/separator.js +7 -0
- package/dist/components/setting-row.d.ts +53 -0
- package/dist/components/setting-row.js +93 -0
- package/dist/components/sidebar-switcher.d.ts +47 -0
- package/dist/components/sidebar-switcher.js +20 -0
- package/dist/components/sidebar.d.ts +220 -0
- package/dist/components/sidebar.js +327 -0
- package/dist/components/skeleton.d.ts +18 -0
- package/dist/components/skeleton.js +23 -0
- package/dist/components/slider.d.ts +15 -0
- package/dist/components/slider.js +28 -0
- package/dist/components/spinner.d.ts +14 -0
- package/dist/components/spinner.js +19 -0
- package/dist/components/status-dot.d.ts +24 -0
- package/dist/components/status-dot.js +35 -0
- package/dist/components/stepper.d.ts +60 -0
- package/dist/components/stepper.js +197 -0
- package/dist/components/switch.d.ts +9 -0
- package/dist/components/switch.js +26 -0
- package/dist/components/table-cell.d.ts +38 -0
- package/dist/components/table-cell.js +107 -0
- package/dist/components/table-context.d.ts +48 -0
- package/dist/components/table-context.js +69 -0
- package/dist/components/table-head.d.ts +42 -0
- package/dist/components/table-head.js +188 -0
- package/dist/components/table-tree.d.ts +96 -0
- package/dist/components/table-tree.js +137 -0
- package/dist/components/table.d.ts +78 -0
- package/dist/components/table.js +119 -0
- package/dist/components/tabs.d.ts +27 -0
- package/dist/components/tabs.js +79 -0
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/textarea.js +20 -0
- package/dist/components/theme.d.ts +41 -0
- package/dist/components/theme.js +60 -0
- package/dist/components/thinking.d.ts +68 -0
- package/dist/components/thinking.js +94 -0
- package/dist/components/toast.d.ts +39 -0
- package/dist/components/toast.js +110 -0
- package/dist/components/toolbar.d.ts +25 -0
- package/dist/components/toolbar.js +92 -0
- package/dist/components/tooltip.d.ts +23 -0
- package/dist/components/tooltip.js +27 -0
- package/dist/components/top-nav.d.ts +129 -0
- package/dist/components/top-nav.js +211 -0
- package/dist/components/truncate.d.ts +29 -0
- package/dist/components/truncate.js +138 -0
- package/dist/deprecated.d.ts +43 -0
- package/dist/deprecated.js +47 -0
- package/dist/index.d.ts +93 -0
- package/dist/index.js +93 -0
- package/dist/lib/cn.d.ts +5 -0
- package/dist/lib/cn.js +14 -0
- package/dist/lib/color.d.ts +136 -0
- package/dist/lib/color.js +307 -0
- package/dist/lib/contrast.d.ts +53 -0
- package/dist/lib/contrast.js +169 -0
- package/dist/lib/create-theme.d.ts +240 -0
- package/dist/lib/create-theme.js +461 -0
- package/dist/lib/harmony.d.ts +102 -0
- package/dist/lib/harmony.js +426 -0
- package/dist/lib/import-theme.d.ts +22 -0
- package/dist/lib/import-theme.js +221 -0
- package/dist/lib/overflow-scroll.d.ts +25 -0
- package/dist/lib/overflow-scroll.js +66 -0
- package/dist/lib/radio-toggle-render.d.ts +3 -0
- package/dist/lib/radio-toggle-render.js +9 -0
- package/dist/lib/reorder.d.ts +38 -0
- package/dist/lib/reorder.js +193 -0
- package/dist/lib/spacing.d.ts +101 -0
- package/dist/lib/spacing.js +118 -0
- package/dist/lib/tailwind-palette.d.ts +5 -0
- package/dist/lib/tailwind-palette.js +351 -0
- package/dist/lib/truncate.d.ts +18 -0
- package/dist/lib/truncate.js +69 -0
- package/dist/lib/use-single-value.d.ts +5 -0
- package/dist/lib/use-single-value.js +17 -0
- package/dist/styles.css +7988 -0
- package/mcp/server.mjs +87590 -0
- package/package.json +58 -5
- package/skills/continuum-fix-padding/SKILL.md +69 -0
- package/skills/continuum-fix-padding/scripts/compute.ts +155 -0
- package/skills/continuum-fix-padding/scripts/spacing.ts +189 -0
- package/skills/continuum-taste/SKILL.md +186 -0
- package/skills/continuum-taste/assets/tokens.css +647 -0
- package/skills/continuum-taste/references/charts.md +375 -0
- package/skills/continuum-taste/references/components.md +1369 -0
- package/skills/continuum-taste/references/foundations.md +539 -0
- package/skills/continuum-taste/references/media/canvas.md +75 -0
- package/skills/continuum-taste/references/media/css.md +61 -0
- package/skills/continuum-taste/references/media/react.md +161 -0
- package/skills/continuum-taste/references/method.md +87 -0
- package/skills/continuum-taste/references/pages.md +391 -0
- package/skills/continuum-taste/references/patterns.md +77 -0
- package/skills/continuum-taste/references/screens/agent.tsx +450 -0
- package/skills/continuum-taste/references/screens/analytics-overview.tsx +377 -0
- package/skills/continuum-taste/references/screens/checkout-funnel.tsx +193 -0
- package/skills/continuum-taste/references/screens/customer.tsx +475 -0
- package/skills/continuum-taste/references/screens/customers.tsx +608 -0
- package/skills/continuum-taste/references/screens/index.tsx +72 -0
- package/skills/continuum-taste/references/screens/invoice-editor.tsx +558 -0
- package/skills/continuum-taste/references/screens/new-customer.tsx +205 -0
- package/skills/continuum-taste/references/screens/overview.tsx +196 -0
- package/skills/continuum-taste/references/screens/report-generator.tsx +329 -0
- package/skills/continuum-taste/references/screens/risk-report.tsx +577 -0
- package/skills/continuum-taste/references/screens/sequence-editor.tsx +455 -0
- package/skills/continuum-taste/references/screens/settings.tsx +288 -0
- package/skills/continuum-taste/references/screens/shared.tsx +204 -0
- package/skills/continuum-taste/references/screens/sign-in.tsx +104 -0
- package/skills/continuum-taste/references/screens/workspace.tsx +596 -0
- package/skills/continuum-taste/references/theming.md +95 -0
- package/src/charts/area-chart.tsx +17 -0
- package/src/charts/bar-chart.tsx +15 -0
- package/src/charts/bubble-chart.tsx +913 -0
- package/src/charts/bullet-chart.tsx +419 -0
- package/src/charts/candlestick-chart.tsx +1242 -0
- package/src/charts/cartesian.tsx +1437 -0
- package/src/charts/chart-card.tsx +394 -0
- package/src/charts/donut-chart.tsx +299 -0
- package/src/charts/funnel-chart.tsx +373 -0
- package/src/charts/horizontal-bar-chart.tsx +991 -0
- package/src/charts/index.ts +76 -0
- package/src/charts/legend.tsx +59 -0
- package/src/charts/lib/candlestick-window.ts +42 -0
- package/src/charts/lib/color.ts +110 -0
- package/src/charts/lib/format.ts +42 -0
- package/src/charts/lib/frame.ts +6 -0
- package/src/charts/lib/layout.ts +78 -0
- package/src/charts/lib/path.ts +225 -0
- package/src/charts/lib/scale.ts +91 -0
- package/src/charts/lib/use-active.ts +87 -0
- package/src/charts/lib/use-size.ts +45 -0
- package/src/charts/line-chart.tsx +16 -0
- package/src/charts/radar-chart.tsx +485 -0
- package/src/charts/rose-chart.tsx +553 -0
- package/src/charts/sparkline.tsx +293 -0
- package/src/charts/tooltip.tsx +105 -0
- package/src/charts/treemap.tsx +271 -0
- package/src/charts/uptime-strip.tsx +469 -0
- package/src/components/accordion.tsx +136 -0
- package/src/components/activity-item.tsx +43 -0
- package/src/components/alert.tsx +135 -0
- package/src/components/assistant-answer.tsx +185 -0
- package/src/components/assistant-prompt.tsx +352 -0
- package/src/components/avatar.tsx +157 -0
- package/src/components/badge.tsx +55 -0
- package/src/components/bar-list.tsx +350 -0
- package/src/components/block-slider.tsx +189 -0
- package/src/components/branch-graph.tsx +580 -0
- package/src/components/breadcrumb.tsx +173 -0
- package/src/components/button.tsx +157 -0
- package/src/components/calendar.tsx +154 -0
- package/src/components/card.tsx +296 -0
- package/src/components/chat-attachment.tsx +255 -0
- package/src/components/chat-event.tsx +34 -0
- package/src/components/chat-message.tsx +332 -0
- package/src/components/chat-reference.tsx +100 -0
- package/src/components/chat-shared.ts +41 -0
- package/src/components/chat-suggestions.tsx +188 -0
- package/src/components/chat-thread.tsx +348 -0
- package/src/components/chat-typing.tsx +155 -0
- package/src/components/checkbox.tsx +83 -0
- package/src/components/checklist.tsx +146 -0
- package/src/components/chip.tsx +152 -0
- package/src/components/code-input.tsx +406 -0
- package/src/components/color-picker.tsx +1385 -0
- package/src/components/combobox.tsx +420 -0
- package/src/components/command-menu.tsx +405 -0
- package/src/components/copy-button.tsx +87 -0
- package/src/components/data-grid.tsx +965 -0
- package/src/components/date-picker.tsx +652 -0
- package/src/components/description-list.tsx +39 -0
- package/src/components/dialog.tsx +367 -0
- package/src/components/dock.tsx +192 -0
- package/src/components/drop-zone.tsx +283 -0
- package/src/components/dropdown-menu.tsx +323 -0
- package/src/components/editable-cell.tsx +219 -0
- package/src/components/empty-state.tsx +50 -0
- package/src/components/field.tsx +148 -0
- package/src/components/filter-condition.tsx +463 -0
- package/src/components/filter-menu.tsx +196 -0
- package/src/components/header-bar.tsx +220 -0
- package/src/components/hold-button.tsx +146 -0
- package/src/components/icon-tile.tsx +43 -0
- package/src/components/info-tip.tsx +87 -0
- package/src/components/input.tsx +136 -0
- package/src/components/kbd.tsx +17 -0
- package/src/components/menu-item.tsx +216 -0
- package/src/components/message-composer.tsx +458 -0
- package/src/components/nav-rail.tsx +235 -0
- package/src/components/notice.tsx +133 -0
- package/src/components/optimistic-undo.ts +68 -0
- package/src/components/option-row.tsx +54 -0
- package/src/components/page-content.tsx +44 -0
- package/src/components/pagination.tsx +182 -0
- package/src/components/popover.tsx +113 -0
- package/src/components/progress.tsx +222 -0
- package/src/components/radio-group.tsx +80 -0
- package/src/components/readonly-field.tsx +251 -0
- package/src/components/segmented-control.tsx +205 -0
- package/src/components/select.tsx +259 -0
- package/src/components/separator.tsx +30 -0
- package/src/components/setting-row.tsx +277 -0
- package/src/components/sidebar-switcher.tsx +134 -0
- package/src/components/sidebar.tsx +804 -0
- package/src/components/skeleton.tsx +57 -0
- package/src/components/slider.tsx +106 -0
- package/src/components/spinner.tsx +43 -0
- package/src/components/status-dot.tsx +100 -0
- package/src/components/stepper.tsx +459 -0
- package/src/components/switch.tsx +54 -0
- package/src/components/table-cell.tsx +239 -0
- package/src/components/table-context.ts +135 -0
- package/src/components/table-head.tsx +393 -0
- package/src/components/table-tree.tsx +357 -0
- package/src/components/table.tsx +295 -0
- package/src/components/tabs.tsx +191 -0
- package/src/components/textarea.tsx +44 -0
- package/src/components/theme.tsx +120 -0
- package/src/components/thinking.tsx +295 -0
- package/src/components/toast.tsx +308 -0
- package/src/components/toolbar.tsx +166 -0
- package/src/components/tooltip.tsx +84 -0
- package/src/components/top-nav.tsx +660 -0
- package/src/components/truncate.tsx +234 -0
- package/src/deprecated.ts +61 -0
- package/src/index.ts +184 -0
- package/src/lib/cn.ts +22 -0
- package/src/lib/color.ts +469 -0
- package/src/lib/contrast.ts +220 -0
- package/src/lib/create-theme.ts +659 -0
- package/src/lib/harmony.ts +609 -0
- package/src/lib/import-theme.ts +272 -0
- package/src/lib/overflow-scroll.tsx +108 -0
- package/src/lib/radio-toggle-render.tsx +15 -0
- package/src/lib/reorder.ts +222 -0
- package/src/lib/spacing.ts +189 -0
- package/src/lib/tailwind-palette.ts +355 -0
- package/src/lib/truncate.ts +79 -0
- package/src/lib/use-single-value.ts +23 -0
- package/src/styles/continuum.css +3 -0
- package/src/styles/theme.css +524 -0
- package/src/styles/tokens.css +647 -0
|
@@ -0,0 +1,1369 @@
|
|
|
1
|
+
# Components
|
|
2
|
+
|
|
3
|
+
Every part of the system, grouped by what it does, in the playground's fifteen categories. Each entry says what the part is **for**, what it is **not
|
|
4
|
+
for** (and what to use instead), what it sits **with**, its parts, its values in units, and its states. The
|
|
5
|
+
values are the React library's, read from its source; a canvas or a stylesheet draws the same numbers. The
|
|
6
|
+
shared values (the hairline, the washes, the focus ring, the corners, the motion) are in `foundations.md` and
|
|
7
|
+
are not repeated here; "hairline" means 1px `neutral-200`, "5% wash" means `neutral-950` at 5%, "focus ring"
|
|
8
|
+
means the 2px ring, "action" means the action colour, and "13/500" means 13px at weight 500. The width of a
|
|
9
|
+
panel, a popup or a fixed column (the sidebar's 256, a toast's 360, a popover's 288, a menu's minimum) is fixed
|
|
10
|
+
pixels and does not follow the theme's spacing unit; the full list is under Fixed widths in `foundations.md`.
|
|
11
|
+
|
|
12
|
+
How to read a lookup: find the family, read the entry, draw or compose what it says. Where two parts could
|
|
13
|
+
fit, the **not for** line decides. Where an entry offers variants, sizes or optional pieces, it says when each
|
|
14
|
+
is the one; an optional piece with no reason on this screen is left out.
|
|
15
|
+
|
|
16
|
+
The words a part draws or announces on its own ("Clear all", "Back", "Previous", "Copy", "Search values",
|
|
17
|
+
"Expand sidebar") each have an optional prop to change them (`clearLabel`, `backLabel`, `previousLabel`,
|
|
18
|
+
`copyLabel`, `searchPlaceholder`, `expandLabel` and so on), for another language or a better name.
|
|
19
|
+
|
|
20
|
+
## App frame
|
|
21
|
+
|
|
22
|
+
**AppShell → Sidebar (or TopNav) + AppPanel.** The shell is the canvas (`neutral-100`, min 100vh); the sidebar
|
|
23
|
+
sits straight on it; the panel is `main`, inset 8 on every side but the navigation's, `panel` corners (20),
|
|
24
|
+
hairline, surface, clipped. Under a TopNav there is no canvas: the shell is the surface and the panel lies flat
|
|
25
|
+
under the bar's hairline, no gutter, corners or frame. Everything styled sits inside a `Theme`
|
|
26
|
+
(the `.continuum` scope with `data-mode` and `data-theme`; 13px Geist, line height 1.25, tracking 0.32px, text
|
|
27
|
+
`neutral-950`; `radius` sets the corner scale); `ThemeScope` re-opens it inside a portal (menus, tooltips,
|
|
28
|
+
dialogs render at the end of the body). `PortalContainer` points every overlay inside it at another element
|
|
29
|
+
than the body, a box that holds fixed descendants and stands for the screen (a phone drawn in a preview): its
|
|
30
|
+
sheets, dialogs and menus then keep to that box and size by it.
|
|
31
|
+
|
|
32
|
+
**Narrow:** the shell is the width the page answers to, not the screen. Under 1024 of it the sidebar (under
|
|
33
|
+
640, a top nav's sections) goes into a drawer the shell holds open or shut (open by the header bar's toggle; Esc, the scrim, a
|
|
34
|
+
chosen place or the drawer's own toggle shut it, focus going back to the toggle), and the panel is inset 8 on
|
|
35
|
+
every side. The panel keeps its gutter, corners and hairline at every width: a phone shows the same shell.
|
|
36
|
+
|
|
37
|
+
### Sidebar · SidebarHeader · SidebarSwitcher · SidebarGroup · SidebarItem · SidebarSection · SidebarLevel · SidebarLevelHead · SidebarBack · SidebarFooter · SidebarAccount
|
|
38
|
+
**For** the main navigation of an app with several places and groups. **Not for** an app whose sections fit
|
|
39
|
+
along one bar (TopNav) or one that wants the navigation out of the way (NavRail). Its rows
|
|
40
|
+
are sidebar items (`SidebarItem`), a section that folds open to its pages is a `SidebarSection`, a place with a
|
|
41
|
+
long index drills into a `SidebarLevel`; all of them, with the header, the switcher and the footer, make one
|
|
42
|
+
sidebar. (The old names `NavItem`, `NavGroup` and `navItemClasses` still work, as aliases.)
|
|
43
|
+
- 256 wide, no fill, no border; a column: header, the switcher, groups, footer at the bottom.
|
|
44
|
+
- **Bordered** (`bordered`), **when** the canvas behind is busy enough (a tint, an image, a pattern) that a
|
|
45
|
+
borderless sidebar's edge gets lost, or the product wants the navigation to read as a panel of its own
|
|
46
|
+
beside the page: a 1px `neutral-200` hairline on `panel` corners (20), with the AppPanel's 8 gutter round it,
|
|
47
|
+
still no fill. Otherwise leave it off: on a plain canvas the sidebar shares it, and one framed panel (the
|
|
48
|
+
page) is quieter than two.
|
|
49
|
+
- **One row for every part.** A sidebar item, a section's row and the back row are the same row: 34 high,
|
|
50
|
+
padding 8 vertical, 10 left and 8 right, gap 8, `item` corners (10), full width; a 14 icon (or an emoji in a 14 box)
|
|
51
|
+
leading; the label 13/400, truncating. A chevron in a row is 14 too. Hover 5% wash; focus ring.
|
|
52
|
+
- **Counts, by what they say.** An item's count is what waits for the reader there (new mail, invoices
|
|
53
|
+
to send): the primary count `Badge` (22 high, 11/500, `chip` corners, min 32 wide), so it stands out from
|
|
54
|
+
the rows around it. A group's or a section's count is how many it holds, a fact and not a call: a plain figure
|
|
55
|
+
in `neutral-500`, in the type of its row, tabular. Both sit at the row's end (a section's after its
|
|
56
|
+
chevron), so the counts of a sidebar line up in one column. A shortcut `Kbd` sits at the item's end too,
|
|
57
|
+
after a count if both.
|
|
58
|
+
- **SidebarHeader**: 56 high; padding 12 top, 14 right, 8 bottom, 8 left; the logo left (`SidebarLogo`: a 26
|
|
59
|
+
mark in `neutral-950` centred in a 36 box), the collapse toggle right (`SidebarToggle`: 28 × 28, chip corners,
|
|
60
|
+
a 16 panel icon in `neutral-300`, `neutral-600` on hover; give it `expanded` and `aria-controls` so its state
|
|
61
|
+
is announced and its name turns between "Collapse sidebar" and "Expand sidebar").
|
|
62
|
+
- **SidebarSwitcher**, **for** the current workspace, project or account of a product that has several, a click
|
|
63
|
+
from the others: under the SidebarHeader, or in the SidebarFooter in the account's place. **Not for** switching
|
|
64
|
+
views inside a page (Tabs, SegmentedControl) or siblings deeper in the trail (BreadcrumbMenu); not for a product
|
|
65
|
+
with one workspace (SidebarAccount). **With** SidebarSwitcherMark, DropdownMenuItem, DropdownMenuSeparator.
|
|
66
|
+
- A button on the item corners: padding 6 top and bottom, 10 left (an item's, so its mark lines up with the
|
|
67
|
+
item icons and the logo), 8 right; gap 10. A 28 mark (a `SidebarSwitcherMark`, an avatar or a logo) with chip
|
|
68
|
+
corners; the name 13/500 `neutral-950` over a detail line 11/400 `neutral-600` (plan, role, "Pick one to
|
|
69
|
+
work on"), both truncating; a 16 up-down chevron in `neutral-500` at the right. Hover 5% wash, the selected
|
|
70
|
+
wash while open, focus ring.
|
|
71
|
+
- Under the header it sits in a group's insets (8 top, 12 right, 4 bottom, 8 left) and opens below; in the
|
|
72
|
+
footer it takes the account's place, pulled 10 left so its wash and mark line up with the items', and opens
|
|
73
|
+
above.
|
|
74
|
+
- **SidebarSwitcherMark**: the workspace's initial 13/500 on its own colour, white by default, or an `ink` for
|
|
75
|
+
a pale colour or one that flips with the mode (`on-action` when the colour is the action); chip corners, a 1px
|
|
76
|
+
inset ring of `neutral-950` at 10%; 28 in the button, 20 (11/500) in a menu row; with no colour, a
|
|
77
|
+
`neutral-200` square with its initial in `neutral-700`.
|
|
78
|
+
- The menu: aligned to the start, 4 from the button, as wide as the button and never under the wide menu
|
|
79
|
+
minimum (192). Each workspace a row with its 20 mark and a check on the current one; then a separator,
|
|
80
|
+
"All …" and "New …".
|
|
81
|
+
- **SidebarGroup**: a `nav` with padding 8 top, 12 right, 8 left; a group after another starts 24 down; an
|
|
82
|
+
optional label (13/400 `neutral-600`, 10 left, 8 right and 4 vertical padding) 4 above the items; items 2 apart. A
|
|
83
|
+
label may carry a `count` at its end (how many items the group holds, or what a search leaves of them), the
|
|
84
|
+
name truncating before it.
|
|
85
|
+
- **SidebarItem**, **for** one place in the sidebar. **Not for** an action (Button) or a view of the current
|
|
86
|
+
page (Dock). Trailing, a `Kbd` only when the place has a shortcut, a `count` only when things wait for the
|
|
87
|
+
reader there. `default` is a place; `project` a project or collection that folds open, and `inset` its pages
|
|
88
|
+
(the 14 belongs to that pair, and to the section's row, only).
|
|
89
|
+
|
|
90
|
+
| variant | text | fill |
|
|
91
|
+
| ------- | -------------------- | ----------------------- |
|
|
92
|
+
| default | 13/400 `neutral-950` | none |
|
|
93
|
+
| project | 14/400 `neutral-950` | none |
|
|
94
|
+
| inset | 14/400 `neutral-700` | none |
|
|
95
|
+
| primary | 13/400 `on-action` | action; 14 margin below |
|
|
96
|
+
|
|
97
|
+
States: hover 5% wash (primary: `action-hover`); current (`aria-current="page"`) the selected wash, inset text
|
|
98
|
+
`neutral-950`; focus ring.
|
|
99
|
+
- **SidebarSection**, **for** a section that folds open to its pages (inset SidebarItems), as deep as it needs:
|
|
100
|
+
a section's rows may be sections. **Not for** flat sections (a SidebarGroup) or a long index (a SidebarLevel).
|
|
101
|
+
- Its row: the item row at 14/400 `neutral-700` (`neutral-950` open), a 14 icon box, an optional `count`, a
|
|
102
|
+
chevron that shows on hover (always on touch) and turns from −90° to 0° when open. Open is never a
|
|
103
|
+
background: a background means "you are here".
|
|
104
|
+
- Its rows: on a 1px `neutral-200` guide line down the middle of the icon above (16 in), the rows 5 off it, so
|
|
105
|
+
a page's label starts 32 in, where its section's does (10 + 14 + 8); each level one icon's width further in.
|
|
106
|
+
4 above and below, rows 2 apart; opens over 200ms.
|
|
107
|
+
- The page you are on takes the theme's active look, and its piece of the guide line turns `neutral-950`;
|
|
108
|
+
every section that holds it (found among its rows, open or closed, or set with `current`) stays plain, its
|
|
109
|
+
label at full strength, and darkens its own piece of the line, so the path down to the page can be followed.
|
|
110
|
+
- **SidebarLevel · SidebarLevelHead · SidebarBack**, **for** a sidebar place with a long index of its own (a docs
|
|
111
|
+
site's components, a settings tree): the sidebar drills down into it as a level of its own. **Not for** a short
|
|
112
|
+
list under a place (a SidebarSection that folds open instead) or views of the current page (Tabs, the Dock).
|
|
113
|
+
**With** SidebarGroup, SidebarItem, a search Input.
|
|
114
|
+
- **SidebarLevel**: one level, the top level's places or a place's index; only the open one renders. It
|
|
115
|
+
enters 8 from its side (from the end going down, from the start coming back) while fading in, 200ms
|
|
116
|
+
`ease-out-strong`; under reduced motion it only fades. A drilled level keeps the sidebar's header and
|
|
117
|
+
switcher above it and takes the rest of the height, scrolling, so a long index shows whole; the footer stays
|
|
118
|
+
at the bottom.
|
|
119
|
+
- **SidebarLevelHead**: the head of a drilled level, holding its SidebarBack and anything that works on the
|
|
120
|
+
whole level (a search). It stays at the top while the level's list scrolls under it, filled with the
|
|
121
|
+
sidebar's canvas (`neutral-100`) and a hairline (`neutral-200`) at its foot; padding 12 top, 12 right, 12
|
|
122
|
+
bottom, 8 left (a group's insets, so its rows sit where the items do), its rows 8 apart. A search in it has
|
|
123
|
+
9 left padding, which with the hairline makes an item's 10, so its icon sits over the item icons.
|
|
124
|
+
- **SidebarBack**: the drilled level's back row, first in its SidebarLevelHead: the item row, a 14
|
|
125
|
+
chevron-left, the level's name 13/400 `neutral-950`. It is announced as "Back: Components" (`backLabel`
|
|
126
|
+
changes the first word) and takes the reader to the level above; the open page stays.
|
|
127
|
+
- On the top level, the place that drills shows a 14 chevron-right in `neutral-500` at its end. In the head,
|
|
128
|
+
under the back row, an optional search narrows the index; the index's groups take a `count` at their labels'
|
|
129
|
+
ends.
|
|
130
|
+
- **SidebarFooter**: pushed to the bottom; padding 16 top, 14 right, 24 bottom, 18 left (a group's 8 and an
|
|
131
|
+
item's 10, so the avatar lines up with the logo, the switcher's mark and the item icons; 14 on the right, so a
|
|
132
|
+
28 icon button's icon centres on the column the toggle and the switcher's chevron share); gap 12; holds
|
|
133
|
+
`SidebarAccount`, the switcher's row again (a 28 avatar with chip corners, 10 from the name, so the account's
|
|
134
|
+
name starts on the switcher's line: the name 13/500 `neutral-600` over a detail line 11/400 `neutral-600`: whatever says more
|
|
135
|
+
about who is signed in, an email, a plan, a role or a place) and, only when the product has notifications, a
|
|
136
|
+
bell.
|
|
137
|
+
- **Narrow:** under 1024 of shell it is a drawer: 256 wide (at most the shell less 48), on the canvas colour,
|
|
138
|
+
sliding in from the left over the panel in 200ms with the `sheet` shadow and a 40% black scrim, still under
|
|
139
|
+
reduced motion; shut, it is neither seen nor focusable. Its SidebarToggle then shuts the drawer, and choosing
|
|
140
|
+
an item shuts it too.
|
|
141
|
+
|
|
142
|
+
### TopNav · TopNavBrand · TopNavSwitcher · TopNavLinks · TopNavLink · TopNavMenu · TopNavMenuGroup · TopNavMenuItem · TopNavActions
|
|
143
|
+
**For** an app whose sections fit along one bar, the sidebar on its side: it holds what a sidebar holds, a
|
|
144
|
+
switcher, places with counts, and sections with pages of their own. **Not for** a long index or navigation
|
|
145
|
+
deeper than one level of pages (Sidebar, which drills into a level).
|
|
146
|
+
- The top of the page: a bar across the shell on the surface (`neutral-50`), a 1px `neutral-200` hairline under
|
|
147
|
+
it, sticky at the top; the page straight under it. Its row is 56 high, gap 24, and keeps to the page's column
|
|
148
|
+
(`width`, the PageContent widths, with their side padding), so the brand starts where the page's title does.
|
|
149
|
+
In order: brand, switcher, links, the account. Search and a bell only when the product has them; the account
|
|
150
|
+
alone is the usual end.
|
|
151
|
+
- **TopNavBrand**: a 26 mark and the name 14/500, gap 8 (the name hides under 640).
|
|
152
|
+
- **TopNavSwitcher**, **when** the product has several workspaces, as the SidebarSwitcher: on the link's row (34
|
|
153
|
+
high, 8 side, gap 8, `item` corners), a 20 mark, the name 13/500 `neutral-950`, a 14 up-down chevron in
|
|
154
|
+
`neutral-500`; one line, the detail only in the drawer. Hover 5% wash, the selected wash while open. Its menu
|
|
155
|
+
is the SidebarSwitcher's, opening below.
|
|
156
|
+
- **TopNavLinks**: 2 apart; links that overflow scroll with a chevron (34 × 34) at the end that has more.
|
|
157
|
+
**TopNavLink**: 34 high, 12 side, 8 vertical, gap 8, `item` corners, 13/400 `neutral-600`; hover 5% wash and
|
|
158
|
+
`neutral-950`; current the selected wash and `neutral-950`. A `count`, what waits there, is the sidebar
|
|
159
|
+
item's primary count Badge, after the label.
|
|
160
|
+
- **TopNavMenu**, **for** a section with pages of its own (the SidebarSection on the bar): the link's row with a
|
|
161
|
+
14 chevron-down in `neutral-500` after the label, gap 6, turning 180° while open; open the 5% wash. Holding the
|
|
162
|
+
page you are on (found among its items, or set with `current`) it takes the current link's look, since the
|
|
163
|
+
page is not on the bar. Its menu opens below, aligned to the start, at least the wide menu minimum (192): the
|
|
164
|
+
pages as menu rows, the current one on the selected wash; **TopNavMenuGroup** heads a group of them (11/500
|
|
165
|
+
`neutral-600`), a group after another ruled off by a hairline.
|
|
166
|
+
- **TopNavActions**: pushed right, gap 8.
|
|
167
|
+
- **Narrow:** the links scroll down to 640 of shell, so the bar keeps its sections where a sidebar would
|
|
168
|
+
already be a drawer. Under 640 the switcher, the links and the actions hide, and a toggle before the brand
|
|
169
|
+
opens the shell's drawer: the switcher under its header as the SidebarSwitcher, the links as sidebar items, a
|
|
170
|
+
menu as a SidebarSection folding open to its pages (open when it holds the current one), a group's heading
|
|
171
|
+
over its rows.
|
|
172
|
+
|
|
173
|
+
### NavRail
|
|
174
|
+
**For** the main navigation as a floating island: icons only, labels on demand. **Not for** an app whose places
|
|
175
|
+
need to be read at a glance (Sidebar). **With** NavRailToggle, NavRailItem, NavRailSeparator.
|
|
176
|
+
- A pill (`dock` corners) 52 wide closed, 208 expanded; padding 8; rows 2 apart; hairline; surface. The current
|
|
177
|
+
item sits on one action-coloured pill (34 high, `item` corners) that slides between items over 200ms; width
|
|
178
|
+
changes over 300ms.
|
|
179
|
+
- **NavRailItem**: 34 high, 9 side, gap 10, `item` corners; a 16 icon on a 16 column, the label 13/500
|
|
180
|
+
`neutral-600` (opacity 0 closed, 1 open), a tooltip on the right while closed; hover 5% wash and
|
|
181
|
+
`neutral-800`; current `on-action` text on the pill. **NavRailSeparator**: a hairline with 6 vertical margin.
|
|
182
|
+
**NavRailToggle** is named "Collapse navigation" or "Expand navigation" (`collapseLabel`, `expandLabel`).
|
|
183
|
+
- **Narrow:** none; the rail is a choice for a wide screen. An app that must work on a phone takes the Sidebar
|
|
184
|
+
or the TopNav, whose places go into the drawer.
|
|
185
|
+
|
|
186
|
+
### HeaderBar
|
|
187
|
+
**For** the top of the panel: the breadcrumb and at most two page-wide actions. **Not for** the page's title
|
|
188
|
+
(the page head under it, in `pages.md`) or its filters. **With** HeaderBarStart, HeaderBarNav, Breadcrumb,
|
|
189
|
+
HeaderBarActions, Notice; `usePageHistory`.
|
|
190
|
+
- 54 high, padding 8 vertical, 16 left, 8 right, gap 16, hairline below, no fill of its own. **HeaderBarNav**:
|
|
191
|
+
back and forward as ghost 28 buttons (chip corners, `neutral-600`, icons 16), 2 apart, pulled through the
|
|
192
|
+
padding and ruled off by a hairline the bar's full height, 12 left and 16 right padding; an arrow with nowhere
|
|
193
|
+
to go (or nothing to call) dims; leave out forward for a back button alone (a detail page returning to its
|
|
194
|
+
list); `backLabel` and `forwardLabel` rename them for screen readers.
|
|
195
|
+
**usePageHistory**`(pages, start)` keeps that history for an app that holds its own pages, not the browser's:
|
|
196
|
+
it gives the page, `canGoBack`, `canGoForward`, `back`, `forward` and `go` (which drops anything forward, as a
|
|
197
|
+
browser does); use the router's history where there is one. **HeaderBarActions**: gap 8, secondary before
|
|
198
|
+
primary.
|
|
199
|
+
- **Narrow:** under 1024 of shell, in an app with a sidebar, a **HeaderBarSidebarToggle** takes the far left,
|
|
200
|
+
where back and forward sit (a ghost square with the panel icon, opening the drawer); back and forward and the
|
|
201
|
+
actions hide; the breadcrumb and a notice stay. A bar of your own places the toggle itself.
|
|
202
|
+
|
|
203
|
+
### PageContent
|
|
204
|
+
**For** the centred column every page's content sits in. **Not for** a container inside the page.
|
|
205
|
+
- Content-box, centred, min width 0. Width `narrow` 640 · `default` 896 · `wide` 1080 · `dense` 1280 · `inset`
|
|
206
|
+
(the panel less 64 a side from 1024, 128 from 1536) · `full` (0). Side padding 16, 24 from 640. Top padding 64.
|
|
207
|
+
- **Narrow:** in a compact shell (under 640) side padding 16 and top padding 40. Outside a shell, as above.
|
|
208
|
+
|
|
209
|
+
### BottomBar · Dock · DockItem · DockAction
|
|
210
|
+
**For** the views of a list, the facets of an editor beside its commit action, or sibling settings pages, at the
|
|
211
|
+
panel's foot. **Not for** the facets of one object on its detail page (Tabs), a one-of-few choice inside content
|
|
212
|
+
(SegmentedControl), or a page with nothing to switch (then the primary stays in the title row).
|
|
213
|
+
- **BottomBar**: `floating` pins it 24 above the panel's bottom, centred, width fits, z 10; gap 8 between the
|
|
214
|
+
dock and its action.
|
|
215
|
+
- **Dock**: 38 high outside, items 32 high sitting 3 from the dock's outer edge (the hairline plus 2), 2
|
|
216
|
+
apart, `dock` corners (a pill; `rounded` shape: `item` 10), hairline, surface, `float` shadow; always one item
|
|
217
|
+
selected; more items than fit scroll sideways with a chevron (32 × 32) at the end that has more, the selected
|
|
218
|
+
one kept in view.
|
|
219
|
+
- **DockItem**: 32 high, 12 side, gap 8, corners `dock − 3` (23), 13/500 `neutral-600`, icon 16; hover
|
|
220
|
+
`neutral-950`; pressed: the action fill and `on-action` text; a count may trail a view that is a set of
|
|
221
|
+
things to count.
|
|
222
|
+
- **DockAction**, only when the page has a primary action: a large primary button (38) with the dock's
|
|
223
|
+
corners; 16 side padding, 13/500 `on-action`, or 38 × 38 with an icon only.
|
|
224
|
+
- **Narrow:** in a compact shell the floating BottomBar is never wider than its parent less 32, so the dock's
|
|
225
|
+
own scroll and chevrons start; the dock's counts (DockCount) hide; a DockAction with an icon shows the icon only, 38 × 38,
|
|
226
|
+
its label kept for screen readers.
|
|
227
|
+
|
|
228
|
+
## Navigation
|
|
229
|
+
|
|
230
|
+
### Breadcrumb
|
|
231
|
+
**For** the trail on every page, in the header bar. **Not for** tabs or steps. **With** BreadcrumbHome,
|
|
232
|
+
BreadcrumbLink, BreadcrumbMenu, BreadcrumbPage, BreadcrumbSeparator.
|
|
233
|
+
- One line, never wraps; the page truncates first. List gap 8; `md` 13/400 `neutral-600`, `lg` 14/500. Home: a
|
|
234
|
+
16 house icon in `neutral-400`. Separator: a 16 chevron in `neutral-400`. Link: `neutral-600`, `neutral-950` on
|
|
235
|
+
hover, chip corners for the ring. Page: `neutral-950`, truncates. **BreadcrumbMenu**: a crumb that opens a
|
|
236
|
+
menu, 28 high, 6 side padding pulled out by 6, gap 4, chip corners; with a `label` and an up-down chevron it
|
|
237
|
+
switches siblings deeper in the trail (a report among reports; the workspace itself only in an app without a
|
|
238
|
+
SidebarSwitcher); without, it is the "…" standing in for a long middle; hover 5% wash;
|
|
239
|
+
open the selected wash; menu min width 192.
|
|
240
|
+
- **Narrow:** in a compact shell only the last two crumbs show, parent › page; home and the earlier crumbs
|
|
241
|
+
hide.
|
|
242
|
+
- A page that is a file or a record ID cuts in the middle (a Truncate inside BreadcrumbPage); a named page at
|
|
243
|
+
the end.
|
|
244
|
+
|
|
245
|
+
### Tabs
|
|
246
|
+
**For** the facets of one object, each with content of its own: line tabs under a page's, a section's or a
|
|
247
|
+
panel's title, pill tabs in a tight spot inside a card or a dialog. **Not for** the views of a
|
|
248
|
+
list, settings areas, or an editor with a commit action (the Dock); not for switching how one thing is shown
|
|
249
|
+
(SegmentedControl). **With** TabsList, TabsTrigger, TabsCount, TabsContent.
|
|
250
|
+
- Root gap 16 between the list and its panel.
|
|
251
|
+
|
|
252
|
+
| variant | list | trigger | active |
|
|
253
|
+
| ------- | --------------------------- | -------------------------------------------------------------------------- | ------------------------------------ |
|
|
254
|
+
| line (the default) | gap 0, hairline below (**a page's, a section's or a panel's facets, under its title**) | 44 high, 12 side, gap 8, 13/500 `neutral-600`, hanging 1 over the line | text `neutral-950`, a 2px underline in `neutral-950` (fading in over 150ms) |
|
|
255
|
+
| pill | gap 2, no line (a tight spot inside a card or a dialog) | 34 high, 12 side, gap 8, `control` corners, 13/500 `neutral-600` | the tint wash, text `tint-fg` |
|
|
256
|
+
|
|
257
|
+
Hover `neutral-950` (pill: also the 5% wash); disabled 50%; arrow keys select as they move. A pill list nested
|
|
258
|
+
in a line list keeps its own look. **TabsCount**: 16 high, min 16 wide, 4 side, round, the tab's
|
|
259
|
+
colour at 10% behind 11/500 in the tab's colour, only on a tab whose content is a list to count. A trailing
|
|
260
|
+
piece may also be a `Kbd`, a `StatusDot` or an icon. **Narrow:** a list longer than its width scrolls sideways under an edge fade, with a chevron at the end
|
|
261
|
+
that has more (the dock's), the active tab kept in view; line tabs keep their hairline full width.
|
|
262
|
+
|
|
263
|
+
### Pagination
|
|
264
|
+
**For** paging a table that runs past one page; a list on one page has none. **Not for** steps (Stepper).
|
|
265
|
+
**With** PaginationPrevious, PaginationButton, PaginationNext.
|
|
266
|
+
- A grid: the results text (13/500 `neutral-800`) left, the pages centred, an optional slot right; column gap 48.
|
|
267
|
+
Buttons 34 × 34, `control` corners, hairline, 14/500 `neutral-600` tabular, 8 apart; hover border
|
|
268
|
+
`neutral-300` and `neutral-950`; the current page only darkens its label; disabled 50%. An ellipsis
|
|
269
|
+
is a 34 slot; the slot count is constant (siblings × 2 + 5), so the row never changes width.
|
|
270
|
+
**getPageItems**`(page, pageCount, siblings = 1)` returns those slots (page numbers and `start-ellipsis` /
|
|
271
|
+
`end-ellipsis`), for a pager drawn by hand.
|
|
272
|
+
- **Narrow:** it measures its own width. Under 720 the results text (one line, never wrapping) hides and the pages become previous, "3 of
|
|
273
|
+
25" (13/500 `neutral-800`, tabular) and next, on the same 34 buttons.
|
|
274
|
+
|
|
275
|
+
### CommandMenu
|
|
276
|
+
**For** search-and-run from the keyboard (⌘K). **Not for** a search box in a page (Input) or a long menu
|
|
277
|
+
(DropdownMenuSearch). **With** CommandMenuContent, CommandMenuInput, CommandMenuList, CommandMenuGroup,
|
|
278
|
+
CommandMenuItem, CommandMenuEmpty, CommandMenuFooter; `useCommandMenuShortcut`.
|
|
279
|
+
- A dialog 560 wide (never wider than the viewport − 32) pinned 16vh from the top, `card` corners, hairline,
|
|
280
|
+
surface, `sheet` shadow, a 40% scrim; opens over 200ms from 8 below.
|
|
281
|
+
- Input row 52 high, 16 side, gap 10, hairline below: a 16 search icon in `neutral-500`, the text 14/400 with
|
|
282
|
+
no box. List max 360 (or half the viewport), padding 6, groups 4 apart; a group label 11/500 `neutral-600`
|
|
283
|
+
with 10 side, 8 top, 4 bottom; a group hides once nothing in it matches. Item: 36 high, 10 side, gap 10, `item`
|
|
284
|
+
corners, 13/500 `neutral-700`, icon 16 `neutral-600`, a hint 11/400 `neutral-600` at the end; highlighted the
|
|
285
|
+
5% wash and `neutral-800`. Empty: 13 `neutral-600`, 10 side, 12 vertical. Footer 40 high, 16 side, gap 16,
|
|
286
|
+
hairline above, 11 `neutral-600` key hints. On a touch screen the input row ends in a secondary close button
|
|
287
|
+
(`closeLabel`), since a finger has no Esc, and the footer hides, its hints being keys. The footer's hints
|
|
288
|
+
never wrap; what does not fit is cut off.
|
|
289
|
+
|
|
290
|
+
### Stepper
|
|
291
|
+
**For** the steps of a long form: horizontal over it, or vertical beside a long one, each step holding its
|
|
292
|
+
fields. **Not for** a form that fits one page of sections, a page's facets (Tabs) or progress of a task
|
|
293
|
+
(Progress). **With** StepperItem.
|
|
294
|
+
- Markers: `number` and `dot` 22 round; `icon` 32 with `control` corners; `line` a 4 bar (`pill` corners). Done:
|
|
295
|
+
action fill, `on-action` (a 14 check); current: a 1px action border on the surface, a 3px ring of the tint,
|
|
296
|
+
the numeral or icon `neutral-950` (the dot stays the action); upcoming: `neutral-300` border, `neutral-600` text; invalid: `error-500` border, `error-600` text. The
|
|
297
|
+
connector between steps is 1px, action behind a done step, else `neutral-200`.
|
|
298
|
+
- Horizontal `inline`: items in a row 4 apart, head padding 10 side 6 vertical with `item` corners, text beside
|
|
299
|
+
the marker; `centered`: marker over centred text. Vertical: 24 between steps, text 12 from the marker, the
|
|
300
|
+
step's fields inside it (padding left marker + 12). Label 13 (upcoming 400 `neutral-600`, else 500
|
|
301
|
+
`neutral-950`); description 11 horizontal, 13 vertical, `neutral-600`. A narrow row keeps only the current
|
|
302
|
+
step's description (under 576) or label (under 448).
|
|
303
|
+
- Done steps become buttons when `onValueChange` is given (hover 5% wash); a step with errors is `invalid` and
|
|
304
|
+
its description says what is missing.
|
|
305
|
+
|
|
306
|
+
## Actions
|
|
307
|
+
|
|
308
|
+
### Button
|
|
309
|
+
**For** an action. **Not for** going somewhere (a link or SidebarItem), turning a thing on (Switch), choosing a view
|
|
310
|
+
(SegmentedControl, Dock). **With** an Input beside it (md level with a small input, lg with a medium one),
|
|
311
|
+
Toolbar, a dialog's footer, a DockAction.
|
|
312
|
+
|
|
313
|
+
| size | height | width | side padding | corners | when |
|
|
314
|
+
| ------- | ------ | ----- | --------------------------------- | ------------ | ----------------------------------------------------------- |
|
|
315
|
+
| md | 34 | hugs | 16; 12 at an end that holds an icon | `control` 12 | the default: a title row, a toolbar, a form's end, a dialog's footer, beside a small input |
|
|
316
|
+
| lg | 38 | hugs | 16 | `control` 12 | only level with a medium input (a sign-in card), and as the dock's action |
|
|
317
|
+
| icon | 34 | 34 | 0 | `control` 12 | an action its icon alone names, standing on its own (a title row, a toolbar), with a tooltip |
|
|
318
|
+
| icon-sm | 28 | 28 | 0 | `chip` 6 | an icon button inside another part: a table row's ellipsis, a field's copy, a remove ×, the header bar's back and forward |
|
|
319
|
+
|
|
320
|
+
| variant | fill | border | text | hover | when |
|
|
321
|
+
| --------- | ----------- | -------- | ------------- | --------------------------------------- | ------------------------------------------------------ |
|
|
322
|
+
| primary | action | none | `on-action` | `action-hover`, gradient off | the view's one primary action, and nothing else |
|
|
323
|
+
| secondary | none | hairline | `neutral-950` | border `neutral-300`, the 5% wash | every other action that stands on its own: Cancel, Export, "Change plan" |
|
|
324
|
+
| ghost | none | none | `neutral-600` | 5% wash, text `neutral-800` | an action that stays quiet inside a row or a part: the ellipsis, a close, "Clear all", "Add line", "Full history" |
|
|
325
|
+
| tint | the 7% wash | none | `tint-fg` | the wash 8% stronger | an AI action beside the primary one |
|
|
326
|
+
|
|
327
|
+
Label 13/500, no wrap, gap 8 (the icon-to-label gap of every 34 and 38 control), icons 14 at 34 and 16 at 38 (leading in navigation, trailing on an action: "Add email +"). Press
|
|
328
|
+
scales to 97%; disabled 50%; `loading` puts a 16 spinner before the label (in place of an icon button's icon),
|
|
329
|
+
holds off clicks, Enter and Space (a submit button sends nothing) and keeps focus, at full strength rather than
|
|
330
|
+
dimmed, since it is working; `pill` rounds it.
|
|
331
|
+
|
|
332
|
+
### HoldButton
|
|
333
|
+
**For** a destructive action repeated in place, where a dialog each time would be clicked through (removing
|
|
334
|
+
members one by one, cancelling queued runs). **Not for** a rare, grave action (a confirmation dialog) or one that
|
|
335
|
+
can be undone (do it, then Undo in a toast). A Button, secondary or ghost at its sizes, labelled to hold
|
|
336
|
+
("Hold to remove"): holding fills it from the start edge with the `error` 500 at 20% over 1000ms, linear, the
|
|
337
|
+
label turning `error-700`, and the action runs when it is full; letting go, leaving it or losing focus sooner
|
|
338
|
+
drains the fill in 200ms and nothing happens. Space or Enter held does the same; a screen reader's activation,
|
|
339
|
+
which cannot hold, runs it at once. The recipe is Press and hold to confirm in `patterns.md`.
|
|
340
|
+
|
|
341
|
+
### Toolbar
|
|
342
|
+
**For** actions on a selection (floating, at the foot) or over a focused block (inline). **Not for** a page's
|
|
343
|
+
standing actions (the title row) or the views of a list (Dock). **With** ToolbarButton, ToolbarChip.
|
|
344
|
+
|
|
345
|
+
| variant | height | padding | gap | corners | items |
|
|
346
|
+
| -------- | ------ | ------- | --- | ------------ | ---------------------------------------------------------- |
|
|
347
|
+
| inline | 34 | 0 | 0 | `control` 12 | 32 high, 12 side, split by hairlines; hover a wash inset 2 (corner 9) |
|
|
348
|
+
| floating | 38 | 3 | 2 | `control` 12 | 30 high, 12 side, corner 8; hover the 5% wash |
|
|
349
|
+
|
|
350
|
+
Hairline, surface, `float` shadow. Items 13/500 `neutral-600`, `neutral-950` on hover, icons 14 on the inline bar and 16 on the floating one, 8 from their label. **ToolbarChip**
|
|
351
|
+
leads it ("AI suggestions"): `primary-500` at 20% behind 11/500 `primary-800`, a 16 sparkle, 8–10 side padding.
|
|
352
|
+
**Narrow:** a bar longer than its room scrolls sideways under an edge fade, no scrollbar, rather than clipping;
|
|
353
|
+
in a compact shell a ToolbarButton with an icon drops its label (kept for screen readers), one without keeps it.
|
|
354
|
+
|
|
355
|
+
### DropdownMenu
|
|
356
|
+
**For** a row's or an object's actions behind a ghost ellipsis, or an account menu. **Not for** picking a value
|
|
357
|
+
(Select), filtering (FilterMenu) or a small form (Popover). **With** DropdownMenuTrigger, DropdownMenuContent,
|
|
358
|
+
DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuGroup,
|
|
359
|
+
DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent,
|
|
360
|
+
DropdownMenuSearch, DropdownMenuEmpty, DropdownMenuShortcut.
|
|
361
|
+
- Panel: min width 160, padding 4, rows 4 apart, `card` corners (16), so the rows inside keep `item` corners (10) and nest; hairline, surface, `float` shadow, 4 from
|
|
362
|
+
its trigger; opens over 200ms from 95% and transparent.
|
|
363
|
+
- Row (a MenuItem): 36 high, 12 side, 8 vertical, gap 8, `item` corners (10, nested inside the 16 panel), 13/500
|
|
364
|
+
`neutral-700`, icons 14 `neutral-600`; highlighted the 5% wash and `neutral-800`; `danger` rows in `error-600`,
|
|
365
|
+
**last, after a separator**. A checkbox or radio item shows a 16 check at its end when checked; radio items
|
|
366
|
+
sit in a **DropdownMenuRadioGroup** (one value), and a checked one takes the selected wash. A
|
|
367
|
+
**DropdownMenuGroup** holds rows a label names. Label 11/500 `neutral-600` (12 side, 6 top, 4 bottom).
|
|
368
|
+
A submenu is a **DropdownMenuSub**: its **DropdownMenuSubTrigger** is a row with a 16 chevron right at its end
|
|
369
|
+
(its own 16 icon goes in `icon`, as on the checkbox and radio rows, never in the children),
|
|
370
|
+
on the selected wash while its submenu is open, and its **DropdownMenuSubContent** is the same panel opening
|
|
371
|
+
beside the row. Separator a hairline bleeding 4 to the panel's edges. Shortcut 11/500
|
|
372
|
+
`neutral-600` at the row's end.
|
|
373
|
+
- A long menu (assign to, move to) takes a **DropdownMenuSearch** on top: 40 high, 16 side, gap 12, a 16 icon
|
|
374
|
+
in `neutral-500`, the text 13 with no box, ruled off full width; Enter runs the first item that matches; and a
|
|
375
|
+
**DropdownMenuEmpty** (13 `neutral-600`, 12 side, 10 vertical) when nothing matches.
|
|
376
|
+
- **DropdownMenuRadioItem** and **DropdownMenuCheckboxItem** take an `icon`: a 16 icon in the row's leading
|
|
377
|
+
slot, like a plain item's, with the check still at the end.
|
|
378
|
+
|
|
379
|
+
### Kbd
|
|
380
|
+
A shortcut key: 22 high, min 22 wide, 4 side, chip corners, a 1px `neutral-300` border, no fill, 11/500
|
|
381
|
+
`neutral-700`. Trails a SidebarItem, a CommandMenuItem, a search input, only where the key does what it says;
|
|
382
|
+
never inside a button, whose key goes in its tooltip or in a hint line under the actions. Hidden on a touch screen, which has no keys
|
|
383
|
+
to hint at.
|
|
384
|
+
|
|
385
|
+
## Inputs
|
|
386
|
+
|
|
387
|
+
### Field · FieldLabel · FieldHelper
|
|
388
|
+
**For** a labelled control in a form: label, control, helper stacked. **Not for** a setting (SettingRow is the
|
|
389
|
+
label there) or a read-only value (ReadonlyField).
|
|
390
|
+
- A column, gap 8. Label 13/500 `neutral-900`. Helper 13/400 `neutral-600` (the secondary step: a hint is told apart by its place, not a paler grey),
|
|
391
|
+
`neutral-700` while the control's box (an Input, a Select, a Combobox, a DatePicker, a CodeInput) is hovered,
|
|
392
|
+
`neutral-900` while it is focused, `error-600` when invalid, `neutral-400` when disabled. The field
|
|
393
|
+
passes `invalid` and `disabled` to its control.
|
|
394
|
+
|
|
395
|
+
### Input
|
|
396
|
+
**For** a line of text. **Not for** a value from a list (Select), a search of a list (Combobox), several lines
|
|
397
|
+
(Textarea), a date (DatePicker). **With** a leading icon (a search), a trailing piece (a Kbd, a unit).
|
|
398
|
+
|
|
399
|
+
| size | height | side padding | gap | corners | text |
|
|
400
|
+
| ---- | ------ | ------------ | --- | ------------ | --------------------------------------- |
|
|
401
|
+
| sm | 34 | 12 | 8 | `control` 12 | 13/500 `neutral-900`, placeholder `neutral-600` (`neutral-700` on hover) |
|
|
402
|
+
| md | 38 | 12 | 8 | `control` 12 | same |
|
|
403
|
+
|
|
404
|
+
Hairline, no fill, full width, icons 14 at 34 and 16 at 38, `neutral-600`. Hover border `neutral-300`; focus border `neutral-300`
|
|
405
|
+
plus the ring; invalid border `error-500`, icon `error-500` and placeholder `error-300`; disabled the whole box
|
|
406
|
+
at 50%, its colours and hairline kept, as every disabled control. `sm` in a toolbar beside buttons; `md` in a
|
|
407
|
+
form. The `plain` variant drops the box (no border, no side padding) for a search inside a container that
|
|
408
|
+
already frames it (a table's bar, a menu); it keeps the ring. **On touch** the text is 16, so the phone does not
|
|
409
|
+
zoom the page on focus; the box keeps its height. The same holds for every field that takes typing: Textarea,
|
|
410
|
+
the Combobox's input, a menu's search, the command menu's, a filter's typed value, the message composer and prompt.
|
|
411
|
+
|
|
412
|
+
### Textarea
|
|
413
|
+
A medium Input for several lines: min height 96, 12 side, 10 vertical, `control` corners, hairline, 13/500
|
|
414
|
+
`neutral-900`; grows downwards only. Same states as Input; 16 on touch, as Input.
|
|
415
|
+
|
|
416
|
+
### Select
|
|
417
|
+
**For** one value from a list of many; in a setting row with `indicator="right"` as the "Select ›" picker.
|
|
418
|
+
**Not for** a one-of-few choice that should stay visible (SegmentedControl, RadioGroup), a list to search
|
|
419
|
+
(Combobox), a row of actions (DropdownMenu). **With** SelectTrigger, SelectValue, SelectContent, SelectItem,
|
|
420
|
+
SelectGroup, SelectLabel, SelectSeparator.
|
|
421
|
+
- Trigger: as Input (sm 34 in a toolbar, a page head or a setting row · md 38 in a form; 12 side, gap 8,
|
|
422
|
+
`control` corners, hairline), hugs its content, 13/500
|
|
423
|
+
`neutral-950`, a 16 chevron (down, or right for a picker) in `neutral-600`; placeholder `neutral-600`
|
|
424
|
+
(`neutral-700` on hover); hover and open border `neutral-300`; invalid border and icon `error-500`; disabled 50%.
|
|
425
|
+
- Panel: at least the trigger's width, `card` corners (16), as every floating panel, hairline, surface, `float` shadow, 4 below; the list
|
|
426
|
+
padded 4 with rows 4 apart; rows as a menu's (36 high, 12 side, corner 5, 13/500 `neutral-700`), the picked
|
|
427
|
+
one on the selected wash with a 16 check at its end; a group label 11/500 `neutral-600`. Never wider than the
|
|
428
|
+
room the screen leaves beside its trigger, as the Combobox's.
|
|
429
|
+
|
|
430
|
+
### Combobox
|
|
431
|
+
**For** a value, or several, found by typing. **Not for** a short list (Select) or free text (Input). **With**
|
|
432
|
+
ComboboxInput (one value: an Input box with a clear × and a chevron, each 24 × 24) or ComboboxChips (several:
|
|
433
|
+
the Input box wrapping chips and a borderless input, growing a row at a time, 3.5–5.5 vertical padding), and
|
|
434
|
+
ComboboxContent / ComboboxList / ComboboxItem / ComboboxGroup / ComboboxGroupLabel / ComboboxEmpty /
|
|
435
|
+
ComboboxSeparator / ComboboxCollection; ComboboxValue renders the picked value (in multiple mode, a function
|
|
436
|
+
mapping the values to chips); `useComboboxFilter` filters by label with the locale's collation (pass its
|
|
437
|
+
`contains` to `filter`).
|
|
438
|
+
- The clear × shows in place of the chevron once there is a value, so one trailing control shows at a time.
|
|
439
|
+
Disabled (on the Combobox, or from a disabled Field) the box sits at 50% with its hairline kept, and the clear
|
|
440
|
+
button, the chevron and each chip's × stop working with it.
|
|
441
|
+
- **ComboboxChip**, a picked value inside ComboboxChips, is a soft chip: 24 high, 8 side, `pill` corners,
|
|
442
|
+
`neutral-100`, 13/400 `neutral-600`, an optional 12 icon, a 12 × at the end (a 20 target; hide it for a value
|
|
443
|
+
that cannot be dropped); Backspace and the arrow keys move between chips, and the focused one takes the ring.
|
|
444
|
+
**ComboboxChipsInput** is the borderless input after them: 24 high, at least 64 wide, taking the rest of the
|
|
445
|
+
row. The panel and rows are the Select's; "No results" is a 36 row in `neutral-600`.
|
|
446
|
+
- Options that are files, paths or IDs cut in the middle (a Truncate as the item's label); named options at the
|
|
447
|
+
end.
|
|
448
|
+
|
|
449
|
+
### Checkbox
|
|
450
|
+
**For** selecting rows in a table, agreeing to a thing in a form, several choices from a short list. **Not for**
|
|
451
|
+
a setting that is on or off (Switch).
|
|
452
|
+
- 20 × 20, `chip` corners (6), a 1px `neutral-300` border (one step over the hairline), no
|
|
453
|
+
fill; checked or mixed: the action fill, the border kept, a 14 check or minus in `on-action`. Hover border
|
|
454
|
+
`neutral-400`; invalid `error-500`; disabled 50%. Inside a
|
|
455
|
+
menu row the indicator is 16 with a 12 mark.
|
|
456
|
+
|
|
457
|
+
### RadioGroup · RadioGroupItem
|
|
458
|
+
**For** one of a few options read together, each with a label (an OptionRow when it needs a description).
|
|
459
|
+
**Not for** five or more options (Select) or a yes/no (Switch).
|
|
460
|
+
- Items 8 apart in a column. Item 20 × 20 round, a 1px `neutral-300` border (as the checkbox's), no fill; checked:
|
|
461
|
+
a 14 round dot in the action colour. Hover border `neutral-400`; invalid `error-500`; disabled 50%.
|
|
462
|
+
|
|
463
|
+
### Switch
|
|
464
|
+
**For** a setting that is on or off and takes effect as it changes. **Not for** a choice submitted with a form
|
|
465
|
+
(Checkbox) or a one-of-few (SegmentedControl).
|
|
466
|
+
- Track 48 × 24, round, 2 padding, `neutral-300` off, the action colour on; knob 20 round, the surface colour off,
|
|
467
|
+
`on-action` on, travelling 24 over 200ms. Disabled 50%; focus ring on the track.
|
|
468
|
+
|
|
469
|
+
### SegmentedControl · SegmentedControlItem
|
|
470
|
+
**For** one of a few values that reshapes the same content: a view (List · Grid), a range (7d · 30d), a filter
|
|
471
|
+
on an index. **Not for** going to another place (Dock, Tabs), a yes/no (Switch), or more than five values
|
|
472
|
+
(Select). Always holds one value: without one given, it starts on its first item.
|
|
473
|
+
- Track 34 high, 2 padding, `control` corners (12), hairline, the surface (`segment-track`); `fill` makes it full
|
|
474
|
+
width with equal items. Items 29 high, 10 side, gap 8, corner 9, 13/500 `neutral-600`, icon 14; hover the 5%
|
|
475
|
+
wash and `neutral-800`. The pressed item sits on one thumb (29 high, corner 9, the action fill, `on-action`
|
|
476
|
+
text; a theme may raise it as a chip with a hairline) that slides between items over 200ms. Inside a Field it
|
|
477
|
+
is named by the FieldLabel, described by the helper and disabled with the field; elsewhere give it an
|
|
478
|
+
`aria-label`.
|
|
479
|
+
- **Narrow:** items keep their labels' width and never collide; a track wider than its room scrolls.
|
|
480
|
+
|
|
481
|
+
### Slider
|
|
482
|
+
A range: a 4 track in `neutral-200` filled with the action colour up to a 16 round knob on the surface with a
|
|
483
|
+
1px `neutral-300` border and the `float` shadow; one knob per value; 20 of height for the pointer. **BlockSlider**
|
|
484
|
+
is the same as a box: 34 / 38 / 48 high, `control` corners, hairline, 2 padding, a `neutral-200` fill growing
|
|
485
|
+
inside with corner 10, the label left and the value right (13, `neutral-600` / `neutral-950`), a 2px grip line
|
|
486
|
+
on hover.
|
|
487
|
+
|
|
488
|
+
### CodeInput
|
|
489
|
+
**For** a one-time code. **Not for** a password (Input).
|
|
490
|
+
- N boxes driven by one input: `md` 38 × 38 (gap 8, text 14/500), `lg` 48 × 52 (gap 10, text 18/500, for a page
|
|
491
|
+
whose only task it is); `control` corners, hairline, the surface, tabular; the active box takes the ring;
|
|
492
|
+
invalid `error-500` with a 240ms shake.
|
|
493
|
+
|
|
494
|
+
### ColorPicker · ColorField
|
|
495
|
+
**For** choosing one colour: a label's, a series', a theme's own. **Not for** a choice from a fixed set (swatches as radios).
|
|
496
|
+
- **ColorPicker** is a well: Input's box at the control height (34 square, the same border, shadow and `control` corners) with the colour inset 3px inside it, its corner the box's less that inset and no edge of its own. It reads as a control holding a colour rather than a slab of it, so it carries no more weight in a row than the field beside it. It opens a popover holding, 12 apart: a plane 176 high at one hue with a 14 round handle (2 white border), a hue BlockSlider (48) with its band along the foot, then a ColorField.
|
|
497
|
+
- **ColorField** is the value by hand: a notation Select (Hex · RGB · HSL · OKLCH, 96 wide, 28 high) 8 from the value it names. Hex is one mono Input of the same height; a notation that is three numbers is three boxes instead, 4 apart, each centred and tabular, since a colour is read and corrected a channel at a time. The arrows step a channel (Shift, ten).
|
|
498
|
+
- A value is taken once it reads as a whole colour, in the notation picked or the one it names itself, and a whole colour pasted over a single channel is taken as the colour; it is kept as hex. The text stays as typed while it is being typed, and is written out in full (the hex expanded, the number rounded) only once the field is let go.
|
|
499
|
+
- The plane follows the notation: saturation over brightness for Hex and RGB, saturation over lightness for HSL, chroma over lightness for OKLCH.
|
|
500
|
+
- Given the light and the dark surface the colour sits on (`contrast`), two readings lead the popover ("On light 2.63:1", a dot in `success` or `error`), each a toggle for its own check, and the colours that miss 3:1 as a fill are dotted over on the plane up to a 1px white line.
|
|
501
|
+
- Put the well and the field side by side, 12 apart, when the value matters as much as the look; the well alone in a dense row.
|
|
502
|
+
|
|
503
|
+
### DatePicker · DateRangePicker · Calendar
|
|
504
|
+
**For** a date in a form (DatePicker, 38 like a medium input), a period for a report or overview
|
|
505
|
+
(DateRangePicker, with presets), the month itself as content (Calendar inline). **Not for** a time or a
|
|
506
|
+
free-text date.
|
|
507
|
+
- The trigger is an Input box (sm 34 in a page head or a toolbar · md 38 in a form; 12 side, gap 8) with a 16
|
|
508
|
+
calendar icon in `neutral-600` and the
|
|
509
|
+
value 13/500 `neutral-900` (placeholder "Select date" in `neutral-600`, `neutral-700` on hover); open: border `neutral-300`.
|
|
510
|
+
- The panel is a popover (`card` corners, hairline, surface, `float` shadow, 12 padding, 4 below, opening over
|
|
511
|
+
150ms). A range panel has no padding: presets in a 144 column at the left (rows 32 high, 8 side, `item`
|
|
512
|
+
corners, 13/500 `neutral-700`; the active one on the selected wash) ruled off by a hairline, the calendar well
|
|
513
|
+
padded 12 with two months from 640, and a footer (min 42, hairline above) with the status 11 `neutral-600`
|
|
514
|
+
("Pick the last day", "14 days") and a ghost Clear once there is a range or a pick under way. Each pick starts
|
|
515
|
+
a new range rather than stretching the one set.
|
|
516
|
+
- A single date commits and closes on the day picked; picking the chosen day again keeps it. A date that is not
|
|
517
|
+
`required` has a footer under the calendar (min 42, hairline above) with a ghost Clear, as the range picker.
|
|
518
|
+
`name` posts the date as a hidden input (a range posts `<name>From` and `<name>To`); `locale` writes the value
|
|
519
|
+
in the reader's language and `labels` renames the words the pickers say.
|
|
520
|
+
- Calendar: months 24 apart; a caption 14/500 centred with 28 ghost chevrons; weekdays 11 `neutral-600`, 28 high
|
|
521
|
+
on 32 columns; days 32 × 32 with `item` corners, 13/400 `neutral-900` tabular; today 500 with a 3 dot; outside
|
|
522
|
+
days `neutral-400`; hover the 5% wash; the chosen day (or either end of a range) on the action fill in
|
|
523
|
+
`on-action`; the days between on the tint wash, the strip rounded at a row's ends.
|
|
524
|
+
|
|
525
|
+
### DropZone · DropZoneFiles · DropZoneFile
|
|
526
|
+
**For** uploading files. **Not for** an empty list (EmptyState) though it looks like one.
|
|
527
|
+
- A well with `item` corners and a 1px dashed `neutral-300` border, 16 padding, left-aligned, wrapping: a 32
|
|
528
|
+
icon tile (chip corners, hairline, `neutral-100`, a 16 upload icon), the title 13/500 and a line 13
|
|
529
|
+
`neutral-600` (2 apart), a secondary "Choose files". Dragging over: border `neutral-500` and the 3% wash;
|
|
530
|
+
invalid `error-500`; disabled 50%.
|
|
531
|
+
- Files follow under it, 16 apart, each a row (gap 12): a 32 icon tile (filled while uploading, outlined in
|
|
532
|
+
the success tone when done, `error-600` on error), the name 13/500 over a meter (4 high) while uploading or the
|
|
533
|
+
size 13 tabular `neutral-600` (the error in `error-600`), a ghost 28 × to cancel or remove.
|
|
534
|
+
- A long file name cuts in the middle (Truncate); `end` only for names read from the start.
|
|
535
|
+
|
|
536
|
+
## Forms and settings
|
|
537
|
+
|
|
538
|
+
### SettingRow · SettingGroup
|
|
539
|
+
**For** one setting: its title and description left, its one control right. **Not for** a value typed in (a
|
|
540
|
+
Field in the card), a choice with explanation (OptionRow), or several controls in one row. **With** a Switch (on
|
|
541
|
+
or off), a Select with a right chevron (a value), a secondary Button (an action); inside a `Card layout="list"`
|
|
542
|
+
per group on a settings page.
|
|
543
|
+
- Row: at least 38 high, the text left and the control right 16 apart, no padding, border or fill of its own.
|
|
544
|
+
Title 13/500 `neutral-950` (it labels the control; clicking it toggles or opens it), description 13/400
|
|
545
|
+
`neutral-600` 2 below. Disabled (`disabled`, or the whole group): the text at 50% and the control disabled
|
|
546
|
+
with it. For an action button turn `labelControl` off, so the button keeps its own text as its name.
|
|
547
|
+
- Group: a fieldset; a quiet title 13/400 `neutral-600` 12 above the rows; settings 24, a hairline at the
|
|
548
|
+
content's width and 24 apart. A `dependent` row sits with the row above it, 12 below and with no hairline
|
|
549
|
+
between, stepped in behind a 1px `neutral-200` guide line (4 in, its text 16 past the line), the line
|
|
550
|
+
running unbroken through consecutive dependents, so the pair reads as one setting; disabling it while the
|
|
551
|
+
parent is off is the caller's (`disabled`). Several dependents get an eyebrow (13/400 `neutral-600`) naming
|
|
552
|
+
what they belong to, marked `data-dependent` so it stays with the parent, behind the same line.
|
|
553
|
+
`layout="boxed"`, when the settings carry dependents that must hold together: each setting with its
|
|
554
|
+
dependents a bordered box (16 padding, `control` corners, the hairline), the boxes 8 apart and no hairlines;
|
|
555
|
+
inside a box the dependents are plain rows 20 under the setting and 12 apart.
|
|
556
|
+
|
|
557
|
+
### OptionRow · OptionList
|
|
558
|
+
**For** a choice that needs a sentence of explanation: a plan, a mode, a permission; in a dialog or a form.
|
|
559
|
+
**Not for** a plain yes/no (Checkbox) or a setting (SettingRow).
|
|
560
|
+
- A label-element row (a click anywhere toggles the control): `item` corners (10), hairline, 12 padding (8
|
|
561
|
+
vertical, 8 left with an icon tile); an optional 32 icon tile 12 from the text; the label 14/400 `neutral-950`
|
|
562
|
+
over the description 13/400 `neutral-600`; the control (a Checkbox when several may be chosen, a
|
|
563
|
+
RadioGroupItem when one) at the right, 12 from the text; about 48 high with a tile, 44 without. Hover border `neutral-300`; disabled 50%. Rows 8 apart in a list.
|
|
564
|
+
|
|
565
|
+
### ReadonlyField
|
|
566
|
+
**For** a read-only fact in a form (an ID, an API key to copy) or a reading with its status (`vital`). **Not
|
|
567
|
+
for** an editable value (Input) or an object's facts (DescriptionList).
|
|
568
|
+
- `well`: the label 13/400 `neutral-600` 6 above a well (sm 34 · md 38, 12 side, `control` corners, the 4% wash,
|
|
569
|
+
no border) holding the value 13/400 `neutral-900` tabular and, when copyable, a ghost 28 copy button sitting
|
|
570
|
+
concentric at the right ("—" in `neutral-600` when empty).
|
|
571
|
+
- `vital`: a 29 pill (hairline, 12 side, gap 12): the label 13/400 `neutral-600`, then a 6 status dot and the
|
|
572
|
+
value 13/500 `neutral-950` tabular at the right.
|
|
573
|
+
- A key, an ID, a hash or a URL in the well cuts in the middle (`truncate`, Truncate); the copy button still copies the
|
|
574
|
+
whole. Other values cut at the end.
|
|
575
|
+
|
|
576
|
+
## Filtering
|
|
577
|
+
|
|
578
|
+
### FilterMenu · FilterMenuTrigger · FilterMenuContent · FilterMenuGroup · FilterMenuItem · FilterMenuClear · FilterBar
|
|
579
|
+
**For** filtering an index by several groups of values. **Not for** one visible choice (SegmentedControl) or
|
|
580
|
+
one value (Select).
|
|
581
|
+
- **Trigger**: a secondary 34 button with a 16 filter icon and "Filter"; once filters apply, a count badge (20,
|
|
582
|
+
`neutral-500` at 20% behind 11/500 `neutral-800`; on a primary trigger `on-action` at 20% behind `on-action`)
|
|
583
|
+
pulled to its edge.
|
|
584
|
+
- **Content**: a menu panel 240 wide; groups each under a label 11/500 `neutral-600`; items are checkbox rows
|
|
585
|
+
(36 high, a 16 indicator with a 12 check, the value 13/500 `neutral-700`, a count 11 `neutral-600` at the end)
|
|
586
|
+
that keep the menu open while ticked; "Clear all" (**FilterMenuClear**) at the foot under a full-width
|
|
587
|
+
hairline; pass it the trigger's `count` and it is disabled while nothing is picked.
|
|
588
|
+
- **FilterBar**: the Filter trigger and the applied filters in one row, wrapping, gap 8: the trigger first, then
|
|
589
|
+
one soft Chip per group ("Status is Paid or Overdue", with an × that removes it) and a ghost "Clear all" once
|
|
590
|
+
there is something to clear. The chips wrap to more lines rather than push the trigger along.
|
|
591
|
+
|
|
592
|
+
### Chip · ChipAction
|
|
593
|
+
**For** an applied filter ("Status is Paid"), a picked value, a tag, or a prompt offered (`outline`). **Not
|
|
594
|
+
for** a status (Badge) or an action (Button).
|
|
595
|
+
- `sm` 24 high, 8 side, a 12 icon; `md` 28 high, 10 side, a 16 icon. `pill` corners, 13/400, no wrap. `soft`,
|
|
596
|
+
for what has been picked or applied (a filter, a value, a tag): `neutral-100` fill, `neutral-600` text
|
|
597
|
+
(hover `neutral-200` and `neutral-950` when clickable); `outline`, for what is offered and not yet taken (a
|
|
598
|
+
prompt for the assistant): a hairline, `neutral-950` text (hover border `neutral-300`). An × at the end (a
|
|
599
|
+
20 target with a 12 icon, 12 from the label) removes it, only on a chip the reader can take away.
|
|
600
|
+
|
|
601
|
+
### FilterConditions · FilterCondition · FilterConditionField · FilterConditionOperator · FilterConditionValue · FilterConditionRemove · FilterConditionAdd
|
|
602
|
+
**For** a table whose filtering is the work: each applied filter is a sentence, field · operator · value, and
|
|
603
|
+
every part of the sentence is the control that changes it, so the applied filters are the controls and need
|
|
604
|
+
no second display. **Not for** one or two filters a table keeps permanently visible (a select, a segmented
|
|
605
|
+
control) or a quick tick-list (FilterMenu); the three coexist in a table's bar. **With** the table's `toolbar`
|
|
606
|
+
slot, a search, selects; `filterOperators` for the operator sets.
|
|
607
|
+
- A condition is the **inline Toolbar** without its shadow: 34 high, `control` corners, a hairline, the
|
|
608
|
+
surface, segments split by hairlines. Segments: the **field** (a 16 icon and the name, 13/500
|
|
609
|
+
`neutral-950`, 10 side, not a control), the **operator** (13/400 `neutral-600`, a radio menu of what the
|
|
610
|
+
field can do), the **value** (13/500 `neutral-950`; "Maya Chen +1" when several; a checkbox menu for a
|
|
611
|
+
many-valued field, radios for one), and a **×** (a 14 icon in `neutral-500`, 8 side). Hover on a segment the
|
|
612
|
+
5% wash inset 2. A segment that opens a menu of your own is a **FilterConditionSegment** (a toolbar button, 10
|
|
613
|
+
side, 13/500 `neutral-950`; `muted` gives the operator's 13/400 `neutral-600`); `filterValueSummary` writes
|
|
614
|
+
the "Maya Chen +1" a value segment shows.
|
|
615
|
+
- Operators by kind: many-valued *has any of · has all of · has none of · is empty · is not empty*; one-valued
|
|
616
|
+
*is · is not*; boolean *is on · is off*; number *is · is not · is more than · is less than*; date *is · is
|
|
617
|
+
before · is after · is in the last*; text *contains · does not contain · is · starts with*. The first is the
|
|
618
|
+
default when a condition is added (`defaultFilterOperator(kind)`). *is empty*, *is not empty*, *is on* and
|
|
619
|
+
*is off* take no value: given the condition's `operator`, the value segment leaves itself out and the
|
|
620
|
+
sentence ends at the operator (`filterOperatorTakesValue` says which).
|
|
621
|
+
- A value typed rather than picked (a number, a date, a piece of text: "is more than 500") is a
|
|
622
|
+
**FilterConditionInput**: a borderless input in the segment, 13/500 `neutral-950`, 10 side, growing with what
|
|
623
|
+
is typed from 64 to 192 wide, placeholder `neutral-600`; 16 on touch, as an Input.
|
|
624
|
+
- **Narrow:** the value segment truncates with an ellipsis before the condition clips; conditions still wrap as
|
|
625
|
+
whole chips.
|
|
626
|
+
- **Add** is a 34 secondary square with the filter icon opening the fields not yet applied (with a search when
|
|
627
|
+
long); picking one adds the condition with its default operator and no value. The conditions, a ghost
|
|
628
|
+
"Clear all" (once anything applies) and the add button sit in one wrapping row, in that order, 8 apart.
|
|
629
|
+
|
|
630
|
+
## Overlays
|
|
631
|
+
|
|
632
|
+
### Dialog
|
|
633
|
+
**For** a confirmation of what cannot be undone, or a short form (two or three fields). **Not for** an action
|
|
634
|
+
that can be undone (do it, and offer Undo in a Toast), reading beside the page (Sheet), an item's editor (its
|
|
635
|
+
own page), a long form (its own page). **With** DialogTrigger, DialogContent, DialogHeader,
|
|
636
|
+
DialogTitle, DialogDescription, DialogBody, DialogFooter, DialogClose.
|
|
637
|
+
- Centred, 480 wide (never wider than the viewport − 32), `card` corners (16), hairline, surface, `sheet`
|
|
638
|
+
shadow, a scrim of black at 40%; enters over 200ms from 8 below. Three parts, only the body scrolls:
|
|
639
|
+
- **Header** 52 high, 20 left, 11 right, hairline below: the title 14/500 `neutral-950` (one line), a secondary
|
|
640
|
+
30 close button (corner 12, a 14 ×) at the right.
|
|
641
|
+
- **Body**: 20 side, 16 vertical, parts 16 apart; the description 13 `neutral-600` first.
|
|
642
|
+
- **Footer** 52 high, 11 side, hairline above: a secondary and the primary right-aligned, 8 apart; a
|
|
643
|
+
destructive confirm is a primary button labelled with the verb.
|
|
644
|
+
|
|
645
|
+
### Sheet
|
|
646
|
+
**For** history, details, comments: things read beside the page, non-modal, the page still usable. **Not for**
|
|
647
|
+
an item's editor or a form that commits (its own page or a dialog). **With** SheetTrigger, SheetContent,
|
|
648
|
+
SheetHeader, SheetTitle, SheetBody, SheetSection, SheetClose, SheetArea.
|
|
649
|
+
- At the right, 512 wide, 16 from the top, right and bottom of the viewport (or of its `SheetArea`: the content
|
|
650
|
+
area below the header bar and beside the sidebar), `panel` corners (20), hairline, surface, `sheet` shadow;
|
|
651
|
+
enters over 200ms from 16 to the right; z 40, below dialogs. A scrim only when fully modal.
|
|
652
|
+
- **Header** 52 high, 16 left, 6 right, gap 8, hairline below: a 16 icon in `neutral-950`, the title 14/500, a
|
|
653
|
+
ghost 36 close at the right. **Body** scrolls, no padding. **Section**: 20 padding; every section after the
|
|
654
|
+
first ruled off by a **full-width** hairline above it.
|
|
655
|
+
|
|
656
|
+
### Popover
|
|
657
|
+
**For** a small form or detail anchored to its trigger: a date, a share setting, a filter's values, column
|
|
658
|
+
settings. **Not for** a list of actions (DropdownMenu) or a label (Tooltip). **With** PopoverTrigger,
|
|
659
|
+
PopoverContent, PopoverHeader, PopoverTitle, PopoverDescription, PopoverClose.
|
|
660
|
+
- 288 wide, 12 padding, parts 12 apart, `card` corners (16), hairline, surface, `float` shadow, 13
|
|
661
|
+
`neutral-700`; 4 below its trigger, centred; grows from 95% over 150ms, leaves in 100ms. Header: the title
|
|
662
|
+
14/500 `neutral-950` over the description 13 `neutral-600`, 2 apart.
|
|
663
|
+
|
|
664
|
+
### MenuItem · MenuItemIndicator · MenuItemShortcut
|
|
665
|
+
**For** the row every popup list is made of: a select's options, a combobox's, a menu's actions, a filter menu's
|
|
666
|
+
values, the command menu's commands; each list renders its own item through it, so its keyboard and state stay
|
|
667
|
+
the list's. **Not for** a row on a page (a table row, a setting row, a bar list row).
|
|
668
|
+
- 36 high, 12 side, 8 vertical, gap 8, `item` corners (10, nested inside the panel's 16), 13/500 `neutral-700`,
|
|
669
|
+
icons 14 `neutral-600`; highlighted the 5% wash and `neutral-800`; selected the selected wash and
|
|
670
|
+
`neutral-950`; `danger` in `error-600`; disabled 50%.
|
|
671
|
+
- In order: the **leading** piece (a 16 icon, an avatar, an indicator, a chip), the name (truncating), **meta**
|
|
672
|
+
inline after it (400 `neutral-600`, 6 from the name: a badge, "you"), an optional **description** under the
|
|
673
|
+
name (11/400 `neutral-600`; the row grows, 10 vertical), and the **trailing** pieces at the far end (11
|
|
674
|
+
`neutral-600`, 8 apart: a check, a shortcut, a count, a chevron to a submenu). What leads sets the rhythm: a 24
|
|
675
|
+
avatar or a chip pads the row 10 vertical, a 32 or 36 avatar 12, and beside either one line of text sits 10
|
|
676
|
+
from it.
|
|
677
|
+
- **MenuItemIndicator**: a 16 checkbox (corner `chip` − 2) or radio (round) at the row's head, a 1px
|
|
678
|
+
`neutral-300` border (as a checkbox's); checked or selected, the action fill with a 12 check or a 6 dot in `on-action`.
|
|
679
|
+
**MenuItemShortcut**: 11/500 `neutral-600`, slightly tracked ("⌘D", "G I"); hidden on a touch screen, as a
|
|
680
|
+
Kbd.
|
|
681
|
+
|
|
682
|
+
### Tooltip
|
|
683
|
+
**For** naming an icon-only control. **Not for** explanation (InfoTip) or anything that must stay. **With**
|
|
684
|
+
TooltipTrigger, TooltipContent, TooltipProvider.
|
|
685
|
+
- A dark chip: `neutral-950` behind 11/500 `neutral-50`, 8 side, 4 vertical, chip corners, max 256 wide, 6 above
|
|
686
|
+
its trigger (another side when given), after a 300ms hover; fades over 200ms. A lone Tooltip brings its own
|
|
687
|
+
provider; a **TooltipProvider** round a rail or a toolbar groups the tooltips inside it, so once one has shown
|
|
688
|
+
the next opens at once, without the wait or the fade.
|
|
689
|
+
|
|
690
|
+
### InfoTip
|
|
691
|
+
**For** explaining a heading, beside a section or card title. **Not for** help text under a title (never a
|
|
692
|
+
paragraph of help).
|
|
693
|
+
- A 16 info icon in `neutral-500` (`neutral-800` on hover and open, a 24 target), opening a small popover on
|
|
694
|
+
hover, focus and tap: 10 side, 6 vertical, `item` corners, max 256, 13 `neutral-700`, 6 above.
|
|
695
|
+
|
|
696
|
+
## Tables
|
|
697
|
+
|
|
698
|
+
### Table
|
|
699
|
+
**For** a list of objects (`ruled`, in its own frame on the page), or a short ranked breakdown inside a card
|
|
700
|
+
(`rows`, frameless, since the card already frames it; when each row has one figure, a BarList). **Not for**
|
|
701
|
+
key–value facts (DescriptionList) or a settings list. **With** TableHeader, TableBody, TableFooter, TableRow,
|
|
702
|
+
TableHead, TableCell, TableGroupRow, TableCaption; Pagination under it; Checkbox for selection; a ghost
|
|
703
|
+
`icon-sm` ellipsis (28) in the last column for the row's DropdownMenu, which the row's 41 holds without growing; TableHead, TableCell, TableDragCell, EditableCell and the fold parts in the sections below. Values worked on cell by cell are a DataGrid.
|
|
704
|
+
|
|
705
|
+
| variant | frame | head | row / cell |
|
|
706
|
+
| ------- | ----------------------------------------------- | ----------------------------------------------- | --------------------------------------------------------------- |
|
|
707
|
+
| ruled | `control` corners (12), hairline, surface, scrolls sideways | 41 high, 12 padding, `neutral-100` fill, 13/400 `neutral-600`, hairline below | 41 high, 12 padding, hairline below (the last row drops it), 13/500 `neutral-900` |
|
|
708
|
+
| rows | none | 12 side, 2 vertical, 13/400 `neutral-700` | 34 high, 12 side, 8 vertical, the 4% wash with `control` corners at the row's ends, 13/400 `neutral-600` (first cell `neutral-800`), rows 8 apart |
|
|
709
|
+
|
|
710
|
+
Numbers tabular and right-aligned; the first column is the name; meta columns `neutral-700`; a status is a badge;
|
|
711
|
+
a person a 24 avatar and name; a row with a second line of meta is 54 high. A `ruled` body row hovers the 3%
|
|
712
|
+
wash; a selected row (`data-selected`) takes the selected wash, which hover leaves as it is. **TableGroupRow**, only when the list falls into sections: a 34 muted row across all columns (`neutral-100`, 13/400 `neutral-700`, a hint 11
|
|
713
|
+
`neutral-600` in parentheses). **TableFooter**, only when the amounts add up to sums the reader needs: an optional head row of the columns the sums sit in (the head's
|
|
714
|
+
fill, 8 vertical padding), then a row per sum with no rules, the first cell `neutral-700`; the total's cells get a
|
|
715
|
+
hairline above, 12 top and 16 bottom padding. **TableCaption** under the table, 13 `neutral-600`. A `toolbar`
|
|
716
|
+
stays put in the frame while a table wider than it scrolls sideways under it.
|
|
717
|
+
|
|
718
|
+
**Narrow:** a head or cell keeps to one line (a second line of meta still stacks under the first), and the frame
|
|
719
|
+
scrolls sideways under an edge fade at the side that has more, so it reads as scrollable. A column marked
|
|
720
|
+
`optional` on its head and cells (an owner, a last seen: what the reader can do without) hides while the frame is
|
|
721
|
+
under 640; the name and the row's menu are never optional.
|
|
722
|
+
|
|
723
|
+
### TableHead
|
|
724
|
+
**For** a column's name over its values, 13/400 `neutral-600` on the head's fill. **Sorting**, only on the columns
|
|
725
|
+
a reader orders by (a name, a date, an amount), never every column: the label is a button with a 14 mark 4 after
|
|
726
|
+
it (before it on a right-aligned column, so the label stays flush with the figures). Unsorted, the mark is an
|
|
727
|
+
up-down chevron in `neutral-500` shown only under the pointer or focus (always on touch), so a sortable head row
|
|
728
|
+
reads as plain as any other; sorted, an arrow in `neutral-900` (up ascending, turned down descending) and the label
|
|
729
|
+
`neutral-900`. A click steps off → first order → the other → off; numbers and dates start descending (the largest
|
|
730
|
+
or latest first, which is why they are sorted), text ascending. One column sorts at a time; the head carries
|
|
731
|
+
`aria-sort`.
|
|
732
|
+
|
|
733
|
+
**Resizing** (`width`, `onWidthChange`), only on a table the reader works in for long, where columns hold values
|
|
734
|
+
of very different lengths: an 8 target inside the head's right edge. Under the pointer the head shows its edge as a
|
|
735
|
+
hairline (`neutral-300`, 12 in from top and bottom); on the target, or dragging, the edge is the accent at 2 down
|
|
736
|
+
the head's full height, and while dragging down every cell of the column, so the reader sees what is cut. The arrow
|
|
737
|
+
keys move a focused edge 8 (32 with Shift); a double click fits the column to its widest value. A column never goes
|
|
738
|
+
under its own label (or `minWidth`, 48). The table then lays out by its widths: every column given one but the
|
|
739
|
+
name, which takes what is left until it is resized itself; once every column has a width the table is as wide as
|
|
740
|
+
they add up to, scrolling sideways past its frame, or leaving room at its right with the head's band running on to
|
|
741
|
+
the frame's edge. A value wider than its column ends in an ellipsis. **Moving** (`movable`, with `onColumnMove` on
|
|
742
|
+
the TableHeader), only where readers arrange the columns to their own work: under the pointer a 14 grip in
|
|
743
|
+
`neutral-500` shows in the head's left padding, 5 clear of the label (always on touch), the same grip a row's
|
|
744
|
+
TableDragCell has. The head or its grip is picked up (the grab cursor; a press on a sortable label that does not
|
|
745
|
+
move still sorts) and the column lifts as one strip on the surface, its sides ruled, the columns it passes stepping
|
|
746
|
+
aside (150, ease-out); let go, it settles into its place the same way, and Escape puts it back. ← → on the focused
|
|
747
|
+
grip move it a place. The selection, grip and menu columns never move. While a column or row is dragged or
|
|
748
|
+
resized the cursor holds for the whole page, and nothing under the pointer hovers or gets its text selected.
|
|
749
|
+
|
|
750
|
+
### TableCell
|
|
751
|
+
**For** one value in a row. Numbers tabular and right-aligned (`numeric`); the name 13/500 `neutral-900`, meta
|
|
752
|
+
13/400 `neutral-700`. A long value that is told apart by its end (a key, a path, a hash) is cut in the middle with
|
|
753
|
+
a Truncate, the whole on hover and in a copy; a name is cut at its end. **Copy** (`copy`), only for a value the
|
|
754
|
+
reader pastes elsewhere: an ID, an email, a key, a hash: a 24 ghost button (14 icon, `chip` corners, the 5% wash
|
|
755
|
+
under the pointer) 8 after the value, so it reads as a control of its own beside it; on a right-aligned cell it
|
|
756
|
+
goes before the value. It shows while the cell is under the pointer or the button has focus (always on touch) and
|
|
757
|
+
keeps its room while hidden, so nothing moves; a copy turns the icon to a tick for 1.5 s and is announced. Not on
|
|
758
|
+
names or amounts, which nobody copies on their own. A box alone in a cell (`TableSelectCell` for the selection
|
|
759
|
+
column) sits on the row's middle and never grows the row.
|
|
760
|
+
|
|
761
|
+
### TableDragCell
|
|
762
|
+
**For** a row whose place in the list is set by hand, where the order means something (a backlog's priority, the
|
|
763
|
+
lines of an invoice as they print), with `onRowMove` on the TableBody. **Not for** an order that follows a value:
|
|
764
|
+
that is sorting (TableHead). The first column (44, before the selection's box), its head empty: a 14 grip in
|
|
765
|
+
`neutral-500` on a 20 × 28 target (`chip` corners, the 5% wash under the pointer), lending the row's padding like
|
|
766
|
+
the ellipsis so the row stays 41, shown only under the pointer or focus (always on touch), so a list that can be
|
|
767
|
+
reordered reads as plain as one that cannot. Moved 3 from where it was pressed, the row lifts (the surface, a
|
|
768
|
+
hairline ring and the `float` shadow) and follows the pointer, held within the list; the rows it passes step aside
|
|
769
|
+
by its height (150, ease-out), so the gap it will drop into is always open; let go, it settles into the gap the same
|
|
770
|
+
way, and Escape puts it back. ↑ ↓ with the grip focused move the row a place, focus staying on
|
|
771
|
+
it. A row nested under a fold has no grip: it moves with its parent.
|
|
772
|
+
|
|
773
|
+
### EditableCell
|
|
774
|
+
**For** a value worked on where it sits, only where the table is where the values are worked on (`patterns.md`).
|
|
775
|
+
The cell reads as its value. Under the pointer or on focus a 14 mark in `neutral-500` shows at the cell's end: a
|
|
776
|
+
pencil for a typed value, a chevron for a pick, the one hint that it can change (before the value on a
|
|
777
|
+
right-aligned cell, so the figures stay flush), with the pointer cursor, since a click is what starts the edit
|
|
778
|
+
(the text cursor belongs to the field once it is open). A click, or Enter on it, turns it into a borderless input
|
|
779
|
+
on the tint wash with the text exactly where it was, so the row keeps its height, and rings the cell inside its
|
|
780
|
+
edges in the accent (`primary-500`, 2), so the cell being edited is plain to see among the values. A 20 ghost
|
|
781
|
+
check at the field's end saves (before the figures on a right-aligned cell): the save is an action you can see and
|
|
782
|
+
tap, not only a key; Enter or a click away saves too, Escape puts the value back, and focus returns to the cell. A value from a set (a VAT rate) opens a list under the cell, its
|
|
783
|
+
left edge on the cell's; the pick saves. Focus on a cell rings the whole cell, inside its edges. A sum the table
|
|
784
|
+
works out stays a plain cell and follows the edit.
|
|
785
|
+
|
|
786
|
+
### TableTree · TableTreeCell · TableTreeRows · TableTreeHead · TableTreePanel
|
|
787
|
+
**For** a row with more rows of the same kind under it, opened now and then: an invoice's instalments, a folder's
|
|
788
|
+
files and folders. The rows a fold shows (`TableTreeRows`) are real rows of the table: the same columns filled
|
|
789
|
+
the same way, the same height, each with its own box when rows are selected, and a nested row can fold in turn.
|
|
790
|
+
Rows of the same kind (instalments under an invoice, files under a folder) **align with the columns**, because
|
|
791
|
+
each value is a value of that column. Rows that are a **breakdown** of the row above (a payout by source, a
|
|
792
|
+
source by plan: `TableTreeRows shift`) **step in a level (a step) in every column**: left-aligned values step right,
|
|
793
|
+
right-aligned figures step left, in from the column's edge, and a column the breakdown has no value for (the
|
|
794
|
+
date) stays empty. So no part sits under its parent's value and reads as a peer of it, while it stays in the
|
|
795
|
+
column it belongs to; each level deeper steps again. Ticking a parent ticks all its children; with some ticked
|
|
796
|
+
it shows mixed.
|
|
797
|
+
|
|
798
|
+
Rows of **another kind** (an invoice's lines under the invoice) take a head of their own (`TableTreeHead`): the
|
|
799
|
+
table's head row again, the same fill, height and type, as the first row the fold shows, naming what each column
|
|
800
|
+
holds for the rows under it (Item, Qty, Rate where the table says Invoice, Client, Status); its first label steps in
|
|
801
|
+
with the rows, and a column they leave empty keeps an empty head. The rows then sit on the table's columns and
|
|
802
|
+
read against those labels, so a quantity under the table's Status reads as a quantity, not a status.
|
|
803
|
+
|
|
804
|
+
**Anything that is not rows** (a diff, a history, a form, a preview) goes in a panel (`TableTreePanel`): one row,
|
|
805
|
+
its action cells empty and the parent's line running down beside it to 16 over its foot. It **splits on a
|
|
806
|
+
column's edge, the way the table does**: what the content is (a title in 13/500 `neutral-900`, who and when in
|
|
807
|
+
`neutral-600`, an action) in the leading columns (`aside`, `asideSpan`), starting a step in where a child's name
|
|
808
|
+
would, and the content itself in the columns after, its left edge on theirs. So the panel follows the table's own
|
|
809
|
+
columns rather than sitting as a block centred in a row. Without an aside the content takes every data column, a
|
|
810
|
+
step in. It grows to what it holds, 16 above and below, both sides from the top, and its text wraps. Inside,
|
|
811
|
+
Continuum's own parts at their own sizes; one primary action at most, and usually none, since the page has its
|
|
812
|
+
own.
|
|
813
|
+
|
|
814
|
+
**Layout.** The fold's control is an action of the row, so it has its own **fold column** after the selection
|
|
815
|
+
column (44, 12 padding, an empty head). A top-level row that folds shows a 20 ghost chevron there, `chip` corners (6) (right closed,
|
|
816
|
+
turned down open, 150 ms); one that does not keeps the slot empty. A **nested row's box moves into the fold
|
|
817
|
+
column**, centred under its parent's chevron (its cell in the selection column stays empty); a nested row that
|
|
818
|
+
folds puts its chevron a **step** after its box, and its children's boxes sit under that chevron, so every level
|
|
819
|
+
repeats the top level's box-and-chevron pair, the same distance apart, one step further in. The step is the
|
|
820
|
+
distance from a box to its chevron: 44 with a selection column (its width), 28 without (a 20 chevron and the 8
|
|
821
|
+
after it). Keep the selection and fold columns at 44 by leaving one data column without a width to take the
|
|
822
|
+
rest; when every column has a width, the table spreads the spare room over all of them and the pairs no longer
|
|
823
|
+
match. The fold column grows a step a level and fits the deepest level shown. Box and chevron share the row's
|
|
824
|
+
middle. The nested row's first data cell steps in a step a level, its name 13/400 `neutral-700` (and a column
|
|
825
|
+
repeating the parent's value the same), so it is set back from its parent's.
|
|
826
|
+
|
|
827
|
+
The **guide line** (a `neutral-200` hairline) hangs from the open chevron at its centre x, from 4 under it, and
|
|
828
|
+
threads between the children's boxes (4 clear of each) to the last child. Without selection it runs straight
|
|
829
|
+
through to the middle of the last child. It can be left off (`guides={false}`) when the moved boxes are enough to
|
|
830
|
+
show the level; it is on by default, since it ties each box to the chevron it hangs from. Nested rows fade in over
|
|
831
|
+
200 ms. The footer's label cell spans the action columns too.
|
|
832
|
+
|
|
833
|
+
### TableToolbar · TableSearch · TableToolbarEnd · TableConditions
|
|
834
|
+
**For** what finds and narrows one table, on that table: passed to `Table`'s `toolbar`, drawn inside its frame
|
|
835
|
+
above the column head. **Not for** page-wide controls (the period, Export: the page head) or the list's views
|
|
836
|
+
(the dock).
|
|
837
|
+
- **TableToolbar**, the bar: min 44 high, 6 padding all round, a hairline below; it wraps when
|
|
838
|
+
its contents outgrow one line, so the head never moves. **TableSearch** at its left: a small outlined `Input`
|
|
839
|
+
(the hairline box, a leading 16 search icon, 34 high, 256 wide, giving way before the filters).
|
|
840
|
+
**TableToolbarEnd** at its right, items 8 apart: the selects a table keeps visible, a FilterMenu, and, while
|
|
841
|
+
no condition applies, the **add button** of the conditions (a 34 secondary square with the filter icon).
|
|
842
|
+
- **TableConditions**, under the bar, **only while a condition applies**: the same 44 row, same padding, with a
|
|
843
|
+
hairline below, holding the conditions (each field · operator · value · ×) and a ghost "Clear all", 8 apart,
|
|
844
|
+
wrapping, and the add button at its right end (a TableToolbarEnd). The conditions never share the search's
|
|
845
|
+
bar, so narrowing reads apart from finding.
|
|
846
|
+
- **Narrow:** the search gives up its 256 and takes the rest of the bar, the end group beside it.
|
|
847
|
+
|
|
848
|
+
### DataGrid
|
|
849
|
+
**For** values worked on cell by cell, as in a spreadsheet: a budget, a plan, a price list, where the reader
|
|
850
|
+
selects a block of cells, types over them, pastes them in from elsewhere and fills them down, and every cell is a
|
|
851
|
+
value of its own. **Not for** a list of objects (Table: a row is a thing, read and opened a row at a time) or a few
|
|
852
|
+
values of a list edited where they sit (EditableCell).
|
|
853
|
+
- **Frame:** the ruled table's frame (`control` corners, a hairline, the surface). Heads on the `neutral-100` fill,
|
|
854
|
+
13/400 `neutral-600`: a column head 32 over each column (its name, or a letter, centred, when the columns have
|
|
855
|
+
no names), a 44 row head with the row's number, centred and tabular; both stay in view as the grid scrolls.
|
|
856
|
+
- **Width:** each column keeps its own width (112 by default, resized by the reader); when they end short of the
|
|
857
|
+
frame the last column takes the room that is left, so the grid always fills its frame and never stops short
|
|
858
|
+
of its right edge. Wider than the frame, it scrolls.
|
|
859
|
+
- **Toolbar** (`toolbar`): what works on this grid (a scenario, a view, where it stands) on a TableToolbar inside
|
|
860
|
+
the frame over the column heads, as a table's; it stays put while the grid scrolls. The page's own actions
|
|
861
|
+
(Share, Publish) are the header bar's, never on it.
|
|
862
|
+
- **Summary rows** (`summaryRows`): **when** the sheet sums itself (a total, a target, a gap), its last rows: a
|
|
863
|
+
`neutral-400` rule over the first of them and their cells in 13/500 `neutral-950`, as a spreadsheet writes its
|
|
864
|
+
totals, a negative one in `error-600` (a shortfall is the sheet's problem). Worked out from the rows above, so
|
|
865
|
+
what is typed over a total is put back.
|
|
866
|
+
- **Cells:** 32 high, 8 side padding, hairlines on both axes (`neutral-200`, the one grid that rules both ways
|
|
867
|
+
with the schedule), 13/400 `neutral-900`; a number right-aligned and tabular, text left; one line, ending in an
|
|
868
|
+
ellipsis. The cell cursor over cells.
|
|
869
|
+
- **Selection,** the grid's one accent: the cell it starts from is ringed 2 on its lines, a block dragged or
|
|
870
|
+
Shift-extended from it is outlined 1 on its lines and washed in the accent at 10%, the start cell left clear
|
|
871
|
+
inside its ring. Ctrl or ⌘ held, a click, a drag or a head adds another block and keeps the ones before, each
|
|
872
|
+
outlined and washed the same, the newest one's start cell ringed; a plain click starts over. The heads over the
|
|
873
|
+
selection darken (`neutral-200`, `neutral-900` text) and take the accent on their edge facing the cells, so the
|
|
874
|
+
blocks read from the heads as well. An 8 square on a lone block's corner (the
|
|
875
|
+
accent, a 1 surface rim) drags a fill: the cells it will write outlined dashed, then a run of numbers a constant
|
|
876
|
+
step apart carries on as a series and anything else repeats. While the grid does not have focus the accent turns
|
|
877
|
+
`neutral-500` and the wash neutral, so only the grid being worked in is in colour.
|
|
878
|
+
- **Editing:** typing over a cell replaces its value; Enter, F2 or a double click opens it with its value. The open
|
|
879
|
+
cell is a borderless 13 input on the tint wash, the text where it was, ringed in the accent; Enter saves and moves
|
|
880
|
+
down, Tab right (Shift back), Escape puts the value back. Delete clears every selected block; Ctrl or ⌘ + C, X and V copy,
|
|
881
|
+
cut and paste it as tab-separated rows (one value pasted fills the whole block), Z undoes and Y redoes.
|
|
882
|
+
- **Keyboard:** the arrows move the start cell (Shift extends the block, Ctrl or ⌘ runs to the edge), Home and End
|
|
883
|
+
to the row's ends, Ctrl or ⌘ + A everything, Escape back to one cell. A column head selects its column and a row
|
|
884
|
+
head its row (dragged along the heads, the ones it passes); the corner selects all. The footer sums every
|
|
885
|
+
selected block, a cell in two counted once.
|
|
886
|
+
- **Sizing:** a column's edge and a row's foot are dragged from the heads (an 8 target, the accent at 2 under the
|
|
887
|
+
pointer); a double click returns it to its own size. A row never goes under 32.
|
|
888
|
+
- **Footer** (`footer`), only when the reader needs what a selection adds up to: a 32 band under the grid on the
|
|
889
|
+
head's fill, ruled off, 13 `neutral-600` with the figures `neutral-900` 500: Sum, Average and Count of the
|
|
890
|
+
numbers selected, 16 apart.
|
|
891
|
+
|
|
892
|
+
## Cards and lists
|
|
893
|
+
|
|
894
|
+
### Card · CardHeader · CardTitle · CardValue
|
|
895
|
+
**For** a self-contained unit: a chart drawn by hand, a group of settings, a list, a block of facts. **Not for** a
|
|
896
|
+
key figure (StatCard: the one card a figure is drawn in), a page
|
|
897
|
+
section (space), a header (never in a card), a form (sections), or inside another card (the one exception is in
|
|
898
|
+
`foundations.md`, Surfaces and depth).
|
|
899
|
+
|
|
900
|
+
| layout | padding | gap | for |
|
|
901
|
+
| ------- | ----------------------- | --- | ------------------------------------- |
|
|
902
|
+
| default | 16 | 16 | a stat card, a small unit |
|
|
903
|
+
| list | 20 | 16 | a list, a group of settings, facts |
|
|
904
|
+
| chart | 20, 48 at the bottom | 32 | a chart drawn by hand, with room under its x labels; the kit's charts bring their own card (`charts.md`) |
|
|
905
|
+
|
|
906
|
+
`card` corners (16), hairline, surface, no shadow. Header: the title 13/400 `neutral-600` over the value (2
|
|
907
|
+
apart); value `md` 18/500 in a stat card (20/500 once it grows a chart or facts), `lg` 24/500 or `xl` 31/500 in a chart card's head, tabular; a figure
|
|
908
|
+
row puts the value and its delta (13,
|
|
909
|
+
`success-800` for good news, `error-600` for bad) on one baseline, 8 apart. The colour follows what the change
|
|
910
|
+
means, not its direction: pass `trend` (`up` good, `down` bad) whenever a fall is good news (churn, costs,
|
|
911
|
+
refunds). Without a `trend`, a delta whose text starts with a minus (a hyphen, the minus sign or an en dash)
|
|
912
|
+
reads as bad, anything else as good.
|
|
913
|
+
- **A card with a head puts the rest in `CardContent`**, and what closes it in `CardFooter`: plain they add
|
|
914
|
+
nothing, but a theme that frames its cards (`theming.md`, `cards`) stands the head and the foot on the frame
|
|
915
|
+
and stages the content. A card's padding and gap are its values, set on it, never a padding class, which would
|
|
916
|
+
also override the framed values. The library's titled parts (StatCard, the chart cards, a BarList with a
|
|
917
|
+
title, Checklist, a SettingGroup with a title) do it themselves; a table stays plain, its toolbar being part of
|
|
918
|
+
what it holds.
|
|
919
|
+
|
|
920
|
+
### StatCard
|
|
921
|
+
**For** one key figure with its change, one of the two to four a reader comes to a page for. **Not for** the
|
|
922
|
+
figure a chart already leads with, a lone figure (a line of text, or its chart card's head), a fact that
|
|
923
|
+
happens to be a number (with the facts), or filling a row.
|
|
924
|
+
- A default Card with gap 12: the label 13/400 `neutral-600`, the value 18/500 `neutral-950` 4 below, a pill
|
|
925
|
+
badge (22, success for good news, error for bad, neutral flat) 12 below, aligned left, only when the figure
|
|
926
|
+
has a change to show. A secondary figure that belongs to the value ("1 invoice, due 30 Nov", "of 418") is its
|
|
927
|
+
`note`: 13 `neutral-600`, 4 under the value; nothing sits inline after the value or is folded into the label.
|
|
928
|
+
`trend` as on a Card (above); `neutral` for a change that is neither good nor bad.
|
|
929
|
+
- It grows by parts, each **only when the reader needs that much more of the figure**, never to make a plain
|
|
930
|
+
row look full: `comparison`, what the change is measured against ("on last month"), 13 `neutral-600` 8
|
|
931
|
+
after the pill, **when the period is not named once for the whole row** (the page head's line or its range
|
|
932
|
+
control names it, and then no card repeats it); `chart`, a Sparkline (`charts.md`), **when which way the
|
|
933
|
+
figure has been going is part of the answer**; `facts`, two or three figures that stand beside the key one
|
|
934
|
+
(a plan, a target, the period before, a figure it is made of), each a 13 `neutral-600` label and a 13/500
|
|
935
|
+
`neutral-950` tabular value 6 after it, 20 apart; `icon` (16 `neutral-600`, 8 before the label) and
|
|
936
|
+
`actions` (a ghost `icon-sm` ⋯ on the label's line, pulled into the padding so the line keeps its height),
|
|
937
|
+
**on a dashboard of many cards**, where the icon finds a card and the menu holds what is done with that
|
|
938
|
+
figure (open its report, set a target). A fact is never the figure again in other words, and never a fourth:
|
|
939
|
+
past three it is a table.
|
|
940
|
+
- **A card with a chart or facts reads in four zones, each parted from the next**, or it is a stack of grey
|
|
941
|
+
lines with nothing to land on: the label line; 14 under it the figure, now 20/500 (a step under the page title's 24, so the cards never read as loud as the head),
|
|
942
|
+
with the pill 8 beside it on its centre line and the comparison after that, the note 4 under; 14 under that
|
|
943
|
+
the sparkline; then the facts under a hairline across the card's full width, 16 above it and 16 under it.
|
|
944
|
+
The figure is the one large thing; every other line is 13 or 11 and stands back.
|
|
945
|
+
- **Each zone keeps its height whatever it holds**, so cards side by side stay level line for line: the figure
|
|
946
|
+
is one line (the comparison truncates first), the note's line is held open in a card without one, the facts
|
|
947
|
+
are one line (a label truncates first) and stand at the card's foot.
|
|
948
|
+
- **It pads by what it holds**: 24 for a card with a chart and facts (the formula, `foundations.md`), 16 at
|
|
949
|
+
the foot under the facts; the plain card stays at its drawn 16.
|
|
950
|
+
- A row is all one kind of card, and every card in it holds the same parts, so the row ends level.
|
|
951
|
+
|
|
952
|
+
### DescriptionList · DescriptionItem
|
|
953
|
+
**For** an object's key–value facts, term left and value right in two equal columns, in a bordered box (in the
|
|
954
|
+
side panel the same rows go without the box). **Not for** settings.
|
|
955
|
+
- `panel` corners (20), hairline, surface; rows 41 (40 cells over a hairline, the last without), 12 side, 8
|
|
956
|
+
vertical, content centred; the term 13/500 `neutral-900`, the value 13/500 `neutral-950` (a badge, an avatar,
|
|
957
|
+
a link); a wrapping value grows the row.
|
|
958
|
+
|
|
959
|
+
### Accordion · AccordionItem · AccordionTrigger · AccordionPanel
|
|
960
|
+
**For** a list of questions, terms or notes read one at a time and skipped otherwise, each opening its answer
|
|
961
|
+
under it: the questions under a product or a plan, the notes on a step. **When:** there are three or more, each
|
|
962
|
+
answer is a few lines of prose, and most readers want one of them. **Not for** the facets of one object (Tabs),
|
|
963
|
+
a page's settings (SettingRow, each area its own page), steps to finish (Checklist), one or two questions (a
|
|
964
|
+
heading and a paragraph each), or anything a reader must see to go on.
|
|
965
|
+
- A divided list: a hairline between items; `plain` (the default) with one above and below, on the page, in a
|
|
966
|
+
reading column; `outline` in a hairline box on the `card` corner on the surface, rows 16 side, for a list
|
|
967
|
+
standing among other boxes.
|
|
968
|
+
- The question is the whole row, a button: min 40 high, 12 vertical, 13/500 `neutral-950`, wrapping when long; a
|
|
969
|
+
16 chevron `neutral-600` at the right end, centred on the row, gap 16, `neutral-950` on hover, turning half round
|
|
970
|
+
as it opens. The answer below: 13/400 `neutral-600`, at most 576 wide, 16 under it.
|
|
971
|
+
- One open at a time; `multiple` only where answers are compared. The first may start open. Opening moves the
|
|
972
|
+
height and the opacity over 200ms on the system's ease; none under reduced motion. The focus ring on the row
|
|
973
|
+
(drawn inward in `outline`); a disabled item 50%.
|
|
974
|
+
|
|
975
|
+
### ActivityList · ActivityItem
|
|
976
|
+
**For** a history or timeline, in a sheet or at the foot of a detail. **Not for** steps of a run (the step row
|
|
977
|
+
pattern) or a chat.
|
|
978
|
+
- Items 24 apart; an item a row with gap 16: a 32 outline icon tile in the tone (`neutral-600` / `success-700` /
|
|
979
|
+
`warning-700` / `error-600` / `primary-700` glyph, as IconTile), the title 13 `neutral-950` over the time 13/400
|
|
980
|
+
`neutral-600` (2 apart), an optional badge at the end.
|
|
981
|
+
|
|
982
|
+
### BranchGraph
|
|
983
|
+
**For** a version history where how the work branched and merged matters: a repository's commits, a document's
|
|
984
|
+
or a model's versions with forks. It is a list of rows first, so it lives with the lists and not the charts: it
|
|
985
|
+
measures nothing, and each row is a thing to pick. **Not for** a straight history with nothing to branch (an
|
|
986
|
+
ActivityList, or a Table when the rows carry several facts), or a run's steps.
|
|
987
|
+
- Takes commits newest first, each with its parents; it works the lanes out itself. One row per commit, 34
|
|
988
|
+
(`compact`, a long log) or 41 (`default`, a short log read closely), no rules between rows so the lanes run
|
|
989
|
+
unbroken; in a frame like the ruled table's (`control` corners, hairline, surface) unless a card already frames it.
|
|
990
|
+
- The gutter: lanes 16 apart, the first 16 from the frame's edge, lines 1.5, a commit an 8 dot in its lane's
|
|
991
|
+
colour; a merge a hollow ring of the same size, and its message `neutral-600`, since a merge says less than
|
|
992
|
+
the work it brings in. Lines run only down a lane or along a dot's row, turning on a 6 corner: a branch
|
|
993
|
+
leaves the commit it was made from along that row, a merge reaches along its own row to the branch it takes
|
|
994
|
+
in, and a line along a row breaks 3 either side of a lane it passes, so it reads as passing under. A lane
|
|
995
|
+
whose parent is not in the list runs off the foot.
|
|
996
|
+
- Colour: the trunk (`main` or `master` unless named) keeps the leftmost lane in `neutral-400`, so the line
|
|
997
|
+
everything comes from stays quiet; the lanes beside it take `chart-series-1` to `-4` in turn. Never the
|
|
998
|
+
status colours: a lane's colour says which line, not how it went.
|
|
999
|
+
- A row: the refs, then the message 13/400 `neutral-900` truncating, then author 13/400 `neutral-700`, the
|
|
1000
|
+
short hash 11 mono `neutral-600` and the time 13/400 `neutral-600` tabular, right aligned, 16 apart. A ref is
|
|
1001
|
+
a 20 label, `chip` corners, the 5% wash, 11/500 truncating at 160: a branch with a 6 dot in its lane's colour,
|
|
1002
|
+
a tag with a 12 tag glyph, the checked-out branch in `neutral-950` with a hairline ring, a remote's copy in
|
|
1003
|
+
`neutral-600`. Two refs at most, the rest a "+N" with the names in its tooltip. Under 560 wide the author and
|
|
1004
|
+
hash go and a row keeps one ref, so the message keeps its line.
|
|
1005
|
+
- When rows are picked: a listbox, one row in the tab order, arrows and Home/End move, Enter or a click picks;
|
|
1006
|
+
hover the 3% wash, picked the selected wash with a soft disc round its dot, the focus ring inside the row.
|
|
1007
|
+
|
|
1008
|
+
### BarList · BarListItem
|
|
1009
|
+
**For** a ranked breakdown (top pages, sources, countries) in a list card. **Not for** a comparison across
|
|
1010
|
+
categories (a chart) or a data table.
|
|
1011
|
+
- Header, rows and footer 8 apart. Header: the title 13/400 `neutral-600` and a value label 13 `neutral-600`,
|
|
1012
|
+
10 side padding; items 6 apart; the footer "Show N more" (29 high, 8 side, `item` corners, 13/500
|
|
1013
|
+
`neutral-600`, hover the 5% wash). A row: 34 high, 10 side, gap 8, `item`
|
|
1014
|
+
corners, the 3% wash, with a bar behind the label sized to its value (the 7% wash; min 4 wide). The bar is
|
|
1015
|
+
neutral: it shows a rank, and a colour there would compete with the page's one action colour and its
|
|
1016
|
+
status colours. The `chart` tone (`chart-1` at 20%) only **when the list sits inside a chart card and its
|
|
1017
|
+
rows are that chart's own series**. Then an optional 16 icon, the label 13/400 `neutral-950` truncating, the value 13/400
|
|
1018
|
+
`neutral-600` tabular. Interactive rows hover the 5% wash; pressed (a filter toggle) the tint with the label at
|
|
1019
|
+
500. Empty: a 34 row "No data yet" in `neutral-600`. Narrow, the header's value label truncates rather than
|
|
1020
|
+
push the title out.
|
|
1021
|
+
- Labels that are paths or URLs cut in the middle (`truncate`, Truncate); names and places at the end.
|
|
1022
|
+
|
|
1023
|
+
## Text and layout
|
|
1024
|
+
|
|
1025
|
+
### Truncate
|
|
1026
|
+
**For** one line of text that must fit the width it is given. **Not for** text that may wrap (a description,
|
|
1027
|
+
a message) or a value that must always show whole (an amount).
|
|
1028
|
+
- Cut **at the end** by default, for names and labels read from the start ("Northwind Traders"). Cut **in the
|
|
1029
|
+
middle** when the end tells one item from the next: a file name keeps its extension and the word before it
|
|
1030
|
+
(`invoice-2026-11-…-final.pdf`), a path its last part (`/docs/…/invoice-paid`), a hash or an ID its last 4
|
|
1031
|
+
(`0x3f2a…9c1b`), so a column of names that share a start still reads apart. The kept end is a fixed number of
|
|
1032
|
+
characters, chosen by the kind of string, and the start fills whatever width is left; it never cuts by a
|
|
1033
|
+
character count alone.
|
|
1034
|
+
- The ellipsis is the font's own `…`, set tight against both halves, never a space beside it. The type is the
|
|
1035
|
+
surrounding text's; a hash or an ID is mono.
|
|
1036
|
+
- While cut, the whole text shows in a Tooltip on hover (11/500, start-aligned, breaking anywhere). The cut is
|
|
1037
|
+
only drawn: a screen reader, find-in-page and a copy all get the whole text.
|
|
1038
|
+
|
|
1039
|
+
### Separator
|
|
1040
|
+
A 1px `neutral-200` line, horizontal or vertical. Rarely: between the rows of a bordered list, segments of a
|
|
1041
|
+
toolbar, the parts of a floating container (full width); never between page sections.
|
|
1042
|
+
|
|
1043
|
+
## Labels and identity
|
|
1044
|
+
|
|
1045
|
+
### Badge
|
|
1046
|
+
**For** a status, a count, a delta. **Not for** emphasis, a tag someone removes (Chip), or a button.
|
|
1047
|
+
|
|
1048
|
+
| variant | corners | side padding | for |
|
|
1049
|
+
| ------- | ------------ | ------------ | ---------------------------------------------- |
|
|
1050
|
+
| soft | `chip` 6 | 6 | a status, with an optional 12 icon |
|
|
1051
|
+
| pill | `chip` (6) | 8 | a delta in a stat card |
|
|
1052
|
+
| dot | `chip` 6 | 6 | a status with a 6 dot of the tone's 500 in front |
|
|
1053
|
+
| count | `chip` 6 | 6 | a count in the sidebar or a nav, min 32 wide, centred |
|
|
1054
|
+
|
|
1055
|
+
22 high, 11/500, no wrap. Tones: the ramp's **500 at 20% behind its 800** (`neutral`, `success`, `warning`,
|
|
1056
|
+
`error`, `primary`), one rule for every tone (the 700 misses 4.5:1 on the success and warning tints). Filled,
|
|
1057
|
+
never outlined, never a solid 100. The tone follows what the state is, not how the row should look: draft
|
|
1058
|
+
`neutral`, waiting on someone `warning`, scheduled or informational `primary`, done or live `success`, failed
|
|
1059
|
+
`error`; a state that is no call for attention stays `neutral`. A badge only where the object has a state, a
|
|
1060
|
+
count or a change to show: never one per row for the look of it. It names a state in a word; a quantity (stock
|
|
1061
|
+
left, seats free) stays a figure beside it.
|
|
1062
|
+
|
|
1063
|
+
### Avatar · AvatarStack
|
|
1064
|
+
**For** a person (round) or a workspace (square). **Not for** an icon (IconTile).
|
|
1065
|
+
- 24 (11 text, 14 icon; in a table row, a message, a stack) · 32 (13, 16) · 36 (13, 16; a detail's title row,
|
|
1066
|
+
the sidebar account); `chip` corners square, round for people; a 1px border;
|
|
1067
|
+
initials in 500 on a tone (six hues: blue 250°, violet 295°, rose 10°, amber 75°, teal 190°, green 145°; a pale
|
|
1068
|
+
fill with a deep ink of the same hue, swapped in dark; chosen from the initials so the same person always gets
|
|
1069
|
+
the same tone), or a person icon on `neutral-100` with `neutral-600`.
|
|
1070
|
+
- A stack: 24 avatars overlapping by a fixed 8 (the spacing unit never changes it), each ringed 2 in the surface colour, three at most, the rest as a "+N"
|
|
1071
|
+
tile (24 round, `neutral-100`, 11/500 `neutral-600`) on top.
|
|
1072
|
+
|
|
1073
|
+
### IconTile
|
|
1074
|
+
A 32 well with `chip` corners (6) and a hairline, `neutral-100` filled or outlined, a 16 icon that reaches 3:1 on it: `neutral-600` by default, the 600 for
|
|
1075
|
+
`error`, the 700 for `primary`, `success` and `warning`. In empty states, option rows, activity items, drop zones, alerts (32 / 24).
|
|
1076
|
+
|
|
1077
|
+
### StatusDot · LiveCount
|
|
1078
|
+
A 6 (`sm`) or 8 (`md`) round dot in the tone's 500; `pulse` adds a halo at 60% expanding over 2s for a live state.
|
|
1079
|
+
**LiveCount**: the pulsing dot 8 from "129 Active now" (the number 13/500 `neutral-950` tabular, the label 13/400
|
|
1080
|
+
`neutral-600`); still and grey at zero. The pulse and the LiveCount only for something that is live now, beside
|
|
1081
|
+
the thing it describes.
|
|
1082
|
+
|
|
1083
|
+
## Status
|
|
1084
|
+
|
|
1085
|
+
### Progress · Meter
|
|
1086
|
+
**For** a task that finishes (Progress) or a value within a known range: credits used, seats taken (Meter).
|
|
1087
|
+
**Not for** a step list (Stepper, Checklist).
|
|
1088
|
+
- A label row (the label 13/500 `neutral-900`, a caption 13/400 `neutral-600` or the value 13 `neutral-600`
|
|
1089
|
+
tabular at the right, gap 12) 8 above a track 4 (`sm`) or 8 (`md`) high, round, `neutral-200`, filled in the
|
|
1090
|
+
action colour (`success-500` / `warning-500` / `error-500` / `chart-1` by tone) over 200ms. A tone only when the
|
|
1091
|
+
amount warrants it: near the limit `warning`, over it `error`, `success` once a task is complete; otherwise
|
|
1092
|
+
none. Indeterminate progress, only while a task has no amount to show yet, fills the track at 30% and holds
|
|
1093
|
+
still.
|
|
1094
|
+
- **Narrow:** the caption or value truncates with an ellipsis rather than push the label out.
|
|
1095
|
+
|
|
1096
|
+
### Checklist · ChecklistItem
|
|
1097
|
+
**For** the set-up steps a new workspace works through. **Not for** a form's steps (Stepper) or tasks to tick (that is data,
|
|
1098
|
+
a table).
|
|
1099
|
+
- A card (16 padding, `card` corners): the title 14/500 with the count 13 `neutral-600` ("3 of 5") and an
|
|
1100
|
+
action, a 4 meter under them 12 below (action fill; success when complete), then the steps 2 apart. A step:
|
|
1101
|
+
8 padding (12 vertical when current), `item` corners, the current one on the 4% wash; a 22 round marker (a
|
|
1102
|
+
`neutral-300` ring; the action ring when current; the action fill with a 14 tick when done), the title 13/500
|
|
1103
|
+
(`neutral-600` at 400 when done), and for the current step its line 13 `neutral-600` and its action 10 below.
|
|
1104
|
+
|
|
1105
|
+
### Skeleton · SkeletonText · Spinner
|
|
1106
|
+
- **Skeleton**: a block at the real element's size on the 5% wash with `item` corners, and a band of light
|
|
1107
|
+
flowing across it: one band for every skeleton on the page at once (pinned to the viewport), left to right in
|
|
1108
|
+
2.4s, without a pause, so the blocks read as one surface loading; still under reduced motion. The region is
|
|
1109
|
+
marked busy. **SkeletonText**: 10 bars at 13px type (they follow the type size) on its rhythm, chip corners,
|
|
1110
|
+
the last one at 62%.
|
|
1111
|
+
- **Spinner**: a quarter arc on a faint ring in the text colour, 16 (12 small), turning; only inside the button
|
|
1112
|
+
that is busy. A page that loads shows skeletons.
|
|
1113
|
+
|
|
1114
|
+
## Messages
|
|
1115
|
+
|
|
1116
|
+
### Toast · ToastProvider · useToast
|
|
1117
|
+
**For** feedback after an action, with Undo for anything reversible (which then needs no confirmation first).
|
|
1118
|
+
**Not for** a message that must stay (Alert) or a small action's confirmation (Notice).
|
|
1119
|
+
- Bottom right, 24 from the edges, 360 wide (16 from the sides and foot on a phone), drawn in the mode opposite
|
|
1120
|
+
the page's, above dialogs and their scrim. A card: hairline, surface, `card` corners (16), 8 padding, gap 6: a
|
|
1121
|
+
36 icon well (corner 10), the title 14/500 (two lines at most) over the description 13 `neutral-600` (three at
|
|
1122
|
+
most; 2 apart, 6 once either wraps), then a 36 action square and a 36 close square touching (`neutral-600`,
|
|
1123
|
+
hover the 5% wash). The `type` sets the well as an Alert's tone would: `primary` an info glyph, `success` a
|
|
1124
|
+
tick, `warning` a triangle, `error` an alert circle, each on its 500 at 20% with a 700 glyph (3:1 on the tint for every tone); with no type, a
|
|
1125
|
+
`data.icon` sits on `neutral`, and with neither there is no well (16 left padding instead). A type only
|
|
1126
|
+
when the tone says what the words do not: `error` when the action failed, `warning` when it went through
|
|
1127
|
+
with a catch, `success` when something that could have failed is done, `primary` for news; plain feedback
|
|
1128
|
+
("Moved to Archive") has none. The action is an
|
|
1129
|
+
icon named by a tooltip: an undo arrow for an undo (`data.undo`, or a label "Undo"), else an arrow. An
|
|
1130
|
+
optional tab above the card (`data.tab`; 16 side, `neutral-600` text, 10 top corners) says what is going on
|
|
1131
|
+
and takes the action beside its words. Toasts pile, three at most, the newest in front and the older peeking
|
|
1132
|
+
8 above it; pointing fans them 12 apart. Enters from 24 below over 400ms; leaves after 5s; swipe down or
|
|
1133
|
+
right.
|
|
1134
|
+
- `useOptimisticUndo` runs the recipe Optimistic update with Undo (`patterns.md`) on this toast: the change
|
|
1135
|
+
shows at once, the toast offers Undo, the request runs behind it, and a failed request puts the thing back
|
|
1136
|
+
with an `error` toast.
|
|
1137
|
+
|
|
1138
|
+
### Notice · useNotice
|
|
1139
|
+
**For** a small action's state in the header bar: "Saving…", "Saved", "Link copied". **Not for** anything that
|
|
1140
|
+
needs an action.
|
|
1141
|
+
- A tab 32 high hanging from the bar's hairline, centred: 12 side, gap 6, 10 bottom corners with 8 fillets
|
|
1142
|
+
bending the hairline round it, the surface, a 14 icon (a tick in `success-700` by default; a small spinner
|
|
1143
|
+
while saving; `neutral-500` for a custom icon) and the message 13 `neutral-700`; slides out and back over
|
|
1144
|
+
200ms; leaves by itself after 1.8s.
|
|
1145
|
+
|
|
1146
|
+
### Alert
|
|
1147
|
+
**For** an inline notice on a page or in a form that must stay: info, success, warning, error. **Not for** feedback that passes (Toast), an empty
|
|
1148
|
+
list (EmptyState), or problems that are what the page is about (failing checks, open incidents): those are the
|
|
1149
|
+
page's content, rows in a list (`patterns.md`, Problems to act on).
|
|
1150
|
+
- A row: `item` corners (10), hairline, surface, 16 side, 12 vertical (8 with a title only), gap 12: a 32 icon
|
|
1151
|
+
well (24 when slim; chip corners; neutral the 5% wash with a `neutral-600` glyph, else the tone's 500 at 20%
|
|
1152
|
+
with a glyph that reaches 3:1 on it: the 600 for `error`, the 700 for `primary`, `success` and `warning`), the title 13/500 over the body 13 `neutral-600` (2 apart), the action buttons at the
|
|
1153
|
+
right (8 apart; on a narrow box, under the words), a ghost 28 × to dismiss. Enters from 4 above over 200ms.
|
|
1154
|
+
|
|
1155
|
+
### EmptyState
|
|
1156
|
+
**For** where a list or section would be before it has anything. **Not for** a loading state (Skeleton) or an
|
|
1157
|
+
error (Alert).
|
|
1158
|
+
- A left-aligned panel with `panel` corners (20) and a 1px **dashed** `neutral-200` border, 24 padding, parts 16
|
|
1159
|
+
apart: an optional 32 icon tile, the title 13/500 over one sentence 13 `neutral-600` (4 apart, max 480 wide),
|
|
1160
|
+
one secondary button. No illustrations. A filter that matched nothing offers to clear it.
|
|
1161
|
+
|
|
1162
|
+
## Charts
|
|
1163
|
+
|
|
1164
|
+
The chart kit, `@contui/ui/charts`, has a reference of its own: `charts.md`. It holds which chart answers which
|
|
1165
|
+
need, the card every chart sits in (ChartFrame, ChartCard, ChartKey), the plot, the marks, colour, hover, motion,
|
|
1166
|
+
and an entry per chart: AreaChart, LineChart, BarChart, HorizontalBarChart, DonutChart, Treemap, FunnelChart,
|
|
1167
|
+
RadarChart, RoseChart, BulletChart, UptimeStrip, BubbleChart and CandlestickChart.
|
|
1168
|
+
|
|
1169
|
+
## Chat
|
|
1170
|
+
|
|
1171
|
+
A conversation between people, and the bots and AI agents that take part in it as people do: support, a help
|
|
1172
|
+
widget, comments, a team's chat. Built from the parts below, each with its own entry. An AI here is one more
|
|
1173
|
+
author: its message is the other side's card, told apart by an "AI" badge and, when the reader needs them, its
|
|
1174
|
+
stats, never by a shape of its own. **For** a conversation. **Not for** asking the product a question (the
|
|
1175
|
+
Assistant parts below), a history (ActivityList) or a log (the step row pattern).
|
|
1176
|
+
|
|
1177
|
+
### ChatThread · ChatUnreadDivider
|
|
1178
|
+
- **Thread**: a scrolling column, 16 padding, 24 between messages, so each reads as its own turn; a system line
|
|
1179
|
+
keeps 16 to its neighbours (its own 12 of padding sets it apart). Opens at the latest and follows new ones
|
|
1180
|
+
while the reader is at the end. Empty: 13 `neutral-600` centred, max 288 wide.
|
|
1181
|
+
- **Thread, own messages**: the thread tells one's own messages (for following the end and the reader's own
|
|
1182
|
+
send) by `variant="own"` or a `data-own` marker on each child; a wrapper round ChatMessage forwards both the
|
|
1183
|
+
`variant` and the `data-enter` the thread gives it, or a new message will not rise in.
|
|
1184
|
+
- **Thread, loading**: while its first messages load, a skeleton of three message rows stands in, sitting at the
|
|
1185
|
+
foot, each with the message's own padding so it is as tall as the message that replaces it. Others' rows are the bordered card with a 24 round block, a 10 name bar 80 wide and two or three 10
|
|
1186
|
+
lines; one's own rows are the tint with one or two lines at 3/4 width. The blocks are Skeletons; the thread is busy (`aria-busy`).
|
|
1187
|
+
- **Thread, earlier messages**: while earlier messages load, a row heads the thread: a 12 spinner in
|
|
1188
|
+
`neutral-500`, gap 8, "Loading earlier messages" 13 `neutral-600`, 4 vertical padding, announced once as a
|
|
1189
|
+
status. It is asked for when the reader comes within 48 of the top; the message being read keeps its place
|
|
1190
|
+
when the history goes in above it.
|
|
1191
|
+
- **Thread, new messages**: a message added after the thread has loaded rises 8 while fading in, 200
|
|
1192
|
+
`ease-out-strong`; reduced motion turns it off. The history it opened with, and earlier history added at the
|
|
1193
|
+
top, never animate. Sending one's own message always takes the reader to the end.
|
|
1194
|
+
- **Jump to latest**: when the reader has scrolled back and messages arrive, a secondary pill button (34, a 16
|
|
1195
|
+
arrow-down, "N new messages") floats 12 above the foot of the thread, centred, with the `float` shadow. It
|
|
1196
|
+
fades in while rising 4 (fade only under reduced motion), is not announced itself (the messages are), and
|
|
1197
|
+
takes the reader back to the end, smoothly unless reduced motion is on.
|
|
1198
|
+
- **Unread divider**: a 1 `neutral-200` hairline either side of a centred 11 label in `neutral-600` ("New
|
|
1199
|
+
messages"), gap 12, 20 from the messages, above the first unseen message. Quiet, as a place in the thread
|
|
1200
|
+
and not news itself; neutral, never the action colour.
|
|
1201
|
+
|
|
1202
|
+
### ChatMessage · ChatEvent
|
|
1203
|
+
- **Message**: `card` corners (16), 16 round the content, the body 13 keeping line breaks and wrapping anywhere
|
|
1204
|
+
(a run of emoji or a long id breaks inside, never widens it). Both variants share one layout: a header row
|
|
1205
|
+
across the top when there is one (24 round avatar, the author 13/500, a badge, gap 8, and its stats at the right), then two columns side
|
|
1206
|
+
by side, the words and the meta 8 apart, the meta at the foot of its column 12 from the right and 10 from the
|
|
1207
|
+
bottom, so the words never run under it however long they get; rows 8 apart. Only the time and its tick sit
|
|
1208
|
+
beside the words: a failed message's meta ("Not sent · Retry · time") takes its own row under the words, at
|
|
1209
|
+
the right, still 12 from the right and 10 from the bottom. `own`: the tint wash, no border, at the right, as
|
|
1210
|
+
wide as its words up to 2/3 of the thread. `other`: the surface with a hairline, at the left, the thread's
|
|
1211
|
+
width. The meta: 11 `neutral-600` tabular, gap 4, a 12 status icon before the time (sending, sent,
|
|
1212
|
+
delivered, read in `neutral-950`, failed in `error-500`).
|
|
1213
|
+
- **Message delivery**: the tick crossfades between states: the outgoing glyph fades out and the incoming one
|
|
1214
|
+
fades in from 80% scale, 200 `ease-out-strong`, while read darkens from `neutral-500` to `neutral-950` over
|
|
1215
|
+
150; reduced motion swaps them at once. A failed message says "Not sent" in `error-600` after its error icon,
|
|
1216
|
+
then " · Retry" as an 11/500 text button in `neutral-950` (underlined on hover), then " · " and the time.
|
|
1217
|
+
- **Stats** (`stats`, `ChatMessageStat`): **when** the reader should know what a message drew on, mostly an AI
|
|
1218
|
+
participant's reply (how sure it is, how many files it read, whose profile it looked at): at the header's
|
|
1219
|
+
right, each a 12 icon in `neutral-500` and a figure 11 `neutral-600` tabular, gap 4, a `neutral-400` "·" 6
|
|
1220
|
+
either side between them; a figure needs a name, so each is named in its tooltip and read before it. Never
|
|
1221
|
+
on one's own messages.
|
|
1222
|
+
- **Pending reply**: a reply still being written (a person or a bot in the chat) shows three 6 dots 4 apart in `neutral-600` in
|
|
1223
|
+
place of its words, or 6 after the words while they stream, and is busy (`aria-busy`).
|
|
1224
|
+
- `status` on a message is its delivery (sending, sent, delivered, read, failed); on ChatAttachment and
|
|
1225
|
+
ChatReference it is a node, usually a badge, at the end.
|
|
1226
|
+
- **Attached** (`attached`): what goes with a message (its files, a record it links, or both, files first) hangs
|
|
1227
|
+
under it, 6 apart, and the two are one group: the same side, the same width (the wider of the words and what is
|
|
1228
|
+
attached, up to 2/3 for one's own), a linked record taking the message's `card` corners. Never the thread's
|
|
1229
|
+
next item, which would sit 24 away at the thread's width and read as a message of its own.
|
|
1230
|
+
- **Event**: a centred quiet line 13 `neutral-600` with 12 vertical padding ("Joan closed the ticket · 09:14").
|
|
1231
|
+
|
|
1232
|
+
### ChatTyping
|
|
1233
|
+
- **Typing**: a row above the composer, in its `typing` slot: 24 high, 6 above it and 8 clear of the box, at
|
|
1234
|
+
the box's left edge, held whether anyone types or not, so the box never moves; never inside the thread. Up to
|
|
1235
|
+
three 24 round avatars, each over the last by 10, ringed 1 in `neutral-950` at 10% (no border); gap 8; then
|
|
1236
|
+
who is typing, 13 `neutral-600`, truncated ("Maya is typing"); gap 8; then the pill: 24 high, fully round,
|
|
1237
|
+
the surface with a hairline, 8 side, holding three 4 dots 2 apart in `neutral-600` (16 wide). Other wording
|
|
1238
|
+
goes in `text` (`label` is the old name). A product that wants the faces alone turns the words off; they are still read out. The dots pulse in turn (1.2s, 160 apart) and stay still under reduced
|
|
1239
|
+
motion. The row fades in while settling 4, 200 `ease-out-strong` (at once under reduced motion), and fades out
|
|
1240
|
+
the same way. Only its words are announced (polite, atomic), once per change of people. The line: one name "Maya
|
|
1241
|
+
is typing"; two "Maya and Liam are typing"; three "Maya, Liam and Noor are typing"; four "Maya, Liam and 2 others
|
|
1242
|
+
are typing"; five or more "5 people are typing".
|
|
1243
|
+
|
|
1244
|
+
### ChatToken · ChatReference
|
|
1245
|
+
- **Token**: a mono 11 chip with `chip` corners, 6 side, 2 vertical, `neutral-500` at 20% behind `neutral-800`
|
|
1246
|
+
by default (a reference is not a state), `primary` only to mark one the reader must act on, inline in a message. **Reference**: a record dropped in: min 48 high, `control` corners (`card` under its message), hairline,
|
|
1247
|
+
surface, 12 side, gap 12: the token, a fact 13 tabular, a status at the end; hover border `neutral-300` when it
|
|
1248
|
+
opens the record.
|
|
1249
|
+
|
|
1250
|
+
### ChatAttachment · ChatAttachments
|
|
1251
|
+
- **Attachment** (`ChatAttachment` · `ChatAttachments`): a file going with a message. `file`: 48 high, `item`
|
|
1252
|
+
corners, hairline, surface, 4 inset: a 40 well with `chip` corners and a 20 file icon, tinted by kind (a PDF the
|
|
1253
|
+
error tone, others neutral: the ramp's 500 at 20%, its 800), gap 10, the name 13/500 over its extension 11
|
|
1254
|
+
`neutral-600`, both truncated, max 288 wide (sized to sit with 13 messages); the name cuts in the middle (Truncate). `image`: a 48 square thumbnail, `item` corners, hairline. Both are
|
|
1255
|
+
48 high round a row (40) well. While waiting in the composer each is removable: a ghost 28 × at the
|
|
1256
|
+
file's end, a 20 round chip (surface, hairline, 12 ×) on the image's top right corner; each named "Remove
|
|
1257
|
+
<name>". `record`, a linked record (an application, an invoice), drawn in ChatReference's shape so it keeps one
|
|
1258
|
+
shape waiting and in the thread: a line of its own at the row's full width, min 48 high, `control` corners,
|
|
1259
|
+
hairline, surface, 12 left, gap 12: a 16 icon in `neutral-600`, its kind 13/500 ("Application"), its token, the
|
|
1260
|
+
status badge at the end, then the ghost 28 × (4 right). The row (`ChatAttachments`): 8 apart, wrapping; above
|
|
1261
|
+
the composer's box while it waits, under a sent message in its `attached`, on the message's side, `variant` `own` (at
|
|
1262
|
+
the right) or `other` (`align` end / start is the same).
|
|
1263
|
+
|
|
1264
|
+
### MessageComposer · MessageComposerAttachItem
|
|
1265
|
+
- **Composer**: a box `control-xl` (48) high at one line, a cell row in 8 of room: corners `item` + 4 (14), not
|
|
1266
|
+
the padding's full 8, so box and button read as one shape and square off together at corner scale 0; a
|
|
1267
|
+
hairline in `neutral-100` (`neutral-200` on hover and focus, the focus ring round the box), the surface, the
|
|
1268
|
+
`composer` shadow (a soft lift, deeper in dark), 8 left and vertical, 10 right. In it: the attach button, a cell
|
|
1269
|
+
(32) square with `item` corners filled in the action colour with a 16 plus, named "Attach" (`attachLabel`;
|
|
1270
|
+
`addLabel` is the old name), which opens the file picker (`onAttach(files)`, `accept`), calls `onAdd`, or, when
|
|
1271
|
+
more than files can go, opens a menu (`attachMenu`, below); `attach` replaces the button outright (`start` is
|
|
1272
|
+
the old name); gap 12; a borderless textarea (min 32, max 160 then scrolls, 13 `neutral-900`, placeholder
|
|
1273
|
+
`neutral-600` for contrast, "Write a message"); the send, named "Send", a quiet cell (32) ghost button with a 20
|
|
1274
|
+
arrow-up in `neutral-600`, dimmed until there is text or a file. The two emphases are on purpose: in a
|
|
1275
|
+
person's chat, adding something is the box's one filled control and the send stays quiet beside it; an
|
|
1276
|
+
assistant's question (AssistantPrompt) is the page's one action, so there the send is the filled one. A press
|
|
1277
|
+
anywhere on the box that is not a button lands in the text. The box only ever holds the line of text:
|
|
1278
|
+
what waits to go (files, images, linked records) sits in a row 8 above it, never inside. From the top: who else
|
|
1279
|
+
is typing, then what waits, then the box, so the box never moves when someone starts typing. Enter sends,
|
|
1280
|
+
Shift+Enter breaks a line. The box keeps 12 above it without a typing row and 24 under it at the page's foot.
|
|
1281
|
+
- **Composer menu**: the "+" opens a menu above it, its left edge on the button's, 8 clear, at least 192 wide, of
|
|
1282
|
+
the menu's rows, each a 16 icon and a label ("Add attachments", "Link invoice", "Link application", "Ask the
|
|
1283
|
+
assistant"); "Add attachments" opens the file picker. The button keeps its name "Attach"; Enter, Space and the
|
|
1284
|
+
arrows open it, picking a row puts the caret back in the text, and Escape closes it back onto the "+".
|
|
1285
|
+
|
|
1286
|
+
### ChatSuggestions · ChatSuggestion
|
|
1287
|
+
- **Suggestions**: while a reference is typed after "#" (or "@"), a panel
|
|
1288
|
+
floats 8 above the box, over what is there, at the box's full width: the box's corners (14), hairline, surface,
|
|
1289
|
+
the `float` shadow, 4 inset; a title 11/500 `neutral-600` ("Recent applications"), then popup rows (36, a 16
|
|
1290
|
+
icon, the label, the meta in `neutral-600`; corners `item` − 1, concentric inside the panel), at most 240 then scrolling. It rises 4 as it fades in, 150
|
|
1291
|
+
`ease-out-strong`. The caret stays in the text: the arrows move the active row (the 5% wash), Enter or Tab picks
|
|
1292
|
+
it (the typed "#a" becomes the record's token and a space), Escape or leaving the text closes it until a new "#"
|
|
1293
|
+
is typed. The text points at the list and its active row (a listbox of options). Sent, the token is a chip.
|
|
1294
|
+
|
|
1295
|
+
## Assistant
|
|
1296
|
+
|
|
1297
|
+
Asking the product a question, and its answers: the assistant page kind (`pages.md`), a sheet that asks about
|
|
1298
|
+
the record it opens over. The thread is ChatThread, as it scrolls and follows the same way; the question is
|
|
1299
|
+
one's own ChatMessage; the answer and the prompt are the assistant's own. **For** an assistant the reader asks.
|
|
1300
|
+
**Not for** a conversation with people, an AI agent among them (the Chat parts above).
|
|
1301
|
+
|
|
1302
|
+
### AssistantAnswer · AssistantAnswerStep · AssistantAnswerAction
|
|
1303
|
+
- **Answer**: the assistant's answer to one question, never a message: no card, avatar, author or time, open
|
|
1304
|
+
in the conversation column at its full width, starting on its text edge. So it can hold what the product
|
|
1305
|
+
draws elsewhere (stat cards, a chart card, a table, a list) as well as words, each a block 16 apart; the
|
|
1306
|
+
words 13 `neutral-950`, lists with their markers inside the text edge (20 indent, items 4 apart). From the
|
|
1307
|
+
top: what it did, the answer, what can be done with it. The question before it is one's own ChatMessage.
|
|
1308
|
+
- **Work** (`work`): above the answer, 16 over it, lines 8 apart. While it works, Thinking (named for what it
|
|
1309
|
+
is doing); once done, what it did as steps: a 16 icon in `neutral-500`, gap 8, the words 13 `neutral-600`,
|
|
1310
|
+
truncated ("Read bounce rate by page", "12 sources used"). A step that opens what it names (the sources) is a
|
|
1311
|
+
button: it darkens to `neutral-950`, icon and words, on hover. **When** the reader would ask how it knows;
|
|
1312
|
+
a reply that only talks (a greeting) has none.
|
|
1313
|
+
- **Actions** (`actions`): 8 under the answer, the first icon on the text edge: 24 square ghost buttons with a
|
|
1314
|
+
14 icon, 2 apart, each named in a tooltip: CopyButton, "Try again" (the last answer only), "Good answer" and
|
|
1315
|
+
"Bad answer", toggles that stay `neutral-950` while pressed (one turns the other off). Held back while the
|
|
1316
|
+
answer is pending, and on a greeting.
|
|
1317
|
+
- **Writing**: while the words arrive, the answer is busy and ThinkingCaret follows the last word.
|
|
1318
|
+
|
|
1319
|
+
### Thinking · ThinkingCaret · ThinkingRun · ThinkingMark · ThinkingText
|
|
1320
|
+
Which one goes by how long the wait is and what is already on screen. A person typing is ChatTyping; a button
|
|
1321
|
+
that is busy is the Spinner; a page loading is skeletons.
|
|
1322
|
+
- **Thinking**: the mark in `neutral-950`, gap 8, a few words lit (`ThinkingText`), truncated ("Thinking",
|
|
1323
|
+
"Searching the docs").
|
|
1324
|
+
**When** an assistant has started but nothing of its answer exists yet and the wait is seconds: in a reply's
|
|
1325
|
+
place in the thread, beside a field it is filling, in a table cell it is working out. Name what it is doing
|
|
1326
|
+
when it knows ("Reading 3 invoices"), because a step named is a wait that feels shorter. The small size: the
|
|
1327
|
+
8 mark, gap 6, 11 type. A status: its words are read once, and again when they change.
|
|
1328
|
+
- **Mark** (`ThinkingMark`): nine 3 squares 1 apart in a 3 by 3 grid (11 across; the small one 2 squares, 8
|
|
1329
|
+
across), in the text colour, with a wave rolling across them from the top left corner to the bottom right:
|
|
1330
|
+
each swells from 60% size and 20% opacity to full and back as the wave passes, a diagonal an eighth of the wave
|
|
1331
|
+
apart, 1.4s a wave, ease-in-out. Scale and opacity only, so it never shifts the line. Under reduced motion it
|
|
1332
|
+
rolls at 2.8s rather than stopping: a still mark reads as stuck. Decorative; the words beside it are read.
|
|
1333
|
+
- **Lit words** (`ThinkingText`): words being worked on, with a band of light crossing them letter by letter
|
|
1334
|
+
every 2s, from `neutral-600` to `neutral-950` and back, so the words themselves say the work goes on. Still, in
|
|
1335
|
+
`neutral-600`, under reduced motion. **When** the words name what is being done now (the thinking line, a
|
|
1336
|
+
run's current step); never on words that are finished.
|
|
1337
|
+
- **Caret** (`ThinkingCaret`): a 6 square, 1 corners, `neutral-950`, on the baseline 4 after the last word,
|
|
1338
|
+
swelling between full and 25% opacity, 1.2s each way, ease-in-out (2.4s under reduced motion). **When** the
|
|
1339
|
+
answer's words are arriving: it moves on with the text and goes when the last word is in. A square and not a
|
|
1340
|
+
bar, so it never reads as a caret the reader could type at. The message is busy while it shows; the caret is
|
|
1341
|
+
read once ("Writing") unless the message says so itself.
|
|
1342
|
+
- **Run** (`ThinkingRun`): **when** the work takes tens of seconds or more (an agent working through steps), so
|
|
1343
|
+
the reader needs to see it is still going, how long it has taken and how to stop it. `card` corners, the
|
|
1344
|
+
surface with a hairline, 12 vertical, 16 left, 12 right, gap 12: the mark on the title's line, then the title
|
|
1345
|
+
13/500 `neutral-950` over the current step, lit, both truncated; the time since it began, 11
|
|
1346
|
+
`neutral-600` tabular ("42s", "3m 05s", "1h 12m"), counting each second; a secondary Stop button at the end.
|
|
1347
|
+
A light runs along the bottom hairline: a segment a quarter of the width, soft at both ends, `neutral-950`,
|
|
1348
|
+
crossing in 2.4s on a strong ease-in-out (`cubic-bezier(0.77, 0, 0.175, 1)`), so it moves while the step
|
|
1349
|
+
stays the same and rests off the edges between passes. Under reduced motion it stops crossing and the whole
|
|
1350
|
+
hairline swells in `neutral-400` instead. The title and step are a status (read as the step changes); the clock
|
|
1351
|
+
is not, or it would be read every second. When the run ends, the answer takes its place. **Steps**: when the
|
|
1352
|
+
run knows its steps, they list under the title on its text edge, 8 apart, in place of the step line: a done
|
|
1353
|
+
one with a 12 check in `neutral-500` and its words in `neutral-600`; the one it is on with the small mark and
|
|
1354
|
+
its words lit; the ones to come with a 4 square in `neutral-300` and words in `neutral-400`. **When** the run
|
|
1355
|
+
has three to six known steps; an open-ended one keeps the step line.
|
|
1356
|
+
|
|
1357
|
+
### AssistantPrompt
|
|
1358
|
+
- **Prompt**: where a question to an assistant is written. A box whose corner nests round the buttons
|
|
1359
|
+
(`chip` + the padding: 14 at `lg`, 12 at `md`), hairline, surface: the textarea on top (borderless, `neutral-900`, placeholder `neutral-600`, "Ask anything…"),
|
|
1360
|
+
a foot under it: an optional menu at the left (a mode or model, a ghost 28 button), at the right a ghost 28
|
|
1361
|
+
attach (a 16 plus) and send, a 28 button in the action colour with a 16 arrow-up, all three on the `chip` corner so they read as one set (never a round send beside a square attach), 4 apart; the text 2
|
|
1362
|
+
above the foot. Attaching takes the composer's props with the same meaning: `onAttach(files)` and `accept` open
|
|
1363
|
+
the file picker, `onAdd` is called instead, `attachMenu` opens a menu, `attach` replaces the button. What waits
|
|
1364
|
+
to go (`attachments`, a ChatAttachments row) sits inside the box, above the text; a question can be sent with
|
|
1365
|
+
only an attachment. `lg`, an empty page's prompt: 8 padding, 14 text, 104 high empty, the text growing to 240 then
|
|
1366
|
+
scrolling. `md`, docked under a conversation: 6 padding, 13 text, 72 high. Send is dimmed while the box is empty; while a reply streams it
|
|
1367
|
+
becomes Stop (the same button with a filled 10 square) and Enter waits; pressing Stop puts the caret
|
|
1368
|
+
back in the text. Hover and focus take the border to
|
|
1369
|
+
`neutral-300`, with the focus ring round the box; a press anywhere on it that is not a button lands in the text.
|