@sanity/ui 2.16.21 → 2.16.23
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/dist/_chunks-cjs/_visual-editing.js +121 -1046
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-cjs/refractor.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +116 -1041
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_chunks-es/refractor.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +411 -351
- package/dist/_visual-editing.d.ts +411 -351
- package/dist/index.d.mts +1107 -930
- package/dist/index.d.ts +1107 -930
- package/dist/index.js +67 -158
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +65 -156
- package/dist/index.mjs.map +1 -1
- package/dist/theme.d.mts +769 -681
- package/dist/theme.d.ts +769 -681
- package/dist/theme.js +47 -0
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +47 -0
- package/dist/theme.mjs.map +1 -1
- package/exports/_visual-editing.ts +1 -0
- package/package.json +50 -163
- package/src/core/_compat.ts +30 -0
- package/src/core/components/autocomplete/autocomplete.tsx +11 -4
- package/src/core/components/autocomplete/autocompleteOption.tsx +1 -0
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +1 -0
- package/src/core/components/dialog/dialog.tsx +3 -0
- package/src/core/components/hotkeys/hotkeys.tsx +1 -0
- package/src/core/components/menu/menu.test.tsx +6 -4
- package/src/core/components/menu/menu.tsx +3 -2
- package/src/core/components/menu/menuButton.tsx +8 -0
- package/src/core/components/menu/menuGroup.tsx +5 -2
- package/src/core/components/menu/menuItem.tsx +4 -0
- package/src/core/components/menu/useMenuController.ts +6 -4
- package/src/core/components/skeleton/skeleton.tsx +2 -1
- package/src/core/components/tab/tab.tsx +1 -0
- package/src/core/components/tab/tabList.tsx +1 -0
- package/src/core/components/toast/toast.test.tsx +9 -4
- package/src/core/components/toast/toast.tsx +1 -1
- package/src/core/components/toast/toastProvider.tsx +1 -1
- package/src/core/components/tree/tree.tsx +1 -0
- package/src/core/components/tree/treeGroup.tsx +1 -0
- package/src/core/components/tree/treeItem.tsx +2 -2
- package/src/core/constants.ts +2 -2
- package/src/core/hooks/useClickOutside.test.tsx +43 -15
- package/src/core/hooks/useClickOutside.ts +1 -1
- package/src/core/hooks/useClickOutsideEvent.test.tsx +8 -4
- package/src/core/hooks/useDelayed.test.ts +7 -6
- package/src/core/hooks/useElementRect/useElementRect.ts +1 -0
- package/src/core/hooks/useForwardedRef.ts +1 -0
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +2 -1
- package/src/core/hooks/usePrefersDark.hydration.test.tsx +7 -5
- package/src/core/hooks/usePrefersDark.test.tsx +3 -1
- package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +7 -5
- package/src/core/hooks/usePrefersReducedMotion.test.tsx +3 -1
- package/src/core/lib/createGlobalScopedContext.ts +1 -0
- package/src/core/lib/globalScope.ts +1 -0
- package/src/core/observers/elementSizeObserver.ts +1 -0
- package/src/core/primitives/avatar/avatar.tsx +1 -2
- package/src/core/primitives/avatar/avatarStack.tsx +1 -0
- package/src/core/primitives/badge/badge.test.tsx +3 -2
- package/src/core/primitives/badge/badge.tsx +2 -1
- package/src/core/primitives/box/box.tsx +2 -1
- package/src/core/primitives/button/button.test.tsx +3 -2
- package/src/core/primitives/button/button.tsx +2 -0
- package/src/core/primitives/button/styles.ts +1 -0
- package/src/core/primitives/card/card.tsx +1 -5
- package/src/core/primitives/card/types.ts +1 -0
- package/src/core/primitives/code/refractor.tsx +2 -0
- package/src/core/primitives/flex/flex.tsx +1 -3
- package/src/core/primitives/inline/inline.tsx +1 -0
- package/src/core/primitives/popover/popover.tsx +13 -4
- package/src/core/primitives/popover/popoverCard.tsx +2 -1
- package/src/core/primitives/popover/types.ts +0 -1
- package/src/core/primitives/stack/styles.ts +1 -0
- package/src/core/primitives/textInput/textInput.tsx +2 -0
- package/src/core/primitives/tooltip/tooltip.test.tsx +82 -49
- package/src/core/primitives/tooltip/tooltip.tsx +6 -1
- package/src/core/primitives/tooltip/tooltipCard.tsx +2 -1
- package/src/core/primitives/tooltip/tooltipDelayGroup/types.ts +2 -0
- package/src/core/styles/flex/types.ts +0 -1
- package/src/core/styles/font/responsiveFont.ts +0 -3
- package/src/core/styles/font/types.ts +1 -3
- package/src/core/styles/grid/gridStyle.ts +1 -0
- package/src/core/styles/margin/marginStyle.ts +1 -0
- package/src/core/styles/margin/marginsStyle.test.ts +2 -1
- package/src/core/styles/padding/paddingStyle.test.ts +2 -1
- package/src/core/styles/padding/paddingStyle.ts +1 -0
- package/src/core/theme/theme.test.tsx +7 -3
- package/src/core/theme/useRootTheme.ts +1 -0
- package/src/core/theme/useTheme.ts +2 -0
- package/src/core/utils/arrow/arrow.tsx +1 -0
- package/src/core/utils/boundaryElement/boundaryElement.test.tsx +9 -4
- package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +1 -0
- package/src/core/utils/getElementRef.ts +5 -0
- package/src/core/utils/layer/getLayerContext.test.ts +2 -0
- package/src/core/utils/layer/layer.test.tsx +9 -4
- package/src/core/utils/layer/layer.tsx +1 -0
- package/src/core/utils/layer/useLayer.ts +2 -0
- package/src/core/utils/portal/portal.test.tsx +9 -4
- package/src/core/utils/portal/portalProvider.tsx +4 -3
- package/src/core/utils/virtualList/virtualList.tsx +2 -1
- package/src/theme/build/_deprecated/color/_selectable/createSelectableTones.ts +10 -0
- package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +4 -0
- package/src/theme/build/_deprecated/color/button/createButtonModes.ts +5 -0
- package/src/theme/build/_deprecated/color/button/createButtonTones.ts +5 -0
- package/src/theme/build/_deprecated/color/card/createCardStates.ts +6 -0
- package/src/theme/build/_deprecated/color/color.test.ts +5 -1
- package/src/theme/build/_deprecated/color/defaults.ts +1 -0
- package/src/theme/build/_deprecated/color/factory.ts +36 -0
- package/src/theme/build/_deprecated/color/input/createInputModes.ts +5 -0
- package/src/theme/build/_deprecated/color/muted/createMuted.ts +4 -0
- package/src/theme/build/_deprecated/color/spot/createSpot.ts +3 -0
- package/src/theme/build/buildColorTheme.test.ts +2 -0
- package/src/theme/build/buildColorTheme.ts +7 -0
- package/src/theme/build/buildTheme.test.ts +2 -0
- package/src/theme/build/lib/color-fns/color-fns.test.ts +3 -1
- package/src/theme/build/merge.ts +5 -0
- package/src/theme/build/mixThemeColor.test.ts +2 -0
- package/src/theme/build/renderColorTheme.ts +6 -0
- package/src/theme/build/renderColorValue.ts +0 -2
- package/src/theme/build/resolveColorTokens.ts +6 -0
- package/src/theme/build/theme.test.ts +2 -0
- package/src/theme/config/helpers.ts +5 -0
- package/src/theme/config/system.ts +2 -0
- package/src/theme/config/tokens/color/types.ts +6 -4
- package/src/theme/config/tokens/parseTokenKey.test.ts +2 -0
- package/src/theme/config/tokens/parseTokenValue.test.ts +2 -0
- package/src/theme/config/tokens/parseTokenValue.ts +1 -0
- package/src/theme/getScopedTheme.ts +5 -0
- package/src/theme/system/color/_helpers.ts +4 -0
- package/src/theme/system/theme.ts +4 -0
- package/src/theme/system/v0/color/_system.ts +1 -0
- package/src/theme/system/v0/color/button.ts +14 -0
- package/src/theme/system/v0/color/card.ts +6 -0
- package/src/theme/system/v0/color/color.ts +11 -0
- package/src/theme/system/v0/color/input.ts +6 -0
- package/src/theme/system/v0/color/muted.ts +11 -0
- package/src/theme/system/v0/color/selectable.ts +11 -0
- package/src/theme/system/v0/color/solid.ts +11 -0
- package/src/theme/system/v0/color/spot.ts +1 -0
- package/src/theme/versioning/getTheme_v2.ts +15 -0
- package/src/theme/versioning/themeColor_v0_v2.ts +7 -0
- package/src/theme/versioning/themeColor_v2_v2_9.ts +1 -0
- package/src/theme/versioning/v0_v2.ts +13 -1
- package/src/theme/versioning/v2_v0.ts +15 -0
- package/src/core/__workshop__/constants.ts +0 -293
- package/src/core/components/autocomplete/__mocks__/apiStore.ts +0 -49
- package/src/core/components/autocomplete/__mocks__/countries.ts +0 -245
- package/src/core/components/autocomplete/__workshop__/async.tsx +0 -156
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +0 -137
- package/src/core/components/autocomplete/__workshop__/custom.tsx +0 -89
- package/src/core/components/autocomplete/__workshop__/example.tsx +0 -79
- package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +0 -36
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +0 -294
- package/src/core/components/autocomplete/__workshop__/index.ts +0 -39
- package/src/core/components/autocomplete/__workshop__/types.ts +0 -4
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +0 -62
- package/src/core/components/breadcrumbs/__workshop__/index.ts +0 -14
- package/src/core/components/dialog/__workshop__/activate.tsx +0 -134
- package/src/core/components/dialog/__workshop__/autoFocus.tsx +0 -29
- package/src/core/components/dialog/__workshop__/index.ts +0 -19
- package/src/core/components/dialog/__workshop__/layering.tsx +0 -41
- package/src/core/components/dialog/__workshop__/nested.tsx +0 -72
- package/src/core/components/dialog/__workshop__/onScroll.tsx +0 -39
- package/src/core/components/dialog/__workshop__/panes.tsx +0 -82
- package/src/core/components/dialog/__workshop__/position.tsx +0 -30
- package/src/core/components/dialog/__workshop__/props.tsx +0 -75
- package/src/core/components/dialog/__workshop__/provider.tsx +0 -11
- package/src/core/components/dialog/__workshop__/wrapped.tsx +0 -76
- package/src/core/components/hotkeys/__workshop__/index.ts +0 -14
- package/src/core/components/hotkeys/__workshop__/plain.tsx +0 -9
- package/src/core/components/menu/__workshop__/asComponent.tsx +0 -45
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +0 -51
- package/src/core/components/menu/__workshop__/closableMenuButton.tsx +0 -46
- package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +0 -134
- package/src/core/components/menu/__workshop__/customMenuItem.tsx +0 -45
- package/src/core/components/menu/__workshop__/customSelectedState.tsx +0 -39
- package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +0 -40
- package/src/core/components/menu/__workshop__/groups.tsx +0 -156
- package/src/core/components/menu/__workshop__/index.ts +0 -89
- package/src/core/components/menu/__workshop__/menuButton.tsx +0 -80
- package/src/core/components/menu/__workshop__/menuGroupRight.tsx +0 -65
- package/src/core/components/menu/__workshop__/nestedMenu.tsx +0 -22
- package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +0 -41
- package/src/core/components/menu/__workshop__/selectedItem.tsx +0 -69
- package/src/core/components/menu/__workshop__/shouldFocus.tsx +0 -47
- package/src/core/components/menu/__workshop__/tones.tsx +0 -25
- package/src/core/components/menu/__workshop__/withoutArrow.tsx +0 -32
- package/src/core/components/skeleton/__workshop__/delay.tsx +0 -70
- package/src/core/components/skeleton/__workshop__/index.ts +0 -11
- package/src/core/components/skeleton/__workshop__/skeleton.tsx +0 -64
- package/src/core/components/tab/__workshop__/example.tsx +0 -79
- package/src/core/components/tab/__workshop__/index.ts +0 -14
- package/src/core/components/toast/__workshop__/hook.tsx +0 -71
- package/src/core/components/toast/__workshop__/index.ts +0 -19
- package/src/core/components/toast/__workshop__/toast.tsx +0 -26
- package/src/core/components/tree/__workshop__/basic.perf.ts +0 -19
- package/src/core/components/tree/__workshop__/basic.tsx +0 -105
- package/src/core/components/tree/__workshop__/index.ts +0 -21
- package/src/core/components/tree/__workshop__/tabFromElement.tsx +0 -84
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +0 -32
- package/src/core/hooks/useElementRect/__workshop__/index.ts +0 -14
- package/src/core/hooks/useMediaIndex/__workshop__/index.ts +0 -14
- package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +0 -14
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +0 -14
- package/src/core/primitives/avatar/__workshop__/index.ts +0 -29
- package/src/core/primitives/avatar/__workshop__/stack.tsx +0 -25
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +0 -63
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +0 -70
- package/src/core/primitives/badge/__workshop__/index.ts +0 -19
- package/src/core/primitives/badge/__workshop__/props.tsx +0 -30
- package/src/core/primitives/badge/__workshop__/tones.tsx +0 -21
- package/src/core/primitives/box/__workshop__/index.ts +0 -19
- package/src/core/primitives/box/__workshop__/props.tsx +0 -20
- package/src/core/primitives/box/__workshop__/responsive.tsx +0 -20
- package/src/core/primitives/button/__workshop__/custom.tsx +0 -51
- package/src/core/primitives/button/__workshop__/customIcons.tsx +0 -30
- package/src/core/primitives/button/__workshop__/disabled.tsx +0 -74
- package/src/core/primitives/button/__workshop__/index.ts +0 -59
- package/src/core/primitives/button/__workshop__/mixedChildren.tsx +0 -12
- package/src/core/primitives/button/__workshop__/props.tsx +0 -55
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +0 -36
- package/src/core/primitives/button/__workshop__/stacked.tsx +0 -58
- package/src/core/primitives/button/__workshop__/styled1.tsx +0 -17
- package/src/core/primitives/button/__workshop__/styled2.tsx +0 -19
- package/src/core/primitives/button/__workshop__/uploadButton.tsx +0 -28
- package/src/core/primitives/card/__workshop__/allTones.tsx +0 -25
- package/src/core/primitives/card/__workshop__/asButton.tsx +0 -107
- package/src/core/primitives/card/__workshop__/asComponent.tsx +0 -27
- package/src/core/primitives/card/__workshop__/checkered.tsx +0 -26
- package/src/core/primitives/card/__workshop__/index.ts +0 -18
- package/src/core/primitives/card/__workshop__/interactive.tsx +0 -30
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +0 -80
- package/src/core/primitives/card/__workshop__/props.tsx +0 -53
- package/src/core/primitives/card/__workshop__/selected.tsx +0 -94
- package/src/core/primitives/card/__workshop__/styled.tsx +0 -14
- package/src/core/primitives/checkbox/__workshop__/example.tsx +0 -25
- package/src/core/primitives/checkbox/__workshop__/index.ts +0 -13
- package/src/core/primitives/checkbox/__workshop__/props.tsx +0 -33
- package/src/core/primitives/checkbox/__workshop__/readOnly.tsx +0 -16
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +0 -28
- package/src/core/primitives/code/__workshop__/index.ts +0 -19
- package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +0 -48
- package/src/core/primitives/code/__workshop__/props.tsx +0 -21
- package/src/core/primitives/container/__workshop__/example.tsx +0 -20
- package/src/core/primitives/container/__workshop__/index.ts +0 -8
- package/src/core/primitives/flex/__workshop__/example.tsx +0 -34
- package/src/core/primitives/flex/__workshop__/gap.tsx +0 -25
- package/src/core/primitives/flex/__workshop__/index.ts +0 -11
- package/src/core/primitives/grid/__workshop__/index.ts +0 -10
- package/src/core/primitives/grid/__workshop__/responsive.tsx +0 -54
- package/src/core/primitives/heading/__workshop__/index.ts +0 -19
- package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +0 -54
- package/src/core/primitives/heading/__workshop__/plain.tsx +0 -32
- package/src/core/primitives/inline/__workshop__/index.ts +0 -8
- package/src/core/primitives/inline/__workshop__/plain.tsx +0 -27
- package/src/core/primitives/kbd/__workshop__/index.ts +0 -8
- package/src/core/primitives/kbd/__workshop__/plain.tsx +0 -9
- package/src/core/primitives/label/__workshop__/index.ts +0 -19
- package/src/core/primitives/label/__workshop__/opticalAlignment.tsx +0 -48
- package/src/core/primitives/label/__workshop__/plain.tsx +0 -24
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +0 -77
- package/src/core/primitives/popover/__workshop__/MarginsStory.tsx +0 -31
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -32
- package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -11
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +0 -71
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +0 -71
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +0 -89
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +0 -97
- package/src/core/primitives/popover/__workshop__/index.ts +0 -49
- package/src/core/primitives/radio/__workshop__/example.tsx +0 -63
- package/src/core/primitives/radio/__workshop__/index.ts +0 -11
- package/src/core/primitives/radio/__workshop__/plain.tsx +0 -28
- package/src/core/primitives/select/__workshop__/index.ts +0 -11
- package/src/core/primitives/select/__workshop__/plain.tsx +0 -27
- package/src/core/primitives/select/__workshop__/readOnly.tsx +0 -23
- package/src/core/primitives/spinner/__workshop__/Props.tsx +0 -15
- package/src/core/primitives/spinner/__workshop__/index.ts +0 -14
- package/src/core/primitives/stack/__workshop__/index.ts +0 -14
- package/src/core/primitives/stack/__workshop__/plain.tsx +0 -32
- package/src/core/primitives/switch/__workshop__/example.tsx +0 -23
- package/src/core/primitives/switch/__workshop__/index.ts +0 -11
- package/src/core/primitives/switch/__workshop__/props.tsx +0 -21
- package/src/core/primitives/text/__workshop__/colored.tsx +0 -30
- package/src/core/primitives/text/__workshop__/example.tsx +0 -39
- package/src/core/primitives/text/__workshop__/index.ts +0 -24
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +0 -48
- package/src/core/primitives/textArea/__workshop__/index.ts +0 -14
- package/src/core/primitives/textArea/__workshop__/plain.tsx +0 -50
- package/src/core/primitives/textInput/__workshop__/clearButton.tsx +0 -30
- package/src/core/primitives/textInput/__workshop__/customValidity.tsx +0 -17
- package/src/core/primitives/textInput/__workshop__/index.ts +0 -44
- package/src/core/primitives/textInput/__workshop__/plain.tsx +0 -98
- package/src/core/primitives/textInput/__workshop__/readOnly.tsx +0 -9
- package/src/core/primitives/textInput/__workshop__/states.tsx +0 -53
- package/src/core/primitives/textInput/__workshop__/tones.tsx +0 -277
- package/src/core/primitives/textInput/__workshop__/typed.tsx +0 -23
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +0 -102
- package/src/core/primitives/tooltip/__workshop__/index.ts +0 -29
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -74
- package/src/core/primitives/tooltip/__workshop__/props.tsx +0 -107
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -86
- package/src/core/theme/__workshop__/build/Root.tsx +0 -367
- package/src/core/theme/__workshop__/build/helpers.ts +0 -46
- package/src/core/theme/__workshop__/build/story.tsx +0 -465
- package/src/core/theme/__workshop__/canvas.tsx +0 -352
- package/src/core/theme/__workshop__/color.tsx +0 -62
- package/src/core/theme/__workshop__/debug/story.tsx +0 -408
- package/src/core/theme/__workshop__/index.ts +0 -39
- package/src/core/theme/__workshop__/layer.tsx +0 -78
- package/src/core/theme/__workshop__/nestedProvider.tsx +0 -15
- package/src/core/utils/boundaryElement/__workshop__/index.ts +0 -14
- package/src/core/utils/boundaryElement/__workshop__/plain.tsx +0 -19
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +0 -30
- package/src/core/utils/elementQuery/__workshop__/index.ts +0 -14
- package/src/core/utils/layer/__workshop__/_debug.tsx +0 -17
- package/src/core/utils/layer/__workshop__/index.ts +0 -24
- package/src/core/utils/layer/__workshop__/multipleRoots.tsx +0 -49
- package/src/core/utils/layer/__workshop__/nested.tsx +0 -98
- package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +0 -13
- package/src/core/utils/portal/__workshop__/index.ts +0 -14
- package/src/core/utils/portal/__workshop__/named.tsx +0 -63
- package/src/core/utils/virtualList/__workshop__/changingProps.tsx +0 -36
- package/src/core/utils/virtualList/__workshop__/elementScroll.tsx +0 -24
- package/src/core/utils/virtualList/__workshop__/index.ts +0 -29
- package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +0 -48
- package/src/core/utils/virtualList/__workshop__/windowScrolll.tsx +0 -22
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3
|
-
var _visualEditing = require("./_chunks-cjs/_visual-editing.js"), jsxRuntime = require("react/jsx-runtime"), icons = require("@sanity/icons"), react = require("react"), styledComponents = require("styled-components"), reactCompilerRuntime = require("react-compiler-runtime"), theme = require("@sanity/ui/theme"),
|
|
3
|
+
var _visualEditing = require("./_chunks-cjs/_visual-editing.js"), jsxRuntime = require("react/jsx-runtime"), icons = require("@sanity/icons"), react = require("react"), styledComponents = require("styled-components"), reactCompilerRuntime = require("react-compiler-runtime"), theme = require("@sanity/ui/theme"), react$1 = require("motion/react");
|
|
4
4
|
function _raf(fn) {
|
|
5
5
|
const frameId = requestAnimationFrame(fn);
|
|
6
6
|
return () => {
|
|
@@ -381,26 +381,71 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
381
381
|
};
|
|
382
382
|
}, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding = react.useMemo(() => padding.map((v_0) => v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2), [padding]), openButtonPadding = react.useMemo(() => padding.map((v_1) => Math.max(v_1 - 1, 0)), [padding]), openButtonProps = react.useMemo(() => typeof openButton == "object" ? openButton : _visualEditing.EMPTY_RECORD, [openButton]), handleOpenClick = react.useCallback((event_4) => {
|
|
383
383
|
dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
|
|
384
|
-
}, [openButtonProps, dispatchOpen]), openButtonNode = react.useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { "aria-label": "Open", disabled: expanded, fontSize, icon: icons.ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = react.useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsxRuntime.jsx(
|
|
384
|
+
}, [openButtonProps, dispatchOpen]), openButtonNode = react.useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { "aria-label": "Open", disabled: expanded, fontSize, icon: icons.ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = react.useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsxRuntime.jsx(
|
|
385
|
+
_visualEditing.TextInput,
|
|
386
|
+
{
|
|
387
|
+
...restProps,
|
|
388
|
+
"aria-activedescendant": activeItemId,
|
|
389
|
+
"aria-autocomplete": "list",
|
|
390
|
+
"aria-expanded": expanded,
|
|
391
|
+
"aria-owns": listBoxId,
|
|
392
|
+
autoCapitalize: "off",
|
|
393
|
+
autoComplete: "off",
|
|
394
|
+
autoCorrect: "off",
|
|
395
|
+
border,
|
|
396
|
+
clearButton,
|
|
397
|
+
customValidity,
|
|
398
|
+
disabled,
|
|
399
|
+
fontSize,
|
|
400
|
+
icon,
|
|
401
|
+
iconRight: loading && AnimatedSpinnerIcon,
|
|
402
|
+
id,
|
|
403
|
+
inputMode: "search",
|
|
404
|
+
onChange: handleInputChange,
|
|
405
|
+
onClear: handleClearButtonClick,
|
|
406
|
+
onFocus: handleInputFocus,
|
|
407
|
+
padding,
|
|
408
|
+
prefix,
|
|
409
|
+
radius,
|
|
410
|
+
readOnly,
|
|
411
|
+
ref: inputElementRef,
|
|
412
|
+
role: "combobox",
|
|
413
|
+
spellCheck: !1,
|
|
414
|
+
suffix: suffix || openButtonNode,
|
|
415
|
+
value: inputValue
|
|
416
|
+
}
|
|
417
|
+
), handleListBoxKeyDown = react.useCallback((event_5) => {
|
|
385
418
|
event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
|
|
386
|
-
}, [listFocused]), content2 = react.useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(ListBox, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
419
|
+
}, [listFocused]), content2 = react.useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(ListBox, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
420
|
+
_visualEditing.Stack,
|
|
421
|
+
{
|
|
422
|
+
as: "ul",
|
|
423
|
+
"aria-multiselectable": !1,
|
|
424
|
+
"data-ui": "AutoComplete__resultsList",
|
|
425
|
+
id: listBoxId,
|
|
426
|
+
ref: listBoxElementRef,
|
|
427
|
+
role: "listbox",
|
|
428
|
+
space: 1,
|
|
429
|
+
children: filteredOptions.map((option_0) => {
|
|
430
|
+
const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
|
|
431
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: react.cloneElement(renderOption(option_0), {
|
|
432
|
+
disabled: loading,
|
|
433
|
+
selected: active,
|
|
434
|
+
tabIndex: listFocused && active ? 0 : -1
|
|
435
|
+
}) }, option_0.value);
|
|
436
|
+
})
|
|
437
|
+
}
|
|
438
|
+
) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = react.useMemo(() => renderPopover ? renderPopover(
|
|
439
|
+
// oxlint-disable-next-line react-compiler
|
|
395
440
|
{
|
|
396
441
|
content: content2,
|
|
397
442
|
hidden: !expanded,
|
|
398
|
-
//
|
|
443
|
+
// oxlint-disable-next-line react-compiler
|
|
399
444
|
inputElement: inputElementRef.current,
|
|
400
445
|
onMouseEnter: handlePopoverMouseEnter,
|
|
401
446
|
onMouseLeave: handlePopoverMouseLeave
|
|
402
447
|
},
|
|
403
|
-
//
|
|
448
|
+
// oxlint-disable-next-line react-compiler
|
|
404
449
|
resultsPopoverElementRef
|
|
405
450
|
) : filteredOptionsLen === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(
|
|
406
451
|
_visualEditing.Popover,
|
|
@@ -525,32 +570,7 @@ function responsiveDialogPositionStyle(props) {
|
|
|
525
570
|
}));
|
|
526
571
|
}
|
|
527
572
|
function animationDialogStyle(props) {
|
|
528
|
-
return props.$animate ? styledComponents.css`
|
|
529
|
-
@keyframes zoomIn {
|
|
530
|
-
from {
|
|
531
|
-
opacity: 0;
|
|
532
|
-
transform: scale(0.95);
|
|
533
|
-
}
|
|
534
|
-
to {
|
|
535
|
-
opacity: 1;
|
|
536
|
-
transform: scale(1);
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
@keyframes fadeIn {
|
|
540
|
-
from {
|
|
541
|
-
opacity: 0;
|
|
542
|
-
}
|
|
543
|
-
to {
|
|
544
|
-
opacity: 1;
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
animation: fadeIn 200ms ease-out;
|
|
549
|
-
// Animates the dialog card.
|
|
550
|
-
& > [data-ui='DialogCard'] {
|
|
551
|
-
animation: zoomIn 200ms ease-out;
|
|
552
|
-
}
|
|
553
|
-
` : styledComponents.css``;
|
|
573
|
+
return props.$animate ? styledComponents.css`@keyframes zoomIn{from{opacity:0;transform:scale(0.95);}to{opacity:1;transform:scale(1);}}@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}animation:fadeIn 200ms ease-out;& > [data-ui='DialogCard']{animation:zoomIn 200ms ease-out;}` : styledComponents.css``;
|
|
554
574
|
}
|
|
555
575
|
const DialogContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/dialog", {
|
|
556
576
|
version: 0
|
|
@@ -875,47 +895,11 @@ MenuButton.displayName = "ForwardRef(MenuButton)";
|
|
|
875
895
|
function _temp$2(v) {
|
|
876
896
|
return !v;
|
|
877
897
|
}
|
|
878
|
-
const keyframe = styledComponents.keyframes`
|
|
879
|
-
0% {
|
|
880
|
-
background-position: 100%;
|
|
881
|
-
}
|
|
882
|
-
100% {
|
|
883
|
-
background-position: -100%;
|
|
884
|
-
}
|
|
885
|
-
`, animation = styledComponents.css`
|
|
886
|
-
background-image: linear-gradient(
|
|
887
|
-
to right,
|
|
888
|
-
var(--card-skeleton-color-from),
|
|
889
|
-
var(--card-skeleton-color-to),
|
|
890
|
-
var(--card-skeleton-color-from),
|
|
891
|
-
var(--card-skeleton-color-from),
|
|
892
|
-
var(--card-skeleton-color-from)
|
|
893
|
-
);
|
|
894
|
-
background-position: 100%;
|
|
895
|
-
background-size: 200% 100%;
|
|
896
|
-
background-attachment: fixed;
|
|
897
|
-
animation-name: ${keyframe};
|
|
898
|
-
animation-timing-function: ease-in-out;
|
|
899
|
-
animation-iteration-count: infinite;
|
|
900
|
-
animation-duration: 2000ms;
|
|
901
|
-
`, skeletonStyle = styledComponents.css`
|
|
902
|
-
opacity: ${({
|
|
898
|
+
const keyframe = styledComponents.keyframes`0%{background-position:100%;}100%{background-position:-100%;}`, animation = styledComponents.css`background-image:linear-gradient( to right,var(--card-skeleton-color-from),var(--card-skeleton-color-to),var(--card-skeleton-color-from),var(--card-skeleton-color-from),var(--card-skeleton-color-from) );background-position:100%;background-size:200% 100%;background-attachment:fixed;animation-name:${keyframe};animation-timing-function:ease-in-out;animation-iteration-count:infinite;animation-duration:2000ms;`, skeletonStyle = styledComponents.css`opacity:${({
|
|
903
899
|
$visible
|
|
904
|
-
}) => $visible ? 1 : 0};
|
|
905
|
-
transition: opacity 200ms ease-in;
|
|
906
|
-
|
|
907
|
-
@media screen and (prefers-reduced-motion: no-preference) {
|
|
908
|
-
${({
|
|
900
|
+
}) => $visible ? 1 : 0};transition:opacity 200ms ease-in;@media screen and (prefers-reduced-motion:no-preference){${({
|
|
909
901
|
$animated
|
|
910
|
-
}) => $animated ? animation : styledComponents.css`
|
|
911
|
-
background-color: var(--card-skeleton-color-from);
|
|
912
|
-
`}
|
|
913
|
-
}
|
|
914
|
-
|
|
915
|
-
@media screen and (prefers-reduced-motion: reduce) {
|
|
916
|
-
background-color: var(--card-skeleton-color-from);
|
|
917
|
-
}
|
|
918
|
-
`, StyledSkeleton$1 = /* @__PURE__ */ styledComponents.styled(_visualEditing.Box).withConfig({
|
|
902
|
+
}) => $animated ? animation : styledComponents.css`background-color:var(--card-skeleton-color-from);`}}@media screen and (prefers-reduced-motion:reduce){background-color:var(--card-skeleton-color-from);}`, StyledSkeleton$1 = /* @__PURE__ */ styledComponents.styled(_visualEditing.Box).withConfig({
|
|
919
903
|
displayName: "StyledSkeleton",
|
|
920
904
|
componentId: "sc-ebtpni-0"
|
|
921
905
|
})(_visualEditing.responsiveRadiusStyle, skeletonStyle), Skeleton = react.forwardRef(function(props, ref) {
|
|
@@ -1165,7 +1149,7 @@ const container = {
|
|
|
1165
1149
|
visible: {
|
|
1166
1150
|
opacity: 1
|
|
1167
1151
|
}
|
|
1168
|
-
}, MotionToast =
|
|
1152
|
+
}, MotionToast = react$1.motion.create(StyledToast), MotionFlex = react$1.motion.create(_visualEditing.Flex), MotionText = react$1.motion.create(_visualEditing.Text), MotionLoadingBar = react$1.motion.create(LoadingBar), MotionLoadingBarProgress = react$1.motion.create(LoadingBarProgress);
|
|
1169
1153
|
function useMounted() {
|
|
1170
1154
|
return react.useSyncExternalStore(subscribe, _temp$1, _temp2);
|
|
1171
1155
|
}
|
|
@@ -1240,7 +1224,7 @@ function ToastProvider(props) {
|
|
|
1240
1224
|
}, $[1] = t2) : t2 = $[1];
|
|
1241
1225
|
const value = t2;
|
|
1242
1226
|
let t3;
|
|
1243
|
-
$[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t3 = mounted && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1227
|
+
$[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t3 = mounted && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t3) : t3 = $[9];
|
|
1244
1228
|
let t4;
|
|
1245
1229
|
return $[10] !== children || $[11] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
|
|
1246
1230
|
children,
|
|
@@ -1474,82 +1458,13 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
|
|
|
1474
1458
|
}));
|
|
1475
1459
|
Tree.displayName = "Memo(ForwardRef(Tree))";
|
|
1476
1460
|
function treeItemRootStyle() {
|
|
1477
|
-
return styledComponents.css
|
|
1478
|
-
&[role='none'] > [role='treeitem'] {
|
|
1479
|
-
outline: none;
|
|
1480
|
-
cursor: default;
|
|
1481
|
-
border-radius: 3px;
|
|
1482
|
-
|
|
1483
|
-
background-color: var(--card-bg-color);
|
|
1484
|
-
color: var(--treeitem-fg-color);
|
|
1485
|
-
|
|
1486
|
-
&:focus {
|
|
1487
|
-
position: relative;
|
|
1488
|
-
}
|
|
1489
|
-
}
|
|
1490
|
-
|
|
1491
|
-
&[role='treeitem'] {
|
|
1492
|
-
outline: none;
|
|
1493
|
-
|
|
1494
|
-
& > div {
|
|
1495
|
-
cursor: default;
|
|
1496
|
-
border-radius: 3px;
|
|
1497
|
-
|
|
1498
|
-
background-color: var(--card-bg-color);
|
|
1499
|
-
color: var(--treeitem-fg-color);
|
|
1500
|
-
}
|
|
1501
|
-
|
|
1502
|
-
&:focus > div {
|
|
1503
|
-
position: relative;
|
|
1504
|
-
}
|
|
1505
|
-
}
|
|
1506
|
-
`;
|
|
1461
|
+
return styledComponents.css`&[role='none'] > [role='treeitem']{outline:none;cursor:default;border-radius:3px;background-color:var(--card-bg-color);color:var(--treeitem-fg-color);&:focus{position:relative;}}&[role='treeitem']{outline:none;& > div{cursor:default;border-radius:3px;background-color:var(--card-bg-color);color:var(--treeitem-fg-color);}&:focus > div{position:relative;}}`;
|
|
1507
1462
|
}
|
|
1508
1463
|
function treeItemRootColorStyle(props) {
|
|
1509
1464
|
const $tone = "default", {
|
|
1510
1465
|
color
|
|
1511
1466
|
} = theme.getTheme_v2(props.theme), tone = color.selectable[$tone];
|
|
1512
|
-
return styledComponents.css
|
|
1513
|
-
&[role='none'] {
|
|
1514
|
-
& > [role='treeitem'] {
|
|
1515
|
-
${_visualEditing._cardColorStyle(color, tone.enabled)}
|
|
1516
|
-
}
|
|
1517
|
-
|
|
1518
|
-
&[data-selected] > [role='treeitem'] {
|
|
1519
|
-
${_visualEditing._cardColorStyle(color, tone.pressed)}
|
|
1520
|
-
}
|
|
1521
|
-
|
|
1522
|
-
@media (hover: hover) {
|
|
1523
|
-
&:not([data-selected]) > [role='treeitem']:not(:focus):hover {
|
|
1524
|
-
${_visualEditing._cardColorStyle(color, tone.hovered)}
|
|
1525
|
-
}
|
|
1526
|
-
|
|
1527
|
-
& > [role='treeitem']:focus {
|
|
1528
|
-
${_visualEditing._cardColorStyle(color, tone.selected)}
|
|
1529
|
-
}
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1532
|
-
|
|
1533
|
-
&[role='treeitem'] {
|
|
1534
|
-
& > [data-ui='TreeItem__box'] {
|
|
1535
|
-
${_visualEditing._cardColorStyle(color, tone.enabled)}
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
&[data-selected] > [data-ui='TreeItem__box'] {
|
|
1539
|
-
${_visualEditing._cardColorStyle(color, tone.pressed)}
|
|
1540
|
-
}
|
|
1541
|
-
|
|
1542
|
-
@media (hover: hover) {
|
|
1543
|
-
&:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover {
|
|
1544
|
-
${_visualEditing._cardColorStyle(color, tone.hovered)}
|
|
1545
|
-
}
|
|
1546
|
-
|
|
1547
|
-
&:focus > [data-ui='TreeItem__box'] {
|
|
1548
|
-
${_visualEditing._cardColorStyle(color, tone.selected)}
|
|
1549
|
-
}
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
`;
|
|
1467
|
+
return styledComponents.css`&[role='none']{& > [role='treeitem']{${_visualEditing._cardColorStyle(color, tone.enabled)}}&[data-selected] > [role='treeitem']{${_visualEditing._cardColorStyle(color, tone.pressed)}}@media (hover:hover){&:not([data-selected]) > [role='treeitem']:not(:focus):hover{${_visualEditing._cardColorStyle(color, tone.hovered)}}& > [role='treeitem']:focus{${_visualEditing._cardColorStyle(color, tone.selected)}}}}&[role='treeitem']{& > [data-ui='TreeItem__box']{${_visualEditing._cardColorStyle(color, tone.enabled)}}&[data-selected] > [data-ui='TreeItem__box']{${_visualEditing._cardColorStyle(color, tone.pressed)}}@media (hover:hover){&:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover{${_visualEditing._cardColorStyle(color, tone.hovered)}}&:focus > [data-ui='TreeItem__box']{${_visualEditing._cardColorStyle(color, tone.selected)}}}}`;
|
|
1553
1468
|
}
|
|
1554
1469
|
function treeItemBoxStyle(props) {
|
|
1555
1470
|
const {
|
|
@@ -1557,13 +1472,7 @@ function treeItemBoxStyle(props) {
|
|
|
1557
1472
|
} = props, {
|
|
1558
1473
|
space
|
|
1559
1474
|
} = theme.getTheme_v2(props.theme);
|
|
1560
|
-
return styledComponents.css`
|
|
1561
|
-
padding-left: ${_visualEditing.rem(space[2] * $level)};
|
|
1562
|
-
|
|
1563
|
-
&[data-as='a'] {
|
|
1564
|
-
text-decoration: none;
|
|
1565
|
-
}
|
|
1566
|
-
`;
|
|
1475
|
+
return styledComponents.css`padding-left:${_visualEditing.rem(space[2] * $level)};&[data-as='a']{text-decoration:none;}`;
|
|
1567
1476
|
}
|
|
1568
1477
|
function useTree() {
|
|
1569
1478
|
const tree = react.useContext(TreeContext);
|