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
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
Drawer,
|
|
28
28
|
Dropdown,
|
|
29
29
|
ExampleFrame,
|
|
30
|
+
FieldList,
|
|
30
31
|
Fieldset,
|
|
31
32
|
FileUpload,
|
|
32
33
|
Gallery,
|
|
@@ -85,7 +86,7 @@ import {
|
|
|
85
86
|
useSidebar,
|
|
86
87
|
useTokenValue,
|
|
87
88
|
useUploadQueue
|
|
88
|
-
} from "./chunks/chunk-
|
|
89
|
+
} from "./chunks/chunk-THFZIHKU.js";
|
|
89
90
|
import {
|
|
90
91
|
Avatar,
|
|
91
92
|
Badge,
|
|
@@ -117,7 +118,7 @@ import {
|
|
|
117
118
|
textTones,
|
|
118
119
|
tones,
|
|
119
120
|
variants
|
|
120
|
-
} from "./chunks/chunk-
|
|
121
|
+
} from "./chunks/chunk-XJAVS6FH.js";
|
|
121
122
|
import {
|
|
122
123
|
ControlSizeProvider,
|
|
123
124
|
useOptionalControlSize
|
|
@@ -158,6 +159,7 @@ export {
|
|
|
158
159
|
Dropdown,
|
|
159
160
|
EmptyPage,
|
|
160
161
|
ExampleFrame,
|
|
162
|
+
FieldList,
|
|
161
163
|
Fieldset,
|
|
162
164
|
FileUpload,
|
|
163
165
|
Gallery,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { AnchorPoint } from "../hooks/usePosition";
|
|
3
|
+
export type { AnchorPoint };
|
|
4
|
+
export type ChartTooltipProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
/** The point the content belongs to («8 окт», «Неделя 41»), over the content. */
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Floats the tooltip beside a point of `anchorRef` (px from its top-left corner) — the pointer
|
|
9
|
+
* over the plot, or the point the arrow keys reached; `null` hides it. Without `anchorRef` the
|
|
10
|
+
* body renders in place (a chart library positions it).
|
|
11
|
+
*/
|
|
12
|
+
point?: AnchorPoint | null;
|
|
13
|
+
/** The plot the point lies in: its scroll and size changes move the tooltip with it. */
|
|
14
|
+
anchorRef?: React.RefObject<HTMLElement | null>;
|
|
15
|
+
/** Escape hid the floating tooltip (it stays hidden until the point moves). */
|
|
16
|
+
onDismiss?: () => void;
|
|
17
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The one chart tooltip of the kit (ChartFrame.Tooltip, Sparkline): its look, and — with
|
|
21
|
+
* `anchorRef` — its place. A floating tooltip is an anchored layer like every other
|
|
22
|
+
* (`useFloatingLayer` + `usePosition` with `anchorPoint`): right of the point, vertically centred,
|
|
23
|
+
* flipped to the left only where the right has no room, kept inside the viewport, passive (no
|
|
24
|
+
* focus, no presses) and aria-hidden — the chart speaks its points itself.
|
|
25
|
+
*/
|
|
26
|
+
export declare function ChartTooltip({ anchorRef, ...props }: ChartTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* A button segment at a field's edge (Input, Textarea): full field height, the icon centred with the
|
|
4
|
-
* field padding on both sides, a hover wash over the whole segment, the touch hit area. The field
|
|
5
|
-
* hosts style it through `data-field-action`.
|
|
6
|
-
*/
|
|
7
|
-
export declare const fieldActionClass: string;
|
|
8
2
|
export type FieldActionButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-label" | "children"> & {
|
|
9
3
|
/** Accessible name and tooltip («Позвонить», «Открыть профиль»). */
|
|
10
4
|
label: string;
|
|
@@ -14,8 +8,13 @@ export type FieldActionButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonE
|
|
|
14
8
|
children: React.ReactNode;
|
|
15
9
|
ref?: React.Ref<HTMLButtonElement>;
|
|
16
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* A segment without a tooltip, for a kit control whose glyph says it all (Input's clear and
|
|
13
|
+
* reveal): the name stays accessible, nothing floats over the field.
|
|
14
|
+
*/
|
|
15
|
+
export declare function FieldActionSegment(props: FieldActionButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
17
16
|
/** A named icon action at the field's edge with a tooltip. */
|
|
18
|
-
export declare function FieldActionButton(
|
|
17
|
+
export declare function FieldActionButton(props: FieldActionButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
19
18
|
export type CopyState = "idle" | "copied" | "error";
|
|
20
19
|
export type FieldCopyLabels = {
|
|
21
20
|
/** Name and tooltip of the copy button. */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The contract between `FieldList` and the fields in its cells. A cell provides its column heading;
|
|
4
|
+
* a framed field without a `label` of its own takes it as its label (and keeps its own `label`, if
|
|
5
|
+
* any), so every field in a row has a name without a visible label per row. The column heading
|
|
6
|
+
* shows the name once above the rows; the field's label is read, not shown, until the list stacks
|
|
7
|
+
* its rows into blocks in a narrow container (`FIELD_LIST_CONTAINER`), where each field shows it.
|
|
8
|
+
*/
|
|
9
|
+
export type FieldCell = {
|
|
10
|
+
/** The column heading: the name of the field in this cell. */
|
|
11
|
+
label: string;
|
|
12
|
+
/**
|
|
13
|
+
* `wide` — hidden while the column heading is on screen, shown when the rows stack; `always` —
|
|
14
|
+
* a one-column list, named by the list's own label, shows none in either layout.
|
|
15
|
+
*/
|
|
16
|
+
hidden: "wide" | "always";
|
|
17
|
+
};
|
|
18
|
+
export declare const FieldCellContext: React.Context<FieldCell | null>;
|
|
19
|
+
/** Name of the size container `FieldList` sets; FieldFrame shows a cell label under its query. */
|
|
20
|
+
export declare const FIELD_LIST_CONTAINER = "prime-field-list";
|
|
21
|
+
export declare function useFieldCell(): FieldCell | null;
|
|
@@ -43,8 +43,8 @@ export type MessageListContextValue = {
|
|
|
43
43
|
/** A message was new at the end in this commit. */
|
|
44
44
|
arrivedNow: () => boolean;
|
|
45
45
|
/**
|
|
46
|
-
* Brings a message into view and
|
|
47
|
-
*
|
|
46
|
+
* Brings a message into view and blinks it (unless `flash` is `false`); `focus`
|
|
47
|
+
* moves the focus to it too.
|
|
48
48
|
*/
|
|
49
49
|
reveal: (value: string, focus?: boolean, flash?: boolean) => boolean;
|
|
50
50
|
/** The selection; read it through `useMessageSelection` / `useListSelection`. */
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { type PaletteColor } from "./states";
|
|
2
|
+
/**
|
|
3
|
+
* A palette hue as a data mark: its step of the categorical chart palette, so a category has one
|
|
4
|
+
* color in charts and in shares. The one source of `--hue-chart` in `palette.module.css` (kept equal
|
|
5
|
+
* by `palette.test.ts`); as strings here, because a chart library takes its colors in JS. Gray is
|
|
6
|
+
* `chart-other`; sky has no chart step (it sits too close to blue) and keeps its solid.
|
|
7
|
+
*/
|
|
8
|
+
export declare const HUE_CHART: Record<PaletteColor, string>;
|
|
2
9
|
/**
|
|
3
10
|
* A palette hue for a person, stable per `id`: the same id always gets the same hue, on every
|
|
4
11
|
* render and every device (a string hash, no state). For names in a group chat and initials of
|
|
@@ -11,11 +11,15 @@ export type ColorPreset = {
|
|
|
11
11
|
* Take `COLOR_PRESETS.slice(0, 8)` for a single row of eight.
|
|
12
12
|
*/
|
|
13
13
|
export declare const COLOR_PRESETS: readonly ColorPreset[];
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* One selectable swatch: `null` is «no color». `contrast` picks the check mark: `light` / `dark`
|
|
16
|
+
* by the color's luminance; `surface` (the «no color» checkerboard, drawn from the surface's own
|
|
17
|
+
* fills) follows the theme with the primary text color.
|
|
18
|
+
*/
|
|
15
19
|
export type SwatchOption = {
|
|
16
20
|
value: string | null;
|
|
17
21
|
label: string;
|
|
18
|
-
contrast: "light" | "dark";
|
|
22
|
+
contrast: "light" | "dark" | "surface";
|
|
19
23
|
};
|
|
20
24
|
/** The presets as swatch options, plus the «no color» option at the end when `allowEmpty`. */
|
|
21
25
|
export declare function useSwatchOptions(presets: readonly ColorPreset[], allowEmpty: boolean, emptyLabel: string): SwatchOption[];
|
|
@@ -14,9 +14,10 @@ export type AppHeaderRootProps = HeaderProps & {
|
|
|
14
14
|
labels?: Partial<AppHeaderLabels>;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
-
* The bar at the very top of the content panel:
|
|
18
|
-
*
|
|
19
|
-
* from its own width (narrow: the
|
|
17
|
+
* The page's bar at the very top of the content panel: its row holds only what the current page
|
|
18
|
+
* needs — the page title, the page's tools, per-page buttons. One row as high as the Sidebar brand
|
|
19
|
+
* row, so the two read as one line; sticky; lays itself out from its own width (narrow: the
|
|
20
|
+
* description goes, the title truncates).
|
|
20
21
|
*/
|
|
21
22
|
declare function AppHeaderRoot({ labels, className, children, ...rest }: AppHeaderRootProps): import("react/jsx-runtime").JSX.Element;
|
|
22
23
|
declare namespace AppHeaderRoot {
|
|
@@ -28,18 +29,14 @@ declare function AppHeaderStart({ className, ...rest }: AppHeaderStartProps): im
|
|
|
28
29
|
declare namespace AppHeaderStart {
|
|
29
30
|
var displayName: string;
|
|
30
31
|
}
|
|
31
|
-
export type AppHeaderTitleProps = DivProps
|
|
32
|
-
/**
|
|
33
|
-
* Tag of the name: `h1` when the header carries the page title (no `PageContent.Header` in
|
|
34
|
-
* main) — the description stays outside the heading's name. Default `span`.
|
|
35
|
-
*/
|
|
36
|
-
as?: "span" | "h1";
|
|
37
|
-
};
|
|
32
|
+
export type AppHeaderTitleProps = DivProps;
|
|
38
33
|
/**
|
|
39
34
|
* Where you are: an optional `AppHeader.Icon`, the name and an optional `AppHeader.Description`
|
|
40
|
-
* under it — the same anatomy as the Sidebar brand. The name
|
|
35
|
+
* under it — the same anatomy as the Sidebar brand. The name is the page's `<h1>` (an app page
|
|
36
|
+
* titles itself in the header); the description stays outside the heading's name. The name
|
|
37
|
+
* truncates.
|
|
41
38
|
*/
|
|
42
|
-
declare function AppHeaderTitle({
|
|
39
|
+
declare function AppHeaderTitle({ className, children, ...rest }: AppHeaderTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
43
40
|
declare namespace AppHeaderTitle {
|
|
44
41
|
var displayName: string;
|
|
45
42
|
}
|
|
@@ -68,21 +65,6 @@ declare function AppHeaderSeparator({ className, ...rest }: AppHeaderSeparatorPr
|
|
|
68
65
|
declare namespace AppHeaderSeparator {
|
|
69
66
|
var displayName: string;
|
|
70
67
|
}
|
|
71
|
-
export type AppHeaderSearchProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "children"> & {
|
|
72
|
-
/** Placeholder text; also the button's name when the header is narrow and the field folds. */
|
|
73
|
-
children: React.ReactNode;
|
|
74
|
-
/** Key hint at the end. Default `⌘K`; `null` hides it. */
|
|
75
|
-
shortcut?: React.ReactNode;
|
|
76
|
-
ref?: React.Ref<HTMLButtonElement>;
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* Global search entry: looks like a field, works as a button that opens your CommandMenu (wire
|
|
80
|
-
* `onClick` and the shortcut). On a narrow header it folds into a square search button.
|
|
81
|
-
*/
|
|
82
|
-
declare function AppHeaderSearch({ children, shortcut, className, ...rest }: AppHeaderSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
-
declare namespace AppHeaderSearch {
|
|
84
|
-
var displayName: string;
|
|
85
|
-
}
|
|
86
68
|
export type AppHeaderToolsProps = DivProps;
|
|
87
69
|
/**
|
|
88
70
|
* The page's tools in the header — a `PageToolbar.Root` (sections, period, filters, the primary
|
|
@@ -120,7 +102,6 @@ export declare const AppHeader: {
|
|
|
120
102
|
Icon: typeof AppHeaderIcon;
|
|
121
103
|
Description: typeof AppHeaderDescription;
|
|
122
104
|
Separator: typeof AppHeaderSeparator;
|
|
123
|
-
Search: typeof AppHeaderSearch;
|
|
124
105
|
Tools: typeof AppHeaderTools;
|
|
125
106
|
Actions: typeof AppHeaderActions;
|
|
126
107
|
MenuButton: typeof AppHeaderMenuButton;
|
package/dist/layout/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { AppHeaderActionsProps, AppHeaderDescriptionProps, AppHeaderIconProps, AppHeaderLabels, AppHeaderMenuButtonProps, AppHeaderRootProps,
|
|
1
|
+
export type { AppHeaderActionsProps, AppHeaderDescriptionProps, AppHeaderIconProps, AppHeaderLabels, AppHeaderMenuButtonProps, AppHeaderRootProps, AppHeaderSeparatorProps, AppHeaderStartProps, AppHeaderTitleProps, AppHeaderToolsProps, } from "./app-header/AppHeader";
|
|
2
2
|
export { AppHeader } from "./app-header/AppHeader";
|
|
3
3
|
export type { AppShellContentWidth, AppShellFooterProps, AppShellMainProps, AppShellNavProps, AppShellRootProps, AppShellTemplateProps, } from "./app-shell/AppShell";
|
|
4
4
|
export { AppShell } from "./app-shell/AppShell";
|
package/dist/skill/SKILL.md
CHANGED
|
@@ -6,10 +6,12 @@ description: >
|
|
|
6
6
|
navigation on prime-ui-kit; when
|
|
7
7
|
choosing which kit component fits a task; when a needed component is missing and must be composed from
|
|
8
8
|
the kit; when adding loading, empty and error states, feedback, motion or micro-animation to a screen;
|
|
9
|
-
and when reviewing a screen for design-system
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
when changing or redesigning a screen that exists; and when reviewing a screen for design-system and
|
|
10
|
+
UX compliance (data shape and layout, repeated or redundant labels, copy, friction, spacing rhythm,
|
|
11
|
+
sizes, tokens, states, motion, a11y, narrow screens). Triggers: build a screen, page, form, table,
|
|
12
|
+
board, schedule, chat, uploads, settings, dashboard, navigation; repeating fields, add another row;
|
|
13
|
+
which component to use; animate, transition, loading state; prime-ui-kit; improve, fix or review a
|
|
14
|
+
screen against the design system — in any language.
|
|
13
15
|
---
|
|
14
16
|
|
|
15
17
|
# prime-ui-kit
|
|
@@ -24,25 +26,33 @@ region, `Skeleton` while it loads).
|
|
|
24
26
|
|
|
25
27
|
0. **First** — [cheatsheet.md](cheatsheet.md): one page of the decisions agents most often get wrong,
|
|
26
28
|
each as «do this, not that» with the exact API. Then follow the steps in order; each names its file.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
Changing a screen that exists: audit it first ([ux.md](ux.md#8-changing-a-screen-someone-built)),
|
|
30
|
+
then make the change.
|
|
31
|
+
1. **Brief** — [ux.md](ux.md): five lines before any JSX (who and what for, the data and its shape,
|
|
32
|
+
the main action, the states, the narrow screen); the shape of the data decides the layout, every
|
|
33
|
+
label must carry something new, friction matches the cost of a mistake.
|
|
34
|
+
2. **The app frame, once per app** — [layouts.md](layouts.md): styles, theme, providers, `AppShell`
|
|
35
|
+
with `Sidebar` and `AppHeader`, page wrappers, auth screens. A screen you deliver renders only its
|
|
36
|
+
page: its header content (title, a line of data, its tools) and its body.
|
|
37
|
+
3. **Choose** — [choosing.md](choosing.md): the category by task, then the component, then the pairs
|
|
30
38
|
that are easy to confuse.
|
|
31
|
-
|
|
39
|
+
4. **Read the component** — [components.md](components.md) links each `COMPONENT.md` (API, variants,
|
|
32
40
|
states, a11y, mistakes) and its `examples/`. Never guess a prop; copy structure from an example.
|
|
33
|
-
|
|
34
|
-
[
|
|
41
|
+
5. **Compose the screen** — [composition.md](composition.md): start from the closest working screen (the
|
|
42
|
+
[screens index](composition.md#screens): the `examples/screen.tsx` of its main component) and keep
|
|
43
|
+
its skeleton; rhythm, hierarchy, surfaces and type in
|
|
35
44
|
[foundations.md](foundations.md).
|
|
36
|
-
|
|
45
|
+
6. **Write the JSX** — [api-contract.md](api-contract.md): prop names, controlled state, events (async
|
|
37
46
|
events return the request's Promise), forms and their submit flow (`Fieldset disabled`), uploads
|
|
38
47
|
(`useUploadQueue`), destructive actions (`ConfirmDialog`), helpers (`groupMessages` for chat rows you build yourself),
|
|
39
48
|
icon names.
|
|
40
|
-
|
|
49
|
+
7. **States and motion** — [motion.md](motion.md): every region loads, empties and fails without
|
|
41
50
|
flipping; what the kit animates by itself and when to move your own elements.
|
|
42
|
-
|
|
51
|
+
8. **Narrow screens** — [responsive.md](responsive.md): every screen works from 320px, the page panel is
|
|
43
52
|
`PageToolbar`, nothing is hidden on phones, touch follows `(hover)` / `(pointer)`.
|
|
44
|
-
|
|
45
|
-
over.
|
|
53
|
+
9. **Check** — [checklist.md](checklist.md) and [anti-slop.md](anti-slop.md), then look at the screen
|
|
54
|
+
in a browser: both themes, 1280 and 375 px ([ux.md](ux.md#9-look-at-it-before-handing-it-over)). Fix
|
|
55
|
+
every «no», then hand over.
|
|
46
56
|
|
|
47
57
|
## Where things are
|
|
48
58
|
|
|
@@ -56,18 +66,18 @@ project under `node_modules/prime-ui-kit/src/`.
|
|
|
56
66
|
| Component reference | `reference/components/<dir>/COMPONENT.md` | `node_modules/prime-ui-kit/src/components/<dir>/COMPONENT.md` |
|
|
57
67
|
| Copyable scenarios | `reference/components/<dir>/examples/*.tsx` | `node_modules/prime-ui-kit/src/components/<dir>/examples/*.tsx` |
|
|
58
68
|
| AppShell, Sidebar, AppHeader, BottomNav | `reference/layout/<dir>/…` | `node_modules/prime-ui-kit/src/layout/<dir>/…` |
|
|
59
|
-
| Whole screens | `
|
|
69
|
+
| Whole screens | `reference/<base>/<dir>/examples/screen.tsx` | `node_modules/prime-ui-kit/src/<base>/<dir>/examples/screen.tsx` |
|
|
60
70
|
|
|
61
71
|
## Files of this skill
|
|
62
72
|
|
|
63
73
|
| File | Read when |
|
|
64
74
|
|---|---|
|
|
65
75
|
| [cheatsheet.md](cheatsheet.md) | first — the most frequent decisions and mistakes in one page |
|
|
76
|
+
| [ux.md](ux.md) | before the layout of every screen and before changing one — the brief, data shape → layout, label economy, copy, friction, defaults, the visual check |
|
|
66
77
|
| [layouts.md](layouts.md) | once per app — the app frame, page wrappers, auth screens |
|
|
67
78
|
| [choosing.md](choosing.md) | unsure which component fits (Gantt / Timeline / Kanban / DataTable, Message / Composer, FileUpload list / grid / gallery / strip, ColorField / ColorPicker…); how to confirm a destructive action |
|
|
68
79
|
| [components.md](components.md) | finding a component and its `COMPONENT.md` / `examples/` |
|
|
69
|
-
| [composition.md](composition.md) | building any screen — the
|
|
70
|
-
| [patterns/](patterns/) | starting a screen — list, detail, settings, form in a Drawer, dashboard, states, messenger |
|
|
80
|
+
| [composition.md](composition.md) | building any screen — the screens index (list, detail, settings, form in a Drawer, dashboard, states, messenger, board, app frame, media library, schedule, record editor) and what each one teaches, the rules of assembly, what to do when the kit lacks a component |
|
|
71
81
|
| [foundations.md](foundations.md) | grid, proximity scale, sizes, surfaces, type, tone and color |
|
|
72
82
|
| [api-contract.md](api-contract.md) | writing JSX — prop names, sizes and host tiers, controlled state, forms, helpers, icons |
|
|
73
83
|
| [motion.md](motion.md) | every screen — loading / empty / error that flow, what the kit animates, when to move, recipes |
|
|
@@ -110,9 +120,11 @@ Take a semantic `<Icon name="…" />` first, else a glyph from the full animated
|
|
|
110
120
|
5. Air is hierarchy: tighter inside a group, wider between groups, widest between sections — spacing via
|
|
111
121
|
`gap` on the parent, never margins.
|
|
112
122
|
6. One primary action per area. The rest are `soft`/`ghost`/`outline` with `tone="neutral"`.
|
|
113
|
-
7. Labels above fields, always
|
|
123
|
+
7. Labels above fields, always — once per column for records in rows (`FieldList`), never numbered
|
|
124
|
+
(«Пункт 1»), never repeating their heading. Placeholder is an example value, never the label.
|
|
114
125
|
8. Text through `Typography` roles (`title-m` section, `title-s` group, `body-m` text, `caption` meta;
|
|
115
|
-
the page title is `
|
|
126
|
+
the page title is `AppHeader.Title` in the page's header, `PageContent.Title` only on a
|
|
127
|
+
document page). No custom font sizes.
|
|
116
128
|
9. Overlays (Modal, ConfirmDialog, Drawer, Sheet, Popover, Dropdown, Tooltip, CommandMenu, Select,
|
|
117
129
|
MediaViewer) come from the kit — never hand-made — and stay mounted: drive them with `open`,
|
|
118
130
|
never `{open && …}`.
|
package/dist/skill/anti-slop.md
CHANGED
|
@@ -48,9 +48,10 @@ Text color goes through `Typography tone="secondary"`, not CSS.
|
|
|
48
48
|
// bad — a card around a card around a table
|
|
49
49
|
<Card.Root><Card.Root><DataTable columns={columns} rows={rows} /></Card.Root></Card.Root>
|
|
50
50
|
|
|
51
|
-
// good — DataTable already is a filled block; a section
|
|
52
|
-
<
|
|
53
|
-
<DataTable columns={columns} rows={rows} />
|
|
51
|
+
// good — DataTable already is a filled block; a titled section is enough
|
|
52
|
+
<PageContent.Section label="Последние оплаты">
|
|
53
|
+
<DataTable columns={columns} rows={rows} />
|
|
54
|
+
</PageContent.Section>
|
|
54
55
|
```
|
|
55
56
|
|
|
56
57
|
## 3a. Hover that merges with the neighbour
|
|
@@ -106,6 +107,78 @@ and inside a card, in both themes: rest, hover and the neighbour must be three d
|
|
|
106
107
|
|
|
107
108
|
A search field in a toolbar may go without a visible label, but then it needs `aria-label`.
|
|
108
109
|
|
|
110
|
+
## 5a. A label in every row, a record split over lines
|
|
111
|
+
|
|
112
|
+
The most common shape bug of generated forms: rules for one field applied to a list of records.
|
|
113
|
+
|
|
114
|
+
```tsx partial
|
|
115
|
+
// bad — «Иконка · Параметр · Значение · Цвет» repeated in every record, a record on two lines,
|
|
116
|
+
// numbered labels, a hint that explains the lock
|
|
117
|
+
{specs.map((spec, index) => (
|
|
118
|
+
<div key={spec.id} className={styles.grid}>
|
|
119
|
+
<Select.Root label="Иконка">…</Select.Root>
|
|
120
|
+
<Input.Root label={`Параметр ${index + 1}`}>…</Input.Root>
|
|
121
|
+
<Input.Root label="Значение">…</Input.Root>
|
|
122
|
+
<ColorField label="Цвет иконки" />
|
|
123
|
+
</div>
|
|
124
|
+
))}
|
|
125
|
+
<Typography variant="body-s">Первые три всегда первыми. Остальные можно перетаскивать.</Typography>
|
|
126
|
+
|
|
127
|
+
// good — one row per record, the headings once, compact columns for the small attributes
|
|
128
|
+
<FieldList
|
|
129
|
+
label="Характеристики"
|
|
130
|
+
columns={[
|
|
131
|
+
{ label: "Иконка", width: "compact" },
|
|
132
|
+
{ label: "Параметр" },
|
|
133
|
+
{ label: "Значение" },
|
|
134
|
+
{ label: "Цвет", width: "compact" },
|
|
135
|
+
]}
|
|
136
|
+
reorderable
|
|
137
|
+
getLocked={(spec) => spec.pinned}
|
|
138
|
+
value={specs}
|
|
139
|
+
onValueChange={setSpecs}
|
|
140
|
+
getId={(spec) => spec.id}
|
|
141
|
+
getLabel={(spec) => spec.name}
|
|
142
|
+
createItem={newSpec}
|
|
143
|
+
addLabel="Добавить характеристику"
|
|
144
|
+
renderItem={(spec, row) => (
|
|
145
|
+
<>
|
|
146
|
+
<Select.Root value={spec.icon} onValueChange={(icon) => row.update({ icon })}>
|
|
147
|
+
<Select.Trigger>
|
|
148
|
+
<Select.TriggerIcon><Icon name={spec.icon} /></Select.TriggerIcon>
|
|
149
|
+
</Select.Trigger>
|
|
150
|
+
<Select.Content>…</Select.Content>
|
|
151
|
+
</Select.Root>
|
|
152
|
+
<Input.Root>…</Input.Root>
|
|
153
|
+
<Input.Root>…</Input.Root>
|
|
154
|
+
<ColorPresets.Root value={spec.color} onValueChange={…}>…</ColorPresets.Root>
|
|
155
|
+
</>
|
|
156
|
+
)}
|
|
157
|
+
/>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
The same for one value in several units — one heading, the fields in a row, the unit inside:
|
|
161
|
+
|
|
162
|
+
```tsx partial
|
|
163
|
+
// bad — three labels, the currency in the label and again in the field, one field on a line of its own
|
|
164
|
+
<Input.Root label="Депозит, $" optional>…<Input.InlineAffix side="end">$</Input.InlineAffix>…</Input.Root>
|
|
165
|
+
<Input.Root label="Депозит, ฿" optional>…</Input.Root>
|
|
166
|
+
<Input.Root label="Депозит, ₽" optional>…</Input.Root>
|
|
167
|
+
|
|
168
|
+
// good — a group heading, three fields in one row, each named for assistive tech
|
|
169
|
+
<Fieldset label="Депозит">
|
|
170
|
+
<div className={styles.row}>
|
|
171
|
+
<Input.Root>
|
|
172
|
+
<Input.Wrapper>
|
|
173
|
+
<Input.Field aria-label="Депозит в долларах" inputMode="decimal" />
|
|
174
|
+
<Input.InlineAffix side="end">$</Input.InlineAffix>
|
|
175
|
+
</Input.Wrapper>
|
|
176
|
+
</Input.Root>
|
|
177
|
+
{/* ฿ and ₽ the same */}
|
|
178
|
+
</div>
|
|
179
|
+
</Fieldset>
|
|
180
|
+
```
|
|
181
|
+
|
|
109
182
|
## 6. Everything on one level of air
|
|
110
183
|
|
|
111
184
|
```css
|
|
@@ -115,7 +188,7 @@ A search field in a toolbar may go without a visible label, but then it needs `a
|
|
|
115
188
|
/* good — proximity scale */
|
|
116
189
|
.form { display: grid; gap: var(--prime-space-8); } /* group → group 32 */
|
|
117
190
|
.group { display: grid; gap: var(--prime-space-5); } /* field → field 20 */
|
|
118
|
-
/* section → section 40
|
|
191
|
+
/* block → block 24 and section → section 40 come from PageContent.Body / PageContent.Section */
|
|
119
192
|
```
|
|
120
193
|
|
|
121
194
|
## 7. `div` instead of a ready component
|
|
@@ -157,7 +157,7 @@ export function InviteForm() {
|
|
|
157
157
|
```
|
|
158
158
|
|
|
159
159
|
(`.form { display: grid; gap: var(--prime-space-5); }`.) A full create form with groups, validation,
|
|
160
|
-
loading and a toast: [
|
|
160
|
+
loading and a toast: [the Drawer screen](reference/components/drawer/examples/screen.tsx).
|
|
161
161
|
|
|
162
162
|
## Loading without DataTable
|
|
163
163
|
|
|
@@ -167,7 +167,7 @@ any other card or region that loads: wrap its content in `Crossfade state={statu
|
|
|
167
167
|
(same rows, gaps and heights). A `Spinner` only where there is no shape to hold. Show the error in
|
|
168
168
|
place (a `Banner` for the page, `EmptyPage` with `EmptyPage.Icon tone="danger"` and a retry for a
|
|
169
169
|
region). Never draw your own spinners or shimmer blocks. See
|
|
170
|
-
[
|
|
170
|
+
[the screen states](reference/components/crossfade/examples/screen.tsx) and [motion.md](motion.md).
|
|
171
171
|
|
|
172
172
|
## Secondary actions
|
|
173
173
|
|
package/dist/skill/cheatsheet.md
CHANGED
|
@@ -39,6 +39,10 @@ reference is each component's `COMPONENT.md` ([components.md](components.md)), t
|
|
|
39
39
|
- A record card that saves each field: `<Input.Root onCommit={save}>` (save returns a Promise) — not hand-written blur / Enter / Escape handlers or a field disabled while saving.
|
|
40
40
|
- Markdown text outside a chat (an announcement, a task description) is `<Textarea.Root formatting>`: the Composer's toolbar, hotkeys and subset (`**`, `_`, `~~`, `` ` ``, `||spoiler||`, links, `> `) — not a hand-made toolbar over a textarea. Turn it on only where the text is shown with its Markdown.
|
|
41
41
|
- Copy or call next to a value: `Input.CopyButton`, `Input.Action` inside `Input.Wrapper` — not a Button beside the field; a password: `Input.RevealButton`.
|
|
42
|
+
- Records of one shape a person adds and removes (invoice lines, contacts, specs, prices by period): `<FieldList columns={[{ label: "Услуга" }, { label: "Цена", width: "m" }]} value onValueChange getId createItem addLabel renderItem={(item, row) => <>…fields without label…</>} />` — the headings stand once, every field takes its column heading as its label; not a `.map()` of fields with a `label` in every row, not «Позиция 1», «Позиция 2».
|
|
43
|
+
- Small attributes in a row of fields: an icon-only `Select` (`<Select.Trigger><Select.TriggerIcon>…</Select.TriggerIcon></Select.Trigger>`, no `Select.Value`) and a `ColorPresets` swatch in `width: "compact"` columns — not a full-width Select and a ColorField on a line of their own.
|
|
44
|
+
- A base value with overrides (a price and its changes by month): one `FieldList`, the base as the first row pinned by `getLocked` — not a separate field above a list in another geometry.
|
|
45
|
+
- One value in several units (a deposit in ₽, $, ฿): the fields side by side in one row under one heading, each unit in `Input.InlineAffix` — not a label per field, not the unit in the label and in the field.
|
|
42
46
|
|
|
43
47
|
## State
|
|
44
48
|
|
|
@@ -72,11 +76,19 @@ reference is each component's `COMPONENT.md` ([components.md](components.md)), t
|
|
|
72
76
|
- Busy action: `<Button.Root loading>` — not a hand-made spinner or «Загрузка…» text.
|
|
73
77
|
- An action on a coloured host (a solid Banner, an accent strip): `<Button.Root variant="ghost" tone="inherit">` — it takes the host's text colour; never recolour a Button with a CSS override.
|
|
74
78
|
|
|
79
|
+
## Page title and header
|
|
80
|
+
|
|
81
|
+
- An app page titles itself in its header: `<AppHeader.Title>` + `<AppHeader.Description>` with a line of data («128 в работе · 6 ждут оплаты») — not a `PageContent.Header` in main and not a sentence about the page.
|
|
82
|
+
- The page's tools — its own search and filter, sections, the view, the primary action — are a `<PageToolbar.Root>` in `<AppHeader.Tools>`; the page's other buttons in `<AppHeader.Actions>` — not a global search, notifications or app-wide buttons: the header row is per page.
|
|
83
|
+
- A nested record: `Breadcrumb` + `<AppHeader.Separator />` + `<AppHeader.Title>` with the record's name — not a breadcrumb in main.
|
|
84
|
+
- A document page (settings, a long form, help) is the only one with `<PageContent.Header>` + `PageContent.Title` in main, and then its header has no title — never two titles, never no `<h1>`.
|
|
85
|
+
|
|
75
86
|
## Cards and surfaces
|
|
76
87
|
|
|
77
88
|
- `Card.Root` only for a bounded block with its own title: a KPI tile (`variant="stat-trend"`), a settings panel (`variant="panel"`), side facts — not around a whole section, a form field or a page.
|
|
78
89
|
- Never a card in a card, and never a `DataTable` inside a Card — the table is already a filled block.
|
|
79
|
-
- Section without a card: `<
|
|
90
|
+
- Section without a card: `<PageContent.Section label="…">` + the content (a link or button beside the heading in `PageContent.Actions`) — not a hand-made `<section>` + `Typography as="h2"` + own gap.
|
|
91
|
+
- The tiles of a screen (KPI cards, charts, panels): one `<PageContent.Grid>` with a `<PageContent.Cell span>` per tile — not an `auto-fit` grid per row (the rows would stand 24 apart instead of 16).
|
|
80
92
|
- Depth from fill, not lines: no borders around blocks; `<Divider />` only inside a block.
|
|
81
93
|
- Every scroll region is a `ScrollContainer` — never `overflow: auto` on a `div`: its hidden edges fade by themselves (`edges="shadow"` on a filled surface, `"none"` only for a page column), `scrollbar="hidden"` on strips, `snap` on strips of cards, `lock` to hold a list still, `anchor="end"` for a log. Kit components already scroll through it; do not wrap them again.
|
|
82
94
|
- Tabs are a bar, not a container: `Tabs.Root` stands in the host's padding and the panel content goes straight into `Tabs.Panel` — never a Card or a padded `div` around the tabs or inside a panel. In a Modal / Drawer, `Tabs.Root` wraps `X.Header` + `X.Body` and `Tabs.List` goes last into the header — not a tab strip at the top of the body.
|
|
@@ -90,13 +102,14 @@ reference is each component's `COMPONENT.md` ([components.md](components.md)), t
|
|
|
90
102
|
- Data the server sorts and pages (thousands of records): `source="server"` + `rowCount`, controlled `sort` / `page` as the request, `page` back to 1 on a new search or filter, old rows kept with `loading` while the next page loads — not a server page passed to the default client mode, and not `rows={[]}` between pages.
|
|
91
103
|
- Categories (sources, platforms, regions) get `color` and the same order of `chartColors` in charts; statuses and meanings get `tone` — never paint categories with tones.
|
|
92
104
|
- A chart with axes or several series: `<ChartFrame.Root series state>` around the library (or your SVG) with `ChartFrame.Plot renderPlot`, `Legend`, `Table` — not a hand-made Card with a grey box while loading and a legend of colored dots.
|
|
105
|
+
- A tooltip on your own SVG chart: `<ChartFrame.Tooltip point={{ x, y }} items>` with the pointer in plot coordinates — not a `foreignObject` or a div placed and clamped by hand; it flips only when out of room.
|
|
93
106
|
- Amounts, counts and dates are `numeric` columns; statuses are `Badge.Root color` from one status → color map.
|
|
94
107
|
- Rows people order by hand: `onReorder(id, beforeId)` (apply it with `moveBefore`, return the save's Promise) — not a Dnd list rebuilt next to the table.
|
|
95
108
|
- A short list of records people order by hand (stages, priorities) is `<List.Root onReorder>` with `List.Item value` — not up / down buttons or a hand-made `Dnd.Sortable`.
|
|
96
109
|
- Groups that fold: pass `defaultCollapsedGroups={[]}` (or the controlled `collapsedGroups` + `onCollapsedGroupsChange`) — not your own button in `renderGroupHeader` or filtering `rows`. One heatmap over several columns: the same `scale: { min, max }` on each.
|
|
97
|
-
- A trend in a table row is `<Sparkline layout="compact">` in the column's `cell` (a column `width`, series built once, not inline); the number itself goes in its own column.
|
|
110
|
+
- A trend in a table row is `<Sparkline layout="compact">` in the column's `cell` (a column `width`, series built once, not inline, the same `min` / `max` on every row when rows compare by size); the number itself goes in its own column. A missing day is `value: null`, never `0`.
|
|
98
111
|
- Properties of one record: `<DescriptionList.Root>` of `DescriptionList.Item` — not a hand-made grid of label / value text, not a one-row DataTable.
|
|
99
|
-
- Who is busy when, a plan with dates: `Gantt` with `onBarChange` / `onBarCreate` — not bars drawn by hand or a DataTable of start and end dates. Statuses moved by hand: `Kanban
|
|
112
|
+
- Who is busy when, a plan with dates: `Gantt` with `onBarChange` / `onBarCreate` — not bars drawn by hand or a DataTable of start and end dates. Statuses moved by hand: `Kanban` — `plain` (default, a header plate) or `line` (a header over a line) for a board that is the page's main region, `variant="well"` only when columns must read as bounded queues (WIP limits, sparse columns); never a Card or a filled box around a column.
|
|
100
113
|
- Open a board card with `Kanban.Root onItemClick` (click, Enter, Space, never after a drag) or `getItemHref`; a Gantt row with `onRowClick` / `getRowHref` (the DataTable contract), a bar with `onSelect`; more facts in a bar tooltip with `renderBarTooltip` (it adds lines under the dates). A legend of hues is a row of `Badge.Root color` + `Badge.Dot` in the host's `toolbar`, the category also in text. Hour slots (bookings, appointments) are not Gantt — its unit is a calendar day.
|
|
101
114
|
|
|
102
115
|
## Chat
|
|
@@ -113,7 +126,7 @@ reference is each component's `COMPONENT.md` ([components.md](components.md)), t
|
|
|
113
126
|
- «печатает…» on the other side: `Composer onActivityChange` (`typing` / `voice` / `video` / `null`, on a change only) → your socket; on the receiving side `<Chat.Root typing={activity === "typing"}>` (the header's status and the list's typing bubble together). Never send it from `onValueChange`.
|
|
114
127
|
- Appearance: messages that are new at the end enter by themselves — mine and theirs float up a little from below and fade in; the first render, history loaded above and rows scrolled into view never animate. Do not add your own enter animation or `scrollTop = scrollHeight`.
|
|
115
128
|
- `Chat.Messages` scrolls to my message, stays at the end for theirs while the reader is there, and otherwise shows the «N новых» button; `onNewMessage(value, { direction })` is for a sound or a counter, `onRead(values)` for read receipts (only what was really seen). The first unread is `unread={key}`; older history is `hasOlder` + `onLoadOlder`.
|
|
116
|
-
- Jump to a message: `Message.Reply target={id}`, a press on `Chat.Pinned`, or `Chat.Root current={id}` (the chat scrolls to it and the
|
|
129
|
+
- Jump to a message: `Message.Reply target={id}`, a press on `Chat.Pinned`, or `Chat.Root current={id}` (the chat scrolls to it and the message blinks); search: `Chat.SearchButton` + `Chat.Search` mark, count and step through the matches in texts and transcripts, keeping the others stepped back. Never an outline or a wash of your own on the target or on selected messages. Never `scrollIntoView` or your own transforms on rows.
|
|
117
130
|
- A long history (thousands of messages): nothing to switch on — `Chat.Messages` renders only the rows around the view and keeps the reader's place. With children, every top-level child is one row (a `Message.Root`, or a fragment / your own row component keyed by the message `value`); give pictures their `width` / `height` so a row's size is final before load; jumps, search, selection and the keyboard still reach every message. Not a hand-rolled window, `content-visibility` on rows or a measured bubble.
|
|
118
131
|
- A message's layout is CSS: the bubble fits its content and the time sits at the end of the last line (or of the reactions row). Every size change of a message (reactions, a transcript, an edit, an upload) plays as one built-in stroke, width and height together; a reaction grows the message upward with the time still, the rows above gliding as one block. Never size, measure or animate a bubble yourself; an own content part declares itself with the kit's part contract instead of a wrapper.
|
|
119
132
|
- One sound at a time is built in: a voice message, a video message and a chat video pause each other; `playing` / `onPlayingChange` on `VoicePlayer` or `VideoNote` when the app needs to know. A round video never plays or loops before a press. A recorded voice message without levels gets them from `getWaveform(blob)` once, stored with the message.
|
|
@@ -170,7 +183,7 @@ State change is continuous in the whole kit: every region that changes what it s
|
|
|
170
183
|
|
|
171
184
|
Full rules: [responsive.md](responsive.md).
|
|
172
185
|
|
|
173
|
-
- The page panel is `<PageToolbar.Root>` with, in this order, `Tools` (`SmartFilter.Toolbar`: search, then filter), `Sections` (a `fullWidth` SegmentedControl), `View`, `Actions`, `Chips` — the active filters
|
|
186
|
+
- The page panel is `<PageToolbar.Root>` with, in this order, `Tools` (`SmartFilter.Toolbar`: search, then filter), `Sections` (a `fullWidth` SegmentedControl), `View`, `Actions`, `Chips` — the active filters sit under the top row, never under the sections; on a phone the primary action takes its own row by itself when the search would be squeezed; not a hand-made flex row of tabs, search and buttons.
|
|
174
187
|
- Rearrange, never hide: every desktop function is on the phone, in another place or a menu — not `display: none` below a breakpoint.
|
|
175
188
|
- Breakpoints 640 · 768 · 1024 · 1280 only for the app frame; inside a page — intrinsic grids (`auto-fill, minmax`) and container queries.
|
|
176
189
|
- A wide table scrolls inside itself; offer `DataTable.ColumnsMenu` in its `toolbar` — never drop columns by breakpoint, never hand-build the chooser.
|
|
@@ -183,10 +196,23 @@ Full rules: [responsive.md](responsive.md).
|
|
|
183
196
|
|
|
184
197
|
## Spacing and values
|
|
185
198
|
|
|
186
|
-
- Gaps are `gap` on the parent with `--prime-space-N` (N × 4px): 8 in a row of buttons, 20 field → field, 32 group → group; `PageContent
|
|
199
|
+
- Gaps are `gap` on the parent with `--prime-space-N` (N × 4px): 8 in a row of buttons, 16 tile → tile, 20 field → field, 32 group → group; `PageContent` already spaces blocks 24 and sections 40 — not margins, not outer padding.
|
|
187
200
|
- Tokens only: `var(--prime-space-4)`, `var(--prime-color-text-secondary)`, `var(--prime-radius-m)` — never raw `px` / `rem` / hex, never `--prime-ref-*`, never inline `style`.
|
|
188
201
|
- Text through `Typography` roles (`title-m`, `title-s`, `body-m`, `caption`) and `tone="secondary" | "muted"` — not `font-size` or `color` in CSS.
|
|
189
202
|
|
|
203
|
+
## UX — what goes on the screen
|
|
204
|
+
|
|
205
|
+
- Five lines of brief before the JSX: who and what for, the data and its shape, the main action, the states, the narrow screen ([ux.md](ux.md)) — not a layout picked by habit.
|
|
206
|
+
- The shape of the data picks the layout: one record → a form or a `DescriptionList`; records a person edits → `FieldList`; records a person reads → `DataTable` ([the table](ux.md#2-the-shape-of-the-data-decides-the-layout)).
|
|
207
|
+
- Every label carries something new: once per column, never numbered, never repeating its heading; no hint that explains what the layout shows (a lock already says «закреплено»).
|
|
208
|
+
- Buttons say the verb and the object («Выставить счёт»), errors say how to fix it («Формат: +7 912 404-18-20»), empty states offer the next step — not «ОК», «Ошибка», «Нет данных».
|
|
209
|
+
- Money, numbers and dates through `Intl` (`ru-RU`); «ёлочки», `…`, a non-breaking space before a unit — not `toFixed` and string glue.
|
|
210
|
+
- Friction matches the cost: a reversible action at once with «Отменить» in a `Notification`; `ConfirmDialog` only for irreversible or weighty ones, naming the thing and the loss — not «Вы уверены?» on every delete.
|
|
211
|
+
- A disabled control says why when the reason is not on screen; an action without permission is hidden.
|
|
212
|
+
- Tabs, filters, search, page and the open record live in the URL.
|
|
213
|
+
- Changing a screen that exists: audit it against [ux.md](ux.md), [checklist.md](checklist.md) and [anti-slop.md](anti-slop.md) first, fix the shape, then make the change.
|
|
214
|
+
- Before handing over, look at it in a browser: both themes, 1280 and 375 px, every text read aloud.
|
|
215
|
+
|
|
190
216
|
## Anti-slop
|
|
191
217
|
|
|
192
218
|
The whole list, bad → good: [anti-slop.md](anti-slop.md). Before handing over: [checklist.md](checklist.md).
|
|
@@ -205,7 +231,7 @@ applyTheme("light");
|
|
|
205
231
|
The frame itself (providers, `AppShell` with `Sidebar` and the phone menu button) is built once too:
|
|
206
232
|
copy it from [layouts.md](layouts.md#app-frame-once-per-app).
|
|
207
233
|
|
|
208
|
-
A page
|
|
234
|
+
A document page (a form) — its title is in main, its header carries none:
|
|
209
235
|
|
|
210
236
|
```tsx
|
|
211
237
|
import { Button, Icon, Input, PageContent } from "prime-ui-kit";
|