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,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Router links as the brand and the items: the router sets `aria-current` and the item shows as current; render it inside a router — `asChild`. */
|
|
2
2
|
import { Icon, Sidebar } from "prime-ui-kit";
|
|
3
|
-
import { NavLink } from "react-router-dom";
|
|
3
|
+
import { Link, NavLink } from "react-router-dom";
|
|
4
4
|
|
|
5
5
|
import styles from "./examples.module.css";
|
|
6
6
|
|
|
@@ -14,6 +14,18 @@ export default function SidebarRouterExample() {
|
|
|
14
14
|
return (
|
|
15
15
|
<div className={styles.stage}>
|
|
16
16
|
<Sidebar.Root offCanvas="never">
|
|
17
|
+
<Sidebar.Header>
|
|
18
|
+
<Sidebar.Brand asChild description="Документация">
|
|
19
|
+
<Link to="/">
|
|
20
|
+
<Sidebar.BrandLogo>
|
|
21
|
+
<span className={styles.logo}>
|
|
22
|
+
<Icon name="object.book" />
|
|
23
|
+
</span>
|
|
24
|
+
</Sidebar.BrandLogo>
|
|
25
|
+
Prime UI
|
|
26
|
+
</Link>
|
|
27
|
+
</Sidebar.Brand>
|
|
28
|
+
</Sidebar.Header>
|
|
17
29
|
<Sidebar.Content>
|
|
18
30
|
{LINKS.map((link) => (
|
|
19
31
|
<Sidebar.Item key={link.to} asChild>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Labelled groups and the optional item parts: a plain count,
|
|
1
|
+
/** Labelled groups and the optional item parts: a plain count, coloured and solid badges, a key hint, a trailing icon, row actions with the default and an own glyph and a disabled section — `Sidebar.Group`, `Sidebar.ItemCount`, `color`, `variant`, `Sidebar.ItemShortcut`, `Sidebar.ItemAction`, `disabled`. */
|
|
2
2
|
import { Icon, Kbd, Sidebar } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
import styles from "./examples.module.css";
|
|
@@ -29,7 +29,9 @@ export default function SidebarStructureExample() {
|
|
|
29
29
|
<Icon name="object.bell" />
|
|
30
30
|
</Sidebar.ItemIcon>
|
|
31
31
|
Уведомления
|
|
32
|
-
<Sidebar.ItemCount color="red">
|
|
32
|
+
<Sidebar.ItemCount color="red" variant="solid">
|
|
33
|
+
7
|
|
34
|
+
</Sidebar.ItemCount>
|
|
33
35
|
</Sidebar.Item>
|
|
34
36
|
</Sidebar.Group>
|
|
35
37
|
<Sidebar.Group label="Работа">
|
|
@@ -54,6 +56,9 @@ export default function SidebarStructureExample() {
|
|
|
54
56
|
</Sidebar.ItemIcon>
|
|
55
57
|
Интеграции
|
|
56
58
|
<Sidebar.ItemCount color="orange">!</Sidebar.ItemCount>
|
|
59
|
+
<Sidebar.ItemAction label="Синхронизировать интеграции" onClick={() => {}}>
|
|
60
|
+
<Icon name="action.refresh" />
|
|
61
|
+
</Sidebar.ItemAction>
|
|
57
62
|
</Sidebar.Item>
|
|
58
63
|
</Sidebar.Group>
|
|
59
64
|
<Sidebar.Group label="Администрирование">
|
package/dist/skill/responsive.md
CHANGED
|
@@ -47,10 +47,10 @@ Use these as they are; never wrap them in your own breakpoints.
|
|
|
47
47
|
|
|
48
48
|
| Need | Built in |
|
|
49
49
|
|---|---|
|
|
50
|
-
| app frame | AppShell gutters 16 → 24 → 32; `AppHeader` un-sticks on screens lower than 480px, respects safe areas and, below 36rem of its width, drops the
|
|
50
|
+
| app frame | AppShell gutters 16 → 24 → 32; `AppHeader` un-sticks on screens lower than 480px, respects safe areas and, below 36rem of its width, drops the title icon, the title and its line of data truncate |
|
|
51
51
|
| app navigation | Sidebar: on-canvas from 768px, an off-canvas panel below (`offCanvas="auto"`) opened by `AppHeader.MenuButton`, which shows itself below 768px; `BottomNav` in `AppShell.Footer` for 2–6 app sections on phones — flat or a floating glass capsule (`floating`) with an optional round `BottomNav.Action`, icons with or without labels (`iconOnly`); the shell hides it by itself while the Sidebar rail is on screen (from 768px with `offCanvas="auto"`) |
|
|
52
52
|
| page panel | `PageToolbar` — search and filter first, one row when wide, stacked rows when narrow (below) |
|
|
53
|
-
| page header | `PageContent.Header`: actions wrap under the title |
|
|
53
|
+
| page header | `AppHeader`: the page's tools wrap under the title (`AppHeader.Tools`), the primary action takes its own row when the search would be squeezed; a document page's `PageContent.Header`: actions wrap under the title |
|
|
54
54
|
| switchers | SegmentedControl and Tabs never wrap: they scroll inside themselves (hidden scrollbar, faded edges, a vertical wheel scrolls them sideways), the active item is scrolled into view, stretched items tend to equal width, the indicator moves only after a person's choice; Tabs collapse icons and descriptions first |
|
|
55
55
|
| tables | DataTable scrolls inside itself, edge shadows show hidden columns, `stickyFirstColumn`, `DataTable.ColumnsMenu` for a column chooser, the toolbar stacks below a 30rem table, sticky head off on short screens |
|
|
56
56
|
| floating layers | Popover (opened from a Trigger), Dropdown, Select (and Datepicker, ColorPresets) never wider than the viewport − 16, 8 from the edges, flip when out of room; below 640 they open as a bottom sheet — scrim, grab handle, swipe down to close, page scroll locked; Tooltip and TagSelect stay anchored |
|
|
@@ -208,9 +208,11 @@ export function OrdersPanel() {
|
|
|
208
208
|
`toolbar`; the key column `hideable: false`); `stickyFirstColumn` for the name. On phones a table / cards switch in `PageToolbar.View` is fine — silently dropping columns
|
|
209
209
|
by breakpoint is not. Never ask to rotate the phone.
|
|
210
210
|
|
|
211
|
-
**Card grids.**
|
|
212
|
-
|
|
213
|
-
|
|
211
|
+
**Card grids.** The tiles of a page are `PageContent.Grid` + `PageContent.Cell span`: it folds by its own
|
|
212
|
+
width (below 30rem every tile takes the row, then small tiles pair up, from 64rem each its span),
|
|
213
|
+
not by the window. Tiles of a row share one height; a card with a list shows 6–8 rows and scrolls inside
|
|
214
|
+
(`ScrollContainer`). A grid inside one block (thumbnails, fields) is the block's own
|
|
215
|
+
`repeat(auto-fill, minmax(min(100%, …), 1fr))`.
|
|
214
216
|
|
|
215
217
|
**Forms.** One column on phones. Pairs («от / до», two buttons) wrap with
|
|
216
218
|
`flex: 1 1 calc(var(--prime-space-24) * 2)` instead of shrinking. Labels above fields (the kit's
|
package/dist/skill/ux.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# UX — what to show and how to arrange it
|
|
2
|
+
|
|
3
|
+
The rest of the skill says how a screen looks. This file says what goes on it: which shape the data
|
|
4
|
+
takes on screen, how many words it needs, how much friction an action deserves, what a person must
|
|
5
|
+
never have to guess. Read it before the layout, and again when you change a screen someone already
|
|
6
|
+
built.
|
|
7
|
+
|
|
8
|
+
## 1. Brief before code
|
|
9
|
+
|
|
10
|
+
Before the first line of JSX, write five lines (in your reply, not in a file):
|
|
11
|
+
|
|
12
|
+
1. **Who and what for** — the person and the decision this screen helps them make («менеджер
|
|
13
|
+
выставляет счёт клиенту»).
|
|
14
|
+
2. **The data** — every entity on the screen and its shape: one record, a collection, a value with
|
|
15
|
+
variants, a base value with overrides (§2).
|
|
16
|
+
3. **The main action** — one per area; everything else is secondary.
|
|
17
|
+
4. **States** — which of loading, empty, error, disabled, read-only, saving, saved this screen
|
|
18
|
+
really has.
|
|
19
|
+
5. **The narrow screen** — what stacks, what scrolls, what moves to a menu.
|
|
20
|
+
|
|
21
|
+
The layout follows from the brief. A screen laid out without it repeats labels, splits records and
|
|
22
|
+
adds text that explains what the layout failed to show.
|
|
23
|
+
|
|
24
|
+
## 2. The shape of the data decides the layout
|
|
25
|
+
|
|
26
|
+
| The data | On screen | With |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| One record, read | label · value pairs | `DescriptionList` |
|
|
29
|
+
| One record, edited | a form: fields 20 apart, groups 32 apart | `Fieldset`, fields |
|
|
30
|
+
| One record of 2–4 short fields in a form | one row of fields | an `auto-fit` grid |
|
|
31
|
+
| Records of one shape a person adds, edits, removes | one row per record, the headings once above | `FieldList` |
|
|
32
|
+
| Records of one shape a person reads, sorts, filters | a table | `DataTable` |
|
|
33
|
+
| One value in several units or currencies (a deposit in ₽, $, ฿) | the fields side by side in one row under one heading, the unit in each field | `Input.InlineAffix` |
|
|
34
|
+
| A base value and its overrides (a price and its changes by month) | one list: the base is the first, pinned row | `FieldList` `getLocked` |
|
|
35
|
+
| Small attributes of a record (an icon, a color, a flag) | compact controls in the record's row, not fields of their own | icon-only `Select`, `ColorPresets`, `Checkbox` |
|
|
36
|
+
| Short texts in an order the person sets | one column, a handle per row | `FieldList` `reorderable` |
|
|
37
|
+
| Settings that most people never touch | behind a disclosure, after the common ones | `Accordion`, a «Дополнительно» section |
|
|
38
|
+
| A choice of 2–5 options | all visible | `Radio.Group`, `SegmentedControl` |
|
|
39
|
+
| A choice of 6+ options | a list that opens | `Select` |
|
|
40
|
+
| Many values picked from options | tags | `TagSelect` |
|
|
41
|
+
|
|
42
|
+
One record is one row or one block, never half a record per line. If a record does not fit one
|
|
43
|
+
row, it is not a row: open it in a `Drawer`.
|
|
44
|
+
|
|
45
|
+
## 3. Label economy
|
|
46
|
+
|
|
47
|
+
Every word on screen must carry something the person does not see already.
|
|
48
|
+
|
|
49
|
+
- **A label once per column, not per row.** Records in rows have their headings above the first
|
|
50
|
+
row only (`FieldList` draws them and names every field by its heading for screen readers).
|
|
51
|
+
- **No numbered labels.** «Преимущество 1», «Преимущество 2» repeat the heading and count what the
|
|
52
|
+
list already counts. The list label names the rows.
|
|
53
|
+
- **No label that repeats its heading.** A field «Цена» inside the section «Цена» needs no label of
|
|
54
|
+
its own beyond what the section says; a group of one field is the field.
|
|
55
|
+
- **A unit lives in one place.** In the field (`Input.InlineAffix`) or in the heading, never both.
|
|
56
|
+
Prefer the field: the unit stays beside the number when the row stacks.
|
|
57
|
+
- **No text that explains the layout.** «Двигатель, места и скорость всегда первыми» — the lock on
|
|
58
|
+
those rows says it. A hint says what the person cannot see (a format, a consequence, a limit).
|
|
59
|
+
- **One name per thing.** The same action, entity and status keep one word on the whole screen
|
|
60
|
+
(and across screens): «Счёт», not «Счёт» in the title and «Инвойс» in the button.
|
|
61
|
+
- **Count the labels.** On a form of repeating rows, labels on screen ≤ number of columns + the
|
|
62
|
+
list label. More means a layout bug.
|
|
63
|
+
|
|
64
|
+
## 4. Words
|
|
65
|
+
|
|
66
|
+
The kit's UI language is Russian; these are the rules of its copy.
|
|
67
|
+
|
|
68
|
+
- **Buttons say the verb and the object:** «Выставить счёт», «Добавить позицию», «Удалить проект».
|
|
69
|
+
Never «ОК», «Да», «Подтвердить», «Отправить» without an object when the object is not obvious.
|
|
70
|
+
- **A confirm names the thing and the loss:** «Удалить проект «Север»? Задачи и файлы удалятся
|
|
71
|
+
без возможности восстановления.» — not «Вы уверены?».
|
|
72
|
+
- **An error says how to fix it:** «Формат: +7 912 404-18-20», «Не больше 2 000 символов» — not
|
|
73
|
+
«Неверное значение», «Ошибка».
|
|
74
|
+
- **An empty state says what to do next** and offers it: «Счетов пока нет» + «Выставить счёт». A
|
|
75
|
+
filtered empty state offers to reset the filter.
|
|
76
|
+
- **Sentence case** everywhere: «Новый счёт», not «Новый Счёт».
|
|
77
|
+
- **Numbers as digits:** «3 файла», not «три файла».
|
|
78
|
+
- **Typography:** quotes «ёлочки» (inner „лапки“), a dash — with spaces, ranges with an en dash
|
|
79
|
+
without spaces (10–20), `…` as one character, a non-breaking space before units and after short
|
|
80
|
+
words in a heading (`50 ГБ`, `2 000 ₽`).
|
|
81
|
+
- **Numbers, money and dates through `Intl`**, never by hand: `Intl.NumberFormat("ru-RU", { style:
|
|
82
|
+
"currency", currency: "RUB" })`, `Intl.DateTimeFormat("ru-RU", { day: "numeric", month: "long" })`,
|
|
83
|
+
`date-fns` with the `ru` locale for relative dates.
|
|
84
|
+
- **Loading text ends with `…`:** «Сохраняем…». The kit's own labels already do.
|
|
85
|
+
|
|
86
|
+
## 5. Friction matches the cost of a mistake
|
|
87
|
+
|
|
88
|
+
Pick the lightest step that keeps the person safe ([choosing.md](choosing.md) has the components):
|
|
89
|
+
|
|
90
|
+
| The action | The step |
|
|
91
|
+
|---|---|
|
|
92
|
+
| Reversible, frequent (remove a row, archive, move) | do it at once, «Отменить» in a `Notification` (`action`, commit in `onDismiss`) |
|
|
93
|
+
| One standalone action that is easy to redo by hand | `Button.Root holdToConfirm` |
|
|
94
|
+
| Irreversible loss of work, or a weighty outward action (send an invoice) | `ConfirmDialog` that names the thing and the loss |
|
|
95
|
+
| Bulk destructive | `ConfirmDialog` that names the count («Удалить 12 счетов?») |
|
|
96
|
+
| Leaving a form with changes | `Modal.Guard` / `Drawer.Guard dirty` |
|
|
97
|
+
|
|
98
|
+
A confirm on every action trains people to click through it; the one that mattered is then missed.
|
|
99
|
+
|
|
100
|
+
## 6. Nothing to guess
|
|
101
|
+
|
|
102
|
+
- **A disabled control says why** when the reason is not on screen: a `hint` under the field, a
|
|
103
|
+
line beside the button («Не больше 3», as `FieldList` does at `max`), a `Tooltip` on a wrapper.
|
|
104
|
+
An action a person may never take (no permission) is hidden, not disabled.
|
|
105
|
+
- **The state of a screen is in the URL:** the tab, the filters, the search, the page, the open
|
|
106
|
+
record. A link copied from the address bar opens the same view; Back undoes the last navigation.
|
|
107
|
+
- **Visible status for every action** (the kit does it when you use it): `loading` on the button,
|
|
108
|
+
«Сохранено» on a form that stays, a `Notification` for one that goes away, `aria-busy` rows while
|
|
109
|
+
a save runs.
|
|
110
|
+
- **Recognition over recall:** options are listed, not typed; the current value is shown in the
|
|
111
|
+
control, not in a hint.
|
|
112
|
+
|
|
113
|
+
## 7. Ask less
|
|
114
|
+
|
|
115
|
+
- **Defaults:** prefill what the system knows or can guess — the current period, today's date, the
|
|
116
|
+
person's own company, the last used currency. An empty required field the person always fills the
|
|
117
|
+
same way is a missing default.
|
|
118
|
+
- **The right control for the data:** `inputMode="numeric" | "decimal" | "tel" | "email"`,
|
|
119
|
+
`autoComplete` for personal data, `Datepicker` for a date, `Select` for a closed list. A free text
|
|
120
|
+
field for a closed set of values is a bug.
|
|
121
|
+
- **Progressive disclosure:** the common 80% first; rare settings behind an `Accordion` item or a
|
|
122
|
+
«Дополнительно» section; a long create flow in steps (`Stepper`).
|
|
123
|
+
- **Group by meaning, order by use:** fields in the order a person has the information (company →
|
|
124
|
+
contact → payment), the most used first in every list.
|
|
125
|
+
|
|
126
|
+
## 8. Changing a screen someone built
|
|
127
|
+
|
|
128
|
+
1. **Audit before editing.** Go through [checklist.md](checklist.md), [anti-slop.md](anti-slop.md)
|
|
129
|
+
and §2–§7 of this file for the whole screen, and list what breaks the rules.
|
|
130
|
+
2. **Fix the shape first:** repeated labels, split records, wrong control for the data, text that
|
|
131
|
+
explains the layout — these come before spacing and color.
|
|
132
|
+
3. **Keep what works:** the screen's skeleton, its data flow and its names, unless they are the
|
|
133
|
+
problem.
|
|
134
|
+
4. Then make the requested change on the cleaned screen.
|
|
135
|
+
|
|
136
|
+
## 9. Look at it before handing it over
|
|
137
|
+
|
|
138
|
+
Code that passes every check can still read badly. Open the screen in a browser and look:
|
|
139
|
+
|
|
140
|
+
- **Both themes**, **1280 px and 375 px** wide, and the narrow container of every panel.
|
|
141
|
+
- **Count:** labels on a form of rows (§3), primary buttons per area (one), sizes per row (one).
|
|
142
|
+
- **Read every text aloud:** a word that repeats its neighbour, a hint that explains the layout, a
|
|
143
|
+
button without an object — remove or rewrite it.
|
|
144
|
+
- **Fill it badly:** the longest real name, an empty list, an error on every field, the slowest
|
|
145
|
+
load. Nothing overflows, jumps or flips.
|
|
@@ -638,6 +638,8 @@ export declare const semanticTokens: {
|
|
|
638
638
|
readonly mediaViewer: {
|
|
639
639
|
readonly pageGap: "{space.6}";
|
|
640
640
|
readonly inset: "{space.4}";
|
|
641
|
+
/** The widest the caption and the video control bar stand. */
|
|
642
|
+
readonly barWidth: "40rem";
|
|
641
643
|
};
|
|
642
644
|
/**
|
|
643
645
|
* Chat bubble geometry (`Message`): the corner radius (one on every corner of every bubble), the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prime-ui-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"packageManager": "bun@1.3.13",
|
|
5
5
|
"description": "React 19 UI kit for product interfaces: 79 composable components on one design contract — forms, selects, tables, overlays, navigation, app shell. CSS Modules, --prime-* tokens, light and dark themes, TypeScript, a11y, Next.js App Router ready. Ships COMPONENT.md docs, copyable examples and an agent skill.",
|
|
6
6
|
"bin": {
|
|
@@ -67,7 +67,7 @@ Avatar.Group overlapping row, gives its size to members
|
|
|
67
67
|
|
|
68
68
|
| Prop | Type | Default | Description |
|
|
69
69
|
|---|---|---|---|
|
|
70
|
-
| `status` | `"online" \| "offline" \| "away" \| "busy"` | — (required) | Presence state: green
|
|
70
|
+
| `status` | `"online" \| "offline" \| "away" \| "busy"` | — (required) | Presence state, told by shape and color: `online` a full green dot, `away` a warning crescent, `busy` a danger dot with a bar, `offline` a hollow gray ring. |
|
|
71
71
|
| `labels` | `Partial<AvatarStatusLabels>` | — | Accessible names of the states, see Labels. |
|
|
72
72
|
| `…rest` | `Omit<HTMLAttributes<HTMLSpanElement>, "children">` | — | `className` and the other span attributes. |
|
|
73
73
|
|
|
@@ -129,7 +129,7 @@ No keyboard interaction.
|
|
|
129
129
|
|
|
130
130
|
### ARIA
|
|
131
131
|
- `Avatar.Image` `alt`: empty when the name is written next to it, otherwise the name. Without a photo and without a name nearby, put `aria-label` on `Avatar.Root`.
|
|
132
|
-
- `Avatar.Status` is `role="img"` with `aria-label` from `labels`.
|
|
132
|
+
- `Avatar.Status` is `role="img"` with `aria-label` from `labels`. Every state has its own shape (full dot, crescent, dot with a bar, hollow ring), so presence never rests on color alone.
|
|
133
133
|
- `Avatar.Group` is `role="group"`; give it `aria-label`. Give `Avatar.Overflow` an `aria-label` («Ещё 3 участника»).
|
|
134
134
|
|
|
135
135
|
### Labels
|
|
@@ -148,8 +148,8 @@ No keyboard interaction.
|
|
|
148
148
|
| [overview.tsx](examples/overview.tsx) | A photo with initials underneath while it loads, and initials alone — `Avatar.Image`, `Avatar.Fallback`. |
|
|
149
149
|
| [variants.tsx](examples/variants.tsx) | Every palette hue of the fallback; derive it from a stable user id — `color`. |
|
|
150
150
|
| [sizes.tsx](examples/sizes.tsx) | Every diameter, 20 to 64 px; initials take 40% of it — `size`. |
|
|
151
|
-
| [states.tsx](examples/states.tsx) | A loaded photo, a broken URL that falls back to initials, and an icon fallback for a guest. |
|
|
152
|
-
| [presence.tsx](examples/presence.tsx) | A presence dot on the avatar edge
|
|
151
|
+
| [states.tsx](examples/states.tsx) | A loaded photo, a broken URL that falls back to initials, and an icon fallback for a guest — `Avatar.Image`, `Avatar.Fallback`. |
|
|
152
|
+
| [presence.tsx](examples/presence.tsx) | A presence dot on the avatar edge: each state has its own shape and color and is announced by its name — `Avatar.Status`, `labels`. |
|
|
153
153
|
| [team-group.tsx](examples/team-group.tsx) | Project members as an overlapping row with a «+N» cell; the group size goes to every member — `Avatar.Group`, `Avatar.Overflow`, `size`. |
|
|
154
154
|
| [src-from-state.tsx](examples/src-from-state.tsx) | A new photo source restarts loading; initials show until the new photo arrives — `src`. |
|
|
155
155
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** A presence dot on the avatar edge
|
|
1
|
+
/** A presence dot on the avatar edge: each state has its own shape and color and is announced by its name — `Avatar.Status`, `labels`. */
|
|
2
2
|
import { Avatar, Typography } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
import styles from "./examples.module.css";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** A loaded photo, a broken URL that falls back to initials, and an icon fallback for a guest. */
|
|
1
|
+
/** A loaded photo, a broken URL that falls back to initials, and an icon fallback for a guest — `Avatar.Image`, `Avatar.Fallback`. */
|
|
2
2
|
import { Avatar, Icon, Typography } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
const PHOTO = "https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=128&h=128&fit=crop";
|
|
@@ -7,7 +7,7 @@ export default function AvatarStatesExample() {
|
|
|
7
7
|
return (
|
|
8
8
|
<div>
|
|
9
9
|
<div>
|
|
10
|
-
<Avatar.Root
|
|
10
|
+
<Avatar.Root color="green">
|
|
11
11
|
<Avatar.Image src={PHOTO} alt="Михаил Котов" />
|
|
12
12
|
<Avatar.Fallback>МК</Avatar.Fallback>
|
|
13
13
|
</Avatar.Root>
|
|
@@ -16,7 +16,7 @@ export default function AvatarStatesExample() {
|
|
|
16
16
|
</Typography>
|
|
17
17
|
</div>
|
|
18
18
|
<div>
|
|
19
|
-
<Avatar.Root
|
|
19
|
+
<Avatar.Root color="orange">
|
|
20
20
|
<Avatar.Image src="https://example.com/missing-avatar.png" alt="Сергей Лебедев" />
|
|
21
21
|
<Avatar.Fallback>СЛ</Avatar.Fallback>
|
|
22
22
|
</Avatar.Root>
|
|
@@ -25,9 +25,9 @@ export default function AvatarStatesExample() {
|
|
|
25
25
|
</Typography>
|
|
26
26
|
</div>
|
|
27
27
|
<div>
|
|
28
|
-
<Avatar.Root
|
|
28
|
+
<Avatar.Root aria-label="Гость">
|
|
29
29
|
<Avatar.Fallback>
|
|
30
|
-
<Icon name="
|
|
30
|
+
<Icon name="object.user" />
|
|
31
31
|
</Avatar.Fallback>
|
|
32
32
|
</Avatar.Root>
|
|
33
33
|
<Typography as="span" variant="caption" tone="muted">
|
|
@@ -8,23 +8,9 @@ const INITIAL = ["Москва", "Санкт-Петербург", "Есть в
|
|
|
8
8
|
|
|
9
9
|
export default function BadgeAppliedFiltersExample() {
|
|
10
10
|
const [filters, setFilters] = React.useState(INITIAL);
|
|
11
|
-
const titleId = React.useId();
|
|
12
11
|
|
|
13
12
|
return (
|
|
14
|
-
<
|
|
15
|
-
<div className={styles.filtersHeader}>
|
|
16
|
-
<Typography as="h3" variant="title-s" id={titleId}>
|
|
17
|
-
Фильтры
|
|
18
|
-
</Typography>
|
|
19
|
-
<Button.Root
|
|
20
|
-
variant="ghost"
|
|
21
|
-
tone="neutral"
|
|
22
|
-
size="s"
|
|
23
|
-
onClick={() => setFilters(filters.length > 0 ? [] : INITIAL)}
|
|
24
|
-
>
|
|
25
|
-
{filters.length > 0 ? "Сбросить все" : "Вернуть"}
|
|
26
|
-
</Button.Root>
|
|
27
|
-
</div>
|
|
13
|
+
<div className={styles.filters}>
|
|
28
14
|
{filters.length > 0 ? (
|
|
29
15
|
<div className={styles.badges}>
|
|
30
16
|
{filters.map((label) => (
|
|
@@ -36,12 +22,20 @@ export default function BadgeAppliedFiltersExample() {
|
|
|
36
22
|
{label}
|
|
37
23
|
</Badge.Root>
|
|
38
24
|
))}
|
|
25
|
+
<Button.Root variant="ghost" tone="neutral" size="s" onClick={() => setFilters([])}>
|
|
26
|
+
Сбросить все
|
|
27
|
+
</Button.Root>
|
|
39
28
|
</div>
|
|
40
29
|
) : (
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
<div className={styles.badges}>
|
|
31
|
+
<Typography variant="body-s" tone="muted">
|
|
32
|
+
Фильтры не выбраны — показаны все товары.
|
|
33
|
+
</Typography>
|
|
34
|
+
<Button.Root variant="ghost" tone="neutral" size="s" onClick={() => setFilters(INITIAL)}>
|
|
35
|
+
Вернуть
|
|
36
|
+
</Button.Root>
|
|
37
|
+
</div>
|
|
44
38
|
)}
|
|
45
|
-
</
|
|
39
|
+
</div>
|
|
46
40
|
);
|
|
47
41
|
}
|
|
@@ -10,20 +10,13 @@
|
|
|
10
10
|
width: min(100%, var(--prime-modal-width-m));
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
/* applied-filters.tsx: a
|
|
13
|
+
/* applied-filters.tsx, server-tags.tsx: a row of badges above a list. */
|
|
14
14
|
.filters {
|
|
15
15
|
display: grid;
|
|
16
16
|
gap: var(--prime-space-3);
|
|
17
17
|
width: min(100%, var(--prime-modal-width-s));
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.filtersHeader {
|
|
21
|
-
display: flex;
|
|
22
|
-
align-items: center;
|
|
23
|
-
justify-content: space-between;
|
|
24
|
-
gap: var(--prime-space-3);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
20
|
.badges {
|
|
28
21
|
display: flex;
|
|
29
22
|
flex-wrap: wrap;
|
|
@@ -19,13 +19,9 @@ function deleteTag(tag: string) {
|
|
|
19
19
|
export default function BadgeServerTagsExample() {
|
|
20
20
|
const [tags, setTags] = React.useState(TAGS);
|
|
21
21
|
const [failure, setFailure] = React.useState<string | null>(null);
|
|
22
|
-
const titleId = React.useId();
|
|
23
22
|
|
|
24
23
|
return (
|
|
25
|
-
<
|
|
26
|
-
<Typography as="h3" variant="title-s" id={titleId}>
|
|
27
|
-
Теги заказа № 4821
|
|
28
|
-
</Typography>
|
|
24
|
+
<div className={styles.filters}>
|
|
29
25
|
<div className={styles.badges}>
|
|
30
26
|
{tags.map((tag) => (
|
|
31
27
|
<Badge.Root
|
|
@@ -56,6 +52,6 @@ export default function BadgeServerTagsExample() {
|
|
|
56
52
|
{failure}
|
|
57
53
|
</Typography>
|
|
58
54
|
) : null}
|
|
59
|
-
</
|
|
55
|
+
</div>
|
|
60
56
|
);
|
|
61
57
|
}
|
|
@@ -46,7 +46,7 @@ Banner.Root <div>; variant, tone, size, placement
|
|
|
46
46
|
| `tone` | `"neutral" \| "accent" \| "success" \| "warning" \| "danger" \| "info"` | `"info"` | Semantic color of the message. |
|
|
47
47
|
| `size` | `"xs" \| "s" \| "m" \| "l" \| "xl"` | `"m"` | Spacing, icon and title follow the control tier; the description is one step smaller. |
|
|
48
48
|
| `placement` | `"inset" \| "page"` | `"inset"` | `inset` — rounded block in the flow or in a card; `page` — edge-to-edge strip above a page, content aligned to the page column. |
|
|
49
|
-
| `onDismiss` | `() => void` | — | Renders a close button (top-right, or last in `Banner.Actions`) and calls this on click; the parent unmounts the banner. |
|
|
49
|
+
| `onDismiss` | `() => void` | — | Renders a close button (top-right, or last in `Banner.Actions`) and calls this on click; the parent unmounts the banner, which closes up in place, and moves focus to a sensible place. |
|
|
50
50
|
| `labels` | `Partial<BannerLabels>` | — | Built-in strings, see Labels. |
|
|
51
51
|
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `className`, `role` (`alert`, `status`, `region`), `aria-label` and the other div attributes. |
|
|
52
52
|
|
|
@@ -117,7 +117,7 @@ Banner.Root <div>; variant, tone, size, placement
|
|
|
117
117
|
| dismissible | `onDismiss` | corner ghost Button (`xs`, `s` on `l` / `xl`), or the last outline Button in `Banner.Actions` |
|
|
118
118
|
| narrow | own width < 36rem (a banner with `Banner.Actions` is a size container) | actions move under the text |
|
|
119
119
|
|
|
120
|
-
No `open` prop: the parent mounts and unmounts the banner.
|
|
120
|
+
No `open` prop: the parent mounts and unmounts the banner. A mounted banner enters (a short fade and rise); an unmounted one closes up in place, so the content below glides up instead of jumping. To swap the banner for another block in the same spot (a «restore» button), wrap both in [Crossfade](../crossfade/COMPONENT.md).
|
|
121
121
|
|
|
122
122
|
## Layout & spacing
|
|
123
123
|
- `width: 100%`; text column capped at `--prime-layout-reading-max-width`.
|
|
@@ -134,7 +134,7 @@ No `open` prop: the parent mounts and unmounts the banner.
|
|
|
134
134
|
### ARIA
|
|
135
135
|
- The banner has no role of its own: give an error after an action `role="alert"`, a calm status `role="status"`, a page strip `role="region"` with `aria-label`.
|
|
136
136
|
- The icon is `aria-hidden`: the title carries the meaning, not the color.
|
|
137
|
-
- The close button is named by `labels.dismiss
|
|
137
|
+
- The close button is named by `labels.dismiss`. It leaves with the banner, so after dismissing the parent moves focus to a sensible place: the control that takes the banner's spot, or the next heading or action of the section (see `dismissible.tsx`).
|
|
138
138
|
|
|
139
139
|
### Labels
|
|
140
140
|
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
@@ -150,9 +150,9 @@ No `open` prop: the parent mounts and unmounts the banner.
|
|
|
150
150
|
| [variants.tsx](examples/variants.tsx) | Every treatment on every tone: soft by default, solid for urgent, outline for calm — `variant`, `tone`. |
|
|
151
151
|
| [sizes.tsx](examples/sizes.tsx) | Every tier: padding, icon and title follow the control tier, the description is one step smaller — `size`. |
|
|
152
152
|
| [structure.tsx](examples/structure.tsx) | Optional parts: a one-line title, a title with a description, and actions where the close button joins the row — `Banner.Description`, `Banner.Actions`, `onDismiss`. |
|
|
153
|
-
| [dismissible.tsx](examples/dismissible.tsx) | The parent owns visibility: the close button calls back and
|
|
153
|
+
| [dismissible.tsx](examples/dismissible.tsx) | The parent owns visibility: the close button calls back, the banner closes up and focus moves to the restore button; the button name comes from labels — `onDismiss`, `labels`. |
|
|
154
154
|
| [page-strip.tsx](examples/page-strip.tsx) | An edge-to-edge strip above a page and a rounded block inside a card — `placement`. |
|
|
155
|
-
| [narrow.tsx](examples/narrow.tsx) | Below 36rem of its own width the banner moves the actions under the text. |
|
|
155
|
+
| [narrow.tsx](examples/narrow.tsx) | Below 36rem of its own width the banner moves the actions under the text — `Banner.Actions`. |
|
|
156
156
|
|
|
157
157
|
## Mistakes
|
|
158
158
|
- A hand-made × next to the banner → pass `onDismiss`.
|
|
@@ -162,4 +162,4 @@ No `open` prop: the parent mounts and unmounts the banner.
|
|
|
162
162
|
|
|
163
163
|
## Related
|
|
164
164
|
- **Built from:** [Button](../button/COMPONENT.md) (close button), Icon (`action.close`)
|
|
165
|
-
- **See also:** [Notification](../notification/COMPONENT.md), [Hint](../hint/COMPONENT.md), [EmptyPage](../empty-page/COMPONENT.md), [Badge](../badge/COMPONENT.md)
|
|
165
|
+
- **See also:** [Crossfade](../crossfade/COMPONENT.md), [Notification](../notification/COMPONENT.md), [Hint](../hint/COMPONENT.md), [EmptyPage](../empty-page/COMPONENT.md), [Badge](../badge/COMPONENT.md)
|
|
@@ -1,18 +1,34 @@
|
|
|
1
|
-
/** The parent owns visibility: the close button calls back and
|
|
2
|
-
import { Banner, Button, Icon } from "prime-ui-kit";
|
|
1
|
+
/** The parent owns visibility: the close button calls back, the banner closes up and focus moves to the restore button; the button name comes from labels — `onDismiss`, `labels`. */
|
|
2
|
+
import { Banner, Button, Crossfade, Icon } from "prime-ui-kit";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
5
5
|
import styles from "./examples.module.css";
|
|
6
6
|
|
|
7
7
|
export default function BannerDismissibleExample() {
|
|
8
8
|
const [visible, setVisible] = React.useState(true);
|
|
9
|
+
const bannerRef = React.useRef<HTMLDivElement>(null);
|
|
10
|
+
const restoreRef = React.useRef<HTMLButtonElement>(null);
|
|
11
|
+
const toggled = React.useRef(false);
|
|
12
|
+
|
|
13
|
+
// The pressed button leaves with its block: focus goes to the control that takes its place.
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
if (!toggled.current) return;
|
|
16
|
+
if (visible) bannerRef.current?.querySelector("button")?.focus();
|
|
17
|
+
else restoreRef.current?.focus();
|
|
18
|
+
}, [visible]);
|
|
19
|
+
|
|
20
|
+
const toggle = (next: boolean) => {
|
|
21
|
+
toggled.current = true;
|
|
22
|
+
setVisible(next);
|
|
23
|
+
};
|
|
9
24
|
|
|
10
25
|
return (
|
|
11
|
-
<
|
|
26
|
+
<Crossfade state={visible ? "banner" : "restore"} className={styles.region}>
|
|
12
27
|
{visible ? (
|
|
13
28
|
<Banner.Root
|
|
29
|
+
ref={bannerRef}
|
|
14
30
|
tone="accent"
|
|
15
|
-
onDismiss={() =>
|
|
31
|
+
onDismiss={() => toggle(false)}
|
|
16
32
|
labels={{ dismiss: "Скрыть объявление" }}
|
|
17
33
|
>
|
|
18
34
|
<Banner.Content>
|
|
@@ -24,15 +40,10 @@ export default function BannerDismissibleExample() {
|
|
|
24
40
|
</Banner.Content>
|
|
25
41
|
</Banner.Root>
|
|
26
42
|
) : (
|
|
27
|
-
<Button.Root
|
|
28
|
-
variant="outline"
|
|
29
|
-
tone="neutral"
|
|
30
|
-
className={styles.restore}
|
|
31
|
-
onClick={() => setVisible(true)}
|
|
32
|
-
>
|
|
43
|
+
<Button.Root ref={restoreRef} variant="outline" tone="neutral" onClick={() => toggle(true)}>
|
|
33
44
|
Вернуть баннер
|
|
34
45
|
</Button.Root>
|
|
35
46
|
)}
|
|
36
|
-
</
|
|
47
|
+
</Crossfade>
|
|
37
48
|
);
|
|
38
49
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
min-width: 0;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
/*
|
|
11
|
+
/* page-strip.tsx: the page strip above a card with an inset banner. */
|
|
12
12
|
.sections {
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: column;
|
|
@@ -17,16 +17,12 @@
|
|
|
17
17
|
min-width: 0;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.pageBody {
|
|
21
|
-
padding: var(--prime-space-5) var(--prime-space-4) var(--prime-space-8);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
20
|
/* narrow.tsx: a 320px column; the banner's container query moves actions under the text. */
|
|
25
21
|
.narrow {
|
|
26
22
|
width: min(100%, calc(var(--prime-space-20) * 4));
|
|
27
23
|
}
|
|
28
24
|
|
|
29
|
-
/*
|
|
30
|
-
.
|
|
31
|
-
|
|
25
|
+
/* dismissible.tsx: the swapped region takes the row's width. */
|
|
26
|
+
.region {
|
|
27
|
+
width: 100%;
|
|
32
28
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Below 36rem of its own width the banner moves the actions under the text. */
|
|
1
|
+
/** Below 36rem of its own width the banner moves the actions under the text — `Banner.Actions`. */
|
|
2
2
|
import { Banner, Button, Icon } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
import styles from "./examples.module.css";
|
|
@@ -1,32 +1,26 @@
|
|
|
1
1
|
/** An edge-to-edge strip above a page and a rounded block inside a card — `placement`. */
|
|
2
|
-
import { Banner, Button, Card, Icon
|
|
2
|
+
import { Banner, Button, Card, Icon } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
import styles from "./examples.module.css";
|
|
5
5
|
|
|
6
6
|
export default function BannerPageStripExample() {
|
|
7
7
|
return (
|
|
8
8
|
<div className={styles.sections}>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<div className={styles.pageBody}>
|
|
25
|
-
<Typography as="h3" variant="heading-s">
|
|
26
|
-
Отчёты
|
|
27
|
-
</Typography>
|
|
28
|
-
</div>
|
|
29
|
-
</Card.Root>
|
|
9
|
+
{/* In an app the strip stands first in the page, edge to edge above its content. */}
|
|
10
|
+
<Banner.Root
|
|
11
|
+
tone="warning"
|
|
12
|
+
placement="page"
|
|
13
|
+
role="region"
|
|
14
|
+
aria-label="Пробный период"
|
|
15
|
+
onDismiss={() => undefined}
|
|
16
|
+
>
|
|
17
|
+
<Banner.Content>
|
|
18
|
+
<Banner.Icon>
|
|
19
|
+
<Icon name="status.warning" />
|
|
20
|
+
</Banner.Icon>
|
|
21
|
+
<Banner.Title>Пробный период закончится 12 октября</Banner.Title>
|
|
22
|
+
</Banner.Content>
|
|
23
|
+
</Banner.Root>
|
|
30
24
|
<Card.Root variant="panel">
|
|
31
25
|
<Card.Header>
|
|
32
26
|
<Card.Title>Оплата</Card.Title>
|