@sanity/ui 3.0.0-static.33 → 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 +263 -375
- 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 +263 -377
- 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 -904
- package/dist/_visual-editing.d.ts +2 -904
- package/dist/_visual-editing.js +2 -4
- package/dist/css/index.cjs +12 -12
- 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 +12 -12
- package/dist/css/index.js.map +1 -1
- package/dist/index.cjs +241 -366
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +990 -3095
- package/dist/index.d.ts +990 -3095
- package/dist/index.js +243 -360
- 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 +3 -4
- package/src/core/Root.tsx +4 -2
- 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 +4 -9
- 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 +1 -1
- package/src/css/primitives/root/root.ts +1 -1
- 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/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
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { getScopedTheme, getTheme_v2 } from "@sanity/ui/theme";
|
|
4
|
-
import { createContext, useContext, useState, isValidElement, useDebugValue, useSyncExternalStore, useRef, useImperativeHandle, useEffect, useMemo, useCallback, cloneElement, Children, useId, useLayoutEffect } from "react";
|
|
5
|
-
import { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1 } from "styled-components";
|
|
6
3
|
import { box, text, textOverflow, animatedSpinnerIcon, spinner, button, buttonLoadingBox, _arrow, vars, _arrowSvg, _arrowStrokeMask, _arrowStroke, _arrowShape, card, BREAKPOINTS, popoverCard, popover, _selectable, stack, textInput, textInputPrefix, textInputElement, _inputElement, _inputPresentation, textInputSuffix, kbd, menu, menuDivider, tooltip } from "@sanity/ui/css";
|
|
4
|
+
import { useState, isValidElement, useDebugValue, useSyncExternalStore, createContext, useContext, useRef, useImperativeHandle, useEffect, useMemo, useCallback, cloneElement, Children, useId, useLayoutEffect } from "react";
|
|
7
5
|
import { useEffectEvent } from "use-effect-event";
|
|
8
6
|
import { SpinnerIcon, CloseIcon, ChevronRightIcon } from "@sanity/icons";
|
|
9
7
|
import { isValidElementType } from "react-is";
|
|
@@ -11,102 +9,6 @@ import { detectOverflow, autoPlacement, flip, offset, shift, arrow, hide, useFlo
|
|
|
11
9
|
import { motion, AnimatePresence } from "framer-motion";
|
|
12
10
|
import { createPortal } from "react-dom";
|
|
13
11
|
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
14
|
-
function getGlobalScope() {
|
|
15
|
-
if (typeof globalThis < "u") return globalThis;
|
|
16
|
-
if (typeof window < "u") return window;
|
|
17
|
-
if (typeof self < "u") return self;
|
|
18
|
-
if (typeof global < "u") return global;
|
|
19
|
-
throw new Error("@sanity/ui: could not locate global scope");
|
|
20
|
-
}
|
|
21
|
-
const globalScope = getGlobalScope();
|
|
22
|
-
function createGlobalScopedContext(key2, defaultValue) {
|
|
23
|
-
const symbol = Symbol.for(key2);
|
|
24
|
-
if (typeof document > "u")
|
|
25
|
-
return createContext(defaultValue);
|
|
26
|
-
const symbolMap = globalScope;
|
|
27
|
-
return symbolMap[symbol] = symbolMap[symbol] || createContext(defaultValue), symbolMap[symbol];
|
|
28
|
-
}
|
|
29
|
-
const CardContext = createGlobalScopedContext("@sanity/ui/context/card", null);
|
|
30
|
-
function CardProvider(props) {
|
|
31
|
-
const $ = c(7), {
|
|
32
|
-
children,
|
|
33
|
-
tone,
|
|
34
|
-
scheme,
|
|
35
|
-
unstable_CompatProvider
|
|
36
|
-
} = props;
|
|
37
|
-
let t0, t1;
|
|
38
|
-
$[0] !== scheme || $[1] !== tone || $[2] !== unstable_CompatProvider ? (t1 = {
|
|
39
|
-
tone,
|
|
40
|
-
scheme,
|
|
41
|
-
unstable_CompatProvider
|
|
42
|
-
}, $[0] = scheme, $[1] = tone, $[2] = unstable_CompatProvider, $[3] = t1) : t1 = $[3], t0 = t1;
|
|
43
|
-
let t2;
|
|
44
|
-
return $[4] !== children || $[5] !== t0 ? (t2 = /* @__PURE__ */ jsx(CardContext.Provider, { value: t0, children }), $[4] = children, $[5] = t0, $[6] = t2) : t2 = $[6], t2;
|
|
45
|
-
}
|
|
46
|
-
const ThemeContext = createGlobalScopedContext("@sanity/ui/context/theme", null);
|
|
47
|
-
function ThemeProvider(props) {
|
|
48
|
-
const $ = c(19), parentTheme = useContext(ThemeContext), {
|
|
49
|
-
children
|
|
50
|
-
} = props, scheme = props.scheme ?? (parentTheme?.scheme || "light"), rootTheme = props.theme ?? (parentTheme?.theme || null), tone = props.tone ?? (parentTheme?.tone || "default");
|
|
51
|
-
let t0;
|
|
52
|
-
bb0: {
|
|
53
|
-
if (!rootTheme) {
|
|
54
|
-
t0 = null;
|
|
55
|
-
break bb0;
|
|
56
|
-
}
|
|
57
|
-
let t12;
|
|
58
|
-
$[0] !== rootTheme || $[1] !== scheme || $[2] !== tone ? (t12 = {
|
|
59
|
-
version: 0,
|
|
60
|
-
theme: rootTheme,
|
|
61
|
-
scheme,
|
|
62
|
-
tone
|
|
63
|
-
}, $[0] = rootTheme, $[1] = scheme, $[2] = tone, $[3] = t12) : t12 = $[3], t0 = t12;
|
|
64
|
-
}
|
|
65
|
-
const themeContext = t0;
|
|
66
|
-
let t1;
|
|
67
|
-
bb1: {
|
|
68
|
-
if (!rootTheme) {
|
|
69
|
-
t1 = null;
|
|
70
|
-
break bb1;
|
|
71
|
-
}
|
|
72
|
-
let t22;
|
|
73
|
-
$[4] !== rootTheme || $[5] !== scheme || $[6] !== tone ? (t22 = getScopedTheme(rootTheme, scheme, tone), $[4] = rootTheme, $[5] = scheme, $[6] = tone, $[7] = t22) : t22 = $[7], t1 = t22;
|
|
74
|
-
}
|
|
75
|
-
const theme = t1;
|
|
76
|
-
if (!theme) {
|
|
77
|
-
let t22;
|
|
78
|
-
return $[8] === Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsx("pre", { children: 'ThemeProvider: no "theme" property provided' }), $[8] = t22) : t22 = $[8], t22;
|
|
79
|
-
}
|
|
80
|
-
let t2;
|
|
81
|
-
$[9] !== children || $[10] !== theme ? (t2 = /* @__PURE__ */ jsx(ThemeProvider$1, { theme, children }), $[9] = children, $[10] = theme, $[11] = t2) : t2 = $[11];
|
|
82
|
-
let t3;
|
|
83
|
-
$[12] !== t2 || $[13] !== themeContext ? (t3 = /* @__PURE__ */ jsx(ThemeContext.Provider, { value: themeContext, children: t2 }), $[12] = t2, $[13] = themeContext, $[14] = t3) : t3 = $[14];
|
|
84
|
-
let t4;
|
|
85
|
-
return $[15] !== scheme || $[16] !== t3 || $[17] !== tone ? (t4 = /* @__PURE__ */ jsx(CardProvider, { scheme, tone, unstable_CompatProvider: ThemeColorProvider, children: t3 }), $[15] = scheme, $[16] = t3, $[17] = tone, $[18] = t4) : t4 = $[18], t4;
|
|
86
|
-
}
|
|
87
|
-
function useRootTheme() {
|
|
88
|
-
const value = useContext(ThemeContext);
|
|
89
|
-
if (!value)
|
|
90
|
-
throw new Error("useRootTheme(): missing context value");
|
|
91
|
-
return value;
|
|
92
|
-
}
|
|
93
|
-
function ThemeColorProvider(props) {
|
|
94
|
-
const $ = c(5), {
|
|
95
|
-
children,
|
|
96
|
-
scheme,
|
|
97
|
-
tone
|
|
98
|
-
} = props, root = useRootTheme(), t0 = scheme || root.scheme;
|
|
99
|
-
let t1;
|
|
100
|
-
return $[0] !== children || $[1] !== root.theme || $[2] !== t0 || $[3] !== tone ? (t1 = /* @__PURE__ */ jsx(ThemeProvider, { scheme: t0, theme: root.theme, tone, children }), $[0] = children, $[1] = root.theme, $[2] = t0, $[3] = tone, $[4] = t1) : t1 = $[4], t1;
|
|
101
|
-
}
|
|
102
|
-
function useTheme() {
|
|
103
|
-
return useTheme$1();
|
|
104
|
-
}
|
|
105
|
-
function useTheme_v2() {
|
|
106
|
-
const $ = c(2), t0 = useTheme$1();
|
|
107
|
-
let t1;
|
|
108
|
-
return $[0] !== t0 ? (t1 = getTheme_v2(t0), $[0] = t0, $[1] = t1) : t1 = $[1], t1;
|
|
109
|
-
}
|
|
110
12
|
const EMPTY_ARRAY = [], EMPTY_RECORD = {}, POPOVER_MOTION_PROPS = {
|
|
111
13
|
card: {
|
|
112
14
|
initial: {
|
|
@@ -185,14 +87,11 @@ function useResponsiveProp(val, defaultVal) {
|
|
|
185
87
|
}
|
|
186
88
|
const DEFAULT_BOX_ELEMENT = "div";
|
|
187
89
|
function Box(props) {
|
|
188
|
-
const $ = c(
|
|
189
|
-
let alignItems,
|
|
90
|
+
const $ = c(132), t0 = props;
|
|
91
|
+
let alignItems, borderBottom, borderLeft, borderRight, borderTop, children, className, flex, flexDirection, flexWrap, gap, gapX, gapY, gridAutoColumns, gridAutoFlow, gridAutoRows, gridColumn, gridColumnEnd, gridColumnStart, gridRow, gridRowEnd, gridRowStart, gridTemplateColumns, gridTemplateRows, height, inset, insetBottom, insetLeft, insetRight, insetTop, justifyContent, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, maxWidth, muted, outline, overflow, overflowX, overflowY, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, pointerEvents, position, radius, rest, shadow, t1, t2, t3, t4, t5, t6, t7, t8, textAlign, width;
|
|
190
92
|
$[0] !== t0 ? ({
|
|
191
93
|
alignItems,
|
|
192
94
|
as: t1,
|
|
193
|
-
autoCols,
|
|
194
|
-
autoFlow,
|
|
195
|
-
autoRows,
|
|
196
95
|
border: t2,
|
|
197
96
|
borderTop,
|
|
198
97
|
borderRight,
|
|
@@ -200,10 +99,6 @@ function Box(props) {
|
|
|
200
99
|
borderLeft,
|
|
201
100
|
className,
|
|
202
101
|
children,
|
|
203
|
-
column,
|
|
204
|
-
columnStart,
|
|
205
|
-
columnEnd,
|
|
206
|
-
columns,
|
|
207
102
|
display: t3,
|
|
208
103
|
flex,
|
|
209
104
|
flexDirection,
|
|
@@ -254,33 +149,22 @@ function Box(props) {
|
|
|
254
149
|
pointerEvents,
|
|
255
150
|
position,
|
|
256
151
|
radius,
|
|
257
|
-
row,
|
|
258
|
-
rows,
|
|
259
|
-
rowStart,
|
|
260
|
-
rowEnd,
|
|
261
152
|
shadow,
|
|
262
153
|
sizing: t8,
|
|
263
154
|
textAlign,
|
|
264
155
|
width,
|
|
265
156
|
...rest
|
|
266
|
-
} = t0, $[0] = t0, $[1] = alignItems, $[2] =
|
|
157
|
+
} = t0, $[0] = t0, $[1] = alignItems, $[2] = borderBottom, $[3] = borderLeft, $[4] = borderRight, $[5] = borderTop, $[6] = children, $[7] = className, $[8] = flex, $[9] = flexDirection, $[10] = flexWrap, $[11] = gap, $[12] = gapX, $[13] = gapY, $[14] = gridAutoColumns, $[15] = gridAutoFlow, $[16] = gridAutoRows, $[17] = gridColumn, $[18] = gridColumnEnd, $[19] = gridColumnStart, $[20] = gridRow, $[21] = gridRowEnd, $[22] = gridRowStart, $[23] = gridTemplateColumns, $[24] = gridTemplateRows, $[25] = height, $[26] = inset, $[27] = insetBottom, $[28] = insetLeft, $[29] = insetRight, $[30] = insetTop, $[31] = justifyContent, $[32] = marginBottom, $[33] = marginLeft, $[34] = marginRight, $[35] = marginTop, $[36] = marginX, $[37] = marginY, $[38] = maxWidth, $[39] = muted, $[40] = outline, $[41] = overflow, $[42] = overflowX, $[43] = overflowY, $[44] = paddingBottom, $[45] = paddingLeft, $[46] = paddingRight, $[47] = paddingTop, $[48] = paddingX, $[49] = paddingY, $[50] = pointerEvents, $[51] = position, $[52] = radius, $[53] = rest, $[54] = shadow, $[55] = t1, $[56] = t2, $[57] = t3, $[58] = t4, $[59] = t5, $[60] = t6, $[61] = t7, $[62] = t8, $[63] = textAlign, $[64] = width) : (alignItems = $[1], borderBottom = $[2], borderLeft = $[3], borderRight = $[4], borderTop = $[5], children = $[6], className = $[7], flex = $[8], flexDirection = $[9], flexWrap = $[10], gap = $[11], gapX = $[12], gapY = $[13], gridAutoColumns = $[14], gridAutoFlow = $[15], gridAutoRows = $[16], gridColumn = $[17], gridColumnEnd = $[18], gridColumnStart = $[19], gridRow = $[20], gridRowEnd = $[21], gridRowStart = $[22], gridTemplateColumns = $[23], gridTemplateRows = $[24], height = $[25], inset = $[26], insetBottom = $[27], insetLeft = $[28], insetRight = $[29], insetTop = $[30], justifyContent = $[31], marginBottom = $[32], marginLeft = $[33], marginRight = $[34], marginTop = $[35], marginX = $[36], marginY = $[37], maxWidth = $[38], muted = $[39], outline = $[40], overflow = $[41], overflowX = $[42], overflowY = $[43], paddingBottom = $[44], paddingLeft = $[45], paddingRight = $[46], paddingTop = $[47], paddingX = $[48], paddingY = $[49], pointerEvents = $[50], position = $[51], radius = $[52], rest = $[53], shadow = $[54], t1 = $[55], t2 = $[56], t3 = $[57], t4 = $[58], t5 = $[59], t6 = $[60], t7 = $[61], t8 = $[62], textAlign = $[63], width = $[64]);
|
|
267
158
|
const Element = t1 === void 0 ? DEFAULT_BOX_ELEMENT : t1, border = t2 === void 0 ? !1 : t2, display = t3 === void 0 ? "block" : t3, margin = t4 === void 0 ? 0 : t4, minHeight = t5 === void 0 ? 0 : t5, minWidth = t6 === void 0 ? 0 : t6, padding = t7 === void 0 ? 0 : t7, sizing = t8 === void 0 ? "border" : t8;
|
|
268
159
|
let t9;
|
|
269
|
-
$[
|
|
160
|
+
$[65] !== alignItems || $[66] !== border || $[67] !== borderBottom || $[68] !== borderLeft || $[69] !== borderRight || $[70] !== borderTop || $[71] !== className || $[72] !== display || $[73] !== flex || $[74] !== flexDirection || $[75] !== flexWrap || $[76] !== gap || $[77] !== gapX || $[78] !== gapY || $[79] !== gridAutoColumns || $[80] !== gridAutoFlow || $[81] !== gridAutoRows || $[82] !== gridColumn || $[83] !== gridColumnEnd || $[84] !== gridColumnStart || $[85] !== gridRow || $[86] !== gridRowEnd || $[87] !== gridRowStart || $[88] !== gridTemplateColumns || $[89] !== gridTemplateRows || $[90] !== height || $[91] !== inset || $[92] !== insetBottom || $[93] !== insetLeft || $[94] !== insetRight || $[95] !== insetTop || $[96] !== justifyContent || $[97] !== margin || $[98] !== marginBottom || $[99] !== marginLeft || $[100] !== marginRight || $[101] !== marginTop || $[102] !== marginX || $[103] !== marginY || $[104] !== maxWidth || $[105] !== minHeight || $[106] !== minWidth || $[107] !== muted || $[108] !== outline || $[109] !== overflow || $[110] !== overflowX || $[111] !== overflowY || $[112] !== padding || $[113] !== paddingBottom || $[114] !== paddingLeft || $[115] !== paddingRight || $[116] !== paddingTop || $[117] !== paddingX || $[118] !== paddingY || $[119] !== pointerEvents || $[120] !== position || $[121] !== radius || $[122] !== shadow || $[123] !== sizing || $[124] !== textAlign || $[125] !== width ? (t9 = box({
|
|
270
161
|
className,
|
|
271
162
|
alignItems,
|
|
272
|
-
autoCols,
|
|
273
|
-
autoFlow,
|
|
274
|
-
autoRows,
|
|
275
163
|
border,
|
|
276
164
|
borderTop,
|
|
277
165
|
borderRight,
|
|
278
166
|
borderBottom,
|
|
279
167
|
borderLeft,
|
|
280
|
-
column,
|
|
281
|
-
columnStart,
|
|
282
|
-
columnEnd,
|
|
283
|
-
columns,
|
|
284
168
|
display,
|
|
285
169
|
flex,
|
|
286
170
|
flexDirection,
|
|
@@ -331,24 +215,19 @@ function Box(props) {
|
|
|
331
215
|
pointerEvents,
|
|
332
216
|
position,
|
|
333
217
|
radius,
|
|
334
|
-
row,
|
|
335
|
-
rows,
|
|
336
|
-
rowStart,
|
|
337
|
-
rowEnd,
|
|
338
218
|
shadow,
|
|
339
219
|
sizing,
|
|
340
220
|
textAlign,
|
|
341
221
|
width
|
|
342
|
-
}), $[
|
|
222
|
+
}), $[65] = alignItems, $[66] = border, $[67] = borderBottom, $[68] = borderLeft, $[69] = borderRight, $[70] = borderTop, $[71] = className, $[72] = display, $[73] = flex, $[74] = flexDirection, $[75] = flexWrap, $[76] = gap, $[77] = gapX, $[78] = gapY, $[79] = gridAutoColumns, $[80] = gridAutoFlow, $[81] = gridAutoRows, $[82] = gridColumn, $[83] = gridColumnEnd, $[84] = gridColumnStart, $[85] = gridRow, $[86] = gridRowEnd, $[87] = gridRowStart, $[88] = gridTemplateColumns, $[89] = gridTemplateRows, $[90] = height, $[91] = inset, $[92] = insetBottom, $[93] = insetLeft, $[94] = insetRight, $[95] = insetTop, $[96] = justifyContent, $[97] = margin, $[98] = marginBottom, $[99] = marginLeft, $[100] = marginRight, $[101] = marginTop, $[102] = marginX, $[103] = marginY, $[104] = maxWidth, $[105] = minHeight, $[106] = minWidth, $[107] = muted, $[108] = outline, $[109] = overflow, $[110] = overflowX, $[111] = overflowY, $[112] = padding, $[113] = paddingBottom, $[114] = paddingLeft, $[115] = paddingRight, $[116] = paddingTop, $[117] = paddingX, $[118] = paddingY, $[119] = pointerEvents, $[120] = position, $[121] = radius, $[122] = shadow, $[123] = sizing, $[124] = textAlign, $[125] = width, $[126] = t9) : t9 = $[126];
|
|
343
223
|
let t10;
|
|
344
|
-
return $[
|
|
224
|
+
return $[127] !== Element || $[128] !== children || $[129] !== rest || $[130] !== t9 ? (t10 = /* @__PURE__ */ jsx(Element, { "data-ui": "Box", ...rest, className: t9, children }), $[127] = Element, $[128] = children, $[129] = rest, $[130] = t9, $[131] = t10) : t10 = $[131], t10;
|
|
345
225
|
}
|
|
346
226
|
const DEFAULT_TEXT_ELEMENT = "div";
|
|
347
227
|
function Text(props) {
|
|
348
|
-
const $ = c(
|
|
349
|
-
let
|
|
228
|
+
const $ = c(30), t0 = props;
|
|
229
|
+
let align, children, className, flex, muted, rest, t1, t2, t3, t4, textOverflowProp;
|
|
350
230
|
$[0] !== t0 ? ({
|
|
351
|
-
accent,
|
|
352
231
|
align,
|
|
353
232
|
as: t1,
|
|
354
233
|
children,
|
|
@@ -360,27 +239,26 @@ function Text(props) {
|
|
|
360
239
|
textOverflow: textOverflowProp,
|
|
361
240
|
weight: t4,
|
|
362
241
|
...rest
|
|
363
|
-
} = t0, $[0] = t0, $[1] =
|
|
242
|
+
} = t0, $[0] = t0, $[1] = align, $[2] = children, $[3] = className, $[4] = flex, $[5] = muted, $[6] = rest, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = t4, $[11] = textOverflowProp) : (align = $[1], children = $[2], className = $[3], flex = $[4], muted = $[5], rest = $[6], t1 = $[7], t2 = $[8], t3 = $[9], t4 = $[10], textOverflowProp = $[11]);
|
|
364
243
|
const Element = t1 === void 0 ? DEFAULT_TEXT_ELEMENT : t1, maxWidth = t2 === void 0 ? "fill" : t2, size2 = t3 === void 0 ? 2 : t3, weight = t4 === void 0 ? "regular" : t4;
|
|
365
244
|
let t5;
|
|
366
|
-
$[
|
|
245
|
+
$[12] !== align || $[13] !== className || $[14] !== flex || $[15] !== maxWidth || $[16] !== muted || $[17] !== size2 || $[18] !== weight ? (t5 = text({
|
|
367
246
|
className,
|
|
368
|
-
accent,
|
|
369
247
|
align,
|
|
370
248
|
flex,
|
|
371
249
|
maxWidth,
|
|
372
250
|
muted,
|
|
373
251
|
size: size2,
|
|
374
252
|
weight
|
|
375
|
-
}), $[
|
|
253
|
+
}), $[12] = align, $[13] = className, $[14] = flex, $[15] = maxWidth, $[16] = muted, $[17] = size2, $[18] = weight, $[19] = t5) : t5 = $[19];
|
|
376
254
|
let t6;
|
|
377
|
-
$[
|
|
255
|
+
$[20] !== textOverflowProp ? (t6 = textOverflow({
|
|
378
256
|
textOverflow: textOverflowProp
|
|
379
|
-
}), $[
|
|
257
|
+
}), $[20] = textOverflowProp, $[21] = t6) : t6 = $[21];
|
|
380
258
|
let t7;
|
|
381
|
-
$[
|
|
259
|
+
$[22] !== children || $[23] !== t6 ? (t7 = /* @__PURE__ */ jsx("span", { className: t6, children }), $[22] = children, $[23] = t6, $[24] = t7) : t7 = $[24];
|
|
382
260
|
let t8;
|
|
383
|
-
return $[
|
|
261
|
+
return $[25] !== Element || $[26] !== rest || $[27] !== t5 || $[28] !== t7 ? (t8 = /* @__PURE__ */ jsx(Element, { "data-ui": "Text", ...rest, className: t5, children: t7 }), $[25] = Element, $[26] = rest, $[27] = t5, $[28] = t7, $[29] = t8) : t8 = $[29], t8;
|
|
384
262
|
}
|
|
385
263
|
function AnimatedSpinnerIcon(props) {
|
|
386
264
|
const $ = c(5);
|
|
@@ -422,7 +300,7 @@ function Button(props) {
|
|
|
422
300
|
disabled,
|
|
423
301
|
flex,
|
|
424
302
|
fontSize = 1,
|
|
425
|
-
gap = props.
|
|
303
|
+
gap = props.padding ?? 3,
|
|
426
304
|
gapX,
|
|
427
305
|
gapY,
|
|
428
306
|
icon: IconComponent,
|
|
@@ -439,8 +317,6 @@ function Button(props) {
|
|
|
439
317
|
paddingRight,
|
|
440
318
|
radius = 2,
|
|
441
319
|
selected,
|
|
442
|
-
space = props.gap ?? props.space ?? props.padding ?? 3,
|
|
443
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
444
320
|
text: text2,
|
|
445
321
|
textAlign,
|
|
446
322
|
textOverflow: textOverflow2 = "ellipsis",
|
|
@@ -536,7 +412,22 @@ const origin = {
|
|
|
536
412
|
function clamp(num, min, max) {
|
|
537
413
|
return Math.min(Math.max(num, min), max);
|
|
538
414
|
}
|
|
539
|
-
|
|
415
|
+
function getGlobalScope() {
|
|
416
|
+
if (typeof globalThis < "u") return globalThis;
|
|
417
|
+
if (typeof window < "u") return window;
|
|
418
|
+
if (typeof self < "u") return self;
|
|
419
|
+
if (typeof global < "u") return global;
|
|
420
|
+
throw new Error("@sanity/ui: could not locate global scope");
|
|
421
|
+
}
|
|
422
|
+
const globalScope = getGlobalScope();
|
|
423
|
+
function createGlobalScopedContext(key2, defaultValue) {
|
|
424
|
+
const symbol = Symbol.for(key2);
|
|
425
|
+
if (typeof document > "u")
|
|
426
|
+
return createContext(defaultValue);
|
|
427
|
+
const symbolMap = globalScope;
|
|
428
|
+
return symbolMap[symbol] = symbolMap[symbol] || createContext(defaultValue), symbolMap[symbol];
|
|
429
|
+
}
|
|
430
|
+
const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/v3/boundaryElement", null), DEFAULT_VALUE = {
|
|
540
431
|
version: 0,
|
|
541
432
|
element: null
|
|
542
433
|
};
|
|
@@ -550,13 +441,30 @@ function getElementRef(element) {
|
|
|
550
441
|
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
551
442
|
return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
|
|
552
443
|
}
|
|
444
|
+
const CardContext = createGlobalScopedContext("@sanity/ui/v3/card", null);
|
|
445
|
+
function CardProvider(props) {
|
|
446
|
+
const $ = c(7), {
|
|
447
|
+
children,
|
|
448
|
+
tone,
|
|
449
|
+
scheme,
|
|
450
|
+
unstable_CompatProvider
|
|
451
|
+
} = props;
|
|
452
|
+
let t0, t1;
|
|
453
|
+
$[0] !== scheme || $[1] !== tone || $[2] !== unstable_CompatProvider ? (t1 = {
|
|
454
|
+
tone,
|
|
455
|
+
scheme,
|
|
456
|
+
unstable_CompatProvider
|
|
457
|
+
}, $[0] = scheme, $[1] = tone, $[2] = unstable_CompatProvider, $[3] = t1) : t1 = $[3], t0 = t1;
|
|
458
|
+
let t2;
|
|
459
|
+
return $[4] !== children || $[5] !== t0 ? (t2 = /* @__PURE__ */ jsx(CardContext.Provider, { value: t0, children }), $[4] = children, $[5] = t0, $[6] = t2) : t2 = $[6], t2;
|
|
460
|
+
}
|
|
553
461
|
function useCard() {
|
|
554
462
|
const card2 = useContext(CardContext);
|
|
555
463
|
if (!card2)
|
|
556
464
|
throw new Error("useCard(): missing context value");
|
|
557
465
|
return card2;
|
|
558
466
|
}
|
|
559
|
-
const key = "@sanity/ui/
|
|
467
|
+
const key = "@sanity/ui/v3/portal", elementKey = Symbol.for(`${key}/element`), elementMap = globalScope;
|
|
560
468
|
elementMap[elementKey] = null;
|
|
561
469
|
const defaultContextValue = {
|
|
562
470
|
version: 0,
|
|
@@ -594,7 +502,7 @@ function getLayerContext(contextValue) {
|
|
|
594
502
|
return contextValue;
|
|
595
503
|
throw new Error("could not get layer context");
|
|
596
504
|
}
|
|
597
|
-
const LayerContext = createGlobalScopedContext("@sanity/ui/
|
|
505
|
+
const LayerContext = createGlobalScopedContext("@sanity/ui/v3/layer", null);
|
|
598
506
|
function useLayer() {
|
|
599
507
|
const $ = c(2), value = useContext(LayerContext);
|
|
600
508
|
if (!value)
|
|
@@ -872,8 +780,10 @@ function _getMediaQuery(media2, index) {
|
|
|
872
780
|
}
|
|
873
781
|
function _createMediaStore() {
|
|
874
782
|
const mediaLen = media.length;
|
|
875
|
-
let sizes;
|
|
783
|
+
let sizes = [];
|
|
876
784
|
const getSizes = () => {
|
|
785
|
+
if (typeof window > "u")
|
|
786
|
+
return sizes;
|
|
877
787
|
if (!sizes) {
|
|
878
788
|
sizes = [];
|
|
879
789
|
for (let index = mediaLen; index > -1; index -= 1) {
|
|
@@ -1083,8 +993,6 @@ function Popover(props) {
|
|
|
1083
993
|
animate: _animate = !1,
|
|
1084
994
|
arrow: arrowProp = !1,
|
|
1085
995
|
as = DEFAULT_POPOVER_ELEMENT,
|
|
1086
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1087
|
-
boundaryElement = boundaryElementContext.element,
|
|
1088
996
|
children: childProp,
|
|
1089
997
|
className,
|
|
1090
998
|
constrainSize = !1,
|
|
@@ -1092,7 +1000,7 @@ function Popover(props) {
|
|
|
1092
1000
|
disabled,
|
|
1093
1001
|
fallbackPlacements = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"],
|
|
1094
1002
|
matchReferenceWidth,
|
|
1095
|
-
floatingBoundary =
|
|
1003
|
+
floatingBoundary = boundaryElementContext.element,
|
|
1096
1004
|
modal,
|
|
1097
1005
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1098
1006
|
onActivate,
|
|
@@ -1105,7 +1013,7 @@ function Popover(props) {
|
|
|
1105
1013
|
preventOverflow = !0,
|
|
1106
1014
|
radius = 3,
|
|
1107
1015
|
ref: forwardedRef,
|
|
1108
|
-
referenceBoundary =
|
|
1016
|
+
referenceBoundary = boundaryElementContext.element,
|
|
1109
1017
|
referenceElement,
|
|
1110
1018
|
scheme,
|
|
1111
1019
|
shadow = 3,
|
|
@@ -1217,23 +1125,21 @@ function Selectable(props) {
|
|
|
1217
1125
|
}
|
|
1218
1126
|
const DEFAULT_STACK_ELEMENT = "div";
|
|
1219
1127
|
function Stack(props) {
|
|
1220
|
-
const $ = c(
|
|
1221
|
-
let className, gap, rest,
|
|
1128
|
+
const $ = c(12), t0 = props;
|
|
1129
|
+
let className, gap, rest, t1;
|
|
1222
1130
|
$[0] !== t0 ? ({
|
|
1223
1131
|
as: t1,
|
|
1224
1132
|
className,
|
|
1225
1133
|
gap,
|
|
1226
|
-
space,
|
|
1227
1134
|
...rest
|
|
1228
|
-
} = t0, $[0] = t0, $[1] = className, $[2] = gap, $[3] = rest, $[4] =
|
|
1135
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = gap, $[3] = rest, $[4] = t1) : (className = $[1], gap = $[2], rest = $[3], t1 = $[4]);
|
|
1229
1136
|
const as = t1 === void 0 ? DEFAULT_STACK_ELEMENT : t1;
|
|
1230
1137
|
let t2;
|
|
1231
|
-
$[
|
|
1138
|
+
$[5] !== className ? (t2 = stack({
|
|
1232
1139
|
className
|
|
1233
|
-
}), $[
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
return $[8] !== as || $[9] !== rest || $[10] !== t2 || $[11] !== t3 ? (t4 = /* @__PURE__ */ jsx(Box, { "data-ui": "Stack", ...rest, as, gridAutoRows: "min", className: t2, display: "grid", gap: t3 }), $[8] = as, $[9] = rest, $[10] = t2, $[11] = t3, $[12] = t4) : t4 = $[12], t4;
|
|
1140
|
+
}), $[5] = className, $[6] = t2) : t2 = $[6];
|
|
1141
|
+
let t3;
|
|
1142
|
+
return $[7] !== as || $[8] !== gap || $[9] !== rest || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsx(Box, { "data-ui": "Stack", ...rest, as, gridAutoRows: "min", className: t2, display: "grid", gap }), $[7] = as, $[8] = gap, $[9] = rest, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
|
|
1237
1143
|
}
|
|
1238
1144
|
function useCustomValidity(ref, customValidity) {
|
|
1239
1145
|
const $ = c(6);
|
|
@@ -1246,8 +1152,8 @@ function useCustomValidity(ref, customValidity) {
|
|
|
1246
1152
|
}
|
|
1247
1153
|
const DEFAULT_TEXT_INPUT_ELEMENT = "input";
|
|
1248
1154
|
function TextInput(props) {
|
|
1249
|
-
const $ = c(
|
|
1250
|
-
let IconComponent, IconRightComponent, __unstable_disableFocusRing, className, clearButton, customValidity, forwardedRef,
|
|
1155
|
+
const $ = c(88), t0 = props;
|
|
1156
|
+
let IconComponent, IconRightComponent, __unstable_disableFocusRing, className, clearButton, customValidity, forwardedRef, onClear, prefix, readOnly, rest, suffix, t1, t2, t3, t4, t5, t6, t7, t8, width;
|
|
1251
1157
|
if ($[0] !== t0) {
|
|
1252
1158
|
const {
|
|
1253
1159
|
__unstable_disableFocusRing: t92,
|
|
@@ -1266,90 +1172,89 @@ function TextInput(props) {
|
|
|
1266
1172
|
radius: t222,
|
|
1267
1173
|
readOnly: t232,
|
|
1268
1174
|
ref: t242,
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
type: t282,
|
|
1175
|
+
suffix: t252,
|
|
1176
|
+
customValidity: t262,
|
|
1177
|
+
type: t272,
|
|
1273
1178
|
weight: _width,
|
|
1274
|
-
width:
|
|
1275
|
-
...
|
|
1179
|
+
width: t282,
|
|
1180
|
+
...t292
|
|
1276
1181
|
} = t0;
|
|
1277
|
-
__unstable_disableFocusRing = t92, t1 = t102, t2 = t112, className = t122, clearButton = t132, t3 = t142, t4 = t152,
|
|
1182
|
+
__unstable_disableFocusRing = t92, t1 = t102, t2 = t112, className = t122, clearButton = t132, t3 = t142, t4 = t152, t5 = t162, IconComponent = t172, IconRightComponent = t182, onClear = t192, t6 = t202, prefix = t212, t7 = t222, readOnly = t232, forwardedRef = t242, suffix = t252, customValidity = t262, t8 = t272, width = t282, rest = t292, $[0] = t0, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = __unstable_disableFocusRing, $[4] = className, $[5] = clearButton, $[6] = customValidity, $[7] = forwardedRef, $[8] = onClear, $[9] = prefix, $[10] = readOnly, $[11] = rest, $[12] = suffix, $[13] = t1, $[14] = t2, $[15] = t3, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = t7, $[20] = t8, $[21] = width;
|
|
1278
1183
|
} else
|
|
1279
|
-
IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], className = $[4], clearButton = $[5], customValidity = $[6], forwardedRef = $[7],
|
|
1280
|
-
const Element = t1 === void 0 ? DEFAULT_TEXT_INPUT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, disabled = t3 === void 0 ? !1 : t3, fontSize = t4 === void 0 ? 2 : t4,
|
|
1184
|
+
IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], className = $[4], clearButton = $[5], customValidity = $[6], forwardedRef = $[7], onClear = $[8], prefix = $[9], readOnly = $[10], rest = $[11], suffix = $[12], t1 = $[13], t2 = $[14], t3 = $[15], t4 = $[16], t5 = $[17], t6 = $[18], t7 = $[19], t8 = $[20], width = $[21];
|
|
1185
|
+
const Element = t1 === void 0 ? DEFAULT_TEXT_INPUT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, disabled = t3 === void 0 ? !1 : t3, fontSize = t4 === void 0 ? 2 : t4, gap = t5 === void 0 ? 3 : t5, padding = t6 === void 0 ? 3 : t6, radius = t7 === void 0 ? 2 : t7, type = t8 === void 0 ? "text" : t8, ref = useRef(null), responsivePadding = useResponsiveProp(padding), withClearButton = !!clearButton;
|
|
1281
1186
|
let t9;
|
|
1282
|
-
$[
|
|
1187
|
+
$[22] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => ref.current, $[22] = t9) : t9 = $[22], useImperativeHandle(forwardedRef, t9), useCustomValidity(ref, customValidity);
|
|
1283
1188
|
const handleClearMouseDown = _temp$3;
|
|
1284
1189
|
let t10;
|
|
1285
|
-
$[
|
|
1190
|
+
$[23] !== onClear ? (t10 = (event_0) => {
|
|
1286
1191
|
event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
|
|
1287
|
-
}, $[
|
|
1192
|
+
}, $[23] = onClear, $[24] = t10) : t10 = $[24];
|
|
1288
1193
|
const handleClearClick = t10;
|
|
1289
1194
|
let t11, t12;
|
|
1290
|
-
$[
|
|
1195
|
+
$[25] !== responsivePadding ? (t12 = Object.fromEntries(Object.entries(responsivePadding).map(_temp2$1)), $[25] = responsivePadding, $[26] = t12) : t12 = $[26], t11 = t12;
|
|
1291
1196
|
const clearButtonBoxPadding = t11;
|
|
1292
1197
|
let t13, t14;
|
|
1293
|
-
$[
|
|
1198
|
+
$[27] !== responsivePadding ? (t14 = Object.fromEntries(Object.entries(responsivePadding).map(_temp3)), $[27] = responsivePadding, $[28] = t14) : t14 = $[28], t13 = t14;
|
|
1294
1199
|
const clearButtonPadding = t13;
|
|
1295
1200
|
let t15;
|
|
1296
1201
|
t15 = isRecord(clearButton) ? clearButton : EMPTY_RECORD;
|
|
1297
|
-
const clearButtonProps = t15
|
|
1298
|
-
let
|
|
1299
|
-
$[
|
|
1202
|
+
const clearButtonProps = t15;
|
|
1203
|
+
let t16;
|
|
1204
|
+
$[29] !== border || $[30] !== className || $[31] !== fontSize || $[32] !== gap || $[33] !== padding || $[34] !== radius || $[35] !== width ? (t16 = textInput({
|
|
1300
1205
|
className,
|
|
1301
1206
|
border,
|
|
1302
1207
|
fontSize,
|
|
1303
1208
|
padding,
|
|
1304
1209
|
radius,
|
|
1305
|
-
gap
|
|
1210
|
+
gap,
|
|
1306
1211
|
width
|
|
1307
|
-
}), $[
|
|
1308
|
-
const
|
|
1212
|
+
}), $[29] = border, $[30] = className, $[31] = fontSize, $[32] = gap, $[33] = padding, $[34] = radius, $[35] = width, $[36] = t16) : t16 = $[36];
|
|
1213
|
+
const t17 = IconComponent ? "" : void 0, t18 = IconRightComponent ? "" : void 0, t19 = customValidity ? "" : void 0, t20 = prefix ? "" : void 0, t21 = !disabled && readOnly ? "" : void 0, t22 = suffix ? "" : void 0;
|
|
1214
|
+
let t23;
|
|
1215
|
+
$[37] !== prefix ? (t23 = prefix && /* @__PURE__ */ jsx(Box, { className: textInputPrefix(), sizing: "border", children: /* @__PURE__ */ jsx("span", { children: prefix }) }), $[37] = prefix, $[38] = t23) : t23 = $[38];
|
|
1309
1216
|
let t24;
|
|
1310
|
-
$[
|
|
1217
|
+
$[39] === Symbol.for("react.memo_cache_sentinel") ? (t24 = textInputElement(), $[39] = t24) : t24 = $[39];
|
|
1311
1218
|
let t25;
|
|
1312
|
-
$[40] === Symbol.for("react.memo_cache_sentinel") ? (t25 =
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1219
|
+
$[40] === Symbol.for("react.memo_cache_sentinel") ? (t25 = _inputElement(), $[40] = t25) : t25 = $[40];
|
|
1220
|
+
const t26 = __unstable_disableFocusRing ? "" : void 0;
|
|
1221
|
+
let t27;
|
|
1222
|
+
$[41] !== Element || $[42] !== disabled || $[43] !== readOnly || $[44] !== rest || $[45] !== t26 || $[46] !== type ? (t27 = /* @__PURE__ */ jsx(Element, { ...rest, className: t25, "data-no-focus-ring": t26, disabled, readOnly, ref, type }), $[41] = Element, $[42] = disabled, $[43] = readOnly, $[44] = rest, $[45] = t26, $[46] = type, $[47] = t27) : t27 = $[47];
|
|
1316
1223
|
let t28;
|
|
1317
|
-
$[
|
|
1224
|
+
$[48] === Symbol.for("react.memo_cache_sentinel") ? (t28 = _inputPresentation(), $[48] = t28) : t28 = $[48];
|
|
1318
1225
|
let t29;
|
|
1319
|
-
$[49]
|
|
1320
|
-
let t30;
|
|
1321
|
-
$[50] !== IconComponent || $[51] !== fontSize || $[52] !== padding ? (t30 = IconComponent && /* @__PURE__ */ jsx(Box, { padding, position: "absolute", insetTop: 0, insetLeft: 0, children: /* @__PURE__ */ jsxs(Text, { size: fontSize, children: [
|
|
1226
|
+
$[49] !== IconComponent || $[50] !== fontSize || $[51] !== padding ? (t29 = IconComponent && /* @__PURE__ */ jsx(Box, { padding, position: "absolute", insetTop: 0, insetLeft: 0, children: /* @__PURE__ */ jsxs(Text, { size: fontSize, children: [
|
|
1322
1227
|
isValidElement(IconComponent) && IconComponent,
|
|
1323
1228
|
isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
|
|
1324
|
-
] }) }), $[
|
|
1325
|
-
let
|
|
1326
|
-
$[
|
|
1229
|
+
] }) }), $[49] = IconComponent, $[50] = fontSize, $[51] = padding, $[52] = t29) : t29 = $[52];
|
|
1230
|
+
let t30;
|
|
1231
|
+
$[53] !== IconRightComponent || $[54] !== fontSize || $[55] !== padding || $[56] !== withClearButton ? (t30 = !withClearButton && IconRightComponent && /* @__PURE__ */ jsx(Box, { padding, position: "absolute", insetTop: 0, insetRight: 0, children: /* @__PURE__ */ jsxs(Text, { size: fontSize, children: [
|
|
1327
1232
|
isValidElement(IconRightComponent) && IconRightComponent,
|
|
1328
1233
|
isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
|
|
1329
|
-
] }) }), $[
|
|
1234
|
+
] }) }), $[53] = IconRightComponent, $[54] = fontSize, $[55] = padding, $[56] = withClearButton, $[57] = t30) : t30 = $[57];
|
|
1235
|
+
let t31;
|
|
1236
|
+
$[58] !== t29 || $[59] !== t30 ? (t31 = /* @__PURE__ */ jsxs(Box, { className: t28, position: "absolute", children: [
|
|
1237
|
+
t29,
|
|
1238
|
+
t30
|
|
1239
|
+
] }), $[58] = t29, $[59] = t30, $[60] = t31) : t31 = $[60];
|
|
1330
1240
|
let t32;
|
|
1331
|
-
$[
|
|
1332
|
-
t30,
|
|
1333
|
-
t31
|
|
1334
|
-
] }), $[59] = t30, $[60] = t31, $[61] = t32) : t32 = $[61];
|
|
1335
|
-
let t33;
|
|
1336
|
-
$[62] !== clearButton || $[63] !== clearButtonBoxPadding || $[64] !== clearButtonPadding || $[65] !== clearButtonProps || $[66] !== disabled || $[67] !== fontSize || $[68] !== handleClearClick || $[69] !== radius || $[70] !== readOnly ? (t33 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsx(Box, { insetTop: 0, insetRight: 0, padding: clearButtonBoxPadding, position: "absolute", style: {
|
|
1241
|
+
$[61] !== clearButton || $[62] !== clearButtonBoxPadding || $[63] !== clearButtonPadding || $[64] !== clearButtonProps || $[65] !== disabled || $[66] !== fontSize || $[67] !== handleClearClick || $[68] !== radius || $[69] !== readOnly ? (t32 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsx(Box, { insetTop: 0, insetRight: 0, padding: clearButtonBoxPadding, position: "absolute", style: {
|
|
1337
1242
|
zIndex: 2
|
|
1338
|
-
}, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Clear", "data-qa": "clear-button", display: "block", fontSize, icon: CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }) }), $[
|
|
1243
|
+
}, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Clear", "data-qa": "clear-button", display: "block", fontSize, icon: CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }) }), $[61] = clearButton, $[62] = clearButtonBoxPadding, $[63] = clearButtonPadding, $[64] = clearButtonProps, $[65] = disabled, $[66] = fontSize, $[67] = handleClearClick, $[68] = radius, $[69] = readOnly, $[70] = t32) : t32 = $[70];
|
|
1244
|
+
let t33;
|
|
1245
|
+
$[71] !== t27 || $[72] !== t31 || $[73] !== t32 ? (t33 = /* @__PURE__ */ jsxs(Box, { className: t24, flex: 1, position: "relative", children: [
|
|
1246
|
+
t27,
|
|
1247
|
+
t31,
|
|
1248
|
+
t32
|
|
1249
|
+
] }), $[71] = t27, $[72] = t31, $[73] = t32, $[74] = t33) : t33 = $[74];
|
|
1339
1250
|
let t34;
|
|
1340
|
-
$[
|
|
1341
|
-
t28,
|
|
1342
|
-
t32,
|
|
1343
|
-
t33
|
|
1344
|
-
] }), $[72] = t28, $[73] = t32, $[74] = t33, $[75] = t34) : t34 = $[75];
|
|
1251
|
+
$[75] !== suffix ? (t34 = suffix && /* @__PURE__ */ jsx(Box, { className: textInputSuffix(), sizing: "border", children: /* @__PURE__ */ jsx("span", { children: suffix }) }), $[75] = suffix, $[76] = t34) : t34 = $[76];
|
|
1345
1252
|
let t35;
|
|
1346
|
-
$[
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
t35
|
|
1352
|
-
] }), $[78] = t17, $[79] = t18, $[80] = t19, $[81] = t20, $[82] = t21, $[83] = t22, $[84] = t23, $[85] = t24, $[86] = t34, $[87] = t35, $[88] = t36) : t36 = $[88], t36;
|
|
1253
|
+
return $[77] !== t16 || $[78] !== t17 || $[79] !== t18 || $[80] !== t19 || $[81] !== t20 || $[82] !== t21 || $[83] !== t22 || $[84] !== t23 || $[85] !== t33 || $[86] !== t34 ? (t35 = /* @__PURE__ */ jsxs(Box, { alignItems: "center", className: t16, "data-icon-left": t17, "data-icon-right": t18, "data-invalid": t19, "data-prefix": t20, "data-read-only": t21, "data-suffix": t22, "data-ui": "TextInput", display: "flex", children: [
|
|
1254
|
+
t23,
|
|
1255
|
+
t33,
|
|
1256
|
+
t34
|
|
1257
|
+
] }), $[77] = t16, $[78] = t17, $[79] = t18, $[80] = t19, $[81] = t20, $[82] = t21, $[83] = t22, $[84] = t23, $[85] = t33, $[86] = t34, $[87] = t35) : t35 = $[87], t35;
|
|
1353
1258
|
}
|
|
1354
1259
|
function _temp3(t0) {
|
|
1355
1260
|
const [key_0, value_0] = t0;
|
|
@@ -1436,34 +1341,32 @@ function KBD(props) {
|
|
|
1436
1341
|
}
|
|
1437
1342
|
const DEFAULT_HOTKEYS_ELEMENT = "kbd";
|
|
1438
1343
|
function Hotkeys(props) {
|
|
1439
|
-
const $ = c(
|
|
1440
|
-
let fontSize,
|
|
1344
|
+
const $ = c(26), t0 = props;
|
|
1345
|
+
let fontSize, gapX, gapY, keys, padding, radius, rest, t1, t2;
|
|
1441
1346
|
$[0] !== t0 ? ({
|
|
1442
1347
|
as: t1,
|
|
1443
1348
|
fontSize,
|
|
1444
|
-
gap,
|
|
1349
|
+
gap: t2,
|
|
1445
1350
|
gapX,
|
|
1446
1351
|
gapY,
|
|
1447
1352
|
keys,
|
|
1448
1353
|
padding,
|
|
1449
1354
|
radius,
|
|
1450
|
-
space: t2,
|
|
1451
1355
|
...rest
|
|
1452
|
-
} = t0, $[0] = t0, $[1] = fontSize, $[2] =
|
|
1453
|
-
const as = t1 === void 0 ? DEFAULT_HOTKEYS_ELEMENT : t1,
|
|
1356
|
+
} = t0, $[0] = t0, $[1] = fontSize, $[2] = gapX, $[3] = gapY, $[4] = keys, $[5] = padding, $[6] = radius, $[7] = rest, $[8] = t1, $[9] = t2) : (fontSize = $[1], gapX = $[2], gapY = $[3], keys = $[4], padding = $[5], radius = $[6], rest = $[7], t1 = $[8], t2 = $[9]);
|
|
1357
|
+
const as = t1 === void 0 ? DEFAULT_HOTKEYS_ELEMENT : t1, gap = t2 === void 0 ? 1 : t2;
|
|
1454
1358
|
if (!keys || keys.length === 0)
|
|
1455
1359
|
return;
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
$[16] !== fontSize || $[17] !== padding || $[18] !== radius ? (t52 = (key2, i) => /* @__PURE__ */ jsx(KBD, { fontSize, padding, radius, children: key2 }, i), $[16] = fontSize, $[17] = padding, $[18] = radius, $[19] = t52) : t52 = $[19], t4 = keys.map(t52), $[11] = fontSize, $[12] = keys, $[13] = padding, $[14] = radius, $[15] = t4;
|
|
1360
|
+
let t3;
|
|
1361
|
+
if ($[10] !== fontSize || $[11] !== keys || $[12] !== padding || $[13] !== radius) {
|
|
1362
|
+
let t42;
|
|
1363
|
+
$[15] !== fontSize || $[16] !== padding || $[17] !== radius ? (t42 = (key2, i) => /* @__PURE__ */ jsx(KBD, { fontSize, padding, radius, children: key2 }, i), $[15] = fontSize, $[16] = padding, $[17] = radius, $[18] = t42) : t42 = $[18], t3 = keys.map(t42), $[10] = fontSize, $[11] = keys, $[12] = padding, $[13] = radius, $[14] = t3;
|
|
1461
1364
|
} else
|
|
1462
|
-
|
|
1463
|
-
let
|
|
1464
|
-
return $[
|
|
1365
|
+
t3 = $[14];
|
|
1366
|
+
let t4;
|
|
1367
|
+
return $[19] !== as || $[20] !== gap || $[21] !== gapX || $[22] !== gapY || $[23] !== rest || $[24] !== t3 ? (t4 = /* @__PURE__ */ jsx(Box, { as, "data-ui": "Hotkeys", ...rest, display: "flex", gap, gapX, gapY, children: t3 }), $[19] = as, $[20] = gap, $[21] = gapX, $[22] = gapY, $[23] = rest, $[24] = t3, $[25] = t4) : t4 = $[25], t4;
|
|
1465
1368
|
}
|
|
1466
|
-
const MenuContext = createGlobalScopedContext("@sanity/ui/
|
|
1369
|
+
const MenuContext = createGlobalScopedContext("@sanity/ui/v3/menu", null);
|
|
1467
1370
|
function _isFocusable(element) {
|
|
1468
1371
|
return isHTMLAnchorElement(element) && element.getAttribute("data-disabled") !== "true" || isHTMLButtonElement(element) && !element.disabled;
|
|
1469
1372
|
}
|
|
@@ -1603,45 +1506,38 @@ function useMenuController(props) {
|
|
|
1603
1506
|
}
|
|
1604
1507
|
const DEFAULT_MENU_ELEMENT = "div";
|
|
1605
1508
|
function Menu(props) {
|
|
1606
|
-
const $ = c(
|
|
1607
|
-
let _shouldFocus, children, className, forwardedRef,
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
space: t18,
|
|
1627
|
-
...t19
|
|
1628
|
-
} = t0;
|
|
1629
|
-
t1 = t42, children = t52, className = t62, gap = t72, onClickOutside = t82, onEscape = t92, onItemClick = t102, onItemSelect = t112, onKeyDown = t122, originElement = t132, t2 = t142, forwardedRef = t152, registerElement = t162, _shouldFocus = t172, t3 = t18, rest = t19, $[0] = t0, $[1] = _shouldFocus, $[2] = children, $[3] = className, $[4] = forwardedRef, $[5] = gap, $[6] = onClickOutside, $[7] = onEscape, $[8] = onItemClick, $[9] = onItemSelect, $[10] = onKeyDown, $[11] = originElement, $[12] = registerElement, $[13] = rest, $[14] = t1, $[15] = t2, $[16] = t3;
|
|
1630
|
-
} else
|
|
1631
|
-
_shouldFocus = $[1], children = $[2], className = $[3], forwardedRef = $[4], gap = $[5], onClickOutside = $[6], onEscape = $[7], onItemClick = $[8], onItemSelect = $[9], onKeyDown = $[10], originElement = $[11], registerElement = $[12], rest = $[13], t1 = $[14], t2 = $[15], t3 = $[16];
|
|
1632
|
-
const as = t1 === void 0 ? DEFAULT_MENU_ELEMENT : t1, padding = t2 === void 0 ? 1 : t2, space = t3 === void 0 ? 1 : t3, shouldFocus = _shouldFocus ?? (props.focusFirst && "first" || props.focusLast && "last" || null), ref = useRef(null);
|
|
1509
|
+
const $ = c(57), t0 = props;
|
|
1510
|
+
let _shouldFocus, children, className, forwardedRef, onClickOutside, onEscape, onItemClick, onItemSelect, onKeyDown, originElement, registerElement, rest, t1, t2, t3;
|
|
1511
|
+
$[0] !== t0 ? ({
|
|
1512
|
+
as: t1,
|
|
1513
|
+
children,
|
|
1514
|
+
className,
|
|
1515
|
+
gap: t2,
|
|
1516
|
+
onClickOutside,
|
|
1517
|
+
onEscape,
|
|
1518
|
+
onItemClick,
|
|
1519
|
+
onItemSelect,
|
|
1520
|
+
onKeyDown,
|
|
1521
|
+
originElement,
|
|
1522
|
+
padding: t3,
|
|
1523
|
+
ref: forwardedRef,
|
|
1524
|
+
registerElement,
|
|
1525
|
+
shouldFocus: _shouldFocus,
|
|
1526
|
+
...rest
|
|
1527
|
+
} = t0, $[0] = t0, $[1] = _shouldFocus, $[2] = children, $[3] = className, $[4] = forwardedRef, $[5] = onClickOutside, $[6] = onEscape, $[7] = onItemClick, $[8] = onItemSelect, $[9] = onKeyDown, $[10] = originElement, $[11] = registerElement, $[12] = rest, $[13] = t1, $[14] = t2, $[15] = t3) : (_shouldFocus = $[1], children = $[2], className = $[3], forwardedRef = $[4], onClickOutside = $[5], onEscape = $[6], onItemClick = $[7], onItemSelect = $[8], onKeyDown = $[9], originElement = $[10], registerElement = $[11], rest = $[12], t1 = $[13], t2 = $[14], t3 = $[15]);
|
|
1528
|
+
const as = t1 === void 0 ? DEFAULT_MENU_ELEMENT : t1, gap = t2 === void 0 ? 1 : t2, padding = t3 === void 0 ? 1 : t3, shouldFocus = _shouldFocus ?? null, ref = useRef(null);
|
|
1633
1529
|
let t4;
|
|
1634
|
-
$[
|
|
1530
|
+
$[16] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[16] = t4) : t4 = $[16], useImperativeHandle(forwardedRef, t4);
|
|
1635
1531
|
const {
|
|
1636
1532
|
isTopLayer
|
|
1637
1533
|
} = useLayer();
|
|
1638
1534
|
let t5;
|
|
1639
|
-
$[
|
|
1535
|
+
$[17] !== onKeyDown || $[18] !== originElement || $[19] !== shouldFocus ? (t5 = {
|
|
1640
1536
|
onKeyDown,
|
|
1641
1537
|
originElement,
|
|
1642
1538
|
shouldFocus,
|
|
1643
1539
|
rootElementRef: ref
|
|
1644
|
-
}, $[
|
|
1540
|
+
}, $[17] = onKeyDown, $[18] = originElement, $[19] = shouldFocus, $[20] = t5) : t5 = $[20];
|
|
1645
1541
|
const {
|
|
1646
1542
|
activeElement,
|
|
1647
1543
|
activeIndex,
|
|
@@ -1651,22 +1547,22 @@ function Menu(props) {
|
|
|
1651
1547
|
mount
|
|
1652
1548
|
} = useMenuController(t5), unregisterElementRef = useRef(null);
|
|
1653
1549
|
let t6;
|
|
1654
|
-
$[
|
|
1550
|
+
$[21] !== registerElement ? (t6 = (el) => {
|
|
1655
1551
|
unregisterElementRef.current && (unregisterElementRef.current(), unregisterElementRef.current = null), ref.current = el, ref.current && registerElement && (unregisterElementRef.current = registerElement(ref.current));
|
|
1656
|
-
}, $[
|
|
1552
|
+
}, $[21] = registerElement, $[22] = t6) : t6 = $[22];
|
|
1657
1553
|
const handleRefChange = t6;
|
|
1658
1554
|
let t7, t8;
|
|
1659
|
-
$[
|
|
1555
|
+
$[23] !== activeIndex || $[24] !== onItemSelect ? (t7 = () => {
|
|
1660
1556
|
onItemSelect && onItemSelect(activeIndex);
|
|
1661
|
-
}, t8 = [activeIndex, onItemSelect], $[
|
|
1557
|
+
}, t8 = [activeIndex, onItemSelect], $[23] = activeIndex, $[24] = onItemSelect, $[25] = t7, $[26] = t8) : (t7 = $[25], t8 = $[26]), useEffect(t7, t8);
|
|
1662
1558
|
let t9;
|
|
1663
|
-
$[
|
|
1559
|
+
$[27] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => [ref.current], $[27] = t9) : t9 = $[27], useClickOutsideEvent(isTopLayer && onClickOutside, t9);
|
|
1664
1560
|
let t10;
|
|
1665
|
-
$[
|
|
1561
|
+
$[28] !== isTopLayer || $[29] !== onEscape ? (t10 = (event) => {
|
|
1666
1562
|
isTopLayer && event.key === "Escape" && (event.stopPropagation(), onEscape && onEscape());
|
|
1667
|
-
}, $[
|
|
1563
|
+
}, $[28] = isTopLayer, $[29] = onEscape, $[30] = t10) : t10 = $[30], useGlobalKeyDown(t10);
|
|
1668
1564
|
let t11, t12;
|
|
1669
|
-
$[
|
|
1565
|
+
$[31] !== activeElement || $[32] !== activeIndex || $[33] !== handleItemMouseEnter || $[34] !== handleItemMouseLeave || $[35] !== mount || $[36] !== onClickOutside || $[37] !== onEscape || $[38] !== onItemClick || $[39] !== registerElement ? (t12 = {
|
|
1670
1566
|
version: 0,
|
|
1671
1567
|
activeElement,
|
|
1672
1568
|
activeIndex,
|
|
@@ -1679,19 +1575,18 @@ function Menu(props) {
|
|
|
1679
1575
|
registerElement,
|
|
1680
1576
|
onMouseEnter: handleItemMouseEnter,
|
|
1681
1577
|
onMouseLeave: handleItemMouseLeave
|
|
1682
|
-
}, $[
|
|
1578
|
+
}, $[31] = activeElement, $[32] = activeIndex, $[33] = handleItemMouseEnter, $[34] = handleItemMouseLeave, $[35] = mount, $[36] = onClickOutside, $[37] = onEscape, $[38] = onItemClick, $[39] = registerElement, $[40] = t12) : t12 = $[40], t11 = t12;
|
|
1683
1579
|
const value = t11;
|
|
1684
1580
|
let t13;
|
|
1685
|
-
$[
|
|
1581
|
+
$[41] !== className ? (t13 = menu({
|
|
1686
1582
|
className
|
|
1687
|
-
}), $[
|
|
1688
|
-
|
|
1583
|
+
}), $[41] = className, $[42] = t13) : t13 = $[42];
|
|
1584
|
+
let t14;
|
|
1585
|
+
$[43] !== children || $[44] !== gap ? (t14 = /* @__PURE__ */ jsx(Stack, { gap, children }), $[43] = children, $[44] = gap, $[45] = t14) : t14 = $[45];
|
|
1689
1586
|
let t15;
|
|
1690
|
-
$[
|
|
1587
|
+
$[46] !== as || $[47] !== handleKeyDown || $[48] !== handleRefChange || $[49] !== padding || $[50] !== rest || $[51] !== t13 || $[52] !== t14 ? (t15 = /* @__PURE__ */ jsx(Box, { "data-ui": "Menu", ...rest, as, className: t13, onKeyDown: handleKeyDown, overflow: "auto", outline: "none", padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: t14 }), $[46] = as, $[47] = handleKeyDown, $[48] = handleRefChange, $[49] = padding, $[50] = rest, $[51] = t13, $[52] = t14, $[53] = t15) : t15 = $[53];
|
|
1691
1588
|
let t16;
|
|
1692
|
-
|
|
1693
|
-
let t17;
|
|
1694
|
-
return $[55] !== t16 || $[56] !== value ? (t17 = /* @__PURE__ */ jsx(MenuContext.Provider, { value, children: t16 }), $[55] = t16, $[56] = value, $[57] = t17) : t17 = $[57], t17;
|
|
1589
|
+
return $[54] !== t15 || $[55] !== value ? (t16 = /* @__PURE__ */ jsx(MenuContext.Provider, { value, children: t15 }), $[54] = t15, $[55] = value, $[56] = t16) : t16 = $[56], t16;
|
|
1695
1590
|
}
|
|
1696
1591
|
const DEFAULT_MENU_DIVIDER_ELEMENT = "hr";
|
|
1697
1592
|
function MenuDivider(props) {
|
|
@@ -1720,126 +1615,125 @@ function useMenu() {
|
|
|
1720
1615
|
}
|
|
1721
1616
|
const DEFAULT_MENU_GROUP_ELEMENT = "button";
|
|
1722
1617
|
function MenuGroup(props) {
|
|
1723
|
-
const $ = c(
|
|
1724
|
-
let IconComponent, children,
|
|
1618
|
+
const $ = c(77), t0 = props;
|
|
1619
|
+
let IconComponent, children, menuProps, onClick, popover2, rest, t1, t2, t3, t4, t5, t6, text2;
|
|
1725
1620
|
$[0] !== t0 ? ({
|
|
1726
1621
|
as: t1,
|
|
1727
1622
|
children,
|
|
1728
1623
|
fontSize: t2,
|
|
1729
|
-
gap,
|
|
1624
|
+
gap: t3,
|
|
1730
1625
|
icon: IconComponent,
|
|
1731
1626
|
menu: menuProps,
|
|
1732
1627
|
onClick,
|
|
1733
|
-
padding:
|
|
1628
|
+
padding: t4,
|
|
1734
1629
|
popover: popover2,
|
|
1735
|
-
radius:
|
|
1736
|
-
space: t5,
|
|
1630
|
+
radius: t5,
|
|
1737
1631
|
text: text2,
|
|
1738
1632
|
tone: t6,
|
|
1739
1633
|
...rest
|
|
1740
|
-
} = t0, $[0] = t0, $[1] = IconComponent, $[2] = children, $[3] =
|
|
1741
|
-
const as = t1 === void 0 ? DEFAULT_MENU_GROUP_ELEMENT : t1, fontSize = t2 === void 0 ? 1 : t2,
|
|
1634
|
+
} = t0, $[0] = t0, $[1] = IconComponent, $[2] = children, $[3] = menuProps, $[4] = onClick, $[5] = popover2, $[6] = rest, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = t4, $[11] = t5, $[12] = t6, $[13] = text2) : (IconComponent = $[1], children = $[2], menuProps = $[3], onClick = $[4], popover2 = $[5], rest = $[6], t1 = $[7], t2 = $[8], t3 = $[9], t4 = $[10], t5 = $[11], t6 = $[12], text2 = $[13]);
|
|
1635
|
+
const as = t1 === void 0 ? DEFAULT_MENU_GROUP_ELEMENT : t1, fontSize = t2 === void 0 ? 1 : t2, gap = t3 === void 0 ? 3 : t3, padding = t4 === void 0 ? 3 : t4, radius = t5 === void 0 ? 2 : t5, tone = t6 === void 0 ? "default" : t6, {
|
|
1742
1636
|
activeElement,
|
|
1743
1637
|
mount,
|
|
1744
1638
|
onClickOutside,
|
|
1745
1639
|
onEscape,
|
|
1746
1640
|
onItemClick,
|
|
1747
|
-
onItemMouseEnter
|
|
1641
|
+
onItemMouseEnter,
|
|
1748
1642
|
registerElement
|
|
1749
|
-
} =
|
|
1643
|
+
} = useMenu(), [rootElement, setRootElement] = useState(null), [open, setOpen] = useState(!1), [shouldFocus, setShouldFocus] = useState(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = useState(!1);
|
|
1750
1644
|
let t7;
|
|
1751
|
-
$[
|
|
1752
|
-
setWithinMenu(!1), onItemMouseEnter(event), setOpen(!0);
|
|
1753
|
-
}, $[
|
|
1645
|
+
$[14] !== onItemMouseEnter ? (t7 = (event) => {
|
|
1646
|
+
setWithinMenu(!1), onItemMouseEnter?.(event), setOpen(!0);
|
|
1647
|
+
}, $[14] = onItemMouseEnter, $[15] = t7) : t7 = $[15];
|
|
1754
1648
|
const handleMouseEnter = t7;
|
|
1755
1649
|
let t8;
|
|
1756
|
-
$[
|
|
1650
|
+
$[16] !== rootElement ? (t8 = (event_0) => {
|
|
1757
1651
|
event_0.key === "ArrowLeft" && (event_0.stopPropagation(), setOpen(!1), requestAnimationFrame(() => {
|
|
1758
1652
|
rootElement?.focus();
|
|
1759
1653
|
}));
|
|
1760
|
-
}, $[
|
|
1654
|
+
}, $[16] = rootElement, $[17] = t8) : t8 = $[17];
|
|
1761
1655
|
const handleMenuKeyDown = t8;
|
|
1762
1656
|
let t9;
|
|
1763
|
-
$[
|
|
1657
|
+
$[18] !== onClick ? (t9 = (event_1) => {
|
|
1764
1658
|
onClick?.(event_1), setShouldFocus("first"), setOpen(!0);
|
|
1765
|
-
}, $[
|
|
1659
|
+
}, $[18] = onClick, $[19] = t9) : t9 = $[19];
|
|
1766
1660
|
const handleClick = t9;
|
|
1767
1661
|
let t10;
|
|
1768
|
-
$[
|
|
1662
|
+
$[20] !== onItemClick ? (t10 = () => {
|
|
1769
1663
|
setOpen(!1), onItemClick?.();
|
|
1770
|
-
}, $[
|
|
1664
|
+
}, $[20] = onItemClick, $[21] = t10) : t10 = $[21];
|
|
1771
1665
|
const handleChildItemClick = t10;
|
|
1772
1666
|
let t11;
|
|
1773
|
-
$[
|
|
1667
|
+
$[22] === Symbol.for("react.memo_cache_sentinel") ? (t11 = () => setWithinMenu(!0), $[22] = t11) : t11 = $[22];
|
|
1774
1668
|
const handleMenuMouseEnter = t11;
|
|
1775
1669
|
let t12, t13;
|
|
1776
|
-
$[
|
|
1670
|
+
$[23] !== mount || $[24] !== rootElement ? (t12 = () => mount(rootElement), t13 = [mount, rootElement], $[23] = mount, $[24] = rootElement, $[25] = t12, $[26] = t13) : (t12 = $[25], t13 = $[26]), useEffect(t12, t13);
|
|
1777
1671
|
let t14, t15;
|
|
1778
|
-
$[
|
|
1672
|
+
$[27] !== active ? (t14 = () => {
|
|
1779
1673
|
active || setOpen(!1);
|
|
1780
|
-
}, t15 = [active], $[
|
|
1674
|
+
}, t15 = [active], $[27] = active, $[28] = t14, $[29] = t15) : (t14 = $[28], t15 = $[29]), useEffect(t14, t15);
|
|
1781
1675
|
let t16, t17;
|
|
1782
|
-
$[
|
|
1676
|
+
$[30] !== open ? (t16 = () => {
|
|
1783
1677
|
open || setWithinMenu(!1);
|
|
1784
|
-
}, t17 = [open], $[
|
|
1678
|
+
}, t17 = [open], $[30] = open, $[31] = t16, $[32] = t17) : (t16 = $[31], t17 = $[32]), useEffect(t16, t17);
|
|
1785
1679
|
let t18, t19;
|
|
1786
|
-
$[
|
|
1680
|
+
$[33] !== shouldFocus ? (t18 = () => {
|
|
1787
1681
|
if (!shouldFocus)
|
|
1788
1682
|
return;
|
|
1789
1683
|
const rafId = requestAnimationFrame(() => setShouldFocus(null));
|
|
1790
1684
|
return () => cancelAnimationFrame(rafId);
|
|
1791
|
-
}, t19 = [shouldFocus], $[
|
|
1685
|
+
}, t19 = [shouldFocus], $[33] = shouldFocus, $[34] = t18, $[35] = t19) : (t18 = $[34], t19 = $[35]), useEffect(t18, t19);
|
|
1792
1686
|
let t20;
|
|
1793
|
-
$[
|
|
1687
|
+
$[36] !== children || $[37] !== handleChildItemClick || $[38] !== handleMenuKeyDown || $[39] !== menuProps || $[40] !== onClickOutside || $[41] !== onEscape || $[42] !== registerElement || $[43] !== shouldFocus ? (t20 = /* @__PURE__ */ jsx(Menu, { ...menuProps, onClickOutside, onEscape, onItemClick: handleChildItemClick, onKeyDown: handleMenuKeyDown, onMouseEnter: handleMenuMouseEnter, registerElement, shouldFocus, children }), $[36] = children, $[37] = handleChildItemClick, $[38] = handleMenuKeyDown, $[39] = menuProps, $[40] = onClickOutside, $[41] = onEscape, $[42] = registerElement, $[43] = shouldFocus, $[44] = t20) : t20 = $[44];
|
|
1794
1688
|
const childMenu = t20;
|
|
1795
1689
|
let t21;
|
|
1796
|
-
$[
|
|
1690
|
+
$[45] === Symbol.for("react.memo_cache_sentinel") ? (t21 = (event_2) => {
|
|
1797
1691
|
const target = event_2.currentTarget;
|
|
1798
1692
|
if (document.activeElement === target && event_2.key === "ArrowRight") {
|
|
1799
1693
|
setShouldFocus("first"), setOpen(!0), setWithinMenu(!0);
|
|
1800
1694
|
return;
|
|
1801
1695
|
}
|
|
1802
|
-
}, $[
|
|
1803
|
-
const handleKeyDown = t21, t22 = as === "button" ? withinMenu : void 0, t23 = as === "button" ? "button" : void 0
|
|
1804
|
-
let
|
|
1805
|
-
$[
|
|
1696
|
+
}, $[45] = t21) : t21 = $[45];
|
|
1697
|
+
const handleKeyDown = t21, t22 = as === "button" ? withinMenu : void 0, t23 = as === "button" ? "button" : void 0;
|
|
1698
|
+
let t24;
|
|
1699
|
+
$[46] !== IconComponent || $[47] !== fontSize ? (t24 = IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize, children: [
|
|
1806
1700
|
isValidElement(IconComponent) && IconComponent,
|
|
1807
1701
|
isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
|
|
1808
|
-
] }), $[
|
|
1702
|
+
] }), $[46] = IconComponent, $[47] = fontSize, $[48] = t24) : t24 = $[48];
|
|
1703
|
+
let t25;
|
|
1704
|
+
$[49] !== fontSize || $[50] !== text2 ? (t25 = /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { size: fontSize, textOverflow: "ellipsis", weight: "medium", children: text2 }) }), $[49] = fontSize, $[50] = text2, $[51] = t25) : t25 = $[51];
|
|
1809
1705
|
let t26;
|
|
1810
|
-
$[
|
|
1706
|
+
$[52] === Symbol.for("react.memo_cache_sentinel") ? (t26 = /* @__PURE__ */ jsx(ChevronRightIcon, {}), $[52] = t26) : t26 = $[52];
|
|
1811
1707
|
let t27;
|
|
1812
|
-
$[53]
|
|
1708
|
+
$[53] !== fontSize ? (t27 = /* @__PURE__ */ jsx(Text, { size: fontSize, children: t26 }), $[53] = fontSize, $[54] = t27) : t27 = $[54];
|
|
1813
1709
|
let t28;
|
|
1814
|
-
$[
|
|
1815
|
-
|
|
1816
|
-
$[56] !== padding || $[57] !== t24 || $[58] !== t25 || $[59] !== t26 || $[60] !== t28 ? (t29 = /* @__PURE__ */ jsxs(Flex, { gap: t24, padding, children: [
|
|
1710
|
+
$[55] !== gap || $[56] !== padding || $[57] !== t24 || $[58] !== t25 || $[59] !== t27 ? (t28 = /* @__PURE__ */ jsxs(Flex, { gap, padding, children: [
|
|
1711
|
+
t24,
|
|
1817
1712
|
t25,
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1713
|
+
t27
|
|
1714
|
+
] }), $[55] = gap, $[56] = padding, $[57] = t24, $[58] = t25, $[59] = t27, $[60] = t28) : t28 = $[60];
|
|
1715
|
+
let t29;
|
|
1716
|
+
$[61] !== as || $[62] !== handleClick || $[63] !== handleMouseEnter || $[64] !== radius || $[65] !== rest || $[66] !== t22 || $[67] !== t23 || $[68] !== t28 || $[69] !== tone || $[70] !== withinMenu ? (t29 = /* @__PURE__ */ jsx(Selectable, { "data-ui": "MenuGroup", ...rest, "aria-pressed": t22, as, onClick: handleClick, onKeyDown: handleKeyDown, onMouseEnter: handleMouseEnter, radius, ref: setRootElement, selected: withinMenu, tabIndex: -1, tone, type: t23, children: t28 }), $[61] = as, $[62] = handleClick, $[63] = handleMouseEnter, $[64] = radius, $[65] = rest, $[66] = t22, $[67] = t23, $[68] = t28, $[69] = tone, $[70] = withinMenu, $[71] = t29) : t29 = $[71];
|
|
1821
1717
|
let t30;
|
|
1822
|
-
|
|
1823
|
-
let t31;
|
|
1824
|
-
return $[73] !== childMenu || $[74] !== open || $[75] !== popover2 || $[76] !== t30 ? (t31 = /* @__PURE__ */ jsx(Popover, { ...popover2, content: childMenu, "data-ui": "MenuGroup__popover", open, children: t30 }), $[73] = childMenu, $[74] = open, $[75] = popover2, $[76] = t30, $[77] = t31) : t31 = $[77], t31;
|
|
1718
|
+
return $[72] !== childMenu || $[73] !== open || $[74] !== popover2 || $[75] !== t29 ? (t30 = /* @__PURE__ */ jsx(Popover, { ...popover2, content: childMenu, "data-ui": "MenuGroup__popover", open, children: t29 }), $[72] = childMenu, $[73] = open, $[74] = popover2, $[75] = t29, $[76] = t30) : t30 = $[76], t30;
|
|
1825
1719
|
}
|
|
1826
1720
|
const DEFAULT_MENU_ITEM_ELEMENT = "button";
|
|
1827
1721
|
function MenuItem(props) {
|
|
1828
|
-
const $ = c(
|
|
1829
|
-
let IconComponent, IconRightComponent, children, disabled, forwardedRef,
|
|
1722
|
+
const $ = c(73), t0 = props;
|
|
1723
|
+
let IconComponent, IconRightComponent, children, disabled, forwardedRef, gapX, gapY, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, pressed, rest, selectedProp, t1, t2, t3, t4, t5, t6, text2;
|
|
1830
1724
|
$[0] !== t0 ? ({
|
|
1831
1725
|
as: t1,
|
|
1832
1726
|
children,
|
|
1833
1727
|
disabled,
|
|
1834
1728
|
fontSize: t2,
|
|
1835
|
-
gap,
|
|
1729
|
+
gap: t3,
|
|
1836
1730
|
gapX,
|
|
1837
1731
|
gapY,
|
|
1838
1732
|
hotkeys,
|
|
1839
1733
|
icon: IconComponent,
|
|
1840
1734
|
iconRight: IconRightComponent,
|
|
1841
1735
|
onClick,
|
|
1842
|
-
padding:
|
|
1736
|
+
padding: t4,
|
|
1843
1737
|
paddingX,
|
|
1844
1738
|
paddingY,
|
|
1845
1739
|
paddingTop,
|
|
@@ -1847,32 +1741,31 @@ function MenuItem(props) {
|
|
|
1847
1741
|
paddingBottom,
|
|
1848
1742
|
paddingLeft,
|
|
1849
1743
|
pressed,
|
|
1850
|
-
radius:
|
|
1744
|
+
radius: t5,
|
|
1851
1745
|
ref: forwardedRef,
|
|
1852
1746
|
selected: selectedProp,
|
|
1853
|
-
space: t5,
|
|
1854
1747
|
text: text2,
|
|
1855
1748
|
tone: t6,
|
|
1856
1749
|
...rest
|
|
1857
|
-
} = t0, $[0] = t0, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = forwardedRef, $[6] =
|
|
1858
|
-
const as = t1 === void 0 ? DEFAULT_MENU_ITEM_ELEMENT : t1, fontSize = t2 === void 0 ? 1 : t2,
|
|
1750
|
+
} = t0, $[0] = t0, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = forwardedRef, $[6] = gapX, $[7] = gapY, $[8] = hotkeys, $[9] = onClick, $[10] = paddingBottom, $[11] = paddingLeft, $[12] = paddingRight, $[13] = paddingTop, $[14] = paddingX, $[15] = paddingY, $[16] = pressed, $[17] = rest, $[18] = selectedProp, $[19] = t1, $[20] = t2, $[21] = t3, $[22] = t4, $[23] = t5, $[24] = t6, $[25] = text2) : (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], forwardedRef = $[5], gapX = $[6], gapY = $[7], hotkeys = $[8], onClick = $[9], paddingBottom = $[10], paddingLeft = $[11], paddingRight = $[12], paddingTop = $[13], paddingX = $[14], paddingY = $[15], pressed = $[16], rest = $[17], selectedProp = $[18], t1 = $[19], t2 = $[20], t3 = $[21], t4 = $[22], t5 = $[23], t6 = $[24], text2 = $[25]);
|
|
1751
|
+
const as = t1 === void 0 ? DEFAULT_MENU_ITEM_ELEMENT : t1, fontSize = t2 === void 0 ? 1 : t2, gap = t3 === void 0 ? 3 : t3, padding = t4 === void 0 ? 3 : t4, radius = t5 === void 0 ? 2 : t5, tone = t6 === void 0 ? "default" : t6, menu2 = useMenu(), {
|
|
1859
1752
|
activeElement,
|
|
1860
1753
|
mount,
|
|
1861
1754
|
onItemClick,
|
|
1862
|
-
onItemMouseEnter
|
|
1863
|
-
onItemMouseLeave
|
|
1864
|
-
} = menu2,
|
|
1755
|
+
onItemMouseEnter,
|
|
1756
|
+
onItemMouseLeave
|
|
1757
|
+
} = menu2, [rootElement, setRootElement] = useState(null), active = !!activeElement && activeElement === rootElement, ref = useRef(null);
|
|
1865
1758
|
let t7;
|
|
1866
|
-
$[
|
|
1759
|
+
$[26] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[26] = t7) : t7 = $[26], useImperativeHandle(forwardedRef, t7);
|
|
1867
1760
|
let t8, t9;
|
|
1868
|
-
$[
|
|
1761
|
+
$[27] !== mount || $[28] !== rootElement || $[29] !== selectedProp ? (t8 = () => mount(rootElement, selectedProp), t9 = [mount, rootElement, selectedProp], $[27] = mount, $[28] = rootElement, $[29] = selectedProp, $[30] = t8, $[31] = t9) : (t8 = $[30], t9 = $[31]), useEffect(t8, t9);
|
|
1869
1762
|
let t10;
|
|
1870
|
-
$[
|
|
1763
|
+
$[32] !== disabled || $[33] !== onClick || $[34] !== onItemClick ? (t10 = (event) => {
|
|
1871
1764
|
disabled || (onClick && onClick(event), onItemClick && onItemClick());
|
|
1872
|
-
}, $[
|
|
1765
|
+
}, $[32] = disabled, $[33] = onClick, $[34] = onItemClick, $[35] = t10) : t10 = $[35];
|
|
1873
1766
|
const handleClick = t10;
|
|
1874
1767
|
let t11, t12;
|
|
1875
|
-
$[
|
|
1768
|
+
$[36] !== padding || $[37] !== paddingBottom || $[38] !== paddingLeft || $[39] !== paddingRight || $[40] !== paddingTop || $[41] !== paddingX || $[42] !== paddingY ? (t12 = {
|
|
1876
1769
|
padding,
|
|
1877
1770
|
paddingX,
|
|
1878
1771
|
paddingY,
|
|
@@ -1880,15 +1773,15 @@ function MenuItem(props) {
|
|
|
1880
1773
|
paddingRight,
|
|
1881
1774
|
paddingBottom,
|
|
1882
1775
|
paddingLeft
|
|
1883
|
-
}, $[
|
|
1776
|
+
}, $[36] = padding, $[37] = paddingBottom, $[38] = paddingLeft, $[39] = paddingRight, $[40] = paddingTop, $[41] = paddingX, $[42] = paddingY, $[43] = t12) : t12 = $[43], t11 = t12;
|
|
1884
1777
|
const paddingProps = t11;
|
|
1885
1778
|
let t13;
|
|
1886
|
-
$[
|
|
1779
|
+
$[44] === Symbol.for("react.memo_cache_sentinel") ? (t13 = (el) => {
|
|
1887
1780
|
ref.current = el, setRootElement(el);
|
|
1888
|
-
}, $[
|
|
1781
|
+
}, $[44] = t13) : t13 = $[44];
|
|
1889
1782
|
const setRef = t13, t14 = pressed ? "" : void 0, t15 = active ? "" : void 0, t16 = disabled ? "" : void 0, t17 = as === "button" ? "button" : void 0;
|
|
1890
1783
|
let t18;
|
|
1891
|
-
$[
|
|
1784
|
+
$[45] !== IconComponent || $[46] !== IconRightComponent || $[47] !== fontSize || $[48] !== gap || $[49] !== gapX || $[50] !== gapY || $[51] !== hotkeys || $[52] !== paddingProps || $[53] !== text2 ? (t18 = (IconComponent || text2 || IconRightComponent) && /* @__PURE__ */ jsxs(Flex, { as: "span", gap, gapX, gapY, align: "center", ...paddingProps, children: [
|
|
1892
1785
|
IconComponent && /* @__PURE__ */ jsxs(Text, { muted: !0, size: fontSize, children: [
|
|
1893
1786
|
isValidElement(IconComponent) && IconComponent,
|
|
1894
1787
|
isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
|
|
@@ -1902,14 +1795,14 @@ function MenuItem(props) {
|
|
|
1902
1795
|
isValidElement(IconRightComponent) && IconRightComponent,
|
|
1903
1796
|
isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
|
|
1904
1797
|
] })
|
|
1905
|
-
] }), $[
|
|
1798
|
+
] }), $[45] = IconComponent, $[46] = IconRightComponent, $[47] = fontSize, $[48] = gap, $[49] = gapX, $[50] = gapY, $[51] = hotkeys, $[52] = paddingProps, $[53] = text2, $[54] = t18) : t18 = $[54];
|
|
1906
1799
|
let t19;
|
|
1907
|
-
$[
|
|
1800
|
+
$[55] !== children || $[56] !== paddingProps ? (t19 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...paddingProps, children }), $[55] = children, $[56] = paddingProps, $[57] = t19) : t19 = $[57];
|
|
1908
1801
|
let t20;
|
|
1909
|
-
return $[
|
|
1802
|
+
return $[58] !== as || $[59] !== disabled || $[60] !== handleClick || $[61] !== onItemMouseEnter || $[62] !== onItemMouseLeave || $[63] !== radius || $[64] !== rest || $[65] !== t14 || $[66] !== t15 || $[67] !== t16 || $[68] !== t17 || $[69] !== t18 || $[70] !== t19 || $[71] !== tone ? (t20 = /* @__PURE__ */ jsxs(Selectable, { "data-ui": "MenuItem", ...rest, as, "data-pressed": t14, "data-selected": t15, "data-disabled": t16, radius, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, role: "menuitem", tabIndex: -1, tone, type: t17, children: [
|
|
1910
1803
|
t18,
|
|
1911
1804
|
t19
|
|
1912
|
-
] }), $[
|
|
1805
|
+
] }), $[58] = as, $[59] = disabled, $[60] = handleClick, $[61] = onItemMouseEnter, $[62] = onItemMouseLeave, $[63] = radius, $[64] = rest, $[65] = t14, $[66] = t15, $[67] = t16, $[68] = t17, $[69] = t18, $[70] = t19, $[71] = tone, $[72] = t20) : t20 = $[72], t20;
|
|
1913
1806
|
}
|
|
1914
1807
|
const DEFAULT_TAB_ELEMENT = "button";
|
|
1915
1808
|
function Tab(props) {
|
|
@@ -1952,36 +1845,35 @@ function Tab(props) {
|
|
|
1952
1845
|
}
|
|
1953
1846
|
const DEFAULT_TAB_LIST_ELEMENT = "div";
|
|
1954
1847
|
function TabList(props) {
|
|
1955
|
-
const $ = c(
|
|
1956
|
-
let childrenProp, rest, t1, t2, t3
|
|
1848
|
+
const $ = c(20), t0 = props;
|
|
1849
|
+
let childrenProp, rest, t1, t2, t3;
|
|
1957
1850
|
$[0] !== t0 ? ({
|
|
1958
1851
|
as: t1,
|
|
1959
1852
|
children: childrenProp,
|
|
1960
1853
|
gap: t2,
|
|
1961
|
-
|
|
1962
|
-
wrap: t4,
|
|
1854
|
+
wrap: t3,
|
|
1963
1855
|
...rest
|
|
1964
|
-
} = t0, $[0] = t0, $[1] = childrenProp, $[2] = rest, $[3] = t1, $[4] = t2, $[5] = t3
|
|
1965
|
-
const as = t1 === void 0 ? DEFAULT_TAB_LIST_ELEMENT : t1, gap = t2 === void 0 ? 1 : t2,
|
|
1966
|
-
let
|
|
1967
|
-
if ($[
|
|
1856
|
+
} = t0, $[0] = t0, $[1] = childrenProp, $[2] = rest, $[3] = t1, $[4] = t2, $[5] = t3) : (childrenProp = $[1], rest = $[2], t1 = $[3], t2 = $[4], t3 = $[5]);
|
|
1857
|
+
const as = t1 === void 0 ? DEFAULT_TAB_LIST_ELEMENT : t1, gap = t2 === void 0 ? 1 : t2, wrap = t3 === void 0 ? "nowrap" : t3, [focusedIndex, setFocusedIndex] = useState(-1);
|
|
1858
|
+
let t4;
|
|
1859
|
+
if ($[6] !== childrenProp || $[7] !== focusedIndex) {
|
|
1968
1860
|
const children = Children.toArray(childrenProp).filter(_isReactElement);
|
|
1969
|
-
let
|
|
1970
|
-
$[
|
|
1861
|
+
let t52;
|
|
1862
|
+
$[9] !== focusedIndex ? (t52 = (child, childIndex) => cloneElement(child, {
|
|
1971
1863
|
focused: focusedIndex === childIndex,
|
|
1972
1864
|
key: childIndex,
|
|
1973
1865
|
onFocus: () => setFocusedIndex(childIndex)
|
|
1974
|
-
}), $[
|
|
1866
|
+
}), $[9] = focusedIndex, $[10] = t52) : t52 = $[10], t4 = children.map(t52), $[6] = childrenProp, $[7] = focusedIndex, $[8] = t4;
|
|
1975
1867
|
} else
|
|
1976
|
-
|
|
1977
|
-
const tabs =
|
|
1978
|
-
let
|
|
1979
|
-
$[
|
|
1868
|
+
t4 = $[8];
|
|
1869
|
+
const tabs = t4, numTabs = tabs.length;
|
|
1870
|
+
let t5;
|
|
1871
|
+
$[11] !== numTabs ? (t5 = (event) => {
|
|
1980
1872
|
event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex_0) => (prevIndex_0 + 1) % numTabs);
|
|
1981
|
-
}, $[
|
|
1982
|
-
const handleKeyDown =
|
|
1983
|
-
let
|
|
1984
|
-
return $[
|
|
1873
|
+
}, $[11] = numTabs, $[12] = t5) : t5 = $[12];
|
|
1874
|
+
const handleKeyDown = t5;
|
|
1875
|
+
let t6;
|
|
1876
|
+
return $[13] !== as || $[14] !== gap || $[15] !== handleKeyDown || $[16] !== rest || $[17] !== tabs || $[18] !== wrap ? (t6 = /* @__PURE__ */ jsx(Flex, { "data-ui": "TabList", ...rest, as, gap, onKeyDown: handleKeyDown, role: "tablist", wrap, children: tabs }), $[13] = as, $[14] = gap, $[15] = handleKeyDown, $[16] = rest, $[17] = tabs, $[18] = wrap, $[19] = t6) : t6 = $[19], t6;
|
|
1985
1877
|
}
|
|
1986
1878
|
function _isReactElement(node) {
|
|
1987
1879
|
return !!node;
|
|
@@ -2033,7 +1925,7 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
|
|
|
2033
1925
|
right: ["right-end", "right-start", "left", "top", "bottom"],
|
|
2034
1926
|
"right-start": ["right", "right-end", "left-start", "top-start", "bottom-start"],
|
|
2035
1927
|
"right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
|
|
2036
|
-
}, TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/
|
|
1928
|
+
}, TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/v3/tooltipDelayGroup", null);
|
|
2037
1929
|
function useTooltipDelayGroup() {
|
|
2038
1930
|
return useContext(TooltipDelayGroupContext);
|
|
2039
1931
|
}
|
|
@@ -2248,24 +2140,23 @@ function useCloseOnMouseLeave(t0) {
|
|
|
2248
2140
|
$[7] !== isInsideGroup || $[8] !== showTooltip ? (t3 = [isInsideGroup, showTooltip], $[7] = isInsideGroup, $[8] = showTooltip, $[9] = t3) : t3 = $[9], useEffect(t2, t3);
|
|
2249
2141
|
}
|
|
2250
2142
|
function PortalProvider(props) {
|
|
2251
|
-
const $ = c(
|
|
2252
|
-
boundaryElement,
|
|
2143
|
+
const $ = c(6), {
|
|
2253
2144
|
children,
|
|
2254
2145
|
element,
|
|
2255
2146
|
__unstable_elements: elementsProp
|
|
2256
2147
|
} = props, elements = useUnique(elementsProp), fallbackElement = useSyncExternalStore(emptySubscribe, _temp, _temp2);
|
|
2257
2148
|
let t0;
|
|
2258
|
-
const t1 =
|
|
2259
|
-
let
|
|
2260
|
-
$[0] !== elements || $[1] !== t1
|
|
2149
|
+
const t1 = element || fallbackElement;
|
|
2150
|
+
let t2;
|
|
2151
|
+
$[0] !== elements || $[1] !== t1 ? (t2 = {
|
|
2261
2152
|
version: 0,
|
|
2262
|
-
boundaryElement:
|
|
2263
|
-
element:
|
|
2153
|
+
boundaryElement: null,
|
|
2154
|
+
element: t1,
|
|
2264
2155
|
elements
|
|
2265
|
-
}, $[0] = elements, $[1] = t1, $[2] = t2
|
|
2156
|
+
}, $[0] = elements, $[1] = t1, $[2] = t2) : t2 = $[2], t0 = t2;
|
|
2266
2157
|
const value = t0;
|
|
2267
|
-
let
|
|
2268
|
-
return $[
|
|
2158
|
+
let t3;
|
|
2159
|
+
return $[3] !== children || $[4] !== value ? (t3 = /* @__PURE__ */ jsx(PortalContext.Provider, { value, children }), $[3] = children, $[4] = value, $[5] = t3) : t3 = $[5], t3;
|
|
2269
2160
|
}
|
|
2270
2161
|
function _temp2() {
|
|
2271
2162
|
return null;
|
|
@@ -2337,8 +2228,6 @@ export {
|
|
|
2337
2228
|
TabList,
|
|
2338
2229
|
Text,
|
|
2339
2230
|
TextInput,
|
|
2340
|
-
ThemeColorProvider,
|
|
2341
|
-
ThemeProvider,
|
|
2342
2231
|
Tooltip,
|
|
2343
2232
|
TooltipDelayGroupContext,
|
|
2344
2233
|
Z_OFFSETS,
|
|
@@ -2367,9 +2256,6 @@ export {
|
|
|
2367
2256
|
usePrefersDark,
|
|
2368
2257
|
usePrefersReducedMotion,
|
|
2369
2258
|
useResponsiveProp,
|
|
2370
|
-
useRootTheme,
|
|
2371
|
-
useTheme,
|
|
2372
|
-
useTheme_v2,
|
|
2373
2259
|
useTooltipDelayGroup
|
|
2374
2260
|
};
|
|
2375
2261
|
//# sourceMappingURL=_visual-editing.js.map
|