@sanity/ui 2.0.0-beta.1 → 2.0.0-beta.10
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/LICENSE +1 -1
- package/README.md +6 -3
- package/dist/index.cjs.mjs +11 -36
- package/dist/index.d.ts +248 -268
- package/dist/index.esm.js +494 -354
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +503 -567
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs.mjs +1 -1
- package/dist/theme.d.ts +81 -114
- package/dist/theme.esm.js +299 -252
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +299 -252
- package/dist/theme.js.map +1 -1
- package/package.json +6 -3
- package/src/core/__workshop__/constants.ts +3 -2
- package/src/core/_compat.ts +236 -87
- package/src/core/components/menu/__workshop__/selectedItem.tsx +7 -2
- package/src/core/components/menu/menuButton.tsx +12 -1
- package/src/core/constants.ts +18 -0
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +6 -3
- package/src/core/middleware/origin.ts +47 -0
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +1 -1
- package/src/core/primitives/avatar/__workshop__/stack.tsx +1 -1
- package/src/core/primitives/avatar/avatar.tsx +14 -4
- package/src/core/primitives/avatar/avatarCounter.tsx +16 -5
- package/src/core/primitives/avatar/avatarStack.tsx +2 -2
- package/src/core/primitives/badge/badge.tsx +1 -3
- package/src/core/primitives/kbd/kbd.tsx +2 -0
- package/src/core/primitives/popover/popover.tsx +67 -13
- package/src/core/primitives/popover/popoverCard.tsx +26 -15
- package/src/core/primitives/select/select.tsx +1 -1
- package/src/core/primitives/switch/styles.ts +6 -1
- package/src/core/primitives/tooltip/tooltip.tsx +47 -57
- package/src/core/primitives/tooltip/tooltipCard.tsx +104 -0
- package/src/core/styles/card/_cardColorStyle.ts +2 -0
- package/src/core/styles/margin/marginsStyle.test.ts +2 -2
- package/src/core/styles/padding/paddingStyle.test.ts +2 -2
- package/src/core/theme/__workshop__/build/Root.tsx +20 -3
- package/src/core/theme/__workshop__/build/story.tsx +16 -10
- package/src/core/theme/__workshop__/canvas.tsx +7 -7
- package/src/core/theme/__workshop__/debug/story.tsx +159 -0
- package/src/core/theme/__workshop__/index.ts +5 -0
- package/src/core/theme/theme.test.tsx +2 -2
- package/src/core/types/avatar.ts +1 -1
- package/src/core/types/button.ts +1 -2
- package/src/core/{primitives/tooltip → utils/conditionalWrapper}/conditionalWrapper.tsx +3 -0
- package/src/core/utils/conditionalWrapper/index.ts +1 -0
- package/src/core/utils/index.ts +1 -0
- package/src/theme/build/_deprecated/color/factory.ts +3 -3
- package/src/theme/build/buildColorTheme.ts +16 -16
- package/src/theme/build/colorToken/colorToken.ts +19 -0
- package/src/theme/build/colorToken/compileColorToken.ts +21 -0
- package/src/theme/build/colorToken/index.ts +2 -0
- package/src/theme/build/colorToken/types.ts +6 -0
- package/src/theme/build/renderColorTheme.ts +14 -15
- package/src/theme/build/renderColorValue.ts +9 -2
- package/src/theme/config/system.ts +12 -10
- package/src/theme/config/tokens/color/types.ts +12 -1
- package/src/theme/config/tokens/parseTokenKey.ts +1 -0
- package/src/theme/config/tokens/parseTokenValue.test.ts +13 -16
- package/src/theme/config/tokens/parseTokenValue.ts +45 -14
- package/src/theme/config/tokens/types.ts +3 -2
- package/src/theme/defaults/colorTokens.ts +219 -211
- package/src/theme/defaults/config.ts +2 -1
- package/src/theme/defaults/fonts.ts +13 -5
- package/src/theme/index.ts +0 -7
- package/src/theme/system/color/_constants.ts +5 -2
- package/src/theme/system/color/_system.ts +2 -1
- package/src/theme/system/color/avatar.ts +2 -12
- package/src/theme/system/color/button.ts +4 -20
- package/src/theme/system/color/input.ts +3 -11
- package/src/theme/system/color/selectable.ts +3 -14
- package/src/theme/system/shadow.ts +0 -6
- package/src/theme/system/styles.ts +0 -6
- package/src/theme/system/theme.ts +2 -0
- package/src/theme/system/v0/avatar.ts +1 -1
- package/src/theme/system/v0/color/button.ts +4 -4
- package/src/theme/system/v0/color/card.ts +2 -2
- package/src/theme/system/v0/color/input.ts +3 -3
- package/src/theme/system/v0/color/muted.ts +2 -2
- package/src/theme/system/v0/color/solid.ts +2 -2
- package/src/theme/versioning/themeColor_v0_v2.ts +2 -2
- package/src/theme/versioning/v2_v0.ts +2 -2
- package/src/theme/build/colorToken.ts +0 -39
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { getTheme_v2, getScopedTheme } from '@sanity/ui/theme';
|
|
2
|
-
export { COLOR_CONFIG_BLEND_KEYS, COLOR_CONFIG_CARD_KEYS, COLOR_CONFIG_CARD_TONES, COLOR_CONFIG_STATE_KEYS, COLOR_CONFIG_STATE_TONES, THEME_COLOR_BLEND_MODES, THEME_COLOR_BUTTON_MODES, THEME_COLOR_CARD_TONES, THEME_COLOR_STATES, THEME_COLOR_STATE_TONES, buildTheme, createColorTheme, hexToRgb, hslToRgb, isColorBlendModeValue, isColorButtonMode, isColorConfigBaseKey, isColorConfigBaseTone, isColorConfigBlendKey, isColorConfigStateKey, isColorConfigStateTone, isColorHueKey, isColorOpacityValue, isColorTintKey, isColorTokenValue, isColorValue, multiply, parseColor, parseTokenKey, parseTokenValue, rgbToHex, rgbToHsl, rgba, rgbaToRGBA, screen, defaultTheme as studioTheme } from '@sanity/ui/theme';
|
|
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';
|
|
3
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
3
|
import { useMemo, useState, useRef, useEffect, createContext, useContext, useSyncExternalStore, useLayoutEffect, forwardRef, useId, useCallback, cloneElement, isValidElement, createElement, Component, memo, useReducer, Children, Fragment as Fragment$1, startTransition } from 'react';
|
|
5
4
|
import ReactIs, { isElement as isElement$1, isFragment, isValidElementType } from 'react-is';
|
|
@@ -7,10 +6,38 @@ import styled, { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1, css,
|
|
|
7
6
|
import { SpinnerIcon, CheckmarkIcon, RemoveIcon, ChevronDownIcon, CloseIcon, ChevronRightIcon, ToggleArrowRightIcon } from '@sanity/icons';
|
|
8
7
|
import Refractor from 'react-refractor';
|
|
9
8
|
import { detectOverflow, flip, offset, shift, arrow, hide, useFloating, autoUpdate } from '@floating-ui/react-dom';
|
|
9
|
+
import { motion, AnimatePresence } from 'framer-motion';
|
|
10
10
|
import { createPortal } from 'react-dom';
|
|
11
|
-
|
|
11
|
+
const createColorTheme = createColorTheme$1;
|
|
12
|
+
const hexToRgb = hexToRgb$1;
|
|
13
|
+
const hslToRgb = hslToRgb$1;
|
|
14
|
+
const multiply = multiply$1;
|
|
15
|
+
const parseColor = parseColor$1;
|
|
16
|
+
const rgbToHex = rgbToHex$1;
|
|
17
|
+
const rgbToHsl = rgbToHsl$1;
|
|
18
|
+
const rgba = rgba$1;
|
|
19
|
+
const screen = screen$1;
|
|
20
|
+
const studioTheme = buildTheme();
|
|
12
21
|
const EMPTY_ARRAY = [];
|
|
13
22
|
const EMPTY_RECORD = {};
|
|
23
|
+
const POPOVER_MOTION_PROPS = {
|
|
24
|
+
initial: {
|
|
25
|
+
opacity: 0.5,
|
|
26
|
+
scale: 0.97
|
|
27
|
+
},
|
|
28
|
+
animate: {
|
|
29
|
+
opacity: 1,
|
|
30
|
+
scale: 1
|
|
31
|
+
},
|
|
32
|
+
exit: {
|
|
33
|
+
opacity: 0,
|
|
34
|
+
scale: 0.97
|
|
35
|
+
},
|
|
36
|
+
transition: {
|
|
37
|
+
duration: 0.4,
|
|
38
|
+
type: "spring"
|
|
39
|
+
}
|
|
40
|
+
};
|
|
14
41
|
function _fillCSSObject(keys, value) {
|
|
15
42
|
return keys.reduce((style, key) => {
|
|
16
43
|
style[key] = value;
|
|
@@ -1469,13 +1496,13 @@ function responsiveInputPaddingIconRightStyle(props) {
|
|
|
1469
1496
|
$iconRight: true
|
|
1470
1497
|
});
|
|
1471
1498
|
}
|
|
1472
|
-
var __freeze$
|
|
1473
|
-
var __defProp$
|
|
1474
|
-
var __template$
|
|
1475
|
-
value: __freeze$
|
|
1499
|
+
var __freeze$F = Object.freeze;
|
|
1500
|
+
var __defProp$G = Object.defineProperty;
|
|
1501
|
+
var __template$F = (cooked, raw) => __freeze$F(__defProp$G(cooked, "raw", {
|
|
1502
|
+
value: __freeze$F(raw || cooked.slice())
|
|
1476
1503
|
}));
|
|
1477
|
-
var _a$
|
|
1478
|
-
const ROOT_STYLE = css(_a$
|
|
1504
|
+
var _a$F, _b$n, _c$c;
|
|
1505
|
+
const ROOT_STYLE = css(_a$F || (_a$F = __template$F(["\n &:not([hidden]) {\n display: flex;\n }\n\n align-items: center;\n"])));
|
|
1479
1506
|
function textInputRootStyle() {
|
|
1480
1507
|
return ROOT_STYLE;
|
|
1481
1508
|
}
|
|
@@ -1489,7 +1516,7 @@ function textInputBaseStyle(props) {
|
|
|
1489
1516
|
color,
|
|
1490
1517
|
font
|
|
1491
1518
|
} = getTheme_v2(props.theme);
|
|
1492
|
-
return css(_b$n || (_b$n = __template$
|
|
1519
|
+
return css(_b$n || (_b$n = __template$F(["\n appearance: none;\n background: none;\n border: 0;\n border-radius: 0;\n outline: none;\n width: 100%;\n box-sizing: border-box;\n font-family: ", ";\n font-weight: ", ";\n margin: 0;\n position: relative;\n z-index: 1;\n display: block;\n\n /* NOTE: This is a hack to disable Chrome\u2019s autofill styles */\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n -webkit-text-fill-color: var(--input-fg-color) !important;\n transition: background-color 5000s;\n transition-delay: 86400s /* 24h */;\n }\n\n /* &:is(textarea) */\n &[data-as='textarea'] {\n resize: none;\n }\n\n color: var(--input-fg-color);\n\n &::placeholder {\n color: var(--input-placeholder-color);\n }\n\n &[data-scheme='", "'][data-tone='", "'] {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n\n /* enabled */\n &:not(:invalid):not(:disabled):not(:read-only) {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n }\n\n /* disabled */\n &:not(:invalid):disabled {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n }\n\n /* invalid */\n &:invalid {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n }\n\n /* readOnly */\n &:read-only {\n --input-fg-color: ", ";\n --input-placeholder-color: ", ";\n }\n }\n "])), font.text.family, $weight && font.text.weights[$weight] || font.text.weights.regular, $scheme, $tone, color.input.default.enabled.fg, color.input.default.enabled.placeholder, color.input.default.enabled.fg, color.input.default.enabled.placeholder, color.input.default.disabled.fg, color.input.default.disabled.placeholder, color.input.invalid.enabled.fg, color.input.invalid.enabled.placeholder, color.input.default.readOnly.fg, color.input.default.readOnly.placeholder);
|
|
1493
1520
|
}
|
|
1494
1521
|
function textInputFontSizeStyle(props) {
|
|
1495
1522
|
const {
|
|
@@ -1516,7 +1543,7 @@ function textInputRepresentationStyle(props) {
|
|
|
1516
1543
|
color,
|
|
1517
1544
|
input
|
|
1518
1545
|
} = getTheme_v2(props.theme);
|
|
1519
|
-
return css(_c$c || (_c$c = __template$
|
|
1546
|
+
return css(_c$c || (_c$c = __template$F(["\n --input-box-shadow: none;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: block;\n pointer-events: none;\n z-index: 0;\n\n background-color: var(--card-bg-color);\n box-shadow: var(--input-box-shadow);\n\n border-top-left-radius: ", ";\n border-bottom-left-radius: ", ";\n border-top-right-radius: ", ";\n border-bottom-right-radius: ", ";\n\n &[data-scheme='", "'][data-tone='", "'] {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n /* enabled */\n *:not(:disabled) + &[data-border] {\n --input-box-shadow: ", ";\n }\n\n /* invalid */\n *:not(:disabled):invalid + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* focused */\n *:not(:disabled):focus + & {\n &[data-border] {\n --input-box-shadow: ", ";\n }\n\n &:not([data-border]) {\n --input-box-shadow: ", ";\n }\n }\n\n /* disabled */\n *:disabled + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* readOnly */\n *:read-only + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n }\n\n /* hovered */\n @media (hover: hover) {\n *:not(:disabled):not(:read-only):not(:invalid):hover + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n }\n\n *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n }\n "])), $hasPrefix ? 0 : void 0, $hasPrefix ? 0 : void 0, $hasSuffix ? 0 : void 0, $hasSuffix ? 0 : void 0, $scheme, $tone, color.input.default.enabled.bg, color.input.default.enabled.fg, focusRingBorderStyle({
|
|
1520
1547
|
color: color.input.default.enabled.border,
|
|
1521
1548
|
width: input.border.width
|
|
1522
1549
|
}), color.input.invalid.enabled.bg, color.input.invalid.enabled.fg, focusRingBorderStyle({
|
|
@@ -1590,12 +1617,12 @@ function responsiveShadowStyle(props) {
|
|
|
1590
1617
|
} = getTheme_v2(props.theme);
|
|
1591
1618
|
return _responsive(media, props.$shadow, index => shadowStyle(shadow[index], card.shadow.outline));
|
|
1592
1619
|
}
|
|
1593
|
-
var __freeze$
|
|
1594
|
-
var __defProp$
|
|
1595
|
-
var __template$
|
|
1596
|
-
value: __freeze$
|
|
1620
|
+
var __freeze$E = Object.freeze;
|
|
1621
|
+
var __defProp$F = Object.defineProperty;
|
|
1622
|
+
var __template$E = (cooked, raw) => __freeze$E(__defProp$F(cooked, "raw", {
|
|
1623
|
+
value: __freeze$E(raw || cooked.slice())
|
|
1597
1624
|
}));
|
|
1598
|
-
var _a$
|
|
1625
|
+
var _a$E, _b$m, _c$b;
|
|
1599
1626
|
function labelBaseStyle(props) {
|
|
1600
1627
|
const {
|
|
1601
1628
|
$accent,
|
|
@@ -1604,16 +1631,16 @@ function labelBaseStyle(props) {
|
|
|
1604
1631
|
const {
|
|
1605
1632
|
font
|
|
1606
1633
|
} = getTheme_v2(props.theme);
|
|
1607
|
-
return css(_c$b || (_c$b = __template$
|
|
1634
|
+
return css(_c$b || (_c$b = __template$E(["\n text-transform: uppercase;\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), $accent && css(_a$E || (_a$E = __template$E(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_b$m || (_b$m = __template$E(["\n color: var(--card-muted-fg-color);\n "]))), font.code.family);
|
|
1608
1635
|
}
|
|
1609
|
-
var __freeze$
|
|
1610
|
-
var __defProp$
|
|
1611
|
-
var __template$
|
|
1612
|
-
value: __freeze$
|
|
1636
|
+
var __freeze$D = Object.freeze;
|
|
1637
|
+
var __defProp$E = Object.defineProperty;
|
|
1638
|
+
var __template$D = (cooked, raw) => __freeze$D(__defProp$E(cooked, "raw", {
|
|
1639
|
+
value: __freeze$D(raw || cooked.slice())
|
|
1613
1640
|
}));
|
|
1614
|
-
var _a$
|
|
1615
|
-
const Root$
|
|
1616
|
-
const SpanWithTextOverflow$2 = styled.span(_a$
|
|
1641
|
+
var _a$D;
|
|
1642
|
+
const Root$C = styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle);
|
|
1643
|
+
const SpanWithTextOverflow$2 = styled.span(_a$D || (_a$D = __template$D(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n overflow: clip;\n"])));
|
|
1617
1644
|
const Label = forwardRef(function Label2(props, ref) {
|
|
1618
1645
|
const {
|
|
1619
1646
|
accent,
|
|
@@ -1635,7 +1662,7 @@ const Label = forwardRef(function Label2(props, ref) {
|
|
|
1635
1662
|
children
|
|
1636
1663
|
});
|
|
1637
1664
|
}
|
|
1638
|
-
return /* @__PURE__ */jsx(Root$
|
|
1665
|
+
return /* @__PURE__ */jsx(Root$C, {
|
|
1639
1666
|
"data-ui": "Label",
|
|
1640
1667
|
...restProps,
|
|
1641
1668
|
$accent: accent,
|
|
@@ -1794,7 +1821,7 @@ function avatarStrokeStyle() {
|
|
|
1794
1821
|
}
|
|
1795
1822
|
};
|
|
1796
1823
|
}
|
|
1797
|
-
const Root$
|
|
1824
|
+
const Root$B = styled.div(responsiveAvatarSizeStyle, avatarStyle.root);
|
|
1798
1825
|
const Arrow$1 = styled.div(avatarStyle.arrow);
|
|
1799
1826
|
const BgStroke = styled.ellipse(avatarStyle.bgStroke);
|
|
1800
1827
|
const Stroke = styled.ellipse(avatarStyle.stroke);
|
|
@@ -1815,14 +1842,14 @@ const Avatar = forwardRef(function Avatar2(props, ref) {
|
|
|
1815
1842
|
arrowPosition: arrowPositionProp,
|
|
1816
1843
|
animateArrowFrom,
|
|
1817
1844
|
status = "online",
|
|
1818
|
-
size: sizeProp =
|
|
1845
|
+
size: sizeProp = 1,
|
|
1819
1846
|
...restProps
|
|
1820
1847
|
} = props;
|
|
1821
|
-
const as = ReactIs.isValidElementType(asProp) ? asProp : "div";
|
|
1822
|
-
const size = useArrayProp(sizeProp);
|
|
1823
1848
|
const {
|
|
1824
1849
|
avatar
|
|
1825
1850
|
} = useTheme_v2();
|
|
1851
|
+
const as = ReactIs.isValidElementType(asProp) ? asProp : "div";
|
|
1852
|
+
const size = useArrayProp(sizeProp);
|
|
1826
1853
|
const avatarSize = avatar.sizes[size[0]] || avatar.sizes[0];
|
|
1827
1854
|
const _sizeRem = avatarSize.size;
|
|
1828
1855
|
const _radius = _sizeRem / 2;
|
|
@@ -1844,8 +1871,13 @@ const Avatar = forwardRef(function Avatar2(props, ref) {
|
|
|
1844
1871
|
onImageLoadError(new Error("Avatar: the image failed to load"));
|
|
1845
1872
|
}
|
|
1846
1873
|
}, [onImageLoadError]);
|
|
1847
|
-
const initialsSize = useMemo(() => size.map(s =>
|
|
1848
|
-
|
|
1874
|
+
const initialsSize = useMemo(() => size.map(s => {
|
|
1875
|
+
if (s === 1) return 1;
|
|
1876
|
+
if (s === 2) return 3;
|
|
1877
|
+
if (s === 3) return 5;
|
|
1878
|
+
return 0;
|
|
1879
|
+
}), [size]);
|
|
1880
|
+
return /* @__PURE__ */jsxs(Root$B, {
|
|
1849
1881
|
as,
|
|
1850
1882
|
"data-as": typeof as === "string" ? as : void 0,
|
|
1851
1883
|
"data-ui": "Avatar",
|
|
@@ -1907,73 +1939,19 @@ const Avatar = forwardRef(function Avatar2(props, ref) {
|
|
|
1907
1939
|
children: /* @__PURE__ */jsx(InitialsLabel, {
|
|
1908
1940
|
forwardedAs: "span",
|
|
1909
1941
|
size: initialsSize,
|
|
1942
|
+
weight: "medium",
|
|
1910
1943
|
children: initials
|
|
1911
1944
|
})
|
|
1912
1945
|
})
|
|
1913
1946
|
})]
|
|
1914
1947
|
});
|
|
1915
1948
|
});
|
|
1916
|
-
var __freeze$
|
|
1917
|
-
var __defProp$
|
|
1918
|
-
var __template$
|
|
1919
|
-
value: __freeze$
|
|
1920
|
-
}));
|
|
1921
|
-
var _a$A, _b$l, _c$a;
|
|
1922
|
-
function textBaseStyle(props) {
|
|
1923
|
-
const {
|
|
1924
|
-
$accent,
|
|
1925
|
-
$muted
|
|
1926
|
-
} = props;
|
|
1927
|
-
const {
|
|
1928
|
-
font
|
|
1929
|
-
} = getTheme_v2(props.theme);
|
|
1930
|
-
return css(_c$a || (_c$a = __template$A(["\n color: var(--card-fg-color);\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n background-color: var(--card-code-bg-color);\n color: var(--card-code-fg-color);\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ", ";\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n color: var(--card-icon-color);\n\n & path {\n vector-effect: non-scaling-stroke !important;\n }\n }\n "])), $accent && css(_a$A || (_a$A = __template$A(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_b$l || (_b$l = __template$A(["\n color: var(--card-muted-fg-color);\n "]))), font.code.family, font.text.weights.bold);
|
|
1931
|
-
}
|
|
1932
|
-
var __freeze$z = Object.freeze;
|
|
1933
|
-
var __defProp$A = Object.defineProperty;
|
|
1934
|
-
var __template$z = (cooked, raw) => __freeze$z(__defProp$A(cooked, "raw", {
|
|
1935
|
-
value: __freeze$z(raw || cooked.slice())
|
|
1936
|
-
}));
|
|
1937
|
-
var _a$z;
|
|
1938
|
-
const Root$B = styled.div(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle);
|
|
1939
|
-
const SpanWithTextOverflow$1 = styled.span(_a$z || (_a$z = __template$z(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n overflow: clip;\n"])));
|
|
1940
|
-
const Text = forwardRef(function Text2(props, ref) {
|
|
1941
|
-
const {
|
|
1942
|
-
accent = false,
|
|
1943
|
-
align,
|
|
1944
|
-
children: childrenProp,
|
|
1945
|
-
muted = false,
|
|
1946
|
-
size = 2,
|
|
1947
|
-
textOverflow,
|
|
1948
|
-
weight,
|
|
1949
|
-
...restProps
|
|
1950
|
-
} = props;
|
|
1951
|
-
let children = childrenProp;
|
|
1952
|
-
if (textOverflow === "ellipsis") {
|
|
1953
|
-
children = /* @__PURE__ */jsx(SpanWithTextOverflow$1, {
|
|
1954
|
-
children
|
|
1955
|
-
});
|
|
1956
|
-
}
|
|
1957
|
-
return /* @__PURE__ */jsx(Root$B, {
|
|
1958
|
-
"data-ui": "Text",
|
|
1959
|
-
...restProps,
|
|
1960
|
-
$accent: accent,
|
|
1961
|
-
$align: useArrayProp(align),
|
|
1962
|
-
$muted: muted,
|
|
1963
|
-
ref,
|
|
1964
|
-
$size: useArrayProp(size),
|
|
1965
|
-
$weight: weight,
|
|
1966
|
-
children: /* @__PURE__ */jsx("span", {
|
|
1967
|
-
children
|
|
1968
|
-
})
|
|
1969
|
-
});
|
|
1970
|
-
});
|
|
1971
|
-
var __freeze$y = Object.freeze;
|
|
1972
|
-
var __defProp$z = Object.defineProperty;
|
|
1973
|
-
var __template$y = (cooked, raw) => __freeze$y(__defProp$z(cooked, "raw", {
|
|
1974
|
-
value: __freeze$y(raw || cooked.slice())
|
|
1949
|
+
var __freeze$C = Object.freeze;
|
|
1950
|
+
var __defProp$D = Object.defineProperty;
|
|
1951
|
+
var __template$C = (cooked, raw) => __freeze$C(__defProp$D(cooked, "raw", {
|
|
1952
|
+
value: __freeze$C(raw || cooked.slice())
|
|
1975
1953
|
}));
|
|
1976
|
-
var _a$
|
|
1954
|
+
var _a$C;
|
|
1977
1955
|
function _responsiveAvatarCounterSizeStyle(props) {
|
|
1978
1956
|
const {
|
|
1979
1957
|
avatar,
|
|
@@ -1993,23 +1971,28 @@ function _avatarCounterBaseStyle(props) {
|
|
|
1993
1971
|
const {
|
|
1994
1972
|
space
|
|
1995
1973
|
} = getTheme_v2(props.theme);
|
|
1996
|
-
return css(_a$
|
|
1974
|
+
return css(_a$C || (_a$C = __template$C(["\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n user-select: none;\n color: inherit;\n color: var(--card-fg-color);\n background: var(--card-bg-color);\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n inset 0 0 0 1px var(--card-hairline-hard-color);\n padding: 0 ", ";\n\n &:not([hidden]) {\n display: flex;\n }\n "])), rem(space[2]));
|
|
1997
1975
|
}
|
|
1998
1976
|
const Root$A = styled.div(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle);
|
|
1999
1977
|
const AvatarCounter = forwardRef(function AvatarCounter2(props, ref) {
|
|
2000
1978
|
const {
|
|
2001
1979
|
count,
|
|
2002
|
-
size: sizeProp =
|
|
1980
|
+
size: sizeProp = 1
|
|
2003
1981
|
} = props;
|
|
2004
1982
|
const size = useArrayProp(sizeProp);
|
|
2005
|
-
const
|
|
1983
|
+
const fontSize = useMemo(() => size.map(s => {
|
|
1984
|
+
if (s === 1) return 1;
|
|
1985
|
+
if (s === 2) return 3;
|
|
1986
|
+
if (s === 3) return 5;
|
|
1987
|
+
return 0;
|
|
1988
|
+
}), [size]);
|
|
2006
1989
|
return /* @__PURE__ */jsx(Root$A, {
|
|
2007
1990
|
$size: size,
|
|
2008
1991
|
"data-ui": "AvatarCounter",
|
|
2009
1992
|
ref,
|
|
2010
|
-
children: /* @__PURE__ */jsx(
|
|
1993
|
+
children: /* @__PURE__ */jsx(Label, {
|
|
2011
1994
|
as: "span",
|
|
2012
|
-
size:
|
|
1995
|
+
size: fontSize,
|
|
2013
1996
|
weight: "medium",
|
|
2014
1997
|
children: count
|
|
2015
1998
|
})
|
|
@@ -2019,13 +2002,13 @@ function childrenToElementArray(children) {
|
|
|
2019
2002
|
const childrenArray = Array.isArray(children) ? children : [children];
|
|
2020
2003
|
return childrenArray.filter(node => isElement$1(node) || isFragment(node) || typeof node === "string");
|
|
2021
2004
|
}
|
|
2022
|
-
var __freeze$
|
|
2023
|
-
var __defProp$
|
|
2024
|
-
var __template$
|
|
2025
|
-
value: __freeze$
|
|
2005
|
+
var __freeze$B = Object.freeze;
|
|
2006
|
+
var __defProp$C = Object.defineProperty;
|
|
2007
|
+
var __template$B = (cooked, raw) => __freeze$B(__defProp$C(cooked, "raw", {
|
|
2008
|
+
value: __freeze$B(raw || cooked.slice())
|
|
2026
2009
|
}));
|
|
2027
|
-
var _a$
|
|
2028
|
-
const BASE_STYLES = css(_a$
|
|
2010
|
+
var _a$B;
|
|
2011
|
+
const BASE_STYLES = css(_a$B || (_a$B = __template$B(["\n white-space: nowrap;\n\n & > div {\n vertical-align: top;\n\n &:not([hidden]) {\n display: inline-block;\n }\n }\n"])));
|
|
2029
2012
|
function avatarStackStyle() {
|
|
2030
2013
|
return BASE_STYLES;
|
|
2031
2014
|
}
|
|
@@ -2049,7 +2032,7 @@ const AvatarStack = forwardRef(function AvatarStack2(props, ref) {
|
|
|
2049
2032
|
const {
|
|
2050
2033
|
children: childrenProp,
|
|
2051
2034
|
maxLength: maxLengthProp = 4,
|
|
2052
|
-
size: sizeProp =
|
|
2035
|
+
size: sizeProp = 1,
|
|
2053
2036
|
...restProps
|
|
2054
2037
|
} = props;
|
|
2055
2038
|
const children = childrenToElementArray(childrenProp).filter(child => typeof child !== "string");
|
|
@@ -2066,7 +2049,8 @@ const AvatarStack = forwardRef(function AvatarStack2(props, ref) {
|
|
|
2066
2049
|
$size: size,
|
|
2067
2050
|
children: [len === 0 && /* @__PURE__ */jsx("div", {
|
|
2068
2051
|
children: /* @__PURE__ */jsx(AvatarCounter, {
|
|
2069
|
-
count: len
|
|
2052
|
+
count: len,
|
|
2053
|
+
size
|
|
2070
2054
|
})
|
|
2071
2055
|
}), len !== 0 && extraCount > 1 && /* @__PURE__ */jsx("div", {
|
|
2072
2056
|
children: /* @__PURE__ */jsx(AvatarCounter, {
|
|
@@ -2145,6 +2129,61 @@ const Box = forwardRef(function Box2(props, ref) {
|
|
|
2145
2129
|
children: props.children
|
|
2146
2130
|
});
|
|
2147
2131
|
});
|
|
2132
|
+
var __freeze$A = Object.freeze;
|
|
2133
|
+
var __defProp$B = Object.defineProperty;
|
|
2134
|
+
var __template$A = (cooked, raw) => __freeze$A(__defProp$B(cooked, "raw", {
|
|
2135
|
+
value: __freeze$A(raw || cooked.slice())
|
|
2136
|
+
}));
|
|
2137
|
+
var _a$A, _b$l, _c$a;
|
|
2138
|
+
function textBaseStyle(props) {
|
|
2139
|
+
const {
|
|
2140
|
+
$accent,
|
|
2141
|
+
$muted
|
|
2142
|
+
} = props;
|
|
2143
|
+
const {
|
|
2144
|
+
font
|
|
2145
|
+
} = getTheme_v2(props.theme);
|
|
2146
|
+
return css(_c$a || (_c$a = __template$A(["\n color: var(--card-fg-color);\n\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n background-color: var(--card-code-bg-color);\n color: var(--card-code-fg-color);\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ", ";\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n color: var(--card-icon-color);\n\n & path {\n vector-effect: non-scaling-stroke !important;\n }\n }\n "])), $accent && css(_a$A || (_a$A = __template$A(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_b$l || (_b$l = __template$A(["\n color: var(--card-muted-fg-color);\n "]))), font.code.family, font.text.weights.bold);
|
|
2147
|
+
}
|
|
2148
|
+
var __freeze$z = Object.freeze;
|
|
2149
|
+
var __defProp$A = Object.defineProperty;
|
|
2150
|
+
var __template$z = (cooked, raw) => __freeze$z(__defProp$A(cooked, "raw", {
|
|
2151
|
+
value: __freeze$z(raw || cooked.slice())
|
|
2152
|
+
}));
|
|
2153
|
+
var _a$z;
|
|
2154
|
+
const Root$x = styled.div(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle);
|
|
2155
|
+
const SpanWithTextOverflow$1 = styled.span(_a$z || (_a$z = __template$z(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n overflow: clip;\n"])));
|
|
2156
|
+
const Text = forwardRef(function Text2(props, ref) {
|
|
2157
|
+
const {
|
|
2158
|
+
accent = false,
|
|
2159
|
+
align,
|
|
2160
|
+
children: childrenProp,
|
|
2161
|
+
muted = false,
|
|
2162
|
+
size = 2,
|
|
2163
|
+
textOverflow,
|
|
2164
|
+
weight,
|
|
2165
|
+
...restProps
|
|
2166
|
+
} = props;
|
|
2167
|
+
let children = childrenProp;
|
|
2168
|
+
if (textOverflow === "ellipsis") {
|
|
2169
|
+
children = /* @__PURE__ */jsx(SpanWithTextOverflow$1, {
|
|
2170
|
+
children
|
|
2171
|
+
});
|
|
2172
|
+
}
|
|
2173
|
+
return /* @__PURE__ */jsx(Root$x, {
|
|
2174
|
+
"data-ui": "Text",
|
|
2175
|
+
...restProps,
|
|
2176
|
+
$accent: accent,
|
|
2177
|
+
$align: useArrayProp(align),
|
|
2178
|
+
$muted: muted,
|
|
2179
|
+
ref,
|
|
2180
|
+
$size: useArrayProp(size),
|
|
2181
|
+
$weight: weight,
|
|
2182
|
+
children: /* @__PURE__ */jsx("span", {
|
|
2183
|
+
children
|
|
2184
|
+
})
|
|
2185
|
+
});
|
|
2186
|
+
});
|
|
2148
2187
|
function badgeStyle(props) {
|
|
2149
2188
|
const {
|
|
2150
2189
|
$tone
|
|
@@ -2160,7 +2199,7 @@ function badgeStyle(props) {
|
|
|
2160
2199
|
}
|
|
2161
2200
|
};
|
|
2162
2201
|
}
|
|
2163
|
-
const Root$
|
|
2202
|
+
const Root$w = styled(Box)(responsiveRadiusStyle, badgeStyle);
|
|
2164
2203
|
const Badge = forwardRef(function Badge2(props, ref) {
|
|
2165
2204
|
const {
|
|
2166
2205
|
children,
|
|
@@ -2172,7 +2211,7 @@ const Badge = forwardRef(function Badge2(props, ref) {
|
|
|
2172
2211
|
tone = "default",
|
|
2173
2212
|
...restProps
|
|
2174
2213
|
} = props;
|
|
2175
|
-
return /* @__PURE__ */jsx(Root$
|
|
2214
|
+
return /* @__PURE__ */jsx(Root$w, {
|
|
2176
2215
|
"data-ui": "Badge",
|
|
2177
2216
|
...restProps,
|
|
2178
2217
|
$tone: tone,
|
|
@@ -2181,12 +2220,11 @@ const Badge = forwardRef(function Badge2(props, ref) {
|
|
|
2181
2220
|
ref,
|
|
2182
2221
|
children: /* @__PURE__ */jsx(Text, {
|
|
2183
2222
|
size: fontSize,
|
|
2184
|
-
weight: "medium",
|
|
2185
2223
|
children
|
|
2186
2224
|
})
|
|
2187
2225
|
});
|
|
2188
2226
|
});
|
|
2189
|
-
const Root$
|
|
2227
|
+
const Root$v = styled(Box)(flexItemStyle, responsiveFlexStyle);
|
|
2190
2228
|
const Flex = forwardRef(function Flex2(props, ref) {
|
|
2191
2229
|
const {
|
|
2192
2230
|
align,
|
|
@@ -2197,7 +2235,7 @@ const Flex = forwardRef(function Flex2(props, ref) {
|
|
|
2197
2235
|
wrap,
|
|
2198
2236
|
...restProps
|
|
2199
2237
|
} = props;
|
|
2200
|
-
return /* @__PURE__ */jsx(Root$
|
|
2238
|
+
return /* @__PURE__ */jsx(Root$v, {
|
|
2201
2239
|
"data-ui": "Flex",
|
|
2202
2240
|
...restProps,
|
|
2203
2241
|
$align: useArrayProp(align),
|
|
@@ -2209,16 +2247,16 @@ const Flex = forwardRef(function Flex2(props, ref) {
|
|
|
2209
2247
|
ref
|
|
2210
2248
|
});
|
|
2211
2249
|
});
|
|
2212
|
-
var __freeze$
|
|
2213
|
-
var __defProp$
|
|
2214
|
-
var __template$
|
|
2215
|
-
value: __freeze$
|
|
2250
|
+
var __freeze$y = Object.freeze;
|
|
2251
|
+
var __defProp$z = Object.defineProperty;
|
|
2252
|
+
var __template$y = (cooked, raw) => __freeze$y(__defProp$z(cooked, "raw", {
|
|
2253
|
+
value: __freeze$y(raw || cooked.slice())
|
|
2216
2254
|
}));
|
|
2217
|
-
var _a$
|
|
2218
|
-
const rotate$1 = keyframes(_a$
|
|
2219
|
-
const Root$
|
|
2255
|
+
var _a$y, _b$k;
|
|
2256
|
+
const rotate$1 = keyframes(_a$y || (_a$y = __template$y(["\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n"])));
|
|
2257
|
+
const Root$u = styled(Text)(_b$k || (_b$k = __template$y(["\n & > span > svg {\n animation: ", " 500ms linear infinite;\n }\n"])), rotate$1);
|
|
2220
2258
|
const Spinner = forwardRef(function Spinner2(props, ref) {
|
|
2221
|
-
return /* @__PURE__ */jsx(Root$
|
|
2259
|
+
return /* @__PURE__ */jsx(Root$u, {
|
|
2222
2260
|
"data-ui": "Spinner",
|
|
2223
2261
|
...props,
|
|
2224
2262
|
ref,
|
|
@@ -2229,6 +2267,7 @@ function _cardColorStyle(base, color) {
|
|
|
2229
2267
|
let checkered = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
2230
2268
|
return {
|
|
2231
2269
|
// from base
|
|
2270
|
+
"--card-backdrop-color": base.backdrop,
|
|
2232
2271
|
"--card-focus-ring-color": base.focusRing,
|
|
2233
2272
|
"--card-shadow-outline-color": base.shadow.outline,
|
|
2234
2273
|
"--card-shadow-umbra-color": base.shadow.umbra,
|
|
@@ -2296,12 +2335,12 @@ function _cardColorStyle(base, color) {
|
|
|
2296
2335
|
"--card-hairline-hard-color": color.border
|
|
2297
2336
|
};
|
|
2298
2337
|
}
|
|
2299
|
-
var __freeze$
|
|
2300
|
-
var __defProp$
|
|
2301
|
-
var __template$
|
|
2302
|
-
value: __freeze$
|
|
2338
|
+
var __freeze$x = Object.freeze;
|
|
2339
|
+
var __defProp$y = Object.defineProperty;
|
|
2340
|
+
var __template$x = (cooked, raw) => __freeze$x(__defProp$y(cooked, "raw", {
|
|
2341
|
+
value: __freeze$x(raw || cooked.slice())
|
|
2303
2342
|
}));
|
|
2304
|
-
var _a$
|
|
2343
|
+
var _a$x, _b$j;
|
|
2305
2344
|
function buttonBaseStyles(props) {
|
|
2306
2345
|
const {
|
|
2307
2346
|
$width
|
|
@@ -2309,7 +2348,7 @@ function buttonBaseStyles(props) {
|
|
|
2309
2348
|
const {
|
|
2310
2349
|
style
|
|
2311
2350
|
} = getTheme_v2(props.theme);
|
|
2312
|
-
return css(_b$j || (_b$j = __template$
|
|
2351
|
+
return css(_b$j || (_b$j = __template$x(["\n ", ";\n\n -webkit-font-smoothing: inherit;\n appearance: none;\n display: inline-flex;\n align-items: center;\n font: inherit;\n border: 0;\n outline: none;\n user-select: none;\n text-decoration: none;\n border: 0;\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n white-space: nowrap;\n text-align: left;\n position: relative;\n vertical-align: top;\n\n ", "\n\n & > span {\n display: block;\n flex: 1;\n min-width: 0;\n border-radius: inherit;\n }\n\n &::-moz-focus-inner {\n border: 0;\n padding: 0;\n }\n "])), style == null ? void 0 : style.button, $width === "fill" && css(_a$x || (_a$x = __template$x(["\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n "]))));
|
|
2313
2352
|
}
|
|
2314
2353
|
function combineBoxShadow() {
|
|
2315
2354
|
for (var _len = arguments.length, boxShadows = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -2364,14 +2403,14 @@ function buttonColorStyles(props) {
|
|
|
2364
2403
|
}
|
|
2365
2404
|
}, (_a2 = style == null ? void 0 : style.button) == null ? void 0 : _a2.root].filter(Boolean);
|
|
2366
2405
|
}
|
|
2367
|
-
var __freeze$
|
|
2368
|
-
var __defProp$
|
|
2369
|
-
var __template$
|
|
2370
|
-
value: __freeze$
|
|
2406
|
+
var __freeze$w = Object.freeze;
|
|
2407
|
+
var __defProp$x = Object.defineProperty;
|
|
2408
|
+
var __template$w = (cooked, raw) => __freeze$w(__defProp$x(cooked, "raw", {
|
|
2409
|
+
value: __freeze$w(raw || cooked.slice())
|
|
2371
2410
|
}));
|
|
2372
|
-
var _a$
|
|
2373
|
-
const Root$
|
|
2374
|
-
const LoadingBox = styled.div(_a$
|
|
2411
|
+
var _a$w;
|
|
2412
|
+
const Root$t = styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles);
|
|
2413
|
+
const LoadingBox = styled.div(_a$w || (_a$w = __template$w(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--card-bg-color);\n border-radius: inherit;\n z-index: 1;\n box-shadow: inherit;\n"])));
|
|
2375
2414
|
const Button = forwardRef(function Button2(props, ref) {
|
|
2376
2415
|
const {
|
|
2377
2416
|
children,
|
|
@@ -2423,7 +2462,7 @@ const Button = forwardRef(function Button2(props, ref) {
|
|
|
2423
2462
|
paddingLeft,
|
|
2424
2463
|
paddingRight
|
|
2425
2464
|
}), [padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight]);
|
|
2426
|
-
return /* @__PURE__ */jsxs(Root$
|
|
2465
|
+
return /* @__PURE__ */jsxs(Root$t, {
|
|
2427
2466
|
"data-ui": "Button",
|
|
2428
2467
|
...restProps,
|
|
2429
2468
|
$mode: mode,
|
|
@@ -2469,12 +2508,12 @@ const Button = forwardRef(function Button2(props, ref) {
|
|
|
2469
2508
|
})]
|
|
2470
2509
|
});
|
|
2471
2510
|
});
|
|
2472
|
-
var __freeze$
|
|
2473
|
-
var __defProp$
|
|
2474
|
-
var __template$
|
|
2475
|
-
value: __freeze$
|
|
2511
|
+
var __freeze$v = Object.freeze;
|
|
2512
|
+
var __defProp$w = Object.defineProperty;
|
|
2513
|
+
var __template$v = (cooked, raw) => __freeze$v(__defProp$w(cooked, "raw", {
|
|
2514
|
+
value: __freeze$v(raw || cooked.slice())
|
|
2476
2515
|
}));
|
|
2477
|
-
var _a$
|
|
2516
|
+
var _a$v, _b$i, _c$9;
|
|
2478
2517
|
function cardStyle(props) {
|
|
2479
2518
|
return [cardBaseStyle(props), cardColorStyle(props)];
|
|
2480
2519
|
}
|
|
@@ -2485,7 +2524,7 @@ function cardBaseStyle(props) {
|
|
|
2485
2524
|
const {
|
|
2486
2525
|
space
|
|
2487
2526
|
} = getTheme_v2(props.theme);
|
|
2488
|
-
return css(_b$i || (_b$i = __template$
|
|
2527
|
+
return css(_b$i || (_b$i = __template$v(["\n ", "\n\n &[data-as='button'] {\n -webkit-font-smoothing: inherit;\n appearance: none;\n outline: none;\n font: inherit;\n text-align: inherit;\n border: 0;\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n outline: none;\n text-decoration: none;\n }\n\n /* &:is(pre) */\n &[data-as='pre'] {\n font: inherit;\n }\n "])), $checkered && css(_a$v || (_a$v = __template$v(["\n background-size: ", "px ", "px;\n background-position: 50% 50%;\n background-image: var(--card-bg-image);\n "])), space[3], space[3]));
|
|
2489
2528
|
}
|
|
2490
2529
|
function cardColorStyle(props) {
|
|
2491
2530
|
var _a2;
|
|
@@ -2502,7 +2541,7 @@ function cardColorStyle(props) {
|
|
|
2502
2541
|
width: card.border.width,
|
|
2503
2542
|
color: "var(--card-border-color)"
|
|
2504
2543
|
};
|
|
2505
|
-
return css(_c$9 || (_c$9 = __template$
|
|
2544
|
+
return css(_c$9 || (_c$9 = __template$v(["\n color-scheme: ", ";\n\n ", "\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n\n /* &:is(button) */\n &[data-as='button'] {\n --card-focus-ring-box-shadow: none;\n\n cursor: default;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &:disabled {\n ", "\n }\n\n &:not(:disabled) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus-visible {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n cursor: pointer;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &[data-disabled] {\n ", "\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus-visible {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n ", "\n "])), color._dark ? "dark" : "light", _cardColorStyle(color, color, $checkered), _cardColorStyle(color, color.selectable.default.disabled, $checkered), _cardColorStyle(color, color.selectable.default.pressed, $checkered), _cardColorStyle(color, color.selectable.default.selected, $checkered), _cardColorStyle(color, color.selectable.default.hovered, $checkered), _cardColorStyle(color, color.selectable.default.pressed, $checkered), $focusRing ? focusRingStyle({
|
|
2506
2545
|
base: color,
|
|
2507
2546
|
border,
|
|
2508
2547
|
focusRing: card.focusRing
|
|
@@ -2512,7 +2551,7 @@ function cardColorStyle(props) {
|
|
|
2512
2551
|
focusRing: card.focusRing
|
|
2513
2552
|
}) : void 0, (_a2 = style == null ? void 0 : style.card) == null ? void 0 : _a2.root);
|
|
2514
2553
|
}
|
|
2515
|
-
const Root$
|
|
2554
|
+
const Root$s = styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle);
|
|
2516
2555
|
const Card = forwardRef(function Card2(props, ref) {
|
|
2517
2556
|
const {
|
|
2518
2557
|
__unstable_checkered: checkered = false,
|
|
@@ -2537,7 +2576,7 @@ const Card = forwardRef(function Card2(props, ref) {
|
|
|
2537
2576
|
return /* @__PURE__ */jsx(ThemeColorProvider, {
|
|
2538
2577
|
scheme,
|
|
2539
2578
|
tone,
|
|
2540
|
-
children: /* @__PURE__ */jsx(Root$
|
|
2579
|
+
children: /* @__PURE__ */jsx(Root$s, {
|
|
2541
2580
|
"data-as": typeof as === "string" ? as : void 0,
|
|
2542
2581
|
"data-scheme": rootTheme.scheme,
|
|
2543
2582
|
"data-ui": "Card",
|
|
@@ -2562,14 +2601,14 @@ const Card = forwardRef(function Card2(props, ref) {
|
|
|
2562
2601
|
})
|
|
2563
2602
|
});
|
|
2564
2603
|
});
|
|
2565
|
-
var __freeze$
|
|
2566
|
-
var __defProp$
|
|
2567
|
-
var __template$
|
|
2568
|
-
value: __freeze$
|
|
2604
|
+
var __freeze$u = Object.freeze;
|
|
2605
|
+
var __defProp$v = Object.defineProperty;
|
|
2606
|
+
var __template$u = (cooked, raw) => __freeze$u(__defProp$v(cooked, "raw", {
|
|
2607
|
+
value: __freeze$u(raw || cooked.slice())
|
|
2569
2608
|
}));
|
|
2570
|
-
var _a$
|
|
2609
|
+
var _a$u, _b$h;
|
|
2571
2610
|
function checkboxBaseStyles() {
|
|
2572
|
-
return css(_a$
|
|
2611
|
+
return css(_a$u || (_a$u = __template$u(["\n position: relative;\n display: inline-block;\n "])));
|
|
2573
2612
|
}
|
|
2574
2613
|
function inputElementStyles(props) {
|
|
2575
2614
|
const {
|
|
@@ -2580,7 +2619,7 @@ function inputElementStyles(props) {
|
|
|
2580
2619
|
const {
|
|
2581
2620
|
focusRing
|
|
2582
2621
|
} = input.checkbox;
|
|
2583
|
-
return css(_b$h || (_b$h = __template$
|
|
2622
|
+
return css(_b$h || (_b$h = __template$u(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n outline: none;\n opacity: 0;\n z-index: 1;\n padding: 0;\n margin: 0;\n\n & + span {\n position: relative;\n display: block;\n height: ", ";\n width: ", ";\n box-sizing: border-box;\n box-shadow: ", ";\n border-radius: ", ";\n line-height: 1;\n background-color: ", ";\n\n & > svg {\n display: block;\n position: absolute;\n opacity: 0;\n height: 100%;\n width: 100%;\n\n & > path {\n vector-effect: non-scaling-stroke;\n stroke-width: 1.5px !important;\n }\n }\n }\n\n &:checked + span {\n background: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n\n /* focus */\n &:not(:disabled):focus:focus-visible + span {\n box-shadow: ", ";\n }\n\n /* focus when checked - uses a different offset */\n &:not(:disabled):focus:focus-visible&:checked + span {\n box-shadow: ", ";\n }\n\n &[data-error] + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n &[data-error]&:checked + span {\n background-color: ", ";\n color: ", ";\n }\n &[data-error]&:checked&:not(:disabled):focus:focus-visible + span {\n box-shadow: ", ";\n }\n\n &:disabled + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n &:disabled&:checked + span {\n background-color: ", ";\n }\n\n &[data-read-only] + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n\n &[data-read-only]&:checked + span {\n background-color: ", ";\n }\n\n &:checked + span > svg:first-child {\n opacity: 1;\n }\n &:indeterminate + span > svg:last-child {\n opacity: 1;\n }\n "])), rem(input.checkbox.size), rem(input.checkbox.size), focusRingBorderStyle({
|
|
2584
2623
|
color: color.input.default.enabled.border,
|
|
2585
2624
|
width: input.border.width
|
|
2586
2625
|
}), rem(radius[2]), color.input.default.enabled.bg, color.input.default.enabled.fg, focusRingBorderStyle({
|
|
@@ -2613,7 +2652,7 @@ function inputElementStyles(props) {
|
|
|
2613
2652
|
color: color.input.default.readOnly.border
|
|
2614
2653
|
}), color.input.default.readOnly.fg, color.input.default.readOnly.muted.bg);
|
|
2615
2654
|
}
|
|
2616
|
-
const Root$
|
|
2655
|
+
const Root$r = styled.div(checkboxBaseStyles);
|
|
2617
2656
|
const Input$5 = styled.input(inputElementStyles);
|
|
2618
2657
|
const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
|
|
2619
2658
|
const {
|
|
@@ -2633,7 +2672,7 @@ const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
|
|
|
2633
2672
|
ref.current.indeterminate = indeterminate || false;
|
|
2634
2673
|
}
|
|
2635
2674
|
}, [indeterminate, ref]);
|
|
2636
|
-
return /* @__PURE__ */jsxs(Root$
|
|
2675
|
+
return /* @__PURE__ */jsxs(Root$r, {
|
|
2637
2676
|
className,
|
|
2638
2677
|
"data-ui": "Checkbox",
|
|
2639
2678
|
style,
|
|
@@ -2651,12 +2690,12 @@ const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
|
|
|
2651
2690
|
})]
|
|
2652
2691
|
});
|
|
2653
2692
|
});
|
|
2654
|
-
var __freeze$
|
|
2655
|
-
var __defProp$
|
|
2656
|
-
var __template$
|
|
2657
|
-
value: __freeze$
|
|
2693
|
+
var __freeze$t = Object.freeze;
|
|
2694
|
+
var __defProp$u = Object.defineProperty;
|
|
2695
|
+
var __template$t = (cooked, raw) => __freeze$t(__defProp$u(cooked, "raw", {
|
|
2696
|
+
value: __freeze$t(raw || cooked.slice())
|
|
2658
2697
|
}));
|
|
2659
|
-
var _a$
|
|
2698
|
+
var _a$t;
|
|
2660
2699
|
function codeSyntaxHighlightingStyle(_ref2) {
|
|
2661
2700
|
let {
|
|
2662
2701
|
theme
|
|
@@ -2778,9 +2817,9 @@ function codeSyntaxHighlightingStyle(_ref2) {
|
|
|
2778
2817
|
};
|
|
2779
2818
|
}
|
|
2780
2819
|
function codeBaseStyle() {
|
|
2781
|
-
return css(_a$
|
|
2820
|
+
return css(_a$t || (_a$t = __template$t(["\n color: var(--card-code-fg-color);\n\n & code {\n font-family: inherit;\n\n &.refractor .token {\n ", "\n }\n }\n\n & a {\n color: inherit;\n text-decoration: underline;\n border-radius: 1px;\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), codeSyntaxHighlightingStyle);
|
|
2782
2821
|
}
|
|
2783
|
-
const Root$
|
|
2822
|
+
const Root$q = styled.pre(codeBaseStyle, responsiveCodeFontStyle);
|
|
2784
2823
|
const Code = forwardRef(function Code2(props, ref) {
|
|
2785
2824
|
const {
|
|
2786
2825
|
children,
|
|
@@ -2791,7 +2830,7 @@ const Code = forwardRef(function Code2(props, ref) {
|
|
|
2791
2830
|
} = props;
|
|
2792
2831
|
const language = typeof languageProp === "string" ? languageProp : void 0;
|
|
2793
2832
|
const registered = language ? Refractor.hasLanguage(language) : false;
|
|
2794
|
-
return /* @__PURE__ */jsxs(Root$
|
|
2833
|
+
return /* @__PURE__ */jsxs(Root$q, {
|
|
2795
2834
|
"data-ui": "Code",
|
|
2796
2835
|
...restProps,
|
|
2797
2836
|
$size: useArrayProp(size),
|
|
@@ -2822,14 +2861,14 @@ function responsiveContainerWidthStyle(props) {
|
|
|
2822
2861
|
maxWidth: val === "auto" ? "none" : rem(container[val])
|
|
2823
2862
|
}));
|
|
2824
2863
|
}
|
|
2825
|
-
const Root$
|
|
2864
|
+
const Root$p = styled(Box)(containerBaseStyle, responsiveContainerWidthStyle);
|
|
2826
2865
|
const Container = forwardRef(function Container2(props, ref) {
|
|
2827
2866
|
const {
|
|
2828
2867
|
as,
|
|
2829
2868
|
width = 2,
|
|
2830
2869
|
...restProps
|
|
2831
2870
|
} = props;
|
|
2832
|
-
return /* @__PURE__ */jsx(Root$
|
|
2871
|
+
return /* @__PURE__ */jsx(Root$p, {
|
|
2833
2872
|
"data-ui": "Container",
|
|
2834
2873
|
...restProps,
|
|
2835
2874
|
$width: useArrayProp(width),
|
|
@@ -2837,7 +2876,7 @@ const Container = forwardRef(function Container2(props, ref) {
|
|
|
2837
2876
|
ref
|
|
2838
2877
|
});
|
|
2839
2878
|
});
|
|
2840
|
-
const Root$
|
|
2879
|
+
const Root$o = styled(Box)(responsiveGridStyle);
|
|
2841
2880
|
const Grid = forwardRef(function Grid2(props, ref) {
|
|
2842
2881
|
const {
|
|
2843
2882
|
as,
|
|
@@ -2852,7 +2891,7 @@ const Grid = forwardRef(function Grid2(props, ref) {
|
|
|
2852
2891
|
children,
|
|
2853
2892
|
...restProps
|
|
2854
2893
|
} = props;
|
|
2855
|
-
return /* @__PURE__ */jsx(Root$
|
|
2894
|
+
return /* @__PURE__ */jsx(Root$o, {
|
|
2856
2895
|
"data-as": typeof as === "string" ? as : void 0,
|
|
2857
2896
|
"data-ui": "Grid",
|
|
2858
2897
|
...restProps,
|
|
@@ -2869,12 +2908,12 @@ const Grid = forwardRef(function Grid2(props, ref) {
|
|
|
2869
2908
|
children
|
|
2870
2909
|
});
|
|
2871
2910
|
});
|
|
2872
|
-
var __freeze$
|
|
2873
|
-
var __defProp$
|
|
2874
|
-
var __template$
|
|
2875
|
-
value: __freeze$
|
|
2911
|
+
var __freeze$s = Object.freeze;
|
|
2912
|
+
var __defProp$t = Object.defineProperty;
|
|
2913
|
+
var __template$s = (cooked, raw) => __freeze$s(__defProp$t(cooked, "raw", {
|
|
2914
|
+
value: __freeze$s(raw || cooked.slice())
|
|
2876
2915
|
}));
|
|
2877
|
-
var _a$
|
|
2916
|
+
var _a$s, _b$g, _c$8;
|
|
2878
2917
|
function headingBaseStyle(props) {
|
|
2879
2918
|
const {
|
|
2880
2919
|
$accent,
|
|
@@ -2883,16 +2922,16 @@ function headingBaseStyle(props) {
|
|
|
2883
2922
|
const {
|
|
2884
2923
|
font
|
|
2885
2924
|
} = getTheme_v2(props.theme);
|
|
2886
|
-
return css(_c$8 || (_c$8 = __template$
|
|
2925
|
+
return css(_c$8 || (_c$8 = __template$s(["\n ", "\n\n ", "\n\n & code {\n font-family: ", ";\n border-radius: 1px;\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), $accent && css(_a$s || (_a$s = __template$s(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_b$g || (_b$g = __template$s(["\n color: var(--card-muted-fg-color);\n "]))), font.code.family);
|
|
2887
2926
|
}
|
|
2888
|
-
var __freeze$
|
|
2889
|
-
var __defProp$
|
|
2890
|
-
var __template$
|
|
2891
|
-
value: __freeze$
|
|
2927
|
+
var __freeze$r = Object.freeze;
|
|
2928
|
+
var __defProp$s = Object.defineProperty;
|
|
2929
|
+
var __template$r = (cooked, raw) => __freeze$r(__defProp$s(cooked, "raw", {
|
|
2930
|
+
value: __freeze$r(raw || cooked.slice())
|
|
2892
2931
|
}));
|
|
2893
|
-
var _a$
|
|
2894
|
-
const Root$
|
|
2895
|
-
const SpanWithTextOverflow = styled.span(_a$
|
|
2932
|
+
var _a$r;
|
|
2933
|
+
const Root$n = styled.div(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont);
|
|
2934
|
+
const SpanWithTextOverflow = styled.span(_a$r || (_a$r = __template$r(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n overflow: clip;\n"])));
|
|
2896
2935
|
const Heading = forwardRef(function Heading2(props, ref) {
|
|
2897
2936
|
const {
|
|
2898
2937
|
accent = false,
|
|
@@ -2910,7 +2949,7 @@ const Heading = forwardRef(function Heading2(props, ref) {
|
|
|
2910
2949
|
children
|
|
2911
2950
|
});
|
|
2912
2951
|
}
|
|
2913
|
-
return /* @__PURE__ */jsx(Root$
|
|
2952
|
+
return /* @__PURE__ */jsx(Root$n, {
|
|
2914
2953
|
"data-ui": "Heading",
|
|
2915
2954
|
...restProps,
|
|
2916
2955
|
$accent: accent,
|
|
@@ -2951,7 +2990,7 @@ function inlineSpaceStyle(props) {
|
|
|
2951
2990
|
};
|
|
2952
2991
|
});
|
|
2953
2992
|
}
|
|
2954
|
-
const Root$
|
|
2993
|
+
const Root$m = styled(Box)(inlineBaseStyle, inlineSpaceStyle);
|
|
2955
2994
|
const Inline = forwardRef(function Inline2(props, ref) {
|
|
2956
2995
|
const {
|
|
2957
2996
|
as,
|
|
@@ -2962,7 +3001,7 @@ const Inline = forwardRef(function Inline2(props, ref) {
|
|
|
2962
3001
|
const children = useMemo(() => childrenToElementArray(childrenProp).filter(Boolean).map((child, idx) => /* @__PURE__ */jsx("div", {
|
|
2963
3002
|
children: child
|
|
2964
3003
|
}, idx)), [childrenProp]);
|
|
2965
|
-
return /* @__PURE__ */jsx(Root$
|
|
3004
|
+
return /* @__PURE__ */jsx(Root$m, {
|
|
2966
3005
|
"data-ui": "Inline",
|
|
2967
3006
|
...restProps,
|
|
2968
3007
|
$space: useArrayProp(space),
|
|
@@ -2971,16 +3010,16 @@ const Inline = forwardRef(function Inline2(props, ref) {
|
|
|
2971
3010
|
children
|
|
2972
3011
|
});
|
|
2973
3012
|
});
|
|
2974
|
-
var __freeze$
|
|
2975
|
-
var __defProp$
|
|
2976
|
-
var __template$
|
|
2977
|
-
value: __freeze$
|
|
3013
|
+
var __freeze$q = Object.freeze;
|
|
3014
|
+
var __defProp$r = Object.defineProperty;
|
|
3015
|
+
var __template$q = (cooked, raw) => __freeze$q(__defProp$r(cooked, "raw", {
|
|
3016
|
+
value: __freeze$q(raw || cooked.slice())
|
|
2978
3017
|
}));
|
|
2979
|
-
var _a$
|
|
3018
|
+
var _a$q;
|
|
2980
3019
|
function kbdStyle() {
|
|
2981
|
-
return css(_a$
|
|
3020
|
+
return css(_a$q || (_a$q = __template$q(["\n --card-bg-color: var(--card-kbd-bg-color);\n --card-border-color: var(--card-kbd-border-color);\n --card-fg-color: var(--card-kbd-fg-color);\n\n box-shadow: inset 0 0 0 1px var(--card-border-color);\n background: var(--card-bg-color);\n font: inherit;\n\n vertical-align: top;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
|
|
2982
3021
|
}
|
|
2983
|
-
const Root$
|
|
3022
|
+
const Root$l = styled.kbd(responsiveRadiusStyle, kbdStyle);
|
|
2984
3023
|
const KBD = forwardRef(function KBD2(props, ref) {
|
|
2985
3024
|
const {
|
|
2986
3025
|
children,
|
|
@@ -2989,7 +3028,7 @@ const KBD = forwardRef(function KBD2(props, ref) {
|
|
|
2989
3028
|
radius = 2,
|
|
2990
3029
|
...restProps
|
|
2991
3030
|
} = props;
|
|
2992
|
-
return /* @__PURE__ */jsx(Root$
|
|
3031
|
+
return /* @__PURE__ */jsx(Root$l, {
|
|
2993
3032
|
"data-ui": "KBD",
|
|
2994
3033
|
...restProps,
|
|
2995
3034
|
$radius: useArrayProp(radius),
|
|
@@ -3006,6 +3045,45 @@ const KBD = forwardRef(function KBD2(props, ref) {
|
|
|
3006
3045
|
})
|
|
3007
3046
|
});
|
|
3008
3047
|
});
|
|
3048
|
+
const origin = {
|
|
3049
|
+
name: "@sanity/ui/origin",
|
|
3050
|
+
fn(_ref3) {
|
|
3051
|
+
let {
|
|
3052
|
+
middlewareData,
|
|
3053
|
+
placement,
|
|
3054
|
+
rects
|
|
3055
|
+
} = _ref3;
|
|
3056
|
+
var _a, _b;
|
|
3057
|
+
const [side] = placement.split("-");
|
|
3058
|
+
const floatingWidth = rects.floating.width;
|
|
3059
|
+
const floatingHeight = rects.floating.height;
|
|
3060
|
+
const shiftX = ((_a = middlewareData.shift) == null ? void 0 : _a.x) || 0;
|
|
3061
|
+
const shiftY = ((_b = middlewareData.shift) == null ? void 0 : _b.y) || 0;
|
|
3062
|
+
if (floatingWidth <= 0 || floatingHeight <= 0) {
|
|
3063
|
+
return {};
|
|
3064
|
+
}
|
|
3065
|
+
const isVerticalPlacement = ["bottom", "top"].includes(side);
|
|
3066
|
+
const {
|
|
3067
|
+
originX,
|
|
3068
|
+
originY
|
|
3069
|
+
} = isVerticalPlacement ? {
|
|
3070
|
+
originX: clamp(0.5 - shiftX / floatingWidth, 0, 1),
|
|
3071
|
+
originY: side === "bottom" ? 0 : 1
|
|
3072
|
+
} : {
|
|
3073
|
+
originX: side === "left" ? 1 : 0,
|
|
3074
|
+
originY: clamp(0.5 - shiftY / floatingHeight, 0, 1)
|
|
3075
|
+
};
|
|
3076
|
+
return {
|
|
3077
|
+
data: {
|
|
3078
|
+
originX,
|
|
3079
|
+
originY
|
|
3080
|
+
}
|
|
3081
|
+
};
|
|
3082
|
+
}
|
|
3083
|
+
};
|
|
3084
|
+
function clamp(num, min, max) {
|
|
3085
|
+
return Math.min(Math.max(num, min), max);
|
|
3086
|
+
}
|
|
3009
3087
|
function moveTowardsLength(movingPoint, targetPoint, amount) {
|
|
3010
3088
|
const width = targetPoint.x - movingPoint.x;
|
|
3011
3089
|
const height = targetPoint.y - movingPoint.y;
|
|
@@ -3060,20 +3138,20 @@ function compileCommands(cmds) {
|
|
|
3060
3138
|
return "";
|
|
3061
3139
|
}).join(" ");
|
|
3062
3140
|
}
|
|
3063
|
-
var __freeze$
|
|
3064
|
-
var __defProp$
|
|
3065
|
-
var __template$
|
|
3066
|
-
value: __freeze$
|
|
3141
|
+
var __freeze$p = Object.freeze;
|
|
3142
|
+
var __defProp$q = Object.defineProperty;
|
|
3143
|
+
var __template$p = (cooked, raw) => __freeze$p(__defProp$q(cooked, "raw", {
|
|
3144
|
+
value: __freeze$p(raw || cooked.slice())
|
|
3067
3145
|
}));
|
|
3068
|
-
var _a$
|
|
3069
|
-
const Root$
|
|
3146
|
+
var _a$p, _b$f, _c$7;
|
|
3147
|
+
const Root$k = styled.div(_ref4 => {
|
|
3070
3148
|
let {
|
|
3071
3149
|
$w: w
|
|
3072
|
-
} =
|
|
3073
|
-
return css(_a$
|
|
3150
|
+
} = _ref4;
|
|
3151
|
+
return css(_a$p || (_a$p = __template$p(["\n position: absolute;\n width: ", "px;\n height: ", "px;\n\n :empty + & {\n display: none;\n }\n\n & > svg {\n display: block;\n line-height: 0;\n transform-origin: ", "px ", "px;\n }\n\n [data-placement^='top'] > & {\n bottom: -", "px;\n\n & > svg {\n transform: rotate(0);\n }\n }\n\n [data-placement^='right'] > & {\n left: -", "px;\n\n & > svg {\n transform: rotate(90deg);\n }\n }\n\n [data-placement^='left'] > & {\n right: -", "px;\n\n & > svg {\n transform: rotate(-90deg);\n }\n }\n\n [data-placement^='bottom'] > & {\n top: -", "px;\n\n & > svg {\n transform: rotate(180deg);\n }\n }\n "])), w, w, w / 2, w / 2, w, w, w, w);
|
|
3074
3152
|
});
|
|
3075
|
-
const StrokePath = styled.path(_b$f || (_b$f = __template$
|
|
3076
|
-
const ShapePath = styled.path(_c$7 || (_c$7 = __template$
|
|
3153
|
+
const StrokePath = styled.path(_b$f || (_b$f = __template$p(["\n stroke: var(--card-shadow-outline-color);\n"])));
|
|
3154
|
+
const ShapePath = styled.path(_c$7 || (_c$7 = __template$p(["\n fill: var(--card-bg-color);\n"])));
|
|
3077
3155
|
const Arrow = forwardRef(function Arrow2(props, ref) {
|
|
3078
3156
|
const {
|
|
3079
3157
|
width: w,
|
|
@@ -3109,7 +3187,7 @@ const Arrow = forwardRef(function Arrow2(props, ref) {
|
|
|
3109
3187
|
const path = compileCommands(cmds);
|
|
3110
3188
|
const strokePath = "".concat(path);
|
|
3111
3189
|
const fillPath = "".concat(path, " M ").concat(w, " -1 M 0 -1 Z");
|
|
3112
|
-
return /* @__PURE__ */jsx(Root$
|
|
3190
|
+
return /* @__PURE__ */jsx(Root$k, {
|
|
3113
3191
|
...restProps,
|
|
3114
3192
|
$w: w,
|
|
3115
3193
|
ref,
|
|
@@ -3167,6 +3245,17 @@ function useBoundaryElement() {
|
|
|
3167
3245
|
}
|
|
3168
3246
|
return value || DEFAULT_VALUE;
|
|
3169
3247
|
}
|
|
3248
|
+
function ConditionalWrapper(_ref5) {
|
|
3249
|
+
let {
|
|
3250
|
+
children,
|
|
3251
|
+
condition,
|
|
3252
|
+
wrapper
|
|
3253
|
+
} = _ref5;
|
|
3254
|
+
if (!condition) {
|
|
3255
|
+
return children;
|
|
3256
|
+
}
|
|
3257
|
+
return wrapper(children);
|
|
3258
|
+
}
|
|
3170
3259
|
function findMaxBreakpoints(media, width) {
|
|
3171
3260
|
const ret = [];
|
|
3172
3261
|
for (let i = 0; i < media.length; i += 1) {
|
|
@@ -3216,8 +3305,8 @@ const ElementQuery = forwardRef(function ElementQuery2(props, ref) {
|
|
|
3216
3305
|
children
|
|
3217
3306
|
});
|
|
3218
3307
|
});
|
|
3219
|
-
var __defProp$
|
|
3220
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp$
|
|
3308
|
+
var __defProp$p = Object.defineProperty;
|
|
3309
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp$p(obj, key, {
|
|
3221
3310
|
enumerable: true,
|
|
3222
3311
|
configurable: true,
|
|
3223
3312
|
writable: true,
|
|
@@ -3446,7 +3535,7 @@ function LayerProvider(props) {
|
|
|
3446
3535
|
children
|
|
3447
3536
|
});
|
|
3448
3537
|
}
|
|
3449
|
-
const Root$
|
|
3538
|
+
const Root$j = styled.div({
|
|
3450
3539
|
position: "relative"
|
|
3451
3540
|
});
|
|
3452
3541
|
const LayerChildren = forwardRef(function LayerChildren2(props, ref) {
|
|
@@ -3482,7 +3571,7 @@ const LayerChildren = forwardRef(function LayerChildren2(props, ref) {
|
|
|
3482
3571
|
lastFocusedRef.current = target;
|
|
3483
3572
|
}
|
|
3484
3573
|
}, [forwardedRef, isTopLayer, onFocus]);
|
|
3485
|
-
return /* @__PURE__ */jsx(Root$
|
|
3574
|
+
return /* @__PURE__ */jsx(Root$j, {
|
|
3486
3575
|
...restProps,
|
|
3487
3576
|
"data-ui": "Layer",
|
|
3488
3577
|
onFocus: handleFocus,
|
|
@@ -3593,19 +3682,19 @@ function PortalProvider(props) {
|
|
|
3593
3682
|
children
|
|
3594
3683
|
});
|
|
3595
3684
|
}
|
|
3596
|
-
var __freeze$
|
|
3597
|
-
var __defProp$
|
|
3598
|
-
var __template$
|
|
3599
|
-
value: __freeze$
|
|
3685
|
+
var __freeze$o = Object.freeze;
|
|
3686
|
+
var __defProp$o = Object.defineProperty;
|
|
3687
|
+
var __template$o = (cooked, raw) => __freeze$o(__defProp$o(cooked, "raw", {
|
|
3688
|
+
value: __freeze$o(raw || cooked.slice())
|
|
3600
3689
|
}));
|
|
3601
|
-
var _a$
|
|
3602
|
-
const Root$
|
|
3690
|
+
var _a$o;
|
|
3691
|
+
const Root$i = styled.div(_a$o || (_a$o = __template$o(["\n display: block;\n width: 0;\n height: 0;\n position: absolute;\n overflow: hidden;\n overflow: clip;\n"])));
|
|
3603
3692
|
const SrOnly = forwardRef(function SrOnly2(props, ref) {
|
|
3604
3693
|
const {
|
|
3605
3694
|
as,
|
|
3606
3695
|
children
|
|
3607
3696
|
} = props;
|
|
3608
|
-
return /* @__PURE__ */jsx(Root$
|
|
3697
|
+
return /* @__PURE__ */jsx(Root$i, {
|
|
3609
3698
|
"aria-hidden": true,
|
|
3610
3699
|
as,
|
|
3611
3700
|
"data-ui": "SrOnly",
|
|
@@ -3613,14 +3702,14 @@ const SrOnly = forwardRef(function SrOnly2(props, ref) {
|
|
|
3613
3702
|
children
|
|
3614
3703
|
});
|
|
3615
3704
|
});
|
|
3616
|
-
var __freeze$
|
|
3617
|
-
var __defProp$
|
|
3618
|
-
var __template$
|
|
3619
|
-
value: __freeze$
|
|
3705
|
+
var __freeze$n = Object.freeze;
|
|
3706
|
+
var __defProp$n = Object.defineProperty;
|
|
3707
|
+
var __template$n = (cooked, raw) => __freeze$n(__defProp$n(cooked, "raw", {
|
|
3708
|
+
value: __freeze$n(raw || cooked.slice())
|
|
3620
3709
|
}));
|
|
3621
|
-
var _a$
|
|
3622
|
-
const Root$
|
|
3623
|
-
const ItemWrapper = styled.div(_b$e || (_b$e = __template$
|
|
3710
|
+
var _a$n, _b$e;
|
|
3711
|
+
const Root$h = styled.div(_a$n || (_a$n = __template$n(["\n position: relative;\n"])));
|
|
3712
|
+
const ItemWrapper = styled.div(_b$e || (_b$e = __template$n(["\n position: absolute;\n left: 0;\n right: 0;\n"])));
|
|
3624
3713
|
const VirtualList = forwardRef(function VirtualList2(props, ref) {
|
|
3625
3714
|
const {
|
|
3626
3715
|
as = "div",
|
|
@@ -3726,7 +3815,7 @@ const VirtualList = forwardRef(function VirtualList2(props, ref) {
|
|
|
3726
3815
|
const wrapperStyle = useMemo(() => ({
|
|
3727
3816
|
height
|
|
3728
3817
|
}), [height]);
|
|
3729
|
-
return /* @__PURE__ */jsx(Root$
|
|
3818
|
+
return /* @__PURE__ */jsx(Root$h, {
|
|
3730
3819
|
as,
|
|
3731
3820
|
"data-ui": "VirtualList",
|
|
3732
3821
|
...restProps,
|
|
@@ -3844,17 +3933,17 @@ function calcMaxWidth(params) {
|
|
|
3844
3933
|
}
|
|
3845
3934
|
return Math.min(currentWidth != null ? currentWidth : Infinity, (boundaryWidth || Infinity) - DEFAULT_POPOVER_PADDING * 2);
|
|
3846
3935
|
}
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
});
|
|
3936
|
+
var __freeze$m = Object.freeze;
|
|
3937
|
+
var __defProp$m = Object.defineProperty;
|
|
3938
|
+
var __template$m = (cooked, raw) => __freeze$m(__defProp$m(cooked, "raw", {
|
|
3939
|
+
value: __freeze$m(raw || cooked.slice())
|
|
3940
|
+
}));
|
|
3941
|
+
var _a$m;
|
|
3942
|
+
const MotionCard$1 = styled(motion(Card))(_a$m || (_a$m = __template$m(["\n &:not([hidden]) {\n display: flex;\n }\n flex-direction: column;\n width: max-content;\n min-width: min-content;\n"])));
|
|
3855
3943
|
const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
3856
3944
|
const {
|
|
3857
3945
|
__unstable_margins: marginsProp,
|
|
3946
|
+
animate,
|
|
3858
3947
|
arrow,
|
|
3859
3948
|
arrowRef,
|
|
3860
3949
|
arrowX,
|
|
@@ -3862,6 +3951,8 @@ const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
|
3862
3951
|
children,
|
|
3863
3952
|
padding,
|
|
3864
3953
|
placement,
|
|
3954
|
+
originX,
|
|
3955
|
+
originY,
|
|
3865
3956
|
overflow,
|
|
3866
3957
|
radius,
|
|
3867
3958
|
scheme,
|
|
@@ -3881,20 +3972,22 @@ const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
|
3881
3972
|
const x = (xProp != null ? xProp : 0) + margins[3];
|
|
3882
3973
|
const y = (yProp != null ? yProp : 0) + margins[0];
|
|
3883
3974
|
const rootStyle = useMemo(() => ({
|
|
3975
|
+
left: x,
|
|
3976
|
+
originX,
|
|
3977
|
+
originY,
|
|
3884
3978
|
position: strategy,
|
|
3885
3979
|
top: y,
|
|
3886
|
-
left: x,
|
|
3887
3980
|
width,
|
|
3888
3981
|
zIndex,
|
|
3889
3982
|
...style
|
|
3890
|
-
}), [strategy, style, width, x, y, zIndex]);
|
|
3983
|
+
}), [originX, originY, strategy, style, width, x, y, zIndex]);
|
|
3891
3984
|
const arrowStyle = useMemo(() => ({
|
|
3892
3985
|
left: arrowX !== null ? arrowX : void 0,
|
|
3893
3986
|
top: arrowY !== null ? arrowY : void 0,
|
|
3894
3987
|
right: void 0,
|
|
3895
3988
|
bottom: void 0
|
|
3896
3989
|
}), [arrowX, arrowY]);
|
|
3897
|
-
return /* @__PURE__ */jsxs(
|
|
3990
|
+
return /* @__PURE__ */jsxs(MotionCard$1, {
|
|
3898
3991
|
"data-ui": "Popover",
|
|
3899
3992
|
...restProps,
|
|
3900
3993
|
"data-placement": placement,
|
|
@@ -3905,6 +3998,7 @@ const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
|
3905
3998
|
sizing: "border",
|
|
3906
3999
|
style: rootStyle,
|
|
3907
4000
|
tone,
|
|
4001
|
+
...(animate ? POPOVER_MOTION_PROPS : {}),
|
|
3908
4002
|
children: [/* @__PURE__ */jsx(Flex, {
|
|
3909
4003
|
"data-ui": "Popover__wrapper",
|
|
3910
4004
|
direction: "column",
|
|
@@ -3927,7 +4021,7 @@ const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
|
3927
4021
|
}));
|
|
3928
4022
|
PopoverCard.displayName = "PopoverCard";
|
|
3929
4023
|
const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
3930
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4024
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
3931
4025
|
const {
|
|
3932
4026
|
container,
|
|
3933
4027
|
layer
|
|
@@ -3935,6 +4029,7 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
3935
4029
|
const boundaryElementContext = useBoundaryElement();
|
|
3936
4030
|
const {
|
|
3937
4031
|
__unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
|
|
4032
|
+
animate = false,
|
|
3938
4033
|
arrow: arrowProp = false,
|
|
3939
4034
|
boundaryElement = boundaryElementContext.element,
|
|
3940
4035
|
children: childProp,
|
|
@@ -4022,13 +4117,13 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4022
4117
|
}));
|
|
4023
4118
|
if (constrainSize || matchReferenceWidth) {
|
|
4024
4119
|
ret.push(size({
|
|
4025
|
-
apply(
|
|
4120
|
+
apply(_ref6) {
|
|
4026
4121
|
let {
|
|
4027
4122
|
availableWidth,
|
|
4028
4123
|
availableHeight,
|
|
4029
4124
|
elements,
|
|
4030
4125
|
referenceWidth
|
|
4031
|
-
} =
|
|
4126
|
+
} = _ref6;
|
|
4032
4127
|
referenceWidthRef.current = referenceWidth;
|
|
4033
4128
|
const _currentWidth = widthRef.current;
|
|
4034
4129
|
const _maxWidth = maxWidthRef.current;
|
|
@@ -4062,13 +4157,16 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4062
4157
|
padding: DEFAULT_POPOVER_PADDING
|
|
4063
4158
|
}));
|
|
4064
4159
|
}
|
|
4160
|
+
if (animate) {
|
|
4161
|
+
ret.push(origin);
|
|
4162
|
+
}
|
|
4065
4163
|
ret.push(hide({
|
|
4066
4164
|
boundary: referenceBoundary || void 0,
|
|
4067
4165
|
padding: DEFAULT_POPOVER_PADDING,
|
|
4068
4166
|
strategy: "referenceHidden"
|
|
4069
4167
|
}));
|
|
4070
4168
|
return ret;
|
|
4071
|
-
}, [arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]);
|
|
4169
|
+
}, [animate, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]);
|
|
4072
4170
|
const {
|
|
4073
4171
|
x,
|
|
4074
4172
|
y,
|
|
@@ -4085,6 +4183,8 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4085
4183
|
const referenceHidden = (_f = middlewareData.hide) == null ? void 0 : _f.referenceHidden;
|
|
4086
4184
|
const arrowX = (_g = middlewareData.arrow) == null ? void 0 : _g.x;
|
|
4087
4185
|
const arrowY = (_h = middlewareData.arrow) == null ? void 0 : _h.y;
|
|
4186
|
+
const originX = (_i = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _i.originX;
|
|
4187
|
+
const originY = (_j = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _j.originY;
|
|
4088
4188
|
const setArrow = useCallback(arrowEl => {
|
|
4089
4189
|
arrowRef.current = arrowEl;
|
|
4090
4190
|
}, []);
|
|
@@ -4127,6 +4227,7 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4127
4227
|
children: /* @__PURE__ */jsx(PopoverCard, {
|
|
4128
4228
|
...restProps,
|
|
4129
4229
|
__unstable_margins: margins,
|
|
4230
|
+
animate,
|
|
4130
4231
|
arrow: arrowProp,
|
|
4131
4232
|
arrowRef: setArrow,
|
|
4132
4233
|
arrowX,
|
|
@@ -4139,6 +4240,8 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4139
4240
|
ref: setFloating,
|
|
4140
4241
|
scheme,
|
|
4141
4242
|
shadow,
|
|
4243
|
+
originX,
|
|
4244
|
+
originY,
|
|
4142
4245
|
strategy,
|
|
4143
4246
|
tone,
|
|
4144
4247
|
width: matchReferenceWidth ? referenceWidthRef.current : width,
|
|
@@ -4148,23 +4251,31 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4148
4251
|
})
|
|
4149
4252
|
});
|
|
4150
4253
|
return /* @__PURE__ */jsxs(Fragment, {
|
|
4151
|
-
children: [
|
|
4152
|
-
|
|
4153
|
-
|
|
4254
|
+
children: [/* @__PURE__ */jsx(ConditionalWrapper, {
|
|
4255
|
+
condition: animate,
|
|
4256
|
+
wrapper: children => /* @__PURE__ */jsx(AnimatePresence, {
|
|
4257
|
+
children
|
|
4258
|
+
}),
|
|
4259
|
+
children: open && /* @__PURE__ */jsx(ConditionalWrapper, {
|
|
4260
|
+
condition: !!portal,
|
|
4261
|
+
wrapper: children => /* @__PURE__ */jsx(Portal, {
|
|
4262
|
+
__unstable_name: typeof portal === "string" ? portal : void 0,
|
|
4263
|
+
children
|
|
4264
|
+
}),
|
|
4154
4265
|
children: popover
|
|
4155
|
-
})
|
|
4266
|
+
})
|
|
4156
4267
|
}), child]
|
|
4157
4268
|
});
|
|
4158
4269
|
}));
|
|
4159
4270
|
Popover.displayName = "Popover";
|
|
4160
|
-
var __freeze$
|
|
4161
|
-
var __defProp$
|
|
4162
|
-
var __template$
|
|
4163
|
-
value: __freeze$
|
|
4271
|
+
var __freeze$l = Object.freeze;
|
|
4272
|
+
var __defProp$l = Object.defineProperty;
|
|
4273
|
+
var __template$l = (cooked, raw) => __freeze$l(__defProp$l(cooked, "raw", {
|
|
4274
|
+
value: __freeze$l(raw || cooked.slice())
|
|
4164
4275
|
}));
|
|
4165
|
-
var _a$
|
|
4276
|
+
var _a$l, _b$d;
|
|
4166
4277
|
function radioBaseStyle() {
|
|
4167
|
-
return css(_a$
|
|
4278
|
+
return css(_a$l || (_a$l = __template$l(["\n position: relative;\n\n &:not([hidden]) {\n display: inline-block;\n }\n\n &[data-read-only] {\n outline: 1px solid red;\n }\n "])));
|
|
4168
4279
|
}
|
|
4169
4280
|
function inputElementStyle(props) {
|
|
4170
4281
|
const {
|
|
@@ -4172,7 +4283,7 @@ function inputElementStyle(props) {
|
|
|
4172
4283
|
input
|
|
4173
4284
|
} = getTheme_v2(props.theme);
|
|
4174
4285
|
const dist = (input.radio.size - input.radio.markSize) / 2;
|
|
4175
|
-
return css(_b$d || (_b$d = __template$
|
|
4286
|
+
return css(_b$d || (_b$d = __template$l(["\n appearance: none;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n z-index: 1;\n padding: 0;\n margin: 0;\n border-radius: ", ";\n border: none;\n\n /* enabled */\n & + span {\n display: block;\n position: relative;\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n\n &::after {\n content: '';\n position: absolute;\n top: ", ";\n left: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n opacity: 0;\n }\n }\n\n /* focused */\n &:not(:disabled):focus + span {\n box-shadow: ", ";\n }\n\n &:not(:disabled):focus:not(:focus-visible) + span {\n box-shadow: ", ";\n }\n\n &:checked + span::after {\n opacity: 1;\n }\n\n /* customValidity */\n &[data-error] + span {\n background-color: ", ";\n box-shadow: ", ";\n &::after {\n background: ", ";\n }\n }\n\n /* read only */\n &[data-read-only] + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n\n /* disabled */\n &:not([data-read-only]):disabled + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n "])), rem(input.radio.size / 2), rem(input.radio.size), rem(input.radio.size), rem(input.radio.size / 2), color.input.default.enabled.bg, focusRingBorderStyle({
|
|
4176
4287
|
color: color.input.default.enabled.border,
|
|
4177
4288
|
width: input.border.width
|
|
4178
4289
|
}), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.input.default.enabled.fg, focusRingStyle({
|
|
@@ -4217,27 +4328,27 @@ const Radio = forwardRef(function Radio2(props, forwardedRef) {
|
|
|
4217
4328
|
}), /* @__PURE__ */jsx("span", {})]
|
|
4218
4329
|
});
|
|
4219
4330
|
});
|
|
4220
|
-
var __freeze$
|
|
4221
|
-
var __defProp$
|
|
4222
|
-
var __template$
|
|
4223
|
-
value: __freeze$
|
|
4331
|
+
var __freeze$k = Object.freeze;
|
|
4332
|
+
var __defProp$k = Object.defineProperty;
|
|
4333
|
+
var __template$k = (cooked, raw) => __freeze$k(__defProp$k(cooked, "raw", {
|
|
4334
|
+
value: __freeze$k(raw || cooked.slice())
|
|
4224
4335
|
}));
|
|
4225
|
-
var _a$
|
|
4336
|
+
var _a$k, _b$c, _c$6, _d$5;
|
|
4226
4337
|
function rootStyle() {
|
|
4227
|
-
return css(_a$
|
|
4338
|
+
return css(_a$k || (_a$k = __template$k(["\n position: relative;\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
|
|
4228
4339
|
}
|
|
4229
4340
|
function inputBaseStyle(props) {
|
|
4230
4341
|
const {
|
|
4231
4342
|
font
|
|
4232
4343
|
} = getTheme_v2(props.theme);
|
|
4233
|
-
return css(_b$c || (_b$c = __template$
|
|
4344
|
+
return css(_b$c || (_b$c = __template$k(["\n -webkit-font-smoothing: antialiased;\n appearance: none;\n border: 0;\n font-family: ", ";\n color: inherit;\n width: 100%;\n outline: none;\n margin: 0;\n\n &:disabled {\n opacity: 1;\n }\n "])), font.text.family);
|
|
4234
4345
|
}
|
|
4235
4346
|
function inputColorStyle(props) {
|
|
4236
4347
|
const {
|
|
4237
4348
|
color,
|
|
4238
4349
|
input
|
|
4239
4350
|
} = getTheme_v2(props.theme);
|
|
4240
|
-
return css(_c$6 || (_c$6 = __template$
|
|
4351
|
+
return css(_c$6 || (_c$6 = __template$k(["\n /* enabled */\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n\n /* hovered */\n @media (hover: hover) {\n &:not(:disabled):hover {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n }\n\n /* focused */\n &:not(:disabled):focus {\n box-shadow: ", ";\n }\n\n /* read-only */\n &[data-read-only] {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n\n /* disabled */\n &:not([data-read-only]):disabled {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n "])), color.input.default.enabled.bg, color.input.default.enabled.fg, focusRingBorderStyle({
|
|
4241
4352
|
color: color.input.default.enabled.border,
|
|
4242
4353
|
width: input.border.width
|
|
4243
4354
|
}), color.input.default.hovered.bg, color.input.default.hovered.fg, focusRingBorderStyle({
|
|
@@ -4280,7 +4391,7 @@ function iconBoxStyle(props) {
|
|
|
4280
4391
|
const {
|
|
4281
4392
|
color
|
|
4282
4393
|
} = getTheme_v2(props.theme);
|
|
4283
|
-
return css(_d$5 || (_d$5 = __template$
|
|
4394
|
+
return css(_d$5 || (_d$5 = __template$k(["\n pointer-events: none;\n position: absolute;\n top: 0;\n right: 0;\n\n /* enabled */\n --card-fg-color: ", ";\n\n /* hover */\n @media (hover: hover) {\n select:not(disabled):not(:read-only):hover + && {\n --card-fg-color: ", ";\n }\n }\n\n /* disabled */\n select:disabled + && {\n --card-fg-color: ", ";\n }\n\n /* read-only */\n select[data-read-only] + && {\n --card-fg-color: ", ";\n }\n "])), color.input.default.enabled.fg, color.input.default.hovered.fg, color.input.default.disabled.fg, color.input.default.readOnly.fg);
|
|
4284
4395
|
}
|
|
4285
4396
|
const selectStyle = {
|
|
4286
4397
|
root: rootStyle,
|
|
@@ -4297,7 +4408,7 @@ const Select = forwardRef(function Select2(props, forwardedRef) {
|
|
|
4297
4408
|
disabled,
|
|
4298
4409
|
fontSize = 2,
|
|
4299
4410
|
padding = 3,
|
|
4300
|
-
radius =
|
|
4411
|
+
radius = 2,
|
|
4301
4412
|
readOnly,
|
|
4302
4413
|
space = 3,
|
|
4303
4414
|
...restProps
|
|
@@ -4364,32 +4475,32 @@ const Stack = forwardRef(function Stack2(props, ref) {
|
|
|
4364
4475
|
ref
|
|
4365
4476
|
});
|
|
4366
4477
|
});
|
|
4367
|
-
var __freeze$
|
|
4368
|
-
var __defProp$
|
|
4369
|
-
var __template$
|
|
4370
|
-
value: __freeze$
|
|
4478
|
+
var __freeze$j = Object.freeze;
|
|
4479
|
+
var __defProp$j = Object.defineProperty;
|
|
4480
|
+
var __template$j = (cooked, raw) => __freeze$j(__defProp$j(cooked, "raw", {
|
|
4481
|
+
value: __freeze$j(raw || cooked.slice())
|
|
4371
4482
|
}));
|
|
4372
|
-
var _a$
|
|
4483
|
+
var _a$j, _b$b, _c$5, _d$4, _e$2, _f$2, _g;
|
|
4373
4484
|
function switchBaseStyles() {
|
|
4374
|
-
return css(_a$
|
|
4485
|
+
return css(_a$j || (_a$j = __template$j(["\n position: relative;\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
|
|
4375
4486
|
}
|
|
4376
4487
|
function switchInputStyles() {
|
|
4377
|
-
return css(_b$b || (_b$b = __template$
|
|
4488
|
+
return css(_b$b || (_b$b = __template$j(["\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n padding: 0;\n margin: 0;\n\n /* Place the input element above the representation element */\n z-index: 1;\n "])));
|
|
4378
4489
|
}
|
|
4379
4490
|
function switchRepresentationStyles(props) {
|
|
4380
4491
|
const {
|
|
4381
4492
|
color,
|
|
4382
4493
|
input
|
|
4383
4494
|
} = getTheme_v2(props.theme);
|
|
4384
|
-
return css(_c$5 || (_c$5 = __template$
|
|
4495
|
+
return css(_c$5 || (_c$5 = __template$j(["\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n --switch-box-shadow: none;\n\n &:not([hidden]) {\n display: block;\n }\n position: relative;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n\n /* Make sure it\u2019s not possible to interact with the wrapper element */\n pointer-events: none;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n box-shadow: var(--switch-box-shadow);\n border-radius: inherit;\n }\n\n /* Focus styles */\n input:focus + && {\n --switch-box-shadow: ", ";\n }\n\n input:focus:not(:focus-visible) + && {\n --switch-box-shadow: none;\n }\n\n input:checked + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n @media (hover: hover) {\n input:not(:disabled):hover + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n input:not(:disabled):checked:hover + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n }\n\n input:not([data-read-only]):disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n input[data-read-only]:disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n input:checked[data-read-only]:disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n "])), color.input.default.enabled.border, color.input.default.enabled.bg, rem(input.switch.width), rem(input.switch.height), rem(input.switch.height / 2), focusRingStyle({
|
|
4385
4496
|
focusRing: input.switch.focusRing
|
|
4386
|
-
}), color.input.default.enabled.fg, color.input.default.enabled.bg, color.input.default.hovered.border, color.input.default.hovered.bg, color.input.default.enabled.fg, color.input.default.enabled.bg, color.input.default.disabled.border, color.input.default.disabled.bg, color.input.default.readOnly.border, color.input.default.readOnly.bg);
|
|
4497
|
+
}), color.input.default.enabled.fg, color.input.default.enabled.bg, color.input.default.hovered.border, color.input.default.hovered.bg, color.input.default.enabled.fg, color.input.default.enabled.bg, color.input.default.disabled.border, color.input.default.disabled.bg, color.input.default.readOnly.border, color.input.default.readOnly.bg, color.input.default.readOnly.fg, color.input.default.readOnly.bg);
|
|
4387
4498
|
}
|
|
4388
4499
|
function switchTrackStyles(props) {
|
|
4389
4500
|
const {
|
|
4390
4501
|
input
|
|
4391
4502
|
} = getTheme_v2(props.theme);
|
|
4392
|
-
return css(_d$4 || (_d$4 = __template$
|
|
4503
|
+
return css(_d$4 || (_d$4 = __template$j(["\n &:not([hidden]) {\n display: block;\n }\n background-color: var(--switch-bg-color);\n position: absolute;\n left: 0;\n top: 0;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n "])), rem(input.switch.width), rem(input.switch.height), rem(input.switch.height / 2));
|
|
4393
4504
|
}
|
|
4394
4505
|
function switchThumbStyles(props) {
|
|
4395
4506
|
const {
|
|
@@ -4405,7 +4516,7 @@ function switchThumbStyles(props) {
|
|
|
4405
4516
|
const checkedOffset = trackWidth - trackPadding * 2 - size;
|
|
4406
4517
|
const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding;
|
|
4407
4518
|
const checked = $indeterminate !== true && props.$checked === true;
|
|
4408
|
-
return css(_g || (_g = __template$
|
|
4519
|
+
return css(_g || (_g = __template$j(["\n &:not([hidden]) {\n display: block;\n }\n position: absolute;\n left: ", ";\n top: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n transition-property: transform;\n transition-duration: ", "ms;\n transition-timing-function: ", ";\n background: var(--switch-fg-color);\n transform: translate3d(0, 0, 0);\n box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.05);\n\n ", "\n\n ", "\n "])), rem(trackPadding), rem(trackPadding), rem(size), rem(size), rem(size / 2), input.switch.transitionDurationMs, input.switch.transitionTimingFunction, checked && css(_e$2 || (_e$2 = __template$j(["\n transform: translate3d(", "px, 0, 0);\n "])), checkedOffset), $indeterminate && css(_f$2 || (_f$2 = __template$j(["\n transform: translate3d(", "px, 0, 0);\n "])), indeterminateOffset));
|
|
4409
4520
|
}
|
|
4410
4521
|
const Root$d = styled.span(switchBaseStyles);
|
|
4411
4522
|
const Input$2 = styled.input(switchInputStyles);
|
|
@@ -4449,14 +4560,14 @@ const Switch = forwardRef(function Switch2(props, forwardedRef) {
|
|
|
4449
4560
|
})]
|
|
4450
4561
|
});
|
|
4451
4562
|
});
|
|
4452
|
-
var __freeze$
|
|
4453
|
-
var __defProp$
|
|
4454
|
-
var __template$
|
|
4455
|
-
value: __freeze$
|
|
4563
|
+
var __freeze$i = Object.freeze;
|
|
4564
|
+
var __defProp$i = Object.defineProperty;
|
|
4565
|
+
var __template$i = (cooked, raw) => __freeze$i(__defProp$i(cooked, "raw", {
|
|
4566
|
+
value: __freeze$i(raw || cooked.slice())
|
|
4456
4567
|
}));
|
|
4457
|
-
var _a$
|
|
4568
|
+
var _a$i;
|
|
4458
4569
|
const Root$c = styled.span(textInputRootStyle);
|
|
4459
|
-
const InputRoot$1 = styled.span(_a$
|
|
4570
|
+
const InputRoot$1 = styled.span(_a$i || (_a$i = __template$i(["\n flex: 1;\n min-width: 0;\n display: block;\n position: relative;\n"])));
|
|
4460
4571
|
const Input$1 = styled.textarea(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle);
|
|
4461
4572
|
const Presentation$1 = styled.div(responsiveRadiusStyle, textInputRepresentationStyle);
|
|
4462
4573
|
const TextArea = forwardRef(function TextArea2(props, forwardedRef) {
|
|
@@ -4500,30 +4611,30 @@ const TextArea = forwardRef(function TextArea2(props, forwardedRef) {
|
|
|
4500
4611
|
})
|
|
4501
4612
|
});
|
|
4502
4613
|
});
|
|
4503
|
-
var __freeze$
|
|
4504
|
-
var __defProp$
|
|
4505
|
-
var __template$
|
|
4506
|
-
value: __freeze$
|
|
4614
|
+
var __freeze$h = Object.freeze;
|
|
4615
|
+
var __defProp$h = Object.defineProperty;
|
|
4616
|
+
var __template$h = (cooked, raw) => __freeze$h(__defProp$h(cooked, "raw", {
|
|
4617
|
+
value: __freeze$h(raw || cooked.slice())
|
|
4507
4618
|
}));
|
|
4508
|
-
var _a$
|
|
4619
|
+
var _a$h, _b$a, _c$4, _d$3, _e$1, _f$1;
|
|
4509
4620
|
const CLEAR_BUTTON_BOX_STYLE = {
|
|
4510
4621
|
zIndex: 2
|
|
4511
4622
|
};
|
|
4512
4623
|
const Root$b = styled(Card).attrs({
|
|
4513
4624
|
forwardedAs: "span"
|
|
4514
4625
|
})(textInputRootStyle);
|
|
4515
|
-
const InputRoot = styled.span(_a$
|
|
4626
|
+
const InputRoot = styled.span(_a$h || (_a$h = __template$h(["\n flex: 1;\n min-width: 0;\n display: block;\n position: relative;\n"])));
|
|
4516
4627
|
const Prefix = styled(Card).attrs({
|
|
4517
4628
|
forwardedAs: "span"
|
|
4518
|
-
})(_b$a || (_b$a = __template$
|
|
4629
|
+
})(_b$a || (_b$a = __template$h(["\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n & > span {\n display: block;\n margin: -1px;\n }\n"])));
|
|
4519
4630
|
const Suffix = styled(Card).attrs({
|
|
4520
4631
|
forwardedAs: "span"
|
|
4521
|
-
})(_c$4 || (_c$4 = __template$
|
|
4632
|
+
})(_c$4 || (_c$4 = __template$h(["\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n & > span {\n display: block;\n margin: -1px;\n }\n"])));
|
|
4522
4633
|
const Input = styled.input(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle);
|
|
4523
4634
|
const Presentation = styled.span(responsiveRadiusStyle, textInputRepresentationStyle);
|
|
4524
|
-
const LeftBox = styled(Box)(_d$3 || (_d$3 = __template$
|
|
4525
|
-
const RightBox = styled(Box)(_e$1 || (_e$1 = __template$
|
|
4526
|
-
const RightCard = styled(Card)(_f$1 || (_f$1 = __template$
|
|
4635
|
+
const LeftBox = styled(Box)(_d$3 || (_d$3 = __template$h(["\n position: absolute;\n top: 0;\n left: 0;\n"])));
|
|
4636
|
+
const RightBox = styled(Box)(_e$1 || (_e$1 = __template$h(["\n position: absolute;\n top: 0;\n right: 0;\n"])));
|
|
4637
|
+
const RightCard = styled(Card)(_f$1 || (_f$1 = __template$h(["\n background-color: transparent;\n position: absolute;\n top: 0;\n right: 0;\n"])));
|
|
4527
4638
|
const TextInputClearButton = styled(Button)({
|
|
4528
4639
|
"&:not([hidden])": {
|
|
4529
4640
|
display: "block"
|
|
@@ -4691,17 +4802,6 @@ function useDelayedState(initialState) {
|
|
|
4691
4802
|
}, []);
|
|
4692
4803
|
return [state, onStateChange];
|
|
4693
4804
|
}
|
|
4694
|
-
function ConditionalWrapper(_ref5) {
|
|
4695
|
-
let {
|
|
4696
|
-
children,
|
|
4697
|
-
condition,
|
|
4698
|
-
wrapper
|
|
4699
|
-
} = _ref5;
|
|
4700
|
-
if (!condition) {
|
|
4701
|
-
return children;
|
|
4702
|
-
}
|
|
4703
|
-
return wrapper(children);
|
|
4704
|
-
}
|
|
4705
4805
|
const DEFAULT_TOOLTIP_ARROW_WIDTH = 15;
|
|
4706
4806
|
const DEFAULT_TOOLTIP_ARROW_HEIGHT = 6;
|
|
4707
4807
|
const DEFAULT_TOOLTIP_ARROW_RADIUS = 2;
|
|
@@ -4721,6 +4821,63 @@ const DEFAULT_FALLBACK_PLACEMENTS = {
|
|
|
4721
4821
|
"right-start": ["right", "right-end", "left-start", "top-start", "bottom-start"],
|
|
4722
4822
|
"right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
|
|
4723
4823
|
};
|
|
4824
|
+
var __freeze$g = Object.freeze;
|
|
4825
|
+
var __defProp$g = Object.defineProperty;
|
|
4826
|
+
var __template$g = (cooked, raw) => __freeze$g(__defProp$g(cooked, "raw", {
|
|
4827
|
+
value: __freeze$g(raw || cooked.slice())
|
|
4828
|
+
}));
|
|
4829
|
+
var _a$g;
|
|
4830
|
+
const MotionCard = styled(motion(Card))(_a$g || (_a$g = __template$g([""])));
|
|
4831
|
+
const TooltipCard = memo(forwardRef(function TooltipCard2(props, ref) {
|
|
4832
|
+
const {
|
|
4833
|
+
animate,
|
|
4834
|
+
arrow,
|
|
4835
|
+
arrowRef,
|
|
4836
|
+
arrowX,
|
|
4837
|
+
arrowY,
|
|
4838
|
+
children,
|
|
4839
|
+
originX,
|
|
4840
|
+
originY,
|
|
4841
|
+
padding,
|
|
4842
|
+
placement,
|
|
4843
|
+
radius,
|
|
4844
|
+
scheme,
|
|
4845
|
+
shadow,
|
|
4846
|
+
style,
|
|
4847
|
+
...restProps
|
|
4848
|
+
} = props;
|
|
4849
|
+
const rootStyle = useMemo(() => ({
|
|
4850
|
+
originX,
|
|
4851
|
+
originY,
|
|
4852
|
+
...style
|
|
4853
|
+
}), [originX, originY, style]);
|
|
4854
|
+
const arrowStyle = useMemo(() => ({
|
|
4855
|
+
left: arrowX !== null ? arrowX : void 0,
|
|
4856
|
+
top: arrowY !== null ? arrowY : void 0,
|
|
4857
|
+
right: void 0,
|
|
4858
|
+
bottom: void 0
|
|
4859
|
+
}), [arrowX, arrowY]);
|
|
4860
|
+
return /* @__PURE__ */jsxs(MotionCard, {
|
|
4861
|
+
"data-ui": "Tooltip__card",
|
|
4862
|
+
...restProps,
|
|
4863
|
+
"data-placement": placement,
|
|
4864
|
+
padding,
|
|
4865
|
+
radius,
|
|
4866
|
+
ref,
|
|
4867
|
+
scheme,
|
|
4868
|
+
shadow,
|
|
4869
|
+
style: rootStyle,
|
|
4870
|
+
...(animate ? POPOVER_MOTION_PROPS : {}),
|
|
4871
|
+
children: [children, arrow && /* @__PURE__ */jsx(Arrow, {
|
|
4872
|
+
ref: arrowRef,
|
|
4873
|
+
style: arrowStyle,
|
|
4874
|
+
width: DEFAULT_TOOLTIP_ARROW_WIDTH,
|
|
4875
|
+
height: DEFAULT_TOOLTIP_ARROW_HEIGHT,
|
|
4876
|
+
radius: DEFAULT_TOOLTIP_ARROW_RADIUS
|
|
4877
|
+
})]
|
|
4878
|
+
});
|
|
4879
|
+
}));
|
|
4880
|
+
TooltipCard.displayName = "TooltipCard";
|
|
4724
4881
|
const key$4 = Symbol.for("@sanity/ui/context/tooltipDelayGroup");
|
|
4725
4882
|
globalScope[key$4] = globalScope[key$4] || createContext(null);
|
|
4726
4883
|
const TooltipDelayGroupContext = globalScope[key$4];
|
|
@@ -4757,26 +4914,27 @@ var __template$f = (cooked, raw) => __freeze$f(__defProp$f(cooked, "raw", {
|
|
|
4757
4914
|
value: __freeze$f(raw || cooked.slice())
|
|
4758
4915
|
}));
|
|
4759
4916
|
var _a$f;
|
|
4760
|
-
const Root$a = styled(Layer)(_a$f || (_a$f = __template$f(["\n pointer-events: none;\n max-width: ", "px;\n"])),
|
|
4917
|
+
const Root$a = styled(Layer)(_a$f || (_a$f = __template$f(["\n pointer-events: none;\n max-width: ", "px;\n"])), _ref7 => {
|
|
4761
4918
|
let {
|
|
4762
4919
|
$maxWidth
|
|
4763
|
-
} =
|
|
4920
|
+
} = _ref7;
|
|
4764
4921
|
return $maxWidth;
|
|
4765
4922
|
});
|
|
4766
4923
|
const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
4767
|
-
var _a2, _b, _c, _d, _e;
|
|
4924
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
4768
4925
|
const boundaryElementContext = useBoundaryElement();
|
|
4769
4926
|
const {
|
|
4770
4927
|
layer
|
|
4771
4928
|
} = useTheme_v2();
|
|
4772
4929
|
const {
|
|
4930
|
+
animate = false,
|
|
4773
4931
|
arrow: arrowProp = false,
|
|
4774
4932
|
boundaryElement = boundaryElementContext == null ? void 0 : boundaryElementContext.element,
|
|
4775
4933
|
children: childProp,
|
|
4776
4934
|
content,
|
|
4777
4935
|
disabled,
|
|
4778
4936
|
fallbackPlacements: fallbackPlacementsProp = (_b = props.fallbackPlacements) != null ? _b : DEFAULT_FALLBACK_PLACEMENTS[(_a2 = props.placement) != null ? _a2 : "bottom"],
|
|
4779
|
-
padding =
|
|
4937
|
+
padding = 2,
|
|
4780
4938
|
placement: placementProp = "bottom",
|
|
4781
4939
|
portal: portalProp,
|
|
4782
4940
|
radius = 2,
|
|
@@ -4784,7 +4942,6 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4784
4942
|
shadow = 2,
|
|
4785
4943
|
zOffset = layer.tooltip.zOffset,
|
|
4786
4944
|
delay,
|
|
4787
|
-
animate = false,
|
|
4788
4945
|
...restProps
|
|
4789
4946
|
} = props;
|
|
4790
4947
|
const fallbackPlacements = useArrayProp(fallbackPlacementsProp);
|
|
@@ -4820,8 +4977,11 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4820
4977
|
padding: DEFAULT_TOOLTIP_PADDING
|
|
4821
4978
|
}));
|
|
4822
4979
|
}
|
|
4980
|
+
if (animate) {
|
|
4981
|
+
ret.push(origin);
|
|
4982
|
+
}
|
|
4823
4983
|
return ret;
|
|
4824
|
-
}, [arrowProp, boundaryElement, fallbackPlacements]);
|
|
4984
|
+
}, [animate, arrowProp, boundaryElement, fallbackPlacements]);
|
|
4825
4985
|
const {
|
|
4826
4986
|
floatingStyles,
|
|
4827
4987
|
placement,
|
|
@@ -4835,12 +4995,8 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4835
4995
|
});
|
|
4836
4996
|
const arrowX = (_d = middlewareData.arrow) == null ? void 0 : _d.x;
|
|
4837
4997
|
const arrowY = (_e = middlewareData.arrow) == null ? void 0 : _e.y;
|
|
4838
|
-
const
|
|
4839
|
-
|
|
4840
|
-
top: arrowY !== null ? arrowY : void 0,
|
|
4841
|
-
right: void 0,
|
|
4842
|
-
bottom: void 0
|
|
4843
|
-
}), [arrowX, arrowY]);
|
|
4998
|
+
const originX = (_f = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _f.originX;
|
|
4999
|
+
const originY = (_g = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _g.originY;
|
|
4844
5000
|
const tooltipId = useId();
|
|
4845
5001
|
const [isOpen, setIsOpen] = useDelayedState(false);
|
|
4846
5002
|
const delayGroupContext = useTooltipDelayGroup();
|
|
@@ -4962,53 +5118,33 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4962
5118
|
}, [childProp, handleBlur, handleClick, handleContextMenu, handleFocus, handleMouseEnter, handleMouseLeave, setReference]);
|
|
4963
5119
|
if (!child) return /* @__PURE__ */jsx(Fragment, {});
|
|
4964
5120
|
if (disabled) return child;
|
|
4965
|
-
const
|
|
5121
|
+
const tooltip = /* @__PURE__ */jsx(Root$a, {
|
|
4966
5122
|
"data-ui": "Tooltip",
|
|
4967
5123
|
...restProps,
|
|
4968
5124
|
ref: setFloating,
|
|
4969
5125
|
style: floatingStyles,
|
|
4970
5126
|
zOffset,
|
|
4971
5127
|
$maxWidth: tooltipWidth,
|
|
4972
|
-
children: /* @__PURE__ */jsx(
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
duration: 0.3,
|
|
4989
|
-
type: "spring"
|
|
4990
|
-
},
|
|
4991
|
-
children
|
|
4992
|
-
}),
|
|
4993
|
-
children: /* @__PURE__ */jsxs(Card, {
|
|
4994
|
-
"data-ui": "Tooltip__card",
|
|
4995
|
-
"data-placement": placement,
|
|
4996
|
-
padding,
|
|
4997
|
-
radius,
|
|
4998
|
-
scheme,
|
|
4999
|
-
shadow,
|
|
5000
|
-
children: [content, arrowProp && /* @__PURE__ */jsx(Arrow, {
|
|
5001
|
-
ref: setArrow,
|
|
5002
|
-
style: arrowStyle,
|
|
5003
|
-
width: DEFAULT_TOOLTIP_ARROW_WIDTH,
|
|
5004
|
-
height: DEFAULT_TOOLTIP_ARROW_HEIGHT,
|
|
5005
|
-
radius: DEFAULT_TOOLTIP_ARROW_RADIUS
|
|
5006
|
-
})]
|
|
5007
|
-
})
|
|
5128
|
+
children: /* @__PURE__ */jsx(TooltipCard, {
|
|
5129
|
+
...restProps,
|
|
5130
|
+
animate,
|
|
5131
|
+
arrow: arrowProp,
|
|
5132
|
+
arrowRef: setArrow,
|
|
5133
|
+
arrowX,
|
|
5134
|
+
arrowY,
|
|
5135
|
+
originX,
|
|
5136
|
+
originY,
|
|
5137
|
+
padding,
|
|
5138
|
+
placement,
|
|
5139
|
+
radius,
|
|
5140
|
+
ref: setFloating,
|
|
5141
|
+
scheme,
|
|
5142
|
+
shadow,
|
|
5143
|
+
children: content
|
|
5008
5144
|
})
|
|
5009
5145
|
});
|
|
5010
5146
|
return /* @__PURE__ */jsxs(Fragment, {
|
|
5011
|
-
children: [
|
|
5147
|
+
children: [/* @__PURE__ */jsx(ConditionalWrapper, {
|
|
5012
5148
|
condition: animate,
|
|
5013
5149
|
wrapper: children => /* @__PURE__ */jsx(AnimatePresence, {
|
|
5014
5150
|
children
|
|
@@ -5019,9 +5155,9 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
5019
5155
|
__unstable_name: typeof portalProp === "string" ? portalProp : void 0,
|
|
5020
5156
|
children
|
|
5021
5157
|
}),
|
|
5022
|
-
children:
|
|
5158
|
+
children: tooltip
|
|
5023
5159
|
})
|
|
5024
|
-
})]
|
|
5160
|
+
}), child]
|
|
5025
5161
|
});
|
|
5026
5162
|
});
|
|
5027
5163
|
var __freeze$e = Object.freeze;
|
|
@@ -5178,10 +5314,10 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
|
|
|
5178
5314
|
query,
|
|
5179
5315
|
value
|
|
5180
5316
|
} = state;
|
|
5181
|
-
const defaultRenderOption = useCallback(
|
|
5317
|
+
const defaultRenderOption = useCallback(_ref8 => {
|
|
5182
5318
|
let {
|
|
5183
5319
|
value: value2
|
|
5184
|
-
} =
|
|
5320
|
+
} = _ref8;
|
|
5185
5321
|
return /* @__PURE__ */jsx(Card, {
|
|
5186
5322
|
"data-as": "button",
|
|
5187
5323
|
padding: paddingProp,
|
|
@@ -5640,10 +5776,10 @@ var __template$c = (cooked, raw) => __freeze$c(__defProp$c(cooked, "raw", {
|
|
|
5640
5776
|
value: __freeze$c(raw || cooked.slice())
|
|
5641
5777
|
}));
|
|
5642
5778
|
var _a$c, _b$7;
|
|
5643
|
-
function dialogStyle(
|
|
5779
|
+
function dialogStyle(_ref9) {
|
|
5644
5780
|
let {
|
|
5645
5781
|
theme
|
|
5646
|
-
} =
|
|
5782
|
+
} = _ref9;
|
|
5647
5783
|
const {
|
|
5648
5784
|
color
|
|
5649
5785
|
} = getTheme_v2(theme);
|
|
@@ -6311,6 +6447,9 @@ const MenuButton = forwardRef(function MenuButton2(props, ref) {
|
|
|
6311
6447
|
setOpen(v => !v);
|
|
6312
6448
|
setShouldFocus(null);
|
|
6313
6449
|
}, []);
|
|
6450
|
+
const handleMouseDown = useCallback(event => {
|
|
6451
|
+
if (open) event.preventDefault();
|
|
6452
|
+
}, [open]);
|
|
6314
6453
|
const handleButtonKeyDown = useCallback(event => {
|
|
6315
6454
|
if (event.key === "ArrowDown" || event.key === "Enter" || event.key === " ") {
|
|
6316
6455
|
event.preventDefault();
|
|
@@ -6394,11 +6533,12 @@ const MenuButton = forwardRef(function MenuButton2(props, ref) {
|
|
|
6394
6533
|
id,
|
|
6395
6534
|
onClick: handleButtonClick,
|
|
6396
6535
|
onKeyDown: handleButtonKeyDown,
|
|
6536
|
+
onMouseDown: handleMouseDown,
|
|
6397
6537
|
"aria-haspopup": true,
|
|
6398
6538
|
"aria-expanded": open,
|
|
6399
6539
|
ref: setButtonRef,
|
|
6400
6540
|
selected: open
|
|
6401
|
-
}) : null, [buttonProp, handleButtonClick, handleButtonKeyDown, id, open, setButtonRef]);
|
|
6541
|
+
}) : null, [buttonProp, handleButtonClick, handleButtonKeyDown, handleMouseDown, id, open, setButtonRef]);
|
|
6402
6542
|
const popoverProps = useMemo(() => ({
|
|
6403
6543
|
boundaryElement: deprecated_boundaryElement,
|
|
6404
6544
|
overflow: "auto",
|
|
@@ -6713,15 +6853,15 @@ var __template$6 = (cooked, raw) => __freeze$6(__defProp$6(cooked, "raw", {
|
|
|
6713
6853
|
var _a$6, _b$3, _c$1, _d;
|
|
6714
6854
|
const keyframe = keyframes(_a$6 || (_a$6 = __template$6(["\n 0% {\n background-position: 100%;\n }\n 100% {\n background-position: -100%;\n }\n"])));
|
|
6715
6855
|
const animation = css(_b$3 || (_b$3 = __template$6(["\n background-image: linear-gradient(\n to right,\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-to),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from)\n );\n background-position: 100%;\n background-size: 200% 100%;\n background-attachment: fixed;\n animation-name: ", ";\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n animation-duration: 2000ms;\n"])), keyframe);
|
|
6716
|
-
const skeletonStyle = css(_d || (_d = __template$6(["\n opacity: ", ";\n transition: opacity 200ms ease-in;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n ", "\n }\n\n @media screen and (prefers-reduced-motion: reduce) {\n background-color: var(--card-skeleton-color-from);\n }\n"])),
|
|
6856
|
+
const skeletonStyle = css(_d || (_d = __template$6(["\n opacity: ", ";\n transition: opacity 200ms ease-in;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n ", "\n }\n\n @media screen and (prefers-reduced-motion: reduce) {\n background-color: var(--card-skeleton-color-from);\n }\n"])), _ref10 => {
|
|
6717
6857
|
let {
|
|
6718
6858
|
$visible
|
|
6719
|
-
} =
|
|
6859
|
+
} = _ref10;
|
|
6720
6860
|
return $visible ? 1 : 0;
|
|
6721
|
-
},
|
|
6861
|
+
}, _ref11 => {
|
|
6722
6862
|
let {
|
|
6723
6863
|
$animated
|
|
6724
|
-
} =
|
|
6864
|
+
} = _ref11;
|
|
6725
6865
|
return $animated ? animation : css(_c$1 || (_c$1 = __template$6(["\n background-color: var(--card-skeleton-color-from);\n "])));
|
|
6726
6866
|
});
|
|
6727
6867
|
const Root$4 = styled(Box)(responsiveRadiusStyle, skeletonStyle);
|
|
@@ -7106,12 +7246,12 @@ function ToastProvider(props) {
|
|
|
7106
7246
|
paddingY,
|
|
7107
7247
|
children: /* @__PURE__ */jsx(AnimatePresence, {
|
|
7108
7248
|
initial: false,
|
|
7109
|
-
children: state.map(
|
|
7249
|
+
children: state.map(_ref12 => {
|
|
7110
7250
|
let {
|
|
7111
7251
|
dismiss,
|
|
7112
7252
|
id,
|
|
7113
7253
|
params
|
|
7114
|
-
} =
|
|
7254
|
+
} = _ref12;
|
|
7115
7255
|
return /* @__PURE__ */jsx(motion.div, {
|
|
7116
7256
|
animate: {
|
|
7117
7257
|
opacity: 1,
|
|
@@ -7605,5 +7745,5 @@ const TreeItem = memo(function TreeItem2(props) {
|
|
|
7605
7745
|
})]
|
|
7606
7746
|
});
|
|
7607
7747
|
});
|
|
7608
|
-
export { Arrow, Autocomplete, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, Box, Breadcrumbs, Button, Card, Checkbox, Code, CodeSkeleton, Container, Dialog, DialogContext, DialogProvider, ElementQuery, ErrorBoundary, Flex, Grid, Heading, HeadingSkeleton, Hotkeys, Inline, KBD, Label, LabelSkeleton, Layer, LayerProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuItem, Popover, Portal, PortalProvider, Radio, Select, Skeleton, Spinner, SrOnly, Stack, Switch, Tab, TabList, TabPanel, Text, TextArea, TextInput, TextSkeleton, ThemeColorProvider, ThemeProvider, Toast, ToastProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, Tree, TreeItem, VirtualList, _ResizeObserver, _elementSizeObserver, _fillCSSObject, _getArrayProp, _getResponsiveSpace, _hasFocus, _isEnterToClickElement, _isScrollable, _raf, _raf2, _responsive, attemptFocus, containsOrEqualsElement, focusFirstDescendant, focusLastDescendant, isFocusable, isHTMLAnchorElement, isHTMLButtonElement, isHTMLElement, isHTMLInputElement, isHTMLSelectElement, isHTMLTextAreaElement, rem, responsiveCodeFontStyle, responsiveHeadingFont, responsiveLabelFont, responsiveTextAlignStyle, responsiveTextFont, useArrayProp, useBoundaryElement, useClickOutside, useCustomValidity, useDialog, useElementRect, useElementSize, useForwardedRef, useGlobalKeyDown, useLayer, useMediaIndex, usePortal, usePrefersDark, usePrefersReducedMotion, useRootTheme, useTheme, useTheme_v2, useToast, useTooltipDelayGroup, useTree };
|
|
7748
|
+
export { Arrow, Autocomplete, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, Box, Breadcrumbs, Button, Card, Checkbox, Code, CodeSkeleton, ConditionalWrapper, Container, Dialog, DialogContext, DialogProvider, ElementQuery, ErrorBoundary, Flex, Grid, Heading, HeadingSkeleton, Hotkeys, Inline, KBD, Label, LabelSkeleton, Layer, LayerProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuItem, Popover, Portal, PortalProvider, Radio, Select, Skeleton, Spinner, SrOnly, Stack, Switch, Tab, TabList, TabPanel, Text, TextArea, TextInput, TextSkeleton, ThemeColorProvider, ThemeProvider, Toast, ToastProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, Tree, TreeItem, VirtualList, _ResizeObserver, _elementSizeObserver, _fillCSSObject, _getArrayProp, _getResponsiveSpace, _hasFocus, _isEnterToClickElement, _isScrollable, _raf, _raf2, _responsive, attemptFocus, containsOrEqualsElement, createColorTheme, focusFirstDescendant, focusLastDescendant, hexToRgb, hslToRgb, isFocusable, isHTMLAnchorElement, isHTMLButtonElement, isHTMLElement, isHTMLInputElement, isHTMLSelectElement, isHTMLTextAreaElement, multiply, parseColor, rem, responsiveCodeFontStyle, responsiveHeadingFont, responsiveLabelFont, responsiveTextAlignStyle, responsiveTextFont, rgbToHex, rgbToHsl, rgba, screen, studioTheme, useArrayProp, useBoundaryElement, useClickOutside, useCustomValidity, useDialog, useElementRect, useElementSize, useForwardedRef, useGlobalKeyDown, useLayer, useMediaIndex, usePortal, usePrefersDark, usePrefersReducedMotion, useRootTheme, useTheme, useTheme_v2, useToast, useTooltipDelayGroup, useTree };
|
|
7609
7749
|
//# sourceMappingURL=index.esm.js.map
|