@sanity/ui 1.4.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.cjs.mjs +0 -2
- package/dist/index.d.ts +19 -34
- package/dist/index.esm.js +213 -189
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +211 -189
- package/dist/index.js.map +1 -1
- package/package.json +39 -39
- package/src/components/menu/__workshop__/menuButton.tsx +2 -0
- package/src/components/menu/menuButton.tsx +10 -0
- 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 +3 -3
- package/src/primitives/popover/helpers.ts +32 -0
- package/src/primitives/popover/index.ts +0 -2
- package/src/primitives/popover/popover.tsx +124 -58
- package/src/primitives/popover/popoverCard.tsx +21 -50
- package/src/primitives/popover/types.ts +6 -8
- package/src/primitives/tooltip/tooltip.tsx +4 -4
- package/src/primitives/popover/__workshop__/PositionStory.tsx +0 -103
- package/src/primitives/popover/popover.test.tsx +0 -164
- package/src/primitives/popover/popoverContext.tsx +0 -9
- package/src/primitives/popover/popoverProvider.tsx +0 -29
- package/src/primitives/popover/useOnForcedUpdate.ts +0 -15
- package/src/primitives/popover/usePopover.ts +0 -24
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
|
|
@@ -3076,9 +3076,9 @@ function getGlobalScope() {
|
|
|
3076
3076
|
throw new Error("@sanity/ui: could not locate global scope");
|
|
3077
3077
|
}
|
|
3078
3078
|
const globalScope = getGlobalScope();
|
|
3079
|
-
const key$
|
|
3080
|
-
globalScope[key$
|
|
3081
|
-
const ThemeContext = globalScope[key$
|
|
3079
|
+
const key$7 = Symbol.for("@sanity/ui/context/theme");
|
|
3080
|
+
globalScope[key$7] = globalScope[key$7] || react.createContext(null);
|
|
3081
|
+
const ThemeContext = globalScope[key$7];
|
|
3082
3082
|
function ThemeProvider(props) {
|
|
3083
3083
|
const parentTheme = react.useContext(ThemeContext);
|
|
3084
3084
|
const {
|
|
@@ -5168,9 +5168,9 @@ const KBD = react.forwardRef(function KBD2(props, ref) {
|
|
|
5168
5168
|
})
|
|
5169
5169
|
});
|
|
5170
5170
|
});
|
|
5171
|
-
const key$
|
|
5172
|
-
globalScope[key$
|
|
5173
|
-
const BoundaryElementContext = globalScope[key$
|
|
5171
|
+
const key$6 = Symbol.for("@sanity/ui/context/boundaryElement");
|
|
5172
|
+
globalScope[key$6] = globalScope[key$6] || react.createContext(null);
|
|
5173
|
+
const BoundaryElementContext = globalScope[key$6];
|
|
5174
5174
|
function BoundaryElementProvider(props) {
|
|
5175
5175
|
const {
|
|
5176
5176
|
children,
|
|
@@ -5288,9 +5288,9 @@ function getLayerContext(contextValue) {
|
|
|
5288
5288
|
}
|
|
5289
5289
|
throw new Error("could not get layer context");
|
|
5290
5290
|
}
|
|
5291
|
-
const key$
|
|
5292
|
-
globalScope[key$
|
|
5293
|
-
const LayerContext = globalScope[key$
|
|
5291
|
+
const key$5 = Symbol.for("@sanity/ui/context/layer");
|
|
5292
|
+
globalScope[key$5] = globalScope[key$5] || react.createContext(null);
|
|
5293
|
+
const LayerContext = globalScope[key$5];
|
|
5294
5294
|
function useLayer() {
|
|
5295
5295
|
const value = react.useContext(LayerContext);
|
|
5296
5296
|
if (!value) {
|
|
@@ -5527,7 +5527,7 @@ const Layer = react.forwardRef(function Layer2(props, ref) {
|
|
|
5527
5527
|
})
|
|
5528
5528
|
});
|
|
5529
5529
|
});
|
|
5530
|
-
const key$
|
|
5530
|
+
const key$4 = Symbol.for("@sanity/ui/context/portal");
|
|
5531
5531
|
const elementKey = Symbol.for("@sanity/ui/context/portal/element");
|
|
5532
5532
|
globalScope[elementKey] = null;
|
|
5533
5533
|
const defaultContextValue = {
|
|
@@ -5546,8 +5546,8 @@ const defaultContextValue = {
|
|
|
5546
5546
|
return globalScope[elementKey];
|
|
5547
5547
|
}
|
|
5548
5548
|
};
|
|
5549
|
-
globalScope[key$
|
|
5550
|
-
const PortalContext = globalScope[key$
|
|
5549
|
+
globalScope[key$4] = globalScope[key$4] || react.createContext(defaultContextValue);
|
|
5550
|
+
const PortalContext = globalScope[key$4];
|
|
5551
5551
|
function usePortal() {
|
|
5552
5552
|
const value = react.useContext(PortalContext);
|
|
5553
5553
|
if (!value) {
|
|
@@ -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
|
|
@@ -5927,19 +5941,8 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
5927
5941
|
});
|
|
5928
5942
|
}));
|
|
5929
5943
|
PopoverCard.displayName = "PopoverCard";
|
|
5930
|
-
const key$4 = Symbol.for("@sanity/ui/context/popover");
|
|
5931
|
-
globalScope[key$4] = globalScope[key$4] || react.createContext(null);
|
|
5932
|
-
const PopoverContext = globalScope[key$4];
|
|
5933
|
-
const useOnForcedUpdate = eventHandler => {
|
|
5934
|
-
const contextValue = react.useContext(PopoverContext);
|
|
5935
|
-
react.useEffect(() => {
|
|
5936
|
-
if ((contextValue == null ? void 0 : contextValue.lastUpdateId) !== null) {
|
|
5937
|
-
eventHandler == null ? void 0 : eventHandler();
|
|
5938
|
-
}
|
|
5939
|
-
}, [contextValue == null ? void 0 : contextValue.lastUpdateId]);
|
|
5940
|
-
};
|
|
5941
5944
|
const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
5942
|
-
var _a, _b, _c, _d, _e;
|
|
5945
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
5943
5946
|
const theme = useTheme();
|
|
5944
5947
|
const boundaryElementContext = useBoundaryElement();
|
|
5945
5948
|
const {
|
|
@@ -5951,7 +5954,8 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
5951
5954
|
content,
|
|
5952
5955
|
disabled,
|
|
5953
5956
|
fallbackPlacements,
|
|
5954
|
-
matchReferenceWidth
|
|
5957
|
+
matchReferenceWidth,
|
|
5958
|
+
floatingBoundary = (_a = props.boundaryElement) != null ? _a : boundaryElementContext.element,
|
|
5955
5959
|
open,
|
|
5956
5960
|
overflow = "hidden",
|
|
5957
5961
|
padding: paddingProp,
|
|
@@ -5959,28 +5963,65 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
5959
5963
|
portal,
|
|
5960
5964
|
preventOverflow = true,
|
|
5961
5965
|
radius: radiusProp = 3,
|
|
5966
|
+
referenceBoundary = (_b = props.boundaryElement) != null ? _b : boundaryElementContext.element,
|
|
5962
5967
|
referenceElement,
|
|
5963
5968
|
scheme,
|
|
5964
5969
|
shadow: shadowProp = 3,
|
|
5965
5970
|
tone = "inherit",
|
|
5966
5971
|
width: widthProp = "auto",
|
|
5967
|
-
zOffset: zOffsetProp = (
|
|
5972
|
+
zOffset: zOffsetProp = (_c = theme.sanity.layer) == null ? void 0 : _c.popover.zOffset,
|
|
5973
|
+
updateRef,
|
|
5968
5974
|
...restProps
|
|
5969
5975
|
} = props;
|
|
5970
|
-
const boundarySize = (
|
|
5976
|
+
const boundarySize = (_d = useElementSize(boundaryElement)) == null ? void 0 : _d.border;
|
|
5971
5977
|
const padding = useArrayProp(paddingProp);
|
|
5972
5978
|
const radius = useArrayProp(radiusProp);
|
|
5973
5979
|
const shadow = useArrayProp(shadowProp);
|
|
5974
|
-
const
|
|
5980
|
+
const widthArrayProp = useArrayProp(widthProp);
|
|
5975
5981
|
const zOffset = useArrayProp(zOffsetProp);
|
|
5976
5982
|
const forwardedRef = useForwardedRef(ref);
|
|
5977
5983
|
const arrowRef = react.useRef(null);
|
|
5978
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]);
|
|
5979
6020
|
const middleware = react.useMemo(() => {
|
|
5980
6021
|
const ret = [];
|
|
5981
6022
|
if (constrainSize || preventOverflow) {
|
|
5982
6023
|
ret.push(reactDom$1.flip({
|
|
5983
|
-
boundary:
|
|
6024
|
+
boundary: floatingBoundary || void 0,
|
|
5984
6025
|
fallbackPlacements,
|
|
5985
6026
|
padding: DEFAULT_POPOVER_PADDING,
|
|
5986
6027
|
rootBoundary
|
|
@@ -5989,7 +6030,7 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
5989
6030
|
ret.push(reactDom$1.offset({
|
|
5990
6031
|
mainAxis: arrowProp ? DEFAULT_POPOVER_DISTANCE : 0
|
|
5991
6032
|
}));
|
|
5992
|
-
if (constrainSize ||
|
|
6033
|
+
if (constrainSize || matchReferenceWidth) {
|
|
5993
6034
|
ret.push(size({
|
|
5994
6035
|
apply(_ref21) {
|
|
5995
6036
|
let {
|
|
@@ -5998,24 +6039,29 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
5998
6039
|
elements,
|
|
5999
6040
|
referenceWidth
|
|
6000
6041
|
} = _ref21;
|
|
6001
|
-
|
|
6042
|
+
referenceWidthRef.current = referenceWidth;
|
|
6043
|
+
const _currentWidth = widthRef.current;
|
|
6044
|
+
const _maxWidth = maxWidthRef.current;
|
|
6045
|
+
if (matchReferenceWidth) {
|
|
6002
6046
|
elements.floating.style.width = "".concat(referenceWidth, "px");
|
|
6047
|
+
} else if (_currentWidth !== void 0) {
|
|
6048
|
+
elements.floating.style.width = "".concat(_currentWidth, "px");
|
|
6003
6049
|
}
|
|
6004
6050
|
if (constrainSize) {
|
|
6005
|
-
elements.floating.style.maxWidth = "".concat(availableWidth, "px");
|
|
6051
|
+
elements.floating.style.maxWidth = "".concat(Math.min(availableWidth, _maxWidth != null ? _maxWidth : Infinity), "px");
|
|
6006
6052
|
elements.floating.style.maxHeight = "".concat(availableHeight, "px");
|
|
6007
6053
|
}
|
|
6008
6054
|
},
|
|
6009
|
-
boundaryElement,
|
|
6055
|
+
boundaryElement: floatingBoundary || void 0,
|
|
6010
6056
|
constrainSize,
|
|
6011
6057
|
margins,
|
|
6012
|
-
matchReferenceWidth
|
|
6058
|
+
matchReferenceWidth,
|
|
6013
6059
|
padding: DEFAULT_POPOVER_PADDING
|
|
6014
6060
|
}));
|
|
6015
6061
|
}
|
|
6016
6062
|
if (preventOverflow) {
|
|
6017
6063
|
ret.push(reactDom$1.shift({
|
|
6018
|
-
boundary:
|
|
6064
|
+
boundary: floatingBoundary || void 0,
|
|
6019
6065
|
rootBoundary,
|
|
6020
6066
|
padding: DEFAULT_POPOVER_PADDING
|
|
6021
6067
|
}));
|
|
@@ -6027,49 +6073,44 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6027
6073
|
}));
|
|
6028
6074
|
}
|
|
6029
6075
|
ret.push(reactDom$1.hide({
|
|
6030
|
-
boundary:
|
|
6076
|
+
boundary: referenceBoundary || void 0,
|
|
6031
6077
|
padding: DEFAULT_POPOVER_PADDING,
|
|
6032
6078
|
strategy: "referenceHidden"
|
|
6033
6079
|
}));
|
|
6034
6080
|
return ret;
|
|
6035
|
-
}, [arrowProp,
|
|
6036
|
-
const floatingProps = react.useMemo(() => ({
|
|
6037
|
-
middleware,
|
|
6038
|
-
placement: placementProp,
|
|
6039
|
-
whileElementsMounted: reactDom$1.autoUpdate
|
|
6040
|
-
}), [middleware, placementProp]);
|
|
6081
|
+
}, [arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]);
|
|
6041
6082
|
const {
|
|
6042
6083
|
x,
|
|
6043
6084
|
y,
|
|
6044
|
-
placement,
|
|
6045
|
-
reference: referenceRef,
|
|
6046
|
-
floating: floatingRef,
|
|
6047
|
-
update: floatingUpdate,
|
|
6048
6085
|
middlewareData,
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
}
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
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;
|
|
6057
6098
|
const setArrow = react.useCallback(arrowEl => {
|
|
6058
6099
|
arrowRef.current = arrowEl;
|
|
6059
6100
|
}, []);
|
|
6060
6101
|
const setFloating = react.useCallback(node => {
|
|
6061
6102
|
forwardedRef.current = node;
|
|
6062
|
-
|
|
6063
|
-
}, [
|
|
6103
|
+
refs.setFloating(node);
|
|
6104
|
+
}, [forwardedRef, refs]);
|
|
6064
6105
|
const setReference = react.useCallback(node => {
|
|
6065
|
-
|
|
6106
|
+
refs.setReference(node);
|
|
6066
6107
|
const childRef = childProp == null ? void 0 : childProp.ref;
|
|
6067
6108
|
if (typeof childRef === "function") {
|
|
6068
6109
|
childRef(node);
|
|
6069
6110
|
} else if (childRef) {
|
|
6070
6111
|
childRef.current = node;
|
|
6071
6112
|
}
|
|
6072
|
-
}, [childProp,
|
|
6113
|
+
}, [childProp, refs]);
|
|
6073
6114
|
const child = react.useMemo(() => {
|
|
6074
6115
|
if (!childProp || referenceElement) return null;
|
|
6075
6116
|
return react.cloneElement(childProp, {
|
|
@@ -6077,9 +6118,17 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6077
6118
|
});
|
|
6078
6119
|
}, [childProp, referenceElement, setReference]);
|
|
6079
6120
|
react.useEffect(() => {
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
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]);
|
|
6083
6132
|
if (disabled) {
|
|
6084
6133
|
return childProp || /* @__PURE__ */jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
6085
6134
|
}
|
|
@@ -6092,7 +6141,6 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6092
6141
|
arrowRef: setArrow,
|
|
6093
6142
|
arrowX,
|
|
6094
6143
|
arrowY,
|
|
6095
|
-
boundaryWidth: preventOverflow ? boundarySize == null ? void 0 : boundarySize.width : void 0,
|
|
6096
6144
|
hidden: referenceHidden,
|
|
6097
6145
|
overflow,
|
|
6098
6146
|
padding,
|
|
@@ -6103,9 +6151,9 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6103
6151
|
shadow,
|
|
6104
6152
|
strategy,
|
|
6105
6153
|
tone,
|
|
6154
|
+
width: matchReferenceWidth ? referenceWidthRef.current : width,
|
|
6106
6155
|
x,
|
|
6107
6156
|
y,
|
|
6108
|
-
width,
|
|
6109
6157
|
children: content
|
|
6110
6158
|
})
|
|
6111
6159
|
});
|
|
@@ -6119,37 +6167,8 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6119
6167
|
});
|
|
6120
6168
|
}));
|
|
6121
6169
|
Popover.displayName = "Popover";
|
|
6122
|
-
const PopoverProvider = _ref22 => {
|
|
6123
|
-
let {
|
|
6124
|
-
children
|
|
6125
|
-
} = _ref22;
|
|
6126
|
-
const [lastUpdateId, setUpdateId] = react.useState(null);
|
|
6127
|
-
const forceUpdate = react.useCallback(() => {
|
|
6128
|
-
const newId = Math.random().toString(36).substr(2, 9);
|
|
6129
|
-
setUpdateId(newId);
|
|
6130
|
-
}, []);
|
|
6131
|
-
const value = react.useMemo(() => ({
|
|
6132
|
-
version: 0,
|
|
6133
|
-
lastUpdateId,
|
|
6134
|
-
forceUpdate
|
|
6135
|
-
}), [lastUpdateId, forceUpdate]);
|
|
6136
|
-
return /* @__PURE__ */jsxRuntime.jsx(PopoverContext.Provider, {
|
|
6137
|
-
value,
|
|
6138
|
-
children
|
|
6139
|
-
});
|
|
6140
|
-
};
|
|
6141
|
-
function usePopover() {
|
|
6142
|
-
const value = react.useContext(PopoverContext);
|
|
6143
|
-
if (!value) {
|
|
6144
|
-
throw new Error("usePopover(): missing context value");
|
|
6145
|
-
}
|
|
6146
|
-
if (!isRecord(value) || value.version !== 0) {
|
|
6147
|
-
throw new Error("usePopover(): the context value is not compatible");
|
|
6148
|
-
}
|
|
6149
|
-
return value;
|
|
6150
|
-
}
|
|
6151
6170
|
function radioBaseStyle() {
|
|
6152
|
-
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 "])));
|
|
6153
6172
|
}
|
|
6154
6173
|
function inputElementStyle(props) {
|
|
6155
6174
|
const {
|
|
@@ -6161,7 +6180,7 @@ function inputElementStyle(props) {
|
|
|
6161
6180
|
} = theme.sanity;
|
|
6162
6181
|
const color = theme.sanity.color.input;
|
|
6163
6182
|
const dist = (input.radio.size - input.radio.markSize) / 2;
|
|
6164
|
-
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({
|
|
6165
6184
|
color: color.default.enabled.border,
|
|
6166
6185
|
width: input.border.width
|
|
6167
6186
|
}), rem(dist), rem(dist), rem(input.radio.markSize), rem(input.radio.markSize), rem(input.radio.markSize / 2), color.default.enabled.fg, focusRingStyle({
|
|
@@ -6203,14 +6222,14 @@ const Radio = react.forwardRef(function Radio2(props, forwardedRef) {
|
|
|
6203
6222
|
});
|
|
6204
6223
|
});
|
|
6205
6224
|
function rootStyle() {
|
|
6206
|
-
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 "])));
|
|
6207
6226
|
}
|
|
6208
6227
|
function inputBaseStyle(props) {
|
|
6209
6228
|
const {
|
|
6210
6229
|
theme
|
|
6211
6230
|
} = props;
|
|
6212
6231
|
const font = theme.sanity.fonts.text;
|
|
6213
|
-
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);
|
|
6214
6233
|
}
|
|
6215
6234
|
function inputColorStyle(props) {
|
|
6216
6235
|
const {
|
|
@@ -6221,7 +6240,7 @@ function inputColorStyle(props) {
|
|
|
6221
6240
|
input
|
|
6222
6241
|
} = theme.sanity;
|
|
6223
6242
|
const color = theme.sanity.color.input;
|
|
6224
|
-
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({
|
|
6225
6244
|
color: color.default.enabled.border,
|
|
6226
6245
|
width: input.border.width
|
|
6227
6246
|
}), color.default.hovered.bg, color.default.hovered.fg, focusRingBorderStyle({
|
|
@@ -6265,7 +6284,7 @@ function iconBoxStyle(props) {
|
|
|
6265
6284
|
theme
|
|
6266
6285
|
} = props;
|
|
6267
6286
|
const color = theme.sanity.color.input;
|
|
6268
|
-
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);
|
|
6269
6288
|
}
|
|
6270
6289
|
const selectStyle = {
|
|
6271
6290
|
root: rootStyle,
|
|
@@ -6353,10 +6372,10 @@ const Stack = react.forwardRef(function Stack2(props, ref) {
|
|
|
6353
6372
|
});
|
|
6354
6373
|
});
|
|
6355
6374
|
function switchBaseStyles() {
|
|
6356
|
-
return styled.css(
|
|
6375
|
+
return styled.css(_templateObject41 || (_templateObject41 = _taggedTemplateLiteral(["\n position: relative;\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
|
|
6357
6376
|
}
|
|
6358
6377
|
function switchInputStyles() {
|
|
6359
|
-
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 "])));
|
|
6360
6379
|
}
|
|
6361
6380
|
function switchRepresentationStyles(props) {
|
|
6362
6381
|
const {
|
|
@@ -6367,7 +6386,7 @@ function switchRepresentationStyles(props) {
|
|
|
6367
6386
|
input
|
|
6368
6387
|
} = theme.sanity;
|
|
6369
6388
|
const color = theme.sanity.color.button.default;
|
|
6370
|
-
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({
|
|
6371
6390
|
focusRing
|
|
6372
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);
|
|
6373
6392
|
}
|
|
@@ -6378,7 +6397,7 @@ function switchTrackStyles(props) {
|
|
|
6378
6397
|
const {
|
|
6379
6398
|
input
|
|
6380
6399
|
} = theme.sanity;
|
|
6381
|
-
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));
|
|
6382
6401
|
}
|
|
6383
6402
|
function switchThumbStyles(props) {
|
|
6384
6403
|
const {
|
|
@@ -6395,7 +6414,7 @@ function switchThumbStyles(props) {
|
|
|
6395
6414
|
const checkedOffset = trackWidth - trackPadding * 2 - size;
|
|
6396
6415
|
const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding;
|
|
6397
6416
|
const checked = $indeterminate !== true && props.$checked === true;
|
|
6398
|
-
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));
|
|
6399
6418
|
}
|
|
6400
6419
|
const Root$e = styled__default.default.span(switchBaseStyles);
|
|
6401
6420
|
const Input$2 = styled__default.default.input(switchInputStyles);
|
|
@@ -6440,7 +6459,7 @@ const Switch = react.forwardRef(function Switch2(props, forwardedRef) {
|
|
|
6440
6459
|
});
|
|
6441
6460
|
});
|
|
6442
6461
|
const Root$d = styled__default.default.span(textInputRootStyle);
|
|
6443
|
-
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"])));
|
|
6444
6463
|
const Input$1 = styled__default.default.textarea(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle);
|
|
6445
6464
|
const Presentation$1 = styled__default.default.div(responsiveRadiusStyle, textInputRepresentationStyle);
|
|
6446
6465
|
const TextArea = react.forwardRef(function TextArea2(props, forwardedRef) {
|
|
@@ -6490,18 +6509,18 @@ const CLEAR_BUTTON_BOX_STYLE = {
|
|
|
6490
6509
|
const Root$c = styled__default.default(Card).attrs({
|
|
6491
6510
|
forwardedAs: "span"
|
|
6492
6511
|
})(textInputRootStyle);
|
|
6493
|
-
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"])));
|
|
6494
6513
|
const Prefix = styled__default.default(Card).attrs({
|
|
6495
6514
|
forwardedAs: "span"
|
|
6496
|
-
})(
|
|
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"])));
|
|
6497
6516
|
const Suffix = styled__default.default(Card).attrs({
|
|
6498
6517
|
forwardedAs: "span"
|
|
6499
|
-
})(
|
|
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"])));
|
|
6500
6519
|
const Input = styled__default.default.input(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle);
|
|
6501
6520
|
const Presentation = styled__default.default.span(responsiveRadiusStyle, textInputRepresentationStyle);
|
|
6502
|
-
const LeftBox = styled__default.default(Box)(
|
|
6503
|
-
const RightBox = styled__default.default(Box)(
|
|
6504
|
-
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"])));
|
|
6505
6524
|
const TextInput = react.forwardRef(function TextInput2(props, forwardedRef) {
|
|
6506
6525
|
const {
|
|
6507
6526
|
border = true,
|
|
@@ -6646,9 +6665,9 @@ const TextInput = react.forwardRef(function TextInput2(props, forwardedRef) {
|
|
|
6646
6665
|
}), suffixNode]
|
|
6647
6666
|
});
|
|
6648
6667
|
});
|
|
6649
|
-
const Root$b = styled__default.default.div(
|
|
6650
|
-
const Border = styled__default.default.path(
|
|
6651
|
-
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"])));
|
|
6652
6671
|
const TooltipArrow = react.forwardRef(function TooltipArrow2(props, ref) {
|
|
6653
6672
|
const {
|
|
6654
6673
|
...restProps
|
|
@@ -6669,7 +6688,7 @@ const TooltipArrow = react.forwardRef(function TooltipArrow2(props, ref) {
|
|
|
6669
6688
|
})
|
|
6670
6689
|
});
|
|
6671
6690
|
});
|
|
6672
|
-
const Root$a = styled__default.default(Layer)(
|
|
6691
|
+
const Root$a = styled__default.default(Layer)(_templateObject58 || (_templateObject58 = _taggedTemplateLiteral(["\n pointer-events: none;\n"])));
|
|
6673
6692
|
const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
6674
6693
|
var _a, _b, _c;
|
|
6675
6694
|
const boundaryElementContext = useBoundaryElement();
|
|
@@ -6719,9 +6738,8 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
6719
6738
|
x,
|
|
6720
6739
|
y,
|
|
6721
6740
|
placement,
|
|
6722
|
-
reference,
|
|
6723
|
-
floating,
|
|
6724
6741
|
middlewareData,
|
|
6742
|
+
refs,
|
|
6725
6743
|
update,
|
|
6726
6744
|
strategy
|
|
6727
6745
|
} = reactDom$1.useFloating({
|
|
@@ -6773,15 +6791,15 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
6773
6791
|
react.useEffect(() => {
|
|
6774
6792
|
if (!content) setIsOpen(false);
|
|
6775
6793
|
}, [content]);
|
|
6776
|
-
react.useEffect(() =>
|
|
6794
|
+
react.useEffect(() => refs.setReference(referenceElement), [referenceElement, refs]);
|
|
6777
6795
|
const setArrow = react.useCallback(arrowEl => {
|
|
6778
6796
|
arrowRef.current = arrowEl;
|
|
6779
6797
|
update();
|
|
6780
6798
|
}, [update]);
|
|
6781
6799
|
const setFloating = react.useCallback(node => {
|
|
6782
6800
|
forwardedRef.current = node;
|
|
6783
|
-
|
|
6784
|
-
}, [
|
|
6801
|
+
refs.setFloating(node);
|
|
6802
|
+
}, [forwardedRef, refs]);
|
|
6785
6803
|
const childRef = childProp == null ? void 0 : childProp.ref;
|
|
6786
6804
|
const setReference = react.useCallback(node => {
|
|
6787
6805
|
if (typeof childRef === "function") {
|
|
@@ -6831,10 +6849,10 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
6831
6849
|
})]
|
|
6832
6850
|
});
|
|
6833
6851
|
});
|
|
6834
|
-
const Root$9 = styled__default.default.div(
|
|
6835
|
-
const ListBox = styled__default.default(Box)(
|
|
6836
|
-
const rotate = styled.keyframes(
|
|
6837
|
-
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);
|
|
6838
6856
|
function AutocompleteOption(props) {
|
|
6839
6857
|
const {
|
|
6840
6858
|
children,
|
|
@@ -6979,10 +6997,10 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
|
|
|
6979
6997
|
query,
|
|
6980
6998
|
value
|
|
6981
6999
|
} = state;
|
|
6982
|
-
const defaultRenderOption = react.useCallback(
|
|
7000
|
+
const defaultRenderOption = react.useCallback(_ref22 => {
|
|
6983
7001
|
let {
|
|
6984
7002
|
value: value2
|
|
6985
|
-
} =
|
|
7003
|
+
} = _ref22;
|
|
6986
7004
|
return /* @__PURE__ */jsxRuntime.jsx(Card, {
|
|
6987
7005
|
"data-as": "button",
|
|
6988
7006
|
padding: paddingProp,
|
|
@@ -7358,8 +7376,8 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
|
|
|
7358
7376
|
});
|
|
7359
7377
|
});
|
|
7360
7378
|
const Autocomplete = InnerAutocomplete;
|
|
7361
|
-
const Root$8 = styled__default.default.ol(
|
|
7362
|
-
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"])));
|
|
7363
7381
|
const Breadcrumbs = react.forwardRef(function Breadcrumbs2(props, ref) {
|
|
7364
7382
|
const {
|
|
7365
7383
|
children,
|
|
@@ -7429,10 +7447,10 @@ const Breadcrumbs = react.forwardRef(function Breadcrumbs2(props, ref) {
|
|
|
7429
7447
|
}, itemIndex))
|
|
7430
7448
|
});
|
|
7431
7449
|
});
|
|
7432
|
-
function dialogStyle(
|
|
7450
|
+
function dialogStyle(_ref23) {
|
|
7433
7451
|
let {
|
|
7434
7452
|
theme
|
|
7435
|
-
} =
|
|
7453
|
+
} = _ref23;
|
|
7436
7454
|
const color = theme.sanity.color.base;
|
|
7437
7455
|
return {
|
|
7438
7456
|
"&:not([hidden])": {
|
|
@@ -7474,12 +7492,12 @@ function isTargetWithinScope(boundaryElement, portalElement, target) {
|
|
|
7474
7492
|
return containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
|
|
7475
7493
|
}
|
|
7476
7494
|
const Root$7 = styled__default.default(Layer)(responsivePaddingStyle, dialogStyle, responsiveDialogPositionStyle);
|
|
7477
|
-
const DialogContainer = styled__default.default(Container)(
|
|
7478
|
-
const DialogCardRoot = styled__default.default(Card)(
|
|
7479
|
-
const DialogLayout = styled__default.default(Flex)(
|
|
7480
|
-
const DialogHeader = styled__default.default(Card)(
|
|
7481
|
-
const DialogContent = styled__default.default(Box)(
|
|
7482
|
-
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"])));
|
|
7483
7501
|
const DialogCard = react.forwardRef(function DialogCard2(props, ref) {
|
|
7484
7502
|
var _a;
|
|
7485
7503
|
const {
|
|
@@ -7723,8 +7741,8 @@ function DialogProvider(props) {
|
|
|
7723
7741
|
children
|
|
7724
7742
|
});
|
|
7725
7743
|
}
|
|
7726
|
-
const Root$6 = styled__default.default.kbd(
|
|
7727
|
-
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"])));
|
|
7728
7746
|
const Hotkeys = react.forwardRef(function Hotkeys2(props, ref) {
|
|
7729
7747
|
const {
|
|
7730
7748
|
fontSize,
|
|
@@ -7945,7 +7963,7 @@ function useMenuController(props) {
|
|
|
7945
7963
|
setRootElement
|
|
7946
7964
|
};
|
|
7947
7965
|
}
|
|
7948
|
-
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"])));
|
|
7949
7967
|
const Menu = react.forwardRef(function Menu2(props, ref) {
|
|
7950
7968
|
const {
|
|
7951
7969
|
children,
|
|
@@ -8042,6 +8060,7 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
|
|
|
8042
8060
|
id,
|
|
8043
8061
|
menu: menuProp,
|
|
8044
8062
|
onClose,
|
|
8063
|
+
onOpen,
|
|
8045
8064
|
placement: deprecated_placement,
|
|
8046
8065
|
popoverScheme: deprecated_popoverScheme,
|
|
8047
8066
|
portal: deprecated_portal = true,
|
|
@@ -8054,6 +8073,11 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
|
|
|
8054
8073
|
const [buttonElement, setButtonElement] = react.useState(null);
|
|
8055
8074
|
const [menuElements, setChildMenuElements] = react.useState([]);
|
|
8056
8075
|
const openRef = react.useRef(open);
|
|
8076
|
+
react.useEffect(() => {
|
|
8077
|
+
if (onOpen && open && !openRef.current) {
|
|
8078
|
+
onOpen();
|
|
8079
|
+
}
|
|
8080
|
+
}, [onOpen, open]);
|
|
8057
8081
|
react.useEffect(() => {
|
|
8058
8082
|
if (onClose && !open && openRef.current) {
|
|
8059
8083
|
onClose();
|
|
@@ -8172,9 +8196,9 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
|
|
|
8172
8196
|
children: button || /* @__PURE__ */jsxRuntime.jsx(jsxRuntime.Fragment, {})
|
|
8173
8197
|
});
|
|
8174
8198
|
});
|
|
8175
|
-
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"])));
|
|
8176
8200
|
function selectableBaseStyle() {
|
|
8177
|
-
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 "])));
|
|
8178
8202
|
}
|
|
8179
8203
|
function selectableColorStyle(props) {
|
|
8180
8204
|
var _a, _b;
|
|
@@ -8188,7 +8212,7 @@ function selectableColorStyle(props) {
|
|
|
8188
8212
|
selectable
|
|
8189
8213
|
} = theme.sanity.color;
|
|
8190
8214
|
const tone = selectable ? selectable[$tone] || selectable.default : muted[$tone] || muted.default;
|
|
8191
|
-
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);
|
|
8192
8216
|
}
|
|
8193
8217
|
const Selectable = styled__default.default(Box)(responsiveRadiusStyle, selectableBaseStyle, selectableColorStyle);
|
|
8194
8218
|
function useMenu() {
|
|
@@ -8450,18 +8474,18 @@ const MenuItem = react.forwardRef(function MenuItem2(props, forwardedRef) {
|
|
|
8450
8474
|
})]
|
|
8451
8475
|
});
|
|
8452
8476
|
});
|
|
8453
|
-
const keyframe = styled.keyframes(
|
|
8454
|
-
const animation = styled.css(
|
|
8455
|
-
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 => {
|
|
8456
8480
|
let {
|
|
8457
8481
|
$visible
|
|
8458
|
-
} =
|
|
8482
|
+
} = _ref24;
|
|
8459
8483
|
return $visible ? 1 : 0;
|
|
8460
|
-
},
|
|
8484
|
+
}, _ref25 => {
|
|
8461
8485
|
let {
|
|
8462
8486
|
$animated
|
|
8463
|
-
} =
|
|
8464
|
-
return $animated ? animation : styled.css(
|
|
8487
|
+
} = _ref25;
|
|
8488
|
+
return $animated ? animation : styled.css(_templateObject80 || (_templateObject80 = _taggedTemplateLiteral(["\n background-color: var(--card-skeleton-color-from);\n "])));
|
|
8465
8489
|
});
|
|
8466
8490
|
const Root$4 = styled__default.default(Box)(responsiveRadiusStyle, skeletonStyle);
|
|
8467
8491
|
const Skeleton = react.forwardRef(function Skeleton2(props, ref) {
|
|
@@ -8491,12 +8515,12 @@ const Skeleton = react.forwardRef(function Skeleton2(props, ref) {
|
|
|
8491
8515
|
ref
|
|
8492
8516
|
});
|
|
8493
8517
|
});
|
|
8494
|
-
const Root$3 = styled__default.default(Skeleton)(
|
|
8518
|
+
const Root$3 = styled__default.default(Skeleton)(_ref26 => {
|
|
8495
8519
|
let {
|
|
8496
8520
|
$size,
|
|
8497
8521
|
$style,
|
|
8498
8522
|
theme
|
|
8499
|
-
} =
|
|
8523
|
+
} = _ref26;
|
|
8500
8524
|
const {
|
|
8501
8525
|
media
|
|
8502
8526
|
} = theme.sanity;
|
|
@@ -8678,8 +8702,8 @@ const ROLES = {
|
|
|
8678
8702
|
success: "alert",
|
|
8679
8703
|
info: "alert"
|
|
8680
8704
|
};
|
|
8681
|
-
const Root$2 = styled__default.default(Card)(
|
|
8682
|
-
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"])));
|
|
8683
8707
|
function Toast(props) {
|
|
8684
8708
|
const {
|
|
8685
8709
|
closable,
|
|
@@ -8739,8 +8763,8 @@ function useMounted() {
|
|
|
8739
8763
|
const key$1 = Symbol.for("@sanity/ui/context/toast");
|
|
8740
8764
|
globalScope[key$1] = globalScope[key$1] || react.createContext(null);
|
|
8741
8765
|
const ToastContext = globalScope[key$1];
|
|
8742
|
-
const Root$1 = styled__default.default(Layer)(
|
|
8743
|
-
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"])));
|
|
8744
8768
|
let toastId = 0;
|
|
8745
8769
|
function ToastProvider(props) {
|
|
8746
8770
|
const {
|
|
@@ -8817,12 +8841,12 @@ function ToastProvider(props) {
|
|
|
8817
8841
|
paddingY,
|
|
8818
8842
|
children: /* @__PURE__ */jsxRuntime.jsx(framerMotion.AnimatePresence, {
|
|
8819
8843
|
initial: false,
|
|
8820
|
-
children: state.map(
|
|
8844
|
+
children: state.map(_ref27 => {
|
|
8821
8845
|
let {
|
|
8822
8846
|
dismiss,
|
|
8823
8847
|
id,
|
|
8824
8848
|
params
|
|
8825
|
-
} =
|
|
8849
|
+
} = _ref27;
|
|
8826
8850
|
return /* @__PURE__ */jsxRuntime.jsx(framerMotion.motion.div, {
|
|
8827
8851
|
animate: {
|
|
8828
8852
|
opacity: 1,
|
|
@@ -9101,7 +9125,7 @@ const Tree = react.memo(react.forwardRef(function Tree2(props, ref) {
|
|
|
9101
9125
|
}));
|
|
9102
9126
|
Tree.displayName = "Tree";
|
|
9103
9127
|
function treeItemRootStyle() {
|
|
9104
|
-
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 "])));
|
|
9105
9129
|
}
|
|
9106
9130
|
function treeItemRootColorStyle(props) {
|
|
9107
9131
|
const {
|
|
@@ -9114,7 +9138,7 @@ function treeItemRootColorStyle(props) {
|
|
|
9114
9138
|
selectable
|
|
9115
9139
|
} = theme.sanity.color;
|
|
9116
9140
|
const tone = selectable ? selectable[$tone] || selectable.default : muted[$tone] || muted.default;
|
|
9117
|
-
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));
|
|
9118
9142
|
}
|
|
9119
9143
|
function treeItemBoxStyle(props) {
|
|
9120
9144
|
const {
|
|
@@ -9124,7 +9148,7 @@ function treeItemBoxStyle(props) {
|
|
|
9124
9148
|
const {
|
|
9125
9149
|
space
|
|
9126
9150
|
} = theme.sanity;
|
|
9127
|
-
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));
|
|
9128
9152
|
}
|
|
9129
9153
|
function useTree() {
|
|
9130
9154
|
const tree = react.useContext(TreeContext);
|
|
@@ -9155,7 +9179,7 @@ const Root = react.memo(styled__default.default.li(treeItemRootStyle, treeItemRo
|
|
|
9155
9179
|
const TreeItemBox = styled__default.default(Box).attrs({
|
|
9156
9180
|
forwardedAs: "a"
|
|
9157
9181
|
})(treeItemBoxStyle);
|
|
9158
|
-
const ToggleArrowText = styled__default.default(Text)(
|
|
9182
|
+
const ToggleArrowText = styled__default.default(Text)(_templateObject88 || (_templateObject88 = _taggedTemplateLiteral(["\n & > svg {\n transition: transform 100ms;\n }\n"])));
|
|
9159
9183
|
const TreeItem = react.memo(function TreeItem2(props) {
|
|
9160
9184
|
const {
|
|
9161
9185
|
children,
|
|
@@ -9338,7 +9362,6 @@ exports.MenuDivider = MenuDivider;
|
|
|
9338
9362
|
exports.MenuGroup = MenuGroup;
|
|
9339
9363
|
exports.MenuItem = MenuItem;
|
|
9340
9364
|
exports.Popover = Popover;
|
|
9341
|
-
exports.PopoverProvider = PopoverProvider;
|
|
9342
9365
|
exports.Portal = Portal;
|
|
9343
9366
|
exports.PortalProvider = PortalProvider;
|
|
9344
9367
|
exports.Radio = Radio;
|
|
@@ -9412,7 +9435,6 @@ exports.useForwardedRef = useForwardedRef;
|
|
|
9412
9435
|
exports.useGlobalKeyDown = useGlobalKeyDown;
|
|
9413
9436
|
exports.useLayer = useLayer;
|
|
9414
9437
|
exports.useMediaIndex = useMediaIndex;
|
|
9415
|
-
exports.usePopover = usePopover;
|
|
9416
9438
|
exports.usePortal = usePortal;
|
|
9417
9439
|
exports.usePrefersDark = usePrefersDark;
|
|
9418
9440
|
exports.usePrefersReducedMotion = usePrefersReducedMotion;
|