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,82 @@
|
|
|
1
|
+
/** A deal bonus split between the team: the share takes a narrow column, and the totals row under the lines sums the shares and the amounts — `renderTotals`, `width`. */
|
|
2
|
+
import { FieldList, type FieldListColumn, Input } from "prime-ui-kit";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
type Share = { id: string; member: string; percent: string };
|
|
6
|
+
|
|
7
|
+
const BONUS = 240_000;
|
|
8
|
+
|
|
9
|
+
const COLUMNS: FieldListColumn[] = [
|
|
10
|
+
{ label: "Участник" },
|
|
11
|
+
{ label: "Доля", width: "xs" },
|
|
12
|
+
{ label: "Сумма", width: "m" },
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
const SHARES: Share[] = [
|
|
16
|
+
{ id: "sokolova", member: "Анна Соколова", percent: "50" },
|
|
17
|
+
{ id: "demin", member: "Олег Демин", percent: "30" },
|
|
18
|
+
{ id: "kotova", member: "Ирина Котова", percent: "20" },
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
const RUB = new Intl.NumberFormat("ru-RU", {
|
|
22
|
+
style: "currency",
|
|
23
|
+
currency: "RUB",
|
|
24
|
+
maximumFractionDigits: 0,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const percentOf = (share: Share) => Number(share.percent.replace(",", ".")) || 0;
|
|
28
|
+
|
|
29
|
+
export default function FieldListTotalsExample() {
|
|
30
|
+
const [shares, setShares] = React.useState(SHARES);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<FieldList
|
|
34
|
+
label="Бонус по сделке"
|
|
35
|
+
hint="Доли в сумме дают 100 %."
|
|
36
|
+
columns={COLUMNS}
|
|
37
|
+
value={shares}
|
|
38
|
+
onValueChange={setShares}
|
|
39
|
+
getId={(share) => share.id}
|
|
40
|
+
getLabel={(share) => share.member}
|
|
41
|
+
createItem={() => ({ id: crypto.randomUUID(), member: "", percent: "" })}
|
|
42
|
+
addLabel="Добавить участника"
|
|
43
|
+
renderItem={(share, row) => (
|
|
44
|
+
<>
|
|
45
|
+
<Input.Root>
|
|
46
|
+
<Input.Wrapper>
|
|
47
|
+
<Input.Field
|
|
48
|
+
value={share.member}
|
|
49
|
+
onChange={(event) => row.update({ member: event.target.value })}
|
|
50
|
+
/>
|
|
51
|
+
</Input.Wrapper>
|
|
52
|
+
</Input.Root>
|
|
53
|
+
<Input.Root>
|
|
54
|
+
<Input.Wrapper>
|
|
55
|
+
<Input.Field
|
|
56
|
+
value={share.percent}
|
|
57
|
+
inputMode="decimal"
|
|
58
|
+
onChange={(event) => row.update({ percent: event.target.value })}
|
|
59
|
+
/>
|
|
60
|
+
<Input.InlineAffix side="end">%</Input.InlineAffix>
|
|
61
|
+
</Input.Wrapper>
|
|
62
|
+
</Input.Root>
|
|
63
|
+
<Input.Root>
|
|
64
|
+
<Input.Wrapper>
|
|
65
|
+
<Input.Field value={RUB.format((BONUS * percentOf(share)) / 100)} readOnly />
|
|
66
|
+
</Input.Wrapper>
|
|
67
|
+
</Input.Root>
|
|
68
|
+
</>
|
|
69
|
+
)}
|
|
70
|
+
renderTotals={(items) => {
|
|
71
|
+
const percent = items.reduce((sum, share) => sum + percentOf(share), 0);
|
|
72
|
+
return (
|
|
73
|
+
<>
|
|
74
|
+
{null}
|
|
75
|
+
{`${percent} %`}
|
|
76
|
+
{RUB.format((BONUS * percent) / 100)}
|
|
77
|
+
</>
|
|
78
|
+
);
|
|
79
|
+
}}
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
## When not to use
|
|
15
15
|
- One choice among options with a heading → [Radio](../radio/COMPONENT.md) `Radio.Group label`, a [SegmentedControl](../segmented-control/COMPONENT.md) or [ButtonGroup](../button-group/COMPONENT.md) `label`.
|
|
16
16
|
- A bounded block with a surface (a settings panel) → [Card](../card/COMPONENT.md) `Card.Root`; a Fieldset inside it groups the fields.
|
|
17
|
-
- A page section with a title and actions → [
|
|
17
|
+
- A page section with a title and actions → [Page](../../layout/page/COMPONENT.md) sections (`Page.Section`).
|
|
18
18
|
- A group of settings with a title and a trailing control (a «Сбросить» button, a master switch) → `Card.Root variant="panel"` with `Card.Header` (`Card.Title` + the control) and the Fieldset in `Card.Body`, named by the title (`aria-labelledby`).
|
|
19
19
|
- A single field's label → the field's own `label`.
|
|
20
20
|
|
|
@@ -14,7 +14,7 @@ export default function FieldsetStatesExample() {
|
|
|
14
14
|
<Fieldset label="Сделка" disabled={state.disabled}>
|
|
15
15
|
<Input.Root label="Название">
|
|
16
16
|
<Input.Wrapper>
|
|
17
|
-
<Input.Field defaultValue="
|
|
17
|
+
<Input.Field defaultValue="Лицензия, 40 мест" />
|
|
18
18
|
</Input.Wrapper>
|
|
19
19
|
</Input.Root>
|
|
20
20
|
<SegmentedControl.Root label="Тип" defaultValue="new">
|
|
@@ -120,6 +120,7 @@ A rejection of `upload` fails the file with its message as the reason; retry que
|
|
|
120
120
|
| `required` | `boolean` | — | Red `*` after the label and native `required` on the input. |
|
|
121
121
|
| `optional` | `boolean` | — | Muted marker right after the label text (`labels.optional`). |
|
|
122
122
|
| `hint` | `ReactNode` | — | Help text under the field. Hidden while `error` is shown. |
|
|
123
|
+
| `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. |
|
|
123
124
|
| `error` | `ReactNode` | — | Error message under the field (a rejected file, too few files); implies `invalid`. |
|
|
124
125
|
| `invalid` | `boolean` | — | Danger line and icon of the zone, `aria-invalid` on the input. A non-empty `error` implies it. |
|
|
125
126
|
| `focusRing` | `boolean` | `true` | `false` hides only the visual focus ring of the drop zone and the add tile (`data-focus-ring="false"`); focus, keyboard and ARIA stay. The picker Button keeps its ring. |
|
|
@@ -424,7 +425,7 @@ Also `data-size`, `data-variant` on the zone, `data-size` on Item, `data-status`
|
|
|
424
425
|
| [controlled.tsx](examples/controlled.tsx) | Documents of a deal in one list: the files already on the server and new uploads after them, saved on every change, and a button brings back the saved set — `value`, `onValueChange`, `queue`. |
|
|
425
426
|
| [in-form.tsx](examples/in-form.tsx) | A contract upload form: submit checks the required scan, its error shakes in and leaves once a file is picked or removed — `required`, `error`, `name`, `value`. |
|
|
426
427
|
| [narrow.tsx](examples/narrow.tsx) | In a phone-width column the zone text wraps, a long file name truncates, and a gallery goes three across and then two, the cover keeping two columns and the remove buttons shown without hover — `layout`, `cover`. |
|
|
427
|
-
| [screen.tsx](examples/screen.tsx) | A media library of a catalog object as a work screen: the title, the object and a
|
|
428
|
+
| [screen.tsx](examples/screen.tsx) | A media library of a catalog object as a work screen: the title, the object and a toolbar with sections, search, order and upload in its top bar; uploads in FileUpload tiles through a queue; a grid of Thumbnails that open MediaViewer out of the tile or are picked for bulk download and delete; a Skeleton first load and a filtered empty state in a Crossfade — `trigger`, `layout`. |
|
|
428
429
|
|
|
429
430
|
## Mistakes
|
|
430
431
|
- A `Label` and a `Hint` placed around the zone by hand → pass `label`, `hint`, `error`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* Media library: a work screen — the
|
|
2
|
-
out the library block only, the page rhythm comes from
|
|
1
|
+
/* Media library: a work screen — the page top bar carries the title and the tools; this module lays
|
|
2
|
+
out the library block only, the page rhythm comes from Page. */
|
|
3
3
|
|
|
4
4
|
.bar {
|
|
5
5
|
display: flex;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/** A media library of a catalog object as a work screen: the title, the object and a
|
|
1
|
+
/** A media library of a catalog object as a work screen: the title, the object and a toolbar with sections, search, order and upload in its top bar; uploads in FileUpload tiles through a queue; a grid of Thumbnails that open MediaViewer out of the tile or are picked for bulk download and delete; a Skeleton first load and a filtered empty state in a Crossfade — `trigger`, `layout`. */
|
|
2
2
|
import {
|
|
3
|
-
AppHeader,
|
|
4
3
|
Button,
|
|
5
4
|
ConfirmDialog,
|
|
6
5
|
Crossfade,
|
|
@@ -12,8 +11,7 @@ import {
|
|
|
12
11
|
Icon,
|
|
13
12
|
MediaViewer,
|
|
14
13
|
type MediaViewerItem,
|
|
15
|
-
|
|
16
|
-
PageToolbar,
|
|
14
|
+
Page,
|
|
17
15
|
SegmentedControl,
|
|
18
16
|
Select,
|
|
19
17
|
Skeleton,
|
|
@@ -365,76 +363,62 @@ export default function FileUploadScreenExample() {
|
|
|
365
363
|
const totalSize = visible.reduce((sum, media) => sum + media.size, 0);
|
|
366
364
|
|
|
367
365
|
return (
|
|
368
|
-
|
|
369
|
-
{
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
<Button.Root onClick={() => picker.current?.open()}>
|
|
425
|
-
<Button.Icon>
|
|
426
|
-
<Icon name="action.upload" />
|
|
427
|
-
</Button.Icon>
|
|
428
|
-
Загрузить
|
|
429
|
-
</Button.Root>
|
|
430
|
-
</PageToolbar.Actions>
|
|
431
|
-
</PageToolbar.Root>
|
|
432
|
-
</SmartFilter.Root>
|
|
433
|
-
</AppHeader.Tools>
|
|
434
|
-
</AppHeader.Root>
|
|
435
|
-
|
|
436
|
-
<PageContent.Root>
|
|
437
|
-
<PageContent.Body>
|
|
366
|
+
<SmartFilter.Root
|
|
367
|
+
fields={[]}
|
|
368
|
+
search={search}
|
|
369
|
+
onSearchChange={setSearch}
|
|
370
|
+
labels={{ searchPlaceholder: "Поиск по названию" }}
|
|
371
|
+
>
|
|
372
|
+
<Page.Root>
|
|
373
|
+
{/* A work screen titles itself in its top bar: the only h1, the object it belongs to, the
|
|
374
|
+
page's tools — sections, search, order — and the upload. */}
|
|
375
|
+
<Page.TopBar>
|
|
376
|
+
<Page.Heading>
|
|
377
|
+
<Page.Title>Медиатека</Page.Title>
|
|
378
|
+
<Page.Description>БЦ «Северная башня», Невский пр., 112</Page.Description>
|
|
379
|
+
</Page.Heading>
|
|
380
|
+
<Page.Tools aria-label="Медиатека">
|
|
381
|
+
<SegmentedControl.Root
|
|
382
|
+
value={section}
|
|
383
|
+
onValueChange={(value) => setSection(value as Section)}
|
|
384
|
+
aria-label="Раздел"
|
|
385
|
+
>
|
|
386
|
+
{SECTIONS.map((item) => (
|
|
387
|
+
<SegmentedControl.Item key={item.value} value={item.value}>
|
|
388
|
+
{item.label}
|
|
389
|
+
{loading ? null : (
|
|
390
|
+
<SegmentedControl.Count>{count(item.value)}</SegmentedControl.Count>
|
|
391
|
+
)}
|
|
392
|
+
</SegmentedControl.Item>
|
|
393
|
+
))}
|
|
394
|
+
</SegmentedControl.Root>
|
|
395
|
+
<SmartFilter.Toolbar />
|
|
396
|
+
<Select.Root value={order} onValueChange={(value) => setOrder(value as Order)}>
|
|
397
|
+
<Select.Trigger aria-label="Порядок">
|
|
398
|
+
<Select.TriggerIcon>
|
|
399
|
+
<Icon name="sort.descending" />
|
|
400
|
+
</Select.TriggerIcon>
|
|
401
|
+
<Select.Value />
|
|
402
|
+
</Select.Trigger>
|
|
403
|
+
<Select.Content>
|
|
404
|
+
{ORDERS.map((item) => (
|
|
405
|
+
<Select.Item key={item.value} value={item.value}>
|
|
406
|
+
{item.label}
|
|
407
|
+
</Select.Item>
|
|
408
|
+
))}
|
|
409
|
+
</Select.Content>
|
|
410
|
+
</Select.Root>
|
|
411
|
+
</Page.Tools>
|
|
412
|
+
<Page.Actions>
|
|
413
|
+
<Button.Root onClick={() => picker.current?.open()}>
|
|
414
|
+
<Button.Icon>
|
|
415
|
+
<Icon name="action.upload" />
|
|
416
|
+
</Button.Icon>
|
|
417
|
+
Загрузить
|
|
418
|
+
</Button.Root>
|
|
419
|
+
</Page.Actions>
|
|
420
|
+
</Page.TopBar>
|
|
421
|
+
<Page.Body>
|
|
438
422
|
{/* Uploads in flight: the add tile is also the drop zone; a done file moves into the grid. */}
|
|
439
423
|
<FileUpload.Root
|
|
440
424
|
label="Новые файлы"
|
|
@@ -447,7 +431,7 @@ export default function FileUploadScreenExample() {
|
|
|
447
431
|
picker={picker}
|
|
448
432
|
/>
|
|
449
433
|
|
|
450
|
-
<
|
|
434
|
+
<Page.Section
|
|
451
435
|
label="Файлы"
|
|
452
436
|
description={
|
|
453
437
|
<span aria-live="polite">
|
|
@@ -459,7 +443,7 @@ export default function FileUploadScreenExample() {
|
|
|
459
443
|
</span>
|
|
460
444
|
}
|
|
461
445
|
>
|
|
462
|
-
<
|
|
446
|
+
<Page.Actions>
|
|
463
447
|
<Crossfade state={selecting ? "select" : "browse"}>
|
|
464
448
|
{selecting ? (
|
|
465
449
|
<div className={styles.bar}>
|
|
@@ -509,7 +493,7 @@ export default function FileUploadScreenExample() {
|
|
|
509
493
|
</div>
|
|
510
494
|
)}
|
|
511
495
|
</Crossfade>
|
|
512
|
-
</
|
|
496
|
+
</Page.Actions>
|
|
513
497
|
|
|
514
498
|
<Crossfade state={state} aria-busy={loading}>
|
|
515
499
|
{loading ? (
|
|
@@ -621,7 +605,7 @@ export default function FileUploadScreenExample() {
|
|
|
621
605
|
</EmptyPage.Root>
|
|
622
606
|
) : null}
|
|
623
607
|
</Crossfade>
|
|
624
|
-
</
|
|
608
|
+
</Page.Section>
|
|
625
609
|
|
|
626
610
|
<MediaViewer
|
|
627
611
|
items={viewerItems}
|
|
@@ -641,8 +625,8 @@ export default function FileUploadScreenExample() {
|
|
|
641
625
|
</Button.Root>
|
|
642
626
|
)}
|
|
643
627
|
/>
|
|
644
|
-
</
|
|
645
|
-
</
|
|
646
|
-
|
|
628
|
+
</Page.Body>
|
|
629
|
+
</Page.Root>
|
|
630
|
+
</SmartFilter.Root>
|
|
647
631
|
);
|
|
648
632
|
}
|
|
@@ -97,6 +97,7 @@ Decided by the items, not a prop: the number of items and their ratios.
|
|
|
97
97
|
- Tiles are `--prime-gallery-gap` (2px) apart; the gaps are the gallery's own background, transparent by default (a host may paint it: a message paints the incoming surface).
|
|
98
98
|
- The outer corners are rounded (`--prime-radius-l`). A host that shapes and clips it itself (a message) passes `maxSize`: the gallery takes that length as its cap instead of its host's width and draws no radius of its own.
|
|
99
99
|
- At any width the album keeps its layout: tiles scale with the gallery, never rearrange.
|
|
100
|
+
- A video tile shorter than 6.5rem (a small tile of a phone album) has no room for the centred play mark under the length pill: it shows the length alone, so the two marks never collide.
|
|
100
101
|
|
|
101
102
|
## Accessibility
|
|
102
103
|
|
|
@@ -224,7 +224,7 @@ A `tone` wins over `color`. Say the status in the label too, never only by color
|
|
|
224
224
|
| [states.tsx](examples/states.tsx) | Skeleton rows in the chart's geometry while it loads, an empty period and a report you may only look at, its today line on the report day — `loading`, `empty`, `readOnly`, `today`. |
|
|
225
225
|
| [controlled.tsx](examples/controlled.tsx) | The zoom owned by the page: presets in the toolbar and the built-in switch change one state — `scale`, `onScaleChange`. |
|
|
226
226
|
| [narrow.tsx](examples/narrow.tsx) | At 360 px the first column keeps only the avatars, the toolbar moves to its own row and the axis scrolls under the pinned column — `renderRowAvatar`. |
|
|
227
|
-
| [screen.tsx](examples/screen.tsx) | A team schedule as a work screen: the title with the people shown and a
|
|
227
|
+
| [screen.tsx](examples/screen.tsx) | A team schedule as a work screen: the title with the people shown and a toolbar with search, filters, team sections and the primary action in its top bar over a full-height Gantt; moves saved or refused, new work drawn and named in a Modal, details in a Drawer — `scrollHeight`, `onBarChange`, `onBarCreate`, `onItemOpen`. |
|
|
228
228
|
|
|
229
229
|
## Mistakes
|
|
230
230
|
- Updating the rows before the request succeeds (optimistic) → the chart cannot glide back on reject; update them when `onBarChange` resolves, or before you resolve it.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* Schedule: a work screen — the header carries the title and the tools, the page fills the app
|
|
2
|
-
panel (`AppShell.Root fillViewport` + `
|
|
2
|
+
panel (`AppShell.Root fillViewport` + `Page.Root fill`) and the chart takes the free
|
|
3
3
|
height. */
|
|
4
4
|
|
|
5
5
|
/* On a short screen the chart keeps room for a few rows; the page scrolls instead. */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/** A team schedule as a work screen: the title with the people shown and a
|
|
1
|
+
/** A team schedule as a work screen: the title with the people shown and a toolbar with search, filters, team sections and the primary action in its top bar over a full-height Gantt; moves saved or refused, new work drawn and named in a Modal, details in a Drawer — `scrollHeight`, `onBarChange`, `onBarCreate`, `onItemOpen`. */
|
|
2
2
|
import {
|
|
3
|
-
AppHeader,
|
|
4
3
|
Avatar,
|
|
5
4
|
Badge,
|
|
6
5
|
Button,
|
|
@@ -17,8 +16,7 @@ import {
|
|
|
17
16
|
Input,
|
|
18
17
|
Modal,
|
|
19
18
|
matchesSmartFilter,
|
|
20
|
-
|
|
21
|
-
PageToolbar,
|
|
19
|
+
Page,
|
|
22
20
|
ProgressBar,
|
|
23
21
|
SegmentedControl,
|
|
24
22
|
Select,
|
|
@@ -441,73 +439,57 @@ export default function GanttScreenExample() {
|
|
|
441
439
|
const detail = selected?.bar;
|
|
442
440
|
|
|
443
441
|
return (
|
|
444
|
-
|
|
445
|
-
{
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
442
|
+
<SmartFilter.Root
|
|
443
|
+
fields={FIELDS}
|
|
444
|
+
value={filter}
|
|
445
|
+
onValueChange={setFilter}
|
|
446
|
+
search={search}
|
|
447
|
+
onSearchChange={setSearch}
|
|
448
|
+
>
|
|
449
|
+
<Page.Root fill>
|
|
450
|
+
{/* A work screen titles itself in its top bar: the only h1, the teams, the search and the
|
|
451
|
+
filters, the one primary action. */}
|
|
452
|
+
<Page.TopBar>
|
|
453
|
+
<Page.Heading>
|
|
454
|
+
<Page.Title>Загрузка команды</Page.Title>
|
|
455
|
+
<Page.Description>
|
|
452
456
|
{loading ? "Загружаем график…" : `Сотрудников: ${rows.length} из ${people.length}`}
|
|
453
|
-
</
|
|
454
|
-
</
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
<Button.Root
|
|
490
|
-
onClick={() => {
|
|
491
|
-
setErrors({});
|
|
492
|
-
setDraft({ personId: null, dates: null });
|
|
493
|
-
}}
|
|
494
|
-
>
|
|
495
|
-
<Button.Icon>
|
|
496
|
-
<Icon name="action.add" />
|
|
497
|
-
</Button.Icon>
|
|
498
|
-
Назначить
|
|
499
|
-
</Button.Root>
|
|
500
|
-
</PageToolbar.Actions>
|
|
501
|
-
<PageToolbar.Chips>
|
|
502
|
-
<SmartFilter.Chips />
|
|
503
|
-
</PageToolbar.Chips>
|
|
504
|
-
</PageToolbar.Root>
|
|
505
|
-
</SmartFilter.Root>
|
|
506
|
-
</AppHeader.Tools>
|
|
507
|
-
</AppHeader.Root>
|
|
508
|
-
|
|
509
|
-
<PageContent.Root fill>
|
|
510
|
-
<PageContent.Body>
|
|
457
|
+
</Page.Description>
|
|
458
|
+
</Page.Heading>
|
|
459
|
+
<Page.Tools aria-label="Загрузка команды">
|
|
460
|
+
<SegmentedControl.Root value={team} onValueChange={setTeam} aria-label="Команда">
|
|
461
|
+
<SegmentedControl.Item value="all">
|
|
462
|
+
Все<SegmentedControl.Count>{people.length}</SegmentedControl.Count>
|
|
463
|
+
</SegmentedControl.Item>
|
|
464
|
+
{TEAMS.map((item) => (
|
|
465
|
+
<SegmentedControl.Item key={item.value} value={item.value}>
|
|
466
|
+
{item.label}
|
|
467
|
+
<SegmentedControl.Count>
|
|
468
|
+
{people.filter((person) => person.team === item.value).length}
|
|
469
|
+
</SegmentedControl.Count>
|
|
470
|
+
</SegmentedControl.Item>
|
|
471
|
+
))}
|
|
472
|
+
</SegmentedControl.Root>
|
|
473
|
+
<SmartFilter.Toolbar />
|
|
474
|
+
</Page.Tools>
|
|
475
|
+
<Page.Actions>
|
|
476
|
+
<Button.Root
|
|
477
|
+
onClick={() => {
|
|
478
|
+
setErrors({});
|
|
479
|
+
setDraft({ personId: null, dates: null });
|
|
480
|
+
}}
|
|
481
|
+
>
|
|
482
|
+
<Button.Icon>
|
|
483
|
+
<Icon name="action.add" />
|
|
484
|
+
</Button.Icon>
|
|
485
|
+
Назначить
|
|
486
|
+
</Button.Root>
|
|
487
|
+
</Page.Actions>
|
|
488
|
+
<Page.Chips>
|
|
489
|
+
<SmartFilter.Chips />
|
|
490
|
+
</Page.Chips>
|
|
491
|
+
</Page.TopBar>
|
|
492
|
+
<Page.Body>
|
|
511
493
|
<Gantt<Person, Assignment>
|
|
512
494
|
aria-label="Загрузка команды внедрения"
|
|
513
495
|
className={styles.chart}
|
|
@@ -719,8 +701,8 @@ export default function GanttScreenExample() {
|
|
|
719
701
|
</Drawer.Footer>
|
|
720
702
|
</Drawer.Content>
|
|
721
703
|
</Drawer.Root>
|
|
722
|
-
</
|
|
723
|
-
</
|
|
724
|
-
|
|
704
|
+
</Page.Body>
|
|
705
|
+
</Page.Root>
|
|
706
|
+
</SmartFilter.Root>
|
|
725
707
|
);
|
|
726
708
|
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
## When to use
|
|
9
9
|
- Under a control without `hint` / `error` props (an embedded `Datepicker.Panel`, a custom control), where you wire the ids yourself: format rules, limits, where the value comes from.
|
|
10
10
|
- As the error message of such a control (`invalid`), in the same slot as the hint.
|
|
11
|
+
- A status the field's value has (a deadline that nears, a check that passed): `tone`, with the status in the words.
|
|
11
12
|
|
|
12
13
|
## When not to use
|
|
13
14
|
- Input, Textarea, Select, Checkbox, Slider, SegmentedControl and other fields with `hint` / `error` props → pass the props; they render Hint and link the ids ([Input](../input/COMPONENT.md), [Textarea](../textarea/COMPONENT.md), [Checkbox](../checkbox/COMPONENT.md), [Slider](../slider/COMPONENT.md)).
|
|
@@ -36,6 +37,7 @@ Hint.Root <p> with the text
|
|
|
36
37
|
| Prop | Type | Default | Description |
|
|
37
38
|
|---|---|---|---|
|
|
38
39
|
| `size` | `"xs" \| "s" \| "m" \| "l" \| "xl"` | host tier, else `"m"` | Tier of the paired field: 12/16 for xs–m, 13/20 for l and xl. Without it the tier of its host, else `m`. |
|
|
40
|
+
| `tone` | `"neutral" \| "success" \| "warning" \| "danger"` | `"neutral"` | Status color of the text (a deadline that nears, a check that passed). The words carry the status, the color repeats it; `invalid` and `disabled` take over the color. |
|
|
39
41
|
| `invalid` | `boolean` | `false` | Error styling: danger text that drops in (fade + 4 px from above). |
|
|
40
42
|
| `disabled` | `boolean` | `false` | Disabled text color, next to a disabled control. A disabled `Fieldset` around the hint sets it too. |
|
|
41
43
|
| `children` | `ReactNode` | — | Text, optionally with `Hint.Icon` first. |
|
|
@@ -49,7 +51,15 @@ Hint.Root <p> with the text
|
|
|
49
51
|
| `…rest` | `HTMLAttributes<HTMLSpanElement>` | — | `children` (the glyph), `className` and the other span attributes. |
|
|
50
52
|
|
|
51
53
|
## Variants
|
|
52
|
-
|
|
54
|
+
### tone
|
|
55
|
+
| Value | Looks like | Use when | Default |
|
|
56
|
+
|---|---|---|---|
|
|
57
|
+
| `neutral` | Muted text | Format rules, limits, where the value comes from | yes |
|
|
58
|
+
| `success` | Success text | The value passed a check («ИНН проверен») | |
|
|
59
|
+
| `warning` | Warning text | The value needs attention soon («Осталось 12 дней») | |
|
|
60
|
+
| `danger` | Danger text, no `aria-invalid` | A status of the data, not a validation error («Срок истёк») | |
|
|
61
|
+
|
|
62
|
+
The words carry the status; the color only repeats it, and a `Hint.Icon` with the status glyph adds a shape. A validation error is `invalid` (or a field's `error`), never `tone="danger"`. `invalid` and `disabled` take over the tone's color.
|
|
53
63
|
|
|
54
64
|
### size
|
|
55
65
|
| Value | Looks like | Use when | Default |
|
|
@@ -68,11 +78,12 @@ The hint is always smaller than the field text; use the field's size.
|
|
|
68
78
|
| `invalid` | Danger text, drops in | Validation error | `false` |
|
|
69
79
|
| `disabled` | Disabled text | Under a disabled control | `false` |
|
|
70
80
|
|
|
71
|
-
**Combinations** — one element switches between the hint text and the error text with `invalid` (no layout jump); a standalone hint that changes after an action stays mounted with `aria-live="polite"` (inside a field the frame does it). `invalid` and `disabled` together make no sense.
|
|
81
|
+
**Combinations** — one element switches between the hint text and the error text with `invalid` (no layout jump); a standalone hint that changes after an action stays mounted with `aria-live="polite"` (inside a field the frame does it). `invalid` and `disabled` together make no sense. A result of the whole form goes to a [Banner](../banner/COMPONENT.md), not a toned hint.
|
|
72
82
|
|
|
73
83
|
## States
|
|
74
84
|
| State | Driven by | DOM |
|
|
75
85
|
|---|---|---|
|
|
86
|
+
| status | `tone` | `data-tone` with the shared text tone (none for `neutral`, and none while `invalid` or `disabled`); the color eases between tones |
|
|
76
87
|
| error | `invalid` | `data-invalid="true"`; the message drops in over `fast` (fade + `--prime-space-1` from above, no shake, no layout shift) and the color eases from the hint color |
|
|
77
88
|
| disabled | `disabled`, or a disabled `Fieldset` around it | `data-disabled="true"` |
|
|
78
89
|
| size | `size`, else the host tier | `data-size` |
|
|
@@ -106,6 +117,7 @@ No `labels`.
|
|
|
106
117
|
| Example | Shows |
|
|
107
118
|
|---|---|
|
|
108
119
|
| [overview.tsx](examples/overview.tsx) | Help text under a calendar that has no hint of its own, linked to it through `id` and `aria-describedby` — `id`. |
|
|
120
|
+
| [variants.tsx](examples/variants.tsx) | Status hints whose words carry the status and the color repeats it — `tone`. |
|
|
109
121
|
| [sizes.tsx](examples/sizes.tsx) | Every size tier, one per field tier: 12/16 for xs–m, 13/20 for l and xl — `size`. |
|
|
110
122
|
| [states.tsx](examples/states.tsx) | Default help text next to an error and a hint under a disabled control — `invalid`, `disabled`. |
|
|
111
123
|
| [with-icon.tsx](examples/with-icon.tsx) | A leading icon centred on the first line, in the default and the error state — `Hint.Icon`. |
|
|
@@ -116,6 +128,8 @@ No `labels`.
|
|
|
116
128
|
- A separate hint and error element at the same time → one element; the error replaces the hint.
|
|
117
129
|
- Hint without `id` + `aria-describedby` → the screen reader does not connect it to the field.
|
|
118
130
|
- Hint size different from the field size → use the same `size`, or none inside a sized host.
|
|
131
|
+
- `tone="danger"` for a validation error → `invalid` (or the field's `error`): only it sets `aria-invalid`.
|
|
132
|
+
- A status by color alone («12 д.» in orange) → the words say it («Осталось 12 дней»), the tone repeats it.
|
|
119
133
|
- `role="alert"` on a field error → none; the field frame announces it, a standalone hint takes `aria-live="polite"`.
|
|
120
134
|
|
|
121
135
|
## Related
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
/* Layout of the Hint scenarios: semantic tokens only. */
|
|
2
2
|
|
|
3
|
-
/*
|
|
3
|
+
/* hint-or-error.tsx: control → support row at the m-tier hint gap. */
|
|
4
4
|
.field {
|
|
5
5
|
display: grid;
|
|
6
6
|
justify-items: start;
|
|
7
7
|
gap: var(--prime-control-m-hint-gap);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
/* overview.tsx: the same pair in a 320 px column — an embedded calendar measures its container
|
|
11
|
+
for its month, so the column gives it one. */
|
|
12
|
+
.calendarField {
|
|
13
|
+
display: grid;
|
|
14
|
+
justify-items: start;
|
|
15
|
+
gap: var(--prime-control-m-hint-gap);
|
|
16
|
+
width: min(100%, calc(var(--prime-space-20) * 4));
|
|
17
|
+
}
|
|
18
|
+
|
|
10
19
|
.actions {
|
|
11
20
|
display: flex;
|
|
12
21
|
flex-wrap: wrap;
|