@sanity/ui 0.37.14-next.6 → 0.37.14
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/lib/dts/src/components/autocomplete/autocomplete.styles.d.ts +1 -1
- package/lib/dts/src/components/autocomplete/autocomplete.styles.d.ts.map +1 -1
- package/lib/dts/src/components/autocomplete/constants.d.ts.map +1 -1
- package/lib/dts/src/constants.d.ts +0 -10
- package/lib/dts/src/constants.d.ts.map +1 -1
- package/lib/dts/src/primitives/popover/{popoverArrow.d.ts → arrow.d.ts} +1 -1
- package/lib/dts/src/primitives/popover/arrow.d.ts.map +1 -0
- package/lib/dts/src/primitives/popover/modifiers/getPopoverModifiers.d.ts +4 -0
- package/lib/dts/src/primitives/popover/modifiers/getPopoverModifiers.d.ts.map +1 -0
- package/lib/dts/src/primitives/popover/modifiers/index.d.ts +2 -0
- package/lib/dts/src/primitives/popover/modifiers/index.d.ts.map +1 -0
- package/lib/dts/src/primitives/popover/modifiers/types.d.ts +18 -0
- package/lib/dts/src/primitives/popover/modifiers/types.d.ts.map +1 -0
- package/lib/dts/src/primitives/popover/modifiers/usePopoverModifiers.d.ts +4 -0
- package/lib/dts/src/primitives/popover/modifiers/usePopoverModifiers.d.ts.map +1 -0
- package/lib/dts/src/primitives/popover/popover.d.ts +5 -6
- package/lib/dts/src/primitives/popover/popover.d.ts.map +1 -1
- package/lib/dts/src/primitives/tooltip/tooltip.d.ts +0 -2
- package/lib/dts/src/primitives/tooltip/tooltip.d.ts.map +1 -1
- package/lib/dts/src/primitives/tooltip/tooltipArrow.d.ts.map +1 -1
- package/lib/sanity-ui.js +439 -488
- package/lib/sanity-ui.js.map +1 -1
- package/lib/sanity-ui.modern.mjs +555 -561
- package/lib/sanity-ui.modern.mjs.map +1 -1
- package/lib/sanity-ui.module.js +439 -489
- package/lib/sanity-ui.module.js.map +1 -1
- package/package.json +6 -5
- package/src/components/autocomplete/autocomplete.styles.tsx +5 -0
- package/src/components/autocomplete/constants.ts +3 -3
- package/src/constants.ts +0 -17
- package/src/primitives/popover/__workshop__/PlainStory.tsx +0 -1
- package/src/primitives/popover/__workshop__/RightAlignedStory.tsx +0 -1
- package/src/primitives/popover/__workshop__/TestStory.tsx +0 -1
- package/src/primitives/popover/{popoverArrow.tsx → arrow.tsx} +5 -5
- package/src/primitives/popover/modifiers/getPopoverModifiers.ts +137 -0
- package/src/primitives/popover/modifiers/index.ts +1 -0
- package/src/primitives/popover/modifiers/types.ts +18 -0
- package/src/primitives/popover/modifiers/usePopoverModifiers.ts +58 -0
- package/src/primitives/popover/popover.tsx +195 -245
- package/src/primitives/tooltip/__workshop__/props.tsx +1 -3
- package/src/primitives/tooltip/tooltip.tsx +83 -159
- package/src/primitives/tooltip/tooltipArrow.tsx +10 -25
- package/lib/dts/src/primitives/popover/popoverArrow.d.ts.map +0 -1
- package/lib/dts/src/primitives/popover/popoverCard.d.ts +0 -33
- package/lib/dts/src/primitives/popover/popoverCard.d.ts.map +0 -1
- package/src/primitives/popover/popoverCard.tsx +0 -160
package/lib/sanity-ui.module.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { useId } from '@reach/auto-id';
|
|
2
|
-
import React, { useMemo, useState, useRef, useEffect, createContext, useContext, useLayoutEffect, forwardRef, useCallback, cloneElement, isValidElement, createElement,
|
|
2
|
+
import React, { useMemo, useState, useRef, useEffect, createContext, useContext, useLayoutEffect, forwardRef, useCallback, cloneElement, isValidElement, createElement, useReducer, Children, Fragment, memo } from 'react';
|
|
3
3
|
import ReactIs, { isElement, isFragment, isValidElementType } from 'react-is';
|
|
4
4
|
import styled, { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1, css, keyframes } from 'styled-components';
|
|
5
5
|
import { ResizeObserver } from '@juggle/resize-observer';
|
|
6
6
|
import { white as white$1, black as black$1, hues } from '@sanity/color';
|
|
7
7
|
import { SpinnerIcon, CheckmarkIcon, RemoveIcon, SelectIcon, CloseIcon, ChevronDownIcon, ChevronRightIcon, ToggleArrowRightIcon } from '@sanity/icons';
|
|
8
8
|
import Refractor from 'react-refractor';
|
|
9
|
-
import {
|
|
9
|
+
import { usePopper } from 'react-popper';
|
|
10
10
|
import ReactDOM from 'react-dom';
|
|
11
|
+
import maxSizeModifier from 'popper-max-size-modifier';
|
|
11
12
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
12
13
|
|
|
13
14
|
function _extends() {
|
|
@@ -106,25 +107,8 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
|
106
107
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
107
108
|
}
|
|
108
109
|
|
|
109
|
-
/**
|
|
110
|
-
* @internal
|
|
111
|
-
*/
|
|
112
110
|
var EMPTY_ARRAY = [];
|
|
113
|
-
/**
|
|
114
|
-
* @internal
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
111
|
var EMPTY_RECORD = {};
|
|
118
|
-
/**
|
|
119
|
-
* @internal
|
|
120
|
-
*/
|
|
121
|
-
|
|
122
|
-
var FLOATING_STATIC_SIDES = {
|
|
123
|
-
top: 'bottom',
|
|
124
|
-
right: 'left',
|
|
125
|
-
bottom: 'top',
|
|
126
|
-
left: 'right'
|
|
127
|
-
};
|
|
128
112
|
|
|
129
113
|
/**
|
|
130
114
|
* @internal
|
|
@@ -2939,7 +2923,7 @@ globalScope[key$7] = globalScope[key$7] || /*#__PURE__*/createContext(null);
|
|
|
2939
2923
|
|
|
2940
2924
|
var ThemeContext = globalScope[key$7];
|
|
2941
2925
|
|
|
2942
|
-
var _excluded$
|
|
2926
|
+
var _excluded$H = ["color", "layer"];
|
|
2943
2927
|
/**
|
|
2944
2928
|
* @public
|
|
2945
2929
|
*/
|
|
@@ -2958,7 +2942,7 @@ function ThemeProvider(props) {
|
|
|
2958
2942
|
|
|
2959
2943
|
var rootColor = themeProp.color,
|
|
2960
2944
|
rootLayer = themeProp.layer,
|
|
2961
|
-
restTheme = _objectWithoutPropertiesLoose(themeProp, _excluded$
|
|
2945
|
+
restTheme = _objectWithoutPropertiesLoose(themeProp, _excluded$H);
|
|
2962
2946
|
|
|
2963
2947
|
var colorScheme = rootColor[scheme] || rootColor.light;
|
|
2964
2948
|
var color = colorScheme[tone] || colorScheme["default"];
|
|
@@ -3701,8 +3685,8 @@ function responsiveInputPaddingIconRightStyle(props) {
|
|
|
3701
3685
|
}));
|
|
3702
3686
|
}
|
|
3703
3687
|
|
|
3704
|
-
var _templateObject$
|
|
3705
|
-
var ROOT_STYLE = css(_templateObject$
|
|
3688
|
+
var _templateObject$D, _templateObject2$n, _templateObject3$e;
|
|
3689
|
+
var ROOT_STYLE = css(_templateObject$D || (_templateObject$D = _taggedTemplateLiteralLoose(["\n &:not([hidden]) {\n display: flex;\n }\n\n align-items: center;\n"])));
|
|
3706
3690
|
function textInputRootStyle() {
|
|
3707
3691
|
return ROOT_STYLE;
|
|
3708
3692
|
}
|
|
@@ -3712,7 +3696,7 @@ function textInputBaseStyle(props) {
|
|
|
3712
3696
|
$weight = props.$weight;
|
|
3713
3697
|
var font = theme.sanity.fonts.text;
|
|
3714
3698
|
var color = theme.sanity.color.input;
|
|
3715
|
-
return css(_templateObject2$
|
|
3699
|
+
return css(_templateObject2$n || (_templateObject2$n = _taggedTemplateLiteralLoose(["\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-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.family, $weight && font.weights[$weight] || font.weights.regular, $tone, color["default"].enabled.fg, color["default"].enabled.placeholder, color["default"].enabled.fg, color["default"].enabled.placeholder, color["default"].disabled.fg, color["default"].disabled.placeholder, color.invalid.enabled.fg, color.invalid.enabled.placeholder, color["default"].readOnly.fg, color["default"].readOnly.placeholder);
|
|
3716
3700
|
}
|
|
3717
3701
|
function textInputFontSizeStyle(props) {
|
|
3718
3702
|
var theme = props.theme;
|
|
@@ -3737,7 +3721,7 @@ function textInputRepresentationStyle(props) {
|
|
|
3737
3721
|
focusRing = _theme$sanity2.focusRing,
|
|
3738
3722
|
input = _theme$sanity2.input;
|
|
3739
3723
|
var color = theme.sanity.color.input;
|
|
3740
|
-
return css(_templateObject3$
|
|
3724
|
+
return css(_templateObject3$e || (_templateObject3$e = _taggedTemplateLiteralLoose(["\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-tone='", "'] {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n\n /* enabled */\n *:not(:disabled) + & {\n --input-box-shadow: ", ";\n }\n\n /* invalid */\n *:not(:disabled):invalid + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n --input-box-shadow: ", ";\n }\n\n /* focused */\n *:not(:disabled):focus + & {\n --input-box-shadow: ", ";\n }\n\n /* disabled */\n *:disabled + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n --input-box-shadow: ", ";\n }\n\n /* readOnly */\n *:read-only + & {\n --card-bg-color: ", " !important;\n --card-fg-color: ", " !important;\n }\n\n /* hovered */\n @media (hover: hover) {\n *:not(:disabled):not(:read-only):not(:invalid):hover + & {\n --card-bg-color: ", ";\n --card-fg-color: ", ";\n }\n\n *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + & {\n --input-box-shadow: ", ";\n }\n }\n }\n "])), $hasPrefix ? 0 : undefined, $hasPrefix ? 0 : undefined, $hasSuffix ? 0 : undefined, $hasSuffix ? 0 : undefined, $tone, color["default"].enabled.bg, color["default"].enabled.fg, $border ? focusRingBorderStyle({
|
|
3741
3725
|
color: color["default"].enabled.border,
|
|
3742
3726
|
width: input.border.width
|
|
3743
3727
|
}) : undefined, color.invalid.enabled.bg, color.invalid.enabled.fg, $border ? focusRingBorderStyle({
|
|
@@ -3805,20 +3789,20 @@ function responsiveShadowStyle(props) {
|
|
|
3805
3789
|
});
|
|
3806
3790
|
}
|
|
3807
3791
|
|
|
3808
|
-
var _templateObject$
|
|
3792
|
+
var _templateObject$C, _templateObject2$m, _templateObject3$d;
|
|
3809
3793
|
function textBaseStyle(props) {
|
|
3810
3794
|
var $accent = props.$accent,
|
|
3811
3795
|
$muted = props.$muted,
|
|
3812
3796
|
theme = props.theme;
|
|
3813
3797
|
var weights = theme.sanity.fonts.text.weights;
|
|
3814
|
-
return css(_templateObject$
|
|
3798
|
+
return css(_templateObject$C || (_templateObject$C = _taggedTemplateLiteralLoose(["\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: 0 0 0 1px var(--card-bg-color), 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 & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), $accent && css(_templateObject2$m || (_templateObject2$m = _taggedTemplateLiteralLoose(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_templateObject3$d || (_templateObject3$d = _taggedTemplateLiteralLoose(["\n color: var(--card-muted-fg-color);\n "]))), theme.sanity.fonts.code.family, weights.bold);
|
|
3815
3799
|
}
|
|
3816
3800
|
|
|
3817
|
-
var _excluded$
|
|
3801
|
+
var _excluded$G = ["accent", "align", "children", "muted", "size", "textOverflow", "weight"];
|
|
3818
3802
|
|
|
3819
|
-
var _templateObject$
|
|
3803
|
+
var _templateObject$B;
|
|
3820
3804
|
var Root$E = styled.div(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle);
|
|
3821
|
-
var SpanWithTextOverflow$2 = styled.span(_templateObject$
|
|
3805
|
+
var SpanWithTextOverflow$2 = styled.span(_templateObject$B || (_templateObject$B = _taggedTemplateLiteralLoose(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n"])));
|
|
3822
3806
|
/**
|
|
3823
3807
|
* @public
|
|
3824
3808
|
*/
|
|
@@ -3834,7 +3818,7 @@ var Text = /*#__PURE__*/forwardRef(function Text(props, ref) {
|
|
|
3834
3818
|
size = _props$size === void 0 ? 2 : _props$size,
|
|
3835
3819
|
textOverflow = props.textOverflow,
|
|
3836
3820
|
weight = props.weight,
|
|
3837
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
3821
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$G);
|
|
3838
3822
|
|
|
3839
3823
|
var children = childrenProp;
|
|
3840
3824
|
|
|
@@ -3994,7 +3978,7 @@ function avatarStrokeStyle() {
|
|
|
3994
3978
|
};
|
|
3995
3979
|
}
|
|
3996
3980
|
|
|
3997
|
-
var _excluded$
|
|
3981
|
+
var _excluded$F = ["as", "color", "src", "title", "initials", "onImageLoadError", "arrowPosition", "animateArrowFrom", "status", "size"];
|
|
3998
3982
|
var Root$D = styled.div(responsiveAvatarSizeStyle, avatarStyle.root);
|
|
3999
3983
|
var Arrow = styled.div(avatarStyle.arrow);
|
|
4000
3984
|
var BgStroke = styled.ellipse(avatarStyle.bgStroke);
|
|
@@ -4018,7 +4002,7 @@ var Avatar = /*#__PURE__*/forwardRef(function Avatar(props, ref) {
|
|
|
4018
4002
|
status = _props$status === void 0 ? 'online' : _props$status,
|
|
4019
4003
|
_props$size = props.size,
|
|
4020
4004
|
sizeProp = _props$size === void 0 ? 0 : _props$size,
|
|
4021
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4005
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$F);
|
|
4022
4006
|
|
|
4023
4007
|
var as = ReactIs.isValidElementType(asProp) ? asProp : 'div';
|
|
4024
4008
|
var size = useArrayProp(sizeProp);
|
|
@@ -4123,7 +4107,7 @@ var Avatar = /*#__PURE__*/forwardRef(function Avatar(props, ref) {
|
|
|
4123
4107
|
}, /*#__PURE__*/React.createElement("strong", null, initials)))));
|
|
4124
4108
|
});
|
|
4125
4109
|
|
|
4126
|
-
var _templateObject$
|
|
4110
|
+
var _templateObject$A;
|
|
4127
4111
|
|
|
4128
4112
|
function _responsiveAvatarCounterSizeStyle(props) {
|
|
4129
4113
|
var theme = props.theme;
|
|
@@ -4143,7 +4127,7 @@ function _responsiveAvatarCounterSizeStyle(props) {
|
|
|
4143
4127
|
|
|
4144
4128
|
function _avatarCounterBaseStyle(props) {
|
|
4145
4129
|
var theme = props.theme;
|
|
4146
|
-
return css(_templateObject$
|
|
4130
|
+
return css(_templateObject$A || (_templateObject$A = _taggedTemplateLiteralLoose(["\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: 0 0 0 1px var(--card-bg-color), inset 0 0 0 1.5px var(--card-hairline-hard-color);\n padding: 0 ", ";\n\n &:not([hidden]) {\n display: flex;\n }\n "])), rem(theme.sanity.space[2]));
|
|
4147
4131
|
}
|
|
4148
4132
|
|
|
4149
4133
|
var Root$C = styled.div(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle);
|
|
@@ -4178,10 +4162,10 @@ function childrenToElementArray(children) {
|
|
|
4178
4162
|
});
|
|
4179
4163
|
}
|
|
4180
4164
|
|
|
4181
|
-
var _excluded$
|
|
4165
|
+
var _excluded$E = ["children", "maxLength", "size"];
|
|
4182
4166
|
|
|
4183
|
-
var _templateObject$
|
|
4184
|
-
var BASE_STYLES = css(_templateObject$
|
|
4167
|
+
var _templateObject$z;
|
|
4168
|
+
var BASE_STYLES = css(_templateObject$z || (_templateObject$z = _taggedTemplateLiteralLoose(["\n white-space: nowrap;\n\n & > div {\n vertical-align: top;\n\n &:not([hidden]) {\n display: inline-block;\n }\n }\n"])));
|
|
4185
4169
|
|
|
4186
4170
|
function avatarStackStyle() {
|
|
4187
4171
|
return BASE_STYLES;
|
|
@@ -4214,7 +4198,7 @@ var AvatarStack = /*#__PURE__*/forwardRef(function AvatarStack(props, ref) {
|
|
|
4214
4198
|
maxLengthProp = _props$maxLength === void 0 ? 4 : _props$maxLength,
|
|
4215
4199
|
_props$size = props.size,
|
|
4216
4200
|
sizeProp = _props$size === void 0 ? 0 : _props$size,
|
|
4217
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4201
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$E);
|
|
4218
4202
|
|
|
4219
4203
|
var children = childrenToElementArray(childrenProp).filter(function (child) {
|
|
4220
4204
|
return typeof child !== 'string';
|
|
@@ -4244,7 +4228,7 @@ var AvatarStack = /*#__PURE__*/forwardRef(function AvatarStack(props, ref) {
|
|
|
4244
4228
|
}));
|
|
4245
4229
|
});
|
|
4246
4230
|
|
|
4247
|
-
var _excluded$
|
|
4231
|
+
var _excluded$D = ["as", "column", "columnStart", "columnEnd", "display", "flex", "height", "margin", "marginX", "marginY", "marginTop", "marginRight", "marginBottom", "marginLeft", "overflow", "padding", "paddingX", "paddingY", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "row", "rowStart", "rowEnd", "sizing"];
|
|
4248
4232
|
var Root$A = styled.div(boxStyle, flexItemStyle, responsiveBoxStyle, responsiveGridItemStyle, responsiveMarginStyle, responsivePaddingStyle);
|
|
4249
4233
|
/**
|
|
4250
4234
|
* @public
|
|
@@ -4281,7 +4265,7 @@ var Box = /*#__PURE__*/forwardRef(function Box(props, ref) {
|
|
|
4281
4265
|
rowStart = props.rowStart,
|
|
4282
4266
|
rowEnd = props.rowEnd,
|
|
4283
4267
|
sizing = props.sizing,
|
|
4284
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4268
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$D);
|
|
4285
4269
|
|
|
4286
4270
|
return /*#__PURE__*/React.createElement(Root$A, _extends({
|
|
4287
4271
|
"data-as": typeof asProp === 'string' ? asProp : undefined,
|
|
@@ -4317,20 +4301,20 @@ var Box = /*#__PURE__*/forwardRef(function Box(props, ref) {
|
|
|
4317
4301
|
}), props.children);
|
|
4318
4302
|
});
|
|
4319
4303
|
|
|
4320
|
-
var _templateObject$
|
|
4304
|
+
var _templateObject$y, _templateObject2$l, _templateObject3$c;
|
|
4321
4305
|
function labelBaseStyle(props) {
|
|
4322
4306
|
var $accent = props.$accent,
|
|
4323
4307
|
$muted = props.$muted,
|
|
4324
4308
|
theme = props.theme;
|
|
4325
4309
|
var fonts = theme.sanity.fonts;
|
|
4326
|
-
return css(_templateObject$
|
|
4310
|
+
return css(_templateObject$y || (_templateObject$y = _taggedTemplateLiteralLoose(["\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 & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), $accent && css(_templateObject2$l || (_templateObject2$l = _taggedTemplateLiteralLoose(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_templateObject3$c || (_templateObject3$c = _taggedTemplateLiteralLoose(["\n color: var(--card-muted-fg-color);\n "]))), fonts.code.family);
|
|
4327
4311
|
}
|
|
4328
4312
|
|
|
4329
|
-
var _excluded$
|
|
4313
|
+
var _excluded$C = ["accent", "align", "children", "muted", "size", "textOverflow", "weight"];
|
|
4330
4314
|
|
|
4331
|
-
var _templateObject$
|
|
4315
|
+
var _templateObject$x;
|
|
4332
4316
|
var Root$z = styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle);
|
|
4333
|
-
var SpanWithTextOverflow$1 = styled.span(_templateObject$
|
|
4317
|
+
var SpanWithTextOverflow$1 = styled.span(_templateObject$x || (_templateObject$x = _taggedTemplateLiteralLoose(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n"])));
|
|
4334
4318
|
/**
|
|
4335
4319
|
* @public
|
|
4336
4320
|
*/
|
|
@@ -4345,7 +4329,7 @@ var Label = /*#__PURE__*/forwardRef(function Label(props, ref) {
|
|
|
4345
4329
|
size = _props$size === void 0 ? 2 : _props$size,
|
|
4346
4330
|
textOverflow = props.textOverflow,
|
|
4347
4331
|
weight = props.weight,
|
|
4348
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4332
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$C);
|
|
4349
4333
|
|
|
4350
4334
|
var children = childrenProp;
|
|
4351
4335
|
|
|
@@ -4384,7 +4368,7 @@ function badgeStyle(props) {
|
|
|
4384
4368
|
};
|
|
4385
4369
|
}
|
|
4386
4370
|
|
|
4387
|
-
var _excluded$
|
|
4371
|
+
var _excluded$B = ["children", "fontSize", "mode", "padding", "radius", "tone"];
|
|
4388
4372
|
var Root$y = styled(Box)(responsiveRadiusStyle, badgeStyle);
|
|
4389
4373
|
/**
|
|
4390
4374
|
* @public
|
|
@@ -4401,7 +4385,7 @@ var Badge = /*#__PURE__*/forwardRef(function Badge(props, ref) {
|
|
|
4401
4385
|
radius = _props$radius === void 0 ? 2 : _props$radius,
|
|
4402
4386
|
_props$tone = props.tone,
|
|
4403
4387
|
tone = _props$tone === void 0 ? 'default' : _props$tone,
|
|
4404
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4388
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$B);
|
|
4405
4389
|
|
|
4406
4390
|
return /*#__PURE__*/React.createElement(Root$y, _extends({
|
|
4407
4391
|
"data-ui": "Badge"
|
|
@@ -4416,7 +4400,7 @@ var Badge = /*#__PURE__*/forwardRef(function Badge(props, ref) {
|
|
|
4416
4400
|
}, children));
|
|
4417
4401
|
});
|
|
4418
4402
|
|
|
4419
|
-
var _excluded$
|
|
4403
|
+
var _excluded$A = ["align", "as", "direction", "gap", "justify", "wrap"];
|
|
4420
4404
|
var Root$x = styled(Box)(flexItemStyle, responsiveFlexStyle);
|
|
4421
4405
|
/**
|
|
4422
4406
|
* @public
|
|
@@ -4430,7 +4414,7 @@ var Flex = /*#__PURE__*/forwardRef(function Flex(props, ref) {
|
|
|
4430
4414
|
gap = props.gap,
|
|
4431
4415
|
justify = props.justify,
|
|
4432
4416
|
wrap = props.wrap,
|
|
4433
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4417
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$A);
|
|
4434
4418
|
|
|
4435
4419
|
return /*#__PURE__*/React.createElement(Root$x, _extends({
|
|
4436
4420
|
"data-ui": "Flex"
|
|
@@ -4445,9 +4429,9 @@ var Flex = /*#__PURE__*/forwardRef(function Flex(props, ref) {
|
|
|
4445
4429
|
}));
|
|
4446
4430
|
});
|
|
4447
4431
|
|
|
4448
|
-
var _templateObject$
|
|
4449
|
-
var rotate$1 = keyframes(_templateObject$
|
|
4450
|
-
var Root$w = styled(Text)(_templateObject2$
|
|
4432
|
+
var _templateObject$w, _templateObject2$k;
|
|
4433
|
+
var rotate$1 = keyframes(_templateObject$w || (_templateObject$w = _taggedTemplateLiteralLoose(["\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n"])));
|
|
4434
|
+
var Root$w = styled(Text)(_templateObject2$k || (_templateObject2$k = _taggedTemplateLiteralLoose(["\n & > span > svg {\n animation: ", " 500ms linear infinite;\n }\n"])), rotate$1);
|
|
4451
4435
|
/**
|
|
4452
4436
|
* @public
|
|
4453
4437
|
*/
|
|
@@ -4497,13 +4481,13 @@ function _colorVarsStyle(base, color, checkered) {
|
|
|
4497
4481
|
};
|
|
4498
4482
|
}
|
|
4499
4483
|
|
|
4500
|
-
var _templateObject$
|
|
4484
|
+
var _templateObject$v;
|
|
4501
4485
|
/**
|
|
4502
4486
|
* @internal
|
|
4503
4487
|
*/
|
|
4504
4488
|
|
|
4505
4489
|
function buttonBaseStyles() {
|
|
4506
|
-
return css(_templateObject$
|
|
4490
|
+
return css(_templateObject$v || (_templateObject$v = _taggedTemplateLiteralLoose(["\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\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 "])));
|
|
4507
4491
|
}
|
|
4508
4492
|
var buttonTheme = {
|
|
4509
4493
|
border: {
|
|
@@ -4552,11 +4536,11 @@ function buttonColorStyles(props) {
|
|
|
4552
4536
|
}, (_theme$sanity$styles = theme.sanity.styles) == null ? void 0 : (_theme$sanity$styles$ = _theme$sanity$styles.button) == null ? void 0 : _theme$sanity$styles$.root].filter(Boolean);
|
|
4553
4537
|
}
|
|
4554
4538
|
|
|
4555
|
-
var _excluded$
|
|
4539
|
+
var _excluded$z = ["children", "disabled", "fontSize", "icon", "iconRight", "justify", "loading", "mode", "padding", "paddingX", "paddingY", "paddingTop", "paddingBottom", "paddingLeft", "paddingRight", "radius", "selected", "space", "text", "textAlign", "tone", "type"];
|
|
4556
4540
|
|
|
4557
|
-
var _templateObject$
|
|
4541
|
+
var _templateObject$u;
|
|
4558
4542
|
var Root$v = styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles);
|
|
4559
|
-
var LoadingBox = styled.div(_templateObject$
|
|
4543
|
+
var LoadingBox = styled.div(_templateObject$u || (_templateObject$u = _taggedTemplateLiteralLoose(["\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"])));
|
|
4560
4544
|
/**
|
|
4561
4545
|
* @public
|
|
4562
4546
|
*/
|
|
@@ -4591,7 +4575,7 @@ var Button = /*#__PURE__*/forwardRef(function Button(props, ref) {
|
|
|
4591
4575
|
tone = _props$tone === void 0 ? 'default' : _props$tone,
|
|
4592
4576
|
_props$type = props.type,
|
|
4593
4577
|
type = _props$type === void 0 ? 'button' : _props$type,
|
|
4594
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4578
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$z);
|
|
4595
4579
|
|
|
4596
4580
|
var justify = useArrayProp(justifyProp);
|
|
4597
4581
|
var padding = useArrayProp(paddingProp);
|
|
@@ -4650,7 +4634,7 @@ var Button = /*#__PURE__*/forwardRef(function Button(props, ref) {
|
|
|
4650
4634
|
}, boxProps), children));
|
|
4651
4635
|
});
|
|
4652
4636
|
|
|
4653
|
-
var _templateObject$
|
|
4637
|
+
var _templateObject$t, _templateObject2$j, _templateObject3$b;
|
|
4654
4638
|
function cardStyle(props) {
|
|
4655
4639
|
return [cardBaseStyle(props), cardColorStyle(props)];
|
|
4656
4640
|
}
|
|
@@ -4658,7 +4642,7 @@ function cardBaseStyle(props) {
|
|
|
4658
4642
|
var $checkered = props.$checkered,
|
|
4659
4643
|
theme = props.theme;
|
|
4660
4644
|
var space = theme.sanity.space;
|
|
4661
|
-
return css(_templateObject$
|
|
4645
|
+
return css(_templateObject$t || (_templateObject$t = _taggedTemplateLiteralLoose(["\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: 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(_templateObject2$j || (_templateObject2$j = _taggedTemplateLiteralLoose(["\n background-size: ", "px ", "px;\n background-position: 50% 50%;\n background-image: var(--card-bg-image);\n "])), space[3], space[3]));
|
|
4662
4646
|
}
|
|
4663
4647
|
function cardColorStyle(props) {
|
|
4664
4648
|
var _theme$sanity$styles, _theme$sanity$styles$;
|
|
@@ -4674,7 +4658,7 @@ function cardColorStyle(props) {
|
|
|
4674
4658
|
width: 0,
|
|
4675
4659
|
color: 'var(--card-border-color)'
|
|
4676
4660
|
};
|
|
4677
|
-
return css(_templateObject3$
|
|
4661
|
+
return css(_templateObject3$b || (_templateObject3$b = _taggedTemplateLiteralLoose(["\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 &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(: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 &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n ", "\n "])), _colorVarsStyle(base, card.enabled, $checkered), _colorVarsStyle(base, card.disabled, $checkered), _colorVarsStyle(base, card.pressed, $checkered), _colorVarsStyle(base, card.selected, $checkered), _colorVarsStyle(base, card.hovered, $checkered), _colorVarsStyle(base, card.pressed, $checkered), $focusRing ? focusRingStyle({
|
|
4678
4662
|
base: base,
|
|
4679
4663
|
border: border,
|
|
4680
4664
|
focusRing: focusRing
|
|
@@ -4685,7 +4669,7 @@ function cardColorStyle(props) {
|
|
|
4685
4669
|
}) : undefined, $focusRing ? focusRingBorderStyle(border) : undefined, (_theme$sanity$styles = theme.sanity.styles) == null ? void 0 : (_theme$sanity$styles$ = _theme$sanity$styles.card) == null ? void 0 : _theme$sanity$styles$.root);
|
|
4686
4670
|
}
|
|
4687
4671
|
|
|
4688
|
-
var _excluded$
|
|
4672
|
+
var _excluded$y = ["__unstable_checkered", "__unstable_focusRing", "as", "border", "borderTop", "borderRight", "borderBottom", "borderLeft", "pressed", "radius", "scheme", "selected", "shadow", "tone"];
|
|
4689
4673
|
var Root$u = styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle);
|
|
4690
4674
|
/**
|
|
4691
4675
|
* @public
|
|
@@ -4710,7 +4694,7 @@ var Card = /*#__PURE__*/forwardRef(function Card(props, ref) {
|
|
|
4710
4694
|
shadow = props.shadow,
|
|
4711
4695
|
_props$tone = props.tone,
|
|
4712
4696
|
toneProp = _props$tone === void 0 ? 'default' : _props$tone,
|
|
4713
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4697
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$y);
|
|
4714
4698
|
|
|
4715
4699
|
var as = isValidElementType(asProp) ? asProp : 'div';
|
|
4716
4700
|
var rootTheme = useRootTheme();
|
|
@@ -4743,9 +4727,9 @@ var Card = /*#__PURE__*/forwardRef(function Card(props, ref) {
|
|
|
4743
4727
|
})));
|
|
4744
4728
|
});
|
|
4745
4729
|
|
|
4746
|
-
var _templateObject$
|
|
4730
|
+
var _templateObject$s, _templateObject2$i;
|
|
4747
4731
|
function checkboxBaseStyles() {
|
|
4748
|
-
return css(_templateObject$
|
|
4732
|
+
return css(_templateObject$s || (_templateObject$s = _taggedTemplateLiteralLoose(["\n position: relative;\n display: inline-block;\n "])));
|
|
4749
4733
|
}
|
|
4750
4734
|
function inputElementStyles(props) {
|
|
4751
4735
|
var theme = props.theme;
|
|
@@ -4754,7 +4738,7 @@ function inputElementStyles(props) {
|
|
|
4754
4738
|
focusRing = _theme$sanity.focusRing,
|
|
4755
4739
|
input = _theme$sanity.input,
|
|
4756
4740
|
radius = _theme$sanity.radius;
|
|
4757
|
-
return css(_templateObject2$
|
|
4741
|
+
return css(_templateObject2$i || (_templateObject2$i = _taggedTemplateLiteralLoose(["\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: 2 !important;\n }\n }\n }\n\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 > svg:first-child {\n opacity: 1;\n }\n\n &[data-read-only] + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n\n &:not([data-read-only]):disabled + span {\n background-color: ", ";\n box-shadow: ", ";\n color: ", ";\n }\n\n &:indeterminate + span > svg:last-child {\n opacity: 1;\n }\n "])), rem(input.checkbox.size), rem(input.checkbox.size), focusRingBorderStyle({
|
|
4758
4742
|
color: color["default"].enabled.border,
|
|
4759
4743
|
width: input.border.width
|
|
4760
4744
|
}), rem(radius[2]), color["default"].enabled.bg, focusRingStyle({
|
|
@@ -4775,7 +4759,7 @@ function inputElementStyles(props) {
|
|
|
4775
4759
|
}), color["default"].disabled.fg);
|
|
4776
4760
|
}
|
|
4777
4761
|
|
|
4778
|
-
var _excluded$
|
|
4762
|
+
var _excluded$x = ["checked", "className", "disabled", "indeterminate", "customValidity", "readOnly", "style"];
|
|
4779
4763
|
var Root$t = styled.div(checkboxBaseStyles);
|
|
4780
4764
|
var Input$5 = styled.input(inputElementStyles);
|
|
4781
4765
|
/**
|
|
@@ -4790,7 +4774,7 @@ var Checkbox = /*#__PURE__*/forwardRef(function Checkbox(props, forwardedRef) {
|
|
|
4790
4774
|
customValidity = props.customValidity,
|
|
4791
4775
|
readOnly = props.readOnly,
|
|
4792
4776
|
style = props.style,
|
|
4793
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4777
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$x);
|
|
4794
4778
|
|
|
4795
4779
|
var ref = useForwardedRef(forwardedRef);
|
|
4796
4780
|
useCustomValidity(ref, customValidity);
|
|
@@ -4815,7 +4799,7 @@ var Checkbox = /*#__PURE__*/forwardRef(function Checkbox(props, forwardedRef) {
|
|
|
4815
4799
|
})), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(CheckmarkIcon, null), /*#__PURE__*/React.createElement(RemoveIcon, null)));
|
|
4816
4800
|
});
|
|
4817
4801
|
|
|
4818
|
-
var _templateObject$
|
|
4802
|
+
var _templateObject$r;
|
|
4819
4803
|
|
|
4820
4804
|
function codeSyntaxHighlightingStyle(_ref) {
|
|
4821
4805
|
var theme = _ref.theme;
|
|
@@ -4933,10 +4917,10 @@ function codeSyntaxHighlightingStyle(_ref) {
|
|
|
4933
4917
|
}
|
|
4934
4918
|
|
|
4935
4919
|
function codeBaseStyle() {
|
|
4936
|
-
return css(_templateObject$
|
|
4920
|
+
return css(_templateObject$r || (_templateObject$r = _taggedTemplateLiteralLoose(["\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 & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), codeSyntaxHighlightingStyle);
|
|
4937
4921
|
}
|
|
4938
4922
|
|
|
4939
|
-
var _excluded$
|
|
4923
|
+
var _excluded$w = ["children", "language", "size", "weight"];
|
|
4940
4924
|
var Root$s = styled.pre(codeBaseStyle, responsiveCodeFontStyle);
|
|
4941
4925
|
/**
|
|
4942
4926
|
* @public
|
|
@@ -4948,7 +4932,7 @@ var Code = /*#__PURE__*/forwardRef(function Code(props, ref) {
|
|
|
4948
4932
|
_props$size = props.size,
|
|
4949
4933
|
size = _props$size === void 0 ? 2 : _props$size,
|
|
4950
4934
|
weight = props.weight,
|
|
4951
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4935
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$w);
|
|
4952
4936
|
|
|
4953
4937
|
var language = typeof languageProp === 'string' ? languageProp : undefined;
|
|
4954
4938
|
var registered = language ? Refractor.hasLanguage(language) : false;
|
|
@@ -4984,7 +4968,7 @@ function responsiveContainerWidthStyle(props) {
|
|
|
4984
4968
|
});
|
|
4985
4969
|
}
|
|
4986
4970
|
|
|
4987
|
-
var _excluded$
|
|
4971
|
+
var _excluded$v = ["as", "width"];
|
|
4988
4972
|
var Root$r = styled(Box)(containerBaseStyle, responsiveContainerWidthStyle);
|
|
4989
4973
|
/**
|
|
4990
4974
|
* @public
|
|
@@ -4994,7 +4978,7 @@ var Container = /*#__PURE__*/forwardRef(function Container(props, ref) {
|
|
|
4994
4978
|
var as = props.as,
|
|
4995
4979
|
_props$width = props.width,
|
|
4996
4980
|
width = _props$width === void 0 ? 2 : _props$width,
|
|
4997
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4981
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$v);
|
|
4998
4982
|
|
|
4999
4983
|
return /*#__PURE__*/React.createElement(Root$r, _extends({
|
|
5000
4984
|
"data-ui": "Container"
|
|
@@ -5005,7 +4989,7 @@ var Container = /*#__PURE__*/forwardRef(function Container(props, ref) {
|
|
|
5005
4989
|
}));
|
|
5006
4990
|
});
|
|
5007
4991
|
|
|
5008
|
-
var _excluded$
|
|
4992
|
+
var _excluded$u = ["as", "autoRows", "autoCols", "autoFlow", "columns", "gap", "gapX", "gapY", "rows", "children"];
|
|
5009
4993
|
var Root$q = styled(Box)(responsiveGridStyle);
|
|
5010
4994
|
/**
|
|
5011
4995
|
* @public
|
|
@@ -5022,7 +5006,7 @@ var Grid = /*#__PURE__*/forwardRef(function Grid(props, ref) {
|
|
|
5022
5006
|
gapY = props.gapY,
|
|
5023
5007
|
rows = props.rows,
|
|
5024
5008
|
children = props.children,
|
|
5025
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5009
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$u);
|
|
5026
5010
|
|
|
5027
5011
|
return /*#__PURE__*/React.createElement(Root$q, _extends({
|
|
5028
5012
|
"data-as": typeof as === 'string' ? as : undefined,
|
|
@@ -5041,19 +5025,19 @@ var Grid = /*#__PURE__*/forwardRef(function Grid(props, ref) {
|
|
|
5041
5025
|
}), children);
|
|
5042
5026
|
});
|
|
5043
5027
|
|
|
5044
|
-
var _templateObject$
|
|
5028
|
+
var _templateObject$q, _templateObject2$h, _templateObject3$a;
|
|
5045
5029
|
function headingBaseStyle(props) {
|
|
5046
5030
|
var $accent = props.$accent,
|
|
5047
5031
|
$muted = props.$muted,
|
|
5048
5032
|
theme = props.theme;
|
|
5049
|
-
return css(_templateObject$
|
|
5033
|
+
return css(_templateObject$q || (_templateObject$q = _taggedTemplateLiteralLoose(["\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: 0 0 0 1px var(--card-bg-color), 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])), $accent && css(_templateObject2$h || (_templateObject2$h = _taggedTemplateLiteralLoose(["\n color: var(--card-accent-fg-color);\n "]))), $muted && css(_templateObject3$a || (_templateObject3$a = _taggedTemplateLiteralLoose(["\n color: var(--card-muted-fg-color);\n "]))), theme.sanity.fonts.code.family);
|
|
5050
5034
|
}
|
|
5051
5035
|
|
|
5052
|
-
var _excluded$
|
|
5036
|
+
var _excluded$t = ["accent", "align", "children", "muted", "size", "textOverflow", "weight"];
|
|
5053
5037
|
|
|
5054
|
-
var _templateObject$
|
|
5038
|
+
var _templateObject$p;
|
|
5055
5039
|
var Root$p = styled.div(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont);
|
|
5056
|
-
var SpanWithTextOverflow = styled.span(_templateObject$
|
|
5040
|
+
var SpanWithTextOverflow = styled.span(_templateObject$p || (_templateObject$p = _taggedTemplateLiteralLoose(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n"])));
|
|
5057
5041
|
/**
|
|
5058
5042
|
* @public
|
|
5059
5043
|
*/
|
|
@@ -5069,7 +5053,7 @@ var Heading = /*#__PURE__*/forwardRef(function Heading(props, ref) {
|
|
|
5069
5053
|
size = _props$size === void 0 ? 2 : _props$size,
|
|
5070
5054
|
textOverflow = props.textOverflow,
|
|
5071
5055
|
weight = props.weight,
|
|
5072
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5056
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$t);
|
|
5073
5057
|
|
|
5074
5058
|
var children = childrenProp;
|
|
5075
5059
|
|
|
@@ -5114,7 +5098,7 @@ function inlineSpaceStyle(props) {
|
|
|
5114
5098
|
});
|
|
5115
5099
|
}
|
|
5116
5100
|
|
|
5117
|
-
var _excluded$
|
|
5101
|
+
var _excluded$s = ["as", "children", "space"];
|
|
5118
5102
|
var Root$o = styled(Box)(inlineBaseStyle, inlineSpaceStyle);
|
|
5119
5103
|
/**
|
|
5120
5104
|
* @public
|
|
@@ -5124,7 +5108,7 @@ var Inline = /*#__PURE__*/forwardRef(function Inline(props, ref) {
|
|
|
5124
5108
|
var as = props.as,
|
|
5125
5109
|
childrenProp = props.children,
|
|
5126
5110
|
space = props.space,
|
|
5127
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5111
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$s);
|
|
5128
5112
|
|
|
5129
5113
|
var children = useMemo(function () {
|
|
5130
5114
|
return childrenToElementArray(childrenProp).filter(Boolean).map(function (child, idx) {
|
|
@@ -5142,12 +5126,12 @@ var Inline = /*#__PURE__*/forwardRef(function Inline(props, ref) {
|
|
|
5142
5126
|
}), children);
|
|
5143
5127
|
});
|
|
5144
5128
|
|
|
5145
|
-
var _excluded$
|
|
5129
|
+
var _excluded$r = ["children", "fontSize", "padding", "radius"];
|
|
5146
5130
|
|
|
5147
|
-
var _templateObject$
|
|
5131
|
+
var _templateObject$o;
|
|
5148
5132
|
|
|
5149
5133
|
function kbdStyle() {
|
|
5150
|
-
return css(_templateObject$
|
|
5134
|
+
return css(_templateObject$o || (_templateObject$o = _taggedTemplateLiteralLoose(["\n background: var(--card-bg-color);\n font: inherit;\n box-shadow: inset 0 0 0 1px var(--card-hairline-hard-color);\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
|
|
5151
5135
|
}
|
|
5152
5136
|
|
|
5153
5137
|
var Root$n = styled.kbd(responsiveRadiusStyle, kbdStyle);
|
|
@@ -5163,7 +5147,7 @@ var KBD = /*#__PURE__*/forwardRef(function KBD(props, ref) {
|
|
|
5163
5147
|
padding = _props$padding === void 0 ? 1 : _props$padding,
|
|
5164
5148
|
_props$radius = props.radius,
|
|
5165
5149
|
radius = _props$radius === void 0 ? 2 : _props$radius,
|
|
5166
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5150
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$r);
|
|
5167
5151
|
|
|
5168
5152
|
return /*#__PURE__*/React.createElement(Root$n, _extends({
|
|
5169
5153
|
"data-ui": "KBD"
|
|
@@ -5249,7 +5233,7 @@ function findMinBreakpoints(media, width) {
|
|
|
5249
5233
|
return ret;
|
|
5250
5234
|
}
|
|
5251
5235
|
|
|
5252
|
-
var _excluded$
|
|
5236
|
+
var _excluded$q = ["children", "media"];
|
|
5253
5237
|
/**
|
|
5254
5238
|
* DO NOT USE IN PRODUCTION.
|
|
5255
5239
|
* @beta
|
|
@@ -5261,7 +5245,7 @@ var ElementQuery = /*#__PURE__*/forwardRef(function ElementQuery(props, ref) {
|
|
|
5261
5245
|
var children = props.children,
|
|
5262
5246
|
_props$media = props.media,
|
|
5263
5247
|
media = _props$media === void 0 ? theme.sanity.media : _props$media,
|
|
5264
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5248
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$q);
|
|
5265
5249
|
|
|
5266
5250
|
var forwardedRef = useForwardedRef(ref);
|
|
5267
5251
|
|
|
@@ -5418,16 +5402,16 @@ function LayerProvider(props) {
|
|
|
5418
5402
|
}, children);
|
|
5419
5403
|
}
|
|
5420
5404
|
|
|
5421
|
-
var _excluded$
|
|
5405
|
+
var _excluded$p = ["children", "style"],
|
|
5422
5406
|
_excluded2$1 = ["children", "zOffset"];
|
|
5423
5407
|
|
|
5424
|
-
var _templateObject$
|
|
5425
|
-
var Root$m = styled.div(_templateObject$
|
|
5408
|
+
var _templateObject$n;
|
|
5409
|
+
var Root$m = styled.div(_templateObject$n || (_templateObject$n = _taggedTemplateLiteralLoose(["\n position: relative;\n"])));
|
|
5426
5410
|
var LayerChildren = /*#__PURE__*/forwardRef(function LayerChildren(props, ref) {
|
|
5427
5411
|
var children = props.children,
|
|
5428
5412
|
_props$style = props.style,
|
|
5429
5413
|
style = _props$style === void 0 ? EMPTY_RECORD : _props$style,
|
|
5430
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5414
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$p);
|
|
5431
5415
|
|
|
5432
5416
|
var _useLayer = useLayer(),
|
|
5433
5417
|
zIndex = _useLayer.zIndex;
|
|
@@ -5575,8 +5559,8 @@ function PortalProvider(props) {
|
|
|
5575
5559
|
}, children);
|
|
5576
5560
|
}
|
|
5577
5561
|
|
|
5578
|
-
var _templateObject$
|
|
5579
|
-
var Root$l = styled.div(_templateObject$
|
|
5562
|
+
var _templateObject$m;
|
|
5563
|
+
var Root$l = styled.div(_templateObject$m || (_templateObject$m = _taggedTemplateLiteralLoose(["\n display: block;\n width: 0;\n height: 0;\n position: absolute;\n overflow: hidden;\n"])));
|
|
5580
5564
|
/**
|
|
5581
5565
|
* @public
|
|
5582
5566
|
*/
|
|
@@ -5758,11 +5742,11 @@ function _isScrollable(el) {
|
|
|
5758
5742
|
return style.overflowX.includes('auto') || style.overflowX.includes('scroll') || style.overflowY.includes('auto') || style.overflowY.includes('scroll');
|
|
5759
5743
|
}
|
|
5760
5744
|
|
|
5761
|
-
var _excluded$
|
|
5745
|
+
var _excluded$o = ["as", "gap", "getItemKey", "items", "onChange", "renderItem"];
|
|
5762
5746
|
|
|
5763
|
-
var _templateObject$
|
|
5764
|
-
var Root$k = styled.div(_templateObject$
|
|
5765
|
-
var ItemWrapper = styled.div(_templateObject2$
|
|
5747
|
+
var _templateObject$l, _templateObject2$g;
|
|
5748
|
+
var Root$k = styled.div(_templateObject$l || (_templateObject$l = _taggedTemplateLiteralLoose(["\n position: relative;\n"])));
|
|
5749
|
+
var ItemWrapper = styled.div(_templateObject2$g || (_templateObject2$g = _taggedTemplateLiteralLoose(["\n position: absolute;\n left: 0;\n right: 0;\n"])));
|
|
5766
5750
|
/**
|
|
5767
5751
|
* @beta
|
|
5768
5752
|
*/
|
|
@@ -5777,7 +5761,7 @@ var VirtualList = /*#__PURE__*/forwardRef(function VirtualList(props, ref) {
|
|
|
5777
5761
|
items = _props$items === void 0 ? [] : _props$items,
|
|
5778
5762
|
onChange = props.onChange,
|
|
5779
5763
|
renderItem = props.renderItem,
|
|
5780
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5764
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$o);
|
|
5781
5765
|
|
|
5782
5766
|
var space = useTheme().sanity.space;
|
|
5783
5767
|
var forwardedRef = useForwardedRef(ref);
|
|
@@ -5906,13 +5890,13 @@ var VirtualList = /*#__PURE__*/forwardRef(function VirtualList(props, ref) {
|
|
|
5906
5890
|
}, children));
|
|
5907
5891
|
});
|
|
5908
5892
|
|
|
5909
|
-
var _templateObject$
|
|
5910
|
-
var Root$j = styled.div(_templateObject$
|
|
5911
|
-
var BorderPath = styled.path(_templateObject2$
|
|
5912
|
-
var ShapePath = styled.path(_templateObject3$
|
|
5893
|
+
var _templateObject$k, _templateObject2$f, _templateObject3$9;
|
|
5894
|
+
var Root$j = styled.div(_templateObject$k || (_templateObject$k = _taggedTemplateLiteralLoose(["\n position: absolute;\n pointer-events: none;\n width: 27px;\n height: 27px;\n fill: none;\n\n :empty + & {\n display: none;\n }\n\n & > svg {\n display: block;\n transform-origin: 13.5px 13.5px;\n }\n\n [data-popper-placement^='top'] > div > & {\n bottom: -27px;\n }\n\n [data-popper-placement^='right'] > div > & {\n left: -27px;\n\n & > svg {\n transform: rotate(90deg);\n }\n }\n\n [data-popper-placement^='left'] > div > & {\n right: -27px;\n\n & > svg {\n transform: rotate(-90deg);\n }\n }\n\n [data-popper-placement^='bottom'] > div > & {\n top: -27px;\n\n & > svg {\n transform: rotate(180deg);\n }\n }\n"])));
|
|
5895
|
+
var BorderPath = styled.path(_templateObject2$f || (_templateObject2$f = _taggedTemplateLiteralLoose(["\n fill: var(--card-shadow-outline-color);\n"])));
|
|
5896
|
+
var ShapePath = styled.path(_templateObject3$9 || (_templateObject3$9 = _taggedTemplateLiteralLoose(["\n fill: var(--card-bg-color);\n"])));
|
|
5913
5897
|
var PopoverArrow = /*#__PURE__*/forwardRef(function PopoverArrow(props, ref) {
|
|
5914
5898
|
return /*#__PURE__*/React.createElement(Root$j, _extends({
|
|
5915
|
-
"data-ui": "
|
|
5899
|
+
"data-ui": "PopoverArrow"
|
|
5916
5900
|
}, props, {
|
|
5917
5901
|
ref: ref
|
|
5918
5902
|
}), /*#__PURE__*/React.createElement("svg", {
|
|
@@ -5928,309 +5912,317 @@ var PopoverArrow = /*#__PURE__*/forwardRef(function PopoverArrow(props, ref) {
|
|
|
5928
5912
|
})));
|
|
5929
5913
|
});
|
|
5930
5914
|
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
function popoverCardStyle(props) {
|
|
5934
|
-
var $boundaryWidth = props.$boundaryWidth;
|
|
5935
|
-
return {
|
|
5936
|
-
maxWidth: $boundaryWidth ? $boundaryWidth - 16 + "px" : 'calc(100% - 16px)'
|
|
5937
|
-
};
|
|
5938
|
-
}
|
|
5915
|
+
/*
|
|
5939
5916
|
|
|
5940
|
-
|
|
5941
|
-
/**
|
|
5942
|
-
* @internal
|
|
5943
|
-
*/
|
|
5917
|
+
The order of popper phases:
|
|
5944
5918
|
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
children = props.children,
|
|
5955
|
-
padding = props.padding,
|
|
5956
|
-
placement = props.placement,
|
|
5957
|
-
overflow = props.overflow,
|
|
5958
|
-
radius = props.radius,
|
|
5959
|
-
referenceWidthProp = props.referenceWidth,
|
|
5960
|
-
scheme = props.scheme,
|
|
5961
|
-
shadow = props.shadow,
|
|
5962
|
-
strategy = props.strategy,
|
|
5963
|
-
tone = props.tone,
|
|
5964
|
-
width = props.width,
|
|
5965
|
-
xProp = props.x,
|
|
5966
|
-
yProp = props.y,
|
|
5967
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$o);
|
|
5919
|
+
- beforeRead
|
|
5920
|
+
- read
|
|
5921
|
+
- afterRead
|
|
5922
|
+
- beforeMain
|
|
5923
|
+
- main
|
|
5924
|
+
- afterMain
|
|
5925
|
+
- beforeWrite
|
|
5926
|
+
- write
|
|
5927
|
+
- afterWrite
|
|
5968
5928
|
|
|
5969
|
-
|
|
5970
|
-
zIndex = _useLayer.zIndex; // top right bottom left
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
var margins = useMemo(function () {
|
|
5974
|
-
return marginsProp || [0, 0, 0, 0];
|
|
5975
|
-
}, [marginsProp]); // translate according to margins
|
|
5976
|
-
|
|
5977
|
-
var referenceWidth = referenceWidthProp ? referenceWidthProp - margins[1] - margins[3] : undefined;
|
|
5978
|
-
var x = (xProp != null ? xProp : 0) + margins[3];
|
|
5979
|
-
var y = (yProp != null ? yProp : 0) + margins[0];
|
|
5980
|
-
var maxWidth = availableWidth ? Math.min(availableWidth - 8, referenceWidth || Infinity) : undefined;
|
|
5981
|
-
var rootStyle = useMemo(function () {
|
|
5982
|
-
return {
|
|
5983
|
-
position: strategy,
|
|
5984
|
-
top: y,
|
|
5985
|
-
left: x,
|
|
5986
|
-
zIndex: zIndex,
|
|
5987
|
-
width: referenceWidth,
|
|
5988
|
-
maxWidth: referenceWidth ? undefined : maxWidth
|
|
5989
|
-
};
|
|
5990
|
-
}, [referenceWidth, maxWidth, strategy, x, y, zIndex]);
|
|
5991
|
-
var wrapperStyle = useMemo(function () {
|
|
5992
|
-
return {
|
|
5993
|
-
minHeight: 25,
|
|
5994
|
-
maxHeight: availableHeight ? availableHeight - 8 : undefined
|
|
5995
|
-
};
|
|
5996
|
-
}, [availableHeight]);
|
|
5997
|
-
var staticSide = placement && FLOATING_STATIC_SIDES[placement.split('-')[0]];
|
|
5998
|
-
var arrowStyle = useMemo(function () {
|
|
5999
|
-
var style = {
|
|
6000
|
-
left: arrowX !== null ? arrowX : undefined,
|
|
6001
|
-
top: arrowY !== null ? arrowY : undefined,
|
|
6002
|
-
right: undefined,
|
|
6003
|
-
bottom: undefined
|
|
6004
|
-
};
|
|
6005
|
-
if (staticSide) style[staticSide] = -27;
|
|
6006
|
-
return style;
|
|
6007
|
-
}, [arrowX, arrowY, staticSide]);
|
|
6008
|
-
return /*#__PURE__*/React.createElement(Root$i, _extends({}, restProps, {
|
|
6009
|
-
"$boundaryWidth": boundaryWidth,
|
|
6010
|
-
"data-placement": placement,
|
|
6011
|
-
"data-ui": "Popover",
|
|
6012
|
-
radius: radius,
|
|
6013
|
-
ref: ref,
|
|
6014
|
-
scheme: scheme,
|
|
6015
|
-
shadow: shadow,
|
|
6016
|
-
style: rootStyle,
|
|
6017
|
-
tone: tone,
|
|
6018
|
-
"$width": width
|
|
6019
|
-
}), /*#__PURE__*/React.createElement(Box, {
|
|
6020
|
-
"data-ui": "Popover__wrapper",
|
|
6021
|
-
overflow: overflow,
|
|
6022
|
-
padding: padding,
|
|
6023
|
-
sizing: "border",
|
|
6024
|
-
style: wrapperStyle
|
|
6025
|
-
}, children), arrow && /*#__PURE__*/React.createElement(PopoverArrow, {
|
|
6026
|
-
ref: arrowRef,
|
|
6027
|
-
style: arrowStyle
|
|
6028
|
-
}));
|
|
6029
|
-
}));
|
|
6030
|
-
PopoverCard.displayName = 'PopoverCard';
|
|
5929
|
+
*/
|
|
6031
5930
|
|
|
6032
|
-
|
|
5931
|
+
function getPopoverModifiers(props) {
|
|
5932
|
+
var allowedAutoPlacements = props.allowedAutoPlacements,
|
|
5933
|
+
arrow = props.arrow,
|
|
5934
|
+
arrowElement = props.arrowElement,
|
|
5935
|
+
boundaryElement = props.boundaryElement,
|
|
5936
|
+
constrainSize = props.constrainSize,
|
|
5937
|
+
distance = props.distance,
|
|
5938
|
+
fallbackPlacements = props.fallbackPlacements,
|
|
5939
|
+
margins = props.margins,
|
|
5940
|
+
matchReferenceWidth = props.matchReferenceWidth,
|
|
5941
|
+
open = props.open,
|
|
5942
|
+
preventOverflow = props.preventOverflow,
|
|
5943
|
+
skidding = props.skidding,
|
|
5944
|
+
tether = props.tether,
|
|
5945
|
+
tetherOffset = props.tetherOffset; // NOTE: For later viewers:
|
|
5946
|
+
// Prior to adding this change, the popover would get `maxWidth: 0` the 2nd time it
|
|
5947
|
+
// was opened, when used with `constrainSize`. I was looking for a way to "reset"
|
|
5948
|
+
// the size of the popover as measured by Popper.js, and this seems to be a workaround.
|
|
5949
|
+
|
|
5950
|
+
if (!open) {
|
|
5951
|
+
return [];
|
|
5952
|
+
}
|
|
6033
5953
|
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
5954
|
+
var detectOverflowOptions = {
|
|
5955
|
+
altAxis: !constrainSize,
|
|
5956
|
+
boundary: boundaryElement || undefined,
|
|
5957
|
+
padding: 8,
|
|
5958
|
+
tether: tether,
|
|
5959
|
+
tetherOffset: tetherOffset
|
|
5960
|
+
};
|
|
5961
|
+
return [constrainSize && _extends({}, maxSizeModifier, {
|
|
5962
|
+
options: detectOverflowOptions
|
|
5963
|
+
}), constrainSize && {
|
|
5964
|
+
name: 'applyMaxSize',
|
|
5965
|
+
enabled: true,
|
|
5966
|
+
phase: 'beforeWrite',
|
|
5967
|
+
requires: ['maxSize'],
|
|
5968
|
+
fn: function fn(_ref) {
|
|
5969
|
+
var state = _ref.state;
|
|
5970
|
+
var _state$modifiersData$ = state.modifiersData.maxSize,
|
|
5971
|
+
width = _state$modifiersData$.width,
|
|
5972
|
+
height = _state$modifiersData$.height;
|
|
5973
|
+
state.styles.popper = _extends({}, state.styles.popper, {
|
|
5974
|
+
maxWidth: width + "px",
|
|
5975
|
+
maxHeight: height + "px"
|
|
5976
|
+
});
|
|
5977
|
+
}
|
|
5978
|
+
}, arrow && {
|
|
5979
|
+
name: 'arrow',
|
|
5980
|
+
options: {
|
|
5981
|
+
element: arrowElement,
|
|
5982
|
+
padding: 4
|
|
5983
|
+
}
|
|
5984
|
+
}, (constrainSize || preventOverflow) && {
|
|
5985
|
+
name: 'preventOverflow',
|
|
5986
|
+
options: detectOverflowOptions
|
|
5987
|
+
}, {
|
|
5988
|
+
name: 'offset',
|
|
5989
|
+
options: {
|
|
5990
|
+
offset: [skidding, distance]
|
|
5991
|
+
}
|
|
5992
|
+
}, margins && {
|
|
5993
|
+
name: 'margins',
|
|
5994
|
+
enabled: true,
|
|
5995
|
+
phase: 'beforeRead',
|
|
5996
|
+
fn: function fn(_ref2) {
|
|
5997
|
+
var state = _ref2.state;
|
|
5998
|
+
var rects = state.rects;
|
|
5999
|
+
|
|
6000
|
+
if (rects.reference) {
|
|
6001
|
+
rects.reference.x += margins[3];
|
|
6002
|
+
rects.reference.y += margins[1];
|
|
6003
|
+
rects.reference.width -= margins[1] + margins[3];
|
|
6004
|
+
rects.reference.height -= margins[0] + margins[2];
|
|
6040
6005
|
}
|
|
6006
|
+
}
|
|
6007
|
+
}, {
|
|
6008
|
+
name: 'flip',
|
|
6009
|
+
options: {
|
|
6010
|
+
allowedAutoPlacements: allowedAutoPlacements,
|
|
6011
|
+
boundary: boundaryElement || undefined,
|
|
6012
|
+
fallbackPlacements: fallbackPlacements,
|
|
6013
|
+
padding: 8
|
|
6014
|
+
}
|
|
6015
|
+
}, matchReferenceWidth && {
|
|
6016
|
+
name: 'matchWidth',
|
|
6017
|
+
enabled: true,
|
|
6018
|
+
phase: 'beforeWrite',
|
|
6019
|
+
requires: ['computeStyles'],
|
|
6020
|
+
fn: function fn(_ref3) {
|
|
6021
|
+
var state = _ref3.state;
|
|
6022
|
+
var width = state.rects.reference.width;
|
|
6023
|
+
state.styles.popper.width = width + "px";
|
|
6024
|
+
},
|
|
6025
|
+
effect: function effect(_ref4) {
|
|
6026
|
+
var state = _ref4.state;
|
|
6027
|
+
var refElement = state.elements.reference;
|
|
6041
6028
|
|
|
6042
|
-
if (
|
|
6043
|
-
|
|
6029
|
+
if (refElement instanceof HTMLElement) {
|
|
6030
|
+
state.elements.popper.style.width = refElement.offsetWidth - (margins ? margins[1] + margins[3] : 0) + "px";
|
|
6044
6031
|
}
|
|
6045
|
-
}
|
|
6046
|
-
|
|
6047
|
-
});
|
|
6032
|
+
}
|
|
6033
|
+
}].filter(Boolean);
|
|
6048
6034
|
}
|
|
6049
6035
|
|
|
6050
|
-
|
|
6051
|
-
var
|
|
6036
|
+
function usePopoverModifiers(props) {
|
|
6037
|
+
var allowedAutoPlacements = props.allowedAutoPlacements,
|
|
6038
|
+
arrow = props.arrow,
|
|
6039
|
+
arrowElement = props.arrowElement,
|
|
6040
|
+
boundaryElement = props.boundaryElement,
|
|
6041
|
+
constrainSize = props.constrainSize,
|
|
6042
|
+
distance = props.distance,
|
|
6043
|
+
fallbackPlacements = props.fallbackPlacements,
|
|
6044
|
+
margins = props.margins,
|
|
6045
|
+
matchReferenceWidth = props.matchReferenceWidth,
|
|
6046
|
+
open = props.open,
|
|
6047
|
+
preventOverflow = props.preventOverflow,
|
|
6048
|
+
skidding = props.skidding,
|
|
6049
|
+
tether = props.tether,
|
|
6050
|
+
tetherOffset = props.tetherOffset;
|
|
6051
|
+
return useMemo(function () {
|
|
6052
|
+
return getPopoverModifiers({
|
|
6053
|
+
allowedAutoPlacements: allowedAutoPlacements,
|
|
6054
|
+
arrow: arrow,
|
|
6055
|
+
arrowElement: arrowElement,
|
|
6056
|
+
boundaryElement: boundaryElement,
|
|
6057
|
+
constrainSize: constrainSize,
|
|
6058
|
+
distance: distance,
|
|
6059
|
+
fallbackPlacements: fallbackPlacements,
|
|
6060
|
+
margins: margins,
|
|
6061
|
+
matchReferenceWidth: matchReferenceWidth,
|
|
6062
|
+
open: open,
|
|
6063
|
+
preventOverflow: preventOverflow,
|
|
6064
|
+
skidding: skidding,
|
|
6065
|
+
tether: tether,
|
|
6066
|
+
tetherOffset: tetherOffset
|
|
6067
|
+
});
|
|
6068
|
+
}, [allowedAutoPlacements, arrow, arrowElement, boundaryElement, constrainSize, distance, fallbackPlacements, margins, matchReferenceWidth, open, preventOverflow, skidding, tether, tetherOffset]);
|
|
6069
|
+
}
|
|
6070
|
+
|
|
6071
|
+
var _excluded$n = ["__unstable_margins", "allowedAutoPlacements", "arrow", "boundaryElement", "children", "content", "constrainSize", "disabled", "fallbackPlacements", "open", "padding", "placement", "portal", "preventOverflow", "radius", "referenceElement", "matchReferenceWidth", "shadow", "scheme", "style", "tether", "tetherOffset", "tone", "width", "zOffset"];
|
|
6072
|
+
|
|
6073
|
+
var _templateObject$j, _templateObject2$e, _templateObject3$8;
|
|
6074
|
+
var Root$i = styled(Layer)(function (_ref) {
|
|
6075
|
+
var $preventOverflow = _ref.$preventOverflow;
|
|
6076
|
+
return css(_templateObject$j || (_templateObject$j = _taggedTemplateLiteralLoose(["\n pointer-events: none;\n display: flex;\n flex-direction: column;\n max-width: calc(100% - 16px);\n\n & > * {\n min-height: 0;\n }\n\n /* Hide the popover when the reference element is out of bounds */\n ", "\n "])), $preventOverflow && css(_templateObject2$e || (_templateObject2$e = _taggedTemplateLiteralLoose(["\n &[data-popper-reference-hidden='true'] {\n display: none;\n }\n "]))));
|
|
6077
|
+
});
|
|
6078
|
+
var PopoverCard = styled(Card)(function (_ref2) {
|
|
6079
|
+
var $constrainSize = _ref2.$constrainSize;
|
|
6080
|
+
return css(_templateObject3$8 || (_templateObject3$8 = _taggedTemplateLiteralLoose(["\n flex: 1;\n max-height: ", ";\n pointer-events: all;\n\n && {\n display: flex;\n }\n\n flex-direction: column;\n\n & > * {\n min-height: 0;\n }\n\n ", "\n "])), $constrainSize && '100%', responsiveContainerWidthStyle);
|
|
6081
|
+
});
|
|
6082
|
+
/**
|
|
6083
|
+
* @public
|
|
6084
|
+
*/
|
|
6085
|
+
|
|
6086
|
+
var Popover = /*#__PURE__*/forwardRef(function Popover(props, ref) {
|
|
6087
|
+
var _theme$sanity$layer;
|
|
6052
6088
|
|
|
6053
|
-
var theme = useTheme();
|
|
6054
6089
|
var boundaryElementContext = useBoundaryElement();
|
|
6090
|
+
var theme = useTheme();
|
|
6055
6091
|
|
|
6056
6092
|
var margins = props.__unstable_margins,
|
|
6093
|
+
allowedAutoPlacements = props.allowedAutoPlacements,
|
|
6057
6094
|
_props$arrow = props.arrow,
|
|
6058
|
-
|
|
6095
|
+
arrow = _props$arrow === void 0 ? true : _props$arrow,
|
|
6059
6096
|
_props$boundaryElemen = props.boundaryElement,
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
_props$constrainSize = props.constrainSize,
|
|
6063
|
-
constrainSize = _props$constrainSize === void 0 ? false : _props$constrainSize,
|
|
6097
|
+
boundaryElementProp = _props$boundaryElemen === void 0 ? boundaryElementContext.element : _props$boundaryElemen,
|
|
6098
|
+
child = props.children,
|
|
6064
6099
|
content = props.content,
|
|
6100
|
+
constrainSize = props.constrainSize,
|
|
6065
6101
|
disabled = props.disabled,
|
|
6066
6102
|
fallbackPlacements = props.fallbackPlacements,
|
|
6067
|
-
|
|
6068
|
-
open =
|
|
6069
|
-
|
|
6070
|
-
overflow = _props$overflow === void 0 ? props.constrainSize ? 'auto' : undefined : _props$overflow,
|
|
6071
|
-
paddingProp = props.padding,
|
|
6103
|
+
_props$open = props.open,
|
|
6104
|
+
open = _props$open === void 0 ? false : _props$open,
|
|
6105
|
+
padding = props.padding,
|
|
6072
6106
|
_props$placement = props.placement,
|
|
6073
|
-
|
|
6074
|
-
portal = props.portal,
|
|
6075
|
-
_props$
|
|
6076
|
-
preventOverflow =
|
|
6107
|
+
placement = _props$placement === void 0 ? 'bottom' : _props$placement,
|
|
6108
|
+
_props$portal = props.portal,
|
|
6109
|
+
portalProp = _props$portal === void 0 ? false : _props$portal,
|
|
6110
|
+
preventOverflow = props.preventOverflow,
|
|
6077
6111
|
_props$radius = props.radius,
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6112
|
+
radius = _props$radius === void 0 ? 3 : _props$radius,
|
|
6113
|
+
referenceElementProp = props.referenceElement,
|
|
6114
|
+
matchReferenceWidth = props.matchReferenceWidth,
|
|
6081
6115
|
_props$shadow = props.shadow,
|
|
6082
|
-
|
|
6116
|
+
shadow = _props$shadow === void 0 ? 3 : _props$shadow,
|
|
6117
|
+
scheme = props.scheme,
|
|
6118
|
+
_props$style = props.style,
|
|
6119
|
+
style = _props$style === void 0 ? EMPTY_RECORD : _props$style,
|
|
6120
|
+
tether = props.tether,
|
|
6121
|
+
tetherOffset = props.tetherOffset,
|
|
6083
6122
|
_props$tone = props.tone,
|
|
6084
6123
|
tone = _props$tone === void 0 ? 'inherit' : _props$tone,
|
|
6085
6124
|
_props$width = props.width,
|
|
6086
|
-
widthProp = _props$width === void 0 ?
|
|
6125
|
+
widthProp = _props$width === void 0 ? 0 : _props$width,
|
|
6087
6126
|
_props$zOffset = props.zOffset,
|
|
6088
|
-
|
|
6127
|
+
zOffset = _props$zOffset === void 0 ? (_theme$sanity$layer = theme.sanity.layer) == null ? void 0 : _theme$sanity$layer.popover.zOffset : _props$zOffset,
|
|
6089
6128
|
restProps = _objectWithoutPropertiesLoose(props, _excluded$n);
|
|
6090
6129
|
|
|
6091
|
-
var boundarySize = (_useElementSize = useElementSize(boundaryElement)) == null ? void 0 : _useElementSize.border;
|
|
6092
|
-
var padding = useArrayProp(paddingProp);
|
|
6093
|
-
var radius = useArrayProp(radiusProp);
|
|
6094
|
-
var shadow = useArrayProp(shadowProp);
|
|
6095
|
-
var width = useArrayProp(widthProp);
|
|
6096
|
-
var zOffset = useArrayProp(zOffsetProp);
|
|
6097
|
-
|
|
6098
|
-
var _useState = useState(undefined),
|
|
6099
|
-
availableWidth = _useState[0],
|
|
6100
|
-
setAvailableWidth = _useState[1];
|
|
6101
|
-
|
|
6102
|
-
var _useState2 = useState(undefined),
|
|
6103
|
-
availableHeight = _useState2[0],
|
|
6104
|
-
setAvailableHeight = _useState2[1];
|
|
6105
|
-
|
|
6106
|
-
var _useState3 = useState(undefined),
|
|
6107
|
-
referenceWidth = _useState3[0],
|
|
6108
|
-
setReferenceWidth = _useState3[1];
|
|
6109
|
-
|
|
6110
6130
|
var forwardedRef = useForwardedRef(ref);
|
|
6111
|
-
var
|
|
6112
|
-
var rootBoundary = 'viewport';
|
|
6113
|
-
var middleware = useMemo(function () {
|
|
6114
|
-
var ret = []; // Flip the floating element when leaving the boundary box
|
|
6115
|
-
|
|
6116
|
-
if (constrainSize || preventOverflow) {
|
|
6117
|
-
ret.push(flip({
|
|
6118
|
-
boundary: boundaryElement || undefined,
|
|
6119
|
-
fallbackPlacements: fallbackPlacements,
|
|
6120
|
-
padding: 8,
|
|
6121
|
-
rootBoundary: rootBoundary
|
|
6122
|
-
}));
|
|
6123
|
-
} // Track sizes
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
ret.push(size({
|
|
6127
|
-
boundaryElement: boundaryElement,
|
|
6128
|
-
constrainSize: constrainSize,
|
|
6129
|
-
matchReferenceWidth: matchReferenceWidthProp,
|
|
6130
|
-
setAvailableHeight: setAvailableHeight,
|
|
6131
|
-
setAvailableWidth: setAvailableWidth,
|
|
6132
|
-
setReferenceWidth: setReferenceWidth
|
|
6133
|
-
})); // Define distance between reference and floating element
|
|
6134
|
-
|
|
6135
|
-
ret.push(offset({
|
|
6136
|
-
mainAxis: arrowProp ? 4 : 0
|
|
6137
|
-
})); // Shift the popover so its sits with the boundary eleement
|
|
6138
|
-
|
|
6139
|
-
if (preventOverflow) {
|
|
6140
|
-
ret.push(shift({
|
|
6141
|
-
boundary: boundaryElement || undefined,
|
|
6142
|
-
rootBoundary: rootBoundary,
|
|
6143
|
-
padding: 8
|
|
6144
|
-
}));
|
|
6145
|
-
} // Place arrow
|
|
6131
|
+
var portal = usePortal();
|
|
6146
6132
|
|
|
6133
|
+
var _useState = useState(null),
|
|
6134
|
+
referenceElement = _useState[0],
|
|
6135
|
+
setReferenceElement = _useState[1];
|
|
6147
6136
|
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
padding: 4
|
|
6152
|
-
}));
|
|
6153
|
-
}
|
|
6137
|
+
var _useState2 = useState(null),
|
|
6138
|
+
popperElement = _useState2[0],
|
|
6139
|
+
setPopperElement = _useState2[1];
|
|
6154
6140
|
|
|
6155
|
-
|
|
6156
|
-
|
|
6141
|
+
var _useState3 = useState(null),
|
|
6142
|
+
arrowElement = _useState3[0],
|
|
6143
|
+
setArrowElement = _useState3[1];
|
|
6157
6144
|
|
|
6158
|
-
var
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
}
|
|
6176
|
-
var
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
}
|
|
6180
|
-
var
|
|
6181
|
-
|
|
6182
|
-
|
|
6145
|
+
var popperReferenceElement = referenceElementProp || referenceElement;
|
|
6146
|
+
var width = useArrayProp(widthProp);
|
|
6147
|
+
var modifiers = usePopoverModifiers({
|
|
6148
|
+
allowedAutoPlacements: allowedAutoPlacements,
|
|
6149
|
+
arrow: arrow,
|
|
6150
|
+
arrowElement: arrowElement,
|
|
6151
|
+
boundaryElement: boundaryElementProp || portal.boundaryElement,
|
|
6152
|
+
constrainSize: constrainSize,
|
|
6153
|
+
distance: arrow ? 4 : 0,
|
|
6154
|
+
fallbackPlacements: fallbackPlacements,
|
|
6155
|
+
margins: margins,
|
|
6156
|
+
matchReferenceWidth: matchReferenceWidth,
|
|
6157
|
+
open: open,
|
|
6158
|
+
preventOverflow: preventOverflow,
|
|
6159
|
+
skidding: 0,
|
|
6160
|
+
tether: tether,
|
|
6161
|
+
tetherOffset: tetherOffset
|
|
6162
|
+
});
|
|
6163
|
+
var popper = usePopper(popperReferenceElement, popperElement, {
|
|
6164
|
+
placement: placement,
|
|
6165
|
+
modifiers: modifiers
|
|
6166
|
+
});
|
|
6167
|
+
var attributes = popper.attributes,
|
|
6168
|
+
forceUpdate = popper.forceUpdate,
|
|
6169
|
+
styles = popper.styles;
|
|
6170
|
+
var setRef = useCallback(function (el) {
|
|
6171
|
+
var childRef = child.ref;
|
|
6172
|
+
setReferenceElement(el);
|
|
6183
6173
|
|
|
6184
6174
|
if (typeof childRef === 'function') {
|
|
6185
|
-
childRef(
|
|
6175
|
+
childRef(el);
|
|
6186
6176
|
} else if (childRef) {
|
|
6187
|
-
childRef.current =
|
|
6177
|
+
childRef.current = el;
|
|
6188
6178
|
}
|
|
6189
|
-
}, [
|
|
6190
|
-
var
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6179
|
+
}, [child]);
|
|
6180
|
+
var setRootRef = useCallback(function (el) {
|
|
6181
|
+
setPopperElement(el);
|
|
6182
|
+
forwardedRef.current = el;
|
|
6183
|
+
}, [forwardedRef]);
|
|
6184
|
+
var popoverStyle = useMemo(function () {
|
|
6185
|
+
return _extends({}, style, styles.popper);
|
|
6186
|
+
}, [style, styles]);
|
|
6196
6187
|
useEffect(function () {
|
|
6197
|
-
if (
|
|
6198
|
-
|
|
6188
|
+
if (forceUpdate) {
|
|
6189
|
+
try {
|
|
6190
|
+
forceUpdate();
|
|
6191
|
+
} catch (_) {// ignore caught error
|
|
6192
|
+
}
|
|
6193
|
+
}
|
|
6194
|
+
}, [content, forceUpdate, open, popperReferenceElement]);
|
|
6199
6195
|
|
|
6200
6196
|
if (disabled) {
|
|
6201
|
-
return
|
|
6197
|
+
return child || /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
6202
6198
|
}
|
|
6203
6199
|
|
|
6204
|
-
var
|
|
6200
|
+
var node = /*#__PURE__*/React.createElement(Root$i, _extends({
|
|
6201
|
+
"data-ui": "Popover"
|
|
6202
|
+
}, restProps, {
|
|
6203
|
+
"$preventOverflow": preventOverflow,
|
|
6204
|
+
ref: setRootRef,
|
|
6205
|
+
style: popoverStyle,
|
|
6205
6206
|
zOffset: zOffset
|
|
6206
|
-
}, /*#__PURE__*/React.createElement(PopoverCard,
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
arrowX: arrowX,
|
|
6211
|
-
arrowY: arrowY,
|
|
6212
|
-
availableWidth: constrainSize ? availableWidth : undefined,
|
|
6213
|
-
availableHeight: constrainSize ? availableHeight : undefined,
|
|
6214
|
-
boundaryWidth: boundarySize == null ? void 0 : boundarySize.width,
|
|
6215
|
-
overflow: overflow,
|
|
6207
|
+
}, attributes.popper), /*#__PURE__*/React.createElement(PopoverCard, {
|
|
6208
|
+
"$constrainSize": constrainSize,
|
|
6209
|
+
"$width": width,
|
|
6210
|
+
"data-ui": "PopoverCard",
|
|
6216
6211
|
padding: padding,
|
|
6217
|
-
placement: placement,
|
|
6218
6212
|
radius: radius,
|
|
6219
|
-
ref: setFloating,
|
|
6220
|
-
referenceWidth: matchReferenceWidthProp ? referenceWidth : undefined,
|
|
6221
6213
|
scheme: scheme,
|
|
6222
6214
|
shadow: shadow,
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
width: width
|
|
6215
|
+
tone: tone
|
|
6216
|
+
}, arrow && /*#__PURE__*/React.createElement(PopoverArrow, {
|
|
6217
|
+
ref: setArrowElement,
|
|
6218
|
+
style: styles.arrow
|
|
6228
6219
|
}), content));
|
|
6229
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
6230
|
-
|
|
6231
|
-
}
|
|
6232
|
-
|
|
6233
|
-
|
|
6220
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, child && !referenceElementProp ? /*#__PURE__*/cloneElement(child, {
|
|
6221
|
+
ref: setRef
|
|
6222
|
+
}) : child || /*#__PURE__*/React.createElement(React.Fragment, null), open && /*#__PURE__*/React.createElement(React.Fragment, null, portalProp && /*#__PURE__*/React.createElement(Portal, {
|
|
6223
|
+
__unstable_name: typeof portalProp === 'string' ? portalProp : undefined
|
|
6224
|
+
}, node), !portalProp && node));
|
|
6225
|
+
});
|
|
6234
6226
|
|
|
6235
6227
|
var _templateObject$i, _templateObject2$d;
|
|
6236
6228
|
function radioBaseStyle() {
|
|
@@ -6772,15 +6764,13 @@ var TextInput = /*#__PURE__*/forwardRef(function TextInput(props, forwardedRef)
|
|
|
6772
6764
|
});
|
|
6773
6765
|
|
|
6774
6766
|
var _templateObject$d, _templateObject2$9, _templateObject3$4;
|
|
6775
|
-
var Root$b = styled.div(_templateObject$d || (_templateObject$d = _taggedTemplateLiteralLoose(["\n position: absolute;\n
|
|
6767
|
+
var Root$b = styled.div(_templateObject$d || (_templateObject$d = _taggedTemplateLiteralLoose(["\n position: absolute;\n width: 15px;\n height: 15px;\n fill: none;\n\n :empty + & {\n display: none;\n }\n\n & > svg {\n &:not([hidden]) {\n display: block;\n }\n transform-origin: 7.5px 7.5px;\n }\n\n [data-popper-placement^='top'] > div > & {\n bottom: -15px;\n }\n\n [data-popper-placement^='right'] > div > & {\n left: -15px;\n\n & > svg {\n transform: rotate(90deg);\n }\n }\n\n [data-popper-placement^='left'] > div > & {\n right: -15px;\n\n & > svg {\n transform: rotate(-90deg);\n }\n }\n\n [data-popper-placement^='bottom'] > div > & {\n top: -15px;\n\n & > svg {\n transform: rotate(180deg);\n }\n }\n"])));
|
|
6776
6768
|
var Border = styled.path(_templateObject2$9 || (_templateObject2$9 = _taggedTemplateLiteralLoose(["\n fill: var(--card-shadow-outline-color);\n"])));
|
|
6777
6769
|
var Shape = styled.path(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteralLoose(["\n fill: var(--card-bg-color);\n"])));
|
|
6778
6770
|
var TooltipArrow = /*#__PURE__*/forwardRef(function TooltipArrow(props, ref) {
|
|
6779
6771
|
var restProps = _extends({}, props);
|
|
6780
6772
|
|
|
6781
|
-
return /*#__PURE__*/React.createElement(Root$b, _extends({
|
|
6782
|
-
"data-ui": "Tooltip__arrow"
|
|
6783
|
-
}, restProps, {
|
|
6773
|
+
return /*#__PURE__*/React.createElement(Root$b, _extends({}, restProps, {
|
|
6784
6774
|
ref: ref
|
|
6785
6775
|
}), /*#__PURE__*/React.createElement("svg", {
|
|
6786
6776
|
width: "15",
|
|
@@ -6793,7 +6783,7 @@ var TooltipArrow = /*#__PURE__*/forwardRef(function TooltipArrow(props, ref) {
|
|
|
6793
6783
|
})));
|
|
6794
6784
|
});
|
|
6795
6785
|
|
|
6796
|
-
var _excluded$g = ["boundaryElement", "children", "content", "disabled", "fallbackPlacements", "placement", "portal", "scheme", "
|
|
6786
|
+
var _excluded$g = ["allowedAutoPlacements", "boundaryElement", "children", "content", "disabled", "fallbackPlacements", "placement", "portal", "scheme", "zOffset"];
|
|
6797
6787
|
|
|
6798
6788
|
var _templateObject$c;
|
|
6799
6789
|
var Root$a = styled(Layer)(_templateObject$c || (_templateObject$c = _taggedTemplateLiteralLoose(["\n pointer-events: none;\n"])));
|
|
@@ -6802,23 +6792,22 @@ var Root$a = styled(Layer)(_templateObject$c || (_templateObject$c = _taggedTemp
|
|
|
6802
6792
|
*/
|
|
6803
6793
|
|
|
6804
6794
|
var Tooltip = /*#__PURE__*/forwardRef(function Tooltip(props, ref) {
|
|
6805
|
-
var _theme$sanity$layer
|
|
6795
|
+
var _theme$sanity$layer;
|
|
6806
6796
|
|
|
6807
6797
|
var boundaryElementContext = useBoundaryElement();
|
|
6808
6798
|
var theme = useTheme();
|
|
6809
6799
|
|
|
6810
|
-
var
|
|
6800
|
+
var allowedAutoPlacements = props.allowedAutoPlacements,
|
|
6801
|
+
_props$boundaryElemen = props.boundaryElement,
|
|
6811
6802
|
boundaryElement = _props$boundaryElemen === void 0 ? boundaryElementContext == null ? void 0 : boundaryElementContext.element : _props$boundaryElemen,
|
|
6812
|
-
|
|
6803
|
+
children = props.children,
|
|
6813
6804
|
content = props.content,
|
|
6814
6805
|
disabled = props.disabled,
|
|
6815
6806
|
fallbackPlacementsProp = props.fallbackPlacements,
|
|
6816
6807
|
_props$placement = props.placement,
|
|
6817
|
-
|
|
6808
|
+
placement = _props$placement === void 0 ? 'bottom' : _props$placement,
|
|
6818
6809
|
portal = props.portal,
|
|
6819
6810
|
scheme = props.scheme,
|
|
6820
|
-
_props$shadow = props.shadow,
|
|
6821
|
-
shadow = _props$shadow === void 0 ? 2 : _props$shadow,
|
|
6822
6811
|
_props$zOffset = props.zOffset,
|
|
6823
6812
|
zOffset = _props$zOffset === void 0 ? (_theme$sanity$layer = theme.sanity.layer) == null ? void 0 : _theme$sanity$layer.tooltip.zOffset : _props$zOffset,
|
|
6824
6813
|
restProps = _objectWithoutPropertiesLoose(props, _excluded$g);
|
|
@@ -6830,73 +6819,47 @@ var Tooltip = /*#__PURE__*/forwardRef(function Tooltip(props, ref) {
|
|
|
6830
6819
|
referenceElement = _useState[0],
|
|
6831
6820
|
setReferenceElement = _useState[1];
|
|
6832
6821
|
|
|
6833
|
-
var
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
var ret = []; // Flip the floating element when leaving the boundary box
|
|
6837
|
-
|
|
6838
|
-
ret.push(flip({
|
|
6839
|
-
boundary: boundaryElement || undefined,
|
|
6840
|
-
fallbackPlacements: fallbackPlacements,
|
|
6841
|
-
padding: 4,
|
|
6842
|
-
rootBoundary: rootBoundary
|
|
6843
|
-
})); // Define distance between reference and floating element
|
|
6844
|
-
|
|
6845
|
-
ret.push(offset({
|
|
6846
|
-
mainAxis: 3
|
|
6847
|
-
})); // Shift the tooltip so its sits with the boundary eleement
|
|
6848
|
-
|
|
6849
|
-
ret.push(shift({
|
|
6850
|
-
boundary: boundaryElement || undefined,
|
|
6851
|
-
rootBoundary: rootBoundary,
|
|
6852
|
-
padding: 4
|
|
6853
|
-
})); // Place arrow
|
|
6822
|
+
var _useState2 = useState(null),
|
|
6823
|
+
popperElement = _useState2[0],
|
|
6824
|
+
setPopperElement = _useState2[1];
|
|
6854
6825
|
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
}));
|
|
6859
|
-
return ret;
|
|
6860
|
-
}, [boundaryElement, fallbackPlacements]);
|
|
6826
|
+
var _useState3 = useState(null),
|
|
6827
|
+
arrowElement = _useState3[0],
|
|
6828
|
+
setArrowElement = _useState3[1];
|
|
6861
6829
|
|
|
6862
|
-
var
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
bottom: undefined
|
|
6892
|
-
};
|
|
6893
|
-
if (staticSide) style[staticSide] = -15;
|
|
6894
|
-
return style;
|
|
6895
|
-
}, [arrowX, arrowY, staticSide]);
|
|
6830
|
+
var popper = usePopper(referenceElement, popperElement, {
|
|
6831
|
+
placement: placement,
|
|
6832
|
+
modifiers: [{
|
|
6833
|
+
name: 'arrow',
|
|
6834
|
+
options: {
|
|
6835
|
+
element: arrowElement,
|
|
6836
|
+
padding: 4
|
|
6837
|
+
}
|
|
6838
|
+
}, {
|
|
6839
|
+
name: 'preventOverflow',
|
|
6840
|
+
options: {
|
|
6841
|
+
altAxis: true,
|
|
6842
|
+
boundary: boundaryElement || undefined,
|
|
6843
|
+
padding: 4
|
|
6844
|
+
}
|
|
6845
|
+
}, {
|
|
6846
|
+
name: 'offset',
|
|
6847
|
+
options: {
|
|
6848
|
+
offset: [0, 3]
|
|
6849
|
+
}
|
|
6850
|
+
}, {
|
|
6851
|
+
name: 'flip',
|
|
6852
|
+
options: {
|
|
6853
|
+
allowedAutoPlacements: allowedAutoPlacements,
|
|
6854
|
+
fallbackPlacements: fallbackPlacements
|
|
6855
|
+
}
|
|
6856
|
+
}]
|
|
6857
|
+
});
|
|
6858
|
+
var forceUpdate = popper.forceUpdate;
|
|
6896
6859
|
|
|
6897
|
-
var
|
|
6898
|
-
isOpen =
|
|
6899
|
-
setIsOpen =
|
|
6860
|
+
var _useState4 = useState(false),
|
|
6861
|
+
isOpen = _useState4[0],
|
|
6862
|
+
setIsOpen = _useState4[1];
|
|
6900
6863
|
|
|
6901
6864
|
var handleBlur = useCallback(function () {
|
|
6902
6865
|
return setIsOpen(false);
|
|
@@ -6930,7 +6893,15 @@ var Tooltip = /*#__PURE__*/forwardRef(function Tooltip(props, ref) {
|
|
|
6930
6893
|
return function () {
|
|
6931
6894
|
window.removeEventListener('mousemove', handleWindowMouseMove);
|
|
6932
6895
|
};
|
|
6933
|
-
}, [isOpen, referenceElement]);
|
|
6896
|
+
}, [isOpen, referenceElement]);
|
|
6897
|
+
useEffect(function () {
|
|
6898
|
+
if (forceUpdate) {
|
|
6899
|
+
try {
|
|
6900
|
+
forceUpdate();
|
|
6901
|
+
} catch (_) {// ignore caught error
|
|
6902
|
+
}
|
|
6903
|
+
}
|
|
6904
|
+
}, [forceUpdate, content]); // Close when `disabled` changes to `true`
|
|
6934
6905
|
|
|
6935
6906
|
useEffect(function () {
|
|
6936
6907
|
if (disabled) setIsOpen(false);
|
|
@@ -6938,61 +6909,40 @@ var Tooltip = /*#__PURE__*/forwardRef(function Tooltip(props, ref) {
|
|
|
6938
6909
|
|
|
6939
6910
|
useEffect(function () {
|
|
6940
6911
|
if (!content) setIsOpen(false);
|
|
6941
|
-
}, [content]);
|
|
6912
|
+
}, [content]);
|
|
6942
6913
|
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
var
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
|
|
6957
|
-
|
|
6958
|
-
|
|
6959
|
-
childRef.current = node;
|
|
6960
|
-
} // childRef.current = node
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
setReferenceElement(node);
|
|
6964
|
-
}, [childRef]);
|
|
6965
|
-
var child = useMemo(function () {
|
|
6966
|
-
if (!childProp) return null;
|
|
6967
|
-
return /*#__PURE__*/cloneElement(childProp, {
|
|
6968
|
-
onBlur: handleBlur,
|
|
6969
|
-
onFocus: handleFocus,
|
|
6970
|
-
onMouseEnter: handleMouseEnter,
|
|
6971
|
-
onMouseLeave: handleMouseLeave,
|
|
6972
|
-
ref: setReference
|
|
6973
|
-
});
|
|
6974
|
-
}, [childProp, handleBlur, handleFocus, handleMouseEnter, handleMouseLeave, setReference]);
|
|
6975
|
-
if (!child) return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
6976
|
-
if (disabled) return child;
|
|
6977
|
-
var root = /*#__PURE__*/React.createElement(Root$a, _extends({
|
|
6914
|
+
var setRef = function setRef(el) {
|
|
6915
|
+
setPopperElement(el);
|
|
6916
|
+
forwardedRef.current = el;
|
|
6917
|
+
};
|
|
6918
|
+
|
|
6919
|
+
if (!children) return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
6920
|
+
if (disabled) return children;
|
|
6921
|
+
var referenceProps = {
|
|
6922
|
+
onBlur: handleBlur,
|
|
6923
|
+
onFocus: handleFocus,
|
|
6924
|
+
onMouseEnter: handleMouseEnter,
|
|
6925
|
+
onMouseLeave: handleMouseLeave,
|
|
6926
|
+
ref: setReferenceElement
|
|
6927
|
+
};
|
|
6928
|
+
var referenceNode = /*#__PURE__*/cloneElement(children, referenceProps);
|
|
6929
|
+
var popperNode = /*#__PURE__*/React.createElement(Root$a, _extends({
|
|
6978
6930
|
"data-ui": "Tooltip"
|
|
6979
|
-
}, restProps, {
|
|
6980
|
-
ref:
|
|
6981
|
-
style:
|
|
6931
|
+
}, restProps, popper.attributes.popper, {
|
|
6932
|
+
ref: setRef,
|
|
6933
|
+
style: popper.styles.popper,
|
|
6982
6934
|
zOffset: zOffset
|
|
6983
6935
|
}), /*#__PURE__*/React.createElement(Card, {
|
|
6984
|
-
"data-ui": "Tooltip__card",
|
|
6985
|
-
"data-placement": placement,
|
|
6986
6936
|
radius: 2,
|
|
6987
6937
|
scheme: scheme,
|
|
6988
|
-
shadow:
|
|
6938
|
+
shadow: 3
|
|
6989
6939
|
}, content, /*#__PURE__*/React.createElement(TooltipArrow, {
|
|
6990
|
-
ref:
|
|
6991
|
-
style:
|
|
6940
|
+
ref: setArrowElement,
|
|
6941
|
+
style: popper.styles.arrow
|
|
6992
6942
|
})));
|
|
6993
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
6943
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, referenceNode, isOpen && /*#__PURE__*/React.createElement(React.Fragment, null, portal && /*#__PURE__*/React.createElement(Portal, {
|
|
6994
6944
|
__unstable_name: typeof portal === 'string' ? portal : undefined
|
|
6995
|
-
},
|
|
6945
|
+
}, popperNode), !portal && popperNode));
|
|
6996
6946
|
});
|
|
6997
6947
|
|
|
6998
6948
|
var _templateObject$b, _templateObject2$8, _templateObject3$3, _templateObject4$2, _templateObject5$1;
|
|
@@ -7010,7 +6960,7 @@ var ListBox = styled(Box)(_templateObject2$8 || (_templateObject2$8 = _taggedTem
|
|
|
7010
6960
|
* @internal
|
|
7011
6961
|
*/
|
|
7012
6962
|
|
|
7013
|
-
var ResultsPopover = styled(Popover)(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteralLoose(["\n &[data-popper-reference-hidden='true'] {\n display: none;\n }\n"])));
|
|
6963
|
+
var ResultsPopover = styled(Popover)(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteralLoose(["\n & > div {\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n }\n\n &[data-popper-reference-hidden='true'] {\n display: none;\n }\n"])));
|
|
7014
6964
|
var rotate = keyframes(_templateObject4$2 || (_templateObject4$2 = _taggedTemplateLiteralLoose(["\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n"])));
|
|
7015
6965
|
/**
|
|
7016
6966
|
* @internal
|
|
@@ -7126,17 +7076,17 @@ var AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ['Control', 'Shift', 'Alt', 'Enter', 'Hom
|
|
|
7126
7076
|
* @internal
|
|
7127
7077
|
*/
|
|
7128
7078
|
|
|
7129
|
-
var AUTOCOMPLETE_POPOVER_MARGINS = [0, 1,
|
|
7079
|
+
var AUTOCOMPLETE_POPOVER_MARGINS = [0, 1, 1, 1];
|
|
7130
7080
|
/**
|
|
7131
7081
|
* @internal
|
|
7132
7082
|
*/
|
|
7133
7083
|
|
|
7134
|
-
var AUTOCOMPLETE_POPOVER_PLACEMENT = 'bottom';
|
|
7084
|
+
var AUTOCOMPLETE_POPOVER_PLACEMENT = 'bottom-start';
|
|
7135
7085
|
/**
|
|
7136
7086
|
* @internal
|
|
7137
7087
|
*/
|
|
7138
7088
|
|
|
7139
|
-
var AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ['
|
|
7089
|
+
var AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ['top-start'];
|
|
7140
7090
|
|
|
7141
7091
|
var _excluded$f = ["border", "customValidity", "disabled", "filterOption", "fontSize", "icon", "id", "listBox", "loading", "onBlur", "onChange", "onFocus", "onQueryChange", "onSelect", "openButton", "options", "padding", "popover", "prefix", "radius", "readOnly", "relatedElements", "renderOption", "renderPopover", "renderValue", "suffix", "value"];
|
|
7142
7092
|
|