prime-ui-kit 0.14.0 → 0.15.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 +13 -14
- package/dist/chunks/{chunk-P6ZO37JM.js → chunk-2IKH55MI.js} +1 -1
- package/dist/chunks/{chunk-SYEX7OVT.js → chunk-THFZIHKU.js} +276 -263
- package/dist/chunks/{chunk-WXKRUVSE.js → chunk-XJAVS6FH.js} +49 -48
- package/dist/color-picker.js +2 -2
- package/dist/components/dnd/Dnd.d.ts +1 -1
- package/dist/components/login-form/LoginForm.d.ts +5 -1
- package/dist/index.css +1 -1
- package/dist/index.js +2 -2
- package/dist/internal/swatch.d.ts +6 -2
- package/dist/layout/app-header/AppHeader.d.ts +9 -28
- package/dist/layout/index.d.ts +1 -1
- package/dist/skill/SKILL.md +9 -7
- package/dist/skill/api-contract.md +2 -2
- package/dist/skill/cheatsheet.md +9 -2
- package/dist/skill/checklist.md +9 -5
- package/dist/skill/choosing.md +7 -9
- package/dist/skill/components.md +5 -12
- package/dist/skill/composition.md +281 -54
- package/dist/skill/foundations.md +1 -1
- package/dist/skill/layouts.md +70 -37
- package/dist/skill/reference/components/avatar/examples/states.tsx +4 -4
- package/dist/skill/reference/components/badge/examples/applied-filters.tsx +13 -19
- package/dist/skill/reference/components/badge/examples/examples.module.css +1 -8
- package/dist/skill/reference/components/badge/examples/server-tags.tsx +2 -6
- package/dist/skill/reference/components/banner/examples/examples.module.css +1 -5
- package/dist/skill/reference/components/banner/examples/page-strip.tsx +16 -22
- package/dist/skill/reference/components/breadcrumb/COMPONENT.md +4 -3
- package/dist/skill/reference/components/breadcrumb/examples/ellipsis.tsx +2 -2
- package/dist/skill/reference/components/button-group/COMPONENT.md +2 -2
- package/dist/skill/reference/components/button-group/examples/in-form.tsx +22 -2
- package/dist/skill/reference/components/button-group/examples/states.tsx +10 -1
- package/dist/skill/reference/components/card/COMPONENT.md +2 -1
- package/dist/skill/reference/components/card/examples/screen.tsx +362 -0
- package/dist/skill/reference/components/card/examples/variants.tsx +15 -1
- package/dist/skill/reference/components/chart-frame/COMPONENT.md +2 -1
- package/dist/skill/reference/components/chart-frame/examples/fill-height.tsx +119 -0
- package/dist/skill/reference/components/chart-frame/examples/states.tsx +3 -1
- package/dist/skill/reference/components/chat/COMPONENT.md +3 -1
- package/dist/skill/reference/components/chat/examples/group-chat.tsx +15 -2
- package/dist/skill/reference/components/chat/examples/reactions.tsx +121 -0
- package/dist/skill/reference/components/chat/examples/screen.module.css +9 -0
- package/dist/skill/{patterns/chat.tsx → reference/components/chat/examples/screen.tsx} +170 -351
- package/dist/skill/reference/components/chat-list/COMPONENT.md +1 -0
- package/dist/skill/reference/components/chat-list/examples/links.tsx +72 -0
- package/dist/skill/reference/components/checkbox/COMPONENT.md +1 -1
- package/dist/skill/reference/components/checkbox/examples/examples.module.css +5 -1
- package/dist/skill/reference/components/checkbox/examples/indicator.tsx +13 -7
- package/dist/skill/reference/components/checkbox/examples/states.tsx +6 -1
- package/dist/skill/reference/components/color-field/COMPONENT.md +1 -1
- package/dist/skill/reference/components/color-picker/COMPONENT.md +4 -3
- package/dist/skill/reference/components/color-picker/examples/controlled-open.tsx +37 -0
- package/dist/skill/reference/components/color-picker/examples/presets.tsx +2 -2
- package/dist/skill/reference/components/color-picker/examples/states.tsx +23 -14
- package/dist/skill/reference/components/composer/COMPONENT.md +2 -1
- package/dist/skill/reference/components/composer/examples/attach-menu.tsx +78 -0
- package/dist/skill/reference/components/composer/examples/attachments.tsx +2 -2
- package/dist/skill/reference/components/crossfade/COMPONENT.md +1 -0
- package/dist/skill/reference/components/crossfade/examples/screen.tsx +197 -0
- package/dist/skill/reference/components/data-table/COMPONENT.md +3 -2
- package/dist/skill/reference/components/data-table/examples/detail-panel.tsx +36 -37
- package/dist/skill/reference/components/data-table/examples/examples.module.css +0 -12
- package/dist/skill/reference/components/data-table/examples/numeric.tsx +36 -4
- package/dist/skill/reference/components/data-table/examples/overview.tsx +1 -0
- package/dist/skill/reference/components/data-table/examples/row-open.tsx +7 -36
- package/dist/skill/{patterns/list-page.module.css → reference/components/data-table/examples/screen.module.css} +1 -7
- package/dist/skill/{patterns/list-page.tsx → reference/components/data-table/examples/screen.tsx} +84 -64
- package/dist/skill/reference/components/datepicker/COMPONENT.md +5 -4
- package/dist/skill/reference/components/datepicker/examples/examples.module.css +2 -6
- package/dist/skill/reference/components/datepicker/examples/in-form.tsx +47 -55
- package/dist/skill/reference/components/datepicker/examples/locale.tsx +35 -0
- package/dist/skill/reference/components/datepicker/examples/range-presets.tsx +11 -2
- package/dist/skill/reference/components/datepicker/examples/states.tsx +9 -1
- package/dist/skill/reference/components/description-list/COMPONENT.md +1 -0
- package/dist/skill/{patterns/detail-page.module.css → reference/components/description-list/examples/screen.module.css} +2 -9
- package/dist/skill/reference/components/description-list/examples/screen.tsx +214 -0
- package/dist/skill/reference/components/description-list/examples/structure.tsx +1 -1
- package/dist/skill/reference/components/digit-input/COMPONENT.md +3 -1
- package/dist/skill/reference/components/digit-input/examples/states.tsx +3 -1
- package/dist/skill/reference/components/digit-input/examples/without-focus-ring.tsx +13 -0
- package/dist/skill/reference/components/divider/examples/with-icon.tsx +2 -2
- package/dist/skill/reference/components/dnd/COMPONENT.md +4 -2
- package/dist/skill/reference/components/dnd/examples/drop-zones.tsx +82 -49
- package/dist/skill/reference/components/dnd/examples/examples.module.css +50 -0
- package/dist/skill/reference/components/dnd/examples/states.tsx +54 -0
- package/dist/skill/reference/components/dnd/examples/table.tsx +113 -0
- package/dist/skill/reference/components/drawer/COMPONENT.md +1 -0
- package/dist/skill/reference/components/drawer/examples/dismiss.tsx +5 -3
- package/dist/skill/reference/components/drawer/examples/examples.module.css +0 -13
- package/dist/skill/reference/components/drawer/examples/header-actions.tsx +5 -9
- package/dist/skill/reference/components/drawer/examples/overview.tsx +6 -18
- package/dist/skill/reference/components/drawer/examples/screen.tsx +298 -0
- package/dist/skill/reference/components/dropdown/examples/examples.module.css +1 -5
- package/dist/skill/reference/components/empty-page/COMPONENT.md +1 -1
- package/dist/skill/reference/components/empty-page/examples/region-error.tsx +8 -2
- package/dist/skill/reference/components/example-frame/COMPONENT.md +3 -2
- package/dist/skill/reference/components/example-frame/examples/initial-view.tsx +44 -0
- package/dist/skill/reference/components/field-list/COMPONENT.md +2 -1
- package/dist/skill/reference/components/field-list/examples/errors.tsx +5 -2
- package/dist/skill/{patterns/record-editor.tsx → reference/components/field-list/examples/screen.tsx} +3 -43
- package/dist/skill/reference/components/file-upload/COMPONENT.md +7 -6
- package/dist/skill/reference/components/file-upload/examples/custom-body.tsx +2 -1
- package/dist/skill/reference/components/file-upload/examples/examples.module.css +1 -7
- package/dist/skill/reference/components/file-upload/examples/file-cards.tsx +10 -1
- package/dist/skill/reference/components/file-upload/examples/gallery.tsx +2 -2
- package/dist/skill/reference/components/file-upload/examples/in-form.tsx +4 -9
- package/dist/skill/reference/components/file-upload/examples/overview.tsx +5 -1
- package/dist/skill/reference/components/file-upload/examples/row-parts.tsx +24 -1
- package/dist/skill/{patterns/media-library.module.css → reference/components/file-upload/examples/screen.module.css} +2 -1
- package/dist/skill/reference/components/file-upload/examples/screen.tsx +646 -0
- package/dist/skill/reference/components/file-upload/examples/states.tsx +6 -2
- package/dist/skill/reference/components/file-upload/examples/validation.tsx +11 -2
- package/dist/skill/reference/components/file-upload/examples/variants.tsx +3 -20
- package/dist/skill/reference/components/gantt/COMPONENT.md +2 -1
- package/dist/skill/reference/components/gantt/examples/screen.module.css +14 -0
- package/dist/skill/{patterns/schedule.tsx → reference/components/gantt/examples/screen.tsx} +174 -170
- package/dist/skill/reference/components/gantt/examples/states.tsx +6 -2
- package/dist/skill/reference/components/input/COMPONENT.md +2 -2
- package/dist/skill/reference/components/input/examples/examples.module.css +0 -6
- package/dist/skill/reference/components/input/examples/in-form.tsx +1 -9
- package/dist/skill/reference/components/input/examples/password-strength.tsx +34 -8
- package/dist/skill/reference/components/input/examples/states.tsx +6 -1
- package/dist/skill/reference/components/kanban/COMPONENT.md +3 -2
- package/dist/skill/reference/components/kanban/examples/columns.tsx +8 -5
- package/dist/skill/reference/components/kanban/examples/screen.module.css +17 -0
- package/dist/skill/{patterns/kanban-board.tsx → reference/components/kanban/examples/screen.tsx} +130 -172
- package/dist/skill/reference/components/kanban/examples/states.tsx +17 -6
- package/dist/skill/reference/components/login-form/COMPONENT.md +6 -5
- package/dist/skill/reference/components/login-form/examples/examples.module.css +2 -21
- package/dist/skill/reference/components/login-form/examples/forgot-password.tsx +28 -32
- package/dist/skill/reference/components/login-form/examples/narrow.tsx +1 -1
- package/dist/skill/reference/components/login-form/examples/overview.tsx +45 -47
- package/dist/skill/reference/components/login-form/examples/register.tsx +64 -68
- package/dist/skill/reference/components/login-form/examples/reset-password.tsx +50 -47
- package/dist/skill/reference/components/login-form/examples/sizes.tsx +4 -6
- package/dist/skill/reference/components/login-form/examples/states.tsx +53 -57
- package/dist/skill/reference/components/login-form/examples/structure.tsx +18 -22
- package/dist/skill/reference/components/login-form/examples/verification-code.tsx +41 -45
- package/dist/skill/reference/components/media-viewer/COMPONENT.md +1 -1
- package/dist/skill/reference/components/media-viewer/examples/dismiss.tsx +5 -1
- package/dist/skill/reference/components/message/COMPONENT.md +4 -3
- package/dist/skill/reference/components/message/examples/file.tsx +5 -1
- package/dist/skill/reference/components/message/examples/media-open.tsx +48 -0
- package/dist/skill/reference/components/message/examples/status.tsx +21 -3
- package/dist/skill/reference/components/message/examples/text-formatting.tsx +7 -1
- package/dist/skill/reference/components/modal/COMPONENT.md +2 -1
- package/dist/skill/reference/components/modal/examples/custom-container.tsx +20 -20
- package/dist/skill/reference/components/modal/examples/dismiss.tsx +5 -3
- package/dist/skill/reference/components/modal/examples/enter-key.tsx +116 -0
- package/dist/skill/reference/components/modal/examples/examples.module.css +7 -13
- package/dist/skill/reference/components/modal/examples/structure.tsx +5 -2
- package/dist/skill/reference/components/native-select/COMPONENT.md +1 -1
- package/dist/skill/reference/components/native-select/examples/states.tsx +5 -1
- package/dist/skill/reference/components/notification/COMPONENT.md +1 -1
- package/dist/skill/reference/components/notification/examples/dismiss.tsx +2 -2
- package/dist/skill/reference/components/page-content/COMPONENT.md +1 -0
- package/dist/skill/reference/components/page-content/examples/list-detail.tsx +0 -3
- package/dist/skill/{patterns/settings-page.tsx → reference/components/page-content/examples/screen.tsx} +3 -3
- package/dist/skill/reference/components/page-content/examples/variants.tsx +4 -11
- package/dist/skill/reference/components/page-toolbar/COMPONENT.md +17 -15
- package/dist/skill/reference/components/page-toolbar/examples/narrow.tsx +6 -3
- package/dist/skill/reference/components/pagination/examples/controlled.tsx +29 -29
- package/dist/skill/reference/components/pagination/examples/examples.module.css +0 -2
- package/dist/skill/reference/components/progress-bar/COMPONENT.md +1 -1
- package/dist/skill/reference/components/progress-bar/examples/segments.tsx +2 -2
- package/dist/skill/reference/components/progress-circle/COMPONENT.md +1 -1
- package/dist/skill/reference/components/progress-circle/examples/segments.tsx +8 -3
- package/dist/skill/reference/components/radio/COMPONENT.md +1 -0
- package/dist/skill/reference/components/radio/examples/examples.module.css +14 -0
- package/dist/skill/reference/components/radio/examples/in-form.tsx +45 -0
- package/dist/skill/reference/components/scroll-container/COMPONENT.md +1 -0
- package/dist/skill/reference/components/scroll-container/examples/auto-scroll.tsx +3 -3
- package/dist/skill/reference/components/scroll-container/examples/chat.tsx +3 -3
- package/dist/skill/reference/components/scroll-container/examples/edges.tsx +6 -3
- package/dist/skill/reference/components/scroll-container/examples/examples.module.css +4 -17
- package/dist/skill/reference/components/scroll-container/examples/load-more.tsx +51 -0
- package/dist/skill/reference/components/scroll-container/examples/lock.tsx +3 -5
- package/dist/skill/reference/components/scroll-container/examples/overscroll.tsx +3 -3
- package/dist/skill/reference/components/scroll-container/examples/overview.tsx +3 -3
- package/dist/skill/reference/components/scroll-container/examples/scrollbar.tsx +13 -7
- package/dist/skill/reference/components/scroll-container/examples/variants.tsx +13 -7
- package/dist/skill/reference/components/segmented-control/COMPONENT.md +2 -2
- package/dist/skill/reference/components/segmented-control/examples/in-form.tsx +5 -1
- package/dist/skill/reference/components/segmented-control/examples/states.tsx +10 -1
- package/dist/skill/reference/components/select/COMPONENT.md +1 -1
- package/dist/skill/reference/components/select/examples/examples.module.css +2 -7
- package/dist/skill/reference/components/select/examples/states.tsx +13 -1
- package/dist/skill/reference/components/sheet/COMPONENT.md +2 -0
- package/dist/skill/reference/components/sheet/examples/guard.tsx +72 -0
- package/dist/skill/reference/components/sheet/examples/header-actions.tsx +56 -0
- package/dist/skill/reference/components/slider/COMPONENT.md +2 -1
- package/dist/skill/reference/components/slider/examples/examples.module.css +8 -0
- package/dist/skill/reference/components/slider/examples/in-form.tsx +47 -0
- package/dist/skill/reference/components/slider/examples/states.tsx +4 -1
- package/dist/skill/reference/components/smart-filter/COMPONENT.md +1 -1
- package/dist/skill/reference/components/smart-filter/examples/controlled.tsx +3 -3
- package/dist/skill/reference/components/smart-filter/examples/ranges.tsx +44 -10
- package/dist/skill/reference/components/sparkline/COMPONENT.md +1 -1
- package/dist/skill/reference/components/sparkline/examples/reference.tsx +2 -1
- package/dist/skill/reference/components/tabs/COMPONENT.md +1 -1
- package/dist/skill/reference/components/tabs/examples/sizes.tsx +1 -1
- package/dist/skill/reference/components/tag-select/COMPONENT.md +1 -1
- package/dist/skill/reference/components/tag-select/examples/states.tsx +8 -1
- package/dist/skill/reference/components/textarea/COMPONENT.md +1 -1
- package/dist/skill/reference/components/textarea/examples/examples.module.css +0 -6
- package/dist/skill/reference/components/textarea/examples/in-form.tsx +1 -9
- package/dist/skill/reference/components/textarea/examples/states.tsx +2 -1
- package/dist/skill/reference/components/thumbnail/COMPONENT.md +2 -1
- package/dist/skill/reference/components/thumbnail/examples/examples.module.css +1 -1
- package/dist/skill/reference/components/thumbnail/examples/fit.tsx +24 -0
- package/dist/skill/reference/components/thumbnail/examples/video.tsx +20 -1
- package/dist/skill/reference/components/timeline/COMPONENT.md +1 -1
- package/dist/skill/reference/components/timeline/examples/links.tsx +55 -14
- package/dist/skill/reference/components/tooltip/COMPONENT.md +1 -1
- package/dist/skill/reference/components/tooltip/examples/toolbar.tsx +2 -2
- package/dist/skill/reference/components/typography/examples/weights.tsx +3 -0
- package/dist/skill/reference/components/video-note/COMPONENT.md +2 -2
- package/dist/skill/reference/components/video-note/examples/controlled.tsx +19 -2
- package/dist/skill/reference/components/video-note/examples/in-message.tsx +5 -2
- package/dist/skill/reference/components/visually-hidden/COMPONENT.md +2 -1
- package/dist/skill/reference/components/visually-hidden/examples/assertive.tsx +39 -0
- package/dist/skill/reference/components/voice-player/COMPONENT.md +2 -2
- package/dist/skill/reference/components/voice-player/examples/call-recording.tsx +19 -9
- package/dist/skill/reference/components/voice-player/examples/controlled.tsx +20 -3
- package/dist/skill/reference/layout/app-header/COMPONENT.md +46 -63
- package/dist/skill/reference/layout/app-header/examples/breadcrumbs.tsx +10 -9
- package/dist/skill/reference/layout/app-header/examples/examples.module.css +1 -1
- package/dist/skill/reference/layout/app-header/examples/in-app-shell.tsx +0 -1
- package/dist/skill/reference/layout/app-header/examples/narrow.tsx +4 -5
- package/dist/skill/reference/layout/app-header/examples/overview.tsx +8 -10
- package/dist/skill/reference/layout/app-header/examples/page-title.tsx +3 -10
- package/dist/skill/reference/layout/app-shell/COMPONENT.md +4 -3
- package/dist/skill/reference/layout/app-shell/examples/overview.tsx +15 -30
- package/dist/skill/reference/layout/app-shell/examples/screen.tsx +262 -0
- package/dist/skill/reference/layout/app-shell/examples/template.tsx +29 -9
- package/dist/skill/reference/layout/sidebar/COMPONENT.md +7 -4
- package/dist/skill/reference/layout/sidebar/examples/account.tsx +2 -2
- package/dist/skill/reference/layout/sidebar/examples/collapsible-groups.tsx +12 -4
- package/dist/skill/reference/layout/sidebar/examples/custom-part.tsx +53 -0
- package/dist/skill/reference/layout/sidebar/examples/examples.module.css +5 -0
- package/dist/skill/reference/layout/sidebar/examples/narrow.tsx +53 -0
- package/dist/skill/reference/layout/sidebar/examples/persist.tsx +57 -0
- package/dist/skill/reference/layout/sidebar/examples/router.tsx +14 -2
- package/dist/skill/reference/layout/sidebar/examples/structure.tsx +7 -2
- package/dist/skill/responsive.md +2 -2
- package/package.json +1 -1
- package/src/components/avatar/examples/states.tsx +4 -4
- package/src/components/badge/examples/applied-filters.tsx +13 -19
- package/src/components/badge/examples/examples.module.css +1 -8
- package/src/components/badge/examples/server-tags.tsx +2 -6
- package/src/components/banner/examples/examples.module.css +1 -5
- package/src/components/banner/examples/page-strip.tsx +16 -22
- package/src/components/breadcrumb/COMPONENT.md +4 -3
- package/src/components/breadcrumb/examples/ellipsis.tsx +2 -2
- package/src/components/button-group/COMPONENT.md +2 -2
- package/src/components/button-group/examples/in-form.tsx +22 -2
- package/src/components/button-group/examples/states.tsx +10 -1
- package/src/components/card/COMPONENT.md +2 -1
- package/src/components/card/examples/screen.module.css +14 -0
- package/src/components/card/examples/screen.tsx +362 -0
- package/src/components/card/examples/variants.tsx +15 -1
- package/src/components/chart-frame/COMPONENT.md +2 -1
- package/src/components/chart-frame/examples/fill-height.tsx +119 -0
- package/src/components/chart-frame/examples/states.tsx +3 -1
- package/src/components/chat/COMPONENT.md +3 -1
- package/src/components/chat/examples/group-chat.tsx +15 -2
- package/src/components/chat/examples/reactions.tsx +121 -0
- package/src/components/chat/examples/screen.module.css +9 -0
- package/src/components/chat/examples/screen.tsx +718 -0
- package/src/components/chat-list/COMPONENT.md +1 -0
- package/src/components/chat-list/examples/links.tsx +72 -0
- package/src/components/checkbox/COMPONENT.md +1 -1
- package/src/components/checkbox/examples/examples.module.css +5 -1
- package/src/components/checkbox/examples/indicator.tsx +13 -7
- package/src/components/checkbox/examples/states.tsx +6 -1
- package/src/components/color-field/COMPONENT.md +1 -1
- package/src/components/color-picker/COMPONENT.md +4 -3
- package/src/components/color-picker/examples/controlled-open.tsx +37 -0
- package/src/components/color-picker/examples/presets.tsx +2 -2
- package/src/components/color-picker/examples/states.tsx +23 -14
- package/src/components/composer/COMPONENT.md +2 -1
- package/src/components/composer/examples/attach-menu.tsx +78 -0
- package/src/components/composer/examples/attachments.tsx +2 -2
- package/src/components/crossfade/COMPONENT.md +1 -0
- package/src/components/crossfade/examples/screen.module.css +40 -0
- package/src/components/crossfade/examples/screen.tsx +197 -0
- package/src/components/data-table/COMPONENT.md +3 -2
- package/src/components/data-table/examples/detail-panel.tsx +36 -37
- package/src/components/data-table/examples/examples.module.css +0 -12
- package/src/components/data-table/examples/numeric.tsx +36 -4
- package/src/components/data-table/examples/overview.tsx +1 -0
- package/src/components/data-table/examples/row-open.tsx +7 -36
- package/src/components/data-table/examples/screen.module.css +13 -0
- package/src/components/data-table/examples/screen.tsx +354 -0
- package/src/components/datepicker/COMPONENT.md +5 -4
- package/src/components/datepicker/examples/examples.module.css +2 -6
- package/src/components/datepicker/examples/in-form.tsx +47 -55
- package/src/components/datepicker/examples/locale.tsx +35 -0
- package/src/components/datepicker/examples/range-presets.tsx +11 -2
- package/src/components/datepicker/examples/states.tsx +9 -1
- package/src/components/description-list/COMPONENT.md +1 -0
- package/src/components/description-list/examples/screen.module.css +64 -0
- package/src/components/description-list/examples/screen.tsx +214 -0
- package/src/components/description-list/examples/structure.tsx +1 -1
- package/src/components/digit-input/COMPONENT.md +3 -1
- package/src/components/digit-input/examples/states.tsx +3 -1
- package/src/components/digit-input/examples/without-focus-ring.tsx +13 -0
- package/src/components/divider/examples/with-icon.tsx +2 -2
- package/src/components/dnd/COMPONENT.md +4 -2
- package/src/components/dnd/examples/drop-zones.tsx +82 -49
- package/src/components/dnd/examples/examples.module.css +50 -0
- package/src/components/dnd/examples/states.tsx +54 -0
- package/src/components/dnd/examples/table.tsx +113 -0
- package/src/components/drawer/COMPONENT.md +1 -0
- package/src/components/drawer/examples/dismiss.tsx +5 -3
- package/src/components/drawer/examples/examples.module.css +0 -13
- package/src/components/drawer/examples/header-actions.tsx +5 -9
- package/src/components/drawer/examples/overview.tsx +6 -18
- package/src/components/drawer/examples/screen.module.css +14 -0
- package/src/components/drawer/examples/screen.tsx +298 -0
- package/src/components/dropdown/examples/examples.module.css +1 -5
- package/src/components/empty-page/COMPONENT.md +1 -1
- package/src/components/empty-page/examples/region-error.tsx +8 -2
- package/src/components/example-frame/COMPONENT.md +3 -2
- package/src/components/example-frame/examples/initial-view.tsx +44 -0
- package/src/components/field-list/COMPONENT.md +2 -1
- package/src/components/field-list/examples/errors.tsx +5 -2
- package/src/components/field-list/examples/screen.module.css +18 -0
- package/src/components/field-list/examples/screen.tsx +316 -0
- package/src/components/file-upload/COMPONENT.md +7 -6
- package/src/components/file-upload/examples/custom-body.tsx +2 -1
- package/src/components/file-upload/examples/examples.module.css +1 -7
- package/src/components/file-upload/examples/file-cards.tsx +10 -1
- package/src/components/file-upload/examples/gallery.tsx +2 -2
- package/src/components/file-upload/examples/in-form.tsx +4 -9
- package/src/components/file-upload/examples/overview.tsx +5 -1
- package/src/components/file-upload/examples/row-parts.tsx +24 -1
- package/src/components/file-upload/examples/screen.module.css +45 -0
- package/src/components/file-upload/examples/screen.tsx +646 -0
- package/src/components/file-upload/examples/states.tsx +6 -2
- package/src/components/file-upload/examples/validation.tsx +11 -2
- package/src/components/file-upload/examples/variants.tsx +3 -20
- package/src/components/gantt/COMPONENT.md +2 -1
- package/src/components/gantt/examples/screen.module.css +14 -0
- package/src/components/gantt/examples/screen.tsx +726 -0
- package/src/components/gantt/examples/states.tsx +6 -2
- package/src/components/input/COMPONENT.md +2 -2
- package/src/components/input/examples/examples.module.css +0 -6
- package/src/components/input/examples/in-form.tsx +1 -9
- package/src/components/input/examples/password-strength.tsx +34 -8
- package/src/components/input/examples/states.tsx +6 -1
- package/src/components/kanban/COMPONENT.md +3 -2
- package/src/components/kanban/examples/columns.tsx +8 -5
- package/src/components/kanban/examples/screen.module.css +17 -0
- package/src/components/kanban/examples/screen.tsx +572 -0
- package/src/components/kanban/examples/states.tsx +17 -6
- package/src/components/login-form/COMPONENT.md +6 -5
- package/src/components/login-form/examples/examples.module.css +2 -21
- package/src/components/login-form/examples/forgot-password.tsx +28 -32
- package/src/components/login-form/examples/narrow.tsx +1 -1
- package/src/components/login-form/examples/overview.tsx +45 -47
- package/src/components/login-form/examples/register.tsx +64 -68
- package/src/components/login-form/examples/reset-password.tsx +50 -47
- package/src/components/login-form/examples/sizes.tsx +4 -6
- package/src/components/login-form/examples/states.tsx +53 -57
- package/src/components/login-form/examples/structure.tsx +18 -22
- package/src/components/login-form/examples/verification-code.tsx +41 -45
- package/src/components/media-viewer/COMPONENT.md +1 -1
- package/src/components/media-viewer/examples/dismiss.tsx +5 -1
- package/src/components/message/COMPONENT.md +4 -3
- package/src/components/message/examples/file.tsx +5 -1
- package/src/components/message/examples/media-open.tsx +48 -0
- package/src/components/message/examples/status.tsx +21 -3
- package/src/components/message/examples/text-formatting.tsx +7 -1
- package/src/components/modal/COMPONENT.md +2 -1
- package/src/components/modal/examples/custom-container.tsx +20 -20
- package/src/components/modal/examples/dismiss.tsx +5 -3
- package/src/components/modal/examples/enter-key.tsx +116 -0
- package/src/components/modal/examples/examples.module.css +7 -13
- package/src/components/modal/examples/structure.tsx +5 -2
- package/src/components/native-select/COMPONENT.md +1 -1
- package/src/components/native-select/examples/states.tsx +5 -1
- package/src/components/notification/COMPONENT.md +1 -1
- package/src/components/notification/examples/dismiss.tsx +2 -2
- package/src/components/page-content/COMPONENT.md +1 -0
- package/src/components/page-content/examples/list-detail.tsx +0 -3
- package/src/components/page-content/examples/screen.module.css +27 -0
- package/src/components/page-content/examples/screen.tsx +196 -0
- package/src/components/page-content/examples/variants.tsx +4 -11
- package/src/components/page-toolbar/COMPONENT.md +17 -15
- package/src/components/page-toolbar/examples/narrow.tsx +6 -3
- package/src/components/pagination/examples/controlled.tsx +29 -29
- package/src/components/pagination/examples/examples.module.css +0 -2
- package/src/components/progress-bar/COMPONENT.md +1 -1
- package/src/components/progress-bar/examples/segments.tsx +2 -2
- package/src/components/progress-circle/COMPONENT.md +1 -1
- package/src/components/progress-circle/examples/segments.tsx +8 -3
- package/src/components/radio/COMPONENT.md +1 -0
- package/src/components/radio/examples/examples.module.css +14 -0
- package/src/components/radio/examples/in-form.tsx +45 -0
- package/src/components/scroll-container/COMPONENT.md +1 -0
- package/src/components/scroll-container/examples/auto-scroll.tsx +3 -3
- package/src/components/scroll-container/examples/chat.tsx +3 -3
- package/src/components/scroll-container/examples/edges.tsx +6 -3
- package/src/components/scroll-container/examples/examples.module.css +4 -17
- package/src/components/scroll-container/examples/load-more.tsx +51 -0
- package/src/components/scroll-container/examples/lock.tsx +3 -5
- package/src/components/scroll-container/examples/overscroll.tsx +3 -3
- package/src/components/scroll-container/examples/overview.tsx +3 -3
- package/src/components/scroll-container/examples/scrollbar.tsx +13 -7
- package/src/components/scroll-container/examples/variants.tsx +13 -7
- package/src/components/segmented-control/COMPONENT.md +2 -2
- package/src/components/segmented-control/examples/in-form.tsx +5 -1
- package/src/components/segmented-control/examples/states.tsx +10 -1
- package/src/components/select/COMPONENT.md +1 -1
- package/src/components/select/examples/examples.module.css +2 -7
- package/src/components/select/examples/states.tsx +13 -1
- package/src/components/sheet/COMPONENT.md +2 -0
- package/src/components/sheet/examples/guard.tsx +72 -0
- package/src/components/sheet/examples/header-actions.tsx +56 -0
- package/src/components/slider/COMPONENT.md +2 -1
- package/src/components/slider/examples/examples.module.css +8 -0
- package/src/components/slider/examples/in-form.tsx +47 -0
- package/src/components/slider/examples/states.tsx +4 -1
- package/src/components/smart-filter/COMPONENT.md +1 -1
- package/src/components/smart-filter/examples/controlled.tsx +3 -3
- package/src/components/smart-filter/examples/ranges.tsx +44 -10
- package/src/components/sparkline/COMPONENT.md +1 -1
- package/src/components/sparkline/examples/reference.tsx +2 -1
- package/src/components/tabs/COMPONENT.md +1 -1
- package/src/components/tabs/examples/sizes.tsx +1 -1
- package/src/components/tag-select/COMPONENT.md +1 -1
- package/src/components/tag-select/examples/states.tsx +8 -1
- package/src/components/textarea/COMPONENT.md +1 -1
- package/src/components/textarea/examples/examples.module.css +0 -6
- package/src/components/textarea/examples/in-form.tsx +1 -9
- package/src/components/textarea/examples/states.tsx +2 -1
- package/src/components/thumbnail/COMPONENT.md +2 -1
- package/src/components/thumbnail/examples/examples.module.css +1 -1
- package/src/components/thumbnail/examples/fit.tsx +24 -0
- package/src/components/thumbnail/examples/video.tsx +20 -1
- package/src/components/timeline/COMPONENT.md +1 -1
- package/src/components/timeline/examples/links.tsx +55 -14
- package/src/components/tooltip/COMPONENT.md +1 -1
- package/src/components/tooltip/examples/toolbar.tsx +2 -2
- package/src/components/typography/examples/weights.tsx +3 -0
- package/src/components/video-note/COMPONENT.md +2 -2
- package/src/components/video-note/examples/controlled.tsx +19 -2
- package/src/components/video-note/examples/in-message.tsx +5 -2
- package/src/components/visually-hidden/COMPONENT.md +2 -1
- package/src/components/visually-hidden/examples/assertive.tsx +39 -0
- package/src/components/voice-player/COMPONENT.md +2 -2
- package/src/components/voice-player/examples/call-recording.tsx +19 -9
- package/src/components/voice-player/examples/controlled.tsx +20 -3
- package/src/layout/app-header/COMPONENT.md +46 -63
- package/src/layout/app-header/examples/breadcrumbs.tsx +10 -9
- package/src/layout/app-header/examples/examples.module.css +1 -1
- package/src/layout/app-header/examples/in-app-shell.tsx +0 -1
- package/src/layout/app-header/examples/narrow.tsx +4 -5
- package/src/layout/app-header/examples/overview.tsx +8 -10
- package/src/layout/app-header/examples/page-title.tsx +3 -10
- package/src/layout/app-shell/COMPONENT.md +4 -3
- package/src/layout/app-shell/examples/overview.tsx +15 -30
- package/src/layout/app-shell/examples/screen.module.css +11 -0
- package/src/layout/app-shell/examples/screen.tsx +262 -0
- package/src/layout/app-shell/examples/template.tsx +29 -9
- package/src/layout/sidebar/COMPONENT.md +7 -4
- package/src/layout/sidebar/examples/account.tsx +2 -2
- package/src/layout/sidebar/examples/collapsible-groups.tsx +12 -4
- package/src/layout/sidebar/examples/custom-part.tsx +53 -0
- package/src/layout/sidebar/examples/examples.module.css +5 -0
- package/src/layout/sidebar/examples/narrow.tsx +53 -0
- package/src/layout/sidebar/examples/persist.tsx +57 -0
- package/src/layout/sidebar/examples/router.tsx +14 -2
- package/src/layout/sidebar/examples/structure.tsx +7 -2
- package/dist/skill/patterns/app-shell.tsx +0 -303
- package/dist/skill/patterns/chat.module.css +0 -8
- package/dist/skill/patterns/dashboard.tsx +0 -340
- package/dist/skill/patterns/detail-page.tsx +0 -206
- package/dist/skill/patterns/form-drawer.tsx +0 -240
- package/dist/skill/patterns/kanban-board.module.css +0 -28
- package/dist/skill/patterns/media-library.tsx +0 -637
- package/dist/skill/patterns/schedule.module.css +0 -22
- package/dist/skill/patterns/screen-states.tsx +0 -187
- /package/dist/skill/{patterns/dashboard.module.css → reference/components/card/examples/screen.module.css} +0 -0
- /package/dist/skill/{patterns/screen-states.module.css → reference/components/crossfade/examples/screen.module.css} +0 -0
- /package/dist/skill/{patterns/form-drawer.module.css → reference/components/drawer/examples/screen.module.css} +0 -0
- /package/dist/skill/{patterns/record-editor.module.css → reference/components/field-list/examples/screen.module.css} +0 -0
- /package/dist/skill/{patterns/settings-page.module.css → reference/components/page-content/examples/screen.module.css} +0 -0
- /package/dist/skill/{patterns/app-shell.module.css → reference/layout/app-shell/examples/screen.module.css} +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** A failed save shown by a badge on screen and announced at once, interrupting the screen reader — `live`. */
|
|
2
|
+
import { Badge, Button, VisuallyHidden } from "prime-ui-kit";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
/** The server refusing the save a beat later. */
|
|
6
|
+
const saveInvoice = () =>
|
|
7
|
+
new Promise<void>((_, reject) => setTimeout(() => reject(new Error("offline")), 700));
|
|
8
|
+
|
|
9
|
+
export default function VisuallyHiddenAssertiveExample() {
|
|
10
|
+
const [saving, setSaving] = React.useState(false);
|
|
11
|
+
const [failed, setFailed] = React.useState(false);
|
|
12
|
+
|
|
13
|
+
const save = async () => {
|
|
14
|
+
setSaving(true);
|
|
15
|
+
setFailed(false);
|
|
16
|
+
try {
|
|
17
|
+
await saveInvoice();
|
|
18
|
+
} catch {
|
|
19
|
+
setFailed(true);
|
|
20
|
+
}
|
|
21
|
+
setSaving(false);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
<Button.Root loading={saving} onClick={save}>
|
|
27
|
+
Сохранить счёт
|
|
28
|
+
</Button.Root>
|
|
29
|
+
{failed ? (
|
|
30
|
+
<Badge.Root color="red" aria-hidden="true">
|
|
31
|
+
Не сохранено
|
|
32
|
+
</Badge.Root>
|
|
33
|
+
) : null}
|
|
34
|
+
<VisuallyHidden live="assertive">
|
|
35
|
+
{failed ? "Счёт не сохранён: нет связи с сервером. Повторите попытку." : ""}
|
|
36
|
+
</VisuallyHidden>
|
|
37
|
+
</>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -172,11 +172,11 @@ One look. Colors are semantic roles only (`accent-default`, `accent-fg`, `fill-s
|
|
|
172
172
|
|---|---|
|
|
173
173
|
| [overview.tsx](examples/overview.tsx) | A client's voice message to support, ready to play — `src`, `waveform`, `duration`. |
|
|
174
174
|
| [states.tsx](examples/states.tsx) | Every state side by side, each labelled by its prop: the transfer is drawn on the play disk itself — in flight with the cross and the ring, failed with the retry, not fetched with the download arrow — `unplayed`, `transfer`, `transferProgress`, `disabled`. |
|
|
175
|
-
| [call-recording.tsx](examples/call-recording.tsx) | A sales call recording on a deal card: the player takes the card's width — `className`. |
|
|
175
|
+
| [call-recording.tsx](examples/call-recording.tsx) | A sales call recording on a deal card: the telephony stores no levels, so the waveform is read from the audio itself and the calm flat row fills in once it is ready; the player takes the card's width — `getWaveform`, `waveform`, `className`. |
|
|
176
176
|
| [in-message.tsx](examples/in-message.tsx) | Voice messages in a support chat: the player sits on the bubble fill and the bubble's time stands in its corner — `Message.Root`, `time`, `status`. |
|
|
177
177
|
| [transcript.tsx](examples/transcript.tsx) | Voice messages with a transcript: one known, one asked for on the first open — `transcript`, `onTranscribe`. |
|
|
178
178
|
| [transfer.tsx](examples/transfer.tsx) | One look for a recording on its way in either direction: the client's voice message waits to be fetched and then arrives, the reply is being sent — the play disk itself carries the cross and the ring of the share, a dropped connection offers a retry, and the play glyph comes back once it is through — `transfer`, `transferProgress`, `transferDirection`, `onCancel`, `onRetry`, `onDownload`. |
|
|
179
|
-
| [controlled.tsx](examples/controlled.tsx) | The parent knows what plays, marks the message as listened on the first play and keeps the speed — `playing`, `onPlayingChange`, `unplayed`, `rate`, `onRateChange`. |
|
|
179
|
+
| [controlled.tsx](examples/controlled.tsx) | The parent knows what plays, marks the message as listened on the first play and as heard to the end when it ends, keeps the speed and keeps the transcript open — `playing`, `onPlayingChange`, `unplayed`, `onEnded`, `rate`, `onRateChange`, `transcriptExpanded`, `onTranscriptExpandedChange`. |
|
|
180
180
|
|
|
181
181
|
## Mistakes
|
|
182
182
|
- A hand-made `<audio controls>` in a bubble → use `VoicePlayer`: it matches the bubble's colors and keeps room for the time.
|
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
/** A sales call recording on a deal card: the player takes the card's width — `className`. */
|
|
2
|
-
import { Card, Typography, VoicePlayer } from "prime-ui-kit";
|
|
1
|
+
/** A sales call recording on a deal card: the telephony stores no levels, so the waveform is read from the audio itself and the calm flat row fills in once it is ready; the player takes the card's width — `getWaveform`, `waveform`, `className`. */
|
|
2
|
+
import { Card, getWaveform, Typography, VoicePlayer } from "prime-ui-kit";
|
|
3
|
+
import * as React from "react";
|
|
3
4
|
|
|
4
5
|
import styles from "./examples.module.css";
|
|
5
6
|
|
|
6
7
|
const RECORDING_URL = "https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3";
|
|
7
8
|
|
|
8
|
-
const WAVEFORM = [
|
|
9
|
-
0.2, 0.34, 0.5, 0.42, 0.6, 0.78, 0.66, 0.4, 0.3, 0.52, 0.7, 0.86, 0.74, 0.48, 0.36, 0.58, 0.8,
|
|
10
|
-
0.62, 0.38, 0.26, 0.44, 0.68, 0.9, 0.72, 0.5, 0.32, 0.46, 0.64, 0.54, 0.3, 0.22, 0.4, 0.6, 0.76,
|
|
11
|
-
0.56, 0.34,
|
|
12
|
-
];
|
|
13
|
-
|
|
14
9
|
export default function VoicePlayerCallRecordingExample() {
|
|
10
|
+
const [waveform, setWaveform] = React.useState<number[]>();
|
|
11
|
+
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
let current = true;
|
|
14
|
+
getWaveform(RECORDING_URL)
|
|
15
|
+
.then((levels) => {
|
|
16
|
+
if (current) setWaveform([...levels]);
|
|
17
|
+
})
|
|
18
|
+
// Without levels the player keeps its flat row: the recording still plays.
|
|
19
|
+
.catch(() => {});
|
|
20
|
+
return () => {
|
|
21
|
+
current = false;
|
|
22
|
+
};
|
|
23
|
+
}, []);
|
|
24
|
+
|
|
15
25
|
return (
|
|
16
26
|
<Card.Root className={styles.card}>
|
|
17
27
|
<Card.Body className={styles.body}>
|
|
@@ -24,7 +34,7 @@ export default function VoicePlayerCallRecordingExample() {
|
|
|
24
34
|
<VoicePlayer
|
|
25
35
|
className={styles.player}
|
|
26
36
|
src={RECORDING_URL}
|
|
27
|
-
waveform={
|
|
37
|
+
waveform={waveform}
|
|
28
38
|
duration={754}
|
|
29
39
|
aria-label="Запись звонка"
|
|
30
40
|
/>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** The parent knows what plays, marks the message as listened on the first play and keeps the speed — `playing`, `onPlayingChange`, `unplayed`, `rate`, `onRateChange`. */
|
|
1
|
+
/** The parent knows what plays, marks the message as listened on the first play and as heard to the end when it ends, keeps the speed and keeps the transcript open — `playing`, `onPlayingChange`, `unplayed`, `onEnded`, `rate`, `onRateChange`, `transcriptExpanded`, `onTranscriptExpandedChange`. */
|
|
2
2
|
import { Typography, VoicePlayer, type VoicePlayerRate } from "prime-ui-kit";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
@@ -9,10 +9,23 @@ const WAVEFORM = [
|
|
|
9
9
|
0.64, 0.86, 0.58, 0.32, 0.2,
|
|
10
10
|
];
|
|
11
11
|
|
|
12
|
+
const TRANSCRIPT =
|
|
13
|
+
"Добрый день! Машина с заказом 4821 будет у склада в девять, водитель позвонит за полчаса.";
|
|
14
|
+
|
|
12
15
|
export default function VoicePlayerControlledExample() {
|
|
13
16
|
const [playing, setPlaying] = React.useState(false);
|
|
14
17
|
const [unplayed, setUnplayed] = React.useState(true);
|
|
18
|
+
const [heard, setHeard] = React.useState(false);
|
|
15
19
|
const [rate, setRate] = React.useState<VoicePlayerRate>(1.5);
|
|
20
|
+
const [transcriptOpen, setTranscriptOpen] = React.useState(false);
|
|
21
|
+
|
|
22
|
+
const state = playing
|
|
23
|
+
? "Воспроизводится"
|
|
24
|
+
: heard
|
|
25
|
+
? "Дослушано до конца"
|
|
26
|
+
: unplayed
|
|
27
|
+
? "Ещё не прослушано"
|
|
28
|
+
: "Прослушано";
|
|
16
29
|
|
|
17
30
|
return (
|
|
18
31
|
<>
|
|
@@ -26,12 +39,16 @@ export default function VoicePlayerControlledExample() {
|
|
|
26
39
|
setPlaying(next);
|
|
27
40
|
if (next) setUnplayed(false);
|
|
28
41
|
}}
|
|
42
|
+
onEnded={() => setHeard(true)}
|
|
29
43
|
rate={rate}
|
|
30
44
|
onRateChange={setRate}
|
|
45
|
+
transcript={TRANSCRIPT}
|
|
46
|
+
transcriptExpanded={transcriptOpen}
|
|
47
|
+
onTranscriptExpandedChange={setTranscriptOpen}
|
|
31
48
|
/>
|
|
32
49
|
<Typography as="p" variant="body-s" tone="secondary">
|
|
33
|
-
{
|
|
34
|
-
{
|
|
50
|
+
{state} · скорость {String(rate).replace(".", ",")}× · расшифровка{" "}
|
|
51
|
+
{transcriptOpen ? "открыта" : "свёрнута"}
|
|
35
52
|
</Typography>
|
|
36
53
|
</>
|
|
37
54
|
);
|
|
@@ -3,18 +3,17 @@
|
|
|
3
3
|
**Category:** page
|
|
4
4
|
**Kind:** layout
|
|
5
5
|
|
|
6
|
-
> The bar at the top of the app's content panel:
|
|
6
|
+
> The page's bar at the top of the app's content panel: the page title with a line of data, the page's tools and its own buttons — only what the current page needs.
|
|
7
7
|
|
|
8
8
|
## When to use
|
|
9
|
-
-
|
|
10
|
-
- The
|
|
11
|
-
-
|
|
9
|
+
- Every page of an app built on [AppShell](../app-shell/COMPONENT.md): the page titles itself here — `AppHeader.Title` (the page's `<h1>`) with an `AppHeader.Description` that carries data, the path up (`Breadcrumb`) on a nested record.
|
|
10
|
+
- The page's tools — its own search and filter, sections, the view, the primary action — as a [PageToolbar](../../components/page-toolbar/COMPONENT.md) in `AppHeader.Tools`.
|
|
11
|
+
- The phone header: the menu button that opens the off-canvas Sidebar, the title, the page's action as an icon.
|
|
12
12
|
|
|
13
13
|
## When not to use
|
|
14
|
-
- A page
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
- The search dialog itself → use [CommandMenu](../../components/command-menu/COMPONENT.md); `AppHeader.Search` only opens it.
|
|
14
|
+
- A document page (settings, a long form, an article) → its title is `PageContent.Header` in main ([PageContent](../../components/page-content/COMPONENT.md)); the header then has no title.
|
|
15
|
+
- App navigation → [Sidebar](../sidebar/COMPONENT.md) and, on a phone, [BottomNav](../bottom-nav/COMPONENT.md); the header holds at most the menu button.
|
|
16
|
+
- Anything that is not about the current page (a global search, app-wide buttons) → the header row is per page; the app's own places live in the Sidebar.
|
|
18
17
|
|
|
19
18
|
## Import
|
|
20
19
|
```tsx
|
|
@@ -23,44 +22,43 @@ import { AppHeader } from "prime-ui-kit";
|
|
|
23
22
|
|
|
24
23
|
## Anatomy
|
|
25
24
|
```
|
|
26
|
-
AppHeader.Root <header>,
|
|
25
|
+
AppHeader.Root <header>, the page's sticky row as high as the Sidebar brand row
|
|
27
26
|
├─ AppHeader.Start leading zone, takes the free width
|
|
28
27
|
│ ├─ AppHeader.MenuButton opens the off-canvas Sidebar (below 768px by default)
|
|
29
|
-
│ ├─
|
|
30
|
-
│
|
|
28
|
+
│ ├─ Breadcrumb the path up, only on a nested record
|
|
29
|
+
│ ├─ AppHeader.Separator short vertical line between the path and the title
|
|
30
|
+
│ └─ AppHeader.Title the page title, truncates
|
|
31
31
|
│ ├─ AppHeader.Icon decorative glyph on a tile shaped like a soft button m
|
|
32
|
-
│ └─ AppHeader.Description muted
|
|
33
|
-
├─ AppHeader.
|
|
34
|
-
|
|
35
|
-
└─ AppHeader.Tools second row, full width: the page tools (a PageToolbar.Root)
|
|
32
|
+
│ └─ AppHeader.Description a muted line of data under the name
|
|
33
|
+
├─ AppHeader.Actions the page's own buttons at the end of the title row
|
|
34
|
+
└─ AppHeader.Tools second row, full width: the page's tools (a PageToolbar.Root)
|
|
36
35
|
```
|
|
37
|
-
`AppHeader.Title
|
|
36
|
+
The name of `AppHeader.Title` (not the icon or the description) is the page's `<h1>`.
|
|
38
37
|
|
|
39
38
|
## API
|
|
40
39
|
|
|
41
40
|
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
42
41
|
|
|
43
42
|
### AppHeader.Root
|
|
44
|
-
`ref` → `HTMLElement`. The sticky `<header>` bar at the top of the content panel,
|
|
43
|
+
`ref` → `HTMLElement`. The page's sticky `<header>` bar at the top of the content panel: only what the current page needs — its title, tools and own buttons. As high as the Sidebar brand row, lined up with the page. Icon buttons inside are `soft`, not `ghost`.
|
|
45
44
|
|
|
46
45
|
| Prop | Type | Default | Description |
|
|
47
46
|
|---|---|---|---|
|
|
48
47
|
| `labels` | `Partial<AppHeaderLabels>` | — | Built-in strings, see Labels. |
|
|
49
|
-
| `…rest` | `HTMLAttributes<HTMLElement>` | — | `children` (`AppHeader.Start`, `AppHeader.
|
|
48
|
+
| `…rest` | `HTMLAttributes<HTMLElement>` | — | `children` (`AppHeader.Start`, `AppHeader.Actions`, `AppHeader.Tools`), `className` and the other attributes. |
|
|
50
49
|
|
|
51
50
|
### AppHeader.Start
|
|
52
|
-
`ref` → `HTMLDivElement`. The leading zone that takes the free width: the menu button, a
|
|
51
|
+
`ref` → `HTMLDivElement`. The leading zone that takes the free width: the menu button, the path up (a Breadcrumb) and the title.
|
|
53
52
|
|
|
54
53
|
| Prop | Type | Default | Description |
|
|
55
54
|
|---|---|---|---|
|
|
56
55
|
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children`, `className` and the other div attributes. |
|
|
57
56
|
|
|
58
57
|
### AppHeader.Title
|
|
59
|
-
`ref` → `HTMLDivElement`.
|
|
58
|
+
`ref` → `HTMLDivElement`. The page title: an optional `AppHeader.Icon`, the name (title-s, truncates) and an optional `AppHeader.Description` under it. The name is the page heading `<h1>`; the description stays outside its accessible name.
|
|
60
59
|
|
|
61
60
|
| Prop | Type | Default | Description |
|
|
62
61
|
|---|---|---|---|
|
|
63
|
-
| `as` | `"span" \| "h1"` | `"span"` | Tag of the name. `h1`: the header carries the page title — only the name is the heading, the description stays outside its accessible name; the look does not change. |
|
|
64
62
|
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children` (the name, `AppHeader.Icon`, `AppHeader.Description` in any order), `className` and the other div attributes. |
|
|
65
63
|
|
|
66
64
|
### AppHeader.Icon
|
|
@@ -71,28 +69,19 @@ AppHeader.Root <header>, one sticky row as high as the Sidebar bra
|
|
|
71
69
|
| `…rest` | `HTMLAttributes<HTMLSpanElement>` | — | `children` (an `Icon`), `className` and the other span attributes. |
|
|
72
70
|
|
|
73
71
|
### AppHeader.Description
|
|
74
|
-
`ref` → `HTMLSpanElement`. Muted
|
|
72
|
+
`ref` → `HTMLSpanElement`. Muted line under the title that carries data («128 в работе · 6 ждут оплаты», a status and a date); truncates on a narrow header, never hides.
|
|
75
73
|
|
|
76
74
|
| Prop | Type | Default | Description |
|
|
77
75
|
|---|---|---|---|
|
|
78
76
|
| `…rest` | `HTMLAttributes<HTMLSpanElement>` | — | `children`, `className` and the other span attributes. |
|
|
79
77
|
|
|
80
78
|
### AppHeader.Separator
|
|
81
|
-
`ref` → `HTMLDivElement`. A short vertical `Divider` (20) between groups in a zone —
|
|
79
|
+
`ref` → `HTMLDivElement`. A short vertical `Divider` (20) between groups in a zone — the path and the title — with 16 of air on each side.
|
|
82
80
|
|
|
83
81
|
| Prop | Type | Default | Description |
|
|
84
82
|
|---|---|---|---|
|
|
85
83
|
| `…rest` | `Omit<DividerProps, "orientation" \| "children">` | — | `className` and the other div attributes. |
|
|
86
84
|
|
|
87
|
-
### AppHeader.Search
|
|
88
|
-
`ref` → `HTMLButtonElement`. The global search entry: a `<button type="button">` drawn as a field (search icon, placeholder text, key hint) that opens your CommandMenu. Below 36rem of header width it folds into a square button named by its text.
|
|
89
|
-
|
|
90
|
-
| Prop | Type | Default | Description |
|
|
91
|
-
|---|---|---|---|
|
|
92
|
-
| `children` | `ReactNode` | — (required) | The placeholder text; also the accessible name. |
|
|
93
|
-
| `shortcut` | `ReactNode` | `"⌘K"` | The key hint at the end (a `Kbd`, hidden from assistive tech); `null` hides it. Bind the key yourself. |
|
|
94
|
-
| `…rest` | `ButtonHTMLAttributes<HTMLButtonElement>` | — | `onClick`, `className` and the other button attributes. |
|
|
95
|
-
|
|
96
85
|
### AppHeader.Tools
|
|
97
86
|
`ref` → `HTMLDivElement`. The page's tools in the header (a `PageToolbar.Root`): the header's second row, full width under the title row, wherever it is written.
|
|
98
87
|
|
|
@@ -101,7 +90,7 @@ AppHeader.Root <header>, one sticky row as high as the Sidebar bra
|
|
|
101
90
|
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children` (a `PageToolbar.Root`), `className` and the other div attributes. |
|
|
102
91
|
|
|
103
92
|
### AppHeader.Actions
|
|
104
|
-
`ref` → `HTMLDivElement`. The trailing row of buttons
|
|
93
|
+
`ref` → `HTMLDivElement`. The trailing row of the page's own buttons in the title row (export, a more menu); the page's primary action goes into the PageToolbar in `AppHeader.Tools` when the page has tools. Never wraps.
|
|
105
94
|
|
|
106
95
|
| Prop | Type | Default | Description |
|
|
107
96
|
|---|---|---|---|
|
|
@@ -126,50 +115,43 @@ AppHeader.Root <header>, one sticky row as high as the Sidebar bra
|
|
|
126
115
|
### Structure
|
|
127
116
|
| Value | Looks like | Use when | Default |
|
|
128
117
|
|---|---|---|---|
|
|
129
|
-
| `AppHeader.Title` | Icon, name and a
|
|
130
|
-
| Breadcrumb in Start |
|
|
131
|
-
| with `AppHeader.
|
|
132
|
-
| with `AppHeader.
|
|
133
|
-
|
|
|
134
|
-
|
|
135
|
-
### as (Title)
|
|
136
|
-
| Value | Looks like | Use when | Default |
|
|
137
|
-
|---|---|---|---|
|
|
138
|
-
| `span` | the name, no heading | the page has `PageContent.Header` in main | yes |
|
|
139
|
-
| `h1` | the same look; the name is the page `<h1>`, the description stays outside its name | the header carries the page title | |
|
|
118
|
+
| `AppHeader.Title` | Icon, name and a line of data under it, like the Sidebar brand | A top-level page | |
|
|
119
|
+
| Breadcrumb in Start | The path, `AppHeader.Separator` and the record as the title | A nested record page | |
|
|
120
|
+
| with `AppHeader.Actions` | A row of the page's buttons at the end of the title row | Export, a more menu of the page | |
|
|
121
|
+
| with `AppHeader.Tools` | A second row under the title row with the page's PageToolbar | The page has search, filters, sections, a view or a primary action | |
|
|
122
|
+
| no `AppHeader.Title` | Only the menu button and the page's buttons | A document page: its title is `PageContent.Header` in main | |
|
|
140
123
|
|
|
141
124
|
## States
|
|
142
125
|
| State | Driven by | DOM |
|
|
143
126
|
|---|---|---|
|
|
144
127
|
| with page tools | an `AppHeader.Tools` child | Root renders it after the title row (DOM and Tab order follow the rows), full width, `--prime-space-3` under it |
|
|
145
|
-
| narrow header | header width below 36rem (container `prime-app-header`) | the icon tile
|
|
128
|
+
| narrow header | header width below 36rem (container `prime-app-header`) | the icon tile hides; the title and its line of data truncate |
|
|
146
129
|
| menu button hidden | `show="narrow"` and viewport from 768px | `data-show="narrow"` on MenuButton |
|
|
147
130
|
| short viewport | viewport below 480px high (a phone on its side) | Root stops sticking |
|
|
148
131
|
|
|
149
132
|
## Layout & spacing
|
|
150
133
|
- Row min height = control m + `--prime-space-2` (44), padding-block `--prime-space-3` (the top grows to the safe-area inset): 68 in all, the height of the Sidebar header, so the brand and the title share one line.
|
|
151
|
-
- Inline padding: the shell gutters (16 → 24 → 32, the same as `AppShell.Main`) in the shell's panel, so the header lines up with the page; `--prime-space-4` elsewhere.
|
|
152
|
-
- Icon buttons are `soft` neutral (MenuButton is), never `ghost`:
|
|
134
|
+
- Inline padding: the shell gutters (16 → 24 → 32, the same as `AppShell.Main`) in the shell's panel, so the header lines up with the page; `--prime-space-4` elsewhere. Main's top air (24, 32 from 1024px) stands between the header and the page's first block.
|
|
135
|
+
- Icon buttons are `soft` neutral (MenuButton is), never `ghost`: every button on the bar has a shape.
|
|
153
136
|
- Gaps: `--prime-space-3` between zones, `--prime-space-2` inside Start and Actions; `AppHeader.Separator` adds `--prime-space-2` on each side (16 in all) and is 20 high.
|
|
154
137
|
- `AppHeader.Icon` is a 36 tile with the radius and fill of a soft neutral button m, so it lines up with the buttons on the bar.
|
|
155
138
|
- On the panel surface with no divider or shadow (depth from fill); `z-index: --prime-z-sticky`.
|
|
156
139
|
- Sticky at `top: 0` of its scroller (static on a viewport below 480px high). The shared sticky surface paints its fill one border width past the top edge, so no sub-pixel seam of the scrolling rows shows above it.
|
|
157
|
-
-
|
|
158
|
-
- `AppHeader.Tools` is the header's second row: the full width under the title row, 12 apart, sticky with it. The PageToolbar inside lays itself out from that width — one row from 56rem,
|
|
140
|
+
- Controls inside are size `m`.
|
|
141
|
+
- `AppHeader.Tools` is the header's second row: the full width under the title row, 12 apart, sticky with it. The PageToolbar inside lays itself out from that width — one row from 56rem, stacked rows below, the primary action on its own row when the search would get less than 18rem beside it — so on a phone the page tools wrap under the title, never squeeze it.
|
|
159
142
|
|
|
160
143
|
## Accessibility
|
|
161
144
|
|
|
162
145
|
### Keyboard
|
|
163
146
|
| Key | Action |
|
|
164
147
|
|---|---|
|
|
165
|
-
| `Tab` | Moves through the menu button, the path links
|
|
166
|
-
| `Enter` · `Space` | Presses the focused button: opens the menu
|
|
148
|
+
| `Tab` | Moves through the menu button, the path links and the page's buttons in reading order, then the page tools in the second row. |
|
|
149
|
+
| `Enter` · `Space` | Presses the focused button: opens the menu or runs the action. |
|
|
167
150
|
|
|
168
151
|
### ARIA
|
|
169
152
|
- Root is a `<header>`: the banner landmark when it sits at the top level of the page.
|
|
170
|
-
- Search is a button named by its text; the key hint is `aria-hidden`, and the app binds the shortcut.
|
|
171
153
|
- MenuButton is named by `labels.menu`; pass `aria-expanded` (whether the Sidebar is open).
|
|
172
|
-
-
|
|
154
|
+
- The name of `AppHeader.Title` is the page heading `<h1>`; the description sits next to it, outside its accessible name. One `<h1>` per page: in the header on app pages, `PageContent.Title` on a document page (whose header has no title).
|
|
173
155
|
- `AppHeader.Tools` follows the title row in the DOM, so Tab and screen readers meet the page tools after the header's own buttons.
|
|
174
156
|
|
|
175
157
|
### Labels
|
|
@@ -182,22 +164,23 @@ AppHeader.Root <header>, one sticky row as high as the Sidebar bra
|
|
|
182
164
|
## Examples
|
|
183
165
|
| Example | Shows |
|
|
184
166
|
|---|---|
|
|
185
|
-
| [overview.tsx](examples/overview.tsx) | The
|
|
186
|
-
| [breadcrumbs.tsx](examples/breadcrumbs.tsx) | A nested
|
|
187
|
-
| [page-title.tsx](examples/page-title.tsx) | The header carries the page: the title is the page heading, the page tools (sections, the period, the primary action) are its second row and lay themselves out from its width — `AppHeader.Title`, `
|
|
167
|
+
| [overview.tsx](examples/overview.tsx) | The page's header: the page title with its icon and a line of data under it, the page's own buttons at the end — `AppHeader.Title`, `AppHeader.Description`, `AppHeader.Actions`. |
|
|
168
|
+
| [breadcrumbs.tsx](examples/breadcrumbs.tsx) | A nested record: the path up, a separator and the record as the page title, the record's buttons at the end — `AppHeader.Separator`, `AppHeader.Actions`. |
|
|
169
|
+
| [page-title.tsx](examples/page-title.tsx) | The header carries the page: the title is the page heading with a line of data, the page tools (sections, the period, the primary action) are its second row and lay themselves out from its width — `AppHeader.Title`, `AppHeader.Tools`. |
|
|
188
170
|
| [in-app-shell.tsx](examples/in-app-shell.tsx) | The header in the app frame: one row with the Sidebar brand across the two planes, sticky over main — `AppShell`, `Sidebar.Brand`. |
|
|
189
|
-
| [narrow.tsx](examples/narrow.tsx) | On a phone: the menu button opens the navigation, the
|
|
171
|
+
| [narrow.tsx](examples/narrow.tsx) | On a phone: the menu button opens the navigation, the title and its line of data truncate and the page's action keeps its icon — `AppHeader.MenuButton`, `show`. |
|
|
190
172
|
|
|
191
173
|
## Mistakes
|
|
192
174
|
- A border or shadow under the header → it sits on the panel surface; the fill is the boundary.
|
|
193
|
-
- `AppHeader.Title
|
|
175
|
+
- `AppHeader.Title` while main also has `PageContent.Title` → two titles; an app page titles itself in the header, only a document page keeps `PageContent.Header` (and then the header has no title).
|
|
176
|
+
- No title at all on an app page → the page has no `<h1>`.
|
|
177
|
+
- A description that describes the page («Все заказы магазина») → a line of data («128 в работе · 6 ждут оплаты») or nothing.
|
|
194
178
|
- Page tools crammed into `AppHeader.Actions` → `AppHeader.Tools` with a PageToolbar: it wraps under the title instead of squeezing it.
|
|
195
|
-
- A
|
|
196
|
-
- A
|
|
197
|
-
- More than three actions → keep one primary action; the rest go into the page or a Dropdown.
|
|
179
|
+
- A global search, notifications or app-wide buttons in the header → the row is per page; the app's own places live in the Sidebar.
|
|
180
|
+
- A heading element of your own inside `AppHeader.Title` → the title's name is already the `<h1>`; a second heading nests inside it.
|
|
198
181
|
- A hand-made menu button with a media query → `AppHeader.MenuButton` follows the Sidebar breakpoint.
|
|
199
182
|
- `ghost` icon buttons in the header → `variant="soft" tone="neutral"`: a light fill gives each button a shape on the bar.
|
|
200
183
|
|
|
201
184
|
## Related
|
|
202
|
-
- **Built from:** [Button](../../components/button/COMPONENT.md), [
|
|
203
|
-
- **See also:** [AppShell](../app-shell/COMPONENT.md), [Sidebar](../sidebar/COMPONENT.md), [PageContent](../../components/page-content/COMPONENT.md), [PageToolbar](../../components/page-toolbar/COMPONENT.md) (inside `AppHeader.Tools`), [
|
|
185
|
+
- **Built from:** [Button](../../components/button/COMPONENT.md), [Divider](../../components/divider/COMPONENT.md), Icon (`nav.menu`)
|
|
186
|
+
- **See also:** [AppShell](../app-shell/COMPONENT.md), [Sidebar](../sidebar/COMPONENT.md), [PageContent](../../components/page-content/COMPONENT.md), [PageToolbar](../../components/page-toolbar/COMPONENT.md) (inside `AppHeader.Tools`), [Breadcrumb](../../components/breadcrumb/COMPONENT.md)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** A nested
|
|
1
|
+
/** A nested record: the path up, a separator and the record as the page title, the record's buttons at the end — `AppHeader.Separator`, `AppHeader.Actions`. */
|
|
2
2
|
import { AppHeader, Breadcrumb, Button, Icon } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
import styles from "./examples.module.css";
|
|
@@ -8,21 +8,22 @@ export default function AppHeaderBreadcrumbsExample() {
|
|
|
8
8
|
<div className={styles.window}>
|
|
9
9
|
<AppHeader.Root>
|
|
10
10
|
<AppHeader.Start>
|
|
11
|
-
<Button.Root variant="soft" tone="neutral" aria-label="Назад к клиентам">
|
|
12
|
-
<Button.Icon>
|
|
13
|
-
<Icon name="nav.chevronLeft" />
|
|
14
|
-
</Button.Icon>
|
|
15
|
-
</Button.Root>
|
|
16
|
-
<AppHeader.Separator />
|
|
17
11
|
<Breadcrumb.Root>
|
|
18
12
|
<Breadcrumb.Item href="#crm">CRM</Breadcrumb.Item>
|
|
19
13
|
<Breadcrumb.Item href="#clients">Клиенты</Breadcrumb.Item>
|
|
20
|
-
<Breadcrumb.Item current>ООО «Север»</Breadcrumb.Item>
|
|
21
14
|
</Breadcrumb.Root>
|
|
15
|
+
<AppHeader.Separator />
|
|
16
|
+
<AppHeader.Title>
|
|
17
|
+
ООО «Север»
|
|
18
|
+
<AppHeader.Description>Клиент с 2021 года · 4 сделки</AppHeader.Description>
|
|
19
|
+
</AppHeader.Title>
|
|
22
20
|
</AppHeader.Start>
|
|
23
21
|
<AppHeader.Actions>
|
|
24
22
|
<Button.Root variant="soft" tone="neutral">
|
|
25
|
-
|
|
23
|
+
<Button.Icon>
|
|
24
|
+
<Icon name="action.send" />
|
|
25
|
+
</Button.Icon>
|
|
26
|
+
Написать
|
|
26
27
|
</Button.Root>
|
|
27
28
|
<Button.Root variant="soft" tone="neutral" aria-label="Ещё действия">
|
|
28
29
|
<Button.Icon>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
var(--prime-shadow-raised);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
/* narrow.tsx: the same window, phone-wide, so the
|
|
15
|
+
/* narrow.tsx: the same window, phone-wide, so the title and its line of data truncate. */
|
|
16
16
|
.phone {
|
|
17
17
|
width: min(100%, var(--prime-drawer-width-s));
|
|
18
18
|
margin-inline: auto;
|
|
@@ -51,7 +51,6 @@ export default function AppHeaderInAppShellExample() {
|
|
|
51
51
|
<AppHeader.Description>128 в работе</AppHeader.Description>
|
|
52
52
|
</AppHeader.Title>
|
|
53
53
|
</AppHeader.Start>
|
|
54
|
-
<AppHeader.Search>Поиск</AppHeader.Search>
|
|
55
54
|
</AppHeader.Root>
|
|
56
55
|
<AppShell.Main>
|
|
57
56
|
<PageContent.Page>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** On a phone: the menu button opens the navigation, the
|
|
1
|
+
/** On a phone: the menu button opens the navigation, the title and its line of data truncate and the page's action keeps its icon — `AppHeader.MenuButton`, `show`. */
|
|
2
2
|
import { AppHeader, Button, Icon } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
import styles from "./examples.module.css";
|
|
@@ -11,13 +11,12 @@ export default function AppHeaderNarrowExample() {
|
|
|
11
11
|
{/* `always`: this frame is phone-wide on any screen; in an app keep the default `narrow`. */}
|
|
12
12
|
<AppHeader.MenuButton show="always" aria-expanded={false} />
|
|
13
13
|
<AppHeader.Title>
|
|
14
|
-
Заказы
|
|
15
|
-
<AppHeader.Description>128 в
|
|
14
|
+
Заказы покупателей
|
|
15
|
+
<AppHeader.Description>128 в работе · 6 ждут оплаты · 2 возврата</AppHeader.Description>
|
|
16
16
|
</AppHeader.Title>
|
|
17
17
|
</AppHeader.Start>
|
|
18
|
-
<AppHeader.Search>Поиск заказов</AppHeader.Search>
|
|
19
18
|
<AppHeader.Actions>
|
|
20
|
-
<Button.Root
|
|
19
|
+
<Button.Root aria-label="Новый заказ">
|
|
21
20
|
<Button.Icon>
|
|
22
21
|
<Icon name="action.add" />
|
|
23
22
|
</Button.Icon>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** The
|
|
1
|
+
/** The page's header: the page title with its icon and a line of data under it, the page's own buttons at the end — `AppHeader.Title`, `AppHeader.Description`, `AppHeader.Actions`. */
|
|
2
2
|
import { AppHeader, Button, Icon } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
import styles from "./examples.module.css";
|
|
@@ -10,24 +10,22 @@ export default function AppHeaderOverviewExample() {
|
|
|
10
10
|
<AppHeader.Start>
|
|
11
11
|
<AppHeader.Title>
|
|
12
12
|
<AppHeader.Icon>
|
|
13
|
-
<Icon name="
|
|
13
|
+
<Icon name="object.package" />
|
|
14
14
|
</AppHeader.Icon>
|
|
15
|
-
|
|
16
|
-
<AppHeader.Description
|
|
15
|
+
Заказы
|
|
16
|
+
<AppHeader.Description>128 в работе · 6 ждут оплаты</AppHeader.Description>
|
|
17
17
|
</AppHeader.Title>
|
|
18
18
|
</AppHeader.Start>
|
|
19
|
-
<AppHeader.Search>Поиск заказов и клиентов</AppHeader.Search>
|
|
20
19
|
<AppHeader.Actions>
|
|
21
|
-
<Button.Root variant="soft" tone="neutral" aria-label="
|
|
20
|
+
<Button.Root variant="soft" tone="neutral" aria-label="Экспорт в CSV">
|
|
22
21
|
<Button.Icon>
|
|
23
|
-
<Icon name="
|
|
22
|
+
<Icon name="action.download" />
|
|
24
23
|
</Button.Icon>
|
|
25
24
|
</Button.Root>
|
|
26
|
-
<Button.Root>
|
|
25
|
+
<Button.Root variant="soft" tone="neutral" aria-label="Ещё действия">
|
|
27
26
|
<Button.Icon>
|
|
28
|
-
<Icon name="action.
|
|
27
|
+
<Icon name="action.more" />
|
|
29
28
|
</Button.Icon>
|
|
30
|
-
Новый заказ
|
|
31
29
|
</Button.Root>
|
|
32
30
|
</AppHeader.Actions>
|
|
33
31
|
</AppHeader.Root>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** The header carries the page: the title is the page heading, the page tools (sections, the period, the primary action) are its second row and lay themselves out from its width — `AppHeader.Title`, `
|
|
1
|
+
/** The header carries the page: the title is the page heading with a line of data, the page tools (sections, the period, the primary action) are its second row and lay themselves out from its width — `AppHeader.Title`, `AppHeader.Tools`. */
|
|
2
2
|
import { AppHeader, Button, Icon, PageToolbar, SegmentedControl, Select } from "prime-ui-kit";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
@@ -24,18 +24,11 @@ export default function AppHeaderPageTitleExample() {
|
|
|
24
24
|
<div className={styles.window}>
|
|
25
25
|
<AppHeader.Root>
|
|
26
26
|
<AppHeader.Start>
|
|
27
|
-
<AppHeader.Title
|
|
27
|
+
<AppHeader.Title>
|
|
28
28
|
Сделки
|
|
29
|
-
<AppHeader.Description
|
|
29
|
+
<AppHeader.Description>24 сделки в работе · 8,2 млн ₽</AppHeader.Description>
|
|
30
30
|
</AppHeader.Title>
|
|
31
31
|
</AppHeader.Start>
|
|
32
|
-
<AppHeader.Actions>
|
|
33
|
-
<Button.Root variant="soft" tone="neutral" aria-label="Уведомления">
|
|
34
|
-
<Button.Icon>
|
|
35
|
-
<Icon name="object.bell" />
|
|
36
|
-
</Button.Icon>
|
|
37
|
-
</Button.Root>
|
|
38
|
-
</AppHeader.Actions>
|
|
39
32
|
<AppHeader.Tools>
|
|
40
33
|
<PageToolbar.Root aria-label="Сделки">
|
|
41
34
|
<PageToolbar.Sections>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
## When not to use
|
|
13
13
|
- The navigation itself → use [Sidebar](../sidebar/COMPONENT.md) inside `AppShell.Nav`, [BottomNav](../bottom-nav/COMPONENT.md) inside `AppShell.Footer`.
|
|
14
|
-
- The top bar (title,
|
|
14
|
+
- The page's top bar (the page title, its tools, the menu button) → use [AppHeader](../app-header/COMPONENT.md) as a child of Root.
|
|
15
15
|
- Page heading, actions and sections inside main → use [PageContent](../../components/page-content/COMPONENT.md).
|
|
16
16
|
- A temporary side panel over the page → use [Drawer](../../components/drawer/COMPONENT.md).
|
|
17
17
|
- A scroll region inside a page → use [ScrollContainer](../../components/scroll-container/COMPONENT.md).
|
|
@@ -98,7 +98,7 @@ Every child of Root that is not `AppShell.Nav` is placed into the content panel.
|
|
|
98
98
|
|---|---|---|---|
|
|
99
99
|
| with `AppShell.Nav` | Two columns: a rail one layer above the page + the panel that is the page | Apps with navigation | |
|
|
100
100
|
| without Nav | Panel takes the full width | Single-page tools, auth screens | |
|
|
101
|
-
| with `AppHeader.Root` | Sticky bar at the top of the panel |
|
|
101
|
+
| with `AppHeader.Root` | Sticky bar at the top of the panel | The page title (or the path and the record), the page's tools and buttons, the mobile menu button | |
|
|
102
102
|
| with `AppShell.Footer` | Sticky bar at the bottom of the panel, shown while no navigation column is on screen | BottomNav on a phone | |
|
|
103
103
|
|
|
104
104
|
`AppShell.Template` with `nav={<Sidebar.Root …/>}` and `PageContent` inside is the standard app; `contentWidth="contained"` + `PageContent.Root maxWidth="readable"` for docs and articles.
|
|
@@ -138,10 +138,11 @@ No `labels`.
|
|
|
138
138
|
## Examples
|
|
139
139
|
| Example | Shows |
|
|
140
140
|
|---|---|
|
|
141
|
-
| [overview.tsx](examples/overview.tsx) | The app frame: Sidebar in the nav column,
|
|
141
|
+
| [overview.tsx](examples/overview.tsx) | The app frame: Sidebar in the nav column, the page title and its action in the AppHeader, the page in main; only main scrolls — `fillViewport`. |
|
|
142
142
|
| [contained.tsx](examples/contained.tsx) | A shell without navigation whose main column is centred and capped for long reads — `contentWidth`. |
|
|
143
143
|
| [footer.tsx](examples/footer.tsx) | A phone app without a Sidebar: the bar in the footer stays at the bottom while main scrolls under it — `AppShell.Footer`. |
|
|
144
144
|
| [template.tsx](examples/template.tsx) | Root, nav, header and main in one component; main scrolls back to the top whenever the page changes — `AppShell.Template` with `scrollResetKey`. |
|
|
145
|
+
| [screen.tsx](examples/screen.tsx) | The app frame for desktop and phone: the Sidebar rail on a wide screen, the floating BottomNav in the footer on a phone, the AppHeader with the menu button, the page title with a line of data, and a simple home page that swaps with the current section — `fillViewport`, `scrollResetKey`. |
|
|
145
146
|
|
|
146
147
|
## Mistakes
|
|
147
148
|
- Adding padding around the page content → Main already has the gutters.
|