prime-ui-kit 0.16.0 → 0.18.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 +15 -18
- package/dist/chunks/{chunk-A7OQWH6R.js → chunk-IVS3J7AS.js} +1 -1
- package/dist/chunks/{chunk-6TPHKCUJ.js → chunk-MB4CXSLL.js} +27732 -26723
- package/dist/chunks/{chunk-4PSQ64S4.js → chunk-OAXJWF3L.js} +6818 -6264
- package/dist/chunks/{chunk-U3Q2I3MY.js → chunk-QFHE5GKW.js} +3 -2
- package/dist/chunks/{chunk-HDBQICPW.js → chunk-X3JT5CLR.js} +60 -20
- package/dist/color-picker.d.ts +1 -1
- package/dist/color-picker.js +3 -3
- package/dist/components/badge/Badge.d.ts +17 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +12 -3
- package/dist/components/button/Button.d.ts +1 -1
- package/dist/components/button-group/ButtonGroup.d.ts +1 -1
- package/dist/components/card/Card.d.ts +8 -4
- package/dist/components/chart-frame/ChartFrame.d.ts +1 -1
- package/dist/components/chat/Chat.d.ts +3 -3
- package/dist/components/chat/ChatRows.d.ts +5 -1
- package/dist/components/chat/MessageList.d.ts +5 -1
- package/dist/components/chat/groupMessages.d.ts +12 -4
- package/dist/components/chat-list/ChatList.d.ts +18 -9
- package/dist/components/chat-list/formatChatTime.d.ts +3 -3
- package/dist/components/checkbox/Checkbox.d.ts +6 -1
- package/dist/components/color-field/ColorField.d.ts +1 -1
- package/dist/components/color-picker/ColorPicker.d.ts +23 -1
- package/dist/components/color-picker/ColorPresets.d.ts +9 -1
- package/dist/components/crossfade/Crossfade.d.ts +1 -1
- package/dist/components/data-table/DataTable.d.ts +3 -1
- package/dist/components/data-table/Head.d.ts +3 -1
- package/dist/components/data-table/types.d.ts +5 -0
- package/dist/components/digit-input/DigitInput.d.ts +1 -1
- package/dist/components/drawer/Drawer.d.ts +3 -2
- package/dist/components/field-list/FieldList.d.ts +18 -6
- package/dist/components/hint/Hint.d.ts +8 -2
- package/dist/components/index.d.ts +6 -7
- package/dist/components/input/Input.d.ts +27 -5
- package/dist/components/input/inputSuggestions.d.ts +39 -0
- package/dist/components/kanban/Kanban.d.ts +4 -9
- package/dist/components/list/List.d.ts +19 -5
- package/dist/components/message/Message.d.ts +15 -3
- package/dist/components/message/MessageSticker.d.ts +27 -0
- package/dist/components/message/formatMessageTime.d.ts +5 -2
- package/dist/components/modal/Modal.d.ts +3 -2
- package/dist/components/native-select/NativeSelect.d.ts +1 -1
- package/dist/components/pagination/Pagination.d.ts +5 -1
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/radio/Radio.d.ts +11 -2
- package/dist/components/rich-text/RichText.d.ts +23 -0
- package/dist/components/scroll-container/ScrollContainer.d.ts +1 -1
- package/dist/components/scroll-container/scrollGlide.d.ts +26 -0
- package/dist/components/scroll-container/useScrollMotion.d.ts +25 -0
- package/dist/components/segmented-control/SegmentedControl.d.ts +1 -1
- package/dist/components/select/selectContext.d.ts +7 -0
- package/dist/components/slider/Slider.d.ts +2 -2
- package/dist/components/smart-filter/SmartFilter.d.ts +4 -5
- package/dist/components/switch/Switch.d.ts +6 -1
- package/dist/components/tag-select/TagSelect.d.ts +1 -1
- package/dist/components/textarea/Textarea.d.ts +6 -1
- package/dist/components/timeline/Timeline.d.ts +1 -1
- package/dist/icon-set.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.js +7 -9
- package/dist/internal/ChoiceField.d.ts +3 -1
- package/dist/internal/FieldFrame.d.ts +8 -2
- package/dist/internal/barPlan.d.ts +44 -0
- package/dist/internal/fieldCell.d.ts +1 -1
- package/dist/internal/formatClock.d.ts +23 -2
- package/dist/internal/leaveGuard.d.ts +21 -0
- package/dist/internal/messageList.d.ts +2 -0
- package/dist/internal/overlay/DialogParts.d.ts +27 -2
- 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/internal/swatch.d.ts +5 -0
- package/dist/internal/tokenDefaults.d.ts +1 -0
- 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 +302 -0
- package/dist/layout/sidebar/Sidebar.d.ts +1 -1
- package/dist/skill/SKILL.md +10 -10
- package/dist/skill/anti-slop.md +106 -5
- package/dist/skill/api-contract.md +15 -8
- package/dist/skill/cheatsheet.md +46 -26
- package/dist/skill/checklist.md +12 -3
- package/dist/skill/choosing.md +34 -20
- package/dist/skill/components.md +4 -5
- package/dist/skill/composition.md +193 -154
- package/dist/skill/foundations.md +9 -9
- package/dist/skill/layouts.md +42 -99
- 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/badge/COMPONENT.md +14 -1
- package/dist/skill/reference/components/badge/examples/examples.module.css +7 -0
- package/dist/skill/reference/components/badge/examples/tag-row.tsx +34 -0
- 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 +18 -12
- package/dist/skill/reference/components/breadcrumb/examples/router.tsx +17 -0
- package/dist/skill/reference/components/button/COMPONENT.md +2 -1
- 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/button-group/COMPONENT.md +1 -0
- package/dist/skill/reference/components/card/COMPONENT.md +14 -8
- 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/card/examples/states.tsx +59 -0
- 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 +8 -5
- 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/examples/time-zone.tsx +83 -0
- package/dist/skill/reference/components/chat-list/COMPONENT.md +14 -8
- 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/chat-list/examples/links.tsx +1 -1
- package/dist/skill/reference/components/chat-list/examples/router.tsx +63 -0
- package/dist/skill/reference/components/checkbox/COMPONENT.md +1 -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-field/COMPONENT.md +2 -1
- package/dist/skill/reference/components/color-picker/COMPONENT.md +31 -11
- 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/presets-custom.tsx +31 -0
- package/dist/skill/reference/components/color-picker/examples/sizes.tsx +4 -8
- package/dist/skill/reference/components/color-swatches/COMPONENT.md +1 -0
- package/dist/skill/reference/components/crossfade/COMPONENT.md +3 -3
- package/dist/skill/reference/components/crossfade/examples/screen.tsx +107 -112
- package/dist/skill/reference/components/data-table/COMPONENT.md +12 -7
- package/dist/skill/reference/components/data-table/examples/examples.module.css +9 -0
- package/dist/skill/reference/components/data-table/examples/numeric.tsx +9 -2
- 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/COMPONENT.md +3 -1
- package/dist/skill/reference/components/datepicker/examples/deadline.tsx +33 -0
- 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/COMPONENT.md +1 -0
- 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 +16 -3
- package/dist/skill/reference/components/drawer/examples/client-card.tsx +32 -8
- 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/COMPONENT.md +15 -3
- package/dist/skill/reference/components/field-list/examples/saving.tsx +83 -0
- 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/field-list/examples/totals.tsx +82 -0
- 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 +2 -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/COMPONENT.md +16 -2
- 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/hint/examples/variants.tsx +48 -0
- package/dist/skill/reference/components/input/COMPONENT.md +39 -9
- package/dist/skill/reference/components/input/examples/affixes.tsx +4 -2
- package/dist/skill/reference/components/input/examples/dismiss.tsx +29 -0
- package/dist/skill/reference/components/input/examples/suggestions.tsx +26 -0
- package/dist/skill/reference/components/input/examples/time.tsx +24 -0
- package/dist/skill/reference/components/input/examples/with-select.tsx +44 -0
- package/dist/skill/reference/components/kanban/COMPONENT.md +7 -7
- package/dist/skill/reference/components/kanban/examples/columns.tsx +4 -2
- 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 +26 -10
- package/dist/skill/reference/components/list/examples/row-controls.tsx +80 -0
- package/dist/skill/reference/components/list/examples/with-icon.tsx +23 -2
- package/dist/skill/reference/components/login-form/COMPONENT.md +8 -7
- package/dist/skill/reference/components/login-form/examples/states.tsx +12 -14
- 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/message/COMPONENT.md +30 -9
- package/dist/skill/reference/components/message/examples/preview.tsx +28 -0
- package/dist/skill/reference/components/message/examples/sticker.tsx +35 -0
- package/dist/skill/reference/components/modal/COMPONENT.md +15 -3
- package/dist/skill/reference/components/modal/examples/long-content.tsx +37 -18
- package/dist/skill/reference/components/native-select/COMPONENT.md +1 -0
- package/dist/skill/reference/components/notification/COMPONENT.md +1 -1
- 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/radio/COMPONENT.md +2 -0
- package/dist/skill/reference/components/rich-text/COMPONENT.md +93 -0
- package/dist/skill/reference/components/rich-text/examples/overview.tsx +19 -0
- package/dist/skill/reference/components/scroll-container/COMPONENT.md +8 -5
- package/dist/skill/reference/components/segmented-control/COMPONENT.md +1 -0
- package/dist/skill/reference/components/segmented-control/examples/in-form.tsx +1 -1
- package/dist/skill/reference/components/select/COMPONENT.md +7 -3
- package/dist/skill/reference/components/slider/COMPONENT.md +4 -3
- package/dist/skill/reference/components/slider/examples/controlled.tsx +1 -1
- 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 +2 -1
- package/dist/skill/reference/components/tabs/COMPONENT.md +1 -1
- package/dist/skill/reference/components/tag-select/COMPONENT.md +1 -0
- package/dist/skill/reference/components/textarea/COMPONENT.md +1 -0
- package/dist/skill/reference/components/timeline/COMPONENT.md +3 -3
- package/dist/skill/reference/components/timeline/examples/structure.tsx +2 -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 +4 -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 +382 -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/layout/page/examples/examples.module.css +92 -0
- package/{src/components/page-content → dist/skill/reference/layout/page}/examples/grid.tsx +15 -15
- package/dist/skill/reference/layout/page/examples/guard.tsx +87 -0
- package/dist/skill/reference/{components/page-content → layout/page}/examples/list-detail.tsx +14 -14
- package/dist/skill/reference/layout/page/examples/loading.tsx +57 -0
- 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 +6 -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 +94 -75
- package/dist/skill/ux.md +5 -3
- package/dist/tokens/layers.d.ts +2 -0
- package/dist/tokens/primitives.d.ts +12 -2
- package/dist/tokens/semantic.d.ts +9 -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/badge/COMPONENT.md +14 -1
- package/src/components/badge/examples/examples.module.css +7 -0
- package/src/components/badge/examples/tag-row.tsx +34 -0
- 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 +18 -12
- package/src/components/breadcrumb/examples/router.tsx +17 -0
- package/src/components/button/COMPONENT.md +2 -1
- 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/button-group/COMPONENT.md +1 -0
- package/src/components/card/COMPONENT.md +14 -8
- package/src/components/card/examples/screen.module.css +1 -1
- package/src/components/card/examples/screen.tsx +184 -198
- package/src/components/card/examples/states.tsx +59 -0
- 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 +8 -5
- package/src/components/chat/examples/screen.module.css +1 -1
- package/src/components/chat/examples/screen.tsx +110 -117
- package/src/components/chat/examples/time-zone.tsx +83 -0
- package/src/components/chat-list/COMPONENT.md +14 -8
- package/src/components/chat-list/examples/controlled.tsx +2 -2
- package/src/components/chat-list/examples/examples.module.css +8 -0
- package/src/components/chat-list/examples/links.tsx +1 -1
- package/src/components/chat-list/examples/router.tsx +63 -0
- package/src/components/checkbox/COMPONENT.md +1 -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-field/COMPONENT.md +2 -1
- package/src/components/color-picker/COMPONENT.md +31 -11
- 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/presets-custom.tsx +31 -0
- package/src/components/color-picker/examples/sizes.tsx +4 -8
- package/src/components/color-swatches/COMPONENT.md +1 -0
- package/src/components/crossfade/COMPONENT.md +3 -3
- package/src/components/crossfade/examples/screen.tsx +107 -112
- package/src/components/data-table/COMPONENT.md +12 -7
- package/src/components/data-table/examples/examples.module.css +9 -0
- package/src/components/data-table/examples/numeric.tsx +9 -2
- package/src/components/data-table/examples/screen.tsx +42 -52
- package/src/components/data-table/examples/server.tsx +6 -2
- package/src/components/datepicker/COMPONENT.md +3 -1
- package/src/components/datepicker/examples/deadline.tsx +33 -0
- 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/COMPONENT.md +1 -0
- 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 +16 -3
- package/src/components/drawer/examples/client-card.tsx +32 -8
- 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/COMPONENT.md +15 -3
- package/src/components/field-list/examples/saving.tsx +83 -0
- package/src/components/field-list/examples/screen.module.css +1 -1
- package/src/components/field-list/examples/screen.tsx +19 -19
- package/src/components/field-list/examples/totals.tsx +82 -0
- package/src/components/fieldset/COMPONENT.md +1 -1
- package/src/components/fieldset/examples/states.tsx +1 -1
- package/src/components/file-upload/COMPONENT.md +2 -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/COMPONENT.md +16 -2
- package/src/components/hint/examples/examples.module.css +10 -1
- package/src/components/hint/examples/overview.tsx +1 -1
- package/src/components/hint/examples/variants.tsx +48 -0
- package/src/components/input/COMPONENT.md +39 -9
- package/src/components/input/examples/affixes.tsx +4 -2
- package/src/components/input/examples/dismiss.tsx +29 -0
- package/src/components/input/examples/suggestions.tsx +26 -0
- package/src/components/input/examples/time.tsx +24 -0
- package/src/components/input/examples/with-select.tsx +44 -0
- package/src/components/kanban/COMPONENT.md +7 -7
- package/src/components/kanban/examples/columns.tsx +4 -2
- 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 +26 -10
- package/src/components/list/examples/row-controls.tsx +80 -0
- package/src/components/list/examples/with-icon.tsx +23 -2
- package/src/components/login-form/COMPONENT.md +8 -7
- package/src/components/login-form/examples/states.tsx +12 -14
- package/src/components/media-viewer/examples/controlled.tsx +16 -16
- package/src/components/media-viewer/examples/examples.module.css +1 -3
- package/src/components/message/COMPONENT.md +30 -9
- package/src/components/message/examples/preview.tsx +28 -0
- package/src/components/message/examples/sticker.tsx +35 -0
- package/src/components/modal/COMPONENT.md +15 -3
- package/src/components/modal/examples/long-content.tsx +37 -18
- package/src/components/native-select/COMPONENT.md +1 -0
- package/src/components/notification/COMPONENT.md +1 -1
- 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/radio/COMPONENT.md +2 -0
- package/src/components/rich-text/COMPONENT.md +93 -0
- package/src/components/rich-text/examples/overview.tsx +19 -0
- package/src/components/scroll-container/COMPONENT.md +8 -5
- package/src/components/segmented-control/COMPONENT.md +1 -0
- package/src/components/segmented-control/examples/in-form.tsx +1 -1
- package/src/components/select/COMPONENT.md +7 -3
- package/src/components/slider/COMPONENT.md +4 -3
- package/src/components/slider/examples/controlled.tsx +1 -1
- 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 +2 -1
- package/src/components/tabs/COMPONENT.md +1 -1
- package/src/components/tag-select/COMPONENT.md +1 -0
- package/src/components/textarea/COMPONENT.md +1 -0
- package/src/components/timeline/COMPONENT.md +3 -3
- package/src/components/timeline/examples/structure.tsx +2 -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 +4 -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 +382 -0
- package/src/layout/page/examples/actions-collapse.tsx +45 -0
- package/src/layout/page/examples/collapse.tsx +68 -0
- package/src/layout/page/examples/examples.module.css +92 -0
- package/{dist/skill/reference/components/page-content → src/layout/page}/examples/grid.tsx +15 -15
- package/src/layout/page/examples/guard.tsx +87 -0
- package/src/{components/page-content → layout/page}/examples/list-detail.tsx +14 -14
- package/src/layout/page/examples/loading.tsx +57 -0
- 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 +6 -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 +4 -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/components/scroll-container/useWheelToInline.d.ts +0 -10
- 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/examples.module.css +0 -56
- 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/examples.module.css +0 -56
- 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
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
# PageContent
|
|
2
|
-
|
|
3
|
-
**Category:** page
|
|
4
|
-
**Kind:** layout
|
|
5
|
-
|
|
6
|
-
> Page structure inside the main column: title, page actions and content blocks, titled sections and the tile grid of a dashboard; a page as high as the panel and the list + detail layout.
|
|
7
|
-
|
|
8
|
-
## When to use
|
|
9
|
-
- Every route rendered inside `AppShell.Main`: a page heading (`<h1>`), an intro line, page-level actions and the page body.
|
|
10
|
-
- A text page held to a reading measure (`PageContent.Root maxWidth="readable"`).
|
|
11
|
-
- A wide dashboard page capped at the content width (`maxWidth="wide"`).
|
|
12
|
-
- The tiles of a dashboard — KPI cards, charts, panels — as one board (`PageContent.Grid` + `PageContent.Cell`).
|
|
13
|
-
- A new topic of the page with its own heading and a link or button beside it (`PageContent.Section`); a settings page with a heading column beside each panel (`layout="aside"`).
|
|
14
|
-
- A page whose body takes the rest of the panel's height — a log table, a board, a chat (`fill`).
|
|
15
|
-
- Mail, a messenger, a ticket queue: a list and the chosen record side by side, one at a time on a narrow panel (`PageContent.Split`).
|
|
16
|
-
|
|
17
|
-
## When not to use
|
|
18
|
-
- The app frame (navigation rail, header, scrolling main column) → use [AppShell](../../layout/app-shell/COMPONENT.md).
|
|
19
|
-
- A bounded block inside the page → use [Card](../card/COMPONENT.md).
|
|
20
|
-
- An empty / error / not-found page → use [EmptyPage](../empty-page/COMPONENT.md).
|
|
21
|
-
- A heading inside a card → `Card.Title`; text headings inside prose → use [Typography](../typography/COMPONENT.md).
|
|
22
|
-
- A grid inside one block (thumbnails, fields, bars in a panel) → the block's own CSS grid; `PageContent.Grid` places the page's tiles.
|
|
23
|
-
- Details that open over the list and close again (a record from a table) → use [Drawer](../drawer/COMPONENT.md); `Split` is for a list people work through record by record.
|
|
24
|
-
|
|
25
|
-
## Import
|
|
26
|
-
```tsx
|
|
27
|
-
import { PageContent } from "prime-ui-kit";
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Anatomy
|
|
31
|
-
```
|
|
32
|
-
PageContent.Root column (<div>, or <section> with as="section"); maxWidth, fill
|
|
33
|
-
├─ PageContent.Header heading column + actions in one wrapping row
|
|
34
|
-
│ ├─ PageContent.Title <h1>, heading-m
|
|
35
|
-
│ ├─ PageContent.Description <p>, secondary body-m
|
|
36
|
-
│ └─ PageContent.Actions page buttons (moved to the end of the header row)
|
|
37
|
-
└─ PageContent.Body page content, blocks 24 apart
|
|
38
|
-
├─ PageContent.Grid 12-column tile grid, 16 on both axes; a container (prime-grid)
|
|
39
|
-
│ └─ PageContent.Cell one tile place: span, rows; its child fills it
|
|
40
|
-
├─ PageContent.Section <section> + <h2> label, 40 from its neighbours
|
|
41
|
-
│ └─ PageContent.Actions a link or button at the end of the section heading
|
|
42
|
-
└─ PageContent.Split list + detail; a container (prime-split)
|
|
43
|
-
├─ PageContent.Panel kind="list" list pane: 16–20rem column, or the whole split while closed
|
|
44
|
-
└─ PageContent.Panel kind="detail" detail pane: the rest, or the whole split while open
|
|
45
|
-
└─ PageContent.BackButton back to the list, only while one pane shows
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## API
|
|
49
|
-
|
|
50
|
-
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
51
|
-
|
|
52
|
-
### PageContent.Root
|
|
53
|
-
`ref` → `HTMLElement` (`<div>` or `<section>`). The page column inside `main`: header → body 24 apart, centred under its cap.
|
|
54
|
-
|
|
55
|
-
| Prop | Type | Default | Description |
|
|
56
|
-
|---|---|---|---|
|
|
57
|
-
| `as` | `"div" \| "section"` | `"div"` | `section` — the whole app page as a region; name it with `aria-labelledby` → the Title `id`. |
|
|
58
|
-
| `maxWidth` | `"full" \| "readable" \| "wide"` | `"full"` | Cap of the column, centred: `full` — the whole main; `readable` — the reading measure `--prime-layout-reading-max-width` (42rem); `wide` — the content width `--prime-layout-content-max-width` (75rem). |
|
|
59
|
-
| `fill` | `boolean` | `false` | The page takes the height of main (`AppShell.Root fillViewport`) and the body takes what the header leaves: for a full-height table, board, chat or `PageContent.Split`. |
|
|
60
|
-
| `…rest` | `HTMLAttributes<HTMLElement>` | — | `children` (Header, Body), `className` and the other attributes. |
|
|
61
|
-
|
|
62
|
-
### PageContent.Header
|
|
63
|
-
`ref` → `HTMLDivElement`. Heading column and page actions in one wrapping row; `PageContent.Actions` children move to the end.
|
|
64
|
-
|
|
65
|
-
| Prop | Type | Default | Description |
|
|
66
|
-
|---|---|---|---|
|
|
67
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children` (Title, Description, Actions), `className` and the other div attributes. |
|
|
68
|
-
|
|
69
|
-
### PageContent.Title
|
|
70
|
-
`ref` → `HTMLHeadingElement`. The page `<h1>` in heading-m.
|
|
71
|
-
|
|
72
|
-
| Prop | Type | Default | Description |
|
|
73
|
-
|---|---|---|---|
|
|
74
|
-
| `…rest` | `HTMLAttributes<HTMLHeadingElement>` | — | `children`, `id`, `className` and the other heading attributes. |
|
|
75
|
-
|
|
76
|
-
### PageContent.Description
|
|
77
|
-
`ref` → `HTMLParagraphElement`. Intro `<p>` in secondary body-m.
|
|
78
|
-
|
|
79
|
-
| Prop | Type | Default | Description |
|
|
80
|
-
|---|---|---|---|
|
|
81
|
-
| `measure` | `"readable" \| "full"` | `"readable"` | `readable` — no wider than the reading measure `--prime-layout-reading-max-width` (42rem); `full` — the full width of the parent. |
|
|
82
|
-
| `…rest` | `HTMLAttributes<HTMLParagraphElement>` | — | `children`, `className` and the other paragraph attributes. |
|
|
83
|
-
|
|
84
|
-
### PageContent.Actions
|
|
85
|
-
`ref` → `HTMLDivElement`. Page-level buttons next to the title; they wrap under the heading on narrow columns.
|
|
86
|
-
|
|
87
|
-
| Prop | Type | Default | Description |
|
|
88
|
-
|---|---|---|---|
|
|
89
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children` (Buttons), `className` and the other div attributes. |
|
|
90
|
-
|
|
91
|
-
### PageContent.Body
|
|
92
|
-
`ref` → `HTMLDivElement`. The page content: blocks of one screen 24 apart, a `PageContent.Section` 40 from its neighbours.
|
|
93
|
-
|
|
94
|
-
| Prop | Type | Default | Description |
|
|
95
|
-
|---|---|---|---|
|
|
96
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children`, `className` and the other div attributes. |
|
|
97
|
-
|
|
98
|
-
### PageContent.Section
|
|
99
|
-
`ref` → `HTMLElement`. A titled section of the page — a `<section>` named by its `h2` (title-m): the heading with an optional description and `PageContent.Actions` at its end, then the content 16 below. Stands 40 from its neighbours in Body.
|
|
100
|
-
|
|
101
|
-
| Prop | Type | Default | Description |
|
|
102
|
-
|---|---|---|---|
|
|
103
|
-
| `label` | `ReactNode` | — (required) | The visible heading (`h2`); it also names the section. |
|
|
104
|
-
| `description` | `ReactNode` | — | One line of context under the heading, in secondary body-s. |
|
|
105
|
-
| `layout` | `"stack" \| "aside"` | `"stack"` | `stack` — the heading over the content; `aside` — a ~16rem heading column beside it (a settings page), above it once the content would get narrower than 30rem. |
|
|
106
|
-
| `…rest` | `Omit<HTMLAttributes<HTMLElement>, "title">` | — | `children` (the content; `PageContent.Actions` goes to the heading row), `className` and the other section attributes. |
|
|
107
|
-
|
|
108
|
-
### PageContent.Grid
|
|
109
|
-
`ref` → `HTMLDivElement`. The grid of the page's tiles (KPI cards, charts, panels): 12 columns, 16 apart on both axes, so its rows read as one board. A size container: cells fold by its own width (see Grid columns).
|
|
110
|
-
|
|
111
|
-
| Prop | Type | Default | Description |
|
|
112
|
-
|---|---|---|---|
|
|
113
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children` (`PageContent.Cell`), `className` and the other div attributes. |
|
|
114
|
-
|
|
115
|
-
### PageContent.Cell
|
|
116
|
-
`ref` → `HTMLDivElement`. One tile place in `PageContent.Grid`; its child (a Card, a ChartFrame) stretches to it, so the tiles of a row share one height.
|
|
117
|
-
|
|
118
|
-
| Prop | Type | Default | Description |
|
|
119
|
-
|---|---|---|---|
|
|
120
|
-
| `span` | `1 \| 2 \| … \| 12` | `12` | Columns of 12 on a wide grid (64rem+). Narrower grids round it: see Grid columns in COMPONENT.md. |
|
|
121
|
-
| `rows` | `1 \| 2 \| 3 \| 4` | `1` | Rows the cell spans from 40rem: a chart beside two stacked tiles (`ChartFrame.Plot height="fill"` fills the height). |
|
|
122
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children` (one tile), `className` and the other div attributes. |
|
|
123
|
-
|
|
124
|
-
### PageContent.Split
|
|
125
|
-
`ref` → `HTMLDivElement`. List + detail (mail, a messenger, a ticket queue): side by side from 48rem of its own width, one pane at a time below it, focus following the pane that comes into view.
|
|
126
|
-
|
|
127
|
-
| Prop | Type | Default | Description |
|
|
128
|
-
|---|---|---|---|
|
|
129
|
-
| `open` | `boolean` | — | The detail is open (a record is chosen), controlled. On a narrow split it takes the place of the list; on a wide one both panes stay. |
|
|
130
|
-
| `defaultOpen` | `boolean` | `false` | Initial open state, uncontrolled. |
|
|
131
|
-
| `onOpenChange` | `(open: boolean) => void` | — | `PageContent.BackButton` closes the detail (`false`); clear the chosen record there. |
|
|
132
|
-
| `labels` | `Partial<PageContentLabels>` | — | Built-in strings, see Labels. |
|
|
133
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children` (two `PageContent.Panel`s: `list`, then `detail`), `className` and the other div attributes. |
|
|
134
|
-
|
|
135
|
-
### PageContent.Panel
|
|
136
|
-
`ref` → `HTMLDivElement`. A pane of the split: a column whose last child takes the free height (a Card with its own ScrollContainer). Focusable from code (`tabindex=-1`, no ring).
|
|
137
|
-
|
|
138
|
-
| Prop | Type | Default | Description |
|
|
139
|
-
|---|---|---|---|
|
|
140
|
-
| `kind` | `"list" \| "detail"` | — (required) | `list` — the 16–20rem column, or the whole split while closed; going back refocuses its last control. `detail` — the rest, or the whole split while open; focus lands here when it opens. |
|
|
141
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children`, `aria-label`, `className` and the other div attributes. |
|
|
142
|
-
|
|
143
|
-
### PageContent.BackButton
|
|
144
|
-
`ref` → `HTMLButtonElement`. Back from the detail to the list: a soft neutral icon Button (`nav.chevronLeft`) named by `labels.back`, shown only while the split shows one pane. Put it first in the detail's header; `event.preventDefault()` in `onClick` keeps the detail open.
|
|
145
|
-
|
|
146
|
-
| Prop | Type | Default | Description |
|
|
147
|
-
|---|---|---|---|
|
|
148
|
-
| `…rest` | `Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" \| "children">` | — | `onClick`, `aria-label` (replaces `labels.back`), `className` and the other button attributes. |
|
|
149
|
-
|
|
150
|
-
## Variants
|
|
151
|
-
|
|
152
|
-
### maxWidth (Root)
|
|
153
|
-
| Value | Looks like | Use when | Default |
|
|
154
|
-
|---|---|---|---|
|
|
155
|
-
| `full` | Column fills the main area | App pages, tables, dashboards in a padded main | yes |
|
|
156
|
-
| `readable` | Column capped at `--prime-layout-reading-max-width` (42rem), centred | Terms, articles, help pages | |
|
|
157
|
-
| `wide` | Column capped at `--prime-layout-content-max-width` (75rem), centred | Wide screens where content should not stretch edge to edge | |
|
|
158
|
-
|
|
159
|
-
### measure (Description)
|
|
160
|
-
| Value | Looks like | Use when | Default |
|
|
161
|
-
|---|---|---|---|
|
|
162
|
-
| `readable` | Intro line wraps at the reading width | Default, most pages | yes |
|
|
163
|
-
| `full` | Intro uses the full header width | The column is already narrow | |
|
|
164
|
-
|
|
165
|
-
One `PageContent.Title` (`<h1>`) per page; a topic inside Body is a `PageContent.Section` (its `h2`). One primary button in Actions, the rest `soft` / `ghost` neutral.
|
|
166
|
-
|
|
167
|
-
### Flags
|
|
168
|
-
| Flag | Looks like when on | Use when | Default |
|
|
169
|
-
|---|---|---|---|
|
|
170
|
-
| `fill` (Root) | the page is as high as main; the body takes what the header leaves; main keeps gutter-high air under it | a full-height table, board, chat or `PageContent.Split` in an `AppShell.Root fillViewport` | `false` |
|
|
171
|
-
|
|
172
|
-
### layout (Section)
|
|
173
|
-
| Value | Looks like | Use when | Default |
|
|
174
|
-
|---|---|---|---|
|
|
175
|
-
| `stack` | the heading row over the content, 16 apart | a topic of a dashboard, a list or a detail page | ✓ |
|
|
176
|
-
| `aside` | a ~16rem heading column beside the content, above it once the content would get < 30rem | a settings page: a heading column beside each panel | |
|
|
177
|
-
|
|
178
|
-
### Grid columns
|
|
179
|
-
| Grid width | Cell `span` 1–3 | `span` 4 | `span` 5–6 | `span` 7–12 | `rows` |
|
|
180
|
-
|---|---|---|---|---|---|
|
|
181
|
-
| < 30rem | the row | the row | the row | the row | — |
|
|
182
|
-
| 30–40rem | half | the row | the row | the row | — |
|
|
183
|
-
| 40–64rem | half | a third | half | the row | spans |
|
|
184
|
-
| ≥ 64rem | its span | its span | its span | its span | spans |
|
|
185
|
-
|
|
186
|
-
### Split layout
|
|
187
|
-
| Value | Looks like | Use when | Default |
|
|
188
|
-
|---|---|---|---|
|
|
189
|
-
| wide (from 48rem of the split's width) | list in a 16–20rem column, detail beside it, 24 apart; no back button | desktops, tablets in landscape | — |
|
|
190
|
-
| narrow (below 48rem) | one pane: the list, or the open detail with `PageContent.BackButton` | phones, a narrow panel next to an open Sidebar | — |
|
|
191
|
-
|
|
192
|
-
## States
|
|
193
|
-
| State | Driven by | DOM |
|
|
194
|
-
|---|---|---|
|
|
195
|
-
| capped column | `maxWidth` | `data-max-width="readable" \| "wide"` on Root (absent for `full`) |
|
|
196
|
-
| filling | `fill` | `data-fill="true"` on Root; `AppShell.Main` drops its long bottom air for it |
|
|
197
|
-
| full-width intro | `measure="full"` | `data-measure="full"` on Description |
|
|
198
|
-
| with actions | `PageContent.Actions` child | `data-has-actions="true"` on Header |
|
|
199
|
-
| section heading column | `layout="aside"` on Section | `data-layout="aside"` on Section (absent for `stack`) |
|
|
200
|
-
| section with actions | `PageContent.Actions` child of Section | `data-has-actions="true"` on the section heading row |
|
|
201
|
-
| tile span | `span` / `rows` on Cell | `data-span="1"…"12"` (always), `data-rows="2"…"4"` (absent for 1) |
|
|
202
|
-
| detail open | `open` / `defaultOpen` on Split | `data-open="true"` on Split; narrow: the list is `display: none`, else the detail is |
|
|
203
|
-
| pane swap | `open` changes on a narrow split | the pane that comes into view enters once (`enterMotion.enterBase`: base, opacity + a 4 px rise); focus moves into the detail, or back to the list control; a wide split moves nothing |
|
|
204
|
-
|
|
205
|
-
## Layout & spacing
|
|
206
|
-
- No outer padding: edge gutters come from `AppShell.Main`.
|
|
207
|
-
- Header → Body `--prime-space-6` (24); blocks inside Body `--prime-space-6` (24); a `PageContent.Section` 40 from its neighbours (the body's 24 + `--prime-space-4`); tile → tile in a Grid `--prime-space-4` (16) on both axes; section heading → content `--prime-space-4` (16), heading → description `--prime-space-1` (4); Title → Description `--prime-space-2` (8); buttons in Actions `--prime-space-2`; heading → Actions `--prime-space-6` (24) side by side, `--prime-space-4` (16) once they wrap below.
|
|
208
|
-
- Header is a wrapping row: actions stay to the right of the title while the heading keeps half a reading measure, otherwise they wrap below it — no breakpoint needed, works from 320px.
|
|
209
|
-
- Title and Description wrap long words (`overflow-wrap: anywhere`).
|
|
210
|
-
- Grid lays itself out from its own width (container `prime-grid`), never from the window, so a board beside an open Sidebar folds on its own. A Cell stretches its child: the tiles of a row share one height; a chart in a `rows={2}` cell fills it with `ChartFrame.Plot height="fill"`. `dense` flow lets a small tile fill a hole left by a wide one.
|
|
211
|
-
- `fill` needs a main with a height: `AppShell.Root fillViewport` (main scrolls inside the panel). The body passes its free height on to a filling child — DataTable `scrollHeight="fill"`, Crossfade `fill`, `PageContent.Split`.
|
|
212
|
-
- Split takes the free height of a filling page and lays itself out from its own width (container `prime-split`), never from the window: a split beside an open Sidebar may be narrow on a wide screen. Each pane is a column whose last child takes the free height — put a Card with its own `ScrollContainer` there, so the list and the thread scroll separately. The records of the list pane are a [List](../list/COMPONENT.md).
|
|
213
|
-
- The detail pane is on screen all the time on a wide split: while nothing is chosen it shows a short hint («Выберите обращение»), never an empty card. A newly chosen record cross-fades in (`Crossfade` keyed by its id).
|
|
214
|
-
|
|
215
|
-
## Accessibility
|
|
216
|
-
|
|
217
|
-
### Keyboard
|
|
218
|
-
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
219
|
-
|
|
220
|
-
| Key | Action |
|
|
221
|
-
|---|---|
|
|
222
|
-
| `Enter` · `Space` | On `PageContent.BackButton`: back from the detail to the list; focus returns to the list control that opened it. |
|
|
223
|
-
|
|
224
|
-
### ARIA
|
|
225
|
-
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
226
|
-
|
|
227
|
-
- `PageContent.Title` is an `<h1>`; use one per page.
|
|
228
|
-
- Give `PageContent.Root as="section"` an `aria-labelledby` that points at the Title `id` to name the region.
|
|
229
|
-
- `PageContent.Section` is a `<section>` named by its own `<h2>` (`label`) through `aria-labelledby`, so it is a region landmark with the heading's name; the heading levels go h1 (page) → h2 (section) → h3 (a card title inside it).
|
|
230
|
-
- Name both `PageContent.Panel`s with `aria-label`: a named pane is `role="region"`, a landmark. On a narrow split opening the detail moves focus into it and going back returns focus to the list control; the hidden pane is `display: none`, out of Tab and the accessibility tree. The panes take focus from code only (`tabindex="-1"`, no ring).
|
|
231
|
-
- `PageContent.BackButton` is named by `labels.back` and is shown only while the split shows one pane.
|
|
232
|
-
|
|
233
|
-
### Labels
|
|
234
|
-
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
235
|
-
|
|
236
|
-
| Key | Default | Used for |
|
|
237
|
-
|---|---|---|
|
|
238
|
-
| `back` | `"Назад к списку"` | Name of `PageContent.BackButton` (on `PageContent.Split`). |
|
|
239
|
-
|
|
240
|
-
## Examples
|
|
241
|
-
| Example | Shows |
|
|
242
|
-
|---|---|
|
|
243
|
-
| [overview.tsx](examples/overview.tsx) | A page in the main column: title, description and page actions, then the body blocks — `PageContent.Actions`. |
|
|
244
|
-
| [variants.tsx](examples/variants.tsx) | The same page column at three caps: the whole main, a wide dashboard column, a reading column — `maxWidth`. |
|
|
245
|
-
| [grid.tsx](examples/grid.tsx) | A dashboard board: four KPI tiles, a chart two rows high beside two panels, one gap on both axes — `PageContent.Grid`, `PageContent.Cell`, `span`, `rows`. |
|
|
246
|
-
| [sections.tsx](examples/sections.tsx) | A page with titled sections: tiles of one screen close together, a new topic set off by air, a link at the end of the heading, a heading column beside a panel — `PageContent.Section`, `label`, `description`, `PageContent.Actions`, `layout`. |
|
|
247
|
-
| [list-detail.tsx](examples/list-detail.tsx) | A ticket queue as list + detail on a full-height page: side by side on a wide panel, one pane at a time with a back button on a narrow one; the chosen ticket cross-fades in — `PageContent.Split`, `PageContent.Panel`, `PageContent.BackButton`, `fill`. |
|
|
248
|
-
| [narrow.tsx](examples/narrow.tsx) | In a phone-width column the page actions wrap under the heading instead of squeezing it — `PageContent.Actions`. |
|
|
249
|
-
| [screen.tsx](examples/screen.tsx) | A settings page: sections with a heading column and a panel, a form saved by its own button, switches that apply at once and a danger zone with a confirm — `layout`, `maxWidth`. |
|
|
250
|
-
|
|
251
|
-
## Mistakes
|
|
252
|
-
- Padding on `PageContent.Root` to imitate gutters → gutters come from `AppShell.Main`.
|
|
253
|
-
- Actions placed outside Header → put `PageContent.Actions` inside `PageContent.Header` so it aligns with the title and wraps.
|
|
254
|
-
- Several `PageContent.Title` on one page → one `<h1>`; a topic of the page is a `PageContent.Section` with its `<h2>`.
|
|
255
|
-
- A hand-made `<section>` + `Typography as="h2"` + own gap CSS → `PageContent.Section label`.
|
|
256
|
-
- Each row of cards in its own grid → the rows stand 24 apart instead of 16; put every tile of the screen in one `PageContent.Grid`.
|
|
257
|
-
- Margins between blocks in Body → Body already sets the 24 gap and the 40 around a Section.
|
|
258
|
-
- Computing a height from `100vh` minus the header for a full-height table or chat → `PageContent.Root fill` and a filling child.
|
|
259
|
-
- A list + detail built with window media queries → `PageContent.Split` follows its own width.
|
|
260
|
-
- Unmounting the detail content the moment the narrow split goes back → keep the last record until another is chosen (the pane leaves with it on screen).
|
|
261
|
-
|
|
262
|
-
## Related
|
|
263
|
-
- **Built from:** [Button](../button/COMPONENT.md) (`PageContent.BackButton`), Icon (`nav.chevronLeft`)
|
|
264
|
-
- **See also:** [AppShell](../../layout/app-shell/COMPONENT.md), [Sidebar](../../layout/sidebar/COMPONENT.md), [Card](../card/COMPONENT.md), [ChartFrame](../chart-frame/COMPONENT.md), [List](../list/COMPONENT.md), [EmptyPage](../empty-page/COMPONENT.md), [ScrollContainer](../scroll-container/COMPONENT.md), [Drawer](../drawer/COMPONENT.md)
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/* Layout of the PageContent scenarios: the frame stands for AppShell.Main (its gutter). */
|
|
2
|
-
|
|
3
|
-
.main {
|
|
4
|
-
box-sizing: border-box;
|
|
5
|
-
width: 100%;
|
|
6
|
-
padding: var(--prime-layout-gutter-m);
|
|
7
|
-
container-type: inline-size;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/* list-detail: main of a viewport-high shell — a column of a fixed height the page fills. */
|
|
11
|
-
.fillMain {
|
|
12
|
-
box-sizing: border-box;
|
|
13
|
-
display: flex;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
width: 100%;
|
|
16
|
-
height: calc(var(--prime-space-24) * 5);
|
|
17
|
-
padding: var(--prime-layout-gutter-m);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/* A pane's card: an optional header row, then the scrolling region takes the rest. */
|
|
21
|
-
.paneCard {
|
|
22
|
-
display: flex;
|
|
23
|
-
flex-direction: column;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.threadHeader {
|
|
27
|
-
display: flex;
|
|
28
|
-
align-items: center;
|
|
29
|
-
gap: var(--prime-space-2);
|
|
30
|
-
padding: var(--prime-space-3) var(--prime-space-4);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.pane {
|
|
34
|
-
flex: 1 1 auto;
|
|
35
|
-
min-height: 0;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.tickets {
|
|
39
|
-
padding: var(--prime-space-2);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.notes {
|
|
43
|
-
display: flex;
|
|
44
|
-
flex-direction: column;
|
|
45
|
-
gap: var(--prime-space-3);
|
|
46
|
-
padding: var(--prime-space-2) var(--prime-space-4) var(--prime-space-4);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.hint {
|
|
50
|
-
padding: var(--prime-space-2) var(--prime-space-4);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/* A phone-width main column (360px). */
|
|
54
|
-
.narrow {
|
|
55
|
-
width: min(100%, calc(var(--prime-space-24) * 3.75));
|
|
56
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/** In a phone-width column the page actions wrap under the heading instead of squeezing it — `PageContent.Actions`. */
|
|
2
|
-
import { Button, PageContent } from "prime-ui-kit";
|
|
3
|
-
|
|
4
|
-
import styles from "./examples.module.css";
|
|
5
|
-
|
|
6
|
-
export default function PageContentNarrowExample() {
|
|
7
|
-
return (
|
|
8
|
-
<div className={styles.narrow}>
|
|
9
|
-
<div className={styles.main}>
|
|
10
|
-
<PageContent.Root>
|
|
11
|
-
<PageContent.Header>
|
|
12
|
-
<PageContent.Title>Счета</PageContent.Title>
|
|
13
|
-
<PageContent.Description>Выставленные и оплаченные за квартал.</PageContent.Description>
|
|
14
|
-
<PageContent.Actions>
|
|
15
|
-
<Button.Root variant="soft" tone="neutral">
|
|
16
|
-
Экспорт
|
|
17
|
-
</Button.Root>
|
|
18
|
-
<Button.Root>Новый счёт</Button.Root>
|
|
19
|
-
</PageContent.Actions>
|
|
20
|
-
</PageContent.Header>
|
|
21
|
-
</PageContent.Root>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/** A page in the main column: title, description and page actions, then the body blocks — `PageContent.Actions`. */
|
|
2
|
-
import { Button, Card, PageContent, Typography } from "prime-ui-kit";
|
|
3
|
-
|
|
4
|
-
import styles from "./examples.module.css";
|
|
5
|
-
|
|
6
|
-
export default function PageContentOverviewExample() {
|
|
7
|
-
return (
|
|
8
|
-
<div className={styles.main}>
|
|
9
|
-
<PageContent.Root as="section" aria-labelledby="settings-heading">
|
|
10
|
-
<PageContent.Header>
|
|
11
|
-
<PageContent.Title id="settings-heading">Настройки</PageContent.Title>
|
|
12
|
-
<PageContent.Description>
|
|
13
|
-
Профиль рабочего пространства и уведомления.
|
|
14
|
-
</PageContent.Description>
|
|
15
|
-
<PageContent.Actions>
|
|
16
|
-
<Button.Root variant="soft" tone="neutral">
|
|
17
|
-
Экспорт
|
|
18
|
-
</Button.Root>
|
|
19
|
-
<Button.Root>Сохранить</Button.Root>
|
|
20
|
-
</PageContent.Actions>
|
|
21
|
-
</PageContent.Header>
|
|
22
|
-
<PageContent.Body>
|
|
23
|
-
<Card.Root variant="panel">
|
|
24
|
-
<Card.Body>
|
|
25
|
-
<Typography variant="body-m" tone="secondary">
|
|
26
|
-
Компания «Прайм Софт», часовой пояс Москва (UTC+3), валюта — рубль.
|
|
27
|
-
</Typography>
|
|
28
|
-
</Card.Body>
|
|
29
|
-
</Card.Root>
|
|
30
|
-
<Card.Root variant="panel">
|
|
31
|
-
<Card.Body>
|
|
32
|
-
<Typography variant="body-m" tone="secondary">
|
|
33
|
-
Письма о новых заказах и сводка по понедельникам включены.
|
|
34
|
-
</Typography>
|
|
35
|
-
</Card.Body>
|
|
36
|
-
</Card.Root>
|
|
37
|
-
</PageContent.Body>
|
|
38
|
-
</PageContent.Root>
|
|
39
|
-
</div>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
# PageToolbar
|
|
2
|
-
|
|
3
|
-
**Category:** page
|
|
4
|
-
**Kind:** layout
|
|
5
|
-
|
|
6
|
-
> The panel at the top of a page — sections, filter and search, view options and the primary action — laid out from its own width: one row when wide, stacked rows when narrow, search and filter always first with the active filters under the top row.
|
|
7
|
-
|
|
8
|
-
## When to use
|
|
9
|
-
- A list, registry or dashboard page whose top holds several of: sections with counts, a filter and search, a period or view switch, the primary action.
|
|
10
|
-
- A settings page with sections and a «Сохранить N изменений» action that must stay reachable on a phone.
|
|
11
|
-
- Any page that has to work on the narrowest supported screen (a 320 px phone) with the same controls as on desktop — nothing is hidden, the slots only move.
|
|
12
|
-
|
|
13
|
-
## When not to use
|
|
14
|
-
- One or two buttons of the page and nothing else → `AppHeader.Actions` in the [AppHeader](../../layout/app-header/COMPONENT.md) title row.
|
|
15
|
-
- Tools that belong to one table → the DataTable `toolbar` slot.
|
|
16
|
-
- Switching panels inside a card or a section → [Tabs](../tabs/COMPONENT.md).
|
|
17
|
-
- App-level navigation → [Sidebar](../../layout/sidebar/COMPONENT.md).
|
|
18
|
-
|
|
19
|
-
## Import
|
|
20
|
-
```tsx
|
|
21
|
-
import { PageToolbar } from "prime-ui-kit";
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Anatomy
|
|
25
|
-
```
|
|
26
|
-
PageToolbar.Root container: its own width picks the layout
|
|
27
|
-
├─ PageToolbar.Tools search + filter button: SmartFilter.Toolbar — always first
|
|
28
|
-
├─ PageToolbar.Sections sections of the page: a fullWidth SegmentedControl with counts
|
|
29
|
-
├─ PageToolbar.View period, table / cards, columns
|
|
30
|
-
├─ PageToolbar.Actions the primary action (and its secondary twin, e.g. «Отменить»)
|
|
31
|
-
└─ PageToolbar.Chips active filters: SmartFilter.Chips, a row under the top row
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## API
|
|
35
|
-
|
|
36
|
-
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
37
|
-
|
|
38
|
-
### PageToolbar.Root
|
|
39
|
-
`ref` → `HTMLDivElement`. The page panel: one row from 56rem of its own width, stacked rows below. Any slot may be left out; whatever the JSX order, the DOM and Tab order is Tools, Sections, View, Actions, Chips. Named (`aria-label`), it is a `group`.
|
|
40
|
-
|
|
41
|
-
| Prop | Type | Default | Description |
|
|
42
|
-
|---|---|---|---|
|
|
43
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children`, `className` and the other div attributes. |
|
|
44
|
-
|
|
45
|
-
### PageToolbar.Sections
|
|
46
|
-
`ref` → `HTMLDivElement`. Sections of the page — a `fullWidth` SegmentedControl with counts; scrolls inside when it does not fit.
|
|
47
|
-
|
|
48
|
-
| Prop | Type | Default | Description |
|
|
49
|
-
|---|---|---|---|
|
|
50
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children`, `className` and the other div attributes. |
|
|
51
|
-
|
|
52
|
-
### PageToolbar.Tools
|
|
53
|
-
`ref` → `HTMLDivElement`. Search and filter button (`SmartFilter.Toolbar`): always the first slot and the stretchy one; it gives way first when the row runs short.
|
|
54
|
-
|
|
55
|
-
| Prop | Type | Default | Description |
|
|
56
|
-
|---|---|---|---|
|
|
57
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children`, `className` and the other div attributes. |
|
|
58
|
-
|
|
59
|
-
### PageToolbar.View
|
|
60
|
-
`ref` → `HTMLDivElement`. How the data is shown: period, table / cards, columns. Sized by content when wide; its own full row when narrow, its controls sharing it equally.
|
|
61
|
-
|
|
62
|
-
| Prop | Type | Default | Description |
|
|
63
|
-
|---|---|---|---|
|
|
64
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children`, `className` and the other div attributes. |
|
|
65
|
-
|
|
66
|
-
### PageToolbar.Actions
|
|
67
|
-
`ref` → `HTMLDivElement`. The primary action of the page: at the end of the top row; on a phone, when the search would get less than 18rem beside it, its own full row right under the search.
|
|
68
|
-
|
|
69
|
-
| Prop | Type | Default | Description |
|
|
70
|
-
|---|---|---|---|
|
|
71
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children`, `className` and the other div attributes. |
|
|
72
|
-
|
|
73
|
-
### PageToolbar.Chips
|
|
74
|
-
`ref` → `HTMLDivElement`. Active filters (`SmartFilter.Chips`) in their own row under the top row; the row takes no space while it is empty.
|
|
75
|
-
|
|
76
|
-
| Prop | Type | Default | Description |
|
|
77
|
-
|---|---|---|---|
|
|
78
|
-
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children`, `className` and the other div attributes. |
|
|
79
|
-
|
|
80
|
-
## Variants
|
|
81
|
-
PageToolbar has no variants: the layout follows the toolbar's width.
|
|
82
|
-
|
|
83
|
-
### Layout by width
|
|
84
|
-
| Toolbar width | Looks like | Default |
|
|
85
|
-
|---|---|---|
|
|
86
|
-
| `≥ 56rem` | one row that never wraps: Tools (stretch) · Sections (content width) · View (content width) · Actions; Chips under it; short of room the Tools give way first, down to 12rem, so the Sections keep their items and counts whole; only then the Sections shrink and scroll inside | |
|
|
87
|
-
| `< 56rem` | rows: Tools (stretch) + Actions; Chips; Sections (full row); View (full row) | yes (mobile first) |
|
|
88
|
-
| phone (Tools would get < 18rem beside the Actions) | rows: Tools (full row); Actions (full row, its buttons share it); Chips; Sections; View — the search is never squeezed; an icon-only action still fits beside the Tools | |
|
|
89
|
-
| any | Chips under the top row, only while there are chips | |
|
|
90
|
-
|
|
91
|
-
## States
|
|
92
|
-
| State | Driven by | DOM |
|
|
93
|
-
|---|---|---|
|
|
94
|
-
| wide | container ≥ 56rem | one flex row, no wrapping; Chips rendered under the bar |
|
|
95
|
-
| narrow | container < 56rem | one wrapping flex line of real rows only (`order` + full-row slots): a missing slot makes no row, every row is 12 from the next |
|
|
96
|
-
| action on its own row | narrow, and the Tools (or the Sections in their place) would get less than 18rem beside the Actions | the Actions wrap under them and stretch across the row; an Actions slot alone in the toolbar keeps its buttons at the end |
|
|
97
|
-
| no Tools | Sections without Tools; View without Tools and Sections | that slot takes the Tools' place: first and stretchy, beside the action, so the action stays at the top row's end |
|
|
98
|
-
| alone in a row | Tools or Sections without Actions; View when narrow | that slot stretches to the full row; the View's controls share it equally and may shrink below their content (`min-width: 0`), so the row fits a phone |
|
|
99
|
-
| no chips | `PageToolbar.Chips` empty (`SmartFilter.Chips` renders nothing) | the chips row takes no space |
|
|
100
|
-
|
|
101
|
-
## Layout & spacing
|
|
102
|
-
- 8 inside a slot. No padding or fill of its own: on an app page it is the page's tools row in `AppHeader.Tools`, under the page title; tools of one table go into that table's `toolbar`.
|
|
103
|
-
- The order is fixed: search and filter first, then the sections, the view and the primary action; the active filters sit under the top row, never under the sections. The primary action is at the end of the top row; on a phone, where the search would get less than 18rem beside it, it takes its own row right under the search — still above the sections and the view.
|
|
104
|
-
- Every gap is one step: 12 between slots and between every pair of rows, at any width — no row is ever further from the next.
|
|
105
|
-
- Sections take a `fullWidth` SegmentedControl: the toolbar decides when it stretches (content width when wide, the full row when narrow), its items tend to equal width and it scrolls inside itself when they do not fit.
|
|
106
|
-
- All controls share one tier, so they share one height and wrapped rows stay level: leave `size` off the controls (default `m`); for a denser page wrap the toolbar in `<ControlSizeProvider value="s">`.
|
|
107
|
-
- On a phone the primary action takes its own row by itself; an icon-only action with `aria-label` stays beside the search instead. Never remove it.
|
|
108
|
-
- The toolbar breaks by its own width, so it behaves the same with the sidebar open or closed.
|
|
109
|
-
|
|
110
|
-
## Accessibility
|
|
111
|
-
|
|
112
|
-
### Keyboard
|
|
113
|
-
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
114
|
-
|
|
115
|
-
No keyboard interaction.
|
|
116
|
-
|
|
117
|
-
### ARIA
|
|
118
|
-
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
119
|
-
|
|
120
|
-
- With an `aria-label` the root is `role="group"` named by it: when a page has more than one panel, name each.
|
|
121
|
-
- The root renders the slots in the wide layout's reading order — Tools, Sections, View, Actions, Chips — whatever the JSX order; the narrow layout moves them only visually (`order`).
|
|
122
|
-
- An icon-only primary action carries `aria-label`.
|
|
123
|
-
|
|
124
|
-
### Labels
|
|
125
|
-
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
126
|
-
|
|
127
|
-
No `labels`.
|
|
128
|
-
|
|
129
|
-
## Examples
|
|
130
|
-
| Example | Shows |
|
|
131
|
-
|---|---|
|
|
132
|
-
| [overview.tsx](examples/overview.tsx) | The panel of an orders page: search and filter, sections with counts, the period and the primary action in one row; active filters under the top row — `PageToolbar.Tools`, `PageToolbar.Sections`, `PageToolbar.View`, `PageToolbar.Actions`, `PageToolbar.Chips`. |
|
|
133
|
-
| [without-search.tsx](examples/without-search.tsx) | A dashboard panel without search on a tablet-width column: the sections fill the top row, the period selector alone in the bottom row stretches to the full width — `PageToolbar.Sections`, `PageToolbar.View`. |
|
|
134
|
-
| [save-changes.tsx](examples/save-changes.tsx) | A settings page: sections of the form on the left, the save action with the number of changes at the end of the top row — never a sticky bar at the bottom of a phone screen — `PageToolbar.Actions`. |
|
|
135
|
-
| [narrow.tsx](examples/narrow.tsx) | A phone-width column: search and filter on top, the primary action on its own row under them, then the active filters, the sections and the period, every row 12 apart — `PageToolbar.Root`. |
|
|
136
|
-
|
|
137
|
-
## Mistakes
|
|
138
|
-
- A hand-built flex row of tabs, search and buttons with `flex-wrap` → rows wrap «as they come», the action drifts down; use `PageToolbar`.
|
|
139
|
-
- `size="s"` on one control inside → a step in the row; one tier for all, through `ControlSizeProvider` around the toolbar.
|
|
140
|
-
- A SegmentedControl without `fullWidth` in Sections → it never stretches on narrow widths.
|
|
141
|
-
- Stat cards above a table for the section totals → counts inside the sections (`SegmentedControl.Count`).
|
|
142
|
-
- Hiding the search or the action on phones → they move, they never disappear.
|
|
143
|
-
- A sticky «Сохранить» bar at the bottom of a phone → the save action with its count in `PageToolbar.Actions`.
|
|
144
|
-
|
|
145
|
-
## Related
|
|
146
|
-
- **Built from:** —
|
|
147
|
-
- **See also:** [SegmentedControl](../segmented-control/COMPONENT.md), [SmartFilter](../smart-filter/COMPONENT.md), [PageContent](../page-content/COMPONENT.md), [DataTable](../data-table/COMPONENT.md), [Select](../select/COMPONENT.md)
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/* Layout of the PageToolbar scenarios: page columns of a capped width, so the toolbar shows its
|
|
2
|
-
two-row form. A cap (`max-width`), not a width: the column is as wide as the stage allows. */
|
|
3
|
-
|
|
4
|
-
/* A phone-width page column (360px). */
|
|
5
|
-
.phone {
|
|
6
|
-
width: 100%;
|
|
7
|
-
max-width: calc(var(--prime-space-24) * 3.75);
|
|
8
|
-
margin-inline: auto;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/* A tablet-width page column (600px). */
|
|
12
|
-
.tablet {
|
|
13
|
-
width: 100%;
|
|
14
|
-
max-width: calc(var(--prime-space-24) * 6.25);
|
|
15
|
-
margin-inline: auto;
|
|
16
|
-
}
|