@sanity/ui 3.0.0-static.32 → 3.0.0-static.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_chunks-cjs/_visual-editing.cjs +269 -378
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -1
- package/dist/_chunks-cjs/refractor.cjs.map +1 -1
- package/dist/_chunks-es/_visual-editing.js +270 -381
- package/dist/_chunks-es/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/refractor.js.map +1 -1
- package/dist/_visual-editing.cjs +0 -2
- package/dist/_visual-editing.cjs.map +1 -1
- package/dist/_visual-editing.d.cts +2 -894
- package/dist/_visual-editing.d.ts +2 -894
- package/dist/_visual-editing.js +2 -4
- package/dist/css/index.cjs +13 -13
- package/dist/css/index.cjs.map +1 -1
- package/dist/css/index.css +1 -1
- package/dist/css/index.d.cts +805 -14697
- package/dist/css/index.d.ts +805 -14697
- package/dist/css/index.js +13 -13
- package/dist/css/index.js.map +1 -1
- package/dist/index.cjs +242 -367
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +990 -3085
- package/dist/index.d.ts +990 -3085
- package/dist/index.js +244 -361
- package/dist/index.js.map +1 -1
- package/dist/portalProvider-DgNIVviV.d.ts +575 -0
- package/dist/theme.cjs +367 -4288
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.d.cts +272 -1806
- package/dist/theme.d.ts +272 -1806
- package/dist/theme.js +371 -4292
- package/dist/theme.js.map +1 -1
- package/exports/_visual-editing.ts +0 -2
- package/package.json +8 -9
- package/src/core/Root.tsx +6 -4
- package/src/core/RootProvider.tsx +4 -4
- package/src/core/__workshop__/boundary.tsx +1 -1
- package/src/core/__workshop__/index.ts +5 -3
- package/src/core/components/autocomplete/__workshop__/async.tsx +1 -1
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/custom.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/example.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +1 -1
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +1 -1
- package/src/core/components/autocomplete/__workshop__/index.ts +5 -3
- package/src/core/components/autocomplete/__workshop__/mock/apiStore.ts +1 -1
- package/src/core/components/autocomplete/__workshop__/mock/countries.ts +1 -1
- package/src/core/components/autocomplete/autocomplete.tsx +2 -2
- package/src/core/components/autocomplete/autocompleteOption.tsx +2 -2
- package/src/core/components/autocomplete/constants.ts +2 -2
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +1 -1
- package/src/core/components/breadcrumbs/__workshop__/index.ts +5 -3
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +6 -11
- package/src/core/components/dialog/__workshop__/activate.tsx +1 -1
- package/src/core/components/dialog/__workshop__/autoFocus.tsx +1 -1
- package/src/core/components/dialog/__workshop__/index.ts +5 -3
- package/src/core/components/dialog/__workshop__/layering.tsx +1 -1
- package/src/core/components/dialog/__workshop__/nested.tsx +2 -3
- package/src/core/components/dialog/__workshop__/onScroll.tsx +1 -1
- package/src/core/components/dialog/__workshop__/panes.tsx +1 -1
- package/src/core/components/dialog/__workshop__/position.tsx +1 -1
- package/src/core/components/dialog/__workshop__/props.tsx +1 -1
- package/src/core/components/dialog/__workshop__/provider.tsx +1 -1
- package/src/core/components/dialog/__workshop__/wrapped.tsx +1 -1
- package/src/core/components/dialog/dialog.tsx +5 -6
- package/src/core/components/dialog/dialogCard.tsx +2 -2
- package/src/core/components/dialog/dialogContext.ts +3 -4
- package/src/core/components/dialog/dialogProvider.tsx +2 -2
- package/src/core/components/hotkeys/__workshop__/index.ts +5 -3
- package/src/core/components/hotkeys/__workshop__/plain.tsx +1 -1
- package/src/core/components/hotkeys/hotkeys.tsx +4 -15
- package/src/core/components/menu/__workshop__/asComponent.tsx +1 -1
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +1 -1
- package/src/core/components/menu/__workshop__/closableMenuButton.tsx +1 -1
- package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +3 -3
- package/src/core/components/menu/__workshop__/customMenuItem.tsx +1 -1
- package/src/core/components/menu/__workshop__/customSelectedState.tsx +1 -1
- package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +1 -1
- package/src/core/components/menu/__workshop__/groups.tsx +1 -1
- package/src/core/components/menu/__workshop__/index.ts +5 -3
- package/src/core/components/menu/__workshop__/menuButton.tsx +2 -2
- package/src/core/components/menu/__workshop__/menuGroupRight.tsx +1 -1
- package/src/core/components/menu/__workshop__/nestedMenu.tsx +1 -1
- package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +1 -1
- package/src/core/components/menu/__workshop__/selectedItem.tsx +1 -1
- package/src/core/components/menu/__workshop__/shouldFocus.tsx +1 -1
- package/src/core/components/menu/__workshop__/tones.tsx +3 -3
- package/src/core/components/menu/__workshop__/withoutArrow.tsx +1 -1
- package/src/core/components/menu/menu.test.tsx +2 -1
- package/src/core/components/menu/menu.tsx +7 -22
- package/src/core/components/menu/menuButton.tsx +4 -50
- package/src/core/components/menu/menuContext.ts +3 -15
- package/src/core/components/menu/menuDivider.tsx +2 -2
- package/src/core/components/menu/menuGroup.tsx +10 -15
- package/src/core/components/menu/menuItem.tsx +7 -18
- package/src/core/components/tab/__workshop__/example.tsx +1 -1
- package/src/core/components/tab/__workshop__/index.ts +5 -3
- package/src/core/components/tab/tab.tsx +6 -4
- package/src/core/components/tab/tabList.tsx +3 -8
- package/src/core/components/tab/tabPanel.tsx +2 -2
- package/src/core/components/toast/__workshop__/hook.tsx +1 -1
- package/src/core/components/toast/__workshop__/index.ts +5 -3
- package/src/core/components/toast/__workshop__/toast.tsx +1 -1
- package/src/core/components/toast/toast.test.tsx +2 -1
- package/src/core/components/toast/toast.tsx +2 -2
- package/src/core/components/toast/toastContext.ts +4 -4
- package/src/core/components/toast/toastLayer.tsx +3 -3
- package/src/core/components/tree/__workshop__/basic.perf.ts +1 -1
- package/src/core/components/tree/__workshop__/basic.tsx +1 -1
- package/src/core/components/tree/__workshop__/index.ts +5 -3
- package/src/core/components/tree/__workshop__/tabFromElement.tsx +1 -1
- package/src/core/components/tree/tree.tsx +8 -9
- package/src/core/components/tree/treeContext.ts +4 -4
- package/src/core/components/tree/treeGroup.tsx +6 -8
- package/src/core/components/tree/treeItem.tsx +4 -4
- package/src/core/components/tree/types.ts +1 -1
- package/src/core/components/virtualList/__workshop__/changingProps.tsx +1 -1
- package/src/core/components/virtualList/__workshop__/elementScroll.tsx +1 -1
- package/src/core/components/virtualList/__workshop__/index.ts +5 -3
- package/src/core/components/virtualList/__workshop__/infiniteList.tsx +1 -1
- package/src/core/components/virtualList/__workshop__/windowScrolll.tsx +1 -1
- package/src/core/components/virtualList/virtualList.tsx +2 -2
- package/src/core/constants.ts +0 -18
- package/src/core/hooks/useMediaIndex/__workshop__/index.ts +5 -3
- package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +1 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +6 -1
- package/src/core/index.ts +1 -24
- package/src/core/lib/createGlobalScopedContext.ts +1 -1
- package/src/core/lib/globalScope.ts +1 -1
- package/src/core/observers/elementSize.ts +1 -1
- package/src/core/primitives/arrow/arrow.tsx +2 -2
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +1 -1
- package/src/core/primitives/avatar/__workshop__/index.ts +5 -3
- package/src/core/primitives/avatar/__workshop__/stack.tsx +1 -1
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +1 -1
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -1
- package/src/core/primitives/avatar/avatar.tsx +3 -10
- package/src/core/primitives/avatar/avatarCounter.tsx +2 -2
- package/src/core/primitives/avatar/avatarStack.tsx +2 -4
- package/src/core/primitives/avatar/types.ts +0 -32
- package/src/core/primitives/badge/__workshop__/index.ts +5 -3
- package/src/core/primitives/badge/__workshop__/props.tsx +1 -1
- package/src/core/primitives/badge/__workshop__/tones.tsx +3 -3
- package/src/core/primitives/badge/badge.test.tsx +2 -1
- package/src/core/primitives/badge/badge.tsx +12 -11
- package/src/core/primitives/box/__workshop__/index.ts +5 -3
- package/src/core/primitives/box/__workshop__/props.tsx +1 -1
- package/src/core/primitives/box/__workshop__/responsive.tsx +1 -1
- package/src/core/primitives/box/box.tsx +28 -32
- package/src/core/primitives/button/__workshop__/custom.tsx +5 -5
- package/src/core/primitives/button/__workshop__/customIcons.tsx +1 -1
- package/src/core/primitives/button/__workshop__/disabled.tsx +3 -3
- package/src/core/primitives/button/__workshop__/index.ts +5 -3
- package/src/core/primitives/button/__workshop__/mixedChildren.tsx +1 -1
- package/src/core/primitives/button/__workshop__/props.tsx +1 -1
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
- package/src/core/primitives/button/__workshop__/stacked.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled1.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled2.tsx +1 -1
- package/src/core/primitives/button/__workshop__/textOverflow.tsx +1 -1
- package/src/core/primitives/button/__workshop__/uploadButton.tsx +1 -1
- package/src/core/primitives/button/button.test.tsx +2 -1
- package/src/core/primitives/button/button.tsx +4 -7
- package/src/core/primitives/button/types.ts +0 -20
- package/src/core/primitives/card/__workshop__/asButton.tsx +2 -2
- package/src/core/primitives/card/__workshop__/asComponent.tsx +1 -1
- package/src/core/primitives/card/__workshop__/checkered.tsx +3 -3
- package/src/core/primitives/card/__workshop__/index.ts +5 -3
- package/src/core/primitives/card/__workshop__/interactive.tsx +1 -1
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +1 -1
- package/src/core/primitives/card/__workshop__/props.tsx +1 -1
- package/src/core/primitives/card/__workshop__/selected.tsx +1 -1
- package/src/core/primitives/card/__workshop__/styled.tsx +1 -1
- package/src/core/primitives/card/__workshop__/tones.tsx +3 -3
- package/src/core/primitives/card/card.tsx +4 -2
- package/src/core/primitives/card/cardContext.ts +1 -1
- package/src/core/primitives/card/cardProvider.tsx +4 -4
- package/src/core/primitives/card/types.ts +5 -19
- package/src/core/primitives/checkbox/__workshop__/example.tsx +1 -1
- package/src/core/primitives/checkbox/__workshop__/index.ts +5 -3
- package/src/core/primitives/checkbox/__workshop__/props.tsx +1 -1
- package/src/core/primitives/checkbox/__workshop__/readOnly.tsx +1 -1
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +3 -3
- package/src/core/primitives/checkbox/checkbox.tsx +2 -2
- package/src/core/primitives/code/__workshop__/index.ts +5 -3
- package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/code/__workshop__/props.tsx +1 -1
- package/src/core/primitives/code/code.tsx +4 -2
- package/src/core/primitives/code/refractor.tsx +1 -1
- package/src/core/primitives/container/__workshop__/example.tsx +1 -1
- package/src/core/primitives/container/__workshop__/index.ts +5 -3
- package/src/core/primitives/container/container.tsx +2 -2
- package/src/core/primitives/flex/__workshop__/example.tsx +1 -1
- package/src/core/primitives/flex/__workshop__/gap.tsx +1 -1
- package/src/core/primitives/flex/__workshop__/index.ts +5 -3
- package/src/core/primitives/flex/flex.tsx +4 -2
- package/src/core/primitives/grid/__workshop__/index.ts +5 -3
- package/src/core/primitives/grid/__workshop__/responsive.tsx +3 -3
- package/src/core/primitives/grid/grid.tsx +4 -2
- package/src/core/primitives/heading/__workshop__/index.ts +5 -3
- package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/heading/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/heading/heading.tsx +2 -4
- package/src/core/primitives/inline/__workshop__/index.ts +5 -3
- package/src/core/primitives/inline/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/inline/inline.tsx +4 -11
- package/src/core/primitives/kbd/__workshop__/index.ts +5 -3
- package/src/core/primitives/kbd/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/kbd/kbd.tsx +4 -2
- package/src/core/primitives/label/__workshop__/index.ts +5 -3
- package/src/core/primitives/label/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/label/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/label/label.tsx +2 -4
- package/src/core/primitives/layer/__workshop__/_debug.tsx +1 -1
- package/src/core/primitives/layer/__workshop__/index.ts +5 -3
- package/src/core/primitives/layer/__workshop__/multipleRoots.tsx +1 -1
- package/src/core/primitives/layer/__workshop__/nested.tsx +1 -1
- package/src/core/primitives/layer/__workshop__/responsiveZOffset.tsx +1 -1
- package/src/core/primitives/layer/layer.test.tsx +2 -1
- package/src/core/primitives/layer/layer.tsx +2 -2
- package/src/core/primitives/layer/layerCard.tsx +2 -2
- package/src/core/primitives/layer/layerContext.ts +4 -4
- package/src/core/primitives/layer/layerProvider.tsx +2 -10
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +2 -2
- package/src/core/primitives/popover/__workshop__/MarginsStory.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +2 -2
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +3 -3
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +3 -3
- package/src/core/primitives/popover/__workshop__/index.ts +5 -3
- package/src/core/primitives/popover/popover.tsx +34 -17
- package/src/core/primitives/popover/popoverLayer.tsx +2 -2
- package/src/core/primitives/radio/__workshop__/example.tsx +1 -1
- package/src/core/primitives/radio/__workshop__/index.ts +5 -3
- package/src/core/primitives/radio/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/radio/radio.tsx +2 -2
- package/src/core/primitives/select/__workshop__/index.ts +5 -3
- package/src/core/primitives/select/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/select/__workshop__/readOnly.tsx +1 -1
- package/src/core/primitives/select/select.tsx +5 -15
- package/src/core/primitives/selectable/selectable.tsx +4 -4
- package/src/core/primitives/skeleton/__workshop__/delay.tsx +1 -1
- package/src/core/primitives/skeleton/__workshop__/index.ts +5 -3
- package/src/core/primitives/skeleton/__workshop__/skeleton.tsx +2 -2
- package/src/core/primitives/skeleton/codeSkeleton.tsx +2 -2
- package/src/core/primitives/skeleton/headingSkeleton.tsx +2 -2
- package/src/core/primitives/skeleton/labelSkeleton.tsx +2 -2
- package/src/core/primitives/skeleton/skeleton.tsx +2 -2
- package/src/core/primitives/skeleton/textSkeleton.tsx +2 -2
- package/src/core/primitives/spinner/__workshop__/Props.tsx +1 -1
- package/src/core/primitives/spinner/__workshop__/index.ts +5 -3
- package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +2 -2
- package/src/core/primitives/spinner/spinner.tsx +2 -2
- package/src/core/primitives/srOnly/srOnly.tsx +2 -2
- package/src/core/primitives/stack/__workshop__/index.ts +5 -3
- package/src/core/primitives/stack/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/stack/stack.tsx +5 -10
- package/src/core/primitives/switch/__workshop__/example.tsx +1 -1
- package/src/core/primitives/switch/__workshop__/index.ts +5 -3
- package/src/core/primitives/switch/__workshop__/props.tsx +1 -1
- package/src/core/primitives/switch/switch.tsx +2 -2
- package/src/core/primitives/text/__workshop__/colored.tsx +1 -1
- package/src/core/primitives/text/__workshop__/example.tsx +1 -1
- package/src/core/primitives/text/__workshop__/index.ts +5 -3
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/text/text.tsx +4 -4
- package/src/core/primitives/textArea/__workshop__/index.ts +5 -3
- package/src/core/primitives/textArea/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/textArea/textArea.tsx +5 -15
- package/src/core/primitives/textInput/__workshop__/clearButton.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/customValidity.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/index.ts +5 -3
- package/src/core/primitives/textInput/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/readOnly.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/states.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/tones.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/typed.tsx +1 -1
- package/src/core/primitives/textInput/textInput.tsx +6 -9
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +1 -1
- package/src/core/primitives/tooltip/__workshop__/index.ts +5 -3
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +1 -1
- package/src/core/primitives/tooltip/__workshop__/props.tsx +1 -1
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -1
- package/src/core/primitives/tooltip/constants.ts +1 -1
- package/src/core/primitives/tooltip/tooltip.test.tsx +2 -4
- package/src/core/primitives/tooltip/tooltip.tsx +5 -9
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +4 -2
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +5 -3
- package/src/core/primitives/tooltip/tooltipLayer.tsx +2 -2
- package/src/core/{types/props.ts → types.ts} +27 -0
- package/src/core/utils/boundaryElement/__workshop__/index.ts +5 -3
- package/src/core/utils/boundaryElement/__workshop__/plain.tsx +1 -1
- package/src/core/utils/boundaryElement/boundaryElement.test.tsx +2 -1
- package/src/core/utils/boundaryElement/boundaryElementContext.ts +7 -4
- package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +2 -2
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +1 -1
- package/src/core/utils/elementQuery/__workshop__/index.ts +5 -3
- package/src/core/utils/elementQuery/elementQuery.tsx +2 -2
- package/src/core/utils/getElementRef.ts +1 -1
- package/src/core/utils/portal/__workshop__/index.ts +5 -3
- package/src/core/utils/portal/__workshop__/named.tsx +1 -1
- package/src/core/utils/portal/portal.test.tsx +2 -1
- package/src/core/utils/portal/portalContext.ts +5 -2
- package/src/core/utils/portal/portalProvider.tsx +5 -9
- package/src/css/_responsiveClassName.ts +2 -2
- package/src/css/_style.css.ts +1 -1
- package/src/css/components/breadcrumbs/breadcrumbs.css.ts +1 -1
- package/src/css/components/dialog/dialog.css.ts +9 -17
- package/src/css/components/menu/menu.css.ts +2 -2
- package/src/css/components/menu/menu.ts +2 -2
- package/src/css/components/skeleton/skeleton.css.ts +2 -6
- package/src/css/components/toast/toast.css.ts +2 -2
- package/src/css/components/toast/toast.ts +2 -2
- package/src/css/components/tree/tree.css.ts +1 -1
- package/src/css/components/tree/tree.ts +1 -1
- package/src/css/defaultTheme.css.ts +59 -60
- package/src/css/layers.css.ts +4 -1
- package/src/css/primitives/_arrow/_arrow.css.ts +5 -5
- package/src/css/primitives/_input/_input.css.ts +4 -4
- package/src/css/primitives/_selectable/_selectable.css.ts +4 -4
- package/src/css/primitives/_selectable/types.ts +2 -2
- package/src/css/primitives/avatar/avatar.css.ts +10 -10
- package/src/css/primitives/badge/badge.css.ts +4 -4
- package/src/css/primitives/badge/types.ts +8 -2
- package/src/css/primitives/box/box.css.ts +2 -2
- package/src/css/primitives/button/button.css.ts +6 -6
- package/src/css/primitives/button/button.ts +2 -2
- package/src/css/primitives/button/types.ts +3 -3
- package/src/css/primitives/card/__workshop__/color.tsx +9 -9
- package/src/css/primitives/card/__workshop__/index.ts +5 -3
- package/src/css/primitives/card/card.css.ts +12 -18
- package/src/css/primitives/card/types.ts +3 -3
- package/src/css/primitives/checkbox/checkbox.css.ts +3 -3
- package/src/css/primitives/checkbox/checkbox.ts +3 -3
- package/src/css/primitives/code/code.css.ts +4 -3
- package/src/css/primitives/code/types.ts +3 -4
- package/src/css/primitives/container/container.css.ts +1 -1
- package/src/css/primitives/heading/heading.css.ts +5 -4
- package/src/css/primitives/heading/types.ts +3 -6
- package/src/css/primitives/kbd/kbd.css.ts +1 -1
- package/src/css/primitives/label/label.css.ts +5 -4
- package/src/css/primitives/label/types.ts +0 -8
- package/src/css/primitives/popover/popover.css.ts +2 -2
- package/src/css/primitives/popover/popover.ts +2 -2
- package/src/css/primitives/radio/radio.css.ts +3 -3
- package/src/css/primitives/radio/radio.ts +3 -3
- package/src/css/primitives/root/root.css.ts +2 -2
- package/src/css/primitives/root/root.ts +2 -2
- package/src/css/primitives/root/types.ts +3 -3
- package/src/css/primitives/select/select.css.ts +3 -3
- package/src/css/primitives/spinner/spinner.css.ts +2 -6
- package/src/css/primitives/spinner/spinner.ts +2 -2
- package/src/css/primitives/srOnly/srOnly.css.ts +1 -1
- package/src/css/primitives/srOnly/srOnly.ts +1 -1
- package/src/css/primitives/stack/stack.css.ts +1 -1
- package/src/css/primitives/stack/stack.ts +1 -1
- package/src/css/primitives/switch/switch.css.ts +5 -5
- package/src/css/primitives/text/text.css.ts +5 -4
- package/src/css/primitives/text/types.ts +3 -5
- package/src/css/primitives/textArea/textArea.css.ts +1 -1
- package/src/css/primitives/textInput/textInput.css.ts +4 -4
- package/src/css/primitives/tooltip/tooltip.css.ts +1 -1
- package/src/css/props/alignItems/alignItems.ts +1 -1
- package/src/css/props/border/border.ts +1 -16
- package/src/css/props/boxSizing/boxSizing.css.ts +2 -1
- package/src/css/props/boxSizing/boxSizing.ts +0 -3
- package/src/css/props/display/display.ts +1 -10
- package/src/css/props/flex/flex.ts +1 -1
- package/src/css/props/flexDirection/flexDirection.ts +1 -1
- package/src/css/props/flexWrap/flexWrap.ts +1 -1
- package/src/css/props/font/font.css.ts +3 -2
- package/src/css/props/font/font.ts +1 -1
- package/src/css/props/gap/gap.ts +1 -1
- package/src/css/props/gridAutoColumns/gridAutoColumns.css.ts +2 -2
- package/src/css/props/gridAutoColumns/gridAutoColumns.ts +2 -2
- package/src/css/props/gridAutoColumns/types.ts +0 -10
- package/src/css/props/gridAutoFlow/gridAutoFlow.ts +2 -2
- package/src/css/props/gridAutoFlow/types.ts +0 -4
- package/src/css/props/gridAutoRows/gridAutoRows.ts +2 -2
- package/src/css/props/gridAutoRows/types.ts +0 -4
- package/src/css/props/gridColumn/gridColumn.ts +3 -3
- package/src/css/props/gridColumn/types.ts +0 -10
- package/src/css/props/gridColumnEnd/gridColumnEnd.ts +3 -3
- package/src/css/props/gridColumnEnd/types.ts +0 -10
- package/src/css/props/gridColumnStart/gridColumnStart.ts +3 -6
- package/src/css/props/gridColumnStart/types.ts +0 -10
- package/src/css/props/gridRow/gridRow.ts +3 -3
- package/src/css/props/gridRow/types.ts +0 -10
- package/src/css/props/gridRowEnd/gridRowEnd.ts +3 -3
- package/src/css/props/gridRowEnd/types.ts +0 -10
- package/src/css/props/gridRowStart/gridRowStart.ts +3 -3
- package/src/css/props/gridRowStart/types.ts +0 -10
- package/src/css/props/gridTemplateColumns/gridTemplateColumns.ts +2 -2
- package/src/css/props/gridTemplateColumns/types.ts +0 -10
- package/src/css/props/gridTemplateRows/gridTemplateRows.ts +2 -2
- package/src/css/props/gridTemplateRows/types.ts +0 -10
- package/src/css/props/height/height.ts +1 -1
- package/src/css/props/height/types.ts +0 -6
- package/src/css/props/inset/inset.ts +1 -1
- package/src/css/props/justifyContent/justifyContent.ts +1 -1
- package/src/css/props/margin/margin.ts +1 -1
- package/src/css/props/maxWidth/maxWidth.ts +1 -1
- package/src/css/props/minHeight/minHeight.ts +1 -1
- package/src/css/props/minWidth/minWidth.ts +1 -1
- package/src/css/props/outline/outline.ts +1 -1
- package/src/css/props/overflow/overflow.ts +1 -1
- package/src/css/props/overflow/types.ts +0 -6
- package/src/css/props/padding/padding.ts +1 -1
- package/src/css/props/pointerEvents/pointerEvents.ts +1 -1
- package/src/css/props/position/position.ts +1 -1
- package/src/css/props/radius/radius.ts +1 -1
- package/src/css/props/shadow/shadow.ts +1 -1
- package/src/css/props/textAlign/textAlign.ts +1 -1
- package/src/css/props/textOverflow/textOverflow.ts +1 -1
- package/src/css/props/width/width.ts +1 -1
- package/src/css/types.ts +225 -53
- package/src/css/util.ts +2 -2
- package/src/css/vars.css.ts +33 -36
- package/src/theme/{v3/_parseColorToken.ts → _parseColorToken.ts} +2 -2
- package/src/theme/buildTheme.ts +33 -0
- package/src/theme/constants.ts +90 -0
- package/src/theme/defaults/color.ts +197 -0
- package/src/theme/{v2/defaults/config.ts → defaults/common.ts} +3 -16
- package/src/theme/{v3/defaultFonts.ts → defaults/fonts.ts} +2 -2
- package/src/theme/index.ts +4 -5
- package/src/theme/{v3/resolveTokens.ts → resolveTokens.ts} +15 -15
- package/src/theme/types.ts +355 -15
- package/dist/css/layers.css +0 -4
- package/dist/css/primitives/popover/popover.css +0 -4
- package/src/core/__DEV__.ts +0 -5
- package/src/core/_compat/helpers.ts +0 -72
- package/src/core/_compat/styles/_responsive.ts +0 -19
- package/src/core/_compat/theme/theme.test.tsx +0 -73
- package/src/core/_compat/theme/themeColorProvider.tsx +0 -24
- package/src/core/_compat/theme/themeContext.ts +0 -10
- package/src/core/_compat/theme/themeProvider.tsx +0 -68
- package/src/core/_compat/theme/types.ts +0 -10
- package/src/core/_compat/theme/useRootTheme.ts +0 -15
- package/src/core/_compat/theme/useTheme.ts +0 -12
- package/src/core/_compat/types.ts +0 -191
- package/src/core/hooks/useArrayProp.ts +0 -26
- package/src/core/hooks/useClickOutside.test.tsx +0 -481
- package/src/core/hooks/useClickOutside.ts +0 -113
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +0 -30
- package/src/core/hooks/useElementRect/__workshop__/index.ts +0 -14
- package/src/core/hooks/useElementRect/useElementRect.ts +0 -13
- package/src/core/hooks/useForwardedRef.ts +0 -19
- package/src/core/hooks/useIsomorphicEffect.ts +0 -7
- package/src/core/primitives/badge/types.ts +0 -18
- package/src/core/primitives/box/types.ts +0 -22
- package/src/core/primitives/flex/types.ts +0 -27
- package/src/core/primitives/grid/types.ts +0 -17
- package/src/core/primitives/selectable/types.ts +0 -7
- package/src/core/primitives/types.ts +0 -153
- package/src/core/types/gridItem.ts +0 -32
- package/src/core/types/placement.ts +0 -18
- package/src/core/types/radius.ts +0 -7
- package/src/core/types/textAlign.ts +0 -7
- package/src/core/utils/spanWithTextOverflow.tsx +0 -10
- package/src/theme/getScopedTheme.ts +0 -88
- package/src/theme/v0/avatar.ts +0 -10
- package/src/theme/v0/color/_generic.ts +0 -35
- package/src/theme/v0/color/_system.ts +0 -17
- package/src/theme/v0/color/base.ts +0 -21
- package/src/theme/v0/color/button.ts +0 -42
- package/src/theme/v0/color/card.ts +0 -19
- package/src/theme/v0/color/color.ts +0 -40
- package/src/theme/v0/color/index.ts +0 -11
- package/src/theme/v0/color/input.ts +0 -34
- package/src/theme/v0/color/muted.ts +0 -26
- package/src/theme/v0/color/selectable.ts +0 -31
- package/src/theme/v0/color/solid.ts +0 -26
- package/src/theme/v0/color/spot.ts +0 -13
- package/src/theme/v0/css.ts +0 -10
- package/src/theme/v0/focusRing.ts +0 -5
- package/src/theme/v0/font.ts +0 -40
- package/src/theme/v0/index.ts +0 -10
- package/src/theme/v0/input.ts +0 -23
- package/src/theme/v0/layer.ts +0 -6
- package/src/theme/v0/shadow.ts +0 -15
- package/src/theme/v0/styles.ts +0 -13
- package/src/theme/v0/theme.ts +0 -72
- package/src/theme/v2/avatar.ts +0 -12
- package/src/theme/v2/build/_deprecated/color/_selectable/createSelectableTones.ts +0 -76
- package/src/theme/v2/build/_deprecated/color/_solid/createSolidTones.ts +0 -54
- package/src/theme/v2/build/_deprecated/color/button/createButtonModes.ts +0 -22
- package/src/theme/v2/build/_deprecated/color/button/createButtonTones.ts +0 -55
- package/src/theme/v2/build/_deprecated/color/card/createCardStates.ts +0 -60
- package/src/theme/v2/build/_deprecated/color/color.test.ts +0 -63
- package/src/theme/v2/build/_deprecated/color/defaults.ts +0 -390
- package/src/theme/v2/build/_deprecated/color/factory.ts +0 -141
- package/src/theme/v2/build/_deprecated/color/index.ts +0 -1
- package/src/theme/v2/build/_deprecated/color/input/createInputModes.ts +0 -86
- package/src/theme/v2/build/_deprecated/color/muted/createMuted.ts +0 -54
- package/src/theme/v2/build/_deprecated/color/spot/createSpot.ts +0 -20
- package/src/theme/v2/build/buildColorTheme.test.ts +0 -185
- package/src/theme/v2/build/buildColorTheme.ts +0 -494
- package/src/theme/v2/build/buildTheme.test.ts +0 -89
- package/src/theme/v2/build/buildTheme.ts +0 -37
- package/src/theme/v2/build/colorToken/colorToken.ts +0 -19
- package/src/theme/v2/build/colorToken/compileColorToken.ts +0 -21
- package/src/theme/v2/build/colorToken/index.ts +0 -2
- package/src/theme/v2/build/colorToken/types.ts +0 -6
- package/src/theme/v2/build/index.ts +0 -3
- package/src/theme/v2/build/lib/color-fns/blend/index.ts +0 -3
- package/src/theme/v2/build/lib/color-fns/blend/mix.ts +0 -21
- package/src/theme/v2/build/lib/color-fns/blend/multiply.ts +0 -18
- package/src/theme/v2/build/lib/color-fns/blend/screen.ts +0 -18
- package/src/theme/v2/build/lib/color-fns/color-fns.test.ts +0 -68
- package/src/theme/v2/build/lib/color-fns/contrastRatio.ts +0 -34
- package/src/theme/v2/build/lib/color-fns/convert.ts +0 -150
- package/src/theme/v2/build/lib/color-fns/index.ts +0 -6
- package/src/theme/v2/build/lib/color-fns/parse.ts +0 -60
- package/src/theme/v2/build/lib/color-fns/rgba.ts +0 -14
- package/src/theme/v2/build/lib/color-fns/types.ts +0 -28
- package/src/theme/v2/build/lib/isRecord.ts +0 -3
- package/src/theme/v2/build/lib/utils.ts +0 -19
- package/src/theme/v2/build/merge.ts +0 -28
- package/src/theme/v2/build/mixThemeColor.test.ts +0 -23
- package/src/theme/v2/build/mixThemeColor.ts +0 -53
- package/src/theme/v2/build/renderColorTheme.ts +0 -532
- package/src/theme/v2/build/renderColorValue.ts +0 -85
- package/src/theme/v2/build/resolveColorTokens.ts +0 -268
- package/src/theme/v2/color/_constants.ts +0 -45
- package/src/theme/v2/color/_helpers.ts +0 -24
- package/src/theme/v2/color/_system.ts +0 -38
- package/src/theme/v2/color/avatar.ts +0 -11
- package/src/theme/v2/color/badge.ts +0 -12
- package/src/theme/v2/color/button.ts +0 -11
- package/src/theme/v2/color/color.ts +0 -28
- package/src/theme/v2/color/index.ts +0 -13
- package/src/theme/v2/color/input.ts +0 -23
- package/src/theme/v2/color/kbd.ts +0 -6
- package/src/theme/v2/color/selectable.ts +0 -8
- package/src/theme/v2/color/shadow.ts +0 -7
- package/src/theme/v2/color/state.ts +0 -41
- package/src/theme/v2/color/syntax.ts +0 -39
- package/src/theme/v2/config/helpers.ts +0 -48
- package/src/theme/v2/config/index.ts +0 -4
- package/src/theme/v2/config/system.ts +0 -114
- package/src/theme/v2/config/tokens/color/index.ts +0 -1
- package/src/theme/v2/config/tokens/color/types.ts +0 -137
- package/src/theme/v2/config/tokens/index.ts +0 -3
- package/src/theme/v2/config/tokens/parseTokenValue.test.ts +0 -44
- package/src/theme/v2/config/tokens/parseTokenValue.ts +0 -133
- package/src/theme/v2/config/tokens/types.ts +0 -53
- package/src/theme/v2/config/types.ts +0 -47
- package/src/theme/v2/defaults/colorPalette.ts +0 -5
- package/src/theme/v2/defaults/colorTokens.ts +0 -648
- package/src/theme/v2/defaults/fonts.ts +0 -227
- package/src/theme/v2/index.ts +0 -6
- package/src/theme/v2/input.ts +0 -31
- package/src/theme/v2/theme.ts +0 -45
- package/src/theme/v3/_constants.ts +0 -29
- package/src/theme/v3/buildTheme_v3.ts +0 -39
- package/src/theme/v3/color/_constants.ts +0 -15
- package/src/theme/v3/color/avatar.ts +0 -14
- package/src/theme/v3/color/card.ts +0 -79
- package/src/theme/v3/color/color.ts +0 -98
- package/src/theme/v3/color/element.ts +0 -19
- package/src/theme/v3/color/index.ts +0 -7
- package/src/theme/v3/color/token.ts +0 -32
- package/src/theme/v3/color/tokens.ts +0 -5
- package/src/theme/v3/defaultTokens.ts +0 -199
- package/src/theme/v3/index.ts +0 -9
- package/src/theme/v3/palette/constants.ts +0 -15
- package/src/theme/v3/palette/index.ts +0 -2
- package/src/theme/v3/palette/types.ts +0 -7
- package/src/theme/v3/tokens.ts +0 -16
- package/src/theme/v3/types.ts +0 -133
- package/src/theme/versioning/getTheme_v2.ts +0 -58
- package/src/theme/versioning/index.ts +0 -1
- package/src/theme/versioning/is_v0.ts +0 -7
- package/src/theme/versioning/is_v2.ts +0 -7
- package/src/theme/versioning/themeColor_v0_v2.ts +0 -245
- package/src/theme/versioning/themeColor_v2_v2_9.ts +0 -49
- package/src/theme/versioning/themeColor_v3_v2.ts +0 -383
- package/src/theme/versioning/v0_v2.ts +0 -95
- package/src/theme/versioning/v2_v0.ts +0 -127
- package/src/theme/versioning/v3_v2.ts +0 -130
- /package/src/theme/{v3/merge.ts → merge.ts} +0 -0
|
@@ -0,0 +1,575 @@
|
|
|
1
|
+
import { AlignItems, BoxStyleProps, ButtonStyleProps, CardStyleProps, DisplayStyleProps, FlexDirection, FlexWrap, GapStyleProps, InputStyleProps, JustifyContent, MaxWidth, PaddingStyleProps, RadiusStyleProps, ResponsiveProp, ShadowStyleProps, TextOverflowStyleProps, TextStyleProps, Width } from "@sanity/ui/css";
|
|
2
|
+
import { CardTone, ColorScheme, ContainerWidth, ElementTone, FontTextSize, FontWeight, Space } from "@sanity/ui/theme";
|
|
3
|
+
import { ComponentClass, ComponentProps, ElementType, ExoticComponent, ForwardedRef, FunctionComponent, HTMLAttributes, JSX, ReactElement, ReactNode, ReactPortal, Ref, RefAttributes } from "react";
|
|
4
|
+
/**
|
|
5
|
+
* Assign properties from `U` to `T`, excluding properties that already exist in `T`.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
type Assign<T extends {}, U extends {}> = Omit<T, keyof U> & U;
|
|
10
|
+
/** @public */
|
|
11
|
+
type EmptyProps = {};
|
|
12
|
+
/** @public */
|
|
13
|
+
type TagType = keyof JSX.IntrinsicElements;
|
|
14
|
+
/** @public */
|
|
15
|
+
type ComponentType$1<P = any> = FunctionComponent<P> | ComponentClass<P> | ExoticComponent<P>;
|
|
16
|
+
/** @public */
|
|
17
|
+
type ElementType$1<P> = TagType | ComponentType$1<P>;
|
|
18
|
+
/** @public */
|
|
19
|
+
type Props<P extends EmptyProps, E extends ElementType$1<P>> = Assign<E extends TagType ? JSX.IntrinsicElements[E] : ComponentProps<E>, P & {
|
|
20
|
+
as?: E;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Placement of floating UI elements.
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
type Placement = "top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end";
|
|
28
|
+
/** @public */
|
|
29
|
+
type Delay = number | Partial<{
|
|
30
|
+
open: number;
|
|
31
|
+
close: number;
|
|
32
|
+
}>;
|
|
33
|
+
/** @public */
|
|
34
|
+
declare const DEFAULT_HOTKEYS_ELEMENT = "kbd";
|
|
35
|
+
/** @public */
|
|
36
|
+
interface HotkeysOwnProps extends GapStyleProps, RadiusStyleProps {
|
|
37
|
+
fontSize?: ResponsiveProp<FontTextSize>;
|
|
38
|
+
padding?: ResponsiveProp<Space>;
|
|
39
|
+
keys?: string[];
|
|
40
|
+
}
|
|
41
|
+
/** @public */
|
|
42
|
+
type HotkeysElementType = "kbd" | ComponentType$1;
|
|
43
|
+
/** @public */
|
|
44
|
+
type HotkeysProps<E extends HotkeysElementType = HotkeysElementType> = Props<HotkeysOwnProps, E>;
|
|
45
|
+
/**
|
|
46
|
+
* Represent hotkeys (a keyboard combination) with semantic `<kbd>` elements.
|
|
47
|
+
*
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
declare function Hotkeys<E extends HotkeysElementType = typeof DEFAULT_HOTKEYS_ELEMENT>(props: HotkeysProps<E>): React.JSX.Element | undefined;
|
|
51
|
+
/** @public */
|
|
52
|
+
declare const DEFAULT_MENU_ELEMENT = "div";
|
|
53
|
+
/** @public */
|
|
54
|
+
type MenuOwnProps = PaddingStyleProps & {
|
|
55
|
+
"gap"?: ResponsiveProp<Space>;
|
|
56
|
+
"onClickOutside"?: (event: MouseEvent) => void;
|
|
57
|
+
"onEscape"?: () => void;
|
|
58
|
+
"onItemClick"?: () => void;
|
|
59
|
+
"onItemSelect"?: (index: number) => void;
|
|
60
|
+
"originElement"?: HTMLElement | null;
|
|
61
|
+
"registerElement"?: (el: HTMLElement) => () => void;
|
|
62
|
+
"shouldFocus"?: "first" | "last" | null;
|
|
63
|
+
"aria-labelledby"?: string;
|
|
64
|
+
};
|
|
65
|
+
/** @public */
|
|
66
|
+
type MenuElementType = "div" | "span" | ComponentType$1;
|
|
67
|
+
/** @public */
|
|
68
|
+
type MenuProps<E extends MenuElementType = MenuElementType> = Props<MenuOwnProps, E>;
|
|
69
|
+
/**
|
|
70
|
+
* The `Menu` component is a building block for application menus.
|
|
71
|
+
*
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
declare function Menu<E extends MenuElementType = typeof DEFAULT_MENU_ELEMENT>(props: MenuProps<E>): React.JSX.Element;
|
|
75
|
+
/** @public */
|
|
76
|
+
declare const DEFAULT_MENU_DIVIDER_ELEMENT = "hr";
|
|
77
|
+
/** @public */
|
|
78
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
79
|
+
type MenuDividerOwnProps = {};
|
|
80
|
+
/** @public */
|
|
81
|
+
type MenuDividerElementType = "div" | "hr" | "span" | ComponentType$1;
|
|
82
|
+
/** @public */
|
|
83
|
+
type MenuDividerProps<E extends MenuDividerElementType = MenuDividerElementType> = Props<MenuDividerOwnProps, E>;
|
|
84
|
+
/** @public */
|
|
85
|
+
declare function MenuDivider<E extends MenuDividerElementType = typeof DEFAULT_MENU_DIVIDER_ELEMENT>(props: MenuDividerProps<E>): React.JSX.Element;
|
|
86
|
+
/** @public */
|
|
87
|
+
declare const DEFAULT_BOX_ELEMENT = "div";
|
|
88
|
+
/** @public */
|
|
89
|
+
type BoxOwnProps = BoxStyleProps;
|
|
90
|
+
/** @public */
|
|
91
|
+
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" | "ul" | ComponentType$1;
|
|
92
|
+
/** @public */
|
|
93
|
+
type BoxProps<E extends BoxElementType = BoxElementType> = Props<BoxOwnProps, E>;
|
|
94
|
+
/**
|
|
95
|
+
* The `Box` component is a basic layout wrapper component which provides utility properties
|
|
96
|
+
* for flex, margins and padding.
|
|
97
|
+
*
|
|
98
|
+
* @public
|
|
99
|
+
*/
|
|
100
|
+
declare function Box<E extends BoxElementType = typeof DEFAULT_BOX_ELEMENT>(props: BoxProps<E>): React.JSX.Element;
|
|
101
|
+
/** @public */
|
|
102
|
+
declare const DEFAULT_CARD_ELEMENT = "div";
|
|
103
|
+
/** @public */
|
|
104
|
+
interface CardOwnProps extends BoxOwnProps, CardStyleProps {
|
|
105
|
+
/**
|
|
106
|
+
* Do not use in production.
|
|
107
|
+
* @beta
|
|
108
|
+
*/
|
|
109
|
+
__unstable_checkered?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Do not use in production.
|
|
112
|
+
* @beta
|
|
113
|
+
*/
|
|
114
|
+
__unstable_focusRing?: boolean;
|
|
115
|
+
disabled?: boolean;
|
|
116
|
+
pressed?: boolean;
|
|
117
|
+
selected?: boolean;
|
|
118
|
+
target?: string;
|
|
119
|
+
}
|
|
120
|
+
/** @public */
|
|
121
|
+
type CardElementType = BoxElementType;
|
|
122
|
+
/** @public */
|
|
123
|
+
type CardProps<E extends CardElementType = CardElementType> = Props<CardOwnProps, E>;
|
|
124
|
+
/**
|
|
125
|
+
* The `Card` component acts much like a `Box`, but with a background and foreground color.
|
|
126
|
+
* Components within a `Card` inherit its colors.
|
|
127
|
+
*
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
declare function Card<E extends CardElementType = typeof DEFAULT_CARD_ELEMENT>(props: CardProps<E>): React.JSX.Element;
|
|
131
|
+
/** @public */
|
|
132
|
+
declare const DEFAULT_LAYER_ELEMENT = "div";
|
|
133
|
+
/** @public */
|
|
134
|
+
type LayerOwnProps = CardOwnProps & {
|
|
135
|
+
/** A callback that fires when the layer becomes the top layer when it was not the top layer before. */
|
|
136
|
+
onActivate?: (props: {
|
|
137
|
+
activeElement: HTMLElement | null;
|
|
138
|
+
}) => void;
|
|
139
|
+
zOffset?: ResponsiveProp<number>;
|
|
140
|
+
};
|
|
141
|
+
/** @public */
|
|
142
|
+
type LayerElementType = CardElementType;
|
|
143
|
+
/** @public */
|
|
144
|
+
type LayerProps<E extends LayerElementType = LayerElementType> = Props<LayerOwnProps, E>;
|
|
145
|
+
/** @public */
|
|
146
|
+
declare function Layer<E extends LayerElementType = typeof DEFAULT_LAYER_ELEMENT>(props: LayerProps<E>): React.JSX.Element;
|
|
147
|
+
/**
|
|
148
|
+
* @beta
|
|
149
|
+
*/
|
|
150
|
+
type PopoverMargins = [number, number, number, number];
|
|
151
|
+
/** @beta */
|
|
152
|
+
type PopoverUpdateCallback = () => void;
|
|
153
|
+
/** @public */
|
|
154
|
+
type PopoverWidth = Exclude<ContainerWidth, "auto">;
|
|
155
|
+
/** @public */
|
|
156
|
+
declare const DEFAULT_POPOVER_ELEMENT = "div";
|
|
157
|
+
/** @public */
|
|
158
|
+
type PopoverOwnProps = Omit<LayerOwnProps, "maxWidth"> & {
|
|
159
|
+
/** @beta */
|
|
160
|
+
__unstable_margins?: PopoverMargins;
|
|
161
|
+
/**
|
|
162
|
+
* Whether the popover should animate in and out.
|
|
163
|
+
*
|
|
164
|
+
* @beta
|
|
165
|
+
* @defaultValue false
|
|
166
|
+
*/
|
|
167
|
+
animate?: boolean;
|
|
168
|
+
arrow?: boolean;
|
|
169
|
+
children?: ReactElement<{
|
|
170
|
+
ref: ForwardedRef<HTMLElement>;
|
|
171
|
+
}>;
|
|
172
|
+
/**
|
|
173
|
+
* When `true`, prevent overflow within the current boundary:
|
|
174
|
+
* - by flipping on its side axis
|
|
175
|
+
* - by resizing
|
|
176
|
+
*
|
|
177
|
+
* Note that:
|
|
178
|
+
* - setting `preventOverflow` to `true` also prevents overflow on its side axis
|
|
179
|
+
* - setting `matchReferenceWidth` to `true` also causes the popover to resize
|
|
180
|
+
*
|
|
181
|
+
* @defaultValue false
|
|
182
|
+
*/
|
|
183
|
+
constrainSize?: boolean;
|
|
184
|
+
content?: ReactNode;
|
|
185
|
+
disabled?: boolean;
|
|
186
|
+
fallbackPlacements?: Placement[];
|
|
187
|
+
floatingBoundary?: HTMLElement | null;
|
|
188
|
+
/**
|
|
189
|
+
* When `true`, set the maximum width to match the reference element, and also prevent overflow within
|
|
190
|
+
* the current boundary by resizing.
|
|
191
|
+
*
|
|
192
|
+
* Note that setting `constrainSize` to `true` also causes the popover to resize
|
|
193
|
+
*
|
|
194
|
+
* @defaultValue false
|
|
195
|
+
*/
|
|
196
|
+
matchReferenceWidth?: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* When true, blocks all pointer interaction with elements beneath the popover until closed.
|
|
199
|
+
*
|
|
200
|
+
* @beta
|
|
201
|
+
* @defaultValue false
|
|
202
|
+
*/
|
|
203
|
+
modal?: boolean;
|
|
204
|
+
open?: boolean;
|
|
205
|
+
placement?: Placement;
|
|
206
|
+
/**
|
|
207
|
+
* When 'flip' (default), the placement is determined from the initial placement and the
|
|
208
|
+
* fallback placements in order. Whichever fits in the viewport first.
|
|
209
|
+
*
|
|
210
|
+
* When 'autoPlacement', the initial placement and all fallback placements are evaluated
|
|
211
|
+
* and the placement with the most viewport space available.
|
|
212
|
+
*
|
|
213
|
+
* Option is only relevant if either `constrainSize` or `preventOverflow` is `true`
|
|
214
|
+
*/
|
|
215
|
+
placementStrategy?: "flip" | "autoPlacement";
|
|
216
|
+
/** Whether or not to render the popover in a portal element. */
|
|
217
|
+
portal?: boolean | string;
|
|
218
|
+
preventOverflow?: boolean;
|
|
219
|
+
referenceBoundary?: HTMLElement | null;
|
|
220
|
+
/**
|
|
221
|
+
* When defined, the popover will be positioned relative to this element.
|
|
222
|
+
* The children of the popover won't be rendered.
|
|
223
|
+
*/
|
|
224
|
+
referenceElement?: HTMLElement | null;
|
|
225
|
+
/** @beta */
|
|
226
|
+
updateRef?: Ref<PopoverUpdateCallback | undefined>;
|
|
227
|
+
width?: ResponsiveProp<MaxWidth>;
|
|
228
|
+
};
|
|
229
|
+
/** @public */
|
|
230
|
+
type PopoverElementType = "div" | ComponentType$1;
|
|
231
|
+
/** @public */
|
|
232
|
+
type PopoverProps<E extends PopoverElementType = PopoverElementType> = Props<PopoverOwnProps, E>;
|
|
233
|
+
/**
|
|
234
|
+
* The `Popover` component is used to display some content on top of another.
|
|
235
|
+
*
|
|
236
|
+
* @public
|
|
237
|
+
*/
|
|
238
|
+
declare function Popover<E extends PopoverElementType = typeof DEFAULT_POPOVER_ELEMENT>(props: PopoverProps<E>): React.JSX.Element;
|
|
239
|
+
/** @public */
|
|
240
|
+
declare const DEFAULT_MENU_GROUP_ELEMENT = "button";
|
|
241
|
+
/** @public */
|
|
242
|
+
type MenuGroupOwnProps = RadiusStyleProps & {
|
|
243
|
+
disabled?: boolean;
|
|
244
|
+
fontSize?: ResponsiveProp<FontTextSize>;
|
|
245
|
+
gap?: ResponsiveProp<Space>;
|
|
246
|
+
icon?: ElementType | ReactNode;
|
|
247
|
+
menu?: Omit<MenuProps<typeof DEFAULT_MENU_ELEMENT>, "onClickOutside" | "onEscape" | "onItemClick" | "onKeyDown" | "onMouseEnter" | "registerElement" | "shouldFocus" | "onBlurCapture">;
|
|
248
|
+
padding?: ResponsiveProp<Space>;
|
|
249
|
+
popover?: Omit<PopoverProps, "content" | "open">;
|
|
250
|
+
text?: ReactNode;
|
|
251
|
+
tone?: ElementTone;
|
|
252
|
+
};
|
|
253
|
+
/** @public */
|
|
254
|
+
type MenuGroupElementType = "button" | ComponentType$1;
|
|
255
|
+
/** @public */
|
|
256
|
+
type MenuGroupProps<E extends MenuGroupElementType = MenuGroupElementType> = Props<MenuGroupOwnProps, E>;
|
|
257
|
+
/** @public */
|
|
258
|
+
declare function MenuGroup<E extends MenuGroupElementType = typeof DEFAULT_MENU_GROUP_ELEMENT>(props: MenuGroupProps<E>): React.JSX.Element;
|
|
259
|
+
/** @public */
|
|
260
|
+
declare const DEFAULT_MENU_ITEM_ELEMENT = "button";
|
|
261
|
+
/** @public */
|
|
262
|
+
type MenuItemOwnProps = GapStyleProps & PaddingStyleProps & RadiusStyleProps & {
|
|
263
|
+
disabled?: boolean;
|
|
264
|
+
fontSize?: ResponsiveProp<FontTextSize>;
|
|
265
|
+
hotkeys?: string[];
|
|
266
|
+
icon?: ElementType | ReactNode;
|
|
267
|
+
iconRight?: ElementType | ReactNode;
|
|
268
|
+
pressed?: boolean;
|
|
269
|
+
selected?: boolean;
|
|
270
|
+
text?: ReactNode;
|
|
271
|
+
tone?: ElementTone;
|
|
272
|
+
};
|
|
273
|
+
/** @public */
|
|
274
|
+
type MenuItemElementType = "button" | "a" | ComponentType$1;
|
|
275
|
+
/** @public */
|
|
276
|
+
type MenuItemProps<E extends MenuItemElementType = MenuItemElementType> = Omit<Props<MenuItemOwnProps, E>, "role">;
|
|
277
|
+
/** @public */
|
|
278
|
+
declare function MenuItem<E extends MenuItemElementType = typeof DEFAULT_MENU_ITEM_ELEMENT>(props: MenuItemProps<E>): React.JSX.Element;
|
|
279
|
+
/** @public */
|
|
280
|
+
declare const DEFAULT_TAB_ELEMENT = "button";
|
|
281
|
+
/** @public */
|
|
282
|
+
type TabOwnProps = {
|
|
283
|
+
/**
|
|
284
|
+
* The `id` of the corresponding `TabPanel` component.
|
|
285
|
+
*/
|
|
286
|
+
"aria-controls": string;
|
|
287
|
+
"id": string;
|
|
288
|
+
"icon"?: ElementType | ReactNode;
|
|
289
|
+
"focused"?: boolean;
|
|
290
|
+
"fontSize"?: ResponsiveProp<FontTextSize>;
|
|
291
|
+
"label"?: ReactNode;
|
|
292
|
+
"padding"?: ResponsiveProp<Space>;
|
|
293
|
+
"selected"?: boolean;
|
|
294
|
+
"tone"?: ElementTone;
|
|
295
|
+
};
|
|
296
|
+
/** @public */
|
|
297
|
+
type TabElementType = "button" | ComponentType$1;
|
|
298
|
+
/** @public */
|
|
299
|
+
type TabProps<E extends TabElementType = TabElementType> = Props<TabOwnProps, E>;
|
|
300
|
+
/** @public */
|
|
301
|
+
declare function Tab<E extends TabElementType = typeof DEFAULT_TAB_ELEMENT>(props: TabProps<E>): React.JSX.Element;
|
|
302
|
+
/** @public */
|
|
303
|
+
declare const DEFAULT_FLEX_ELEMENT = "div";
|
|
304
|
+
/** @public */
|
|
305
|
+
type FlexOwnProps = Omit<BoxOwnProps, "align" | "display" | "flexDirection" | "flexWrap"> & {
|
|
306
|
+
align?: ResponsiveProp<AlignItems>;
|
|
307
|
+
direction?: ResponsiveProp<FlexDirection>;
|
|
308
|
+
justify?: ResponsiveProp<JustifyContent>;
|
|
309
|
+
wrap?: ResponsiveProp<FlexWrap>;
|
|
310
|
+
};
|
|
311
|
+
/** @public */
|
|
312
|
+
type FlexElementType = BoxElementType;
|
|
313
|
+
/** @public */
|
|
314
|
+
type FlexProps<E extends FlexElementType = FlexElementType> = Props<FlexOwnProps, E>;
|
|
315
|
+
/**
|
|
316
|
+
* The `Flex` component is a wrapper component for flexible elements (`Box`, `Card` and `Flex`).
|
|
317
|
+
*
|
|
318
|
+
* @public
|
|
319
|
+
*/
|
|
320
|
+
declare function Flex<E extends FlexElementType = typeof DEFAULT_FLEX_ELEMENT>(props: FlexProps<E>): React.JSX.Element;
|
|
321
|
+
/** @public */
|
|
322
|
+
declare const DEFAULT_TAB_LIST_ELEMENT = "div";
|
|
323
|
+
/** @public */
|
|
324
|
+
type TabListChild = ReactElement<Props<TabProps, "button">> | null | undefined | false;
|
|
325
|
+
/** @public */
|
|
326
|
+
type TabListOwnProps = Omit<FlexOwnProps, "as" | "height"> & {
|
|
327
|
+
children: TabListChild[];
|
|
328
|
+
};
|
|
329
|
+
/** @public */
|
|
330
|
+
type TabListElementType = "div" | "span" | ComponentType$1;
|
|
331
|
+
/** @public */
|
|
332
|
+
type TabListProps<E extends TabListElementType = TabListElementType> = Props<TabListOwnProps, E>;
|
|
333
|
+
/** @public */
|
|
334
|
+
declare function TabList<E extends TabListElementType = typeof DEFAULT_TAB_LIST_ELEMENT>(props: TabListProps<E>): React.JSX.Element;
|
|
335
|
+
/**
|
|
336
|
+
* @internal
|
|
337
|
+
*/
|
|
338
|
+
declare function _isEnterToClickElement(element: HTMLElement): boolean;
|
|
339
|
+
/**
|
|
340
|
+
* @internal
|
|
341
|
+
*/
|
|
342
|
+
declare function isHTMLElement(node: unknown): node is HTMLElement;
|
|
343
|
+
/**
|
|
344
|
+
* @internal
|
|
345
|
+
*/
|
|
346
|
+
declare function isHTMLAnchorElement(element: unknown): element is HTMLAnchorElement;
|
|
347
|
+
/**
|
|
348
|
+
* @internal
|
|
349
|
+
*/
|
|
350
|
+
declare function isHTMLInputElement(element: unknown): element is HTMLInputElement;
|
|
351
|
+
/**
|
|
352
|
+
* @internal
|
|
353
|
+
*/
|
|
354
|
+
declare function isHTMLButtonElement(element: unknown): element is HTMLButtonElement;
|
|
355
|
+
/**
|
|
356
|
+
* @internal
|
|
357
|
+
*/
|
|
358
|
+
declare function isHTMLSelectElement(element: unknown): element is HTMLSelectElement;
|
|
359
|
+
/**
|
|
360
|
+
* @internal
|
|
361
|
+
*/
|
|
362
|
+
declare function isHTMLTextAreaElement(element: unknown): element is HTMLTextAreaElement;
|
|
363
|
+
/**
|
|
364
|
+
* @internal
|
|
365
|
+
*/
|
|
366
|
+
declare function containsOrEqualsElement(element: HTMLElement, node: Node): boolean;
|
|
367
|
+
/**
|
|
368
|
+
* Returns true if a dark color scheme is preferred, false if a light color scheme is preferred or the preference is not known.
|
|
369
|
+
*
|
|
370
|
+
* @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)
|
|
371
|
+
*
|
|
372
|
+
* If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
|
|
373
|
+
* 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
|
|
374
|
+
* @example https://gist.github.com/stipsan/13c0cccf8dfc34f4b44bb1b984baf7df
|
|
375
|
+
*
|
|
376
|
+
* @public
|
|
377
|
+
*/
|
|
378
|
+
declare function usePrefersDark(getServerSnapshot?: () => boolean): boolean;
|
|
379
|
+
/** @public */
|
|
380
|
+
declare const DEFAULT_TEXT_ELEMENT = "div";
|
|
381
|
+
/** @public */
|
|
382
|
+
type TextOwnProps = TextStyleProps & TextOverflowStyleProps;
|
|
383
|
+
/** @public */
|
|
384
|
+
type TextElementType = "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "label" | "li" | "p" | "span" | ComponentType$1;
|
|
385
|
+
/** @public */
|
|
386
|
+
type TextProps<E extends TextElementType = TextElementType> = Props<TextOwnProps, E>;
|
|
387
|
+
/**
|
|
388
|
+
* The `Text` component is an agile, themed typographic element.
|
|
389
|
+
*
|
|
390
|
+
* @public
|
|
391
|
+
*/
|
|
392
|
+
declare function Text<E extends TextElementType = typeof DEFAULT_TEXT_ELEMENT>(props: TextProps<E>): React.JSX.Element;
|
|
393
|
+
/** @public */
|
|
394
|
+
type ButtonTextAlign = "left" | "right" | "center";
|
|
395
|
+
/** @public */
|
|
396
|
+
declare const DEFAULT_BUTTON_ELEMENT = "button";
|
|
397
|
+
/** @public */
|
|
398
|
+
type ButtonOwnProps = ButtonStyleProps & DisplayStyleProps & GapStyleProps & PaddingStyleProps & {
|
|
399
|
+
"align"?: BoxStyleProps["alignItems"];
|
|
400
|
+
"data-ui"?: string;
|
|
401
|
+
"disabled"?: boolean;
|
|
402
|
+
"fontSize"?: ResponsiveProp<FontTextSize>;
|
|
403
|
+
"icon"?: ElementType | ReactNode;
|
|
404
|
+
"iconRight"?: ElementType | ReactNode;
|
|
405
|
+
"justify"?: BoxStyleProps["justifyContent"];
|
|
406
|
+
/** @beta Do not use in production, as this might change.*/
|
|
407
|
+
"loading"?: boolean;
|
|
408
|
+
"selected"?: boolean;
|
|
409
|
+
"textAlign"?: ButtonTextAlign;
|
|
410
|
+
"muted"?: boolean;
|
|
411
|
+
"target"?: string;
|
|
412
|
+
"text"?: ReactNode;
|
|
413
|
+
"textOverflow"?: TextOwnProps["textOverflow"];
|
|
414
|
+
"textWeight"?: TextOwnProps["weight"];
|
|
415
|
+
"width"?: ResponsiveProp<Width>;
|
|
416
|
+
};
|
|
417
|
+
/** @public */
|
|
418
|
+
type ButtonElementType = "a" | "button" | "label" | ComponentType$1;
|
|
419
|
+
/** @public */
|
|
420
|
+
type ButtonProps<E extends ButtonElementType = ButtonElementType> = Props<ButtonOwnProps, E>;
|
|
421
|
+
/** @public */
|
|
422
|
+
declare function Button<E extends ButtonElementType = typeof DEFAULT_BUTTON_ELEMENT>(props: ButtonProps<E>): React.JSX.Element;
|
|
423
|
+
/** @public */
|
|
424
|
+
declare const DEFAULT_GRID_ELEMENT = "div";
|
|
425
|
+
/** @public */
|
|
426
|
+
type GridOwnProps = Omit<BoxOwnProps, "display">;
|
|
427
|
+
/** @public */
|
|
428
|
+
type GridElementType = BoxElementType;
|
|
429
|
+
/** @public */
|
|
430
|
+
type GridProps<E extends GridElementType = GridElementType> = Props<GridOwnProps, E>;
|
|
431
|
+
/**
|
|
432
|
+
* The `Grid` component is for building 2-dimensional layers (based on CSS grid).
|
|
433
|
+
*
|
|
434
|
+
* @public
|
|
435
|
+
*/
|
|
436
|
+
declare function Grid<E extends GridElementType = typeof DEFAULT_GRID_ELEMENT>(props: GridProps<E>): React.JSX.Element;
|
|
437
|
+
/** @public */
|
|
438
|
+
interface LayerProviderProps {
|
|
439
|
+
children?: ReactNode;
|
|
440
|
+
zOffset?: ResponsiveProp<number>;
|
|
441
|
+
}
|
|
442
|
+
/** @public */
|
|
443
|
+
declare function LayerProvider(props: LayerProviderProps): React.JSX.Element;
|
|
444
|
+
/** @public */
|
|
445
|
+
declare const DEFAULT_SPINNER_ELEMENT = "div";
|
|
446
|
+
/** @public */
|
|
447
|
+
type SpinnerOwnProps = {
|
|
448
|
+
muted?: boolean;
|
|
449
|
+
size?: ResponsiveProp<FontTextSize>;
|
|
450
|
+
};
|
|
451
|
+
/** @public */
|
|
452
|
+
type SpinnerElementType = "div" | "span" | ComponentType$1;
|
|
453
|
+
/** @public */
|
|
454
|
+
type SpinnerProps<E extends SpinnerElementType = SpinnerElementType> = Props<SpinnerOwnProps, E>;
|
|
455
|
+
/**
|
|
456
|
+
* Indicate that something is loading for an indeterminate amount of time.
|
|
457
|
+
*
|
|
458
|
+
* @public
|
|
459
|
+
*/
|
|
460
|
+
declare function Spinner<E extends SpinnerElementType = typeof DEFAULT_SPINNER_ELEMENT>(props: SpinnerProps<E>): React.JSX.Element;
|
|
461
|
+
/** @public */
|
|
462
|
+
declare const DEFAULT_STACK_ELEMENT = "div";
|
|
463
|
+
/** @public */
|
|
464
|
+
type StackOwnProps = Omit<BoxOwnProps, "align" | "alignItems" | "columns" | "gridTemplateColumns" | "direction" | "display" | "flexDirection" | "flexWrap" | "gapX" | "gapY" | "justify" | "justifyContent" | "rows" | "gridTemplateRows">;
|
|
465
|
+
/** @public */
|
|
466
|
+
type StackElementType = BoxElementType;
|
|
467
|
+
/** @public */
|
|
468
|
+
type StackProps<E extends StackElementType = StackElementType> = Props<StackOwnProps, E>;
|
|
469
|
+
/**
|
|
470
|
+
* The `Stack` component is used to place elements on top of each other.
|
|
471
|
+
*
|
|
472
|
+
* @public
|
|
473
|
+
*/
|
|
474
|
+
declare function Stack<E extends StackElementType = typeof DEFAULT_STACK_ELEMENT>(props: StackProps<E>): React.JSX.Element;
|
|
475
|
+
/** @public */
|
|
476
|
+
declare const DEFAULT_TEXT_INPUT_ELEMENT = "input";
|
|
477
|
+
/** @public */
|
|
478
|
+
type TextInputClearButtonProps = Omit<ButtonProps<"button">, "as" | "onClick" | "onMouseDown">;
|
|
479
|
+
/** @public */
|
|
480
|
+
type TextInputOwnProps = InputStyleProps & {
|
|
481
|
+
/**
|
|
482
|
+
* @beta
|
|
483
|
+
*/
|
|
484
|
+
__unstable_disableFocusRing?: boolean;
|
|
485
|
+
/**
|
|
486
|
+
* @beta
|
|
487
|
+
*/
|
|
488
|
+
clearButton?: boolean | TextInputClearButtonProps;
|
|
489
|
+
customValidity?: string;
|
|
490
|
+
icon?: ElementType | ReactNode;
|
|
491
|
+
iconRight?: ElementType | ReactNode;
|
|
492
|
+
/**
|
|
493
|
+
* @beta
|
|
494
|
+
*/
|
|
495
|
+
onClear?: () => void;
|
|
496
|
+
prefix?: ReactNode;
|
|
497
|
+
suffix?: ReactNode;
|
|
498
|
+
weight?: FontWeight;
|
|
499
|
+
};
|
|
500
|
+
/** @public */
|
|
501
|
+
type TextInputElementType = "input" | ComponentType$1;
|
|
502
|
+
/** @public */
|
|
503
|
+
type TextInputProps<E extends TextInputElementType = TextInputElementType> = Props<TextInputOwnProps, E>;
|
|
504
|
+
/**
|
|
505
|
+
* Single line text input.
|
|
506
|
+
*
|
|
507
|
+
* @public
|
|
508
|
+
*/
|
|
509
|
+
declare function TextInput<E extends TextInputElementType = typeof DEFAULT_TEXT_INPUT_ELEMENT>(props: TextInputProps<E>): React.JSX.Element;
|
|
510
|
+
/** @public */
|
|
511
|
+
declare const DEFAULT_TOOLTIP_ELEMENT = "div";
|
|
512
|
+
/** @public */
|
|
513
|
+
type TooltipOwnProps = LayerOwnProps & RadiusStyleProps & ShadowStyleProps & {
|
|
514
|
+
/**
|
|
515
|
+
* Whether the tooltip should animate in and out.
|
|
516
|
+
*
|
|
517
|
+
* @beta
|
|
518
|
+
* @defaultValue false
|
|
519
|
+
*/
|
|
520
|
+
animate?: boolean;
|
|
521
|
+
arrow?: boolean;
|
|
522
|
+
boundaryElement?: HTMLElement | null;
|
|
523
|
+
children?: ReactElement<HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement>>;
|
|
524
|
+
content?: ReactNode;
|
|
525
|
+
/**
|
|
526
|
+
* Adds a delay to open or close the tooltip.
|
|
527
|
+
*
|
|
528
|
+
* If only a `number` is passed, it will be used for both opening and closing.
|
|
529
|
+
*
|
|
530
|
+
* If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
|
|
531
|
+
*
|
|
532
|
+
* @public
|
|
533
|
+
* @defaultValue 0
|
|
534
|
+
*/
|
|
535
|
+
delay?: Delay;
|
|
536
|
+
disabled?: boolean;
|
|
537
|
+
fallbackPlacements?: Placement[];
|
|
538
|
+
placement?: Placement;
|
|
539
|
+
/** Whether or not to render the tooltip in a portal element. */
|
|
540
|
+
portal?: boolean | string;
|
|
541
|
+
scheme?: ColorScheme;
|
|
542
|
+
tone?: CardTone;
|
|
543
|
+
};
|
|
544
|
+
/** @public */
|
|
545
|
+
type TooltipElementType = "div" | "span" | ComponentType$1;
|
|
546
|
+
/** @public */
|
|
547
|
+
type TooltipProps<E extends TooltipElementType = TooltipElementType> = Props<TooltipOwnProps, E>;
|
|
548
|
+
/**
|
|
549
|
+
* Tooltips display information when hovering, focusing or tapping.
|
|
550
|
+
*
|
|
551
|
+
* @public
|
|
552
|
+
*/
|
|
553
|
+
declare function Tooltip<E extends TooltipElementType = typeof DEFAULT_TOOLTIP_ELEMENT>(props: TooltipProps<E>): React.JSX.Element;
|
|
554
|
+
/** @public */
|
|
555
|
+
interface PortalProps {
|
|
556
|
+
children: ReactNode;
|
|
557
|
+
/**
|
|
558
|
+
* @beta This API might change. DO NOT USE IN PRODUCTION.
|
|
559
|
+
*/
|
|
560
|
+
__unstable_name?: string;
|
|
561
|
+
}
|
|
562
|
+
/** @public */
|
|
563
|
+
declare function Portal(props: PortalProps): ReactPortal | null;
|
|
564
|
+
/** @public */
|
|
565
|
+
interface PortalProviderProps {
|
|
566
|
+
children: ReactNode;
|
|
567
|
+
element?: HTMLElement | null;
|
|
568
|
+
/**
|
|
569
|
+
* @beta
|
|
570
|
+
*/
|
|
571
|
+
__unstable_elements?: Record<string, HTMLElement | null | undefined>;
|
|
572
|
+
}
|
|
573
|
+
/** @public */
|
|
574
|
+
declare function PortalProvider(props: PortalProviderProps): React.JSX.Element;
|
|
575
|
+
export { Assign, Box, BoxElementType, BoxOwnProps, BoxProps, Button, ButtonElementType, ButtonOwnProps, ButtonProps, ButtonTextAlign, Card, CardElementType, CardOwnProps, CardProps, ComponentType$1 as ComponentType, DEFAULT_BOX_ELEMENT, DEFAULT_BUTTON_ELEMENT, DEFAULT_CARD_ELEMENT, DEFAULT_FLEX_ELEMENT, DEFAULT_GRID_ELEMENT, DEFAULT_HOTKEYS_ELEMENT, DEFAULT_LAYER_ELEMENT, DEFAULT_MENU_DIVIDER_ELEMENT, DEFAULT_MENU_ELEMENT, DEFAULT_MENU_GROUP_ELEMENT, DEFAULT_MENU_ITEM_ELEMENT, DEFAULT_POPOVER_ELEMENT, DEFAULT_SPINNER_ELEMENT, DEFAULT_STACK_ELEMENT, DEFAULT_TAB_ELEMENT, DEFAULT_TAB_LIST_ELEMENT, DEFAULT_TEXT_ELEMENT, DEFAULT_TEXT_INPUT_ELEMENT, DEFAULT_TOOLTIP_ELEMENT, Delay, ElementType$1 as ElementType, EmptyProps, Flex, FlexElementType, FlexOwnProps, FlexProps, Grid, GridElementType, GridOwnProps, GridProps, Hotkeys, HotkeysElementType, HotkeysOwnProps, HotkeysProps, Layer, LayerElementType, LayerOwnProps, LayerProps, LayerProvider, LayerProviderProps, Menu, MenuDivider, MenuDividerElementType, MenuDividerOwnProps, MenuDividerProps, MenuElementType, MenuGroup, MenuGroupElementType, MenuGroupOwnProps, MenuGroupProps, MenuItem, MenuItemElementType, MenuItemOwnProps, MenuItemProps, MenuOwnProps, MenuProps, Placement, Popover, PopoverElementType, PopoverMargins, PopoverOwnProps, PopoverProps, PopoverUpdateCallback, PopoverWidth, Portal, PortalProps, PortalProvider, PortalProviderProps, Props, Spinner, SpinnerElementType, SpinnerOwnProps, SpinnerProps, Stack, StackElementType, StackOwnProps, StackProps, Tab, TabElementType, TabList, TabListChild, TabListElementType, TabListOwnProps, TabListProps, TabOwnProps, TabProps, TagType, Text, TextElementType, TextInput, TextInputClearButtonProps, TextInputElementType, TextInputOwnProps, TextInputProps, TextOwnProps, TextProps, Tooltip, TooltipElementType, TooltipOwnProps, TooltipProps, _isEnterToClickElement, containsOrEqualsElement, isHTMLAnchorElement, isHTMLButtonElement, isHTMLElement, isHTMLInputElement, isHTMLSelectElement, isHTMLTextAreaElement, usePrefersDark };
|