@sanity/ui 4.0.0-beta.8 → 4.0.0-next.2
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/LICENSE +1 -1
- package/README.md +21 -7
- package/dist/_chunks/getScopedTheme.cjs +4043 -0
- package/dist/_chunks/getScopedTheme.cjs.map +1 -0
- package/dist/_chunks/getScopedTheme.js +3803 -0
- package/dist/_chunks/getScopedTheme.js.map +1 -0
- package/dist/_chunks/refractor.cjs +18 -0
- package/dist/_chunks/refractor.cjs.map +1 -0
- package/dist/_chunks/refractor.js +20 -0
- package/dist/_chunks/refractor.js.map +1 -0
- package/dist/_chunks/rgba.d.cts +929 -0
- package/dist/_chunks/rgba.d.cts.map +1 -0
- package/dist/_chunks/rgba.d.ts +929 -0
- package/dist/_chunks/rgba.d.ts.map +1 -0
- package/dist/index.cjs +6243 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2332 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +1767 -1190
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6134 -4725
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs +54 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.cts +278 -0
- package/dist/theme.d.cts.map +1 -0
- package/dist/theme.d.ts +278 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +53 -0
- package/dist/theme.js.map +1 -0
- package/package.json +55 -86
- package/dist/_chunks-es/Syntax.js +0 -23
- package/dist/_chunks-es/Syntax.js.map +0 -1
- package/dist/index.css +0 -1
- package/exports/index.css +0 -1
- package/exports/index.ts +0 -125
- package/src/components/autocomplete/Autocomplete.tsx +0 -665
- package/src/components/autocomplete/AutocompleteOption.tsx +0 -42
- package/src/components/autocomplete/__workshop__/Async.tsx +0 -162
- package/src/components/autocomplete/__workshop__/ConstrainedHeight.tsx +0 -121
- package/src/components/autocomplete/__workshop__/Custom.tsx +0 -91
- package/src/components/autocomplete/__workshop__/Example.tsx +0 -70
- package/src/components/autocomplete/__workshop__/FocusAndBlur.tsx +0 -39
- package/src/components/autocomplete/__workshop__/Fullscreen.tsx +0 -307
- package/src/components/autocomplete/__workshop__/index.ts +0 -41
- package/src/components/autocomplete/__workshop__/mock/apiStore.ts +0 -49
- package/src/components/autocomplete/__workshop__/mock/countries.ts +0 -245
- package/src/components/autocomplete/__workshop__/types.ts +0 -4
- package/src/components/autocomplete/autocompleteReducer.ts +0 -47
- package/src/components/autocomplete/constants.ts +0 -28
- package/src/components/autocomplete/types.ts +0 -103
- package/src/components/breadcrumbs/Breadcrumbs.tsx +0 -163
- package/src/components/breadcrumbs/__workshop__/Example.tsx +0 -48
- package/src/components/breadcrumbs/__workshop__/index.ts +0 -16
- package/src/components/dialog/Dialog.tsx +0 -230
- package/src/components/dialog/DialogCard.tsx +0 -233
- package/src/components/dialog/DialogContext.ts +0 -21
- package/src/components/dialog/DialogProvider.tsx +0 -34
- package/src/components/dialog/__workshop__/Activate.tsx +0 -141
- package/src/components/dialog/__workshop__/AutoFocus.tsx +0 -29
- package/src/components/dialog/__workshop__/Layering.tsx +0 -41
- package/src/components/dialog/__workshop__/Nested.tsx +0 -71
- package/src/components/dialog/__workshop__/OnScroll.tsx +0 -51
- package/src/components/dialog/__workshop__/Panes.tsx +0 -75
- package/src/components/dialog/__workshop__/Position.tsx +0 -30
- package/src/components/dialog/__workshop__/Props.tsx +0 -93
- package/src/components/dialog/__workshop__/Provider.tsx +0 -11
- package/src/components/dialog/__workshop__/Wrapped.tsx +0 -76
- package/src/components/dialog/__workshop__/index.ts +0 -21
- package/src/components/dialog/isTargetWithinScope.ts +0 -14
- package/src/components/dialog/types.ts +0 -2
- package/src/components/dialog/useDialog.ts +0 -11
- package/src/components/hotkeys/Hotkeys.tsx +0 -70
- package/src/components/hotkeys/__workshop__/Plain.tsx +0 -9
- package/src/components/hotkeys/__workshop__/index.ts +0 -16
- package/src/components/menu/Menu.test.tsx +0 -125
- package/src/components/menu/Menu.tsx +0 -174
- package/src/components/menu/MenuButton.tsx +0 -231
- package/src/components/menu/MenuContext.ts +0 -19
- package/src/components/menu/MenuDivider.tsx +0 -32
- package/src/components/menu/MenuGroup.tsx +0 -240
- package/src/components/menu/MenuItem.tsx +0 -153
- package/src/components/menu/__workshop__/AsComponent.tsx +0 -45
- package/src/components/menu/__workshop__/AvatarMenu.tsx +0 -36
- package/src/components/menu/__workshop__/ClosableMenuButton.tsx +0 -47
- package/src/components/menu/__workshop__/ConstrainedInBoundary.tsx +0 -133
- package/src/components/menu/__workshop__/CustomMenuItem.tsx +0 -47
- package/src/components/menu/__workshop__/CustomSelectedState.tsx +0 -35
- package/src/components/menu/__workshop__/DataProps.tsx +0 -27
- package/src/components/menu/__workshop__/DisableFocusOnClose.tsx +0 -40
- package/src/components/menu/__workshop__/Groups.tsx +0 -164
- package/src/components/menu/__workshop__/MenuButton.tsx +0 -79
- package/src/components/menu/__workshop__/MenuGroupRight.tsx +0 -73
- package/src/components/menu/__workshop__/NestedMenu.tsx +0 -22
- package/src/components/menu/__workshop__/OnCloseMenuButton.tsx +0 -50
- package/src/components/menu/__workshop__/SelectedItem.tsx +0 -69
- package/src/components/menu/__workshop__/ShouldFocus.tsx +0 -42
- package/src/components/menu/__workshop__/Tones.tsx +0 -19
- package/src/components/menu/__workshop__/index.ts +0 -91
- package/src/components/menu/helpers.ts +0 -82
- package/src/components/menu/useMenu.ts +0 -21
- package/src/components/menu/useMenuController.ts +0 -245
- package/src/components/tab/Tab.tsx +0 -135
- package/src/components/tab/TabList.tsx +0 -157
- package/src/components/tab/TabListContext.ts +0 -10
- package/src/components/tab/TabPanel.tsx +0 -94
- package/src/components/tab/__workshop__/Example.tsx +0 -135
- package/src/components/tab/__workshop__/index.ts +0 -16
- package/src/components/tab/types.ts +0 -11
- package/src/components/toast/Toast.test.tsx +0 -103
- package/src/components/toast/Toast.tsx +0 -191
- package/src/components/toast/ToastContext.ts +0 -7
- package/src/components/toast/ToastLayer.tsx +0 -54
- package/src/components/toast/ToastProvider.tsx +0 -127
- package/src/components/toast/__workshop__/Hook.tsx +0 -71
- package/src/components/toast/__workshop__/Toast.tsx +0 -26
- package/src/components/toast/__workshop__/index.ts +0 -21
- package/src/components/toast/toastState.ts +0 -6
- package/src/components/toast/types.ts +0 -24
- package/src/components/toast/useToast.ts +0 -23
- package/src/components/tree/Tree.tsx +0 -248
- package/src/components/tree/TreeContext.ts +0 -10
- package/src/components/tree/TreeGroup.tsx +0 -46
- package/src/components/tree/TreeItem.tsx +0 -236
- package/src/components/tree/__workshop__/Basic.tsx +0 -108
- package/src/components/tree/__workshop__/TabFromElement.tsx +0 -84
- package/src/components/tree/__workshop__/basic.perf.ts +0 -19
- package/src/components/tree/__workshop__/index.ts +0 -23
- package/src/components/tree/helpers.ts +0 -105
- package/src/components/tree/types.ts +0 -24
- package/src/components/tree/useTree.ts +0 -17
- package/src/components/virtualList/VirtualList.tsx +0 -254
- package/src/components/virtualList/__workshop__/ChangingProps.tsx +0 -41
- package/src/components/virtualList/__workshop__/ElementScroll.tsx +0 -43
- package/src/components/virtualList/__workshop__/InfiniteList.tsx +0 -40
- package/src/components/virtualList/__workshop__/WindowScrolll.tsx +0 -23
- package/src/components/virtualList/__workshop__/index.ts +0 -31
- package/src/core/_keys.ts +0 -26
- package/src/core/constants.ts +0 -67
- package/src/core/getElementRef.ts +0 -29
- package/src/core/helpers/animation.ts +0 -26
- package/src/core/helpers/element.ts +0 -55
- package/src/core/helpers/focus.ts +0 -92
- package/src/core/helpers/props.ts +0 -51
- package/src/core/helpers/scroll.ts +0 -15
- package/src/core/lib/createGlobalScopedContext.ts +0 -39
- package/src/core/lib/globalScope.ts +0 -19
- package/src/core/lib/isArray.ts +0 -3
- package/src/core/lib/isRecord.ts +0 -3
- package/src/core/types.ts +0 -57
- package/src/hooks/useClickOutsideEvent.test.tsx +0 -114
- package/src/hooks/useClickOutsideEvent.ts +0 -66
- package/src/hooks/useCustomValidity.ts +0 -13
- package/src/hooks/useElementSize.ts +0 -19
- package/src/hooks/useGlobalKeyDown.ts +0 -23
- package/src/hooks/useMatchMedia.ts +0 -28
- package/src/hooks/useMediaIndex/__workshop__/Test.tsx +0 -14
- package/src/hooks/useMediaIndex/__workshop__/index.ts +0 -16
- package/src/hooks/useMediaIndex/useMediaIndex.test.tsx +0 -21
- package/src/hooks/useMediaIndex/useMediaIndex.ts +0 -111
- package/src/hooks/useMounted.ts +0 -15
- package/src/hooks/usePrefersDark.hydration.test.tsx +0 -56
- package/src/hooks/usePrefersDark.test.tsx +0 -20
- package/src/hooks/usePrefersDark.ts +0 -16
- package/src/hooks/usePrefersReducedMotion.hydration.test.tsx +0 -56
- package/src/hooks/usePrefersReducedMotion.test.tsx +0 -20
- package/src/hooks/usePrefersReducedMotion.ts +0 -16
- package/src/hooks/useResponsiveProp.ts +0 -14
- package/src/hooks/useUnique.ts +0 -54
- package/src/middleware/origin.ts +0 -47
- package/src/observers/elementSize.ts +0 -114
- package/src/primitives/_syntax/LazySyntax.tsx +0 -4
- package/src/primitives/_syntax/Syntax.tsx +0 -26
- package/src/primitives/avatar/Avatar.tsx +0 -145
- package/src/primitives/avatar/AvatarCounter.tsx +0 -69
- package/src/primitives/avatar/AvatarStack.tsx +0 -77
- package/src/primitives/avatar/__workshop__/AsButton.tsx +0 -12
- package/src/primitives/avatar/__workshop__/PropsStory.tsx +0 -24
- package/src/primitives/avatar/__workshop__/Stack.tsx +0 -27
- package/src/primitives/avatar/__workshop__/WithinButton.tsx +0 -51
- package/src/primitives/avatar/__workshop__/WithinMenuItem.tsx +0 -52
- package/src/primitives/avatar/__workshop__/index.ts +0 -36
- package/src/primitives/avatar/types.ts +0 -2
- package/src/primitives/badge/Badge.test.tsx +0 -16
- package/src/primitives/badge/Badge.tsx +0 -53
- package/src/primitives/badge/__workshop__/Props.tsx +0 -27
- package/src/primitives/badge/__workshop__/Tones.tsx +0 -15
- package/src/primitives/badge/__workshop__/index.ts +0 -26
- package/src/primitives/badge/__workshop__/within-button.tsx +0 -36
- package/src/primitives/box/Box.tsx +0 -73
- package/src/primitives/box/__workshop__/Props.tsx +0 -26
- package/src/primitives/box/__workshop__/Responsive.tsx +0 -19
- package/src/primitives/box/__workshop__/index.ts +0 -21
- package/src/primitives/button/Button.test.tsx +0 -30
- package/src/primitives/button/Button.tsx +0 -148
- package/src/primitives/button/__workshop__/Custom.tsx +0 -39
- package/src/primitives/button/__workshop__/CustomIcons.tsx +0 -37
- package/src/primitives/button/__workshop__/DataProps.tsx +0 -18
- package/src/primitives/button/__workshop__/Disabled.tsx +0 -43
- package/src/primitives/button/__workshop__/MixedChildren.tsx +0 -12
- package/src/primitives/button/__workshop__/Props.tsx +0 -60
- package/src/primitives/button/__workshop__/Stacked.tsx +0 -60
- package/src/primitives/button/__workshop__/Styled1.css.ts +0 -7
- package/src/primitives/button/__workshop__/Styled1.tsx +0 -11
- package/src/primitives/button/__workshop__/TextOverflow.tsx +0 -17
- package/src/primitives/button/__workshop__/UploadButton.tsx +0 -28
- package/src/primitives/button/__workshop__/index.ts +0 -61
- package/src/primitives/button/types.ts +0 -2
- package/src/primitives/card/Card.tsx +0 -124
- package/src/primitives/card/CardContext.ts +0 -10
- package/src/primitives/card/CardInternalContext.ts +0 -10
- package/src/primitives/card/CardInternalProvider.tsx +0 -15
- package/src/primitives/card/CardProvider.tsx +0 -16
- package/src/primitives/card/__workshop__/AsButton.tsx +0 -103
- package/src/primitives/card/__workshop__/AsComponent.tsx +0 -25
- package/src/primitives/card/__workshop__/Checkered.tsx +0 -25
- package/src/primitives/card/__workshop__/DataProps.tsx +0 -25
- package/src/primitives/card/__workshop__/Interactive.tsx +0 -29
- package/src/primitives/card/__workshop__/ListNavigation.tsx +0 -78
- package/src/primitives/card/__workshop__/Props.tsx +0 -59
- package/src/primitives/card/__workshop__/Selected.tsx +0 -62
- package/src/primitives/card/__workshop__/Styled.tsx +0 -11
- package/src/primitives/card/__workshop__/Tones.tsx +0 -26
- package/src/primitives/card/__workshop__/index.ts +0 -21
- package/src/primitives/card/types.ts +0 -21
- package/src/primitives/card/useCard.ts +0 -20
- package/src/primitives/checkbox/Checkbox.tsx +0 -80
- package/src/primitives/checkbox/__workshop__/Example.tsx +0 -25
- package/src/primitives/checkbox/__workshop__/Props.tsx +0 -35
- package/src/primitives/checkbox/__workshop__/ReadOnly.tsx +0 -16
- package/src/primitives/checkbox/__workshop__/Tones.tsx +0 -26
- package/src/primitives/checkbox/__workshop__/index.ts +0 -15
- package/src/primitives/code/Code.tsx +0 -47
- package/src/primitives/code/__workshop__/OpticalAlignment.tsx +0 -25
- package/src/primitives/code/__workshop__/Props.tsx +0 -20
- package/src/primitives/code/__workshop__/index.ts +0 -21
- package/src/primitives/container/Container.tsx +0 -43
- package/src/primitives/container/__workshop__/Example.tsx +0 -16
- package/src/primitives/container/__workshop__/index.ts +0 -16
- package/src/primitives/container/types.ts +0 -6
- package/src/primitives/flex/Flex.tsx +0 -38
- package/src/primitives/flex/__workshop__/Example.tsx +0 -26
- package/src/primitives/flex/__workshop__/Gap.tsx +0 -25
- package/src/primitives/flex/__workshop__/index.ts +0 -13
- package/src/primitives/flex/__workshop__/styles.css.ts +0 -12
- package/src/primitives/grid/Grid.tsx +0 -38
- package/src/primitives/grid/__workshop__/Responsive.tsx +0 -54
- package/src/primitives/grid/__workshop__/index.ts +0 -12
- package/src/primitives/heading/Heading.tsx +0 -68
- package/src/primitives/heading/__workshop__/OpticalAlignment.tsx +0 -27
- package/src/primitives/heading/__workshop__/Plain.tsx +0 -25
- package/src/primitives/heading/__workshop__/index.ts +0 -21
- package/src/primitives/inline/Inline.tsx +0 -37
- package/src/primitives/inline/__workshop__/Plain.tsx +0 -22
- package/src/primitives/inline/__workshop__/index.ts +0 -10
- package/src/primitives/kbd/Kbd.tsx +0 -36
- package/src/primitives/kbd/__workshop__/Plain.tsx +0 -9
- package/src/primitives/kbd/__workshop__/index.ts +0 -10
- package/src/primitives/label/Label.tsx +0 -67
- package/src/primitives/label/__workshop__/OpticalAlignment.tsx +0 -27
- package/src/primitives/label/__workshop__/Plain.tsx +0 -27
- package/src/primitives/label/__workshop__/index.ts +0 -21
- package/src/primitives/layer/Layer.test.tsx +0 -110
- package/src/primitives/layer/Layer.tsx +0 -35
- package/src/primitives/layer/LayerCard.tsx +0 -90
- package/src/primitives/layer/LayerContext.ts +0 -7
- package/src/primitives/layer/LayerProvider.tsx +0 -106
- package/src/primitives/layer/__workshop__/MultipleRoots.tsx +0 -49
- package/src/primitives/layer/__workshop__/Nested.tsx +0 -107
- package/src/primitives/layer/__workshop__/ResponsiveZOffset.tsx +0 -17
- package/src/primitives/layer/__workshop__/_debug.tsx +0 -17
- package/src/primitives/layer/__workshop__/index.ts +0 -26
- package/src/primitives/layer/getLayerContext.test.ts +0 -32
- package/src/primitives/layer/getLayerContext.ts +0 -21
- package/src/primitives/layer/types.ts +0 -9
- package/src/primitives/layer/useLayer.ts +0 -24
- package/src/primitives/popover/Popover.tsx +0 -291
- package/src/primitives/popover/PopoverLayer.tsx +0 -101
- package/src/primitives/popover/__workshop__/AlignedStory.tsx +0 -75
- package/src/primitives/popover/__workshop__/MarginsStory.tsx +0 -31
- package/src/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -32
- package/src/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -11
- package/src/primitives/popover/__workshop__/PlainStory.tsx +0 -67
- package/src/primitives/popover/__workshop__/RecursiveStory.tsx +0 -71
- package/src/primitives/popover/__workshop__/SidePanelStory.tsx +0 -95
- package/src/primitives/popover/__workshop__/TestStory.tsx +0 -97
- package/src/primitives/popover/__workshop__/index.ts +0 -56
- package/src/primitives/popover/__workshop__/portal-inheritance.tsx +0 -15
- package/src/primitives/popover/constants.ts +0 -20
- package/src/primitives/popover/floating-ui/size.ts +0 -75
- package/src/primitives/popover/types.ts +0 -12
- package/src/primitives/popover/useMiddleware.ts +0 -126
- package/src/primitives/radio/Radio.tsx +0 -64
- package/src/primitives/radio/__workshop__/Example.tsx +0 -63
- package/src/primitives/radio/__workshop__/Plain.tsx +0 -28
- package/src/primitives/radio/__workshop__/index.ts +0 -13
- package/src/primitives/select/Select.tsx +0 -76
- package/src/primitives/select/__workshop__/Plain.tsx +0 -37
- package/src/primitives/select/__workshop__/ReadOnly.tsx +0 -23
- package/src/primitives/select/__workshop__/index.ts +0 -13
- package/src/primitives/selectable/Selectable.tsx +0 -48
- package/src/primitives/selectable/__workshop__/DataProps.tsx +0 -24
- package/src/primitives/selectable/__workshop__/as-link.tsx +0 -13
- package/src/primitives/selectable/__workshop__/index.ts +0 -19
- package/src/primitives/skeleton/CodeSkeleton.tsx +0 -49
- package/src/primitives/skeleton/HeadingSkeleton.tsx +0 -48
- package/src/primitives/skeleton/LabelSkeleton.tsx +0 -47
- package/src/primitives/skeleton/Skeleton.tsx +0 -70
- package/src/primitives/skeleton/TextSkeleton.tsx +0 -49
- package/src/primitives/skeleton/__workshop__/Delay.tsx +0 -69
- package/src/primitives/skeleton/__workshop__/Skeleton.tsx +0 -63
- package/src/primitives/skeleton/__workshop__/index.ts +0 -13
- package/src/primitives/spinner/Spinner.tsx +0 -45
- package/src/primitives/spinner/SpinnerAnimatedIcon.tsx +0 -14
- package/src/primitives/spinner/__workshop__/Props.tsx +0 -13
- package/src/primitives/spinner/__workshop__/index.ts +0 -16
- package/src/primitives/srOnly/SrOnly.tsx +0 -33
- package/src/primitives/stack/Stack.tsx +0 -38
- package/src/primitives/stack/__workshop__/Plain.tsx +0 -30
- package/src/primitives/stack/__workshop__/index.ts +0 -16
- package/src/primitives/switch/Switch.tsx +0 -76
- package/src/primitives/switch/__workshop__/Example.tsx +0 -25
- package/src/primitives/switch/__workshop__/Props.tsx +0 -23
- package/src/primitives/switch/__workshop__/index.ts +0 -13
- package/src/primitives/text/InlineCode.tsx +0 -25
- package/src/primitives/text/Text.tsx +0 -68
- package/src/primitives/text/__workshop__/Example.tsx +0 -26
- package/src/primitives/text/__workshop__/OpticalAlignment.tsx +0 -27
- package/src/primitives/text/__workshop__/index.ts +0 -26
- package/src/primitives/text/__workshop__/inline-code.tsx +0 -13
- package/src/primitives/textArea/TextArea.tsx +0 -97
- package/src/primitives/textArea/__workshop__/Plain.tsx +0 -46
- package/src/primitives/textArea/__workshop__/index.ts +0 -16
- package/src/primitives/textInput/TextInput.tsx +0 -279
- package/src/primitives/textInput/__workshop__/ClearButton.tsx +0 -32
- package/src/primitives/textInput/__workshop__/CustomValidity.tsx +0 -17
- package/src/primitives/textInput/__workshop__/Plain.tsx +0 -102
- package/src/primitives/textInput/__workshop__/ReadOnly.tsx +0 -14
- package/src/primitives/textInput/__workshop__/States.tsx +0 -53
- package/src/primitives/textInput/__workshop__/Tones.tsx +0 -40
- package/src/primitives/textInput/__workshop__/Typed.tsx +0 -23
- package/src/primitives/textInput/__workshop__/index.ts +0 -46
- package/src/primitives/tooltip/Tooltip.test.tsx +0 -496
- package/src/primitives/tooltip/Tooltip.tsx +0 -546
- package/src/primitives/tooltip/TooltipLayer.tsx +0 -72
- package/src/primitives/tooltip/__workshop__/CustomPortal.tsx +0 -102
- package/src/primitives/tooltip/__workshop__/OverflowingBoundary.tsx +0 -74
- package/src/primitives/tooltip/__workshop__/Props.tsx +0 -107
- package/src/primitives/tooltip/__workshop__/ResizableBoundary.tsx +0 -91
- package/src/primitives/tooltip/__workshop__/index.ts +0 -31
- package/src/primitives/tooltip/constants.ts +0 -24
- package/src/primitives/tooltip/tooltipDelayGroup/TooltipDelayGroupContext.tsx +0 -13
- package/src/primitives/tooltip/tooltipDelayGroup/TooltipDelayGroupProvider.tsx +0 -96
- package/src/primitives/tooltip/tooltipDelayGroup/types.ts +0 -7
- package/src/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +0 -13
- package/src/root/Root.tsx +0 -93
- package/src/root/RootProvider.tsx +0 -37
- package/src/root/__workshop__/Boundary.tsx +0 -43
- package/src/root/__workshop__/index.ts +0 -24
- package/src/root/__workshop__/primitives.tsx +0 -49
- package/src/root/__workshop__/tone-inheritance.tsx +0 -65
- package/src/utils/ErrorBoundary.tsx +0 -50
- package/src/utils/boundaryElement/BoundaryElementContext.ts +0 -7
- package/src/utils/boundaryElement/BoundaryElementProvider.tsx +0 -16
- package/src/utils/boundaryElement/__workshop__/Plain.tsx +0 -49
- package/src/utils/boundaryElement/__workshop__/index.ts +0 -16
- package/src/utils/boundaryElement/types.ts +0 -2
- package/src/utils/boundaryElement/useBoundaryElement.ts +0 -12
- package/src/utils/elementQuery/ElementQuery.tsx +0 -75
- package/src/utils/elementQuery/__workshop__/CustomMedia.tsx +0 -19
- package/src/utils/elementQuery/__workshop__/index.ts +0 -16
- package/src/utils/elementQuery/__workshop__/styles.css.ts +0 -31
- package/src/utils/elementQuery/helpers.ts +0 -27
- package/src/utils/portal/Portal.test.tsx +0 -105
- package/src/utils/portal/Portal.tsx +0 -42
- package/src/utils/portal/PortalContext.ts +0 -37
- package/src/utils/portal/PortalProvider.tsx +0 -38
- package/src/utils/portal/__workshop__/Named.tsx +0 -69
- package/src/utils/portal/__workshop__/index.ts +0 -16
- package/src/utils/portal/types.ts +0 -7
- package/src/utils/portal/usePortal.ts +0 -30
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,2332 @@
|
|
|
1
|
+
import { A as ThemeColorMutedTone, At as ThemeColorSchemeKey$1, B as ThemeColorBase, C as ThemeColorSpotKey, Ct as ThemeColorSyntax$1, D as ThemeColorSelectableState, Dt as ThemeColorCardToneKey, E as ThemeColorSelectable, Et as ThemeColorButtonModeKey$1, F as ThemeColorCardState, H as ThemeColorToneKey, Ht as HSL$1, I as ThemeColorButton, L as ThemeColorButtonState, M as ThemeColorInputState, Mt as ThemeColorStateToneKey, N as ThemeColorInputStates, O as ThemeColorSelectableStates, P as ThemeColorCard, R as ThemeColorButtonStates, S as ThemeColorSpot, St as ThemeFonts$1, T as ThemeColorSolidTone, U as ThemeColorGenericState, Ut as RGB$1, V as ThemeColorName, W as ThemeAvatar, _ as Theme_v2, _t as ThemeFont$1, a as rgbToHex$1, b as ThemeColorScheme, bt as ThemeFontWeight$1, c as screen$1, d as ThemeColorBuilderOpts, f as createColorTheme$1, ft as ThemeStyles, g as Theme$1, gt as ThemeLayer$1, ht as ThemeShadow$1, i as hslToRgb$1, j as ThemeColorInput, k as ThemeColorMuted, l as multiply$1, m as RootTheme$1, mt as ThemeBoxShadow, n as parseColor$1, o as rgbToHsl$1, p as BaseTheme$1, pt as CSSObject, r as hexToRgb$1, t as rgba$1, u as PartialThemeColorBuilderOpts, v as ThemeInput, vt as ThemeFontKey$1, w as ThemeColorSolid, wt as ThemeColorAvatarColorKey, x as ThemeColorSchemes, xt as ThemeFontWeightKey$1, y as ThemeColor, yt as ThemeFontSize$1, z as ThemeColorButtonTones } from "./_chunks/rgba.cjs";
|
|
2
|
+
import { Component, ElementType as ElementType$1, HTMLProps, PropsWithChildren, ReactNode, Ref } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
* @deprecated Use `BaseTheme` from `@sanity/ui/theme` instead.
|
|
6
|
+
*/
|
|
7
|
+
type BaseTheme = BaseTheme$1;
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
* @deprecated Use `ThemeBoxShadow` from `@sanity/ui/theme` instead.
|
|
11
|
+
*/
|
|
12
|
+
type BoxShadow = ThemeBoxShadow;
|
|
13
|
+
/**
|
|
14
|
+
* @public
|
|
15
|
+
* @deprecated Use `HSL` from `@sanity/ui/theme` instead.
|
|
16
|
+
*/
|
|
17
|
+
type HSL = HSL$1;
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
* @deprecated Use `RGB` from `@sanity/ui/theme` instead.
|
|
21
|
+
*/
|
|
22
|
+
type RGB = RGB$1;
|
|
23
|
+
/**
|
|
24
|
+
* @public
|
|
25
|
+
* @deprecated Use `RootTheme` from `@sanity/ui/theme` instead.
|
|
26
|
+
*/
|
|
27
|
+
type RootTheme = RootTheme$1;
|
|
28
|
+
/**
|
|
29
|
+
* @public
|
|
30
|
+
* @deprecated Use `ThemeStyles` from `@sanity/ui/theme` instead.
|
|
31
|
+
*/
|
|
32
|
+
type Styles = ThemeStyles;
|
|
33
|
+
/**
|
|
34
|
+
* @public
|
|
35
|
+
* @deprecated Use `Theme` from `@sanity/ui/theme` instead.
|
|
36
|
+
*/
|
|
37
|
+
type Theme = Theme$1;
|
|
38
|
+
/**
|
|
39
|
+
* @public
|
|
40
|
+
* @deprecated Use `ThemeColorButtonModeKey` from `@sanity/ui/theme` instead.
|
|
41
|
+
*/
|
|
42
|
+
type ThemeColorButtonModeKey = ThemeColorButtonModeKey$1;
|
|
43
|
+
/**
|
|
44
|
+
* @public
|
|
45
|
+
* @deprecated Use `ThemeColorSchemeKey` from `@sanity/ui/theme` instead.
|
|
46
|
+
*/
|
|
47
|
+
type ThemeColorSchemeKey = ThemeColorSchemeKey$1;
|
|
48
|
+
/**
|
|
49
|
+
* @public
|
|
50
|
+
* @deprecated Use `ThemeColorSyntax` from `@sanity/ui/theme` instead.
|
|
51
|
+
*/
|
|
52
|
+
type ThemeColorSyntax = ThemeColorSyntax$1;
|
|
53
|
+
/**
|
|
54
|
+
* @public
|
|
55
|
+
* @deprecated Use `ThemeFont` from `@sanity/ui/theme` instead.
|
|
56
|
+
*/
|
|
57
|
+
type ThemeFont = ThemeFont$1;
|
|
58
|
+
/**
|
|
59
|
+
* @public
|
|
60
|
+
* @deprecated Use `ThemeFontKey` from `@sanity/ui/theme` instead.
|
|
61
|
+
*/
|
|
62
|
+
type ThemeFontKey = ThemeFontKey$1;
|
|
63
|
+
/**
|
|
64
|
+
* @public
|
|
65
|
+
* @deprecated Use `ThemeFontSize` from `@sanity/ui/theme` instead.
|
|
66
|
+
*/
|
|
67
|
+
type ThemeFontSize = ThemeFontSize$1;
|
|
68
|
+
/**
|
|
69
|
+
* @public
|
|
70
|
+
* @deprecated Use `ThemeFontWeight` from `@sanity/ui/theme` instead.
|
|
71
|
+
*/
|
|
72
|
+
type ThemeFontWeight = ThemeFontWeight$1;
|
|
73
|
+
/**
|
|
74
|
+
* @public
|
|
75
|
+
* @deprecated Use `ThemeFontWeightKey` from `@sanity/ui/theme` instead.
|
|
76
|
+
*/
|
|
77
|
+
type ThemeFontWeightKey = ThemeFontWeightKey$1;
|
|
78
|
+
/**
|
|
79
|
+
* @public
|
|
80
|
+
* @deprecated Use `ThemeFonts` from `@sanity/ui/theme` instead.
|
|
81
|
+
*/
|
|
82
|
+
type ThemeFonts = ThemeFonts$1;
|
|
83
|
+
/**
|
|
84
|
+
* @public
|
|
85
|
+
* @deprecated Use `ThemeLayer` from `@sanity/ui/theme` instead.
|
|
86
|
+
*/
|
|
87
|
+
type ThemeLayer = ThemeLayer$1;
|
|
88
|
+
/**
|
|
89
|
+
* @public
|
|
90
|
+
* @deprecated Use `ThemeShadow` from `@sanity/ui/theme` instead.
|
|
91
|
+
*/
|
|
92
|
+
type ThemeShadow = ThemeShadow$1;
|
|
93
|
+
/**
|
|
94
|
+
* @public
|
|
95
|
+
* @deprecated Use `createColorTheme` from `@sanity/ui/theme` instead.
|
|
96
|
+
*/
|
|
97
|
+
declare const createColorTheme: typeof createColorTheme$1;
|
|
98
|
+
/**
|
|
99
|
+
* @public
|
|
100
|
+
* @deprecated Use `hexToRgb` from `@sanity/ui/theme` instead.
|
|
101
|
+
*/
|
|
102
|
+
declare const hexToRgb: typeof hexToRgb$1;
|
|
103
|
+
/**
|
|
104
|
+
* @public
|
|
105
|
+
* @deprecated Use `hslToRgb` from `@sanity/ui/theme` instead.
|
|
106
|
+
*/
|
|
107
|
+
declare const hslToRgb: typeof hslToRgb$1;
|
|
108
|
+
/**
|
|
109
|
+
* @public
|
|
110
|
+
* @deprecated Use `multiply` from `@sanity/ui/theme` instead.
|
|
111
|
+
*/
|
|
112
|
+
declare const multiply: typeof multiply$1;
|
|
113
|
+
/**
|
|
114
|
+
* @public
|
|
115
|
+
* @deprecated Use `parseColor` from `@sanity/ui/theme` instead.
|
|
116
|
+
*/
|
|
117
|
+
declare const parseColor: typeof parseColor$1;
|
|
118
|
+
/**
|
|
119
|
+
* @public
|
|
120
|
+
* @deprecated Use `rgbToHex` from `@sanity/ui/theme` instead.
|
|
121
|
+
*/
|
|
122
|
+
declare const rgbToHex: typeof rgbToHex$1;
|
|
123
|
+
/**
|
|
124
|
+
* @public
|
|
125
|
+
* @deprecated Use `rgbToHsl` from `@sanity/ui/theme` instead.
|
|
126
|
+
*/
|
|
127
|
+
declare const rgbToHsl: typeof rgbToHsl$1;
|
|
128
|
+
/**
|
|
129
|
+
* @public
|
|
130
|
+
* @deprecated Use `rgba` from `@sanity/ui/theme` instead.
|
|
131
|
+
*/
|
|
132
|
+
declare const rgba: typeof rgba$1;
|
|
133
|
+
/**
|
|
134
|
+
* @public
|
|
135
|
+
* @deprecated Use `screen` from `@sanity/ui/theme` instead.
|
|
136
|
+
*/
|
|
137
|
+
declare const screen: typeof screen$1;
|
|
138
|
+
/**
|
|
139
|
+
* @public
|
|
140
|
+
* @deprecated Use `buildTheme` from `@sanity/ui/theme` instead.
|
|
141
|
+
*/
|
|
142
|
+
declare const studioTheme: BaseTheme$1;
|
|
143
|
+
/**
|
|
144
|
+
* Assign properties from `U` to `T`, excluding properties that already exist in `T`.
|
|
145
|
+
*
|
|
146
|
+
* @public
|
|
147
|
+
*/
|
|
148
|
+
type Assign<T extends object, U extends object> = Omit<T, keyof U> & U;
|
|
149
|
+
/** @public */
|
|
150
|
+
type EmptyProps = object;
|
|
151
|
+
/** @public */
|
|
152
|
+
type TagType = keyof React.JSX.IntrinsicElements;
|
|
153
|
+
/** @public */
|
|
154
|
+
type ComponentType<P = any> = React.FunctionComponent<P> | React.ComponentClass<P> | React.ExoticComponent<P>;
|
|
155
|
+
/** @public */
|
|
156
|
+
type ElementType<P = any> = TagType | ComponentType<P>;
|
|
157
|
+
/**
|
|
158
|
+
* Resolves the props of a polymorphic component: the props of the element/component passed to `as`
|
|
159
|
+
* (defaulting to the component's own element), with the component's own props assigned on top.
|
|
160
|
+
*
|
|
161
|
+
* @public
|
|
162
|
+
*/
|
|
163
|
+
type Props<P extends EmptyProps, E extends ElementType<P>> = Assign<E extends TagType ? React.JSX.IntrinsicElements[E] : React.ComponentProps<E>, P & {
|
|
164
|
+
as?: E;
|
|
165
|
+
}>;
|
|
166
|
+
/**
|
|
167
|
+
* @public
|
|
168
|
+
*/
|
|
169
|
+
type BoxSizing = 'content' | 'border';
|
|
170
|
+
/**
|
|
171
|
+
* @public
|
|
172
|
+
*/
|
|
173
|
+
type BoxDisplay = 'none' | 'block' | 'grid' | 'flex' | 'inline-block';
|
|
174
|
+
/**
|
|
175
|
+
* @public
|
|
176
|
+
*/
|
|
177
|
+
type BoxHeight = 'stretch' | 'fill';
|
|
178
|
+
/**
|
|
179
|
+
* @public
|
|
180
|
+
*/
|
|
181
|
+
type BoxOverflow = 'visible' | 'hidden' | 'auto';
|
|
182
|
+
/**
|
|
183
|
+
* @public
|
|
184
|
+
*/
|
|
185
|
+
type FlexAlign = 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
|
|
186
|
+
/**
|
|
187
|
+
* @public
|
|
188
|
+
*/
|
|
189
|
+
type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
190
|
+
/**
|
|
191
|
+
* @public
|
|
192
|
+
*/
|
|
193
|
+
type FlexJustify = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
194
|
+
/**
|
|
195
|
+
* @public
|
|
196
|
+
*/
|
|
197
|
+
type FlexValue = number | 'none' | 'auto' | 'initial';
|
|
198
|
+
/**
|
|
199
|
+
* @public
|
|
200
|
+
*/
|
|
201
|
+
type FlexWrap = 'wrap' | 'wrap-reverse' | 'nowrap';
|
|
202
|
+
/**
|
|
203
|
+
* @public
|
|
204
|
+
*/
|
|
205
|
+
type GridAutoRows = 'auto' | 'min' | 'max' | 'fr';
|
|
206
|
+
/**
|
|
207
|
+
* @public
|
|
208
|
+
*/
|
|
209
|
+
type GridAutoCols = 'auto' | 'min' | 'max' | 'fr';
|
|
210
|
+
/**
|
|
211
|
+
* @public
|
|
212
|
+
*/
|
|
213
|
+
type GridAutoFlow = 'row' | 'column' | 'row dense' | 'column dense';
|
|
214
|
+
/**
|
|
215
|
+
* @public
|
|
216
|
+
*/
|
|
217
|
+
type GridItemColumn = 'auto' | 'full' | number;
|
|
218
|
+
/**
|
|
219
|
+
* @public
|
|
220
|
+
*/
|
|
221
|
+
type GridItemColumnStart = 'auto' | number;
|
|
222
|
+
/**
|
|
223
|
+
* @public
|
|
224
|
+
*/
|
|
225
|
+
type GridItemColumnEnd = 'auto' | number;
|
|
226
|
+
/**
|
|
227
|
+
* @public
|
|
228
|
+
*/
|
|
229
|
+
type GridItemRow = 'auto' | 'full' | number;
|
|
230
|
+
/**
|
|
231
|
+
* @public
|
|
232
|
+
*/
|
|
233
|
+
type GridItemRowStart = 'auto' | number;
|
|
234
|
+
/**
|
|
235
|
+
* @public
|
|
236
|
+
*/
|
|
237
|
+
type GridItemRowEnd = 'auto' | number;
|
|
238
|
+
/**
|
|
239
|
+
* @public
|
|
240
|
+
*/
|
|
241
|
+
type Radius = number | 'full';
|
|
242
|
+
/**
|
|
243
|
+
* @public
|
|
244
|
+
*/
|
|
245
|
+
interface ResponsiveBorderProps {
|
|
246
|
+
border?: boolean | boolean[];
|
|
247
|
+
borderTop?: boolean | boolean[];
|
|
248
|
+
borderRight?: boolean | boolean[];
|
|
249
|
+
borderBottom?: boolean | boolean[];
|
|
250
|
+
borderLeft?: boolean | boolean[];
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* @public
|
|
254
|
+
*/
|
|
255
|
+
interface ResponsiveBoxProps {
|
|
256
|
+
display?: BoxDisplay | BoxDisplay[];
|
|
257
|
+
height?: BoxHeight | BoxHeight[];
|
|
258
|
+
overflow?: BoxOverflow | BoxOverflow[];
|
|
259
|
+
sizing?: BoxSizing | BoxSizing[];
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* @public
|
|
263
|
+
*/
|
|
264
|
+
interface ResponsiveFlexProps {
|
|
265
|
+
align?: FlexAlign | FlexAlign[];
|
|
266
|
+
direction?: FlexDirection | FlexDirection[];
|
|
267
|
+
justify?: FlexJustify | FlexJustify[];
|
|
268
|
+
wrap?: FlexWrap | FlexWrap[];
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* @public
|
|
272
|
+
*/
|
|
273
|
+
interface ResponsiveFlexItemProps {
|
|
274
|
+
/** Sets the flex CSS attribute. The property is responsive. */
|
|
275
|
+
flex?: FlexValue | FlexValue[];
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* @public
|
|
279
|
+
*/
|
|
280
|
+
interface ResponsiveGridProps {
|
|
281
|
+
autoRows?: GridAutoRows | GridAutoRows[];
|
|
282
|
+
autoCols?: GridAutoCols | GridAutoCols[];
|
|
283
|
+
autoFlow?: GridAutoFlow | GridAutoFlow[];
|
|
284
|
+
/**
|
|
285
|
+
* @deprecated Use `gridTemplateColumns` instead.
|
|
286
|
+
*/
|
|
287
|
+
columns?: never;
|
|
288
|
+
gridTemplateColumns?: number | number[];
|
|
289
|
+
gap?: number | number[];
|
|
290
|
+
gapX?: number | number[];
|
|
291
|
+
gapY?: number | number[];
|
|
292
|
+
/**
|
|
293
|
+
* @deprecated Use `gridTemplateRows` instead.
|
|
294
|
+
*/
|
|
295
|
+
rows?: never;
|
|
296
|
+
gridTemplateRows?: number | number[];
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* @public
|
|
300
|
+
*/
|
|
301
|
+
interface ResponsiveGridItemProps {
|
|
302
|
+
gridColumn?: GridItemColumn | GridItemColumn[];
|
|
303
|
+
/**
|
|
304
|
+
* @deprecated Use `gridColumn` instead.
|
|
305
|
+
*/
|
|
306
|
+
column?: never;
|
|
307
|
+
gridColumnStart?: GridItemColumnStart | GridItemColumnStart[];
|
|
308
|
+
/**
|
|
309
|
+
* @deprecated Use `gridColumnStart` instead.
|
|
310
|
+
*/
|
|
311
|
+
columnStart?: never;
|
|
312
|
+
gridColumnEnd?: GridItemColumnEnd | GridItemColumnEnd[];
|
|
313
|
+
/**
|
|
314
|
+
* @deprecated Use `gridColumnEnd` instead.
|
|
315
|
+
*/
|
|
316
|
+
columnEnd?: never;
|
|
317
|
+
gridRow?: GridItemRow | GridItemRow[];
|
|
318
|
+
/**
|
|
319
|
+
* @deprecated Use `gridRow` instead.
|
|
320
|
+
*/
|
|
321
|
+
row?: never;
|
|
322
|
+
gridRowStart?: GridItemRowStart | GridItemRowStart[];
|
|
323
|
+
/**
|
|
324
|
+
* @deprecated Use `gridRowStart` instead.
|
|
325
|
+
*/
|
|
326
|
+
rowStart?: never;
|
|
327
|
+
gridRowEnd?: GridItemRowEnd | GridItemRowEnd[];
|
|
328
|
+
/**
|
|
329
|
+
* @deprecated Use `gridRowEnd` instead.
|
|
330
|
+
*/
|
|
331
|
+
rowEnd?: never;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* @public
|
|
335
|
+
*/
|
|
336
|
+
interface ResponsiveMarginProps {
|
|
337
|
+
/** Applies margins to all sides. The property is responsive. */
|
|
338
|
+
margin?: number | number[];
|
|
339
|
+
/** Applies margins to the left and right sides. The property is responsive. */
|
|
340
|
+
marginX?: number | number[];
|
|
341
|
+
/** Applies margins to the top and bottom sides. The property is responsive. */
|
|
342
|
+
marginY?: number | number[];
|
|
343
|
+
marginTop?: number | number[];
|
|
344
|
+
marginRight?: number | number[];
|
|
345
|
+
marginBottom?: number | number[];
|
|
346
|
+
marginLeft?: number | number[];
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* @public
|
|
350
|
+
*/
|
|
351
|
+
interface ResponsivePaddingProps {
|
|
352
|
+
padding?: number | number[];
|
|
353
|
+
paddingX?: number | number[];
|
|
354
|
+
paddingY?: number | number[];
|
|
355
|
+
paddingTop?: number | number[];
|
|
356
|
+
paddingRight?: number | number[];
|
|
357
|
+
paddingBottom?: number | number[];
|
|
358
|
+
paddingLeft?: number | number[];
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* @public
|
|
362
|
+
*/
|
|
363
|
+
interface ResponsiveRadiusProps {
|
|
364
|
+
radius?: Radius | Radius[];
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* @public
|
|
368
|
+
*/
|
|
369
|
+
interface ResponsiveShadowProps {
|
|
370
|
+
shadow?: number | number[];
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* @public
|
|
374
|
+
*/
|
|
375
|
+
interface ResponsiveWidthProps {
|
|
376
|
+
width?: number | 'auto' | (number | 'auto')[];
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* @public
|
|
380
|
+
*/
|
|
381
|
+
type Delay = number | Partial<{
|
|
382
|
+
open: number;
|
|
383
|
+
close: number;
|
|
384
|
+
}>;
|
|
385
|
+
/**
|
|
386
|
+
* The props that `Box` adds on top of the element it renders as.
|
|
387
|
+
*
|
|
388
|
+
* @public
|
|
389
|
+
*/
|
|
390
|
+
interface BoxOwnProps extends ResponsiveFlexItemProps, ResponsiveBoxProps, ResponsiveGridItemProps, ResponsiveMarginProps, ResponsivePaddingProps {
|
|
391
|
+
forwardedAs?: ElementType;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* @public
|
|
395
|
+
*/
|
|
396
|
+
type BoxProps<E extends ElementType = 'div'> = Props<BoxOwnProps, E>;
|
|
397
|
+
/**
|
|
398
|
+
* The `Box` component is a basic layout wrapper component which provides utility properties
|
|
399
|
+
* for flex, margins and padding.
|
|
400
|
+
*
|
|
401
|
+
* @public
|
|
402
|
+
*/
|
|
403
|
+
declare const Box: <E extends ElementType = 'div'>(props: BoxProps<E>) => React.JSX.Element;
|
|
404
|
+
/**
|
|
405
|
+
* @public
|
|
406
|
+
*/
|
|
407
|
+
type CardTone = ThemeColorCardToneKey | 'inherit';
|
|
408
|
+
/**
|
|
409
|
+
* Placement of floating UI elements.
|
|
410
|
+
*
|
|
411
|
+
* @public
|
|
412
|
+
*/
|
|
413
|
+
type Placement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
|
|
414
|
+
/**
|
|
415
|
+
* @beta
|
|
416
|
+
*/
|
|
417
|
+
type PopoverMargins = [number, number, number, number];
|
|
418
|
+
/**
|
|
419
|
+
* @public
|
|
420
|
+
*/
|
|
421
|
+
interface LayerProps {
|
|
422
|
+
as?: React.ElementType | keyof React.JSX.IntrinsicElements;
|
|
423
|
+
/** A callback that fires when the layer becomes the top layer when it was not the top layer before. */
|
|
424
|
+
onActivate?: (props: {
|
|
425
|
+
activeElement: HTMLElement | null;
|
|
426
|
+
}) => void;
|
|
427
|
+
zOffset?: number | number[];
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* @public
|
|
431
|
+
*/
|
|
432
|
+
declare const Layer: import("react").ForwardRefExoticComponent<Omit<LayerProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
433
|
+
/** @beta */
|
|
434
|
+
type PopoverUpdateCallback = () => void;
|
|
435
|
+
/** @public */
|
|
436
|
+
type PopoverWidth = number | 'auto';
|
|
437
|
+
/** @public */
|
|
438
|
+
interface PopoverProps extends Omit<LayerProps, 'as'>, ResponsiveRadiusProps, ResponsiveShadowProps {
|
|
439
|
+
/** @beta */
|
|
440
|
+
__unstable_margins?: PopoverMargins;
|
|
441
|
+
/**
|
|
442
|
+
* Whether the popover should animate in and out.
|
|
443
|
+
*
|
|
444
|
+
* @beta
|
|
445
|
+
* @defaultValue false
|
|
446
|
+
*/
|
|
447
|
+
animate?: boolean;
|
|
448
|
+
arrow?: boolean;
|
|
449
|
+
/** @deprecated Use `floatingBoundary` and/or `referenceBoundary` instead */
|
|
450
|
+
boundaryElement?: never;
|
|
451
|
+
children?: React.JSX.Element;
|
|
452
|
+
/**
|
|
453
|
+
* When `true`, prevent overflow within the current boundary:
|
|
454
|
+
* - by flipping on its side axis
|
|
455
|
+
* - by resizing
|
|
456
|
+
/*
|
|
457
|
+
* Note that:
|
|
458
|
+
* - setting `preventOverflow` to `true` also prevents overflow on its side axis
|
|
459
|
+
* - setting `matchReferenceWidth` to `true` also causes the popover to resize
|
|
460
|
+
*
|
|
461
|
+
* @defaultValue false
|
|
462
|
+
*/
|
|
463
|
+
constrainSize?: boolean;
|
|
464
|
+
content?: React.ReactNode;
|
|
465
|
+
disabled?: boolean;
|
|
466
|
+
fallbackPlacements?: Placement[];
|
|
467
|
+
floatingBoundary?: HTMLElement | null;
|
|
468
|
+
/**
|
|
469
|
+
* When `true`, set the maximum width to match the reference element, and also prevent overflow within
|
|
470
|
+
* the current boundary by resizing.
|
|
471
|
+
*
|
|
472
|
+
* Note that setting `constrainSize` to `true` also causes the popover to resize
|
|
473
|
+
*
|
|
474
|
+
* @defaultValue false
|
|
475
|
+
*/
|
|
476
|
+
matchReferenceWidth?: boolean;
|
|
477
|
+
/**
|
|
478
|
+
* When true, blocks all pointer interaction with elements beneath the popover until closed.
|
|
479
|
+
*
|
|
480
|
+
* @beta
|
|
481
|
+
* @defaultValue false
|
|
482
|
+
*/
|
|
483
|
+
modal?: boolean;
|
|
484
|
+
open?: boolean;
|
|
485
|
+
overflow?: BoxOverflow;
|
|
486
|
+
padding?: number | number[];
|
|
487
|
+
placement?: Placement;
|
|
488
|
+
/**
|
|
489
|
+
* When 'flip' (default), the placement is determined from the initial placement and the
|
|
490
|
+
* fallback placements in order. Whichever fits in the viewport first.
|
|
491
|
+
*
|
|
492
|
+
* When 'autoPlacement', the initial placement and all fallback placements are evaluated
|
|
493
|
+
* and the placement with the most viewport space available.
|
|
494
|
+
*
|
|
495
|
+
* Option is only relevant if either `constrainSize` or `preventOverflow` is `true`
|
|
496
|
+
*/
|
|
497
|
+
placementStrategy?: 'flip' | 'autoPlacement';
|
|
498
|
+
/** Whether or not to render the popover in a portal element. */
|
|
499
|
+
portal?: boolean | string;
|
|
500
|
+
preventOverflow?: boolean;
|
|
501
|
+
referenceBoundary?: HTMLElement | null;
|
|
502
|
+
/**
|
|
503
|
+
* When defined, the popover will be positioned relative to this element.
|
|
504
|
+
* The children of the popover won't be rendered.
|
|
505
|
+
*/
|
|
506
|
+
referenceElement?: HTMLElement | null;
|
|
507
|
+
scheme?: ThemeColorSchemeKey$1;
|
|
508
|
+
tone?: CardTone;
|
|
509
|
+
/** @beta */
|
|
510
|
+
updateRef?: Ref<PopoverUpdateCallback | undefined>;
|
|
511
|
+
width?: PopoverWidth | PopoverWidth[];
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* The `Popover` component is used to display some content on top of another.
|
|
515
|
+
*
|
|
516
|
+
* @public
|
|
517
|
+
*/
|
|
518
|
+
declare const Popover: import("react").ForwardRefExoticComponent<Omit<PopoverProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "content" | "width">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
519
|
+
/**
|
|
520
|
+
* @public
|
|
521
|
+
*/
|
|
522
|
+
type ButtonMode = ThemeColorButtonModeKey$1;
|
|
523
|
+
/**
|
|
524
|
+
* @public
|
|
525
|
+
*/
|
|
526
|
+
type ButtonTextAlign = 'left' | 'right' | 'center';
|
|
527
|
+
/**
|
|
528
|
+
* @public
|
|
529
|
+
*/
|
|
530
|
+
type ButtonTone = ThemeColorStateToneKey;
|
|
531
|
+
/**
|
|
532
|
+
* @public
|
|
533
|
+
*/
|
|
534
|
+
type ButtonWidth = 'fill';
|
|
535
|
+
/**
|
|
536
|
+
* @public
|
|
537
|
+
*/
|
|
538
|
+
interface ButtonOwnProps extends ResponsivePaddingProps, ResponsiveRadiusProps {
|
|
539
|
+
fontSize?: number | number[];
|
|
540
|
+
mode?: ButtonMode;
|
|
541
|
+
icon?: React.ElementType | React.ReactNode;
|
|
542
|
+
iconRight?: React.ElementType | React.ReactNode;
|
|
543
|
+
justify?: FlexJustify | FlexJustify[];
|
|
544
|
+
/**
|
|
545
|
+
* @beta Do not use in production, as this might change.
|
|
546
|
+
*/
|
|
547
|
+
loading?: boolean;
|
|
548
|
+
selected?: boolean;
|
|
549
|
+
/**
|
|
550
|
+
* @deprecated Use `gap` instead.
|
|
551
|
+
*/
|
|
552
|
+
space?: never;
|
|
553
|
+
gap?: number | number[];
|
|
554
|
+
muted?: boolean;
|
|
555
|
+
text?: React.ReactNode;
|
|
556
|
+
textAlign?: ButtonTextAlign;
|
|
557
|
+
textWeight?: ThemeFontWeightKey$1;
|
|
558
|
+
tone?: ButtonTone;
|
|
559
|
+
type?: 'button' | 'reset' | 'submit';
|
|
560
|
+
width?: ButtonWidth;
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* @public
|
|
564
|
+
*/
|
|
565
|
+
type ButtonProps<E extends ElementType = 'button'> = Props<ButtonOwnProps, E>;
|
|
566
|
+
/**
|
|
567
|
+
* @public
|
|
568
|
+
*/
|
|
569
|
+
declare const Button: <E extends ElementType = 'button'>(props: ButtonProps<E>) => React.JSX.Element;
|
|
570
|
+
/**
|
|
571
|
+
* @public
|
|
572
|
+
*/
|
|
573
|
+
type AutocompleteOpenButtonProps = ButtonOwnProps & Omit<React.HTMLProps<HTMLButtonElement>, 'as' | 'ref'>;
|
|
574
|
+
/**
|
|
575
|
+
* @public
|
|
576
|
+
*/
|
|
577
|
+
interface BaseAutocompleteOption {
|
|
578
|
+
value: string;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* @internal
|
|
582
|
+
*/
|
|
583
|
+
interface AutocompleteState {
|
|
584
|
+
activeValue: string | null;
|
|
585
|
+
focused: boolean;
|
|
586
|
+
listFocused: boolean;
|
|
587
|
+
query: string | null;
|
|
588
|
+
value: string | null;
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* @internal
|
|
592
|
+
*/
|
|
593
|
+
interface AutocompleteRootBlurMsg {
|
|
594
|
+
type: 'root/blur';
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* @internal
|
|
598
|
+
*/
|
|
599
|
+
interface AutocompleteRootClearMsg {
|
|
600
|
+
type: 'root/clear';
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* @internal
|
|
604
|
+
*/
|
|
605
|
+
interface AutocompleteRootEscapeMsg {
|
|
606
|
+
type: 'root/escape';
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* @internal
|
|
610
|
+
*/
|
|
611
|
+
interface AutocompleteRootOpenMsg {
|
|
612
|
+
type: 'root/open';
|
|
613
|
+
query: string | null;
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* @internal
|
|
617
|
+
*/
|
|
618
|
+
interface AutocompleteRootSetActiveValueMsg {
|
|
619
|
+
type: 'root/setActiveValue';
|
|
620
|
+
value: string;
|
|
621
|
+
listFocused?: boolean;
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* @internal
|
|
625
|
+
*/
|
|
626
|
+
interface AutocompleteRootSetListFocusedMsg {
|
|
627
|
+
type: 'root/setListFocused';
|
|
628
|
+
listFocused: boolean;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* @internal
|
|
632
|
+
*/
|
|
633
|
+
interface AutocompleteInputChangeMsg {
|
|
634
|
+
type: 'input/change';
|
|
635
|
+
query: string | null;
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* @internal
|
|
639
|
+
*/
|
|
640
|
+
interface AutocompleteInputFoocusMsg {
|
|
641
|
+
type: 'input/focus';
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* @internal
|
|
645
|
+
*/
|
|
646
|
+
interface AutocompleteValueChangeMsg {
|
|
647
|
+
type: 'value/change';
|
|
648
|
+
value: string | null;
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* @internal
|
|
652
|
+
*/
|
|
653
|
+
type AutocompleteMsg = AutocompleteRootBlurMsg | AutocompleteRootClearMsg | AutocompleteRootEscapeMsg | AutocompleteRootOpenMsg | AutocompleteRootSetActiveValueMsg | AutocompleteRootSetListFocusedMsg | AutocompleteInputChangeMsg | AutocompleteInputFoocusMsg | AutocompleteValueChangeMsg;
|
|
654
|
+
/**
|
|
655
|
+
* @public
|
|
656
|
+
*/
|
|
657
|
+
interface AutocompleteProps<Option extends BaseAutocompleteOption = BaseAutocompleteOption> {
|
|
658
|
+
border?: boolean;
|
|
659
|
+
customValidity?: string;
|
|
660
|
+
filterOption?: (query: string, option: Option) => boolean;
|
|
661
|
+
fontSize?: number | number[];
|
|
662
|
+
icon?: ElementType$1 | ReactNode;
|
|
663
|
+
id: string;
|
|
664
|
+
/** @beta */
|
|
665
|
+
listBox?: BoxProps;
|
|
666
|
+
loading?: boolean;
|
|
667
|
+
onChange?: (value: string) => void;
|
|
668
|
+
onQueryChange?: (query: string | null) => void;
|
|
669
|
+
onSelect?: (value: string) => void;
|
|
670
|
+
/** @beta */
|
|
671
|
+
openButton?: boolean | AutocompleteOpenButtonProps;
|
|
672
|
+
/** @beta */
|
|
673
|
+
openOnFocus?: boolean;
|
|
674
|
+
/** The options to render. */
|
|
675
|
+
options?: Option[];
|
|
676
|
+
padding?: number | number[];
|
|
677
|
+
popover?: Omit<PopoverProps, 'content' | 'onMouseEnter' | 'onMouseLeave' | 'open'> & Omit<HTMLProps<HTMLDivElement>, 'as' | 'children' | 'content' | 'ref' | 'width'>;
|
|
678
|
+
prefix?: ReactNode;
|
|
679
|
+
radius?: Radius | Radius[];
|
|
680
|
+
/** @beta */
|
|
681
|
+
relatedElements?: HTMLElement[];
|
|
682
|
+
/** The callback function for rendering each option. */
|
|
683
|
+
renderOption?: (option: Option) => React.JSX.Element;
|
|
684
|
+
/** @beta */
|
|
685
|
+
renderPopover?: (props: {
|
|
686
|
+
content: React.JSX.Element | null;
|
|
687
|
+
hidden: boolean;
|
|
688
|
+
inputElement: HTMLInputElement | null;
|
|
689
|
+
onMouseEnter: () => void;
|
|
690
|
+
onMouseLeave: () => void;
|
|
691
|
+
}, ref: Ref<HTMLDivElement>) => ReactNode;
|
|
692
|
+
renderValue?: (value: string, option?: Option) => string;
|
|
693
|
+
suffix?: ReactNode;
|
|
694
|
+
/** The current value. */
|
|
695
|
+
value?: string;
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
698
|
+
* The Autocomplete component is typically used for search components.
|
|
699
|
+
* It consists of a text input for writing a query, and properties for rendering suggestions.
|
|
700
|
+
*
|
|
701
|
+
* @public
|
|
702
|
+
*/
|
|
703
|
+
declare const Autocomplete: <Option extends BaseAutocompleteOption>(props: AutocompleteProps<Option> & Omit<HTMLProps<HTMLInputElement>, 'aria-activedescendant' | 'aria-autocomplete' | 'aria-expanded' | 'aria-owns' | 'as' | 'autoCapitalize' | 'autoComplete' | 'autoCorrect' | 'id' | 'inputMode' | 'onChange' | 'onSelect' | 'popover' | 'prefix' | 'ref' | 'role' | 'spellCheck' | 'type' | 'value'> & {
|
|
704
|
+
ref?: Ref<HTMLInputElement>;
|
|
705
|
+
}) => React.JSX.Element;
|
|
706
|
+
/**
|
|
707
|
+
* @beta
|
|
708
|
+
*/
|
|
709
|
+
interface BreadcrumbsProps {
|
|
710
|
+
maxLength?: number;
|
|
711
|
+
separator?: React.ReactNode;
|
|
712
|
+
gap?: number | number[];
|
|
713
|
+
/**
|
|
714
|
+
* @deprecated Use `gap` instead.
|
|
715
|
+
*/
|
|
716
|
+
space?: never;
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* @beta
|
|
720
|
+
*/
|
|
721
|
+
declare const Breadcrumbs: import("react").ForwardRefExoticComponent<BreadcrumbsProps & Omit<import("react").HTMLProps<HTMLOListElement>, "as" | "ref" | "type"> & import("react").RefAttributes<HTMLOListElement>>;
|
|
722
|
+
/**
|
|
723
|
+
* @public
|
|
724
|
+
*/
|
|
725
|
+
type DialogPosition = 'absolute' | 'fixed';
|
|
726
|
+
/**
|
|
727
|
+
* @public
|
|
728
|
+
*/
|
|
729
|
+
interface DialogProps extends ResponsivePaddingProps, ResponsiveWidthProps {
|
|
730
|
+
/**
|
|
731
|
+
* @beta
|
|
732
|
+
*/
|
|
733
|
+
__unstable_autoFocus?: boolean;
|
|
734
|
+
/**
|
|
735
|
+
* @beta
|
|
736
|
+
*/
|
|
737
|
+
__unstable_hideCloseButton?: boolean;
|
|
738
|
+
cardRadius?: Radius | Radius[];
|
|
739
|
+
cardShadow?: number | number[];
|
|
740
|
+
contentRef?: React.ForwardedRef<HTMLDivElement>;
|
|
741
|
+
footer?: React.ReactNode;
|
|
742
|
+
header?: React.ReactNode;
|
|
743
|
+
id: string;
|
|
744
|
+
/** A callback that fires when the dialog becomes the top layer when it was not the top layer before. */
|
|
745
|
+
onActivate?: LayerProps['onActivate'];
|
|
746
|
+
onClickOutside?: () => void;
|
|
747
|
+
onClose?: () => void;
|
|
748
|
+
portal?: string;
|
|
749
|
+
position?: DialogPosition | DialogPosition[];
|
|
750
|
+
scheme?: ThemeColorSchemeKey$1;
|
|
751
|
+
zOffset?: number | number[];
|
|
752
|
+
/**
|
|
753
|
+
* Whether the dialog should animate in on mount.
|
|
754
|
+
*
|
|
755
|
+
* @beta
|
|
756
|
+
* @defaultValue false
|
|
757
|
+
*/
|
|
758
|
+
animate?: boolean;
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* The Dialog component.
|
|
762
|
+
*
|
|
763
|
+
* @public
|
|
764
|
+
*/
|
|
765
|
+
declare const Dialog: import("react").ForwardRefExoticComponent<Omit<DialogProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "id" | "width">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
766
|
+
/**
|
|
767
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
768
|
+
* @beta
|
|
769
|
+
*/
|
|
770
|
+
interface DialogContextValue {
|
|
771
|
+
version: 0.0;
|
|
772
|
+
position?: DialogPosition | DialogPosition[];
|
|
773
|
+
zOffset?: number | number[];
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* @internal
|
|
777
|
+
*/
|
|
778
|
+
declare const DialogContext: import("react").Context<DialogContextValue>;
|
|
779
|
+
/**
|
|
780
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
781
|
+
* @beta
|
|
782
|
+
*/
|
|
783
|
+
interface DialogProviderProps {
|
|
784
|
+
children?: React.ReactNode;
|
|
785
|
+
position?: DialogPosition | DialogPosition[];
|
|
786
|
+
zOffset?: number | number[];
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
790
|
+
* @beta
|
|
791
|
+
*/
|
|
792
|
+
declare function DialogProvider(props: DialogProviderProps): React.JSX.Element;
|
|
793
|
+
/**
|
|
794
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
795
|
+
* @beta
|
|
796
|
+
*/
|
|
797
|
+
declare function useDialog(): DialogContextValue;
|
|
798
|
+
/**
|
|
799
|
+
* @public
|
|
800
|
+
*/
|
|
801
|
+
interface HotkeysProps {
|
|
802
|
+
fontSize?: number | number[];
|
|
803
|
+
gap?: number | number[];
|
|
804
|
+
padding?: number | number[];
|
|
805
|
+
radius?: Radius | Radius[];
|
|
806
|
+
/**
|
|
807
|
+
* @deprecated Use `gap` instead.
|
|
808
|
+
*/
|
|
809
|
+
space?: never;
|
|
810
|
+
keys?: string[];
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* Represent hotkeys (a keyboard combination) with semantic `<kbd>` elements.
|
|
814
|
+
*
|
|
815
|
+
* @public
|
|
816
|
+
*/
|
|
817
|
+
declare const Hotkeys: import("react").ForwardRefExoticComponent<HotkeysProps & Omit<import("react").HTMLProps<HTMLElement>, "as" | "ref" | "size"> & import("react").RefAttributes<HTMLElement>>;
|
|
818
|
+
/**
|
|
819
|
+
* @public
|
|
820
|
+
*/
|
|
821
|
+
interface MenuProps extends ResponsivePaddingProps {
|
|
822
|
+
/**
|
|
823
|
+
* @deprecated Use `shouldFocus="first"` instead.
|
|
824
|
+
*/
|
|
825
|
+
'focusFirst'?: never;
|
|
826
|
+
/**
|
|
827
|
+
* @deprecated Use `shouldFocus="last"` instead.
|
|
828
|
+
*/
|
|
829
|
+
'focusLast'?: never;
|
|
830
|
+
'onClickOutside'?: (event: MouseEvent) => void;
|
|
831
|
+
'onEscape'?: () => void;
|
|
832
|
+
'onItemClick'?: () => void;
|
|
833
|
+
'onItemSelect'?: (index: number) => void;
|
|
834
|
+
'originElement'?: HTMLElement | null;
|
|
835
|
+
'registerElement'?: (el: HTMLElement) => () => void;
|
|
836
|
+
'shouldFocus'?: 'first' | 'last' | null;
|
|
837
|
+
'gap'?: number | number[];
|
|
838
|
+
/**
|
|
839
|
+
* @deprecated Use `gap` instead.
|
|
840
|
+
*/
|
|
841
|
+
'space'?: never;
|
|
842
|
+
'aria-labelledby'?: string;
|
|
843
|
+
'onBlurCapture'?: (event: FocusEvent) => void;
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* The `Menu` component is a building block for application menus.
|
|
847
|
+
*
|
|
848
|
+
* @public
|
|
849
|
+
*/
|
|
850
|
+
declare const Menu: import("react").ForwardRefExoticComponent<Omit<MenuProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "height" | "role" | "tabIndex">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
851
|
+
/**
|
|
852
|
+
* @public
|
|
853
|
+
*/
|
|
854
|
+
interface MenuButtonProps {
|
|
855
|
+
/**
|
|
856
|
+
* @beta Do not use in production.
|
|
857
|
+
*/
|
|
858
|
+
__unstable_disableRestoreFocusOnClose?: boolean;
|
|
859
|
+
/**
|
|
860
|
+
* @deprecated Use `popover={{boundaryElement: element}}` instead.
|
|
861
|
+
*/
|
|
862
|
+
boundaryElement?: never;
|
|
863
|
+
button: React.JSX.Element;
|
|
864
|
+
id: string;
|
|
865
|
+
menu?: React.JSX.Element;
|
|
866
|
+
onClose?: () => void;
|
|
867
|
+
onOpen?: () => void;
|
|
868
|
+
/**
|
|
869
|
+
* @deprecated Use `popover={{placement: 'top'}}` instead.
|
|
870
|
+
*/
|
|
871
|
+
placement?: never;
|
|
872
|
+
popover?: Omit<PopoverProps, 'content' | 'open'>;
|
|
873
|
+
/**
|
|
874
|
+
* @deprecated Use `popover={{scheme: 'dark'}}` instead.
|
|
875
|
+
*/
|
|
876
|
+
popoverScheme?: never;
|
|
877
|
+
/**
|
|
878
|
+
* @deprecated Use `popover={{radius: 2}}` instead.
|
|
879
|
+
*/
|
|
880
|
+
popoverRadius?: never;
|
|
881
|
+
/**
|
|
882
|
+
* @beta Do not use in production.
|
|
883
|
+
* @deprecated Use `popover={{portal: true}}` instead.
|
|
884
|
+
*/
|
|
885
|
+
portal?: never;
|
|
886
|
+
/**
|
|
887
|
+
* @deprecated Use `popover={{preventOverflow: true}}` instead.
|
|
888
|
+
*/
|
|
889
|
+
preventOverflow?: never;
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* The `MenuButton` component follows the WAI-ARIA specification for menu buttons.
|
|
893
|
+
*
|
|
894
|
+
* @public
|
|
895
|
+
*/
|
|
896
|
+
declare const MenuButton: import("react").ForwardRefExoticComponent<MenuButtonProps & import("react").RefAttributes<HTMLButtonElement | null>>;
|
|
897
|
+
/**
|
|
898
|
+
* @public
|
|
899
|
+
*/
|
|
900
|
+
type MenuDividerProps<E extends ElementType = 'hr'> = Props<EmptyProps, E>;
|
|
901
|
+
/**
|
|
902
|
+
* @public
|
|
903
|
+
*/
|
|
904
|
+
declare const MenuDivider: <E extends ElementType = 'hr'>(props: MenuDividerProps<E>) => React.JSX.Element;
|
|
905
|
+
/**
|
|
906
|
+
* @public
|
|
907
|
+
*/
|
|
908
|
+
type SelectableTone = ThemeColorStateToneKey;
|
|
909
|
+
/**
|
|
910
|
+
* @public
|
|
911
|
+
*/
|
|
912
|
+
interface MenuGroupOwnProps {
|
|
913
|
+
fontSize?: number | number[];
|
|
914
|
+
icon?: React.ElementType | React.ReactNode;
|
|
915
|
+
menu?: Omit<MenuProps, 'onClickOutside' | 'onEscape' | 'onItemClick' | 'onKeyDown' | 'onMouseEnter' | 'registerElement' | 'shouldFocus' | 'onBlurCapture'>;
|
|
916
|
+
padding?: number | number[];
|
|
917
|
+
popover?: Omit<PopoverProps, 'content' | 'open'>;
|
|
918
|
+
radius?: Radius | Radius[];
|
|
919
|
+
gap?: number | number[];
|
|
920
|
+
/**
|
|
921
|
+
* @deprecated Use `gap` instead.
|
|
922
|
+
*/
|
|
923
|
+
space?: never;
|
|
924
|
+
text: React.ReactNode;
|
|
925
|
+
tone?: SelectableTone;
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* @public
|
|
929
|
+
*/
|
|
930
|
+
type MenuGroupProps<E extends ElementType = 'button'> = Props<MenuGroupOwnProps, E>;
|
|
931
|
+
/**
|
|
932
|
+
* @public
|
|
933
|
+
*/
|
|
934
|
+
declare const MenuGroup: <E extends ElementType = 'button'>(props: MenuGroupProps<E>) => React.JSX.Element;
|
|
935
|
+
/**
|
|
936
|
+
* @public
|
|
937
|
+
*/
|
|
938
|
+
interface MenuItemOwnProps extends ResponsivePaddingProps, ResponsiveRadiusProps {
|
|
939
|
+
fontSize?: number | number[];
|
|
940
|
+
hotkeys?: string[];
|
|
941
|
+
icon?: React.ElementType | React.ReactNode;
|
|
942
|
+
iconRight?: React.ElementType | React.ReactNode;
|
|
943
|
+
pressed?: boolean;
|
|
944
|
+
selected?: boolean;
|
|
945
|
+
gap?: number | number[];
|
|
946
|
+
/**
|
|
947
|
+
* @deprecated Use `gap` instead.
|
|
948
|
+
*/
|
|
949
|
+
space?: never;
|
|
950
|
+
text?: React.ReactNode;
|
|
951
|
+
tone?: SelectableTone;
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* @public
|
|
955
|
+
*/
|
|
956
|
+
type MenuItemProps<E extends ElementType = 'button'> = Props<MenuItemOwnProps, E>;
|
|
957
|
+
/**
|
|
958
|
+
* @public
|
|
959
|
+
*/
|
|
960
|
+
declare const MenuItem: <E extends ElementType = 'button'>(props: MenuItemProps<E>) => React.JSX.Element;
|
|
961
|
+
/**
|
|
962
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
963
|
+
* @beta
|
|
964
|
+
*/
|
|
965
|
+
interface SkeletonProps extends ResponsiveRadiusProps, Omit<BoxOwnProps, 'children'> {
|
|
966
|
+
animated?: boolean;
|
|
967
|
+
delay?: number;
|
|
968
|
+
}
|
|
969
|
+
/**
|
|
970
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
971
|
+
* @beta
|
|
972
|
+
*/
|
|
973
|
+
declare const Skeleton: import("react").ForwardRefExoticComponent<Omit<SkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "height">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
974
|
+
/**
|
|
975
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
976
|
+
* @beta
|
|
977
|
+
*/
|
|
978
|
+
interface TextSkeletonProps extends SkeletonProps {
|
|
979
|
+
size?: number | number[];
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
983
|
+
* @beta
|
|
984
|
+
*/
|
|
985
|
+
interface LabelSkeletonProps extends SkeletonProps {
|
|
986
|
+
size?: number | number[];
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
990
|
+
* @beta
|
|
991
|
+
*/
|
|
992
|
+
interface HeadingSkeletonProps extends SkeletonProps {
|
|
993
|
+
size?: number | number[];
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
997
|
+
* @beta
|
|
998
|
+
*/
|
|
999
|
+
interface CodeSkeletonProps extends SkeletonProps {
|
|
1000
|
+
size?: number | number[];
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
1003
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1004
|
+
* @beta
|
|
1005
|
+
*/
|
|
1006
|
+
declare const TextSkeleton: import("react").ForwardRefExoticComponent<Omit<TextSkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "height" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
1007
|
+
/**
|
|
1008
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1009
|
+
* @beta
|
|
1010
|
+
*/
|
|
1011
|
+
declare const LabelSkeleton: import("react").ForwardRefExoticComponent<Omit<LabelSkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "height" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
1012
|
+
/**
|
|
1013
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1014
|
+
* @beta
|
|
1015
|
+
*/
|
|
1016
|
+
declare const HeadingSkeleton: import("react").ForwardRefExoticComponent<Omit<HeadingSkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "height" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
1017
|
+
/**
|
|
1018
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1019
|
+
* @beta
|
|
1020
|
+
*/
|
|
1021
|
+
declare const CodeSkeleton: import("react").ForwardRefExoticComponent<Omit<CodeSkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "height" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
1022
|
+
/**
|
|
1023
|
+
* @public
|
|
1024
|
+
*/
|
|
1025
|
+
interface TabProps {
|
|
1026
|
+
/**
|
|
1027
|
+
* The `id` of the correlating `TabPanel` component.
|
|
1028
|
+
*/
|
|
1029
|
+
'aria-controls': string;
|
|
1030
|
+
'id': string;
|
|
1031
|
+
'icon'?: React.ElementType | React.ReactNode;
|
|
1032
|
+
'focused'?: boolean;
|
|
1033
|
+
'fontSize'?: number | number[];
|
|
1034
|
+
'label'?: React.ReactNode;
|
|
1035
|
+
'padding'?: number | number[];
|
|
1036
|
+
'selected'?: boolean;
|
|
1037
|
+
'tone'?: ButtonTone;
|
|
1038
|
+
}
|
|
1039
|
+
/**
|
|
1040
|
+
* @public
|
|
1041
|
+
*/
|
|
1042
|
+
declare const Tab: import("react").ForwardRefExoticComponent<Omit<TabProps & Omit<import("react").HTMLProps<HTMLButtonElement>, "aria-controls" | "as" | "id" | "label" | "type" | "width">, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
1043
|
+
/**
|
|
1044
|
+
* @public
|
|
1045
|
+
*/
|
|
1046
|
+
interface InlineOwnProps extends Omit<BoxOwnProps, 'display'> {
|
|
1047
|
+
/**
|
|
1048
|
+
* @deprecated Use `gap` instead.
|
|
1049
|
+
*/
|
|
1050
|
+
space?: never;
|
|
1051
|
+
/** The spacing between children. */
|
|
1052
|
+
gap?: number | number[];
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* @public
|
|
1056
|
+
*/
|
|
1057
|
+
type InlineProps<E extends ElementType = 'div'> = Props<InlineOwnProps, E>;
|
|
1058
|
+
/**
|
|
1059
|
+
* The `Inline` component is a layout utility for aligning and spacing items horizontally.
|
|
1060
|
+
*
|
|
1061
|
+
* @public
|
|
1062
|
+
*/
|
|
1063
|
+
declare const Inline: <E extends ElementType = 'div'>(props: InlineProps<E>) => React.JSX.Element;
|
|
1064
|
+
/**
|
|
1065
|
+
* @public
|
|
1066
|
+
*/
|
|
1067
|
+
interface TabListProps extends Omit<InlineOwnProps, 'height'> {
|
|
1068
|
+
children: Array<React.JSX.Element | null | undefined | false>;
|
|
1069
|
+
}
|
|
1070
|
+
/**
|
|
1071
|
+
* @public
|
|
1072
|
+
*/
|
|
1073
|
+
declare const TabList: import("react").ForwardRefExoticComponent<Omit<TabListProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "height">, "ref"> & import("react").RefAttributes<unknown>>;
|
|
1074
|
+
/**
|
|
1075
|
+
* @public
|
|
1076
|
+
*/
|
|
1077
|
+
interface TabPanelProps extends BoxOwnProps {
|
|
1078
|
+
/**
|
|
1079
|
+
* The `id` of the correlating `Tab` component.
|
|
1080
|
+
*/
|
|
1081
|
+
'aria-labelledby': string;
|
|
1082
|
+
'id': string;
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* @public
|
|
1086
|
+
*/
|
|
1087
|
+
declare const TabPanel: import("react").ForwardRefExoticComponent<Omit<TabPanelProps & Omit<import("react").HTMLProps<HTMLDivElement>, "aria-labelledby" | "as" | "id" | "role">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
1088
|
+
/**
|
|
1089
|
+
* @public
|
|
1090
|
+
*/
|
|
1091
|
+
interface ToastProps {
|
|
1092
|
+
closable?: boolean;
|
|
1093
|
+
description?: React.ReactNode;
|
|
1094
|
+
onClose: () => void;
|
|
1095
|
+
radius?: number | number[];
|
|
1096
|
+
title?: React.ReactNode;
|
|
1097
|
+
status?: 'error' | 'warning' | 'success' | 'info';
|
|
1098
|
+
duration?: number;
|
|
1099
|
+
updatedAt?: number;
|
|
1100
|
+
}
|
|
1101
|
+
/**
|
|
1102
|
+
* The `Toast` component gives feedback to users when an action has taken place.
|
|
1103
|
+
*
|
|
1104
|
+
* Toasts can be closed with a close button, or auto-dismiss after a certain timeout.
|
|
1105
|
+
*
|
|
1106
|
+
* @public
|
|
1107
|
+
*/
|
|
1108
|
+
declare function Toast(props: ToastProps & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref' | 'title' | 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'>): React.JSX.Element;
|
|
1109
|
+
/**
|
|
1110
|
+
* @public
|
|
1111
|
+
*/
|
|
1112
|
+
interface ToastLayerProps {
|
|
1113
|
+
children: React.ReactNode;
|
|
1114
|
+
padding?: number | number[];
|
|
1115
|
+
paddingX?: number | number[];
|
|
1116
|
+
paddingY?: number | number[];
|
|
1117
|
+
gap?: number | number[];
|
|
1118
|
+
}
|
|
1119
|
+
/**
|
|
1120
|
+
* @public
|
|
1121
|
+
*/
|
|
1122
|
+
interface ToastProviderProps extends Omit<ToastLayerProps, 'children'> {
|
|
1123
|
+
children?: React.ReactNode;
|
|
1124
|
+
zOffset?: number | number[];
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* @public
|
|
1128
|
+
*/
|
|
1129
|
+
declare function ToastProvider(props: ToastProviderProps): React.JSX.Element;
|
|
1130
|
+
/**
|
|
1131
|
+
* @public
|
|
1132
|
+
*/
|
|
1133
|
+
interface ToastParams {
|
|
1134
|
+
closable?: boolean;
|
|
1135
|
+
description?: React.ReactNode;
|
|
1136
|
+
duration?: number;
|
|
1137
|
+
id?: string;
|
|
1138
|
+
onClose?: () => void;
|
|
1139
|
+
title?: React.ReactNode;
|
|
1140
|
+
status?: 'error' | 'warning' | 'success' | 'info';
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* @public
|
|
1144
|
+
*/
|
|
1145
|
+
interface ToastContextValue {
|
|
1146
|
+
version: 0.0;
|
|
1147
|
+
/**
|
|
1148
|
+
* Creates or updates a toast notification.
|
|
1149
|
+
* If a toast with the same ID already exists, it will be updated.
|
|
1150
|
+
* If an ID is not provided, a random one will be generated.
|
|
1151
|
+
* The returned ID can be used to programatically update a toast.
|
|
1152
|
+
*/
|
|
1153
|
+
push: (params: ToastParams) => string;
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1156
|
+
* @public
|
|
1157
|
+
*/
|
|
1158
|
+
declare function useToast(): ToastContextValue;
|
|
1159
|
+
/**
|
|
1160
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1161
|
+
* @beta
|
|
1162
|
+
*/
|
|
1163
|
+
interface TreeProps {
|
|
1164
|
+
gap?: number | number[];
|
|
1165
|
+
/**
|
|
1166
|
+
* @deprecated Use `gap` instead.
|
|
1167
|
+
*/
|
|
1168
|
+
space?: never;
|
|
1169
|
+
}
|
|
1170
|
+
/**
|
|
1171
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1172
|
+
* @beta
|
|
1173
|
+
*/
|
|
1174
|
+
declare const Tree: import("react").ForwardRefExoticComponent<TreeProps & Omit<import("react").HTMLProps<HTMLUListElement>, "align" | "as" | "height" | "ref" | "role" | "wrap"> & import("react").RefAttributes<HTMLUListElement>>;
|
|
1175
|
+
/**
|
|
1176
|
+
* @beta
|
|
1177
|
+
*/
|
|
1178
|
+
interface TreeItemProps {
|
|
1179
|
+
expanded?: boolean;
|
|
1180
|
+
fontSize?: number | number[];
|
|
1181
|
+
icon?: React.ElementType;
|
|
1182
|
+
/**
|
|
1183
|
+
* Allows passing a custom element type to the link component
|
|
1184
|
+
*/
|
|
1185
|
+
linkAs?: ElementType;
|
|
1186
|
+
/**
|
|
1187
|
+
* Additional props for the link element that is rendered when `href` is set — e.g. `next/link`'s
|
|
1188
|
+
* `prefetch` together with `linkAs={Link}`. Props controlled by `TreeItem` itself (`href`,
|
|
1189
|
+
* `role`, `tabIndex`, `aria-expanded` and the ref) take precedence.
|
|
1190
|
+
*/
|
|
1191
|
+
linkProps?: React.HTMLProps<HTMLAnchorElement> & Record<string, unknown>;
|
|
1192
|
+
padding?: number | number[];
|
|
1193
|
+
gap?: number | number[];
|
|
1194
|
+
/**
|
|
1195
|
+
* @deprecated Use `gap` instead.
|
|
1196
|
+
*/
|
|
1197
|
+
space?: never;
|
|
1198
|
+
text?: React.ReactNode;
|
|
1199
|
+
weight?: ThemeFontWeightKey$1;
|
|
1200
|
+
}
|
|
1201
|
+
/**
|
|
1202
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1203
|
+
* @beta
|
|
1204
|
+
*/
|
|
1205
|
+
declare function TreeItem(props: TreeItemProps & Omit<React.HTMLProps<HTMLLIElement>, 'as' | 'ref' | 'role'>): React.JSX.Element;
|
|
1206
|
+
/**
|
|
1207
|
+
* @beta
|
|
1208
|
+
*/
|
|
1209
|
+
interface TreeState {
|
|
1210
|
+
[key: string]: {
|
|
1211
|
+
element: HTMLElement;
|
|
1212
|
+
expanded: boolean;
|
|
1213
|
+
} | undefined;
|
|
1214
|
+
}
|
|
1215
|
+
/**
|
|
1216
|
+
* @beta
|
|
1217
|
+
*/
|
|
1218
|
+
interface TreeContextValue {
|
|
1219
|
+
version: 0.0;
|
|
1220
|
+
focusedElement: HTMLElement | null;
|
|
1221
|
+
level: number;
|
|
1222
|
+
path: string[];
|
|
1223
|
+
registerItem: (element: HTMLElement, path: string, expanded: boolean, selected: boolean) => void;
|
|
1224
|
+
setExpanded: (path: string, expanded: boolean) => void;
|
|
1225
|
+
setFocusedElement: (focusedElement: HTMLElement | null) => void;
|
|
1226
|
+
gap: number | number[];
|
|
1227
|
+
/**
|
|
1228
|
+
* @deprecated Use `gap` instead.
|
|
1229
|
+
*/
|
|
1230
|
+
space?: never;
|
|
1231
|
+
state: TreeState;
|
|
1232
|
+
}
|
|
1233
|
+
/**
|
|
1234
|
+
* @beta
|
|
1235
|
+
*/
|
|
1236
|
+
declare function useTree(): TreeContextValue;
|
|
1237
|
+
/**
|
|
1238
|
+
* @internal
|
|
1239
|
+
*/
|
|
1240
|
+
declare function _raf(fn: () => void): () => void;
|
|
1241
|
+
/**
|
|
1242
|
+
* @internal
|
|
1243
|
+
*/
|
|
1244
|
+
declare function _raf2(fn: () => void): () => void;
|
|
1245
|
+
/**
|
|
1246
|
+
* @internal
|
|
1247
|
+
*/
|
|
1248
|
+
declare function _isEnterToClickElement(element: HTMLElement): boolean;
|
|
1249
|
+
/**
|
|
1250
|
+
* @internal
|
|
1251
|
+
*/
|
|
1252
|
+
declare function isHTMLElement(node: unknown): node is HTMLElement;
|
|
1253
|
+
/**
|
|
1254
|
+
* @internal
|
|
1255
|
+
*/
|
|
1256
|
+
declare function isHTMLAnchorElement(element: unknown): element is HTMLAnchorElement;
|
|
1257
|
+
/**
|
|
1258
|
+
* @internal
|
|
1259
|
+
*/
|
|
1260
|
+
declare function isHTMLInputElement(element: unknown): element is HTMLInputElement;
|
|
1261
|
+
/**
|
|
1262
|
+
* @internal
|
|
1263
|
+
*/
|
|
1264
|
+
declare function isHTMLButtonElement(element: unknown): element is HTMLButtonElement;
|
|
1265
|
+
/**
|
|
1266
|
+
* @internal
|
|
1267
|
+
*/
|
|
1268
|
+
declare function isHTMLSelectElement(element: unknown): element is HTMLSelectElement;
|
|
1269
|
+
/**
|
|
1270
|
+
* @internal
|
|
1271
|
+
*/
|
|
1272
|
+
declare function isHTMLTextAreaElement(element: unknown): element is HTMLTextAreaElement;
|
|
1273
|
+
/**
|
|
1274
|
+
* @internal
|
|
1275
|
+
*/
|
|
1276
|
+
declare function containsOrEqualsElement(element: HTMLElement, node: Node): boolean;
|
|
1277
|
+
/**
|
|
1278
|
+
* @internal
|
|
1279
|
+
*/
|
|
1280
|
+
declare function _hasFocus(element: HTMLElement): boolean;
|
|
1281
|
+
/**
|
|
1282
|
+
* @internal
|
|
1283
|
+
*/
|
|
1284
|
+
declare function isFocusable(element: HTMLElement): boolean;
|
|
1285
|
+
/**
|
|
1286
|
+
* @internal
|
|
1287
|
+
*/
|
|
1288
|
+
declare function attemptFocus(element: HTMLElement): boolean;
|
|
1289
|
+
/**
|
|
1290
|
+
* @internal
|
|
1291
|
+
*/
|
|
1292
|
+
declare function focusFirstDescendant(element: HTMLElement): boolean;
|
|
1293
|
+
/**
|
|
1294
|
+
* @internal
|
|
1295
|
+
*/
|
|
1296
|
+
declare function focusLastDescendant(element: HTMLElement): boolean;
|
|
1297
|
+
/**
|
|
1298
|
+
* @internal
|
|
1299
|
+
*/
|
|
1300
|
+
declare function _isScrollable(el: Node): boolean;
|
|
1301
|
+
/** @beta */
|
|
1302
|
+
type ArrayPropPrimitive = string | number | boolean | undefined | null;
|
|
1303
|
+
/**
|
|
1304
|
+
* @deprecated instead of `useArrayProp(width)` use `Array.isArray(width) ? width : [width]` instead
|
|
1305
|
+
* @beta
|
|
1306
|
+
*/
|
|
1307
|
+
declare function useArrayProp(_val?: never, _defaultVal?: never): never;
|
|
1308
|
+
/**
|
|
1309
|
+
* @public
|
|
1310
|
+
*/
|
|
1311
|
+
type ClickOutsideListener = (event: MouseEvent) => void;
|
|
1312
|
+
/**
|
|
1313
|
+
* @public
|
|
1314
|
+
*/
|
|
1315
|
+
type ClickOutsideElements = (HTMLElement | null | (HTMLElement | null)[])[];
|
|
1316
|
+
/**
|
|
1317
|
+
* @public
|
|
1318
|
+
* @deprecated replaced by the new `useClickOutsideEvent` hook, instead of:
|
|
1319
|
+
* ```tsx
|
|
1320
|
+
* const [button, setButtonElement] = useState(null)
|
|
1321
|
+
* useClickOutside((event) => {}, [button])
|
|
1322
|
+
* return <button ref={setButtonElement} />
|
|
1323
|
+
* ```
|
|
1324
|
+
* do:
|
|
1325
|
+
* ```tsx
|
|
1326
|
+
* const buttonRef = useRef()
|
|
1327
|
+
* useClickOutsideEvent((event) => {}, () => [buttonRef.current])
|
|
1328
|
+
* return <button ref={buttonRef} />
|
|
1329
|
+
* ```
|
|
1330
|
+
*/
|
|
1331
|
+
declare function useClickOutside(_listener?: never, _elementsArg?: never, _boundaryElement?: never): never;
|
|
1332
|
+
/**
|
|
1333
|
+
* @public
|
|
1334
|
+
*/
|
|
1335
|
+
type ClickOutsideEventListener = (event: MouseEvent) => void;
|
|
1336
|
+
/**
|
|
1337
|
+
* @public
|
|
1338
|
+
*/
|
|
1339
|
+
type ClickOutsideEventElements = (HTMLElement | null | (HTMLElement | null)[])[];
|
|
1340
|
+
/**
|
|
1341
|
+
* @public
|
|
1342
|
+
*/
|
|
1343
|
+
declare function useClickOutsideEvent(listener: ClickOutsideEventListener | false | undefined, elementsArg?: () => ClickOutsideEventElements, boundaryElement?: () => HTMLElement | null): void;
|
|
1344
|
+
/**
|
|
1345
|
+
* @beta
|
|
1346
|
+
*/
|
|
1347
|
+
declare function useCustomValidity(ref: {
|
|
1348
|
+
current: null | {
|
|
1349
|
+
setCustomValidity: (validity: string) => void;
|
|
1350
|
+
};
|
|
1351
|
+
}, customValidity: string | undefined): void;
|
|
1352
|
+
/**
|
|
1353
|
+
* Subscribe to the rect of a DOM element.
|
|
1354
|
+
* @beta
|
|
1355
|
+
*
|
|
1356
|
+
* @deprecated Use `useElementSize` instead
|
|
1357
|
+
*/
|
|
1358
|
+
declare function useElementRect(_element?: never): never;
|
|
1359
|
+
/**
|
|
1360
|
+
* @beta
|
|
1361
|
+
*/
|
|
1362
|
+
interface ElementRectValue {
|
|
1363
|
+
width: number;
|
|
1364
|
+
height: number;
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* @beta
|
|
1368
|
+
*/
|
|
1369
|
+
interface ElementSize {
|
|
1370
|
+
content: ElementRectValue;
|
|
1371
|
+
border: ElementRectValue;
|
|
1372
|
+
/** @deprecated INTERNAL ONLY */
|
|
1373
|
+
_contentRect: DOMRectReadOnly;
|
|
1374
|
+
}
|
|
1375
|
+
/**
|
|
1376
|
+
* @internal
|
|
1377
|
+
*/
|
|
1378
|
+
type _ElementSizeSubscriber = (elementRect: ElementSize) => void;
|
|
1379
|
+
/**
|
|
1380
|
+
* @internal
|
|
1381
|
+
*/
|
|
1382
|
+
interface _ElementSizeObserver {
|
|
1383
|
+
subscribe: (element: HTMLElement, subscriber: _ElementSizeSubscriber) => () => void;
|
|
1384
|
+
}
|
|
1385
|
+
/**
|
|
1386
|
+
* @internal
|
|
1387
|
+
*/
|
|
1388
|
+
interface _ElementSizeListener {
|
|
1389
|
+
subscribe: (element: HTMLElement, subscriber: _ElementSizeSubscriber) => () => void;
|
|
1390
|
+
}
|
|
1391
|
+
/**
|
|
1392
|
+
* @internal
|
|
1393
|
+
*/
|
|
1394
|
+
declare const _elementSizeObserver: _ElementSizeObserver;
|
|
1395
|
+
/**
|
|
1396
|
+
* Subscribe to the size of a DOM element.
|
|
1397
|
+
* @beta
|
|
1398
|
+
*/
|
|
1399
|
+
declare function useElementSize(element: HTMLElement | null): ElementSize | null;
|
|
1400
|
+
/**
|
|
1401
|
+
* @beta
|
|
1402
|
+
* @deprecated use `useImperativeHandle` instead
|
|
1403
|
+
* @example
|
|
1404
|
+
* ```diff
|
|
1405
|
+
* -const ref = useForwardedRef(forwardedRef)
|
|
1406
|
+
* +const ref = useRef(null)
|
|
1407
|
+
* +useImperativeHandle(forwardedRef, () => ref.current)
|
|
1408
|
+
* ```
|
|
1409
|
+
*/
|
|
1410
|
+
declare function useForwardedRef(_ref?: never): never;
|
|
1411
|
+
/**
|
|
1412
|
+
* Adds global keydown event listener to the window.
|
|
1413
|
+
*
|
|
1414
|
+
* @param onKeyDown - The function to call when a keydown event is triggered.
|
|
1415
|
+
* @param options - The options to pass to the addEventListener function (example, capture: true)
|
|
1416
|
+
* @beta
|
|
1417
|
+
*/
|
|
1418
|
+
declare function useGlobalKeyDown(onKeyDown: (event: KeyboardEvent) => void, options?: AddEventListenerOptions): void;
|
|
1419
|
+
/**
|
|
1420
|
+
* Efficiently subscribes to `window.matchMedia` queries
|
|
1421
|
+
*
|
|
1422
|
+
* @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Required if the hook is called during SSR (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
|
|
1423
|
+
*
|
|
1424
|
+
* @public
|
|
1425
|
+
*/
|
|
1426
|
+
declare function useMatchMedia(mediaQueryString: `(${string})`, getServerSnapshot?: () => boolean): boolean;
|
|
1427
|
+
/**
|
|
1428
|
+
* @internal
|
|
1429
|
+
*/
|
|
1430
|
+
interface _MediaStore {
|
|
1431
|
+
subscribe: (onStoreChange: () => void) => () => void;
|
|
1432
|
+
getSnapshot: () => number;
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1436
|
+
* @beta
|
|
1437
|
+
*/
|
|
1438
|
+
declare function useMediaIndex(): number;
|
|
1439
|
+
/**
|
|
1440
|
+
* Returns true if a dark color scheme is preferred, false if a light color scheme is preferred or the preference is not known.
|
|
1441
|
+
*
|
|
1442
|
+
* @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query and we assume `(prefers-color-scheme: light)` since it's the most common scheme (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
|
|
1443
|
+
*
|
|
1444
|
+
* If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
|
|
1445
|
+
* Chrome supports reading the `prefers-color-scheme` media query from a header if the server response: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Color-Scheme
|
|
1446
|
+
* @example https://gist.github.com/stipsan/13c0cccf8dfc34f4b44bb1b984baf7df
|
|
1447
|
+
*
|
|
1448
|
+
* @public
|
|
1449
|
+
*/
|
|
1450
|
+
declare function usePrefersDark(getServerSnapshot?: () => boolean): boolean;
|
|
1451
|
+
/**
|
|
1452
|
+
* Returns true if motion should be reduced
|
|
1453
|
+
*
|
|
1454
|
+
* @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query and we assume `(prefers-reduced-motion: no-preference)` since it's the most common scheme (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
|
|
1455
|
+
*
|
|
1456
|
+
* If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
|
|
1457
|
+
* Chrome supports reading the `prefers-reduced-motion` media query from a header if the server response: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Reduced-Motion
|
|
1458
|
+
* @example https://gist.github.com/stipsan/0c0f839a27842249cada893e9fb7767b
|
|
1459
|
+
*
|
|
1460
|
+
* @public
|
|
1461
|
+
*/
|
|
1462
|
+
declare function usePrefersReducedMotion(getServerSnapshot?: () => boolean): boolean;
|
|
1463
|
+
/**
|
|
1464
|
+
* @internal
|
|
1465
|
+
*/
|
|
1466
|
+
declare const _ResizeObserver: typeof ResizeObserver;
|
|
1467
|
+
/**
|
|
1468
|
+
* @public
|
|
1469
|
+
*/
|
|
1470
|
+
type AvatarPosition = 'top' | 'bottom' | 'inside';
|
|
1471
|
+
/**
|
|
1472
|
+
* @public
|
|
1473
|
+
*/
|
|
1474
|
+
type AvatarSize = 0 | 1 | 2 | 3;
|
|
1475
|
+
/**
|
|
1476
|
+
* @public
|
|
1477
|
+
*/
|
|
1478
|
+
type AvatarStatus = 'online' | 'editing' | 'inactive';
|
|
1479
|
+
/**
|
|
1480
|
+
* @public
|
|
1481
|
+
*/
|
|
1482
|
+
interface AvatarOwnProps {
|
|
1483
|
+
/** @beta */
|
|
1484
|
+
__unstable_hideInnerStroke?: boolean;
|
|
1485
|
+
animateArrowFrom?: AvatarPosition;
|
|
1486
|
+
arrowPosition?: AvatarPosition;
|
|
1487
|
+
color?: ThemeColorAvatarColorKey;
|
|
1488
|
+
initials?: string;
|
|
1489
|
+
onImageLoadError?: (event: Error) => void;
|
|
1490
|
+
size?: AvatarSize | AvatarSize[];
|
|
1491
|
+
src?: string;
|
|
1492
|
+
/**
|
|
1493
|
+
* The status of the entity this Avatar represents.
|
|
1494
|
+
* @alpha
|
|
1495
|
+
*/
|
|
1496
|
+
status?: AvatarStatus;
|
|
1497
|
+
title?: string;
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* @public
|
|
1501
|
+
*/
|
|
1502
|
+
type AvatarProps<E extends ElementType = 'div'> = Props<AvatarOwnProps, E>;
|
|
1503
|
+
/**
|
|
1504
|
+
* Avatars are used to represent people and other agents (e.g. bots).
|
|
1505
|
+
*
|
|
1506
|
+
* @public
|
|
1507
|
+
*/
|
|
1508
|
+
declare const Avatar: <E extends ElementType = 'div'>(props: AvatarProps<E>) => React.JSX.Element;
|
|
1509
|
+
/**
|
|
1510
|
+
* @public
|
|
1511
|
+
*/
|
|
1512
|
+
interface AvatarCounterProps {
|
|
1513
|
+
count: number;
|
|
1514
|
+
size?: AvatarSize | AvatarSize[];
|
|
1515
|
+
/** @deprecated No longer supported. */
|
|
1516
|
+
tone?: never;
|
|
1517
|
+
}
|
|
1518
|
+
/**
|
|
1519
|
+
* @public
|
|
1520
|
+
*/
|
|
1521
|
+
declare const AvatarCounter: import("react").ForwardRefExoticComponent<AvatarCounterProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
1522
|
+
/**
|
|
1523
|
+
* @public
|
|
1524
|
+
*/
|
|
1525
|
+
interface AvatarStackProps {
|
|
1526
|
+
children: React.ReactNode;
|
|
1527
|
+
maxLength?: number;
|
|
1528
|
+
size?: AvatarSize | AvatarSize[];
|
|
1529
|
+
/** @deprecated No longer supported. */
|
|
1530
|
+
tone?: never;
|
|
1531
|
+
}
|
|
1532
|
+
/**
|
|
1533
|
+
* @public
|
|
1534
|
+
*/
|
|
1535
|
+
declare const AvatarStack: import("react").ForwardRefExoticComponent<AvatarStackProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
1536
|
+
/**
|
|
1537
|
+
* @internal
|
|
1538
|
+
*/
|
|
1539
|
+
interface AvatarRootStyleProps {
|
|
1540
|
+
$color: ThemeColorAvatarColorKey;
|
|
1541
|
+
}
|
|
1542
|
+
/**
|
|
1543
|
+
* @internal
|
|
1544
|
+
*/
|
|
1545
|
+
interface ResponsiveAvatarSizeStyleProps {
|
|
1546
|
+
$size: AvatarSize[];
|
|
1547
|
+
}
|
|
1548
|
+
/**
|
|
1549
|
+
* @public
|
|
1550
|
+
* @deprecated No longer used
|
|
1551
|
+
*/
|
|
1552
|
+
type BadgeMode = never;
|
|
1553
|
+
/**
|
|
1554
|
+
* @public
|
|
1555
|
+
*/
|
|
1556
|
+
type BadgeTone = ThemeColorStateToneKey;
|
|
1557
|
+
/**
|
|
1558
|
+
* @public
|
|
1559
|
+
*/
|
|
1560
|
+
interface BadgeOwnProps extends BoxOwnProps, ResponsiveRadiusProps {
|
|
1561
|
+
fontSize?: number | number[];
|
|
1562
|
+
/** @deprecated No longer used. */
|
|
1563
|
+
mode?: never;
|
|
1564
|
+
tone?: BadgeTone;
|
|
1565
|
+
}
|
|
1566
|
+
/**
|
|
1567
|
+
* @public
|
|
1568
|
+
*/
|
|
1569
|
+
type BadgeProps<E extends ElementType = 'div'> = Props<BadgeOwnProps, E>;
|
|
1570
|
+
/**
|
|
1571
|
+
* Badges are used to tag resources.
|
|
1572
|
+
*
|
|
1573
|
+
* @public
|
|
1574
|
+
*/
|
|
1575
|
+
declare const Badge: <E extends ElementType = 'div'>(props: BadgeProps<E>) => React.JSX.Element;
|
|
1576
|
+
/**
|
|
1577
|
+
* @public
|
|
1578
|
+
*/
|
|
1579
|
+
interface CardOwnProps extends BoxOwnProps, ResponsiveBorderProps, ResponsiveRadiusProps, ResponsiveShadowProps {
|
|
1580
|
+
/**
|
|
1581
|
+
* Do not use in production.
|
|
1582
|
+
* @beta
|
|
1583
|
+
*/
|
|
1584
|
+
__unstable_checkered?: boolean;
|
|
1585
|
+
/**
|
|
1586
|
+
* Do not use in production.
|
|
1587
|
+
* @beta
|
|
1588
|
+
*/
|
|
1589
|
+
__unstable_focusRing?: boolean;
|
|
1590
|
+
disabled?: boolean;
|
|
1591
|
+
muted?: boolean;
|
|
1592
|
+
pressed?: boolean;
|
|
1593
|
+
scheme?: ThemeColorSchemeKey$1;
|
|
1594
|
+
selected?: boolean;
|
|
1595
|
+
tone?: CardTone;
|
|
1596
|
+
}
|
|
1597
|
+
/**
|
|
1598
|
+
* @public
|
|
1599
|
+
*/
|
|
1600
|
+
type CardProps<E extends ElementType = 'div'> = Props<CardOwnProps, E>;
|
|
1601
|
+
/**
|
|
1602
|
+
* The `Card` component acts much like a `Box`, but with a background and foreground color.
|
|
1603
|
+
* Components within a `Card` inherit its colors.
|
|
1604
|
+
*
|
|
1605
|
+
* @public
|
|
1606
|
+
*/
|
|
1607
|
+
declare const Card: <E extends ElementType = 'div'>(props: CardProps<E>) => React.JSX.Element;
|
|
1608
|
+
/**
|
|
1609
|
+
* @internal
|
|
1610
|
+
*/
|
|
1611
|
+
interface CardStyleProps {
|
|
1612
|
+
$checkered: boolean;
|
|
1613
|
+
$focusRing: boolean;
|
|
1614
|
+
$muted: boolean;
|
|
1615
|
+
$tone: ThemeColorToneKey;
|
|
1616
|
+
}
|
|
1617
|
+
/**
|
|
1618
|
+
* @public
|
|
1619
|
+
*/
|
|
1620
|
+
interface CheckboxProps {
|
|
1621
|
+
indeterminate?: boolean;
|
|
1622
|
+
customValidity?: string;
|
|
1623
|
+
}
|
|
1624
|
+
/**
|
|
1625
|
+
* Checkboxes allow the user to select one or more items from a set.
|
|
1626
|
+
*
|
|
1627
|
+
* @public
|
|
1628
|
+
*/
|
|
1629
|
+
declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").HTMLProps<HTMLInputElement>, "as" | "type"> & CheckboxProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
1630
|
+
/**
|
|
1631
|
+
* @public
|
|
1632
|
+
*/
|
|
1633
|
+
interface CodeOwnProps {
|
|
1634
|
+
/** Define the language to use for syntax highlighting. */
|
|
1635
|
+
language?: string;
|
|
1636
|
+
size?: number | number[];
|
|
1637
|
+
weight?: string;
|
|
1638
|
+
}
|
|
1639
|
+
/**
|
|
1640
|
+
* @public
|
|
1641
|
+
*/
|
|
1642
|
+
type CodeProps<E extends ElementType = 'pre'> = Props<CodeOwnProps, E>;
|
|
1643
|
+
/**
|
|
1644
|
+
* @public
|
|
1645
|
+
*/
|
|
1646
|
+
declare const Code: <E extends ElementType = 'pre'>(props: CodeProps<E>) => React.JSX.Element;
|
|
1647
|
+
/**
|
|
1648
|
+
* @public
|
|
1649
|
+
*/
|
|
1650
|
+
interface ContainerOwnProps extends BoxOwnProps, ResponsiveWidthProps {}
|
|
1651
|
+
/**
|
|
1652
|
+
* @public
|
|
1653
|
+
*/
|
|
1654
|
+
type ContainerProps<E extends ElementType = 'div'> = Props<ContainerOwnProps, E>;
|
|
1655
|
+
/**
|
|
1656
|
+
* The `Container` component wraps content layout in a defined set of widths.
|
|
1657
|
+
*
|
|
1658
|
+
* @public
|
|
1659
|
+
*/
|
|
1660
|
+
declare const Container: <E extends ElementType = 'div'>(props: ContainerProps<E>) => React.JSX.Element;
|
|
1661
|
+
/**
|
|
1662
|
+
* @internal
|
|
1663
|
+
*/
|
|
1664
|
+
interface ResponsiveWidthStyleProps {
|
|
1665
|
+
$width: (number | 'auto')[];
|
|
1666
|
+
}
|
|
1667
|
+
/**
|
|
1668
|
+
* @public
|
|
1669
|
+
*/
|
|
1670
|
+
interface FlexOwnProps extends Omit<BoxOwnProps, 'display'>, ResponsiveFlexProps, ResponsiveFlexItemProps {
|
|
1671
|
+
gap?: number | number[];
|
|
1672
|
+
}
|
|
1673
|
+
/**
|
|
1674
|
+
* @public
|
|
1675
|
+
*/
|
|
1676
|
+
type FlexProps<E extends ElementType = 'div'> = Props<FlexOwnProps, E>;
|
|
1677
|
+
/**
|
|
1678
|
+
* The `Flex` component is a wrapper component for flexible elements (`Box`, `Card` and `Flex`).
|
|
1679
|
+
*
|
|
1680
|
+
* @public
|
|
1681
|
+
*/
|
|
1682
|
+
declare const Flex: <E extends ElementType = 'div'>(props: FlexProps<E>) => React.JSX.Element;
|
|
1683
|
+
/**
|
|
1684
|
+
* @public
|
|
1685
|
+
*/
|
|
1686
|
+
interface GridOwnProps extends Omit<BoxOwnProps, 'display'>, ResponsiveGridProps {}
|
|
1687
|
+
/**
|
|
1688
|
+
* @public
|
|
1689
|
+
*/
|
|
1690
|
+
type GridProps<E extends ElementType = 'div'> = Props<GridOwnProps, E>;
|
|
1691
|
+
/**
|
|
1692
|
+
* The `Grid` component is for building 2-dimensional layers (based on CSS grid).
|
|
1693
|
+
*
|
|
1694
|
+
* @public
|
|
1695
|
+
*/
|
|
1696
|
+
declare const Grid: <E extends ElementType = 'div'>(props: GridProps<E>) => React.JSX.Element;
|
|
1697
|
+
/**
|
|
1698
|
+
* @public
|
|
1699
|
+
*/
|
|
1700
|
+
type TextAlign = 'left' | 'right' | 'center' | 'justify' | 'initial';
|
|
1701
|
+
/**
|
|
1702
|
+
* @public
|
|
1703
|
+
*/
|
|
1704
|
+
interface HeadingOwnProps {
|
|
1705
|
+
accent?: boolean;
|
|
1706
|
+
align?: TextAlign | TextAlign[];
|
|
1707
|
+
muted?: boolean;
|
|
1708
|
+
size?: number | number[];
|
|
1709
|
+
/**
|
|
1710
|
+
* Controls how overflowing text is treated.
|
|
1711
|
+
* Use `textOverflow="ellipsis"` to render text as a single line which is concatenated with a `…` symbol.
|
|
1712
|
+
* @beta
|
|
1713
|
+
*/
|
|
1714
|
+
textOverflow?: 'ellipsis';
|
|
1715
|
+
weight?: ThemeFontWeightKey$1;
|
|
1716
|
+
}
|
|
1717
|
+
/**
|
|
1718
|
+
* @public
|
|
1719
|
+
*/
|
|
1720
|
+
type HeadingProps<E extends ElementType = 'div'> = Props<HeadingOwnProps, E>;
|
|
1721
|
+
/**
|
|
1722
|
+
* Typographic headings.
|
|
1723
|
+
*
|
|
1724
|
+
* @public
|
|
1725
|
+
*/
|
|
1726
|
+
declare const Heading: <E extends ElementType = 'div'>(props: HeadingProps<E>) => React.JSX.Element;
|
|
1727
|
+
/**
|
|
1728
|
+
* @public
|
|
1729
|
+
*/
|
|
1730
|
+
interface KBDOwnProps {
|
|
1731
|
+
fontSize?: number | number[];
|
|
1732
|
+
padding?: number | number[];
|
|
1733
|
+
radius?: Radius | Radius[];
|
|
1734
|
+
}
|
|
1735
|
+
/**
|
|
1736
|
+
* @public
|
|
1737
|
+
*/
|
|
1738
|
+
type KBDProps<E extends ElementType = 'kbd'> = Props<KBDOwnProps, E>;
|
|
1739
|
+
/**
|
|
1740
|
+
* Used to define some text as keyboard input.
|
|
1741
|
+
*
|
|
1742
|
+
* @public
|
|
1743
|
+
*/
|
|
1744
|
+
declare const KBD: <E extends ElementType = 'kbd'>(props: KBDProps<E>) => React.JSX.Element;
|
|
1745
|
+
/**
|
|
1746
|
+
* @public
|
|
1747
|
+
*/
|
|
1748
|
+
interface LabelOwnProps {
|
|
1749
|
+
accent?: boolean;
|
|
1750
|
+
align?: TextAlign | TextAlign[];
|
|
1751
|
+
muted?: boolean;
|
|
1752
|
+
size?: number | number[];
|
|
1753
|
+
/**
|
|
1754
|
+
* Controls how overflowing text is treated.
|
|
1755
|
+
* Use `textOverflow="ellipsis"` to render text as a single line which is concatenated with a `…` symbol.
|
|
1756
|
+
* @beta
|
|
1757
|
+
*/
|
|
1758
|
+
textOverflow?: 'ellipsis';
|
|
1759
|
+
weight?: ThemeFontWeightKey$1;
|
|
1760
|
+
}
|
|
1761
|
+
/**
|
|
1762
|
+
* @public
|
|
1763
|
+
*/
|
|
1764
|
+
type LabelProps<E extends ElementType = 'div'> = Props<LabelOwnProps, E>;
|
|
1765
|
+
/**
|
|
1766
|
+
* Typographic labels.
|
|
1767
|
+
*
|
|
1768
|
+
* @public
|
|
1769
|
+
*/
|
|
1770
|
+
declare const Label: <E extends ElementType = 'div'>(props: LabelProps<E>) => React.JSX.Element;
|
|
1771
|
+
/**
|
|
1772
|
+
* @public
|
|
1773
|
+
*/
|
|
1774
|
+
interface RadioProps {
|
|
1775
|
+
customValidity?: string;
|
|
1776
|
+
}
|
|
1777
|
+
/**
|
|
1778
|
+
* The `Radio` component allows the user to select one option from a set.
|
|
1779
|
+
*
|
|
1780
|
+
* @public
|
|
1781
|
+
*/
|
|
1782
|
+
declare const Radio: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").HTMLProps<HTMLInputElement>, "as" | "type"> & RadioProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
1783
|
+
/**
|
|
1784
|
+
* @public
|
|
1785
|
+
*/
|
|
1786
|
+
interface SelectProps {
|
|
1787
|
+
fontSize?: number | number[];
|
|
1788
|
+
gap?: number | number[];
|
|
1789
|
+
padding?: number | number[];
|
|
1790
|
+
radius?: Radius | Radius[];
|
|
1791
|
+
/**
|
|
1792
|
+
* @deprecated Use `gap` instead.
|
|
1793
|
+
*/
|
|
1794
|
+
space?: never;
|
|
1795
|
+
customValidity?: string;
|
|
1796
|
+
}
|
|
1797
|
+
/**
|
|
1798
|
+
* The `Select` component provides control of options.
|
|
1799
|
+
*
|
|
1800
|
+
* @public
|
|
1801
|
+
*/
|
|
1802
|
+
declare const Select: import("react").ForwardRefExoticComponent<Omit<SelectProps & Omit<import("react").HTMLProps<HTMLSelectElement>, "as">, "ref"> & import("react").RefAttributes<HTMLSelectElement>>;
|
|
1803
|
+
/**
|
|
1804
|
+
* @public
|
|
1805
|
+
*/
|
|
1806
|
+
interface SpinnerProps {
|
|
1807
|
+
muted?: boolean;
|
|
1808
|
+
size?: number | number[];
|
|
1809
|
+
}
|
|
1810
|
+
/**
|
|
1811
|
+
* Indicate that something is loading for an indeterminate amount of time.
|
|
1812
|
+
*
|
|
1813
|
+
* @public
|
|
1814
|
+
*/
|
|
1815
|
+
declare const Spinner: import("react").ForwardRefExoticComponent<Omit<SpinnerProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
1816
|
+
/**
|
|
1817
|
+
* @public
|
|
1818
|
+
*/
|
|
1819
|
+
interface StackOwnProps extends BoxOwnProps {
|
|
1820
|
+
gap?: number | number[];
|
|
1821
|
+
/**
|
|
1822
|
+
* @deprecated Use `gap` instead.
|
|
1823
|
+
*/
|
|
1824
|
+
space?: never;
|
|
1825
|
+
}
|
|
1826
|
+
/**
|
|
1827
|
+
* @public
|
|
1828
|
+
*/
|
|
1829
|
+
type StackProps<E extends ElementType = 'div'> = Props<StackOwnProps, E>;
|
|
1830
|
+
/**
|
|
1831
|
+
* The `Stack` component is used to place elements on top of each other.
|
|
1832
|
+
*
|
|
1833
|
+
* @public
|
|
1834
|
+
*/
|
|
1835
|
+
declare const Stack: <E extends ElementType = 'div'>(props: StackProps<E>) => React.JSX.Element;
|
|
1836
|
+
/**
|
|
1837
|
+
* @public
|
|
1838
|
+
*/
|
|
1839
|
+
interface SwitchProps {
|
|
1840
|
+
indeterminate?: boolean;
|
|
1841
|
+
}
|
|
1842
|
+
/**
|
|
1843
|
+
* The `Switch` component allows the user to toggle a setting on and off.
|
|
1844
|
+
*
|
|
1845
|
+
* Extends all properties of an `<input type="checkbox" />` element, except type.
|
|
1846
|
+
*
|
|
1847
|
+
* @public
|
|
1848
|
+
*/
|
|
1849
|
+
declare const Switch: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").HTMLProps<HTMLInputElement>, "as" | "type"> & SwitchProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
1850
|
+
/**
|
|
1851
|
+
* @public
|
|
1852
|
+
*/
|
|
1853
|
+
interface TextOwnProps {
|
|
1854
|
+
accent?: boolean;
|
|
1855
|
+
align?: TextAlign | TextAlign[];
|
|
1856
|
+
/** When `true` the text color will be muted. */
|
|
1857
|
+
muted?: boolean;
|
|
1858
|
+
size?: number | number[];
|
|
1859
|
+
/**
|
|
1860
|
+
* Controls how overflowing text is treated.
|
|
1861
|
+
* Use `textOverflow="ellipsis"` to render text as a single line which is concatenated with a `…` symbol.
|
|
1862
|
+
* @beta
|
|
1863
|
+
*/
|
|
1864
|
+
textOverflow?: 'ellipsis';
|
|
1865
|
+
weight?: ThemeFontWeightKey$1;
|
|
1866
|
+
}
|
|
1867
|
+
/**
|
|
1868
|
+
* @public
|
|
1869
|
+
*/
|
|
1870
|
+
type TextProps<E extends ElementType = 'div'> = Props<TextOwnProps, E>;
|
|
1871
|
+
/**
|
|
1872
|
+
* The `Text` component is an agile, themed typographic element.
|
|
1873
|
+
*
|
|
1874
|
+
* @public
|
|
1875
|
+
*/
|
|
1876
|
+
declare const Text: <E extends ElementType = 'div'>(props: TextProps<E>) => React.JSX.Element;
|
|
1877
|
+
/**
|
|
1878
|
+
* @public
|
|
1879
|
+
*/
|
|
1880
|
+
interface TextAreaProps extends ResponsiveRadiusProps {
|
|
1881
|
+
/**
|
|
1882
|
+
* @beta
|
|
1883
|
+
*/
|
|
1884
|
+
__unstable_disableFocusRing?: boolean;
|
|
1885
|
+
border?: boolean;
|
|
1886
|
+
customValidity?: string;
|
|
1887
|
+
fontSize?: number | number[];
|
|
1888
|
+
padding?: number | number[];
|
|
1889
|
+
weight?: ThemeFontWeightKey$1;
|
|
1890
|
+
}
|
|
1891
|
+
/**
|
|
1892
|
+
* A multiline text input.
|
|
1893
|
+
*
|
|
1894
|
+
* @public
|
|
1895
|
+
*/
|
|
1896
|
+
declare const TextArea: import("react").ForwardRefExoticComponent<Omit<TextAreaProps & Omit<import("react").HTMLProps<HTMLTextAreaElement>, "as">, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
1897
|
+
/**
|
|
1898
|
+
* @public
|
|
1899
|
+
*/
|
|
1900
|
+
type TextInputClearButtonProps = ButtonOwnProps & Omit<React.HTMLProps<HTMLButtonElement>, 'as' | 'onClick' | 'onMouseDown' | 'ref'>;
|
|
1901
|
+
/**
|
|
1902
|
+
* @public
|
|
1903
|
+
*/
|
|
1904
|
+
type TextInputType = 'search' | 'date' | 'datetime-local' | 'email' | 'url' | 'month' | 'number' | 'password' | 'tel' | 'time' | 'text' | 'week' | 'color';
|
|
1905
|
+
/**
|
|
1906
|
+
* @public
|
|
1907
|
+
*/
|
|
1908
|
+
interface TextInputProps {
|
|
1909
|
+
/**
|
|
1910
|
+
* @beta
|
|
1911
|
+
*/
|
|
1912
|
+
__unstable_disableFocusRing?: boolean;
|
|
1913
|
+
border?: boolean;
|
|
1914
|
+
/**
|
|
1915
|
+
* @beta
|
|
1916
|
+
*/
|
|
1917
|
+
clearButton?: boolean | TextInputClearButtonProps;
|
|
1918
|
+
customValidity?: string;
|
|
1919
|
+
fontSize?: number | number[];
|
|
1920
|
+
icon?: React.ElementType | React.ReactNode;
|
|
1921
|
+
iconRight?: React.ElementType | React.ReactNode;
|
|
1922
|
+
/**
|
|
1923
|
+
* @beta
|
|
1924
|
+
*/
|
|
1925
|
+
onClear?: () => void;
|
|
1926
|
+
padding?: number | number[];
|
|
1927
|
+
prefix?: React.ReactNode;
|
|
1928
|
+
radius?: Radius | Radius[];
|
|
1929
|
+
/**
|
|
1930
|
+
* @deprecated Use `gap` instead.
|
|
1931
|
+
*/
|
|
1932
|
+
space?: never;
|
|
1933
|
+
gap?: number | number[];
|
|
1934
|
+
suffix?: React.ReactNode;
|
|
1935
|
+
type?: TextInputType;
|
|
1936
|
+
weight?: ThemeFontWeightKey$1;
|
|
1937
|
+
}
|
|
1938
|
+
/**
|
|
1939
|
+
* Single line text input.
|
|
1940
|
+
*
|
|
1941
|
+
* @public
|
|
1942
|
+
*/
|
|
1943
|
+
declare const TextInput: import("react").ForwardRefExoticComponent<Omit<TextInputProps & Omit<import("react").HTMLProps<HTMLInputElement>, "as" | "prefix" | "type">, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
1944
|
+
/**
|
|
1945
|
+
* @public
|
|
1946
|
+
*/
|
|
1947
|
+
interface TooltipProps extends Omit<LayerProps, 'as'> {
|
|
1948
|
+
/** @deprecated Use `fallbackPlacements` instead. */
|
|
1949
|
+
allowedAutoPlacements?: never;
|
|
1950
|
+
arrow?: boolean;
|
|
1951
|
+
boundaryElement?: HTMLElement | null;
|
|
1952
|
+
children?: React.JSX.Element;
|
|
1953
|
+
content?: React.ReactNode;
|
|
1954
|
+
disabled?: boolean;
|
|
1955
|
+
fallbackPlacements?: Placement[];
|
|
1956
|
+
padding?: number | number[];
|
|
1957
|
+
placement?: Placement;
|
|
1958
|
+
/** Whether or not to render the tooltip in a portal element. */
|
|
1959
|
+
portal?: boolean | string;
|
|
1960
|
+
radius?: number | number[];
|
|
1961
|
+
scheme?: ThemeColorSchemeKey$1;
|
|
1962
|
+
shadow?: number | number[];
|
|
1963
|
+
/**
|
|
1964
|
+
* Adds a delay to open or close the tooltip.
|
|
1965
|
+
*
|
|
1966
|
+
* If only a `number` is passed, it will be used for both opening and closing.
|
|
1967
|
+
*
|
|
1968
|
+
* If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
|
|
1969
|
+
*
|
|
1970
|
+
* @public
|
|
1971
|
+
* @defaultValue 0
|
|
1972
|
+
*/
|
|
1973
|
+
delay?: Delay;
|
|
1974
|
+
/**
|
|
1975
|
+
* Whether the tooltip should animate in and out.
|
|
1976
|
+
*
|
|
1977
|
+
* @beta
|
|
1978
|
+
* @defaultValue false
|
|
1979
|
+
*/
|
|
1980
|
+
animate?: boolean;
|
|
1981
|
+
}
|
|
1982
|
+
/**
|
|
1983
|
+
* Tooltips display information when hovering, focusing or tapping.
|
|
1984
|
+
*
|
|
1985
|
+
* @public
|
|
1986
|
+
*/
|
|
1987
|
+
declare const Tooltip: import("react").ForwardRefExoticComponent<Omit<TooltipProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "content">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
1988
|
+
/**
|
|
1989
|
+
* @beta
|
|
1990
|
+
*/
|
|
1991
|
+
interface TooltipDelayGroupContextValue {
|
|
1992
|
+
setIsGroupActive: (nextState: React.SetStateAction<boolean>, delay?: number | undefined) => void;
|
|
1993
|
+
setOpenTooltipId: (nextId: string | null, delay?: number | undefined) => void;
|
|
1994
|
+
openDelay: number;
|
|
1995
|
+
closeDelay: number;
|
|
1996
|
+
openTooltipId: string | null;
|
|
1997
|
+
}
|
|
1998
|
+
/**
|
|
1999
|
+
* @beta
|
|
2000
|
+
*/
|
|
2001
|
+
declare const TooltipDelayGroupContext: import("react").Context<TooltipDelayGroupContextValue | null>;
|
|
2002
|
+
/**
|
|
2003
|
+
* @public
|
|
2004
|
+
* */
|
|
2005
|
+
interface TooltipDelayGroupProviderProps {
|
|
2006
|
+
children?: React.ReactNode;
|
|
2007
|
+
/**
|
|
2008
|
+
* Handles the delays to open or close a tooltip inside a group
|
|
2009
|
+
*
|
|
2010
|
+
* If only a `number` is passed, it will be used for both opening and closing.
|
|
2011
|
+
*
|
|
2012
|
+
* If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
|
|
2013
|
+
*
|
|
2014
|
+
* @public
|
|
2015
|
+
*/
|
|
2016
|
+
delay: Delay;
|
|
2017
|
+
}
|
|
2018
|
+
/**
|
|
2019
|
+
* @public
|
|
2020
|
+
* Provides context for a group of tooltip elements that should share a delay
|
|
2021
|
+
* which temporarily becomes 1 ms after the first floating element of the group opens.
|
|
2022
|
+
*/
|
|
2023
|
+
declare function TooltipDelayGroupProvider(props: TooltipDelayGroupProviderProps): React.JSX.Element;
|
|
2024
|
+
/**
|
|
2025
|
+
* @beta
|
|
2026
|
+
*/
|
|
2027
|
+
declare function useTooltipDelayGroup(): TooltipDelayGroupContextValue | null;
|
|
2028
|
+
/**
|
|
2029
|
+
* @internal
|
|
2030
|
+
*/
|
|
2031
|
+
interface ThemeProps {
|
|
2032
|
+
theme: Theme$1;
|
|
2033
|
+
}
|
|
2034
|
+
/**
|
|
2035
|
+
* @internal
|
|
2036
|
+
*/
|
|
2037
|
+
interface ResponsiveFontSizeStyleProps {
|
|
2038
|
+
$size: number[];
|
|
2039
|
+
}
|
|
2040
|
+
/**
|
|
2041
|
+
* @internal
|
|
2042
|
+
*/
|
|
2043
|
+
interface FontWeightStyleProps {
|
|
2044
|
+
$weight?: ThemeFontWeightKey$1;
|
|
2045
|
+
}
|
|
2046
|
+
/**
|
|
2047
|
+
* @internal
|
|
2048
|
+
*/
|
|
2049
|
+
interface ResponsiveTextAlignStyleProps {
|
|
2050
|
+
$align: TextAlign[];
|
|
2051
|
+
}
|
|
2052
|
+
/**
|
|
2053
|
+
* @internal
|
|
2054
|
+
*/
|
|
2055
|
+
interface ResponsiveFontStyleProps extends FontWeightStyleProps, ResponsiveFontSizeStyleProps, ResponsiveTextAlignStyleProps {
|
|
2056
|
+
$accent?: boolean;
|
|
2057
|
+
$muted?: boolean;
|
|
2058
|
+
}
|
|
2059
|
+
/**
|
|
2060
|
+
* Get responsive CSS for the `code` font style.
|
|
2061
|
+
* @internal
|
|
2062
|
+
*/
|
|
2063
|
+
declare function responsiveCodeFontStyle(props: FontWeightStyleProps & ResponsiveFontSizeStyleProps & ThemeProps): CSSObject[];
|
|
2064
|
+
/**
|
|
2065
|
+
* Get responsive CSS for the `heading` font style.
|
|
2066
|
+
* @internal
|
|
2067
|
+
*/
|
|
2068
|
+
declare function responsiveHeadingFont(props: ResponsiveFontStyleProps & ThemeProps): CSSObject[];
|
|
2069
|
+
/**
|
|
2070
|
+
* Get responsive CSS for the `label` font style.
|
|
2071
|
+
* @internal
|
|
2072
|
+
*/
|
|
2073
|
+
declare function responsiveLabelFont(props: ResponsiveFontStyleProps & ThemeProps): CSSObject[];
|
|
2074
|
+
/**
|
|
2075
|
+
* Get responsive text align styles.
|
|
2076
|
+
* @internal
|
|
2077
|
+
*/
|
|
2078
|
+
declare function responsiveTextAlignStyle(props: ResponsiveTextAlignStyleProps & ThemeProps): CSSObject[];
|
|
2079
|
+
/**
|
|
2080
|
+
* Get responsive CSS for the `text` font style.
|
|
2081
|
+
* @internal
|
|
2082
|
+
*/
|
|
2083
|
+
declare function responsiveTextFont(props: ResponsiveFontStyleProps & ThemeProps): CSSObject[];
|
|
2084
|
+
/**
|
|
2085
|
+
* @internal
|
|
2086
|
+
*/
|
|
2087
|
+
declare function _fillCSSObject(keys: string[], value: string | number | CSSObject): CSSObject;
|
|
2088
|
+
/**
|
|
2089
|
+
* @public
|
|
2090
|
+
*/
|
|
2091
|
+
declare function rem(pixelValue: number): string | 0;
|
|
2092
|
+
/**
|
|
2093
|
+
* @internal
|
|
2094
|
+
*/
|
|
2095
|
+
declare function _responsive<T>(media: number[], values: T[], callback: (value: T, index: number, array: T[]) => CSSObject): CSSObject[];
|
|
2096
|
+
/**
|
|
2097
|
+
* @internal
|
|
2098
|
+
*/
|
|
2099
|
+
declare function _getArrayProp<T = number>(val: T | T[] | undefined, defaultVal?: T[]): T[];
|
|
2100
|
+
/**
|
|
2101
|
+
* @internal
|
|
2102
|
+
*/
|
|
2103
|
+
declare function _getResponsiveSpace(theme: Theme$1, props: string[], spaceIndexes?: number[]): CSSObject[] | null;
|
|
2104
|
+
/**
|
|
2105
|
+
* @public
|
|
2106
|
+
*/
|
|
2107
|
+
interface ThemeColorProviderProps {
|
|
2108
|
+
children?: React.ReactNode;
|
|
2109
|
+
scheme?: ThemeColorSchemeKey$1;
|
|
2110
|
+
tone?: ThemeColorCardToneKey;
|
|
2111
|
+
}
|
|
2112
|
+
/**
|
|
2113
|
+
* @public
|
|
2114
|
+
*/
|
|
2115
|
+
declare function ThemeColorProvider(props: ThemeColorProviderProps): React.JSX.Element;
|
|
2116
|
+
/**
|
|
2117
|
+
* @public
|
|
2118
|
+
*/
|
|
2119
|
+
interface ThemeProviderProps {
|
|
2120
|
+
children?: React.ReactNode;
|
|
2121
|
+
scheme?: ThemeColorSchemeKey$1;
|
|
2122
|
+
theme?: RootTheme$1;
|
|
2123
|
+
tone?: ThemeColorCardToneKey;
|
|
2124
|
+
}
|
|
2125
|
+
/**
|
|
2126
|
+
* @public
|
|
2127
|
+
*/
|
|
2128
|
+
declare function ThemeProvider(props: ThemeProviderProps): React.JSX.Element;
|
|
2129
|
+
/**
|
|
2130
|
+
* @public
|
|
2131
|
+
*/
|
|
2132
|
+
interface ThemeContextValue {
|
|
2133
|
+
/** @deprecated No longer used */
|
|
2134
|
+
version: 0.0;
|
|
2135
|
+
scheme: ThemeColorSchemeKey$1;
|
|
2136
|
+
theme: RootTheme$1;
|
|
2137
|
+
tone: ThemeColorCardToneKey;
|
|
2138
|
+
}
|
|
2139
|
+
/**
|
|
2140
|
+
* @public
|
|
2141
|
+
*/
|
|
2142
|
+
declare function useRootTheme(): ThemeContextValue;
|
|
2143
|
+
/**
|
|
2144
|
+
* @public
|
|
2145
|
+
*/
|
|
2146
|
+
declare function useTheme(): Theme$1;
|
|
2147
|
+
/**
|
|
2148
|
+
* @public
|
|
2149
|
+
*/
|
|
2150
|
+
declare function useTheme_v2(): Theme_v2;
|
|
2151
|
+
/** @internal */
|
|
2152
|
+
declare const Arrow: import("react").ForwardRefExoticComponent<Omit<{
|
|
2153
|
+
width: number;
|
|
2154
|
+
height: number;
|
|
2155
|
+
radius?: number;
|
|
2156
|
+
} & Omit<HTMLProps<HTMLDivElement>, "height" | "width">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
2157
|
+
/**
|
|
2158
|
+
* @public
|
|
2159
|
+
*/
|
|
2160
|
+
interface BoundaryElementProviderProps {
|
|
2161
|
+
children: React.ReactNode;
|
|
2162
|
+
element: HTMLElement | null;
|
|
2163
|
+
}
|
|
2164
|
+
/**
|
|
2165
|
+
* @public
|
|
2166
|
+
*/
|
|
2167
|
+
declare function BoundaryElementProvider(props: BoundaryElementProviderProps): React.JSX.Element;
|
|
2168
|
+
/**
|
|
2169
|
+
* @public
|
|
2170
|
+
*/
|
|
2171
|
+
interface BoundaryElementContextValue {
|
|
2172
|
+
version: 0.0;
|
|
2173
|
+
element: HTMLElement | null;
|
|
2174
|
+
}
|
|
2175
|
+
/**
|
|
2176
|
+
* @public
|
|
2177
|
+
*/
|
|
2178
|
+
declare function useBoundaryElement(): BoundaryElementContextValue;
|
|
2179
|
+
/**
|
|
2180
|
+
* @internal
|
|
2181
|
+
* @deprecated ConditionalWrapper was removed in @sanity/ui v4. Inline the conditional wrapping logic instead.
|
|
2182
|
+
*/
|
|
2183
|
+
declare function ConditionalWrapper(_props?: never): never;
|
|
2184
|
+
/**
|
|
2185
|
+
* DO NOT USE IN PRODUCTION.
|
|
2186
|
+
* @beta
|
|
2187
|
+
*/
|
|
2188
|
+
interface MediaQueryProps {
|
|
2189
|
+
as?: React.ElementType | keyof React.JSX.IntrinsicElements;
|
|
2190
|
+
media?: number[];
|
|
2191
|
+
}
|
|
2192
|
+
/**
|
|
2193
|
+
* DO NOT USE IN PRODUCTION.
|
|
2194
|
+
* @beta
|
|
2195
|
+
*/
|
|
2196
|
+
declare const ElementQuery: import("react").ForwardRefExoticComponent<Omit<MediaQueryProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "media">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
2197
|
+
/**
|
|
2198
|
+
* DO NOT USE IN PRODUCTION
|
|
2199
|
+
* @beta
|
|
2200
|
+
*/
|
|
2201
|
+
type ErrorBoundaryProps = PropsWithChildren<{
|
|
2202
|
+
onCatch: (params: {
|
|
2203
|
+
error: Error;
|
|
2204
|
+
info: React.ErrorInfo;
|
|
2205
|
+
}) => void;
|
|
2206
|
+
}>;
|
|
2207
|
+
/**
|
|
2208
|
+
* DO NOT USE IN PRODUCTION
|
|
2209
|
+
* @beta
|
|
2210
|
+
*/
|
|
2211
|
+
interface ErrorBoundaryState {
|
|
2212
|
+
error: Error | null;
|
|
2213
|
+
}
|
|
2214
|
+
/**
|
|
2215
|
+
* DO NOT USE IN PRODUCTION
|
|
2216
|
+
* @beta
|
|
2217
|
+
*/
|
|
2218
|
+
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
2219
|
+
state: ErrorBoundaryState;
|
|
2220
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
2221
|
+
componentDidCatch(error: Error, info: React.ErrorInfo): void;
|
|
2222
|
+
render(): React.ReactNode;
|
|
2223
|
+
}
|
|
2224
|
+
/**
|
|
2225
|
+
* @public
|
|
2226
|
+
*/
|
|
2227
|
+
interface LayerProviderProps {
|
|
2228
|
+
children?: React.ReactNode;
|
|
2229
|
+
zOffset?: number | number[];
|
|
2230
|
+
}
|
|
2231
|
+
/**
|
|
2232
|
+
* @public
|
|
2233
|
+
*/
|
|
2234
|
+
declare function LayerProvider(props: LayerProviderProps): React.JSX.Element;
|
|
2235
|
+
/** @public */
|
|
2236
|
+
interface LayerContextValue {
|
|
2237
|
+
version: 0.0;
|
|
2238
|
+
isTopLayer: boolean;
|
|
2239
|
+
level?: number;
|
|
2240
|
+
registerChild: (childLevel?: number) => () => void;
|
|
2241
|
+
size: number;
|
|
2242
|
+
zIndex: number;
|
|
2243
|
+
}
|
|
2244
|
+
/**
|
|
2245
|
+
* @public
|
|
2246
|
+
*/
|
|
2247
|
+
declare function useLayer(): LayerContextValue;
|
|
2248
|
+
/**
|
|
2249
|
+
* @public
|
|
2250
|
+
*/
|
|
2251
|
+
interface PortalProps {
|
|
2252
|
+
children: React.ReactNode;
|
|
2253
|
+
/**
|
|
2254
|
+
* @beta This API might change. DO NOT USE IN PRODUCTION.
|
|
2255
|
+
*/
|
|
2256
|
+
__unstable_name?: string;
|
|
2257
|
+
}
|
|
2258
|
+
/**
|
|
2259
|
+
* @public
|
|
2260
|
+
*/
|
|
2261
|
+
declare function Portal(props: PortalProps): React.ReactPortal | null;
|
|
2262
|
+
/**
|
|
2263
|
+
* @public
|
|
2264
|
+
*/
|
|
2265
|
+
interface PortalProviderProps {
|
|
2266
|
+
/**
|
|
2267
|
+
* @deprecated Use `<BoundaryElementProvider element={...} />` instead
|
|
2268
|
+
*/
|
|
2269
|
+
boundaryElement?: HTMLElement | null;
|
|
2270
|
+
children: React.ReactNode;
|
|
2271
|
+
element?: HTMLElement | null;
|
|
2272
|
+
/**
|
|
2273
|
+
* @beta
|
|
2274
|
+
*/
|
|
2275
|
+
__unstable_elements?: Record<string, HTMLElement | null | undefined>;
|
|
2276
|
+
}
|
|
2277
|
+
/**
|
|
2278
|
+
* @public
|
|
2279
|
+
*/
|
|
2280
|
+
declare function PortalProvider(props: PortalProviderProps): React.JSX.Element;
|
|
2281
|
+
/**
|
|
2282
|
+
* @public
|
|
2283
|
+
*/
|
|
2284
|
+
interface PortalContextValue {
|
|
2285
|
+
version: 0.0;
|
|
2286
|
+
boundaryElement: HTMLElement | null;
|
|
2287
|
+
element: HTMLElement | null;
|
|
2288
|
+
elements?: Record<string, HTMLElement | null | undefined>;
|
|
2289
|
+
}
|
|
2290
|
+
/**
|
|
2291
|
+
* @public
|
|
2292
|
+
*/
|
|
2293
|
+
declare function usePortal(): PortalContextValue;
|
|
2294
|
+
/**
|
|
2295
|
+
* @public
|
|
2296
|
+
*/
|
|
2297
|
+
interface SrOnlyProps {
|
|
2298
|
+
as?: React.ElementType | keyof React.JSX.IntrinsicElements;
|
|
2299
|
+
children?: React.ReactNode;
|
|
2300
|
+
}
|
|
2301
|
+
/**
|
|
2302
|
+
* @public
|
|
2303
|
+
*/
|
|
2304
|
+
declare const SrOnly: import("react").ForwardRefExoticComponent<Omit<SrOnlyProps & Omit<import("react").HTMLProps<HTMLDivElement>, "aria-hidden" | "as">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
2305
|
+
/**
|
|
2306
|
+
* @beta
|
|
2307
|
+
*/
|
|
2308
|
+
interface VirtualListChangeOpts {
|
|
2309
|
+
fromIndex: number;
|
|
2310
|
+
gap: number;
|
|
2311
|
+
itemHeight: number;
|
|
2312
|
+
scrollHeight: number;
|
|
2313
|
+
scrollTop: number;
|
|
2314
|
+
toIndex: number;
|
|
2315
|
+
}
|
|
2316
|
+
/**
|
|
2317
|
+
* @beta
|
|
2318
|
+
*/
|
|
2319
|
+
interface VirtualListProps<Item = any> {
|
|
2320
|
+
as?: React.ElementType | keyof React.JSX.IntrinsicElements;
|
|
2321
|
+
gap?: number;
|
|
2322
|
+
getItemKey?: (item: Item, itemIndex: number) => string;
|
|
2323
|
+
items?: Item[];
|
|
2324
|
+
onChange?: (opts: VirtualListChangeOpts) => void;
|
|
2325
|
+
renderItem?: (item: Item) => React.ReactNode;
|
|
2326
|
+
}
|
|
2327
|
+
/**
|
|
2328
|
+
* @beta
|
|
2329
|
+
*/
|
|
2330
|
+
declare const VirtualList: import("react").ForwardRefExoticComponent<VirtualListProps<any> & StackOwnProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "onChange" | "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
2331
|
+
export { type ArrayPropPrimitive, Arrow, type Assign, Autocomplete, type AutocompleteInputChangeMsg, type AutocompleteInputFoocusMsg, type AutocompleteMsg, type AutocompleteOpenButtonProps, type AutocompleteProps, type AutocompleteRootBlurMsg, type AutocompleteRootClearMsg, type AutocompleteRootEscapeMsg, type AutocompleteRootOpenMsg, type AutocompleteRootSetActiveValueMsg, type AutocompleteRootSetListFocusedMsg, type AutocompleteState, type AutocompleteValueChangeMsg, Avatar, AvatarCounter, type AvatarCounterProps, type AvatarOwnProps, type AvatarPosition, type AvatarProps, type AvatarRootStyleProps, type AvatarSize, AvatarStack, type AvatarStackProps, type AvatarStatus, Badge, type BadgeMode, type BadgeOwnProps, type BadgeProps, type BadgeTone, type BaseAutocompleteOption, type BaseTheme, type BoundaryElementContextValue, BoundaryElementProvider, type BoundaryElementProviderProps, Box, type BoxDisplay, type BoxHeight, type BoxOverflow, type BoxOwnProps, type BoxProps, type BoxShadow, type BoxSizing, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonMode, type ButtonOwnProps, type ButtonProps, type ButtonTextAlign, type ButtonTone, type ButtonWidth, Card, type CardOwnProps, type CardProps, type CardStyleProps, type CardTone, Checkbox, type CheckboxProps, type ClickOutsideElements, type ClickOutsideEventElements, type ClickOutsideEventListener, type ClickOutsideListener, Code, type CodeOwnProps, type CodeProps, CodeSkeleton, type CodeSkeletonProps, type ComponentType, ConditionalWrapper, Container, type ContainerOwnProps, type ContainerProps, type Delay, Dialog, DialogContext, type DialogContextValue, type DialogPosition, type DialogProps, DialogProvider, type DialogProviderProps, ElementQuery, type ElementRectValue, type ElementSize, type ElementType, type EmptyProps, ErrorBoundary, type ErrorBoundaryProps, type ErrorBoundaryState, Flex, type FlexAlign, type FlexDirection, type FlexJustify, type FlexOwnProps, type FlexProps, type FlexValue, type FlexWrap, type FontWeightStyleProps, Grid, type GridAutoCols, type GridAutoFlow, type GridAutoRows, type GridItemColumn, type GridItemColumnEnd, type GridItemColumnStart, type GridItemRow, type GridItemRowEnd, type GridItemRowStart, type GridOwnProps, type GridProps, type HSL, Heading, type HeadingOwnProps, type HeadingProps, HeadingSkeleton, type HeadingSkeletonProps, Hotkeys, type HotkeysProps, Inline, type InlineOwnProps, type InlineProps, KBD, type KBDOwnProps, type KBDProps, Label, type LabelOwnProps, type LabelProps, LabelSkeleton, type LabelSkeletonProps, Layer, type LayerContextValue, type LayerProps, LayerProvider, type LayerProviderProps, type MediaQueryProps, Menu, MenuButton, type MenuButtonProps, MenuDivider, type MenuDividerProps, MenuGroup, type MenuGroupOwnProps, type MenuGroupProps, MenuItem, type MenuItemOwnProps, type MenuItemProps, type MenuProps, type PartialThemeColorBuilderOpts, type Placement, Popover, type PopoverMargins, type PopoverProps, type PopoverUpdateCallback, type PopoverWidth, Portal, type PortalContextValue, type PortalProps, PortalProvider, type PortalProviderProps, type Props, type RGB, Radio, type RadioProps, type Radius, type ResponsiveAvatarSizeStyleProps, type ResponsiveBorderProps, type ResponsiveBoxProps, type ResponsiveFlexItemProps, type ResponsiveFlexProps, type ResponsiveFontSizeStyleProps, type ResponsiveFontStyleProps, type ResponsiveGridItemProps, type ResponsiveGridProps, type ResponsiveMarginProps, type ResponsivePaddingProps, type ResponsiveRadiusProps, type ResponsiveShadowProps, type ResponsiveTextAlignStyleProps, type ResponsiveWidthProps, type ResponsiveWidthStyleProps, type RootTheme, Select, type SelectProps, type SelectableTone, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, SrOnly, type SrOnlyProps, Stack, type StackOwnProps, type StackProps, type Styles, Switch, type SwitchProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, type TagType, Text, type TextAlign, TextArea, type TextAreaProps, TextInput, type TextInputClearButtonProps, type TextInputProps, type TextInputType, type TextOwnProps, type TextProps, TextSkeleton, type TextSkeletonProps, type Theme, type ThemeAvatar, type ThemeColor, type ThemeColorBase, type ThemeColorBuilderOpts, type ThemeColorButton, type ThemeColorButtonModeKey, type ThemeColorButtonState, type ThemeColorButtonStates, type ThemeColorButtonTones, type ThemeColorCard, type ThemeColorCardState, type ThemeColorGenericState, type ThemeColorInput, type ThemeColorInputState, type ThemeColorInputStates, type ThemeColorMuted, type ThemeColorMutedTone, type ThemeColorName, ThemeColorProvider, type ThemeColorProviderProps, type ThemeColorScheme, type ThemeColorSchemeKey, type ThemeColorSchemes, type ThemeColorSelectable, type ThemeColorSelectableState, type ThemeColorSelectableStates, type ThemeColorSolid, type ThemeColorSolidTone, type ThemeColorSpot, type ThemeColorSpotKey, type ThemeColorSyntax, type ThemeColorToneKey, type ThemeContextValue, type ThemeFont, type ThemeFontKey, type ThemeFontSize, type ThemeFontWeight, type ThemeFontWeightKey, type ThemeFonts, type ThemeInput, type ThemeLayer, type ThemeProps, ThemeProvider, type ThemeProviderProps, type ThemeShadow, Toast, type ToastContextValue, type ToastParams, type ToastProps, ToastProvider, type ToastProviderProps, Tooltip, TooltipDelayGroupContext, type TooltipDelayGroupContextValue, TooltipDelayGroupProvider, type TooltipDelayGroupProviderProps, type TooltipProps, Tree, type TreeContextValue, TreeItem, type TreeItemProps, type TreeProps, type TreeState, VirtualList, type VirtualListChangeOpts, type VirtualListProps, type _ElementSizeListener, type _ElementSizeObserver, type _ElementSizeSubscriber, type _MediaStore, _ResizeObserver, _elementSizeObserver, _fillCSSObject, _getArrayProp, _getResponsiveSpace, _hasFocus, _isEnterToClickElement, _isScrollable, _raf, _raf2, _responsive, attemptFocus, containsOrEqualsElement, createColorTheme, focusFirstDescendant, focusLastDescendant, hexToRgb, hslToRgb, isFocusable, isHTMLAnchorElement, isHTMLButtonElement, isHTMLElement, isHTMLInputElement, isHTMLSelectElement, isHTMLTextAreaElement, multiply, parseColor, rem, responsiveCodeFontStyle, responsiveHeadingFont, responsiveLabelFont, responsiveTextAlignStyle, responsiveTextFont, rgbToHex, rgbToHsl, rgba, screen, studioTheme, useArrayProp, useBoundaryElement, useClickOutside, useClickOutsideEvent, useCustomValidity, useDialog, useElementRect, useElementSize, useForwardedRef, useGlobalKeyDown, useLayer, useMatchMedia, useMediaIndex, usePortal, usePrefersDark, usePrefersReducedMotion, useRootTheme, useTheme, useTheme_v2, useToast, useTooltipDelayGroup, useTree };
|
|
2332
|
+
//# sourceMappingURL=index.d.cts.map
|