@sanity/ui 2.8.6 → 2.8.7
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/index.d.mts +48 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.esm.js +121 -32
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +121 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +121 -32
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/core/components/autocomplete/autocomplete.tsx +2 -0
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +1 -0
- package/src/core/components/dialog/dialog.tsx +3 -0
- package/src/core/components/dialog/dialogProvider.tsx +2 -0
- package/src/core/components/hotkeys/hotkeys.tsx +1 -0
- package/src/core/components/menu/menu.tsx +1 -0
- package/src/core/components/menu/menuButton.tsx +1 -0
- package/src/core/components/menu/menuDivider.ts +1 -0
- package/src/core/components/menu/menuGroup.tsx +2 -0
- package/src/core/components/menu/menuItem.tsx +1 -0
- package/src/core/components/skeleton/skeleton.tsx +1 -0
- package/src/core/components/skeleton/textSkeleton.tsx +4 -0
- package/src/core/components/tab/tab.tsx +1 -0
- package/src/core/components/tab/tabList.tsx +1 -0
- package/src/core/components/tab/tabPanel.tsx +1 -0
- package/src/core/components/toast/toast.tsx +2 -0
- package/src/core/components/toast/toastProvider.tsx +2 -0
- package/src/core/components/tree/tree.tsx +1 -2
- package/src/core/components/tree/treeItem.tsx +1 -0
- package/src/core/primitives/_selectable/selectable.tsx +1 -0
- package/src/core/primitives/avatar/avatar.tsx +1 -0
- package/src/core/primitives/avatar/avatarCounter.tsx +1 -0
- package/src/core/primitives/avatar/avatarStack.tsx +1 -0
- package/src/core/primitives/badge/badge.tsx +1 -0
- package/src/core/primitives/box/box.tsx +1 -0
- package/src/core/primitives/button/button.tsx +1 -0
- package/src/core/primitives/card/card.tsx +1 -0
- package/src/core/primitives/checkbox/checkbox.tsx +1 -0
- package/src/core/primitives/code/code.tsx +1 -0
- package/src/core/primitives/container/container.tsx +1 -0
- package/src/core/primitives/flex/flex.tsx +1 -0
- package/src/core/primitives/grid/grid.tsx +1 -0
- package/src/core/primitives/heading/heading.tsx +1 -0
- package/src/core/primitives/inline/inline.tsx +1 -0
- package/src/core/primitives/kbd/kbd.tsx +1 -0
- package/src/core/primitives/label/label.tsx +1 -0
- package/src/core/primitives/popover/popover.tsx +1 -2
- package/src/core/primitives/popover/popoverCard.tsx +1 -2
- package/src/core/primitives/radio/radio.tsx +1 -0
- package/src/core/primitives/select/select.tsx +1 -0
- package/src/core/primitives/spinner/spinner.tsx +1 -0
- package/src/core/primitives/stack/stack.tsx +1 -0
- package/src/core/primitives/switch/switch.tsx +1 -0
- package/src/core/primitives/text/text.tsx +1 -0
- package/src/core/primitives/textArea/textArea.tsx +1 -0
- package/src/core/primitives/textInput/textInput.tsx +1 -0
- package/src/core/primitives/tooltip/tooltip.tsx +1 -0
- package/src/core/primitives/tooltip/tooltipCard.tsx +1 -2
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +2 -0
- package/src/core/theme/themeColorProvider.tsx +2 -0
- package/src/core/theme/themeProvider.tsx +2 -0
- package/src/core/utils/arrow/arrow.tsx +1 -0
- package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +2 -0
- package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +2 -0
- package/src/core/utils/elementQuery/elementQuery.tsx +1 -0
- package/src/core/utils/layer/layer.tsx +1 -0
- package/src/core/utils/layer/layerProvider.tsx +2 -0
- package/src/core/utils/portal/portal.ts +2 -0
- package/src/core/utils/portal/portalProvider.tsx +2 -0
- package/src/core/utils/srOnly/srOnly.tsx +1 -0
- package/src/core/utils/virtualList/virtualList.tsx +1 -0
package/dist/index.mjs
CHANGED
|
@@ -585,6 +585,7 @@ function ThemeProvider(props) {
|
|
|
585
585
|
} : null, [rootTheme, scheme, tone]), theme = useMemo(() => rootTheme ? getScopedTheme(rootTheme, scheme, tone) : null, [scheme, rootTheme, tone]);
|
|
586
586
|
return theme ? /* @__PURE__ */ jsx(ThemeContext.Provider, { value: themeContext, children: /* @__PURE__ */ jsx(ThemeProvider$1, { theme, children }) }) : /* @__PURE__ */ jsx("pre", { children: 'ThemeProvider: no "theme" property provided' });
|
|
587
587
|
}
|
|
588
|
+
ThemeProvider.displayName = "ThemeProvider";
|
|
588
589
|
function useRootTheme() {
|
|
589
590
|
const value = useContext(ThemeContext);
|
|
590
591
|
if (!value)
|
|
@@ -595,6 +596,7 @@ function ThemeColorProvider(props) {
|
|
|
595
596
|
const { children, scheme, tone } = props, root = useRootTheme();
|
|
596
597
|
return /* @__PURE__ */ jsx(ThemeProvider, { scheme: scheme || root.scheme, theme: root.theme, tone, children });
|
|
597
598
|
}
|
|
599
|
+
ThemeColorProvider.displayName = "ThemeColorProvider";
|
|
598
600
|
function useTheme() {
|
|
599
601
|
return useTheme$1();
|
|
600
602
|
}
|
|
@@ -1274,7 +1276,9 @@ const Root$C = styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBa
|
|
|
1274
1276
|
children
|
|
1275
1277
|
}
|
|
1276
1278
|
);
|
|
1277
|
-
})
|
|
1279
|
+
});
|
|
1280
|
+
Label.displayName = "ForwardRef(Label)";
|
|
1281
|
+
const avatarStyle = {
|
|
1278
1282
|
root: avatarRootStyle,
|
|
1279
1283
|
arrow: avatarArrowStyle,
|
|
1280
1284
|
bgStroke: avatarBgStrokeStyle,
|
|
@@ -1502,6 +1506,7 @@ const Root$B = styled.div(
|
|
|
1502
1506
|
}
|
|
1503
1507
|
);
|
|
1504
1508
|
});
|
|
1509
|
+
Avatar.displayName = "ForwardRef(Avatar)";
|
|
1505
1510
|
function _responsiveAvatarCounterSizeStyle(props) {
|
|
1506
1511
|
const { avatar, media } = getTheme_v2(props.theme);
|
|
1507
1512
|
return _responsive(media, props.$size, (size2) => {
|
|
@@ -1542,7 +1547,9 @@ const Root$A = styled.div(
|
|
|
1542
1547
|
[size2]
|
|
1543
1548
|
);
|
|
1544
1549
|
return /* @__PURE__ */ jsx(Root$A, { $size: size2, "data-ui": "AvatarCounter", ref, children: /* @__PURE__ */ jsx(Label, { as: "span", size: fontSize2, weight: "medium", children: count }) });
|
|
1545
|
-
})
|
|
1550
|
+
});
|
|
1551
|
+
AvatarCounter.displayName = "ForwardRef(AvatarCounter)";
|
|
1552
|
+
const BASE_STYLES = css`
|
|
1546
1553
|
white-space: nowrap;
|
|
1547
1554
|
|
|
1548
1555
|
& > div {
|
|
@@ -1582,7 +1589,9 @@ const Root$z = styled.div(responsiveAvatarStackSizeStyle, avatarStackStyle), Ava
|
|
|
1582
1589
|
len !== 0 && extraCount > 1 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: extraCount, size: size2 }) }),
|
|
1583
1590
|
visibleChildren.map((child, childIndex) => /* @__PURE__ */ jsx("div", { children: cloneElement(child, { size: size2 }) }, String(childIndex)))
|
|
1584
1591
|
] });
|
|
1585
|
-
})
|
|
1592
|
+
});
|
|
1593
|
+
AvatarStack.displayName = "ForwardRef(AvatarStack)";
|
|
1594
|
+
const Root$y = styled.div(
|
|
1586
1595
|
boxStyle,
|
|
1587
1596
|
flexItemStyle,
|
|
1588
1597
|
responsiveBoxStyle,
|
|
@@ -1656,6 +1665,7 @@ const Root$z = styled.div(responsiveAvatarStackSizeStyle, avatarStackStyle), Ava
|
|
|
1656
1665
|
}
|
|
1657
1666
|
);
|
|
1658
1667
|
});
|
|
1668
|
+
Box.displayName = "ForwardRef(Box)";
|
|
1659
1669
|
function textBaseStyle(props) {
|
|
1660
1670
|
const { $accent, $muted } = props, { font } = getTheme_v2(props.theme);
|
|
1661
1671
|
return css`
|
|
@@ -1756,6 +1766,7 @@ const Root$x = styled.div(
|
|
|
1756
1766
|
}
|
|
1757
1767
|
);
|
|
1758
1768
|
});
|
|
1769
|
+
Text.displayName = "ForwardRef(Text)";
|
|
1759
1770
|
function badgeStyle(props) {
|
|
1760
1771
|
const { $tone } = props;
|
|
1761
1772
|
return {
|
|
@@ -1795,7 +1806,9 @@ const Root$w = styled(Box)(
|
|
|
1795
1806
|
children: /* @__PURE__ */ jsx(Text, { size: fontSize2, children })
|
|
1796
1807
|
}
|
|
1797
1808
|
);
|
|
1798
|
-
})
|
|
1809
|
+
});
|
|
1810
|
+
Badge.displayName = "ForwardRef(Badge)";
|
|
1811
|
+
const Root$v = styled(Box)(
|
|
1799
1812
|
flexItemStyle,
|
|
1800
1813
|
responsiveFlexStyle
|
|
1801
1814
|
), Flex = forwardRef(function(props, ref) {
|
|
@@ -1814,7 +1827,9 @@ const Root$w = styled(Box)(
|
|
|
1814
1827
|
ref
|
|
1815
1828
|
}
|
|
1816
1829
|
);
|
|
1817
|
-
})
|
|
1830
|
+
});
|
|
1831
|
+
Flex.displayName = "ForwardRef(Flex)";
|
|
1832
|
+
const rotate$1 = keyframes`
|
|
1818
1833
|
from {
|
|
1819
1834
|
transform: rotate(0deg);
|
|
1820
1835
|
}
|
|
@@ -1829,6 +1844,7 @@ const Root$w = styled(Box)(
|
|
|
1829
1844
|
`, Spinner = forwardRef(function(props, ref) {
|
|
1830
1845
|
return /* @__PURE__ */ jsx(Root$u, { "data-ui": "Spinner", ...props, ref, children: /* @__PURE__ */ jsx(SpinnerIcon, {}) });
|
|
1831
1846
|
});
|
|
1847
|
+
Spinner.displayName = "ForwardRef(Spinner)";
|
|
1832
1848
|
function _cardColorStyle(base, color, checkered = !1) {
|
|
1833
1849
|
return {
|
|
1834
1850
|
// from base
|
|
@@ -2082,6 +2098,7 @@ const Root$t = styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColo
|
|
|
2082
2098
|
}
|
|
2083
2099
|
);
|
|
2084
2100
|
});
|
|
2101
|
+
Button.displayName = "ForwardRef(Button)";
|
|
2085
2102
|
function cardStyle(props) {
|
|
2086
2103
|
return [cardBaseStyle(props), cardColorStyle(props)];
|
|
2087
2104
|
}
|
|
@@ -2255,6 +2272,7 @@ const Root$s = styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, respons
|
|
|
2255
2272
|
}
|
|
2256
2273
|
) });
|
|
2257
2274
|
});
|
|
2275
|
+
Card.displayName = "ForwardRef(Card)";
|
|
2258
2276
|
function checkboxBaseStyles() {
|
|
2259
2277
|
return css`
|
|
2260
2278
|
position: relative;
|
|
@@ -2410,6 +2428,7 @@ const Root$r = styled.div(checkboxBaseStyles), Input$5 = styled.input(inputEleme
|
|
|
2410
2428
|
] })
|
|
2411
2429
|
] });
|
|
2412
2430
|
});
|
|
2431
|
+
Checkbox.displayName = "ForwardRef(Checkbox)";
|
|
2413
2432
|
function codeSyntaxHighlightingStyle({ theme }) {
|
|
2414
2433
|
const {
|
|
2415
2434
|
color: { syntax: color }
|
|
@@ -2488,7 +2507,9 @@ const Root$q = styled.pre(codeBaseStyle, responsiveCodeFontStyle), Code = forwar
|
|
|
2488
2507
|
!(language && registered) && /* @__PURE__ */ jsx("code", { children }),
|
|
2489
2508
|
language && registered && /* @__PURE__ */ jsx(Refractor, { inline: !0, language, value: String(children) })
|
|
2490
2509
|
] });
|
|
2491
|
-
})
|
|
2510
|
+
});
|
|
2511
|
+
Code.displayName = "ForwardRef(Code)";
|
|
2512
|
+
const BASE_STYLE$1 = {
|
|
2492
2513
|
width: "100%",
|
|
2493
2514
|
margin: "0 auto"
|
|
2494
2515
|
};
|
|
@@ -2516,7 +2537,9 @@ const Root$p = styled(Box)(
|
|
|
2516
2537
|
ref
|
|
2517
2538
|
}
|
|
2518
2539
|
);
|
|
2519
|
-
})
|
|
2540
|
+
});
|
|
2541
|
+
Container.displayName = "ForwardRef(Container)";
|
|
2542
|
+
const Root$o = styled(Box)(responsiveGridStyle), Grid = forwardRef(function(props, ref) {
|
|
2520
2543
|
const { as, autoRows, autoCols, autoFlow, columns, gap, gapX, gapY, rows, children, ...restProps } = props;
|
|
2521
2544
|
return /* @__PURE__ */ jsx(
|
|
2522
2545
|
Root$o,
|
|
@@ -2538,6 +2561,7 @@ const Root$p = styled(Box)(
|
|
|
2538
2561
|
}
|
|
2539
2562
|
);
|
|
2540
2563
|
});
|
|
2564
|
+
Grid.displayName = "ForwardRef(Grid)";
|
|
2541
2565
|
function headingBaseStyle(props) {
|
|
2542
2566
|
const { $accent, $muted } = props, { font } = getTheme_v2(props.theme);
|
|
2543
2567
|
return css`
|
|
@@ -2625,6 +2649,7 @@ const Root$n = styled.div(headingBaseStyle, responsiveTextAlignStyle, responsive
|
|
|
2625
2649
|
}
|
|
2626
2650
|
);
|
|
2627
2651
|
});
|
|
2652
|
+
Heading.displayName = "ForwardRef(Heading)";
|
|
2628
2653
|
function inlineBaseStyle() {
|
|
2629
2654
|
return {
|
|
2630
2655
|
lineHeight: 0,
|
|
@@ -2664,6 +2689,7 @@ const Root$m = styled(Box)(inlineBaseStyle, inlineSpaceStyle), Inline = forwardR
|
|
|
2664
2689
|
}
|
|
2665
2690
|
);
|
|
2666
2691
|
});
|
|
2692
|
+
Inline.displayName = "ForwardRef(Inline)";
|
|
2667
2693
|
function kbdStyle() {
|
|
2668
2694
|
return css`
|
|
2669
2695
|
--card-bg-color: var(--card-kbd-bg-color);
|
|
@@ -2684,7 +2710,9 @@ function kbdStyle() {
|
|
|
2684
2710
|
const Root$l = styled.kbd(responsiveRadiusStyle, kbdStyle), KBD = forwardRef(function(props, ref) {
|
|
2685
2711
|
const { children, fontSize: fontSize2 = 0, padding = 1, radius = 2, ...restProps } = props;
|
|
2686
2712
|
return /* @__PURE__ */ jsx(Root$l, { "data-ui": "KBD", ...restProps, $radius: useArrayProp(radius), ref, children: /* @__PURE__ */ jsx(Box, { as: "span", padding, children: /* @__PURE__ */ jsx(Text, { as: "span", size: fontSize2, weight: "semibold", children }) }) });
|
|
2687
|
-
})
|
|
2713
|
+
});
|
|
2714
|
+
KBD.displayName = "ForwardRef(KBD)";
|
|
2715
|
+
const origin = {
|
|
2688
2716
|
name: "@sanity/ui/origin",
|
|
2689
2717
|
fn({ middlewareData, placement, rects }) {
|
|
2690
2718
|
var _a, _b;
|
|
@@ -2825,7 +2853,9 @@ const Root$k = styled.div(
|
|
|
2825
2853
|
/* @__PURE__ */ jsx(StrokePath, { d: strokePath, mask: "url(#stroke-mask)", strokeWidth: strokeWidth * 2 }),
|
|
2826
2854
|
/* @__PURE__ */ jsx(ShapePath, { d: fillPath })
|
|
2827
2855
|
] }) });
|
|
2828
|
-
})
|
|
2856
|
+
});
|
|
2857
|
+
Arrow.displayName = "ForwardRef(Arrow)";
|
|
2858
|
+
const BoundaryElementContext = createGlobalScopedContext(
|
|
2829
2859
|
"@sanity/ui/context/boundaryElement",
|
|
2830
2860
|
null
|
|
2831
2861
|
);
|
|
@@ -2833,6 +2863,7 @@ function BoundaryElementProvider(props) {
|
|
|
2833
2863
|
const { children, element } = props, value = useMemo(() => ({ version: 0, element }), [element]);
|
|
2834
2864
|
return /* @__PURE__ */ jsx(BoundaryElementContext.Provider, { value, children });
|
|
2835
2865
|
}
|
|
2866
|
+
BoundaryElementProvider.displayName = "BoundaryElementProvider";
|
|
2836
2867
|
function isRecord(value) {
|
|
2837
2868
|
return !!(value && typeof value == "object" && !Array.isArray(value));
|
|
2838
2869
|
}
|
|
@@ -2853,6 +2884,7 @@ function ConditionalWrapper({
|
|
|
2853
2884
|
}) {
|
|
2854
2885
|
return condition ? wrapper(children) : children;
|
|
2855
2886
|
}
|
|
2887
|
+
ConditionalWrapper.displayName = "ConditionalWrapper";
|
|
2856
2888
|
function findMaxBreakpoints(media, width) {
|
|
2857
2889
|
const ret = [];
|
|
2858
2890
|
for (let i = 0; i < media.length; i += 1)
|
|
@@ -2886,6 +2918,7 @@ const ElementQuery = forwardRef(function(props, forwardedRef) {
|
|
|
2886
2918
|
}
|
|
2887
2919
|
);
|
|
2888
2920
|
});
|
|
2921
|
+
ElementQuery.displayName = "ForwardRef(ElementQuery)";
|
|
2889
2922
|
var __defProp = Object.defineProperty, __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key2] = value, __publicField = (obj, key2, value) => __defNormalProp(obj, key2 + "", value);
|
|
2890
2923
|
class ErrorBoundary extends Component {
|
|
2891
2924
|
constructor() {
|
|
@@ -3036,6 +3069,7 @@ function LayerProvider(props) {
|
|
|
3036
3069
|
);
|
|
3037
3070
|
return /* @__PURE__ */ jsx(LayerContext.Provider, { value, children });
|
|
3038
3071
|
}
|
|
3072
|
+
LayerProvider.displayName = "LayerProvider";
|
|
3039
3073
|
const Root$j = styled.div({ position: "relative" }), LayerChildren = forwardRef(function(props, forwardedRef) {
|
|
3040
3074
|
const { children, onActivate, onFocus, style = EMPTY_RECORD, ...restProps } = props, { zIndex, isTopLayer } = useLayer(), lastFocusedRef = useRef(null), ref = useRef(null), isTopLayerRef = useRef(isTopLayer);
|
|
3041
3075
|
useImperativeHandle(forwardedRef, () => ref.current), useEffect(() => {
|
|
@@ -3053,7 +3087,9 @@ const Root$j = styled.div({ position: "relative" }), LayerChildren = forwardRef(
|
|
|
3053
3087
|
}), Layer = forwardRef(function(props, ref) {
|
|
3054
3088
|
const { children, zOffset = 1, ...restProps } = props;
|
|
3055
3089
|
return /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(LayerChildren, { ...restProps, ref, children }) });
|
|
3056
|
-
})
|
|
3090
|
+
});
|
|
3091
|
+
Layer.displayName = "ForwardRef(Layer)";
|
|
3092
|
+
const key = "@sanity/ui/context/portal", elementKey = Symbol.for(`${key}/element`);
|
|
3057
3093
|
globalScope[elementKey] = null;
|
|
3058
3094
|
const defaultContextValue = {
|
|
3059
3095
|
version: 0,
|
|
@@ -3075,6 +3111,7 @@ function Portal(props) {
|
|
|
3075
3111
|
const { children, __unstable_name: name } = props, portal = usePortal(), portalElement = (name ? portal.elements && portal.elements[name] : portal.element) || ((_a = portal.elements) == null ? void 0 : _a.default);
|
|
3076
3112
|
return portalElement ? createPortal(children, portalElement) : null;
|
|
3077
3113
|
}
|
|
3114
|
+
Portal.displayName = "Portal";
|
|
3078
3115
|
function PortalProvider(props) {
|
|
3079
3116
|
const { boundaryElement, children, element, __unstable_elements: elementsProp } = props, elements = useUnique(elementsProp), fallbackElement = useSyncExternalStore(
|
|
3080
3117
|
emptySubscribe,
|
|
@@ -3088,6 +3125,7 @@ function PortalProvider(props) {
|
|
|
3088
3125
|
}), [boundaryElement, element, elements, fallbackElement]);
|
|
3089
3126
|
return /* @__PURE__ */ jsx(PortalContext.Provider, { value, children });
|
|
3090
3127
|
}
|
|
3128
|
+
PortalProvider.displayName = "PortalProvider";
|
|
3091
3129
|
const emptySubscribe = () => () => {
|
|
3092
3130
|
};
|
|
3093
3131
|
function useUnique(value) {
|
|
@@ -3110,7 +3148,9 @@ const Root$i = styled.div`
|
|
|
3110
3148
|
`, SrOnly = forwardRef(function(props, ref) {
|
|
3111
3149
|
const { as, children } = props;
|
|
3112
3150
|
return /* @__PURE__ */ jsx(Root$i, { "aria-hidden": !0, as, "data-ui": "SrOnly", ref, children });
|
|
3113
|
-
})
|
|
3151
|
+
});
|
|
3152
|
+
SrOnly.displayName = "ForwardRef(SrOnly)";
|
|
3153
|
+
const Root$h = styled.div`
|
|
3114
3154
|
position: relative;
|
|
3115
3155
|
`, ItemWrapper = styled.div`
|
|
3116
3156
|
position: absolute;
|
|
@@ -3159,7 +3199,9 @@ const Root$i = styled.div`
|
|
|
3159
3199
|
return /* @__PURE__ */ jsx(ItemWrapper, { style: { top: itemIndex * (itemHeight + space[gap]) }, children: node }, key2);
|
|
3160
3200
|
}), [fromIndex, gap, getItemKey, itemHeight, items, renderItem, space, toIndex]), wrapperStyle = useMemo(() => ({ height }), [height]);
|
|
3161
3201
|
return /* @__PURE__ */ jsx(Root$h, { as, "data-ui": "VirtualList", ...restProps, ref, children: /* @__PURE__ */ jsx("div", { ref: wrapperRef, style: wrapperStyle, children }) });
|
|
3162
|
-
})
|
|
3202
|
+
});
|
|
3203
|
+
VirtualList.displayName = "ForwardRef(VirtualList)";
|
|
3204
|
+
const DEFAULT_POPOVER_DISTANCE = 4, DEFAULT_POPOVER_PADDING = 4, DEFAULT_POPOVER_ARROW_WIDTH = 19, DEFAULT_POPOVER_ARROW_HEIGHT = 8, DEFAULT_POPOVER_ARROW_RADIUS = 2, DEFAULT_POPOVER_MARGINS = [0, 0, 0, 0], DEFAULT_FALLBACK_PLACEMENTS$1 = {
|
|
3163
3205
|
top: ["bottom", "left", "right"],
|
|
3164
3206
|
"top-start": ["bottom-start", "left-start", "right-start"],
|
|
3165
3207
|
"top-end": ["bottom-end", "left-end", "right-end"],
|
|
@@ -3302,7 +3344,7 @@ const MotionCard$1 = styled(motion(Card))`
|
|
|
3302
3344
|
);
|
|
3303
3345
|
})
|
|
3304
3346
|
);
|
|
3305
|
-
PopoverCard.displayName = "PopoverCard";
|
|
3347
|
+
PopoverCard.displayName = "Memo(ForwardRef(PopoverCard))";
|
|
3306
3348
|
const Popover = memo(
|
|
3307
3349
|
forwardRef(function(props, forwardedRef) {
|
|
3308
3350
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
@@ -3486,7 +3528,7 @@ const Popover = memo(
|
|
|
3486
3528
|
] });
|
|
3487
3529
|
})
|
|
3488
3530
|
);
|
|
3489
|
-
Popover.displayName = "Popover";
|
|
3531
|
+
Popover.displayName = "Memo(ForwardRef(Popover))";
|
|
3490
3532
|
function radioBaseStyle() {
|
|
3491
3533
|
return css`
|
|
3492
3534
|
position: relative;
|
|
@@ -3616,6 +3658,7 @@ const Root$g = styled.div(radioBaseStyle), Input$4 = styled.input(inputElementSt
|
|
|
3616
3658
|
/* @__PURE__ */ jsx("span", {})
|
|
3617
3659
|
] });
|
|
3618
3660
|
});
|
|
3661
|
+
Radio.displayName = "ForwardRef(Radio)";
|
|
3619
3662
|
function rootStyle() {
|
|
3620
3663
|
return css`
|
|
3621
3664
|
position: relative;
|
|
@@ -3783,7 +3826,9 @@ const selectStyle = {
|
|
|
3783
3826
|
),
|
|
3784
3827
|
/* @__PURE__ */ jsx(IconBox, { padding, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, children: /* @__PURE__ */ jsx(ChevronDownIcon, {}) }) })
|
|
3785
3828
|
] });
|
|
3786
|
-
})
|
|
3829
|
+
});
|
|
3830
|
+
Select.displayName = "ForwardRef(Select)";
|
|
3831
|
+
const BASE_STYLE = {
|
|
3787
3832
|
"&&:not([hidden])": {
|
|
3788
3833
|
display: "grid"
|
|
3789
3834
|
},
|
|
@@ -3816,6 +3861,7 @@ const Root$e = styled(Box)(stackBaseStyle, responsiveStackSpaceStyle), Stack = f
|
|
|
3816
3861
|
}
|
|
3817
3862
|
);
|
|
3818
3863
|
});
|
|
3864
|
+
Stack.displayName = "ForwardRef(Stack)";
|
|
3819
3865
|
function switchBaseStyles() {
|
|
3820
3866
|
return css`
|
|
3821
3867
|
position: relative;
|
|
@@ -3982,7 +4028,9 @@ const Root$d = styled.span(switchBaseStyles), Input$2 = styled.input(switchInput
|
|
|
3982
4028
|
/* @__PURE__ */ jsx(Thumb, { $checked: checked, $indeterminate: indeterminate })
|
|
3983
4029
|
] })
|
|
3984
4030
|
] });
|
|
3985
|
-
})
|
|
4031
|
+
});
|
|
4032
|
+
Switch.displayName = "ForwardRef(Switch)";
|
|
4033
|
+
const Root$c = styled.span(textInputRootStyle), InputRoot$1 = styled.span`
|
|
3986
4034
|
flex: 1;
|
|
3987
4035
|
min-width: 0;
|
|
3988
4036
|
display: block;
|
|
@@ -4040,7 +4088,9 @@ const Root$d = styled.span(switchBaseStyles), Input$2 = styled.input(switchInput
|
|
|
4040
4088
|
}
|
|
4041
4089
|
)
|
|
4042
4090
|
] }) });
|
|
4043
|
-
})
|
|
4091
|
+
});
|
|
4092
|
+
TextArea.displayName = "ForwardRef(TextArea)";
|
|
4093
|
+
const CLEAR_BUTTON_BOX_STYLE = { zIndex: 2 }, Root$b = styled(Card).attrs({ forwardedAs: "span" })(textInputRootStyle), InputRoot = styled.span`
|
|
4044
4094
|
flex: 1;
|
|
4045
4095
|
min-width: 0;
|
|
4046
4096
|
display: block;
|
|
@@ -4240,6 +4290,7 @@ const Root$d = styled.span(switchBaseStyles), Input$2 = styled.input(switchInput
|
|
|
4240
4290
|
suffixNode
|
|
4241
4291
|
] });
|
|
4242
4292
|
});
|
|
4293
|
+
TextInput.displayName = "ForwardRef(TextInput)";
|
|
4243
4294
|
function useDelayedState(initialState) {
|
|
4244
4295
|
const [state, setState] = useState(initialState), delayedAction = useRef(), onStateChange = useCallback((nextState, delay) => {
|
|
4245
4296
|
const action = () => {
|
|
@@ -4333,7 +4384,7 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
|
|
|
4333
4384
|
);
|
|
4334
4385
|
})
|
|
4335
4386
|
);
|
|
4336
|
-
TooltipCard.displayName = "TooltipCard";
|
|
4387
|
+
TooltipCard.displayName = "Memo(ForwardRef(TooltipCard))";
|
|
4337
4388
|
const TooltipDelayGroupContext = createGlobalScopedContext(
|
|
4338
4389
|
"@sanity/ui/context/tooltipDelayGroup",
|
|
4339
4390
|
null
|
|
@@ -4356,6 +4407,7 @@ function TooltipDelayGroupProvider(props) {
|
|
|
4356
4407
|
);
|
|
4357
4408
|
return /* @__PURE__ */ jsx(TooltipDelayGroupContext.Provider, { value, children });
|
|
4358
4409
|
}
|
|
4410
|
+
TooltipDelayGroupProvider.displayName = "TooltipDelayGroupProvider";
|
|
4359
4411
|
const Root$a = styled(Layer)`
|
|
4360
4412
|
pointer-events: none;
|
|
4361
4413
|
`, Tooltip = forwardRef(function(props, forwardedRef) {
|
|
@@ -4555,6 +4607,7 @@ const Root$a = styled(Layer)`
|
|
|
4555
4607
|
child
|
|
4556
4608
|
] });
|
|
4557
4609
|
});
|
|
4610
|
+
Tooltip.displayName = "ForwardRef(Tooltip)";
|
|
4558
4611
|
function useCloseOnMouseLeave({
|
|
4559
4612
|
handleIsOpenChange,
|
|
4560
4613
|
referenceElement,
|
|
@@ -4970,7 +5023,9 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
4970
5023
|
]
|
|
4971
5024
|
}
|
|
4972
5025
|
);
|
|
4973
|
-
})
|
|
5026
|
+
});
|
|
5027
|
+
InnerAutocomplete.displayName = "ForwardRef(Autocomplete)";
|
|
5028
|
+
const Autocomplete = InnerAutocomplete, Root$8 = styled.ol`
|
|
4974
5029
|
margin: 0;
|
|
4975
5030
|
padding: 0;
|
|
4976
5031
|
display: flex;
|
|
@@ -5024,6 +5079,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
5024
5079
|
/* @__PURE__ */ jsx(Box, { as: "li", children: item })
|
|
5025
5080
|
] }, itemIndex)) });
|
|
5026
5081
|
});
|
|
5082
|
+
Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
|
|
5027
5083
|
function dialogStyle({ theme }) {
|
|
5028
5084
|
const { color } = getTheme_v2(theme);
|
|
5029
5085
|
return {
|
|
@@ -5171,7 +5227,9 @@ const Root$7 = styled(Layer)(responsivePaddingStyle, dialogStyle, responsiveDial
|
|
|
5171
5227
|
/* @__PURE__ */ jsx(DialogContent, { flex: 1, ref: contentRef, tabIndex: -1, children }),
|
|
5172
5228
|
footer && /* @__PURE__ */ jsx(DialogFooter, { children: footer })
|
|
5173
5229
|
] }) }) });
|
|
5174
|
-
})
|
|
5230
|
+
});
|
|
5231
|
+
DialogCard.displayName = "ForwardRef(DialogCard)";
|
|
5232
|
+
const Dialog = forwardRef(function(props, ref) {
|
|
5175
5233
|
var _a;
|
|
5176
5234
|
const dialog = useDialog(), { layer } = useTheme_v2(), {
|
|
5177
5235
|
__unstable_autoFocus: autoFocus = !0,
|
|
@@ -5268,6 +5326,7 @@ const Root$7 = styled(Layer)(responsivePaddingStyle, dialogStyle, responsiveDial
|
|
|
5268
5326
|
}
|
|
5269
5327
|
) });
|
|
5270
5328
|
});
|
|
5329
|
+
Dialog.displayName = "ForwardRef(Dialog)";
|
|
5271
5330
|
function DialogProvider(props) {
|
|
5272
5331
|
const { children, position, zOffset } = props, contextValue = useMemo(
|
|
5273
5332
|
() => ({
|
|
@@ -5279,6 +5338,7 @@ function DialogProvider(props) {
|
|
|
5279
5338
|
);
|
|
5280
5339
|
return /* @__PURE__ */ jsx(DialogContext.Provider, { value: contextValue, children });
|
|
5281
5340
|
}
|
|
5341
|
+
DialogProvider.displayName = "DialogProvider";
|
|
5282
5342
|
const Root$6 = styled.kbd`
|
|
5283
5343
|
font: inherit;
|
|
5284
5344
|
padding: 1px;
|
|
@@ -5293,7 +5353,9 @@ const Root$6 = styled.kbd`
|
|
|
5293
5353
|
`, Hotkeys = forwardRef(function(props, ref) {
|
|
5294
5354
|
const { fontSize: fontSize2, keys, padding, radius, space: spaceProp = 0.5, ...restProps } = props, space = useArrayProp(spaceProp);
|
|
5295
5355
|
return !keys || keys.length === 0 ? /* @__PURE__ */ jsx(Fragment, {}) : /* @__PURE__ */ jsx(Root$6, { "data-ui": "Hotkeys", ...restProps, ref, children: /* @__PURE__ */ jsx(Inline, { as: "span", space, children: keys.map((key2, i) => /* @__PURE__ */ jsx(Key, { fontSize: fontSize2, padding, radius, children: key2 }, i)) }) });
|
|
5296
|
-
})
|
|
5356
|
+
});
|
|
5357
|
+
Hotkeys.displayName = "ForwardRef(Hotkeys)";
|
|
5358
|
+
const MenuContext = createGlobalScopedContext(
|
|
5297
5359
|
"@sanity/ui/context/menu",
|
|
5298
5360
|
null
|
|
5299
5361
|
);
|
|
@@ -5527,7 +5589,9 @@ const Root$5 = styled(Box)`
|
|
|
5527
5589
|
children: /* @__PURE__ */ jsx(Stack, { space, children })
|
|
5528
5590
|
}
|
|
5529
5591
|
) });
|
|
5530
|
-
})
|
|
5592
|
+
});
|
|
5593
|
+
Menu.displayName = "ForwardRef(Menu)";
|
|
5594
|
+
const MenuButton = forwardRef(function(props, forwardedRef) {
|
|
5531
5595
|
const {
|
|
5532
5596
|
__unstable_disableRestoreFocusOnClose: disableRestoreFocusOnClose = !1,
|
|
5533
5597
|
boundaryElement: deprecated_boundaryElement,
|
|
@@ -5659,12 +5723,15 @@ const Root$5 = styled(Box)`
|
|
|
5659
5723
|
]
|
|
5660
5724
|
);
|
|
5661
5725
|
return /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: button || /* @__PURE__ */ jsx(Fragment, {}) });
|
|
5662
|
-
})
|
|
5726
|
+
});
|
|
5727
|
+
MenuButton.displayName = "ForwardRef(MenuButton)";
|
|
5728
|
+
const MenuDivider = styled.hr`
|
|
5663
5729
|
height: 1px;
|
|
5664
5730
|
border: 0;
|
|
5665
5731
|
background: var(--card-hairline-soft-color);
|
|
5666
5732
|
margin: 0;
|
|
5667
5733
|
`;
|
|
5734
|
+
MenuDivider.displayName = "MenuDivider";
|
|
5668
5735
|
function selectableBaseStyle() {
|
|
5669
5736
|
return css`
|
|
5670
5737
|
background-color: inherit;
|
|
@@ -5766,6 +5833,7 @@ const Selectable = styled(Box)(
|
|
|
5766
5833
|
selectableBaseStyle,
|
|
5767
5834
|
selectableColorStyle
|
|
5768
5835
|
);
|
|
5836
|
+
Selectable.displayName = "Selectable";
|
|
5769
5837
|
function useMenu() {
|
|
5770
5838
|
const value = useContext(MenuContext);
|
|
5771
5839
|
if (!value)
|
|
@@ -5874,6 +5942,7 @@ function MenuGroup(props) {
|
|
|
5874
5942
|
}
|
|
5875
5943
|
) });
|
|
5876
5944
|
}
|
|
5945
|
+
MenuGroup.displayName = "MenuGroup";
|
|
5877
5946
|
const MenuItem = forwardRef(function(props, forwardedRef) {
|
|
5878
5947
|
const {
|
|
5879
5948
|
as = "button",
|
|
@@ -5971,7 +6040,9 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
|
|
|
5971
6040
|
]
|
|
5972
6041
|
}
|
|
5973
6042
|
);
|
|
5974
|
-
})
|
|
6043
|
+
});
|
|
6044
|
+
MenuItem.displayName = "ForwardRef(MenuItem)";
|
|
6045
|
+
const keyframe = keyframes`
|
|
5975
6046
|
0% {
|
|
5976
6047
|
background-position: 100%;
|
|
5977
6048
|
}
|
|
@@ -6031,7 +6102,9 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
|
|
|
6031
6102
|
ref
|
|
6032
6103
|
}
|
|
6033
6104
|
);
|
|
6034
|
-
})
|
|
6105
|
+
});
|
|
6106
|
+
Skeleton.displayName = "ForwardRef(Skeleton)";
|
|
6107
|
+
const Root$3 = styled(Skeleton)((props) => {
|
|
6035
6108
|
const { $size, $style } = props, { font, media } = getTheme_v2(props.theme), fontStyle = font[$style];
|
|
6036
6109
|
return _responsive(media, $size, (sizeIndex) => {
|
|
6037
6110
|
const fontSize2 = fontStyle.sizes[sizeIndex];
|
|
@@ -6040,16 +6113,24 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
|
|
|
6040
6113
|
}), TextSkeleton = forwardRef(function(props, ref) {
|
|
6041
6114
|
const { size: size2 = 2, ...restProps } = props, $size = useArrayProp(size2);
|
|
6042
6115
|
return /* @__PURE__ */ jsx(Root$3, { ...restProps, $size, ref, $style: "text" });
|
|
6043
|
-
})
|
|
6116
|
+
});
|
|
6117
|
+
TextSkeleton.displayName = "ForwardRef(TextSkeleton)";
|
|
6118
|
+
const LabelSkeleton = forwardRef(function(props, ref) {
|
|
6044
6119
|
const { size: size2 = 2, ...restProps } = props, $size = useArrayProp(size2);
|
|
6045
6120
|
return /* @__PURE__ */ jsx(Root$3, { ...restProps, $size, ref, $style: "label" });
|
|
6046
|
-
})
|
|
6121
|
+
});
|
|
6122
|
+
LabelSkeleton.displayName = "ForwardRef(LabelSkeleton)";
|
|
6123
|
+
const HeadingSkeleton = forwardRef(function(props, ref) {
|
|
6047
6124
|
const { size: size2 = 2, ...restProps } = props, $size = useArrayProp(size2);
|
|
6048
6125
|
return /* @__PURE__ */ jsx(Root$3, { ...restProps, $size, ref, $style: "heading" });
|
|
6049
|
-
})
|
|
6126
|
+
});
|
|
6127
|
+
HeadingSkeleton.displayName = "ForwardRef(HeadingSkeleton)";
|
|
6128
|
+
const CodeSkeleton = forwardRef(function(props, ref) {
|
|
6050
6129
|
const { size: size2 = 2, ...restProps } = props, $size = useArrayProp(size2);
|
|
6051
6130
|
return /* @__PURE__ */ jsx(Root$3, { ...restProps, $size, ref, $style: "code" });
|
|
6052
|
-
})
|
|
6131
|
+
});
|
|
6132
|
+
CodeSkeleton.displayName = "ForwardRef(CodeSkeleton)";
|
|
6133
|
+
const CustomButton = styled(Button)`
|
|
6053
6134
|
max-width: 100%;
|
|
6054
6135
|
`, Tab = forwardRef(function(props, forwardedRef) {
|
|
6055
6136
|
const {
|
|
@@ -6101,6 +6182,7 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
|
|
|
6101
6182
|
}
|
|
6102
6183
|
);
|
|
6103
6184
|
});
|
|
6185
|
+
Tab.displayName = "ForwardRef(Tab)";
|
|
6104
6186
|
function _isReactElement(node) {
|
|
6105
6187
|
return !!node;
|
|
6106
6188
|
}
|
|
@@ -6137,7 +6219,9 @@ const CustomInline = styled(Inline)`
|
|
|
6137
6219
|
children: tabs
|
|
6138
6220
|
}
|
|
6139
6221
|
);
|
|
6140
|
-
})
|
|
6222
|
+
});
|
|
6223
|
+
TabList.displayName = "ForwardRef(TabList)";
|
|
6224
|
+
const TabPanel = forwardRef(function(props, ref) {
|
|
6141
6225
|
const { flex, ...restProps } = props;
|
|
6142
6226
|
return /* @__PURE__ */ jsx(
|
|
6143
6227
|
Box,
|
|
@@ -6151,7 +6235,9 @@ const CustomInline = styled(Inline)`
|
|
|
6151
6235
|
children: props.children
|
|
6152
6236
|
}
|
|
6153
6237
|
);
|
|
6154
|
-
})
|
|
6238
|
+
});
|
|
6239
|
+
TabPanel.displayName = "ForwardRef(TabPanel)";
|
|
6240
|
+
const TextBox = styled(Flex)`
|
|
6155
6241
|
overflow-x: auto;
|
|
6156
6242
|
`, loadingAnimation = keyframes`
|
|
6157
6243
|
0% {
|
|
@@ -6245,6 +6331,7 @@ function Toast(props) {
|
|
|
6245
6331
|
}
|
|
6246
6332
|
);
|
|
6247
6333
|
}
|
|
6334
|
+
Toast.displayName = "Toast";
|
|
6248
6335
|
function useMounted() {
|
|
6249
6336
|
return useSyncExternalStore(
|
|
6250
6337
|
subscribe,
|
|
@@ -6351,6 +6438,7 @@ function ToastProvider(props) {
|
|
|
6351
6438
|
)) }) }) }) })
|
|
6352
6439
|
] });
|
|
6353
6440
|
}
|
|
6441
|
+
ToastProvider.displayName = "ToastProvider";
|
|
6354
6442
|
function useToast() {
|
|
6355
6443
|
const value = useContext(ToastContext);
|
|
6356
6444
|
if (!value)
|
|
@@ -6539,7 +6627,7 @@ const TreeContext = createGlobalScopedContext(
|
|
|
6539
6627
|
) });
|
|
6540
6628
|
})
|
|
6541
6629
|
);
|
|
6542
|
-
Tree.displayName = "Tree";
|
|
6630
|
+
Tree.displayName = "Memo(ForwardRef(Tree))";
|
|
6543
6631
|
function treeItemRootStyle() {
|
|
6544
6632
|
return css`
|
|
6545
6633
|
&[role='none'] > [role='treeitem'] {
|
|
@@ -6758,6 +6846,7 @@ const TreeGroup = memo(function(props) {
|
|
|
6758
6846
|
}
|
|
6759
6847
|
);
|
|
6760
6848
|
});
|
|
6849
|
+
TreeItem.displayName = "Memo(TreeItem)";
|
|
6761
6850
|
export {
|
|
6762
6851
|
Arrow,
|
|
6763
6852
|
Autocomplete,
|