prime-ui-kit 0.16.0 → 0.17.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/README.md +14 -18
- package/dist/chunks/{chunk-4PSQ64S4.js → chunk-7WWZYGRC.js} +3697 -3738
- package/dist/chunks/{chunk-6TPHKCUJ.js → chunk-A4WE3UNC.js} +27340 -26893
- package/dist/chunks/{chunk-A7OQWH6R.js → chunk-PRP4B6OG.js} +1 -1
- package/dist/chunks/{chunk-HDBQICPW.js → chunk-SVFWPLNW.js} +49 -20
- package/dist/color-picker.d.ts +1 -1
- package/dist/color-picker.js +3 -3
- package/dist/components/breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/components/chart-frame/ChartFrame.d.ts +1 -1
- package/dist/components/chat/ChatRows.d.ts +5 -1
- package/dist/components/color-picker/ColorPicker.d.ts +18 -1
- package/dist/components/data-table/DataTable.d.ts +1 -1
- package/dist/components/index.d.ts +0 -4
- package/dist/components/pagination/Pagination.d.ts +5 -1
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/slider/Slider.d.ts +1 -1
- package/dist/components/smart-filter/SmartFilter.d.ts +4 -5
- package/dist/icon-set.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.js +5 -9
- package/dist/internal/barPlan.d.ts +44 -0
- package/dist/internal/overlay/FloatingPanel.d.ts +1 -1
- package/dist/internal/overlay/focus.d.ts +3 -2
- package/dist/internal/parts.d.ts +1 -1
- package/dist/internal/slot.d.ts +0 -30
- package/dist/layout/app-shell/AppShell.d.ts +19 -38
- package/dist/layout/index.d.ts +3 -3
- package/dist/layout/page/Page.d.ts +263 -0
- package/dist/layout/sidebar/Sidebar.d.ts +1 -1
- package/dist/skill/SKILL.md +10 -10
- package/dist/skill/anti-slop.md +101 -5
- package/dist/skill/api-contract.md +1 -1
- package/dist/skill/cheatsheet.md +27 -22
- package/dist/skill/checklist.md +7 -3
- package/dist/skill/choosing.md +9 -8
- package/dist/skill/components.md +3 -5
- package/dist/skill/composition.md +177 -152
- package/dist/skill/foundations.md +9 -9
- package/dist/skill/layouts.md +39 -98
- package/dist/skill/reference/components/avatar/COMPONENT.md +2 -2
- package/dist/skill/reference/components/avatar/examples/team-group.tsx +1 -1
- package/dist/skill/reference/components/banner/COMPONENT.md +4 -4
- package/dist/skill/reference/components/banner/examples/examples.module.css +6 -1
- package/dist/skill/reference/components/banner/examples/page-strip.tsx +24 -22
- package/dist/skill/reference/components/breadcrumb/COMPONENT.md +9 -8
- package/dist/skill/reference/components/button/COMPONENT.md +1 -0
- package/dist/skill/reference/components/button/examples/hold-to-confirm.tsx +1 -1
- package/dist/skill/reference/components/button/examples/on-colored-host.tsx +8 -8
- package/dist/skill/reference/components/card/COMPONENT.md +7 -7
- package/dist/skill/reference/components/card/examples/screen.module.css +1 -1
- package/dist/skill/reference/components/card/examples/screen.tsx +184 -198
- package/dist/skill/reference/components/chart-frame/COMPONENT.md +1 -1
- package/dist/skill/reference/components/chart-frame/examples/fill-height.tsx +9 -9
- package/dist/skill/reference/components/chat/COMPONENT.md +4 -4
- package/dist/skill/reference/components/chat/examples/screen.module.css +1 -1
- package/dist/skill/reference/components/chat/examples/screen.tsx +110 -117
- package/dist/skill/reference/components/chat-list/COMPONENT.md +2 -2
- package/dist/skill/reference/components/chat-list/examples/controlled.tsx +2 -2
- package/dist/skill/reference/components/chat-list/examples/examples.module.css +8 -0
- package/dist/skill/reference/components/checkbox/examples/examples.module.css +3 -2
- package/dist/skill/reference/components/code-block/COMPONENT.md +1 -1
- package/dist/skill/reference/components/code-block/examples/color-scheme.tsx +2 -4
- package/dist/skill/reference/components/code-block/examples/examples.module.css +0 -11
- package/dist/skill/reference/components/color-picker/COMPONENT.md +18 -7
- package/dist/skill/reference/components/color-picker/examples/examples.module.css +2 -5
- package/dist/skill/reference/components/color-picker/examples/overview.tsx +5 -10
- package/dist/skill/reference/components/color-picker/examples/sizes.tsx +4 -8
- package/dist/skill/reference/components/crossfade/COMPONENT.md +2 -2
- package/dist/skill/reference/components/crossfade/examples/screen.tsx +107 -112
- package/dist/skill/reference/components/data-table/COMPONENT.md +5 -5
- package/dist/skill/reference/components/data-table/examples/examples.module.css +9 -0
- package/dist/skill/reference/components/data-table/examples/screen.tsx +42 -52
- package/dist/skill/reference/components/data-table/examples/server.tsx +6 -2
- package/dist/skill/reference/components/datepicker/examples/examples.module.css +6 -0
- package/dist/skill/reference/components/datepicker/examples/inline-panel.tsx +3 -1
- package/dist/skill/reference/components/description-list/COMPONENT.md +1 -1
- package/dist/skill/reference/components/description-list/examples/screen.tsx +120 -127
- package/dist/skill/reference/components/digit-input/examples/grouped.tsx +4 -4
- package/dist/skill/reference/components/digit-input/examples/validation.tsx +1 -1
- package/dist/skill/reference/components/divider/COMPONENT.md +2 -2
- package/dist/skill/reference/components/divider/examples/examples.module.css +4 -1
- package/dist/skill/reference/components/divider/examples/vertical.tsx +22 -9
- package/dist/skill/reference/components/dnd/examples/examples.module.css +3 -1
- package/dist/skill/reference/components/drawer/COMPONENT.md +1 -1
- package/dist/skill/reference/components/drawer/examples/placement.tsx +26 -31
- package/dist/skill/reference/components/drawer/examples/screen.tsx +137 -160
- package/dist/skill/reference/components/dropdown/COMPONENT.md +1 -1
- package/dist/skill/reference/components/example-frame/COMPONENT.md +3 -3
- package/dist/skill/reference/components/field-list/examples/screen.module.css +1 -1
- package/dist/skill/reference/components/field-list/examples/screen.tsx +19 -19
- package/dist/skill/reference/components/fieldset/COMPONENT.md +1 -1
- package/dist/skill/reference/components/fieldset/examples/states.tsx +1 -1
- package/dist/skill/reference/components/file-upload/COMPONENT.md +1 -1
- package/dist/skill/reference/components/file-upload/examples/screen.module.css +2 -2
- package/dist/skill/reference/components/file-upload/examples/screen.tsx +65 -81
- package/dist/skill/reference/components/gallery/COMPONENT.md +1 -0
- package/dist/skill/reference/components/gantt/COMPONENT.md +1 -1
- package/dist/skill/reference/components/gantt/examples/screen.module.css +1 -1
- package/dist/skill/reference/components/gantt/examples/screen.tsx +55 -73
- package/dist/skill/reference/components/hint/examples/examples.module.css +10 -1
- package/dist/skill/reference/components/hint/examples/overview.tsx +1 -1
- package/dist/skill/reference/components/kanban/COMPONENT.md +1 -1
- package/dist/skill/reference/components/kanban/examples/screen.module.css +1 -1
- package/dist/skill/reference/components/kanban/examples/screen.tsx +50 -65
- package/dist/skill/reference/components/kbd/COMPONENT.md +1 -1
- package/dist/skill/reference/components/label/examples/examples.module.css +12 -1
- package/dist/skill/reference/components/label/examples/overview.tsx +1 -1
- package/dist/skill/reference/components/list/COMPONENT.md +3 -3
- package/dist/skill/reference/components/media-viewer/examples/controlled.tsx +16 -16
- package/dist/skill/reference/components/media-viewer/examples/examples.module.css +1 -3
- package/dist/skill/reference/components/pagination/COMPONENT.md +11 -3
- package/dist/skill/reference/components/pagination/examples/controlled.tsx +2 -1
- package/dist/skill/reference/components/popover/COMPONENT.md +3 -2
- package/dist/skill/reference/components/popover/examples/width.tsx +13 -1
- package/dist/skill/reference/components/slider/COMPONENT.md +3 -3
- package/dist/skill/reference/components/slider/examples/states.tsx +14 -10
- package/dist/skill/reference/components/smart-filter/COMPONENT.md +13 -13
- package/dist/skill/reference/components/smart-filter/examples/examples.module.css +3 -0
- package/dist/skill/reference/components/smart-filter/examples/many-values.tsx +12 -8
- package/dist/skill/reference/components/smart-filter/examples/sizes.tsx +7 -3
- package/dist/skill/reference/components/sparkline/COMPONENT.md +1 -0
- package/dist/skill/reference/components/sparkline/examples/curve.tsx +16 -11
- package/dist/skill/reference/components/sparkline/examples/states.tsx +14 -10
- package/dist/skill/reference/components/switch/COMPONENT.md +1 -1
- package/dist/skill/reference/components/tabs/COMPONENT.md +1 -1
- package/dist/skill/reference/components/typography/COMPONENT.md +2 -2
- package/dist/skill/reference/foundation.md +15 -11
- package/dist/skill/reference/layout/app-shell/COMPONENT.md +25 -38
- package/dist/skill/reference/layout/app-shell/examples/footer.tsx +10 -10
- package/dist/skill/reference/layout/app-shell/examples/overview.tsx +20 -22
- package/dist/skill/reference/layout/app-shell/examples/screen.module.css +2 -2
- package/dist/skill/reference/layout/app-shell/examples/screen.tsx +25 -30
- package/dist/skill/reference/layout/app-shell/examples/template.tsx +13 -17
- package/dist/skill/reference/layout/bottom-nav/COMPONENT.md +3 -3
- package/dist/skill/reference/layout/bottom-nav/examples/floating-action.tsx +10 -19
- package/dist/skill/reference/layout/bottom-nav/examples/floating.tsx +10 -19
- package/dist/skill/reference/layout/bottom-nav/examples/in-app-shell.tsx +11 -19
- package/dist/skill/reference/layout/page/COMPONENT.md +353 -0
- package/dist/skill/reference/layout/page/examples/actions-collapse.tsx +45 -0
- package/dist/skill/reference/layout/page/examples/collapse.tsx +68 -0
- package/dist/skill/reference/{components/page-content → layout/page}/examples/examples.module.css +33 -4
- package/{src/components/page-content → dist/skill/reference/layout/page}/examples/grid.tsx +15 -15
- package/dist/skill/reference/{components/page-content → layout/page}/examples/list-detail.tsx +14 -14
- package/dist/skill/reference/layout/page/examples/narrow.tsx +75 -0
- package/dist/skill/reference/layout/page/examples/overview.tsx +57 -0
- package/dist/skill/reference/{components/page-content → layout/page}/examples/screen.module.css +1 -1
- package/{src/components/page-content → dist/skill/reference/layout/page}/examples/screen.tsx +29 -19
- package/dist/skill/reference/{components/page-content → layout/page}/examples/sections.tsx +17 -24
- package/dist/skill/reference/layout/page/examples/structure.tsx +41 -0
- package/dist/skill/reference/{components/page-toolbar/examples/narrow.tsx → layout/page/examples/tools.tsx} +38 -35
- package/dist/skill/reference/layout/page/examples/top-bar.tsx +85 -0
- package/dist/skill/reference/{components/page-content → layout/page}/examples/variants.tsx +7 -7
- package/dist/skill/reference/layout/sidebar/COMPONENT.md +5 -4
- package/dist/skill/reference/layout/sidebar/examples/dismiss.tsx +10 -7
- package/dist/skill/reference/layout/sidebar/examples/narrow.tsx +11 -8
- package/dist/skill/responsive.md +88 -74
- package/dist/tokens/layers.d.ts +2 -0
- package/dist/tokens/primitives.d.ts +12 -2
- package/dist/tokens/semantic.d.ts +7 -0
- package/dist/tokens/themes/dark.d.ts +7 -2
- package/package.json +2 -2
- package/src/components/avatar/COMPONENT.md +2 -2
- package/src/components/avatar/examples/team-group.tsx +1 -1
- package/src/components/banner/COMPONENT.md +4 -4
- package/src/components/banner/examples/examples.module.css +6 -1
- package/src/components/banner/examples/page-strip.tsx +24 -22
- package/src/components/breadcrumb/COMPONENT.md +9 -8
- package/src/components/button/COMPONENT.md +1 -0
- package/src/components/button/examples/hold-to-confirm.tsx +1 -1
- package/src/components/button/examples/on-colored-host.tsx +8 -8
- package/src/components/card/COMPONENT.md +7 -7
- package/src/components/card/examples/screen.module.css +1 -1
- package/src/components/card/examples/screen.tsx +184 -198
- package/src/components/chart-frame/COMPONENT.md +1 -1
- package/src/components/chart-frame/examples/fill-height.tsx +9 -9
- package/src/components/chat/COMPONENT.md +4 -4
- package/src/components/chat/examples/screen.module.css +1 -1
- package/src/components/chat/examples/screen.tsx +110 -117
- package/src/components/chat-list/COMPONENT.md +2 -2
- package/src/components/chat-list/examples/controlled.tsx +2 -2
- package/src/components/chat-list/examples/examples.module.css +8 -0
- package/src/components/checkbox/examples/examples.module.css +3 -2
- package/src/components/code-block/COMPONENT.md +1 -1
- package/src/components/code-block/examples/color-scheme.tsx +2 -4
- package/src/components/code-block/examples/examples.module.css +0 -11
- package/src/components/color-picker/COMPONENT.md +18 -7
- package/src/components/color-picker/examples/examples.module.css +2 -5
- package/src/components/color-picker/examples/overview.tsx +5 -10
- package/src/components/color-picker/examples/sizes.tsx +4 -8
- package/src/components/crossfade/COMPONENT.md +2 -2
- package/src/components/crossfade/examples/screen.tsx +107 -112
- package/src/components/data-table/COMPONENT.md +5 -5
- package/src/components/data-table/examples/examples.module.css +9 -0
- package/src/components/data-table/examples/screen.tsx +42 -52
- package/src/components/data-table/examples/server.tsx +6 -2
- package/src/components/datepicker/examples/examples.module.css +6 -0
- package/src/components/datepicker/examples/inline-panel.tsx +3 -1
- package/src/components/description-list/COMPONENT.md +1 -1
- package/src/components/description-list/examples/screen.tsx +120 -127
- package/src/components/digit-input/examples/grouped.tsx +4 -4
- package/src/components/digit-input/examples/validation.tsx +1 -1
- package/src/components/divider/COMPONENT.md +2 -2
- package/src/components/divider/examples/examples.module.css +4 -1
- package/src/components/divider/examples/vertical.tsx +22 -9
- package/src/components/dnd/examples/examples.module.css +3 -1
- package/src/components/drawer/COMPONENT.md +1 -1
- package/src/components/drawer/examples/placement.tsx +26 -31
- package/src/components/drawer/examples/screen.tsx +137 -160
- package/src/components/dropdown/COMPONENT.md +1 -1
- package/src/components/example-frame/COMPONENT.md +3 -3
- package/src/components/field-list/examples/screen.module.css +1 -1
- package/src/components/field-list/examples/screen.tsx +19 -19
- package/src/components/fieldset/COMPONENT.md +1 -1
- package/src/components/fieldset/examples/states.tsx +1 -1
- package/src/components/file-upload/COMPONENT.md +1 -1
- package/src/components/file-upload/examples/screen.module.css +2 -2
- package/src/components/file-upload/examples/screen.tsx +65 -81
- package/src/components/gallery/COMPONENT.md +1 -0
- package/src/components/gantt/COMPONENT.md +1 -1
- package/src/components/gantt/examples/screen.module.css +1 -1
- package/src/components/gantt/examples/screen.tsx +55 -73
- package/src/components/hint/examples/examples.module.css +10 -1
- package/src/components/hint/examples/overview.tsx +1 -1
- package/src/components/kanban/COMPONENT.md +1 -1
- package/src/components/kanban/examples/screen.module.css +1 -1
- package/src/components/kanban/examples/screen.tsx +50 -65
- package/src/components/kbd/COMPONENT.md +1 -1
- package/src/components/label/examples/examples.module.css +12 -1
- package/src/components/label/examples/overview.tsx +1 -1
- package/src/components/list/COMPONENT.md +3 -3
- package/src/components/media-viewer/examples/controlled.tsx +16 -16
- package/src/components/media-viewer/examples/examples.module.css +1 -3
- package/src/components/pagination/COMPONENT.md +11 -3
- package/src/components/pagination/examples/controlled.tsx +2 -1
- package/src/components/popover/COMPONENT.md +3 -2
- package/src/components/popover/examples/width.tsx +13 -1
- package/src/components/slider/COMPONENT.md +3 -3
- package/src/components/slider/examples/states.tsx +14 -10
- package/src/components/smart-filter/COMPONENT.md +13 -13
- package/src/components/smart-filter/examples/examples.module.css +3 -0
- package/src/components/smart-filter/examples/many-values.tsx +12 -8
- package/src/components/smart-filter/examples/sizes.tsx +7 -3
- package/src/components/sparkline/COMPONENT.md +1 -0
- package/src/components/sparkline/examples/curve.tsx +16 -11
- package/src/components/sparkline/examples/states.tsx +14 -10
- package/src/components/switch/COMPONENT.md +1 -1
- package/src/components/tabs/COMPONENT.md +1 -1
- package/src/components/typography/COMPONENT.md +2 -2
- package/src/layout/app-shell/COMPONENT.md +25 -38
- package/src/layout/app-shell/examples/footer.tsx +10 -10
- package/src/layout/app-shell/examples/overview.tsx +20 -22
- package/src/layout/app-shell/examples/screen.module.css +2 -2
- package/src/layout/app-shell/examples/screen.tsx +25 -30
- package/src/layout/app-shell/examples/template.tsx +13 -17
- package/src/layout/bottom-nav/COMPONENT.md +3 -3
- package/src/layout/bottom-nav/examples/floating-action.tsx +10 -19
- package/src/layout/bottom-nav/examples/floating.tsx +10 -19
- package/src/layout/bottom-nav/examples/in-app-shell.tsx +11 -19
- package/src/layout/page/COMPONENT.md +353 -0
- package/src/layout/page/examples/actions-collapse.tsx +45 -0
- package/src/layout/page/examples/collapse.tsx +68 -0
- package/src/{components/page-content → layout/page}/examples/examples.module.css +33 -4
- package/{dist/skill/reference/components/page-content → src/layout/page}/examples/grid.tsx +15 -15
- package/src/{components/page-content → layout/page}/examples/list-detail.tsx +14 -14
- package/src/layout/page/examples/narrow.tsx +75 -0
- package/src/layout/page/examples/overview.tsx +57 -0
- package/src/{components/page-content → layout/page}/examples/screen.module.css +1 -1
- package/{dist/skill/reference/components/page-content → src/layout/page}/examples/screen.tsx +29 -19
- package/src/{components/page-content → layout/page}/examples/sections.tsx +17 -24
- package/src/layout/page/examples/structure.tsx +41 -0
- package/src/{components/page-toolbar/examples/narrow.tsx → layout/page/examples/tools.tsx} +38 -35
- package/src/layout/page/examples/top-bar.tsx +85 -0
- package/src/{components/page-content → layout/page}/examples/variants.tsx +7 -7
- package/src/layout/sidebar/COMPONENT.md +5 -4
- package/src/layout/sidebar/examples/dismiss.tsx +10 -7
- package/src/layout/sidebar/examples/narrow.tsx +11 -8
- package/src/styles/theme-dark.css +12 -10
- package/src/styles/theme-light.css +3 -0
- package/src/styles/tokens.css +3 -1
- package/dist/components/page-content/PageContent.d.ts +0 -192
- package/dist/components/page-toolbar/PageToolbar.d.ts +0 -55
- package/dist/layout/app-header/AppHeader.d.ts +0 -118
- package/dist/skill/reference/components/page-content/COMPONENT.md +0 -264
- package/dist/skill/reference/components/page-content/examples/narrow.tsx +0 -25
- package/dist/skill/reference/components/page-content/examples/overview.tsx +0 -41
- package/dist/skill/reference/components/page-toolbar/COMPONENT.md +0 -147
- package/dist/skill/reference/components/page-toolbar/examples/examples.module.css +0 -16
- package/dist/skill/reference/components/page-toolbar/examples/overview.tsx +0 -113
- package/dist/skill/reference/components/page-toolbar/examples/save-changes.tsx +0 -43
- package/dist/skill/reference/components/page-toolbar/examples/without-search.tsx +0 -60
- package/dist/skill/reference/layout/app-header/COMPONENT.md +0 -187
- package/dist/skill/reference/layout/app-header/examples/breadcrumbs.tsx +0 -37
- package/dist/skill/reference/layout/app-header/examples/examples.module.css +0 -28
- package/dist/skill/reference/layout/app-header/examples/in-app-shell.tsx +0 -67
- package/dist/skill/reference/layout/app-header/examples/narrow.tsx +0 -66
- package/dist/skill/reference/layout/app-header/examples/overview.tsx +0 -34
- package/dist/skill/reference/layout/app-header/examples/page-title.tsx +0 -78
- package/dist/skill/reference/layout/app-shell/examples/contained.tsx +0 -30
- package/src/components/page-content/COMPONENT.md +0 -264
- package/src/components/page-content/examples/narrow.tsx +0 -25
- package/src/components/page-content/examples/overview.tsx +0 -41
- package/src/components/page-toolbar/COMPONENT.md +0 -147
- package/src/components/page-toolbar/examples/examples.module.css +0 -16
- package/src/components/page-toolbar/examples/overview.tsx +0 -113
- package/src/components/page-toolbar/examples/save-changes.tsx +0 -43
- package/src/components/page-toolbar/examples/without-search.tsx +0 -60
- package/src/layout/app-header/COMPONENT.md +0 -187
- package/src/layout/app-header/examples/breadcrumbs.tsx +0 -37
- package/src/layout/app-header/examples/examples.module.css +0 -28
- package/src/layout/app-header/examples/in-app-shell.tsx +0 -67
- package/src/layout/app-header/examples/narrow.tsx +0 -66
- package/src/layout/app-header/examples/overview.tsx +0 -34
- package/src/layout/app-header/examples/page-title.tsx +0 -78
- package/src/layout/app-shell/examples/contained.tsx +0 -30
- package/dist/chunks/{chunk-U3Q2I3MY.js → chunk-2ODXLPW3.js} +2 -2
|
@@ -35,12 +35,12 @@ Things that belong together sit closer than things that do not.
|
|
|
35
35
|
| inline controls in a row (buttons, filters) | 8 | `--prime-space-2` |
|
|
36
36
|
| switch → switch in a settings list | 20 | `--prime-space-5` |
|
|
37
37
|
| group → group (fieldset, form section) | 32 | `--prime-space-8` |
|
|
38
|
-
| tile → tile, both axes (KPI cards, charts, panels) | 16 | `--prime-space-4` — `
|
|
39
|
-
| block → block on a page (page header → body too) | 24 | `--prime-space-6` — `
|
|
40
|
-
| section → section on a page (a new topic with an `h2`) | 40 | `
|
|
38
|
+
| tile → tile, both axes (KPI cards, charts, panels) | 16 | `--prime-space-4` — `Page.Grid` already does it |
|
|
39
|
+
| block → block on a page (page header → body too) | 24 | `--prime-space-6` — `Page` already does it |
|
|
40
|
+
| section → section on a page (a new topic with an `h2`) | 40 | `Page.Section` already does it |
|
|
41
41
|
|
|
42
|
-
`
|
|
43
|
-
neighbours, `
|
|
42
|
+
`Page.Body` already spaces its direct blocks 24 apart, a `Page.Section` 40 from its
|
|
43
|
+
neighbours, `Page.Grid` its tiles 16 on both axes, and `AppShell.Main` already hands the page its
|
|
44
44
|
gutters — do not add your own outer padding.
|
|
45
45
|
|
|
46
46
|
## 3. Size axis
|
|
@@ -143,10 +143,10 @@ A chart color does one job, and the job picks the colors:
|
|
|
143
143
|
| `body-m` | 14/20 | default text |
|
|
144
144
|
| `body-l` | 16/24 | reading text |
|
|
145
145
|
| `title-s` | 14/20 600 | card title, group heading inside a card or form |
|
|
146
|
-
| `title-m` | 16/24 600 | page section heading (`
|
|
146
|
+
| `title-m` | 16/24 600 | page section heading (`Page.Section` draws it), modal title |
|
|
147
147
|
| `title-l` | 18/24 600 | large block title |
|
|
148
148
|
| `heading-s` | 20/28 600 | page sub-heading |
|
|
149
|
-
| `heading-m` | 24/32 600 | the title
|
|
149
|
+
| `heading-m` | 24/32 600 | the page title in the flow (`Page.Title` of a document page or an overview); in `Page.TopBar` the same `Page.Title` is `title-m` |
|
|
150
150
|
| `heading-l` | 30/36 600 | marketing / auth title |
|
|
151
151
|
| `display-*` | 36–60 | hero numbers only |
|
|
152
152
|
| `code` | 13/20 mono | identifiers, inline code |
|
|
@@ -154,7 +154,7 @@ A chart color does one job, and the job picks the colors:
|
|
|
154
154
|
`variant` is required on `Typography`. Weights only 400/500/600. Numbers in tables, prices, dates:
|
|
155
155
|
tabular (the kit does it in DataTable `numeric` columns and `Card.Value`; your own amounts take
|
|
156
156
|
`font-variant-numeric: tabular-nums`). Reading text max width `--prime-layout-reading-max-width`
|
|
157
|
-
(`
|
|
157
|
+
(`Page.Root maxWidth="readable"`).
|
|
158
158
|
|
|
159
159
|
### Text colour
|
|
160
160
|
|
|
@@ -174,7 +174,7 @@ level of air: a page with uniform 16px gaps everywhere reads as a list of unrela
|
|
|
174
174
|
the [breakpoints and their scope](responsive.md#breakpoints), the
|
|
175
175
|
[intrinsic grids](responsive.md#intrinsic-grids), what the kit adapts by itself and touch.
|
|
176
176
|
- Flex children with text: `min-width: 0` + ellipsis or `overflow-wrap: anywhere`.
|
|
177
|
-
- Sticky parts come from the kit: `
|
|
177
|
+
- Sticky parts come from the kit: `Page.TopBar` (with all its groups), the
|
|
178
178
|
DataTable head and `stickyFirstColumn`, the Gantt header and first column — each sticks inside its
|
|
179
179
|
own scroller, and the top ones let go on screens lower than 480px. Never a `position: sticky` bar of your own.
|
|
180
180
|
|
package/dist/skill/layouts.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Layouts — app frame, page wrappers, auth
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The app is navigation and the page: `AppShell.Root` with the Sidebar in `AppShell.Nav` and
|
|
4
4
|
`AppShell.Main` (the content panel is the page, the nav rail one layer above it). The frame is the
|
|
5
|
-
app's;
|
|
6
|
-
page title and the page's tools, [composition.md](composition.md#1-page-skeleton))
|
|
7
|
-
`
|
|
8
|
-
`AppShell.Main`
|
|
9
|
-
`
|
|
10
|
-
|
|
5
|
+
app's; everything inside Main is the page's — a screen renders one `Page.Root` with its own top
|
|
6
|
+
(`Page.TopBar`: the page title and the page's tools, [composition.md](composition.md#1-page-skeleton))
|
|
7
|
+
and its body in `Page.Body`.
|
|
8
|
+
`AppShell.Main` hands the page its gutters and top air and `Page` spaces it — blocks 24, a titled
|
|
9
|
+
`Page.Section` 40, tiles in a `Page.Grid` 16 on both axes — so your code adds **no outer padding and no margins**. Your CSS only lays out the inside of a block (grids, rows) with `gap` on `--prime-space-*`.
|
|
10
|
+
The page's top air is part of the frame — 24, then 32 from 1024px: the page's first block
|
|
11
11
|
starts there; never cancel it with a negative margin or a padding override.
|
|
12
12
|
|
|
13
13
|
The page recipes are whole, working screens — the `screen.tsx` example of their main component
|
|
@@ -16,14 +16,13 @@ The page recipes are whole, working screens — the `screen.tsx` example of thei
|
|
|
16
16
|
## App frame (once per app)
|
|
17
17
|
|
|
18
18
|
The frame is the root layout and nothing else: the providers, `AppShell.Root`, the Sidebar in
|
|
19
|
-
`AppShell.Nav` and `AppShell.Main` around the page. It holds no header
|
|
19
|
+
`AppShell.Nav` and `AppShell.Main` around the page. It holds no header and no menu state:
|
|
20
20
|
|
|
21
|
-
- **
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
and the title read as one line. Nothing app-wide goes into it — no global search, no notifications.
|
|
21
|
+
- **Everything at the top belongs to the page.** There is no app-wide header and no global search:
|
|
22
|
+
every page renders its own `Page.TopBar` with only what it needs. Its title row is as high as the
|
|
23
|
+
Sidebar brand row, so the brand and the title read as one line.
|
|
25
24
|
- **The phone menu comes with the frame.** Below 768px the Sidebar becomes an off-canvas panel
|
|
26
|
-
(`offCanvas="auto"`) and
|
|
25
|
+
(`offCanvas="auto"`) and `Page.TopBar` leads with the menu button that opens it by itself — never a
|
|
27
26
|
menu state or a menu button wired by hand. A trigger outside the rail (a BottomNav «Ещё», your own
|
|
28
27
|
button) reads the shell's navigation with `useAppShellNav()` (`open`, `setOpen`, `navId`; see
|
|
29
28
|
[the app frame screen](reference/layout/app-shell/examples/screen.tsx)).
|
|
@@ -90,37 +89,33 @@ export function AppFrame({ children }: { children: ReactNode }) {
|
|
|
90
89
|
}
|
|
91
90
|
```
|
|
92
91
|
|
|
93
|
-
Every page renders its
|
|
92
|
+
Every page renders its top and its body in one `Page.Root`:
|
|
94
93
|
|
|
95
94
|
```tsx
|
|
96
|
-
import {
|
|
95
|
+
import { Page } from "prime-ui-kit";
|
|
97
96
|
|
|
98
97
|
export function OrdersPage() {
|
|
99
98
|
return (
|
|
100
|
-
|
|
101
|
-
<
|
|
102
|
-
<
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
<PageContent.Root as="section">
|
|
110
|
-
<PageContent.Body>{/* the page's blocks */}</PageContent.Body>
|
|
111
|
-
</PageContent.Root>
|
|
112
|
-
</>
|
|
99
|
+
<Page.Root>
|
|
100
|
+
<Page.TopBar>
|
|
101
|
+
<Page.Heading>
|
|
102
|
+
<Page.Title>Заказы</Page.Title>
|
|
103
|
+
<Page.Description>128 в работе · 6 ждут оплаты</Page.Description>
|
|
104
|
+
</Page.Heading>
|
|
105
|
+
</Page.TopBar>
|
|
106
|
+
<Page.Body>{/* the page's blocks */}</Page.Body>
|
|
107
|
+
</Page.Root>
|
|
113
108
|
);
|
|
114
109
|
}
|
|
115
110
|
```
|
|
116
111
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
What stands in the bar — the path ending in the title, the tools, every button, the active filters —
|
|
113
|
+
is [the top bar](composition.md#the-top-bar); where the title stands on a document page or an
|
|
114
|
+
overview is [the page skeleton](composition.md#1-page-skeleton).
|
|
120
115
|
|
|
121
116
|
With React Router the frame's `children` is `<Outlet />` and every item is `Sidebar.Item asChild`
|
|
122
117
|
around a `NavLink` ([the router example](reference/layout/sidebar/examples/router.tsx)). The same frame
|
|
123
|
-
as one component is `AppShell.Template` (`nav`, `footer`, the page as children); give it the
|
|
118
|
+
as one component is `AppShell.Template` (`nav`, `footer`, `mainProps`, the page as children); give it the
|
|
124
119
|
pathname as `scrollResetKey`, so a new page opens at the top.
|
|
125
120
|
|
|
126
121
|
Phone navigation for 2–6 main sections is a `BottomNav.Root` in `AppShell.Footer` (the last child of
|
|
@@ -133,60 +128,6 @@ Next.js App Router: the package is marked `"use client"`, but a server component
|
|
|
133
128
|
`"use client"` and render them from `app/layout.tsx` and the pages; import `bundle.css` in the root
|
|
134
129
|
layout and put `data-theme` on `<html>` there.
|
|
135
130
|
|
|
136
|
-
A nested record page puts the path up before its title in the header — `Breadcrumb` (the list it
|
|
137
|
-
belongs to), `AppHeader.Separator`, `AppHeader.Title` with the record's name and its status as
|
|
138
|
-
the description ([the detail page](reference/components/description-list/examples/screen.tsx)).
|
|
139
|
-
|
|
140
|
-
### The page's tools in the header
|
|
141
|
-
|
|
142
|
-
The page's tools — its own search and filters, sections, the period or view, the primary action —
|
|
143
|
-
go into `AppHeader.Tools` as a `PageToolbar.Root`: the header's second row, full width, sticky with
|
|
144
|
-
it. The toolbar lays itself out from that width ([the page panel](responsive.md#page-panel--pagetoolbar)),
|
|
145
|
-
so the tools wrap under the title instead of squeezing it. `AppHeader.Actions` keeps the page's
|
|
146
|
-
other buttons (export, a more menu) in the title row.
|
|
147
|
-
|
|
148
|
-
```tsx
|
|
149
|
-
import { AppHeader, Button, Icon, PageToolbar, SegmentedControl } from "prime-ui-kit";
|
|
150
|
-
|
|
151
|
-
type DealsHeaderProps = { view: string; onViewChange: (view: string) => void };
|
|
152
|
-
|
|
153
|
-
export function DealsHeader({ view, onViewChange }: DealsHeaderProps) {
|
|
154
|
-
return (
|
|
155
|
-
<AppHeader.Root>
|
|
156
|
-
<AppHeader.Start>
|
|
157
|
-
<AppHeader.Title>
|
|
158
|
-
Сделки
|
|
159
|
-
<AppHeader.Description>7 сделок в работе · 6 461 750 ₽</AppHeader.Description>
|
|
160
|
-
</AppHeader.Title>
|
|
161
|
-
</AppHeader.Start>
|
|
162
|
-
<AppHeader.Tools>
|
|
163
|
-
<PageToolbar.Root aria-label="Сделки">
|
|
164
|
-
<PageToolbar.Sections>
|
|
165
|
-
<SegmentedControl.Root
|
|
166
|
-
fullWidth
|
|
167
|
-
value={view}
|
|
168
|
-
onValueChange={onViewChange}
|
|
169
|
-
aria-label="Вид"
|
|
170
|
-
>
|
|
171
|
-
<SegmentedControl.Item value="board">Доска</SegmentedControl.Item>
|
|
172
|
-
<SegmentedControl.Item value="list">Список</SegmentedControl.Item>
|
|
173
|
-
</SegmentedControl.Root>
|
|
174
|
-
</PageToolbar.Sections>
|
|
175
|
-
<PageToolbar.Actions>
|
|
176
|
-
<Button.Root>
|
|
177
|
-
<Button.Icon>
|
|
178
|
-
<Icon name="action.add" />
|
|
179
|
-
</Button.Icon>
|
|
180
|
-
Новая сделка
|
|
181
|
-
</Button.Root>
|
|
182
|
-
</PageToolbar.Actions>
|
|
183
|
-
</PageToolbar.Root>
|
|
184
|
-
</AppHeader.Tools>
|
|
185
|
-
</AppHeader.Root>
|
|
186
|
-
);
|
|
187
|
-
}
|
|
188
|
-
```
|
|
189
|
-
|
|
190
131
|
## Navigation structure (the sidebar's content)
|
|
191
132
|
|
|
192
133
|
The sidebar is the product's map: people scan it, remember where things are and come back. Build it
|
|
@@ -208,20 +149,20 @@ shows only icons); none on the children of a sub-list.
|
|
|
208
149
|
|
|
209
150
|
## Page wrapper
|
|
210
151
|
|
|
211
|
-
- App pages (dashboard, list, detail, a board): `
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
- Document pages — settings and long forms: `
|
|
215
|
-
(the page's h1) and a `
|
|
216
|
-
(
|
|
152
|
+
- App pages (dashboard, list, detail, a board): `Page.Root` — the full width of the panel; the
|
|
153
|
+
page's title and tools are in its `Page.TopBar`, its blocks go into `Page.Body`
|
|
154
|
+
([the page skeleton](composition.md#1-page-skeleton)).
|
|
155
|
+
- Document pages — settings and long forms: `Page.Root maxWidth="wide"` with `Page.Header` in the
|
|
156
|
+
flow (the page's h1) and a `Page.Section layout="aside"` (heading column + panel) per section
|
|
157
|
+
([the settings page](reference/layout/page/examples/screen.tsx)), or `maxWidth="readable"` for a single
|
|
217
158
|
narrow column of fields.
|
|
218
|
-
- Long reading text (terms, help): `
|
|
159
|
+
- Long reading text (terms, help): `Page.Root maxWidth="readable"` with `Page.Header` in the flow.
|
|
219
160
|
- A page as high as the panel (a log, a board, a chat): `AppShell.Root fillViewport` +
|
|
220
|
-
`
|
|
221
|
-
`scrollHeight="fill"`, Crossfade `fill`, `
|
|
222
|
-
- List + detail (mail, a messenger, a ticket queue): `
|
|
223
|
-
`
|
|
224
|
-
at a time below it with `
|
|
161
|
+
`Page.Root fill`; the body passes its free height to a filling child — DataTable
|
|
162
|
+
`scrollHeight="fill"`, Crossfade `fill`, `Page.Split`. Never compute heights from `100vh`.
|
|
163
|
+
- List + detail (mail, a messenger, a ticket queue): `Page.Split` with `Page.List` and
|
|
164
|
+
`Page.Detail` in a filling page. Side by side from 48rem of the split's own width, one pane
|
|
165
|
+
at a time below it with `Page.BackButton` first in the detail's header; `open` is «a record
|
|
225
166
|
is chosen». Each pane gives its last child the free height: a Card with its own `ScrollContainer`
|
|
226
167
|
(`anchor="end"` for a thread). The records in the list pane are a `List` (`current` on the open
|
|
227
168
|
one), the conversations of a messenger a `ChatList`. Details that open over a table and close
|
|
@@ -72,7 +72,7 @@ Avatar.Group overlapping row, gives its size to members
|
|
|
72
72
|
| `…rest` | `Omit<HTMLAttributes<HTMLSpanElement>, "children">` | — | `className` and the other span attributes. |
|
|
73
73
|
|
|
74
74
|
### Avatar.Group
|
|
75
|
-
`ref` → `HTMLDivElement`. An overlapping row (`role="group"`); members overlap by
|
|
75
|
+
`ref` → `HTMLDivElement`. An overlapping row (`role="group"`); members overlap by an eighth of the diameter with a ring in `--avatar-ring`.
|
|
76
76
|
|
|
77
77
|
| Prop | Type | Default | Description |
|
|
78
78
|
|---|---|---|---|
|
|
@@ -119,7 +119,7 @@ The soft fill is opaque: the soft hue is composited over the ground the avatar s
|
|
|
119
119
|
## Layout & spacing
|
|
120
120
|
- Inline-flex, never shrinks, `vertical-align: middle`.
|
|
121
121
|
- Avatar → name: space step 3 (12px) in lists and cards, step 2 (8px) in table cells.
|
|
122
|
-
- Group: members overlap by
|
|
122
|
+
- Group: members overlap by an eighth of the diameter (initials are never cut) with a 2px ring in the ground they stand on: the current layer of the surface around them (no surface sets anything), or `--avatar-ring` from a host whose ground is not a layer (a reaction chip sets its own fill); the fills of initials and «+N» are composited over the same ground.
|
|
123
123
|
- An icon fallback is half the diameter: a kit `Icon` reads `--prime-icon-size`, a raw svg too.
|
|
124
124
|
|
|
125
125
|
## Accessibility
|
|
@@ -28,7 +28,7 @@ const MEMBERS: { name: string; initials: string; color: PaletteColor; src?: stri
|
|
|
28
28
|
|
|
29
29
|
export default function AvatarTeamGroupExample() {
|
|
30
30
|
return (
|
|
31
|
-
<Avatar.Group size="
|
|
31
|
+
<Avatar.Group size="l" aria-label="Участники проекта: 7">
|
|
32
32
|
{MEMBERS.map((member) => (
|
|
33
33
|
<Avatar.Root key={member.initials} color={member.color} aria-label={member.name}>
|
|
34
34
|
{member.src ? <Avatar.Image src={member.src} /> : null}
|
|
@@ -29,8 +29,8 @@ Banner.Root <div>; variant, tone, size, placement
|
|
|
29
29
|
│ ├─ Banner.Icon one Icon on the first line (aria-hidden)
|
|
30
30
|
│ ├─ Banner.Title
|
|
31
31
|
│ ├─ Banner.Description
|
|
32
|
-
│ └─ Banner.Actions buttons; with onDismiss the close button is last here
|
|
33
|
-
└─ close button with onDismiss and no Actions: ghost icon Button (tone="inherit"), top-right
|
|
32
|
+
│ └─ Banner.Actions buttons; with onDismiss the close button is last here (wide banner)
|
|
33
|
+
└─ close button with onDismiss and no Actions, or Actions under the text: ghost icon Button (tone="inherit"), top-right
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
## API
|
|
@@ -72,7 +72,7 @@ Banner.Root <div>; variant, tone, size, placement
|
|
|
72
72
|
| `…rest` | `HTMLAttributes<HTMLSpanElement>` | — | `children`, `className` and the other span attributes. |
|
|
73
73
|
|
|
74
74
|
### Banner.Actions
|
|
75
|
-
`ref` → `HTMLDivElement`. A `<div>` row of buttons; with `onDismiss` the close button becomes its last square button.
|
|
75
|
+
`ref` → `HTMLDivElement`. A `<div>` row of buttons; with `onDismiss` the close button becomes its last square button (in the corner below 36rem).
|
|
76
76
|
|
|
77
77
|
| Prop | Type | Default | Description |
|
|
78
78
|
|---|---|---|---|
|
|
@@ -115,7 +115,7 @@ Banner.Root <div>; variant, tone, size, placement
|
|
|
115
115
|
|---|---|---|
|
|
116
116
|
| look | `variant`, `tone`, `size`, `placement` | `data-variant`, `data-tone`, `data-size`, `data-placement` |
|
|
117
117
|
| dismissible | `onDismiss` | corner ghost Button (`xs`, `s` on `l` / `xl`), or the last outline Button in `Banner.Actions` |
|
|
118
|
-
| narrow | own width < 36rem (a banner with `Banner.Actions` is a size container) | actions move under the text |
|
|
118
|
+
| narrow | own width < 36rem (a banner with `Banner.Actions` is a size container) | actions move under the text; the close button returns to the corner |
|
|
119
119
|
|
|
120
120
|
No `open` prop: the parent mounts and unmounts the banner. A mounted banner enters (a short fade and rise); an unmounted one closes up in place, so the content below glides up instead of jumping. To swap the banner for another block in the same spot (a «restore» button), wrap both in [Crossfade](../crossfade/COMPONENT.md).
|
|
121
121
|
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
min-width: 0;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
/* page-strip.tsx:
|
|
11
|
+
/* page-strip.tsx: a page — the strip spans its whole width, the content below keeps the page's
|
|
12
|
+
side padding, so the strip reads wider than the card with the inset banner. */
|
|
12
13
|
.sections {
|
|
13
14
|
display: flex;
|
|
14
15
|
flex-direction: column;
|
|
@@ -17,6 +18,10 @@
|
|
|
17
18
|
min-width: 0;
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
.pageBody {
|
|
22
|
+
padding-inline: var(--prime-layout-gutter);
|
|
23
|
+
}
|
|
24
|
+
|
|
20
25
|
/* narrow.tsx: a 320px column; the banner's container query moves actions under the text. */
|
|
21
26
|
.narrow {
|
|
22
27
|
width: min(100%, calc(var(--prime-space-20) * 4));
|
|
@@ -6,7 +6,7 @@ import styles from "./examples.module.css";
|
|
|
6
6
|
export default function BannerPageStripExample() {
|
|
7
7
|
return (
|
|
8
8
|
<div className={styles.sections}>
|
|
9
|
-
{/* In an app the strip stands first in the page, edge to edge above its content. */}
|
|
9
|
+
{/* In an app the strip stands first in the page, edge to edge above its padded content. */}
|
|
10
10
|
<Banner.Root
|
|
11
11
|
tone="warning"
|
|
12
12
|
placement="page"
|
|
@@ -21,27 +21,29 @@ export default function BannerPageStripExample() {
|
|
|
21
21
|
<Banner.Title>Пробный период закончится 12 октября</Banner.Title>
|
|
22
22
|
</Banner.Content>
|
|
23
23
|
</Banner.Root>
|
|
24
|
-
<
|
|
25
|
-
<Card.
|
|
26
|
-
<Card.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
<Banner.
|
|
31
|
-
<Banner.
|
|
32
|
-
<Icon
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
24
|
+
<div className={styles.pageBody}>
|
|
25
|
+
<Card.Root variant="panel">
|
|
26
|
+
<Card.Header>
|
|
27
|
+
<Card.Title>Оплата</Card.Title>
|
|
28
|
+
</Card.Header>
|
|
29
|
+
<Card.Body>
|
|
30
|
+
<Banner.Root tone="danger">
|
|
31
|
+
<Banner.Content>
|
|
32
|
+
<Banner.Icon>
|
|
33
|
+
<Icon name="status.danger" />
|
|
34
|
+
</Banner.Icon>
|
|
35
|
+
<Banner.Title>Не удалось списать оплату</Banner.Title>
|
|
36
|
+
<Banner.Description>
|
|
37
|
+
Карта •••• 4242 отклонена банком. Обновите способ оплаты до 15 октября.
|
|
38
|
+
</Banner.Description>
|
|
39
|
+
<Banner.Actions>
|
|
40
|
+
<Button.Root tone="danger">Обновить карту</Button.Root>
|
|
41
|
+
</Banner.Actions>
|
|
42
|
+
</Banner.Content>
|
|
43
|
+
</Banner.Root>
|
|
44
|
+
</Card.Body>
|
|
45
|
+
</Card.Root>
|
|
46
|
+
</div>
|
|
45
47
|
</div>
|
|
46
48
|
);
|
|
47
49
|
}
|
|
@@ -32,7 +32,7 @@ Breadcrumb.Root <nav aria-label> + <ol>; size; chevrons between levels
|
|
|
32
32
|
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
33
33
|
|
|
34
34
|
### Breadcrumb.Root
|
|
35
|
-
`ref` → `HTMLElement` (the `<nav>`). `<nav aria-label>` with an `<ol>`; draws the chevrons between levels, sets the size and
|
|
35
|
+
`ref` → `HTMLElement` (the `<nav>`). `<nav aria-label>` with an `<ol>`; draws the chevrons between levels, sets the size and folds levels that do not fit into a «…» menu button that lists them: the middle ones, then the first one too.
|
|
36
36
|
|
|
37
37
|
| Prop | Type | Default | Description |
|
|
38
38
|
|---|---|---|---|
|
|
@@ -85,15 +85,16 @@ Use links for every ancestor and `current` on the last item; `s` above a `headin
|
|
|
85
85
|
|---|---|---|
|
|
86
86
|
| current | `current` | `aria-current="page"` on the text span, or on the link when the item has `href` |
|
|
87
87
|
| hover / focus-visible on links | pointer / keyboard | text → primary; focus ring from LinkButton |
|
|
88
|
-
| truncation | width | each level truncates with an ellipsis, max width `2 × --prime-space-24` (192;
|
|
89
|
-
| auto-collapse |
|
|
88
|
+
| truncation | width | each level truncates with an ellipsis, max width `2 × --prime-space-24` (192); the current page shrinks at half the rate of the others |
|
|
89
|
+
| auto-collapse | 2+ levels whose whole path does not fit the width uncut (measured on every resize) | `data-collapsible="true"`, `data-collapsed="true"`; middle levels are `display: none` and replaced by «… ›»: a ghost menu button (`Dropdown.Trigger`, named by `labels.ellipsis`) whose menu lists them — links stay links, a level without `href` is a disabled row |
|
|
90
|
+
| deep collapse | the path folded as above still does not fit | `data-collapsed="deep"`; the first level folds too: «…» › current page, the menu lists every level before it |
|
|
90
91
|
| collapse menu open | a press, `Enter` or `ArrowDown` on the «…» | `aria-expanded="true"` on the button; a `role="menu"` panel at the tier size |
|
|
91
92
|
|
|
92
|
-
Root attributes: `data-size`, `data-collapsible` (`"true"` / `"false"`).
|
|
93
|
+
Root attributes: `data-size`, `data-collapsible` (`"true"` / `"false"`), `data-collapsed` (`"true"` / `"deep"`).
|
|
93
94
|
|
|
94
95
|
## Layout & spacing
|
|
95
|
-
- A
|
|
96
|
-
- In
|
|
96
|
+
- A single level takes its content width (at most the row). A path of 2+ levels fills the row (`inline-size: 100%`) and folds by that width, so a wider row unfolds it again; its intrinsic width stays the whole path, so a host that measures natural widths (the `Page.TopBar` plan) reads it uncut. Inside a flex row give it a box that takes the room it may use (`flex: 1 1 auto; min-width: 0`).
|
|
97
|
+
- In a `Page.Heading` the path up holds the list a record belongs to (1–2 levels); the record itself is the `Page.Title` (in a top bar the path's last level, after the chevron), not the breadcrumb's `current` item.
|
|
97
98
|
- Above a page title: `gap: var(--prime-space-2)` between the trail and the title row.
|
|
98
99
|
- The list never wraps. Chevrons sit inside each level after the first, in the placeholder text color, at the tier icon size.
|
|
99
100
|
|
|
@@ -113,7 +114,7 @@ Root attributes: `data-size`, `data-collapsible` (`"true"` / `"false"`).
|
|
|
113
114
|
|
|
114
115
|
- `nav` landmark with `aria-label` from `labels.nav`; an ordered list.
|
|
115
116
|
- The current page has `aria-current="page"`; the chevrons are `aria-hidden` spans inside the levels, so every list item is a level.
|
|
116
|
-
- Collapsed
|
|
117
|
+
- Collapsed levels leave the layout and the tab order (no invisible focus stops); the automatic «…» is a menu button (`aria-haspopup="menu"`) named by `labels.ellipsis`, and its menu lists them as links.
|
|
117
118
|
- Icon-only links need `aria-label` on the Item.
|
|
118
119
|
|
|
119
120
|
### Labels
|
|
@@ -141,4 +142,4 @@ Root attributes: `data-size`, `data-collapsible` (`"true"` / `"false"`).
|
|
|
141
142
|
|
|
142
143
|
## Related
|
|
143
144
|
- **Built from:** [LinkButton](../link-button/COMPONENT.md) (`tone="muted"`), [Button](../button/COMPONENT.md) and [Dropdown](../dropdown/COMPONENT.md) (the collapse menu), Icon (`nav.chevronRight`), [VisuallyHidden](../visually-hidden/COMPONENT.md)
|
|
144
|
-
- **See also:** [Tabs](../tabs/COMPONENT.md), [
|
|
145
|
+
- **See also:** [Tabs](../tabs/COMPONENT.md), [Page](../../layout/page/COMPONENT.md), [Stepper](../stepper/COMPONENT.md)
|
|
@@ -144,6 +144,7 @@ A Button lines up exactly with Input, Select, Datepicker trigger, SegmentedContr
|
|
|
144
144
|
|---|---|---|---|
|
|
145
145
|
| `fullWidth` | button fills the row | narrow forms, cards, mobile footers | off |
|
|
146
146
|
| icon-only (children are only `Button.Icon`) | square, width = height | toolbars; needs `aria-label` | — |
|
|
147
|
+
| icon only by the host (`data-button-label="icon"` on a wrapper, the `Page.TopBar` plan) | a Button with an icon and a label shows only its icon, square; the label and anything else beside the icon (a `Kbd` hint) stay transparent over it, the label as the name | a host short of width | — |
|
|
147
148
|
| `pressed` / `defaultPressed` | on: accent soft fill and accent text over any variant; off: the variant's own look | a single toggle (favourite, pin, «show archived») | — (not a toggle) |
|
|
148
149
|
| `current` | the selected look, `aria-current="page"` | the current page of a set (page numbers) | off |
|
|
149
150
|
|
|
@@ -13,15 +13,15 @@ export default function ButtonOnColoredHostExample() {
|
|
|
13
13
|
<Banner.Root key={text} variant="solid" tone={tone}>
|
|
14
14
|
<Banner.Content>
|
|
15
15
|
<Banner.Title>{text}</Banner.Title>
|
|
16
|
+
<Banner.Actions>
|
|
17
|
+
<Button.Root variant="soft" tone="inherit">
|
|
18
|
+
{action}
|
|
19
|
+
</Button.Root>
|
|
20
|
+
<Button.Root variant="ghost" tone="inherit">
|
|
21
|
+
{later}
|
|
22
|
+
</Button.Root>
|
|
23
|
+
</Banner.Actions>
|
|
16
24
|
</Banner.Content>
|
|
17
|
-
<Banner.Actions>
|
|
18
|
-
<Button.Root variant="soft" tone="inherit">
|
|
19
|
-
{action}
|
|
20
|
-
</Button.Root>
|
|
21
|
-
<Button.Root variant="ghost" tone="inherit">
|
|
22
|
-
{later}
|
|
23
|
-
</Button.Root>
|
|
24
|
-
</Banner.Actions>
|
|
25
25
|
</Banner.Root>
|
|
26
26
|
))}
|
|
27
27
|
</>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
- A tile that is itself the way to its details — a KPI that opens its report, a project tile (`asChild` with a link or a button).
|
|
14
14
|
|
|
15
15
|
## When not to use
|
|
16
|
-
- A whole page region with a title and description → [
|
|
16
|
+
- A whole page region with a title and description → [Page](../../layout/page/COMPONENT.md) sections (`Page.Section`); do not wrap every section in a card.
|
|
17
17
|
- Tabular data → use [DataTable](../data-table/COMPONENT.md) (it has its own fill).
|
|
18
18
|
- A message about the page state → [Banner](../banner/COMPONENT.md); nothing to show yet → [EmptyPage](../empty-page/COMPONENT.md).
|
|
19
19
|
- Content that floats over the page → [Popover](../popover/COMPONENT.md), [Modal](../modal/COMPONENT.md) or [Drawer](../drawer/COMPONENT.md).
|
|
@@ -101,7 +101,7 @@ Card.Root asChild <a> or <button> (the only child) holding the pa
|
|
|
101
101
|
| `…rest` | `HTMLAttributes<HTMLElement>` | — | `children`, `className` and the other attributes of the element. |
|
|
102
102
|
|
|
103
103
|
### Card.Label · Card.Value
|
|
104
|
-
`ref` → `HTMLSpanElement`. Metric text: the label (body-s,
|
|
104
|
+
`ref` → `HTMLSpanElement`. Metric text: the label (body-s; truncates, wraps in a `mini` tile and a `split` cell) and the value (tabular, sized by the template and the card width).
|
|
105
105
|
|
|
106
106
|
| Prop | Type | Default | Description |
|
|
107
107
|
|---|---|---|---|
|
|
@@ -170,11 +170,11 @@ Card.Root asChild <a> or <button> (the only child) holding the pa
|
|
|
170
170
|
Without `asChild` a card is static: no hover, focus or press of its own. With it: `data-interactive` on the element.
|
|
171
171
|
|
|
172
172
|
## Layout & spacing
|
|
173
|
-
- Cards on a page: one `
|
|
173
|
+
- Cards on a page: one `Page.Grid` with a `Page.Cell span` per card (16 on both axes, the cards of a row share one height); a grid inside one block is the block's own intrinsic `auto-fill` grid on the tile width of the layout tokens (a lone card keeps its column width), gap `--prime-space-4`.
|
|
174
174
|
- Radius `--prime-card-radius`, no border. In `panel` and `list` the `Header` is a padded zone with a faint inset hairline below; in `stat-trend` it can pair a leading Badge or icon with a compact `Card.Value`.
|
|
175
175
|
- Padding `--prime-card-padding-m` (20); `Body` gap `--prime-card-gap` (16); fields inside `Body` 20 apart, one ladder step off the card.
|
|
176
176
|
- Depth comes from nesting (foundation §4): on the page — the AppShell panel is the page — a card is layer 1 (white in light) with the raised whisper; inside another card it is the next layer, a flat tile. The ladder stops at layer 4.
|
|
177
|
-
- Long values wrap
|
|
177
|
+
- Long values wrap; labels truncate, except in a `mini` tile and a `split` cell, where a label beside the icon wraps instead; a chart SVG needs a CSS height.
|
|
178
178
|
- In a `Header` the title takes the free width; a control or a caption after it sits at the end without a wrapper. A `Card.Description` in the header stacks under the title, 4 apart; the control stays at the end, centred on both lines.
|
|
179
179
|
- `Card.Meta` in `stat-trend` takes the bottom of the tile (`margin-top: auto`), so tiles of one row line their meta up; in `mini` and a `split` cell it sits in the text column under the value.
|
|
180
180
|
|
|
@@ -212,11 +212,11 @@ No `labels`.
|
|
|
212
212
|
| [content-templates.tsx](examples/content-templates.tsx) | Content templates: a call to action, an events list and a campaign tile with a cover — `Card.Footer`, `Card.List`, `Card.Media`. |
|
|
213
213
|
| [flat.tsx](examples/flat.tsx) | A flat tile without the raised shadow next to the default one, for dense grids — `flat`. |
|
|
214
214
|
| [narrow.tsx](examples/narrow.tsx) | The card is a size container: the split template stacks its cells below 22rem and the trend value shrinks below 20rem — `variant`. |
|
|
215
|
-
| [screen.tsx](examples/screen.tsx) | A dashboard: the title
|
|
215
|
+
| [screen.tsx](examples/screen.tsx) | A dashboard: the title and a line of data in the page flow, the period switch and the report in the top bar that keeps the title once it scrolls away; one grid of KPI tiles that cross-fade to the new period, a revenue trend, invoiced against paid beside two panels, and the latest payments with a link to the list — `collapse`, `Page.Grid`. |
|
|
216
216
|
|
|
217
217
|
## Mistakes
|
|
218
218
|
- A `<div>` with a border styled as a card → use `Card.Root`; depth comes from fill, not lines.
|
|
219
|
-
- Wrapping every page section in a card → use
|
|
219
|
+
- Wrapping every page section in a card → use `Page.Section`.
|
|
220
220
|
- `Card.Delta tone="success"` for every «+» → choose the tone by meaning.
|
|
221
221
|
- Custom padding on a `panel` root → padding belongs to `Header` / `Body` / `Footer`.
|
|
222
222
|
- A wrapper `<div>` around the label and the value of `mini` → put `Icon`, `Label`, `Value` straight into the root (or into a `split` cell); the template lays them out.
|
|
@@ -228,4 +228,4 @@ No `labels`.
|
|
|
228
228
|
|
|
229
229
|
## Related
|
|
230
230
|
- **Built from:** —
|
|
231
|
-
- **See also:** [
|
|
231
|
+
- **See also:** [Page](../../layout/page/COMPONENT.md), [DescriptionList](../description-list/COMPONENT.md) (record details inside a `Card.Body`), [Fieldset](../fieldset/COMPONENT.md) (groups of fields inside a settings card), [DataTable](../data-table/COMPONENT.md), [Badge](../badge/COMPONENT.md), [ProgressBar](../progress-bar/COMPONENT.md), [SegmentedControl](../segmented-control/COMPONENT.md), [Sparkline](../sparkline/COMPONENT.md) (a trend with its total inside a `panel`), [ChartFrame](../chart-frame/COMPONENT.md) (a full chart with legend and states)
|