@sanity/ui 2.0.0-beta.2 → 2.0.0-beta.21
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 +247 -267
- package/dist/index.esm.js +477 -326
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +486 -539
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs.mjs +1 -1
- package/dist/theme.d.ts +87 -115
- package/dist/theme.esm.js +348 -290
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +348 -290
- package/dist/theme.js.map +1 -1
- package/package.json +6 -3
- package/src/core/__workshop__/fontsPlugin.tsx +48 -8
- package/src/core/_compat.ts +236 -87
- package/src/core/components/dialog/dialog.tsx +1 -1
- package/src/core/components/dialog/styles.ts +2 -2
- package/src/core/components/menu/__workshop__/selectedItem.tsx +7 -2
- package/src/core/components/menu/menuButton.tsx +12 -1
- package/src/core/components/toast/toast.tsx +17 -2
- package/src/core/components/toast/toastProvider.tsx +20 -3
- package/src/core/constants.ts +37 -0
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +6 -3
- package/src/core/middleware/origin.ts +47 -0
- package/src/core/primitives/badge/badge.tsx +1 -3
- package/src/core/primitives/button/button.tsx +9 -11
- package/src/core/primitives/heading/styles.ts +4 -0
- 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 +31 -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 +46 -56
- package/src/core/primitives/tooltip/tooltipCard.tsx +110 -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/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 +279 -253
- package/src/theme/defaults/config.ts +2 -2
- package/src/theme/getScopedTheme.ts +1 -0
- 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 +11 -1
- 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/color.ts +0 -1
- 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/getTheme_v2.ts +2 -1
- package/src/theme/versioning/themeColor_v0_v2.ts +2 -2
- package/src/theme/versioning/v2_v0.ts +3 -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,44 @@ 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_CONTENT_OPACITY_PROPERTY = "--motion-content-opacity";
|
|
24
|
+
const POPOVER_MOTION_PROPS = {
|
|
25
|
+
initial: {
|
|
26
|
+
opacity: 0.5,
|
|
27
|
+
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: 0,
|
|
28
|
+
scale: 0.97,
|
|
29
|
+
willChange: "transform"
|
|
30
|
+
},
|
|
31
|
+
animate: {
|
|
32
|
+
opacity: [null, 1, 1],
|
|
33
|
+
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [null, null, 1],
|
|
34
|
+
scale: 1
|
|
35
|
+
},
|
|
36
|
+
exit: {
|
|
37
|
+
// @ts-expect-error -- passing null a second time is valid: https://github.com/framer/motion/blob/b9ce4c42914c3916ea523609c5b032dfc72718bb/packages/framer-motion/src/animation/utils/keyframes.ts#L34C22-L34C22
|
|
38
|
+
opacity: [null, null, 0],
|
|
39
|
+
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [null, 0, 0],
|
|
40
|
+
scale: 0.97
|
|
41
|
+
},
|
|
42
|
+
transition: {
|
|
43
|
+
duration: 0.4,
|
|
44
|
+
type: "spring"
|
|
45
|
+
}
|
|
46
|
+
};
|
|
14
47
|
function _fillCSSObject(keys, value) {
|
|
15
48
|
return keys.reduce((style, key) => {
|
|
16
49
|
style[key] = value;
|
|
@@ -1469,13 +1502,13 @@ function responsiveInputPaddingIconRightStyle(props) {
|
|
|
1469
1502
|
$iconRight: true
|
|
1470
1503
|
});
|
|
1471
1504
|
}
|
|
1472
|
-
var __freeze$
|
|
1473
|
-
var __defProp$
|
|
1474
|
-
var __template$
|
|
1475
|
-
value: __freeze$
|
|
1505
|
+
var __freeze$F = Object.freeze;
|
|
1506
|
+
var __defProp$G = Object.defineProperty;
|
|
1507
|
+
var __template$F = (cooked, raw) => __freeze$F(__defProp$G(cooked, "raw", {
|
|
1508
|
+
value: __freeze$F(raw || cooked.slice())
|
|
1476
1509
|
}));
|
|
1477
|
-
var _a$
|
|
1478
|
-
const ROOT_STYLE = css(_a$
|
|
1510
|
+
var _a$F, _b$n, _c$c;
|
|
1511
|
+
const ROOT_STYLE = css(_a$F || (_a$F = __template$F(["\n &:not([hidden]) {\n display: flex;\n }\n\n align-items: center;\n"])));
|
|
1479
1512
|
function textInputRootStyle() {
|
|
1480
1513
|
return ROOT_STYLE;
|
|
1481
1514
|
}
|
|
@@ -1489,7 +1522,7 @@ function textInputBaseStyle(props) {
|
|
|
1489
1522
|
color,
|
|
1490
1523
|
font
|
|
1491
1524
|
} = getTheme_v2(props.theme);
|
|
1492
|
-
return css(_b$n || (_b$n = __template$
|
|
1525
|
+
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
1526
|
}
|
|
1494
1527
|
function textInputFontSizeStyle(props) {
|
|
1495
1528
|
const {
|
|
@@ -1516,7 +1549,7 @@ function textInputRepresentationStyle(props) {
|
|
|
1516
1549
|
color,
|
|
1517
1550
|
input
|
|
1518
1551
|
} = getTheme_v2(props.theme);
|
|
1519
|
-
return css(_c$c || (_c$c = __template$
|
|
1552
|
+
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
1553
|
color: color.input.default.enabled.border,
|
|
1521
1554
|
width: input.border.width
|
|
1522
1555
|
}), color.input.invalid.enabled.bg, color.input.invalid.enabled.fg, focusRingBorderStyle({
|
|
@@ -1530,12 +1563,18 @@ function textInputRepresentationStyle(props) {
|
|
|
1530
1563
|
focusRing: input.text.focusRing
|
|
1531
1564
|
}), $unstableDisableFocusRing ? void 0 : focusRingStyle({
|
|
1532
1565
|
focusRing: input.text.focusRing
|
|
1533
|
-
}), color.input.default.disabled.bg, color.input.default.disabled.fg, focusRingBorderStyle({
|
|
1566
|
+
}), color.input.default.disabled.bg, color.input.default.disabled.fg, color.input.default.disabled.fg, focusRingBorderStyle({
|
|
1534
1567
|
color: color.input.default.disabled.border,
|
|
1535
1568
|
width: input.border.width
|
|
1536
|
-
}), color.input.
|
|
1569
|
+
}), color.input.invalid.disabled.bg, color.input.invalid.disabled.fg, color.input.invalid.disabled.fg, focusRingBorderStyle({
|
|
1570
|
+
color: color.input.invalid.disabled.border,
|
|
1571
|
+
width: input.border.width
|
|
1572
|
+
}), 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
1573
|
color: color.input.default.hovered.border,
|
|
1538
1574
|
width: input.border.width
|
|
1575
|
+
}), focusRingBorderStyle({
|
|
1576
|
+
color: color.input.invalid.hovered.border,
|
|
1577
|
+
width: input.border.width
|
|
1539
1578
|
}));
|
|
1540
1579
|
}
|
|
1541
1580
|
function responsiveMarginStyle(props) {
|
|
@@ -1590,12 +1629,12 @@ function responsiveShadowStyle(props) {
|
|
|
1590
1629
|
} = getTheme_v2(props.theme);
|
|
1591
1630
|
return _responsive(media, props.$shadow, index => shadowStyle(shadow[index], card.shadow.outline));
|
|
1592
1631
|
}
|
|
1593
|
-
var __freeze$
|
|
1594
|
-
var __defProp$
|
|
1595
|
-
var __template$
|
|
1596
|
-
value: __freeze$
|
|
1632
|
+
var __freeze$E = Object.freeze;
|
|
1633
|
+
var __defProp$F = Object.defineProperty;
|
|
1634
|
+
var __template$E = (cooked, raw) => __freeze$E(__defProp$F(cooked, "raw", {
|
|
1635
|
+
value: __freeze$E(raw || cooked.slice())
|
|
1597
1636
|
}));
|
|
1598
|
-
var _a$
|
|
1637
|
+
var _a$E, _b$m, _c$b;
|
|
1599
1638
|
function labelBaseStyle(props) {
|
|
1600
1639
|
const {
|
|
1601
1640
|
$accent,
|
|
@@ -1604,16 +1643,16 @@ function labelBaseStyle(props) {
|
|
|
1604
1643
|
const {
|
|
1605
1644
|
font
|
|
1606
1645
|
} = getTheme_v2(props.theme);
|
|
1607
|
-
return css(_c$b || (_c$b = __template$
|
|
1646
|
+
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
1647
|
}
|
|
1609
|
-
var __freeze$
|
|
1610
|
-
var __defProp$
|
|
1611
|
-
var __template$
|
|
1612
|
-
value: __freeze$
|
|
1648
|
+
var __freeze$D = Object.freeze;
|
|
1649
|
+
var __defProp$E = Object.defineProperty;
|
|
1650
|
+
var __template$D = (cooked, raw) => __freeze$D(__defProp$E(cooked, "raw", {
|
|
1651
|
+
value: __freeze$D(raw || cooked.slice())
|
|
1613
1652
|
}));
|
|
1614
|
-
var _a$
|
|
1615
|
-
const Root$
|
|
1616
|
-
const SpanWithTextOverflow$2 = styled.span(_a$
|
|
1653
|
+
var _a$D;
|
|
1654
|
+
const Root$C = styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle);
|
|
1655
|
+
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
1656
|
const Label = forwardRef(function Label2(props, ref) {
|
|
1618
1657
|
const {
|
|
1619
1658
|
accent,
|
|
@@ -1635,7 +1674,7 @@ const Label = forwardRef(function Label2(props, ref) {
|
|
|
1635
1674
|
children
|
|
1636
1675
|
});
|
|
1637
1676
|
}
|
|
1638
|
-
return /* @__PURE__ */jsx(Root$
|
|
1677
|
+
return /* @__PURE__ */jsx(Root$C, {
|
|
1639
1678
|
"data-ui": "Label",
|
|
1640
1679
|
...restProps,
|
|
1641
1680
|
$accent: accent,
|
|
@@ -1794,7 +1833,7 @@ function avatarStrokeStyle() {
|
|
|
1794
1833
|
}
|
|
1795
1834
|
};
|
|
1796
1835
|
}
|
|
1797
|
-
const Root$
|
|
1836
|
+
const Root$B = styled.div(responsiveAvatarSizeStyle, avatarStyle.root);
|
|
1798
1837
|
const Arrow$1 = styled.div(avatarStyle.arrow);
|
|
1799
1838
|
const BgStroke = styled.ellipse(avatarStyle.bgStroke);
|
|
1800
1839
|
const Stroke = styled.ellipse(avatarStyle.stroke);
|
|
@@ -1850,7 +1889,7 @@ const Avatar = forwardRef(function Avatar2(props, ref) {
|
|
|
1850
1889
|
if (s === 3) return 5;
|
|
1851
1890
|
return 0;
|
|
1852
1891
|
}), [size]);
|
|
1853
|
-
return /* @__PURE__ */jsxs(Root$
|
|
1892
|
+
return /* @__PURE__ */jsxs(Root$B, {
|
|
1854
1893
|
as,
|
|
1855
1894
|
"data-as": typeof as === "string" ? as : void 0,
|
|
1856
1895
|
"data-ui": "Avatar",
|
|
@@ -1919,12 +1958,12 @@ const Avatar = forwardRef(function Avatar2(props, ref) {
|
|
|
1919
1958
|
})]
|
|
1920
1959
|
});
|
|
1921
1960
|
});
|
|
1922
|
-
var __freeze$
|
|
1923
|
-
var __defProp$
|
|
1924
|
-
var __template$
|
|
1925
|
-
value: __freeze$
|
|
1961
|
+
var __freeze$C = Object.freeze;
|
|
1962
|
+
var __defProp$D = Object.defineProperty;
|
|
1963
|
+
var __template$C = (cooked, raw) => __freeze$C(__defProp$D(cooked, "raw", {
|
|
1964
|
+
value: __freeze$C(raw || cooked.slice())
|
|
1926
1965
|
}));
|
|
1927
|
-
var _a$
|
|
1966
|
+
var _a$C;
|
|
1928
1967
|
function _responsiveAvatarCounterSizeStyle(props) {
|
|
1929
1968
|
const {
|
|
1930
1969
|
avatar,
|
|
@@ -1944,9 +1983,9 @@ function _avatarCounterBaseStyle(props) {
|
|
|
1944
1983
|
const {
|
|
1945
1984
|
space
|
|
1946
1985
|
} = getTheme_v2(props.theme);
|
|
1947
|
-
return css(_a$
|
|
1986
|
+
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]));
|
|
1948
1987
|
}
|
|
1949
|
-
const Root$
|
|
1988
|
+
const Root$A = styled.div(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle);
|
|
1950
1989
|
const AvatarCounter = forwardRef(function AvatarCounter2(props, ref) {
|
|
1951
1990
|
const {
|
|
1952
1991
|
count,
|
|
@@ -1959,7 +1998,7 @@ const AvatarCounter = forwardRef(function AvatarCounter2(props, ref) {
|
|
|
1959
1998
|
if (s === 3) return 5;
|
|
1960
1999
|
return 0;
|
|
1961
2000
|
}), [size]);
|
|
1962
|
-
return /* @__PURE__ */jsx(Root$
|
|
2001
|
+
return /* @__PURE__ */jsx(Root$A, {
|
|
1963
2002
|
$size: size,
|
|
1964
2003
|
"data-ui": "AvatarCounter",
|
|
1965
2004
|
ref,
|
|
@@ -1975,13 +2014,13 @@ function childrenToElementArray(children) {
|
|
|
1975
2014
|
const childrenArray = Array.isArray(children) ? children : [children];
|
|
1976
2015
|
return childrenArray.filter(node => isElement$1(node) || isFragment(node) || typeof node === "string");
|
|
1977
2016
|
}
|
|
1978
|
-
var __freeze$
|
|
1979
|
-
var __defProp$
|
|
1980
|
-
var __template$
|
|
1981
|
-
value: __freeze$
|
|
2017
|
+
var __freeze$B = Object.freeze;
|
|
2018
|
+
var __defProp$C = Object.defineProperty;
|
|
2019
|
+
var __template$B = (cooked, raw) => __freeze$B(__defProp$C(cooked, "raw", {
|
|
2020
|
+
value: __freeze$B(raw || cooked.slice())
|
|
1982
2021
|
}));
|
|
1983
|
-
var _a$
|
|
1984
|
-
const BASE_STYLES = css(_a$
|
|
2022
|
+
var _a$B;
|
|
2023
|
+
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"])));
|
|
1985
2024
|
function avatarStackStyle() {
|
|
1986
2025
|
return BASE_STYLES;
|
|
1987
2026
|
}
|
|
@@ -2000,7 +2039,7 @@ function responsiveAvatarStackSizeStyle(props) {
|
|
|
2000
2039
|
};
|
|
2001
2040
|
});
|
|
2002
2041
|
}
|
|
2003
|
-
const Root$
|
|
2042
|
+
const Root$z = styled.div(responsiveAvatarStackSizeStyle, avatarStackStyle);
|
|
2004
2043
|
const AvatarStack = forwardRef(function AvatarStack2(props, ref) {
|
|
2005
2044
|
const {
|
|
2006
2045
|
children: childrenProp,
|
|
@@ -2015,7 +2054,7 @@ const AvatarStack = forwardRef(function AvatarStack2(props, ref) {
|
|
|
2015
2054
|
const visibleCount = maxLength - 1;
|
|
2016
2055
|
const extraCount = len - visibleCount;
|
|
2017
2056
|
const visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children;
|
|
2018
|
-
return /* @__PURE__ */jsxs(Root$
|
|
2057
|
+
return /* @__PURE__ */jsxs(Root$z, {
|
|
2019
2058
|
"data-ui": "AvatarStack",
|
|
2020
2059
|
...restProps,
|
|
2021
2060
|
ref,
|
|
@@ -2037,7 +2076,7 @@ const AvatarStack = forwardRef(function AvatarStack2(props, ref) {
|
|
|
2037
2076
|
}, String(childIndex)))]
|
|
2038
2077
|
});
|
|
2039
2078
|
});
|
|
2040
|
-
const Root$
|
|
2079
|
+
const Root$y = styled.div(boxStyle, flexItemStyle, responsiveBoxStyle, responsiveGridItemStyle, responsiveMarginStyle, responsivePaddingStyle);
|
|
2041
2080
|
const Box = forwardRef(function Box2(props, ref) {
|
|
2042
2081
|
const {
|
|
2043
2082
|
as: asProp = "div",
|
|
@@ -2068,7 +2107,7 @@ const Box = forwardRef(function Box2(props, ref) {
|
|
|
2068
2107
|
sizing,
|
|
2069
2108
|
...restProps
|
|
2070
2109
|
} = props;
|
|
2071
|
-
return /* @__PURE__ */jsx(Root$
|
|
2110
|
+
return /* @__PURE__ */jsx(Root$y, {
|
|
2072
2111
|
"data-as": typeof asProp === "string" ? asProp : void 0,
|
|
2073
2112
|
"data-ui": "Box",
|
|
2074
2113
|
...restProps,
|
|
@@ -2102,12 +2141,12 @@ const Box = forwardRef(function Box2(props, ref) {
|
|
|
2102
2141
|
children: props.children
|
|
2103
2142
|
});
|
|
2104
2143
|
});
|
|
2105
|
-
var __freeze$
|
|
2106
|
-
var __defProp$
|
|
2107
|
-
var __template$
|
|
2108
|
-
value: __freeze$
|
|
2144
|
+
var __freeze$A = Object.freeze;
|
|
2145
|
+
var __defProp$B = Object.defineProperty;
|
|
2146
|
+
var __template$A = (cooked, raw) => __freeze$A(__defProp$B(cooked, "raw", {
|
|
2147
|
+
value: __freeze$A(raw || cooked.slice())
|
|
2109
2148
|
}));
|
|
2110
|
-
var _a$
|
|
2149
|
+
var _a$A, _b$l, _c$a;
|
|
2111
2150
|
function textBaseStyle(props) {
|
|
2112
2151
|
const {
|
|
2113
2152
|
$accent,
|
|
@@ -2116,16 +2155,16 @@ function textBaseStyle(props) {
|
|
|
2116
2155
|
const {
|
|
2117
2156
|
font
|
|
2118
2157
|
} = getTheme_v2(props.theme);
|
|
2119
|
-
return css(_c$a || (_c$a = __template$
|
|
2158
|
+
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);
|
|
2120
2159
|
}
|
|
2121
|
-
var __freeze$
|
|
2122
|
-
var __defProp$
|
|
2123
|
-
var __template$
|
|
2124
|
-
value: __freeze$
|
|
2160
|
+
var __freeze$z = Object.freeze;
|
|
2161
|
+
var __defProp$A = Object.defineProperty;
|
|
2162
|
+
var __template$z = (cooked, raw) => __freeze$z(__defProp$A(cooked, "raw", {
|
|
2163
|
+
value: __freeze$z(raw || cooked.slice())
|
|
2125
2164
|
}));
|
|
2126
|
-
var _a$
|
|
2127
|
-
const Root$
|
|
2128
|
-
const SpanWithTextOverflow$1 = styled.span(_a$
|
|
2165
|
+
var _a$z;
|
|
2166
|
+
const Root$x = styled.div(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle);
|
|
2167
|
+
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"])));
|
|
2129
2168
|
const Text = forwardRef(function Text2(props, ref) {
|
|
2130
2169
|
const {
|
|
2131
2170
|
accent = false,
|
|
@@ -2143,7 +2182,7 @@ const Text = forwardRef(function Text2(props, ref) {
|
|
|
2143
2182
|
children
|
|
2144
2183
|
});
|
|
2145
2184
|
}
|
|
2146
|
-
return /* @__PURE__ */jsx(Root$
|
|
2185
|
+
return /* @__PURE__ */jsx(Root$x, {
|
|
2147
2186
|
"data-ui": "Text",
|
|
2148
2187
|
...restProps,
|
|
2149
2188
|
$accent: accent,
|
|
@@ -2172,7 +2211,7 @@ function badgeStyle(props) {
|
|
|
2172
2211
|
}
|
|
2173
2212
|
};
|
|
2174
2213
|
}
|
|
2175
|
-
const Root$
|
|
2214
|
+
const Root$w = styled(Box)(responsiveRadiusStyle, badgeStyle);
|
|
2176
2215
|
const Badge = forwardRef(function Badge2(props, ref) {
|
|
2177
2216
|
const {
|
|
2178
2217
|
children,
|
|
@@ -2184,7 +2223,7 @@ const Badge = forwardRef(function Badge2(props, ref) {
|
|
|
2184
2223
|
tone = "default",
|
|
2185
2224
|
...restProps
|
|
2186
2225
|
} = props;
|
|
2187
|
-
return /* @__PURE__ */jsx(Root$
|
|
2226
|
+
return /* @__PURE__ */jsx(Root$w, {
|
|
2188
2227
|
"data-ui": "Badge",
|
|
2189
2228
|
...restProps,
|
|
2190
2229
|
$tone: tone,
|
|
@@ -2193,12 +2232,11 @@ const Badge = forwardRef(function Badge2(props, ref) {
|
|
|
2193
2232
|
ref,
|
|
2194
2233
|
children: /* @__PURE__ */jsx(Text, {
|
|
2195
2234
|
size: fontSize,
|
|
2196
|
-
weight: "medium",
|
|
2197
2235
|
children
|
|
2198
2236
|
})
|
|
2199
2237
|
});
|
|
2200
2238
|
});
|
|
2201
|
-
const Root$
|
|
2239
|
+
const Root$v = styled(Box)(flexItemStyle, responsiveFlexStyle);
|
|
2202
2240
|
const Flex = forwardRef(function Flex2(props, ref) {
|
|
2203
2241
|
const {
|
|
2204
2242
|
align,
|
|
@@ -2209,7 +2247,7 @@ const Flex = forwardRef(function Flex2(props, ref) {
|
|
|
2209
2247
|
wrap,
|
|
2210
2248
|
...restProps
|
|
2211
2249
|
} = props;
|
|
2212
|
-
return /* @__PURE__ */jsx(Root$
|
|
2250
|
+
return /* @__PURE__ */jsx(Root$v, {
|
|
2213
2251
|
"data-ui": "Flex",
|
|
2214
2252
|
...restProps,
|
|
2215
2253
|
$align: useArrayProp(align),
|
|
@@ -2221,16 +2259,16 @@ const Flex = forwardRef(function Flex2(props, ref) {
|
|
|
2221
2259
|
ref
|
|
2222
2260
|
});
|
|
2223
2261
|
});
|
|
2224
|
-
var __freeze$
|
|
2225
|
-
var __defProp$
|
|
2226
|
-
var __template$
|
|
2227
|
-
value: __freeze$
|
|
2262
|
+
var __freeze$y = Object.freeze;
|
|
2263
|
+
var __defProp$z = Object.defineProperty;
|
|
2264
|
+
var __template$y = (cooked, raw) => __freeze$y(__defProp$z(cooked, "raw", {
|
|
2265
|
+
value: __freeze$y(raw || cooked.slice())
|
|
2228
2266
|
}));
|
|
2229
|
-
var _a$
|
|
2230
|
-
const rotate$1 = keyframes(_a$
|
|
2231
|
-
const Root$
|
|
2267
|
+
var _a$y, _b$k;
|
|
2268
|
+
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"])));
|
|
2269
|
+
const Root$u = styled(Text)(_b$k || (_b$k = __template$y(["\n & > span > svg {\n animation: ", " 500ms linear infinite;\n }\n"])), rotate$1);
|
|
2232
2270
|
const Spinner = forwardRef(function Spinner2(props, ref) {
|
|
2233
|
-
return /* @__PURE__ */jsx(Root$
|
|
2271
|
+
return /* @__PURE__ */jsx(Root$u, {
|
|
2234
2272
|
"data-ui": "Spinner",
|
|
2235
2273
|
...props,
|
|
2236
2274
|
ref,
|
|
@@ -2241,6 +2279,7 @@ function _cardColorStyle(base, color) {
|
|
|
2241
2279
|
let checkered = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
2242
2280
|
return {
|
|
2243
2281
|
// from base
|
|
2282
|
+
"--card-backdrop-color": base.backdrop,
|
|
2244
2283
|
"--card-focus-ring-color": base.focusRing,
|
|
2245
2284
|
"--card-shadow-outline-color": base.shadow.outline,
|
|
2246
2285
|
"--card-shadow-umbra-color": base.shadow.umbra,
|
|
@@ -2308,12 +2347,12 @@ function _cardColorStyle(base, color) {
|
|
|
2308
2347
|
"--card-hairline-hard-color": color.border
|
|
2309
2348
|
};
|
|
2310
2349
|
}
|
|
2311
|
-
var __freeze$
|
|
2312
|
-
var __defProp$
|
|
2313
|
-
var __template$
|
|
2314
|
-
value: __freeze$
|
|
2350
|
+
var __freeze$x = Object.freeze;
|
|
2351
|
+
var __defProp$y = Object.defineProperty;
|
|
2352
|
+
var __template$x = (cooked, raw) => __freeze$x(__defProp$y(cooked, "raw", {
|
|
2353
|
+
value: __freeze$x(raw || cooked.slice())
|
|
2315
2354
|
}));
|
|
2316
|
-
var _a$
|
|
2355
|
+
var _a$x, _b$j;
|
|
2317
2356
|
function buttonBaseStyles(props) {
|
|
2318
2357
|
const {
|
|
2319
2358
|
$width
|
|
@@ -2321,7 +2360,7 @@ function buttonBaseStyles(props) {
|
|
|
2321
2360
|
const {
|
|
2322
2361
|
style
|
|
2323
2362
|
} = getTheme_v2(props.theme);
|
|
2324
|
-
return css(_b$j || (_b$j = __template$
|
|
2363
|
+
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 "]))));
|
|
2325
2364
|
}
|
|
2326
2365
|
function combineBoxShadow() {
|
|
2327
2366
|
for (var _len = arguments.length, boxShadows = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -2376,14 +2415,14 @@ function buttonColorStyles(props) {
|
|
|
2376
2415
|
}
|
|
2377
2416
|
}, (_a2 = style == null ? void 0 : style.button) == null ? void 0 : _a2.root].filter(Boolean);
|
|
2378
2417
|
}
|
|
2379
|
-
var __freeze$
|
|
2380
|
-
var __defProp$
|
|
2381
|
-
var __template$
|
|
2382
|
-
value: __freeze$
|
|
2418
|
+
var __freeze$w = Object.freeze;
|
|
2419
|
+
var __defProp$x = Object.defineProperty;
|
|
2420
|
+
var __template$w = (cooked, raw) => __freeze$w(__defProp$x(cooked, "raw", {
|
|
2421
|
+
value: __freeze$w(raw || cooked.slice())
|
|
2383
2422
|
}));
|
|
2384
|
-
var _a$
|
|
2385
|
-
const Root$
|
|
2386
|
-
const LoadingBox = styled.div(_a$
|
|
2423
|
+
var _a$w;
|
|
2424
|
+
const Root$t = styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles);
|
|
2425
|
+
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"])));
|
|
2387
2426
|
const Button = forwardRef(function Button2(props, ref) {
|
|
2388
2427
|
const {
|
|
2389
2428
|
children,
|
|
@@ -2435,7 +2474,7 @@ const Button = forwardRef(function Button2(props, ref) {
|
|
|
2435
2474
|
paddingLeft,
|
|
2436
2475
|
paddingRight
|
|
2437
2476
|
}), [padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight]);
|
|
2438
|
-
return /* @__PURE__ */jsxs(Root$
|
|
2477
|
+
return /* @__PURE__ */jsxs(Root$t, {
|
|
2439
2478
|
"data-ui": "Button",
|
|
2440
2479
|
...restProps,
|
|
2441
2480
|
$mode: mode,
|
|
@@ -2459,16 +2498,13 @@ const Button = forwardRef(function Button2(props, ref) {
|
|
|
2459
2498
|
children: [icon && /* @__PURE__ */jsxs(Text, {
|
|
2460
2499
|
size: fontSize,
|
|
2461
2500
|
children: [isValidElement(icon) && icon, isValidElementType(icon) && createElement(icon)]
|
|
2462
|
-
}), text && /* @__PURE__ */jsx(
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
weight: button.textWeight,
|
|
2470
|
-
children: text
|
|
2471
|
-
})
|
|
2501
|
+
}), text && /* @__PURE__ */jsx(Text, {
|
|
2502
|
+
muted,
|
|
2503
|
+
align: textAlign,
|
|
2504
|
+
size: fontSize,
|
|
2505
|
+
textOverflow: "ellipsis",
|
|
2506
|
+
weight: button.textWeight,
|
|
2507
|
+
children: text
|
|
2472
2508
|
}), iconRight && /* @__PURE__ */jsxs(Text, {
|
|
2473
2509
|
size: fontSize,
|
|
2474
2510
|
children: [isValidElement(iconRight) && iconRight, isValidElementType(iconRight) && createElement(iconRight)]
|
|
@@ -2481,12 +2517,12 @@ const Button = forwardRef(function Button2(props, ref) {
|
|
|
2481
2517
|
})]
|
|
2482
2518
|
});
|
|
2483
2519
|
});
|
|
2484
|
-
var __freeze$
|
|
2485
|
-
var __defProp$
|
|
2486
|
-
var __template$
|
|
2487
|
-
value: __freeze$
|
|
2520
|
+
var __freeze$v = Object.freeze;
|
|
2521
|
+
var __defProp$w = Object.defineProperty;
|
|
2522
|
+
var __template$v = (cooked, raw) => __freeze$v(__defProp$w(cooked, "raw", {
|
|
2523
|
+
value: __freeze$v(raw || cooked.slice())
|
|
2488
2524
|
}));
|
|
2489
|
-
var _a$
|
|
2525
|
+
var _a$v, _b$i, _c$9;
|
|
2490
2526
|
function cardStyle(props) {
|
|
2491
2527
|
return [cardBaseStyle(props), cardColorStyle(props)];
|
|
2492
2528
|
}
|
|
@@ -2497,7 +2533,7 @@ function cardBaseStyle(props) {
|
|
|
2497
2533
|
const {
|
|
2498
2534
|
space
|
|
2499
2535
|
} = getTheme_v2(props.theme);
|
|
2500
|
-
return css(_b$i || (_b$i = __template$
|
|
2536
|
+
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]));
|
|
2501
2537
|
}
|
|
2502
2538
|
function cardColorStyle(props) {
|
|
2503
2539
|
var _a2;
|
|
@@ -2514,7 +2550,7 @@ function cardColorStyle(props) {
|
|
|
2514
2550
|
width: card.border.width,
|
|
2515
2551
|
color: "var(--card-border-color)"
|
|
2516
2552
|
};
|
|
2517
|
-
return css(_c$9 || (_c$9 = __template$
|
|
2553
|
+
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({
|
|
2518
2554
|
base: color,
|
|
2519
2555
|
border,
|
|
2520
2556
|
focusRing: card.focusRing
|
|
@@ -2524,7 +2560,7 @@ function cardColorStyle(props) {
|
|
|
2524
2560
|
focusRing: card.focusRing
|
|
2525
2561
|
}) : void 0, (_a2 = style == null ? void 0 : style.card) == null ? void 0 : _a2.root);
|
|
2526
2562
|
}
|
|
2527
|
-
const Root$
|
|
2563
|
+
const Root$s = styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle);
|
|
2528
2564
|
const Card = forwardRef(function Card2(props, ref) {
|
|
2529
2565
|
const {
|
|
2530
2566
|
__unstable_checkered: checkered = false,
|
|
@@ -2549,7 +2585,7 @@ const Card = forwardRef(function Card2(props, ref) {
|
|
|
2549
2585
|
return /* @__PURE__ */jsx(ThemeColorProvider, {
|
|
2550
2586
|
scheme,
|
|
2551
2587
|
tone,
|
|
2552
|
-
children: /* @__PURE__ */jsx(Root$
|
|
2588
|
+
children: /* @__PURE__ */jsx(Root$s, {
|
|
2553
2589
|
"data-as": typeof as === "string" ? as : void 0,
|
|
2554
2590
|
"data-scheme": rootTheme.scheme,
|
|
2555
2591
|
"data-ui": "Card",
|
|
@@ -2574,14 +2610,14 @@ const Card = forwardRef(function Card2(props, ref) {
|
|
|
2574
2610
|
})
|
|
2575
2611
|
});
|
|
2576
2612
|
});
|
|
2577
|
-
var __freeze$
|
|
2578
|
-
var __defProp$
|
|
2579
|
-
var __template$
|
|
2580
|
-
value: __freeze$
|
|
2613
|
+
var __freeze$u = Object.freeze;
|
|
2614
|
+
var __defProp$v = Object.defineProperty;
|
|
2615
|
+
var __template$u = (cooked, raw) => __freeze$u(__defProp$v(cooked, "raw", {
|
|
2616
|
+
value: __freeze$u(raw || cooked.slice())
|
|
2581
2617
|
}));
|
|
2582
|
-
var _a$
|
|
2618
|
+
var _a$u, _b$h;
|
|
2583
2619
|
function checkboxBaseStyles() {
|
|
2584
|
-
return css(_a$
|
|
2620
|
+
return css(_a$u || (_a$u = __template$u(["\n position: relative;\n display: inline-block;\n "])));
|
|
2585
2621
|
}
|
|
2586
2622
|
function inputElementStyles(props) {
|
|
2587
2623
|
const {
|
|
@@ -2592,7 +2628,7 @@ function inputElementStyles(props) {
|
|
|
2592
2628
|
const {
|
|
2593
2629
|
focusRing
|
|
2594
2630
|
} = input.checkbox;
|
|
2595
|
-
return css(_b$h || (_b$h = __template$
|
|
2631
|
+
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({
|
|
2596
2632
|
color: color.input.default.enabled.border,
|
|
2597
2633
|
width: input.border.width
|
|
2598
2634
|
}), rem(radius[2]), color.input.default.enabled.bg, color.input.default.enabled.fg, focusRingBorderStyle({
|
|
@@ -2625,7 +2661,7 @@ function inputElementStyles(props) {
|
|
|
2625
2661
|
color: color.input.default.readOnly.border
|
|
2626
2662
|
}), color.input.default.readOnly.fg, color.input.default.readOnly.muted.bg);
|
|
2627
2663
|
}
|
|
2628
|
-
const Root$
|
|
2664
|
+
const Root$r = styled.div(checkboxBaseStyles);
|
|
2629
2665
|
const Input$5 = styled.input(inputElementStyles);
|
|
2630
2666
|
const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
|
|
2631
2667
|
const {
|
|
@@ -2645,7 +2681,7 @@ const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
|
|
|
2645
2681
|
ref.current.indeterminate = indeterminate || false;
|
|
2646
2682
|
}
|
|
2647
2683
|
}, [indeterminate, ref]);
|
|
2648
|
-
return /* @__PURE__ */jsxs(Root$
|
|
2684
|
+
return /* @__PURE__ */jsxs(Root$r, {
|
|
2649
2685
|
className,
|
|
2650
2686
|
"data-ui": "Checkbox",
|
|
2651
2687
|
style,
|
|
@@ -2663,12 +2699,12 @@ const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
|
|
|
2663
2699
|
})]
|
|
2664
2700
|
});
|
|
2665
2701
|
});
|
|
2666
|
-
var __freeze$
|
|
2667
|
-
var __defProp$
|
|
2668
|
-
var __template$
|
|
2669
|
-
value: __freeze$
|
|
2702
|
+
var __freeze$t = Object.freeze;
|
|
2703
|
+
var __defProp$u = Object.defineProperty;
|
|
2704
|
+
var __template$t = (cooked, raw) => __freeze$t(__defProp$u(cooked, "raw", {
|
|
2705
|
+
value: __freeze$t(raw || cooked.slice())
|
|
2670
2706
|
}));
|
|
2671
|
-
var _a$
|
|
2707
|
+
var _a$t;
|
|
2672
2708
|
function codeSyntaxHighlightingStyle(_ref2) {
|
|
2673
2709
|
let {
|
|
2674
2710
|
theme
|
|
@@ -2790,9 +2826,9 @@ function codeSyntaxHighlightingStyle(_ref2) {
|
|
|
2790
2826
|
};
|
|
2791
2827
|
}
|
|
2792
2828
|
function codeBaseStyle() {
|
|
2793
|
-
return css(_a$
|
|
2829
|
+
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);
|
|
2794
2830
|
}
|
|
2795
|
-
const Root$
|
|
2831
|
+
const Root$q = styled.pre(codeBaseStyle, responsiveCodeFontStyle);
|
|
2796
2832
|
const Code = forwardRef(function Code2(props, ref) {
|
|
2797
2833
|
const {
|
|
2798
2834
|
children,
|
|
@@ -2803,7 +2839,7 @@ const Code = forwardRef(function Code2(props, ref) {
|
|
|
2803
2839
|
} = props;
|
|
2804
2840
|
const language = typeof languageProp === "string" ? languageProp : void 0;
|
|
2805
2841
|
const registered = language ? Refractor.hasLanguage(language) : false;
|
|
2806
|
-
return /* @__PURE__ */jsxs(Root$
|
|
2842
|
+
return /* @__PURE__ */jsxs(Root$q, {
|
|
2807
2843
|
"data-ui": "Code",
|
|
2808
2844
|
...restProps,
|
|
2809
2845
|
$size: useArrayProp(size),
|
|
@@ -2834,14 +2870,14 @@ function responsiveContainerWidthStyle(props) {
|
|
|
2834
2870
|
maxWidth: val === "auto" ? "none" : rem(container[val])
|
|
2835
2871
|
}));
|
|
2836
2872
|
}
|
|
2837
|
-
const Root$
|
|
2873
|
+
const Root$p = styled(Box)(containerBaseStyle, responsiveContainerWidthStyle);
|
|
2838
2874
|
const Container = forwardRef(function Container2(props, ref) {
|
|
2839
2875
|
const {
|
|
2840
2876
|
as,
|
|
2841
2877
|
width = 2,
|
|
2842
2878
|
...restProps
|
|
2843
2879
|
} = props;
|
|
2844
|
-
return /* @__PURE__ */jsx(Root$
|
|
2880
|
+
return /* @__PURE__ */jsx(Root$p, {
|
|
2845
2881
|
"data-ui": "Container",
|
|
2846
2882
|
...restProps,
|
|
2847
2883
|
$width: useArrayProp(width),
|
|
@@ -2849,7 +2885,7 @@ const Container = forwardRef(function Container2(props, ref) {
|
|
|
2849
2885
|
ref
|
|
2850
2886
|
});
|
|
2851
2887
|
});
|
|
2852
|
-
const Root$
|
|
2888
|
+
const Root$o = styled(Box)(responsiveGridStyle);
|
|
2853
2889
|
const Grid = forwardRef(function Grid2(props, ref) {
|
|
2854
2890
|
const {
|
|
2855
2891
|
as,
|
|
@@ -2864,7 +2900,7 @@ const Grid = forwardRef(function Grid2(props, ref) {
|
|
|
2864
2900
|
children,
|
|
2865
2901
|
...restProps
|
|
2866
2902
|
} = props;
|
|
2867
|
-
return /* @__PURE__ */jsx(Root$
|
|
2903
|
+
return /* @__PURE__ */jsx(Root$o, {
|
|
2868
2904
|
"data-as": typeof as === "string" ? as : void 0,
|
|
2869
2905
|
"data-ui": "Grid",
|
|
2870
2906
|
...restProps,
|
|
@@ -2881,12 +2917,12 @@ const Grid = forwardRef(function Grid2(props, ref) {
|
|
|
2881
2917
|
children
|
|
2882
2918
|
});
|
|
2883
2919
|
});
|
|
2884
|
-
var __freeze$
|
|
2885
|
-
var __defProp$
|
|
2886
|
-
var __template$
|
|
2887
|
-
value: __freeze$
|
|
2920
|
+
var __freeze$s = Object.freeze;
|
|
2921
|
+
var __defProp$t = Object.defineProperty;
|
|
2922
|
+
var __template$s = (cooked, raw) => __freeze$s(__defProp$t(cooked, "raw", {
|
|
2923
|
+
value: __freeze$s(raw || cooked.slice())
|
|
2888
2924
|
}));
|
|
2889
|
-
var _a$
|
|
2925
|
+
var _a$s, _b$g, _c$8;
|
|
2890
2926
|
function headingBaseStyle(props) {
|
|
2891
2927
|
const {
|
|
2892
2928
|
$accent,
|
|
@@ -2895,16 +2931,16 @@ function headingBaseStyle(props) {
|
|
|
2895
2931
|
const {
|
|
2896
2932
|
font
|
|
2897
2933
|
} = getTheme_v2(props.theme);
|
|
2898
|
-
return css(_c$8 || (_c$8 = __template$
|
|
2934
|
+
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 & 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 }\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, font.heading.weights.bold);
|
|
2899
2935
|
}
|
|
2900
|
-
var __freeze$
|
|
2901
|
-
var __defProp$
|
|
2902
|
-
var __template$
|
|
2903
|
-
value: __freeze$
|
|
2936
|
+
var __freeze$r = Object.freeze;
|
|
2937
|
+
var __defProp$s = Object.defineProperty;
|
|
2938
|
+
var __template$r = (cooked, raw) => __freeze$r(__defProp$s(cooked, "raw", {
|
|
2939
|
+
value: __freeze$r(raw || cooked.slice())
|
|
2904
2940
|
}));
|
|
2905
|
-
var _a$
|
|
2906
|
-
const Root$
|
|
2907
|
-
const SpanWithTextOverflow = styled.span(_a$
|
|
2941
|
+
var _a$r;
|
|
2942
|
+
const Root$n = styled.div(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont);
|
|
2943
|
+
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"])));
|
|
2908
2944
|
const Heading = forwardRef(function Heading2(props, ref) {
|
|
2909
2945
|
const {
|
|
2910
2946
|
accent = false,
|
|
@@ -2922,7 +2958,7 @@ const Heading = forwardRef(function Heading2(props, ref) {
|
|
|
2922
2958
|
children
|
|
2923
2959
|
});
|
|
2924
2960
|
}
|
|
2925
|
-
return /* @__PURE__ */jsx(Root$
|
|
2961
|
+
return /* @__PURE__ */jsx(Root$n, {
|
|
2926
2962
|
"data-ui": "Heading",
|
|
2927
2963
|
...restProps,
|
|
2928
2964
|
$accent: accent,
|
|
@@ -2963,7 +2999,7 @@ function inlineSpaceStyle(props) {
|
|
|
2963
2999
|
};
|
|
2964
3000
|
});
|
|
2965
3001
|
}
|
|
2966
|
-
const Root$
|
|
3002
|
+
const Root$m = styled(Box)(inlineBaseStyle, inlineSpaceStyle);
|
|
2967
3003
|
const Inline = forwardRef(function Inline2(props, ref) {
|
|
2968
3004
|
const {
|
|
2969
3005
|
as,
|
|
@@ -2974,7 +3010,7 @@ const Inline = forwardRef(function Inline2(props, ref) {
|
|
|
2974
3010
|
const children = useMemo(() => childrenToElementArray(childrenProp).filter(Boolean).map((child, idx) => /* @__PURE__ */jsx("div", {
|
|
2975
3011
|
children: child
|
|
2976
3012
|
}, idx)), [childrenProp]);
|
|
2977
|
-
return /* @__PURE__ */jsx(Root$
|
|
3013
|
+
return /* @__PURE__ */jsx(Root$m, {
|
|
2978
3014
|
"data-ui": "Inline",
|
|
2979
3015
|
...restProps,
|
|
2980
3016
|
$space: useArrayProp(space),
|
|
@@ -2983,16 +3019,16 @@ const Inline = forwardRef(function Inline2(props, ref) {
|
|
|
2983
3019
|
children
|
|
2984
3020
|
});
|
|
2985
3021
|
});
|
|
2986
|
-
var __freeze$
|
|
2987
|
-
var __defProp$
|
|
2988
|
-
var __template$
|
|
2989
|
-
value: __freeze$
|
|
3022
|
+
var __freeze$q = Object.freeze;
|
|
3023
|
+
var __defProp$r = Object.defineProperty;
|
|
3024
|
+
var __template$q = (cooked, raw) => __freeze$q(__defProp$r(cooked, "raw", {
|
|
3025
|
+
value: __freeze$q(raw || cooked.slice())
|
|
2990
3026
|
}));
|
|
2991
|
-
var _a$
|
|
3027
|
+
var _a$q;
|
|
2992
3028
|
function kbdStyle() {
|
|
2993
|
-
return css(_a$
|
|
3029
|
+
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 "])));
|
|
2994
3030
|
}
|
|
2995
|
-
const Root$
|
|
3031
|
+
const Root$l = styled.kbd(responsiveRadiusStyle, kbdStyle);
|
|
2996
3032
|
const KBD = forwardRef(function KBD2(props, ref) {
|
|
2997
3033
|
const {
|
|
2998
3034
|
children,
|
|
@@ -3001,7 +3037,7 @@ const KBD = forwardRef(function KBD2(props, ref) {
|
|
|
3001
3037
|
radius = 2,
|
|
3002
3038
|
...restProps
|
|
3003
3039
|
} = props;
|
|
3004
|
-
return /* @__PURE__ */jsx(Root$
|
|
3040
|
+
return /* @__PURE__ */jsx(Root$l, {
|
|
3005
3041
|
"data-ui": "KBD",
|
|
3006
3042
|
...restProps,
|
|
3007
3043
|
$radius: useArrayProp(radius),
|
|
@@ -3018,6 +3054,45 @@ const KBD = forwardRef(function KBD2(props, ref) {
|
|
|
3018
3054
|
})
|
|
3019
3055
|
});
|
|
3020
3056
|
});
|
|
3057
|
+
const origin = {
|
|
3058
|
+
name: "@sanity/ui/origin",
|
|
3059
|
+
fn(_ref3) {
|
|
3060
|
+
let {
|
|
3061
|
+
middlewareData,
|
|
3062
|
+
placement,
|
|
3063
|
+
rects
|
|
3064
|
+
} = _ref3;
|
|
3065
|
+
var _a, _b;
|
|
3066
|
+
const [side] = placement.split("-");
|
|
3067
|
+
const floatingWidth = rects.floating.width;
|
|
3068
|
+
const floatingHeight = rects.floating.height;
|
|
3069
|
+
const shiftX = ((_a = middlewareData.shift) == null ? void 0 : _a.x) || 0;
|
|
3070
|
+
const shiftY = ((_b = middlewareData.shift) == null ? void 0 : _b.y) || 0;
|
|
3071
|
+
if (floatingWidth <= 0 || floatingHeight <= 0) {
|
|
3072
|
+
return {};
|
|
3073
|
+
}
|
|
3074
|
+
const isVerticalPlacement = ["bottom", "top"].includes(side);
|
|
3075
|
+
const {
|
|
3076
|
+
originX,
|
|
3077
|
+
originY
|
|
3078
|
+
} = isVerticalPlacement ? {
|
|
3079
|
+
originX: clamp(0.5 - shiftX / floatingWidth, 0, 1),
|
|
3080
|
+
originY: side === "bottom" ? 0 : 1
|
|
3081
|
+
} : {
|
|
3082
|
+
originX: side === "left" ? 1 : 0,
|
|
3083
|
+
originY: clamp(0.5 - shiftY / floatingHeight, 0, 1)
|
|
3084
|
+
};
|
|
3085
|
+
return {
|
|
3086
|
+
data: {
|
|
3087
|
+
originX,
|
|
3088
|
+
originY
|
|
3089
|
+
}
|
|
3090
|
+
};
|
|
3091
|
+
}
|
|
3092
|
+
};
|
|
3093
|
+
function clamp(num, min, max) {
|
|
3094
|
+
return Math.min(Math.max(num, min), max);
|
|
3095
|
+
}
|
|
3021
3096
|
function moveTowardsLength(movingPoint, targetPoint, amount) {
|
|
3022
3097
|
const width = targetPoint.x - movingPoint.x;
|
|
3023
3098
|
const height = targetPoint.y - movingPoint.y;
|
|
@@ -3072,20 +3147,20 @@ function compileCommands(cmds) {
|
|
|
3072
3147
|
return "";
|
|
3073
3148
|
}).join(" ");
|
|
3074
3149
|
}
|
|
3075
|
-
var __freeze$
|
|
3076
|
-
var __defProp$
|
|
3077
|
-
var __template$
|
|
3078
|
-
value: __freeze$
|
|
3150
|
+
var __freeze$p = Object.freeze;
|
|
3151
|
+
var __defProp$q = Object.defineProperty;
|
|
3152
|
+
var __template$p = (cooked, raw) => __freeze$p(__defProp$q(cooked, "raw", {
|
|
3153
|
+
value: __freeze$p(raw || cooked.slice())
|
|
3079
3154
|
}));
|
|
3080
|
-
var _a$
|
|
3081
|
-
const Root$
|
|
3155
|
+
var _a$p, _b$f, _c$7;
|
|
3156
|
+
const Root$k = styled.div(_ref4 => {
|
|
3082
3157
|
let {
|
|
3083
3158
|
$w: w
|
|
3084
|
-
} =
|
|
3085
|
-
return css(_a$
|
|
3159
|
+
} = _ref4;
|
|
3160
|
+
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);
|
|
3086
3161
|
});
|
|
3087
|
-
const StrokePath = styled.path(_b$f || (_b$f = __template$
|
|
3088
|
-
const ShapePath = styled.path(_c$7 || (_c$7 = __template$
|
|
3162
|
+
const StrokePath = styled.path(_b$f || (_b$f = __template$p(["\n stroke: var(--card-shadow-outline-color);\n"])));
|
|
3163
|
+
const ShapePath = styled.path(_c$7 || (_c$7 = __template$p(["\n fill: var(--card-bg-color);\n"])));
|
|
3089
3164
|
const Arrow = forwardRef(function Arrow2(props, ref) {
|
|
3090
3165
|
const {
|
|
3091
3166
|
width: w,
|
|
@@ -3121,7 +3196,7 @@ const Arrow = forwardRef(function Arrow2(props, ref) {
|
|
|
3121
3196
|
const path = compileCommands(cmds);
|
|
3122
3197
|
const strokePath = "".concat(path);
|
|
3123
3198
|
const fillPath = "".concat(path, " M ").concat(w, " -1 M 0 -1 Z");
|
|
3124
|
-
return /* @__PURE__ */jsx(Root$
|
|
3199
|
+
return /* @__PURE__ */jsx(Root$k, {
|
|
3125
3200
|
...restProps,
|
|
3126
3201
|
$w: w,
|
|
3127
3202
|
ref,
|
|
@@ -3179,6 +3254,17 @@ function useBoundaryElement() {
|
|
|
3179
3254
|
}
|
|
3180
3255
|
return value || DEFAULT_VALUE;
|
|
3181
3256
|
}
|
|
3257
|
+
function ConditionalWrapper(_ref5) {
|
|
3258
|
+
let {
|
|
3259
|
+
children,
|
|
3260
|
+
condition,
|
|
3261
|
+
wrapper
|
|
3262
|
+
} = _ref5;
|
|
3263
|
+
if (!condition) {
|
|
3264
|
+
return children;
|
|
3265
|
+
}
|
|
3266
|
+
return wrapper(children);
|
|
3267
|
+
}
|
|
3182
3268
|
function findMaxBreakpoints(media, width) {
|
|
3183
3269
|
const ret = [];
|
|
3184
3270
|
for (let i = 0; i < media.length; i += 1) {
|
|
@@ -3228,8 +3314,8 @@ const ElementQuery = forwardRef(function ElementQuery2(props, ref) {
|
|
|
3228
3314
|
children
|
|
3229
3315
|
});
|
|
3230
3316
|
});
|
|
3231
|
-
var __defProp$
|
|
3232
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp$
|
|
3317
|
+
var __defProp$p = Object.defineProperty;
|
|
3318
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp$p(obj, key, {
|
|
3233
3319
|
enumerable: true,
|
|
3234
3320
|
configurable: true,
|
|
3235
3321
|
writable: true,
|
|
@@ -3458,7 +3544,7 @@ function LayerProvider(props) {
|
|
|
3458
3544
|
children
|
|
3459
3545
|
});
|
|
3460
3546
|
}
|
|
3461
|
-
const Root$
|
|
3547
|
+
const Root$j = styled.div({
|
|
3462
3548
|
position: "relative"
|
|
3463
3549
|
});
|
|
3464
3550
|
const LayerChildren = forwardRef(function LayerChildren2(props, ref) {
|
|
@@ -3494,7 +3580,7 @@ const LayerChildren = forwardRef(function LayerChildren2(props, ref) {
|
|
|
3494
3580
|
lastFocusedRef.current = target;
|
|
3495
3581
|
}
|
|
3496
3582
|
}, [forwardedRef, isTopLayer, onFocus]);
|
|
3497
|
-
return /* @__PURE__ */jsx(Root$
|
|
3583
|
+
return /* @__PURE__ */jsx(Root$j, {
|
|
3498
3584
|
...restProps,
|
|
3499
3585
|
"data-ui": "Layer",
|
|
3500
3586
|
onFocus: handleFocus,
|
|
@@ -3605,19 +3691,19 @@ function PortalProvider(props) {
|
|
|
3605
3691
|
children
|
|
3606
3692
|
});
|
|
3607
3693
|
}
|
|
3608
|
-
var __freeze$
|
|
3609
|
-
var __defProp$
|
|
3610
|
-
var __template$
|
|
3611
|
-
value: __freeze$
|
|
3694
|
+
var __freeze$o = Object.freeze;
|
|
3695
|
+
var __defProp$o = Object.defineProperty;
|
|
3696
|
+
var __template$o = (cooked, raw) => __freeze$o(__defProp$o(cooked, "raw", {
|
|
3697
|
+
value: __freeze$o(raw || cooked.slice())
|
|
3612
3698
|
}));
|
|
3613
|
-
var _a$
|
|
3614
|
-
const Root$
|
|
3699
|
+
var _a$o;
|
|
3700
|
+
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"])));
|
|
3615
3701
|
const SrOnly = forwardRef(function SrOnly2(props, ref) {
|
|
3616
3702
|
const {
|
|
3617
3703
|
as,
|
|
3618
3704
|
children
|
|
3619
3705
|
} = props;
|
|
3620
|
-
return /* @__PURE__ */jsx(Root$
|
|
3706
|
+
return /* @__PURE__ */jsx(Root$i, {
|
|
3621
3707
|
"aria-hidden": true,
|
|
3622
3708
|
as,
|
|
3623
3709
|
"data-ui": "SrOnly",
|
|
@@ -3625,14 +3711,14 @@ const SrOnly = forwardRef(function SrOnly2(props, ref) {
|
|
|
3625
3711
|
children
|
|
3626
3712
|
});
|
|
3627
3713
|
});
|
|
3628
|
-
var __freeze$
|
|
3629
|
-
var __defProp$
|
|
3630
|
-
var __template$
|
|
3631
|
-
value: __freeze$
|
|
3714
|
+
var __freeze$n = Object.freeze;
|
|
3715
|
+
var __defProp$n = Object.defineProperty;
|
|
3716
|
+
var __template$n = (cooked, raw) => __freeze$n(__defProp$n(cooked, "raw", {
|
|
3717
|
+
value: __freeze$n(raw || cooked.slice())
|
|
3632
3718
|
}));
|
|
3633
|
-
var _a$
|
|
3634
|
-
const Root$
|
|
3635
|
-
const ItemWrapper = styled.div(_b$e || (_b$e = __template$
|
|
3719
|
+
var _a$n, _b$e;
|
|
3720
|
+
const Root$h = styled.div(_a$n || (_a$n = __template$n(["\n position: relative;\n"])));
|
|
3721
|
+
const ItemWrapper = styled.div(_b$e || (_b$e = __template$n(["\n position: absolute;\n left: 0;\n right: 0;\n"])));
|
|
3636
3722
|
const VirtualList = forwardRef(function VirtualList2(props, ref) {
|
|
3637
3723
|
const {
|
|
3638
3724
|
as = "div",
|
|
@@ -3738,7 +3824,7 @@ const VirtualList = forwardRef(function VirtualList2(props, ref) {
|
|
|
3738
3824
|
const wrapperStyle = useMemo(() => ({
|
|
3739
3825
|
height
|
|
3740
3826
|
}), [height]);
|
|
3741
|
-
return /* @__PURE__ */jsx(Root$
|
|
3827
|
+
return /* @__PURE__ */jsx(Root$h, {
|
|
3742
3828
|
as,
|
|
3743
3829
|
"data-ui": "VirtualList",
|
|
3744
3830
|
...restProps,
|
|
@@ -3856,17 +3942,17 @@ function calcMaxWidth(params) {
|
|
|
3856
3942
|
}
|
|
3857
3943
|
return Math.min(currentWidth != null ? currentWidth : Infinity, (boundaryWidth || Infinity) - DEFAULT_POPOVER_PADDING * 2);
|
|
3858
3944
|
}
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
});
|
|
3945
|
+
var __freeze$m = Object.freeze;
|
|
3946
|
+
var __defProp$m = Object.defineProperty;
|
|
3947
|
+
var __template$m = (cooked, raw) => __freeze$m(__defProp$m(cooked, "raw", {
|
|
3948
|
+
value: __freeze$m(raw || cooked.slice())
|
|
3949
|
+
}));
|
|
3950
|
+
var _a$m;
|
|
3951
|
+
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 & > * {\n opacity: var(", ", 1);\n will-change: opacity;\n }\n"])), POPOVER_MOTION_CONTENT_OPACITY_PROPERTY);
|
|
3867
3952
|
const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
3868
3953
|
const {
|
|
3869
3954
|
__unstable_margins: marginsProp,
|
|
3955
|
+
animate,
|
|
3870
3956
|
arrow,
|
|
3871
3957
|
arrowRef,
|
|
3872
3958
|
arrowX,
|
|
@@ -3874,6 +3960,8 @@ const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
|
3874
3960
|
children,
|
|
3875
3961
|
padding,
|
|
3876
3962
|
placement,
|
|
3963
|
+
originX,
|
|
3964
|
+
originY,
|
|
3877
3965
|
overflow,
|
|
3878
3966
|
radius,
|
|
3879
3967
|
scheme,
|
|
@@ -3893,20 +3981,23 @@ const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
|
3893
3981
|
const x = (xProp != null ? xProp : 0) + margins[3];
|
|
3894
3982
|
const y = (yProp != null ? yProp : 0) + margins[0];
|
|
3895
3983
|
const rootStyle = useMemo(() => ({
|
|
3984
|
+
left: x,
|
|
3985
|
+
originX,
|
|
3986
|
+
originY,
|
|
3896
3987
|
position: strategy,
|
|
3897
3988
|
top: y,
|
|
3898
|
-
left: x,
|
|
3899
3989
|
width,
|
|
3900
3990
|
zIndex,
|
|
3991
|
+
willChange: animate ? "transform" : void 0,
|
|
3901
3992
|
...style
|
|
3902
|
-
}), [strategy, style, width, x, y, zIndex]);
|
|
3993
|
+
}), [animate, originX, originY, strategy, style, width, x, y, zIndex]);
|
|
3903
3994
|
const arrowStyle = useMemo(() => ({
|
|
3904
3995
|
left: arrowX !== null ? arrowX : void 0,
|
|
3905
3996
|
top: arrowY !== null ? arrowY : void 0,
|
|
3906
3997
|
right: void 0,
|
|
3907
3998
|
bottom: void 0
|
|
3908
3999
|
}), [arrowX, arrowY]);
|
|
3909
|
-
return /* @__PURE__ */jsxs(
|
|
4000
|
+
return /* @__PURE__ */jsxs(MotionCard$1, {
|
|
3910
4001
|
"data-ui": "Popover",
|
|
3911
4002
|
...restProps,
|
|
3912
4003
|
"data-placement": placement,
|
|
@@ -3917,6 +4008,7 @@ const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
|
3917
4008
|
sizing: "border",
|
|
3918
4009
|
style: rootStyle,
|
|
3919
4010
|
tone,
|
|
4011
|
+
...(animate ? POPOVER_MOTION_PROPS : {}),
|
|
3920
4012
|
children: [/* @__PURE__ */jsx(Flex, {
|
|
3921
4013
|
"data-ui": "Popover__wrapper",
|
|
3922
4014
|
direction: "column",
|
|
@@ -3939,7 +4031,7 @@ const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
|
3939
4031
|
}));
|
|
3940
4032
|
PopoverCard.displayName = "PopoverCard";
|
|
3941
4033
|
const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
3942
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4034
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
3943
4035
|
const {
|
|
3944
4036
|
container,
|
|
3945
4037
|
layer
|
|
@@ -3947,6 +4039,7 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
3947
4039
|
const boundaryElementContext = useBoundaryElement();
|
|
3948
4040
|
const {
|
|
3949
4041
|
__unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
|
|
4042
|
+
animate = false,
|
|
3950
4043
|
arrow: arrowProp = false,
|
|
3951
4044
|
boundaryElement = boundaryElementContext.element,
|
|
3952
4045
|
children: childProp,
|
|
@@ -4034,13 +4127,13 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4034
4127
|
}));
|
|
4035
4128
|
if (constrainSize || matchReferenceWidth) {
|
|
4036
4129
|
ret.push(size({
|
|
4037
|
-
apply(
|
|
4130
|
+
apply(_ref6) {
|
|
4038
4131
|
let {
|
|
4039
4132
|
availableWidth,
|
|
4040
4133
|
availableHeight,
|
|
4041
4134
|
elements,
|
|
4042
4135
|
referenceWidth
|
|
4043
|
-
} =
|
|
4136
|
+
} = _ref6;
|
|
4044
4137
|
referenceWidthRef.current = referenceWidth;
|
|
4045
4138
|
const _currentWidth = widthRef.current;
|
|
4046
4139
|
const _maxWidth = maxWidthRef.current;
|
|
@@ -4074,13 +4167,16 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4074
4167
|
padding: DEFAULT_POPOVER_PADDING
|
|
4075
4168
|
}));
|
|
4076
4169
|
}
|
|
4170
|
+
if (animate) {
|
|
4171
|
+
ret.push(origin);
|
|
4172
|
+
}
|
|
4077
4173
|
ret.push(hide({
|
|
4078
4174
|
boundary: referenceBoundary || void 0,
|
|
4079
4175
|
padding: DEFAULT_POPOVER_PADDING,
|
|
4080
4176
|
strategy: "referenceHidden"
|
|
4081
4177
|
}));
|
|
4082
4178
|
return ret;
|
|
4083
|
-
}, [arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]);
|
|
4179
|
+
}, [animate, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]);
|
|
4084
4180
|
const {
|
|
4085
4181
|
x,
|
|
4086
4182
|
y,
|
|
@@ -4097,6 +4193,8 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4097
4193
|
const referenceHidden = (_f = middlewareData.hide) == null ? void 0 : _f.referenceHidden;
|
|
4098
4194
|
const arrowX = (_g = middlewareData.arrow) == null ? void 0 : _g.x;
|
|
4099
4195
|
const arrowY = (_h = middlewareData.arrow) == null ? void 0 : _h.y;
|
|
4196
|
+
const originX = (_i = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _i.originX;
|
|
4197
|
+
const originY = (_j = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _j.originY;
|
|
4100
4198
|
const setArrow = useCallback(arrowEl => {
|
|
4101
4199
|
arrowRef.current = arrowEl;
|
|
4102
4200
|
}, []);
|
|
@@ -4139,6 +4237,7 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4139
4237
|
children: /* @__PURE__ */jsx(PopoverCard, {
|
|
4140
4238
|
...restProps,
|
|
4141
4239
|
__unstable_margins: margins,
|
|
4240
|
+
animate,
|
|
4142
4241
|
arrow: arrowProp,
|
|
4143
4242
|
arrowRef: setArrow,
|
|
4144
4243
|
arrowX,
|
|
@@ -4151,6 +4250,8 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4151
4250
|
ref: setFloating,
|
|
4152
4251
|
scheme,
|
|
4153
4252
|
shadow,
|
|
4253
|
+
originX,
|
|
4254
|
+
originY,
|
|
4154
4255
|
strategy,
|
|
4155
4256
|
tone,
|
|
4156
4257
|
width: matchReferenceWidth ? referenceWidthRef.current : width,
|
|
@@ -4160,23 +4261,31 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
4160
4261
|
})
|
|
4161
4262
|
});
|
|
4162
4263
|
return /* @__PURE__ */jsxs(Fragment, {
|
|
4163
|
-
children: [
|
|
4164
|
-
|
|
4165
|
-
|
|
4264
|
+
children: [/* @__PURE__ */jsx(ConditionalWrapper, {
|
|
4265
|
+
condition: animate,
|
|
4266
|
+
wrapper: children => /* @__PURE__ */jsx(AnimatePresence, {
|
|
4267
|
+
children
|
|
4268
|
+
}),
|
|
4269
|
+
children: open && /* @__PURE__ */jsx(ConditionalWrapper, {
|
|
4270
|
+
condition: !!portal,
|
|
4271
|
+
wrapper: children => /* @__PURE__ */jsx(Portal, {
|
|
4272
|
+
__unstable_name: typeof portal === "string" ? portal : void 0,
|
|
4273
|
+
children
|
|
4274
|
+
}),
|
|
4166
4275
|
children: popover
|
|
4167
|
-
})
|
|
4276
|
+
})
|
|
4168
4277
|
}), child]
|
|
4169
4278
|
});
|
|
4170
4279
|
}));
|
|
4171
4280
|
Popover.displayName = "Popover";
|
|
4172
|
-
var __freeze$
|
|
4173
|
-
var __defProp$
|
|
4174
|
-
var __template$
|
|
4175
|
-
value: __freeze$
|
|
4281
|
+
var __freeze$l = Object.freeze;
|
|
4282
|
+
var __defProp$l = Object.defineProperty;
|
|
4283
|
+
var __template$l = (cooked, raw) => __freeze$l(__defProp$l(cooked, "raw", {
|
|
4284
|
+
value: __freeze$l(raw || cooked.slice())
|
|
4176
4285
|
}));
|
|
4177
|
-
var _a$
|
|
4286
|
+
var _a$l, _b$d;
|
|
4178
4287
|
function radioBaseStyle() {
|
|
4179
|
-
return css(_a$
|
|
4288
|
+
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 "])));
|
|
4180
4289
|
}
|
|
4181
4290
|
function inputElementStyle(props) {
|
|
4182
4291
|
const {
|
|
@@ -4184,7 +4293,7 @@ function inputElementStyle(props) {
|
|
|
4184
4293
|
input
|
|
4185
4294
|
} = getTheme_v2(props.theme);
|
|
4186
4295
|
const dist = (input.radio.size - input.radio.markSize) / 2;
|
|
4187
|
-
return css(_b$d || (_b$d = __template$
|
|
4296
|
+
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({
|
|
4188
4297
|
color: color.input.default.enabled.border,
|
|
4189
4298
|
width: input.border.width
|
|
4190
4299
|
}), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.input.default.enabled.fg, focusRingStyle({
|
|
@@ -4229,27 +4338,27 @@ const Radio = forwardRef(function Radio2(props, forwardedRef) {
|
|
|
4229
4338
|
}), /* @__PURE__ */jsx("span", {})]
|
|
4230
4339
|
});
|
|
4231
4340
|
});
|
|
4232
|
-
var __freeze$
|
|
4233
|
-
var __defProp$
|
|
4234
|
-
var __template$
|
|
4235
|
-
value: __freeze$
|
|
4341
|
+
var __freeze$k = Object.freeze;
|
|
4342
|
+
var __defProp$k = Object.defineProperty;
|
|
4343
|
+
var __template$k = (cooked, raw) => __freeze$k(__defProp$k(cooked, "raw", {
|
|
4344
|
+
value: __freeze$k(raw || cooked.slice())
|
|
4236
4345
|
}));
|
|
4237
|
-
var _a$
|
|
4346
|
+
var _a$k, _b$c, _c$6, _d$5;
|
|
4238
4347
|
function rootStyle() {
|
|
4239
|
-
return css(_a$
|
|
4348
|
+
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 "])));
|
|
4240
4349
|
}
|
|
4241
4350
|
function inputBaseStyle(props) {
|
|
4242
4351
|
const {
|
|
4243
4352
|
font
|
|
4244
4353
|
} = getTheme_v2(props.theme);
|
|
4245
|
-
return css(_b$c || (_b$c = __template$
|
|
4354
|
+
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);
|
|
4246
4355
|
}
|
|
4247
4356
|
function inputColorStyle(props) {
|
|
4248
4357
|
const {
|
|
4249
4358
|
color,
|
|
4250
4359
|
input
|
|
4251
4360
|
} = getTheme_v2(props.theme);
|
|
4252
|
-
return css(_c$6 || (_c$6 = __template$
|
|
4361
|
+
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({
|
|
4253
4362
|
color: color.input.default.enabled.border,
|
|
4254
4363
|
width: input.border.width
|
|
4255
4364
|
}), color.input.default.hovered.bg, color.input.default.hovered.fg, focusRingBorderStyle({
|
|
@@ -4292,7 +4401,7 @@ function iconBoxStyle(props) {
|
|
|
4292
4401
|
const {
|
|
4293
4402
|
color
|
|
4294
4403
|
} = getTheme_v2(props.theme);
|
|
4295
|
-
return css(_d$5 || (_d$5 = __template$
|
|
4404
|
+
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);
|
|
4296
4405
|
}
|
|
4297
4406
|
const selectStyle = {
|
|
4298
4407
|
root: rootStyle,
|
|
@@ -4309,7 +4418,7 @@ const Select = forwardRef(function Select2(props, forwardedRef) {
|
|
|
4309
4418
|
disabled,
|
|
4310
4419
|
fontSize = 2,
|
|
4311
4420
|
padding = 3,
|
|
4312
|
-
radius =
|
|
4421
|
+
radius = 2,
|
|
4313
4422
|
readOnly,
|
|
4314
4423
|
space = 3,
|
|
4315
4424
|
...restProps
|
|
@@ -4376,32 +4485,32 @@ const Stack = forwardRef(function Stack2(props, ref) {
|
|
|
4376
4485
|
ref
|
|
4377
4486
|
});
|
|
4378
4487
|
});
|
|
4379
|
-
var __freeze$
|
|
4380
|
-
var __defProp$
|
|
4381
|
-
var __template$
|
|
4382
|
-
value: __freeze$
|
|
4488
|
+
var __freeze$j = Object.freeze;
|
|
4489
|
+
var __defProp$j = Object.defineProperty;
|
|
4490
|
+
var __template$j = (cooked, raw) => __freeze$j(__defProp$j(cooked, "raw", {
|
|
4491
|
+
value: __freeze$j(raw || cooked.slice())
|
|
4383
4492
|
}));
|
|
4384
|
-
var _a$
|
|
4493
|
+
var _a$j, _b$b, _c$5, _d$4, _e$2, _f$2, _g;
|
|
4385
4494
|
function switchBaseStyles() {
|
|
4386
|
-
return css(_a$
|
|
4495
|
+
return css(_a$j || (_a$j = __template$j(["\n position: relative;\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
|
|
4387
4496
|
}
|
|
4388
4497
|
function switchInputStyles() {
|
|
4389
|
-
return css(_b$b || (_b$b = __template$
|
|
4498
|
+
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 "])));
|
|
4390
4499
|
}
|
|
4391
4500
|
function switchRepresentationStyles(props) {
|
|
4392
4501
|
const {
|
|
4393
4502
|
color,
|
|
4394
4503
|
input
|
|
4395
4504
|
} = getTheme_v2(props.theme);
|
|
4396
|
-
return css(_c$5 || (_c$5 = __template$
|
|
4505
|
+
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({
|
|
4397
4506
|
focusRing: input.switch.focusRing
|
|
4398
|
-
}), 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);
|
|
4507
|
+
}), 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);
|
|
4399
4508
|
}
|
|
4400
4509
|
function switchTrackStyles(props) {
|
|
4401
4510
|
const {
|
|
4402
4511
|
input
|
|
4403
4512
|
} = getTheme_v2(props.theme);
|
|
4404
|
-
return css(_d$4 || (_d$4 = __template$
|
|
4513
|
+
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));
|
|
4405
4514
|
}
|
|
4406
4515
|
function switchThumbStyles(props) {
|
|
4407
4516
|
const {
|
|
@@ -4417,7 +4526,7 @@ function switchThumbStyles(props) {
|
|
|
4417
4526
|
const checkedOffset = trackWidth - trackPadding * 2 - size;
|
|
4418
4527
|
const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding;
|
|
4419
4528
|
const checked = $indeterminate !== true && props.$checked === true;
|
|
4420
|
-
return css(_g || (_g = __template$
|
|
4529
|
+
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));
|
|
4421
4530
|
}
|
|
4422
4531
|
const Root$d = styled.span(switchBaseStyles);
|
|
4423
4532
|
const Input$2 = styled.input(switchInputStyles);
|
|
@@ -4461,14 +4570,14 @@ const Switch = forwardRef(function Switch2(props, forwardedRef) {
|
|
|
4461
4570
|
})]
|
|
4462
4571
|
});
|
|
4463
4572
|
});
|
|
4464
|
-
var __freeze$
|
|
4465
|
-
var __defProp$
|
|
4466
|
-
var __template$
|
|
4467
|
-
value: __freeze$
|
|
4573
|
+
var __freeze$i = Object.freeze;
|
|
4574
|
+
var __defProp$i = Object.defineProperty;
|
|
4575
|
+
var __template$i = (cooked, raw) => __freeze$i(__defProp$i(cooked, "raw", {
|
|
4576
|
+
value: __freeze$i(raw || cooked.slice())
|
|
4468
4577
|
}));
|
|
4469
|
-
var _a$
|
|
4578
|
+
var _a$i;
|
|
4470
4579
|
const Root$c = styled.span(textInputRootStyle);
|
|
4471
|
-
const InputRoot$1 = styled.span(_a$
|
|
4580
|
+
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"])));
|
|
4472
4581
|
const Input$1 = styled.textarea(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle);
|
|
4473
4582
|
const Presentation$1 = styled.div(responsiveRadiusStyle, textInputRepresentationStyle);
|
|
4474
4583
|
const TextArea = forwardRef(function TextArea2(props, forwardedRef) {
|
|
@@ -4512,30 +4621,30 @@ const TextArea = forwardRef(function TextArea2(props, forwardedRef) {
|
|
|
4512
4621
|
})
|
|
4513
4622
|
});
|
|
4514
4623
|
});
|
|
4515
|
-
var __freeze$
|
|
4516
|
-
var __defProp$
|
|
4517
|
-
var __template$
|
|
4518
|
-
value: __freeze$
|
|
4624
|
+
var __freeze$h = Object.freeze;
|
|
4625
|
+
var __defProp$h = Object.defineProperty;
|
|
4626
|
+
var __template$h = (cooked, raw) => __freeze$h(__defProp$h(cooked, "raw", {
|
|
4627
|
+
value: __freeze$h(raw || cooked.slice())
|
|
4519
4628
|
}));
|
|
4520
|
-
var _a$
|
|
4629
|
+
var _a$h, _b$a, _c$4, _d$3, _e$1, _f$1;
|
|
4521
4630
|
const CLEAR_BUTTON_BOX_STYLE = {
|
|
4522
4631
|
zIndex: 2
|
|
4523
4632
|
};
|
|
4524
4633
|
const Root$b = styled(Card).attrs({
|
|
4525
4634
|
forwardedAs: "span"
|
|
4526
4635
|
})(textInputRootStyle);
|
|
4527
|
-
const InputRoot = styled.span(_a$
|
|
4636
|
+
const InputRoot = styled.span(_a$h || (_a$h = __template$h(["\n flex: 1;\n min-width: 0;\n display: block;\n position: relative;\n"])));
|
|
4528
4637
|
const Prefix = styled(Card).attrs({
|
|
4529
4638
|
forwardedAs: "span"
|
|
4530
|
-
})(_b$a || (_b$a = __template$
|
|
4639
|
+
})(_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"])));
|
|
4531
4640
|
const Suffix = styled(Card).attrs({
|
|
4532
4641
|
forwardedAs: "span"
|
|
4533
|
-
})(_c$4 || (_c$4 = __template$
|
|
4642
|
+
})(_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"])));
|
|
4534
4643
|
const Input = styled.input(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle);
|
|
4535
4644
|
const Presentation = styled.span(responsiveRadiusStyle, textInputRepresentationStyle);
|
|
4536
|
-
const LeftBox = styled(Box)(_d$3 || (_d$3 = __template$
|
|
4537
|
-
const RightBox = styled(Box)(_e$1 || (_e$1 = __template$
|
|
4538
|
-
const RightCard = styled(Card)(_f$1 || (_f$1 = __template$
|
|
4645
|
+
const LeftBox = styled(Box)(_d$3 || (_d$3 = __template$h(["\n position: absolute;\n top: 0;\n left: 0;\n"])));
|
|
4646
|
+
const RightBox = styled(Box)(_e$1 || (_e$1 = __template$h(["\n position: absolute;\n top: 0;\n right: 0;\n"])));
|
|
4647
|
+
const RightCard = styled(Card)(_f$1 || (_f$1 = __template$h(["\n background-color: transparent;\n position: absolute;\n top: 0;\n right: 0;\n"])));
|
|
4539
4648
|
const TextInputClearButton = styled(Button)({
|
|
4540
4649
|
"&:not([hidden])": {
|
|
4541
4650
|
display: "block"
|
|
@@ -4703,17 +4812,6 @@ function useDelayedState(initialState) {
|
|
|
4703
4812
|
}, []);
|
|
4704
4813
|
return [state, onStateChange];
|
|
4705
4814
|
}
|
|
4706
|
-
function ConditionalWrapper(_ref5) {
|
|
4707
|
-
let {
|
|
4708
|
-
children,
|
|
4709
|
-
condition,
|
|
4710
|
-
wrapper
|
|
4711
|
-
} = _ref5;
|
|
4712
|
-
if (!condition) {
|
|
4713
|
-
return children;
|
|
4714
|
-
}
|
|
4715
|
-
return wrapper(children);
|
|
4716
|
-
}
|
|
4717
4815
|
const DEFAULT_TOOLTIP_ARROW_WIDTH = 15;
|
|
4718
4816
|
const DEFAULT_TOOLTIP_ARROW_HEIGHT = 6;
|
|
4719
4817
|
const DEFAULT_TOOLTIP_ARROW_RADIUS = 2;
|
|
@@ -4733,6 +4831,64 @@ const DEFAULT_FALLBACK_PLACEMENTS = {
|
|
|
4733
4831
|
"right-start": ["right", "right-end", "left-start", "top-start", "bottom-start"],
|
|
4734
4832
|
"right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
|
|
4735
4833
|
};
|
|
4834
|
+
var __freeze$g = Object.freeze;
|
|
4835
|
+
var __defProp$g = Object.defineProperty;
|
|
4836
|
+
var __template$g = (cooked, raw) => __freeze$g(__defProp$g(cooked, "raw", {
|
|
4837
|
+
value: __freeze$g(raw || cooked.slice())
|
|
4838
|
+
}));
|
|
4839
|
+
var _a$g;
|
|
4840
|
+
const MotionCard = styled(motion(Card))(_a$g || (_a$g = __template$g(["\n & > * {\n opacity: var(", ", 1);\n will-change: opacity;\n }\n"])), POPOVER_MOTION_CONTENT_OPACITY_PROPERTY);
|
|
4841
|
+
const TooltipCard = memo(forwardRef(function TooltipCard2(props, ref) {
|
|
4842
|
+
const {
|
|
4843
|
+
animate,
|
|
4844
|
+
arrow,
|
|
4845
|
+
arrowRef,
|
|
4846
|
+
arrowX,
|
|
4847
|
+
arrowY,
|
|
4848
|
+
children,
|
|
4849
|
+
originX,
|
|
4850
|
+
originY,
|
|
4851
|
+
padding,
|
|
4852
|
+
placement,
|
|
4853
|
+
radius,
|
|
4854
|
+
scheme,
|
|
4855
|
+
shadow,
|
|
4856
|
+
style,
|
|
4857
|
+
...restProps
|
|
4858
|
+
} = props;
|
|
4859
|
+
const rootStyle = useMemo(() => ({
|
|
4860
|
+
originX,
|
|
4861
|
+
originY,
|
|
4862
|
+
willChange: animate ? "transform" : void 0,
|
|
4863
|
+
...style
|
|
4864
|
+
}), [animate, originX, originY, style]);
|
|
4865
|
+
const arrowStyle = useMemo(() => ({
|
|
4866
|
+
left: arrowX !== null ? arrowX : void 0,
|
|
4867
|
+
top: arrowY !== null ? arrowY : void 0,
|
|
4868
|
+
right: void 0,
|
|
4869
|
+
bottom: void 0
|
|
4870
|
+
}), [arrowX, arrowY]);
|
|
4871
|
+
return /* @__PURE__ */jsxs(MotionCard, {
|
|
4872
|
+
"data-ui": "Tooltip__card",
|
|
4873
|
+
...restProps,
|
|
4874
|
+
"data-placement": placement,
|
|
4875
|
+
padding,
|
|
4876
|
+
radius,
|
|
4877
|
+
ref,
|
|
4878
|
+
scheme,
|
|
4879
|
+
shadow,
|
|
4880
|
+
style: rootStyle,
|
|
4881
|
+
...(animate ? POPOVER_MOTION_PROPS : {}),
|
|
4882
|
+
children: [children, arrow && /* @__PURE__ */jsx(Arrow, {
|
|
4883
|
+
ref: arrowRef,
|
|
4884
|
+
style: arrowStyle,
|
|
4885
|
+
width: DEFAULT_TOOLTIP_ARROW_WIDTH,
|
|
4886
|
+
height: DEFAULT_TOOLTIP_ARROW_HEIGHT,
|
|
4887
|
+
radius: DEFAULT_TOOLTIP_ARROW_RADIUS
|
|
4888
|
+
})]
|
|
4889
|
+
});
|
|
4890
|
+
}));
|
|
4891
|
+
TooltipCard.displayName = "TooltipCard";
|
|
4736
4892
|
const key$4 = Symbol.for("@sanity/ui/context/tooltipDelayGroup");
|
|
4737
4893
|
globalScope[key$4] = globalScope[key$4] || createContext(null);
|
|
4738
4894
|
const TooltipDelayGroupContext = globalScope[key$4];
|
|
@@ -4769,19 +4925,20 @@ var __template$f = (cooked, raw) => __freeze$f(__defProp$f(cooked, "raw", {
|
|
|
4769
4925
|
value: __freeze$f(raw || cooked.slice())
|
|
4770
4926
|
}));
|
|
4771
4927
|
var _a$f;
|
|
4772
|
-
const Root$a = styled(Layer)(_a$f || (_a$f = __template$f(["\n pointer-events: none;\n max-width: ", "px;\n"])),
|
|
4928
|
+
const Root$a = styled(Layer)(_a$f || (_a$f = __template$f(["\n pointer-events: none;\n max-width: ", "px;\n"])), _ref7 => {
|
|
4773
4929
|
let {
|
|
4774
4930
|
$maxWidth
|
|
4775
|
-
} =
|
|
4931
|
+
} = _ref7;
|
|
4776
4932
|
return $maxWidth;
|
|
4777
4933
|
});
|
|
4778
4934
|
const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
4779
|
-
var _a2, _b, _c, _d, _e;
|
|
4935
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
4780
4936
|
const boundaryElementContext = useBoundaryElement();
|
|
4781
4937
|
const {
|
|
4782
4938
|
layer
|
|
4783
4939
|
} = useTheme_v2();
|
|
4784
4940
|
const {
|
|
4941
|
+
animate = false,
|
|
4785
4942
|
arrow: arrowProp = false,
|
|
4786
4943
|
boundaryElement = boundaryElementContext == null ? void 0 : boundaryElementContext.element,
|
|
4787
4944
|
children: childProp,
|
|
@@ -4796,7 +4953,6 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4796
4953
|
shadow = 2,
|
|
4797
4954
|
zOffset = layer.tooltip.zOffset,
|
|
4798
4955
|
delay,
|
|
4799
|
-
animate = false,
|
|
4800
4956
|
...restProps
|
|
4801
4957
|
} = props;
|
|
4802
4958
|
const fallbackPlacements = useArrayProp(fallbackPlacementsProp);
|
|
@@ -4832,8 +4988,11 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4832
4988
|
padding: DEFAULT_TOOLTIP_PADDING
|
|
4833
4989
|
}));
|
|
4834
4990
|
}
|
|
4991
|
+
if (animate) {
|
|
4992
|
+
ret.push(origin);
|
|
4993
|
+
}
|
|
4835
4994
|
return ret;
|
|
4836
|
-
}, [arrowProp, boundaryElement, fallbackPlacements]);
|
|
4995
|
+
}, [animate, arrowProp, boundaryElement, fallbackPlacements]);
|
|
4837
4996
|
const {
|
|
4838
4997
|
floatingStyles,
|
|
4839
4998
|
placement,
|
|
@@ -4847,12 +5006,8 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4847
5006
|
});
|
|
4848
5007
|
const arrowX = (_d = middlewareData.arrow) == null ? void 0 : _d.x;
|
|
4849
5008
|
const arrowY = (_e = middlewareData.arrow) == null ? void 0 : _e.y;
|
|
4850
|
-
const
|
|
4851
|
-
|
|
4852
|
-
top: arrowY !== null ? arrowY : void 0,
|
|
4853
|
-
right: void 0,
|
|
4854
|
-
bottom: void 0
|
|
4855
|
-
}), [arrowX, arrowY]);
|
|
5009
|
+
const originX = (_f = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _f.originX;
|
|
5010
|
+
const originY = (_g = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _g.originY;
|
|
4856
5011
|
const tooltipId = useId();
|
|
4857
5012
|
const [isOpen, setIsOpen] = useDelayedState(false);
|
|
4858
5013
|
const delayGroupContext = useTooltipDelayGroup();
|
|
@@ -4974,53 +5129,33 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4974
5129
|
}, [childProp, handleBlur, handleClick, handleContextMenu, handleFocus, handleMouseEnter, handleMouseLeave, setReference]);
|
|
4975
5130
|
if (!child) return /* @__PURE__ */jsx(Fragment, {});
|
|
4976
5131
|
if (disabled) return child;
|
|
4977
|
-
const
|
|
5132
|
+
const tooltip = /* @__PURE__ */jsx(Root$a, {
|
|
4978
5133
|
"data-ui": "Tooltip",
|
|
4979
5134
|
...restProps,
|
|
4980
5135
|
ref: setFloating,
|
|
4981
5136
|
style: floatingStyles,
|
|
4982
5137
|
zOffset,
|
|
4983
5138
|
$maxWidth: tooltipWidth,
|
|
4984
|
-
children: /* @__PURE__ */jsx(
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
duration: 0.3,
|
|
5001
|
-
type: "spring"
|
|
5002
|
-
},
|
|
5003
|
-
children
|
|
5004
|
-
}),
|
|
5005
|
-
children: /* @__PURE__ */jsxs(Card, {
|
|
5006
|
-
"data-ui": "Tooltip__card",
|
|
5007
|
-
"data-placement": placement,
|
|
5008
|
-
padding,
|
|
5009
|
-
radius,
|
|
5010
|
-
scheme,
|
|
5011
|
-
shadow,
|
|
5012
|
-
children: [content, arrowProp && /* @__PURE__ */jsx(Arrow, {
|
|
5013
|
-
ref: setArrow,
|
|
5014
|
-
style: arrowStyle,
|
|
5015
|
-
width: DEFAULT_TOOLTIP_ARROW_WIDTH,
|
|
5016
|
-
height: DEFAULT_TOOLTIP_ARROW_HEIGHT,
|
|
5017
|
-
radius: DEFAULT_TOOLTIP_ARROW_RADIUS
|
|
5018
|
-
})]
|
|
5019
|
-
})
|
|
5139
|
+
children: /* @__PURE__ */jsx(TooltipCard, {
|
|
5140
|
+
...restProps,
|
|
5141
|
+
animate,
|
|
5142
|
+
arrow: arrowProp,
|
|
5143
|
+
arrowRef: setArrow,
|
|
5144
|
+
arrowX,
|
|
5145
|
+
arrowY,
|
|
5146
|
+
originX,
|
|
5147
|
+
originY,
|
|
5148
|
+
padding,
|
|
5149
|
+
placement,
|
|
5150
|
+
radius,
|
|
5151
|
+
ref: setFloating,
|
|
5152
|
+
scheme,
|
|
5153
|
+
shadow,
|
|
5154
|
+
children: content
|
|
5020
5155
|
})
|
|
5021
5156
|
});
|
|
5022
5157
|
return /* @__PURE__ */jsxs(Fragment, {
|
|
5023
|
-
children: [
|
|
5158
|
+
children: [/* @__PURE__ */jsx(ConditionalWrapper, {
|
|
5024
5159
|
condition: animate,
|
|
5025
5160
|
wrapper: children => /* @__PURE__ */jsx(AnimatePresence, {
|
|
5026
5161
|
children
|
|
@@ -5031,9 +5166,9 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
5031
5166
|
__unstable_name: typeof portalProp === "string" ? portalProp : void 0,
|
|
5032
5167
|
children
|
|
5033
5168
|
}),
|
|
5034
|
-
children:
|
|
5169
|
+
children: tooltip
|
|
5035
5170
|
})
|
|
5036
|
-
})]
|
|
5171
|
+
}), child]
|
|
5037
5172
|
});
|
|
5038
5173
|
});
|
|
5039
5174
|
var __freeze$e = Object.freeze;
|
|
@@ -5190,10 +5325,10 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
|
|
|
5190
5325
|
query,
|
|
5191
5326
|
value
|
|
5192
5327
|
} = state;
|
|
5193
|
-
const defaultRenderOption = useCallback(
|
|
5328
|
+
const defaultRenderOption = useCallback(_ref8 => {
|
|
5194
5329
|
let {
|
|
5195
5330
|
value: value2
|
|
5196
|
-
} =
|
|
5331
|
+
} = _ref8;
|
|
5197
5332
|
return /* @__PURE__ */jsx(Card, {
|
|
5198
5333
|
"data-as": "button",
|
|
5199
5334
|
padding: paddingProp,
|
|
@@ -5652,10 +5787,10 @@ var __template$c = (cooked, raw) => __freeze$c(__defProp$c(cooked, "raw", {
|
|
|
5652
5787
|
value: __freeze$c(raw || cooked.slice())
|
|
5653
5788
|
}));
|
|
5654
5789
|
var _a$c, _b$7;
|
|
5655
|
-
function dialogStyle(
|
|
5790
|
+
function dialogStyle(_ref9) {
|
|
5656
5791
|
let {
|
|
5657
5792
|
theme
|
|
5658
|
-
} =
|
|
5793
|
+
} = _ref9;
|
|
5659
5794
|
const {
|
|
5660
5795
|
color
|
|
5661
5796
|
} = getTheme_v2(theme);
|
|
@@ -5684,7 +5819,7 @@ function responsiveDialogPositionStyle(props) {
|
|
|
5684
5819
|
}));
|
|
5685
5820
|
}
|
|
5686
5821
|
function animationDialogStyle(props) {
|
|
5687
|
-
if (!props
|
|
5822
|
+
if (!props.$animate) return css(_a$c || (_a$c = __template$c([""])));
|
|
5688
5823
|
return css(_b$7 || (_b$7 = __template$c(["\n @keyframes zoomIn {\n from {\n opacity: 0;\n transform: scale(0.95);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n }\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n animation: fadeIn 200ms ease-out;\n // Animates the dialog card.\n & > [data-ui='DialogCard'] {\n animation: zoomIn 200ms ease-out;\n }\n "])));
|
|
5689
5824
|
}
|
|
5690
5825
|
const key$3 = Symbol.for("@sanity/ui/context/dialog");
|
|
@@ -5907,6 +6042,7 @@ const Dialog = forwardRef(function Dialog2(props, ref) {
|
|
|
5907
6042
|
__unstable_name: portalProp,
|
|
5908
6043
|
children: /* @__PURE__ */jsxs(Root$7, {
|
|
5909
6044
|
...restProps,
|
|
6045
|
+
$animate: animate,
|
|
5910
6046
|
$padding: padding,
|
|
5911
6047
|
$position: position,
|
|
5912
6048
|
"aria-labelledby": labelId,
|
|
@@ -5919,7 +6055,6 @@ const Dialog = forwardRef(function Dialog2(props, ref) {
|
|
|
5919
6055
|
ref,
|
|
5920
6056
|
role: "dialog",
|
|
5921
6057
|
zOffset,
|
|
5922
|
-
animate,
|
|
5923
6058
|
children: [/* @__PURE__ */jsx("div", {
|
|
5924
6059
|
ref: preDivRef,
|
|
5925
6060
|
tabIndex: 0
|
|
@@ -6323,6 +6458,9 @@ const MenuButton = forwardRef(function MenuButton2(props, ref) {
|
|
|
6323
6458
|
setOpen(v => !v);
|
|
6324
6459
|
setShouldFocus(null);
|
|
6325
6460
|
}, []);
|
|
6461
|
+
const handleMouseDown = useCallback(event => {
|
|
6462
|
+
if (open) event.preventDefault();
|
|
6463
|
+
}, [open]);
|
|
6326
6464
|
const handleButtonKeyDown = useCallback(event => {
|
|
6327
6465
|
if (event.key === "ArrowDown" || event.key === "Enter" || event.key === " ") {
|
|
6328
6466
|
event.preventDefault();
|
|
@@ -6406,11 +6544,12 @@ const MenuButton = forwardRef(function MenuButton2(props, ref) {
|
|
|
6406
6544
|
id,
|
|
6407
6545
|
onClick: handleButtonClick,
|
|
6408
6546
|
onKeyDown: handleButtonKeyDown,
|
|
6547
|
+
onMouseDown: handleMouseDown,
|
|
6409
6548
|
"aria-haspopup": true,
|
|
6410
6549
|
"aria-expanded": open,
|
|
6411
6550
|
ref: setButtonRef,
|
|
6412
6551
|
selected: open
|
|
6413
|
-
}) : null, [buttonProp, handleButtonClick, handleButtonKeyDown, id, open, setButtonRef]);
|
|
6552
|
+
}) : null, [buttonProp, handleButtonClick, handleButtonKeyDown, handleMouseDown, id, open, setButtonRef]);
|
|
6414
6553
|
const popoverProps = useMemo(() => ({
|
|
6415
6554
|
boundaryElement: deprecated_boundaryElement,
|
|
6416
6555
|
overflow: "auto",
|
|
@@ -6725,15 +6864,15 @@ var __template$6 = (cooked, raw) => __freeze$6(__defProp$6(cooked, "raw", {
|
|
|
6725
6864
|
var _a$6, _b$3, _c$1, _d;
|
|
6726
6865
|
const keyframe = keyframes(_a$6 || (_a$6 = __template$6(["\n 0% {\n background-position: 100%;\n }\n 100% {\n background-position: -100%;\n }\n"])));
|
|
6727
6866
|
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);
|
|
6728
|
-
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"])),
|
|
6867
|
+
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 => {
|
|
6729
6868
|
let {
|
|
6730
6869
|
$visible
|
|
6731
|
-
} =
|
|
6870
|
+
} = _ref10;
|
|
6732
6871
|
return $visible ? 1 : 0;
|
|
6733
|
-
},
|
|
6872
|
+
}, _ref11 => {
|
|
6734
6873
|
let {
|
|
6735
6874
|
$animated
|
|
6736
|
-
} =
|
|
6875
|
+
} = _ref11;
|
|
6737
6876
|
return $animated ? animation : css(_c$1 || (_c$1 = __template$6(["\n background-color: var(--card-skeleton-color-from);\n "])));
|
|
6738
6877
|
});
|
|
6739
6878
|
const Root$4 = styled(Box)(responsiveRadiusStyle, skeletonStyle);
|
|
@@ -6965,13 +7104,19 @@ const STATUS_CARD_TONE = {
|
|
|
6965
7104
|
success: "positive",
|
|
6966
7105
|
info: "primary"
|
|
6967
7106
|
};
|
|
7107
|
+
const BUTTON_TONE = {
|
|
7108
|
+
error: "critical",
|
|
7109
|
+
warning: "caution",
|
|
7110
|
+
success: "positive",
|
|
7111
|
+
info: "primary"
|
|
7112
|
+
};
|
|
6968
7113
|
const ROLES = {
|
|
6969
7114
|
error: "alert",
|
|
6970
7115
|
warning: "alert",
|
|
6971
7116
|
success: "alert",
|
|
6972
7117
|
info: "alert"
|
|
6973
7118
|
};
|
|
6974
|
-
const Root$2 = styled(Card)(_a$3 || (_a$3 = __template$3(["\n pointer-events: all;\n"])));
|
|
7119
|
+
const Root$2 = styled(Card)(_a$3 || (_a$3 = __template$3(["\n pointer-events: all;\n & > * {\n opacity: var(", ", 1);\n will-change: opacity;\n }\n"])), POPOVER_MOTION_CONTENT_OPACITY_PROPERTY);
|
|
6975
7120
|
const TextBox = styled(Flex)(_b$2 || (_b$2 = __template$3(["\n overflow-x: auto;\n"])));
|
|
6976
7121
|
function Toast(props) {
|
|
6977
7122
|
const {
|
|
@@ -6984,6 +7129,7 @@ function Toast(props) {
|
|
|
6984
7129
|
...restProps
|
|
6985
7130
|
} = props;
|
|
6986
7131
|
const cardTone = status ? STATUS_CARD_TONE[status] : "default";
|
|
7132
|
+
const buttonTone = status ? BUTTON_TONE[status] : "default";
|
|
6987
7133
|
const role = status ? ROLES[status] : "status";
|
|
6988
7134
|
return /* @__PURE__ */jsx(Root$2, {
|
|
6989
7135
|
"data-ui": "Toast",
|
|
@@ -7017,6 +7163,7 @@ function Toast(props) {
|
|
|
7017
7163
|
icon: CloseIcon,
|
|
7018
7164
|
mode: "bleed",
|
|
7019
7165
|
padding: 2,
|
|
7166
|
+
tone: buttonTone,
|
|
7020
7167
|
onClick: onClose,
|
|
7021
7168
|
style: {
|
|
7022
7169
|
verticalAlign: "top"
|
|
@@ -7118,20 +7265,22 @@ function ToastProvider(props) {
|
|
|
7118
7265
|
paddingY,
|
|
7119
7266
|
children: /* @__PURE__ */jsx(AnimatePresence, {
|
|
7120
7267
|
initial: false,
|
|
7121
|
-
children: state.map(
|
|
7268
|
+
children: state.map(_ref12 => {
|
|
7122
7269
|
let {
|
|
7123
7270
|
dismiss,
|
|
7124
7271
|
id,
|
|
7125
7272
|
params
|
|
7126
|
-
} =
|
|
7273
|
+
} = _ref12;
|
|
7127
7274
|
return /* @__PURE__ */jsx(motion.div, {
|
|
7128
7275
|
animate: {
|
|
7129
|
-
opacity: 1,
|
|
7276
|
+
opacity: [0, 1, 1],
|
|
7277
|
+
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [0, 0, 1],
|
|
7130
7278
|
y: 0,
|
|
7131
7279
|
scale: 1
|
|
7132
7280
|
},
|
|
7133
7281
|
exit: {
|
|
7134
|
-
opacity: 0,
|
|
7282
|
+
opacity: [1, 1, 0],
|
|
7283
|
+
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [1, 0, 0],
|
|
7135
7284
|
scale: 0.5,
|
|
7136
7285
|
transition: {
|
|
7137
7286
|
duration: 0.2
|
|
@@ -7139,8 +7288,10 @@ function ToastProvider(props) {
|
|
|
7139
7288
|
},
|
|
7140
7289
|
initial: {
|
|
7141
7290
|
opacity: 0,
|
|
7291
|
+
[POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: 0,
|
|
7142
7292
|
y: 32,
|
|
7143
|
-
scale: 0.25
|
|
7293
|
+
scale: 0.25,
|
|
7294
|
+
willChange: "transform"
|
|
7144
7295
|
},
|
|
7145
7296
|
layout: "position",
|
|
7146
7297
|
transition: {
|
|
@@ -7617,5 +7768,5 @@ const TreeItem = memo(function TreeItem2(props) {
|
|
|
7617
7768
|
})]
|
|
7618
7769
|
});
|
|
7619
7770
|
});
|
|
7620
|
-
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 };
|
|
7771
|
+
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 };
|
|
7621
7772
|
//# sourceMappingURL=index.esm.js.map
|