@sanity/ui 1.0.0-beta.30 → 1.0.0-beta.32
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 +163 -95
- package/dist/sanity-ui.esm.js.map +1 -1
- package/dist/sanity-ui.js +162 -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 +39 -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,13 @@ 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
|
|
6247
6329
|
};
|
|
6248
6330
|
}
|
|
6249
6331
|
|
|
@@ -6267,8 +6349,9 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
6267
6349
|
scheme,
|
|
6268
6350
|
shadow,
|
|
6269
6351
|
strategy,
|
|
6352
|
+
style,
|
|
6270
6353
|
tone,
|
|
6271
|
-
width,
|
|
6354
|
+
width = "auto",
|
|
6272
6355
|
x: xProp,
|
|
6273
6356
|
y: yProp
|
|
6274
6357
|
} = props,
|
|
@@ -6277,33 +6360,29 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
6277
6360
|
const {
|
|
6278
6361
|
zIndex
|
|
6279
6362
|
} = useLayer();
|
|
6280
|
-
const margins = react.useMemo(() => marginsProp ||
|
|
6363
|
+
const margins = react.useMemo(() => marginsProp || DEFAULT_POPOVER_MARGINS, [marginsProp]);
|
|
6281
6364
|
const referenceWidth = referenceWidthProp ? referenceWidthProp - margins[1] - margins[3] : void 0;
|
|
6282
6365
|
const x = (xProp != null ? xProp : 0) + margins[3];
|
|
6283
6366
|
const y = (yProp != null ? yProp : 0) + margins[0];
|
|
6284
|
-
const
|
|
6285
|
-
const rootStyle = react.useMemo(() => ({
|
|
6367
|
+
const rootStyle = react.useMemo(() => _objectSpread({
|
|
6286
6368
|
position: strategy,
|
|
6287
6369
|
top: y,
|
|
6288
6370
|
left: x,
|
|
6289
6371
|
zIndex,
|
|
6290
6372
|
width: referenceWidth,
|
|
6291
|
-
maxWidth:
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
minHeight: 25,
|
|
6295
|
-
maxHeight: availableHeight ? availableHeight - 8 : void 0
|
|
6296
|
-
}), [availableHeight]);
|
|
6373
|
+
maxWidth: availableWidth,
|
|
6374
|
+
maxHeight: availableHeight
|
|
6375
|
+
}, style), [availableHeight, availableWidth, referenceWidth, strategy, style, x, y, zIndex]);
|
|
6297
6376
|
const staticSide = placement && FLOATING_STATIC_SIDES[placement.split("-")[0]];
|
|
6298
6377
|
const arrowStyle = react.useMemo(() => {
|
|
6299
|
-
const
|
|
6378
|
+
const style2 = {
|
|
6300
6379
|
left: arrowX !== null ? arrowX : void 0,
|
|
6301
6380
|
top: arrowY !== null ? arrowY : void 0,
|
|
6302
6381
|
right: void 0,
|
|
6303
6382
|
bottom: void 0
|
|
6304
6383
|
};
|
|
6305
|
-
if (staticSide)
|
|
6306
|
-
return
|
|
6384
|
+
if (staticSide) style2[staticSide] = 0 - DEFAULT_POPOVER_ARROW_WIDTH;
|
|
6385
|
+
return style2;
|
|
6307
6386
|
}, [arrowX, arrowY, staticSide]);
|
|
6308
6387
|
return /* @__PURE__ */jsxRuntime.jsxs(Root$i, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
6309
6388
|
$boundaryWidth: boundaryWidth,
|
|
@@ -6315,13 +6394,13 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
6315
6394
|
shadow,
|
|
6316
6395
|
style: rootStyle,
|
|
6317
6396
|
tone,
|
|
6318
|
-
|
|
6319
|
-
children: [/* @__PURE__ */jsxRuntime.jsx(Box, {
|
|
6397
|
+
children: [/* @__PURE__ */jsxRuntime.jsx(Container, {
|
|
6320
6398
|
"data-ui": "Popover__wrapper",
|
|
6399
|
+
flex: 1,
|
|
6321
6400
|
overflow,
|
|
6322
6401
|
padding,
|
|
6323
6402
|
sizing: "border",
|
|
6324
|
-
|
|
6403
|
+
width,
|
|
6325
6404
|
children
|
|
6326
6405
|
}), arrow && /* @__PURE__ */jsxRuntime.jsx(PopoverArrow, {
|
|
6327
6406
|
ref: arrowRef,
|
|
@@ -6330,33 +6409,14 @@ const PopoverCard = react.memo(react.forwardRef(function PopoverCard2(props, ref
|
|
|
6330
6409
|
}));
|
|
6331
6410
|
}));
|
|
6332
6411
|
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
6412
|
const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
6352
|
-
var _a, _b, _c, _d;
|
|
6413
|
+
var _a, _b, _c, _d, _e;
|
|
6353
6414
|
|
|
6354
6415
|
const theme = useTheme();
|
|
6355
6416
|
const boundaryElementContext = useBoundaryElement();
|
|
6356
6417
|
|
|
6357
6418
|
const {
|
|
6358
6419
|
__unstable_margins: margins,
|
|
6359
|
-
allowedAutoPlacements,
|
|
6360
6420
|
arrow: arrowProp = true,
|
|
6361
6421
|
boundaryElement = boundaryElementContext.element,
|
|
6362
6422
|
children: childProp,
|
|
@@ -6366,7 +6426,7 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6366
6426
|
fallbackPlacements,
|
|
6367
6427
|
matchReferenceWidth: matchReferenceWidthProp,
|
|
6368
6428
|
open,
|
|
6369
|
-
overflow = props.constrainSize ? "auto" :
|
|
6429
|
+
overflow = props.constrainSize ? "auto" : "hidden",
|
|
6370
6430
|
padding: paddingProp,
|
|
6371
6431
|
placement: placementProp = "bottom",
|
|
6372
6432
|
portal,
|
|
@@ -6375,10 +6435,8 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6375
6435
|
referenceElement,
|
|
6376
6436
|
scheme,
|
|
6377
6437
|
shadow: shadowProp = 3,
|
|
6378
|
-
tether,
|
|
6379
|
-
tetherOffset,
|
|
6380
6438
|
tone = "inherit",
|
|
6381
|
-
width: widthProp =
|
|
6439
|
+
width: widthProp = "auto",
|
|
6382
6440
|
zOffset: zOffsetProp = (_a = theme.sanity.layer) == null ? void 0 : _a.popover.zOffset
|
|
6383
6441
|
} = props,
|
|
6384
6442
|
restProps = _objectWithoutProperties(props, _excluded23);
|
|
@@ -6402,38 +6460,47 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6402
6460
|
ret.push(reactDom$1.flip({
|
|
6403
6461
|
boundary: boundaryElement || void 0,
|
|
6404
6462
|
fallbackPlacements,
|
|
6405
|
-
padding:
|
|
6463
|
+
padding: DEFAULT_POPOVER_PADDING,
|
|
6406
6464
|
rootBoundary
|
|
6407
6465
|
}));
|
|
6408
6466
|
}
|
|
6409
6467
|
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6468
|
+
if (constrainSize || matchReferenceWidthProp) {
|
|
6469
|
+
ret.push(size({
|
|
6470
|
+
boundaryElement,
|
|
6471
|
+
constrainSize,
|
|
6472
|
+
matchReferenceWidth: matchReferenceWidthProp,
|
|
6473
|
+
padding: DEFAULT_POPOVER_PADDING,
|
|
6474
|
+
setAvailableHeight,
|
|
6475
|
+
setAvailableWidth,
|
|
6476
|
+
setReferenceWidth
|
|
6477
|
+
}));
|
|
6478
|
+
}
|
|
6479
|
+
|
|
6418
6480
|
ret.push(reactDom$1.offset({
|
|
6419
|
-
mainAxis: arrowProp ?
|
|
6481
|
+
mainAxis: arrowProp ? DEFAULT_POPOVER_DISTANCE : 0
|
|
6420
6482
|
}));
|
|
6421
6483
|
|
|
6422
6484
|
if (preventOverflow) {
|
|
6423
6485
|
ret.push(reactDom$1.shift({
|
|
6424
6486
|
boundary: boundaryElement || void 0,
|
|
6425
6487
|
rootBoundary,
|
|
6426
|
-
padding:
|
|
6488
|
+
padding: DEFAULT_POPOVER_PADDING
|
|
6427
6489
|
}));
|
|
6428
6490
|
}
|
|
6429
6491
|
|
|
6430
6492
|
if (arrowProp) {
|
|
6431
6493
|
ret.push(reactDom$1.arrow({
|
|
6432
6494
|
element: arrowRef,
|
|
6433
|
-
padding:
|
|
6495
|
+
padding: DEFAULT_POPOVER_PADDING
|
|
6434
6496
|
}));
|
|
6435
6497
|
}
|
|
6436
6498
|
|
|
6499
|
+
ret.push(reactDom$1.hide({
|
|
6500
|
+
boundary: boundaryElement || void 0,
|
|
6501
|
+
padding: DEFAULT_POPOVER_PADDING,
|
|
6502
|
+
strategy: "referenceHidden"
|
|
6503
|
+
}));
|
|
6437
6504
|
return ret;
|
|
6438
6505
|
}, [arrowProp, boundaryElement, constrainSize, fallbackPlacements, matchReferenceWidthProp, preventOverflow]);
|
|
6439
6506
|
const {
|
|
@@ -6449,8 +6516,9 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6449
6516
|
placement: placementProp,
|
|
6450
6517
|
whileElementsMounted: reactDom$1.autoUpdate
|
|
6451
6518
|
});
|
|
6452
|
-
const
|
|
6453
|
-
const
|
|
6519
|
+
const referenceHidden = (_c = middlewareData.hide) == null ? void 0 : _c.referenceHidden;
|
|
6520
|
+
const arrowX = (_d = middlewareData.arrow) == null ? void 0 : _d.x;
|
|
6521
|
+
const arrowY = (_e = middlewareData.arrow) == null ? void 0 : _e.y;
|
|
6454
6522
|
const setArrow = react.useCallback(arrowEl => {
|
|
6455
6523
|
arrowRef.current = arrowEl;
|
|
6456
6524
|
}, []);
|
|
@@ -6492,7 +6560,8 @@ const Popover = react.memo(react.forwardRef(function Popover2(props, ref) {
|
|
|
6492
6560
|
arrowY,
|
|
6493
6561
|
availableWidth: constrainSize ? availableWidth : void 0,
|
|
6494
6562
|
availableHeight: constrainSize ? availableHeight : void 0,
|
|
6495
|
-
boundaryWidth: boundarySize == null ? void 0 : boundarySize.width,
|
|
6563
|
+
boundaryWidth: preventOverflow ? boundarySize == null ? void 0 : boundarySize.width : void 0,
|
|
6564
|
+
hidden: referenceHidden,
|
|
6496
6565
|
overflow,
|
|
6497
6566
|
padding,
|
|
6498
6567
|
placement,
|
|
@@ -7236,9 +7305,8 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
7236
7305
|
});
|
|
7237
7306
|
const Root$9 = styled__default["default"].div(_templateObject60 || (_templateObject60 = _taggedTemplateLiteral(["\n line-height: 0;\n"])));
|
|
7238
7307
|
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);
|
|
7308
|
+
const rotate = styled.keyframes(_templateObject62 || (_templateObject62 = _taggedTemplateLiteral(["\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n"])));
|
|
7309
|
+
const AnimatedSpinnerIcon = styled__default["default"](icons.SpinnerIcon)(_templateObject63 || (_templateObject63 = _taggedTemplateLiteral(["\n animation: ", " 500ms linear infinite;\n"])), rotate);
|
|
7242
7310
|
|
|
7243
7311
|
function AutocompleteOption(props) {
|
|
7244
7312
|
const {
|
|
@@ -7770,7 +7838,7 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
|
|
|
7770
7838
|
return null;
|
|
7771
7839
|
}
|
|
7772
7840
|
|
|
7773
|
-
return /* @__PURE__ */jsxRuntime.jsx(
|
|
7841
|
+
return /* @__PURE__ */jsxRuntime.jsx(Popover, _objectSpread({
|
|
7774
7842
|
__unstable_margins: AUTOCOMPLETE_POPOVER_MARGINS,
|
|
7775
7843
|
arrow: false,
|
|
7776
7844
|
constrainSize: true,
|
|
@@ -7797,8 +7865,8 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
|
|
|
7797
7865
|
});
|
|
7798
7866
|
});
|
|
7799
7867
|
const Autocomplete = InnerAutocomplete;
|
|
7800
|
-
const Root$8 = styled__default["default"].ol(
|
|
7801
|
-
const ExpandButton = styled__default["default"](Button)(
|
|
7868
|
+
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"])));
|
|
7869
|
+
const ExpandButton = styled__default["default"](Button)(_templateObject65 || (_templateObject65 = _taggedTemplateLiteral(["\n appearance: none;\n margin: -4px;\n"])));
|
|
7802
7870
|
const Breadcrumbs = react.forwardRef(function Breadcrumbs2(props, ref) {
|
|
7803
7871
|
const {
|
|
7804
7872
|
children,
|
|
@@ -7917,12 +7985,12 @@ function useDialog() {
|
|
|
7917
7985
|
}
|
|
7918
7986
|
|
|
7919
7987
|
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)(
|
|
7988
|
+
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"])));
|
|
7989
|
+
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"])));
|
|
7990
|
+
const DialogLayout = styled__default["default"](Flex)(_templateObject68 || (_templateObject68 = _taggedTemplateLiteral(["\n flex: 1;\n min-height: 0;\n width: 100%;\n"])));
|
|
7991
|
+
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"])));
|
|
7992
|
+
const DialogContent = styled__default["default"](Box)(_templateObject70 || (_templateObject70 = _taggedTemplateLiteral(["\n position: relative;\n z-index: 1;\n overflow: auto;\n outline: none;\n"])));
|
|
7993
|
+
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
7994
|
const DialogCard = react.forwardRef(function DialogCard2(props, ref) {
|
|
7927
7995
|
const {
|
|
7928
7996
|
__unstable_autoFocus: autoFocus,
|
|
@@ -8134,8 +8202,8 @@ function DialogProvider(props) {
|
|
|
8134
8202
|
});
|
|
8135
8203
|
}
|
|
8136
8204
|
|
|
8137
|
-
const Root$6 = styled__default["default"].kbd(
|
|
8138
|
-
const Key = styled__default["default"](KBD)(
|
|
8205
|
+
const Root$6 = styled__default["default"].kbd(_templateObject72 || (_templateObject72 = _taggedTemplateLiteral(["\n &:not([hidden]) {\n display: block;\n }\n font: inherit;\n"])));
|
|
8206
|
+
const Key = styled__default["default"](KBD)(_templateObject73 || (_templateObject73 = _taggedTemplateLiteral(["\n &:not([hidden]) {\n display: block;\n }\n"])));
|
|
8139
8207
|
const Hotkeys = react.forwardRef(function Hotkeys2(props, ref) {
|
|
8140
8208
|
const {
|
|
8141
8209
|
fontSize,
|
|
@@ -8406,7 +8474,7 @@ function useMenuController(props) {
|
|
|
8406
8474
|
};
|
|
8407
8475
|
}
|
|
8408
8476
|
|
|
8409
|
-
const Root$5 = styled__default["default"](Box)(
|
|
8477
|
+
const Root$5 = styled__default["default"](Box)(_templateObject74 || (_templateObject74 = _taggedTemplateLiteral(["\n outline: none;\n overflow: auto;\n"])));
|
|
8410
8478
|
const Menu = react.forwardRef(function Menu2(props, ref) {
|
|
8411
8479
|
const {
|
|
8412
8480
|
children,
|
|
@@ -8640,10 +8708,10 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
|
|
|
8640
8708
|
children: button || /* @__PURE__ */jsxRuntime.jsx(jsxRuntime.Fragment, {})
|
|
8641
8709
|
}));
|
|
8642
8710
|
});
|
|
8643
|
-
const MenuDivider = styled__default["default"].hr(
|
|
8711
|
+
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
8712
|
|
|
8645
8713
|
function selectableBaseStyle() {
|
|
8646
|
-
return styled.css(
|
|
8714
|
+
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
8715
|
}
|
|
8648
8716
|
|
|
8649
8717
|
function selectableColorStyle(props) {
|
|
@@ -8659,7 +8727,7 @@ function selectableColorStyle(props) {
|
|
|
8659
8727
|
selectable
|
|
8660
8728
|
} = theme.sanity.color;
|
|
8661
8729
|
const tone = selectable ? selectable[$tone] || selectable.default : muted[$tone] || muted.default;
|
|
8662
|
-
return styled.css(
|
|
8730
|
+
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
8731
|
}
|
|
8664
8732
|
|
|
8665
8733
|
const Selectable = styled__default["default"](Box)(responsiveRadiusStyle, selectableBaseStyle, selectableColorStyle);
|
|
@@ -8931,9 +8999,9 @@ const MenuItem = react.forwardRef(function MenuItem2(props, forwardedRef) {
|
|
|
8931
8999
|
}))]
|
|
8932
9000
|
}));
|
|
8933
9001
|
});
|
|
8934
|
-
const keyframe = styled.keyframes(
|
|
8935
|
-
const animation = styled.css(
|
|
8936
|
-
const skeletonStyle = styled.css(
|
|
9002
|
+
const keyframe = styled.keyframes(_templateObject78 || (_templateObject78 = _taggedTemplateLiteral(["\n 0% {\n background-position: 100%;\n }\n 100% {\n background-position: -100%;\n }\n"])));
|
|
9003
|
+
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);
|
|
9004
|
+
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
9005
|
let {
|
|
8938
9006
|
$visible
|
|
8939
9007
|
} = _ref23;
|
|
@@ -8942,7 +9010,7 @@ const skeletonStyle = styled.css(_templateObject81 || (_templateObject81 = _tagg
|
|
|
8942
9010
|
let {
|
|
8943
9011
|
$animated
|
|
8944
9012
|
} = _ref24;
|
|
8945
|
-
return $animated ? animation : styled.css(
|
|
9013
|
+
return $animated ? animation : styled.css(_templateObject81 || (_templateObject81 = _taggedTemplateLiteral(["\n background-color: var(--card-skeleton-color-from);\n "])));
|
|
8946
9014
|
});
|
|
8947
9015
|
const Root$4 = styled__default["default"](Box)(responsiveRadiusStyle, skeletonStyle);
|
|
8948
9016
|
const Skeleton = react.forwardRef(function Skeleton2(props, ref) {
|
|
@@ -9170,8 +9238,8 @@ const ROLES = {
|
|
|
9170
9238
|
success: "alert",
|
|
9171
9239
|
info: "alert"
|
|
9172
9240
|
};
|
|
9173
|
-
const Root$2 = styled__default["default"](Card)(
|
|
9174
|
-
const TextBox = styled__default["default"](Flex)(
|
|
9241
|
+
const Root$2 = styled__default["default"](Card)(_templateObject82 || (_templateObject82 = _taggedTemplateLiteral(["\n pointer-events: all;\n"])));
|
|
9242
|
+
const TextBox = styled__default["default"](Flex)(_templateObject83 || (_templateObject83 = _taggedTemplateLiteral(["\n overflow-x: auto;\n"])));
|
|
9175
9243
|
|
|
9176
9244
|
function Toast(props) {
|
|
9177
9245
|
const {
|
|
@@ -9229,8 +9297,8 @@ function Toast(props) {
|
|
|
9229
9297
|
const key$1 = Symbol.for("@sanity/ui/context/toast");
|
|
9230
9298
|
globalScope[key$1] = globalScope[key$1] || react.createContext(null);
|
|
9231
9299
|
const ToastContext = globalScope[key$1];
|
|
9232
|
-
const Root$1 = styled__default["default"](Layer)(
|
|
9233
|
-
const ToastContainer = styled__default["default"].div(
|
|
9300
|
+
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"])));
|
|
9301
|
+
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
9302
|
let toastId = 0;
|
|
9235
9303
|
|
|
9236
9304
|
function ToastProvider(props) {
|
|
@@ -9647,7 +9715,7 @@ const Tree = react.memo(react.forwardRef(function Tree2(props, ref) {
|
|
|
9647
9715
|
Tree.displayName = "Tree";
|
|
9648
9716
|
|
|
9649
9717
|
function treeItemRootStyle() {
|
|
9650
|
-
return styled.css(
|
|
9718
|
+
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
9719
|
}
|
|
9652
9720
|
|
|
9653
9721
|
function treeItemRootColorStyle(props) {
|
|
@@ -9661,7 +9729,7 @@ function treeItemRootColorStyle(props) {
|
|
|
9661
9729
|
selectable
|
|
9662
9730
|
} = theme.sanity.color;
|
|
9663
9731
|
const tone = selectable ? selectable[$tone] || selectable.default : muted[$tone] || muted.default;
|
|
9664
|
-
return styled.css(
|
|
9732
|
+
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
9733
|
}
|
|
9666
9734
|
|
|
9667
9735
|
function treeItemBoxStyle(props) {
|
|
@@ -9672,7 +9740,7 @@ function treeItemBoxStyle(props) {
|
|
|
9672
9740
|
const {
|
|
9673
9741
|
space
|
|
9674
9742
|
} = theme.sanity;
|
|
9675
|
-
return styled.css(
|
|
9743
|
+
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
9744
|
}
|
|
9677
9745
|
|
|
9678
9746
|
function useTree() {
|
|
@@ -9708,7 +9776,7 @@ const Root = react.memo(styled__default["default"].li(treeItemRootStyle, treeIte
|
|
|
9708
9776
|
const TreeItemBox = styled__default["default"](Box).attrs({
|
|
9709
9777
|
forwardedAs: "a"
|
|
9710
9778
|
})(treeItemBoxStyle);
|
|
9711
|
-
const ToggleArrowText = styled__default["default"](Text)(
|
|
9779
|
+
const ToggleArrowText = styled__default["default"](Text)(_templateObject89 || (_templateObject89 = _taggedTemplateLiteral(["\n & > svg {\n transition: transform 100ms;\n }\n"])));
|
|
9712
9780
|
const TreeItem = react.memo(function TreeItem2(props) {
|
|
9713
9781
|
const {
|
|
9714
9782
|
children,
|