@moderneinc/design-system-components 7.7.0-next.f97145 → 8.0.0-alpha.c3d9f8
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 +20 -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/SideNav/SideNav.d.ts +9 -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 +53 -13
- package/dist/index.esm.js +898 -124
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +894 -119
- package/dist/index.js.map +1 -1
- package/dist/utils/OverflowActions.d.ts +14 -0
- package/dist/utils/formatCount.d.ts +3 -0
- package/dist/utils/responsive.d.ts +26 -0
- package/package.json +10 -10
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');
|
|
@@ -59,6 +60,7 @@ var Fab = require('@mui/material/Fab');
|
|
|
59
60
|
var Fade$1 = require('@mui/material/Fade');
|
|
60
61
|
var Radio = require('@mui/material/Radio');
|
|
61
62
|
var material = require('@mui/material');
|
|
63
|
+
var Drawer = require('@mui/material/Drawer');
|
|
62
64
|
var Skeleton = require('@mui/material/Skeleton');
|
|
63
65
|
var MuiTable = require('@mui/material/Table');
|
|
64
66
|
var TableBody = require('@mui/material/TableBody');
|
|
@@ -214,16 +216,24 @@ const ModGeneralAvatar = ({
|
|
|
214
216
|
};
|
|
215
217
|
ModGeneralAvatar.displayName = "ModGeneralAvatar";
|
|
216
218
|
|
|
217
|
-
const CellContentContainer = styles.styled("div")({
|
|
219
|
+
const CellContentContainer = styles.styled("div")(({ theme }) => ({
|
|
218
220
|
display: "flex",
|
|
219
221
|
alignItems: "center",
|
|
220
222
|
gap: designSystemTokens.spacing.spacing_2,
|
|
221
223
|
minWidth: 0,
|
|
222
224
|
// Allow flex item to shrink below content size
|
|
223
225
|
width: "100%",
|
|
224
|
-
overflow: "hidden"
|
|
226
|
+
overflow: "hidden",
|
|
225
227
|
// Prevent content from overflowing cell boundaries
|
|
226
|
-
|
|
228
|
+
// Still clips sideways, but lets controls' 44px hit areas reach into the row's height and,
|
|
229
|
+
// through a padding the margin cancels, past the content's edge into the cell's padding.
|
|
230
|
+
[theme.breakpoints.down("md")]: {
|
|
231
|
+
overflowX: "clip",
|
|
232
|
+
overflowY: "visible",
|
|
233
|
+
paddingInline: `${designSystemTokens.spacing.spacing_1}px`,
|
|
234
|
+
marginInline: `-${designSystemTokens.spacing.spacing_1}px`
|
|
235
|
+
}
|
|
236
|
+
}));
|
|
227
237
|
const ModDataGridCellContent = ({ children, ...props }) => {
|
|
228
238
|
return /* @__PURE__ */ jsxRuntime.jsx(CellContentContainer, { ...props, children });
|
|
229
239
|
};
|
|
@@ -379,6 +389,45 @@ const ModActivityIndicatorCell = ({
|
|
|
379
389
|
};
|
|
380
390
|
ModActivityIndicatorCell.displayName = "ModActivityIndicatorCell";
|
|
381
391
|
|
|
392
|
+
const TOUCH_TARGET = designSystemTokens.spacing.spacing_5_1_2;
|
|
393
|
+
const FILL_AVAILABLE = ["-moz-available", "-webkit-fill-available", "stretch"];
|
|
394
|
+
function useIsCompact() {
|
|
395
|
+
const theme = styles.useTheme();
|
|
396
|
+
return useMediaQuery(theme.breakpoints.down("md"));
|
|
397
|
+
}
|
|
398
|
+
function touchTarget(theme, { pseudo = "after" } = {}) {
|
|
399
|
+
return {
|
|
400
|
+
[`&::${pseudo}`]: {
|
|
401
|
+
[theme.breakpoints.down("md")]: {
|
|
402
|
+
content: '""',
|
|
403
|
+
position: "absolute",
|
|
404
|
+
top: "50%",
|
|
405
|
+
left: "50%",
|
|
406
|
+
transform: "translate(-50%, -50%)",
|
|
407
|
+
width: "100%",
|
|
408
|
+
height: "100%",
|
|
409
|
+
minWidth: TOUCH_TARGET,
|
|
410
|
+
minHeight: TOUCH_TARGET
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
function inputTouchTarget(theme, { heightOnly = false } = {}) {
|
|
416
|
+
return {
|
|
417
|
+
[theme.breakpoints.down("md")]: {
|
|
418
|
+
top: "50%",
|
|
419
|
+
height: "100%",
|
|
420
|
+
minHeight: TOUCH_TARGET,
|
|
421
|
+
...heightOnly ? { transform: "translateY(-50%)" } : {
|
|
422
|
+
left: "50%",
|
|
423
|
+
transform: "translate(-50%, -50%)",
|
|
424
|
+
width: "100%",
|
|
425
|
+
minWidth: TOUCH_TARGET
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
|
|
382
431
|
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
432
|
const intentColors$1 = {
|
|
384
433
|
success: designSystemTokens.semanticColors.color.status.success,
|
|
@@ -450,6 +499,17 @@ const StyledAlert$2 = styles.styled(Alert, {
|
|
|
450
499
|
color: designSystemTokens.semanticColors.color.text.tooltip,
|
|
451
500
|
[`& .${ButtonBase.buttonBaseClasses.root}`]: { color: "inherit" }
|
|
452
501
|
}
|
|
502
|
+
},
|
|
503
|
+
[theme.breakpoints.down("md")]: {
|
|
504
|
+
width: FILL_AVAILABLE,
|
|
505
|
+
// A wrapped default alert grows instead of scrolling inside its fixed 64px.
|
|
506
|
+
...!isCompact && !hasChildren && {
|
|
507
|
+
height: "auto",
|
|
508
|
+
minHeight: designSystemTokens.spacing.spacing_8 - designSystemTokens.spacing.spacing_1_1_2 * 2,
|
|
509
|
+
paddingTop: designSystemTokens.spacing.spacing_1_1_2,
|
|
510
|
+
paddingBottom: designSystemTokens.spacing.spacing_1_1_2
|
|
511
|
+
},
|
|
512
|
+
[`& .${Alert.alertClasses.message}`]: { overflowWrap: "anywhere" }
|
|
453
513
|
}
|
|
454
514
|
};
|
|
455
515
|
}
|
|
@@ -554,26 +614,51 @@ const StyledAlert$1 = styles.styled(Alert, {
|
|
|
554
614
|
}
|
|
555
615
|
};
|
|
556
616
|
});
|
|
557
|
-
const
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
617
|
+
const ResponsiveAlert = styles.styled(StyledAlert$1, {
|
|
618
|
+
shouldForwardProp: (prop) => prop !== "hasControls"
|
|
619
|
+
})(
|
|
620
|
+
({ theme, messagePosition = "left", hasControls = false }) => hasControls && {
|
|
621
|
+
[theme.breakpoints.down("md")]: {
|
|
622
|
+
minHeight: designSystemTokens.height.button.large,
|
|
623
|
+
...messagePosition === "center" && { justifyContent: "flex-start" },
|
|
624
|
+
[`& .${Alert.alertClasses.message}`]: {
|
|
625
|
+
// MUI's message scrolls (overflow: auto), which would clip the link's hit area.
|
|
626
|
+
overflow: "visible",
|
|
627
|
+
overflowWrap: "anywhere",
|
|
628
|
+
...messagePosition === "center" && { flex: 1, "& > svg": { flexShrink: 0 } }
|
|
629
|
+
},
|
|
630
|
+
[`& .${Alert.alertClasses.action}`]: {
|
|
631
|
+
paddingLeft: designSystemTokens.spacing.spacing_1_2,
|
|
632
|
+
...messagePosition === "center" && { position: "static" }
|
|
633
|
+
}
|
|
634
|
+
}
|
|
565
635
|
}
|
|
566
|
-
|
|
636
|
+
);
|
|
637
|
+
const LinkText = styles.styled("span")(
|
|
638
|
+
({ theme, bannerType = "outlined" }) => ({
|
|
639
|
+
marginLeft: "auto",
|
|
640
|
+
fontWeight: designSystemTokens.typography.fontWeight.semiBold,
|
|
641
|
+
color: bannerType === "filled" ? designSystemTokens.semanticColors.color.text.linkOnBrand : designSystemTokens.semanticColors.color.text.link,
|
|
642
|
+
cursor: "pointer",
|
|
643
|
+
whiteSpace: "nowrap",
|
|
644
|
+
"&:hover": {
|
|
645
|
+
textDecoration: "underline"
|
|
646
|
+
},
|
|
647
|
+
...touchTarget(theme),
|
|
648
|
+
[theme.breakpoints.down("md")]: { position: "relative" }
|
|
649
|
+
})
|
|
650
|
+
);
|
|
567
651
|
const StyledIconButton = styles.styled(IconButton, {
|
|
568
652
|
shouldForwardProp: (prop) => prop !== "closeIconColor"
|
|
569
|
-
})(({ closeIconColor }) => ({
|
|
653
|
+
})(({ theme, closeIconColor }) => ({
|
|
570
654
|
minWidth: 24,
|
|
571
655
|
minHeight: 24,
|
|
572
656
|
padding: 0,
|
|
573
657
|
color: closeIconColor,
|
|
574
658
|
"&:hover": {
|
|
575
659
|
backgroundColor: "transparent"
|
|
576
|
-
}
|
|
660
|
+
},
|
|
661
|
+
...touchTarget(theme)
|
|
577
662
|
}));
|
|
578
663
|
const ModBanner = ({
|
|
579
664
|
intent = "info",
|
|
@@ -597,12 +682,13 @@ const ModBanner = ({
|
|
|
597
682
|
}
|
|
598
683
|
const closeIconColor = type === "filled" ? designSystemTokens.semanticColors.color.surface.raised : intentColors[intent].solid;
|
|
599
684
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
600
|
-
|
|
685
|
+
ResponsiveAlert,
|
|
601
686
|
{
|
|
602
687
|
...props,
|
|
603
688
|
intent,
|
|
604
689
|
bannerType: type,
|
|
605
690
|
messagePosition,
|
|
691
|
+
hasControls: showClose || Boolean(linkText),
|
|
606
692
|
icon: messagePosition === "left" ? icon || false : false,
|
|
607
693
|
action: showClose ? /* @__PURE__ */ jsxRuntime.jsx(StyledIconButton, { size: "small", onClick: handleClose, closeIconColor, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 16 }) }) : void 0,
|
|
608
694
|
children: messagePosition === "center" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -618,18 +704,22 @@ const ModBanner = ({
|
|
|
618
704
|
};
|
|
619
705
|
ModBanner.displayName = "ModBanner";
|
|
620
706
|
|
|
621
|
-
const StyledBreadcrumbs = styles.styled(Breadcrumbs)(() => ({
|
|
707
|
+
const StyledBreadcrumbs = styles.styled(Breadcrumbs)(({ theme }) => ({
|
|
622
708
|
[`& .${Breadcrumbs.breadcrumbsClasses.separator}`]: {
|
|
623
709
|
margin: 0,
|
|
624
710
|
color: designSystemTokens.semanticColors.color.icon.utility
|
|
625
711
|
},
|
|
626
712
|
[`& .${Breadcrumbs.breadcrumbsClasses.ol}`]: {
|
|
627
|
-
gap: designSystemTokens.spacing.spacing_1
|
|
628
|
-
|
|
713
|
+
gap: designSystemTokens.spacing.spacing_1,
|
|
714
|
+
// An expanded trail that wraps keeps its lines' hit areas apart.
|
|
715
|
+
[theme.breakpoints.down("md")]: { rowGap: designSystemTokens.spacing.spacing_4 }
|
|
716
|
+
},
|
|
717
|
+
// The "…" that expands a collapsed trail.
|
|
718
|
+
[`& .${Breadcrumbs.breadcrumbsClasses.ol} > li > .${ButtonBase.buttonBaseClasses.root}`]: touchTarget(theme)
|
|
629
719
|
}));
|
|
630
720
|
const StyledBreadcrumbLink = styles.styled(Link, {
|
|
631
721
|
shouldForwardProp: (prop) => prop !== "current"
|
|
632
|
-
})(({ current = false }) => ({
|
|
722
|
+
})(({ theme, current = false }) => ({
|
|
633
723
|
fontSize: designSystemTokens.typography.fontSize.sm,
|
|
634
724
|
fontWeight: designSystemTokens.typography.fontWeight.medium,
|
|
635
725
|
lineHeight: 1,
|
|
@@ -644,7 +734,9 @@ const StyledBreadcrumbLink = styles.styled(Link, {
|
|
|
644
734
|
"&:focus-visible": {
|
|
645
735
|
outline: `2px solid ${designSystemTokens.semanticColors.color.border.focus}`,
|
|
646
736
|
outlineOffset: 2
|
|
647
|
-
}
|
|
737
|
+
},
|
|
738
|
+
...touchTarget(theme),
|
|
739
|
+
[theme.breakpoints.down("md")]: { position: "relative" }
|
|
648
740
|
}));
|
|
649
741
|
function ModBreadcrumbLink({
|
|
650
742
|
current = false,
|
|
@@ -665,14 +757,17 @@ function ModBreadcrumbLink({
|
|
|
665
757
|
);
|
|
666
758
|
}
|
|
667
759
|
function ModBreadcrumbs({ children, className }) {
|
|
760
|
+
const compact = useIsCompact();
|
|
668
761
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
669
762
|
StyledBreadcrumbs,
|
|
670
763
|
{
|
|
764
|
+
...compact && { maxItems: 2, itemsBeforeCollapse: 0, itemsAfterCollapse: 2 },
|
|
671
765
|
separator: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { size: 10.67, color: designSystemTokens.semanticColors.color.icon.utility }),
|
|
672
766
|
className,
|
|
673
767
|
"aria-label": "breadcrumb",
|
|
674
768
|
children
|
|
675
|
-
}
|
|
769
|
+
},
|
|
770
|
+
compact ? "compact" : "full"
|
|
676
771
|
);
|
|
677
772
|
}
|
|
678
773
|
|
|
@@ -711,6 +806,7 @@ const StyledButton = styles.styled(Button, {
|
|
|
711
806
|
position: "relative",
|
|
712
807
|
minWidth: "fit-content",
|
|
713
808
|
gap: designSystemTokens.spacing.spacing_1,
|
|
809
|
+
...touchTarget(theme),
|
|
714
810
|
// `gap` spaces the icons; MUI's slot margins would add to it
|
|
715
811
|
[`& .${Button.buttonClasses.startIcon}, & .${Button.buttonClasses.endIcon}`]: {
|
|
716
812
|
margin: 0
|
|
@@ -897,6 +993,7 @@ function ModButton({
|
|
|
897
993
|
ModButton.displayName = "ModButton";
|
|
898
994
|
|
|
899
995
|
const StyledButtonTab = styles.styled(MuiToggleButton)(({ theme }) => ({
|
|
996
|
+
...touchTarget(theme),
|
|
900
997
|
fontFamily: designSystemTokens.typography.fontFamily.body,
|
|
901
998
|
fontSize: theme.typography.pxToRem(designSystemTokens.typography.fontSize.sm),
|
|
902
999
|
lineHeight: 1,
|
|
@@ -965,8 +1062,11 @@ const StyledButtonTabGroup = styles.styled(MuiToggleButtonGroup)(({ theme, size
|
|
|
965
1062
|
borderRadius: designSystemTokens.borderRadius.button,
|
|
966
1063
|
border: `1px solid ${designSystemTokens.semanticColors.color.border.primary}`,
|
|
967
1064
|
overflow: "hidden",
|
|
1065
|
+
// The clip would cut the buttons' touch targets; round the end buttons to the inner (minus 1px border) radius.
|
|
1066
|
+
[theme.breakpoints.down("md")]: { overflow: "visible" },
|
|
968
1067
|
// Style all grouped children
|
|
969
1068
|
[`& .${MuiToggleButtonGroup.toggleButtonGroupClasses.grouped}`]: {
|
|
1069
|
+
...touchTarget(theme),
|
|
970
1070
|
flex: 1,
|
|
971
1071
|
minWidth: "auto",
|
|
972
1072
|
height: sizeStyles[size].height,
|
|
@@ -1002,12 +1102,20 @@ const StyledButtonTabGroup = styles.styled(MuiToggleButtonGroup)(({ theme, size
|
|
|
1002
1102
|
// First button: rounded left edge
|
|
1003
1103
|
[`&.${MuiToggleButtonGroup.toggleButtonGroupClasses.firstButton}`]: {
|
|
1004
1104
|
borderTopLeftRadius: designSystemTokens.borderRadius.button,
|
|
1005
|
-
borderBottomLeftRadius: designSystemTokens.borderRadius.button
|
|
1105
|
+
borderBottomLeftRadius: designSystemTokens.borderRadius.button,
|
|
1106
|
+
[theme.breakpoints.down("md")]: {
|
|
1107
|
+
borderTopLeftRadius: designSystemTokens.borderRadius.button - 1,
|
|
1108
|
+
borderBottomLeftRadius: designSystemTokens.borderRadius.button - 1
|
|
1109
|
+
}
|
|
1006
1110
|
},
|
|
1007
1111
|
// Last button: rounded right edge, no right border
|
|
1008
1112
|
[`&.${MuiToggleButtonGroup.toggleButtonGroupClasses.lastButton}`]: {
|
|
1009
1113
|
borderTopRightRadius: designSystemTokens.borderRadius.button,
|
|
1010
1114
|
borderBottomRightRadius: designSystemTokens.borderRadius.button,
|
|
1115
|
+
[theme.breakpoints.down("md")]: {
|
|
1116
|
+
borderTopRightRadius: designSystemTokens.borderRadius.button - 1,
|
|
1117
|
+
borderBottomRightRadius: designSystemTokens.borderRadius.button - 1
|
|
1118
|
+
},
|
|
1011
1119
|
borderRight: "none"
|
|
1012
1120
|
},
|
|
1013
1121
|
// Disabled state
|
|
@@ -1129,7 +1237,7 @@ const SmallDescription = styles.styled("p")(({ theme }) => ({
|
|
|
1129
1237
|
}));
|
|
1130
1238
|
const LargeStyledCard = styles.styled(MuiCard, {
|
|
1131
1239
|
shouldForwardProp: (prop) => prop !== "disabled" && prop !== "cardTheme"
|
|
1132
|
-
})(({ disabled = false, cardTheme = "light" }) => {
|
|
1240
|
+
})(({ theme, disabled = false, cardTheme = "light" }) => {
|
|
1133
1241
|
const isLight = cardTheme === "light";
|
|
1134
1242
|
const activeBorderColor = isLight ? designSystemTokens.semanticColors.button.primary.bg : designSystemTokens.colors.digitalGreen[300];
|
|
1135
1243
|
const defaultBorderColor = isLight ? designSystemTokens.semanticColors.color.border.primary : designSystemTokens.semanticColorsDark.color.border.primary;
|
|
@@ -1164,6 +1272,12 @@ const LargeStyledCard = styles.styled(MuiCard, {
|
|
|
1164
1272
|
opacity: 0.5,
|
|
1165
1273
|
pointerEvents: "none",
|
|
1166
1274
|
cursor: "not-allowed"
|
|
1275
|
+
},
|
|
1276
|
+
[theme.breakpoints.down("md")]: {
|
|
1277
|
+
maxWidth: FILL_AVAILABLE,
|
|
1278
|
+
// Grows instead of clipping when the narrower card wraps its description or actions.
|
|
1279
|
+
height: "auto",
|
|
1280
|
+
minHeight: 162
|
|
1167
1281
|
}
|
|
1168
1282
|
};
|
|
1169
1283
|
});
|
|
@@ -1212,12 +1326,17 @@ const LargeDescription = styles.styled("p", {
|
|
|
1212
1326
|
minWidth: "100%",
|
|
1213
1327
|
wordWrap: "break-word"
|
|
1214
1328
|
}));
|
|
1215
|
-
const LargeButtonsRow = styles.styled("div")({
|
|
1329
|
+
const LargeButtonsRow = styles.styled("div")(({ theme }) => ({
|
|
1216
1330
|
display: "flex",
|
|
1217
1331
|
gap: designSystemTokens.spacing.spacing_3,
|
|
1218
1332
|
alignItems: "flex-start",
|
|
1219
|
-
flexShrink: 0
|
|
1220
|
-
|
|
1333
|
+
flexShrink: 0,
|
|
1334
|
+
[theme.breakpoints.down("md")]: {
|
|
1335
|
+
flexWrap: "wrap",
|
|
1336
|
+
// 32px small buttons + 12px = a 44px pitch, so wrapped rows' hit areas meet without overlapping.
|
|
1337
|
+
rowGap: designSystemTokens.spacing.spacing_1_1_2
|
|
1338
|
+
}
|
|
1339
|
+
}));
|
|
1221
1340
|
const SmallCardImpl = ({
|
|
1222
1341
|
logo,
|
|
1223
1342
|
recipeCount,
|
|
@@ -1330,7 +1449,7 @@ const HelperText$2 = styles.styled("span")(({ theme, size = "medium" }) => ({
|
|
|
1330
1449
|
const XS_FOCUS_RING_RADIUS = 1;
|
|
1331
1450
|
const StyledCheckbox = styles.styled(Checkbox, {
|
|
1332
1451
|
shouldForwardProp: (prop) => prop !== "size"
|
|
1333
|
-
})(({ size = "medium" }) => {
|
|
1452
|
+
})(({ theme, size = "medium" }) => {
|
|
1334
1453
|
const sizeConfig = {
|
|
1335
1454
|
xs: {
|
|
1336
1455
|
size: 12,
|
|
@@ -1391,7 +1510,8 @@ const StyledCheckbox = styles.styled(Checkbox, {
|
|
|
1391
1510
|
"& svg": {
|
|
1392
1511
|
width: config.size,
|
|
1393
1512
|
height: config.size
|
|
1394
|
-
}
|
|
1513
|
+
},
|
|
1514
|
+
"& input": inputTouchTarget(theme)
|
|
1395
1515
|
};
|
|
1396
1516
|
});
|
|
1397
1517
|
const ModCheckbox = ({
|
|
@@ -1449,6 +1569,18 @@ const ModCheckboxWithText = ({ size = "small", ...props }) => {
|
|
|
1449
1569
|
};
|
|
1450
1570
|
ModCheckboxWithText.displayName = "ModCheckboxWithText";
|
|
1451
1571
|
|
|
1572
|
+
const compactStyles = (theme, size, isMultiline) => {
|
|
1573
|
+
if (isMultiline) {
|
|
1574
|
+
return {
|
|
1575
|
+
[theme.breakpoints.down("md")]: {
|
|
1576
|
+
minWidth: 0,
|
|
1577
|
+
whiteSpace: "pre-wrap",
|
|
1578
|
+
overflowWrap: "anywhere"
|
|
1579
|
+
}
|
|
1580
|
+
};
|
|
1581
|
+
}
|
|
1582
|
+
return size === "inline" ? {} : touchTarget(theme);
|
|
1583
|
+
};
|
|
1452
1584
|
const StyledButtonBase = styles.styled(ButtonBase, {
|
|
1453
1585
|
shouldForwardProp: (prop) => prop !== "isMultiline" && prop !== "variant" && prop !== "size"
|
|
1454
1586
|
})(({ theme, variant = "outlined", size = "small", isMultiline = false }) => {
|
|
@@ -1534,7 +1666,8 @@ const StyledButtonBase = styles.styled(ButtonBase, {
|
|
|
1534
1666
|
};
|
|
1535
1667
|
return {
|
|
1536
1668
|
...baseStyles,
|
|
1537
|
-
...variantStyles[variant]
|
|
1669
|
+
...variantStyles[variant],
|
|
1670
|
+
...compactStyles(theme, size, isMultiline)
|
|
1538
1671
|
};
|
|
1539
1672
|
});
|
|
1540
1673
|
const IconWrapper$2 = styles.styled("span")(({ isMultiline }) => ({
|
|
@@ -1874,6 +2007,9 @@ const StyledMenuItem = styles.styled(MenuItem)(({ theme }) => ({
|
|
|
1874
2007
|
paddingLeft: designSystemTokens.spacing.spacing_2,
|
|
1875
2008
|
paddingRight: designSystemTokens.spacing.spacing_2,
|
|
1876
2009
|
minHeight: designSystemTokens.spacing.spacing_5,
|
|
2010
|
+
[theme.breakpoints.down("md")]: {
|
|
2011
|
+
minHeight: TOUCH_TARGET
|
|
2012
|
+
},
|
|
1877
2013
|
gap: designSystemTokens.spacing.spacing_2,
|
|
1878
2014
|
borderRadius: 0,
|
|
1879
2015
|
color: designSystemTokens.semanticColors.color.icon.default,
|
|
@@ -1980,7 +2116,7 @@ const ChevronDownIcon = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
1980
2116
|
style: { ...props.style }
|
|
1981
2117
|
}
|
|
1982
2118
|
);
|
|
1983
|
-
const StyledSelect = styles.styled(MuiSelect)({
|
|
2119
|
+
const StyledSelect = styles.styled(MuiSelect)(({ theme }) => ({
|
|
1984
2120
|
minHeight: designSystemTokens.spacing.spacing_5,
|
|
1985
2121
|
backgroundColor: designSystemTokens.semanticColors.input.bg,
|
|
1986
2122
|
border: `1px solid ${designSystemTokens.semanticColors.color.border.primary}`,
|
|
@@ -2008,10 +2144,18 @@ const StyledSelect = styles.styled(MuiSelect)({
|
|
|
2008
2144
|
fontWeight: designSystemTokens.typography.fontWeight.regular,
|
|
2009
2145
|
color: designSystemTokens.semanticColors.color.text.input
|
|
2010
2146
|
},
|
|
2147
|
+
// Doubled `&` outranks MUI's own `.MuiSelect-select` rules, which are inserted after these.
|
|
2148
|
+
[`&& .${MuiSelect.selectClasses.select}`]: {
|
|
2149
|
+
[theme.breakpoints.down("md")]: {
|
|
2150
|
+
lineHeight: `${TOUCH_TARGET - 2 * designSystemTokens.spacing.spacing_1_2}px`,
|
|
2151
|
+
// Covers the root's 1px border, so all 44px of the control hit-test as the combobox.
|
|
2152
|
+
marginBlock: -1
|
|
2153
|
+
}
|
|
2154
|
+
},
|
|
2011
2155
|
[`& .${MuiSelect.selectClasses.icon}`]: {
|
|
2012
2156
|
right: designSystemTokens.spacing.spacing_1_1_2
|
|
2013
2157
|
}
|
|
2014
|
-
});
|
|
2158
|
+
}));
|
|
2015
2159
|
const ModSelect = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2016
2160
|
StyledSelect,
|
|
2017
2161
|
{
|
|
@@ -2045,7 +2189,7 @@ const ModDataGridFilterPanelDeleteIcon = () => /* @__PURE__ */ jsxRuntime.jsx(lu
|
|
|
2045
2189
|
ModDataGridFilterPanelDeleteIcon.displayName = "ModDataGridFilterPanelDeleteIcon";
|
|
2046
2190
|
const ModDataGridFilterPanelRemoveAllIcon = () => /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { size: designSystemTokens.spacing.spacing_2, color: designSystemTokens.semanticColors.button.tertiary.fg });
|
|
2047
2191
|
ModDataGridFilterPanelRemoveAllIcon.displayName = "ModDataGridFilterPanelRemoveAllIcon";
|
|
2048
|
-
const StyledGridFilterPanel = styles.styled(xDataGrid.GridFilterPanel)({
|
|
2192
|
+
const StyledGridFilterPanel = styles.styled(xDataGrid.GridFilterPanel)(({ theme }) => ({
|
|
2049
2193
|
...panelSurfaceStyles,
|
|
2050
2194
|
// Panel padding (12px top, 16px right/bottom/left)
|
|
2051
2195
|
paddingTop: designSystemTokens.spacing.spacing_2,
|
|
@@ -2169,6 +2313,7 @@ const StyledGridFilterPanel = styles.styled(xDataGrid.GridFilterPanel)({
|
|
|
2169
2313
|
// Buttons - design system styling
|
|
2170
2314
|
// Add filter button (first button)
|
|
2171
2315
|
[`& .${xDataGrid.gridClasses.panelFooter} .${Button.buttonClasses.root}:first-child`]: {
|
|
2316
|
+
...touchTarget(theme),
|
|
2172
2317
|
textTransform: "none",
|
|
2173
2318
|
fontSize: designSystemTokens.typography.fontSize.sm,
|
|
2174
2319
|
fontWeight: designSystemTokens.typography.fontWeight.medium,
|
|
@@ -2191,6 +2336,7 @@ const StyledGridFilterPanel = styles.styled(xDataGrid.GridFilterPanel)({
|
|
|
2191
2336
|
},
|
|
2192
2337
|
// Clear all button (second button) - styled to match ModButton link variant
|
|
2193
2338
|
[`& .${xDataGrid.gridClasses.panelFooter} .${Button.buttonClasses.root}:nth-child(2)`]: {
|
|
2339
|
+
...touchTarget(theme),
|
|
2194
2340
|
height: 32,
|
|
2195
2341
|
// ModButton small size
|
|
2196
2342
|
padding: `0 ${designSystemTokens.spacing.spacing_1}px`,
|
|
@@ -2220,8 +2366,41 @@ const StyledGridFilterPanel = styles.styled(xDataGrid.GridFilterPanel)({
|
|
|
2220
2366
|
},
|
|
2221
2367
|
[`& .${xDataGrid.gridClasses.filterForm} .${IconButton.iconButtonClasses.root}:hover`]: {
|
|
2222
2368
|
backgroundColor: designSystemTokens.semanticColors.input.bgHover
|
|
2369
|
+
},
|
|
2370
|
+
// In the sheet the fields share its full width; MUI X fixes each input at 150–220px.
|
|
2371
|
+
[theme.breakpoints.down("md")]: {
|
|
2372
|
+
[`& .${xDataGrid.gridClasses.filterForm}`]: {
|
|
2373
|
+
width: "100%"
|
|
2374
|
+
},
|
|
2375
|
+
[`& .MuiFormControl-root:has(.${xDataGrid.gridClasses.filterFormColumnInput}), & .MuiFormControl-root:has(.${xDataGrid.gridClasses.filterFormOperatorInput}), & .${xDataGrid.gridClasses.filterFormValueInput}`]: {
|
|
2376
|
+
flex: "1 1 0",
|
|
2377
|
+
minWidth: 0
|
|
2378
|
+
},
|
|
2379
|
+
[`& .${xDataGrid.gridClasses.filterForm} .${InputBase.inputBaseClasses.root}, & .${xDataGrid.gridClasses.filterFormValueInput} .MuiFormControl-root`]: {
|
|
2380
|
+
width: "100%"
|
|
2381
|
+
}
|
|
2382
|
+
},
|
|
2383
|
+
// On phones each filter opens with a row holding its And/Or select and its remove X, then column,
|
|
2384
|
+
// operator and value each take a full row.
|
|
2385
|
+
[theme.breakpoints.down("sm")]: {
|
|
2386
|
+
[`& .${xDataGrid.gridClasses.filterForm}`]: {
|
|
2387
|
+
flexWrap: "wrap",
|
|
2388
|
+
rowGap: designSystemTokens.spacing.spacing_1_1_2
|
|
2389
|
+
},
|
|
2390
|
+
[`& .MuiFormControl-root:has(.${xDataGrid.gridClasses.filterFormLogicOperatorInput})`]: {
|
|
2391
|
+
order: -1
|
|
2392
|
+
},
|
|
2393
|
+
[`& .${xDataGrid.gridClasses.filterFormDeleteIcon}`]: {
|
|
2394
|
+
marginLeft: "auto",
|
|
2395
|
+
marginRight: 0
|
|
2396
|
+
},
|
|
2397
|
+
[`& .MuiFormControl-root:has(.${xDataGrid.gridClasses.filterFormColumnInput}), & .MuiFormControl-root:has(.${xDataGrid.gridClasses.filterFormOperatorInput}), & .${xDataGrid.gridClasses.filterFormValueInput}`]: {
|
|
2398
|
+
flex: "1 1 100%",
|
|
2399
|
+
width: "100%",
|
|
2400
|
+
marginLeft: 0
|
|
2401
|
+
}
|
|
2223
2402
|
}
|
|
2224
|
-
});
|
|
2403
|
+
}));
|
|
2225
2404
|
StyledGridFilterPanel.displayName = "StyledGridFilterPanel";
|
|
2226
2405
|
const ModDataGridSelect = react.forwardRef(function ModDataGridSelect2({
|
|
2227
2406
|
id,
|
|
@@ -2290,11 +2469,38 @@ function UnsortedIcon() {
|
|
|
2290
2469
|
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsUpDown, { size: 16, color: designSystemTokens.semanticColors.color.icon.utility });
|
|
2291
2470
|
}
|
|
2292
2471
|
|
|
2293
|
-
const
|
|
2472
|
+
const COMPACT_MIN_COLUMN_WIDTH = 120;
|
|
2473
|
+
const ModGridPanel = styles.styled(xDataGrid.GridPanel)(({ theme }) => ({
|
|
2294
2474
|
[`& .${xDataGrid.gridPanelClasses.paper}`]: {
|
|
2295
2475
|
backgroundColor: designSystemTokens.semanticColors.color.surface.raised
|
|
2476
|
+
},
|
|
2477
|
+
// Below md the panel is a bottom sheet; Popper writes inset/transform inline, hence !important.
|
|
2478
|
+
[theme.breakpoints.down("md")]: {
|
|
2479
|
+
position: "fixed !important",
|
|
2480
|
+
inset: "auto 0 0 0 !important",
|
|
2481
|
+
transform: "none !important",
|
|
2482
|
+
[`& .${xDataGrid.gridPanelClasses.paper}`]: {
|
|
2483
|
+
width: "100%",
|
|
2484
|
+
maxWidth: "100%",
|
|
2485
|
+
maxHeight: "80vh",
|
|
2486
|
+
flexDirection: "column",
|
|
2487
|
+
overflowY: "auto",
|
|
2488
|
+
borderRadius: `${designSystemTokens.borderRadius.m}px ${designSystemTokens.borderRadius.m}px 0 0`,
|
|
2489
|
+
// The drawer shadow, flipped to cast upward from the bottom edge.
|
|
2490
|
+
boxShadow: `0 -${designSystemTokens.shadows.drawer.y}px ${designSystemTokens.shadows.drawer.blur}px ${designSystemTokens.shadows.drawer.spread}px ${designSystemTokens.shadows.drawer.shadow}`,
|
|
2491
|
+
"&::before": {
|
|
2492
|
+
content: '""',
|
|
2493
|
+
display: "block",
|
|
2494
|
+
flexShrink: 0,
|
|
2495
|
+
width: designSystemTokens.spacing.spacing_4,
|
|
2496
|
+
height: designSystemTokens.spacing.spacing_1_2,
|
|
2497
|
+
margin: `${designSystemTokens.spacing.spacing_1}px auto 0`,
|
|
2498
|
+
borderRadius: designSystemTokens.borderRadius.full,
|
|
2499
|
+
backgroundColor: designSystemTokens.semanticColors.color.border.strong
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2296
2502
|
}
|
|
2297
|
-
});
|
|
2503
|
+
}));
|
|
2298
2504
|
const DataGridCheckbox = ({
|
|
2299
2505
|
slotProps,
|
|
2300
2506
|
...props
|
|
@@ -2311,10 +2517,33 @@ function ModDataGrid({
|
|
|
2311
2517
|
toolbar,
|
|
2312
2518
|
slots,
|
|
2313
2519
|
sx,
|
|
2314
|
-
density
|
|
2520
|
+
density: densityProp,
|
|
2315
2521
|
slotProps: userSlotProps,
|
|
2522
|
+
columns: columnsProp,
|
|
2316
2523
|
...props
|
|
2317
2524
|
}) {
|
|
2525
|
+
const theme = styles.useTheme();
|
|
2526
|
+
const compact = useIsCompact();
|
|
2527
|
+
const density = densityProp ?? (compact ? "comfortable" : "standard");
|
|
2528
|
+
const columns = react.useMemo(
|
|
2529
|
+
() => compact ? columnsProp.map((column) => {
|
|
2530
|
+
const hasMenu = !(props.disableColumnMenu || column.disableColumnMenu);
|
|
2531
|
+
const hasSort = !props.disableColumnSorting && column.sortable !== false;
|
|
2532
|
+
if (column.type === "actions" || !(hasMenu || hasSort)) {
|
|
2533
|
+
return column;
|
|
2534
|
+
}
|
|
2535
|
+
const min = Math.min(
|
|
2536
|
+
COMPACT_MIN_COLUMN_WIDTH,
|
|
2537
|
+
column.maxWidth ?? Number.POSITIVE_INFINITY
|
|
2538
|
+
);
|
|
2539
|
+
return {
|
|
2540
|
+
...column,
|
|
2541
|
+
minWidth: Math.max(column.minWidth ?? 0, min),
|
|
2542
|
+
...column.width !== void 0 && { width: Math.max(column.width, min) }
|
|
2543
|
+
};
|
|
2544
|
+
}) : columnsProp,
|
|
2545
|
+
[compact, columnsProp, props.disableColumnMenu, props.disableColumnSorting]
|
|
2546
|
+
);
|
|
2318
2547
|
const defaultApiRef = xDataGridPro.useGridApiRef();
|
|
2319
2548
|
const apiRef = props?.apiRef ? props.apiRef : defaultApiRef;
|
|
2320
2549
|
const mergedSlots = {
|
|
@@ -2332,6 +2561,9 @@ function ModDataGrid({
|
|
|
2332
2561
|
// Add toolbar slot if toolbar prop is provided (overrides slots.toolbar if both exist)
|
|
2333
2562
|
...toolbar ? { toolbar: () => toolbar } : {}
|
|
2334
2563
|
};
|
|
2564
|
+
const compactQuery = theme.breakpoints.down("md");
|
|
2565
|
+
const plainSx = sx && typeof sx === "object" && !Array.isArray(sx);
|
|
2566
|
+
const { [compactQuery]: consumerCompact, ...restSx } = plainSx ? sx : {};
|
|
2335
2567
|
const baseSx = {
|
|
2336
2568
|
// Fix for MUI X 8.15.0+ scroll shadow issue - backgroundColor must be on main, not root
|
|
2337
2569
|
// See: https://github.com/mui/mui-x/issues/20107
|
|
@@ -2356,6 +2588,57 @@ function ModDataGrid({
|
|
|
2356
2588
|
backgroundColor: designSystemTokens.semanticColors.color.surface.dataGrid.default
|
|
2357
2589
|
},
|
|
2358
2590
|
...getDataGridHeaderStyles({ resizable: !props.disableColumnResize }),
|
|
2591
|
+
[`& .${xDataGrid.gridClasses.menuIconButton}`]: touchTarget(theme),
|
|
2592
|
+
// On touch the filter icon is an indicator too and filters open from the column menu; a mouse in a
|
|
2593
|
+
// narrow window keeps clicking it. MUI gives the filter button no class of its own.
|
|
2594
|
+
[`${theme.breakpoints.down("md")} and (pointer: coarse)`]: {
|
|
2595
|
+
[`& button:has(> .${xDataGrid.gridClasses.filterIcon})`]: { pointerEvents: "none" }
|
|
2596
|
+
},
|
|
2597
|
+
[compactQuery]: {
|
|
2598
|
+
maxWidth: "100%",
|
|
2599
|
+
// A tap on the header sorts; the sort icon only shows the direction, leaving the room to the column menu.
|
|
2600
|
+
[`& .${xDataGrid.gridClasses.sortButton}`]: {
|
|
2601
|
+
pointerEvents: "none"
|
|
2602
|
+
},
|
|
2603
|
+
// The header is tall enough below md for the select-all checkbox's hit area; stop clipping it.
|
|
2604
|
+
[`& .${xDataGrid.gridClasses.columnHeaderCheckbox} .${xDataGrid.gridClasses.columnHeaderTitleContainerContent}`]: {
|
|
2605
|
+
overflow: "visible"
|
|
2606
|
+
},
|
|
2607
|
+
// The checkbox column doesn't resize, so its separator is decoration; let taps pass through.
|
|
2608
|
+
[`& .${xDataGrid.gridClasses.columnHeaderCheckbox} .${xDataGrid.gridClasses.columnSeparator}`]: {
|
|
2609
|
+
pointerEvents: "none"
|
|
2610
|
+
},
|
|
2611
|
+
// Narrow columns keep room for their label: a tighter gutter on the title's side (cells below
|
|
2612
|
+
// match), while the menu side keeps its gutter so the menu's hit area clears the separator; a
|
|
2613
|
+
// header without a menu matches its cells on both sides. `:where` keeps this at the gutter rule's
|
|
2614
|
+
// specificity, so a consumer's own padding for that column still wins.
|
|
2615
|
+
// The sort slot takes no width while its icon is hidden, as in MUI's own default.
|
|
2616
|
+
[`& .${xDataGrid.gridClasses.columnHeader}:not(.${xDataGrid.gridClasses.columnHeaderCheckbox})`]: {
|
|
2617
|
+
paddingLeft: `${designSystemTokens.spacing.spacing_2}px`
|
|
2618
|
+
},
|
|
2619
|
+
[`& .${xDataGrid.gridClasses.columnHeader}:not(.${xDataGrid.gridClasses.columnHeaderCheckbox}):where(:not(:has(.${xDataGrid.gridClasses.menuIcon})))`]: {
|
|
2620
|
+
paddingRight: `${designSystemTokens.spacing.spacing_2}px`
|
|
2621
|
+
},
|
|
2622
|
+
[`& .${xDataGrid.gridClasses.columnHeader}.${xDataGrid.gridClasses["columnHeader--alignRight"]}`]: {
|
|
2623
|
+
paddingLeft: `${designSystemTokens.spacing.spacing_3}px`,
|
|
2624
|
+
paddingRight: `${designSystemTokens.spacing.spacing_2}px`
|
|
2625
|
+
},
|
|
2626
|
+
[`& .${xDataGrid.gridClasses.columnHeader}:not(.${xDataGrid.gridClasses["columnHeader--sorted"]}):not(:hover) .${xDataGrid.gridClasses.iconButtonContainer}:has(.${xDataGrid.gridClasses.sortButton})`]: {
|
|
2627
|
+
width: 0,
|
|
2628
|
+
marginLeft: 0
|
|
2629
|
+
},
|
|
2630
|
+
// Carry the header band across the filler past the last column, over the body-coloured filler rule.
|
|
2631
|
+
[`&& .${xDataGrid.gridClasses.columnHeaders} .${xDataGrid.gridClasses.filler}, && .${xDataGrid.gridClasses.columnHeaders} .${xDataGrid.gridClasses.scrollbarFiller}`]: {
|
|
2632
|
+
backgroundColor: designSystemTokens.semanticColors.color.surface.dataGrid.header,
|
|
2633
|
+
borderBottomColor: designSystemTokens.semanticColors.color.border.primary
|
|
2634
|
+
},
|
|
2635
|
+
// Two classes so this outranks the base cell padding declared further down.
|
|
2636
|
+
[`& .${xDataGrid.gridClasses.row} .${xDataGrid.gridClasses.cell}`]: {
|
|
2637
|
+
paddingLeft: `${designSystemTokens.spacing.spacing_2}px`,
|
|
2638
|
+
paddingRight: `${designSystemTokens.spacing.spacing_2}px`
|
|
2639
|
+
},
|
|
2640
|
+
...typeof consumerCompact === "function" ? consumerCompact(theme) : consumerCompact
|
|
2641
|
+
},
|
|
2359
2642
|
...getDataGridRowStyles(),
|
|
2360
2643
|
border: `1px solid ${designSystemTokens.semanticColors.color.border.primary}`,
|
|
2361
2644
|
// Target `& svg` (not `.MuiSvgIcon-root`) to match the lucide icons
|
|
@@ -2386,13 +2669,14 @@ function ModDataGrid({
|
|
|
2386
2669
|
wordBreak: "break-word",
|
|
2387
2670
|
hyphens: "auto"
|
|
2388
2671
|
},
|
|
2389
|
-
...sx
|
|
2672
|
+
...plainSx ? restSx : sx
|
|
2390
2673
|
};
|
|
2391
2674
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2392
2675
|
xDataGridPro.DataGridPro,
|
|
2393
2676
|
{
|
|
2394
2677
|
apiRef,
|
|
2395
|
-
|
|
2678
|
+
columns,
|
|
2679
|
+
columnHeaderHeight: compact ? designSystemTokens.height.button.large : designSystemTokens.height.table.header,
|
|
2396
2680
|
autoHeight,
|
|
2397
2681
|
autoPageSize: !autoHeight,
|
|
2398
2682
|
getRowHeight: () => "auto",
|
|
@@ -2666,6 +2950,7 @@ const StyledNavButton = styles.styled(IconButton, {
|
|
|
2666
2950
|
color: designSystemTokens.semanticColors.button.primary.bgPressed
|
|
2667
2951
|
};
|
|
2668
2952
|
return {
|
|
2953
|
+
...touchTarget(theme),
|
|
2669
2954
|
width: sizeStyles.width,
|
|
2670
2955
|
height: sizeStyles.height,
|
|
2671
2956
|
padding: sizeStyles.padding,
|
|
@@ -2911,10 +3196,12 @@ const ModDatePicker = ({
|
|
|
2911
3196
|
size: "small"
|
|
2912
3197
|
},
|
|
2913
3198
|
openPickerButton: {
|
|
2914
|
-
size: "small"
|
|
3199
|
+
size: "small",
|
|
3200
|
+
sx: (theme) => touchTarget(theme)
|
|
2915
3201
|
},
|
|
2916
3202
|
clearButton: {
|
|
2917
|
-
size: "small"
|
|
3203
|
+
size: "small",
|
|
3204
|
+
sx: (theme) => touchTarget(theme)
|
|
2918
3205
|
}
|
|
2919
3206
|
};
|
|
2920
3207
|
if (type === "range") {
|
|
@@ -3090,15 +3377,16 @@ const StyledLinearProgress$1 = styles.styled(LinearProgress)({
|
|
|
3090
3377
|
borderRadius: `${designSystemTokens.borderRadius.xS}px 0 0 ${designSystemTokens.borderRadius.xS}px`
|
|
3091
3378
|
}
|
|
3092
3379
|
});
|
|
3093
|
-
const ActionButton = styles.styled(IconButton)({
|
|
3380
|
+
const ActionButton = styles.styled(IconButton)(({ theme }) => ({
|
|
3094
3381
|
padding: 0,
|
|
3095
3382
|
width: designSystemTokens.spacing.spacing_2,
|
|
3096
3383
|
height: designSystemTokens.spacing.spacing_2,
|
|
3097
3384
|
color: designSystemTokens.semanticColors.color.icon.utility,
|
|
3098
3385
|
"&:hover": {
|
|
3099
3386
|
backgroundColor: "transparent"
|
|
3100
|
-
}
|
|
3101
|
-
|
|
3387
|
+
},
|
|
3388
|
+
...touchTarget(theme)
|
|
3389
|
+
}));
|
|
3102
3390
|
const ModDownloadToast = ({
|
|
3103
3391
|
title,
|
|
3104
3392
|
fileName,
|
|
@@ -3118,10 +3406,22 @@ const ModDownloadToast = ({
|
|
|
3118
3406
|
if (!hasActions) {
|
|
3119
3407
|
return null;
|
|
3120
3408
|
}
|
|
3121
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3409
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3410
|
+
Stack,
|
|
3411
|
+
{
|
|
3412
|
+
direction: "row",
|
|
3413
|
+
sx: (theme) => ({
|
|
3414
|
+
alignItems: "center",
|
|
3415
|
+
gap: `${designSystemTokens.spacing.spacing_2}px`,
|
|
3416
|
+
// Keeps the two buttons' 44px hit areas from overlapping.
|
|
3417
|
+
[theme.breakpoints.down("md")]: { gap: `${designSystemTokens.spacing.spacing_4}px` }
|
|
3418
|
+
}),
|
|
3419
|
+
children: [
|
|
3420
|
+
showPause && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { size: "small", onClick: onPause, "aria-label": "Pause download", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, { size: designSystemTokens.spacing.spacing_2 }) }),
|
|
3421
|
+
showClose && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { size: "small", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: designSystemTokens.spacing.spacing_2 }) })
|
|
3422
|
+
]
|
|
3423
|
+
}
|
|
3424
|
+
);
|
|
3125
3425
|
};
|
|
3126
3426
|
return /* @__PURE__ */ jsxRuntime.jsxs(StyledRoot$1, { elevation: 0, role: "status", ...props, children: [
|
|
3127
3427
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3276,6 +3576,12 @@ const StyledChip$1 = styles.styled(Chip, {
|
|
|
3276
3576
|
[`&.${Chip.chipClasses.focusVisible}`]: {
|
|
3277
3577
|
...focusRingStyles,
|
|
3278
3578
|
backgroundColor: selected ? designSystemTokens.semanticColors.button.secondary.bgPressed : designSystemTokens.semanticColors.color.surface.raised
|
|
3579
|
+
},
|
|
3580
|
+
...touchTarget(theme),
|
|
3581
|
+
[theme.breakpoints.down("md")]: {
|
|
3582
|
+
position: "relative",
|
|
3583
|
+
// Keeps the clear icon above the chip's hit area so a tap on it clears rather than opens.
|
|
3584
|
+
[`& .${Chip.chipClasses.deleteIcon}`]: { position: "relative", zIndex: 1 }
|
|
3279
3585
|
}
|
|
3280
3586
|
}));
|
|
3281
3587
|
const LabelContent = styles.styled("span")({
|
|
@@ -3394,6 +3700,13 @@ const ModLoadingSpinner = ({
|
|
|
3394
3700
|
};
|
|
3395
3701
|
ModLoadingSpinner.displayName = "ModLoadingSpinner";
|
|
3396
3702
|
|
|
3703
|
+
const formatCount = (value, locales) => new Intl.NumberFormat(locales).format(value);
|
|
3704
|
+
const paginationRangeLabel = (page, pageSize, rowCount, locales) => {
|
|
3705
|
+
const start = page * pageSize + 1;
|
|
3706
|
+
const end = Math.min((page + 1) * pageSize, rowCount);
|
|
3707
|
+
return `${formatCount(start, locales)}-${formatCount(end, locales)} of ${formatCount(rowCount, locales)}`;
|
|
3708
|
+
};
|
|
3709
|
+
|
|
3397
3710
|
const StyledFooter = styles.styled(Box, {
|
|
3398
3711
|
shouldForwardProp: (prop) => prop !== "showShadow"
|
|
3399
3712
|
})(({ theme, showShadow = false }) => ({
|
|
@@ -3451,7 +3764,9 @@ const LoadMoreButton = styles.styled("button")(({ theme }) => ({
|
|
|
3451
3764
|
"&:disabled": {
|
|
3452
3765
|
color: designSystemTokens.semanticColors.button.fgDisabled,
|
|
3453
3766
|
cursor: "not-allowed"
|
|
3454
|
-
}
|
|
3767
|
+
},
|
|
3768
|
+
...touchTarget(theme),
|
|
3769
|
+
[theme.breakpoints.down("md")]: { position: "relative" }
|
|
3455
3770
|
}));
|
|
3456
3771
|
const SelectedText = styles.styled("p")(({ theme }) => ({
|
|
3457
3772
|
fontFamily: designSystemTokens.typography.fontFamily.body,
|
|
@@ -3517,10 +3832,7 @@ const ModFooter = ({
|
|
|
3517
3832
|
return paginationInfo;
|
|
3518
3833
|
}
|
|
3519
3834
|
if (paginationModel && rowCount > 0) {
|
|
3520
|
-
|
|
3521
|
-
const start = page * pageSize + 1;
|
|
3522
|
-
const end = Math.min((page + 1) * pageSize, rowCount);
|
|
3523
|
-
return `${start}-${end} of ${rowCount}`;
|
|
3835
|
+
return paginationRangeLabel(paginationModel.page, paginationModel.pageSize, rowCount);
|
|
3524
3836
|
}
|
|
3525
3837
|
return "0-0 of 0";
|
|
3526
3838
|
};
|
|
@@ -3600,7 +3912,7 @@ const ModFooter = ({
|
|
|
3600
3912
|
}
|
|
3601
3913
|
return /* @__PURE__ */ jsxRuntime.jsxs(StyledFooter, { showShadow, sx: { justifyContent: "space-between" }, children: [
|
|
3602
3914
|
showSelected ? /* @__PURE__ */ jsxRuntime.jsxs(SelectedText, { children: [
|
|
3603
|
-
selectedCount,
|
|
3915
|
+
formatCount(selectedCount),
|
|
3604
3916
|
" selected"
|
|
3605
3917
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(Box, {}),
|
|
3606
3918
|
/* @__PURE__ */ jsxRuntime.jsxs(PaginationContainer, { children: [
|
|
@@ -3805,6 +4117,11 @@ const StyledInputBase = styles.styled(InputBase, {
|
|
|
3805
4117
|
transition: theme.transitions.create(["border-color", "background-color"], {
|
|
3806
4118
|
duration: theme.transitions.duration.short
|
|
3807
4119
|
}),
|
|
4120
|
+
// A tap on the hit area focuses the input; positioning keeps the input above it for caret taps.
|
|
4121
|
+
...touchTarget(theme, { pseudo: "before" }),
|
|
4122
|
+
[theme.breakpoints.down("md")]: {
|
|
4123
|
+
[`& .${InputBase.inputBaseClasses.input}`]: { position: "relative" }
|
|
4124
|
+
},
|
|
3808
4125
|
[`& .${InputBase.inputBaseClasses.input}`]: {
|
|
3809
4126
|
padding: sizeStyles.padding,
|
|
3810
4127
|
color: designSystemTokens.semanticColors.color.text.input,
|
|
@@ -3994,6 +4311,17 @@ const sizeConfig = {
|
|
|
3994
4311
|
lineHeight: 1.5
|
|
3995
4312
|
}
|
|
3996
4313
|
};
|
|
4314
|
+
function compactRowHeight(theme, rowHeight, hasSecondaryText) {
|
|
4315
|
+
if (rowHeight >= TOUCH_TARGET) {
|
|
4316
|
+
return {};
|
|
4317
|
+
}
|
|
4318
|
+
return {
|
|
4319
|
+
[theme.breakpoints.down("md")]: {
|
|
4320
|
+
minHeight: TOUCH_TARGET,
|
|
4321
|
+
height: hasSecondaryText ? "auto" : TOUCH_TARGET
|
|
4322
|
+
}
|
|
4323
|
+
};
|
|
4324
|
+
}
|
|
3997
4325
|
const StyledListItemButton$1 = styles.styled(ListItemButton, {
|
|
3998
4326
|
shouldForwardProp: (prop) => prop !== "size" && prop !== "primaryText" && prop !== "secondaryText" && prop !== "badge" && prop !== "icon" && prop !== "isLink" && prop !== "hasSecondaryText" && prop !== "trailingElement"
|
|
3999
4327
|
})(({ theme, size = "medium", isLink, hasSecondaryText }) => {
|
|
@@ -4001,6 +4329,7 @@ const StyledListItemButton$1 = styles.styled(ListItemButton, {
|
|
|
4001
4329
|
return {
|
|
4002
4330
|
minHeight: config.height,
|
|
4003
4331
|
height: hasSecondaryText ? "auto" : config.height,
|
|
4332
|
+
...compactRowHeight(theme, config.height, hasSecondaryText),
|
|
4004
4333
|
paddingTop: config.paddingTop,
|
|
4005
4334
|
paddingRight: config.paddingRight,
|
|
4006
4335
|
paddingBottom: config.paddingBottom,
|
|
@@ -4184,6 +4513,9 @@ function navVariantStyles(theme) {
|
|
|
4184
4513
|
paddingBottom: designSystemTokens.spacing.spacing_1,
|
|
4185
4514
|
paddingLeft: designSystemTokens.spacing.spacing_2,
|
|
4186
4515
|
paddingRight: designSystemTokens.spacing.spacing_2,
|
|
4516
|
+
[theme.breakpoints.down("md")]: {
|
|
4517
|
+
minHeight: TOUCH_TARGET
|
|
4518
|
+
},
|
|
4187
4519
|
border: "none",
|
|
4188
4520
|
color: designSystemTokens.semanticColors.color.text.secondary,
|
|
4189
4521
|
backgroundColor: "transparent",
|
|
@@ -4321,13 +4653,27 @@ const ModMenu = ({ children, ...props }) => {
|
|
|
4321
4653
|
};
|
|
4322
4654
|
ModMenu.displayName = "ModMenu";
|
|
4323
4655
|
|
|
4324
|
-
const StyledActionsCell = styles.styled(xDataGrid.GridActionsCell)({
|
|
4656
|
+
const StyledActionsCell = styles.styled(xDataGrid.GridActionsCell)(({ theme }) => ({
|
|
4325
4657
|
gap: designSystemTokens.spacing.spacing_1,
|
|
4326
4658
|
paddingLeft: designSystemTokens.spacing.spacing_1_1_2,
|
|
4327
|
-
paddingRight: designSystemTokens.spacing.spacing_1_1_2
|
|
4659
|
+
paddingRight: designSystemTokens.spacing.spacing_1_1_2,
|
|
4660
|
+
// Below md a cell holds one button (a lone action or the menu trigger), so hit areas can't overlap.
|
|
4661
|
+
[`& .${IconButton.iconButtonClasses.root}`]: touchTarget(theme)
|
|
4662
|
+
}));
|
|
4663
|
+
const actionsOf = (children, prefix = "") => react.Children.toArray(children).flatMap((child) => {
|
|
4664
|
+
if (!react.isValidElement(child)) {
|
|
4665
|
+
return [];
|
|
4666
|
+
}
|
|
4667
|
+
const key = `${prefix}${child.key}`;
|
|
4668
|
+
return child.type === react.Fragment ? actionsOf(child.props.children, key) : [react.cloneElement(child, { key })];
|
|
4328
4669
|
});
|
|
4329
|
-
function ModActionsCell(props) {
|
|
4330
|
-
|
|
4670
|
+
function ModActionsCell({ children, ...props }) {
|
|
4671
|
+
const compact = useIsCompact();
|
|
4672
|
+
const actions = actionsOf(children);
|
|
4673
|
+
if (compact && actions.length > 1) {
|
|
4674
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledActionsCell, { ...props, children: actions.map((action) => react.cloneElement(action, { showInMenu: true })) }, "compact");
|
|
4675
|
+
}
|
|
4676
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledActionsCell, { ...props, children });
|
|
4331
4677
|
}
|
|
4332
4678
|
|
|
4333
4679
|
const StyledCell$1 = styles.styled("div", {
|
|
@@ -4377,7 +4723,7 @@ const ModAvatarCell = ({
|
|
|
4377
4723
|
};
|
|
4378
4724
|
ModAvatarCell.displayName = "ModAvatarCell";
|
|
4379
4725
|
|
|
4380
|
-
const StyledDialog = styles.styled(Dialog)({
|
|
4726
|
+
const StyledDialog = styles.styled(Dialog)(({ theme }) => ({
|
|
4381
4727
|
[`& .${Dialog.dialogClasses.paper}`]: {
|
|
4382
4728
|
backgroundColor: designSystemTokens.semanticColors.color.surface.raised,
|
|
4383
4729
|
borderRadius: designSystemTokens.borderRadius.card,
|
|
@@ -4387,16 +4733,33 @@ const StyledDialog = styles.styled(Dialog)({
|
|
|
4387
4733
|
[`& .${Dialog.dialogClasses.container}`]: {
|
|
4388
4734
|
alignItems: "center",
|
|
4389
4735
|
justifyContent: "center"
|
|
4736
|
+
},
|
|
4737
|
+
[theme.breakpoints.down("sm")]: {
|
|
4738
|
+
[`& .${Dialog.dialogClasses.paper}`]: {
|
|
4739
|
+
margin: 0,
|
|
4740
|
+
width: "100%",
|
|
4741
|
+
maxWidth: "100%",
|
|
4742
|
+
height: "100%",
|
|
4743
|
+
maxHeight: "100%",
|
|
4744
|
+
borderRadius: 0,
|
|
4745
|
+
border: "none"
|
|
4746
|
+
}
|
|
4390
4747
|
}
|
|
4391
|
-
});
|
|
4748
|
+
}));
|
|
4392
4749
|
const ModModal = ({ children, ...props }) => {
|
|
4393
4750
|
return /* @__PURE__ */ jsxRuntime.jsx(StyledDialog, { ...props, children });
|
|
4394
4751
|
};
|
|
4395
4752
|
ModModal.displayName = "ModModal";
|
|
4396
|
-
const ModalHeaderRoot = styles.styled("div")({
|
|
4753
|
+
const ModalHeaderRoot = styles.styled("div")(({ theme }) => ({
|
|
4397
4754
|
display: "flex",
|
|
4398
|
-
flexDirection: "column"
|
|
4399
|
-
|
|
4755
|
+
flexDirection: "column",
|
|
4756
|
+
// Header extras such as tabs otherwise end flush on the body text.
|
|
4757
|
+
[theme.breakpoints.down("md")]: {
|
|
4758
|
+
"&:has(> :nth-child(2))": {
|
|
4759
|
+
paddingBottom: designSystemTokens.spacing.spacing_2
|
|
4760
|
+
}
|
|
4761
|
+
}
|
|
4762
|
+
}));
|
|
4400
4763
|
const ModalHeaderTitleRow = styles.styled("div")({
|
|
4401
4764
|
display: "flex",
|
|
4402
4765
|
alignItems: "flex-start",
|
|
@@ -4441,7 +4804,8 @@ const ModalHeaderSubtitle = styles.styled("p")(({ theme }) => ({
|
|
|
4441
4804
|
lineHeight: 1.4,
|
|
4442
4805
|
color: designSystemTokens.semanticColors.color.text.secondary
|
|
4443
4806
|
}));
|
|
4444
|
-
const StyledCloseButton = styles.styled(IconButton)({
|
|
4807
|
+
const StyledCloseButton = styles.styled(IconButton)(({ theme }) => ({
|
|
4808
|
+
...touchTarget(theme),
|
|
4445
4809
|
color: designSystemTokens.semanticColors.color.icon.utility,
|
|
4446
4810
|
paddingTop: 0,
|
|
4447
4811
|
paddingRight: 0,
|
|
@@ -4454,7 +4818,7 @@ const StyledCloseButton = styles.styled(IconButton)({
|
|
|
4454
4818
|
backgroundColor: "transparent",
|
|
4455
4819
|
color: designSystemTokens.semanticColors.color.icon.utility
|
|
4456
4820
|
}
|
|
4457
|
-
});
|
|
4821
|
+
}));
|
|
4458
4822
|
const ModModalHeader = ({
|
|
4459
4823
|
title,
|
|
4460
4824
|
subtitle,
|
|
@@ -4509,7 +4873,7 @@ const ModModalContent = ({ children }) => {
|
|
|
4509
4873
|
return /* @__PURE__ */ jsxRuntime.jsx(StyledDialogContent, { dividers: false, children });
|
|
4510
4874
|
};
|
|
4511
4875
|
ModModalContent.displayName = "ModModalContent";
|
|
4512
|
-
const StyledDialogActions = styles.styled(DialogActions)({
|
|
4876
|
+
const StyledDialogActions = styles.styled(DialogActions)(({ theme }) => ({
|
|
4513
4877
|
paddingTop: 0,
|
|
4514
4878
|
paddingRight: designSystemTokens.spacing.spacing_4,
|
|
4515
4879
|
paddingBottom: designSystemTokens.spacing.spacing_4,
|
|
@@ -4521,15 +4885,38 @@ const StyledDialogActions = styles.styled(DialogActions)({
|
|
|
4521
4885
|
paddingTop: 0,
|
|
4522
4886
|
paddingRight: designSystemTokens.spacing.spacing_4,
|
|
4523
4887
|
paddingBottom: designSystemTokens.spacing.spacing_4,
|
|
4524
|
-
paddingLeft: designSystemTokens.spacing.spacing_4
|
|
4888
|
+
paddingLeft: designSystemTokens.spacing.spacing_4,
|
|
4889
|
+
// A full-screen body scrolls; the border marks where it ends and the actions begin.
|
|
4890
|
+
[theme.breakpoints.down("sm")]: {
|
|
4891
|
+
paddingTop: designSystemTokens.spacing.spacing_2,
|
|
4892
|
+
borderTop: `1px solid ${designSystemTokens.semanticColors.color.border.primary}`
|
|
4893
|
+
}
|
|
4894
|
+
},
|
|
4895
|
+
[theme.breakpoints.down("sm")]: {
|
|
4896
|
+
flexWrap: "wrap",
|
|
4897
|
+
columnGap: designSystemTokens.spacing.spacing_2,
|
|
4898
|
+
rowGap: designSystemTokens.spacing.spacing_2,
|
|
4899
|
+
// MUI's sibling margin would inset the actions past the header's edge.
|
|
4900
|
+
[`&.${DialogActions.dialogActionsClasses.spacing} > :not(style) ~ :not(style)`]: {
|
|
4901
|
+
marginLeft: 0
|
|
4902
|
+
}
|
|
4525
4903
|
}
|
|
4526
|
-
});
|
|
4527
|
-
const FooterActionsGroup = styles.styled("div")({
|
|
4904
|
+
}));
|
|
4905
|
+
const FooterActionsGroup = styles.styled("div")(({ theme }) => ({
|
|
4528
4906
|
display: "flex",
|
|
4529
4907
|
gap: designSystemTokens.spacing.spacing_2,
|
|
4530
4908
|
alignItems: "center",
|
|
4531
|
-
marginLeft: "auto"
|
|
4532
|
-
|
|
4909
|
+
marginLeft: "auto",
|
|
4910
|
+
// Full-width stack with the primary action last, nearest the thumb.
|
|
4911
|
+
// A small leading icon shares the actions' row; wider leading content pushes them to a row of their own.
|
|
4912
|
+
[theme.breakpoints.down("sm")]: {
|
|
4913
|
+
flex: "1 1 0",
|
|
4914
|
+
minWidth: "50%",
|
|
4915
|
+
flexDirection: "column",
|
|
4916
|
+
alignItems: "stretch",
|
|
4917
|
+
marginLeft: 0
|
|
4918
|
+
}
|
|
4919
|
+
}));
|
|
4533
4920
|
const ModModalFooter = ({ leadingContent, children }) => {
|
|
4534
4921
|
return /* @__PURE__ */ jsxRuntime.jsxs(StyledDialogActions, { children: [
|
|
4535
4922
|
leadingContent,
|
|
@@ -4863,6 +5250,23 @@ const StyledTooltip = styles.styled(
|
|
|
4863
5250
|
}
|
|
4864
5251
|
};
|
|
4865
5252
|
});
|
|
5253
|
+
const withCompactFallback = (placement, popper) => {
|
|
5254
|
+
const side = placement?.split("-")[0];
|
|
5255
|
+
if (side !== "left" && side !== "right") {
|
|
5256
|
+
return popper;
|
|
5257
|
+
}
|
|
5258
|
+
const flip = {
|
|
5259
|
+
name: "flip",
|
|
5260
|
+
options: { fallbackPlacements: [side === "left" ? "right" : "left", "top", "bottom"] }
|
|
5261
|
+
};
|
|
5262
|
+
return {
|
|
5263
|
+
...popper,
|
|
5264
|
+
popperOptions: {
|
|
5265
|
+
...popper?.popperOptions,
|
|
5266
|
+
modifiers: [flip, ...popper?.popperOptions?.modifiers ?? []]
|
|
5267
|
+
}
|
|
5268
|
+
};
|
|
5269
|
+
};
|
|
4866
5270
|
const ModTooltip = ({
|
|
4867
5271
|
variant = "light",
|
|
4868
5272
|
title,
|
|
@@ -4870,8 +5274,22 @@ const ModTooltip = ({
|
|
|
4870
5274
|
children,
|
|
4871
5275
|
arrow = false,
|
|
4872
5276
|
placement,
|
|
5277
|
+
describeChild,
|
|
5278
|
+
slotProps,
|
|
4873
5279
|
...props
|
|
4874
5280
|
}) => {
|
|
5281
|
+
const accessibleName = typeof title === "string" && !description && !describeChild ? title : void 0;
|
|
5282
|
+
const isCompact = useIsCompact();
|
|
5283
|
+
const compactSlotProps = react.useMemo(() => {
|
|
5284
|
+
const popper = slotProps?.popper;
|
|
5285
|
+
if (!isCompact) {
|
|
5286
|
+
return slotProps;
|
|
5287
|
+
}
|
|
5288
|
+
return {
|
|
5289
|
+
...slotProps,
|
|
5290
|
+
popper: typeof popper === "function" ? (ownerState) => withCompactFallback(placement, popper(ownerState)) : withCompactFallback(placement, popper)
|
|
5291
|
+
};
|
|
5292
|
+
}, [isCompact, placement, slotProps]);
|
|
4875
5293
|
const titleContent = description ? /* @__PURE__ */ jsxRuntime.jsxs(Stack, { sx: { gap: `${designSystemTokens.spacing.spacing_1_4}px` }, children: [
|
|
4876
5294
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "inherit", sx: { fontWeight: designSystemTokens.typography.fontWeight.semiBold }, children: title }),
|
|
4877
5295
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "inherit", children: description })
|
|
@@ -4883,6 +5301,9 @@ const ModTooltip = ({
|
|
|
4883
5301
|
title: titleContent,
|
|
4884
5302
|
arrow,
|
|
4885
5303
|
placement,
|
|
5304
|
+
describeChild,
|
|
5305
|
+
"aria-label": accessibleName,
|
|
5306
|
+
slotProps: compactSlotProps,
|
|
4886
5307
|
...props,
|
|
4887
5308
|
children
|
|
4888
5309
|
}
|
|
@@ -4981,6 +5402,7 @@ function ModNavigationItem({
|
|
|
4981
5402
|
selected,
|
|
4982
5403
|
"aria-label": collapsed && typeof label === "string" ? label : void 0,
|
|
4983
5404
|
disableRipple: true,
|
|
5405
|
+
"data-mod-nav-item": "",
|
|
4984
5406
|
...props,
|
|
4985
5407
|
children: [
|
|
4986
5408
|
/* @__PURE__ */ jsxRuntime.jsx(IconPadding, { className: "mod-nav-icon-padding", children: icon }),
|
|
@@ -5007,6 +5429,71 @@ function ModNavigationItem({
|
|
|
5007
5429
|
}
|
|
5008
5430
|
ModNavigationItem.displayName = "ModNavigationItem";
|
|
5009
5431
|
|
|
5432
|
+
function OverflowActions({ actions = [] }) {
|
|
5433
|
+
const compact = useIsCompact();
|
|
5434
|
+
const [anchor, setAnchor] = react.useState(null);
|
|
5435
|
+
const menuId = react.useId();
|
|
5436
|
+
react.useEffect(() => {
|
|
5437
|
+
if (!compact) {
|
|
5438
|
+
setAnchor(null);
|
|
5439
|
+
}
|
|
5440
|
+
}, [compact]);
|
|
5441
|
+
if (actions.length === 0) {
|
|
5442
|
+
return null;
|
|
5443
|
+
}
|
|
5444
|
+
const [first, ...rest] = actions;
|
|
5445
|
+
const inline = compact && rest.length > 0 ? [first] : actions;
|
|
5446
|
+
const overflow = compact ? rest : [];
|
|
5447
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: `${designSystemTokens.spacing.spacing_1}px` }, children: [
|
|
5448
|
+
inline.map((action) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5449
|
+
ModButton,
|
|
5450
|
+
{
|
|
5451
|
+
variant: action.variant,
|
|
5452
|
+
startIcon: action.icon,
|
|
5453
|
+
disabled: action.disabled,
|
|
5454
|
+
onClick: action.onClick,
|
|
5455
|
+
children: action.label
|
|
5456
|
+
},
|
|
5457
|
+
action.id
|
|
5458
|
+
)),
|
|
5459
|
+
overflow.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5460
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5461
|
+
ModIconButton,
|
|
5462
|
+
{
|
|
5463
|
+
"aria-label": "More actions",
|
|
5464
|
+
"aria-haspopup": "menu",
|
|
5465
|
+
"aria-expanded": anchor !== null,
|
|
5466
|
+
"aria-controls": anchor ? menuId : void 0,
|
|
5467
|
+
onClick: (event) => setAnchor(event.currentTarget),
|
|
5468
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EllipsisVertical, {})
|
|
5469
|
+
}
|
|
5470
|
+
),
|
|
5471
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5472
|
+
ModMenu,
|
|
5473
|
+
{
|
|
5474
|
+
anchorEl: anchor,
|
|
5475
|
+
open: anchor !== null,
|
|
5476
|
+
onClose: () => setAnchor(null),
|
|
5477
|
+
slotProps: { list: { id: menuId } },
|
|
5478
|
+
children: overflow.map((action) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5479
|
+
ModMenuItem,
|
|
5480
|
+
{
|
|
5481
|
+
icon: action.icon,
|
|
5482
|
+
disabled: action.disabled,
|
|
5483
|
+
onClick: () => {
|
|
5484
|
+
setAnchor(null);
|
|
5485
|
+
action.onClick();
|
|
5486
|
+
},
|
|
5487
|
+
children: action.label
|
|
5488
|
+
},
|
|
5489
|
+
action.id
|
|
5490
|
+
))
|
|
5491
|
+
}
|
|
5492
|
+
)
|
|
5493
|
+
] })
|
|
5494
|
+
] });
|
|
5495
|
+
}
|
|
5496
|
+
|
|
5010
5497
|
const StickyHeader = styles.styled(Box)(({ theme }) => ({
|
|
5011
5498
|
position: "sticky",
|
|
5012
5499
|
top: 0,
|
|
@@ -5028,6 +5515,7 @@ function ModPageContent({
|
|
|
5028
5515
|
subtitle,
|
|
5029
5516
|
breadcrumbs,
|
|
5030
5517
|
action,
|
|
5518
|
+
actions,
|
|
5031
5519
|
sticky = false,
|
|
5032
5520
|
contentMaxWidth: contentMaxWidthProp = false,
|
|
5033
5521
|
centerContent = true,
|
|
@@ -5086,13 +5574,19 @@ function ModPageContent({
|
|
|
5086
5574
|
Stack,
|
|
5087
5575
|
{
|
|
5088
5576
|
direction: "row",
|
|
5089
|
-
sx:
|
|
5577
|
+
sx: (theme) => ({
|
|
5578
|
+
justifyContent: "space-between",
|
|
5579
|
+
alignItems: "flex-start",
|
|
5580
|
+
gap: "1rem",
|
|
5581
|
+
[theme.breakpoints.down("md")]: { flexWrap: "wrap" }
|
|
5582
|
+
}),
|
|
5090
5583
|
children: [
|
|
5091
5584
|
/* @__PURE__ */ jsxRuntime.jsxs(Stack, { sx: { gap: "0.5rem", flexGrow: 1 }, children: [
|
|
5092
5585
|
typeof pageTitle === "string" ? /* @__PURE__ */ jsxRuntime.jsx(PageTitle, { component: "h1", children: pageTitle }) : pageTitle,
|
|
5093
5586
|
subtitle && (typeof subtitle === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Subtitle, { variant: "caption", children: subtitle }) : subtitle)
|
|
5094
5587
|
] }),
|
|
5095
|
-
action
|
|
5588
|
+
action,
|
|
5589
|
+
/* @__PURE__ */ jsxRuntime.jsx(OverflowActions, { actions })
|
|
5096
5590
|
]
|
|
5097
5591
|
}
|
|
5098
5592
|
)
|
|
@@ -5251,7 +5745,16 @@ function ModPaginatedGrid({
|
|
|
5251
5745
|
}
|
|
5252
5746
|
ModPaginatedGrid.displayName = "ModPaginatedGrid";
|
|
5253
5747
|
|
|
5748
|
+
const StyledQuickFilter = styles.styled(xDataGrid.QuickFilter)(({ theme }) => ({
|
|
5749
|
+
[theme.breakpoints.down("sm")]: {
|
|
5750
|
+
flex: "1 1 100%",
|
|
5751
|
+
minWidth: 0
|
|
5752
|
+
}
|
|
5753
|
+
}));
|
|
5254
5754
|
const StyledTextField = styles.styled(TextField)(({ theme }) => ({
|
|
5755
|
+
[theme.breakpoints.down("sm")]: {
|
|
5756
|
+
width: "100%"
|
|
5757
|
+
},
|
|
5255
5758
|
[`& .${InputBase.inputBaseClasses.root}`]: {
|
|
5256
5759
|
height: designSystemTokens.spacing.spacing_5,
|
|
5257
5760
|
fontSize: theme.typography.pxToRem(designSystemTokens.typography.fontSize.default),
|
|
@@ -5263,6 +5766,9 @@ const StyledTextField = styles.styled(TextField)(({ theme }) => ({
|
|
|
5263
5766
|
paddingLeft: designSystemTokens.spacing.spacing_1_1_2,
|
|
5264
5767
|
paddingRight: designSystemTokens.spacing.spacing_1_1_2,
|
|
5265
5768
|
gap: designSystemTokens.spacing.spacing_1_2,
|
|
5769
|
+
[theme.breakpoints.down("md")]: {
|
|
5770
|
+
height: TOUCH_TARGET
|
|
5771
|
+
},
|
|
5266
5772
|
"&::before, &::after": {
|
|
5267
5773
|
display: "none"
|
|
5268
5774
|
},
|
|
@@ -5297,6 +5803,7 @@ const StyledTextField = styles.styled(TextField)(({ theme }) => ({
|
|
|
5297
5803
|
marginRight: 0
|
|
5298
5804
|
},
|
|
5299
5805
|
[`& .${IconButton.iconButtonClasses.root}`]: {
|
|
5806
|
+
...touchTarget(theme),
|
|
5300
5807
|
color: designSystemTokens.semanticColors.color.icon.placeholder,
|
|
5301
5808
|
"&:hover": {
|
|
5302
5809
|
backgroundColor: designSystemTokens.semanticColors.color.icon.bgHover,
|
|
@@ -5313,7 +5820,7 @@ const ModQuickFilter = ({
|
|
|
5313
5820
|
onKeyDown,
|
|
5314
5821
|
autoFocus = false
|
|
5315
5822
|
}) => {
|
|
5316
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5823
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledQuickFilter, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5317
5824
|
xDataGrid.QuickFilterControl,
|
|
5318
5825
|
{
|
|
5319
5826
|
onKeyDown,
|
|
@@ -5453,7 +5960,7 @@ const HelperText$1 = styles.styled("span")(({ theme, size = "medium" }) => ({
|
|
|
5453
5960
|
}));
|
|
5454
5961
|
const StyledRadio = styles.styled(Radio, {
|
|
5455
5962
|
shouldForwardProp: (prop) => prop !== "size"
|
|
5456
|
-
})(({ size = "medium" }) => {
|
|
5963
|
+
})(({ theme, size = "medium" }) => {
|
|
5457
5964
|
const dimensions = size === "small" ? 16 : 20;
|
|
5458
5965
|
const radius = size === "small" ? 8 : 10;
|
|
5459
5966
|
return {
|
|
@@ -5474,6 +5981,7 @@ const StyledRadio = styles.styled(Radio, {
|
|
|
5474
5981
|
width: dimensions,
|
|
5475
5982
|
height: dimensions
|
|
5476
5983
|
},
|
|
5984
|
+
"& input": inputTouchTarget(theme),
|
|
5477
5985
|
// Focus state for keyboard navigation
|
|
5478
5986
|
[`&.${ButtonBase.buttonBaseClasses.focusVisible}`]: {
|
|
5479
5987
|
// Unchecked focus state: white background
|
|
@@ -5602,6 +6110,11 @@ const StyledSearchChip = styles.styled(InputBase, {
|
|
|
5602
6110
|
transition: theme.transitions.create(["border-color", "background-color"], {
|
|
5603
6111
|
duration: theme.transitions.duration.short
|
|
5604
6112
|
}),
|
|
6113
|
+
// A tap on the hit area focuses the input; positioning keeps the input above it for caret taps.
|
|
6114
|
+
...touchTarget(theme, { pseudo: "before" }),
|
|
6115
|
+
[theme.breakpoints.down("md")]: {
|
|
6116
|
+
[`& .${InputBase.inputBaseClasses.input}`]: { position: "relative" }
|
|
6117
|
+
},
|
|
5605
6118
|
[`& .${InputBase.inputBaseClasses.input}`]: {
|
|
5606
6119
|
padding: `0 ${designSystemTokens.spacing.spacing_1_4}px`,
|
|
5607
6120
|
height: "auto",
|
|
@@ -5634,7 +6147,8 @@ const StyledSearchChip = styles.styled(InputBase, {
|
|
|
5634
6147
|
outline: `3px solid ${designSystemTokens.semanticColors.color.action.tint}`
|
|
5635
6148
|
}
|
|
5636
6149
|
}));
|
|
5637
|
-
const ClearButton = styles.styled(ButtonBase)({
|
|
6150
|
+
const ClearButton = styles.styled(ButtonBase)(({ theme }) => ({
|
|
6151
|
+
...touchTarget(theme),
|
|
5638
6152
|
display: "inline-flex",
|
|
5639
6153
|
alignItems: "center",
|
|
5640
6154
|
justifyContent: "center",
|
|
@@ -5650,7 +6164,7 @@ const ClearButton = styles.styled(ButtonBase)({
|
|
|
5650
6164
|
"&:hover": {
|
|
5651
6165
|
backgroundColor: designSystemTokens.semanticColors.button.secondary.bgHover
|
|
5652
6166
|
}
|
|
5653
|
-
});
|
|
6167
|
+
}));
|
|
5654
6168
|
const ModSearchChip = ({ onClear, value, ...props }) => {
|
|
5655
6169
|
const hasValue = Boolean(value && String(value).length > 0);
|
|
5656
6170
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5763,7 +6277,7 @@ const HeaderRegion = styles.styled("div")({
|
|
|
5763
6277
|
flexDirection: "column",
|
|
5764
6278
|
alignItems: "center"
|
|
5765
6279
|
});
|
|
5766
|
-
const Scroll = styles.styled("div")({
|
|
6280
|
+
const Scroll = styles.styled("div")(({ theme }) => ({
|
|
5767
6281
|
flex: 1,
|
|
5768
6282
|
minHeight: 0,
|
|
5769
6283
|
overflowY: "auto",
|
|
@@ -5777,8 +6291,12 @@ const Scroll = styles.styled("div")({
|
|
|
5777
6291
|
// Keeps Tab from parking an item under a fade, which hides its focus ring.
|
|
5778
6292
|
scrollPaddingBlock: designSystemTokens.spacing.spacing_3,
|
|
5779
6293
|
paddingInline: designSystemTokens.spacing.spacing_1,
|
|
5780
|
-
"&::-webkit-scrollbar": { display: "none" }
|
|
5781
|
-
|
|
6294
|
+
"&::-webkit-scrollbar": { display: "none" },
|
|
6295
|
+
// Taller touch rows end flush on the footer's logo; the list stops short of it.
|
|
6296
|
+
[theme.breakpoints.down("md")]: {
|
|
6297
|
+
marginBottom: designSystemTokens.spacing.spacing_2
|
|
6298
|
+
}
|
|
6299
|
+
}));
|
|
5782
6300
|
const FooterRegion = styles.styled("div")({
|
|
5783
6301
|
position: "relative",
|
|
5784
6302
|
flexShrink: 0,
|
|
@@ -5816,6 +6334,7 @@ const Fade = styles.styled("div", {
|
|
|
5816
6334
|
}
|
|
5817
6335
|
}));
|
|
5818
6336
|
const Handle = styles.styled(ButtonBase)(({ theme }) => ({
|
|
6337
|
+
...touchTarget(theme),
|
|
5819
6338
|
position: "absolute",
|
|
5820
6339
|
right: 0,
|
|
5821
6340
|
bottom: designSystemTokens.spacing.spacing_1,
|
|
@@ -5836,7 +6355,7 @@ const Handle = styles.styled(ButtonBase)(({ theme }) => ({
|
|
|
5836
6355
|
borderColor: designSystemTokens.semanticColors.color.border.primary
|
|
5837
6356
|
}
|
|
5838
6357
|
}));
|
|
5839
|
-
function useScrollEdges() {
|
|
6358
|
+
function useScrollEdges$1() {
|
|
5840
6359
|
const ref = react.useRef(null);
|
|
5841
6360
|
const contentRef = react.useRef(null);
|
|
5842
6361
|
const [edges, setEdges] = react.useState({
|
|
@@ -5869,6 +6388,33 @@ function useScrollEdges() {
|
|
|
5869
6388
|
}, [measure]);
|
|
5870
6389
|
return { ref, contentRef, onScroll: measure, ...edges };
|
|
5871
6390
|
}
|
|
6391
|
+
function Rail({ collapsed, header, footer, children, className, id, ariaLabel }) {
|
|
6392
|
+
const { ref: scrollRef, contentRef, onScroll, canScrollUp, canScrollDown } = useScrollEdges$1();
|
|
6393
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Root, { collapsed, "aria-label": ariaLabel, className, id, children: [
|
|
6394
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HeaderRegion, { children: [
|
|
6395
|
+
header,
|
|
6396
|
+
/* @__PURE__ */ jsxRuntime.jsx(Fade, { edge: "header", visible: canScrollUp })
|
|
6397
|
+
] }),
|
|
6398
|
+
/* @__PURE__ */ jsxRuntime.jsx(Scroll, { ref: scrollRef, onScroll, "data-testid": "mod-side-nav-scroll", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6399
|
+
Stack,
|
|
6400
|
+
{
|
|
6401
|
+
ref: contentRef,
|
|
6402
|
+
sx: {
|
|
6403
|
+
alignItems: "center",
|
|
6404
|
+
gap: `${designSystemTokens.spacing.spacing_1_2}px`,
|
|
6405
|
+
// Keeps `flex: 1` / `margin-block-start: auto` working on
|
|
6406
|
+
// children, as when Scroll was the flex container.
|
|
6407
|
+
minHeight: "100%"
|
|
6408
|
+
},
|
|
6409
|
+
children
|
|
6410
|
+
}
|
|
6411
|
+
) }),
|
|
6412
|
+
/* @__PURE__ */ jsxRuntime.jsxs(FooterRegion, { children: [
|
|
6413
|
+
/* @__PURE__ */ jsxRuntime.jsx(Fade, { edge: "footer", visible: canScrollDown }),
|
|
6414
|
+
footer
|
|
6415
|
+
] })
|
|
6416
|
+
] });
|
|
6417
|
+
}
|
|
5872
6418
|
function ModSideNav({
|
|
5873
6419
|
collapsed,
|
|
5874
6420
|
onCollapsedChange,
|
|
@@ -5877,36 +6423,57 @@ function ModSideNav({
|
|
|
5877
6423
|
children,
|
|
5878
6424
|
className,
|
|
5879
6425
|
id,
|
|
5880
|
-
"aria-label": ariaLabel
|
|
6426
|
+
"aria-label": ariaLabel,
|
|
6427
|
+
mobileOpen = false,
|
|
6428
|
+
onMobileOpenChange
|
|
5881
6429
|
}) {
|
|
5882
|
-
const
|
|
5883
|
-
const
|
|
6430
|
+
const compact = useIsCompact();
|
|
6431
|
+
const asDrawer = compact && onMobileOpenChange !== void 0;
|
|
6432
|
+
const railCollapsed = asDrawer ? false : collapsed;
|
|
6433
|
+
react.useEffect(() => {
|
|
6434
|
+
if (!compact && mobileOpen) {
|
|
6435
|
+
onMobileOpenChange?.(false);
|
|
6436
|
+
}
|
|
6437
|
+
}, [compact, mobileOpen, onMobileOpenChange]);
|
|
6438
|
+
const contextValue = react.useMemo(() => ({ collapsed: railCollapsed }), [railCollapsed]);
|
|
6439
|
+
const rail = /* @__PURE__ */ jsxRuntime.jsx(
|
|
6440
|
+
Rail,
|
|
6441
|
+
{
|
|
6442
|
+
collapsed: railCollapsed,
|
|
6443
|
+
header,
|
|
6444
|
+
footer,
|
|
6445
|
+
className,
|
|
6446
|
+
id,
|
|
6447
|
+
ariaLabel,
|
|
6448
|
+
children
|
|
6449
|
+
}
|
|
6450
|
+
);
|
|
6451
|
+
if (asDrawer) {
|
|
6452
|
+
const closeOnNavigate = (event) => {
|
|
6453
|
+
const target = event.target;
|
|
6454
|
+
const hit = target.closest("a[href], [data-mod-nav-item]");
|
|
6455
|
+
const popup = target.closest('[aria-haspopup]:not([aria-haspopup="false"]), [aria-expanded]');
|
|
6456
|
+
if (hit && !(popup && hit.contains(popup))) {
|
|
6457
|
+
onMobileOpenChange?.(false);
|
|
6458
|
+
}
|
|
6459
|
+
};
|
|
6460
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ModSideNavContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6461
|
+
Drawer,
|
|
6462
|
+
{
|
|
6463
|
+
variant: "temporary",
|
|
6464
|
+
anchor: "left",
|
|
6465
|
+
open: mobileOpen,
|
|
6466
|
+
onClose: () => onMobileOpenChange?.(false),
|
|
6467
|
+
slotProps: {
|
|
6468
|
+
paper: { sx: { backgroundColor: RAIL_BACKGROUND, backgroundImage: "none" } }
|
|
6469
|
+
},
|
|
6470
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Frame, { collapsed: false, onClickCapture: closeOnNavigate, children: rail })
|
|
6471
|
+
}
|
|
6472
|
+
) });
|
|
6473
|
+
}
|
|
5884
6474
|
const HandleIcon = collapsed ? lucideReact.ChevronRight : lucideReact.ChevronLeft;
|
|
5885
6475
|
return /* @__PURE__ */ jsxRuntime.jsx(ModSideNavContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(Frame, { collapsed, children: [
|
|
5886
|
-
|
|
5887
|
-
/* @__PURE__ */ jsxRuntime.jsxs(HeaderRegion, { children: [
|
|
5888
|
-
header,
|
|
5889
|
-
/* @__PURE__ */ jsxRuntime.jsx(Fade, { edge: "header", visible: canScrollUp })
|
|
5890
|
-
] }),
|
|
5891
|
-
/* @__PURE__ */ jsxRuntime.jsx(Scroll, { ref: scrollRef, onScroll, "data-testid": "mod-side-nav-scroll", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5892
|
-
Stack,
|
|
5893
|
-
{
|
|
5894
|
-
ref: contentRef,
|
|
5895
|
-
sx: {
|
|
5896
|
-
alignItems: "center",
|
|
5897
|
-
gap: `${designSystemTokens.spacing.spacing_1_2}px`,
|
|
5898
|
-
// Keeps `flex: 1` / `margin-block-start: auto` working on
|
|
5899
|
-
// children, as when Scroll was the flex container.
|
|
5900
|
-
minHeight: "100%"
|
|
5901
|
-
},
|
|
5902
|
-
children
|
|
5903
|
-
}
|
|
5904
|
-
) }),
|
|
5905
|
-
/* @__PURE__ */ jsxRuntime.jsxs(FooterRegion, { children: [
|
|
5906
|
-
/* @__PURE__ */ jsxRuntime.jsx(Fade, { edge: "footer", visible: canScrollDown }),
|
|
5907
|
-
footer
|
|
5908
|
-
] })
|
|
5909
|
-
] }),
|
|
6476
|
+
rail,
|
|
5910
6477
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5911
6478
|
Handle,
|
|
5912
6479
|
{
|
|
@@ -5945,7 +6512,9 @@ const StyledSkeleton = styles.styled(Skeleton, {
|
|
|
5945
6512
|
"&::after": {
|
|
5946
6513
|
animationDirection: "reverse"
|
|
5947
6514
|
}
|
|
5948
|
-
}
|
|
6515
|
+
},
|
|
6516
|
+
// A fixed width sized for desktop yields to a phone-width container.
|
|
6517
|
+
[theme.breakpoints.down("md")]: { maxWidth: "100%" }
|
|
5949
6518
|
}));
|
|
5950
6519
|
const ModSkeleton = ({
|
|
5951
6520
|
colorTheme = "light",
|
|
@@ -6072,20 +6641,91 @@ const ModTabPanel = ({
|
|
|
6072
6641
|
};
|
|
6073
6642
|
ModTabPanel.displayName = "ModTabPanel";
|
|
6074
6643
|
|
|
6075
|
-
const
|
|
6644
|
+
const EDGE_FADE = designSystemTokens.spacing.spacing_4;
|
|
6645
|
+
const StyledTabs = styles.styled(MuiTabs)(({ theme }) => ({
|
|
6076
6646
|
minHeight: designSystemTokens.spacing.spacing_5,
|
|
6647
|
+
[theme.breakpoints.down("md")]: {
|
|
6648
|
+
minHeight: TOUCH_TARGET
|
|
6649
|
+
},
|
|
6077
6650
|
[`& .${MuiTabs.tabsClasses.indicator}`]: {
|
|
6078
6651
|
backgroundColor: designSystemTokens.semanticColors.button.nav.borderActive,
|
|
6079
|
-
height: 2
|
|
6652
|
+
height: 2,
|
|
6653
|
+
// The indicator overlaps the selected tab's bottom edge; let those taps reach the tab.
|
|
6654
|
+
[theme.breakpoints.down("md")]: {
|
|
6655
|
+
pointerEvents: "none"
|
|
6656
|
+
}
|
|
6080
6657
|
},
|
|
6081
6658
|
[`& .${MuiTabs.tabsClasses.list}`]: {
|
|
6082
6659
|
gap: 0
|
|
6660
|
+
},
|
|
6661
|
+
// A row that scrolls fades out at each edge it can still scroll toward (set by ModTabs below md).
|
|
6662
|
+
[theme.breakpoints.down("md")]: {
|
|
6663
|
+
[`&[data-fade-end] .${MuiTabs.tabsClasses.scroller}`]: {
|
|
6664
|
+
maskImage: `linear-gradient(to right, black calc(100% - ${EDGE_FADE}px), transparent)`
|
|
6665
|
+
},
|
|
6666
|
+
[`&[data-fade-start] .${MuiTabs.tabsClasses.scroller}`]: {
|
|
6667
|
+
maskImage: `linear-gradient(to left, black calc(100% - ${EDGE_FADE}px), transparent)`
|
|
6668
|
+
},
|
|
6669
|
+
[`&[data-fade-start][data-fade-end] .${MuiTabs.tabsClasses.scroller}`]: {
|
|
6670
|
+
maskImage: `linear-gradient(to right, transparent, black ${EDGE_FADE}px, black calc(100% - ${EDGE_FADE}px), transparent)`
|
|
6671
|
+
}
|
|
6083
6672
|
}
|
|
6084
6673
|
}));
|
|
6674
|
+
function useScrollEdges(active) {
|
|
6675
|
+
const rootRef = react.useRef(null);
|
|
6676
|
+
const [edges, setEdges] = react.useState({ start: false, end: false });
|
|
6677
|
+
react.useEffect(() => {
|
|
6678
|
+
const scroller = rootRef.current?.querySelector(`.${MuiTabs.tabsClasses.scroller}`);
|
|
6679
|
+
if (!active || !scroller) {
|
|
6680
|
+
setEdges((prev) => prev.start || prev.end ? { start: false, end: false } : prev);
|
|
6681
|
+
return;
|
|
6682
|
+
}
|
|
6683
|
+
const measure = () => {
|
|
6684
|
+
const left = Math.abs(scroller.scrollLeft);
|
|
6685
|
+
const start = left > 0;
|
|
6686
|
+
const end = left + scroller.clientWidth < scroller.scrollWidth - 1;
|
|
6687
|
+
setEdges((prev) => prev.start === start && prev.end === end ? prev : { start, end });
|
|
6688
|
+
};
|
|
6689
|
+
measure();
|
|
6690
|
+
scroller.addEventListener("scroll", measure, { passive: true });
|
|
6691
|
+
const resize = new ResizeObserver(measure);
|
|
6692
|
+
resize.observe(scroller);
|
|
6693
|
+
for (const child of scroller.children) {
|
|
6694
|
+
resize.observe(child);
|
|
6695
|
+
}
|
|
6696
|
+
return () => {
|
|
6697
|
+
scroller.removeEventListener("scroll", measure);
|
|
6698
|
+
resize.disconnect();
|
|
6699
|
+
};
|
|
6700
|
+
}, [active]);
|
|
6701
|
+
return { rootRef, edges };
|
|
6702
|
+
}
|
|
6703
|
+
const ModTabs = react.forwardRef(function ModTabs2(props, ref) {
|
|
6704
|
+
const compact = useIsCompact();
|
|
6705
|
+
const variant = props.variant ?? "standard";
|
|
6706
|
+
const scrollable = compact && variant === "standard";
|
|
6707
|
+
const arrowless = compact && variant === "scrollable" && !props.allowScrollButtonsMobile;
|
|
6708
|
+
const { rootRef, edges } = useScrollEdges(compact && variant !== "fullWidth");
|
|
6709
|
+
const forkedRef = utils.useForkRef(ref, rootRef);
|
|
6710
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6711
|
+
StyledTabs,
|
|
6712
|
+
{
|
|
6713
|
+
ref: forkedRef,
|
|
6714
|
+
...props,
|
|
6715
|
+
...scrollable && { variant: "scrollable", scrollButtons: false, centered: false },
|
|
6716
|
+
...arrowless && { scrollButtons: false },
|
|
6717
|
+
"data-fade-start": edges.start || void 0,
|
|
6718
|
+
"data-fade-end": edges.end || void 0
|
|
6719
|
+
}
|
|
6720
|
+
);
|
|
6721
|
+
});
|
|
6085
6722
|
ModTabs.displayName = "ModTabs";
|
|
6086
6723
|
const StyledTab = styles.styled(MuiTab)(({ theme }) => ({
|
|
6087
6724
|
minHeight: designSystemTokens.spacing.spacing_5,
|
|
6088
6725
|
padding: `${designSystemTokens.spacing.spacing_1}px ${designSystemTokens.spacing.spacing_2}px`,
|
|
6726
|
+
[theme.breakpoints.down("md")]: {
|
|
6727
|
+
minHeight: TOUCH_TARGET
|
|
6728
|
+
},
|
|
6089
6729
|
textTransform: "none",
|
|
6090
6730
|
fontWeight: designSystemTokens.typography.fontWeight.regular,
|
|
6091
6731
|
fontSize: theme.typography.pxToRem(14),
|
|
@@ -6221,6 +6861,10 @@ const StyledAlert = styles.styled(Alert, {
|
|
|
6221
6861
|
[`& .${Alert.alertClasses.action}`]: {
|
|
6222
6862
|
padding: 0,
|
|
6223
6863
|
marginRight: 0
|
|
6864
|
+
},
|
|
6865
|
+
// MUI's message scrolls (overflow: auto), which would clip the action buttons' hit areas.
|
|
6866
|
+
[theme.breakpoints.down("md")]: {
|
|
6867
|
+
[`& .${Alert.alertClasses.message}`]: { overflow: "visible" }
|
|
6224
6868
|
}
|
|
6225
6869
|
};
|
|
6226
6870
|
});
|
|
@@ -6256,7 +6900,8 @@ const ToastButton = styles.styled(Button, {
|
|
|
6256
6900
|
"&:hover": {
|
|
6257
6901
|
backgroundColor: "transparent",
|
|
6258
6902
|
textDecoration: "underline"
|
|
6259
|
-
}
|
|
6903
|
+
},
|
|
6904
|
+
...touchTarget(theme)
|
|
6260
6905
|
}));
|
|
6261
6906
|
const ModToast = ({
|
|
6262
6907
|
intent = "neutral",
|
|
@@ -6278,7 +6923,7 @@ const ModToast = ({
|
|
|
6278
6923
|
{
|
|
6279
6924
|
size: "small",
|
|
6280
6925
|
onClick: onClose,
|
|
6281
|
-
sx: { color: designSystemTokens.semanticColors.color.icon.utility },
|
|
6926
|
+
sx: (theme) => ({ color: designSystemTokens.semanticColors.color.icon.utility, ...touchTarget(theme) }),
|
|
6282
6927
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 16 })
|
|
6283
6928
|
}
|
|
6284
6929
|
) : void 0,
|
|
@@ -6402,6 +7047,9 @@ const StyledSwitch = styles.styled(Switch, {
|
|
|
6402
7047
|
color: designSystemTokens.semanticColors.input.bgDisabled
|
|
6403
7048
|
}
|
|
6404
7049
|
},
|
|
7050
|
+
[`& .${Switch.switchClasses.switchBase} .${Switch.switchClasses.input}`]: inputTouchTarget(theme, {
|
|
7051
|
+
heightOnly: true
|
|
7052
|
+
}),
|
|
6405
7053
|
// Thumb
|
|
6406
7054
|
[`& .${Switch.switchClasses.thumb}`]: {
|
|
6407
7055
|
width: config.thumbSize,
|
|
@@ -6464,7 +7112,12 @@ const StyledToggleButton$1 = styles.styled(MuiToggleButton, {
|
|
|
6464
7112
|
({ theme, toggleSize = "medium", toggleVariant = "default" }) => {
|
|
6465
7113
|
const segmented = toggleVariant === "segmented";
|
|
6466
7114
|
return {
|
|
7115
|
+
...touchTarget(theme),
|
|
6467
7116
|
height: sizeStyles[toggleSize].height,
|
|
7117
|
+
// Both sizes grow to a full touch row below md; the type size stays.
|
|
7118
|
+
[theme.breakpoints.down("md")]: {
|
|
7119
|
+
height: TOUCH_TARGET
|
|
7120
|
+
},
|
|
6468
7121
|
padding: `0 ${designSystemTokens.spacing.spacing_1_1_2}px`,
|
|
6469
7122
|
fontFamily: designSystemTokens.typography.fontFamily.body,
|
|
6470
7123
|
fontSize: theme.typography.pxToRem(sizeStyles[toggleSize].fontSize),
|
|
@@ -6510,7 +7163,7 @@ ModToggleButton.displayName = "ModToggleButton";
|
|
|
6510
7163
|
|
|
6511
7164
|
const StyledToggleButtonGroup$1 = styles.styled(MuiToggleButtonGroup, {
|
|
6512
7165
|
shouldForwardProp: (prop) => prop !== "groupVariant"
|
|
6513
|
-
})(({ groupVariant = "default" }) => {
|
|
7166
|
+
})(({ theme, groupVariant = "default" }) => {
|
|
6514
7167
|
const segmented = groupVariant === "segmented";
|
|
6515
7168
|
return {
|
|
6516
7169
|
display: "inline-flex",
|
|
@@ -6524,7 +7177,19 @@ const StyledToggleButtonGroup$1 = styles.styled(MuiToggleButtonGroup, {
|
|
|
6524
7177
|
} : {
|
|
6525
7178
|
borderRadius: designSystemTokens.borderRadius.button,
|
|
6526
7179
|
border: `1px solid ${designSystemTokens.semanticColors.color.border.primary}`,
|
|
6527
|
-
overflow: "hidden"
|
|
7180
|
+
overflow: "hidden",
|
|
7181
|
+
// The clip would cut the buttons' touch targets; round the end buttons to the inner (minus 1px border) radius.
|
|
7182
|
+
[theme.breakpoints.down("md")]: {
|
|
7183
|
+
overflow: "visible",
|
|
7184
|
+
[`& .${MuiToggleButton.toggleButtonClasses.root}:first-of-type`]: {
|
|
7185
|
+
borderTopLeftRadius: designSystemTokens.borderRadius.button - 1,
|
|
7186
|
+
borderBottomLeftRadius: designSystemTokens.borderRadius.button - 1
|
|
7187
|
+
},
|
|
7188
|
+
[`& .${MuiToggleButton.toggleButtonClasses.root}:last-of-type`]: {
|
|
7189
|
+
borderTopRightRadius: designSystemTokens.borderRadius.button - 1,
|
|
7190
|
+
borderBottomRightRadius: designSystemTokens.borderRadius.button - 1
|
|
7191
|
+
}
|
|
7192
|
+
}
|
|
6528
7193
|
},
|
|
6529
7194
|
// Default fuses the children (square inner corners, no gap); segmented
|
|
6530
7195
|
// keeps each button as its own rounded pill.
|
|
@@ -6563,10 +7228,26 @@ const StyledToolbar = styles.styled(xDataGrid.Toolbar)(({ theme }) => ({
|
|
|
6563
7228
|
// 16px
|
|
6564
7229
|
[theme.breakpoints.down("sm")]: {
|
|
6565
7230
|
flexWrap: "wrap"
|
|
7231
|
+
},
|
|
7232
|
+
// Controls are documented as grouped in Boxes; let those groups wrap too.
|
|
7233
|
+
[theme.breakpoints.down("md")]: {
|
|
7234
|
+
rowGap: designSystemTokens.spacing.spacing_1,
|
|
7235
|
+
"& > *": { flexWrap: "wrap" }
|
|
7236
|
+
},
|
|
7237
|
+
// On tablets a group can wrap beside others; they centre on its first line, not on its middle.
|
|
7238
|
+
// Every group is at least one control row tall (the QuickFilter's 44px) and bare controls centre
|
|
7239
|
+
// in it. Phones give the QuickFilter a row of its own, so groups there never share a line.
|
|
7240
|
+
[theme.breakpoints.between("sm", "md")]: {
|
|
7241
|
+
alignItems: "flex-start",
|
|
7242
|
+
"& > div": { minHeight: TOUCH_TARGET },
|
|
7243
|
+
"& > :not(div)": { alignSelf: "center" }
|
|
6566
7244
|
}
|
|
6567
7245
|
}));
|
|
6568
|
-
const ModToolbar = ({ children, ...props }) => {
|
|
6569
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
7246
|
+
const ModToolbar = ({ children, actions, ...props }) => {
|
|
7247
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(StyledToolbar, { ...props, children: [
|
|
7248
|
+
children,
|
|
7249
|
+
/* @__PURE__ */ jsxRuntime.jsx(OverflowActions, { actions })
|
|
7250
|
+
] });
|
|
6570
7251
|
};
|
|
6571
7252
|
ModToolbar.displayName = "ModToolbar";
|
|
6572
7253
|
|
|
@@ -6578,9 +7259,88 @@ const ModTreeItemLabel = (props) => {
|
|
|
6578
7259
|
(item?.statusIcon ?? item?.icon) && /* @__PURE__ */ jsxRuntime.jsx(ItemIcon, { children: item?.statusIcon ?? item?.icon }),
|
|
6579
7260
|
/* @__PURE__ */ jsxRuntime.jsx(ItemLabel, { children }),
|
|
6580
7261
|
item?.secondaryLabel && /* @__PURE__ */ jsxRuntime.jsx(ItemSecondaryLabel, { children: item.secondaryLabel }),
|
|
6581
|
-
item?.endAction && /* @__PURE__ */ jsxRuntime.jsx(ItemEndAction, { children: item.endAction })
|
|
7262
|
+
item?.endAction && /* @__PURE__ */ jsxRuntime.jsx(ItemEndAction, { children: item.endAction }),
|
|
7263
|
+
item?.endActions && item.endActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(ItemEndAction, { children: /* @__PURE__ */ jsxRuntime.jsx(TreeEndActions, { actions: item.endActions }) })
|
|
6582
7264
|
] });
|
|
6583
7265
|
};
|
|
7266
|
+
const stop = (event) => event.stopPropagation();
|
|
7267
|
+
const EndActionButton = styles.styled(ButtonBase)(({ theme }) => ({
|
|
7268
|
+
...touchTarget(theme),
|
|
7269
|
+
color: "inherit",
|
|
7270
|
+
"&:hover": {
|
|
7271
|
+
color: designSystemTokens.semanticColors.color.icon.default
|
|
7272
|
+
},
|
|
7273
|
+
[`&.${ButtonBase.buttonBaseClasses.focusVisible}`]: {
|
|
7274
|
+
outline: `2px solid ${designSystemTokens.semanticColors.color.border.focus}`
|
|
7275
|
+
}
|
|
7276
|
+
}));
|
|
7277
|
+
function TreeEndActions({ actions }) {
|
|
7278
|
+
const compact = useIsCompact();
|
|
7279
|
+
const [anchor, setAnchor] = react.useState(null);
|
|
7280
|
+
const menuId = react.useId();
|
|
7281
|
+
react.useEffect(() => {
|
|
7282
|
+
if (!compact) {
|
|
7283
|
+
setAnchor(null);
|
|
7284
|
+
}
|
|
7285
|
+
}, [compact]);
|
|
7286
|
+
if (!compact || actions.length === 1) {
|
|
7287
|
+
return actions.map((action) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7288
|
+
EndActionButton,
|
|
7289
|
+
{
|
|
7290
|
+
"aria-label": action.label,
|
|
7291
|
+
disabled: action.disabled,
|
|
7292
|
+
onKeyDown: stop,
|
|
7293
|
+
onClick: (event) => {
|
|
7294
|
+
stop(event);
|
|
7295
|
+
action.onClick();
|
|
7296
|
+
},
|
|
7297
|
+
children: action.icon
|
|
7298
|
+
},
|
|
7299
|
+
action.id
|
|
7300
|
+
));
|
|
7301
|
+
}
|
|
7302
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7303
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7304
|
+
EndActionButton,
|
|
7305
|
+
{
|
|
7306
|
+
"aria-label": "More actions",
|
|
7307
|
+
"aria-haspopup": "menu",
|
|
7308
|
+
"aria-expanded": anchor !== null,
|
|
7309
|
+
"aria-controls": anchor ? menuId : void 0,
|
|
7310
|
+
onKeyDown: stop,
|
|
7311
|
+
onClick: (event) => {
|
|
7312
|
+
stop(event);
|
|
7313
|
+
setAnchor(event.currentTarget);
|
|
7314
|
+
},
|
|
7315
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EllipsisVertical, {})
|
|
7316
|
+
}
|
|
7317
|
+
),
|
|
7318
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7319
|
+
ModMenu,
|
|
7320
|
+
{
|
|
7321
|
+
anchorEl: anchor,
|
|
7322
|
+
open: anchor !== null,
|
|
7323
|
+
onClose: () => setAnchor(null),
|
|
7324
|
+
onClick: stop,
|
|
7325
|
+
onKeyDown: stop,
|
|
7326
|
+
slotProps: { list: { id: menuId } },
|
|
7327
|
+
children: actions.map((action) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7328
|
+
ModMenuItem,
|
|
7329
|
+
{
|
|
7330
|
+
icon: action.icon,
|
|
7331
|
+
disabled: action.disabled,
|
|
7332
|
+
onClick: () => {
|
|
7333
|
+
setAnchor(null);
|
|
7334
|
+
action.onClick();
|
|
7335
|
+
},
|
|
7336
|
+
children: action.label
|
|
7337
|
+
},
|
|
7338
|
+
action.id
|
|
7339
|
+
))
|
|
7340
|
+
}
|
|
7341
|
+
)
|
|
7342
|
+
] });
|
|
7343
|
+
}
|
|
6584
7344
|
const ModTreeItem = react.forwardRef(function ModTreeItem2({ slots, slotProps, ...props }, ref) {
|
|
6585
7345
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6586
7346
|
TreeItem.TreeItem,
|
|
@@ -6658,9 +7418,12 @@ const ModTreeView = ({ slots, ...props }) => {
|
|
|
6658
7418
|
ModTreeView.displayName = "ModTreeView";
|
|
6659
7419
|
const CollapseIcon = () => /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { size: 16 });
|
|
6660
7420
|
const ExpandIcon = () => /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { size: 16 });
|
|
6661
|
-
const StyledTreeView = styles.styled(RichTreeViewPro.RichTreeViewPro)({
|
|
7421
|
+
const StyledTreeView = styles.styled(RichTreeViewPro.RichTreeViewPro)(({ theme }) => ({
|
|
6662
7422
|
[`& .${TreeItem.treeItemClasses.content}`]: {
|
|
6663
7423
|
height: 28,
|
|
7424
|
+
[theme.breakpoints.down("md")]: {
|
|
7425
|
+
height: TOUCH_TARGET
|
|
7426
|
+
},
|
|
6664
7427
|
gap: designSystemTokens.spacing.spacing_1_2,
|
|
6665
7428
|
paddingLeft: designSystemTokens.spacing.spacing_1,
|
|
6666
7429
|
paddingRight: designSystemTokens.spacing.spacing_1,
|
|
@@ -6699,7 +7462,7 @@ const StyledTreeView = styles.styled(RichTreeViewPro.RichTreeViewPro)({
|
|
|
6699
7462
|
borderLeft: `1px solid ${designSystemTokens.semanticColors.color.border.primary}`,
|
|
6700
7463
|
marginLeft: designSystemTokens.spacing.spacing_1_1_4
|
|
6701
7464
|
}
|
|
6702
|
-
});
|
|
7465
|
+
}));
|
|
6703
7466
|
|
|
6704
7467
|
const TOGGLE_BUTTON_BORDER_RADIUS = 14;
|
|
6705
7468
|
const StyledToggleButtonGroup = styles.styled(MuiToggleButtonGroup)(({ theme }) => ({
|
|
@@ -6718,11 +7481,22 @@ const StyledToggleButtonGroup = styles.styled(MuiToggleButtonGroup)(({ theme })
|
|
|
6718
7481
|
"&:not(:last-of-type)": {
|
|
6719
7482
|
borderRadius: TOGGLE_BUTTON_BORDER_RADIUS
|
|
6720
7483
|
}
|
|
7484
|
+
},
|
|
7485
|
+
// MUI outlines disabled toggles and its vertical grouping drops each later top edge, which reads
|
|
7486
|
+
// as clipped borders; disabled toggles stay borderless like enabled ones.
|
|
7487
|
+
[theme.breakpoints.down("md")]: {
|
|
7488
|
+
[`& .${MuiToggleButtonGroup.toggleButtonGroupClasses.grouped}.${MuiToggleButton.toggleButtonClasses.disabled}`]: {
|
|
7489
|
+
border: "none"
|
|
7490
|
+
}
|
|
6721
7491
|
}
|
|
6722
7492
|
}));
|
|
6723
7493
|
const StyledToggleButton = styles.styled(MuiToggleButton)(({ theme }) => ({
|
|
6724
7494
|
padding: theme.spacing(0.625),
|
|
6725
7495
|
minWidth: "auto",
|
|
7496
|
+
[theme.breakpoints.down("md")]: {
|
|
7497
|
+
minWidth: TOUCH_TARGET,
|
|
7498
|
+
minHeight: TOUCH_TARGET
|
|
7499
|
+
},
|
|
6726
7500
|
color: designSystemTokens.semanticColors.color.icon.default,
|
|
6727
7501
|
border: "none",
|
|
6728
7502
|
"& svg": {
|
|
@@ -6892,5 +7666,6 @@ exports.focusRingStyles = focusRingStyles;
|
|
|
6892
7666
|
exports.getDataGridHeaderStyles = getDataGridHeaderStyles;
|
|
6893
7667
|
exports.getDataGridRowStyles = getDataGridRowStyles;
|
|
6894
7668
|
exports.modRowHeights = modRowHeights;
|
|
7669
|
+
exports.useIsCompact = useIsCompact;
|
|
6895
7670
|
exports.version = version;
|
|
6896
7671
|
//# sourceMappingURL=index.js.map
|