prime-ui-kit 0.15.0 → 0.16.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 +72 -63
- package/dist/chunks/{chunk-XJAVS6FH.js → chunk-4PSQ64S4.js} +3094 -1750
- package/dist/chunks/{chunk-THFZIHKU.js → chunk-6TPHKCUJ.js} +9392 -9225
- package/dist/chunks/{chunk-6TI4DSM5.js → chunk-A7OQWH6R.js} +1 -1
- package/dist/chunks/{chunk-2IKH55MI.js → chunk-HDBQICPW.js} +170 -138
- package/dist/chunks/{chunk-Q3BFRQHZ.js → chunk-U3Q2I3MY.js} +169 -10
- package/dist/color-picker.js +3 -3
- package/dist/components/accordion/Accordion.d.ts +52 -5
- package/dist/components/avatar/Avatar.d.ts +31 -8
- package/dist/components/badge/Badge.d.ts +93 -25
- package/dist/components/banner/Banner.d.ts +17 -10
- package/dist/components/breadcrumb/Breadcrumb.d.ts +18 -5
- package/dist/components/button/Button.d.ts +102 -43
- package/dist/components/button-group/ButtonGroup.d.ts +32 -8
- package/dist/components/card/Card.d.ts +15 -9
- package/dist/components/chart-frame/ChartFrame.d.ts +58 -51
- package/dist/components/chat/Chat.d.ts +77 -38
- package/dist/components/chat/ChatPinned.d.ts +20 -8
- package/dist/components/chat/ChatRows.d.ts +3 -0
- package/dist/components/chat/MessageList.d.ts +14 -19
- package/dist/components/chat/chatContext.d.ts +3 -3
- package/dist/components/chat/messageFlow.d.ts +1 -1
- package/dist/components/chat-list/ChatList.d.ts +88 -34
- package/dist/components/checkbox/Checkbox.d.ts +61 -12
- package/dist/components/code-block/CodeBlock.d.ts +11 -5
- package/dist/components/color-field/ColorField.d.ts +54 -14
- package/dist/components/color-picker/ColorPicker.d.ts +64 -30
- package/dist/components/color-picker/ColorPresets.d.ts +68 -13
- package/dist/components/color-swatches/ColorSwatches.d.ts +90 -18
- package/dist/components/command-menu/CommandMenu.d.ts +86 -27
- package/dist/components/composer/Composer.d.ts +82 -41
- package/dist/components/composer/useRecorder.d.ts +0 -2
- package/dist/components/confirm-dialog/ConfirmDialog.d.ts +40 -16
- package/dist/components/crossfade/Crossfade.d.ts +5 -8
- package/dist/components/data-table/ColumnsMenu.d.ts +6 -2
- package/dist/components/data-table/DataTable.d.ts +157 -58
- package/dist/components/data-table/Footer.d.ts +2 -4
- package/dist/components/data-table/Row.d.ts +1 -1
- package/dist/components/data-table/StateRows.d.ts +2 -2
- package/dist/components/data-table/reorder.d.ts +10 -10
- package/dist/components/data-table/types.d.ts +5 -0
- package/dist/components/data-table/useInfiniteRows.d.ts +3 -3
- package/dist/components/datepicker/Datepicker.d.ts +61 -12
- package/dist/components/datepicker/DatepickerPanel.d.ts +76 -16
- package/dist/components/datepicker/panelLayout.d.ts +6 -11
- package/dist/components/description-list/DescriptionList.d.ts +40 -11
- package/dist/components/digit-input/DigitInput.d.ts +50 -19
- package/dist/components/divider/Divider.d.ts +15 -5
- package/dist/components/dnd/Dnd.d.ts +152 -41
- package/dist/components/dnd/geometry.d.ts +0 -8
- package/dist/components/dnd/labels.d.ts +1 -1
- package/dist/components/dnd/useDropTarget.d.ts +0 -2
- package/dist/components/dnd/useSortableList.d.ts +6 -1
- package/dist/components/drawer/Drawer.d.ts +39 -18
- package/dist/components/dropdown/Dropdown.d.ts +90 -19
- package/dist/components/empty-page/EmptyPage.d.ts +14 -15
- package/dist/components/example-frame/ExampleFrame.d.ts +38 -8
- package/dist/components/field-list/FieldList.d.ts +57 -19
- package/dist/components/fieldset/Fieldset.d.ts +12 -7
- package/dist/components/file-upload/FileUpload.d.ts +119 -42
- package/dist/components/gallery/Gallery.d.ts +44 -16
- package/dist/components/gallery/layout.d.ts +4 -1
- package/dist/components/gantt/Gantt.d.ts +69 -34
- package/dist/components/gantt/GanttRow.d.ts +2 -2
- package/dist/components/hint/Hint.d.ts +10 -4
- package/dist/components/index.d.ts +19 -18
- package/dist/components/input/Input.d.ts +78 -25
- package/dist/components/kanban/Kanban.d.ts +64 -36
- package/dist/components/kbd/Kbd.d.ts +3 -1
- package/dist/components/label/Label.d.ts +33 -4
- package/dist/components/link-button/LinkButton.d.ts +40 -10
- package/dist/components/list/List.d.ts +48 -26
- package/dist/components/login-form/LoginForm.d.ts +66 -7
- package/dist/components/media-viewer/MediaViewer.d.ts +46 -18
- package/dist/components/media-viewer/physics.d.ts +0 -2
- package/dist/components/media-viewer/viewerEngine.d.ts +0 -1
- package/dist/components/message/Message.d.ts +27 -16
- package/dist/components/message/MessageCards.d.ts +49 -10
- package/dist/components/message/MessageFile.d.ts +19 -5
- package/dist/components/message/MessageParts.d.ts +44 -18
- package/dist/components/message/MessageReactionBar.d.ts +3 -1
- package/dist/components/message/MessageTyping.d.ts +10 -6
- package/dist/components/message/bubbleMorph.d.ts +2 -0
- package/dist/components/modal/Modal.d.ts +6 -6
- package/dist/components/native-select/NativeSelect.d.ts +22 -7
- package/dist/components/notification/Notification.d.ts +35 -11
- package/dist/components/notification/NotificationStore.d.ts +12 -3
- package/dist/components/page-content/PageContent.d.ts +56 -37
- package/dist/components/page-toolbar/PageToolbar.d.ts +7 -6
- package/dist/components/pagination/Pagination.d.ts +25 -6
- package/dist/components/popover/Popover.d.ts +54 -31
- package/dist/components/progress-bar/ProgressBar.d.ts +37 -12
- package/dist/components/progress-circle/ProgressCircle.d.ts +32 -13
- package/dist/components/radio/Radio.d.ts +58 -15
- package/dist/components/scroll-container/ScrollContainer.d.ts +28 -14
- package/dist/components/scroll-container/useScrollEdges.d.ts +1 -24
- package/dist/components/segmented-control/SegmentedControl.d.ts +73 -15
- package/dist/components/select/Select.d.ts +104 -30
- package/dist/components/select/SelectItem.d.ts +35 -8
- package/dist/components/select/selectContext.d.ts +7 -19
- package/dist/components/sheet/Sheet.d.ts +32 -15
- package/dist/components/skeleton/Skeleton.d.ts +9 -3
- package/dist/components/slider/Slider.d.ts +55 -15
- package/dist/components/smart-filter/SmartFilter.d.ts +39 -12
- package/dist/components/sparkline/Sparkline.d.ts +42 -19
- package/dist/components/spinner/Spinner.d.ts +11 -5
- package/dist/components/stepper/Stepper.d.ts +41 -19
- package/dist/components/switch/Switch.d.ts +37 -12
- package/dist/components/tabs/Tabs.d.ts +61 -18
- package/dist/components/tag-select/TagSelect.d.ts +74 -20
- package/dist/components/textarea/Textarea.d.ts +52 -25
- package/dist/components/thumbnail/Thumbnail.d.ts +50 -20
- package/dist/components/timeline/Timeline.d.ts +85 -66
- package/dist/components/tooltip/Tooltip.d.ts +47 -17
- package/dist/components/typography/Typography.d.ts +32 -6
- package/dist/components/video-note/VideoNote.d.ts +7 -1
- package/dist/{internal → components/visually-hidden}/VisuallyHidden.d.ts +5 -5
- package/dist/components/voice-player/VoicePlayer.d.ts +16 -3
- package/dist/hooks/breakpoints.d.ts +10 -0
- package/dist/hooks/floatingPosition.d.ts +42 -0
- package/dist/hooks/useDraft.d.ts +12 -0
- package/dist/hooks/useEdgeOverflow.d.ts +5 -3
- package/dist/hooks/useElementSize.d.ts +31 -0
- package/dist/hooks/useEnterConfirm.d.ts +2 -1
- package/dist/hooks/useImageStatus.d.ts +12 -5
- package/dist/hooks/useLoadMore.d.ts +28 -0
- package/dist/hooks/useMediaQuery.d.ts +1 -3
- package/dist/hooks/useMergedRefs.d.ts +10 -4
- package/dist/hooks/useModalLayer.d.ts +13 -7
- package/dist/hooks/usePosition.d.ts +4 -42
- package/dist/hooks/usePresence.d.ts +4 -7
- package/dist/hooks/useScrollRegion.d.ts +28 -0
- package/dist/hooks/useStableValue.d.ts +6 -0
- package/dist/hooks/useSwipeDismiss.d.ts +38 -17
- package/dist/hooks/useVirtualRows.d.ts +9 -3
- package/dist/icon-set.js +2 -2
- package/dist/icons/Icon.d.ts +1 -1
- package/dist/icons/glyph.d.ts +9 -2
- package/dist/index.css +1 -1
- package/dist/index.js +13 -3
- package/dist/internal/AnchorRectContext.d.ts +2 -1
- package/dist/internal/ChartTooltip.d.ts +1 -1
- package/dist/internal/CheckMark.d.ts +2 -2
- package/dist/internal/ChoiceField.d.ts +29 -10
- package/dist/internal/ControlSizeContext.d.ts +16 -0
- package/dist/internal/Disclosure.d.ts +38 -9
- package/dist/internal/FieldAction.d.ts +20 -12
- package/dist/internal/FieldCommit.d.ts +8 -11
- package/dist/internal/FieldFrame.d.ts +100 -21
- package/dist/internal/MenuGroup.d.ts +3 -1
- package/dist/internal/MorphText.d.ts +2 -1
- package/dist/internal/ProgressLegend.d.ts +3 -2
- package/dist/internal/RegionSwap.d.ts +41 -0
- package/dist/internal/RollingNumber.d.ts +10 -1
- package/dist/internal/RowAction.d.ts +26 -0
- package/dist/internal/SwitcherScroller.d.ts +11 -0
- package/dist/internal/attachmentTile.d.ts +1 -1
- package/dist/internal/audio.d.ts +13 -0
- package/dist/{components/badge/tier.d.ts → internal/chipTier.d.ts} +7 -5
- package/dist/internal/context.d.ts +10 -1
- package/dist/internal/controlValue.d.ts +7 -0
- package/dist/internal/edgeAutoScroll.d.ts +43 -25
- package/dist/internal/fieldCell.d.ts +4 -3
- package/dist/internal/fieldClasses.d.ts +15 -2
- package/dist/internal/fileSize.d.ts +5 -1
- package/dist/internal/formatClock.d.ts +2 -0
- package/dist/internal/formatNumber.d.ts +6 -0
- package/dist/internal/glyphSwap.d.ts +5 -9
- package/dist/internal/hasContent.d.ts +6 -0
- package/dist/internal/highlightTsx.d.ts +12 -0
- package/dist/internal/iconBox.d.ts +6 -0
- package/dist/internal/iconLayout.d.ts +2 -1
- package/dist/internal/imageSlot.d.ts +6 -1
- package/dist/internal/interactiveElement.d.ts +41 -0
- package/dist/internal/labels.d.ts +6 -0
- package/dist/internal/leaveInPlace.d.ts +6 -5
- package/dist/internal/listPresence.d.ts +32 -0
- package/dist/internal/listbox.d.ts +71 -31
- package/dist/internal/longPress.d.ts +42 -0
- package/dist/internal/mediaDisk.d.ts +7 -4
- package/dist/internal/mediaPlayer.d.ts +91 -27
- package/dist/internal/mediaSession.d.ts +0 -6
- package/dist/internal/messageList.d.ts +4 -3
- package/dist/internal/motionTiming.d.ts +34 -0
- package/dist/internal/namedRole.d.ts +13 -0
- package/dist/internal/nodeText.d.ts +6 -0
- package/dist/{components/modal → internal/overlay}/DialogGuard.d.ts +3 -5
- package/dist/{components/modal → internal/overlay}/DialogParts.d.ts +86 -89
- package/dist/internal/overlay/FloatingPanel.d.ts +27 -5
- package/dist/internal/overlay/ModalDialog.d.ts +59 -0
- package/dist/internal/overlay/focus.d.ts +29 -5
- package/dist/internal/overlay/layerStack.d.ts +8 -5
- package/dist/internal/overlay/useAnchorName.d.ts +14 -0
- package/dist/internal/overlay/useContainScroll.d.ts +7 -0
- package/dist/internal/overlay/useFloatingLayer.d.ts +43 -14
- package/dist/internal/overlay/useOpenState.d.ts +22 -0
- package/dist/internal/partPresence.d.ts +31 -0
- package/dist/internal/parts.d.ts +39 -0
- package/dist/internal/progressSegments.d.ts +52 -12
- package/dist/internal/richText.d.ts +6 -34
- package/dist/internal/ring.d.ts +18 -8
- package/dist/internal/rovingFocus.d.ts +10 -5
- package/dist/{components/data-table/rowEvents.d.ts → internal/rowLink.d.ts} +0 -5
- package/dist/internal/scrollAncestors.d.ts +14 -0
- package/dist/internal/selectionIndicator.d.ts +27 -0
- package/dist/internal/slot.d.ts +53 -5
- package/dist/internal/states.d.ts +61 -0
- package/dist/internal/sticky.d.ts +5 -1
- package/dist/internal/swallowNextClick.d.ts +9 -0
- package/dist/internal/swatch.d.ts +59 -15
- package/dist/internal/textFormatting.d.ts +2 -1
- package/dist/internal/textFormattingToolbar.d.ts +3 -2
- package/dist/internal/tokenDefaults.d.ts +21 -0
- package/dist/internal/touchTarget.d.ts +5 -0
- package/dist/internal/transcript.d.ts +19 -18
- package/dist/internal/transfer.d.ts +22 -8
- package/dist/internal/transferDisk.d.ts +2 -3
- package/dist/internal/useFlipList.d.ts +44 -0
- package/dist/internal/useNearView.d.ts +4 -3
- package/dist/internal/usePendingChanges.d.ts +23 -0
- package/dist/internal/useRangeSelection.d.ts +2 -1
- package/dist/layout/app-header/AppHeader.d.ts +29 -20
- package/dist/layout/app-shell/AppShell.d.ts +72 -8
- package/dist/layout/bottom-nav/BottomNav.d.ts +58 -22
- package/dist/layout/index.d.ts +2 -2
- package/dist/layout/sidebar/Sidebar.d.ts +232 -101
- package/dist/skill/SKILL.md +10 -10
- package/dist/skill/anti-slop.md +105 -24
- package/dist/skill/api-contract.md +115 -35
- package/dist/skill/cheatsheet.md +37 -37
- package/dist/skill/checklist.md +57 -89
- package/dist/skill/choosing.md +23 -25
- package/dist/skill/components.md +50 -48
- package/dist/skill/composition.md +68 -58
- package/dist/skill/foundations.md +31 -24
- package/dist/skill/layouts.md +81 -83
- package/dist/skill/motion.md +26 -31
- package/dist/skill/reference/components/accordion/COMPONENT.md +16 -9
- package/dist/skill/reference/components/accordion/examples/overview.tsx +2 -2
- package/dist/skill/reference/components/accordion/examples/sizes.tsx +6 -8
- package/dist/skill/reference/components/accordion/examples/states.tsx +27 -24
- package/dist/skill/reference/components/accordion/examples/variants.tsx +6 -8
- package/dist/skill/reference/components/accordion/examples/with-icon.tsx +22 -19
- package/dist/skill/reference/components/avatar/COMPONENT.md +23 -16
- package/dist/skill/reference/components/avatar/examples/examples.module.css +1 -4
- package/dist/skill/reference/components/avatar/examples/overview.tsx +3 -3
- package/dist/skill/reference/components/avatar/examples/presence.tsx +4 -4
- package/dist/skill/reference/components/avatar/examples/src-from-state.tsx +3 -3
- package/dist/skill/reference/components/avatar/examples/states.tsx +4 -4
- package/dist/skill/reference/components/avatar/examples/team-group.tsx +2 -2
- package/dist/skill/reference/components/badge/COMPONENT.md +66 -34
- package/dist/skill/reference/components/badge/examples/controlled.tsx +32 -0
- package/dist/skill/reference/components/badge/examples/examples.module.css +2 -2
- package/dist/skill/reference/components/badge/examples/filter-values.tsx +4 -6
- package/dist/skill/reference/components/badge/examples/in-controls.tsx +1 -1
- package/dist/skill/reference/components/badge/examples/overview.tsx +6 -5
- package/dist/skill/reference/components/badge/examples/square.tsx +21 -0
- package/dist/skill/reference/components/badge/examples/states.tsx +4 -4
- package/dist/skill/reference/components/badge/examples/with-icon.tsx +10 -1
- package/dist/skill/reference/components/banner/COMPONENT.md +9 -5
- package/dist/skill/reference/components/banner/examples/dismissible.tsx +3 -19
- package/dist/skill/reference/components/banner/examples/overview.tsx +1 -1
- package/dist/skill/reference/components/breadcrumb/COMPONENT.md +17 -11
- package/dist/skill/reference/components/breadcrumb/examples/examples.module.css +1 -1
- package/dist/skill/reference/components/breadcrumb/examples/overflow.tsx +1 -1
- package/dist/skill/reference/components/breadcrumb/examples/sizes.tsx +6 -8
- package/dist/skill/reference/components/breadcrumb/examples/with-icon.tsx +15 -8
- package/dist/skill/reference/components/button/COMPONENT.md +66 -30
- package/dist/skill/reference/components/button/examples/align.tsx +25 -0
- package/dist/skill/reference/components/button/examples/controlled.tsx +21 -0
- package/dist/skill/reference/components/button/examples/density.tsx +45 -0
- package/dist/skill/reference/components/button/examples/examples.module.css +14 -25
- package/dist/skill/reference/components/button/examples/label-morph.tsx +1 -1
- package/dist/skill/reference/components/button/examples/on-colored-host.tsx +19 -19
- package/dist/skill/reference/components/button/examples/over-media.tsx +7 -1
- package/dist/skill/reference/components/button/examples/toggle.tsx +2 -10
- package/dist/skill/reference/components/button-group/COMPONENT.md +21 -15
- package/dist/skill/reference/components/button-group/examples/controlled.tsx +1 -1
- package/dist/skill/reference/components/card/COMPONENT.md +16 -5
- package/dist/skill/reference/components/card/examples/content-templates.tsx +8 -2
- package/dist/skill/reference/components/card/examples/examples.module.css +4 -16
- package/dist/skill/reference/components/card/examples/overview.tsx +11 -11
- package/dist/skill/reference/components/card/examples/screen.tsx +9 -8
- package/dist/skill/reference/components/card/examples/variants.tsx +74 -47
- package/dist/skill/reference/components/chart-frame/COMPONENT.md +24 -28
- package/dist/skill/reference/components/chart-frame/examples/controlled.tsx +9 -7
- package/dist/skill/reference/components/chart-frame/examples/fill-height.tsx +4 -6
- package/dist/skill/reference/components/chart-frame/examples/narrow.tsx +24 -5
- package/dist/skill/reference/components/chart-frame/examples/overview.tsx +5 -2
- package/dist/skill/reference/components/chart-frame/examples/states.tsx +72 -64
- package/dist/skill/reference/components/chart-frame/examples/tooltip.tsx +27 -26
- package/dist/skill/reference/components/chat/COMPONENT.md +35 -22
- package/dist/skill/reference/components/chat/examples/group-chat.tsx +2 -2
- package/dist/skill/reference/components/chat/examples/overview.tsx +119 -130
- package/dist/skill/reference/components/chat/examples/reactions.tsx +18 -23
- package/dist/skill/reference/components/chat/examples/screen.tsx +108 -131
- package/dist/skill/reference/components/chat/examples/states.tsx +23 -22
- package/dist/skill/reference/components/chat-list/COMPONENT.md +10 -5
- package/dist/skill/reference/components/chat-list/examples/examples.module.css +0 -8
- package/dist/skill/reference/components/chat-list/examples/live.tsx +29 -22
- package/dist/skill/reference/components/chat-list/examples/sizes.tsx +6 -8
- package/dist/skill/reference/components/chat-list/examples/states.tsx +42 -38
- package/dist/skill/reference/components/checkbox/COMPONENT.md +27 -14
- package/dist/skill/reference/components/checkbox/examples/controlled.tsx +18 -16
- package/dist/skill/reference/components/checkbox/examples/examples.module.css +14 -56
- package/dist/skill/reference/components/checkbox/examples/in-form.tsx +16 -16
- package/dist/skill/reference/components/checkbox/examples/indicator.tsx +19 -64
- package/dist/skill/reference/components/checkbox/examples/overview.tsx +1 -1
- package/dist/skill/reference/components/checkbox/examples/states.tsx +1 -1
- package/dist/skill/reference/components/checkbox/examples/without-label.tsx +1 -1
- package/dist/skill/reference/components/code-block/COMPONENT.md +16 -12
- package/dist/skill/reference/components/code-block/examples/examples.module.css +5 -2
- package/dist/skill/reference/components/code-block/examples/narrow.tsx +1 -1
- package/dist/skill/reference/components/color-field/COMPONENT.md +15 -9
- package/dist/skill/reference/components/color-field/examples/examples.module.css +4 -5
- package/dist/skill/reference/components/color-field/examples/in-form.tsx +15 -13
- package/dist/skill/reference/components/color-field/examples/sizes.tsx +5 -1
- package/dist/skill/reference/components/color-field/examples/states.tsx +15 -3
- package/dist/skill/reference/components/color-picker/COMPONENT.md +55 -19
- package/dist/skill/reference/components/color-picker/examples/controlled.tsx +16 -5
- package/dist/skill/reference/components/color-picker/examples/examples.module.css +6 -7
- package/dist/skill/reference/components/color-picker/examples/in-form.tsx +24 -22
- package/dist/skill/reference/components/color-picker/examples/overview.tsx +1 -1
- package/dist/skill/reference/components/color-picker/examples/panel.tsx +1 -1
- package/dist/skill/reference/components/color-picker/examples/sizes.tsx +9 -11
- package/dist/skill/reference/components/color-picker/examples/states.tsx +28 -23
- package/dist/skill/reference/components/color-swatches/COMPONENT.md +22 -8
- package/dist/skill/reference/components/color-swatches/examples/examples.module.css +3 -4
- package/dist/skill/reference/components/color-swatches/examples/in-form.tsx +19 -17
- package/dist/skill/reference/components/color-swatches/examples/palette.tsx +24 -0
- package/dist/skill/reference/components/color-swatches/examples/wrapping.tsx +17 -2
- package/dist/skill/reference/components/command-menu/COMPONENT.md +60 -20
- package/dist/skill/reference/components/command-menu/examples/sizes.tsx +20 -15
- package/dist/skill/reference/components/command-menu/examples/states.tsx +46 -24
- package/dist/skill/reference/components/composer/COMPONENT.md +42 -24
- package/dist/skill/reference/components/composer/examples/examples.module.css +0 -9
- package/dist/skill/reference/components/composer/examples/narrow.tsx +1 -1
- package/dist/skill/reference/components/composer/examples/reply-edit.tsx +3 -3
- package/dist/skill/reference/components/composer/examples/sizes.tsx +3 -5
- package/dist/skill/reference/components/composer/examples/states.tsx +4 -6
- package/dist/skill/reference/components/confirm-dialog/COMPONENT.md +26 -13
- package/dist/skill/reference/components/confirm-dialog/examples/dismiss.tsx +27 -0
- package/dist/skill/reference/components/confirm-dialog/examples/failure.tsx +9 -16
- package/dist/skill/reference/components/crossfade/COMPONENT.md +11 -5
- package/dist/skill/reference/components/crossfade/examples/examples.module.css +1 -40
- package/dist/skill/reference/components/crossfade/examples/fill.tsx +16 -19
- package/dist/skill/reference/components/crossfade/examples/overview.tsx +14 -16
- package/dist/skill/reference/components/crossfade/examples/record-switch.tsx +6 -11
- package/dist/skill/reference/components/crossfade/examples/screen.module.css +1 -24
- package/dist/skill/reference/components/crossfade/examples/screen.tsx +14 -25
- package/dist/skill/reference/components/data-table/COMPONENT.md +31 -21
- package/dist/skill/reference/components/data-table/examples/controlled.tsx +14 -2
- package/dist/skill/reference/components/data-table/examples/examples.module.css +1 -9
- package/dist/skill/reference/components/data-table/examples/narrow.tsx +5 -1
- package/dist/skill/reference/components/data-table/examples/row-link.tsx +2 -1
- package/dist/skill/reference/components/data-table/examples/screen.module.css +2 -2
- package/dist/skill/reference/components/data-table/examples/screen.tsx +11 -10
- package/dist/skill/reference/components/data-table/examples/sizes.tsx +17 -17
- package/dist/skill/reference/components/data-table/examples/states.tsx +37 -29
- package/dist/skill/reference/components/datepicker/COMPONENT.md +53 -22
- package/dist/skill/reference/components/datepicker/examples/dismiss.tsx +15 -0
- package/dist/skill/reference/components/datepicker/examples/examples.module.css +3 -2
- package/dist/skill/reference/components/datepicker/examples/in-form.tsx +33 -25
- package/dist/skill/reference/components/datepicker/examples/sizes.tsx +2 -2
- package/dist/skill/reference/components/datepicker/examples/states.tsx +2 -2
- package/dist/skill/reference/components/datepicker/examples/validation.tsx +3 -3
- package/dist/skill/reference/components/description-list/COMPONENT.md +24 -9
- package/dist/skill/reference/components/description-list/examples/examples.module.css +4 -24
- package/dist/skill/reference/components/description-list/examples/narrow.tsx +1 -1
- package/dist/skill/reference/components/description-list/examples/screen.module.css +0 -18
- package/dist/skill/reference/components/description-list/examples/screen.tsx +19 -27
- package/dist/skill/reference/components/description-list/examples/sizes.tsx +2 -4
- package/dist/skill/reference/components/description-list/examples/structure.tsx +6 -7
- package/dist/skill/reference/components/description-list/examples/totals.tsx +40 -0
- package/dist/skill/reference/components/digit-input/COMPONENT.md +12 -6
- package/dist/skill/reference/components/digit-input/examples/examples.module.css +2 -2
- package/dist/skill/reference/components/digit-input/examples/in-form.tsx +1 -1
- package/dist/skill/reference/components/digit-input/examples/sizes.tsx +5 -3
- package/dist/skill/reference/components/digit-input/examples/states.tsx +14 -6
- package/dist/skill/reference/components/divider/COMPONENT.md +26 -12
- package/dist/skill/reference/components/divider/examples/align.tsx +2 -4
- package/dist/skill/reference/components/divider/examples/examples.module.css +13 -17
- package/dist/skill/reference/components/divider/examples/or-separator.tsx +3 -5
- package/dist/skill/reference/components/divider/examples/overview.tsx +18 -16
- package/dist/skill/reference/components/divider/examples/vertical.tsx +5 -1
- package/dist/skill/reference/components/divider/examples/with-icon.tsx +1 -1
- package/dist/skill/reference/components/dnd/COMPONENT.md +52 -34
- package/dist/skill/reference/components/dnd/examples/drop-zones.tsx +1 -1
- package/dist/skill/reference/components/dnd/examples/examples.module.css +4 -6
- package/dist/skill/reference/components/dnd/examples/states.tsx +41 -35
- package/dist/skill/reference/components/drawer/COMPONENT.md +37 -14
- package/dist/skill/reference/components/drawer/examples/guard.tsx +1 -3
- package/dist/skill/reference/components/drawer/examples/header-actions.tsx +1 -1
- package/dist/skill/reference/components/drawer/examples/in-form.tsx +31 -31
- package/dist/skill/reference/components/drawer/examples/placement.tsx +31 -26
- package/dist/skill/reference/components/drawer/examples/sizes.tsx +32 -27
- package/dist/skill/reference/components/dropdown/COMPONENT.md +58 -23
- package/dist/skill/reference/components/dropdown/examples/context-menu.tsx +75 -0
- package/dist/skill/reference/components/dropdown/examples/examples.module.css +1 -1
- package/dist/skill/reference/components/dropdown/examples/sizes.tsx +39 -34
- package/dist/skill/reference/components/dropdown/examples/states.tsx +37 -29
- package/dist/skill/reference/components/empty-page/COMPONENT.md +20 -9
- package/dist/skill/reference/components/empty-page/examples/compact.tsx +28 -18
- package/dist/skill/reference/components/empty-page/examples/examples.module.css +0 -43
- package/dist/skill/reference/components/empty-page/examples/narrow.tsx +3 -3
- package/dist/skill/reference/components/empty-page/examples/region-error.tsx +6 -11
- package/dist/skill/reference/components/empty-page/examples/sizes.tsx +13 -13
- package/dist/skill/reference/components/empty-page/examples/variants.tsx +34 -30
- package/dist/skill/reference/components/example-frame/COMPONENT.md +21 -9
- package/dist/skill/reference/components/example-frame/examples/controlled.tsx +3 -3
- package/dist/skill/reference/components/field-list/COMPONENT.md +14 -8
- package/dist/skill/reference/components/field-list/examples/sizes.tsx +32 -26
- package/dist/skill/reference/components/field-list/examples/states.tsx +37 -31
- package/dist/skill/reference/components/fieldset/COMPONENT.md +10 -5
- package/dist/skill/reference/components/fieldset/examples/examples.module.css +1 -1
- package/dist/skill/reference/components/file-upload/COMPONENT.md +67 -29
- package/dist/skill/reference/components/file-upload/examples/avatar-upload.tsx +5 -5
- package/dist/skill/reference/components/file-upload/examples/custom-body.tsx +12 -7
- package/dist/skill/reference/components/file-upload/examples/examples.module.css +4 -4
- package/dist/skill/reference/components/file-upload/examples/narrow.tsx +1 -1
- package/dist/skill/reference/components/file-upload/examples/row-parts.tsx +4 -4
- package/dist/skill/reference/components/file-upload/examples/screen.module.css +2 -2
- package/dist/skill/reference/components/file-upload/examples/screen.tsx +6 -4
- package/dist/skill/reference/components/file-upload/examples/sizes.tsx +1 -3
- package/dist/skill/reference/components/file-upload/examples/states.tsx +1 -3
- package/dist/skill/reference/components/file-upload/examples/variants.tsx +13 -7
- package/dist/skill/reference/components/gallery/COMPONENT.md +16 -7
- package/dist/skill/reference/components/gallery/examples/album-sizes.tsx +52 -0
- package/dist/skill/reference/components/gallery/examples/controlled.tsx +40 -0
- package/dist/skill/reference/components/gallery/examples/examples.module.css +1 -1
- package/dist/skill/reference/components/gallery/examples/overview.tsx +15 -43
- package/dist/skill/reference/components/gallery/examples/transfer.tsx +22 -13
- package/dist/skill/reference/components/gantt/COMPONENT.md +21 -15
- package/dist/skill/reference/components/gantt/examples/examples.module.css +0 -16
- package/dist/skill/reference/components/gantt/examples/occupancy.tsx +2 -2
- package/dist/skill/reference/components/gantt/examples/screen.tsx +2 -2
- package/dist/skill/reference/components/gantt/examples/sizes.tsx +16 -16
- package/dist/skill/reference/components/gantt/examples/states.tsx +34 -30
- package/dist/skill/reference/components/gantt/examples/variants.tsx +27 -25
- package/dist/skill/reference/components/hint/COMPONENT.md +24 -14
- package/dist/skill/reference/components/hint/examples/examples.module.css +1 -1
- package/dist/skill/reference/components/hint/examples/hint-or-error.tsx +2 -2
- package/dist/skill/reference/components/hint/examples/overview.tsx +9 -10
- package/dist/skill/reference/components/hint/examples/sizes.tsx +1 -1
- package/dist/skill/reference/components/input/COMPONENT.md +10 -6
- package/dist/skill/reference/components/input/examples/affixes.tsx +2 -2
- package/dist/skill/reference/components/input/examples/examples.module.css +1 -1
- package/dist/skill/reference/components/input/examples/sizes.tsx +9 -5
- package/dist/skill/reference/components/input/examples/states.tsx +39 -23
- package/dist/skill/reference/components/input/examples/with-icon.tsx +24 -16
- package/dist/skill/reference/components/kanban/COMPONENT.md +30 -24
- package/dist/skill/reference/components/kanban/examples/columns.tsx +14 -19
- package/dist/skill/reference/components/kanban/examples/item-link.tsx +2 -2
- package/dist/skill/reference/components/kanban/examples/limits.tsx +1 -1
- package/dist/skill/reference/components/kanban/examples/narrow.tsx +1 -1
- package/dist/skill/reference/components/kanban/examples/screen.module.css +1 -3
- package/dist/skill/reference/components/kanban/examples/screen.tsx +6 -4
- package/dist/skill/reference/components/kanban/examples/states.tsx +37 -58
- package/dist/skill/reference/components/kanban/examples/variants.tsx +0 -3
- package/dist/skill/reference/components/kbd/COMPONENT.md +10 -6
- package/dist/skill/reference/components/kbd/examples/examples.module.css +1 -20
- package/dist/skill/reference/components/kbd/examples/in-controls.tsx +2 -2
- package/dist/skill/reference/components/kbd/examples/shortcut-list.tsx +14 -26
- package/dist/skill/reference/components/label/COMPONENT.md +26 -11
- package/dist/skill/reference/components/label/examples/examples.module.css +3 -11
- package/dist/skill/reference/components/label/examples/overview.tsx +5 -9
- package/dist/skill/reference/components/label/examples/structure.tsx +2 -2
- package/dist/skill/reference/components/link-button/COMPONENT.md +33 -20
- package/dist/skill/reference/components/link-button/examples/as-child.tsx +1 -1
- package/dist/skill/reference/components/link-button/examples/external-link.tsx +1 -1
- package/dist/skill/reference/components/link-button/examples/overview.tsx +4 -2
- package/dist/skill/reference/components/link-button/examples/variants.tsx +2 -2
- package/dist/skill/reference/components/list/COMPONENT.md +24 -16
- package/dist/skill/reference/components/list/examples/examples.module.css +0 -8
- package/dist/skill/reference/components/list/examples/overflow.tsx +1 -1
- package/dist/skill/reference/components/list/examples/overview.tsx +31 -30
- package/dist/skill/reference/components/list/examples/sizes.tsx +23 -23
- package/dist/skill/reference/components/list/examples/states.tsx +38 -21
- package/dist/skill/reference/components/list/examples/with-icon.tsx +16 -14
- package/dist/skill/reference/components/login-form/COMPONENT.md +69 -16
- package/dist/skill/reference/components/login-form/examples/narrow.tsx +1 -1
- package/dist/skill/reference/components/login-form/examples/register.tsx +1 -1
- package/dist/skill/reference/components/media-viewer/COMPONENT.md +12 -8
- package/dist/skill/reference/components/media-viewer/examples/examples.module.css +2 -2
- package/dist/skill/reference/components/media-viewer/examples/video.tsx +1 -1
- package/dist/skill/reference/components/message/COMPONENT.md +102 -46
- package/dist/skill/reference/components/message/examples/typing.tsx +5 -5
- package/dist/skill/reference/components/modal/COMPONENT.md +71 -37
- package/dist/skill/reference/components/modal/examples/dismiss.tsx +35 -27
- package/dist/skill/reference/components/modal/examples/enter-key.tsx +22 -25
- package/dist/skill/reference/components/modal/examples/examples.module.css +0 -7
- package/dist/skill/reference/components/modal/examples/guard.tsx +2 -4
- package/dist/skill/reference/components/modal/examples/in-form.tsx +28 -28
- package/dist/skill/reference/components/modal/examples/long-content.tsx +6 -4
- package/dist/skill/reference/components/modal/examples/sizes.tsx +36 -31
- package/dist/skill/reference/components/modal/examples/structure.tsx +1 -1
- package/dist/skill/reference/components/native-select/COMPONENT.md +7 -3
- package/dist/skill/reference/components/native-select/examples/examples.module.css +3 -3
- package/dist/skill/reference/components/native-select/examples/in-form.tsx +28 -29
- package/dist/skill/reference/components/native-select/examples/sizes.tsx +2 -2
- package/dist/skill/reference/components/native-select/examples/states.tsx +2 -2
- package/dist/skill/reference/components/notification/COMPONENT.md +36 -31
- package/dist/skill/reference/components/notification/examples/examples.module.css +1 -2
- package/dist/skill/reference/components/notification/examples/in-form.tsx +28 -20
- package/dist/skill/reference/components/notification/examples/sizes.tsx +16 -12
- package/dist/skill/reference/components/notification/examples/undo.tsx +7 -15
- package/dist/skill/reference/components/page-content/COMPONENT.md +21 -29
- package/dist/skill/reference/components/page-content/examples/examples.module.css +3 -16
- package/dist/skill/reference/components/page-content/examples/grid.tsx +3 -1
- package/dist/skill/reference/components/page-content/examples/list-detail.tsx +55 -49
- package/dist/skill/reference/components/page-content/examples/narrow.tsx +1 -1
- package/dist/skill/reference/components/page-content/examples/overview.tsx +2 -2
- package/dist/skill/reference/components/page-content/examples/variants.tsx +7 -7
- package/dist/skill/reference/components/page-toolbar/COMPONENT.md +10 -6
- package/dist/skill/reference/components/page-toolbar/examples/overview.tsx +1 -1
- package/dist/skill/reference/components/page-toolbar/examples/save-changes.tsx +25 -22
- package/dist/skill/reference/components/pagination/COMPONENT.md +20 -17
- package/dist/skill/reference/components/pagination/examples/narrow.tsx +5 -5
- package/dist/skill/reference/components/popover/COMPONENT.md +43 -20
- package/dist/skill/reference/components/popover/examples/controlled-open.tsx +6 -4
- package/dist/skill/reference/components/popover/examples/dismiss.tsx +37 -28
- package/dist/skill/reference/components/popover/examples/examples.module.css +2 -2
- package/dist/skill/reference/components/popover/examples/sizes.tsx +32 -27
- package/dist/skill/reference/components/popover/examples/width.tsx +45 -0
- package/dist/skill/reference/components/progress-bar/COMPONENT.md +21 -29
- package/dist/skill/reference/components/progress-bar/examples/examples.module.css +1 -1
- package/dist/skill/reference/components/progress-circle/COMPONENT.md +21 -29
- package/dist/skill/reference/components/progress-circle/examples/examples.module.css +1 -1
- package/dist/skill/reference/components/progress-circle/examples/on-color.tsx +16 -0
- package/dist/skill/reference/components/progress-circle/examples/variants.tsx +1 -0
- package/dist/skill/reference/components/radio/COMPONENT.md +13 -4
- package/dist/skill/reference/components/radio/examples/examples.module.css +1 -1
- package/dist/skill/reference/components/scroll-container/COMPONENT.md +18 -12
- package/dist/skill/reference/components/scroll-container/examples/auto-scroll.tsx +8 -4
- package/dist/skill/reference/components/scroll-container/examples/edges.tsx +4 -4
- package/dist/skill/reference/components/scroll-container/examples/examples.module.css +7 -51
- package/dist/skill/reference/components/scroll-container/examples/load-more.tsx +4 -4
- package/dist/skill/reference/components/scroll-container/examples/lock.tsx +4 -4
- package/dist/skill/reference/components/scroll-container/examples/log.tsx +97 -0
- package/dist/skill/reference/components/scroll-container/examples/overscroll.tsx +4 -4
- package/dist/skill/reference/components/scroll-container/examples/overview.tsx +5 -5
- package/dist/skill/reference/components/scroll-container/examples/scrollbar.tsx +4 -4
- package/dist/skill/reference/components/scroll-container/examples/snap.tsx +2 -2
- package/dist/skill/reference/components/scroll-container/examples/variants.tsx +1 -0
- package/dist/skill/reference/components/segmented-control/COMPONENT.md +24 -12
- package/dist/skill/reference/components/segmented-control/examples/controlled.tsx +2 -4
- package/dist/skill/reference/components/segmented-control/examples/examples.module.css +0 -8
- package/dist/skill/reference/components/segmented-control/examples/scroll.tsx +1 -1
- package/dist/skill/reference/components/select/COMPONENT.md +33 -9
- package/dist/skill/reference/components/select/examples/dismiss.tsx +26 -0
- package/dist/skill/reference/components/select/examples/examples.module.css +1 -1
- package/dist/skill/reference/components/select/examples/server-search.tsx +6 -2
- package/dist/skill/reference/components/select/examples/sizes.tsx +2 -2
- package/dist/skill/reference/components/select/examples/states.tsx +2 -2
- package/dist/skill/reference/components/select/examples/with-icon.tsx +20 -18
- package/dist/skill/reference/components/sheet/COMPONENT.md +44 -21
- package/dist/skill/reference/components/sheet/examples/header-actions.tsx +23 -4
- package/dist/skill/reference/components/sheet/examples/overview.tsx +25 -10
- package/dist/skill/reference/components/skeleton/COMPONENT.md +8 -4
- package/dist/skill/reference/components/skeleton/examples/examples.module.css +1 -13
- package/dist/skill/reference/components/skeleton/examples/with-crossfade.tsx +7 -7
- package/dist/skill/reference/components/slider/COMPONENT.md +10 -5
- package/dist/skill/reference/components/slider/examples/examples.module.css +6 -7
- package/dist/skill/reference/components/slider/examples/hint-and-error.tsx +3 -5
- package/dist/skill/reference/components/slider/examples/in-form.tsx +21 -19
- package/dist/skill/reference/components/smart-filter/COMPONENT.md +32 -12
- package/dist/skill/reference/components/smart-filter/examples/examples.module.css +0 -21
- package/dist/skill/reference/components/smart-filter/examples/ranges.tsx +2 -1
- package/dist/skill/reference/components/smart-filter/examples/sizes.tsx +2 -4
- package/dist/skill/reference/components/sparkline/COMPONENT.md +7 -3
- package/dist/skill/reference/components/sparkline/examples/examples.module.css +1 -1
- package/dist/skill/reference/components/sparkline/examples/signed-bars.tsx +2 -2
- package/dist/skill/reference/components/spinner/COMPONENT.md +15 -9
- package/dist/skill/reference/components/spinner/examples/examples.module.css +2 -14
- package/dist/skill/reference/components/spinner/examples/overview.tsx +1 -1
- package/dist/skill/reference/components/stepper/COMPONENT.md +50 -41
- package/dist/skill/reference/components/stepper/examples/examples.module.css +1 -6
- package/dist/skill/reference/components/stepper/examples/narrow.tsx +1 -1
- package/dist/skill/reference/components/stepper/examples/sizes.tsx +6 -8
- package/dist/skill/reference/components/stepper/examples/states.tsx +44 -43
- package/dist/skill/reference/components/stepper/examples/with-icon.tsx +19 -17
- package/dist/skill/reference/components/switch/COMPONENT.md +21 -8
- package/dist/skill/reference/components/switch/examples/examples.module.css +2 -2
- package/dist/skill/reference/components/switch/examples/states.tsx +3 -3
- package/dist/skill/reference/components/tabs/COMPONENT.md +21 -16
- package/dist/skill/reference/components/tabs/examples/in-drawer.tsx +1 -1
- package/dist/skill/reference/components/tabs/examples/sizes.tsx +5 -10
- package/dist/skill/reference/components/tabs/examples/variants.tsx +19 -23
- package/dist/skill/reference/components/tag-select/COMPONENT.md +19 -6
- package/dist/skill/reference/components/tag-select/examples/creatable.tsx +2 -2
- package/dist/skill/reference/components/tag-select/examples/dismiss.tsx +23 -0
- package/dist/skill/reference/components/tag-select/examples/examples.module.css +3 -3
- package/dist/skill/reference/components/tag-select/examples/in-form.tsx +31 -32
- package/dist/skill/reference/components/tag-select/examples/sizes.tsx +2 -2
- package/dist/skill/reference/components/tag-select/examples/states.tsx +2 -2
- package/dist/skill/reference/components/textarea/COMPONENT.md +10 -6
- package/dist/skill/reference/components/textarea/examples/examples.module.css +3 -10
- package/dist/skill/reference/components/textarea/examples/in-form.tsx +3 -3
- package/dist/skill/reference/components/textarea/examples/sizes.tsx +10 -7
- package/dist/skill/reference/components/textarea/examples/states.tsx +29 -13
- package/dist/skill/reference/components/textarea/examples/validation.tsx +45 -36
- package/dist/skill/reference/components/thumbnail/COMPONENT.md +17 -13
- package/dist/skill/reference/components/thumbnail/examples/examples.module.css +1 -1
- package/dist/skill/reference/components/thumbnail/examples/states.tsx +1 -1
- package/dist/skill/reference/components/thumbnail/examples/variants.tsx +12 -1
- package/dist/skill/reference/components/timeline/COMPONENT.md +51 -35
- package/dist/skill/reference/components/timeline/examples/links.tsx +14 -14
- package/dist/skill/reference/components/timeline/examples/narrow.tsx +6 -6
- package/dist/skill/reference/components/timeline/examples/overview.tsx +6 -6
- package/dist/skill/reference/components/timeline/examples/sizes.tsx +28 -23
- package/dist/skill/reference/components/timeline/examples/structure.tsx +30 -30
- package/dist/skill/reference/components/timeline/examples/variants.tsx +40 -28
- package/dist/skill/reference/components/tooltip/COMPONENT.md +10 -6
- package/dist/skill/reference/components/tooltip/examples/examples.module.css +1 -5
- package/dist/skill/reference/components/tooltip/examples/non-interactive-trigger.tsx +1 -1
- package/dist/skill/reference/components/tooltip/examples/sizes.tsx +17 -10
- package/dist/skill/reference/components/typography/COMPONENT.md +17 -2
- package/dist/skill/reference/components/typography/examples/examples.module.css +3 -6
- package/dist/skill/reference/components/typography/examples/numeric.tsx +16 -0
- package/dist/skill/reference/components/video-note/COMPONENT.md +11 -7
- package/dist/skill/reference/components/visually-hidden/COMPONENT.md +8 -4
- package/dist/skill/reference/components/visually-hidden/examples/assertive.tsx +1 -1
- package/dist/skill/reference/components/visually-hidden/examples/overview.tsx +17 -7
- package/dist/skill/reference/components/voice-player/COMPONENT.md +15 -7
- package/dist/skill/reference/foundation.md +564 -0
- package/dist/skill/reference/layout/app-header/COMPONENT.md +27 -26
- package/dist/skill/reference/layout/app-header/examples/examples.module.css +4 -23
- package/dist/skill/reference/layout/app-header/examples/in-app-shell.tsx +3 -5
- package/dist/skill/reference/layout/app-header/examples/narrow.tsx +58 -20
- package/dist/skill/reference/layout/app-shell/COMPONENT.md +40 -10
- package/dist/skill/reference/layout/app-shell/examples/examples.module.css +2 -22
- package/dist/skill/reference/layout/app-shell/examples/footer.tsx +2 -2
- package/dist/skill/reference/layout/app-shell/examples/overview.tsx +3 -5
- package/dist/skill/reference/layout/app-shell/examples/screen.tsx +27 -21
- package/dist/skill/reference/layout/app-shell/examples/template.tsx +3 -3
- package/dist/skill/reference/layout/bottom-nav/COMPONENT.md +27 -17
- package/dist/skill/reference/layout/bottom-nav/examples/examples.module.css +2 -7
- package/dist/skill/reference/layout/bottom-nav/examples/floating-action.tsx +2 -2
- package/dist/skill/reference/layout/bottom-nav/examples/floating.tsx +2 -2
- package/dist/skill/reference/layout/bottom-nav/examples/in-app-shell.tsx +2 -2
- package/dist/skill/reference/layout/bottom-nav/examples/router.tsx +6 -5
- package/dist/skill/reference/layout/sidebar/COMPONENT.md +50 -40
- package/dist/skill/reference/layout/sidebar/examples/account.tsx +1 -3
- package/dist/skill/reference/layout/sidebar/examples/brand-header.tsx +1 -3
- package/dist/skill/reference/layout/sidebar/examples/collapsible-groups.tsx +1 -3
- package/dist/skill/reference/layout/sidebar/examples/controlled-open.tsx +1 -3
- package/dist/skill/reference/layout/sidebar/examples/controlled.tsx +1 -3
- package/dist/skill/reference/layout/sidebar/examples/custom-part.tsx +1 -3
- package/dist/skill/reference/layout/sidebar/examples/dismiss.tsx +47 -0
- package/dist/skill/reference/layout/sidebar/examples/examples.module.css +7 -32
- package/dist/skill/reference/layout/sidebar/examples/narrow.tsx +44 -42
- package/dist/skill/reference/layout/sidebar/examples/nested-items.tsx +1 -3
- package/dist/skill/reference/layout/sidebar/examples/overview.tsx +1 -3
- package/dist/skill/reference/layout/sidebar/examples/persist.tsx +1 -3
- package/dist/skill/reference/layout/sidebar/examples/router.tsx +12 -13
- package/dist/skill/reference/layout/sidebar/examples/sizes.tsx +6 -6
- package/dist/skill/responsive.md +48 -51
- package/dist/skill/ux.md +21 -9
- package/dist/theme/applyTheme.d.ts +7 -6
- package/dist/tokens/hues.d.ts +8 -0
- package/dist/tokens/layers.d.ts +3 -16
- package/dist/tokens/offGrid.d.ts +7 -0
- package/dist/tokens/primitives.d.ts +22 -7
- package/dist/tokens/semantic.d.ts +201 -51
- package/dist/tokens/themes/dark.d.ts +32 -31
- package/package.json +5 -3
- package/src/components/accordion/COMPONENT.md +16 -9
- package/src/components/accordion/examples/overview.tsx +2 -2
- package/src/components/accordion/examples/sizes.tsx +6 -8
- package/src/components/accordion/examples/states.tsx +27 -24
- package/src/components/accordion/examples/variants.tsx +6 -8
- package/src/components/accordion/examples/with-icon.tsx +22 -19
- package/src/components/avatar/COMPONENT.md +23 -16
- package/src/components/avatar/examples/examples.module.css +1 -4
- package/src/components/avatar/examples/overview.tsx +3 -3
- package/src/components/avatar/examples/presence.tsx +4 -4
- package/src/components/avatar/examples/src-from-state.tsx +3 -3
- package/src/components/avatar/examples/states.tsx +4 -4
- package/src/components/avatar/examples/team-group.tsx +2 -2
- package/src/components/badge/COMPONENT.md +66 -34
- package/src/components/badge/examples/controlled.tsx +32 -0
- package/src/components/badge/examples/examples.module.css +2 -2
- package/src/components/badge/examples/filter-values.tsx +4 -6
- package/src/components/badge/examples/in-controls.tsx +1 -1
- package/src/components/badge/examples/overview.tsx +6 -5
- package/src/components/badge/examples/square.tsx +21 -0
- package/src/components/badge/examples/states.tsx +4 -4
- package/src/components/badge/examples/with-icon.tsx +10 -1
- package/src/components/banner/COMPONENT.md +9 -5
- package/src/components/banner/examples/dismissible.tsx +3 -19
- package/src/components/banner/examples/overview.tsx +1 -1
- package/src/components/breadcrumb/COMPONENT.md +17 -11
- package/src/components/breadcrumb/examples/examples.module.css +1 -1
- package/src/components/breadcrumb/examples/overflow.tsx +1 -1
- package/src/components/breadcrumb/examples/sizes.tsx +6 -8
- package/src/components/breadcrumb/examples/with-icon.tsx +15 -8
- package/src/components/button/COMPONENT.md +66 -30
- package/src/components/button/examples/align.tsx +25 -0
- package/src/components/button/examples/controlled.tsx +21 -0
- package/src/components/button/examples/density.tsx +45 -0
- package/src/components/button/examples/examples.module.css +14 -25
- package/src/components/button/examples/label-morph.tsx +1 -1
- package/src/components/button/examples/on-colored-host.tsx +19 -19
- package/src/components/button/examples/over-media.tsx +7 -1
- package/src/components/button/examples/toggle.tsx +2 -10
- package/src/components/button-group/COMPONENT.md +21 -15
- package/src/components/button-group/examples/controlled.tsx +1 -1
- package/src/components/card/COMPONENT.md +16 -5
- package/src/components/card/examples/content-templates.tsx +8 -2
- package/src/components/card/examples/examples.module.css +4 -16
- package/src/components/card/examples/overview.tsx +11 -11
- package/src/components/card/examples/screen.tsx +9 -8
- package/src/components/card/examples/variants.tsx +74 -47
- package/src/components/chart-frame/COMPONENT.md +24 -28
- package/src/components/chart-frame/examples/controlled.tsx +9 -7
- package/src/components/chart-frame/examples/fill-height.tsx +4 -6
- package/src/components/chart-frame/examples/narrow.tsx +24 -5
- package/src/components/chart-frame/examples/overview.tsx +5 -2
- package/src/components/chart-frame/examples/states.tsx +72 -64
- package/src/components/chart-frame/examples/tooltip.tsx +27 -26
- package/src/components/chat/COMPONENT.md +35 -22
- package/src/components/chat/examples/group-chat.tsx +2 -2
- package/src/components/chat/examples/overview.tsx +119 -130
- package/src/components/chat/examples/reactions.tsx +18 -23
- package/src/components/chat/examples/screen.tsx +108 -131
- package/src/components/chat/examples/states.tsx +23 -22
- package/src/components/chat-list/COMPONENT.md +10 -5
- package/src/components/chat-list/examples/examples.module.css +0 -8
- package/src/components/chat-list/examples/live.tsx +29 -22
- package/src/components/chat-list/examples/sizes.tsx +6 -8
- package/src/components/chat-list/examples/states.tsx +42 -38
- package/src/components/checkbox/COMPONENT.md +27 -14
- package/src/components/checkbox/examples/controlled.tsx +18 -16
- package/src/components/checkbox/examples/examples.module.css +14 -56
- package/src/components/checkbox/examples/in-form.tsx +16 -16
- package/src/components/checkbox/examples/indicator.tsx +19 -64
- package/src/components/checkbox/examples/overview.tsx +1 -1
- package/src/components/checkbox/examples/states.tsx +1 -1
- package/src/components/checkbox/examples/without-label.tsx +1 -1
- package/src/components/code-block/COMPONENT.md +16 -12
- package/src/components/code-block/examples/examples.module.css +5 -2
- package/src/components/code-block/examples/narrow.tsx +1 -1
- package/src/components/color-field/COMPONENT.md +15 -9
- package/src/components/color-field/examples/examples.module.css +4 -5
- package/src/components/color-field/examples/in-form.tsx +15 -13
- package/src/components/color-field/examples/sizes.tsx +5 -1
- package/src/components/color-field/examples/states.tsx +15 -3
- package/src/components/color-picker/COMPONENT.md +55 -19
- package/src/components/color-picker/examples/controlled.tsx +16 -5
- package/src/components/color-picker/examples/examples.module.css +6 -7
- package/src/components/color-picker/examples/in-form.tsx +24 -22
- package/src/components/color-picker/examples/overview.tsx +1 -1
- package/src/components/color-picker/examples/panel.tsx +1 -1
- package/src/components/color-picker/examples/sizes.tsx +9 -11
- package/src/components/color-picker/examples/states.tsx +28 -23
- package/src/components/color-swatches/COMPONENT.md +22 -8
- package/src/components/color-swatches/examples/examples.module.css +3 -4
- package/src/components/color-swatches/examples/in-form.tsx +19 -17
- package/src/components/color-swatches/examples/palette.tsx +24 -0
- package/src/components/color-swatches/examples/wrapping.tsx +17 -2
- package/src/components/command-menu/COMPONENT.md +60 -20
- package/src/components/command-menu/examples/sizes.tsx +20 -15
- package/src/components/command-menu/examples/states.tsx +46 -24
- package/src/components/composer/COMPONENT.md +42 -24
- package/src/components/composer/examples/examples.module.css +0 -9
- package/src/components/composer/examples/narrow.tsx +1 -1
- package/src/components/composer/examples/reply-edit.tsx +3 -3
- package/src/components/composer/examples/sizes.tsx +3 -5
- package/src/components/composer/examples/states.tsx +4 -6
- package/src/components/confirm-dialog/COMPONENT.md +26 -13
- package/src/components/confirm-dialog/examples/dismiss.tsx +27 -0
- package/src/components/confirm-dialog/examples/failure.tsx +9 -16
- package/src/components/crossfade/COMPONENT.md +11 -5
- package/src/components/crossfade/examples/examples.module.css +1 -40
- package/src/components/crossfade/examples/fill.tsx +16 -19
- package/src/components/crossfade/examples/overview.tsx +14 -16
- package/src/components/crossfade/examples/record-switch.tsx +6 -11
- package/src/components/crossfade/examples/screen.module.css +1 -24
- package/src/components/crossfade/examples/screen.tsx +14 -25
- package/src/components/data-table/COMPONENT.md +31 -21
- package/src/components/data-table/examples/controlled.tsx +14 -2
- package/src/components/data-table/examples/examples.module.css +1 -9
- package/src/components/data-table/examples/narrow.tsx +5 -1
- package/src/components/data-table/examples/row-link.tsx +2 -1
- package/src/components/data-table/examples/screen.module.css +2 -2
- package/src/components/data-table/examples/screen.tsx +11 -10
- package/src/components/data-table/examples/sizes.tsx +17 -17
- package/src/components/data-table/examples/states.tsx +37 -29
- package/src/components/datepicker/COMPONENT.md +53 -22
- package/src/components/datepicker/examples/dismiss.tsx +15 -0
- package/src/components/datepicker/examples/examples.module.css +3 -2
- package/src/components/datepicker/examples/in-form.tsx +33 -25
- package/src/components/datepicker/examples/sizes.tsx +2 -2
- package/src/components/datepicker/examples/states.tsx +2 -2
- package/src/components/datepicker/examples/validation.tsx +3 -3
- package/src/components/description-list/COMPONENT.md +24 -9
- package/src/components/description-list/examples/examples.module.css +4 -24
- package/src/components/description-list/examples/narrow.tsx +1 -1
- package/src/components/description-list/examples/screen.module.css +0 -18
- package/src/components/description-list/examples/screen.tsx +19 -27
- package/src/components/description-list/examples/sizes.tsx +2 -4
- package/src/components/description-list/examples/structure.tsx +6 -7
- package/src/components/description-list/examples/totals.tsx +40 -0
- package/src/components/digit-input/COMPONENT.md +12 -6
- package/src/components/digit-input/examples/examples.module.css +2 -2
- package/src/components/digit-input/examples/in-form.tsx +1 -1
- package/src/components/digit-input/examples/sizes.tsx +5 -3
- package/src/components/digit-input/examples/states.tsx +14 -6
- package/src/components/divider/COMPONENT.md +26 -12
- package/src/components/divider/examples/align.tsx +2 -4
- package/src/components/divider/examples/examples.module.css +13 -17
- package/src/components/divider/examples/or-separator.tsx +3 -5
- package/src/components/divider/examples/overview.tsx +18 -16
- package/src/components/divider/examples/vertical.tsx +5 -1
- package/src/components/divider/examples/with-icon.tsx +1 -1
- package/src/components/dnd/COMPONENT.md +52 -34
- package/src/components/dnd/examples/drop-zones.tsx +1 -1
- package/src/components/dnd/examples/examples.module.css +4 -6
- package/src/components/dnd/examples/states.tsx +41 -35
- package/src/components/drawer/COMPONENT.md +37 -14
- package/src/components/drawer/examples/guard.tsx +1 -3
- package/src/components/drawer/examples/header-actions.tsx +1 -1
- package/src/components/drawer/examples/in-form.tsx +31 -31
- package/src/components/drawer/examples/placement.tsx +31 -26
- package/src/components/drawer/examples/sizes.tsx +32 -27
- package/src/components/dropdown/COMPONENT.md +58 -23
- package/src/components/dropdown/examples/context-menu.tsx +75 -0
- package/src/components/dropdown/examples/examples.module.css +1 -1
- package/src/components/dropdown/examples/sizes.tsx +39 -34
- package/src/components/dropdown/examples/states.tsx +37 -29
- package/src/components/empty-page/COMPONENT.md +20 -9
- package/src/components/empty-page/examples/compact.tsx +28 -18
- package/src/components/empty-page/examples/examples.module.css +0 -43
- package/src/components/empty-page/examples/narrow.tsx +3 -3
- package/src/components/empty-page/examples/region-error.tsx +6 -11
- package/src/components/empty-page/examples/sizes.tsx +13 -13
- package/src/components/empty-page/examples/variants.tsx +34 -30
- package/src/components/example-frame/COMPONENT.md +21 -9
- package/src/components/example-frame/examples/controlled.tsx +3 -3
- package/src/components/field-list/COMPONENT.md +14 -8
- package/src/components/field-list/examples/sizes.tsx +32 -26
- package/src/components/field-list/examples/states.tsx +37 -31
- package/src/components/fieldset/COMPONENT.md +10 -5
- package/src/components/fieldset/examples/examples.module.css +1 -1
- package/src/components/file-upload/COMPONENT.md +67 -29
- package/src/components/file-upload/examples/avatar-upload.tsx +5 -5
- package/src/components/file-upload/examples/custom-body.tsx +12 -7
- package/src/components/file-upload/examples/examples.module.css +4 -4
- package/src/components/file-upload/examples/narrow.tsx +1 -1
- package/src/components/file-upload/examples/row-parts.tsx +4 -4
- package/src/components/file-upload/examples/screen.module.css +2 -2
- package/src/components/file-upload/examples/screen.tsx +6 -4
- package/src/components/file-upload/examples/sizes.tsx +1 -3
- package/src/components/file-upload/examples/states.tsx +1 -3
- package/src/components/file-upload/examples/variants.tsx +13 -7
- package/src/components/gallery/COMPONENT.md +16 -7
- package/src/components/gallery/examples/album-sizes.tsx +52 -0
- package/src/components/gallery/examples/controlled.tsx +40 -0
- package/src/components/gallery/examples/examples.module.css +1 -1
- package/src/components/gallery/examples/overview.tsx +15 -43
- package/src/components/gallery/examples/transfer.tsx +22 -13
- package/src/components/gantt/COMPONENT.md +21 -15
- package/src/components/gantt/examples/examples.module.css +0 -16
- package/src/components/gantt/examples/occupancy.tsx +2 -2
- package/src/components/gantt/examples/screen.tsx +2 -2
- package/src/components/gantt/examples/sizes.tsx +16 -16
- package/src/components/gantt/examples/states.tsx +34 -30
- package/src/components/gantt/examples/variants.tsx +27 -25
- package/src/components/hint/COMPONENT.md +24 -14
- package/src/components/hint/examples/examples.module.css +1 -1
- package/src/components/hint/examples/hint-or-error.tsx +2 -2
- package/src/components/hint/examples/overview.tsx +9 -10
- package/src/components/hint/examples/sizes.tsx +1 -1
- package/src/components/input/COMPONENT.md +10 -6
- package/src/components/input/examples/affixes.tsx +2 -2
- package/src/components/input/examples/examples.module.css +1 -1
- package/src/components/input/examples/sizes.tsx +9 -5
- package/src/components/input/examples/states.tsx +39 -23
- package/src/components/input/examples/with-icon.tsx +24 -16
- package/src/components/kanban/COMPONENT.md +30 -24
- package/src/components/kanban/examples/columns.tsx +14 -19
- package/src/components/kanban/examples/item-link.tsx +2 -2
- package/src/components/kanban/examples/limits.tsx +1 -1
- package/src/components/kanban/examples/narrow.tsx +1 -1
- package/src/components/kanban/examples/screen.module.css +1 -3
- package/src/components/kanban/examples/screen.tsx +6 -4
- package/src/components/kanban/examples/states.tsx +37 -58
- package/src/components/kanban/examples/variants.tsx +0 -3
- package/src/components/kbd/COMPONENT.md +10 -6
- package/src/components/kbd/examples/examples.module.css +1 -20
- package/src/components/kbd/examples/in-controls.tsx +2 -2
- package/src/components/kbd/examples/shortcut-list.tsx +14 -26
- package/src/components/label/COMPONENT.md +26 -11
- package/src/components/label/examples/examples.module.css +3 -11
- package/src/components/label/examples/overview.tsx +5 -9
- package/src/components/label/examples/structure.tsx +2 -2
- package/src/components/link-button/COMPONENT.md +33 -20
- package/src/components/link-button/examples/as-child.tsx +1 -1
- package/src/components/link-button/examples/external-link.tsx +1 -1
- package/src/components/link-button/examples/overview.tsx +4 -2
- package/src/components/link-button/examples/variants.tsx +2 -2
- package/src/components/list/COMPONENT.md +24 -16
- package/src/components/list/examples/examples.module.css +0 -8
- package/src/components/list/examples/overflow.tsx +1 -1
- package/src/components/list/examples/overview.tsx +31 -30
- package/src/components/list/examples/sizes.tsx +23 -23
- package/src/components/list/examples/states.tsx +38 -21
- package/src/components/list/examples/with-icon.tsx +16 -14
- package/src/components/login-form/COMPONENT.md +69 -16
- package/src/components/login-form/examples/narrow.tsx +1 -1
- package/src/components/login-form/examples/register.tsx +1 -1
- package/src/components/media-viewer/COMPONENT.md +12 -8
- package/src/components/media-viewer/examples/examples.module.css +2 -2
- package/src/components/media-viewer/examples/video.tsx +1 -1
- package/src/components/message/COMPONENT.md +102 -46
- package/src/components/message/examples/typing.tsx +5 -5
- package/src/components/modal/COMPONENT.md +71 -37
- package/src/components/modal/examples/dismiss.tsx +35 -27
- package/src/components/modal/examples/enter-key.tsx +22 -25
- package/src/components/modal/examples/examples.module.css +0 -7
- package/src/components/modal/examples/guard.tsx +2 -4
- package/src/components/modal/examples/in-form.tsx +28 -28
- package/src/components/modal/examples/long-content.tsx +6 -4
- package/src/components/modal/examples/sizes.tsx +36 -31
- package/src/components/modal/examples/structure.tsx +1 -1
- package/src/components/native-select/COMPONENT.md +7 -3
- package/src/components/native-select/examples/examples.module.css +3 -3
- package/src/components/native-select/examples/in-form.tsx +28 -29
- package/src/components/native-select/examples/sizes.tsx +2 -2
- package/src/components/native-select/examples/states.tsx +2 -2
- package/src/components/notification/COMPONENT.md +36 -31
- package/src/components/notification/examples/examples.module.css +1 -2
- package/src/components/notification/examples/in-form.tsx +28 -20
- package/src/components/notification/examples/sizes.tsx +16 -12
- package/src/components/notification/examples/undo.tsx +7 -15
- package/src/components/page-content/COMPONENT.md +21 -29
- package/src/components/page-content/examples/examples.module.css +3 -16
- package/src/components/page-content/examples/grid.tsx +3 -1
- package/src/components/page-content/examples/list-detail.tsx +55 -49
- package/src/components/page-content/examples/narrow.tsx +1 -1
- package/src/components/page-content/examples/overview.tsx +2 -2
- package/src/components/page-content/examples/variants.tsx +7 -7
- package/src/components/page-toolbar/COMPONENT.md +10 -6
- package/src/components/page-toolbar/examples/overview.tsx +1 -1
- package/src/components/page-toolbar/examples/save-changes.tsx +25 -22
- package/src/components/pagination/COMPONENT.md +20 -17
- package/src/components/pagination/examples/narrow.tsx +5 -5
- package/src/components/popover/COMPONENT.md +43 -20
- package/src/components/popover/examples/controlled-open.tsx +6 -4
- package/src/components/popover/examples/dismiss.tsx +37 -28
- package/src/components/popover/examples/examples.module.css +2 -2
- package/src/components/popover/examples/sizes.tsx +32 -27
- package/src/components/popover/examples/width.tsx +45 -0
- package/src/components/progress-bar/COMPONENT.md +21 -29
- package/src/components/progress-bar/examples/examples.module.css +1 -1
- package/src/components/progress-circle/COMPONENT.md +21 -29
- package/src/components/progress-circle/examples/examples.module.css +1 -1
- package/src/components/progress-circle/examples/on-color.tsx +16 -0
- package/src/components/progress-circle/examples/variants.tsx +1 -0
- package/src/components/radio/COMPONENT.md +13 -4
- package/src/components/radio/examples/examples.module.css +1 -1
- package/src/components/scroll-container/COMPONENT.md +18 -12
- package/src/components/scroll-container/examples/auto-scroll.tsx +8 -4
- package/src/components/scroll-container/examples/edges.tsx +4 -4
- package/src/components/scroll-container/examples/examples.module.css +7 -51
- package/src/components/scroll-container/examples/load-more.tsx +4 -4
- package/src/components/scroll-container/examples/lock.tsx +4 -4
- package/src/components/scroll-container/examples/log.tsx +97 -0
- package/src/components/scroll-container/examples/overscroll.tsx +4 -4
- package/src/components/scroll-container/examples/overview.tsx +5 -5
- package/src/components/scroll-container/examples/scrollbar.tsx +4 -4
- package/src/components/scroll-container/examples/snap.tsx +2 -2
- package/src/components/scroll-container/examples/variants.tsx +1 -0
- package/src/components/segmented-control/COMPONENT.md +24 -12
- package/src/components/segmented-control/examples/controlled.tsx +2 -4
- package/src/components/segmented-control/examples/examples.module.css +0 -8
- package/src/components/segmented-control/examples/scroll.tsx +1 -1
- package/src/components/select/COMPONENT.md +33 -9
- package/src/components/select/examples/dismiss.tsx +26 -0
- package/src/components/select/examples/examples.module.css +1 -1
- package/src/components/select/examples/server-search.tsx +6 -2
- package/src/components/select/examples/sizes.tsx +2 -2
- package/src/components/select/examples/states.tsx +2 -2
- package/src/components/select/examples/with-icon.tsx +20 -18
- package/src/components/sheet/COMPONENT.md +44 -21
- package/src/components/sheet/examples/header-actions.tsx +23 -4
- package/src/components/sheet/examples/overview.tsx +25 -10
- package/src/components/skeleton/COMPONENT.md +8 -4
- package/src/components/skeleton/examples/examples.module.css +1 -13
- package/src/components/skeleton/examples/with-crossfade.tsx +7 -7
- package/src/components/slider/COMPONENT.md +10 -5
- package/src/components/slider/examples/examples.module.css +6 -7
- package/src/components/slider/examples/hint-and-error.tsx +3 -5
- package/src/components/slider/examples/in-form.tsx +21 -19
- package/src/components/smart-filter/COMPONENT.md +32 -12
- package/src/components/smart-filter/examples/examples.module.css +0 -21
- package/src/components/smart-filter/examples/ranges.tsx +2 -1
- package/src/components/smart-filter/examples/sizes.tsx +2 -4
- package/src/components/sparkline/COMPONENT.md +7 -3
- package/src/components/sparkline/examples/examples.module.css +1 -1
- package/src/components/sparkline/examples/signed-bars.tsx +2 -2
- package/src/components/spinner/COMPONENT.md +15 -9
- package/src/components/spinner/examples/examples.module.css +2 -14
- package/src/components/spinner/examples/overview.tsx +1 -1
- package/src/components/stepper/COMPONENT.md +50 -41
- package/src/components/stepper/examples/examples.module.css +1 -6
- package/src/components/stepper/examples/narrow.tsx +1 -1
- package/src/components/stepper/examples/sizes.tsx +6 -8
- package/src/components/stepper/examples/states.tsx +44 -43
- package/src/components/stepper/examples/with-icon.tsx +19 -17
- package/src/components/switch/COMPONENT.md +21 -8
- package/src/components/switch/examples/examples.module.css +2 -2
- package/src/components/switch/examples/states.tsx +3 -3
- package/src/components/tabs/COMPONENT.md +21 -16
- package/src/components/tabs/examples/in-drawer.tsx +1 -1
- package/src/components/tabs/examples/sizes.tsx +5 -10
- package/src/components/tabs/examples/variants.tsx +19 -23
- package/src/components/tag-select/COMPONENT.md +19 -6
- package/src/components/tag-select/examples/creatable.tsx +2 -2
- package/src/components/tag-select/examples/dismiss.tsx +23 -0
- package/src/components/tag-select/examples/examples.module.css +3 -3
- package/src/components/tag-select/examples/in-form.tsx +31 -32
- package/src/components/tag-select/examples/sizes.tsx +2 -2
- package/src/components/tag-select/examples/states.tsx +2 -2
- package/src/components/textarea/COMPONENT.md +10 -6
- package/src/components/textarea/examples/examples.module.css +3 -10
- package/src/components/textarea/examples/in-form.tsx +3 -3
- package/src/components/textarea/examples/sizes.tsx +10 -7
- package/src/components/textarea/examples/states.tsx +29 -13
- package/src/components/textarea/examples/validation.tsx +45 -36
- package/src/components/thumbnail/COMPONENT.md +17 -13
- package/src/components/thumbnail/examples/examples.module.css +1 -1
- package/src/components/thumbnail/examples/states.tsx +1 -1
- package/src/components/thumbnail/examples/variants.tsx +12 -1
- package/src/components/timeline/COMPONENT.md +51 -35
- package/src/components/timeline/examples/links.tsx +14 -14
- package/src/components/timeline/examples/narrow.tsx +6 -6
- package/src/components/timeline/examples/overview.tsx +6 -6
- package/src/components/timeline/examples/sizes.tsx +28 -23
- package/src/components/timeline/examples/structure.tsx +30 -30
- package/src/components/timeline/examples/variants.tsx +40 -28
- package/src/components/tooltip/COMPONENT.md +10 -6
- package/src/components/tooltip/examples/examples.module.css +1 -5
- package/src/components/tooltip/examples/non-interactive-trigger.tsx +1 -1
- package/src/components/tooltip/examples/sizes.tsx +17 -10
- package/src/components/typography/COMPONENT.md +17 -2
- package/src/components/typography/examples/examples.module.css +3 -6
- package/src/components/typography/examples/numeric.tsx +16 -0
- package/src/components/video-note/COMPONENT.md +11 -7
- package/src/components/visually-hidden/COMPONENT.md +8 -4
- package/src/components/visually-hidden/examples/assertive.tsx +1 -1
- package/src/components/visually-hidden/examples/overview.tsx +17 -7
- package/src/components/voice-player/COMPONENT.md +15 -7
- package/src/layout/app-header/COMPONENT.md +27 -26
- package/src/layout/app-header/examples/examples.module.css +4 -23
- package/src/layout/app-header/examples/in-app-shell.tsx +3 -5
- package/src/layout/app-header/examples/narrow.tsx +58 -20
- package/src/layout/app-shell/COMPONENT.md +40 -10
- package/src/layout/app-shell/examples/examples.module.css +2 -22
- package/src/layout/app-shell/examples/footer.tsx +2 -2
- package/src/layout/app-shell/examples/overview.tsx +3 -5
- package/src/layout/app-shell/examples/screen.tsx +27 -21
- package/src/layout/app-shell/examples/template.tsx +3 -3
- package/src/layout/bottom-nav/COMPONENT.md +27 -17
- package/src/layout/bottom-nav/examples/examples.module.css +2 -7
- package/src/layout/bottom-nav/examples/floating-action.tsx +2 -2
- package/src/layout/bottom-nav/examples/floating.tsx +2 -2
- package/src/layout/bottom-nav/examples/in-app-shell.tsx +2 -2
- package/src/layout/bottom-nav/examples/router.tsx +6 -5
- package/src/layout/sidebar/COMPONENT.md +50 -40
- package/src/layout/sidebar/examples/account.tsx +1 -3
- package/src/layout/sidebar/examples/brand-header.tsx +1 -3
- package/src/layout/sidebar/examples/collapsible-groups.tsx +1 -3
- package/src/layout/sidebar/examples/controlled-open.tsx +1 -3
- package/src/layout/sidebar/examples/controlled.tsx +1 -3
- package/src/layout/sidebar/examples/custom-part.tsx +1 -3
- package/src/layout/sidebar/examples/dismiss.tsx +47 -0
- package/src/layout/sidebar/examples/examples.module.css +7 -32
- package/src/layout/sidebar/examples/narrow.tsx +44 -42
- package/src/layout/sidebar/examples/nested-items.tsx +1 -3
- package/src/layout/sidebar/examples/overview.tsx +1 -3
- package/src/layout/sidebar/examples/persist.tsx +1 -3
- package/src/layout/sidebar/examples/router.tsx +12 -13
- package/src/layout/sidebar/examples/sizes.tsx +6 -6
- package/src/styles/controls.css +2 -2
- package/src/styles/fonts.css +22 -0
- package/src/styles/globals.css +89 -12
- package/src/styles/theme-dark.css +13 -14
- package/src/styles/theme-light.css +67 -23
- package/src/styles/tokens.css +14 -4
- package/dist/components/dnd/useFlipList.d.ts +0 -17
- package/dist/components/gantt/useEdgeAutoScroll.d.ts +0 -12
- package/dist/components/modal/ModalDialog.d.ts +0 -46
- package/dist/hooks/useStateSwap.d.ts +0 -8
- package/dist/internal/highlightTsxHtml.d.ts +0 -2
- package/dist/internal/layoutPxFromPrimitives.d.ts +0 -6
- package/dist/internal/mergeRefs.d.ts +0 -6
- package/dist/skill/reference/components/drawer/examples/examples.module.css +0 -8
- package/dist/skill/reference/components/popover/examples/match-trigger-width.tsx +0 -23
- package/dist/skill/reference/components/scroll-container/examples/chat.tsx +0 -101
- package/dist/skill/reference/components/spinner/examples/loading-region.tsx +0 -22
- package/src/components/drawer/examples/examples.module.css +0 -8
- package/src/components/popover/examples/match-trigger-width.tsx +0 -23
- package/src/components/scroll-container/examples/chat.tsx +0 -101
- package/src/components/spinner/examples/loading-region.tsx +0 -22
|
@@ -25,7 +25,7 @@ import { Composer, type ComposerActivity, type ComposerMessage, useUploadQueue }
|
|
|
25
25
|
## Anatomy
|
|
26
26
|
```
|
|
27
27
|
Composer.Root <form>: the column below, one tier for every part
|
|
28
|
-
├─ (video preview) round camera preview (VideoNote geometry, Skeleton until the camera answers, progress ring to 60 s)
|
|
28
|
+
├─ (video preview) round camera preview (VideoNote geometry, Skeleton until the camera answers, progress ring to 60 s, `weight="band"`)
|
|
29
29
|
├─ (tray) Crossfade of `queue`: opens and closes with a fade and a height glide
|
|
30
30
|
│ ├─ (strip) FileUpload.Queue layout="strip": one row of tiles — photos, videos and
|
|
31
31
|
│ │ files in tray order; format pill, remove ×, name · size band, upload disk + ring, reorder
|
|
@@ -53,10 +53,10 @@ Sending is an async event (`SKILL/api-contract.md`, Events):
|
|
|
53
53
|
const queue = useUploadQueue({ upload: sendFile });
|
|
54
54
|
<Composer.Root
|
|
55
55
|
queue={queue}
|
|
56
|
-
onSend={({ text,
|
|
56
|
+
onSend={({ text, albums, files }) =>
|
|
57
57
|
api.post(chatId, {
|
|
58
58
|
text,
|
|
59
|
-
|
|
59
|
+
albums: albums.map((album) => album.map((item) => ({ type: item.type, id: item.result }))),
|
|
60
60
|
files: files.map((item) => item.result),
|
|
61
61
|
})
|
|
62
62
|
}
|
|
@@ -68,9 +68,9 @@ const queue = useUploadQueue({ upload: sendFile });
|
|
|
68
68
|
|
|
69
69
|
`text` arrives trimmed. While the Promise runs the button is busy and the field read-only; resolve clears the field and the queue and closes the reply / edit bar (its `onDismiss`), reject leaves the text for another try.
|
|
70
70
|
|
|
71
|
-
Every attachment is a tile of one strip, in the order attached and then reordered by the person. Photos and videos arrive as `
|
|
71
|
+
Every attachment is a tile of one strip, in the order attached and then reordered by the person. Photos and videos arrive as `albums` in that order, a new album every ten (the most a `Gallery` lays out) — send each as one `Message.Media` message, the text as the caption of the first — and the other files as `files` in that order, a `Message.File` each. Clearing the queue revokes its previews, so a sent album shows from `result` (the server's URL) or from your own `URL.createObjectURL(item.file)` — revoke it when its message is deleted or the chat unmounts.
|
|
72
72
|
|
|
73
|
-
In an optimistic chat the send returns at once: add the message to the list with `status="sending"` under a client id, then patch its status as the server answers — the row keeps its key, so it never enters twice. Give the reply / edit bar the message id (`Composer.Context
|
|
73
|
+
In an optimistic chat the send returns at once: add the message to the list with `status="sending"` under a client id, then patch its status as the server answers — the row keeps its key, so it never enters twice. Give the reply / edit bar the message id (`Composer.Context messageId`) and the send says what it answers or edits:
|
|
74
74
|
|
|
75
75
|
```tsx partial
|
|
76
76
|
<Composer.Root
|
|
@@ -78,7 +78,7 @@ In an optimistic chat the send returns at once: add the message to the list with
|
|
|
78
78
|
onActivityChange={(activity) => chat.signal(activity)}
|
|
79
79
|
>
|
|
80
80
|
{replyTo ? (
|
|
81
|
-
<Composer.Context
|
|
81
|
+
<Composer.Context messageId={replyTo.id} onDismiss={() => setReplyTo(null)}>
|
|
82
82
|
<Composer.Title>Ответ Анне</Composer.Title>
|
|
83
83
|
<Composer.Description>{replyTo.text}</Composer.Description>
|
|
84
84
|
</Composer.Context>
|
|
@@ -98,7 +98,7 @@ In an optimistic chat the send returns at once: add the message to the list with
|
|
|
98
98
|
| `value` | `string` | — | The text of the message (controlled). |
|
|
99
99
|
| `defaultValue` | `string` | `""` | Initial text, uncontrolled (a saved draft). |
|
|
100
100
|
| `onValueChange` | `(value: string) => void` | — | Every change of the text: typing, formatting, the field cleared after a send. |
|
|
101
|
-
| `onSend` | `(message: { text: string;
|
|
101
|
+
| `onSend` | `(message: { text: string; albums: readonly (readonly (UploadItem & { type: "image" \| "video" })[])[]; files: readonly UploadItem[]; replyTo?: string; editOf?: string }) => void \| Promise<unknown>` | — | Sends the message (Enter, Mod+Enter, the button): trimmed `text`, photos and videos as `albums` of up to 10, `files`, `replyTo` / `editOf`. A Promise keeps the text until it resolves; reject changes nothing. |
|
|
102
102
|
| `onActivityChange` | `(activity: "typing" \| "voice" \| "video" \| null) => void` | — | What the person is doing changed, for the other side's «печатает…»: `typing`, `voice` / `video` while recording, or `null`. Fires on a change only. |
|
|
103
103
|
| `onSendVoice` | `(recording: { blob: Blob; durationMs: number; waveform: number[] }) => void \| Promise<unknown>` | — | A voice message was recorded: the `MediaRecorder` blob, its length and 48 loudness values 0…1 for its waveform. With it an empty field shows the record button (where the browser can record). |
|
|
104
104
|
| `onSendVideoNote` | `(recording: { blob: Blob; durationMs: number; waveform: number[] }) => void \| Promise<unknown>` | — | A round video message was recorded (front camera and microphone), at most 60 s. With both record handlers a double click or tap on the record button (or ↑ / ↓ on it) switches voice and video. |
|
|
@@ -108,7 +108,7 @@ In an optimistic chat the send returns at once: add the message to the list with
|
|
|
108
108
|
| `onRecordModeChange` | `(mode: "voice" \| "video") => void` | — | A double click / double tap on the record button (or ↑ / ↓ on it) switched voice and video. |
|
|
109
109
|
| `queue` | `Pick<UploadQueue, "items" \| "add" \| "retry" \| "remove" \| "clear" \| "move">` | — | Attachments, usually `useUploadQueue(…)`: the paperclip, a paste and a drop add to it, and a tray above the row shows them as one reorderable strip of tiles. Without `queue` paste and drop of files do nothing. |
|
|
110
110
|
| `formatting` | `boolean` | `true` | Selecting text shows a floating toolbar of seven Markdown tools and enables their hotkeys; a tool wraps the selection, a second press unwraps it. `false` turns both off. |
|
|
111
|
-
| `size` | `"xs" \| "s" \| "m" \| "l" \| "xl"` |
|
|
111
|
+
| `size` | `"xs" \| "s" \| "m" \| "l" \| "xl"` | host tier, else `"m"` | Tier of the field, the buttons and the bar text. Without it the tier of its host, else `m`. |
|
|
112
112
|
| `disabled` | `boolean` | `false` | A closed conversation: the field, the paperclip and the button are disabled; nothing is pasted or dropped. A disabled `Fieldset` around it sets it too (`data-disabled` included). |
|
|
113
113
|
| `inputRef` | `Ref<HTMLTextAreaElement>` | — | The message `<textarea>`: focus it after «Ответить» in a message menu. |
|
|
114
114
|
| `labels` | `Partial<ComposerLabels>` | — | Built-in strings, see Labels. |
|
|
@@ -116,26 +116,32 @@ In an optimistic chat the send returns at once: add the message to the list with
|
|
|
116
116
|
| `…rest` | `Omit<FormHTMLAttributes<HTMLFormElement>, "children" \| "defaultValue" \| "onSubmit">` | — | `className`, `aria-*`, `onKeyDown` and the other attributes of the `<form>`. |
|
|
117
117
|
|
|
118
118
|
### Composer.Context
|
|
119
|
-
`ref` → `HTMLDivElement`. The bar above the field: a reply or edit glyph, `Composer.Title` over `Composer.Description` behind an accent rule, and a close button; it describes the field; when it appears, the caret moves to the field.
|
|
119
|
+
`ref` → `HTMLDivElement`. The bar above the field: a reply or edit glyph, `Composer.Title` over `Composer.Description` behind an accent rule, and a close button; it describes the field; when it appears, the caret moves to the field.
|
|
120
120
|
|
|
121
121
|
| Prop | Type | Default | Description |
|
|
122
122
|
|---|---|---|---|
|
|
123
123
|
| `mode` | `"reply" \| "edit"` | `"reply"` | `reply` — a reply to a message; `edit` — your message is being edited: the send button turns into «Сохранить» and the record button is not offered. |
|
|
124
|
-
| `
|
|
124
|
+
| `messageId` | `string` | — | The id of the message answered or edited: `onSend` receives it as `replyTo` (`reply`) or `editOf` (`edit`). |
|
|
125
125
|
| `onDismiss` | `() => void` | — | Stop replying or editing: the close button, Escape in the field, and a send that went through. Without it the bar has no close button. |
|
|
126
126
|
| `children` | `ReactNode` | — | `Composer.Title` and `Composer.Description`. |
|
|
127
|
+
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `className` and the other div attributes. |
|
|
127
128
|
|
|
128
129
|
### Composer.Title · Composer.Description
|
|
129
|
-
`ref` → `HTMLDivElement`. The first line of the bar in the accent text color, medium weight («Ответ Анне», «Редактирование») / the quoted message in the secondary color; both one line, cut with an ellipsis.
|
|
130
|
+
`ref` → `HTMLDivElement`. The first line of the bar in the accent text color, medium weight («Ответ Анне», «Редактирование») / the quoted message in the secondary color; both one line, cut with an ellipsis.
|
|
131
|
+
|
|
132
|
+
| Prop | Type | Default | Description |
|
|
133
|
+
|---|---|---|---|
|
|
134
|
+
| `…rest` | `HTMLAttributes<HTMLDivElement>` | — | `children`, `className` and the other div attributes. |
|
|
130
135
|
|
|
131
136
|
### Composer.Attach
|
|
132
|
-
`ref` → `HTMLDivElement`. The paperclip at the start of the row. Alone it opens the file picker (FileUpload `trigger="button"`); with `Composer.Item` children it opens a menu where every item picks its own file types. Files go to the root's `queue`.
|
|
137
|
+
`ref` → `HTMLDivElement`. The paperclip at the start of the row. Alone it opens the file picker (FileUpload `trigger="button"`); with `Composer.Item` children it opens a menu where every item picks its own file types. Files go to the root's `queue`.
|
|
133
138
|
|
|
134
139
|
| Prop | Type | Default | Description |
|
|
135
140
|
|---|---|---|---|
|
|
136
141
|
| `accept` | `string` | — | File types of the picker without a menu. |
|
|
137
142
|
| `aria-label` | `string` | — | Name of the button. Default `labels.attach`. |
|
|
138
143
|
| `children` | `ReactNode` | — | `Composer.Item` kinds of attachment. |
|
|
144
|
+
| `…rest` | `Omit<HTMLAttributes<HTMLDivElement>, "children">` | — | `className` and the other div attributes. |
|
|
139
145
|
|
|
140
146
|
### Composer.Item
|
|
141
147
|
`ref` → `HTMLButtonElement`. A kind of attachment in the paperclip menu, a `Dropdown.Item` (`role="menuitem"`): `Composer.ItemIcon` and the label. + native button props.
|
|
@@ -145,9 +151,14 @@ In an optimistic chat the send returns at once: add the message to the list with
|
|
|
145
151
|
| `accept` | `string` | — | File types this item picks (`"image/*,video/*"`; `""` for any file). Without it the item only runs `onSelect`. |
|
|
146
152
|
| `onSelect` | `() => void` | — | The item's own action (a poll, a location); runs after the picker opens when `accept` is set. |
|
|
147
153
|
| `disabled` | `boolean` | `false` | Muted and skipped by the arrow keys. |
|
|
154
|
+
| `…rest` | `Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onSelect" \| "type">` | — | `children`, `className` and the other button attributes. |
|
|
148
155
|
|
|
149
156
|
### Composer.ItemIcon
|
|
150
|
-
`ref` → `HTMLSpanElement`. The leading glyph of a menu item (`Dropdown.ItemIcon`, `aria-hidden`).
|
|
157
|
+
`ref` → `HTMLSpanElement`. The leading glyph of a menu item (`Dropdown.ItemIcon`, `aria-hidden`).
|
|
158
|
+
|
|
159
|
+
| Prop | Type | Default | Description |
|
|
160
|
+
|---|---|---|---|
|
|
161
|
+
| `…rest` | `HTMLAttributes<HTMLSpanElement>` | — | `children` (the `Icon`), `className` and the other span attributes. |
|
|
151
162
|
|
|
152
163
|
## Variants
|
|
153
164
|
Composer has no `variant`; what the row shows follows its state.
|
|
@@ -179,19 +190,19 @@ Composer has no `variant`; what the row shows follows its state.
|
|
|
179
190
|
| State | Driven by | DOM |
|
|
180
191
|
|---|---|---|
|
|
181
192
|
| empty | no text, no attachments | with a record handler the button is the quiet ghost microphone (or camera), else a disabled send |
|
|
182
|
-
| typing | text | the button turns into the accent send; the glyph
|
|
193
|
+
| typing | text | the button turns into the accent send; the glyph cross-fades into the plane (`Button.Icon`) |
|
|
183
194
|
| attachments | `queue.items` | the tray above the row: one strip of tiles in the order attached — photos and videos (MIME type, else the name's extension) as the local preview or first frame, other files as the sheet glyph, each with the format pill and a name · size (duration) band; while a file goes up a disk with the progress ring along its edge stands in the middle of a picture (dimmed under it) or in place of a file's sheet (name and size stay readable) (pressing it cancels, a failure turns it into a danger retry, done fades it away), remove ×, reorder by drag or `Alt + ←` / `→`; send is disabled while any is `queued` / `uploading` |
|
|
184
|
-
| as files | the «Отправить как файлы, без сжатия» checkbox (shown with photos or videos) | the view stays the same (the strip); `onSend` gets every file in `files` and `
|
|
195
|
+
| as files | the «Отправить как файлы, без сжатия» checkbox (shown with photos or videos) | the view stays the same (the strip); `onSend` gets every file in `files` and `albums` empty; reset after a send |
|
|
185
196
|
| sending | `onSend` returned a Promise | button `loading` (`aria-busy`), textarea `readonly`, text kept |
|
|
186
197
|
| sent | the Promise resolved (or nothing returned) | field and queue cleared (the previews revoked, the tray fades and glides closed), the reply / edit bar's `onDismiss` called, focus stays in the field; `onActivityChange(null)` |
|
|
187
|
-
| reply / edit | `Composer.Context` | bar above the field (enters with `enterMotion`); `mode="edit"` turns send into save; its `
|
|
198
|
+
| reply / edit | `Composer.Context` | bar above the field (enters with `enterMotion`); `mode="edit"` turns send into save; its `messageId` goes to `onSend` as `replyTo` / `editOf` |
|
|
188
199
|
| activity | typing, recording | `onActivityChange`: `typing` from the first keystroke until the text is sent, emptied or rests for 3 s; `voice` / `video` while the recording bar shows; `null` after, and on unmount while active. It fires on a change only: a server that expires the signal wants it repeated on your side while the value is not `null` |
|
|
189
200
|
| selection | a non-empty selection while the field has focus | the floating toolbar fades in from below (`overlayMotion` floating, `data-side="top"`); a tool wraps the selection in its Markdown, a second press removes it |
|
|
190
201
|
| files over | a file drag over the composer (with `queue`) | `data-dropping="true"`: an accent ring over the field; a drop adds the files to the queue. A pasted file with no type (a screenshot from some apps) takes its clipboard item's type. Without `queue` paste and drop of files do nothing |
|
|
191
|
-
| recording, held | `data-recording="hold"` (a finger on the button; with voice and video both offered, from 200 ms of holding) | recording bar over the paperclip and the field with «Влево — отмена» sliding and fading with the finger — a slide of `--prime-space-24` throws the recording away; lock pill above the button, a lift of `--prime-space-12` locks; release sends |
|
|
202
|
+
| recording, held | `data-recording="hold"` (a finger on the button; with voice and video both offered, from 200 ms of holding) | recording bar over the paperclip and the field with «Влево — отмена» sliding and fading with the finger — a slide of `--prime-space-24` throws the recording away; lock pill above the button (a floating surface, `data-depth="floating"`) rises in, a lift of `--prime-space-12` locks and it snaps away; release sends |
|
|
192
203
|
| recording, locked | `data-recording="locked"` (a mouse click, Enter / Space, a tap shorter than 200 ms, or a slide up) | delete button · pause button · dot · timer · live waveform over the full free width; the button and Enter send; a video message sends itself at 60 s of recorded time |
|
|
193
|
-
| recording, paused | Space or the pause button during a hands-free recording (`MediaRecorder.pause()`) | `data-paused` on the bar: the dot
|
|
194
|
-
| double-click window | with voice and video both offered, the 300 ms after a click or a tap | no `data-recording` yet: the button keeps its glyph and nothing is announced; with a granted microphone voice already records. A second press inside it discards that recording unseen and switches the mode (glyph swap, «Голосовое сообщение» / «Видеосообщение» announced); otherwise the bar
|
|
204
|
+
| recording, paused | Space or the pause button during a hands-free recording (`MediaRecorder.pause()`) | `data-paused` on the bar: the dot cross-fades into a still pause glyph (`GlyphSwap`), the timer and the waveform stand, the video ring stops; Space or «Продолжить запись» resumes; a send hands over what was recorded, without the pause |
|
|
205
|
+
| double-click window | with voice and video both offered, the 300 ms after a click or a tap | no `data-recording` yet: the button keeps its glyph and nothing is announced; with a granted microphone voice already records. A second press inside it discards that recording unseen and switches the mode (glyph swap, «Голосовое сообщение» / «Видеосообщение» announced); otherwise the bar rises in over the field with the timer counting from the first press; when the recording ends it closes up in place |
|
|
195
206
|
| starting | the press is answered, the device is not granted yet | already the recording bar with a running timer (it counts from the press) while the device is asked for in parallel; the waveform is a calm line of dots |
|
|
196
207
|
| too short | a recording under 0.7 s | dropped: nothing is sent |
|
|
197
208
|
| record error | the browser refused / found no device | the bar cross-fades back to the field; `Hint` with `role="alert"` above the row, cleared by typing or the next attempt |
|
|
@@ -203,7 +214,7 @@ Motion: the tray opens and closes as a Crossfade (fade and height glide, the row
|
|
|
203
214
|
- The row stands on its bottom edge with `--prime-space-2` gaps: the paperclip and the button stay by the last line as the field grows. Field → bar / attachments above: `--prime-space-2`.
|
|
204
215
|
- The tray is never in the row: the strip (`--prime-space-24` square tiles, one row scrolling sideways with faded edges, so its height is one tile at any count) and the «как файлы» checkbox stack with `--prime-space-2` gaps above it.
|
|
205
216
|
- The field grows from one line to eight and then scrolls inside; its padding centres one line exactly like an Input of the tier.
|
|
206
|
-
- The composer takes its container's width and works
|
|
217
|
+
- The composer takes its container's width and works on the narrowest phone (320 px); it is a size container, the round video preview is `--prime-message-video-note` wide, at most 70% of its width, and needs that room above the composer (a chat history gives it).
|
|
207
218
|
- The recording bar covers the paperclip and the field, so entering and leaving a recording never changes the row height; its waveform takes all the width between the timer and the send button, as tall as the button minus `--prime-space-2`, in VoicePlayer's bar geometry.
|
|
208
219
|
- On touch the editable text is at least 16 px (no iOS zoom) and every button has the 44 px hit area.
|
|
209
220
|
- The formatting toolbar floats above the field's start edge on the floating layer, over whatever is above the composer.
|
|
@@ -211,6 +222,8 @@ Motion: the tray opens and closes as a Crossfade (fade and height glide, the row
|
|
|
211
222
|
## Accessibility
|
|
212
223
|
|
|
213
224
|
### Keyboard
|
|
225
|
+
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
226
|
+
|
|
214
227
|
| Key | Action |
|
|
215
228
|
|---|---|
|
|
216
229
|
| `Enter` | In the field sends the message; on a touch screen breaks the line. |
|
|
@@ -227,6 +240,8 @@ Motion: the tray opens and closes as a Crossfade (fade and height glide, the row
|
|
|
227
240
|
| `Delete` · `Backspace` | On a tile of the tray: removes the attachment; focus moves to its neighbour. |
|
|
228
241
|
|
|
229
242
|
### ARIA
|
|
243
|
+
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
244
|
+
|
|
230
245
|
- The composer is a `<form>` named «Новое сообщение»; the field is a `<textarea>` named «Сообщение» with `enterkeyhint="send"` (`enter` on touch).
|
|
231
246
|
- A reply / edit bar describes the field (`aria-describedby`); when it appears after the first render the caret moves to the field. Its close button is «Отменить ответ» / «Отменить редактирование». A send that went through closes it.
|
|
232
247
|
- The formatting toolbar is `role="toolbar"` with one Tab stop and arrow keys; every button has `aria-keyshortcuts` and a tooltip with its keys (`⌘B` on Apple systems, `Ctrl+B` elsewhere).
|
|
@@ -234,6 +249,8 @@ Motion: the tray opens and closes as a Crossfade (fade and height glide, the row
|
|
|
234
249
|
- A live region (`role="status"`) announces a recording started, locked, deleted and sent, and the record mode after a switch («Голосовое сообщение» / «Видеосообщение»); a refused microphone is a `role="alert"` message that also describes the field, never a thrown error.
|
|
235
250
|
- While recording the paperclip and the field are `inert` under the bar; the bar's buttons are «Удалить запись» and «Приостановить запись» / «Продолжить запись» (`aria-keyshortcuts="Space"`), the action button «Отправить запись». Deleting brings the focus back to the action button. Pause and resume are announced. The timer and the waveform are decorative. While a finger holds a recording only `Escape` works (it throws the recording away); the delete and pause buttons keep their own Enter and Space.
|
|
236
251
|
- The attachments are one `<ul>` named «Вложения» (FileUpload.Queue `layout="strip"`): every tile is «Фото N: name» / «Видео N: name» / «Файл N: name» with its upload state, `aria-keyshortcuts` for `Alt + ←` / `→` and `Delete`, a remove button «Убрать name»; the upload disk is a `progressbar` while the file goes up. Moves are announced by Dnd's live region, finished and failed files by the queue's. «Отправить как файлы, без сжатия» is a labelled Checkbox.
|
|
252
|
+
- Touch: the buttons get a 44 px hit area; Enter breaks the line, the button sends.
|
|
253
|
+
- Voice and video together: a single press records without holding, a double press (within 300 ms) switches the mode. The first press records silently until the window ends, so a double press shows no recording and sends nothing.
|
|
237
254
|
|
|
238
255
|
### Labels
|
|
239
256
|
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
@@ -285,19 +302,20 @@ Motion: the tray opens and closes as a Crossfade (fade and height glide, the row
|
|
|
285
302
|
| [sizes.tsx](examples/sizes.tsx) | One composer in every tier: field, buttons and the paperclip follow it — `size`. |
|
|
286
303
|
| [attachments.tsx](examples/attachments.tsx) | Warehouse photos and documents for a client go through an upload queue: the paperclip opens the file picker for photos, videos and office documents, a paste or a drop adds files too, every attachment is a tile of one strip that drags into its order, and send waits until the uploads finish — `queue`, `Composer.Attach`, `accept`, `useUploadQueue`. |
|
|
287
304
|
| [attach-menu.tsx](examples/attach-menu.tsx) | The paperclip as a menu of attachment kinds: photos and videos, documents, any file, and an invoice from the system that puts its link into the message and returns the focus to the field — `Composer.Item`, `Composer.ItemIcon`, `accept`, `onSelect`, `inputRef`. |
|
|
288
|
-
| [reply-edit.tsx](examples/reply-edit.tsx) | Answering a client's message and correcting your own: the bar above the field quotes the message, Escape or the cross cancels, ↑ in an empty field opens your last message, send becomes save and hands over the message id — `Composer.Context`, `mode`, `
|
|
305
|
+
| [reply-edit.tsx](examples/reply-edit.tsx) | Answering a client's message and correcting your own: the bar above the field quotes the message, Escape or the cross cancels, ↑ in an empty field opens your last message, send becomes save and hands over the message id — `Composer.Context`, `mode`, `messageId`, `onDismiss`, `onEditLast`. |
|
|
289
306
|
| [typing.tsx](examples/typing.tsx) | The other side's status line follows what you do: typing, recording a voice or a video message, then nothing — `onActivityChange`. |
|
|
290
307
|
| [formatting.tsx](examples/formatting.tsx) | Selected text gets a toolbar of bold, italic, strikethrough, code, spoiler, link and quote, each with its shortcut, written as Markdown around the selection — `formatting`. |
|
|
291
308
|
| [voice.tsx](examples/voice.tsx) | Voice and round video messages: hold the button to record and release to send, slide left to cancel, slide up or tap to record hands-free; a double tap or double click switches voice and video — `onSendVoice`, `onSendVideoNote`, `recordMode`. |
|
|
292
309
|
| [states.tsx](examples/states.tsx) | A closed conversation is disabled, a slow send keeps the text with a busy button until the server answers — `disabled`, `onSend`. |
|
|
293
310
|
| [controlled.tsx](examples/controlled.tsx) | Every conversation keeps its own draft: switching the chat swaps the text, a template button fills it from outside — `value`, `onValueChange`. |
|
|
294
|
-
| [narrow.tsx](examples/narrow.tsx) | On a phone-width chat the row keeps the paperclip, the field and the button; Enter makes a new line on touch screens and the button sends. |
|
|
311
|
+
| [narrow.tsx](examples/narrow.tsx) | On a phone-width chat the row keeps the paperclip, the field and the button; Enter makes a new line on touch screens and the button sends — `Composer.Attach`, `onSend`. |
|
|
295
312
|
|
|
296
313
|
## Mistakes
|
|
297
314
|
- A `<Textarea>` with a hand-made send button and an Enter handler → `Composer.Root`: Enter / Shift+Enter / touch, the async send, the clearing and the focus are built in.
|
|
298
315
|
- Clearing the field in `onSend` before the server answers → return the Promise; the composer clears on resolve and keeps the text on reject.
|
|
299
316
|
- Rendering the attachment rows yourself → pass `queue`; the tray, paste and drop come with it.
|
|
300
|
-
- Sending photos as file messages → send `
|
|
317
|
+
- Sending photos as file messages → send each of `albums` as one `Message.Media` message (its order is the tray's), `files` as `Message.File`.
|
|
318
|
+
- Cutting `media` into albums of ten by hand → `albums` comes split.
|
|
301
319
|
- Showing a sent photo from `item.preview` → the queue revokes it after the send; use `result` or your own object URL of `item.file`, revoked with its message.
|
|
302
320
|
- Expecting HTML from the formatting → the text is Markdown (`**…**`, `_…_`, `~~…~~`, `` `…` ``, `||…||`, Markdown links, `> `); render it with the message component, never as HTML.
|
|
303
321
|
- Hiding the reply bar by CSS → unmount `Composer.Context` in `onDismiss`; Escape and a sent message call the same handler.
|
|
@@ -308,5 +326,5 @@ Motion: the tray opens and closes as a Crossfade (fade and height glide, the row
|
|
|
308
326
|
- An `aria-label` on the root to rename the field → use `labels.placeholder` (the field) and `labels.region` (the form).
|
|
309
327
|
|
|
310
328
|
## Related
|
|
311
|
-
- **Built from:** [Textarea](../textarea/COMPONENT.md), [Button](../button/COMPONENT.md), [FileUpload](../file-upload/COMPONENT.md) (the paperclip; `FileUpload.Queue layout="strip"`, the tray), [Crossfade](../crossfade/COMPONENT.md), [Checkbox](../checkbox/COMPONENT.md), [Dropdown](../dropdown/COMPONENT.md), [Tooltip](../tooltip/COMPONENT.md), [Kbd](../kbd/COMPONENT.md), [Hint](../hint/COMPONENT.md), [Skeleton](../skeleton/COMPONENT.md), Icon (`action.*`, `format.*`, `nav.chevronLeft`, `nav.chevronUp`, `status.locked`), `useUploadQueue` (the `queue`), `internal/ring` (the video preview's ring), `internal/textFormatting` + `internal/textFormattingToolbar` (the formatting shared with Textarea `formatting`)
|
|
329
|
+
- **Built from:** [Textarea](../textarea/COMPONENT.md), [Button](../button/COMPONENT.md), [FileUpload](../file-upload/COMPONENT.md) (the paperclip and the picker of the menu; `FileUpload.Queue layout="strip"`, the tray), [Gallery](../gallery/COMPONENT.md) (`GALLERY_MAX`, the size of an album in `albums`), [Crossfade](../crossfade/COMPONENT.md), [Checkbox](../checkbox/COMPONENT.md), [Dropdown](../dropdown/COMPONENT.md), [Tooltip](../tooltip/COMPONENT.md), [Kbd](../kbd/COMPONENT.md), [Hint](../hint/COMPONENT.md), [Skeleton](../skeleton/COMPONENT.md), Icon (`action.*`, `format.*`, `nav.chevronLeft`, `nav.chevronUp`, `status.locked`), `useUploadQueue` (the `queue`), `internal/ring` (the video preview's ring), `internal/textFormatting` + `internal/textFormattingToolbar` (the formatting shared with Textarea `formatting`), [VisuallyHidden](../visually-hidden/COMPONENT.md)
|
|
312
330
|
- **See also:** [Message](../message/COMPONENT.md) — the bubbles the composer writes into; [VoicePlayer](../voice-player/COMPONENT.md) — plays a sent voice message; [Textarea](../textarea/COMPONENT.md), [Input](../input/COMPONENT.md)
|
|
@@ -19,12 +19,3 @@
|
|
|
19
19
|
width: min(100%, calc(var(--prime-space-20) * 4));
|
|
20
20
|
margin-inline: auto;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
/* sizes.tsx, states.tsx: one composer per row with its caption. */
|
|
24
|
-
.cell {
|
|
25
|
-
display: flex;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
gap: var(--prime-space-1);
|
|
28
|
-
width: min(100%, calc(var(--prime-space-24) * 6));
|
|
29
|
-
margin-inline: auto;
|
|
30
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** On a phone-width chat the row keeps the paperclip, the field and the button; Enter makes a new line on touch screens and the button sends. */
|
|
1
|
+
/** On a phone-width chat the row keeps the paperclip, the field and the button; Enter makes a new line on touch screens and the button sends — `Composer.Attach`, `onSend`. */
|
|
2
2
|
import { Composer, useUploadQueue } from "prime-ui-kit";
|
|
3
3
|
|
|
4
4
|
import styles from "./examples.module.css";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Answering a client's message and correcting your own: the bar above the field quotes the message, Escape or the cross cancels, ↑ in an empty field opens your last message, send becomes save and hands over the message id — `Composer.Context`, `mode`, `
|
|
1
|
+
/** Answering a client's message and correcting your own: the bar above the field quotes the message, Escape or the cross cancels, ↑ in an empty field opens your last message, send becomes save and hands over the message id — `Composer.Context`, `mode`, `messageId`, `onDismiss`, `onEditLast`. */
|
|
2
2
|
import { Button, Composer, type ComposerMessage, Typography } from "prime-ui-kit";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
@@ -46,13 +46,13 @@ export default function ComposerReplyEditExample() {
|
|
|
46
46
|
}}
|
|
47
47
|
>
|
|
48
48
|
{mode?.kind === "reply" ? (
|
|
49
|
-
<Composer.Context
|
|
49
|
+
<Composer.Context messageId={CLIENT_MESSAGE_ID} onDismiss={dismiss}>
|
|
50
50
|
<Composer.Title>Ответ Анне Соколовой</Composer.Title>
|
|
51
51
|
<Composer.Description>{CLIENT_MESSAGE}</Composer.Description>
|
|
52
52
|
</Composer.Context>
|
|
53
53
|
) : null}
|
|
54
54
|
{mode?.kind === "edit" ? (
|
|
55
|
-
<Composer.Context mode="edit"
|
|
55
|
+
<Composer.Context mode="edit" messageId={LAST_OWN_MESSAGE_ID} onDismiss={dismiss}>
|
|
56
56
|
<Composer.Title>Редактирование</Composer.Title>
|
|
57
57
|
<Composer.Description>{LAST_OWN_MESSAGE}</Composer.Description>
|
|
58
58
|
</Composer.Context>
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/** One composer in every tier: field, buttons and the paperclip follow it — `size`. */
|
|
2
2
|
import { Composer, Typography } from "prime-ui-kit";
|
|
3
3
|
|
|
4
|
-
import styles from "./examples.module.css";
|
|
5
|
-
|
|
6
4
|
const SIZES = ["xs", "s", "m", "l", "xl"] as const;
|
|
7
5
|
|
|
8
6
|
export default function ComposerSizesExample() {
|
|
9
7
|
return (
|
|
10
|
-
|
|
8
|
+
<div>
|
|
11
9
|
{SIZES.map((size) => (
|
|
12
|
-
<div key={size}
|
|
10
|
+
<div key={size}>
|
|
13
11
|
<Composer.Root size={size} defaultValue="Счёт № 2187 оплачен" onSend={() => {}}>
|
|
14
12
|
<Composer.Attach />
|
|
15
13
|
</Composer.Root>
|
|
@@ -18,6 +16,6 @@ export default function ComposerSizesExample() {
|
|
|
18
16
|
</Typography>
|
|
19
17
|
</div>
|
|
20
18
|
))}
|
|
21
|
-
|
|
19
|
+
</div>
|
|
22
20
|
);
|
|
23
21
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/** A closed conversation is disabled, a slow send keeps the text with a busy button until the server answers — `disabled`, `onSend`. */
|
|
2
2
|
import { Composer, Typography } from "prime-ui-kit";
|
|
3
3
|
|
|
4
|
-
import styles from "./examples.module.css";
|
|
5
|
-
|
|
6
4
|
const SLOW_SEND_MS = 2500;
|
|
7
5
|
|
|
8
6
|
const slowSend = () => new Promise<void>((resolve) => window.setTimeout(resolve, SLOW_SEND_MS));
|
|
9
7
|
|
|
10
8
|
export default function ComposerStatesExample() {
|
|
11
9
|
return (
|
|
12
|
-
|
|
13
|
-
<div
|
|
10
|
+
<div>
|
|
11
|
+
<div>
|
|
14
12
|
<Composer.Root disabled defaultValue="Обращение закрыто">
|
|
15
13
|
<Composer.Attach />
|
|
16
14
|
</Composer.Root>
|
|
@@ -18,7 +16,7 @@ export default function ComposerStatesExample() {
|
|
|
18
16
|
disabled
|
|
19
17
|
</Typography>
|
|
20
18
|
</div>
|
|
21
|
-
<div
|
|
19
|
+
<div>
|
|
22
20
|
<Composer.Root defaultValue="Нажмите Enter — отправка займёт пару секунд" onSend={slowSend}>
|
|
23
21
|
<Composer.Attach />
|
|
24
22
|
</Composer.Root>
|
|
@@ -26,6 +24,6 @@ export default function ComposerStatesExample() {
|
|
|
26
24
|
onSend → Promise
|
|
27
25
|
</Typography>
|
|
28
26
|
</div>
|
|
29
|
-
|
|
27
|
+
</div>
|
|
30
28
|
);
|
|
31
29
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
- A form, a choice or more than one sentence of content → use [Modal](../modal/COMPONENT.md).
|
|
15
15
|
- An action that can be undone → do it at once and offer «Отменить» in a [Notification](../notification/COMPONENT.md).
|
|
16
16
|
- A hold-to-confirm right on the button (no dialog) → `holdToConfirm` on [Button](../button/COMPONENT.md).
|
|
17
|
-
- Unsaved changes in a Modal or
|
|
17
|
+
- Unsaved changes in a Modal, Drawer or Sheet form → `Modal.Guard` / `Drawer.Guard` / `Sheet.Guard` with `dirty` (it opens this dialog itself).
|
|
18
18
|
- A confirm that asks for input (a reason for a refusal, a comment) → [Modal](../modal/COMPONENT.md) `size="s"` with the field in `Modal.Body`, the action button in `Modal.Confirm`, and `Modal.Guard busy` while it is sent.
|
|
19
19
|
|
|
20
20
|
## Import
|
|
@@ -28,7 +28,7 @@ ConfirmDialog.Root state; renders the trigger and the dialog
|
|
|
28
28
|
├── ConfirmDialog.Trigger clones its child; opens on click
|
|
29
29
|
└── (Modal s) portal + scrim + role="alertdialog"
|
|
30
30
|
├── header title (names it) · description (describes it) · close button
|
|
31
|
-
├── (
|
|
31
|
+
├── (reason) a danger Banner with role="alert" after a failure: the rejection's message
|
|
32
32
|
└── footer Cancel (focused first) · the confirm (solid, loading while it runs)
|
|
33
33
|
```
|
|
34
34
|
|
|
@@ -37,19 +37,20 @@ ConfirmDialog.Root state; renders the trigger and the dialog
|
|
|
37
37
|
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
38
38
|
|
|
39
39
|
### ConfirmDialog.Root
|
|
40
|
-
No ref (state root). Renders its Trigger and a Modal `s` with `role="alertdialog"`: the
|
|
40
|
+
No ref (state root). Renders its Trigger and a Modal `s` with `role="alertdialog"`: the question, the consequence, the reason after a failure, Cancel (focused first) and the confirm. While `onConfirm` runs nothing closes it.
|
|
41
41
|
|
|
42
42
|
| Prop | Type | Default | Description |
|
|
43
43
|
|---|---|---|---|
|
|
44
44
|
| `open` | `boolean` | — | Controlled visibility; together with `onOpenChange`. |
|
|
45
45
|
| `defaultOpen` | `boolean` | `false` | Initial visibility, uncontrolled. |
|
|
46
46
|
| `onOpenChange` | `(open: boolean) => void` | — | Called on open and close: the Trigger, Cancel, the close button, Escape, a resolved `onConfirm`. |
|
|
47
|
+
| `closeOnEscape` | `boolean` | `true` | Escape closes the dialog, like Cancel. |
|
|
48
|
+
| `closeOnOutsideClick` | `boolean` | `false` | A click on the scrim (and on a phone a swipe down) closes the dialog. Off by default: a question about a weighty action is answered with a button, not by a stray click beside it. |
|
|
47
49
|
| `title` | `ReactNode` | — (required) | The question as a heading («Удалить проект?»); names the dialog. |
|
|
48
50
|
| `description` | `ReactNode` | — | What happens and what cannot be undone; describes the dialog. |
|
|
49
51
|
| `confirmLabel` | `ReactNode` | — (required) | The confirm button: the action as a verb («Удалить»), never «Да» or «ОК». |
|
|
50
52
|
| `tone` | `"danger" \| "accent"` | `"danger"` | `danger`: a destructive action, solid danger confirm. `accent`: a weighty but safe one (send, publish), solid accent confirm. |
|
|
51
|
-
| `onConfirm` | `() => unknown` | — (required) | The action. A Promise keeps the dialog busy
|
|
52
|
-
| `error` | `ReactNode` | — | Why the action failed, from the owner; shown under the text while set. |
|
|
53
|
+
| `onConfirm` | `() => unknown` | — (required) | The action. A pending Promise keeps the dialog busy (`loading`, nothing closes it). Resolve closes it; reject keeps it open with the reason: the `Error.message` or string, else `labels.error`. |
|
|
53
54
|
| `labels` | `Partial<ConfirmDialogLabels>` | — | Built-in strings, see Labels. |
|
|
54
55
|
| `children` | `ReactNode` | — | `ConfirmDialog.Trigger`; nothing when `open` comes from code. |
|
|
55
56
|
|
|
@@ -69,32 +70,42 @@ The dialog is a Modal `s` with the floating surface, a header and a footer; ther
|
|
|
69
70
|
| `danger` | solid danger confirm | Delete, revoke, cancel for good | yes |
|
|
70
71
|
| `accent` | solid accent confirm | Send, publish, charge — weighty but safe | |
|
|
71
72
|
|
|
73
|
+
### Flags
|
|
74
|
+
| Flag | Effect | Default |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| `closeOnEscape` | Escape closes the dialog like Cancel (never while the action runs) | `true` |
|
|
77
|
+
| `closeOnOutsideClick` | a click on the scrim (on a phone also a swipe down) closes it; turn on only for a safe confirm | `false` |
|
|
78
|
+
|
|
72
79
|
## States
|
|
73
80
|
| State | Driven by | DOM |
|
|
74
81
|
|---|---|---|
|
|
75
82
|
| open / closed | `open` / `defaultOpen` / `onOpenChange` | `data-state` on the scrim and the dialog (closed while the exit motion plays) |
|
|
76
83
|
| running | `onConfirm` returned a pending Promise | the confirm `data-loading="true"` and `aria-busy="true"`; Cancel and the close button `disabled` in place; Escape ignored |
|
|
77
|
-
| failed | `onConfirm` rejected
|
|
84
|
+
| failed | `onConfirm` rejected | a danger Banner with `role="alert"` drops in under the header with the rejection's `Error.message` (or string, else `labels.error`); the confirm is ready again; the next try or closing clears it, and the body closes up in place |
|
|
78
85
|
|
|
79
86
|
## Layout & spacing
|
|
80
|
-
- Modal `s`: 440 wide, the footer fills with two equal buttons; a bottom sheet
|
|
87
|
+
- Modal `s`: 440 wide, the footer fills with two equal buttons; a bottom sheet on a phone, buttons stacked full width.
|
|
81
88
|
- The failure message is the dialog body (20 around it); without it the header meets the footer.
|
|
82
89
|
- Write the title as a question with the object («Удалить тег «VIP»?»), the description as the consequence in one or two sentences, the confirm as the verb.
|
|
83
90
|
|
|
84
91
|
## Accessibility
|
|
85
92
|
|
|
86
93
|
### Keyboard
|
|
94
|
+
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
95
|
+
|
|
87
96
|
| Key | Action |
|
|
88
97
|
|---|---|
|
|
89
98
|
| `Tab` · `Shift+Tab` | Cycles focus inside the dialog; Cancel is focused first. |
|
|
90
99
|
| `Enter` | On a button presses it; from the dialog itself presses the confirm. |
|
|
91
|
-
| `Escape` | Closes the dialog unless the action runs; focus returns to the trigger. |
|
|
100
|
+
| `Escape` | Closes the dialog (`closeOnEscape`) unless the action runs; focus returns to the trigger. |
|
|
92
101
|
|
|
93
102
|
### ARIA
|
|
103
|
+
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
104
|
+
|
|
94
105
|
- `role="alertdialog"`, `aria-modal="true"`, named by `title`, described by `description`.
|
|
95
106
|
- Cancel takes focus first — the least destructive choice.
|
|
96
107
|
- While the action runs the confirm has `aria-busy="true"`; Cancel and the close button are disabled.
|
|
97
|
-
- The failure
|
|
108
|
+
- The reason of a failure is `role="alert"`, read at once.
|
|
98
109
|
|
|
99
110
|
### Labels
|
|
100
111
|
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
@@ -103,23 +114,25 @@ The dialog is a Modal `s` with the floating surface, a header and a footer; ther
|
|
|
103
114
|
|---|---|---|
|
|
104
115
|
| `cancel` | `"Отмена"` | The cancel button. |
|
|
105
116
|
| `close` | `"Закрыть"` | `aria-label` of the header close button. |
|
|
106
|
-
| `error` | `"Не получилось. Попробуйте ещё раз."` | The message after a rejected `onConfirm`
|
|
117
|
+
| `error` | `"Не получилось. Попробуйте ещё раз."` | The message after a rejected `onConfirm` without a reason of its own. |
|
|
107
118
|
|
|
108
119
|
## Examples
|
|
109
120
|
| Example | Shows |
|
|
110
121
|
|---|---|
|
|
111
122
|
| [overview.tsx](examples/overview.tsx) | Deleting a project: the danger confirm runs the request with a spinner and nothing closes the dialog until it ends — `ConfirmDialog.Trigger`, `onConfirm`. |
|
|
112
123
|
| [variants.tsx](examples/variants.tsx) | A destructive action gets the danger confirm; a weighty but safe one, such as sending an invoice, the accent one — `tone`. |
|
|
113
|
-
| [failure.tsx](examples/failure.tsx) | The server refuses: the dialog stays open with the
|
|
124
|
+
| [failure.tsx](examples/failure.tsx) | The server refuses: the dialog stays open with the reason of the rejection under the text and the confirm ready to try again — `onConfirm`. |
|
|
125
|
+
| [dismiss.tsx](examples/dismiss.tsx) | A reminder to the client is weighty but safe: a click beside the dialog closes it like Cancel, and Escape does too — `closeOnOutsideClick`, `closeOnEscape`. |
|
|
114
126
|
| [controlled-open.tsx](examples/controlled-open.tsx) | A menu item opens the confirm from code: the dialog has no trigger of its own and the parent owns its state — `open`, `onOpenChange`. |
|
|
115
127
|
|
|
116
128
|
## Mistakes
|
|
117
129
|
- A hand-built Modal with `closeOnOutsideClick={false}`, a loading flag and a disabled Cancel → ConfirmDialog does all of it.
|
|
118
|
-
- `onConfirm` that catches its own error and resolves → the dialog closes as if it worked; rethrow (or reject) to keep it open.
|
|
130
|
+
- `onConfirm` that catches its own error and resolves → the dialog closes as if it worked; rethrow (or reject) to keep it open. Reject with an `Error` whose message a person can read («Тег используется в 12 сделках») — it is the text under the question.
|
|
131
|
+
- `closeOnOutsideClick` on a destructive confirm → a stray click beside it must not answer the question; keep it off for `danger`.
|
|
119
132
|
- «Да» / «ОК» on the confirm → the verb of the action («Удалить», «Отправить»).
|
|
120
133
|
- A success message inside the dialog → it closes on success; say «Удалено» with a Notification.
|
|
121
134
|
- `tone="accent"` for a delete → destructive is always `danger`.
|
|
122
135
|
|
|
123
136
|
## Related
|
|
124
|
-
- **Built from:** [
|
|
137
|
+
- **Built from:** the dialog Modal stands on (`internal/overlay/ModalDialog` at `s`, the header, body and footer of `internal/overlay/DialogParts`), [ScrollContainer](../scroll-container/COMPONENT.md) (the body), [Avatar](../avatar/COMPONENT.md) and [Thumbnail](../thumbnail/COMPONENT.md) (pictures the shared icon slot recognises), [Button](../button/COMPONENT.md) (Cancel, the confirm with `loading`), [Banner](../banner/COMPONENT.md) (the failure message), `Icon` (`status.danger` in the Banner)
|
|
125
138
|
- **See also:** [Modal](../modal/COMPONENT.md), [Drawer](../drawer/COMPONENT.md), [Notification](../notification/COMPONENT.md)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** A reminder to the client is weighty but safe: a click beside the dialog closes it like Cancel, and Escape does too — `closeOnOutsideClick`, `closeOnEscape`. */
|
|
2
|
+
import { Button, ConfirmDialog } from "prime-ui-kit";
|
|
3
|
+
|
|
4
|
+
/** Pretends to send the reminder. */
|
|
5
|
+
function sendReminder() {
|
|
6
|
+
return new Promise((resolve) => setTimeout(resolve, 900));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function ConfirmDialogDismissExample() {
|
|
10
|
+
return (
|
|
11
|
+
<ConfirmDialog.Root
|
|
12
|
+
tone="accent"
|
|
13
|
+
closeOnOutsideClick
|
|
14
|
+
closeOnEscape
|
|
15
|
+
title="Напомнить клиенту о счёте №318?"
|
|
16
|
+
description="ООО «Гранит» получит письмо со ссылкой на оплату."
|
|
17
|
+
confirmLabel="Напомнить"
|
|
18
|
+
onConfirm={sendReminder}
|
|
19
|
+
>
|
|
20
|
+
<ConfirmDialog.Trigger>
|
|
21
|
+
<Button.Root variant="soft" tone="neutral">
|
|
22
|
+
Напомнить об оплате
|
|
23
|
+
</Button.Root>
|
|
24
|
+
</ConfirmDialog.Trigger>
|
|
25
|
+
</ConfirmDialog.Root>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -1,31 +1,24 @@
|
|
|
1
|
-
/** The server refuses: the dialog stays open with the
|
|
1
|
+
/** The server refuses: the dialog stays open with the reason of the rejection under the text and the confirm ready to try again — `onConfirm`. */
|
|
2
2
|
import { Button, ConfirmDialog } from "prime-ui-kit";
|
|
3
|
-
import * as React from "react";
|
|
4
3
|
|
|
5
4
|
/** Pretends the server refuses: the tag is still in use. */
|
|
6
5
|
function deleteTag() {
|
|
7
|
-
return new Promise((_, reject) =>
|
|
6
|
+
return new Promise((_, reject) =>
|
|
7
|
+
setTimeout(
|
|
8
|
+
() =>
|
|
9
|
+
reject(new Error("Тег используется в 12 активных сделках — сначала снимите его с них.")),
|
|
10
|
+
900,
|
|
11
|
+
),
|
|
12
|
+
);
|
|
8
13
|
}
|
|
9
14
|
|
|
10
15
|
export default function ConfirmDialogFailureExample() {
|
|
11
|
-
const [error, setError] = React.useState<string>();
|
|
12
|
-
|
|
13
16
|
return (
|
|
14
17
|
<ConfirmDialog.Root
|
|
15
18
|
title="Удалить тег «VIP»?"
|
|
16
19
|
description="Тег снимется со всех клиентов."
|
|
17
20
|
confirmLabel="Удалить тег"
|
|
18
|
-
|
|
19
|
-
onOpenChange={() => setError(undefined)}
|
|
20
|
-
onConfirm={async () => {
|
|
21
|
-
setError(undefined);
|
|
22
|
-
try {
|
|
23
|
-
await deleteTag();
|
|
24
|
-
} catch (reason) {
|
|
25
|
-
setError("Тег используется в 12 активных сделках — сначала снимите его с них.");
|
|
26
|
-
throw reason;
|
|
27
|
-
}
|
|
28
|
-
}}
|
|
21
|
+
onConfirm={deleteTag}
|
|
29
22
|
>
|
|
30
23
|
<ConfirmDialog.Trigger>
|
|
31
24
|
<Button.Root variant="soft" tone="danger">
|
|
@@ -40,7 +40,7 @@ Crossfade <div>; holds the region's height while it changes
|
|
|
40
40
|
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
41
41
|
|
|
42
42
|
### Crossfade
|
|
43
|
-
`ref` → `HTMLDivElement`. A region that cross-fades its content when `state` changes and glides to the new height; still on the first render
|
|
43
|
+
`ref` → `HTMLDivElement`. A region that cross-fades its content when `state` changes and glides to the new height; still on the first render. Under reduced motion the old content goes at once and the height jumps; the new content still fades in.
|
|
44
44
|
|
|
45
45
|
| Prop | Type | Default | Description |
|
|
46
46
|
|---|---|---|---|
|
|
@@ -69,12 +69,13 @@ Crossfade has no variants: one treatment, keyed by `state`.
|
|
|
69
69
|
|---|---|---|
|
|
70
70
|
| first render | mount | one layer, `data-state="open"`, no motion |
|
|
71
71
|
| swapping | `state` changes | previous layer `data-state="closed"`, `aria-hidden`, `inert`, absolutely placed, fades out over `fast` with `exit` easing and unmounts on `animationend` (timeout fallback); the new layer fades in over `base` with `enter` easing |
|
|
72
|
-
| resizing | the new state has another height | root `data-resizing="true"`: height glides from the old to the new value over `base` with `standard` easing, clipped with a `--prime-focus-space` margin, then returns to `auto` |
|
|
73
|
-
| reduced motion | `prefers-reduced-motion: reduce` |
|
|
72
|
+
| resizing | the new state has another height | root `data-resizing="true"`: height glides from the old to the new value over `base` with `standard` easing (a swap mid-glide starts from the height on screen), clipped with a `--prime-focus-space` margin, then returns to `auto` |
|
|
73
|
+
| reduced motion | `prefers-reduced-motion: reduce` | the old layer goes before it is painted and the height does not glide; the new layer still fades in (the fade clock, foundation §7 rule 12) |
|
|
74
|
+
| focus handoff | focus was in the old state when `state` changed | focus moves into the new layer: its first tab stop, else the layer itself (`tabindex="-1"`); focus elsewhere stays |
|
|
74
75
|
| empty | the current state renders nothing (`null`, `false`, `""`) | no current layer; once nothing is leaving the root is `:empty` and `display: none` — no box and no gap in its grid or flex parent |
|
|
75
76
|
| filling | `fill` | `data-fill="true"`; the root is a one-cell grid (`flex: 1`, `height: 100%`, `min-height: 0`), layers stretch to it |
|
|
76
77
|
|
|
77
|
-
Motion is opacity only, so nothing shifts under the pointer; the leaving content keeps its instance (no remount, no repeated effects) until it is gone.
|
|
78
|
+
Motion is opacity only, so nothing shifts under the pointer; the leaving content keeps its instance (no remount, no repeated effects) until it is gone. Each state is a block formatting context, so it measures the same in flow and laid over as it leaves.
|
|
78
79
|
|
|
79
80
|
## Layout & spacing
|
|
80
81
|
- No padding, gap or fill of its own: it sits where the swapped content would sit (inside `Card.Body`, a page section, a panel).
|
|
@@ -85,12 +86,16 @@ Motion is opacity only, so nothing shifts under the pointer; the leaving content
|
|
|
85
86
|
## Accessibility
|
|
86
87
|
|
|
87
88
|
### Keyboard
|
|
89
|
+
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
90
|
+
|
|
88
91
|
No keyboard interaction.
|
|
89
92
|
|
|
90
93
|
### ARIA
|
|
94
|
+
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
95
|
+
|
|
91
96
|
- Renders a plain `<div>`; pass `aria-busy` while the region loads and `aria-live` or `role` when its changes must be announced.
|
|
92
97
|
- The leaving layer is `aria-hidden` and `inert`: screen readers and Tab never reach content that is going away.
|
|
93
|
-
-
|
|
98
|
+
- Focus in the old state (the retry button of an error) moves into the new one: its first tab stop, or the new content itself; focus elsewhere on the page stays where it is.
|
|
94
99
|
|
|
95
100
|
### Labels
|
|
96
101
|
<!-- Generated from api.ts by `bun run docs:build`. Edit api.ts, not this section. -->
|
|
@@ -111,6 +116,7 @@ No `labels`.
|
|
|
111
116
|
- A spinner block for content of known shape → a `Skeleton` of that shape; a spinner is for loading with no shape to hold (a button, a status line).
|
|
112
117
|
- Wrapping a DataTable to animate its loading / empty / error → the table body already cross-fades; use its props.
|
|
113
118
|
- Hand-written `opacity` transitions or `height` animations for a state swap → Crossfade owns both, with tokens and reduced motion.
|
|
119
|
+
- An effect that moves focus out of a state that is going away (the retry button of an error) → Crossfade hands focus to the new state itself.
|
|
114
120
|
- `height: 100%` on the content of a full-height region → `fill` on the Crossfade; its layers stretch.
|
|
115
121
|
- Rendering an optional block conditionally outside Crossfade (`{notice && <Banner />}`) → it pops in and out; keep the Crossfade and pass `null` when there is nothing to show.
|
|
116
122
|
|