@sanity/ui 4.0.0-beta.7 → 4.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/portalProvider.cjs +3750 -0
- package/dist/_chunks/portalProvider.cjs.map +1 -0
- package/dist/_chunks/portalProvider.d.cts +1067 -0
- package/dist/_chunks/portalProvider.d.cts.map +1 -0
- package/dist/_chunks/portalProvider.d.ts +1067 -0
- package/dist/_chunks/portalProvider.d.ts.map +1 -0
- package/dist/_chunks/portalProvider.js +3300 -0
- package/dist/_chunks/portalProvider.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/_visual-editing.cjs +4 -0
- package/dist/_visual-editing.d.cts +2 -0
- package/dist/_visual-editing.d.ts +2 -0
- package/dist/_visual-editing.js +3 -0
- package/dist/index.cjs +3007 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1275 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +708 -1188
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2964 -4783
- 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 +65 -88
- 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,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
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"];
|
|
16
|
-
/**
|
|
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
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
declare const AVATAR_COLORS: _$_sanity_color0.ColorHueKey[];
|
|
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"];
|
|
36
|
-
/**
|
|
37
|
-
* Available card tone mode values for the `_cardTone` collection.
|
|
38
|
-
*
|
|
39
|
-
* @public
|
|
40
|
-
*/
|
|
41
|
-
declare const CARD_TONES: readonly ["default", "neutral", "primary", "suggest", "positive", "caution", "critical", "transparent"];
|
|
42
|
-
/**
|
|
43
|
-
* Available color scheme mode values for the `_colorScheme` collection.
|
|
44
|
-
*
|
|
45
|
-
* @public
|
|
46
|
-
*/
|
|
47
|
-
declare const COLOR_SCHEMES: readonly ["light", "dark"];
|
|
48
|
-
/**
|
|
49
|
-
* Available color variant types.
|
|
50
|
-
*
|
|
51
|
-
* @public
|
|
52
|
-
*/
|
|
53
|
-
declare const COLOR_VARIANTS: readonly ["tinted", "solid"];
|
|
54
|
-
/** @public */
|
|
55
|
-
declare const CONTAINER_SCALE: readonly [0, 1, 2, 3, 4, 5];
|
|
56
|
-
/** @public */
|
|
57
|
-
declare const CONTAINER: [...typeof CONTAINER_SCALE, 'auto'];
|
|
58
|
-
/** @public */
|
|
59
|
-
declare const ELEMENT_TONES: readonly ["default", "neutral", "primary", "suggest", "positive", "caution", "critical"];
|
|
60
|
-
/** @public */
|
|
61
|
-
declare const FONT_CODE_SIZE: readonly [0, 1, 2, 3, 4];
|
|
62
|
-
/** @public */
|
|
63
|
-
declare const FONT_HEADING_SIZE: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
64
|
-
/** @public */
|
|
65
|
-
declare const FONT_LABEL_SIZE: readonly [0, 1, 2, 3, 4, 5];
|
|
66
|
-
/** @public */
|
|
67
|
-
declare const FONT_TEXT_SIZE: readonly [0, 1, 2, 3, 4];
|
|
68
|
-
/** @public */
|
|
69
|
-
declare const FONT_WEIGHT: readonly ["regular", "medium", "semibold", "bold"];
|
|
70
|
-
/** @public */
|
|
71
|
-
declare const RADIUS: readonly [0, 1, 2, 3, 4, 5, 6, "full"];
|
|
72
|
-
/** @public */
|
|
73
|
-
declare const SHADOW: readonly [0, 1, 2, 3, 4, 5];
|
|
74
|
-
/** @public */
|
|
75
|
-
declare const SPACE: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
76
|
-
/**
|
|
77
|
-
* Assign properties from `U` to `T`, excluding properties that already exist in `T`.
|
|
78
|
-
*
|
|
79
|
-
* @public
|
|
80
|
-
*/
|
|
81
|
-
type Assign<T extends {}, U extends {}> = Omit<T, keyof U> & U;
|
|
82
|
-
/** @public */
|
|
83
|
-
type EmptyProps = {};
|
|
84
|
-
/** @public */
|
|
85
|
-
type TagType = keyof React.JSX.IntrinsicElements;
|
|
86
|
-
/** @public */
|
|
87
|
-
type ComponentType<P = any> = React.FunctionComponent<P> | React.ComponentClass<P> | React.ExoticComponent<P>;
|
|
88
|
-
/** @public */
|
|
89
|
-
type ElementType<P> = TagType | ComponentType<P>;
|
|
90
|
-
/** @public */
|
|
91
|
-
type Props<P extends EmptyProps, E extends ElementType<P>> = Assign<E extends TagType ? React.JSX.IntrinsicElements[E] : React.ComponentProps<E>, P & {
|
|
92
|
-
as?: E;
|
|
93
|
-
}>;
|
|
94
|
-
/**
|
|
95
|
-
* Placement of floating UI elements.
|
|
96
|
-
*
|
|
97
|
-
* @public
|
|
98
|
-
*/
|
|
99
|
-
type Placement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
|
|
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>;
|
|
113
|
-
/**
|
|
114
|
-
* The `Box` component is a basic layout wrapper component which provides utility properties
|
|
115
|
-
* for flex, margins and padding.
|
|
116
|
-
*
|
|
117
|
-
* @public
|
|
118
|
-
*/
|
|
119
|
-
declare function Box<E extends BoxElementType = typeof DEFAULT_BOX_ELEMENT>(props: BoxProps<E>): React.JSX.Element;
|
|
120
|
-
/** @public */
|
|
121
|
-
declare const DEFAULT_CARD_ELEMENT = "div";
|
|
122
|
-
/** @public */
|
|
123
|
-
interface CardOwnProps extends Omit<CardStyleProps, 'tone'> {
|
|
124
|
-
/**
|
|
125
|
-
* Do not use in production.
|
|
126
|
-
* @beta
|
|
127
|
-
* @deprecated Use `__unstable_pattern` instead.
|
|
128
|
-
*/
|
|
129
|
-
__unstable_checkered?: boolean;
|
|
130
|
-
/**
|
|
131
|
-
* Do not use in production.
|
|
132
|
-
* @beta
|
|
133
|
-
*/
|
|
134
|
-
__unstable_focusRing?: boolean;
|
|
135
|
-
disabled?: boolean;
|
|
136
|
-
pressed?: boolean;
|
|
137
|
-
selected?: boolean;
|
|
138
|
-
target?: string;
|
|
139
|
-
tone?: CardTone | 'inherit';
|
|
140
|
-
}
|
|
141
|
-
/** @public */
|
|
142
|
-
type CardElementType = BoxElementType;
|
|
143
|
-
/** @public */
|
|
144
|
-
type CardProps<E extends CardElementType = CardElementType> = Props<CardOwnProps, E>;
|
|
145
|
-
/**
|
|
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
|
-
* @public
|
|
150
|
-
*/
|
|
151
|
-
declare function Card<E extends CardElementType = typeof DEFAULT_CARD_ELEMENT>(props: CardProps<E>): React.JSX.Element;
|
|
152
|
-
/** @public */
|
|
153
|
-
declare const DEFAULT_LAYER_ELEMENT = "div";
|
|
154
|
-
/** @public */
|
|
155
|
-
interface LayerOwnProps extends CardOwnProps {
|
|
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>;
|
|
161
|
-
}
|
|
162
|
-
/** @public */
|
|
163
|
-
type LayerElementType = CardElementType;
|
|
164
|
-
/** @public */
|
|
165
|
-
type LayerProps<E extends LayerElementType = LayerElementType> = Props<LayerOwnProps, E>;
|
|
166
|
-
/** @public */
|
|
167
|
-
declare function Layer<E extends LayerElementType = typeof DEFAULT_LAYER_ELEMENT>(props: LayerProps<E>): React.JSX.Element;
|
|
168
|
-
/** @internal */
|
|
169
|
-
interface PopoverLayerOwnProps extends LayerOwnProps {
|
|
170
|
-
/**
|
|
171
|
-
* Whether the popover should animate in and out.
|
|
172
|
-
*
|
|
173
|
-
* @beta
|
|
174
|
-
* @defaultValue false
|
|
175
|
-
*/
|
|
176
|
-
animate?: boolean;
|
|
177
|
-
children?: React.ReactNode;
|
|
178
|
-
originX?: number;
|
|
179
|
-
originY?: number;
|
|
180
|
-
referenceWidth?: number;
|
|
181
|
-
strategy?: Strategy;
|
|
182
|
-
x?: number;
|
|
183
|
-
y?: number;
|
|
184
|
-
}
|
|
185
|
-
/** @public */
|
|
186
|
-
type PopoverLayerProps = Assign<HTMLMotionProps<'div'>, PopoverLayerOwnProps>;
|
|
187
|
-
/**
|
|
188
|
-
* @beta
|
|
189
|
-
*/
|
|
190
|
-
type PopoverMargins = [number, number, number, number];
|
|
191
|
-
/** @beta */
|
|
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;
|
|
198
|
-
/**
|
|
199
|
-
* @beta
|
|
200
|
-
* @deprecated Will be removed in the next major version */
|
|
201
|
-
__unstable_margins?: PopoverMargins; /** @beta */
|
|
202
|
-
__unstable_shift?: number;
|
|
203
|
-
/**
|
|
204
|
-
* @deprecated Will be removed in the next major version
|
|
205
|
-
*/
|
|
206
|
-
arrow?: boolean;
|
|
207
|
-
children?: ReactElement<{
|
|
208
|
-
ref: ForwardedRef<HTMLElement>;
|
|
209
|
-
}>;
|
|
210
|
-
/**
|
|
211
|
-
* When `true`, prevent overflow within the current boundary:
|
|
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
|
|
220
|
-
*/
|
|
221
|
-
constrainSize?: boolean;
|
|
222
|
-
content?: ReactNode;
|
|
223
|
-
disabled?: boolean;
|
|
224
|
-
fallbackPlacements?: Placement[];
|
|
225
|
-
floatingBoundary?: HTMLElement | null;
|
|
226
|
-
/**
|
|
227
|
-
* When `true`, set the maximum width to match the reference element, and also prevent overflow within
|
|
228
|
-
* the current boundary by resizing.
|
|
229
|
-
*
|
|
230
|
-
* Note that setting `constrainSize` to `true` also causes the popover to resize
|
|
231
|
-
*
|
|
232
|
-
* @defaultValue false
|
|
233
|
-
*/
|
|
234
|
-
matchReferenceWidth?: boolean;
|
|
235
|
-
/**
|
|
236
|
-
* When true, blocks all pointer interaction with elements beneath the popover until closed.
|
|
237
|
-
*
|
|
238
|
-
* @beta
|
|
239
|
-
* @defaultValue false
|
|
240
|
-
*/
|
|
241
|
-
modal?: boolean;
|
|
242
|
-
open?: boolean;
|
|
243
|
-
placement?: Placement;
|
|
244
|
-
/**
|
|
245
|
-
* When 'flip' (default), the placement is determined from the initial placement and the
|
|
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.
|
|
260
|
-
*/
|
|
261
|
-
referenceElement?: HTMLElement | null; /** @beta */
|
|
262
|
-
updateRef?: Ref<PopoverUpdateCallback | undefined>;
|
|
263
|
-
width?: ResponsiveProp$1<MaxWidth>;
|
|
264
|
-
};
|
|
265
|
-
/** @public */
|
|
266
|
-
type PopoverElementType = 'div';
|
|
267
|
-
/** @public */
|
|
268
|
-
type PopoverProps = Assign<PopoverLayerProps, PopoverOwnProps>;
|
|
269
|
-
/**
|
|
270
|
-
* The `Popover` component is used to display some content on top of another.
|
|
271
|
-
*
|
|
272
|
-
* @public
|
|
273
|
-
*/
|
|
274
|
-
declare function Popover(props: PopoverProps): React.JSX.Element;
|
|
275
|
-
/** @public */
|
|
276
|
-
declare const DEFAULT_TEXT_ELEMENT = "div";
|
|
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>;
|
|
283
|
-
/**
|
|
284
|
-
* The `Text` component is an agile, themed typographic element.
|
|
285
|
-
*
|
|
286
|
-
* @public
|
|
287
|
-
*/
|
|
288
|
-
declare function Text<E extends TextElementType = typeof DEFAULT_TEXT_ELEMENT>(props: TextProps<E>): React.JSX.Element;
|
|
289
|
-
/** @public */
|
|
290
|
-
declare const DEFAULT_TOOLTIP_ELEMENT = "div";
|
|
291
|
-
/** @public */
|
|
292
|
-
type TooltipOwnProps = LayerOwnProps & RadiusStyleProps & ShadowStyleProps & {
|
|
293
|
-
/**
|
|
294
|
-
* Whether the tooltip should animate in and out.
|
|
295
|
-
*
|
|
296
|
-
* @beta
|
|
297
|
-
* @defaultValue false
|
|
298
|
-
*/
|
|
299
|
-
animate?: boolean; /** @deprecated Will be removed in the next major version */
|
|
300
|
-
arrow?: boolean;
|
|
301
|
-
boundaryElement?: HTMLElement | null;
|
|
302
|
-
children?: React.ReactElement<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
303
|
-
content?: React.ReactNode;
|
|
304
|
-
/**
|
|
305
|
-
* Adds a delay to open or close the tooltip.
|
|
306
|
-
*
|
|
307
|
-
* If only a `number` is passed, it will be used for both opening and closing.
|
|
308
|
-
*
|
|
309
|
-
* If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
|
|
310
|
-
*
|
|
311
|
-
* @public
|
|
312
|
-
* @defaultValue 0
|
|
313
|
-
*/
|
|
314
|
-
delay?: Delay;
|
|
315
|
-
disabled?: boolean;
|
|
316
|
-
fallbackPlacements?: Placement[];
|
|
317
|
-
hotkeys?: string[];
|
|
318
|
-
placement?: Placement; /** Whether or not to render the tooltip in a portal element. */
|
|
319
|
-
portal?: boolean | string;
|
|
320
|
-
scheme?: ColorScheme;
|
|
321
|
-
text?: React.ReactNode;
|
|
322
|
-
textSize?: ResponsiveProp$1<FontTextSize>;
|
|
323
|
-
tone?: CardTone;
|
|
324
|
-
};
|
|
325
|
-
/** @public */
|
|
326
|
-
type TooltipElementType = 'div' | 'span' | ComponentType;
|
|
327
|
-
/** @public */
|
|
328
|
-
type TooltipProps<E extends TooltipElementType = TooltipElementType> = Props<TooltipOwnProps, E>;
|
|
1
|
+
import { A as ThemeColorMutedTone, At as ThemeColorSchemeKey$1, B as ThemeColorBase, C as ThemeColorSpotKey, D as ThemeColorSelectableState, Dt as ThemeColorCardToneKey, E as ThemeColorSelectable, F as ThemeColorCardState, H as ThemeColorToneKey, 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, T as ThemeColorSolidTone, U as ThemeColorGenericState, V as ThemeColorName, W as ThemeAvatar, b as ThemeColorScheme, d as ThemeColorBuilderOpts, g as Theme$1, j as ThemeColorInput, k as ThemeColorMuted, m as RootTheme$1, pt as CSSObject, u as PartialThemeColorBuilderOpts, v as ThemeInput, w as ThemeColorSolid, wt as ThemeColorAvatarColorKey, x as ThemeColorSchemes, xt as ThemeFontWeightKey$1, y as ThemeColor, z as ThemeColorButtonTones } from "./_chunks/rgba.js";
|
|
2
|
+
import { $ as BoxOwnProps, $t as GridAutoRows, A as FlexOwnProps, An as createColorTheme, At as TagType, B as containsOrEqualsElement, Bt as ResponsiveMarginProps, C as StackProps, Cn as ThemeFontKey, Ct as MenuDivider, D as GridOwnProps, Dn as ThemeFonts, Dt as ElementType, E as Grid, En as ThemeFontWeightKey, Et as ComponentType, F as Button, Fn as rgbToHex, Ft as ResponsiveBoxProps, G as isHTMLSelectElement, Gt as GridItemColumn, H as isHTMLButtonElement, Ht as ResponsiveRadiusProps, I as ButtonOwnProps, In as rgbToHsl, It as ResponsiveFlexItemProps, J as TabListProps, Jt as GridItemRow, K as isHTMLTextAreaElement, Kt as GridItemColumnEnd, L as ButtonProps, Ln as rgba, Lt as ResponsiveFlexProps, M as Card, Mn as hslToRgb, Mt as MenuProps, N as CardOwnProps, Nn as multiply, Nt as Delay, O as GridProps, On as ThemeLayer, Ot as EmptyProps, P as CardProps, Pn as parseColor, Pt as ResponsiveBorderProps, Q as Box, Qt as GridAutoFlow, R as usePrefersDark, Rn as screen, Rt as ResponsiveGridItemProps, S as StackOwnProps, Sn as ThemeFont, St as CardTone, T as SpinnerProps, Tn as ThemeFontWeight, Tt as Assign, U as isHTMLElement, Ut as ResponsiveShadowProps, V as isHTMLAnchorElement, Vt as ResponsivePaddingProps, W as isHTMLInputElement, Wt as ResponsiveWidthProps, X as InlineOwnProps, Xt as GridItemRowStart, Y as Inline, Yt as GridItemRowEnd, Z as InlineProps, Zt as GridAutoCols, _ as Text, _n as Styles, _t as PopoverWidth, a as LayerProvider, an as BoxDisplay, at as ButtonTone, b as TextAlign, bn as ThemeColorSchemeKey, bt as PopoverMargins, c as useTheme_v2, cn as BoxSizing, ct as MenuItemOwnProps, d as Tooltip, dn as Radius, dt as MenuGroupOwnProps, en as FlexAlign, et as BoxProps, f as TooltipProps, fn as BaseTheme, ft as MenuGroupProps, g as TextInputType, gn as RootTheme, gt as PopoverUpdateCallback, h as TextInputProps, hn as RGB, ht as PopoverProps, i as PortalProps, in as FlexWrap, it as ButtonTextAlign, j as FlexProps, jn as hexToRgb, jt as Menu, k as Flex, kn as ThemeShadow, kt as Props, l as ThemeProvider, ln as Hotkeys, lt as MenuItemProps, m as TextInputClearButtonProps, mn as HSL, mt as Popover, n as PortalProviderProps, nn as FlexJustify, nt as TabProps, o as LayerProviderProps, on as BoxHeight, ot as ButtonWidth, p as TextInput, pn as BoxShadow, pt as SelectableTone, q as TabList, qt as GridItemColumnStart, r as Portal, rn as FlexValue, rt as ButtonMode, s as useTheme, sn as BoxOverflow, st as MenuItem, t as PortalProvider, tn as FlexDirection, tt as Tab, u as ThemeProviderProps, un as HotkeysProps, ut as MenuGroup, v as TextOwnProps, vn as Theme, vt as Layer, w as Spinner, wn as ThemeFontSize, wt as MenuDividerProps, x as Stack, xn as ThemeColorSyntax, xt as Placement, y as TextProps, yn as ThemeColorButtonModeKey, yt as LayerProps, z as _isEnterToClickElement, zn as studioTheme, zt as ResponsiveGridProps } from "./_chunks/portalProvider.js";
|
|
3
|
+
import { Component, ElementType as ElementType$1, HTMLProps, PropsWithChildren, ReactNode, Ref } from "react";
|
|
329
4
|
/**
|
|
330
|
-
* Tooltips display information when hovering, focusing or tapping.
|
|
331
|
-
*
|
|
332
5
|
* @public
|
|
333
6
|
*/
|
|
334
|
-
|
|
335
|
-
/** @public */
|
|
336
|
-
declare const DEFAULT_BUTTON_ELEMENT = "button";
|
|
337
|
-
/** @public */
|
|
338
|
-
interface ButtonOwnProps extends ButtonStyleProps {
|
|
339
|
-
'data-ui'?: string;
|
|
340
|
-
'fontSize'?: ResponsiveProp$1<FontTextSize>;
|
|
341
|
-
'icon'?: React.ElementType | React.ReactNode;
|
|
342
|
-
'iconRight'?: React.ElementType | React.ReactNode;
|
|
343
|
-
'loading'?: boolean;
|
|
344
|
-
'muted'?: boolean;
|
|
345
|
-
'pressed'?: boolean;
|
|
346
|
-
/** @deprecated Use `pressed` instead. */
|
|
347
|
-
'selected'?: boolean;
|
|
348
|
-
'textAlign'?: TextOwnProps['align'];
|
|
349
|
-
'text'?: React.ReactNode;
|
|
350
|
-
'textOverflow'?: TextOwnProps['textOverflow'];
|
|
351
|
-
'textWeight'?: TextOwnProps['weight'];
|
|
352
|
-
'tooltip'?: Omit<TooltipProps<'div'>, 'as' | 'children'>;
|
|
353
|
-
}
|
|
354
|
-
/** @public */
|
|
355
|
-
type ButtonElementType = 'a' | 'button' | 'label' | ComponentType;
|
|
356
|
-
/** @public */
|
|
357
|
-
type ButtonProps<E extends ButtonElementType = ButtonElementType> = Props<ButtonOwnProps, E>;
|
|
358
|
-
/** @public */
|
|
359
|
-
declare function Button<E extends ButtonElementType = typeof DEFAULT_BUTTON_ELEMENT>(props: ButtonProps<E>): React.JSX.Element;
|
|
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;
|
|
377
|
-
/**
|
|
378
|
-
* @beta
|
|
379
|
-
*/
|
|
380
|
-
onClear?: () => void;
|
|
381
|
-
prefix?: ReactNode;
|
|
382
|
-
suffix?: ReactNode;
|
|
383
|
-
/**
|
|
384
|
-
* @deprecated Use `fontWeight` instead
|
|
385
|
-
*/
|
|
386
|
-
weight?: FontWeight;
|
|
387
|
-
};
|
|
388
|
-
/** @public */
|
|
389
|
-
type TextInputElementType = 'input' | ComponentType;
|
|
390
|
-
/** @public */
|
|
391
|
-
type TextInputProps<E extends TextInputElementType = TextInputElementType> = Props<TextInputOwnProps, E>;
|
|
7
|
+
type AutocompleteOpenButtonProps = ButtonOwnProps & Omit<React.HTMLProps<HTMLButtonElement>, 'as' | 'ref'>;
|
|
392
8
|
/**
|
|
393
|
-
* Single line text input.
|
|
394
|
-
*
|
|
395
9
|
* @public
|
|
396
10
|
*/
|
|
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
11
|
interface BaseAutocompleteOption {
|
|
402
12
|
value: string;
|
|
403
13
|
}
|
|
@@ -475,71 +85,82 @@ interface AutocompleteValueChangeMsg {
|
|
|
475
85
|
* @internal
|
|
476
86
|
*/
|
|
477
87
|
type AutocompleteMsg = AutocompleteRootBlurMsg | AutocompleteRootClearMsg | AutocompleteRootEscapeMsg | AutocompleteRootOpenMsg | AutocompleteRootSetActiveValueMsg | AutocompleteRootSetListFocusedMsg | AutocompleteInputChangeMsg | AutocompleteInputFoocusMsg | AutocompleteValueChangeMsg;
|
|
478
|
-
/**
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
88
|
+
/**
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
interface AutocompleteProps<Option extends BaseAutocompleteOption = BaseAutocompleteOption> {
|
|
482
92
|
border?: boolean;
|
|
483
93
|
customValidity?: string;
|
|
484
94
|
filterOption?: (query: string, option: Option) => boolean;
|
|
485
|
-
|
|
486
|
-
|
|
95
|
+
fontSize?: number | number[];
|
|
96
|
+
icon?: ElementType$1 | ReactNode;
|
|
97
|
+
id: string;
|
|
98
|
+
/** @beta */
|
|
99
|
+
listBox?: BoxProps;
|
|
487
100
|
loading?: boolean;
|
|
488
101
|
onChange?: (value: string) => void;
|
|
489
102
|
onQueryChange?: (query: string | null) => void;
|
|
490
|
-
onSelect?: (value: string) => void;
|
|
491
|
-
|
|
492
|
-
|
|
103
|
+
onSelect?: (value: string) => void;
|
|
104
|
+
/** @beta */
|
|
105
|
+
openButton?: boolean | AutocompleteOpenButtonProps;
|
|
106
|
+
/** @beta */
|
|
107
|
+
openOnFocus?: boolean;
|
|
108
|
+
/** The options to render. */
|
|
493
109
|
options?: Option[];
|
|
494
|
-
padding?:
|
|
495
|
-
popover?: Omit<PopoverProps, 'content' | 'onMouseEnter' | 'onMouseLeave' | 'open'>;
|
|
110
|
+
padding?: number | number[];
|
|
111
|
+
popover?: Omit<PopoverProps, 'content' | 'onMouseEnter' | 'onMouseLeave' | 'open'> & Omit<HTMLProps<HTMLDivElement>, 'as' | 'children' | 'content' | 'ref' | 'width'>;
|
|
496
112
|
prefix?: ReactNode;
|
|
497
|
-
radius?: Radius | Radius[];
|
|
498
|
-
|
|
499
|
-
|
|
113
|
+
radius?: Radius | Radius[];
|
|
114
|
+
/** @beta */
|
|
115
|
+
relatedElements?: HTMLElement[];
|
|
116
|
+
/** The callback function for rendering each option. */
|
|
117
|
+
renderOption?: (option: Option) => React.JSX.Element;
|
|
118
|
+
/** @beta */
|
|
500
119
|
renderPopover?: (props: {
|
|
501
120
|
content: React.JSX.Element | null;
|
|
502
121
|
hidden: boolean;
|
|
503
122
|
inputElement: HTMLInputElement | null;
|
|
504
123
|
onMouseEnter: () => void;
|
|
505
124
|
onMouseLeave: () => void;
|
|
506
|
-
}, ref:
|
|
125
|
+
}, ref: Ref<HTMLDivElement>) => ReactNode;
|
|
507
126
|
renderValue?: (value: string, option?: Option) => string;
|
|
508
127
|
suffix?: ReactNode;
|
|
128
|
+
/** The current value. */
|
|
509
129
|
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>;
|
|
130
|
+
}
|
|
515
131
|
/**
|
|
516
132
|
* The Autocomplete component is typically used for search components.
|
|
517
133
|
* It consists of a text input for writing a query, and properties for rendering suggestions.
|
|
518
134
|
*
|
|
519
135
|
* @public
|
|
520
136
|
*/
|
|
521
|
-
declare
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
|
|
526
|
-
|
|
137
|
+
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'> & {
|
|
138
|
+
ref?: Ref<HTMLInputElement>;
|
|
139
|
+
}) => React.JSX.Element;
|
|
140
|
+
/**
|
|
141
|
+
* @beta
|
|
142
|
+
*/
|
|
143
|
+
interface BreadcrumbsProps {
|
|
527
144
|
maxLength?: number;
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
|
|
537
|
-
|
|
145
|
+
separator?: React.ReactNode;
|
|
146
|
+
gap?: number | number[];
|
|
147
|
+
/**
|
|
148
|
+
* @deprecated Use `gap` instead. `space` will be removed in v4.
|
|
149
|
+
*/
|
|
150
|
+
space?: number | number[];
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* @beta
|
|
154
|
+
*/
|
|
155
|
+
declare const Breadcrumbs: import("react").ForwardRefExoticComponent<BreadcrumbsProps & Omit<import("react").HTMLProps<HTMLOListElement>, "as" | "ref" | "type"> & import("react").RefAttributes<HTMLOListElement>>;
|
|
156
|
+
/**
|
|
157
|
+
* @public
|
|
158
|
+
*/
|
|
538
159
|
type DialogPosition = 'absolute' | 'fixed';
|
|
539
|
-
/**
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
interface
|
|
160
|
+
/**
|
|
161
|
+
* @public
|
|
162
|
+
*/
|
|
163
|
+
interface DialogProps extends ResponsivePaddingProps, ResponsiveWidthProps {
|
|
543
164
|
/**
|
|
544
165
|
* @beta
|
|
545
166
|
*/
|
|
@@ -548,61 +169,55 @@ interface DialogOwnProps extends Omit<ContainerStyleProps, 'id' | 'position' | '
|
|
|
548
169
|
* @beta
|
|
549
170
|
*/
|
|
550
171
|
__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;
|
|
172
|
+
cardRadius?: Radius | Radius[];
|
|
173
|
+
cardShadow?: number | number[];
|
|
174
|
+
contentRef?: React.ForwardedRef<HTMLDivElement>;
|
|
175
|
+
footer?: React.ReactNode;
|
|
176
|
+
header?: React.ReactNode;
|
|
562
177
|
id: string;
|
|
563
178
|
/** A callback that fires when the dialog becomes the top layer when it was not the top layer before. */
|
|
564
179
|
onActivate?: LayerProps['onActivate'];
|
|
565
180
|
onClickOutside?: () => void;
|
|
566
181
|
onClose?: () => void;
|
|
567
|
-
open?: boolean;
|
|
568
182
|
portal?: string;
|
|
569
|
-
position?:
|
|
183
|
+
position?: DialogPosition | DialogPosition[];
|
|
184
|
+
scheme?: ThemeColorSchemeKey$1;
|
|
185
|
+
zOffset?: number | number[];
|
|
570
186
|
/**
|
|
571
|
-
*
|
|
187
|
+
* Whether the dialog should animate in on mount.
|
|
188
|
+
*
|
|
189
|
+
* @beta
|
|
190
|
+
* @defaultValue false
|
|
572
191
|
*/
|
|
573
|
-
|
|
192
|
+
animate?: boolean;
|
|
574
193
|
}
|
|
575
|
-
/** @public */
|
|
576
|
-
type DialogElementType = 'div' | 'span' | ComponentType;
|
|
577
|
-
/** @public */
|
|
578
|
-
type DialogProps<E extends DialogElementType = DialogElementType> = Props<DialogOwnProps, E>;
|
|
579
194
|
/**
|
|
580
195
|
* The Dialog component.
|
|
581
196
|
*
|
|
582
197
|
* @public
|
|
583
198
|
*/
|
|
584
|
-
declare
|
|
199
|
+
declare const Dialog: import("react").ForwardRefExoticComponent<Omit<DialogProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "id" | "width">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
585
200
|
/**
|
|
586
201
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
587
202
|
* @beta
|
|
588
203
|
*/
|
|
589
204
|
interface DialogContextValue {
|
|
590
205
|
version: 0.0;
|
|
591
|
-
position?:
|
|
592
|
-
zOffset?:
|
|
206
|
+
position?: DialogPosition | DialogPosition[];
|
|
207
|
+
zOffset?: number | number[];
|
|
593
208
|
}
|
|
594
209
|
/**
|
|
595
210
|
* @internal
|
|
596
211
|
*/
|
|
597
|
-
declare const DialogContext: Context<DialogContextValue>;
|
|
212
|
+
declare const DialogContext: import("react").Context<DialogContextValue>;
|
|
598
213
|
/**
|
|
599
214
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
600
215
|
* @beta
|
|
601
216
|
*/
|
|
602
217
|
interface DialogProviderProps {
|
|
603
|
-
children?: ReactNode;
|
|
604
|
-
position?:
|
|
605
|
-
zOffset?:
|
|
218
|
+
children?: React.ReactNode;
|
|
219
|
+
position?: DialogPosition | DialogPosition[];
|
|
220
|
+
zOffset?: number | number[];
|
|
606
221
|
}
|
|
607
222
|
/**
|
|
608
223
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
@@ -614,235 +229,184 @@ declare function DialogProvider(props: DialogProviderProps): React.JSX.Element;
|
|
|
614
229
|
* @beta
|
|
615
230
|
*/
|
|
616
231
|
declare function useDialog(): DialogContextValue;
|
|
617
|
-
/** @public */
|
|
618
|
-
declare const DEFAULT_HOTKEYS_ELEMENT = "kbd";
|
|
619
|
-
/** @public */
|
|
620
|
-
interface HotkeysOwnProps extends GapStyleProps, RadiusStyleProps {
|
|
621
|
-
/** @deprecated No longer supported. */
|
|
622
|
-
fontSize?: never;
|
|
623
|
-
/** @deprecated No longer supported. */
|
|
624
|
-
padding?: never;
|
|
625
|
-
keys: string[];
|
|
626
|
-
}
|
|
627
|
-
/** @public */
|
|
628
|
-
type HotkeysElementType = 'kbd' | ComponentType;
|
|
629
|
-
/** @public */
|
|
630
|
-
type HotkeysProps<E extends HotkeysElementType = HotkeysElementType> = Props<HotkeysOwnProps, E>;
|
|
631
232
|
/**
|
|
632
|
-
* Represent hotkeys (a keyboard combination) with semantic `<kbd>` elements.
|
|
633
|
-
*
|
|
634
|
-
* @example
|
|
635
|
-
* ```tsx
|
|
636
|
-
* import {Hotkeys} from '@sanity/ui'
|
|
637
|
-
*
|
|
638
|
-
* <Hotkeys keys={['⌘', 'K']} />
|
|
639
|
-
* ```
|
|
640
|
-
*
|
|
641
233
|
* @public
|
|
642
234
|
*/
|
|
643
|
-
|
|
644
|
-
/** @public */
|
|
645
|
-
declare const DEFAULT_MENU_ELEMENT = "div";
|
|
646
|
-
/** @public */
|
|
647
|
-
type MenuOwnProps = PaddingStyleProps & {
|
|
648
|
-
'gap'?: ResponsiveProp$1<Space>;
|
|
649
|
-
'onClickOutside'?: (event: MouseEvent) => void;
|
|
650
|
-
'onEscape'?: () => void;
|
|
651
|
-
'onItemClick'?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
652
|
-
'onItemSelect'?: (index: number) => void;
|
|
653
|
-
'originElement'?: HTMLElement | null;
|
|
654
|
-
'registerElement'?: (el: HTMLElement) => () => void;
|
|
655
|
-
'shouldFocus'?: 'first' | 'last' | null;
|
|
656
|
-
'aria-labelledby'?: string;
|
|
657
|
-
};
|
|
658
|
-
/** @public */
|
|
659
|
-
type MenuElementType = 'div' | 'span' | ComponentType;
|
|
660
|
-
/** @public */
|
|
661
|
-
type MenuProps<E extends MenuElementType = MenuElementType> = Props<MenuOwnProps, E>;
|
|
662
|
-
/**
|
|
663
|
-
* The `Menu` component is a building block for application menus.
|
|
664
|
-
*
|
|
665
|
-
* @public
|
|
666
|
-
*/
|
|
667
|
-
declare function Menu<E extends MenuElementType = typeof DEFAULT_MENU_ELEMENT>(props: MenuProps<E>): React.JSX.Element;
|
|
668
|
-
/** @public */
|
|
669
|
-
type MenuButtonProps = {
|
|
235
|
+
interface MenuButtonProps {
|
|
670
236
|
/**
|
|
671
237
|
* @beta Do not use in production.
|
|
672
238
|
*/
|
|
673
239
|
__unstable_disableRestoreFocusOnClose?: boolean;
|
|
674
|
-
|
|
240
|
+
/**
|
|
241
|
+
* @deprecated Use `popover={{boundaryElement: element}}` instead.
|
|
242
|
+
*/
|
|
243
|
+
boundaryElement?: HTMLElement;
|
|
244
|
+
button: React.JSX.Element;
|
|
675
245
|
id: string;
|
|
676
|
-
menu?:
|
|
246
|
+
menu?: React.JSX.Element;
|
|
677
247
|
onClose?: () => void;
|
|
678
248
|
onOpen?: () => void;
|
|
249
|
+
/**
|
|
250
|
+
* @deprecated Use `popover={{placement: 'top'}}` instead.
|
|
251
|
+
*/
|
|
252
|
+
placement?: Placement;
|
|
679
253
|
popover?: Omit<PopoverProps, 'content' | 'open'>;
|
|
680
|
-
|
|
681
|
-
}
|
|
254
|
+
/**
|
|
255
|
+
* @deprecated Use `popover={{scheme: 'dark'}}` instead.
|
|
256
|
+
*/
|
|
257
|
+
popoverScheme?: ThemeColorSchemeKey$1;
|
|
258
|
+
/**
|
|
259
|
+
* @deprecated Use `popover={{radius: 2}}` instead.
|
|
260
|
+
*/
|
|
261
|
+
popoverRadius?: Radius | Radius[];
|
|
262
|
+
/**
|
|
263
|
+
* @beta Do not use in production.
|
|
264
|
+
* @deprecated Use `popover={{portal: true}}` instead.
|
|
265
|
+
*/
|
|
266
|
+
portal?: boolean;
|
|
267
|
+
/**
|
|
268
|
+
* @deprecated Use `popover={{preventOverflow: true}}` instead.
|
|
269
|
+
*/
|
|
270
|
+
preventOverflow?: boolean;
|
|
271
|
+
}
|
|
682
272
|
/**
|
|
683
273
|
* The `MenuButton` component follows the WAI-ARIA specification for menu buttons.
|
|
684
274
|
*
|
|
685
275
|
* @public
|
|
686
276
|
*/
|
|
687
|
-
declare
|
|
688
|
-
/**
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
type MenuDividerProps<E extends MenuDividerElementType = MenuDividerElementType> = Props<MenuDividerOwnProps, E>;
|
|
696
|
-
/** @public */
|
|
697
|
-
declare function MenuDivider<E extends MenuDividerElementType = typeof DEFAULT_MENU_DIVIDER_ELEMENT>(props: MenuDividerProps<E>): React.JSX.Element;
|
|
698
|
-
/** @public */
|
|
699
|
-
declare const DEFAULT_MENU_GROUP_ELEMENT = "button";
|
|
700
|
-
/** @public */
|
|
701
|
-
type MenuGroupOwnProps = RadiusStyleProps & {
|
|
702
|
-
disabled?: boolean;
|
|
703
|
-
fontSize?: ResponsiveProp$1<FontTextSize>;
|
|
704
|
-
gap?: ResponsiveProp$1<Space>;
|
|
705
|
-
icon?: ElementType$1 | ReactNode;
|
|
706
|
-
menu?: Omit<MenuProps<typeof DEFAULT_MENU_ELEMENT>, 'onClickOutside' | 'onEscape' | 'onItemClick' | 'onKeyDown' | 'onMouseEnter' | 'registerElement' | 'shouldFocus' | 'onBlurCapture'>;
|
|
707
|
-
padding?: ResponsiveProp$1<Space>;
|
|
708
|
-
popover?: Omit<PopoverProps, 'content' | 'open'>;
|
|
709
|
-
text?: ReactNode;
|
|
710
|
-
tone?: ElementTone;
|
|
711
|
-
};
|
|
712
|
-
/** @public */
|
|
713
|
-
type MenuGroupElementType = 'button' | ComponentType;
|
|
714
|
-
/** @public */
|
|
715
|
-
type MenuGroupProps<E extends MenuGroupElementType = MenuGroupElementType> = Props<MenuGroupOwnProps, E>;
|
|
716
|
-
/** @public */
|
|
717
|
-
declare function MenuGroup<E extends MenuGroupElementType = typeof DEFAULT_MENU_GROUP_ELEMENT>(props: MenuGroupProps<E>): React.JSX.Element;
|
|
718
|
-
/** @public */
|
|
719
|
-
declare const DEFAULT_MENU_ITEM_ELEMENT = "button";
|
|
720
|
-
/** @public */
|
|
721
|
-
type MenuItemOwnProps = GapStyleProps & PaddingStyleProps & RadiusStyleProps & {
|
|
722
|
-
disabled?: boolean;
|
|
723
|
-
fontSize?: ResponsiveProp$1<FontTextSize>;
|
|
724
|
-
hotkeys?: string[];
|
|
725
|
-
icon?: ElementType$1 | ReactNode;
|
|
726
|
-
iconRight?: ElementType$1 | ReactNode;
|
|
727
|
-
pressed?: boolean;
|
|
728
|
-
selected?: boolean;
|
|
729
|
-
text?: ReactNode;
|
|
730
|
-
tone?: ElementTone;
|
|
731
|
-
};
|
|
732
|
-
/** @public */
|
|
733
|
-
type MenuItemElementType = 'button' | 'a' | ComponentType;
|
|
734
|
-
/** @public */
|
|
735
|
-
type MenuItemProps<E extends MenuItemElementType = MenuItemElementType> = Props<MenuItemOwnProps, E>;
|
|
736
|
-
/** @public */
|
|
737
|
-
declare function MenuItem<E extends MenuItemElementType = typeof DEFAULT_MENU_ITEM_ELEMENT>(props: MenuItemProps<E>): React.JSX.Element;
|
|
738
|
-
/** @public */
|
|
739
|
-
declare const DEFAULT_TAB_ELEMENT = "button";
|
|
740
|
-
/** @public */
|
|
741
|
-
interface TabOwnProps extends ButtonOwnProps {
|
|
742
|
-
/**
|
|
743
|
-
* The `id` of the corresponding `TabPanel` component.
|
|
744
|
-
*/
|
|
745
|
-
'aria-controls': string;
|
|
746
|
-
'id': string;
|
|
747
|
-
'focused'?: boolean;
|
|
748
|
-
'label'?: React.ReactNode;
|
|
749
|
-
'onActivate'?: () => void;
|
|
277
|
+
declare const MenuButton: import("react").ForwardRefExoticComponent<MenuButtonProps & import("react").RefAttributes<HTMLButtonElement | null>>;
|
|
278
|
+
/**
|
|
279
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
280
|
+
* @beta
|
|
281
|
+
*/
|
|
282
|
+
interface SkeletonProps extends ResponsiveRadiusProps, Omit<BoxOwnProps, 'children'> {
|
|
283
|
+
animated?: boolean;
|
|
284
|
+
delay?: number;
|
|
750
285
|
}
|
|
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
286
|
/**
|
|
766
|
-
*
|
|
767
|
-
*
|
|
768
|
-
* @public
|
|
287
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
288
|
+
* @beta
|
|
769
289
|
*/
|
|
770
|
-
declare
|
|
771
|
-
/**
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
290
|
+
declare const Skeleton: import("react").ForwardRefExoticComponent<Omit<SkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "height">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
291
|
+
/**
|
|
292
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
293
|
+
* @beta
|
|
294
|
+
*/
|
|
295
|
+
interface TextSkeletonProps extends SkeletonProps {
|
|
296
|
+
size?: number | number[];
|
|
776
297
|
}
|
|
777
|
-
/**
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
298
|
+
/**
|
|
299
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
300
|
+
* @beta
|
|
301
|
+
*/
|
|
302
|
+
interface LabelSkeletonProps extends SkeletonProps {
|
|
303
|
+
size?: number | number[];
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
307
|
+
* @beta
|
|
308
|
+
*/
|
|
309
|
+
interface HeadingSkeletonProps extends SkeletonProps {
|
|
310
|
+
size?: number | number[];
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
314
|
+
* @beta
|
|
315
|
+
*/
|
|
316
|
+
interface CodeSkeletonProps extends SkeletonProps {
|
|
317
|
+
size?: number | number[];
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
321
|
+
* @beta
|
|
322
|
+
*/
|
|
323
|
+
declare const TextSkeleton: import("react").ForwardRefExoticComponent<Omit<TextSkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "height" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
324
|
+
/**
|
|
325
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
326
|
+
* @beta
|
|
327
|
+
*/
|
|
328
|
+
declare const LabelSkeleton: import("react").ForwardRefExoticComponent<Omit<LabelSkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "height" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
329
|
+
/**
|
|
330
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
331
|
+
* @beta
|
|
332
|
+
*/
|
|
333
|
+
declare const HeadingSkeleton: import("react").ForwardRefExoticComponent<Omit<HeadingSkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "height" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
334
|
+
/**
|
|
335
|
+
* This API might change. DO NOT USE IN PRODUCTION.
|
|
336
|
+
* @beta
|
|
337
|
+
*/
|
|
338
|
+
declare const CodeSkeleton: import("react").ForwardRefExoticComponent<Omit<CodeSkeletonProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "height" | "size">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
339
|
+
/**
|
|
340
|
+
* @public
|
|
341
|
+
*/
|
|
342
|
+
interface TabPanelProps extends BoxOwnProps {
|
|
787
343
|
/**
|
|
788
|
-
* The `id` of the
|
|
344
|
+
* The `id` of the correlating `Tab` component.
|
|
789
345
|
*/
|
|
790
346
|
'aria-labelledby': string;
|
|
791
347
|
'id': string;
|
|
792
|
-
}
|
|
793
|
-
/**
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
/**
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
/** @internal */
|
|
802
|
-
type ToastOwnProps = RadiusStyleProps & {
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* @public
|
|
351
|
+
*/
|
|
352
|
+
declare const TabPanel: import("react").ForwardRefExoticComponent<Omit<TabPanelProps & Omit<import("react").HTMLProps<HTMLDivElement>, "aria-labelledby" | "as" | "id" | "role">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
353
|
+
/**
|
|
354
|
+
* @public
|
|
355
|
+
*/
|
|
356
|
+
interface ToastProps {
|
|
803
357
|
closable?: boolean;
|
|
804
|
-
description?: ReactNode;
|
|
805
|
-
onClose
|
|
806
|
-
|
|
358
|
+
description?: React.ReactNode;
|
|
359
|
+
onClose: () => void;
|
|
360
|
+
radius?: number | number[];
|
|
361
|
+
title?: React.ReactNode;
|
|
807
362
|
status?: 'error' | 'warning' | 'success' | 'info';
|
|
808
363
|
duration?: number;
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
type ToastElementType = 'li' | ComponentType;
|
|
812
|
-
/** @internal */
|
|
813
|
-
type ToastProps<E extends ToastElementType = ToastElementType> = Props<ToastOwnProps, E>;
|
|
364
|
+
updatedAt?: number;
|
|
365
|
+
}
|
|
814
366
|
/**
|
|
815
367
|
* The `Toast` component gives feedback to users when an action has taken place.
|
|
816
368
|
*
|
|
817
|
-
* Toasts can be closed with a close button, or auto-dismiss
|
|
369
|
+
* Toasts can be closed with a close button, or auto-dismiss after a certain timeout.
|
|
818
370
|
*
|
|
819
|
-
* @
|
|
371
|
+
* @public
|
|
372
|
+
*/
|
|
373
|
+
declare function Toast(props: ToastProps & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref' | 'title' | 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'>): React.JSX.Element;
|
|
374
|
+
/**
|
|
375
|
+
* @public
|
|
376
|
+
*/
|
|
377
|
+
interface ToastLayerProps {
|
|
378
|
+
children: React.ReactNode;
|
|
379
|
+
padding?: number | number[];
|
|
380
|
+
paddingX?: number | number[];
|
|
381
|
+
paddingY?: number | number[];
|
|
382
|
+
gap?: number | number[];
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* @public
|
|
820
386
|
*/
|
|
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
387
|
interface ToastProviderProps extends Omit<ToastLayerProps, 'children'> {
|
|
830
388
|
children?: React.ReactNode;
|
|
831
|
-
zOffset?:
|
|
389
|
+
zOffset?: number | number[];
|
|
832
390
|
}
|
|
833
|
-
/**
|
|
391
|
+
/**
|
|
392
|
+
* @public
|
|
393
|
+
*/
|
|
834
394
|
declare function ToastProvider(props: ToastProviderProps): React.JSX.Element;
|
|
835
|
-
/**
|
|
395
|
+
/**
|
|
396
|
+
* @public
|
|
397
|
+
*/
|
|
836
398
|
interface ToastParams {
|
|
837
399
|
closable?: boolean;
|
|
838
|
-
description?: ReactNode;
|
|
400
|
+
description?: React.ReactNode;
|
|
839
401
|
duration?: number;
|
|
840
402
|
id?: string;
|
|
841
403
|
onClose?: () => void;
|
|
842
|
-
title?: ReactNode;
|
|
404
|
+
title?: React.ReactNode;
|
|
843
405
|
status?: 'error' | 'warning' | 'success' | 'info';
|
|
844
406
|
}
|
|
845
|
-
/**
|
|
407
|
+
/**
|
|
408
|
+
* @public
|
|
409
|
+
*/
|
|
846
410
|
interface ToastContextValue {
|
|
847
411
|
version: 0.0;
|
|
848
412
|
/**
|
|
@@ -853,78 +417,57 @@ interface ToastContextValue {
|
|
|
853
417
|
*/
|
|
854
418
|
push: (params: ToastParams) => string;
|
|
855
419
|
}
|
|
856
|
-
/** @public */
|
|
857
|
-
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
420
|
/**
|
|
867
|
-
* The `Stack` component is used to place elements on top of each other.
|
|
868
|
-
*
|
|
869
421
|
* @public
|
|
870
422
|
*/
|
|
871
|
-
declare function
|
|
872
|
-
/** @beta */
|
|
873
|
-
declare const DEFAULT_TREE_ELEMENT = "div";
|
|
423
|
+
declare function useToast(): ToastContextValue;
|
|
874
424
|
/**
|
|
875
425
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
876
426
|
* @beta
|
|
877
427
|
*/
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
428
|
+
interface TreeProps {
|
|
429
|
+
gap?: number | number[];
|
|
430
|
+
/**
|
|
431
|
+
* @deprecated Use `gap` instead. `space` will be removed in v4.
|
|
432
|
+
*/
|
|
433
|
+
space?: number | number[];
|
|
434
|
+
}
|
|
883
435
|
/**
|
|
884
436
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
885
437
|
* @beta
|
|
886
438
|
*/
|
|
887
|
-
declare
|
|
888
|
-
/**
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
interface
|
|
892
|
-
selected?: boolean;
|
|
893
|
-
}
|
|
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 & {
|
|
439
|
+
declare const Tree: import("react").ForwardRefExoticComponent<TreeProps & Omit<import("react").HTMLProps<HTMLUListElement>, "align" | "as" | "height" | "ref" | "role" | "wrap"> & import("react").RefAttributes<HTMLUListElement>>;
|
|
440
|
+
/**
|
|
441
|
+
* @beta
|
|
442
|
+
*/
|
|
443
|
+
interface TreeItemProps {
|
|
904
444
|
expanded?: boolean;
|
|
905
|
-
fontSize?:
|
|
906
|
-
icon?: ElementType
|
|
445
|
+
fontSize?: number | number[];
|
|
446
|
+
icon?: React.ElementType;
|
|
907
447
|
/**
|
|
908
448
|
* Allows passing a custom element type to the link component
|
|
909
|
-
* @internal
|
|
910
449
|
*/
|
|
911
|
-
linkAs?:
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
450
|
+
linkAs?: ElementType;
|
|
451
|
+
/**
|
|
452
|
+
* Additional props for the link element that is rendered when `href` is set — e.g. `next/link`'s
|
|
453
|
+
* `prefetch` together with `linkAs={Link}`. Props controlled by `TreeItem` itself (`href`,
|
|
454
|
+
* `role`, `tabIndex`, `aria-expanded` and the ref) take precedence.
|
|
455
|
+
*/
|
|
456
|
+
linkProps?: React.HTMLProps<HTMLAnchorElement> & Record<string, unknown>;
|
|
457
|
+
padding?: number | number[];
|
|
458
|
+
gap?: number | number[];
|
|
459
|
+
/**
|
|
460
|
+
* @deprecated Use `gap` instead. `space` will be removed in v4.
|
|
461
|
+
*/
|
|
462
|
+
space?: number | number[];
|
|
463
|
+
text?: React.ReactNode;
|
|
464
|
+
weight?: ThemeFontWeightKey$1;
|
|
465
|
+
}
|
|
923
466
|
/**
|
|
924
467
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
925
468
|
* @beta
|
|
926
469
|
*/
|
|
927
|
-
declare function TreeItem<
|
|
470
|
+
declare function TreeItem(props: TreeItemProps & Omit<React.HTMLProps<HTMLLIElement>, 'as' | 'ref' | 'role'>): React.JSX.Element;
|
|
928
471
|
/**
|
|
929
472
|
* @beta
|
|
930
473
|
*/
|
|
@@ -940,43 +483,22 @@ interface TreeState {
|
|
|
940
483
|
interface TreeContextValue {
|
|
941
484
|
version: 0.0;
|
|
942
485
|
focusedElement: HTMLElement | null;
|
|
943
|
-
gap: ResponsiveProp$1<Space>;
|
|
944
486
|
level: number;
|
|
945
487
|
path: string[];
|
|
946
488
|
registerItem: (element: HTMLElement, path: string, expanded: boolean, selected: boolean) => void;
|
|
947
489
|
setExpanded: (path: string, expanded: boolean) => void;
|
|
948
490
|
setFocusedElement: (focusedElement: HTMLElement | null) => void;
|
|
491
|
+
gap: number | number[];
|
|
492
|
+
/**
|
|
493
|
+
* @deprecated Use `gap` instead. `space` will be removed in v4.
|
|
494
|
+
*/
|
|
495
|
+
space: number | number[];
|
|
949
496
|
state: TreeState;
|
|
950
497
|
}
|
|
951
498
|
/**
|
|
952
499
|
* @beta
|
|
953
500
|
*/
|
|
954
501
|
declare function useTree(): TreeContextValue;
|
|
955
|
-
/** @beta */
|
|
956
|
-
declare const DEFAULT_VIRTUAL_LIST_ELEMENT = "div";
|
|
957
|
-
/** @beta */
|
|
958
|
-
interface VirtualListChangeOpts {
|
|
959
|
-
fromIndex: number;
|
|
960
|
-
gap: number;
|
|
961
|
-
itemHeight: number;
|
|
962
|
-
scrollHeight: number;
|
|
963
|
-
scrollTop: number;
|
|
964
|
-
toIndex: number;
|
|
965
|
-
}
|
|
966
|
-
/** @beta */
|
|
967
|
-
interface VirtualListOwnProps<Item = any> {
|
|
968
|
-
gap?: Space;
|
|
969
|
-
getItemKey?: (item: Item, itemIndex: number) => string;
|
|
970
|
-
items?: Item[];
|
|
971
|
-
onChange?: (opts: VirtualListChangeOpts) => void;
|
|
972
|
-
renderItem?: (item: Item) => ReactNode;
|
|
973
|
-
}
|
|
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
502
|
/**
|
|
981
503
|
* @internal
|
|
982
504
|
*/
|
|
@@ -988,68 +510,69 @@ declare function _raf2(fn: () => void): () => void;
|
|
|
988
510
|
/**
|
|
989
511
|
* @internal
|
|
990
512
|
*/
|
|
991
|
-
declare function
|
|
992
|
-
/**
|
|
993
|
-
* @internal
|
|
994
|
-
*/
|
|
995
|
-
declare function isHTMLElement(node: unknown): node is HTMLElement;
|
|
996
|
-
/**
|
|
997
|
-
* @internal
|
|
998
|
-
*/
|
|
999
|
-
declare function isHTMLAnchorElement(element: unknown): element is HTMLAnchorElement;
|
|
513
|
+
declare function _hasFocus(element: HTMLElement): boolean;
|
|
1000
514
|
/**
|
|
1001
515
|
* @internal
|
|
1002
516
|
*/
|
|
1003
|
-
declare function
|
|
517
|
+
declare function isFocusable(element: HTMLElement): boolean;
|
|
1004
518
|
/**
|
|
1005
519
|
* @internal
|
|
1006
520
|
*/
|
|
1007
|
-
declare function
|
|
521
|
+
declare function attemptFocus(element: HTMLElement): boolean;
|
|
1008
522
|
/**
|
|
1009
523
|
* @internal
|
|
1010
524
|
*/
|
|
1011
|
-
declare function
|
|
525
|
+
declare function focusFirstDescendant(element: HTMLElement): boolean;
|
|
1012
526
|
/**
|
|
1013
527
|
* @internal
|
|
1014
528
|
*/
|
|
1015
|
-
declare function
|
|
529
|
+
declare function focusLastDescendant(element: HTMLElement): boolean;
|
|
1016
530
|
/**
|
|
1017
531
|
* @internal
|
|
1018
532
|
*/
|
|
1019
|
-
declare function
|
|
533
|
+
declare function _isScrollable(el: Node): boolean;
|
|
534
|
+
/** @beta */
|
|
535
|
+
type ArrayPropPrimitive = string | number | boolean | undefined | null;
|
|
1020
536
|
/**
|
|
1021
|
-
* @
|
|
537
|
+
* @deprecated instead of `useArrayProp(width)` use `Array.isArray(width) ? width : [width]` instead
|
|
538
|
+
* @beta
|
|
1022
539
|
*/
|
|
1023
|
-
declare function
|
|
540
|
+
declare function useArrayProp<T extends ArrayPropPrimitive = ArrayPropPrimitive>(val: T | T[] | undefined, defaultVal?: T[]): T[];
|
|
1024
541
|
/**
|
|
1025
|
-
* @
|
|
542
|
+
* @public
|
|
1026
543
|
*/
|
|
1027
|
-
|
|
544
|
+
type ClickOutsideListener = (event: MouseEvent) => void;
|
|
1028
545
|
/**
|
|
1029
|
-
* @
|
|
546
|
+
* @public
|
|
1030
547
|
*/
|
|
1031
|
-
|
|
548
|
+
type ClickOutsideElements = (HTMLElement | null | (HTMLElement | null)[])[];
|
|
1032
549
|
/**
|
|
1033
|
-
* @
|
|
550
|
+
* @public
|
|
551
|
+
* @deprecated replaced by the new `useClickOutsideEvent` hook, instead of:
|
|
552
|
+
* ```tsx
|
|
553
|
+
* const [button, setButtonElement] = useState(null)
|
|
554
|
+
* useClickOutside((event) => {}, [button])
|
|
555
|
+
* return <button ref={setButtonElement} />
|
|
556
|
+
* ```
|
|
557
|
+
* do:
|
|
558
|
+
* ```tsx
|
|
559
|
+
* const buttonRef = useRef()
|
|
560
|
+
* useClickOutsideEvent((event) => {}, () => [buttonRef.current])
|
|
561
|
+
* return <button ref={buttonRef} />
|
|
562
|
+
* ```
|
|
1034
563
|
*/
|
|
1035
|
-
declare function
|
|
564
|
+
declare function useClickOutside(listener: ClickOutsideListener, elementsArg?: ClickOutsideElements, boundaryElement?: HTMLElement | null): (el: HTMLElement | null) => void;
|
|
1036
565
|
/**
|
|
1037
|
-
* @
|
|
566
|
+
* @public
|
|
1038
567
|
*/
|
|
1039
|
-
|
|
568
|
+
type ClickOutsideEventListener = (event: MouseEvent) => void;
|
|
1040
569
|
/**
|
|
1041
|
-
* @
|
|
570
|
+
* @public
|
|
1042
571
|
*/
|
|
1043
|
-
|
|
572
|
+
type ClickOutsideEventElements = (HTMLElement | null | (HTMLElement | null)[])[];
|
|
1044
573
|
/**
|
|
1045
|
-
* @
|
|
574
|
+
* @public
|
|
1046
575
|
*/
|
|
1047
|
-
declare function _isScrollable(el: Node): boolean;
|
|
1048
|
-
/** @public */
|
|
1049
|
-
type ClickOutsideEventListener = (event: MouseEvent) => void;
|
|
1050
|
-
/** @public */
|
|
1051
|
-
type ClickOutsideEventElements = (HTMLElement | null | (HTMLElement | null)[])[];
|
|
1052
|
-
/** @public */
|
|
1053
576
|
declare function useClickOutsideEvent(listener: ClickOutsideEventListener | false | undefined, elementsArg?: () => ClickOutsideEventElements, boundaryElement?: () => HTMLElement | null): void;
|
|
1054
577
|
/**
|
|
1055
578
|
* @beta
|
|
@@ -1059,6 +582,13 @@ declare function useCustomValidity(ref: {
|
|
|
1059
582
|
setCustomValidity: (validity: string) => void;
|
|
1060
583
|
};
|
|
1061
584
|
}, customValidity: string | undefined): void;
|
|
585
|
+
/**
|
|
586
|
+
* Subscribe to the rect of a DOM element.
|
|
587
|
+
* @beta
|
|
588
|
+
*
|
|
589
|
+
* @deprecated Use `useElementSize` instead
|
|
590
|
+
*/
|
|
591
|
+
declare function useElementRect(element: HTMLElement | null): DOMRectReadOnly | null;
|
|
1062
592
|
/**
|
|
1063
593
|
* @beta
|
|
1064
594
|
*/
|
|
@@ -1100,6 +630,17 @@ declare const _elementSizeObserver: _ElementSizeObserver;
|
|
|
1100
630
|
* @beta
|
|
1101
631
|
*/
|
|
1102
632
|
declare function useElementSize(element: HTMLElement | null): ElementSize | null;
|
|
633
|
+
/**
|
|
634
|
+
* @beta
|
|
635
|
+
* @deprecated use `useImperativeHandle` instead
|
|
636
|
+
* @example
|
|
637
|
+
* ```diff
|
|
638
|
+
* -const ref = useForwardedRef(forwardedRef)
|
|
639
|
+
* +const ref = useRef(null)
|
|
640
|
+
* +useImperativeHandle(forwardedRef, () => ref.current)
|
|
641
|
+
* ```
|
|
642
|
+
*/
|
|
643
|
+
declare function useForwardedRef<T>(ref: React.ForwardedRef<T>): React.RefObject<T | null>;
|
|
1103
644
|
/**
|
|
1104
645
|
* Adds global keydown event listener to the window.
|
|
1105
646
|
*
|
|
@@ -1111,7 +652,7 @@ declare function useGlobalKeyDown(onKeyDown: (event: KeyboardEvent) => void, opt
|
|
|
1111
652
|
/**
|
|
1112
653
|
* Efficiently subscribes to `window.matchMedia` queries
|
|
1113
654
|
*
|
|
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)
|
|
655
|
+
* @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)
|
|
1115
656
|
*
|
|
1116
657
|
* @public
|
|
1117
658
|
*/
|
|
@@ -1121,29 +662,17 @@ declare function useMatchMedia(mediaQueryString: `(${string})`, getServerSnapsho
|
|
|
1121
662
|
*/
|
|
1122
663
|
interface _MediaStore {
|
|
1123
664
|
subscribe: (onStoreChange: () => void) => () => void;
|
|
1124
|
-
getSnapshot: () =>
|
|
665
|
+
getSnapshot: () => number;
|
|
1125
666
|
}
|
|
1126
667
|
/**
|
|
1127
668
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
1128
669
|
* @beta
|
|
1129
670
|
*/
|
|
1130
|
-
declare function useMediaIndex():
|
|
1131
|
-
/**
|
|
1132
|
-
* Returns true if a dark color scheme is preferred, false if a light color scheme is preferred or the preference is not known.
|
|
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
|
|
1139
|
-
*
|
|
1140
|
-
* @public
|
|
1141
|
-
*/
|
|
1142
|
-
declare function usePrefersDark(getServerSnapshot?: () => boolean): boolean;
|
|
671
|
+
declare function useMediaIndex(): number;
|
|
1143
672
|
/**
|
|
1144
673
|
* Returns true if motion should be reduced
|
|
1145
674
|
*
|
|
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)
|
|
675
|
+
* @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)
|
|
1147
676
|
*
|
|
1148
677
|
* If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
|
|
1149
678
|
* 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
|
|
@@ -1152,409 +681,286 @@ declare function usePrefersDark(getServerSnapshot?: () => boolean): boolean;
|
|
|
1152
681
|
* @public
|
|
1153
682
|
*/
|
|
1154
683
|
declare function usePrefersReducedMotion(getServerSnapshot?: () => boolean): boolean;
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
/** @public */
|
|
684
|
+
/**
|
|
685
|
+
* @internal
|
|
686
|
+
*/
|
|
687
|
+
declare const _ResizeObserver: typeof ResizeObserver;
|
|
688
|
+
/**
|
|
689
|
+
* @public
|
|
690
|
+
*/
|
|
1163
691
|
type AvatarPosition = 'top' | 'bottom' | 'inside';
|
|
1164
|
-
/**
|
|
1165
|
-
|
|
1166
|
-
|
|
692
|
+
/**
|
|
693
|
+
* @public
|
|
694
|
+
*/
|
|
695
|
+
type AvatarSize = 0 | 1 | 2 | 3;
|
|
696
|
+
/**
|
|
697
|
+
* @public
|
|
698
|
+
*/
|
|
699
|
+
type AvatarStatus = 'online' | 'editing' | 'inactive';
|
|
700
|
+
/**
|
|
701
|
+
* @public
|
|
702
|
+
*/
|
|
1167
703
|
interface AvatarOwnProps {
|
|
1168
704
|
/** @beta */
|
|
1169
705
|
__unstable_hideInnerStroke?: boolean;
|
|
1170
706
|
animateArrowFrom?: AvatarPosition;
|
|
1171
707
|
arrowPosition?: AvatarPosition;
|
|
1172
|
-
color?:
|
|
708
|
+
color?: ThemeColorAvatarColorKey;
|
|
1173
709
|
initials?: string;
|
|
1174
710
|
onImageLoadError?: (event: Error) => void;
|
|
1175
|
-
size?:
|
|
711
|
+
size?: AvatarSize | AvatarSize[];
|
|
1176
712
|
src?: string;
|
|
713
|
+
/**
|
|
714
|
+
* The status of the entity this Avatar represents.
|
|
715
|
+
* @alpha
|
|
716
|
+
*/
|
|
717
|
+
status?: AvatarStatus;
|
|
1177
718
|
title?: string;
|
|
1178
719
|
}
|
|
1179
|
-
/**
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
type AvatarProps<E extends
|
|
720
|
+
/**
|
|
721
|
+
* @public
|
|
722
|
+
*/
|
|
723
|
+
type AvatarProps<E extends ElementType = 'div'> = Props<AvatarOwnProps, E>;
|
|
1183
724
|
/**
|
|
1184
725
|
* Avatars are used to represent people and other agents (e.g. bots).
|
|
1185
726
|
*
|
|
1186
727
|
* @public
|
|
1187
728
|
*/
|
|
1188
|
-
declare
|
|
1189
|
-
/**
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
interface
|
|
729
|
+
declare const Avatar: <E extends ElementType = 'div'>(props: AvatarProps<E>) => React.JSX.Element;
|
|
730
|
+
/**
|
|
731
|
+
* @public
|
|
732
|
+
*/
|
|
733
|
+
interface AvatarCounterProps {
|
|
1193
734
|
count: number;
|
|
1194
|
-
size?:
|
|
735
|
+
size?: AvatarSize | AvatarSize[];
|
|
736
|
+
/** @deprecated No longer supported. */
|
|
737
|
+
tone?: 'navbar';
|
|
1195
738
|
}
|
|
1196
|
-
/**
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
/**
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
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[];
|
|
739
|
+
/**
|
|
740
|
+
* @public
|
|
741
|
+
*/
|
|
742
|
+
declare const AvatarCounter: import("react").ForwardRefExoticComponent<AvatarCounterProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
743
|
+
/**
|
|
744
|
+
* @public
|
|
745
|
+
*/
|
|
746
|
+
interface AvatarStackProps {
|
|
747
|
+
children: React.ReactNode;
|
|
1209
748
|
maxLength?: number;
|
|
1210
|
-
size?:
|
|
1211
|
-
|
|
1212
|
-
|
|
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>;
|
|
749
|
+
size?: AvatarSize | AvatarSize[];
|
|
750
|
+
/** @deprecated No longer supported. */
|
|
751
|
+
tone?: 'navbar';
|
|
1223
752
|
}
|
|
1224
|
-
/** @public */
|
|
1225
|
-
type BadgeElementType = 'div' | 'span' | ComponentType;
|
|
1226
|
-
/** @public */
|
|
1227
|
-
type BadgeProps<E extends BadgeElementType = BadgeElementType> = Props<BadgeOwnProps, E>;
|
|
1228
753
|
/**
|
|
1229
|
-
* Badges are used to tag resources.
|
|
1230
|
-
*
|
|
1231
754
|
* @public
|
|
1232
755
|
*/
|
|
1233
|
-
declare
|
|
1234
|
-
/**
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
tone: CardTone;
|
|
1240
|
-
scheme: ColorScheme;
|
|
1241
|
-
}): React.JSX.Element;
|
|
1242
|
-
/** @public */
|
|
1243
|
-
interface CardContextValue {
|
|
1244
|
-
tone: CardTone;
|
|
1245
|
-
scheme: ColorScheme;
|
|
756
|
+
declare const AvatarStack: import("react").ForwardRefExoticComponent<AvatarStackProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
757
|
+
/**
|
|
758
|
+
* @internal
|
|
759
|
+
*/
|
|
760
|
+
interface AvatarRootStyleProps {
|
|
761
|
+
$color: ThemeColorAvatarColorKey;
|
|
1246
762
|
}
|
|
1247
|
-
/**
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
}>;
|
|
1253
|
-
/** @internal */
|
|
1254
|
-
interface _CardInternalContextValue {
|
|
1255
|
-
CompatProvider?: _CardCompatProviderComponent;
|
|
1256
|
-
root: boolean;
|
|
763
|
+
/**
|
|
764
|
+
* @internal
|
|
765
|
+
*/
|
|
766
|
+
interface ResponsiveAvatarSizeStyleProps {
|
|
767
|
+
$size: AvatarSize[];
|
|
1257
768
|
}
|
|
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
769
|
/**
|
|
1272
|
-
* Checkboxes allow the user to select one or more items from a set.
|
|
1273
|
-
*
|
|
1274
770
|
* @public
|
|
771
|
+
* @deprecated No longer used
|
|
1275
772
|
*/
|
|
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>;
|
|
773
|
+
type BadgeMode = 'default' | 'outline';
|
|
1297
774
|
/**
|
|
1298
|
-
*
|
|
775
|
+
* @public
|
|
776
|
+
*/
|
|
777
|
+
type BadgeTone = ThemeColorStateToneKey;
|
|
778
|
+
/**
|
|
779
|
+
* @public
|
|
780
|
+
*/
|
|
781
|
+
interface BadgeOwnProps extends BoxOwnProps, ResponsiveRadiusProps {
|
|
782
|
+
fontSize?: number | number[];
|
|
783
|
+
/** @deprecated No longer used. */
|
|
784
|
+
mode?: BadgeMode;
|
|
785
|
+
tone?: BadgeTone;
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* @public
|
|
789
|
+
*/
|
|
790
|
+
type BadgeProps<E extends ElementType = 'div'> = Props<BadgeOwnProps, E>;
|
|
791
|
+
/**
|
|
792
|
+
* Badges are used to tag resources.
|
|
1299
793
|
*
|
|
1300
794
|
* @public
|
|
1301
795
|
*/
|
|
1302
|
-
declare
|
|
796
|
+
declare const Badge: <E extends ElementType = 'div'>(props: BadgeProps<E>) => React.JSX.Element;
|
|
1303
797
|
/**
|
|
1304
798
|
* @internal
|
|
1305
799
|
*/
|
|
1306
|
-
interface
|
|
1307
|
-
$
|
|
800
|
+
interface CardStyleProps {
|
|
801
|
+
$checkered: boolean;
|
|
802
|
+
$focusRing: boolean;
|
|
803
|
+
$muted: boolean;
|
|
804
|
+
$tone: ThemeColorToneKey;
|
|
1308
805
|
}
|
|
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
806
|
/**
|
|
1318
|
-
* The `Grid` component is for building 2-dimensional layers (based on CSS grid).
|
|
1319
|
-
*
|
|
1320
807
|
* @public
|
|
1321
808
|
*/
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
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>;
|
|
809
|
+
interface CheckboxProps {
|
|
810
|
+
indeterminate?: boolean;
|
|
811
|
+
customValidity?: string;
|
|
812
|
+
}
|
|
1331
813
|
/**
|
|
1332
|
-
*
|
|
814
|
+
* Checkboxes allow the user to select one or more items from a set.
|
|
1333
815
|
*
|
|
1334
816
|
* @public
|
|
1335
817
|
*/
|
|
1336
|
-
declare
|
|
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>;
|
|
818
|
+
declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").HTMLProps<HTMLInputElement>, "as" | "type"> & CheckboxProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
1345
819
|
/**
|
|
1346
|
-
* The `Inline` component is a layout utility for aligning and spacing items horizontally.
|
|
1347
|
-
*
|
|
1348
820
|
* @public
|
|
1349
821
|
*/
|
|
1350
|
-
|
|
1351
|
-
/**
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
type KBDElementType = 'kbd' | ComponentType;
|
|
1357
|
-
/** @public */
|
|
1358
|
-
type KBDProps<E extends KBDElementType = KBDElementType> = Props<KBDOwnProps, E>;
|
|
822
|
+
interface CodeOwnProps {
|
|
823
|
+
/** Define the language to use for syntax highlighting. */
|
|
824
|
+
language?: string;
|
|
825
|
+
size?: number | number[];
|
|
826
|
+
weight?: string;
|
|
827
|
+
}
|
|
1359
828
|
/**
|
|
1360
|
-
* Used to define some text as keyboard input.
|
|
1361
|
-
*
|
|
1362
829
|
* @public
|
|
1363
830
|
*/
|
|
1364
|
-
|
|
1365
|
-
/** @public */
|
|
1366
|
-
declare const DEFAULT_LABEL_ELEMENT = "div";
|
|
1367
|
-
/** @public */
|
|
1368
|
-
type LabelOwnProps = LabelStyleProps & TextOverflowStyleProps;
|
|
1369
|
-
/** @public */
|
|
1370
|
-
type LabelElementType = 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label' | 'li' | 'p' | 'span' | ComponentType;
|
|
1371
|
-
/** @public */
|
|
1372
|
-
type LabelProps<E extends LabelElementType = LabelElementType> = Props<LabelOwnProps, E>;
|
|
831
|
+
type CodeProps<E extends ElementType = 'pre'> = Props<CodeOwnProps, E>;
|
|
1373
832
|
/**
|
|
1374
|
-
*
|
|
833
|
+
* @public
|
|
834
|
+
*/
|
|
835
|
+
declare const Code: <E extends ElementType = 'pre'>(props: CodeProps<E>) => React.JSX.Element;
|
|
836
|
+
/**
|
|
837
|
+
* @public
|
|
838
|
+
*/
|
|
839
|
+
interface ContainerOwnProps extends BoxOwnProps, ResponsiveWidthProps {}
|
|
840
|
+
/**
|
|
841
|
+
* @public
|
|
842
|
+
*/
|
|
843
|
+
type ContainerProps<E extends ElementType = 'div'> = Props<ContainerOwnProps, E>;
|
|
844
|
+
/**
|
|
845
|
+
* The `Container` component wraps content layout in a defined set of widths.
|
|
1375
846
|
*
|
|
1376
847
|
* @public
|
|
1377
848
|
*/
|
|
1378
|
-
declare
|
|
1379
|
-
/**
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
849
|
+
declare const Container: <E extends ElementType = 'div'>(props: ContainerProps<E>) => React.JSX.Element;
|
|
850
|
+
/**
|
|
851
|
+
* @internal
|
|
852
|
+
*/
|
|
853
|
+
interface ResponsiveWidthStyleProps {
|
|
854
|
+
$width: (number | 'auto')[];
|
|
1383
855
|
}
|
|
1384
|
-
/**
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
interface
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
856
|
+
/**
|
|
857
|
+
* @public
|
|
858
|
+
*/
|
|
859
|
+
interface HeadingOwnProps {
|
|
860
|
+
accent?: boolean;
|
|
861
|
+
align?: TextAlign | TextAlign[];
|
|
862
|
+
muted?: boolean;
|
|
863
|
+
size?: number | number[];
|
|
864
|
+
/**
|
|
865
|
+
* Controls how overflowing text is treated.
|
|
866
|
+
* Use `textOverflow="ellipsis"` to render text as a single line which is concatenated with a `…` symbol.
|
|
867
|
+
* @beta
|
|
868
|
+
*/
|
|
869
|
+
textOverflow?: 'ellipsis';
|
|
870
|
+
weight?: ThemeFontWeightKey$1;
|
|
1394
871
|
}
|
|
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
872
|
/**
|
|
1408
|
-
* The `Radio` component allows the user to select one option from a set.
|
|
1409
|
-
*
|
|
1410
873
|
* @public
|
|
1411
874
|
*/
|
|
1412
|
-
|
|
1413
|
-
/** @public */
|
|
1414
|
-
declare const DEFAULT_SELECT_ELEMENT = "select";
|
|
1415
|
-
/** @public */
|
|
1416
|
-
type SelectOwnProps = SelectStyleProps & {
|
|
1417
|
-
customValidity?: string;
|
|
1418
|
-
readOnly?: boolean;
|
|
1419
|
-
};
|
|
1420
|
-
/** @public */
|
|
1421
|
-
type SelectElementType = 'select' | ComponentType;
|
|
1422
|
-
/** @public */
|
|
1423
|
-
type SelectProps<E extends SelectElementType = SelectElementType> = Props<SelectOwnProps, E>;
|
|
875
|
+
type HeadingProps<E extends ElementType = 'div'> = Props<HeadingOwnProps, E>;
|
|
1424
876
|
/**
|
|
1425
|
-
*
|
|
877
|
+
* Typographic headings.
|
|
1426
878
|
*
|
|
1427
879
|
* @public
|
|
1428
880
|
*/
|
|
1429
|
-
declare
|
|
1430
|
-
/** @beta */
|
|
1431
|
-
declare const DEFAULT_SKELETON_ELEMENT = "div";
|
|
881
|
+
declare const Heading: <E extends ElementType = 'div'>(props: HeadingProps<E>) => React.JSX.Element;
|
|
1432
882
|
/**
|
|
1433
|
-
*
|
|
1434
|
-
* @beta
|
|
883
|
+
* @public
|
|
1435
884
|
*/
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
type SkeletonElementType = 'div' | 'span' | ComponentType;
|
|
1442
|
-
/** @beta */
|
|
1443
|
-
type SkeletonProps<E extends SkeletonElementType = SkeletonElementType> = Props<SkeletonOwnProps, E>;
|
|
885
|
+
interface KBDOwnProps {
|
|
886
|
+
fontSize?: number | number[];
|
|
887
|
+
padding?: number | number[];
|
|
888
|
+
radius?: Radius | Radius[];
|
|
889
|
+
}
|
|
1444
890
|
/**
|
|
1445
|
-
*
|
|
1446
|
-
* @beta
|
|
891
|
+
* @public
|
|
1447
892
|
*/
|
|
1448
|
-
|
|
1449
|
-
/** @beta */
|
|
1450
|
-
declare const DEFAULT_CODE_SKELETON_ELEMENT = "div";
|
|
1451
|
-
/** @beta */
|
|
1452
|
-
type CodeSkeletonOwnProps = SkeletonOwnProps & {
|
|
1453
|
-
size?: ResponsiveProp$1<FontCodeSize>;
|
|
1454
|
-
};
|
|
1455
|
-
/** @beta */
|
|
1456
|
-
type CodeSkeletonElementType = SkeletonElementType;
|
|
893
|
+
type KBDProps<E extends ElementType = 'kbd'> = Props<KBDOwnProps, E>;
|
|
1457
894
|
/**
|
|
1458
|
-
*
|
|
1459
|
-
*
|
|
895
|
+
* Used to define some text as keyboard input.
|
|
896
|
+
*
|
|
897
|
+
* @public
|
|
1460
898
|
*/
|
|
1461
|
-
|
|
899
|
+
declare const KBD: <E extends ElementType = 'kbd'>(props: KBDProps<E>) => React.JSX.Element;
|
|
1462
900
|
/**
|
|
1463
|
-
*
|
|
1464
|
-
* @beta
|
|
901
|
+
* @public
|
|
1465
902
|
*/
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
903
|
+
interface LabelOwnProps {
|
|
904
|
+
accent?: boolean;
|
|
905
|
+
align?: TextAlign | TextAlign[];
|
|
906
|
+
muted?: boolean;
|
|
907
|
+
size?: number | number[];
|
|
908
|
+
/**
|
|
909
|
+
* Controls how overflowing text is treated.
|
|
910
|
+
* Use `textOverflow="ellipsis"` to render text as a single line which is concatenated with a `…` symbol.
|
|
911
|
+
* @beta
|
|
912
|
+
*/
|
|
913
|
+
textOverflow?: 'ellipsis';
|
|
914
|
+
weight?: ThemeFontWeightKey$1;
|
|
915
|
+
}
|
|
1475
916
|
/**
|
|
1476
|
-
*
|
|
1477
|
-
* @beta
|
|
917
|
+
* @public
|
|
1478
918
|
*/
|
|
1479
|
-
type
|
|
919
|
+
type LabelProps<E extends ElementType = 'div'> = Props<LabelOwnProps, E>;
|
|
1480
920
|
/**
|
|
1481
|
-
*
|
|
1482
|
-
*
|
|
921
|
+
* Typographic labels.
|
|
922
|
+
*
|
|
923
|
+
* @public
|
|
1483
924
|
*/
|
|
1484
|
-
declare
|
|
1485
|
-
/** @beta */
|
|
1486
|
-
declare const DEFAULT_LABEL_SKELETON_ELEMENT = "div";
|
|
1487
|
-
/** @beta */
|
|
1488
|
-
type LabelSkeletonOwnProps = SkeletonOwnProps & {
|
|
1489
|
-
size?: ResponsiveProp$1<FontLabelSize>;
|
|
1490
|
-
};
|
|
1491
|
-
/** @beta */
|
|
1492
|
-
type LabelSkeletonElementType = SkeletonElementType;
|
|
925
|
+
declare const Label: <E extends ElementType = 'div'>(props: LabelProps<E>) => React.JSX.Element;
|
|
1493
926
|
/**
|
|
1494
|
-
*
|
|
1495
|
-
* @beta
|
|
927
|
+
* @public
|
|
1496
928
|
*/
|
|
1497
|
-
|
|
929
|
+
interface RadioProps {
|
|
930
|
+
customValidity?: string;
|
|
931
|
+
}
|
|
1498
932
|
/**
|
|
1499
|
-
*
|
|
1500
|
-
*
|
|
933
|
+
* The `Radio` component allows the user to select one option from a set.
|
|
934
|
+
*
|
|
935
|
+
* @public
|
|
1501
936
|
*/
|
|
1502
|
-
declare
|
|
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;
|
|
937
|
+
declare const Radio: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").HTMLProps<HTMLInputElement>, "as" | "type"> & RadioProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
1511
938
|
/**
|
|
1512
|
-
*
|
|
1513
|
-
* @beta
|
|
939
|
+
* @public
|
|
1514
940
|
*/
|
|
1515
|
-
|
|
941
|
+
interface SelectProps {
|
|
942
|
+
fontSize?: number | number[];
|
|
943
|
+
gap?: number | number[];
|
|
944
|
+
padding?: number | number[];
|
|
945
|
+
radius?: Radius | Radius[];
|
|
946
|
+
/**
|
|
947
|
+
* @deprecated Use `gap` instead. `space` will be removed in v4.
|
|
948
|
+
*/
|
|
949
|
+
space?: number | number[];
|
|
950
|
+
customValidity?: string;
|
|
951
|
+
}
|
|
1516
952
|
/**
|
|
1517
|
-
*
|
|
1518
|
-
*
|
|
953
|
+
* The `Select` component provides control of options.
|
|
954
|
+
*
|
|
955
|
+
* @public
|
|
1519
956
|
*/
|
|
1520
|
-
declare
|
|
1521
|
-
/** @public */
|
|
1522
|
-
declare const DEFAULT_SPINNER_ELEMENT = "div";
|
|
1523
|
-
/** @public */
|
|
1524
|
-
type SpinnerOwnProps = {
|
|
1525
|
-
muted?: boolean;
|
|
1526
|
-
size?: ResponsiveProp$1<FontTextSize>;
|
|
1527
|
-
};
|
|
1528
|
-
/** @public */
|
|
1529
|
-
type SpinnerElementType = 'div' | 'span' | ComponentType;
|
|
1530
|
-
/** @public */
|
|
1531
|
-
type SpinnerProps<E extends SpinnerElementType = SpinnerElementType> = Props<SpinnerOwnProps, E>;
|
|
957
|
+
declare const Select: import("react").ForwardRefExoticComponent<Omit<SelectProps & Omit<import("react").HTMLProps<HTMLSelectElement>, "as">, "ref"> & import("react").RefAttributes<HTMLSelectElement>>;
|
|
1532
958
|
/**
|
|
1533
|
-
* Indicate that something is loading for an indeterminate amount of time.
|
|
1534
|
-
*
|
|
1535
959
|
* @public
|
|
1536
960
|
*/
|
|
1537
|
-
|
|
1538
|
-
/** @public */
|
|
1539
|
-
declare const DEFAULT_SR_ONLY_ELEMENT = "span";
|
|
1540
|
-
/** @public */
|
|
1541
|
-
type SrOnlyOwnProps = {};
|
|
1542
|
-
/** @public */
|
|
1543
|
-
type SrOnlyElementType = 'span' | ComponentType;
|
|
1544
|
-
/** @public */
|
|
1545
|
-
type SrOnlyProps<E extends SrOnlyElementType = SrOnlyElementType> = Props<SrOnlyOwnProps, E>;
|
|
1546
|
-
/** @public */
|
|
1547
|
-
declare function SrOnly<E extends SrOnlyElementType = typeof DEFAULT_SR_ONLY_ELEMENT>(props: SrOnlyProps<E>): React.JSX.Element;
|
|
1548
|
-
/** @public */
|
|
1549
|
-
declare const DEFAULT_SWITCH_ELEMENT = "input";
|
|
1550
|
-
/** @public */
|
|
1551
|
-
type SwitchOwnProps = {
|
|
961
|
+
interface SwitchProps {
|
|
1552
962
|
indeterminate?: boolean;
|
|
1553
|
-
}
|
|
1554
|
-
/** @public */
|
|
1555
|
-
type SwitchElementType = 'input' | ComponentType;
|
|
1556
|
-
/** @public */
|
|
1557
|
-
type SwitchProps<E extends SwitchElementType = SwitchElementType> = Props<SwitchOwnProps, E>;
|
|
963
|
+
}
|
|
1558
964
|
/**
|
|
1559
965
|
* The `Switch` component allows the user to toggle a setting on and off.
|
|
1560
966
|
*
|
|
@@ -1562,57 +968,46 @@ type SwitchProps<E extends SwitchElementType = SwitchElementType> = Props<Switch
|
|
|
1562
968
|
*
|
|
1563
969
|
* @public
|
|
1564
970
|
*/
|
|
1565
|
-
declare
|
|
1566
|
-
/**
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
interface
|
|
1570
|
-
children: React.ReactNode;
|
|
1571
|
-
/** Language to use for syntax highlighting. */
|
|
1572
|
-
language?: string;
|
|
1573
|
-
}
|
|
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 & {
|
|
971
|
+
declare const Switch: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").HTMLProps<HTMLInputElement>, "as" | "type"> & SwitchProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
972
|
+
/**
|
|
973
|
+
* @public
|
|
974
|
+
*/
|
|
975
|
+
interface TextAreaProps extends ResponsiveRadiusProps {
|
|
1580
976
|
/**
|
|
1581
977
|
* @beta
|
|
1582
978
|
*/
|
|
1583
979
|
__unstable_disableFocusRing?: boolean;
|
|
980
|
+
border?: boolean;
|
|
1584
981
|
customValidity?: string;
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
type TextAreaProps<E extends TextAreaElementType = TextAreaElementType> = Props<TextAreaOwnProps, E>;
|
|
982
|
+
fontSize?: number | number[];
|
|
983
|
+
padding?: number | number[];
|
|
984
|
+
weight?: ThemeFontWeightKey$1;
|
|
985
|
+
}
|
|
1590
986
|
/**
|
|
1591
987
|
* A multiline text input.
|
|
1592
988
|
*
|
|
1593
989
|
* @public
|
|
1594
990
|
*/
|
|
1595
|
-
declare
|
|
991
|
+
declare const TextArea: import("react").ForwardRefExoticComponent<Omit<TextAreaProps & Omit<import("react").HTMLProps<HTMLTextAreaElement>, "as">, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
1596
992
|
/**
|
|
1597
993
|
* @beta
|
|
1598
994
|
*/
|
|
1599
995
|
interface TooltipDelayGroupContextValue {
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
visibleTooltipId: string | undefined;
|
|
996
|
+
setIsGroupActive: (nextState: React.SetStateAction<boolean>, delay?: number | undefined) => void;
|
|
997
|
+
setOpenTooltipId: (nextId: string | null, delay?: number | undefined) => void;
|
|
998
|
+
openDelay: number;
|
|
999
|
+
closeDelay: number;
|
|
1000
|
+
openTooltipId: string | null;
|
|
1606
1001
|
}
|
|
1607
1002
|
/**
|
|
1608
1003
|
* @beta
|
|
1609
1004
|
*/
|
|
1610
|
-
declare const TooltipDelayGroupContext: Context<TooltipDelayGroupContextValue | null>;
|
|
1005
|
+
declare const TooltipDelayGroupContext: import("react").Context<TooltipDelayGroupContextValue | null>;
|
|
1611
1006
|
/**
|
|
1612
1007
|
* @public
|
|
1613
1008
|
* */
|
|
1614
1009
|
interface TooltipDelayGroupProviderProps {
|
|
1615
|
-
children?: ReactNode;
|
|
1010
|
+
children?: React.ReactNode;
|
|
1616
1011
|
/**
|
|
1617
1012
|
* Handles the delays to open or close a tooltip inside a group
|
|
1618
1013
|
*
|
|
@@ -1622,53 +1017,170 @@ interface TooltipDelayGroupProviderProps {
|
|
|
1622
1017
|
*
|
|
1623
1018
|
* @public
|
|
1624
1019
|
*/
|
|
1625
|
-
delay
|
|
1020
|
+
delay: Delay;
|
|
1626
1021
|
}
|
|
1627
1022
|
/**
|
|
1628
1023
|
* @public
|
|
1629
1024
|
* Provides context for a group of tooltip elements that should share a delay
|
|
1630
|
-
* which temporarily becomes
|
|
1025
|
+
* which temporarily becomes 1 ms after the first floating element of the group opens.
|
|
1631
1026
|
*/
|
|
1632
1027
|
declare function TooltipDelayGroupProvider(props: TooltipDelayGroupProviderProps): React.JSX.Element;
|
|
1633
1028
|
/**
|
|
1634
1029
|
* @beta
|
|
1635
1030
|
*/
|
|
1636
1031
|
declare function useTooltipDelayGroup(): TooltipDelayGroupContextValue | null;
|
|
1637
|
-
/**
|
|
1032
|
+
/**
|
|
1033
|
+
* @internal
|
|
1034
|
+
*/
|
|
1035
|
+
interface ThemeProps {
|
|
1036
|
+
theme: Theme$1;
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* @internal
|
|
1040
|
+
*/
|
|
1041
|
+
interface ResponsiveFontSizeStyleProps {
|
|
1042
|
+
$size: number[];
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* @internal
|
|
1046
|
+
*/
|
|
1047
|
+
interface FontWeightStyleProps {
|
|
1048
|
+
$weight?: ThemeFontWeightKey$1;
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* @internal
|
|
1052
|
+
*/
|
|
1053
|
+
interface ResponsiveTextAlignStyleProps {
|
|
1054
|
+
$align: TextAlign[];
|
|
1055
|
+
}
|
|
1056
|
+
/**
|
|
1057
|
+
* @internal
|
|
1058
|
+
*/
|
|
1059
|
+
interface ResponsiveFontStyleProps extends FontWeightStyleProps, ResponsiveFontSizeStyleProps, ResponsiveTextAlignStyleProps {
|
|
1060
|
+
$accent?: boolean;
|
|
1061
|
+
$muted?: boolean;
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Get responsive CSS for the `code` font style.
|
|
1065
|
+
* @internal
|
|
1066
|
+
*/
|
|
1067
|
+
declare function responsiveCodeFontStyle(props: FontWeightStyleProps & ResponsiveFontSizeStyleProps & ThemeProps): CSSObject[];
|
|
1068
|
+
/**
|
|
1069
|
+
* Get responsive CSS for the `heading` font style.
|
|
1070
|
+
* @internal
|
|
1071
|
+
*/
|
|
1072
|
+
declare function responsiveHeadingFont(props: ResponsiveFontStyleProps & ThemeProps): CSSObject[];
|
|
1073
|
+
/**
|
|
1074
|
+
* Get responsive CSS for the `label` font style.
|
|
1075
|
+
* @internal
|
|
1076
|
+
*/
|
|
1077
|
+
declare function responsiveLabelFont(props: ResponsiveFontStyleProps & ThemeProps): CSSObject[];
|
|
1078
|
+
/**
|
|
1079
|
+
* Get responsive text align styles.
|
|
1080
|
+
* @internal
|
|
1081
|
+
*/
|
|
1082
|
+
declare function responsiveTextAlignStyle(props: ResponsiveTextAlignStyleProps & ThemeProps): CSSObject[];
|
|
1083
|
+
/**
|
|
1084
|
+
* Get responsive CSS for the `text` font style.
|
|
1085
|
+
* @internal
|
|
1086
|
+
*/
|
|
1087
|
+
declare function responsiveTextFont(props: ResponsiveFontStyleProps & ThemeProps): CSSObject[];
|
|
1088
|
+
/**
|
|
1089
|
+
* @internal
|
|
1090
|
+
*/
|
|
1091
|
+
declare function _fillCSSObject(keys: string[], value: string | number | CSSObject): CSSObject;
|
|
1092
|
+
/**
|
|
1093
|
+
* @public
|
|
1094
|
+
*/
|
|
1095
|
+
declare function rem(pixelValue: number): string | 0;
|
|
1096
|
+
/**
|
|
1097
|
+
* @internal
|
|
1098
|
+
*/
|
|
1099
|
+
declare function _responsive<T>(media: number[], values: T[], callback: (value: T, index: number, array: T[]) => CSSObject): CSSObject[];
|
|
1100
|
+
/**
|
|
1101
|
+
* @internal
|
|
1102
|
+
*/
|
|
1103
|
+
declare function _getArrayProp<T = number>(val: T | T[] | undefined, defaultVal?: T[]): T[];
|
|
1104
|
+
/**
|
|
1105
|
+
* @internal
|
|
1106
|
+
*/
|
|
1107
|
+
declare function _getResponsiveSpace(theme: Theme$1, props: string[], spaceIndexes?: number[]): CSSObject[] | null;
|
|
1108
|
+
/**
|
|
1109
|
+
* @public
|
|
1110
|
+
*/
|
|
1111
|
+
interface ThemeColorProviderProps {
|
|
1112
|
+
children?: React.ReactNode;
|
|
1113
|
+
scheme?: ThemeColorSchemeKey$1;
|
|
1114
|
+
tone?: ThemeColorCardToneKey;
|
|
1115
|
+
}
|
|
1116
|
+
/**
|
|
1117
|
+
* @public
|
|
1118
|
+
*/
|
|
1119
|
+
declare function ThemeColorProvider(props: ThemeColorProviderProps): React.JSX.Element;
|
|
1120
|
+
/**
|
|
1121
|
+
* @public
|
|
1122
|
+
*/
|
|
1123
|
+
interface ThemeContextValue {
|
|
1124
|
+
/** @deprecated No longer used */
|
|
1125
|
+
version: 0.0;
|
|
1126
|
+
scheme: ThemeColorSchemeKey$1;
|
|
1127
|
+
theme: RootTheme$1;
|
|
1128
|
+
tone: ThemeColorCardToneKey;
|
|
1129
|
+
}
|
|
1130
|
+
/**
|
|
1131
|
+
* @public
|
|
1132
|
+
*/
|
|
1133
|
+
declare function useRootTheme(): ThemeContextValue;
|
|
1134
|
+
/** @internal */
|
|
1135
|
+
declare const Arrow: import("react").ForwardRefExoticComponent<Omit<{
|
|
1136
|
+
width: number;
|
|
1137
|
+
height: number;
|
|
1138
|
+
radius?: number;
|
|
1139
|
+
} & Omit<HTMLProps<HTMLDivElement>, "height" | "width">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
1140
|
+
/**
|
|
1141
|
+
* @public
|
|
1142
|
+
*/
|
|
1638
1143
|
interface BoundaryElementProviderProps {
|
|
1639
|
-
children: ReactNode;
|
|
1144
|
+
children: React.ReactNode;
|
|
1640
1145
|
element: HTMLElement | null;
|
|
1641
1146
|
}
|
|
1642
|
-
/**
|
|
1147
|
+
/**
|
|
1148
|
+
* @public
|
|
1149
|
+
*/
|
|
1643
1150
|
declare function BoundaryElementProvider(props: BoundaryElementProviderProps): React.JSX.Element;
|
|
1644
|
-
/**
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1151
|
+
/**
|
|
1152
|
+
* @public
|
|
1153
|
+
*/
|
|
1154
|
+
interface BoundaryElementContextValue {
|
|
1648
1155
|
version: 0.0;
|
|
1649
|
-
element:
|
|
1650
|
-
}
|
|
1651
|
-
/** @beta */
|
|
1652
|
-
declare const DEFAULT_ELEMENT_QUERY_ELEMENT = "div";
|
|
1156
|
+
element: HTMLElement | null;
|
|
1157
|
+
}
|
|
1653
1158
|
/**
|
|
1654
|
-
*
|
|
1655
|
-
* @beta
|
|
1159
|
+
* @public
|
|
1656
1160
|
*/
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1161
|
+
declare function useBoundaryElement(): BoundaryElementContextValue;
|
|
1162
|
+
/**
|
|
1163
|
+
* @internal
|
|
1164
|
+
* @deprecated this component will be removed in the next major release
|
|
1165
|
+
*/
|
|
1166
|
+
declare function ConditionalWrapper({ children, condition, wrapper }: {
|
|
1167
|
+
children: React.ReactNode;
|
|
1168
|
+
condition: boolean;
|
|
1169
|
+
wrapper: (children: React.ReactNode) => React.ReactNode;
|
|
1170
|
+
}): React.ReactNode;
|
|
1662
1171
|
/**
|
|
1663
1172
|
* DO NOT USE IN PRODUCTION.
|
|
1664
1173
|
* @beta
|
|
1665
1174
|
*/
|
|
1666
|
-
|
|
1175
|
+
interface MediaQueryProps {
|
|
1176
|
+
as?: React.ElementType | keyof React.JSX.IntrinsicElements;
|
|
1177
|
+
media?: number[];
|
|
1178
|
+
}
|
|
1667
1179
|
/**
|
|
1668
1180
|
* DO NOT USE IN PRODUCTION.
|
|
1669
1181
|
* @beta
|
|
1670
1182
|
*/
|
|
1671
|
-
declare
|
|
1183
|
+
declare const ElementQuery: import("react").ForwardRefExoticComponent<Omit<MediaQueryProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "media">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
1672
1184
|
/**
|
|
1673
1185
|
* DO NOT USE IN PRODUCTION
|
|
1674
1186
|
* @beta
|
|
@@ -1676,7 +1188,7 @@ declare function ElementQuery<E extends ElementQueryElementType = typeof DEFAULT
|
|
|
1676
1188
|
type ErrorBoundaryProps = PropsWithChildren<{
|
|
1677
1189
|
onCatch: (params: {
|
|
1678
1190
|
error: Error;
|
|
1679
|
-
info: ErrorInfo;
|
|
1191
|
+
info: React.ErrorInfo;
|
|
1680
1192
|
}) => void;
|
|
1681
1193
|
}>;
|
|
1682
1194
|
/**
|
|
@@ -1692,64 +1204,72 @@ interface ErrorBoundaryState {
|
|
|
1692
1204
|
*/
|
|
1693
1205
|
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
1694
1206
|
state: ErrorBoundaryState;
|
|
1695
|
-
static displayName: string;
|
|
1696
1207
|
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
1697
|
-
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
1698
|
-
render(): ReactNode;
|
|
1208
|
+
componentDidCatch(error: Error, info: React.ErrorInfo): void;
|
|
1209
|
+
render(): React.ReactNode;
|
|
1699
1210
|
}
|
|
1700
1211
|
/** @public */
|
|
1701
|
-
interface
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
/** @public */
|
|
1709
|
-
declare function Portal(props: PortalProps): ReactPortal | null;
|
|
1710
|
-
/** @public */
|
|
1711
|
-
interface PortalProviderProps {
|
|
1712
|
-
children: ReactNode;
|
|
1713
|
-
element?: HTMLElement | null;
|
|
1714
|
-
/**
|
|
1715
|
-
* @beta
|
|
1716
|
-
*/
|
|
1717
|
-
__unstable_elements?: Record<string, HTMLElement | null | undefined>;
|
|
1212
|
+
interface LayerContextValue {
|
|
1213
|
+
version: 0.0;
|
|
1214
|
+
isTopLayer: boolean;
|
|
1215
|
+
level?: number;
|
|
1216
|
+
registerChild: (childLevel?: number) => () => void;
|
|
1217
|
+
size: number;
|
|
1218
|
+
zIndex: number;
|
|
1718
1219
|
}
|
|
1719
|
-
/**
|
|
1720
|
-
|
|
1721
|
-
|
|
1220
|
+
/**
|
|
1221
|
+
* @public
|
|
1222
|
+
*/
|
|
1223
|
+
declare function useLayer(): LayerContextValue;
|
|
1224
|
+
/**
|
|
1225
|
+
* @public
|
|
1226
|
+
*/
|
|
1722
1227
|
interface PortalContextValue {
|
|
1723
1228
|
version: 0.0;
|
|
1724
1229
|
boundaryElement: HTMLElement | null;
|
|
1725
1230
|
element: HTMLElement | null;
|
|
1726
1231
|
elements?: Record<string, HTMLElement | null | undefined>;
|
|
1727
1232
|
}
|
|
1728
|
-
/**
|
|
1233
|
+
/**
|
|
1234
|
+
* @public
|
|
1235
|
+
*/
|
|
1729
1236
|
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
1237
|
/**
|
|
1739
|
-
* The `Root` component.
|
|
1740
|
-
*
|
|
1741
1238
|
* @public
|
|
1742
1239
|
*/
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
boundaryElement: HTMLElement | null;
|
|
1747
|
-
children?: ReactNode;
|
|
1748
|
-
portalElement: HTMLElement | null;
|
|
1749
|
-
scheme: ColorScheme;
|
|
1750
|
-
tone: CardTone;
|
|
1240
|
+
interface SrOnlyProps {
|
|
1241
|
+
as?: React.ElementType | keyof React.JSX.IntrinsicElements;
|
|
1242
|
+
children?: React.ReactNode;
|
|
1751
1243
|
}
|
|
1752
|
-
/**
|
|
1753
|
-
|
|
1754
|
-
|
|
1244
|
+
/**
|
|
1245
|
+
* @public
|
|
1246
|
+
*/
|
|
1247
|
+
declare const SrOnly: import("react").ForwardRefExoticComponent<Omit<SrOnlyProps & Omit<import("react").HTMLProps<HTMLDivElement>, "aria-hidden" | "as">, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
1248
|
+
/**
|
|
1249
|
+
* @beta
|
|
1250
|
+
*/
|
|
1251
|
+
interface VirtualListChangeOpts {
|
|
1252
|
+
fromIndex: number;
|
|
1253
|
+
gap: number;
|
|
1254
|
+
itemHeight: number;
|
|
1255
|
+
scrollHeight: number;
|
|
1256
|
+
scrollTop: number;
|
|
1257
|
+
toIndex: number;
|
|
1258
|
+
}
|
|
1259
|
+
/**
|
|
1260
|
+
* @beta
|
|
1261
|
+
*/
|
|
1262
|
+
interface VirtualListProps<Item = any> {
|
|
1263
|
+
as?: React.ElementType | keyof React.JSX.IntrinsicElements;
|
|
1264
|
+
gap?: number;
|
|
1265
|
+
getItemKey?: (item: Item, itemIndex: number) => string;
|
|
1266
|
+
items?: Item[];
|
|
1267
|
+
onChange?: (opts: VirtualListChangeOpts) => void;
|
|
1268
|
+
renderItem?: (item: Item) => React.ReactNode;
|
|
1269
|
+
}
|
|
1270
|
+
/**
|
|
1271
|
+
* @beta
|
|
1272
|
+
*/
|
|
1273
|
+
declare const VirtualList: import("react").ForwardRefExoticComponent<VirtualListProps<any> & StackOwnProps & Omit<import("react").HTMLProps<HTMLDivElement>, "as" | "children" | "onChange" | "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
1274
|
+
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
1275
|
//# sourceMappingURL=index.d.ts.map
|