@sanity/ui 3.0.0-static.33 → 3.0.0-static.35
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 +34 -85
- package/dist/_visual-editing.d.ts +34 -85
- 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 +383 -13934
- package/dist/css/index.d.ts +383 -13934
- 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 +107 -817
- package/dist/index.d.ts +107 -817
- package/dist/index.js +243 -360
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs +367 -4288
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.d.cts +180 -1582
- package/dist/theme.d.ts +180 -1582
- 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,101 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var jsxRuntime = require("react/jsx-runtime"), compilerRuntime = require("react/compiler-runtime"),
|
|
3
|
-
function getGlobalScope() {
|
|
4
|
-
if (typeof globalThis < "u") return globalThis;
|
|
5
|
-
if (typeof window < "u") return window;
|
|
6
|
-
if (typeof self < "u") return self;
|
|
7
|
-
if (typeof global < "u") return global;
|
|
8
|
-
throw new Error("@sanity/ui: could not locate global scope");
|
|
9
|
-
}
|
|
10
|
-
const globalScope = getGlobalScope();
|
|
11
|
-
function createGlobalScopedContext(key2, defaultValue) {
|
|
12
|
-
const symbol = Symbol.for(key2);
|
|
13
|
-
if (typeof document > "u")
|
|
14
|
-
return react.createContext(defaultValue);
|
|
15
|
-
const symbolMap = globalScope;
|
|
16
|
-
return symbolMap[symbol] = symbolMap[symbol] || react.createContext(defaultValue), symbolMap[symbol];
|
|
17
|
-
}
|
|
18
|
-
const CardContext = createGlobalScopedContext("@sanity/ui/context/card", null);
|
|
19
|
-
function CardProvider(props) {
|
|
20
|
-
const $ = compilerRuntime.c(7), {
|
|
21
|
-
children,
|
|
22
|
-
tone,
|
|
23
|
-
scheme,
|
|
24
|
-
unstable_CompatProvider
|
|
25
|
-
} = props;
|
|
26
|
-
let t0, t1;
|
|
27
|
-
$[0] !== scheme || $[1] !== tone || $[2] !== unstable_CompatProvider ? (t1 = {
|
|
28
|
-
tone,
|
|
29
|
-
scheme,
|
|
30
|
-
unstable_CompatProvider
|
|
31
|
-
}, $[0] = scheme, $[1] = tone, $[2] = unstable_CompatProvider, $[3] = t1) : t1 = $[3], t0 = t1;
|
|
32
|
-
let t2;
|
|
33
|
-
return $[4] !== children || $[5] !== t0 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(CardContext.Provider, { value: t0, children }), $[4] = children, $[5] = t0, $[6] = t2) : t2 = $[6], t2;
|
|
34
|
-
}
|
|
35
|
-
const ThemeContext = createGlobalScopedContext("@sanity/ui/context/theme", null);
|
|
36
|
-
function ThemeProvider(props) {
|
|
37
|
-
const $ = compilerRuntime.c(19), parentTheme = react.useContext(ThemeContext), {
|
|
38
|
-
children
|
|
39
|
-
} = props, scheme = props.scheme ?? (parentTheme?.scheme || "light"), rootTheme = props.theme ?? (parentTheme?.theme || null), tone = props.tone ?? (parentTheme?.tone || "default");
|
|
40
|
-
let t0;
|
|
41
|
-
bb0: {
|
|
42
|
-
if (!rootTheme) {
|
|
43
|
-
t0 = null;
|
|
44
|
-
break bb0;
|
|
45
|
-
}
|
|
46
|
-
let t12;
|
|
47
|
-
$[0] !== rootTheme || $[1] !== scheme || $[2] !== tone ? (t12 = {
|
|
48
|
-
version: 0,
|
|
49
|
-
theme: rootTheme,
|
|
50
|
-
scheme,
|
|
51
|
-
tone
|
|
52
|
-
}, $[0] = rootTheme, $[1] = scheme, $[2] = tone, $[3] = t12) : t12 = $[3], t0 = t12;
|
|
53
|
-
}
|
|
54
|
-
const themeContext = t0;
|
|
55
|
-
let t1;
|
|
56
|
-
bb1: {
|
|
57
|
-
if (!rootTheme) {
|
|
58
|
-
t1 = null;
|
|
59
|
-
break bb1;
|
|
60
|
-
}
|
|
61
|
-
let t22;
|
|
62
|
-
$[4] !== rootTheme || $[5] !== scheme || $[6] !== tone ? (t22 = theme.getScopedTheme(rootTheme, scheme, tone), $[4] = rootTheme, $[5] = scheme, $[6] = tone, $[7] = t22) : t22 = $[7], t1 = t22;
|
|
63
|
-
}
|
|
64
|
-
const theme$1 = t1;
|
|
65
|
-
if (!theme$1) {
|
|
66
|
-
let t22;
|
|
67
|
-
return $[8] === Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsxRuntime.jsx("pre", { children: 'ThemeProvider: no "theme" property provided' }), $[8] = t22) : t22 = $[8], t22;
|
|
68
|
-
}
|
|
69
|
-
let t2;
|
|
70
|
-
$[9] !== children || $[10] !== theme$1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(styledComponents.ThemeProvider, { theme: theme$1, children }), $[9] = children, $[10] = theme$1, $[11] = t2) : t2 = $[11];
|
|
71
|
-
let t3;
|
|
72
|
-
$[12] !== t2 || $[13] !== themeContext ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: themeContext, children: t2 }), $[12] = t2, $[13] = themeContext, $[14] = t3) : t3 = $[14];
|
|
73
|
-
let t4;
|
|
74
|
-
return $[15] !== scheme || $[16] !== t3 || $[17] !== tone ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(CardProvider, { scheme, tone, unstable_CompatProvider: ThemeColorProvider, children: t3 }), $[15] = scheme, $[16] = t3, $[17] = tone, $[18] = t4) : t4 = $[18], t4;
|
|
75
|
-
}
|
|
76
|
-
function useRootTheme() {
|
|
77
|
-
const value = react.useContext(ThemeContext);
|
|
78
|
-
if (!value)
|
|
79
|
-
throw new Error("useRootTheme(): missing context value");
|
|
80
|
-
return value;
|
|
81
|
-
}
|
|
82
|
-
function ThemeColorProvider(props) {
|
|
83
|
-
const $ = compilerRuntime.c(5), {
|
|
84
|
-
children,
|
|
85
|
-
scheme,
|
|
86
|
-
tone
|
|
87
|
-
} = props, root = useRootTheme(), t0 = scheme || root.scheme;
|
|
88
|
-
let t1;
|
|
89
|
-
return $[0] !== children || $[1] !== root.theme || $[2] !== t0 || $[3] !== tone ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { scheme: t0, theme: root.theme, tone, children }), $[0] = children, $[1] = root.theme, $[2] = t0, $[3] = tone, $[4] = t1) : t1 = $[4], t1;
|
|
90
|
-
}
|
|
91
|
-
function useTheme() {
|
|
92
|
-
return styledComponents.useTheme();
|
|
93
|
-
}
|
|
94
|
-
function useTheme_v2() {
|
|
95
|
-
const $ = compilerRuntime.c(2), t0 = styledComponents.useTheme();
|
|
96
|
-
let t1;
|
|
97
|
-
return $[0] !== t0 ? (t1 = theme.getTheme_v2(t0), $[0] = t0, $[1] = t1) : t1 = $[1], t1;
|
|
98
|
-
}
|
|
2
|
+
var jsxRuntime = require("react/jsx-runtime"), compilerRuntime = require("react/compiler-runtime"), css = require("@sanity/ui/css"), react = require("react"), useEffectEvent = require("use-effect-event"), icons = require("@sanity/icons"), reactIs = require("react-is"), reactDom$1 = require("@floating-ui/react-dom"), framerMotion = require("framer-motion"), reactDom = require("react-dom"), dynamic = require("@vanilla-extract/dynamic");
|
|
99
3
|
const EMPTY_ARRAY = [], EMPTY_RECORD = {}, POPOVER_MOTION_PROPS = {
|
|
100
4
|
card: {
|
|
101
5
|
initial: {
|
|
@@ -174,14 +78,11 @@ function useResponsiveProp(val, defaultVal) {
|
|
|
174
78
|
}
|
|
175
79
|
const DEFAULT_BOX_ELEMENT = "div";
|
|
176
80
|
function Box(props) {
|
|
177
|
-
const $ = compilerRuntime.c(
|
|
178
|
-
let alignItems,
|
|
81
|
+
const $ = compilerRuntime.c(132), t0 = props;
|
|
82
|
+
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;
|
|
179
83
|
$[0] !== t0 ? ({
|
|
180
84
|
alignItems,
|
|
181
85
|
as: t1,
|
|
182
|
-
autoCols,
|
|
183
|
-
autoFlow,
|
|
184
|
-
autoRows,
|
|
185
86
|
border: t2,
|
|
186
87
|
borderTop,
|
|
187
88
|
borderRight,
|
|
@@ -189,10 +90,6 @@ function Box(props) {
|
|
|
189
90
|
borderLeft,
|
|
190
91
|
className,
|
|
191
92
|
children,
|
|
192
|
-
column,
|
|
193
|
-
columnStart,
|
|
194
|
-
columnEnd,
|
|
195
|
-
columns,
|
|
196
93
|
display: t3,
|
|
197
94
|
flex,
|
|
198
95
|
flexDirection,
|
|
@@ -243,33 +140,22 @@ function Box(props) {
|
|
|
243
140
|
pointerEvents,
|
|
244
141
|
position,
|
|
245
142
|
radius,
|
|
246
|
-
row,
|
|
247
|
-
rows,
|
|
248
|
-
rowStart,
|
|
249
|
-
rowEnd,
|
|
250
143
|
shadow,
|
|
251
144
|
sizing: t8,
|
|
252
145
|
textAlign,
|
|
253
146
|
width,
|
|
254
147
|
...rest
|
|
255
|
-
} = t0, $[0] = t0, $[1] = alignItems, $[2] =
|
|
148
|
+
} = 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]);
|
|
256
149
|
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;
|
|
257
150
|
let t9;
|
|
258
|
-
$[
|
|
151
|
+
$[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 = css.box({
|
|
259
152
|
className,
|
|
260
153
|
alignItems,
|
|
261
|
-
autoCols,
|
|
262
|
-
autoFlow,
|
|
263
|
-
autoRows,
|
|
264
154
|
border,
|
|
265
155
|
borderTop,
|
|
266
156
|
borderRight,
|
|
267
157
|
borderBottom,
|
|
268
158
|
borderLeft,
|
|
269
|
-
column,
|
|
270
|
-
columnStart,
|
|
271
|
-
columnEnd,
|
|
272
|
-
columns,
|
|
273
159
|
display,
|
|
274
160
|
flex,
|
|
275
161
|
flexDirection,
|
|
@@ -320,24 +206,19 @@ function Box(props) {
|
|
|
320
206
|
pointerEvents,
|
|
321
207
|
position,
|
|
322
208
|
radius,
|
|
323
|
-
row,
|
|
324
|
-
rows,
|
|
325
|
-
rowStart,
|
|
326
|
-
rowEnd,
|
|
327
209
|
shadow,
|
|
328
210
|
sizing,
|
|
329
211
|
textAlign,
|
|
330
212
|
width
|
|
331
|
-
}), $[
|
|
213
|
+
}), $[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];
|
|
332
214
|
let t10;
|
|
333
|
-
return $[
|
|
215
|
+
return $[127] !== Element || $[128] !== children || $[129] !== rest || $[130] !== t9 ? (t10 = /* @__PURE__ */ jsxRuntime.jsx(Element, { "data-ui": "Box", ...rest, className: t9, children }), $[127] = Element, $[128] = children, $[129] = rest, $[130] = t9, $[131] = t10) : t10 = $[131], t10;
|
|
334
216
|
}
|
|
335
217
|
const DEFAULT_TEXT_ELEMENT = "div";
|
|
336
218
|
function Text(props) {
|
|
337
|
-
const $ = compilerRuntime.c(
|
|
338
|
-
let
|
|
219
|
+
const $ = compilerRuntime.c(30), t0 = props;
|
|
220
|
+
let align, children, className, flex, muted, rest, t1, t2, t3, t4, textOverflowProp;
|
|
339
221
|
$[0] !== t0 ? ({
|
|
340
|
-
accent,
|
|
341
222
|
align,
|
|
342
223
|
as: t1,
|
|
343
224
|
children,
|
|
@@ -349,27 +230,26 @@ function Text(props) {
|
|
|
349
230
|
textOverflow: textOverflowProp,
|
|
350
231
|
weight: t4,
|
|
351
232
|
...rest
|
|
352
|
-
} = t0, $[0] = t0, $[1] =
|
|
233
|
+
} = 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]);
|
|
353
234
|
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;
|
|
354
235
|
let t5;
|
|
355
|
-
$[
|
|
236
|
+
$[12] !== align || $[13] !== className || $[14] !== flex || $[15] !== maxWidth || $[16] !== muted || $[17] !== size2 || $[18] !== weight ? (t5 = css.text({
|
|
356
237
|
className,
|
|
357
|
-
accent,
|
|
358
238
|
align,
|
|
359
239
|
flex,
|
|
360
240
|
maxWidth,
|
|
361
241
|
muted,
|
|
362
242
|
size: size2,
|
|
363
243
|
weight
|
|
364
|
-
}), $[
|
|
244
|
+
}), $[12] = align, $[13] = className, $[14] = flex, $[15] = maxWidth, $[16] = muted, $[17] = size2, $[18] = weight, $[19] = t5) : t5 = $[19];
|
|
365
245
|
let t6;
|
|
366
|
-
$[
|
|
246
|
+
$[20] !== textOverflowProp ? (t6 = css.textOverflow({
|
|
367
247
|
textOverflow: textOverflowProp
|
|
368
|
-
}), $[
|
|
248
|
+
}), $[20] = textOverflowProp, $[21] = t6) : t6 = $[21];
|
|
369
249
|
let t7;
|
|
370
|
-
$[
|
|
250
|
+
$[22] !== children || $[23] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t6, children }), $[22] = children, $[23] = t6, $[24] = t7) : t7 = $[24];
|
|
371
251
|
let t8;
|
|
372
|
-
return $[
|
|
252
|
+
return $[25] !== Element || $[26] !== rest || $[27] !== t5 || $[28] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(Element, { "data-ui": "Text", ...rest, className: t5, children: t7 }), $[25] = Element, $[26] = rest, $[27] = t5, $[28] = t7, $[29] = t8) : t8 = $[29], t8;
|
|
373
253
|
}
|
|
374
254
|
function AnimatedSpinnerIcon(props) {
|
|
375
255
|
const $ = compilerRuntime.c(5);
|
|
@@ -411,7 +291,7 @@ function Button(props) {
|
|
|
411
291
|
disabled,
|
|
412
292
|
flex,
|
|
413
293
|
fontSize = 1,
|
|
414
|
-
gap = props.
|
|
294
|
+
gap = props.padding ?? 3,
|
|
415
295
|
gapX,
|
|
416
296
|
gapY,
|
|
417
297
|
icon: IconComponent,
|
|
@@ -428,8 +308,6 @@ function Button(props) {
|
|
|
428
308
|
paddingRight,
|
|
429
309
|
radius = 2,
|
|
430
310
|
selected,
|
|
431
|
-
space = props.gap ?? props.space ?? props.padding ?? 3,
|
|
432
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
433
311
|
text,
|
|
434
312
|
textAlign,
|
|
435
313
|
textOverflow = "ellipsis",
|
|
@@ -525,7 +403,22 @@ const origin = {
|
|
|
525
403
|
function clamp(num, min, max) {
|
|
526
404
|
return Math.min(Math.max(num, min), max);
|
|
527
405
|
}
|
|
528
|
-
|
|
406
|
+
function getGlobalScope() {
|
|
407
|
+
if (typeof globalThis < "u") return globalThis;
|
|
408
|
+
if (typeof window < "u") return window;
|
|
409
|
+
if (typeof self < "u") return self;
|
|
410
|
+
if (typeof global < "u") return global;
|
|
411
|
+
throw new Error("@sanity/ui: could not locate global scope");
|
|
412
|
+
}
|
|
413
|
+
const globalScope = getGlobalScope();
|
|
414
|
+
function createGlobalScopedContext(key2, defaultValue) {
|
|
415
|
+
const symbol = Symbol.for(key2);
|
|
416
|
+
if (typeof document > "u")
|
|
417
|
+
return react.createContext(defaultValue);
|
|
418
|
+
const symbolMap = globalScope;
|
|
419
|
+
return symbolMap[symbol] = symbolMap[symbol] || react.createContext(defaultValue), symbolMap[symbol];
|
|
420
|
+
}
|
|
421
|
+
const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/v3/boundaryElement", null), DEFAULT_VALUE = {
|
|
529
422
|
version: 0,
|
|
530
423
|
element: null
|
|
531
424
|
};
|
|
@@ -539,13 +432,30 @@ function getElementRef(element) {
|
|
|
539
432
|
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
540
433
|
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);
|
|
541
434
|
}
|
|
435
|
+
const CardContext = createGlobalScopedContext("@sanity/ui/v3/card", null);
|
|
436
|
+
function CardProvider(props) {
|
|
437
|
+
const $ = compilerRuntime.c(7), {
|
|
438
|
+
children,
|
|
439
|
+
tone,
|
|
440
|
+
scheme,
|
|
441
|
+
unstable_CompatProvider
|
|
442
|
+
} = props;
|
|
443
|
+
let t0, t1;
|
|
444
|
+
$[0] !== scheme || $[1] !== tone || $[2] !== unstable_CompatProvider ? (t1 = {
|
|
445
|
+
tone,
|
|
446
|
+
scheme,
|
|
447
|
+
unstable_CompatProvider
|
|
448
|
+
}, $[0] = scheme, $[1] = tone, $[2] = unstable_CompatProvider, $[3] = t1) : t1 = $[3], t0 = t1;
|
|
449
|
+
let t2;
|
|
450
|
+
return $[4] !== children || $[5] !== t0 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(CardContext.Provider, { value: t0, children }), $[4] = children, $[5] = t0, $[6] = t2) : t2 = $[6], t2;
|
|
451
|
+
}
|
|
542
452
|
function useCard() {
|
|
543
453
|
const card = react.useContext(CardContext);
|
|
544
454
|
if (!card)
|
|
545
455
|
throw new Error("useCard(): missing context value");
|
|
546
456
|
return card;
|
|
547
457
|
}
|
|
548
|
-
const key = "@sanity/ui/
|
|
458
|
+
const key = "@sanity/ui/v3/portal", elementKey = Symbol.for(`${key}/element`), elementMap = globalScope;
|
|
549
459
|
elementMap[elementKey] = null;
|
|
550
460
|
const defaultContextValue = {
|
|
551
461
|
version: 0,
|
|
@@ -583,7 +493,7 @@ function getLayerContext(contextValue) {
|
|
|
583
493
|
return contextValue;
|
|
584
494
|
throw new Error("could not get layer context");
|
|
585
495
|
}
|
|
586
|
-
const LayerContext = createGlobalScopedContext("@sanity/ui/
|
|
496
|
+
const LayerContext = createGlobalScopedContext("@sanity/ui/v3/layer", null);
|
|
587
497
|
function useLayer() {
|
|
588
498
|
const $ = compilerRuntime.c(2), value = react.useContext(LayerContext);
|
|
589
499
|
if (!value)
|
|
@@ -861,8 +771,10 @@ function _getMediaQuery(media2, index) {
|
|
|
861
771
|
}
|
|
862
772
|
function _createMediaStore() {
|
|
863
773
|
const mediaLen = media.length;
|
|
864
|
-
let sizes;
|
|
774
|
+
let sizes = [];
|
|
865
775
|
const getSizes = () => {
|
|
776
|
+
if (typeof window > "u")
|
|
777
|
+
return sizes;
|
|
866
778
|
if (!sizes) {
|
|
867
779
|
sizes = [];
|
|
868
780
|
for (let index = mediaLen; index > -1; index -= 1) {
|
|
@@ -1072,8 +984,6 @@ function Popover(props) {
|
|
|
1072
984
|
animate: _animate = !1,
|
|
1073
985
|
arrow: arrowProp = !1,
|
|
1074
986
|
as = DEFAULT_POPOVER_ELEMENT,
|
|
1075
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1076
|
-
boundaryElement = boundaryElementContext.element,
|
|
1077
987
|
children: childProp,
|
|
1078
988
|
className,
|
|
1079
989
|
constrainSize = !1,
|
|
@@ -1081,7 +991,7 @@ function Popover(props) {
|
|
|
1081
991
|
disabled,
|
|
1082
992
|
fallbackPlacements = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"],
|
|
1083
993
|
matchReferenceWidth,
|
|
1084
|
-
floatingBoundary =
|
|
994
|
+
floatingBoundary = boundaryElementContext.element,
|
|
1085
995
|
modal,
|
|
1086
996
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1087
997
|
onActivate,
|
|
@@ -1094,7 +1004,7 @@ function Popover(props) {
|
|
|
1094
1004
|
preventOverflow = !0,
|
|
1095
1005
|
radius = 3,
|
|
1096
1006
|
ref: forwardedRef,
|
|
1097
|
-
referenceBoundary =
|
|
1007
|
+
referenceBoundary = boundaryElementContext.element,
|
|
1098
1008
|
referenceElement,
|
|
1099
1009
|
scheme,
|
|
1100
1010
|
shadow = 3,
|
|
@@ -1206,23 +1116,21 @@ function Selectable(props) {
|
|
|
1206
1116
|
}
|
|
1207
1117
|
const DEFAULT_STACK_ELEMENT = "div";
|
|
1208
1118
|
function Stack(props) {
|
|
1209
|
-
const $ = compilerRuntime.c(
|
|
1210
|
-
let className, gap, rest,
|
|
1119
|
+
const $ = compilerRuntime.c(12), t0 = props;
|
|
1120
|
+
let className, gap, rest, t1;
|
|
1211
1121
|
$[0] !== t0 ? ({
|
|
1212
1122
|
as: t1,
|
|
1213
1123
|
className,
|
|
1214
1124
|
gap,
|
|
1215
|
-
space,
|
|
1216
1125
|
...rest
|
|
1217
|
-
} = t0, $[0] = t0, $[1] = className, $[2] = gap, $[3] = rest, $[4] =
|
|
1126
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = gap, $[3] = rest, $[4] = t1) : (className = $[1], gap = $[2], rest = $[3], t1 = $[4]);
|
|
1218
1127
|
const as = t1 === void 0 ? DEFAULT_STACK_ELEMENT : t1;
|
|
1219
1128
|
let t2;
|
|
1220
|
-
$[
|
|
1129
|
+
$[5] !== className ? (t2 = css.stack({
|
|
1221
1130
|
className
|
|
1222
|
-
}), $[
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
return $[8] !== as || $[9] !== rest || $[10] !== t2 || $[11] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.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;
|
|
1131
|
+
}), $[5] = className, $[6] = t2) : t2 = $[6];
|
|
1132
|
+
let t3;
|
|
1133
|
+
return $[7] !== as || $[8] !== gap || $[9] !== rest || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.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;
|
|
1226
1134
|
}
|
|
1227
1135
|
function useCustomValidity(ref, customValidity) {
|
|
1228
1136
|
const $ = compilerRuntime.c(6);
|
|
@@ -1235,8 +1143,8 @@ function useCustomValidity(ref, customValidity) {
|
|
|
1235
1143
|
}
|
|
1236
1144
|
const DEFAULT_TEXT_INPUT_ELEMENT = "input";
|
|
1237
1145
|
function TextInput(props) {
|
|
1238
|
-
const $ = compilerRuntime.c(
|
|
1239
|
-
let IconComponent, IconRightComponent, __unstable_disableFocusRing, className, clearButton, customValidity, forwardedRef,
|
|
1146
|
+
const $ = compilerRuntime.c(88), t0 = props;
|
|
1147
|
+
let IconComponent, IconRightComponent, __unstable_disableFocusRing, className, clearButton, customValidity, forwardedRef, onClear, prefix, readOnly, rest, suffix, t1, t2, t3, t4, t5, t6, t7, t8, width;
|
|
1240
1148
|
if ($[0] !== t0) {
|
|
1241
1149
|
const {
|
|
1242
1150
|
__unstable_disableFocusRing: t92,
|
|
@@ -1255,90 +1163,89 @@ function TextInput(props) {
|
|
|
1255
1163
|
radius: t222,
|
|
1256
1164
|
readOnly: t232,
|
|
1257
1165
|
ref: t242,
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
type: t282,
|
|
1166
|
+
suffix: t252,
|
|
1167
|
+
customValidity: t262,
|
|
1168
|
+
type: t272,
|
|
1262
1169
|
weight: _width,
|
|
1263
|
-
width:
|
|
1264
|
-
...
|
|
1170
|
+
width: t282,
|
|
1171
|
+
...t292
|
|
1265
1172
|
} = t0;
|
|
1266
|
-
__unstable_disableFocusRing = t92, t1 = t102, t2 = t112, className = t122, clearButton = t132, t3 = t142, t4 = t152,
|
|
1173
|
+
__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;
|
|
1267
1174
|
} else
|
|
1268
|
-
IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], className = $[4], clearButton = $[5], customValidity = $[6], forwardedRef = $[7],
|
|
1269
|
-
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,
|
|
1175
|
+
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];
|
|
1176
|
+
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 = react.useRef(null), responsivePadding = useResponsiveProp(padding), withClearButton = !!clearButton;
|
|
1270
1177
|
let t9;
|
|
1271
|
-
$[
|
|
1178
|
+
$[22] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => ref.current, $[22] = t9) : t9 = $[22], react.useImperativeHandle(forwardedRef, t9), useCustomValidity(ref, customValidity);
|
|
1272
1179
|
const handleClearMouseDown = _temp$3;
|
|
1273
1180
|
let t10;
|
|
1274
|
-
$[
|
|
1181
|
+
$[23] !== onClear ? (t10 = (event_0) => {
|
|
1275
1182
|
event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
|
|
1276
|
-
}, $[
|
|
1183
|
+
}, $[23] = onClear, $[24] = t10) : t10 = $[24];
|
|
1277
1184
|
const handleClearClick = t10;
|
|
1278
1185
|
let t11, t12;
|
|
1279
|
-
$[
|
|
1186
|
+
$[25] !== responsivePadding ? (t12 = Object.fromEntries(Object.entries(responsivePadding).map(_temp2$1)), $[25] = responsivePadding, $[26] = t12) : t12 = $[26], t11 = t12;
|
|
1280
1187
|
const clearButtonBoxPadding = t11;
|
|
1281
1188
|
let t13, t14;
|
|
1282
|
-
$[
|
|
1189
|
+
$[27] !== responsivePadding ? (t14 = Object.fromEntries(Object.entries(responsivePadding).map(_temp3)), $[27] = responsivePadding, $[28] = t14) : t14 = $[28], t13 = t14;
|
|
1283
1190
|
const clearButtonPadding = t13;
|
|
1284
1191
|
let t15;
|
|
1285
1192
|
t15 = isRecord(clearButton) ? clearButton : EMPTY_RECORD;
|
|
1286
|
-
const clearButtonProps = t15
|
|
1287
|
-
let
|
|
1288
|
-
$[
|
|
1193
|
+
const clearButtonProps = t15;
|
|
1194
|
+
let t16;
|
|
1195
|
+
$[29] !== border || $[30] !== className || $[31] !== fontSize || $[32] !== gap || $[33] !== padding || $[34] !== radius || $[35] !== width ? (t16 = css.textInput({
|
|
1289
1196
|
className,
|
|
1290
1197
|
border,
|
|
1291
1198
|
fontSize,
|
|
1292
1199
|
padding,
|
|
1293
1200
|
radius,
|
|
1294
|
-
gap
|
|
1201
|
+
gap,
|
|
1295
1202
|
width
|
|
1296
|
-
}), $[
|
|
1297
|
-
const
|
|
1203
|
+
}), $[29] = border, $[30] = className, $[31] = fontSize, $[32] = gap, $[33] = padding, $[34] = radius, $[35] = width, $[36] = t16) : t16 = $[36];
|
|
1204
|
+
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;
|
|
1205
|
+
let t23;
|
|
1206
|
+
$[37] !== prefix ? (t23 = prefix && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: css.textInputPrefix(), sizing: "border", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: prefix }) }), $[37] = prefix, $[38] = t23) : t23 = $[38];
|
|
1298
1207
|
let t24;
|
|
1299
|
-
$[
|
|
1208
|
+
$[39] === Symbol.for("react.memo_cache_sentinel") ? (t24 = css.textInputElement(), $[39] = t24) : t24 = $[39];
|
|
1300
1209
|
let t25;
|
|
1301
|
-
$[40] === Symbol.for("react.memo_cache_sentinel") ? (t25 = css.
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1210
|
+
$[40] === Symbol.for("react.memo_cache_sentinel") ? (t25 = css._inputElement(), $[40] = t25) : t25 = $[40];
|
|
1211
|
+
const t26 = __unstable_disableFocusRing ? "" : void 0;
|
|
1212
|
+
let t27;
|
|
1213
|
+
$[41] !== Element || $[42] !== disabled || $[43] !== readOnly || $[44] !== rest || $[45] !== t26 || $[46] !== type ? (t27 = /* @__PURE__ */ jsxRuntime.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];
|
|
1305
1214
|
let t28;
|
|
1306
|
-
$[
|
|
1215
|
+
$[48] === Symbol.for("react.memo_cache_sentinel") ? (t28 = css._inputPresentation(), $[48] = t28) : t28 = $[48];
|
|
1307
1216
|
let t29;
|
|
1308
|
-
$[49]
|
|
1309
|
-
let t30;
|
|
1310
|
-
$[50] !== IconComponent || $[51] !== fontSize || $[52] !== padding ? (t30 = IconComponent && /* @__PURE__ */ jsxRuntime.jsx(Box, { padding, position: "absolute", insetTop: 0, insetLeft: 0, children: /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize, children: [
|
|
1217
|
+
$[49] !== IconComponent || $[50] !== fontSize || $[51] !== padding ? (t29 = IconComponent && /* @__PURE__ */ jsxRuntime.jsx(Box, { padding, position: "absolute", insetTop: 0, insetLeft: 0, children: /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize, children: [
|
|
1311
1218
|
react.isValidElement(IconComponent) && IconComponent,
|
|
1312
1219
|
reactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
|
|
1313
|
-
] }) }), $[
|
|
1314
|
-
let
|
|
1315
|
-
$[
|
|
1220
|
+
] }) }), $[49] = IconComponent, $[50] = fontSize, $[51] = padding, $[52] = t29) : t29 = $[52];
|
|
1221
|
+
let t30;
|
|
1222
|
+
$[53] !== IconRightComponent || $[54] !== fontSize || $[55] !== padding || $[56] !== withClearButton ? (t30 = !withClearButton && IconRightComponent && /* @__PURE__ */ jsxRuntime.jsx(Box, { padding, position: "absolute", insetTop: 0, insetRight: 0, children: /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize, children: [
|
|
1316
1223
|
react.isValidElement(IconRightComponent) && IconRightComponent,
|
|
1317
1224
|
reactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
|
|
1318
|
-
] }) }), $[
|
|
1225
|
+
] }) }), $[53] = IconRightComponent, $[54] = fontSize, $[55] = padding, $[56] = withClearButton, $[57] = t30) : t30 = $[57];
|
|
1226
|
+
let t31;
|
|
1227
|
+
$[58] !== t29 || $[59] !== t30 ? (t31 = /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: t28, position: "absolute", children: [
|
|
1228
|
+
t29,
|
|
1229
|
+
t30
|
|
1230
|
+
] }), $[58] = t29, $[59] = t30, $[60] = t31) : t31 = $[60];
|
|
1319
1231
|
let t32;
|
|
1320
|
-
$[
|
|
1321
|
-
t30,
|
|
1322
|
-
t31
|
|
1323
|
-
] }), $[59] = t30, $[60] = t31, $[61] = t32) : t32 = $[61];
|
|
1324
|
-
let t33;
|
|
1325
|
-
$[62] !== clearButton || $[63] !== clearButtonBoxPadding || $[64] !== clearButtonPadding || $[65] !== clearButtonProps || $[66] !== disabled || $[67] !== fontSize || $[68] !== handleClearClick || $[69] !== radius || $[70] !== readOnly ? (t33 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsxRuntime.jsx(Box, { insetTop: 0, insetRight: 0, padding: clearButtonBoxPadding, position: "absolute", style: {
|
|
1232
|
+
$[61] !== clearButton || $[62] !== clearButtonBoxPadding || $[63] !== clearButtonPadding || $[64] !== clearButtonProps || $[65] !== disabled || $[66] !== fontSize || $[67] !== handleClearClick || $[68] !== radius || $[69] !== readOnly ? (t32 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsxRuntime.jsx(Box, { insetTop: 0, insetRight: 0, padding: clearButtonBoxPadding, position: "absolute", style: {
|
|
1326
1233
|
zIndex: 2
|
|
1327
|
-
}, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { "aria-label": "Clear", "data-qa": "clear-button", display: "block", fontSize, icon: icons.CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }) }), $[
|
|
1234
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { "aria-label": "Clear", "data-qa": "clear-button", display: "block", fontSize, icon: icons.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];
|
|
1235
|
+
let t33;
|
|
1236
|
+
$[71] !== t27 || $[72] !== t31 || $[73] !== t32 ? (t33 = /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: t24, flex: 1, position: "relative", children: [
|
|
1237
|
+
t27,
|
|
1238
|
+
t31,
|
|
1239
|
+
t32
|
|
1240
|
+
] }), $[71] = t27, $[72] = t31, $[73] = t32, $[74] = t33) : t33 = $[74];
|
|
1328
1241
|
let t34;
|
|
1329
|
-
$[
|
|
1330
|
-
t28,
|
|
1331
|
-
t32,
|
|
1332
|
-
t33
|
|
1333
|
-
] }), $[72] = t28, $[73] = t32, $[74] = t33, $[75] = t34) : t34 = $[75];
|
|
1242
|
+
$[75] !== suffix ? (t34 = suffix && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: css.textInputSuffix(), sizing: "border", children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: suffix }) }), $[75] = suffix, $[76] = t34) : t34 = $[76];
|
|
1334
1243
|
let t35;
|
|
1335
|
-
$[
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
t35
|
|
1341
|
-
] }), $[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;
|
|
1244
|
+
return $[77] !== t16 || $[78] !== t17 || $[79] !== t18 || $[80] !== t19 || $[81] !== t20 || $[82] !== t21 || $[83] !== t22 || $[84] !== t23 || $[85] !== t33 || $[86] !== t34 ? (t35 = /* @__PURE__ */ jsxRuntime.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: [
|
|
1245
|
+
t23,
|
|
1246
|
+
t33,
|
|
1247
|
+
t34
|
|
1248
|
+
] }), $[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;
|
|
1342
1249
|
}
|
|
1343
1250
|
function _temp3(t0) {
|
|
1344
1251
|
const [key_0, value_0] = t0;
|
|
@@ -1425,34 +1332,32 @@ function KBD(props) {
|
|
|
1425
1332
|
}
|
|
1426
1333
|
const DEFAULT_HOTKEYS_ELEMENT = "kbd";
|
|
1427
1334
|
function Hotkeys(props) {
|
|
1428
|
-
const $ = compilerRuntime.c(
|
|
1429
|
-
let fontSize,
|
|
1335
|
+
const $ = compilerRuntime.c(26), t0 = props;
|
|
1336
|
+
let fontSize, gapX, gapY, keys, padding, radius, rest, t1, t2;
|
|
1430
1337
|
$[0] !== t0 ? ({
|
|
1431
1338
|
as: t1,
|
|
1432
1339
|
fontSize,
|
|
1433
|
-
gap,
|
|
1340
|
+
gap: t2,
|
|
1434
1341
|
gapX,
|
|
1435
1342
|
gapY,
|
|
1436
1343
|
keys,
|
|
1437
1344
|
padding,
|
|
1438
1345
|
radius,
|
|
1439
|
-
space: t2,
|
|
1440
1346
|
...rest
|
|
1441
|
-
} = t0, $[0] = t0, $[1] = fontSize, $[2] =
|
|
1442
|
-
const as = t1 === void 0 ? DEFAULT_HOTKEYS_ELEMENT : t1,
|
|
1347
|
+
} = 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]);
|
|
1348
|
+
const as = t1 === void 0 ? DEFAULT_HOTKEYS_ELEMENT : t1, gap = t2 === void 0 ? 1 : t2;
|
|
1443
1349
|
if (!keys || keys.length === 0)
|
|
1444
1350
|
return;
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
$[16] !== fontSize || $[17] !== padding || $[18] !== radius ? (t52 = (key2, i) => /* @__PURE__ */ jsxRuntime.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;
|
|
1351
|
+
let t3;
|
|
1352
|
+
if ($[10] !== fontSize || $[11] !== keys || $[12] !== padding || $[13] !== radius) {
|
|
1353
|
+
let t42;
|
|
1354
|
+
$[15] !== fontSize || $[16] !== padding || $[17] !== radius ? (t42 = (key2, i) => /* @__PURE__ */ jsxRuntime.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;
|
|
1450
1355
|
} else
|
|
1451
|
-
|
|
1452
|
-
let
|
|
1453
|
-
return $[
|
|
1356
|
+
t3 = $[14];
|
|
1357
|
+
let t4;
|
|
1358
|
+
return $[19] !== as || $[20] !== gap || $[21] !== gapX || $[22] !== gapY || $[23] !== rest || $[24] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.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;
|
|
1454
1359
|
}
|
|
1455
|
-
const MenuContext = createGlobalScopedContext("@sanity/ui/
|
|
1360
|
+
const MenuContext = createGlobalScopedContext("@sanity/ui/v3/menu", null);
|
|
1456
1361
|
function _isFocusable(element) {
|
|
1457
1362
|
return isHTMLAnchorElement(element) && element.getAttribute("data-disabled") !== "true" || isHTMLButtonElement(element) && !element.disabled;
|
|
1458
1363
|
}
|
|
@@ -1592,45 +1497,38 @@ function useMenuController(props) {
|
|
|
1592
1497
|
}
|
|
1593
1498
|
const DEFAULT_MENU_ELEMENT = "div";
|
|
1594
1499
|
function Menu(props) {
|
|
1595
|
-
const $ = compilerRuntime.c(
|
|
1596
|
-
let _shouldFocus, children, className, forwardedRef,
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
space: t18,
|
|
1616
|
-
...t19
|
|
1617
|
-
} = t0;
|
|
1618
|
-
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;
|
|
1619
|
-
} else
|
|
1620
|
-
_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];
|
|
1621
|
-
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 = react.useRef(null);
|
|
1500
|
+
const $ = compilerRuntime.c(57), t0 = props;
|
|
1501
|
+
let _shouldFocus, children, className, forwardedRef, onClickOutside, onEscape, onItemClick, onItemSelect, onKeyDown, originElement, registerElement, rest, t1, t2, t3;
|
|
1502
|
+
$[0] !== t0 ? ({
|
|
1503
|
+
as: t1,
|
|
1504
|
+
children,
|
|
1505
|
+
className,
|
|
1506
|
+
gap: t2,
|
|
1507
|
+
onClickOutside,
|
|
1508
|
+
onEscape,
|
|
1509
|
+
onItemClick,
|
|
1510
|
+
onItemSelect,
|
|
1511
|
+
onKeyDown,
|
|
1512
|
+
originElement,
|
|
1513
|
+
padding: t3,
|
|
1514
|
+
ref: forwardedRef,
|
|
1515
|
+
registerElement,
|
|
1516
|
+
shouldFocus: _shouldFocus,
|
|
1517
|
+
...rest
|
|
1518
|
+
} = 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]);
|
|
1519
|
+
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 = react.useRef(null);
|
|
1622
1520
|
let t4;
|
|
1623
|
-
$[
|
|
1521
|
+
$[16] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[16] = t4) : t4 = $[16], react.useImperativeHandle(forwardedRef, t4);
|
|
1624
1522
|
const {
|
|
1625
1523
|
isTopLayer
|
|
1626
1524
|
} = useLayer();
|
|
1627
1525
|
let t5;
|
|
1628
|
-
$[
|
|
1526
|
+
$[17] !== onKeyDown || $[18] !== originElement || $[19] !== shouldFocus ? (t5 = {
|
|
1629
1527
|
onKeyDown,
|
|
1630
1528
|
originElement,
|
|
1631
1529
|
shouldFocus,
|
|
1632
1530
|
rootElementRef: ref
|
|
1633
|
-
}, $[
|
|
1531
|
+
}, $[17] = onKeyDown, $[18] = originElement, $[19] = shouldFocus, $[20] = t5) : t5 = $[20];
|
|
1634
1532
|
const {
|
|
1635
1533
|
activeElement,
|
|
1636
1534
|
activeIndex,
|
|
@@ -1640,22 +1538,22 @@ function Menu(props) {
|
|
|
1640
1538
|
mount
|
|
1641
1539
|
} = useMenuController(t5), unregisterElementRef = react.useRef(null);
|
|
1642
1540
|
let t6;
|
|
1643
|
-
$[
|
|
1541
|
+
$[21] !== registerElement ? (t6 = (el) => {
|
|
1644
1542
|
unregisterElementRef.current && (unregisterElementRef.current(), unregisterElementRef.current = null), ref.current = el, ref.current && registerElement && (unregisterElementRef.current = registerElement(ref.current));
|
|
1645
|
-
}, $[
|
|
1543
|
+
}, $[21] = registerElement, $[22] = t6) : t6 = $[22];
|
|
1646
1544
|
const handleRefChange = t6;
|
|
1647
1545
|
let t7, t8;
|
|
1648
|
-
$[
|
|
1546
|
+
$[23] !== activeIndex || $[24] !== onItemSelect ? (t7 = () => {
|
|
1649
1547
|
onItemSelect && onItemSelect(activeIndex);
|
|
1650
|
-
}, t8 = [activeIndex, onItemSelect], $[
|
|
1548
|
+
}, t8 = [activeIndex, onItemSelect], $[23] = activeIndex, $[24] = onItemSelect, $[25] = t7, $[26] = t8) : (t7 = $[25], t8 = $[26]), react.useEffect(t7, t8);
|
|
1651
1549
|
let t9;
|
|
1652
|
-
$[
|
|
1550
|
+
$[27] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => [ref.current], $[27] = t9) : t9 = $[27], useClickOutsideEvent(isTopLayer && onClickOutside, t9);
|
|
1653
1551
|
let t10;
|
|
1654
|
-
$[
|
|
1552
|
+
$[28] !== isTopLayer || $[29] !== onEscape ? (t10 = (event) => {
|
|
1655
1553
|
isTopLayer && event.key === "Escape" && (event.stopPropagation(), onEscape && onEscape());
|
|
1656
|
-
}, $[
|
|
1554
|
+
}, $[28] = isTopLayer, $[29] = onEscape, $[30] = t10) : t10 = $[30], useGlobalKeyDown(t10);
|
|
1657
1555
|
let t11, t12;
|
|
1658
|
-
$[
|
|
1556
|
+
$[31] !== activeElement || $[32] !== activeIndex || $[33] !== handleItemMouseEnter || $[34] !== handleItemMouseLeave || $[35] !== mount || $[36] !== onClickOutside || $[37] !== onEscape || $[38] !== onItemClick || $[39] !== registerElement ? (t12 = {
|
|
1659
1557
|
version: 0,
|
|
1660
1558
|
activeElement,
|
|
1661
1559
|
activeIndex,
|
|
@@ -1668,19 +1566,18 @@ function Menu(props) {
|
|
|
1668
1566
|
registerElement,
|
|
1669
1567
|
onMouseEnter: handleItemMouseEnter,
|
|
1670
1568
|
onMouseLeave: handleItemMouseLeave
|
|
1671
|
-
}, $[
|
|
1569
|
+
}, $[31] = activeElement, $[32] = activeIndex, $[33] = handleItemMouseEnter, $[34] = handleItemMouseLeave, $[35] = mount, $[36] = onClickOutside, $[37] = onEscape, $[38] = onItemClick, $[39] = registerElement, $[40] = t12) : t12 = $[40], t11 = t12;
|
|
1672
1570
|
const value = t11;
|
|
1673
1571
|
let t13;
|
|
1674
|
-
$[
|
|
1572
|
+
$[41] !== className ? (t13 = css.menu({
|
|
1675
1573
|
className
|
|
1676
|
-
}), $[
|
|
1677
|
-
|
|
1574
|
+
}), $[41] = className, $[42] = t13) : t13 = $[42];
|
|
1575
|
+
let t14;
|
|
1576
|
+
$[43] !== children || $[44] !== gap ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(Stack, { gap, children }), $[43] = children, $[44] = gap, $[45] = t14) : t14 = $[45];
|
|
1678
1577
|
let t15;
|
|
1679
|
-
$[
|
|
1578
|
+
$[46] !== as || $[47] !== handleKeyDown || $[48] !== handleRefChange || $[49] !== padding || $[50] !== rest || $[51] !== t13 || $[52] !== t14 ? (t15 = /* @__PURE__ */ jsxRuntime.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];
|
|
1680
1579
|
let t16;
|
|
1681
|
-
|
|
1682
|
-
let t17;
|
|
1683
|
-
return $[55] !== t16 || $[56] !== value ? (t17 = /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value, children: t16 }), $[55] = t16, $[56] = value, $[57] = t17) : t17 = $[57], t17;
|
|
1580
|
+
return $[54] !== t15 || $[55] !== value ? (t16 = /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value, children: t15 }), $[54] = t15, $[55] = value, $[56] = t16) : t16 = $[56], t16;
|
|
1684
1581
|
}
|
|
1685
1582
|
const DEFAULT_MENU_DIVIDER_ELEMENT = "hr";
|
|
1686
1583
|
function MenuDivider(props) {
|
|
@@ -1709,126 +1606,125 @@ function useMenu() {
|
|
|
1709
1606
|
}
|
|
1710
1607
|
const DEFAULT_MENU_GROUP_ELEMENT = "button";
|
|
1711
1608
|
function MenuGroup(props) {
|
|
1712
|
-
const $ = compilerRuntime.c(
|
|
1713
|
-
let IconComponent, children,
|
|
1609
|
+
const $ = compilerRuntime.c(77), t0 = props;
|
|
1610
|
+
let IconComponent, children, menuProps, onClick, popover, rest, t1, t2, t3, t4, t5, t6, text;
|
|
1714
1611
|
$[0] !== t0 ? ({
|
|
1715
1612
|
as: t1,
|
|
1716
1613
|
children,
|
|
1717
1614
|
fontSize: t2,
|
|
1718
|
-
gap,
|
|
1615
|
+
gap: t3,
|
|
1719
1616
|
icon: IconComponent,
|
|
1720
1617
|
menu: menuProps,
|
|
1721
1618
|
onClick,
|
|
1722
|
-
padding:
|
|
1619
|
+
padding: t4,
|
|
1723
1620
|
popover,
|
|
1724
|
-
radius:
|
|
1725
|
-
space: t5,
|
|
1621
|
+
radius: t5,
|
|
1726
1622
|
text,
|
|
1727
1623
|
tone: t6,
|
|
1728
1624
|
...rest
|
|
1729
|
-
} = t0, $[0] = t0, $[1] = IconComponent, $[2] = children, $[3] =
|
|
1730
|
-
const as = t1 === void 0 ? DEFAULT_MENU_GROUP_ELEMENT : t1, fontSize = t2 === void 0 ? 1 : t2,
|
|
1625
|
+
} = t0, $[0] = t0, $[1] = IconComponent, $[2] = children, $[3] = menuProps, $[4] = onClick, $[5] = popover, $[6] = rest, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = t4, $[11] = t5, $[12] = t6, $[13] = text) : (IconComponent = $[1], children = $[2], menuProps = $[3], onClick = $[4], popover = $[5], rest = $[6], t1 = $[7], t2 = $[8], t3 = $[9], t4 = $[10], t5 = $[11], t6 = $[12], text = $[13]);
|
|
1626
|
+
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, {
|
|
1731
1627
|
activeElement,
|
|
1732
1628
|
mount,
|
|
1733
1629
|
onClickOutside,
|
|
1734
1630
|
onEscape,
|
|
1735
1631
|
onItemClick,
|
|
1736
|
-
onItemMouseEnter
|
|
1632
|
+
onItemMouseEnter,
|
|
1737
1633
|
registerElement
|
|
1738
|
-
} =
|
|
1634
|
+
} = useMenu(), [rootElement, setRootElement] = react.useState(null), [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = react.useState(!1);
|
|
1739
1635
|
let t7;
|
|
1740
|
-
$[
|
|
1741
|
-
setWithinMenu(!1), onItemMouseEnter(event), setOpen(!0);
|
|
1742
|
-
}, $[
|
|
1636
|
+
$[14] !== onItemMouseEnter ? (t7 = (event) => {
|
|
1637
|
+
setWithinMenu(!1), onItemMouseEnter?.(event), setOpen(!0);
|
|
1638
|
+
}, $[14] = onItemMouseEnter, $[15] = t7) : t7 = $[15];
|
|
1743
1639
|
const handleMouseEnter = t7;
|
|
1744
1640
|
let t8;
|
|
1745
|
-
$[
|
|
1641
|
+
$[16] !== rootElement ? (t8 = (event_0) => {
|
|
1746
1642
|
event_0.key === "ArrowLeft" && (event_0.stopPropagation(), setOpen(!1), requestAnimationFrame(() => {
|
|
1747
1643
|
rootElement?.focus();
|
|
1748
1644
|
}));
|
|
1749
|
-
}, $[
|
|
1645
|
+
}, $[16] = rootElement, $[17] = t8) : t8 = $[17];
|
|
1750
1646
|
const handleMenuKeyDown = t8;
|
|
1751
1647
|
let t9;
|
|
1752
|
-
$[
|
|
1648
|
+
$[18] !== onClick ? (t9 = (event_1) => {
|
|
1753
1649
|
onClick?.(event_1), setShouldFocus("first"), setOpen(!0);
|
|
1754
|
-
}, $[
|
|
1650
|
+
}, $[18] = onClick, $[19] = t9) : t9 = $[19];
|
|
1755
1651
|
const handleClick = t9;
|
|
1756
1652
|
let t10;
|
|
1757
|
-
$[
|
|
1653
|
+
$[20] !== onItemClick ? (t10 = () => {
|
|
1758
1654
|
setOpen(!1), onItemClick?.();
|
|
1759
|
-
}, $[
|
|
1655
|
+
}, $[20] = onItemClick, $[21] = t10) : t10 = $[21];
|
|
1760
1656
|
const handleChildItemClick = t10;
|
|
1761
1657
|
let t11;
|
|
1762
|
-
$[
|
|
1658
|
+
$[22] === Symbol.for("react.memo_cache_sentinel") ? (t11 = () => setWithinMenu(!0), $[22] = t11) : t11 = $[22];
|
|
1763
1659
|
const handleMenuMouseEnter = t11;
|
|
1764
1660
|
let t12, t13;
|
|
1765
|
-
$[
|
|
1661
|
+
$[23] !== mount || $[24] !== rootElement ? (t12 = () => mount(rootElement), t13 = [mount, rootElement], $[23] = mount, $[24] = rootElement, $[25] = t12, $[26] = t13) : (t12 = $[25], t13 = $[26]), react.useEffect(t12, t13);
|
|
1766
1662
|
let t14, t15;
|
|
1767
|
-
$[
|
|
1663
|
+
$[27] !== active ? (t14 = () => {
|
|
1768
1664
|
active || setOpen(!1);
|
|
1769
|
-
}, t15 = [active], $[
|
|
1665
|
+
}, t15 = [active], $[27] = active, $[28] = t14, $[29] = t15) : (t14 = $[28], t15 = $[29]), react.useEffect(t14, t15);
|
|
1770
1666
|
let t16, t17;
|
|
1771
|
-
$[
|
|
1667
|
+
$[30] !== open ? (t16 = () => {
|
|
1772
1668
|
open || setWithinMenu(!1);
|
|
1773
|
-
}, t17 = [open], $[
|
|
1669
|
+
}, t17 = [open], $[30] = open, $[31] = t16, $[32] = t17) : (t16 = $[31], t17 = $[32]), react.useEffect(t16, t17);
|
|
1774
1670
|
let t18, t19;
|
|
1775
|
-
$[
|
|
1671
|
+
$[33] !== shouldFocus ? (t18 = () => {
|
|
1776
1672
|
if (!shouldFocus)
|
|
1777
1673
|
return;
|
|
1778
1674
|
const rafId = requestAnimationFrame(() => setShouldFocus(null));
|
|
1779
1675
|
return () => cancelAnimationFrame(rafId);
|
|
1780
|
-
}, t19 = [shouldFocus], $[
|
|
1676
|
+
}, t19 = [shouldFocus], $[33] = shouldFocus, $[34] = t18, $[35] = t19) : (t18 = $[34], t19 = $[35]), react.useEffect(t18, t19);
|
|
1781
1677
|
let t20;
|
|
1782
|
-
$[
|
|
1678
|
+
$[36] !== children || $[37] !== handleChildItemClick || $[38] !== handleMenuKeyDown || $[39] !== menuProps || $[40] !== onClickOutside || $[41] !== onEscape || $[42] !== registerElement || $[43] !== shouldFocus ? (t20 = /* @__PURE__ */ jsxRuntime.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];
|
|
1783
1679
|
const childMenu = t20;
|
|
1784
1680
|
let t21;
|
|
1785
|
-
$[
|
|
1681
|
+
$[45] === Symbol.for("react.memo_cache_sentinel") ? (t21 = (event_2) => {
|
|
1786
1682
|
const target = event_2.currentTarget;
|
|
1787
1683
|
if (document.activeElement === target && event_2.key === "ArrowRight") {
|
|
1788
1684
|
setShouldFocus("first"), setOpen(!0), setWithinMenu(!0);
|
|
1789
1685
|
return;
|
|
1790
1686
|
}
|
|
1791
|
-
}, $[
|
|
1792
|
-
const handleKeyDown = t21, t22 = as === "button" ? withinMenu : void 0, t23 = as === "button" ? "button" : void 0
|
|
1793
|
-
let
|
|
1794
|
-
$[
|
|
1687
|
+
}, $[45] = t21) : t21 = $[45];
|
|
1688
|
+
const handleKeyDown = t21, t22 = as === "button" ? withinMenu : void 0, t23 = as === "button" ? "button" : void 0;
|
|
1689
|
+
let t24;
|
|
1690
|
+
$[46] !== IconComponent || $[47] !== fontSize ? (t24 = IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize, children: [
|
|
1795
1691
|
react.isValidElement(IconComponent) && IconComponent,
|
|
1796
1692
|
reactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
|
|
1797
|
-
] }), $[
|
|
1693
|
+
] }), $[46] = IconComponent, $[47] = fontSize, $[48] = t24) : t24 = $[48];
|
|
1694
|
+
let t25;
|
|
1695
|
+
$[49] !== fontSize || $[50] !== text ? (t25 = /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize, textOverflow: "ellipsis", weight: "medium", children: text }) }), $[49] = fontSize, $[50] = text, $[51] = t25) : t25 = $[51];
|
|
1798
1696
|
let t26;
|
|
1799
|
-
$[
|
|
1697
|
+
$[52] === Symbol.for("react.memo_cache_sentinel") ? (t26 = /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronRightIcon, {}), $[52] = t26) : t26 = $[52];
|
|
1800
1698
|
let t27;
|
|
1801
|
-
$[53]
|
|
1699
|
+
$[53] !== fontSize ? (t27 = /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize, children: t26 }), $[53] = fontSize, $[54] = t27) : t27 = $[54];
|
|
1802
1700
|
let t28;
|
|
1803
|
-
$[
|
|
1804
|
-
|
|
1805
|
-
$[56] !== padding || $[57] !== t24 || $[58] !== t25 || $[59] !== t26 || $[60] !== t28 ? (t29 = /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: t24, padding, children: [
|
|
1701
|
+
$[55] !== gap || $[56] !== padding || $[57] !== t24 || $[58] !== t25 || $[59] !== t27 ? (t28 = /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap, padding, children: [
|
|
1702
|
+
t24,
|
|
1806
1703
|
t25,
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1704
|
+
t27
|
|
1705
|
+
] }), $[55] = gap, $[56] = padding, $[57] = t24, $[58] = t25, $[59] = t27, $[60] = t28) : t28 = $[60];
|
|
1706
|
+
let t29;
|
|
1707
|
+
$[61] !== as || $[62] !== handleClick || $[63] !== handleMouseEnter || $[64] !== radius || $[65] !== rest || $[66] !== t22 || $[67] !== t23 || $[68] !== t28 || $[69] !== tone || $[70] !== withinMenu ? (t29 = /* @__PURE__ */ jsxRuntime.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];
|
|
1810
1708
|
let t30;
|
|
1811
|
-
|
|
1812
|
-
let t31;
|
|
1813
|
-
return $[73] !== childMenu || $[74] !== open || $[75] !== popover || $[76] !== t30 ? (t31 = /* @__PURE__ */ jsxRuntime.jsx(Popover, { ...popover, content: childMenu, "data-ui": "MenuGroup__popover", open, children: t30 }), $[73] = childMenu, $[74] = open, $[75] = popover, $[76] = t30, $[77] = t31) : t31 = $[77], t31;
|
|
1709
|
+
return $[72] !== childMenu || $[73] !== open || $[74] !== popover || $[75] !== t29 ? (t30 = /* @__PURE__ */ jsxRuntime.jsx(Popover, { ...popover, content: childMenu, "data-ui": "MenuGroup__popover", open, children: t29 }), $[72] = childMenu, $[73] = open, $[74] = popover, $[75] = t29, $[76] = t30) : t30 = $[76], t30;
|
|
1814
1710
|
}
|
|
1815
1711
|
const DEFAULT_MENU_ITEM_ELEMENT = "button";
|
|
1816
1712
|
function MenuItem(props) {
|
|
1817
|
-
const $ = compilerRuntime.c(
|
|
1818
|
-
let IconComponent, IconRightComponent, children, disabled, forwardedRef,
|
|
1713
|
+
const $ = compilerRuntime.c(73), t0 = props;
|
|
1714
|
+
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, text;
|
|
1819
1715
|
$[0] !== t0 ? ({
|
|
1820
1716
|
as: t1,
|
|
1821
1717
|
children,
|
|
1822
1718
|
disabled,
|
|
1823
1719
|
fontSize: t2,
|
|
1824
|
-
gap,
|
|
1720
|
+
gap: t3,
|
|
1825
1721
|
gapX,
|
|
1826
1722
|
gapY,
|
|
1827
1723
|
hotkeys,
|
|
1828
1724
|
icon: IconComponent,
|
|
1829
1725
|
iconRight: IconRightComponent,
|
|
1830
1726
|
onClick,
|
|
1831
|
-
padding:
|
|
1727
|
+
padding: t4,
|
|
1832
1728
|
paddingX,
|
|
1833
1729
|
paddingY,
|
|
1834
1730
|
paddingTop,
|
|
@@ -1836,32 +1732,31 @@ function MenuItem(props) {
|
|
|
1836
1732
|
paddingBottom,
|
|
1837
1733
|
paddingLeft,
|
|
1838
1734
|
pressed,
|
|
1839
|
-
radius:
|
|
1735
|
+
radius: t5,
|
|
1840
1736
|
ref: forwardedRef,
|
|
1841
1737
|
selected: selectedProp,
|
|
1842
|
-
space: t5,
|
|
1843
1738
|
text,
|
|
1844
1739
|
tone: t6,
|
|
1845
1740
|
...rest
|
|
1846
|
-
} = t0, $[0] = t0, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = forwardedRef, $[6] =
|
|
1847
|
-
const as = t1 === void 0 ? DEFAULT_MENU_ITEM_ELEMENT : t1, fontSize = t2 === void 0 ? 1 : t2,
|
|
1741
|
+
} = 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] = text) : (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], text = $[25]);
|
|
1742
|
+
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, menu = useMenu(), {
|
|
1848
1743
|
activeElement,
|
|
1849
1744
|
mount,
|
|
1850
1745
|
onItemClick,
|
|
1851
|
-
onItemMouseEnter
|
|
1852
|
-
onItemMouseLeave
|
|
1853
|
-
} = menu,
|
|
1746
|
+
onItemMouseEnter,
|
|
1747
|
+
onItemMouseLeave
|
|
1748
|
+
} = menu, [rootElement, setRootElement] = react.useState(null), active = !!activeElement && activeElement === rootElement, ref = react.useRef(null);
|
|
1854
1749
|
let t7;
|
|
1855
|
-
$[
|
|
1750
|
+
$[26] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[26] = t7) : t7 = $[26], react.useImperativeHandle(forwardedRef, t7);
|
|
1856
1751
|
let t8, t9;
|
|
1857
|
-
$[
|
|
1752
|
+
$[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]), react.useEffect(t8, t9);
|
|
1858
1753
|
let t10;
|
|
1859
|
-
$[
|
|
1754
|
+
$[32] !== disabled || $[33] !== onClick || $[34] !== onItemClick ? (t10 = (event) => {
|
|
1860
1755
|
disabled || (onClick && onClick(event), onItemClick && onItemClick());
|
|
1861
|
-
}, $[
|
|
1756
|
+
}, $[32] = disabled, $[33] = onClick, $[34] = onItemClick, $[35] = t10) : t10 = $[35];
|
|
1862
1757
|
const handleClick = t10;
|
|
1863
1758
|
let t11, t12;
|
|
1864
|
-
$[
|
|
1759
|
+
$[36] !== padding || $[37] !== paddingBottom || $[38] !== paddingLeft || $[39] !== paddingRight || $[40] !== paddingTop || $[41] !== paddingX || $[42] !== paddingY ? (t12 = {
|
|
1865
1760
|
padding,
|
|
1866
1761
|
paddingX,
|
|
1867
1762
|
paddingY,
|
|
@@ -1869,15 +1764,15 @@ function MenuItem(props) {
|
|
|
1869
1764
|
paddingRight,
|
|
1870
1765
|
paddingBottom,
|
|
1871
1766
|
paddingLeft
|
|
1872
|
-
}, $[
|
|
1767
|
+
}, $[36] = padding, $[37] = paddingBottom, $[38] = paddingLeft, $[39] = paddingRight, $[40] = paddingTop, $[41] = paddingX, $[42] = paddingY, $[43] = t12) : t12 = $[43], t11 = t12;
|
|
1873
1768
|
const paddingProps = t11;
|
|
1874
1769
|
let t13;
|
|
1875
|
-
$[
|
|
1770
|
+
$[44] === Symbol.for("react.memo_cache_sentinel") ? (t13 = (el) => {
|
|
1876
1771
|
ref.current = el, setRootElement(el);
|
|
1877
|
-
}, $[
|
|
1772
|
+
}, $[44] = t13) : t13 = $[44];
|
|
1878
1773
|
const setRef = t13, t14 = pressed ? "" : void 0, t15 = active ? "" : void 0, t16 = disabled ? "" : void 0, t17 = as === "button" ? "button" : void 0;
|
|
1879
1774
|
let t18;
|
|
1880
|
-
$[
|
|
1775
|
+
$[45] !== IconComponent || $[46] !== IconRightComponent || $[47] !== fontSize || $[48] !== gap || $[49] !== gapX || $[50] !== gapY || $[51] !== hotkeys || $[52] !== paddingProps || $[53] !== text ? (t18 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", gap, gapX, gapY, align: "center", ...paddingProps, children: [
|
|
1881
1776
|
IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { muted: !0, size: fontSize, children: [
|
|
1882
1777
|
react.isValidElement(IconComponent) && IconComponent,
|
|
1883
1778
|
reactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
|
|
@@ -1891,14 +1786,14 @@ function MenuItem(props) {
|
|
|
1891
1786
|
react.isValidElement(IconRightComponent) && IconRightComponent,
|
|
1892
1787
|
reactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
|
|
1893
1788
|
] })
|
|
1894
|
-
] }), $[
|
|
1789
|
+
] }), $[45] = IconComponent, $[46] = IconRightComponent, $[47] = fontSize, $[48] = gap, $[49] = gapX, $[50] = gapY, $[51] = hotkeys, $[52] = paddingProps, $[53] = text, $[54] = t18) : t18 = $[54];
|
|
1895
1790
|
let t19;
|
|
1896
|
-
$[
|
|
1791
|
+
$[55] !== children || $[56] !== paddingProps ? (t19 = children && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...paddingProps, children }), $[55] = children, $[56] = paddingProps, $[57] = t19) : t19 = $[57];
|
|
1897
1792
|
let t20;
|
|
1898
|
-
return $[
|
|
1793
|
+
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__ */ jsxRuntime.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: [
|
|
1899
1794
|
t18,
|
|
1900
1795
|
t19
|
|
1901
|
-
] }), $[
|
|
1796
|
+
] }), $[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;
|
|
1902
1797
|
}
|
|
1903
1798
|
const DEFAULT_TAB_ELEMENT = "button";
|
|
1904
1799
|
function Tab(props) {
|
|
@@ -1941,36 +1836,35 @@ function Tab(props) {
|
|
|
1941
1836
|
}
|
|
1942
1837
|
const DEFAULT_TAB_LIST_ELEMENT = "div";
|
|
1943
1838
|
function TabList(props) {
|
|
1944
|
-
const $ = compilerRuntime.c(
|
|
1945
|
-
let childrenProp, rest, t1, t2, t3
|
|
1839
|
+
const $ = compilerRuntime.c(20), t0 = props;
|
|
1840
|
+
let childrenProp, rest, t1, t2, t3;
|
|
1946
1841
|
$[0] !== t0 ? ({
|
|
1947
1842
|
as: t1,
|
|
1948
1843
|
children: childrenProp,
|
|
1949
1844
|
gap: t2,
|
|
1950
|
-
|
|
1951
|
-
wrap: t4,
|
|
1845
|
+
wrap: t3,
|
|
1952
1846
|
...rest
|
|
1953
|
-
} = t0, $[0] = t0, $[1] = childrenProp, $[2] = rest, $[3] = t1, $[4] = t2, $[5] = t3
|
|
1954
|
-
const as = t1 === void 0 ? DEFAULT_TAB_LIST_ELEMENT : t1, gap = t2 === void 0 ? 1 : t2,
|
|
1955
|
-
let
|
|
1956
|
-
if ($[
|
|
1847
|
+
} = t0, $[0] = t0, $[1] = childrenProp, $[2] = rest, $[3] = t1, $[4] = t2, $[5] = t3) : (childrenProp = $[1], rest = $[2], t1 = $[3], t2 = $[4], t3 = $[5]);
|
|
1848
|
+
const as = t1 === void 0 ? DEFAULT_TAB_LIST_ELEMENT : t1, gap = t2 === void 0 ? 1 : t2, wrap = t3 === void 0 ? "nowrap" : t3, [focusedIndex, setFocusedIndex] = react.useState(-1);
|
|
1849
|
+
let t4;
|
|
1850
|
+
if ($[6] !== childrenProp || $[7] !== focusedIndex) {
|
|
1957
1851
|
const children = react.Children.toArray(childrenProp).filter(_isReactElement);
|
|
1958
|
-
let
|
|
1959
|
-
$[
|
|
1852
|
+
let t52;
|
|
1853
|
+
$[9] !== focusedIndex ? (t52 = (child, childIndex) => react.cloneElement(child, {
|
|
1960
1854
|
focused: focusedIndex === childIndex,
|
|
1961
1855
|
key: childIndex,
|
|
1962
1856
|
onFocus: () => setFocusedIndex(childIndex)
|
|
1963
|
-
}), $[
|
|
1857
|
+
}), $[9] = focusedIndex, $[10] = t52) : t52 = $[10], t4 = children.map(t52), $[6] = childrenProp, $[7] = focusedIndex, $[8] = t4;
|
|
1964
1858
|
} else
|
|
1965
|
-
|
|
1966
|
-
const tabs =
|
|
1967
|
-
let
|
|
1968
|
-
$[
|
|
1859
|
+
t4 = $[8];
|
|
1860
|
+
const tabs = t4, numTabs = tabs.length;
|
|
1861
|
+
let t5;
|
|
1862
|
+
$[11] !== numTabs ? (t5 = (event) => {
|
|
1969
1863
|
event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex_0) => (prevIndex_0 + 1) % numTabs);
|
|
1970
|
-
}, $[
|
|
1971
|
-
const handleKeyDown =
|
|
1972
|
-
let
|
|
1973
|
-
return $[
|
|
1864
|
+
}, $[11] = numTabs, $[12] = t5) : t5 = $[12];
|
|
1865
|
+
const handleKeyDown = t5;
|
|
1866
|
+
let t6;
|
|
1867
|
+
return $[13] !== as || $[14] !== gap || $[15] !== handleKeyDown || $[16] !== rest || $[17] !== tabs || $[18] !== wrap ? (t6 = /* @__PURE__ */ jsxRuntime.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;
|
|
1974
1868
|
}
|
|
1975
1869
|
function _isReactElement(node) {
|
|
1976
1870
|
return !!node;
|
|
@@ -2022,7 +1916,7 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
|
|
|
2022
1916
|
right: ["right-end", "right-start", "left", "top", "bottom"],
|
|
2023
1917
|
"right-start": ["right", "right-end", "left-start", "top-start", "bottom-start"],
|
|
2024
1918
|
"right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
|
|
2025
|
-
}, TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/
|
|
1919
|
+
}, TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/v3/tooltipDelayGroup", null);
|
|
2026
1920
|
function useTooltipDelayGroup() {
|
|
2027
1921
|
return react.useContext(TooltipDelayGroupContext);
|
|
2028
1922
|
}
|
|
@@ -2237,24 +2131,23 @@ function useCloseOnMouseLeave(t0) {
|
|
|
2237
2131
|
$[7] !== isInsideGroup || $[8] !== showTooltip ? (t3 = [isInsideGroup, showTooltip], $[7] = isInsideGroup, $[8] = showTooltip, $[9] = t3) : t3 = $[9], react.useEffect(t2, t3);
|
|
2238
2132
|
}
|
|
2239
2133
|
function PortalProvider(props) {
|
|
2240
|
-
const $ = compilerRuntime.c(
|
|
2241
|
-
boundaryElement,
|
|
2134
|
+
const $ = compilerRuntime.c(6), {
|
|
2242
2135
|
children,
|
|
2243
2136
|
element,
|
|
2244
2137
|
__unstable_elements: elementsProp
|
|
2245
2138
|
} = props, elements = useUnique(elementsProp), fallbackElement = react.useSyncExternalStore(emptySubscribe, _temp, _temp2);
|
|
2246
2139
|
let t0;
|
|
2247
|
-
const t1 =
|
|
2248
|
-
let
|
|
2249
|
-
$[0] !== elements || $[1] !== t1
|
|
2140
|
+
const t1 = element || fallbackElement;
|
|
2141
|
+
let t2;
|
|
2142
|
+
$[0] !== elements || $[1] !== t1 ? (t2 = {
|
|
2250
2143
|
version: 0,
|
|
2251
|
-
boundaryElement:
|
|
2252
|
-
element:
|
|
2144
|
+
boundaryElement: null,
|
|
2145
|
+
element: t1,
|
|
2253
2146
|
elements
|
|
2254
|
-
}, $[0] = elements, $[1] = t1, $[2] = t2
|
|
2147
|
+
}, $[0] = elements, $[1] = t1, $[2] = t2) : t2 = $[2], t0 = t2;
|
|
2255
2148
|
const value = t0;
|
|
2256
|
-
let
|
|
2257
|
-
return $[
|
|
2149
|
+
let t3;
|
|
2150
|
+
return $[3] !== children || $[4] !== value ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(PortalContext.Provider, { value, children }), $[3] = children, $[4] = value, $[5] = t3) : t3 = $[5], t3;
|
|
2258
2151
|
}
|
|
2259
2152
|
function _temp2() {
|
|
2260
2153
|
return null;
|
|
@@ -2325,8 +2218,6 @@ exports.Tab = Tab;
|
|
|
2325
2218
|
exports.TabList = TabList;
|
|
2326
2219
|
exports.Text = Text;
|
|
2327
2220
|
exports.TextInput = TextInput;
|
|
2328
|
-
exports.ThemeColorProvider = ThemeColorProvider;
|
|
2329
|
-
exports.ThemeProvider = ThemeProvider;
|
|
2330
2221
|
exports.Tooltip = Tooltip;
|
|
2331
2222
|
exports.TooltipDelayGroupContext = TooltipDelayGroupContext;
|
|
2332
2223
|
exports.Z_OFFSETS = Z_OFFSETS;
|
|
@@ -2355,8 +2246,5 @@ exports.usePortal = usePortal;
|
|
|
2355
2246
|
exports.usePrefersDark = usePrefersDark;
|
|
2356
2247
|
exports.usePrefersReducedMotion = usePrefersReducedMotion;
|
|
2357
2248
|
exports.useResponsiveProp = useResponsiveProp;
|
|
2358
|
-
exports.useRootTheme = useRootTheme;
|
|
2359
|
-
exports.useTheme = useTheme;
|
|
2360
|
-
exports.useTheme_v2 = useTheme_v2;
|
|
2361
2249
|
exports.useTooltipDelayGroup = useTooltipDelayGroup;
|
|
2362
2250
|
//# sourceMappingURL=_visual-editing.cjs.map
|