@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.ts
CHANGED
|
@@ -1,403 +1,579 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import * as _$_sanity_color0 from "@sanity/color";
|
|
4
|
-
import { COLOR_HUES as HUES, COLOR_TINTS as TINTS } from "@sanity/color";
|
|
5
|
-
import * as _$react from "react";
|
|
6
|
-
import { Component, ComponentType as ComponentType$1, Context, ElementType as ElementType$1, ErrorInfo, ForwardedRef, MouseEventHandler, PropsWithChildren, ReactElement, ReactNode, ReactPortal, Ref } from "react";
|
|
7
|
-
import { Strategy } from "@floating-ui/react-dom";
|
|
8
|
-
import { HTMLMotionProps } from "motion/react";
|
|
9
|
-
export * from "@sanity/ui-tokens";
|
|
10
|
-
/** @internal */
|
|
11
|
-
declare const _BUTTON_STATES: readonly ["enabled", "hovered", "pressed", "disabled"];
|
|
12
|
-
/** @internal */
|
|
13
|
-
declare const _CODE_TOKEN_KEYS: readonly ["atrule", "attrName", "attrValue", "attribute", "boolean", "builtin", "cdata", "char", "class", "className", "constant", "deleted", "doctype", "entity", "function", "hexcode", "id", "important", "inserted", "keyword", "number", "operator", "property", "pseudoClass", "pseudoElement", "regex", "selector", "string", "symbol", "tag", "unit", "url", "variable"];
|
|
14
|
-
/** @internal */
|
|
15
|
-
declare const _INPUT_VALIDITY: readonly ["valid", "invalid"];
|
|
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.js";
|
|
2
|
+
import { Component, ElementType as ElementType$1, HTMLProps, PropsWithChildren, ReactNode, Ref } from "react";
|
|
16
3
|
/**
|
|
17
|
-
* Available avatar color mode values for the `_avatarColor` collection.
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* Avatar colors map to color hues: gray, red, orange, yellow, green,
|
|
21
|
-
* cyan, blue, purple, magenta.
|
|
22
|
-
*
|
|
23
4
|
* @public
|
|
5
|
+
* @deprecated Use `BaseTheme` from `@sanity/ui/theme` instead.
|
|
24
6
|
*/
|
|
25
|
-
|
|
26
|
-
/** @public */
|
|
27
|
-
declare const AVATAR_SIZE: readonly [0, 1, 2, 3];
|
|
28
|
-
/** @beta */
|
|
29
|
-
declare const BG_PATTERNS: readonly ["checkered", "halftone", "grid"];
|
|
30
|
-
/** @public */
|
|
31
|
-
declare const BORDER_STYLE: readonly ["default", "muted", "none"];
|
|
32
|
-
/** @public */
|
|
33
|
-
declare const BORDER_WIDTH: readonly [0, 1, 2];
|
|
34
|
-
/** @public */
|
|
35
|
-
declare const BUTTON_MODES: readonly ["default", "ghost", "bleed"];
|
|
7
|
+
type BaseTheme = BaseTheme$1;
|
|
36
8
|
/**
|
|
37
|
-
* Available card tone mode values for the `_cardTone` collection.
|
|
38
|
-
*
|
|
39
9
|
* @public
|
|
10
|
+
* @deprecated Use `ThemeBoxShadow` from `@sanity/ui/theme` instead.
|
|
40
11
|
*/
|
|
41
|
-
|
|
12
|
+
type BoxShadow = ThemeBoxShadow;
|
|
42
13
|
/**
|
|
43
|
-
* Available color scheme mode values for the `_colorScheme` collection.
|
|
44
|
-
*
|
|
45
14
|
* @public
|
|
15
|
+
* @deprecated Use `HSL` from `@sanity/ui/theme` instead.
|
|
46
16
|
*/
|
|
47
|
-
|
|
17
|
+
type HSL = HSL$1;
|
|
48
18
|
/**
|
|
49
|
-
* Available color variant types.
|
|
50
|
-
*
|
|
51
19
|
* @public
|
|
20
|
+
* @deprecated Use `RGB` from `@sanity/ui/theme` instead.
|
|
52
21
|
*/
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
|
|
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;
|
|
76
143
|
/**
|
|
77
144
|
* Assign properties from `U` to `T`, excluding properties that already exist in `T`.
|
|
78
145
|
*
|
|
79
146
|
* @public
|
|
80
147
|
*/
|
|
81
|
-
type Assign<T extends
|
|
148
|
+
type Assign<T extends object, U extends object> = Omit<T, keyof U> & U;
|
|
82
149
|
/** @public */
|
|
83
|
-
type EmptyProps =
|
|
150
|
+
type EmptyProps = object;
|
|
84
151
|
/** @public */
|
|
85
152
|
type TagType = keyof React.JSX.IntrinsicElements;
|
|
86
153
|
/** @public */
|
|
87
154
|
type ComponentType<P = any> = React.FunctionComponent<P> | React.ComponentClass<P> | React.ExoticComponent<P>;
|
|
88
155
|
/** @public */
|
|
89
|
-
type ElementType<P> = TagType | ComponentType<P>;
|
|
90
|
-
/**
|
|
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
|
+
*/
|
|
91
163
|
type Props<P extends EmptyProps, E extends ElementType<P>> = Assign<E extends TagType ? React.JSX.IntrinsicElements[E] : React.ComponentProps<E>, P & {
|
|
92
164
|
as?: E;
|
|
93
165
|
}>;
|
|
94
166
|
/**
|
|
95
|
-
* Placement of floating UI elements.
|
|
96
|
-
*
|
|
97
167
|
* @public
|
|
98
168
|
*/
|
|
99
|
-
type
|
|
100
|
-
/** @public */
|
|
101
|
-
type Delay = number | Partial<{
|
|
102
|
-
open: number;
|
|
103
|
-
close: number;
|
|
104
|
-
}>;
|
|
105
|
-
/** @public */
|
|
106
|
-
declare const DEFAULT_BOX_ELEMENT = "div";
|
|
107
|
-
/** @public */
|
|
108
|
-
type BoxOwnProps = BoxStyleProps;
|
|
109
|
-
/** @public */
|
|
110
|
-
type BoxElementType = 'a' | 'article' | 'aside' | 'blockquote' | 'body' | 'button' | 'details' | 'div' | 'header' | 'fieldset' | 'figure' | 'figcaption' | 'footer' | 'form' | 'html' | 'iframe' | 'kbd' | 'label' | 'legend' | 'li' | 'main' | 'nav' | 'ol' | 'pre' | 'section' | 'span' | 'summary' | 'table' | 'tbody' | 'td' | 'tfoot' | 'th' | 'thead' | 'tr' | 'ul' | ComponentType;
|
|
111
|
-
/** @public */
|
|
112
|
-
type BoxProps<E extends BoxElementType = BoxElementType> = Props<BoxOwnProps, E>;
|
|
169
|
+
type BoxSizing = 'content' | 'border';
|
|
113
170
|
/**
|
|
114
|
-
* The `Box` component is a basic layout wrapper component which provides utility properties
|
|
115
|
-
* for flex, margins and padding.
|
|
116
|
-
*
|
|
117
171
|
* @public
|
|
118
172
|
*/
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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[];
|
|
140
251
|
}
|
|
141
|
-
/** @public */
|
|
142
|
-
type CardElementType = BoxElementType;
|
|
143
|
-
/** @public */
|
|
144
|
-
type CardProps<E extends CardElementType = CardElementType> = Props<CardOwnProps, E>;
|
|
145
252
|
/**
|
|
146
|
-
* The `Card` component acts much like a `Box`, but with a background and foreground color.
|
|
147
|
-
* Components within a `Card` inherit its colors.
|
|
148
|
-
*
|
|
149
253
|
* @public
|
|
150
254
|
*/
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
/** A callback that fires when the layer becomes the top layer when it was not the top layer before. */
|
|
157
|
-
onActivate?: (props: {
|
|
158
|
-
activeElement: HTMLElement | null;
|
|
159
|
-
}) => void;
|
|
160
|
-
zOffset?: ResponsiveProp$1<number>;
|
|
255
|
+
interface ResponsiveBoxProps {
|
|
256
|
+
display?: BoxDisplay | BoxDisplay[];
|
|
257
|
+
height?: BoxHeight | BoxHeight[];
|
|
258
|
+
overflow?: BoxOverflow | BoxOverflow[];
|
|
259
|
+
sizing?: BoxSizing | BoxSizing[];
|
|
161
260
|
}
|
|
162
|
-
/**
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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[];
|
|
170
284
|
/**
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* @beta
|
|
174
|
-
* @defaultValue false
|
|
285
|
+
* @deprecated Use `gridTemplateColumns` instead.
|
|
175
286
|
*/
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
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[];
|
|
184
297
|
}
|
|
185
|
-
/** @public */
|
|
186
|
-
type PopoverLayerProps = Assign<HTMLMotionProps<'div'>, PopoverLayerOwnProps>;
|
|
187
298
|
/**
|
|
188
|
-
* @
|
|
299
|
+
* @public
|
|
189
300
|
*/
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
type PopoverUpdateCallback = () => void;
|
|
193
|
-
/** @public */
|
|
194
|
-
type PopoverWidth = Exclude<ContainerWidth, 'auto'>;
|
|
195
|
-
/** @public */
|
|
196
|
-
type PopoverOwnProps = Omit<PopoverLayerOwnProps, 'maxWidth'> & {
|
|
197
|
-
/** @beta */__unstable_distance?: number;
|
|
301
|
+
interface ResponsiveGridItemProps {
|
|
302
|
+
gridColumn?: GridItemColumn | GridItemColumn[];
|
|
198
303
|
/**
|
|
199
|
-
* @
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
304
|
+
* @deprecated Use `gridColumn` instead.
|
|
305
|
+
*/
|
|
306
|
+
column?: never;
|
|
307
|
+
gridColumnStart?: GridItemColumnStart | GridItemColumnStart[];
|
|
203
308
|
/**
|
|
204
|
-
* @deprecated
|
|
309
|
+
* @deprecated Use `gridColumnStart` instead.
|
|
205
310
|
*/
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
ref: ForwardedRef<HTMLElement>;
|
|
209
|
-
}>;
|
|
311
|
+
columnStart?: never;
|
|
312
|
+
gridColumnEnd?: GridItemColumnEnd | GridItemColumnEnd[];
|
|
210
313
|
/**
|
|
211
|
-
*
|
|
212
|
-
* - by flipping on its side axis
|
|
213
|
-
* - by resizing
|
|
214
|
-
*
|
|
215
|
-
* Note that:
|
|
216
|
-
* - setting `preventOverflow` to `true` also prevents overflow on its side axis
|
|
217
|
-
* - setting `matchReferenceWidth` to `true` also causes the popover to resize
|
|
218
|
-
*
|
|
219
|
-
* @defaultValue false
|
|
314
|
+
* @deprecated Use `gridColumnEnd` instead.
|
|
220
315
|
*/
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
disabled?: boolean;
|
|
224
|
-
fallbackPlacements?: Placement[];
|
|
225
|
-
floatingBoundary?: HTMLElement | null;
|
|
316
|
+
columnEnd?: never;
|
|
317
|
+
gridRow?: GridItemRow | GridItemRow[];
|
|
226
318
|
/**
|
|
227
|
-
*
|
|
228
|
-
* the current boundary by resizing.
|
|
229
|
-
*
|
|
230
|
-
* Note that setting `constrainSize` to `true` also causes the popover to resize
|
|
231
|
-
*
|
|
232
|
-
* @defaultValue false
|
|
319
|
+
* @deprecated Use `gridRow` instead.
|
|
233
320
|
*/
|
|
234
|
-
|
|
321
|
+
row?: never;
|
|
322
|
+
gridRowStart?: GridItemRowStart | GridItemRowStart[];
|
|
235
323
|
/**
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
* @beta
|
|
239
|
-
* @defaultValue false
|
|
324
|
+
* @deprecated Use `gridRowStart` instead.
|
|
240
325
|
*/
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
placement?: Placement;
|
|
326
|
+
rowStart?: never;
|
|
327
|
+
gridRowEnd?: GridItemRowEnd | GridItemRowEnd[];
|
|
244
328
|
/**
|
|
245
|
-
*
|
|
246
|
-
* fallback placements in order. Whichever fits in the viewport first.
|
|
247
|
-
*
|
|
248
|
-
* When 'autoPlacement', the initial placement and all fallback placements are evaluated
|
|
249
|
-
* and the placement with the most viewport space available.
|
|
250
|
-
*
|
|
251
|
-
* Option is only relevant if either `constrainSize` or `preventOverflow` is `true`
|
|
252
|
-
*/
|
|
253
|
-
placementStrategy?: 'flip' | 'autoPlacement'; /** Whether or not to render the popover in a portal element. */
|
|
254
|
-
portal?: boolean | string;
|
|
255
|
-
preventOverflow?: boolean;
|
|
256
|
-
referenceBoundary?: HTMLElement | null;
|
|
257
|
-
/**
|
|
258
|
-
* When defined, the popover will be positioned relative to this element.
|
|
259
|
-
* The children of the popover won't be rendered.
|
|
329
|
+
* @deprecated Use `gridRowEnd` instead.
|
|
260
330
|
*/
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
width?: ResponsiveProp$1<MaxWidth>;
|
|
264
|
-
};
|
|
265
|
-
/** @public */
|
|
266
|
-
type PopoverElementType = 'div';
|
|
267
|
-
/** @public */
|
|
268
|
-
type PopoverProps = Assign<PopoverLayerProps, PopoverOwnProps>;
|
|
331
|
+
rowEnd?: never;
|
|
332
|
+
}
|
|
269
333
|
/**
|
|
270
|
-
*
|
|
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.
|
|
271
387
|
*
|
|
272
388
|
* @public
|
|
273
389
|
*/
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
/** @public */
|
|
278
|
-
type TextOwnProps = TextStyleProps & TextOverflowStyleProps;
|
|
279
|
-
/** @public */
|
|
280
|
-
type TextElementType = 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label' | 'li' | 'p' | 'span' | 'summary' | 'time' | ComponentType;
|
|
281
|
-
/** @public */
|
|
282
|
-
type TextProps<E extends TextElementType = TextElementType> = Props<TextOwnProps, E>;
|
|
390
|
+
interface BoxOwnProps extends ResponsiveFlexItemProps, ResponsiveBoxProps, ResponsiveGridItemProps, ResponsiveMarginProps, ResponsivePaddingProps {
|
|
391
|
+
forwardedAs?: ElementType;
|
|
392
|
+
}
|
|
283
393
|
/**
|
|
284
|
-
*
|
|
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.
|
|
285
410
|
*
|
|
286
411
|
* @public
|
|
287
412
|
*/
|
|
288
|
-
|
|
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;
|
|
289
435
|
/** @public */
|
|
290
|
-
|
|
436
|
+
type PopoverWidth = number | 'auto';
|
|
291
437
|
/** @public */
|
|
292
|
-
|
|
438
|
+
interface PopoverProps extends Omit<LayerProps, 'as'>, ResponsiveRadiusProps, ResponsiveShadowProps {
|
|
439
|
+
/** @beta */
|
|
440
|
+
__unstable_margins?: PopoverMargins;
|
|
293
441
|
/**
|
|
294
|
-
* Whether the
|
|
442
|
+
* Whether the popover should animate in and out.
|
|
295
443
|
*
|
|
296
444
|
* @beta
|
|
297
445
|
* @defaultValue false
|
|
298
446
|
*/
|
|
299
|
-
animate?: boolean;
|
|
447
|
+
animate?: boolean;
|
|
300
448
|
arrow?: boolean;
|
|
301
|
-
|
|
302
|
-
|
|
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;
|
|
303
464
|
content?: React.ReactNode;
|
|
465
|
+
disabled?: boolean;
|
|
466
|
+
fallbackPlacements?: Placement[];
|
|
467
|
+
floatingBoundary?: HTMLElement | null;
|
|
304
468
|
/**
|
|
305
|
-
*
|
|
469
|
+
* When `true`, set the maximum width to match the reference element, and also prevent overflow within
|
|
470
|
+
* the current boundary by resizing.
|
|
306
471
|
*
|
|
307
|
-
*
|
|
472
|
+
* Note that setting `constrainSize` to `true` also causes the popover to resize
|
|
308
473
|
*
|
|
309
|
-
*
|
|
474
|
+
* @defaultValue false
|
|
475
|
+
*/
|
|
476
|
+
matchReferenceWidth?: boolean;
|
|
477
|
+
/**
|
|
478
|
+
* When true, blocks all pointer interaction with elements beneath the popover until closed.
|
|
310
479
|
*
|
|
311
|
-
* @
|
|
312
|
-
* @defaultValue
|
|
480
|
+
* @beta
|
|
481
|
+
* @defaultValue false
|
|
313
482
|
*/
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
placement?: Placement;
|
|
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. */
|
|
319
499
|
portal?: boolean | string;
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
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;
|
|
323
508
|
tone?: CardTone;
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
type TooltipProps<E extends TooltipElementType = TooltipElementType> = Props<TooltipOwnProps, E>;
|
|
509
|
+
/** @beta */
|
|
510
|
+
updateRef?: Ref<PopoverUpdateCallback | undefined>;
|
|
511
|
+
width?: PopoverWidth | PopoverWidth[];
|
|
512
|
+
}
|
|
329
513
|
/**
|
|
330
|
-
*
|
|
514
|
+
* The `Popover` component is used to display some content on top of another.
|
|
331
515
|
*
|
|
332
516
|
* @public
|
|
333
517
|
*/
|
|
334
|
-
declare
|
|
335
|
-
/**
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
/** @public */
|
|
361
|
-
declare const DEFAULT_TEXT_INPUT_ELEMENT = "input";
|
|
362
|
-
/** @public */
|
|
363
|
-
type TextInputClearButtonProps = Omit<ButtonProps<'button'>, 'as' | 'onClick' | 'onMouseDown'>;
|
|
364
|
-
/** @public */
|
|
365
|
-
type TextInputOwnProps = InputStyleProps & {
|
|
366
|
-
/**
|
|
367
|
-
* @beta
|
|
368
|
-
*/
|
|
369
|
-
__unstable_disableFocusRing?: boolean;
|
|
370
|
-
/**
|
|
371
|
-
* @beta
|
|
372
|
-
*/
|
|
373
|
-
clearButton?: boolean | TextInputClearButtonProps;
|
|
374
|
-
customValidity?: string;
|
|
375
|
-
icon?: ElementType$1 | ReactNode;
|
|
376
|
-
iconRight?: ElementType$1 | ReactNode;
|
|
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[];
|
|
377
544
|
/**
|
|
378
|
-
* @beta
|
|
545
|
+
* @beta Do not use in production, as this might change.
|
|
379
546
|
*/
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
suffix?: ReactNode;
|
|
547
|
+
loading?: boolean;
|
|
548
|
+
selected?: boolean;
|
|
383
549
|
/**
|
|
384
|
-
* @deprecated Use `
|
|
550
|
+
* @deprecated Use `gap` instead.
|
|
385
551
|
*/
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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'>;
|
|
392
574
|
/**
|
|
393
|
-
* Single line text input.
|
|
394
|
-
*
|
|
395
575
|
* @public
|
|
396
576
|
*/
|
|
397
|
-
declare function TextInput<E extends TextInputElementType = typeof DEFAULT_TEXT_INPUT_ELEMENT>(props: TextInputProps<E>): React.JSX.Element;
|
|
398
|
-
/** @public */
|
|
399
|
-
type AutocompleteOpenButtonProps = Omit<ButtonProps<'button'>, 'as'>;
|
|
400
|
-
/** @public */
|
|
401
577
|
interface BaseAutocompleteOption {
|
|
402
578
|
value: string;
|
|
403
579
|
}
|
|
@@ -475,71 +651,82 @@ interface AutocompleteValueChangeMsg {
|
|
|
475
651
|
* @internal
|
|
476
652
|
*/
|
|
477
653
|
type AutocompleteMsg = AutocompleteRootBlurMsg | AutocompleteRootClearMsg | AutocompleteRootEscapeMsg | AutocompleteRootOpenMsg | AutocompleteRootSetActiveValueMsg | AutocompleteRootSetListFocusedMsg | AutocompleteInputChangeMsg | AutocompleteInputFoocusMsg | AutocompleteValueChangeMsg;
|
|
478
|
-
/**
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
654
|
+
/**
|
|
655
|
+
* @public
|
|
656
|
+
*/
|
|
657
|
+
interface AutocompleteProps<Option extends BaseAutocompleteOption = BaseAutocompleteOption> {
|
|
482
658
|
border?: boolean;
|
|
483
659
|
customValidity?: string;
|
|
484
660
|
filterOption?: (query: string, option: Option) => boolean;
|
|
485
|
-
|
|
486
|
-
|
|
661
|
+
fontSize?: number | number[];
|
|
662
|
+
icon?: ElementType$1 | ReactNode;
|
|
663
|
+
id: string;
|
|
664
|
+
/** @beta */
|
|
665
|
+
listBox?: BoxProps;
|
|
487
666
|
loading?: boolean;
|
|
488
667
|
onChange?: (value: string) => void;
|
|
489
668
|
onQueryChange?: (query: string | null) => void;
|
|
490
|
-
onSelect?: (value: string) => void;
|
|
491
|
-
|
|
492
|
-
|
|
669
|
+
onSelect?: (value: string) => void;
|
|
670
|
+
/** @beta */
|
|
671
|
+
openButton?: boolean | AutocompleteOpenButtonProps;
|
|
672
|
+
/** @beta */
|
|
673
|
+
openOnFocus?: boolean;
|
|
674
|
+
/** The options to render. */
|
|
493
675
|
options?: Option[];
|
|
494
|
-
padding?:
|
|
495
|
-
popover?: Omit<PopoverProps, 'content' | 'onMouseEnter' | 'onMouseLeave' | 'open'>;
|
|
676
|
+
padding?: number | number[];
|
|
677
|
+
popover?: Omit<PopoverProps, 'content' | 'onMouseEnter' | 'onMouseLeave' | 'open'> & Omit<HTMLProps<HTMLDivElement>, 'as' | 'children' | 'content' | 'ref' | 'width'>;
|
|
496
678
|
prefix?: ReactNode;
|
|
497
|
-
radius?: Radius | Radius[];
|
|
498
|
-
|
|
499
|
-
|
|
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 */
|
|
500
685
|
renderPopover?: (props: {
|
|
501
686
|
content: React.JSX.Element | null;
|
|
502
687
|
hidden: boolean;
|
|
503
688
|
inputElement: HTMLInputElement | null;
|
|
504
689
|
onMouseEnter: () => void;
|
|
505
690
|
onMouseLeave: () => void;
|
|
506
|
-
}, ref:
|
|
691
|
+
}, ref: Ref<HTMLDivElement>) => ReactNode;
|
|
507
692
|
renderValue?: (value: string, option?: Option) => string;
|
|
508
693
|
suffix?: ReactNode;
|
|
694
|
+
/** The current value. */
|
|
509
695
|
value?: string;
|
|
510
|
-
}
|
|
511
|
-
/** @public */
|
|
512
|
-
type AutocompleteElementType = 'input' | ComponentType;
|
|
513
|
-
/** @public */
|
|
514
|
-
type AutocompleteProps<E extends AutocompleteElementType = AutocompleteElementType, Option extends BaseAutocompleteOption = BaseAutocompleteOption> = Props<AutocompleteOwnProps<Option>, E>;
|
|
696
|
+
}
|
|
515
697
|
/**
|
|
516
698
|
* The Autocomplete component is typically used for search components.
|
|
517
699
|
* It consists of a text input for writing a query, and properties for rendering suggestions.
|
|
518
700
|
*
|
|
519
701
|
* @public
|
|
520
702
|
*/
|
|
521
|
-
declare
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
|
|
526
|
-
|
|
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 {
|
|
527
710
|
maxLength?: number;
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
|
|
537
|
-
|
|
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
|
+
*/
|
|
538
725
|
type DialogPosition = 'absolute' | 'fixed';
|
|
539
|
-
/**
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
interface
|
|
726
|
+
/**
|
|
727
|
+
* @public
|
|
728
|
+
*/
|
|
729
|
+
interface DialogProps extends ResponsivePaddingProps, ResponsiveWidthProps {
|
|
543
730
|
/**
|
|
544
731
|
* @beta
|
|
545
732
|
*/
|
|
@@ -548,61 +735,55 @@ interface DialogOwnProps extends Omit<ContainerStyleProps, 'id' | 'position' | '
|
|
|
548
735
|
* @beta
|
|
549
736
|
*/
|
|
550
737
|
__unstable_hideCloseButton?: boolean;
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
*/
|
|
557
|
-
animate?: boolean;
|
|
558
|
-
cardRadius?: ResponsiveProp$1<Radius>;
|
|
559
|
-
contentRef?: ForwardedRef<HTMLDivElement>;
|
|
560
|
-
footer?: ReactNode;
|
|
561
|
-
header?: ReactNode;
|
|
738
|
+
cardRadius?: Radius | Radius[];
|
|
739
|
+
cardShadow?: number | number[];
|
|
740
|
+
contentRef?: React.ForwardedRef<HTMLDivElement>;
|
|
741
|
+
footer?: React.ReactNode;
|
|
742
|
+
header?: React.ReactNode;
|
|
562
743
|
id: string;
|
|
563
744
|
/** A callback that fires when the dialog becomes the top layer when it was not the top layer before. */
|
|
564
745
|
onActivate?: LayerProps['onActivate'];
|
|
565
746
|
onClickOutside?: () => void;
|
|
566
747
|
onClose?: () => void;
|
|
567
|
-
open?: boolean;
|
|
568
748
|
portal?: string;
|
|
569
|
-
position?:
|
|
749
|
+
position?: DialogPosition | DialogPosition[];
|
|
750
|
+
scheme?: ThemeColorSchemeKey$1;
|
|
751
|
+
zOffset?: number | number[];
|
|
570
752
|
/**
|
|
571
|
-
*
|
|
753
|
+
* Whether the dialog should animate in on mount.
|
|
754
|
+
*
|
|
755
|
+
* @beta
|
|
756
|
+
* @defaultValue false
|
|
572
757
|
*/
|
|
573
|
-
|
|
758
|
+
animate?: boolean;
|
|
574
759
|
}
|
|
575
|
-
/** @public */
|
|
576
|
-
type DialogElementType = 'div' | 'span' | ComponentType;
|
|
577
|
-
/** @public */
|
|
578
|
-
type DialogProps<E extends DialogElementType = DialogElementType> = Props<DialogOwnProps, E>;
|
|
579
760
|
/**
|
|
580
761
|
* The Dialog component.
|
|
581
762
|
*
|
|
582
763
|
* @public
|
|
583
764
|
*/
|
|
584
|
-
declare
|
|
765
|
+
declare const Dialog: import("react").ForwardRefExoticComponent<Omit<DialogProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "id" | "width">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
585
766
|
/**
|
|
586
767
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
587
768
|
* @beta
|
|
588
769
|
*/
|
|
589
770
|
interface DialogContextValue {
|
|
590
771
|
version: 0.0;
|
|
591
|
-
position?:
|
|
592
|
-
zOffset?:
|
|
772
|
+
position?: DialogPosition | DialogPosition[];
|
|
773
|
+
zOffset?: number | number[];
|
|
593
774
|
}
|
|
594
775
|
/**
|
|
595
776
|
* @internal
|
|
596
777
|
*/
|
|
597
|
-
declare const DialogContext: Context<DialogContextValue>;
|
|
778
|
+
declare const DialogContext: import("react").Context<DialogContextValue>;
|
|
598
779
|
/**
|
|
599
780
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
600
781
|
* @beta
|
|
601
782
|
*/
|
|
602
783
|
interface DialogProviderProps {
|
|
603
|
-
children?: ReactNode;
|
|
604
|
-
position?:
|
|
605
|
-
zOffset?:
|
|
784
|
+
children?: React.ReactNode;
|
|
785
|
+
position?: DialogPosition | DialogPosition[];
|
|
786
|
+
zOffset?: number | number[];
|
|
606
787
|
}
|
|
607
788
|
/**
|
|
608
789
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
@@ -614,235 +795,353 @@ declare function DialogProvider(props: DialogProviderProps): React.JSX.Element;
|
|
|
614
795
|
* @beta
|
|
615
796
|
*/
|
|
616
797
|
declare function useDialog(): DialogContextValue;
|
|
617
|
-
/**
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
interface
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
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
|
+
}
|
|
631
812
|
/**
|
|
632
813
|
* Represent hotkeys (a keyboard combination) with semantic `<kbd>` elements.
|
|
633
814
|
*
|
|
634
|
-
* @example
|
|
635
|
-
* ```tsx
|
|
636
|
-
* import {Hotkeys} from '@sanity/ui'
|
|
637
|
-
*
|
|
638
|
-
* <Hotkeys keys={['⌘', 'K']} />
|
|
639
|
-
* ```
|
|
640
|
-
*
|
|
641
815
|
* @public
|
|
642
816
|
*/
|
|
643
|
-
declare
|
|
644
|
-
/**
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
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;
|
|
649
830
|
'onClickOutside'?: (event: MouseEvent) => void;
|
|
650
831
|
'onEscape'?: () => void;
|
|
651
|
-
'onItemClick'?: (
|
|
832
|
+
'onItemClick'?: () => void;
|
|
652
833
|
'onItemSelect'?: (index: number) => void;
|
|
653
834
|
'originElement'?: HTMLElement | null;
|
|
654
835
|
'registerElement'?: (el: HTMLElement) => () => void;
|
|
655
836
|
'shouldFocus'?: 'first' | 'last' | null;
|
|
837
|
+
'gap'?: number | number[];
|
|
838
|
+
/**
|
|
839
|
+
* @deprecated Use `gap` instead.
|
|
840
|
+
*/
|
|
841
|
+
'space'?: never;
|
|
656
842
|
'aria-labelledby'?: string;
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
type MenuElementType = 'div' | 'span' | ComponentType;
|
|
660
|
-
/** @public */
|
|
661
|
-
type MenuProps<E extends MenuElementType = MenuElementType> = Props<MenuOwnProps, E>;
|
|
843
|
+
'onBlurCapture'?: (event: FocusEvent) => void;
|
|
844
|
+
}
|
|
662
845
|
/**
|
|
663
846
|
* The `Menu` component is a building block for application menus.
|
|
664
847
|
*
|
|
665
848
|
* @public
|
|
666
849
|
*/
|
|
667
|
-
declare
|
|
668
|
-
/**
|
|
669
|
-
|
|
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 {
|
|
670
855
|
/**
|
|
671
856
|
* @beta Do not use in production.
|
|
672
857
|
*/
|
|
673
858
|
__unstable_disableRestoreFocusOnClose?: boolean;
|
|
674
|
-
|
|
859
|
+
/**
|
|
860
|
+
* @deprecated Use `popover={{boundaryElement: element}}` instead.
|
|
861
|
+
*/
|
|
862
|
+
boundaryElement?: never;
|
|
863
|
+
button: React.JSX.Element;
|
|
675
864
|
id: string;
|
|
676
|
-
menu?:
|
|
865
|
+
menu?: React.JSX.Element;
|
|
677
866
|
onClose?: () => void;
|
|
678
867
|
onOpen?: () => void;
|
|
868
|
+
/**
|
|
869
|
+
* @deprecated Use `popover={{placement: 'top'}}` instead.
|
|
870
|
+
*/
|
|
871
|
+
placement?: never;
|
|
679
872
|
popover?: Omit<PopoverProps, 'content' | 'open'>;
|
|
680
|
-
|
|
681
|
-
}
|
|
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
|
+
}
|
|
682
891
|
/**
|
|
683
892
|
* The `MenuButton` component follows the WAI-ARIA specification for menu buttons.
|
|
684
893
|
*
|
|
685
894
|
* @public
|
|
686
895
|
*/
|
|
687
|
-
declare
|
|
688
|
-
/**
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
type
|
|
692
|
-
/**
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
/**
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
/**
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
icon?: ElementType
|
|
706
|
-
menu?: Omit<MenuProps
|
|
707
|
-
padding?:
|
|
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[];
|
|
708
917
|
popover?: Omit<PopoverProps, 'content' | 'open'>;
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
/**
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
type
|
|
722
|
-
|
|
723
|
-
|
|
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[];
|
|
724
940
|
hotkeys?: string[];
|
|
725
|
-
icon?: ElementType
|
|
726
|
-
iconRight?: ElementType
|
|
941
|
+
icon?: React.ElementType | React.ReactNode;
|
|
942
|
+
iconRight?: React.ElementType | React.ReactNode;
|
|
727
943
|
pressed?: boolean;
|
|
728
944
|
selected?: boolean;
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
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 {
|
|
742
1026
|
/**
|
|
743
|
-
* The `id` of the
|
|
1027
|
+
* The `id` of the correlating `TabPanel` component.
|
|
744
1028
|
*/
|
|
745
1029
|
'aria-controls': string;
|
|
746
1030
|
'id': string;
|
|
1031
|
+
'icon'?: React.ElementType | React.ReactNode;
|
|
747
1032
|
'focused'?: boolean;
|
|
1033
|
+
'fontSize'?: number | number[];
|
|
748
1034
|
'label'?: React.ReactNode;
|
|
749
|
-
'
|
|
1035
|
+
'padding'?: number | number[];
|
|
1036
|
+
'selected'?: boolean;
|
|
1037
|
+
'tone'?: ButtonTone;
|
|
750
1038
|
}
|
|
751
|
-
/** @public */
|
|
752
|
-
type TabElementType = 'button' | ComponentType;
|
|
753
|
-
/** @public */
|
|
754
|
-
type TabProps<E extends TabElementType = TabElementType> = Props<TabOwnProps, E>;
|
|
755
|
-
/** @public */
|
|
756
|
-
declare function Tab<E extends TabElementType = typeof DEFAULT_TAB_ELEMENT>(props: TabProps<E>): React.JSX.Element;
|
|
757
|
-
/** @public */
|
|
758
|
-
declare const DEFAULT_FLEX_ELEMENT = "div";
|
|
759
|
-
/** @public */
|
|
760
|
-
type FlexOwnProps = FlexStyleProps;
|
|
761
|
-
/** @public */
|
|
762
|
-
type FlexElementType = BoxElementType;
|
|
763
|
-
/** @public */
|
|
764
|
-
type FlexProps<E extends FlexElementType = FlexElementType> = Props<FlexOwnProps, E>;
|
|
765
1039
|
/**
|
|
766
|
-
*
|
|
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.
|
|
767
1060
|
*
|
|
768
1061
|
* @public
|
|
769
1062
|
*/
|
|
770
|
-
declare
|
|
771
|
-
/**
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
interface
|
|
775
|
-
|
|
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>;
|
|
776
1069
|
}
|
|
777
|
-
/**
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
/**
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
/** @public */
|
|
786
|
-
type TabPanelOwnProps = BoxOwnProps & {
|
|
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 {
|
|
787
1078
|
/**
|
|
788
|
-
* The `id` of the
|
|
1079
|
+
* The `id` of the correlating `Tab` component.
|
|
789
1080
|
*/
|
|
790
1081
|
'aria-labelledby': string;
|
|
791
1082
|
'id': string;
|
|
792
|
-
}
|
|
793
|
-
/**
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
/**
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
/** @internal */
|
|
802
|
-
type ToastOwnProps = RadiusStyleProps & {
|
|
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 {
|
|
803
1092
|
closable?: boolean;
|
|
804
|
-
description?: ReactNode;
|
|
805
|
-
onClose
|
|
806
|
-
|
|
1093
|
+
description?: React.ReactNode;
|
|
1094
|
+
onClose: () => void;
|
|
1095
|
+
radius?: number | number[];
|
|
1096
|
+
title?: React.ReactNode;
|
|
807
1097
|
status?: 'error' | 'warning' | 'success' | 'info';
|
|
808
1098
|
duration?: number;
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
type ToastElementType = 'li' | ComponentType;
|
|
812
|
-
/** @internal */
|
|
813
|
-
type ToastProps<E extends ToastElementType = ToastElementType> = Props<ToastOwnProps, E>;
|
|
1099
|
+
updatedAt?: number;
|
|
1100
|
+
}
|
|
814
1101
|
/**
|
|
815
1102
|
* The `Toast` component gives feedback to users when an action has taken place.
|
|
816
1103
|
*
|
|
817
|
-
* Toasts can be closed with a close button, or auto-dismiss
|
|
1104
|
+
* Toasts can be closed with a close button, or auto-dismiss after a certain timeout.
|
|
818
1105
|
*
|
|
819
|
-
* @
|
|
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
|
|
820
1121
|
*/
|
|
821
|
-
declare function Toast<E extends ToastElementType = typeof DEFAULT_TOAST_ELEMENT>(props: ToastProps<E>): React.JSX.Element;
|
|
822
|
-
/** @internal */
|
|
823
|
-
type ToastLayerOwnProps = GapStyleProps & PaddingStyleProps;
|
|
824
|
-
/** @internal */
|
|
825
|
-
type ToastLayerElementType = 'ul' | ComponentType;
|
|
826
|
-
/** @internal */
|
|
827
|
-
type ToastLayerProps<E extends ToastLayerElementType = ToastLayerElementType> = Props<ToastLayerOwnProps, E>;
|
|
828
|
-
/** @public */
|
|
829
1122
|
interface ToastProviderProps extends Omit<ToastLayerProps, 'children'> {
|
|
830
1123
|
children?: React.ReactNode;
|
|
831
|
-
zOffset?:
|
|
1124
|
+
zOffset?: number | number[];
|
|
832
1125
|
}
|
|
833
|
-
/**
|
|
1126
|
+
/**
|
|
1127
|
+
* @public
|
|
1128
|
+
*/
|
|
834
1129
|
declare function ToastProvider(props: ToastProviderProps): React.JSX.Element;
|
|
835
|
-
/**
|
|
1130
|
+
/**
|
|
1131
|
+
* @public
|
|
1132
|
+
*/
|
|
836
1133
|
interface ToastParams {
|
|
837
1134
|
closable?: boolean;
|
|
838
|
-
description?: ReactNode;
|
|
1135
|
+
description?: React.ReactNode;
|
|
839
1136
|
duration?: number;
|
|
840
1137
|
id?: string;
|
|
841
1138
|
onClose?: () => void;
|
|
842
|
-
title?: ReactNode;
|
|
1139
|
+
title?: React.ReactNode;
|
|
843
1140
|
status?: 'error' | 'warning' | 'success' | 'info';
|
|
844
1141
|
}
|
|
845
|
-
/**
|
|
1142
|
+
/**
|
|
1143
|
+
* @public
|
|
1144
|
+
*/
|
|
846
1145
|
interface ToastContextValue {
|
|
847
1146
|
version: 0.0;
|
|
848
1147
|
/**
|
|
@@ -853,822 +1152,1048 @@ interface ToastContextValue {
|
|
|
853
1152
|
*/
|
|
854
1153
|
push: (params: ToastParams) => string;
|
|
855
1154
|
}
|
|
856
|
-
/**
|
|
1155
|
+
/**
|
|
1156
|
+
* @public
|
|
1157
|
+
*/
|
|
857
1158
|
declare function useToast(): ToastContextValue;
|
|
858
|
-
/** @public */
|
|
859
|
-
declare const DEFAULT_STACK_ELEMENT = "div";
|
|
860
|
-
/** @public */
|
|
861
|
-
type StackOwnProps = StackStyleProps;
|
|
862
|
-
/** @public */
|
|
863
|
-
type StackElementType = BoxElementType;
|
|
864
|
-
/** @public */
|
|
865
|
-
type StackProps<E extends StackElementType = StackElementType> = Props<StackOwnProps, E>;
|
|
866
1159
|
/**
|
|
867
|
-
*
|
|
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).
|
|
868
1505
|
*
|
|
869
1506
|
* @public
|
|
870
1507
|
*/
|
|
871
|
-
declare
|
|
872
|
-
/** @beta */
|
|
873
|
-
declare const DEFAULT_TREE_ELEMENT = "div";
|
|
1508
|
+
declare const Avatar: <E extends ElementType = 'div'>(props: AvatarProps<E>) => React.JSX.Element;
|
|
874
1509
|
/**
|
|
875
|
-
*
|
|
876
|
-
* @beta
|
|
1510
|
+
* @public
|
|
877
1511
|
*/
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
/** @
|
|
882
|
-
|
|
1512
|
+
interface AvatarCounterProps {
|
|
1513
|
+
count: number;
|
|
1514
|
+
size?: AvatarSize | AvatarSize[];
|
|
1515
|
+
/** @deprecated No longer supported. */
|
|
1516
|
+
tone?: never;
|
|
1517
|
+
}
|
|
883
1518
|
/**
|
|
884
|
-
*
|
|
885
|
-
* @beta
|
|
1519
|
+
* @public
|
|
886
1520
|
*/
|
|
887
|
-
declare
|
|
888
|
-
/**
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
interface
|
|
892
|
-
|
|
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;
|
|
893
1531
|
}
|
|
894
|
-
/** @public */
|
|
895
|
-
type SelectableElementType = 'a' | 'button' | 'span' | ComponentType;
|
|
896
|
-
/** @public */
|
|
897
|
-
type SelectableProps<E extends SelectableElementType = SelectableElementType> = Props<SelectableOwnProps, E>;
|
|
898
|
-
/** @public */
|
|
899
|
-
declare function Selectable<E extends SelectableElementType = typeof DEFAULT_SELECTABLE_ELEMENT>(props: SelectableProps<E>): React.JSX.Element;
|
|
900
|
-
/** @beta */
|
|
901
|
-
declare const DEFAULT_TREE_ITEM_ELEMENT = "a";
|
|
902
|
-
/** @beta */
|
|
903
|
-
type TreeItemOwnProps = SelectableOwnProps & {
|
|
904
|
-
expanded?: boolean;
|
|
905
|
-
fontSize?: ResponsiveProp$1<FontTextSize>;
|
|
906
|
-
icon?: ElementType$1;
|
|
907
|
-
/**
|
|
908
|
-
* Allows passing a custom element type to the link component
|
|
909
|
-
* @internal
|
|
910
|
-
*/
|
|
911
|
-
linkAs?: SelectableElementType;
|
|
912
|
-
onClick?: MouseEventHandler<HTMLAnchorElement | HTMLLIElement>;
|
|
913
|
-
padding?: ResponsiveProp$1<Space>;
|
|
914
|
-
gap?: ResponsiveProp$1<Space>; /** @deprecated Use `gap` instead */
|
|
915
|
-
space?: never;
|
|
916
|
-
text?: ReactNode;
|
|
917
|
-
weight?: FontWeight;
|
|
918
|
-
};
|
|
919
|
-
/** @beta */
|
|
920
|
-
type TreeItemElementType = 'a' | 'li' | ComponentType;
|
|
921
|
-
/** @beta */
|
|
922
|
-
type TreeItemProps<E extends TreeItemElementType = TreeItemElementType> = Props<TreeItemOwnProps, E>;
|
|
923
1532
|
/**
|
|
924
|
-
*
|
|
925
|
-
* @beta
|
|
1533
|
+
* @public
|
|
926
1534
|
*/
|
|
927
|
-
declare
|
|
1535
|
+
declare const AvatarStack: import("react").ForwardRefExoticComponent<AvatarStackProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
928
1536
|
/**
|
|
929
|
-
* @
|
|
1537
|
+
* @internal
|
|
930
1538
|
*/
|
|
931
|
-
interface
|
|
932
|
-
|
|
933
|
-
element: HTMLElement;
|
|
934
|
-
expanded: boolean;
|
|
935
|
-
} | undefined;
|
|
1539
|
+
interface AvatarRootStyleProps {
|
|
1540
|
+
$color: ThemeColorAvatarColorKey;
|
|
936
1541
|
}
|
|
937
1542
|
/**
|
|
938
|
-
* @
|
|
1543
|
+
* @internal
|
|
939
1544
|
*/
|
|
940
|
-
interface
|
|
941
|
-
|
|
942
|
-
focusedElement: HTMLElement | null;
|
|
943
|
-
gap: ResponsiveProp$1<Space>;
|
|
944
|
-
level: number;
|
|
945
|
-
path: string[];
|
|
946
|
-
registerItem: (element: HTMLElement, path: string, expanded: boolean, selected: boolean) => void;
|
|
947
|
-
setExpanded: (path: string, expanded: boolean) => void;
|
|
948
|
-
setFocusedElement: (focusedElement: HTMLElement | null) => void;
|
|
949
|
-
state: TreeState;
|
|
1545
|
+
interface ResponsiveAvatarSizeStyleProps {
|
|
1546
|
+
$size: AvatarSize[];
|
|
950
1547
|
}
|
|
951
1548
|
/**
|
|
952
|
-
* @
|
|
1549
|
+
* @public
|
|
1550
|
+
* @deprecated No longer used
|
|
953
1551
|
*/
|
|
954
|
-
|
|
955
|
-
/**
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
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;
|
|
965
1565
|
}
|
|
966
|
-
/**
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
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;
|
|
973
1596
|
}
|
|
974
|
-
/** @beta */
|
|
975
|
-
type VirtualListElementType = 'div' | ComponentType;
|
|
976
|
-
/** @beta */
|
|
977
|
-
type VirtualListProps<E extends VirtualListElementType = VirtualListElementType, Item = any> = Props<VirtualListOwnProps<Item>, E>;
|
|
978
|
-
/** @beta */
|
|
979
|
-
declare function VirtualList<E extends VirtualListElementType = typeof DEFAULT_VIRTUAL_LIST_ELEMENT, Item = any>(props: VirtualListProps<E, Item>): React.JSX.Element;
|
|
980
1597
|
/**
|
|
981
|
-
* @
|
|
1598
|
+
* @public
|
|
982
1599
|
*/
|
|
983
|
-
|
|
1600
|
+
type CardProps<E extends ElementType = 'div'> = Props<CardOwnProps, E>;
|
|
984
1601
|
/**
|
|
985
|
-
*
|
|
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
|
|
986
1606
|
*/
|
|
987
|
-
declare
|
|
1607
|
+
declare const Card: <E extends ElementType = 'div'>(props: CardProps<E>) => React.JSX.Element;
|
|
988
1608
|
/**
|
|
989
1609
|
* @internal
|
|
990
1610
|
*/
|
|
991
|
-
|
|
1611
|
+
interface CardStyleProps {
|
|
1612
|
+
$checkered: boolean;
|
|
1613
|
+
$focusRing: boolean;
|
|
1614
|
+
$muted: boolean;
|
|
1615
|
+
$tone: ThemeColorToneKey;
|
|
1616
|
+
}
|
|
992
1617
|
/**
|
|
993
|
-
* @
|
|
1618
|
+
* @public
|
|
994
1619
|
*/
|
|
995
|
-
|
|
1620
|
+
interface CheckboxProps {
|
|
1621
|
+
indeterminate?: boolean;
|
|
1622
|
+
customValidity?: string;
|
|
1623
|
+
}
|
|
996
1624
|
/**
|
|
997
|
-
*
|
|
1625
|
+
* Checkboxes allow the user to select one or more items from a set.
|
|
1626
|
+
*
|
|
1627
|
+
* @public
|
|
998
1628
|
*/
|
|
999
|
-
declare
|
|
1629
|
+
declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").HTMLProps<HTMLInputElement>, "as" | "type"> & CheckboxProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
1000
1630
|
/**
|
|
1001
|
-
* @
|
|
1631
|
+
* @public
|
|
1002
1632
|
*/
|
|
1003
|
-
|
|
1633
|
+
interface CodeOwnProps {
|
|
1634
|
+
/** Define the language to use for syntax highlighting. */
|
|
1635
|
+
language?: string;
|
|
1636
|
+
size?: number | number[];
|
|
1637
|
+
weight?: string;
|
|
1638
|
+
}
|
|
1004
1639
|
/**
|
|
1005
|
-
* @
|
|
1640
|
+
* @public
|
|
1006
1641
|
*/
|
|
1007
|
-
|
|
1642
|
+
type CodeProps<E extends ElementType = 'pre'> = Props<CodeOwnProps, E>;
|
|
1008
1643
|
/**
|
|
1009
|
-
* @
|
|
1644
|
+
* @public
|
|
1010
1645
|
*/
|
|
1011
|
-
declare
|
|
1646
|
+
declare const Code: <E extends ElementType = 'pre'>(props: CodeProps<E>) => React.JSX.Element;
|
|
1012
1647
|
/**
|
|
1013
|
-
* @
|
|
1648
|
+
* @public
|
|
1014
1649
|
*/
|
|
1015
|
-
|
|
1650
|
+
interface ContainerOwnProps extends BoxOwnProps, ResponsiveWidthProps {}
|
|
1016
1651
|
/**
|
|
1017
|
-
* @
|
|
1652
|
+
* @public
|
|
1018
1653
|
*/
|
|
1019
|
-
|
|
1654
|
+
type ContainerProps<E extends ElementType = 'div'> = Props<ContainerOwnProps, E>;
|
|
1020
1655
|
/**
|
|
1021
|
-
*
|
|
1656
|
+
* The `Container` component wraps content layout in a defined set of widths.
|
|
1657
|
+
*
|
|
1658
|
+
* @public
|
|
1022
1659
|
*/
|
|
1023
|
-
declare
|
|
1660
|
+
declare const Container: <E extends ElementType = 'div'>(props: ContainerProps<E>) => React.JSX.Element;
|
|
1024
1661
|
/**
|
|
1025
1662
|
* @internal
|
|
1026
1663
|
*/
|
|
1027
|
-
|
|
1664
|
+
interface ResponsiveWidthStyleProps {
|
|
1665
|
+
$width: (number | 'auto')[];
|
|
1666
|
+
}
|
|
1028
1667
|
/**
|
|
1029
|
-
* @
|
|
1668
|
+
* @public
|
|
1030
1669
|
*/
|
|
1031
|
-
|
|
1670
|
+
interface FlexOwnProps extends Omit<BoxOwnProps, 'display'>, ResponsiveFlexProps, ResponsiveFlexItemProps {
|
|
1671
|
+
gap?: number | number[];
|
|
1672
|
+
}
|
|
1032
1673
|
/**
|
|
1033
|
-
* @
|
|
1674
|
+
* @public
|
|
1034
1675
|
*/
|
|
1035
|
-
|
|
1676
|
+
type FlexProps<E extends ElementType = 'div'> = Props<FlexOwnProps, E>;
|
|
1036
1677
|
/**
|
|
1037
|
-
*
|
|
1678
|
+
* The `Flex` component is a wrapper component for flexible elements (`Box`, `Card` and `Flex`).
|
|
1679
|
+
*
|
|
1680
|
+
* @public
|
|
1038
1681
|
*/
|
|
1039
|
-
declare
|
|
1682
|
+
declare const Flex: <E extends ElementType = 'div'>(props: FlexProps<E>) => React.JSX.Element;
|
|
1040
1683
|
/**
|
|
1041
|
-
* @
|
|
1684
|
+
* @public
|
|
1042
1685
|
*/
|
|
1043
|
-
|
|
1686
|
+
interface GridOwnProps extends Omit<BoxOwnProps, 'display'>, ResponsiveGridProps {}
|
|
1044
1687
|
/**
|
|
1045
|
-
* @
|
|
1688
|
+
* @public
|
|
1046
1689
|
*/
|
|
1047
|
-
|
|
1048
|
-
/** @public */
|
|
1049
|
-
type ClickOutsideEventListener = (event: MouseEvent) => void;
|
|
1050
|
-
/** @public */
|
|
1051
|
-
type ClickOutsideEventElements = (HTMLElement | null | (HTMLElement | null)[])[];
|
|
1052
|
-
/** @public */
|
|
1053
|
-
declare function useClickOutsideEvent(listener: ClickOutsideEventListener | false | undefined, elementsArg?: () => ClickOutsideEventElements, boundaryElement?: () => HTMLElement | null): void;
|
|
1690
|
+
type GridProps<E extends ElementType = 'div'> = Props<GridOwnProps, E>;
|
|
1054
1691
|
/**
|
|
1055
|
-
*
|
|
1692
|
+
* The `Grid` component is for building 2-dimensional layers (based on CSS grid).
|
|
1693
|
+
*
|
|
1694
|
+
* @public
|
|
1056
1695
|
*/
|
|
1057
|
-
declare
|
|
1058
|
-
current: null | {
|
|
1059
|
-
setCustomValidity: (validity: string) => void;
|
|
1060
|
-
};
|
|
1061
|
-
}, customValidity: string | undefined): void;
|
|
1696
|
+
declare const Grid: <E extends ElementType = 'div'>(props: GridProps<E>) => React.JSX.Element;
|
|
1062
1697
|
/**
|
|
1063
|
-
* @
|
|
1698
|
+
* @public
|
|
1064
1699
|
*/
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
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;
|
|
1068
1716
|
}
|
|
1069
1717
|
/**
|
|
1070
|
-
* @
|
|
1718
|
+
* @public
|
|
1071
1719
|
*/
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
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[];
|
|
1077
1734
|
}
|
|
1078
1735
|
/**
|
|
1079
|
-
* @
|
|
1736
|
+
* @public
|
|
1080
1737
|
*/
|
|
1081
|
-
type
|
|
1738
|
+
type KBDProps<E extends ElementType = 'kbd'> = Props<KBDOwnProps, E>;
|
|
1082
1739
|
/**
|
|
1083
|
-
*
|
|
1740
|
+
* Used to define some text as keyboard input.
|
|
1741
|
+
*
|
|
1742
|
+
* @public
|
|
1084
1743
|
*/
|
|
1085
|
-
|
|
1086
|
-
|
|
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;
|
|
1087
1760
|
}
|
|
1088
1761
|
/**
|
|
1089
|
-
* @
|
|
1762
|
+
* @public
|
|
1090
1763
|
*/
|
|
1091
|
-
|
|
1092
|
-
|
|
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;
|
|
1093
1796
|
}
|
|
1094
1797
|
/**
|
|
1095
|
-
*
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
/**
|
|
1099
|
-
* Subscribe to the size of a DOM element.
|
|
1100
|
-
* @beta
|
|
1798
|
+
* The `Select` component provides control of options.
|
|
1799
|
+
*
|
|
1800
|
+
* @public
|
|
1101
1801
|
*/
|
|
1102
|
-
declare
|
|
1802
|
+
declare const Select: import("react").ForwardRefExoticComponent<Omit<SelectProps & Omit<import("react").HTMLProps<HTMLSelectElement>, "as">, "ref"> & import("react").RefAttributes<HTMLSelectElement>>;
|
|
1103
1803
|
/**
|
|
1104
|
-
*
|
|
1105
|
-
*
|
|
1106
|
-
* @param onKeyDown - The function to call when a keydown event is triggered.
|
|
1107
|
-
* @param options - The options to pass to the addEventListener function (example, capture: true)
|
|
1108
|
-
* @beta
|
|
1804
|
+
* @public
|
|
1109
1805
|
*/
|
|
1110
|
-
|
|
1806
|
+
interface SpinnerProps {
|
|
1807
|
+
muted?: boolean;
|
|
1808
|
+
size?: number | number[];
|
|
1809
|
+
}
|
|
1111
1810
|
/**
|
|
1112
|
-
*
|
|
1113
|
-
*
|
|
1114
|
-
* @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Required if the hook is called during SSR (https://dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
|
|
1811
|
+
* Indicate that something is loading for an indeterminate amount of time.
|
|
1115
1812
|
*
|
|
1116
1813
|
* @public
|
|
1117
1814
|
*/
|
|
1118
|
-
declare
|
|
1815
|
+
declare const Spinner: import("react").ForwardRefExoticComponent<Omit<SpinnerProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
1119
1816
|
/**
|
|
1120
|
-
* @
|
|
1817
|
+
* @public
|
|
1121
1818
|
*/
|
|
1122
|
-
interface
|
|
1123
|
-
|
|
1124
|
-
|
|
1819
|
+
interface StackOwnProps extends BoxOwnProps {
|
|
1820
|
+
gap?: number | number[];
|
|
1821
|
+
/**
|
|
1822
|
+
* @deprecated Use `gap` instead.
|
|
1823
|
+
*/
|
|
1824
|
+
space?: never;
|
|
1125
1825
|
}
|
|
1126
1826
|
/**
|
|
1127
|
-
*
|
|
1128
|
-
* @beta
|
|
1827
|
+
* @public
|
|
1129
1828
|
*/
|
|
1130
|
-
|
|
1829
|
+
type StackProps<E extends ElementType = 'div'> = Props<StackOwnProps, E>;
|
|
1131
1830
|
/**
|
|
1132
|
-
*
|
|
1133
|
-
*
|
|
1134
|
-
* @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://dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
|
|
1135
|
-
*
|
|
1136
|
-
* If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
|
|
1137
|
-
* 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
|
|
1138
|
-
* @example https://gist.github.com/stipsan/13c0cccf8dfc34f4b44bb1b984baf7df
|
|
1831
|
+
* The `Stack` component is used to place elements on top of each other.
|
|
1139
1832
|
*
|
|
1140
1833
|
* @public
|
|
1141
1834
|
*/
|
|
1142
|
-
declare
|
|
1835
|
+
declare const Stack: <E extends ElementType = 'div'>(props: StackProps<E>) => React.JSX.Element;
|
|
1143
1836
|
/**
|
|
1144
|
-
* Returns true if motion should be reduced
|
|
1145
|
-
*
|
|
1146
|
-
* @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://dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
|
|
1147
|
-
*
|
|
1148
|
-
* If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
|
|
1149
|
-
* 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
|
|
1150
|
-
* @example https://gist.github.com/stipsan/0c0f839a27842249cada893e9fb7767b
|
|
1151
|
-
*
|
|
1152
1837
|
* @public
|
|
1153
1838
|
*/
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
language?: string;
|
|
1157
|
-
value: React.ReactNode;
|
|
1158
|
-
}
|
|
1159
|
-
declare function Syntax(props: SyntaxProps): React.JSX.Element;
|
|
1160
|
-
/** @internal */
|
|
1161
|
-
declare const LazySyntax: _$react.LazyExoticComponent<typeof Syntax>;
|
|
1162
|
-
/** @public */
|
|
1163
|
-
type AvatarPosition = 'top' | 'bottom' | 'inside';
|
|
1164
|
-
/** @public */
|
|
1165
|
-
declare const DEFAULT_AVATAR_ELEMENT = "span";
|
|
1166
|
-
/** @public */
|
|
1167
|
-
interface AvatarOwnProps {
|
|
1168
|
-
/** @beta */
|
|
1169
|
-
__unstable_hideInnerStroke?: boolean;
|
|
1170
|
-
animateArrowFrom?: AvatarPosition;
|
|
1171
|
-
arrowPosition?: AvatarPosition;
|
|
1172
|
-
color?: AvatarColor;
|
|
1173
|
-
initials?: string;
|
|
1174
|
-
onImageLoadError?: (event: Error) => void;
|
|
1175
|
-
size?: ResponsiveProp$1<AvatarSize>;
|
|
1176
|
-
src?: string;
|
|
1177
|
-
title?: string;
|
|
1839
|
+
interface SwitchProps {
|
|
1840
|
+
indeterminate?: boolean;
|
|
1178
1841
|
}
|
|
1179
|
-
/** @public */
|
|
1180
|
-
type AvatarElementType = 'a' | 'button' | 'div' | 'span' | ComponentType;
|
|
1181
|
-
/** @public */
|
|
1182
|
-
type AvatarProps<E extends AvatarElementType = AvatarElementType> = Props<AvatarOwnProps, E>;
|
|
1183
1842
|
/**
|
|
1184
|
-
*
|
|
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.
|
|
1185
1846
|
*
|
|
1186
1847
|
* @public
|
|
1187
1848
|
*/
|
|
1188
|
-
declare
|
|
1189
|
-
/** @public */
|
|
1190
|
-
declare const DEFAULT_AVATAR_COUNTER_ELEMENT = "span";
|
|
1191
|
-
/** @public */
|
|
1192
|
-
interface AvatarCounterOwnProps {
|
|
1193
|
-
count: number;
|
|
1194
|
-
size?: ResponsiveProp$1<AvatarSize>;
|
|
1195
|
-
}
|
|
1196
|
-
/** @public */
|
|
1197
|
-
type AvatarCounterElementType = 'button' | 'div' | 'span' | ComponentType;
|
|
1198
|
-
/** @public */
|
|
1199
|
-
type AvatarCounterProps<E extends AvatarCounterElementType = AvatarCounterElementType> = Props<AvatarCounterOwnProps, E>;
|
|
1200
|
-
/** @public */
|
|
1201
|
-
declare function AvatarCounter<E extends AvatarCounterElementType = typeof DEFAULT_AVATAR_COUNTER_ELEMENT>(props: AvatarCounterProps<E>): React.JSX.Element;
|
|
1202
|
-
/** @public */
|
|
1203
|
-
declare const DEFAULT_AVATAR_STACK_ELEMENT = "span";
|
|
1204
|
-
/** @public */
|
|
1205
|
-
type AvatarStackChild = ReactElement<AvatarProps<'div'>> | null | undefined | false;
|
|
1206
|
-
/** @public */
|
|
1207
|
-
type AvatarStackOwnProps = Omit<BoxOwnProps, 'align' | 'alignItems' | 'display' | 'justify' | 'justifyContent'> & {
|
|
1208
|
-
children: AvatarStackChild | AvatarStackChild[];
|
|
1209
|
-
maxLength?: number;
|
|
1210
|
-
size?: ResponsiveProp$1<AvatarSize>;
|
|
1211
|
-
};
|
|
1212
|
-
/** @public */
|
|
1213
|
-
type AvatarStackElementType = 'div' | 'span' | ComponentType;
|
|
1214
|
-
/** @public */
|
|
1215
|
-
type AvatarStackProps<E extends AvatarStackElementType = AvatarStackElementType> = Props<AvatarStackOwnProps, E>;
|
|
1216
|
-
/** @public */
|
|
1217
|
-
declare function AvatarStack<E extends AvatarStackElementType = typeof DEFAULT_AVATAR_STACK_ELEMENT>(props: AvatarStackProps<E>): React.JSX.Element;
|
|
1218
|
-
/** @public */
|
|
1219
|
-
declare const DEFAULT_BADGE_ELEMENT = "span";
|
|
1220
|
-
/** @public */
|
|
1221
|
-
interface BadgeOwnProps extends BadgeStyleProps {
|
|
1222
|
-
fontSize?: ResponsiveProp$1<FontTextSize>;
|
|
1223
|
-
}
|
|
1224
|
-
/** @public */
|
|
1225
|
-
type BadgeElementType = 'div' | 'span' | ComponentType;
|
|
1226
|
-
/** @public */
|
|
1227
|
-
type BadgeProps<E extends BadgeElementType = BadgeElementType> = Props<BadgeOwnProps, E>;
|
|
1849
|
+
declare const Switch: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").HTMLProps<HTMLInputElement>, "as" | "type"> & SwitchProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
1228
1850
|
/**
|
|
1229
|
-
* Badges are used to tag resources.
|
|
1230
|
-
*
|
|
1231
1851
|
* @public
|
|
1232
1852
|
*/
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
/**
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
}
|
|
1247
|
-
/** @internal */
|
|
1248
|
-
type _CardCompatProviderComponent = ComponentType$1<{
|
|
1249
|
-
children?: ReactNode;
|
|
1250
|
-
tone: CardTone | 'inherit';
|
|
1251
|
-
scheme: ColorScheme;
|
|
1252
|
-
}>;
|
|
1253
|
-
/** @internal */
|
|
1254
|
-
interface _CardInternalContextValue {
|
|
1255
|
-
CompatProvider?: _CardCompatProviderComponent;
|
|
1256
|
-
root: boolean;
|
|
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;
|
|
1257
1866
|
}
|
|
1258
|
-
/** @public */
|
|
1259
|
-
declare function useCard(): CardContextValue;
|
|
1260
|
-
/** @public */
|
|
1261
|
-
declare const DEFAULT_CHECKBOX_ELEMENT = "input";
|
|
1262
|
-
/** @public */
|
|
1263
|
-
type CheckboxOwnProps = {
|
|
1264
|
-
indeterminate?: boolean;
|
|
1265
|
-
customValidity?: string;
|
|
1266
|
-
};
|
|
1267
|
-
/** @public */
|
|
1268
|
-
type CheckboxElementType = 'input' | ComponentType;
|
|
1269
|
-
/** @public */
|
|
1270
|
-
type CheckboxProps<E extends CheckboxElementType = CheckboxElementType> = Props<CheckboxOwnProps, E>;
|
|
1271
1867
|
/**
|
|
1272
|
-
* Checkboxes allow the user to select one or more items from a set.
|
|
1273
|
-
*
|
|
1274
1868
|
* @public
|
|
1275
1869
|
*/
|
|
1276
|
-
|
|
1277
|
-
/** @public */
|
|
1278
|
-
declare const DEFAULT_CODE_ELEMENT = "pre";
|
|
1279
|
-
/** @public */
|
|
1280
|
-
type CodeOwnProps = CodeStyleProps & {
|
|
1281
|
-
/** Define the language to use for syntax highlighting. */language?: string;
|
|
1282
|
-
};
|
|
1283
|
-
/** @public */
|
|
1284
|
-
type CodeElementType = 'div' | 'pre' | ComponentType;
|
|
1285
|
-
/** @public */
|
|
1286
|
-
type CodeProps<E extends CodeElementType = CodeElementType> = Props<CodeOwnProps, E>;
|
|
1287
|
-
/** @public */
|
|
1288
|
-
declare function Code<E extends CodeElementType = typeof DEFAULT_CODE_ELEMENT>(props: CodeProps<E>): React.JSX.Element;
|
|
1289
|
-
/** @public */
|
|
1290
|
-
declare const DEFAULT_CONTAINER_ELEMENT = "div";
|
|
1291
|
-
/** @public */
|
|
1292
|
-
type ContainerOwnProps = ContainerStyleProps;
|
|
1293
|
-
/** @public */
|
|
1294
|
-
type ContainerElementType = BoxElementType;
|
|
1295
|
-
/** @public */
|
|
1296
|
-
type ContainerProps<E extends ContainerElementType = ContainerElementType> = Props<ContainerOwnProps, E>;
|
|
1870
|
+
type TextProps<E extends ElementType = 'div'> = Props<TextOwnProps, E>;
|
|
1297
1871
|
/**
|
|
1298
|
-
* The `
|
|
1872
|
+
* The `Text` component is an agile, themed typographic element.
|
|
1299
1873
|
*
|
|
1300
1874
|
* @public
|
|
1301
1875
|
*/
|
|
1302
|
-
declare
|
|
1876
|
+
declare const Text: <E extends ElementType = 'div'>(props: TextProps<E>) => React.JSX.Element;
|
|
1303
1877
|
/**
|
|
1304
|
-
* @
|
|
1878
|
+
* @public
|
|
1305
1879
|
*/
|
|
1306
|
-
interface
|
|
1307
|
-
|
|
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;
|
|
1308
1890
|
}
|
|
1309
|
-
/** @public */
|
|
1310
|
-
declare const DEFAULT_GRID_ELEMENT = "div";
|
|
1311
|
-
/** @public */
|
|
1312
|
-
type GridOwnProps = GridStyleProps;
|
|
1313
|
-
/** @public */
|
|
1314
|
-
type GridElementType = BoxElementType;
|
|
1315
|
-
/** @public */
|
|
1316
|
-
type GridProps<E extends GridElementType = GridElementType> = Props<GridOwnProps, E>;
|
|
1317
1891
|
/**
|
|
1318
|
-
*
|
|
1892
|
+
* A multiline text input.
|
|
1319
1893
|
*
|
|
1320
1894
|
* @public
|
|
1321
1895
|
*/
|
|
1322
|
-
declare
|
|
1323
|
-
/** @public */
|
|
1324
|
-
declare const DEFAULT_HEADING_ELEMENT = "div";
|
|
1325
|
-
/** @public */
|
|
1326
|
-
type HeadingOwnProps = HeadingStyleProps & TextOverflowStyleProps;
|
|
1327
|
-
/** @public */
|
|
1328
|
-
type HeadingElementType = 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label' | 'span' | ComponentType;
|
|
1329
|
-
/** @public */
|
|
1330
|
-
type HeadingProps<E extends HeadingElementType = HeadingElementType> = Props<HeadingOwnProps, E>;
|
|
1896
|
+
declare const TextArea: import("react").ForwardRefExoticComponent<Omit<TextAreaProps & Omit<import("react").HTMLProps<HTMLTextAreaElement>, "as">, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
1331
1897
|
/**
|
|
1332
|
-
* Typographic headings.
|
|
1333
|
-
*
|
|
1334
1898
|
* @public
|
|
1335
1899
|
*/
|
|
1336
|
-
|
|
1337
|
-
/** @public */
|
|
1338
|
-
declare const DEFAULT_INLINE_ELEMENT = "div";
|
|
1339
|
-
/** @public */
|
|
1340
|
-
type InlineOwnProps = InlineStyleProps;
|
|
1341
|
-
/** @public */
|
|
1342
|
-
type InlineElementType = BoxElementType;
|
|
1343
|
-
/** @public */
|
|
1344
|
-
type InlineProps<E extends InlineElementType = InlineElementType> = Props<InlineOwnProps, E>;
|
|
1900
|
+
type TextInputClearButtonProps = ButtonOwnProps & Omit<React.HTMLProps<HTMLButtonElement>, 'as' | 'onClick' | 'onMouseDown' | 'ref'>;
|
|
1345
1901
|
/**
|
|
1346
|
-
* The `Inline` component is a layout utility for aligning and spacing items horizontally.
|
|
1347
|
-
*
|
|
1348
1902
|
* @public
|
|
1349
1903
|
*/
|
|
1350
|
-
|
|
1351
|
-
/** @public */
|
|
1352
|
-
declare const DEFAULT_KBD_ELEMENT = "kbd";
|
|
1353
|
-
/** @public */
|
|
1354
|
-
type KBDOwnProps = KBDStyleProps;
|
|
1355
|
-
/** @public */
|
|
1356
|
-
type KBDElementType = 'kbd' | ComponentType;
|
|
1357
|
-
/** @public */
|
|
1358
|
-
type KBDProps<E extends KBDElementType = KBDElementType> = Props<KBDOwnProps, E>;
|
|
1904
|
+
type TextInputType = 'search' | 'date' | 'datetime-local' | 'email' | 'url' | 'month' | 'number' | 'password' | 'tel' | 'time' | 'text' | 'week' | 'color';
|
|
1359
1905
|
/**
|
|
1360
|
-
* Used to define some text as keyboard input.
|
|
1361
|
-
*
|
|
1362
1906
|
* @public
|
|
1363
1907
|
*/
|
|
1364
|
-
|
|
1365
|
-
/**
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
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
|
+
}
|
|
1373
1938
|
/**
|
|
1374
|
-
*
|
|
1939
|
+
* Single line text input.
|
|
1375
1940
|
*
|
|
1376
1941
|
* @public
|
|
1377
1942
|
*/
|
|
1378
|
-
declare
|
|
1379
|
-
/**
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
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;
|
|
1394
1981
|
}
|
|
1395
|
-
/** @public */
|
|
1396
|
-
declare function useLayer(): LayerContextValue;
|
|
1397
|
-
/** @public */
|
|
1398
|
-
declare const DEFAULT_RADIO_ELEMENT = "input";
|
|
1399
|
-
/** @public */
|
|
1400
|
-
type RadioOwnProps = {
|
|
1401
|
-
customValidity?: string;
|
|
1402
|
-
};
|
|
1403
|
-
/** @public */
|
|
1404
|
-
type RadioElementType = 'input' | ComponentType;
|
|
1405
|
-
/** @public */
|
|
1406
|
-
type RadioProps<E extends RadioElementType = RadioElementType> = Props<RadioOwnProps, E>;
|
|
1407
1982
|
/**
|
|
1408
|
-
*
|
|
1983
|
+
* Tooltips display information when hovering, focusing or tapping.
|
|
1409
1984
|
*
|
|
1410
1985
|
* @public
|
|
1411
1986
|
*/
|
|
1412
|
-
declare
|
|
1413
|
-
/**
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
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
|
+
}
|
|
1424
2018
|
/**
|
|
1425
|
-
* The `Select` component provides control of options.
|
|
1426
|
-
*
|
|
1427
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.
|
|
1428
2022
|
*/
|
|
1429
|
-
declare function
|
|
1430
|
-
/** @beta */
|
|
1431
|
-
declare const DEFAULT_SKELETON_ELEMENT = "div";
|
|
2023
|
+
declare function TooltipDelayGroupProvider(props: TooltipDelayGroupProviderProps): React.JSX.Element;
|
|
1432
2024
|
/**
|
|
1433
|
-
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1434
2025
|
* @beta
|
|
1435
2026
|
*/
|
|
1436
|
-
|
|
1437
|
-
animated?: boolean;
|
|
1438
|
-
delay?: number;
|
|
1439
|
-
};
|
|
1440
|
-
/** @beta */
|
|
1441
|
-
type SkeletonElementType = 'div' | 'span' | ComponentType;
|
|
1442
|
-
/** @beta */
|
|
1443
|
-
type SkeletonProps<E extends SkeletonElementType = SkeletonElementType> = Props<SkeletonOwnProps, E>;
|
|
2027
|
+
declare function useTooltipDelayGroup(): TooltipDelayGroupContextValue | null;
|
|
1444
2028
|
/**
|
|
1445
|
-
*
|
|
1446
|
-
* @beta
|
|
2029
|
+
* @internal
|
|
1447
2030
|
*/
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
/** @beta */
|
|
1452
|
-
type CodeSkeletonOwnProps = SkeletonOwnProps & {
|
|
1453
|
-
size?: ResponsiveProp$1<FontCodeSize>;
|
|
1454
|
-
};
|
|
1455
|
-
/** @beta */
|
|
1456
|
-
type CodeSkeletonElementType = SkeletonElementType;
|
|
2031
|
+
interface ThemeProps {
|
|
2032
|
+
theme: Theme$1;
|
|
2033
|
+
}
|
|
1457
2034
|
/**
|
|
1458
|
-
*
|
|
1459
|
-
* @beta
|
|
2035
|
+
* @internal
|
|
1460
2036
|
*/
|
|
1461
|
-
|
|
2037
|
+
interface ResponsiveFontSizeStyleProps {
|
|
2038
|
+
$size: number[];
|
|
2039
|
+
}
|
|
1462
2040
|
/**
|
|
1463
|
-
*
|
|
1464
|
-
* @beta
|
|
2041
|
+
* @internal
|
|
1465
2042
|
*/
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
/** @beta */
|
|
1470
|
-
type HeadingSkeletonOwnProps = SkeletonOwnProps & {
|
|
1471
|
-
size?: ResponsiveProp$1<FontHeadingSize>;
|
|
1472
|
-
};
|
|
1473
|
-
/** @beta */
|
|
1474
|
-
type HeadingSkeletonElementType = SkeletonElementType;
|
|
2043
|
+
interface FontWeightStyleProps {
|
|
2044
|
+
$weight?: ThemeFontWeightKey$1;
|
|
2045
|
+
}
|
|
1475
2046
|
/**
|
|
1476
|
-
*
|
|
1477
|
-
* @beta
|
|
2047
|
+
* @internal
|
|
1478
2048
|
*/
|
|
1479
|
-
|
|
2049
|
+
interface ResponsiveTextAlignStyleProps {
|
|
2050
|
+
$align: TextAlign[];
|
|
2051
|
+
}
|
|
1480
2052
|
/**
|
|
1481
|
-
*
|
|
1482
|
-
* @beta
|
|
2053
|
+
* @internal
|
|
1483
2054
|
*/
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
type LabelSkeletonOwnProps = SkeletonOwnProps & {
|
|
1489
|
-
size?: ResponsiveProp$1<FontLabelSize>;
|
|
1490
|
-
};
|
|
1491
|
-
/** @beta */
|
|
1492
|
-
type LabelSkeletonElementType = SkeletonElementType;
|
|
2055
|
+
interface ResponsiveFontStyleProps extends FontWeightStyleProps, ResponsiveFontSizeStyleProps, ResponsiveTextAlignStyleProps {
|
|
2056
|
+
$accent?: boolean;
|
|
2057
|
+
$muted?: boolean;
|
|
2058
|
+
}
|
|
1493
2059
|
/**
|
|
1494
|
-
*
|
|
1495
|
-
* @
|
|
2060
|
+
* Get responsive CSS for the `code` font style.
|
|
2061
|
+
* @internal
|
|
1496
2062
|
*/
|
|
1497
|
-
|
|
2063
|
+
declare function responsiveCodeFontStyle(props: FontWeightStyleProps & ResponsiveFontSizeStyleProps & ThemeProps): CSSObject[];
|
|
1498
2064
|
/**
|
|
1499
|
-
*
|
|
1500
|
-
* @
|
|
2065
|
+
* Get responsive CSS for the `heading` font style.
|
|
2066
|
+
* @internal
|
|
1501
2067
|
*/
|
|
1502
|
-
declare function
|
|
1503
|
-
/** @beta */
|
|
1504
|
-
declare const DEFAULT_TEXT_SKELETON_ELEMENT = "div";
|
|
1505
|
-
/** @beta */
|
|
1506
|
-
type TextSkeletonOwnProps = SkeletonOwnProps & {
|
|
1507
|
-
size?: ResponsiveProp$1<FontTextSize>;
|
|
1508
|
-
};
|
|
1509
|
-
/** @beta */
|
|
1510
|
-
type TextSkeletonElementType = SkeletonElementType;
|
|
2068
|
+
declare function responsiveHeadingFont(props: ResponsiveFontStyleProps & ThemeProps): CSSObject[];
|
|
1511
2069
|
/**
|
|
1512
|
-
*
|
|
1513
|
-
* @
|
|
2070
|
+
* Get responsive CSS for the `label` font style.
|
|
2071
|
+
* @internal
|
|
1514
2072
|
*/
|
|
1515
|
-
|
|
2073
|
+
declare function responsiveLabelFont(props: ResponsiveFontStyleProps & ThemeProps): CSSObject[];
|
|
1516
2074
|
/**
|
|
1517
|
-
*
|
|
1518
|
-
* @
|
|
2075
|
+
* Get responsive text align styles.
|
|
2076
|
+
* @internal
|
|
1519
2077
|
*/
|
|
1520
|
-
declare function
|
|
1521
|
-
/**
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
/** @public */
|
|
1531
|
-
type SpinnerProps<E extends SpinnerElementType = SpinnerElementType> = Props<SpinnerOwnProps, E>;
|
|
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;
|
|
1532
2088
|
/**
|
|
1533
|
-
* Indicate that something is loading for an indeterminate amount of time.
|
|
1534
|
-
*
|
|
1535
2089
|
* @public
|
|
1536
2090
|
*/
|
|
1537
|
-
declare function
|
|
1538
|
-
/**
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
/**
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
/**
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
declare
|
|
1550
|
-
/** @public */
|
|
1551
|
-
type SwitchOwnProps = {
|
|
1552
|
-
indeterminate?: boolean;
|
|
1553
|
-
};
|
|
1554
|
-
/** @public */
|
|
1555
|
-
type SwitchElementType = 'input' | ComponentType;
|
|
1556
|
-
/** @public */
|
|
1557
|
-
type SwitchProps<E extends SwitchElementType = SwitchElementType> = Props<SwitchOwnProps, E>;
|
|
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;
|
|
1558
2104
|
/**
|
|
1559
|
-
* The `Switch` component allows the user to toggle a setting on and off.
|
|
1560
|
-
*
|
|
1561
|
-
* Extends all properties of an `<input type="checkbox" />` element, except type.
|
|
1562
|
-
*
|
|
1563
2105
|
* @public
|
|
1564
2106
|
*/
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
interface InlineCodeProps {
|
|
1570
|
-
children: React.ReactNode;
|
|
1571
|
-
/** Language to use for syntax highlighting. */
|
|
1572
|
-
language?: string;
|
|
2107
|
+
interface ThemeColorProviderProps {
|
|
2108
|
+
children?: React.ReactNode;
|
|
2109
|
+
scheme?: ThemeColorSchemeKey$1;
|
|
2110
|
+
tone?: ThemeColorCardToneKey;
|
|
1573
2111
|
}
|
|
1574
|
-
/** @public */
|
|
1575
|
-
declare function InlineCode(props: InlineCodeProps): React.JSX.Element;
|
|
1576
|
-
/** @public */
|
|
1577
|
-
declare const DEFAULT_TEXT_AREA_ELEMENT = "textarea";
|
|
1578
|
-
/** @public */
|
|
1579
|
-
type TextAreaOwnProps = TextAreaStyleProps & {
|
|
1580
|
-
/**
|
|
1581
|
-
* @beta
|
|
1582
|
-
*/
|
|
1583
|
-
__unstable_disableFocusRing?: boolean;
|
|
1584
|
-
customValidity?: string;
|
|
1585
|
-
};
|
|
1586
|
-
/** @public */
|
|
1587
|
-
type TextAreaElementType = 'textarea' | ComponentType;
|
|
1588
|
-
/** @public */
|
|
1589
|
-
type TextAreaProps<E extends TextAreaElementType = TextAreaElementType> = Props<TextAreaOwnProps, E>;
|
|
1590
2112
|
/**
|
|
1591
|
-
* A multiline text input.
|
|
1592
|
-
*
|
|
1593
2113
|
* @public
|
|
1594
2114
|
*/
|
|
1595
|
-
declare function
|
|
2115
|
+
declare function ThemeColorProvider(props: ThemeColorProviderProps): React.JSX.Element;
|
|
1596
2116
|
/**
|
|
1597
|
-
* @
|
|
2117
|
+
* @public
|
|
1598
2118
|
*/
|
|
1599
|
-
interface
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
}) => void;
|
|
1605
|
-
visibleTooltipId: string | undefined;
|
|
2119
|
+
interface ThemeProviderProps {
|
|
2120
|
+
children?: React.ReactNode;
|
|
2121
|
+
scheme?: ThemeColorSchemeKey$1;
|
|
2122
|
+
theme?: RootTheme$1;
|
|
2123
|
+
tone?: ThemeColorCardToneKey;
|
|
1606
2124
|
}
|
|
1607
2125
|
/**
|
|
1608
|
-
* @
|
|
2126
|
+
* @public
|
|
1609
2127
|
*/
|
|
1610
|
-
declare
|
|
2128
|
+
declare function ThemeProvider(props: ThemeProviderProps): React.JSX.Element;
|
|
1611
2129
|
/**
|
|
1612
2130
|
* @public
|
|
1613
|
-
|
|
1614
|
-
interface
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
*
|
|
1621
|
-
* If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
|
|
1622
|
-
*
|
|
1623
|
-
* @public
|
|
1624
|
-
*/
|
|
1625
|
-
delay?: Delay;
|
|
2131
|
+
*/
|
|
2132
|
+
interface ThemeContextValue {
|
|
2133
|
+
/** @deprecated No longer used */
|
|
2134
|
+
version: 0.0;
|
|
2135
|
+
scheme: ThemeColorSchemeKey$1;
|
|
2136
|
+
theme: RootTheme$1;
|
|
2137
|
+
tone: ThemeColorCardToneKey;
|
|
1626
2138
|
}
|
|
1627
2139
|
/**
|
|
1628
2140
|
* @public
|
|
1629
|
-
* Provides context for a group of tooltip elements that should share a delay
|
|
1630
|
-
* which temporarily becomes 0ms after the first tooltip of the group opens.
|
|
1631
2141
|
*/
|
|
1632
|
-
declare function
|
|
2142
|
+
declare function useRootTheme(): ThemeContextValue;
|
|
1633
2143
|
/**
|
|
1634
|
-
* @
|
|
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
|
|
1635
2159
|
*/
|
|
1636
|
-
declare function useTooltipDelayGroup(): TooltipDelayGroupContextValue | null;
|
|
1637
|
-
/** @public */
|
|
1638
2160
|
interface BoundaryElementProviderProps {
|
|
1639
|
-
children: ReactNode;
|
|
2161
|
+
children: React.ReactNode;
|
|
1640
2162
|
element: HTMLElement | null;
|
|
1641
2163
|
}
|
|
1642
|
-
/**
|
|
2164
|
+
/**
|
|
2165
|
+
* @public
|
|
2166
|
+
*/
|
|
1643
2167
|
declare function BoundaryElementProvider(props: BoundaryElementProviderProps): React.JSX.Element;
|
|
1644
|
-
/**
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
2168
|
+
/**
|
|
2169
|
+
* @public
|
|
2170
|
+
*/
|
|
2171
|
+
interface BoundaryElementContextValue {
|
|
1648
2172
|
version: 0.0;
|
|
1649
|
-
element:
|
|
1650
|
-
}
|
|
1651
|
-
/** @beta */
|
|
1652
|
-
declare const DEFAULT_ELEMENT_QUERY_ELEMENT = "div";
|
|
2173
|
+
element: HTMLElement | null;
|
|
2174
|
+
}
|
|
1653
2175
|
/**
|
|
1654
|
-
*
|
|
1655
|
-
* @beta
|
|
2176
|
+
* @public
|
|
1656
2177
|
*/
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
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;
|
|
1662
2184
|
/**
|
|
1663
2185
|
* DO NOT USE IN PRODUCTION.
|
|
1664
2186
|
* @beta
|
|
1665
2187
|
*/
|
|
1666
|
-
|
|
2188
|
+
interface MediaQueryProps {
|
|
2189
|
+
as?: React.ElementType | keyof React.JSX.IntrinsicElements;
|
|
2190
|
+
media?: number[];
|
|
2191
|
+
}
|
|
1667
2192
|
/**
|
|
1668
2193
|
* DO NOT USE IN PRODUCTION.
|
|
1669
2194
|
* @beta
|
|
1670
2195
|
*/
|
|
1671
|
-
declare
|
|
2196
|
+
declare const ElementQuery: import("react").ForwardRefExoticComponent<Omit<MediaQueryProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "media">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
1672
2197
|
/**
|
|
1673
2198
|
* DO NOT USE IN PRODUCTION
|
|
1674
2199
|
* @beta
|
|
@@ -1676,7 +2201,7 @@ declare function ElementQuery<E extends ElementQueryElementType = typeof DEFAULT
|
|
|
1676
2201
|
type ErrorBoundaryProps = PropsWithChildren<{
|
|
1677
2202
|
onCatch: (params: {
|
|
1678
2203
|
error: Error;
|
|
1679
|
-
info: ErrorInfo;
|
|
2204
|
+
info: React.ErrorInfo;
|
|
1680
2205
|
}) => void;
|
|
1681
2206
|
}>;
|
|
1682
2207
|
/**
|
|
@@ -1692,64 +2217,116 @@ interface ErrorBoundaryState {
|
|
|
1692
2217
|
*/
|
|
1693
2218
|
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
1694
2219
|
state: ErrorBoundaryState;
|
|
1695
|
-
static displayName: string;
|
|
1696
2220
|
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
1697
|
-
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
1698
|
-
render(): ReactNode;
|
|
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[];
|
|
1699
2230
|
}
|
|
2231
|
+
/**
|
|
2232
|
+
* @public
|
|
2233
|
+
*/
|
|
2234
|
+
declare function LayerProvider(props: LayerProviderProps): React.JSX.Element;
|
|
1700
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
|
+
*/
|
|
1701
2251
|
interface PortalProps {
|
|
1702
|
-
children: ReactNode;
|
|
2252
|
+
children: React.ReactNode;
|
|
1703
2253
|
/**
|
|
1704
2254
|
* @beta This API might change. DO NOT USE IN PRODUCTION.
|
|
1705
2255
|
*/
|
|
1706
2256
|
__unstable_name?: string;
|
|
1707
2257
|
}
|
|
1708
|
-
/**
|
|
1709
|
-
|
|
1710
|
-
|
|
2258
|
+
/**
|
|
2259
|
+
* @public
|
|
2260
|
+
*/
|
|
2261
|
+
declare function Portal(props: PortalProps): React.ReactPortal | null;
|
|
2262
|
+
/**
|
|
2263
|
+
* @public
|
|
2264
|
+
*/
|
|
1711
2265
|
interface PortalProviderProps {
|
|
1712
|
-
|
|
2266
|
+
/**
|
|
2267
|
+
* @deprecated Use `<BoundaryElementProvider element={...} />` instead
|
|
2268
|
+
*/
|
|
2269
|
+
boundaryElement?: HTMLElement | null;
|
|
2270
|
+
children: React.ReactNode;
|
|
1713
2271
|
element?: HTMLElement | null;
|
|
1714
2272
|
/**
|
|
1715
2273
|
* @beta
|
|
1716
2274
|
*/
|
|
1717
2275
|
__unstable_elements?: Record<string, HTMLElement | null | undefined>;
|
|
1718
2276
|
}
|
|
1719
|
-
/**
|
|
2277
|
+
/**
|
|
2278
|
+
* @public
|
|
2279
|
+
*/
|
|
1720
2280
|
declare function PortalProvider(props: PortalProviderProps): React.JSX.Element;
|
|
1721
|
-
/**
|
|
2281
|
+
/**
|
|
2282
|
+
* @public
|
|
2283
|
+
*/
|
|
1722
2284
|
interface PortalContextValue {
|
|
1723
2285
|
version: 0.0;
|
|
1724
2286
|
boundaryElement: HTMLElement | null;
|
|
1725
2287
|
element: HTMLElement | null;
|
|
1726
2288
|
elements?: Record<string, HTMLElement | null | undefined>;
|
|
1727
2289
|
}
|
|
1728
|
-
/**
|
|
2290
|
+
/**
|
|
2291
|
+
* @public
|
|
2292
|
+
*/
|
|
1729
2293
|
declare function usePortal(): PortalContextValue;
|
|
1730
|
-
/** @public */
|
|
1731
|
-
declare const DEFAULT_ROOT_ELEMENT = "html";
|
|
1732
|
-
/** @public */
|
|
1733
|
-
type RootOwnProps = RootStyleProps;
|
|
1734
|
-
/** @public */
|
|
1735
|
-
type RootElementType = 'html' | 'div';
|
|
1736
|
-
/** @public */
|
|
1737
|
-
type RootProps<E extends RootElementType = RootElementType> = Props<RootOwnProps, E>;
|
|
1738
2294
|
/**
|
|
1739
|
-
* The `Root` component.
|
|
1740
|
-
*
|
|
1741
2295
|
* @public
|
|
1742
2296
|
*/
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
boundaryElement: HTMLElement | null;
|
|
1747
|
-
children?: ReactNode;
|
|
1748
|
-
portalElement: HTMLElement | null;
|
|
1749
|
-
scheme: ColorScheme;
|
|
1750
|
-
tone: CardTone;
|
|
2297
|
+
interface SrOnlyProps {
|
|
2298
|
+
as?: React.ElementType | keyof React.JSX.IntrinsicElements;
|
|
2299
|
+
children?: React.ReactNode;
|
|
1751
2300
|
}
|
|
1752
|
-
/**
|
|
1753
|
-
|
|
1754
|
-
|
|
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 };
|
|
1755
2332
|
//# sourceMappingURL=index.d.ts.map
|