@sanity/ui 1.0.0-beta.30 → 1.0.0-beta.31
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/sanity-ui.esm.js +165 -95
- package/dist/sanity-ui.esm.js.map +1 -1
- package/dist/sanity-ui.js +164 -94
- package/dist/sanity-ui.js.map +1 -1
- package/dist/types/src/index.d.ts +0 -6
- package/package.json +4 -4
- package/src/__workshop__/constants.ts +31 -22
- package/src/components/autocomplete/autocomplete.styles.tsx +1 -10
- package/src/components/autocomplete/autocomplete.tsx +13 -3
- package/src/components/menu/__workshop__/closableMenuButton.tsx +6 -2
- package/src/components/menu/__workshop__/constrainedInBoundary.tsx +5 -11
- package/src/components/menu/__workshop__/disableFocusOnClose.tsx +7 -2
- package/src/components/menu/__workshop__/groups.tsx +16 -3
- package/src/components/menu/__workshop__/menuButton.tsx +11 -1
- package/src/components/menu/__workshop__/menuGroupRight.tsx +8 -1
- package/src/components/menu/__workshop__/onCloseMenuButton.tsx +6 -2
- package/src/components/menu/__workshop__/selectedItem.tsx +16 -2
- package/src/components/menu/__workshop__/withoutArrow.tsx +12 -10
- package/src/primitives/card/styles.ts +3 -1
- package/src/primitives/popover/__workshop__/{RightAlignedStory.tsx → AlignedStory.tsx} +19 -7
- package/src/primitives/popover/__workshop__/PlainStory.tsx +24 -21
- package/src/primitives/popover/__workshop__/TestStory.tsx +2 -0
- package/src/primitives/popover/__workshop__/index.ts +3 -3
- package/src/primitives/popover/constants.ts +10 -0
- package/src/primitives/popover/floating-ui/size.ts +67 -0
- package/src/primitives/popover/popover.tsx +43 -50
- package/src/primitives/popover/popoverArrow.tsx +10 -9
- package/src/primitives/popover/popoverCard.tsx +42 -29
package/dist/sanity-ui.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, _templateObject89
|
|
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, _templateObject89;
|
|
4
4
|
|
|
5
5
|
const _excluded = ["color", "layer"],
|
|
6
6
|
_excluded2 = ["accent", "align", "children", "muted", "size", "textOverflow", "weight"],
|
|
@@ -23,8 +23,8 @@ const _excluded = ["color", "layer"],
|
|
|
23
23
|
_excluded19 = ["children", "style"],
|
|
24
24
|
_excluded20 = ["children", "zOffset"],
|
|
25
25
|
_excluded21 = ["as", "gap", "getItemKey", "items", "onChange", "renderItem"],
|
|
26
|
-
_excluded22 = ["__unstable_margins", "arrow", "arrowRef", "arrowX", "arrowY", "availableHeight", "availableWidth", "boundaryWidth", "children", "padding", "placement", "overflow", "radius", "referenceWidth", "scheme", "shadow", "strategy", "tone", "width", "x", "y"],
|
|
27
|
-
_excluded23 = ["__unstable_margins", "
|
|
26
|
+
_excluded22 = ["__unstable_margins", "arrow", "arrowRef", "arrowX", "arrowY", "availableHeight", "availableWidth", "boundaryWidth", "children", "padding", "placement", "overflow", "radius", "referenceWidth", "scheme", "shadow", "strategy", "style", "tone", "width", "x", "y"],
|
|
27
|
+
_excluded23 = ["__unstable_margins", "arrow", "boundaryElement", "children", "constrainSize", "content", "disabled", "fallbackPlacements", "matchReferenceWidth", "open", "overflow", "padding", "placement", "portal", "preventOverflow", "radius", "referenceElement", "scheme", "shadow", "tone", "width", "zOffset"],
|
|
28
28
|
_excluded24 = ["className", "disabled", "style", "customValidity", "readOnly"],
|
|
29
29
|
_excluded25 = ["children", "customValidity", "disabled", "fontSize", "padding", "radius", "readOnly", "space"],
|
|
30
30
|
_excluded26 = ["as", "space"],
|
|
@@ -5141,13 +5141,14 @@ function cardColorStyle(props) {
|
|
|
5141
5141
|
} = theme.sanity;
|
|
5142
5142
|
const {
|
|
5143
5143
|
base,
|
|
5144
|
-
card
|
|
5144
|
+
card,
|
|
5145
|
+
dark
|
|
5145
5146
|
} = theme.sanity.color;
|
|
5146
5147
|
const border = {
|
|
5147
5148
|
width: 0,
|
|
5148
5149
|
color: "var(--card-border-color)"
|
|
5149
5150
|
};
|
|
5150
|
-
return styled.css(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n ", "\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n\n /* &:is(button) */\n &[data-as='button'] {\n --card-focus-ring-box-shadow: none;\n\n cursor: default;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &:disabled {\n ", "\n }\n\n &:not(:disabled) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n cursor: pointer;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &[data-disabled] {\n ", "\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n ", "\n "])), _colorVarsStyle(base, card.enabled, $checkered), _colorVarsStyle(base, card.disabled, $checkered), _colorVarsStyle(base, card.pressed, $checkered), _colorVarsStyle(base, card.selected, $checkered), _colorVarsStyle(base, card.hovered, $checkered), _colorVarsStyle(base, card.pressed, $checkered), $focusRing ? focusRingStyle({
|
|
5151
|
+
return styled.css(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n color-scheme: ", ";\n\n ", "\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n\n /* &:is(button) */\n &[data-as='button'] {\n --card-focus-ring-box-shadow: none;\n\n cursor: default;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &:disabled {\n ", "\n }\n\n &:not(:disabled) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n cursor: pointer;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &[data-disabled] {\n ", "\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ", "\n }\n\n &[data-selected] {\n ", "\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &:hover {\n ", "\n }\n\n &:active {\n ", "\n }\n }\n }\n\n &:focus {\n --card-focus-ring-box-shadow: ", ";\n }\n\n &:focus:not(:focus-visible) {\n --card-focus-ring-box-shadow: ", ";\n }\n }\n }\n\n ", "\n "])), dark ? "dark" : "light", _colorVarsStyle(base, card.enabled, $checkered), _colorVarsStyle(base, card.disabled, $checkered), _colorVarsStyle(base, card.pressed, $checkered), _colorVarsStyle(base, card.selected, $checkered), _colorVarsStyle(base, card.hovered, $checkered), _colorVarsStyle(base, card.pressed, $checkered), $focusRing ? focusRingStyle({
|
|
5151
5152
|
base,
|
|
5152
5153
|
border,
|
|
5153
5154
|
focusRing
|
|
@@ -6215,7 +6216,82 @@ const VirtualList = react.forwardRef(function VirtualList2(props, ref) {
|
|
|
6215
6216
|
})
|
|
6216
6217
|
}));
|
|
6217
6218
|
});
|
|
6218
|
-
const
|
|
6219
|
+
const DEFAULT_POPOVER_DISTANCE = 4;
|
|
6220
|
+
const DEFAULT_POPOVER_PADDING = 4;
|
|
6221
|
+
const DEFAULT_POPOVER_ARROW_WIDTH = 27;
|
|
6222
|
+
const DEFAULT_POPOVER_ARROW_HEIGHT = 11;
|
|
6223
|
+
const DEFAULT_POPOVER_MARGINS = [0, 0, 0, 0];
|
|
6224
|
+
|
|
6225
|
+
function size(scope) {
|
|
6226
|
+
const {
|
|
6227
|
+
padding = 0
|
|
6228
|
+
} = scope;
|
|
6229
|
+
return {
|
|
6230
|
+
name: "@sanity/ui/size",
|
|
6231
|
+
|
|
6232
|
+
async fn(args) {
|
|
6233
|
+
const {
|
|
6234
|
+
placement,
|
|
6235
|
+
rects
|
|
6236
|
+
} = args;
|
|
6237
|
+
const {
|
|
6238
|
+
floating,
|
|
6239
|
+
reference
|
|
6240
|
+
} = rects;
|
|
6241
|
+
const overflow = await reactDom$1.detectOverflow(args, {
|
|
6242
|
+
altBoundary: true,
|
|
6243
|
+
boundary: scope.boundaryElement || void 0,
|
|
6244
|
+
elementContext: "floating",
|
|
6245
|
+
padding,
|
|
6246
|
+
rootBoundary: "viewport"
|
|
6247
|
+
});
|
|
6248
|
+
let maxWidth = Infinity;
|
|
6249
|
+
let maxHeight = Infinity;
|
|
6250
|
+
|
|
6251
|
+
if (placement.includes("top")) {
|
|
6252
|
+
maxWidth = floating.width - (overflow.left + overflow.right);
|
|
6253
|
+
maxHeight = floating.height - overflow.top - padding;
|
|
6254
|
+
}
|
|
6255
|
+
|
|
6256
|
+
if (placement.includes("right")) {
|
|
6257
|
+
maxWidth = floating.width - overflow.right - padding;
|
|
6258
|
+
maxHeight = floating.height - (overflow.top + overflow.bottom);
|
|
6259
|
+
}
|
|
6260
|
+
|
|
6261
|
+
if (placement.includes("bottom")) {
|
|
6262
|
+
maxWidth = floating.width - (overflow.left + overflow.right);
|
|
6263
|
+
maxHeight = floating.height - overflow.bottom - padding;
|
|
6264
|
+
}
|
|
6265
|
+
|
|
6266
|
+
if (placement.includes("left")) {
|
|
6267
|
+
maxWidth = floating.width - overflow.left - padding;
|
|
6268
|
+
maxHeight = floating.height - (overflow.top + overflow.bottom);
|
|
6269
|
+
}
|
|
6270
|
+
|
|
6271
|
+
if (scope.constrainSize) {
|
|
6272
|
+
scope.setAvailableWidth(maxWidth);
|
|
6273
|
+
scope.setAvailableHeight(maxHeight);
|
|
6274
|
+
}
|
|
6275
|
+
|
|
6276
|
+
if (scope.matchReferenceWidth) {
|
|
6277
|
+
scope.setReferenceWidth(reference.width);
|
|
6278
|
+
}
|
|
6279
|
+
|
|
6280
|
+
if (!floating.width || !floating.height) {
|
|
6281
|
+
return {
|
|
6282
|
+
reset: {
|
|
6283
|
+
rects: true
|
|
6284
|
+
}
|
|
6285
|
+
};
|
|
6286
|
+
}
|
|
6287
|
+
|
|
6288
|
+
return {};
|
|
6289
|
+
}
|
|
6290
|
+
|
|
6291
|
+
};
|
|
6292
|
+
}
|
|
6293
|
+
|
|
6294
|
+
const Root$j = styled__default["default"].div(_templateObject33 || (_templateObject33 = _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);
|
|
6219
6295
|
const BorderPath = styled__default["default"].path(_templateObject34 || (_templateObject34 = _taggedTemplateLiteral(["\n fill: var(--card-shadow-outline-color);\n"])));
|
|
6220
6296
|
const ShapePath = styled__default["default"].path(_templateObject35 || (_templateObject35 = _taggedTemplateLiteral(["\n fill: var(--card-bg-color);\n"])));
|
|
6221
6297
|
const PopoverArrow = react.forwardRef(function PopoverArrow2(props, ref) {
|
|
@@ -6224,8 +6300,8 @@ const PopoverArrow = react.forwardRef(function PopoverArrow2(props, ref) {
|
|
|
6224
6300
|
}, props), {}, {
|
|
6225
6301
|
ref,
|
|
6226
6302
|
children: /* @__PURE__ */jsxRuntime.jsxs("svg", {
|
|
6227
|
-
width:
|
|
6228
|
-
height:
|
|
6303
|
+
width: DEFAULT_POPOVER_ARROW_WIDTH,
|
|
6304
|
+
height: DEFAULT_POPOVER_ARROW_HEIGHT,
|
|
6229
6305
|
viewBox: "0 0 27 11",
|
|
6230
6306
|
fill: "none",
|
|
6231
6307
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6243,7 +6319,15 @@ function popoverCardStyle(props) {
|
|
|
6243
6319
|
$boundaryWidth
|
|
6244
6320
|
} = props;
|
|
6245
6321
|
return {
|
|
6246
|
-
|
|
6322
|
+
"&:not([hidden])": {
|
|
6323
|
+
display: "flex"
|
|
6324
|
+
},
|
|
6325
|
+
flexDirection: "column",
|
|
6326
|
+
width: "max-content",
|
|
6327
|
+
minWidth: "min-content",
|
|
6328
|
+
maxWidth: typeof $boundaryWidth === "number" ? "".concat($boundaryWidth - DEFAULT_POPOVER_PADDING * 2, "px") : void 0,
|
|
6329
|
+
height: "max-content",
|
|
6330
|
+
minHeight: "min-content"
|
|
6247
6331
|
};
|
|
6248
6332
|
}
|
|
6249
6333
|
|
|
@@ -6267,8 +6351,9 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
6267
6351
|
scheme,
|
|
6268
6352
|
shadow,
|
|
6269
6353
|
strategy,
|
|
6354
|
+
style,
|
|
6270
6355
|
tone,
|
|
6271
|
-
width,
|
|
6356
|
+
width = "auto",
|
|
6272
6357
|
x: xProp,
|
|
6273
6358
|
y: yProp
|
|
6274
6359
|
} = props,
|
|
@@ -6277,33 +6362,29 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
6277
6362
|
const {
|
|
6278
6363
|
zIndex
|
|
6279
6364
|
} = useLayer();
|
|
6280
|
-
const margins = react.useMemo(() => marginsProp ||
|
|
6365
|
+
const margins = react.useMemo(() => marginsProp || DEFAULT_POPOVER_MARGINS, [marginsProp]);
|
|
6281
6366
|
const referenceWidth = referenceWidthProp ? referenceWidthProp - margins[1] - margins[3] : void 0;
|
|
6282
6367
|
const x = (xProp != null ? xProp : 0) + margins[3];
|
|
6283
6368
|
const y = (yProp != null ? yProp : 0) + margins[0];
|
|
6284
|
-
const
|
|
6285
|
-
const rootStyle = react.useMemo(() => ({
|
|
6369
|
+
const rootStyle = react.useMemo(() => _objectSpread({
|
|
6286
6370
|
position: strategy,
|
|
6287
6371
|
top: y,
|
|
6288
6372
|
left: x,
|
|
6289
6373
|
zIndex,
|
|
6290
6374
|
width: referenceWidth,
|
|
6291
|
-
maxWidth:
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
minHeight: 25,
|
|
6295
|
-
maxHeight: availableHeight ? availableHeight - 8 : void 0
|
|
6296
|
-
}), [availableHeight]);
|
|
6375
|
+
maxWidth: availableWidth,
|
|
6376
|
+
maxHeight: availableHeight
|
|
6377
|
+
}, style), [availableHeight, availableWidth, referenceWidth, strategy, style, x, y, zIndex]);
|
|
6297
6378
|
const staticSide = placement && FLOATING_STATIC_SIDES[placement.split("-")[0]];
|
|
6298
6379
|
const arrowStyle = react.useMemo(() => {
|
|
6299
|
-
const
|
|
6380
|
+
const style2 = {
|
|
6300
6381
|
left: arrowX !== null ? arrowX : void 0,
|
|
6301
6382
|
top: arrowY !== null ? arrowY : void 0,
|
|
6302
6383
|
right: void 0,
|
|
6303
6384
|
bottom: void 0
|
|
6304
6385
|
};
|
|
6305
|
-
if (staticSide)
|
|
6306
|
-
return
|
|
6386
|
+
if (staticSide) style2[staticSide] = 0 - DEFAULT_POPOVER_ARROW_WIDTH;
|
|
6387
|
+
return style2;
|
|
6307
6388
|
}, [arrowX, arrowY, staticSide]);
|
|
6308
6389
|
return /* @__PURE__ */jsxRuntime.jsxs(Root$i, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
6309
6390
|
$boundaryWidth: boundaryWidth,
|
|
@@ -6315,13 +6396,13 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
6315
6396
|
shadow,
|
|
6316
6397
|
style: rootStyle,
|
|
6317
6398
|
tone,
|
|
6318
|
-
|
|
6319
|
-
children: [/* @__PURE__ */jsxRuntime.jsx(Box, {
|
|
6399
|
+
children: [/* @__PURE__ */jsxRuntime.jsx(Container, {
|
|
6320
6400
|
"data-ui": "Popover__wrapper",
|
|
6401
|
+
flex: 1,
|
|
6321
6402
|
overflow,
|
|
6322
6403
|
padding,
|
|
6323
6404
|
sizing: "border",
|
|
6324
|
-
|
|
6405
|
+
width,
|
|
6325
6406
|
children
|
|
6326
6407
|
}), arrow && /* @__PURE__ */jsxRuntime.jsx(PopoverArrow, {
|
|
6327
6408
|
ref: arrowRef,
|
|
@@ -6330,33 +6411,14 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
6330
6411
|
}));
|
|
6331
6412
|
}));
|
|
6332
6413
|
PopoverCard.displayName = "PopoverCard";
|
|
6333
|
-
|
|
6334
|
-
function size(scope) {
|
|
6335
|
-
return reactDom$1.size({
|
|
6336
|
-
apply(args) {
|
|
6337
|
-
if (scope.constrainSize) {
|
|
6338
|
-
scope.setAvailableWidth(args.availableWidth);
|
|
6339
|
-
scope.setAvailableHeight(args.availableHeight);
|
|
6340
|
-
}
|
|
6341
|
-
|
|
6342
|
-
if (scope.matchReferenceWidth) {
|
|
6343
|
-
scope.setReferenceWidth(args.rects.reference.width);
|
|
6344
|
-
}
|
|
6345
|
-
},
|
|
6346
|
-
|
|
6347
|
-
boundary: scope.boundaryElement || void 0
|
|
6348
|
-
});
|
|
6349
|
-
}
|
|
6350
|
-
|
|
6351
6414
|
const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
6352
|
-
var _a, _b, _c, _d;
|
|
6415
|
+
var _a, _b, _c, _d, _e;
|
|
6353
6416
|
|
|
6354
6417
|
const theme = useTheme();
|
|
6355
6418
|
const boundaryElementContext = useBoundaryElement();
|
|
6356
6419
|
|
|
6357
6420
|
const {
|
|
6358
6421
|
__unstable_margins: margins,
|
|
6359
|
-
allowedAutoPlacements,
|
|
6360
6422
|
arrow: arrowProp = true,
|
|
6361
6423
|
boundaryElement = boundaryElementContext.element,
|
|
6362
6424
|
children: childProp,
|
|
@@ -6366,7 +6428,7 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6366
6428
|
fallbackPlacements,
|
|
6367
6429
|
matchReferenceWidth: matchReferenceWidthProp,
|
|
6368
6430
|
open,
|
|
6369
|
-
overflow = props.constrainSize ? "auto" :
|
|
6431
|
+
overflow = props.constrainSize ? "auto" : "hidden",
|
|
6370
6432
|
padding: paddingProp,
|
|
6371
6433
|
placement: placementProp = "bottom",
|
|
6372
6434
|
portal,
|
|
@@ -6375,10 +6437,8 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6375
6437
|
referenceElement,
|
|
6376
6438
|
scheme,
|
|
6377
6439
|
shadow: shadowProp = 3,
|
|
6378
|
-
tether,
|
|
6379
|
-
tetherOffset,
|
|
6380
6440
|
tone = "inherit",
|
|
6381
|
-
width: widthProp =
|
|
6441
|
+
width: widthProp = "auto",
|
|
6382
6442
|
zOffset: zOffsetProp = (_a = theme.sanity.layer) == null ? void 0 : _a.popover.zOffset
|
|
6383
6443
|
} = props,
|
|
6384
6444
|
restProps = _objectWithoutProperties(props, _excluded23);
|
|
@@ -6402,38 +6462,47 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6402
6462
|
ret.push(reactDom$1.flip({
|
|
6403
6463
|
boundary: boundaryElement || void 0,
|
|
6404
6464
|
fallbackPlacements,
|
|
6405
|
-
padding:
|
|
6465
|
+
padding: DEFAULT_POPOVER_PADDING,
|
|
6406
6466
|
rootBoundary
|
|
6407
6467
|
}));
|
|
6408
6468
|
}
|
|
6409
6469
|
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6470
|
+
if (constrainSize || matchReferenceWidthProp) {
|
|
6471
|
+
ret.push(size({
|
|
6472
|
+
boundaryElement,
|
|
6473
|
+
constrainSize,
|
|
6474
|
+
matchReferenceWidth: matchReferenceWidthProp,
|
|
6475
|
+
padding: DEFAULT_POPOVER_PADDING,
|
|
6476
|
+
setAvailableHeight,
|
|
6477
|
+
setAvailableWidth,
|
|
6478
|
+
setReferenceWidth
|
|
6479
|
+
}));
|
|
6480
|
+
}
|
|
6481
|
+
|
|
6418
6482
|
ret.push(reactDom$1.offset({
|
|
6419
|
-
mainAxis: arrowProp ?
|
|
6483
|
+
mainAxis: arrowProp ? DEFAULT_POPOVER_DISTANCE : 0
|
|
6420
6484
|
}));
|
|
6421
6485
|
|
|
6422
6486
|
if (preventOverflow) {
|
|
6423
6487
|
ret.push(reactDom$1.shift({
|
|
6424
6488
|
boundary: boundaryElement || void 0,
|
|
6425
6489
|
rootBoundary,
|
|
6426
|
-
padding:
|
|
6490
|
+
padding: DEFAULT_POPOVER_PADDING
|
|
6427
6491
|
}));
|
|
6428
6492
|
}
|
|
6429
6493
|
|
|
6430
6494
|
if (arrowProp) {
|
|
6431
6495
|
ret.push(reactDom$1.arrow({
|
|
6432
6496
|
element: arrowRef,
|
|
6433
|
-
padding:
|
|
6497
|
+
padding: DEFAULT_POPOVER_PADDING
|
|
6434
6498
|
}));
|
|
6435
6499
|
}
|
|
6436
6500
|
|
|
6501
|
+
ret.push(reactDom$1.hide({
|
|
6502
|
+
boundary: boundaryElement || void 0,
|
|
6503
|
+
padding: DEFAULT_POPOVER_PADDING,
|
|
6504
|
+
strategy: "referenceHidden"
|
|
6505
|
+
}));
|
|
6437
6506
|
return ret;
|
|
6438
6507
|
}, [arrowProp, boundaryElement, constrainSize, fallbackPlacements, matchReferenceWidthProp, preventOverflow]);
|
|
6439
6508
|
const {
|
|
@@ -6449,8 +6518,9 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6449
6518
|
placement: placementProp,
|
|
6450
6519
|
whileElementsMounted: reactDom$1.autoUpdate
|
|
6451
6520
|
});
|
|
6452
|
-
const
|
|
6453
|
-
const
|
|
6521
|
+
const referenceHidden = (_c = middlewareData.hide) == null ? void 0 : _c.referenceHidden;
|
|
6522
|
+
const arrowX = (_d = middlewareData.arrow) == null ? void 0 : _d.x;
|
|
6523
|
+
const arrowY = (_e = middlewareData.arrow) == null ? void 0 : _e.y;
|
|
6454
6524
|
const setArrow = react.useCallback(arrowEl => {
|
|
6455
6525
|
arrowRef.current = arrowEl;
|
|
6456
6526
|
}, []);
|
|
@@ -6492,7 +6562,8 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6492
6562
|
arrowY,
|
|
6493
6563
|
availableWidth: constrainSize ? availableWidth : void 0,
|
|
6494
6564
|
availableHeight: constrainSize ? availableHeight : void 0,
|
|
6495
|
-
boundaryWidth: boundarySize == null ? void 0 : boundarySize.width,
|
|
6565
|
+
boundaryWidth: preventOverflow ? boundarySize == null ? void 0 : boundarySize.width : void 0,
|
|
6566
|
+
hidden: referenceHidden,
|
|
6496
6567
|
overflow,
|
|
6497
6568
|
padding,
|
|
6498
6569
|
placement,
|
|
@@ -7236,9 +7307,8 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
7236
7307
|
});
|
|
7237
7308
|
const Root$9 = styled__default["default"].div(_templateObject60 || (_templateObject60 = _taggedTemplateLiteral(["\n line-height: 0;\n"])));
|
|
7238
7309
|
const ListBox = styled__default["default"](Box)(_templateObject61 || (_templateObject61 = _taggedTemplateLiteral(["\n & > ul {\n list-style: none;\n padding: 0;\n margin: 0;\n }\n"])));
|
|
7239
|
-
const
|
|
7240
|
-
const
|
|
7241
|
-
const AnimatedSpinnerIcon = styled__default["default"](icons.SpinnerIcon)(_templateObject64 || (_templateObject64 = _taggedTemplateLiteral(["\n animation: ", " 500ms linear infinite;\n"])), rotate);
|
|
7310
|
+
const rotate = styled.keyframes(_templateObject62 || (_templateObject62 = _taggedTemplateLiteral(["\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n"])));
|
|
7311
|
+
const AnimatedSpinnerIcon = styled__default["default"](icons.SpinnerIcon)(_templateObject63 || (_templateObject63 = _taggedTemplateLiteral(["\n animation: ", " 500ms linear infinite;\n"])), rotate);
|
|
7242
7312
|
|
|
7243
7313
|
function AutocompleteOption(props) {
|
|
7244
7314
|
const {
|
|
@@ -7770,7 +7840,7 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
|
|
|
7770
7840
|
return null;
|
|
7771
7841
|
}
|
|
7772
7842
|
|
|
7773
|
-
return /* @__PURE__ */jsxRuntime.jsx(
|
|
7843
|
+
return /* @__PURE__ */jsxRuntime.jsx(Popover, _objectSpread({
|
|
7774
7844
|
__unstable_margins: AUTOCOMPLETE_POPOVER_MARGINS,
|
|
7775
7845
|
arrow: false,
|
|
7776
7846
|
constrainSize: true,
|
|
@@ -7797,8 +7867,8 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
|
|
|
7797
7867
|
});
|
|
7798
7868
|
});
|
|
7799
7869
|
const Autocomplete = InnerAutocomplete;
|
|
7800
|
-
const Root$8 = styled__default["default"].ol(
|
|
7801
|
-
const ExpandButton = styled__default["default"](Button)(
|
|
7870
|
+
const Root$8 = styled__default["default"].ol(_templateObject64 || (_templateObject64 = _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"])));
|
|
7871
|
+
const ExpandButton = styled__default["default"](Button)(_templateObject65 || (_templateObject65 = _taggedTemplateLiteral(["\n appearance: none;\n margin: -4px;\n"])));
|
|
7802
7872
|
const Breadcrumbs = react.forwardRef(function Breadcrumbs2(props, ref) {
|
|
7803
7873
|
const {
|
|
7804
7874
|
children,
|
|
@@ -7917,12 +7987,12 @@ function useDialog() {
|
|
|
7917
7987
|
}
|
|
7918
7988
|
|
|
7919
7989
|
const Root$7 = styled__default["default"](Layer)(responsivePaddingStyle, dialogStyle, responsiveDialogPositionStyle);
|
|
7920
|
-
const DialogContainer = styled__default["default"](Container)(
|
|
7921
|
-
const DialogCardRoot = styled__default["default"](Card)(
|
|
7922
|
-
const DialogLayout = styled__default["default"](Flex)(
|
|
7923
|
-
const DialogHeader = styled__default["default"](Card)(
|
|
7924
|
-
const DialogContent = styled__default["default"](Box)(
|
|
7925
|
-
const DialogFooter = styled__default["default"](Box)(
|
|
7990
|
+
const DialogContainer = styled__default["default"](Container)(_templateObject66 || (_templateObject66 = _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"])));
|
|
7991
|
+
const DialogCardRoot = styled__default["default"](Card)(_templateObject67 || (_templateObject67 = _taggedTemplateLiteral(["\n &:not([hidden]) {\n display: flex;\n }\n width: 100%;\n min-height: 0;\n max-height: 100%;\n overflow: hidden;\n"])));
|
|
7992
|
+
const DialogLayout = styled__default["default"](Flex)(_templateObject68 || (_templateObject68 = _taggedTemplateLiteral(["\n flex: 1;\n min-height: 0;\n width: 100%;\n"])));
|
|
7993
|
+
const DialogHeader = styled__default["default"](Card)(_templateObject69 || (_templateObject69 = _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"])));
|
|
7994
|
+
const DialogContent = styled__default["default"](Box)(_templateObject70 || (_templateObject70 = _taggedTemplateLiteral(["\n position: relative;\n z-index: 1;\n overflow: auto;\n outline: none;\n"])));
|
|
7995
|
+
const DialogFooter = styled__default["default"](Box)(_templateObject71 || (_templateObject71 = _taggedTemplateLiteral(["\n position: relative;\n z-index: 3;\n border-top: 1px solid var(--card-hairline-soft-color);\n"])));
|
|
7926
7996
|
const DialogCard = react.forwardRef(function DialogCard2(props, ref) {
|
|
7927
7997
|
const {
|
|
7928
7998
|
__unstable_autoFocus: autoFocus,
|
|
@@ -8134,8 +8204,8 @@ function DialogProvider(props) {
|
|
|
8134
8204
|
});
|
|
8135
8205
|
}
|
|
8136
8206
|
|
|
8137
|
-
const Root$6 = styled__default["default"].kbd(
|
|
8138
|
-
const Key = styled__default["default"](KBD)(
|
|
8207
|
+
const Root$6 = styled__default["default"].kbd(_templateObject72 || (_templateObject72 = _taggedTemplateLiteral(["\n &:not([hidden]) {\n display: block;\n }\n font: inherit;\n"])));
|
|
8208
|
+
const Key = styled__default["default"](KBD)(_templateObject73 || (_templateObject73 = _taggedTemplateLiteral(["\n &:not([hidden]) {\n display: block;\n }\n"])));
|
|
8139
8209
|
const Hotkeys = react.forwardRef(function Hotkeys2(props, ref) {
|
|
8140
8210
|
const {
|
|
8141
8211
|
fontSize,
|
|
@@ -8406,7 +8476,7 @@ function useMenuController(props) {
|
|
|
8406
8476
|
};
|
|
8407
8477
|
}
|
|
8408
8478
|
|
|
8409
|
-
const Root$5 = styled__default["default"](Box)(
|
|
8479
|
+
const Root$5 = styled__default["default"](Box)(_templateObject74 || (_templateObject74 = _taggedTemplateLiteral(["\n outline: none;\n overflow: auto;\n"])));
|
|
8410
8480
|
const Menu = react.forwardRef(function Menu2(props, ref) {
|
|
8411
8481
|
const {
|
|
8412
8482
|
children,
|
|
@@ -8640,10 +8710,10 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
|
|
|
8640
8710
|
children: button || /* @__PURE__ */jsxRuntime.jsx(jsxRuntime.Fragment, {})
|
|
8641
8711
|
}));
|
|
8642
8712
|
});
|
|
8643
|
-
const MenuDivider = styled__default["default"].hr(
|
|
8713
|
+
const MenuDivider = styled__default["default"].hr(_templateObject75 || (_templateObject75 = _taggedTemplateLiteral(["\n height: 1px;\n border: 0;\n background: var(--card-hairline-soft-color);\n margin: 0;\n"])));
|
|
8644
8714
|
|
|
8645
8715
|
function selectableBaseStyle() {
|
|
8646
|
-
return styled.css(
|
|
8716
|
+
return styled.css(_templateObject76 || (_templateObject76 = _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 "])));
|
|
8647
8717
|
}
|
|
8648
8718
|
|
|
8649
8719
|
function selectableColorStyle(props) {
|
|
@@ -8659,7 +8729,7 @@ function selectableColorStyle(props) {
|
|
|
8659
8729
|
selectable
|
|
8660
8730
|
} = theme.sanity.color;
|
|
8661
8731
|
const tone = selectable ? selectable[$tone] || selectable.default : muted[$tone] || muted.default;
|
|
8662
|
-
return styled.css(
|
|
8732
|
+
return styled.css(_templateObject77 || (_templateObject77 = _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 &: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 &: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);
|
|
8663
8733
|
}
|
|
8664
8734
|
|
|
8665
8735
|
const Selectable = styled__default["default"](Box)(responsiveRadiusStyle, selectableBaseStyle, selectableColorStyle);
|
|
@@ -8931,9 +9001,9 @@ const MenuItem = react.forwardRef(function MenuItem2(props, forwardedRef) {
|
|
|
8931
9001
|
}))]
|
|
8932
9002
|
}));
|
|
8933
9003
|
});
|
|
8934
|
-
const keyframe = styled.keyframes(
|
|
8935
|
-
const animation = styled.css(
|
|
8936
|
-
const skeletonStyle = styled.css(
|
|
9004
|
+
const keyframe = styled.keyframes(_templateObject78 || (_templateObject78 = _taggedTemplateLiteral(["\n 0% {\n background-position: 100%;\n }\n 100% {\n background-position: -100%;\n }\n"])));
|
|
9005
|
+
const animation = styled.css(_templateObject79 || (_templateObject79 = _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);
|
|
9006
|
+
const skeletonStyle = styled.css(_templateObject80 || (_templateObject80 = _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"])), _ref23 => {
|
|
8937
9007
|
let {
|
|
8938
9008
|
$visible
|
|
8939
9009
|
} = _ref23;
|
|
@@ -8942,7 +9012,7 @@ const skeletonStyle = styled.css(_templateObject81 || (_templateObject81 = _tagg
|
|
|
8942
9012
|
let {
|
|
8943
9013
|
$animated
|
|
8944
9014
|
} = _ref24;
|
|
8945
|
-
return $animated ? animation : styled.css(
|
|
9015
|
+
return $animated ? animation : styled.css(_templateObject81 || (_templateObject81 = _taggedTemplateLiteral(["\n background-color: var(--card-skeleton-color-from);\n "])));
|
|
8946
9016
|
});
|
|
8947
9017
|
const Root$4 = styled__default["default"](Box)(responsiveRadiusStyle, skeletonStyle);
|
|
8948
9018
|
const Skeleton = react.forwardRef(function Skeleton2(props, ref) {
|
|
@@ -9170,8 +9240,8 @@ const ROLES = {
|
|
|
9170
9240
|
success: "alert",
|
|
9171
9241
|
info: "alert"
|
|
9172
9242
|
};
|
|
9173
|
-
const Root$2 = styled__default["default"](Card)(
|
|
9174
|
-
const TextBox = styled__default["default"](Flex)(
|
|
9243
|
+
const Root$2 = styled__default["default"](Card)(_templateObject82 || (_templateObject82 = _taggedTemplateLiteral(["\n pointer-events: all;\n"])));
|
|
9244
|
+
const TextBox = styled__default["default"](Flex)(_templateObject83 || (_templateObject83 = _taggedTemplateLiteral(["\n overflow-x: auto;\n"])));
|
|
9175
9245
|
|
|
9176
9246
|
function Toast(props) {
|
|
9177
9247
|
const {
|
|
@@ -9229,8 +9299,8 @@ function Toast(props) {
|
|
|
9229
9299
|
const key$1 = Symbol.for("@sanity/ui/context/toast");
|
|
9230
9300
|
globalScope[key$1] = globalScope[key$1] || react.createContext(null);
|
|
9231
9301
|
const ToastContext = globalScope[key$1];
|
|
9232
|
-
const Root$1 = styled__default["default"](Layer)(
|
|
9233
|
-
const ToastContainer = styled__default["default"].div(
|
|
9302
|
+
const Root$1 = styled__default["default"](Layer)(_templateObject84 || (_templateObject84 = _taggedTemplateLiteral(["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n"])));
|
|
9303
|
+
const ToastContainer = styled__default["default"].div(_templateObject85 || (_templateObject85 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n position: absolute;\n right: 0;\n bottom: 0;\n max-width: 420px;\n width: 100%;\n"])));
|
|
9234
9304
|
let toastId = 0;
|
|
9235
9305
|
|
|
9236
9306
|
function ToastProvider(props) {
|
|
@@ -9647,7 +9717,7 @@ const Tree = react.memo(react.forwardRef(function Tree2(props, ref) {
|
|
|
9647
9717
|
Tree.displayName = "Tree";
|
|
9648
9718
|
|
|
9649
9719
|
function treeItemRootStyle() {
|
|
9650
|
-
return styled.css(
|
|
9720
|
+
return styled.css(_templateObject86 || (_templateObject86 = _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 "])));
|
|
9651
9721
|
}
|
|
9652
9722
|
|
|
9653
9723
|
function treeItemRootColorStyle(props) {
|
|
@@ -9661,7 +9731,7 @@ function treeItemRootColorStyle(props) {
|
|
|
9661
9731
|
selectable
|
|
9662
9732
|
} = theme.sanity.color;
|
|
9663
9733
|
const tone = selectable ? selectable[$tone] || selectable.default : muted[$tone] || muted.default;
|
|
9664
|
-
return styled.css(
|
|
9734
|
+
return styled.css(_templateObject87 || (_templateObject87 = _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));
|
|
9665
9735
|
}
|
|
9666
9736
|
|
|
9667
9737
|
function treeItemBoxStyle(props) {
|
|
@@ -9672,7 +9742,7 @@ function treeItemBoxStyle(props) {
|
|
|
9672
9742
|
const {
|
|
9673
9743
|
space
|
|
9674
9744
|
} = theme.sanity;
|
|
9675
|
-
return styled.css(
|
|
9745
|
+
return styled.css(_templateObject88 || (_templateObject88 = _taggedTemplateLiteral(["\n padding-left: ", ";\n\n &[data-as='a'] {\n text-decoration: none;\n }\n "])), rem(space[2] * $level));
|
|
9676
9746
|
}
|
|
9677
9747
|
|
|
9678
9748
|
function useTree() {
|
|
@@ -9708,7 +9778,7 @@ const Root = react.memo(styled__default["default"].li(treeItemRootStyle, treeIte
|
|
|
9708
9778
|
const TreeItemBox = styled__default["default"](Box).attrs({
|
|
9709
9779
|
forwardedAs: "a"
|
|
9710
9780
|
})(treeItemBoxStyle);
|
|
9711
|
-
const ToggleArrowText = styled__default["default"](Text)(
|
|
9781
|
+
const ToggleArrowText = styled__default["default"](Text)(_templateObject89 || (_templateObject89 = _taggedTemplateLiteral(["\n & > svg {\n transition: transform 100ms;\n }\n"])));
|
|
9712
9782
|
const TreeItem = react.memo(function TreeItem2(props) {
|
|
9713
9783
|
const {
|
|
9714
9784
|
children,
|