@sanity/ui 2.0.0-beta.1 → 2.0.0-beta.11
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 +502 -356
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +511 -569
- 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 +355 -290
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +355 -290
- 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/textInput/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/states.tsx +10 -2
- 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/input/textInputStyle.ts +33 -2
- 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 +196 -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.test.ts +2 -2
- 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 +278 -252
- 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 *:not(:invalid):disabled + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n --card-icon-color: ", " !important;\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n *:invalid:disabled + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n --card-icon-color: ", " !important;\n\n &[data-border] {\n --input-box-shadow: ", ";\n }\n }\n\n /* readOnly */\n *:not(:invalid):read-only + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n }\n\n *:invalid: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 *:invalid:not(:disabled):not(:read-only):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 *:invalid:not(:disabled):not(:read-only):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({
|
|
@@ -1530,12 +1557,18 @@ function textInputRepresentationStyle(props) {
|
|
|
1530
1557
|
focusRing: input.text.focusRing
|
|
1531
1558
|
}), $unstableDisableFocusRing ? void 0 : focusRingStyle({
|
|
1532
1559
|
focusRing: input.text.focusRing
|
|
1533
|
-
}), color.input.default.disabled.bg, color.input.default.disabled.fg, focusRingBorderStyle({
|
|
1560
|
+
}), color.input.default.disabled.bg, color.input.default.disabled.fg, color.input.default.disabled.fg, focusRingBorderStyle({
|
|
1534
1561
|
color: color.input.default.disabled.border,
|
|
1535
1562
|
width: input.border.width
|
|
1536
|
-
}), color.input.
|
|
1563
|
+
}), color.input.invalid.disabled.bg, color.input.invalid.disabled.fg, color.input.invalid.disabled.fg, focusRingBorderStyle({
|
|
1564
|
+
color: color.input.invalid.disabled.border,
|
|
1565
|
+
width: input.border.width
|
|
1566
|
+
}), color.input.default.readOnly.bg, color.input.default.readOnly.fg, color.input.invalid.readOnly.bg, color.input.invalid.readOnly.fg, color.input.default.hovered.bg, color.input.default.hovered.fg, color.input.invalid.hovered.bg, color.input.invalid.hovered.fg, focusRingBorderStyle({
|
|
1537
1567
|
color: color.input.default.hovered.border,
|
|
1538
1568
|
width: input.border.width
|
|
1569
|
+
}), focusRingBorderStyle({
|
|
1570
|
+
color: color.input.invalid.hovered.border,
|
|
1571
|
+
width: input.border.width
|
|
1539
1572
|
}));
|
|
1540
1573
|
}
|
|
1541
1574
|
function responsiveMarginStyle(props) {
|
|
@@ -1590,12 +1623,12 @@ function responsiveShadowStyle(props) {
|
|
|
1590
1623
|
} = getTheme_v2(props.theme);
|
|
1591
1624
|
return _responsive(media, props.$shadow, index => shadowStyle(shadow[index], card.shadow.outline));
|
|
1592
1625
|
}
|
|
1593
|
-
var __freeze$
|
|
1594
|
-
var __defProp$
|
|
1595
|
-
var __template$
|
|
1596
|
-
value: __freeze$
|
|
1626
|
+
var __freeze$E = Object.freeze;
|
|
1627
|
+
var __defProp$F = Object.defineProperty;
|
|
1628
|
+
var __template$E = (cooked, raw) => __freeze$E(__defProp$F(cooked, "raw", {
|
|
1629
|
+
value: __freeze$E(raw || cooked.slice())
|
|
1597
1630
|
}));
|
|
1598
|
-
var _a$
|
|
1631
|
+
var _a$E, _b$m, _c$b;
|
|
1599
1632
|
function labelBaseStyle(props) {
|
|
1600
1633
|
const {
|
|
1601
1634
|
$accent,
|
|
@@ -1604,16 +1637,16 @@ function labelBaseStyle(props) {
|
|
|
1604
1637
|
const {
|
|
1605
1638
|
font
|
|
1606
1639
|
} = getTheme_v2(props.theme);
|
|
1607
|
-
return css(_c$b || (_c$b = __template$
|
|
1640
|
+
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
1641
|
}
|
|
1609
|
-
var __freeze$
|
|
1610
|
-
var __defProp$
|
|
1611
|
-
var __template$
|
|
1612
|
-
value: __freeze$
|
|
1642
|
+
var __freeze$D = Object.freeze;
|
|
1643
|
+
var __defProp$E = Object.defineProperty;
|
|
1644
|
+
var __template$D = (cooked, raw) => __freeze$D(__defProp$E(cooked, "raw", {
|
|
1645
|
+
value: __freeze$D(raw || cooked.slice())
|
|
1613
1646
|
}));
|
|
1614
|
-
var _a$
|
|
1615
|
-
const Root$
|
|
1616
|
-
const SpanWithTextOverflow$2 = styled.span(_a$
|
|
1647
|
+
var _a$D;
|
|
1648
|
+
const Root$C = styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle);
|
|
1649
|
+
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
1650
|
const Label = forwardRef(function Label2(props, ref) {
|
|
1618
1651
|
const {
|
|
1619
1652
|
accent,
|
|
@@ -1635,7 +1668,7 @@ const Label = forwardRef(function Label2(props, ref) {
|
|
|
1635
1668
|
children
|
|
1636
1669
|
});
|
|
1637
1670
|
}
|
|
1638
|
-
return /* @__PURE__ */jsx(Root$
|
|
1671
|
+
return /* @__PURE__ */jsx(Root$C, {
|
|
1639
1672
|
"data-ui": "Label",
|
|
1640
1673
|
...restProps,
|
|
1641
1674
|
$accent: accent,
|
|
@@ -1794,7 +1827,7 @@ function avatarStrokeStyle() {
|
|
|
1794
1827
|
}
|
|
1795
1828
|
};
|
|
1796
1829
|
}
|
|
1797
|
-
const Root$
|
|
1830
|
+
const Root$B = styled.div(responsiveAvatarSizeStyle, avatarStyle.root);
|
|
1798
1831
|
const Arrow$1 = styled.div(avatarStyle.arrow);
|
|
1799
1832
|
const BgStroke = styled.ellipse(avatarStyle.bgStroke);
|
|
1800
1833
|
const Stroke = styled.ellipse(avatarStyle.stroke);
|
|
@@ -1815,14 +1848,14 @@ const Avatar = forwardRef(function Avatar2(props, ref) {
|
|
|
1815
1848
|
arrowPosition: arrowPositionProp,
|
|
1816
1849
|
animateArrowFrom,
|
|
1817
1850
|
status = "online",
|
|
1818
|
-
size: sizeProp =
|
|
1851
|
+
size: sizeProp = 1,
|
|
1819
1852
|
...restProps
|
|
1820
1853
|
} = props;
|
|
1821
|
-
const as = ReactIs.isValidElementType(asProp) ? asProp : "div";
|
|
1822
|
-
const size = useArrayProp(sizeProp);
|
|
1823
1854
|
const {
|
|
1824
1855
|
avatar
|
|
1825
1856
|
} = useTheme_v2();
|
|
1857
|
+
const as = ReactIs.isValidElementType(asProp) ? asProp : "div";
|
|
1858
|
+
const size = useArrayProp(sizeProp);
|
|
1826
1859
|
const avatarSize = avatar.sizes[size[0]] || avatar.sizes[0];
|
|
1827
1860
|
const _sizeRem = avatarSize.size;
|
|
1828
1861
|
const _radius = _sizeRem / 2;
|
|
@@ -1844,8 +1877,13 @@ const Avatar = forwardRef(function Avatar2(props, ref) {
|
|
|
1844
1877
|
onImageLoadError(new Error("Avatar: the image failed to load"));
|
|
1845
1878
|
}
|
|
1846
1879
|
}, [onImageLoadError]);
|
|
1847
|
-
const initialsSize = useMemo(() => size.map(s =>
|
|
1848
|
-
|
|
1880
|
+
const initialsSize = useMemo(() => size.map(s => {
|
|
1881
|
+
if (s === 1) return 1;
|
|
1882
|
+
if (s === 2) return 3;
|
|
1883
|
+
if (s === 3) return 5;
|
|
1884
|
+
return 0;
|
|
1885
|
+
}), [size]);
|
|
1886
|
+
return /* @__PURE__ */jsxs(Root$B, {
|
|
1849
1887
|
as,
|
|
1850
1888
|
"data-as": typeof as === "string" ? as : void 0,
|
|
1851
1889
|
"data-ui": "Avatar",
|
|
@@ -1907,73 +1945,19 @@ const Avatar = forwardRef(function Avatar2(props, ref) {
|
|
|
1907
1945
|
children: /* @__PURE__ */jsx(InitialsLabel, {
|
|
1908
1946
|
forwardedAs: "span",
|
|
1909
1947
|
size: initialsSize,
|
|
1948
|
+
weight: "medium",
|
|
1910
1949
|
children: initials
|
|
1911
1950
|
})
|
|
1912
1951
|
})
|
|
1913
1952
|
})]
|
|
1914
1953
|
});
|
|
1915
1954
|
});
|
|
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())
|
|
1955
|
+
var __freeze$C = Object.freeze;
|
|
1956
|
+
var __defProp$D = Object.defineProperty;
|
|
1957
|
+
var __template$C = (cooked, raw) => __freeze$C(__defProp$D(cooked, "raw", {
|
|
1958
|
+
value: __freeze$C(raw || cooked.slice())
|
|
1975
1959
|
}));
|
|
1976
|
-
var _a$
|
|
1960
|
+
var _a$C;
|
|
1977
1961
|
function _responsiveAvatarCounterSizeStyle(props) {
|
|
1978
1962
|
const {
|
|
1979
1963
|
avatar,
|
|
@@ -1993,23 +1977,28 @@ function _avatarCounterBaseStyle(props) {
|
|
|
1993
1977
|
const {
|
|
1994
1978
|
space
|
|
1995
1979
|
} = getTheme_v2(props.theme);
|
|
1996
|
-
return css(_a$
|
|
1980
|
+
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
1981
|
}
|
|
1998
1982
|
const Root$A = styled.div(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle);
|
|
1999
1983
|
const AvatarCounter = forwardRef(function AvatarCounter2(props, ref) {
|
|
2000
1984
|
const {
|
|
2001
1985
|
count,
|
|
2002
|
-
size: sizeProp =
|
|
1986
|
+
size: sizeProp = 1
|
|
2003
1987
|
} = props;
|
|
2004
1988
|
const size = useArrayProp(sizeProp);
|
|
2005
|
-
const
|
|
1989
|
+
const fontSize = useMemo(() => size.map(s => {
|
|
1990
|
+
if (s === 1) return 1;
|
|
1991
|
+
if (s === 2) return 3;
|
|
1992
|
+
if (s === 3) return 5;
|
|
1993
|
+
return 0;
|
|
1994
|
+
}), [size]);
|
|
2006
1995
|
return /* @__PURE__ */jsx(Root$A, {
|
|
2007
1996
|
$size: size,
|
|
2008
1997
|
"data-ui": "AvatarCounter",
|
|
2009
1998
|
ref,
|
|
2010
|
-
children: /* @__PURE__ */jsx(
|
|
1999
|
+
children: /* @__PURE__ */jsx(Label, {
|
|
2011
2000
|
as: "span",
|
|
2012
|
-
size:
|
|
2001
|
+
size: fontSize,
|
|
2013
2002
|
weight: "medium",
|
|
2014
2003
|
children: count
|
|
2015
2004
|
})
|
|
@@ -2019,13 +2008,13 @@ function childrenToElementArray(children) {
|
|
|
2019
2008
|
const childrenArray = Array.isArray(children) ? children : [children];
|
|
2020
2009
|
return childrenArray.filter(node => isElement$1(node) || isFragment(node) || typeof node === "string");
|
|
2021
2010
|
}
|
|
2022
|
-
var __freeze$
|
|
2023
|
-
var __defProp$
|
|
2024
|
-
var __template$
|
|
2025
|
-
value: __freeze$
|
|
2011
|
+
var __freeze$B = Object.freeze;
|
|
2012
|
+
var __defProp$C = Object.defineProperty;
|
|
2013
|
+
var __template$B = (cooked, raw) => __freeze$B(__defProp$C(cooked, "raw", {
|
|
2014
|
+
value: __freeze$B(raw || cooked.slice())
|
|
2026
2015
|
}));
|
|
2027
|
-
var _a$
|
|
2028
|
-
const BASE_STYLES = css(_a$
|
|
2016
|
+
var _a$B;
|
|
2017
|
+
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
2018
|
function avatarStackStyle() {
|
|
2030
2019
|
return BASE_STYLES;
|
|
2031
2020
|
}
|
|
@@ -2049,7 +2038,7 @@ const AvatarStack = forwardRef(function AvatarStack2(props, ref) {
|
|
|
2049
2038
|
const {
|
|
2050
2039
|
children: childrenProp,
|
|
2051
2040
|
maxLength: maxLengthProp = 4,
|
|
2052
|
-
size: sizeProp =
|
|
2041
|
+
size: sizeProp = 1,
|
|
2053
2042
|
...restProps
|
|
2054
2043
|
} = props;
|
|
2055
2044
|
const children = childrenToElementArray(childrenProp).filter(child => typeof child !== "string");
|
|
@@ -2066,7 +2055,8 @@ const AvatarStack = forwardRef(function AvatarStack2(props, ref) {
|
|
|
2066
2055
|
$size: size,
|
|
2067
2056
|
children: [len === 0 && /* @__PURE__ */jsx("div", {
|
|
2068
2057
|
children: /* @__PURE__ */jsx(AvatarCounter, {
|
|
2069
|
-
count: len
|
|
2058
|
+
count: len,
|
|
2059
|
+
size
|
|
2070
2060
|
})
|
|
2071
2061
|
}), len !== 0 && extraCount > 1 && /* @__PURE__ */jsx("div", {
|
|
2072
2062
|
children: /* @__PURE__ */jsx(AvatarCounter, {
|
|
@@ -2145,6 +2135,61 @@ const Box = forwardRef(function Box2(props, ref) {
|
|
|
2145
2135
|
children: props.children
|
|
2146
2136
|
});
|
|
2147
2137
|
});
|
|
2138
|
+
var __freeze$A = Object.freeze;
|
|
2139
|
+
var __defProp$B = Object.defineProperty;
|
|
2140
|
+
var __template$A = (cooked, raw) => __freeze$A(__defProp$B(cooked, "raw", {
|
|
2141
|
+
value: __freeze$A(raw || cooked.slice())
|
|
2142
|
+
}));
|
|
2143
|
+
var _a$A, _b$l, _c$a;
|
|
2144
|
+
function textBaseStyle(props) {
|
|
2145
|
+
const {
|
|
2146
|
+
$accent,
|
|
2147
|
+
$muted
|
|
2148
|
+
} = props;
|
|
2149
|
+
const {
|
|
2150
|
+
font
|
|
2151
|
+
} = getTheme_v2(props.theme);
|
|
2152
|
+
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);
|
|
2153
|
+
}
|
|
2154
|
+
var __freeze$z = Object.freeze;
|
|
2155
|
+
var __defProp$A = Object.defineProperty;
|
|
2156
|
+
var __template$z = (cooked, raw) => __freeze$z(__defProp$A(cooked, "raw", {
|
|
2157
|
+
value: __freeze$z(raw || cooked.slice())
|
|
2158
|
+
}));
|
|
2159
|
+
var _a$z;
|
|
2160
|
+
const Root$x = styled.div(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle);
|
|
2161
|
+
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"])));
|
|
2162
|
+
const Text = forwardRef(function Text2(props, ref) {
|
|
2163
|
+
const {
|
|
2164
|
+
accent = false,
|
|
2165
|
+
align,
|
|
2166
|
+
children: childrenProp,
|
|
2167
|
+
muted = false,
|
|
2168
|
+
size = 2,
|
|
2169
|
+
textOverflow,
|
|
2170
|
+
weight,
|
|
2171
|
+
...restProps
|
|
2172
|
+
} = props;
|
|
2173
|
+
let children = childrenProp;
|
|
2174
|
+
if (textOverflow === "ellipsis") {
|
|
2175
|
+
children = /* @__PURE__ */jsx(SpanWithTextOverflow$1, {
|
|
2176
|
+
children
|
|
2177
|
+
});
|
|
2178
|
+
}
|
|
2179
|
+
return /* @__PURE__ */jsx(Root$x, {
|
|
2180
|
+
"data-ui": "Text",
|
|
2181
|
+
...restProps,
|
|
2182
|
+
$accent: accent,
|
|
2183
|
+
$align: useArrayProp(align),
|
|
2184
|
+
$muted: muted,
|
|
2185
|
+
ref,
|
|
2186
|
+
$size: useArrayProp(size),
|
|
2187
|
+
$weight: weight,
|
|
2188
|
+
children: /* @__PURE__ */jsx("span", {
|
|
2189
|
+
children
|
|
2190
|
+
})
|
|
2191
|
+
});
|
|
2192
|
+
});
|
|
2148
2193
|
function badgeStyle(props) {
|
|
2149
2194
|
const {
|
|
2150
2195
|
$tone
|
|
@@ -2160,7 +2205,7 @@ function badgeStyle(props) {
|
|
|
2160
2205
|
}
|
|
2161
2206
|
};
|
|
2162
2207
|
}
|
|
2163
|
-
const Root$
|
|
2208
|
+
const Root$w = styled(Box)(responsiveRadiusStyle, badgeStyle);
|
|
2164
2209
|
const Badge = forwardRef(function Badge2(props, ref) {
|
|
2165
2210
|
const {
|
|
2166
2211
|
children,
|
|
@@ -2172,7 +2217,7 @@ const Badge = forwardRef(function Badge2(props, ref) {
|
|
|
2172
2217
|
tone = "default",
|
|
2173
2218
|
...restProps
|
|
2174
2219
|
} = props;
|
|
2175
|
-
return /* @__PURE__ */jsx(Root$
|
|
2220
|
+
return /* @__PURE__ */jsx(Root$w, {
|
|
2176
2221
|
"data-ui": "Badge",
|
|
2177
2222
|
...restProps,
|
|
2178
2223
|
$tone: tone,
|
|
@@ -2181,12 +2226,11 @@ const Badge = forwardRef(function Badge2(props, ref) {
|
|
|
2181
2226
|
ref,
|
|
2182
2227
|
children: /* @__PURE__ */jsx(Text, {
|
|
2183
2228
|
size: fontSize,
|
|
2184
|
-
weight: "medium",
|
|
2185
2229
|
children
|
|
2186
2230
|
})
|
|
2187
2231
|
});
|
|
2188
2232
|
});
|
|
2189
|
-
const Root$
|
|
2233
|
+
const Root$v = styled(Box)(flexItemStyle, responsiveFlexStyle);
|
|
2190
2234
|
const Flex = forwardRef(function Flex2(props, ref) {
|
|
2191
2235
|
const {
|
|
2192
2236
|
align,
|
|
@@ -2197,7 +2241,7 @@ const Flex = forwardRef(function Flex2(props, ref) {
|
|
|
2197
2241
|
wrap,
|
|
2198
2242
|
...restProps
|
|
2199
2243
|
} = props;
|
|
2200
|
-
return /* @__PURE__ */jsx(Root$
|
|
2244
|
+
return /* @__PURE__ */jsx(Root$v, {
|
|
2201
2245
|
"data-ui": "Flex",
|
|
2202
2246
|
...restProps,
|
|
2203
2247
|
$align: useArrayProp(align),
|
|
@@ -2209,16 +2253,16 @@ const Flex = forwardRef(function Flex2(props, ref) {
|
|
|
2209
2253
|
ref
|
|
2210
2254
|
});
|
|
2211
2255
|
});
|
|
2212
|
-
var __freeze$
|
|
2213
|
-
var __defProp$
|
|
2214
|
-
var __template$
|
|
2215
|
-
value: __freeze$
|
|
2256
|
+
var __freeze$y = Object.freeze;
|
|
2257
|
+
var __defProp$z = Object.defineProperty;
|
|
2258
|
+
var __template$y = (cooked, raw) => __freeze$y(__defProp$z(cooked, "raw", {
|
|
2259
|
+
value: __freeze$y(raw || cooked.slice())
|
|
2216
2260
|
}));
|
|
2217
|
-
var _a$
|
|
2218
|
-
const rotate$1 = keyframes(_a$
|
|
2219
|
-
const Root$
|
|
2261
|
+
var _a$y, _b$k;
|
|
2262
|
+
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"])));
|
|
2263
|
+
const Root$u = styled(Text)(_b$k || (_b$k = __template$y(["\n & > span > svg {\n animation: ", " 500ms linear infinite;\n }\n"])), rotate$1);
|
|
2220
2264
|
const Spinner = forwardRef(function Spinner2(props, ref) {
|
|
2221
|
-
return /* @__PURE__ */jsx(Root$
|
|
2265
|
+
return /* @__PURE__ */jsx(Root$u, {
|
|
2222
2266
|
"data-ui": "Spinner",
|
|
2223
2267
|
...props,
|
|
2224
2268
|
ref,
|
|
@@ -2229,6 +2273,7 @@ function _cardColorStyle(base, color) {
|
|
|
2229
2273
|
let checkered = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
2230
2274
|
return {
|
|
2231
2275
|
// from base
|
|
2276
|
+
"--card-backdrop-color": base.backdrop,
|
|
2232
2277
|
"--card-focus-ring-color": base.focusRing,
|
|
2233
2278
|
"--card-shadow-outline-color": base.shadow.outline,
|
|
2234
2279
|
"--card-shadow-umbra-color": base.shadow.umbra,
|
|
@@ -2296,12 +2341,12 @@ function _cardColorStyle(base, color) {
|
|
|
2296
2341
|
"--card-hairline-hard-color": color.border
|
|
2297
2342
|
};
|
|
2298
2343
|
}
|
|
2299
|
-
var __freeze$
|
|
2300
|
-
var __defProp$
|
|
2301
|
-
var __template$
|
|
2302
|
-
value: __freeze$
|
|
2344
|
+
var __freeze$x = Object.freeze;
|
|
2345
|
+
var __defProp$y = Object.defineProperty;
|
|
2346
|
+
var __template$x = (cooked, raw) => __freeze$x(__defProp$y(cooked, "raw", {
|
|
2347
|
+
value: __freeze$x(raw || cooked.slice())
|
|
2303
2348
|
}));
|
|
2304
|
-
var _a$
|
|
2349
|
+
var _a$x, _b$j;
|
|
2305
2350
|
function buttonBaseStyles(props) {
|
|
2306
2351
|
const {
|
|
2307
2352
|
$width
|
|
@@ -2309,7 +2354,7 @@ function buttonBaseStyles(props) {
|
|
|
2309
2354
|
const {
|
|
2310
2355
|
style
|
|
2311
2356
|
} = getTheme_v2(props.theme);
|
|
2312
|
-
return css(_b$j || (_b$j = __template$
|
|
2357
|
+
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
2358
|
}
|
|
2314
2359
|
function combineBoxShadow() {
|
|
2315
2360
|
for (var _len = arguments.length, boxShadows = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -2364,14 +2409,14 @@ function buttonColorStyles(props) {
|
|
|
2364
2409
|
}
|
|
2365
2410
|
}, (_a2 = style == null ? void 0 : style.button) == null ? void 0 : _a2.root].filter(Boolean);
|
|
2366
2411
|
}
|
|
2367
|
-
var __freeze$
|
|
2368
|
-
var __defProp$
|
|
2369
|
-
var __template$
|
|
2370
|
-
value: __freeze$
|
|
2412
|
+
var __freeze$w = Object.freeze;
|
|
2413
|
+
var __defProp$x = Object.defineProperty;
|
|
2414
|
+
var __template$w = (cooked, raw) => __freeze$w(__defProp$x(cooked, "raw", {
|
|
2415
|
+
value: __freeze$w(raw || cooked.slice())
|
|
2371
2416
|
}));
|
|
2372
|
-
var _a$
|
|
2373
|
-
const Root$
|
|
2374
|
-
const LoadingBox = styled.div(_a$
|
|
2417
|
+
var _a$w;
|
|
2418
|
+
const Root$t = styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles);
|
|
2419
|
+
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
2420
|
const Button = forwardRef(function Button2(props, ref) {
|
|
2376
2421
|
const {
|
|
2377
2422
|
children,
|
|
@@ -2423,7 +2468,7 @@ const Button = forwardRef(function Button2(props, ref) {
|
|
|
2423
2468
|
paddingLeft,
|
|
2424
2469
|
paddingRight
|
|
2425
2470
|
}), [padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight]);
|
|
2426
|
-
return /* @__PURE__ */jsxs(Root$
|
|
2471
|
+
return /* @__PURE__ */jsxs(Root$t, {
|
|
2427
2472
|
"data-ui": "Button",
|
|
2428
2473
|
...restProps,
|
|
2429
2474
|
$mode: mode,
|
|
@@ -2469,12 +2514,12 @@ const Button = forwardRef(function Button2(props, ref) {
|
|
|
2469
2514
|
})]
|
|
2470
2515
|
});
|
|
2471
2516
|
});
|
|
2472
|
-
var __freeze$
|
|
2473
|
-
var __defProp$
|
|
2474
|
-
var __template$
|
|
2475
|
-
value: __freeze$
|
|
2517
|
+
var __freeze$v = Object.freeze;
|
|
2518
|
+
var __defProp$w = Object.defineProperty;
|
|
2519
|
+
var __template$v = (cooked, raw) => __freeze$v(__defProp$w(cooked, "raw", {
|
|
2520
|
+
value: __freeze$v(raw || cooked.slice())
|
|
2476
2521
|
}));
|
|
2477
|
-
var _a$
|
|
2522
|
+
var _a$v, _b$i, _c$9;
|
|
2478
2523
|
function cardStyle(props) {
|
|
2479
2524
|
return [cardBaseStyle(props), cardColorStyle(props)];
|
|
2480
2525
|
}
|
|
@@ -2485,7 +2530,7 @@ function cardBaseStyle(props) {
|
|
|
2485
2530
|
const {
|
|
2486
2531
|
space
|
|
2487
2532
|
} = getTheme_v2(props.theme);
|
|
2488
|
-
return css(_b$i || (_b$i = __template$
|
|
2533
|
+
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
2534
|
}
|
|
2490
2535
|
function cardColorStyle(props) {
|
|
2491
2536
|
var _a2;
|
|
@@ -2502,7 +2547,7 @@ function cardColorStyle(props) {
|
|
|
2502
2547
|
width: card.border.width,
|
|
2503
2548
|
color: "var(--card-border-color)"
|
|
2504
2549
|
};
|
|
2505
|
-
return css(_c$9 || (_c$9 = __template$
|
|
2550
|
+
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
2551
|
base: color,
|
|
2507
2552
|
border,
|
|
2508
2553
|
focusRing: card.focusRing
|
|
@@ -2512,7 +2557,7 @@ function cardColorStyle(props) {
|
|
|
2512
2557
|
focusRing: card.focusRing
|
|
2513
2558
|
}) : void 0, (_a2 = style == null ? void 0 : style.card) == null ? void 0 : _a2.root);
|
|
2514
2559
|
}
|
|
2515
|
-
const Root$
|
|
2560
|
+
const Root$s = styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle);
|
|
2516
2561
|
const Card = forwardRef(function Card2(props, ref) {
|
|
2517
2562
|
const {
|
|
2518
2563
|
__unstable_checkered: checkered = false,
|
|
@@ -2537,7 +2582,7 @@ const Card = forwardRef(function Card2(props, ref) {
|
|
|
2537
2582
|
return /* @__PURE__ */jsx(ThemeColorProvider, {
|
|
2538
2583
|
scheme,
|
|
2539
2584
|
tone,
|
|
2540
|
-
children: /* @__PURE__ */jsx(Root$
|
|
2585
|
+
children: /* @__PURE__ */jsx(Root$s, {
|
|
2541
2586
|
"data-as": typeof as === "string" ? as : void 0,
|
|
2542
2587
|
"data-scheme": rootTheme.scheme,
|
|
2543
2588
|
"data-ui": "Card",
|
|
@@ -2562,14 +2607,14 @@ const Card = forwardRef(function Card2(props, ref) {
|
|
|
2562
2607
|
})
|
|
2563
2608
|
});
|
|
2564
2609
|
});
|
|
2565
|
-
var __freeze$
|
|
2566
|
-
var __defProp$
|
|
2567
|
-
var __template$
|
|
2568
|
-
value: __freeze$
|
|
2610
|
+
var __freeze$u = Object.freeze;
|
|
2611
|
+
var __defProp$v = Object.defineProperty;
|
|
2612
|
+
var __template$u = (cooked, raw) => __freeze$u(__defProp$v(cooked, "raw", {
|
|
2613
|
+
value: __freeze$u(raw || cooked.slice())
|
|
2569
2614
|
}));
|
|
2570
|
-
var _a$
|
|
2615
|
+
var _a$u, _b$h;
|
|
2571
2616
|
function checkboxBaseStyles() {
|
|
2572
|
-
return css(_a$
|
|
2617
|
+
return css(_a$u || (_a$u = __template$u(["\n position: relative;\n display: inline-block;\n "])));
|
|
2573
2618
|
}
|
|
2574
2619
|
function inputElementStyles(props) {
|
|
2575
2620
|
const {
|
|
@@ -2580,7 +2625,7 @@ function inputElementStyles(props) {
|
|
|
2580
2625
|
const {
|
|
2581
2626
|
focusRing
|
|
2582
2627
|
} = input.checkbox;
|
|
2583
|
-
return css(_b$h || (_b$h = __template$
|
|
2628
|
+
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
2629
|
color: color.input.default.enabled.border,
|
|
2585
2630
|
width: input.border.width
|
|
2586
2631
|
}), rem(radius[2]), color.input.default.enabled.bg, color.input.default.enabled.fg, focusRingBorderStyle({
|
|
@@ -2613,7 +2658,7 @@ function inputElementStyles(props) {
|
|
|
2613
2658
|
color: color.input.default.readOnly.border
|
|
2614
2659
|
}), color.input.default.readOnly.fg, color.input.default.readOnly.muted.bg);
|
|
2615
2660
|
}
|
|
2616
|
-
const Root$
|
|
2661
|
+
const Root$r = styled.div(checkboxBaseStyles);
|
|
2617
2662
|
const Input$5 = styled.input(inputElementStyles);
|
|
2618
2663
|
const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
|
|
2619
2664
|
const {
|
|
@@ -2633,7 +2678,7 @@ const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
|
|
|
2633
2678
|
ref.current.indeterminate = indeterminate || false;
|
|
2634
2679
|
}
|
|
2635
2680
|
}, [indeterminate, ref]);
|
|
2636
|
-
return /* @__PURE__ */jsxs(Root$
|
|
2681
|
+
return /* @__PURE__ */jsxs(Root$r, {
|
|
2637
2682
|
className,
|
|
2638
2683
|
"data-ui": "Checkbox",
|
|
2639
2684
|
style,
|
|
@@ -2651,12 +2696,12 @@ const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
|
|
|
2651
2696
|
})]
|
|
2652
2697
|
});
|
|
2653
2698
|
});
|
|
2654
|
-
var __freeze$
|
|
2655
|
-
var __defProp$
|
|
2656
|
-
var __template$
|
|
2657
|
-
value: __freeze$
|
|
2699
|
+
var __freeze$t = Object.freeze;
|
|
2700
|
+
var __defProp$u = Object.defineProperty;
|
|
2701
|
+
var __template$t = (cooked, raw) => __freeze$t(__defProp$u(cooked, "raw", {
|
|
2702
|
+
value: __freeze$t(raw || cooked.slice())
|
|
2658
2703
|
}));
|
|
2659
|
-
var _a$
|
|
2704
|
+
var _a$t;
|
|
2660
2705
|
function codeSyntaxHighlightingStyle(_ref2) {
|
|
2661
2706
|
let {
|
|
2662
2707
|
theme
|
|
@@ -2778,9 +2823,9 @@ function codeSyntaxHighlightingStyle(_ref2) {
|
|
|
2778
2823
|
};
|
|
2779
2824
|
}
|
|
2780
2825
|
function codeBaseStyle() {
|
|
2781
|
-
return css(_a$
|
|
2826
|
+
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
2827
|
}
|
|
2783
|
-
const Root$
|
|
2828
|
+
const Root$q = styled.pre(codeBaseStyle, responsiveCodeFontStyle);
|
|
2784
2829
|
const Code = forwardRef(function Code2(props, ref) {
|
|
2785
2830
|
const {
|
|
2786
2831
|
children,
|
|
@@ -2791,7 +2836,7 @@ const Code = forwardRef(function Code2(props, ref) {
|
|
|
2791
2836
|
} = props;
|
|
2792
2837
|
const language = typeof languageProp === "string" ? languageProp : void 0;
|
|
2793
2838
|
const registered = language ? Refractor.hasLanguage(language) : false;
|
|
2794
|
-
return /* @__PURE__ */jsxs(Root$
|
|
2839
|
+
return /* @__PURE__ */jsxs(Root$q, {
|
|
2795
2840
|
"data-ui": "Code",
|
|
2796
2841
|
...restProps,
|
|
2797
2842
|
$size: useArrayProp(size),
|
|
@@ -2822,14 +2867,14 @@ function responsiveContainerWidthStyle(props) {
|
|
|
2822
2867
|
maxWidth: val === "auto" ? "none" : rem(container[val])
|
|
2823
2868
|
}));
|
|
2824
2869
|
}
|
|
2825
|
-
const Root$
|
|
2870
|
+
const Root$p = styled(Box)(containerBaseStyle, responsiveContainerWidthStyle);
|
|
2826
2871
|
const Container = forwardRef(function Container2(props, ref) {
|
|
2827
2872
|
const {
|
|
2828
2873
|
as,
|
|
2829
2874
|
width = 2,
|
|
2830
2875
|
...restProps
|
|
2831
2876
|
} = props;
|
|
2832
|
-
return /* @__PURE__ */jsx(Root$
|
|
2877
|
+
return /* @__PURE__ */jsx(Root$p, {
|
|
2833
2878
|
"data-ui": "Container",
|
|
2834
2879
|
...restProps,
|
|
2835
2880
|
$width: useArrayProp(width),
|
|
@@ -2837,7 +2882,7 @@ const Container = forwardRef(function Container2(props, ref) {
|
|
|
2837
2882
|
ref
|
|
2838
2883
|
});
|
|
2839
2884
|
});
|
|
2840
|
-
const Root$
|
|
2885
|
+
const Root$o = styled(Box)(responsiveGridStyle);
|
|
2841
2886
|
const Grid = forwardRef(function Grid2(props, ref) {
|
|
2842
2887
|
const {
|
|
2843
2888
|
as,
|
|
@@ -2852,7 +2897,7 @@ const Grid = forwardRef(function Grid2(props, ref) {
|
|
|
2852
2897
|
children,
|
|
2853
2898
|
...restProps
|
|
2854
2899
|
} = props;
|
|
2855
|
-
return /* @__PURE__ */jsx(Root$
|
|
2900
|
+
return /* @__PURE__ */jsx(Root$o, {
|
|
2856
2901
|
"data-as": typeof as === "string" ? as : void 0,
|
|
2857
2902
|
"data-ui": "Grid",
|
|
2858
2903
|
...restProps,
|
|
@@ -2869,12 +2914,12 @@ const Grid = forwardRef(function Grid2(props, ref) {
|
|
|
2869
2914
|
children
|
|
2870
2915
|
});
|
|
2871
2916
|
});
|
|
2872
|
-
var __freeze$
|
|
2873
|
-
var __defProp$
|
|
2874
|
-
var __template$
|
|
2875
|
-
value: __freeze$
|
|
2917
|
+
var __freeze$s = Object.freeze;
|
|
2918
|
+
var __defProp$t = Object.defineProperty;
|
|
2919
|
+
var __template$s = (cooked, raw) => __freeze$s(__defProp$t(cooked, "raw", {
|
|
2920
|
+
value: __freeze$s(raw || cooked.slice())
|
|
2876
2921
|
}));
|
|
2877
|
-
var _a$
|
|
2922
|
+
var _a$s, _b$g, _c$8;
|
|
2878
2923
|
function headingBaseStyle(props) {
|
|
2879
2924
|
const {
|
|
2880
2925
|
$accent,
|
|
@@ -2883,16 +2928,16 @@ function headingBaseStyle(props) {
|
|
|
2883
2928
|
const {
|
|
2884
2929
|
font
|
|
2885
2930
|
} = getTheme_v2(props.theme);
|
|
2886
|
-
return css(_c$8 || (_c$8 = __template$
|
|
2931
|
+
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
2932
|
}
|
|
2888
|
-
var __freeze$
|
|
2889
|
-
var __defProp$
|
|
2890
|
-
var __template$
|
|
2891
|
-
value: __freeze$
|
|
2933
|
+
var __freeze$r = Object.freeze;
|
|
2934
|
+
var __defProp$s = Object.defineProperty;
|
|
2935
|
+
var __template$r = (cooked, raw) => __freeze$r(__defProp$s(cooked, "raw", {
|
|
2936
|
+
value: __freeze$r(raw || cooked.slice())
|
|
2892
2937
|
}));
|
|
2893
|
-
var _a$
|
|
2894
|
-
const Root$
|
|
2895
|
-
const SpanWithTextOverflow = styled.span(_a$
|
|
2938
|
+
var _a$r;
|
|
2939
|
+
const Root$n = styled.div(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont);
|
|
2940
|
+
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
2941
|
const Heading = forwardRef(function Heading2(props, ref) {
|
|
2897
2942
|
const {
|
|
2898
2943
|
accent = false,
|
|
@@ -2910,7 +2955,7 @@ const Heading = forwardRef(function Heading2(props, ref) {
|
|
|
2910
2955
|
children
|
|
2911
2956
|
});
|
|
2912
2957
|
}
|
|
2913
|
-
return /* @__PURE__ */jsx(Root$
|
|
2958
|
+
return /* @__PURE__ */jsx(Root$n, {
|
|
2914
2959
|
"data-ui": "Heading",
|
|
2915
2960
|
...restProps,
|
|
2916
2961
|
$accent: accent,
|
|
@@ -2951,7 +2996,7 @@ function inlineSpaceStyle(props) {
|
|
|
2951
2996
|
};
|
|
2952
2997
|
});
|
|
2953
2998
|
}
|
|
2954
|
-
const Root$
|
|
2999
|
+
const Root$m = styled(Box)(inlineBaseStyle, inlineSpaceStyle);
|
|
2955
3000
|
const Inline = forwardRef(function Inline2(props, ref) {
|
|
2956
3001
|
const {
|
|
2957
3002
|
as,
|
|
@@ -2962,7 +3007,7 @@ const Inline = forwardRef(function Inline2(props, ref) {
|
|
|
2962
3007
|
const children = useMemo(() => childrenToElementArray(childrenProp).filter(Boolean).map((child, idx) => /* @__PURE__ */jsx("div", {
|
|
2963
3008
|
children: child
|
|
2964
3009
|
}, idx)), [childrenProp]);
|
|
2965
|
-
return /* @__PURE__ */jsx(Root$
|
|
3010
|
+
return /* @__PURE__ */jsx(Root$m, {
|
|
2966
3011
|
"data-ui": "Inline",
|
|
2967
3012
|
...restProps,
|
|
2968
3013
|
$space: useArrayProp(space),
|
|
@@ -2971,16 +3016,16 @@ const Inline = forwardRef(function Inline2(props, ref) {
|
|
|
2971
3016
|
children
|
|
2972
3017
|
});
|
|
2973
3018
|
});
|
|
2974
|
-
var __freeze$
|
|
2975
|
-
var __defProp$
|
|
2976
|
-
var __template$
|
|
2977
|
-
value: __freeze$
|
|
3019
|
+
var __freeze$q = Object.freeze;
|
|
3020
|
+
var __defProp$r = Object.defineProperty;
|
|
3021
|
+
var __template$q = (cooked, raw) => __freeze$q(__defProp$r(cooked, "raw", {
|
|
3022
|
+
value: __freeze$q(raw || cooked.slice())
|
|
2978
3023
|
}));
|
|
2979
|
-
var _a$
|
|
3024
|
+
var _a$q;
|
|
2980
3025
|
function kbdStyle() {
|
|
2981
|
-
return css(_a$
|
|
3026
|
+
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
3027
|
}
|
|
2983
|
-
const Root$
|
|
3028
|
+
const Root$l = styled.kbd(responsiveRadiusStyle, kbdStyle);
|
|
2984
3029
|
const KBD = forwardRef(function KBD2(props, ref) {
|
|
2985
3030
|
const {
|
|
2986
3031
|
children,
|
|
@@ -2989,7 +3034,7 @@ const KBD = forwardRef(function KBD2(props, ref) {
|
|
|
2989
3034
|
radius = 2,
|
|
2990
3035
|
...restProps
|
|
2991
3036
|
} = props;
|
|
2992
|
-
return /* @__PURE__ */jsx(Root$
|
|
3037
|
+
return /* @__PURE__ */jsx(Root$l, {
|
|
2993
3038
|
"data-ui": "KBD",
|
|
2994
3039
|
...restProps,
|
|
2995
3040
|
$radius: useArrayProp(radius),
|
|
@@ -3006,6 +3051,45 @@ const KBD = forwardRef(function KBD2(props, ref) {
|
|
|
3006
3051
|
})
|
|
3007
3052
|
});
|
|
3008
3053
|
});
|
|
3054
|
+
const origin = {
|
|
3055
|
+
name: "@sanity/ui/origin",
|
|
3056
|
+
fn(_ref3) {
|
|
3057
|
+
let {
|
|
3058
|
+
middlewareData,
|
|
3059
|
+
placement,
|
|
3060
|
+
rects
|
|
3061
|
+
} = _ref3;
|
|
3062
|
+
var _a, _b;
|
|
3063
|
+
const [side] = placement.split("-");
|
|
3064
|
+
const floatingWidth = rects.floating.width;
|
|
3065
|
+
const floatingHeight = rects.floating.height;
|
|
3066
|
+
const shiftX = ((_a = middlewareData.shift) == null ? void 0 : _a.x) || 0;
|
|
3067
|
+
const shiftY = ((_b = middlewareData.shift) == null ? void 0 : _b.y) || 0;
|
|
3068
|
+
if (floatingWidth <= 0 || floatingHeight <= 0) {
|
|
3069
|
+
return {};
|
|
3070
|
+
}
|
|
3071
|
+
const isVerticalPlacement = ["bottom", "top"].includes(side);
|
|
3072
|
+
const {
|
|
3073
|
+
originX,
|
|
3074
|
+
originY
|
|
3075
|
+
} = isVerticalPlacement ? {
|
|
3076
|
+
originX: clamp(0.5 - shiftX / floatingWidth, 0, 1),
|
|
3077
|
+
originY: side === "bottom" ? 0 : 1
|
|
3078
|
+
} : {
|
|
3079
|
+
originX: side === "left" ? 1 : 0,
|
|
3080
|
+
originY: clamp(0.5 - shiftY / floatingHeight, 0, 1)
|
|
3081
|
+
};
|
|
3082
|
+
return {
|
|
3083
|
+
data: {
|
|
3084
|
+
originX,
|
|
3085
|
+
originY
|
|
3086
|
+
}
|
|
3087
|
+
};
|
|
3088
|
+
}
|
|
3089
|
+
};
|
|
3090
|
+
function clamp(num, min, max) {
|
|
3091
|
+
return Math.min(Math.max(num, min), max);
|
|
3092
|
+
}
|
|
3009
3093
|
function moveTowardsLength(movingPoint, targetPoint, amount) {
|
|
3010
3094
|
const width = targetPoint.x - movingPoint.x;
|
|
3011
3095
|
const height = targetPoint.y - movingPoint.y;
|
|
@@ -3060,20 +3144,20 @@ function compileCommands(cmds) {
|
|
|
3060
3144
|
return "";
|
|
3061
3145
|
}).join(" ");
|
|
3062
3146
|
}
|
|
3063
|
-
var __freeze$
|
|
3064
|
-
var __defProp$
|
|
3065
|
-
var __template$
|
|
3066
|
-
value: __freeze$
|
|
3147
|
+
var __freeze$p = Object.freeze;
|
|
3148
|
+
var __defProp$q = Object.defineProperty;
|
|
3149
|
+
var __template$p = (cooked, raw) => __freeze$p(__defProp$q(cooked, "raw", {
|
|
3150
|
+
value: __freeze$p(raw || cooked.slice())
|
|
3067
3151
|
}));
|
|
3068
|
-
var _a$
|
|
3069
|
-
const Root$
|
|
3152
|
+
var _a$p, _b$f, _c$7;
|
|
3153
|
+
const Root$k = styled.div(_ref4 => {
|
|
3070
3154
|
let {
|
|
3071
3155
|
$w: w
|
|
3072
|
-
} =
|
|
3073
|
-
return css(_a$
|
|
3156
|
+
} = _ref4;
|
|
3157
|
+
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
3158
|
});
|
|
3075
|
-
const StrokePath = styled.path(_b$f || (_b$f = __template$
|
|
3076
|
-
const ShapePath = styled.path(_c$7 || (_c$7 = __template$
|
|
3159
|
+
const StrokePath = styled.path(_b$f || (_b$f = __template$p(["\n stroke: var(--card-shadow-outline-color);\n"])));
|
|
3160
|
+
const ShapePath = styled.path(_c$7 || (_c$7 = __template$p(["\n fill: var(--card-bg-color);\n"])));
|
|
3077
3161
|
const Arrow = forwardRef(function Arrow2(props, ref) {
|
|
3078
3162
|
const {
|
|
3079
3163
|
width: w,
|
|
@@ -3109,7 +3193,7 @@ const Arrow = forwardRef(function Arrow2(props, ref) {
|
|
|
3109
3193
|
const path = compileCommands(cmds);
|
|
3110
3194
|
const strokePath = "".concat(path);
|
|
3111
3195
|
const fillPath = "".concat(path, " M ").concat(w, " -1 M 0 -1 Z");
|
|
3112
|
-
return /* @__PURE__ */jsx(Root$
|
|
3196
|
+
return /* @__PURE__ */jsx(Root$k, {
|
|
3113
3197
|
...restProps,
|
|
3114
3198
|
$w: w,
|
|
3115
3199
|
ref,
|
|
@@ -3167,6 +3251,17 @@ function useBoundaryElement() {
|
|
|
3167
3251
|
}
|
|
3168
3252
|
return value || DEFAULT_VALUE;
|
|
3169
3253
|
}
|
|
3254
|
+
function ConditionalWrapper(_ref5) {
|
|
3255
|
+
let {
|
|
3256
|
+
children,
|
|
3257
|
+
condition,
|
|
3258
|
+
wrapper
|
|
3259
|
+
} = _ref5;
|
|
3260
|
+
if (!condition) {
|
|
3261
|
+
return children;
|
|
3262
|
+
}
|
|
3263
|
+
return wrapper(children);
|
|
3264
|
+
}
|
|
3170
3265
|
function findMaxBreakpoints(media, width) {
|
|
3171
3266
|
const ret = [];
|
|
3172
3267
|
for (let i = 0; i < media.length; i += 1) {
|
|
@@ -3216,8 +3311,8 @@ const ElementQuery = forwardRef(function ElementQuery2(props, ref) {
|
|
|
3216
3311
|
children
|
|
3217
3312
|
});
|
|
3218
3313
|
});
|
|
3219
|
-
var __defProp$
|
|
3220
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp$
|
|
3314
|
+
var __defProp$p = Object.defineProperty;
|
|
3315
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp$p(obj, key, {
|
|
3221
3316
|
enumerable: true,
|
|
3222
3317
|
configurable: true,
|
|
3223
3318
|
writable: true,
|
|
@@ -3446,7 +3541,7 @@ function LayerProvider(props) {
|
|
|
3446
3541
|
children
|
|
3447
3542
|
});
|
|
3448
3543
|
}
|
|
3449
|
-
const Root$
|
|
3544
|
+
const Root$j = styled.div({
|
|
3450
3545
|
position: "relative"
|
|
3451
3546
|
});
|
|
3452
3547
|
const LayerChildren = forwardRef(function LayerChildren2(props, ref) {
|
|
@@ -3482,7 +3577,7 @@ const LayerChildren = forwardRef(function LayerChildren2(props, ref) {
|
|
|
3482
3577
|
lastFocusedRef.current = target;
|
|
3483
3578
|
}
|
|
3484
3579
|
}, [forwardedRef, isTopLayer, onFocus]);
|
|
3485
|
-
return /* @__PURE__ */jsx(Root$
|
|
3580
|
+
return /* @__PURE__ */jsx(Root$j, {
|
|
3486
3581
|
...restProps,
|
|
3487
3582
|
"data-ui": "Layer",
|
|
3488
3583
|
onFocus: handleFocus,
|
|
@@ -3593,19 +3688,19 @@ function PortalProvider(props) {
|
|
|
3593
3688
|
children
|
|
3594
3689
|
});
|
|
3595
3690
|
}
|
|
3596
|
-
var __freeze$
|
|
3597
|
-
var __defProp$
|
|
3598
|
-
var __template$
|
|
3599
|
-
value: __freeze$
|
|
3691
|
+
var __freeze$o = Object.freeze;
|
|
3692
|
+
var __defProp$o = Object.defineProperty;
|
|
3693
|
+
var __template$o = (cooked, raw) => __freeze$o(__defProp$o(cooked, "raw", {
|
|
3694
|
+
value: __freeze$o(raw || cooked.slice())
|
|
3600
3695
|
}));
|
|
3601
|
-
var _a$
|
|
3602
|
-
const Root$
|
|
3696
|
+
var _a$o;
|
|
3697
|
+
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
3698
|
const SrOnly = forwardRef(function SrOnly2(props, ref) {
|
|
3604
3699
|
const {
|
|
3605
3700
|
as,
|
|
3606
3701
|
children
|
|
3607
3702
|
} = props;
|
|
3608
|
-
return /* @__PURE__ */jsx(Root$
|
|
3703
|
+
return /* @__PURE__ */jsx(Root$i, {
|
|
3609
3704
|
"aria-hidden": true,
|
|
3610
3705
|
as,
|
|
3611
3706
|
"data-ui": "SrOnly",
|
|
@@ -3613,14 +3708,14 @@ const SrOnly = forwardRef(function SrOnly2(props, ref) {
|
|
|
3613
3708
|
children
|
|
3614
3709
|
});
|
|
3615
3710
|
});
|
|
3616
|
-
var __freeze$
|
|
3617
|
-
var __defProp$
|
|
3618
|
-
var __template$
|
|
3619
|
-
value: __freeze$
|
|
3711
|
+
var __freeze$n = Object.freeze;
|
|
3712
|
+
var __defProp$n = Object.defineProperty;
|
|
3713
|
+
var __template$n = (cooked, raw) => __freeze$n(__defProp$n(cooked, "raw", {
|
|
3714
|
+
value: __freeze$n(raw || cooked.slice())
|
|
3620
3715
|
}));
|
|
3621
|
-
var _a$
|
|
3622
|
-
const Root$
|
|
3623
|
-
const ItemWrapper = styled.div(_b$e || (_b$e = __template$
|
|
3716
|
+
var _a$n, _b$e;
|
|
3717
|
+
const Root$h = styled.div(_a$n || (_a$n = __template$n(["\n position: relative;\n"])));
|
|
3718
|
+
const ItemWrapper = styled.div(_b$e || (_b$e = __template$n(["\n position: absolute;\n left: 0;\n right: 0;\n"])));
|
|
3624
3719
|
const VirtualList = forwardRef(function VirtualList2(props, ref) {
|
|
3625
3720
|
const {
|
|
3626
3721
|
as = "div",
|
|
@@ -3726,7 +3821,7 @@ const VirtualList = forwardRef(function VirtualList2(props, ref) {
|
|
|
3726
3821
|
const wrapperStyle = useMemo(() => ({
|
|
3727
3822
|
height
|
|
3728
3823
|
}), [height]);
|
|
3729
|
-
return /* @__PURE__ */jsx(Root$
|
|
3824
|
+
return /* @__PURE__ */jsx(Root$h, {
|
|
3730
3825
|
as,
|
|
3731
3826
|
"data-ui": "VirtualList",
|
|
3732
3827
|
...restProps,
|
|
@@ -3844,17 +3939,17 @@ function calcMaxWidth(params) {
|
|
|
3844
3939
|
}
|
|
3845
3940
|
return Math.min(currentWidth != null ? currentWidth : Infinity, (boundaryWidth || Infinity) - DEFAULT_POPOVER_PADDING * 2);
|
|
3846
3941
|
}
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
});
|
|
3942
|
+
var __freeze$m = Object.freeze;
|
|
3943
|
+
var __defProp$m = Object.defineProperty;
|
|
3944
|
+
var __template$m = (cooked, raw) => __freeze$m(__defProp$m(cooked, "raw", {
|
|
3945
|
+
value: __freeze$m(raw || cooked.slice())
|
|
3946
|
+
}));
|
|
3947
|
+
var _a$m;
|
|
3948
|
+
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
3949
|
const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
3856
3950
|
const {
|
|
3857
3951
|
__unstable_margins: marginsProp,
|
|
3952
|
+
animate,
|
|
3858
3953
|
arrow,
|
|
3859
3954
|
arrowRef,
|
|
3860
3955
|
arrowX,
|
|
@@ -3862,6 +3957,8 @@ const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
|
3862
3957
|
children,
|
|
3863
3958
|
padding,
|
|
3864
3959
|
placement,
|
|
3960
|
+
originX,
|
|
3961
|
+
originY,
|
|
3865
3962
|
overflow,
|
|
3866
3963
|
radius,
|
|
3867
3964
|
scheme,
|
|
@@ -3881,20 +3978,22 @@ const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
|
3881
3978
|
const x = (xProp != null ? xProp : 0) + margins[3];
|
|
3882
3979
|
const y = (yProp != null ? yProp : 0) + margins[0];
|
|
3883
3980
|
const rootStyle = useMemo(() => ({
|
|
3981
|
+
left: x,
|
|
3982
|
+
originX,
|
|
3983
|
+
originY,
|
|
3884
3984
|
position: strategy,
|
|
3885
3985
|
top: y,
|
|
3886
|
-
left: x,
|
|
3887
3986
|
width,
|
|
3888
3987
|
zIndex,
|
|
3889
3988
|
...style
|
|
3890
|
-
}), [strategy, style, width, x, y, zIndex]);
|
|
3989
|
+
}), [originX, originY, strategy, style, width, x, y, zIndex]);
|
|
3891
3990
|
const arrowStyle = useMemo(() => ({
|
|
3892
3991
|
left: arrowX !== null ? arrowX : void 0,
|
|
3893
3992
|
top: arrowY !== null ? arrowY : void 0,
|
|
3894
3993
|
right: void 0,
|
|
3895
3994
|
bottom: void 0
|
|
3896
3995
|
}), [arrowX, arrowY]);
|
|
3897
|
-
return /* @__PURE__ */jsxs(
|
|
3996
|
+
return /* @__PURE__ */jsxs(MotionCard$1, {
|
|
3898
3997
|
"data-ui": "Popover",
|
|
3899
3998
|
...restProps,
|
|
3900
3999
|
"data-placement": placement,
|
|
@@ -3905,6 +4004,7 @@ const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
|
3905
4004
|
sizing: "border",
|
|
3906
4005
|
style: rootStyle,
|
|
3907
4006
|
tone,
|
|
4007
|
+
...(animate ? POPOVER_MOTION_PROPS : {}),
|
|
3908
4008
|
children: [/* @__PURE__ */jsx(Flex, {
|
|
3909
4009
|
"data-ui": "Popover__wrapper",
|
|
3910
4010
|
direction: "column",
|
|
@@ -3927,7 +4027,7 @@ const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
|
3927
4027
|
}));
|
|
3928
4028
|
PopoverCard.displayName = "PopoverCard";
|
|
3929
4029
|
const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
3930
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4030
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
3931
4031
|
const {
|
|
3932
4032
|
container,
|
|
3933
4033
|
layer
|
|
@@ -3935,6 +4035,7 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
3935
4035
|
const boundaryElementContext = useBoundaryElement();
|
|
3936
4036
|
const {
|
|
3937
4037
|
__unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
|
|
4038
|
+
animate = false,
|
|
3938
4039
|
arrow: arrowProp = false,
|
|
3939
4040
|
boundaryElement = boundaryElementContext.element,
|
|
3940
4041
|
children: childProp,
|
|
@@ -4022,13 +4123,13 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4022
4123
|
}));
|
|
4023
4124
|
if (constrainSize || matchReferenceWidth) {
|
|
4024
4125
|
ret.push(size({
|
|
4025
|
-
apply(
|
|
4126
|
+
apply(_ref6) {
|
|
4026
4127
|
let {
|
|
4027
4128
|
availableWidth,
|
|
4028
4129
|
availableHeight,
|
|
4029
4130
|
elements,
|
|
4030
4131
|
referenceWidth
|
|
4031
|
-
} =
|
|
4132
|
+
} = _ref6;
|
|
4032
4133
|
referenceWidthRef.current = referenceWidth;
|
|
4033
4134
|
const _currentWidth = widthRef.current;
|
|
4034
4135
|
const _maxWidth = maxWidthRef.current;
|
|
@@ -4062,13 +4163,16 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4062
4163
|
padding: DEFAULT_POPOVER_PADDING
|
|
4063
4164
|
}));
|
|
4064
4165
|
}
|
|
4166
|
+
if (animate) {
|
|
4167
|
+
ret.push(origin);
|
|
4168
|
+
}
|
|
4065
4169
|
ret.push(hide({
|
|
4066
4170
|
boundary: referenceBoundary || void 0,
|
|
4067
4171
|
padding: DEFAULT_POPOVER_PADDING,
|
|
4068
4172
|
strategy: "referenceHidden"
|
|
4069
4173
|
}));
|
|
4070
4174
|
return ret;
|
|
4071
|
-
}, [arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]);
|
|
4175
|
+
}, [animate, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]);
|
|
4072
4176
|
const {
|
|
4073
4177
|
x,
|
|
4074
4178
|
y,
|
|
@@ -4085,6 +4189,8 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4085
4189
|
const referenceHidden = (_f = middlewareData.hide) == null ? void 0 : _f.referenceHidden;
|
|
4086
4190
|
const arrowX = (_g = middlewareData.arrow) == null ? void 0 : _g.x;
|
|
4087
4191
|
const arrowY = (_h = middlewareData.arrow) == null ? void 0 : _h.y;
|
|
4192
|
+
const originX = (_i = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _i.originX;
|
|
4193
|
+
const originY = (_j = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _j.originY;
|
|
4088
4194
|
const setArrow = useCallback(arrowEl => {
|
|
4089
4195
|
arrowRef.current = arrowEl;
|
|
4090
4196
|
}, []);
|
|
@@ -4127,6 +4233,7 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4127
4233
|
children: /* @__PURE__ */jsx(PopoverCard, {
|
|
4128
4234
|
...restProps,
|
|
4129
4235
|
__unstable_margins: margins,
|
|
4236
|
+
animate,
|
|
4130
4237
|
arrow: arrowProp,
|
|
4131
4238
|
arrowRef: setArrow,
|
|
4132
4239
|
arrowX,
|
|
@@ -4139,6 +4246,8 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4139
4246
|
ref: setFloating,
|
|
4140
4247
|
scheme,
|
|
4141
4248
|
shadow,
|
|
4249
|
+
originX,
|
|
4250
|
+
originY,
|
|
4142
4251
|
strategy,
|
|
4143
4252
|
tone,
|
|
4144
4253
|
width: matchReferenceWidth ? referenceWidthRef.current : width,
|
|
@@ -4148,23 +4257,31 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4148
4257
|
})
|
|
4149
4258
|
});
|
|
4150
4259
|
return /* @__PURE__ */jsxs(Fragment, {
|
|
4151
|
-
children: [
|
|
4152
|
-
|
|
4153
|
-
|
|
4260
|
+
children: [/* @__PURE__ */jsx(ConditionalWrapper, {
|
|
4261
|
+
condition: animate,
|
|
4262
|
+
wrapper: children => /* @__PURE__ */jsx(AnimatePresence, {
|
|
4263
|
+
children
|
|
4264
|
+
}),
|
|
4265
|
+
children: open && /* @__PURE__ */jsx(ConditionalWrapper, {
|
|
4266
|
+
condition: !!portal,
|
|
4267
|
+
wrapper: children => /* @__PURE__ */jsx(Portal, {
|
|
4268
|
+
__unstable_name: typeof portal === "string" ? portal : void 0,
|
|
4269
|
+
children
|
|
4270
|
+
}),
|
|
4154
4271
|
children: popover
|
|
4155
|
-
})
|
|
4272
|
+
})
|
|
4156
4273
|
}), child]
|
|
4157
4274
|
});
|
|
4158
4275
|
}));
|
|
4159
4276
|
Popover.displayName = "Popover";
|
|
4160
|
-
var __freeze$
|
|
4161
|
-
var __defProp$
|
|
4162
|
-
var __template$
|
|
4163
|
-
value: __freeze$
|
|
4277
|
+
var __freeze$l = Object.freeze;
|
|
4278
|
+
var __defProp$l = Object.defineProperty;
|
|
4279
|
+
var __template$l = (cooked, raw) => __freeze$l(__defProp$l(cooked, "raw", {
|
|
4280
|
+
value: __freeze$l(raw || cooked.slice())
|
|
4164
4281
|
}));
|
|
4165
|
-
var _a$
|
|
4282
|
+
var _a$l, _b$d;
|
|
4166
4283
|
function radioBaseStyle() {
|
|
4167
|
-
return css(_a$
|
|
4284
|
+
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
4285
|
}
|
|
4169
4286
|
function inputElementStyle(props) {
|
|
4170
4287
|
const {
|
|
@@ -4172,7 +4289,7 @@ function inputElementStyle(props) {
|
|
|
4172
4289
|
input
|
|
4173
4290
|
} = getTheme_v2(props.theme);
|
|
4174
4291
|
const dist = (input.radio.size - input.radio.markSize) / 2;
|
|
4175
|
-
return css(_b$d || (_b$d = __template$
|
|
4292
|
+
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
4293
|
color: color.input.default.enabled.border,
|
|
4177
4294
|
width: input.border.width
|
|
4178
4295
|
}), 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 +4334,27 @@ const Radio = forwardRef(function Radio2(props, forwardedRef) {
|
|
|
4217
4334
|
}), /* @__PURE__ */jsx("span", {})]
|
|
4218
4335
|
});
|
|
4219
4336
|
});
|
|
4220
|
-
var __freeze$
|
|
4221
|
-
var __defProp$
|
|
4222
|
-
var __template$
|
|
4223
|
-
value: __freeze$
|
|
4337
|
+
var __freeze$k = Object.freeze;
|
|
4338
|
+
var __defProp$k = Object.defineProperty;
|
|
4339
|
+
var __template$k = (cooked, raw) => __freeze$k(__defProp$k(cooked, "raw", {
|
|
4340
|
+
value: __freeze$k(raw || cooked.slice())
|
|
4224
4341
|
}));
|
|
4225
|
-
var _a$
|
|
4342
|
+
var _a$k, _b$c, _c$6, _d$5;
|
|
4226
4343
|
function rootStyle() {
|
|
4227
|
-
return css(_a$
|
|
4344
|
+
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
4345
|
}
|
|
4229
4346
|
function inputBaseStyle(props) {
|
|
4230
4347
|
const {
|
|
4231
4348
|
font
|
|
4232
4349
|
} = getTheme_v2(props.theme);
|
|
4233
|
-
return css(_b$c || (_b$c = __template$
|
|
4350
|
+
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
4351
|
}
|
|
4235
4352
|
function inputColorStyle(props) {
|
|
4236
4353
|
const {
|
|
4237
4354
|
color,
|
|
4238
4355
|
input
|
|
4239
4356
|
} = getTheme_v2(props.theme);
|
|
4240
|
-
return css(_c$6 || (_c$6 = __template$
|
|
4357
|
+
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
4358
|
color: color.input.default.enabled.border,
|
|
4242
4359
|
width: input.border.width
|
|
4243
4360
|
}), color.input.default.hovered.bg, color.input.default.hovered.fg, focusRingBorderStyle({
|
|
@@ -4280,7 +4397,7 @@ function iconBoxStyle(props) {
|
|
|
4280
4397
|
const {
|
|
4281
4398
|
color
|
|
4282
4399
|
} = getTheme_v2(props.theme);
|
|
4283
|
-
return css(_d$5 || (_d$5 = __template$
|
|
4400
|
+
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
4401
|
}
|
|
4285
4402
|
const selectStyle = {
|
|
4286
4403
|
root: rootStyle,
|
|
@@ -4297,7 +4414,7 @@ const Select = forwardRef(function Select2(props, forwardedRef) {
|
|
|
4297
4414
|
disabled,
|
|
4298
4415
|
fontSize = 2,
|
|
4299
4416
|
padding = 3,
|
|
4300
|
-
radius =
|
|
4417
|
+
radius = 2,
|
|
4301
4418
|
readOnly,
|
|
4302
4419
|
space = 3,
|
|
4303
4420
|
...restProps
|
|
@@ -4364,32 +4481,32 @@ const Stack = forwardRef(function Stack2(props, ref) {
|
|
|
4364
4481
|
ref
|
|
4365
4482
|
});
|
|
4366
4483
|
});
|
|
4367
|
-
var __freeze$
|
|
4368
|
-
var __defProp$
|
|
4369
|
-
var __template$
|
|
4370
|
-
value: __freeze$
|
|
4484
|
+
var __freeze$j = Object.freeze;
|
|
4485
|
+
var __defProp$j = Object.defineProperty;
|
|
4486
|
+
var __template$j = (cooked, raw) => __freeze$j(__defProp$j(cooked, "raw", {
|
|
4487
|
+
value: __freeze$j(raw || cooked.slice())
|
|
4371
4488
|
}));
|
|
4372
|
-
var _a$
|
|
4489
|
+
var _a$j, _b$b, _c$5, _d$4, _e$2, _f$2, _g;
|
|
4373
4490
|
function switchBaseStyles() {
|
|
4374
|
-
return css(_a$
|
|
4491
|
+
return css(_a$j || (_a$j = __template$j(["\n position: relative;\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
|
|
4375
4492
|
}
|
|
4376
4493
|
function switchInputStyles() {
|
|
4377
|
-
return css(_b$b || (_b$b = __template$
|
|
4494
|
+
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
4495
|
}
|
|
4379
4496
|
function switchRepresentationStyles(props) {
|
|
4380
4497
|
const {
|
|
4381
4498
|
color,
|
|
4382
4499
|
input
|
|
4383
4500
|
} = getTheme_v2(props.theme);
|
|
4384
|
-
return css(_c$5 || (_c$5 = __template$
|
|
4501
|
+
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
4502
|
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);
|
|
4503
|
+
}), 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
4504
|
}
|
|
4388
4505
|
function switchTrackStyles(props) {
|
|
4389
4506
|
const {
|
|
4390
4507
|
input
|
|
4391
4508
|
} = getTheme_v2(props.theme);
|
|
4392
|
-
return css(_d$4 || (_d$4 = __template$
|
|
4509
|
+
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
4510
|
}
|
|
4394
4511
|
function switchThumbStyles(props) {
|
|
4395
4512
|
const {
|
|
@@ -4405,7 +4522,7 @@ function switchThumbStyles(props) {
|
|
|
4405
4522
|
const checkedOffset = trackWidth - trackPadding * 2 - size;
|
|
4406
4523
|
const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding;
|
|
4407
4524
|
const checked = $indeterminate !== true && props.$checked === true;
|
|
4408
|
-
return css(_g || (_g = __template$
|
|
4525
|
+
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
4526
|
}
|
|
4410
4527
|
const Root$d = styled.span(switchBaseStyles);
|
|
4411
4528
|
const Input$2 = styled.input(switchInputStyles);
|
|
@@ -4449,14 +4566,14 @@ const Switch = forwardRef(function Switch2(props, forwardedRef) {
|
|
|
4449
4566
|
})]
|
|
4450
4567
|
});
|
|
4451
4568
|
});
|
|
4452
|
-
var __freeze$
|
|
4453
|
-
var __defProp$
|
|
4454
|
-
var __template$
|
|
4455
|
-
value: __freeze$
|
|
4569
|
+
var __freeze$i = Object.freeze;
|
|
4570
|
+
var __defProp$i = Object.defineProperty;
|
|
4571
|
+
var __template$i = (cooked, raw) => __freeze$i(__defProp$i(cooked, "raw", {
|
|
4572
|
+
value: __freeze$i(raw || cooked.slice())
|
|
4456
4573
|
}));
|
|
4457
|
-
var _a$
|
|
4574
|
+
var _a$i;
|
|
4458
4575
|
const Root$c = styled.span(textInputRootStyle);
|
|
4459
|
-
const InputRoot$1 = styled.span(_a$
|
|
4576
|
+
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
4577
|
const Input$1 = styled.textarea(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle);
|
|
4461
4578
|
const Presentation$1 = styled.div(responsiveRadiusStyle, textInputRepresentationStyle);
|
|
4462
4579
|
const TextArea = forwardRef(function TextArea2(props, forwardedRef) {
|
|
@@ -4500,30 +4617,30 @@ const TextArea = forwardRef(function TextArea2(props, forwardedRef) {
|
|
|
4500
4617
|
})
|
|
4501
4618
|
});
|
|
4502
4619
|
});
|
|
4503
|
-
var __freeze$
|
|
4504
|
-
var __defProp$
|
|
4505
|
-
var __template$
|
|
4506
|
-
value: __freeze$
|
|
4620
|
+
var __freeze$h = Object.freeze;
|
|
4621
|
+
var __defProp$h = Object.defineProperty;
|
|
4622
|
+
var __template$h = (cooked, raw) => __freeze$h(__defProp$h(cooked, "raw", {
|
|
4623
|
+
value: __freeze$h(raw || cooked.slice())
|
|
4507
4624
|
}));
|
|
4508
|
-
var _a$
|
|
4625
|
+
var _a$h, _b$a, _c$4, _d$3, _e$1, _f$1;
|
|
4509
4626
|
const CLEAR_BUTTON_BOX_STYLE = {
|
|
4510
4627
|
zIndex: 2
|
|
4511
4628
|
};
|
|
4512
4629
|
const Root$b = styled(Card).attrs({
|
|
4513
4630
|
forwardedAs: "span"
|
|
4514
4631
|
})(textInputRootStyle);
|
|
4515
|
-
const InputRoot = styled.span(_a$
|
|
4632
|
+
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
4633
|
const Prefix = styled(Card).attrs({
|
|
4517
4634
|
forwardedAs: "span"
|
|
4518
|
-
})(_b$a || (_b$a = __template$
|
|
4635
|
+
})(_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
4636
|
const Suffix = styled(Card).attrs({
|
|
4520
4637
|
forwardedAs: "span"
|
|
4521
|
-
})(_c$4 || (_c$4 = __template$
|
|
4638
|
+
})(_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
4639
|
const Input = styled.input(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle);
|
|
4523
4640
|
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$
|
|
4641
|
+
const LeftBox = styled(Box)(_d$3 || (_d$3 = __template$h(["\n position: absolute;\n top: 0;\n left: 0;\n"])));
|
|
4642
|
+
const RightBox = styled(Box)(_e$1 || (_e$1 = __template$h(["\n position: absolute;\n top: 0;\n right: 0;\n"])));
|
|
4643
|
+
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
4644
|
const TextInputClearButton = styled(Button)({
|
|
4528
4645
|
"&:not([hidden])": {
|
|
4529
4646
|
display: "block"
|
|
@@ -4691,17 +4808,6 @@ function useDelayedState(initialState) {
|
|
|
4691
4808
|
}, []);
|
|
4692
4809
|
return [state, onStateChange];
|
|
4693
4810
|
}
|
|
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
4811
|
const DEFAULT_TOOLTIP_ARROW_WIDTH = 15;
|
|
4706
4812
|
const DEFAULT_TOOLTIP_ARROW_HEIGHT = 6;
|
|
4707
4813
|
const DEFAULT_TOOLTIP_ARROW_RADIUS = 2;
|
|
@@ -4721,6 +4827,63 @@ const DEFAULT_FALLBACK_PLACEMENTS = {
|
|
|
4721
4827
|
"right-start": ["right", "right-end", "left-start", "top-start", "bottom-start"],
|
|
4722
4828
|
"right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
|
|
4723
4829
|
};
|
|
4830
|
+
var __freeze$g = Object.freeze;
|
|
4831
|
+
var __defProp$g = Object.defineProperty;
|
|
4832
|
+
var __template$g = (cooked, raw) => __freeze$g(__defProp$g(cooked, "raw", {
|
|
4833
|
+
value: __freeze$g(raw || cooked.slice())
|
|
4834
|
+
}));
|
|
4835
|
+
var _a$g;
|
|
4836
|
+
const MotionCard = styled(motion(Card))(_a$g || (_a$g = __template$g([""])));
|
|
4837
|
+
const TooltipCard = memo(forwardRef(function TooltipCard2(props, ref) {
|
|
4838
|
+
const {
|
|
4839
|
+
animate,
|
|
4840
|
+
arrow,
|
|
4841
|
+
arrowRef,
|
|
4842
|
+
arrowX,
|
|
4843
|
+
arrowY,
|
|
4844
|
+
children,
|
|
4845
|
+
originX,
|
|
4846
|
+
originY,
|
|
4847
|
+
padding,
|
|
4848
|
+
placement,
|
|
4849
|
+
radius,
|
|
4850
|
+
scheme,
|
|
4851
|
+
shadow,
|
|
4852
|
+
style,
|
|
4853
|
+
...restProps
|
|
4854
|
+
} = props;
|
|
4855
|
+
const rootStyle = useMemo(() => ({
|
|
4856
|
+
originX,
|
|
4857
|
+
originY,
|
|
4858
|
+
...style
|
|
4859
|
+
}), [originX, originY, style]);
|
|
4860
|
+
const arrowStyle = useMemo(() => ({
|
|
4861
|
+
left: arrowX !== null ? arrowX : void 0,
|
|
4862
|
+
top: arrowY !== null ? arrowY : void 0,
|
|
4863
|
+
right: void 0,
|
|
4864
|
+
bottom: void 0
|
|
4865
|
+
}), [arrowX, arrowY]);
|
|
4866
|
+
return /* @__PURE__ */jsxs(MotionCard, {
|
|
4867
|
+
"data-ui": "Tooltip__card",
|
|
4868
|
+
...restProps,
|
|
4869
|
+
"data-placement": placement,
|
|
4870
|
+
padding,
|
|
4871
|
+
radius,
|
|
4872
|
+
ref,
|
|
4873
|
+
scheme,
|
|
4874
|
+
shadow,
|
|
4875
|
+
style: rootStyle,
|
|
4876
|
+
...(animate ? POPOVER_MOTION_PROPS : {}),
|
|
4877
|
+
children: [children, arrow && /* @__PURE__ */jsx(Arrow, {
|
|
4878
|
+
ref: arrowRef,
|
|
4879
|
+
style: arrowStyle,
|
|
4880
|
+
width: DEFAULT_TOOLTIP_ARROW_WIDTH,
|
|
4881
|
+
height: DEFAULT_TOOLTIP_ARROW_HEIGHT,
|
|
4882
|
+
radius: DEFAULT_TOOLTIP_ARROW_RADIUS
|
|
4883
|
+
})]
|
|
4884
|
+
});
|
|
4885
|
+
}));
|
|
4886
|
+
TooltipCard.displayName = "TooltipCard";
|
|
4724
4887
|
const key$4 = Symbol.for("@sanity/ui/context/tooltipDelayGroup");
|
|
4725
4888
|
globalScope[key$4] = globalScope[key$4] || createContext(null);
|
|
4726
4889
|
const TooltipDelayGroupContext = globalScope[key$4];
|
|
@@ -4757,26 +4920,27 @@ var __template$f = (cooked, raw) => __freeze$f(__defProp$f(cooked, "raw", {
|
|
|
4757
4920
|
value: __freeze$f(raw || cooked.slice())
|
|
4758
4921
|
}));
|
|
4759
4922
|
var _a$f;
|
|
4760
|
-
const Root$a = styled(Layer)(_a$f || (_a$f = __template$f(["\n pointer-events: none;\n max-width: ", "px;\n"])),
|
|
4923
|
+
const Root$a = styled(Layer)(_a$f || (_a$f = __template$f(["\n pointer-events: none;\n max-width: ", "px;\n"])), _ref7 => {
|
|
4761
4924
|
let {
|
|
4762
4925
|
$maxWidth
|
|
4763
|
-
} =
|
|
4926
|
+
} = _ref7;
|
|
4764
4927
|
return $maxWidth;
|
|
4765
4928
|
});
|
|
4766
4929
|
const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
4767
|
-
var _a2, _b, _c, _d, _e;
|
|
4930
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
4768
4931
|
const boundaryElementContext = useBoundaryElement();
|
|
4769
4932
|
const {
|
|
4770
4933
|
layer
|
|
4771
4934
|
} = useTheme_v2();
|
|
4772
4935
|
const {
|
|
4936
|
+
animate = false,
|
|
4773
4937
|
arrow: arrowProp = false,
|
|
4774
4938
|
boundaryElement = boundaryElementContext == null ? void 0 : boundaryElementContext.element,
|
|
4775
4939
|
children: childProp,
|
|
4776
4940
|
content,
|
|
4777
4941
|
disabled,
|
|
4778
4942
|
fallbackPlacements: fallbackPlacementsProp = (_b = props.fallbackPlacements) != null ? _b : DEFAULT_FALLBACK_PLACEMENTS[(_a2 = props.placement) != null ? _a2 : "bottom"],
|
|
4779
|
-
padding =
|
|
4943
|
+
padding = 2,
|
|
4780
4944
|
placement: placementProp = "bottom",
|
|
4781
4945
|
portal: portalProp,
|
|
4782
4946
|
radius = 2,
|
|
@@ -4784,7 +4948,6 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4784
4948
|
shadow = 2,
|
|
4785
4949
|
zOffset = layer.tooltip.zOffset,
|
|
4786
4950
|
delay,
|
|
4787
|
-
animate = false,
|
|
4788
4951
|
...restProps
|
|
4789
4952
|
} = props;
|
|
4790
4953
|
const fallbackPlacements = useArrayProp(fallbackPlacementsProp);
|
|
@@ -4820,8 +4983,11 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4820
4983
|
padding: DEFAULT_TOOLTIP_PADDING
|
|
4821
4984
|
}));
|
|
4822
4985
|
}
|
|
4986
|
+
if (animate) {
|
|
4987
|
+
ret.push(origin);
|
|
4988
|
+
}
|
|
4823
4989
|
return ret;
|
|
4824
|
-
}, [arrowProp, boundaryElement, fallbackPlacements]);
|
|
4990
|
+
}, [animate, arrowProp, boundaryElement, fallbackPlacements]);
|
|
4825
4991
|
const {
|
|
4826
4992
|
floatingStyles,
|
|
4827
4993
|
placement,
|
|
@@ -4835,12 +5001,8 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4835
5001
|
});
|
|
4836
5002
|
const arrowX = (_d = middlewareData.arrow) == null ? void 0 : _d.x;
|
|
4837
5003
|
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]);
|
|
5004
|
+
const originX = (_f = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _f.originX;
|
|
5005
|
+
const originY = (_g = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _g.originY;
|
|
4844
5006
|
const tooltipId = useId();
|
|
4845
5007
|
const [isOpen, setIsOpen] = useDelayedState(false);
|
|
4846
5008
|
const delayGroupContext = useTooltipDelayGroup();
|
|
@@ -4962,53 +5124,33 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4962
5124
|
}, [childProp, handleBlur, handleClick, handleContextMenu, handleFocus, handleMouseEnter, handleMouseLeave, setReference]);
|
|
4963
5125
|
if (!child) return /* @__PURE__ */jsx(Fragment, {});
|
|
4964
5126
|
if (disabled) return child;
|
|
4965
|
-
const
|
|
5127
|
+
const tooltip = /* @__PURE__ */jsx(Root$a, {
|
|
4966
5128
|
"data-ui": "Tooltip",
|
|
4967
5129
|
...restProps,
|
|
4968
5130
|
ref: setFloating,
|
|
4969
5131
|
style: floatingStyles,
|
|
4970
5132
|
zOffset,
|
|
4971
5133
|
$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
|
-
})
|
|
5134
|
+
children: /* @__PURE__ */jsx(TooltipCard, {
|
|
5135
|
+
...restProps,
|
|
5136
|
+
animate,
|
|
5137
|
+
arrow: arrowProp,
|
|
5138
|
+
arrowRef: setArrow,
|
|
5139
|
+
arrowX,
|
|
5140
|
+
arrowY,
|
|
5141
|
+
originX,
|
|
5142
|
+
originY,
|
|
5143
|
+
padding,
|
|
5144
|
+
placement,
|
|
5145
|
+
radius,
|
|
5146
|
+
ref: setFloating,
|
|
5147
|
+
scheme,
|
|
5148
|
+
shadow,
|
|
5149
|
+
children: content
|
|
5008
5150
|
})
|
|
5009
5151
|
});
|
|
5010
5152
|
return /* @__PURE__ */jsxs(Fragment, {
|
|
5011
|
-
children: [
|
|
5153
|
+
children: [/* @__PURE__ */jsx(ConditionalWrapper, {
|
|
5012
5154
|
condition: animate,
|
|
5013
5155
|
wrapper: children => /* @__PURE__ */jsx(AnimatePresence, {
|
|
5014
5156
|
children
|
|
@@ -5019,9 +5161,9 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
5019
5161
|
__unstable_name: typeof portalProp === "string" ? portalProp : void 0,
|
|
5020
5162
|
children
|
|
5021
5163
|
}),
|
|
5022
|
-
children:
|
|
5164
|
+
children: tooltip
|
|
5023
5165
|
})
|
|
5024
|
-
})]
|
|
5166
|
+
}), child]
|
|
5025
5167
|
});
|
|
5026
5168
|
});
|
|
5027
5169
|
var __freeze$e = Object.freeze;
|
|
@@ -5178,10 +5320,10 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
|
|
|
5178
5320
|
query,
|
|
5179
5321
|
value
|
|
5180
5322
|
} = state;
|
|
5181
|
-
const defaultRenderOption = useCallback(
|
|
5323
|
+
const defaultRenderOption = useCallback(_ref8 => {
|
|
5182
5324
|
let {
|
|
5183
5325
|
value: value2
|
|
5184
|
-
} =
|
|
5326
|
+
} = _ref8;
|
|
5185
5327
|
return /* @__PURE__ */jsx(Card, {
|
|
5186
5328
|
"data-as": "button",
|
|
5187
5329
|
padding: paddingProp,
|
|
@@ -5640,10 +5782,10 @@ var __template$c = (cooked, raw) => __freeze$c(__defProp$c(cooked, "raw", {
|
|
|
5640
5782
|
value: __freeze$c(raw || cooked.slice())
|
|
5641
5783
|
}));
|
|
5642
5784
|
var _a$c, _b$7;
|
|
5643
|
-
function dialogStyle(
|
|
5785
|
+
function dialogStyle(_ref9) {
|
|
5644
5786
|
let {
|
|
5645
5787
|
theme
|
|
5646
|
-
} =
|
|
5788
|
+
} = _ref9;
|
|
5647
5789
|
const {
|
|
5648
5790
|
color
|
|
5649
5791
|
} = getTheme_v2(theme);
|
|
@@ -6311,6 +6453,9 @@ const MenuButton = forwardRef(function MenuButton2(props, ref) {
|
|
|
6311
6453
|
setOpen(v => !v);
|
|
6312
6454
|
setShouldFocus(null);
|
|
6313
6455
|
}, []);
|
|
6456
|
+
const handleMouseDown = useCallback(event => {
|
|
6457
|
+
if (open) event.preventDefault();
|
|
6458
|
+
}, [open]);
|
|
6314
6459
|
const handleButtonKeyDown = useCallback(event => {
|
|
6315
6460
|
if (event.key === "ArrowDown" || event.key === "Enter" || event.key === " ") {
|
|
6316
6461
|
event.preventDefault();
|
|
@@ -6394,11 +6539,12 @@ const MenuButton = forwardRef(function MenuButton2(props, ref) {
|
|
|
6394
6539
|
id,
|
|
6395
6540
|
onClick: handleButtonClick,
|
|
6396
6541
|
onKeyDown: handleButtonKeyDown,
|
|
6542
|
+
onMouseDown: handleMouseDown,
|
|
6397
6543
|
"aria-haspopup": true,
|
|
6398
6544
|
"aria-expanded": open,
|
|
6399
6545
|
ref: setButtonRef,
|
|
6400
6546
|
selected: open
|
|
6401
|
-
}) : null, [buttonProp, handleButtonClick, handleButtonKeyDown, id, open, setButtonRef]);
|
|
6547
|
+
}) : null, [buttonProp, handleButtonClick, handleButtonKeyDown, handleMouseDown, id, open, setButtonRef]);
|
|
6402
6548
|
const popoverProps = useMemo(() => ({
|
|
6403
6549
|
boundaryElement: deprecated_boundaryElement,
|
|
6404
6550
|
overflow: "auto",
|
|
@@ -6713,15 +6859,15 @@ var __template$6 = (cooked, raw) => __freeze$6(__defProp$6(cooked, "raw", {
|
|
|
6713
6859
|
var _a$6, _b$3, _c$1, _d;
|
|
6714
6860
|
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
6861
|
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"])),
|
|
6862
|
+
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
6863
|
let {
|
|
6718
6864
|
$visible
|
|
6719
|
-
} =
|
|
6865
|
+
} = _ref10;
|
|
6720
6866
|
return $visible ? 1 : 0;
|
|
6721
|
-
},
|
|
6867
|
+
}, _ref11 => {
|
|
6722
6868
|
let {
|
|
6723
6869
|
$animated
|
|
6724
|
-
} =
|
|
6870
|
+
} = _ref11;
|
|
6725
6871
|
return $animated ? animation : css(_c$1 || (_c$1 = __template$6(["\n background-color: var(--card-skeleton-color-from);\n "])));
|
|
6726
6872
|
});
|
|
6727
6873
|
const Root$4 = styled(Box)(responsiveRadiusStyle, skeletonStyle);
|
|
@@ -7106,12 +7252,12 @@ function ToastProvider(props) {
|
|
|
7106
7252
|
paddingY,
|
|
7107
7253
|
children: /* @__PURE__ */jsx(AnimatePresence, {
|
|
7108
7254
|
initial: false,
|
|
7109
|
-
children: state.map(
|
|
7255
|
+
children: state.map(_ref12 => {
|
|
7110
7256
|
let {
|
|
7111
7257
|
dismiss,
|
|
7112
7258
|
id,
|
|
7113
7259
|
params
|
|
7114
|
-
} =
|
|
7260
|
+
} = _ref12;
|
|
7115
7261
|
return /* @__PURE__ */jsx(motion.div, {
|
|
7116
7262
|
animate: {
|
|
7117
7263
|
opacity: 1,
|
|
@@ -7605,5 +7751,5 @@ const TreeItem = memo(function TreeItem2(props) {
|
|
|
7605
7751
|
})]
|
|
7606
7752
|
});
|
|
7607
7753
|
});
|
|
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 };
|
|
7754
|
+
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
7755
|
//# sourceMappingURL=index.esm.js.map
|