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
package/dist/skill/ux.md
CHANGED
|
@@ -55,8 +55,10 @@ Every word on screen must carry something the person does not see already.
|
|
|
55
55
|
list already counts. The list label names the rows.
|
|
56
56
|
- **No label that repeats its heading.** A field «Цена» inside the section «Цена» needs no label of
|
|
57
57
|
its own beyond what the section says; a group of one field is the field.
|
|
58
|
-
- **A unit lives in one place.** In the field (`Input.InlineAffix`) or in the heading, never both
|
|
59
|
-
|
|
58
|
+
- **A unit lives in one place.** In the field (`Input.InlineAffix`) or in the heading, never both;
|
|
59
|
+
never in the field's own label («Бюджет», not «Бюджет, ₽»). Prefer the field: the unit stays
|
|
60
|
+
beside the number when the row stacks, and a screen reader hears it with the field (the affix
|
|
61
|
+
describes the input; `aria-label="рублей"` on it when the sign reads badly).
|
|
60
62
|
- **No text that explains the layout.** «Двигатель, места и скорость всегда первыми» — the lock on
|
|
61
63
|
those rows says it. A hint says what the person cannot see (a format, a consequence, a limit).
|
|
62
64
|
- **One name per thing.** The same action, entity and status keep one word on the whole screen
|
|
@@ -97,7 +99,7 @@ Pick the lightest step that keeps the person safe ([choosing.md](choosing.md) ha
|
|
|
97
99
|
| One standalone action that is easy to redo by hand | `Button.Root holdToConfirm` |
|
|
98
100
|
| Irreversible loss of work, or an outward action that cannot be called back once it leaves the product (an invoice or a message sent to a client, a payment) | `ConfirmDialog` that names the thing and the consequence |
|
|
99
101
|
| Bulk destructive | `ConfirmDialog` that names the count («Удалить 12 счетов?») |
|
|
100
|
-
| Leaving a form with changes | `Modal.Guard` / `Drawer.Guard dirty` |
|
|
102
|
+
| Leaving a form with changes | `Modal.Guard` / `Drawer.Guard dirty`; a form that is the page — `Page.Guard dirty` |
|
|
101
103
|
|
|
102
104
|
A confirm on every action trains people to click through it; the one that mattered is then missed.
|
|
103
105
|
Which button starts each step and how the confirm behaves:
|
package/dist/tokens/layers.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ type LayerTheme = {
|
|
|
6
6
|
hi: number;
|
|
7
7
|
/** Direction of control fills from their host: −1 darker, +1 lighter. */
|
|
8
8
|
control: 1 | -1;
|
|
9
|
+
/** Steps from a track up to its selected segment (thumb). */
|
|
10
|
+
selected: number;
|
|
9
11
|
};
|
|
10
12
|
export declare const LIGHT_LAYERS: LayerTheme;
|
|
11
13
|
export declare const DARK_LAYERS: LayerTheme;
|
|
@@ -15,6 +15,8 @@ export declare const primitiveTokens: {
|
|
|
15
15
|
readonly 100: "#e8eaee";
|
|
16
16
|
readonly 150: "#e0e3e8";
|
|
17
17
|
readonly 300: "#b9bec8";
|
|
18
|
+
/** Dark muted text: AA on the hovered fill of the deepest layer. */
|
|
19
|
+
readonly 350: "#a1a8b6";
|
|
18
20
|
readonly 400: "#949bab";
|
|
19
21
|
readonly 500: "#636a79";
|
|
20
22
|
readonly 600: "#575e6d";
|
|
@@ -131,9 +133,12 @@ export declare const primitiveTokens: {
|
|
|
131
133
|
readonly 700: "#be185d";
|
|
132
134
|
};
|
|
133
135
|
};
|
|
134
|
-
/**
|
|
136
|
+
/**
|
|
137
|
+
* 4px grid. Key = number of 4px steps (`4` → 16px). `0` carries a unit: a unitless `0` is a
|
|
138
|
+
* number inside `calc()` / `max()`, and `calc(100% + 0)` is invalid (the declaration drops).
|
|
139
|
+
*/
|
|
135
140
|
readonly space: {
|
|
136
|
-
readonly 0: "
|
|
141
|
+
readonly 0: "0rem";
|
|
137
142
|
readonly 1: "0.25rem";
|
|
138
143
|
readonly 2: "0.5rem";
|
|
139
144
|
readonly 3: "0.75rem";
|
|
@@ -165,6 +170,11 @@ export declare const primitiveTokens: {
|
|
|
165
170
|
/** `… Fallback`: the metric-matched local faces of the opt-in `fonts.css`. */
|
|
166
171
|
readonly sans: "\"Golos Text\", \"Golos Text Fallback\", ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif";
|
|
167
172
|
readonly mono: "\"JetBrains Mono\", \"JetBrains Mono Fallback\", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
|
|
173
|
+
/**
|
|
174
|
+
* Key caps: the mono faces for letters and digits, then the system UI face before the mono
|
|
175
|
+
* fallbacks — the mono faces have no ⇧ ⌥ ⌃ or ⌘, and Menlo draws them small and light.
|
|
176
|
+
*/
|
|
177
|
+
readonly key: "\"JetBrains Mono\", \"JetBrains Mono Fallback\", ui-monospace, SFMono-Regular, system-ui, -apple-system, \"Segoe UI Symbol\", Menlo, Consolas, monospace";
|
|
168
178
|
};
|
|
169
179
|
/** Modular scale, ~1.2 in the body range, ~1.25 for headings. */
|
|
170
180
|
readonly size: {
|
|
@@ -142,6 +142,12 @@ export declare const semanticTokens: {
|
|
|
142
142
|
readonly control: {
|
|
143
143
|
/** Switch thumb, slider thumb. */
|
|
144
144
|
readonly thumb: "{color.white}";
|
|
145
|
+
/** A disabled switch thumb: quiet on the disabled track, like the rest of the control. */
|
|
146
|
+
readonly thumbDisabled: "{color.white}";
|
|
147
|
+
};
|
|
148
|
+
readonly skeleton: {
|
|
149
|
+
/** A loading placeholder: a wash over whatever layer it sits on, readable in both themes. */
|
|
150
|
+
readonly fill: "color-mix(in srgb, {color.gray.925} 6%, transparent)";
|
|
145
151
|
};
|
|
146
152
|
/**
|
|
147
153
|
* The tooltip is an inverse chip: everything inside it (a Kbd, a secondary line) reads its
|
|
@@ -224,6 +230,7 @@ export declare const semanticTokens: {
|
|
|
224
230
|
readonly family: {
|
|
225
231
|
readonly sans: "{font.family.sans}";
|
|
226
232
|
readonly mono: "{font.family.mono}";
|
|
233
|
+
readonly key: "{font.family.key}";
|
|
227
234
|
};
|
|
228
235
|
readonly weight: {
|
|
229
236
|
readonly regular: "{font.weight.regular}";
|
|
@@ -794,6 +801,8 @@ export declare const semanticTokens: {
|
|
|
794
801
|
readonly videoNote: "14.5rem";
|
|
795
802
|
/** The box of a sent round video message (`VideoNote`): its diameter, at most the row. */
|
|
796
803
|
readonly videoNoteBox: "16.75rem";
|
|
804
|
+
/** The square box of a sticker (`Message.Sticker`), at most the row. */
|
|
805
|
+
readonly sticker: "10rem";
|
|
797
806
|
/**
|
|
798
807
|
* A message changing size (a reaction row, a transcript that opens): the bubble's box, its
|
|
799
808
|
* parts and the messages around glide in one calm stroke, between `fast` and `base`; zeroed
|
|
@@ -25,8 +25,9 @@ export declare const darkThemeOverrides: {
|
|
|
25
25
|
readonly text: {
|
|
26
26
|
readonly primary: "{color.gray.100}";
|
|
27
27
|
readonly secondary: "{color.gray.300}";
|
|
28
|
-
|
|
29
|
-
readonly
|
|
28
|
+
/** gray.350: AA on every layer, its fill and the fill's hover (a hovered field, row, chip). */
|
|
29
|
+
readonly muted: "{color.gray.350}";
|
|
30
|
+
readonly placeholder: "{color.gray.350}";
|
|
30
31
|
readonly disabled: "{color.gray.600}";
|
|
31
32
|
readonly inverse: "{color.gray.925}";
|
|
32
33
|
};
|
|
@@ -80,6 +81,10 @@ export declare const darkThemeOverrides: {
|
|
|
80
81
|
};
|
|
81
82
|
readonly control: {
|
|
82
83
|
readonly thumb: "{color.gray.100}";
|
|
84
|
+
readonly thumbDisabled: "{color.gray.600}";
|
|
85
|
+
};
|
|
86
|
+
readonly skeleton: {
|
|
87
|
+
readonly fill: "color-mix(in srgb, {color.gray.100} 10%, transparent)";
|
|
83
88
|
};
|
|
84
89
|
/** A light chip over the dark UI: inverse like in light, so it reads over any layer. */
|
|
85
90
|
readonly tooltip: {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prime-ui-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"packageManager": "bun@1.3.13",
|
|
5
|
-
"description": "React 19 UI kit for product interfaces:
|
|
5
|
+
"description": "React 19 UI kit for product interfaces: 79 composable components on one design contract — forms, selects, tables, overlays, navigation, app shell. CSS Modules, --prime-* tokens, light and dark themes, TypeScript, a11y, Next.js App Router ready. Ships COMPONENT.md docs, copyable examples and an agent skill.",
|
|
6
6
|
"bin": {
|
|
7
7
|
"prime-ui-kit": "bin/prime-ui-kit.js"
|
|
8
8
|
},
|
|
@@ -72,7 +72,7 @@ Avatar.Group overlapping row, gives its size to members
|
|
|
72
72
|
| `…rest` | `Omit<HTMLAttributes<HTMLSpanElement>, "children">` | — | `className` and the other span attributes. |
|
|
73
73
|
|
|
74
74
|
### Avatar.Group
|
|
75
|
-
`ref` → `HTMLDivElement`. An overlapping row (`role="group"`); members overlap by
|
|
75
|
+
`ref` → `HTMLDivElement`. An overlapping row (`role="group"`); members overlap by an eighth of the diameter with a ring in `--avatar-ring`.
|
|
76
76
|
|
|
77
77
|
| Prop | Type | Default | Description |
|
|
78
78
|
|---|---|---|---|
|
|
@@ -119,7 +119,7 @@ The soft fill is opaque: the soft hue is composited over the ground the avatar s
|
|
|
119
119
|
## Layout & spacing
|
|
120
120
|
- Inline-flex, never shrinks, `vertical-align: middle`.
|
|
121
121
|
- Avatar → name: space step 3 (12px) in lists and cards, step 2 (8px) in table cells.
|
|
122
|
-
- Group: members overlap by
|
|
122
|
+
- Group: members overlap by an eighth of the diameter (initials are never cut) with a 2px ring in the ground they stand on: the current layer of the surface around them (no surface sets anything), or `--avatar-ring` from a host whose ground is not a layer (a reaction chip sets its own fill); the fills of initials and «+N» are composited over the same ground.
|
|
123
123
|
- An icon fallback is half the diameter: a kit `Icon` reads `--prime-icon-size`, a raw svg too.
|
|
124
124
|
|
|
125
125
|
## Accessibility
|
|
@@ -28,7 +28,7 @@ const MEMBERS: { name: string; initials: string; color: PaletteColor; src?: stri
|
|
|
28
28
|
|
|
29
29
|
export default function AvatarTeamGroupExample() {
|
|
30
30
|
return (
|
|
31
|
-
<Avatar.Group size="
|
|
31
|
+
<Avatar.Group size="l" aria-label="Участники проекта: 7">
|
|
32
32
|
{MEMBERS.map((member) => (
|
|
33
33
|
<Avatar.Root key={member.initials} color={member.color} aria-label={member.name}>
|
|
34
34
|
{member.src ? <Avatar.Image src={member.src} /> : null}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
- A selected value, keyword or applied filter the user can remove (`onRemove`).
|
|
13
13
|
- Values in a filter panel that toggle on press and hide with a hover action (the `pressed` triad, `Badge.Action`).
|
|
14
14
|
- A short code as a square tile (a file format «PDF») — `shape="square"`.
|
|
15
|
+
- Several badges as one value (the tags of a client, a record's labels) — `Badge.Group`: it wraps and keeps one gap.
|
|
15
16
|
|
|
16
17
|
## When not to use
|
|
17
18
|
- A multi-select field with chips → use [TagSelect](../tag-select/COMPONENT.md) (it renders badges itself).
|
|
@@ -33,6 +34,8 @@ Badge.Root <span>: fill, tier dimensions
|
|
|
33
34
|
│ (a toggle <button> with the pressed triad; a <span> with a trailing segment; none when read-only)
|
|
34
35
|
├─ Badge.Action optional end segment revealed on hover / focus (always shown on touch screens)
|
|
35
36
|
└─ remove segment with onRemove: full height, the whole end is the hit area (Icon action.close)
|
|
37
|
+
|
|
38
|
+
Badge.Group <div>: a wrapping row of Badge.Root, one value; `size` sets every badge's tier
|
|
36
39
|
```
|
|
37
40
|
|
|
38
41
|
## API
|
|
@@ -60,6 +63,14 @@ Badge.Root <span>: fill, tier dimensions
|
|
|
60
63
|
| `children` | `ReactNode` | — | Text, `Badge.Dot`, `Badge.Icon`, one `Badge.Action`. Only `Badge.Icon` children (no remove or action) make a square icon-only badge. |
|
|
61
64
|
| `…rest` | `Omit<HTMLAttributes<HTMLSpanElement>, "onClick" \| "color">` | — | `aria-label` (an icon-only badge named by it is an image) and the other span attributes; no `onClick` — a pressable chip is the toggle. |
|
|
62
65
|
|
|
66
|
+
### Badge.Group
|
|
67
|
+
`ref` → `HTMLDivElement`. A row of badges as one value (the tags of a record): it wraps onto more lines, the badges a chip gap apart.
|
|
68
|
+
|
|
69
|
+
| Prop | Type | Default | Description |
|
|
70
|
+
|---|---|---|---|
|
|
71
|
+
| `size` | `"xs" \| "s" \| "m" \| "l" \| "xl"` | the host tier, one step down | Tier of every badge in the group; a badge's own `size` wins. Small tiers stand closer. |
|
|
72
|
+
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children` (the `Badge.Root`s), `className`, `aria-label` (a named group is `role="group"`) and the other div attributes. |
|
|
73
|
+
|
|
63
74
|
### Badge.Icon
|
|
64
75
|
`ref` → `HTMLSpanElement`. A `<span>` holding one icon at the tier icon size. At the first or last position it becomes a full-height edge segment.
|
|
65
76
|
|
|
@@ -163,7 +174,7 @@ A status takes `tone`; a category takes `color`. The two never go together (the
|
|
|
163
174
|
- `Badge.Dot` is 6px, 8px from `l`; alone it takes the tier of the surrounding control; `color` paints it in the solid step of that hue.
|
|
164
175
|
- The root never clips: the text ellipsizes in its own box, so the segments' touch areas reach past the chip.
|
|
165
176
|
- `Badge.Action` room is reserved, so revealing it never changes the badge width.
|
|
166
|
-
- Several badges in a row: `
|
|
177
|
+
- Several badges in a row: `Badge.Group` — it wraps, badges 8 apart (4 at the `xs` and `s` tiers).
|
|
167
178
|
- In a list row the badge is the trailing column; the title column gets `min-width: 0` and an ellipsis.
|
|
168
179
|
|
|
169
180
|
## Accessibility
|
|
@@ -206,6 +217,7 @@ A status takes `tone`; a category takes `color`. The two never go together (the
|
|
|
206
217
|
| [server-tags.tsx](examples/server-tags.tsx) | Order tags removed on the server: a badge waits dimmed with a spinner, leaves once the server agrees and stays with an announcement when it refuses — `onRemove`, `labels`. |
|
|
207
218
|
| [filter-values.tsx](examples/filter-values.tsx) | Filter values as toggles with a hide action that slides in without changing the width — `pressed`, `onPressedChange`, `Badge.Action`, `persistent`. |
|
|
208
219
|
| [square.tsx](examples/square.tsx) | File formats as square tiles of text, large enough for three letters; the hue sorts them by kind — `shape`, `size`, `color`. |
|
|
220
|
+
| [tag-row.tsx](examples/tag-row.tsx) | The tags of a client as one value: the row wraps in a narrow column and keeps one gap between badges — `Badge.Group`, `size`. |
|
|
209
221
|
| [controlled.tsx](examples/controlled.tsx) | Delivery cities as toggle chips whose state the screen owns: the summary counts the chosen ones — `pressed`, `onPressedChange`. |
|
|
210
222
|
|
|
211
223
|
## Mistakes
|
|
@@ -217,6 +229,7 @@ A status takes `tone`; a category takes `color`. The two never go together (the
|
|
|
217
229
|
- Several removable badges with the default «Удалить» → pass `labels.remove` with the badge text.
|
|
218
230
|
- A colored badge with no text → keep a word; color alone is not a signal.
|
|
219
231
|
- An explicit `size` inside a control → drop it; the badge takes the tier one step down.
|
|
232
|
+
- A row of badges in a hand-made flex wrapper with its own gap → `Badge.Group`.
|
|
220
233
|
- `onRemove` together with `Badge.Action` → one end segment per badge.
|
|
221
234
|
- Removing the badge from your list first and putting it back when the request fails → return the request's promise and remove it after it succeeds; the badge waits meanwhile.
|
|
222
235
|
|
|
@@ -23,3 +23,10 @@
|
|
|
23
23
|
align-items: center;
|
|
24
24
|
gap: var(--prime-space-2);
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
/* tag-row.tsx: a 320 px column, narrow enough for the row of badges to wrap. */
|
|
28
|
+
.column {
|
|
29
|
+
display: grid;
|
|
30
|
+
gap: var(--prime-space-6);
|
|
31
|
+
inline-size: min(100%, calc(var(--prime-space-20) * 4));
|
|
32
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** The tags of a client as one value: the row wraps in a narrow column and keeps one gap between badges — `Badge.Group`, `size`. */
|
|
2
|
+
import { Badge } from "prime-ui-kit";
|
|
3
|
+
|
|
4
|
+
import styles from "./examples.module.css";
|
|
5
|
+
|
|
6
|
+
const TAGS = [
|
|
7
|
+
{ label: "Ключевой клиент", color: "purple" },
|
|
8
|
+
{ label: "Оптовые закупки", color: "blue" },
|
|
9
|
+
{ label: "Отсрочка 30 дней", color: "orange" },
|
|
10
|
+
{ label: "ЭДО", color: "teal" },
|
|
11
|
+
{ label: "Москва", color: "gray" },
|
|
12
|
+
{ label: "Новый договор", color: "green" },
|
|
13
|
+
] as const;
|
|
14
|
+
|
|
15
|
+
export default function BadgeTagRowExample() {
|
|
16
|
+
return (
|
|
17
|
+
<div className={styles.column}>
|
|
18
|
+
<Badge.Group aria-label="Теги клиента">
|
|
19
|
+
{TAGS.map((tag) => (
|
|
20
|
+
<Badge.Root key={tag.label} color={tag.color}>
|
|
21
|
+
{tag.label}
|
|
22
|
+
</Badge.Root>
|
|
23
|
+
))}
|
|
24
|
+
</Badge.Group>
|
|
25
|
+
<Badge.Group size="s" aria-label="Теги заказа">
|
|
26
|
+
{TAGS.slice(0, 4).map((tag) => (
|
|
27
|
+
<Badge.Root key={tag.label} color={tag.color}>
|
|
28
|
+
{tag.label}
|
|
29
|
+
</Badge.Root>
|
|
30
|
+
))}
|
|
31
|
+
</Badge.Group>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -29,8 +29,8 @@ Banner.Root <div>; variant, tone, size, placement
|
|
|
29
29
|
│ ├─ Banner.Icon one Icon on the first line (aria-hidden)
|
|
30
30
|
│ ├─ Banner.Title
|
|
31
31
|
│ ├─ Banner.Description
|
|
32
|
-
│ └─ Banner.Actions buttons; with onDismiss the close button is last here
|
|
33
|
-
└─ close button with onDismiss and no Actions: ghost icon Button (tone="inherit"), top-right
|
|
32
|
+
│ └─ Banner.Actions buttons; with onDismiss the close button is last here (wide banner)
|
|
33
|
+
└─ close button with onDismiss and no Actions, or Actions under the text: ghost icon Button (tone="inherit"), top-right
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
## API
|
|
@@ -72,7 +72,7 @@ Banner.Root <div>; variant, tone, size, placement
|
|
|
72
72
|
| `…rest` | `HTMLAttributes<HTMLSpanElement>` | — | `children`, `className` and the other span attributes. |
|
|
73
73
|
|
|
74
74
|
### Banner.Actions
|
|
75
|
-
`ref` → `HTMLDivElement`. A `<div>` row of buttons; with `onDismiss` the close button becomes its last square button.
|
|
75
|
+
`ref` → `HTMLDivElement`. A `<div>` row of buttons; with `onDismiss` the close button becomes its last square button (in the corner below 36rem).
|
|
76
76
|
|
|
77
77
|
| Prop | Type | Default | Description |
|
|
78
78
|
|---|---|---|---|
|
|
@@ -115,7 +115,7 @@ Banner.Root <div>; variant, tone, size, placement
|
|
|
115
115
|
|---|---|---|
|
|
116
116
|
| look | `variant`, `tone`, `size`, `placement` | `data-variant`, `data-tone`, `data-size`, `data-placement` |
|
|
117
117
|
| dismissible | `onDismiss` | corner ghost Button (`xs`, `s` on `l` / `xl`), or the last outline Button in `Banner.Actions` |
|
|
118
|
-
| narrow | own width < 36rem (a banner with `Banner.Actions` is a size container) | actions move under the text |
|
|
118
|
+
| narrow | own width < 36rem (a banner with `Banner.Actions` is a size container) | actions move under the text; the close button returns to the corner |
|
|
119
119
|
|
|
120
120
|
No `open` prop: the parent mounts and unmounts the banner. A mounted banner enters (a short fade and rise); an unmounted one closes up in place, so the content below glides up instead of jumping. To swap the banner for another block in the same spot (a «restore» button), wrap both in [Crossfade](../crossfade/COMPONENT.md).
|
|
121
121
|
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
min-width: 0;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
/* page-strip.tsx:
|
|
11
|
+
/* page-strip.tsx: a page — the strip spans its whole width, the content below keeps the page's
|
|
12
|
+
side padding, so the strip reads wider than the card with the inset banner. */
|
|
12
13
|
.sections {
|
|
13
14
|
display: flex;
|
|
14
15
|
flex-direction: column;
|
|
@@ -17,6 +18,10 @@
|
|
|
17
18
|
min-width: 0;
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
.pageBody {
|
|
22
|
+
padding-inline: var(--prime-layout-gutter);
|
|
23
|
+
}
|
|
24
|
+
|
|
20
25
|
/* narrow.tsx: a 320px column; the banner's container query moves actions under the text. */
|
|
21
26
|
.narrow {
|
|
22
27
|
width: min(100%, calc(var(--prime-space-20) * 4));
|
|
@@ -6,7 +6,7 @@ import styles from "./examples.module.css";
|
|
|
6
6
|
export default function BannerPageStripExample() {
|
|
7
7
|
return (
|
|
8
8
|
<div className={styles.sections}>
|
|
9
|
-
{/* In an app the strip stands first in the page, edge to edge above its content. */}
|
|
9
|
+
{/* In an app the strip stands first in the page, edge to edge above its padded content. */}
|
|
10
10
|
<Banner.Root
|
|
11
11
|
tone="warning"
|
|
12
12
|
placement="page"
|
|
@@ -21,27 +21,29 @@ export default function BannerPageStripExample() {
|
|
|
21
21
|
<Banner.Title>Пробный период закончится 12 октября</Banner.Title>
|
|
22
22
|
</Banner.Content>
|
|
23
23
|
</Banner.Root>
|
|
24
|
-
<
|
|
25
|
-
<Card.
|
|
26
|
-
<Card.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
<Banner.
|
|
31
|
-
<Banner.
|
|
32
|
-
<Icon
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
24
|
+
<div className={styles.pageBody}>
|
|
25
|
+
<Card.Root variant="panel">
|
|
26
|
+
<Card.Header>
|
|
27
|
+
<Card.Title>Оплата</Card.Title>
|
|
28
|
+
</Card.Header>
|
|
29
|
+
<Card.Body>
|
|
30
|
+
<Banner.Root tone="danger">
|
|
31
|
+
<Banner.Content>
|
|
32
|
+
<Banner.Icon>
|
|
33
|
+
<Icon name="status.danger" />
|
|
34
|
+
</Banner.Icon>
|
|
35
|
+
<Banner.Title>Не удалось списать оплату</Banner.Title>
|
|
36
|
+
<Banner.Description>
|
|
37
|
+
Карта •••• 4242 отклонена банком. Обновите способ оплаты до 15 октября.
|
|
38
|
+
</Banner.Description>
|
|
39
|
+
<Banner.Actions>
|
|
40
|
+
<Button.Root tone="danger">Обновить карту</Button.Root>
|
|
41
|
+
</Banner.Actions>
|
|
42
|
+
</Banner.Content>
|
|
43
|
+
</Banner.Root>
|
|
44
|
+
</Card.Body>
|
|
45
|
+
</Card.Root>
|
|
46
|
+
</div>
|
|
45
47
|
</div>
|
|
46
48
|
);
|
|
47
49
|
}
|
|
@@ -23,7 +23,7 @@ import { Breadcrumb } from "prime-ui-kit";
|
|
|
23
23
|
## Anatomy
|
|
24
24
|
```
|
|
25
25
|
Breadcrumb.Root <nav aria-label> + <ol>; size; chevrons between levels; auto-collapse into a «…» menu
|
|
26
|
-
├─ Breadcrumb.Item <li>: a link (href → LinkButton), text, or the current page (current)
|
|
26
|
+
├─ Breadcrumb.Item <li>: a link (href → LinkButton, or a router link with asChild), text, or the current page (current)
|
|
27
27
|
└─ Breadcrumb.Ellipsis <li> with «…» for levels skipped on purpose
|
|
28
28
|
```
|
|
29
29
|
|
|
@@ -32,7 +32,7 @@ Breadcrumb.Root <nav aria-label> + <ol>; size; chevrons between levels
|
|
|
32
32
|
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
33
33
|
|
|
34
34
|
### Breadcrumb.Root
|
|
35
|
-
`ref` → `HTMLElement` (the `<nav>`). `<nav aria-label>` with an `<ol>`; draws the chevrons between levels, sets the size and
|
|
35
|
+
`ref` → `HTMLElement` (the `<nav>`). `<nav aria-label>` with an `<ol>`; draws the chevrons between levels, sets the size and folds levels that do not fit into a «…» menu button that lists them: the middle ones, then the first one too.
|
|
36
36
|
|
|
37
37
|
| Prop | Type | Default | Description |
|
|
38
38
|
|---|---|---|---|
|
|
@@ -42,14 +42,15 @@ Breadcrumb.Root <nav aria-label> + <ol>; size; chevrons between levels
|
|
|
42
42
|
| `…rest` | `HTMLAttributes<HTMLElement>` | — | `className` and the other `nav` attributes; an `aria-label` here overrides `labels.nav`. |
|
|
43
43
|
|
|
44
44
|
### Breadcrumb.Item
|
|
45
|
-
`ref` → `HTMLLIElement`. `<li>`: a muted `LinkButton` (`href`), plain text, or the current page (`current`).
|
|
45
|
+
`ref` → `HTMLLIElement`. `<li>`: a muted `LinkButton` (`href`, or the consumer's router link with `asChild`), plain text, or the current page (`current`). A press on the link goes through `Page.Guard`.
|
|
46
46
|
|
|
47
47
|
| Prop | Type | Default | Description |
|
|
48
48
|
|---|---|---|---|
|
|
49
|
-
| `href` | `string` | — | Renders a link; without it the item is text. |
|
|
49
|
+
| `href` | `string` | — | Renders a link; without it (and without `asChild`) the item is text. |
|
|
50
|
+
| `asChild` | `boolean` | `false` | The single child (a router `Link`) is the level's link with the same look; its own text is the level. In the «…» menu of a folded path it is the menu item. |
|
|
50
51
|
| `current` | `boolean` | — | Current page: `aria-current="page"` (on the link when `href` is set), primary text, medium weight. Usually the last item, without `href`. |
|
|
51
52
|
| `aria-label` | `string` | — | Name of a link without visible text (e.g. a home icon); set on the link, not the `li`. |
|
|
52
|
-
| `children` | `ReactNode` | — | Text or an `Icon
|
|
53
|
+
| `children` | `ReactNode` | — | Text or an `Icon`; with `asChild` one element. A string also becomes the `title` of a text item (full text when truncated). |
|
|
53
54
|
| `…rest` | `Omit<LiHTMLAttributes<HTMLLIElement>, "aria-label">` | — | `className` and the other `li` attributes. |
|
|
54
55
|
|
|
55
56
|
### Breadcrumb.Ellipsis
|
|
@@ -77,6 +78,7 @@ Breadcrumb.Root <nav aria-label> + <ol>; size; chevrons between levels
|
|
|
77
78
|
| text (no `href`, no `current`) | muted text | a level without its own page | yes |
|
|
78
79
|
| current (`current`) | primary text, medium weight | the last item — this page | |
|
|
79
80
|
| icon link (`href` + `aria-label`, `Icon` child) | icon at the tier icon size | a «home» root | |
|
|
81
|
+
| router link (`asChild`, one `Link` child) | the same muted link, the consumer's element | an app with a client router: the path moves without a reload | |
|
|
80
82
|
|
|
81
83
|
Use links for every ancestor and `current` on the last item; `s` above a `heading-m` page title. Avoid `href` on the current item and two `current` items.
|
|
82
84
|
|
|
@@ -85,15 +87,17 @@ Use links for every ancestor and `current` on the last item; `s` above a `headin
|
|
|
85
87
|
|---|---|---|
|
|
86
88
|
| current | `current` | `aria-current="page"` on the text span, or on the link when the item has `href` |
|
|
87
89
|
| hover / focus-visible on links | pointer / keyboard | text → primary; focus ring from LinkButton |
|
|
88
|
-
| truncation | width | each level truncates with an ellipsis, max width `2 × --prime-space-24` (192;
|
|
89
|
-
| auto-collapse |
|
|
90
|
+
| truncation | width | each level truncates with an ellipsis, max width `2 × --prime-space-24` (192); the current page shrinks at half the rate of the others |
|
|
91
|
+
| auto-collapse | 2+ levels whose whole path does not fit the width uncut (measured on every resize) | `data-collapsible="true"`, `data-collapsed="true"`; middle levels are `display: none` and replaced by «… ›»: a ghost menu button (`Dropdown.Trigger`, named by `labels.ellipsis`) whose menu lists them — links stay links, a level without `href` is a disabled row |
|
|
92
|
+
| deep collapse | the path folded as above still does not fit | `data-collapsed="deep"`; the first level folds too: «…» › current page, the menu lists every level before it |
|
|
90
93
|
| collapse menu open | a press, `Enter` or `ArrowDown` on the «…» | `aria-expanded="true"` on the button; a `role="menu"` panel at the tier size |
|
|
94
|
+
| held | a `Page.Guard` that is `busy` or `dirty` on the page | a press on a level's link (in the path or the «…» menu) stops before it navigates; `dirty` asks first, then repeats it |
|
|
91
95
|
|
|
92
|
-
Root attributes: `data-size`, `data-collapsible` (`"true"` / `"false"`).
|
|
96
|
+
Root attributes: `data-size`, `data-collapsible` (`"true"` / `"false"`), `data-collapsed` (`"true"` / `"deep"`).
|
|
93
97
|
|
|
94
98
|
## Layout & spacing
|
|
95
|
-
- A
|
|
96
|
-
- In
|
|
99
|
+
- A single level takes its content width (at most the row). A path of 2+ levels fills the row (`inline-size: 100%`) and folds by that width, so a wider row unfolds it again; its intrinsic width stays the whole path, so a host that measures natural widths (the `Page.TopBar` plan) reads it uncut. Inside a flex row give it a box that takes the room it may use (`flex: 1 1 auto; min-width: 0`).
|
|
100
|
+
- In a `Page.Heading` the path up holds the list a record belongs to (1–2 levels); the record itself is the `Page.Title` (in a top bar the path's last level, after the chevron), not the breadcrumb's `current` item.
|
|
97
101
|
- Above a page title: `gap: var(--prime-space-2)` between the trail and the title row.
|
|
98
102
|
- The list never wraps. Chevrons sit inside each level after the first, in the placeholder text color, at the tier icon size.
|
|
99
103
|
|
|
@@ -113,7 +117,7 @@ Root attributes: `data-size`, `data-collapsible` (`"true"` / `"false"`).
|
|
|
113
117
|
|
|
114
118
|
- `nav` landmark with `aria-label` from `labels.nav`; an ordered list.
|
|
115
119
|
- The current page has `aria-current="page"`; the chevrons are `aria-hidden` spans inside the levels, so every list item is a level.
|
|
116
|
-
- Collapsed
|
|
120
|
+
- Collapsed levels leave the layout and the tab order (no invisible focus stops); the automatic «…» is a menu button (`aria-haspopup="menu"`) named by `labels.ellipsis`, and its menu lists them as links.
|
|
117
121
|
- Icon-only links need `aria-label` on the Item.
|
|
118
122
|
|
|
119
123
|
### Labels
|
|
@@ -132,13 +136,15 @@ Root attributes: `data-size`, `data-collapsible` (`"true"` / `"false"`).
|
|
|
132
136
|
| [with-icon.tsx](examples/with-icon.tsx) | The root level as a home icon; a link without text is named for screen readers — `aria-label`. |
|
|
133
137
|
| [overflow.tsx](examples/overflow.tsx) | A long path: levels truncate, and in a 320px container the middle ones collapse into a «…» menu that lists them — `Breadcrumb.Item`, `current`. |
|
|
134
138
|
| [ellipsis.tsx](examples/ellipsis.tsx) | Levels skipped on purpose shown as «…» whose hidden text names them for screen readers — `Breadcrumb.Ellipsis`, `labels`. |
|
|
139
|
+
| [router.tsx](examples/router.tsx) | Router links as the levels above: the path moves without a reload; render it inside a router — `asChild`, `current`. |
|
|
135
140
|
|
|
136
141
|
## Mistakes
|
|
137
142
|
- Separators by hand between items → the root draws the chevrons.
|
|
138
143
|
- `<Breadcrumb.Item href="…" current>` → the current page has no `href`.
|
|
139
144
|
- Breadcrumb inside a flex row collapsing to zero width → give it `flex: 1 1 auto; min-width: 0`.
|
|
140
145
|
- Home icon link without `aria-label` → add `aria-label="Главная"`.
|
|
146
|
+
- `href` + `onClick` with `preventDefault()` and `navigate()` for a router → `asChild` with the router's `Link`.
|
|
141
147
|
|
|
142
148
|
## Related
|
|
143
149
|
- **Built from:** [LinkButton](../link-button/COMPONENT.md) (`tone="muted"`), [Button](../button/COMPONENT.md) and [Dropdown](../dropdown/COMPONENT.md) (the collapse menu), Icon (`nav.chevronRight`), [VisuallyHidden](../visually-hidden/COMPONENT.md)
|
|
144
|
-
- **See also:** [Tabs](../tabs/COMPONENT.md), [
|
|
150
|
+
- **See also:** [Tabs](../tabs/COMPONENT.md), [Page](../../layout/page/COMPONENT.md), [Stepper](../stepper/COMPONENT.md)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Router links as the levels above: the path moves without a reload; render it inside a router — `asChild`, `current`. */
|
|
2
|
+
import { Breadcrumb } from "prime-ui-kit";
|
|
3
|
+
import { Link } from "react-router-dom";
|
|
4
|
+
|
|
5
|
+
export default function BreadcrumbRouterExample() {
|
|
6
|
+
return (
|
|
7
|
+
<Breadcrumb.Root>
|
|
8
|
+
<Breadcrumb.Item asChild>
|
|
9
|
+
<Link to="/crm">CRM</Link>
|
|
10
|
+
</Breadcrumb.Item>
|
|
11
|
+
<Breadcrumb.Item asChild>
|
|
12
|
+
<Link to="/crm/clients">Клиенты</Link>
|
|
13
|
+
</Breadcrumb.Item>
|
|
14
|
+
<Breadcrumb.Item current>ООО «Северный ветер»</Breadcrumb.Item>
|
|
15
|
+
</Breadcrumb.Root>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -66,7 +66,7 @@ Button.Root <button> (or the single child with asChild); variant, tone, s
|
|
|
66
66
|
| `labels` | `Partial<ButtonLabels>` | — | Built-in strings, see Labels. |
|
|
67
67
|
| `asChild` | `boolean` | `false` | Merges Button props and styles onto the single child element (a link) instead of rendering `<button>`. `disabled`/`loading` become `aria-disabled`; `progress` and `holdToConfirm` need a `<button>`. |
|
|
68
68
|
| `disabled` | `boolean` | — | Disabled state; `loading` also disables. With `asChild` the child leaves the Tab order and a link loses its `href`. |
|
|
69
|
-
| `children` | `ReactNode` | — | Label and `Button.Icon`. Only `Button.Icon` children → a square icon-only button that needs `aria-label`. A changed label morphs letter by letter. With `asChild`, the one child element. |
|
|
69
|
+
| `children` | `ReactNode` | — | Label and `Button.Icon`. Only `Button.Icon` children → a square icon-only button that needs `aria-label`. A changed label morphs letter by letter. With `asChild`, the one child element; its text is the label too. |
|
|
70
70
|
| `aria-label` | `string` | — | The name of a button without a visible label; required with `shape="circle"`. |
|
|
71
71
|
| `…rest` | `Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size" \| "aria-pressed">` | — | `onClick`, `type` (`"button"` by default, not passed on with `asChild`), `className`, `aria-*`, `data-*` and the other button attributes. |
|
|
72
72
|
|
|
@@ -144,6 +144,7 @@ A Button lines up exactly with Input, Select, Datepicker trigger, SegmentedContr
|
|
|
144
144
|
|---|---|---|---|
|
|
145
145
|
| `fullWidth` | button fills the row | narrow forms, cards, mobile footers | off |
|
|
146
146
|
| icon-only (children are only `Button.Icon`) | square, width = height | toolbars; needs `aria-label` | — |
|
|
147
|
+
| icon only by the host (`data-button-label="icon"` on a wrapper, the `Page.TopBar` plan) | a Button with an icon and a label shows only its icon, square; the label and anything else beside the icon (a `Kbd` hint) stay transparent over it, the label as the name | a host short of width | — |
|
|
147
148
|
| `pressed` / `defaultPressed` | on: accent soft fill and accent text over any variant; off: the variant's own look | a single toggle (favourite, pin, «show archived») | — (not a toggle) |
|
|
148
149
|
| `current` | the selected look, `aria-current="page"` | the current page of a set (page numbers) | off |
|
|
149
150
|
|
|
@@ -13,15 +13,15 @@ export default function ButtonOnColoredHostExample() {
|
|
|
13
13
|
<Banner.Root key={text} variant="solid" tone={tone}>
|
|
14
14
|
<Banner.Content>
|
|
15
15
|
<Banner.Title>{text}</Banner.Title>
|
|
16
|
+
<Banner.Actions>
|
|
17
|
+
<Button.Root variant="soft" tone="inherit">
|
|
18
|
+
{action}
|
|
19
|
+
</Button.Root>
|
|
20
|
+
<Button.Root variant="ghost" tone="inherit">
|
|
21
|
+
{later}
|
|
22
|
+
</Button.Root>
|
|
23
|
+
</Banner.Actions>
|
|
16
24
|
</Banner.Content>
|
|
17
|
-
<Banner.Actions>
|
|
18
|
-
<Button.Root variant="soft" tone="inherit">
|
|
19
|
-
{action}
|
|
20
|
-
</Button.Root>
|
|
21
|
-
<Button.Root variant="ghost" tone="inherit">
|
|
22
|
-
{later}
|
|
23
|
-
</Button.Root>
|
|
24
|
-
</Banner.Actions>
|
|
25
25
|
</Banner.Root>
|
|
26
26
|
))}
|
|
27
27
|
</>
|
|
@@ -47,6 +47,7 @@ The root is a field root: `className`, `ref` and the native attributes land on t
|
|
|
47
47
|
| `required` | `boolean` | `false` | Red `*` after the label and `aria-required` on the `group`. |
|
|
48
48
|
| `optional` | `boolean` | `false` | Muted marker after the label (`labels.optional`). |
|
|
49
49
|
| `hint` | `ReactNode` | — | Help text under the control (`aria-describedby`). Hidden while `error` is shown. |
|
|
50
|
+
| `hintTone` | `"neutral" \| "success" \| "warning" \| "danger"` | `"neutral"` | Status color of `hint` («Осталось 12 дней» in `warning`). The words carry the status, the color repeats it; an `error` replaces the hint and its tone. A validation error is `error`, never a `danger` hint. |
|
|
50
51
|
| `error` | `ReactNode` | — | Error message in the hint slot; implies `invalid`. |
|
|
51
52
|
| `invalid` | `boolean` | `false` | Danger inset ring, `aria-invalid` and `data-invalid` on the `group`; the control shakes once when an error arrives. |
|
|
52
53
|
| `reserveSupportRow` | `boolean` | `false` | Always render the support row, so an appearing error does not shift the layout. |
|