prime-ui-kit 0.13.1 → 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 +20 -20
- package/dist/chunks/{chunk-XNOJEX55.js → chunk-2IKH55MI.js} +1 -1
- package/dist/chunks/{chunk-JV2KB5JZ.js → chunk-THFZIHKU.js} +3761 -3041
- package/dist/chunks/{chunk-PK2GC77E.js → chunk-XJAVS6FH.js} +213 -188
- package/dist/color-picker.js +2 -2
- package/dist/components/banner/Banner.d.ts +5 -2
- package/dist/components/chart-frame/ChartFrame.d.ts +19 -6
- package/dist/components/chat/Chat.d.ts +2 -2
- package/dist/components/chat/ChatPinned.d.ts +2 -2
- package/dist/components/chat/MessageList.d.ts +1 -1
- package/dist/components/chat/chatContext.d.ts +1 -1
- package/dist/components/dnd/Dnd.d.ts +1 -1
- package/dist/components/field-list/FieldList.d.ts +90 -0
- package/dist/components/index.d.ts +3 -1
- package/dist/components/input/Input.d.ts +2 -2
- package/dist/components/kanban/Kanban.d.ts +6 -3
- package/dist/components/login-form/LoginForm.d.ts +5 -1
- package/dist/components/page-content/PageContent.d.ts +55 -4
- package/dist/components/sparkline/Sparkline.d.ts +64 -15
- package/dist/components/sparkline/geometry.d.ts +26 -0
- package/dist/components/tooltip/Tooltip.d.ts +5 -2
- package/dist/hooks/usePosition.d.ts +15 -4
- package/dist/index.css +1 -1
- package/dist/index.js +4 -2
- package/dist/internal/ChartTooltip.d.ts +26 -0
- package/dist/internal/FieldAction.d.ts +6 -7
- package/dist/internal/fieldCell.d.ts +21 -0
- package/dist/internal/messageList.d.ts +2 -2
- package/dist/internal/palette.d.ts +7 -0
- 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 +32 -20
- package/dist/skill/anti-slop.md +77 -4
- package/dist/skill/api-contract.md +2 -2
- package/dist/skill/cheatsheet.md +33 -7
- package/dist/skill/checklist.md +28 -6
- package/dist/skill/choosing.md +17 -14
- package/dist/skill/components.md +9 -15
- package/dist/skill/composition.md +301 -61
- package/dist/skill/foundations.md +9 -7
- package/dist/skill/layouts.md +70 -37
- package/dist/skill/reference/components/avatar/COMPONENT.md +4 -4
- package/dist/skill/reference/components/avatar/examples/presence.tsx +1 -1
- package/dist/skill/reference/components/avatar/examples/states.tsx +5 -5
- 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/COMPONENT.md +6 -6
- package/dist/skill/reference/components/banner/examples/dismissible.tsx +22 -11
- package/dist/skill/reference/components/banner/examples/examples.module.css +4 -8
- package/dist/skill/reference/components/banner/examples/narrow.tsx +1 -1
- package/dist/skill/reference/components/banner/examples/page-strip.tsx +16 -22
- package/dist/skill/reference/components/breadcrumb/COMPONENT.md +5 -4
- package/dist/skill/reference/components/breadcrumb/examples/ellipsis.tsx +2 -2
- package/dist/skill/reference/components/breadcrumb/examples/overflow.tsx +1 -1
- 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 +7 -5
- package/dist/skill/reference/components/card/examples/examples.module.css +0 -28
- package/dist/skill/reference/components/card/examples/kpi-media.tsx +13 -11
- package/dist/skill/reference/components/card/examples/narrow.tsx +1 -1
- package/dist/skill/reference/components/card/examples/panel-chart.tsx +45 -22
- package/dist/skill/reference/components/card/examples/screen.module.css +14 -0
- 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 +12 -8
- 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/chart-frame/examples/tooltip.tsx +20 -24
- package/dist/skill/reference/components/chat/COMPONENT.md +6 -4
- 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} +187 -350
- package/dist/skill/reference/components/chat/examples/search.tsx +1 -1
- package/dist/skill/reference/components/chat-list/COMPONENT.md +2 -1
- 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 +37 -9
- 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 +6 -5
- 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/color-swatches/COMPONENT.md +1 -0
- 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/{patterns/screen-states.module.css → reference/components/crossfade/examples/screen.module.css} +3 -17
- 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 +6 -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 -12
- 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 +7 -5
- 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 +165 -0
- package/dist/skill/reference/components/field-list/examples/base-row.tsx +76 -0
- package/dist/skill/reference/components/field-list/examples/controlled.tsx +72 -0
- package/dist/skill/reference/components/field-list/examples/errors.tsx +88 -0
- package/dist/skill/reference/components/field-list/examples/examples.module.css +34 -0
- package/dist/skill/reference/components/field-list/examples/limits.tsx +55 -0
- package/dist/skill/reference/components/field-list/examples/locked.tsx +139 -0
- package/dist/skill/reference/components/field-list/examples/narrow.tsx +68 -0
- package/dist/skill/reference/components/field-list/examples/overview.tsx +66 -0
- package/dist/skill/reference/components/field-list/examples/reorder.tsx +42 -0
- package/dist/skill/reference/components/field-list/examples/screen.module.css +18 -0
- package/dist/skill/reference/components/field-list/examples/screen.tsx +316 -0
- package/dist/skill/reference/components/field-list/examples/sizes.tsx +42 -0
- package/dist/skill/reference/components/field-list/examples/states.tsx +51 -0
- 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 -23
- 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 +2 -13
- 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 +16 -11
- package/dist/skill/reference/components/kanban/examples/columns.tsx +8 -5
- package/dist/skill/reference/components/kanban/examples/limits.tsx +2 -1
- 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} +132 -172
- package/dist/skill/reference/components/kanban/examples/states.tsx +17 -6
- package/dist/skill/reference/components/kanban/examples/variants.tsx +16 -8
- package/dist/skill/reference/components/list/COMPONENT.md +1 -1
- 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 +3 -3
- package/dist/skill/reference/components/media-viewer/examples/dismiss.tsx +5 -1
- package/dist/skill/reference/components/message/COMPONENT.md +6 -5
- 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 +2 -1
- package/dist/skill/reference/components/notification/examples/dismiss.tsx +2 -2
- package/dist/skill/reference/components/page-content/COMPONENT.md +71 -14
- package/dist/skill/reference/components/page-content/examples/grid.tsx +107 -0
- package/dist/skill/reference/components/page-content/examples/list-detail.tsx +0 -3
- package/dist/skill/reference/components/page-content/examples/overview.tsx +2 -2
- package/dist/skill/{patterns/settings-page.module.css → reference/components/page-content/examples/screen.module.css} +1 -21
- package/dist/skill/{patterns/settings-page.tsx → reference/components/page-content/examples/screen.tsx} +61 -82
- package/dist/skill/reference/components/page-content/examples/sections.tsx +81 -0
- package/dist/skill/reference/components/page-content/examples/variants.tsx +4 -11
- package/dist/skill/reference/components/page-toolbar/COMPONENT.md +18 -16
- 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 +3 -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 +5 -3
- package/dist/skill/reference/components/select/examples/examples.module.css +2 -7
- package/dist/skill/reference/components/select/examples/icon-only.tsx +38 -0
- 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 +83 -30
- package/dist/skill/reference/components/sparkline/examples/compact.tsx +1 -1
- package/dist/skill/reference/components/sparkline/examples/curve.tsx +28 -0
- package/dist/skill/reference/components/sparkline/examples/gaps.tsx +33 -0
- package/dist/skill/reference/components/sparkline/examples/overview.tsx +11 -2
- package/dist/skill/reference/components/sparkline/examples/period.tsx +7 -2
- package/dist/skill/reference/components/sparkline/examples/reference.tsx +38 -0
- package/dist/skill/reference/components/sparkline/examples/variants.tsx +2 -2
- package/dist/skill/reference/components/tabs/COMPONENT.md +1 -1
- package/dist/skill/reference/components/tabs/examples/examples.module.css +0 -6
- package/dist/skill/reference/components/tabs/examples/in-drawer.tsx +11 -13
- 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/examples.module.css +0 -8
- package/dist/skill/reference/components/timeline/examples/links.tsx +55 -14
- package/dist/skill/reference/components/timeline/examples/narrow.tsx +2 -2
- package/dist/skill/reference/components/timeline/examples/sizes.tsx +3 -3
- package/dist/skill/reference/components/timeline/examples/variants.tsx +4 -4
- package/dist/skill/reference/components/tooltip/COMPONENT.md +7 -5
- package/dist/skill/reference/components/tooltip/examples/placement.tsx +2 -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 +3 -3
- 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 +3 -3
- 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 +2 -3
- 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 +5 -4
- package/dist/skill/reference/layout/app-shell/examples/footer.tsx +2 -2
- package/dist/skill/reference/layout/app-shell/examples/overview.tsx +17 -32
- package/dist/skill/{patterns/app-shell.module.css → reference/layout/app-shell/examples/screen.module.css} +1 -8
- package/dist/skill/reference/layout/app-shell/examples/screen.tsx +262 -0
- package/dist/skill/reference/layout/app-shell/examples/template.tsx +31 -11
- package/dist/skill/reference/layout/bottom-nav/examples/floating-action.tsx +2 -2
- package/dist/skill/reference/layout/bottom-nav/examples/floating.tsx +2 -2
- package/dist/skill/reference/layout/bottom-nav/examples/in-app-shell.tsx +2 -2
- 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 +7 -5
- package/dist/skill/ux.md +145 -0
- package/dist/tokens/semantic.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/avatar/COMPONENT.md +4 -4
- package/src/components/avatar/examples/presence.tsx +1 -1
- package/src/components/avatar/examples/states.tsx +5 -5
- 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/COMPONENT.md +6 -6
- package/src/components/banner/examples/dismissible.tsx +22 -11
- package/src/components/banner/examples/examples.module.css +4 -8
- package/src/components/banner/examples/narrow.tsx +1 -1
- package/src/components/banner/examples/page-strip.tsx +16 -22
- package/src/components/breadcrumb/COMPONENT.md +5 -4
- package/src/components/breadcrumb/examples/ellipsis.tsx +2 -2
- package/src/components/breadcrumb/examples/overflow.tsx +1 -1
- 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 +7 -5
- package/src/components/card/examples/examples.module.css +0 -28
- package/src/components/card/examples/kpi-media.tsx +13 -11
- package/src/components/card/examples/narrow.tsx +1 -1
- package/src/components/card/examples/panel-chart.tsx +45 -22
- 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 +12 -8
- package/src/components/chart-frame/examples/fill-height.tsx +119 -0
- package/src/components/chart-frame/examples/states.tsx +3 -1
- package/src/components/chart-frame/examples/tooltip.tsx +20 -24
- package/src/components/chat/COMPONENT.md +6 -4
- 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/examples/search.tsx +1 -1
- package/src/components/chat-list/COMPONENT.md +2 -1
- 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 +37 -9
- 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 +6 -5
- 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/color-swatches/COMPONENT.md +1 -0
- 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 +6 -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 +7 -5
- 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 +165 -0
- package/src/components/field-list/examples/base-row.tsx +76 -0
- package/src/components/field-list/examples/controlled.tsx +72 -0
- package/src/components/field-list/examples/errors.tsx +88 -0
- package/src/components/field-list/examples/examples.module.css +34 -0
- package/src/components/field-list/examples/limits.tsx +55 -0
- package/src/components/field-list/examples/locked.tsx +139 -0
- package/src/components/field-list/examples/narrow.tsx +68 -0
- package/src/components/field-list/examples/overview.tsx +66 -0
- package/src/components/field-list/examples/reorder.tsx +42 -0
- package/src/components/field-list/examples/screen.module.css +18 -0
- package/src/components/field-list/examples/screen.tsx +316 -0
- package/src/components/field-list/examples/sizes.tsx +42 -0
- package/src/components/field-list/examples/states.tsx +51 -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 +2 -13
- 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 +16 -11
- package/src/components/kanban/examples/columns.tsx +8 -5
- package/src/components/kanban/examples/limits.tsx +2 -1
- 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/kanban/examples/variants.tsx +16 -8
- package/src/components/list/COMPONENT.md +1 -1
- 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 +3 -3
- package/src/components/media-viewer/examples/dismiss.tsx +5 -1
- package/src/components/message/COMPONENT.md +6 -5
- 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 +2 -1
- package/src/components/notification/examples/dismiss.tsx +2 -2
- package/src/components/page-content/COMPONENT.md +71 -14
- package/src/components/page-content/examples/grid.tsx +107 -0
- package/src/components/page-content/examples/list-detail.tsx +0 -3
- package/src/components/page-content/examples/overview.tsx +2 -2
- 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/sections.tsx +81 -0
- package/src/components/page-content/examples/variants.tsx +4 -11
- package/src/components/page-toolbar/COMPONENT.md +18 -16
- 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 +3 -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 +5 -3
- package/src/components/select/examples/examples.module.css +2 -7
- package/src/components/select/examples/icon-only.tsx +38 -0
- 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 +83 -30
- package/src/components/sparkline/examples/compact.tsx +1 -1
- package/src/components/sparkline/examples/curve.tsx +28 -0
- package/src/components/sparkline/examples/gaps.tsx +33 -0
- package/src/components/sparkline/examples/overview.tsx +11 -2
- package/src/components/sparkline/examples/period.tsx +7 -2
- package/src/components/sparkline/examples/reference.tsx +38 -0
- package/src/components/sparkline/examples/variants.tsx +2 -2
- package/src/components/tabs/COMPONENT.md +1 -1
- package/src/components/tabs/examples/examples.module.css +0 -6
- package/src/components/tabs/examples/in-drawer.tsx +11 -13
- 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/examples.module.css +0 -8
- package/src/components/timeline/examples/links.tsx +55 -14
- package/src/components/timeline/examples/narrow.tsx +2 -2
- package/src/components/timeline/examples/sizes.tsx +3 -3
- package/src/components/timeline/examples/variants.tsx +4 -4
- package/src/components/tooltip/COMPONENT.md +7 -5
- package/src/components/tooltip/examples/placement.tsx +2 -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 +3 -3
- 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 +3 -3
- 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 +2 -3
- 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 +5 -4
- package/src/layout/app-shell/examples/footer.tsx +2 -2
- package/src/layout/app-shell/examples/overview.tsx +17 -32
- 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 +31 -11
- package/src/layout/bottom-nav/examples/floating-action.tsx +2 -2
- package/src/layout/bottom-nav/examples/floating.tsx +2 -2
- package/src/layout/bottom-nav/examples/in-app-shell.tsx +2 -2
- 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/src/styles/theme-light.css +1 -0
- package/dist/skill/patterns/app-shell.tsx +0 -301
- package/dist/skill/patterns/chat.module.css +0 -8
- package/dist/skill/patterns/dashboard.module.css +0 -44
- package/dist/skill/patterns/dashboard.tsx +0 -326
- package/dist/skill/patterns/detail-page.tsx +0 -209
- 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 -638
- package/dist/skill/patterns/schedule.module.css +0 -22
- package/dist/skill/patterns/screen-states.tsx +0 -186
- /package/dist/skill/{patterns/form-drawer.module.css → reference/components/drawer/examples/screen.module.css} +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/** A page with titled sections: tiles of one screen close together, a new topic set off by air, a link at the end of the heading, a heading column beside a panel — `PageContent.Section`, `label`, `description`, `PageContent.Actions`, `layout`. */
|
|
2
|
+
import {
|
|
3
|
+
Card,
|
|
4
|
+
DataTable,
|
|
5
|
+
type DataTableColumn,
|
|
6
|
+
LinkButton,
|
|
7
|
+
PageContent,
|
|
8
|
+
Typography,
|
|
9
|
+
} from "prime-ui-kit";
|
|
10
|
+
|
|
11
|
+
import styles from "./examples.module.css";
|
|
12
|
+
|
|
13
|
+
type Invoice = { id: string; client: string; amount: number };
|
|
14
|
+
|
|
15
|
+
const INVOICES: Invoice[] = [
|
|
16
|
+
{ id: "СЧ-1042", client: "ООО «Север»", amount: 184_000 },
|
|
17
|
+
{ id: "СЧ-1041", client: "ИП Лаптева", amount: 42_500 },
|
|
18
|
+
{ id: "СЧ-1039", client: "АО «Техносфера»", amount: 610_000 },
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
const MONEY = new Intl.NumberFormat("ru-RU", {
|
|
22
|
+
style: "currency",
|
|
23
|
+
currency: "RUB",
|
|
24
|
+
maximumFractionDigits: 0,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const COLUMNS: DataTableColumn<Invoice>[] = [
|
|
28
|
+
{ id: "id", header: "Счёт", cell: (row) => row.id },
|
|
29
|
+
{ id: "client", header: "Клиент", cell: (row) => row.client },
|
|
30
|
+
{
|
|
31
|
+
id: "amount",
|
|
32
|
+
header: "Сумма",
|
|
33
|
+
numeric: true,
|
|
34
|
+
headerAlign: "end",
|
|
35
|
+
cell: (row) => MONEY.format(row.amount),
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
export default function PageContentSectionsExample() {
|
|
40
|
+
return (
|
|
41
|
+
<div className={styles.main}>
|
|
42
|
+
<PageContent.Body>
|
|
43
|
+
<PageContent.Grid>
|
|
44
|
+
<PageContent.Cell span={6}>
|
|
45
|
+
<Card.Root variant="stat-trend">
|
|
46
|
+
<Card.Label>Выставлено</Card.Label>
|
|
47
|
+
<Card.Value>2,4 млн ₽</Card.Value>
|
|
48
|
+
<Card.Delta tone="success">+9% к сентябрю</Card.Delta>
|
|
49
|
+
</Card.Root>
|
|
50
|
+
</PageContent.Cell>
|
|
51
|
+
<PageContent.Cell span={6}>
|
|
52
|
+
<Card.Root variant="stat-trend">
|
|
53
|
+
<Card.Label>Оплачено</Card.Label>
|
|
54
|
+
<Card.Value>1,9 млн ₽</Card.Value>
|
|
55
|
+
<Card.Delta tone="neutral">79% выставленного</Card.Delta>
|
|
56
|
+
</Card.Root>
|
|
57
|
+
</PageContent.Cell>
|
|
58
|
+
</PageContent.Grid>
|
|
59
|
+
<PageContent.Section label="Последние счета" description="Три последних за октябрь">
|
|
60
|
+
<PageContent.Actions>
|
|
61
|
+
<LinkButton href="#invoices">Все счета</LinkButton>
|
|
62
|
+
</PageContent.Actions>
|
|
63
|
+
<DataTable columns={COLUMNS} rows={INVOICES} getRowKey={(row) => row.id} paging="none" />
|
|
64
|
+
</PageContent.Section>
|
|
65
|
+
<PageContent.Section
|
|
66
|
+
layout="aside"
|
|
67
|
+
label="Реквизиты в счетах"
|
|
68
|
+
description="Попадают в каждый новый счёт."
|
|
69
|
+
>
|
|
70
|
+
<Card.Root variant="panel">
|
|
71
|
+
<Card.Body>
|
|
72
|
+
<Typography variant="body-m" tone="secondary">
|
|
73
|
+
ООО «Прайм Софт», ИНН 7701234567, р/с в Т-Банке.
|
|
74
|
+
</Typography>
|
|
75
|
+
</Card.Body>
|
|
76
|
+
</Card.Root>
|
|
77
|
+
</PageContent.Section>
|
|
78
|
+
</PageContent.Body>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
@@ -4,24 +4,17 @@ import { Card, PageContent, Typography } from "prime-ui-kit";
|
|
|
4
4
|
import styles from "./examples.module.css";
|
|
5
5
|
|
|
6
6
|
const WIDTHS = [
|
|
7
|
-
{ value: "full",
|
|
8
|
-
{ value: "wide",
|
|
9
|
-
{
|
|
10
|
-
value: "readable",
|
|
11
|
-
title: "Условия использования",
|
|
12
|
-
text: "Не шире колонки для чтения, по центру.",
|
|
13
|
-
},
|
|
7
|
+
{ value: "full", text: "Сделки: колонка занимает всю ширину main." },
|
|
8
|
+
{ value: "wide", text: "Дашборд продаж: не шире ширины контента, по центру." },
|
|
9
|
+
{ value: "readable", text: "Условия использования: не шире колонки для чтения, по центру." },
|
|
14
10
|
] as const;
|
|
15
11
|
|
|
16
12
|
export default function PageContentVariantsExample() {
|
|
17
13
|
return (
|
|
18
14
|
<div className={styles.main}>
|
|
19
15
|
<div className={styles.stack}>
|
|
20
|
-
{WIDTHS.map(({ value,
|
|
16
|
+
{WIDTHS.map(({ value, text }) => (
|
|
21
17
|
<PageContent.Root key={value} maxWidth={value}>
|
|
22
|
-
<PageContent.Header>
|
|
23
|
-
<PageContent.Title>{title}</PageContent.Title>
|
|
24
|
-
</PageContent.Header>
|
|
25
18
|
<PageContent.Body>
|
|
26
19
|
<Card.Root>
|
|
27
20
|
<Card.Body>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Category:** page
|
|
4
4
|
**Kind:** layout
|
|
5
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
|
|
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
7
|
|
|
8
8
|
## When to use
|
|
9
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.
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
- Any page that has to work from 320px with the same controls as on desktop — nothing is hidden, the slots only move.
|
|
12
12
|
|
|
13
13
|
## When not to use
|
|
14
|
-
-
|
|
14
|
+
- One or two buttons of the page and nothing else → `AppHeader.Actions` in the [AppHeader](../../layout/app-header/COMPONENT.md) title row.
|
|
15
15
|
- Tools that belong to one table → the DataTable `toolbar` slot.
|
|
16
16
|
- Switching panels inside a card or a section → [Tabs](../tabs/COMPONENT.md).
|
|
17
17
|
- App-level navigation → [Sidebar](../../layout/sidebar/COMPONENT.md).
|
|
@@ -28,7 +28,7 @@ PageToolbar.Root container: its own width picks the layout
|
|
|
28
28
|
├─ PageToolbar.Sections sections of the page: a fullWidth SegmentedControl with counts
|
|
29
29
|
├─ PageToolbar.View period, table / cards, columns
|
|
30
30
|
├─ PageToolbar.Actions the primary action (and its secondary twin, e.g. «Отменить»)
|
|
31
|
-
└─ PageToolbar.Chips active filters: SmartFilter.Chips, a row
|
|
31
|
+
└─ PageToolbar.Chips active filters: SmartFilter.Chips, a row under the top row
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
## API
|
|
@@ -50,7 +50,7 @@ PageToolbar.Root container: its own width picks the layout
|
|
|
50
50
|
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children`, `className` and the other div attributes. |
|
|
51
51
|
|
|
52
52
|
### PageToolbar.Tools
|
|
53
|
-
`ref` → `HTMLDivElement`. Search and filter button (`SmartFilter.Toolbar`): always the first slot and the stretchy one
|
|
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
54
|
|
|
55
55
|
| Prop | Type | Default | Description |
|
|
56
56
|
|---|---|---|---|
|
|
@@ -64,14 +64,14 @@ PageToolbar.Root container: its own width picks the layout
|
|
|
64
64
|
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children`, `className` and the other div attributes. |
|
|
65
65
|
|
|
66
66
|
### PageToolbar.Actions
|
|
67
|
-
`ref` → `HTMLDivElement`. The primary action of the page: at the end of the top row
|
|
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
68
|
|
|
69
69
|
| Prop | Type | Default | Description |
|
|
70
70
|
|---|---|---|---|
|
|
71
71
|
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children`, `className` and the other div attributes. |
|
|
72
72
|
|
|
73
73
|
### PageToolbar.Chips
|
|
74
|
-
`ref` → `HTMLDivElement`. Active filters (`SmartFilter.Chips`) in their own row
|
|
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
75
|
|
|
76
76
|
| Prop | Type | Default | Description |
|
|
77
77
|
|---|---|---|---|
|
|
@@ -83,26 +83,28 @@ PageToolbar has no variants: the layout follows the toolbar's width.
|
|
|
83
83
|
### Layout by width
|
|
84
84
|
| Toolbar width | Looks like | Default |
|
|
85
85
|
|---|---|---|
|
|
86
|
-
| `≥ 56rem` | one row that never wraps: Tools (stretch
|
|
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
87
|
| `< 56rem` | rows: Tools (stretch) + Actions; Chips; Sections (full row); View (full row) | yes (mobile first) |
|
|
88
|
-
|
|
|
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 | |
|
|
89
90
|
|
|
90
91
|
## States
|
|
91
92
|
| State | Driven by | DOM |
|
|
92
93
|
|---|---|---|
|
|
93
94
|
| wide | container ≥ 56rem | one flex row, no wrapping; Chips rendered under the bar |
|
|
94
|
-
| narrow | container < 56rem |
|
|
95
|
-
|
|
|
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 |
|
|
96
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 |
|
|
97
99
|
| no chips | `PageToolbar.Chips` empty (`SmartFilter.Chips` renders nothing) | the chips row takes no space |
|
|
98
100
|
|
|
99
101
|
## Layout & spacing
|
|
100
|
-
- 8 inside a slot. No padding or fill of its own: it
|
|
101
|
-
- The order is fixed: search and filter first, then the sections, the view and the primary action; the active filters
|
|
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.
|
|
102
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.
|
|
103
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.
|
|
104
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">`.
|
|
105
|
-
- On a phone the primary action
|
|
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.
|
|
106
108
|
- The toolbar breaks by its own width, so it behaves the same with the sidebar open or closed.
|
|
107
109
|
|
|
108
110
|
## Accessibility
|
|
@@ -111,9 +113,9 @@ PageToolbar has no variants: the layout follows the toolbar's width.
|
|
|
111
113
|
No keyboard interaction.
|
|
112
114
|
|
|
113
115
|
### ARIA
|
|
114
|
-
- A plain `<div>`:
|
|
116
|
+
- A plain `<div>`: when a page has more than one panel, give each `role="group"` and an `aria-label` (a name on a `<div>` without a role is ignored by assistive tech).
|
|
115
117
|
- Slots move only visually (`order`); the Tab order is the JSX order. Write the slots in the reading order of the wide layout — Tools, Sections, View, Actions, Chips. In the narrow layout the action is shown beside the tools but reached after the view.
|
|
116
|
-
- An icon-only primary action
|
|
118
|
+
- An icon-only primary action carries `aria-label`.
|
|
117
119
|
|
|
118
120
|
### Labels
|
|
119
121
|
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
@@ -126,7 +128,7 @@ No `labels`.
|
|
|
126
128
|
| [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 right under the search — `PageToolbar.Tools`, `PageToolbar.Sections`, `PageToolbar.View`, `PageToolbar.Actions`, `PageToolbar.Chips`. |
|
|
127
129
|
| [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`. |
|
|
128
130
|
| [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`. |
|
|
129
|
-
| [narrow.tsx](examples/narrow.tsx) | A phone-width column: search
|
|
131
|
+
| [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`. |
|
|
130
132
|
|
|
131
133
|
## Mistakes
|
|
132
134
|
- A hand-built flex row of tabs, search and buttons with `flex-wrap` → rows wrap «as they come», the action drifts down; use `PageToolbar`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** A phone-width column: search
|
|
1
|
+
/** 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`. */
|
|
2
2
|
import {
|
|
3
3
|
Button,
|
|
4
4
|
Icon,
|
|
@@ -38,7 +38,9 @@ const FIELDS: SmartFilterField[] = [
|
|
|
38
38
|
export default function PageToolbarNarrowExample() {
|
|
39
39
|
const [section, setSection] = React.useState("all");
|
|
40
40
|
const [period, setPeriod] = React.useState("7d");
|
|
41
|
-
const [filter, setFilter] = React.useState<SmartFilterValue>({
|
|
41
|
+
const [filter, setFilter] = React.useState<SmartFilterValue>({
|
|
42
|
+
city: { include: ["msk"], exclude: [] },
|
|
43
|
+
});
|
|
42
44
|
const [search, setSearch] = React.useState("");
|
|
43
45
|
|
|
44
46
|
return (
|
|
@@ -87,10 +89,11 @@ export default function PageToolbarNarrowExample() {
|
|
|
87
89
|
</Select.Root>
|
|
88
90
|
</PageToolbar.View>
|
|
89
91
|
<PageToolbar.Actions>
|
|
90
|
-
<Button.Root
|
|
92
|
+
<Button.Root>
|
|
91
93
|
<Button.Icon>
|
|
92
94
|
<Icon name="action.add" />
|
|
93
95
|
</Button.Icon>
|
|
96
|
+
Новый заказ
|
|
94
97
|
</Button.Root>
|
|
95
98
|
</PageToolbar.Actions>
|
|
96
99
|
<PageToolbar.Chips>
|
|
@@ -16,36 +16,36 @@ export default function PaginationControlledExample() {
|
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
18
|
<Card.Root>
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
19
|
+
<Card.Body>
|
|
20
|
+
<div className={styles.footer}>
|
|
21
|
+
<Typography as="span" variant="body-s" tone="secondary">
|
|
22
|
+
Счета {from}–{to} из {TOTAL_INVOICES}
|
|
23
|
+
</Typography>
|
|
24
|
+
<div className={styles.controls}>
|
|
25
|
+
<Select.Root
|
|
26
|
+
value={perPage}
|
|
27
|
+
onValueChange={(next) => {
|
|
28
|
+
setPerPage(next);
|
|
29
|
+
setPage(1);
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
<Select.Trigger aria-label="Строк на странице">
|
|
33
|
+
<Select.Value />
|
|
34
|
+
</Select.Trigger>
|
|
35
|
+
<Select.Content>
|
|
36
|
+
<Select.Item value="10">10 строк</Select.Item>
|
|
37
|
+
<Select.Item value="25">25 строк</Select.Item>
|
|
38
|
+
<Select.Item value="50">50 строк</Select.Item>
|
|
39
|
+
</Select.Content>
|
|
40
|
+
</Select.Root>
|
|
41
|
+
<Pagination
|
|
42
|
+
value={page}
|
|
43
|
+
onValueChange={setPage}
|
|
44
|
+
totalPages={Math.ceil(TOTAL_INVOICES / pageSize)}
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
47
|
</div>
|
|
48
|
-
</
|
|
48
|
+
</Card.Body>
|
|
49
49
|
</Card.Root>
|
|
50
50
|
);
|
|
51
51
|
}
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
/* A list footer in a Card: the range on the left, rows per page and pages on the right; wraps when narrow. */
|
|
4
4
|
.footer {
|
|
5
|
-
box-sizing: border-box;
|
|
6
5
|
display: flex;
|
|
7
6
|
flex-wrap: wrap;
|
|
8
7
|
align-items: center;
|
|
9
8
|
justify-content: space-between;
|
|
10
9
|
gap: var(--prime-space-3);
|
|
11
|
-
padding: var(--prime-space-3) var(--prime-space-4);
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
.controls {
|
|
@@ -177,7 +177,7 @@ No keyboard interaction.
|
|
|
177
177
|
| [sizes.tsx](examples/sizes.tsx) | Every tier: the line grows from 4 to 8 px like the Slider track — `size`. |
|
|
178
178
|
| [states.tsx](examples/states.tsx) | Loading takes the bar's own geometry, so the data lands without a jump — `loading`. |
|
|
179
179
|
| [custom-max.tsx](examples/custom-max.tsx) | A scale of steps instead of percent: 3 of 5 profile steps — `max`. |
|
|
180
|
-
| [segments.tsx](examples/segments.tsx) | Parts of a whole in one bar: joined or separate pills, free capacity up to `max` and an empty list — `segments`, `segmentGap`, `max`. |
|
|
180
|
+
| [segments.tsx](examples/segments.tsx) | Parts of a whole in one bar: joined or separate pills, free capacity up to `max` and an empty list with its own spoken text — `segments`, `segmentGap`, `max`, `labels`. |
|
|
181
181
|
| [legend.tsx](examples/legend.tsx) | Shares of categories in their chart colors with a legend of color · name · value · share — `color`, `legend`, `formatValue`. |
|
|
182
182
|
| [ranking.tsx](examples/ranking.tsx) | Rankings as rows of label · value · share over a bar: top cities against the leader and a funnel against its first step — `layout`, `scale`. |
|
|
183
183
|
| [steps.tsx](examples/steps.tsx) | The scale as whole cells that fill one after another: 2 of 5 onboarding steps, forward and back — `steps`, `max`. |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Parts of a whole in one bar: joined or separate pills, free capacity up to `max` and an empty list — `segments`, `segmentGap`, `max`. */
|
|
1
|
+
/** Parts of a whole in one bar: joined or separate pills, free capacity up to `max` and an empty list with its own spoken text — `segments`, `segmentGap`, `max`, `labels`. */
|
|
2
2
|
import { ProgressBar, type ProgressSegment } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
import styles from "./examples.module.css";
|
|
@@ -26,7 +26,7 @@ export default function ProgressBarSegmentsExample() {
|
|
|
26
26
|
label="Хранилище: 71 из 100 ГБ"
|
|
27
27
|
showValue
|
|
28
28
|
/>
|
|
29
|
-
<ProgressBar segments={[]} label="
|
|
29
|
+
<ProgressBar segments={[]} label="Заявки за ноябрь" labels={{ empty: "Заявок пока нет" }} />
|
|
30
30
|
</div>
|
|
31
31
|
);
|
|
32
32
|
}
|
|
@@ -171,7 +171,7 @@ No keyboard interaction.
|
|
|
171
171
|
| [states.tsx](examples/states.tsx) | Loading is a Skeleton ring of the same diameter and stroke; the number in the centre waits for the data — `loading`. |
|
|
172
172
|
| [inner-content.tsx](examples/inner-content.tsx) | The center holds a percentage, a count on its own scale or an icon — `children`, `max`. |
|
|
173
173
|
| [under-way.tsx](examples/under-way.tsx) | An import whose share is not known yet turns a quarter arc, then fills and swaps its icon; a sync turns while its share grows — `value`, `spin`, `children`. |
|
|
174
|
-
| [segments.tsx](examples/segments.tsx) | Parts of a whole clockwise from the top: a closed ring, free capacity up to `max`, separate arcs and an empty list — `segments`, `segmentGap`. |
|
|
174
|
+
| [segments.tsx](examples/segments.tsx) | Parts of a whole clockwise from the top: a closed ring, free capacity up to `max`, separate arcs and an empty list with its own spoken text — `segments`, `segmentGap`, `labels`. |
|
|
175
175
|
| [legend.tsx](examples/legend.tsx) | A ring of category shares with a legend beside it, in the categories' chart colors — `color`, `legend`, `formatValue`. |
|
|
176
176
|
|
|
177
177
|
## Mistakes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Parts of a whole clockwise from the top: a closed ring, free capacity up to `max`, separate arcs and an empty list — `segments`, `segmentGap`. */
|
|
1
|
+
/** Parts of a whole clockwise from the top: a closed ring, free capacity up to `max`, separate arcs and an empty list with its own spoken text — `segments`, `segmentGap`, `labels`. */
|
|
2
2
|
import { ProgressCircle, type ProgressSegment, Typography } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
import styles from "./examples.module.css";
|
|
@@ -54,9 +54,14 @@ export default function ProgressCircleSegmentsExample() {
|
|
|
54
54
|
</Typography>
|
|
55
55
|
</div>
|
|
56
56
|
<div className={styles.item}>
|
|
57
|
-
<ProgressCircle
|
|
57
|
+
<ProgressCircle
|
|
58
|
+
size="xl"
|
|
59
|
+
segments={[]}
|
|
60
|
+
aria-label="Заявки за ноябрь"
|
|
61
|
+
labels={{ empty: "Заявок пока нет" }}
|
|
62
|
+
/>
|
|
58
63
|
<Typography as="span" variant="caption" tone="muted">
|
|
59
|
-
|
|
64
|
+
Заявки за ноябрь
|
|
60
65
|
</Typography>
|
|
61
66
|
</div>
|
|
62
67
|
</div>
|
|
@@ -152,6 +152,7 @@ The radiogroup carries `data-size`, `data-orientation`, `aria-orientation`, `ari
|
|
|
152
152
|
| [group.tsx](examples/group.tsx) | A required group with option descriptions and the group's error under the options — `label`, `required`, `hint`, `error`. |
|
|
153
153
|
| [orientation.tsx](examples/orientation.tsx) | Options stacked in a column and laid out in a wrapping row — `orientation`. |
|
|
154
154
|
| [controlled.tsx](examples/controlled.tsx) | The parent owns the chosen plan and shows it in the hint — `value`, `onValueChange`. |
|
|
155
|
+
| [in-form.tsx](examples/in-form.tsx) | Choices of an order form: a required group shows its error after a submit without a choice, an optional one is marked — `name`, `required`, `optional`, `error`. |
|
|
155
156
|
|
|
156
157
|
## Mistakes
|
|
157
158
|
- `Radio.Root` outside `Radio.Group` → it throws; every option needs the group.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* Layout of the Radio scenarios: semantic tokens only. */
|
|
2
|
+
|
|
3
|
+
/* in-form.tsx: groups, then actions (group → actions 32). */
|
|
4
|
+
.form {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: var(--prime-space-6);
|
|
8
|
+
width: min(100%, var(--prime-modal-width-s));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.formActions {
|
|
12
|
+
display: flex;
|
|
13
|
+
margin-top: var(--prime-space-2);
|
|
14
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Choices of an order form: a required group shows its error after a submit without a choice, an optional one is marked — `name`, `required`, `optional`, `error`. */
|
|
2
|
+
import { Button, Radio } from "prime-ui-kit";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
import styles from "./examples.module.css";
|
|
6
|
+
|
|
7
|
+
export default function RadioInFormExample() {
|
|
8
|
+
const [error, setError] = React.useState<string>();
|
|
9
|
+
|
|
10
|
+
const submit = (event: React.FormEvent<HTMLFormElement>) => {
|
|
11
|
+
event.preventDefault();
|
|
12
|
+
const chosen = new FormData(event.currentTarget).get("delivery");
|
|
13
|
+
setError(chosen ? undefined : "Выберите способ доставки");
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<form className={styles.form} noValidate onSubmit={submit}>
|
|
18
|
+
<Radio.Group
|
|
19
|
+
label="Способ доставки"
|
|
20
|
+
name="delivery"
|
|
21
|
+
required
|
|
22
|
+
error={error}
|
|
23
|
+
onValueChange={() => setError(undefined)}
|
|
24
|
+
>
|
|
25
|
+
<Radio.Root value="courier">
|
|
26
|
+
<Radio.Label>Курьером до склада</Radio.Label>
|
|
27
|
+
</Radio.Root>
|
|
28
|
+
<Radio.Root value="pickup">
|
|
29
|
+
<Radio.Label>Самовывоз с терминала</Radio.Label>
|
|
30
|
+
</Radio.Root>
|
|
31
|
+
</Radio.Group>
|
|
32
|
+
<Radio.Group label="Упаковка" name="packing" optional>
|
|
33
|
+
<Radio.Root value="pallet">
|
|
34
|
+
<Radio.Label>На паллетах</Radio.Label>
|
|
35
|
+
</Radio.Root>
|
|
36
|
+
<Radio.Root value="crate">
|
|
37
|
+
<Radio.Label>В обрешётке</Radio.Label>
|
|
38
|
+
</Radio.Root>
|
|
39
|
+
</Radio.Group>
|
|
40
|
+
<div className={styles.formActions}>
|
|
41
|
+
<Button.Root type="submit">Оформить заказ</Button.Root>
|
|
42
|
+
</div>
|
|
43
|
+
</form>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -160,6 +160,7 @@ No `labels`.
|
|
|
160
160
|
| [auto-scroll.tsx](examples/auto-scroll.tsx) | A task dragged to the top or bottom edge of a scrolling list scrolls it, faster the closer it comes — `ScrollContainer`, `Dnd.Sortable`. |
|
|
161
161
|
| [overscroll.tsx](examples/overscroll.tsx) | At the end of the list the scroll passes on to the page instead of stopping — `overscrollBehavior`. |
|
|
162
162
|
| [chat.tsx](examples/chat.tsx) | A support chat pinned to its last message: a sent message keeps it at the end, scrolling up loads older ones without moving what is on screen — `anchor`, `onReachStart`. |
|
|
163
|
+
| [load-more.tsx](examples/load-more.tsx) | An order log that loads the next page as the reader nears its end, with loading lines in the rows' place — `onReachEnd`. |
|
|
163
164
|
|
|
164
165
|
## Mistakes
|
|
165
166
|
- `overflow: auto` on a plain `div` inside a flex column that never shrinks → use ScrollContainer (it sets `min-height: 0`).
|
|
@@ -22,9 +22,9 @@ export default function ScrollContainerAutoScrollExample() {
|
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
24
|
<Card.Root role="region" className={styles.card} aria-label="План проекта">
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
</
|
|
25
|
+
<Card.Header>
|
|
26
|
+
<Card.Title>План проекта</Card.Title>
|
|
27
|
+
</Card.Header>
|
|
28
28
|
<ScrollContainer>
|
|
29
29
|
<Dnd.Root>
|
|
30
30
|
<Dnd.Sortable
|
|
@@ -57,9 +57,9 @@ export default function ScrollContainerChatExample() {
|
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
59
|
<Card.Root className={styles.chat}>
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
</
|
|
60
|
+
<Card.Header>
|
|
61
|
+
<Card.Title>ООО «Гранит» · счёт № 4821</Card.Title>
|
|
62
|
+
</Card.Header>
|
|
63
63
|
<ScrollContainer
|
|
64
64
|
anchor="end"
|
|
65
65
|
onReachStart={loadOlder}
|
|
@@ -22,9 +22,12 @@ export default function ScrollContainerEdgesExample() {
|
|
|
22
22
|
<div className={styles.layout}>
|
|
23
23
|
{EDGES.map((edges) => (
|
|
24
24
|
<Card.Root key={edges} role="region" className={styles.card} aria-label={`Лента: ${edges}`}>
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
<Card.Header>
|
|
26
|
+
<Card.Title>Лента событий</Card.Title>
|
|
27
|
+
<Typography as="span" variant="caption" tone="muted">
|
|
28
|
+
{edges}
|
|
29
|
+
</Typography>
|
|
30
|
+
</Card.Header>
|
|
28
31
|
<ScrollContainer edges={edges}>
|
|
29
32
|
<ul className={styles.list}>
|
|
30
33
|
{EVENTS.map((event) => (
|
|
@@ -17,15 +17,11 @@
|
|
|
17
17
|
width: auto;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.cardTitle {
|
|
21
|
-
padding: var(--prime-space-3) var(--prime-space-4);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
20
|
.list {
|
|
25
21
|
display: flex;
|
|
26
22
|
flex-direction: column;
|
|
27
23
|
margin: 0;
|
|
28
|
-
padding:
|
|
24
|
+
padding: var(--prime-space-2) var(--prime-space-4) var(--prime-space-3);
|
|
29
25
|
list-style: none;
|
|
30
26
|
}
|
|
31
27
|
|
|
@@ -48,7 +44,7 @@
|
|
|
48
44
|
}
|
|
49
45
|
|
|
50
46
|
.messages {
|
|
51
|
-
|
|
47
|
+
min-height: 0;
|
|
52
48
|
}
|
|
53
49
|
|
|
54
50
|
/* Older messages loading: lines in the messages' geometry, at the top where they will appear. */
|
|
@@ -77,7 +73,7 @@
|
|
|
77
73
|
|
|
78
74
|
/* Two-axis scroller: the side padding lives on the scrolling element itself (foundation §7). */
|
|
79
75
|
.canvas {
|
|
80
|
-
padding:
|
|
76
|
+
padding: var(--prime-space-3) var(--prime-space-4);
|
|
81
77
|
}
|
|
82
78
|
|
|
83
79
|
.grid {
|
|
@@ -94,15 +90,6 @@
|
|
|
94
90
|
font-variant-numeric: tabular-nums;
|
|
95
91
|
}
|
|
96
92
|
|
|
97
|
-
/* lock.tsx: the title and the review button in one row above the queue. */
|
|
98
|
-
.cardHeader {
|
|
99
|
-
display: flex;
|
|
100
|
-
align-items: center;
|
|
101
|
-
justify-content: space-between;
|
|
102
|
-
gap: var(--prime-space-3);
|
|
103
|
-
padding: var(--prime-space-3) var(--prime-space-4);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
93
|
/* snap.tsx: a row of fixed-width cards; the padding keeps the edge cards' rings unclipped. */
|
|
107
94
|
.tiles {
|
|
108
95
|
display: flex;
|
|
@@ -124,7 +111,7 @@
|
|
|
124
111
|
flex-direction: column;
|
|
125
112
|
gap: var(--prime-space-1);
|
|
126
113
|
margin: 0;
|
|
127
|
-
padding:
|
|
114
|
+
padding: var(--prime-space-3);
|
|
128
115
|
list-style: none;
|
|
129
116
|
}
|
|
130
117
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** An order log that loads the next page as the reader nears its end, with loading lines in the rows' place — `onReachEnd`. */
|
|
2
|
+
import { Card, ScrollContainer, Skeleton, Typography } from "prime-ui-kit";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
import styles from "./examples.module.css";
|
|
6
|
+
|
|
7
|
+
const ORDERS = Array.from({ length: 40 }, (_, index) => ({
|
|
8
|
+
id: 2400 - index,
|
|
9
|
+
amount: `${(18 + ((index * 7) % 23)) * 1000} ₽`,
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
const PAGE = 10;
|
|
13
|
+
|
|
14
|
+
export default function ScrollContainerLoadMoreExample() {
|
|
15
|
+
const [shown, setShown] = React.useState(PAGE);
|
|
16
|
+
const [loading, setLoading] = React.useState(false);
|
|
17
|
+
const done = shown >= ORDERS.length;
|
|
18
|
+
|
|
19
|
+
const loadMore = () => {
|
|
20
|
+
if (done) return;
|
|
21
|
+
setLoading(true);
|
|
22
|
+
// The promise keeps the region `aria-busy` and stops repeat calls until it settles.
|
|
23
|
+
return new Promise<void>((resolve) => {
|
|
24
|
+
window.setTimeout(() => {
|
|
25
|
+
setShown((count) => Math.min(count + PAGE, ORDERS.length));
|
|
26
|
+
setLoading(false);
|
|
27
|
+
resolve();
|
|
28
|
+
}, 800);
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Card.Root role="region" className={styles.card} aria-label="Журнал заказов">
|
|
34
|
+
<Card.Header>
|
|
35
|
+
<Card.Title>Журнал заказов</Card.Title>
|
|
36
|
+
</Card.Header>
|
|
37
|
+
<ScrollContainer onReachEnd={loadMore} tabIndex={0} aria-label="Заказы">
|
|
38
|
+
<ul className={styles.list}>
|
|
39
|
+
{ORDERS.slice(0, shown).map((order) => (
|
|
40
|
+
<li key={order.id}>
|
|
41
|
+
<Typography as="span" variant="body-m" tone="secondary">
|
|
42
|
+
Заказ № {order.id} · {order.amount}
|
|
43
|
+
</Typography>
|
|
44
|
+
</li>
|
|
45
|
+
))}
|
|
46
|
+
</ul>
|
|
47
|
+
{loading ? <Skeleton lines={3} className={styles.older} /> : null}
|
|
48
|
+
</ScrollContainer>
|
|
49
|
+
</Card.Root>
|
|
50
|
+
);
|
|
51
|
+
}
|