@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.esm.js
CHANGED
|
@@ -53,14 +53,14 @@ function _fillCSSObject(keys, value) {
|
|
|
53
53
|
function rem(pixelValue) {
|
|
54
54
|
if (pixelValue === 0)
|
|
55
55
|
return 0;
|
|
56
|
-
return
|
|
56
|
+
return `${pixelValue / 16}rem`;
|
|
57
57
|
}
|
|
58
58
|
function _responsive(media, values, callback) {
|
|
59
59
|
const statements = (values == null ? void 0 : values.map(callback)) || [];
|
|
60
60
|
return statements.map((statement, mediaIndex) => {
|
|
61
61
|
if (mediaIndex === 0)
|
|
62
62
|
return statement;
|
|
63
|
-
return { [
|
|
63
|
+
return { [`@media screen and (min-width: ${media[mediaIndex - 1]}px)`]: statement };
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
function _getArrayProp(val, defaultVal) {
|
|
@@ -131,21 +131,21 @@ function fontSize(size) {
|
|
|
131
131
|
const customIconOffset = (capHeight - customIconSize) / 2;
|
|
132
132
|
return {
|
|
133
133
|
fontSize: rem(fontSize2),
|
|
134
|
-
lineHeight:
|
|
134
|
+
lineHeight: `calc(${lineHeight} / ${fontSize2})`,
|
|
135
135
|
letterSpacing: rem(letterSpacing),
|
|
136
|
-
transform:
|
|
136
|
+
transform: `translateY(${rem(descenderHeight)})`,
|
|
137
137
|
"&:before": {
|
|
138
|
-
marginTop:
|
|
138
|
+
marginTop: `calc(${rem(0 - negHeight)} - 1px)`
|
|
139
139
|
},
|
|
140
140
|
"&:after": {
|
|
141
141
|
marginBottom: "-1px"
|
|
142
142
|
},
|
|
143
143
|
"& svg:not([data-sanity-icon])": {
|
|
144
|
-
fontSize:
|
|
144
|
+
fontSize: `calc(${customIconSize} / 16 * 1rem)`,
|
|
145
145
|
margin: rem(customIconOffset)
|
|
146
146
|
},
|
|
147
147
|
"& [data-sanity-icon]": {
|
|
148
|
-
fontSize:
|
|
148
|
+
fontSize: `calc(${iconSize} / 16 * 1rem)`,
|
|
149
149
|
margin: rem(iconOffset)
|
|
150
150
|
}
|
|
151
151
|
};
|
|
@@ -175,7 +175,7 @@ function responsiveTextFont(props) {
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
function useArrayProp(val, defaultVal) {
|
|
178
|
-
const __perf_hash__ = useMemo(() => JSON.stringify(val
|
|
178
|
+
const __perf_hash__ = useMemo(() => JSON.stringify(val ?? defaultVal), [defaultVal, val]);
|
|
179
179
|
return useMemo(
|
|
180
180
|
() => _getArrayProp(val, defaultVal),
|
|
181
181
|
// Improve performance: Keep object identify for a given hash of the value
|
|
@@ -897,12 +897,12 @@ function useTheme_v2() {
|
|
|
897
897
|
const MEDIA_STORE_CACHE = /* @__PURE__ */ new WeakMap();
|
|
898
898
|
function _getMediaQuery(media, index) {
|
|
899
899
|
if (index === 0) {
|
|
900
|
-
return
|
|
900
|
+
return `screen and (max-width: ${media[index] - 1}px)`;
|
|
901
901
|
}
|
|
902
902
|
if (index === media.length) {
|
|
903
|
-
return
|
|
903
|
+
return `screen and (min-width: ${media[index - 1]}px)`;
|
|
904
904
|
}
|
|
905
|
-
return
|
|
905
|
+
return `screen and (min-width: ${media[index - 1]}px) and (max-width: ${media[index] - 1}px)`;
|
|
906
906
|
}
|
|
907
907
|
function _createMediaStore(media) {
|
|
908
908
|
const mediaLen = media.length;
|
|
@@ -1027,9 +1027,9 @@ function responsiveBorderStyle() {
|
|
|
1027
1027
|
return [border, borderTop, borderRight, borderBottom, borderLeft];
|
|
1028
1028
|
}
|
|
1029
1029
|
function border(props) {
|
|
1030
|
-
var _a
|
|
1030
|
+
var _a;
|
|
1031
1031
|
const { card, media } = getTheme_v2(props.theme);
|
|
1032
|
-
const borderStyle =
|
|
1032
|
+
const borderStyle = `${((_a = card.border) == null ? void 0 : _a.width) ?? 1}px solid var(--card-border-color)`;
|
|
1033
1033
|
return _responsive(
|
|
1034
1034
|
media,
|
|
1035
1035
|
props.$border,
|
|
@@ -1037,9 +1037,9 @@ function border(props) {
|
|
|
1037
1037
|
);
|
|
1038
1038
|
}
|
|
1039
1039
|
function borderTop(props) {
|
|
1040
|
-
var _a
|
|
1040
|
+
var _a;
|
|
1041
1041
|
const { card, media } = 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.$borderTop,
|
|
@@ -1047,9 +1047,9 @@ function borderTop(props) {
|
|
|
1047
1047
|
);
|
|
1048
1048
|
}
|
|
1049
1049
|
function borderRight(props) {
|
|
1050
|
-
var _a
|
|
1050
|
+
var _a;
|
|
1051
1051
|
const { card, media } = 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.$borderRight,
|
|
@@ -1057,9 +1057,9 @@ function borderRight(props) {
|
|
|
1057
1057
|
);
|
|
1058
1058
|
}
|
|
1059
1059
|
function borderBottom(props) {
|
|
1060
|
-
var _a
|
|
1060
|
+
var _a;
|
|
1061
1061
|
const { card, media } = 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.$borderBottom,
|
|
@@ -1067,9 +1067,9 @@ function borderBottom(props) {
|
|
|
1067
1067
|
);
|
|
1068
1068
|
}
|
|
1069
1069
|
function borderLeft(props) {
|
|
1070
|
-
var _a
|
|
1070
|
+
var _a;
|
|
1071
1071
|
const { card, media } = 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.$borderLeft,
|
|
@@ -1187,7 +1187,7 @@ function responsiveFlexItemStyle(props) {
|
|
|
1187
1187
|
}
|
|
1188
1188
|
|
|
1189
1189
|
function focusRingBorderStyle(border) {
|
|
1190
|
-
return
|
|
1190
|
+
return `inset 0 0 0 ${border.width}px ${border.color}`;
|
|
1191
1191
|
}
|
|
1192
1192
|
function focusRingStyle(opts) {
|
|
1193
1193
|
const { base, border, focusRing } = opts;
|
|
@@ -1195,10 +1195,10 @@ function focusRingStyle(opts) {
|
|
|
1195
1195
|
const focusRingInsetWidth = 0 - focusRing.offset;
|
|
1196
1196
|
const bgColor = base ? base.bg : "var(--card-bg-color)";
|
|
1197
1197
|
return [
|
|
1198
|
-
focusRingInsetWidth > 0 &&
|
|
1198
|
+
focusRingInsetWidth > 0 && `inset 0 0 0 ${focusRingInsetWidth}px var(--card-focus-ring-color)`,
|
|
1199
1199
|
border && focusRingBorderStyle(border),
|
|
1200
|
-
focusRingInsetWidth < 0 &&
|
|
1201
|
-
focusRingOutsetWidth > 0 &&
|
|
1200
|
+
focusRingInsetWidth < 0 && `0 0 0 ${0 - focusRingInsetWidth}px ${bgColor}`,
|
|
1201
|
+
focusRingOutsetWidth > 0 && `0 0 0 ${focusRingOutsetWidth}px var(--card-focus-ring-color)`
|
|
1202
1202
|
].filter(Boolean).join(",");
|
|
1203
1203
|
}
|
|
1204
1204
|
|
|
@@ -1256,13 +1256,13 @@ function responsiveGridAutoColsStyle(props) {
|
|
|
1256
1256
|
function responsiveGridColumnsStyle(props) {
|
|
1257
1257
|
const { media } = getTheme_v2(props.theme);
|
|
1258
1258
|
return _responsive(media, props.$columns, (columns) => ({
|
|
1259
|
-
gridTemplateColumns: columns &&
|
|
1259
|
+
gridTemplateColumns: columns && `repeat(${columns},minmax(0,1fr));`
|
|
1260
1260
|
}));
|
|
1261
1261
|
}
|
|
1262
1262
|
function responsiveGridRowsStyle(props) {
|
|
1263
1263
|
const { media } = getTheme_v2(props.theme);
|
|
1264
1264
|
return _responsive(media, props.$rows, (rows) => ({
|
|
1265
|
-
gridTemplateRows: rows &&
|
|
1265
|
+
gridTemplateRows: rows && `repeat(${rows},minmax(0,1fr));`
|
|
1266
1266
|
}));
|
|
1267
1267
|
}
|
|
1268
1268
|
function responsiveGridGapStyle(props) {
|
|
@@ -1306,7 +1306,7 @@ function responsiveGridItemRowStyle(props) {
|
|
|
1306
1306
|
const { media } = getTheme_v2(props.theme);
|
|
1307
1307
|
return _responsive(media, props.$row, (row) => {
|
|
1308
1308
|
if (typeof row === "number") {
|
|
1309
|
-
return { gridRow:
|
|
1309
|
+
return { gridRow: `span ${row} / span ${row}` };
|
|
1310
1310
|
}
|
|
1311
1311
|
return { gridRow: GRID_ITEM_ROW[row] };
|
|
1312
1312
|
});
|
|
@@ -1325,7 +1325,7 @@ function responsiveGridItemColumnStyle(props) {
|
|
|
1325
1325
|
const { media } = getTheme_v2(props.theme);
|
|
1326
1326
|
return _responsive(media, props.$column, (column) => {
|
|
1327
1327
|
if (typeof column === "number") {
|
|
1328
|
-
return { gridColumn:
|
|
1328
|
+
return { gridColumn: `span ${column} / span ${column}` };
|
|
1329
1329
|
}
|
|
1330
1330
|
return { gridColumn: GRID_ITEM_COLUMN[column] };
|
|
1331
1331
|
});
|
|
@@ -1377,18 +1377,84 @@ function responsiveInputPaddingIconRightStyle(props) {
|
|
|
1377
1377
|
return responsiveInputPaddingStyle({ ...props, $iconRight: true });
|
|
1378
1378
|
}
|
|
1379
1379
|
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1380
|
+
const ROOT_STYLE = css`
|
|
1381
|
+
&:not([hidden]) {
|
|
1382
|
+
display: flex;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
align-items: center;
|
|
1386
|
+
`;
|
|
1385
1387
|
function textInputRootStyle() {
|
|
1386
1388
|
return ROOT_STYLE;
|
|
1387
1389
|
}
|
|
1388
1390
|
function textInputBaseStyle(props) {
|
|
1389
1391
|
const { $scheme, $tone, $weight } = props;
|
|
1390
1392
|
const { color, font } = getTheme_v2(props.theme);
|
|
1391
|
-
return css
|
|
1393
|
+
return css`
|
|
1394
|
+
appearance: none;
|
|
1395
|
+
background: none;
|
|
1396
|
+
border: 0;
|
|
1397
|
+
border-radius: 0;
|
|
1398
|
+
outline: none;
|
|
1399
|
+
width: 100%;
|
|
1400
|
+
box-sizing: border-box;
|
|
1401
|
+
font-family: ${font.text.family};
|
|
1402
|
+
font-weight: ${$weight && font.text.weights[$weight] || font.text.weights.regular};
|
|
1403
|
+
margin: 0;
|
|
1404
|
+
position: relative;
|
|
1405
|
+
z-index: 1;
|
|
1406
|
+
display: block;
|
|
1407
|
+
|
|
1408
|
+
/* NOTE: This is a hack to disable Chrome’s autofill styles */
|
|
1409
|
+
&:-webkit-autofill,
|
|
1410
|
+
&:-webkit-autofill:hover,
|
|
1411
|
+
&:-webkit-autofill:focus,
|
|
1412
|
+
&:-webkit-autofill:active {
|
|
1413
|
+
-webkit-text-fill-color: var(--input-fg-color) !important;
|
|
1414
|
+
transition: background-color 5000s;
|
|
1415
|
+
transition-delay: 86400s /* 24h */;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
/* &:is(textarea) */
|
|
1419
|
+
&[data-as='textarea'] {
|
|
1420
|
+
resize: none;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
color: var(--input-fg-color);
|
|
1424
|
+
|
|
1425
|
+
&::placeholder {
|
|
1426
|
+
color: var(--input-placeholder-color);
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
&[data-scheme='${$scheme}'][data-tone='${$tone}'] {
|
|
1430
|
+
--input-fg-color: ${color.input.default.enabled.fg};
|
|
1431
|
+
--input-placeholder-color: ${color.input.default.enabled.placeholder};
|
|
1432
|
+
|
|
1433
|
+
/* enabled */
|
|
1434
|
+
&:not(:invalid):not(:disabled):not(:read-only) {
|
|
1435
|
+
--input-fg-color: ${color.input.default.enabled.fg};
|
|
1436
|
+
--input-placeholder-color: ${color.input.default.enabled.placeholder};
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
/* disabled */
|
|
1440
|
+
&:not(:invalid):disabled {
|
|
1441
|
+
--input-fg-color: ${color.input.default.disabled.fg};
|
|
1442
|
+
--input-placeholder-color: ${color.input.default.disabled.placeholder};
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
/* invalid */
|
|
1446
|
+
&:invalid {
|
|
1447
|
+
--input-fg-color: ${color.input.invalid.enabled.fg};
|
|
1448
|
+
--input-placeholder-color: ${color.input.invalid.enabled.placeholder};
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
/* readOnly */
|
|
1452
|
+
&:read-only {
|
|
1453
|
+
--input-fg-color: ${color.input.default.readOnly.fg};
|
|
1454
|
+
--input-placeholder-color: ${color.input.default.readOnly.placeholder};
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
`;
|
|
1392
1458
|
}
|
|
1393
1459
|
function textInputFontSizeStyle(props) {
|
|
1394
1460
|
const { font, media } = getTheme_v2(props.theme);
|
|
@@ -1403,28 +1469,131 @@ function textInputFontSizeStyle(props) {
|
|
|
1403
1469
|
function textInputRepresentationStyle(props) {
|
|
1404
1470
|
const { $hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing } = props;
|
|
1405
1471
|
const { color, input } = getTheme_v2(props.theme);
|
|
1406
|
-
return css
|
|
1472
|
+
return css`
|
|
1473
|
+
--input-box-shadow: none;
|
|
1474
|
+
|
|
1475
|
+
position: absolute;
|
|
1476
|
+
top: 0;
|
|
1477
|
+
left: 0;
|
|
1478
|
+
right: 0;
|
|
1479
|
+
bottom: 0;
|
|
1480
|
+
display: block;
|
|
1481
|
+
pointer-events: none;
|
|
1482
|
+
z-index: 0;
|
|
1483
|
+
|
|
1484
|
+
background-color: var(--card-bg-color);
|
|
1485
|
+
box-shadow: var(--input-box-shadow);
|
|
1486
|
+
|
|
1487
|
+
border-top-left-radius: ${$hasPrefix ? 0 : void 0};
|
|
1488
|
+
border-bottom-left-radius: ${$hasPrefix ? 0 : void 0};
|
|
1489
|
+
border-top-right-radius: ${$hasSuffix ? 0 : void 0};
|
|
1490
|
+
border-bottom-right-radius: ${$hasSuffix ? 0 : void 0};
|
|
1491
|
+
|
|
1492
|
+
&[data-scheme='${$scheme}'][data-tone='${$tone}'] {
|
|
1493
|
+
--card-bg-color: ${color.input.default.enabled.bg};
|
|
1494
|
+
--card-fg-color: ${color.input.default.enabled.fg};
|
|
1495
|
+
|
|
1496
|
+
/* enabled */
|
|
1497
|
+
*:not(:disabled) + &[data-border] {
|
|
1498
|
+
--input-box-shadow: ${focusRingBorderStyle({
|
|
1407
1499
|
color: color.input.default.enabled.border,
|
|
1408
1500
|
width: input.border.width
|
|
1409
|
-
})
|
|
1501
|
+
})};
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
/* invalid */
|
|
1505
|
+
*:not(:disabled):invalid + & {
|
|
1506
|
+
--card-bg-color: ${color.input.invalid.enabled.bg};
|
|
1507
|
+
--card-fg-color: ${color.input.invalid.enabled.fg};
|
|
1508
|
+
|
|
1509
|
+
&[data-border] {
|
|
1510
|
+
--input-box-shadow: ${focusRingBorderStyle({
|
|
1410
1511
|
color: color.input.invalid.enabled.border,
|
|
1411
1512
|
width: input.border.width
|
|
1412
|
-
})
|
|
1513
|
+
})};
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
/* focused */
|
|
1518
|
+
*:not(:disabled):focus + & {
|
|
1519
|
+
&[data-border] {
|
|
1520
|
+
--input-box-shadow: ${$unstableDisableFocusRing ? void 0 : focusRingStyle({
|
|
1413
1521
|
border: { color: color.input.default.enabled.border, width: input.border.width },
|
|
1414
1522
|
focusRing: input.text.focusRing
|
|
1415
|
-
})
|
|
1523
|
+
})};
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
&:not([data-border]) {
|
|
1527
|
+
--input-box-shadow: ${$unstableDisableFocusRing ? void 0 : focusRingStyle({ focusRing: input.text.focusRing })};
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
/* disabled */
|
|
1532
|
+
*:not(:invalid):disabled + & {
|
|
1533
|
+
--card-bg-color: ${color.input.default.disabled.bg} !important;
|
|
1534
|
+
--card-fg-color: ${color.input.default.disabled.fg} !important;
|
|
1535
|
+
--card-icon-color: ${color.input.default.disabled.fg} !important;
|
|
1536
|
+
|
|
1537
|
+
&[data-border] {
|
|
1538
|
+
--input-box-shadow: ${focusRingBorderStyle({
|
|
1416
1539
|
color: color.input.default.disabled.border,
|
|
1417
1540
|
width: input.border.width
|
|
1418
|
-
})
|
|
1541
|
+
})};
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
*:invalid:disabled + & {
|
|
1546
|
+
--card-bg-color: ${color.input.invalid.disabled.bg} !important;
|
|
1547
|
+
--card-fg-color: ${color.input.invalid.disabled.fg} !important;
|
|
1548
|
+
--card-icon-color: ${color.input.invalid.disabled.fg} !important;
|
|
1549
|
+
|
|
1550
|
+
&[data-border] {
|
|
1551
|
+
--input-box-shadow: ${focusRingBorderStyle({
|
|
1419
1552
|
color: color.input.invalid.disabled.border,
|
|
1420
1553
|
width: input.border.width
|
|
1421
|
-
})
|
|
1554
|
+
})};
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
/* readOnly */
|
|
1559
|
+
*:not(:invalid):read-only + & {
|
|
1560
|
+
--card-bg-color: ${color.input.default.readOnly.bg} !important;
|
|
1561
|
+
--card-fg-color: ${color.input.default.readOnly.fg} !important;
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
*:invalid:read-only + & {
|
|
1565
|
+
--card-bg-color: ${color.input.invalid.readOnly.bg} !important;
|
|
1566
|
+
--card-fg-color: ${color.input.invalid.readOnly.fg} !important;
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
/* hovered */
|
|
1570
|
+
@media (hover: hover) {
|
|
1571
|
+
*:not(:disabled):not(:read-only):not(:invalid):hover + & {
|
|
1572
|
+
--card-bg-color: ${color.input.default.hovered.bg};
|
|
1573
|
+
--card-fg-color: ${color.input.default.hovered.fg};
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
*:invalid:not(:disabled):not(:read-only):hover + & {
|
|
1577
|
+
--card-bg-color: ${color.input.invalid.hovered.bg};
|
|
1578
|
+
--card-fg-color: ${color.input.invalid.hovered.fg};
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
*:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {
|
|
1582
|
+
--input-box-shadow: ${focusRingBorderStyle({
|
|
1422
1583
|
color: color.input.default.hovered.border,
|
|
1423
1584
|
width: input.border.width
|
|
1424
|
-
})
|
|
1585
|
+
})};
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
*:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border] {
|
|
1589
|
+
--input-box-shadow: ${focusRingBorderStyle({
|
|
1425
1590
|
color: color.input.invalid.hovered.border,
|
|
1426
1591
|
width: input.border.width
|
|
1427
|
-
})
|
|
1592
|
+
})};
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
`;
|
|
1428
1597
|
}
|
|
1429
1598
|
|
|
1430
1599
|
function responsiveMarginStyle(props) {
|
|
@@ -1468,16 +1637,16 @@ function responsiveRadiusStyle(props) {
|
|
|
1468
1637
|
}
|
|
1469
1638
|
|
|
1470
1639
|
function toBoxShadow(shadow, color) {
|
|
1471
|
-
return
|
|
1640
|
+
return `${shadow.map(rem).join(" ")} ${color}`;
|
|
1472
1641
|
}
|
|
1473
1642
|
function shadowStyle(shadow, outlineWidth = 1) {
|
|
1474
1643
|
if (!shadow)
|
|
1475
1644
|
return EMPTY_RECORD;
|
|
1476
|
-
const outline =
|
|
1645
|
+
const outline = `0 0 0 ${rem(outlineWidth)} var(--card-shadow-outline-color)`;
|
|
1477
1646
|
const umbra = toBoxShadow(shadow.umbra, "var(--card-shadow-umbra-color)");
|
|
1478
1647
|
const penumbra = toBoxShadow(shadow.penumbra, "var(--card-shadow-penumbra-color)");
|
|
1479
1648
|
const ambient = toBoxShadow(shadow.ambient, "var(--card-shadow-ambient-color)");
|
|
1480
|
-
return { boxShadow:
|
|
1649
|
+
return { boxShadow: `${outline}, ${umbra}, ${penumbra}, ${ambient}` };
|
|
1481
1650
|
}
|
|
1482
1651
|
function responsiveShadowStyle(props) {
|
|
1483
1652
|
const { card, media, shadow } = getTheme_v2(props.theme);
|
|
@@ -1488,22 +1657,50 @@ function responsiveShadowStyle(props) {
|
|
|
1488
1657
|
);
|
|
1489
1658
|
}
|
|
1490
1659
|
|
|
1491
|
-
var __freeze$E = Object.freeze;
|
|
1492
|
-
var __defProp$F = Object.defineProperty;
|
|
1493
|
-
var __template$E = (cooked, raw) => __freeze$E(__defProp$F(cooked, "raw", { value: __freeze$E(raw || cooked.slice()) }));
|
|
1494
|
-
var _a$E, _b$m, _c$b;
|
|
1495
1660
|
function labelBaseStyle(props) {
|
|
1496
1661
|
const { $accent, $muted } = props;
|
|
1497
1662
|
const { font } = getTheme_v2(props.theme);
|
|
1498
|
-
return css
|
|
1663
|
+
return css`
|
|
1664
|
+
text-transform: uppercase;
|
|
1665
|
+
|
|
1666
|
+
${$accent && css`
|
|
1667
|
+
color: var(--card-accent-fg-color);
|
|
1668
|
+
`}
|
|
1669
|
+
|
|
1670
|
+
${$muted && css`
|
|
1671
|
+
color: var(--card-muted-fg-color);
|
|
1672
|
+
`}
|
|
1673
|
+
|
|
1674
|
+
& code {
|
|
1675
|
+
font-family: ${font.code.family};
|
|
1676
|
+
border-radius: 1px;
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
& a {
|
|
1680
|
+
text-decoration: none;
|
|
1681
|
+
border-radius: 1px;
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
& svg {
|
|
1685
|
+
/* Certain popular CSS libraries changes the defaults for SVG display */
|
|
1686
|
+
/* Make sure SVGs are rendered as inline elements */
|
|
1687
|
+
display: inline;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
& [data-sanity-icon] {
|
|
1691
|
+
vertical-align: baseline;
|
|
1692
|
+
}
|
|
1693
|
+
`;
|
|
1499
1694
|
}
|
|
1500
1695
|
|
|
1501
|
-
var __freeze$D = Object.freeze;
|
|
1502
|
-
var __defProp$E = Object.defineProperty;
|
|
1503
|
-
var __template$D = (cooked, raw) => __freeze$D(__defProp$E(cooked, "raw", { value: __freeze$D(raw || cooked.slice()) }));
|
|
1504
|
-
var _a$D;
|
|
1505
1696
|
const Root$C = styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle);
|
|
1506
|
-
const SpanWithTextOverflow$2 = styled.span
|
|
1697
|
+
const SpanWithTextOverflow$2 = styled.span`
|
|
1698
|
+
display: block;
|
|
1699
|
+
white-space: nowrap;
|
|
1700
|
+
text-overflow: ellipsis;
|
|
1701
|
+
overflow: hidden;
|
|
1702
|
+
overflow: clip;
|
|
1703
|
+
`;
|
|
1507
1704
|
const Label = forwardRef(function Label2(props, ref) {
|
|
1508
1705
|
const {
|
|
1509
1706
|
accent,
|
|
@@ -1586,8 +1783,8 @@ function avatarRootStyle(props) {
|
|
|
1586
1783
|
const { $color } = props;
|
|
1587
1784
|
const { avatar } = getTheme_v2(props.theme);
|
|
1588
1785
|
return {
|
|
1589
|
-
"--avatar-bg-color":
|
|
1590
|
-
"--avatar-fg-color":
|
|
1786
|
+
"--avatar-bg-color": `var(--card-avatar-${$color}-bg-color)`,
|
|
1787
|
+
"--avatar-fg-color": `var(--card-avatar-${$color}-fg-color)`,
|
|
1591
1788
|
backgroundColor: "var(--avatar-bg-color)",
|
|
1592
1789
|
position: "relative",
|
|
1593
1790
|
boxSizing: "border-box",
|
|
@@ -1711,7 +1908,7 @@ const Avatar = forwardRef(function Avatar2(props, ref) {
|
|
|
1711
1908
|
animateArrowFrom || arrowPositionProp || "inside"
|
|
1712
1909
|
);
|
|
1713
1910
|
const [imageFailed, setImageFailed] = useState(false);
|
|
1714
|
-
const imageId =
|
|
1911
|
+
const imageId = `avatar-image-${elementId}`;
|
|
1715
1912
|
useEffect(() => {
|
|
1716
1913
|
if (arrowPosition === arrowPositionProp)
|
|
1717
1914
|
return void 0;
|
|
@@ -1762,7 +1959,7 @@ const Avatar = forwardRef(function Avatar2(props, ref) {
|
|
|
1762
1959
|
fill: color
|
|
1763
1960
|
}
|
|
1764
1961
|
) }) }),
|
|
1765
|
-
!imageFailed && src && /* @__PURE__ */ jsxs(Image, { viewBox:
|
|
1962
|
+
!imageFailed && src && /* @__PURE__ */ jsxs(Image, { viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
|
|
1766
1963
|
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", { id: imageId, patternContentUnits: "objectBoundingBox", width: "1", height: "1", children: /* @__PURE__ */ jsx(
|
|
1767
1964
|
"image",
|
|
1768
1965
|
{
|
|
@@ -1772,7 +1969,7 @@ const Avatar = forwardRef(function Avatar2(props, ref) {
|
|
|
1772
1969
|
onError: handleImageError
|
|
1773
1970
|
}
|
|
1774
1971
|
) }) }),
|
|
1775
|
-
/* @__PURE__ */ jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill:
|
|
1972
|
+
/* @__PURE__ */ jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill: `url(#${imageId})` }),
|
|
1776
1973
|
!__unstable_hideInnerStroke && /* @__PURE__ */ jsx(
|
|
1777
1974
|
BgStroke,
|
|
1778
1975
|
{
|
|
@@ -1800,10 +1997,6 @@ const Avatar = forwardRef(function Avatar2(props, ref) {
|
|
|
1800
1997
|
);
|
|
1801
1998
|
});
|
|
1802
1999
|
|
|
1803
|
-
var __freeze$C = Object.freeze;
|
|
1804
|
-
var __defProp$D = Object.defineProperty;
|
|
1805
|
-
var __template$C = (cooked, raw) => __freeze$C(__defProp$D(cooked, "raw", { value: __freeze$C(raw || cooked.slice()) }));
|
|
1806
|
-
var _a$C;
|
|
1807
2000
|
function _responsiveAvatarCounterSizeStyle(props) {
|
|
1808
2001
|
const { avatar, media } = getTheme_v2(props.theme);
|
|
1809
2002
|
return _responsive(media, props.$size, (size) => {
|
|
@@ -1819,7 +2012,23 @@ function _responsiveAvatarCounterSizeStyle(props) {
|
|
|
1819
2012
|
}
|
|
1820
2013
|
function _avatarCounterBaseStyle(props) {
|
|
1821
2014
|
const { space } = getTheme_v2(props.theme);
|
|
1822
|
-
return css
|
|
2015
|
+
return css`
|
|
2016
|
+
align-items: center;
|
|
2017
|
+
justify-content: center;
|
|
2018
|
+
box-sizing: border-box;
|
|
2019
|
+
user-select: none;
|
|
2020
|
+
color: inherit;
|
|
2021
|
+
color: var(--card-fg-color);
|
|
2022
|
+
background: var(--card-bg-color);
|
|
2023
|
+
box-shadow:
|
|
2024
|
+
0 0 0 1px var(--card-bg-color),
|
|
2025
|
+
inset 0 0 0 1px var(--card-hairline-hard-color);
|
|
2026
|
+
padding: 0 ${rem(space[2])};
|
|
2027
|
+
|
|
2028
|
+
&:not([hidden]) {
|
|
2029
|
+
display: flex;
|
|
2030
|
+
}
|
|
2031
|
+
`;
|
|
1823
2032
|
}
|
|
1824
2033
|
const Root$A = styled.div(
|
|
1825
2034
|
_responsiveAvatarCounterSizeStyle,
|
|
@@ -1850,11 +2059,17 @@ function childrenToElementArray(children) {
|
|
|
1850
2059
|
);
|
|
1851
2060
|
}
|
|
1852
2061
|
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
2062
|
+
const BASE_STYLES = css`
|
|
2063
|
+
white-space: nowrap;
|
|
2064
|
+
|
|
2065
|
+
& > div {
|
|
2066
|
+
vertical-align: top;
|
|
2067
|
+
|
|
2068
|
+
&:not([hidden]) {
|
|
2069
|
+
display: inline-block;
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
`;
|
|
1858
2073
|
function avatarStackStyle() {
|
|
1859
2074
|
return BASE_STYLES;
|
|
1860
2075
|
}
|
|
@@ -1971,26 +2186,83 @@ const Box = forwardRef(function Box2(props, ref) {
|
|
|
1971
2186
|
);
|
|
1972
2187
|
});
|
|
1973
2188
|
|
|
1974
|
-
var __freeze$A = Object.freeze;
|
|
1975
|
-
var __defProp$B = Object.defineProperty;
|
|
1976
|
-
var __template$A = (cooked, raw) => __freeze$A(__defProp$B(cooked, "raw", { value: __freeze$A(raw || cooked.slice()) }));
|
|
1977
|
-
var _a$A, _b$l, _c$a;
|
|
1978
2189
|
function textBaseStyle(props) {
|
|
1979
2190
|
const { $accent, $muted } = props;
|
|
1980
2191
|
const { font } = getTheme_v2(props.theme);
|
|
1981
|
-
return css
|
|
2192
|
+
return css`
|
|
2193
|
+
color: var(--card-fg-color);
|
|
2194
|
+
|
|
2195
|
+
${$accent && css`
|
|
2196
|
+
color: var(--card-accent-fg-color);
|
|
2197
|
+
`}
|
|
2198
|
+
|
|
2199
|
+
${$muted && css`
|
|
2200
|
+
color: var(--card-muted-fg-color);
|
|
2201
|
+
`}
|
|
2202
|
+
|
|
2203
|
+
& code {
|
|
2204
|
+
font-family: ${font.code.family};
|
|
2205
|
+
border-radius: 1px;
|
|
2206
|
+
background-color: var(--card-code-bg-color);
|
|
2207
|
+
color: var(--card-code-fg-color);
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
& a {
|
|
2211
|
+
text-decoration: none;
|
|
2212
|
+
border-radius: 1px;
|
|
2213
|
+
color: var(--card-link-color);
|
|
2214
|
+
outline: none;
|
|
2215
|
+
|
|
2216
|
+
@media (hover: hover) {
|
|
2217
|
+
&:hover {
|
|
2218
|
+
text-decoration: underline;
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
&:focus {
|
|
2223
|
+
box-shadow:
|
|
2224
|
+
0 0 0 1px var(--card-bg-color),
|
|
2225
|
+
0 0 0 3px var(--card-focus-ring-color);
|
|
2226
|
+
}
|
|
2227
|
+
|
|
2228
|
+
&:focus:not(:focus-visible) {
|
|
2229
|
+
box-shadow: none;
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2233
|
+
& strong {
|
|
2234
|
+
font-weight: ${font.text.weights.bold};
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
& svg {
|
|
2238
|
+
/* Certain popular CSS libraries changes the defaults for SVG display */
|
|
2239
|
+
/* Make sure SVGs are rendered as inline elements */
|
|
2240
|
+
display: inline;
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
& [data-sanity-icon] {
|
|
2244
|
+
vertical-align: baseline;
|
|
2245
|
+
color: var(--card-icon-color);
|
|
2246
|
+
|
|
2247
|
+
& path {
|
|
2248
|
+
vector-effect: non-scaling-stroke !important;
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
`;
|
|
1982
2252
|
}
|
|
1983
2253
|
|
|
1984
|
-
var __freeze$z = Object.freeze;
|
|
1985
|
-
var __defProp$A = Object.defineProperty;
|
|
1986
|
-
var __template$z = (cooked, raw) => __freeze$z(__defProp$A(cooked, "raw", { value: __freeze$z(raw || cooked.slice()) }));
|
|
1987
|
-
var _a$z;
|
|
1988
2254
|
const Root$x = styled.div(
|
|
1989
2255
|
responsiveTextFont,
|
|
1990
2256
|
responsiveTextAlignStyle,
|
|
1991
2257
|
textBaseStyle
|
|
1992
2258
|
);
|
|
1993
|
-
const SpanWithTextOverflow$1 = styled.span
|
|
2259
|
+
const SpanWithTextOverflow$1 = styled.span`
|
|
2260
|
+
display: block;
|
|
2261
|
+
white-space: nowrap;
|
|
2262
|
+
text-overflow: ellipsis;
|
|
2263
|
+
overflow: hidden;
|
|
2264
|
+
overflow: clip;
|
|
2265
|
+
`;
|
|
1994
2266
|
const Text = forwardRef(function Text2(props, ref) {
|
|
1995
2267
|
const {
|
|
1996
2268
|
accent = false,
|
|
@@ -2025,8 +2297,8 @@ const Text = forwardRef(function Text2(props, ref) {
|
|
|
2025
2297
|
function badgeStyle(props) {
|
|
2026
2298
|
const { $tone } = props;
|
|
2027
2299
|
return {
|
|
2028
|
-
"--card-bg-color":
|
|
2029
|
-
"--card-fg-color":
|
|
2300
|
+
"--card-bg-color": `var(--card-badge-${$tone}-bg-color)`,
|
|
2301
|
+
"--card-fg-color": `var(--card-badge-${$tone}-fg-color)`,
|
|
2030
2302
|
backgroundColor: "var(--card-bg-color)",
|
|
2031
2303
|
cursor: "default",
|
|
2032
2304
|
"&:not([hidden])": {
|
|
@@ -2087,12 +2359,20 @@ const Flex = forwardRef(function Flex2(props, ref) {
|
|
|
2087
2359
|
);
|
|
2088
2360
|
});
|
|
2089
2361
|
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2362
|
+
const rotate$1 = keyframes`
|
|
2363
|
+
from {
|
|
2364
|
+
transform: rotate(0deg);
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
to {
|
|
2368
|
+
transform: rotate(360deg);
|
|
2369
|
+
}
|
|
2370
|
+
`;
|
|
2371
|
+
const Root$u = styled(Text)`
|
|
2372
|
+
& > span > svg {
|
|
2373
|
+
animation: ${rotate$1} 500ms linear infinite;
|
|
2374
|
+
}
|
|
2375
|
+
`;
|
|
2096
2376
|
const Spinner = forwardRef(function Spinner2(props, ref) {
|
|
2097
2377
|
return /* @__PURE__ */ jsx(Root$u, { "data-ui": "Spinner", ...props, ref, children: /* @__PURE__ */ jsx(SpinnerIcon, {}) });
|
|
2098
2378
|
});
|
|
@@ -2127,7 +2407,7 @@ function _cardColorStyle(base, color, checkered = false) {
|
|
|
2127
2407
|
"--card-avatar-cyan-bg-color": color.avatar.cyan.bg,
|
|
2128
2408
|
"--card-avatar-cyan-fg-color": color.avatar.cyan.fg,
|
|
2129
2409
|
"--card-bg-color": color.bg,
|
|
2130
|
-
"--card-bg-image": checkered ?
|
|
2410
|
+
"--card-bg-image": checkered ? `repeating-conic-gradient(${color.bg} 0% 25%, ${color.muted.bg} 0% 50%)` : void 0,
|
|
2131
2411
|
"--card-border-color": color.border,
|
|
2132
2412
|
"--card-badge-default-bg-color": color.badge.default.bg,
|
|
2133
2413
|
"--card-badge-default-dot-color": color.badge.default.dot,
|
|
@@ -2169,20 +2449,54 @@ function _cardColorStyle(base, color, checkered = false) {
|
|
|
2169
2449
|
};
|
|
2170
2450
|
}
|
|
2171
2451
|
|
|
2172
|
-
var __freeze$x = Object.freeze;
|
|
2173
|
-
var __defProp$y = Object.defineProperty;
|
|
2174
|
-
var __template$x = (cooked, raw) => __freeze$x(__defProp$y(cooked, "raw", { value: __freeze$x(raw || cooked.slice()) }));
|
|
2175
|
-
var _a$x, _b$j;
|
|
2176
2452
|
function buttonBaseStyles(props) {
|
|
2177
2453
|
const { $width } = props;
|
|
2178
2454
|
const { style } = getTheme_v2(props.theme);
|
|
2179
|
-
return css
|
|
2455
|
+
return css`
|
|
2456
|
+
${style == null ? void 0 : style.button};
|
|
2457
|
+
|
|
2458
|
+
-webkit-font-smoothing: inherit;
|
|
2459
|
+
appearance: none;
|
|
2460
|
+
display: inline-flex;
|
|
2461
|
+
align-items: center;
|
|
2462
|
+
font: inherit;
|
|
2463
|
+
border: 0;
|
|
2464
|
+
outline: none;
|
|
2465
|
+
user-select: none;
|
|
2466
|
+
text-decoration: none;
|
|
2467
|
+
border: 0;
|
|
2468
|
+
box-sizing: border-box;
|
|
2469
|
+
padding: 0;
|
|
2470
|
+
margin: 0;
|
|
2471
|
+
white-space: nowrap;
|
|
2472
|
+
text-align: left;
|
|
2473
|
+
position: relative;
|
|
2474
|
+
vertical-align: top;
|
|
2475
|
+
|
|
2476
|
+
${$width === "fill" && css`
|
|
2477
|
+
width: -moz-available;
|
|
2478
|
+
width: -webkit-fill-available;
|
|
2479
|
+
width: stretch;
|
|
2480
|
+
`}
|
|
2481
|
+
|
|
2482
|
+
& > span {
|
|
2483
|
+
display: block;
|
|
2484
|
+
flex: 1;
|
|
2485
|
+
min-width: 0;
|
|
2486
|
+
border-radius: inherit;
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2489
|
+
&::-moz-focus-inner {
|
|
2490
|
+
border: 0;
|
|
2491
|
+
padding: 0;
|
|
2492
|
+
}
|
|
2493
|
+
`;
|
|
2180
2494
|
}
|
|
2181
2495
|
function combineBoxShadow(...boxShadows) {
|
|
2182
2496
|
return boxShadows.filter(Boolean).join(",");
|
|
2183
2497
|
}
|
|
2184
2498
|
function buttonColorStyles(props) {
|
|
2185
|
-
var
|
|
2499
|
+
var _a;
|
|
2186
2500
|
const { $mode } = props;
|
|
2187
2501
|
const { button, color: baseColor, style } = getTheme_v2(props.theme);
|
|
2188
2502
|
const shadow = props.$mode === "ghost";
|
|
@@ -2226,16 +2540,25 @@ function buttonColorStyles(props) {
|
|
|
2226
2540
|
"&[data-selected]": _cardColorStyle(baseColor, color.pressed)
|
|
2227
2541
|
}
|
|
2228
2542
|
},
|
|
2229
|
-
(
|
|
2543
|
+
(_a = style == null ? void 0 : style.button) == null ? void 0 : _a.root
|
|
2230
2544
|
].filter(Boolean);
|
|
2231
2545
|
}
|
|
2232
2546
|
|
|
2233
|
-
var __freeze$w = Object.freeze;
|
|
2234
|
-
var __defProp$x = Object.defineProperty;
|
|
2235
|
-
var __template$w = (cooked, raw) => __freeze$w(__defProp$x(cooked, "raw", { value: __freeze$w(raw || cooked.slice()) }));
|
|
2236
|
-
var _a$w;
|
|
2237
2547
|
const Root$t = styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColorStyles);
|
|
2238
|
-
const LoadingBox = styled.div
|
|
2548
|
+
const LoadingBox = styled.div`
|
|
2549
|
+
position: absolute;
|
|
2550
|
+
top: 0;
|
|
2551
|
+
left: 0;
|
|
2552
|
+
right: 0;
|
|
2553
|
+
bottom: 0;
|
|
2554
|
+
display: flex;
|
|
2555
|
+
align-items: center;
|
|
2556
|
+
justify-content: center;
|
|
2557
|
+
background-color: var(--card-bg-color);
|
|
2558
|
+
border-radius: inherit;
|
|
2559
|
+
z-index: 1;
|
|
2560
|
+
box-shadow: inherit;
|
|
2561
|
+
`;
|
|
2239
2562
|
const Button = forwardRef(function Button2(props, ref) {
|
|
2240
2563
|
const {
|
|
2241
2564
|
children,
|
|
@@ -2331,24 +2654,134 @@ const Button = forwardRef(function Button2(props, ref) {
|
|
|
2331
2654
|
);
|
|
2332
2655
|
});
|
|
2333
2656
|
|
|
2334
|
-
var __freeze$v = Object.freeze;
|
|
2335
|
-
var __defProp$w = Object.defineProperty;
|
|
2336
|
-
var __template$v = (cooked, raw) => __freeze$v(__defProp$w(cooked, "raw", { value: __freeze$v(raw || cooked.slice()) }));
|
|
2337
|
-
var _a$v, _b$i, _c$9;
|
|
2338
2657
|
function cardStyle(props) {
|
|
2339
2658
|
return [cardBaseStyle(props), cardColorStyle(props)];
|
|
2340
2659
|
}
|
|
2341
2660
|
function cardBaseStyle(props) {
|
|
2342
2661
|
const { $checkered } = props;
|
|
2343
2662
|
const { space } = getTheme_v2(props.theme);
|
|
2344
|
-
return css
|
|
2663
|
+
return css`
|
|
2664
|
+
${$checkered && css`
|
|
2665
|
+
background-size: ${space[3]}px ${space[3]}px;
|
|
2666
|
+
background-position: 50% 50%;
|
|
2667
|
+
background-image: var(--card-bg-image);
|
|
2668
|
+
`}
|
|
2669
|
+
|
|
2670
|
+
&[data-as='button'] {
|
|
2671
|
+
-webkit-font-smoothing: inherit;
|
|
2672
|
+
appearance: none;
|
|
2673
|
+
outline: none;
|
|
2674
|
+
font: inherit;
|
|
2675
|
+
text-align: inherit;
|
|
2676
|
+
border: 0;
|
|
2677
|
+
width: -moz-available;
|
|
2678
|
+
width: -webkit-fill-available;
|
|
2679
|
+
width: stretch;
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
/* &:is(a) */
|
|
2683
|
+
&[data-as='a'] {
|
|
2684
|
+
outline: none;
|
|
2685
|
+
text-decoration: none;
|
|
2686
|
+
}
|
|
2687
|
+
|
|
2688
|
+
/* &:is(pre) */
|
|
2689
|
+
&[data-as='pre'] {
|
|
2690
|
+
font: inherit;
|
|
2691
|
+
}
|
|
2692
|
+
`;
|
|
2345
2693
|
}
|
|
2346
2694
|
function cardColorStyle(props) {
|
|
2347
|
-
var
|
|
2695
|
+
var _a;
|
|
2348
2696
|
const { $checkered, $focusRing } = props;
|
|
2349
2697
|
const { card, color, style } = getTheme_v2(props.theme);
|
|
2350
2698
|
const border = { width: card.border.width, color: "var(--card-border-color)" };
|
|
2351
|
-
return css
|
|
2699
|
+
return css`
|
|
2700
|
+
color-scheme: ${color._dark ? "dark" : "light"};
|
|
2701
|
+
|
|
2702
|
+
${_cardColorStyle(color, color, $checkered)}
|
|
2703
|
+
|
|
2704
|
+
background-color: var(--card-bg-color);
|
|
2705
|
+
color: var(--card-fg-color);
|
|
2706
|
+
|
|
2707
|
+
/* &:is(button) */
|
|
2708
|
+
&[data-as='button'] {
|
|
2709
|
+
--card-focus-ring-box-shadow: none;
|
|
2710
|
+
|
|
2711
|
+
cursor: default;
|
|
2712
|
+
box-shadow: var(--card-focus-ring-box-shadow);
|
|
2713
|
+
|
|
2714
|
+
&:disabled {
|
|
2715
|
+
${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}
|
|
2716
|
+
}
|
|
2717
|
+
|
|
2718
|
+
&:not(:disabled) {
|
|
2719
|
+
&[data-pressed] {
|
|
2720
|
+
${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
&[data-selected] {
|
|
2724
|
+
${_cardColorStyle(color, color.selectable.default.selected, $checkered)}
|
|
2725
|
+
}
|
|
2726
|
+
|
|
2727
|
+
@media (hover: hover) {
|
|
2728
|
+
&:not([data-pressed]):not([data-selected]) {
|
|
2729
|
+
&[data-hovered],
|
|
2730
|
+
&:hover {
|
|
2731
|
+
${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}
|
|
2732
|
+
}
|
|
2733
|
+
|
|
2734
|
+
&:active {
|
|
2735
|
+
${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
&:focus-visible {
|
|
2741
|
+
--card-focus-ring-box-shadow: ${$focusRing ? focusRingStyle({ base: color, border, focusRing: card.focusRing }) : void 0};
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
}
|
|
2745
|
+
|
|
2746
|
+
/* &:is(a) */
|
|
2747
|
+
&[data-as='a'] {
|
|
2748
|
+
cursor: pointer;
|
|
2749
|
+
box-shadow: var(--card-focus-ring-box-shadow);
|
|
2750
|
+
|
|
2751
|
+
&[data-disabled] {
|
|
2752
|
+
${_cardColorStyle(color, color.selectable.default.disabled, $checkered)}
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
&:not([data-disabled]) {
|
|
2756
|
+
&[data-pressed] {
|
|
2757
|
+
${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
|
|
2758
|
+
}
|
|
2759
|
+
|
|
2760
|
+
&[data-selected] {
|
|
2761
|
+
${_cardColorStyle(color, color.selectable.default.selected, $checkered)}
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
@media (hover: hover) {
|
|
2765
|
+
&:not([data-pressed]):not([data-selected]) {
|
|
2766
|
+
&[data-hovered],
|
|
2767
|
+
&:hover {
|
|
2768
|
+
${_cardColorStyle(color, color.selectable.default.hovered, $checkered)}
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
&:active {
|
|
2772
|
+
${_cardColorStyle(color, color.selectable.default.pressed, $checkered)}
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2777
|
+
&:focus-visible {
|
|
2778
|
+
--card-focus-ring-box-shadow: ${$focusRing ? focusRingStyle({ base: color, border, focusRing: card.focusRing }) : void 0};
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
}
|
|
2782
|
+
|
|
2783
|
+
${(_a = style == null ? void 0 : style.card) == null ? void 0 : _a.root}
|
|
2784
|
+
`;
|
|
2352
2785
|
}
|
|
2353
2786
|
|
|
2354
2787
|
const Root$s = styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle);
|
|
@@ -2401,35 +2834,125 @@ const Card = forwardRef(function Card2(props, ref) {
|
|
|
2401
2834
|
) });
|
|
2402
2835
|
});
|
|
2403
2836
|
|
|
2404
|
-
var __freeze$u = Object.freeze;
|
|
2405
|
-
var __defProp$v = Object.defineProperty;
|
|
2406
|
-
var __template$u = (cooked, raw) => __freeze$u(__defProp$v(cooked, "raw", { value: __freeze$u(raw || cooked.slice()) }));
|
|
2407
|
-
var _a$u, _b$h;
|
|
2408
2837
|
function checkboxBaseStyles() {
|
|
2409
|
-
return css
|
|
2838
|
+
return css`
|
|
2839
|
+
position: relative;
|
|
2840
|
+
display: inline-block;
|
|
2841
|
+
`;
|
|
2410
2842
|
}
|
|
2411
2843
|
function inputElementStyles(props) {
|
|
2412
2844
|
const { color, input, radius } = getTheme_v2(props.theme);
|
|
2413
2845
|
const { focusRing } = input.checkbox;
|
|
2414
|
-
return css
|
|
2846
|
+
return css`
|
|
2847
|
+
position: absolute;
|
|
2848
|
+
top: 0;
|
|
2849
|
+
left: 0;
|
|
2850
|
+
width: 100%;
|
|
2851
|
+
height: 100%;
|
|
2852
|
+
outline: none;
|
|
2853
|
+
opacity: 0;
|
|
2854
|
+
z-index: 1;
|
|
2855
|
+
padding: 0;
|
|
2856
|
+
margin: 0;
|
|
2857
|
+
|
|
2858
|
+
& + span {
|
|
2859
|
+
position: relative;
|
|
2860
|
+
display: block;
|
|
2861
|
+
height: ${rem(input.checkbox.size)};
|
|
2862
|
+
width: ${rem(input.checkbox.size)};
|
|
2863
|
+
box-sizing: border-box;
|
|
2864
|
+
box-shadow: ${focusRingBorderStyle({
|
|
2415
2865
|
color: color.input.default.enabled.border,
|
|
2416
2866
|
width: input.border.width
|
|
2417
|
-
})
|
|
2867
|
+
})};
|
|
2868
|
+
border-radius: ${rem(radius[2])};
|
|
2869
|
+
line-height: 1;
|
|
2870
|
+
background-color: ${color.input.default.enabled.bg};
|
|
2871
|
+
|
|
2872
|
+
& > svg {
|
|
2873
|
+
display: block;
|
|
2874
|
+
position: absolute;
|
|
2875
|
+
opacity: 0;
|
|
2876
|
+
height: 100%;
|
|
2877
|
+
width: 100%;
|
|
2878
|
+
|
|
2879
|
+
& > path {
|
|
2880
|
+
vector-effect: non-scaling-stroke;
|
|
2881
|
+
stroke-width: 1.5px !important;
|
|
2882
|
+
}
|
|
2883
|
+
}
|
|
2884
|
+
}
|
|
2885
|
+
|
|
2886
|
+
&:checked + span {
|
|
2887
|
+
background: ${color.input.default.enabled.fg};
|
|
2888
|
+
box-shadow: ${focusRingBorderStyle({
|
|
2418
2889
|
color: color.input.default.enabled.fg,
|
|
2419
2890
|
width: input.border.width
|
|
2420
|
-
})
|
|
2891
|
+
})};
|
|
2892
|
+
color: ${color.input.default.enabled.bg};
|
|
2893
|
+
}
|
|
2894
|
+
|
|
2895
|
+
/* focus */
|
|
2896
|
+
&:not(:disabled):focus:focus-visible + span {
|
|
2897
|
+
box-shadow: ${focusRingStyle({ focusRing })};
|
|
2898
|
+
}
|
|
2899
|
+
|
|
2900
|
+
/* focus when checked - uses a different offset */
|
|
2901
|
+
&:not(:disabled):focus:focus-visible&:checked + span {
|
|
2902
|
+
box-shadow: ${focusRingStyle({ focusRing: { width: 1, offset: 1 } })};
|
|
2903
|
+
}
|
|
2904
|
+
|
|
2905
|
+
&[data-error] + span {
|
|
2906
|
+
background-color: ${color.input.invalid.enabled.border};
|
|
2907
|
+
box-shadow: ${focusRingBorderStyle({
|
|
2421
2908
|
width: input.border.width,
|
|
2422
2909
|
color: color.input.invalid.enabled.muted.bg
|
|
2423
|
-
})
|
|
2910
|
+
})};
|
|
2911
|
+
color: ${color.input.default.disabled.fg};
|
|
2912
|
+
}
|
|
2913
|
+
&[data-error]&:checked + span {
|
|
2914
|
+
background-color: ${color.input.invalid.enabled.muted.bg};
|
|
2915
|
+
color: ${color.input.default.enabled.bg};
|
|
2916
|
+
}
|
|
2917
|
+
&[data-error]&:checked&:not(:disabled):focus:focus-visible + span {
|
|
2918
|
+
box-shadow: ${focusRingStyle({
|
|
2424
2919
|
border: { width: input.border.width, color: color.input.invalid.readOnly.muted.bg },
|
|
2425
2920
|
focusRing: { width: 1, offset: 1 }
|
|
2426
|
-
})
|
|
2921
|
+
})};
|
|
2922
|
+
}
|
|
2923
|
+
|
|
2924
|
+
&:disabled + span {
|
|
2925
|
+
background-color: ${color.input.default.disabled.bg};
|
|
2926
|
+
box-shadow: ${focusRingBorderStyle({
|
|
2427
2927
|
width: input.border.width,
|
|
2428
2928
|
color: color.input.default.disabled.border
|
|
2429
|
-
})
|
|
2929
|
+
})};
|
|
2930
|
+
color: ${color.input.default.disabled.fg};
|
|
2931
|
+
}
|
|
2932
|
+
&:disabled&:checked + span {
|
|
2933
|
+
background-color: ${color.input.default.disabled.muted.bg};
|
|
2934
|
+
}
|
|
2935
|
+
|
|
2936
|
+
&[data-read-only] + span {
|
|
2937
|
+
background-color: ${color.input.default.readOnly.bg};
|
|
2938
|
+
box-shadow: ${focusRingBorderStyle({
|
|
2430
2939
|
width: input.border.width,
|
|
2431
2940
|
color: color.input.default.readOnly.border
|
|
2432
|
-
})
|
|
2941
|
+
})};
|
|
2942
|
+
color: ${color.input.default.readOnly.fg};
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2945
|
+
&[data-read-only]&:checked + span {
|
|
2946
|
+
background-color: ${color.input.default.readOnly.muted.bg};
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2949
|
+
&:checked + span > svg:first-child {
|
|
2950
|
+
opacity: 1;
|
|
2951
|
+
}
|
|
2952
|
+
&:indeterminate + span > svg:last-child {
|
|
2953
|
+
opacity: 1;
|
|
2954
|
+
}
|
|
2955
|
+
`;
|
|
2433
2956
|
}
|
|
2434
2957
|
|
|
2435
2958
|
const Root$r = styled.div(checkboxBaseStyles);
|
|
@@ -2473,10 +2996,6 @@ const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
|
|
|
2473
2996
|
] });
|
|
2474
2997
|
});
|
|
2475
2998
|
|
|
2476
|
-
var __freeze$t = Object.freeze;
|
|
2477
|
-
var __defProp$u = Object.defineProperty;
|
|
2478
|
-
var __template$t = (cooked, raw) => __freeze$t(__defProp$u(cooked, "raw", { value: __freeze$t(raw || cooked.slice()) }));
|
|
2479
|
-
var _a$t;
|
|
2480
2999
|
function codeSyntaxHighlightingStyle({ theme }) {
|
|
2481
3000
|
const {
|
|
2482
3001
|
color: { syntax: color }
|
|
@@ -2521,7 +3040,33 @@ function codeSyntaxHighlightingStyle({ theme }) {
|
|
|
2521
3040
|
};
|
|
2522
3041
|
}
|
|
2523
3042
|
function codeBaseStyle() {
|
|
2524
|
-
return css
|
|
3043
|
+
return css`
|
|
3044
|
+
color: var(--card-code-fg-color);
|
|
3045
|
+
|
|
3046
|
+
& code {
|
|
3047
|
+
font-family: inherit;
|
|
3048
|
+
|
|
3049
|
+
&.refractor .token {
|
|
3050
|
+
${codeSyntaxHighlightingStyle}
|
|
3051
|
+
}
|
|
3052
|
+
}
|
|
3053
|
+
|
|
3054
|
+
& a {
|
|
3055
|
+
color: inherit;
|
|
3056
|
+
text-decoration: underline;
|
|
3057
|
+
border-radius: 1px;
|
|
3058
|
+
}
|
|
3059
|
+
|
|
3060
|
+
& svg {
|
|
3061
|
+
/* Certain popular CSS libraries changes the defaults for SVG display */
|
|
3062
|
+
/* Make sure SVGs are rendered as inline elements */
|
|
3063
|
+
display: inline;
|
|
3064
|
+
}
|
|
3065
|
+
|
|
3066
|
+
& [data-sanity-icon] {
|
|
3067
|
+
vertical-align: baseline;
|
|
3068
|
+
}
|
|
3069
|
+
`;
|
|
2525
3070
|
}
|
|
2526
3071
|
|
|
2527
3072
|
const Root$q = styled.pre(codeBaseStyle, responsiveCodeFontStyle);
|
|
@@ -2591,22 +3136,70 @@ const Grid = forwardRef(function Grid2(props, ref) {
|
|
|
2591
3136
|
);
|
|
2592
3137
|
});
|
|
2593
3138
|
|
|
2594
|
-
var __freeze$s = Object.freeze;
|
|
2595
|
-
var __defProp$t = Object.defineProperty;
|
|
2596
|
-
var __template$s = (cooked, raw) => __freeze$s(__defProp$t(cooked, "raw", { value: __freeze$s(raw || cooked.slice()) }));
|
|
2597
|
-
var _a$s, _b$g, _c$8;
|
|
2598
3139
|
function headingBaseStyle(props) {
|
|
2599
3140
|
const { $accent, $muted } = props;
|
|
2600
3141
|
const { font } = getTheme_v2(props.theme);
|
|
2601
|
-
return css
|
|
3142
|
+
return css`
|
|
3143
|
+
${$accent && css`
|
|
3144
|
+
color: var(--card-accent-fg-color);
|
|
3145
|
+
`}
|
|
3146
|
+
|
|
3147
|
+
${$muted && css`
|
|
3148
|
+
color: var(--card-muted-fg-color);
|
|
3149
|
+
`}
|
|
3150
|
+
|
|
3151
|
+
& code {
|
|
3152
|
+
font-family: ${font.code.family};
|
|
3153
|
+
border-radius: 1px;
|
|
3154
|
+
}
|
|
3155
|
+
|
|
3156
|
+
& a {
|
|
3157
|
+
text-decoration: none;
|
|
3158
|
+
border-radius: 1px;
|
|
3159
|
+
color: var(--card-link-color);
|
|
3160
|
+
outline: none;
|
|
3161
|
+
|
|
3162
|
+
@media (hover: hover) {
|
|
3163
|
+
&:hover {
|
|
3164
|
+
text-decoration: underline;
|
|
3165
|
+
}
|
|
3166
|
+
}
|
|
3167
|
+
|
|
3168
|
+
&:focus {
|
|
3169
|
+
box-shadow:
|
|
3170
|
+
0 0 0 1px var(--card-bg-color),
|
|
3171
|
+
0 0 0 3px var(--card-focus-ring-color);
|
|
3172
|
+
}
|
|
3173
|
+
|
|
3174
|
+
&:focus:not(:focus-visible) {
|
|
3175
|
+
box-shadow: none;
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3178
|
+
|
|
3179
|
+
& strong {
|
|
3180
|
+
font-weight: ${font.heading.weights.bold};
|
|
3181
|
+
}
|
|
3182
|
+
|
|
3183
|
+
& svg {
|
|
3184
|
+
/* Certain popular CSS libraries changes the defaults for SVG display */
|
|
3185
|
+
/* Make sure SVGs are rendered as inline elements */
|
|
3186
|
+
display: inline;
|
|
3187
|
+
}
|
|
3188
|
+
|
|
3189
|
+
& [data-sanity-icon] {
|
|
3190
|
+
vertical-align: baseline;
|
|
3191
|
+
}
|
|
3192
|
+
`;
|
|
2602
3193
|
}
|
|
2603
3194
|
|
|
2604
|
-
var __freeze$r = Object.freeze;
|
|
2605
|
-
var __defProp$s = Object.defineProperty;
|
|
2606
|
-
var __template$r = (cooked, raw) => __freeze$r(__defProp$s(cooked, "raw", { value: __freeze$r(raw || cooked.slice()) }));
|
|
2607
|
-
var _a$r;
|
|
2608
3195
|
const Root$n = styled.div(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont);
|
|
2609
|
-
const SpanWithTextOverflow = styled.span
|
|
3196
|
+
const SpanWithTextOverflow = styled.span`
|
|
3197
|
+
display: block;
|
|
3198
|
+
white-space: nowrap;
|
|
3199
|
+
text-overflow: ellipsis;
|
|
3200
|
+
overflow: hidden;
|
|
3201
|
+
overflow: clip;
|
|
3202
|
+
`;
|
|
2610
3203
|
const Heading = forwardRef(function Heading2(props, ref) {
|
|
2611
3204
|
const {
|
|
2612
3205
|
accent = false,
|
|
@@ -2655,8 +3248,8 @@ function inlineSpaceStyle(props) {
|
|
|
2655
3248
|
return _responsive(media, props.$space, (spaceIndex) => {
|
|
2656
3249
|
const _space = rem(spaceIndex === 0.5 ? space[1] / 2 : space[spaceIndex]);
|
|
2657
3250
|
return {
|
|
2658
|
-
margin:
|
|
2659
|
-
"& > div": { padding:
|
|
3251
|
+
margin: `-${_space} 0 0 -${_space}`,
|
|
3252
|
+
"& > div": { padding: `${_space} 0 0 ${_space}` }
|
|
2660
3253
|
};
|
|
2661
3254
|
});
|
|
2662
3255
|
}
|
|
@@ -2681,12 +3274,22 @@ const Inline = forwardRef(function Inline2(props, ref) {
|
|
|
2681
3274
|
);
|
|
2682
3275
|
});
|
|
2683
3276
|
|
|
2684
|
-
var __freeze$q = Object.freeze;
|
|
2685
|
-
var __defProp$r = Object.defineProperty;
|
|
2686
|
-
var __template$q = (cooked, raw) => __freeze$q(__defProp$r(cooked, "raw", { value: __freeze$q(raw || cooked.slice()) }));
|
|
2687
|
-
var _a$q;
|
|
2688
3277
|
function kbdStyle() {
|
|
2689
|
-
return css
|
|
3278
|
+
return css`
|
|
3279
|
+
--card-bg-color: var(--card-kbd-bg-color);
|
|
3280
|
+
--card-border-color: var(--card-kbd-border-color);
|
|
3281
|
+
--card-fg-color: var(--card-kbd-fg-color);
|
|
3282
|
+
|
|
3283
|
+
box-shadow: inset 0 0 0 1px var(--card-border-color);
|
|
3284
|
+
background: var(--card-bg-color);
|
|
3285
|
+
font: inherit;
|
|
3286
|
+
|
|
3287
|
+
vertical-align: top;
|
|
3288
|
+
|
|
3289
|
+
&:not([hidden]) {
|
|
3290
|
+
display: inline-block;
|
|
3291
|
+
}
|
|
3292
|
+
`;
|
|
2690
3293
|
}
|
|
2691
3294
|
const Root$l = styled.kbd(responsiveRadiusStyle, kbdStyle);
|
|
2692
3295
|
const KBD = forwardRef(function KBD2(props, ref) {
|
|
@@ -2769,24 +3372,70 @@ function getRoundedCommands(points) {
|
|
|
2769
3372
|
function compileCommands(cmds) {
|
|
2770
3373
|
return cmds.map((n, idx) => {
|
|
2771
3374
|
if (n.type === "point") {
|
|
2772
|
-
return
|
|
3375
|
+
return `${idx === 0 ? "M" : "L"} ${n.x} ${n.y}`;
|
|
2773
3376
|
}
|
|
2774
3377
|
if (n.type === "curve") {
|
|
2775
|
-
return
|
|
3378
|
+
return `C ${n.startControl.x} ${n.startControl.y} ${n.endControl.x} ${n.endControl.y} ${n.curveEnd.x} ${n.curveEnd.y}`;
|
|
2776
3379
|
}
|
|
2777
|
-
return
|
|
3380
|
+
return ``;
|
|
2778
3381
|
}).join(" ");
|
|
2779
3382
|
}
|
|
2780
3383
|
|
|
2781
|
-
var __freeze$p = Object.freeze;
|
|
2782
|
-
var __defProp$q = Object.defineProperty;
|
|
2783
|
-
var __template$p = (cooked, raw) => __freeze$p(__defProp$q(cooked, "raw", { value: __freeze$p(raw || cooked.slice()) }));
|
|
2784
|
-
var _a$p, _b$f, _c$7;
|
|
2785
3384
|
const Root$k = styled.div(
|
|
2786
|
-
({ $w: w }) => css
|
|
3385
|
+
({ $w: w }) => css`
|
|
3386
|
+
position: absolute;
|
|
3387
|
+
width: ${w}px;
|
|
3388
|
+
height: ${w}px;
|
|
3389
|
+
|
|
3390
|
+
:empty + & {
|
|
3391
|
+
display: none;
|
|
3392
|
+
}
|
|
3393
|
+
|
|
3394
|
+
& > svg {
|
|
3395
|
+
display: block;
|
|
3396
|
+
line-height: 0;
|
|
3397
|
+
transform-origin: ${w / 2}px ${w / 2}px;
|
|
3398
|
+
}
|
|
3399
|
+
|
|
3400
|
+
[data-placement^='top'] > & {
|
|
3401
|
+
bottom: -${w}px;
|
|
3402
|
+
|
|
3403
|
+
& > svg {
|
|
3404
|
+
transform: rotate(0);
|
|
3405
|
+
}
|
|
3406
|
+
}
|
|
3407
|
+
|
|
3408
|
+
[data-placement^='right'] > & {
|
|
3409
|
+
left: -${w}px;
|
|
3410
|
+
|
|
3411
|
+
& > svg {
|
|
3412
|
+
transform: rotate(90deg);
|
|
3413
|
+
}
|
|
3414
|
+
}
|
|
3415
|
+
|
|
3416
|
+
[data-placement^='left'] > & {
|
|
3417
|
+
right: -${w}px;
|
|
3418
|
+
|
|
3419
|
+
& > svg {
|
|
3420
|
+
transform: rotate(-90deg);
|
|
3421
|
+
}
|
|
3422
|
+
}
|
|
3423
|
+
|
|
3424
|
+
[data-placement^='bottom'] > & {
|
|
3425
|
+
top: -${w}px;
|
|
3426
|
+
|
|
3427
|
+
& > svg {
|
|
3428
|
+
transform: rotate(180deg);
|
|
3429
|
+
}
|
|
3430
|
+
}
|
|
3431
|
+
`
|
|
2787
3432
|
);
|
|
2788
|
-
const StrokePath = styled.path
|
|
2789
|
-
|
|
3433
|
+
const StrokePath = styled.path`
|
|
3434
|
+
stroke: var(--card-shadow-outline-color);
|
|
3435
|
+
`;
|
|
3436
|
+
const ShapePath = styled.path`
|
|
3437
|
+
fill: var(--card-bg-color);
|
|
3438
|
+
`;
|
|
2790
3439
|
const Arrow = forwardRef(function Arrow2(props, ref) {
|
|
2791
3440
|
const { width: w, height: h, radius = 0, ...restProps } = props;
|
|
2792
3441
|
const { card } = useTheme_v2();
|
|
@@ -2819,9 +3468,9 @@ const Arrow = forwardRef(function Arrow2(props, ref) {
|
|
|
2819
3468
|
];
|
|
2820
3469
|
const cmds = getRoundedCommands(points);
|
|
2821
3470
|
const path = compileCommands(cmds);
|
|
2822
|
-
const strokePath =
|
|
2823
|
-
const fillPath =
|
|
2824
|
-
return /* @__PURE__ */ jsx(Root$k, { ...restProps, $w: w, ref, children: /* @__PURE__ */ jsxs("svg", { width: w, height: w, viewBox:
|
|
3471
|
+
const strokePath = `${path}`;
|
|
3472
|
+
const fillPath = `${path} M ${w} -1 M 0 -1 Z`;
|
|
3473
|
+
return /* @__PURE__ */ jsx(Root$k, { ...restProps, $w: w, ref, children: /* @__PURE__ */ jsxs("svg", { width: w, height: w, viewBox: `0 0 ${w} ${w}`, children: [
|
|
2825
3474
|
/* @__PURE__ */ jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsx("rect", { x: 0, y: strokeWidth, width: w, height: w, fill: "white" }) }),
|
|
2826
3475
|
/* @__PURE__ */ jsx(StrokePath, { d: strokePath, mask: "url(#stroke-mask)", strokeWidth: strokeWidth * 2 }),
|
|
2827
3476
|
/* @__PURE__ */ jsx(ShapePath, { d: fillPath })
|
|
@@ -2892,10 +3541,7 @@ const ElementQuery = forwardRef(function ElementQuery2(props, ref) {
|
|
|
2892
3541
|
const forwardedRef = useForwardedRef(ref);
|
|
2893
3542
|
const [element, setElement] = useState(null);
|
|
2894
3543
|
const elementSize = useElementSize(element);
|
|
2895
|
-
const width = useMemo(() =>
|
|
2896
|
-
var _a;
|
|
2897
|
-
return (_a = elementSize == null ? void 0 : elementSize.border.width) != null ? _a : window.innerWidth;
|
|
2898
|
-
}, [elementSize]);
|
|
3544
|
+
const width = useMemo(() => (elementSize == null ? void 0 : elementSize.border.width) ?? window.innerWidth, [elementSize]);
|
|
2899
3545
|
const max = useMemo(() => findMaxBreakpoints(media, width), [media, width]);
|
|
2900
3546
|
const min = useMemo(() => findMinBreakpoints(media, width), [media, width]);
|
|
2901
3547
|
const setRef = useCallback(
|
|
@@ -2918,17 +3564,8 @@ const ElementQuery = forwardRef(function ElementQuery2(props, ref) {
|
|
|
2918
3564
|
);
|
|
2919
3565
|
});
|
|
2920
3566
|
|
|
2921
|
-
var __defProp$p = Object.defineProperty;
|
|
2922
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2923
|
-
var __publicField = (obj, key, value) => {
|
|
2924
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2925
|
-
return value;
|
|
2926
|
-
};
|
|
2927
3567
|
class ErrorBoundary extends Component {
|
|
2928
|
-
|
|
2929
|
-
super(...arguments);
|
|
2930
|
-
__publicField(this, "state", { error: null });
|
|
2931
|
-
}
|
|
3568
|
+
state = { error: null };
|
|
2932
3569
|
static getDerivedStateFromError(error) {
|
|
2933
3570
|
return { error };
|
|
2934
3571
|
}
|
|
@@ -2971,9 +3608,9 @@ function useLayer() {
|
|
|
2971
3608
|
return getLayerContext(value);
|
|
2972
3609
|
} catch (err) {
|
|
2973
3610
|
if (err instanceof Error) {
|
|
2974
|
-
throw new Error(
|
|
3611
|
+
throw new Error(`useLayer(): ${err.message}`);
|
|
2975
3612
|
} else {
|
|
2976
|
-
throw new Error(
|
|
3613
|
+
throw new Error(`useLayer(): ${err}`);
|
|
2977
3614
|
}
|
|
2978
3615
|
}
|
|
2979
3616
|
}
|
|
@@ -3076,12 +3713,11 @@ function _isScrollable(el) {
|
|
|
3076
3713
|
}
|
|
3077
3714
|
|
|
3078
3715
|
function LayerProvider(props) {
|
|
3079
|
-
var _a;
|
|
3080
3716
|
const { children, zOffset: zOffsetProp = 0 } = props;
|
|
3081
3717
|
const parentContextValue = useContext(LayerContext);
|
|
3082
3718
|
const parent = parentContextValue && getLayerContext(parentContextValue);
|
|
3083
3719
|
const parentRegisterChild = parent == null ? void 0 : parent.registerChild;
|
|
3084
|
-
const parentLevel = (
|
|
3720
|
+
const parentLevel = (parent == null ? void 0 : parent.level) ?? 0;
|
|
3085
3721
|
const level = parentLevel + 1;
|
|
3086
3722
|
const zOffset = useArrayProp(zOffsetProp);
|
|
3087
3723
|
const maxMediaIndex = zOffset.length - 1;
|
|
@@ -3095,8 +3731,7 @@ function LayerProvider(props) {
|
|
|
3095
3731
|
const parentDispose = parentRegisterChild == null ? void 0 : parentRegisterChild(childLevel);
|
|
3096
3732
|
if (childLevel !== void 0) {
|
|
3097
3733
|
setChildLayers((state) => {
|
|
3098
|
-
|
|
3099
|
-
const prevLen = (_a2 = state[childLevel]) != null ? _a2 : 0;
|
|
3734
|
+
const prevLen = state[childLevel] ?? 0;
|
|
3100
3735
|
const nextState = { ...state, [childLevel]: prevLen + 1 };
|
|
3101
3736
|
setSize(Object.keys(nextState).length);
|
|
3102
3737
|
return nextState;
|
|
@@ -3261,22 +3896,27 @@ function PortalProvider(props) {
|
|
|
3261
3896
|
return /* @__PURE__ */ jsx(PortalContext.Provider, { value, children });
|
|
3262
3897
|
}
|
|
3263
3898
|
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3899
|
+
const Root$i = styled.div`
|
|
3900
|
+
display: block;
|
|
3901
|
+
width: 0;
|
|
3902
|
+
height: 0;
|
|
3903
|
+
position: absolute;
|
|
3904
|
+
overflow: hidden;
|
|
3905
|
+
overflow: clip;
|
|
3906
|
+
`;
|
|
3269
3907
|
const SrOnly = forwardRef(function SrOnly2(props, ref) {
|
|
3270
3908
|
const { as, children } = props;
|
|
3271
3909
|
return /* @__PURE__ */ jsx(Root$i, { "aria-hidden": true, as, "data-ui": "SrOnly", ref, children });
|
|
3272
3910
|
});
|
|
3273
3911
|
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3912
|
+
const Root$h = styled.div`
|
|
3913
|
+
position: relative;
|
|
3914
|
+
`;
|
|
3915
|
+
const ItemWrapper = styled.div`
|
|
3916
|
+
position: absolute;
|
|
3917
|
+
left: 0;
|
|
3918
|
+
right: 0;
|
|
3919
|
+
`;
|
|
3280
3920
|
const VirtualList = forwardRef(function VirtualList2(props, ref) {
|
|
3281
3921
|
const { as = "div", gap = 0, getItemKey, items = [], onChange, renderItem, ...restProps } = props;
|
|
3282
3922
|
const { space } = useTheme_v2();
|
|
@@ -3444,16 +4084,23 @@ function calcMaxWidth(params) {
|
|
|
3444
4084
|
return void 0;
|
|
3445
4085
|
}
|
|
3446
4086
|
return Math.min(
|
|
3447
|
-
currentWidth
|
|
4087
|
+
currentWidth ?? Infinity,
|
|
3448
4088
|
(boundaryWidth || Infinity) - DEFAULT_POPOVER_PADDING * 2
|
|
3449
4089
|
);
|
|
3450
4090
|
}
|
|
3451
4091
|
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
4092
|
+
const MotionCard$1 = styled(motion(Card))`
|
|
4093
|
+
&:not([hidden]) {
|
|
4094
|
+
display: flex;
|
|
4095
|
+
}
|
|
4096
|
+
flex-direction: column;
|
|
4097
|
+
width: max-content;
|
|
4098
|
+
min-width: min-content;
|
|
4099
|
+
& > * {
|
|
4100
|
+
opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
|
|
4101
|
+
will-change: opacity;
|
|
4102
|
+
}
|
|
4103
|
+
`;
|
|
3457
4104
|
const PopoverCard = memo(
|
|
3458
4105
|
forwardRef(function PopoverCard2(props, ref) {
|
|
3459
4106
|
const {
|
|
@@ -3485,8 +4132,8 @@ const PopoverCard = memo(
|
|
|
3485
4132
|
() => marginsProp || DEFAULT_POPOVER_MARGINS,
|
|
3486
4133
|
[marginsProp]
|
|
3487
4134
|
);
|
|
3488
|
-
const x = (xProp
|
|
3489
|
-
const y = (yProp
|
|
4135
|
+
const x = (xProp ?? 0) + margins[3];
|
|
4136
|
+
const y = (yProp ?? 0) + margins[0];
|
|
3490
4137
|
const rootStyle = useMemo(
|
|
3491
4138
|
() => ({
|
|
3492
4139
|
left: x,
|
|
@@ -3545,7 +4192,7 @@ PopoverCard.displayName = "PopoverCard";
|
|
|
3545
4192
|
|
|
3546
4193
|
const Popover = memo(
|
|
3547
4194
|
forwardRef(function Popover2(props, ref) {
|
|
3548
|
-
var _a, _b, _c, _d, _e, _f
|
|
4195
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3549
4196
|
const { container, layer } = useTheme_v2();
|
|
3550
4197
|
const boundaryElementContext = useBoundaryElement();
|
|
3551
4198
|
const {
|
|
@@ -3557,9 +4204,9 @@ const Popover = memo(
|
|
|
3557
4204
|
constrainSize = false,
|
|
3558
4205
|
content,
|
|
3559
4206
|
disabled,
|
|
3560
|
-
fallbackPlacements =
|
|
4207
|
+
fallbackPlacements = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"],
|
|
3561
4208
|
matchReferenceWidth,
|
|
3562
|
-
floatingBoundary =
|
|
4209
|
+
floatingBoundary = props.boundaryElement ?? boundaryElementContext.element,
|
|
3563
4210
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3564
4211
|
onActivate,
|
|
3565
4212
|
open,
|
|
@@ -3569,7 +4216,7 @@ const Popover = memo(
|
|
|
3569
4216
|
portal,
|
|
3570
4217
|
preventOverflow = true,
|
|
3571
4218
|
radius: radiusProp = 3,
|
|
3572
|
-
referenceBoundary =
|
|
4219
|
+
referenceBoundary = props.boundaryElement ?? boundaryElementContext.element,
|
|
3573
4220
|
referenceElement,
|
|
3574
4221
|
scheme,
|
|
3575
4222
|
shadow: shadowProp = 3,
|
|
@@ -3581,7 +4228,7 @@ const Popover = memo(
|
|
|
3581
4228
|
} = props;
|
|
3582
4229
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
3583
4230
|
const animate = prefersReducedMotion ? false : _animate;
|
|
3584
|
-
const boundarySize = (
|
|
4231
|
+
const boundarySize = (_a = useElementSize(boundaryElement)) == null ? void 0 : _a.border;
|
|
3585
4232
|
const padding = useArrayProp(paddingProp);
|
|
3586
4233
|
const radius = useArrayProp(radiusProp);
|
|
3587
4234
|
const shadow = useArrayProp(shadowProp);
|
|
@@ -3614,13 +4261,13 @@ const Popover = memo(
|
|
|
3614
4261
|
const referenceWidth = referenceWidthRef.current;
|
|
3615
4262
|
if (matchReferenceWidth) {
|
|
3616
4263
|
if (referenceWidth !== void 0) {
|
|
3617
|
-
floatingElement.style.width =
|
|
4264
|
+
floatingElement.style.width = `${referenceWidth}px`;
|
|
3618
4265
|
}
|
|
3619
4266
|
} else if (width !== void 0) {
|
|
3620
|
-
floatingElement.style.width =
|
|
4267
|
+
floatingElement.style.width = `${width}px`;
|
|
3621
4268
|
}
|
|
3622
4269
|
if (typeof maxWidth === "number") {
|
|
3623
|
-
floatingElement.style.maxWidth =
|
|
4270
|
+
floatingElement.style.maxWidth = `${maxWidth}px`;
|
|
3624
4271
|
}
|
|
3625
4272
|
}, [width, forwardedRef, matchReferenceWidth, maxWidth, open]);
|
|
3626
4273
|
const middleware = useMemo(() => {
|
|
@@ -3644,16 +4291,16 @@ const Popover = memo(
|
|
|
3644
4291
|
const _currentWidth = widthRef.current;
|
|
3645
4292
|
const _maxWidth = maxWidthRef.current;
|
|
3646
4293
|
if (matchReferenceWidth) {
|
|
3647
|
-
elements.floating.style.width =
|
|
4294
|
+
elements.floating.style.width = `${referenceWidth}px`;
|
|
3648
4295
|
} else if (_currentWidth !== void 0) {
|
|
3649
|
-
elements.floating.style.width =
|
|
4296
|
+
elements.floating.style.width = `${_currentWidth}px`;
|
|
3650
4297
|
}
|
|
3651
4298
|
if (constrainSize) {
|
|
3652
|
-
elements.floating.style.maxWidth =
|
|
4299
|
+
elements.floating.style.maxWidth = `${Math.min(
|
|
3653
4300
|
availableWidth,
|
|
3654
|
-
_maxWidth
|
|
3655
|
-
)
|
|
3656
|
-
elements.floating.style.maxHeight =
|
|
4301
|
+
_maxWidth ?? Infinity
|
|
4302
|
+
)}px`;
|
|
4303
|
+
elements.floating.style.maxHeight = `${availableHeight}px`;
|
|
3657
4304
|
}
|
|
3658
4305
|
},
|
|
3659
4306
|
boundaryElement: floatingBoundary || void 0,
|
|
@@ -3708,11 +4355,11 @@ const Popover = memo(
|
|
|
3708
4355
|
placement: placementProp,
|
|
3709
4356
|
whileElementsMounted: autoUpdate
|
|
3710
4357
|
});
|
|
3711
|
-
const referenceHidden = (
|
|
3712
|
-
const arrowX = (
|
|
3713
|
-
const arrowY = (
|
|
3714
|
-
const originX = (
|
|
3715
|
-
const originY = (
|
|
4358
|
+
const referenceHidden = (_b = middlewareData.hide) == null ? void 0 : _b.referenceHidden;
|
|
4359
|
+
const arrowX = (_c = middlewareData.arrow) == null ? void 0 : _c.x;
|
|
4360
|
+
const arrowY = (_d = middlewareData.arrow) == null ? void 0 : _d.y;
|
|
4361
|
+
const originX = (_e = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _e.originX;
|
|
4362
|
+
const originY = (_f = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _f.originY;
|
|
3716
4363
|
const setArrow = useCallback((arrowEl) => {
|
|
3717
4364
|
arrowRef.current = arrowEl;
|
|
3718
4365
|
}, []);
|
|
@@ -3807,29 +4454,114 @@ const Popover = memo(
|
|
|
3807
4454
|
);
|
|
3808
4455
|
Popover.displayName = "Popover";
|
|
3809
4456
|
|
|
3810
|
-
var __freeze$l = Object.freeze;
|
|
3811
|
-
var __defProp$l = Object.defineProperty;
|
|
3812
|
-
var __template$l = (cooked, raw) => __freeze$l(__defProp$l(cooked, "raw", { value: __freeze$l(raw || cooked.slice()) }));
|
|
3813
|
-
var _a$l, _b$d;
|
|
3814
4457
|
function radioBaseStyle() {
|
|
3815
|
-
return css
|
|
4458
|
+
return css`
|
|
4459
|
+
position: relative;
|
|
4460
|
+
|
|
4461
|
+
&:not([hidden]) {
|
|
4462
|
+
display: inline-block;
|
|
4463
|
+
}
|
|
4464
|
+
|
|
4465
|
+
&[data-read-only] {
|
|
4466
|
+
outline: 1px solid red;
|
|
4467
|
+
}
|
|
4468
|
+
`;
|
|
3816
4469
|
}
|
|
3817
4470
|
function inputElementStyle(props) {
|
|
3818
4471
|
const { color, input } = getTheme_v2(props.theme);
|
|
3819
4472
|
const dist = (input.radio.size - input.radio.markSize) / 2;
|
|
3820
|
-
return css
|
|
4473
|
+
return css`
|
|
4474
|
+
appearance: none;
|
|
4475
|
+
position: absolute;
|
|
4476
|
+
top: 0;
|
|
4477
|
+
left: 0;
|
|
4478
|
+
opacity: 0;
|
|
4479
|
+
height: 100%;
|
|
4480
|
+
width: 100%;
|
|
4481
|
+
outline: none;
|
|
4482
|
+
z-index: 1;
|
|
4483
|
+
padding: 0;
|
|
4484
|
+
margin: 0;
|
|
4485
|
+
border-radius: ${rem(input.radio.size / 2)};
|
|
4486
|
+
border: none;
|
|
4487
|
+
|
|
4488
|
+
/* enabled */
|
|
4489
|
+
& + span {
|
|
4490
|
+
display: block;
|
|
4491
|
+
position: relative;
|
|
4492
|
+
height: ${rem(input.radio.size)};
|
|
4493
|
+
width: ${rem(input.radio.size)};
|
|
4494
|
+
border-radius: ${rem(input.radio.size / 2)};
|
|
4495
|
+
background: ${color.input.default.enabled.bg};
|
|
4496
|
+
box-shadow: ${focusRingBorderStyle({
|
|
3821
4497
|
color: color.input.default.enabled.border,
|
|
3822
4498
|
width: input.border.width
|
|
3823
|
-
})
|
|
4499
|
+
})};
|
|
4500
|
+
|
|
4501
|
+
&::after {
|
|
4502
|
+
content: '';
|
|
4503
|
+
position: absolute;
|
|
4504
|
+
top: ${rem(dist)};
|
|
4505
|
+
left: ${rem(dist)};
|
|
4506
|
+
height: ${rem(input.radio.markSize)};
|
|
4507
|
+
width: ${rem(input.radio.markSize)};
|
|
4508
|
+
border-radius: ${rem(input.radio.markSize / 2)};
|
|
4509
|
+
background: ${color.input.default.enabled.fg};
|
|
4510
|
+
opacity: 0;
|
|
4511
|
+
}
|
|
4512
|
+
}
|
|
4513
|
+
|
|
4514
|
+
/* focused */
|
|
4515
|
+
&:not(:disabled):focus + span {
|
|
4516
|
+
box-shadow: ${focusRingStyle({
|
|
3824
4517
|
border: { width: input.border.width, color: color.input.default.enabled.border },
|
|
3825
4518
|
focusRing: input.radio.focusRing
|
|
3826
|
-
})
|
|
4519
|
+
})};
|
|
4520
|
+
}
|
|
4521
|
+
|
|
4522
|
+
&:not(:disabled):focus:not(:focus-visible) + span {
|
|
4523
|
+
box-shadow: ${focusRingBorderStyle({
|
|
3827
4524
|
color: color.input.default.enabled.border,
|
|
3828
4525
|
width: input.border.width
|
|
3829
|
-
})
|
|
4526
|
+
})};
|
|
4527
|
+
}
|
|
4528
|
+
|
|
4529
|
+
&:checked + span::after {
|
|
4530
|
+
opacity: 1;
|
|
4531
|
+
}
|
|
4532
|
+
|
|
4533
|
+
/* customValidity */
|
|
4534
|
+
&[data-error] + span {
|
|
4535
|
+
background-color: ${color.input.invalid.enabled.border};
|
|
4536
|
+
box-shadow: ${focusRingBorderStyle({
|
|
3830
4537
|
width: input.border.width,
|
|
3831
4538
|
color: color.input.invalid.enabled.muted.bg
|
|
3832
|
-
})
|
|
4539
|
+
})};
|
|
4540
|
+
&::after {
|
|
4541
|
+
background: ${color.input.invalid.enabled.muted.bg};
|
|
4542
|
+
}
|
|
4543
|
+
}
|
|
4544
|
+
|
|
4545
|
+
/* read only */
|
|
4546
|
+
&[data-read-only] + span {
|
|
4547
|
+
box-shadow: 0 0 0 1px ${color.input.default.readOnly.border};
|
|
4548
|
+
background: ${color.input.default.readOnly.bg};
|
|
4549
|
+
|
|
4550
|
+
&::after {
|
|
4551
|
+
background: ${color.input.default.readOnly.border};
|
|
4552
|
+
}
|
|
4553
|
+
}
|
|
4554
|
+
|
|
4555
|
+
/* disabled */
|
|
4556
|
+
&:not([data-read-only]):disabled + span {
|
|
4557
|
+
box-shadow: 0 0 0 1px ${color.input.default.disabled.border};
|
|
4558
|
+
background: ${color.input.default.disabled.bg};
|
|
4559
|
+
|
|
4560
|
+
&::after {
|
|
4561
|
+
background: ${color.input.default.disabled.border};
|
|
4562
|
+
}
|
|
4563
|
+
}
|
|
4564
|
+
`;
|
|
3833
4565
|
}
|
|
3834
4566
|
|
|
3835
4567
|
const Root$g = styled.div(radioBaseStyle);
|
|
@@ -3855,35 +4587,86 @@ const Radio = forwardRef(function Radio2(props, forwardedRef) {
|
|
|
3855
4587
|
] });
|
|
3856
4588
|
});
|
|
3857
4589
|
|
|
3858
|
-
var __freeze$k = Object.freeze;
|
|
3859
|
-
var __defProp$k = Object.defineProperty;
|
|
3860
|
-
var __template$k = (cooked, raw) => __freeze$k(__defProp$k(cooked, "raw", { value: __freeze$k(raw || cooked.slice()) }));
|
|
3861
|
-
var _a$k, _b$c, _c$6, _d$5;
|
|
3862
4590
|
function rootStyle() {
|
|
3863
|
-
return css
|
|
4591
|
+
return css`
|
|
4592
|
+
position: relative;
|
|
4593
|
+
width: -moz-available;
|
|
4594
|
+
width: -webkit-fill-available;
|
|
4595
|
+
width: stretch;
|
|
4596
|
+
|
|
4597
|
+
&:not([hidden]) {
|
|
4598
|
+
display: inline-block;
|
|
4599
|
+
}
|
|
4600
|
+
`;
|
|
3864
4601
|
}
|
|
3865
4602
|
function inputBaseStyle(props) {
|
|
3866
4603
|
const { font } = getTheme_v2(props.theme);
|
|
3867
|
-
return css
|
|
4604
|
+
return css`
|
|
4605
|
+
-webkit-font-smoothing: antialiased;
|
|
4606
|
+
appearance: none;
|
|
4607
|
+
border: 0;
|
|
4608
|
+
font-family: ${font.text.family};
|
|
4609
|
+
color: inherit;
|
|
4610
|
+
width: 100%;
|
|
4611
|
+
outline: none;
|
|
4612
|
+
margin: 0;
|
|
4613
|
+
|
|
4614
|
+
&:disabled {
|
|
4615
|
+
opacity: 1;
|
|
4616
|
+
}
|
|
4617
|
+
`;
|
|
3868
4618
|
}
|
|
3869
4619
|
function inputColorStyle(props) {
|
|
3870
4620
|
const { color, input } = getTheme_v2(props.theme);
|
|
3871
|
-
return css
|
|
4621
|
+
return css`
|
|
4622
|
+
/* enabled */
|
|
4623
|
+
background-color: ${color.input.default.enabled.bg};
|
|
4624
|
+
color: ${color.input.default.enabled.fg};
|
|
4625
|
+
box-shadow: ${focusRingBorderStyle({
|
|
3872
4626
|
color: color.input.default.enabled.border,
|
|
3873
4627
|
width: input.border.width
|
|
3874
|
-
})
|
|
4628
|
+
})};
|
|
4629
|
+
|
|
4630
|
+
/* hovered */
|
|
4631
|
+
@media (hover: hover) {
|
|
4632
|
+
&:not(:disabled):hover {
|
|
4633
|
+
background-color: ${color.input.default.hovered.bg};
|
|
4634
|
+
color: ${color.input.default.hovered.fg};
|
|
4635
|
+
box-shadow: ${focusRingBorderStyle({
|
|
3875
4636
|
color: color.input.default.hovered.border,
|
|
3876
4637
|
width: input.border.width
|
|
3877
|
-
})
|
|
4638
|
+
})};
|
|
4639
|
+
}
|
|
4640
|
+
}
|
|
4641
|
+
|
|
4642
|
+
/* focused */
|
|
4643
|
+
&:not(:disabled):focus {
|
|
4644
|
+
box-shadow: ${focusRingStyle({
|
|
3878
4645
|
border: { width: input.border.width, color: color.input.default.enabled.border },
|
|
3879
4646
|
focusRing: input.select.focusRing
|
|
3880
|
-
})
|
|
4647
|
+
})};
|
|
4648
|
+
}
|
|
4649
|
+
|
|
4650
|
+
/* read-only */
|
|
4651
|
+
&[data-read-only] {
|
|
4652
|
+
background-color: ${color.input.default.readOnly.bg};
|
|
4653
|
+
color: ${color.input.default.readOnly.fg};
|
|
4654
|
+
box-shadow: ${focusRingBorderStyle({
|
|
3881
4655
|
color: color.input.default.readOnly.border,
|
|
3882
4656
|
width: input.border.width
|
|
3883
|
-
})
|
|
4657
|
+
})};
|
|
4658
|
+
}
|
|
4659
|
+
|
|
4660
|
+
/* disabled */
|
|
4661
|
+
&:not([data-read-only]):disabled {
|
|
4662
|
+
background-color: ${color.input.default.disabled.bg};
|
|
4663
|
+
color: ${color.input.default.disabled.fg};
|
|
4664
|
+
box-shadow: ${focusRingBorderStyle({
|
|
3884
4665
|
color: color.input.default.disabled.border,
|
|
3885
4666
|
width: input.border.width
|
|
3886
|
-
})
|
|
4667
|
+
})};
|
|
4668
|
+
}
|
|
4669
|
+
`;
|
|
3887
4670
|
}
|
|
3888
4671
|
function textSize(size) {
|
|
3889
4672
|
return { fontSize: rem(size.fontSize), lineHeight: rem(size.lineHeight) };
|
|
@@ -3908,7 +4691,32 @@ function inputStyle() {
|
|
|
3908
4691
|
}
|
|
3909
4692
|
function iconBoxStyle(props) {
|
|
3910
4693
|
const { color } = getTheme_v2(props.theme);
|
|
3911
|
-
return css
|
|
4694
|
+
return css`
|
|
4695
|
+
pointer-events: none;
|
|
4696
|
+
position: absolute;
|
|
4697
|
+
top: 0;
|
|
4698
|
+
right: 0;
|
|
4699
|
+
|
|
4700
|
+
/* enabled */
|
|
4701
|
+
--card-fg-color: ${color.input.default.enabled.fg};
|
|
4702
|
+
|
|
4703
|
+
/* hover */
|
|
4704
|
+
@media (hover: hover) {
|
|
4705
|
+
select:not(disabled):not(:read-only):hover + && {
|
|
4706
|
+
--card-fg-color: ${color.input.default.hovered.fg};
|
|
4707
|
+
}
|
|
4708
|
+
}
|
|
4709
|
+
|
|
4710
|
+
/* disabled */
|
|
4711
|
+
select:disabled + && {
|
|
4712
|
+
--card-fg-color: ${color.input.default.disabled.fg};
|
|
4713
|
+
}
|
|
4714
|
+
|
|
4715
|
+
/* read-only */
|
|
4716
|
+
select[data-read-only] + && {
|
|
4717
|
+
--card-fg-color: ${color.input.default.readOnly.fg};
|
|
4718
|
+
}
|
|
4719
|
+
`;
|
|
3912
4720
|
}
|
|
3913
4721
|
const selectStyle = {
|
|
3914
4722
|
root: rootStyle,
|
|
@@ -3989,23 +4797,119 @@ const Stack = forwardRef(function Stack2(props, ref) {
|
|
|
3989
4797
|
);
|
|
3990
4798
|
});
|
|
3991
4799
|
|
|
3992
|
-
var __freeze$j = Object.freeze;
|
|
3993
|
-
var __defProp$j = Object.defineProperty;
|
|
3994
|
-
var __template$j = (cooked, raw) => __freeze$j(__defProp$j(cooked, "raw", { value: __freeze$j(raw || cooked.slice()) }));
|
|
3995
|
-
var _a$j, _b$b, _c$5, _d$4, _e$2, _f$2, _g;
|
|
3996
4800
|
function switchBaseStyles() {
|
|
3997
|
-
return css
|
|
4801
|
+
return css`
|
|
4802
|
+
position: relative;
|
|
4803
|
+
&:not([hidden]) {
|
|
4804
|
+
display: inline-block;
|
|
4805
|
+
}
|
|
4806
|
+
`;
|
|
3998
4807
|
}
|
|
3999
4808
|
function switchInputStyles() {
|
|
4000
|
-
return css
|
|
4809
|
+
return css`
|
|
4810
|
+
position: absolute;
|
|
4811
|
+
top: 0;
|
|
4812
|
+
right: 0;
|
|
4813
|
+
bottom: 0;
|
|
4814
|
+
left: 0;
|
|
4815
|
+
opacity: 0;
|
|
4816
|
+
height: 100%;
|
|
4817
|
+
width: 100%;
|
|
4818
|
+
outline: none;
|
|
4819
|
+
padding: 0;
|
|
4820
|
+
margin: 0;
|
|
4821
|
+
|
|
4822
|
+
/* Place the input element above the representation element */
|
|
4823
|
+
z-index: 1;
|
|
4824
|
+
`;
|
|
4001
4825
|
}
|
|
4002
4826
|
function switchRepresentationStyles(props) {
|
|
4003
4827
|
const { color, input } = getTheme_v2(props.theme);
|
|
4004
|
-
return css
|
|
4828
|
+
return css`
|
|
4829
|
+
--switch-bg-color: ${color.input.default.enabled.border};
|
|
4830
|
+
--switch-fg-color: ${color.input.default.enabled.bg};
|
|
4831
|
+
--switch-box-shadow: none;
|
|
4832
|
+
|
|
4833
|
+
&:not([hidden]) {
|
|
4834
|
+
display: block;
|
|
4835
|
+
}
|
|
4836
|
+
position: relative;
|
|
4837
|
+
width: ${rem(input.switch.width)};
|
|
4838
|
+
height: ${rem(input.switch.height)};
|
|
4839
|
+
border-radius: ${rem(input.switch.height / 2)};
|
|
4840
|
+
|
|
4841
|
+
/* Make sure it’s not possible to interact with the wrapper element */
|
|
4842
|
+
pointer-events: none;
|
|
4843
|
+
|
|
4844
|
+
&:after {
|
|
4845
|
+
content: '';
|
|
4846
|
+
display: block;
|
|
4847
|
+
position: absolute;
|
|
4848
|
+
top: 0;
|
|
4849
|
+
left: 0;
|
|
4850
|
+
right: 0;
|
|
4851
|
+
bottom: 0;
|
|
4852
|
+
z-index: 1;
|
|
4853
|
+
box-shadow: var(--switch-box-shadow);
|
|
4854
|
+
border-radius: inherit;
|
|
4855
|
+
}
|
|
4856
|
+
|
|
4857
|
+
/* Focus styles */
|
|
4858
|
+
input:focus + && {
|
|
4859
|
+
--switch-box-shadow: ${focusRingStyle({ focusRing: input.switch.focusRing })};
|
|
4860
|
+
}
|
|
4861
|
+
|
|
4862
|
+
input:focus:not(:focus-visible) + && {
|
|
4863
|
+
--switch-box-shadow: none;
|
|
4864
|
+
}
|
|
4865
|
+
|
|
4866
|
+
input:checked + && {
|
|
4867
|
+
--switch-bg-color: ${color.input.default.enabled.fg};
|
|
4868
|
+
--switch-fg-color: ${color.input.default.enabled.bg};
|
|
4869
|
+
}
|
|
4870
|
+
|
|
4871
|
+
@media (hover: hover) {
|
|
4872
|
+
input:not(:disabled):hover + && {
|
|
4873
|
+
--switch-bg-color: ${color.input.default.hovered.border};
|
|
4874
|
+
--switch-fg-color: ${color.input.default.hovered.bg};
|
|
4875
|
+
}
|
|
4876
|
+
|
|
4877
|
+
input:not(:disabled):checked:hover + && {
|
|
4878
|
+
--switch-bg-color: ${color.input.default.enabled.fg};
|
|
4879
|
+
--switch-fg-color: ${color.input.default.enabled.bg};
|
|
4880
|
+
}
|
|
4881
|
+
}
|
|
4882
|
+
|
|
4883
|
+
input:not([data-read-only]):disabled + && {
|
|
4884
|
+
--switch-bg-color: ${color.input.default.disabled.border};
|
|
4885
|
+
--switch-fg-color: ${color.input.default.disabled.bg};
|
|
4886
|
+
}
|
|
4887
|
+
|
|
4888
|
+
input[data-read-only]:disabled + && {
|
|
4889
|
+
--switch-bg-color: ${color.input.default.readOnly.border};
|
|
4890
|
+
--switch-fg-color: ${color.input.default.readOnly.bg};
|
|
4891
|
+
}
|
|
4892
|
+
|
|
4893
|
+
input:checked[data-read-only]:disabled + && {
|
|
4894
|
+
--switch-bg-color: ${color.input.default.readOnly.fg};
|
|
4895
|
+
--switch-fg-color: ${color.input.default.readOnly.bg};
|
|
4896
|
+
}
|
|
4897
|
+
`;
|
|
4005
4898
|
}
|
|
4006
4899
|
function switchTrackStyles(props) {
|
|
4007
4900
|
const { input } = getTheme_v2(props.theme);
|
|
4008
|
-
return css
|
|
4901
|
+
return css`
|
|
4902
|
+
&:not([hidden]) {
|
|
4903
|
+
display: block;
|
|
4904
|
+
}
|
|
4905
|
+
background-color: var(--switch-bg-color);
|
|
4906
|
+
position: absolute;
|
|
4907
|
+
left: 0;
|
|
4908
|
+
top: 0;
|
|
4909
|
+
width: ${rem(input.switch.width)};
|
|
4910
|
+
height: ${rem(input.switch.height)};
|
|
4911
|
+
border-radius: ${rem(input.switch.height / 2)};
|
|
4912
|
+
`;
|
|
4009
4913
|
}
|
|
4010
4914
|
function switchThumbStyles(props) {
|
|
4011
4915
|
const { $indeterminate } = props;
|
|
@@ -4017,7 +4921,31 @@ function switchThumbStyles(props) {
|
|
|
4017
4921
|
const checkedOffset = trackWidth - trackPadding * 2 - size;
|
|
4018
4922
|
const indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding;
|
|
4019
4923
|
const checked = $indeterminate !== true && props.$checked === true;
|
|
4020
|
-
return css
|
|
4924
|
+
return css`
|
|
4925
|
+
&:not([hidden]) {
|
|
4926
|
+
display: block;
|
|
4927
|
+
}
|
|
4928
|
+
position: absolute;
|
|
4929
|
+
left: ${rem(trackPadding)};
|
|
4930
|
+
top: ${rem(trackPadding)};
|
|
4931
|
+
height: ${rem(size)};
|
|
4932
|
+
width: ${rem(size)};
|
|
4933
|
+
border-radius: ${rem(size / 2)};
|
|
4934
|
+
transition-property: transform;
|
|
4935
|
+
transition-duration: ${input.switch.transitionDurationMs}ms;
|
|
4936
|
+
transition-timing-function: ${input.switch.transitionTimingFunction};
|
|
4937
|
+
background: var(--switch-fg-color);
|
|
4938
|
+
transform: translate3d(0, 0, 0);
|
|
4939
|
+
box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.05);
|
|
4940
|
+
|
|
4941
|
+
${checked && css`
|
|
4942
|
+
transform: translate3d(${checkedOffset}px, 0, 0);
|
|
4943
|
+
`}
|
|
4944
|
+
|
|
4945
|
+
${$indeterminate && css`
|
|
4946
|
+
transform: translate3d(${indeterminateOffset}px, 0, 0);
|
|
4947
|
+
`}
|
|
4948
|
+
`;
|
|
4021
4949
|
}
|
|
4022
4950
|
|
|
4023
4951
|
const Root$d = styled.span(switchBaseStyles);
|
|
@@ -4052,12 +4980,13 @@ const Switch = forwardRef(function Switch2(props, forwardedRef) {
|
|
|
4052
4980
|
] });
|
|
4053
4981
|
});
|
|
4054
4982
|
|
|
4055
|
-
var __freeze$i = Object.freeze;
|
|
4056
|
-
var __defProp$i = Object.defineProperty;
|
|
4057
|
-
var __template$i = (cooked, raw) => __freeze$i(__defProp$i(cooked, "raw", { value: __freeze$i(raw || cooked.slice()) }));
|
|
4058
|
-
var _a$i;
|
|
4059
4983
|
const Root$c = styled.span(textInputRootStyle);
|
|
4060
|
-
const InputRoot$1 = styled.span
|
|
4984
|
+
const InputRoot$1 = styled.span`
|
|
4985
|
+
flex: 1;
|
|
4986
|
+
min-width: 0;
|
|
4987
|
+
display: block;
|
|
4988
|
+
position: relative;
|
|
4989
|
+
`;
|
|
4061
4990
|
const Input$1 = styled.textarea(
|
|
4062
4991
|
responsiveInputPaddingStyle,
|
|
4063
4992
|
textInputBaseStyle,
|
|
@@ -4113,15 +5042,32 @@ const TextArea = forwardRef(function TextArea2(props, forwardedRef) {
|
|
|
4113
5042
|
] }) });
|
|
4114
5043
|
});
|
|
4115
5044
|
|
|
4116
|
-
var __freeze$h = Object.freeze;
|
|
4117
|
-
var __defProp$h = Object.defineProperty;
|
|
4118
|
-
var __template$h = (cooked, raw) => __freeze$h(__defProp$h(cooked, "raw", { value: __freeze$h(raw || cooked.slice()) }));
|
|
4119
|
-
var _a$h, _b$a, _c$4, _d$3, _e$1, _f$1;
|
|
4120
5045
|
const CLEAR_BUTTON_BOX_STYLE = { zIndex: 2 };
|
|
4121
5046
|
const Root$b = styled(Card).attrs({ forwardedAs: "span" })(textInputRootStyle);
|
|
4122
|
-
const InputRoot = styled.span
|
|
4123
|
-
|
|
4124
|
-
|
|
5047
|
+
const InputRoot = styled.span`
|
|
5048
|
+
flex: 1;
|
|
5049
|
+
min-width: 0;
|
|
5050
|
+
display: block;
|
|
5051
|
+
position: relative;
|
|
5052
|
+
`;
|
|
5053
|
+
const Prefix = styled(Card).attrs({ forwardedAs: "span" })`
|
|
5054
|
+
border-top-right-radius: 0;
|
|
5055
|
+
border-bottom-right-radius: 0;
|
|
5056
|
+
|
|
5057
|
+
& > span {
|
|
5058
|
+
display: block;
|
|
5059
|
+
margin: -1px;
|
|
5060
|
+
}
|
|
5061
|
+
`;
|
|
5062
|
+
const Suffix = styled(Card).attrs({ forwardedAs: "span" })`
|
|
5063
|
+
border-top-left-radius: 0;
|
|
5064
|
+
border-bottom-left-radius: 0;
|
|
5065
|
+
|
|
5066
|
+
& > span {
|
|
5067
|
+
display: block;
|
|
5068
|
+
margin: -1px;
|
|
5069
|
+
}
|
|
5070
|
+
`;
|
|
4125
5071
|
const Input = styled.input(
|
|
4126
5072
|
responsiveInputPaddingStyle,
|
|
4127
5073
|
textInputBaseStyle,
|
|
@@ -4131,9 +5077,22 @@ const Presentation = styled.span(
|
|
|
4131
5077
|
responsiveRadiusStyle,
|
|
4132
5078
|
textInputRepresentationStyle
|
|
4133
5079
|
);
|
|
4134
|
-
const LeftBox = styled(Box)
|
|
4135
|
-
|
|
4136
|
-
|
|
5080
|
+
const LeftBox = styled(Box)`
|
|
5081
|
+
position: absolute;
|
|
5082
|
+
top: 0;
|
|
5083
|
+
left: 0;
|
|
5084
|
+
`;
|
|
5085
|
+
const RightBox = styled(Box)`
|
|
5086
|
+
position: absolute;
|
|
5087
|
+
top: 0;
|
|
5088
|
+
right: 0;
|
|
5089
|
+
`;
|
|
5090
|
+
const RightCard = styled(Card)`
|
|
5091
|
+
background-color: transparent;
|
|
5092
|
+
position: absolute;
|
|
5093
|
+
top: 0;
|
|
5094
|
+
right: 0;
|
|
5095
|
+
`;
|
|
4137
5096
|
const TextInputClearButton = styled(Button)({
|
|
4138
5097
|
"&:not([hidden])": {
|
|
4139
5098
|
display: "block"
|
|
@@ -4178,12 +5137,12 @@ const TextInput = forwardRef(function TextInput2(props, forwardedRef) {
|
|
|
4178
5137
|
}, []);
|
|
4179
5138
|
const handleClearClick = useCallback(
|
|
4180
5139
|
(event) => {
|
|
4181
|
-
var
|
|
5140
|
+
var _a;
|
|
4182
5141
|
event.preventDefault();
|
|
4183
5142
|
event.stopPropagation();
|
|
4184
5143
|
if (onClear)
|
|
4185
5144
|
onClear();
|
|
4186
|
-
(
|
|
5145
|
+
(_a = ref.current) == null ? void 0 : _a.focus();
|
|
4187
5146
|
},
|
|
4188
5147
|
[onClear, ref]
|
|
4189
5148
|
);
|
|
@@ -4370,11 +5329,12 @@ const DEFAULT_FALLBACK_PLACEMENTS = {
|
|
|
4370
5329
|
"right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
|
|
4371
5330
|
};
|
|
4372
5331
|
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
var
|
|
4376
|
-
|
|
4377
|
-
|
|
5332
|
+
const MotionCard = styled(motion(Card))`
|
|
5333
|
+
& > * {
|
|
5334
|
+
opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
|
|
5335
|
+
will-change: opacity;
|
|
5336
|
+
}
|
|
5337
|
+
`;
|
|
4378
5338
|
const TooltipCard = memo(
|
|
4379
5339
|
forwardRef(function TooltipCard2(props, ref) {
|
|
4380
5340
|
const {
|
|
@@ -4474,13 +5434,12 @@ function TooltipDelayGroupProvider(props) {
|
|
|
4474
5434
|
return /* @__PURE__ */ jsx(TooltipDelayGroupContext.Provider, { value, children });
|
|
4475
5435
|
}
|
|
4476
5436
|
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
const Root$a = styled(Layer)(_a$f || (_a$f = __template$f(["\n pointer-events: none;\n max-width: ", "px;\n"])), ({ $maxWidth }) => $maxWidth);
|
|
5437
|
+
const Root$a = styled(Layer)`
|
|
5438
|
+
pointer-events: none;
|
|
5439
|
+
max-width: ${({ $maxWidth }) => $maxWidth}px;
|
|
5440
|
+
`;
|
|
4482
5441
|
const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
4483
|
-
var
|
|
5442
|
+
var _a, _b, _c, _d, _e;
|
|
4484
5443
|
const boundaryElementContext = useBoundaryElement();
|
|
4485
5444
|
const { layer } = useTheme_v2();
|
|
4486
5445
|
const {
|
|
@@ -4490,7 +5449,7 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4490
5449
|
children: childProp,
|
|
4491
5450
|
content,
|
|
4492
5451
|
disabled,
|
|
4493
|
-
fallbackPlacements: fallbackPlacementsProp =
|
|
5452
|
+
fallbackPlacements: fallbackPlacementsProp = props.fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"],
|
|
4494
5453
|
padding = 2,
|
|
4495
5454
|
placement: placementProp = "bottom",
|
|
4496
5455
|
portal: portalProp,
|
|
@@ -4509,7 +5468,7 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4509
5468
|
const arrowRef = useRef(null);
|
|
4510
5469
|
const rootBoundary = "viewport";
|
|
4511
5470
|
const portal = usePortal();
|
|
4512
|
-
const portalElement = typeof portalProp === "string" ? ((
|
|
5471
|
+
const portalElement = typeof portalProp === "string" ? ((_a = portal.elements) == null ? void 0 : _a[portalProp]) || null : portal.element;
|
|
4513
5472
|
const tooltipWidth = useMemo(() => {
|
|
4514
5473
|
const availableWidths = [
|
|
4515
5474
|
...boundaryElement ? [boundaryElement.offsetWidth] : [],
|
|
@@ -4548,10 +5507,10 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4548
5507
|
placement: placementProp,
|
|
4549
5508
|
whileElementsMounted: autoUpdate
|
|
4550
5509
|
});
|
|
4551
|
-
const arrowX = (
|
|
4552
|
-
const arrowY = (
|
|
4553
|
-
const originX = (
|
|
4554
|
-
const originY = (
|
|
5510
|
+
const arrowX = (_b = middlewareData.arrow) == null ? void 0 : _b.x;
|
|
5511
|
+
const arrowY = (_c = middlewareData.arrow) == null ? void 0 : _c.y;
|
|
5512
|
+
const originX = (_d = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _d.originX;
|
|
5513
|
+
const originY = (_e = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _e.originY;
|
|
4555
5514
|
const tooltipId = useId();
|
|
4556
5515
|
const [isOpen, setIsOpen] = useDelayedState(false);
|
|
4557
5516
|
const delayGroupContext = useTooltipDelayGroup();
|
|
@@ -4583,49 +5542,49 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4583
5542
|
);
|
|
4584
5543
|
const handleBlur = useCallback(
|
|
4585
5544
|
(e) => {
|
|
4586
|
-
var
|
|
5545
|
+
var _a2, _b2;
|
|
4587
5546
|
handleIsOpenChange(false);
|
|
4588
|
-
(_b2 = (
|
|
5547
|
+
(_b2 = (_a2 = childProp == null ? void 0 : childProp.props) == null ? void 0 : _a2.onBlur) == null ? void 0 : _b2.call(_a2, e);
|
|
4589
5548
|
},
|
|
4590
5549
|
[childProp == null ? void 0 : childProp.props, handleIsOpenChange]
|
|
4591
5550
|
);
|
|
4592
5551
|
const handleClick = useCallback(
|
|
4593
5552
|
(e) => {
|
|
4594
|
-
var
|
|
5553
|
+
var _a2, _b2;
|
|
4595
5554
|
handleIsOpenChange(false, true);
|
|
4596
|
-
(_b2 = childProp == null ? void 0 : (
|
|
5555
|
+
(_b2 = childProp == null ? void 0 : (_a2 = childProp.props).onClick) == null ? void 0 : _b2.call(_a2, e);
|
|
4597
5556
|
},
|
|
4598
5557
|
[childProp == null ? void 0 : childProp.props, handleIsOpenChange]
|
|
4599
5558
|
);
|
|
4600
5559
|
const handleContextMenu = useCallback(
|
|
4601
5560
|
(e) => {
|
|
4602
|
-
var
|
|
5561
|
+
var _a2, _b2;
|
|
4603
5562
|
handleIsOpenChange(false, true);
|
|
4604
|
-
(_b2 = childProp == null ? void 0 : (
|
|
5563
|
+
(_b2 = childProp == null ? void 0 : (_a2 = childProp.props).onContextMenu) == null ? void 0 : _b2.call(_a2, e);
|
|
4605
5564
|
},
|
|
4606
5565
|
[childProp == null ? void 0 : childProp.props, handleIsOpenChange]
|
|
4607
5566
|
);
|
|
4608
5567
|
const handleFocus = useCallback(
|
|
4609
5568
|
(e) => {
|
|
4610
|
-
var
|
|
5569
|
+
var _a2, _b2;
|
|
4611
5570
|
handleIsOpenChange(true);
|
|
4612
|
-
(_b2 = (
|
|
5571
|
+
(_b2 = (_a2 = childProp == null ? void 0 : childProp.props) == null ? void 0 : _a2.onFocus) == null ? void 0 : _b2.call(_a2, e);
|
|
4613
5572
|
},
|
|
4614
5573
|
[childProp == null ? void 0 : childProp.props, handleIsOpenChange]
|
|
4615
5574
|
);
|
|
4616
5575
|
const handleMouseEnter = useCallback(
|
|
4617
5576
|
(e) => {
|
|
4618
|
-
var
|
|
5577
|
+
var _a2, _b2;
|
|
4619
5578
|
handleIsOpenChange(true);
|
|
4620
|
-
(_b2 = (
|
|
5579
|
+
(_b2 = (_a2 = childProp == null ? void 0 : childProp.props) == null ? void 0 : _a2.onMouseEnter) == null ? void 0 : _b2.call(_a2, e);
|
|
4621
5580
|
},
|
|
4622
5581
|
[childProp == null ? void 0 : childProp.props, handleIsOpenChange]
|
|
4623
5582
|
);
|
|
4624
5583
|
const handleMouseLeave = useCallback(
|
|
4625
5584
|
(e) => {
|
|
4626
|
-
var
|
|
5585
|
+
var _a2, _b2;
|
|
4627
5586
|
handleIsOpenChange(false);
|
|
4628
|
-
(_b2 = (
|
|
5587
|
+
(_b2 = (_a2 = childProp == null ? void 0 : childProp.props) == null ? void 0 : _a2.onMouseLeave) == null ? void 0 : _b2.call(_a2, e);
|
|
4629
5588
|
},
|
|
4630
5589
|
[childProp == null ? void 0 : childProp.props, handleIsOpenChange]
|
|
4631
5590
|
);
|
|
@@ -4771,14 +5730,28 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
4771
5730
|
] });
|
|
4772
5731
|
});
|
|
4773
5732
|
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
5733
|
+
const Root$9 = styled.div`
|
|
5734
|
+
line-height: 0;
|
|
5735
|
+
`;
|
|
5736
|
+
const ListBox = styled(Box)`
|
|
5737
|
+
& > ul {
|
|
5738
|
+
list-style: none;
|
|
5739
|
+
padding: 0;
|
|
5740
|
+
margin: 0;
|
|
5741
|
+
}
|
|
5742
|
+
`;
|
|
5743
|
+
const rotate = keyframes`
|
|
5744
|
+
from {
|
|
5745
|
+
transform: rotate(0deg);
|
|
5746
|
+
}
|
|
5747
|
+
|
|
5748
|
+
to {
|
|
5749
|
+
transform: rotate(360deg);
|
|
5750
|
+
}
|
|
5751
|
+
`;
|
|
5752
|
+
const AnimatedSpinnerIcon = styled(SpinnerIcon)`
|
|
5753
|
+
animation: ${rotate} 500ms linear infinite;
|
|
5754
|
+
`;
|
|
4782
5755
|
|
|
4783
5756
|
function AutocompleteOption(props) {
|
|
4784
5757
|
const { children, id, onSelect, selected, value } = props;
|
|
@@ -4912,7 +5885,7 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
|
|
|
4912
5885
|
const valuePropRef = useRef(valueProp);
|
|
4913
5886
|
const popoverMouseWithinRef = useRef(false);
|
|
4914
5887
|
const forwardedRef = useForwardedRef(ref);
|
|
4915
|
-
const listBoxId =
|
|
5888
|
+
const listBoxId = `${id}-listbox`;
|
|
4916
5889
|
const options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY;
|
|
4917
5890
|
const padding = useArrayProp(paddingProp);
|
|
4918
5891
|
const currentOption = useMemo(
|
|
@@ -4924,7 +5897,7 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
|
|
|
4924
5897
|
[filterOption, options, query]
|
|
4925
5898
|
);
|
|
4926
5899
|
const filteredOptionsLen = filteredOptions.length;
|
|
4927
|
-
const activeItemId = activeValue ?
|
|
5900
|
+
const activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0;
|
|
4928
5901
|
const expanded = query !== null && loading || focused && query !== null;
|
|
4929
5902
|
const handleRootBlur = useCallback(
|
|
4930
5903
|
(event) => {
|
|
@@ -5252,7 +6225,7 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
|
|
|
5252
6225
|
return /* @__PURE__ */ jsx(
|
|
5253
6226
|
AutocompleteOption,
|
|
5254
6227
|
{
|
|
5255
|
-
id:
|
|
6228
|
+
id: `${id}-option-${option.value}`,
|
|
5256
6229
|
onSelect: handleOptionSelect,
|
|
5257
6230
|
selected: active,
|
|
5258
6231
|
value: option.value,
|
|
@@ -5345,12 +6318,19 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
|
|
|
5345
6318
|
});
|
|
5346
6319
|
const Autocomplete = InnerAutocomplete;
|
|
5347
6320
|
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
6321
|
+
const Root$8 = styled.ol`
|
|
6322
|
+
margin: 0;
|
|
6323
|
+
padding: 0;
|
|
6324
|
+
display: flex;
|
|
6325
|
+
list-style: none;
|
|
6326
|
+
align-items: center;
|
|
6327
|
+
white-space: nowrap;
|
|
6328
|
+
line-height: 0;
|
|
6329
|
+
`;
|
|
6330
|
+
const ExpandButton = styled(Button)`
|
|
6331
|
+
appearance: none;
|
|
6332
|
+
margin: -4px;
|
|
6333
|
+
`;
|
|
5354
6334
|
|
|
5355
6335
|
const Breadcrumbs = forwardRef(function Breadcrumbs2(props, ref) {
|
|
5356
6336
|
const { children, maxLength, separator, space: spaceRaw = 2, ...restProps } = props;
|
|
@@ -5409,10 +6389,6 @@ const Breadcrumbs = forwardRef(function Breadcrumbs2(props, ref) {
|
|
|
5409
6389
|
] }, itemIndex)) });
|
|
5410
6390
|
});
|
|
5411
6391
|
|
|
5412
|
-
var __freeze$c = Object.freeze;
|
|
5413
|
-
var __defProp$c = Object.defineProperty;
|
|
5414
|
-
var __template$c = (cooked, raw) => __freeze$c(__defProp$c(cooked, "raw", { value: __freeze$c(raw || cooked.slice()) }));
|
|
5415
|
-
var _a$c, _b$7;
|
|
5416
6392
|
function dialogStyle({ theme }) {
|
|
5417
6393
|
const { color } = getTheme_v2(theme);
|
|
5418
6394
|
return {
|
|
@@ -5435,8 +6411,33 @@ function responsiveDialogPositionStyle(props) {
|
|
|
5435
6411
|
}
|
|
5436
6412
|
function animationDialogStyle(props) {
|
|
5437
6413
|
if (!props.$animate)
|
|
5438
|
-
return css
|
|
5439
|
-
return css
|
|
6414
|
+
return css``;
|
|
6415
|
+
return css`
|
|
6416
|
+
@keyframes zoomIn {
|
|
6417
|
+
from {
|
|
6418
|
+
opacity: 0;
|
|
6419
|
+
transform: scale(0.95);
|
|
6420
|
+
}
|
|
6421
|
+
to {
|
|
6422
|
+
opacity: 1;
|
|
6423
|
+
transform: scale(1);
|
|
6424
|
+
}
|
|
6425
|
+
}
|
|
6426
|
+
@keyframes fadeIn {
|
|
6427
|
+
from {
|
|
6428
|
+
opacity: 0;
|
|
6429
|
+
}
|
|
6430
|
+
to {
|
|
6431
|
+
opacity: 1;
|
|
6432
|
+
}
|
|
6433
|
+
}
|
|
6434
|
+
|
|
6435
|
+
animation: fadeIn 200ms ease-out;
|
|
6436
|
+
// Animates the dialog card.
|
|
6437
|
+
& > [data-ui='DialogCard'] {
|
|
6438
|
+
animation: zoomIn 200ms ease-out;
|
|
6439
|
+
}
|
|
6440
|
+
`;
|
|
5440
6441
|
}
|
|
5441
6442
|
|
|
5442
6443
|
const key$3 = Symbol.for("@sanity/ui/context/dialog");
|
|
@@ -5447,24 +6448,53 @@ function useDialog() {
|
|
|
5447
6448
|
return useContext(DialogContext);
|
|
5448
6449
|
}
|
|
5449
6450
|
|
|
5450
|
-
var __freeze$b = Object.freeze;
|
|
5451
|
-
var __defProp$b = Object.defineProperty;
|
|
5452
|
-
var __template$b = (cooked, raw) => __freeze$b(__defProp$b(cooked, "raw", { value: __freeze$b(raw || cooked.slice()) }));
|
|
5453
|
-
var _a$b, _b$6, _c$2, _d$1, _e, _f;
|
|
5454
6451
|
function isTargetWithinScope(boundaryElement, portalElement, target) {
|
|
5455
6452
|
if (!boundaryElement || !portalElement)
|
|
5456
6453
|
return true;
|
|
5457
6454
|
return containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
|
|
5458
6455
|
}
|
|
5459
6456
|
const Root$7 = styled(Layer)(responsivePaddingStyle, dialogStyle, responsiveDialogPositionStyle, animationDialogStyle);
|
|
5460
|
-
const DialogContainer = styled(Container)
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
6457
|
+
const DialogContainer = styled(Container)`
|
|
6458
|
+
&:not([hidden]) {
|
|
6459
|
+
display: flex;
|
|
6460
|
+
}
|
|
6461
|
+
width: 100%;
|
|
6462
|
+
height: 100%;
|
|
6463
|
+
flex-direction: column;
|
|
6464
|
+
align-items: center;
|
|
6465
|
+
justify-content: center;
|
|
6466
|
+
`;
|
|
6467
|
+
const DialogCardRoot = styled(Card)`
|
|
6468
|
+
&:not([hidden]) {
|
|
6469
|
+
display: flex;
|
|
6470
|
+
}
|
|
6471
|
+
width: 100%;
|
|
6472
|
+
min-height: 0;
|
|
6473
|
+
max-height: 100%;
|
|
6474
|
+
overflow: hidden;
|
|
6475
|
+
overflow: clip;
|
|
6476
|
+
`;
|
|
6477
|
+
const DialogLayout = styled(Flex)`
|
|
6478
|
+
flex: 1;
|
|
6479
|
+
min-height: 0;
|
|
6480
|
+
width: 100%;
|
|
6481
|
+
`;
|
|
6482
|
+
const DialogHeader = styled(Box)`
|
|
6483
|
+
position: relative;
|
|
6484
|
+
z-index: 2;
|
|
6485
|
+
`;
|
|
6486
|
+
const DialogContent = styled(Box)`
|
|
6487
|
+
position: relative;
|
|
6488
|
+
z-index: 1;
|
|
6489
|
+
overflow: auto;
|
|
6490
|
+
outline: none;
|
|
6491
|
+
`;
|
|
6492
|
+
const DialogFooter = styled(Box)`
|
|
6493
|
+
position: relative;
|
|
6494
|
+
z-index: 3;
|
|
6495
|
+
`;
|
|
5466
6496
|
const DialogCard = forwardRef(function DialogCard2(props, ref) {
|
|
5467
|
-
var
|
|
6497
|
+
var _a;
|
|
5468
6498
|
const {
|
|
5469
6499
|
__unstable_autoFocus: autoFocus,
|
|
5470
6500
|
__unstable_hideCloseButton: hideCloseButton,
|
|
@@ -5482,7 +6512,7 @@ const DialogCard = forwardRef(function DialogCard2(props, ref) {
|
|
|
5482
6512
|
width: widthProp
|
|
5483
6513
|
} = props;
|
|
5484
6514
|
const portal = usePortal();
|
|
5485
|
-
const portalElement = portalProp ? ((
|
|
6515
|
+
const portalElement = portalProp ? ((_a = portal.elements) == null ? void 0 : _a[portalProp]) || null : portal.element;
|
|
5486
6516
|
const boundaryElement = useBoundaryElement().element;
|
|
5487
6517
|
const radius = useArrayProp(radiusProp);
|
|
5488
6518
|
const shadow = useArrayProp(shadowProp);
|
|
@@ -5492,7 +6522,7 @@ const DialogCard = forwardRef(function DialogCard2(props, ref) {
|
|
|
5492
6522
|
const localContentRef = useRef(null);
|
|
5493
6523
|
const layer = useLayer();
|
|
5494
6524
|
const { isTopLayer } = layer;
|
|
5495
|
-
const labelId =
|
|
6525
|
+
const labelId = `${id}_label`;
|
|
5496
6526
|
const showCloseButton = Boolean(onClose) && hideCloseButton === false;
|
|
5497
6527
|
const showHeader = Boolean(header) || showCloseButton;
|
|
5498
6528
|
useEffect(() => {
|
|
@@ -5572,7 +6602,7 @@ const DialogCard = forwardRef(function DialogCard2(props, ref) {
|
|
|
5572
6602
|
] }) }) });
|
|
5573
6603
|
});
|
|
5574
6604
|
const Dialog = forwardRef(function Dialog2(props, ref) {
|
|
5575
|
-
var
|
|
6605
|
+
var _a;
|
|
5576
6606
|
const dialog = useDialog();
|
|
5577
6607
|
const { layer } = useTheme_v2();
|
|
5578
6608
|
const {
|
|
@@ -5601,7 +6631,7 @@ const Dialog = forwardRef(function Dialog2(props, ref) {
|
|
|
5601
6631
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
5602
6632
|
const animate = prefersReducedMotion ? false : _animate;
|
|
5603
6633
|
const portal = usePortal();
|
|
5604
|
-
const portalElement = portalProp ? ((
|
|
6634
|
+
const portalElement = portalProp ? ((_a = portal.elements) == null ? void 0 : _a[portalProp]) || null : portal.element;
|
|
5605
6635
|
const boundaryElement = useBoundaryElement().element;
|
|
5606
6636
|
const cardRadius = useArrayProp(cardRadiusProp);
|
|
5607
6637
|
const padding = useArrayProp(paddingProp);
|
|
@@ -5631,7 +6661,7 @@ const Dialog = forwardRef(function Dialog2(props, ref) {
|
|
|
5631
6661
|
},
|
|
5632
6662
|
[onFocus]
|
|
5633
6663
|
);
|
|
5634
|
-
const labelId =
|
|
6664
|
+
const labelId = `${id}_label`;
|
|
5635
6665
|
const rootClickTimeoutRef = useRef();
|
|
5636
6666
|
const handleRootClick = useCallback(() => {
|
|
5637
6667
|
if (rootClickTimeoutRef.current) {
|
|
@@ -5709,12 +6739,19 @@ function DialogProvider(props) {
|
|
|
5709
6739
|
return /* @__PURE__ */ jsx(DialogContext.Provider, { value: contextValue, children });
|
|
5710
6740
|
}
|
|
5711
6741
|
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
6742
|
+
const Root$6 = styled.kbd`
|
|
6743
|
+
font: inherit;
|
|
6744
|
+
padding: 1px;
|
|
6745
|
+
|
|
6746
|
+
&:not([hidden]) {
|
|
6747
|
+
display: block;
|
|
6748
|
+
}
|
|
6749
|
+
`;
|
|
6750
|
+
const Key = styled(KBD)`
|
|
6751
|
+
&:not([hidden]) {
|
|
6752
|
+
display: block;
|
|
6753
|
+
}
|
|
6754
|
+
`;
|
|
5718
6755
|
const Hotkeys = forwardRef(function Hotkeys2(props, ref) {
|
|
5719
6756
|
const { fontSize, keys, padding, radius, space: spaceProp = 0.5, ...restProps } = props;
|
|
5720
6757
|
const space = useArrayProp(spaceProp);
|
|
@@ -5931,11 +6968,10 @@ function useMenuController(props) {
|
|
|
5931
6968
|
};
|
|
5932
6969
|
}
|
|
5933
6970
|
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
const Root$5 = styled(Box)(_a$9 || (_a$9 = __template$9(["\n outline: none;\n overflow: auto;\n"])));
|
|
6971
|
+
const Root$5 = styled(Box)`
|
|
6972
|
+
outline: none;
|
|
6973
|
+
overflow: auto;
|
|
6974
|
+
`;
|
|
5939
6975
|
const Menu = forwardRef(function Menu2(props, ref) {
|
|
5940
6976
|
const {
|
|
5941
6977
|
children,
|
|
@@ -6233,25 +7269,110 @@ const MenuButton = forwardRef(function MenuButton2(props, ref) {
|
|
|
6233
7269
|
return /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: button || /* @__PURE__ */ jsx(Fragment, {}) });
|
|
6234
7270
|
});
|
|
6235
7271
|
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
var
|
|
6240
|
-
|
|
7272
|
+
const MenuDivider = styled.hr`
|
|
7273
|
+
height: 1px;
|
|
7274
|
+
border: 0;
|
|
7275
|
+
background: var(--card-hairline-soft-color);
|
|
7276
|
+
margin: 0;
|
|
7277
|
+
`;
|
|
6241
7278
|
|
|
6242
|
-
var __freeze$7 = Object.freeze;
|
|
6243
|
-
var __defProp$7 = Object.defineProperty;
|
|
6244
|
-
var __template$7 = (cooked, raw) => __freeze$7(__defProp$7(cooked, "raw", { value: __freeze$7(raw || cooked.slice()) }));
|
|
6245
|
-
var _a$7, _b$4;
|
|
6246
7279
|
function selectableBaseStyle() {
|
|
6247
|
-
return css
|
|
7280
|
+
return css`
|
|
7281
|
+
background-color: inherit;
|
|
7282
|
+
color: inherit;
|
|
7283
|
+
|
|
7284
|
+
&[data-as='button'] {
|
|
7285
|
+
-webkit-font-smoothing: inherit;
|
|
7286
|
+
appearance: none;
|
|
7287
|
+
outline: none;
|
|
7288
|
+
font: inherit;
|
|
7289
|
+
text-align: inherit;
|
|
7290
|
+
border: 0;
|
|
7291
|
+
width: -moz-available;
|
|
7292
|
+
width: -webkit-fill-available;
|
|
7293
|
+
width: stretch;
|
|
7294
|
+
}
|
|
7295
|
+
|
|
7296
|
+
/* &:is(a) */
|
|
7297
|
+
&[data-as='a'] {
|
|
7298
|
+
text-decoration: none;
|
|
7299
|
+
}
|
|
7300
|
+
`;
|
|
6248
7301
|
}
|
|
6249
7302
|
function selectableColorStyle(props) {
|
|
6250
|
-
var
|
|
7303
|
+
var _a;
|
|
6251
7304
|
const { $tone } = props;
|
|
6252
7305
|
const { color, style } = getTheme_v2(props.theme);
|
|
6253
7306
|
const tone = color.selectable[$tone];
|
|
6254
|
-
return css
|
|
7307
|
+
return css`
|
|
7308
|
+
${_cardColorStyle(color, tone.enabled)}
|
|
7309
|
+
|
|
7310
|
+
background-color: var(--card-bg-color);
|
|
7311
|
+
color: var(--card-fg-color);
|
|
7312
|
+
outline: none;
|
|
7313
|
+
|
|
7314
|
+
/* &:is(button) */
|
|
7315
|
+
&[data-as='button'] {
|
|
7316
|
+
&:disabled {
|
|
7317
|
+
${_cardColorStyle(color, tone.disabled)}
|
|
7318
|
+
}
|
|
7319
|
+
|
|
7320
|
+
&:not(:disabled) {
|
|
7321
|
+
&[aria-pressed='true'] {
|
|
7322
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
7323
|
+
}
|
|
7324
|
+
|
|
7325
|
+
&[data-selected],
|
|
7326
|
+
&[aria-selected='true'] > & {
|
|
7327
|
+
${_cardColorStyle(color, tone.selected)}
|
|
7328
|
+
}
|
|
7329
|
+
|
|
7330
|
+
@media (hover: hover) {
|
|
7331
|
+
&:not([data-selected]) {
|
|
7332
|
+
&[data-hovered],
|
|
7333
|
+
&:hover {
|
|
7334
|
+
${_cardColorStyle(color, tone.hovered)}
|
|
7335
|
+
}
|
|
7336
|
+
|
|
7337
|
+
&:active {
|
|
7338
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
7339
|
+
}
|
|
7340
|
+
}
|
|
7341
|
+
}
|
|
7342
|
+
}
|
|
7343
|
+
}
|
|
7344
|
+
|
|
7345
|
+
/* &:is(a) */
|
|
7346
|
+
&[data-as='a'] {
|
|
7347
|
+
&[data-disabled] {
|
|
7348
|
+
${_cardColorStyle(color, tone.disabled)}
|
|
7349
|
+
}
|
|
7350
|
+
|
|
7351
|
+
&:not([data-disabled]) {
|
|
7352
|
+
&[data-pressed] {
|
|
7353
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
7354
|
+
}
|
|
7355
|
+
|
|
7356
|
+
&[data-selected] {
|
|
7357
|
+
${_cardColorStyle(color, tone.selected)}
|
|
7358
|
+
}
|
|
7359
|
+
|
|
7360
|
+
@media (hover: hover) {
|
|
7361
|
+
&:not([data-selected]) {
|
|
7362
|
+
&[data-hovered],
|
|
7363
|
+
&:hover {
|
|
7364
|
+
${_cardColorStyle(color, tone.hovered)}
|
|
7365
|
+
}
|
|
7366
|
+
&:active {
|
|
7367
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
7368
|
+
}
|
|
7369
|
+
}
|
|
7370
|
+
}
|
|
7371
|
+
}
|
|
7372
|
+
}
|
|
7373
|
+
|
|
7374
|
+
${(_a = style == null ? void 0 : style.card) == null ? void 0 : _a.root}
|
|
7375
|
+
`;
|
|
6255
7376
|
}
|
|
6256
7377
|
|
|
6257
7378
|
const Selectable = styled(Box)(
|
|
@@ -6525,13 +7646,45 @@ const MenuItem = forwardRef(function MenuItem2(props, forwardedRef) {
|
|
|
6525
7646
|
);
|
|
6526
7647
|
});
|
|
6527
7648
|
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
7649
|
+
const keyframe = keyframes`
|
|
7650
|
+
0% {
|
|
7651
|
+
background-position: 100%;
|
|
7652
|
+
}
|
|
7653
|
+
100% {
|
|
7654
|
+
background-position: -100%;
|
|
7655
|
+
}
|
|
7656
|
+
`;
|
|
7657
|
+
const animation = css`
|
|
7658
|
+
background-image: linear-gradient(
|
|
7659
|
+
to right,
|
|
7660
|
+
var(--card-skeleton-color-from),
|
|
7661
|
+
var(--card-skeleton-color-to),
|
|
7662
|
+
var(--card-skeleton-color-from),
|
|
7663
|
+
var(--card-skeleton-color-from),
|
|
7664
|
+
var(--card-skeleton-color-from)
|
|
7665
|
+
);
|
|
7666
|
+
background-position: 100%;
|
|
7667
|
+
background-size: 200% 100%;
|
|
7668
|
+
background-attachment: fixed;
|
|
7669
|
+
animation-name: ${keyframe};
|
|
7670
|
+
animation-timing-function: ease-in-out;
|
|
7671
|
+
animation-iteration-count: infinite;
|
|
7672
|
+
animation-duration: 2000ms;
|
|
7673
|
+
`;
|
|
7674
|
+
const skeletonStyle = css`
|
|
7675
|
+
opacity: ${({ $visible }) => $visible ? 1 : 0};
|
|
7676
|
+
transition: opacity 200ms ease-in;
|
|
7677
|
+
|
|
7678
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
7679
|
+
${({ $animated }) => $animated ? animation : css`
|
|
7680
|
+
background-color: var(--card-skeleton-color-from);
|
|
7681
|
+
`}
|
|
7682
|
+
}
|
|
7683
|
+
|
|
7684
|
+
@media screen and (prefers-reduced-motion: reduce) {
|
|
7685
|
+
background-color: var(--card-skeleton-color-from);
|
|
7686
|
+
}
|
|
7687
|
+
`;
|
|
6535
7688
|
|
|
6536
7689
|
const Root$4 = styled(Box)(
|
|
6537
7690
|
responsiveRadiusStyle,
|
|
@@ -6595,11 +7748,9 @@ const CodeSkeleton = forwardRef(function TextSkeleton5(props, ref) {
|
|
|
6595
7748
|
return /* @__PURE__ */ jsx(Root$3, { ...restProps, $size, ref, $style: "code" });
|
|
6596
7749
|
});
|
|
6597
7750
|
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
var _a$5;
|
|
6602
|
-
const CustomButton = styled(Button)(_a$5 || (_a$5 = __template$5(["\n max-width: 100%;\n"])));
|
|
7751
|
+
const CustomButton = styled(Button)`
|
|
7752
|
+
max-width: 100%;
|
|
7753
|
+
`;
|
|
6603
7754
|
const Tab = forwardRef(function Tab2(props, forwardedRef) {
|
|
6604
7755
|
const {
|
|
6605
7756
|
icon,
|
|
@@ -6662,14 +7813,17 @@ const Tab = forwardRef(function Tab2(props, forwardedRef) {
|
|
|
6662
7813
|
);
|
|
6663
7814
|
});
|
|
6664
7815
|
|
|
6665
|
-
var __freeze$4 = Object.freeze;
|
|
6666
|
-
var __defProp$4 = Object.defineProperty;
|
|
6667
|
-
var __template$4 = (cooked, raw) => __freeze$4(__defProp$4(cooked, "raw", { value: __freeze$4(raw || cooked.slice()) }));
|
|
6668
|
-
var _a$4;
|
|
6669
7816
|
function _isReactElement(node) {
|
|
6670
7817
|
return Boolean(node);
|
|
6671
7818
|
}
|
|
6672
|
-
const CustomInline = styled(Inline)
|
|
7819
|
+
const CustomInline = styled(Inline)`
|
|
7820
|
+
& > div {
|
|
7821
|
+
display: inline-block;
|
|
7822
|
+
vertical-align: middle;
|
|
7823
|
+
max-width: 100%;
|
|
7824
|
+
box-sizing: border-box;
|
|
7825
|
+
}
|
|
7826
|
+
`;
|
|
6673
7827
|
const TabList = forwardRef(function TabList2(props, ref) {
|
|
6674
7828
|
const { children: childrenProp, ...restProps } = props;
|
|
6675
7829
|
const [focusedIndex, setFocusedIndex] = useState(-1);
|
|
@@ -6725,10 +7879,6 @@ const TabPanel = forwardRef(function TabPanel2(props, ref) {
|
|
|
6725
7879
|
);
|
|
6726
7880
|
});
|
|
6727
7881
|
|
|
6728
|
-
var __freeze$3 = Object.freeze;
|
|
6729
|
-
var __defProp$3 = Object.defineProperty;
|
|
6730
|
-
var __template$3 = (cooked, raw) => __freeze$3(__defProp$3(cooked, "raw", { value: __freeze$3(raw || cooked.slice()) }));
|
|
6731
|
-
var _a$3, _b$2;
|
|
6732
7882
|
const STATUS_CARD_TONE = {
|
|
6733
7883
|
error: "critical",
|
|
6734
7884
|
warning: "caution",
|
|
@@ -6747,8 +7897,16 @@ const ROLES = {
|
|
|
6747
7897
|
success: "alert",
|
|
6748
7898
|
info: "alert"
|
|
6749
7899
|
};
|
|
6750
|
-
const Root$2 = styled(Card)
|
|
6751
|
-
|
|
7900
|
+
const Root$2 = styled(Card)`
|
|
7901
|
+
pointer-events: all;
|
|
7902
|
+
& > * {
|
|
7903
|
+
opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
|
|
7904
|
+
will-change: opacity;
|
|
7905
|
+
}
|
|
7906
|
+
`;
|
|
7907
|
+
const TextBox = styled(Flex)`
|
|
7908
|
+
overflow-x: auto;
|
|
7909
|
+
`;
|
|
6752
7910
|
function Toast(props) {
|
|
6753
7911
|
const { closable, description, onClose, radius = 3, title, status, ...restProps } = props;
|
|
6754
7912
|
const cardTone = status ? STATUS_CARD_TONE[status] : "default";
|
|
@@ -6800,12 +7958,22 @@ const key$1 = Symbol.for("@sanity/ui/context/toast");
|
|
|
6800
7958
|
globalScope[key$1] = globalScope[key$1] || createContext(null);
|
|
6801
7959
|
const ToastContext = globalScope[key$1];
|
|
6802
7960
|
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
7961
|
+
const Root$1 = styled(Layer)`
|
|
7962
|
+
position: fixed;
|
|
7963
|
+
top: 0;
|
|
7964
|
+
left: 0;
|
|
7965
|
+
right: 0;
|
|
7966
|
+
bottom: 0;
|
|
7967
|
+
pointer-events: none;
|
|
7968
|
+
`;
|
|
7969
|
+
const ToastContainer = styled.div`
|
|
7970
|
+
box-sizing: border-box;
|
|
7971
|
+
position: absolute;
|
|
7972
|
+
right: 0;
|
|
7973
|
+
bottom: 0;
|
|
7974
|
+
max-width: 420px;
|
|
7975
|
+
width: 100%;
|
|
7976
|
+
`;
|
|
6809
7977
|
let toastId = 0;
|
|
6810
7978
|
function ToastProvider(props) {
|
|
6811
7979
|
const { children, padding = 4, paddingX, paddingY, zOffset } = props;
|
|
@@ -6843,8 +8011,8 @@ function ToastProvider(props) {
|
|
|
6843
8011
|
const id = params.id || String(toastId++);
|
|
6844
8012
|
const duration = params.duration || 5e3;
|
|
6845
8013
|
const dismiss = () => {
|
|
6846
|
-
var
|
|
6847
|
-
const timeoutId = (
|
|
8014
|
+
var _a;
|
|
8015
|
+
const timeoutId = (_a = toastsRef.current[id]) == null ? void 0 : _a.timeoutId;
|
|
6848
8016
|
setState((prevState) => {
|
|
6849
8017
|
const idx = prevState.findIndex((t) => t.id === id);
|
|
6850
8018
|
if (idx > -1) {
|
|
@@ -7162,23 +8330,94 @@ const Tree = memo(
|
|
|
7162
8330
|
);
|
|
7163
8331
|
Tree.displayName = "Tree";
|
|
7164
8332
|
|
|
7165
|
-
var __freeze$1 = Object.freeze;
|
|
7166
|
-
var __defProp$1 = Object.defineProperty;
|
|
7167
|
-
var __template$1 = (cooked, raw) => __freeze$1(__defProp$1(cooked, "raw", { value: __freeze$1(raw || cooked.slice()) }));
|
|
7168
|
-
var _a$1, _b, _c;
|
|
7169
8333
|
function treeItemRootStyle() {
|
|
7170
|
-
return css
|
|
8334
|
+
return css`
|
|
8335
|
+
&[role='none'] > [role='treeitem'] {
|
|
8336
|
+
outline: none;
|
|
8337
|
+
cursor: default;
|
|
8338
|
+
border-radius: 3px;
|
|
8339
|
+
|
|
8340
|
+
background-color: var(--card-bg-color);
|
|
8341
|
+
color: var(--treeitem-fg-color);
|
|
8342
|
+
|
|
8343
|
+
&:focus {
|
|
8344
|
+
position: relative;
|
|
8345
|
+
}
|
|
8346
|
+
}
|
|
8347
|
+
|
|
8348
|
+
&[role='treeitem'] {
|
|
8349
|
+
outline: none;
|
|
8350
|
+
|
|
8351
|
+
& > div {
|
|
8352
|
+
cursor: default;
|
|
8353
|
+
border-radius: 3px;
|
|
8354
|
+
|
|
8355
|
+
background-color: var(--card-bg-color);
|
|
8356
|
+
color: var(--treeitem-fg-color);
|
|
8357
|
+
}
|
|
8358
|
+
|
|
8359
|
+
&:focus > div {
|
|
8360
|
+
position: relative;
|
|
8361
|
+
}
|
|
8362
|
+
}
|
|
8363
|
+
`;
|
|
7171
8364
|
}
|
|
7172
8365
|
function treeItemRootColorStyle(props) {
|
|
7173
8366
|
const $tone = "default";
|
|
7174
8367
|
const { color } = getTheme_v2(props.theme);
|
|
7175
8368
|
const tone = color.selectable[$tone];
|
|
7176
|
-
return css
|
|
8369
|
+
return css`
|
|
8370
|
+
&[role='none'] {
|
|
8371
|
+
& > [role='treeitem'] {
|
|
8372
|
+
${_cardColorStyle(color, tone.enabled)}
|
|
8373
|
+
}
|
|
8374
|
+
|
|
8375
|
+
&[data-selected] > [role='treeitem'] {
|
|
8376
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
8377
|
+
}
|
|
8378
|
+
|
|
8379
|
+
@media (hover: hover) {
|
|
8380
|
+
&:not([data-selected]) > [role='treeitem']:not(:focus):hover {
|
|
8381
|
+
${_cardColorStyle(color, tone.hovered)}
|
|
8382
|
+
}
|
|
8383
|
+
|
|
8384
|
+
& > [role='treeitem']:focus {
|
|
8385
|
+
${_cardColorStyle(color, tone.selected)}
|
|
8386
|
+
}
|
|
8387
|
+
}
|
|
8388
|
+
}
|
|
8389
|
+
|
|
8390
|
+
&[role='treeitem'] {
|
|
8391
|
+
& > [data-ui='TreeItem__box'] {
|
|
8392
|
+
${_cardColorStyle(color, tone.enabled)}
|
|
8393
|
+
}
|
|
8394
|
+
|
|
8395
|
+
&[data-selected] > [data-ui='TreeItem__box'] {
|
|
8396
|
+
${_cardColorStyle(color, tone.pressed)}
|
|
8397
|
+
}
|
|
8398
|
+
|
|
8399
|
+
@media (hover: hover) {
|
|
8400
|
+
&:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover {
|
|
8401
|
+
${_cardColorStyle(color, tone.hovered)}
|
|
8402
|
+
}
|
|
8403
|
+
|
|
8404
|
+
&:focus > [data-ui='TreeItem__box'] {
|
|
8405
|
+
${_cardColorStyle(color, tone.selected)}
|
|
8406
|
+
}
|
|
8407
|
+
}
|
|
8408
|
+
}
|
|
8409
|
+
`;
|
|
7177
8410
|
}
|
|
7178
8411
|
function treeItemBoxStyle(props) {
|
|
7179
8412
|
const { $level } = props;
|
|
7180
8413
|
const { space } = getTheme_v2(props.theme);
|
|
7181
|
-
return css
|
|
8414
|
+
return css`
|
|
8415
|
+
padding-left: ${rem(space[2] * $level)};
|
|
8416
|
+
|
|
8417
|
+
&[data-as='a'] {
|
|
8418
|
+
text-decoration: none;
|
|
8419
|
+
}
|
|
8420
|
+
`;
|
|
7182
8421
|
}
|
|
7183
8422
|
|
|
7184
8423
|
function useTree() {
|
|
@@ -7207,13 +8446,13 @@ const TreeGroup = memo(function TreeGroup2(props) {
|
|
|
7207
8446
|
);
|
|
7208
8447
|
});
|
|
7209
8448
|
|
|
7210
|
-
var __freeze = Object.freeze;
|
|
7211
|
-
var __defProp = Object.defineProperty;
|
|
7212
|
-
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
|
|
7213
|
-
var _a;
|
|
7214
8449
|
const Root = memo(styled.li(treeItemRootStyle, treeItemRootColorStyle));
|
|
7215
8450
|
const TreeItemBox = styled(Box).attrs({ forwardedAs: "a" })(treeItemBoxStyle);
|
|
7216
|
-
const ToggleArrowText = styled(Text)
|
|
8451
|
+
const ToggleArrowText = styled(Text)`
|
|
8452
|
+
& > svg {
|
|
8453
|
+
transition: transform 100ms;
|
|
8454
|
+
}
|
|
8455
|
+
`;
|
|
7217
8456
|
const TreeItem = memo(function TreeItem2(props) {
|
|
7218
8457
|
const {
|
|
7219
8458
|
children,
|