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
|
@@ -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. |
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
- A tile that is itself the way to its details — a KPI that opens its report, a project tile (`asChild` with a link or a button).
|
|
14
14
|
|
|
15
15
|
## When not to use
|
|
16
|
-
- A whole page region with a title and description → [
|
|
16
|
+
- A whole page region with a title and description → [Page](../../layout/page/COMPONENT.md) sections (`Page.Section`); do not wrap every section in a card.
|
|
17
17
|
- Tabular data → use [DataTable](../data-table/COMPONENT.md) (it has its own fill).
|
|
18
18
|
- A message about the page state → [Banner](../banner/COMPONENT.md); nothing to show yet → [EmptyPage](../empty-page/COMPONENT.md).
|
|
19
19
|
- Content that floats over the page → [Popover](../popover/COMPONENT.md), [Modal](../modal/COMPONENT.md) or [Drawer](../drawer/COMPONENT.md).
|
|
@@ -47,6 +47,7 @@ Card.Root asChild <a> or <button> (the only child) holding the pa
|
|
|
47
47
|
|---|---|---|---|
|
|
48
48
|
| `variant` | `"panel" \| "mini" \| "stat-trend" \| "split" \| "cta" \| "list" \| "cover"` | `"panel"` | Structural template: titled block with zones (`panel`), KPI tiles, a call to action, a list or a cover tile. |
|
|
49
49
|
| `flat` | `boolean` | `false` | No raised shadow: a flat tile for dense grids. |
|
|
50
|
+
| `loading` | `boolean` | `false` | The KPI is loading: `Card.Value`, `Card.Delta` and `Card.Meta` show a Skeleton in their own geometry and the root sets `aria-busy`; the data fades in when it arrives. Labels and titles stay. |
|
|
50
51
|
| `asChild` | `boolean` | `false` | The whole card is one link or button: pass that element as the only child with the parts inside it; it gets hover, press and the focus ring. Nothing interactive may sit inside it. |
|
|
51
52
|
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `className`, `role` + `aria-labelledby` for a landmark block, and the other div attributes. |
|
|
52
53
|
|
|
@@ -101,7 +102,7 @@ Card.Root asChild <a> or <button> (the only child) holding the pa
|
|
|
101
102
|
| `…rest` | `HTMLAttributes<HTMLElement>` | — | `children`, `className` and the other attributes of the element. |
|
|
102
103
|
|
|
103
104
|
### Card.Label · Card.Value
|
|
104
|
-
`ref` → `HTMLSpanElement`. Metric text: the label (body-s,
|
|
105
|
+
`ref` → `HTMLSpanElement`. Metric text: the label (body-s; truncates, wraps in a `mini` tile and a `split` cell) and the value (tabular, sized by the template and the card width).
|
|
105
106
|
|
|
106
107
|
| Prop | Type | Default | Description |
|
|
107
108
|
|---|---|---|---|
|
|
@@ -154,6 +155,7 @@ Card.Root asChild <a> or <button> (the only child) holding the pa
|
|
|
154
155
|
| Value | Looks like | Use when | Default |
|
|
155
156
|
|---|---|---|---|
|
|
156
157
|
| `flat` | same fill, no shadow | dense grids of tiles | `false` |
|
|
158
|
+
| `loading` | `Card.Value`, `Card.Delta` and `Card.Meta` hold a Skeleton in their own geometry (the value a bar one line of its role high); the data fades in under the same element | a KPI waits for its report | `false` |
|
|
157
159
|
| `asChild` | the card is the link or button it wraps: lifts on hover (raised → overlay shadow), presses, focus ring | the whole tile opens its details | `false` |
|
|
158
160
|
|
|
159
161
|
## States
|
|
@@ -161,6 +163,7 @@ Card.Root asChild <a> or <button> (the only child) holding the pa
|
|
|
161
163
|
|---|---|---|
|
|
162
164
|
| template | `variant` | `data-variant` |
|
|
163
165
|
| flat | `flat` | `data-flat` |
|
|
166
|
+
| loading | `loading` | `aria-busy` on the root; `data-loading` on `Card.Value`, `Card.Delta`, `Card.Meta`, each holding a `Skeleton`; on `false` the data fades in (`useSwapIn`, foundation §1 rule 7) |
|
|
164
167
|
| depth | nesting: one above the nearest surface (the page and the AppShell panel are 0) | `data-depth` (`1`–`4`, `floating-1`/`floating-2` inside a floating layer); the fill is `--prime-color-layer-current`, the shadow only at depth 1 |
|
|
165
168
|
| card width | container queries | `split` stacks below 22rem, `Header` wraps below 22rem (a header control under its description), the `stat-trend` value changes at 20rem / 36rem |
|
|
166
169
|
| hover | `asChild`, a fine pointer | the fill stays (a whole surface never changes its fill, foundation §8); the shadow lifts to `--prime-shadow-overlay` over `fast` |
|
|
@@ -170,11 +173,11 @@ Card.Root asChild <a> or <button> (the only child) holding the pa
|
|
|
170
173
|
Without `asChild` a card is static: no hover, focus or press of its own. With it: `data-interactive` on the element.
|
|
171
174
|
|
|
172
175
|
## Layout & spacing
|
|
173
|
-
- Cards on a page: one `
|
|
176
|
+
- Cards on a page: one `Page.Grid` with a `Page.Cell span` per card (16 on both axes, the cards of a row share one height); a grid inside one block is the block's own intrinsic `auto-fill` grid on the tile width of the layout tokens (a lone card keeps its column width), gap `--prime-space-4`.
|
|
174
177
|
- Radius `--prime-card-radius`, no border. In `panel` and `list` the `Header` is a padded zone with a faint inset hairline below; in `stat-trend` it can pair a leading Badge or icon with a compact `Card.Value`.
|
|
175
178
|
- Padding `--prime-card-padding-m` (20); `Body` gap `--prime-card-gap` (16); fields inside `Body` 20 apart, one ladder step off the card.
|
|
176
179
|
- Depth comes from nesting (foundation §4): on the page — the AppShell panel is the page — a card is layer 1 (white in light) with the raised whisper; inside another card it is the next layer, a flat tile. The ladder stops at layer 4.
|
|
177
|
-
- Long values wrap
|
|
180
|
+
- Long values wrap; labels truncate, except in a `mini` tile and a `split` cell, where a label beside the icon wraps instead; a chart SVG needs a CSS height.
|
|
178
181
|
- In a `Header` the title takes the free width; a control or a caption after it sits at the end without a wrapper. A `Card.Description` in the header stacks under the title, 4 apart; the control stays at the end, centred on both lines.
|
|
179
182
|
- `Card.Meta` in `stat-trend` takes the bottom of the tile (`margin-top: auto`), so tiles of one row line their meta up; in `mini` and a `split` cell it sits in the text column under the value.
|
|
180
183
|
|
|
@@ -195,6 +198,7 @@ Without `asChild` a card is static: no hover, focus or press of its own. With it
|
|
|
195
198
|
- `Card.Root` is a plain `<div>`; give it `role="region"` + `aria-labelledby` only when it is a landmark-worthy block.
|
|
196
199
|
- `Card.Title` renders `<h3>`; directly under the page title pass `as="h2"`.
|
|
197
200
|
- Decorative icons in `Card.Icon` and cover images in `Card.Media` get `aria-hidden`; controls in `Card.Header` need their own names.
|
|
201
|
+
- A `loading` card sets `aria-busy` on its root; the Skeletons are decorative (`aria-hidden`).
|
|
198
202
|
|
|
199
203
|
### Labels
|
|
200
204
|
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
@@ -211,12 +215,13 @@ No `labels`.
|
|
|
211
215
|
| [interactive.tsx](examples/interactive.tsx) | Whole cards as links to their reports: one tab stop each, a lift on hover, a press and the focus ring — `asChild`. |
|
|
212
216
|
| [content-templates.tsx](examples/content-templates.tsx) | Content templates: a call to action, an events list and a campaign tile with a cover — `Card.Footer`, `Card.List`, `Card.Media`. |
|
|
213
217
|
| [flat.tsx](examples/flat.tsx) | A flat tile without the raised shadow next to the default one, for dense grids — `flat`. |
|
|
218
|
+
| [states.tsx](examples/states.tsx) | A KPI tile while its report loads next to the loaded one, in the `stat-trend` and `mini` templates — `loading`. |
|
|
214
219
|
| [narrow.tsx](examples/narrow.tsx) | The card is a size container: the split template stacks its cells below 22rem and the trend value shrinks below 20rem — `variant`. |
|
|
215
|
-
| [screen.tsx](examples/screen.tsx) | A dashboard: the title
|
|
220
|
+
| [screen.tsx](examples/screen.tsx) | A dashboard: the title and a line of data in the page flow, the period switch and the report in the top bar that keeps the title once it scrolls away; one grid of KPI tiles that cross-fade to the new period, a revenue trend, invoiced against paid beside two panels, and the latest payments with a link to the list — `collapse`, `Page.Grid`. |
|
|
216
221
|
|
|
217
222
|
## Mistakes
|
|
218
223
|
- A `<div>` with a border styled as a card → use `Card.Root`; depth comes from fill, not lines.
|
|
219
|
-
- Wrapping every page section in a card → use
|
|
224
|
+
- Wrapping every page section in a card → use `Page.Section`.
|
|
220
225
|
- `Card.Delta tone="success"` for every «+» → choose the tone by meaning.
|
|
221
226
|
- Custom padding on a `panel` root → padding belongs to `Header` / `Body` / `Footer`.
|
|
222
227
|
- A wrapper `<div>` around the label and the value of `mini` → put `Icon`, `Label`, `Value` straight into the root (or into a `split` cell); the template lays them out.
|
|
@@ -225,7 +230,8 @@ No `labels`.
|
|
|
225
230
|
- A clickable `<div>` card with `onClick` → `asChild` with a real `<a href>` (Cmd-click, a new tab) or a `<button>`.
|
|
226
231
|
- Buttons or links inside an `asChild` card → nested interactive elements; move them out of the card.
|
|
227
232
|
- The reference figures written into `Card.Delta` or `Card.Label` → `Card.Meta`.
|
|
233
|
+
- Skeletons placed by hand inside `Card.Value` → `Card.Root loading`; keep the parts mounted while loading so each holds its place.
|
|
228
234
|
|
|
229
235
|
## Related
|
|
230
|
-
- **Built from:**
|
|
231
|
-
- **See also:** [
|
|
236
|
+
- **Built from:** [Skeleton](../skeleton/COMPONENT.md)
|
|
237
|
+
- **See also:** [Page](../../layout/page/COMPONENT.md), [DescriptionList](../description-list/COMPONENT.md) (record details inside a `Card.Body`), [Fieldset](../fieldset/COMPONENT.md) (groups of fields inside a settings card), [DataTable](../data-table/COMPONENT.md), [Badge](../badge/COMPONENT.md), [ProgressBar](../progress-bar/COMPONENT.md), [SegmentedControl](../segmented-control/COMPONENT.md), [Sparkline](../sparkline/COMPONENT.md) (a trend with its total inside a `panel`), [ChartFrame](../chart-frame/COMPONENT.md) (a full chart with legend and states)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/** A dashboard: the title
|
|
1
|
+
/** A dashboard: the title and a line of data in the page flow, the period switch and the report in the top bar that keeps the title once it scrolls away; one grid of KPI tiles that cross-fade to the new period, a revenue trend, invoiced against paid beside two panels, and the latest payments with a link to the list — `collapse`, `Page.Grid`. */
|
|
2
2
|
import {
|
|
3
|
-
AppHeader,
|
|
4
3
|
Badge,
|
|
5
4
|
Button,
|
|
6
5
|
Card,
|
|
@@ -12,8 +11,7 @@ import {
|
|
|
12
11
|
type DataTableColumn,
|
|
13
12
|
Icon,
|
|
14
13
|
LinkButton,
|
|
15
|
-
|
|
16
|
-
PageToolbar,
|
|
14
|
+
Page,
|
|
17
15
|
ProgressBar,
|
|
18
16
|
type ProgressSegment,
|
|
19
17
|
SegmentedControl,
|
|
@@ -158,206 +156,194 @@ export default function CardScreenExample() {
|
|
|
158
156
|
const [period, setPeriod] = React.useState<Period>("month");
|
|
159
157
|
|
|
160
158
|
return (
|
|
161
|
-
|
|
162
|
-
{/*
|
|
163
|
-
|
|
164
|
-
<
|
|
165
|
-
<
|
|
166
|
-
<
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
<
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
159
|
+
<Page.Root>
|
|
160
|
+
{/* An overview: the large title in the flow; the bar keeps the period and the report in
|
|
161
|
+
reach and repeats the title once it scrolls away. */}
|
|
162
|
+
<Page.TopBar collapse>
|
|
163
|
+
<Page.Tools>
|
|
164
|
+
<SegmentedControl.Root
|
|
165
|
+
aria-label="Период"
|
|
166
|
+
value={period}
|
|
167
|
+
onValueChange={(next) => setPeriod(next as Period)}
|
|
168
|
+
>
|
|
169
|
+
<SegmentedControl.Item value="week">Неделя</SegmentedControl.Item>
|
|
170
|
+
<SegmentedControl.Item value="month">Месяц</SegmentedControl.Item>
|
|
171
|
+
<SegmentedControl.Item value="quarter">Квартал</SegmentedControl.Item>
|
|
172
|
+
</SegmentedControl.Root>
|
|
173
|
+
</Page.Tools>
|
|
174
|
+
<Page.Actions>
|
|
175
|
+
<Button.Root variant="soft" tone="neutral">
|
|
176
|
+
<Button.Icon>
|
|
177
|
+
<Icon name="action.download" />
|
|
178
|
+
</Button.Icon>
|
|
179
|
+
Отчёт
|
|
180
|
+
</Button.Root>
|
|
181
|
+
</Page.Actions>
|
|
182
|
+
</Page.TopBar>
|
|
183
|
+
<Page.Header>
|
|
184
|
+
<Page.Heading>
|
|
185
|
+
<Page.Title>Обзор</Page.Title>
|
|
186
|
+
<Page.Description>Продажи и оплаты · на 8 октября, 9:40</Page.Description>
|
|
187
|
+
</Page.Heading>
|
|
188
|
+
</Page.Header>
|
|
189
|
+
<Page.Body>
|
|
190
|
+
{/* One board: every tile of the screen in one grid, 16 apart on both axes. */}
|
|
191
|
+
<Page.Grid>
|
|
192
|
+
{KPIS[period].map((kpi) => (
|
|
193
|
+
<Page.Cell key={kpi.label} span={3}>
|
|
194
|
+
{/* Another period is another set of values: the tile cross-fades instead of flipping. */}
|
|
195
|
+
<Crossfade state={period}>
|
|
196
|
+
<Card.Root variant="stat-trend">
|
|
197
|
+
<Card.Label>{kpi.label}</Card.Label>
|
|
198
|
+
<Card.Value>{kpi.value}</Card.Value>
|
|
199
|
+
<Card.Delta tone={kpi.tone}>{kpi.delta}</Card.Delta>
|
|
200
|
+
</Card.Root>
|
|
201
|
+
</Crossfade>
|
|
202
|
+
</Page.Cell>
|
|
203
|
+
))}
|
|
195
204
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
</Card.Root>
|
|
209
|
-
</Crossfade>
|
|
210
|
-
</PageContent.Cell>
|
|
211
|
-
))}
|
|
212
|
-
|
|
213
|
-
<PageContent.Cell>
|
|
214
|
-
<Card.Root variant="panel">
|
|
215
|
-
<Card.Body>
|
|
216
|
-
<Sparkline
|
|
217
|
-
data={REVENUE[period]}
|
|
218
|
-
label="Выручка по дням"
|
|
219
|
-
summary="sum"
|
|
220
|
-
formatValue={formatRubles}
|
|
221
|
-
/>
|
|
222
|
-
</Card.Body>
|
|
223
|
-
</Card.Root>
|
|
224
|
-
</PageContent.Cell>
|
|
205
|
+
<Page.Cell>
|
|
206
|
+
<Card.Root variant="panel">
|
|
207
|
+
<Card.Body>
|
|
208
|
+
<Sparkline
|
|
209
|
+
data={REVENUE[period]}
|
|
210
|
+
label="Выручка по дням"
|
|
211
|
+
summary="sum"
|
|
212
|
+
formatValue={formatRubles}
|
|
213
|
+
/>
|
|
214
|
+
</Card.Body>
|
|
215
|
+
</Card.Root>
|
|
216
|
+
</Page.Cell>
|
|
225
217
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
218
|
+
{/* The chart spans two rows beside the two panels and fills their height. */}
|
|
219
|
+
<Page.Cell span={8} rows={2}>
|
|
220
|
+
<ChartFrame.Root
|
|
221
|
+
series={BILLING_SERIES}
|
|
222
|
+
formatValue={formatMillionsShort}
|
|
223
|
+
rows={BILLING[period].map((row) => ({
|
|
224
|
+
label: row.label,
|
|
225
|
+
values: { invoiced: row.invoiced, paid: row.paid },
|
|
226
|
+
}))}
|
|
227
|
+
>
|
|
228
|
+
<ChartFrame.Header>
|
|
229
|
+
<ChartFrame.Title as="h2">Выставлено и оплачено</ChartFrame.Title>
|
|
230
|
+
<ChartFrame.Description>Счета за период, млн ₽</ChartFrame.Description>
|
|
231
|
+
</ChartFrame.Header>
|
|
232
|
+
<ChartFrame.Plot
|
|
233
|
+
height="fill"
|
|
234
|
+
renderPlot={({ width, height, series }) => {
|
|
235
|
+
const rows = BILLING[period];
|
|
236
|
+
const top = Math.ceil(Math.max(...rows.map((row) => row.invoiced)));
|
|
237
|
+
const innerH = height - BILLING_MARGIN.top - BILLING_MARGIN.bottom;
|
|
238
|
+
const band = (width - BILLING_MARGIN.left) / rows.length;
|
|
239
|
+
const bar = Math.min(28, (band - 16) / series.length);
|
|
240
|
+
const y = (value: number) => BILLING_MARGIN.top + innerH * (1 - value / top);
|
|
241
|
+
return (
|
|
242
|
+
<svg width={width} height={height} aria-hidden="true">
|
|
243
|
+
{[0, top / 2, top].map((tick) => (
|
|
244
|
+
<g key={tick}>
|
|
245
|
+
<line
|
|
246
|
+
x1={BILLING_MARGIN.left}
|
|
247
|
+
x2={width}
|
|
248
|
+
y1={y(tick)}
|
|
249
|
+
y2={y(tick)}
|
|
250
|
+
stroke={tick === 0 ? chartColors.axis : chartColors.grid}
|
|
251
|
+
/>
|
|
252
|
+
<text
|
|
253
|
+
x={BILLING_MARGIN.left - 8}
|
|
254
|
+
y={y(tick)}
|
|
255
|
+
textAnchor="end"
|
|
256
|
+
dominantBaseline="middle"
|
|
257
|
+
>
|
|
258
|
+
{tick.toLocaleString("ru-RU")}
|
|
259
|
+
</text>
|
|
260
|
+
</g>
|
|
261
|
+
))}
|
|
262
|
+
{rows.map((row, i) => {
|
|
263
|
+
const center = BILLING_MARGIN.left + band * i + band / 2;
|
|
264
|
+
return (
|
|
265
|
+
<g key={row.label}>
|
|
266
|
+
{series.map((s, j) => {
|
|
267
|
+
const value = s.id === "paid" ? row.paid : row.invoiced;
|
|
268
|
+
return (
|
|
269
|
+
<rect
|
|
270
|
+
key={s.id}
|
|
271
|
+
data-hidden={s.hidden}
|
|
272
|
+
x={center - (bar * series.length) / 2 + bar * j}
|
|
273
|
+
y={y(value)}
|
|
274
|
+
width={bar - 2}
|
|
275
|
+
height={y(0) - y(value)}
|
|
276
|
+
rx={2}
|
|
277
|
+
fill={s.color}
|
|
278
|
+
/>
|
|
279
|
+
);
|
|
280
|
+
})}
|
|
281
|
+
<text x={center} y={height - 4} textAnchor="middle">
|
|
282
|
+
{row.label}
|
|
267
283
|
</text>
|
|
268
284
|
</g>
|
|
269
|
-
)
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
key={s.id}
|
|
279
|
-
data-hidden={s.hidden}
|
|
280
|
-
x={center - (bar * series.length) / 2 + bar * j}
|
|
281
|
-
y={y(value)}
|
|
282
|
-
width={bar - 2}
|
|
283
|
-
height={y(0) - y(value)}
|
|
284
|
-
rx={2}
|
|
285
|
-
fill={s.color}
|
|
286
|
-
/>
|
|
287
|
-
);
|
|
288
|
-
})}
|
|
289
|
-
<text x={center} y={height - 4} textAnchor="middle">
|
|
290
|
-
{row.label}
|
|
291
|
-
</text>
|
|
292
|
-
</g>
|
|
293
|
-
);
|
|
294
|
-
})}
|
|
295
|
-
</svg>
|
|
296
|
-
);
|
|
297
|
-
}}
|
|
298
|
-
/>
|
|
299
|
-
<ChartFrame.Legend />
|
|
300
|
-
</ChartFrame.Root>
|
|
301
|
-
</PageContent.Cell>
|
|
285
|
+
);
|
|
286
|
+
})}
|
|
287
|
+
</svg>
|
|
288
|
+
);
|
|
289
|
+
}}
|
|
290
|
+
/>
|
|
291
|
+
<ChartFrame.Legend />
|
|
292
|
+
</ChartFrame.Root>
|
|
293
|
+
</Page.Cell>
|
|
302
294
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
295
|
+
<Page.Cell span={4}>
|
|
296
|
+
<Card.Root variant="panel">
|
|
297
|
+
<Card.Header>
|
|
298
|
+
<Card.Title as="h2">План продаж</Card.Title>
|
|
299
|
+
<Typography as="span" variant="caption" tone="muted">
|
|
300
|
+
Октябрь
|
|
301
|
+
</Typography>
|
|
302
|
+
</Card.Header>
|
|
303
|
+
<Card.Body>
|
|
304
|
+
<div className={styles.bars}>
|
|
305
|
+
{PLAN.map((row) => (
|
|
306
|
+
<ProgressBar
|
|
307
|
+
key={row.manager}
|
|
308
|
+
value={row.value}
|
|
309
|
+
label={row.manager}
|
|
310
|
+
tone={row.value < 50 ? "warning" : "accent"}
|
|
311
|
+
showValue
|
|
312
|
+
/>
|
|
313
|
+
))}
|
|
314
|
+
</div>
|
|
315
|
+
</Card.Body>
|
|
316
|
+
</Card.Root>
|
|
317
|
+
</Page.Cell>
|
|
326
318
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
319
|
+
<Page.Cell span={4}>
|
|
320
|
+
<Card.Root variant="panel">
|
|
321
|
+
<Card.Header>
|
|
322
|
+
<Card.Title as="h2">Дебиторка</Card.Title>
|
|
323
|
+
<Typography as="span" variant="caption" tone="muted">
|
|
324
|
+
8,2 млн ₽
|
|
325
|
+
</Typography>
|
|
326
|
+
</Card.Header>
|
|
327
|
+
<Card.Body>
|
|
328
|
+
<ProgressBar
|
|
329
|
+
segments={RECEIVABLES}
|
|
330
|
+
label="По сроку оплаты"
|
|
331
|
+
legend
|
|
332
|
+
formatValue={formatMillions}
|
|
333
|
+
/>
|
|
334
|
+
</Card.Body>
|
|
335
|
+
</Card.Root>
|
|
336
|
+
</Page.Cell>
|
|
337
|
+
</Page.Grid>
|
|
346
338
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
paging="none"
|
|
357
|
-
/>
|
|
358
|
-
</PageContent.Section>
|
|
359
|
-
</PageContent.Body>
|
|
360
|
-
</PageContent.Root>
|
|
361
|
-
</>
|
|
339
|
+
{/* A new topic: a titled section, set off by more air than the tiles. */}
|
|
340
|
+
<Page.Section label="Последние оплаты">
|
|
341
|
+
<Page.Actions>
|
|
342
|
+
<LinkButton href="#invoices">Все счета</LinkButton>
|
|
343
|
+
</Page.Actions>
|
|
344
|
+
<DataTable columns={COLUMNS} rows={PAYMENTS} getRowKey={(row) => row.id} paging="none" />
|
|
345
|
+
</Page.Section>
|
|
346
|
+
</Page.Body>
|
|
347
|
+
</Page.Root>
|
|
362
348
|
);
|
|
363
349
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** A KPI tile while its report loads next to the loaded one, in the `stat-trend` and `mini` templates — `loading`. */
|
|
2
|
+
import { Card, Icon, Typography } from "prime-ui-kit";
|
|
3
|
+
|
|
4
|
+
export default function CardStatesExample() {
|
|
5
|
+
return (
|
|
6
|
+
<>
|
|
7
|
+
<div>
|
|
8
|
+
<div>
|
|
9
|
+
<Card.Root variant="stat-trend" loading>
|
|
10
|
+
<Card.Label>Выручка за месяц</Card.Label>
|
|
11
|
+
<Card.Value />
|
|
12
|
+
<Card.Delta />
|
|
13
|
+
<Card.Meta />
|
|
14
|
+
</Card.Root>
|
|
15
|
+
<Typography as="span" variant="caption" tone="muted">
|
|
16
|
+
stat-trend · loading
|
|
17
|
+
</Typography>
|
|
18
|
+
</div>
|
|
19
|
+
<div>
|
|
20
|
+
<Card.Root variant="stat-trend">
|
|
21
|
+
<Card.Label>Выручка за месяц</Card.Label>
|
|
22
|
+
<Card.Value>4,2 млн ₽</Card.Value>
|
|
23
|
+
<Card.Delta tone="success">+18% к сентябрю</Card.Delta>
|
|
24
|
+
<Card.Meta>Лидов 1 240 · сделок 186</Card.Meta>
|
|
25
|
+
</Card.Root>
|
|
26
|
+
<Typography as="span" variant="caption" tone="muted">
|
|
27
|
+
stat-trend
|
|
28
|
+
</Typography>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div>
|
|
32
|
+
<div>
|
|
33
|
+
<Card.Root variant="mini" loading>
|
|
34
|
+
<Card.Icon>
|
|
35
|
+
<Icon name="object.users" />
|
|
36
|
+
</Card.Icon>
|
|
37
|
+
<Card.Label>Активные сессии</Card.Label>
|
|
38
|
+
<Card.Value />
|
|
39
|
+
</Card.Root>
|
|
40
|
+
<Typography as="span" variant="caption" tone="muted">
|
|
41
|
+
mini · loading
|
|
42
|
+
</Typography>
|
|
43
|
+
</div>
|
|
44
|
+
<div>
|
|
45
|
+
<Card.Root variant="mini">
|
|
46
|
+
<Card.Icon>
|
|
47
|
+
<Icon name="object.users" />
|
|
48
|
+
</Card.Icon>
|
|
49
|
+
<Card.Label>Активные сессии</Card.Label>
|
|
50
|
+
<Card.Value>1 248</Card.Value>
|
|
51
|
+
</Card.Root>
|
|
52
|
+
<Typography as="span" variant="caption" tone="muted">
|
|
53
|
+
mini
|
|
54
|
+
</Typography>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</>
|
|
58
|
+
);
|
|
59
|
+
}
|