@sanity/ui 1.5.0 → 1.6.0
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/dist/index.d.ts +20 -9
- package/dist/index.esm.js +183 -120
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +182 -119
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/primitives/popover/__workshop__/AlignedStory.tsx +1 -0
- package/src/primitives/popover/__workshop__/SidePanelStory.tsx +86 -0
- package/src/primitives/popover/__workshop__/TestStory.tsx +30 -18
- package/src/primitives/popover/__workshop__/index.ts +5 -0
- package/src/primitives/popover/helpers.ts +32 -0
- package/src/primitives/popover/index.ts +1 -0
- package/src/primitives/popover/popover.tsx +125 -51
- package/src/primitives/popover/popoverCard.tsx +21 -50
- package/src/primitives/popover/types.ts +6 -0
- package/src/primitives/tooltip/tooltip.tsx +4 -4
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36, _templateObject37, _templateObject38, _templateObject39, _templateObject40, _templateObject41, _templateObject42, _templateObject43, _templateObject44, _templateObject45, _templateObject46, _templateObject47, _templateObject48, _templateObject49, _templateObject50, _templateObject51, _templateObject52, _templateObject53, _templateObject54, _templateObject55, _templateObject56, _templateObject57, _templateObject58, _templateObject59, _templateObject60, _templateObject61, _templateObject62, _templateObject63, _templateObject64, _templateObject65, _templateObject66, _templateObject67, _templateObject68, _templateObject69, _templateObject70, _templateObject71, _templateObject72, _templateObject73, _templateObject74, _templateObject75, _templateObject76, _templateObject77, _templateObject78, _templateObject79, _templateObject80, _templateObject81, _templateObject82, _templateObject83, _templateObject84, _templateObject85, _templateObject86, _templateObject87, _templateObject88
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36, _templateObject37, _templateObject38, _templateObject39, _templateObject40, _templateObject41, _templateObject42, _templateObject43, _templateObject44, _templateObject45, _templateObject46, _templateObject47, _templateObject48, _templateObject49, _templateObject50, _templateObject51, _templateObject52, _templateObject53, _templateObject54, _templateObject55, _templateObject56, _templateObject57, _templateObject58, _templateObject59, _templateObject60, _templateObject61, _templateObject62, _templateObject63, _templateObject64, _templateObject65, _templateObject66, _templateObject67, _templateObject68, _templateObject69, _templateObject70, _templateObject71, _templateObject72, _templateObject73, _templateObject74, _templateObject75, _templateObject76, _templateObject77, _templateObject78, _templateObject79, _templateObject80, _templateObject81, _templateObject82, _templateObject83, _templateObject84, _templateObject85, _templateObject86, _templateObject87, _templateObject88;
|
|
4
4
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
5
5
|
Object.defineProperty(exports, '__esModule', {
|
|
6
6
|
value: true
|
|
@@ -5815,6 +5815,26 @@ function size(options) {
|
|
|
5815
5815
|
}
|
|
5816
5816
|
};
|
|
5817
5817
|
}
|
|
5818
|
+
function calcCurrentWidth(params) {
|
|
5819
|
+
const {
|
|
5820
|
+
mediaIndex,
|
|
5821
|
+
theme,
|
|
5822
|
+
width
|
|
5823
|
+
} = params;
|
|
5824
|
+
const w = width[mediaIndex];
|
|
5825
|
+
const currentWidth = w === void 0 ? width[width.length - 1] : w;
|
|
5826
|
+
return typeof currentWidth === "number" ? theme.sanity.container[currentWidth] : void 0;
|
|
5827
|
+
}
|
|
5828
|
+
function calcMaxWidth(params) {
|
|
5829
|
+
const {
|
|
5830
|
+
boundaryWidth,
|
|
5831
|
+
currentWidth
|
|
5832
|
+
} = params;
|
|
5833
|
+
if (currentWidth === void 0 && boundaryWidth === void 0) {
|
|
5834
|
+
return void 0;
|
|
5835
|
+
}
|
|
5836
|
+
return Math.min(currentWidth != null ? currentWidth : Infinity, (boundaryWidth || Infinity) - DEFAULT_POPOVER_PADDING * 2);
|
|
5837
|
+
}
|
|
5818
5838
|
const Root$j = styled__default.default.div(_templateObject32 || (_templateObject32 = _taggedTemplateLiteral(["\n position: absolute;\n pointer-events: none;\n width: ", "px;\n height: ", "px;\n fill: none;\n\n :empty + & {\n display: none;\n }\n\n & > svg {\n display: block;\n transform-origin: ", "px ", "px;\n }\n\n [data-placement^='top'] > & {\n bottom: -", "px;\n }\n\n [data-placement^='right'] > & {\n left: -", "px;\n\n & > svg {\n transform: rotate(90deg);\n }\n }\n\n [data-placement^='left'] > & {\n right: -", "px;\n\n & > svg {\n transform: rotate(-90deg);\n }\n }\n\n [data-placement^='bottom'] > & {\n top: -", "px;\n\n & > svg {\n transform: rotate(180deg);\n }\n }\n"])), DEFAULT_POPOVER_ARROW_WIDTH, DEFAULT_POPOVER_ARROW_WIDTH, DEFAULT_POPOVER_ARROW_WIDTH / 2, DEFAULT_POPOVER_ARROW_WIDTH / 2, DEFAULT_POPOVER_ARROW_WIDTH, DEFAULT_POPOVER_ARROW_WIDTH, DEFAULT_POPOVER_ARROW_WIDTH, DEFAULT_POPOVER_ARROW_WIDTH);
|
|
5819
5839
|
const BorderPath = styled__default.default.path(_templateObject33 || (_templateObject33 = _taggedTemplateLiteral(["\n fill: var(--card-shadow-outline-color);\n"])));
|
|
5820
5840
|
const ShapePath = styled__default.default.path(_templateObject34 || (_templateObject34 = _taggedTemplateLiteral(["\n fill: var(--card-bg-color);\n"])));
|
|
@@ -5837,22 +5857,14 @@ const PopoverArrow = react.forwardRef(function PopoverArrow2(props, ref) {
|
|
|
5837
5857
|
})
|
|
5838
5858
|
});
|
|
5839
5859
|
});
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
}
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
flexDirection: "column",
|
|
5849
|
-
width: "max-content",
|
|
5850
|
-
minWidth: "min-content",
|
|
5851
|
-
maxWidth: typeof $boundaryWidth === "number" ? "".concat($boundaryWidth - DEFAULT_POPOVER_PADDING * 2, "px") : void 0
|
|
5852
|
-
};
|
|
5853
|
-
}
|
|
5854
|
-
const Root$i = react.memo(styled__default.default(Card)(popoverCardStyle));
|
|
5855
|
-
const PopoverContainer = react.memo(styled__default.default(Container)(_templateObject35 || (_templateObject35 = _taggedTemplateLiteral(["\n max-height: inherit;\n max-width: inherit;\n"]))));
|
|
5860
|
+
const Root$i = styled__default.default(Card)({
|
|
5861
|
+
"&:not([hidden])": {
|
|
5862
|
+
display: "flex"
|
|
5863
|
+
},
|
|
5864
|
+
flexDirection: "column",
|
|
5865
|
+
width: "max-content",
|
|
5866
|
+
minWidth: "min-content"
|
|
5867
|
+
});
|
|
5856
5868
|
const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref) {
|
|
5857
5869
|
const {
|
|
5858
5870
|
__unstable_margins: marginsProp,
|
|
@@ -5860,7 +5872,6 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
5860
5872
|
arrowRef,
|
|
5861
5873
|
arrowX,
|
|
5862
5874
|
arrowY,
|
|
5863
|
-
boundaryWidth,
|
|
5864
5875
|
children,
|
|
5865
5876
|
padding,
|
|
5866
5877
|
placement,
|
|
@@ -5871,7 +5882,7 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
5871
5882
|
strategy,
|
|
5872
5883
|
style,
|
|
5873
5884
|
tone,
|
|
5874
|
-
width
|
|
5885
|
+
width,
|
|
5875
5886
|
x: xProp,
|
|
5876
5887
|
y: yProp,
|
|
5877
5888
|
...restProps
|
|
@@ -5886,9 +5897,10 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
5886
5897
|
position: strategy,
|
|
5887
5898
|
top: y,
|
|
5888
5899
|
left: x,
|
|
5900
|
+
width,
|
|
5889
5901
|
zIndex,
|
|
5890
5902
|
...style
|
|
5891
|
-
}), [strategy, style, x, y, zIndex]);
|
|
5903
|
+
}), [strategy, style, width, x, y, zIndex]);
|
|
5892
5904
|
const staticSide = placement && FLOATING_STATIC_SIDES[placement.split("-")[0]];
|
|
5893
5905
|
const arrowStyle = react.useMemo(() => {
|
|
5894
5906
|
const style2 = {
|
|
@@ -5901,10 +5913,9 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
5901
5913
|
return style2;
|
|
5902
5914
|
}, [arrowX, arrowY, staticSide]);
|
|
5903
5915
|
return /* @__PURE__ */jsxRuntime.jsxs(Root$i, {
|
|
5916
|
+
"data-ui": "Popover",
|
|
5904
5917
|
...restProps,
|
|
5905
|
-
$boundaryWidth: boundaryWidth,
|
|
5906
5918
|
"data-placement": placement,
|
|
5907
|
-
"data-ui": "Popover",
|
|
5908
5919
|
radius,
|
|
5909
5920
|
ref,
|
|
5910
5921
|
scheme,
|
|
@@ -5912,14 +5923,17 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
5912
5923
|
sizing: "border",
|
|
5913
5924
|
style: rootStyle,
|
|
5914
5925
|
tone,
|
|
5915
|
-
children: [/* @__PURE__ */jsxRuntime.jsx(
|
|
5926
|
+
children: [/* @__PURE__ */jsxRuntime.jsx(Flex, {
|
|
5916
5927
|
"data-ui": "Popover__wrapper",
|
|
5928
|
+
direction: "column",
|
|
5917
5929
|
flex: 1,
|
|
5918
5930
|
overflow,
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5931
|
+
children: /* @__PURE__ */jsxRuntime.jsx(Flex, {
|
|
5932
|
+
direction: "column",
|
|
5933
|
+
flex: 1,
|
|
5934
|
+
padding,
|
|
5935
|
+
children
|
|
5936
|
+
})
|
|
5923
5937
|
}), arrow && /* @__PURE__ */jsxRuntime.jsx(PopoverArrow, {
|
|
5924
5938
|
ref: arrowRef,
|
|
5925
5939
|
style: arrowStyle
|
|
@@ -5928,7 +5942,7 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
5928
5942
|
}));
|
|
5929
5943
|
PopoverCard.displayName = "PopoverCard";
|
|
5930
5944
|
const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
5931
|
-
var _a, _b, _c, _d, _e;
|
|
5945
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
5932
5946
|
const theme = useTheme();
|
|
5933
5947
|
const boundaryElementContext = useBoundaryElement();
|
|
5934
5948
|
const {
|
|
@@ -5940,7 +5954,8 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
5940
5954
|
content,
|
|
5941
5955
|
disabled,
|
|
5942
5956
|
fallbackPlacements,
|
|
5943
|
-
matchReferenceWidth
|
|
5957
|
+
matchReferenceWidth,
|
|
5958
|
+
floatingBoundary = (_a = props.boundaryElement) != null ? _a : boundaryElementContext.element,
|
|
5944
5959
|
open,
|
|
5945
5960
|
overflow = "hidden",
|
|
5946
5961
|
padding: paddingProp,
|
|
@@ -5948,28 +5963,65 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
5948
5963
|
portal,
|
|
5949
5964
|
preventOverflow = true,
|
|
5950
5965
|
radius: radiusProp = 3,
|
|
5966
|
+
referenceBoundary = (_b = props.boundaryElement) != null ? _b : boundaryElementContext.element,
|
|
5951
5967
|
referenceElement,
|
|
5952
5968
|
scheme,
|
|
5953
5969
|
shadow: shadowProp = 3,
|
|
5954
5970
|
tone = "inherit",
|
|
5955
5971
|
width: widthProp = "auto",
|
|
5956
|
-
zOffset: zOffsetProp = (
|
|
5972
|
+
zOffset: zOffsetProp = (_c = theme.sanity.layer) == null ? void 0 : _c.popover.zOffset,
|
|
5973
|
+
updateRef,
|
|
5957
5974
|
...restProps
|
|
5958
5975
|
} = props;
|
|
5959
|
-
const boundarySize = (
|
|
5976
|
+
const boundarySize = (_d = useElementSize(boundaryElement)) == null ? void 0 : _d.border;
|
|
5960
5977
|
const padding = useArrayProp(paddingProp);
|
|
5961
5978
|
const radius = useArrayProp(radiusProp);
|
|
5962
5979
|
const shadow = useArrayProp(shadowProp);
|
|
5963
|
-
const
|
|
5980
|
+
const widthArrayProp = useArrayProp(widthProp);
|
|
5964
5981
|
const zOffset = useArrayProp(zOffsetProp);
|
|
5965
5982
|
const forwardedRef = useForwardedRef(ref);
|
|
5966
5983
|
const arrowRef = react.useRef(null);
|
|
5967
5984
|
const rootBoundary = "viewport";
|
|
5985
|
+
const mediaIndex = useMediaIndex();
|
|
5986
|
+
const boundaryWidth = constrainSize || preventOverflow ? boundarySize == null ? void 0 : boundarySize.width : void 0;
|
|
5987
|
+
const width = calcCurrentWidth({
|
|
5988
|
+
mediaIndex,
|
|
5989
|
+
theme,
|
|
5990
|
+
width: widthArrayProp
|
|
5991
|
+
});
|
|
5992
|
+
const widthRef = react.useRef(width);
|
|
5993
|
+
react.useEffect(() => {
|
|
5994
|
+
widthRef.current = width;
|
|
5995
|
+
}, [width]);
|
|
5996
|
+
const maxWidth = calcMaxWidth({
|
|
5997
|
+
boundaryWidth,
|
|
5998
|
+
currentWidth: width
|
|
5999
|
+
});
|
|
6000
|
+
const maxWidthRef = react.useRef(maxWidth);
|
|
6001
|
+
react.useEffect(() => {
|
|
6002
|
+
maxWidthRef.current = maxWidth;
|
|
6003
|
+
}, [maxWidth]);
|
|
6004
|
+
const referenceWidthRef = react.useRef();
|
|
6005
|
+
react.useEffect(() => {
|
|
6006
|
+
const floatingElement = forwardedRef.current;
|
|
6007
|
+
if (!open || !floatingElement) return;
|
|
6008
|
+
const referenceWidth = referenceWidthRef.current;
|
|
6009
|
+
if (matchReferenceWidth) {
|
|
6010
|
+
if (referenceWidth !== void 0) {
|
|
6011
|
+
floatingElement.style.width = "".concat(referenceWidth, "px");
|
|
6012
|
+
}
|
|
6013
|
+
} else if (width !== void 0) {
|
|
6014
|
+
floatingElement.style.width = "".concat(width, "px");
|
|
6015
|
+
}
|
|
6016
|
+
if (typeof maxWidth === "number") {
|
|
6017
|
+
floatingElement.style.maxWidth = "".concat(maxWidth, "px");
|
|
6018
|
+
}
|
|
6019
|
+
}, [width, forwardedRef, matchReferenceWidth, maxWidth, open]);
|
|
5968
6020
|
const middleware = react.useMemo(() => {
|
|
5969
6021
|
const ret = [];
|
|
5970
6022
|
if (constrainSize || preventOverflow) {
|
|
5971
6023
|
ret.push(reactDom$1.flip({
|
|
5972
|
-
boundary:
|
|
6024
|
+
boundary: floatingBoundary || void 0,
|
|
5973
6025
|
fallbackPlacements,
|
|
5974
6026
|
padding: DEFAULT_POPOVER_PADDING,
|
|
5975
6027
|
rootBoundary
|
|
@@ -5978,7 +6030,7 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
5978
6030
|
ret.push(reactDom$1.offset({
|
|
5979
6031
|
mainAxis: arrowProp ? DEFAULT_POPOVER_DISTANCE : 0
|
|
5980
6032
|
}));
|
|
5981
|
-
if (constrainSize ||
|
|
6033
|
+
if (constrainSize || matchReferenceWidth) {
|
|
5982
6034
|
ret.push(size({
|
|
5983
6035
|
apply(_ref21) {
|
|
5984
6036
|
let {
|
|
@@ -5987,24 +6039,29 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
5987
6039
|
elements,
|
|
5988
6040
|
referenceWidth
|
|
5989
6041
|
} = _ref21;
|
|
5990
|
-
|
|
6042
|
+
referenceWidthRef.current = referenceWidth;
|
|
6043
|
+
const _currentWidth = widthRef.current;
|
|
6044
|
+
const _maxWidth = maxWidthRef.current;
|
|
6045
|
+
if (matchReferenceWidth) {
|
|
5991
6046
|
elements.floating.style.width = "".concat(referenceWidth, "px");
|
|
6047
|
+
} else if (_currentWidth !== void 0) {
|
|
6048
|
+
elements.floating.style.width = "".concat(_currentWidth, "px");
|
|
5992
6049
|
}
|
|
5993
6050
|
if (constrainSize) {
|
|
5994
|
-
elements.floating.style.maxWidth = "".concat(availableWidth, "px");
|
|
6051
|
+
elements.floating.style.maxWidth = "".concat(Math.min(availableWidth, _maxWidth != null ? _maxWidth : Infinity), "px");
|
|
5995
6052
|
elements.floating.style.maxHeight = "".concat(availableHeight, "px");
|
|
5996
6053
|
}
|
|
5997
6054
|
},
|
|
5998
|
-
boundaryElement,
|
|
6055
|
+
boundaryElement: floatingBoundary || void 0,
|
|
5999
6056
|
constrainSize,
|
|
6000
6057
|
margins,
|
|
6001
|
-
matchReferenceWidth
|
|
6058
|
+
matchReferenceWidth,
|
|
6002
6059
|
padding: DEFAULT_POPOVER_PADDING
|
|
6003
6060
|
}));
|
|
6004
6061
|
}
|
|
6005
6062
|
if (preventOverflow) {
|
|
6006
6063
|
ret.push(reactDom$1.shift({
|
|
6007
|
-
boundary:
|
|
6064
|
+
boundary: floatingBoundary || void 0,
|
|
6008
6065
|
rootBoundary,
|
|
6009
6066
|
padding: DEFAULT_POPOVER_PADDING
|
|
6010
6067
|
}));
|
|
@@ -6016,45 +6073,44 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6016
6073
|
}));
|
|
6017
6074
|
}
|
|
6018
6075
|
ret.push(reactDom$1.hide({
|
|
6019
|
-
boundary:
|
|
6076
|
+
boundary: referenceBoundary || void 0,
|
|
6020
6077
|
padding: DEFAULT_POPOVER_PADDING,
|
|
6021
6078
|
strategy: "referenceHidden"
|
|
6022
6079
|
}));
|
|
6023
6080
|
return ret;
|
|
6024
|
-
}, [arrowProp,
|
|
6025
|
-
const floatingProps = react.useMemo(() => ({
|
|
6026
|
-
middleware,
|
|
6027
|
-
placement: placementProp,
|
|
6028
|
-
whileElementsMounted: reactDom$1.autoUpdate
|
|
6029
|
-
}), [middleware, placementProp]);
|
|
6081
|
+
}, [arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]);
|
|
6030
6082
|
const {
|
|
6031
6083
|
x,
|
|
6032
6084
|
y,
|
|
6033
|
-
placement,
|
|
6034
|
-
reference: referenceRef,
|
|
6035
|
-
floating: floatingRef,
|
|
6036
6085
|
middlewareData,
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6086
|
+
placement,
|
|
6087
|
+
refs,
|
|
6088
|
+
strategy,
|
|
6089
|
+
update
|
|
6090
|
+
} = reactDom$1.useFloating({
|
|
6091
|
+
middleware,
|
|
6092
|
+
placement: placementProp,
|
|
6093
|
+
whileElementsMounted: reactDom$1.autoUpdate
|
|
6094
|
+
});
|
|
6095
|
+
const referenceHidden = (_e = middlewareData.hide) == null ? void 0 : _e.referenceHidden;
|
|
6096
|
+
const arrowX = (_f = middlewareData.arrow) == null ? void 0 : _f.x;
|
|
6097
|
+
const arrowY = (_g = middlewareData.arrow) == null ? void 0 : _g.y;
|
|
6042
6098
|
const setArrow = react.useCallback(arrowEl => {
|
|
6043
6099
|
arrowRef.current = arrowEl;
|
|
6044
6100
|
}, []);
|
|
6045
6101
|
const setFloating = react.useCallback(node => {
|
|
6046
6102
|
forwardedRef.current = node;
|
|
6047
|
-
|
|
6048
|
-
}, [
|
|
6103
|
+
refs.setFloating(node);
|
|
6104
|
+
}, [forwardedRef, refs]);
|
|
6049
6105
|
const setReference = react.useCallback(node => {
|
|
6050
|
-
|
|
6106
|
+
refs.setReference(node);
|
|
6051
6107
|
const childRef = childProp == null ? void 0 : childProp.ref;
|
|
6052
6108
|
if (typeof childRef === "function") {
|
|
6053
6109
|
childRef(node);
|
|
6054
6110
|
} else if (childRef) {
|
|
6055
6111
|
childRef.current = node;
|
|
6056
6112
|
}
|
|
6057
|
-
}, [childProp,
|
|
6113
|
+
}, [childProp, refs]);
|
|
6058
6114
|
const child = react.useMemo(() => {
|
|
6059
6115
|
if (!childProp || referenceElement) return null;
|
|
6060
6116
|
return react.cloneElement(childProp, {
|
|
@@ -6062,8 +6118,17 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6062
6118
|
});
|
|
6063
6119
|
}, [childProp, referenceElement, setReference]);
|
|
6064
6120
|
react.useEffect(() => {
|
|
6065
|
-
|
|
6066
|
-
|
|
6121
|
+
if (updateRef) {
|
|
6122
|
+
if (typeof updateRef === "function") {
|
|
6123
|
+
updateRef(update);
|
|
6124
|
+
} else if (updateRef) {
|
|
6125
|
+
updateRef.current = update;
|
|
6126
|
+
}
|
|
6127
|
+
}
|
|
6128
|
+
}, [update, updateRef]);
|
|
6129
|
+
react.useEffect(() => {
|
|
6130
|
+
refs.setReference(referenceElement || null);
|
|
6131
|
+
}, [referenceElement, refs]);
|
|
6067
6132
|
if (disabled) {
|
|
6068
6133
|
return childProp || /* @__PURE__ */jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
6069
6134
|
}
|
|
@@ -6076,7 +6141,6 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6076
6141
|
arrowRef: setArrow,
|
|
6077
6142
|
arrowX,
|
|
6078
6143
|
arrowY,
|
|
6079
|
-
boundaryWidth: preventOverflow ? boundarySize == null ? void 0 : boundarySize.width : void 0,
|
|
6080
6144
|
hidden: referenceHidden,
|
|
6081
6145
|
overflow,
|
|
6082
6146
|
padding,
|
|
@@ -6087,9 +6151,9 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6087
6151
|
shadow,
|
|
6088
6152
|
strategy,
|
|
6089
6153
|
tone,
|
|
6154
|
+
width: matchReferenceWidth ? referenceWidthRef.current : width,
|
|
6090
6155
|
x,
|
|
6091
6156
|
y,
|
|
6092
|
-
width,
|
|
6093
6157
|
children: content
|
|
6094
6158
|
})
|
|
6095
6159
|
});
|
|
@@ -6104,7 +6168,7 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6104
6168
|
}));
|
|
6105
6169
|
Popover.displayName = "Popover";
|
|
6106
6170
|
function radioBaseStyle() {
|
|
6107
|
-
return styled.css(
|
|
6171
|
+
return styled.css(_templateObject35 || (_templateObject35 = _taggedTemplateLiteral(["\n position: relative;\n\n &:not([hidden]) {\n display: inline-block;\n }\n\n &[data-read-only] {\n outline: 1px solid red;\n }\n "])));
|
|
6108
6172
|
}
|
|
6109
6173
|
function inputElementStyle(props) {
|
|
6110
6174
|
const {
|
|
@@ -6116,7 +6180,7 @@ function inputElementStyle(props) {
|
|
|
6116
6180
|
} = theme.sanity;
|
|
6117
6181
|
const color = theme.sanity.color.input;
|
|
6118
6182
|
const dist = (input.radio.size - input.radio.markSize) / 2;
|
|
6119
|
-
return styled.css(
|
|
6183
|
+
return styled.css(_templateObject36 || (_templateObject36 = _taggedTemplateLiteral(["\n appearance: none;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n z-index: 1;\n padding: 0;\n margin: 0;\n border-radius: ", ";\n border: none;\n\n /* enabled */\n & + span {\n display: block;\n position: relative;\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n\n &::after {\n content: '';\n position: absolute;\n top: ", ";\n left: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n background: ", ";\n opacity: 0;\n }\n }\n\n /* focused */\n &:not(:disabled):focus + span {\n box-shadow: ", ";\n }\n\n &:not(:disabled):focus:not(:focus-visible) + span {\n box-shadow: ", ";\n }\n\n &:checked + span::after {\n opacity: 1;\n }\n\n /* read only */\n &[data-read-only] + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n\n /* disabled */\n &:not([data-read-only]):disabled + span {\n box-shadow: 0 0 0 1px ", ";\n background: ", ";\n\n &::after {\n background: ", ";\n }\n }\n "])), rem(input.radio.size / 2), rem(input.radio.size), rem(input.radio.size), rem(input.radio.size / 2), color.default.enabled.bg, focusRingBorderStyle({
|
|
6120
6184
|
color: color.default.enabled.border,
|
|
6121
6185
|
width: input.border.width
|
|
6122
6186
|
}), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.default.enabled.fg, focusRingStyle({
|
|
@@ -6158,14 +6222,14 @@ const Radio = react.forwardRef(function Radio2(props, forwardedRef) {
|
|
|
6158
6222
|
});
|
|
6159
6223
|
});
|
|
6160
6224
|
function rootStyle() {
|
|
6161
|
-
return styled.css(
|
|
6225
|
+
return styled.css(_templateObject37 || (_templateObject37 = _taggedTemplateLiteral(["\n position: relative;\n width: stretch;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
|
|
6162
6226
|
}
|
|
6163
6227
|
function inputBaseStyle(props) {
|
|
6164
6228
|
const {
|
|
6165
6229
|
theme
|
|
6166
6230
|
} = props;
|
|
6167
6231
|
const font = theme.sanity.fonts.text;
|
|
6168
|
-
return styled.css(
|
|
6232
|
+
return styled.css(_templateObject38 || (_templateObject38 = _taggedTemplateLiteral(["\n -webkit-font-smoothing: antialiased;\n appearance: none;\n border: 0;\n font-family: ", ";\n color: inherit;\n width: 100%;\n outline: none;\n margin: 0;\n\n &:disabled {\n opacity: 1;\n }\n "])), font.family);
|
|
6169
6233
|
}
|
|
6170
6234
|
function inputColorStyle(props) {
|
|
6171
6235
|
const {
|
|
@@ -6176,7 +6240,7 @@ function inputColorStyle(props) {
|
|
|
6176
6240
|
input
|
|
6177
6241
|
} = theme.sanity;
|
|
6178
6242
|
const color = theme.sanity.color.input;
|
|
6179
|
-
return styled.css(
|
|
6243
|
+
return styled.css(_templateObject39 || (_templateObject39 = _taggedTemplateLiteral(["\n /* enabled */\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n\n /* hovered */\n @media (hover: hover) {\n &:not(:disabled):hover {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n }\n\n /* focused */\n &:not(:disabled):focus {\n box-shadow: ", ";\n }\n\n /* read-only */\n &[data-read-only] {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n\n /* disabled */\n &:not([data-read-only]):disabled {\n background-color: ", ";\n color: ", ";\n box-shadow: ", ";\n }\n "])), color.default.enabled.bg, color.default.enabled.fg, focusRingBorderStyle({
|
|
6180
6244
|
color: color.default.enabled.border,
|
|
6181
6245
|
width: input.border.width
|
|
6182
6246
|
}), color.default.hovered.bg, color.default.hovered.fg, focusRingBorderStyle({
|
|
@@ -6220,7 +6284,7 @@ function iconBoxStyle(props) {
|
|
|
6220
6284
|
theme
|
|
6221
6285
|
} = props;
|
|
6222
6286
|
const color = theme.sanity.color.input;
|
|
6223
|
-
return styled.css(
|
|
6287
|
+
return styled.css(_templateObject40 || (_templateObject40 = _taggedTemplateLiteral(["\n pointer-events: none;\n position: absolute;\n top: 0;\n right: 0;\n\n /* enabled */\n --card-fg-color: ", ";\n\n /* hover */\n @media (hover: hover) {\n select:not(disabled):not(:read-only):hover + && {\n --card-fg-color: ", ";\n }\n }\n\n /* disabled */\n select:disabled + && {\n --card-fg-color: ", ";\n }\n\n /* read-only */\n select[data-read-only] + && {\n --card-fg-color: ", ";\n }\n "])), color.default.enabled.fg, color.default.hovered.fg, color.default.disabled.fg, color.default.readOnly.fg);
|
|
6224
6288
|
}
|
|
6225
6289
|
const selectStyle = {
|
|
6226
6290
|
root: rootStyle,
|
|
@@ -6308,10 +6372,10 @@ const Stack = react.forwardRef(function Stack2(props, ref) {
|
|
|
6308
6372
|
});
|
|
6309
6373
|
});
|
|
6310
6374
|
function switchBaseStyles() {
|
|
6311
|
-
return styled.css(
|
|
6375
|
+
return styled.css(_templateObject41 || (_templateObject41 = _taggedTemplateLiteral(["\n position: relative;\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
|
|
6312
6376
|
}
|
|
6313
6377
|
function switchInputStyles() {
|
|
6314
|
-
return styled.css(
|
|
6378
|
+
return styled.css(_templateObject42 || (_templateObject42 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n padding: 0;\n margin: 0;\n\n /* Place the input element above the representation element */\n z-index: 1;\n "])));
|
|
6315
6379
|
}
|
|
6316
6380
|
function switchRepresentationStyles(props) {
|
|
6317
6381
|
const {
|
|
@@ -6322,7 +6386,7 @@ function switchRepresentationStyles(props) {
|
|
|
6322
6386
|
input
|
|
6323
6387
|
} = theme.sanity;
|
|
6324
6388
|
const color = theme.sanity.color.button.default;
|
|
6325
|
-
return styled.css(
|
|
6389
|
+
return styled.css(_templateObject43 || (_templateObject43 = _taggedTemplateLiteral(["\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n --switch-box-shadow: none;\n\n &:not([hidden]) {\n display: block;\n }\n position: relative;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n\n /* Make sure it\u2019s not possible to interact with the wrapper element */\n pointer-events: none;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n box-shadow: var(--switch-box-shadow);\n border-radius: inherit;\n }\n\n /* Focus styles */\n input:focus + && {\n --switch-box-shadow: ", ";\n }\n\n input:focus:not(:focus-visible) + && {\n --switch-box-shadow: none;\n }\n\n input:checked + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n @media (hover: hover) {\n input:not(:disabled):hover + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n\n input:not(:disabled):checked:hover + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n }\n\n input:not([data-read-only]):disabled + && {\n --switch-bg-color: ", ";\n --switch-fg-color: ", ";\n }\n "])), color.default.enabled.bg, color.default.enabled.fg, rem(input.switch.width), rem(input.switch.height), rem(input.switch.height / 2), focusRingStyle({
|
|
6326
6390
|
focusRing
|
|
6327
6391
|
}), color.positive.enabled.bg, color.positive.enabled.fg, color.default.hovered.bg, color.default.hovered.fg, color.positive.hovered.bg, color.positive.hovered.fg, color.default.disabled.bg, color.default.disabled.fg);
|
|
6328
6392
|
}
|
|
@@ -6333,7 +6397,7 @@ function switchTrackStyles(props) {
|
|
|
6333
6397
|
const {
|
|
6334
6398
|
input
|
|
6335
6399
|
} = theme.sanity;
|
|
6336
|
-
return styled.css(
|
|
6400
|
+
return styled.css(_templateObject44 || (_templateObject44 = _taggedTemplateLiteral(["\n &:not([hidden]) {\n display: block;\n }\n background-color: var(--switch-bg-color);\n position: absolute;\n left: 0;\n top: 0;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n "])), rem(input.switch.width), rem(input.switch.height), rem(input.switch.height / 2));
|
|
6337
6401
|
}
|
|
6338
6402
|
function switchThumbStyles(props) {
|
|
6339
6403
|
const {
|
|
@@ -6350,7 +6414,7 @@ function switchThumbStyles(props) {
|
|
|
6350
6414
|
const checkedOffset = trackWidth - trackPadding * 2 - size;
|
|
6351
6415
|
const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding;
|
|
6352
6416
|
const checked = $indeterminate !== true && props.$checked === true;
|
|
6353
|
-
return styled.css(
|
|
6417
|
+
return styled.css(_templateObject45 || (_templateObject45 = _taggedTemplateLiteral(["\n &:not([hidden]) {\n display: block;\n }\n position: absolute;\n left: ", ";\n top: ", ";\n height: ", ";\n width: ", ";\n border-radius: ", ";\n transition-property: transform;\n transition-duration: ", "ms;\n transition-timing-function: ", ";\n background: var(--switch-fg-color);\n transform: translate3d(0, 0, 0);\n\n ", "\n\n ", "\n "])), rem(trackPadding), rem(trackPadding), rem(size), rem(size), rem(size / 2), input.switch.transitionDurationMs, input.switch.transitionTimingFunction, checked && styled.css(_templateObject46 || (_templateObject46 = _taggedTemplateLiteral(["\n transform: translate3d(", "px, 0, 0);\n "])), checkedOffset), $indeterminate && styled.css(_templateObject47 || (_templateObject47 = _taggedTemplateLiteral(["\n transform: translate3d(", "px, 0, 0);\n "])), indeterminateOffset));
|
|
6354
6418
|
}
|
|
6355
6419
|
const Root$e = styled__default.default.span(switchBaseStyles);
|
|
6356
6420
|
const Input$2 = styled__default.default.input(switchInputStyles);
|
|
@@ -6395,7 +6459,7 @@ const Switch = react.forwardRef(function Switch2(props, forwardedRef) {
|
|
|
6395
6459
|
});
|
|
6396
6460
|
});
|
|
6397
6461
|
const Root$d = styled__default.default.span(textInputRootStyle);
|
|
6398
|
-
const InputRoot$1 = styled__default.default.span(
|
|
6462
|
+
const InputRoot$1 = styled__default.default.span(_templateObject48 || (_templateObject48 = _taggedTemplateLiteral(["\n flex: 1;\n min-width: 0;\n display: block;\n position: relative;\n"])));
|
|
6399
6463
|
const Input$1 = styled__default.default.textarea(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle);
|
|
6400
6464
|
const Presentation$1 = styled__default.default.div(responsiveRadiusStyle, textInputRepresentationStyle);
|
|
6401
6465
|
const TextArea = react.forwardRef(function TextArea2(props, forwardedRef) {
|
|
@@ -6445,18 +6509,18 @@ const CLEAR_BUTTON_BOX_STYLE = {
|
|
|
6445
6509
|
const Root$c = styled__default.default(Card).attrs({
|
|
6446
6510
|
forwardedAs: "span"
|
|
6447
6511
|
})(textInputRootStyle);
|
|
6448
|
-
const InputRoot = styled__default.default.span(
|
|
6512
|
+
const InputRoot = styled__default.default.span(_templateObject49 || (_templateObject49 = _taggedTemplateLiteral(["\n flex: 1;\n min-width: 0;\n display: block;\n position: relative;\n"])));
|
|
6449
6513
|
const Prefix = styled__default.default(Card).attrs({
|
|
6450
6514
|
forwardedAs: "span"
|
|
6451
|
-
})(
|
|
6515
|
+
})(_templateObject50 || (_templateObject50 = _taggedTemplateLiteral(["\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\n & > span {\n display: block;\n margin: -1px;\n }\n"])));
|
|
6452
6516
|
const Suffix = styled__default.default(Card).attrs({
|
|
6453
6517
|
forwardedAs: "span"
|
|
6454
|
-
})(
|
|
6518
|
+
})(_templateObject51 || (_templateObject51 = _taggedTemplateLiteral(["\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n & > span {\n display: block;\n margin: -1px;\n }\n"])));
|
|
6455
6519
|
const Input = styled__default.default.input(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle);
|
|
6456
6520
|
const Presentation = styled__default.default.span(responsiveRadiusStyle, textInputRepresentationStyle);
|
|
6457
|
-
const LeftBox = styled__default.default(Box)(
|
|
6458
|
-
const RightBox = styled__default.default(Box)(
|
|
6459
|
-
const RightCard = styled__default.default(Card)(
|
|
6521
|
+
const LeftBox = styled__default.default(Box)(_templateObject52 || (_templateObject52 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n"])));
|
|
6522
|
+
const RightBox = styled__default.default(Box)(_templateObject53 || (_templateObject53 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n right: 0;\n"])));
|
|
6523
|
+
const RightCard = styled__default.default(Card)(_templateObject54 || (_templateObject54 = _taggedTemplateLiteral(["\n background-color: transparent;\n position: absolute;\n top: 0;\n right: 0;\n"])));
|
|
6460
6524
|
const TextInput = react.forwardRef(function TextInput2(props, forwardedRef) {
|
|
6461
6525
|
const {
|
|
6462
6526
|
border = true,
|
|
@@ -6601,9 +6665,9 @@ const TextInput = react.forwardRef(function TextInput2(props, forwardedRef) {
|
|
|
6601
6665
|
}), suffixNode]
|
|
6602
6666
|
});
|
|
6603
6667
|
});
|
|
6604
|
-
const Root$b = styled__default.default.div(
|
|
6605
|
-
const Border = styled__default.default.path(
|
|
6606
|
-
const Shape = styled__default.default.path(
|
|
6668
|
+
const Root$b = styled__default.default.div(_templateObject55 || (_templateObject55 = _taggedTemplateLiteral(["\n position: absolute;\n pointer-events: none;\n width: 15px;\n height: 15px;\n fill: none;\n\n :empty + & {\n display: none;\n }\n\n & > svg {\n display: block;\n transform-origin: 7.5px 7.5px;\n }\n\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-placement^='top'] > & {\n bottom: -27px;\n }\n\n [data-placement^='right'] > & {\n left: -27px;\n\n & > svg {\n transform: rotate(90deg);\n }\n }\n\n [data-placement^='left'] > & {\n right: -27px;\n\n & > svg {\n transform: rotate(-90deg);\n }\n }\n\n [data-placement^='bottom'] > & {\n top: -27px;\n\n & > svg {\n transform: rotate(180deg);\n }\n }\n"])));
|
|
6669
|
+
const Border = styled__default.default.path(_templateObject56 || (_templateObject56 = _taggedTemplateLiteral(["\n fill: var(--card-shadow-outline-color);\n"])));
|
|
6670
|
+
const Shape = styled__default.default.path(_templateObject57 || (_templateObject57 = _taggedTemplateLiteral(["\n fill: var(--card-bg-color);\n"])));
|
|
6607
6671
|
const TooltipArrow = react.forwardRef(function TooltipArrow2(props, ref) {
|
|
6608
6672
|
const {
|
|
6609
6673
|
...restProps
|
|
@@ -6624,7 +6688,7 @@ const TooltipArrow = react.forwardRef(function TooltipArrow2(props, ref) {
|
|
|
6624
6688
|
})
|
|
6625
6689
|
});
|
|
6626
6690
|
});
|
|
6627
|
-
const Root$a = styled__default.default(Layer)(
|
|
6691
|
+
const Root$a = styled__default.default(Layer)(_templateObject58 || (_templateObject58 = _taggedTemplateLiteral(["\n pointer-events: none;\n"])));
|
|
6628
6692
|
const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
6629
6693
|
var _a, _b, _c;
|
|
6630
6694
|
const boundaryElementContext = useBoundaryElement();
|
|
@@ -6674,9 +6738,8 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
6674
6738
|
x,
|
|
6675
6739
|
y,
|
|
6676
6740
|
placement,
|
|
6677
|
-
reference,
|
|
6678
|
-
floating,
|
|
6679
6741
|
middlewareData,
|
|
6742
|
+
refs,
|
|
6680
6743
|
update,
|
|
6681
6744
|
strategy
|
|
6682
6745
|
} = reactDom$1.useFloating({
|
|
@@ -6728,15 +6791,15 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
6728
6791
|
react.useEffect(() => {
|
|
6729
6792
|
if (!content) setIsOpen(false);
|
|
6730
6793
|
}, [content]);
|
|
6731
|
-
react.useEffect(() =>
|
|
6794
|
+
react.useEffect(() => refs.setReference(referenceElement), [referenceElement, refs]);
|
|
6732
6795
|
const setArrow = react.useCallback(arrowEl => {
|
|
6733
6796
|
arrowRef.current = arrowEl;
|
|
6734
6797
|
update();
|
|
6735
6798
|
}, [update]);
|
|
6736
6799
|
const setFloating = react.useCallback(node => {
|
|
6737
6800
|
forwardedRef.current = node;
|
|
6738
|
-
|
|
6739
|
-
}, [
|
|
6801
|
+
refs.setFloating(node);
|
|
6802
|
+
}, [forwardedRef, refs]);
|
|
6740
6803
|
const childRef = childProp == null ? void 0 : childProp.ref;
|
|
6741
6804
|
const setReference = react.useCallback(node => {
|
|
6742
6805
|
if (typeof childRef === "function") {
|
|
@@ -6786,10 +6849,10 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
6786
6849
|
})]
|
|
6787
6850
|
});
|
|
6788
6851
|
});
|
|
6789
|
-
const Root$9 = styled__default.default.div(
|
|
6790
|
-
const ListBox = styled__default.default(Box)(
|
|
6791
|
-
const rotate = styled.keyframes(
|
|
6792
|
-
const AnimatedSpinnerIcon = styled__default.default(icons.SpinnerIcon)(
|
|
6852
|
+
const Root$9 = styled__default.default.div(_templateObject59 || (_templateObject59 = _taggedTemplateLiteral(["\n line-height: 0;\n"])));
|
|
6853
|
+
const ListBox = styled__default.default(Box)(_templateObject60 || (_templateObject60 = _taggedTemplateLiteral(["\n & > ul {\n list-style: none;\n padding: 0;\n margin: 0;\n }\n"])));
|
|
6854
|
+
const rotate = styled.keyframes(_templateObject61 || (_templateObject61 = _taggedTemplateLiteral(["\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n"])));
|
|
6855
|
+
const AnimatedSpinnerIcon = styled__default.default(icons.SpinnerIcon)(_templateObject62 || (_templateObject62 = _taggedTemplateLiteral(["\n animation: ", " 500ms linear infinite;\n"])), rotate);
|
|
6793
6856
|
function AutocompleteOption(props) {
|
|
6794
6857
|
const {
|
|
6795
6858
|
children,
|
|
@@ -7313,8 +7376,8 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
|
|
|
7313
7376
|
});
|
|
7314
7377
|
});
|
|
7315
7378
|
const Autocomplete = InnerAutocomplete;
|
|
7316
|
-
const Root$8 = styled__default.default.ol(
|
|
7317
|
-
const ExpandButton = styled__default.default(Button)(
|
|
7379
|
+
const Root$8 = styled__default.default.ol(_templateObject63 || (_templateObject63 = _taggedTemplateLiteral(["\n margin: 0;\n padding: 0;\n display: flex;\n list-style: none;\n align-items: center;\n white-space: nowrap;\n line-height: 0;\n"])));
|
|
7380
|
+
const ExpandButton = styled__default.default(Button)(_templateObject64 || (_templateObject64 = _taggedTemplateLiteral(["\n appearance: none;\n margin: -4px;\n"])));
|
|
7318
7381
|
const Breadcrumbs = react.forwardRef(function Breadcrumbs2(props, ref) {
|
|
7319
7382
|
const {
|
|
7320
7383
|
children,
|
|
@@ -7429,12 +7492,12 @@ function isTargetWithinScope(boundaryElement, portalElement, target) {
|
|
|
7429
7492
|
return containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
|
|
7430
7493
|
}
|
|
7431
7494
|
const Root$7 = styled__default.default(Layer)(responsivePaddingStyle, dialogStyle, responsiveDialogPositionStyle);
|
|
7432
|
-
const DialogContainer = styled__default.default(Container)(
|
|
7433
|
-
const DialogCardRoot = styled__default.default(Card)(
|
|
7434
|
-
const DialogLayout = styled__default.default(Flex)(
|
|
7435
|
-
const DialogHeader = styled__default.default(Card)(
|
|
7436
|
-
const DialogContent = styled__default.default(Box)(
|
|
7437
|
-
const DialogFooter = styled__default.default(Box)(
|
|
7495
|
+
const DialogContainer = styled__default.default(Container)(_templateObject65 || (_templateObject65 = _taggedTemplateLiteral(["\n &:not([hidden]) {\n display: flex;\n }\n width: 100%;\n height: 100%;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n"])));
|
|
7496
|
+
const DialogCardRoot = styled__default.default(Card)(_templateObject66 || (_templateObject66 = _taggedTemplateLiteral(["\n &:not([hidden]) {\n display: flex;\n }\n width: 100%;\n min-height: 0;\n max-height: 100%;\n overflow: hidden;\n overflow: clip;\n"])));
|
|
7497
|
+
const DialogLayout = styled__default.default(Flex)(_templateObject67 || (_templateObject67 = _taggedTemplateLiteral(["\n flex: 1;\n min-height: 0;\n width: 100%;\n"])));
|
|
7498
|
+
const DialogHeader = styled__default.default(Card)(_templateObject68 || (_templateObject68 = _taggedTemplateLiteral(["\n position: relative;\n z-index: 2;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n right: 0;\n bottom: -1px;\n border-bottom: 1px solid var(--card-hairline-soft-color);\n }\n"])));
|
|
7499
|
+
const DialogContent = styled__default.default(Box)(_templateObject69 || (_templateObject69 = _taggedTemplateLiteral(["\n position: relative;\n z-index: 1;\n overflow: auto;\n outline: none;\n"])));
|
|
7500
|
+
const DialogFooter = styled__default.default(Box)(_templateObject70 || (_templateObject70 = _taggedTemplateLiteral(["\n position: relative;\n z-index: 3;\n border-top: 1px solid var(--card-hairline-soft-color);\n"])));
|
|
7438
7501
|
const DialogCard = react.forwardRef(function DialogCard2(props, ref) {
|
|
7439
7502
|
var _a;
|
|
7440
7503
|
const {
|
|
@@ -7678,8 +7741,8 @@ function DialogProvider(props) {
|
|
|
7678
7741
|
children
|
|
7679
7742
|
});
|
|
7680
7743
|
}
|
|
7681
|
-
const Root$6 = styled__default.default.kbd(
|
|
7682
|
-
const Key = styled__default.default(KBD)(
|
|
7744
|
+
const Root$6 = styled__default.default.kbd(_templateObject71 || (_templateObject71 = _taggedTemplateLiteral(["\n &:not([hidden]) {\n display: block;\n }\n font: inherit;\n"])));
|
|
7745
|
+
const Key = styled__default.default(KBD)(_templateObject72 || (_templateObject72 = _taggedTemplateLiteral(["\n &:not([hidden]) {\n display: block;\n }\n"])));
|
|
7683
7746
|
const Hotkeys = react.forwardRef(function Hotkeys2(props, ref) {
|
|
7684
7747
|
const {
|
|
7685
7748
|
fontSize,
|
|
@@ -7900,7 +7963,7 @@ function useMenuController(props) {
|
|
|
7900
7963
|
setRootElement
|
|
7901
7964
|
};
|
|
7902
7965
|
}
|
|
7903
|
-
const Root$5 = styled__default.default(Box)(
|
|
7966
|
+
const Root$5 = styled__default.default(Box)(_templateObject73 || (_templateObject73 = _taggedTemplateLiteral(["\n outline: none;\n overflow: auto;\n"])));
|
|
7904
7967
|
const Menu = react.forwardRef(function Menu2(props, ref) {
|
|
7905
7968
|
const {
|
|
7906
7969
|
children,
|
|
@@ -8133,9 +8196,9 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
|
|
|
8133
8196
|
children: button || /* @__PURE__ */jsxRuntime.jsx(jsxRuntime.Fragment, {})
|
|
8134
8197
|
});
|
|
8135
8198
|
});
|
|
8136
|
-
const MenuDivider = styled__default.default.hr(
|
|
8199
|
+
const MenuDivider = styled__default.default.hr(_templateObject74 || (_templateObject74 = _taggedTemplateLiteral(["\n height: 1px;\n border: 0;\n background: var(--card-hairline-soft-color);\n margin: 0;\n"])));
|
|
8137
8200
|
function selectableBaseStyle() {
|
|
8138
|
-
return styled.css(
|
|
8201
|
+
return styled.css(_templateObject75 || (_templateObject75 = _taggedTemplateLiteral(["\n background-color: inherit;\n color: inherit;\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 text-decoration: none;\n }\n "])));
|
|
8139
8202
|
}
|
|
8140
8203
|
function selectableColorStyle(props) {
|
|
8141
8204
|
var _a, _b;
|
|
@@ -8149,7 +8212,7 @@ function selectableColorStyle(props) {
|
|
|
8149
8212
|
selectable
|
|
8150
8213
|
} = theme.sanity.color;
|
|
8151
8214
|
const tone = selectable ? selectable[$tone] || selectable.default : muted[$tone] || muted.default;
|
|
8152
|
-
return styled.css(
|
|
8215
|
+
return styled.css(_templateObject76 || (_templateObject76 = _taggedTemplateLiteral(["\n ", "\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n outline: none;\n\n /* &:is(button) */\n &[data-as='button'] {\n &:disabled {\n ", "\n }\n\n &:not(:disabled) {\n &[aria-pressed='true'] {\n ", "\n }\n\n &[data-selected],\n &[aria-selected='true'] > & {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\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-selected]) {\n &[data-hovered],\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n }\n }\n\n ", "\n "])), _colorVarsStyle(base, tone.enabled), _colorVarsStyle(base, tone.disabled), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.selected), _colorVarsStyle(base, tone.hovered), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.disabled), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.selected), _colorVarsStyle(base, tone.hovered), _colorVarsStyle(base, tone.pressed), (_b = (_a = theme.sanity.styles) == null ? void 0 : _a.card) == null ? void 0 : _b.root);
|
|
8153
8216
|
}
|
|
8154
8217
|
const Selectable = styled__default.default(Box)(responsiveRadiusStyle, selectableBaseStyle, selectableColorStyle);
|
|
8155
8218
|
function useMenu() {
|
|
@@ -8411,9 +8474,9 @@ const MenuItem = react.forwardRef(function MenuItem2(props, forwardedRef) {
|
|
|
8411
8474
|
})]
|
|
8412
8475
|
});
|
|
8413
8476
|
});
|
|
8414
|
-
const keyframe = styled.keyframes(
|
|
8415
|
-
const animation = styled.css(
|
|
8416
|
-
const skeletonStyle = styled.css(
|
|
8477
|
+
const keyframe = styled.keyframes(_templateObject77 || (_templateObject77 = _taggedTemplateLiteral(["\n 0% {\n background-position: 100%;\n }\n 100% {\n background-position: -100%;\n }\n"])));
|
|
8478
|
+
const animation = styled.css(_templateObject78 || (_templateObject78 = _taggedTemplateLiteral(["\n background-image: linear-gradient(\n to right,\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-to),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from)\n );\n background-position: 100%;\n background-size: 200% 100%;\n background-attachment: fixed;\n animation-name: ", ";\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n animation-duration: 2000ms;\n"])), keyframe);
|
|
8479
|
+
const skeletonStyle = styled.css(_templateObject79 || (_templateObject79 = _taggedTemplateLiteral(["\n opacity: ", ";\n transition: opacity 200ms ease-in;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n ", "\n }\n\n @media screen and (prefers-reduced-motion: reduce) {\n background-color: var(--card-skeleton-color-from);\n }\n"])), _ref24 => {
|
|
8417
8480
|
let {
|
|
8418
8481
|
$visible
|
|
8419
8482
|
} = _ref24;
|
|
@@ -8422,7 +8485,7 @@ const skeletonStyle = styled.css(_templateObject80 || (_templateObject80 = _tagg
|
|
|
8422
8485
|
let {
|
|
8423
8486
|
$animated
|
|
8424
8487
|
} = _ref25;
|
|
8425
|
-
return $animated ? animation : styled.css(
|
|
8488
|
+
return $animated ? animation : styled.css(_templateObject80 || (_templateObject80 = _taggedTemplateLiteral(["\n background-color: var(--card-skeleton-color-from);\n "])));
|
|
8426
8489
|
});
|
|
8427
8490
|
const Root$4 = styled__default.default(Box)(responsiveRadiusStyle, skeletonStyle);
|
|
8428
8491
|
const Skeleton = react.forwardRef(function Skeleton2(props, ref) {
|
|
@@ -8639,8 +8702,8 @@ const ROLES = {
|
|
|
8639
8702
|
success: "alert",
|
|
8640
8703
|
info: "alert"
|
|
8641
8704
|
};
|
|
8642
|
-
const Root$2 = styled__default.default(Card)(
|
|
8643
|
-
const TextBox = styled__default.default(Flex)(
|
|
8705
|
+
const Root$2 = styled__default.default(Card)(_templateObject81 || (_templateObject81 = _taggedTemplateLiteral(["\n pointer-events: all;\n"])));
|
|
8706
|
+
const TextBox = styled__default.default(Flex)(_templateObject82 || (_templateObject82 = _taggedTemplateLiteral(["\n overflow-x: auto;\n"])));
|
|
8644
8707
|
function Toast(props) {
|
|
8645
8708
|
const {
|
|
8646
8709
|
closable,
|
|
@@ -8700,8 +8763,8 @@ function useMounted() {
|
|
|
8700
8763
|
const key$1 = Symbol.for("@sanity/ui/context/toast");
|
|
8701
8764
|
globalScope[key$1] = globalScope[key$1] || react.createContext(null);
|
|
8702
8765
|
const ToastContext = globalScope[key$1];
|
|
8703
|
-
const Root$1 = styled__default.default(Layer)(
|
|
8704
|
-
const ToastContainer = styled__default.default.div(
|
|
8766
|
+
const Root$1 = styled__default.default(Layer)(_templateObject83 || (_templateObject83 = _taggedTemplateLiteral(["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n"])));
|
|
8767
|
+
const ToastContainer = styled__default.default.div(_templateObject84 || (_templateObject84 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n position: absolute;\n right: 0;\n bottom: 0;\n max-width: 420px;\n width: 100%;\n"])));
|
|
8705
8768
|
let toastId = 0;
|
|
8706
8769
|
function ToastProvider(props) {
|
|
8707
8770
|
const {
|
|
@@ -9062,7 +9125,7 @@ const Tree = react.memo(react.forwardRef(function Tree2(props, ref) {
|
|
|
9062
9125
|
}));
|
|
9063
9126
|
Tree.displayName = "Tree";
|
|
9064
9127
|
function treeItemRootStyle() {
|
|
9065
|
-
return styled.css(
|
|
9128
|
+
return styled.css(_templateObject85 || (_templateObject85 = _taggedTemplateLiteral(["\n &[role='none'] > [role='treeitem'] {\n outline: none;\n cursor: default;\n border-radius: 3px;\n\n &:focus {\n position: relative;\n }\n }\n\n &[role='treeitem'] {\n outline: none;\n\n & > div {\n cursor: default;\n border-radius: 3px;\n }\n\n &:focus > div {\n position: relative;\n }\n }\n "])));
|
|
9066
9129
|
}
|
|
9067
9130
|
function treeItemRootColorStyle(props) {
|
|
9068
9131
|
const {
|
|
@@ -9075,7 +9138,7 @@ function treeItemRootColorStyle(props) {
|
|
|
9075
9138
|
selectable
|
|
9076
9139
|
} = theme.sanity.color;
|
|
9077
9140
|
const tone = selectable ? selectable[$tone] || selectable.default : muted[$tone] || muted.default;
|
|
9078
|
-
return styled.css(
|
|
9141
|
+
return styled.css(_templateObject86 || (_templateObject86 = _taggedTemplateLiteral(["\n /* <div role=\"none\"><a data-ui=\"TreeItem__box\" role=\"treeitem\" tabIndex=\"0\"></div> */\n &[role='none'] {\n & > [role='treeitem'] {\n ", "\n\n background-color: var(--card-bg-color);\n color: var(--treeitem-fg-color);\n }\n\n &[data-selected] > [role='treeitem'] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]) > [role='treeitem']:not(:focus):hover {\n ", "\n }\n\n & > [role='treeitem']:focus {\n ", "\n }\n }\n }\n\n /* <div role=\"treeitem\" tabIndex=\"0\"><div data-ui=\"TreeItem__box\"></div> */\n &[role='treeitem'] {\n & > [data-ui='TreeItem__box'] {\n ", "\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n }\n\n &[data-selected] > [data-ui='TreeItem__box'] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover {\n ", "\n }\n\n &:focus > [data-ui='TreeItem__box'] {\n ", "\n }\n }\n }\n "])), _colorVarsStyle(base, tone.enabled), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.hovered), _colorVarsStyle(base, tone.selected), _colorVarsStyle(base, tone.enabled), _colorVarsStyle(base, tone.pressed), _colorVarsStyle(base, tone.hovered), _colorVarsStyle(base, tone.selected));
|
|
9079
9142
|
}
|
|
9080
9143
|
function treeItemBoxStyle(props) {
|
|
9081
9144
|
const {
|
|
@@ -9085,7 +9148,7 @@ function treeItemBoxStyle(props) {
|
|
|
9085
9148
|
const {
|
|
9086
9149
|
space
|
|
9087
9150
|
} = theme.sanity;
|
|
9088
|
-
return styled.css(
|
|
9151
|
+
return styled.css(_templateObject87 || (_templateObject87 = _taggedTemplateLiteral(["\n padding-left: ", ";\n\n &[data-as='a'] {\n text-decoration: none;\n }\n "])), rem(space[2] * $level));
|
|
9089
9152
|
}
|
|
9090
9153
|
function useTree() {
|
|
9091
9154
|
const tree = react.useContext(TreeContext);
|
|
@@ -9116,7 +9179,7 @@ const Root = react.memo(styled__default.default.li(treeItemRootStyle, treeItemRo
|
|
|
9116
9179
|
const TreeItemBox = styled__default.default(Box).attrs({
|
|
9117
9180
|
forwardedAs: "a"
|
|
9118
9181
|
})(treeItemBoxStyle);
|
|
9119
|
-
const ToggleArrowText = styled__default.default(Text)(
|
|
9182
|
+
const ToggleArrowText = styled__default.default(Text)(_templateObject88 || (_templateObject88 = _taggedTemplateLiteral(["\n & > svg {\n transition: transform 100ms;\n }\n"])));
|
|
9120
9183
|
const TreeItem = react.memo(function TreeItem2(props) {
|
|
9121
9184
|
const {
|
|
9122
9185
|
children,
|