@sanity/ui 2.0.4 → 2.0.5
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.esm.js +1636 -397
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1636 -397
- package/dist/index.js.map +1 -1
- package/dist/theme.esm.js +27 -29
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +27 -29
- package/dist/theme.js.map +1 -1
- package/package.json +21 -21
package/dist/index.js
CHANGED
|
@@ -63,14 +63,14 @@ function _fillCSSObject(keys, value) {
|
|
|
63
63
|
function rem(pixelValue) {
|
|
64
64
|
if (pixelValue === 0)
|
|
65
65
|
return 0;
|
|
66
|
-
return
|
|
66
|
+
return `${pixelValue / 16}rem`;
|
|
67
67
|
}
|
|
68
68
|
function _responsive(media, values, callback) {
|
|
69
69
|
const statements = (values == null ? void 0 : values.map(callback)) || [];
|
|
70
70
|
return statements.map((statement, mediaIndex) => {
|
|
71
71
|
if (mediaIndex === 0)
|
|
72
72
|
return statement;
|
|
73
|
-
return { [
|
|
73
|
+
return { [`@media screen and (min-width: ${media[mediaIndex - 1]}px)`]: statement };
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
function _getArrayProp(val, defaultVal) {
|
|
@@ -141,21 +141,21 @@ function fontSize(size) {
|
|
|
141
141
|
const customIconOffset = (capHeight - customIconSize) / 2;
|
|
142
142
|
return {
|
|
143
143
|
fontSize: rem(fontSize2),
|
|
144
|
-
lineHeight:
|
|
144
|
+
lineHeight: `calc(${lineHeight} / ${fontSize2})`,
|
|
145
145
|
letterSpacing: rem(letterSpacing),
|
|
146
|
-
transform:
|
|
146
|
+
transform: `translateY(${rem(descenderHeight)})`,
|
|
147
147
|
"&:before": {
|
|
148
|
-
marginTop:
|
|
148
|
+
marginTop: `calc(${rem(0 - negHeight)} - 1px)`
|
|
149
149
|
},
|
|
150
150
|
"&:after": {
|
|
151
151
|
marginBottom: "-1px"
|
|
152
152
|
},
|
|
153
153
|
"& svg:not([data-sanity-icon])": {
|
|
154
|
-
fontSize:
|
|
154
|
+
fontSize: `calc(${customIconSize} / 16 * 1rem)`,
|
|
155
155
|
margin: rem(customIconOffset)
|
|
156
156
|
},
|
|
157
157
|
"& [data-sanity-icon]": {
|
|
158
|
-
fontSize:
|
|
158
|
+
fontSize: `calc(${iconSize} / 16 * 1rem)`,
|
|
159
159
|
margin: rem(iconOffset)
|
|
160
160
|
}
|
|
161
161
|
};
|
|
@@ -185,7 +185,7 @@ function responsiveTextFont(props) {
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
function useArrayProp(val, defaultVal) {
|
|
188
|
-
const __perf_hash__ = react.useMemo(() => JSON.stringify(val
|
|
188
|
+
const __perf_hash__ = react.useMemo(() => JSON.stringify(val ?? defaultVal), [defaultVal, val]);
|
|
189
189
|
return react.useMemo(
|
|
190
190
|
() => _getArrayProp(val, defaultVal),
|
|
191
191
|
// Improve performance: Keep object identify for a given hash of the value
|
|
@@ -907,12 +907,12 @@ function useTheme_v2() {
|
|
|
907
907
|
const MEDIA_STORE_CACHE = /* @__PURE__ */ new WeakMap();
|
|
908
908
|
function _getMediaQuery(media, index) {
|
|
909
909
|
if (index === 0) {
|
|
910
|
-
return
|
|
910
|
+
return `screen and (max-width: ${media[index] - 1}px)`;
|
|
911
911
|
}
|
|
912
912
|
if (index === media.length) {
|
|
913
|
-
return
|
|
913
|
+
return `screen and (min-width: ${media[index - 1]}px)`;
|
|
914
914
|
}
|
|
915
|
-
return
|
|
915
|
+
return `screen and (min-width: ${media[index - 1]}px) and (max-width: ${media[index] - 1}px)`;
|
|
916
916
|
}
|
|
917
917
|
function _createMediaStore(media) {
|
|
918
918
|
const mediaLen = media.length;
|
|
@@ -1037,9 +1037,9 @@ function responsiveBorderStyle() {
|
|
|
1037
1037
|
return [border, borderTop, borderRight, borderBottom, borderLeft];
|
|
1038
1038
|
}
|
|
1039
1039
|
function border(props) {
|
|
1040
|
-
var _a
|
|
1040
|
+
var _a;
|
|
1041
1041
|
const { card, media } = theme.getTheme_v2(props.theme);
|
|
1042
|
-
const borderStyle =
|
|
1042
|
+
const borderStyle = `${((_a = card.border) == null ? void 0 : _a.width) ?? 1}px solid var(--card-border-color)`;
|
|
1043
1043
|
return _responsive(
|
|
1044
1044
|
media,
|
|
1045
1045
|
props.$border,
|
|
@@ -1047,9 +1047,9 @@ function border(props) {
|
|
|
1047
1047
|
);
|
|
1048
1048
|
}
|
|
1049
1049
|
function borderTop(props) {
|
|
1050
|
-
var _a
|
|
1050
|
+
var _a;
|
|
1051
1051
|
const { card, media } = theme.getTheme_v2(props.theme);
|
|
1052
|
-
const borderStyle =
|
|
1052
|
+
const borderStyle = `${((_a = card.border) == null ? void 0 : _a.width) ?? 1}px solid var(--card-border-color)`;
|
|
1053
1053
|
return _responsive(
|
|
1054
1054
|
media,
|
|
1055
1055
|
props.$borderTop,
|
|
@@ -1057,9 +1057,9 @@ function borderTop(props) {
|
|
|
1057
1057
|
);
|
|
1058
1058
|
}
|
|
1059
1059
|
function borderRight(props) {
|
|
1060
|
-
var _a
|
|
1060
|
+
var _a;
|
|
1061
1061
|
const { card, media } = theme.getTheme_v2(props.theme);
|
|
1062
|
-
const borderStyle =
|
|
1062
|
+
const borderStyle = `${((_a = card.border) == null ? void 0 : _a.width) ?? 1}px solid var(--card-border-color)`;
|
|
1063
1063
|
return _responsive(
|
|
1064
1064
|
media,
|
|
1065
1065
|
props.$borderRight,
|
|
@@ -1067,9 +1067,9 @@ function borderRight(props) {
|
|
|
1067
1067
|
);
|
|
1068
1068
|
}
|
|
1069
1069
|
function borderBottom(props) {
|
|
1070
|
-
var _a
|
|
1070
|
+
var _a;
|
|
1071
1071
|
const { card, media } = theme.getTheme_v2(props.theme);
|
|
1072
|
-
const borderStyle =
|
|
1072
|
+
const borderStyle = `${((_a = card.border) == null ? void 0 : _a.width) ?? 1}px solid var(--card-border-color)`;
|
|
1073
1073
|
return _responsive(
|
|
1074
1074
|
media,
|
|
1075
1075
|
props.$borderBottom,
|
|
@@ -1077,9 +1077,9 @@ function borderBottom(props) {
|
|
|
1077
1077
|
);
|
|
1078
1078
|
}
|
|
1079
1079
|
function borderLeft(props) {
|
|
1080
|
-
var _a
|
|
1080
|
+
var _a;
|
|
1081
1081
|
const { card, media } = theme.getTheme_v2(props.theme);
|
|
1082
|
-
const borderStyle =
|
|
1082
|
+
const borderStyle = `${((_a = card.border) == null ? void 0 : _a.width) ?? 1}px solid var(--card-border-color)`;
|
|
1083
1083
|
return _responsive(
|
|
1084
1084
|
media,
|
|
1085
1085
|
props.$borderLeft,
|
|
@@ -1197,7 +1197,7 @@ function responsiveFlexItemStyle(props) {
|
|
|
1197
1197
|
}
|
|
1198
1198
|
|
|
1199
1199
|
function focusRingBorderStyle(border) {
|
|
1200
|
-
return
|
|
1200
|
+
return `inset 0 0 0 ${border.width}px ${border.color}`;
|
|
1201
1201
|
}
|
|
1202
1202
|
function focusRingStyle(opts) {
|
|
1203
1203
|
const { base, border, focusRing } = opts;
|
|
@@ -1205,10 +1205,10 @@ function focusRingStyle(opts) {
|
|
|
1205
1205
|
const focusRingInsetWidth = 0 - focusRing.offset;
|
|
1206
1206
|
const bgColor = base ? base.bg : "var(--card-bg-color)";
|
|
1207
1207
|
return [
|
|
1208
|
-
focusRingInsetWidth > 0 &&
|
|
1208
|
+
focusRingInsetWidth > 0 && `inset 0 0 0 ${focusRingInsetWidth}px var(--card-focus-ring-color)`,
|
|
1209
1209
|
border && focusRingBorderStyle(border),
|
|
1210
|
-
focusRingInsetWidth < 0 &&
|
|
1211
|
-
focusRingOutsetWidth > 0 &&
|
|
1210
|
+
focusRingInsetWidth < 0 && `0 0 0 ${0 - focusRingInsetWidth}px ${bgColor}`,
|
|
1211
|
+
focusRingOutsetWidth > 0 && `0 0 0 ${focusRingOutsetWidth}px var(--card-focus-ring-color)`
|
|
1212
1212
|
].filter(Boolean).join(",");
|
|
1213
1213
|
}
|
|
1214
1214
|
|
|
@@ -1266,13 +1266,13 @@ function responsiveGridAutoColsStyle(props) {
|
|
|
1266
1266
|
function responsiveGridColumnsStyle(props) {
|
|
1267
1267
|
const { media } = theme.getTheme_v2(props.theme);
|
|
1268
1268
|
return _responsive(media, props.$columns, (columns) => ({
|
|
1269
|
-
gridTemplateColumns: columns &&
|
|
1269
|
+
gridTemplateColumns: columns && `repeat(${columns},minmax(0,1fr));`
|
|
1270
1270
|
}));
|
|
1271
1271
|
}
|
|
1272
1272
|
function responsiveGridRowsStyle(props) {
|
|
1273
1273
|
const { media } = theme.getTheme_v2(props.theme);
|
|
1274
1274
|
return _responsive(media, props.$rows, (rows) => ({
|
|
1275
|
-
gridTemplateRows: rows &&
|
|
1275
|
+
gridTemplateRows: rows && `repeat(${rows},minmax(0,1fr));`
|
|
1276
1276
|
}));
|
|
1277
1277
|
}
|
|
1278
1278
|
function responsiveGridGapStyle(props) {
|
|
@@ -1316,7 +1316,7 @@ function responsiveGridItemRowStyle(props) {
|
|
|
1316
1316
|
const { media } = theme.getTheme_v2(props.theme);
|
|
1317
1317
|
return _responsive(media, props.$row, (row) => {
|
|
1318
1318
|
if (typeof row === "number") {
|
|
1319
|
-
return { gridRow:
|
|
1319
|
+
return { gridRow: `span ${row} / span ${row}` };
|
|
1320
1320
|
}
|
|
1321
1321
|
return { gridRow: GRID_ITEM_ROW[row] };
|
|
1322
1322
|
});
|
|
@@ -1335,7 +1335,7 @@ function responsiveGridItemColumnStyle(props) {
|
|
|
1335
1335
|
const { media } = theme.getTheme_v2(props.theme);
|
|
1336
1336
|
return _responsive(media, props.$column, (column) => {
|
|
1337
1337
|
if (typeof column === "number") {
|
|
1338
|
-
return { gridColumn:
|
|
1338
|
+
return { gridColumn: `span ${column} / span ${column}` };
|
|
1339
1339
|
}
|
|
1340
1340
|
return { gridColumn: GRID_ITEM_COLUMN[column] };
|
|
1341
1341
|
});
|
|
@@ -1387,18 +1387,84 @@ function responsiveInputPaddingIconRightStyle(props) {
|
|
|
1387
1387
|
return responsiveInputPaddingStyle({ ...props, $iconRight: true });
|
|
1388
1388
|
}
|
|
1389
1389
|
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1390
|
+
const ROOT_STYLE = styled.css`
|
|
1391
|
+
&:not([hidden]) {
|
|
1392
|
+
display: flex;
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
align-items: center;
|
|
1396
|
+
`;
|
|
1395
1397
|
function textInputRootStyle() {
|
|
1396
1398
|
return ROOT_STYLE;
|
|
1397
1399
|
}
|
|
1398
1400
|
function textInputBaseStyle(props) {
|
|
1399
1401
|
const { $scheme, $tone, $weight } = props;
|
|
1400
1402
|
const { color, font } = theme.getTheme_v2(props.theme);
|
|
1401
|
-
return styled.css
|
|
1403
|
+
return styled.css`
|
|
1404
|
+
appearance: none;
|
|
1405
|
+
background: none;
|
|
1406
|
+
border: 0;
|
|
1407
|
+
border-radius: 0;
|
|
1408
|
+
outline: none;
|
|
1409
|
+
width: 100%;
|
|
1410
|
+
box-sizing: border-box;
|
|
1411
|
+
font-family: ${font.text.family};
|
|
1412
|
+
font-weight: ${$weight && font.text.weights[$weight] || font.text.weights.regular};
|
|
1413
|
+
margin: 0;
|
|
1414
|
+
position: relative;
|
|
1415
|
+
z-index: 1;
|
|
1416
|
+
display: block;
|
|
1417
|
+
|
|
1418
|
+
/* NOTE: This is a hack to disable Chrome’s autofill styles */
|
|
1419
|
+
&:-webkit-autofill,
|
|
1420
|
+
&:-webkit-autofill:hover,
|
|
1421
|
+
&:-webkit-autofill:focus,
|
|
1422
|
+
&:-webkit-autofill:active {
|
|
1423
|
+
-webkit-text-fill-color: var(--input-fg-color) !important;
|
|
1424
|
+
transition: background-color 5000s;
|
|
1425
|
+
transition-delay: 86400s /* 24h */;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
/* &:is(textarea) */
|
|
1429
|
+
&[data-as='textarea'] {
|
|
1430
|
+
resize: none;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
color: var(--input-fg-color);
|
|
1434
|
+
|
|
1435
|
+
&::placeholder {
|
|
1436
|
+
color: var(--input-placeholder-color);
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
&[data-scheme='${$scheme}'][data-tone='${$tone}'] {
|
|
1440
|
+
--input-fg-color: ${color.input.default.enabled.fg};
|
|
1441
|
+
--input-placeholder-color: ${color.input.default.enabled.placeholder};
|
|
1442
|
+
|
|
1443
|
+
/* enabled */
|
|
1444
|
+
&:not(:invalid):not(:disabled):not(:read-only) {
|
|
1445
|
+
--input-fg-color: ${color.input.default.enabled.fg};
|
|
1446
|
+
--input-placeholder-color: ${color.input.default.enabled.placeholder};
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
/* disabled */
|
|
1450
|
+
&:not(:invalid):disabled {
|
|
1451
|
+
--input-fg-color: ${color.input.default.disabled.fg};
|
|
1452
|
+
--input-placeholder-color: ${color.input.default.disabled.placeholder};
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
/* invalid */
|
|
1456
|
+
&:invalid {
|
|
1457
|
+
--input-fg-color: ${color.input.invalid.enabled.fg};
|
|
1458
|
+
--input-placeholder-color: ${color.input.invalid.enabled.placeholder};
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
/* readOnly */
|
|
1462
|
+
&:read-only {
|
|
1463
|
+
--input-fg-color: ${color.input.default.readOnly.fg};
|
|
1464
|
+
--input-placeholder-color: ${color.input.default.readOnly.placeholder};
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
`;
|
|
1402
1468
|
}
|
|
1403
1469
|
function textInputFontSizeStyle(props) {
|
|
1404
1470
|
const { font, media } = theme.getTheme_v2(props.theme);
|
|
@@ -1413,28 +1479,131 @@ function textInputFontSizeStyle(props) {
|
|
|
1413
1479
|
function textInputRepresentationStyle(props) {
|
|
1414
1480
|
const { $hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing } = props;
|
|
1415
1481
|
const { color, input } = theme.getTheme_v2(props.theme);
|
|
1416
|
-
return styled.css
|
|
1482
|
+
return styled.css`
|
|
1483
|
+
--input-box-shadow: none;
|
|
1484
|
+
|
|
1485
|
+
position: absolute;
|
|
1486
|
+
top: 0;
|
|
1487
|
+
left: 0;
|
|
1488
|
+
right: 0;
|
|
1489
|
+
bottom: 0;
|
|
1490
|
+
display: block;
|
|
1491
|
+
pointer-events: none;
|
|
1492
|
+
z-index: 0;
|
|
1493
|
+
|
|
1494
|
+
background-color: var(--card-bg-color);
|
|
1495
|
+
box-shadow: var(--input-box-shadow);
|
|
1496
|
+
|
|
1497
|
+
border-top-left-radius: ${$hasPrefix ? 0 : void 0};
|
|
1498
|
+
border-bottom-left-radius: ${$hasPrefix ? 0 : void 0};
|
|
1499
|
+
border-top-right-radius: ${$hasSuffix ? 0 : void 0};
|
|
1500
|
+
border-bottom-right-radius: ${$hasSuffix ? 0 : void 0};
|
|
1501
|
+
|
|
1502
|
+
&[data-scheme='${$scheme}'][data-tone='${$tone}'] {
|
|
1503
|
+
--card-bg-color: ${color.input.default.enabled.bg};
|
|
1504
|
+
--card-fg-color: ${color.input.default.enabled.fg};
|
|
1505
|
+
|
|
1506
|
+
/* enabled */
|
|
1507
|
+
*:not(:disabled) + &[data-border] {
|
|
1508
|
+
--input-box-shadow: ${focusRingBorderStyle({
|
|
1417
1509
|
color: color.input.default.enabled.border,
|
|
1418
1510
|
width: input.border.width
|
|
1419
|
-
})
|
|
1511
|
+
})};
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
/* invalid */
|
|
1515
|
+
*:not(:disabled):invalid + & {
|
|
1516
|
+
--card-bg-color: ${color.input.invalid.enabled.bg};
|
|
1517
|
+
--card-fg-color: ${color.input.invalid.enabled.fg};
|
|
1518
|
+
|
|
1519
|
+
&[data-border] {
|
|
1520
|
+
--input-box-shadow: ${focusRingBorderStyle({
|
|
1420
1521
|
color: color.input.invalid.enabled.border,
|
|
1421
1522
|
width: input.border.width
|
|
1422
|
-
})
|
|
1523
|
+
})};
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
/* focused */
|
|
1528
|
+
*:not(:disabled):focus + & {
|
|
1529
|
+
&[data-border] {
|
|
1530
|
+
--input-box-shadow: ${$unstableDisableFocusRing ? void 0 : focusRingStyle({
|
|
1423
1531
|
border: { color: color.input.default.enabled.border, width: input.border.width },
|
|
1424
1532
|
focusRing: input.text.focusRing
|
|
1425
|
-
})
|
|
1533
|
+
})};
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
&:not([data-border]) {
|
|
1537
|
+
--input-box-shadow: ${$unstableDisableFocusRing ? void 0 : focusRingStyle({ focusRing: input.text.focusRing })};
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
/* disabled */
|
|
1542
|
+
*:not(:invalid):disabled + & {
|
|
1543
|
+
--card-bg-color: ${color.input.default.disabled.bg} !important;
|
|
1544
|
+
--card-fg-color: ${color.input.default.disabled.fg} !important;
|
|
1545
|
+
--card-icon-color: ${color.input.default.disabled.fg} !important;
|
|
1546
|
+
|
|
1547
|
+
&[data-border] {
|
|
1548
|
+
--input-box-shadow: ${focusRingBorderStyle({
|
|
1426
1549
|
color: color.input.default.disabled.border,
|
|
1427
1550
|
width: input.border.width
|
|
1428
|
-
})
|
|
1551
|
+
})};
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
*:invalid:disabled + & {
|
|
1556
|
+
--card-bg-color: ${color.input.invalid.disabled.bg} !important;
|
|
1557
|
+
--card-fg-color: ${color.input.invalid.disabled.fg} !important;
|
|
1558
|
+
--card-icon-color: ${color.input.invalid.disabled.fg} !important;
|
|
1559
|
+
|
|
1560
|
+
&[data-border] {
|
|
1561
|
+
--input-box-shadow: ${focusRingBorderStyle({
|
|
1429
1562
|
color: color.input.invalid.disabled.border,
|
|
1430
1563
|
width: input.border.width
|
|
1431
|
-
})
|
|
1564
|
+
})};
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
/* readOnly */
|
|
1569
|
+
*:not(:invalid):read-only + & {
|
|
1570
|
+
--card-bg-color: ${color.input.default.readOnly.bg} !important;
|
|
1571
|
+
--card-fg-color: ${color.input.default.readOnly.fg} !important;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
*:invalid:read-only + & {
|
|
1575
|
+
--card-bg-color: ${color.input.invalid.readOnly.bg} !important;
|
|
1576
|
+
--card-fg-color: ${color.input.invalid.readOnly.fg} !important;
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
/* hovered */
|
|
1580
|
+
@media (hover: hover) {
|
|
1581
|
+
*:not(:disabled):not(:read-only):not(:invalid):hover + & {
|
|
1582
|
+
--card-bg-color: ${color.input.default.hovered.bg};
|
|
1583
|
+
--card-fg-color: ${color.input.default.hovered.fg};
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
*:invalid:not(:disabled):not(:read-only):hover + & {
|
|
1587
|
+
--card-bg-color: ${color.input.invalid.hovered.bg};
|
|
1588
|
+
--card-fg-color: ${color.input.invalid.hovered.fg};
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
*:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {
|
|
1592
|
+
--input-box-shadow: ${focusRingBorderStyle({
|
|
1432
1593
|
color: color.input.default.hovered.border,
|
|
1433
1594
|
width: input.border.width
|
|
1434
|
-
})
|
|
1595
|
+
})};
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
*:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border] {
|
|
1599
|
+
--input-box-shadow: ${focusRingBorderStyle({
|
|
1435
1600
|
color: color.input.invalid.hovered.border,
|
|
1436
1601
|
width: input.border.width
|
|
1437
|
-
})
|
|
1602
|
+
})};
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
`;
|
|
1438
1607
|
}
|
|
1439
1608
|
|
|
1440
1609
|
function responsiveMarginStyle(props) {
|
|
@@ -1478,16 +1647,16 @@ function responsiveRadiusStyle(props) {
|
|
|
1478
1647
|
}
|
|
1479
1648
|
|
|
1480
1649
|
function toBoxShadow(shadow, color) {
|
|
1481
|
-
return
|
|
1650
|
+
return `${shadow.map(rem).join(" ")} ${color}`;
|
|
1482
1651
|
}
|
|
1483
1652
|
function shadowStyle(shadow, outlineWidth = 1) {
|
|
1484
1653
|
if (!shadow)
|
|
1485
1654
|
return EMPTY_RECORD;
|
|
1486
|
-
const outline =
|
|
1655
|
+
const outline = `0 0 0 ${rem(outlineWidth)} var(--card-shadow-outline-color)`;
|
|
1487
1656
|
const umbra = toBoxShadow(shadow.umbra, "var(--card-shadow-umbra-color)");
|
|
1488
1657
|
const penumbra = toBoxShadow(shadow.penumbra, "var(--card-shadow-penumbra-color)");
|
|
1489
1658
|
const ambient = toBoxShadow(shadow.ambient, "var(--card-shadow-ambient-color)");
|
|
1490
|
-
return { boxShadow:
|
|
1659
|
+
return { boxShadow: `${outline}, ${umbra}, ${penumbra}, ${ambient}` };
|
|
1491
1660
|
}
|
|
1492
1661
|
function responsiveShadowStyle(props) {
|
|
1493
1662
|
const { card, media, shadow } = theme.getTheme_v2(props.theme);
|
|
@@ -1498,22 +1667,50 @@ function responsiveShadowStyle(props) {
|
|
|
1498
1667
|
);
|
|
1499
1668
|
}
|
|
1500
1669
|
|
|
1501
|
-
var __freeze$E = Object.freeze;
|
|
1502
|
-
var __defProp$F = Object.defineProperty;
|
|
1503
|
-
var __template$E = (cooked, raw) => __freeze$E(__defProp$F(cooked, "raw", { value: __freeze$E(raw || cooked.slice()) }));
|
|
1504
|
-
var _a$E, _b$m, _c$b;
|
|
1505
1670
|
function labelBaseStyle(props) {
|
|
1506
1671
|
const { $accent, $muted } = props;
|
|
1507
1672
|
const { font } = theme.getTheme_v2(props.theme);
|
|
1508
|
-
return styled.css
|
|
1673
|
+
return styled.css`
|
|
1674
|
+
text-transform: uppercase;
|
|
1675
|
+
|
|
1676
|
+
${$accent && styled.css`
|
|
1677
|
+
color: var(--card-accent-fg-color);
|
|
1678
|
+
`}
|
|
1679
|
+
|
|
1680
|
+
${$muted && styled.css`
|
|
1681
|
+
color: var(--card-muted-fg-color);
|
|
1682
|
+
`}
|
|
1683
|
+
|
|
1684
|
+
& code {
|
|
1685
|
+
font-family: ${font.code.family};
|
|
1686
|
+
border-radius: 1px;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
& a {
|
|
1690
|
+
text-decoration: none;
|
|
1691
|
+
border-radius: 1px;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
& svg {
|
|
1695
|
+
/* Certain popular CSS libraries changes the defaults for SVG display */
|
|
1696
|
+
/* Make sure SVGs are rendered as inline elements */
|
|
1697
|
+
display: inline;
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
& [data-sanity-icon] {
|
|
1701
|
+
vertical-align: baseline;
|
|
1702
|
+
}
|
|
1703
|
+
`;
|
|
1509
1704
|
}
|
|
1510
1705
|
|
|
1511
|
-
var __freeze$D = Object.freeze;
|
|
1512
|
-
var __defProp$E = Object.defineProperty;
|
|
1513
|
-
var __template$D = (cooked, raw) => __freeze$D(__defProp$E(cooked, "raw", { value: __freeze$D(raw || cooked.slice()) }));
|
|
1514
|
-
var _a$D;
|
|
1515
1706
|
const Root$C = styled__default.default.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle);
|
|
1516
|
-
const SpanWithTextOverflow$2 = styled__default.default.span
|
|
1707
|
+
const SpanWithTextOverflow$2 = styled__default.default.span`
|
|
1708
|
+
display: block;
|
|
1709
|
+
white-space: nowrap;
|
|
1710
|
+
text-overflow: ellipsis;
|
|
1711
|
+
overflow: hidden;
|
|
1712
|
+
overflow: clip;
|
|
1713
|
+
`;
|
|
1517
1714
|
const Label = react.forwardRef(function Label2(props, ref) {
|
|
1518
1715
|
const {
|
|
1519
1716
|
accent,
|
|
@@ -1596,8 +1793,8 @@ function avatarRootStyle(props) {
|
|
|
1596
1793
|
const { $color } = props;
|
|
1597
1794
|
const { avatar } = theme.getTheme_v2(props.theme);
|
|
1598
1795
|
return {
|
|
1599
|
-
"--avatar-bg-color":
|
|
1600
|
-
"--avatar-fg-color":
|
|
1796
|
+
"--avatar-bg-color": `var(--card-avatar-${$color}-bg-color)`,
|
|
1797
|
+
"--avatar-fg-color": `var(--card-avatar-${$color}-fg-color)`,
|
|
1601
1798
|
backgroundColor: "var(--avatar-bg-color)",
|
|
1602
1799
|
position: "relative",
|
|
1603
1800
|
boxSizing: "border-box",
|
|
@@ -1721,7 +1918,7 @@ const Avatar = react.forwardRef(function Avatar2(props, ref) {
|
|
|
1721
1918
|
animateArrowFrom || arrowPositionProp || "inside"
|
|
1722
1919
|
);
|
|
1723
1920
|
const [imageFailed, setImageFailed] = react.useState(false);
|
|
1724
|
-
const imageId =
|
|
1921
|
+
const imageId = `avatar-image-${elementId}`;
|
|
1725
1922
|
react.useEffect(() => {
|
|
1726
1923
|
if (arrowPosition === arrowPositionProp)
|
|
1727
1924
|
return void 0;
|
|
@@ -1772,7 +1969,7 @@ const Avatar = react.forwardRef(function Avatar2(props, ref) {
|
|
|
1772
1969
|
fill: color
|
|
1773
1970
|
}
|
|
1774
1971
|
) }) }),
|
|
1775
|
-
!imageFailed && src && /* @__PURE__ */ jsxRuntime.jsxs(Image, { viewBox:
|
|
1972
|
+
!imageFailed && src && /* @__PURE__ */ jsxRuntime.jsxs(Image, { viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
|
|
1776
1973
|
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("pattern", { id: imageId, patternContentUnits: "objectBoundingBox", width: "1", height: "1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1777
1974
|
"image",
|
|
1778
1975
|
{
|
|
@@ -1782,7 +1979,7 @@ const Avatar = react.forwardRef(function Avatar2(props, ref) {
|
|
|
1782
1979
|
onError: handleImageError
|
|
1783
1980
|
}
|
|
1784
1981
|
) }) }),
|
|
1785
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill:
|
|
1982
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill: `url(#${imageId})` }),
|
|
1786
1983
|
!__unstable_hideInnerStroke && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1787
1984
|
BgStroke,
|
|
1788
1985
|
{
|
|
@@ -1810,10 +2007,6 @@ const Avatar = react.forwardRef(function Avatar2(props, ref) {
|
|
|
1810
2007
|
);
|
|
1811
2008
|
});
|
|
1812
2009
|
|
|
1813
|
-
var __freeze$C = Object.freeze;
|
|
1814
|
-
var __defProp$D = Object.defineProperty;
|
|
1815
|
-
var __template$C = (cooked, raw) => __freeze$C(__defProp$D(cooked, "raw", { value: __freeze$C(raw || cooked.slice()) }));
|
|
1816
|
-
var _a$C;
|
|
1817
2010
|
function _responsiveAvatarCounterSizeStyle(props) {
|
|
1818
2011
|
const { avatar, media } = theme.getTheme_v2(props.theme);
|
|
1819
2012
|
return _responsive(media, props.$size, (size) => {
|
|
@@ -1829,7 +2022,23 @@ function _responsiveAvatarCounterSizeStyle(props) {
|
|
|
1829
2022
|
}
|
|
1830
2023
|
function _avatarCounterBaseStyle(props) {
|
|
1831
2024
|
const { space } = theme.getTheme_v2(props.theme);
|
|
1832
|
-
return styled.css
|
|
2025
|
+
return styled.css`
|
|
2026
|
+
align-items: center;
|
|
2027
|
+
justify-content: center;
|
|
2028
|
+
box-sizing: border-box;
|
|
2029
|
+
user-select: none;
|
|
2030
|
+
color: inherit;
|
|
2031
|
+
color: var(--card-fg-color);
|
|
2032
|
+
background: var(--card-bg-color);
|
|
2033
|
+
box-shadow:
|
|
2034
|
+
0 0 0 1px var(--card-bg-color),
|
|
2035
|
+
inset 0 0 0 1px var(--card-hairline-hard-color);
|
|
2036
|
+
padding: 0 ${rem(space[2])};
|
|
2037
|
+
|
|
2038
|
+
&:not([hidden]) {
|
|
2039
|
+
display: flex;
|
|
2040
|
+
}
|
|
2041
|
+
`;
|
|
1833
2042
|
}
|
|
1834
2043
|
const Root$A = styled__default.default.div(
|
|
1835
2044
|
_responsiveAvatarCounterSizeStyle,
|
|
@@ -1860,11 +2069,17 @@ function childrenToElementArray(children) {
|
|
|
1860
2069
|
);
|
|
1861
2070
|
}
|
|
1862
2071
|
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
2072
|
+
const BASE_STYLES = styled.css`
|
|
2073
|
+
white-space: nowrap;
|
|
2074
|
+
|
|
2075
|
+
& > div {
|
|
2076
|
+
vertical-align: top;
|
|
2077
|
+
|
|
2078
|
+
&:not([hidden]) {
|
|
2079
|
+
display: inline-block;
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
`;
|
|
1868
2083
|
function avatarStackStyle() {
|
|
1869
2084
|
return BASE_STYLES;
|
|
1870
2085
|
}
|
|
@@ -1981,26 +2196,83 @@ const Box = react.forwardRef(function Box2(props, ref) {
|
|
|
1981
2196
|
);
|
|
1982
2197
|
});
|
|
1983
2198
|
|
|
1984
|
-
var __freeze$A = Object.freeze;
|
|
1985
|
-
var __defProp$B = Object.defineProperty;
|
|
1986
|
-
var __template$A = (cooked, raw) => __freeze$A(__defProp$B(cooked, "raw", { value: __freeze$A(raw || cooked.slice()) }));
|
|
1987
|
-
var _a$A, _b$l, _c$a;
|
|
1988
2199
|
function textBaseStyle(props) {
|
|
1989
2200
|
const { $accent, $muted } = props;
|
|
1990
2201
|
const { font } = theme.getTheme_v2(props.theme);
|
|
1991
|
-
return styled.css
|
|
2202
|
+
return styled.css`
|
|
2203
|
+
color: var(--card-fg-color);
|
|
2204
|
+
|
|
2205
|
+
${$accent && styled.css`
|
|
2206
|
+
color: var(--card-accent-fg-color);
|
|
2207
|
+
`}
|
|
2208
|
+
|
|
2209
|
+
${$muted && styled.css`
|
|
2210
|
+
color: var(--card-muted-fg-color);
|
|
2211
|
+
`}
|
|
2212
|
+
|
|
2213
|
+
& code {
|
|
2214
|
+
font-family: ${font.code.family};
|
|
2215
|
+
border-radius: 1px;
|
|
2216
|
+
background-color: var(--card-code-bg-color);
|
|
2217
|
+
color: var(--card-code-fg-color);
|
|
2218
|
+
}
|
|
2219
|
+
|
|
2220
|
+
& a {
|
|
2221
|
+
text-decoration: none;
|
|
2222
|
+
border-radius: 1px;
|
|
2223
|
+
color: var(--card-link-color);
|
|
2224
|
+
outline: none;
|
|
2225
|
+
|
|
2226
|
+
@media (hover: hover) {
|
|
2227
|
+
&:hover {
|
|
2228
|
+
text-decoration: underline;
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
&:focus {
|
|
2233
|
+
box-shadow:
|
|
2234
|
+
0 0 0 1px var(--card-bg-color),
|
|
2235
|
+
0 0 0 3px var(--card-focus-ring-color);
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
&:focus:not(:focus-visible) {
|
|
2239
|
+
box-shadow: none;
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
& strong {
|
|
2244
|
+
font-weight: ${font.text.weights.bold};
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
& svg {
|
|
2248
|
+
/* Certain popular CSS libraries changes the defaults for SVG display */
|
|
2249
|
+
/* Make sure SVGs are rendered as inline elements */
|
|
2250
|
+
display: inline;
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
& [data-sanity-icon] {
|
|
2254
|
+
vertical-align: baseline;
|
|
2255
|
+
color: var(--card-icon-color);
|
|
2256
|
+
|
|
2257
|
+
& path {
|
|
2258
|
+
vector-effect: non-scaling-stroke !important;
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
`;
|
|
1992
2262
|
}
|
|
1993
2263
|
|
|
1994
|
-
var __freeze$z = Object.freeze;
|
|
1995
|
-
var __defProp$A = Object.defineProperty;
|
|
1996
|
-
var __template$z = (cooked, raw) => __freeze$z(__defProp$A(cooked, "raw", { value: __freeze$z(raw || cooked.slice()) }));
|
|
1997
|
-
var _a$z;
|
|
1998
2264
|
const Root$x = styled__default.default.div(
|
|
1999
2265
|
responsiveTextFont,
|
|
2000
2266
|
responsiveTextAlignStyle,
|
|
2001
2267
|
textBaseStyle
|
|
2002
2268
|
);
|
|
2003
|
-
const SpanWithTextOverflow$1 = styled__default.default.span
|
|
2269
|
+
const SpanWithTextOverflow$1 = styled__default.default.span`
|
|
2270
|
+
display: block;
|
|
2271
|
+
white-space: nowrap;
|
|
2272
|
+
text-overflow: ellipsis;
|
|
2273
|
+
overflow: hidden;
|
|
2274
|
+
overflow: clip;
|
|
2275
|
+
`;
|
|
2004
2276
|
const Text = react.forwardRef(function Text2(props, ref) {
|
|
2005
2277
|
const {
|
|
2006
2278
|
accent = false,
|
|
@@ -2035,8 +2307,8 @@ const Text = react.forwardRef(function Text2(props, ref) {
|
|
|
2035
2307
|
function badgeStyle(props) {
|
|
2036
2308
|
const { $tone } = props;
|
|
2037
2309
|
return {
|
|
2038
|
-
"--card-bg-color":
|
|
2039
|
-
"--card-fg-color":
|
|
2310
|
+
"--card-bg-color": `var(--card-badge-${$tone}-bg-color)`,
|
|
2311
|
+
"--card-fg-color": `var(--card-badge-${$tone}-fg-color)`,
|
|
2040
2312
|
backgroundColor: "var(--card-bg-color)",
|
|
2041
2313
|
cursor: "default",
|
|
2042
2314
|
"&:not([hidden])": {
|
|
@@ -2097,12 +2369,20 @@ const Flex = react.forwardRef(function Flex2(props, ref) {
|
|
|
2097
2369
|
);
|
|
2098
2370
|
});
|
|
2099
2371
|
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2372
|
+
const rotate$1 = styled.keyframes`
|
|
2373
|
+
from {
|
|
2374
|
+
transform: rotate(0deg);
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2377
|
+
to {
|
|
2378
|
+
transform: rotate(360deg);
|
|
2379
|
+
}
|
|
2380
|
+
`;
|
|
2381
|
+
const Root$u = styled__default.default(Text)`
|
|
2382
|
+
& > span > svg {
|
|
2383
|
+
animation: ${rotate$1} 500ms linear infinite;
|
|
2384
|
+
}
|
|
2385
|
+
`;
|
|
2106
2386
|
const Spinner = react.forwardRef(function Spinner2(props, ref) {
|
|
2107
2387
|
return /* @__PURE__ */ jsxRuntime.jsx(Root$u, { "data-ui": "Spinner", ...props, ref, children: /* @__PURE__ */ jsxRuntime.jsx(icons.SpinnerIcon, {}) });
|
|
2108
2388
|
});
|
|
@@ -2137,7 +2417,7 @@ function _cardColorStyle(base, color, checkered = false) {
|
|
|
2137
2417
|
"--card-avatar-cyan-bg-color": color.avatar.cyan.bg,
|
|
2138
2418
|
"--card-avatar-cyan-fg-color": color.avatar.cyan.fg,
|
|
2139
2419
|
"--card-bg-color": color.bg,
|
|
2140
|
-
"--card-bg-image": checkered ?
|
|
2420
|
+
"--card-bg-image": checkered ? `repeating-conic-gradient(${color.bg} 0% 25%, ${color.muted.bg} 0% 50%)` : void 0,
|
|
2141
2421
|
"--card-border-color": color.border,
|
|
2142
2422
|
"--card-badge-default-bg-color": color.badge.default.bg,
|
|
2143
2423
|
"--card-badge-default-dot-color": color.badge.default.dot,
|
|
@@ -2179,20 +2459,54 @@ function _cardColorStyle(base, color, checkered = false) {
|
|
|
2179
2459
|
};
|
|
2180
2460
|
}
|
|
2181
2461
|
|
|
2182
|
-
var __freeze$x = Object.freeze;
|
|
2183
|
-
var __defProp$y = Object.defineProperty;
|
|
2184
|
-
var __template$x = (cooked, raw) => __freeze$x(__defProp$y(cooked, "raw", { value: __freeze$x(raw || cooked.slice()) }));
|
|
2185
|
-
var _a$x, _b$j;
|
|
2186
2462
|
function buttonBaseStyles(props) {
|
|
2187
2463
|
const { $width } = props;
|
|
2188
2464
|
const { style } = theme.getTheme_v2(props.theme);
|
|
2189
|
-
return styled.css
|
|
2465
|
+
return styled.css`
|
|
2466
|
+
${style == null ? void 0 : style.button};
|
|
2467
|
+
|
|
2468
|
+
-webkit-font-smoothing: inherit;
|
|
2469
|
+
appearance: none;
|
|
2470
|
+
display: inline-flex;
|
|
2471
|
+
align-items: center;
|
|
2472
|
+
font: inherit;
|
|
2473
|
+
border: 0;
|
|
2474
|
+
outline: none;
|
|
2475
|
+
user-select: none;
|
|
2476
|
+
text-decoration: none;
|
|
2477
|
+
border: 0;
|
|
2478
|
+
box-sizing: border-box;
|
|
2479
|
+
padding: 0;
|
|
2480
|
+
margin: 0;
|
|
2481
|
+
white-space: nowrap;
|
|
2482
|
+
text-align: left;
|
|
2483
|
+
position: relative;
|
|
2484
|
+
vertical-align: top;
|
|
2485
|
+
|
|
2486
|
+
${$width === "fill" && styled.css`
|
|
2487
|
+
width: -moz-available;
|
|
2488
|
+
width: -webkit-fill-available;
|
|
2489
|
+
width: stretch;
|
|
2490
|
+
`}
|
|
2491
|
+
|
|
2492
|
+
& > span {
|
|
2493
|
+
display: block;
|
|
2494
|
+
flex: 1;
|
|
2495
|
+
min-width: 0;
|
|
2496
|
+
border-radius: inherit;
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2499
|
+
&::-moz-focus-inner {
|
|
2500
|
+
border: 0;
|
|
2501
|
+
padding: 0;
|
|
2502
|
+
}
|
|
2503
|
+
`;
|
|
2190
2504
|
}
|
|
2191
2505
|
function combineBoxShadow(...boxShadows) {
|
|
2192
2506
|
return boxShadows.filter(Boolean).join(",");
|
|
2193
2507
|
}
|
|
2194
2508
|
function buttonColorStyles(props) {
|
|
2195
|
-
var
|
|
2509
|
+
var _a;
|
|
2196
2510
|
const { $mode } = props;
|
|
2197
2511
|
const { button, color: baseColor, style } = theme.getTheme_v2(props.theme);
|
|
2198
2512
|
const shadow = props.$mode === "ghost";
|
|
@@ -2236,16 +2550,25 @@ function buttonColorStyles(props) {
|
|
|
2236
2550
|
"&[data-selected]": _cardColorStyle(baseColor, color.pressed)
|
|
2237
2551
|
}
|
|
2238
2552
|
},
|
|
2239
|
-
(
|
|
2553
|
+
(_a = style == null ? void 0 : style.button) == null ? void 0 : _a.root
|
|
2240
2554
|
].filter(Boolean);
|
|
2241
2555
|
}
|
|
2242
2556
|
|
|
2243
|
-
var __freeze$w = Object.freeze;
|
|
2244
|
-
var __defProp$x = Object.defineProperty;
|
|
2245
|
-
var __template$w = (cooked, raw) => __freeze$w(__defProp$x(cooked, "raw", { value: __freeze$w(raw || cooked.slice()) }));
|
|
2246
|
-
var _a$w;
|
|
2247
2557
|
const Root$t = styled__default.default.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles);
|
|
2248
|
-
const LoadingBox = styled__default.default.div
|
|
2558
|
+
const LoadingBox = styled__default.default.div`
|
|
2559
|
+
position: absolute;
|
|
2560
|
+
top: 0;
|
|
2561
|
+
left: 0;
|
|
2562
|
+
right: 0;
|
|
2563
|
+
bottom: 0;
|
|
2564
|
+
display: flex;
|
|
2565
|
+
align-items: center;
|
|
2566
|
+
justify-content: center;
|
|
2567
|
+
background-color: var(--card-bg-color);
|
|
2568
|
+
border-radius: inherit;
|
|
2569
|
+
z-index: 1;
|
|
2570
|
+
box-shadow: inherit;
|
|
2571
|
+
`;
|
|
2249
2572
|
const Button = react.forwardRef(function Button2(props, ref) {
|
|
2250
2573
|
const {
|
|
2251
2574
|
children,
|
|
@@ -2341,24 +2664,134 @@ const Button = react.forwardRef(function Button2(props, ref) {
|
|
|
2341
2664
|
);
|
|
2342
2665
|
});
|
|
2343
2666
|
|
|
2344
|
-
var __freeze$v = Object.freeze;
|
|
2345
|
-
var __defProp$w = Object.defineProperty;
|
|
2346
|
-
var __template$v = (cooked, raw) => __freeze$v(__defProp$w(cooked, "raw", { value: __freeze$v(raw || cooked.slice()) }));
|
|
2347
|
-
var _a$v, _b$i, _c$9;
|
|
2348
2667
|
function cardStyle(props) {
|
|
2349
2668
|
return [cardBaseStyle(props), cardColorStyle(props)];
|
|
2350
2669
|
}
|
|
2351
2670
|
function cardBaseStyle(props) {
|
|
2352
2671
|
const { $checkered } = props;
|
|
2353
2672
|
const { space } = theme.getTheme_v2(props.theme);
|
|
2354
|
-
return styled.css
|
|
2673
|
+
return styled.css`
|
|
2674
|
+
${$checkered && styled.css`
|
|
2675
|
+
background-size: ${space[3]}px ${space[3]}px;
|
|
2676
|
+
background-position: 50% 50%;
|
|
2677
|
+
background-image: var(--card-bg-image);
|
|
2678
|
+
`}
|
|
2679
|
+
|
|
2680
|
+
&[data-as='button'] {
|
|
2681
|
+
-webkit-font-smoothing: inherit;
|
|
2682
|
+
appearance: none;
|
|
2683
|
+
outline: none;
|
|
2684
|
+
font: inherit;
|
|
2685
|
+
text-align: inherit;
|
|
2686
|
+
border: 0;
|
|
2687
|
+
width: -moz-available;
|
|
2688
|
+
width: -webkit-fill-available;
|
|
2689
|
+
width: stretch;
|
|
2690
|
+
}
|
|
2691
|
+
|
|
2692
|
+
/* &:is(a) */
|
|
2693
|
+
&[data-as='a'] {
|
|
2694
|
+
outline: none;
|
|
2695
|
+
text-decoration: none;
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2698
|
+
/* &:is(pre) */
|
|
2699
|
+
&[data-as='pre'] {
|
|
2700
|
+
font: inherit;
|
|
2701
|
+
}
|
|
2702
|
+
`;
|
|
2355
2703
|
}
|
|
2356
2704
|
function cardColorStyle(props) {
|
|
2357
|
-
var
|
|
2705
|
+
var _a;
|
|
2358
2706
|
const { $checkered, $focusRing } = props;
|
|
2359
2707
|
const { card, color, style } = theme.getTheme_v2(props.theme);
|
|
2360
2708
|
const border = { width: card.border.width, color: "var(--card-border-color)" };
|
|
2361
|
-
return styled.css
|
|
2709
|
+
return styled.css`
|
|
2710
|
+
color-scheme: ${color._dark ? "dark" : "light"};
|
|
2711
|
+
|
|
2712
|
+
${_cardColorStyle(color, color, $checkered)}
|
|
2713
|
+
|
|
2714
|
+
background-color: var(--card-bg-color);
|
|
2715
|
+
color: var(--card-fg-color);
|
|
2716
|
+
|
|
2717
|
+
/* &:is(button) */
|
|
2718
|
+
&[data-as='button'] {
|
|
2719
|
+
--card-focus-ring-box-shadow: none;
|
|
2720
|
+
|
|
2721
|
+
cursor: default;
|
|
2722
|
+
box-shadow: var(--card-focus-ring-box-shadow);
|
|
2723
|
+
|
|
2724
|
+
&:disabled {
|
|
2725
|
+
${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}
|
|
2726
|
+
}
|
|
2727
|
+
|
|
2728
|
+
&:not(:disabled) {
|
|
2729
|
+
&[data-pressed] {
|
|
2730
|
+
${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
|
|
2731
|
+
}
|
|
2732
|
+
|
|
2733
|
+
&[data-selected] {
|
|
2734
|
+
${_cardColorStyle(color, color.selectable.default.selected, $checkered)}
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
@media (hover: hover) {
|
|
2738
|
+
&:not([data-pressed]):not([data-selected]) {
|
|
2739
|
+
&[data-hovered],
|
|
2740
|
+
&:hover {
|
|
2741
|
+
${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}
|
|
2742
|
+
}
|
|
2743
|
+
|
|
2744
|
+
&:active {
|
|
2745
|
+
${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
&:focus-visible {
|
|
2751
|
+
--card-focus-ring-box-shadow: ${$focusRing ? focusRingStyle({ base: color, border, focusRing: card.focusRing }) : void 0};
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2756
|
+
/* &:is(a) */
|
|
2757
|
+
&[data-as='a'] {
|
|
2758
|
+
cursor: pointer;
|
|
2759
|
+
box-shadow: var(--card-focus-ring-box-shadow);
|
|
2760
|
+
|
|
2761
|
+
&[data-disabled] {
|
|
2762
|
+
${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}
|
|
2763
|
+
}
|
|
2764
|
+
|
|
2765
|
+
&:not([data-disabled]) {
|
|
2766
|
+
&[data-pressed] {
|
|
2767
|
+
${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
|
|
2768
|
+
}
|
|
2769
|
+
|
|
2770
|
+
&[data-selected] {
|
|
2771
|
+
${_cardColorStyle(color, color.selectable.default.selected, $checkered)}
|
|
2772
|
+
}
|
|
2773
|
+
|
|
2774
|
+
@media (hover: hover) {
|
|
2775
|
+
&:not([data-pressed]):not([data-selected]) {
|
|
2776
|
+
&[data-hovered],
|
|
2777
|
+
&:hover {
|
|
2778
|
+
${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}
|
|
2779
|
+
}
|
|
2780
|
+
|
|
2781
|
+
&:active {
|
|
2782
|
+
${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
&:focus-visible {
|
|
2788
|
+
--card-focus-ring-box-shadow: ${$focusRing ? focusRingStyle({ base: color, border, focusRing: card.focusRing }) : void 0};
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
|
|
2793
|
+
${(_a = style == null ? void 0 : style.card) == null ? void 0 : _a.root}
|
|
2794
|
+
`;
|
|
2362
2795
|
}
|
|
2363
2796
|
|
|
2364
2797
|
const Root$s = styled__default.default(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle);
|
|
@@ -2411,35 +2844,125 @@ const Card = react.forwardRef(function Card2(props, ref) {
|
|
|
2411
2844
|
) });
|
|
2412
2845
|
});
|
|
2413
2846
|
|
|
2414
|
-
var __freeze$u = Object.freeze;
|
|
2415
|
-
var __defProp$v = Object.defineProperty;
|
|
2416
|
-
var __template$u = (cooked, raw) => __freeze$u(__defProp$v(cooked, "raw", { value: __freeze$u(raw || cooked.slice()) }));
|
|
2417
|
-
var _a$u, _b$h;
|
|
2418
2847
|
function checkboxBaseStyles() {
|
|
2419
|
-
return styled.css
|
|
2848
|
+
return styled.css`
|
|
2849
|
+
position: relative;
|
|
2850
|
+
display: inline-block;
|
|
2851
|
+
`;
|
|
2420
2852
|
}
|
|
2421
2853
|
function inputElementStyles(props) {
|
|
2422
2854
|
const { color, input, radius } = theme.getTheme_v2(props.theme);
|
|
2423
2855
|
const { focusRing } = input.checkbox;
|
|
2424
|
-
return styled.css
|
|
2856
|
+
return styled.css`
|
|
2857
|
+
position: absolute;
|
|
2858
|
+
top: 0;
|
|
2859
|
+
left: 0;
|
|
2860
|
+
width: 100%;
|
|
2861
|
+
height: 100%;
|
|
2862
|
+
outline: none;
|
|
2863
|
+
opacity: 0;
|
|
2864
|
+
z-index: 1;
|
|
2865
|
+
padding: 0;
|
|
2866
|
+
margin: 0;
|
|
2867
|
+
|
|
2868
|
+
& + span {
|
|
2869
|
+
position: relative;
|
|
2870
|
+
display: block;
|
|
2871
|
+
height: ${rem(input.checkbox.size)};
|
|
2872
|
+
width: ${rem(input.checkbox.size)};
|
|
2873
|
+
box-sizing: border-box;
|
|
2874
|
+
box-shadow: ${focusRingBorderStyle({
|
|
2425
2875
|
color: color.input.default.enabled.border,
|
|
2426
2876
|
width: input.border.width
|
|
2427
|
-
})
|
|
2877
|
+
})};
|
|
2878
|
+
border-radius: ${rem(radius[2])};
|
|
2879
|
+
line-height: 1;
|
|
2880
|
+
background-color: ${color.input.default.enabled.bg};
|
|
2881
|
+
|
|
2882
|
+
& > svg {
|
|
2883
|
+
display: block;
|
|
2884
|
+
position: absolute;
|
|
2885
|
+
opacity: 0;
|
|
2886
|
+
height: 100%;
|
|
2887
|
+
width: 100%;
|
|
2888
|
+
|
|
2889
|
+
& > path {
|
|
2890
|
+
vector-effect: non-scaling-stroke;
|
|
2891
|
+
stroke-width: 1.5px !important;
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
&:checked + span {
|
|
2897
|
+
background: ${color.input.default.enabled.fg};
|
|
2898
|
+
box-shadow: ${focusRingBorderStyle({
|
|
2428
2899
|
color: color.input.default.enabled.fg,
|
|
2429
2900
|
width: input.border.width
|
|
2430
|
-
})
|
|
2901
|
+
})};
|
|
2902
|
+
color: ${color.input.default.enabled.bg};
|
|
2903
|
+
}
|
|
2904
|
+
|
|
2905
|
+
/* focus */
|
|
2906
|
+
&:not(:disabled):focus:focus-visible + span {
|
|
2907
|
+
box-shadow: ${focusRingStyle({ focusRing })};
|
|
2908
|
+
}
|
|
2909
|
+
|
|
2910
|
+
/* focus when checked - uses a different offset */
|
|
2911
|
+
&:not(:disabled):focus:focus-visible&:checked + span {
|
|
2912
|
+
box-shadow: ${focusRingStyle({ focusRing: { width: 1, offset: 1 } })};
|
|
2913
|
+
}
|
|
2914
|
+
|
|
2915
|
+
&[data-error] + span {
|
|
2916
|
+
background-color: ${color.input.invalid.enabled.border};
|
|
2917
|
+
box-shadow: ${focusRingBorderStyle({
|
|
2431
2918
|
width: input.border.width,
|
|
2432
2919
|
color: color.input.invalid.enabled.muted.bg
|
|
2433
|
-
})
|
|
2920
|
+
})};
|
|
2921
|
+
color: ${color.input.default.disabled.fg};
|
|
2922
|
+
}
|
|
2923
|
+
&[data-error]&:checked + span {
|
|
2924
|
+
background-color: ${color.input.invalid.enabled.muted.bg};
|
|
2925
|
+
color: ${color.input.default.enabled.bg};
|
|
2926
|
+
}
|
|
2927
|
+
&[data-error]&:checked&:not(:disabled):focus:focus-visible + span {
|
|
2928
|
+
box-shadow: ${focusRingStyle({
|
|
2434
2929
|
border: { width: input.border.width, color: color.input.invalid.readOnly.muted.bg },
|
|
2435
2930
|
focusRing: { width: 1, offset: 1 }
|
|
2436
|
-
})
|
|
2931
|
+
})};
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2934
|
+
&:disabled + span {
|
|
2935
|
+
background-color: ${color.input.default.disabled.bg};
|
|
2936
|
+
box-shadow: ${focusRingBorderStyle({
|
|
2437
2937
|
width: input.border.width,
|
|
2438
2938
|
color: color.input.default.disabled.border
|
|
2439
|
-
})
|
|
2939
|
+
})};
|
|
2940
|
+
color: ${color.input.default.disabled.fg};
|
|
2941
|
+
}
|
|
2942
|
+
&:disabled&:checked + span {
|
|
2943
|
+
background-color: ${color.input.default.disabled.muted.bg};
|
|
2944
|
+
}
|
|
2945
|
+
|
|
2946
|
+
&[data-read-only] + span {
|
|
2947
|
+
background-color: ${color.input.default.readOnly.bg};
|
|
2948
|
+
box-shadow: ${focusRingBorderStyle({
|
|
2440
2949
|
width: input.border.width,
|
|
2441
2950
|
color: color.input.default.readOnly.border
|
|
2442
|
-
})
|
|
2951
|
+
})};
|
|
2952
|
+
color: ${color.input.default.readOnly.fg};
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
&[data-read-only]&:checked + span {
|
|
2956
|
+
background-color: ${color.input.default.readOnly.muted.bg};
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
&:checked + span > svg:first-child {
|
|
2960
|
+
opacity: 1;
|
|
2961
|
+
}
|
|
2962
|
+
&:indeterminate + span > svg:last-child {
|
|
2963
|
+
opacity: 1;
|
|
2964
|
+
}
|
|
2965
|
+
`;
|
|
2443
2966
|
}
|
|
2444
2967
|
|
|
2445
2968
|
const Root$r = styled__default.default.div(checkboxBaseStyles);
|
|
@@ -2483,10 +3006,6 @@ const Checkbox = react.forwardRef(function Checkbox2(props, forwardedRef) {
|
|
|
2483
3006
|
] });
|
|
2484
3007
|
});
|
|
2485
3008
|
|
|
2486
|
-
var __freeze$t = Object.freeze;
|
|
2487
|
-
var __defProp$u = Object.defineProperty;
|
|
2488
|
-
var __template$t = (cooked, raw) => __freeze$t(__defProp$u(cooked, "raw", { value: __freeze$t(raw || cooked.slice()) }));
|
|
2489
|
-
var _a$t;
|
|
2490
3009
|
function codeSyntaxHighlightingStyle({ theme: theme$1 }) {
|
|
2491
3010
|
const {
|
|
2492
3011
|
color: { syntax: color }
|
|
@@ -2531,7 +3050,33 @@ function codeSyntaxHighlightingStyle({ theme: theme$1 }) {
|
|
|
2531
3050
|
};
|
|
2532
3051
|
}
|
|
2533
3052
|
function codeBaseStyle() {
|
|
2534
|
-
return styled.css
|
|
3053
|
+
return styled.css`
|
|
3054
|
+
color: var(--card-code-fg-color);
|
|
3055
|
+
|
|
3056
|
+
& code {
|
|
3057
|
+
font-family: inherit;
|
|
3058
|
+
|
|
3059
|
+
&.refractor .token {
|
|
3060
|
+
${codeSyntaxHighlightingStyle}
|
|
3061
|
+
}
|
|
3062
|
+
}
|
|
3063
|
+
|
|
3064
|
+
& a {
|
|
3065
|
+
color: inherit;
|
|
3066
|
+
text-decoration: underline;
|
|
3067
|
+
border-radius: 1px;
|
|
3068
|
+
}
|
|
3069
|
+
|
|
3070
|
+
& svg {
|
|
3071
|
+
/* Certain popular CSS libraries changes the defaults for SVG display */
|
|
3072
|
+
/* Make sure SVGs are rendered as inline elements */
|
|
3073
|
+
display: inline;
|
|
3074
|
+
}
|
|
3075
|
+
|
|
3076
|
+
& [data-sanity-icon] {
|
|
3077
|
+
vertical-align: baseline;
|
|
3078
|
+
}
|
|
3079
|
+
`;
|
|
2535
3080
|
}
|
|
2536
3081
|
|
|
2537
3082
|
const Root$q = styled__default.default.pre(codeBaseStyle, responsiveCodeFontStyle);
|
|
@@ -2601,22 +3146,70 @@ const Grid = react.forwardRef(function Grid2(props, ref) {
|
|
|
2601
3146
|
);
|
|
2602
3147
|
});
|
|
2603
3148
|
|
|
2604
|
-
var __freeze$s = Object.freeze;
|
|
2605
|
-
var __defProp$t = Object.defineProperty;
|
|
2606
|
-
var __template$s = (cooked, raw) => __freeze$s(__defProp$t(cooked, "raw", { value: __freeze$s(raw || cooked.slice()) }));
|
|
2607
|
-
var _a$s, _b$g, _c$8;
|
|
2608
3149
|
function headingBaseStyle(props) {
|
|
2609
3150
|
const { $accent, $muted } = props;
|
|
2610
3151
|
const { font } = theme.getTheme_v2(props.theme);
|
|
2611
|
-
return styled.css
|
|
3152
|
+
return styled.css`
|
|
3153
|
+
${$accent && styled.css`
|
|
3154
|
+
color: var(--card-accent-fg-color);
|
|
3155
|
+
`}
|
|
3156
|
+
|
|
3157
|
+
${$muted && styled.css`
|
|
3158
|
+
color: var(--card-muted-fg-color);
|
|
3159
|
+
`}
|
|
3160
|
+
|
|
3161
|
+
& code {
|
|
3162
|
+
font-family: ${font.code.family};
|
|
3163
|
+
border-radius: 1px;
|
|
3164
|
+
}
|
|
3165
|
+
|
|
3166
|
+
& a {
|
|
3167
|
+
text-decoration: none;
|
|
3168
|
+
border-radius: 1px;
|
|
3169
|
+
color: var(--card-link-color);
|
|
3170
|
+
outline: none;
|
|
3171
|
+
|
|
3172
|
+
@media (hover: hover) {
|
|
3173
|
+
&:hover {
|
|
3174
|
+
text-decoration: underline;
|
|
3175
|
+
}
|
|
3176
|
+
}
|
|
3177
|
+
|
|
3178
|
+
&:focus {
|
|
3179
|
+
box-shadow:
|
|
3180
|
+
0 0 0 1px var(--card-bg-color),
|
|
3181
|
+
0 0 0 3px var(--card-focus-ring-color);
|
|
3182
|
+
}
|
|
3183
|
+
|
|
3184
|
+
&:focus:not(:focus-visible) {
|
|
3185
|
+
box-shadow: none;
|
|
3186
|
+
}
|
|
3187
|
+
}
|
|
3188
|
+
|
|
3189
|
+
& strong {
|
|
3190
|
+
font-weight: ${font.heading.weights.bold};
|
|
3191
|
+
}
|
|
3192
|
+
|
|
3193
|
+
& svg {
|
|
3194
|
+
/* Certain popular CSS libraries changes the defaults for SVG display */
|
|
3195
|
+
/* Make sure SVGs are rendered as inline elements */
|
|
3196
|
+
display: inline;
|
|
3197
|
+
}
|
|
3198
|
+
|
|
3199
|
+
& [data-sanity-icon] {
|
|
3200
|
+
vertical-align: baseline;
|
|
3201
|
+
}
|
|
3202
|
+
`;
|
|
2612
3203
|
}
|
|
2613
3204
|
|
|
2614
|
-
var __freeze$r = Object.freeze;
|
|
2615
|
-
var __defProp$s = Object.defineProperty;
|
|
2616
|
-
var __template$r = (cooked, raw) => __freeze$r(__defProp$s(cooked, "raw", { value: __freeze$r(raw || cooked.slice()) }));
|
|
2617
|
-
var _a$r;
|
|
2618
3205
|
const Root$n = styled__default.default.div(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont);
|
|
2619
|
-
const SpanWithTextOverflow = styled__default.default.span
|
|
3206
|
+
const SpanWithTextOverflow = styled__default.default.span`
|
|
3207
|
+
display: block;
|
|
3208
|
+
white-space: nowrap;
|
|
3209
|
+
text-overflow: ellipsis;
|
|
3210
|
+
overflow: hidden;
|
|
3211
|
+
overflow: clip;
|
|
3212
|
+
`;
|
|
2620
3213
|
const Heading = react.forwardRef(function Heading2(props, ref) {
|
|
2621
3214
|
const {
|
|
2622
3215
|
accent = false,
|
|
@@ -2665,8 +3258,8 @@ function inlineSpaceStyle(props) {
|
|
|
2665
3258
|
return _responsive(media, props.$space, (spaceIndex) => {
|
|
2666
3259
|
const _space = rem(spaceIndex === 0.5 ? space[1] / 2 : space[spaceIndex]);
|
|
2667
3260
|
return {
|
|
2668
|
-
margin:
|
|
2669
|
-
"& > div": { padding:
|
|
3261
|
+
margin: `-${_space} 0 0 -${_space}`,
|
|
3262
|
+
"& > div": { padding: `${_space} 0 0 ${_space}` }
|
|
2670
3263
|
};
|
|
2671
3264
|
});
|
|
2672
3265
|
}
|
|
@@ -2691,12 +3284,22 @@ const Inline = react.forwardRef(function Inline2(props, ref) {
|
|
|
2691
3284
|
);
|
|
2692
3285
|
});
|
|
2693
3286
|
|
|
2694
|
-
var __freeze$q = Object.freeze;
|
|
2695
|
-
var __defProp$r = Object.defineProperty;
|
|
2696
|
-
var __template$q = (cooked, raw) => __freeze$q(__defProp$r(cooked, "raw", { value: __freeze$q(raw || cooked.slice()) }));
|
|
2697
|
-
var _a$q;
|
|
2698
3287
|
function kbdStyle() {
|
|
2699
|
-
return styled.css
|
|
3288
|
+
return styled.css`
|
|
3289
|
+
--card-bg-color: var(--card-kbd-bg-color);
|
|
3290
|
+
--card-border-color: var(--card-kbd-border-color);
|
|
3291
|
+
--card-fg-color: var(--card-kbd-fg-color);
|
|
3292
|
+
|
|
3293
|
+
box-shadow: inset 0 0 0 1px var(--card-border-color);
|
|
3294
|
+
background: var(--card-bg-color);
|
|
3295
|
+
font: inherit;
|
|
3296
|
+
|
|
3297
|
+
vertical-align: top;
|
|
3298
|
+
|
|
3299
|
+
&:not([hidden]) {
|
|
3300
|
+
display: inline-block;
|
|
3301
|
+
}
|
|
3302
|
+
`;
|
|
2700
3303
|
}
|
|
2701
3304
|
const Root$l = styled__default.default.kbd(responsiveRadiusStyle, kbdStyle);
|
|
2702
3305
|
const KBD = react.forwardRef(function KBD2(props, ref) {
|
|
@@ -2779,24 +3382,70 @@ function getRoundedCommands(points) {
|
|
|
2779
3382
|
function compileCommands(cmds) {
|
|
2780
3383
|
return cmds.map((n, idx) => {
|
|
2781
3384
|
if (n.type === "point") {
|
|
2782
|
-
return
|
|
3385
|
+
return `${idx === 0 ? "M" : "L"} ${n.x} ${n.y}`;
|
|
2783
3386
|
}
|
|
2784
3387
|
if (n.type === "curve") {
|
|
2785
|
-
return
|
|
3388
|
+
return `C ${n.startControl.x} ${n.startControl.y} ${n.endControl.x} ${n.endControl.y} ${n.curveEnd.x} ${n.curveEnd.y}`;
|
|
2786
3389
|
}
|
|
2787
|
-
return
|
|
3390
|
+
return ``;
|
|
2788
3391
|
}).join(" ");
|
|
2789
3392
|
}
|
|
2790
3393
|
|
|
2791
|
-
var __freeze$p = Object.freeze;
|
|
2792
|
-
var __defProp$q = Object.defineProperty;
|
|
2793
|
-
var __template$p = (cooked, raw) => __freeze$p(__defProp$q(cooked, "raw", { value: __freeze$p(raw || cooked.slice()) }));
|
|
2794
|
-
var _a$p, _b$f, _c$7;
|
|
2795
3394
|
const Root$k = styled__default.default.div(
|
|
2796
|
-
({ $w: w }) => styled.css
|
|
3395
|
+
({ $w: w }) => styled.css`
|
|
3396
|
+
position: absolute;
|
|
3397
|
+
width: ${w}px;
|
|
3398
|
+
height: ${w}px;
|
|
3399
|
+
|
|
3400
|
+
:empty + & {
|
|
3401
|
+
display: none;
|
|
3402
|
+
}
|
|
3403
|
+
|
|
3404
|
+
& > svg {
|
|
3405
|
+
display: block;
|
|
3406
|
+
line-height: 0;
|
|
3407
|
+
transform-origin: ${w / 2}px ${w / 2}px;
|
|
3408
|
+
}
|
|
3409
|
+
|
|
3410
|
+
[data-placement^='top'] > & {
|
|
3411
|
+
bottom: -${w}px;
|
|
3412
|
+
|
|
3413
|
+
& > svg {
|
|
3414
|
+
transform: rotate(0);
|
|
3415
|
+
}
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3418
|
+
[data-placement^='right'] > & {
|
|
3419
|
+
left: -${w}px;
|
|
3420
|
+
|
|
3421
|
+
& > svg {
|
|
3422
|
+
transform: rotate(90deg);
|
|
3423
|
+
}
|
|
3424
|
+
}
|
|
3425
|
+
|
|
3426
|
+
[data-placement^='left'] > & {
|
|
3427
|
+
right: -${w}px;
|
|
3428
|
+
|
|
3429
|
+
& > svg {
|
|
3430
|
+
transform: rotate(-90deg);
|
|
3431
|
+
}
|
|
3432
|
+
}
|
|
3433
|
+
|
|
3434
|
+
[data-placement^='bottom'] > & {
|
|
3435
|
+
top: -${w}px;
|
|
3436
|
+
|
|
3437
|
+
& > svg {
|
|
3438
|
+
transform: rotate(180deg);
|
|
3439
|
+
}
|
|
3440
|
+
}
|
|
3441
|
+
`
|
|
2797
3442
|
);
|
|
2798
|
-
const StrokePath = styled__default.default.path
|
|
2799
|
-
|
|
3443
|
+
const StrokePath = styled__default.default.path`
|
|
3444
|
+
stroke: var(--card-shadow-outline-color);
|
|
3445
|
+
`;
|
|
3446
|
+
const ShapePath = styled__default.default.path`
|
|
3447
|
+
fill: var(--card-bg-color);
|
|
3448
|
+
`;
|
|
2800
3449
|
const Arrow = react.forwardRef(function Arrow2(props, ref) {
|
|
2801
3450
|
const { width: w, height: h, radius = 0, ...restProps } = props;
|
|
2802
3451
|
const { card } = useTheme_v2();
|
|
@@ -2829,9 +3478,9 @@ const Arrow = react.forwardRef(function Arrow2(props, ref) {
|
|
|
2829
3478
|
];
|
|
2830
3479
|
const cmds = getRoundedCommands(points);
|
|
2831
3480
|
const path = compileCommands(cmds);
|
|
2832
|
-
const strokePath =
|
|
2833
|
-
const fillPath =
|
|
2834
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Root$k, { ...restProps, $w: w, ref, children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: w, height: w, viewBox:
|
|
3481
|
+
const strokePath = `${path}`;
|
|
3482
|
+
const fillPath = `${path} M ${w} -1 M 0 -1 Z`;
|
|
3483
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Root$k, { ...restProps, $w: w, ref, children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: w, height: w, viewBox: `0 0 ${w} ${w}`, children: [
|
|
2835
3484
|
/* @__PURE__ */ jsxRuntime.jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: strokeWidth, width: w, height: w, fill: "white" }) }),
|
|
2836
3485
|
/* @__PURE__ */ jsxRuntime.jsx(StrokePath, { d: strokePath, mask: "url(#stroke-mask)", strokeWidth: strokeWidth * 2 }),
|
|
2837
3486
|
/* @__PURE__ */ jsxRuntime.jsx(ShapePath, { d: fillPath })
|
|
@@ -2902,10 +3551,7 @@ const ElementQuery = react.forwardRef(function ElementQuery2(props, ref) {
|
|
|
2902
3551
|
const forwardedRef = useForwardedRef(ref);
|
|
2903
3552
|
const [element, setElement] = react.useState(null);
|
|
2904
3553
|
const elementSize = useElementSize(element);
|
|
2905
|
-
const width = react.useMemo(() =>
|
|
2906
|
-
var _a;
|
|
2907
|
-
return (_a = elementSize == null ? void 0 : elementSize.border.width) != null ? _a : window.innerWidth;
|
|
2908
|
-
}, [elementSize]);
|
|
3554
|
+
const width = react.useMemo(() => (elementSize == null ? void 0 : elementSize.border.width) ?? window.innerWidth, [elementSize]);
|
|
2909
3555
|
const max = react.useMemo(() => findMaxBreakpoints(media, width), [media, width]);
|
|
2910
3556
|
const min = react.useMemo(() => findMinBreakpoints(media, width), [media, width]);
|
|
2911
3557
|
const setRef = react.useCallback(
|
|
@@ -2928,17 +3574,8 @@ const ElementQuery = react.forwardRef(function ElementQuery2(props, ref) {
|
|
|
2928
3574
|
);
|
|
2929
3575
|
});
|
|
2930
3576
|
|
|
2931
|
-
var __defProp$p = Object.defineProperty;
|
|
2932
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2933
|
-
var __publicField = (obj, key, value) => {
|
|
2934
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2935
|
-
return value;
|
|
2936
|
-
};
|
|
2937
3577
|
class ErrorBoundary extends react.Component {
|
|
2938
|
-
|
|
2939
|
-
super(...arguments);
|
|
2940
|
-
__publicField(this, "state", { error: null });
|
|
2941
|
-
}
|
|
3578
|
+
state = { error: null };
|
|
2942
3579
|
static getDerivedStateFromError(error) {
|
|
2943
3580
|
return { error };
|
|
2944
3581
|
}
|
|
@@ -2981,9 +3618,9 @@ function useLayer() {
|
|
|
2981
3618
|
return getLayerContext(value);
|
|
2982
3619
|
} catch (err) {
|
|
2983
3620
|
if (err instanceof Error) {
|
|
2984
|
-
throw new Error(
|
|
3621
|
+
throw new Error(`useLayer(): ${err.message}`);
|
|
2985
3622
|
} else {
|
|
2986
|
-
throw new Error(
|
|
3623
|
+
throw new Error(`useLayer(): ${err}`);
|
|
2987
3624
|
}
|
|
2988
3625
|
}
|
|
2989
3626
|
}
|
|
@@ -3086,12 +3723,11 @@ function _isScrollable(el) {
|
|
|
3086
3723
|
}
|
|
3087
3724
|
|
|
3088
3725
|
function LayerProvider(props) {
|
|
3089
|
-
var _a;
|
|
3090
3726
|
const { children, zOffset: zOffsetProp = 0 } = props;
|
|
3091
3727
|
const parentContextValue = react.useContext(LayerContext);
|
|
3092
3728
|
const parent = parentContextValue && getLayerContext(parentContextValue);
|
|
3093
3729
|
const parentRegisterChild = parent == null ? void 0 : parent.registerChild;
|
|
3094
|
-
const parentLevel = (
|
|
3730
|
+
const parentLevel = (parent == null ? void 0 : parent.level) ?? 0;
|
|
3095
3731
|
const level = parentLevel + 1;
|
|
3096
3732
|
const zOffset = useArrayProp(zOffsetProp);
|
|
3097
3733
|
const maxMediaIndex = zOffset.length - 1;
|
|
@@ -3105,8 +3741,7 @@ function LayerProvider(props) {
|
|
|
3105
3741
|
const parentDispose = parentRegisterChild == null ? void 0 : parentRegisterChild(childLevel);
|
|
3106
3742
|
if (childLevel !== void 0) {
|
|
3107
3743
|
setChildLayers((state) => {
|
|
3108
|
-
|
|
3109
|
-
const prevLen = (_a2 = state[childLevel]) != null ? _a2 : 0;
|
|
3744
|
+
const prevLen = state[childLevel] ?? 0;
|
|
3110
3745
|
const nextState = { ...state, [childLevel]: prevLen + 1 };
|
|
3111
3746
|
setSize(Object.keys(nextState).length);
|
|
3112
3747
|
return nextState;
|
|
@@ -3271,22 +3906,27 @@ function PortalProvider(props) {
|
|
|
3271
3906
|
return /* @__PURE__ */ jsxRuntime.jsx(PortalContext.Provider, { value, children });
|
|
3272
3907
|
}
|
|
3273
3908
|
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3909
|
+
const Root$i = styled__default.default.div`
|
|
3910
|
+
display: block;
|
|
3911
|
+
width: 0;
|
|
3912
|
+
height: 0;
|
|
3913
|
+
position: absolute;
|
|
3914
|
+
overflow: hidden;
|
|
3915
|
+
overflow: clip;
|
|
3916
|
+
`;
|
|
3279
3917
|
const SrOnly = react.forwardRef(function SrOnly2(props, ref) {
|
|
3280
3918
|
const { as, children } = props;
|
|
3281
3919
|
return /* @__PURE__ */ jsxRuntime.jsx(Root$i, { "aria-hidden": true, as, "data-ui": "SrOnly", ref, children });
|
|
3282
3920
|
});
|
|
3283
3921
|
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3922
|
+
const Root$h = styled__default.default.div`
|
|
3923
|
+
position: relative;
|
|
3924
|
+
`;
|
|
3925
|
+
const ItemWrapper = styled__default.default.div`
|
|
3926
|
+
position: absolute;
|
|
3927
|
+
left: 0;
|
|
3928
|
+
right: 0;
|
|
3929
|
+
`;
|
|
3290
3930
|
const VirtualList = react.forwardRef(function VirtualList2(props, ref) {
|
|
3291
3931
|
const { as = "div", gap = 0, getItemKey, items = [], onChange, renderItem, ...restProps } = props;
|
|
3292
3932
|
const { space } = useTheme_v2();
|
|
@@ -3454,16 +4094,23 @@ function calcMaxWidth(params) {
|
|
|
3454
4094
|
return void 0;
|
|
3455
4095
|
}
|
|
3456
4096
|
return Math.min(
|
|
3457
|
-
currentWidth
|
|
4097
|
+
currentWidth ?? Infinity,
|
|
3458
4098
|
(boundaryWidth || Infinity) - DEFAULT_POPOVER_PADDING * 2
|
|
3459
4099
|
);
|
|
3460
4100
|
}
|
|
3461
4101
|
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
4102
|
+
const MotionCard$1 = styled__default.default(framerMotion.motion(Card))`
|
|
4103
|
+
&:not([hidden]) {
|
|
4104
|
+
display: flex;
|
|
4105
|
+
}
|
|
4106
|
+
flex-direction: column;
|
|
4107
|
+
width: max-content;
|
|
4108
|
+
min-width: min-content;
|
|
4109
|
+
& > * {
|
|
4110
|
+
opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
|
|
4111
|
+
will-change: opacity;
|
|
4112
|
+
}
|
|
4113
|
+
`;
|
|
3467
4114
|
const PopoverCard = react.memo(
|
|
3468
4115
|
react.forwardRef(function PopoverCard2(props, ref) {
|
|
3469
4116
|
const {
|
|
@@ -3495,8 +4142,8 @@ const PopoverCard = react.memo(
|
|
|
3495
4142
|
() => marginsProp || DEFAULT_POPOVER_MARGINS,
|
|
3496
4143
|
[marginsProp]
|
|
3497
4144
|
);
|
|
3498
|
-
const x = (xProp
|
|
3499
|
-
const y = (yProp
|
|
4145
|
+
const x = (xProp ?? 0) + margins[3];
|
|
4146
|
+
const y = (yProp ?? 0) + margins[0];
|
|
3500
4147
|
const rootStyle = react.useMemo(
|
|
3501
4148
|
() => ({
|
|
3502
4149
|
left: x,
|
|
@@ -3555,7 +4202,7 @@ PopoverCard.displayName = "PopoverCard";
|
|
|
3555
4202
|
|
|
3556
4203
|
const Popover = react.memo(
|
|
3557
4204
|
react.forwardRef(function Popover2(props, ref) {
|
|
3558
|
-
var _a, _b, _c, _d, _e, _f
|
|
4205
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3559
4206
|
const { container, layer } = useTheme_v2();
|
|
3560
4207
|
const boundaryElementContext = useBoundaryElement();
|
|
3561
4208
|
const {
|
|
@@ -3567,9 +4214,9 @@ const Popover = react.memo(
|
|
|
3567
4214
|
constrainSize = false,
|
|
3568
4215
|
content,
|
|
3569
4216
|
disabled,
|
|
3570
|
-
fallbackPlacements =
|
|
4217
|
+
fallbackPlacements = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"],
|
|
3571
4218
|
matchReferenceWidth,
|
|
3572
|
-
floatingBoundary =
|
|
4219
|
+
floatingBoundary = props.boundaryElement ?? boundaryElementContext.element,
|
|
3573
4220
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3574
4221
|
onActivate,
|
|
3575
4222
|
open,
|
|
@@ -3579,7 +4226,7 @@ const Popover = react.memo(
|
|
|
3579
4226
|
portal,
|
|
3580
4227
|
preventOverflow = true,
|
|
3581
4228
|
radius: radiusProp = 3,
|
|
3582
|
-
referenceBoundary =
|
|
4229
|
+
referenceBoundary = props.boundaryElement ?? boundaryElementContext.element,
|
|
3583
4230
|
referenceElement,
|
|
3584
4231
|
scheme,
|
|
3585
4232
|
shadow: shadowProp = 3,
|
|
@@ -3591,7 +4238,7 @@ const Popover = react.memo(
|
|
|
3591
4238
|
} = props;
|
|
3592
4239
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
3593
4240
|
const animate = prefersReducedMotion ? false : _animate;
|
|
3594
|
-
const boundarySize = (
|
|
4241
|
+
const boundarySize = (_a = useElementSize(boundaryElement)) == null ? void 0 : _a.border;
|
|
3595
4242
|
const padding = useArrayProp(paddingProp);
|
|
3596
4243
|
const radius = useArrayProp(radiusProp);
|
|
3597
4244
|
const shadow = useArrayProp(shadowProp);
|
|
@@ -3624,13 +4271,13 @@ const Popover = react.memo(
|
|
|
3624
4271
|
const referenceWidth = referenceWidthRef.current;
|
|
3625
4272
|
if (matchReferenceWidth) {
|
|
3626
4273
|
if (referenceWidth !== void 0) {
|
|
3627
|
-
floatingElement.style.width =
|
|
4274
|
+
floatingElement.style.width = `${referenceWidth}px`;
|
|
3628
4275
|
}
|
|
3629
4276
|
} else if (width !== void 0) {
|
|
3630
|
-
floatingElement.style.width =
|
|
4277
|
+
floatingElement.style.width = `${width}px`;
|
|
3631
4278
|
}
|
|
3632
4279
|
if (typeof maxWidth === "number") {
|
|
3633
|
-
floatingElement.style.maxWidth =
|
|
4280
|
+
floatingElement.style.maxWidth = `${maxWidth}px`;
|
|
3634
4281
|
}
|
|
3635
4282
|
}, [width, forwardedRef, matchReferenceWidth, maxWidth, open]);
|
|
3636
4283
|
const middleware = react.useMemo(() => {
|
|
@@ -3654,16 +4301,16 @@ const Popover = react.memo(
|
|
|
3654
4301
|
const _currentWidth = widthRef.current;
|
|
3655
4302
|
const _maxWidth = maxWidthRef.current;
|
|
3656
4303
|
if (matchReferenceWidth) {
|
|
3657
|
-
elements.floating.style.width =
|
|
4304
|
+
elements.floating.style.width = `${referenceWidth}px`;
|
|
3658
4305
|
} else if (_currentWidth !== void 0) {
|
|
3659
|
-
elements.floating.style.width =
|
|
4306
|
+
elements.floating.style.width = `${_currentWidth}px`;
|
|
3660
4307
|
}
|
|
3661
4308
|
if (constrainSize) {
|
|
3662
|
-
elements.floating.style.maxWidth =
|
|
4309
|
+
elements.floating.style.maxWidth = `${Math.min(
|
|
3663
4310
|
availableWidth,
|
|
3664
|
-
_maxWidth
|
|
3665
|
-
)
|
|
3666
|
-
elements.floating.style.maxHeight =
|
|
4311
|
+
_maxWidth ?? Infinity
|
|
4312
|
+
)}px`;
|
|
4313
|
+
elements.floating.style.maxHeight = `${availableHeight}px`;
|
|
3667
4314
|
}
|
|
3668
4315
|
},
|
|
3669
4316
|
boundaryElement: floatingBoundary || void 0,
|
|
@@ -3718,11 +4365,11 @@ const Popover = react.memo(
|
|
|
3718
4365
|
placement: placementProp,
|
|
3719
4366
|
whileElementsMounted: reactDom$1.autoUpdate
|
|
3720
4367
|
});
|
|
3721
|
-
const referenceHidden = (
|
|
3722
|
-
const arrowX = (
|
|
3723
|
-
const arrowY = (
|
|
3724
|
-
const originX = (
|
|
3725
|
-
const originY = (
|
|
4368
|
+
const referenceHidden = (_b = middlewareData.hide) == null ? void 0 : _b.referenceHidden;
|
|
4369
|
+
const arrowX = (_c = middlewareData.arrow) == null ? void 0 : _c.x;
|
|
4370
|
+
const arrowY = (_d = middlewareData.arrow) == null ? void 0 : _d.y;
|
|
4371
|
+
const originX = (_e = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _e.originX;
|
|
4372
|
+
const originY = (_f = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _f.originY;
|
|
3726
4373
|
const setArrow = react.useCallback((arrowEl) => {
|
|
3727
4374
|
arrowRef.current = arrowEl;
|
|
3728
4375
|
}, []);
|
|
@@ -3817,29 +4464,114 @@ const Popover = react.memo(
|
|
|
3817
4464
|
);
|
|
3818
4465
|
Popover.displayName = "Popover";
|
|
3819
4466
|
|
|
3820
|
-
var __freeze$l = Object.freeze;
|
|
3821
|
-
var __defProp$l = Object.defineProperty;
|
|
3822
|
-
var __template$l = (cooked, raw) => __freeze$l(__defProp$l(cooked, "raw", { value: __freeze$l(raw || cooked.slice()) }));
|
|
3823
|
-
var _a$l, _b$d;
|
|
3824
4467
|
function radioBaseStyle() {
|
|
3825
|
-
return styled.css
|
|
4468
|
+
return styled.css`
|
|
4469
|
+
position: relative;
|
|
4470
|
+
|
|
4471
|
+
&:not([hidden]) {
|
|
4472
|
+
display: inline-block;
|
|
4473
|
+
}
|
|
4474
|
+
|
|
4475
|
+
&[data-read-only] {
|
|
4476
|
+
outline: 1px solid red;
|
|
4477
|
+
}
|
|
4478
|
+
`;
|
|
3826
4479
|
}
|
|
3827
4480
|
function inputElementStyle(props) {
|
|
3828
4481
|
const { color, input } = theme.getTheme_v2(props.theme);
|
|
3829
4482
|
const dist = (input.radio.size - input.radio.markSize) / 2;
|
|
3830
|
-
return styled.css
|
|
4483
|
+
return styled.css`
|
|
4484
|
+
appearance: none;
|
|
4485
|
+
position: absolute;
|
|
4486
|
+
top: 0;
|
|
4487
|
+
left: 0;
|
|
4488
|
+
opacity: 0;
|
|
4489
|
+
height: 100%;
|
|
4490
|
+
width: 100%;
|
|
4491
|
+
outline: none;
|
|
4492
|
+
z-index: 1;
|
|
4493
|
+
padding: 0;
|
|
4494
|
+
margin: 0;
|
|
4495
|
+
border-radius: ${rem(input.radio.size / 2)};
|
|
4496
|
+
border: none;
|
|
4497
|
+
|
|
4498
|
+
/* enabled */
|
|
4499
|
+
& + span {
|
|
4500
|
+
display: block;
|
|
4501
|
+
position: relative;
|
|
4502
|
+
height: ${rem(input.radio.size)};
|
|
4503
|
+
width: ${rem(input.radio.size)};
|
|
4504
|
+
border-radius: ${rem(input.radio.size / 2)};
|
|
4505
|
+
background: ${color.input.default.enabled.bg};
|
|
4506
|
+
box-shadow: ${focusRingBorderStyle({
|
|
3831
4507
|
color: color.input.default.enabled.border,
|
|
3832
4508
|
width: input.border.width
|
|
3833
|
-
})
|
|
4509
|
+
})};
|
|
4510
|
+
|
|
4511
|
+
&::after {
|
|
4512
|
+
content: '';
|
|
4513
|
+
position: absolute;
|
|
4514
|
+
top: ${rem(dist)};
|
|
4515
|
+
left: ${rem(dist)};
|
|
4516
|
+
height: ${rem(input.radio.markSize)};
|
|
4517
|
+
width: ${rem(input.radio.markSize)};
|
|
4518
|
+
border-radius: ${rem(input.radio.markSize / 2)};
|
|
4519
|
+
background: ${color.input.default.enabled.fg};
|
|
4520
|
+
opacity: 0;
|
|
4521
|
+
}
|
|
4522
|
+
}
|
|
4523
|
+
|
|
4524
|
+
/* focused */
|
|
4525
|
+
&:not(:disabled):focus + span {
|
|
4526
|
+
box-shadow: ${focusRingStyle({
|
|
3834
4527
|
border: { width: input.border.width, color: color.input.default.enabled.border },
|
|
3835
4528
|
focusRing: input.radio.focusRing
|
|
3836
|
-
})
|
|
4529
|
+
})};
|
|
4530
|
+
}
|
|
4531
|
+
|
|
4532
|
+
&:not(:disabled):focus:not(:focus-visible) + span {
|
|
4533
|
+
box-shadow: ${focusRingBorderStyle({
|
|
3837
4534
|
color: color.input.default.enabled.border,
|
|
3838
4535
|
width: input.border.width
|
|
3839
|
-
})
|
|
4536
|
+
})};
|
|
4537
|
+
}
|
|
4538
|
+
|
|
4539
|
+
&:checked + span::after {
|
|
4540
|
+
opacity: 1;
|
|
4541
|
+
}
|
|
4542
|
+
|
|
4543
|
+
/* customValidity */
|
|
4544
|
+
&[data-error] + span {
|
|
4545
|
+
background-color: ${color.input.invalid.enabled.border};
|
|
4546
|
+
box-shadow: ${focusRingBorderStyle({
|
|
3840
4547
|
width: input.border.width,
|
|
3841
4548
|
color: color.input.invalid.enabled.muted.bg
|
|
3842
|
-
})
|
|
4549
|
+
})};
|
|
4550
|
+
&::after {
|
|
4551
|
+
background: ${color.input.invalid.enabled.muted.bg};
|
|
4552
|
+
}
|
|
4553
|
+
}
|
|
4554
|
+
|
|
4555
|
+
/* read only */
|
|
4556
|
+
&[data-read-only] + span {
|
|
4557
|
+
box-shadow: 0 0 0 1px ${color.input.default.readOnly.border};
|
|
4558
|
+
background: ${color.input.default.readOnly.bg};
|
|
4559
|
+
|
|
4560
|
+
&::after {
|
|
4561
|
+
background: ${color.input.default.readOnly.border};
|
|
4562
|
+
}
|
|
4563
|
+
}
|
|
4564
|
+
|
|
4565
|
+
/* disabled */
|
|
4566
|
+
&:not([data-read-only]):disabled + span {
|
|
4567
|
+
box-shadow: 0 0 0 1px ${color.input.default.disabled.border};
|
|
4568
|
+
background: ${color.input.default.disabled.bg};
|
|
4569
|
+
|
|
4570
|
+
&::after {
|
|
4571
|
+
background: ${color.input.default.disabled.border};
|
|
4572
|
+
}
|
|
4573
|
+
}
|
|
4574
|
+
`;
|
|
3843
4575
|
}
|
|
3844
4576
|
|
|
3845
4577
|
const Root$g = styled__default.default.div(radioBaseStyle);
|
|
@@ -3865,35 +4597,86 @@ const Radio = react.forwardRef(function Radio2(props, forwardedRef) {
|
|
|
3865
4597
|
] });
|
|
3866
4598
|
});
|
|
3867
4599
|
|
|
3868
|
-
var __freeze$k = Object.freeze;
|
|
3869
|
-
var __defProp$k = Object.defineProperty;
|
|
3870
|
-
var __template$k = (cooked, raw) => __freeze$k(__defProp$k(cooked, "raw", { value: __freeze$k(raw || cooked.slice()) }));
|
|
3871
|
-
var _a$k, _b$c, _c$6, _d$5;
|
|
3872
4600
|
function rootStyle() {
|
|
3873
|
-
return styled.css
|
|
4601
|
+
return styled.css`
|
|
4602
|
+
position: relative;
|
|
4603
|
+
width: -moz-available;
|
|
4604
|
+
width: -webkit-fill-available;
|
|
4605
|
+
width: stretch;
|
|
4606
|
+
|
|
4607
|
+
&:not([hidden]) {
|
|
4608
|
+
display: inline-block;
|
|
4609
|
+
}
|
|
4610
|
+
`;
|
|
3874
4611
|
}
|
|
3875
4612
|
function inputBaseStyle(props) {
|
|
3876
4613
|
const { font } = theme.getTheme_v2(props.theme);
|
|
3877
|
-
return styled.css
|
|
4614
|
+
return styled.css`
|
|
4615
|
+
-webkit-font-smoothing: antialiased;
|
|
4616
|
+
appearance: none;
|
|
4617
|
+
border: 0;
|
|
4618
|
+
font-family: ${font.text.family};
|
|
4619
|
+
color: inherit;
|
|
4620
|
+
width: 100%;
|
|
4621
|
+
outline: none;
|
|
4622
|
+
margin: 0;
|
|
4623
|
+
|
|
4624
|
+
&:disabled {
|
|
4625
|
+
opacity: 1;
|
|
4626
|
+
}
|
|
4627
|
+
`;
|
|
3878
4628
|
}
|
|
3879
4629
|
function inputColorStyle(props) {
|
|
3880
4630
|
const { color, input } = theme.getTheme_v2(props.theme);
|
|
3881
|
-
return styled.css
|
|
4631
|
+
return styled.css`
|
|
4632
|
+
/* enabled */
|
|
4633
|
+
background-color: ${color.input.default.enabled.bg};
|
|
4634
|
+
color: ${color.input.default.enabled.fg};
|
|
4635
|
+
box-shadow: ${focusRingBorderStyle({
|
|
3882
4636
|
color: color.input.default.enabled.border,
|
|
3883
4637
|
width: input.border.width
|
|
3884
|
-
})
|
|
4638
|
+
})};
|
|
4639
|
+
|
|
4640
|
+
/* hovered */
|
|
4641
|
+
@media (hover: hover) {
|
|
4642
|
+
&:not(:disabled):hover {
|
|
4643
|
+
background-color: ${color.input.default.hovered.bg};
|
|
4644
|
+
color: ${color.input.default.hovered.fg};
|
|
4645
|
+
box-shadow: ${focusRingBorderStyle({
|
|
3885
4646
|
color: color.input.default.hovered.border,
|
|
3886
4647
|
width: input.border.width
|
|
3887
|
-
})
|
|
4648
|
+
})};
|
|
4649
|
+
}
|
|
4650
|
+
}
|
|
4651
|
+
|
|
4652
|
+
/* focused */
|
|
4653
|
+
&:not(:disabled):focus {
|
|
4654
|
+
box-shadow: ${focusRingStyle({
|
|
3888
4655
|
border: { width: input.border.width, color: color.input.default.enabled.border },
|
|
3889
4656
|
focusRing: input.select.focusRing
|
|
3890
|
-
})
|
|
4657
|
+
})};
|
|
4658
|
+
}
|
|
4659
|
+
|
|
4660
|
+
/* read-only */
|
|
4661
|
+
&[data-read-only] {
|
|
4662
|
+
background-color: ${color.input.default.readOnly.bg};
|
|
4663
|
+
color: ${color.input.default.readOnly.fg};
|
|
4664
|
+
box-shadow: ${focusRingBorderStyle({
|
|
3891
4665
|
color: color.input.default.readOnly.border,
|
|
3892
4666
|
width: input.border.width
|
|
3893
|
-
})
|
|
4667
|
+
})};
|
|
4668
|
+
}
|
|
4669
|
+
|
|
4670
|
+
/* disabled */
|
|
4671
|
+
&:not([data-read-only]):disabled {
|
|
4672
|
+
background-color: ${color.input.default.disabled.bg};
|
|
4673
|
+
color: ${color.input.default.disabled.fg};
|
|
4674
|
+
box-shadow: ${focusRingBorderStyle({
|
|
3894
4675
|
color: color.input.default.disabled.border,
|
|
3895
4676
|
width: input.border.width
|
|
3896
|
-
})
|
|
4677
|
+
})};
|
|
4678
|
+
}
|
|
4679
|
+
`;
|
|
3897
4680
|
}
|
|
3898
4681
|
function textSize(size) {
|
|
3899
4682
|
return { fontSize: rem(size.fontSize), lineHeight: rem(size.lineHeight) };
|
|
@@ -3918,7 +4701,32 @@ function inputStyle() {
|
|
|
3918
4701
|
}
|
|
3919
4702
|
function iconBoxStyle(props) {
|
|
3920
4703
|
const { color } = theme.getTheme_v2(props.theme);
|
|
3921
|
-
return styled.css
|
|
4704
|
+
return styled.css`
|
|
4705
|
+
pointer-events: none;
|
|
4706
|
+
position: absolute;
|
|
4707
|
+
top: 0;
|
|
4708
|
+
right: 0;
|
|
4709
|
+
|
|
4710
|
+
/* enabled */
|
|
4711
|
+
--card-fg-color: ${color.input.default.enabled.fg};
|
|
4712
|
+
|
|
4713
|
+
/* hover */
|
|
4714
|
+
@media (hover: hover) {
|
|
4715
|
+
select:not(disabled):not(:read-only):hover + && {
|
|
4716
|
+
--card-fg-color: ${color.input.default.hovered.fg};
|
|
4717
|
+
}
|
|
4718
|
+
}
|
|
4719
|
+
|
|
4720
|
+
/* disabled */
|
|
4721
|
+
select:disabled + && {
|
|
4722
|
+
--card-fg-color: ${color.input.default.disabled.fg};
|
|
4723
|
+
}
|
|
4724
|
+
|
|
4725
|
+
/* read-only */
|
|
4726
|
+
select[data-read-only] + && {
|
|
4727
|
+
--card-fg-color: ${color.input.default.readOnly.fg};
|
|
4728
|
+
}
|
|
4729
|
+
`;
|
|
3922
4730
|
}
|
|
3923
4731
|
const selectStyle = {
|
|
3924
4732
|
root: rootStyle,
|
|
@@ -3999,23 +4807,119 @@ const Stack = react.forwardRef(function Stack2(props, ref) {
|
|
|
3999
4807
|
);
|
|
4000
4808
|
});
|
|
4001
4809
|
|
|
4002
|
-
var __freeze$j = Object.freeze;
|
|
4003
|
-
var __defProp$j = Object.defineProperty;
|
|
4004
|
-
var __template$j = (cooked, raw) => __freeze$j(__defProp$j(cooked, "raw", { value: __freeze$j(raw || cooked.slice()) }));
|
|
4005
|
-
var _a$j, _b$b, _c$5, _d$4, _e$2, _f$2, _g;
|
|
4006
4810
|
function switchBaseStyles() {
|
|
4007
|
-
return styled.css
|
|
4811
|
+
return styled.css`
|
|
4812
|
+
position: relative;
|
|
4813
|
+
&:not([hidden]) {
|
|
4814
|
+
display: inline-block;
|
|
4815
|
+
}
|
|
4816
|
+
`;
|
|
4008
4817
|
}
|
|
4009
4818
|
function switchInputStyles() {
|
|
4010
|
-
return styled.css
|
|
4819
|
+
return styled.css`
|
|
4820
|
+
position: absolute;
|
|
4821
|
+
top: 0;
|
|
4822
|
+
right: 0;
|
|
4823
|
+
bottom: 0;
|
|
4824
|
+
left: 0;
|
|
4825
|
+
opacity: 0;
|
|
4826
|
+
height: 100%;
|
|
4827
|
+
width: 100%;
|
|
4828
|
+
outline: none;
|
|
4829
|
+
padding: 0;
|
|
4830
|
+
margin: 0;
|
|
4831
|
+
|
|
4832
|
+
/* Place the input element above the representation element */
|
|
4833
|
+
z-index: 1;
|
|
4834
|
+
`;
|
|
4011
4835
|
}
|
|
4012
4836
|
function switchRepresentationStyles(props) {
|
|
4013
4837
|
const { color, input } = theme.getTheme_v2(props.theme);
|
|
4014
|
-
return styled.css
|
|
4838
|
+
return styled.css`
|
|
4839
|
+
--switch-bg-color: ${color.input.default.enabled.border};
|
|
4840
|
+
--switch-fg-color: ${color.input.default.enabled.bg};
|
|
4841
|
+
--switch-box-shadow: none;
|
|
4842
|
+
|
|
4843
|
+
&:not([hidden]) {
|
|
4844
|
+
display: block;
|
|
4845
|
+
}
|
|
4846
|
+
position: relative;
|
|
4847
|
+
width: ${rem(input.switch.width)};
|
|
4848
|
+
height: ${rem(input.switch.height)};
|
|
4849
|
+
border-radius: ${rem(input.switch.height / 2)};
|
|
4850
|
+
|
|
4851
|
+
/* Make sure it’s not possible to interact with the wrapper element */
|
|
4852
|
+
pointer-events: none;
|
|
4853
|
+
|
|
4854
|
+
&:after {
|
|
4855
|
+
content: '';
|
|
4856
|
+
display: block;
|
|
4857
|
+
position: absolute;
|
|
4858
|
+
top: 0;
|
|
4859
|
+
left: 0;
|
|
4860
|
+
right: 0;
|
|
4861
|
+
bottom: 0;
|
|
4862
|
+
z-index: 1;
|
|
4863
|
+
box-shadow: var(--switch-box-shadow);
|
|
4864
|
+
border-radius: inherit;
|
|
4865
|
+
}
|
|
4866
|
+
|
|
4867
|
+
/* Focus styles */
|
|
4868
|
+
input:focus + && {
|
|
4869
|
+
--switch-box-shadow: ${focusRingStyle({ focusRing: input.switch.focusRing })};
|
|
4870
|
+
}
|
|
4871
|
+
|
|
4872
|
+
input:focus:not(:focus-visible) + && {
|
|
4873
|
+
--switch-box-shadow: none;
|
|
4874
|
+
}
|
|
4875
|
+
|
|
4876
|
+
input:checked + && {
|
|
4877
|
+
--switch-bg-color: ${color.input.default.enabled.fg};
|
|
4878
|
+
--switch-fg-color: ${color.input.default.enabled.bg};
|
|
4879
|
+
}
|
|
4880
|
+
|
|
4881
|
+
@media (hover: hover) {
|
|
4882
|
+
input:not(:disabled):hover + && {
|
|
4883
|
+
--switch-bg-color: ${color.input.default.hovered.border};
|
|
4884
|
+
--switch-fg-color: ${color.input.default.hovered.bg};
|
|
4885
|
+
}
|
|
4886
|
+
|
|
4887
|
+
input:not(:disabled):checked:hover + && {
|
|
4888
|
+
--switch-bg-color: ${color.input.default.enabled.fg};
|
|
4889
|
+
--switch-fg-color: ${color.input.default.enabled.bg};
|
|
4890
|
+
}
|
|
4891
|
+
}
|
|
4892
|
+
|
|
4893
|
+
input:not([data-read-only]):disabled + && {
|
|
4894
|
+
--switch-bg-color: ${color.input.default.disabled.border};
|
|
4895
|
+
--switch-fg-color: ${color.input.default.disabled.bg};
|
|
4896
|
+
}
|
|
4897
|
+
|
|
4898
|
+
input[data-read-only]:disabled + && {
|
|
4899
|
+
--switch-bg-color: ${color.input.default.readOnly.border};
|
|
4900
|
+
--switch-fg-color: ${color.input.default.readOnly.bg};
|
|
4901
|
+
}
|
|
4902
|
+
|
|
4903
|
+
input:checked[data-read-only]:disabled + && {
|
|
4904
|
+
--switch-bg-color: ${color.input.default.readOnly.fg};
|
|
4905
|
+
--switch-fg-color: ${color.input.default.readOnly.bg};
|
|
4906
|
+
}
|
|
4907
|
+
`;
|
|
4015
4908
|
}
|
|
4016
4909
|
function switchTrackStyles(props) {
|
|
4017
4910
|
const { input } = theme.getTheme_v2(props.theme);
|
|
4018
|
-
return styled.css
|
|
4911
|
+
return styled.css`
|
|
4912
|
+
&:not([hidden]) {
|
|
4913
|
+
display: block;
|
|
4914
|
+
}
|
|
4915
|
+
background-color: var(--switch-bg-color);
|
|
4916
|
+
position: absolute;
|
|
4917
|
+
left: 0;
|
|
4918
|
+
top: 0;
|
|
4919
|
+
width: ${rem(input.switch.width)};
|
|
4920
|
+
height: ${rem(input.switch.height)};
|
|
4921
|
+
border-radius: ${rem(input.switch.height / 2)};
|
|
4922
|
+
`;
|
|
4019
4923
|
}
|
|
4020
4924
|
function switchThumbStyles(props) {
|
|
4021
4925
|
const { $indeterminate } = props;
|
|
@@ -4027,7 +4931,31 @@ function switchThumbStyles(props) {
|
|
|
4027
4931
|
const checkedOffset = trackWidth - trackPadding * 2 - size;
|
|
4028
4932
|
const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding;
|
|
4029
4933
|
const checked = $indeterminate !== true && props.$checked === true;
|
|
4030
|
-
return styled.css
|
|
4934
|
+
return styled.css`
|
|
4935
|
+
&:not([hidden]) {
|
|
4936
|
+
display: block;
|
|
4937
|
+
}
|
|
4938
|
+
position: absolute;
|
|
4939
|
+
left: ${rem(trackPadding)};
|
|
4940
|
+
top: ${rem(trackPadding)};
|
|
4941
|
+
height: ${rem(size)};
|
|
4942
|
+
width: ${rem(size)};
|
|
4943
|
+
border-radius: ${rem(size / 2)};
|
|
4944
|
+
transition-property: transform;
|
|
4945
|
+
transition-duration: ${input.switch.transitionDurationMs}ms;
|
|
4946
|
+
transition-timing-function: ${input.switch.transitionTimingFunction};
|
|
4947
|
+
background: var(--switch-fg-color);
|
|
4948
|
+
transform: translate3d(0, 0, 0);
|
|
4949
|
+
box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.05);
|
|
4950
|
+
|
|
4951
|
+
${checked && styled.css`
|
|
4952
|
+
transform: translate3d(${checkedOffset}px, 0, 0);
|
|
4953
|
+
`}
|
|
4954
|
+
|
|
4955
|
+
${$indeterminate && styled.css`
|
|
4956
|
+
transform: translate3d(${indeterminateOffset}px, 0, 0);
|
|
4957
|
+
`}
|
|
4958
|
+
`;
|
|
4031
4959
|
}
|
|
4032
4960
|
|
|
4033
4961
|
const Root$d = styled__default.default.span(switchBaseStyles);
|
|
@@ -4062,12 +4990,13 @@ const Switch = react.forwardRef(function Switch2(props, forwardedRef) {
|
|
|
4062
4990
|
] });
|
|
4063
4991
|
});
|
|
4064
4992
|
|
|
4065
|
-
var __freeze$i = Object.freeze;
|
|
4066
|
-
var __defProp$i = Object.defineProperty;
|
|
4067
|
-
var __template$i = (cooked, raw) => __freeze$i(__defProp$i(cooked, "raw", { value: __freeze$i(raw || cooked.slice()) }));
|
|
4068
|
-
var _a$i;
|
|
4069
4993
|
const Root$c = styled__default.default.span(textInputRootStyle);
|
|
4070
|
-
const InputRoot$1 = styled__default.default.span
|
|
4994
|
+
const InputRoot$1 = styled__default.default.span`
|
|
4995
|
+
flex: 1;
|
|
4996
|
+
min-width: 0;
|
|
4997
|
+
display: block;
|
|
4998
|
+
position: relative;
|
|
4999
|
+
`;
|
|
4071
5000
|
const Input$1 = styled__default.default.textarea(
|
|
4072
5001
|
responsiveInputPaddingStyle,
|
|
4073
5002
|
textInputBaseStyle,
|
|
@@ -4123,15 +5052,32 @@ const TextArea = react.forwardRef(function TextArea2(props, forwardedRef) {
|
|
|
4123
5052
|
] }) });
|
|
4124
5053
|
});
|
|
4125
5054
|
|
|
4126
|
-
var __freeze$h = Object.freeze;
|
|
4127
|
-
var __defProp$h = Object.defineProperty;
|
|
4128
|
-
var __template$h = (cooked, raw) => __freeze$h(__defProp$h(cooked, "raw", { value: __freeze$h(raw || cooked.slice()) }));
|
|
4129
|
-
var _a$h, _b$a, _c$4, _d$3, _e$1, _f$1;
|
|
4130
5055
|
const CLEAR_BUTTON_BOX_STYLE = { zIndex: 2 };
|
|
4131
5056
|
const Root$b = styled__default.default(Card).attrs({ forwardedAs: "span" })(textInputRootStyle);
|
|
4132
|
-
const InputRoot = styled__default.default.span
|
|
4133
|
-
|
|
4134
|
-
|
|
5057
|
+
const InputRoot = styled__default.default.span`
|
|
5058
|
+
flex: 1;
|
|
5059
|
+
min-width: 0;
|
|
5060
|
+
display: block;
|
|
5061
|
+
position: relative;
|
|
5062
|
+
`;
|
|
5063
|
+
const Prefix = styled__default.default(Card).attrs({ forwardedAs: "span" })`
|
|
5064
|
+
border-top-right-radius: 0;
|
|
5065
|
+
border-bottom-right-radius: 0;
|
|
5066
|
+
|
|
5067
|
+
& > span {
|
|
5068
|
+
display: block;
|
|
5069
|
+
margin: -1px;
|
|
5070
|
+
}
|
|
5071
|
+
`;
|
|
5072
|
+
const Suffix = styled__default.default(Card).attrs({ forwardedAs: "span" })`
|
|
5073
|
+
border-top-left-radius: 0;
|
|
5074
|
+
border-bottom-left-radius: 0;
|
|
5075
|
+
|
|
5076
|
+
& > span {
|
|
5077
|
+
display: block;
|
|
5078
|
+
margin: -1px;
|
|
5079
|
+
}
|
|
5080
|
+
`;
|
|
4135
5081
|
const Input = styled__default.default.input(
|
|
4136
5082
|
responsiveInputPaddingStyle,
|
|
4137
5083
|
textInputBaseStyle,
|
|
@@ -4141,9 +5087,22 @@ const Presentation = styled__default.default.span(
|
|
|
4141
5087
|
responsiveRadiusStyle,
|
|
4142
5088
|
textInputRepresentationStyle
|
|
4143
5089
|
);
|
|
4144
|
-
const LeftBox = styled__default.default(Box)
|
|
4145
|
-
|
|
4146
|
-
|
|
5090
|
+
const LeftBox = styled__default.default(Box)`
|
|
5091
|
+
position: absolute;
|
|
5092
|
+
top: 0;
|
|
5093
|
+
left: 0;
|
|
5094
|
+
`;
|
|
5095
|
+
const RightBox = styled__default.default(Box)`
|
|
5096
|
+
position: absolute;
|
|
5097
|
+
top: 0;
|
|
5098
|
+
right: 0;
|
|
5099
|
+
`;
|
|
5100
|
+
const RightCard = styled__default.default(Card)`
|
|
5101
|
+
background-color: transparent;
|
|
5102
|
+
position: absolute;
|
|
5103
|
+
top: 0;
|
|
5104
|
+
right: 0;
|
|
5105
|
+
`;
|
|
4147
5106
|
const TextInputClearButton = styled__default.default(Button)({
|
|
4148
5107
|
"&:not([hidden])": {
|
|
4149
5108
|
display: "block"
|
|
@@ -4188,12 +5147,12 @@ const TextInput = react.forwardRef(function TextInput2(props, forwardedRef) {
|
|
|
4188
5147
|
}, []);
|
|
4189
5148
|
const handleClearClick = react.useCallback(
|
|
4190
5149
|
(event) => {
|
|
4191
|
-
var
|
|
5150
|
+
var _a;
|
|
4192
5151
|
event.preventDefault();
|
|
4193
5152
|
event.stopPropagation();
|
|
4194
5153
|
if (onClear)
|
|
4195
5154
|
onClear();
|
|
4196
|
-
(
|
|
5155
|
+
(_a = ref.current) == null ? void 0 : _a.focus();
|
|
4197
5156
|
},
|
|
4198
5157
|
[onClear, ref]
|
|
4199
5158
|
);
|
|
@@ -4380,11 +5339,12 @@ const DEFAULT_FALLBACK_PLACEMENTS = {
|
|
|
4380
5339
|
"right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
|
|
4381
5340
|
};
|
|
4382
5341
|
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
var
|
|
4386
|
-
|
|
4387
|
-
|
|
5342
|
+
const MotionCard = styled__default.default(framerMotion.motion(Card))`
|
|
5343
|
+
& > * {
|
|
5344
|
+
opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
|
|
5345
|
+
will-change: opacity;
|
|
5346
|
+
}
|
|
5347
|
+
`;
|
|
4388
5348
|
const TooltipCard = react.memo(
|
|
4389
5349
|
react.forwardRef(function TooltipCard2(props, ref) {
|
|
4390
5350
|
const {
|
|
@@ -4484,13 +5444,12 @@ function TooltipDelayGroupProvider(props) {
|
|
|
4484
5444
|
return /* @__PURE__ */ jsxRuntime.jsx(TooltipDelayGroupContext.Provider, { value, children });
|
|
4485
5445
|
}
|
|
4486
5446
|
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
const Root$a = styled__default.default(Layer)(_a$f || (_a$f = __template$f(["\n pointer-events: none;\n max-width: ", "px;\n"])), ({ $maxWidth }) => $maxWidth);
|
|
5447
|
+
const Root$a = styled__default.default(Layer)`
|
|
5448
|
+
pointer-events: none;
|
|
5449
|
+
max-width: ${({ $maxWidth }) => $maxWidth}px;
|
|
5450
|
+
`;
|
|
4492
5451
|
const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
4493
|
-
var
|
|
5452
|
+
var _a, _b, _c, _d, _e;
|
|
4494
5453
|
const boundaryElementContext = useBoundaryElement();
|
|
4495
5454
|
const { layer } = useTheme_v2();
|
|
4496
5455
|
const {
|
|
@@ -4500,7 +5459,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
4500
5459
|
children: childProp,
|
|
4501
5460
|
content,
|
|
4502
5461
|
disabled,
|
|
4503
|
-
fallbackPlacements: fallbackPlacementsProp =
|
|
5462
|
+
fallbackPlacements: fallbackPlacementsProp = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"],
|
|
4504
5463
|
padding = 2,
|
|
4505
5464
|
placement: placementProp = "bottom",
|
|
4506
5465
|
portal: portalProp,
|
|
@@ -4519,7 +5478,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
4519
5478
|
const arrowRef = react.useRef(null);
|
|
4520
5479
|
const rootBoundary = "viewport";
|
|
4521
5480
|
const portal = usePortal();
|
|
4522
|
-
const portalElement = typeof portalProp === "string" ? ((
|
|
5481
|
+
const portalElement = typeof portalProp === "string" ? ((_a = portal.elements) == null ? void 0 : _a[portalProp]) || null : portal.element;
|
|
4523
5482
|
const tooltipWidth = react.useMemo(() => {
|
|
4524
5483
|
const availableWidths = [
|
|
4525
5484
|
...boundaryElement ? [boundaryElement.offsetWidth] : [],
|
|
@@ -4558,10 +5517,10 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
4558
5517
|
placement: placementProp,
|
|
4559
5518
|
whileElementsMounted: reactDom$1.autoUpdate
|
|
4560
5519
|
});
|
|
4561
|
-
const arrowX = (
|
|
4562
|
-
const arrowY = (
|
|
4563
|
-
const originX = (
|
|
4564
|
-
const originY = (
|
|
5520
|
+
const arrowX = (_b = middlewareData.arrow) == null ? void 0 : _b.x;
|
|
5521
|
+
const arrowY = (_c = middlewareData.arrow) == null ? void 0 : _c.y;
|
|
5522
|
+
const originX = (_d = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _d.originX;
|
|
5523
|
+
const originY = (_e = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _e.originY;
|
|
4565
5524
|
const tooltipId = react.useId();
|
|
4566
5525
|
const [isOpen, setIsOpen] = useDelayedState(false);
|
|
4567
5526
|
const delayGroupContext = useTooltipDelayGroup();
|
|
@@ -4593,49 +5552,49 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
4593
5552
|
);
|
|
4594
5553
|
const handleBlur = react.useCallback(
|
|
4595
5554
|
(e) => {
|
|
4596
|
-
var
|
|
5555
|
+
var _a2, _b2;
|
|
4597
5556
|
handleIsOpenChange(false);
|
|
4598
|
-
(_b2 = (
|
|
5557
|
+
(_b2 = (_a2 = childProp == null ? void 0 : childProp.props) == null ? void 0 : _a2.onBlur) == null ? void 0 : _b2.call(_a2, e);
|
|
4599
5558
|
},
|
|
4600
5559
|
[childProp == null ? void 0 : childProp.props, handleIsOpenChange]
|
|
4601
5560
|
);
|
|
4602
5561
|
const handleClick = react.useCallback(
|
|
4603
5562
|
(e) => {
|
|
4604
|
-
var
|
|
5563
|
+
var _a2, _b2;
|
|
4605
5564
|
handleIsOpenChange(false, true);
|
|
4606
|
-
(_b2 = childProp == null ? void 0 : (
|
|
5565
|
+
(_b2 = childProp == null ? void 0 : (_a2 = childProp.props).onClick) == null ? void 0 : _b2.call(_a2, e);
|
|
4607
5566
|
},
|
|
4608
5567
|
[childProp == null ? void 0 : childProp.props, handleIsOpenChange]
|
|
4609
5568
|
);
|
|
4610
5569
|
const handleContextMenu = react.useCallback(
|
|
4611
5570
|
(e) => {
|
|
4612
|
-
var
|
|
5571
|
+
var _a2, _b2;
|
|
4613
5572
|
handleIsOpenChange(false, true);
|
|
4614
|
-
(_b2 = childProp == null ? void 0 : (
|
|
5573
|
+
(_b2 = childProp == null ? void 0 : (_a2 = childProp.props).onContextMenu) == null ? void 0 : _b2.call(_a2, e);
|
|
4615
5574
|
},
|
|
4616
5575
|
[childProp == null ? void 0 : childProp.props, handleIsOpenChange]
|
|
4617
5576
|
);
|
|
4618
5577
|
const handleFocus = react.useCallback(
|
|
4619
5578
|
(e) => {
|
|
4620
|
-
var
|
|
5579
|
+
var _a2, _b2;
|
|
4621
5580
|
handleIsOpenChange(true);
|
|
4622
|
-
(_b2 = (
|
|
5581
|
+
(_b2 = (_a2 = childProp == null ? void 0 : childProp.props) == null ? void 0 : _a2.onFocus) == null ? void 0 : _b2.call(_a2, e);
|
|
4623
5582
|
},
|
|
4624
5583
|
[childProp == null ? void 0 : childProp.props, handleIsOpenChange]
|
|
4625
5584
|
);
|
|
4626
5585
|
const handleMouseEnter = react.useCallback(
|
|
4627
5586
|
(e) => {
|
|
4628
|
-
var
|
|
5587
|
+
var _a2, _b2;
|
|
4629
5588
|
handleIsOpenChange(true);
|
|
4630
|
-
(_b2 = (
|
|
5589
|
+
(_b2 = (_a2 = childProp == null ? void 0 : childProp.props) == null ? void 0 : _a2.onMouseEnter) == null ? void 0 : _b2.call(_a2, e);
|
|
4631
5590
|
},
|
|
4632
5591
|
[childProp == null ? void 0 : childProp.props, handleIsOpenChange]
|
|
4633
5592
|
);
|
|
4634
5593
|
const handleMouseLeave = react.useCallback(
|
|
4635
5594
|
(e) => {
|
|
4636
|
-
var
|
|
5595
|
+
var _a2, _b2;
|
|
4637
5596
|
handleIsOpenChange(false);
|
|
4638
|
-
(_b2 = (
|
|
5597
|
+
(_b2 = (_a2 = childProp == null ? void 0 : childProp.props) == null ? void 0 : _a2.onMouseLeave) == null ? void 0 : _b2.call(_a2, e);
|
|
4639
5598
|
},
|
|
4640
5599
|
[childProp == null ? void 0 : childProp.props, handleIsOpenChange]
|
|
4641
5600
|
);
|
|
@@ -4781,14 +5740,28 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
4781
5740
|
] });
|
|
4782
5741
|
});
|
|
4783
5742
|
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
5743
|
+
const Root$9 = styled__default.default.div`
|
|
5744
|
+
line-height: 0;
|
|
5745
|
+
`;
|
|
5746
|
+
const ListBox = styled__default.default(Box)`
|
|
5747
|
+
& > ul {
|
|
5748
|
+
list-style: none;
|
|
5749
|
+
padding: 0;
|
|
5750
|
+
margin: 0;
|
|
5751
|
+
}
|
|
5752
|
+
`;
|
|
5753
|
+
const rotate = styled.keyframes`
|
|
5754
|
+
from {
|
|
5755
|
+
transform: rotate(0deg);
|
|
5756
|
+
}
|
|
5757
|
+
|
|
5758
|
+
to {
|
|
5759
|
+
transform: rotate(360deg);
|
|
5760
|
+
}
|
|
5761
|
+
`;
|
|
5762
|
+
const AnimatedSpinnerIcon = styled__default.default(icons.SpinnerIcon)`
|
|
5763
|
+
animation: ${rotate} 500ms linear infinite;
|
|
5764
|
+
`;
|
|
4792
5765
|
|
|
4793
5766
|
function AutocompleteOption(props) {
|
|
4794
5767
|
const { children, id, onSelect, selected, value } = props;
|
|
@@ -4922,7 +5895,7 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
|
|
|
4922
5895
|
const valuePropRef = react.useRef(valueProp);
|
|
4923
5896
|
const popoverMouseWithinRef = react.useRef(false);
|
|
4924
5897
|
const forwardedRef = useForwardedRef(ref);
|
|
4925
|
-
const listBoxId =
|
|
5898
|
+
const listBoxId = `${id}-listbox`;
|
|
4926
5899
|
const options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY;
|
|
4927
5900
|
const padding = useArrayProp(paddingProp);
|
|
4928
5901
|
const currentOption = react.useMemo(
|
|
@@ -4934,7 +5907,7 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
|
|
|
4934
5907
|
[filterOption, options, query]
|
|
4935
5908
|
);
|
|
4936
5909
|
const filteredOptionsLen = filteredOptions.length;
|
|
4937
|
-
const activeItemId = activeValue ?
|
|
5910
|
+
const activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0;
|
|
4938
5911
|
const expanded = query !== null && loading || focused && query !== null;
|
|
4939
5912
|
const handleRootBlur = react.useCallback(
|
|
4940
5913
|
(event) => {
|
|
@@ -5262,7 +6235,7 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
|
|
|
5262
6235
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5263
6236
|
AutocompleteOption,
|
|
5264
6237
|
{
|
|
5265
|
-
id:
|
|
6238
|
+
id: `${id}-option-${option.value}`,
|
|
5266
6239
|
onSelect: handleOptionSelect,
|
|
5267
6240
|
selected: active,
|
|
5268
6241
|
value: option.value,
|
|
@@ -5355,12 +6328,19 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
|
|
|
5355
6328
|
});
|
|
5356
6329
|
const Autocomplete = InnerAutocomplete;
|
|
5357
6330
|
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
6331
|
+
const Root$8 = styled__default.default.ol`
|
|
6332
|
+
margin: 0;
|
|
6333
|
+
padding: 0;
|
|
6334
|
+
display: flex;
|
|
6335
|
+
list-style: none;
|
|
6336
|
+
align-items: center;
|
|
6337
|
+
white-space: nowrap;
|
|
6338
|
+
line-height: 0;
|
|
6339
|
+
`;
|
|
6340
|
+
const ExpandButton = styled__default.default(Button)`
|
|
6341
|
+
appearance: none;
|
|
6342
|
+
margin: -4px;
|
|
6343
|
+
`;
|
|
5364
6344
|
|
|
5365
6345
|
const Breadcrumbs = react.forwardRef(function Breadcrumbs2(props, ref) {
|
|
5366
6346
|
const { children, maxLength, separator, space: spaceRaw = 2, ...restProps } = props;
|
|
@@ -5419,10 +6399,6 @@ const Breadcrumbs = react.forwardRef(function Breadcrumbs2(props, ref) {
|
|
|
5419
6399
|
] }, itemIndex)) });
|
|
5420
6400
|
});
|
|
5421
6401
|
|
|
5422
|
-
var __freeze$c = Object.freeze;
|
|
5423
|
-
var __defProp$c = Object.defineProperty;
|
|
5424
|
-
var __template$c = (cooked, raw) => __freeze$c(__defProp$c(cooked, "raw", { value: __freeze$c(raw || cooked.slice()) }));
|
|
5425
|
-
var _a$c, _b$7;
|
|
5426
6402
|
function dialogStyle({ theme: theme$1 }) {
|
|
5427
6403
|
const { color } = theme.getTheme_v2(theme$1);
|
|
5428
6404
|
return {
|
|
@@ -5445,8 +6421,33 @@ function responsiveDialogPositionStyle(props) {
|
|
|
5445
6421
|
}
|
|
5446
6422
|
function animationDialogStyle(props) {
|
|
5447
6423
|
if (!props.$animate)
|
|
5448
|
-
return styled.css
|
|
5449
|
-
return styled.css
|
|
6424
|
+
return styled.css``;
|
|
6425
|
+
return styled.css`
|
|
6426
|
+
@keyframes zoomIn {
|
|
6427
|
+
from {
|
|
6428
|
+
opacity: 0;
|
|
6429
|
+
transform: scale(0.95);
|
|
6430
|
+
}
|
|
6431
|
+
to {
|
|
6432
|
+
opacity: 1;
|
|
6433
|
+
transform: scale(1);
|
|
6434
|
+
}
|
|
6435
|
+
}
|
|
6436
|
+
@keyframes fadeIn {
|
|
6437
|
+
from {
|
|
6438
|
+
opacity: 0;
|
|
6439
|
+
}
|
|
6440
|
+
to {
|
|
6441
|
+
opacity: 1;
|
|
6442
|
+
}
|
|
6443
|
+
}
|
|
6444
|
+
|
|
6445
|
+
animation: fadeIn 200ms ease-out;
|
|
6446
|
+
// Animates the dialog card.
|
|
6447
|
+
& > [data-ui='DialogCard'] {
|
|
6448
|
+
animation: zoomIn 200ms ease-out;
|
|
6449
|
+
}
|
|
6450
|
+
`;
|
|
5450
6451
|
}
|
|
5451
6452
|
|
|
5452
6453
|
const key$3 = Symbol.for("@sanity/ui/context/dialog");
|
|
@@ -5457,24 +6458,53 @@ function useDialog() {
|
|
|
5457
6458
|
return react.useContext(DialogContext);
|
|
5458
6459
|
}
|
|
5459
6460
|
|
|
5460
|
-
var __freeze$b = Object.freeze;
|
|
5461
|
-
var __defProp$b = Object.defineProperty;
|
|
5462
|
-
var __template$b = (cooked, raw) => __freeze$b(__defProp$b(cooked, "raw", { value: __freeze$b(raw || cooked.slice()) }));
|
|
5463
|
-
var _a$b, _b$6, _c$2, _d$1, _e, _f;
|
|
5464
6461
|
function isTargetWithinScope(boundaryElement, portalElement, target) {
|
|
5465
6462
|
if (!boundaryElement || !portalElement)
|
|
5466
6463
|
return true;
|
|
5467
6464
|
return containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
|
|
5468
6465
|
}
|
|
5469
6466
|
const Root$7 = styled__default.default(Layer)(responsivePaddingStyle, dialogStyle, responsiveDialogPositionStyle, animationDialogStyle);
|
|
5470
|
-
const DialogContainer = styled__default.default(Container)
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
6467
|
+
const DialogContainer = styled__default.default(Container)`
|
|
6468
|
+
&:not([hidden]) {
|
|
6469
|
+
display: flex;
|
|
6470
|
+
}
|
|
6471
|
+
width: 100%;
|
|
6472
|
+
height: 100%;
|
|
6473
|
+
flex-direction: column;
|
|
6474
|
+
align-items: center;
|
|
6475
|
+
justify-content: center;
|
|
6476
|
+
`;
|
|
6477
|
+
const DialogCardRoot = styled__default.default(Card)`
|
|
6478
|
+
&:not([hidden]) {
|
|
6479
|
+
display: flex;
|
|
6480
|
+
}
|
|
6481
|
+
width: 100%;
|
|
6482
|
+
min-height: 0;
|
|
6483
|
+
max-height: 100%;
|
|
6484
|
+
overflow: hidden;
|
|
6485
|
+
overflow: clip;
|
|
6486
|
+
`;
|
|
6487
|
+
const DialogLayout = styled__default.default(Flex)`
|
|
6488
|
+
flex: 1;
|
|
6489
|
+
min-height: 0;
|
|
6490
|
+
width: 100%;
|
|
6491
|
+
`;
|
|
6492
|
+
const DialogHeader = styled__default.default(Box)`
|
|
6493
|
+
position: relative;
|
|
6494
|
+
z-index: 2;
|
|
6495
|
+
`;
|
|
6496
|
+
const DialogContent = styled__default.default(Box)`
|
|
6497
|
+
position: relative;
|
|
6498
|
+
z-index: 1;
|
|
6499
|
+
overflow: auto;
|
|
6500
|
+
outline: none;
|
|
6501
|
+
`;
|
|
6502
|
+
const DialogFooter = styled__default.default(Box)`
|
|
6503
|
+
position: relative;
|
|
6504
|
+
z-index: 3;
|
|
6505
|
+
`;
|
|
5476
6506
|
const DialogCard = react.forwardRef(function DialogCard2(props, ref) {
|
|
5477
|
-
var
|
|
6507
|
+
var _a;
|
|
5478
6508
|
const {
|
|
5479
6509
|
__unstable_autoFocus: autoFocus,
|
|
5480
6510
|
__unstable_hideCloseButton: hideCloseButton,
|
|
@@ -5492,7 +6522,7 @@ const DialogCard = react.forwardRef(function DialogCard2(props, ref) {
|
|
|
5492
6522
|
width: widthProp
|
|
5493
6523
|
} = props;
|
|
5494
6524
|
const portal = usePortal();
|
|
5495
|
-
const portalElement = portalProp ? ((
|
|
6525
|
+
const portalElement = portalProp ? ((_a = portal.elements) == null ? void 0 : _a[portalProp]) || null : portal.element;
|
|
5496
6526
|
const boundaryElement = useBoundaryElement().element;
|
|
5497
6527
|
const radius = useArrayProp(radiusProp);
|
|
5498
6528
|
const shadow = useArrayProp(shadowProp);
|
|
@@ -5502,7 +6532,7 @@ const DialogCard = react.forwardRef(function DialogCard2(props, ref) {
|
|
|
5502
6532
|
const localContentRef = react.useRef(null);
|
|
5503
6533
|
const layer = useLayer();
|
|
5504
6534
|
const { isTopLayer } = layer;
|
|
5505
|
-
const labelId =
|
|
6535
|
+
const labelId = `${id}_label`;
|
|
5506
6536
|
const showCloseButton = Boolean(onClose) && hideCloseButton === false;
|
|
5507
6537
|
const showHeader = Boolean(header) || showCloseButton;
|
|
5508
6538
|
react.useEffect(() => {
|
|
@@ -5582,7 +6612,7 @@ const DialogCard = react.forwardRef(function DialogCard2(props, ref) {
|
|
|
5582
6612
|
] }) }) });
|
|
5583
6613
|
});
|
|
5584
6614
|
const Dialog = react.forwardRef(function Dialog2(props, ref) {
|
|
5585
|
-
var
|
|
6615
|
+
var _a;
|
|
5586
6616
|
const dialog = useDialog();
|
|
5587
6617
|
const { layer } = useTheme_v2();
|
|
5588
6618
|
const {
|
|
@@ -5611,7 +6641,7 @@ const Dialog = react.forwardRef(function Dialog2(props, ref) {
|
|
|
5611
6641
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
5612
6642
|
const animate = prefersReducedMotion ? false : _animate;
|
|
5613
6643
|
const portal = usePortal();
|
|
5614
|
-
const portalElement = portalProp ? ((
|
|
6644
|
+
const portalElement = portalProp ? ((_a = portal.elements) == null ? void 0 : _a[portalProp]) || null : portal.element;
|
|
5615
6645
|
const boundaryElement = useBoundaryElement().element;
|
|
5616
6646
|
const cardRadius = useArrayProp(cardRadiusProp);
|
|
5617
6647
|
const padding = useArrayProp(paddingProp);
|
|
@@ -5641,7 +6671,7 @@ const Dialog = react.forwardRef(function Dialog2(props, ref) {
|
|
|
5641
6671
|
},
|
|
5642
6672
|
[onFocus]
|
|
5643
6673
|
);
|
|
5644
|
-
const labelId =
|
|
6674
|
+
const labelId = `${id}_label`;
|
|
5645
6675
|
const rootClickTimeoutRef = react.useRef();
|
|
5646
6676
|
const handleRootClick = react.useCallback(() => {
|
|
5647
6677
|
if (rootClickTimeoutRef.current) {
|
|
@@ -5719,12 +6749,19 @@ function DialogProvider(props) {
|
|
|
5719
6749
|
return /* @__PURE__ */ jsxRuntime.jsx(DialogContext.Provider, { value: contextValue, children });
|
|
5720
6750
|
}
|
|
5721
6751
|
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
6752
|
+
const Root$6 = styled__default.default.kbd`
|
|
6753
|
+
font: inherit;
|
|
6754
|
+
padding: 1px;
|
|
6755
|
+
|
|
6756
|
+
&:not([hidden]) {
|
|
6757
|
+
display: block;
|
|
6758
|
+
}
|
|
6759
|
+
`;
|
|
6760
|
+
const Key = styled__default.default(KBD)`
|
|
6761
|
+
&:not([hidden]) {
|
|
6762
|
+
display: block;
|
|
6763
|
+
}
|
|
6764
|
+
`;
|
|
5728
6765
|
const Hotkeys = react.forwardRef(function Hotkeys2(props, ref) {
|
|
5729
6766
|
const { fontSize, keys, padding, radius, space: spaceProp = 0.5, ...restProps } = props;
|
|
5730
6767
|
const space = useArrayProp(spaceProp);
|
|
@@ -5941,11 +6978,10 @@ function useMenuController(props) {
|
|
|
5941
6978
|
};
|
|
5942
6979
|
}
|
|
5943
6980
|
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
const Root$5 = styled__default.default(Box)(_a$9 || (_a$9 = __template$9(["\n outline: none;\n overflow: auto;\n"])));
|
|
6981
|
+
const Root$5 = styled__default.default(Box)`
|
|
6982
|
+
outline: none;
|
|
6983
|
+
overflow: auto;
|
|
6984
|
+
`;
|
|
5949
6985
|
const Menu = react.forwardRef(function Menu2(props, ref) {
|
|
5950
6986
|
const {
|
|
5951
6987
|
children,
|
|
@@ -6243,25 +7279,110 @@ const MenuButton = react.forwardRef(function MenuButton2(props, ref) {
|
|
|
6243
7279
|
return /* @__PURE__ */ jsxRuntime.jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: button || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}) });
|
|
6244
7280
|
});
|
|
6245
7281
|
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
var
|
|
6250
|
-
|
|
7282
|
+
const MenuDivider = styled__default.default.hr`
|
|
7283
|
+
height: 1px;
|
|
7284
|
+
border: 0;
|
|
7285
|
+
background: var(--card-hairline-soft-color);
|
|
7286
|
+
margin: 0;
|
|
7287
|
+
`;
|
|
6251
7288
|
|
|
6252
|
-
var __freeze$7 = Object.freeze;
|
|
6253
|
-
var __defProp$7 = Object.defineProperty;
|
|
6254
|
-
var __template$7 = (cooked, raw) => __freeze$7(__defProp$7(cooked, "raw", { value: __freeze$7(raw || cooked.slice()) }));
|
|
6255
|
-
var _a$7, _b$4;
|
|
6256
7289
|
function selectableBaseStyle() {
|
|
6257
|
-
return styled.css
|
|
7290
|
+
return styled.css`
|
|
7291
|
+
background-color: inherit;
|
|
7292
|
+
color: inherit;
|
|
7293
|
+
|
|
7294
|
+
&[data-as='button'] {
|
|
7295
|
+
-webkit-font-smoothing: inherit;
|
|
7296
|
+
appearance: none;
|
|
7297
|
+
outline: none;
|
|
7298
|
+
font: inherit;
|
|
7299
|
+
text-align: inherit;
|
|
7300
|
+
border: 0;
|
|
7301
|
+
width: -moz-available;
|
|
7302
|
+
width: -webkit-fill-available;
|
|
7303
|
+
width: stretch;
|
|
7304
|
+
}
|
|
7305
|
+
|
|
7306
|
+
/* &:is(a) */
|
|
7307
|
+
&[data-as='a'] {
|
|
7308
|
+
text-decoration: none;
|
|
7309
|
+
}
|
|
7310
|
+
`;
|
|
6258
7311
|
}
|
|
6259
7312
|
function selectableColorStyle(props) {
|
|
6260
|
-
var
|
|
7313
|
+
var _a;
|
|
6261
7314
|
const { $tone } = props;
|
|
6262
7315
|
const { color, style } = theme.getTheme_v2(props.theme);
|
|
6263
7316
|
const tone = color.selectable[$tone];
|
|
6264
|
-
return styled.css
|
|
7317
|
+
return styled.css`
|
|
7318
|
+
${_cardColorStyle(color, tone.enabled)}
|
|
7319
|
+
|
|
7320
|
+
background-color: var(--card-bg-color);
|
|
7321
|
+
color: var(--card-fg-color);
|
|
7322
|
+
outline: none;
|
|
7323
|
+
|
|
7324
|
+
/* &:is(button) */
|
|
7325
|
+
&[data-as='button'] {
|
|
7326
|
+
&:disabled {
|
|
7327
|
+
${_cardColorStyle(color, tone.disabled)}
|
|
7328
|
+
}
|
|
7329
|
+
|
|
7330
|
+
&:not(:disabled) {
|
|
7331
|
+
&[aria-pressed='true'] {
|
|
7332
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
7333
|
+
}
|
|
7334
|
+
|
|
7335
|
+
&[data-selected],
|
|
7336
|
+
&[aria-selected='true'] > & {
|
|
7337
|
+
${_cardColorStyle(color, tone.selected)}
|
|
7338
|
+
}
|
|
7339
|
+
|
|
7340
|
+
@media (hover: hover) {
|
|
7341
|
+
&:not([data-selected]) {
|
|
7342
|
+
&[data-hovered],
|
|
7343
|
+
&:hover {
|
|
7344
|
+
${_cardColorStyle(color, tone.hovered)}
|
|
7345
|
+
}
|
|
7346
|
+
|
|
7347
|
+
&:active {
|
|
7348
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
7349
|
+
}
|
|
7350
|
+
}
|
|
7351
|
+
}
|
|
7352
|
+
}
|
|
7353
|
+
}
|
|
7354
|
+
|
|
7355
|
+
/* &:is(a) */
|
|
7356
|
+
&[data-as='a'] {
|
|
7357
|
+
&[data-disabled] {
|
|
7358
|
+
${_cardColorStyle(color, tone.disabled)}
|
|
7359
|
+
}
|
|
7360
|
+
|
|
7361
|
+
&:not([data-disabled]) {
|
|
7362
|
+
&[data-pressed] {
|
|
7363
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
7364
|
+
}
|
|
7365
|
+
|
|
7366
|
+
&[data-selected] {
|
|
7367
|
+
${_cardColorStyle(color, tone.selected)}
|
|
7368
|
+
}
|
|
7369
|
+
|
|
7370
|
+
@media (hover: hover) {
|
|
7371
|
+
&:not([data-selected]) {
|
|
7372
|
+
&[data-hovered],
|
|
7373
|
+
&:hover {
|
|
7374
|
+
${_cardColorStyle(color, tone.hovered)}
|
|
7375
|
+
}
|
|
7376
|
+
&:active {
|
|
7377
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
7378
|
+
}
|
|
7379
|
+
}
|
|
7380
|
+
}
|
|
7381
|
+
}
|
|
7382
|
+
}
|
|
7383
|
+
|
|
7384
|
+
${(_a = style == null ? void 0 : style.card) == null ? void 0 : _a.root}
|
|
7385
|
+
`;
|
|
6265
7386
|
}
|
|
6266
7387
|
|
|
6267
7388
|
const Selectable = styled__default.default(Box)(
|
|
@@ -6535,13 +7656,45 @@ const MenuItem = react.forwardRef(function MenuItem2(props, forwardedRef) {
|
|
|
6535
7656
|
);
|
|
6536
7657
|
});
|
|
6537
7658
|
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
7659
|
+
const keyframe = styled.keyframes`
|
|
7660
|
+
0% {
|
|
7661
|
+
background-position: 100%;
|
|
7662
|
+
}
|
|
7663
|
+
100% {
|
|
7664
|
+
background-position: -100%;
|
|
7665
|
+
}
|
|
7666
|
+
`;
|
|
7667
|
+
const animation = styled.css`
|
|
7668
|
+
background-image: linear-gradient(
|
|
7669
|
+
to right,
|
|
7670
|
+
var(--card-skeleton-color-from),
|
|
7671
|
+
var(--card-skeleton-color-to),
|
|
7672
|
+
var(--card-skeleton-color-from),
|
|
7673
|
+
var(--card-skeleton-color-from),
|
|
7674
|
+
var(--card-skeleton-color-from)
|
|
7675
|
+
);
|
|
7676
|
+
background-position: 100%;
|
|
7677
|
+
background-size: 200% 100%;
|
|
7678
|
+
background-attachment: fixed;
|
|
7679
|
+
animation-name: ${keyframe};
|
|
7680
|
+
animation-timing-function: ease-in-out;
|
|
7681
|
+
animation-iteration-count: infinite;
|
|
7682
|
+
animation-duration: 2000ms;
|
|
7683
|
+
`;
|
|
7684
|
+
const skeletonStyle = styled.css`
|
|
7685
|
+
opacity: ${({ $visible }) => $visible ? 1 : 0};
|
|
7686
|
+
transition: opacity 200ms ease-in;
|
|
7687
|
+
|
|
7688
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
7689
|
+
${({ $animated }) => $animated ? animation : styled.css`
|
|
7690
|
+
background-color: var(--card-skeleton-color-from);
|
|
7691
|
+
`}
|
|
7692
|
+
}
|
|
7693
|
+
|
|
7694
|
+
@media screen and (prefers-reduced-motion: reduce) {
|
|
7695
|
+
background-color: var(--card-skeleton-color-from);
|
|
7696
|
+
}
|
|
7697
|
+
`;
|
|
6545
7698
|
|
|
6546
7699
|
const Root$4 = styled__default.default(Box)(
|
|
6547
7700
|
responsiveRadiusStyle,
|
|
@@ -6605,11 +7758,9 @@ const CodeSkeleton = react.forwardRef(function TextSkeleton5(props, ref) {
|
|
|
6605
7758
|
return /* @__PURE__ */ jsxRuntime.jsx(Root$3, { ...restProps, $size, ref, $style: "code" });
|
|
6606
7759
|
});
|
|
6607
7760
|
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
var _a$5;
|
|
6612
|
-
const CustomButton = styled__default.default(Button)(_a$5 || (_a$5 = __template$5(["\n max-width: 100%;\n"])));
|
|
7761
|
+
const CustomButton = styled__default.default(Button)`
|
|
7762
|
+
max-width: 100%;
|
|
7763
|
+
`;
|
|
6613
7764
|
const Tab = react.forwardRef(function Tab2(props, forwardedRef) {
|
|
6614
7765
|
const {
|
|
6615
7766
|
icon,
|
|
@@ -6672,14 +7823,17 @@ const Tab = react.forwardRef(function Tab2(props, forwardedRef) {
|
|
|
6672
7823
|
);
|
|
6673
7824
|
});
|
|
6674
7825
|
|
|
6675
|
-
var __freeze$4 = Object.freeze;
|
|
6676
|
-
var __defProp$4 = Object.defineProperty;
|
|
6677
|
-
var __template$4 = (cooked, raw) => __freeze$4(__defProp$4(cooked, "raw", { value: __freeze$4(raw || cooked.slice()) }));
|
|
6678
|
-
var _a$4;
|
|
6679
7826
|
function _isReactElement(node) {
|
|
6680
7827
|
return Boolean(node);
|
|
6681
7828
|
}
|
|
6682
|
-
const CustomInline = styled__default.default(Inline)
|
|
7829
|
+
const CustomInline = styled__default.default(Inline)`
|
|
7830
|
+
& > div {
|
|
7831
|
+
display: inline-block;
|
|
7832
|
+
vertical-align: middle;
|
|
7833
|
+
max-width: 100%;
|
|
7834
|
+
box-sizing: border-box;
|
|
7835
|
+
}
|
|
7836
|
+
`;
|
|
6683
7837
|
const TabList = react.forwardRef(function TabList2(props, ref) {
|
|
6684
7838
|
const { children: childrenProp, ...restProps } = props;
|
|
6685
7839
|
const [focusedIndex, setFocusedIndex] = react.useState(-1);
|
|
@@ -6735,10 +7889,6 @@ const TabPanel = react.forwardRef(function TabPanel2(props, ref) {
|
|
|
6735
7889
|
);
|
|
6736
7890
|
});
|
|
6737
7891
|
|
|
6738
|
-
var __freeze$3 = Object.freeze;
|
|
6739
|
-
var __defProp$3 = Object.defineProperty;
|
|
6740
|
-
var __template$3 = (cooked, raw) => __freeze$3(__defProp$3(cooked, "raw", { value: __freeze$3(raw || cooked.slice()) }));
|
|
6741
|
-
var _a$3, _b$2;
|
|
6742
7892
|
const STATUS_CARD_TONE = {
|
|
6743
7893
|
error: "critical",
|
|
6744
7894
|
warning: "caution",
|
|
@@ -6757,8 +7907,16 @@ const ROLES = {
|
|
|
6757
7907
|
success: "alert",
|
|
6758
7908
|
info: "alert"
|
|
6759
7909
|
};
|
|
6760
|
-
const Root$2 = styled__default.default(Card)
|
|
6761
|
-
|
|
7910
|
+
const Root$2 = styled__default.default(Card)`
|
|
7911
|
+
pointer-events: all;
|
|
7912
|
+
& > * {
|
|
7913
|
+
opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
|
|
7914
|
+
will-change: opacity;
|
|
7915
|
+
}
|
|
7916
|
+
`;
|
|
7917
|
+
const TextBox = styled__default.default(Flex)`
|
|
7918
|
+
overflow-x: auto;
|
|
7919
|
+
`;
|
|
6762
7920
|
function Toast(props) {
|
|
6763
7921
|
const { closable, description, onClose, radius = 3, title, status, ...restProps } = props;
|
|
6764
7922
|
const cardTone = status ? STATUS_CARD_TONE[status] : "default";
|
|
@@ -6810,12 +7968,22 @@ const key$1 = Symbol.for("@sanity/ui/context/toast");
|
|
|
6810
7968
|
globalScope[key$1] = globalScope[key$1] || react.createContext(null);
|
|
6811
7969
|
const ToastContext = globalScope[key$1];
|
|
6812
7970
|
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
|
|
6818
|
-
|
|
7971
|
+
const Root$1 = styled__default.default(Layer)`
|
|
7972
|
+
position: fixed;
|
|
7973
|
+
top: 0;
|
|
7974
|
+
left: 0;
|
|
7975
|
+
right: 0;
|
|
7976
|
+
bottom: 0;
|
|
7977
|
+
pointer-events: none;
|
|
7978
|
+
`;
|
|
7979
|
+
const ToastContainer = styled__default.default.div`
|
|
7980
|
+
box-sizing: border-box;
|
|
7981
|
+
position: absolute;
|
|
7982
|
+
right: 0;
|
|
7983
|
+
bottom: 0;
|
|
7984
|
+
max-width: 420px;
|
|
7985
|
+
width: 100%;
|
|
7986
|
+
`;
|
|
6819
7987
|
let toastId = 0;
|
|
6820
7988
|
function ToastProvider(props) {
|
|
6821
7989
|
const { children, padding = 4, paddingX, paddingY, zOffset } = props;
|
|
@@ -6853,8 +8021,8 @@ function ToastProvider(props) {
|
|
|
6853
8021
|
const id = params.id || String(toastId++);
|
|
6854
8022
|
const duration = params.duration || 5e3;
|
|
6855
8023
|
const dismiss = () => {
|
|
6856
|
-
var
|
|
6857
|
-
const timeoutId = (
|
|
8024
|
+
var _a;
|
|
8025
|
+
const timeoutId = (_a = toastsRef.current[id]) == null ? void 0 : _a.timeoutId;
|
|
6858
8026
|
setState((prevState) => {
|
|
6859
8027
|
const idx = prevState.findIndex((t) => t.id === id);
|
|
6860
8028
|
if (idx > -1) {
|
|
@@ -7172,23 +8340,94 @@ const Tree = react.memo(
|
|
|
7172
8340
|
);
|
|
7173
8341
|
Tree.displayName = "Tree";
|
|
7174
8342
|
|
|
7175
|
-
var __freeze$1 = Object.freeze;
|
|
7176
|
-
var __defProp$1 = Object.defineProperty;
|
|
7177
|
-
var __template$1 = (cooked, raw) => __freeze$1(__defProp$1(cooked, "raw", { value: __freeze$1(raw || cooked.slice()) }));
|
|
7178
|
-
var _a$1, _b, _c;
|
|
7179
8343
|
function treeItemRootStyle() {
|
|
7180
|
-
return styled.css
|
|
8344
|
+
return styled.css`
|
|
8345
|
+
&[role='none'] > [role='treeitem'] {
|
|
8346
|
+
outline: none;
|
|
8347
|
+
cursor: default;
|
|
8348
|
+
border-radius: 3px;
|
|
8349
|
+
|
|
8350
|
+
background-color: var(--card-bg-color);
|
|
8351
|
+
color: var(--treeitem-fg-color);
|
|
8352
|
+
|
|
8353
|
+
&:focus {
|
|
8354
|
+
position: relative;
|
|
8355
|
+
}
|
|
8356
|
+
}
|
|
8357
|
+
|
|
8358
|
+
&[role='treeitem'] {
|
|
8359
|
+
outline: none;
|
|
8360
|
+
|
|
8361
|
+
& > div {
|
|
8362
|
+
cursor: default;
|
|
8363
|
+
border-radius: 3px;
|
|
8364
|
+
|
|
8365
|
+
background-color: var(--card-bg-color);
|
|
8366
|
+
color: var(--treeitem-fg-color);
|
|
8367
|
+
}
|
|
8368
|
+
|
|
8369
|
+
&:focus > div {
|
|
8370
|
+
position: relative;
|
|
8371
|
+
}
|
|
8372
|
+
}
|
|
8373
|
+
`;
|
|
7181
8374
|
}
|
|
7182
8375
|
function treeItemRootColorStyle(props) {
|
|
7183
8376
|
const $tone = "default";
|
|
7184
8377
|
const { color } = theme.getTheme_v2(props.theme);
|
|
7185
8378
|
const tone = color.selectable[$tone];
|
|
7186
|
-
return styled.css
|
|
8379
|
+
return styled.css`
|
|
8380
|
+
&[role='none'] {
|
|
8381
|
+
& > [role='treeitem'] {
|
|
8382
|
+
${_cardColorStyle(color, tone.enabled)}
|
|
8383
|
+
}
|
|
8384
|
+
|
|
8385
|
+
&[data-selected] > [role='treeitem'] {
|
|
8386
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
8387
|
+
}
|
|
8388
|
+
|
|
8389
|
+
@media (hover: hover) {
|
|
8390
|
+
&:not([data-selected]) > [role='treeitem']:not(:focus):hover {
|
|
8391
|
+
${_cardColorStyle(color, tone.hovered)}
|
|
8392
|
+
}
|
|
8393
|
+
|
|
8394
|
+
& > [role='treeitem']:focus {
|
|
8395
|
+
${_cardColorStyle(color, tone.selected)}
|
|
8396
|
+
}
|
|
8397
|
+
}
|
|
8398
|
+
}
|
|
8399
|
+
|
|
8400
|
+
&[role='treeitem'] {
|
|
8401
|
+
& > [data-ui='TreeItem__box'] {
|
|
8402
|
+
${_cardColorStyle(color, tone.enabled)}
|
|
8403
|
+
}
|
|
8404
|
+
|
|
8405
|
+
&[data-selected] > [data-ui='TreeItem__box'] {
|
|
8406
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
8407
|
+
}
|
|
8408
|
+
|
|
8409
|
+
@media (hover: hover) {
|
|
8410
|
+
&:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover {
|
|
8411
|
+
${_cardColorStyle(color, tone.hovered)}
|
|
8412
|
+
}
|
|
8413
|
+
|
|
8414
|
+
&:focus > [data-ui='TreeItem__box'] {
|
|
8415
|
+
${_cardColorStyle(color, tone.selected)}
|
|
8416
|
+
}
|
|
8417
|
+
}
|
|
8418
|
+
}
|
|
8419
|
+
`;
|
|
7187
8420
|
}
|
|
7188
8421
|
function treeItemBoxStyle(props) {
|
|
7189
8422
|
const { $level } = props;
|
|
7190
8423
|
const { space } = theme.getTheme_v2(props.theme);
|
|
7191
|
-
return styled.css
|
|
8424
|
+
return styled.css`
|
|
8425
|
+
padding-left: ${rem(space[2] * $level)};
|
|
8426
|
+
|
|
8427
|
+
&[data-as='a'] {
|
|
8428
|
+
text-decoration: none;
|
|
8429
|
+
}
|
|
8430
|
+
`;
|
|
7192
8431
|
}
|
|
7193
8432
|
|
|
7194
8433
|
function useTree() {
|
|
@@ -7217,13 +8456,13 @@ const TreeGroup = react.memo(function TreeGroup2(props) {
|
|
|
7217
8456
|
);
|
|
7218
8457
|
});
|
|
7219
8458
|
|
|
7220
|
-
var __freeze = Object.freeze;
|
|
7221
|
-
var __defProp = Object.defineProperty;
|
|
7222
|
-
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
|
|
7223
|
-
var _a;
|
|
7224
8459
|
const Root = react.memo(styled__default.default.li(treeItemRootStyle, treeItemRootColorStyle));
|
|
7225
8460
|
const TreeItemBox = styled__default.default(Box).attrs({ forwardedAs: "a" })(treeItemBoxStyle);
|
|
7226
|
-
const ToggleArrowText = styled__default.default(Text)
|
|
8461
|
+
const ToggleArrowText = styled__default.default(Text)`
|
|
8462
|
+
& > svg {
|
|
8463
|
+
transition: transform 100ms;
|
|
8464
|
+
}
|
|
8465
|
+
`;
|
|
7227
8466
|
const TreeItem = react.memo(function TreeItem2(props) {
|
|
7228
8467
|
const {
|
|
7229
8468
|
children,
|