@moderneinc/design-system-components 7.7.0-alpha.6aac59 → 7.7.0-alpha.734c3e
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 +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { semanticColors, spacing, typography, borderRadius, shadows, iconSize, colors, semanticColorsDark, semanticTypography
|
|
2
|
+
import { semanticColors, spacing, typography, borderRadius, shadows, height, iconSize, colors, semanticColorsDark, semanticTypography } from '@moderneinc/design-system-tokens';
|
|
3
3
|
import Box from '@mui/material/Box';
|
|
4
4
|
import { styled, useTheme, alpha } from '@mui/material/styles';
|
|
5
5
|
import Chip, { chipClasses } from '@mui/material/Chip';
|
|
@@ -7,9 +7,10 @@ import MuiAvatar from '@mui/material/Avatar';
|
|
|
7
7
|
import SvgIcon from '@mui/material/SvgIcon';
|
|
8
8
|
import Alert, { alertClasses } from '@mui/material/Alert';
|
|
9
9
|
import ButtonBase, { buttonBaseClasses } from '@mui/material/ButtonBase';
|
|
10
|
-
import { Info, WifiOff, TriangleAlert, CircleAlert, CircleCheckBig, X, ChevronRight, SquareMinus, SquareCheck, Square, Search, ChevronDown, Plus, Trash2, ArrowUp, ArrowDown, ChevronsUpDown, Columns3, ListFilter, HelpCircle, CalendarDays, Minus, ChevronLeft, AlertCircle, ChevronUp } from 'lucide-react';
|
|
10
|
+
import { Info, WifiOff, TriangleAlert, CircleAlert, CircleCheckBig, X, ChevronRight, SquareMinus, SquareCheck, Square, Search, ChevronDown, Plus, Trash2, ArrowUp, ArrowDown, ChevronsUpDown, Columns3, ListFilter, HelpCircle, CalendarDays, Minus, ChevronLeft, AlertCircle, EllipsisVertical, ChevronUp } from 'lucide-react';
|
|
11
|
+
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
11
12
|
import IconButton, { iconButtonClasses } from '@mui/material/IconButton';
|
|
12
|
-
import { useState, useId, useRef, useCallback, useMemo, forwardRef, useEffect,
|
|
13
|
+
import { useState, useId, useRef, useCallback, useMemo, forwardRef, useEffect, cloneElement, Children, isValidElement, Fragment as Fragment$1, useContext, createContext, useLayoutEffect } from 'react';
|
|
13
14
|
import Breadcrumbs, { breadcrumbsClasses } from '@mui/material/Breadcrumbs';
|
|
14
15
|
import Link from '@mui/material/Link';
|
|
15
16
|
import Button, { buttonClasses } from '@mui/material/Button';
|
|
@@ -18,7 +19,7 @@ import MuiToggleButton, { toggleButtonClasses } from '@mui/material/ToggleButton
|
|
|
18
19
|
import MuiToggleButtonGroup, { toggleButtonGroupClasses } from '@mui/material/ToggleButtonGroup';
|
|
19
20
|
import MuiCard from '@mui/material/Card';
|
|
20
21
|
import Checkbox, { checkboxClasses } from '@mui/material/Checkbox';
|
|
21
|
-
import { gridClasses, useGridApiContext, useGridSelector, gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector, GridFilterPanel, GridPanel, gridPanelClasses, ColumnsPanelTrigger, ToolbarButton, gridFilterModelSelector, FilterPanelTrigger, gridPaginationModelSelector, gridRowCountSelector, gridRowSelectionCountSelector, GridActionsCell,
|
|
22
|
+
import { gridClasses, useGridApiContext, useGridSelector, gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector, GridFilterPanel, GridPanel, gridPanelClasses, ColumnsPanelTrigger, ToolbarButton, gridFilterModelSelector, FilterPanelTrigger, gridPaginationModelSelector, gridRowCountSelector, gridRowSelectionCountSelector, GridActionsCell, QuickFilterControl, QuickFilterClear, QuickFilter, Toolbar } from '@mui/x-data-grid';
|
|
22
23
|
import { useGridApiRef, DataGridPro } from '@mui/x-data-grid-pro';
|
|
23
24
|
import Divider from '@mui/material/Divider';
|
|
24
25
|
import InputAdornment, { inputAdornmentClasses } from '@mui/material/InputAdornment';
|
|
@@ -212,16 +213,24 @@ const ModGeneralAvatar = ({
|
|
|
212
213
|
};
|
|
213
214
|
ModGeneralAvatar.displayName = "ModGeneralAvatar";
|
|
214
215
|
|
|
215
|
-
const CellContentContainer = styled("div")({
|
|
216
|
+
const CellContentContainer = styled("div")(({ theme }) => ({
|
|
216
217
|
display: "flex",
|
|
217
218
|
alignItems: "center",
|
|
218
219
|
gap: spacing.spacing_2,
|
|
219
220
|
minWidth: 0,
|
|
220
221
|
// Allow flex item to shrink below content size
|
|
221
222
|
width: "100%",
|
|
222
|
-
overflow: "hidden"
|
|
223
|
+
overflow: "hidden",
|
|
223
224
|
// Prevent content from overflowing cell boundaries
|
|
224
|
-
|
|
225
|
+
// Still clips sideways, but lets controls' 44px hit areas reach into the row's height and,
|
|
226
|
+
// through a padding the margin cancels, past the content's edge into the cell's padding.
|
|
227
|
+
[theme.breakpoints.down("md")]: {
|
|
228
|
+
overflowX: "clip",
|
|
229
|
+
overflowY: "visible",
|
|
230
|
+
paddingInline: `${spacing.spacing_1}px`,
|
|
231
|
+
marginInline: `-${spacing.spacing_1}px`
|
|
232
|
+
}
|
|
233
|
+
}));
|
|
225
234
|
const ModDataGridCellContent = ({ children, ...props }) => {
|
|
226
235
|
return /* @__PURE__ */ jsx(CellContentContainer, { ...props, children });
|
|
227
236
|
};
|
|
@@ -377,6 +386,45 @@ const ModActivityIndicatorCell = ({
|
|
|
377
386
|
};
|
|
378
387
|
ModActivityIndicatorCell.displayName = "ModActivityIndicatorCell";
|
|
379
388
|
|
|
389
|
+
const TOUCH_TARGET = spacing.spacing_5_1_2;
|
|
390
|
+
const FILL_AVAILABLE = ["-moz-available", "-webkit-fill-available", "stretch"];
|
|
391
|
+
function useIsCompact() {
|
|
392
|
+
const theme = useTheme();
|
|
393
|
+
return useMediaQuery(theme.breakpoints.down("md"));
|
|
394
|
+
}
|
|
395
|
+
function touchTarget(theme, { pseudo = "after" } = {}) {
|
|
396
|
+
return {
|
|
397
|
+
[`&::${pseudo}`]: {
|
|
398
|
+
[theme.breakpoints.down("md")]: {
|
|
399
|
+
content: '""',
|
|
400
|
+
position: "absolute",
|
|
401
|
+
top: "50%",
|
|
402
|
+
left: "50%",
|
|
403
|
+
transform: "translate(-50%, -50%)",
|
|
404
|
+
width: "100%",
|
|
405
|
+
height: "100%",
|
|
406
|
+
minWidth: TOUCH_TARGET,
|
|
407
|
+
minHeight: TOUCH_TARGET
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
function inputTouchTarget(theme, { heightOnly = false } = {}) {
|
|
413
|
+
return {
|
|
414
|
+
[theme.breakpoints.down("md")]: {
|
|
415
|
+
top: "50%",
|
|
416
|
+
height: "100%",
|
|
417
|
+
minHeight: TOUCH_TARGET,
|
|
418
|
+
...heightOnly ? { transform: "translateY(-50%)" } : {
|
|
419
|
+
left: "50%",
|
|
420
|
+
transform: "translate(-50%, -50%)",
|
|
421
|
+
width: "100%",
|
|
422
|
+
minWidth: TOUCH_TARGET
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
|
|
380
428
|
const neutralSmallShadow = `${shadows.neutral.small.x}px ${shadows.neutral.small.y}px ${shadows.neutral.small.blur}px ${shadows.neutral.small.spread}px ${shadows.neutral.small.shadow}`;
|
|
381
429
|
const intentColors$1 = {
|
|
382
430
|
success: semanticColors.color.status.success,
|
|
@@ -448,6 +496,17 @@ const StyledAlert$2 = styled(Alert, {
|
|
|
448
496
|
color: semanticColors.color.text.tooltip,
|
|
449
497
|
[`& .${buttonBaseClasses.root}`]: { color: "inherit" }
|
|
450
498
|
}
|
|
499
|
+
},
|
|
500
|
+
[theme.breakpoints.down("md")]: {
|
|
501
|
+
width: FILL_AVAILABLE,
|
|
502
|
+
// A wrapped default alert grows instead of scrolling inside its fixed 64px.
|
|
503
|
+
...!isCompact && !hasChildren && {
|
|
504
|
+
height: "auto",
|
|
505
|
+
minHeight: spacing.spacing_8 - spacing.spacing_1_1_2 * 2,
|
|
506
|
+
paddingTop: spacing.spacing_1_1_2,
|
|
507
|
+
paddingBottom: spacing.spacing_1_1_2
|
|
508
|
+
},
|
|
509
|
+
[`& .${alertClasses.message}`]: { overflowWrap: "anywhere" }
|
|
451
510
|
}
|
|
452
511
|
};
|
|
453
512
|
}
|
|
@@ -552,26 +611,51 @@ const StyledAlert$1 = styled(Alert, {
|
|
|
552
611
|
}
|
|
553
612
|
};
|
|
554
613
|
});
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
614
|
+
const ResponsiveAlert = styled(StyledAlert$1, {
|
|
615
|
+
shouldForwardProp: (prop) => prop !== "hasControls"
|
|
616
|
+
})(
|
|
617
|
+
({ theme, messagePosition = "left", hasControls = false }) => hasControls && {
|
|
618
|
+
[theme.breakpoints.down("md")]: {
|
|
619
|
+
minHeight: height.button.large,
|
|
620
|
+
...messagePosition === "center" && { justifyContent: "flex-start" },
|
|
621
|
+
[`& .${alertClasses.message}`]: {
|
|
622
|
+
// MUI's message scrolls (overflow: auto), which would clip the link's hit area.
|
|
623
|
+
overflow: "visible",
|
|
624
|
+
overflowWrap: "anywhere",
|
|
625
|
+
...messagePosition === "center" && { flex: 1, "& > svg": { flexShrink: 0 } }
|
|
626
|
+
},
|
|
627
|
+
[`& .${alertClasses.action}`]: {
|
|
628
|
+
paddingLeft: spacing.spacing_1_2,
|
|
629
|
+
...messagePosition === "center" && { position: "static" }
|
|
630
|
+
}
|
|
631
|
+
}
|
|
563
632
|
}
|
|
564
|
-
|
|
633
|
+
);
|
|
634
|
+
const LinkText = styled("span")(
|
|
635
|
+
({ theme, bannerType = "outlined" }) => ({
|
|
636
|
+
marginLeft: "auto",
|
|
637
|
+
fontWeight: typography.fontWeight.semiBold,
|
|
638
|
+
color: bannerType === "filled" ? semanticColors.color.text.linkOnBrand : semanticColors.color.text.link,
|
|
639
|
+
cursor: "pointer",
|
|
640
|
+
whiteSpace: "nowrap",
|
|
641
|
+
"&:hover": {
|
|
642
|
+
textDecoration: "underline"
|
|
643
|
+
},
|
|
644
|
+
...touchTarget(theme),
|
|
645
|
+
[theme.breakpoints.down("md")]: { position: "relative" }
|
|
646
|
+
})
|
|
647
|
+
);
|
|
565
648
|
const StyledIconButton = styled(IconButton, {
|
|
566
649
|
shouldForwardProp: (prop) => prop !== "closeIconColor"
|
|
567
|
-
})(({ closeIconColor }) => ({
|
|
650
|
+
})(({ theme, closeIconColor }) => ({
|
|
568
651
|
minWidth: 24,
|
|
569
652
|
minHeight: 24,
|
|
570
653
|
padding: 0,
|
|
571
654
|
color: closeIconColor,
|
|
572
655
|
"&:hover": {
|
|
573
656
|
backgroundColor: "transparent"
|
|
574
|
-
}
|
|
657
|
+
},
|
|
658
|
+
...touchTarget(theme)
|
|
575
659
|
}));
|
|
576
660
|
const ModBanner = ({
|
|
577
661
|
intent = "info",
|
|
@@ -595,12 +679,13 @@ const ModBanner = ({
|
|
|
595
679
|
}
|
|
596
680
|
const closeIconColor = type === "filled" ? semanticColors.color.surface.raised : intentColors[intent].solid;
|
|
597
681
|
return /* @__PURE__ */ jsx(
|
|
598
|
-
|
|
682
|
+
ResponsiveAlert,
|
|
599
683
|
{
|
|
600
684
|
...props,
|
|
601
685
|
intent,
|
|
602
686
|
bannerType: type,
|
|
603
687
|
messagePosition,
|
|
688
|
+
hasControls: showClose || Boolean(linkText),
|
|
604
689
|
icon: messagePosition === "left" ? icon || false : false,
|
|
605
690
|
action: showClose ? /* @__PURE__ */ jsx(StyledIconButton, { size: "small", onClick: handleClose, closeIconColor, children: /* @__PURE__ */ jsx(X, { size: 16 }) }) : void 0,
|
|
606
691
|
children: messagePosition === "center" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -616,18 +701,25 @@ const ModBanner = ({
|
|
|
616
701
|
};
|
|
617
702
|
ModBanner.displayName = "ModBanner";
|
|
618
703
|
|
|
619
|
-
const
|
|
704
|
+
const ITEM = `.${breadcrumbsClasses.li}`;
|
|
705
|
+
const FULL_TRAIL = `.${breadcrumbsClasses.ol}:not(:has(> li > .${buttonBaseClasses.root})):has(> ${ITEM} ~ ${ITEM} ~ ${ITEM})`;
|
|
706
|
+
const StyledBreadcrumbs = styled(Breadcrumbs)(({ theme }) => ({
|
|
620
707
|
[`& .${breadcrumbsClasses.separator}`]: {
|
|
621
708
|
margin: 0,
|
|
622
709
|
color: semanticColors.color.icon.utility
|
|
623
710
|
},
|
|
624
711
|
[`& .${breadcrumbsClasses.ol}`]: {
|
|
625
712
|
gap: spacing.spacing_1
|
|
626
|
-
}
|
|
713
|
+
},
|
|
714
|
+
[`& ${FULL_TRAIL}`]: {
|
|
715
|
+
[theme.breakpoints.down("md")]: { rowGap: spacing.spacing_4 }
|
|
716
|
+
},
|
|
717
|
+
// The "…" that expands a collapsed trail.
|
|
718
|
+
[`& .${breadcrumbsClasses.ol} > li > .${buttonBaseClasses.root}`]: touchTarget(theme)
|
|
627
719
|
}));
|
|
628
720
|
const StyledBreadcrumbLink = styled(Link, {
|
|
629
721
|
shouldForwardProp: (prop) => prop !== "current"
|
|
630
|
-
})(({ current = false }) => ({
|
|
722
|
+
})(({ theme, current = false }) => ({
|
|
631
723
|
fontSize: typography.fontSize.sm,
|
|
632
724
|
fontWeight: typography.fontWeight.medium,
|
|
633
725
|
lineHeight: 1,
|
|
@@ -642,7 +734,9 @@ const StyledBreadcrumbLink = styled(Link, {
|
|
|
642
734
|
"&:focus-visible": {
|
|
643
735
|
outline: `2px solid ${semanticColors.color.border.focus}`,
|
|
644
736
|
outlineOffset: 2
|
|
645
|
-
}
|
|
737
|
+
},
|
|
738
|
+
...touchTarget(theme),
|
|
739
|
+
[theme.breakpoints.down("md")]: { position: "relative" }
|
|
646
740
|
}));
|
|
647
741
|
function ModBreadcrumbLink({
|
|
648
742
|
current = false,
|
|
@@ -663,14 +757,17 @@ function ModBreadcrumbLink({
|
|
|
663
757
|
);
|
|
664
758
|
}
|
|
665
759
|
function ModBreadcrumbs({ children, className }) {
|
|
760
|
+
const compact = useIsCompact();
|
|
666
761
|
return /* @__PURE__ */ jsx(
|
|
667
762
|
StyledBreadcrumbs,
|
|
668
763
|
{
|
|
764
|
+
...compact && { maxItems: 3, itemsBeforeCollapse: 0, itemsAfterCollapse: 2 },
|
|
669
765
|
separator: /* @__PURE__ */ jsx(ChevronRight, { size: 10.67, color: semanticColors.color.icon.utility }),
|
|
670
766
|
className,
|
|
671
767
|
"aria-label": "breadcrumb",
|
|
672
768
|
children
|
|
673
|
-
}
|
|
769
|
+
},
|
|
770
|
+
compact ? "compact" : "full"
|
|
674
771
|
);
|
|
675
772
|
}
|
|
676
773
|
|
|
@@ -709,6 +806,7 @@ const StyledButton = styled(Button, {
|
|
|
709
806
|
position: "relative",
|
|
710
807
|
minWidth: "fit-content",
|
|
711
808
|
gap: spacing.spacing_1,
|
|
809
|
+
...touchTarget(theme),
|
|
712
810
|
// `gap` spaces the icons; MUI's slot margins would add to it
|
|
713
811
|
[`& .${buttonClasses.startIcon}, & .${buttonClasses.endIcon}`]: {
|
|
714
812
|
margin: 0
|
|
@@ -895,6 +993,7 @@ function ModButton({
|
|
|
895
993
|
ModButton.displayName = "ModButton";
|
|
896
994
|
|
|
897
995
|
const StyledButtonTab = styled(MuiToggleButton)(({ theme }) => ({
|
|
996
|
+
...touchTarget(theme),
|
|
898
997
|
fontFamily: typography.fontFamily.body,
|
|
899
998
|
fontSize: theme.typography.pxToRem(typography.fontSize.sm),
|
|
900
999
|
lineHeight: 1,
|
|
@@ -963,8 +1062,11 @@ const StyledButtonTabGroup = styled(MuiToggleButtonGroup)(({ theme, size = "medi
|
|
|
963
1062
|
borderRadius: borderRadius.button,
|
|
964
1063
|
border: `1px solid ${semanticColors.color.border.primary}`,
|
|
965
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" },
|
|
966
1067
|
// Style all grouped children
|
|
967
1068
|
[`& .${toggleButtonGroupClasses.grouped}`]: {
|
|
1069
|
+
...touchTarget(theme),
|
|
968
1070
|
flex: 1,
|
|
969
1071
|
minWidth: "auto",
|
|
970
1072
|
height: sizeStyles[size].height,
|
|
@@ -1000,12 +1102,20 @@ const StyledButtonTabGroup = styled(MuiToggleButtonGroup)(({ theme, size = "medi
|
|
|
1000
1102
|
// First button: rounded left edge
|
|
1001
1103
|
[`&.${toggleButtonGroupClasses.firstButton}`]: {
|
|
1002
1104
|
borderTopLeftRadius: borderRadius.button,
|
|
1003
|
-
borderBottomLeftRadius: borderRadius.button
|
|
1105
|
+
borderBottomLeftRadius: borderRadius.button,
|
|
1106
|
+
[theme.breakpoints.down("md")]: {
|
|
1107
|
+
borderTopLeftRadius: borderRadius.button - 1,
|
|
1108
|
+
borderBottomLeftRadius: borderRadius.button - 1
|
|
1109
|
+
}
|
|
1004
1110
|
},
|
|
1005
1111
|
// Last button: rounded right edge, no right border
|
|
1006
1112
|
[`&.${toggleButtonGroupClasses.lastButton}`]: {
|
|
1007
1113
|
borderTopRightRadius: borderRadius.button,
|
|
1008
1114
|
borderBottomRightRadius: borderRadius.button,
|
|
1115
|
+
[theme.breakpoints.down("md")]: {
|
|
1116
|
+
borderTopRightRadius: borderRadius.button - 1,
|
|
1117
|
+
borderBottomRightRadius: borderRadius.button - 1
|
|
1118
|
+
},
|
|
1009
1119
|
borderRight: "none"
|
|
1010
1120
|
},
|
|
1011
1121
|
// Disabled state
|
|
@@ -1127,7 +1237,7 @@ const SmallDescription = styled("p")(({ theme }) => ({
|
|
|
1127
1237
|
}));
|
|
1128
1238
|
const LargeStyledCard = styled(MuiCard, {
|
|
1129
1239
|
shouldForwardProp: (prop) => prop !== "disabled" && prop !== "cardTheme"
|
|
1130
|
-
})(({ disabled = false, cardTheme = "light" }) => {
|
|
1240
|
+
})(({ theme, disabled = false, cardTheme = "light" }) => {
|
|
1131
1241
|
const isLight = cardTheme === "light";
|
|
1132
1242
|
const activeBorderColor = isLight ? semanticColors.button.primary.bg : colors.digitalGreen[300];
|
|
1133
1243
|
const defaultBorderColor = isLight ? semanticColors.color.border.primary : semanticColorsDark.color.border.primary;
|
|
@@ -1162,6 +1272,12 @@ const LargeStyledCard = styled(MuiCard, {
|
|
|
1162
1272
|
opacity: 0.5,
|
|
1163
1273
|
pointerEvents: "none",
|
|
1164
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
|
|
1165
1281
|
}
|
|
1166
1282
|
};
|
|
1167
1283
|
});
|
|
@@ -1210,12 +1326,17 @@ const LargeDescription = styled("p", {
|
|
|
1210
1326
|
minWidth: "100%",
|
|
1211
1327
|
wordWrap: "break-word"
|
|
1212
1328
|
}));
|
|
1213
|
-
const LargeButtonsRow = styled("div")({
|
|
1329
|
+
const LargeButtonsRow = styled("div")(({ theme }) => ({
|
|
1214
1330
|
display: "flex",
|
|
1215
1331
|
gap: spacing.spacing_3,
|
|
1216
1332
|
alignItems: "flex-start",
|
|
1217
|
-
flexShrink: 0
|
|
1218
|
-
|
|
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: spacing.spacing_1_1_2
|
|
1338
|
+
}
|
|
1339
|
+
}));
|
|
1219
1340
|
const SmallCardImpl = ({
|
|
1220
1341
|
logo,
|
|
1221
1342
|
recipeCount,
|
|
@@ -1328,7 +1449,7 @@ const HelperText$2 = styled("span")(({ theme, size = "medium" }) => ({
|
|
|
1328
1449
|
const XS_FOCUS_RING_RADIUS = 1;
|
|
1329
1450
|
const StyledCheckbox = styled(Checkbox, {
|
|
1330
1451
|
shouldForwardProp: (prop) => prop !== "size"
|
|
1331
|
-
})(({ size = "medium" }) => {
|
|
1452
|
+
})(({ theme, size = "medium" }) => {
|
|
1332
1453
|
const sizeConfig = {
|
|
1333
1454
|
xs: {
|
|
1334
1455
|
size: 12,
|
|
@@ -1389,7 +1510,8 @@ const StyledCheckbox = styled(Checkbox, {
|
|
|
1389
1510
|
"& svg": {
|
|
1390
1511
|
width: config.size,
|
|
1391
1512
|
height: config.size
|
|
1392
|
-
}
|
|
1513
|
+
},
|
|
1514
|
+
"& input": inputTouchTarget(theme)
|
|
1393
1515
|
};
|
|
1394
1516
|
});
|
|
1395
1517
|
const ModCheckbox = ({
|
|
@@ -1447,6 +1569,18 @@ const ModCheckboxWithText = ({ size = "small", ...props }) => {
|
|
|
1447
1569
|
};
|
|
1448
1570
|
ModCheckboxWithText.displayName = "ModCheckboxWithText";
|
|
1449
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
|
+
};
|
|
1450
1584
|
const StyledButtonBase = styled(ButtonBase, {
|
|
1451
1585
|
shouldForwardProp: (prop) => prop !== "isMultiline" && prop !== "variant" && prop !== "size"
|
|
1452
1586
|
})(({ theme, variant = "outlined", size = "small", isMultiline = false }) => {
|
|
@@ -1532,7 +1666,8 @@ const StyledButtonBase = styled(ButtonBase, {
|
|
|
1532
1666
|
};
|
|
1533
1667
|
return {
|
|
1534
1668
|
...baseStyles,
|
|
1535
|
-
...variantStyles[variant]
|
|
1669
|
+
...variantStyles[variant],
|
|
1670
|
+
...compactStyles(theme, size, isMultiline)
|
|
1536
1671
|
};
|
|
1537
1672
|
});
|
|
1538
1673
|
const IconWrapper$2 = styled("span")(({ isMultiline }) => ({
|
|
@@ -1872,6 +2007,9 @@ const StyledMenuItem = styled(MenuItem)(({ theme }) => ({
|
|
|
1872
2007
|
paddingLeft: spacing.spacing_2,
|
|
1873
2008
|
paddingRight: spacing.spacing_2,
|
|
1874
2009
|
minHeight: spacing.spacing_5,
|
|
2010
|
+
[theme.breakpoints.down("md")]: {
|
|
2011
|
+
minHeight: TOUCH_TARGET
|
|
2012
|
+
},
|
|
1875
2013
|
gap: spacing.spacing_2,
|
|
1876
2014
|
borderRadius: 0,
|
|
1877
2015
|
color: semanticColors.color.icon.default,
|
|
@@ -1978,7 +2116,7 @@ const ChevronDownIcon = (props) => /* @__PURE__ */ jsx(
|
|
|
1978
2116
|
style: { ...props.style }
|
|
1979
2117
|
}
|
|
1980
2118
|
);
|
|
1981
|
-
const StyledSelect = styled(MuiSelect)({
|
|
2119
|
+
const StyledSelect = styled(MuiSelect)(({ theme }) => ({
|
|
1982
2120
|
minHeight: spacing.spacing_5,
|
|
1983
2121
|
backgroundColor: semanticColors.input.bg,
|
|
1984
2122
|
border: `1px solid ${semanticColors.color.border.primary}`,
|
|
@@ -2006,10 +2144,18 @@ const StyledSelect = styled(MuiSelect)({
|
|
|
2006
2144
|
fontWeight: typography.fontWeight.regular,
|
|
2007
2145
|
color: semanticColors.color.text.input
|
|
2008
2146
|
},
|
|
2147
|
+
// Doubled `&` outranks MUI's own `.MuiSelect-select` rules, which are inserted after these.
|
|
2148
|
+
[`&& .${selectClasses.select}`]: {
|
|
2149
|
+
[theme.breakpoints.down("md")]: {
|
|
2150
|
+
lineHeight: `${TOUCH_TARGET - 2 * 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
|
+
},
|
|
2009
2155
|
[`& .${selectClasses.icon}`]: {
|
|
2010
2156
|
right: spacing.spacing_1_1_2
|
|
2011
2157
|
}
|
|
2012
|
-
});
|
|
2158
|
+
}));
|
|
2013
2159
|
const ModSelect = (props) => /* @__PURE__ */ jsx(
|
|
2014
2160
|
StyledSelect,
|
|
2015
2161
|
{
|
|
@@ -2043,7 +2189,7 @@ const ModDataGridFilterPanelDeleteIcon = () => /* @__PURE__ */ jsx(X, { size: sp
|
|
|
2043
2189
|
ModDataGridFilterPanelDeleteIcon.displayName = "ModDataGridFilterPanelDeleteIcon";
|
|
2044
2190
|
const ModDataGridFilterPanelRemoveAllIcon = () => /* @__PURE__ */ jsx(Trash2, { size: spacing.spacing_2, color: semanticColors.button.tertiary.fg });
|
|
2045
2191
|
ModDataGridFilterPanelRemoveAllIcon.displayName = "ModDataGridFilterPanelRemoveAllIcon";
|
|
2046
|
-
const StyledGridFilterPanel = styled(GridFilterPanel)({
|
|
2192
|
+
const StyledGridFilterPanel = styled(GridFilterPanel)(({ theme }) => ({
|
|
2047
2193
|
...panelSurfaceStyles,
|
|
2048
2194
|
// Panel padding (12px top, 16px right/bottom/left)
|
|
2049
2195
|
paddingTop: spacing.spacing_2,
|
|
@@ -2167,6 +2313,7 @@ const StyledGridFilterPanel = styled(GridFilterPanel)({
|
|
|
2167
2313
|
// Buttons - design system styling
|
|
2168
2314
|
// Add filter button (first button)
|
|
2169
2315
|
[`& .${gridClasses.panelFooter} .${buttonClasses.root}:first-child`]: {
|
|
2316
|
+
...touchTarget(theme),
|
|
2170
2317
|
textTransform: "none",
|
|
2171
2318
|
fontSize: typography.fontSize.sm,
|
|
2172
2319
|
fontWeight: typography.fontWeight.medium,
|
|
@@ -2189,6 +2336,7 @@ const StyledGridFilterPanel = styled(GridFilterPanel)({
|
|
|
2189
2336
|
},
|
|
2190
2337
|
// Clear all button (second button) - styled to match ModButton link variant
|
|
2191
2338
|
[`& .${gridClasses.panelFooter} .${buttonClasses.root}:nth-child(2)`]: {
|
|
2339
|
+
...touchTarget(theme),
|
|
2192
2340
|
height: 32,
|
|
2193
2341
|
// ModButton small size
|
|
2194
2342
|
padding: `0 ${spacing.spacing_1}px`,
|
|
@@ -2218,8 +2366,41 @@ const StyledGridFilterPanel = styled(GridFilterPanel)({
|
|
|
2218
2366
|
},
|
|
2219
2367
|
[`& .${gridClasses.filterForm} .${iconButtonClasses.root}:hover`]: {
|
|
2220
2368
|
backgroundColor: 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
|
+
[`& .${gridClasses.filterForm}`]: {
|
|
2373
|
+
width: "100%"
|
|
2374
|
+
},
|
|
2375
|
+
[`& .MuiFormControl-root:has(.${gridClasses.filterFormColumnInput}), & .MuiFormControl-root:has(.${gridClasses.filterFormOperatorInput}), & .${gridClasses.filterFormValueInput}`]: {
|
|
2376
|
+
flex: "1 1 0",
|
|
2377
|
+
minWidth: 0
|
|
2378
|
+
},
|
|
2379
|
+
[`& .${gridClasses.filterForm} .${inputBaseClasses.root}, & .${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
|
+
[`& .${gridClasses.filterForm}`]: {
|
|
2387
|
+
flexWrap: "wrap",
|
|
2388
|
+
rowGap: spacing.spacing_1_1_2
|
|
2389
|
+
},
|
|
2390
|
+
[`& .MuiFormControl-root:has(.${gridClasses.filterFormLogicOperatorInput})`]: {
|
|
2391
|
+
order: -1
|
|
2392
|
+
},
|
|
2393
|
+
[`& .${gridClasses.filterFormDeleteIcon}`]: {
|
|
2394
|
+
marginLeft: "auto",
|
|
2395
|
+
marginRight: 0
|
|
2396
|
+
},
|
|
2397
|
+
[`& .MuiFormControl-root:has(.${gridClasses.filterFormColumnInput}), & .MuiFormControl-root:has(.${gridClasses.filterFormOperatorInput}), & .${gridClasses.filterFormValueInput}`]: {
|
|
2398
|
+
flex: "1 1 100%",
|
|
2399
|
+
width: "100%",
|
|
2400
|
+
marginLeft: 0
|
|
2401
|
+
}
|
|
2221
2402
|
}
|
|
2222
|
-
});
|
|
2403
|
+
}));
|
|
2223
2404
|
StyledGridFilterPanel.displayName = "StyledGridFilterPanel";
|
|
2224
2405
|
const ModDataGridSelect = forwardRef(function ModDataGridSelect2({
|
|
2225
2406
|
id,
|
|
@@ -2288,11 +2469,38 @@ function UnsortedIcon() {
|
|
|
2288
2469
|
return /* @__PURE__ */ jsx(ChevronsUpDown, { size: 16, color: semanticColors.color.icon.utility });
|
|
2289
2470
|
}
|
|
2290
2471
|
|
|
2291
|
-
const
|
|
2472
|
+
const COMPACT_MIN_COLUMN_WIDTH = 120;
|
|
2473
|
+
const ModGridPanel = styled(GridPanel)(({ theme }) => ({
|
|
2292
2474
|
[`& .${gridPanelClasses.paper}`]: {
|
|
2293
2475
|
backgroundColor: 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
|
+
[`& .${gridPanelClasses.paper}`]: {
|
|
2483
|
+
width: "100%",
|
|
2484
|
+
maxWidth: "100%",
|
|
2485
|
+
maxHeight: "80vh",
|
|
2486
|
+
flexDirection: "column",
|
|
2487
|
+
overflowY: "auto",
|
|
2488
|
+
borderRadius: `${borderRadius.m}px ${borderRadius.m}px 0 0`,
|
|
2489
|
+
// The drawer shadow, flipped to cast upward from the bottom edge.
|
|
2490
|
+
boxShadow: `0 -${shadows.drawer.y}px ${shadows.drawer.blur}px ${shadows.drawer.spread}px ${shadows.drawer.shadow}`,
|
|
2491
|
+
"&::before": {
|
|
2492
|
+
content: '""',
|
|
2493
|
+
display: "block",
|
|
2494
|
+
flexShrink: 0,
|
|
2495
|
+
width: spacing.spacing_4,
|
|
2496
|
+
height: spacing.spacing_1_2,
|
|
2497
|
+
margin: `${spacing.spacing_1}px auto 0`,
|
|
2498
|
+
borderRadius: borderRadius.full,
|
|
2499
|
+
backgroundColor: semanticColors.color.border.strong
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2294
2502
|
}
|
|
2295
|
-
});
|
|
2503
|
+
}));
|
|
2296
2504
|
const DataGridCheckbox = ({
|
|
2297
2505
|
slotProps,
|
|
2298
2506
|
...props
|
|
@@ -2309,10 +2517,33 @@ function ModDataGrid({
|
|
|
2309
2517
|
toolbar,
|
|
2310
2518
|
slots,
|
|
2311
2519
|
sx,
|
|
2312
|
-
density
|
|
2520
|
+
density: densityProp,
|
|
2313
2521
|
slotProps: userSlotProps,
|
|
2522
|
+
columns: columnsProp,
|
|
2314
2523
|
...props
|
|
2315
2524
|
}) {
|
|
2525
|
+
const theme = useTheme();
|
|
2526
|
+
const compact = useIsCompact();
|
|
2527
|
+
const density = densityProp ?? (compact ? "comfortable" : "standard");
|
|
2528
|
+
const columns = 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
|
+
);
|
|
2316
2547
|
const defaultApiRef = useGridApiRef();
|
|
2317
2548
|
const apiRef = props?.apiRef ? props.apiRef : defaultApiRef;
|
|
2318
2549
|
const mergedSlots = {
|
|
@@ -2330,6 +2561,9 @@ function ModDataGrid({
|
|
|
2330
2561
|
// Add toolbar slot if toolbar prop is provided (overrides slots.toolbar if both exist)
|
|
2331
2562
|
...toolbar ? { toolbar: () => toolbar } : {}
|
|
2332
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 : {};
|
|
2333
2567
|
const baseSx = {
|
|
2334
2568
|
// Fix for MUI X 8.15.0+ scroll shadow issue - backgroundColor must be on main, not root
|
|
2335
2569
|
// See: https://github.com/mui/mui-x/issues/20107
|
|
@@ -2354,6 +2588,61 @@ function ModDataGrid({
|
|
|
2354
2588
|
backgroundColor: semanticColors.color.surface.dataGrid.default
|
|
2355
2589
|
},
|
|
2356
2590
|
...getDataGridHeaderStyles({ resizable: !props.disableColumnResize }),
|
|
2591
|
+
[`& .${gridClasses.menuIconButton}`]: touchTarget(theme),
|
|
2592
|
+
// Covers `type: 'actions'` columns built with getActions, which bypass ModActionsCell.
|
|
2593
|
+
[`& .${gridClasses.actionsCell} .${iconButtonClasses.root}`]: touchTarget(theme),
|
|
2594
|
+
// On touch the filter icon is an indicator too and filters open from the column menu; a mouse in a
|
|
2595
|
+
// narrow window keeps clicking it. MUI gives the filter button no class of its own.
|
|
2596
|
+
[`${theme.breakpoints.down("md")} and (pointer: coarse)`]: {
|
|
2597
|
+
[`& button:has(> .${gridClasses.filterIcon})`]: { pointerEvents: "none" }
|
|
2598
|
+
},
|
|
2599
|
+
[compactQuery]: {
|
|
2600
|
+
maxWidth: "100%",
|
|
2601
|
+
// Spaces adjacent row actions so their 44px hit areas don't overlap.
|
|
2602
|
+
[`& .${gridClasses.actionsCell}`]: { columnGap: `${spacing.spacing_2}px` },
|
|
2603
|
+
// A tap on the header sorts; the sort icon only shows the direction, leaving the room to the column menu.
|
|
2604
|
+
[`& .${gridClasses.sortButton}`]: {
|
|
2605
|
+
pointerEvents: "none"
|
|
2606
|
+
},
|
|
2607
|
+
// The header is tall enough below md for the select-all checkbox's hit area; stop clipping it.
|
|
2608
|
+
[`& .${gridClasses.columnHeaderCheckbox} .${gridClasses.columnHeaderTitleContainerContent}`]: {
|
|
2609
|
+
overflow: "visible"
|
|
2610
|
+
},
|
|
2611
|
+
// The checkbox column doesn't resize, so its separator is decoration; let taps pass through.
|
|
2612
|
+
[`& .${gridClasses.columnHeaderCheckbox} .${gridClasses.columnSeparator}`]: {
|
|
2613
|
+
pointerEvents: "none"
|
|
2614
|
+
},
|
|
2615
|
+
// Narrow columns keep room for their label: a tighter gutter on the title's side (cells below
|
|
2616
|
+
// match), while the menu side keeps its gutter so the menu's hit area clears the separator; a
|
|
2617
|
+
// header without a menu matches its cells on both sides. `:where` keeps this at the gutter rule's
|
|
2618
|
+
// specificity, so a consumer's own padding for that column still wins.
|
|
2619
|
+
// The sort slot takes no width while its icon is hidden, as in MUI's own default.
|
|
2620
|
+
[`& .${gridClasses.columnHeader}:not(.${gridClasses.columnHeaderCheckbox})`]: {
|
|
2621
|
+
paddingLeft: `${spacing.spacing_2}px`
|
|
2622
|
+
},
|
|
2623
|
+
[`& .${gridClasses.columnHeader}:not(.${gridClasses.columnHeaderCheckbox}):where(:not(:has(.${gridClasses.menuIcon})))`]: {
|
|
2624
|
+
paddingRight: `${spacing.spacing_2}px`
|
|
2625
|
+
},
|
|
2626
|
+
[`& .${gridClasses.columnHeader}.${gridClasses["columnHeader--alignRight"]}`]: {
|
|
2627
|
+
paddingLeft: `${spacing.spacing_3}px`,
|
|
2628
|
+
paddingRight: `${spacing.spacing_2}px`
|
|
2629
|
+
},
|
|
2630
|
+
[`& .${gridClasses.columnHeader}:not(.${gridClasses["columnHeader--sorted"]}):not(:hover) .${gridClasses.iconButtonContainer}:has(.${gridClasses.sortButton})`]: {
|
|
2631
|
+
width: 0,
|
|
2632
|
+
marginLeft: 0
|
|
2633
|
+
},
|
|
2634
|
+
// Carry the header band across the filler past the last column, over the body-coloured filler rule.
|
|
2635
|
+
[`&& .${gridClasses.columnHeaders} .${gridClasses.filler}, && .${gridClasses.columnHeaders} .${gridClasses.scrollbarFiller}`]: {
|
|
2636
|
+
backgroundColor: semanticColors.color.surface.dataGrid.header,
|
|
2637
|
+
borderBottomColor: semanticColors.color.border.primary
|
|
2638
|
+
},
|
|
2639
|
+
// Two classes so this outranks the base cell padding declared further down.
|
|
2640
|
+
[`& .${gridClasses.row} .${gridClasses.cell}`]: {
|
|
2641
|
+
paddingLeft: `${spacing.spacing_2}px`,
|
|
2642
|
+
paddingRight: `${spacing.spacing_2}px`
|
|
2643
|
+
},
|
|
2644
|
+
...typeof consumerCompact === "function" ? consumerCompact(theme) : consumerCompact
|
|
2645
|
+
},
|
|
2357
2646
|
...getDataGridRowStyles(),
|
|
2358
2647
|
border: `1px solid ${semanticColors.color.border.primary}`,
|
|
2359
2648
|
// Target `& svg` (not `.MuiSvgIcon-root`) to match the lucide icons
|
|
@@ -2384,13 +2673,14 @@ function ModDataGrid({
|
|
|
2384
2673
|
wordBreak: "break-word",
|
|
2385
2674
|
hyphens: "auto"
|
|
2386
2675
|
},
|
|
2387
|
-
...sx
|
|
2676
|
+
...plainSx ? restSx : sx
|
|
2388
2677
|
};
|
|
2389
2678
|
return /* @__PURE__ */ jsx(
|
|
2390
2679
|
DataGridPro,
|
|
2391
2680
|
{
|
|
2392
2681
|
apiRef,
|
|
2393
|
-
|
|
2682
|
+
columns,
|
|
2683
|
+
columnHeaderHeight: compact ? height.button.large : height.table.header,
|
|
2394
2684
|
autoHeight,
|
|
2395
2685
|
autoPageSize: !autoHeight,
|
|
2396
2686
|
getRowHeight: () => "auto",
|
|
@@ -2664,6 +2954,7 @@ const StyledNavButton = styled(IconButton, {
|
|
|
2664
2954
|
color: semanticColors.button.primary.bgPressed
|
|
2665
2955
|
};
|
|
2666
2956
|
return {
|
|
2957
|
+
...touchTarget(theme),
|
|
2667
2958
|
width: sizeStyles.width,
|
|
2668
2959
|
height: sizeStyles.height,
|
|
2669
2960
|
padding: sizeStyles.padding,
|
|
@@ -2909,10 +3200,12 @@ const ModDatePicker = ({
|
|
|
2909
3200
|
size: "small"
|
|
2910
3201
|
},
|
|
2911
3202
|
openPickerButton: {
|
|
2912
|
-
size: "small"
|
|
3203
|
+
size: "small",
|
|
3204
|
+
sx: (theme) => touchTarget(theme)
|
|
2913
3205
|
},
|
|
2914
3206
|
clearButton: {
|
|
2915
|
-
size: "small"
|
|
3207
|
+
size: "small",
|
|
3208
|
+
sx: (theme) => touchTarget(theme)
|
|
2916
3209
|
}
|
|
2917
3210
|
};
|
|
2918
3211
|
if (type === "range") {
|
|
@@ -3088,15 +3381,16 @@ const StyledLinearProgress$1 = styled(LinearProgress)({
|
|
|
3088
3381
|
borderRadius: `${borderRadius.xS}px 0 0 ${borderRadius.xS}px`
|
|
3089
3382
|
}
|
|
3090
3383
|
});
|
|
3091
|
-
const ActionButton = styled(IconButton)({
|
|
3384
|
+
const ActionButton = styled(IconButton)(({ theme }) => ({
|
|
3092
3385
|
padding: 0,
|
|
3093
3386
|
width: spacing.spacing_2,
|
|
3094
3387
|
height: spacing.spacing_2,
|
|
3095
3388
|
color: semanticColors.color.icon.utility,
|
|
3096
3389
|
"&:hover": {
|
|
3097
3390
|
backgroundColor: "transparent"
|
|
3098
|
-
}
|
|
3099
|
-
|
|
3391
|
+
},
|
|
3392
|
+
...touchTarget(theme)
|
|
3393
|
+
}));
|
|
3100
3394
|
const ModDownloadToast = ({
|
|
3101
3395
|
title,
|
|
3102
3396
|
fileName,
|
|
@@ -3116,10 +3410,22 @@ const ModDownloadToast = ({
|
|
|
3116
3410
|
if (!hasActions) {
|
|
3117
3411
|
return null;
|
|
3118
3412
|
}
|
|
3119
|
-
return /* @__PURE__ */ jsxs(
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3413
|
+
return /* @__PURE__ */ jsxs(
|
|
3414
|
+
Stack,
|
|
3415
|
+
{
|
|
3416
|
+
direction: "row",
|
|
3417
|
+
sx: (theme) => ({
|
|
3418
|
+
alignItems: "center",
|
|
3419
|
+
gap: `${spacing.spacing_2}px`,
|
|
3420
|
+
// Keeps the two buttons' 44px hit areas from overlapping.
|
|
3421
|
+
[theme.breakpoints.down("md")]: { gap: `${spacing.spacing_4}px` }
|
|
3422
|
+
}),
|
|
3423
|
+
children: [
|
|
3424
|
+
showPause && /* @__PURE__ */ jsx(ActionButton, { size: "small", onClick: onPause, "aria-label": "Pause download", children: /* @__PURE__ */ jsx(Minus, { size: spacing.spacing_2 }) }),
|
|
3425
|
+
showClose && /* @__PURE__ */ jsx(ActionButton, { size: "small", onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsx(X, { size: spacing.spacing_2 }) })
|
|
3426
|
+
]
|
|
3427
|
+
}
|
|
3428
|
+
);
|
|
3123
3429
|
};
|
|
3124
3430
|
return /* @__PURE__ */ jsxs(StyledRoot$1, { elevation: 0, role: "status", ...props, children: [
|
|
3125
3431
|
/* @__PURE__ */ jsxs(
|
|
@@ -3274,6 +3580,12 @@ const StyledChip$1 = styled(Chip, {
|
|
|
3274
3580
|
[`&.${chipClasses.focusVisible}`]: {
|
|
3275
3581
|
...focusRingStyles,
|
|
3276
3582
|
backgroundColor: selected ? semanticColors.button.secondary.bgPressed : semanticColors.color.surface.raised
|
|
3583
|
+
},
|
|
3584
|
+
...touchTarget(theme),
|
|
3585
|
+
[theme.breakpoints.down("md")]: {
|
|
3586
|
+
position: "relative",
|
|
3587
|
+
// Keeps the clear icon above the chip's hit area so a tap on it clears rather than opens.
|
|
3588
|
+
[`& .${chipClasses.deleteIcon}`]: { position: "relative", zIndex: 1 }
|
|
3277
3589
|
}
|
|
3278
3590
|
}));
|
|
3279
3591
|
const LabelContent = styled("span")({
|
|
@@ -3456,7 +3768,9 @@ const LoadMoreButton = styled("button")(({ theme }) => ({
|
|
|
3456
3768
|
"&:disabled": {
|
|
3457
3769
|
color: semanticColors.button.fgDisabled,
|
|
3458
3770
|
cursor: "not-allowed"
|
|
3459
|
-
}
|
|
3771
|
+
},
|
|
3772
|
+
...touchTarget(theme),
|
|
3773
|
+
[theme.breakpoints.down("md")]: { position: "relative" }
|
|
3460
3774
|
}));
|
|
3461
3775
|
const SelectedText = styled("p")(({ theme }) => ({
|
|
3462
3776
|
fontFamily: typography.fontFamily.body,
|
|
@@ -3807,6 +4121,11 @@ const StyledInputBase = styled(InputBase, {
|
|
|
3807
4121
|
transition: theme.transitions.create(["border-color", "background-color"], {
|
|
3808
4122
|
duration: theme.transitions.duration.short
|
|
3809
4123
|
}),
|
|
4124
|
+
// A tap on the hit area focuses the input; positioning keeps the input above it for caret taps.
|
|
4125
|
+
...touchTarget(theme, { pseudo: "before" }),
|
|
4126
|
+
[theme.breakpoints.down("md")]: {
|
|
4127
|
+
[`& .${inputBaseClasses.input}`]: { position: "relative" }
|
|
4128
|
+
},
|
|
3810
4129
|
[`& .${inputBaseClasses.input}`]: {
|
|
3811
4130
|
padding: sizeStyles.padding,
|
|
3812
4131
|
color: semanticColors.color.text.input,
|
|
@@ -3996,13 +4315,27 @@ const sizeConfig = {
|
|
|
3996
4315
|
lineHeight: 1.5
|
|
3997
4316
|
}
|
|
3998
4317
|
};
|
|
4318
|
+
function compactRowHeight(theme, rowHeight, hasSecondaryText) {
|
|
4319
|
+
if (rowHeight >= TOUCH_TARGET) {
|
|
4320
|
+
return {};
|
|
4321
|
+
}
|
|
4322
|
+
return {
|
|
4323
|
+
[theme.breakpoints.down("md")]: {
|
|
4324
|
+
minHeight: TOUCH_TARGET,
|
|
4325
|
+
height: hasSecondaryText ? "auto" : TOUCH_TARGET
|
|
4326
|
+
}
|
|
4327
|
+
};
|
|
4328
|
+
}
|
|
3999
4329
|
const StyledListItemButton$1 = styled(ListItemButton, {
|
|
4000
4330
|
shouldForwardProp: (prop) => prop !== "size" && prop !== "primaryText" && prop !== "secondaryText" && prop !== "badge" && prop !== "icon" && prop !== "isLink" && prop !== "hasSecondaryText" && prop !== "trailingElement"
|
|
4001
4331
|
})(({ theme, size = "medium", isLink, hasSecondaryText }) => {
|
|
4002
4332
|
const config = sizeConfig[size];
|
|
4333
|
+
const isCard = size === "xxlarge" || size === "xxxlarge";
|
|
4003
4334
|
return {
|
|
4004
4335
|
minHeight: config.height,
|
|
4005
4336
|
height: hasSecondaryText ? "auto" : config.height,
|
|
4337
|
+
...compactRowHeight(theme, config.height, hasSecondaryText),
|
|
4338
|
+
...isCard && { [theme.breakpoints.down("md")]: { height: "auto" } },
|
|
4006
4339
|
paddingTop: config.paddingTop,
|
|
4007
4340
|
paddingRight: config.paddingRight,
|
|
4008
4341
|
paddingBottom: config.paddingBottom,
|
|
@@ -4039,7 +4372,11 @@ const StyledListItemButton$1 = styled(ListItemButton, {
|
|
|
4039
4372
|
overflow: "hidden",
|
|
4040
4373
|
textOverflow: "ellipsis",
|
|
4041
4374
|
whiteSpace: "nowrap",
|
|
4042
|
-
...isLink &&
|
|
4375
|
+
...isLink && isCard && { textDecoration: "none" },
|
|
4376
|
+
// On a phone one line clips a trailing badge mid-chip; card rows wrap instead.
|
|
4377
|
+
...isCard && {
|
|
4378
|
+
[theme.breakpoints.down("md")]: { whiteSpace: "normal", overflowWrap: "anywhere" }
|
|
4379
|
+
}
|
|
4043
4380
|
},
|
|
4044
4381
|
// Link hover styling (underline on hover for xxlarge/xxxlarge)
|
|
4045
4382
|
...isLink && (size === "xxlarge" || size === "xxxlarge") && {
|
|
@@ -4186,6 +4523,9 @@ function navVariantStyles(theme) {
|
|
|
4186
4523
|
paddingBottom: spacing.spacing_1,
|
|
4187
4524
|
paddingLeft: spacing.spacing_2,
|
|
4188
4525
|
paddingRight: spacing.spacing_2,
|
|
4526
|
+
[theme.breakpoints.down("md")]: {
|
|
4527
|
+
minHeight: TOUCH_TARGET
|
|
4528
|
+
},
|
|
4189
4529
|
border: "none",
|
|
4190
4530
|
color: semanticColors.color.text.secondary,
|
|
4191
4531
|
backgroundColor: "transparent",
|
|
@@ -4323,13 +4663,27 @@ const ModMenu = ({ children, ...props }) => {
|
|
|
4323
4663
|
};
|
|
4324
4664
|
ModMenu.displayName = "ModMenu";
|
|
4325
4665
|
|
|
4326
|
-
const StyledActionsCell = styled(GridActionsCell)({
|
|
4666
|
+
const StyledActionsCell = styled(GridActionsCell)(({ theme }) => ({
|
|
4327
4667
|
gap: spacing.spacing_1,
|
|
4328
4668
|
paddingLeft: spacing.spacing_1_1_2,
|
|
4329
|
-
paddingRight: spacing.spacing_1_1_2
|
|
4669
|
+
paddingRight: spacing.spacing_1_1_2,
|
|
4670
|
+
// Below md a cell holds one button (a lone action or the menu trigger), so hit areas can't overlap.
|
|
4671
|
+
[`& .${iconButtonClasses.root}`]: touchTarget(theme)
|
|
4672
|
+
}));
|
|
4673
|
+
const actionsOf = (children, prefix = "") => Children.toArray(children).flatMap((child) => {
|
|
4674
|
+
if (!isValidElement(child)) {
|
|
4675
|
+
return [];
|
|
4676
|
+
}
|
|
4677
|
+
const key = `${prefix}${child.key}`;
|
|
4678
|
+
return child.type === Fragment$1 ? actionsOf(child.props.children, key) : [cloneElement(child, { key })];
|
|
4330
4679
|
});
|
|
4331
|
-
function ModActionsCell(props) {
|
|
4332
|
-
|
|
4680
|
+
function ModActionsCell({ children, ...props }) {
|
|
4681
|
+
const compact = useIsCompact();
|
|
4682
|
+
const actions = actionsOf(children);
|
|
4683
|
+
if (compact && actions.length > 1) {
|
|
4684
|
+
return /* @__PURE__ */ jsx(StyledActionsCell, { ...props, children: actions.map((action) => cloneElement(action, { showInMenu: true })) }, "compact");
|
|
4685
|
+
}
|
|
4686
|
+
return /* @__PURE__ */ jsx(StyledActionsCell, { ...props, children });
|
|
4333
4687
|
}
|
|
4334
4688
|
|
|
4335
4689
|
const StyledCell$1 = styled("div", {
|
|
@@ -4379,7 +4733,7 @@ const ModAvatarCell = ({
|
|
|
4379
4733
|
};
|
|
4380
4734
|
ModAvatarCell.displayName = "ModAvatarCell";
|
|
4381
4735
|
|
|
4382
|
-
const StyledDialog = styled(Dialog)({
|
|
4736
|
+
const StyledDialog = styled(Dialog)(({ theme }) => ({
|
|
4383
4737
|
[`& .${dialogClasses.paper}`]: {
|
|
4384
4738
|
backgroundColor: semanticColors.color.surface.raised,
|
|
4385
4739
|
borderRadius: borderRadius.card,
|
|
@@ -4389,16 +4743,33 @@ const StyledDialog = styled(Dialog)({
|
|
|
4389
4743
|
[`& .${dialogClasses.container}`]: {
|
|
4390
4744
|
alignItems: "center",
|
|
4391
4745
|
justifyContent: "center"
|
|
4746
|
+
},
|
|
4747
|
+
[theme.breakpoints.down("sm")]: {
|
|
4748
|
+
[`& .${dialogClasses.paper}`]: {
|
|
4749
|
+
margin: 0,
|
|
4750
|
+
width: "100%",
|
|
4751
|
+
maxWidth: "100%",
|
|
4752
|
+
height: "100%",
|
|
4753
|
+
maxHeight: "100%",
|
|
4754
|
+
borderRadius: 0,
|
|
4755
|
+
border: "none"
|
|
4756
|
+
}
|
|
4392
4757
|
}
|
|
4393
|
-
});
|
|
4758
|
+
}));
|
|
4394
4759
|
const ModModal = ({ children, ...props }) => {
|
|
4395
4760
|
return /* @__PURE__ */ jsx(StyledDialog, { ...props, children });
|
|
4396
4761
|
};
|
|
4397
4762
|
ModModal.displayName = "ModModal";
|
|
4398
|
-
const ModalHeaderRoot = styled("div")({
|
|
4763
|
+
const ModalHeaderRoot = styled("div")(({ theme }) => ({
|
|
4399
4764
|
display: "flex",
|
|
4400
|
-
flexDirection: "column"
|
|
4401
|
-
|
|
4765
|
+
flexDirection: "column",
|
|
4766
|
+
// Header extras such as tabs otherwise end flush on the body text.
|
|
4767
|
+
[theme.breakpoints.down("md")]: {
|
|
4768
|
+
"&:has(> :nth-child(2))": {
|
|
4769
|
+
paddingBottom: spacing.spacing_2
|
|
4770
|
+
}
|
|
4771
|
+
}
|
|
4772
|
+
}));
|
|
4402
4773
|
const ModalHeaderTitleRow = styled("div")({
|
|
4403
4774
|
display: "flex",
|
|
4404
4775
|
alignItems: "flex-start",
|
|
@@ -4443,7 +4814,8 @@ const ModalHeaderSubtitle = styled("p")(({ theme }) => ({
|
|
|
4443
4814
|
lineHeight: 1.4,
|
|
4444
4815
|
color: semanticColors.color.text.secondary
|
|
4445
4816
|
}));
|
|
4446
|
-
const StyledCloseButton = styled(IconButton)({
|
|
4817
|
+
const StyledCloseButton = styled(IconButton)(({ theme }) => ({
|
|
4818
|
+
...touchTarget(theme),
|
|
4447
4819
|
color: semanticColors.color.icon.utility,
|
|
4448
4820
|
paddingTop: 0,
|
|
4449
4821
|
paddingRight: 0,
|
|
@@ -4456,7 +4828,7 @@ const StyledCloseButton = styled(IconButton)({
|
|
|
4456
4828
|
backgroundColor: "transparent",
|
|
4457
4829
|
color: semanticColors.color.icon.utility
|
|
4458
4830
|
}
|
|
4459
|
-
});
|
|
4831
|
+
}));
|
|
4460
4832
|
const ModModalHeader = ({
|
|
4461
4833
|
title,
|
|
4462
4834
|
subtitle,
|
|
@@ -4511,7 +4883,7 @@ const ModModalContent = ({ children }) => {
|
|
|
4511
4883
|
return /* @__PURE__ */ jsx(StyledDialogContent, { dividers: false, children });
|
|
4512
4884
|
};
|
|
4513
4885
|
ModModalContent.displayName = "ModModalContent";
|
|
4514
|
-
const StyledDialogActions = styled(DialogActions)({
|
|
4886
|
+
const StyledDialogActions = styled(DialogActions)(({ theme }) => ({
|
|
4515
4887
|
paddingTop: 0,
|
|
4516
4888
|
paddingRight: spacing.spacing_4,
|
|
4517
4889
|
paddingBottom: spacing.spacing_4,
|
|
@@ -4523,15 +4895,38 @@ const StyledDialogActions = styled(DialogActions)({
|
|
|
4523
4895
|
paddingTop: 0,
|
|
4524
4896
|
paddingRight: spacing.spacing_4,
|
|
4525
4897
|
paddingBottom: spacing.spacing_4,
|
|
4526
|
-
paddingLeft: spacing.spacing_4
|
|
4898
|
+
paddingLeft: spacing.spacing_4,
|
|
4899
|
+
// A full-screen body scrolls; the border marks where it ends and the actions begin.
|
|
4900
|
+
[theme.breakpoints.down("sm")]: {
|
|
4901
|
+
paddingTop: spacing.spacing_2,
|
|
4902
|
+
borderTop: `1px solid ${semanticColors.color.border.primary}`
|
|
4903
|
+
}
|
|
4904
|
+
},
|
|
4905
|
+
[theme.breakpoints.down("sm")]: {
|
|
4906
|
+
flexWrap: "wrap",
|
|
4907
|
+
columnGap: spacing.spacing_2,
|
|
4908
|
+
rowGap: spacing.spacing_2,
|
|
4909
|
+
// MUI's sibling margin would inset the actions past the header's edge.
|
|
4910
|
+
[`&.${dialogActionsClasses.spacing} > :not(style) ~ :not(style)`]: {
|
|
4911
|
+
marginLeft: 0
|
|
4912
|
+
}
|
|
4527
4913
|
}
|
|
4528
|
-
});
|
|
4529
|
-
const FooterActionsGroup = styled("div")({
|
|
4914
|
+
}));
|
|
4915
|
+
const FooterActionsGroup = styled("div")(({ theme }) => ({
|
|
4530
4916
|
display: "flex",
|
|
4531
4917
|
gap: spacing.spacing_2,
|
|
4532
4918
|
alignItems: "center",
|
|
4533
|
-
marginLeft: "auto"
|
|
4534
|
-
|
|
4919
|
+
marginLeft: "auto",
|
|
4920
|
+
// Full-width stack with the primary action last, nearest the thumb.
|
|
4921
|
+
// A small leading icon shares the actions' row; wider leading content pushes them to a row of their own.
|
|
4922
|
+
[theme.breakpoints.down("sm")]: {
|
|
4923
|
+
flex: "1 1 0",
|
|
4924
|
+
minWidth: "50%",
|
|
4925
|
+
flexDirection: "column",
|
|
4926
|
+
alignItems: "stretch",
|
|
4927
|
+
marginLeft: 0
|
|
4928
|
+
}
|
|
4929
|
+
}));
|
|
4535
4930
|
const ModModalFooter = ({ leadingContent, children }) => {
|
|
4536
4931
|
return /* @__PURE__ */ jsxs(StyledDialogActions, { children: [
|
|
4537
4932
|
leadingContent,
|
|
@@ -4865,6 +5260,23 @@ const StyledTooltip = styled(
|
|
|
4865
5260
|
}
|
|
4866
5261
|
};
|
|
4867
5262
|
});
|
|
5263
|
+
const withCompactFallback = (placement, popper) => {
|
|
5264
|
+
const side = placement?.split("-")[0];
|
|
5265
|
+
if (side !== "left" && side !== "right") {
|
|
5266
|
+
return popper;
|
|
5267
|
+
}
|
|
5268
|
+
const flip = {
|
|
5269
|
+
name: "flip",
|
|
5270
|
+
options: { fallbackPlacements: [side === "left" ? "right" : "left", "top", "bottom"] }
|
|
5271
|
+
};
|
|
5272
|
+
return {
|
|
5273
|
+
...popper,
|
|
5274
|
+
popperOptions: {
|
|
5275
|
+
...popper?.popperOptions,
|
|
5276
|
+
modifiers: [flip, ...popper?.popperOptions?.modifiers ?? []]
|
|
5277
|
+
}
|
|
5278
|
+
};
|
|
5279
|
+
};
|
|
4868
5280
|
const ModTooltip = ({
|
|
4869
5281
|
variant = "light",
|
|
4870
5282
|
title,
|
|
@@ -4873,9 +5285,21 @@ const ModTooltip = ({
|
|
|
4873
5285
|
arrow = false,
|
|
4874
5286
|
placement,
|
|
4875
5287
|
describeChild,
|
|
5288
|
+
slotProps,
|
|
4876
5289
|
...props
|
|
4877
5290
|
}) => {
|
|
4878
5291
|
const accessibleName = typeof title === "string" && !description && !describeChild ? title : void 0;
|
|
5292
|
+
const isCompact = useIsCompact();
|
|
5293
|
+
const compactSlotProps = useMemo(() => {
|
|
5294
|
+
const popper = slotProps?.popper;
|
|
5295
|
+
if (!isCompact) {
|
|
5296
|
+
return slotProps;
|
|
5297
|
+
}
|
|
5298
|
+
return {
|
|
5299
|
+
...slotProps,
|
|
5300
|
+
popper: typeof popper === "function" ? (ownerState) => withCompactFallback(placement, popper(ownerState)) : withCompactFallback(placement, popper)
|
|
5301
|
+
};
|
|
5302
|
+
}, [isCompact, placement, slotProps]);
|
|
4879
5303
|
const titleContent = description ? /* @__PURE__ */ jsxs(Stack, { sx: { gap: `${spacing.spacing_1_4}px` }, children: [
|
|
4880
5304
|
/* @__PURE__ */ jsx(Typography, { variant: "inherit", sx: { fontWeight: typography.fontWeight.semiBold }, children: title }),
|
|
4881
5305
|
/* @__PURE__ */ jsx(Typography, { variant: "inherit", children: description })
|
|
@@ -4889,6 +5313,7 @@ const ModTooltip = ({
|
|
|
4889
5313
|
placement,
|
|
4890
5314
|
describeChild,
|
|
4891
5315
|
"aria-label": accessibleName,
|
|
5316
|
+
slotProps: compactSlotProps,
|
|
4892
5317
|
...props,
|
|
4893
5318
|
children
|
|
4894
5319
|
}
|
|
@@ -5013,6 +5438,71 @@ function ModNavigationItem({
|
|
|
5013
5438
|
}
|
|
5014
5439
|
ModNavigationItem.displayName = "ModNavigationItem";
|
|
5015
5440
|
|
|
5441
|
+
function OverflowActions({ actions = [] }) {
|
|
5442
|
+
const compact = useIsCompact();
|
|
5443
|
+
const [anchor, setAnchor] = useState(null);
|
|
5444
|
+
const menuId = useId();
|
|
5445
|
+
useEffect(() => {
|
|
5446
|
+
if (!compact) {
|
|
5447
|
+
setAnchor(null);
|
|
5448
|
+
}
|
|
5449
|
+
}, [compact]);
|
|
5450
|
+
if (actions.length === 0) {
|
|
5451
|
+
return null;
|
|
5452
|
+
}
|
|
5453
|
+
const [first, ...rest] = actions;
|
|
5454
|
+
const inline = compact && rest.length > 0 ? [first] : actions;
|
|
5455
|
+
const overflow = compact ? rest : [];
|
|
5456
|
+
return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: `${spacing.spacing_1}px` }, children: [
|
|
5457
|
+
inline.map((action) => /* @__PURE__ */ jsx(
|
|
5458
|
+
ModButton,
|
|
5459
|
+
{
|
|
5460
|
+
variant: action.variant,
|
|
5461
|
+
startIcon: action.icon,
|
|
5462
|
+
disabled: action.disabled,
|
|
5463
|
+
onClick: action.onClick,
|
|
5464
|
+
children: action.label
|
|
5465
|
+
},
|
|
5466
|
+
action.id
|
|
5467
|
+
)),
|
|
5468
|
+
overflow.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5469
|
+
/* @__PURE__ */ jsx(
|
|
5470
|
+
ModIconButton,
|
|
5471
|
+
{
|
|
5472
|
+
"aria-label": "More actions",
|
|
5473
|
+
"aria-haspopup": "menu",
|
|
5474
|
+
"aria-expanded": anchor !== null,
|
|
5475
|
+
"aria-controls": anchor ? menuId : void 0,
|
|
5476
|
+
onClick: (event) => setAnchor(event.currentTarget),
|
|
5477
|
+
children: /* @__PURE__ */ jsx(EllipsisVertical, {})
|
|
5478
|
+
}
|
|
5479
|
+
),
|
|
5480
|
+
/* @__PURE__ */ jsx(
|
|
5481
|
+
ModMenu,
|
|
5482
|
+
{
|
|
5483
|
+
anchorEl: anchor,
|
|
5484
|
+
open: anchor !== null,
|
|
5485
|
+
onClose: () => setAnchor(null),
|
|
5486
|
+
slotProps: { list: { id: menuId } },
|
|
5487
|
+
children: overflow.map((action) => /* @__PURE__ */ jsx(
|
|
5488
|
+
ModMenuItem,
|
|
5489
|
+
{
|
|
5490
|
+
icon: action.icon,
|
|
5491
|
+
disabled: action.disabled,
|
|
5492
|
+
onClick: () => {
|
|
5493
|
+
setAnchor(null);
|
|
5494
|
+
action.onClick();
|
|
5495
|
+
},
|
|
5496
|
+
children: action.label
|
|
5497
|
+
},
|
|
5498
|
+
action.id
|
|
5499
|
+
))
|
|
5500
|
+
}
|
|
5501
|
+
)
|
|
5502
|
+
] })
|
|
5503
|
+
] });
|
|
5504
|
+
}
|
|
5505
|
+
|
|
5016
5506
|
const StickyHeader = styled(Box)(({ theme }) => ({
|
|
5017
5507
|
position: "sticky",
|
|
5018
5508
|
top: 0,
|
|
@@ -5034,6 +5524,7 @@ function ModPageContent({
|
|
|
5034
5524
|
subtitle,
|
|
5035
5525
|
breadcrumbs,
|
|
5036
5526
|
action,
|
|
5527
|
+
actions,
|
|
5037
5528
|
sticky = false,
|
|
5038
5529
|
contentMaxWidth: contentMaxWidthProp = false,
|
|
5039
5530
|
centerContent = true,
|
|
@@ -5092,13 +5583,19 @@ function ModPageContent({
|
|
|
5092
5583
|
Stack,
|
|
5093
5584
|
{
|
|
5094
5585
|
direction: "row",
|
|
5095
|
-
sx:
|
|
5586
|
+
sx: (theme) => ({
|
|
5587
|
+
justifyContent: "space-between",
|
|
5588
|
+
alignItems: "flex-start",
|
|
5589
|
+
gap: "1rem",
|
|
5590
|
+
[theme.breakpoints.down("md")]: { flexWrap: "wrap" }
|
|
5591
|
+
}),
|
|
5096
5592
|
children: [
|
|
5097
5593
|
/* @__PURE__ */ jsxs(Stack, { sx: { gap: "0.5rem", flexGrow: 1 }, children: [
|
|
5098
5594
|
typeof pageTitle === "string" ? /* @__PURE__ */ jsx(PageTitle, { component: "h1", children: pageTitle }) : pageTitle,
|
|
5099
5595
|
subtitle && (typeof subtitle === "string" ? /* @__PURE__ */ jsx(Subtitle, { variant: "caption", children: subtitle }) : subtitle)
|
|
5100
5596
|
] }),
|
|
5101
|
-
action
|
|
5597
|
+
action,
|
|
5598
|
+
/* @__PURE__ */ jsx(OverflowActions, { actions })
|
|
5102
5599
|
]
|
|
5103
5600
|
}
|
|
5104
5601
|
)
|
|
@@ -5257,7 +5754,16 @@ function ModPaginatedGrid({
|
|
|
5257
5754
|
}
|
|
5258
5755
|
ModPaginatedGrid.displayName = "ModPaginatedGrid";
|
|
5259
5756
|
|
|
5757
|
+
const StyledQuickFilter = styled(QuickFilter)(({ theme }) => ({
|
|
5758
|
+
[theme.breakpoints.down("sm")]: {
|
|
5759
|
+
flex: "1 1 100%",
|
|
5760
|
+
minWidth: 0
|
|
5761
|
+
}
|
|
5762
|
+
}));
|
|
5260
5763
|
const StyledTextField = styled(TextField)(({ theme }) => ({
|
|
5764
|
+
[theme.breakpoints.down("sm")]: {
|
|
5765
|
+
width: "100%"
|
|
5766
|
+
},
|
|
5261
5767
|
[`& .${inputBaseClasses.root}`]: {
|
|
5262
5768
|
height: spacing.spacing_5,
|
|
5263
5769
|
fontSize: theme.typography.pxToRem(typography.fontSize.default),
|
|
@@ -5269,6 +5775,9 @@ const StyledTextField = styled(TextField)(({ theme }) => ({
|
|
|
5269
5775
|
paddingLeft: spacing.spacing_1_1_2,
|
|
5270
5776
|
paddingRight: spacing.spacing_1_1_2,
|
|
5271
5777
|
gap: spacing.spacing_1_2,
|
|
5778
|
+
[theme.breakpoints.down("md")]: {
|
|
5779
|
+
height: TOUCH_TARGET
|
|
5780
|
+
},
|
|
5272
5781
|
"&::before, &::after": {
|
|
5273
5782
|
display: "none"
|
|
5274
5783
|
},
|
|
@@ -5303,6 +5812,7 @@ const StyledTextField = styled(TextField)(({ theme }) => ({
|
|
|
5303
5812
|
marginRight: 0
|
|
5304
5813
|
},
|
|
5305
5814
|
[`& .${iconButtonClasses.root}`]: {
|
|
5815
|
+
...touchTarget(theme),
|
|
5306
5816
|
color: semanticColors.color.icon.placeholder,
|
|
5307
5817
|
"&:hover": {
|
|
5308
5818
|
backgroundColor: semanticColors.color.icon.bgHover,
|
|
@@ -5319,7 +5829,7 @@ const ModQuickFilter = ({
|
|
|
5319
5829
|
onKeyDown,
|
|
5320
5830
|
autoFocus = false
|
|
5321
5831
|
}) => {
|
|
5322
|
-
return /* @__PURE__ */ jsx(
|
|
5832
|
+
return /* @__PURE__ */ jsx(StyledQuickFilter, { children: /* @__PURE__ */ jsx(
|
|
5323
5833
|
QuickFilterControl,
|
|
5324
5834
|
{
|
|
5325
5835
|
onKeyDown,
|
|
@@ -5459,7 +5969,7 @@ const HelperText$1 = styled("span")(({ theme, size = "medium" }) => ({
|
|
|
5459
5969
|
}));
|
|
5460
5970
|
const StyledRadio = styled(Radio, {
|
|
5461
5971
|
shouldForwardProp: (prop) => prop !== "size"
|
|
5462
|
-
})(({ size = "medium" }) => {
|
|
5972
|
+
})(({ theme, size = "medium" }) => {
|
|
5463
5973
|
const dimensions = size === "small" ? 16 : 20;
|
|
5464
5974
|
const radius = size === "small" ? 8 : 10;
|
|
5465
5975
|
return {
|
|
@@ -5480,6 +5990,7 @@ const StyledRadio = styled(Radio, {
|
|
|
5480
5990
|
width: dimensions,
|
|
5481
5991
|
height: dimensions
|
|
5482
5992
|
},
|
|
5993
|
+
"& input": inputTouchTarget(theme),
|
|
5483
5994
|
// Focus state for keyboard navigation
|
|
5484
5995
|
[`&.${buttonBaseClasses.focusVisible}`]: {
|
|
5485
5996
|
// Unchecked focus state: white background
|
|
@@ -5608,6 +6119,11 @@ const StyledSearchChip = styled(InputBase, {
|
|
|
5608
6119
|
transition: theme.transitions.create(["border-color", "background-color"], {
|
|
5609
6120
|
duration: theme.transitions.duration.short
|
|
5610
6121
|
}),
|
|
6122
|
+
// A tap on the hit area focuses the input; positioning keeps the input above it for caret taps.
|
|
6123
|
+
...touchTarget(theme, { pseudo: "before" }),
|
|
6124
|
+
[theme.breakpoints.down("md")]: {
|
|
6125
|
+
[`& .${inputBaseClasses.input}`]: { position: "relative" }
|
|
6126
|
+
},
|
|
5611
6127
|
[`& .${inputBaseClasses.input}`]: {
|
|
5612
6128
|
padding: `0 ${spacing.spacing_1_4}px`,
|
|
5613
6129
|
height: "auto",
|
|
@@ -5640,7 +6156,8 @@ const StyledSearchChip = styled(InputBase, {
|
|
|
5640
6156
|
outline: `3px solid ${semanticColors.color.action.tint}`
|
|
5641
6157
|
}
|
|
5642
6158
|
}));
|
|
5643
|
-
const ClearButton = styled(ButtonBase)({
|
|
6159
|
+
const ClearButton = styled(ButtonBase)(({ theme }) => ({
|
|
6160
|
+
...touchTarget(theme),
|
|
5644
6161
|
display: "inline-flex",
|
|
5645
6162
|
alignItems: "center",
|
|
5646
6163
|
justifyContent: "center",
|
|
@@ -5656,7 +6173,7 @@ const ClearButton = styled(ButtonBase)({
|
|
|
5656
6173
|
"&:hover": {
|
|
5657
6174
|
backgroundColor: semanticColors.button.secondary.bgHover
|
|
5658
6175
|
}
|
|
5659
|
-
});
|
|
6176
|
+
}));
|
|
5660
6177
|
const ModSearchChip = ({ onClear, value, ...props }) => {
|
|
5661
6178
|
const hasValue = Boolean(value && String(value).length > 0);
|
|
5662
6179
|
return /* @__PURE__ */ jsx(
|
|
@@ -5842,7 +6359,7 @@ const Handle = styled(ButtonBase)(({ theme }) => ({
|
|
|
5842
6359
|
borderColor: semanticColors.color.border.primary
|
|
5843
6360
|
}
|
|
5844
6361
|
}));
|
|
5845
|
-
function useScrollEdges() {
|
|
6362
|
+
function useScrollEdges$1() {
|
|
5846
6363
|
const ref = useRef(null);
|
|
5847
6364
|
const contentRef = useRef(null);
|
|
5848
6365
|
const [edges, setEdges] = useState({
|
|
@@ -5886,7 +6403,7 @@ function ModSideNav({
|
|
|
5886
6403
|
"aria-label": ariaLabel
|
|
5887
6404
|
}) {
|
|
5888
6405
|
const contextValue = useMemo(() => ({ collapsed }), [collapsed]);
|
|
5889
|
-
const { ref: scrollRef, contentRef, onScroll, canScrollUp, canScrollDown } = useScrollEdges();
|
|
6406
|
+
const { ref: scrollRef, contentRef, onScroll, canScrollUp, canScrollDown } = useScrollEdges$1();
|
|
5890
6407
|
const HandleIcon = collapsed ? ChevronRight : ChevronLeft;
|
|
5891
6408
|
return /* @__PURE__ */ jsx(ModSideNavContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(Frame, { collapsed, children: [
|
|
5892
6409
|
/* @__PURE__ */ jsxs(Root, { collapsed, "aria-label": ariaLabel, className, id, children: [
|
|
@@ -5951,7 +6468,9 @@ const StyledSkeleton = styled(Skeleton, {
|
|
|
5951
6468
|
"&::after": {
|
|
5952
6469
|
animationDirection: "reverse"
|
|
5953
6470
|
}
|
|
5954
|
-
}
|
|
6471
|
+
},
|
|
6472
|
+
// A fixed width sized for desktop yields to a phone-width container.
|
|
6473
|
+
[theme.breakpoints.down("md")]: { maxWidth: "100%" }
|
|
5955
6474
|
}));
|
|
5956
6475
|
const ModSkeleton = ({
|
|
5957
6476
|
colorTheme = "light",
|
|
@@ -6078,20 +6597,91 @@ const ModTabPanel = ({
|
|
|
6078
6597
|
};
|
|
6079
6598
|
ModTabPanel.displayName = "ModTabPanel";
|
|
6080
6599
|
|
|
6081
|
-
const
|
|
6600
|
+
const EDGE_FADE = spacing.spacing_4;
|
|
6601
|
+
const StyledTabs = styled(MuiTabs)(({ theme }) => ({
|
|
6082
6602
|
minHeight: spacing.spacing_5,
|
|
6603
|
+
[theme.breakpoints.down("md")]: {
|
|
6604
|
+
minHeight: TOUCH_TARGET
|
|
6605
|
+
},
|
|
6083
6606
|
[`& .${tabsClasses.indicator}`]: {
|
|
6084
6607
|
backgroundColor: semanticColors.button.nav.borderActive,
|
|
6085
|
-
height: 2
|
|
6608
|
+
height: 2,
|
|
6609
|
+
// The indicator overlaps the selected tab's bottom edge; let those taps reach the tab.
|
|
6610
|
+
[theme.breakpoints.down("md")]: {
|
|
6611
|
+
pointerEvents: "none"
|
|
6612
|
+
}
|
|
6086
6613
|
},
|
|
6087
6614
|
[`& .${tabsClasses.list}`]: {
|
|
6088
6615
|
gap: 0
|
|
6616
|
+
},
|
|
6617
|
+
// A row that scrolls fades out at each edge it can still scroll toward (set by ModTabs below md).
|
|
6618
|
+
[theme.breakpoints.down("md")]: {
|
|
6619
|
+
[`&[data-fade-end] .${tabsClasses.scroller}`]: {
|
|
6620
|
+
maskImage: `linear-gradient(to right, black calc(100% - ${EDGE_FADE}px), transparent)`
|
|
6621
|
+
},
|
|
6622
|
+
[`&[data-fade-start] .${tabsClasses.scroller}`]: {
|
|
6623
|
+
maskImage: `linear-gradient(to left, black calc(100% - ${EDGE_FADE}px), transparent)`
|
|
6624
|
+
},
|
|
6625
|
+
[`&[data-fade-start][data-fade-end] .${tabsClasses.scroller}`]: {
|
|
6626
|
+
maskImage: `linear-gradient(to right, transparent, black ${EDGE_FADE}px, black calc(100% - ${EDGE_FADE}px), transparent)`
|
|
6627
|
+
}
|
|
6089
6628
|
}
|
|
6090
6629
|
}));
|
|
6630
|
+
function useScrollEdges(active) {
|
|
6631
|
+
const rootRef = useRef(null);
|
|
6632
|
+
const [edges, setEdges] = useState({ start: false, end: false });
|
|
6633
|
+
useEffect(() => {
|
|
6634
|
+
const scroller = rootRef.current?.querySelector(`.${tabsClasses.scroller}`);
|
|
6635
|
+
if (!active || !scroller) {
|
|
6636
|
+
setEdges((prev) => prev.start || prev.end ? { start: false, end: false } : prev);
|
|
6637
|
+
return;
|
|
6638
|
+
}
|
|
6639
|
+
const measure = () => {
|
|
6640
|
+
const left = Math.abs(scroller.scrollLeft);
|
|
6641
|
+
const start = left > 0;
|
|
6642
|
+
const end = left + scroller.clientWidth < scroller.scrollWidth - 1;
|
|
6643
|
+
setEdges((prev) => prev.start === start && prev.end === end ? prev : { start, end });
|
|
6644
|
+
};
|
|
6645
|
+
measure();
|
|
6646
|
+
scroller.addEventListener("scroll", measure, { passive: true });
|
|
6647
|
+
const resize = new ResizeObserver(measure);
|
|
6648
|
+
resize.observe(scroller);
|
|
6649
|
+
for (const child of scroller.children) {
|
|
6650
|
+
resize.observe(child);
|
|
6651
|
+
}
|
|
6652
|
+
return () => {
|
|
6653
|
+
scroller.removeEventListener("scroll", measure);
|
|
6654
|
+
resize.disconnect();
|
|
6655
|
+
};
|
|
6656
|
+
}, [active]);
|
|
6657
|
+
return { rootRef, edges };
|
|
6658
|
+
}
|
|
6659
|
+
const ModTabs = forwardRef(function ModTabs2(props, ref) {
|
|
6660
|
+
const compact = useIsCompact();
|
|
6661
|
+
const variant = props.variant ?? "standard";
|
|
6662
|
+
const scrollable = compact && variant === "standard";
|
|
6663
|
+
const arrowless = compact && variant === "scrollable" && !props.allowScrollButtonsMobile;
|
|
6664
|
+
const { rootRef, edges } = useScrollEdges(compact && variant !== "fullWidth");
|
|
6665
|
+
const forkedRef = useForkRef(ref, rootRef);
|
|
6666
|
+
return /* @__PURE__ */ jsx(
|
|
6667
|
+
StyledTabs,
|
|
6668
|
+
{
|
|
6669
|
+
ref: forkedRef,
|
|
6670
|
+
...props,
|
|
6671
|
+
...scrollable && { variant: "scrollable", scrollButtons: false, centered: false },
|
|
6672
|
+
...arrowless && { scrollButtons: false },
|
|
6673
|
+
"data-fade-start": edges.start || void 0,
|
|
6674
|
+
"data-fade-end": edges.end || void 0
|
|
6675
|
+
}
|
|
6676
|
+
);
|
|
6677
|
+
});
|
|
6091
6678
|
ModTabs.displayName = "ModTabs";
|
|
6092
6679
|
const StyledTab = styled(MuiTab)(({ theme }) => ({
|
|
6093
6680
|
minHeight: spacing.spacing_5,
|
|
6094
6681
|
padding: `${spacing.spacing_1}px ${spacing.spacing_2}px`,
|
|
6682
|
+
[theme.breakpoints.down("md")]: {
|
|
6683
|
+
minHeight: TOUCH_TARGET
|
|
6684
|
+
},
|
|
6095
6685
|
textTransform: "none",
|
|
6096
6686
|
fontWeight: typography.fontWeight.regular,
|
|
6097
6687
|
fontSize: theme.typography.pxToRem(14),
|
|
@@ -6227,6 +6817,10 @@ const StyledAlert = styled(Alert, {
|
|
|
6227
6817
|
[`& .${alertClasses.action}`]: {
|
|
6228
6818
|
padding: 0,
|
|
6229
6819
|
marginRight: 0
|
|
6820
|
+
},
|
|
6821
|
+
// MUI's message scrolls (overflow: auto), which would clip the action buttons' hit areas.
|
|
6822
|
+
[theme.breakpoints.down("md")]: {
|
|
6823
|
+
[`& .${alertClasses.message}`]: { overflow: "visible" }
|
|
6230
6824
|
}
|
|
6231
6825
|
};
|
|
6232
6826
|
});
|
|
@@ -6262,7 +6856,8 @@ const ToastButton = styled(Button, {
|
|
|
6262
6856
|
"&:hover": {
|
|
6263
6857
|
backgroundColor: "transparent",
|
|
6264
6858
|
textDecoration: "underline"
|
|
6265
|
-
}
|
|
6859
|
+
},
|
|
6860
|
+
...touchTarget(theme)
|
|
6266
6861
|
}));
|
|
6267
6862
|
const ModToast = ({
|
|
6268
6863
|
intent = "neutral",
|
|
@@ -6284,7 +6879,7 @@ const ModToast = ({
|
|
|
6284
6879
|
{
|
|
6285
6880
|
size: "small",
|
|
6286
6881
|
onClick: onClose,
|
|
6287
|
-
sx: { color: semanticColors.color.icon.utility },
|
|
6882
|
+
sx: (theme) => ({ color: semanticColors.color.icon.utility, ...touchTarget(theme) }),
|
|
6288
6883
|
children: /* @__PURE__ */ jsx(X, { size: 16 })
|
|
6289
6884
|
}
|
|
6290
6885
|
) : void 0,
|
|
@@ -6408,6 +7003,9 @@ const StyledSwitch = styled(Switch, {
|
|
|
6408
7003
|
color: semanticColors.input.bgDisabled
|
|
6409
7004
|
}
|
|
6410
7005
|
},
|
|
7006
|
+
[`& .${switchClasses.switchBase} .${switchClasses.input}`]: inputTouchTarget(theme, {
|
|
7007
|
+
heightOnly: true
|
|
7008
|
+
}),
|
|
6411
7009
|
// Thumb
|
|
6412
7010
|
[`& .${switchClasses.thumb}`]: {
|
|
6413
7011
|
width: config.thumbSize,
|
|
@@ -6470,7 +7068,12 @@ const StyledToggleButton$1 = styled(MuiToggleButton, {
|
|
|
6470
7068
|
({ theme, toggleSize = "medium", toggleVariant = "default" }) => {
|
|
6471
7069
|
const segmented = toggleVariant === "segmented";
|
|
6472
7070
|
return {
|
|
7071
|
+
...touchTarget(theme),
|
|
6473
7072
|
height: sizeStyles[toggleSize].height,
|
|
7073
|
+
// Both sizes grow to a full touch row below md; the type size stays.
|
|
7074
|
+
[theme.breakpoints.down("md")]: {
|
|
7075
|
+
height: TOUCH_TARGET
|
|
7076
|
+
},
|
|
6474
7077
|
padding: `0 ${spacing.spacing_1_1_2}px`,
|
|
6475
7078
|
fontFamily: typography.fontFamily.body,
|
|
6476
7079
|
fontSize: theme.typography.pxToRem(sizeStyles[toggleSize].fontSize),
|
|
@@ -6516,7 +7119,7 @@ ModToggleButton.displayName = "ModToggleButton";
|
|
|
6516
7119
|
|
|
6517
7120
|
const StyledToggleButtonGroup$1 = styled(MuiToggleButtonGroup, {
|
|
6518
7121
|
shouldForwardProp: (prop) => prop !== "groupVariant"
|
|
6519
|
-
})(({ groupVariant = "default" }) => {
|
|
7122
|
+
})(({ theme, groupVariant = "default" }) => {
|
|
6520
7123
|
const segmented = groupVariant === "segmented";
|
|
6521
7124
|
return {
|
|
6522
7125
|
display: "inline-flex",
|
|
@@ -6530,7 +7133,19 @@ const StyledToggleButtonGroup$1 = styled(MuiToggleButtonGroup, {
|
|
|
6530
7133
|
} : {
|
|
6531
7134
|
borderRadius: borderRadius.button,
|
|
6532
7135
|
border: `1px solid ${semanticColors.color.border.primary}`,
|
|
6533
|
-
overflow: "hidden"
|
|
7136
|
+
overflow: "hidden",
|
|
7137
|
+
// The clip would cut the buttons' touch targets; round the end buttons to the inner (minus 1px border) radius.
|
|
7138
|
+
[theme.breakpoints.down("md")]: {
|
|
7139
|
+
overflow: "visible",
|
|
7140
|
+
[`& .${toggleButtonClasses.root}:first-of-type`]: {
|
|
7141
|
+
borderTopLeftRadius: borderRadius.button - 1,
|
|
7142
|
+
borderBottomLeftRadius: borderRadius.button - 1
|
|
7143
|
+
},
|
|
7144
|
+
[`& .${toggleButtonClasses.root}:last-of-type`]: {
|
|
7145
|
+
borderTopRightRadius: borderRadius.button - 1,
|
|
7146
|
+
borderBottomRightRadius: borderRadius.button - 1
|
|
7147
|
+
}
|
|
7148
|
+
}
|
|
6534
7149
|
},
|
|
6535
7150
|
// Default fuses the children (square inner corners, no gap); segmented
|
|
6536
7151
|
// keeps each button as its own rounded pill.
|
|
@@ -6569,10 +7184,26 @@ const StyledToolbar = styled(Toolbar)(({ theme }) => ({
|
|
|
6569
7184
|
// 16px
|
|
6570
7185
|
[theme.breakpoints.down("sm")]: {
|
|
6571
7186
|
flexWrap: "wrap"
|
|
7187
|
+
},
|
|
7188
|
+
// Controls are documented as grouped in Boxes; let those groups wrap too.
|
|
7189
|
+
[theme.breakpoints.down("md")]: {
|
|
7190
|
+
rowGap: spacing.spacing_1,
|
|
7191
|
+
"& > *": { flexWrap: "wrap" }
|
|
7192
|
+
},
|
|
7193
|
+
// On tablets a group can wrap beside others; they centre on its first line, not on its middle.
|
|
7194
|
+
// Every group is at least one control row tall (the QuickFilter's 44px) and bare controls centre
|
|
7195
|
+
// in it. Phones give the QuickFilter a row of its own, so groups there never share a line.
|
|
7196
|
+
[theme.breakpoints.between("sm", "md")]: {
|
|
7197
|
+
alignItems: "flex-start",
|
|
7198
|
+
"& > div": { minHeight: TOUCH_TARGET },
|
|
7199
|
+
"& > :not(div)": { alignSelf: "center" }
|
|
6572
7200
|
}
|
|
6573
7201
|
}));
|
|
6574
|
-
const ModToolbar = ({ children, ...props }) => {
|
|
6575
|
-
return /* @__PURE__ */
|
|
7202
|
+
const ModToolbar = ({ children, actions, ...props }) => {
|
|
7203
|
+
return /* @__PURE__ */ jsxs(StyledToolbar, { ...props, children: [
|
|
7204
|
+
children,
|
|
7205
|
+
/* @__PURE__ */ jsx(OverflowActions, { actions })
|
|
7206
|
+
] });
|
|
6576
7207
|
};
|
|
6577
7208
|
ModToolbar.displayName = "ModToolbar";
|
|
6578
7209
|
|
|
@@ -6584,9 +7215,88 @@ const ModTreeItemLabel = (props) => {
|
|
|
6584
7215
|
(item?.statusIcon ?? item?.icon) && /* @__PURE__ */ jsx(ItemIcon, { children: item?.statusIcon ?? item?.icon }),
|
|
6585
7216
|
/* @__PURE__ */ jsx(ItemLabel, { children }),
|
|
6586
7217
|
item?.secondaryLabel && /* @__PURE__ */ jsx(ItemSecondaryLabel, { children: item.secondaryLabel }),
|
|
6587
|
-
item?.endAction && /* @__PURE__ */ jsx(ItemEndAction, { children: item.endAction })
|
|
7218
|
+
item?.endAction && /* @__PURE__ */ jsx(ItemEndAction, { children: item.endAction }),
|
|
7219
|
+
item?.endActions && item.endActions.length > 0 && /* @__PURE__ */ jsx(ItemEndAction, { children: /* @__PURE__ */ jsx(TreeEndActions, { actions: item.endActions }) })
|
|
6588
7220
|
] });
|
|
6589
7221
|
};
|
|
7222
|
+
const stop = (event) => event.stopPropagation();
|
|
7223
|
+
const EndActionButton = styled(ButtonBase)(({ theme }) => ({
|
|
7224
|
+
...touchTarget(theme),
|
|
7225
|
+
color: "inherit",
|
|
7226
|
+
"&:hover": {
|
|
7227
|
+
color: semanticColors.color.icon.default
|
|
7228
|
+
},
|
|
7229
|
+
[`&.${buttonBaseClasses.focusVisible}`]: {
|
|
7230
|
+
outline: `2px solid ${semanticColors.color.border.focus}`
|
|
7231
|
+
}
|
|
7232
|
+
}));
|
|
7233
|
+
function TreeEndActions({ actions }) {
|
|
7234
|
+
const compact = useIsCompact();
|
|
7235
|
+
const [anchor, setAnchor] = useState(null);
|
|
7236
|
+
const menuId = useId();
|
|
7237
|
+
useEffect(() => {
|
|
7238
|
+
if (!compact) {
|
|
7239
|
+
setAnchor(null);
|
|
7240
|
+
}
|
|
7241
|
+
}, [compact]);
|
|
7242
|
+
if (!compact || actions.length === 1) {
|
|
7243
|
+
return actions.map((action) => /* @__PURE__ */ jsx(
|
|
7244
|
+
EndActionButton,
|
|
7245
|
+
{
|
|
7246
|
+
"aria-label": action.label,
|
|
7247
|
+
disabled: action.disabled,
|
|
7248
|
+
onKeyDown: stop,
|
|
7249
|
+
onClick: (event) => {
|
|
7250
|
+
stop(event);
|
|
7251
|
+
action.onClick();
|
|
7252
|
+
},
|
|
7253
|
+
children: action.icon
|
|
7254
|
+
},
|
|
7255
|
+
action.id
|
|
7256
|
+
));
|
|
7257
|
+
}
|
|
7258
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7259
|
+
/* @__PURE__ */ jsx(
|
|
7260
|
+
EndActionButton,
|
|
7261
|
+
{
|
|
7262
|
+
"aria-label": "More actions",
|
|
7263
|
+
"aria-haspopup": "menu",
|
|
7264
|
+
"aria-expanded": anchor !== null,
|
|
7265
|
+
"aria-controls": anchor ? menuId : void 0,
|
|
7266
|
+
onKeyDown: stop,
|
|
7267
|
+
onClick: (event) => {
|
|
7268
|
+
stop(event);
|
|
7269
|
+
setAnchor(event.currentTarget);
|
|
7270
|
+
},
|
|
7271
|
+
children: /* @__PURE__ */ jsx(EllipsisVertical, {})
|
|
7272
|
+
}
|
|
7273
|
+
),
|
|
7274
|
+
/* @__PURE__ */ jsx(
|
|
7275
|
+
ModMenu,
|
|
7276
|
+
{
|
|
7277
|
+
anchorEl: anchor,
|
|
7278
|
+
open: anchor !== null,
|
|
7279
|
+
onClose: () => setAnchor(null),
|
|
7280
|
+
onClick: stop,
|
|
7281
|
+
onKeyDown: stop,
|
|
7282
|
+
slotProps: { list: { id: menuId } },
|
|
7283
|
+
children: actions.map((action) => /* @__PURE__ */ jsx(
|
|
7284
|
+
ModMenuItem,
|
|
7285
|
+
{
|
|
7286
|
+
icon: action.icon,
|
|
7287
|
+
disabled: action.disabled,
|
|
7288
|
+
onClick: () => {
|
|
7289
|
+
setAnchor(null);
|
|
7290
|
+
action.onClick();
|
|
7291
|
+
},
|
|
7292
|
+
children: action.label
|
|
7293
|
+
},
|
|
7294
|
+
action.id
|
|
7295
|
+
))
|
|
7296
|
+
}
|
|
7297
|
+
)
|
|
7298
|
+
] });
|
|
7299
|
+
}
|
|
6590
7300
|
const ModTreeItem = forwardRef(function ModTreeItem2({ slots, slotProps, ...props }, ref) {
|
|
6591
7301
|
return /* @__PURE__ */ jsx(
|
|
6592
7302
|
TreeItem,
|
|
@@ -6664,9 +7374,12 @@ const ModTreeView = ({ slots, ...props }) => {
|
|
|
6664
7374
|
ModTreeView.displayName = "ModTreeView";
|
|
6665
7375
|
const CollapseIcon = () => /* @__PURE__ */ jsx(ChevronDown, { size: 16 });
|
|
6666
7376
|
const ExpandIcon = () => /* @__PURE__ */ jsx(ChevronRight, { size: 16 });
|
|
6667
|
-
const StyledTreeView = styled(RichTreeViewPro)({
|
|
7377
|
+
const StyledTreeView = styled(RichTreeViewPro)(({ theme }) => ({
|
|
6668
7378
|
[`& .${treeItemClasses.content}`]: {
|
|
6669
7379
|
height: 28,
|
|
7380
|
+
[theme.breakpoints.down("md")]: {
|
|
7381
|
+
height: TOUCH_TARGET
|
|
7382
|
+
},
|
|
6670
7383
|
gap: spacing.spacing_1_2,
|
|
6671
7384
|
paddingLeft: spacing.spacing_1,
|
|
6672
7385
|
paddingRight: spacing.spacing_1,
|
|
@@ -6705,7 +7418,7 @@ const StyledTreeView = styled(RichTreeViewPro)({
|
|
|
6705
7418
|
borderLeft: `1px solid ${semanticColors.color.border.primary}`,
|
|
6706
7419
|
marginLeft: spacing.spacing_1_1_4
|
|
6707
7420
|
}
|
|
6708
|
-
});
|
|
7421
|
+
}));
|
|
6709
7422
|
|
|
6710
7423
|
const TOGGLE_BUTTON_BORDER_RADIUS = 14;
|
|
6711
7424
|
const StyledToggleButtonGroup = styled(MuiToggleButtonGroup)(({ theme }) => ({
|
|
@@ -6724,11 +7437,22 @@ const StyledToggleButtonGroup = styled(MuiToggleButtonGroup)(({ theme }) => ({
|
|
|
6724
7437
|
"&:not(:last-of-type)": {
|
|
6725
7438
|
borderRadius: TOGGLE_BUTTON_BORDER_RADIUS
|
|
6726
7439
|
}
|
|
7440
|
+
},
|
|
7441
|
+
// MUI outlines disabled toggles and its vertical grouping drops each later top edge, which reads
|
|
7442
|
+
// as clipped borders; disabled toggles stay borderless like enabled ones.
|
|
7443
|
+
[theme.breakpoints.down("md")]: {
|
|
7444
|
+
[`& .${toggleButtonGroupClasses.grouped}.${toggleButtonClasses.disabled}`]: {
|
|
7445
|
+
border: "none"
|
|
7446
|
+
}
|
|
6727
7447
|
}
|
|
6728
7448
|
}));
|
|
6729
7449
|
const StyledToggleButton = styled(MuiToggleButton)(({ theme }) => ({
|
|
6730
7450
|
padding: theme.spacing(0.625),
|
|
6731
7451
|
minWidth: "auto",
|
|
7452
|
+
[theme.breakpoints.down("md")]: {
|
|
7453
|
+
minWidth: TOUCH_TARGET,
|
|
7454
|
+
minHeight: TOUCH_TARGET
|
|
7455
|
+
},
|
|
6732
7456
|
color: semanticColors.color.icon.default,
|
|
6733
7457
|
border: "none",
|
|
6734
7458
|
"& svg": {
|
|
@@ -6792,5 +7516,5 @@ ModVibratingDot.displayName = "ModVibratingDot";
|
|
|
6792
7516
|
|
|
6793
7517
|
const version = '0.0.0-development';
|
|
6794
7518
|
|
|
6795
|
-
export { ActivityScene, CIRCLE_RADIUS, ModActionsCell, ModActivityHeader, ModActivityIndicatorCell, ModAlert, ModAvatarCell, ModBadge, ModBanner, ModBreadcrumbLink, ModBreadcrumbs, ModButton, ModButtonTab, ModButtonTabGroup, ModCanceledIcon, ModCard, ModCheckbox, ModCheckboxWithText, ModCodeSnippet, ModDataGrid, ModDataGridCellContent, ModDataGridColumnsButton, ModDataGridColumnsPanel, ModDataGridFilterPanel, ModDataGridFilterPanelAddIcon, ModDataGridFilterPanelDeleteIcon, ModDataGridFilterPanelRemoveAllIcon, ModDataGridFiltersButton, ModDataGridHeaderLabel, ModDataGridSelect, ModDatePicker, ModDivider, ModDot, ModDownloadToast, ModSelect as ModDropdown, ModMenu as ModDropdownMenu, ModMenuItem as ModDropdownMenuItem, ModMenuItem as ModDropdownOption, ModFilledCanceled, ModFilledError, ModFilledInfo, ModFilledNeutral, ModFilledQueued, ModFilledSuccess, ModFilledWarning, ModFilterChip, ModFooter, ModGeneralAvatar, ModIconButton, ModIconCell, ModIconWrapper, ModInfiniteScrollGrid, ModInputField, ModListItem, ModListItemButton, ModLoadingSpinner, ModLogoCell, ModMenu, ModMenuItem, ModModal, ModModalContent, ModModalFooter, ModModalHeader, ModMultiBadgesCell, ModNavigationAvatar, ModNavigationItem, ModPageContent, ModPaginatedGrid, ModProgressCell, ModProgressbar, ModQuickFilter, ModRadio, ModRipplingDot, ModSearchChip, ModSelect, ModSelectField, ModMenuItem as ModSelectOption, ModSideNav, ModSkeleton, ModStatusBadgeCell, ModStatusCell, ModTab, ModTabPanel, ModTable, ModTabs, ModTag, ModToast, ModToastButton, ModToggle, ModToggleButton, ModToggleButtonGroup, ModToolbar, ModTooltip, ModTreeItem, ModTreeView, StyledToggleButton as ModTypologyButton, ModTypologyControl, ModUserAvatarCell, ModVibratingDot, SortedAscendingIcon, SortedDescendingIcon, UnsortedIcon, focusRingStyles, getDataGridHeaderStyles, getDataGridRowStyles, modRowHeights, version };
|
|
7519
|
+
export { ActivityScene, CIRCLE_RADIUS, ModActionsCell, ModActivityHeader, ModActivityIndicatorCell, ModAlert, ModAvatarCell, ModBadge, ModBanner, ModBreadcrumbLink, ModBreadcrumbs, ModButton, ModButtonTab, ModButtonTabGroup, ModCanceledIcon, ModCard, ModCheckbox, ModCheckboxWithText, ModCodeSnippet, ModDataGrid, ModDataGridCellContent, ModDataGridColumnsButton, ModDataGridColumnsPanel, ModDataGridFilterPanel, ModDataGridFilterPanelAddIcon, ModDataGridFilterPanelDeleteIcon, ModDataGridFilterPanelRemoveAllIcon, ModDataGridFiltersButton, ModDataGridHeaderLabel, ModDataGridSelect, ModDatePicker, ModDivider, ModDot, ModDownloadToast, ModSelect as ModDropdown, ModMenu as ModDropdownMenu, ModMenuItem as ModDropdownMenuItem, ModMenuItem as ModDropdownOption, ModFilledCanceled, ModFilledError, ModFilledInfo, ModFilledNeutral, ModFilledQueued, ModFilledSuccess, ModFilledWarning, ModFilterChip, ModFooter, ModGeneralAvatar, ModIconButton, ModIconCell, ModIconWrapper, ModInfiniteScrollGrid, ModInputField, ModListItem, ModListItemButton, ModLoadingSpinner, ModLogoCell, ModMenu, ModMenuItem, ModModal, ModModalContent, ModModalFooter, ModModalHeader, ModMultiBadgesCell, ModNavigationAvatar, ModNavigationItem, ModPageContent, ModPaginatedGrid, ModProgressCell, ModProgressbar, ModQuickFilter, ModRadio, ModRipplingDot, ModSearchChip, ModSelect, ModSelectField, ModMenuItem as ModSelectOption, ModSideNav, ModSkeleton, ModStatusBadgeCell, ModStatusCell, ModTab, ModTabPanel, ModTable, ModTabs, ModTag, ModToast, ModToastButton, ModToggle, ModToggleButton, ModToggleButtonGroup, ModToolbar, ModTooltip, ModTreeItem, ModTreeView, StyledToggleButton as ModTypologyButton, ModTypologyControl, ModUserAvatarCell, ModVibratingDot, SortedAscendingIcon, SortedDescendingIcon, UnsortedIcon, focusRingStyles, getDataGridHeaderStyles, getDataGridRowStyles, modRowHeights, touchTarget, useIsCompact, version };
|
|
6796
7520
|
//# sourceMappingURL=index.esm.js.map
|