prime-ui-kit 0.9.0 → 0.9.1
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 +41 -41
- package/dist/chunks/chunk-DB2Y3XXA.js +12437 -0
- package/dist/chunks/chunk-KCQFOORX.js +379 -0
- package/dist/chunks/chunk-NHOWNIAR.js +3239 -0
- package/dist/color-picker.d.ts +7 -0
- package/dist/color-picker.js +9 -0
- package/dist/components/accordion/Accordion.d.ts +44 -32
- package/dist/components/avatar/Avatar.d.ts +36 -53
- package/dist/components/badge/Badge.d.ts +50 -13
- package/dist/components/badge/edgeIcons.d.ts +13 -0
- package/dist/components/badge/tier.d.ts +0 -1
- package/dist/components/banner/Banner.d.ts +29 -60
- package/dist/components/breadcrumb/Breadcrumb.d.ts +11 -23
- package/dist/components/button/Button.d.ts +22 -36
- package/dist/components/button-group/ButtonGroup.d.ts +17 -17
- package/dist/components/card/Card.d.ts +75 -202
- package/dist/components/checkbox/Checkbox.d.ts +37 -38
- package/dist/components/code-block/CodeBlock.d.ts +5 -13
- package/dist/components/color-picker/ColorPicker.d.ts +76 -52
- package/dist/components/color-picker/ColorPresets.d.ts +18 -30
- package/dist/components/color-swatches/ColorSwatches.d.ts +40 -0
- package/dist/components/command-menu/CommandMenu.d.ts +138 -78
- package/dist/components/crossfade/Crossfade.d.ts +14 -0
- package/dist/components/data-table/DataTable.d.ts +30 -81
- package/dist/components/data-table/Footer.d.ts +16 -0
- package/dist/components/data-table/Head.d.ts +21 -0
- package/dist/components/data-table/Row.d.ts +56 -0
- package/dist/components/data-table/StateRows.d.ts +18 -0
- package/dist/components/data-table/rows.d.ts +60 -0
- package/dist/components/data-table/types.d.ts +35 -0
- package/dist/components/data-table/useColumnHover.d.ts +9 -0
- package/dist/components/data-table/useFrozenColumns.d.ts +16 -0
- package/dist/components/data-table/useInfiniteRows.d.ts +24 -0
- package/dist/components/data-table/useRowSelection.d.ts +35 -0
- package/dist/components/datepicker/Datepicker.d.ts +9 -126
- package/dist/components/datepicker/DatepickerPanel.d.ts +113 -0
- package/dist/components/datepicker/datepickerModel.d.ts +16 -22
- package/dist/components/datepicker/panelLayout.d.ts +50 -0
- package/dist/components/digit-input/DigitInput.d.ts +24 -19
- package/dist/components/divider/Divider.d.ts +7 -15
- package/dist/components/dnd/Dnd.d.ts +135 -0
- package/dist/components/dnd/DragOverlay.d.ts +6 -0
- package/dist/components/dnd/autoScroll.d.ts +5 -0
- package/dist/components/dnd/context.d.ts +5 -0
- package/dist/components/dnd/dragSession.d.ts +93 -0
- package/dist/components/dnd/geometry.d.ts +30 -0
- package/dist/components/dnd/labels.d.ts +18 -0
- package/dist/components/dnd/store.d.ts +9 -0
- package/dist/components/dnd/useDragSource.d.ts +36 -0
- package/dist/components/dnd/useDropTarget.d.ts +39 -0
- package/dist/components/dnd/useFlipList.d.ts +11 -0
- package/dist/components/dnd/useSortableList.d.ts +62 -0
- package/dist/components/drawer/Drawer.d.ts +8 -19
- package/dist/components/dropdown/Dropdown.d.ts +63 -86
- package/dist/components/empty-page/EmptyPage.d.ts +48 -48
- package/dist/components/example-frame/ExampleFrame.d.ts +20 -27
- package/dist/components/file-upload/FileUpload.d.ts +79 -134
- package/dist/components/hint/Hint.d.ts +10 -11
- package/dist/components/index.d.ts +54 -42
- package/dist/components/input/Input.d.ts +35 -37
- package/dist/components/kbd/Kbd.d.ts +6 -12
- package/dist/components/label/Label.d.ts +18 -15
- package/dist/components/link-button/LinkButton.d.ts +14 -15
- package/dist/components/login-form/LoginForm.d.ts +115 -0
- package/dist/components/modal/DialogParts.d.ts +57 -16
- package/dist/components/modal/Modal.d.ts +7 -21
- package/dist/components/native-select/NativeSelect.d.ts +28 -0
- package/dist/components/notification/Notification.d.ts +50 -16
- package/dist/components/notification/NotificationStore.d.ts +2 -6
- package/dist/components/page-content/PageContent.d.ts +43 -52
- package/dist/components/pagination/Pagination.d.ts +11 -23
- package/dist/components/popover/Popover.d.ts +62 -26
- package/dist/components/progress-bar/ProgressBar.d.ts +17 -13
- package/dist/components/progress-circle/ProgressCircle.d.ts +14 -15
- package/dist/components/radio/Radio.d.ts +46 -54
- package/dist/components/scroll-container/ScrollContainer.d.ts +10 -13
- package/dist/components/segmented-control/SegmentedControl.d.ts +15 -27
- package/dist/components/select/Select.d.ts +54 -135
- package/dist/components/select/SelectItem.d.ts +68 -0
- package/dist/components/select/selectContext.d.ts +61 -0
- package/dist/components/skeleton/Skeleton.d.ts +22 -0
- package/dist/components/slider/Slider.d.ts +24 -16
- package/dist/components/smart-filter/SmartFilter.d.ts +105 -0
- package/dist/components/smart-filter/model.d.ts +33 -0
- package/dist/components/spinner/Spinner.d.ts +22 -0
- package/dist/components/stepper/Stepper.d.ts +32 -42
- package/dist/components/switch/Switch.d.ts +19 -37
- package/dist/components/tabs/Tabs.d.ts +62 -38
- package/dist/components/tag-select/TagOptionMenu.d.ts +29 -0
- package/dist/components/tag-select/TagSelect.d.ts +15 -16
- package/dist/components/tag-select/useChipOverflow.d.ts +19 -0
- package/dist/components/textarea/Textarea.d.ts +16 -31
- package/dist/components/thumbnail/Thumbnail.d.ts +41 -0
- package/dist/components/timeline/Timeline.d.ts +46 -61
- package/dist/components/tooltip/Tooltip.d.ts +21 -17
- package/dist/components/typography/Typography.d.ts +5 -21
- package/dist/hooks/useControllableState.d.ts +0 -1
- package/dist/hooks/useEnterConfirm.d.ts +15 -0
- package/dist/hooks/useImageStatus.d.ts +19 -0
- package/dist/hooks/useInertSiblings.d.ts +9 -0
- package/dist/hooks/useMergedRefs.d.ts +6 -2
- package/dist/hooks/useModalLayer.d.ts +22 -0
- package/dist/hooks/usePosition.d.ts +46 -40
- package/dist/hooks/usePresence.d.ts +0 -1
- package/dist/hooks/useScrollLock.d.ts +3 -5
- package/dist/hooks/useStateSwap.d.ts +8 -0
- package/dist/icons/Icon.d.ts +24 -7
- package/dist/icons/index.d.ts +2 -44
- package/dist/icons/registry.d.ts +85 -0
- package/dist/index.css +5990 -6891
- package/dist/index.d.ts +0 -1
- package/dist/index.js +98 -13830
- package/dist/internal/AnchorRectContext.d.ts +12 -0
- package/dist/internal/ChoiceField.d.ts +34 -0
- package/dist/internal/ControlSizeContext.d.ts +6 -2
- package/dist/internal/FieldFrame.d.ts +47 -8
- package/dist/internal/HighlightMatch.d.ts +13 -0
- package/dist/internal/MenuGroup.d.ts +8 -0
- package/dist/internal/Portal.d.ts +0 -1
- package/dist/internal/VisuallyHidden.d.ts +11 -0
- package/dist/internal/context.d.ts +0 -1
- package/dist/internal/cx.d.ts +0 -1
- package/dist/internal/data-attributes.d.ts +0 -1
- package/dist/internal/fieldClasses.d.ts +9 -0
- package/dist/internal/formatLabel.d.ts +6 -0
- package/dist/internal/highlightTsxHtml.d.ts +1 -2
- package/dist/internal/iconBox.d.ts +9 -0
- package/dist/internal/iconLayout.d.ts +15 -0
- package/dist/internal/imageSlot.d.ts +29 -0
- package/dist/internal/layoutPxFromPrimitives.d.ts +2 -3
- package/dist/internal/listbox.d.ts +40 -0
- package/dist/internal/mergeRefs.d.ts +4 -2
- package/dist/internal/overlay/FloatingPanel.d.ts +34 -0
- package/dist/internal/overlay/focus.d.ts +14 -0
- package/dist/internal/overlay/layerStack.d.ts +41 -0
- package/dist/internal/overlay/useFloatingLayer.d.ts +60 -0
- package/dist/internal/polymorphic.d.ts +9 -0
- package/dist/internal/progressSegments.d.ts +63 -0
- package/dist/internal/rovingFocus.d.ts +18 -0
- package/dist/internal/scrollAncestors.d.ts +1 -2
- package/dist/internal/slot.d.ts +11 -5
- package/dist/internal/states.d.ts +3 -2
- package/dist/internal/swatch.d.ts +56 -0
- package/dist/layout/app-shell/AppShell.d.ts +41 -21
- package/dist/layout/index.d.ts +1 -2
- package/dist/layout/sidebar/Sidebar.d.ts +206 -35
- package/dist/theme/applyTheme.d.ts +0 -1
- package/dist/tokens/naming.d.ts +6 -0
- package/dist/tokens/primitives.d.ts +22 -80
- package/dist/tokens/semantic.d.ts +66 -25
- package/dist/tokens/themes/dark.d.ts +3 -1
- package/package.json +29 -24
- package/src/components/accordion/COMPONENT.md +90 -100
- package/src/components/accordion/examples/collapsible.tsx +27 -0
- package/src/components/accordion/examples/controlled.tsx +36 -0
- package/src/components/accordion/examples/examples.module.css +6 -39
- package/src/components/accordion/examples/multiple.tsx +31 -0
- package/src/components/accordion/examples/overview.tsx +39 -0
- package/src/components/accordion/examples/sizes.tsx +14 -25
- package/src/components/accordion/examples/states.tsx +23 -48
- package/src/components/accordion/examples/variants.tsx +35 -0
- package/src/components/accordion/examples/with-icon.tsx +47 -0
- package/src/components/avatar/COMPONENT.md +88 -153
- package/src/components/avatar/examples/examples.module.css +6 -44
- package/src/components/avatar/examples/overview.tsx +18 -0
- package/src/components/avatar/examples/presence.tsx +20 -17
- package/src/components/avatar/examples/sizes.tsx +8 -10
- package/src/components/avatar/examples/src-from-state.tsx +4 -5
- package/src/components/avatar/examples/states.tsx +17 -27
- package/src/components/avatar/examples/team-group.tsx +21 -0
- package/src/components/avatar/examples/variants.tsx +40 -0
- package/src/components/badge/COMPONENT.md +113 -122
- package/src/components/{tag → badge}/examples/applied-filters.tsx +10 -11
- package/src/components/badge/examples/examples.module.css +14 -59
- package/src/components/badge/examples/filter-values.tsx +39 -0
- package/src/components/badge/examples/in-controls.tsx +14 -26
- package/src/components/badge/examples/overview.tsx +13 -0
- package/src/components/badge/examples/sizes.tsx +8 -10
- package/src/components/badge/examples/states.tsx +35 -29
- package/src/components/badge/examples/variants.tsx +27 -36
- package/src/components/badge/examples/with-icon.tsx +50 -0
- package/src/components/banner/COMPONENT.md +88 -93
- package/src/components/banner/examples/dismissible.tsx +38 -0
- package/src/components/banner/examples/examples.module.css +6 -22
- package/src/components/banner/examples/narrow.tsx +23 -0
- package/src/components/banner/examples/overview.tsx +18 -0
- package/src/components/banner/examples/page-strip.tsx +53 -0
- package/src/components/banner/examples/sizes.tsx +22 -21
- package/src/components/banner/examples/structure.tsx +45 -0
- package/src/components/banner/examples/variants.tsx +28 -55
- package/src/components/breadcrumb/COMPONENT.md +55 -59
- package/src/components/breadcrumb/examples/ellipsis.tsx +12 -0
- package/src/components/breadcrumb/examples/examples.module.css +3 -52
- package/src/components/breadcrumb/examples/overflow.tsx +26 -0
- package/src/components/breadcrumb/examples/overview.tsx +12 -0
- package/src/components/breadcrumb/examples/sizes.tsx +11 -14
- package/src/components/breadcrumb/examples/with-icon.tsx +14 -0
- package/src/components/button/COMPONENT.md +65 -66
- package/src/components/button/examples/as-child.tsx +8 -32
- package/src/components/button/examples/examples.module.css +18 -76
- package/src/components/button/examples/in-form.tsx +20 -14
- package/src/components/button/examples/on-colored-host.tsx +29 -0
- package/src/components/button/examples/overview.tsx +13 -0
- package/src/components/button/examples/sizes.tsx +7 -9
- package/src/components/button/examples/states.tsx +18 -28
- package/src/components/button/examples/variants.tsx +31 -0
- package/src/components/button/examples/with-icon.tsx +35 -23
- package/src/components/button-group/COMPONENT.md +64 -55
- package/src/components/button-group/examples/controlled.tsx +3 -3
- package/src/components/button-group/examples/examples.module.css +4 -39
- package/src/components/button-group/examples/full-width.tsx +10 -14
- package/src/components/button-group/examples/in-form.tsx +3 -3
- package/src/components/button-group/examples/orientation.tsx +6 -8
- package/src/components/button-group/examples/overview.tsx +12 -0
- package/src/components/button-group/examples/sizes.tsx +8 -10
- package/src/components/button-group/examples/states.tsx +28 -7
- package/src/components/button-group/examples/with-icon.tsx +45 -0
- package/src/components/card/COMPONENT.md +99 -298
- package/src/components/card/examples/{content.tsx → content-templates.tsx} +23 -29
- package/src/components/card/examples/examples.module.css +0 -8
- package/src/components/card/examples/flat.tsx +9 -14
- package/src/components/card/examples/kpi-media.tsx +42 -0
- package/src/components/card/examples/narrow.tsx +47 -0
- package/src/components/card/examples/{settings.tsx → overview.tsx} +7 -8
- package/src/components/card/examples/panel-chart.tsx +26 -34
- package/src/components/card/examples/{metrics.tsx → variants.tsx} +12 -18
- package/src/components/checkbox/COMPONENT.md +92 -96
- package/src/components/checkbox/examples/controlled.tsx +41 -0
- package/src/components/checkbox/examples/examples.module.css +45 -43
- package/src/components/checkbox/examples/in-form.tsx +34 -0
- package/src/components/checkbox/examples/indicator.tsx +54 -0
- package/src/components/checkbox/examples/overview.tsx +10 -0
- package/src/components/checkbox/examples/sizes.tsx +5 -10
- package/src/components/checkbox/examples/states.tsx +42 -23
- package/src/components/checkbox/examples/without-label.tsx +3 -7
- package/src/components/code-block/COMPONENT.md +55 -57
- package/src/components/code-block/examples/color-scheme.tsx +4 -15
- package/src/components/code-block/examples/examples.module.css +9 -40
- package/src/components/code-block/examples/{long-lines.tsx → narrow.tsx} +3 -4
- package/src/components/code-block/examples/overview.tsx +19 -0
- package/src/components/code-block/examples/variants.tsx +12 -21
- package/src/components/color-picker/COMPONENT.md +196 -165
- package/src/components/color-picker/examples/controlled.tsx +37 -0
- package/src/components/color-picker/examples/examples.module.css +19 -88
- package/src/components/color-picker/examples/formats.tsx +13 -18
- package/src/components/color-picker/examples/in-form.tsx +44 -0
- package/src/components/color-picker/examples/overview.tsx +37 -0
- package/src/components/color-picker/examples/panel.tsx +12 -13
- package/src/components/color-picker/examples/presets-sizes.tsx +15 -20
- package/src/components/color-picker/examples/presets.tsx +33 -0
- package/src/components/color-picker/examples/sizes.tsx +26 -0
- package/src/components/color-picker/examples/states.tsx +4 -14
- package/src/components/color-picker/examples/validation.tsx +18 -0
- package/src/components/color-swatches/COMPONENT.md +145 -0
- package/src/components/color-swatches/examples/controlled.tsx +22 -0
- package/src/components/color-swatches/examples/examples.module.css +19 -0
- package/src/components/color-swatches/examples/in-form.tsx +35 -0
- package/src/components/color-swatches/examples/overview.tsx +6 -0
- package/src/components/color-swatches/examples/sizes.tsx +19 -0
- package/src/components/color-swatches/examples/states.tsx +20 -0
- package/src/components/color-swatches/examples/wrapping.tsx +12 -0
- package/src/components/command-menu/COMPONENT.md +117 -180
- package/src/components/command-menu/examples/controlled-open.tsx +29 -0
- package/src/components/command-menu/examples/controlled.tsx +19 -26
- package/src/components/command-menu/examples/dismiss.tsx +39 -0
- package/src/components/command-menu/examples/overview.tsx +61 -0
- package/src/components/command-menu/examples/sizes.tsx +30 -51
- package/src/components/command-menu/examples/states.tsx +6 -16
- package/src/components/command-menu/examples/structure.tsx +54 -0
- package/src/components/crossfade/COMPONENT.md +104 -0
- package/src/components/crossfade/examples/examples.module.css +65 -0
- package/src/components/crossfade/examples/overview.tsx +102 -0
- package/src/components/crossfade/examples/record-switch.tsx +67 -0
- package/src/components/data-table/COMPONENT.md +171 -185
- package/src/components/data-table/examples/appearance.tsx +31 -34
- package/src/components/data-table/examples/content-width.tsx +46 -26
- package/src/components/data-table/examples/controlled.tsx +56 -0
- package/src/components/data-table/examples/detail-panel.tsx +23 -28
- package/src/components/data-table/examples/examples.module.css +20 -91
- package/src/components/data-table/examples/infinite-scroll.tsx +17 -18
- package/src/components/data-table/examples/narrow.tsx +28 -38
- package/src/components/data-table/examples/nested-rows.tsx +32 -54
- package/src/components/data-table/examples/numeric.tsx +10 -19
- package/src/components/data-table/examples/overview.tsx +54 -0
- package/src/components/data-table/examples/selection.tsx +11 -15
- package/src/components/data-table/examples/sizes.tsx +22 -33
- package/src/components/data-table/examples/states.tsx +23 -24
- package/src/components/data-table/examples/sticky.tsx +17 -24
- package/src/components/data-table/examples/toolbar.tsx +21 -23
- package/src/components/datepicker/COMPONENT.md +152 -164
- package/src/components/datepicker/examples/controlled-open.tsx +32 -0
- package/src/components/datepicker/examples/controlled.tsx +39 -0
- package/src/components/datepicker/examples/examples.module.css +9 -23
- package/src/components/datepicker/examples/in-form.tsx +32 -45
- package/src/components/datepicker/examples/inline-panel.tsx +3 -3
- package/src/components/datepicker/examples/narrow.tsx +1 -1
- package/src/components/datepicker/examples/overview.tsx +6 -0
- package/src/components/datepicker/examples/range-presets.tsx +6 -5
- package/src/components/datepicker/examples/sizes.tsx +7 -10
- package/src/components/datepicker/examples/states.tsx +9 -30
- package/src/components/datepicker/examples/validation.tsx +26 -0
- package/src/components/datepicker/examples/yearless.tsx +9 -8
- package/src/components/digit-input/COMPONENT.md +91 -53
- package/src/components/digit-input/examples/controlled.tsx +6 -15
- package/src/components/digit-input/examples/examples.module.css +9 -42
- package/src/components/digit-input/examples/full-width.tsx +13 -0
- package/src/components/digit-input/examples/grouped.tsx +11 -0
- package/src/components/digit-input/examples/in-form.tsx +35 -0
- package/src/components/digit-input/examples/on-complete.tsx +20 -0
- package/src/components/digit-input/examples/overview.tsx +6 -0
- package/src/components/digit-input/examples/sizes.tsx +5 -17
- package/src/components/digit-input/examples/states.tsx +6 -50
- package/src/components/digit-input/examples/validation.tsx +17 -0
- package/src/components/divider/COMPONENT.md +61 -52
- package/src/components/divider/examples/align.tsx +14 -0
- package/src/components/divider/examples/examples.module.css +6 -20
- package/src/components/divider/examples/or-separator.tsx +19 -0
- package/src/components/divider/examples/overview.tsx +30 -0
- package/src/components/divider/examples/sizes.tsx +11 -10
- package/src/components/divider/examples/vertical.tsx +21 -0
- package/src/components/divider/examples/with-icon.tsx +26 -0
- package/src/components/dnd/COMPONENT.md +197 -0
- package/src/components/dnd/examples/board.tsx +83 -0
- package/src/components/dnd/examples/drop-zones.tsx +82 -0
- package/src/components/dnd/examples/examples.module.css +89 -0
- package/src/components/dnd/examples/handle.tsx +53 -0
- package/src/components/dnd/examples/narrow.tsx +42 -0
- package/src/components/dnd/examples/overview.tsx +45 -0
- package/src/components/drawer/COMPONENT.md +103 -102
- package/src/components/drawer/examples/controlled-open.tsx +33 -0
- package/src/components/drawer/examples/dismiss.tsx +55 -0
- package/src/components/drawer/examples/examples.module.css +3 -24
- package/src/components/drawer/examples/in-form.tsx +82 -0
- package/src/components/drawer/examples/long-content.tsx +40 -0
- package/src/components/drawer/examples/overview.tsx +48 -0
- package/src/components/drawer/examples/{variants-sides.tsx → placement.tsx} +10 -13
- package/src/components/drawer/examples/sizes.tsx +9 -15
- package/src/components/drawer/examples/structure.tsx +35 -0
- package/src/components/dropdown/COMPONENT.md +109 -152
- package/src/components/dropdown/examples/controlled-open.tsx +32 -0
- package/src/components/dropdown/examples/dismiss.tsx +17 -0
- package/src/components/dropdown/examples/examples.module.css +11 -45
- package/src/components/dropdown/examples/long-list.tsx +42 -0
- package/src/components/dropdown/examples/{full-width.tsx → match-trigger-width.tsx} +5 -4
- package/src/components/dropdown/examples/overview.tsx +41 -0
- package/src/components/dropdown/examples/placement.tsx +16 -13
- package/src/components/dropdown/examples/sizes.tsx +18 -15
- package/src/components/dropdown/examples/states.tsx +21 -29
- package/src/components/dropdown/examples/structure.tsx +56 -0
- package/src/components/empty-page/COMPONENT.md +71 -75
- package/src/components/empty-page/examples/compact.tsx +23 -0
- package/src/components/empty-page/examples/data-region.tsx +8 -11
- package/src/components/empty-page/examples/examples.module.css +22 -25
- package/src/components/empty-page/examples/icon-tones.tsx +5 -6
- package/src/components/empty-page/examples/narrow.tsx +26 -0
- package/src/components/empty-page/examples/{no-results.tsx → overview.tsx} +4 -5
- package/src/components/empty-page/examples/sizes.tsx +14 -20
- package/src/components/example-frame/COMPONENT.md +64 -66
- package/src/components/example-frame/examples/controlled.tsx +42 -0
- package/src/components/example-frame/examples/overview.tsx +16 -0
- package/src/components/file-upload/COMPONENT.md +128 -186
- package/src/components/file-upload/examples/avatar-upload.tsx +7 -12
- package/src/components/file-upload/examples/custom-body.tsx +44 -0
- package/src/components/file-upload/examples/examples.module.css +46 -64
- package/src/components/file-upload/examples/in-form.tsx +76 -0
- package/src/components/file-upload/examples/narrow.tsx +17 -0
- package/src/components/file-upload/examples/overview.tsx +52 -0
- package/src/components/file-upload/examples/sizes.tsx +16 -37
- package/src/components/file-upload/examples/states.tsx +6 -98
- package/src/components/file-upload/examples/upload-progress.tsx +39 -0
- package/src/components/file-upload/examples/validation.tsx +19 -0
- package/src/components/file-upload/examples/variants.tsx +5 -18
- package/src/components/hint/COMPONENT.md +42 -48
- package/src/components/hint/examples/examples.module.css +3 -45
- package/src/components/hint/examples/hint-or-error.tsx +5 -5
- package/src/components/hint/examples/overview.tsx +34 -0
- package/src/components/hint/examples/sizes.tsx +8 -10
- package/src/components/hint/examples/states.tsx +21 -14
- package/src/components/hint/examples/with-icon.tsx +31 -0
- package/src/components/input/COMPONENT.md +70 -88
- package/src/components/input/examples/affixes.tsx +22 -0
- package/src/components/input/examples/controlled.tsx +9 -10
- package/src/components/input/examples/examples.module.css +3 -116
- package/src/components/input/examples/in-form.tsx +35 -14
- package/src/components/input/examples/overview.tsx +12 -0
- package/src/components/input/examples/sizes.tsx +6 -11
- package/src/components/input/examples/states.tsx +6 -23
- package/src/components/input/examples/validation.tsx +35 -0
- package/src/components/input/examples/with-icon.tsx +25 -0
- package/src/components/input/examples/{search-without-focus-ring.tsx → without-focus-ring.tsx} +5 -5
- package/src/components/kbd/COMPONENT.md +50 -65
- package/src/components/kbd/examples/examples.module.css +11 -41
- package/src/components/kbd/examples/in-controls.tsx +25 -31
- package/src/components/kbd/examples/overview.tsx +24 -0
- package/src/components/kbd/examples/shortcut-list.tsx +12 -12
- package/src/components/kbd/examples/sizes.tsx +8 -13
- package/src/components/label/COMPONENT.md +45 -44
- package/src/components/label/examples/examples.module.css +8 -29
- package/src/components/label/examples/overview.tsx +17 -0
- package/src/components/label/examples/sizes.tsx +9 -13
- package/src/components/label/examples/states.tsx +17 -14
- package/src/components/label/examples/structure.tsx +32 -0
- package/src/components/label/examples/with-icon.tsx +25 -17
- package/src/components/link-button/COMPONENT.md +56 -39
- package/src/components/link-button/examples/as-child.tsx +18 -0
- package/src/components/link-button/examples/external-link.tsx +6 -6
- package/src/components/link-button/examples/overview.tsx +11 -0
- package/src/components/link-button/examples/sizes.tsx +9 -11
- package/src/components/link-button/examples/states.tsx +25 -12
- package/src/components/link-button/examples/variants.tsx +21 -0
- package/src/components/link-button/examples/with-icon.tsx +21 -13
- package/src/components/login-form/COMPONENT.md +162 -0
- package/src/components/login-form/examples/examples.module.css +39 -0
- package/src/components/login-form/examples/forgot-password.tsx +39 -0
- package/src/components/login-form/examples/narrow.tsx +32 -0
- package/src/components/login-form/examples/overview.tsx +58 -0
- package/src/components/login-form/examples/register.tsx +85 -0
- package/src/components/login-form/examples/reset-password.tsx +60 -0
- package/src/components/login-form/examples/sizes.tsx +38 -0
- package/src/components/login-form/examples/states.tsx +75 -0
- package/src/components/login-form/examples/structure.tsx +28 -0
- package/src/components/login-form/examples/verification-code.tsx +57 -0
- package/src/components/modal/COMPONENT.md +64 -84
- package/src/components/modal/examples/{controlled.tsx → controlled-open.tsx} +6 -12
- package/src/components/modal/examples/custom-container.tsx +29 -0
- package/src/components/modal/examples/dismiss.tsx +54 -0
- package/src/components/modal/examples/examples.module.css +4 -20
- package/src/components/modal/examples/in-form.tsx +78 -0
- package/src/components/modal/examples/long-content.tsx +52 -0
- package/src/components/modal/examples/overview.tsx +35 -0
- package/src/components/modal/examples/sizes.tsx +7 -9
- package/src/components/modal/examples/structure.tsx +53 -0
- package/src/components/native-select/COMPONENT.md +132 -0
- package/src/components/native-select/examples/controlled.tsx +26 -0
- package/src/components/native-select/examples/examples.module.css +14 -0
- package/src/components/native-select/examples/in-form.tsx +43 -0
- package/src/components/native-select/examples/option-groups.tsx +17 -0
- package/src/components/native-select/examples/overview.tsx +16 -0
- package/src/components/native-select/examples/sizes.tsx +18 -0
- package/src/components/native-select/examples/states.tsx +21 -0
- package/src/components/native-select/examples/validation.tsx +26 -0
- package/src/components/notification/COMPONENT.md +107 -121
- package/src/components/notification/examples/dismiss.tsx +50 -0
- package/src/components/notification/examples/examples.module.css +10 -23
- package/src/components/notification/examples/in-form.tsx +64 -0
- package/src/components/notification/examples/overview.tsx +24 -0
- package/src/components/notification/examples/placement.tsx +66 -0
- package/src/components/notification/examples/sizes.tsx +11 -18
- package/src/components/notification/examples/stacking.tsx +45 -0
- package/src/components/notification/examples/structure.tsx +20 -0
- package/src/components/notification/examples/tones.tsx +14 -26
- package/src/components/page-content/COMPONENT.md +49 -74
- package/src/components/page-content/examples/examples.module.css +4 -8
- package/src/components/page-content/examples/narrow.tsx +25 -0
- package/src/components/page-content/examples/overview.tsx +41 -0
- package/src/components/page-content/examples/variants.tsx +39 -0
- package/src/components/pagination/COMPONENT.md +73 -64
- package/src/components/pagination/examples/controlled.tsx +51 -0
- package/src/components/pagination/examples/examples.module.css +6 -55
- package/src/components/pagination/examples/narrow.tsx +25 -0
- package/src/components/pagination/examples/overflow.tsx +23 -0
- package/src/components/pagination/examples/overview.tsx +6 -0
- package/src/components/pagination/examples/sizes.tsx +10 -18
- package/src/components/popover/COMPONENT.md +88 -99
- package/src/components/popover/examples/controlled-open.tsx +32 -0
- package/src/components/popover/examples/dismiss.tsx +49 -0
- package/src/components/popover/examples/examples.module.css +21 -41
- package/src/components/popover/examples/flush.tsx +47 -0
- package/src/components/popover/examples/in-form.tsx +54 -0
- package/src/components/popover/examples/{full-width.tsx → match-trigger-width.tsx} +7 -7
- package/src/components/popover/examples/overview.tsx +43 -0
- package/src/components/popover/examples/placement.tsx +17 -15
- package/src/components/popover/examples/sizes.tsx +12 -9
- package/src/components/popover/examples/structure.tsx +50 -0
- package/src/components/progress-bar/COMPONENT.md +102 -61
- package/src/components/progress-bar/examples/custom-max.tsx +12 -0
- package/src/components/progress-bar/examples/examples.module.css +4 -34
- package/src/components/progress-bar/examples/overview.tsx +12 -0
- package/src/components/progress-bar/examples/segments.tsx +32 -0
- package/src/components/progress-bar/examples/sizes.tsx +11 -8
- package/src/components/progress-bar/examples/variants.tsx +34 -0
- package/src/components/progress-circle/COMPONENT.md +101 -60
- package/src/components/progress-circle/examples/examples.module.css +2 -39
- package/src/components/progress-circle/examples/inner-content.tsx +35 -0
- package/src/components/progress-circle/examples/overview.tsx +10 -0
- package/src/components/progress-circle/examples/segments.tsx +64 -0
- package/src/components/progress-circle/examples/sizes.tsx +10 -12
- package/src/components/progress-circle/examples/variants.tsx +28 -0
- package/src/components/radio/COMPONENT.md +93 -114
- package/src/components/radio/examples/controlled.tsx +30 -0
- package/src/components/radio/examples/group.tsx +23 -0
- package/src/components/radio/examples/orientation.tsx +34 -0
- package/src/components/radio/examples/overview.tsx +18 -0
- package/src/components/radio/examples/sizes.tsx +7 -12
- package/src/components/radio/examples/states.tsx +42 -30
- package/src/components/scroll-container/COMPONENT.md +56 -28
- package/src/components/scroll-container/examples/edge-fade.tsx +53 -0
- package/src/components/scroll-container/examples/examples.module.css +7 -7
- package/src/components/scroll-container/examples/overscroll.tsx +27 -0
- package/src/components/scroll-container/examples/overview.tsx +27 -0
- package/src/components/scroll-container/examples/variants.tsx +54 -0
- package/src/components/segmented-control/COMPONENT.md +91 -105
- package/src/components/segmented-control/examples/colors.tsx +8 -13
- package/src/components/segmented-control/examples/controlled.tsx +10 -6
- package/src/components/segmented-control/examples/examples.module.css +2 -88
- package/src/components/segmented-control/examples/full-width.tsx +7 -44
- package/src/components/segmented-control/examples/overview.tsx +12 -0
- package/src/components/segmented-control/examples/scroll.tsx +16 -0
- package/src/components/segmented-control/examples/sizes.tsx +8 -20
- package/src/components/segmented-control/examples/states.tsx +28 -34
- package/src/components/segmented-control/examples/two-line.tsx +17 -104
- package/src/components/segmented-control/examples/with-icon.tsx +52 -0
- package/src/components/select/COMPONENT.md +154 -208
- package/src/components/select/examples/clearable.tsx +23 -0
- package/src/components/select/examples/controlled-open.tsx +30 -0
- package/src/components/select/examples/controlled.tsx +17 -10
- package/src/components/select/examples/examples.module.css +18 -38
- package/src/components/select/examples/in-form.tsx +59 -70
- package/src/components/select/examples/multiple.tsx +21 -33
- package/src/components/select/examples/overview.tsx +17 -0
- package/src/components/select/examples/rich-options.tsx +43 -69
- package/src/components/select/examples/searchable.tsx +42 -0
- package/src/components/select/examples/sizes.tsx +13 -17
- package/src/components/select/examples/states.tsx +34 -48
- package/src/components/select/examples/validation.tsx +41 -0
- package/src/components/select/examples/with-icon.tsx +35 -0
- package/src/components/skeleton/COMPONENT.md +104 -0
- package/src/components/skeleton/examples/examples.module.css +89 -0
- package/src/components/skeleton/examples/form.tsx +20 -0
- package/src/components/skeleton/examples/overview.tsx +21 -0
- package/src/components/skeleton/examples/sizes.tsx +24 -0
- package/src/components/skeleton/examples/with-crossfade.tsx +68 -0
- package/src/components/slider/COMPONENT.md +105 -68
- package/src/components/slider/examples/controlled.tsx +26 -30
- package/src/components/slider/examples/examples.module.css +8 -32
- package/src/components/slider/examples/hint-and-error.tsx +33 -0
- package/src/components/slider/examples/overview.tsx +6 -0
- package/src/components/slider/examples/range-step.tsx +7 -17
- package/src/components/slider/examples/sizes.tsx +8 -6
- package/src/components/slider/examples/states.tsx +11 -8
- package/src/components/slider/examples/value-format.tsx +13 -25
- package/src/components/slider/examples/variants.tsx +23 -0
- package/src/components/smart-filter/COMPONENT.md +182 -0
- package/src/components/smart-filter/examples/controlled.tsx +48 -0
- package/src/components/smart-filter/examples/examples.module.css +56 -0
- package/src/components/smart-filter/examples/many-values.tsx +53 -0
- package/src/components/smart-filter/examples/narrow.tsx +38 -0
- package/src/components/smart-filter/examples/overview.tsx +109 -0
- package/src/components/smart-filter/examples/sizes.tsx +33 -0
- package/src/components/spinner/COMPONENT.md +112 -0
- package/src/components/spinner/examples/examples.module.css +20 -0
- package/src/components/spinner/examples/loading-region.tsx +22 -0
- package/src/components/spinner/examples/overview.tsx +15 -0
- package/src/components/spinner/examples/sizes.tsx +19 -0
- package/src/components/spinner/examples/variants.tsx +19 -0
- package/src/components/stepper/COMPONENT.md +83 -78
- package/src/components/stepper/examples/controlled.tsx +46 -0
- package/src/components/stepper/examples/examples.module.css +9 -40
- package/src/components/stepper/examples/narrow.tsx +11 -19
- package/src/components/stepper/examples/orientation.tsx +21 -59
- package/src/components/stepper/examples/overview.tsx +28 -0
- package/src/components/stepper/examples/sizes.tsx +19 -28
- package/src/components/stepper/examples/states.tsx +20 -21
- package/src/components/stepper/examples/with-icon.tsx +29 -0
- package/src/components/switch/COMPONENT.md +75 -94
- package/src/components/switch/examples/controlled.tsx +8 -6
- package/src/components/switch/examples/examples.module.css +13 -45
- package/src/components/switch/examples/in-form.tsx +20 -24
- package/src/components/switch/examples/overview.tsx +10 -0
- package/src/components/switch/examples/settings-row.tsx +14 -22
- package/src/components/switch/examples/sizes.tsx +5 -10
- package/src/components/switch/examples/states.tsx +37 -25
- package/src/components/tabs/COMPONENT.md +153 -86
- package/src/components/tabs/examples/closable.tsx +48 -0
- package/src/components/tabs/examples/controlled.tsx +14 -20
- package/src/components/tabs/examples/examples.module.css +13 -93
- package/src/components/tabs/examples/orientation.tsx +40 -0
- package/src/components/tabs/examples/overflow.tsx +60 -0
- package/src/components/tabs/examples/overview.tsx +30 -0
- package/src/components/tabs/examples/sizes.tsx +19 -19
- package/src/components/tabs/examples/states.tsx +20 -55
- package/src/components/tabs/examples/two-line.tsx +22 -29
- package/src/components/tabs/examples/variants.tsx +40 -0
- package/src/components/tabs/examples/with-icon.tsx +44 -0
- package/src/components/tag-select/COMPONENT.md +119 -122
- package/src/components/tag-select/examples/controlled-open.tsx +29 -0
- package/src/components/tag-select/examples/controlled.tsx +26 -0
- package/src/components/tag-select/examples/creatable.tsx +28 -0
- package/src/components/tag-select/examples/examples.module.css +3 -22
- package/src/components/tag-select/examples/in-form.tsx +44 -41
- package/src/components/tag-select/examples/manage-tags.tsx +20 -39
- package/src/components/tag-select/examples/many-tags.tsx +20 -0
- package/src/components/tag-select/examples/overview.tsx +21 -0
- package/src/components/tag-select/examples/sizes.tsx +7 -10
- package/src/components/tag-select/examples/states.tsx +11 -36
- package/src/components/tag-select/examples/validation.tsx +35 -0
- package/src/components/textarea/COMPONENT.md +50 -50
- package/src/components/textarea/examples/auto-resize.tsx +21 -0
- package/src/components/textarea/examples/controlled.tsx +12 -16
- package/src/components/textarea/examples/examples.module.css +15 -48
- package/src/components/textarea/examples/in-form.tsx +52 -48
- package/src/components/textarea/examples/overview.tsx +12 -0
- package/src/components/textarea/examples/sizes.tsx +6 -7
- package/src/components/textarea/examples/states.tsx +9 -13
- package/src/components/textarea/examples/validation.tsx +34 -0
- package/src/components/textarea/examples/without-focus-ring.tsx +12 -0
- package/src/components/thumbnail/COMPONENT.md +150 -0
- package/src/components/thumbnail/examples/examples.module.css +45 -0
- package/src/components/thumbnail/examples/full-width.tsx +48 -0
- package/src/components/thumbnail/examples/overview.tsx +31 -0
- package/src/components/thumbnail/examples/ratios.tsx +25 -0
- package/src/components/thumbnail/examples/ring.tsx +29 -0
- package/src/components/thumbnail/examples/sizes.tsx +23 -0
- package/src/components/thumbnail/examples/states.tsx +38 -0
- package/src/components/thumbnail/examples/variants.tsx +28 -0
- package/src/components/timeline/COMPONENT.md +92 -203
- package/src/components/timeline/examples/examples.module.css +5 -20
- package/src/components/timeline/examples/links.tsx +28 -0
- package/src/components/timeline/examples/narrow.tsx +30 -38
- package/src/components/timeline/examples/{activity-feed.tsx → overview.tsx} +9 -17
- package/src/components/timeline/examples/sizes.tsx +22 -28
- package/src/components/timeline/examples/{service-history.tsx → structure.tsx} +10 -8
- package/src/components/timeline/examples/{colors-and-tones.tsx → variants.tsx} +11 -16
- package/src/components/tooltip/COMPONENT.md +74 -62
- package/src/components/tooltip/examples/{controlled.tsx → controlled-open.tsx} +5 -7
- package/src/components/tooltip/examples/delay.tsx +19 -28
- package/src/components/tooltip/examples/disabled-trigger.tsx +18 -0
- package/src/components/tooltip/examples/examples.module.css +3 -33
- package/src/components/tooltip/examples/long-content.tsx +12 -15
- package/src/components/tooltip/examples/overview.tsx +17 -0
- package/src/components/tooltip/examples/placement.tsx +30 -0
- package/src/components/tooltip/examples/sizes.tsx +12 -15
- package/src/components/tooltip/examples/toolbar.tsx +35 -0
- package/src/components/typography/COMPONENT.md +68 -99
- package/src/components/typography/examples/article.tsx +23 -36
- package/src/components/typography/examples/examples.module.css +20 -54
- package/src/components/typography/examples/inline-emphasis.tsx +20 -0
- package/src/components/typography/examples/overview.tsx +20 -0
- package/src/components/typography/examples/semantic-tag.tsx +17 -0
- package/src/components/typography/examples/truncate.tsx +7 -7
- package/src/components/typography/examples/variants.tsx +43 -42
- package/src/components/typography/examples/weights.tsx +31 -0
- package/src/layout/app-shell/COMPONENT.md +48 -54
- package/src/layout/app-shell/examples/contained.tsx +5 -5
- package/src/layout/app-shell/examples/examples.module.css +9 -0
- package/src/layout/app-shell/examples/overview.tsx +72 -0
- package/src/layout/app-shell/examples/template.tsx +54 -0
- package/src/layout/sidebar/COMPONENT.md +302 -110
- package/src/layout/sidebar/examples/account.tsx +88 -0
- package/src/layout/sidebar/examples/brand-header.tsx +45 -0
- package/src/layout/sidebar/examples/collapsible-groups.tsx +77 -0
- package/src/layout/sidebar/examples/controlled-open.tsx +55 -0
- package/src/layout/sidebar/examples/controlled.tsx +68 -0
- package/src/layout/sidebar/examples/examples.module.css +17 -3
- package/src/layout/sidebar/examples/nested-items.tsx +74 -0
- package/src/layout/sidebar/examples/overview.tsx +126 -0
- package/src/layout/sidebar/examples/router.tsx +19 -13
- package/src/layout/sidebar/examples/sizes.tsx +17 -12
- package/src/layout/sidebar/examples/structure.tsx +81 -0
- package/src/styles/fonts.css +4 -0
- package/src/styles/globals.css +18 -29
- package/src/styles/reset.css +2 -0
- package/src/styles/theme-dark.css +3 -0
- package/src/styles/theme-light.css +34 -23
- package/src/styles/tokens.css +9 -77
- package/dist/components/accordion/Accordion.d.ts.map +0 -1
- package/dist/components/avatar/Avatar.d.ts.map +0 -1
- package/dist/components/badge/Badge.d.ts.map +0 -1
- package/dist/components/badge/tier.d.ts.map +0 -1
- package/dist/components/banner/Banner.d.ts.map +0 -1
- package/dist/components/breadcrumb/Breadcrumb.d.ts.map +0 -1
- package/dist/components/button/Button.d.ts.map +0 -1
- package/dist/components/button-group/ButtonGroup.d.ts.map +0 -1
- package/dist/components/card/Card.d.ts.map +0 -1
- package/dist/components/checkbox/Checkbox.d.ts.map +0 -1
- package/dist/components/code-block/CodeBlock.d.ts.map +0 -1
- package/dist/components/color-picker/ColorPicker.d.ts.map +0 -1
- package/dist/components/color-picker/ColorPresets.d.ts.map +0 -1
- package/dist/components/command-menu/CommandMenu.d.ts.map +0 -1
- package/dist/components/data-table/DataTable.d.ts.map +0 -1
- package/dist/components/datepicker/Datepicker.d.ts.map +0 -1
- package/dist/components/datepicker/datepickerModel.d.ts.map +0 -1
- package/dist/components/digit-input/DigitInput.d.ts.map +0 -1
- package/dist/components/divider/Divider.d.ts.map +0 -1
- package/dist/components/drawer/Drawer.d.ts.map +0 -1
- package/dist/components/dropdown/Dropdown.d.ts.map +0 -1
- package/dist/components/dropdown/dropdownGeometry.d.ts +0 -10
- package/dist/components/dropdown/dropdownGeometry.d.ts.map +0 -1
- package/dist/components/dropdown/menuKeyboard.d.ts +0 -4
- package/dist/components/dropdown/menuKeyboard.d.ts.map +0 -1
- package/dist/components/dropdown/useDropdownPosition.d.ts +0 -18
- package/dist/components/dropdown/useDropdownPosition.d.ts.map +0 -1
- package/dist/components/empty-page/EmptyPage.d.ts.map +0 -1
- package/dist/components/example-frame/ExampleFrame.d.ts.map +0 -1
- package/dist/components/file-upload/FileUpload.d.ts.map +0 -1
- package/dist/components/hint/Hint.d.ts.map +0 -1
- package/dist/components/index.css +0 -11181
- package/dist/components/index.css.map +0 -7
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -13833
- package/dist/components/index.js.map +0 -7
- package/dist/components/input/Input.d.ts.map +0 -1
- package/dist/components/kbd/Kbd.d.ts.map +0 -1
- package/dist/components/label/Label.d.ts.map +0 -1
- package/dist/components/link-button/LinkButton.d.ts.map +0 -1
- package/dist/components/modal/DialogParts.d.ts.map +0 -1
- package/dist/components/modal/Modal.d.ts.map +0 -1
- package/dist/components/modal/useInertSiblings.d.ts +0 -7
- package/dist/components/modal/useInertSiblings.d.ts.map +0 -1
- package/dist/components/notification/Notification.d.ts.map +0 -1
- package/dist/components/notification/NotificationStore.d.ts.map +0 -1
- package/dist/components/page-content/PageContent.d.ts.map +0 -1
- package/dist/components/pagination/Pagination.d.ts.map +0 -1
- package/dist/components/popover/Popover.d.ts.map +0 -1
- package/dist/components/popover/popoverGeometry.d.ts +0 -6
- package/dist/components/popover/popoverGeometry.d.ts.map +0 -1
- package/dist/components/popover/usePopoverPosition.d.ts +0 -18
- package/dist/components/popover/usePopoverPosition.d.ts.map +0 -1
- package/dist/components/progress-bar/ProgressBar.d.ts.map +0 -1
- package/dist/components/progress-circle/ProgressCircle.d.ts.map +0 -1
- package/dist/components/radio/Radio.d.ts.map +0 -1
- package/dist/components/scroll-container/ScrollContainer.d.ts.map +0 -1
- package/dist/components/segmented-control/SegmentedControl.d.ts.map +0 -1
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts +0 -29
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts.map +0 -1
- package/dist/components/select/Select.d.ts.map +0 -1
- package/dist/components/select/selectIcons.d.ts +0 -15
- package/dist/components/select/selectIcons.d.ts.map +0 -1
- package/dist/components/select/selectListbox.d.ts +0 -13
- package/dist/components/select/selectListbox.d.ts.map +0 -1
- package/dist/components/slider/Slider.d.ts.map +0 -1
- package/dist/components/stepper/Stepper.d.ts.map +0 -1
- package/dist/components/switch/Switch.d.ts.map +0 -1
- package/dist/components/tabs/Tabs.d.ts.map +0 -1
- package/dist/components/tag/Tag.d.ts +0 -47
- package/dist/components/tag/Tag.d.ts.map +0 -1
- package/dist/components/tag-select/TagSelect.d.ts.map +0 -1
- package/dist/components/textarea/Textarea.d.ts.map +0 -1
- package/dist/components/timeline/Timeline.d.ts.map +0 -1
- package/dist/components/tooltip/Tooltip.d.ts.map +0 -1
- package/dist/components/typography/Typography.d.ts.map +0 -1
- package/dist/hooks/useControllableState.d.ts.map +0 -1
- package/dist/hooks/useEscapeKey.d.ts +0 -7
- package/dist/hooks/useEscapeKey.d.ts.map +0 -1
- package/dist/hooks/useFieldIds.d.ts +0 -17
- package/dist/hooks/useFieldIds.d.ts.map +0 -1
- package/dist/hooks/useFocusTrap.d.ts +0 -20
- package/dist/hooks/useFocusTrap.d.ts.map +0 -1
- package/dist/hooks/useMergedRefs.d.ts.map +0 -1
- package/dist/hooks/useModalKeyboard.d.ts +0 -14
- package/dist/hooks/useModalKeyboard.d.ts.map +0 -1
- package/dist/hooks/useOutsideClick.d.ts +0 -26
- package/dist/hooks/useOutsideClick.d.ts.map +0 -1
- package/dist/hooks/useOverlayModal.d.ts +0 -7
- package/dist/hooks/useOverlayModal.d.ts.map +0 -1
- package/dist/hooks/usePosition.d.ts.map +0 -1
- package/dist/hooks/usePresence.d.ts.map +0 -1
- package/dist/hooks/useResponsiveMonths.d.ts +0 -18
- package/dist/hooks/useResponsiveMonths.d.ts.map +0 -1
- package/dist/hooks/useScrollLock.d.ts.map +0 -1
- package/dist/icons/Icon.d.ts.map +0 -1
- package/dist/icons/index.d.ts.map +0 -1
- package/dist/index.css.map +0 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -7
- package/dist/internal/ControlSizeContext.d.ts.map +0 -1
- package/dist/internal/DividerContentContext.d.ts +0 -4
- package/dist/internal/DividerContentContext.d.ts.map +0 -1
- package/dist/internal/FieldFrame.d.ts.map +0 -1
- package/dist/internal/OverlayPortalLayerContext.d.ts +0 -13
- package/dist/internal/OverlayPortalLayerContext.d.ts.map +0 -1
- package/dist/internal/Portal.d.ts.map +0 -1
- package/dist/internal/context.d.ts.map +0 -1
- package/dist/internal/cx.d.ts.map +0 -1
- package/dist/internal/data-attributes.d.ts.map +0 -1
- package/dist/internal/highlightTsxHtml.d.ts.map +0 -1
- package/dist/internal/layoutPxFromPrimitives.d.ts.map +0 -1
- package/dist/internal/mergeRefs.d.ts.map +0 -1
- package/dist/internal/runtimeUnits.d.ts +0 -3
- package/dist/internal/runtimeUnits.d.ts.map +0 -1
- package/dist/internal/scrollAncestors.d.ts.map +0 -1
- package/dist/internal/slot.d.ts.map +0 -1
- package/dist/internal/states.d.ts.map +0 -1
- package/dist/internal/useFieldDescriptions.d.ts +0 -18
- package/dist/internal/useFieldDescriptions.d.ts.map +0 -1
- package/dist/layout/app-shell/AppShell.d.ts.map +0 -1
- package/dist/layout/index.d.ts.map +0 -1
- package/dist/layout/sidebar/Sidebar.d.ts.map +0 -1
- package/dist/theme/applyTheme.d.ts.map +0 -1
- package/dist/tokens/primitives.d.ts.map +0 -1
- package/dist/tokens/semantic.d.ts.map +0 -1
- package/dist/tokens/themes/dark.d.ts.map +0 -1
- package/dist/tokens/themes/light.d.ts +0 -3
- package/dist/tokens/themes/light.d.ts.map +0 -1
- package/src/components/accordion/examples/checkout.tsx +0 -73
- package/src/components/accordion/examples/layouts.tsx +0 -58
- package/src/components/avatar/examples/colors.tsx +0 -29
- package/src/components/avatar/examples/group.tsx +0 -35
- package/src/components/avatar/examples/team-card.tsx +0 -70
- package/src/components/badge/examples/icons.tsx +0 -37
- package/src/components/badge/examples/order-list.tsx +0 -48
- package/src/components/badge/examples/palette.tsx +0 -44
- package/src/components/badge/examples/surfaces.tsx +0 -21
- package/src/components/banner/examples/dismiss.tsx +0 -48
- package/src/components/banner/examples/placement.tsx +0 -92
- package/src/components/breadcrumb/examples/collapse.tsx +0 -56
- package/src/components/breadcrumb/examples/page-header.tsx +0 -31
- package/src/components/button/examples/composition.tsx +0 -46
- package/src/components/button/examples/controlled.tsx +0 -18
- package/src/components/button/examples/full-width.tsx +0 -15
- package/src/components/button/examples/icon-only.tsx +0 -42
- package/src/components/button/examples/surfaces.tsx +0 -18
- package/src/components/button/examples/variants-tones.tsx +0 -39
- package/src/components/button-group/examples/composition.tsx +0 -99
- package/src/components/card/examples/mini-media.tsx +0 -55
- package/src/components/card/examples/responsive.tsx +0 -72
- package/src/components/checkbox/examples/hint-error.tsx +0 -22
- package/src/components/checkbox/examples/select-all.tsx +0 -40
- package/src/components/checkbox/examples/settings-card.tsx +0 -76
- package/src/components/code-block/examples/api-docs.tsx +0 -31
- package/src/components/code-block/examples/controlled.tsx +0 -38
- package/src/components/code-block/examples/surfaces.tsx +0 -7
- package/src/components/color-picker/examples/brand-color.tsx +0 -73
- package/src/components/color-picker/examples/hex-input-sizes.tsx +0 -54
- package/src/components/color-picker/examples/presets-quick.tsx +0 -57
- package/src/components/color-picker/examples/presets-tags.tsx +0 -52
- package/src/components/command-menu/examples/composition.tsx +0 -91
- package/src/components/command-menu/examples/examples.module.css +0 -9
- package/src/components/command-menu/examples/keyboard-search.tsx +0 -94
- package/src/components/data-table/examples/dashboard.tsx +0 -205
- package/src/components/data-table/examples/sorting-pagination.tsx +0 -66
- package/src/components/datepicker/examples/badge.tsx +0 -19
- package/src/components/datepicker/examples/single.tsx +0 -16
- package/src/components/digit-input/examples/length-and-complete.tsx +0 -30
- package/src/components/digit-input/examples/surfaces.tsx +0 -6
- package/src/components/digit-input/examples/verification-step.tsx +0 -62
- package/src/components/divider/examples/composition.tsx +0 -49
- package/src/components/divider/examples/variants.tsx +0 -62
- package/src/components/drawer/examples/composition.tsx +0 -94
- package/src/components/drawer/examples/controlled.tsx +0 -42
- package/src/components/drawer/examples/features.tsx +0 -48
- package/src/components/drawer/examples/states.tsx +0 -54
- package/src/components/dropdown/examples/as-child.tsx +0 -23
- package/src/components/dropdown/examples/composition.tsx +0 -91
- package/src/components/dropdown/examples/controlled.tsx +0 -32
- package/src/components/dropdown/examples/row-actions.tsx +0 -56
- package/src/components/dropdown/examples/variants.tsx +0 -52
- package/src/components/example-frame/examples/basic.tsx +0 -18
- package/src/components/file-upload/examples/file-list.tsx +0 -67
- package/src/components/file-upload/examples/in-card.tsx +0 -84
- package/src/components/hint/examples/field-states.tsx +0 -60
- package/src/components/hint/examples/in-form.tsx +0 -45
- package/src/components/input/examples/anatomy.tsx +0 -70
- package/src/components/input/examples/control-alignment.tsx +0 -57
- package/src/components/input/examples/full-width.tsx +0 -23
- package/src/components/input/examples/icons-and-affixes.tsx +0 -32
- package/src/components/input/examples/reserved-support-row.tsx +0 -33
- package/src/components/input/examples/surfaces.tsx +0 -12
- package/src/components/input/examples/with-badge.tsx +0 -40
- package/src/components/kbd/examples/modifier-keys.tsx +0 -24
- package/src/components/label/examples/in-form.tsx +0 -39
- package/src/components/label/examples/markers.tsx +0 -27
- package/src/components/link-button/examples/composition.tsx +0 -30
- package/src/components/link-button/examples/examples.module.css +0 -46
- package/src/components/link-button/examples/tones.tsx +0 -15
- package/src/components/modal/examples/composition.tsx +0 -87
- package/src/components/modal/examples/features.tsx +0 -68
- package/src/components/modal/examples/link.tsx +0 -79
- package/src/components/modal/examples/states.tsx +0 -73
- package/src/components/notification/examples/features.tsx +0 -42
- package/src/components/notification/examples/live.tsx +0 -128
- package/src/components/notification/examples/save-form.tsx +0 -59
- package/src/components/page-content/examples/readable.tsx +0 -24
- package/src/components/page-content/examples/settings-page.tsx +0 -49
- package/src/components/page-content/examples/widths.tsx +0 -39
- package/src/components/pagination/examples/compact.tsx +0 -36
- package/src/components/pagination/examples/list-footer.tsx +0 -50
- package/src/components/pagination/examples/states.tsx +0 -44
- package/src/components/popover/examples/as-child.tsx +0 -29
- package/src/components/popover/examples/composition.tsx +0 -45
- package/src/components/popover/examples/controlled.tsx +0 -39
- package/src/components/popover/examples/features.tsx +0 -56
- package/src/components/popover/examples/inset-variants.tsx +0 -58
- package/src/components/popover/examples/states.tsx +0 -48
- package/src/components/progress-bar/examples/file-upload.tsx +0 -52
- package/src/components/progress-bar/examples/values-and-tones.tsx +0 -17
- package/src/components/progress-circle/examples/goals-card.tsx +0 -37
- package/src/components/progress-circle/examples/values-and-tones.tsx +0 -56
- package/src/components/radio/examples/examples.module.css +0 -43
- package/src/components/radio/examples/hint-error.tsx +0 -28
- package/src/components/radio/examples/horizontal.tsx +0 -33
- package/src/components/radio/examples/plan-picker.tsx +0 -55
- package/src/components/scroll-container/examples/both-axes.tsx +0 -57
- package/src/components/scroll-container/examples/list.tsx +0 -44
- package/src/components/segmented-control/examples/item-content.tsx +0 -78
- package/src/components/segmented-control/examples/surfaces.tsx +0 -82
- package/src/components/segmented-control/examples/toolbar.tsx +0 -56
- package/src/components/segmented-progress-bar/COMPONENT.md +0 -128
- package/src/components/segmented-progress-bar/examples/examples.module.css +0 -68
- package/src/components/segmented-progress-bar/examples/segment-gap.tsx +0 -24
- package/src/components/segmented-progress-bar/examples/sizes.tsx +0 -31
- package/src/components/segmented-progress-bar/examples/storage-distribution.tsx +0 -41
- package/src/components/select/examples/native.tsx +0 -21
- package/src/components/select/examples/search-groups.tsx +0 -61
- package/src/components/select/examples/with-badge.tsx +0 -47
- package/src/components/slider/examples/basic.tsx +0 -6
- package/src/components/slider/examples/display-settings.tsx +0 -41
- package/src/components/stepper/examples/wizard.tsx +0 -62
- package/src/components/switch/examples/notification-settings.tsx +0 -37
- package/src/components/switch/examples/on-off.tsx +0 -15
- package/src/components/switch/examples/validation.tsx +0 -19
- package/src/components/tabs/examples/horizontal.tsx +0 -30
- package/src/components/tabs/examples/vertical.tsx +0 -101
- package/src/components/tag/COMPONENT.md +0 -179
- package/src/components/tag/examples/colors.tsx +0 -49
- package/src/components/tag/examples/examples.module.css +0 -47
- package/src/components/tag/examples/sizes.tsx +0 -23
- package/src/components/tag/examples/states.tsx +0 -19
- package/src/components/tag/examples/surfaces.tsx +0 -16
- package/src/components/tag/examples/with-icon.tsx +0 -29
- package/src/components/textarea/examples/height-and-limits.tsx +0 -45
- package/src/components/textarea/examples/hint-and-error.tsx +0 -21
- package/src/components/textarea/examples/reserved-support-row.tsx +0 -37
- package/src/components/textarea/examples/surfaces.tsx +0 -11
- package/src/components/textarea/examples/with-label.tsx +0 -22
- package/src/components/timeline/examples/hover-highlight.tsx +0 -48
- package/src/components/timeline/examples/in-card.tsx +0 -48
- package/src/components/timeline/examples/selectable.tsx +0 -58
- package/src/components/tooltip/examples/composition.tsx +0 -37
- package/src/components/tooltip/examples/side.tsx +0 -29
- package/src/components/tooltip/examples/states.tsx +0 -45
- package/src/components/typography/examples/as-prop.tsx +0 -25
- package/src/components/typography/examples/composition.tsx +0 -23
- package/src/components/typography/examples/full-width.tsx +0 -29
- package/src/components/typography/examples/reading-and-form.tsx +0 -35
- package/src/components/typography/examples/states.tsx +0 -23
- package/src/components/typography/examples/tones.tsx +0 -34
- package/src/components/typography/examples/variant-catalog.tsx +0 -41
- package/src/layout/app-shell/examples/with-sidebar.tsx +0 -63
- package/src/layout/sidebar/examples/modes.tsx +0 -55
- package/src/layout/sidebar/examples/responsive.tsx +0 -44
- package/src/layout/sidebar/examples/states.tsx +0 -34
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { type Locale } from "date-fns";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import type { ControlSize } from "@/internal/states";
|
|
4
|
+
import { type DatepickerPreset, type DatepickerRange, type WeekStart } from "./datepickerModel";
|
|
5
|
+
/** System strings and default texts. */
|
|
6
|
+
export type DatepickerLabels = {
|
|
7
|
+
/** Field text without a value. */
|
|
8
|
+
placeholder: string;
|
|
9
|
+
pickStart: string;
|
|
10
|
+
pickEnd: string;
|
|
11
|
+
pickDate: string;
|
|
12
|
+
reset: string;
|
|
13
|
+
apply: string;
|
|
14
|
+
prevMonth: string;
|
|
15
|
+
nextMonth: string;
|
|
16
|
+
rangeStart: string;
|
|
17
|
+
rangeEnd: string;
|
|
18
|
+
date: string;
|
|
19
|
+
timeStart: string;
|
|
20
|
+
timeEnd: string;
|
|
21
|
+
time: string;
|
|
22
|
+
/** Prefix of a range without a start: «до 6 окт». */
|
|
23
|
+
until: string;
|
|
24
|
+
/** Heading of the presets column. */
|
|
25
|
+
presetsTitle: string;
|
|
26
|
+
/** Muted marker after the field label when `optional`. */
|
|
27
|
+
optional: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const DATEPICKER_LABELS: DatepickerLabels;
|
|
30
|
+
export type CalendarOptions = {
|
|
31
|
+
/** Tier: day cell = the tier's menu item height (`m` → 32 px), text = the tier's text. */
|
|
32
|
+
size?: ControlSize;
|
|
33
|
+
/** Months side by side; one when there is no room. */
|
|
34
|
+
months?: 1 | 2;
|
|
35
|
+
/** The presets column (`range` only). */
|
|
36
|
+
presets?: DatepickerPreset[] | false;
|
|
37
|
+
/** Step prompt under the calendar: «Выберите начальную дату» / «… конечную дату». */
|
|
38
|
+
prompt?: boolean;
|
|
39
|
+
/** Footer with date fields and Reset / Apply. Without it a pick applies at once. */
|
|
40
|
+
footer?: boolean;
|
|
41
|
+
/** Time fields in the footer (00:00 — 23:59 by default). */
|
|
42
|
+
withTime?: boolean;
|
|
43
|
+
/** Days that cannot be picked (a calendar day is a Date at local midnight). */
|
|
44
|
+
isDayDisabled?: (day: Date) => boolean;
|
|
45
|
+
/** Future days are muted and cannot be picked. */
|
|
46
|
+
disableFuture?: boolean;
|
|
47
|
+
/** An annual day + month: no year, months wrap around inside `YEARLESS_YEAR`. */
|
|
48
|
+
yearless?: boolean;
|
|
49
|
+
/** «Today» for highlighting, presets and `disableFuture`; the browser's day by default. */
|
|
50
|
+
today?: Date;
|
|
51
|
+
locale?: Locale;
|
|
52
|
+
weekStartsOn?: WeekStart;
|
|
53
|
+
labels?: Partial<DatepickerLabels>;
|
|
54
|
+
};
|
|
55
|
+
export type RangeModeProps = {
|
|
56
|
+
mode: "range";
|
|
57
|
+
/** Bounds in wall-clock time; `null` — the bound is not set. */
|
|
58
|
+
value?: DatepickerRange;
|
|
59
|
+
defaultValue?: DatepickerRange;
|
|
60
|
+
onValueChange?: (value: DatepickerRange) => void;
|
|
61
|
+
/** Value applied by «Сбросить»; an empty range by default. */
|
|
62
|
+
resetValue?: DatepickerRange;
|
|
63
|
+
};
|
|
64
|
+
export type SingleModeProps = {
|
|
65
|
+
mode: "single";
|
|
66
|
+
value?: Date | null;
|
|
67
|
+
defaultValue?: Date | null;
|
|
68
|
+
onValueChange?: (value: Date | null) => void;
|
|
69
|
+
/** Value applied by «Сбросить»; `null` by default. */
|
|
70
|
+
resetValue?: Date | null;
|
|
71
|
+
};
|
|
72
|
+
/** Native attributes and `ref` of the element a part renders (the panel card, the field frame). */
|
|
73
|
+
export type DatepickerDomProps = Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "defaultValue" | "defaultChecked" | "onChange"> & {
|
|
74
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
75
|
+
};
|
|
76
|
+
export type DatepickerPanelProps = CalendarOptions & (RangeModeProps | SingleModeProps) & DatepickerDomProps;
|
|
77
|
+
/** Separates the calendar options from the native attributes of a part. */
|
|
78
|
+
export declare function splitCalendarOptions<T extends CalendarOptions>({ size, months, presets, prompt, footer, withTime, isDayDisabled, disableFuture, yearless, today, locale, weekStartsOn, labels, ...rest }: T): {
|
|
79
|
+
options: CalendarOptions;
|
|
80
|
+
rest: Omit<T, keyof CalendarOptions>;
|
|
81
|
+
};
|
|
82
|
+
/** The value a part works with: controlled or internal, with its setter. */
|
|
83
|
+
export type DatepickerValue = {
|
|
84
|
+
mode: "range";
|
|
85
|
+
value: DatepickerRange;
|
|
86
|
+
onChange: (value: DatepickerRange) => void;
|
|
87
|
+
resetValue?: DatepickerRange | undefined;
|
|
88
|
+
} | {
|
|
89
|
+
mode: "single";
|
|
90
|
+
value: Date | null;
|
|
91
|
+
onChange: (value: Date | null) => void;
|
|
92
|
+
resetValue?: Date | null | undefined;
|
|
93
|
+
};
|
|
94
|
+
/** Controlled-or-internal value of either mode (a part never switches its mode). */
|
|
95
|
+
export declare function useDatepickerValue(props: RangeModeProps | SingleModeProps): DatepickerValue;
|
|
96
|
+
/** Calendar panel without a field: inline in a page or a card. */
|
|
97
|
+
export declare function DatepickerPanel(props: DatepickerPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
98
|
+
export declare namespace DatepickerPanel {
|
|
99
|
+
var displayName: string;
|
|
100
|
+
}
|
|
101
|
+
type PanelViewProps = Omit<CalendarOptions, "labels"> & DatepickerValue & {
|
|
102
|
+
labels: DatepickerLabels;
|
|
103
|
+
/** `Datepicker.Panel`: the card follows its container; otherwise (the Root popover) it sizes to its content. */
|
|
104
|
+
embedded: boolean;
|
|
105
|
+
/** After a value is applied (Root closes the popover). */
|
|
106
|
+
onDone?: () => void;
|
|
107
|
+
className?: string;
|
|
108
|
+
/** Native attributes and `ref` of the panel card (`Datepicker.Panel`). */
|
|
109
|
+
dom?: Omit<DatepickerDomProps, "className">;
|
|
110
|
+
};
|
|
111
|
+
/** Presets aside (or above when narrow), 1–2 months, the step prompt, the footer. */
|
|
112
|
+
export declare function PanelView(props: PanelViewProps): import("react/jsx-runtime").JSX.Element;
|
|
113
|
+
export {};
|
|
@@ -1,52 +1,47 @@
|
|
|
1
1
|
import { type Locale } from "date-fns";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Datepicker logic without time zones: every value is wall-clock time (the local Date fields).
|
|
4
|
+
* A calendar day is a Date at local midnight. Converting to a zone is up to the application.
|
|
5
5
|
*/
|
|
6
6
|
export type DatepickerRange = {
|
|
7
|
-
/** null —
|
|
7
|
+
/** `null` — no lower bound («Всё время»). */
|
|
8
8
|
from: Date | null;
|
|
9
9
|
to: Date | null;
|
|
10
10
|
};
|
|
11
11
|
export type WeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
12
|
-
/**
|
|
12
|
+
/** A leap year for yearly "day + month" dates. */
|
|
13
13
|
export declare const YEARLESS_YEAR = 2000;
|
|
14
14
|
export declare const DAY_START_MINUTES = 0;
|
|
15
15
|
export declare const DAY_END_MINUTES: number;
|
|
16
16
|
export declare function sameDay(a: Date | null | undefined, b: Date | null | undefined): boolean;
|
|
17
|
-
export declare function toDay(value: Date): Date;
|
|
18
17
|
export declare function minutesOf(value: Date): number;
|
|
19
|
-
/**
|
|
18
|
+
/** Day + minutes → Date; `endOfMinute` fills up to 59.999 s. */
|
|
20
19
|
export declare function withMinutes(day: Date, minutes: number, endOfMinute?: boolean): Date;
|
|
21
|
-
/**
|
|
22
|
-
* Клетка сетки месяца. `day` — день этого месяца или null для клетки соседнего месяца;
|
|
23
|
-
* `outside` — дата соседнего месяца в этой клетке (для приглушённого показа).
|
|
24
|
-
*/
|
|
20
|
+
/** A cell of the month grid: its date, and whether it belongs to the month (else it is a muted day of a neighbour). */
|
|
25
21
|
export type MonthCell = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
outside: Date | null;
|
|
22
|
+
date: Date;
|
|
23
|
+
inMonth: boolean;
|
|
29
24
|
};
|
|
30
25
|
export declare function rowsNeeded(month: Date, weekStartsOn: WeekStart): number;
|
|
31
|
-
/**
|
|
26
|
+
/** Rows of 7 cells for a month; `rows` evens out the height of side-by-side months. */
|
|
32
27
|
export declare function monthGrid(month: Date, rows: number, weekStartsOn: WeekStart): MonthCell[][];
|
|
33
28
|
export declare function weekdayLabels(locale: Locale, weekStartsOn: WeekStart): string[];
|
|
34
29
|
export declare function monthTitle(month: Date, locale: Locale, yearless?: boolean): string;
|
|
35
|
-
/** «6 окт», «6 окт 2025
|
|
30
|
+
/** «6 окт», «6 окт 2025»: the year only when it is not the current one. */
|
|
36
31
|
export declare function formatDayShort(day: Date, today: Date, locale: Locale, yearless?: boolean): string;
|
|
37
|
-
/**
|
|
32
|
+
/** "HH:mm" → minutes since midnight; `null` for an invalid format. */
|
|
38
33
|
export declare function parseTime(text: string): number | null;
|
|
39
34
|
export declare function formatTime(minutes: number): string;
|
|
40
35
|
export type DatepickerPreset = {
|
|
41
36
|
key: string;
|
|
42
37
|
label: string;
|
|
43
|
-
/**
|
|
38
|
+
/** Calendar days relative to today; `from = null` — no lower bound. */
|
|
44
39
|
days: (today: Date) => {
|
|
45
40
|
from: Date | null;
|
|
46
41
|
to: Date;
|
|
47
42
|
};
|
|
48
43
|
};
|
|
49
|
-
/**
|
|
44
|
+
/** Ready presets (the week starts on Monday). Replace a label with `{ ...preset, label }`. */
|
|
50
45
|
export declare const datepickerPresets: {
|
|
51
46
|
today: {
|
|
52
47
|
key: string;
|
|
@@ -112,11 +107,10 @@ export declare const datepickerPresets: {
|
|
|
112
107
|
to: Date;
|
|
113
108
|
};
|
|
114
109
|
};
|
|
115
|
-
/** «Всё время»:
|
|
110
|
+
/** «Всё время»: no lower bound, or an explicit start date. */
|
|
116
111
|
allTime: (start?: Date | null, label?: string) => DatepickerPreset;
|
|
117
112
|
};
|
|
118
|
-
/**
|
|
113
|
+
/** The default set of periods. */
|
|
119
114
|
export declare const DEFAULT_DATEPICKER_PRESETS: DatepickerPreset[];
|
|
120
|
-
/**
|
|
115
|
+
/** The preset that matches the selected days exactly. */
|
|
121
116
|
export declare function matchPreset(presets: DatepickerPreset[], fromDay: Date | null, toDay: Date | null, today: Date): DatepickerPreset | null;
|
|
122
|
-
//# sourceMappingURL=datepickerModel.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ControlSize } from "@/internal/states";
|
|
2
|
+
/** Buttons and fields inside the panel sit one tier below the panel (m → s, 32 = the day cell). */
|
|
3
|
+
export declare const STEP_DOWN: Record<ControlSize, ControlSize>;
|
|
4
|
+
/** Panel geometry in px, the same numbers the CSS lays out with. */
|
|
5
|
+
export type PanelMetrics = {
|
|
6
|
+
/** Day cell: `--prime-control-<tier>-item-height`. */
|
|
7
|
+
cell: number;
|
|
8
|
+
/** Gap between months: `--prime-space-6`. */
|
|
9
|
+
monthsGap: number;
|
|
10
|
+
/** Side padding of `.main` (both sides): `space-3` in the popover, `card-padding-s` embedded. */
|
|
11
|
+
chrome: number;
|
|
12
|
+
};
|
|
13
|
+
/** Reads the panel geometry from the tokens on the document (theme and app overrides apply). */
|
|
14
|
+
export declare function readPanelMetrics(size: ControlSize, embedded: boolean): PanelMetrics;
|
|
15
|
+
export type PanelLayoutInput = {
|
|
16
|
+
/** Requested months (`months` prop). */
|
|
17
|
+
months: 1 | 2;
|
|
18
|
+
hasPresets: boolean;
|
|
19
|
+
/** Embedded panel (`Datepicker.Panel`), not the popover of `Datepicker.Root`. */
|
|
20
|
+
embedded: boolean;
|
|
21
|
+
/** Available inline size in px; `null` — not measured yet (assume it fits). */
|
|
22
|
+
available: number | null;
|
|
23
|
+
metrics: PanelMetrics;
|
|
24
|
+
};
|
|
25
|
+
export type PanelLayout = {
|
|
26
|
+
monthCount: 1 | 2;
|
|
27
|
+
presetsAside: boolean;
|
|
28
|
+
compact: boolean;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* 1 vs 2 months, presets aside vs stacked, compact cells — from the space AVAILABLE to the panel
|
|
32
|
+
* (the parent's content box for an embedded panel, the viewport for the popover). The panel's own
|
|
33
|
+
* width never feeds back into the decision, so there is no resize loop. Without readable tokens
|
|
34
|
+
* (no stylesheet yet) everything is assumed to fit.
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolvePanelLayout({ months, hasPresets, embedded, available, metrics, }: PanelLayoutInput): PanelLayout;
|
|
37
|
+
/** Window width (px) — for the popover panel, which cannot measure itself. */
|
|
38
|
+
export declare function useViewportWidth(enabled: boolean): number | null;
|
|
39
|
+
/**
|
|
40
|
+
* The wheel over an open calendar does not scroll the page under it; scrolling areas inside (the
|
|
41
|
+
* presets list) work as usual. `overscroll-behavior: contain` is not enough: it only holds while
|
|
42
|
+
* the popover itself overflows, and a calendar that fits chains the wheel to the page.
|
|
43
|
+
*/
|
|
44
|
+
export declare function useContainScroll(node: HTMLElement | null): void;
|
|
45
|
+
/**
|
|
46
|
+
* Available width of an embedded panel: the content box of its PARENT (ResizeObserver), not the
|
|
47
|
+
* panel's own width (that follows the content) — otherwise «1 or 2 months» would loop. `null` —
|
|
48
|
+
* not measured yet.
|
|
49
|
+
*/
|
|
50
|
+
export declare function useAvailableWidth(node: HTMLElement | null): number | null;
|
|
@@ -1,38 +1,43 @@
|
|
|
1
|
+
import { type FieldFrameProps, type FieldRootDomProps } from "@/internal/FieldFrame";
|
|
1
2
|
import type { ControlSize } from "@/internal/states";
|
|
2
3
|
export type DigitInputLabels = {
|
|
3
|
-
/** Accessible name of the group
|
|
4
|
+
/** Accessible name of the group when there is no visible `label`. */
|
|
4
5
|
group: string;
|
|
5
6
|
/** Accessible name of a cell; `{index}` (1-based) and `{length}` are replaced. */
|
|
6
7
|
cell: string;
|
|
8
|
+
/** Muted marker after the label when `optional`. */
|
|
9
|
+
optional: string;
|
|
7
10
|
};
|
|
8
|
-
export type
|
|
11
|
+
export type DigitInputProps = FieldRootDomProps & FieldFrameProps & {
|
|
9
12
|
/** Number of cells. */
|
|
10
13
|
length?: number;
|
|
14
|
+
/** Tier. Default: the tier of the surrounding control (a form, a panel), else `m`. */
|
|
11
15
|
size?: ControlSize;
|
|
16
|
+
/**
|
|
17
|
+
* Cells share the container width and grow with it (height stays the tier height, so they become
|
|
18
|
+
* wider than tall). Default `false`: square cells of the tier size, centered.
|
|
19
|
+
*/
|
|
20
|
+
fullWidth?: boolean;
|
|
21
|
+
/** Name of the hidden input that carries the joined code in a native form submit. */
|
|
22
|
+
name?: string;
|
|
23
|
+
/** Splits the cells into groups of this size with a wider gap between them (`3` → 123 456). */
|
|
24
|
+
groupSize?: number;
|
|
25
|
+
/** Hides the digits (PIN): cells are `type="password"`. */
|
|
26
|
+
mask?: boolean;
|
|
27
|
+
/** Focuses the first empty cell on mount. */
|
|
28
|
+
autoFocus?: boolean;
|
|
12
29
|
value?: string;
|
|
13
30
|
defaultValue?: string;
|
|
14
31
|
onValueChange?: (value: string) => void;
|
|
15
32
|
/** Called once when the last empty cell is filled. */
|
|
16
33
|
onComplete?: (value: string) => void;
|
|
17
34
|
disabled?: boolean;
|
|
35
|
+
/** Invalid state: danger ring on every cell. A non-empty `error` implies it. */
|
|
18
36
|
invalid?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
* the fieldset and hides only the visual ring — focus, keyboard and ARIA are unchanged, the error
|
|
22
|
-
* ring still shows. Turn it off only where focus is otherwise obvious; WCAG 2.4.7.
|
|
23
|
-
*/
|
|
24
|
-
focusRing?: boolean;
|
|
25
|
-
/** Id(s) of the hint / error text describing the group. */
|
|
37
|
+
/** Id of the first cell (the label points at it); generated when omitted. */
|
|
38
|
+
id?: string;
|
|
26
39
|
"aria-describedby"?: string;
|
|
27
40
|
labels?: Partial<DigitInputLabels>;
|
|
28
|
-
className?: string;
|
|
29
|
-
};
|
|
30
|
-
declare function DigitInputRoot({ length: lengthProp, size, value: valueProp, defaultValue, onValueChange, onComplete, disabled, invalid, focusRing, "aria-describedby": ariaDescribedBy, labels: labelsProp, className, }: DigitInputRootProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
declare namespace DigitInputRoot {
|
|
32
|
-
var displayName: string;
|
|
33
|
-
}
|
|
34
|
-
export declare const DigitInput: {
|
|
35
|
-
Root: typeof DigitInputRoot;
|
|
36
41
|
};
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
/** A one-time code or PIN split into cells, with the field label, hint and error. */
|
|
43
|
+
export declare function DigitInput({ length, size: sizeProp, fullWidth, name, groupSize, mask, autoFocus, value: valueProp, defaultValue, onValueChange, onComplete, disabled, invalid, focusRing, label, required, optional, hint, error, id, "aria-describedby": ariaDescribedBy, labels: labelsProp, className, ...rest }: DigitInputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
import * as React from "react";
|
|
1
|
+
import type * as React from "react";
|
|
2
2
|
import type { ControlSize } from "@/internal/states";
|
|
3
3
|
export type DividerOrientation = "horizontal" | "vertical";
|
|
4
4
|
export type DividerAlign = "start" | "center" | "end";
|
|
5
|
-
export type
|
|
5
|
+
export type DividerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
/** Default `horizontal`. */
|
|
6
7
|
orientation?: DividerOrientation;
|
|
7
8
|
/** Position of the label (children) on the line. Default `center`. */
|
|
8
9
|
align?: DividerAlign;
|
|
10
|
+
/** Tier of the label: type, gap and icon size. Default `m`. */
|
|
9
11
|
size?: ControlSize;
|
|
10
|
-
|
|
11
|
-
className?: string;
|
|
12
|
-
} & React.HTMLAttributes<HTMLDivElement>;
|
|
13
|
-
export declare const Divider: {
|
|
14
|
-
Root: React.ForwardRefExoticComponent<{
|
|
15
|
-
orientation?: DividerOrientation;
|
|
16
|
-
/** Position of the label (children) on the line. Default `center`. */
|
|
17
|
-
align?: DividerAlign;
|
|
18
|
-
size?: ControlSize;
|
|
19
|
-
children?: React.ReactNode;
|
|
20
|
-
className?: string;
|
|
21
|
-
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
22
13
|
};
|
|
23
|
-
|
|
14
|
+
/** A hairline with an optional label; `role="separator"` unless the consumer overrides `role`. */
|
|
15
|
+
export declare function Divider({ orientation, align, size, children, className, role, ...rest }: DividerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type DragItem, type DragOutcome } from "./dragSession";
|
|
3
|
+
import type { Point, Rect } from "./geometry";
|
|
4
|
+
import { type DndLabels } from "./labels";
|
|
5
|
+
import { type ReorderReturn } from "./useSortableList";
|
|
6
|
+
export type { DragItem, DragOutcome } from "./dragSession";
|
|
7
|
+
export type { DndLabels } from "./labels";
|
|
8
|
+
export type { DndReorderResult } from "./useSortableList";
|
|
9
|
+
export type DndRootProps = {
|
|
10
|
+
/** Built-in strings (live region, handle, role description). Russian defaults. */
|
|
11
|
+
labels?: Partial<DndLabels>;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Owns the one drag session the app shares, the overlay that follows the pointer and the live
|
|
16
|
+
* region. Mount once above every screen that drags: a drag crosses component boundaries.
|
|
17
|
+
*/
|
|
18
|
+
declare function DndRoot({ labels, children }: DndRootProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare namespace DndRoot {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
22
|
+
export type DndHandleProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "children"> & {
|
|
23
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The grip of a `handle` item: a ghost icon-only Button (`xs`), so it is reachable by keyboard
|
|
27
|
+
* (Alt+arrows reorder).
|
|
28
|
+
*/
|
|
29
|
+
declare function DndHandle({ className, "aria-label": ariaLabel, ref, ...rest }: DndHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
declare namespace DndHandle {
|
|
31
|
+
var displayName: string;
|
|
32
|
+
}
|
|
33
|
+
export type DndSortableProps<T> = Omit<React.HTMLAttributes<HTMLElement>, "children"> & {
|
|
34
|
+
/** Items in their current order. */
|
|
35
|
+
items: readonly T[];
|
|
36
|
+
/** Stable unique id of an item. */
|
|
37
|
+
getId: (item: T) => string;
|
|
38
|
+
/** Spoken by the live region ("Задача 3: позиция 2 из 5"). Defaults to the id. */
|
|
39
|
+
getLabel?: (item: T) => string;
|
|
40
|
+
/** Called when an item lands in front of `beforeId` (`null` = last). Return `{ ok: false }` (or reject) to roll the drawn order back. */
|
|
41
|
+
onReorder: (id: string, beforeId: string | null) => ReorderReturn | Promise<ReorderReturn>;
|
|
42
|
+
/** Renders one item; return a `Dnd.SortableItem`. */
|
|
43
|
+
renderItem: (item: T, index: number) => React.ReactNode;
|
|
44
|
+
/** Layout direction of the list. */
|
|
45
|
+
axis?: "x" | "y";
|
|
46
|
+
/** Only `Dnd.Handle` starts a drag; the rest of the item stays free for clicks and text selection. */
|
|
47
|
+
handle?: boolean;
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Drag kind. Lists sharing a `kind` exchange items: an item dropped from another list arrives in
|
|
51
|
+
* `onReorder` with an `id` that is not in `items` (move it into this list). Defaults to a unique
|
|
52
|
+
* value per list, so lists stay separate.
|
|
53
|
+
*/
|
|
54
|
+
kind?: string;
|
|
55
|
+
/** Refuses an item (by id) the list would otherwise take; the list turns `danger` before the release. */
|
|
56
|
+
canDrop?: (id: string) => boolean;
|
|
57
|
+
/** Root element: `ul` / `ol` turn items into `li`. */
|
|
58
|
+
as?: "div" | "ul" | "ol";
|
|
59
|
+
/** Accessible name of the list. */
|
|
60
|
+
"aria-label"?: string;
|
|
61
|
+
ref?: React.Ref<HTMLElement>;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* A reorderable list: pointer drag with a gap where the item lands, neighbours that glide aside, an
|
|
65
|
+
* optimistic order, auto-scroll near the edges and an Alt+arrow keyboard path.
|
|
66
|
+
*/
|
|
67
|
+
declare function DndSortable<T>({ items, getId, getLabel, onReorder, renderItem, axis, handle, disabled, kind, canDrop, as: Tag, className, ref: forwardedRef, ...rest }: DndSortableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
declare namespace DndSortable {
|
|
69
|
+
var displayName: string;
|
|
70
|
+
}
|
|
71
|
+
export type DndSortableItemProps = {
|
|
72
|
+
/** Must match `getId` of the item. */
|
|
73
|
+
id: string;
|
|
74
|
+
disabled?: boolean;
|
|
75
|
+
className?: string;
|
|
76
|
+
children?: React.ReactNode;
|
|
77
|
+
ref?: React.Ref<HTMLElement>;
|
|
78
|
+
} & Omit<React.HTMLAttributes<HTMLElement>, "id">;
|
|
79
|
+
/** One item of a `Dnd.Sortable`. Renders `li` inside `ul` / `ol`, `div` otherwise. */
|
|
80
|
+
declare function DndSortableItem({ id, disabled: itemDisabled, className, children, onPointerDown, onKeyDown, ref, ...rest }: DndSortableItemProps): import("react/jsx-runtime").JSX.Element;
|
|
81
|
+
declare namespace DndSortableItem {
|
|
82
|
+
var displayName: string;
|
|
83
|
+
}
|
|
84
|
+
export type DndDraggableProps<TData = unknown> = {
|
|
85
|
+
/** What is dragged; a `Dnd.DropZone` accepts it by kind. */
|
|
86
|
+
kind: string;
|
|
87
|
+
id: string;
|
|
88
|
+
/** Payload handed to the drop target. */
|
|
89
|
+
data?: TData;
|
|
90
|
+
/** Spoken by the live region. Defaults to the id. */
|
|
91
|
+
label?: string;
|
|
92
|
+
disabled?: boolean;
|
|
93
|
+
/** Only `Dnd.Handle` starts a drag. */
|
|
94
|
+
handle?: boolean;
|
|
95
|
+
as?: "div" | "li" | "span" | "article" | "section";
|
|
96
|
+
onDragStart?: (item: DragItem<TData>, point: Point, origin: Rect) => void;
|
|
97
|
+
onDragEnd?: (item: DragItem<TData>, outcome: DragOutcome) => void;
|
|
98
|
+
className?: string;
|
|
99
|
+
children?: React.ReactNode;
|
|
100
|
+
ref?: React.Ref<HTMLElement>;
|
|
101
|
+
} & Omit<React.HTMLAttributes<HTMLElement>, "id">;
|
|
102
|
+
/** Something to carry onto a `Dnd.DropZone`. The source stays in place, faded, until the drop. */
|
|
103
|
+
declare function DndDraggable<TData = unknown>({ kind, id, data, label, disabled, handle, as: Tag, onDragStart, onDragEnd, className, children, onPointerDown, ref, ...rest }: DndDraggableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
104
|
+
declare namespace DndDraggable {
|
|
105
|
+
var displayName: string;
|
|
106
|
+
}
|
|
107
|
+
export type DndDropZoneProps<TData = unknown> = {
|
|
108
|
+
/** Drag kinds this zone takes, or a predicate over the dragged item. */
|
|
109
|
+
accepts: string | readonly string[] | ((item: DragItem) => boolean);
|
|
110
|
+
onDrop: (item: DragItem<TData>) => void;
|
|
111
|
+
/** Refuses an item the zone would otherwise take; the zone turns `danger` before the release. */
|
|
112
|
+
canDrop?: (item: DragItem<TData>) => boolean;
|
|
113
|
+
onEnter?: (item: DragItem<TData>) => void;
|
|
114
|
+
onLeave?: () => void;
|
|
115
|
+
/** Flashes the zone after a drop, so the eye can follow where the item went. */
|
|
116
|
+
flashOnDrop?: boolean;
|
|
117
|
+
disabled?: boolean;
|
|
118
|
+
as?: "div" | "section" | "li" | "ul" | "ol" | "span";
|
|
119
|
+
className?: string;
|
|
120
|
+
children?: React.ReactNode;
|
|
121
|
+
ref?: React.Ref<HTMLElement>;
|
|
122
|
+
} & Omit<React.HTMLAttributes<HTMLElement>, "onDrop">;
|
|
123
|
+
/** A box that takes dropped items. `data-dnd-over` / `data-dnd-reject` / `data-dnd-flash` mirror its state. */
|
|
124
|
+
declare function DndDropZone<TData = unknown>({ accepts, onDrop, canDrop, onEnter, onLeave, flashOnDrop, disabled, as: Tag, className, children, onAnimationEnd, ref: forwardedRef, ...rest }: DndDropZoneProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
125
|
+
declare namespace DndDropZone {
|
|
126
|
+
var displayName: string;
|
|
127
|
+
}
|
|
128
|
+
export declare const Dnd: {
|
|
129
|
+
Root: typeof DndRoot;
|
|
130
|
+
Sortable: typeof DndSortable;
|
|
131
|
+
SortableItem: typeof DndSortableItem;
|
|
132
|
+
Draggable: typeof DndDraggable;
|
|
133
|
+
DropZone: typeof DndDropZone;
|
|
134
|
+
Handle: typeof DndHandle;
|
|
135
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { DragController } from "./dragSession";
|
|
3
|
+
/** The piece that follows the pointer: a clone of the lifted element above every layer. Mounted once by `Dnd.Root`. */
|
|
4
|
+
export declare function DragOverlay({ controller }: {
|
|
5
|
+
controller: DragController;
|
|
6
|
+
}): React.ReactPortal | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Point } from "./geometry";
|
|
2
|
+
/** Scrollable boxes between `element` and the root, innermost first: a list that can still scroll wins over the page. */
|
|
3
|
+
export declare function scrollableAncestors(element: Element | null): HTMLElement[];
|
|
4
|
+
/** Scrolls the innermost container that wants to move and still can. Returns whether anything moved. */
|
|
5
|
+
export declare function autoScrollStep(containers: HTMLElement[], point: Point, elapsedMs: number): boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type DragController } from "./dragSession";
|
|
3
|
+
export declare const DragControllerContext: React.Context<DragController | null>;
|
|
4
|
+
/** The one drag session every drag hook runs in, mounted by `Dnd.Root`. */
|
|
5
|
+
export declare function useDragController(): DragController;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type Point, type Rect } from "./geometry";
|
|
2
|
+
import { type DndLabels } from "./labels";
|
|
3
|
+
import { type Store } from "./store";
|
|
4
|
+
/**
|
|
5
|
+
* Every gesture runs on pointer events, mouse and finger alike. The HTML5 drag-and-drop API is not
|
|
6
|
+
* used: it never fires from touch, its preview cannot be styled, and its drop delivery depends on a
|
|
7
|
+
* preventDefault on the last dragover. One pointer path means one set of rules everywhere.
|
|
8
|
+
*/
|
|
9
|
+
export type PointerKind = "mouse" | "touch" | "pen";
|
|
10
|
+
export type DragItem<TData = unknown> = {
|
|
11
|
+
/** What is dragged, matched against a target's `accepts`. Unrelated screens never see each other's drags. */
|
|
12
|
+
kind: string;
|
|
13
|
+
id: string;
|
|
14
|
+
data: TData;
|
|
15
|
+
/** Spoken by the live region; written for someone who cannot see where the item went. */
|
|
16
|
+
label: string;
|
|
17
|
+
};
|
|
18
|
+
export type DragSnapshot = {
|
|
19
|
+
item: DragItem | null;
|
|
20
|
+
pointerKind: PointerKind | null;
|
|
21
|
+
/** The drop target the pointer is over right now, by registered id. */
|
|
22
|
+
overId: string | null;
|
|
23
|
+
canDrop: boolean;
|
|
24
|
+
/** The rect the lifted element occupied when the drag began: the size of the gap a list opens for it. */
|
|
25
|
+
origin: Rect | null;
|
|
26
|
+
/** Where inside that rect the pointer grabbed it. */
|
|
27
|
+
grab: Point | null;
|
|
28
|
+
/** The lifted element's `border-radius`, so the gap it leaves is shaped like it. */
|
|
29
|
+
radius: string | null;
|
|
30
|
+
/** The live region text; `sequence` makes a repeated message count as new for assistive technology. */
|
|
31
|
+
announcement: {
|
|
32
|
+
message: string;
|
|
33
|
+
sequence: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export declare const IDLE_SNAPSHOT: DragSnapshot;
|
|
37
|
+
export type DropTargetEntry = {
|
|
38
|
+
id: string;
|
|
39
|
+
element: HTMLElement;
|
|
40
|
+
accepts: (item: DragItem) => boolean;
|
|
41
|
+
enter: (item: DragItem) => void;
|
|
42
|
+
/** Called on every resolved pointer position; returns whether a drop here would be accepted. */
|
|
43
|
+
over: (point: Point, item: DragItem) => boolean;
|
|
44
|
+
leave: () => void;
|
|
45
|
+
drop: (point: Point, item: DragItem) => void;
|
|
46
|
+
};
|
|
47
|
+
export type DragPreview = {
|
|
48
|
+
/** The element the gesture started on, cloned by the overlay. */
|
|
49
|
+
element: HTMLElement;
|
|
50
|
+
origin: Rect;
|
|
51
|
+
/** Where inside the element the pointer grabbed it: the same pixel stays under the finger. */
|
|
52
|
+
grab: Point;
|
|
53
|
+
point: Point;
|
|
54
|
+
pointerKind: PointerKind;
|
|
55
|
+
};
|
|
56
|
+
export type DragOverlayEvent = {
|
|
57
|
+
type: "start";
|
|
58
|
+
preview: DragPreview;
|
|
59
|
+
} | {
|
|
60
|
+
type: "move";
|
|
61
|
+
point: Point;
|
|
62
|
+
} | {
|
|
63
|
+
type: "end";
|
|
64
|
+
item: DragItem;
|
|
65
|
+
outcome: DragOutcome;
|
|
66
|
+
origin: Rect | null;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* How a drag ended. `release` is not `cancel`: the pointer was let go deliberately, just not over a
|
|
70
|
+
* target that took it. `cancel` (Escape, a system-cancelled pointer) means the move was taken back.
|
|
71
|
+
*/
|
|
72
|
+
export type DragOutcome = "drop" | "release" | "cancel";
|
|
73
|
+
export type BeginDragParams<TData> = {
|
|
74
|
+
event: PointerEvent;
|
|
75
|
+
/** The element the drag lifts: the whole card, even when the press landed on a handle inside it. */
|
|
76
|
+
element: HTMLElement;
|
|
77
|
+
item: DragItem<TData>;
|
|
78
|
+
/** Fired once the press became a drag, with the press point and the rect the item occupied. */
|
|
79
|
+
onDragStart?(item: DragItem<TData>, point: Point, origin: Rect): void;
|
|
80
|
+
onDragEnd?(item: DragItem<TData>, outcome: DragOutcome): void;
|
|
81
|
+
};
|
|
82
|
+
export type DragController = {
|
|
83
|
+
store: Store<DragSnapshot>;
|
|
84
|
+
registerTarget: (entry: DropTargetEntry) => () => void;
|
|
85
|
+
beginPointerDrag: <TData>(params: BeginDragParams<TData>) => void;
|
|
86
|
+
/** Speaks through the live region without a pointer drag in flight (the keyboard path). */
|
|
87
|
+
announce: (message: string) => void;
|
|
88
|
+
labels: () => DndLabels;
|
|
89
|
+
cancel: () => void;
|
|
90
|
+
subscribeOverlay: (listener: (event: DragOverlayEvent) => void) => () => void;
|
|
91
|
+
destroy: () => void;
|
|
92
|
+
};
|
|
93
|
+
export declare function createDragController(getLabels?: () => DndLabels): DragController;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type Point = {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
};
|
|
5
|
+
export type Rect = {
|
|
6
|
+
left: number;
|
|
7
|
+
top: number;
|
|
8
|
+
right: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
};
|
|
13
|
+
export type Axis = "x" | "y";
|
|
14
|
+
export declare function rectOf(element: Element): Rect;
|
|
15
|
+
/**
|
|
16
|
+
* Where an element sits in the layout with any animation transform taken back out. Every drop
|
|
17
|
+
* decision is measured against this: reading the drawn position makes each answer depend on the
|
|
18
|
+
* animation the previous answer started, and the gap flickers under a pointer that barely moves.
|
|
19
|
+
*/
|
|
20
|
+
export declare function layoutRect(element: Element): Rect;
|
|
21
|
+
export declare function rectContains(rect: Rect, point: Point): boolean;
|
|
22
|
+
export declare function distanceBetween(a: Point, b: Point): number;
|
|
23
|
+
/** Marks the gap a sortable list opens where the dragged item will land. */
|
|
24
|
+
export declare const DROP_GAP_SELECTOR = "[data-dnd-gap]";
|
|
25
|
+
/**
|
|
26
|
+
* The item a dragged one would land in front of: the first whose midline is past the pointer, or
|
|
27
|
+
* `null` for "after every item". Measured in the layout the list would have WITHOUT the gap, so the
|
|
28
|
+
* answer depends only on the pointer, never on where the gap currently stands.
|
|
29
|
+
*/
|
|
30
|
+
export declare function insertionBefore(container: Element, itemSelector: string, point: Point, axis?: Axis, liftedId?: string): string | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** System strings of the drag-and-drop layer. `{label}`, `{position}`, `{total}` are substituted. */
|
|
2
|
+
export type DndLabels = {
|
|
3
|
+
/** `aria-label` of `Dnd.Handle`. */
|
|
4
|
+
handle: string;
|
|
5
|
+
/** `aria-roledescription` of every draggable element. */
|
|
6
|
+
roleDescription: string;
|
|
7
|
+
/** Live region: an item was picked up. */
|
|
8
|
+
grabbed: string;
|
|
9
|
+
/** Live region: an item was dropped on a target. */
|
|
10
|
+
dropped: string;
|
|
11
|
+
/** Live region: an item was released over nothing and went back. */
|
|
12
|
+
returned: string;
|
|
13
|
+
/** Live region: the drag was cancelled (Escape, system interruption). */
|
|
14
|
+
cancelled: string;
|
|
15
|
+
/** Live region: an item was moved with the keyboard. */
|
|
16
|
+
moved: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const defaultDndLabels: DndLabels;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type Store<T> = {
|
|
2
|
+
getSnapshot: () => T;
|
|
3
|
+
subscribe: (listener: () => void) => () => void;
|
|
4
|
+
setState: (update: (current: T) => T) => void;
|
|
5
|
+
};
|
|
6
|
+
/** A plain store outside React: the drag session outlives any one component and is shared by many. */
|
|
7
|
+
export declare function createStore<T>(initial: T): Store<T>;
|
|
8
|
+
/** Subscribes to a slice of a store. `select` must return a primitive or a stable reference. */
|
|
9
|
+
export declare function useStoreSelector<T, S>(store: Store<T>, select: (state: T) => S): S;
|