@sanity/ui 2.15.8 → 2.15.9
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 +134 -134
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +134 -134
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +1 -1
- package/dist/_visual-editing.d.ts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +48 -48
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -49
- package/dist/index.mjs.map +1 -1
- package/dist/theme.js +431 -40
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +393 -4
- package/dist/theme.mjs.map +1 -1
- package/exports/_visual-editing.ts +15 -15
- package/package.json +31 -27
- package/src/core/_compat.ts +11 -11
- package/src/core/components/autocomplete/__mocks__/apiStore.ts +1 -1
- package/src/core/components/autocomplete/__workshop__/async.tsx +1 -0
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -1
- package/src/core/components/autocomplete/__workshop__/custom.tsx +2 -1
- package/src/core/components/autocomplete/__workshop__/example.tsx +2 -1
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +1 -0
- package/src/core/components/autocomplete/autocomplete.styles.tsx +2 -1
- package/src/core/components/autocomplete/autocomplete.tsx +3 -2
- package/src/core/components/autocomplete/autocompleteOption.tsx +1 -0
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +7 -0
- package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +1 -0
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +1 -0
- package/src/core/components/dialog/__workshop__/activate.tsx +2 -1
- package/src/core/components/dialog/__workshop__/panes.tsx +1 -0
- package/src/core/components/dialog/__workshop__/position.tsx +1 -0
- package/src/core/components/dialog/__workshop__/props.tsx +1 -0
- package/src/core/components/dialog/__workshop__/wrapped.tsx +1 -3
- package/src/core/components/dialog/dialog.tsx +3 -0
- package/src/core/components/dialog/dialogProvider.tsx +1 -0
- package/src/core/components/dialog/styles.ts +1 -0
- package/src/core/components/dialog/useDialog.ts +1 -0
- package/src/core/components/hotkeys/hotkeys.tsx +1 -0
- package/src/core/components/menu/__workshop__/asComponent.tsx +1 -0
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +1 -0
- package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +1 -0
- package/src/core/components/menu/__workshop__/customSelectedState.tsx +1 -0
- package/src/core/components/menu/__workshop__/menuButton.tsx +1 -0
- package/src/core/components/menu/__workshop__/shouldFocus.tsx +1 -0
- package/src/core/components/menu/__workshop__/tones.tsx +1 -0
- package/src/core/components/menu/menu.test.tsx +1 -0
- package/src/core/components/menu/menu.tsx +1 -0
- package/src/core/components/menu/menuButton.tsx +4 -3
- package/src/core/components/menu/menuGroup.tsx +1 -0
- package/src/core/components/menu/menuItem.tsx +1 -1
- package/src/core/components/menu/useMenu.ts +1 -0
- package/src/core/components/menu/useMenuController.ts +1 -0
- package/src/core/components/skeleton/__workshop__/delay.tsx +1 -0
- package/src/core/components/skeleton/__workshop__/skeleton.tsx +1 -0
- package/src/core/components/skeleton/skeleton.tsx +2 -2
- package/src/core/components/skeleton/textSkeleton.tsx +3 -2
- package/src/core/components/tab/tab.tsx +1 -0
- package/src/core/components/tab/tabList.tsx +2 -1
- package/src/core/components/tab/tabPanel.tsx +1 -0
- package/src/core/components/toast/__workshop__/toast.tsx +1 -0
- package/src/core/components/toast/styles.ts +2 -1
- package/src/core/components/toast/toast.tsx +4 -4
- package/src/core/components/toast/toastLayer.tsx +1 -0
- package/src/core/components/toast/toastProvider.tsx +1 -0
- package/src/core/components/toast/useToast.ts +1 -0
- package/src/core/components/tree/__workshop__/basic.tsx +1 -0
- package/src/core/components/tree/__workshop__/tabFromElement.tsx +2 -1
- package/src/core/components/tree/style.ts +1 -0
- 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 +3 -2
- package/src/core/components/tree/useTree.ts +1 -0
- package/src/core/helpers/focus.ts +2 -2
- package/src/core/hooks/useArrayProp.ts +1 -0
- package/src/core/hooks/useClickOutside.test.tsx +0 -1
- package/src/core/hooks/useClickOutside.ts +1 -0
- package/src/core/hooks/useClickOutsideEvent.test.tsx +0 -1
- package/src/core/hooks/useClickOutsideEvent.ts +1 -0
- package/src/core/hooks/useDelayed.test.ts +2 -1
- package/src/core/hooks/useDelayedState.ts +1 -2
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -0
- package/src/core/hooks/useElementSize.ts +2 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +2 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +1 -0
- package/src/core/hooks/usePrefersDark.test.tsx +2 -1
- package/src/core/hooks/usePrefersReducedMotion.test.tsx +2 -1
- package/src/core/index.ts +1 -2
- package/src/core/lib/createGlobalScopedContext.ts +2 -1
- package/src/core/primitives/_selectable/selectable.tsx +1 -0
- package/src/core/primitives/_selectable/style.ts +1 -0
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +1 -0
- package/src/core/primitives/avatar/__workshop__/stack.tsx +1 -0
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +1 -0
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -0
- package/src/core/primitives/avatar/avatar.tsx +2 -7
- package/src/core/primitives/avatar/avatarCounter.tsx +3 -2
- package/src/core/primitives/avatar/avatarStack.tsx +3 -2
- package/src/core/primitives/avatar/styles.ts +2 -1
- package/src/core/primitives/avatar/types.ts +1 -0
- package/src/core/primitives/badge/__workshop__/props.tsx +1 -0
- package/src/core/primitives/badge/__workshop__/tones.tsx +1 -0
- package/src/core/primitives/badge/badge.test.tsx +1 -0
- package/src/core/primitives/badge/badge.tsx +1 -0
- package/src/core/primitives/badge/styles.ts +1 -0
- package/src/core/primitives/box/__workshop__/props.tsx +1 -0
- package/src/core/primitives/box/box.tsx +3 -2
- package/src/core/primitives/button/__workshop__/custom.tsx +3 -0
- package/src/core/primitives/button/__workshop__/disabled.tsx +1 -0
- package/src/core/primitives/button/__workshop__/props.tsx +2 -1
- package/src/core/primitives/button/__workshop__/stacked.tsx +1 -0
- package/src/core/primitives/button/button.test.tsx +1 -0
- package/src/core/primitives/button/button.tsx +1 -0
- package/src/core/primitives/button/styles.ts +1 -0
- package/src/core/primitives/card/__workshop__/asButton.tsx +1 -0
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +1 -0
- package/src/core/primitives/card/__workshop__/props.tsx +3 -1
- package/src/core/primitives/card/__workshop__/selected.tsx +2 -2
- package/src/core/primitives/card/card.tsx +1 -0
- package/src/core/primitives/card/styles.ts +1 -0
- package/src/core/primitives/checkbox/checkbox.tsx +1 -0
- package/src/core/primitives/checkbox/styles.ts +1 -0
- package/src/core/primitives/code/__workshop__/props.tsx +1 -0
- package/src/core/primitives/code/code.tsx +2 -1
- package/src/core/primitives/container/__workshop__/example.tsx +1 -0
- package/src/core/primitives/container/container.tsx +1 -0
- package/src/core/primitives/container/styles.ts +2 -1
- package/src/core/primitives/flex/__workshop__/example.tsx +1 -0
- package/src/core/primitives/flex/flex.tsx +2 -1
- package/src/core/primitives/grid/grid.tsx +1 -0
- package/src/core/primitives/heading/__workshop__/plain.tsx +2 -1
- package/src/core/primitives/heading/heading.tsx +1 -0
- package/src/core/primitives/heading/styles.ts +1 -0
- package/src/core/primitives/inline/__workshop__/plain.tsx +1 -0
- package/src/core/primitives/inline/inline.tsx +2 -1
- package/src/core/primitives/inline/styles.ts +2 -1
- package/src/core/primitives/kbd/kbd.tsx +2 -1
- package/src/core/primitives/label/__workshop__/plain.tsx +2 -1
- package/src/core/primitives/label/label.tsx +1 -0
- package/src/core/primitives/label/styles.ts +1 -0
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +1 -0
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +1 -0
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +1 -0
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +4 -1
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +1 -0
- package/src/core/primitives/popover/floating-ui/size.ts +2 -1
- package/src/core/primitives/popover/popover.tsx +6 -7
- package/src/core/primitives/popover/popoverCard.tsx +2 -1
- package/src/core/primitives/radio/radio.tsx +2 -1
- package/src/core/primitives/radio/styles.ts +1 -0
- package/src/core/primitives/select/select.tsx +2 -1
- package/src/core/primitives/select/styles.ts +3 -3
- package/src/core/primitives/spinner/__workshop__/Props.tsx +1 -0
- package/src/core/primitives/spinner/spinner.tsx +2 -1
- package/src/core/primitives/stack/__workshop__/plain.tsx +1 -0
- package/src/core/primitives/stack/stack.tsx +2 -1
- package/src/core/primitives/stack/styles.ts +2 -1
- package/src/core/primitives/switch/styles.ts +1 -0
- package/src/core/primitives/switch/switch.tsx +2 -1
- package/src/core/primitives/text/__workshop__/colored.tsx +3 -2
- package/src/core/primitives/text/__workshop__/example.tsx +1 -0
- package/src/core/primitives/text/styles.ts +1 -0
- package/src/core/primitives/text/text.tsx +1 -0
- package/src/core/primitives/textArea/__workshop__/plain.tsx +1 -0
- package/src/core/primitives/textArea/textArea.tsx +6 -5
- package/src/core/primitives/textInput/__workshop__/plain.tsx +2 -1
- package/src/core/primitives/textInput/__workshop__/typed.tsx +1 -0
- package/src/core/primitives/textInput/textInput.tsx +1 -0
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +1 -0
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +1 -0
- package/src/core/primitives/tooltip/__workshop__/props.tsx +3 -2
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -0
- package/src/core/primitives/tooltip/tooltip.test.tsx +4 -2
- package/src/core/primitives/tooltip/tooltip.tsx +6 -5
- package/src/core/primitives/tooltip/tooltipCard.tsx +2 -1
- package/src/core/primitives/tooltip/tooltipDelayGroup/index.ts +1 -1
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +1 -0
- package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +1 -0
- package/src/core/styles/border/borderStyle.ts +1 -0
- package/src/core/styles/box/boxStyle.ts +1 -0
- package/src/core/styles/card/_cardColorStyle.ts +1 -2
- package/src/core/styles/flex/flexItemStyle.ts +1 -0
- package/src/core/styles/flex/flexStyle.ts +2 -1
- package/src/core/styles/flex/index.ts +1 -1
- package/src/core/styles/flex/types.ts +1 -0
- package/src/core/styles/font/codeFontStyle.ts +1 -0
- package/src/core/styles/font/headingFontStyle.ts +1 -0
- package/src/core/styles/font/labelFontStyle.ts +1 -0
- package/src/core/styles/font/responsiveFont.ts +3 -3
- package/src/core/styles/font/textAlignStyle.ts +1 -0
- package/src/core/styles/font/textFontStyle.ts +1 -0
- package/src/core/styles/font/types.ts +1 -0
- package/src/core/styles/grid/gridItemStyle.ts +1 -0
- package/src/core/styles/grid/gridStyle.ts +2 -1
- package/src/core/styles/grid/index.ts +1 -1
- package/src/core/styles/helpers.ts +2 -2
- package/src/core/styles/input/responsiveInputPaddingStyle.ts +2 -1
- package/src/core/styles/input/textInputStyle.ts +3 -3
- package/src/core/styles/margin/marginStyle.ts +1 -0
- package/src/core/styles/margin/marginsStyle.test.ts +1 -0
- package/src/core/styles/padding/paddingStyle.test.ts +1 -0
- package/src/core/styles/padding/paddingStyle.ts +1 -0
- package/src/core/styles/radius/radiusStyle.ts +1 -0
- package/src/core/styles/shadow/shadowStyle.ts +3 -3
- package/src/core/theme/__workshop__/build/Root.tsx +1 -1
- package/src/core/theme/__workshop__/build/story.tsx +18 -9
- package/src/core/theme/__workshop__/canvas.tsx +7 -6
- package/src/core/theme/__workshop__/debug/story.tsx +5 -3
- package/src/core/theme/index.ts +1 -1
- package/src/core/theme/theme.test.tsx +1 -0
- package/src/core/theme/themeColorProvider.tsx +1 -0
- package/src/core/theme/themeProvider.tsx +3 -2
- package/src/core/theme/useRootTheme.ts +1 -0
- package/src/core/theme/useTheme.ts +1 -1
- package/src/core/utils/arrow/arrow.tsx +4 -3
- package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +1 -0
- package/src/core/utils/boundaryElement/index.ts +1 -1
- package/src/core/utils/boundaryElement/useBoundaryElement.ts +1 -0
- package/src/core/utils/elementQuery/elementQuery.tsx +1 -0
- package/src/core/utils/errorBoundary.tsx +1 -0
- package/src/core/utils/layer/__workshop__/multipleRoots.tsx +1 -0
- package/src/core/utils/layer/__workshop__/nested.tsx +1 -0
- package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +1 -0
- package/src/core/utils/layer/index.ts +1 -1
- package/src/core/utils/layer/layer.tsx +1 -0
- package/src/core/utils/layer/layerProvider.tsx +2 -1
- package/src/core/utils/layer/useLayer.ts +1 -0
- package/src/core/utils/portal/portal.ts +1 -0
- package/src/core/utils/portal/portalProvider.tsx +1 -0
- package/src/core/utils/portal/usePortal.ts +1 -0
- package/src/core/utils/virtualList/virtualList.tsx +1 -0
- package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +1 -1
- package/src/theme/build/_deprecated/color/card/createCardStates.ts +1 -1
- package/src/theme/build/_deprecated/color/factory.ts +6 -6
- package/src/theme/build/buildColorTheme.ts +15 -15
- package/src/theme/build/colorToken/colorToken.ts +1 -1
- package/src/theme/build/mixThemeColor.ts +1 -1
- package/src/theme/build/renderColorTheme.ts +7 -6
- package/src/theme/build/renderColorValue.ts +3 -2
- package/src/theme/build/resolveColorTokens.ts +5 -4
- package/src/theme/config/helpers.ts +2 -2
- package/src/theme/config/system.ts +2 -1
- package/src/theme/config/tokens/color/types.ts +2 -1
- package/src/theme/config/tokens/types.ts +2 -1
- package/src/theme/config/types.ts +2 -1
- package/src/theme/system/color/_helpers.ts +1 -0
- package/src/theme/system/color/_system.ts +1 -1
- package/src/theme/system/color/color.ts +1 -1
- package/src/theme/system/index.ts +1 -2
- package/src/theme/system/theme.ts +2 -2
- package/src/theme/system/v0/color/index.ts +1 -1
- package/src/theme/system/v0/index.ts +1 -1
- package/src/theme/versioning/themeColor_v0_v2.ts +5 -5
- package/dist/_chunks-cjs/getTheme_v2.js +0 -397
- package/dist/_chunks-cjs/getTheme_v2.js.map +0 -1
- package/dist/_chunks-es/getTheme_v2.mjs +0 -398
- package/dist/_chunks-es/getTheme_v2.mjs.map +0 -1
- package/src/core/__workshop__/fontsPlugin.tsx +0 -76
- /package/src/core/components/autocomplete/{__fixtures__ → __mocks__}/countries.ts +0 -0
- /package/src/core/primitives/kbd/{index.tsx → index.ts} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { buildTheme, createColorTheme as createColorTheme$1, hexToRgb as hexToRgb$1, hslToRgb as hslToRgb$1, multiply as multiply$1, parseColor as parseColor$1, rgbToHex as rgbToHex$1, rgbToHsl as rgbToHsl$1, rgba as rgba$1, screen as screen$1, getTheme_v2, getScopedTheme } from "@sanity/ui/theme";
|
|
1
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
3
|
import { c } from "react-compiler-runtime";
|
|
3
4
|
import { useState, useEffect, useDebugValue, useMemo, useSyncExternalStore, createContext, useContext, forwardRef, useId, Children, isValidElement, cloneElement, useRef, useImperativeHandle, lazy, Suspense, memo, useCallback, useLayoutEffect } from "react";
|
|
4
5
|
import { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1, css, styled, keyframes } from "styled-components";
|
|
5
|
-
import { buildTheme, createColorTheme as createColorTheme$1, hexToRgb as hexToRgb$1, hslToRgb as hslToRgb$1, multiply as multiply$1, parseColor as parseColor$1, rgbToHex as rgbToHex$1, rgbToHsl as rgbToHsl$1, rgba as rgba$1, screen as screen$1, getTheme_v2, getScopedTheme } from "@sanity/ui/theme";
|
|
6
6
|
import ReactIs, { isValidElementType } from "react-is";
|
|
7
7
|
import { SpinnerIcon, CheckmarkIcon, RemoveIcon, ChevronDownIcon, CloseIcon, ChevronRightIcon } from "@sanity/icons";
|
|
8
8
|
import { detectOverflow, flip, offset, shift, arrow, hide, useFloating, autoUpdate } from "@floating-ui/react-dom";
|
|
@@ -47,6 +47,35 @@ const createColorTheme = createColorTheme$1, hexToRgb = hexToRgb$1, hslToRgb = h
|
|
|
47
47
|
bounce: 0.25
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
+
function _isEnterToClickElement(element) {
|
|
51
|
+
return isHTMLAnchorElement(element) || isHTMLButtonElement(element);
|
|
52
|
+
}
|
|
53
|
+
function isHTMLElement(node) {
|
|
54
|
+
return node instanceof Node && node.nodeType === Node.ELEMENT_NODE;
|
|
55
|
+
}
|
|
56
|
+
function isHTMLAnchorElement(element) {
|
|
57
|
+
return isHTMLElement(element) && element.nodeName === "A";
|
|
58
|
+
}
|
|
59
|
+
function isHTMLInputElement(element) {
|
|
60
|
+
return isHTMLElement(element) && element.nodeName === "INPUT";
|
|
61
|
+
}
|
|
62
|
+
function isHTMLButtonElement(element) {
|
|
63
|
+
return isHTMLElement(element) && element.nodeName === "BUTTON";
|
|
64
|
+
}
|
|
65
|
+
function isHTMLSelectElement(element) {
|
|
66
|
+
return isHTMLElement(element) && element.nodeName === "SELECT";
|
|
67
|
+
}
|
|
68
|
+
function isHTMLTextAreaElement(element) {
|
|
69
|
+
return isHTMLElement(element) && element.nodeName === "TEXTAREA";
|
|
70
|
+
}
|
|
71
|
+
function containsOrEqualsElement(element, node) {
|
|
72
|
+
return element.contains(node) || element === node;
|
|
73
|
+
}
|
|
74
|
+
function _isScrollable(el) {
|
|
75
|
+
if (!(el instanceof Element)) return !1;
|
|
76
|
+
const style = window.getComputedStyle(el);
|
|
77
|
+
return style.overflowX.includes("auto") || style.overflowX.includes("scroll") || style.overflowY.includes("auto") || style.overflowY.includes("scroll");
|
|
78
|
+
}
|
|
50
79
|
function _fillCSSObject(keys, value) {
|
|
51
80
|
return keys.reduce((style, key2) => (style[key2] = value, style), {});
|
|
52
81
|
}
|
|
@@ -568,12 +597,27 @@ function responsiveBoxOverflowStyle(props) {
|
|
|
568
597
|
}));
|
|
569
598
|
}
|
|
570
599
|
const BASE_STYLE$3 = {
|
|
600
|
+
minWidth: 0,
|
|
601
|
+
minHeight: 0
|
|
602
|
+
};
|
|
603
|
+
function flexItemStyle() {
|
|
604
|
+
return [BASE_STYLE$3, responsiveFlexItemStyle];
|
|
605
|
+
}
|
|
606
|
+
function responsiveFlexItemStyle(props) {
|
|
607
|
+
const {
|
|
608
|
+
media
|
|
609
|
+
} = getTheme_v2(props.theme);
|
|
610
|
+
return props.$flex ? _responsive(media, props.$flex, (flex) => ({
|
|
611
|
+
flex
|
|
612
|
+
})) : EMPTY_ARRAY;
|
|
613
|
+
}
|
|
614
|
+
const BASE_STYLE$2 = {
|
|
571
615
|
"&&:not([hidden])": {
|
|
572
616
|
display: "flex"
|
|
573
617
|
}
|
|
574
618
|
};
|
|
575
619
|
function responsiveFlexStyle() {
|
|
576
|
-
return [BASE_STYLE$
|
|
620
|
+
return [BASE_STYLE$2, responsiveFlexAlignStyle, responsiveFlexGapStyle, responsiveFlexWrapStyle, responsiveFlexJustifyStyle, responsiveFlexDirectionStyle];
|
|
577
621
|
}
|
|
578
622
|
function responsiveFlexAlignStyle(props) {
|
|
579
623
|
const {
|
|
@@ -616,21 +660,6 @@ function responsiveFlexDirectionStyle(props) {
|
|
|
616
660
|
flexDirection: direction
|
|
617
661
|
}));
|
|
618
662
|
}
|
|
619
|
-
const BASE_STYLE$2 = {
|
|
620
|
-
minWidth: 0,
|
|
621
|
-
minHeight: 0
|
|
622
|
-
};
|
|
623
|
-
function flexItemStyle() {
|
|
624
|
-
return [BASE_STYLE$2, responsiveFlexItemStyle];
|
|
625
|
-
}
|
|
626
|
-
function responsiveFlexItemStyle(props) {
|
|
627
|
-
const {
|
|
628
|
-
media
|
|
629
|
-
} = getTheme_v2(props.theme);
|
|
630
|
-
return props.$flex ? _responsive(media, props.$flex, (flex) => ({
|
|
631
|
-
flex
|
|
632
|
-
})) : EMPTY_ARRAY;
|
|
633
|
-
}
|
|
634
663
|
function focusRingBorderStyle(border2) {
|
|
635
664
|
return `inset 0 0 0 ${border2.width}px ${border2.color}`;
|
|
636
665
|
}
|
|
@@ -642,6 +671,68 @@ function focusRingStyle(opts) {
|
|
|
642
671
|
} = opts, focusRingOutsetWidth = focusRing.offset + focusRing.width, focusRingInsetWidth = 0 - focusRing.offset, bgColor = base ? base.bg : "var(--card-bg-color)";
|
|
643
672
|
return [focusRingInsetWidth > 0 && `inset 0 0 0 ${focusRingInsetWidth}px var(--card-focus-ring-color)`, border2 && focusRingBorderStyle(border2), focusRingInsetWidth < 0 && `0 0 0 ${0 - focusRingInsetWidth}px ${bgColor}`, focusRingOutsetWidth > 0 && `0 0 0 ${focusRingOutsetWidth}px var(--card-focus-ring-color)`].filter(Boolean).join(",");
|
|
644
673
|
}
|
|
674
|
+
function responsiveGridItemStyle() {
|
|
675
|
+
return [responsiveGridItemRowStyle, responsiveGridItemRowStartStyle, responsiveGridItemRowEndStyle, responsiveGridItemColumnStyle, responsiveGridItemColumnStartStyle, responsiveGridItemColumnEndStyle];
|
|
676
|
+
}
|
|
677
|
+
const GRID_ITEM_ROW = {
|
|
678
|
+
auto: "auto",
|
|
679
|
+
full: "1 / -1"
|
|
680
|
+
}, GRID_ITEM_COLUMN = {
|
|
681
|
+
auto: "auto",
|
|
682
|
+
full: "1 / -1"
|
|
683
|
+
};
|
|
684
|
+
function responsiveGridItemRowStyle(props) {
|
|
685
|
+
const {
|
|
686
|
+
media
|
|
687
|
+
} = getTheme_v2(props.theme);
|
|
688
|
+
return _responsive(media, props.$row, (row) => typeof row == "number" ? {
|
|
689
|
+
gridRow: `span ${row} / span ${row}`
|
|
690
|
+
} : {
|
|
691
|
+
gridRow: GRID_ITEM_ROW[row]
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
function responsiveGridItemRowStartStyle(props) {
|
|
695
|
+
const {
|
|
696
|
+
media
|
|
697
|
+
} = getTheme_v2(props.theme);
|
|
698
|
+
return _responsive(media, props.$rowStart, (rowStart) => ({
|
|
699
|
+
gridRowStart: rowStart
|
|
700
|
+
}));
|
|
701
|
+
}
|
|
702
|
+
function responsiveGridItemRowEndStyle(props) {
|
|
703
|
+
const {
|
|
704
|
+
media
|
|
705
|
+
} = getTheme_v2(props.theme);
|
|
706
|
+
return _responsive(media, props.$rowEnd, (rowEnd) => ({
|
|
707
|
+
gridRowEnd: rowEnd
|
|
708
|
+
}));
|
|
709
|
+
}
|
|
710
|
+
function responsiveGridItemColumnStyle(props) {
|
|
711
|
+
const {
|
|
712
|
+
media
|
|
713
|
+
} = getTheme_v2(props.theme);
|
|
714
|
+
return _responsive(media, props.$column, (column) => typeof column == "number" ? {
|
|
715
|
+
gridColumn: `span ${column} / span ${column}`
|
|
716
|
+
} : {
|
|
717
|
+
gridColumn: GRID_ITEM_COLUMN[column]
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
function responsiveGridItemColumnStartStyle(props) {
|
|
721
|
+
const {
|
|
722
|
+
media
|
|
723
|
+
} = getTheme_v2(props.theme);
|
|
724
|
+
return _responsive(media, props.$columnStart, (columnStart) => ({
|
|
725
|
+
gridColumnStart: columnStart
|
|
726
|
+
}));
|
|
727
|
+
}
|
|
728
|
+
function responsiveGridItemColumnEndStyle(props) {
|
|
729
|
+
const {
|
|
730
|
+
media
|
|
731
|
+
} = getTheme_v2(props.theme);
|
|
732
|
+
return _responsive(media, props.$columnEnd, (columnEnd) => ({
|
|
733
|
+
gridColumnEnd: columnEnd
|
|
734
|
+
}));
|
|
735
|
+
}
|
|
645
736
|
const GRID_CSS = {
|
|
646
737
|
"&&:not([hidden])": {
|
|
647
738
|
display: "grid"
|
|
@@ -730,68 +821,6 @@ function responsiveGridGapYStyle(props) {
|
|
|
730
821
|
rowGap: gapY ? rem(space[gapY]) : void 0
|
|
731
822
|
}));
|
|
732
823
|
}
|
|
733
|
-
function responsiveGridItemStyle() {
|
|
734
|
-
return [responsiveGridItemRowStyle, responsiveGridItemRowStartStyle, responsiveGridItemRowEndStyle, responsiveGridItemColumnStyle, responsiveGridItemColumnStartStyle, responsiveGridItemColumnEndStyle];
|
|
735
|
-
}
|
|
736
|
-
const GRID_ITEM_ROW = {
|
|
737
|
-
auto: "auto",
|
|
738
|
-
full: "1 / -1"
|
|
739
|
-
}, GRID_ITEM_COLUMN = {
|
|
740
|
-
auto: "auto",
|
|
741
|
-
full: "1 / -1"
|
|
742
|
-
};
|
|
743
|
-
function responsiveGridItemRowStyle(props) {
|
|
744
|
-
const {
|
|
745
|
-
media
|
|
746
|
-
} = getTheme_v2(props.theme);
|
|
747
|
-
return _responsive(media, props.$row, (row) => typeof row == "number" ? {
|
|
748
|
-
gridRow: `span ${row} / span ${row}`
|
|
749
|
-
} : {
|
|
750
|
-
gridRow: GRID_ITEM_ROW[row]
|
|
751
|
-
});
|
|
752
|
-
}
|
|
753
|
-
function responsiveGridItemRowStartStyle(props) {
|
|
754
|
-
const {
|
|
755
|
-
media
|
|
756
|
-
} = getTheme_v2(props.theme);
|
|
757
|
-
return _responsive(media, props.$rowStart, (rowStart) => ({
|
|
758
|
-
gridRowStart: rowStart
|
|
759
|
-
}));
|
|
760
|
-
}
|
|
761
|
-
function responsiveGridItemRowEndStyle(props) {
|
|
762
|
-
const {
|
|
763
|
-
media
|
|
764
|
-
} = getTheme_v2(props.theme);
|
|
765
|
-
return _responsive(media, props.$rowEnd, (rowEnd) => ({
|
|
766
|
-
gridRowEnd: rowEnd
|
|
767
|
-
}));
|
|
768
|
-
}
|
|
769
|
-
function responsiveGridItemColumnStyle(props) {
|
|
770
|
-
const {
|
|
771
|
-
media
|
|
772
|
-
} = getTheme_v2(props.theme);
|
|
773
|
-
return _responsive(media, props.$column, (column) => typeof column == "number" ? {
|
|
774
|
-
gridColumn: `span ${column} / span ${column}`
|
|
775
|
-
} : {
|
|
776
|
-
gridColumn: GRID_ITEM_COLUMN[column]
|
|
777
|
-
});
|
|
778
|
-
}
|
|
779
|
-
function responsiveGridItemColumnStartStyle(props) {
|
|
780
|
-
const {
|
|
781
|
-
media
|
|
782
|
-
} = getTheme_v2(props.theme);
|
|
783
|
-
return _responsive(media, props.$columnStart, (columnStart) => ({
|
|
784
|
-
gridColumnStart: columnStart
|
|
785
|
-
}));
|
|
786
|
-
}
|
|
787
|
-
function responsiveGridItemColumnEndStyle(props) {
|
|
788
|
-
const {
|
|
789
|
-
media
|
|
790
|
-
} = getTheme_v2(props.theme);
|
|
791
|
-
return _responsive(media, props.$columnEnd, (columnEnd) => ({
|
|
792
|
-
gridColumnEnd: columnEnd
|
|
793
|
-
}));
|
|
794
|
-
}
|
|
795
824
|
function responsiveInputPaddingStyle(props) {
|
|
796
825
|
const {
|
|
797
826
|
$fontSize,
|
|
@@ -3000,47 +3029,6 @@ function getLayerContext(contextValue) {
|
|
|
3000
3029
|
throw new Error("could not get layer context");
|
|
3001
3030
|
}
|
|
3002
3031
|
const LayerContext = createGlobalScopedContext("@sanity/ui/context/layer", null);
|
|
3003
|
-
function useLayer() {
|
|
3004
|
-
const $ = c(2), value = useContext(LayerContext);
|
|
3005
|
-
if (!value)
|
|
3006
|
-
throw new Error("useLayer(): missing context value");
|
|
3007
|
-
try {
|
|
3008
|
-
let t1;
|
|
3009
|
-
return $[0] !== value ? (t1 = getLayerContext(value), $[0] = value, $[1] = t1) : t1 = $[1], t1;
|
|
3010
|
-
} catch (t0) {
|
|
3011
|
-
const err = t0;
|
|
3012
|
-
throw err instanceof Error ? new Error(`useLayer(): ${err.message}`) : new Error(`useLayer(): ${err}`);
|
|
3013
|
-
}
|
|
3014
|
-
}
|
|
3015
|
-
function _isEnterToClickElement(element) {
|
|
3016
|
-
return isHTMLAnchorElement(element) || isHTMLButtonElement(element);
|
|
3017
|
-
}
|
|
3018
|
-
function isHTMLElement(node) {
|
|
3019
|
-
return node instanceof Node && node.nodeType === Node.ELEMENT_NODE;
|
|
3020
|
-
}
|
|
3021
|
-
function isHTMLAnchorElement(element) {
|
|
3022
|
-
return isHTMLElement(element) && element.nodeName === "A";
|
|
3023
|
-
}
|
|
3024
|
-
function isHTMLInputElement(element) {
|
|
3025
|
-
return isHTMLElement(element) && element.nodeName === "INPUT";
|
|
3026
|
-
}
|
|
3027
|
-
function isHTMLButtonElement(element) {
|
|
3028
|
-
return isHTMLElement(element) && element.nodeName === "BUTTON";
|
|
3029
|
-
}
|
|
3030
|
-
function isHTMLSelectElement(element) {
|
|
3031
|
-
return isHTMLElement(element) && element.nodeName === "SELECT";
|
|
3032
|
-
}
|
|
3033
|
-
function isHTMLTextAreaElement(element) {
|
|
3034
|
-
return isHTMLElement(element) && element.nodeName === "TEXTAREA";
|
|
3035
|
-
}
|
|
3036
|
-
function containsOrEqualsElement(element, node) {
|
|
3037
|
-
return element.contains(node) || element === node;
|
|
3038
|
-
}
|
|
3039
|
-
function _isScrollable(el) {
|
|
3040
|
-
if (!(el instanceof Element)) return !1;
|
|
3041
|
-
const style = window.getComputedStyle(el);
|
|
3042
|
-
return style.overflowX.includes("auto") || style.overflowX.includes("scroll") || style.overflowY.includes("auto") || style.overflowY.includes("scroll");
|
|
3043
|
-
}
|
|
3044
3032
|
function LayerProvider(props) {
|
|
3045
3033
|
const $ = c(19), {
|
|
3046
3034
|
children,
|
|
@@ -3093,6 +3081,18 @@ function _temp$3(v) {
|
|
|
3093
3081
|
return v + 1;
|
|
3094
3082
|
}
|
|
3095
3083
|
LayerProvider.displayName = "LayerProvider";
|
|
3084
|
+
function useLayer() {
|
|
3085
|
+
const $ = c(2), value = useContext(LayerContext);
|
|
3086
|
+
if (!value)
|
|
3087
|
+
throw new Error("useLayer(): missing context value");
|
|
3088
|
+
try {
|
|
3089
|
+
let t1;
|
|
3090
|
+
return $[0] !== value ? (t1 = getLayerContext(value), $[0] = value, $[1] = t1) : t1 = $[1], t1;
|
|
3091
|
+
} catch (t0) {
|
|
3092
|
+
const err = t0;
|
|
3093
|
+
throw err instanceof Error ? new Error(`useLayer(): ${err.message}`) : new Error(`useLayer(): ${err}`);
|
|
3094
|
+
}
|
|
3095
|
+
}
|
|
3096
3096
|
const StyledLayer = /* @__PURE__ */ styled.div.withConfig({
|
|
3097
3097
|
displayName: "StyledLayer",
|
|
3098
3098
|
componentId: "sc-16kojrv-0"
|
|
@@ -4491,9 +4491,6 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
|
|
|
4491
4491
|
}));
|
|
4492
4492
|
TooltipCard.displayName = "Memo(ForwardRef(TooltipCard))";
|
|
4493
4493
|
const TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
|
|
4494
|
-
function useTooltipDelayGroup() {
|
|
4495
|
-
return useContext(TooltipDelayGroupContext);
|
|
4496
|
-
}
|
|
4497
4494
|
function TooltipDelayGroupProvider(props) {
|
|
4498
4495
|
const $ = c(10), {
|
|
4499
4496
|
children,
|
|
@@ -4515,6 +4512,9 @@ function TooltipDelayGroupProvider(props) {
|
|
|
4515
4512
|
return $[7] !== children || $[8] !== value ? (t3 = /* @__PURE__ */ jsx(TooltipDelayGroupContext.Provider, { value, children }), $[7] = children, $[8] = value, $[9] = t3) : t3 = $[9], t3;
|
|
4516
4513
|
}
|
|
4517
4514
|
TooltipDelayGroupProvider.displayName = "TooltipDelayGroupProvider";
|
|
4515
|
+
function useTooltipDelayGroup() {
|
|
4516
|
+
return useContext(TooltipDelayGroupContext);
|
|
4517
|
+
}
|
|
4518
4518
|
const StyledTooltip = styled(Layer).withConfig({
|
|
4519
4519
|
displayName: "StyledTooltip",
|
|
4520
4520
|
componentId: "sc-13f2zvh-0"
|
|
@@ -5145,7 +5145,7 @@ function MenuGroup(props) {
|
|
|
5145
5145
|
}
|
|
5146
5146
|
MenuGroup.displayName = "MenuGroup";
|
|
5147
5147
|
const MenuItem = forwardRef(function(props, forwardedRef) {
|
|
5148
|
-
const $ = c(
|
|
5148
|
+
const $ = c(73);
|
|
5149
5149
|
let IconComponent, IconRightComponent, children, disabled, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, pressed, restProps, selectedProp, t0, t1, t2, t3, t4, t5, text;
|
|
5150
5150
|
$[0] !== props ? ({
|
|
5151
5151
|
as: t0,
|
|
@@ -5207,9 +5207,9 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
|
|
|
5207
5207
|
$[43] === Symbol.for("react.memo_cache_sentinel") ? (t14 = (el) => {
|
|
5208
5208
|
ref.current = el, setRootElement(el);
|
|
5209
5209
|
}, $[43] = t14) : t14 = $[43];
|
|
5210
|
-
const setRef = t14, t15 = as
|
|
5211
|
-
let
|
|
5212
|
-
$[44] !== IconComponent || $[45] !== IconRightComponent || $[46] !== fontSize2 || $[47] !== hotkeys || $[48] !== hotkeysFontSize || $[49] !== paddingProps || $[50] !== space || $[51] !== text ? (
|
|
5210
|
+
const setRef = t14, t15 = as !== "button" && pressed ? "" : void 0, t16 = active ? "" : void 0, t17 = disabled ? "" : void 0, t18 = useArrayProp(radius), t19 = useArrayProp(0), t20 = disabled ? "default" : tone, t21 = as === "button" ? "button" : void 0;
|
|
5211
|
+
let t22;
|
|
5212
|
+
$[44] !== IconComponent || $[45] !== IconRightComponent || $[46] !== fontSize2 || $[47] !== hotkeys || $[48] !== hotkeysFontSize || $[49] !== paddingProps || $[50] !== space || $[51] !== text ? (t22 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
|
|
5213
5213
|
IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
|
|
5214
5214
|
isValidElement(IconComponent) && IconComponent,
|
|
5215
5215
|
isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
|
|
@@ -5223,14 +5223,14 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
|
|
|
5223
5223
|
isValidElement(IconRightComponent) && IconRightComponent,
|
|
5224
5224
|
isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
|
|
5225
5225
|
] })
|
|
5226
|
-
] }), $[44] = IconComponent, $[45] = IconRightComponent, $[46] = fontSize2, $[47] = hotkeys, $[48] = hotkeysFontSize, $[49] = paddingProps, $[50] = space, $[51] = text, $[52] =
|
|
5226
|
+
] }), $[44] = IconComponent, $[45] = IconRightComponent, $[46] = fontSize2, $[47] = hotkeys, $[48] = hotkeysFontSize, $[49] = paddingProps, $[50] = space, $[51] = text, $[52] = t22) : t22 = $[52];
|
|
5227
|
+
let t23;
|
|
5228
|
+
$[53] !== children || $[54] !== paddingProps ? (t23 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...paddingProps, children }), $[53] = children, $[54] = paddingProps, $[55] = t23) : t23 = $[55];
|
|
5227
5229
|
let t24;
|
|
5228
|
-
$[
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
t24
|
|
5233
|
-
] }), $[56] = as, $[57] = disabled, $[58] = handleClick, $[59] = onItemMouseEnter, $[60] = onItemMouseLeave, $[61] = restProps, $[62] = scheme, $[63] = t15, $[64] = t16, $[65] = t17, $[66] = t18, $[67] = t19, $[68] = t20, $[69] = t21, $[70] = t22, $[71] = t23, $[72] = t24, $[73] = t25) : t25 = $[73], t25;
|
|
5230
|
+
return $[56] !== as || $[57] !== disabled || $[58] !== handleClick || $[59] !== onItemMouseEnter || $[60] !== onItemMouseLeave || $[61] !== restProps || $[62] !== scheme || $[63] !== t15 || $[64] !== t16 || $[65] !== t17 || $[66] !== t18 || $[67] !== t19 || $[68] !== t20 || $[69] !== t21 || $[70] !== t22 || $[71] !== t23 ? (t24 = /* @__PURE__ */ jsxs(Selectable, { "data-ui": "MenuItem", role: "menuitem", ...restProps, "data-pressed": t15, "data-selected": t16, "data-disabled": t17, forwardedAs: as, $radius: t18, $padding: t19, $tone: t20, $scheme: scheme, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, tabIndex: -1, type: t21, children: [
|
|
5231
|
+
t22,
|
|
5232
|
+
t23
|
|
5233
|
+
] }), $[56] = as, $[57] = disabled, $[58] = handleClick, $[59] = onItemMouseEnter, $[60] = onItemMouseLeave, $[61] = restProps, $[62] = scheme, $[63] = t15, $[64] = t16, $[65] = t17, $[66] = t18, $[67] = t19, $[68] = t20, $[69] = t21, $[70] = t22, $[71] = t23, $[72] = t24) : t24 = $[72], t24;
|
|
5234
5234
|
});
|
|
5235
5235
|
MenuItem.displayName = "ForwardRef(MenuItem)";
|
|
5236
5236
|
function _temp(s) {
|