@sanity/ui 0.37.14-next.5 → 0.37.15
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 +456 -489
- package/lib/sanity-ui.js.map +1 -1
- package/lib/sanity-ui.modern.mjs +571 -561
- package/lib/sanity-ui.modern.mjs.map +1 -1
- package/lib/sanity-ui.module.js +456 -490
- package/lib/sanity-ui.module.js.map +1 -1
- package/package.json +7 -6
- 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 +196 -229
- package/src/primitives/tooltip/__workshop__/props.tsx +4 -5
- package/src/primitives/tooltip/tooltip.tsx +92 -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.modern.mjs
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() {
|
|
@@ -43,25 +44,8 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
43
44
|
return target;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
/**
|
|
47
|
-
* @internal
|
|
48
|
-
*/
|
|
49
47
|
const EMPTY_ARRAY = [];
|
|
50
|
-
/**
|
|
51
|
-
* @internal
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
48
|
const EMPTY_RECORD = {};
|
|
55
|
-
/**
|
|
56
|
-
* @internal
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
const FLOATING_STATIC_SIDES = {
|
|
60
|
-
top: 'bottom',
|
|
61
|
-
right: 'left',
|
|
62
|
-
bottom: 'top',
|
|
63
|
-
left: 'right'
|
|
64
|
-
};
|
|
65
49
|
|
|
66
50
|
/**
|
|
67
51
|
* @internal
|
|
@@ -2853,7 +2837,7 @@ globalScope[key$7] = globalScope[key$7] || /*#__PURE__*/createContext(null);
|
|
|
2853
2837
|
|
|
2854
2838
|
const ThemeContext = globalScope[key$7];
|
|
2855
2839
|
|
|
2856
|
-
const _excluded$
|
|
2840
|
+
const _excluded$H = ["color", "layer"];
|
|
2857
2841
|
/**
|
|
2858
2842
|
* @public
|
|
2859
2843
|
*/
|
|
@@ -2873,7 +2857,7 @@ function ThemeProvider(props) {
|
|
|
2873
2857
|
color: rootColor,
|
|
2874
2858
|
layer: rootLayer
|
|
2875
2859
|
} = themeProp,
|
|
2876
|
-
restTheme = _objectWithoutPropertiesLoose(themeProp, _excluded$
|
|
2860
|
+
restTheme = _objectWithoutPropertiesLoose(themeProp, _excluded$H);
|
|
2877
2861
|
|
|
2878
2862
|
const colorScheme = rootColor[scheme] || rootColor.light;
|
|
2879
2863
|
const color = colorScheme[tone] || colorScheme.default;
|
|
@@ -3667,11 +3651,11 @@ function responsiveInputPaddingIconRightStyle(props) {
|
|
|
3667
3651
|
}));
|
|
3668
3652
|
}
|
|
3669
3653
|
|
|
3670
|
-
let _$
|
|
3671
|
-
_t$
|
|
3672
|
-
_t2$
|
|
3673
|
-
_t3$
|
|
3674
|
-
const ROOT_STYLE = css(_t$
|
|
3654
|
+
let _$B = t => t,
|
|
3655
|
+
_t$D,
|
|
3656
|
+
_t2$n,
|
|
3657
|
+
_t3$e;
|
|
3658
|
+
const ROOT_STYLE = css(_t$D || (_t$D = _$B`
|
|
3675
3659
|
&:not([hidden]) {
|
|
3676
3660
|
display: flex;
|
|
3677
3661
|
}
|
|
@@ -3689,7 +3673,7 @@ function textInputBaseStyle(props) {
|
|
|
3689
3673
|
} = props;
|
|
3690
3674
|
const font = theme.sanity.fonts.text;
|
|
3691
3675
|
const color = theme.sanity.color.input;
|
|
3692
|
-
return css(_t2$
|
|
3676
|
+
return css(_t2$n || (_t2$n = _$B`
|
|
3693
3677
|
appearance: none;
|
|
3694
3678
|
background: none;
|
|
3695
3679
|
border: 0;
|
|
@@ -3784,7 +3768,7 @@ function textInputRepresentationStyle(props) {
|
|
|
3784
3768
|
input
|
|
3785
3769
|
} = theme.sanity;
|
|
3786
3770
|
const color = theme.sanity.color.input;
|
|
3787
|
-
return css(_t3$
|
|
3771
|
+
return css(_t3$e || (_t3$e = _$B`
|
|
3788
3772
|
--input-box-shadow: none;
|
|
3789
3773
|
|
|
3790
3774
|
position: absolute;
|
|
@@ -3924,10 +3908,10 @@ function responsiveShadowStyle(props) {
|
|
|
3924
3908
|
return _responsive(media, props.$shadow, shadow => shadowStyle(shadows[shadow]));
|
|
3925
3909
|
}
|
|
3926
3910
|
|
|
3927
|
-
let _$
|
|
3928
|
-
_t$
|
|
3929
|
-
_t2$
|
|
3930
|
-
_t3$
|
|
3911
|
+
let _$A = t => t,
|
|
3912
|
+
_t$C,
|
|
3913
|
+
_t2$m,
|
|
3914
|
+
_t3$d;
|
|
3931
3915
|
function textBaseStyle(props) {
|
|
3932
3916
|
const {
|
|
3933
3917
|
$accent,
|
|
@@ -3937,7 +3921,7 @@ function textBaseStyle(props) {
|
|
|
3937
3921
|
const {
|
|
3938
3922
|
weights
|
|
3939
3923
|
} = theme.sanity.fonts.text;
|
|
3940
|
-
return css(_t$
|
|
3924
|
+
return css(_t$C || (_t$C = _$A`
|
|
3941
3925
|
color: var(--card-fg-color);
|
|
3942
3926
|
|
|
3943
3927
|
${0}
|
|
@@ -3979,19 +3963,19 @@ function textBaseStyle(props) {
|
|
|
3979
3963
|
& [data-sanity-icon] {
|
|
3980
3964
|
vertical-align: baseline;
|
|
3981
3965
|
}
|
|
3982
|
-
`), $accent && css(_t2$
|
|
3966
|
+
`), $accent && css(_t2$m || (_t2$m = _$A`
|
|
3983
3967
|
color: var(--card-accent-fg-color);
|
|
3984
|
-
`)), $muted && css(_t3$
|
|
3968
|
+
`)), $muted && css(_t3$d || (_t3$d = _$A`
|
|
3985
3969
|
color: var(--card-muted-fg-color);
|
|
3986
3970
|
`)), theme.sanity.fonts.code.family, weights.bold);
|
|
3987
3971
|
}
|
|
3988
3972
|
|
|
3989
|
-
const _excluded$
|
|
3973
|
+
const _excluded$G = ["accent", "align", "children", "muted", "size", "textOverflow", "weight"];
|
|
3990
3974
|
|
|
3991
|
-
let _$
|
|
3992
|
-
_t$
|
|
3975
|
+
let _$z = t => t,
|
|
3976
|
+
_t$B;
|
|
3993
3977
|
const Root$E = styled.div(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle);
|
|
3994
|
-
const SpanWithTextOverflow$2 = styled.span(_t$
|
|
3978
|
+
const SpanWithTextOverflow$2 = styled.span(_t$B || (_t$B = _$z`
|
|
3995
3979
|
display: block;
|
|
3996
3980
|
white-space: nowrap;
|
|
3997
3981
|
text-overflow: ellipsis;
|
|
@@ -4011,7 +3995,7 @@ const Text = /*#__PURE__*/forwardRef(function Text(props, ref) {
|
|
|
4011
3995
|
textOverflow,
|
|
4012
3996
|
weight
|
|
4013
3997
|
} = props,
|
|
4014
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
3998
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$G);
|
|
4015
3999
|
|
|
4016
4000
|
let children = childrenProp;
|
|
4017
4001
|
|
|
@@ -4182,7 +4166,7 @@ function avatarStrokeStyle() {
|
|
|
4182
4166
|
};
|
|
4183
4167
|
}
|
|
4184
4168
|
|
|
4185
|
-
const _excluded$
|
|
4169
|
+
const _excluded$F = ["as", "color", "src", "title", "initials", "onImageLoadError", "arrowPosition", "animateArrowFrom", "status", "size"];
|
|
4186
4170
|
const Root$D = styled.div(responsiveAvatarSizeStyle, avatarStyle.root);
|
|
4187
4171
|
const Arrow = styled.div(avatarStyle.arrow);
|
|
4188
4172
|
const BgStroke = styled.ellipse(avatarStyle.bgStroke);
|
|
@@ -4205,7 +4189,7 @@ const Avatar = /*#__PURE__*/forwardRef(function Avatar(props, ref) {
|
|
|
4205
4189
|
status = 'online',
|
|
4206
4190
|
size: sizeProp = 0
|
|
4207
4191
|
} = props,
|
|
4208
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4192
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$F);
|
|
4209
4193
|
|
|
4210
4194
|
const as = ReactIs.isValidElementType(asProp) ? asProp : 'div';
|
|
4211
4195
|
const size = useArrayProp(sizeProp);
|
|
@@ -4295,8 +4279,8 @@ const Avatar = /*#__PURE__*/forwardRef(function Avatar(props, ref) {
|
|
|
4295
4279
|
}, /*#__PURE__*/React.createElement("strong", null, initials)))));
|
|
4296
4280
|
});
|
|
4297
4281
|
|
|
4298
|
-
let _$
|
|
4299
|
-
_t$
|
|
4282
|
+
let _$y = t => t,
|
|
4283
|
+
_t$A;
|
|
4300
4284
|
|
|
4301
4285
|
function _responsiveAvatarCounterSizeStyle(props) {
|
|
4302
4286
|
const {
|
|
@@ -4321,7 +4305,7 @@ function _avatarCounterBaseStyle(props) {
|
|
|
4321
4305
|
const {
|
|
4322
4306
|
theme
|
|
4323
4307
|
} = props;
|
|
4324
|
-
return css(_t$
|
|
4308
|
+
return css(_t$A || (_t$A = _$y`
|
|
4325
4309
|
align-items: center;
|
|
4326
4310
|
justify-content: center;
|
|
4327
4311
|
box-sizing: border-box;
|
|
@@ -4365,11 +4349,11 @@ function childrenToElementArray(children) {
|
|
|
4365
4349
|
return childrenArray.filter(node => isElement(node) || isFragment(node) || typeof node === 'string');
|
|
4366
4350
|
}
|
|
4367
4351
|
|
|
4368
|
-
const _excluded$
|
|
4352
|
+
const _excluded$E = ["children", "maxLength", "size"];
|
|
4369
4353
|
|
|
4370
|
-
let _$
|
|
4371
|
-
_t$
|
|
4372
|
-
const BASE_STYLES = css(_t$
|
|
4354
|
+
let _$x = t => t,
|
|
4355
|
+
_t$z;
|
|
4356
|
+
const BASE_STYLES = css(_t$z || (_t$z = _$x`
|
|
4373
4357
|
white-space: nowrap;
|
|
4374
4358
|
|
|
4375
4359
|
& > div {
|
|
@@ -4415,7 +4399,7 @@ const AvatarStack = /*#__PURE__*/forwardRef(function AvatarStack(props, ref) {
|
|
|
4415
4399
|
maxLength: maxLengthProp = 4,
|
|
4416
4400
|
size: sizeProp = 0
|
|
4417
4401
|
} = props,
|
|
4418
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4402
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$E);
|
|
4419
4403
|
|
|
4420
4404
|
const children = childrenToElementArray(childrenProp).filter(child => typeof child !== 'string');
|
|
4421
4405
|
const maxLength = Math.max(maxLengthProp, 0);
|
|
@@ -4441,7 +4425,7 @@ const AvatarStack = /*#__PURE__*/forwardRef(function AvatarStack(props, ref) {
|
|
|
4441
4425
|
}))));
|
|
4442
4426
|
});
|
|
4443
4427
|
|
|
4444
|
-
const _excluded$
|
|
4428
|
+
const _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"];
|
|
4445
4429
|
const Root$A = styled.div(boxStyle, flexItemStyle, responsiveBoxStyle, responsiveGridItemStyle, responsiveMarginStyle, responsivePaddingStyle);
|
|
4446
4430
|
/**
|
|
4447
4431
|
* @public
|
|
@@ -4476,7 +4460,7 @@ const Box = /*#__PURE__*/forwardRef(function Box(props, ref) {
|
|
|
4476
4460
|
rowEnd,
|
|
4477
4461
|
sizing
|
|
4478
4462
|
} = props,
|
|
4479
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4463
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$D);
|
|
4480
4464
|
|
|
4481
4465
|
return /*#__PURE__*/React.createElement(Root$A, _extends({
|
|
4482
4466
|
"data-as": typeof asProp === 'string' ? asProp : undefined,
|
|
@@ -4512,10 +4496,10 @@ const Box = /*#__PURE__*/forwardRef(function Box(props, ref) {
|
|
|
4512
4496
|
}), props.children);
|
|
4513
4497
|
});
|
|
4514
4498
|
|
|
4515
|
-
let _$
|
|
4516
|
-
_t$
|
|
4517
|
-
_t2$
|
|
4518
|
-
_t3$
|
|
4499
|
+
let _$w = t => t,
|
|
4500
|
+
_t$y,
|
|
4501
|
+
_t2$l,
|
|
4502
|
+
_t3$c;
|
|
4519
4503
|
function labelBaseStyle(props) {
|
|
4520
4504
|
const {
|
|
4521
4505
|
$accent,
|
|
@@ -4525,7 +4509,7 @@ function labelBaseStyle(props) {
|
|
|
4525
4509
|
const {
|
|
4526
4510
|
fonts
|
|
4527
4511
|
} = theme.sanity;
|
|
4528
|
-
return css(_t$
|
|
4512
|
+
return css(_t$y || (_t$y = _$w`
|
|
4529
4513
|
text-transform: uppercase;
|
|
4530
4514
|
|
|
4531
4515
|
${0}
|
|
@@ -4545,19 +4529,19 @@ function labelBaseStyle(props) {
|
|
|
4545
4529
|
& [data-sanity-icon] {
|
|
4546
4530
|
vertical-align: baseline;
|
|
4547
4531
|
}
|
|
4548
|
-
`), $accent && css(_t2$
|
|
4532
|
+
`), $accent && css(_t2$l || (_t2$l = _$w`
|
|
4549
4533
|
color: var(--card-accent-fg-color);
|
|
4550
|
-
`)), $muted && css(_t3$
|
|
4534
|
+
`)), $muted && css(_t3$c || (_t3$c = _$w`
|
|
4551
4535
|
color: var(--card-muted-fg-color);
|
|
4552
4536
|
`)), fonts.code.family);
|
|
4553
4537
|
}
|
|
4554
4538
|
|
|
4555
|
-
const _excluded$
|
|
4539
|
+
const _excluded$C = ["accent", "align", "children", "muted", "size", "textOverflow", "weight"];
|
|
4556
4540
|
|
|
4557
|
-
let _$
|
|
4558
|
-
_t$
|
|
4541
|
+
let _$v = t => t,
|
|
4542
|
+
_t$x;
|
|
4559
4543
|
const Root$z = styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle);
|
|
4560
|
-
const SpanWithTextOverflow$1 = styled.span(_t$
|
|
4544
|
+
const SpanWithTextOverflow$1 = styled.span(_t$x || (_t$x = _$v`
|
|
4561
4545
|
display: block;
|
|
4562
4546
|
white-space: nowrap;
|
|
4563
4547
|
text-overflow: ellipsis;
|
|
@@ -4577,7 +4561,7 @@ const Label = /*#__PURE__*/forwardRef(function Label(props, ref) {
|
|
|
4577
4561
|
textOverflow,
|
|
4578
4562
|
weight
|
|
4579
4563
|
} = props,
|
|
4580
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4564
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$C);
|
|
4581
4565
|
|
|
4582
4566
|
let children = childrenProp;
|
|
4583
4567
|
|
|
@@ -4618,7 +4602,7 @@ function badgeStyle(props) {
|
|
|
4618
4602
|
};
|
|
4619
4603
|
}
|
|
4620
4604
|
|
|
4621
|
-
const _excluded$
|
|
4605
|
+
const _excluded$B = ["children", "fontSize", "mode", "padding", "radius", "tone"];
|
|
4622
4606
|
const Root$y = styled(Box)(responsiveRadiusStyle, badgeStyle);
|
|
4623
4607
|
/**
|
|
4624
4608
|
* @public
|
|
@@ -4633,7 +4617,7 @@ const Badge = /*#__PURE__*/forwardRef(function Badge(props, ref) {
|
|
|
4633
4617
|
radius = 2,
|
|
4634
4618
|
tone = 'default'
|
|
4635
4619
|
} = props,
|
|
4636
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4620
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$B);
|
|
4637
4621
|
|
|
4638
4622
|
return /*#__PURE__*/React.createElement(Root$y, _extends({
|
|
4639
4623
|
"data-ui": "Badge"
|
|
@@ -4648,7 +4632,7 @@ const Badge = /*#__PURE__*/forwardRef(function Badge(props, ref) {
|
|
|
4648
4632
|
}, children));
|
|
4649
4633
|
});
|
|
4650
4634
|
|
|
4651
|
-
const _excluded$
|
|
4635
|
+
const _excluded$A = ["align", "as", "direction", "gap", "justify", "wrap"];
|
|
4652
4636
|
const Root$x = styled(Box)(flexItemStyle, responsiveFlexStyle);
|
|
4653
4637
|
/**
|
|
4654
4638
|
* @public
|
|
@@ -4663,7 +4647,7 @@ const Flex = /*#__PURE__*/forwardRef(function Flex(props, ref) {
|
|
|
4663
4647
|
justify,
|
|
4664
4648
|
wrap
|
|
4665
4649
|
} = props,
|
|
4666
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4650
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$A);
|
|
4667
4651
|
|
|
4668
4652
|
return /*#__PURE__*/React.createElement(Root$x, _extends({
|
|
4669
4653
|
"data-ui": "Flex"
|
|
@@ -4678,10 +4662,10 @@ const Flex = /*#__PURE__*/forwardRef(function Flex(props, ref) {
|
|
|
4678
4662
|
}));
|
|
4679
4663
|
});
|
|
4680
4664
|
|
|
4681
|
-
let _$
|
|
4682
|
-
_t$
|
|
4683
|
-
_t2$
|
|
4684
|
-
const rotate$1 = keyframes(_t$
|
|
4665
|
+
let _$u = t => t,
|
|
4666
|
+
_t$w,
|
|
4667
|
+
_t2$k;
|
|
4668
|
+
const rotate$1 = keyframes(_t$w || (_t$w = _$u`
|
|
4685
4669
|
from {
|
|
4686
4670
|
transform: rotate(0deg);
|
|
4687
4671
|
}
|
|
@@ -4690,7 +4674,7 @@ const rotate$1 = keyframes(_t$v || (_t$v = _$v`
|
|
|
4690
4674
|
transform: rotate(360deg);
|
|
4691
4675
|
}
|
|
4692
4676
|
`));
|
|
4693
|
-
const Root$w = styled(Text)(_t2$
|
|
4677
|
+
const Root$w = styled(Text)(_t2$k || (_t2$k = _$u`
|
|
4694
4678
|
& > span > svg {
|
|
4695
4679
|
animation: ${0} 500ms linear infinite;
|
|
4696
4680
|
}
|
|
@@ -4740,14 +4724,14 @@ function _colorVarsStyle(base, color, checkered = false) {
|
|
|
4740
4724
|
};
|
|
4741
4725
|
}
|
|
4742
4726
|
|
|
4743
|
-
let _$
|
|
4744
|
-
_t$
|
|
4727
|
+
let _$t = t => t,
|
|
4728
|
+
_t$v;
|
|
4745
4729
|
/**
|
|
4746
4730
|
* @internal
|
|
4747
4731
|
*/
|
|
4748
4732
|
|
|
4749
4733
|
function buttonBaseStyles() {
|
|
4750
|
-
return css(_t$
|
|
4734
|
+
return css(_t$v || (_t$v = _$t`
|
|
4751
4735
|
-webkit-font-smoothing: inherit;
|
|
4752
4736
|
appearance: none;
|
|
4753
4737
|
display: inline-flex;
|
|
@@ -4829,12 +4813,12 @@ function buttonColorStyles(props) {
|
|
|
4829
4813
|
}, (_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);
|
|
4830
4814
|
}
|
|
4831
4815
|
|
|
4832
|
-
const _excluded$
|
|
4816
|
+
const _excluded$z = ["children", "disabled", "fontSize", "icon", "iconRight", "justify", "loading", "mode", "padding", "paddingX", "paddingY", "paddingTop", "paddingBottom", "paddingLeft", "paddingRight", "radius", "selected", "space", "text", "textAlign", "tone", "type"];
|
|
4833
4817
|
|
|
4834
|
-
let _$
|
|
4835
|
-
_t$
|
|
4818
|
+
let _$s = t => t,
|
|
4819
|
+
_t$u;
|
|
4836
4820
|
const Root$v = styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles);
|
|
4837
|
-
const LoadingBox = styled.div(_t$
|
|
4821
|
+
const LoadingBox = styled.div(_t$u || (_t$u = _$s`
|
|
4838
4822
|
position: absolute;
|
|
4839
4823
|
top: 0;
|
|
4840
4824
|
left: 0;
|
|
@@ -4877,7 +4861,7 @@ const Button = /*#__PURE__*/forwardRef(function Button(props, ref) {
|
|
|
4877
4861
|
tone = 'default',
|
|
4878
4862
|
type = 'button'
|
|
4879
4863
|
} = props,
|
|
4880
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
4864
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$z);
|
|
4881
4865
|
|
|
4882
4866
|
const justify = useArrayProp(justifyProp);
|
|
4883
4867
|
const padding = useArrayProp(paddingProp);
|
|
@@ -4934,10 +4918,10 @@ const Button = /*#__PURE__*/forwardRef(function Button(props, ref) {
|
|
|
4934
4918
|
}, boxProps), children));
|
|
4935
4919
|
});
|
|
4936
4920
|
|
|
4937
|
-
let _$
|
|
4938
|
-
_t$
|
|
4939
|
-
_t2$
|
|
4940
|
-
_t3$
|
|
4921
|
+
let _$r = t => t,
|
|
4922
|
+
_t$t,
|
|
4923
|
+
_t2$j,
|
|
4924
|
+
_t3$b;
|
|
4941
4925
|
function cardStyle(props) {
|
|
4942
4926
|
return [cardBaseStyle(props), cardColorStyle(props)];
|
|
4943
4927
|
}
|
|
@@ -4947,7 +4931,7 @@ function cardBaseStyle(props) {
|
|
|
4947
4931
|
theme
|
|
4948
4932
|
} = props;
|
|
4949
4933
|
const space = theme.sanity.space;
|
|
4950
|
-
return css(_t$
|
|
4934
|
+
return css(_t$t || (_t$t = _$r`
|
|
4951
4935
|
${0}
|
|
4952
4936
|
|
|
4953
4937
|
&[data-as='button'] {
|
|
@@ -4970,7 +4954,7 @@ function cardBaseStyle(props) {
|
|
|
4970
4954
|
&[data-as='pre'] {
|
|
4971
4955
|
font: inherit;
|
|
4972
4956
|
}
|
|
4973
|
-
`), $checkered && css(_t2$
|
|
4957
|
+
`), $checkered && css(_t2$j || (_t2$j = _$r`
|
|
4974
4958
|
background-size: ${0}px ${0}px;
|
|
4975
4959
|
background-position: 50% 50%;
|
|
4976
4960
|
background-image: var(--card-bg-image);
|
|
@@ -4995,7 +4979,7 @@ function cardColorStyle(props) {
|
|
|
4995
4979
|
width: 0,
|
|
4996
4980
|
color: 'var(--card-border-color)'
|
|
4997
4981
|
};
|
|
4998
|
-
return css(_t3$
|
|
4982
|
+
return css(_t3$b || (_t3$b = _$r`
|
|
4999
4983
|
${0}
|
|
5000
4984
|
|
|
5001
4985
|
background-color: var(--card-bg-color);
|
|
@@ -5095,7 +5079,7 @@ function cardColorStyle(props) {
|
|
|
5095
5079
|
}) : 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);
|
|
5096
5080
|
}
|
|
5097
5081
|
|
|
5098
|
-
const _excluded$
|
|
5082
|
+
const _excluded$y = ["__unstable_checkered", "__unstable_focusRing", "as", "border", "borderTop", "borderRight", "borderBottom", "borderLeft", "pressed", "radius", "scheme", "selected", "shadow", "tone"];
|
|
5099
5083
|
const Root$u = styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle);
|
|
5100
5084
|
/**
|
|
5101
5085
|
* @public
|
|
@@ -5118,7 +5102,7 @@ const Card = /*#__PURE__*/forwardRef(function Card(props, ref) {
|
|
|
5118
5102
|
shadow,
|
|
5119
5103
|
tone: toneProp = 'default'
|
|
5120
5104
|
} = props,
|
|
5121
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5105
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$y);
|
|
5122
5106
|
|
|
5123
5107
|
const as = isValidElementType(asProp) ? asProp : 'div';
|
|
5124
5108
|
const rootTheme = useRootTheme();
|
|
@@ -5151,11 +5135,11 @@ const Card = /*#__PURE__*/forwardRef(function Card(props, ref) {
|
|
|
5151
5135
|
})));
|
|
5152
5136
|
});
|
|
5153
5137
|
|
|
5154
|
-
let _$
|
|
5155
|
-
_t$
|
|
5156
|
-
_t2$
|
|
5138
|
+
let _$q = t => t,
|
|
5139
|
+
_t$s,
|
|
5140
|
+
_t2$i;
|
|
5157
5141
|
function checkboxBaseStyles() {
|
|
5158
|
-
return css(_t$
|
|
5142
|
+
return css(_t$s || (_t$s = _$q`
|
|
5159
5143
|
position: relative;
|
|
5160
5144
|
display: inline-block;
|
|
5161
5145
|
`));
|
|
@@ -5170,7 +5154,7 @@ function inputElementStyles(props) {
|
|
|
5170
5154
|
input,
|
|
5171
5155
|
radius
|
|
5172
5156
|
} = theme.sanity;
|
|
5173
|
-
return css(_t2$
|
|
5157
|
+
return css(_t2$i || (_t2$i = _$q`
|
|
5174
5158
|
position: absolute;
|
|
5175
5159
|
top: 0;
|
|
5176
5160
|
left: 0;
|
|
@@ -5255,7 +5239,7 @@ function inputElementStyles(props) {
|
|
|
5255
5239
|
}), color.default.disabled.fg);
|
|
5256
5240
|
}
|
|
5257
5241
|
|
|
5258
|
-
const _excluded$
|
|
5242
|
+
const _excluded$x = ["checked", "className", "disabled", "indeterminate", "customValidity", "readOnly", "style"];
|
|
5259
5243
|
const Root$t = styled.div(checkboxBaseStyles);
|
|
5260
5244
|
const Input$5 = styled.input(inputElementStyles);
|
|
5261
5245
|
/**
|
|
@@ -5272,7 +5256,7 @@ const Checkbox = /*#__PURE__*/forwardRef(function Checkbox(props, forwardedRef)
|
|
|
5272
5256
|
readOnly,
|
|
5273
5257
|
style
|
|
5274
5258
|
} = props,
|
|
5275
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5259
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$x);
|
|
5276
5260
|
|
|
5277
5261
|
const ref = useForwardedRef(forwardedRef);
|
|
5278
5262
|
useCustomValidity(ref, customValidity);
|
|
@@ -5297,8 +5281,8 @@ const Checkbox = /*#__PURE__*/forwardRef(function Checkbox(props, forwardedRef)
|
|
|
5297
5281
|
})), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(CheckmarkIcon, null), /*#__PURE__*/React.createElement(RemoveIcon, null)));
|
|
5298
5282
|
});
|
|
5299
5283
|
|
|
5300
|
-
let _$
|
|
5301
|
-
_t$
|
|
5284
|
+
let _$p = t => t,
|
|
5285
|
+
_t$r;
|
|
5302
5286
|
|
|
5303
5287
|
function codeSyntaxHighlightingStyle({
|
|
5304
5288
|
theme
|
|
@@ -5417,7 +5401,7 @@ function codeSyntaxHighlightingStyle({
|
|
|
5417
5401
|
}
|
|
5418
5402
|
|
|
5419
5403
|
function codeBaseStyle() {
|
|
5420
|
-
return css(_t$
|
|
5404
|
+
return css(_t$r || (_t$r = _$p`
|
|
5421
5405
|
color: var(--card-code-fg-color);
|
|
5422
5406
|
|
|
5423
5407
|
& code {
|
|
@@ -5440,7 +5424,7 @@ function codeBaseStyle() {
|
|
|
5440
5424
|
`), codeSyntaxHighlightingStyle);
|
|
5441
5425
|
}
|
|
5442
5426
|
|
|
5443
|
-
const _excluded$
|
|
5427
|
+
const _excluded$w = ["children", "language", "size", "weight"];
|
|
5444
5428
|
const Root$s = styled.pre(codeBaseStyle, responsiveCodeFontStyle);
|
|
5445
5429
|
/**
|
|
5446
5430
|
* @public
|
|
@@ -5453,7 +5437,7 @@ const Code = /*#__PURE__*/forwardRef(function Code(props, ref) {
|
|
|
5453
5437
|
size = 2,
|
|
5454
5438
|
weight
|
|
5455
5439
|
} = props,
|
|
5456
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5440
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$w);
|
|
5457
5441
|
|
|
5458
5442
|
const language = typeof languageProp === 'string' ? languageProp : undefined;
|
|
5459
5443
|
const registered = language ? Refractor.hasLanguage(language) : false;
|
|
@@ -5490,7 +5474,7 @@ function responsiveContainerWidthStyle(props) {
|
|
|
5490
5474
|
}));
|
|
5491
5475
|
}
|
|
5492
5476
|
|
|
5493
|
-
const _excluded$
|
|
5477
|
+
const _excluded$v = ["as", "width"];
|
|
5494
5478
|
const Root$r = styled(Box)(containerBaseStyle, responsiveContainerWidthStyle);
|
|
5495
5479
|
/**
|
|
5496
5480
|
* @public
|
|
@@ -5501,7 +5485,7 @@ const Container = /*#__PURE__*/forwardRef(function Container(props, ref) {
|
|
|
5501
5485
|
as,
|
|
5502
5486
|
width = 2
|
|
5503
5487
|
} = props,
|
|
5504
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5488
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$v);
|
|
5505
5489
|
|
|
5506
5490
|
return /*#__PURE__*/React.createElement(Root$r, _extends({
|
|
5507
5491
|
"data-ui": "Container"
|
|
@@ -5512,7 +5496,7 @@ const Container = /*#__PURE__*/forwardRef(function Container(props, ref) {
|
|
|
5512
5496
|
}));
|
|
5513
5497
|
});
|
|
5514
5498
|
|
|
5515
|
-
const _excluded$
|
|
5499
|
+
const _excluded$u = ["as", "autoRows", "autoCols", "autoFlow", "columns", "gap", "gapX", "gapY", "rows", "children"];
|
|
5516
5500
|
const Root$q = styled(Box)(responsiveGridStyle);
|
|
5517
5501
|
/**
|
|
5518
5502
|
* @public
|
|
@@ -5531,7 +5515,7 @@ const Grid = /*#__PURE__*/forwardRef(function Grid(props, ref) {
|
|
|
5531
5515
|
rows,
|
|
5532
5516
|
children
|
|
5533
5517
|
} = props,
|
|
5534
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5518
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$u);
|
|
5535
5519
|
|
|
5536
5520
|
return /*#__PURE__*/React.createElement(Root$q, _extends({
|
|
5537
5521
|
"data-as": typeof as === 'string' ? as : undefined,
|
|
@@ -5550,17 +5534,17 @@ const Grid = /*#__PURE__*/forwardRef(function Grid(props, ref) {
|
|
|
5550
5534
|
}), children);
|
|
5551
5535
|
});
|
|
5552
5536
|
|
|
5553
|
-
let _$
|
|
5554
|
-
_t$
|
|
5555
|
-
_t2$
|
|
5556
|
-
_t3$
|
|
5537
|
+
let _$o = t => t,
|
|
5538
|
+
_t$q,
|
|
5539
|
+
_t2$h,
|
|
5540
|
+
_t3$a;
|
|
5557
5541
|
function headingBaseStyle(props) {
|
|
5558
5542
|
const {
|
|
5559
5543
|
$accent,
|
|
5560
5544
|
$muted,
|
|
5561
5545
|
theme
|
|
5562
5546
|
} = props;
|
|
5563
|
-
return css(_t$
|
|
5547
|
+
return css(_t$q || (_t$q = _$o`
|
|
5564
5548
|
${0}
|
|
5565
5549
|
|
|
5566
5550
|
${0}
|
|
@@ -5594,19 +5578,19 @@ function headingBaseStyle(props) {
|
|
|
5594
5578
|
& [data-sanity-icon] {
|
|
5595
5579
|
vertical-align: baseline;
|
|
5596
5580
|
}
|
|
5597
|
-
`), $accent && css(_t2$
|
|
5581
|
+
`), $accent && css(_t2$h || (_t2$h = _$o`
|
|
5598
5582
|
color: var(--card-accent-fg-color);
|
|
5599
|
-
`)), $muted && css(_t3$
|
|
5583
|
+
`)), $muted && css(_t3$a || (_t3$a = _$o`
|
|
5600
5584
|
color: var(--card-muted-fg-color);
|
|
5601
5585
|
`)), theme.sanity.fonts.code.family);
|
|
5602
5586
|
}
|
|
5603
5587
|
|
|
5604
|
-
const _excluded$
|
|
5588
|
+
const _excluded$t = ["accent", "align", "children", "muted", "size", "textOverflow", "weight"];
|
|
5605
5589
|
|
|
5606
|
-
let _$
|
|
5607
|
-
_t$
|
|
5590
|
+
let _$n = t => t,
|
|
5591
|
+
_t$p;
|
|
5608
5592
|
const Root$p = styled.div(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont);
|
|
5609
|
-
const SpanWithTextOverflow = styled.span(_t$
|
|
5593
|
+
const SpanWithTextOverflow = styled.span(_t$p || (_t$p = _$n`
|
|
5610
5594
|
display: block;
|
|
5611
5595
|
white-space: nowrap;
|
|
5612
5596
|
text-overflow: ellipsis;
|
|
@@ -5626,7 +5610,7 @@ const Heading = /*#__PURE__*/forwardRef(function Heading(props, ref) {
|
|
|
5626
5610
|
textOverflow,
|
|
5627
5611
|
weight
|
|
5628
5612
|
} = props,
|
|
5629
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5613
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$t);
|
|
5630
5614
|
|
|
5631
5615
|
let children = childrenProp;
|
|
5632
5616
|
|
|
@@ -5673,7 +5657,7 @@ function inlineSpaceStyle(props) {
|
|
|
5673
5657
|
});
|
|
5674
5658
|
}
|
|
5675
5659
|
|
|
5676
|
-
const _excluded$
|
|
5660
|
+
const _excluded$s = ["as", "children", "space"];
|
|
5677
5661
|
const Root$o = styled(Box)(inlineBaseStyle, inlineSpaceStyle);
|
|
5678
5662
|
/**
|
|
5679
5663
|
* @public
|
|
@@ -5685,7 +5669,7 @@ const Inline = /*#__PURE__*/forwardRef(function Inline(props, ref) {
|
|
|
5685
5669
|
children: childrenProp,
|
|
5686
5670
|
space
|
|
5687
5671
|
} = props,
|
|
5688
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5672
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$s);
|
|
5689
5673
|
|
|
5690
5674
|
const children = useMemo(() => childrenToElementArray(childrenProp).filter(Boolean).map((child, idx) => /*#__PURE__*/React.createElement("div", {
|
|
5691
5675
|
key: idx
|
|
@@ -5699,13 +5683,13 @@ const Inline = /*#__PURE__*/forwardRef(function Inline(props, ref) {
|
|
|
5699
5683
|
}), children);
|
|
5700
5684
|
});
|
|
5701
5685
|
|
|
5702
|
-
const _excluded$
|
|
5686
|
+
const _excluded$r = ["children", "fontSize", "padding", "radius"];
|
|
5703
5687
|
|
|
5704
|
-
let _$
|
|
5705
|
-
_t$
|
|
5688
|
+
let _$m = t => t,
|
|
5689
|
+
_t$o;
|
|
5706
5690
|
|
|
5707
5691
|
function kbdStyle() {
|
|
5708
|
-
return css(_t$
|
|
5692
|
+
return css(_t$o || (_t$o = _$m`
|
|
5709
5693
|
background: var(--card-bg-color);
|
|
5710
5694
|
font: inherit;
|
|
5711
5695
|
box-shadow: inset 0 0 0 1px var(--card-hairline-hard-color);
|
|
@@ -5728,7 +5712,7 @@ const KBD = /*#__PURE__*/forwardRef(function KBD(props, ref) {
|
|
|
5728
5712
|
padding = 1,
|
|
5729
5713
|
radius = 2
|
|
5730
5714
|
} = props,
|
|
5731
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5715
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$r);
|
|
5732
5716
|
|
|
5733
5717
|
return /*#__PURE__*/React.createElement(Root$n, _extends({
|
|
5734
5718
|
"data-ui": "KBD"
|
|
@@ -5814,7 +5798,7 @@ function findMinBreakpoints(media, width) {
|
|
|
5814
5798
|
return ret;
|
|
5815
5799
|
}
|
|
5816
5800
|
|
|
5817
|
-
const _excluded$
|
|
5801
|
+
const _excluded$q = ["children", "media"];
|
|
5818
5802
|
/**
|
|
5819
5803
|
* DO NOT USE IN PRODUCTION.
|
|
5820
5804
|
* @beta
|
|
@@ -5827,7 +5811,7 @@ const ElementQuery = /*#__PURE__*/forwardRef(function ElementQuery(props, ref) {
|
|
|
5827
5811
|
children,
|
|
5828
5812
|
media = theme.sanity.media
|
|
5829
5813
|
} = props,
|
|
5830
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5814
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$q);
|
|
5831
5815
|
|
|
5832
5816
|
const forwardedRef = useForwardedRef(ref);
|
|
5833
5817
|
const [element, setElement] = useState(null);
|
|
@@ -5955,12 +5939,12 @@ function LayerProvider(props) {
|
|
|
5955
5939
|
}, children);
|
|
5956
5940
|
}
|
|
5957
5941
|
|
|
5958
|
-
const _excluded$
|
|
5942
|
+
const _excluded$p = ["children", "style"],
|
|
5959
5943
|
_excluded2$1 = ["children", "zOffset"];
|
|
5960
5944
|
|
|
5961
|
-
let _$
|
|
5962
|
-
_t$
|
|
5963
|
-
const Root$m = styled.div(_t$
|
|
5945
|
+
let _$l = t => t,
|
|
5946
|
+
_t$n;
|
|
5947
|
+
const Root$m = styled.div(_t$n || (_t$n = _$l`
|
|
5964
5948
|
position: relative;
|
|
5965
5949
|
`));
|
|
5966
5950
|
const LayerChildren = /*#__PURE__*/forwardRef(function LayerChildren(props, ref) {
|
|
@@ -5968,7 +5952,7 @@ const LayerChildren = /*#__PURE__*/forwardRef(function LayerChildren(props, ref)
|
|
|
5968
5952
|
children,
|
|
5969
5953
|
style = EMPTY_RECORD
|
|
5970
5954
|
} = props,
|
|
5971
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5955
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$p);
|
|
5972
5956
|
|
|
5973
5957
|
const {
|
|
5974
5958
|
zIndex
|
|
@@ -6119,9 +6103,9 @@ function PortalProvider(props) {
|
|
|
6119
6103
|
}, children);
|
|
6120
6104
|
}
|
|
6121
6105
|
|
|
6122
|
-
let _$
|
|
6123
|
-
_t$
|
|
6124
|
-
const Root$l = styled.div(_t$
|
|
6106
|
+
let _$k = t => t,
|
|
6107
|
+
_t$m;
|
|
6108
|
+
const Root$l = styled.div(_t$m || (_t$m = _$k`
|
|
6125
6109
|
display: block;
|
|
6126
6110
|
width: 0;
|
|
6127
6111
|
height: 0;
|
|
@@ -6311,15 +6295,15 @@ function _isScrollable(el) {
|
|
|
6311
6295
|
return style.overflowX.includes('auto') || style.overflowX.includes('scroll') || style.overflowY.includes('auto') || style.overflowY.includes('scroll');
|
|
6312
6296
|
}
|
|
6313
6297
|
|
|
6314
|
-
const _excluded$
|
|
6298
|
+
const _excluded$o = ["as", "gap", "getItemKey", "items", "onChange", "renderItem"];
|
|
6315
6299
|
|
|
6316
|
-
let _$
|
|
6317
|
-
_t$
|
|
6318
|
-
_t2$
|
|
6319
|
-
const Root$k = styled.div(_t$
|
|
6300
|
+
let _$j = t => t,
|
|
6301
|
+
_t$l,
|
|
6302
|
+
_t2$g;
|
|
6303
|
+
const Root$k = styled.div(_t$l || (_t$l = _$j`
|
|
6320
6304
|
position: relative;
|
|
6321
6305
|
`));
|
|
6322
|
-
const ItemWrapper = styled.div(_t2$
|
|
6306
|
+
const ItemWrapper = styled.div(_t2$g || (_t2$g = _$j`
|
|
6323
6307
|
position: absolute;
|
|
6324
6308
|
left: 0;
|
|
6325
6309
|
right: 0;
|
|
@@ -6337,7 +6321,7 @@ const VirtualList = /*#__PURE__*/forwardRef(function VirtualList(props, ref) {
|
|
|
6337
6321
|
onChange,
|
|
6338
6322
|
renderItem
|
|
6339
6323
|
} = props,
|
|
6340
|
-
restProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
6324
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded$o);
|
|
6341
6325
|
|
|
6342
6326
|
const {
|
|
6343
6327
|
space
|
|
@@ -6456,11 +6440,11 @@ const VirtualList = /*#__PURE__*/forwardRef(function VirtualList(props, ref) {
|
|
|
6456
6440
|
}, children));
|
|
6457
6441
|
});
|
|
6458
6442
|
|
|
6459
|
-
let _$
|
|
6460
|
-
_t$
|
|
6461
|
-
_t2$
|
|
6462
|
-
_t3$
|
|
6463
|
-
const Root$j = styled.div(_t$
|
|
6443
|
+
let _$i = t => t,
|
|
6444
|
+
_t$k,
|
|
6445
|
+
_t2$f,
|
|
6446
|
+
_t3$9;
|
|
6447
|
+
const Root$j = styled.div(_t$k || (_t$k = _$i`
|
|
6464
6448
|
position: absolute;
|
|
6465
6449
|
pointer-events: none;
|
|
6466
6450
|
width: 27px;
|
|
@@ -6476,11 +6460,11 @@ const Root$j = styled.div(_t$j || (_t$j = _$j`
|
|
|
6476
6460
|
transform-origin: 13.5px 13.5px;
|
|
6477
6461
|
}
|
|
6478
6462
|
|
|
6479
|
-
[data-placement^='top'] > & {
|
|
6463
|
+
[data-popper-placement^='top'] > div > & {
|
|
6480
6464
|
bottom: -27px;
|
|
6481
6465
|
}
|
|
6482
6466
|
|
|
6483
|
-
[data-placement^='right'] > & {
|
|
6467
|
+
[data-popper-placement^='right'] > div > & {
|
|
6484
6468
|
left: -27px;
|
|
6485
6469
|
|
|
6486
6470
|
& > svg {
|
|
@@ -6488,7 +6472,7 @@ const Root$j = styled.div(_t$j || (_t$j = _$j`
|
|
|
6488
6472
|
}
|
|
6489
6473
|
}
|
|
6490
6474
|
|
|
6491
|
-
[data-placement^='left'] > & {
|
|
6475
|
+
[data-popper-placement^='left'] > div > & {
|
|
6492
6476
|
right: -27px;
|
|
6493
6477
|
|
|
6494
6478
|
& > svg {
|
|
@@ -6496,7 +6480,7 @@ const Root$j = styled.div(_t$j || (_t$j = _$j`
|
|
|
6496
6480
|
}
|
|
6497
6481
|
}
|
|
6498
6482
|
|
|
6499
|
-
[data-placement^='bottom'] > & {
|
|
6483
|
+
[data-popper-placement^='bottom'] > div > & {
|
|
6500
6484
|
top: -27px;
|
|
6501
6485
|
|
|
6502
6486
|
& > svg {
|
|
@@ -6504,15 +6488,15 @@ const Root$j = styled.div(_t$j || (_t$j = _$j`
|
|
|
6504
6488
|
}
|
|
6505
6489
|
}
|
|
6506
6490
|
`));
|
|
6507
|
-
const BorderPath = styled.path(_t2$
|
|
6491
|
+
const BorderPath = styled.path(_t2$f || (_t2$f = _$i`
|
|
6508
6492
|
fill: var(--card-shadow-outline-color);
|
|
6509
6493
|
`));
|
|
6510
|
-
const ShapePath = styled.path(_t3$
|
|
6494
|
+
const ShapePath = styled.path(_t3$9 || (_t3$9 = _$i`
|
|
6511
6495
|
fill: var(--card-bg-color);
|
|
6512
6496
|
`));
|
|
6513
6497
|
const PopoverArrow = /*#__PURE__*/forwardRef(function PopoverArrow(props, ref) {
|
|
6514
6498
|
return /*#__PURE__*/React.createElement(Root$j, _extends({
|
|
6515
|
-
"data-ui": "
|
|
6499
|
+
"data-ui": "PopoverArrow"
|
|
6516
6500
|
}, props, {
|
|
6517
6501
|
ref: ref
|
|
6518
6502
|
}), /*#__PURE__*/React.createElement("svg", {
|
|
@@ -6528,294 +6512,362 @@ const PopoverArrow = /*#__PURE__*/forwardRef(function PopoverArrow(props, ref) {
|
|
|
6528
6512
|
})));
|
|
6529
6513
|
});
|
|
6530
6514
|
|
|
6531
|
-
|
|
6515
|
+
/*
|
|
6516
|
+
|
|
6517
|
+
The order of popper phases:
|
|
6518
|
+
|
|
6519
|
+
- beforeRead
|
|
6520
|
+
- read
|
|
6521
|
+
- afterRead
|
|
6522
|
+
- beforeMain
|
|
6523
|
+
- main
|
|
6524
|
+
- afterMain
|
|
6525
|
+
- beforeWrite
|
|
6526
|
+
- write
|
|
6527
|
+
- afterWrite
|
|
6528
|
+
|
|
6529
|
+
*/
|
|
6532
6530
|
|
|
6533
|
-
function
|
|
6531
|
+
function getPopoverModifiers(props) {
|
|
6534
6532
|
const {
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6533
|
+
allowedAutoPlacements,
|
|
6534
|
+
arrow,
|
|
6535
|
+
arrowElement,
|
|
6536
|
+
boundaryElement,
|
|
6537
|
+
constrainSize,
|
|
6538
|
+
distance,
|
|
6539
|
+
fallbackPlacements,
|
|
6540
|
+
margins,
|
|
6541
|
+
matchReferenceWidth,
|
|
6542
|
+
open,
|
|
6543
|
+
preventOverflow,
|
|
6544
|
+
skidding,
|
|
6545
|
+
tether,
|
|
6546
|
+
tetherOffset
|
|
6547
|
+
} = props; // NOTE: For later viewers:
|
|
6548
|
+
// Prior to adding this change, the popover would get `maxWidth: 0` the 2nd time it
|
|
6549
|
+
// was opened, when used with `constrainSize`. I was looking for a way to "reset"
|
|
6550
|
+
// the size of the popover as measured by Popper.js, and this seems to be a workaround.
|
|
6551
|
+
|
|
6552
|
+
if (!open) {
|
|
6553
|
+
return [];
|
|
6554
|
+
}
|
|
6555
|
+
|
|
6556
|
+
const detectOverflowOptions = {
|
|
6557
|
+
altAxis: !constrainSize,
|
|
6558
|
+
boundary: boundaryElement || undefined,
|
|
6559
|
+
padding: 8,
|
|
6560
|
+
tether,
|
|
6561
|
+
tetherOffset
|
|
6539
6562
|
};
|
|
6540
|
-
}
|
|
6563
|
+
return [constrainSize && _extends({}, maxSizeModifier, {
|
|
6564
|
+
options: detectOverflowOptions
|
|
6565
|
+
}), constrainSize && {
|
|
6566
|
+
name: 'applyMaxSize',
|
|
6567
|
+
enabled: true,
|
|
6568
|
+
phase: 'beforeWrite',
|
|
6569
|
+
requires: ['maxSize'],
|
|
6570
|
+
|
|
6571
|
+
fn({
|
|
6572
|
+
state
|
|
6573
|
+
}) {
|
|
6574
|
+
const {
|
|
6575
|
+
width,
|
|
6576
|
+
height
|
|
6577
|
+
} = state.modifiersData.maxSize;
|
|
6578
|
+
state.styles.popper = _extends({}, state.styles.popper, {
|
|
6579
|
+
maxWidth: `${width}px`,
|
|
6580
|
+
maxHeight: `${height}px`
|
|
6581
|
+
});
|
|
6582
|
+
}
|
|
6541
6583
|
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6584
|
+
}, arrow && {
|
|
6585
|
+
name: 'arrow',
|
|
6586
|
+
options: {
|
|
6587
|
+
element: arrowElement,
|
|
6588
|
+
padding: 4
|
|
6589
|
+
}
|
|
6590
|
+
}, (constrainSize || preventOverflow) && {
|
|
6591
|
+
name: 'preventOverflow',
|
|
6592
|
+
options: detectOverflowOptions
|
|
6593
|
+
}, {
|
|
6594
|
+
name: 'offset',
|
|
6595
|
+
options: {
|
|
6596
|
+
offset: [skidding, distance]
|
|
6597
|
+
}
|
|
6598
|
+
}, margins && {
|
|
6599
|
+
name: 'margins',
|
|
6600
|
+
enabled: true,
|
|
6601
|
+
phase: 'beforeRead',
|
|
6602
|
+
fn: ({
|
|
6603
|
+
state
|
|
6604
|
+
}) => {
|
|
6605
|
+
const {
|
|
6606
|
+
rects
|
|
6607
|
+
} = state;
|
|
6608
|
+
|
|
6609
|
+
if (rects.reference) {
|
|
6610
|
+
rects.reference.x += margins[3];
|
|
6611
|
+
rects.reference.y += margins[1];
|
|
6612
|
+
rects.reference.width -= margins[1] + margins[3];
|
|
6613
|
+
rects.reference.height -= margins[0] + margins[2];
|
|
6614
|
+
}
|
|
6615
|
+
}
|
|
6616
|
+
}, {
|
|
6617
|
+
name: 'flip',
|
|
6618
|
+
options: {
|
|
6619
|
+
allowedAutoPlacements,
|
|
6620
|
+
boundary: boundaryElement || undefined,
|
|
6621
|
+
fallbackPlacements,
|
|
6622
|
+
padding: 8
|
|
6623
|
+
}
|
|
6624
|
+
}, matchReferenceWidth && {
|
|
6625
|
+
name: 'matchWidth',
|
|
6626
|
+
enabled: true,
|
|
6627
|
+
phase: 'beforeWrite',
|
|
6628
|
+
requires: ['computeStyles'],
|
|
6629
|
+
|
|
6630
|
+
fn({
|
|
6631
|
+
state
|
|
6632
|
+
}) {
|
|
6633
|
+
const {
|
|
6634
|
+
width
|
|
6635
|
+
} = state.rects.reference;
|
|
6636
|
+
state.styles.popper.width = `${width}px`;
|
|
6637
|
+
},
|
|
6638
|
+
|
|
6639
|
+
effect: ({
|
|
6640
|
+
state
|
|
6641
|
+
}) => {
|
|
6642
|
+
const refElement = state.elements.reference;
|
|
6546
6643
|
|
|
6547
|
-
|
|
6644
|
+
if (refElement instanceof HTMLElement) {
|
|
6645
|
+
state.elements.popper.style.width = `${refElement.offsetWidth - (margins ? margins[1] + margins[3] : 0)}px`;
|
|
6646
|
+
}
|
|
6647
|
+
}
|
|
6648
|
+
}].filter(Boolean);
|
|
6649
|
+
}
|
|
6650
|
+
|
|
6651
|
+
function usePopoverModifiers(props) {
|
|
6548
6652
|
const {
|
|
6549
|
-
|
|
6653
|
+
allowedAutoPlacements,
|
|
6550
6654
|
arrow,
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6655
|
+
arrowElement,
|
|
6656
|
+
boundaryElement,
|
|
6657
|
+
constrainSize,
|
|
6658
|
+
distance,
|
|
6659
|
+
fallbackPlacements,
|
|
6660
|
+
margins,
|
|
6661
|
+
matchReferenceWidth,
|
|
6662
|
+
open,
|
|
6663
|
+
preventOverflow,
|
|
6664
|
+
skidding,
|
|
6665
|
+
tether,
|
|
6666
|
+
tetherOffset
|
|
6667
|
+
} = props;
|
|
6668
|
+
return useMemo(() => {
|
|
6669
|
+
return getPopoverModifiers({
|
|
6670
|
+
allowedAutoPlacements,
|
|
6671
|
+
arrow,
|
|
6672
|
+
arrowElement,
|
|
6673
|
+
boundaryElement,
|
|
6674
|
+
constrainSize,
|
|
6675
|
+
distance,
|
|
6676
|
+
fallbackPlacements,
|
|
6677
|
+
margins,
|
|
6678
|
+
matchReferenceWidth,
|
|
6679
|
+
open,
|
|
6680
|
+
preventOverflow,
|
|
6681
|
+
skidding,
|
|
6682
|
+
tether,
|
|
6683
|
+
tetherOffset
|
|
6684
|
+
});
|
|
6685
|
+
}, [allowedAutoPlacements, arrow, arrowElement, boundaryElement, constrainSize, distance, fallbackPlacements, margins, matchReferenceWidth, open, preventOverflow, skidding, tether, tetherOffset]);
|
|
6686
|
+
}
|
|
6572
6687
|
|
|
6573
|
-
|
|
6574
|
-
zIndex
|
|
6575
|
-
} = useLayer(); // top right bottom left
|
|
6576
|
-
|
|
6577
|
-
const margins = useMemo(() => marginsProp || [0, 0, 0, 0], [marginsProp]); // translate according to margins
|
|
6578
|
-
|
|
6579
|
-
const referenceWidth = referenceWidthProp ? referenceWidthProp - margins[1] - margins[3] : undefined;
|
|
6580
|
-
const x = (xProp != null ? xProp : 0) + margins[3];
|
|
6581
|
-
const y = (yProp != null ? yProp : 0) + margins[0];
|
|
6582
|
-
const maxWidth = availableWidth ? Math.min(availableWidth - 8, referenceWidth || Infinity) : undefined;
|
|
6583
|
-
const rootStyle = useMemo(() => ({
|
|
6584
|
-
position: strategy,
|
|
6585
|
-
top: y,
|
|
6586
|
-
left: x,
|
|
6587
|
-
zIndex,
|
|
6588
|
-
width: referenceWidth,
|
|
6589
|
-
maxWidth: referenceWidth ? undefined : maxWidth
|
|
6590
|
-
}), [referenceWidth, maxWidth, strategy, x, y, zIndex]);
|
|
6591
|
-
const wrapperStyle = useMemo(() => ({
|
|
6592
|
-
minHeight: 25,
|
|
6593
|
-
maxHeight: availableHeight ? availableHeight - 8 : undefined
|
|
6594
|
-
}), [availableHeight]);
|
|
6595
|
-
const staticSide = placement && FLOATING_STATIC_SIDES[placement.split('-')[0]];
|
|
6596
|
-
const arrowStyle = useMemo(() => {
|
|
6597
|
-
const style = {
|
|
6598
|
-
left: arrowX !== null ? arrowX : undefined,
|
|
6599
|
-
top: arrowY !== null ? arrowY : undefined,
|
|
6600
|
-
right: undefined,
|
|
6601
|
-
bottom: undefined
|
|
6602
|
-
};
|
|
6603
|
-
if (staticSide) style[staticSide] = -27;
|
|
6604
|
-
return style;
|
|
6605
|
-
}, [arrowX, arrowY, staticSide]);
|
|
6606
|
-
return /*#__PURE__*/React.createElement(Root$i, _extends({}, restProps, {
|
|
6607
|
-
"$boundaryWidth": boundaryWidth,
|
|
6608
|
-
"data-placement": placement,
|
|
6609
|
-
"data-ui": "Popover",
|
|
6610
|
-
radius: radius,
|
|
6611
|
-
ref: ref,
|
|
6612
|
-
scheme: scheme,
|
|
6613
|
-
shadow: shadow,
|
|
6614
|
-
style: rootStyle,
|
|
6615
|
-
tone: tone,
|
|
6616
|
-
"$width": width
|
|
6617
|
-
}), /*#__PURE__*/React.createElement(Box, {
|
|
6618
|
-
"data-ui": "Popover__wrapper",
|
|
6619
|
-
overflow: overflow,
|
|
6620
|
-
padding: padding,
|
|
6621
|
-
sizing: "border",
|
|
6622
|
-
style: wrapperStyle
|
|
6623
|
-
}, children), arrow && /*#__PURE__*/React.createElement(PopoverArrow, {
|
|
6624
|
-
ref: arrowRef,
|
|
6625
|
-
style: arrowStyle
|
|
6626
|
-
}));
|
|
6627
|
-
}));
|
|
6628
|
-
PopoverCard.displayName = 'PopoverCard';
|
|
6688
|
+
const _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"];
|
|
6629
6689
|
|
|
6630
|
-
|
|
6690
|
+
let _2$1 = t => t,
|
|
6691
|
+
_t$j,
|
|
6692
|
+
_t2$e,
|
|
6693
|
+
_t3$8;
|
|
6694
|
+
const Root$i = styled(Layer)(({
|
|
6695
|
+
$preventOverflow
|
|
6696
|
+
}) => css(_t$j || (_t$j = _2$1`
|
|
6697
|
+
pointer-events: none;
|
|
6698
|
+
display: flex;
|
|
6699
|
+
flex-direction: column;
|
|
6700
|
+
max-width: calc(100% - 16px);
|
|
6631
6701
|
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
if (scope.constrainSize) {
|
|
6636
|
-
scope.setAvailableWidth(args.availableWidth);
|
|
6637
|
-
scope.setAvailableHeight(args.availableHeight);
|
|
6638
|
-
}
|
|
6702
|
+
& > * {
|
|
6703
|
+
min-height: 0;
|
|
6704
|
+
}
|
|
6639
6705
|
|
|
6640
|
-
|
|
6641
|
-
|
|
6706
|
+
/* Hide the popover when the reference element is out of bounds */
|
|
6707
|
+
${0}
|
|
6708
|
+
`), $preventOverflow && css(_t2$e || (_t2$e = _2$1`
|
|
6709
|
+
&[data-popper-reference-hidden='true'] {
|
|
6710
|
+
display: none;
|
|
6642
6711
|
}
|
|
6643
|
-
|
|
6712
|
+
`))));
|
|
6713
|
+
const PopoverCard = styled(Card)(({
|
|
6714
|
+
$constrainSize
|
|
6715
|
+
}) => css(_t3$8 || (_t3$8 = _2$1`
|
|
6716
|
+
flex: 1;
|
|
6717
|
+
max-height: ${0};
|
|
6718
|
+
pointer-events: all;
|
|
6719
|
+
|
|
6720
|
+
&& {
|
|
6721
|
+
display: flex;
|
|
6722
|
+
}
|
|
6644
6723
|
|
|
6645
|
-
|
|
6646
|
-
});
|
|
6647
|
-
}
|
|
6724
|
+
flex-direction: column;
|
|
6648
6725
|
|
|
6649
|
-
|
|
6650
|
-
|
|
6726
|
+
& > * {
|
|
6727
|
+
min-height: 0;
|
|
6728
|
+
}
|
|
6729
|
+
|
|
6730
|
+
${0}
|
|
6731
|
+
`), $constrainSize && '100%', responsiveContainerWidthStyle));
|
|
6732
|
+
/**
|
|
6733
|
+
* @public
|
|
6734
|
+
*/
|
|
6735
|
+
|
|
6736
|
+
const Popover = /*#__PURE__*/forwardRef(function Popover(props, ref) {
|
|
6737
|
+
var _theme$sanity$layer;
|
|
6651
6738
|
|
|
6652
|
-
const theme = useTheme();
|
|
6653
6739
|
const boundaryElementContext = useBoundaryElement();
|
|
6740
|
+
const theme = useTheme();
|
|
6654
6741
|
|
|
6655
6742
|
const {
|
|
6656
6743
|
__unstable_margins: margins,
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6744
|
+
allowedAutoPlacements,
|
|
6745
|
+
arrow = true,
|
|
6746
|
+
boundaryElement: boundaryElementProp = boundaryElementContext.element,
|
|
6747
|
+
children: child,
|
|
6661
6748
|
content,
|
|
6749
|
+
constrainSize,
|
|
6662
6750
|
disabled,
|
|
6663
6751
|
fallbackPlacements,
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6752
|
+
open = false,
|
|
6753
|
+
padding,
|
|
6754
|
+
placement = 'bottom',
|
|
6755
|
+
portal: portalProp = false,
|
|
6756
|
+
preventOverflow,
|
|
6757
|
+
radius = 3,
|
|
6758
|
+
referenceElement: referenceElementProp,
|
|
6759
|
+
matchReferenceWidth,
|
|
6760
|
+
shadow = 3,
|
|
6673
6761
|
scheme,
|
|
6674
|
-
|
|
6762
|
+
style = EMPTY_RECORD,
|
|
6763
|
+
tether,
|
|
6764
|
+
tetherOffset,
|
|
6675
6765
|
tone = 'inherit',
|
|
6676
|
-
width: widthProp =
|
|
6677
|
-
zOffset
|
|
6766
|
+
width: widthProp = 0,
|
|
6767
|
+
zOffset = (_theme$sanity$layer = theme.sanity.layer) == null ? void 0 : _theme$sanity$layer.popover.zOffset
|
|
6678
6768
|
} = props,
|
|
6679
6769
|
restProps = _objectWithoutPropertiesLoose(props, _excluded$n);
|
|
6680
6770
|
|
|
6681
|
-
const boundarySize = (_useElementSize = useElementSize(boundaryElement)) == null ? void 0 : _useElementSize.border;
|
|
6682
|
-
const padding = useArrayProp(paddingProp);
|
|
6683
|
-
const radius = useArrayProp(radiusProp);
|
|
6684
|
-
const shadow = useArrayProp(shadowProp);
|
|
6685
|
-
const width = useArrayProp(widthProp);
|
|
6686
|
-
const zOffset = useArrayProp(zOffsetProp);
|
|
6687
|
-
const [availableWidth, setAvailableWidth] = useState(undefined);
|
|
6688
|
-
const [availableHeight, setAvailableHeight] = useState(undefined);
|
|
6689
|
-
const [referenceWidth, setReferenceWidth] = useState(undefined);
|
|
6690
6771
|
const forwardedRef = useForwardedRef(ref);
|
|
6691
|
-
const
|
|
6692
|
-
const
|
|
6693
|
-
const
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
ret.push(offset({
|
|
6716
|
-
mainAxis: arrowProp ? 4 : 0
|
|
6717
|
-
})); // Shift the popover so its sits with the boundary eleement
|
|
6718
|
-
|
|
6719
|
-
if (preventOverflow) {
|
|
6720
|
-
ret.push(shift({
|
|
6721
|
-
boundary: boundaryElement || undefined,
|
|
6722
|
-
rootBoundary,
|
|
6723
|
-
padding: 8
|
|
6724
|
-
}));
|
|
6725
|
-
} // Place arrow
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
if (arrowProp) {
|
|
6729
|
-
ret.push(arrow({
|
|
6730
|
-
element: arrowRef,
|
|
6731
|
-
padding: 4
|
|
6732
|
-
}));
|
|
6733
|
-
}
|
|
6734
|
-
|
|
6735
|
-
return ret;
|
|
6736
|
-
}, [arrowProp, boundaryElement, constrainSize, fallbackPlacements, matchReferenceWidthProp, preventOverflow]);
|
|
6737
|
-
const {
|
|
6738
|
-
x,
|
|
6739
|
-
y,
|
|
6772
|
+
const portal = usePortal();
|
|
6773
|
+
const [referenceElement, setReferenceElement] = useState(null);
|
|
6774
|
+
const [popperElement, setPopperElement] = useState(null);
|
|
6775
|
+
const [arrowElement, setArrowElement] = useState(null);
|
|
6776
|
+
const popperReferenceElement = referenceElementProp || referenceElement;
|
|
6777
|
+
const width = useArrayProp(matchReferenceWidth ? 'auto' : widthProp);
|
|
6778
|
+
const modifiers = usePopoverModifiers({
|
|
6779
|
+
allowedAutoPlacements,
|
|
6780
|
+
arrow,
|
|
6781
|
+
arrowElement,
|
|
6782
|
+
boundaryElement: boundaryElementProp || portal.boundaryElement,
|
|
6783
|
+
constrainSize,
|
|
6784
|
+
distance: arrow ? 4 : 0,
|
|
6785
|
+
fallbackPlacements,
|
|
6786
|
+
margins,
|
|
6787
|
+
matchReferenceWidth,
|
|
6788
|
+
open,
|
|
6789
|
+
preventOverflow,
|
|
6790
|
+
skidding: 0,
|
|
6791
|
+
tether,
|
|
6792
|
+
tetherOffset
|
|
6793
|
+
});
|
|
6794
|
+
const popper = usePopper(popperReferenceElement, popperElement, {
|
|
6740
6795
|
placement,
|
|
6741
|
-
|
|
6742
|
-
floating,
|
|
6743
|
-
middlewareData,
|
|
6744
|
-
strategy
|
|
6745
|
-
} = useFloating({
|
|
6746
|
-
middleware,
|
|
6747
|
-
placement: placementProp,
|
|
6748
|
-
whileElementsMounted: autoUpdate
|
|
6796
|
+
modifiers
|
|
6749
6797
|
});
|
|
6750
|
-
const
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
}
|
|
6755
|
-
const
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
}, [floating, forwardedRef]);
|
|
6759
|
-
const setReference = useCallback(node => {
|
|
6760
|
-
reference(node);
|
|
6761
|
-
const childRef = childProp == null ? void 0 : childProp.ref;
|
|
6798
|
+
const {
|
|
6799
|
+
attributes,
|
|
6800
|
+
forceUpdate,
|
|
6801
|
+
styles
|
|
6802
|
+
} = popper;
|
|
6803
|
+
const setRef = useCallback(el => {
|
|
6804
|
+
const childRef = child.ref;
|
|
6805
|
+
setReferenceElement(el);
|
|
6762
6806
|
|
|
6763
6807
|
if (typeof childRef === 'function') {
|
|
6764
|
-
childRef(
|
|
6808
|
+
childRef(el);
|
|
6765
6809
|
} else if (childRef) {
|
|
6766
|
-
childRef.current =
|
|
6810
|
+
childRef.current = el;
|
|
6767
6811
|
}
|
|
6768
|
-
}, [
|
|
6769
|
-
const
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6812
|
+
}, [child]);
|
|
6813
|
+
const setRootRef = useCallback(el => {
|
|
6814
|
+
setPopperElement(el);
|
|
6815
|
+
forwardedRef.current = el;
|
|
6816
|
+
}, [forwardedRef]);
|
|
6817
|
+
const popoverStyle = useMemo(() => _extends({}, style, styles.popper), [style, styles]);
|
|
6818
|
+
const updateTimeoutRef = useRef(null);
|
|
6775
6819
|
useEffect(() => {
|
|
6776
|
-
if (
|
|
6777
|
-
|
|
6820
|
+
if (updateTimeoutRef.current) {
|
|
6821
|
+
clearTimeout(updateTimeoutRef.current);
|
|
6822
|
+
updateTimeoutRef.current = null;
|
|
6823
|
+
}
|
|
6824
|
+
|
|
6825
|
+
updateTimeoutRef.current = setTimeout(() => {
|
|
6826
|
+
if (forceUpdate) {
|
|
6827
|
+
try {
|
|
6828
|
+
forceUpdate();
|
|
6829
|
+
} catch (_) {// ignore caught error
|
|
6830
|
+
}
|
|
6831
|
+
}
|
|
6832
|
+
}, 0);
|
|
6833
|
+
}, [content, forceUpdate, open, popperReferenceElement]);
|
|
6778
6834
|
|
|
6779
6835
|
if (disabled) {
|
|
6780
|
-
return
|
|
6836
|
+
return child || /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
6781
6837
|
}
|
|
6782
6838
|
|
|
6783
|
-
const
|
|
6839
|
+
const node = /*#__PURE__*/React.createElement(Root$i, _extends({
|
|
6840
|
+
"data-ui": "Popover"
|
|
6841
|
+
}, restProps, {
|
|
6842
|
+
"$preventOverflow": preventOverflow,
|
|
6843
|
+
ref: setRootRef,
|
|
6844
|
+
style: popoverStyle,
|
|
6784
6845
|
zOffset: zOffset
|
|
6785
|
-
}, /*#__PURE__*/React.createElement(PopoverCard,
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
arrowX: arrowX,
|
|
6790
|
-
arrowY: arrowY,
|
|
6791
|
-
availableWidth: constrainSize ? availableWidth : undefined,
|
|
6792
|
-
availableHeight: constrainSize ? availableHeight : undefined,
|
|
6793
|
-
boundaryWidth: boundarySize == null ? void 0 : boundarySize.width,
|
|
6794
|
-
overflow: overflow,
|
|
6846
|
+
}, attributes.popper), /*#__PURE__*/React.createElement(PopoverCard, {
|
|
6847
|
+
"$constrainSize": constrainSize,
|
|
6848
|
+
"$width": width,
|
|
6849
|
+
"data-ui": "PopoverCard",
|
|
6795
6850
|
padding: padding,
|
|
6796
|
-
placement: placement,
|
|
6797
6851
|
radius: radius,
|
|
6798
|
-
ref: setFloating,
|
|
6799
|
-
referenceWidth: matchReferenceWidthProp ? referenceWidth : undefined,
|
|
6800
6852
|
scheme: scheme,
|
|
6801
6853
|
shadow: shadow,
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
width: width
|
|
6854
|
+
tone: tone
|
|
6855
|
+
}, arrow && /*#__PURE__*/React.createElement(PopoverArrow, {
|
|
6856
|
+
ref: setArrowElement,
|
|
6857
|
+
style: styles.arrow
|
|
6807
6858
|
}), content));
|
|
6808
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
6809
|
-
|
|
6810
|
-
}
|
|
6811
|
-
|
|
6812
|
-
|
|
6859
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, child && !referenceElementProp ? /*#__PURE__*/cloneElement(child, {
|
|
6860
|
+
ref: setRef
|
|
6861
|
+
}) : child || /*#__PURE__*/React.createElement(React.Fragment, null), open && /*#__PURE__*/React.createElement(React.Fragment, null, portalProp && /*#__PURE__*/React.createElement(Portal, {
|
|
6862
|
+
__unstable_name: typeof portalProp === 'string' ? portalProp : undefined
|
|
6863
|
+
}, node), !portalProp && node));
|
|
6864
|
+
});
|
|
6813
6865
|
|
|
6814
|
-
let _$
|
|
6866
|
+
let _$h = t => t,
|
|
6815
6867
|
_t$i,
|
|
6816
6868
|
_t2$d;
|
|
6817
6869
|
function radioBaseStyle() {
|
|
6818
|
-
return css(_t$i || (_t$i = _$
|
|
6870
|
+
return css(_t$i || (_t$i = _$h`
|
|
6819
6871
|
position: relative;
|
|
6820
6872
|
|
|
6821
6873
|
&:not([hidden]) {
|
|
@@ -6837,7 +6889,7 @@ function inputElementStyle(props) {
|
|
|
6837
6889
|
} = theme.sanity;
|
|
6838
6890
|
const color = theme.sanity.color.input;
|
|
6839
6891
|
const dist = (input.radio.size - input.radio.markSize) / 2;
|
|
6840
|
-
return css(_t2$d || (_t2$d = _$
|
|
6892
|
+
return css(_t2$d || (_t2$d = _$h`
|
|
6841
6893
|
appearance: none;
|
|
6842
6894
|
position: absolute;
|
|
6843
6895
|
top: 0;
|
|
@@ -6955,14 +7007,14 @@ const Radio = /*#__PURE__*/forwardRef(function Radio(props, forwardedRef) {
|
|
|
6955
7007
|
})), /*#__PURE__*/React.createElement("span", null));
|
|
6956
7008
|
});
|
|
6957
7009
|
|
|
6958
|
-
let _$
|
|
7010
|
+
let _$g = t => t,
|
|
6959
7011
|
_t$h,
|
|
6960
7012
|
_t2$c,
|
|
6961
7013
|
_t3$7,
|
|
6962
7014
|
_t4$5;
|
|
6963
7015
|
|
|
6964
7016
|
function rootStyle() {
|
|
6965
|
-
return css(_t$h || (_t$h = _$
|
|
7017
|
+
return css(_t$h || (_t$h = _$g`
|
|
6966
7018
|
position: relative;
|
|
6967
7019
|
width: stretch;
|
|
6968
7020
|
|
|
@@ -6977,7 +7029,7 @@ function inputBaseStyle(props) {
|
|
|
6977
7029
|
theme
|
|
6978
7030
|
} = props;
|
|
6979
7031
|
const font = theme.sanity.fonts.text;
|
|
6980
|
-
return css(_t2$c || (_t2$c = _$
|
|
7032
|
+
return css(_t2$c || (_t2$c = _$g`
|
|
6981
7033
|
-webkit-font-smoothing: antialiased;
|
|
6982
7034
|
appearance: none;
|
|
6983
7035
|
border: 0;
|
|
@@ -7002,7 +7054,7 @@ function inputColorStyle(props) {
|
|
|
7002
7054
|
input
|
|
7003
7055
|
} = theme.sanity;
|
|
7004
7056
|
const color = theme.sanity.color.input;
|
|
7005
|
-
return css(_t3$7 || (_t3$7 = _$
|
|
7057
|
+
return css(_t3$7 || (_t3$7 = _$g`
|
|
7006
7058
|
/* enabled */
|
|
7007
7059
|
background-color: ${0};
|
|
7008
7060
|
color: ${0};
|
|
@@ -7083,7 +7135,7 @@ function iconBoxStyle(props) {
|
|
|
7083
7135
|
theme
|
|
7084
7136
|
} = props;
|
|
7085
7137
|
const color = theme.sanity.color.input;
|
|
7086
|
-
return css(_t4$5 || (_t4$5 = _$
|
|
7138
|
+
return css(_t4$5 || (_t4$5 = _$g`
|
|
7087
7139
|
pointer-events: none;
|
|
7088
7140
|
position: absolute;
|
|
7089
7141
|
top: 0;
|
|
@@ -7208,7 +7260,7 @@ const Stack = /*#__PURE__*/forwardRef(function Stack(props, ref) {
|
|
|
7208
7260
|
}));
|
|
7209
7261
|
});
|
|
7210
7262
|
|
|
7211
|
-
let _$
|
|
7263
|
+
let _$f = t => t,
|
|
7212
7264
|
_t$g,
|
|
7213
7265
|
_t2$b,
|
|
7214
7266
|
_t3$6,
|
|
@@ -7219,7 +7271,7 @@ let _$g = t => t,
|
|
|
7219
7271
|
/* Root */
|
|
7220
7272
|
|
|
7221
7273
|
function switchBaseStyles() {
|
|
7222
|
-
return css(_t$g || (_t$g = _$
|
|
7274
|
+
return css(_t$g || (_t$g = _$f`
|
|
7223
7275
|
position: relative;
|
|
7224
7276
|
&:not([hidden]) {
|
|
7225
7277
|
display: inline-block;
|
|
@@ -7230,7 +7282,7 @@ function switchBaseStyles() {
|
|
|
7230
7282
|
|
|
7231
7283
|
function switchInputStyles() {
|
|
7232
7284
|
// Visually hide the input element while keeping it interactive
|
|
7233
|
-
return css(_t2$b || (_t2$b = _$
|
|
7285
|
+
return css(_t2$b || (_t2$b = _$f`
|
|
7234
7286
|
position: absolute;
|
|
7235
7287
|
top: 0;
|
|
7236
7288
|
right: 0;
|
|
@@ -7258,7 +7310,7 @@ function switchRepresentationStyles(props) {
|
|
|
7258
7310
|
input
|
|
7259
7311
|
} = theme.sanity;
|
|
7260
7312
|
const color = theme.sanity.color.button.default;
|
|
7261
|
-
return css(_t3$6 || (_t3$6 = _$
|
|
7313
|
+
return css(_t3$6 || (_t3$6 = _$f`
|
|
7262
7314
|
--switch-bg-color: ${0};
|
|
7263
7315
|
--switch-fg-color: ${0};
|
|
7264
7316
|
--switch-box-shadow: none;
|
|
@@ -7330,7 +7382,7 @@ function switchTrackStyles(props) {
|
|
|
7330
7382
|
const {
|
|
7331
7383
|
input
|
|
7332
7384
|
} = theme.sanity;
|
|
7333
|
-
return css(_t4$4 || (_t4$4 = _$
|
|
7385
|
+
return css(_t4$4 || (_t4$4 = _$f`
|
|
7334
7386
|
&:not([hidden]) {
|
|
7335
7387
|
display: block;
|
|
7336
7388
|
}
|
|
@@ -7360,7 +7412,7 @@ function switchThumbStyles(props) {
|
|
|
7360
7412
|
const checkedOffset = trackWidth - trackPadding * 2 - size;
|
|
7361
7413
|
const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding;
|
|
7362
7414
|
const checked = $indeterminate !== true && props.$checked === true;
|
|
7363
|
-
return css(_t5$3 || (_t5$3 = _$
|
|
7415
|
+
return css(_t5$3 || (_t5$3 = _$f`
|
|
7364
7416
|
&:not([hidden]) {
|
|
7365
7417
|
display: block;
|
|
7366
7418
|
}
|
|
@@ -7379,9 +7431,9 @@ function switchThumbStyles(props) {
|
|
|
7379
7431
|
${0}
|
|
7380
7432
|
|
|
7381
7433
|
${0}
|
|
7382
|
-
`), rem(trackPadding), rem(trackPadding), rem(size), rem(size), rem(size / 2), input.switch.transitionDurationMs, input.switch.transitionTimingFunction, checked && css(_t6$2 || (_t6$2 = _$
|
|
7434
|
+
`), rem(trackPadding), rem(trackPadding), rem(size), rem(size), rem(size / 2), input.switch.transitionDurationMs, input.switch.transitionTimingFunction, checked && css(_t6$2 || (_t6$2 = _$f`
|
|
7383
7435
|
transform: translate3d(${0}px, 0, 0);
|
|
7384
|
-
`), checkedOffset), $indeterminate && css(_t7 || (_t7 = _$
|
|
7436
|
+
`), checkedOffset), $indeterminate && css(_t7 || (_t7 = _$f`
|
|
7385
7437
|
transform: translate3d(${0}px, 0, 0);
|
|
7386
7438
|
`), indeterminateOffset));
|
|
7387
7439
|
}
|
|
@@ -7436,10 +7488,10 @@ const Switch = /*#__PURE__*/forwardRef(function Switch(props, forwardedRef) {
|
|
|
7436
7488
|
|
|
7437
7489
|
const _excluded$i = ["border", "customValidity", "disabled", "fontSize", "padding", "radius", "weight"];
|
|
7438
7490
|
|
|
7439
|
-
let _$
|
|
7491
|
+
let _$e = t => t,
|
|
7440
7492
|
_t$f;
|
|
7441
7493
|
const Root$d = styled.span(textInputRootStyle);
|
|
7442
|
-
const InputRoot$1 = styled.span(_t$f || (_t$f = _$
|
|
7494
|
+
const InputRoot$1 = styled.span(_t$f || (_t$f = _$e`
|
|
7443
7495
|
flex: 1;
|
|
7444
7496
|
min-width: 0;
|
|
7445
7497
|
display: block;
|
|
@@ -7489,7 +7541,7 @@ const TextArea = /*#__PURE__*/forwardRef(function TextArea(props, forwardedRef)
|
|
|
7489
7541
|
|
|
7490
7542
|
const _excluded$h = ["border", "clearButton", "disabled", "fontSize", "icon", "iconRight", "onClear", "padding", "prefix", "radius", "readOnly", "space", "suffix", "customValidity", "type", "weight"];
|
|
7491
7543
|
|
|
7492
|
-
let _$
|
|
7544
|
+
let _$d = t => t,
|
|
7493
7545
|
_t$e,
|
|
7494
7546
|
_t2$a,
|
|
7495
7547
|
_t3$5,
|
|
@@ -7502,7 +7554,7 @@ const CLEAR_BUTTON_BOX_STYLE = {
|
|
|
7502
7554
|
const Root$c = styled(Card).attrs({
|
|
7503
7555
|
forwardedAs: 'span'
|
|
7504
7556
|
})(textInputRootStyle);
|
|
7505
|
-
const InputRoot = styled.span(_t$e || (_t$e = _$
|
|
7557
|
+
const InputRoot = styled.span(_t$e || (_t$e = _$d`
|
|
7506
7558
|
flex: 1;
|
|
7507
7559
|
min-width: 0;
|
|
7508
7560
|
display: block;
|
|
@@ -7510,7 +7562,7 @@ const InputRoot = styled.span(_t$e || (_t$e = _$e`
|
|
|
7510
7562
|
`));
|
|
7511
7563
|
const Prefix = styled(Card).attrs({
|
|
7512
7564
|
forwardedAs: 'span'
|
|
7513
|
-
})(_t2$a || (_t2$a = _$
|
|
7565
|
+
})(_t2$a || (_t2$a = _$d`
|
|
7514
7566
|
border-top-right-radius: 0;
|
|
7515
7567
|
border-bottom-right-radius: 0;
|
|
7516
7568
|
|
|
@@ -7521,7 +7573,7 @@ const Prefix = styled(Card).attrs({
|
|
|
7521
7573
|
`));
|
|
7522
7574
|
const Suffix = styled(Card).attrs({
|
|
7523
7575
|
forwardedAs: 'span'
|
|
7524
|
-
})(_t3$5 || (_t3$5 = _$
|
|
7576
|
+
})(_t3$5 || (_t3$5 = _$d`
|
|
7525
7577
|
border-top-left-radius: 0;
|
|
7526
7578
|
border-bottom-left-radius: 0;
|
|
7527
7579
|
|
|
@@ -7532,17 +7584,17 @@ const Suffix = styled(Card).attrs({
|
|
|
7532
7584
|
`));
|
|
7533
7585
|
const Input = styled.input(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle);
|
|
7534
7586
|
const Presentation = styled.span(responsiveRadiusStyle, textInputRepresentationStyle);
|
|
7535
|
-
const LeftBox = styled(Box)(_t4$3 || (_t4$3 = _$
|
|
7587
|
+
const LeftBox = styled(Box)(_t4$3 || (_t4$3 = _$d`
|
|
7536
7588
|
position: absolute;
|
|
7537
7589
|
top: 0;
|
|
7538
7590
|
left: 0;
|
|
7539
7591
|
`));
|
|
7540
|
-
const RightBox = styled(Box)(_t5$2 || (_t5$2 = _$
|
|
7592
|
+
const RightBox = styled(Box)(_t5$2 || (_t5$2 = _$d`
|
|
7541
7593
|
position: absolute;
|
|
7542
7594
|
top: 0;
|
|
7543
7595
|
right: 0;
|
|
7544
7596
|
`));
|
|
7545
|
-
const RightCard = styled(Card)(_t6$1 || (_t6$1 = _$
|
|
7597
|
+
const RightCard = styled(Card)(_t6$1 || (_t6$1 = _$d`
|
|
7546
7598
|
background-color: transparent;
|
|
7547
7599
|
position: absolute;
|
|
7548
7600
|
top: 0;
|
|
@@ -7686,27 +7738,12 @@ const TextInput = /*#__PURE__*/forwardRef(function TextInput(props, forwardedRef
|
|
|
7686
7738
|
})), presentationNode, clearButtonNode), suffixNode);
|
|
7687
7739
|
});
|
|
7688
7740
|
|
|
7689
|
-
let _$
|
|
7741
|
+
let _$c = t => t,
|
|
7690
7742
|
_t$d,
|
|
7691
7743
|
_t2$9,
|
|
7692
7744
|
_t3$4;
|
|
7693
|
-
const Root$b = styled.div(_t$d || (_t$d = _$
|
|
7745
|
+
const Root$b = styled.div(_t$d || (_t$d = _$c`
|
|
7694
7746
|
position: absolute;
|
|
7695
|
-
pointer-events: none;
|
|
7696
|
-
width: 15px;
|
|
7697
|
-
height: 15px;
|
|
7698
|
-
fill: none;
|
|
7699
|
-
|
|
7700
|
-
:empty + & {
|
|
7701
|
-
display: none;
|
|
7702
|
-
}
|
|
7703
|
-
|
|
7704
|
-
& > svg {
|
|
7705
|
-
display: block;
|
|
7706
|
-
transform-origin: 7.5px 7.5px;
|
|
7707
|
-
}
|
|
7708
|
-
|
|
7709
|
-
/* position: absolute;
|
|
7710
7747
|
width: 15px;
|
|
7711
7748
|
height: 15px;
|
|
7712
7749
|
fill: none;
|
|
@@ -7720,48 +7757,46 @@ const Root$b = styled.div(_t$d || (_t$d = _$d`
|
|
|
7720
7757
|
display: block;
|
|
7721
7758
|
}
|
|
7722
7759
|
transform-origin: 7.5px 7.5px;
|
|
7723
|
-
}
|
|
7760
|
+
}
|
|
7724
7761
|
|
|
7725
|
-
[data-placement^='top'] > & {
|
|
7726
|
-
bottom: -
|
|
7762
|
+
[data-popper-placement^='top'] > div > & {
|
|
7763
|
+
bottom: -15px;
|
|
7727
7764
|
}
|
|
7728
7765
|
|
|
7729
|
-
[data-placement^='right'] > & {
|
|
7730
|
-
left: -
|
|
7766
|
+
[data-popper-placement^='right'] > div > & {
|
|
7767
|
+
left: -15px;
|
|
7731
7768
|
|
|
7732
7769
|
& > svg {
|
|
7733
7770
|
transform: rotate(90deg);
|
|
7734
7771
|
}
|
|
7735
7772
|
}
|
|
7736
7773
|
|
|
7737
|
-
[data-placement^='left'] > & {
|
|
7738
|
-
right: -
|
|
7774
|
+
[data-popper-placement^='left'] > div > & {
|
|
7775
|
+
right: -15px;
|
|
7739
7776
|
|
|
7740
7777
|
& > svg {
|
|
7741
7778
|
transform: rotate(-90deg);
|
|
7742
7779
|
}
|
|
7743
7780
|
}
|
|
7744
7781
|
|
|
7745
|
-
[data-placement^='bottom'] > & {
|
|
7746
|
-
top: -
|
|
7782
|
+
[data-popper-placement^='bottom'] > div > & {
|
|
7783
|
+
top: -15px;
|
|
7747
7784
|
|
|
7748
7785
|
& > svg {
|
|
7749
7786
|
transform: rotate(180deg);
|
|
7750
7787
|
}
|
|
7751
7788
|
}
|
|
7752
7789
|
`));
|
|
7753
|
-
const Border = styled.path(_t2$9 || (_t2$9 = _$
|
|
7790
|
+
const Border = styled.path(_t2$9 || (_t2$9 = _$c`
|
|
7754
7791
|
fill: var(--card-shadow-outline-color);
|
|
7755
7792
|
`));
|
|
7756
|
-
const Shape = styled.path(_t3$4 || (_t3$4 = _$
|
|
7793
|
+
const Shape = styled.path(_t3$4 || (_t3$4 = _$c`
|
|
7757
7794
|
fill: var(--card-bg-color);
|
|
7758
7795
|
`));
|
|
7759
7796
|
const TooltipArrow = /*#__PURE__*/forwardRef(function TooltipArrow(props, ref) {
|
|
7760
7797
|
const restProps = _extends({}, props);
|
|
7761
7798
|
|
|
7762
|
-
return /*#__PURE__*/React.createElement(Root$b, _extends({
|
|
7763
|
-
"data-ui": "Tooltip__arrow"
|
|
7764
|
-
}, restProps, {
|
|
7799
|
+
return /*#__PURE__*/React.createElement(Root$b, _extends({}, restProps, {
|
|
7765
7800
|
ref: ref
|
|
7766
7801
|
}), /*#__PURE__*/React.createElement("svg", {
|
|
7767
7802
|
width: "15",
|
|
@@ -7774,11 +7809,11 @@ const TooltipArrow = /*#__PURE__*/forwardRef(function TooltipArrow(props, ref) {
|
|
|
7774
7809
|
})));
|
|
7775
7810
|
});
|
|
7776
7811
|
|
|
7777
|
-
const _excluded$g = ["boundaryElement", "children", "content", "disabled", "fallbackPlacements", "placement", "portal", "scheme", "
|
|
7812
|
+
const _excluded$g = ["allowedAutoPlacements", "boundaryElement", "children", "content", "disabled", "fallbackPlacements", "placement", "portal", "scheme", "zOffset"];
|
|
7778
7813
|
|
|
7779
|
-
let
|
|
7814
|
+
let _2 = t => t,
|
|
7780
7815
|
_t$c;
|
|
7781
|
-
const Root$a = styled(Layer)(_t$c || (_t$c =
|
|
7816
|
+
const Root$a = styled(Layer)(_t$c || (_t$c = _2`
|
|
7782
7817
|
pointer-events: none;
|
|
7783
7818
|
`));
|
|
7784
7819
|
/**
|
|
@@ -7786,21 +7821,21 @@ const Root$a = styled(Layer)(_t$c || (_t$c = _$c`
|
|
|
7786
7821
|
*/
|
|
7787
7822
|
|
|
7788
7823
|
const Tooltip = /*#__PURE__*/forwardRef(function Tooltip(props, ref) {
|
|
7789
|
-
var _theme$sanity$layer
|
|
7824
|
+
var _theme$sanity$layer;
|
|
7790
7825
|
|
|
7791
7826
|
const boundaryElementContext = useBoundaryElement();
|
|
7792
7827
|
const theme = useTheme();
|
|
7793
7828
|
|
|
7794
7829
|
const {
|
|
7830
|
+
allowedAutoPlacements,
|
|
7795
7831
|
boundaryElement = boundaryElementContext == null ? void 0 : boundaryElementContext.element,
|
|
7796
|
-
children
|
|
7832
|
+
children,
|
|
7797
7833
|
content,
|
|
7798
7834
|
disabled,
|
|
7799
7835
|
fallbackPlacements: fallbackPlacementsProp,
|
|
7800
|
-
placement
|
|
7836
|
+
placement = 'bottom',
|
|
7801
7837
|
portal,
|
|
7802
7838
|
scheme,
|
|
7803
|
-
shadow = 2,
|
|
7804
7839
|
zOffset = (_theme$sanity$layer = theme.sanity.layer) == null ? void 0 : _theme$sanity$layer.tooltip.zOffset
|
|
7805
7840
|
} = props,
|
|
7806
7841
|
restProps = _objectWithoutPropertiesLoose(props, _excluded$g);
|
|
@@ -7808,66 +7843,39 @@ const Tooltip = /*#__PURE__*/forwardRef(function Tooltip(props, ref) {
|
|
|
7808
7843
|
const fallbackPlacements = useArrayProp(fallbackPlacementsProp);
|
|
7809
7844
|
const forwardedRef = useForwardedRef(ref);
|
|
7810
7845
|
const [referenceElement, setReferenceElement] = useState(null);
|
|
7811
|
-
const
|
|
7812
|
-
const
|
|
7813
|
-
const
|
|
7814
|
-
const ret = []; // Flip the floating element when leaving the boundary box
|
|
7815
|
-
|
|
7816
|
-
ret.push(flip({
|
|
7817
|
-
boundary: boundaryElement || undefined,
|
|
7818
|
-
fallbackPlacements,
|
|
7819
|
-
padding: 4,
|
|
7820
|
-
rootBoundary
|
|
7821
|
-
})); // Define distance between reference and floating element
|
|
7822
|
-
|
|
7823
|
-
ret.push(offset({
|
|
7824
|
-
mainAxis: 3
|
|
7825
|
-
})); // Shift the tooltip so its sits with the boundary eleement
|
|
7826
|
-
|
|
7827
|
-
ret.push(shift({
|
|
7828
|
-
boundary: boundaryElement || undefined,
|
|
7829
|
-
rootBoundary,
|
|
7830
|
-
padding: 4
|
|
7831
|
-
})); // Place arrow
|
|
7832
|
-
|
|
7833
|
-
ret.push(arrow({
|
|
7834
|
-
element: arrowRef,
|
|
7835
|
-
padding: 2
|
|
7836
|
-
}));
|
|
7837
|
-
return ret;
|
|
7838
|
-
}, [boundaryElement, fallbackPlacements]);
|
|
7839
|
-
const {
|
|
7840
|
-
x,
|
|
7841
|
-
y,
|
|
7846
|
+
const [popperElement, setPopperElement] = useState(null);
|
|
7847
|
+
const [arrowElement, setArrowElement] = useState(null);
|
|
7848
|
+
const popper = usePopper(referenceElement, popperElement, {
|
|
7842
7849
|
placement,
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7850
|
+
modifiers: [{
|
|
7851
|
+
name: 'arrow',
|
|
7852
|
+
options: {
|
|
7853
|
+
element: arrowElement,
|
|
7854
|
+
padding: 4
|
|
7855
|
+
}
|
|
7856
|
+
}, {
|
|
7857
|
+
name: 'preventOverflow',
|
|
7858
|
+
options: {
|
|
7859
|
+
altAxis: true,
|
|
7860
|
+
boundary: boundaryElement || undefined,
|
|
7861
|
+
padding: 4
|
|
7862
|
+
}
|
|
7863
|
+
}, {
|
|
7864
|
+
name: 'offset',
|
|
7865
|
+
options: {
|
|
7866
|
+
offset: [0, 3]
|
|
7867
|
+
}
|
|
7868
|
+
}, {
|
|
7869
|
+
name: 'flip',
|
|
7870
|
+
options: {
|
|
7871
|
+
allowedAutoPlacements,
|
|
7872
|
+
fallbackPlacements
|
|
7873
|
+
}
|
|
7874
|
+
}]
|
|
7852
7875
|
});
|
|
7853
|
-
const
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
left: x != null ? x : 0
|
|
7857
|
-
}), [strategy, x, y]);
|
|
7858
|
-
const staticSide = placement && FLOATING_STATIC_SIDES[placement.split('-')[0]];
|
|
7859
|
-
const arrowX = (_middlewareData$arrow = middlewareData.arrow) == null ? void 0 : _middlewareData$arrow.x;
|
|
7860
|
-
const arrowY = (_middlewareData$arrow2 = middlewareData.arrow) == null ? void 0 : _middlewareData$arrow2.y;
|
|
7861
|
-
const arrowStyle = useMemo(() => {
|
|
7862
|
-
const style = {
|
|
7863
|
-
left: arrowX !== null ? arrowX : undefined,
|
|
7864
|
-
top: arrowY !== null ? arrowY : undefined,
|
|
7865
|
-
right: undefined,
|
|
7866
|
-
bottom: undefined
|
|
7867
|
-
};
|
|
7868
|
-
if (staticSide) style[staticSide] = -15;
|
|
7869
|
-
return style;
|
|
7870
|
-
}, [arrowX, arrowY, staticSide]);
|
|
7876
|
+
const {
|
|
7877
|
+
forceUpdate
|
|
7878
|
+
} = popper;
|
|
7871
7879
|
const [isOpen, setIsOpen] = useState(false);
|
|
7872
7880
|
const handleBlur = useCallback(() => setIsOpen(false), []);
|
|
7873
7881
|
const handleFocus = useCallback(() => setIsOpen(true), []);
|
|
@@ -7893,7 +7901,23 @@ const Tooltip = /*#__PURE__*/forwardRef(function Tooltip(props, ref) {
|
|
|
7893
7901
|
return () => {
|
|
7894
7902
|
window.removeEventListener('mousemove', handleWindowMouseMove);
|
|
7895
7903
|
};
|
|
7896
|
-
}, [isOpen, referenceElement]);
|
|
7904
|
+
}, [isOpen, referenceElement]);
|
|
7905
|
+
const updateTimeoutRef = useRef(null);
|
|
7906
|
+
useEffect(() => {
|
|
7907
|
+
if (updateTimeoutRef.current) {
|
|
7908
|
+
clearTimeout(updateTimeoutRef.current);
|
|
7909
|
+
updateTimeoutRef.current = null;
|
|
7910
|
+
}
|
|
7911
|
+
|
|
7912
|
+
updateTimeoutRef.current = setTimeout(() => {
|
|
7913
|
+
if (forceUpdate) {
|
|
7914
|
+
try {
|
|
7915
|
+
forceUpdate();
|
|
7916
|
+
} catch (_) {// ignore caught error
|
|
7917
|
+
}
|
|
7918
|
+
}
|
|
7919
|
+
}, 0);
|
|
7920
|
+
}, [forceUpdate, content]); // Close when `disabled` changes to `true`
|
|
7897
7921
|
|
|
7898
7922
|
useEffect(() => {
|
|
7899
7923
|
if (disabled) setIsOpen(false);
|
|
@@ -7901,59 +7925,40 @@ const Tooltip = /*#__PURE__*/forwardRef(function Tooltip(props, ref) {
|
|
|
7901
7925
|
|
|
7902
7926
|
useEffect(() => {
|
|
7903
7927
|
if (!content) setIsOpen(false);
|
|
7904
|
-
}, [content]);
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
setReferenceElement(node);
|
|
7925
|
-
}, [childRef]);
|
|
7926
|
-
const child = useMemo(() => {
|
|
7927
|
-
if (!childProp) return null;
|
|
7928
|
-
return /*#__PURE__*/cloneElement(childProp, {
|
|
7929
|
-
onBlur: handleBlur,
|
|
7930
|
-
onFocus: handleFocus,
|
|
7931
|
-
onMouseEnter: handleMouseEnter,
|
|
7932
|
-
onMouseLeave: handleMouseLeave,
|
|
7933
|
-
ref: setReference
|
|
7934
|
-
});
|
|
7935
|
-
}, [childProp, handleBlur, handleFocus, handleMouseEnter, handleMouseLeave, setReference]);
|
|
7936
|
-
if (!child) return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
7937
|
-
if (disabled) return child;
|
|
7938
|
-
const root = /*#__PURE__*/React.createElement(Root$a, _extends({
|
|
7928
|
+
}, [content]);
|
|
7929
|
+
|
|
7930
|
+
const setRef = el => {
|
|
7931
|
+
setPopperElement(el);
|
|
7932
|
+
forwardedRef.current = el;
|
|
7933
|
+
};
|
|
7934
|
+
|
|
7935
|
+
if (!children) return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
7936
|
+
if (disabled) return children;
|
|
7937
|
+
const referenceProps = {
|
|
7938
|
+
onBlur: handleBlur,
|
|
7939
|
+
onFocus: handleFocus,
|
|
7940
|
+
onMouseEnter: handleMouseEnter,
|
|
7941
|
+
onMouseLeave: handleMouseLeave,
|
|
7942
|
+
ref: setReferenceElement
|
|
7943
|
+
};
|
|
7944
|
+
const referenceNode = /*#__PURE__*/cloneElement(children, referenceProps);
|
|
7945
|
+
const popperNode = /*#__PURE__*/React.createElement(Root$a, _extends({
|
|
7939
7946
|
"data-ui": "Tooltip"
|
|
7940
|
-
}, restProps, {
|
|
7941
|
-
ref:
|
|
7942
|
-
style:
|
|
7947
|
+
}, restProps, popper.attributes.popper, {
|
|
7948
|
+
ref: setRef,
|
|
7949
|
+
style: popper.styles.popper,
|
|
7943
7950
|
zOffset: zOffset
|
|
7944
7951
|
}), /*#__PURE__*/React.createElement(Card, {
|
|
7945
|
-
"data-ui": "Tooltip__card",
|
|
7946
|
-
"data-placement": placement,
|
|
7947
7952
|
radius: 2,
|
|
7948
7953
|
scheme: scheme,
|
|
7949
|
-
shadow:
|
|
7954
|
+
shadow: 3
|
|
7950
7955
|
}, content, /*#__PURE__*/React.createElement(TooltipArrow, {
|
|
7951
|
-
ref:
|
|
7952
|
-
style:
|
|
7956
|
+
ref: setArrowElement,
|
|
7957
|
+
style: popper.styles.arrow
|
|
7953
7958
|
})));
|
|
7954
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
7959
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, referenceNode, isOpen && /*#__PURE__*/React.createElement(React.Fragment, null, portal && /*#__PURE__*/React.createElement(Portal, {
|
|
7955
7960
|
__unstable_name: typeof portal === 'string' ? portal : undefined
|
|
7956
|
-
},
|
|
7961
|
+
}, popperNode), !portal && popperNode));
|
|
7957
7962
|
});
|
|
7958
7963
|
|
|
7959
7964
|
let _$b = t => t,
|
|
@@ -7985,6 +7990,11 @@ const ListBox = styled(Box)(_t2$8 || (_t2$8 = _$b`
|
|
|
7985
7990
|
*/
|
|
7986
7991
|
|
|
7987
7992
|
const ResultsPopover = styled(Popover)(_t3$3 || (_t3$3 = _$b`
|
|
7993
|
+
& > div {
|
|
7994
|
+
overflow: auto;
|
|
7995
|
+
-webkit-overflow-scrolling: touch;
|
|
7996
|
+
}
|
|
7997
|
+
|
|
7988
7998
|
&[data-popper-reference-hidden='true'] {
|
|
7989
7999
|
display: none;
|
|
7990
8000
|
}
|
|
@@ -8116,17 +8126,17 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ['Control', 'Shift', 'Alt', 'Enter', 'H
|
|
|
8116
8126
|
* @internal
|
|
8117
8127
|
*/
|
|
8118
8128
|
|
|
8119
|
-
const AUTOCOMPLETE_POPOVER_MARGINS = [0, 1,
|
|
8129
|
+
const AUTOCOMPLETE_POPOVER_MARGINS = [0, 1, 1, 1];
|
|
8120
8130
|
/**
|
|
8121
8131
|
* @internal
|
|
8122
8132
|
*/
|
|
8123
8133
|
|
|
8124
|
-
const AUTOCOMPLETE_POPOVER_PLACEMENT = 'bottom';
|
|
8134
|
+
const AUTOCOMPLETE_POPOVER_PLACEMENT = 'bottom-start';
|
|
8125
8135
|
/**
|
|
8126
8136
|
* @internal
|
|
8127
8137
|
*/
|
|
8128
8138
|
|
|
8129
|
-
const AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ['
|
|
8139
|
+
const AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ['top-start'];
|
|
8130
8140
|
|
|
8131
8141
|
const _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"];
|
|
8132
8142
|
|