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,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
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/** 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`. */
|
|
2
|
-
import {
|
|
3
|
-
Button,
|
|
4
|
-
Icon,
|
|
5
|
-
PageToolbar,
|
|
6
|
-
SegmentedControl,
|
|
7
|
-
Select,
|
|
8
|
-
SmartFilter,
|
|
9
|
-
type SmartFilterField,
|
|
10
|
-
type SmartFilterValue,
|
|
11
|
-
} from "prime-ui-kit";
|
|
12
|
-
import * as React from "react";
|
|
13
|
-
|
|
14
|
-
const SECTIONS = [
|
|
15
|
-
{ value: "all", label: "Все", count: 128 },
|
|
16
|
-
{ value: "active", label: "В работе", count: 12 },
|
|
17
|
-
{ value: "done", label: "Доставлены", count: 96 },
|
|
18
|
-
{ value: "cancelled", label: "Отменены", count: 20 },
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
const PERIODS = [
|
|
22
|
-
{ value: "7d", label: "7 дней" },
|
|
23
|
-
{ value: "30d", label: "30 дней" },
|
|
24
|
-
{ value: "quarter", label: "Квартал" },
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
const FIELDS: SmartFilterField[] = [
|
|
28
|
-
{
|
|
29
|
-
key: "city",
|
|
30
|
-
label: "Город",
|
|
31
|
-
options: [
|
|
32
|
-
{ value: "msk", label: "Москва" },
|
|
33
|
-
{ value: "spb", label: "Санкт-Петербург" },
|
|
34
|
-
{ value: "kzn", label: "Казань" },
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
key: "payment",
|
|
39
|
-
label: "Оплата",
|
|
40
|
-
options: [
|
|
41
|
-
{ value: "card", label: "Картой" },
|
|
42
|
-
{ value: "invoice", label: "По счёту" },
|
|
43
|
-
],
|
|
44
|
-
},
|
|
45
|
-
];
|
|
46
|
-
|
|
47
|
-
export default function PageToolbarOverviewExample() {
|
|
48
|
-
const [section, setSection] = React.useState("all");
|
|
49
|
-
const [period, setPeriod] = React.useState("30d");
|
|
50
|
-
const [filter, setFilter] = React.useState<SmartFilterValue>({
|
|
51
|
-
city: { include: ["msk"], exclude: [] },
|
|
52
|
-
});
|
|
53
|
-
const [search, setSearch] = React.useState("");
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<SmartFilter.Root
|
|
57
|
-
fields={FIELDS}
|
|
58
|
-
value={filter}
|
|
59
|
-
onValueChange={setFilter}
|
|
60
|
-
search={search}
|
|
61
|
-
onSearchChange={setSearch}
|
|
62
|
-
>
|
|
63
|
-
<PageToolbar.Root aria-label="Заказы">
|
|
64
|
-
<PageToolbar.Tools>
|
|
65
|
-
<SmartFilter.Toolbar />
|
|
66
|
-
</PageToolbar.Tools>
|
|
67
|
-
<PageToolbar.Sections>
|
|
68
|
-
<SegmentedControl.Root
|
|
69
|
-
fullWidth
|
|
70
|
-
value={section}
|
|
71
|
-
onValueChange={setSection}
|
|
72
|
-
aria-label="Раздел"
|
|
73
|
-
>
|
|
74
|
-
{SECTIONS.map((item) => (
|
|
75
|
-
<SegmentedControl.Item key={item.value} value={item.value}>
|
|
76
|
-
{item.label}
|
|
77
|
-
<SegmentedControl.Count>{item.count}</SegmentedControl.Count>
|
|
78
|
-
</SegmentedControl.Item>
|
|
79
|
-
))}
|
|
80
|
-
</SegmentedControl.Root>
|
|
81
|
-
</PageToolbar.Sections>
|
|
82
|
-
<PageToolbar.View>
|
|
83
|
-
<Select.Root value={period} onValueChange={setPeriod}>
|
|
84
|
-
<Select.Trigger aria-label="Период">
|
|
85
|
-
<Select.TriggerIcon>
|
|
86
|
-
<Icon name="field.calendar" />
|
|
87
|
-
</Select.TriggerIcon>
|
|
88
|
-
<Select.Value />
|
|
89
|
-
</Select.Trigger>
|
|
90
|
-
<Select.Content>
|
|
91
|
-
{PERIODS.map((item) => (
|
|
92
|
-
<Select.Item key={item.value} value={item.value}>
|
|
93
|
-
{item.label}
|
|
94
|
-
</Select.Item>
|
|
95
|
-
))}
|
|
96
|
-
</Select.Content>
|
|
97
|
-
</Select.Root>
|
|
98
|
-
</PageToolbar.View>
|
|
99
|
-
<PageToolbar.Actions>
|
|
100
|
-
<Button.Root>
|
|
101
|
-
<Button.Icon>
|
|
102
|
-
<Icon name="action.add" />
|
|
103
|
-
</Button.Icon>
|
|
104
|
-
Новый заказ
|
|
105
|
-
</Button.Root>
|
|
106
|
-
</PageToolbar.Actions>
|
|
107
|
-
<PageToolbar.Chips>
|
|
108
|
-
<SmartFilter.Chips />
|
|
109
|
-
</PageToolbar.Chips>
|
|
110
|
-
</PageToolbar.Root>
|
|
111
|
-
</SmartFilter.Root>
|
|
112
|
-
);
|
|
113
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/** 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`. */
|
|
2
|
-
import { Button, PageToolbar, SegmentedControl } from "prime-ui-kit";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
const SECTIONS = [
|
|
6
|
-
{ value: "profile", label: "Профиль" },
|
|
7
|
-
{ value: "billing", label: "Оплата" },
|
|
8
|
-
{ value: "team", label: "Команда" },
|
|
9
|
-
];
|
|
10
|
-
|
|
11
|
-
const CHANGES = 3;
|
|
12
|
-
|
|
13
|
-
export default function PageToolbarSaveChangesExample() {
|
|
14
|
-
const [section, setSection] = React.useState("profile");
|
|
15
|
-
|
|
16
|
-
// The toolbar heads the settings form: its save action submits the page's form.
|
|
17
|
-
return (
|
|
18
|
-
<form onSubmit={(event) => event.preventDefault()}>
|
|
19
|
-
<PageToolbar.Root aria-label="Настройки">
|
|
20
|
-
<PageToolbar.Sections>
|
|
21
|
-
<SegmentedControl.Root
|
|
22
|
-
fullWidth
|
|
23
|
-
value={section}
|
|
24
|
-
onValueChange={setSection}
|
|
25
|
-
aria-label="Раздел настроек"
|
|
26
|
-
>
|
|
27
|
-
{SECTIONS.map((item) => (
|
|
28
|
-
<SegmentedControl.Item key={item.value} value={item.value}>
|
|
29
|
-
{item.label}
|
|
30
|
-
</SegmentedControl.Item>
|
|
31
|
-
))}
|
|
32
|
-
</SegmentedControl.Root>
|
|
33
|
-
</PageToolbar.Sections>
|
|
34
|
-
<PageToolbar.Actions>
|
|
35
|
-
<Button.Root variant="ghost" tone="neutral">
|
|
36
|
-
Отменить
|
|
37
|
-
</Button.Root>
|
|
38
|
-
<Button.Root type="submit">Сохранить {CHANGES} изменения</Button.Root>
|
|
39
|
-
</PageToolbar.Actions>
|
|
40
|
-
</PageToolbar.Root>
|
|
41
|
-
</form>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/** 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`. */
|
|
2
|
-
import { Icon, PageToolbar, SegmentedControl, Select } from "prime-ui-kit";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import styles from "./examples.module.css";
|
|
6
|
-
|
|
7
|
-
const SECTIONS = [
|
|
8
|
-
{ value: "overview", label: "Обзор" },
|
|
9
|
-
{ value: "activity", label: "Активность" },
|
|
10
|
-
{ value: "resources", label: "Ресурсы" },
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
const PERIODS = [
|
|
14
|
-
{ value: "1h", label: "1 час" },
|
|
15
|
-
{ value: "24h", label: "24 часа" },
|
|
16
|
-
{ value: "7d", label: "7 дней" },
|
|
17
|
-
];
|
|
18
|
-
|
|
19
|
-
export default function PageToolbarWithoutSearchExample() {
|
|
20
|
-
const [section, setSection] = React.useState("overview");
|
|
21
|
-
const [period, setPeriod] = React.useState("24h");
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<div className={styles.tablet}>
|
|
25
|
-
<PageToolbar.Root aria-label="Панель мониторинга">
|
|
26
|
-
<PageToolbar.Sections>
|
|
27
|
-
<SegmentedControl.Root
|
|
28
|
-
fullWidth
|
|
29
|
-
value={section}
|
|
30
|
-
onValueChange={setSection}
|
|
31
|
-
aria-label="Раздел"
|
|
32
|
-
>
|
|
33
|
-
{SECTIONS.map((item) => (
|
|
34
|
-
<SegmentedControl.Item key={item.value} value={item.value}>
|
|
35
|
-
{item.label}
|
|
36
|
-
</SegmentedControl.Item>
|
|
37
|
-
))}
|
|
38
|
-
</SegmentedControl.Root>
|
|
39
|
-
</PageToolbar.Sections>
|
|
40
|
-
<PageToolbar.View>
|
|
41
|
-
<Select.Root value={period} onValueChange={setPeriod}>
|
|
42
|
-
<Select.Trigger aria-label="Период">
|
|
43
|
-
<Select.TriggerIcon>
|
|
44
|
-
<Icon name="field.calendar" />
|
|
45
|
-
</Select.TriggerIcon>
|
|
46
|
-
<Select.Value />
|
|
47
|
-
</Select.Trigger>
|
|
48
|
-
<Select.Content>
|
|
49
|
-
{PERIODS.map((item) => (
|
|
50
|
-
<Select.Item key={item.value} value={item.value}>
|
|
51
|
-
{item.label}
|
|
52
|
-
</Select.Item>
|
|
53
|
-
))}
|
|
54
|
-
</Select.Content>
|
|
55
|
-
</Select.Root>
|
|
56
|
-
</PageToolbar.View>
|
|
57
|
-
</PageToolbar.Root>
|
|
58
|
-
</div>
|
|
59
|
-
);
|
|
60
|
-
}
|