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
|
@@ -238,6 +238,7 @@ Root attribute: `data-size`. Every motion honours reduced motion (durations coll
|
|
|
238
238
|
| [search.tsx](examples/search.tsx) | The search field filters dialogs by name and by the last message, marks the match in both, says how many were found and shows a quiet state when none match — `defaultSearch`, `onSearchChange`. |
|
|
239
239
|
| [live.tsx](examples/live.tsx) | A live inbox: a client types, then writes — the preview turns into the typing line and back, the count rolls up and the dialog glides to the top; opening it clears the count — `typing`, `unread`, `items`. |
|
|
240
240
|
| [long-list.tsx](examples/long-list.tsx) | A sales inbox of a thousand dialogs: only the rows around the view render, arrows walk through all of them, and the next page loads as the end comes near — `hasMore`, `onLoadMore`. |
|
|
241
|
+
| [links.tsx](examples/links.tsx) | Dialogs with their own address: every row is a link the router opens, the time reads as how long ago, and the list is named for its queue — `href`, `formatTime`, `labels`. |
|
|
241
242
|
| [states.tsx](examples/states.tsx) | Loading and empty: placeholder rows in the rows' geometry cross-fade into the dialogs; a new workspace without dialogs shows its own empty state with an action — `loading`, `empty`. |
|
|
242
243
|
| [controlled.tsx](examples/controlled.tsx) | The open dialog lives in the screen: a row opens it beside the list, and a next-unread button opens the next one from outside — `value`, `onValueChange`. |
|
|
243
244
|
| [narrow.tsx](examples/narrow.tsx) | At phone width long names and previews truncate while the time and counts stay whole; a pane squeezed under 240px keeps only the names and the counts — `ChatList.Root`, `search`. |
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** Dialogs with their own address: every row is a link the router opens, the time reads as how long ago, and the list is named for its queue — `href`, `formatTime`, `labels`. */
|
|
2
|
+
import { Avatar, Card, ChatList, hueOf } from "prime-ui-kit";
|
|
3
|
+
|
|
4
|
+
import styles from "./examples.module.css";
|
|
5
|
+
|
|
6
|
+
const NOW = new Date(2026, 9, 14, 15, 0);
|
|
7
|
+
const at = (day: number, hour: number, minute: number) => new Date(2026, 9, day, hour, minute);
|
|
8
|
+
|
|
9
|
+
const DIALOGS = [
|
|
10
|
+
{
|
|
11
|
+
id: "t-1042",
|
|
12
|
+
name: "ООО «Вектор»",
|
|
13
|
+
initials: "ВК",
|
|
14
|
+
preview: "Не можем выгрузить счёт в 1С",
|
|
15
|
+
at: at(14, 14, 52),
|
|
16
|
+
unread: 2,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: "t-1039",
|
|
20
|
+
name: "ООО «Гранит»",
|
|
21
|
+
initials: "ГР",
|
|
22
|
+
preview: "Акт сверки подписан",
|
|
23
|
+
at: at(14, 12, 5),
|
|
24
|
+
unread: 0,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "t-1031",
|
|
28
|
+
name: "ИП Козлов",
|
|
29
|
+
initials: "ИК",
|
|
30
|
+
preview: "Подключите, пожалуйста, ЭДО",
|
|
31
|
+
at: at(12, 11, 40),
|
|
32
|
+
unread: 0,
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
const MINUTE = 60_000;
|
|
37
|
+
const HOUR = 60 * MINUTE;
|
|
38
|
+
const DAY = 24 * HOUR;
|
|
39
|
+
|
|
40
|
+
/** A support queue reads waiting time: «8 мин», «3 ч», «2 дн». */
|
|
41
|
+
const formatAgo = (date: Date, now: Date) => {
|
|
42
|
+
const passed = now.getTime() - date.getTime();
|
|
43
|
+
if (passed < HOUR) return `${Math.max(1, Math.round(passed / MINUTE))} мин`;
|
|
44
|
+
if (passed < DAY) return `${Math.round(passed / HOUR)} ч`;
|
|
45
|
+
return `${Math.round(passed / DAY)} дн`;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default function ChatListLinksExample() {
|
|
49
|
+
return (
|
|
50
|
+
<Card.Root className={styles.short}>
|
|
51
|
+
<ChatList.Root
|
|
52
|
+
labels={{ list: "Обращения" }}
|
|
53
|
+
items={DIALOGS}
|
|
54
|
+
getKey={(item) => item.id}
|
|
55
|
+
value="t-1042"
|
|
56
|
+
now={NOW}
|
|
57
|
+
formatTime={formatAgo}
|
|
58
|
+
renderItem={(item) => (
|
|
59
|
+
<ChatList.Item href={`/support/tickets/${item.id}`} time={item.at} unread={item.unread}>
|
|
60
|
+
<ChatList.ItemIcon>
|
|
61
|
+
<Avatar.Root color={hueOf(item.id)}>
|
|
62
|
+
<Avatar.Fallback>{item.initials}</Avatar.Fallback>
|
|
63
|
+
</Avatar.Root>
|
|
64
|
+
</ChatList.ItemIcon>
|
|
65
|
+
<ChatList.ItemText>{item.name}</ChatList.ItemText>
|
|
66
|
+
<ChatList.ItemDescription>{item.preview}</ChatList.ItemDescription>
|
|
67
|
+
</ChatList.Item>
|
|
68
|
+
)}
|
|
69
|
+
/>
|
|
70
|
+
</Card.Root>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
@@ -152,7 +152,7 @@ No `labels`.
|
|
|
152
152
|
| [overview.tsx](examples/overview.tsx) | A checkbox with its label; a click anywhere on the row toggles it. |
|
|
153
153
|
| [variants.tsx](examples/variants.tsx) | The rounded square next to the circle, in three states — `shape`. |
|
|
154
154
|
| [sizes.tsx](examples/sizes.tsx) | Every size; the box and the text follow the control tier — `size`. |
|
|
155
|
-
| [states.tsx](examples/states.tsx) | Every state side by side, each labelled by its prop — `checked`, `indeterminate`, `invalid`, `disabled`. |
|
|
155
|
+
| [states.tsx](examples/states.tsx) | Every state side by side, each labelled by its prop — `checked`, `indeterminate`, `readOnly`, `invalid`, `disabled`. |
|
|
156
156
|
| [without-label.tsx](examples/without-label.tsx) | Bare boxes in table rows, named by `aria-label` and submitted with `name` and `value`. |
|
|
157
157
|
| [indicator.tsx](examples/indicator.tsx) | The box alone in a multi-select list: the option row carries `aria-selected`, the box only shows it — `Checkbox.Indicator`. |
|
|
158
158
|
| [controlled.tsx](examples/controlled.tsx) | The parent owns the selection; «select all» turns indeterminate on a partial one — `checked`, `onCheckedChange`, `indeterminate`. |
|
|
@@ -57,8 +57,12 @@
|
|
|
57
57
|
var(--prime-motion-easing-standard);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
.option[aria-disabled="true"] {
|
|
61
|
+
cursor: default;
|
|
62
|
+
}
|
|
63
|
+
|
|
60
64
|
@media (hover: hover) {
|
|
61
|
-
.option:hover {
|
|
65
|
+
.option:not([aria-disabled="true"]):hover {
|
|
62
66
|
background: var(--prime-color-fill-subtle);
|
|
63
67
|
}
|
|
64
68
|
}
|
|
@@ -4,10 +4,11 @@ import * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
import styles from "./examples.module.css";
|
|
6
6
|
|
|
7
|
-
const CITIES = [
|
|
7
|
+
const CITIES: { value: string; label: string; disabled?: boolean }[] = [
|
|
8
8
|
{ value: "msk", label: "Москва" },
|
|
9
9
|
{ value: "spb", label: "Санкт-Петербург" },
|
|
10
10
|
{ value: "kzn", label: "Казань" },
|
|
11
|
+
{ value: "tver", label: "Тверь · закрыт", disabled: true },
|
|
11
12
|
];
|
|
12
13
|
|
|
13
14
|
/** One tab stop: arrows move the focused row (wrapping), Home / End jump to the ends. */
|
|
@@ -24,10 +25,14 @@ export default function CheckboxIndicatorExample() {
|
|
|
24
25
|
const [active, setActive] = React.useState(0);
|
|
25
26
|
const optionRefs = React.useRef<(HTMLDivElement | null)[]>([]);
|
|
26
27
|
|
|
27
|
-
const toggle = (
|
|
28
|
+
const toggle = (city: (typeof CITIES)[number]) => {
|
|
29
|
+
if (city.disabled) return;
|
|
28
30
|
setSelected((current) =>
|
|
29
|
-
current.includes(
|
|
31
|
+
current.includes(city.value)
|
|
32
|
+
? current.filter((item) => item !== city.value)
|
|
33
|
+
: [...current, city.value],
|
|
30
34
|
);
|
|
35
|
+
};
|
|
31
36
|
|
|
32
37
|
return (
|
|
33
38
|
<div
|
|
@@ -53,19 +58,20 @@ export default function CheckboxIndicatorExample() {
|
|
|
53
58
|
}}
|
|
54
59
|
role="option"
|
|
55
60
|
aria-selected={isSelected}
|
|
61
|
+
aria-disabled={city.disabled || undefined}
|
|
56
62
|
tabIndex={index === active ? 0 : -1}
|
|
57
63
|
className={styles.option}
|
|
58
64
|
onFocus={() => setActive(index)}
|
|
59
|
-
onClick={() => toggle(city
|
|
65
|
+
onClick={() => toggle(city)}
|
|
60
66
|
onKeyDown={(event) => {
|
|
61
67
|
if (event.key === " " || event.key === "Enter") {
|
|
62
68
|
event.preventDefault();
|
|
63
|
-
toggle(city
|
|
69
|
+
toggle(city);
|
|
64
70
|
}
|
|
65
71
|
}}
|
|
66
72
|
>
|
|
67
|
-
<Checkbox.Indicator checked={isSelected} />
|
|
68
|
-
<Typography as="span" variant="body-m">
|
|
73
|
+
<Checkbox.Indicator checked={isSelected} disabled={city.disabled} />
|
|
74
|
+
<Typography as="span" variant="body-m" tone={city.disabled ? "muted" : undefined}>
|
|
69
75
|
{city.label}
|
|
70
76
|
</Typography>
|
|
71
77
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Every state side by side, each labelled by its prop — `checked`, `indeterminate`, `invalid`, `disabled`. */
|
|
1
|
+
/** Every state side by side, each labelled by its prop — `checked`, `indeterminate`, `readOnly`, `invalid`, `disabled`. */
|
|
2
2
|
import { Checkbox } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
export default function CheckboxStatesExample() {
|
|
@@ -20,6 +20,11 @@ export default function CheckboxStatesExample() {
|
|
|
20
20
|
<Checkbox.Label>indeterminate</Checkbox.Label>
|
|
21
21
|
</Checkbox.Root>
|
|
22
22
|
</div>
|
|
23
|
+
<div>
|
|
24
|
+
<Checkbox.Root defaultChecked readOnly>
|
|
25
|
+
<Checkbox.Label>readOnly</Checkbox.Label>
|
|
26
|
+
</Checkbox.Root>
|
|
27
|
+
</div>
|
|
23
28
|
<div>
|
|
24
29
|
<Checkbox.Root invalid>
|
|
25
30
|
<Checkbox.Label>invalid</Checkbox.Label>
|
|
@@ -93,7 +93,7 @@ ColorField field frame: label · field button · hint | er
|
|
|
93
93
|
## States
|
|
94
94
|
| State | Driven by | DOM |
|
|
95
95
|
|---|---|---|
|
|
96
|
-
| closed / open | click, `Enter` · `Space`, `Escape`, an outside press | `aria-expanded` and `data-state` on the button; the chevron turns; the button
|
|
96
|
+
| closed / open | click, `Enter` · `Space`, `Escape`, an outside press | `aria-expanded` and `data-state` on the button; the chevron turns; the button holds the hover fill while open |
|
|
97
97
|
| value | `value` / `defaultValue`, the panel | the chip and the hex follow the color as it is dragged; `onValueChange` gets every change as hex |
|
|
98
98
|
| invalid | `invalid` or `error` | `data-invalid="true"`, `aria-invalid` on the button; the field shakes once when an error arrives (`data-shake` on the frame) |
|
|
99
99
|
| disabled | `disabled` | native `disabled` on the button, `data-disabled` on the frame; the hidden `name` input is disabled too, so the form does not submit the value |
|
|
@@ -163,7 +163,7 @@ No DOM. Holds the color (React Aria `ColorPicker`) and the value format for ever
|
|
|
163
163
|
| `…rest` | `Omit<ButtonRootProps, "variant" \| "tone" \| "size" \| "aria-label">` | — | The other Button props. |
|
|
164
164
|
|
|
165
165
|
### ColorPresets.Root
|
|
166
|
-
|
|
166
|
+
A quick color from a fixed palette: a square trigger and a popover grid of presets. No DOM, except a field frame in a FieldList cell (the column heading as its label).
|
|
167
167
|
|
|
168
168
|
| Prop | Type | Default | Description |
|
|
169
169
|
|---|---|---|---|
|
|
@@ -315,13 +315,14 @@ There is no `disabled` on `ColorPicker.Root` — disable parts individually. Con
|
|
|
315
315
|
|---|---|
|
|
316
316
|
| [overview.tsx](examples/overview.tsx) | A color field: a hex value and a swatch button that opens the picker panel — `ColorPicker.HexInput`, `ColorPicker.TriggerSwatch`. |
|
|
317
317
|
| [sizes.tsx](examples/sizes.tsx) | Every size of the hex field with a swatch button of the same tier — `size`. |
|
|
318
|
-
| [states.tsx](examples/states.tsx) | A disabled area
|
|
318
|
+
| [states.tsx](examples/states.tsx) | A disabled area, hue slider and preset trigger keep showing the color but take no input — `disabled`. |
|
|
319
319
|
| [validation.tsx](examples/validation.tsx) | A button color checked live: a too light color shakes in an error that leaves once the color is darker; a hint under the other field, invalid text reverts on blur — `hint`, `error`. |
|
|
320
320
|
| [panel.tsx](examples/panel.tsx) | The full raised panel and its part order: format, area, hue and alpha sliders, channels, brand swatches — `ColorPicker.Panel`, `surface`, `ColorPicker.Swatches`. |
|
|
321
321
|
| [formats.tsx](examples/formats.tsx) | The channel strip in each value format; three pickers edit one color — `defaultFormat`, `ColorPicker.ChannelStrip`. |
|
|
322
|
-
| [presets.tsx](examples/presets.tsx) | A quick color from the palette: a square trigger
|
|
322
|
+
| [presets.tsx](examples/presets.tsx) | A quick color from the palette: a square trigger with «no color» and a Button trigger whose grid of four columns stays open after a pick — `ColorPresets`, `allowEmpty`, `ColorPresets.Trigger`, `columns`, `closeOnSelect`. |
|
|
323
323
|
| [presets-sizes.tsx](examples/presets-sizes.tsx) | The preset trigger in every size, a square of the control height next to an input of the same tier — `ColorPresets`, `size`. |
|
|
324
324
|
| [controlled.tsx](examples/controlled.tsx) | The parent owns the color: brand swatches and the hex field edit it, a button resets it — `value`, `onValueChange`. |
|
|
325
|
+
| [controlled-open.tsx](examples/controlled-open.tsx) | The parent opens the preset palette from its own button and keeps the chosen color — `open`, `onOpenChange`, `value`, `onValueChange`. |
|
|
325
326
|
| [in-form.tsx](examples/in-form.tsx) | Theme settings: the color goes with the form, a too light color shakes in an error on save that leaves once the color changes — `value`, `error`. |
|
|
326
327
|
|
|
327
328
|
## Mistakes
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** The parent opens the preset palette from its own button and keeps the chosen color — `open`, `onOpenChange`, `value`, `onValueChange`. */
|
|
2
|
+
import { Button, COLOR_PRESETS, ColorPresets, Typography } from "prime-ui-kit";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
import styles from "./examples.module.css";
|
|
6
|
+
|
|
7
|
+
const PRESETS = COLOR_PRESETS.slice(0, 8);
|
|
8
|
+
|
|
9
|
+
export default function ColorPickerControlledOpenExample() {
|
|
10
|
+
const [open, setOpen] = React.useState(false);
|
|
11
|
+
const [color, setColor] = React.useState<string | null>("#ef4444");
|
|
12
|
+
const name = PRESETS.find((preset) => preset.value === color)?.label ?? "без цвета";
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div className={styles.inlineRow}>
|
|
16
|
+
<ColorPresets.Root
|
|
17
|
+
presets={PRESETS}
|
|
18
|
+
value={color}
|
|
19
|
+
onValueChange={setColor}
|
|
20
|
+
open={open}
|
|
21
|
+
onOpenChange={setOpen}
|
|
22
|
+
labels={{ trigger: "Цвет метки «Срочно»" }}
|
|
23
|
+
>
|
|
24
|
+
<ColorPresets.Trigger>
|
|
25
|
+
<ColorPresets.SwatchButton />
|
|
26
|
+
</ColorPresets.Trigger>
|
|
27
|
+
<ColorPresets.Content label="Цвет метки «Срочно»" />
|
|
28
|
+
</ColorPresets.Root>
|
|
29
|
+
<Typography as="span" variant="body-s" tone="secondary">
|
|
30
|
+
Метка «Срочно»: {name}
|
|
31
|
+
</Typography>
|
|
32
|
+
<Button.Root variant="soft" tone="neutral" onClick={() => setOpen(true)}>
|
|
33
|
+
Сменить цвет
|
|
34
|
+
</Button.Root>
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** A quick color from the palette: a square trigger
|
|
1
|
+
/** A quick color from the palette: a square trigger with «no color» and a Button trigger whose grid of four columns stays open after a pick — `ColorPresets`, `allowEmpty`, `ColorPresets.Trigger`, `columns`, `closeOnSelect`. */
|
|
2
2
|
import { Button, COLOR_PRESETS, ColorPresets } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
import styles from "./examples.module.css";
|
|
@@ -19,7 +19,7 @@ export default function ColorPickerPresetsExample() {
|
|
|
19
19
|
</ColorPresets.Trigger>
|
|
20
20
|
<ColorPresets.Content />
|
|
21
21
|
</ColorPresets.Root>
|
|
22
|
-
<ColorPresets.Root defaultValue="#22c55e">
|
|
22
|
+
<ColorPresets.Root presets={ONE_ROW} columns={4} closeOnSelect={false} defaultValue="#22c55e">
|
|
23
23
|
<ColorPresets.Trigger>
|
|
24
24
|
<Button.Root variant="soft" tone="neutral">
|
|
25
25
|
<Button.Icon>
|
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
/** A disabled area
|
|
1
|
+
/** A disabled area, hue slider and preset trigger keep showing the color but take no input — `disabled`. */
|
|
2
|
+
import { ColorPresets } from "prime-ui-kit";
|
|
2
3
|
import { ColorPicker } from "prime-ui-kit/color-picker";
|
|
3
4
|
|
|
4
5
|
import styles from "./examples.module.css";
|
|
5
6
|
|
|
6
7
|
export default function ColorPickerStatesExample() {
|
|
7
8
|
return (
|
|
8
|
-
|
|
9
|
-
<ColorPicker.
|
|
10
|
-
<ColorPicker.
|
|
11
|
-
<ColorPicker.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<ColorPicker.
|
|
15
|
-
|
|
16
|
-
<ColorPicker.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
<>
|
|
10
|
+
<ColorPicker.Root defaultValue="#30a46c">
|
|
11
|
+
<ColorPicker.Panel className={styles.panel}>
|
|
12
|
+
<ColorPicker.Area colorSpace="hsl" xChannel="saturation" yChannel="lightness" disabled>
|
|
13
|
+
<ColorPicker.AreaThumb />
|
|
14
|
+
</ColorPicker.Area>
|
|
15
|
+
<ColorPicker.Slider channel="hue" colorSpace="hsl" disabled>
|
|
16
|
+
<ColorPicker.SliderMeta label="disabled" />
|
|
17
|
+
<ColorPicker.SliderTrack>
|
|
18
|
+
<ColorPicker.Thumb />
|
|
19
|
+
</ColorPicker.SliderTrack>
|
|
20
|
+
</ColorPicker.Slider>
|
|
21
|
+
</ColorPicker.Panel>
|
|
22
|
+
</ColorPicker.Root>
|
|
23
|
+
<ColorPresets.Root disabled defaultValue="#22c55e" labels={{ trigger: "Цвет метки" }}>
|
|
24
|
+
<ColorPresets.Trigger>
|
|
25
|
+
<ColorPresets.SwatchButton />
|
|
26
|
+
</ColorPresets.Trigger>
|
|
27
|
+
<ColorPresets.Content />
|
|
28
|
+
</ColorPresets.Root>
|
|
29
|
+
</>
|
|
21
30
|
);
|
|
22
31
|
}
|
|
@@ -283,7 +283,8 @@ Motion: the tray opens and closes as a Crossfade (fade and height glide, the row
|
|
|
283
283
|
|---|---|
|
|
284
284
|
| [overview.tsx](examples/overview.tsx) | A reply to a client in a support chat: Enter sends, Shift+Enter breaks the line, the paperclip attaches files and an empty field records a voice message — `onSend`, `onSendVoice`, `queue`, `Composer.Attach`. |
|
|
285
285
|
| [sizes.tsx](examples/sizes.tsx) | One composer in every tier: field, buttons and the paperclip follow it — `size`. |
|
|
286
|
-
| [attachments.tsx](examples/attachments.tsx) | Warehouse photos and documents for a client go through an upload queue: the paperclip opens the file picker, a paste or a drop adds files too, every attachment is a tile of one strip that drags into its order, and send waits until the uploads finish — `queue`, `Composer.Attach`, `useUploadQueue`. |
|
|
286
|
+
| [attachments.tsx](examples/attachments.tsx) | Warehouse photos and documents for a client go through an upload queue: the paperclip opens the file picker for photos, videos and office documents, a paste or a drop adds files too, every attachment is a tile of one strip that drags into its order, and send waits until the uploads finish — `queue`, `Composer.Attach`, `accept`, `useUploadQueue`. |
|
|
287
|
+
| [attach-menu.tsx](examples/attach-menu.tsx) | The paperclip as a menu of attachment kinds: photos and videos, documents, any file, and an invoice from the system that puts its link into the message and returns the focus to the field — `Composer.Item`, `Composer.ItemIcon`, `accept`, `onSelect`, `inputRef`. |
|
|
287
288
|
| [reply-edit.tsx](examples/reply-edit.tsx) | Answering a client's message and correcting your own: the bar above the field quotes the message, Escape or the cross cancels, ↑ in an empty field opens your last message, send becomes save and hands over the message id — `Composer.Context`, `mode`, `value`, `onDismiss`, `onEditLast`. |
|
|
288
289
|
| [typing.tsx](examples/typing.tsx) | The other side's status line follows what you do: typing, recording a voice or a video message, then nothing — `onActivityChange`. |
|
|
289
290
|
| [formatting.tsx](examples/formatting.tsx) | Selected text gets a toolbar of bold, italic, strikethrough, code, spoiler, link and quote, each with its shortcut, written as Markdown around the selection — `formatting`. |
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** The paperclip as a menu of attachment kinds: photos and videos, documents, any file, and an invoice from the system that puts its link into the message and returns the focus to the field — `Composer.Item`, `Composer.ItemIcon`, `accept`, `onSelect`, `inputRef`. */
|
|
2
|
+
import { Composer, Icon, type UploadContext, useUploadQueue } from "prime-ui-kit";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
import styles from "./examples.module.css";
|
|
6
|
+
|
|
7
|
+
const TICK_MS = 300;
|
|
8
|
+
|
|
9
|
+
const INVOICE_LINK = "Счёт INV-2051 на 184 000 ₽: https://prime.app/invoices/2051";
|
|
10
|
+
|
|
11
|
+
/** A stand-in for the file server: sends a file in a few steps. */
|
|
12
|
+
function sendFile(file: File, { signal, onProgress }: UploadContext): Promise<string> {
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
let sent = 0;
|
|
15
|
+
const timer = window.setInterval(() => {
|
|
16
|
+
sent = Math.min(1, sent + 0.25);
|
|
17
|
+
onProgress(sent);
|
|
18
|
+
if (sent < 1) return;
|
|
19
|
+
window.clearInterval(timer);
|
|
20
|
+
resolve(`https://files.example.com/chat/${encodeURIComponent(file.name)}`);
|
|
21
|
+
}, TICK_MS);
|
|
22
|
+
signal.addEventListener("abort", () => {
|
|
23
|
+
window.clearInterval(timer);
|
|
24
|
+
reject(signal.reason);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default function ComposerAttachMenuExample() {
|
|
30
|
+
const queue = useUploadQueue({ upload: sendFile });
|
|
31
|
+
const [draft, setDraft] = React.useState("");
|
|
32
|
+
const inputRef = React.useRef<HTMLTextAreaElement>(null);
|
|
33
|
+
|
|
34
|
+
const attachInvoice = () => {
|
|
35
|
+
setDraft((current) => (current ? `${current}\n${INVOICE_LINK}` : INVOICE_LINK));
|
|
36
|
+
// The menu returns the focus to the paperclip; the reader goes on typing in the field.
|
|
37
|
+
window.requestAnimationFrame(() => inputRef.current?.focus());
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div className={styles.chat}>
|
|
42
|
+
<Composer.Root
|
|
43
|
+
value={draft}
|
|
44
|
+
onValueChange={setDraft}
|
|
45
|
+
inputRef={inputRef}
|
|
46
|
+
queue={queue}
|
|
47
|
+
onSend={() => setDraft("")}
|
|
48
|
+
>
|
|
49
|
+
<Composer.Attach>
|
|
50
|
+
<Composer.Item accept="image/*,video/*">
|
|
51
|
+
<Composer.ItemIcon>
|
|
52
|
+
<Icon name="object.image" />
|
|
53
|
+
</Composer.ItemIcon>
|
|
54
|
+
Фото и видео
|
|
55
|
+
</Composer.Item>
|
|
56
|
+
<Composer.Item accept=".pdf,.docx,.xlsx">
|
|
57
|
+
<Composer.ItemIcon>
|
|
58
|
+
<Icon name="object.document" />
|
|
59
|
+
</Composer.ItemIcon>
|
|
60
|
+
Документ
|
|
61
|
+
</Composer.Item>
|
|
62
|
+
<Composer.Item accept="">
|
|
63
|
+
<Composer.ItemIcon>
|
|
64
|
+
<Icon name="object.file" />
|
|
65
|
+
</Composer.ItemIcon>
|
|
66
|
+
Любой файл
|
|
67
|
+
</Composer.Item>
|
|
68
|
+
<Composer.Item onSelect={attachInvoice}>
|
|
69
|
+
<Composer.ItemIcon>
|
|
70
|
+
<Icon name="object.receipt" />
|
|
71
|
+
</Composer.ItemIcon>
|
|
72
|
+
Счёт из системы
|
|
73
|
+
</Composer.Item>
|
|
74
|
+
</Composer.Attach>
|
|
75
|
+
</Composer.Root>
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Warehouse photos and documents for a client go through an upload queue: the paperclip opens the file picker, a paste or a drop adds files too, every attachment is a tile of one strip that drags into its order, and send waits until the uploads finish — `queue`, `Composer.Attach`, `useUploadQueue`. */
|
|
1
|
+
/** Warehouse photos and documents for a client go through an upload queue: the paperclip opens the file picker for photos, videos and office documents, a paste or a drop adds files too, every attachment is a tile of one strip that drags into its order, and send waits until the uploads finish — `queue`, `Composer.Attach`, `accept`, `useUploadQueue`. */
|
|
2
2
|
import { Composer, type UploadContext, useUploadQueue } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
import styles from "./examples.module.css";
|
|
@@ -29,7 +29,7 @@ export default function ComposerAttachmentsExample() {
|
|
|
29
29
|
return (
|
|
30
30
|
<div className={styles.chat}>
|
|
31
31
|
<Composer.Root queue={queue} onSend={() => {}}>
|
|
32
|
-
<Composer.Attach />
|
|
32
|
+
<Composer.Attach accept="image/*,video/*,.pdf,.docx,.xlsx" />
|
|
33
33
|
</Composer.Root>
|
|
34
34
|
</div>
|
|
35
35
|
);
|
|
@@ -103,6 +103,7 @@ No `labels`.
|
|
|
103
103
|
| [overview.tsx](examples/overview.tsx) | A card region that cross-fades between loading, data, empty and error and glides to the new height — `state`. |
|
|
104
104
|
| [record-switch.tsx](examples/record-switch.tsx) | A detail panel keyed by the record id: picking another client cross-fades the details of a different height — `state`. |
|
|
105
105
|
| [fill.tsx](examples/fill.tsx) | A deal board that fills its panel's height while it swaps between loading and data, and a notice slot above it that takes no room while empty — `fill`, `state`. |
|
|
106
|
+
| [screen.tsx](examples/screen.tsx) | Screen states: the title and the date of the statement in the app header, a page-level error in a Banner with a retry, a region loading with a Skeleton of its rows and a table skeleton, the table error in place and a first-run EmptyPage; regions cross-fade between states — `state`. |
|
|
106
107
|
|
|
107
108
|
## Mistakes
|
|
108
109
|
- A new `state` on every data refresh (`state={Date.now()}`) → key by what the region shows, not by when it was fetched.
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/** Screen states: the title and the date of the statement in the app header, a page-level error in a Banner with a retry, a region loading with a Skeleton of its rows and a table skeleton, the table error in place and a first-run EmptyPage; regions cross-fade between states — `state`. */
|
|
2
|
+
import {
|
|
3
|
+
AppHeader,
|
|
4
|
+
Banner,
|
|
5
|
+
Button,
|
|
6
|
+
Card,
|
|
7
|
+
Crossfade,
|
|
8
|
+
DataTable,
|
|
9
|
+
type DataTableColumn,
|
|
10
|
+
EmptyPage,
|
|
11
|
+
Icon,
|
|
12
|
+
PageContent,
|
|
13
|
+
Skeleton,
|
|
14
|
+
Typography,
|
|
15
|
+
useNotifications,
|
|
16
|
+
} from "prime-ui-kit";
|
|
17
|
+
import * as React from "react";
|
|
18
|
+
|
|
19
|
+
import styles from "./screen.module.css";
|
|
20
|
+
|
|
21
|
+
type Status = "error" | "loading" | "ready";
|
|
22
|
+
type Payment = { id: string; payer: string; purpose: string; amount: number };
|
|
23
|
+
|
|
24
|
+
const PAYMENTS: Payment[] = [
|
|
25
|
+
{ id: "b1", payer: "ООО «Гранит»", purpose: "Оплата по сч. 2026-0414", amount: 94_750 },
|
|
26
|
+
{ id: "b2", payer: "ИП Орлов Д. С.", purpose: "Предоплата за обучение", amount: 18_000 },
|
|
27
|
+
{ id: "b3", payer: "АО «Альфа Медиа»", purpose: "Без указания счёта", amount: 380_000 },
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const ACCOUNTS = [
|
|
31
|
+
{ name: "Т-Банк, расчётный", balance: "4 812 300 ₽" },
|
|
32
|
+
{ name: "Сбербанк, расчётный", balance: "1 207 950 ₽" },
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const MONEY = new Intl.NumberFormat("ru-RU", {
|
|
36
|
+
style: "currency",
|
|
37
|
+
currency: "RUB",
|
|
38
|
+
maximumFractionDigits: 0,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const COLUMNS: DataTableColumn<Payment>[] = [
|
|
42
|
+
{ id: "payer", header: "Плательщик", accessor: "payer" },
|
|
43
|
+
{ id: "purpose", header: "Назначение", accessor: "purpose" },
|
|
44
|
+
{
|
|
45
|
+
id: "amount",
|
|
46
|
+
header: "Сумма",
|
|
47
|
+
numeric: true,
|
|
48
|
+
headerAlign: "end",
|
|
49
|
+
cell: (row) => MONEY.format(row.amount),
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
export default function CrossfadeScreenExample() {
|
|
54
|
+
const { notify } = useNotifications();
|
|
55
|
+
const [status, setStatus] = React.useState<Status>("error");
|
|
56
|
+
|
|
57
|
+
const retry = () => {
|
|
58
|
+
setStatus("loading");
|
|
59
|
+
window.setTimeout(() => {
|
|
60
|
+
setStatus("ready");
|
|
61
|
+
notify({
|
|
62
|
+
tone: "success",
|
|
63
|
+
title: "Выписка получена",
|
|
64
|
+
description: "3 платежа ждут разнесения",
|
|
65
|
+
});
|
|
66
|
+
}, 1500);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<>
|
|
71
|
+
{/* The header carries the page: the only h1 and a line of data, here the date of the last
|
|
72
|
+
statement — it moves on once the statement arrives. Main has no PageContent.Header. */}
|
|
73
|
+
<AppHeader.Root>
|
|
74
|
+
<AppHeader.Start>
|
|
75
|
+
<AppHeader.Title>
|
|
76
|
+
Сверка с банком
|
|
77
|
+
<AppHeader.Description>
|
|
78
|
+
2 счёта · выписка на {status === "ready" ? "7" : "6"} октября
|
|
79
|
+
</AppHeader.Description>
|
|
80
|
+
</AppHeader.Title>
|
|
81
|
+
</AppHeader.Start>
|
|
82
|
+
</AppHeader.Root>
|
|
83
|
+
|
|
84
|
+
<PageContent.Root>
|
|
85
|
+
<PageContent.Body>
|
|
86
|
+
{/* The page banner and the panels are one block: the banner, with the 40 below it, comes and
|
|
87
|
+
goes inside a Crossfade, so the panels glide instead of jumping. */}
|
|
88
|
+
<div className={styles.lead}>
|
|
89
|
+
<Crossfade state={status === "error" ? "error" : "ok"}>
|
|
90
|
+
{status === "error" ? (
|
|
91
|
+
<div className={styles.bannerSlot}>
|
|
92
|
+
<Banner.Root tone="danger">
|
|
93
|
+
<Banner.Content>
|
|
94
|
+
<Banner.Icon>
|
|
95
|
+
<Icon name="status.danger" />
|
|
96
|
+
</Banner.Icon>
|
|
97
|
+
<Banner.Title>Выписка за 7 октября не получена</Banner.Title>
|
|
98
|
+
<Banner.Description>
|
|
99
|
+
Т-Банк не ответил на запрос. Остатки показаны на 6 октября.
|
|
100
|
+
</Banner.Description>
|
|
101
|
+
<Banner.Actions>
|
|
102
|
+
<Button.Root tone="danger" onClick={retry}>
|
|
103
|
+
Повторить
|
|
104
|
+
</Button.Root>
|
|
105
|
+
</Banner.Actions>
|
|
106
|
+
</Banner.Content>
|
|
107
|
+
</Banner.Root>
|
|
108
|
+
</div>
|
|
109
|
+
) : null}
|
|
110
|
+
</Crossfade>
|
|
111
|
+
|
|
112
|
+
<PageContent.Grid>
|
|
113
|
+
<PageContent.Cell span={6}>
|
|
114
|
+
<Card.Root variant="panel" aria-busy={status === "loading"}>
|
|
115
|
+
<Card.Header>
|
|
116
|
+
<Card.Title as="h2">Остатки</Card.Title>
|
|
117
|
+
<Typography as="span" variant="caption" tone="muted">
|
|
118
|
+
{status === "ready" ? "на 7 октября" : "на 6 октября"}
|
|
119
|
+
</Typography>
|
|
120
|
+
</Card.Header>
|
|
121
|
+
<Card.Body>
|
|
122
|
+
{/* Loading ↔ data cross-fade in place; the table below swaps its body the same way. */}
|
|
123
|
+
<Crossfade state={status === "loading" ? "loading" : "ready"}>
|
|
124
|
+
{status === "loading" ? (
|
|
125
|
+
<ul className={styles.accounts}>
|
|
126
|
+
{ACCOUNTS.map((account) => (
|
|
127
|
+
<li key={account.name} className={styles.account}>
|
|
128
|
+
<Skeleton className={styles.nameBar} />
|
|
129
|
+
{/* title-m is the l text tier: 16 / 24. */}
|
|
130
|
+
<Skeleton size="l" className={styles.balanceBar} />
|
|
131
|
+
</li>
|
|
132
|
+
))}
|
|
133
|
+
</ul>
|
|
134
|
+
) : (
|
|
135
|
+
<ul className={styles.accounts}>
|
|
136
|
+
{ACCOUNTS.map((account) => (
|
|
137
|
+
<li key={account.name} className={styles.account}>
|
|
138
|
+
<Typography as="span" variant="body-m" tone="secondary">
|
|
139
|
+
{account.name}
|
|
140
|
+
</Typography>
|
|
141
|
+
<Typography as="span" variant="title-m" className={styles.amount}>
|
|
142
|
+
{account.balance}
|
|
143
|
+
</Typography>
|
|
144
|
+
</li>
|
|
145
|
+
))}
|
|
146
|
+
</ul>
|
|
147
|
+
)}
|
|
148
|
+
</Crossfade>
|
|
149
|
+
</Card.Body>
|
|
150
|
+
</Card.Root>
|
|
151
|
+
</PageContent.Cell>
|
|
152
|
+
|
|
153
|
+
<PageContent.Cell span={6}>
|
|
154
|
+
<Card.Root variant="panel">
|
|
155
|
+
<Card.Header>
|
|
156
|
+
<Card.Title as="h2">Правила разнесения</Card.Title>
|
|
157
|
+
</Card.Header>
|
|
158
|
+
<Card.Body>
|
|
159
|
+
<EmptyPage.Root size="s" aria-labelledby="rules-empty">
|
|
160
|
+
<EmptyPage.Icon tone="accent">
|
|
161
|
+
<Icon name="action.filter" />
|
|
162
|
+
</EmptyPage.Icon>
|
|
163
|
+
<EmptyPage.Title as="h3" id="rules-empty">
|
|
164
|
+
Правил пока нет
|
|
165
|
+
</EmptyPage.Title>
|
|
166
|
+
<EmptyPage.Description>
|
|
167
|
+
Правило свяжет платёж со счётом по ИНН или назначению.
|
|
168
|
+
</EmptyPage.Description>
|
|
169
|
+
<EmptyPage.Actions>
|
|
170
|
+
<Button.Root variant="soft" tone="neutral">
|
|
171
|
+
Создать правило
|
|
172
|
+
</Button.Root>
|
|
173
|
+
</EmptyPage.Actions>
|
|
174
|
+
</EmptyPage.Root>
|
|
175
|
+
</Card.Body>
|
|
176
|
+
</Card.Root>
|
|
177
|
+
</PageContent.Cell>
|
|
178
|
+
</PageContent.Grid>
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
<PageContent.Section label="Неразнесённые платежи">
|
|
182
|
+
<DataTable
|
|
183
|
+
columns={COLUMNS}
|
|
184
|
+
rows={status === "ready" ? PAYMENTS : []}
|
|
185
|
+
getRowKey={(row) => row.id}
|
|
186
|
+
paging="none"
|
|
187
|
+
loading={status === "loading"}
|
|
188
|
+
loadingRows={3}
|
|
189
|
+
error={status === "error" ? "Платежи появятся после загрузки выписки" : undefined}
|
|
190
|
+
empty="Все платежи разнесены"
|
|
191
|
+
/>
|
|
192
|
+
</PageContent.Section>
|
|
193
|
+
</PageContent.Body>
|
|
194
|
+
</PageContent.Root>
|
|
195
|
+
</>
|
|
196
|
+
);
|
|
197
|
+
}
|