prime-ui-kit 0.16.0 → 0.18.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 +15 -18
- package/dist/chunks/{chunk-A7OQWH6R.js → chunk-IVS3J7AS.js} +1 -1
- package/dist/chunks/{chunk-6TPHKCUJ.js → chunk-MB4CXSLL.js} +27732 -26723
- package/dist/chunks/{chunk-4PSQ64S4.js → chunk-OAXJWF3L.js} +6818 -6264
- package/dist/chunks/{chunk-U3Q2I3MY.js → chunk-QFHE5GKW.js} +3 -2
- package/dist/chunks/{chunk-HDBQICPW.js → chunk-X3JT5CLR.js} +60 -20
- package/dist/color-picker.d.ts +1 -1
- package/dist/color-picker.js +3 -3
- package/dist/components/badge/Badge.d.ts +17 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +12 -3
- package/dist/components/button/Button.d.ts +1 -1
- package/dist/components/button-group/ButtonGroup.d.ts +1 -1
- package/dist/components/card/Card.d.ts +8 -4
- package/dist/components/chart-frame/ChartFrame.d.ts +1 -1
- package/dist/components/chat/Chat.d.ts +3 -3
- package/dist/components/chat/ChatRows.d.ts +5 -1
- package/dist/components/chat/MessageList.d.ts +5 -1
- package/dist/components/chat/groupMessages.d.ts +12 -4
- package/dist/components/chat-list/ChatList.d.ts +18 -9
- package/dist/components/chat-list/formatChatTime.d.ts +3 -3
- package/dist/components/checkbox/Checkbox.d.ts +6 -1
- package/dist/components/color-field/ColorField.d.ts +1 -1
- package/dist/components/color-picker/ColorPicker.d.ts +23 -1
- package/dist/components/color-picker/ColorPresets.d.ts +9 -1
- package/dist/components/crossfade/Crossfade.d.ts +1 -1
- package/dist/components/data-table/DataTable.d.ts +3 -1
- package/dist/components/data-table/Head.d.ts +3 -1
- package/dist/components/data-table/types.d.ts +5 -0
- package/dist/components/digit-input/DigitInput.d.ts +1 -1
- package/dist/components/drawer/Drawer.d.ts +3 -2
- package/dist/components/field-list/FieldList.d.ts +18 -6
- package/dist/components/hint/Hint.d.ts +8 -2
- package/dist/components/index.d.ts +6 -7
- package/dist/components/input/Input.d.ts +27 -5
- package/dist/components/input/inputSuggestions.d.ts +39 -0
- package/dist/components/kanban/Kanban.d.ts +4 -9
- package/dist/components/list/List.d.ts +19 -5
- package/dist/components/message/Message.d.ts +15 -3
- package/dist/components/message/MessageSticker.d.ts +27 -0
- package/dist/components/message/formatMessageTime.d.ts +5 -2
- package/dist/components/modal/Modal.d.ts +3 -2
- package/dist/components/native-select/NativeSelect.d.ts +1 -1
- package/dist/components/pagination/Pagination.d.ts +5 -1
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/radio/Radio.d.ts +11 -2
- package/dist/components/rich-text/RichText.d.ts +23 -0
- package/dist/components/scroll-container/ScrollContainer.d.ts +1 -1
- package/dist/components/scroll-container/scrollGlide.d.ts +26 -0
- package/dist/components/scroll-container/useScrollMotion.d.ts +25 -0
- package/dist/components/segmented-control/SegmentedControl.d.ts +1 -1
- package/dist/components/select/selectContext.d.ts +7 -0
- package/dist/components/slider/Slider.d.ts +2 -2
- package/dist/components/smart-filter/SmartFilter.d.ts +4 -5
- package/dist/components/switch/Switch.d.ts +6 -1
- package/dist/components/tag-select/TagSelect.d.ts +1 -1
- package/dist/components/textarea/Textarea.d.ts +6 -1
- package/dist/components/timeline/Timeline.d.ts +1 -1
- package/dist/icon-set.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.js +7 -9
- package/dist/internal/ChoiceField.d.ts +3 -1
- package/dist/internal/FieldFrame.d.ts +8 -2
- package/dist/internal/barPlan.d.ts +44 -0
- package/dist/internal/fieldCell.d.ts +1 -1
- package/dist/internal/formatClock.d.ts +23 -2
- package/dist/internal/leaveGuard.d.ts +21 -0
- package/dist/internal/messageList.d.ts +2 -0
- package/dist/internal/overlay/DialogParts.d.ts +27 -2
- package/dist/internal/overlay/FloatingPanel.d.ts +1 -1
- package/dist/internal/overlay/focus.d.ts +3 -2
- package/dist/internal/parts.d.ts +1 -1
- package/dist/internal/slot.d.ts +0 -30
- package/dist/internal/swatch.d.ts +5 -0
- package/dist/internal/tokenDefaults.d.ts +1 -0
- package/dist/layout/app-shell/AppShell.d.ts +19 -38
- package/dist/layout/index.d.ts +3 -3
- package/dist/layout/page/Page.d.ts +302 -0
- package/dist/layout/sidebar/Sidebar.d.ts +1 -1
- package/dist/skill/SKILL.md +10 -10
- package/dist/skill/anti-slop.md +106 -5
- package/dist/skill/api-contract.md +15 -8
- package/dist/skill/cheatsheet.md +46 -26
- package/dist/skill/checklist.md +12 -3
- package/dist/skill/choosing.md +34 -20
- package/dist/skill/components.md +4 -5
- package/dist/skill/composition.md +193 -154
- package/dist/skill/foundations.md +9 -9
- package/dist/skill/layouts.md +42 -99
- package/dist/skill/reference/components/avatar/COMPONENT.md +2 -2
- package/dist/skill/reference/components/avatar/examples/team-group.tsx +1 -1
- package/dist/skill/reference/components/badge/COMPONENT.md +14 -1
- package/dist/skill/reference/components/badge/examples/examples.module.css +7 -0
- package/dist/skill/reference/components/badge/examples/tag-row.tsx +34 -0
- package/dist/skill/reference/components/banner/COMPONENT.md +4 -4
- package/dist/skill/reference/components/banner/examples/examples.module.css +6 -1
- package/dist/skill/reference/components/banner/examples/page-strip.tsx +24 -22
- package/dist/skill/reference/components/breadcrumb/COMPONENT.md +18 -12
- package/dist/skill/reference/components/breadcrumb/examples/router.tsx +17 -0
- package/dist/skill/reference/components/button/COMPONENT.md +2 -1
- package/dist/skill/reference/components/button/examples/hold-to-confirm.tsx +1 -1
- package/dist/skill/reference/components/button/examples/on-colored-host.tsx +8 -8
- package/dist/skill/reference/components/button-group/COMPONENT.md +1 -0
- package/dist/skill/reference/components/card/COMPONENT.md +14 -8
- package/dist/skill/reference/components/card/examples/screen.module.css +1 -1
- package/dist/skill/reference/components/card/examples/screen.tsx +184 -198
- package/dist/skill/reference/components/card/examples/states.tsx +59 -0
- package/dist/skill/reference/components/chart-frame/COMPONENT.md +1 -1
- package/dist/skill/reference/components/chart-frame/examples/fill-height.tsx +9 -9
- package/dist/skill/reference/components/chat/COMPONENT.md +8 -5
- package/dist/skill/reference/components/chat/examples/screen.module.css +1 -1
- package/dist/skill/reference/components/chat/examples/screen.tsx +110 -117
- package/dist/skill/reference/components/chat/examples/time-zone.tsx +83 -0
- package/dist/skill/reference/components/chat-list/COMPONENT.md +14 -8
- package/dist/skill/reference/components/chat-list/examples/controlled.tsx +2 -2
- package/dist/skill/reference/components/chat-list/examples/examples.module.css +8 -0
- package/dist/skill/reference/components/chat-list/examples/links.tsx +1 -1
- package/dist/skill/reference/components/chat-list/examples/router.tsx +63 -0
- package/dist/skill/reference/components/checkbox/COMPONENT.md +1 -0
- package/dist/skill/reference/components/checkbox/examples/examples.module.css +3 -2
- package/dist/skill/reference/components/code-block/COMPONENT.md +1 -1
- package/dist/skill/reference/components/code-block/examples/color-scheme.tsx +2 -4
- package/dist/skill/reference/components/code-block/examples/examples.module.css +0 -11
- package/dist/skill/reference/components/color-field/COMPONENT.md +2 -1
- package/dist/skill/reference/components/color-picker/COMPONENT.md +31 -11
- package/dist/skill/reference/components/color-picker/examples/examples.module.css +2 -5
- package/dist/skill/reference/components/color-picker/examples/overview.tsx +5 -10
- package/dist/skill/reference/components/color-picker/examples/presets-custom.tsx +31 -0
- package/dist/skill/reference/components/color-picker/examples/sizes.tsx +4 -8
- package/dist/skill/reference/components/color-swatches/COMPONENT.md +1 -0
- package/dist/skill/reference/components/crossfade/COMPONENT.md +3 -3
- package/dist/skill/reference/components/crossfade/examples/screen.tsx +107 -112
- package/dist/skill/reference/components/data-table/COMPONENT.md +12 -7
- package/dist/skill/reference/components/data-table/examples/examples.module.css +9 -0
- package/dist/skill/reference/components/data-table/examples/numeric.tsx +9 -2
- package/dist/skill/reference/components/data-table/examples/screen.tsx +42 -52
- package/dist/skill/reference/components/data-table/examples/server.tsx +6 -2
- package/dist/skill/reference/components/datepicker/COMPONENT.md +3 -1
- package/dist/skill/reference/components/datepicker/examples/deadline.tsx +33 -0
- package/dist/skill/reference/components/datepicker/examples/examples.module.css +6 -0
- package/dist/skill/reference/components/datepicker/examples/inline-panel.tsx +3 -1
- package/dist/skill/reference/components/description-list/COMPONENT.md +1 -1
- package/dist/skill/reference/components/description-list/examples/screen.tsx +120 -127
- package/dist/skill/reference/components/digit-input/COMPONENT.md +1 -0
- package/dist/skill/reference/components/digit-input/examples/grouped.tsx +4 -4
- package/dist/skill/reference/components/digit-input/examples/validation.tsx +1 -1
- package/dist/skill/reference/components/divider/COMPONENT.md +2 -2
- package/dist/skill/reference/components/divider/examples/examples.module.css +4 -1
- package/dist/skill/reference/components/divider/examples/vertical.tsx +22 -9
- package/dist/skill/reference/components/dnd/examples/examples.module.css +3 -1
- package/dist/skill/reference/components/drawer/COMPONENT.md +16 -3
- package/dist/skill/reference/components/drawer/examples/client-card.tsx +32 -8
- package/dist/skill/reference/components/drawer/examples/placement.tsx +26 -31
- package/dist/skill/reference/components/drawer/examples/screen.tsx +137 -160
- package/dist/skill/reference/components/dropdown/COMPONENT.md +1 -1
- package/dist/skill/reference/components/example-frame/COMPONENT.md +3 -3
- package/dist/skill/reference/components/field-list/COMPONENT.md +15 -3
- package/dist/skill/reference/components/field-list/examples/saving.tsx +83 -0
- package/dist/skill/reference/components/field-list/examples/screen.module.css +1 -1
- package/dist/skill/reference/components/field-list/examples/screen.tsx +19 -19
- package/dist/skill/reference/components/field-list/examples/totals.tsx +82 -0
- package/dist/skill/reference/components/fieldset/COMPONENT.md +1 -1
- package/dist/skill/reference/components/fieldset/examples/states.tsx +1 -1
- package/dist/skill/reference/components/file-upload/COMPONENT.md +2 -1
- package/dist/skill/reference/components/file-upload/examples/screen.module.css +2 -2
- package/dist/skill/reference/components/file-upload/examples/screen.tsx +65 -81
- package/dist/skill/reference/components/gallery/COMPONENT.md +1 -0
- package/dist/skill/reference/components/gantt/COMPONENT.md +1 -1
- package/dist/skill/reference/components/gantt/examples/screen.module.css +1 -1
- package/dist/skill/reference/components/gantt/examples/screen.tsx +55 -73
- package/dist/skill/reference/components/hint/COMPONENT.md +16 -2
- package/dist/skill/reference/components/hint/examples/examples.module.css +10 -1
- package/dist/skill/reference/components/hint/examples/overview.tsx +1 -1
- package/dist/skill/reference/components/hint/examples/variants.tsx +48 -0
- package/dist/skill/reference/components/input/COMPONENT.md +39 -9
- package/dist/skill/reference/components/input/examples/affixes.tsx +4 -2
- package/dist/skill/reference/components/input/examples/dismiss.tsx +29 -0
- package/dist/skill/reference/components/input/examples/suggestions.tsx +26 -0
- package/dist/skill/reference/components/input/examples/time.tsx +24 -0
- package/dist/skill/reference/components/input/examples/with-select.tsx +44 -0
- package/dist/skill/reference/components/kanban/COMPONENT.md +7 -7
- package/dist/skill/reference/components/kanban/examples/columns.tsx +4 -2
- package/dist/skill/reference/components/kanban/examples/screen.module.css +1 -1
- package/dist/skill/reference/components/kanban/examples/screen.tsx +50 -65
- package/dist/skill/reference/components/kbd/COMPONENT.md +1 -1
- package/dist/skill/reference/components/label/examples/examples.module.css +12 -1
- package/dist/skill/reference/components/label/examples/overview.tsx +1 -1
- package/dist/skill/reference/components/list/COMPONENT.md +26 -10
- package/dist/skill/reference/components/list/examples/row-controls.tsx +80 -0
- package/dist/skill/reference/components/list/examples/with-icon.tsx +23 -2
- package/dist/skill/reference/components/login-form/COMPONENT.md +8 -7
- package/dist/skill/reference/components/login-form/examples/states.tsx +12 -14
- package/dist/skill/reference/components/media-viewer/examples/controlled.tsx +16 -16
- package/dist/skill/reference/components/media-viewer/examples/examples.module.css +1 -3
- package/dist/skill/reference/components/message/COMPONENT.md +30 -9
- package/dist/skill/reference/components/message/examples/preview.tsx +28 -0
- package/dist/skill/reference/components/message/examples/sticker.tsx +35 -0
- package/dist/skill/reference/components/modal/COMPONENT.md +15 -3
- package/dist/skill/reference/components/modal/examples/long-content.tsx +37 -18
- package/dist/skill/reference/components/native-select/COMPONENT.md +1 -0
- package/dist/skill/reference/components/notification/COMPONENT.md +1 -1
- package/dist/skill/reference/components/pagination/COMPONENT.md +11 -3
- package/dist/skill/reference/components/pagination/examples/controlled.tsx +2 -1
- package/dist/skill/reference/components/popover/COMPONENT.md +3 -2
- package/dist/skill/reference/components/popover/examples/width.tsx +13 -1
- package/dist/skill/reference/components/radio/COMPONENT.md +2 -0
- package/dist/skill/reference/components/rich-text/COMPONENT.md +93 -0
- package/dist/skill/reference/components/rich-text/examples/overview.tsx +19 -0
- package/dist/skill/reference/components/scroll-container/COMPONENT.md +8 -5
- package/dist/skill/reference/components/segmented-control/COMPONENT.md +1 -0
- package/dist/skill/reference/components/segmented-control/examples/in-form.tsx +1 -1
- package/dist/skill/reference/components/select/COMPONENT.md +7 -3
- package/dist/skill/reference/components/slider/COMPONENT.md +4 -3
- package/dist/skill/reference/components/slider/examples/controlled.tsx +1 -1
- package/dist/skill/reference/components/slider/examples/states.tsx +14 -10
- package/dist/skill/reference/components/smart-filter/COMPONENT.md +13 -13
- package/dist/skill/reference/components/smart-filter/examples/examples.module.css +3 -0
- package/dist/skill/reference/components/smart-filter/examples/many-values.tsx +12 -8
- package/dist/skill/reference/components/smart-filter/examples/sizes.tsx +7 -3
- package/dist/skill/reference/components/sparkline/COMPONENT.md +1 -0
- package/dist/skill/reference/components/sparkline/examples/curve.tsx +16 -11
- package/dist/skill/reference/components/sparkline/examples/states.tsx +14 -10
- package/dist/skill/reference/components/switch/COMPONENT.md +2 -1
- package/dist/skill/reference/components/tabs/COMPONENT.md +1 -1
- package/dist/skill/reference/components/tag-select/COMPONENT.md +1 -0
- package/dist/skill/reference/components/textarea/COMPONENT.md +1 -0
- package/dist/skill/reference/components/timeline/COMPONENT.md +3 -3
- package/dist/skill/reference/components/timeline/examples/structure.tsx +2 -1
- package/dist/skill/reference/components/typography/COMPONENT.md +2 -2
- package/dist/skill/reference/foundation.md +15 -11
- package/dist/skill/reference/layout/app-shell/COMPONENT.md +25 -38
- package/dist/skill/reference/layout/app-shell/examples/footer.tsx +10 -10
- package/dist/skill/reference/layout/app-shell/examples/overview.tsx +20 -22
- package/dist/skill/reference/layout/app-shell/examples/screen.module.css +2 -2
- package/dist/skill/reference/layout/app-shell/examples/screen.tsx +25 -30
- package/dist/skill/reference/layout/app-shell/examples/template.tsx +13 -17
- package/dist/skill/reference/layout/bottom-nav/COMPONENT.md +4 -3
- package/dist/skill/reference/layout/bottom-nav/examples/floating-action.tsx +10 -19
- package/dist/skill/reference/layout/bottom-nav/examples/floating.tsx +10 -19
- package/dist/skill/reference/layout/bottom-nav/examples/in-app-shell.tsx +11 -19
- package/dist/skill/reference/layout/page/COMPONENT.md +382 -0
- package/dist/skill/reference/layout/page/examples/actions-collapse.tsx +45 -0
- package/dist/skill/reference/layout/page/examples/collapse.tsx +68 -0
- package/dist/skill/reference/layout/page/examples/examples.module.css +92 -0
- package/{src/components/page-content → dist/skill/reference/layout/page}/examples/grid.tsx +15 -15
- package/dist/skill/reference/layout/page/examples/guard.tsx +87 -0
- package/dist/skill/reference/{components/page-content → layout/page}/examples/list-detail.tsx +14 -14
- package/dist/skill/reference/layout/page/examples/loading.tsx +57 -0
- package/dist/skill/reference/layout/page/examples/narrow.tsx +75 -0
- package/dist/skill/reference/layout/page/examples/overview.tsx +57 -0
- package/dist/skill/reference/{components/page-content → layout/page}/examples/screen.module.css +1 -1
- package/{src/components/page-content → dist/skill/reference/layout/page}/examples/screen.tsx +29 -19
- package/dist/skill/reference/{components/page-content → layout/page}/examples/sections.tsx +17 -24
- package/dist/skill/reference/layout/page/examples/structure.tsx +41 -0
- package/dist/skill/reference/{components/page-toolbar/examples/narrow.tsx → layout/page/examples/tools.tsx} +38 -35
- package/dist/skill/reference/layout/page/examples/top-bar.tsx +85 -0
- package/dist/skill/reference/{components/page-content → layout/page}/examples/variants.tsx +7 -7
- package/dist/skill/reference/layout/sidebar/COMPONENT.md +6 -4
- package/dist/skill/reference/layout/sidebar/examples/dismiss.tsx +10 -7
- package/dist/skill/reference/layout/sidebar/examples/narrow.tsx +11 -8
- package/dist/skill/responsive.md +94 -75
- package/dist/skill/ux.md +5 -3
- package/dist/tokens/layers.d.ts +2 -0
- package/dist/tokens/primitives.d.ts +12 -2
- package/dist/tokens/semantic.d.ts +9 -0
- package/dist/tokens/themes/dark.d.ts +7 -2
- package/package.json +2 -2
- package/src/components/avatar/COMPONENT.md +2 -2
- package/src/components/avatar/examples/team-group.tsx +1 -1
- package/src/components/badge/COMPONENT.md +14 -1
- package/src/components/badge/examples/examples.module.css +7 -0
- package/src/components/badge/examples/tag-row.tsx +34 -0
- package/src/components/banner/COMPONENT.md +4 -4
- package/src/components/banner/examples/examples.module.css +6 -1
- package/src/components/banner/examples/page-strip.tsx +24 -22
- package/src/components/breadcrumb/COMPONENT.md +18 -12
- package/src/components/breadcrumb/examples/router.tsx +17 -0
- package/src/components/button/COMPONENT.md +2 -1
- package/src/components/button/examples/hold-to-confirm.tsx +1 -1
- package/src/components/button/examples/on-colored-host.tsx +8 -8
- package/src/components/button-group/COMPONENT.md +1 -0
- package/src/components/card/COMPONENT.md +14 -8
- package/src/components/card/examples/screen.module.css +1 -1
- package/src/components/card/examples/screen.tsx +184 -198
- package/src/components/card/examples/states.tsx +59 -0
- package/src/components/chart-frame/COMPONENT.md +1 -1
- package/src/components/chart-frame/examples/fill-height.tsx +9 -9
- package/src/components/chat/COMPONENT.md +8 -5
- package/src/components/chat/examples/screen.module.css +1 -1
- package/src/components/chat/examples/screen.tsx +110 -117
- package/src/components/chat/examples/time-zone.tsx +83 -0
- package/src/components/chat-list/COMPONENT.md +14 -8
- package/src/components/chat-list/examples/controlled.tsx +2 -2
- package/src/components/chat-list/examples/examples.module.css +8 -0
- package/src/components/chat-list/examples/links.tsx +1 -1
- package/src/components/chat-list/examples/router.tsx +63 -0
- package/src/components/checkbox/COMPONENT.md +1 -0
- package/src/components/checkbox/examples/examples.module.css +3 -2
- package/src/components/code-block/COMPONENT.md +1 -1
- package/src/components/code-block/examples/color-scheme.tsx +2 -4
- package/src/components/code-block/examples/examples.module.css +0 -11
- package/src/components/color-field/COMPONENT.md +2 -1
- package/src/components/color-picker/COMPONENT.md +31 -11
- package/src/components/color-picker/examples/examples.module.css +2 -5
- package/src/components/color-picker/examples/overview.tsx +5 -10
- package/src/components/color-picker/examples/presets-custom.tsx +31 -0
- package/src/components/color-picker/examples/sizes.tsx +4 -8
- package/src/components/color-swatches/COMPONENT.md +1 -0
- package/src/components/crossfade/COMPONENT.md +3 -3
- package/src/components/crossfade/examples/screen.tsx +107 -112
- package/src/components/data-table/COMPONENT.md +12 -7
- package/src/components/data-table/examples/examples.module.css +9 -0
- package/src/components/data-table/examples/numeric.tsx +9 -2
- package/src/components/data-table/examples/screen.tsx +42 -52
- package/src/components/data-table/examples/server.tsx +6 -2
- package/src/components/datepicker/COMPONENT.md +3 -1
- package/src/components/datepicker/examples/deadline.tsx +33 -0
- package/src/components/datepicker/examples/examples.module.css +6 -0
- package/src/components/datepicker/examples/inline-panel.tsx +3 -1
- package/src/components/description-list/COMPONENT.md +1 -1
- package/src/components/description-list/examples/screen.tsx +120 -127
- package/src/components/digit-input/COMPONENT.md +1 -0
- package/src/components/digit-input/examples/grouped.tsx +4 -4
- package/src/components/digit-input/examples/validation.tsx +1 -1
- package/src/components/divider/COMPONENT.md +2 -2
- package/src/components/divider/examples/examples.module.css +4 -1
- package/src/components/divider/examples/vertical.tsx +22 -9
- package/src/components/dnd/examples/examples.module.css +3 -1
- package/src/components/drawer/COMPONENT.md +16 -3
- package/src/components/drawer/examples/client-card.tsx +32 -8
- package/src/components/drawer/examples/placement.tsx +26 -31
- package/src/components/drawer/examples/screen.tsx +137 -160
- package/src/components/dropdown/COMPONENT.md +1 -1
- package/src/components/example-frame/COMPONENT.md +3 -3
- package/src/components/field-list/COMPONENT.md +15 -3
- package/src/components/field-list/examples/saving.tsx +83 -0
- package/src/components/field-list/examples/screen.module.css +1 -1
- package/src/components/field-list/examples/screen.tsx +19 -19
- package/src/components/field-list/examples/totals.tsx +82 -0
- package/src/components/fieldset/COMPONENT.md +1 -1
- package/src/components/fieldset/examples/states.tsx +1 -1
- package/src/components/file-upload/COMPONENT.md +2 -1
- package/src/components/file-upload/examples/screen.module.css +2 -2
- package/src/components/file-upload/examples/screen.tsx +65 -81
- package/src/components/gallery/COMPONENT.md +1 -0
- package/src/components/gantt/COMPONENT.md +1 -1
- package/src/components/gantt/examples/screen.module.css +1 -1
- package/src/components/gantt/examples/screen.tsx +55 -73
- package/src/components/hint/COMPONENT.md +16 -2
- package/src/components/hint/examples/examples.module.css +10 -1
- package/src/components/hint/examples/overview.tsx +1 -1
- package/src/components/hint/examples/variants.tsx +48 -0
- package/src/components/input/COMPONENT.md +39 -9
- package/src/components/input/examples/affixes.tsx +4 -2
- package/src/components/input/examples/dismiss.tsx +29 -0
- package/src/components/input/examples/suggestions.tsx +26 -0
- package/src/components/input/examples/time.tsx +24 -0
- package/src/components/input/examples/with-select.tsx +44 -0
- package/src/components/kanban/COMPONENT.md +7 -7
- package/src/components/kanban/examples/columns.tsx +4 -2
- package/src/components/kanban/examples/screen.module.css +1 -1
- package/src/components/kanban/examples/screen.tsx +50 -65
- package/src/components/kbd/COMPONENT.md +1 -1
- package/src/components/label/examples/examples.module.css +12 -1
- package/src/components/label/examples/overview.tsx +1 -1
- package/src/components/list/COMPONENT.md +26 -10
- package/src/components/list/examples/row-controls.tsx +80 -0
- package/src/components/list/examples/with-icon.tsx +23 -2
- package/src/components/login-form/COMPONENT.md +8 -7
- package/src/components/login-form/examples/states.tsx +12 -14
- package/src/components/media-viewer/examples/controlled.tsx +16 -16
- package/src/components/media-viewer/examples/examples.module.css +1 -3
- package/src/components/message/COMPONENT.md +30 -9
- package/src/components/message/examples/preview.tsx +28 -0
- package/src/components/message/examples/sticker.tsx +35 -0
- package/src/components/modal/COMPONENT.md +15 -3
- package/src/components/modal/examples/long-content.tsx +37 -18
- package/src/components/native-select/COMPONENT.md +1 -0
- package/src/components/notification/COMPONENT.md +1 -1
- package/src/components/pagination/COMPONENT.md +11 -3
- package/src/components/pagination/examples/controlled.tsx +2 -1
- package/src/components/popover/COMPONENT.md +3 -2
- package/src/components/popover/examples/width.tsx +13 -1
- package/src/components/radio/COMPONENT.md +2 -0
- package/src/components/rich-text/COMPONENT.md +93 -0
- package/src/components/rich-text/examples/overview.tsx +19 -0
- package/src/components/scroll-container/COMPONENT.md +8 -5
- package/src/components/segmented-control/COMPONENT.md +1 -0
- package/src/components/segmented-control/examples/in-form.tsx +1 -1
- package/src/components/select/COMPONENT.md +7 -3
- package/src/components/slider/COMPONENT.md +4 -3
- package/src/components/slider/examples/controlled.tsx +1 -1
- package/src/components/slider/examples/states.tsx +14 -10
- package/src/components/smart-filter/COMPONENT.md +13 -13
- package/src/components/smart-filter/examples/examples.module.css +3 -0
- package/src/components/smart-filter/examples/many-values.tsx +12 -8
- package/src/components/smart-filter/examples/sizes.tsx +7 -3
- package/src/components/sparkline/COMPONENT.md +1 -0
- package/src/components/sparkline/examples/curve.tsx +16 -11
- package/src/components/sparkline/examples/states.tsx +14 -10
- package/src/components/switch/COMPONENT.md +2 -1
- package/src/components/tabs/COMPONENT.md +1 -1
- package/src/components/tag-select/COMPONENT.md +1 -0
- package/src/components/textarea/COMPONENT.md +1 -0
- package/src/components/timeline/COMPONENT.md +3 -3
- package/src/components/timeline/examples/structure.tsx +2 -1
- package/src/components/typography/COMPONENT.md +2 -2
- package/src/layout/app-shell/COMPONENT.md +25 -38
- package/src/layout/app-shell/examples/footer.tsx +10 -10
- package/src/layout/app-shell/examples/overview.tsx +20 -22
- package/src/layout/app-shell/examples/screen.module.css +2 -2
- package/src/layout/app-shell/examples/screen.tsx +25 -30
- package/src/layout/app-shell/examples/template.tsx +13 -17
- package/src/layout/bottom-nav/COMPONENT.md +4 -3
- package/src/layout/bottom-nav/examples/floating-action.tsx +10 -19
- package/src/layout/bottom-nav/examples/floating.tsx +10 -19
- package/src/layout/bottom-nav/examples/in-app-shell.tsx +11 -19
- package/src/layout/page/COMPONENT.md +382 -0
- package/src/layout/page/examples/actions-collapse.tsx +45 -0
- package/src/layout/page/examples/collapse.tsx +68 -0
- package/src/layout/page/examples/examples.module.css +92 -0
- package/{dist/skill/reference/components/page-content → src/layout/page}/examples/grid.tsx +15 -15
- package/src/layout/page/examples/guard.tsx +87 -0
- package/src/{components/page-content → layout/page}/examples/list-detail.tsx +14 -14
- package/src/layout/page/examples/loading.tsx +57 -0
- package/src/layout/page/examples/narrow.tsx +75 -0
- package/src/layout/page/examples/overview.tsx +57 -0
- package/src/{components/page-content → layout/page}/examples/screen.module.css +1 -1
- package/{dist/skill/reference/components/page-content → src/layout/page}/examples/screen.tsx +29 -19
- package/src/{components/page-content → layout/page}/examples/sections.tsx +17 -24
- package/src/layout/page/examples/structure.tsx +41 -0
- package/src/{components/page-toolbar/examples/narrow.tsx → layout/page/examples/tools.tsx} +38 -35
- package/src/layout/page/examples/top-bar.tsx +85 -0
- package/src/{components/page-content → layout/page}/examples/variants.tsx +7 -7
- package/src/layout/sidebar/COMPONENT.md +6 -4
- package/src/layout/sidebar/examples/dismiss.tsx +10 -7
- package/src/layout/sidebar/examples/narrow.tsx +11 -8
- package/src/styles/theme-dark.css +12 -10
- package/src/styles/theme-light.css +4 -0
- package/src/styles/tokens.css +3 -1
- package/dist/components/page-content/PageContent.d.ts +0 -192
- package/dist/components/page-toolbar/PageToolbar.d.ts +0 -55
- package/dist/components/scroll-container/useWheelToInline.d.ts +0 -10
- package/dist/layout/app-header/AppHeader.d.ts +0 -118
- package/dist/skill/reference/components/page-content/COMPONENT.md +0 -264
- package/dist/skill/reference/components/page-content/examples/examples.module.css +0 -56
- package/dist/skill/reference/components/page-content/examples/narrow.tsx +0 -25
- package/dist/skill/reference/components/page-content/examples/overview.tsx +0 -41
- package/dist/skill/reference/components/page-toolbar/COMPONENT.md +0 -147
- package/dist/skill/reference/components/page-toolbar/examples/examples.module.css +0 -16
- package/dist/skill/reference/components/page-toolbar/examples/overview.tsx +0 -113
- package/dist/skill/reference/components/page-toolbar/examples/save-changes.tsx +0 -43
- package/dist/skill/reference/components/page-toolbar/examples/without-search.tsx +0 -60
- package/dist/skill/reference/layout/app-header/COMPONENT.md +0 -187
- package/dist/skill/reference/layout/app-header/examples/breadcrumbs.tsx +0 -37
- package/dist/skill/reference/layout/app-header/examples/examples.module.css +0 -28
- package/dist/skill/reference/layout/app-header/examples/in-app-shell.tsx +0 -67
- package/dist/skill/reference/layout/app-header/examples/narrow.tsx +0 -66
- package/dist/skill/reference/layout/app-header/examples/overview.tsx +0 -34
- package/dist/skill/reference/layout/app-header/examples/page-title.tsx +0 -78
- package/dist/skill/reference/layout/app-shell/examples/contained.tsx +0 -30
- package/src/components/page-content/COMPONENT.md +0 -264
- package/src/components/page-content/examples/examples.module.css +0 -56
- package/src/components/page-content/examples/narrow.tsx +0 -25
- package/src/components/page-content/examples/overview.tsx +0 -41
- package/src/components/page-toolbar/COMPONENT.md +0 -147
- package/src/components/page-toolbar/examples/examples.module.css +0 -16
- package/src/components/page-toolbar/examples/overview.tsx +0 -113
- package/src/components/page-toolbar/examples/save-changes.tsx +0 -43
- package/src/components/page-toolbar/examples/without-search.tsx +0 -60
- package/src/layout/app-header/COMPONENT.md +0 -187
- package/src/layout/app-header/examples/breadcrumbs.tsx +0 -37
- package/src/layout/app-header/examples/examples.module.css +0 -28
- package/src/layout/app-header/examples/in-app-shell.tsx +0 -67
- package/src/layout/app-header/examples/narrow.tsx +0 -66
- package/src/layout/app-header/examples/overview.tsx +0 -34
- package/src/layout/app-header/examples/page-title.tsx +0 -78
- package/src/layout/app-shell/examples/contained.tsx +0 -30
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type PageLabels = {
|
|
3
|
+
/** Name of the menu button the top bar draws while the shell's Sidebar is off-canvas. */
|
|
4
|
+
menu: string;
|
|
5
|
+
/** Name of the «⋯» button the top bar's actions fold into when the row runs out of width. */
|
|
6
|
+
more: string;
|
|
7
|
+
/** Name of `Page.BackButton` (back from the detail to the list on a narrow split). */
|
|
8
|
+
back: string;
|
|
9
|
+
/** Title of the confirm `Page.Guard` opens when a person leaves a `dirty` page. */
|
|
10
|
+
leaveTitle: string;
|
|
11
|
+
/** Its description. */
|
|
12
|
+
leaveDescription: string;
|
|
13
|
+
/** Its confirm button: leave and lose the changes. */
|
|
14
|
+
leaveConfirm: string;
|
|
15
|
+
/** Its cancel button: stay on the page. */
|
|
16
|
+
leaveCancel: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const PAGE_LABELS: PageLabels;
|
|
19
|
+
type DivProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
20
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
21
|
+
};
|
|
22
|
+
/** Cap of the page column. */
|
|
23
|
+
export type PageMaxWidth = "full" | "readable" | "wide";
|
|
24
|
+
export type PageRootProps = DivProps & {
|
|
25
|
+
/**
|
|
26
|
+
* Cap of everything but the top bar, centred: `full` — the whole main; `readable` — 42rem (`--prime-layout-reading-max-width`); `wide` — 75rem (`--prime-layout-content-max-width`).
|
|
27
|
+
*/
|
|
28
|
+
maxWidth?: PageMaxWidth;
|
|
29
|
+
/**
|
|
30
|
+
* The page takes the height of main (`AppShell.Root fillViewport`) and the body takes what the bar and the header leave: for a full-height table, board, chat or `Page.Split`.
|
|
31
|
+
*/
|
|
32
|
+
fill?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Built-in strings of every part, see Labels.
|
|
35
|
+
*/
|
|
36
|
+
labels?: Partial<PageLabels>;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The page: the column inside `AppShell.Main` that holds the top bar, the header and the body. In
|
|
40
|
+
* the shell it takes the shell's gutters and top air (`--page-gutter`, `--page-top` from main);
|
|
41
|
+
* outside it brings none. `maxWidth` caps and centres everything but the top bar, which runs the
|
|
42
|
+
* width of the panel.
|
|
43
|
+
*/
|
|
44
|
+
declare function PageRoot({ maxWidth, fill, labels: labelsProp, className, ...rest }: PageRootProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
declare namespace PageRoot {
|
|
46
|
+
var displayName: string;
|
|
47
|
+
}
|
|
48
|
+
export type PageTopBarProps = React.HTMLAttributes<HTMLElement> & {
|
|
49
|
+
/**
|
|
50
|
+
* Sticks to the top of the page's scroller (`AppShell.Main`); `false` — scrolls away with the page. On a screen lower than 480px it scrolls anyway.
|
|
51
|
+
*/
|
|
52
|
+
sticky?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Once the flow `Page.Title` scrolls out under the bar, the bar repeats it as the last level of its heading (of its `Breadcrumb` path, which folds for it), unless the path ends at it; it leaves when the title returns.
|
|
55
|
+
*/
|
|
56
|
+
collapse?: boolean;
|
|
57
|
+
ref?: React.Ref<HTMLElement>;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* The page's strip at its top edge, across the panel. Up to four groups in one grid —
|
|
61
|
+
* `Page.Heading`, `Page.Tools`, `Page.Actions` on the first line, `Page.Chips` under them — laid
|
|
62
|
+
* out by one plan chosen from their natural widths (`planBar`): one line while everything fits;
|
|
63
|
+
* then the tools take a line of their own; then the buttons give way to their icons, secondary
|
|
64
|
+
* first, and fold into «⋯»; only then does a heading with a path stack (path over title), and a
|
|
65
|
+
* heading without one truncate. Sticky inside the scroller of
|
|
66
|
+
* the page; while the shell's Sidebar is off-canvas it starts with the menu button. With
|
|
67
|
+
* `collapse` it repeats the flow `Page.Title` once that title scrolls out under the bar.
|
|
68
|
+
*/
|
|
69
|
+
declare function PageTopBar({ sticky, collapse, className, children, ref, ...rest }: PageTopBarProps): import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
declare namespace PageTopBar {
|
|
71
|
+
var displayName: string;
|
|
72
|
+
}
|
|
73
|
+
export type PageHeaderProps = DivProps;
|
|
74
|
+
/**
|
|
75
|
+
* The document header in the page flow (settings, long forms, overviews): a `Page.Heading` and
|
|
76
|
+
* its `Page.Actions` in one row; the actions wrap under the heading on a narrow column. In a
|
|
77
|
+
* `Page.TopBar` the same parts stand directly in the bar.
|
|
78
|
+
*/
|
|
79
|
+
declare function PageHeader({ className, children, ...rest }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
80
|
+
declare namespace PageHeader {
|
|
81
|
+
var displayName: string;
|
|
82
|
+
}
|
|
83
|
+
export type PageHeadingProps = DivProps;
|
|
84
|
+
/**
|
|
85
|
+
* The title group: an optional `Breadcrumb` path, `Page.Title`, `Page.Description`. In the bar
|
|
86
|
+
* the title is the path's last level — the path, a chevron and the title on one line, the
|
|
87
|
+
* description under the whole line, both truncating; in the flow the path stands over a large
|
|
88
|
+
* title and the description wraps.
|
|
89
|
+
*/
|
|
90
|
+
declare function PageHeading({ className, children, ...rest }: PageHeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
91
|
+
declare namespace PageHeading {
|
|
92
|
+
var displayName: string;
|
|
93
|
+
}
|
|
94
|
+
export type PageTitleProps = React.HTMLAttributes<HTMLHeadingElement> & {
|
|
95
|
+
ref?: React.Ref<HTMLHeadingElement>;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* The page's `<h1>`: the last level of the path in the top bar (it truncates), a large title in
|
|
99
|
+
* the flow. A flow title is what a `collapse` top bar repeats once it scrolls away.
|
|
100
|
+
*/
|
|
101
|
+
declare function PageTitle({ className, children, ref, ...rest }: PageTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
102
|
+
declare namespace PageTitle {
|
|
103
|
+
var displayName: string;
|
|
104
|
+
}
|
|
105
|
+
export type PageDescriptionProps = React.HTMLAttributes<HTMLParagraphElement> & {
|
|
106
|
+
/**
|
|
107
|
+
* Its data is loading: a Skeleton keeps the line's place, so the title never moves; the data then fades in. Sets `aria-busy`.
|
|
108
|
+
*/
|
|
109
|
+
loading?: boolean;
|
|
110
|
+
ref?: React.Ref<HTMLParagraphElement>;
|
|
111
|
+
};
|
|
112
|
+
/** One line of context that carries data (a period, a count): truncates in the bar, wraps in the flow. */
|
|
113
|
+
declare function PageDescription({ loading, className, children, ...rest }: PageDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
114
|
+
declare namespace PageDescription {
|
|
115
|
+
var displayName: string;
|
|
116
|
+
}
|
|
117
|
+
export type PageActionsProps = DivProps;
|
|
118
|
+
/**
|
|
119
|
+
* The page's buttons: at the end of a `Page.Header` or a `Page.Section` heading in the flow (they
|
|
120
|
+
* wrap under it on a narrow column), on the first line of a `Page.TopBar` at every width. In the
|
|
121
|
+
* bar, when the line runs short, Buttons with an icon show only it — the secondary ones first,
|
|
122
|
+
* then the primary (the first solid Button) — with their label as name and tooltip; then the
|
|
123
|
+
* secondary Buttons fold into a «⋯» menu. Anything that is not a `Button.Root` stays as it is.
|
|
124
|
+
*/
|
|
125
|
+
declare function PageActions(props: PageActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
126
|
+
declare namespace PageActions {
|
|
127
|
+
var displayName: string;
|
|
128
|
+
}
|
|
129
|
+
export type PageToolsProps = DivProps;
|
|
130
|
+
/**
|
|
131
|
+
* The page's tools — sections, search and filter, view — as kit controls in the order written.
|
|
132
|
+
* On the bar's first line each keeps its natural width; on a line of their own they fill it:
|
|
133
|
+
* a search (`SmartFilter.Toolbar`, `Input.Root`) takes the room first, switchers and fields share
|
|
134
|
+
* the rest (a `SegmentedControl.Root` and a `Datepicker.Root` are `fullWidth` unless set; a Select
|
|
135
|
+
* trigger fills by itself), and they wrap when one line is not enough. Named (`aria-label`), it is
|
|
136
|
+
* a `group`.
|
|
137
|
+
*/
|
|
138
|
+
declare function PageTools({ className, children, ref, ...rest }: PageToolsProps): import("react/jsx-runtime").JSX.Element;
|
|
139
|
+
declare namespace PageTools {
|
|
140
|
+
var displayName: string;
|
|
141
|
+
}
|
|
142
|
+
export type PageChipsProps = DivProps;
|
|
143
|
+
/** Active filters (`SmartFilter.Chips`) on a line of their own under the bar; gone while empty. */
|
|
144
|
+
declare function PageChips({ className, ...rest }: PageChipsProps): import("react/jsx-runtime").JSX.Element;
|
|
145
|
+
declare namespace PageChips {
|
|
146
|
+
var displayName: string;
|
|
147
|
+
}
|
|
148
|
+
export type PageBodyProps = DivProps;
|
|
149
|
+
/** The page content: blocks of one screen 24 apart, a `Page.Section` 40 from its neighbours. */
|
|
150
|
+
declare function PageBody({ className, ...rest }: PageBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
151
|
+
declare namespace PageBody {
|
|
152
|
+
var displayName: string;
|
|
153
|
+
}
|
|
154
|
+
/** Where the heading of a section stands: over its content or in a column beside it. */
|
|
155
|
+
export type PageSectionLayout = "stack" | "aside";
|
|
156
|
+
export type PageSectionProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
|
|
157
|
+
/**
|
|
158
|
+
* The visible heading (`h2`); it also names the section.
|
|
159
|
+
*/
|
|
160
|
+
label: React.ReactNode;
|
|
161
|
+
/**
|
|
162
|
+
* One line of context under the heading, in secondary body-s.
|
|
163
|
+
*/
|
|
164
|
+
description?: React.ReactNode;
|
|
165
|
+
/**
|
|
166
|
+
* `stack` — the heading over the content; `aside` — a ~16rem heading column beside it (a settings page), above it once the content would get narrower than 30rem.
|
|
167
|
+
*/
|
|
168
|
+
layout?: PageSectionLayout;
|
|
169
|
+
ref?: React.Ref<HTMLElement>;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* A titled section of the page: an `h2` heading (with an optional description and `Page.Actions`
|
|
173
|
+
* at its end) over its content. Sections stand further apart than the plain blocks of the body,
|
|
174
|
+
* so the air shows where a new topic starts.
|
|
175
|
+
*/
|
|
176
|
+
declare function PageSection({ label, description, layout, className, children, ...rest }: PageSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
177
|
+
declare namespace PageSection {
|
|
178
|
+
var displayName: string;
|
|
179
|
+
}
|
|
180
|
+
export type PageGridProps = DivProps;
|
|
181
|
+
/**
|
|
182
|
+
* The grid of the page's tiles (KPI cards, charts, panels): 12 columns, one gap on both axes.
|
|
183
|
+
* Columns follow the grid's own width, so tiles fold on a narrow panel by themselves. A wide cell
|
|
184
|
+
* (span 7–11) written next to a narrow one (span 4–5) forms a pair that a mid-width grid lays out as
|
|
185
|
+
* 2/3 + 1/3, so the row keeps no hole.
|
|
186
|
+
*/
|
|
187
|
+
declare function PageGrid({ className, children, ...rest }: PageGridProps): import("react/jsx-runtime").JSX.Element;
|
|
188
|
+
declare namespace PageGrid {
|
|
189
|
+
var displayName: string;
|
|
190
|
+
}
|
|
191
|
+
/** Columns of 12 a cell spans on a wide grid. */
|
|
192
|
+
export type PageCellSpan = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
193
|
+
/** Rows a cell spans. */
|
|
194
|
+
export type PageCellRows = 1 | 2 | 3 | 4;
|
|
195
|
+
export type PageCellProps = DivProps & {
|
|
196
|
+
/**
|
|
197
|
+
* Columns of 12 on a wide grid (64rem+). Narrower grids round it: see Grid columns in COMPONENT.md.
|
|
198
|
+
*/
|
|
199
|
+
span?: PageCellSpan;
|
|
200
|
+
/**
|
|
201
|
+
* Rows the cell spans from 40rem: a chart beside two stacked tiles (`ChartFrame.Plot height="fill"` fills the height).
|
|
202
|
+
*/
|
|
203
|
+
rows?: PageCellRows;
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* One tile place in `Page.Grid`; its child (a Card, a ChartFrame) fills it. A `Crossfade` child
|
|
207
|
+
* fills it too (`fill` unless set), so a tile that swaps its states keeps the row's height.
|
|
208
|
+
*/
|
|
209
|
+
declare function PageCell({ span, rows, className, children, ...rest }: PageCellProps): import("react/jsx-runtime").JSX.Element;
|
|
210
|
+
declare namespace PageCell {
|
|
211
|
+
var displayName: string;
|
|
212
|
+
}
|
|
213
|
+
export type PageGuardProps = {
|
|
214
|
+
/**
|
|
215
|
+
* A request runs (a save): a press on those items does nothing until it ends; the browser asks before the tab closes.
|
|
216
|
+
*/
|
|
217
|
+
busy?: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Changes are not saved: a press on those items asks «leave without saving?»; its confirm (`labels.leaveConfirm`) repeats the press, its cancel keeps the page. The browser asks before the tab closes.
|
|
220
|
+
*/
|
|
221
|
+
dirty?: boolean;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* Holds the page from where its form state lives: put it anywhere inside the page. While it holds,
|
|
225
|
+
* a press on a `Sidebar.Item`, a `BottomNav.Item` or a `Breadcrumb.Item` link stops before it
|
|
226
|
+
* navigates — `busy` holds it, `dirty` asks «leave without saving?» and replays the press once the
|
|
227
|
+
* person agrees — and the browser asks before the tab closes or reloads. Renders only the confirm.
|
|
228
|
+
*/
|
|
229
|
+
declare function PageGuard({ busy, dirty }: PageGuardProps): import("react/jsx-runtime").JSX.Element;
|
|
230
|
+
declare namespace PageGuard {
|
|
231
|
+
var displayName: string;
|
|
232
|
+
}
|
|
233
|
+
export type PageSplitProps = DivProps & {
|
|
234
|
+
/**
|
|
235
|
+
* The detail is open (a record is chosen), controlled. On a narrow split it takes the place of the list; on a wide one both panes stay.
|
|
236
|
+
*/
|
|
237
|
+
open?: boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Initial open state, uncontrolled.
|
|
240
|
+
*/
|
|
241
|
+
defaultOpen?: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* `Page.BackButton` closes the detail (`false`); clear the chosen record there.
|
|
244
|
+
*/
|
|
245
|
+
onOpenChange?: (open: boolean) => void;
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* List + detail (mail, a messenger, a ticket queue): two panes side by side from 48rem of its own
|
|
249
|
+
* width, one at a time below it — the list, or the open detail with a back button. Takes the free
|
|
250
|
+
* height of a filling page; each pane gives its last child the free height.
|
|
251
|
+
*/
|
|
252
|
+
declare function PageSplit({ open: openProp, defaultOpen, onOpenChange, className, children, ...rest }: PageSplitProps): import("react/jsx-runtime").JSX.Element;
|
|
253
|
+
declare namespace PageSplit {
|
|
254
|
+
var displayName: string;
|
|
255
|
+
}
|
|
256
|
+
export type PageListProps = DivProps;
|
|
257
|
+
/**
|
|
258
|
+
* The list pane of the split: a fixed column on a wide split, the whole split while the detail is
|
|
259
|
+
* closed. It remembers the control that had focus, so going back returns there.
|
|
260
|
+
*/
|
|
261
|
+
declare function PageList(props: PageListProps): import("react/jsx-runtime").JSX.Element;
|
|
262
|
+
declare namespace PageList {
|
|
263
|
+
var displayName: string;
|
|
264
|
+
}
|
|
265
|
+
export type PageDetailProps = DivProps;
|
|
266
|
+
/** The detail pane of the split: the rest of a wide split; on a narrow one it replaces the list while open. */
|
|
267
|
+
declare function PageDetail(props: PageDetailProps): import("react/jsx-runtime").JSX.Element;
|
|
268
|
+
declare namespace PageDetail {
|
|
269
|
+
var displayName: string;
|
|
270
|
+
}
|
|
271
|
+
export type PageBackButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "children"> & {
|
|
272
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* Back from the detail to the list: a soft neutral icon Button named by `labels.back`, shown only
|
|
276
|
+
* while the split shows one pane. Put it at the start of the detail's header.
|
|
277
|
+
*/
|
|
278
|
+
declare function PageBackButton({ className, onClick, ...rest }: PageBackButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
279
|
+
declare namespace PageBackButton {
|
|
280
|
+
var displayName: string;
|
|
281
|
+
}
|
|
282
|
+
export declare const Page: {
|
|
283
|
+
Root: typeof PageRoot;
|
|
284
|
+
TopBar: typeof PageTopBar;
|
|
285
|
+
Header: typeof PageHeader;
|
|
286
|
+
Heading: typeof PageHeading;
|
|
287
|
+
Title: typeof PageTitle;
|
|
288
|
+
Description: typeof PageDescription;
|
|
289
|
+
Actions: typeof PageActions;
|
|
290
|
+
Tools: typeof PageTools;
|
|
291
|
+
Chips: typeof PageChips;
|
|
292
|
+
Body: typeof PageBody;
|
|
293
|
+
Section: typeof PageSection;
|
|
294
|
+
Grid: typeof PageGrid;
|
|
295
|
+
Cell: typeof PageCell;
|
|
296
|
+
Guard: typeof PageGuard;
|
|
297
|
+
Split: typeof PageSplit;
|
|
298
|
+
List: typeof PageList;
|
|
299
|
+
Detail: typeof PageDetail;
|
|
300
|
+
BackButton: typeof PageBackButton;
|
|
301
|
+
};
|
|
302
|
+
export {};
|
|
@@ -61,7 +61,7 @@ export type SidebarRootProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
|
61
61
|
*/
|
|
62
62
|
defaultOpen?: boolean;
|
|
63
63
|
/**
|
|
64
|
-
* Off-canvas open / close: Toggle, the
|
|
64
|
+
* Off-canvas open / close: Toggle, the menu button of `Page.TopBar`, scrim, Escape, an activated item, leaving the narrow viewport.
|
|
65
65
|
*/
|
|
66
66
|
onOpenChange?: (open: boolean) => void;
|
|
67
67
|
/**
|
package/dist/skill/SKILL.md
CHANGED
|
@@ -32,8 +32,8 @@ region, `Skeleton` while it loads).
|
|
|
32
32
|
the main action, the states, the narrow screen); the shape of the data decides the layout, every
|
|
33
33
|
label must carry something new, friction matches the cost of a mistake.
|
|
34
34
|
2. **The app frame, once per app** — [layouts.md](layouts.md): styles, theme, providers, `AppShell`
|
|
35
|
-
with the `Sidebar`, page wrappers, auth screens. A screen you deliver renders its page:
|
|
36
|
-
`
|
|
35
|
+
with the `Sidebar`, page wrappers, auth screens. A screen you deliver renders its page: one
|
|
36
|
+
`Page.Root` with its top bar (title, a line of data, its tools) and its body.
|
|
37
37
|
3. **Choose** — [choosing.md](choosing.md): the category by task, then the component, then the pairs
|
|
38
38
|
that are easy to confuse.
|
|
39
39
|
4. **Read the component** — [components.md](components.md) links each `COMPONENT.md` (API, variants,
|
|
@@ -48,8 +48,8 @@ region, `Skeleton` while it loads).
|
|
|
48
48
|
icon names.
|
|
49
49
|
7. **States and motion** — [motion.md](motion.md): every region loads, empties and fails without
|
|
50
50
|
flipping; what the kit animates by itself and when to move your own elements.
|
|
51
|
-
8. **Narrow screens** — [responsive.md](responsive.md): every screen works from 320px, the page
|
|
52
|
-
|
|
51
|
+
8. **Narrow screens** — [responsive.md](responsive.md): every screen works from 320px, the page's top bar
|
|
52
|
+
gives way by width itself, nothing is hidden on phones, touch follows `(hover)` / `(pointer)`.
|
|
53
53
|
9. **Check** — [checklist.md](checklist.md) and [anti-slop.md](anti-slop.md), then look at the screen
|
|
54
54
|
in a browser ([ux.md](ux.md#9-look-at-it-before-handing-it-over)). Fix every «no», then hand
|
|
55
55
|
over.
|
|
@@ -65,7 +65,7 @@ project under `node_modules/prime-ui-kit/src/`.
|
|
|
65
65
|
|---|---|---|
|
|
66
66
|
| Component reference | `reference/components/<dir>/COMPONENT.md` | `node_modules/prime-ui-kit/src/components/<dir>/COMPONENT.md` |
|
|
67
67
|
| Copyable scenarios | `reference/components/<dir>/examples/*.tsx` | `node_modules/prime-ui-kit/src/components/<dir>/examples/*.tsx` |
|
|
68
|
-
| AppShell, Sidebar,
|
|
68
|
+
| AppShell, Sidebar, BottomNav, Page | `reference/layout/<dir>/…` | `node_modules/prime-ui-kit/src/layout/<dir>/…` |
|
|
69
69
|
| Whole screens | `reference/<base>/<dir>/examples/screen.tsx` | `node_modules/prime-ui-kit/src/<base>/<dir>/examples/screen.tsx` |
|
|
70
70
|
|
|
71
71
|
## Files of this skill
|
|
@@ -81,7 +81,7 @@ project under `node_modules/prime-ui-kit/src/`.
|
|
|
81
81
|
| [foundations.md](foundations.md) | grid, proximity scale, sizes, surfaces, type, tone and color |
|
|
82
82
|
| [api-contract.md](api-contract.md) | writing JSX — prop names, sizes and host tiers, controlled state, forms, helpers, icons |
|
|
83
83
|
| [motion.md](motion.md) | every screen — loading / empty / error that flow, what the kit animates, when to move, recipes |
|
|
84
|
-
| [responsive.md](responsive.md) | every screen — 320px and up, the page
|
|
84
|
+
| [responsive.md](responsive.md) | every screen — 320px and up, the page's top bar (`Page.TopBar`), touch |
|
|
85
85
|
| [anti-slop.md](anti-slop.md) | before and after writing — what makes a screen look generated |
|
|
86
86
|
| [checklist.md](checklist.md) | before handing the screen over |
|
|
87
87
|
|
|
@@ -97,8 +97,8 @@ applyTheme("light"); // sets data-theme on <html>; "dark" for the dark theme
|
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
Wrap the app in `NotificationProvider` if it shows toasts. Styles, `applyTheme`, `NotificationProvider`
|
|
100
|
-
and `AppShell` belong to the app root, once. A screen component you deliver renders its page —
|
|
101
|
-
`
|
|
100
|
+
and `AppShell` belong to the app root, once. A screen component you deliver renders its page — one
|
|
101
|
+
`Page.Root` with its `Page.TopBar` and its `Page.Body` — and assumes the root exists. If the project has no app
|
|
102
102
|
frame yet, also deliver it as a separate root layout from
|
|
103
103
|
[layouts.md](layouts.md#app-frame-once-per-app) — never inline the frame into a page.
|
|
104
104
|
|
|
@@ -123,8 +123,8 @@ Take a semantic `<Icon name="…" />` first, else a glyph from the full animated
|
|
|
123
123
|
7. Labels above fields, always — once per column for records in rows (`FieldList`), never numbered
|
|
124
124
|
(«Пункт 1»), never repeating their heading. Placeholder is an example value, never the label.
|
|
125
125
|
8. Text through `Typography` roles (`title-m` section, `title-s` group, `body-m` text, `caption` meta;
|
|
126
|
-
the page title is `
|
|
127
|
-
document page). No custom font sizes.
|
|
126
|
+
the page title is `Page.Title`, one per page: in the `Page.Heading` of `Page.TopBar` on a work screen, in the flow
|
|
127
|
+
on a document page or an overview). No custom font sizes.
|
|
128
128
|
9. Overlays (Modal, ConfirmDialog, Drawer, Sheet, Popover, Dropdown, Tooltip, CommandMenu, Select,
|
|
129
129
|
MediaViewer) come from the kit — never hand-made — and stay mounted: drive them with `open`,
|
|
130
130
|
never `{open && …}`.
|
package/dist/skill/anti-slop.md
CHANGED
|
@@ -55,13 +55,13 @@ Text colour is not CSS: [foundations.md → Text colour](foundations.md#text-col
|
|
|
55
55
|
```tsx good
|
|
56
56
|
// good — DataTable already is a filled block; a titled section is enough
|
|
57
57
|
// declare: const payments: { id: string; client: string }[]
|
|
58
|
-
<
|
|
58
|
+
<Page.Section label="Последние оплаты">
|
|
59
59
|
<DataTable
|
|
60
60
|
columns={[{ id: "client", header: "Клиент", accessor: "client" }]}
|
|
61
61
|
rows={payments}
|
|
62
62
|
getRowKey={(row) => row.id}
|
|
63
63
|
/>
|
|
64
|
-
</
|
|
64
|
+
</Page.Section>
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
## 3a. Hover that merges with the neighbour
|
|
@@ -225,7 +225,7 @@ The same for one value in several units — one heading, the fields in a row, th
|
|
|
225
225
|
/* good — proximity scale */
|
|
226
226
|
.form { display: grid; gap: var(--prime-space-8); } /* group → group 32 */
|
|
227
227
|
.group { display: grid; gap: var(--prime-space-5); } /* field → field 20 */
|
|
228
|
-
/* block → block 24 and section → section 40 come from
|
|
228
|
+
/* block → block 24 and section → section 40 come from Page.Body / Page.Section */
|
|
229
229
|
```
|
|
230
230
|
|
|
231
231
|
## 7. `div` instead of a ready component
|
|
@@ -242,7 +242,7 @@ The same for one value in several units — one heading, the fields in a row, th
|
|
|
242
242
|
| `<Button.Root onClick={() => location.assign(url)}>` | `<Button.Root asChild><a href={url}>…</a></Button.Root>` or `LinkButton` |
|
|
243
243
|
| a hand-built spinner, shimmer, grey placeholder box or «Loading…» text | `loading` on Button / Select / DataTable; a region: `Skeleton` of its content inside `Crossfade`; no shape to hold: `Spinner` |
|
|
244
244
|
| `{loading ? <Spinner /> : <List />}` — a state that flips | `<Crossfade state={status}>` around the region, `Skeleton` while loading |
|
|
245
|
-
| a search Input + a row of filter Selects above a table | `SmartFilter` in the page's `
|
|
245
|
+
| a search Input + a row of filter Selects above a table | `SmartFilter` in the page's top bar: its toolbar in `Page.Tools`, its chips in `Page.Chips` ([where the filters go](composition.md#where-the-filters-go)) |
|
|
246
246
|
| a grid of «label: value» text pairs for one record | `DescriptionList.Root` + `DescriptionList.Item` |
|
|
247
247
|
| a Modal hand-built as «Удалить?» with your own pending flag | `ConfirmDialog.Root` with an async `onConfirm` |
|
|
248
248
|
| a `<fieldset>` reset by hand, or `disabled` on every field while saving | `<Fieldset label disabled={saving}>` |
|
|
@@ -251,10 +251,15 @@ The same for one value in several units — one heading, the fields in a row, th
|
|
|
251
251
|
| bars of dates drawn by hand, or a DataTable of start / end dates | `Gantt` |
|
|
252
252
|
| a hand-made `<span>` hidden with CSS for screen readers | `<VisuallyHidden>` |
|
|
253
253
|
| a `div` with `overflow: auto` | `ScrollContainer` (`edges`, `scrollbar="hidden"`, `snap`) |
|
|
254
|
+
| `scroll-snap-type` on a strip of cards | `ScrollContainer snap` (`"mandatory"` only where each child fills most of the view) |
|
|
255
|
+
| a flex row of Badges with its own gap | `Badge.Group` |
|
|
256
|
+
| a Switch or a ⋯ button inside a list row, or the row rebuilt as a `div` to hold them | `List.ItemActions` beside the row's element |
|
|
257
|
+
| a heading row (`Typography as="h3"` + buttons) over a group in a Drawer or a Modal | `Drawer.Section label` / `Modal.Section label` with `Drawer.Actions` / `Modal.Actions` |
|
|
258
|
+
| Markdown turned into HTML (`dangerouslySetInnerHTML`, a Markdown library) | `RichText` |
|
|
254
259
|
| an `<img>` with your own radius and loading box | `Thumbnail.Root` / `Avatar.Root` |
|
|
255
260
|
| a lightbox, or a Modal with an `<img>` | `Gallery` (opens `MediaViewer` itself) or `MediaViewer` |
|
|
256
261
|
| a `position: fixed` bottom tab bar | `BottomNav` in `AppShell.Footer` |
|
|
257
|
-
| a menu state and a menu button wired by hand to open the phone Sidebar | nothing: the `
|
|
262
|
+
| a menu state and a menu button wired by hand to open the phone Sidebar | nothing: the page's `Page.TopBar` draws the menu button; another trigger reads `useAppShellNav()` ([the app frame](layouts.md#app-frame-once-per-app)) |
|
|
258
263
|
| a bottom panel built from a Drawer or a `div` | `Sheet` |
|
|
259
264
|
|
|
260
265
|
## 7a. Fighting the table
|
|
@@ -287,6 +292,102 @@ The same for one value in several units — one heading, the fields in a row, th
|
|
|
287
292
|
/>
|
|
288
293
|
```
|
|
289
294
|
|
|
295
|
+
## 7b. A top bar out of its groups
|
|
296
|
+
|
|
297
|
+
The bar lays itself out only from its four groups ([the top bar](composition.md#the-top-bar)); a
|
|
298
|
+
bar assembled any other way cannot give way on a narrow panel.
|
|
299
|
+
|
|
300
|
+
The title as a row of its own under the path:
|
|
301
|
+
|
|
302
|
+
```tsx partial
|
|
303
|
+
// bad — the path, then the title on a second line; the path repeats the title
|
|
304
|
+
<Page.Heading>
|
|
305
|
+
<Breadcrumb.Root>
|
|
306
|
+
<Breadcrumb.Item href="/invoices">Счета</Breadcrumb.Item>
|
|
307
|
+
<Breadcrumb.Item current>Счёт № 1042</Breadcrumb.Item>
|
|
308
|
+
</Breadcrumb.Root>
|
|
309
|
+
</Page.Heading>
|
|
310
|
+
<Typography as="h1" variant="heading-m">Счёт № 1042</Typography>
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
```tsx good
|
|
314
|
+
// good — the path ends in the title: the levels above, then Page.Title, on one line
|
|
315
|
+
<Page.TopBar>
|
|
316
|
+
<Page.Heading>
|
|
317
|
+
<Breadcrumb.Root>
|
|
318
|
+
<Breadcrumb.Item href="/invoices">Счета</Breadcrumb.Item>
|
|
319
|
+
</Breadcrumb.Root>
|
|
320
|
+
<Page.Title>Счёт № 1042</Page.Title>
|
|
321
|
+
<Page.Description>Отправлен · оплатить до 14 октября</Page.Description>
|
|
322
|
+
</Page.Heading>
|
|
323
|
+
</Page.TopBar>
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
Buttons in two places, buttons with only text:
|
|
327
|
+
|
|
328
|
+
```tsx partial
|
|
329
|
+
// bad — export beside the title, the primary among the tools; no icons, so nothing can collapse
|
|
330
|
+
<Page.Heading>
|
|
331
|
+
<Page.Title>Заказы</Page.Title>
|
|
332
|
+
<Button.Root variant="soft" tone="neutral">Экспорт</Button.Root>
|
|
333
|
+
</Page.Heading>
|
|
334
|
+
<Page.Tools aria-label="Заказы">
|
|
335
|
+
<SmartFilter.Toolbar />
|
|
336
|
+
<Button.Root>Новый заказ</Button.Root>
|
|
337
|
+
</Page.Tools>
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
```tsx good
|
|
341
|
+
// good — every button in one Page.Actions, each with an icon, the primary last
|
|
342
|
+
<Page.Actions>
|
|
343
|
+
<Button.Root variant="soft" tone="neutral">
|
|
344
|
+
<Button.Icon>
|
|
345
|
+
<Icon name="action.download" />
|
|
346
|
+
</Button.Icon>
|
|
347
|
+
Экспорт
|
|
348
|
+
</Button.Root>
|
|
349
|
+
<Button.Root>
|
|
350
|
+
<Button.Icon>
|
|
351
|
+
<Icon name="action.add" />
|
|
352
|
+
</Button.Icon>
|
|
353
|
+
Новый заказ
|
|
354
|
+
</Button.Root>
|
|
355
|
+
</Page.Actions>
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
`SmartFilter.Root` inside the bar:
|
|
359
|
+
|
|
360
|
+
```tsx partial
|
|
361
|
+
// bad — the filter's state wraps one group, its chips land outside it
|
|
362
|
+
<Page.TopBar>
|
|
363
|
+
<SmartFilter.Root fields={FIELDS}>
|
|
364
|
+
<Page.Tools aria-label="Заказы">
|
|
365
|
+
<SmartFilter.Toolbar />
|
|
366
|
+
</Page.Tools>
|
|
367
|
+
</SmartFilter.Root>
|
|
368
|
+
</Page.TopBar>
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
```tsx good
|
|
372
|
+
// good — SmartFilter.Root draws nothing and wraps the page; toolbar and chips sit in their groups
|
|
373
|
+
// declare: const FIELDS: Parameters<typeof SmartFilter.Root>[0]["fields"]
|
|
374
|
+
<SmartFilter.Root fields={FIELDS}>
|
|
375
|
+
<Page.Root>
|
|
376
|
+
<Page.TopBar>
|
|
377
|
+
<Page.Heading>
|
|
378
|
+
<Page.Title>Заказы</Page.Title>
|
|
379
|
+
</Page.Heading>
|
|
380
|
+
<Page.Tools aria-label="Заказы">
|
|
381
|
+
<SmartFilter.Toolbar />
|
|
382
|
+
</Page.Tools>
|
|
383
|
+
<Page.Chips>
|
|
384
|
+
<SmartFilter.Chips />
|
|
385
|
+
</Page.Chips>
|
|
386
|
+
</Page.TopBar>
|
|
387
|
+
</Page.Root>
|
|
388
|
+
</SmartFilter.Root>
|
|
389
|
+
```
|
|
390
|
+
|
|
290
391
|
## 8. Decoration and filler
|
|
291
392
|
|
|
292
393
|
- No emoji in UI. No icon next to every label — an icon earns its place when it speeds recognition
|
|
@@ -25,14 +25,14 @@ import type { ControlSize, PaletteColor, TextTone, Tone, Variant } from "prime-u
|
|
|
25
25
|
| Text value | native `value` / `onChange` + `onValueChange(string)` | Input (`Input.Field`), Textarea. |
|
|
26
26
|
| Other state | `x` / `defaultX` / `onXChange(x)` | Badge `pressed`; Button `pressed`; ChartFrame `hiddenSeries`; Chat `selected`, `search`; ChatList `search`; ColorPicker `format`; CommandMenu `search`; Composer `recordMode`; DataTable `hiddenColumns`, `page`, `sort`, `selected`, `expanded`, `collapsedGroups`; ExampleFrame `viewport`, `colorScheme`; Gallery `index`; Gantt `scale`; Kanban `columnOrder`; MediaViewer `index`; Message.Media `index`; Select `search`; SmartFilter `search`; VideoNote `playing`, `transcriptExpanded`; VoicePlayer `rate`, `playing`, `transcriptExpanded`; Sidebar `mode`. |
|
|
27
27
|
| Checked | `checked` / `defaultChecked` / `onCheckedChange(checked)` | Checkbox, Dropdown.CheckboxItem, Switch, Thumbnail. |
|
|
28
|
-
| Open | `open` / `defaultOpen` / `onOpenChange(open)` | ColorPresets, CommandMenu, ConfirmDialog, Datepicker, Drawer, Dropdown, Gallery, MediaViewer, Message.Media, Modal,
|
|
29
|
-
| Dismiss | `closeOnOutsideClick` (default `true`), `closeOnEscape` (default `true`) | Both on every overlay that opens a layer: the dialogs, the floating panels, the panels of Select, TagSelect, Datepicker and ColorPresets, the off-canvas Sidebar and the reaction bar of a message. `ConfirmDialog` takes both with `closeOnOutsideClick` default `false` (Escape is held while `onConfirm` runs). Tooltip and Notification take neither. A form holds closing with `Modal.Guard` / `Drawer.Guard` / `Sheet.Guard`. |
|
|
28
|
+
| Open | `open` / `defaultOpen` / `onOpenChange(open)` | ColorPresets, CommandMenu, ConfirmDialog, Datepicker, Drawer, Dropdown, Gallery, MediaViewer, Message.Media, Modal, Popover, Select, Sheet, TagSelect, Tooltip, Page.Split, Sidebar, Sidebar.Group, Sidebar.Sub. |
|
|
29
|
+
| Dismiss | `closeOnOutsideClick` (default `true`), `closeOnEscape` (default `true`) | Both on every overlay that opens a layer: the dialogs, the floating panels, the panels of Select, TagSelect, Datepicker and ColorPresets, the `suggestions` list of Input, the off-canvas Sidebar and the reaction bar of a message. `ConfirmDialog` takes both with `closeOnOutsideClick` default `false` (Escape is held while `onConfirm` runs). Tooltip and Notification take neither. A form holds closing with `Modal.Guard` / `Drawer.Guard` / `Sheet.Guard`. |
|
|
30
30
|
| Selection mode | `multiple` | One vs many (Select, Accordion) — never `type`. `mode` only for structurally different values (Datepicker `single \| range`). |
|
|
31
31
|
| Status words | `selected`, `current`, `pressed` | `current` marks a navigation location (`Sidebar.Item`, `Breadcrumb.Item`) and sets `aria-current`; `pressed` a toggle button. |
|
|
32
32
|
| Flags | `disabled`, `readOnly`, `required`, `optional`, `loading`, `fullWidth` | Same names everywhere. |
|
|
33
33
|
| Focus ring | `focusRing` (default `true`) | Fields only; `false` only where focus is obvious otherwise. |
|
|
34
34
|
| System strings | `labels?: Partial<XLabels>` | aria labels, counters, default texts; Russian defaults; values as `{token}` templates. Visible content goes in children or props. |
|
|
35
|
-
| Structure | `X.Root` + `X.Part` | Only for components with parts. Leaves are single exports: `Typography`, `Kbd`, `Divider`, `Spinner`, `Skeleton`, `Crossfade`, `LinkButton`, `NativeSelect`, `DigitInput`, `Slider`, `TagSelect`, `ColorSwatches`, `CodeBlock`, `ProgressBar`, `ProgressCircle`, `Sparkline`, `Pagination`, `DataTable`, `Gantt`, `Fieldset`, `VisuallyHidden`, `ColorField`, `ExampleFrame`, `VoicePlayer`, `VideoNote`, `ScrollContainer`, `Gallery`, `MediaViewer`. This is the one list; other files link here. A group of roots is `X.Group` (`Radio.Group`, `Avatar.Group`). |
|
|
35
|
+
| Structure | `X.Root` + `X.Part` | Only for components with parts. Leaves are single exports: `Typography`, `Kbd`, `Divider`, `Spinner`, `Skeleton`, `Crossfade`, `LinkButton`, `NativeSelect`, `DigitInput`, `Slider`, `TagSelect`, `ColorSwatches`, `CodeBlock`, `ProgressBar`, `ProgressCircle`, `Sparkline`, `Pagination`, `DataTable`, `Gantt`, `Fieldset`, `VisuallyHidden`, `ColorField`, `ExampleFrame`, `VoicePlayer`, `VideoNote`, `ScrollContainer`, `Gallery`, `MediaViewer`, `RichText`. This is the one list; other files link here. A group of roots is `X.Group` (`Radio.Group`, `Avatar.Group`, `Badge.Group`). |
|
|
36
36
|
| Slots | `X.Trigger`, `X.Close`, `X.Confirm`, `X.Anchor` | Your own button inside, exactly one element child; the slot renders no element and takes no `className` — style the child. A trigger the kit draws itself (`Select.Trigger`, `Accordion.Trigger`) is a real part with `className`. |
|
|
37
37
|
| Icons in parts | `X.Icon`, `X.ItemIcon` | `Button.Icon`, `Input.Icon`, `Sidebar.ItemIcon`, `Dropdown.ItemIcon`… — never an `icon` prop on a component. Only data arrays (`notify()`, `options`) carry `icon: ReactNode`. |
|
|
38
38
|
| DOM state | `data-size`, `data-variant`, `data-tone`, `data-color`, `data-invalid`, `data-disabled`, `data-loading`, `data-state` | Style your wrappers from these, not from class names of kit internals. |
|
|
@@ -85,7 +85,7 @@ export function PeriodFilter() {
|
|
|
85
85
|
resolving. The async events: Input / Textarea `onCommit`, ConfirmDialog `onConfirm`,
|
|
86
86
|
`EmptyPage.RetryButton` and CommandMenu `onRetry`, Button `onConfirm` (`holdToConfirm`), Slider
|
|
87
87
|
`onCommit`, DigitInput `onComplete`, Tabs `onRemove`, Switch `onCheckedChange`, Badge `onRemove`,
|
|
88
|
-
FileUpload `onValueChange`, TagSelect `onCreate` / `onOptionUpdate` / `onOptionDelete`, DataTable
|
|
88
|
+
FileUpload and FieldList `onValueChange`, TagSelect `onCreate` / `onOptionUpdate` / `onOptionDelete`, DataTable
|
|
89
89
|
and Dnd `onReorder`, Kanban `onValueChange` / `onColumnOrderChange`, Gantt `onBarChange` /
|
|
90
90
|
`onBarCreate`, Composer `onSend` / `onSendVoice` / `onSendVideoNote`, `Message.Root`
|
|
91
91
|
`onReactionToggle` and `onRetry`, the `onRetry` / `onCancel` of `Message.File`, the
|
|
@@ -118,8 +118,11 @@ export function PeriodFilter() {
|
|
|
118
118
|
- Checkbox, Switch and Radio: [choice controls](#choice-controls) below.
|
|
119
119
|
- `required` → red `*` after the label + native `required`. `optional` → muted «необязательно».
|
|
120
120
|
- Placeholder is an example (`name@company.ru`), never the label.
|
|
121
|
-
-
|
|
122
|
-
|
|
121
|
+
- `hintTone` (`success` · `warning` · `danger`) colors the `hint` of a field by the status of its
|
|
122
|
+
value («Осталось 12 дней» in `warning`); a lone `Hint.Root` takes `tone`. The words carry the
|
|
123
|
+
status and the color only repeats it; a validation problem is `error`, which replaces the hint.
|
|
124
|
+
- `Input.Affix` and `Input.InlineAffix` describe the input for screen readers (`aria-describedby`),
|
|
125
|
+
so the label never repeats a unit or a prefix ([a unit lives in one place](ux.md#3-label-economy)).
|
|
123
126
|
- Mark the minority: when most fields are required, mark only the optional ones (`optional`); when most
|
|
124
127
|
are optional, mark the required ones; on a tie mark the required ones. Validate in code either way.
|
|
125
128
|
- Show `error` after the user leaves the field or on submit, not while typing the first character.
|
|
@@ -249,7 +252,8 @@ place (a `Banner` for the page; for a region `EmptyPage tone="danger"` — it an
|
|
|
249
252
|
фильтры»), and the same action keeps the same variant in the header, toolbars and menus. If «Отмена»
|
|
250
253
|
would clash with the action itself («Отменить заказ»), use an unambiguous label («Не отменять»).
|
|
251
254
|
- A control that navigates is a link: `LinkButton href`, `Button.Root asChild` with `<a>` / router
|
|
252
|
-
`Link`, `Sidebar.Item href` or `asChild`. Never
|
|
255
|
+
`Link`, `Sidebar.Item` / `Breadcrumb.Item` / `List.Item` / `ChatList.Item` `href` or `asChild`. Never
|
|
256
|
+
`onClick={() => location.assign(…)}`.
|
|
253
257
|
|
|
254
258
|
## Destructive actions
|
|
255
259
|
|
|
@@ -291,7 +295,10 @@ export function DeleteProject({ onDelete }: { onDelete: () => Promise<void> }) {
|
|
|
291
295
|
|
|
292
296
|
Leaving a form with unsaved changes is the same contract: `Modal.Guard` / `Drawer.Guard` inside the
|
|
293
297
|
content with `dirty` (any dismiss asks «Не сохранять изменения?») and `busy` (nothing closes it while
|
|
294
|
-
it saves).
|
|
298
|
+
it saves). A form that is the whole page takes `Page.Guard` (`dirty`, `busy`) inside the page: it
|
|
299
|
+
holds a press on `Sidebar.Item`, `BottomNav.Item` and `Breadcrumb.Item` links — router links
|
|
300
|
+
included — and the browser's own close or reload; never a `beforeunload` or a ConfirmDialog on a
|
|
301
|
+
crumb of your own.
|
|
295
302
|
|
|
296
303
|
## Providers and helpers
|
|
297
304
|
|