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,63 @@
|
|
|
1
|
+
/** Router links as the dialogs, the times in the zone of the operator's profile; render it inside a router — `asChild`, `timeZone`. */
|
|
2
|
+
import { Avatar, Card, ChatList, hueOf } from "prime-ui-kit";
|
|
3
|
+
import { Link } from "react-router-dom";
|
|
4
|
+
|
|
5
|
+
import styles from "./examples.module.css";
|
|
6
|
+
|
|
7
|
+
const NOW = new Date(Date.UTC(2026, 9, 15, 4, 0));
|
|
8
|
+
const utc = (day: number, hour: number, minute: number) =>
|
|
9
|
+
new Date(Date.UTC(2026, 9, day, hour, minute));
|
|
10
|
+
|
|
11
|
+
const DIALOGS = [
|
|
12
|
+
{
|
|
13
|
+
id: "c-311",
|
|
14
|
+
name: "ООО «Вектор»",
|
|
15
|
+
initials: "ВК",
|
|
16
|
+
preview: "Машина на месте, начинаем выгрузку",
|
|
17
|
+
at: utc(15, 0, 10),
|
|
18
|
+
unread: 1,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "c-308",
|
|
22
|
+
name: "ООО «Гранит»",
|
|
23
|
+
initials: "ГР",
|
|
24
|
+
preview: "Счёт № 2041 оплачен",
|
|
25
|
+
at: utc(14, 14, 30),
|
|
26
|
+
unread: 0,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "c-297",
|
|
30
|
+
name: "ИП Козлов",
|
|
31
|
+
initials: "ИК",
|
|
32
|
+
preview: "Пришлите, пожалуйста, акт сверки",
|
|
33
|
+
at: utc(12, 6, 15),
|
|
34
|
+
unread: 0,
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
export default function ChatListRouterExample() {
|
|
39
|
+
return (
|
|
40
|
+
<Card.Root className={styles.short}>
|
|
41
|
+
<ChatList.Root
|
|
42
|
+
items={DIALOGS}
|
|
43
|
+
getKey={(item) => item.id}
|
|
44
|
+
defaultValue="c-311"
|
|
45
|
+
now={NOW}
|
|
46
|
+
timeZone="Asia/Vladivostok"
|
|
47
|
+
renderItem={(item) => (
|
|
48
|
+
<ChatList.Item asChild time={item.at} unread={item.unread}>
|
|
49
|
+
<Link to={`/chats/${item.id}`}>
|
|
50
|
+
<ChatList.ItemIcon>
|
|
51
|
+
<Avatar.Root color={hueOf(item.id)}>
|
|
52
|
+
<Avatar.Fallback>{item.initials}</Avatar.Fallback>
|
|
53
|
+
</Avatar.Root>
|
|
54
|
+
</ChatList.ItemIcon>
|
|
55
|
+
<ChatList.ItemText>{item.name}</ChatList.ItemText>
|
|
56
|
+
<ChatList.ItemDescription>{item.preview}</ChatList.ItemDescription>
|
|
57
|
+
</Link>
|
|
58
|
+
</ChatList.Item>
|
|
59
|
+
)}
|
|
60
|
+
/>
|
|
61
|
+
</Card.Root>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -50,6 +50,7 @@ Checkbox.Indicator the box alone, no input — a mark inside option / menu r
|
|
|
50
50
|
| `optional` | `boolean` | `false` | Muted `labels.optional` after the label text; the field may stay off. |
|
|
51
51
|
| `labels` | `Partial<CheckboxLabels>` | — | Built-in strings, see Labels. |
|
|
52
52
|
| `hint` | `ReactNode` | — | Help text under the label text. Hidden while `error` is shown. |
|
|
53
|
+
| `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. |
|
|
53
54
|
| `error` | `ReactNode` | — | Error message in the hint slot; implies `invalid`. |
|
|
54
55
|
| `invalid` | `boolean` | `false` | Danger ring on the unchecked box and `aria-invalid`. A non-empty `error` implies it. |
|
|
55
56
|
| `disabled` | `boolean` | `false` | Disabled fill, dimmed label and hint, no toggling. |
|
|
@@ -19,12 +19,13 @@
|
|
|
19
19
|
width: min(100%, var(--prime-layout-form-width-s));
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
/* indicator.tsx: selectable tiles in a fluid grid
|
|
22
|
+
/* indicator.tsx: selectable tiles in a fluid grid; a column holds a whole module name (a tile
|
|
23
|
+
label stays on one line), so a narrow column stacks the tiles instead of truncating them. */
|
|
23
24
|
.tiles {
|
|
24
25
|
display: grid;
|
|
25
26
|
grid-template-columns: repeat(
|
|
26
27
|
auto-fit,
|
|
27
|
-
minmax(min(100%, var(--prime-layout-tile-min-width)), 1fr)
|
|
28
|
+
minmax(min(100%, calc(var(--prime-layout-tile-min-width) * 1.5)), 1fr)
|
|
28
29
|
);
|
|
29
30
|
gap: var(--prime-space-4);
|
|
30
31
|
width: 100%;
|
|
@@ -69,7 +69,7 @@ Syntax tokens: keywords purple (weight 500), strings teal, numbers orange, JSX t
|
|
|
69
69
|
## Layout & spacing
|
|
70
70
|
- `max-width: 100%`; the block takes the column width and long lines scroll horizontally inside it (`white-space: pre`, tab size 2), with the kit's thin scrollbar.
|
|
71
71
|
- Heading / text → code block: space step 2–4 (8–16px).
|
|
72
|
-
- Constrain the column (
|
|
72
|
+
- Constrain the column (`Page.Root maxWidth="readable"` for docs), not the block.
|
|
73
73
|
|
|
74
74
|
## Accessibility
|
|
75
75
|
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/** A block fixed to one scheme looks the same in both page themes — `colorScheme`. */
|
|
2
2
|
import { CodeBlock } from "prime-ui-kit";
|
|
3
3
|
|
|
4
|
-
import styles from "./examples.module.css";
|
|
5
|
-
|
|
6
4
|
const SAMPLE = `const retries = 3; // повторы при ошибке сети
|
|
7
5
|
export const isReady = (status: "idle" | "busy") => status === "idle";`;
|
|
8
6
|
|
|
9
7
|
export default function CodeBlockColorSchemeExample() {
|
|
10
8
|
return (
|
|
11
|
-
|
|
9
|
+
<>
|
|
12
10
|
<CodeBlock code={SAMPLE} colorScheme="light" aria-label="Светлая схема" />
|
|
13
11
|
<CodeBlock code={SAMPLE} colorScheme="dark" aria-label="Тёмная схема" />
|
|
14
|
-
|
|
12
|
+
</>
|
|
15
13
|
);
|
|
16
14
|
}
|
|
@@ -6,17 +6,6 @@
|
|
|
6
6
|
min-width: 0;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
/* color-scheme.tsx: two blocks side by side, stacked when narrow. */
|
|
10
|
-
.grid {
|
|
11
|
-
display: grid;
|
|
12
|
-
grid-template-columns: repeat(
|
|
13
|
-
auto-fit,
|
|
14
|
-
minmax(min(100%, var(--prime-layout-tile-min-width)), 1fr)
|
|
15
|
-
);
|
|
16
|
-
gap: var(--prime-space-4);
|
|
17
|
-
width: 100%;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
9
|
/* narrow.tsx: a column narrower than the line. */
|
|
21
10
|
.narrow {
|
|
22
11
|
width: min(100%, var(--prime-layout-form-width-s));
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
## When not to use
|
|
14
14
|
- The color comes from a short fixed palette and the choice should be visible at once → use [ColorSwatches](../color-swatches/COMPONENT.md).
|
|
15
|
-
- A compact color next to a field or in a dense list row → use [ColorPresets](../color-picker/COMPONENT.md) (square trigger + palette).
|
|
15
|
+
- A compact color next to a field or in a dense list row → use [ColorPresets](../color-picker/COMPONENT.md) (square trigger + palette; `allowCustom` adds a hex field for any other color).
|
|
16
16
|
- The picker panel itself is the screen (a design tool, an inline editor) → compose [ColorPicker](../color-picker/COMPONENT.md) parts.
|
|
17
17
|
- A plain text field for a hex code → use [Input](../input/COMPONENT.md).
|
|
18
18
|
|
|
@@ -55,6 +55,7 @@ ColorField field frame: label · field button · hint | er
|
|
|
55
55
|
| `required` | `boolean` | `false` | Red `*` after the label; the field button is described by `labels.required` (a button takes no `aria-required`). |
|
|
56
56
|
| `optional` | `boolean` | — | Muted marker right after the label text (`labels.optional`). |
|
|
57
57
|
| `hint` | `ReactNode` | — | Help text under the field. Hidden while `error` is shown. |
|
|
58
|
+
| `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. |
|
|
58
59
|
| `error` | `ReactNode` | — | Error message in the hint slot; implies `invalid`. |
|
|
59
60
|
| `invalid` | `boolean` | — | Danger ring and `aria-invalid` without a message. A non-empty `error` implies it. |
|
|
60
61
|
| `disabled` | `boolean` | `false` | Disables the field: it shows the color and does not open. |
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
## When to use
|
|
9
9
|
- `ColorPicker` — any color is allowed and the picker parts are laid out by hand: an inline panel, a design tool, a hex field with a custom trigger.
|
|
10
|
-
- `ColorPresets` — a color from a fixed palette with an optional «no color»: label, project or calendar colors, one trigger per row.
|
|
10
|
+
- `ColorPresets` — a color from a fixed palette with an optional «no color»: label, project or calendar colors, one trigger per row. With `allowCustom` the palette is a shortcut, not a limit: any hex is typed under it (a spec color on a site, a brand color in a dense list row).
|
|
11
11
|
- `parseColor` — turning a CSS string into a `Color` for a controlled `ColorPicker`.
|
|
12
12
|
|
|
13
13
|
## When not to use
|
|
@@ -31,7 +31,8 @@ in `prime-ui-kit/bundle.css`. `ColorPresets` stays in the main entry and needs n
|
|
|
31
31
|
```
|
|
32
32
|
ColorPicker.Root shared Color + value format (no DOM)
|
|
33
33
|
├─ ColorPicker.HexInput kit Input bound to the hex of the current color
|
|
34
|
-
|
|
34
|
+
│ └─ ColorPicker.SwatchButton end segment of the field box: the current color, opens a panel
|
|
35
|
+
├─ ColorPicker.TriggerSwatch square of the current color for your own trigger button
|
|
35
36
|
└─ ColorPicker.Panel vertical stack, optional raised surface
|
|
36
37
|
├─ ColorPicker.FormatSelect kit Select: HSL / RGB / Hex
|
|
37
38
|
├─ ColorPicker.Area 2D area (4:3)
|
|
@@ -48,6 +49,7 @@ ColorPresets.Root value, open, presets (no DOM)
|
|
|
48
49
|
├─ ColorPresets.Trigger slot around one element
|
|
49
50
|
│ └─ ColorPresets.SwatchButton square swatch button (or your Button with ColorPresets.Swatch)
|
|
50
51
|
└─ ColorPresets.Content popover with the swatch grid (listbox)
|
|
52
|
+
└─ Input hex field with the typed color's chip (`allowCustom`)
|
|
51
53
|
```
|
|
52
54
|
Helpers: `parseColor(value)` (throws on invalid input; back to text with `color.toString("hex" | "hexa" | "css")`), `COLOR_PRESETS` (16 colors: step 500 and step 700 of eight hues), types `ColorPickerColorValue`, `ColorValueFormat`, `ColorPreset`.
|
|
53
55
|
|
|
@@ -85,10 +87,19 @@ No DOM. Holds the color (React Aria `ColorPicker`) and the value format for ever
|
|
|
85
87
|
|---|---|---|---|
|
|
86
88
|
| `label` | `ReactNode` | — | Field label; defaults to `labels.hex`. |
|
|
87
89
|
| `hint` | `ReactNode` | — | Help text under the field. Hidden while `error` is shown. |
|
|
90
|
+
| `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. |
|
|
88
91
|
| `error` | `ReactNode` | — | Error message in the hint slot; marks the field invalid. |
|
|
89
92
|
| `focusRing` | `boolean` | `true` | `false` hides only the visual focus ring of the fields (`data-focus-ring="false"`); focus, keyboard and ARIA stay. |
|
|
93
|
+
| `children` | `ReactNode` | — | End segments of the field box after the value: `ColorPicker.SwatchButton` (in a `Popover.Trigger`), so the hex and its swatch read as one field. |
|
|
90
94
|
| `…rest` | `Omit<HTMLAttributes<HTMLDivElement>, "id" \| "children" \| "defaultValue" \| "defaultChecked" \| "onChange">` | — | `className`, `data-*` and the other attributes of the field frame `<div>` (field-root rule: `className`, `ref` and the rest → frame, `id` → control). |
|
|
91
95
|
|
|
96
|
+
### ColorPicker.SwatchButton
|
|
97
|
+
`ref` → `HTMLButtonElement`. The current color as a button segment at the end of `HexInput`: full field height, named `labels.palette`, with a tooltip. Wrap it in `Popover.Trigger` to open the panel.
|
|
98
|
+
|
|
99
|
+
| Prop | Type | Default | Description |
|
|
100
|
+
|---|---|---|---|
|
|
101
|
+
| `…rest` | `Omit<ButtonHTMLAttributes<HTMLButtonElement>, "aria-label" \| "children">` | — | `className`, `disabled`, `onClick` and the other attributes of the `<button>`. |
|
|
102
|
+
|
|
92
103
|
### ColorPicker.TriggerSwatch
|
|
93
104
|
`ref` → `HTMLSpanElement`. A square of the current color for a trigger button (`aria-hidden`); follows the host icon size, e.g. inside `Button.Icon`.
|
|
94
105
|
|
|
@@ -155,7 +166,7 @@ No DOM. Holds the color (React Aria `ColorPicker`) and the value format for ever
|
|
|
155
166
|
| Prop | Type | Default | Description |
|
|
156
167
|
|---|---|---|---|
|
|
157
168
|
| `presets` | `readonly ColorPreset[]` | `COLOR_PRESETS` | Swatches `{ value, label }`; the label names the swatch. |
|
|
158
|
-
| `label · hint · error · invalid · required · optional · disabled · size · id · labels · aria-label · aria-labelledby · aria-describedby` | `ColorSwatchesProps` | — | As on `ColorSwatches`. |
|
|
169
|
+
| `label · hint · hintTone · error · invalid · required · optional · disabled · size · id · labels · aria-label · aria-labelledby · aria-describedby` | `ColorSwatchesProps` | — | As on `ColorSwatches`. |
|
|
159
170
|
| `…rest` | `Omit<ColorSwatchesProps, "value" \| "defaultValue" \| "onValueChange" \| "allowEmpty" \| "name">` | — | `className` and the other attributes of the field frame. |
|
|
160
171
|
|
|
161
172
|
### ColorPicker.EyeDropperButton
|
|
@@ -185,6 +196,7 @@ No DOM and no ref, except a field frame in a FieldList cell (the column heading
|
|
|
185
196
|
| `size` | `"xs" \| "s" \| "m" \| "l" \| "xl"` | host tier, else `"m"` | Tier of the trigger, the swatches and the panel. Without it the tier of its host, else `m`. |
|
|
186
197
|
| `disabled` | `boolean` | `false` | The trigger is disabled and does not open the panel. A disabled `Fieldset` around it sets it too. |
|
|
187
198
|
| `allowEmpty` | `boolean` | `false` | Adds the «no color» swatch after the presets (value `null`). |
|
|
199
|
+
| `allowCustom` | `boolean` | `false` | Any color beyond the palette: a hex field under the swatches (`labels.custom`) shows the typed color, Enter picks it as `#rrggbb`; invalid text gets `labels.customInvalid`. |
|
|
188
200
|
| `closeOnSelect` | `boolean` | `true` | Close the panel after a pick (focus returns to the trigger). |
|
|
189
201
|
| `labels` | `Partial<ColorPresetsLabels>` | — | Built-in strings, see Labels. |
|
|
190
202
|
| `children` | `ReactNode` | — (required) | `ColorPresets.Trigger` and `ColorPresets.Content`. |
|
|
@@ -245,12 +257,13 @@ No `variant` / `tone` / `color`.
|
|
|
245
257
|
| `l` | 40px, 28px swatches | spacious forms | |
|
|
246
258
|
| `xl` | 48px, 32px swatches | touch-first screens | |
|
|
247
259
|
|
|
248
|
-
**Sizes:** `ColorPresets.SwatchButton` is a square of the control height, so it lines up with an Input of the same size;
|
|
260
|
+
**Sizes:** `ColorPresets.SwatchButton` is a square of the control height, so it lines up with an Input of the same size; `ColorPicker.SwatchButton` is a segment inside HexInput, so it takes the field's tier with it. Area, sliders and the channel strip have no size axis (always tier `m`).
|
|
249
261
|
|
|
250
262
|
### Flags
|
|
251
263
|
| Value | Looks like | Use when | Default |
|
|
252
264
|
|---|---|---|---|
|
|
253
265
|
| `allowEmpty` (ColorPresets) | checkerboard «Без цвета» swatch at the end | the color is optional | `false` |
|
|
266
|
+
| `allowCustom` (ColorPresets) | a «Свой цвет» hex field under the swatches, its chip showing the typed color | any color is valid, the palette only speeds the common ones | `false` |
|
|
254
267
|
| `closeOnSelect={false}` (ColorPresets) | panel stays open after a pick | trying several colors in a row | `true` |
|
|
255
268
|
| `closeOnOutsideClick={false}` (ColorPresets) | a press beside the panel keeps it open | comparing presets with the page | `true` |
|
|
256
269
|
| `closeOnEscape={false}` (ColorPresets) | Escape leaves the panel open | the panel closes only by a pick or the trigger | `true` |
|
|
@@ -271,13 +284,14 @@ No `variant` / `tone` / `color`.
|
|
|
271
284
|
| eyedropper unsupported | no `window.EyeDropper` | button `disabled`, `aria-hidden` |
|
|
272
285
|
| selected swatch | the color | `data-state="checked"`; a check mark that contrasts with the color draws in — no ring, the check is the selection |
|
|
273
286
|
| ColorPresets open | `open` / click / ArrowDown · ArrowUp on the trigger | popover `data-state`; focus on the selected swatch |
|
|
287
|
+
| ColorPresets custom color | `allowCustom` + a value that is no preset, or Enter in the hex field | no swatch is checked; the hex field holds the value; the trigger is named «`labels.trigger`: #rrggbb»; invalid text on Enter shows `labels.customInvalid` as the field's error (the error drops in, the field shakes once) |
|
|
274
288
|
| ColorPresets empty | value `null` | the trigger shows the checkerboard fill and is named «`labels.trigger`: `labels.empty`» |
|
|
275
289
|
|
|
276
290
|
There is no `disabled` on `ColorPicker.Root` — disable parts individually. Controlled: `value` + `onValueChange` (both components), `open` + `onOpenChange` (ColorPresets). Uncontrolled: `defaultValue`, `defaultOpen`.
|
|
277
291
|
|
|
278
292
|
## Layout & spacing
|
|
279
293
|
- Panel width comes from the layout: a popover or a column wide enough for the area and four channel fields.
|
|
280
|
-
-
|
|
294
|
+
- Hex field + palette trigger: `ColorPicker.SwatchButton` as a child of `HexInput` — one field box, the swatch a full-height segment at its end; no row of your own.
|
|
281
295
|
- Panel parts gap: 12px (`--prime-space-3`) from `ColorPicker.Panel`.
|
|
282
296
|
- ColorPresets.Content `align="auto"`: a trigger near the end of the screen lines up the panel's end edge and the panel grows toward the start, and the other way near the start; a fixed `align` still flips at the screen edge.
|
|
283
297
|
- ColorPresets grid: one row for up to 8 presets (+ «no color»), else rows of 8 (`columns` overrides); a panel narrower than the row wraps the swatches into balanced rows (16 → 8 + 8, never 14 + 2). On a coarse pointer every swatch grows to the 44 px touch target and the grid wraps into more rows, so it still fits a 320px panel; the arrow keys walk the rows on screen.
|
|
@@ -292,15 +306,15 @@ There is no `disabled` on `ColorPicker.Root` — disable parts individually. Con
|
|
|
292
306
|
| `ArrowLeft` · `ArrowRight` · `ArrowUp` · `ArrowDown` | Move the area thumb or a slider; in the ColorPresets grid, move between swatches. |
|
|
293
307
|
| `PageUp` · `PageDown` | Larger steps on the area and the sliders. |
|
|
294
308
|
| `Home` · `End` | Slider ends; the first / last swatch in the ColorPresets grid. |
|
|
295
|
-
| `Enter` · `Space` | Commit a field; pick the focused preset swatch and close. |
|
|
296
|
-
| `Tab` | Moves through the parts; inside the ColorPresets grid returns to the trigger and closes. |
|
|
309
|
+
| `Enter` · `Space` | Commit a field; pick the focused preset swatch and close. In the ColorPresets hex field (`allowCustom`) Enter picks the typed color. |
|
|
310
|
+
| `Tab` | Moves through the parts; inside the ColorPresets grid returns to the trigger and closes. With `allowCustom` Tab goes from the grid to the hex field; past it the panel closes and focus goes on from the trigger. |
|
|
297
311
|
| `Escape` | Closes the ColorPresets panel. |
|
|
298
312
|
|
|
299
313
|
### ARIA
|
|
300
314
|
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
301
315
|
|
|
302
316
|
- Area and sliders are React Aria primitives with their own `role="slider"` names.
|
|
303
|
-
- `TriggerSwatch` and `ColorPresets.Swatch` are `aria-hidden` — give the trigger button an `aria-label` (`ColorPresets.Trigger` names its element «`labels.trigger`: <color name>» unless the element has its own `aria-label`).
|
|
317
|
+
- `SwatchButton` is a button named `labels.palette` with a tooltip. `TriggerSwatch` and `ColorPresets.Swatch` are `aria-hidden` — give the trigger button an `aria-label` (`ColorPresets.Trigger` names its element «`labels.trigger`: <color name>» unless the element has its own `aria-label`).
|
|
304
318
|
- `ColorPicker.Swatches` is a `role="radiogroup"` (ColorSwatches): name it with `label` or `aria-label`.
|
|
305
319
|
- The ColorPresets grid is `role="listbox"` with `role="option"` swatches (roving tabindex), named by the Content `label` or `labels.list`.
|
|
306
320
|
- Channel fields are named by `labels` (`hue`, `red`…); HexInput by its label (`labels.hex` by default).
|
|
@@ -315,6 +329,7 @@ There is no `disabled` on `ColorPicker.Root` — disable parts individually. Con
|
|
|
315
329
|
| `format` | `"Формат значений цвета"` | Name of `ColorPicker.FormatSelect`. |
|
|
316
330
|
| `eyeDropper` | `"Пипетка"` | Name of `ColorPicker.EyeDropperButton`. |
|
|
317
331
|
| `hex` | `"Hex"` | Hex field of `ChannelStrip` and the default `HexInput` label. |
|
|
332
|
+
| `palette` | `"Открыть палитру"` | Name and tooltip of `ColorPicker.SwatchButton`. |
|
|
318
333
|
| `hue` | `"Оттенок, градусы"` | Hue channel field. |
|
|
319
334
|
| `saturation` | `"Насыщенность, проценты"` | Saturation channel field. |
|
|
320
335
|
| `lightness` | `"Яркость, проценты"` | Lightness channel field. |
|
|
@@ -345,23 +360,27 @@ There is no `disabled` on `ColorPicker.Root` — disable parts individually. Con
|
|
|
345
360
|
| `trigger` | `"Цвет"` | ColorPresets trigger name prefix: «<trigger>: <color name>»; in a FieldList cell the column heading. |
|
|
346
361
|
| `list` | `"Цвета"` | ColorPresets swatch list name when `Content` has no `label`. |
|
|
347
362
|
| `empty` | `"Без цвета"` | ColorPresets «no color» swatch and the trigger name for an empty value. |
|
|
363
|
+
| `custom` | `"Свой цвет"` | Label of the ColorPresets hex field (`allowCustom`). |
|
|
364
|
+
| `customInvalid` | `"Введите цвет в формате #RRGGBB"` | Error of the ColorPresets hex field when Enter finds no hex color. |
|
|
348
365
|
|
|
349
366
|
## Examples
|
|
350
367
|
| Example | Shows |
|
|
351
368
|
|---|---|
|
|
352
|
-
| [overview.tsx](examples/overview.tsx) | A color field: a hex value and a swatch
|
|
353
|
-
| [sizes.tsx](examples/sizes.tsx) | Every tier of the picker: the hex field and
|
|
369
|
+
| [overview.tsx](examples/overview.tsx) | A color field: a hex value and a swatch segment at its end that opens the picker panel — `ColorPicker.HexInput`, `ColorPicker.SwatchButton`. |
|
|
370
|
+
| [sizes.tsx](examples/sizes.tsx) | Every tier of the picker: the hex field and its swatch segment take it from the root — `size`. |
|
|
354
371
|
| [states.tsx](examples/states.tsx) | A disabled area, hue slider and preset trigger keep showing the color but take no input — `disabled`. |
|
|
355
372
|
| [validation.tsx](examples/validation.tsx) | A button color checked live: a too light color shakes in an error that leaves once the color is darker; a hint under the other field, invalid text reverts on blur — `hint`, `error`. |
|
|
356
373
|
| [panel.tsx](examples/panel.tsx) | The full raised panel and its part order: format, area, hue and alpha sliders, channels, brand swatches — `ColorPicker.Panel`, `surface`, `ColorPicker.Swatches`. |
|
|
357
374
|
| [formats.tsx](examples/formats.tsx) | The channel strip in each value format; three pickers edit one color — `defaultFormat`, `ColorPicker.ChannelStrip`. |
|
|
358
375
|
| [presets.tsx](examples/presets.tsx) | A quick color from the palette: a square trigger with «no color» and a Button trigger whose grid of four columns stays open after a pick — `ColorPresets`, `allowEmpty`, `ColorPresets.Trigger`, `columns`, `closeOnSelect`. |
|
|
376
|
+
| [presets-custom.tsx](examples/presets-custom.tsx) | A spec's color on the site: the brand palette one click away and any hex typed under it — `ColorPresets`, `allowCustom`. |
|
|
359
377
|
| [presets-sizes.tsx](examples/presets-sizes.tsx) | The preset trigger in every size, a square of the control height next to an input of the same tier — `ColorPresets`, `size`. |
|
|
360
378
|
| [controlled.tsx](examples/controlled.tsx) | The parent owns the color and its format: brand swatches and the channels edit it, the format stays as picked, a button resets both — `value`, `onValueChange`, `format`, `onFormatChange`. |
|
|
361
379
|
| [controlled-open.tsx](examples/controlled-open.tsx) | The parent opens the preset palette from its own button and keeps the chosen color — `open`, `onOpenChange`, `value`, `onValueChange`. |
|
|
362
380
|
| [in-form.tsx](examples/in-form.tsx) | Theme settings: the color goes with the form, a too light color shakes in an error on save that leaves once the color changes — `value`, `error`. |
|
|
363
381
|
|
|
364
382
|
## Mistakes
|
|
383
|
+
- A ColorPresets palette padded with dozens of colors so that «any» color fits, or a ColorField beside it for the rest → `allowCustom`: the palette stays short, any hex is typed under it.
|
|
365
384
|
- Trigger in one `ColorPicker.Root` and panel in another → they will not share the color; wrap both in one Root.
|
|
366
385
|
- `isDisabled` on Area / Slider → use `disabled`.
|
|
367
386
|
- `onChange` on `ColorPicker.Root` → use `onValueChange`.
|
|
@@ -369,8 +388,9 @@ There is no `disabled` on `ColorPicker.Root` — disable parts individually. Con
|
|
|
369
388
|
- `surface="raised"` inside a Popover → use the default `none`.
|
|
370
389
|
- Expecting `ColorPresets` to return a `Color` → it returns the preset string (or `null`).
|
|
371
390
|
- `<ColorPresets.Trigger onKeyDown={…}>` or `className` on the Trigger → it is a slot with no props of its own; put them on the child element.
|
|
391
|
+
- A hex field and a separate swatch `Button` side by side in your own row → put `ColorPicker.SwatchButton` inside `HexInput`.
|
|
372
392
|
- `<ColorPresets.Trigger />` with no child → put `ColorPresets.SwatchButton` (or your Button) inside it.
|
|
373
393
|
|
|
374
394
|
## Related
|
|
375
|
-
- **Built from:** [Input](../input/COMPONENT.md) (`HexInput`), [Label](../label/COMPONENT.md) and [Hint](../hint/COMPONENT.md) (the `HexInput` label, hint and error), [Select](../select/COMPONENT.md) (`FormatSelect`), [Button](../button/COMPONENT.md) (`EyeDropperButton`), [ColorSwatches](../color-swatches/COMPONENT.md) (`Swatches`), [Popover](../popover/COMPONENT.md) (`ColorPresets.Root`, `ColorPresets.Content`), `Icon` (pipette), [VisuallyHidden](../visually-hidden/COMPONENT.md)
|
|
395
|
+
- **Built from:** [Input](../input/COMPONENT.md) (`HexInput`; its field action segment for `SwatchButton`; the hex field of `ColorPresets allowCustom`), [Tooltip](../tooltip/COMPONENT.md) (`SwatchButton`), [Label](../label/COMPONENT.md) and [Hint](../hint/COMPONENT.md) (the `HexInput` label, hint and error), [Select](../select/COMPONENT.md) (`FormatSelect`), [Button](../button/COMPONENT.md) (`EyeDropperButton`), [ColorSwatches](../color-swatches/COMPONENT.md) (`Swatches`), [Popover](../popover/COMPONENT.md) (`ColorPresets.Root`, `ColorPresets.Content`), `Icon` (pipette), [VisuallyHidden](../visually-hidden/COMPONENT.md)
|
|
376
396
|
- **See also:** [ColorField](../color-field/COMPONENT.md), [ColorSwatches](../color-swatches/COMPONENT.md), [TagSelect](../tag-select/COMPONENT.md)
|
|
@@ -9,11 +9,8 @@
|
|
|
9
9
|
max-width: 100%;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
/*
|
|
13
|
-
.
|
|
14
|
-
display: flex;
|
|
15
|
-
align-items: flex-end;
|
|
16
|
-
gap: var(--prime-space-2);
|
|
12
|
+
/* overview.tsx: the hex field with its swatch segment at a field's width. */
|
|
13
|
+
.field {
|
|
17
14
|
width: var(--prime-layout-min-width);
|
|
18
15
|
max-width: 100%;
|
|
19
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** A color field: a hex value and a swatch
|
|
2
|
-
import {
|
|
1
|
+
/** A color field: a hex value and a swatch segment at its end that opens the picker panel — `ColorPicker.HexInput`, `ColorPicker.SwatchButton`. */
|
|
2
|
+
import { Popover } from "prime-ui-kit";
|
|
3
3
|
import { ColorPicker } from "prime-ui-kit/color-picker";
|
|
4
4
|
|
|
5
5
|
import styles from "./examples.module.css";
|
|
@@ -7,15 +7,10 @@ import styles from "./examples.module.css";
|
|
|
7
7
|
export default function ColorPickerOverviewExample() {
|
|
8
8
|
return (
|
|
9
9
|
<ColorPicker.Root defaultValue="#5b5bd6">
|
|
10
|
-
<
|
|
11
|
-
<ColorPicker.HexInput label="Акцентный цвет" />
|
|
10
|
+
<ColorPicker.HexInput label="Акцентный цвет" className={styles.field}>
|
|
12
11
|
<Popover.Root>
|
|
13
12
|
<Popover.Trigger>
|
|
14
|
-
<
|
|
15
|
-
<Button.Icon>
|
|
16
|
-
<ColorPicker.TriggerSwatch />
|
|
17
|
-
</Button.Icon>
|
|
18
|
-
</Button.Root>
|
|
13
|
+
<ColorPicker.SwatchButton />
|
|
19
14
|
</Popover.Trigger>
|
|
20
15
|
<Popover.Content>
|
|
21
16
|
<ColorPicker.Panel className={styles.panel}>
|
|
@@ -31,7 +26,7 @@ export default function ColorPickerOverviewExample() {
|
|
|
31
26
|
</ColorPicker.Panel>
|
|
32
27
|
</Popover.Content>
|
|
33
28
|
</Popover.Root>
|
|
34
|
-
</
|
|
29
|
+
</ColorPicker.HexInput>
|
|
35
30
|
</ColorPicker.Root>
|
|
36
31
|
);
|
|
37
32
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** A spec's color on the site: the brand palette one click away and any hex typed under it — `ColorPresets`, `allowCustom`. */
|
|
2
|
+
import { ColorPresets } from "prime-ui-kit";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
const BRAND_COLORS = [
|
|
6
|
+
{ value: "#5b5bd6", label: "Индиго" },
|
|
7
|
+
{ value: "#0090ff", label: "Синий" },
|
|
8
|
+
{ value: "#12a594", label: "Бирюзовый" },
|
|
9
|
+
{ value: "#30a46c", label: "Зелёный" },
|
|
10
|
+
{ value: "#f76b15", label: "Оранжевый" },
|
|
11
|
+
{ value: "#e5484d", label: "Красный" },
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
export default function ColorPickerPresetsCustomExample() {
|
|
15
|
+
const [color, setColor] = React.useState<string | null>("#8e4ec6");
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<ColorPresets.Root
|
|
19
|
+
presets={BRAND_COLORS}
|
|
20
|
+
allowCustom
|
|
21
|
+
value={color}
|
|
22
|
+
onValueChange={setColor}
|
|
23
|
+
labels={{ trigger: "Цвет характеристики" }}
|
|
24
|
+
>
|
|
25
|
+
<ColorPresets.Trigger>
|
|
26
|
+
<ColorPresets.SwatchButton />
|
|
27
|
+
</ColorPresets.Trigger>
|
|
28
|
+
<ColorPresets.Content label="Цвет характеристики" />
|
|
29
|
+
</ColorPresets.Root>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/** Every tier of the picker: the hex field and
|
|
2
|
-
import { Button } from "prime-ui-kit";
|
|
1
|
+
/** Every tier of the picker: the hex field and its swatch segment take it from the root — `size`. */
|
|
3
2
|
import { ColorPicker } from "prime-ui-kit/color-picker";
|
|
4
3
|
|
|
5
4
|
const SIZES = ["xs", "s", "m", "l", "xl"] as const;
|
|
@@ -10,12 +9,9 @@ export default function ColorPickerSizesExample() {
|
|
|
10
9
|
{SIZES.map((size) => (
|
|
11
10
|
<div key={size}>
|
|
12
11
|
<ColorPicker.Root defaultValue="#0090ff" size={size}>
|
|
13
|
-
<ColorPicker.HexInput label={size}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<ColorPicker.TriggerSwatch />
|
|
17
|
-
</Button.Icon>
|
|
18
|
-
</Button.Root>
|
|
12
|
+
<ColorPicker.HexInput label={size}>
|
|
13
|
+
<ColorPicker.SwatchButton />
|
|
14
|
+
</ColorPicker.HexInput>
|
|
19
15
|
</ColorPicker.Root>
|
|
20
16
|
</div>
|
|
21
17
|
))}
|
|
@@ -49,6 +49,7 @@ ColorSwatches field frame: label → swatches → hint | error
|
|
|
49
49
|
| `required` | `boolean` | — | Red `*` after the label and `aria-required` on the group. |
|
|
50
50
|
| `optional` | `boolean` | — | Muted marker right after the label text (`labels.optional`). |
|
|
51
51
|
| `hint` | `ReactNode` | — | Help text under the swatches. Hidden while `error` is shown. |
|
|
52
|
+
| `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. |
|
|
52
53
|
| `error` | `ReactNode` | — | Error message in the hint slot; implies `invalid`. |
|
|
53
54
|
| `invalid` | `boolean` | — | Danger inner edge on every swatch and `aria-invalid`. A non-empty `error` implies it. |
|
|
54
55
|
| `disabled` | `boolean` | `false` | Disables every swatch (grey, half transparent). |
|
|
@@ -45,7 +45,7 @@ Crossfade <div>; holds the region's height while it changes
|
|
|
45
45
|
| Prop | Type | Default | Description |
|
|
46
46
|
|---|---|---|---|
|
|
47
47
|
| `state` | `string \| number` | — (required) | Key of what the region shows: `"loading"`, `"ready"`, `"empty"`, `"error"` or a record id. A new value cross-fades the old content into the new one; the same value updates in place. |
|
|
48
|
-
| `fill` | `boolean` | `false` | The region takes its parent's height (a flex or grid item, or a sized block) and every state stretches to it; the height never glides. |
|
|
48
|
+
| `fill` | `boolean` | `false` | The region takes its parent's height (a flex or grid item, or a sized block) and every state stretches to it; the height never glides. A `Crossfade` that is the child of a `Page.Cell` fills it unless `fill` is set. |
|
|
49
49
|
| `children` | `ReactNode` | — | Content of the current `state`. Nothing (`null`, `false`) leaves no box once the old state has faded: no gap in a grid or a flex column. |
|
|
50
50
|
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `className`, `aria-busy`, `aria-live`, `role` and the other div attributes. |
|
|
51
51
|
|
|
@@ -79,7 +79,7 @@ Motion is opacity only, so nothing shifts under the pointer; the leaving content
|
|
|
79
79
|
|
|
80
80
|
## Layout & spacing
|
|
81
81
|
- No padding, gap or fill of its own: it sits where the swapped content would sit (inside `Card.Body`, a page section, a panel).
|
|
82
|
-
- Width follows the parent; height is the current content's height except while gliding — or, with `fill`, the parent's height (the parent needs one: a flex or grid column with a height, `
|
|
82
|
+
- Width follows the parent; height is the current content's height except while gliding — or, with `fill`, the parent's height (the parent needs one: a flex or grid column with a height, `Page.Root fill`).
|
|
83
83
|
- An empty Crossfade has no box: an optional block above a list keeps the page rhythm whether it is there or not.
|
|
84
84
|
- The loading state is a `Skeleton` with the geometry of the data it stands for (same rows, same line heights), so the swap to data changes neither layout nor height.
|
|
85
85
|
|
|
@@ -108,7 +108,7 @@ No `labels`.
|
|
|
108
108
|
| [overview.tsx](examples/overview.tsx) | A card region that cross-fades between loading, data, empty and error and glides to the new height — `state`. |
|
|
109
109
|
| [record-switch.tsx](examples/record-switch.tsx) | A detail panel keyed by the record id: picking another client cross-fades the details of a different height — `state`. |
|
|
110
110
|
| [fill.tsx](examples/fill.tsx) | A deal board that fills its panel's height while it swaps between loading and data, and a notice slot above it that takes no room while empty — `fill`, `state`. |
|
|
111
|
-
| [screen.tsx](examples/screen.tsx) | Screen states: the title and the date of the statement in
|
|
111
|
+
| [screen.tsx](examples/screen.tsx) | Screen states: the title and the date of the statement in its top bar, a page-level error in a Banner with a retry, a region loading with a Skeleton of its rows and a table skeleton, the table error in place and a first-run EmptyPage; regions cross-fade between states — `state`. |
|
|
112
112
|
|
|
113
113
|
## Mistakes
|
|
114
114
|
- A new `state` on every data refresh (`state={Date.now()}`) → key by what the region shows, not by when it was fetched.
|