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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** Optional parts: an icon tile with a header-only notice, and a header with a footer but no body — `Modal.Icon`, `Modal.Body`, `Modal.Footer`. */
|
|
2
|
-
import { Button, Icon, Modal } from "prime-ui-kit";
|
|
1
|
+
/** Optional parts: an icon tile with a header-only notice, and a header with a status before the close button and a footer but no body — `Modal.Icon`, `Modal.Actions`, `Modal.Body`, `Modal.Footer`. */
|
|
2
|
+
import { Badge, Button, Icon, Modal } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
export default function ModalStructureExample() {
|
|
5
5
|
return (
|
|
@@ -35,6 +35,9 @@ export default function ModalStructureExample() {
|
|
|
35
35
|
<Modal.Description>
|
|
36
36
|
Новые клиенты увидят тариф сразу после публикации.
|
|
37
37
|
</Modal.Description>
|
|
38
|
+
<Modal.Actions>
|
|
39
|
+
<Badge.Root color="gray">Черновик</Badge.Root>
|
|
40
|
+
</Modal.Actions>
|
|
38
41
|
</Modal.Header>
|
|
39
42
|
<Modal.Footer>
|
|
40
43
|
<Modal.Close>
|
|
@@ -115,7 +115,7 @@ One look, the Select trigger's: field fill, inset control border, tier radius; t
|
|
|
115
115
|
|---|---|
|
|
116
116
|
| [overview.tsx](examples/overview.tsx) | A labelled system select with a hint; the OS picker opens on phones — `label`, `hint`. |
|
|
117
117
|
| [sizes.tsx](examples/sizes.tsx) | Every size tier; the label and the hint follow the field tier — `size`. |
|
|
118
|
-
| [states.tsx](examples/states.tsx) | A default field next to a disabled and an invalid one — `disabled`, `invalid`. |
|
|
118
|
+
| [states.tsx](examples/states.tsx) | A default field next to a disabled and an invalid one, and one whose focus shows without the ring — `disabled`, `invalid`, `focusRing`. |
|
|
119
119
|
| [validation.tsx](examples/validation.tsx) | Live validation: unassigning the owner shakes the field and drops the error in, picking someone clears it; required and optional markers and a hint — `required`, `optional`, `hint`, `error`. |
|
|
120
120
|
| [option-groups.tsx](examples/option-groups.tsx) | Options under group headings with the native optgroup, and a placeholder while nothing is picked — `placeholder`. |
|
|
121
121
|
| [controlled.tsx](examples/controlled.tsx) | The parent owns the value: the plan drives the price under the field — `value`, `onValueChange`. |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** A default field next to a disabled and an invalid one — `disabled`, `invalid`. */
|
|
1
|
+
/** A default field next to a disabled and an invalid one, and one whose focus shows without the ring — `disabled`, `invalid`, `focusRing`. */
|
|
2
2
|
import { NativeSelect } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
export default function NativeSelectStatesExample() {
|
|
@@ -16,6 +16,10 @@ export default function NativeSelectStatesExample() {
|
|
|
16
16
|
<option value="viewer">Наблюдатель</option>
|
|
17
17
|
<option value="editor">Редактор</option>
|
|
18
18
|
</NativeSelect>
|
|
19
|
+
<NativeSelect label="focusRing={false}" defaultValue="editor" focusRing={false}>
|
|
20
|
+
<option value="viewer">Наблюдатель</option>
|
|
21
|
+
<option value="editor">Редактор</option>
|
|
22
|
+
</NativeSelect>
|
|
19
23
|
</>
|
|
20
24
|
);
|
|
21
25
|
}
|
|
@@ -152,6 +152,7 @@ Collapsed stacks show up to 3 cards peeking behind each other. Hover or keyboard
|
|
|
152
152
|
### ARIA
|
|
153
153
|
- Each stack is an `<ol>` named by the region label of its position; each card is an `<article>`: `role="status"` + `aria-live="polite"`, or `role="alert"` + `aria-live="assertive"` for `warning` / `danger`.
|
|
154
154
|
- The icon and the countdown are `aria-hidden`; the close button is named by `labels.close`.
|
|
155
|
+
- A toast is a non-modal live region, not a layer of the overlay stack: Escape and a press elsewhere belong to the page and to the topmost open layer, so a toast takes no `closeOnEscape` / `closeOnOutsideClick` — it leaves by its timer, the close button, a swipe or `dismiss()`.
|
|
155
156
|
- Do not keep the only copy of important information in a toast with a timer — use `persistent` or a Banner.
|
|
156
157
|
|
|
157
158
|
### Labels
|
|
@@ -177,7 +178,7 @@ Collapsed stacks show up to 3 cards peeking behind each other. Hover or keyboard
|
|
|
177
178
|
| [tones.tsx](examples/tones.tsx) | The four tones: the icon carries the meaning; danger and warning are announced at once — `tone`. |
|
|
178
179
|
| [stacking.tsx](examples/stacking.tsx) | Toasts of one position and tone stack; hover expands the stack and pauses the timers — `max`, `items`, `dismissAll`. |
|
|
179
180
|
| [undo.tsx](examples/undo.tsx) | Delete at once and offer to undo: the row leaves the list, the toast brings it back, and the deletion is sent only when the toast leaves without an undo — `onDismiss`, `action`. |
|
|
180
|
-
| [dismiss.tsx](examples/dismiss.tsx) | A short timer, a toast that stays until closed, and one without a close button — `duration`, `persistent`, `closable`. |
|
|
181
|
+
| [dismiss.tsx](examples/dismiss.tsx) | A short timer, a toast that stays until closed, and one without a close button; the close button's name comes from labels — `duration`, `persistent`, `closable`, `labels`. |
|
|
181
182
|
| [in-form.tsx](examples/in-form.tsx) | Saving a form: the button shows loading, then a success toast or an error toast with a retry action — `notify`, `action`. |
|
|
182
183
|
|
|
183
184
|
## Mistakes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** A short timer, a toast that stays until closed, and one without a close button — `duration`, `persistent`, `closable`. */
|
|
1
|
+
/** A short timer, a toast that stays until closed, and one without a close button; the close button's name comes from labels — `duration`, `persistent`, `closable`, `labels`. */
|
|
2
2
|
import { Button, NotificationProvider, useNotifications } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
import styles from "./examples.module.css";
|
|
@@ -43,7 +43,7 @@ function DismissButtons() {
|
|
|
43
43
|
export default function NotificationDismissExample() {
|
|
44
44
|
// In an app NotificationProvider wraps the root once; here it keeps the example self-contained.
|
|
45
45
|
return (
|
|
46
|
-
<NotificationProvider>
|
|
46
|
+
<NotificationProvider labels={{ close: "Скрыть уведомление" }}>
|
|
47
47
|
<DismissButtons />
|
|
48
48
|
</NotificationProvider>
|
|
49
49
|
);
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
**Category:** page
|
|
4
4
|
**Kind:** layout
|
|
5
5
|
|
|
6
|
-
> Page structure inside the main column: title,
|
|
6
|
+
> Page structure inside the main column: title, page actions and content blocks, titled sections and the tile grid of a dashboard; a page as high as the panel and the list + detail layout.
|
|
7
7
|
|
|
8
8
|
## When to use
|
|
9
9
|
- Every route rendered inside `AppShell.Main`: a page heading (`<h1>`), an intro line, page-level actions and the page body.
|
|
10
10
|
- A text page held to a reading measure (`PageContent.Root maxWidth="readable"`).
|
|
11
11
|
- A wide dashboard page capped at the content width (`maxWidth="wide"`).
|
|
12
|
+
- The tiles of a dashboard — KPI cards, charts, panels — as one board (`PageContent.Grid` + `PageContent.Cell`).
|
|
13
|
+
- A new topic of the page with its own heading and a link or button beside it (`PageContent.Section`); a settings page with a heading column beside each panel (`layout="aside"`).
|
|
12
14
|
- A page whose body takes the rest of the panel's height — a log table, a board, a chat (`fill`).
|
|
13
15
|
- Mail, a messenger, a ticket queue: a list and the chosen record side by side, one at a time on a narrow panel (`PageContent.Split`).
|
|
14
16
|
|
|
@@ -16,7 +18,8 @@
|
|
|
16
18
|
- The app frame (navigation rail, header, scrolling main column) → use [AppShell](../../layout/app-shell/COMPONENT.md).
|
|
17
19
|
- A bounded block inside the page → use [Card](../card/COMPONENT.md).
|
|
18
20
|
- An empty / error / not-found page → use [EmptyPage](../empty-page/COMPONENT.md).
|
|
19
|
-
-
|
|
21
|
+
- A heading inside a card → `Card.Title`; text headings inside prose → use [Typography](../typography/COMPONENT.md).
|
|
22
|
+
- A grid inside one block (thumbnails, fields, bars in a panel) → the block's own CSS grid; `PageContent.Grid` places the page's tiles.
|
|
20
23
|
- Details that open over the list and close again (a record from a table) → use [Drawer](../drawer/COMPONENT.md); `Split` is for a list people work through record by record.
|
|
21
24
|
|
|
22
25
|
## Import
|
|
@@ -26,12 +29,16 @@ import { PageContent } from "prime-ui-kit";
|
|
|
26
29
|
|
|
27
30
|
## Anatomy
|
|
28
31
|
```
|
|
29
|
-
PageContent.Root | PageContent.
|
|
32
|
+
PageContent.Root | PageContent.Page column; Root adds maxWidth and fill, Page renders <section>
|
|
30
33
|
├─ PageContent.Header heading column + actions in one wrapping row
|
|
31
34
|
│ ├─ PageContent.Title <h1>, heading-m
|
|
32
35
|
│ ├─ PageContent.Description <p>, secondary body-m
|
|
33
36
|
│ └─ PageContent.Actions page buttons (moved to the end of the header row)
|
|
34
|
-
└─ PageContent.Body page content, blocks
|
|
37
|
+
└─ PageContent.Body page content, blocks 24 apart
|
|
38
|
+
├─ PageContent.Grid 12-column tile grid, 16 on both axes; a container (prime-grid)
|
|
39
|
+
│ └─ PageContent.Cell one tile place: span, rows; its child fills it
|
|
40
|
+
├─ PageContent.Section <section> + <h2> label, 40 from its neighbours
|
|
41
|
+
│ └─ PageContent.Actions a link or button at the end of the section heading
|
|
35
42
|
└─ PageContent.Split list + detail; a container (prime-split)
|
|
36
43
|
├─ PageContent.List list pane: 16–20rem column, or the whole split while closed
|
|
37
44
|
└─ PageContent.Detail detail pane: the rest, or the whole split while open
|
|
@@ -43,7 +50,7 @@ PageContent.Root | PageContent.Section column; Root adds maxWidth and fill,
|
|
|
43
50
|
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
44
51
|
|
|
45
52
|
### PageContent.Root
|
|
46
|
-
`ref` → `HTMLDivElement`. The page column inside `main`: header → body
|
|
53
|
+
`ref` → `HTMLDivElement`. The page column inside `main`: header → body 24 apart, centred under its cap.
|
|
47
54
|
|
|
48
55
|
| Prop | Type | Default | Description |
|
|
49
56
|
|---|---|---|---|
|
|
@@ -51,8 +58,8 @@ PageContent.Root | PageContent.Section column; Root adds maxWidth and fill,
|
|
|
51
58
|
| `fill` | `boolean` | `false` | The page takes the height of main (`AppShell.Root fillViewport`) and the body takes what the header leaves: for a full-height table, board, chat or `PageContent.Split`. |
|
|
52
59
|
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children` (Header, Body), `className` and the other div attributes. |
|
|
53
60
|
|
|
54
|
-
### PageContent.
|
|
55
|
-
`ref` → `HTMLElement`. The
|
|
61
|
+
### PageContent.Page
|
|
62
|
+
`ref` → `HTMLElement`. The whole app page as a `<section>` (the same column, the full panel width); name it with `aria-labelledby` → the Title `id`.
|
|
56
63
|
|
|
57
64
|
| Prop | Type | Default | Description |
|
|
58
65
|
|---|---|---|---|
|
|
@@ -88,12 +95,38 @@ PageContent.Root | PageContent.Section column; Root adds maxWidth and fill,
|
|
|
88
95
|
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children` (Buttons), `className` and the other div attributes. |
|
|
89
96
|
|
|
90
97
|
### PageContent.Body
|
|
91
|
-
`ref` → `HTMLDivElement`. The page content
|
|
98
|
+
`ref` → `HTMLDivElement`. The page content: blocks of one screen 24 apart, a `PageContent.Section` 40 from its neighbours.
|
|
92
99
|
|
|
93
100
|
| Prop | Type | Default | Description |
|
|
94
101
|
|---|---|---|---|
|
|
95
102
|
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children`, `className` and the other div attributes. |
|
|
96
103
|
|
|
104
|
+
### PageContent.Section
|
|
105
|
+
`ref` → `HTMLElement`. A titled section of the page — a `<section>` named by its `h2` (title-m): the heading with an optional description and `PageContent.Actions` at its end, then the content 16 below. Stands 40 from its neighbours in Body.
|
|
106
|
+
|
|
107
|
+
| Prop | Type | Default | Description |
|
|
108
|
+
|---|---|---|---|
|
|
109
|
+
| `label` | `ReactNode` | — (required) | The visible heading (`h2`); it also names the section. |
|
|
110
|
+
| `description` | `ReactNode` | — | One line of context under the heading, in secondary body-s. |
|
|
111
|
+
| `layout` | `"stack" \| "aside"` | `"stack"` | `stack` — the heading over the content; `aside` — a ~16rem heading column beside it (a settings page), above it once the content would get narrower than 30rem. |
|
|
112
|
+
| `…rest` | `Omit<HTMLAttributes<HTMLElement>, "title">` | — | `children` (the content; `PageContent.Actions` goes to the heading row), `className` and the other section attributes. |
|
|
113
|
+
|
|
114
|
+
### PageContent.Grid
|
|
115
|
+
`ref` → `HTMLDivElement`. The grid of the page's tiles (KPI cards, charts, panels): 12 columns, 16 apart on both axes, so its rows read as one board. A size container: cells fold by its own width (see Grid columns).
|
|
116
|
+
|
|
117
|
+
| Prop | Type | Default | Description |
|
|
118
|
+
|---|---|---|---|
|
|
119
|
+
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children` (`PageContent.Cell`), `className` and the other div attributes. |
|
|
120
|
+
|
|
121
|
+
### PageContent.Cell
|
|
122
|
+
`ref` → `HTMLDivElement`. One tile place in `PageContent.Grid`; its child (a Card, a ChartFrame) stretches to it, so the tiles of a row share one height.
|
|
123
|
+
|
|
124
|
+
| Prop | Type | Default | Description |
|
|
125
|
+
|---|---|---|---|
|
|
126
|
+
| `span` | `1 \| 2 \| … \| 12` | `12` | Columns of 12 on a wide grid (64rem+). Narrower grids round it: see Grid columns in COMPONENT.md. |
|
|
127
|
+
| `rows` | `1 \| 2 \| 3 \| 4` | `1` | Rows the cell spans from 40rem: a chart beside two stacked tiles (`ChartFrame.Plot height="fill"` fills the height). |
|
|
128
|
+
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children` (one tile), `className` and the other div attributes. |
|
|
129
|
+
|
|
97
130
|
### PageContent.Split
|
|
98
131
|
`ref` → `HTMLDivElement`. List + detail (mail, a messenger, a ticket queue): side by side from 48rem of its own width, one pane at a time below it, focus following the pane that comes into view.
|
|
99
132
|
|
|
@@ -141,13 +174,27 @@ PageContent.Root | PageContent.Section column; Root adds maxWidth and fill,
|
|
|
141
174
|
| `readable` | Intro line wraps at the reading width | Default, most pages | yes |
|
|
142
175
|
| `full` | Intro uses the full header width | The column is already narrow | |
|
|
143
176
|
|
|
144
|
-
One `PageContent.Title` (`<h1>`) per page;
|
|
177
|
+
One `PageContent.Title` (`<h1>`) per page; a topic inside Body is a `PageContent.Section` (its `h2`). One primary button in Actions, the rest `soft` / `ghost` neutral.
|
|
145
178
|
|
|
146
179
|
### Flags
|
|
147
180
|
| Flag | Looks like when on | Use when | Default |
|
|
148
181
|
|---|---|---|---|
|
|
149
182
|
| `fill` (Root) | the page is as high as main; the body takes what the header leaves; main keeps gutter-high air under it | a full-height table, board, chat or `PageContent.Split` in an `AppShell.Root fillViewport` | `false` |
|
|
150
183
|
|
|
184
|
+
### layout (Section)
|
|
185
|
+
| Value | Looks like | Use when | Default |
|
|
186
|
+
|---|---|---|---|
|
|
187
|
+
| `stack` | the heading row over the content, 16 apart | a topic of a dashboard, a list or a detail page | ✓ |
|
|
188
|
+
| `aside` | a ~16rem heading column beside the content, above it once the content would get < 30rem | a settings page: a heading column beside each panel | |
|
|
189
|
+
|
|
190
|
+
### Grid columns
|
|
191
|
+
| Grid width | Cell `span` 1–3 | `span` 4 | `span` 5–6 | `span` 7–12 | `rows` |
|
|
192
|
+
|---|---|---|---|---|---|
|
|
193
|
+
| < 30rem | the row | the row | the row | the row | — |
|
|
194
|
+
| 30–40rem | half | the row | the row | the row | — |
|
|
195
|
+
| 40–64rem | half | a third | half | the row | spans |
|
|
196
|
+
| ≥ 64rem | its span | its span | its span | its span | spans |
|
|
197
|
+
|
|
151
198
|
### Split layout
|
|
152
199
|
| Value | Looks like | Use when | Default |
|
|
153
200
|
|---|---|---|---|
|
|
@@ -161,14 +208,18 @@ One `PageContent.Title` (`<h1>`) per page; sub-sections inside Body use `title-s
|
|
|
161
208
|
| filling | `fill` | `data-fill="true"` on Root; `AppShell.Main` drops its long bottom air for it |
|
|
162
209
|
| full-width intro | `measure="full"` | `data-measure="full"` on Description |
|
|
163
210
|
| with actions | `PageContent.Actions` child | `data-has-actions="true"` on Header |
|
|
211
|
+
| section heading column | `layout="aside"` on Section | `data-layout="aside"` on Section (absent for `stack`) |
|
|
212
|
+
| section with actions | `PageContent.Actions` child of Section | `data-has-actions="true"` on the section heading row |
|
|
213
|
+
| tile span | `span` / `rows` on Cell | `data-span="1"…"12"` (always), `data-rows="2"…"4"` (absent for 1) |
|
|
164
214
|
| detail open | `open` / `defaultOpen` on Split | `data-open="true"` on Split; narrow: the list is `display: none`, else the detail is |
|
|
165
215
|
| pane swap | `open` changes on a narrow split | the pane that comes into view enters once (`enterMotion.enterBase`: base, opacity + a 4 px rise); focus moves into the detail, or back to the list control; a wide split moves nothing |
|
|
166
216
|
|
|
167
217
|
## Layout & spacing
|
|
168
218
|
- No outer padding: edge gutters come from `AppShell.Main`.
|
|
169
|
-
- Header → Body `--prime-space-
|
|
219
|
+
- Header → Body `--prime-space-6` (24); blocks inside Body `--prime-space-6` (24); a `PageContent.Section` 40 from its neighbours (the body's 24 + `--prime-space-4`); tile → tile in a Grid `--prime-space-4` (16) on both axes; section heading → content `--prime-space-4` (16), heading → description `--prime-space-1` (4); Title → Description `--prime-space-2` (8); buttons in Actions `--prime-space-2`; heading → Actions `--prime-space-6` (24) side by side, `--prime-space-4` (16) once they wrap below.
|
|
170
220
|
- Header is a wrapping row: actions stay to the right of the title while the heading keeps half a reading measure, otherwise they wrap below it — no breakpoint needed, works from 320px.
|
|
171
221
|
- Title and Description wrap long words (`overflow-wrap: anywhere`).
|
|
222
|
+
- Grid lays itself out from its own width (container `prime-grid`), never from the window, so a board beside an open Sidebar folds on its own. A Cell stretches its child: the tiles of a row share one height; a chart in a `rows={2}` cell fills it with `ChartFrame.Plot height="fill"`. `dense` flow lets a small tile fill a hole left by a wide one.
|
|
172
223
|
- `fill` needs a main with a height: `AppShell.Root fillViewport` (main scrolls inside the panel). The body passes its free height on to a filling child — DataTable `scrollHeight="fill"`, Crossfade `fill`, `PageContent.Split`.
|
|
173
224
|
- Split takes the free height of a filling page and lays itself out from its own width (container `prime-split`), never from the window: a split beside an open Sidebar may be narrow on a wide screen. Each pane is a column whose last child takes the free height — put a Card with its own `ScrollContainer` there, so the list and the thread scroll separately. The records of the list pane are a [List](../list/COMPONENT.md).
|
|
174
225
|
- The detail pane is on screen all the time on a wide split: while nothing is chosen it shows a short hint («Выберите диалог»), never an empty card.
|
|
@@ -182,7 +233,8 @@ One `PageContent.Title` (`<h1>`) per page; sub-sections inside Body use `title-s
|
|
|
182
233
|
|
|
183
234
|
### ARIA
|
|
184
235
|
- Title is an `<h1>`; use one per page.
|
|
185
|
-
- Give `PageContent.
|
|
236
|
+
- Give `PageContent.Page` an `aria-labelledby` that points at the Title `id` to name the region.
|
|
237
|
+
- `PageContent.Section` is a `<section>` named by its own `<h2>` (`label`) through `aria-labelledby`, so it is a region landmark with the heading's name; the heading levels go h1 (page) → h2 (section) → h3 (a card title inside it).
|
|
186
238
|
- Name `PageContent.List` and `PageContent.Detail` with `aria-label`. On a narrow split opening the detail moves focus into it and going back returns focus to the list control; the hidden pane is `display: none`, out of Tab and the accessibility tree. The panes take focus from code only (`tabindex="-1"`, no ring).
|
|
187
239
|
- `PageContent.BackButton` is named by `labels.back` and is shown only while the split shows one pane.
|
|
188
240
|
|
|
@@ -198,18 +250,23 @@ One `PageContent.Title` (`<h1>`) per page; sub-sections inside Body use `title-s
|
|
|
198
250
|
|---|---|
|
|
199
251
|
| [overview.tsx](examples/overview.tsx) | A page in the main column: title, description and page actions, then the body blocks — `PageContent.Actions`. |
|
|
200
252
|
| [variants.tsx](examples/variants.tsx) | The same page column at three caps: the whole main, a wide dashboard column, a reading column — `maxWidth`. |
|
|
253
|
+
| [grid.tsx](examples/grid.tsx) | A dashboard board: four KPI tiles, a chart two rows high beside two panels, one gap on both axes — `PageContent.Grid`, `PageContent.Cell`, `span`, `rows`. |
|
|
254
|
+
| [sections.tsx](examples/sections.tsx) | A page with titled sections: tiles of one screen close together, a new topic set off by air, a link at the end of the heading, a heading column beside a panel — `PageContent.Section`, `label`, `description`, `PageContent.Actions`, `layout`. |
|
|
201
255
|
| [list-detail.tsx](examples/list-detail.tsx) | A support inbox as list + detail on a full-height page: side by side on a wide panel, one pane at a time with a back button on a narrow one — `PageContent.Split`, `PageContent.BackButton`, `fill`. |
|
|
202
256
|
| [narrow.tsx](examples/narrow.tsx) | In a phone-width column the page actions wrap under the heading instead of squeezing it. |
|
|
257
|
+
| [screen.tsx](examples/screen.tsx) | A settings page: sections with a heading column and a panel, a form saved by its own button, switches that apply at once and a danger zone with a confirm — `layout`, `maxWidth`. |
|
|
203
258
|
|
|
204
259
|
## Mistakes
|
|
205
260
|
- Padding on `PageContent.Root` to imitate gutters → gutters come from `AppShell.Main`.
|
|
206
261
|
- Actions placed outside Header → put `PageContent.Actions` inside `PageContent.Header` so it aligns with the title and wraps.
|
|
207
|
-
- Several `PageContent.Title` on one page → one `<h1
|
|
208
|
-
-
|
|
262
|
+
- Several `PageContent.Title` on one page → one `<h1>`; a topic of the page is a `PageContent.Section` with its `<h2>`.
|
|
263
|
+
- A hand-made `<section>` + `Typography as="h2"` + own gap CSS → `PageContent.Section label`.
|
|
264
|
+
- Each row of cards in its own auto-fit grid → the rows stand 24 apart instead of 16; put every tile of the screen in one `PageContent.Grid`.
|
|
265
|
+
- Margins between blocks in Body → Body already sets the 24 gap and the 40 around a Section.
|
|
209
266
|
- Computing a height from `100vh` minus the header for a full-height table or chat → `PageContent.Root fill` and a filling child.
|
|
210
267
|
- A list + detail built with window media queries → `PageContent.Split` follows its own width.
|
|
211
268
|
- Unmounting the detail content the moment the narrow split goes back → keep the last record until another is chosen (the pane leaves with it on screen).
|
|
212
269
|
|
|
213
270
|
## Related
|
|
214
271
|
- **Built from:** [Button](../button/COMPONENT.md) (`PageContent.BackButton`), Icon (`nav.chevronLeft`)
|
|
215
|
-
- **See also:** [AppShell](../../layout/app-shell/COMPONENT.md), [Sidebar](../../layout/sidebar/COMPONENT.md), [Card](../card/COMPONENT.md), [List](../list/COMPONENT.md), [EmptyPage](../empty-page/COMPONENT.md), [ScrollContainer](../scroll-container/COMPONENT.md), [Drawer](../drawer/COMPONENT.md)
|
|
272
|
+
- **See also:** [AppShell](../../layout/app-shell/COMPONENT.md), [Sidebar](../../layout/sidebar/COMPONENT.md), [Card](../card/COMPONENT.md), [ChartFrame](../chart-frame/COMPONENT.md), [List](../list/COMPONENT.md), [EmptyPage](../empty-page/COMPONENT.md), [ScrollContainer](../scroll-container/COMPONENT.md), [Drawer](../drawer/COMPONENT.md)
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/** A dashboard board: four KPI tiles, a chart two rows high beside two panels, one gap on both axes — `PageContent.Grid`, `PageContent.Cell`, `span`, `rows`. */
|
|
2
|
+
import { Card, ChartFrame, type ChartFrameSeries, chartColors, PageContent } from "prime-ui-kit";
|
|
3
|
+
|
|
4
|
+
import styles from "./examples.module.css";
|
|
5
|
+
|
|
6
|
+
const KPIS = [
|
|
7
|
+
{ label: "Выручка", value: "4,8 млн ₽", delta: "+12% к сентябрю", tone: "success" },
|
|
8
|
+
{ label: "Заказы", value: "1 284", delta: "+6% к сентябрю", tone: "success" },
|
|
9
|
+
{ label: "Средний чек", value: "3 740 ₽", delta: "−2% к сентябрю", tone: "danger" },
|
|
10
|
+
{ label: "Возвраты", value: "1,8%", delta: "без изменений", tone: "neutral" },
|
|
11
|
+
] as const;
|
|
12
|
+
|
|
13
|
+
const SERIES: ChartFrameSeries[] = [{ id: "orders", label: "Заказы" }];
|
|
14
|
+
|
|
15
|
+
const WEEKS = [
|
|
16
|
+
{ week: "1 нед", orders: 268 },
|
|
17
|
+
{ week: "2 нед", orders: 301 },
|
|
18
|
+
{ week: "3 нед", orders: 287 },
|
|
19
|
+
{ week: "4 нед", orders: 334 },
|
|
20
|
+
{ week: "5 нед", orders: 352 },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const MARGIN = { top: 8, right: 8, bottom: 24, left: 8 };
|
|
24
|
+
|
|
25
|
+
const formatOrders = (value: number) => `${value.toLocaleString("ru-RU")} заказов`;
|
|
26
|
+
|
|
27
|
+
export default function PageContentGridExample() {
|
|
28
|
+
return (
|
|
29
|
+
<div className={styles.main}>
|
|
30
|
+
<PageContent.Body>
|
|
31
|
+
<PageContent.Grid>
|
|
32
|
+
{KPIS.map((kpi) => (
|
|
33
|
+
<PageContent.Cell key={kpi.label} span={3}>
|
|
34
|
+
<Card.Root variant="stat-trend">
|
|
35
|
+
<Card.Label>{kpi.label}</Card.Label>
|
|
36
|
+
<Card.Value>{kpi.value}</Card.Value>
|
|
37
|
+
<Card.Delta tone={kpi.tone}>{kpi.delta}</Card.Delta>
|
|
38
|
+
</Card.Root>
|
|
39
|
+
</PageContent.Cell>
|
|
40
|
+
))}
|
|
41
|
+
<PageContent.Cell span={8} rows={2}>
|
|
42
|
+
<ChartFrame.Root series={SERIES} formatValue={formatOrders}>
|
|
43
|
+
<ChartFrame.Header>
|
|
44
|
+
<ChartFrame.Title>Заказы по неделям</ChartFrame.Title>
|
|
45
|
+
<ChartFrame.Description>Октябрь</ChartFrame.Description>
|
|
46
|
+
</ChartFrame.Header>
|
|
47
|
+
<ChartFrame.Plot
|
|
48
|
+
height="fill"
|
|
49
|
+
renderPlot={({ width, height, series }) => {
|
|
50
|
+
const max = Math.max(...WEEKS.map((w) => w.orders));
|
|
51
|
+
const innerW = width - MARGIN.left - MARGIN.right;
|
|
52
|
+
const innerH = height - MARGIN.top - MARGIN.bottom;
|
|
53
|
+
const slot = innerW / WEEKS.length;
|
|
54
|
+
const bar = slot * 0.56;
|
|
55
|
+
return (
|
|
56
|
+
<svg width={width} height={height} aria-hidden="true">
|
|
57
|
+
<line
|
|
58
|
+
x1={MARGIN.left}
|
|
59
|
+
x2={width - MARGIN.right}
|
|
60
|
+
y1={MARGIN.top + innerH}
|
|
61
|
+
y2={MARGIN.top + innerH}
|
|
62
|
+
stroke={chartColors.axis}
|
|
63
|
+
/>
|
|
64
|
+
{WEEKS.map((w, i) => {
|
|
65
|
+
const h = (innerH * w.orders) / max;
|
|
66
|
+
const x = MARGIN.left + slot * i + (slot - bar) / 2;
|
|
67
|
+
return (
|
|
68
|
+
<g key={w.week} data-hidden={series[0].hidden}>
|
|
69
|
+
<rect
|
|
70
|
+
x={x}
|
|
71
|
+
y={MARGIN.top + innerH - h}
|
|
72
|
+
width={bar}
|
|
73
|
+
height={h}
|
|
74
|
+
rx={4}
|
|
75
|
+
fill={series[0].color}
|
|
76
|
+
/>
|
|
77
|
+
<text x={x + bar / 2} y={height - 4} textAnchor="middle">
|
|
78
|
+
{w.week}
|
|
79
|
+
</text>
|
|
80
|
+
</g>
|
|
81
|
+
);
|
|
82
|
+
})}
|
|
83
|
+
</svg>
|
|
84
|
+
);
|
|
85
|
+
}}
|
|
86
|
+
/>
|
|
87
|
+
</ChartFrame.Root>
|
|
88
|
+
</PageContent.Cell>
|
|
89
|
+
<PageContent.Cell span={4}>
|
|
90
|
+
<Card.Root variant="stat-trend">
|
|
91
|
+
<Card.Label>Новые клиенты</Card.Label>
|
|
92
|
+
<Card.Value>86</Card.Value>
|
|
93
|
+
<Card.Delta tone="success">+14 к сентябрю</Card.Delta>
|
|
94
|
+
</Card.Root>
|
|
95
|
+
</PageContent.Cell>
|
|
96
|
+
<PageContent.Cell span={4}>
|
|
97
|
+
<Card.Root variant="stat-trend">
|
|
98
|
+
<Card.Label>Ждут оплаты</Card.Label>
|
|
99
|
+
<Card.Value>312 400 ₽</Card.Value>
|
|
100
|
+
<Card.Delta tone="warning">7 счетов</Card.Delta>
|
|
101
|
+
</Card.Root>
|
|
102
|
+
</PageContent.Cell>
|
|
103
|
+
</PageContent.Grid>
|
|
104
|
+
</PageContent.Body>
|
|
105
|
+
</div>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
@@ -45,9 +45,6 @@ export default function PageContentListDetailExample() {
|
|
|
45
45
|
return (
|
|
46
46
|
<div className={styles.fillMain}>
|
|
47
47
|
<PageContent.Root fill>
|
|
48
|
-
<PageContent.Header>
|
|
49
|
-
<PageContent.Title>Обращения</PageContent.Title>
|
|
50
|
-
</PageContent.Header>
|
|
51
48
|
<PageContent.Body>
|
|
52
49
|
<PageContent.Split
|
|
53
50
|
open={dialogId !== null}
|
|
@@ -6,7 +6,7 @@ import styles from "./examples.module.css";
|
|
|
6
6
|
export default function PageContentOverviewExample() {
|
|
7
7
|
return (
|
|
8
8
|
<div className={styles.main}>
|
|
9
|
-
<PageContent.
|
|
9
|
+
<PageContent.Page aria-labelledby="settings-heading">
|
|
10
10
|
<PageContent.Header>
|
|
11
11
|
<PageContent.Title id="settings-heading">Настройки</PageContent.Title>
|
|
12
12
|
<PageContent.Description>
|
|
@@ -35,7 +35,7 @@ export default function PageContentOverviewExample() {
|
|
|
35
35
|
</Card.Body>
|
|
36
36
|
</Card.Root>
|
|
37
37
|
</PageContent.Body>
|
|
38
|
-
</PageContent.
|
|
38
|
+
</PageContent.Page>
|
|
39
39
|
</div>
|
|
40
40
|
);
|
|
41
41
|
}
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
/* Settings page:
|
|
2
|
-
|
|
3
|
-
.section {
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-wrap: wrap;
|
|
6
|
-
align-items: flex-start;
|
|
7
|
-
gap: var(--prime-space-4) var(--prime-space-10);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/* ~16rem of heading and lead text; drops above the panel once the panel would get < 30rem. */
|
|
11
|
-
.lead {
|
|
12
|
-
display: grid;
|
|
13
|
-
flex: 1 1 calc(var(--prime-space-16) * 4);
|
|
14
|
-
gap: var(--prime-space-1);
|
|
15
|
-
min-width: 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.panel {
|
|
19
|
-
flex: 999 1 calc(var(--prime-space-24) * 5);
|
|
20
|
-
min-width: 0;
|
|
21
|
-
}
|
|
1
|
+
/* Settings page: each section is a PageContent.Section layout="aside"; here only the panels' insides. */
|
|
22
2
|
|
|
23
3
|
/* Field → field 20. */
|
|
24
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** A settings page: sections with a heading column and a panel, a form saved by its own button, switches that apply at once and a danger zone with a confirm
|
|
1
|
+
/** A settings page: sections with a heading column and a panel, a form saved by its own button, switches that apply at once and a danger zone with a confirm — `layout`, `maxWidth`. */
|
|
2
2
|
import {
|
|
3
3
|
Button,
|
|
4
4
|
Card,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "prime-ui-kit";
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
|
|
16
|
-
import styles from "./
|
|
16
|
+
import styles from "./screen.module.css";
|
|
17
17
|
|
|
18
18
|
const TIMEZONES = [
|
|
19
19
|
{ value: "Europe/Kaliningrad", label: "Калининград (UTC+2)" },
|
|
@@ -45,7 +45,7 @@ const ALERTS = [
|
|
|
45
45
|
},
|
|
46
46
|
];
|
|
47
47
|
|
|
48
|
-
export default function
|
|
48
|
+
export default function PageContentScreenExample() {
|
|
49
49
|
const [innError, setInnError] = React.useState<string>();
|
|
50
50
|
const [saving, setSaving] = React.useState(false);
|
|
51
51
|
const [saved, setSaved] = React.useState(false);
|
|
@@ -78,21 +78,12 @@ export default function SettingsPagePattern() {
|
|
|
78
78
|
</PageContent.Description>
|
|
79
79
|
</PageContent.Header>
|
|
80
80
|
<PageContent.Body>
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
Попадают в счета, акты и письма клиентам.
|
|
88
|
-
</Typography>
|
|
89
|
-
</div>
|
|
90
|
-
<form
|
|
91
|
-
className={styles.panel}
|
|
92
|
-
noValidate
|
|
93
|
-
onSubmit={save}
|
|
94
|
-
onReset={() => setInnError(undefined)}
|
|
95
|
-
>
|
|
81
|
+
<PageContent.Section
|
|
82
|
+
layout="aside"
|
|
83
|
+
label="Компания"
|
|
84
|
+
description="Попадают в счета, акты и письма клиентам."
|
|
85
|
+
>
|
|
86
|
+
<form noValidate onSubmit={save} onReset={() => setInnError(undefined)}>
|
|
96
87
|
<Card.Root variant="panel">
|
|
97
88
|
<Card.Body>
|
|
98
89
|
<Fieldset disabled={saving}>
|
|
@@ -144,73 +135,61 @@ export default function SettingsPagePattern() {
|
|
|
144
135
|
</Card.Footer>
|
|
145
136
|
</Card.Root>
|
|
146
137
|
</form>
|
|
147
|
-
</
|
|
138
|
+
</PageContent.Section>
|
|
148
139
|
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
<Switch.Root
|
|
164
|
-
key={alert.name}
|
|
165
|
-
name={alert.name}
|
|
166
|
-
defaultChecked={alert.defaultChecked}
|
|
167
|
-
hint={alert.hint}
|
|
168
|
-
>
|
|
169
|
-
<Switch.Label>{alert.label}</Switch.Label>
|
|
170
|
-
</Switch.Root>
|
|
171
|
-
))}
|
|
172
|
-
</Fieldset>
|
|
173
|
-
</Card.Body>
|
|
174
|
-
</Card.Root>
|
|
175
|
-
</div>
|
|
176
|
-
</section>
|
|
177
|
-
|
|
178
|
-
<section className={styles.section} aria-labelledby="danger-title">
|
|
179
|
-
<div className={styles.lead}>
|
|
180
|
-
<Typography as="h2" variant="title-m" id="danger-title">
|
|
181
|
-
Рабочее пространство
|
|
182
|
-
</Typography>
|
|
183
|
-
<Typography variant="body-m" tone="secondary">
|
|
184
|
-
Действия, которые нельзя отменить.
|
|
185
|
-
</Typography>
|
|
186
|
-
</div>
|
|
187
|
-
<div className={styles.panel}>
|
|
188
|
-
<Card.Root variant="panel">
|
|
189
|
-
<Card.Body>
|
|
190
|
-
<div className={styles.danger}>
|
|
191
|
-
<div className={styles.dangerText}>
|
|
192
|
-
<Typography variant="title-s">Удалить пространство</Typography>
|
|
193
|
-
<Typography variant="body-s" tone="secondary">
|
|
194
|
-
Счета, клиенты и история будут удалены для всех участников.
|
|
195
|
-
</Typography>
|
|
196
|
-
</div>
|
|
197
|
-
<ConfirmDialog.Root
|
|
198
|
-
title="Удалить «Прайм Софт»?"
|
|
199
|
-
description="312 счетов, 48 клиентов и вся история удалятся без возможности восстановления."
|
|
200
|
-
confirmLabel="Удалить пространство"
|
|
201
|
-
onConfirm={removeWorkspace}
|
|
140
|
+
<PageContent.Section
|
|
141
|
+
layout="aside"
|
|
142
|
+
label="Уведомления"
|
|
143
|
+
description="Включаются сразу, без сохранения."
|
|
144
|
+
>
|
|
145
|
+
<Card.Root variant="panel">
|
|
146
|
+
<Card.Body>
|
|
147
|
+
<Fieldset aria-label="Уведомления">
|
|
148
|
+
{ALERTS.map((alert) => (
|
|
149
|
+
<Switch.Root
|
|
150
|
+
key={alert.name}
|
|
151
|
+
name={alert.name}
|
|
152
|
+
defaultChecked={alert.defaultChecked}
|
|
153
|
+
hint={alert.hint}
|
|
202
154
|
>
|
|
203
|
-
<
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
155
|
+
<Switch.Label>{alert.label}</Switch.Label>
|
|
156
|
+
</Switch.Root>
|
|
157
|
+
))}
|
|
158
|
+
</Fieldset>
|
|
159
|
+
</Card.Body>
|
|
160
|
+
</Card.Root>
|
|
161
|
+
</PageContent.Section>
|
|
162
|
+
|
|
163
|
+
<PageContent.Section
|
|
164
|
+
layout="aside"
|
|
165
|
+
label="Рабочее пространство"
|
|
166
|
+
description="Действия, которые нельзя отменить."
|
|
167
|
+
>
|
|
168
|
+
<Card.Root variant="panel">
|
|
169
|
+
<Card.Body>
|
|
170
|
+
<div className={styles.danger}>
|
|
171
|
+
<div className={styles.dangerText}>
|
|
172
|
+
<Typography variant="title-s">Удалить пространство</Typography>
|
|
173
|
+
<Typography variant="body-s" tone="secondary">
|
|
174
|
+
Счета, клиенты и история будут удалены для всех участников.
|
|
175
|
+
</Typography>
|
|
209
176
|
</div>
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
177
|
+
<ConfirmDialog.Root
|
|
178
|
+
title="Удалить «Прайм Софт»?"
|
|
179
|
+
description="312 счетов, 48 клиентов и вся история удалятся без возможности восстановления."
|
|
180
|
+
confirmLabel="Удалить пространство"
|
|
181
|
+
onConfirm={removeWorkspace}
|
|
182
|
+
>
|
|
183
|
+
<ConfirmDialog.Trigger>
|
|
184
|
+
<Button.Root variant="outline" tone="danger">
|
|
185
|
+
Удалить
|
|
186
|
+
</Button.Root>
|
|
187
|
+
</ConfirmDialog.Trigger>
|
|
188
|
+
</ConfirmDialog.Root>
|
|
189
|
+
</div>
|
|
190
|
+
</Card.Body>
|
|
191
|
+
</Card.Root>
|
|
192
|
+
</PageContent.Section>
|
|
214
193
|
</PageContent.Body>
|
|
215
194
|
</PageContent.Root>
|
|
216
195
|
);
|