@moderneinc/design-system-components 7.7.0 → 7.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/dist/DataGrid/DataGrid.d.ts +2 -2
- package/dist/InputField/InputField.d.ts +3 -3
- package/dist/ModActionsCell/ModActionsCell.d.ts +2 -2
- package/dist/PageContent/PageContent.d.ts +7 -1
- package/dist/Tabs/Tabs.d.ts +3 -2
- package/dist/Toolbar/Toolbar.d.ts +7 -1
- package/dist/Tooltip/Tooltip.d.ts +2 -2
- package/dist/Tree/Tree.d.ts +11 -0
- package/dist/TypologyControl/TypologyControl.d.ts +1 -1
- package/dist/index.d.ts +55 -13
- package/dist/index.esm.js +814 -90
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +811 -85
- package/dist/index.js.map +1 -1
- package/dist/utils/OverflowActions.d.ts +14 -0
- package/dist/utils/responsive.d.ts +26 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ var SvgIcon = require('@mui/material/SvgIcon');
|
|
|
10
10
|
var Alert = require('@mui/material/Alert');
|
|
11
11
|
var ButtonBase = require('@mui/material/ButtonBase');
|
|
12
12
|
var lucideReact = require('lucide-react');
|
|
13
|
+
var useMediaQuery = require('@mui/material/useMediaQuery');
|
|
13
14
|
var IconButton = require('@mui/material/IconButton');
|
|
14
15
|
var react = require('react');
|
|
15
16
|
var Breadcrumbs = require('@mui/material/Breadcrumbs');
|
|
@@ -214,16 +215,24 @@ const ModGeneralAvatar = ({
|
|
|
214
215
|
};
|
|
215
216
|
ModGeneralAvatar.displayName = "ModGeneralAvatar";
|
|
216
217
|
|
|
217
|
-
const CellContentContainer = styles.styled("div")({
|
|
218
|
+
const CellContentContainer = styles.styled("div")(({ theme }) => ({
|
|
218
219
|
display: "flex",
|
|
219
220
|
alignItems: "center",
|
|
220
221
|
gap: designSystemTokens.spacing.spacing_2,
|
|
221
222
|
minWidth: 0,
|
|
222
223
|
// Allow flex item to shrink below content size
|
|
223
224
|
width: "100%",
|
|
224
|
-
overflow: "hidden"
|
|
225
|
+
overflow: "hidden",
|
|
225
226
|
// Prevent content from overflowing cell boundaries
|
|
226
|
-
|
|
227
|
+
// Still clips sideways, but lets controls' 44px hit areas reach into the row's height and,
|
|
228
|
+
// through a padding the margin cancels, past the content's edge into the cell's padding.
|
|
229
|
+
[theme.breakpoints.down("md")]: {
|
|
230
|
+
overflowX: "clip",
|
|
231
|
+
overflowY: "visible",
|
|
232
|
+
paddingInline: `${designSystemTokens.spacing.spacing_1}px`,
|
|
233
|
+
marginInline: `-${designSystemTokens.spacing.spacing_1}px`
|
|
234
|
+
}
|
|
235
|
+
}));
|
|
227
236
|
const ModDataGridCellContent = ({ children, ...props }) => {
|
|
228
237
|
return /* @__PURE__ */ jsxRuntime.jsx(CellContentContainer, { ...props, children });
|
|
229
238
|
};
|
|
@@ -379,6 +388,45 @@ const ModActivityIndicatorCell = ({
|
|
|
379
388
|
};
|
|
380
389
|
ModActivityIndicatorCell.displayName = "ModActivityIndicatorCell";
|
|
381
390
|
|
|
391
|
+
const TOUCH_TARGET = designSystemTokens.spacing.spacing_5_1_2;
|
|
392
|
+
const FILL_AVAILABLE = ["-moz-available", "-webkit-fill-available", "stretch"];
|
|
393
|
+
function useIsCompact() {
|
|
394
|
+
const theme = styles.useTheme();
|
|
395
|
+
return useMediaQuery(theme.breakpoints.down("md"));
|
|
396
|
+
}
|
|
397
|
+
function touchTarget(theme, { pseudo = "after" } = {}) {
|
|
398
|
+
return {
|
|
399
|
+
[`&::${pseudo}`]: {
|
|
400
|
+
[theme.breakpoints.down("md")]: {
|
|
401
|
+
content: '""',
|
|
402
|
+
position: "absolute",
|
|
403
|
+
top: "50%",
|
|
404
|
+
left: "50%",
|
|
405
|
+
transform: "translate(-50%, -50%)",
|
|
406
|
+
width: "100%",
|
|
407
|
+
height: "100%",
|
|
408
|
+
minWidth: TOUCH_TARGET,
|
|
409
|
+
minHeight: TOUCH_TARGET
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
function inputTouchTarget(theme, { heightOnly = false } = {}) {
|
|
415
|
+
return {
|
|
416
|
+
[theme.breakpoints.down("md")]: {
|
|
417
|
+
top: "50%",
|
|
418
|
+
height: "100%",
|
|
419
|
+
minHeight: TOUCH_TARGET,
|
|
420
|
+
...heightOnly ? { transform: "translateY(-50%)" } : {
|
|
421
|
+
left: "50%",
|
|
422
|
+
transform: "translate(-50%, -50%)",
|
|
423
|
+
width: "100%",
|
|
424
|
+
minWidth: TOUCH_TARGET
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
|
|
382
430
|
const neutralSmallShadow = `${designSystemTokens.shadows.neutral.small.x}px ${designSystemTokens.shadows.neutral.small.y}px ${designSystemTokens.shadows.neutral.small.blur}px ${designSystemTokens.shadows.neutral.small.spread}px ${designSystemTokens.shadows.neutral.small.shadow}`;
|
|
383
431
|
const intentColors$1 = {
|
|
384
432
|
success: designSystemTokens.semanticColors.color.status.success,
|
|
@@ -450,6 +498,17 @@ const StyledAlert$2 = styles.styled(Alert, {
|
|
|
450
498
|
color: designSystemTokens.semanticColors.color.text.tooltip,
|
|
451
499
|
[`& .${ButtonBase.buttonBaseClasses.root}`]: { color: "inherit" }
|
|
452
500
|
}
|
|
501
|
+
},
|
|
502
|
+
[theme.breakpoints.down("md")]: {
|
|
503
|
+
width: FILL_AVAILABLE,
|
|
504
|
+
// A wrapped default alert grows instead of scrolling inside its fixed 64px.
|
|
505
|
+
...!isCompact && !hasChildren && {
|
|
506
|
+
height: "auto",
|
|
507
|
+
minHeight: designSystemTokens.spacing.spacing_8 - designSystemTokens.spacing.spacing_1_1_2 * 2,
|
|
508
|
+
paddingTop: designSystemTokens.spacing.spacing_1_1_2,
|
|
509
|
+
paddingBottom: designSystemTokens.spacing.spacing_1_1_2
|
|
510
|
+
},
|
|
511
|
+
[`& .${Alert.alertClasses.message}`]: { overflowWrap: "anywhere" }
|
|
453
512
|
}
|
|
454
513
|
};
|
|
455
514
|
}
|
|
@@ -554,26 +613,51 @@ const StyledAlert$1 = styles.styled(Alert, {
|
|
|
554
613
|
}
|
|
555
614
|
};
|
|
556
615
|
});
|
|
557
|
-
const
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
616
|
+
const ResponsiveAlert = styles.styled(StyledAlert$1, {
|
|
617
|
+
shouldForwardProp: (prop) => prop !== "hasControls"
|
|
618
|
+
})(
|
|
619
|
+
({ theme, messagePosition = "left", hasControls = false }) => hasControls && {
|
|
620
|
+
[theme.breakpoints.down("md")]: {
|
|
621
|
+
minHeight: designSystemTokens.height.button.large,
|
|
622
|
+
...messagePosition === "center" && { justifyContent: "flex-start" },
|
|
623
|
+
[`& .${Alert.alertClasses.message}`]: {
|
|
624
|
+
// MUI's message scrolls (overflow: auto), which would clip the link's hit area.
|
|
625
|
+
overflow: "visible",
|
|
626
|
+
overflowWrap: "anywhere",
|
|
627
|
+
...messagePosition === "center" && { flex: 1, "& > svg": { flexShrink: 0 } }
|
|
628
|
+
},
|
|
629
|
+
[`& .${Alert.alertClasses.action}`]: {
|
|
630
|
+
paddingLeft: designSystemTokens.spacing.spacing_1_2,
|
|
631
|
+
...messagePosition === "center" && { position: "static" }
|
|
632
|
+
}
|
|
633
|
+
}
|
|
565
634
|
}
|
|
566
|
-
|
|
635
|
+
);
|
|
636
|
+
const LinkText = styles.styled("span")(
|
|
637
|
+
({ theme, bannerType = "outlined" }) => ({
|
|
638
|
+
marginLeft: "auto",
|
|
639
|
+
fontWeight: designSystemTokens.typography.fontWeight.semiBold,
|
|
640
|
+
color: bannerType === "filled" ? designSystemTokens.semanticColors.color.text.linkOnBrand : designSystemTokens.semanticColors.color.text.link,
|
|
641
|
+
cursor: "pointer",
|
|
642
|
+
whiteSpace: "nowrap",
|
|
643
|
+
"&:hover": {
|
|
644
|
+
textDecoration: "underline"
|
|
645
|
+
},
|
|
646
|
+
...touchTarget(theme),
|
|
647
|
+
[theme.breakpoints.down("md")]: { position: "relative" }
|
|
648
|
+
})
|
|
649
|
+
);
|
|
567
650
|
const StyledIconButton = styles.styled(IconButton, {
|
|
568
651
|
shouldForwardProp: (prop) => prop !== "closeIconColor"
|
|
569
|
-
})(({ closeIconColor }) => ({
|
|
652
|
+
})(({ theme, closeIconColor }) => ({
|
|
570
653
|
minWidth: 24,
|
|
571
654
|
minHeight: 24,
|
|
572
655
|
padding: 0,
|
|
573
656
|
color: closeIconColor,
|
|
574
657
|
"&:hover": {
|
|
575
658
|
backgroundColor: "transparent"
|
|
576
|
-
}
|
|
659
|
+
},
|
|
660
|
+
...touchTarget(theme)
|
|
577
661
|
}));
|
|
578
662
|
const ModBanner = ({
|
|
579
663
|
intent = "info",
|
|
@@ -597,12 +681,13 @@ const ModBanner = ({
|
|
|
597
681
|
}
|
|
598
682
|
const closeIconColor = type === "filled" ? designSystemTokens.semanticColors.color.surface.raised : intentColors[intent].solid;
|
|
599
683
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
600
|
-
|
|
684
|
+
ResponsiveAlert,
|
|
601
685
|
{
|
|
602
686
|
...props,
|
|
603
687
|
intent,
|
|
604
688
|
bannerType: type,
|
|
605
689
|
messagePosition,
|
|
690
|
+
hasControls: showClose || Boolean(linkText),
|
|
606
691
|
icon: messagePosition === "left" ? icon || false : false,
|
|
607
692
|
action: showClose ? /* @__PURE__ */ jsxRuntime.jsx(StyledIconButton, { size: "small", onClick: handleClose, closeIconColor, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 16 }) }) : void 0,
|
|
608
693
|
children: messagePosition === "center" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -618,18 +703,25 @@ const ModBanner = ({
|
|
|
618
703
|
};
|
|
619
704
|
ModBanner.displayName = "ModBanner";
|
|
620
705
|
|
|
621
|
-
const
|
|
706
|
+
const ITEM = `.${Breadcrumbs.breadcrumbsClasses.li}`;
|
|
707
|
+
const FULL_TRAIL = `.${Breadcrumbs.breadcrumbsClasses.ol}:not(:has(> li > .${ButtonBase.buttonBaseClasses.root})):has(> ${ITEM} ~ ${ITEM} ~ ${ITEM})`;
|
|
708
|
+
const StyledBreadcrumbs = styles.styled(Breadcrumbs)(({ theme }) => ({
|
|
622
709
|
[`& .${Breadcrumbs.breadcrumbsClasses.separator}`]: {
|
|
623
710
|
margin: 0,
|
|
624
711
|
color: designSystemTokens.semanticColors.color.icon.utility
|
|
625
712
|
},
|
|
626
713
|
[`& .${Breadcrumbs.breadcrumbsClasses.ol}`]: {
|
|
627
714
|
gap: designSystemTokens.spacing.spacing_1
|
|
628
|
-
}
|
|
715
|
+
},
|
|
716
|
+
[`& ${FULL_TRAIL}`]: {
|
|
717
|
+
[theme.breakpoints.down("md")]: { rowGap: designSystemTokens.spacing.spacing_4 }
|
|
718
|
+
},
|
|
719
|
+
// The "…" that expands a collapsed trail.
|
|
720
|
+
[`& .${Breadcrumbs.breadcrumbsClasses.ol} > li > .${ButtonBase.buttonBaseClasses.root}`]: touchTarget(theme)
|
|
629
721
|
}));
|
|
630
722
|
const StyledBreadcrumbLink = styles.styled(Link, {
|
|
631
723
|
shouldForwardProp: (prop) => prop !== "current"
|
|
632
|
-
})(({ current = false }) => ({
|
|
724
|
+
})(({ theme, current = false }) => ({
|
|
633
725
|
fontSize: designSystemTokens.typography.fontSize.sm,
|
|
634
726
|
fontWeight: designSystemTokens.typography.fontWeight.medium,
|
|
635
727
|
lineHeight: 1,
|
|
@@ -644,7 +736,9 @@ const StyledBreadcrumbLink = styles.styled(Link, {
|
|
|
644
736
|
"&:focus-visible": {
|
|
645
737
|
outline: `2px solid ${designSystemTokens.semanticColors.color.border.focus}`,
|
|
646
738
|
outlineOffset: 2
|
|
647
|
-
}
|
|
739
|
+
},
|
|
740
|
+
...touchTarget(theme),
|
|
741
|
+
[theme.breakpoints.down("md")]: { position: "relative" }
|
|
648
742
|
}));
|
|
649
743
|
function ModBreadcrumbLink({
|
|
650
744
|
current = false,
|
|
@@ -665,14 +759,17 @@ function ModBreadcrumbLink({
|
|
|
665
759
|
);
|
|
666
760
|
}
|
|
667
761
|
function ModBreadcrumbs({ children, className }) {
|
|
762
|
+
const compact = useIsCompact();
|
|
668
763
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
669
764
|
StyledBreadcrumbs,
|
|
670
765
|
{
|
|
766
|
+
...compact && { maxItems: 3, itemsBeforeCollapse: 0, itemsAfterCollapse: 2 },
|
|
671
767
|
separator: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { size: 10.67, color: designSystemTokens.semanticColors.color.icon.utility }),
|
|
672
768
|
className,
|
|
673
769
|
"aria-label": "breadcrumb",
|
|
674
770
|
children
|
|
675
|
-
}
|
|
771
|
+
},
|
|
772
|
+
compact ? "compact" : "full"
|
|
676
773
|
);
|
|
677
774
|
}
|
|
678
775
|
|
|
@@ -711,6 +808,7 @@ const StyledButton = styles.styled(Button, {
|
|
|
711
808
|
position: "relative",
|
|
712
809
|
minWidth: "fit-content",
|
|
713
810
|
gap: designSystemTokens.spacing.spacing_1,
|
|
811
|
+
...touchTarget(theme),
|
|
714
812
|
// `gap` spaces the icons; MUI's slot margins would add to it
|
|
715
813
|
[`& .${Button.buttonClasses.startIcon}, & .${Button.buttonClasses.endIcon}`]: {
|
|
716
814
|
margin: 0
|
|
@@ -897,6 +995,7 @@ function ModButton({
|
|
|
897
995
|
ModButton.displayName = "ModButton";
|
|
898
996
|
|
|
899
997
|
const StyledButtonTab = styles.styled(MuiToggleButton)(({ theme }) => ({
|
|
998
|
+
...touchTarget(theme),
|
|
900
999
|
fontFamily: designSystemTokens.typography.fontFamily.body,
|
|
901
1000
|
fontSize: theme.typography.pxToRem(designSystemTokens.typography.fontSize.sm),
|
|
902
1001
|
lineHeight: 1,
|
|
@@ -965,8 +1064,11 @@ const StyledButtonTabGroup = styles.styled(MuiToggleButtonGroup)(({ theme, size
|
|
|
965
1064
|
borderRadius: designSystemTokens.borderRadius.button,
|
|
966
1065
|
border: `1px solid ${designSystemTokens.semanticColors.color.border.primary}`,
|
|
967
1066
|
overflow: "hidden",
|
|
1067
|
+
// The clip would cut the buttons' touch targets; round the end buttons to the inner (minus 1px border) radius.
|
|
1068
|
+
[theme.breakpoints.down("md")]: { overflow: "visible" },
|
|
968
1069
|
// Style all grouped children
|
|
969
1070
|
[`& .${MuiToggleButtonGroup.toggleButtonGroupClasses.grouped}`]: {
|
|
1071
|
+
...touchTarget(theme),
|
|
970
1072
|
flex: 1,
|
|
971
1073
|
minWidth: "auto",
|
|
972
1074
|
height: sizeStyles[size].height,
|
|
@@ -1002,12 +1104,20 @@ const StyledButtonTabGroup = styles.styled(MuiToggleButtonGroup)(({ theme, size
|
|
|
1002
1104
|
// First button: rounded left edge
|
|
1003
1105
|
[`&.${MuiToggleButtonGroup.toggleButtonGroupClasses.firstButton}`]: {
|
|
1004
1106
|
borderTopLeftRadius: designSystemTokens.borderRadius.button,
|
|
1005
|
-
borderBottomLeftRadius: designSystemTokens.borderRadius.button
|
|
1107
|
+
borderBottomLeftRadius: designSystemTokens.borderRadius.button,
|
|
1108
|
+
[theme.breakpoints.down("md")]: {
|
|
1109
|
+
borderTopLeftRadius: designSystemTokens.borderRadius.button - 1,
|
|
1110
|
+
borderBottomLeftRadius: designSystemTokens.borderRadius.button - 1
|
|
1111
|
+
}
|
|
1006
1112
|
},
|
|
1007
1113
|
// Last button: rounded right edge, no right border
|
|
1008
1114
|
[`&.${MuiToggleButtonGroup.toggleButtonGroupClasses.lastButton}`]: {
|
|
1009
1115
|
borderTopRightRadius: designSystemTokens.borderRadius.button,
|
|
1010
1116
|
borderBottomRightRadius: designSystemTokens.borderRadius.button,
|
|
1117
|
+
[theme.breakpoints.down("md")]: {
|
|
1118
|
+
borderTopRightRadius: designSystemTokens.borderRadius.button - 1,
|
|
1119
|
+
borderBottomRightRadius: designSystemTokens.borderRadius.button - 1
|
|
1120
|
+
},
|
|
1011
1121
|
borderRight: "none"
|
|
1012
1122
|
},
|
|
1013
1123
|
// Disabled state
|
|
@@ -1129,7 +1239,7 @@ const SmallDescription = styles.styled("p")(({ theme }) => ({
|
|
|
1129
1239
|
}));
|
|
1130
1240
|
const LargeStyledCard = styles.styled(MuiCard, {
|
|
1131
1241
|
shouldForwardProp: (prop) => prop !== "disabled" && prop !== "cardTheme"
|
|
1132
|
-
})(({ disabled = false, cardTheme = "light" }) => {
|
|
1242
|
+
})(({ theme, disabled = false, cardTheme = "light" }) => {
|
|
1133
1243
|
const isLight = cardTheme === "light";
|
|
1134
1244
|
const activeBorderColor = isLight ? designSystemTokens.semanticColors.button.primary.bg : designSystemTokens.colors.digitalGreen[300];
|
|
1135
1245
|
const defaultBorderColor = isLight ? designSystemTokens.semanticColors.color.border.primary : designSystemTokens.semanticColorsDark.color.border.primary;
|
|
@@ -1164,6 +1274,12 @@ const LargeStyledCard = styles.styled(MuiCard, {
|
|
|
1164
1274
|
opacity: 0.5,
|
|
1165
1275
|
pointerEvents: "none",
|
|
1166
1276
|
cursor: "not-allowed"
|
|
1277
|
+
},
|
|
1278
|
+
[theme.breakpoints.down("md")]: {
|
|
1279
|
+
maxWidth: FILL_AVAILABLE,
|
|
1280
|
+
// Grows instead of clipping when the narrower card wraps its description or actions.
|
|
1281
|
+
height: "auto",
|
|
1282
|
+
minHeight: 162
|
|
1167
1283
|
}
|
|
1168
1284
|
};
|
|
1169
1285
|
});
|
|
@@ -1212,12 +1328,17 @@ const LargeDescription = styles.styled("p", {
|
|
|
1212
1328
|
minWidth: "100%",
|
|
1213
1329
|
wordWrap: "break-word"
|
|
1214
1330
|
}));
|
|
1215
|
-
const LargeButtonsRow = styles.styled("div")({
|
|
1331
|
+
const LargeButtonsRow = styles.styled("div")(({ theme }) => ({
|
|
1216
1332
|
display: "flex",
|
|
1217
1333
|
gap: designSystemTokens.spacing.spacing_3,
|
|
1218
1334
|
alignItems: "flex-start",
|
|
1219
|
-
flexShrink: 0
|
|
1220
|
-
|
|
1335
|
+
flexShrink: 0,
|
|
1336
|
+
[theme.breakpoints.down("md")]: {
|
|
1337
|
+
flexWrap: "wrap",
|
|
1338
|
+
// 32px small buttons + 12px = a 44px pitch, so wrapped rows' hit areas meet without overlapping.
|
|
1339
|
+
rowGap: designSystemTokens.spacing.spacing_1_1_2
|
|
1340
|
+
}
|
|
1341
|
+
}));
|
|
1221
1342
|
const SmallCardImpl = ({
|
|
1222
1343
|
logo,
|
|
1223
1344
|
recipeCount,
|
|
@@ -1330,7 +1451,7 @@ const HelperText$2 = styles.styled("span")(({ theme, size = "medium" }) => ({
|
|
|
1330
1451
|
const XS_FOCUS_RING_RADIUS = 1;
|
|
1331
1452
|
const StyledCheckbox = styles.styled(Checkbox, {
|
|
1332
1453
|
shouldForwardProp: (prop) => prop !== "size"
|
|
1333
|
-
})(({ size = "medium" }) => {
|
|
1454
|
+
})(({ theme, size = "medium" }) => {
|
|
1334
1455
|
const sizeConfig = {
|
|
1335
1456
|
xs: {
|
|
1336
1457
|
size: 12,
|
|
@@ -1391,7 +1512,8 @@ const StyledCheckbox = styles.styled(Checkbox, {
|
|
|
1391
1512
|
"& svg": {
|
|
1392
1513
|
width: config.size,
|
|
1393
1514
|
height: config.size
|
|
1394
|
-
}
|
|
1515
|
+
},
|
|
1516
|
+
"& input": inputTouchTarget(theme)
|
|
1395
1517
|
};
|
|
1396
1518
|
});
|
|
1397
1519
|
const ModCheckbox = ({
|
|
@@ -1449,6 +1571,18 @@ const ModCheckboxWithText = ({ size = "small", ...props }) => {
|
|
|
1449
1571
|
};
|
|
1450
1572
|
ModCheckboxWithText.displayName = "ModCheckboxWithText";
|
|
1451
1573
|
|
|
1574
|
+
const compactStyles = (theme, size, isMultiline) => {
|
|
1575
|
+
if (isMultiline) {
|
|
1576
|
+
return {
|
|
1577
|
+
[theme.breakpoints.down("md")]: {
|
|
1578
|
+
minWidth: 0,
|
|
1579
|
+
whiteSpace: "pre-wrap",
|
|
1580
|
+
overflowWrap: "anywhere"
|
|
1581
|
+
}
|
|
1582
|
+
};
|
|
1583
|
+
}
|
|
1584
|
+
return size === "inline" ? {} : touchTarget(theme);
|
|
1585
|
+
};
|
|
1452
1586
|
const StyledButtonBase = styles.styled(ButtonBase, {
|
|
1453
1587
|
shouldForwardProp: (prop) => prop !== "isMultiline" && prop !== "variant" && prop !== "size"
|
|
1454
1588
|
})(({ theme, variant = "outlined", size = "small", isMultiline = false }) => {
|
|
@@ -1534,7 +1668,8 @@ const StyledButtonBase = styles.styled(ButtonBase, {
|
|
|
1534
1668
|
};
|
|
1535
1669
|
return {
|
|
1536
1670
|
...baseStyles,
|
|
1537
|
-
...variantStyles[variant]
|
|
1671
|
+
...variantStyles[variant],
|
|
1672
|
+
...compactStyles(theme, size, isMultiline)
|
|
1538
1673
|
};
|
|
1539
1674
|
});
|
|
1540
1675
|
const IconWrapper$2 = styles.styled("span")(({ isMultiline }) => ({
|
|
@@ -1874,6 +2009,9 @@ const StyledMenuItem = styles.styled(MenuItem)(({ theme }) => ({
|
|
|
1874
2009
|
paddingLeft: designSystemTokens.spacing.spacing_2,
|
|
1875
2010
|
paddingRight: designSystemTokens.spacing.spacing_2,
|
|
1876
2011
|
minHeight: designSystemTokens.spacing.spacing_5,
|
|
2012
|
+
[theme.breakpoints.down("md")]: {
|
|
2013
|
+
minHeight: TOUCH_TARGET
|
|
2014
|
+
},
|
|
1877
2015
|
gap: designSystemTokens.spacing.spacing_2,
|
|
1878
2016
|
borderRadius: 0,
|
|
1879
2017
|
color: designSystemTokens.semanticColors.color.icon.default,
|
|
@@ -1980,7 +2118,7 @@ const ChevronDownIcon = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
1980
2118
|
style: { ...props.style }
|
|
1981
2119
|
}
|
|
1982
2120
|
);
|
|
1983
|
-
const StyledSelect = styles.styled(MuiSelect)({
|
|
2121
|
+
const StyledSelect = styles.styled(MuiSelect)(({ theme }) => ({
|
|
1984
2122
|
minHeight: designSystemTokens.spacing.spacing_5,
|
|
1985
2123
|
backgroundColor: designSystemTokens.semanticColors.input.bg,
|
|
1986
2124
|
border: `1px solid ${designSystemTokens.semanticColors.color.border.primary}`,
|
|
@@ -2008,10 +2146,18 @@ const StyledSelect = styles.styled(MuiSelect)({
|
|
|
2008
2146
|
fontWeight: designSystemTokens.typography.fontWeight.regular,
|
|
2009
2147
|
color: designSystemTokens.semanticColors.color.text.input
|
|
2010
2148
|
},
|
|
2149
|
+
// Doubled `&` outranks MUI's own `.MuiSelect-select` rules, which are inserted after these.
|
|
2150
|
+
[`&& .${MuiSelect.selectClasses.select}`]: {
|
|
2151
|
+
[theme.breakpoints.down("md")]: {
|
|
2152
|
+
lineHeight: `${TOUCH_TARGET - 2 * designSystemTokens.spacing.spacing_1_2}px`,
|
|
2153
|
+
// Covers the root's 1px border, so all 44px of the control hit-test as the combobox.
|
|
2154
|
+
marginBlock: -1
|
|
2155
|
+
}
|
|
2156
|
+
},
|
|
2011
2157
|
[`& .${MuiSelect.selectClasses.icon}`]: {
|
|
2012
2158
|
right: designSystemTokens.spacing.spacing_1_1_2
|
|
2013
2159
|
}
|
|
2014
|
-
});
|
|
2160
|
+
}));
|
|
2015
2161
|
const ModSelect = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2016
2162
|
StyledSelect,
|
|
2017
2163
|
{
|
|
@@ -2045,7 +2191,7 @@ const ModDataGridFilterPanelDeleteIcon = () => /* @__PURE__ */ jsxRuntime.jsx(lu
|
|
|
2045
2191
|
ModDataGridFilterPanelDeleteIcon.displayName = "ModDataGridFilterPanelDeleteIcon";
|
|
2046
2192
|
const ModDataGridFilterPanelRemoveAllIcon = () => /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { size: designSystemTokens.spacing.spacing_2, color: designSystemTokens.semanticColors.button.tertiary.fg });
|
|
2047
2193
|
ModDataGridFilterPanelRemoveAllIcon.displayName = "ModDataGridFilterPanelRemoveAllIcon";
|
|
2048
|
-
const StyledGridFilterPanel = styles.styled(xDataGrid.GridFilterPanel)({
|
|
2194
|
+
const StyledGridFilterPanel = styles.styled(xDataGrid.GridFilterPanel)(({ theme }) => ({
|
|
2049
2195
|
...panelSurfaceStyles,
|
|
2050
2196
|
// Panel padding (12px top, 16px right/bottom/left)
|
|
2051
2197
|
paddingTop: designSystemTokens.spacing.spacing_2,
|
|
@@ -2169,6 +2315,7 @@ const StyledGridFilterPanel = styles.styled(xDataGrid.GridFilterPanel)({
|
|
|
2169
2315
|
// Buttons - design system styling
|
|
2170
2316
|
// Add filter button (first button)
|
|
2171
2317
|
[`& .${xDataGrid.gridClasses.panelFooter} .${Button.buttonClasses.root}:first-child`]: {
|
|
2318
|
+
...touchTarget(theme),
|
|
2172
2319
|
textTransform: "none",
|
|
2173
2320
|
fontSize: designSystemTokens.typography.fontSize.sm,
|
|
2174
2321
|
fontWeight: designSystemTokens.typography.fontWeight.medium,
|
|
@@ -2191,6 +2338,7 @@ const StyledGridFilterPanel = styles.styled(xDataGrid.GridFilterPanel)({
|
|
|
2191
2338
|
},
|
|
2192
2339
|
// Clear all button (second button) - styled to match ModButton link variant
|
|
2193
2340
|
[`& .${xDataGrid.gridClasses.panelFooter} .${Button.buttonClasses.root}:nth-child(2)`]: {
|
|
2341
|
+
...touchTarget(theme),
|
|
2194
2342
|
height: 32,
|
|
2195
2343
|
// ModButton small size
|
|
2196
2344
|
padding: `0 ${designSystemTokens.spacing.spacing_1}px`,
|
|
@@ -2220,8 +2368,41 @@ const StyledGridFilterPanel = styles.styled(xDataGrid.GridFilterPanel)({
|
|
|
2220
2368
|
},
|
|
2221
2369
|
[`& .${xDataGrid.gridClasses.filterForm} .${IconButton.iconButtonClasses.root}:hover`]: {
|
|
2222
2370
|
backgroundColor: designSystemTokens.semanticColors.input.bgHover
|
|
2371
|
+
},
|
|
2372
|
+
// In the sheet the fields share its full width; MUI X fixes each input at 150–220px.
|
|
2373
|
+
[theme.breakpoints.down("md")]: {
|
|
2374
|
+
[`& .${xDataGrid.gridClasses.filterForm}`]: {
|
|
2375
|
+
width: "100%"
|
|
2376
|
+
},
|
|
2377
|
+
[`& .MuiFormControl-root:has(.${xDataGrid.gridClasses.filterFormColumnInput}), & .MuiFormControl-root:has(.${xDataGrid.gridClasses.filterFormOperatorInput}), & .${xDataGrid.gridClasses.filterFormValueInput}`]: {
|
|
2378
|
+
flex: "1 1 0",
|
|
2379
|
+
minWidth: 0
|
|
2380
|
+
},
|
|
2381
|
+
[`& .${xDataGrid.gridClasses.filterForm} .${InputBase.inputBaseClasses.root}, & .${xDataGrid.gridClasses.filterFormValueInput} .MuiFormControl-root`]: {
|
|
2382
|
+
width: "100%"
|
|
2383
|
+
}
|
|
2384
|
+
},
|
|
2385
|
+
// On phones each filter opens with a row holding its And/Or select and its remove X, then column,
|
|
2386
|
+
// operator and value each take a full row.
|
|
2387
|
+
[theme.breakpoints.down("sm")]: {
|
|
2388
|
+
[`& .${xDataGrid.gridClasses.filterForm}`]: {
|
|
2389
|
+
flexWrap: "wrap",
|
|
2390
|
+
rowGap: designSystemTokens.spacing.spacing_1_1_2
|
|
2391
|
+
},
|
|
2392
|
+
[`& .MuiFormControl-root:has(.${xDataGrid.gridClasses.filterFormLogicOperatorInput})`]: {
|
|
2393
|
+
order: -1
|
|
2394
|
+
},
|
|
2395
|
+
[`& .${xDataGrid.gridClasses.filterFormDeleteIcon}`]: {
|
|
2396
|
+
marginLeft: "auto",
|
|
2397
|
+
marginRight: 0
|
|
2398
|
+
},
|
|
2399
|
+
[`& .MuiFormControl-root:has(.${xDataGrid.gridClasses.filterFormColumnInput}), & .MuiFormControl-root:has(.${xDataGrid.gridClasses.filterFormOperatorInput}), & .${xDataGrid.gridClasses.filterFormValueInput}`]: {
|
|
2400
|
+
flex: "1 1 100%",
|
|
2401
|
+
width: "100%",
|
|
2402
|
+
marginLeft: 0
|
|
2403
|
+
}
|
|
2223
2404
|
}
|
|
2224
|
-
});
|
|
2405
|
+
}));
|
|
2225
2406
|
StyledGridFilterPanel.displayName = "StyledGridFilterPanel";
|
|
2226
2407
|
const ModDataGridSelect = react.forwardRef(function ModDataGridSelect2({
|
|
2227
2408
|
id,
|
|
@@ -2290,11 +2471,38 @@ function UnsortedIcon() {
|
|
|
2290
2471
|
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsUpDown, { size: 16, color: designSystemTokens.semanticColors.color.icon.utility });
|
|
2291
2472
|
}
|
|
2292
2473
|
|
|
2293
|
-
const
|
|
2474
|
+
const COMPACT_MIN_COLUMN_WIDTH = 120;
|
|
2475
|
+
const ModGridPanel = styles.styled(xDataGrid.GridPanel)(({ theme }) => ({
|
|
2294
2476
|
[`& .${xDataGrid.gridPanelClasses.paper}`]: {
|
|
2295
2477
|
backgroundColor: designSystemTokens.semanticColors.color.surface.raised
|
|
2478
|
+
},
|
|
2479
|
+
// Below md the panel is a bottom sheet; Popper writes inset/transform inline, hence !important.
|
|
2480
|
+
[theme.breakpoints.down("md")]: {
|
|
2481
|
+
position: "fixed !important",
|
|
2482
|
+
inset: "auto 0 0 0 !important",
|
|
2483
|
+
transform: "none !important",
|
|
2484
|
+
[`& .${xDataGrid.gridPanelClasses.paper}`]: {
|
|
2485
|
+
width: "100%",
|
|
2486
|
+
maxWidth: "100%",
|
|
2487
|
+
maxHeight: "80vh",
|
|
2488
|
+
flexDirection: "column",
|
|
2489
|
+
overflowY: "auto",
|
|
2490
|
+
borderRadius: `${designSystemTokens.borderRadius.m}px ${designSystemTokens.borderRadius.m}px 0 0`,
|
|
2491
|
+
// The drawer shadow, flipped to cast upward from the bottom edge.
|
|
2492
|
+
boxShadow: `0 -${designSystemTokens.shadows.drawer.y}px ${designSystemTokens.shadows.drawer.blur}px ${designSystemTokens.shadows.drawer.spread}px ${designSystemTokens.shadows.drawer.shadow}`,
|
|
2493
|
+
"&::before": {
|
|
2494
|
+
content: '""',
|
|
2495
|
+
display: "block",
|
|
2496
|
+
flexShrink: 0,
|
|
2497
|
+
width: designSystemTokens.spacing.spacing_4,
|
|
2498
|
+
height: designSystemTokens.spacing.spacing_1_2,
|
|
2499
|
+
margin: `${designSystemTokens.spacing.spacing_1}px auto 0`,
|
|
2500
|
+
borderRadius: designSystemTokens.borderRadius.full,
|
|
2501
|
+
backgroundColor: designSystemTokens.semanticColors.color.border.strong
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2296
2504
|
}
|
|
2297
|
-
});
|
|
2505
|
+
}));
|
|
2298
2506
|
const DataGridCheckbox = ({
|
|
2299
2507
|
slotProps,
|
|
2300
2508
|
...props
|
|
@@ -2311,10 +2519,33 @@ function ModDataGrid({
|
|
|
2311
2519
|
toolbar,
|
|
2312
2520
|
slots,
|
|
2313
2521
|
sx,
|
|
2314
|
-
density
|
|
2522
|
+
density: densityProp,
|
|
2315
2523
|
slotProps: userSlotProps,
|
|
2524
|
+
columns: columnsProp,
|
|
2316
2525
|
...props
|
|
2317
2526
|
}) {
|
|
2527
|
+
const theme = styles.useTheme();
|
|
2528
|
+
const compact = useIsCompact();
|
|
2529
|
+
const density = densityProp ?? (compact ? "comfortable" : "standard");
|
|
2530
|
+
const columns = react.useMemo(
|
|
2531
|
+
() => compact ? columnsProp.map((column) => {
|
|
2532
|
+
const hasMenu = !(props.disableColumnMenu || column.disableColumnMenu);
|
|
2533
|
+
const hasSort = !props.disableColumnSorting && column.sortable !== false;
|
|
2534
|
+
if (column.type === "actions" || !(hasMenu || hasSort)) {
|
|
2535
|
+
return column;
|
|
2536
|
+
}
|
|
2537
|
+
const min = Math.min(
|
|
2538
|
+
COMPACT_MIN_COLUMN_WIDTH,
|
|
2539
|
+
column.maxWidth ?? Number.POSITIVE_INFINITY
|
|
2540
|
+
);
|
|
2541
|
+
return {
|
|
2542
|
+
...column,
|
|
2543
|
+
minWidth: Math.max(column.minWidth ?? 0, min),
|
|
2544
|
+
...column.width !== void 0 && { width: Math.max(column.width, min) }
|
|
2545
|
+
};
|
|
2546
|
+
}) : columnsProp,
|
|
2547
|
+
[compact, columnsProp, props.disableColumnMenu, props.disableColumnSorting]
|
|
2548
|
+
);
|
|
2318
2549
|
const defaultApiRef = xDataGridPro.useGridApiRef();
|
|
2319
2550
|
const apiRef = props?.apiRef ? props.apiRef : defaultApiRef;
|
|
2320
2551
|
const mergedSlots = {
|
|
@@ -2332,6 +2563,9 @@ function ModDataGrid({
|
|
|
2332
2563
|
// Add toolbar slot if toolbar prop is provided (overrides slots.toolbar if both exist)
|
|
2333
2564
|
...toolbar ? { toolbar: () => toolbar } : {}
|
|
2334
2565
|
};
|
|
2566
|
+
const compactQuery = theme.breakpoints.down("md");
|
|
2567
|
+
const plainSx = sx && typeof sx === "object" && !Array.isArray(sx);
|
|
2568
|
+
const { [compactQuery]: consumerCompact, ...restSx } = plainSx ? sx : {};
|
|
2335
2569
|
const baseSx = {
|
|
2336
2570
|
// Fix for MUI X 8.15.0+ scroll shadow issue - backgroundColor must be on main, not root
|
|
2337
2571
|
// See: https://github.com/mui/mui-x/issues/20107
|
|
@@ -2356,6 +2590,61 @@ function ModDataGrid({
|
|
|
2356
2590
|
backgroundColor: designSystemTokens.semanticColors.color.surface.dataGrid.default
|
|
2357
2591
|
},
|
|
2358
2592
|
...getDataGridHeaderStyles({ resizable: !props.disableColumnResize }),
|
|
2593
|
+
[`& .${xDataGrid.gridClasses.menuIconButton}`]: touchTarget(theme),
|
|
2594
|
+
// Covers `type: 'actions'` columns built with getActions, which bypass ModActionsCell.
|
|
2595
|
+
[`& .${xDataGrid.gridClasses.actionsCell} .${IconButton.iconButtonClasses.root}`]: touchTarget(theme),
|
|
2596
|
+
// On touch the filter icon is an indicator too and filters open from the column menu; a mouse in a
|
|
2597
|
+
// narrow window keeps clicking it. MUI gives the filter button no class of its own.
|
|
2598
|
+
[`${theme.breakpoints.down("md")} and (pointer: coarse)`]: {
|
|
2599
|
+
[`& button:has(> .${xDataGrid.gridClasses.filterIcon})`]: { pointerEvents: "none" }
|
|
2600
|
+
},
|
|
2601
|
+
[compactQuery]: {
|
|
2602
|
+
maxWidth: "100%",
|
|
2603
|
+
// Spaces adjacent row actions so their 44px hit areas don't overlap.
|
|
2604
|
+
[`& .${xDataGrid.gridClasses.actionsCell}`]: { columnGap: `${designSystemTokens.spacing.spacing_2}px` },
|
|
2605
|
+
// A tap on the header sorts; the sort icon only shows the direction, leaving the room to the column menu.
|
|
2606
|
+
[`& .${xDataGrid.gridClasses.sortButton}`]: {
|
|
2607
|
+
pointerEvents: "none"
|
|
2608
|
+
},
|
|
2609
|
+
// The header is tall enough below md for the select-all checkbox's hit area; stop clipping it.
|
|
2610
|
+
[`& .${xDataGrid.gridClasses.columnHeaderCheckbox} .${xDataGrid.gridClasses.columnHeaderTitleContainerContent}`]: {
|
|
2611
|
+
overflow: "visible"
|
|
2612
|
+
},
|
|
2613
|
+
// The checkbox column doesn't resize, so its separator is decoration; let taps pass through.
|
|
2614
|
+
[`& .${xDataGrid.gridClasses.columnHeaderCheckbox} .${xDataGrid.gridClasses.columnSeparator}`]: {
|
|
2615
|
+
pointerEvents: "none"
|
|
2616
|
+
},
|
|
2617
|
+
// Narrow columns keep room for their label: a tighter gutter on the title's side (cells below
|
|
2618
|
+
// match), while the menu side keeps its gutter so the menu's hit area clears the separator; a
|
|
2619
|
+
// header without a menu matches its cells on both sides. `:where` keeps this at the gutter rule's
|
|
2620
|
+
// specificity, so a consumer's own padding for that column still wins.
|
|
2621
|
+
// The sort slot takes no width while its icon is hidden, as in MUI's own default.
|
|
2622
|
+
[`& .${xDataGrid.gridClasses.columnHeader}:not(.${xDataGrid.gridClasses.columnHeaderCheckbox})`]: {
|
|
2623
|
+
paddingLeft: `${designSystemTokens.spacing.spacing_2}px`
|
|
2624
|
+
},
|
|
2625
|
+
[`& .${xDataGrid.gridClasses.columnHeader}:not(.${xDataGrid.gridClasses.columnHeaderCheckbox}):where(:not(:has(.${xDataGrid.gridClasses.menuIcon})))`]: {
|
|
2626
|
+
paddingRight: `${designSystemTokens.spacing.spacing_2}px`
|
|
2627
|
+
},
|
|
2628
|
+
[`& .${xDataGrid.gridClasses.columnHeader}.${xDataGrid.gridClasses["columnHeader--alignRight"]}`]: {
|
|
2629
|
+
paddingLeft: `${designSystemTokens.spacing.spacing_3}px`,
|
|
2630
|
+
paddingRight: `${designSystemTokens.spacing.spacing_2}px`
|
|
2631
|
+
},
|
|
2632
|
+
[`& .${xDataGrid.gridClasses.columnHeader}:not(.${xDataGrid.gridClasses["columnHeader--sorted"]}):not(:hover) .${xDataGrid.gridClasses.iconButtonContainer}:has(.${xDataGrid.gridClasses.sortButton})`]: {
|
|
2633
|
+
width: 0,
|
|
2634
|
+
marginLeft: 0
|
|
2635
|
+
},
|
|
2636
|
+
// Carry the header band across the filler past the last column, over the body-coloured filler rule.
|
|
2637
|
+
[`&& .${xDataGrid.gridClasses.columnHeaders} .${xDataGrid.gridClasses.filler}, && .${xDataGrid.gridClasses.columnHeaders} .${xDataGrid.gridClasses.scrollbarFiller}`]: {
|
|
2638
|
+
backgroundColor: designSystemTokens.semanticColors.color.surface.dataGrid.header,
|
|
2639
|
+
borderBottomColor: designSystemTokens.semanticColors.color.border.primary
|
|
2640
|
+
},
|
|
2641
|
+
// Two classes so this outranks the base cell padding declared further down.
|
|
2642
|
+
[`& .${xDataGrid.gridClasses.row} .${xDataGrid.gridClasses.cell}`]: {
|
|
2643
|
+
paddingLeft: `${designSystemTokens.spacing.spacing_2}px`,
|
|
2644
|
+
paddingRight: `${designSystemTokens.spacing.spacing_2}px`
|
|
2645
|
+
},
|
|
2646
|
+
...typeof consumerCompact === "function" ? consumerCompact(theme) : consumerCompact
|
|
2647
|
+
},
|
|
2359
2648
|
...getDataGridRowStyles(),
|
|
2360
2649
|
border: `1px solid ${designSystemTokens.semanticColors.color.border.primary}`,
|
|
2361
2650
|
// Target `& svg` (not `.MuiSvgIcon-root`) to match the lucide icons
|
|
@@ -2386,13 +2675,14 @@ function ModDataGrid({
|
|
|
2386
2675
|
wordBreak: "break-word",
|
|
2387
2676
|
hyphens: "auto"
|
|
2388
2677
|
},
|
|
2389
|
-
...sx
|
|
2678
|
+
...plainSx ? restSx : sx
|
|
2390
2679
|
};
|
|
2391
2680
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2392
2681
|
xDataGridPro.DataGridPro,
|
|
2393
2682
|
{
|
|
2394
2683
|
apiRef,
|
|
2395
|
-
|
|
2684
|
+
columns,
|
|
2685
|
+
columnHeaderHeight: compact ? designSystemTokens.height.button.large : designSystemTokens.height.table.header,
|
|
2396
2686
|
autoHeight,
|
|
2397
2687
|
autoPageSize: !autoHeight,
|
|
2398
2688
|
getRowHeight: () => "auto",
|
|
@@ -2666,6 +2956,7 @@ const StyledNavButton = styles.styled(IconButton, {
|
|
|
2666
2956
|
color: designSystemTokens.semanticColors.button.primary.bgPressed
|
|
2667
2957
|
};
|
|
2668
2958
|
return {
|
|
2959
|
+
...touchTarget(theme),
|
|
2669
2960
|
width: sizeStyles.width,
|
|
2670
2961
|
height: sizeStyles.height,
|
|
2671
2962
|
padding: sizeStyles.padding,
|
|
@@ -2911,10 +3202,12 @@ const ModDatePicker = ({
|
|
|
2911
3202
|
size: "small"
|
|
2912
3203
|
},
|
|
2913
3204
|
openPickerButton: {
|
|
2914
|
-
size: "small"
|
|
3205
|
+
size: "small",
|
|
3206
|
+
sx: (theme) => touchTarget(theme)
|
|
2915
3207
|
},
|
|
2916
3208
|
clearButton: {
|
|
2917
|
-
size: "small"
|
|
3209
|
+
size: "small",
|
|
3210
|
+
sx: (theme) => touchTarget(theme)
|
|
2918
3211
|
}
|
|
2919
3212
|
};
|
|
2920
3213
|
if (type === "range") {
|
|
@@ -3090,15 +3383,16 @@ const StyledLinearProgress$1 = styles.styled(LinearProgress)({
|
|
|
3090
3383
|
borderRadius: `${designSystemTokens.borderRadius.xS}px 0 0 ${designSystemTokens.borderRadius.xS}px`
|
|
3091
3384
|
}
|
|
3092
3385
|
});
|
|
3093
|
-
const ActionButton = styles.styled(IconButton)({
|
|
3386
|
+
const ActionButton = styles.styled(IconButton)(({ theme }) => ({
|
|
3094
3387
|
padding: 0,
|
|
3095
3388
|
width: designSystemTokens.spacing.spacing_2,
|
|
3096
3389
|
height: designSystemTokens.spacing.spacing_2,
|
|
3097
3390
|
color: designSystemTokens.semanticColors.color.icon.utility,
|
|
3098
3391
|
"&:hover": {
|
|
3099
3392
|
backgroundColor: "transparent"
|
|
3100
|
-
}
|
|
3101
|
-
|
|
3393
|
+
},
|
|
3394
|
+
...touchTarget(theme)
|
|
3395
|
+
}));
|
|
3102
3396
|
const ModDownloadToast = ({
|
|
3103
3397
|
title,
|
|
3104
3398
|
fileName,
|
|
@@ -3118,10 +3412,22 @@ const ModDownloadToast = ({
|
|
|
3118
3412
|
if (!hasActions) {
|
|
3119
3413
|
return null;
|
|
3120
3414
|
}
|
|
3121
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3415
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3416
|
+
Stack,
|
|
3417
|
+
{
|
|
3418
|
+
direction: "row",
|
|
3419
|
+
sx: (theme) => ({
|
|
3420
|
+
alignItems: "center",
|
|
3421
|
+
gap: `${designSystemTokens.spacing.spacing_2}px`,
|
|
3422
|
+
// Keeps the two buttons' 44px hit areas from overlapping.
|
|
3423
|
+
[theme.breakpoints.down("md")]: { gap: `${designSystemTokens.spacing.spacing_4}px` }
|
|
3424
|
+
}),
|
|
3425
|
+
children: [
|
|
3426
|
+
showPause && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { size: "small", onClick: onPause, "aria-label": "Pause download", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, { size: designSystemTokens.spacing.spacing_2 }) }),
|
|
3427
|
+
showClose && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { size: "small", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: designSystemTokens.spacing.spacing_2 }) })
|
|
3428
|
+
]
|
|
3429
|
+
}
|
|
3430
|
+
);
|
|
3125
3431
|
};
|
|
3126
3432
|
return /* @__PURE__ */ jsxRuntime.jsxs(StyledRoot$1, { elevation: 0, role: "status", ...props, children: [
|
|
3127
3433
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3276,6 +3582,12 @@ const StyledChip$1 = styles.styled(Chip, {
|
|
|
3276
3582
|
[`&.${Chip.chipClasses.focusVisible}`]: {
|
|
3277
3583
|
...focusRingStyles,
|
|
3278
3584
|
backgroundColor: selected ? designSystemTokens.semanticColors.button.secondary.bgPressed : designSystemTokens.semanticColors.color.surface.raised
|
|
3585
|
+
},
|
|
3586
|
+
...touchTarget(theme),
|
|
3587
|
+
[theme.breakpoints.down("md")]: {
|
|
3588
|
+
position: "relative",
|
|
3589
|
+
// Keeps the clear icon above the chip's hit area so a tap on it clears rather than opens.
|
|
3590
|
+
[`& .${Chip.chipClasses.deleteIcon}`]: { position: "relative", zIndex: 1 }
|
|
3279
3591
|
}
|
|
3280
3592
|
}));
|
|
3281
3593
|
const LabelContent = styles.styled("span")({
|
|
@@ -3458,7 +3770,9 @@ const LoadMoreButton = styles.styled("button")(({ theme }) => ({
|
|
|
3458
3770
|
"&:disabled": {
|
|
3459
3771
|
color: designSystemTokens.semanticColors.button.fgDisabled,
|
|
3460
3772
|
cursor: "not-allowed"
|
|
3461
|
-
}
|
|
3773
|
+
},
|
|
3774
|
+
...touchTarget(theme),
|
|
3775
|
+
[theme.breakpoints.down("md")]: { position: "relative" }
|
|
3462
3776
|
}));
|
|
3463
3777
|
const SelectedText = styles.styled("p")(({ theme }) => ({
|
|
3464
3778
|
fontFamily: designSystemTokens.typography.fontFamily.body,
|
|
@@ -3809,6 +4123,11 @@ const StyledInputBase = styles.styled(InputBase, {
|
|
|
3809
4123
|
transition: theme.transitions.create(["border-color", "background-color"], {
|
|
3810
4124
|
duration: theme.transitions.duration.short
|
|
3811
4125
|
}),
|
|
4126
|
+
// A tap on the hit area focuses the input; positioning keeps the input above it for caret taps.
|
|
4127
|
+
...touchTarget(theme, { pseudo: "before" }),
|
|
4128
|
+
[theme.breakpoints.down("md")]: {
|
|
4129
|
+
[`& .${InputBase.inputBaseClasses.input}`]: { position: "relative" }
|
|
4130
|
+
},
|
|
3812
4131
|
[`& .${InputBase.inputBaseClasses.input}`]: {
|
|
3813
4132
|
padding: sizeStyles.padding,
|
|
3814
4133
|
color: designSystemTokens.semanticColors.color.text.input,
|
|
@@ -3998,13 +4317,27 @@ const sizeConfig = {
|
|
|
3998
4317
|
lineHeight: 1.5
|
|
3999
4318
|
}
|
|
4000
4319
|
};
|
|
4320
|
+
function compactRowHeight(theme, rowHeight, hasSecondaryText) {
|
|
4321
|
+
if (rowHeight >= TOUCH_TARGET) {
|
|
4322
|
+
return {};
|
|
4323
|
+
}
|
|
4324
|
+
return {
|
|
4325
|
+
[theme.breakpoints.down("md")]: {
|
|
4326
|
+
minHeight: TOUCH_TARGET,
|
|
4327
|
+
height: hasSecondaryText ? "auto" : TOUCH_TARGET
|
|
4328
|
+
}
|
|
4329
|
+
};
|
|
4330
|
+
}
|
|
4001
4331
|
const StyledListItemButton$1 = styles.styled(ListItemButton, {
|
|
4002
4332
|
shouldForwardProp: (prop) => prop !== "size" && prop !== "primaryText" && prop !== "secondaryText" && prop !== "badge" && prop !== "icon" && prop !== "isLink" && prop !== "hasSecondaryText" && prop !== "trailingElement"
|
|
4003
4333
|
})(({ theme, size = "medium", isLink, hasSecondaryText }) => {
|
|
4004
4334
|
const config = sizeConfig[size];
|
|
4335
|
+
const isCard = size === "xxlarge" || size === "xxxlarge";
|
|
4005
4336
|
return {
|
|
4006
4337
|
minHeight: config.height,
|
|
4007
4338
|
height: hasSecondaryText ? "auto" : config.height,
|
|
4339
|
+
...compactRowHeight(theme, config.height, hasSecondaryText),
|
|
4340
|
+
...isCard && { [theme.breakpoints.down("md")]: { height: "auto" } },
|
|
4008
4341
|
paddingTop: config.paddingTop,
|
|
4009
4342
|
paddingRight: config.paddingRight,
|
|
4010
4343
|
paddingBottom: config.paddingBottom,
|
|
@@ -4041,7 +4374,11 @@ const StyledListItemButton$1 = styles.styled(ListItemButton, {
|
|
|
4041
4374
|
overflow: "hidden",
|
|
4042
4375
|
textOverflow: "ellipsis",
|
|
4043
4376
|
whiteSpace: "nowrap",
|
|
4044
|
-
...isLink &&
|
|
4377
|
+
...isLink && isCard && { textDecoration: "none" },
|
|
4378
|
+
// On a phone one line clips a trailing badge mid-chip; card rows wrap instead.
|
|
4379
|
+
...isCard && {
|
|
4380
|
+
[theme.breakpoints.down("md")]: { whiteSpace: "normal", overflowWrap: "anywhere" }
|
|
4381
|
+
}
|
|
4045
4382
|
},
|
|
4046
4383
|
// Link hover styling (underline on hover for xxlarge/xxxlarge)
|
|
4047
4384
|
...isLink && (size === "xxlarge" || size === "xxxlarge") && {
|
|
@@ -4188,6 +4525,9 @@ function navVariantStyles(theme) {
|
|
|
4188
4525
|
paddingBottom: designSystemTokens.spacing.spacing_1,
|
|
4189
4526
|
paddingLeft: designSystemTokens.spacing.spacing_2,
|
|
4190
4527
|
paddingRight: designSystemTokens.spacing.spacing_2,
|
|
4528
|
+
[theme.breakpoints.down("md")]: {
|
|
4529
|
+
minHeight: TOUCH_TARGET
|
|
4530
|
+
},
|
|
4191
4531
|
border: "none",
|
|
4192
4532
|
color: designSystemTokens.semanticColors.color.text.secondary,
|
|
4193
4533
|
backgroundColor: "transparent",
|
|
@@ -4325,13 +4665,27 @@ const ModMenu = ({ children, ...props }) => {
|
|
|
4325
4665
|
};
|
|
4326
4666
|
ModMenu.displayName = "ModMenu";
|
|
4327
4667
|
|
|
4328
|
-
const StyledActionsCell = styles.styled(xDataGrid.GridActionsCell)({
|
|
4668
|
+
const StyledActionsCell = styles.styled(xDataGrid.GridActionsCell)(({ theme }) => ({
|
|
4329
4669
|
gap: designSystemTokens.spacing.spacing_1,
|
|
4330
4670
|
paddingLeft: designSystemTokens.spacing.spacing_1_1_2,
|
|
4331
|
-
paddingRight: designSystemTokens.spacing.spacing_1_1_2
|
|
4671
|
+
paddingRight: designSystemTokens.spacing.spacing_1_1_2,
|
|
4672
|
+
// Below md a cell holds one button (a lone action or the menu trigger), so hit areas can't overlap.
|
|
4673
|
+
[`& .${IconButton.iconButtonClasses.root}`]: touchTarget(theme)
|
|
4674
|
+
}));
|
|
4675
|
+
const actionsOf = (children, prefix = "") => react.Children.toArray(children).flatMap((child) => {
|
|
4676
|
+
if (!react.isValidElement(child)) {
|
|
4677
|
+
return [];
|
|
4678
|
+
}
|
|
4679
|
+
const key = `${prefix}${child.key}`;
|
|
4680
|
+
return child.type === react.Fragment ? actionsOf(child.props.children, key) : [react.cloneElement(child, { key })];
|
|
4332
4681
|
});
|
|
4333
|
-
function ModActionsCell(props) {
|
|
4334
|
-
|
|
4682
|
+
function ModActionsCell({ children, ...props }) {
|
|
4683
|
+
const compact = useIsCompact();
|
|
4684
|
+
const actions = actionsOf(children);
|
|
4685
|
+
if (compact && actions.length > 1) {
|
|
4686
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledActionsCell, { ...props, children: actions.map((action) => react.cloneElement(action, { showInMenu: true })) }, "compact");
|
|
4687
|
+
}
|
|
4688
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledActionsCell, { ...props, children });
|
|
4335
4689
|
}
|
|
4336
4690
|
|
|
4337
4691
|
const StyledCell$1 = styles.styled("div", {
|
|
@@ -4381,7 +4735,7 @@ const ModAvatarCell = ({
|
|
|
4381
4735
|
};
|
|
4382
4736
|
ModAvatarCell.displayName = "ModAvatarCell";
|
|
4383
4737
|
|
|
4384
|
-
const StyledDialog = styles.styled(Dialog)({
|
|
4738
|
+
const StyledDialog = styles.styled(Dialog)(({ theme }) => ({
|
|
4385
4739
|
[`& .${Dialog.dialogClasses.paper}`]: {
|
|
4386
4740
|
backgroundColor: designSystemTokens.semanticColors.color.surface.raised,
|
|
4387
4741
|
borderRadius: designSystemTokens.borderRadius.card,
|
|
@@ -4391,16 +4745,33 @@ const StyledDialog = styles.styled(Dialog)({
|
|
|
4391
4745
|
[`& .${Dialog.dialogClasses.container}`]: {
|
|
4392
4746
|
alignItems: "center",
|
|
4393
4747
|
justifyContent: "center"
|
|
4748
|
+
},
|
|
4749
|
+
[theme.breakpoints.down("sm")]: {
|
|
4750
|
+
[`& .${Dialog.dialogClasses.paper}`]: {
|
|
4751
|
+
margin: 0,
|
|
4752
|
+
width: "100%",
|
|
4753
|
+
maxWidth: "100%",
|
|
4754
|
+
height: "100%",
|
|
4755
|
+
maxHeight: "100%",
|
|
4756
|
+
borderRadius: 0,
|
|
4757
|
+
border: "none"
|
|
4758
|
+
}
|
|
4394
4759
|
}
|
|
4395
|
-
});
|
|
4760
|
+
}));
|
|
4396
4761
|
const ModModal = ({ children, ...props }) => {
|
|
4397
4762
|
return /* @__PURE__ */ jsxRuntime.jsx(StyledDialog, { ...props, children });
|
|
4398
4763
|
};
|
|
4399
4764
|
ModModal.displayName = "ModModal";
|
|
4400
|
-
const ModalHeaderRoot = styles.styled("div")({
|
|
4765
|
+
const ModalHeaderRoot = styles.styled("div")(({ theme }) => ({
|
|
4401
4766
|
display: "flex",
|
|
4402
|
-
flexDirection: "column"
|
|
4403
|
-
|
|
4767
|
+
flexDirection: "column",
|
|
4768
|
+
// Header extras such as tabs otherwise end flush on the body text.
|
|
4769
|
+
[theme.breakpoints.down("md")]: {
|
|
4770
|
+
"&:has(> :nth-child(2))": {
|
|
4771
|
+
paddingBottom: designSystemTokens.spacing.spacing_2
|
|
4772
|
+
}
|
|
4773
|
+
}
|
|
4774
|
+
}));
|
|
4404
4775
|
const ModalHeaderTitleRow = styles.styled("div")({
|
|
4405
4776
|
display: "flex",
|
|
4406
4777
|
alignItems: "flex-start",
|
|
@@ -4445,7 +4816,8 @@ const ModalHeaderSubtitle = styles.styled("p")(({ theme }) => ({
|
|
|
4445
4816
|
lineHeight: 1.4,
|
|
4446
4817
|
color: designSystemTokens.semanticColors.color.text.secondary
|
|
4447
4818
|
}));
|
|
4448
|
-
const StyledCloseButton = styles.styled(IconButton)({
|
|
4819
|
+
const StyledCloseButton = styles.styled(IconButton)(({ theme }) => ({
|
|
4820
|
+
...touchTarget(theme),
|
|
4449
4821
|
color: designSystemTokens.semanticColors.color.icon.utility,
|
|
4450
4822
|
paddingTop: 0,
|
|
4451
4823
|
paddingRight: 0,
|
|
@@ -4458,7 +4830,7 @@ const StyledCloseButton = styles.styled(IconButton)({
|
|
|
4458
4830
|
backgroundColor: "transparent",
|
|
4459
4831
|
color: designSystemTokens.semanticColors.color.icon.utility
|
|
4460
4832
|
}
|
|
4461
|
-
});
|
|
4833
|
+
}));
|
|
4462
4834
|
const ModModalHeader = ({
|
|
4463
4835
|
title,
|
|
4464
4836
|
subtitle,
|
|
@@ -4513,7 +4885,7 @@ const ModModalContent = ({ children }) => {
|
|
|
4513
4885
|
return /* @__PURE__ */ jsxRuntime.jsx(StyledDialogContent, { dividers: false, children });
|
|
4514
4886
|
};
|
|
4515
4887
|
ModModalContent.displayName = "ModModalContent";
|
|
4516
|
-
const StyledDialogActions = styles.styled(DialogActions)({
|
|
4888
|
+
const StyledDialogActions = styles.styled(DialogActions)(({ theme }) => ({
|
|
4517
4889
|
paddingTop: 0,
|
|
4518
4890
|
paddingRight: designSystemTokens.spacing.spacing_4,
|
|
4519
4891
|
paddingBottom: designSystemTokens.spacing.spacing_4,
|
|
@@ -4525,15 +4897,38 @@ const StyledDialogActions = styles.styled(DialogActions)({
|
|
|
4525
4897
|
paddingTop: 0,
|
|
4526
4898
|
paddingRight: designSystemTokens.spacing.spacing_4,
|
|
4527
4899
|
paddingBottom: designSystemTokens.spacing.spacing_4,
|
|
4528
|
-
paddingLeft: designSystemTokens.spacing.spacing_4
|
|
4900
|
+
paddingLeft: designSystemTokens.spacing.spacing_4,
|
|
4901
|
+
// A full-screen body scrolls; the border marks where it ends and the actions begin.
|
|
4902
|
+
[theme.breakpoints.down("sm")]: {
|
|
4903
|
+
paddingTop: designSystemTokens.spacing.spacing_2,
|
|
4904
|
+
borderTop: `1px solid ${designSystemTokens.semanticColors.color.border.primary}`
|
|
4905
|
+
}
|
|
4906
|
+
},
|
|
4907
|
+
[theme.breakpoints.down("sm")]: {
|
|
4908
|
+
flexWrap: "wrap",
|
|
4909
|
+
columnGap: designSystemTokens.spacing.spacing_2,
|
|
4910
|
+
rowGap: designSystemTokens.spacing.spacing_2,
|
|
4911
|
+
// MUI's sibling margin would inset the actions past the header's edge.
|
|
4912
|
+
[`&.${DialogActions.dialogActionsClasses.spacing} > :not(style) ~ :not(style)`]: {
|
|
4913
|
+
marginLeft: 0
|
|
4914
|
+
}
|
|
4529
4915
|
}
|
|
4530
|
-
});
|
|
4531
|
-
const FooterActionsGroup = styles.styled("div")({
|
|
4916
|
+
}));
|
|
4917
|
+
const FooterActionsGroup = styles.styled("div")(({ theme }) => ({
|
|
4532
4918
|
display: "flex",
|
|
4533
4919
|
gap: designSystemTokens.spacing.spacing_2,
|
|
4534
4920
|
alignItems: "center",
|
|
4535
|
-
marginLeft: "auto"
|
|
4536
|
-
|
|
4921
|
+
marginLeft: "auto",
|
|
4922
|
+
// Full-width stack with the primary action last, nearest the thumb.
|
|
4923
|
+
// A small leading icon shares the actions' row; wider leading content pushes them to a row of their own.
|
|
4924
|
+
[theme.breakpoints.down("sm")]: {
|
|
4925
|
+
flex: "1 1 0",
|
|
4926
|
+
minWidth: "50%",
|
|
4927
|
+
flexDirection: "column",
|
|
4928
|
+
alignItems: "stretch",
|
|
4929
|
+
marginLeft: 0
|
|
4930
|
+
}
|
|
4931
|
+
}));
|
|
4537
4932
|
const ModModalFooter = ({ leadingContent, children }) => {
|
|
4538
4933
|
return /* @__PURE__ */ jsxRuntime.jsxs(StyledDialogActions, { children: [
|
|
4539
4934
|
leadingContent,
|
|
@@ -4867,6 +5262,23 @@ const StyledTooltip = styles.styled(
|
|
|
4867
5262
|
}
|
|
4868
5263
|
};
|
|
4869
5264
|
});
|
|
5265
|
+
const withCompactFallback = (placement, popper) => {
|
|
5266
|
+
const side = placement?.split("-")[0];
|
|
5267
|
+
if (side !== "left" && side !== "right") {
|
|
5268
|
+
return popper;
|
|
5269
|
+
}
|
|
5270
|
+
const flip = {
|
|
5271
|
+
name: "flip",
|
|
5272
|
+
options: { fallbackPlacements: [side === "left" ? "right" : "left", "top", "bottom"] }
|
|
5273
|
+
};
|
|
5274
|
+
return {
|
|
5275
|
+
...popper,
|
|
5276
|
+
popperOptions: {
|
|
5277
|
+
...popper?.popperOptions,
|
|
5278
|
+
modifiers: [flip, ...popper?.popperOptions?.modifiers ?? []]
|
|
5279
|
+
}
|
|
5280
|
+
};
|
|
5281
|
+
};
|
|
4870
5282
|
const ModTooltip = ({
|
|
4871
5283
|
variant = "light",
|
|
4872
5284
|
title,
|
|
@@ -4875,9 +5287,21 @@ const ModTooltip = ({
|
|
|
4875
5287
|
arrow = false,
|
|
4876
5288
|
placement,
|
|
4877
5289
|
describeChild,
|
|
5290
|
+
slotProps,
|
|
4878
5291
|
...props
|
|
4879
5292
|
}) => {
|
|
4880
5293
|
const accessibleName = typeof title === "string" && !description && !describeChild ? title : void 0;
|
|
5294
|
+
const isCompact = useIsCompact();
|
|
5295
|
+
const compactSlotProps = react.useMemo(() => {
|
|
5296
|
+
const popper = slotProps?.popper;
|
|
5297
|
+
if (!isCompact) {
|
|
5298
|
+
return slotProps;
|
|
5299
|
+
}
|
|
5300
|
+
return {
|
|
5301
|
+
...slotProps,
|
|
5302
|
+
popper: typeof popper === "function" ? (ownerState) => withCompactFallback(placement, popper(ownerState)) : withCompactFallback(placement, popper)
|
|
5303
|
+
};
|
|
5304
|
+
}, [isCompact, placement, slotProps]);
|
|
4881
5305
|
const titleContent = description ? /* @__PURE__ */ jsxRuntime.jsxs(Stack, { sx: { gap: `${designSystemTokens.spacing.spacing_1_4}px` }, children: [
|
|
4882
5306
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "inherit", sx: { fontWeight: designSystemTokens.typography.fontWeight.semiBold }, children: title }),
|
|
4883
5307
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "inherit", children: description })
|
|
@@ -4891,6 +5315,7 @@ const ModTooltip = ({
|
|
|
4891
5315
|
placement,
|
|
4892
5316
|
describeChild,
|
|
4893
5317
|
"aria-label": accessibleName,
|
|
5318
|
+
slotProps: compactSlotProps,
|
|
4894
5319
|
...props,
|
|
4895
5320
|
children
|
|
4896
5321
|
}
|
|
@@ -5015,6 +5440,71 @@ function ModNavigationItem({
|
|
|
5015
5440
|
}
|
|
5016
5441
|
ModNavigationItem.displayName = "ModNavigationItem";
|
|
5017
5442
|
|
|
5443
|
+
function OverflowActions({ actions = [] }) {
|
|
5444
|
+
const compact = useIsCompact();
|
|
5445
|
+
const [anchor, setAnchor] = react.useState(null);
|
|
5446
|
+
const menuId = react.useId();
|
|
5447
|
+
react.useEffect(() => {
|
|
5448
|
+
if (!compact) {
|
|
5449
|
+
setAnchor(null);
|
|
5450
|
+
}
|
|
5451
|
+
}, [compact]);
|
|
5452
|
+
if (actions.length === 0) {
|
|
5453
|
+
return null;
|
|
5454
|
+
}
|
|
5455
|
+
const [first, ...rest] = actions;
|
|
5456
|
+
const inline = compact && rest.length > 0 ? [first] : actions;
|
|
5457
|
+
const overflow = compact ? rest : [];
|
|
5458
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: `${designSystemTokens.spacing.spacing_1}px` }, children: [
|
|
5459
|
+
inline.map((action) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5460
|
+
ModButton,
|
|
5461
|
+
{
|
|
5462
|
+
variant: action.variant,
|
|
5463
|
+
startIcon: action.icon,
|
|
5464
|
+
disabled: action.disabled,
|
|
5465
|
+
onClick: action.onClick,
|
|
5466
|
+
children: action.label
|
|
5467
|
+
},
|
|
5468
|
+
action.id
|
|
5469
|
+
)),
|
|
5470
|
+
overflow.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5471
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5472
|
+
ModIconButton,
|
|
5473
|
+
{
|
|
5474
|
+
"aria-label": "More actions",
|
|
5475
|
+
"aria-haspopup": "menu",
|
|
5476
|
+
"aria-expanded": anchor !== null,
|
|
5477
|
+
"aria-controls": anchor ? menuId : void 0,
|
|
5478
|
+
onClick: (event) => setAnchor(event.currentTarget),
|
|
5479
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EllipsisVertical, {})
|
|
5480
|
+
}
|
|
5481
|
+
),
|
|
5482
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5483
|
+
ModMenu,
|
|
5484
|
+
{
|
|
5485
|
+
anchorEl: anchor,
|
|
5486
|
+
open: anchor !== null,
|
|
5487
|
+
onClose: () => setAnchor(null),
|
|
5488
|
+
slotProps: { list: { id: menuId } },
|
|
5489
|
+
children: overflow.map((action) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5490
|
+
ModMenuItem,
|
|
5491
|
+
{
|
|
5492
|
+
icon: action.icon,
|
|
5493
|
+
disabled: action.disabled,
|
|
5494
|
+
onClick: () => {
|
|
5495
|
+
setAnchor(null);
|
|
5496
|
+
action.onClick();
|
|
5497
|
+
},
|
|
5498
|
+
children: action.label
|
|
5499
|
+
},
|
|
5500
|
+
action.id
|
|
5501
|
+
))
|
|
5502
|
+
}
|
|
5503
|
+
)
|
|
5504
|
+
] })
|
|
5505
|
+
] });
|
|
5506
|
+
}
|
|
5507
|
+
|
|
5018
5508
|
const StickyHeader = styles.styled(Box)(({ theme }) => ({
|
|
5019
5509
|
position: "sticky",
|
|
5020
5510
|
top: 0,
|
|
@@ -5036,6 +5526,7 @@ function ModPageContent({
|
|
|
5036
5526
|
subtitle,
|
|
5037
5527
|
breadcrumbs,
|
|
5038
5528
|
action,
|
|
5529
|
+
actions,
|
|
5039
5530
|
sticky = false,
|
|
5040
5531
|
contentMaxWidth: contentMaxWidthProp = false,
|
|
5041
5532
|
centerContent = true,
|
|
@@ -5094,13 +5585,19 @@ function ModPageContent({
|
|
|
5094
5585
|
Stack,
|
|
5095
5586
|
{
|
|
5096
5587
|
direction: "row",
|
|
5097
|
-
sx:
|
|
5588
|
+
sx: (theme) => ({
|
|
5589
|
+
justifyContent: "space-between",
|
|
5590
|
+
alignItems: "flex-start",
|
|
5591
|
+
gap: "1rem",
|
|
5592
|
+
[theme.breakpoints.down("md")]: { flexWrap: "wrap" }
|
|
5593
|
+
}),
|
|
5098
5594
|
children: [
|
|
5099
5595
|
/* @__PURE__ */ jsxRuntime.jsxs(Stack, { sx: { gap: "0.5rem", flexGrow: 1 }, children: [
|
|
5100
5596
|
typeof pageTitle === "string" ? /* @__PURE__ */ jsxRuntime.jsx(PageTitle, { component: "h1", children: pageTitle }) : pageTitle,
|
|
5101
5597
|
subtitle && (typeof subtitle === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Subtitle, { variant: "caption", children: subtitle }) : subtitle)
|
|
5102
5598
|
] }),
|
|
5103
|
-
action
|
|
5599
|
+
action,
|
|
5600
|
+
/* @__PURE__ */ jsxRuntime.jsx(OverflowActions, { actions })
|
|
5104
5601
|
]
|
|
5105
5602
|
}
|
|
5106
5603
|
)
|
|
@@ -5259,7 +5756,16 @@ function ModPaginatedGrid({
|
|
|
5259
5756
|
}
|
|
5260
5757
|
ModPaginatedGrid.displayName = "ModPaginatedGrid";
|
|
5261
5758
|
|
|
5759
|
+
const StyledQuickFilter = styles.styled(xDataGrid.QuickFilter)(({ theme }) => ({
|
|
5760
|
+
[theme.breakpoints.down("sm")]: {
|
|
5761
|
+
flex: "1 1 100%",
|
|
5762
|
+
minWidth: 0
|
|
5763
|
+
}
|
|
5764
|
+
}));
|
|
5262
5765
|
const StyledTextField = styles.styled(TextField)(({ theme }) => ({
|
|
5766
|
+
[theme.breakpoints.down("sm")]: {
|
|
5767
|
+
width: "100%"
|
|
5768
|
+
},
|
|
5263
5769
|
[`& .${InputBase.inputBaseClasses.root}`]: {
|
|
5264
5770
|
height: designSystemTokens.spacing.spacing_5,
|
|
5265
5771
|
fontSize: theme.typography.pxToRem(designSystemTokens.typography.fontSize.default),
|
|
@@ -5271,6 +5777,9 @@ const StyledTextField = styles.styled(TextField)(({ theme }) => ({
|
|
|
5271
5777
|
paddingLeft: designSystemTokens.spacing.spacing_1_1_2,
|
|
5272
5778
|
paddingRight: designSystemTokens.spacing.spacing_1_1_2,
|
|
5273
5779
|
gap: designSystemTokens.spacing.spacing_1_2,
|
|
5780
|
+
[theme.breakpoints.down("md")]: {
|
|
5781
|
+
height: TOUCH_TARGET
|
|
5782
|
+
},
|
|
5274
5783
|
"&::before, &::after": {
|
|
5275
5784
|
display: "none"
|
|
5276
5785
|
},
|
|
@@ -5305,6 +5814,7 @@ const StyledTextField = styles.styled(TextField)(({ theme }) => ({
|
|
|
5305
5814
|
marginRight: 0
|
|
5306
5815
|
},
|
|
5307
5816
|
[`& .${IconButton.iconButtonClasses.root}`]: {
|
|
5817
|
+
...touchTarget(theme),
|
|
5308
5818
|
color: designSystemTokens.semanticColors.color.icon.placeholder,
|
|
5309
5819
|
"&:hover": {
|
|
5310
5820
|
backgroundColor: designSystemTokens.semanticColors.color.icon.bgHover,
|
|
@@ -5321,7 +5831,7 @@ const ModQuickFilter = ({
|
|
|
5321
5831
|
onKeyDown,
|
|
5322
5832
|
autoFocus = false
|
|
5323
5833
|
}) => {
|
|
5324
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5834
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledQuickFilter, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5325
5835
|
xDataGrid.QuickFilterControl,
|
|
5326
5836
|
{
|
|
5327
5837
|
onKeyDown,
|
|
@@ -5461,7 +5971,7 @@ const HelperText$1 = styles.styled("span")(({ theme, size = "medium" }) => ({
|
|
|
5461
5971
|
}));
|
|
5462
5972
|
const StyledRadio = styles.styled(Radio, {
|
|
5463
5973
|
shouldForwardProp: (prop) => prop !== "size"
|
|
5464
|
-
})(({ size = "medium" }) => {
|
|
5974
|
+
})(({ theme, size = "medium" }) => {
|
|
5465
5975
|
const dimensions = size === "small" ? 16 : 20;
|
|
5466
5976
|
const radius = size === "small" ? 8 : 10;
|
|
5467
5977
|
return {
|
|
@@ -5482,6 +5992,7 @@ const StyledRadio = styles.styled(Radio, {
|
|
|
5482
5992
|
width: dimensions,
|
|
5483
5993
|
height: dimensions
|
|
5484
5994
|
},
|
|
5995
|
+
"& input": inputTouchTarget(theme),
|
|
5485
5996
|
// Focus state for keyboard navigation
|
|
5486
5997
|
[`&.${ButtonBase.buttonBaseClasses.focusVisible}`]: {
|
|
5487
5998
|
// Unchecked focus state: white background
|
|
@@ -5610,6 +6121,11 @@ const StyledSearchChip = styles.styled(InputBase, {
|
|
|
5610
6121
|
transition: theme.transitions.create(["border-color", "background-color"], {
|
|
5611
6122
|
duration: theme.transitions.duration.short
|
|
5612
6123
|
}),
|
|
6124
|
+
// A tap on the hit area focuses the input; positioning keeps the input above it for caret taps.
|
|
6125
|
+
...touchTarget(theme, { pseudo: "before" }),
|
|
6126
|
+
[theme.breakpoints.down("md")]: {
|
|
6127
|
+
[`& .${InputBase.inputBaseClasses.input}`]: { position: "relative" }
|
|
6128
|
+
},
|
|
5613
6129
|
[`& .${InputBase.inputBaseClasses.input}`]: {
|
|
5614
6130
|
padding: `0 ${designSystemTokens.spacing.spacing_1_4}px`,
|
|
5615
6131
|
height: "auto",
|
|
@@ -5642,7 +6158,8 @@ const StyledSearchChip = styles.styled(InputBase, {
|
|
|
5642
6158
|
outline: `3px solid ${designSystemTokens.semanticColors.color.action.tint}`
|
|
5643
6159
|
}
|
|
5644
6160
|
}));
|
|
5645
|
-
const ClearButton = styles.styled(ButtonBase)({
|
|
6161
|
+
const ClearButton = styles.styled(ButtonBase)(({ theme }) => ({
|
|
6162
|
+
...touchTarget(theme),
|
|
5646
6163
|
display: "inline-flex",
|
|
5647
6164
|
alignItems: "center",
|
|
5648
6165
|
justifyContent: "center",
|
|
@@ -5658,7 +6175,7 @@ const ClearButton = styles.styled(ButtonBase)({
|
|
|
5658
6175
|
"&:hover": {
|
|
5659
6176
|
backgroundColor: designSystemTokens.semanticColors.button.secondary.bgHover
|
|
5660
6177
|
}
|
|
5661
|
-
});
|
|
6178
|
+
}));
|
|
5662
6179
|
const ModSearchChip = ({ onClear, value, ...props }) => {
|
|
5663
6180
|
const hasValue = Boolean(value && String(value).length > 0);
|
|
5664
6181
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5844,7 +6361,7 @@ const Handle = styles.styled(ButtonBase)(({ theme }) => ({
|
|
|
5844
6361
|
borderColor: designSystemTokens.semanticColors.color.border.primary
|
|
5845
6362
|
}
|
|
5846
6363
|
}));
|
|
5847
|
-
function useScrollEdges() {
|
|
6364
|
+
function useScrollEdges$1() {
|
|
5848
6365
|
const ref = react.useRef(null);
|
|
5849
6366
|
const contentRef = react.useRef(null);
|
|
5850
6367
|
const [edges, setEdges] = react.useState({
|
|
@@ -5888,7 +6405,7 @@ function ModSideNav({
|
|
|
5888
6405
|
"aria-label": ariaLabel
|
|
5889
6406
|
}) {
|
|
5890
6407
|
const contextValue = react.useMemo(() => ({ collapsed }), [collapsed]);
|
|
5891
|
-
const { ref: scrollRef, contentRef, onScroll, canScrollUp, canScrollDown } = useScrollEdges();
|
|
6408
|
+
const { ref: scrollRef, contentRef, onScroll, canScrollUp, canScrollDown } = useScrollEdges$1();
|
|
5892
6409
|
const HandleIcon = collapsed ? lucideReact.ChevronRight : lucideReact.ChevronLeft;
|
|
5893
6410
|
return /* @__PURE__ */ jsxRuntime.jsx(ModSideNavContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(Frame, { collapsed, children: [
|
|
5894
6411
|
/* @__PURE__ */ jsxRuntime.jsxs(Root, { collapsed, "aria-label": ariaLabel, className, id, children: [
|
|
@@ -5953,7 +6470,9 @@ const StyledSkeleton = styles.styled(Skeleton, {
|
|
|
5953
6470
|
"&::after": {
|
|
5954
6471
|
animationDirection: "reverse"
|
|
5955
6472
|
}
|
|
5956
|
-
}
|
|
6473
|
+
},
|
|
6474
|
+
// A fixed width sized for desktop yields to a phone-width container.
|
|
6475
|
+
[theme.breakpoints.down("md")]: { maxWidth: "100%" }
|
|
5957
6476
|
}));
|
|
5958
6477
|
const ModSkeleton = ({
|
|
5959
6478
|
colorTheme = "light",
|
|
@@ -6080,20 +6599,91 @@ const ModTabPanel = ({
|
|
|
6080
6599
|
};
|
|
6081
6600
|
ModTabPanel.displayName = "ModTabPanel";
|
|
6082
6601
|
|
|
6083
|
-
const
|
|
6602
|
+
const EDGE_FADE = designSystemTokens.spacing.spacing_4;
|
|
6603
|
+
const StyledTabs = styles.styled(MuiTabs)(({ theme }) => ({
|
|
6084
6604
|
minHeight: designSystemTokens.spacing.spacing_5,
|
|
6605
|
+
[theme.breakpoints.down("md")]: {
|
|
6606
|
+
minHeight: TOUCH_TARGET
|
|
6607
|
+
},
|
|
6085
6608
|
[`& .${MuiTabs.tabsClasses.indicator}`]: {
|
|
6086
6609
|
backgroundColor: designSystemTokens.semanticColors.button.nav.borderActive,
|
|
6087
|
-
height: 2
|
|
6610
|
+
height: 2,
|
|
6611
|
+
// The indicator overlaps the selected tab's bottom edge; let those taps reach the tab.
|
|
6612
|
+
[theme.breakpoints.down("md")]: {
|
|
6613
|
+
pointerEvents: "none"
|
|
6614
|
+
}
|
|
6088
6615
|
},
|
|
6089
6616
|
[`& .${MuiTabs.tabsClasses.list}`]: {
|
|
6090
6617
|
gap: 0
|
|
6618
|
+
},
|
|
6619
|
+
// A row that scrolls fades out at each edge it can still scroll toward (set by ModTabs below md).
|
|
6620
|
+
[theme.breakpoints.down("md")]: {
|
|
6621
|
+
[`&[data-fade-end] .${MuiTabs.tabsClasses.scroller}`]: {
|
|
6622
|
+
maskImage: `linear-gradient(to right, black calc(100% - ${EDGE_FADE}px), transparent)`
|
|
6623
|
+
},
|
|
6624
|
+
[`&[data-fade-start] .${MuiTabs.tabsClasses.scroller}`]: {
|
|
6625
|
+
maskImage: `linear-gradient(to left, black calc(100% - ${EDGE_FADE}px), transparent)`
|
|
6626
|
+
},
|
|
6627
|
+
[`&[data-fade-start][data-fade-end] .${MuiTabs.tabsClasses.scroller}`]: {
|
|
6628
|
+
maskImage: `linear-gradient(to right, transparent, black ${EDGE_FADE}px, black calc(100% - ${EDGE_FADE}px), transparent)`
|
|
6629
|
+
}
|
|
6091
6630
|
}
|
|
6092
6631
|
}));
|
|
6632
|
+
function useScrollEdges(active) {
|
|
6633
|
+
const rootRef = react.useRef(null);
|
|
6634
|
+
const [edges, setEdges] = react.useState({ start: false, end: false });
|
|
6635
|
+
react.useEffect(() => {
|
|
6636
|
+
const scroller = rootRef.current?.querySelector(`.${MuiTabs.tabsClasses.scroller}`);
|
|
6637
|
+
if (!active || !scroller) {
|
|
6638
|
+
setEdges((prev) => prev.start || prev.end ? { start: false, end: false } : prev);
|
|
6639
|
+
return;
|
|
6640
|
+
}
|
|
6641
|
+
const measure = () => {
|
|
6642
|
+
const left = Math.abs(scroller.scrollLeft);
|
|
6643
|
+
const start = left > 0;
|
|
6644
|
+
const end = left + scroller.clientWidth < scroller.scrollWidth - 1;
|
|
6645
|
+
setEdges((prev) => prev.start === start && prev.end === end ? prev : { start, end });
|
|
6646
|
+
};
|
|
6647
|
+
measure();
|
|
6648
|
+
scroller.addEventListener("scroll", measure, { passive: true });
|
|
6649
|
+
const resize = new ResizeObserver(measure);
|
|
6650
|
+
resize.observe(scroller);
|
|
6651
|
+
for (const child of scroller.children) {
|
|
6652
|
+
resize.observe(child);
|
|
6653
|
+
}
|
|
6654
|
+
return () => {
|
|
6655
|
+
scroller.removeEventListener("scroll", measure);
|
|
6656
|
+
resize.disconnect();
|
|
6657
|
+
};
|
|
6658
|
+
}, [active]);
|
|
6659
|
+
return { rootRef, edges };
|
|
6660
|
+
}
|
|
6661
|
+
const ModTabs = react.forwardRef(function ModTabs2(props, ref) {
|
|
6662
|
+
const compact = useIsCompact();
|
|
6663
|
+
const variant = props.variant ?? "standard";
|
|
6664
|
+
const scrollable = compact && variant === "standard";
|
|
6665
|
+
const arrowless = compact && variant === "scrollable" && !props.allowScrollButtonsMobile;
|
|
6666
|
+
const { rootRef, edges } = useScrollEdges(compact && variant !== "fullWidth");
|
|
6667
|
+
const forkedRef = utils.useForkRef(ref, rootRef);
|
|
6668
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6669
|
+
StyledTabs,
|
|
6670
|
+
{
|
|
6671
|
+
ref: forkedRef,
|
|
6672
|
+
...props,
|
|
6673
|
+
...scrollable && { variant: "scrollable", scrollButtons: false, centered: false },
|
|
6674
|
+
...arrowless && { scrollButtons: false },
|
|
6675
|
+
"data-fade-start": edges.start || void 0,
|
|
6676
|
+
"data-fade-end": edges.end || void 0
|
|
6677
|
+
}
|
|
6678
|
+
);
|
|
6679
|
+
});
|
|
6093
6680
|
ModTabs.displayName = "ModTabs";
|
|
6094
6681
|
const StyledTab = styles.styled(MuiTab)(({ theme }) => ({
|
|
6095
6682
|
minHeight: designSystemTokens.spacing.spacing_5,
|
|
6096
6683
|
padding: `${designSystemTokens.spacing.spacing_1}px ${designSystemTokens.spacing.spacing_2}px`,
|
|
6684
|
+
[theme.breakpoints.down("md")]: {
|
|
6685
|
+
minHeight: TOUCH_TARGET
|
|
6686
|
+
},
|
|
6097
6687
|
textTransform: "none",
|
|
6098
6688
|
fontWeight: designSystemTokens.typography.fontWeight.regular,
|
|
6099
6689
|
fontSize: theme.typography.pxToRem(14),
|
|
@@ -6229,6 +6819,10 @@ const StyledAlert = styles.styled(Alert, {
|
|
|
6229
6819
|
[`& .${Alert.alertClasses.action}`]: {
|
|
6230
6820
|
padding: 0,
|
|
6231
6821
|
marginRight: 0
|
|
6822
|
+
},
|
|
6823
|
+
// MUI's message scrolls (overflow: auto), which would clip the action buttons' hit areas.
|
|
6824
|
+
[theme.breakpoints.down("md")]: {
|
|
6825
|
+
[`& .${Alert.alertClasses.message}`]: { overflow: "visible" }
|
|
6232
6826
|
}
|
|
6233
6827
|
};
|
|
6234
6828
|
});
|
|
@@ -6264,7 +6858,8 @@ const ToastButton = styles.styled(Button, {
|
|
|
6264
6858
|
"&:hover": {
|
|
6265
6859
|
backgroundColor: "transparent",
|
|
6266
6860
|
textDecoration: "underline"
|
|
6267
|
-
}
|
|
6861
|
+
},
|
|
6862
|
+
...touchTarget(theme)
|
|
6268
6863
|
}));
|
|
6269
6864
|
const ModToast = ({
|
|
6270
6865
|
intent = "neutral",
|
|
@@ -6286,7 +6881,7 @@ const ModToast = ({
|
|
|
6286
6881
|
{
|
|
6287
6882
|
size: "small",
|
|
6288
6883
|
onClick: onClose,
|
|
6289
|
-
sx: { color: designSystemTokens.semanticColors.color.icon.utility },
|
|
6884
|
+
sx: (theme) => ({ color: designSystemTokens.semanticColors.color.icon.utility, ...touchTarget(theme) }),
|
|
6290
6885
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 16 })
|
|
6291
6886
|
}
|
|
6292
6887
|
) : void 0,
|
|
@@ -6410,6 +7005,9 @@ const StyledSwitch = styles.styled(Switch, {
|
|
|
6410
7005
|
color: designSystemTokens.semanticColors.input.bgDisabled
|
|
6411
7006
|
}
|
|
6412
7007
|
},
|
|
7008
|
+
[`& .${Switch.switchClasses.switchBase} .${Switch.switchClasses.input}`]: inputTouchTarget(theme, {
|
|
7009
|
+
heightOnly: true
|
|
7010
|
+
}),
|
|
6413
7011
|
// Thumb
|
|
6414
7012
|
[`& .${Switch.switchClasses.thumb}`]: {
|
|
6415
7013
|
width: config.thumbSize,
|
|
@@ -6472,7 +7070,12 @@ const StyledToggleButton$1 = styles.styled(MuiToggleButton, {
|
|
|
6472
7070
|
({ theme, toggleSize = "medium", toggleVariant = "default" }) => {
|
|
6473
7071
|
const segmented = toggleVariant === "segmented";
|
|
6474
7072
|
return {
|
|
7073
|
+
...touchTarget(theme),
|
|
6475
7074
|
height: sizeStyles[toggleSize].height,
|
|
7075
|
+
// Both sizes grow to a full touch row below md; the type size stays.
|
|
7076
|
+
[theme.breakpoints.down("md")]: {
|
|
7077
|
+
height: TOUCH_TARGET
|
|
7078
|
+
},
|
|
6476
7079
|
padding: `0 ${designSystemTokens.spacing.spacing_1_1_2}px`,
|
|
6477
7080
|
fontFamily: designSystemTokens.typography.fontFamily.body,
|
|
6478
7081
|
fontSize: theme.typography.pxToRem(sizeStyles[toggleSize].fontSize),
|
|
@@ -6518,7 +7121,7 @@ ModToggleButton.displayName = "ModToggleButton";
|
|
|
6518
7121
|
|
|
6519
7122
|
const StyledToggleButtonGroup$1 = styles.styled(MuiToggleButtonGroup, {
|
|
6520
7123
|
shouldForwardProp: (prop) => prop !== "groupVariant"
|
|
6521
|
-
})(({ groupVariant = "default" }) => {
|
|
7124
|
+
})(({ theme, groupVariant = "default" }) => {
|
|
6522
7125
|
const segmented = groupVariant === "segmented";
|
|
6523
7126
|
return {
|
|
6524
7127
|
display: "inline-flex",
|
|
@@ -6532,7 +7135,19 @@ const StyledToggleButtonGroup$1 = styles.styled(MuiToggleButtonGroup, {
|
|
|
6532
7135
|
} : {
|
|
6533
7136
|
borderRadius: designSystemTokens.borderRadius.button,
|
|
6534
7137
|
border: `1px solid ${designSystemTokens.semanticColors.color.border.primary}`,
|
|
6535
|
-
overflow: "hidden"
|
|
7138
|
+
overflow: "hidden",
|
|
7139
|
+
// The clip would cut the buttons' touch targets; round the end buttons to the inner (minus 1px border) radius.
|
|
7140
|
+
[theme.breakpoints.down("md")]: {
|
|
7141
|
+
overflow: "visible",
|
|
7142
|
+
[`& .${MuiToggleButton.toggleButtonClasses.root}:first-of-type`]: {
|
|
7143
|
+
borderTopLeftRadius: designSystemTokens.borderRadius.button - 1,
|
|
7144
|
+
borderBottomLeftRadius: designSystemTokens.borderRadius.button - 1
|
|
7145
|
+
},
|
|
7146
|
+
[`& .${MuiToggleButton.toggleButtonClasses.root}:last-of-type`]: {
|
|
7147
|
+
borderTopRightRadius: designSystemTokens.borderRadius.button - 1,
|
|
7148
|
+
borderBottomRightRadius: designSystemTokens.borderRadius.button - 1
|
|
7149
|
+
}
|
|
7150
|
+
}
|
|
6536
7151
|
},
|
|
6537
7152
|
// Default fuses the children (square inner corners, no gap); segmented
|
|
6538
7153
|
// keeps each button as its own rounded pill.
|
|
@@ -6571,10 +7186,26 @@ const StyledToolbar = styles.styled(xDataGrid.Toolbar)(({ theme }) => ({
|
|
|
6571
7186
|
// 16px
|
|
6572
7187
|
[theme.breakpoints.down("sm")]: {
|
|
6573
7188
|
flexWrap: "wrap"
|
|
7189
|
+
},
|
|
7190
|
+
// Controls are documented as grouped in Boxes; let those groups wrap too.
|
|
7191
|
+
[theme.breakpoints.down("md")]: {
|
|
7192
|
+
rowGap: designSystemTokens.spacing.spacing_1,
|
|
7193
|
+
"& > *": { flexWrap: "wrap" }
|
|
7194
|
+
},
|
|
7195
|
+
// On tablets a group can wrap beside others; they centre on its first line, not on its middle.
|
|
7196
|
+
// Every group is at least one control row tall (the QuickFilter's 44px) and bare controls centre
|
|
7197
|
+
// in it. Phones give the QuickFilter a row of its own, so groups there never share a line.
|
|
7198
|
+
[theme.breakpoints.between("sm", "md")]: {
|
|
7199
|
+
alignItems: "flex-start",
|
|
7200
|
+
"& > div": { minHeight: TOUCH_TARGET },
|
|
7201
|
+
"& > :not(div)": { alignSelf: "center" }
|
|
6574
7202
|
}
|
|
6575
7203
|
}));
|
|
6576
|
-
const ModToolbar = ({ children, ...props }) => {
|
|
6577
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
7204
|
+
const ModToolbar = ({ children, actions, ...props }) => {
|
|
7205
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(StyledToolbar, { ...props, children: [
|
|
7206
|
+
children,
|
|
7207
|
+
/* @__PURE__ */ jsxRuntime.jsx(OverflowActions, { actions })
|
|
7208
|
+
] });
|
|
6578
7209
|
};
|
|
6579
7210
|
ModToolbar.displayName = "ModToolbar";
|
|
6580
7211
|
|
|
@@ -6586,9 +7217,88 @@ const ModTreeItemLabel = (props) => {
|
|
|
6586
7217
|
(item?.statusIcon ?? item?.icon) && /* @__PURE__ */ jsxRuntime.jsx(ItemIcon, { children: item?.statusIcon ?? item?.icon }),
|
|
6587
7218
|
/* @__PURE__ */ jsxRuntime.jsx(ItemLabel, { children }),
|
|
6588
7219
|
item?.secondaryLabel && /* @__PURE__ */ jsxRuntime.jsx(ItemSecondaryLabel, { children: item.secondaryLabel }),
|
|
6589
|
-
item?.endAction && /* @__PURE__ */ jsxRuntime.jsx(ItemEndAction, { children: item.endAction })
|
|
7220
|
+
item?.endAction && /* @__PURE__ */ jsxRuntime.jsx(ItemEndAction, { children: item.endAction }),
|
|
7221
|
+
item?.endActions && item.endActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(ItemEndAction, { children: /* @__PURE__ */ jsxRuntime.jsx(TreeEndActions, { actions: item.endActions }) })
|
|
6590
7222
|
] });
|
|
6591
7223
|
};
|
|
7224
|
+
const stop = (event) => event.stopPropagation();
|
|
7225
|
+
const EndActionButton = styles.styled(ButtonBase)(({ theme }) => ({
|
|
7226
|
+
...touchTarget(theme),
|
|
7227
|
+
color: "inherit",
|
|
7228
|
+
"&:hover": {
|
|
7229
|
+
color: designSystemTokens.semanticColors.color.icon.default
|
|
7230
|
+
},
|
|
7231
|
+
[`&.${ButtonBase.buttonBaseClasses.focusVisible}`]: {
|
|
7232
|
+
outline: `2px solid ${designSystemTokens.semanticColors.color.border.focus}`
|
|
7233
|
+
}
|
|
7234
|
+
}));
|
|
7235
|
+
function TreeEndActions({ actions }) {
|
|
7236
|
+
const compact = useIsCompact();
|
|
7237
|
+
const [anchor, setAnchor] = react.useState(null);
|
|
7238
|
+
const menuId = react.useId();
|
|
7239
|
+
react.useEffect(() => {
|
|
7240
|
+
if (!compact) {
|
|
7241
|
+
setAnchor(null);
|
|
7242
|
+
}
|
|
7243
|
+
}, [compact]);
|
|
7244
|
+
if (!compact || actions.length === 1) {
|
|
7245
|
+
return actions.map((action) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7246
|
+
EndActionButton,
|
|
7247
|
+
{
|
|
7248
|
+
"aria-label": action.label,
|
|
7249
|
+
disabled: action.disabled,
|
|
7250
|
+
onKeyDown: stop,
|
|
7251
|
+
onClick: (event) => {
|
|
7252
|
+
stop(event);
|
|
7253
|
+
action.onClick();
|
|
7254
|
+
},
|
|
7255
|
+
children: action.icon
|
|
7256
|
+
},
|
|
7257
|
+
action.id
|
|
7258
|
+
));
|
|
7259
|
+
}
|
|
7260
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7261
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7262
|
+
EndActionButton,
|
|
7263
|
+
{
|
|
7264
|
+
"aria-label": "More actions",
|
|
7265
|
+
"aria-haspopup": "menu",
|
|
7266
|
+
"aria-expanded": anchor !== null,
|
|
7267
|
+
"aria-controls": anchor ? menuId : void 0,
|
|
7268
|
+
onKeyDown: stop,
|
|
7269
|
+
onClick: (event) => {
|
|
7270
|
+
stop(event);
|
|
7271
|
+
setAnchor(event.currentTarget);
|
|
7272
|
+
},
|
|
7273
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EllipsisVertical, {})
|
|
7274
|
+
}
|
|
7275
|
+
),
|
|
7276
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7277
|
+
ModMenu,
|
|
7278
|
+
{
|
|
7279
|
+
anchorEl: anchor,
|
|
7280
|
+
open: anchor !== null,
|
|
7281
|
+
onClose: () => setAnchor(null),
|
|
7282
|
+
onClick: stop,
|
|
7283
|
+
onKeyDown: stop,
|
|
7284
|
+
slotProps: { list: { id: menuId } },
|
|
7285
|
+
children: actions.map((action) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7286
|
+
ModMenuItem,
|
|
7287
|
+
{
|
|
7288
|
+
icon: action.icon,
|
|
7289
|
+
disabled: action.disabled,
|
|
7290
|
+
onClick: () => {
|
|
7291
|
+
setAnchor(null);
|
|
7292
|
+
action.onClick();
|
|
7293
|
+
},
|
|
7294
|
+
children: action.label
|
|
7295
|
+
},
|
|
7296
|
+
action.id
|
|
7297
|
+
))
|
|
7298
|
+
}
|
|
7299
|
+
)
|
|
7300
|
+
] });
|
|
7301
|
+
}
|
|
6592
7302
|
const ModTreeItem = react.forwardRef(function ModTreeItem2({ slots, slotProps, ...props }, ref) {
|
|
6593
7303
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6594
7304
|
TreeItem.TreeItem,
|
|
@@ -6666,9 +7376,12 @@ const ModTreeView = ({ slots, ...props }) => {
|
|
|
6666
7376
|
ModTreeView.displayName = "ModTreeView";
|
|
6667
7377
|
const CollapseIcon = () => /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { size: 16 });
|
|
6668
7378
|
const ExpandIcon = () => /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { size: 16 });
|
|
6669
|
-
const StyledTreeView = styles.styled(RichTreeViewPro.RichTreeViewPro)({
|
|
7379
|
+
const StyledTreeView = styles.styled(RichTreeViewPro.RichTreeViewPro)(({ theme }) => ({
|
|
6670
7380
|
[`& .${TreeItem.treeItemClasses.content}`]: {
|
|
6671
7381
|
height: 28,
|
|
7382
|
+
[theme.breakpoints.down("md")]: {
|
|
7383
|
+
height: TOUCH_TARGET
|
|
7384
|
+
},
|
|
6672
7385
|
gap: designSystemTokens.spacing.spacing_1_2,
|
|
6673
7386
|
paddingLeft: designSystemTokens.spacing.spacing_1,
|
|
6674
7387
|
paddingRight: designSystemTokens.spacing.spacing_1,
|
|
@@ -6707,7 +7420,7 @@ const StyledTreeView = styles.styled(RichTreeViewPro.RichTreeViewPro)({
|
|
|
6707
7420
|
borderLeft: `1px solid ${designSystemTokens.semanticColors.color.border.primary}`,
|
|
6708
7421
|
marginLeft: designSystemTokens.spacing.spacing_1_1_4
|
|
6709
7422
|
}
|
|
6710
|
-
});
|
|
7423
|
+
}));
|
|
6711
7424
|
|
|
6712
7425
|
const TOGGLE_BUTTON_BORDER_RADIUS = 14;
|
|
6713
7426
|
const StyledToggleButtonGroup = styles.styled(MuiToggleButtonGroup)(({ theme }) => ({
|
|
@@ -6726,11 +7439,22 @@ const StyledToggleButtonGroup = styles.styled(MuiToggleButtonGroup)(({ theme })
|
|
|
6726
7439
|
"&:not(:last-of-type)": {
|
|
6727
7440
|
borderRadius: TOGGLE_BUTTON_BORDER_RADIUS
|
|
6728
7441
|
}
|
|
7442
|
+
},
|
|
7443
|
+
// MUI outlines disabled toggles and its vertical grouping drops each later top edge, which reads
|
|
7444
|
+
// as clipped borders; disabled toggles stay borderless like enabled ones.
|
|
7445
|
+
[theme.breakpoints.down("md")]: {
|
|
7446
|
+
[`& .${MuiToggleButtonGroup.toggleButtonGroupClasses.grouped}.${MuiToggleButton.toggleButtonClasses.disabled}`]: {
|
|
7447
|
+
border: "none"
|
|
7448
|
+
}
|
|
6729
7449
|
}
|
|
6730
7450
|
}));
|
|
6731
7451
|
const StyledToggleButton = styles.styled(MuiToggleButton)(({ theme }) => ({
|
|
6732
7452
|
padding: theme.spacing(0.625),
|
|
6733
7453
|
minWidth: "auto",
|
|
7454
|
+
[theme.breakpoints.down("md")]: {
|
|
7455
|
+
minWidth: TOUCH_TARGET,
|
|
7456
|
+
minHeight: TOUCH_TARGET
|
|
7457
|
+
},
|
|
6734
7458
|
color: designSystemTokens.semanticColors.color.icon.default,
|
|
6735
7459
|
border: "none",
|
|
6736
7460
|
"& svg": {
|
|
@@ -6900,5 +7624,7 @@ exports.focusRingStyles = focusRingStyles;
|
|
|
6900
7624
|
exports.getDataGridHeaderStyles = getDataGridHeaderStyles;
|
|
6901
7625
|
exports.getDataGridRowStyles = getDataGridRowStyles;
|
|
6902
7626
|
exports.modRowHeights = modRowHeights;
|
|
7627
|
+
exports.touchTarget = touchTarget;
|
|
7628
|
+
exports.useIsCompact = useIsCompact;
|
|
6903
7629
|
exports.version = version;
|
|
6904
7630
|
//# sourceMappingURL=index.js.map
|