@open-ui-kit/core 2.0.4 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -9
- package/index.cjs.js +1342 -51
- package/index.cjs.js.map +1 -1
- package/index.d.ts +1222 -1201
- package/index.esm.js +1342 -53
- package/index.esm.js.map +1 -1
- package/index.umd.js +1342 -51
- package/index.umd.js.map +1 -1
- package/package.json +11 -11
package/index.cjs.js
CHANGED
|
@@ -6336,6 +6336,13 @@ const StyledButton$1 = material.styled(material.Button)(({ theme }) => ({
|
|
|
6336
6336
|
textTransform: "none",
|
|
6337
6337
|
transition: "none",
|
|
6338
6338
|
borderRadius: "4px",
|
|
6339
|
+
width: "max-content",
|
|
6340
|
+
maxWidth: "100%",
|
|
6341
|
+
whiteSpace: "normal",
|
|
6342
|
+
overflowWrap: "break-word",
|
|
6343
|
+
textAlign: "center",
|
|
6344
|
+
alignItems: "center",
|
|
6345
|
+
height: "auto",
|
|
6339
6346
|
"& .MuiButton-startIcon": {
|
|
6340
6347
|
marginLeft: "0px",
|
|
6341
6348
|
},
|
|
@@ -6347,16 +6354,22 @@ const StyledButton$1 = material.styled(material.Button)(({ theme }) => ({
|
|
|
6347
6354
|
padding: "8px",
|
|
6348
6355
|
minWidth: "40px",
|
|
6349
6356
|
width: "40px",
|
|
6357
|
+
height: "40px",
|
|
6358
|
+
minHeight: "40px",
|
|
6350
6359
|
},
|
|
6351
6360
|
"&.MuiButton-sizeMedium": {
|
|
6352
6361
|
padding: "6px",
|
|
6353
6362
|
minWidth: "32px",
|
|
6354
6363
|
width: "32px",
|
|
6364
|
+
height: "32px",
|
|
6365
|
+
minHeight: "32px",
|
|
6355
6366
|
},
|
|
6356
6367
|
"&.MuiButton-sizeSmall": {
|
|
6357
6368
|
padding: "2px",
|
|
6358
6369
|
minWidth: "24px",
|
|
6359
6370
|
width: "24px",
|
|
6371
|
+
height: "24px",
|
|
6372
|
+
minHeight: "24px",
|
|
6360
6373
|
},
|
|
6361
6374
|
},
|
|
6362
6375
|
"&.MuiButton-sizeLarge": {
|
|
@@ -6364,7 +6377,8 @@ const StyledButton$1 = material.styled(material.Button)(({ theme }) => ({
|
|
|
6364
6377
|
fontWeight: 600,
|
|
6365
6378
|
fontSize: "16px",
|
|
6366
6379
|
lineHeight: "125%",
|
|
6367
|
-
|
|
6380
|
+
minHeight: "40px",
|
|
6381
|
+
height: "auto",
|
|
6368
6382
|
padding: "10px 16px",
|
|
6369
6383
|
},
|
|
6370
6384
|
"&.OuiButton-hasIcon.MuiButton-sizeLarge": {
|
|
@@ -6375,7 +6389,8 @@ const StyledButton$1 = material.styled(material.Button)(({ theme }) => ({
|
|
|
6375
6389
|
fontWeight: 600,
|
|
6376
6390
|
fontSize: "14px",
|
|
6377
6391
|
lineHeight: "125%",
|
|
6378
|
-
|
|
6392
|
+
minHeight: "32px",
|
|
6393
|
+
height: "auto",
|
|
6379
6394
|
padding: "7px 16px",
|
|
6380
6395
|
},
|
|
6381
6396
|
"&.MuiButton-sizeSmall": {
|
|
@@ -6383,7 +6398,8 @@ const StyledButton$1 = material.styled(material.Button)(({ theme }) => ({
|
|
|
6383
6398
|
fontWeight: 600,
|
|
6384
6399
|
fontSize: "14px",
|
|
6385
6400
|
lineHeight: "125%",
|
|
6386
|
-
|
|
6401
|
+
minHeight: "24px",
|
|
6402
|
+
height: "auto",
|
|
6387
6403
|
padding: "3px 12px",
|
|
6388
6404
|
},
|
|
6389
6405
|
"&.MuiButton-sizeLarge svg": {
|
|
@@ -6602,7 +6618,7 @@ const isIconOnlyChild = (children) => {
|
|
|
6602
6618
|
}
|
|
6603
6619
|
return child.props.children == null;
|
|
6604
6620
|
};
|
|
6605
|
-
const Button = (_a) => {
|
|
6621
|
+
const Button = React.forwardRef((_a, ref) => {
|
|
6606
6622
|
var { children, className, disableRipple = true, endIcon, startIcon } = _a, props = __rest(_a, ["children", "className", "disableRipple", "endIcon", "startIcon"]);
|
|
6607
6623
|
const hasIcon = Boolean(startIcon || endIcon);
|
|
6608
6624
|
const isIconOnly = !hasIcon && isIconOnlyChild(children);
|
|
@@ -6613,8 +6629,9 @@ const Button = (_a) => {
|
|
|
6613
6629
|
]
|
|
6614
6630
|
.filter(Boolean)
|
|
6615
6631
|
.join(" ");
|
|
6616
|
-
return (jsxRuntime.jsx(StyledButton$1, Object.assign({ className: buttonClassName || undefined, disableRipple: disableRipple, endIcon: endIcon, startIcon: startIcon }, props, { children: children })));
|
|
6617
|
-
};
|
|
6632
|
+
return (jsxRuntime.jsx(StyledButton$1, Object.assign({ ref: ref, className: buttonClassName || undefined, disableRipple: disableRipple, endIcon: endIcon, startIcon: startIcon }, props, { children: children })));
|
|
6633
|
+
});
|
|
6634
|
+
Button.displayName = "Button";
|
|
6618
6635
|
|
|
6619
6636
|
const getSpinnerWrapperStyles = (size) => ({
|
|
6620
6637
|
position: "relative",
|
|
@@ -7633,18 +7650,48 @@ const SelectNodeListItem = ({ isLeaf, isSelectable = true, listItemProps = {}, o
|
|
|
7633
7650
|
}, children: [selectNodeElement, selectableLeavesCount && (jsxRuntime.jsx(material.Typography, { variant: "body2", sx: { cursor: "pointer", color: theme.palette.vars.baseTextWeak }, children: selectableLeavesCount }))] })));
|
|
7634
7651
|
};
|
|
7635
7652
|
|
|
7653
|
+
const TOOLTIP_ARROW_WIDTH = 10;
|
|
7654
|
+
const TOOLTIP_ARROW_HEIGHT = 6;
|
|
7636
7655
|
const baseTooltipStyles = (theme) => (Object.assign(Object.assign({}, theme.typography.captionMedium), { backgroundColor: theme.palette.vars.inactiveBackgroundActive, borderRadius: "4px", boxSizing: "border-box", color: theme.palette.vars.baseTextInverse, maxWidth: "none" }));
|
|
7637
7656
|
const tooltipArrowStyles = (theme) => ({
|
|
7638
7657
|
color: theme.palette.vars.inactiveBackgroundActive,
|
|
7639
|
-
height:
|
|
7640
|
-
width:
|
|
7658
|
+
height: `${TOOLTIP_ARROW_HEIGHT}px`,
|
|
7659
|
+
width: `${TOOLTIP_ARROW_WIDTH}px`,
|
|
7641
7660
|
"&::before": {
|
|
7642
7661
|
backgroundColor: "currentColor",
|
|
7643
|
-
|
|
7644
|
-
height: "
|
|
7645
|
-
width: "
|
|
7662
|
+
display: "block",
|
|
7663
|
+
height: "100%",
|
|
7664
|
+
width: "100%",
|
|
7646
7665
|
},
|
|
7647
7666
|
});
|
|
7667
|
+
const tooltipPopperSx = {
|
|
7668
|
+
[`&[data-popper-placement*="bottom"] .MuiTooltip-arrow`]: {
|
|
7669
|
+
marginTop: `-${TOOLTIP_ARROW_HEIGHT}px`,
|
|
7670
|
+
},
|
|
7671
|
+
[`&[data-popper-placement*="top"] .MuiTooltip-arrow`]: {
|
|
7672
|
+
marginBottom: `-${TOOLTIP_ARROW_HEIGHT}px`,
|
|
7673
|
+
},
|
|
7674
|
+
[`&[data-popper-placement*="left"] .MuiTooltip-arrow, &[data-popper-placement*="right"] .MuiTooltip-arrow`]: {
|
|
7675
|
+
height: `${TOOLTIP_ARROW_WIDTH}px`,
|
|
7676
|
+
width: `${TOOLTIP_ARROW_HEIGHT}px`,
|
|
7677
|
+
},
|
|
7678
|
+
[`&[data-popper-placement*="right"] .MuiTooltip-arrow`]: {
|
|
7679
|
+
marginLeft: `-${TOOLTIP_ARROW_HEIGHT}px`,
|
|
7680
|
+
marginRight: 0,
|
|
7681
|
+
},
|
|
7682
|
+
[`&[data-popper-placement*="left"] .MuiTooltip-arrow`]: {
|
|
7683
|
+
marginRight: `-${TOOLTIP_ARROW_HEIGHT}px`,
|
|
7684
|
+
marginLeft: 0,
|
|
7685
|
+
},
|
|
7686
|
+
'[dir="rtl"] &[data-popper-placement*="right"] .MuiTooltip-arrow': {
|
|
7687
|
+
marginLeft: 0,
|
|
7688
|
+
marginRight: `-${TOOLTIP_ARROW_HEIGHT}px`,
|
|
7689
|
+
},
|
|
7690
|
+
'[dir="rtl"] &[data-popper-placement*="left"] .MuiTooltip-arrow': {
|
|
7691
|
+
marginRight: 0,
|
|
7692
|
+
marginLeft: `-${TOOLTIP_ARROW_HEIGHT}px`,
|
|
7693
|
+
},
|
|
7694
|
+
};
|
|
7648
7695
|
const largeTooltipStyles = {
|
|
7649
7696
|
height: "32px",
|
|
7650
7697
|
padding: "8px 12px",
|
|
@@ -7669,12 +7716,7 @@ const tooltipPopper = {
|
|
|
7669
7716
|
},
|
|
7670
7717
|
},
|
|
7671
7718
|
],
|
|
7672
|
-
sx:
|
|
7673
|
-
'&[data-popper-placement*="left"] .MuiTooltip-arrow, &[data-popper-placement*="right"] .MuiTooltip-arrow': {
|
|
7674
|
-
height: "10px",
|
|
7675
|
-
width: "6px",
|
|
7676
|
-
},
|
|
7677
|
-
},
|
|
7719
|
+
sx: tooltipPopperSx,
|
|
7678
7720
|
};
|
|
7679
7721
|
const tooltipSlotProps = {
|
|
7680
7722
|
[exports.TooltipSize.Medium]: {
|
|
@@ -10501,7 +10543,7 @@ const shadows$1 = [
|
|
|
10501
10543
|
darkModeFooterBottom,
|
|
10502
10544
|
...Array(17).fill("none"),
|
|
10503
10545
|
];
|
|
10504
|
-
const palette$
|
|
10546
|
+
const palette$2 = {
|
|
10505
10547
|
mode: "dark",
|
|
10506
10548
|
primary: bluePalette,
|
|
10507
10549
|
secondary: Object.assign(Object.assign({}, surfaceDarkPalette), { main: surfaceDarkPalette[500] }),
|
|
@@ -10531,7 +10573,7 @@ const palette$1 = {
|
|
|
10531
10573
|
};
|
|
10532
10574
|
const theme$1 = material.createTheme({
|
|
10533
10575
|
breakpoints,
|
|
10534
|
-
palette: palette$
|
|
10576
|
+
palette: palette$2,
|
|
10535
10577
|
typography,
|
|
10536
10578
|
mixins: commonMixins,
|
|
10537
10579
|
});
|
|
@@ -10568,6 +10610,519 @@ const darkThemeOptions = {
|
|
|
10568
10610
|
};
|
|
10569
10611
|
const darkTheme = material.createTheme(theme$1, darkThemeOptions);
|
|
10570
10612
|
|
|
10613
|
+
const iocSurface50 = "rgba(255, 255, 255, 0.02)";
|
|
10614
|
+
const iocSurface100 = "rgba(255, 255, 255, 0.035)";
|
|
10615
|
+
const iocSurface200 = "rgba(255, 255, 255, 0.06)";
|
|
10616
|
+
const iocSurface300 = "rgba(255, 255, 255, 0.09)";
|
|
10617
|
+
const iocSurface400 = "rgba(255, 255, 255, 0.12)";
|
|
10618
|
+
const iocSurface500 = "rgba(255, 255, 255, 0.16)";
|
|
10619
|
+
const iocSurfacePalette = {
|
|
10620
|
+
50: iocSurface50,
|
|
10621
|
+
100: iocSurface100,
|
|
10622
|
+
200: iocSurface200,
|
|
10623
|
+
300: iocSurface300,
|
|
10624
|
+
400: iocSurface400,
|
|
10625
|
+
500: iocSurface500,
|
|
10626
|
+
};
|
|
10627
|
+
const iocBackdrop900 = "#020508";
|
|
10628
|
+
const iocBackdrop800 = "#03080F";
|
|
10629
|
+
const iocBackdrop700 = "#050C18";
|
|
10630
|
+
const iocBackdrop600 = "#07111F";
|
|
10631
|
+
const iocBackdrop500 = "#091428";
|
|
10632
|
+
const iocBackdropPalette = {
|
|
10633
|
+
900: iocBackdrop900,
|
|
10634
|
+
800: iocBackdrop800,
|
|
10635
|
+
700: iocBackdrop700,
|
|
10636
|
+
600: iocBackdrop600,
|
|
10637
|
+
500: iocBackdrop500};
|
|
10638
|
+
const iocTeal50 = "#E6F9FE";
|
|
10639
|
+
const iocTeal100 = "#B3EEFB";
|
|
10640
|
+
const iocTeal200 = "#7DE0F8";
|
|
10641
|
+
const iocTeal300 = "#40D0F4";
|
|
10642
|
+
const iocTeal400 = "#1AC6F0";
|
|
10643
|
+
const iocTeal500 = "#00BCEB";
|
|
10644
|
+
const iocTeal600 = "#00A0D1";
|
|
10645
|
+
const iocTeal700 = "#0082AD";
|
|
10646
|
+
const iocTeal800 = "#006B8A";
|
|
10647
|
+
const iocTeal900 = "#003D54";
|
|
10648
|
+
const iocTealAlpha40 = "rgba(0, 188, 235, 0.40)";
|
|
10649
|
+
const iocTealAlpha20 = "rgba(0, 188, 235, 0.20)";
|
|
10650
|
+
const iocTealAlpha10 = "rgba(0, 188, 235, 0.10)";
|
|
10651
|
+
const iocTealAlpha05 = "rgba(0, 188, 235, 0.05)";
|
|
10652
|
+
const iocTealPalette = {
|
|
10653
|
+
50: iocTeal50,
|
|
10654
|
+
100: iocTeal100,
|
|
10655
|
+
200: iocTeal200,
|
|
10656
|
+
300: iocTeal300,
|
|
10657
|
+
400: iocTeal400,
|
|
10658
|
+
500: iocTeal500,
|
|
10659
|
+
600: iocTeal600,
|
|
10660
|
+
700: iocTeal700,
|
|
10661
|
+
800: iocTeal800,
|
|
10662
|
+
900: iocTeal900,
|
|
10663
|
+
alpha40: iocTealAlpha40,
|
|
10664
|
+
alpha20: iocTealAlpha20,
|
|
10665
|
+
alpha10: iocTealAlpha10,
|
|
10666
|
+
alpha05: iocTealAlpha05,
|
|
10667
|
+
};
|
|
10668
|
+
const iocBlue500 = "#2B82F6";
|
|
10669
|
+
const iocBlue400 = "#3B92FF";
|
|
10670
|
+
const iocBlue600 = "#1E6FD9";
|
|
10671
|
+
const iocBluePalette = {
|
|
10672
|
+
400: iocBlue400,
|
|
10673
|
+
500: iocBlue500,
|
|
10674
|
+
600: iocBlue600,
|
|
10675
|
+
};
|
|
10676
|
+
const iocBorder100 = "rgba(255, 255, 255, 0.05)";
|
|
10677
|
+
const iocBorder200 = "rgba(255, 255, 255, 0.07)";
|
|
10678
|
+
const iocBorder300 = "rgba(255, 255, 255, 0.09)";
|
|
10679
|
+
const iocBorder500 = "rgba(255, 255, 255, 0.18)";
|
|
10680
|
+
const iocBorderPalette = {
|
|
10681
|
+
100: iocBorder100,
|
|
10682
|
+
200: iocBorder200,
|
|
10683
|
+
300: iocBorder300,
|
|
10684
|
+
500: iocBorder500,
|
|
10685
|
+
};
|
|
10686
|
+
const iocTextPrimary = "rgba(255, 255, 255, 0.94)";
|
|
10687
|
+
const iocTextSecondary = "rgba(255, 255, 255, 0.55)";
|
|
10688
|
+
const iocTextTertiary = "rgba(255, 255, 255, 0.32)";
|
|
10689
|
+
const iocTextDisabled = "rgba(255, 255, 255, 0.22)";
|
|
10690
|
+
const iocPageBackground = `
|
|
10691
|
+
radial-gradient(ellipse 130% 90% at -15% -5%, rgba(0, 70, 160, 0.50) 0%, rgba(0, 40, 100, 0.15) 45%, transparent 65%),
|
|
10692
|
+
radial-gradient(ellipse 80% 60% at 60% 110%, rgba(0, 30, 80, 0.30) 0%, transparent 60%),
|
|
10693
|
+
linear-gradient(160deg, #07111F 0%, #050C18 40%, #030810 100%)
|
|
10694
|
+
`;
|
|
10695
|
+
const iocShadowSm = "0 2px 8px rgba(0, 0, 0, 0.30)";
|
|
10696
|
+
const iocShadowMd = "0 4px 16px rgba(0, 0, 0, 0.40)";
|
|
10697
|
+
const iocShadowLg = "0 8px 32px rgba(0, 0, 0, 0.50)";
|
|
10698
|
+
`linear-gradient(180deg, ${iocTealPalette[400]} 0%, ${iocTealPalette[600]} 100%)`;
|
|
10699
|
+
`linear-gradient(180deg, ${iocBluePalette[500]} 0%, ${iocBluePalette[600]} 100%)`;
|
|
10700
|
+
`linear-gradient(180deg, ${redPalette[400]} 0%, ${redPalette[500]} 100%)`;
|
|
10701
|
+
`linear-gradient(135deg, ${iocTealPalette[400]} 0%, ${iocBluePalette[500]} 100%)`;
|
|
10702
|
+
`0 0 6px ${iocTealPalette[500]}CC, 0 0 16px ${iocTealPalette[500]}77, 0 0 28px ${iocTealPalette[500]}33`;
|
|
10703
|
+
`0 0 6px ${iocBluePalette[500]}CC, 0 0 16px ${iocBluePalette[500]}77, 0 0 28px ${iocBluePalette[500]}33`;
|
|
10704
|
+
`0 0 6px ${greenPalette[500]}CC, 0 0 16px ${greenPalette[500]}77, 0 0 28px ${greenPalette[500]}33`;
|
|
10705
|
+
`0 0 6px ${lightOrangePalette[500]}CC, 0 0 16px ${lightOrangePalette[500]}77, 0 0 28px ${lightOrangePalette[500]}33`;
|
|
10706
|
+
`0 0 6px ${redPalette[500]}CC, 0 0 16px ${redPalette[500]}77, 0 0 28px ${redPalette[500]}33`;
|
|
10707
|
+
`0 0 6px ${orangePalette[500]}CC, 0 0 16px ${orangePalette[500]}77, 0 0 28px ${orangePalette[500]}33`;
|
|
10708
|
+
`0 0 6px ${lightBluePalette[500]}CC, 0 0 16px ${lightBluePalette[500]}77, 0 0 28px ${lightBluePalette[500]}33`;
|
|
10709
|
+
`0 0 6px ${iocTealPalette[600]}99, 0 0 14px ${iocTealPalette[600]}44`;
|
|
10710
|
+
|
|
10711
|
+
const iocVars = {
|
|
10712
|
+
brandOrange: lightOrangePalette[500],
|
|
10713
|
+
brandOrangeDark: lightOrangePalette[900],
|
|
10714
|
+
brandBlue: iocTealPalette[500],
|
|
10715
|
+
brandMidnightBlue: iocBackdropPalette[500],
|
|
10716
|
+
agentcyYellow: lightOrangePalette[500],
|
|
10717
|
+
agentcyBlue: iocTealPalette[500],
|
|
10718
|
+
agentcyDarkBlue: iocBackdropPalette[900],
|
|
10719
|
+
baseTextDark: iocBackdropPalette[900],
|
|
10720
|
+
baseTextStrong: iocTextPrimary,
|
|
10721
|
+
baseTextDefault: iocTextSecondary,
|
|
10722
|
+
baseTextMedium: iocTextTertiary,
|
|
10723
|
+
baseTextWeak: iocTextDisabled,
|
|
10724
|
+
baseTextInverse: iocBackdropPalette[900],
|
|
10725
|
+
baseTextDisabled: iocTextDisabled,
|
|
10726
|
+
baseBackgroundStrong: iocBackdropPalette[600],
|
|
10727
|
+
baseBackgroundMedium: iocSurfacePalette[200],
|
|
10728
|
+
baseBackgroundWeak: iocSurfacePalette[100],
|
|
10729
|
+
baseBackgroundHover: iocSurfacePalette[300],
|
|
10730
|
+
baseBorderDefault: iocBorderPalette[300],
|
|
10731
|
+
baseBorderStrong: iocBorderPalette[500],
|
|
10732
|
+
baseBorderMedium: iocBorderPalette[200],
|
|
10733
|
+
baseBorderWeak: iocBorderPalette[100],
|
|
10734
|
+
brandIconPrimaryDefault: iocTealPalette[500],
|
|
10735
|
+
brandIconPrimaryWeak: iocTealPalette[200],
|
|
10736
|
+
brandIconPrimaryMedium: iocTealPalette[400],
|
|
10737
|
+
brandIconPrimaryStrong: iocTealPalette[700],
|
|
10738
|
+
brandIconSecondaryDefault: iocBluePalette[500],
|
|
10739
|
+
brandIconSecondaryWeak: iocBluePalette[400],
|
|
10740
|
+
brandIconSecondaryMedium: iocBluePalette[500],
|
|
10741
|
+
brandIconTertiaryDefault: lightOrangePalette[500],
|
|
10742
|
+
brandIconTertiaryWeak: lightOrangePalette[200],
|
|
10743
|
+
brandIconTertiaryMedium: lightOrangePalette[400],
|
|
10744
|
+
brandBackgroundPrimaryDefault: iocTealPalette[500],
|
|
10745
|
+
brandBackgroundPrimaryWeak: iocTealPalette.alpha10,
|
|
10746
|
+
brandBackgroundPrimaryMedium: iocTealPalette.alpha20,
|
|
10747
|
+
brandBackgroundSecondaryDefault: iocBluePalette[500],
|
|
10748
|
+
brandLogoPrimary: iocTealPalette[400],
|
|
10749
|
+
brandLogoSecondary: iocTextPrimary,
|
|
10750
|
+
brandTextPrimary: iocTealPalette[400],
|
|
10751
|
+
brandTextSecondary: iocTextPrimary,
|
|
10752
|
+
brandTextTertiary: lightOrangePalette[500],
|
|
10753
|
+
controlBackgroundDefault: iocSurfacePalette[200],
|
|
10754
|
+
controlBackgroundDisabled: iocSurfacePalette[50],
|
|
10755
|
+
controlBackgroundWeak: iocSurfacePalette[300],
|
|
10756
|
+
controlBackgroundMedium: iocSurfacePalette[500],
|
|
10757
|
+
controlBorderDefault: iocBorderPalette[300],
|
|
10758
|
+
controlBorderStrong: iocBorderPalette[500],
|
|
10759
|
+
controlBorderMedium: iocBorderPalette[200],
|
|
10760
|
+
controlBorderWeak: iocBorderPalette[100],
|
|
10761
|
+
controlBorderHover: iocTealPalette[500],
|
|
10762
|
+
controlBorderActive: iocTealPalette[600],
|
|
10763
|
+
controlBorderNegative: redPalette[500],
|
|
10764
|
+
controlBorderDisabled: iocBorderPalette[100],
|
|
10765
|
+
controlIconDefault: iocTextSecondary,
|
|
10766
|
+
controlIconStrong: iocTextPrimary,
|
|
10767
|
+
controlIconMedium: iocTextTertiary,
|
|
10768
|
+
controlIconWeak: iocTextDisabled,
|
|
10769
|
+
controlIconHover: iocTealPalette[400],
|
|
10770
|
+
controlIconActive: iocTealPalette[500],
|
|
10771
|
+
controlIconDisabled: iocTextDisabled,
|
|
10772
|
+
controlFocusRingWeak: iocTealPalette.alpha10,
|
|
10773
|
+
controlFocusRingStrong: iocTealPalette.alpha20,
|
|
10774
|
+
interactivePrimaryDefaultDefault: iocTealPalette[500],
|
|
10775
|
+
interactivePrimaryDefaultHover: iocTealPalette[400],
|
|
10776
|
+
interactivePrimaryDefaultActive: iocTealPalette[600],
|
|
10777
|
+
interactivePrimaryDefaultDisabled: iocTealPalette.alpha40,
|
|
10778
|
+
interactivePrimaryWeakDefault: iocTealPalette.alpha10,
|
|
10779
|
+
interactivePrimaryWeakHover: iocTealPalette.alpha20,
|
|
10780
|
+
interactivePrimaryWeakActive: iocTealPalette.alpha40,
|
|
10781
|
+
interactivePrimaryWeakDisabled: iocTealPalette.alpha05,
|
|
10782
|
+
interactiveSecondaryDefaultDefault: iocBluePalette[500],
|
|
10783
|
+
interactiveSecondaryDefaultHover: iocBluePalette[400],
|
|
10784
|
+
interactiveSecondaryDefaultActive: iocBluePalette[600],
|
|
10785
|
+
interactiveSecondaryDefaultDisabled: "rgba(43,130,246,0.40)",
|
|
10786
|
+
interactiveSecondaryWeakDefault: iocSurfacePalette[200],
|
|
10787
|
+
interactiveSecondaryWeakHover: iocSurfacePalette[300],
|
|
10788
|
+
interactiveSecondaryWeakActive: iocSurfacePalette[400],
|
|
10789
|
+
interactiveSecondaryWeakDisabled: iocSurfacePalette[100],
|
|
10790
|
+
interactiveInverseBackgroundDefault: "rgba(255,255,255,0.90)",
|
|
10791
|
+
interactiveInverseBackgroundHover: "rgba(255,255,255,0.95)",
|
|
10792
|
+
interactiveInverseBackgroundActive: "rgba(255,255,255,0.85)",
|
|
10793
|
+
interactiveInverseBackgroundDisabled: "rgba(255,255,255,0.40)",
|
|
10794
|
+
interactiveInverseTextDefault: iocBackdropPalette[900],
|
|
10795
|
+
interactiveInverseTextHover: iocBackdropPalette[700],
|
|
10796
|
+
interactiveInverseTextActive: iocBackdropPalette[800],
|
|
10797
|
+
interactiveInverseTextDisabled: "rgba(0,0,0,0.30)",
|
|
10798
|
+
interactiveTextInDefault: iocTextPrimary,
|
|
10799
|
+
interactiveTextInHover: iocTextPrimary,
|
|
10800
|
+
interactiveTextInActive: iocTextPrimary,
|
|
10801
|
+
interactiveTextInDisabled: iocTextDisabled,
|
|
10802
|
+
interactiveTertiaryDefault: lightOrangePalette[500],
|
|
10803
|
+
interactiveTertiaryHover: lightOrangePalette[400],
|
|
10804
|
+
interactiveTertiaryActive: lightOrangePalette[600],
|
|
10805
|
+
interactiveTertiaryDisabled: lightOrangePalette["alpha40"],
|
|
10806
|
+
successBackgroundDefault: greenPalette[500],
|
|
10807
|
+
successBackgroundDisabled: greenPalette[40],
|
|
10808
|
+
successBackgroundHover: greenPalette[400],
|
|
10809
|
+
successBackgroundActive: greenPalette[600],
|
|
10810
|
+
successBackgroundWeak: "rgba(0, 185, 141, 0.10)",
|
|
10811
|
+
successIconActive: greenPalette[600],
|
|
10812
|
+
successIconDisabled: greenPalette[40],
|
|
10813
|
+
successIconHover: greenPalette[400],
|
|
10814
|
+
successIconDefault: greenPalette[500],
|
|
10815
|
+
successTextActive: greenPalette[300],
|
|
10816
|
+
successTextHover: greenPalette[200],
|
|
10817
|
+
successTextDefault: greenPalette[300],
|
|
10818
|
+
successTextInDisabled: greenPalette[10],
|
|
10819
|
+
successTextInDefault: greyPalette[900],
|
|
10820
|
+
successBorderDisabled: greenPalette[40],
|
|
10821
|
+
successBorderActive: greenPalette[600],
|
|
10822
|
+
successBorderHover: greenPalette[400],
|
|
10823
|
+
successBorderDefault: greenPalette[500],
|
|
10824
|
+
successBorderWeak: "rgba(0, 185, 141, 0.30)",
|
|
10825
|
+
successIconInDisabled: greenPalette[10],
|
|
10826
|
+
successIconInActive: greenPalette[200],
|
|
10827
|
+
successIconInHover: greenPalette[100],
|
|
10828
|
+
successIconInDefault: greenPalette[50],
|
|
10829
|
+
negativeBackgroundHover: redPalette[400],
|
|
10830
|
+
negativeBackgroundActive: redPalette[600],
|
|
10831
|
+
negativeBackgroundDisabled: redPalette["alpha40"],
|
|
10832
|
+
negativeBackgroundDefault: redPalette[500],
|
|
10833
|
+
negativeBackgroundWeak: "rgba(198, 41, 83, 0.10)",
|
|
10834
|
+
negativeTextDefault: redPalette[300],
|
|
10835
|
+
negativeTextHover: redPalette[200],
|
|
10836
|
+
negativeTextActive: redPalette[400],
|
|
10837
|
+
negativeBorderActive: redPalette[600],
|
|
10838
|
+
negativeBorderHover: redPalette[400],
|
|
10839
|
+
negativeBorderDisabled: redPalette["alpha40"],
|
|
10840
|
+
negativeBorderDefault: redPalette[500],
|
|
10841
|
+
negativeBorderWeak: "rgba(198, 41, 83, 0.30)",
|
|
10842
|
+
negativeIconDisabled: redPalette["alpha40"],
|
|
10843
|
+
negativeIconActive: redPalette[600],
|
|
10844
|
+
negativeIconHover: redPalette[400],
|
|
10845
|
+
negativeIconDefault: redPalette[500],
|
|
10846
|
+
negativeTextInDefault: redPalette[50],
|
|
10847
|
+
negativeTextInDisabled: redPalette["alpha10"],
|
|
10848
|
+
negativeIconInDefault: redPalette[50],
|
|
10849
|
+
negativeIconInHover: redPalette[100],
|
|
10850
|
+
negativeIconInActive: redPalette[200],
|
|
10851
|
+
negativeIconInDisabled: redPalette["alpha10"],
|
|
10852
|
+
excellentBackgroundDefault: lightBluePalette[600],
|
|
10853
|
+
excellentBackgroundWeak: "rgba(31, 210, 255, 0.10)",
|
|
10854
|
+
excellentBackgroundDisabled: lightBluePalette["alpha40"],
|
|
10855
|
+
excellentBackgroundHover: lightBluePalette[500],
|
|
10856
|
+
excellentBackgroundActive: lightBluePalette[700],
|
|
10857
|
+
excellentTextDefault: lightBluePalette[200],
|
|
10858
|
+
excellentTextHover: lightBluePalette[100],
|
|
10859
|
+
excellentTextActive: lightBluePalette[300],
|
|
10860
|
+
excellentTextInDefault: greyPalette[900],
|
|
10861
|
+
excellentTextInDisabled: lightBluePalette["alpha10"],
|
|
10862
|
+
excellentBorderDefault: lightBluePalette[600],
|
|
10863
|
+
excellentBorderHover: lightBluePalette[500],
|
|
10864
|
+
excellentBorderActive: lightBluePalette[700],
|
|
10865
|
+
excellentBorderDisabled: lightBluePalette["alpha40"],
|
|
10866
|
+
excellentBorderWeak: "rgba(31, 210, 255, 0.30)",
|
|
10867
|
+
excellentIconDefault: lightBluePalette[500],
|
|
10868
|
+
excellentIconHover: lightBluePalette[400],
|
|
10869
|
+
excellentIconActive: lightBluePalette[600],
|
|
10870
|
+
excellentIconDisabled: lightBluePalette["alpha40"],
|
|
10871
|
+
excellentIconInDefault: lightBluePalette[50],
|
|
10872
|
+
excellentIconInHover: lightBluePalette[100],
|
|
10873
|
+
excellentIconInActive: lightBluePalette[200],
|
|
10874
|
+
excellentIconInDisabled: lightBluePalette["alpha10"],
|
|
10875
|
+
neutralBackgroundDefault: iocTealPalette[600],
|
|
10876
|
+
neutralBackgroundWeak: iocTealPalette.alpha10,
|
|
10877
|
+
neutralBackgroundDisabled: iocTealPalette.alpha40,
|
|
10878
|
+
neutralBackgroundHover: iocTealPalette[500],
|
|
10879
|
+
neutralBackgroundActive: iocTealPalette[700],
|
|
10880
|
+
neutralTextDefault: iocTealPalette[200],
|
|
10881
|
+
neutralTextHover: iocTealPalette[100],
|
|
10882
|
+
neutralTextActive: iocTealPalette[300],
|
|
10883
|
+
neutralTextInDefault: greyPalette[900],
|
|
10884
|
+
neutralTextInDisabled: iocTealPalette.alpha10,
|
|
10885
|
+
neutralBorderDefault: iocTealPalette[600],
|
|
10886
|
+
neutralBorderHover: iocTealPalette[500],
|
|
10887
|
+
neutralBorderActive: iocTealPalette[700],
|
|
10888
|
+
neutralBorderDisabled: iocTealPalette.alpha40,
|
|
10889
|
+
neutralBorderWeak: iocTealPalette.alpha20,
|
|
10890
|
+
neutralIconDefault: iocTealPalette[500],
|
|
10891
|
+
neutralIconHover: iocTealPalette[400],
|
|
10892
|
+
neutralIconActive: iocTealPalette[600],
|
|
10893
|
+
neutralIconDisabled: iocTealPalette.alpha40,
|
|
10894
|
+
neutralIconInDefault: iocTealPalette[50],
|
|
10895
|
+
neutralIconInHover: iocTealPalette[100],
|
|
10896
|
+
neutralIconInActive: iocTealPalette[200],
|
|
10897
|
+
neutralIconInDisabled: iocTealPalette.alpha10,
|
|
10898
|
+
infoBackgroundDefault: iocBluePalette[600],
|
|
10899
|
+
infoBackgroundWeak: "rgba(43,130,246,0.10)",
|
|
10900
|
+
infoBackgroundDisabled: "rgba(43,130,246,0.40)",
|
|
10901
|
+
infoBackgroundHover: iocBluePalette[500],
|
|
10902
|
+
infoBackgroundActive: iocBluePalette[600],
|
|
10903
|
+
infoTextDefault: "#93C5FD",
|
|
10904
|
+
infoTextHover: "#BFDBFE",
|
|
10905
|
+
infoTextActive: "#60A5FA",
|
|
10906
|
+
infoTextInDefault: greyPalette[900],
|
|
10907
|
+
infoTextInDisabled: "rgba(43,130,246,0.10)",
|
|
10908
|
+
infoBorderDefault: iocBluePalette[600],
|
|
10909
|
+
infoBorderHover: iocBluePalette[500],
|
|
10910
|
+
infoBorderActive: iocBluePalette[600],
|
|
10911
|
+
infoBorderDisabled: "rgba(43,130,246,0.40)",
|
|
10912
|
+
infoBorderWeak: "rgba(43,130,246,0.20)",
|
|
10913
|
+
infoIconDefault: iocBluePalette[500],
|
|
10914
|
+
infoIconHover: iocBluePalette[400],
|
|
10915
|
+
infoIconActive: iocBluePalette[600],
|
|
10916
|
+
infoIconDisabled: "rgba(43,130,246,0.40)",
|
|
10917
|
+
infoIconInDefault: "#EFF6FF",
|
|
10918
|
+
infoIconInHover: "#BFDBFE",
|
|
10919
|
+
infoIconInActive: "#93C5FD",
|
|
10920
|
+
infoIconInDisabled: "rgba(43,130,246,0.10)",
|
|
10921
|
+
inactiveBackgroundDefault: greyPalette[600],
|
|
10922
|
+
inactiveBackgroundWeak: "rgba(60, 69, 81, 0.10)",
|
|
10923
|
+
inactiveBackgroundDisabled: greyPalette["alpha40"],
|
|
10924
|
+
inactiveBackgroundHover: greyPalette[500],
|
|
10925
|
+
inactiveBackgroundActive: greyPalette[700],
|
|
10926
|
+
inactiveTextDefault: greyPalette[200],
|
|
10927
|
+
inactiveTextHover: greyPalette[100],
|
|
10928
|
+
inactiveTextActive: greyPalette[300],
|
|
10929
|
+
inactiveTextInDefault: greyPalette[50],
|
|
10930
|
+
inactiveTextInDisabled: greyPalette["alpha40"],
|
|
10931
|
+
inactiveBorderDefault: greyPalette[600],
|
|
10932
|
+
inactiveBorderHover: greyPalette[500],
|
|
10933
|
+
inactiveBorderActive: greyPalette[700],
|
|
10934
|
+
inactiveBorderDisabled: greyPalette["alpha40"],
|
|
10935
|
+
inactiveBorderWeak: "rgba(60, 69, 81, 0.30)",
|
|
10936
|
+
inactiveIconDefault: greyPalette[400],
|
|
10937
|
+
inactiveIconHover: greyPalette[300],
|
|
10938
|
+
inactiveIconActive: greyPalette[500],
|
|
10939
|
+
inactiveIconDisabled: greyPalette["alpha40"],
|
|
10940
|
+
inactiveIconInDefault: greyPalette[0],
|
|
10941
|
+
inactiveIconInHover: greyPalette[50],
|
|
10942
|
+
inactiveIconInActive: greyPalette[100],
|
|
10943
|
+
inactiveIconInDisabled: greyPalette["alpha10"],
|
|
10944
|
+
warningBackgroundDefault: lightOrangePalette[500],
|
|
10945
|
+
warningBackgroundWeak: "rgba(251, 175, 69, 0.10)",
|
|
10946
|
+
warningBackgroundHover: lightOrangePalette[400],
|
|
10947
|
+
warningBackgroundActive: lightOrangePalette[600],
|
|
10948
|
+
warningBackgroundDisabled: lightOrangePalette["alpha40"],
|
|
10949
|
+
warningTextDefault: lightOrangePalette[200],
|
|
10950
|
+
warningTextHover: lightOrangePalette[100],
|
|
10951
|
+
warningTextActive: lightOrangePalette[300],
|
|
10952
|
+
warningTextInDefault: greyPalette[900],
|
|
10953
|
+
warningTextInDisabled: lightOrangePalette["alpha10"],
|
|
10954
|
+
warningBorderDefault: lightOrangePalette[500],
|
|
10955
|
+
warningBorderHover: lightOrangePalette[400],
|
|
10956
|
+
warningBorderActive: lightOrangePalette[600],
|
|
10957
|
+
warningBorderDisabled: lightOrangePalette["alpha40"],
|
|
10958
|
+
warningBorderWeak: "rgba(251, 175, 69, 0.30)",
|
|
10959
|
+
warningIconDefault: lightOrangePalette[500],
|
|
10960
|
+
warningIconHover: lightOrangePalette[400],
|
|
10961
|
+
warningIconActive: lightOrangePalette[600],
|
|
10962
|
+
warningIconDisabled: lightOrangePalette["alpha40"],
|
|
10963
|
+
warningIconInDefault: lightOrangePalette[50],
|
|
10964
|
+
warningIconInHover: lightOrangePalette[100],
|
|
10965
|
+
warningIconInActive: lightOrangePalette[200],
|
|
10966
|
+
warningIconInDisabled: lightOrangePalette["alpha10"],
|
|
10967
|
+
severeWarningBackgroundDefault: orangePalette[500],
|
|
10968
|
+
severeWarningBackgroundWeak: "rgba(242, 100, 61, 0.10)",
|
|
10969
|
+
severeWarningBackgroundHover: orangePalette[400],
|
|
10970
|
+
severeWarningBackgroundActive: orangePalette[600],
|
|
10971
|
+
severeWarningBackgroundDisabled: orangePalette["alpha40"],
|
|
10972
|
+
severeWarningTextDefault: orangePalette[200],
|
|
10973
|
+
severeWarningTextHover: orangePalette[100],
|
|
10974
|
+
severeWarningTextActive: orangePalette[300],
|
|
10975
|
+
severeWarningTextInDefault: greyPalette[900],
|
|
10976
|
+
severeWarningTextInDisabled: orangePalette["alpha10"],
|
|
10977
|
+
severeWarningBorderDefault: orangePalette[500],
|
|
10978
|
+
severeWarningBorderHover: orangePalette[400],
|
|
10979
|
+
severeWarningBorderActive: orangePalette[600],
|
|
10980
|
+
severeWarningBorderDisabled: orangePalette["alpha40"],
|
|
10981
|
+
severeWarningBorderWeak: "rgba(242, 100, 61, 0.30)",
|
|
10982
|
+
severeWarningIconDefault: orangePalette[500],
|
|
10983
|
+
severeWarningIconHover: orangePalette[400],
|
|
10984
|
+
severeWarningIconActive: orangePalette[600],
|
|
10985
|
+
severeWarningIconDisabled: orangePalette["alpha40"],
|
|
10986
|
+
severeWarningIconInDefault: orangePalette[50],
|
|
10987
|
+
severeWarningIconInHover: orangePalette[100],
|
|
10988
|
+
severeWarningIconInActive: orangePalette[200],
|
|
10989
|
+
severeWarningIconInDisabled: orangePalette["alpha10"],
|
|
10990
|
+
moderateBackgroundDefault: yellowPalette[500],
|
|
10991
|
+
moderateBackgroundWeak: "rgba(255, 230, 89, 0.10)",
|
|
10992
|
+
moderateBackgroundHover: yellowPalette[400],
|
|
10993
|
+
moderateBackgroundActive: yellowPalette[600],
|
|
10994
|
+
moderateBackgroundDisabled: yellowPalette["alpha40"],
|
|
10995
|
+
moderateTextDefault: yellowPalette[900],
|
|
10996
|
+
moderateTextHover: yellowPalette[800],
|
|
10997
|
+
moderateTextActive: yellowPalette[700],
|
|
10998
|
+
moderateTextInDefault: greyPalette[900],
|
|
10999
|
+
moderateTextInDisabled: yellowPalette["alpha10"],
|
|
11000
|
+
moderateBorderDefault: yellowPalette[500],
|
|
11001
|
+
moderateBorderHover: yellowPalette[400],
|
|
11002
|
+
moderateBorderActive: yellowPalette[600],
|
|
11003
|
+
moderateBorderDisabled: yellowPalette["alpha40"],
|
|
11004
|
+
moderateBorderWeak: "rgba(255, 230, 89, 0.30)",
|
|
11005
|
+
moderateIconDefault: yellowPalette[700],
|
|
11006
|
+
moderateIconHover: yellowPalette[600],
|
|
11007
|
+
moderateIconActive: yellowPalette[800],
|
|
11008
|
+
moderateIconDisabled: yellowPalette["alpha40"],
|
|
11009
|
+
moderateIconInDefault: yellowPalette[900],
|
|
11010
|
+
moderateIconInHover: yellowPalette[800],
|
|
11011
|
+
moderateIconInActive: yellowPalette[700],
|
|
11012
|
+
moderateIconInDisabled: yellowPalette["alpha10"],
|
|
11013
|
+
accentADefault: lavenderPalette[400],
|
|
11014
|
+
accentAWeak: "rgba(140, 149, 255, 0.15)",
|
|
11015
|
+
accentBDefault: sunsetPalette[300],
|
|
11016
|
+
accentBWeak: "rgba(233, 106, 141, 0.15)",
|
|
11017
|
+
accentCDefault: sunsetPalette[100],
|
|
11018
|
+
accentCWeak: "rgba(243, 172, 162, 0.15)",
|
|
11019
|
+
accentDDefault: purplePalette[400],
|
|
11020
|
+
accentDWeak: "rgba(192, 128, 255, 0.15)",
|
|
11021
|
+
accentEDefault: limePalette[400],
|
|
11022
|
+
accentEWeak: "rgba(164, 197, 71, 0.15)",
|
|
11023
|
+
accentFDefault: orangePalette[400],
|
|
11024
|
+
accentFWeak: "rgba(244, 123, 90, 0.15)",
|
|
11025
|
+
accentGDefault: nightPalette[200],
|
|
11026
|
+
accentGWeak: "rgba(70, 170, 206, 0.15)",
|
|
11027
|
+
accentHDefault: iocTealPalette[400],
|
|
11028
|
+
accentHWeak: iocTealPalette.alpha10,
|
|
11029
|
+
accentIDefault: pinkPalette[400],
|
|
11030
|
+
accentIWeak: "rgba(242, 99, 140, 0.15)",
|
|
11031
|
+
accentJDefault: tealPalette[400],
|
|
11032
|
+
accentJWeak: "rgba(62, 203, 209, 0.15)",
|
|
11033
|
+
};
|
|
11034
|
+
|
|
11035
|
+
const iocShadows = [
|
|
11036
|
+
"none",
|
|
11037
|
+
iocShadowSm,
|
|
11038
|
+
iocShadowMd,
|
|
11039
|
+
iocShadowLg,
|
|
11040
|
+
iocShadowLg,
|
|
11041
|
+
iocShadowLg,
|
|
11042
|
+
...Array(19).fill("none"),
|
|
11043
|
+
];
|
|
11044
|
+
const palette$1 = {
|
|
11045
|
+
mode: "dark",
|
|
11046
|
+
primary: Object.assign(Object.assign({}, iocTealPalette), { main: iocTealPalette[500], light: iocTealPalette[300], dark: iocTealPalette[700], contrastText: iocBackdropPalette[900] }),
|
|
11047
|
+
secondary: {
|
|
11048
|
+
main: iocBluePalette[500],
|
|
11049
|
+
light: iocBluePalette[400],
|
|
11050
|
+
dark: iocBluePalette[600],
|
|
11051
|
+
contrastText: "#ffffff",
|
|
11052
|
+
},
|
|
11053
|
+
tertiary: lightOrangePalette,
|
|
11054
|
+
error: redPalette,
|
|
11055
|
+
warning: lightOrangePalette,
|
|
11056
|
+
info: iocBluePalette,
|
|
11057
|
+
success: greenPalette,
|
|
11058
|
+
negative: redPalette,
|
|
11059
|
+
orange: orangePalette,
|
|
11060
|
+
grey: greyPalette,
|
|
11061
|
+
vars: iocVars,
|
|
11062
|
+
text: {
|
|
11063
|
+
primary: iocTextPrimary,
|
|
11064
|
+
secondary: iocTextSecondary,
|
|
11065
|
+
disabled: iocTextDisabled,
|
|
11066
|
+
},
|
|
11067
|
+
background: {
|
|
11068
|
+
paper: iocSurfacePalette[100],
|
|
11069
|
+
default: iocBackdropPalette[600],
|
|
11070
|
+
},
|
|
11071
|
+
action: {
|
|
11072
|
+
hoverOpacity: 0.08,
|
|
11073
|
+
selectedOpacity: 0.14,
|
|
11074
|
+
focusOpacity: 0.1,
|
|
11075
|
+
},
|
|
11076
|
+
};
|
|
11077
|
+
const baseTheme = material.createTheme({
|
|
11078
|
+
breakpoints,
|
|
11079
|
+
palette: palette$1,
|
|
11080
|
+
typography,
|
|
11081
|
+
mixins: commonMixins,
|
|
11082
|
+
});
|
|
11083
|
+
const iocCssBaselineComponent = {
|
|
11084
|
+
MuiCssBaseline: {
|
|
11085
|
+
styleOverrides: {
|
|
11086
|
+
html: {
|
|
11087
|
+
scrollbarWidth: "thin",
|
|
11088
|
+
scrollbarColor: `${baseTheme.palette.vars.baseTextMedium} ${baseTheme.palette.background.default}`,
|
|
11089
|
+
},
|
|
11090
|
+
body: {
|
|
11091
|
+
background: iocPageBackground,
|
|
11092
|
+
backgroundAttachment: "fixed",
|
|
11093
|
+
minHeight: "100vh",
|
|
11094
|
+
},
|
|
11095
|
+
"*::-webkit-scrollbar": { width: "12px", height: "12px" },
|
|
11096
|
+
"*::-webkit-scrollbar-track": {
|
|
11097
|
+
backgroundColor: baseTheme.palette.background.default,
|
|
11098
|
+
borderRadius: 8,
|
|
11099
|
+
},
|
|
11100
|
+
"*::-webkit-scrollbar-thumb": {
|
|
11101
|
+
backgroundColor: baseTheme.palette.vars.controlIconMedium,
|
|
11102
|
+
borderRadius: 8,
|
|
11103
|
+
border: "2px solid transparent",
|
|
11104
|
+
backgroundClip: "content-box",
|
|
11105
|
+
},
|
|
11106
|
+
"*::-webkit-scrollbar-thumb:hover": {
|
|
11107
|
+
backgroundColor: baseTheme.palette.vars.baseTextMedium,
|
|
11108
|
+
},
|
|
11109
|
+
"*::-webkit-scrollbar-corner": {
|
|
11110
|
+
backgroundColor: baseTheme.palette.background.default,
|
|
11111
|
+
},
|
|
11112
|
+
"::selection": {
|
|
11113
|
+
backgroundColor: baseTheme.palette.vars.controlFocusRingStrong,
|
|
11114
|
+
color: baseTheme.palette.vars.baseTextStrong,
|
|
11115
|
+
},
|
|
11116
|
+
},
|
|
11117
|
+
},
|
|
11118
|
+
};
|
|
11119
|
+
const iocThemeOptions = {
|
|
11120
|
+
shadows: iocShadows,
|
|
11121
|
+
components: Object.assign(Object.assign(Object.assign(Object.assign({}, buttonComponent(baseTheme)), inputComponents(baseTheme)), snackbarComponent(baseTheme)), iocCssBaselineComponent),
|
|
11122
|
+
};
|
|
11123
|
+
const iocTheme = material.createTheme(baseTheme, iocThemeOptions);
|
|
11124
|
+
iocTheme.palette.vars = iocVars;
|
|
11125
|
+
|
|
10571
11126
|
const lightVars = {
|
|
10572
11127
|
brandOrange: lightOrangePalette[500],
|
|
10573
11128
|
brandOrangeDark: lightOrangePalette[900],
|
|
@@ -10947,6 +11502,7 @@ exports.ThemeMode = void 0;
|
|
|
10947
11502
|
(function (ThemeMode) {
|
|
10948
11503
|
ThemeMode["Light"] = "light";
|
|
10949
11504
|
ThemeMode["Dark"] = "dark";
|
|
11505
|
+
ThemeMode["IoC"] = "ioc";
|
|
10950
11506
|
})(exports.ThemeMode || (exports.ThemeMode = {}));
|
|
10951
11507
|
const ThemeModeContext = React__namespace.default.createContext(null);
|
|
10952
11508
|
function useThemeMode() {
|
|
@@ -10956,17 +11512,23 @@ function useThemeMode() {
|
|
|
10956
11512
|
}
|
|
10957
11513
|
return ctx;
|
|
10958
11514
|
}
|
|
11515
|
+
function resolveBuiltInTheme(mode) {
|
|
11516
|
+
if (mode === exports.ThemeMode.IoC) {
|
|
11517
|
+
return iocTheme;
|
|
11518
|
+
}
|
|
11519
|
+
return mode === exports.ThemeMode.Dark ? darkTheme : lightTheme;
|
|
11520
|
+
}
|
|
10959
11521
|
const ThemeProvider = ({ children, defaultMode, customTheme, }) => {
|
|
10960
11522
|
const [mode, setMode] = React__namespace.default.useState(defaultMode !== null && defaultMode !== void 0 ? defaultMode : exports.ThemeMode.Light);
|
|
10961
|
-
const
|
|
10962
|
-
setMode(
|
|
11523
|
+
const setTheme = React__namespace.default.useCallback((theme) => {
|
|
11524
|
+
setMode(theme);
|
|
10963
11525
|
}, []);
|
|
10964
|
-
const resolvedTheme = customTheme !== null && customTheme !== void 0 ? customTheme : (mode
|
|
11526
|
+
const resolvedTheme = customTheme !== null && customTheme !== void 0 ? customTheme : resolveBuiltInTheme(mode);
|
|
10965
11527
|
const themeModeValue = React__namespace.default.useMemo(() => ({
|
|
10966
11528
|
mode,
|
|
10967
11529
|
setMode,
|
|
10968
|
-
|
|
10969
|
-
}), [mode,
|
|
11530
|
+
setTheme,
|
|
11531
|
+
}), [mode, setTheme]);
|
|
10970
11532
|
return (jsxRuntime.jsx(ThemeModeContext.Provider, { value: themeModeValue, children: jsxRuntime.jsxs(material.ThemeProvider, { theme: resolvedTheme, children: [jsxRuntime.jsx(material.CssBaseline, {}), children] }) }));
|
|
10971
11533
|
};
|
|
10972
11534
|
|
|
@@ -12620,44 +13182,604 @@ const PickerItem = (_a) => {
|
|
|
12620
13182
|
], children: [jsxRuntime.jsx(material.Box, { className: "picker-icon", "aria-hidden": true, children: icon }), jsxRuntime.jsx(material.Box, { component: "span", className: "picker-label", children: label })] })));
|
|
12621
13183
|
};
|
|
12622
13184
|
|
|
13185
|
+
exports.PopoverPlacementSide = void 0;
|
|
13186
|
+
(function (PopoverPlacementSide) {
|
|
13187
|
+
PopoverPlacementSide["Top"] = "top";
|
|
13188
|
+
PopoverPlacementSide["Bottom"] = "bottom";
|
|
13189
|
+
PopoverPlacementSide["Left"] = "left";
|
|
13190
|
+
PopoverPlacementSide["Right"] = "right";
|
|
13191
|
+
})(exports.PopoverPlacementSide || (exports.PopoverPlacementSide = {}));
|
|
13192
|
+
exports.PopoverPlacementAlign = void 0;
|
|
13193
|
+
(function (PopoverPlacementAlign) {
|
|
13194
|
+
PopoverPlacementAlign["Start"] = "start";
|
|
13195
|
+
PopoverPlacementAlign["End"] = "end";
|
|
13196
|
+
PopoverPlacementAlign["Center"] = "center";
|
|
13197
|
+
})(exports.PopoverPlacementAlign || (exports.PopoverPlacementAlign = {}));
|
|
13198
|
+
exports.PopoverPlacement = void 0;
|
|
13199
|
+
(function (PopoverPlacement) {
|
|
13200
|
+
PopoverPlacement["Top"] = "top";
|
|
13201
|
+
PopoverPlacement["TopStart"] = "top-start";
|
|
13202
|
+
PopoverPlacement["TopEnd"] = "top-end";
|
|
13203
|
+
PopoverPlacement["Bottom"] = "bottom";
|
|
13204
|
+
PopoverPlacement["BottomStart"] = "bottom-start";
|
|
13205
|
+
PopoverPlacement["BottomEnd"] = "bottom-end";
|
|
13206
|
+
PopoverPlacement["Left"] = "left";
|
|
13207
|
+
PopoverPlacement["LeftStart"] = "left-start";
|
|
13208
|
+
PopoverPlacement["LeftEnd"] = "left-end";
|
|
13209
|
+
PopoverPlacement["Right"] = "right";
|
|
13210
|
+
PopoverPlacement["RightStart"] = "right-start";
|
|
13211
|
+
PopoverPlacement["RightEnd"] = "right-end";
|
|
13212
|
+
})(exports.PopoverPlacement || (exports.PopoverPlacement = {}));
|
|
13213
|
+
const POPOVER_PLACEMENTS = [
|
|
13214
|
+
exports.PopoverPlacement.BottomStart,
|
|
13215
|
+
exports.PopoverPlacement.Bottom,
|
|
13216
|
+
exports.PopoverPlacement.BottomEnd,
|
|
13217
|
+
exports.PopoverPlacement.TopStart,
|
|
13218
|
+
exports.PopoverPlacement.Top,
|
|
13219
|
+
exports.PopoverPlacement.TopEnd,
|
|
13220
|
+
exports.PopoverPlacement.LeftStart,
|
|
13221
|
+
exports.PopoverPlacement.Left,
|
|
13222
|
+
exports.PopoverPlacement.LeftEnd,
|
|
13223
|
+
exports.PopoverPlacement.RightStart,
|
|
13224
|
+
exports.PopoverPlacement.Right,
|
|
13225
|
+
exports.PopoverPlacement.RightEnd,
|
|
13226
|
+
];
|
|
13227
|
+
var PopoverVerticalPlacement;
|
|
13228
|
+
(function (PopoverVerticalPlacement) {
|
|
13229
|
+
PopoverVerticalPlacement["Above"] = "above";
|
|
13230
|
+
PopoverVerticalPlacement["Below"] = "below";
|
|
13231
|
+
})(PopoverVerticalPlacement || (PopoverVerticalPlacement = {}));
|
|
13232
|
+
var PopoverHorizontalPlacement;
|
|
13233
|
+
(function (PopoverHorizontalPlacement) {
|
|
13234
|
+
PopoverHorizontalPlacement["Left"] = "left";
|
|
13235
|
+
PopoverHorizontalPlacement["Center"] = "center";
|
|
13236
|
+
PopoverHorizontalPlacement["Right"] = "right";
|
|
13237
|
+
})(PopoverHorizontalPlacement || (PopoverHorizontalPlacement = {}));
|
|
13238
|
+
var PopoverSidePlacement;
|
|
13239
|
+
(function (PopoverSidePlacement) {
|
|
13240
|
+
PopoverSidePlacement["Left"] = "left";
|
|
13241
|
+
PopoverSidePlacement["Right"] = "right";
|
|
13242
|
+
})(PopoverSidePlacement || (PopoverSidePlacement = {}));
|
|
13243
|
+
var PopoverEdgeAlignment;
|
|
13244
|
+
(function (PopoverEdgeAlignment) {
|
|
13245
|
+
PopoverEdgeAlignment["Top"] = "top";
|
|
13246
|
+
PopoverEdgeAlignment["Center"] = "center";
|
|
13247
|
+
PopoverEdgeAlignment["Bottom"] = "bottom";
|
|
13248
|
+
})(PopoverEdgeAlignment || (PopoverEdgeAlignment = {}));
|
|
13249
|
+
var PopoverArrowAxisAlign;
|
|
13250
|
+
(function (PopoverArrowAxisAlign) {
|
|
13251
|
+
PopoverArrowAxisAlign["Left"] = "left";
|
|
13252
|
+
PopoverArrowAxisAlign["Right"] = "right";
|
|
13253
|
+
PopoverArrowAxisAlign["Top"] = "top";
|
|
13254
|
+
PopoverArrowAxisAlign["Bottom"] = "bottom";
|
|
13255
|
+
PopoverArrowAxisAlign["Center"] = "center";
|
|
13256
|
+
})(PopoverArrowAxisAlign || (PopoverArrowAxisAlign = {}));
|
|
13257
|
+
|
|
13258
|
+
const VIEWPORT_MARGIN = 16;
|
|
13259
|
+
const POPOVER_ARROW_HEIGHT = 8;
|
|
13260
|
+
const POPOVER_ARROW_WIDTH = POPOVER_ARROW_HEIGHT;
|
|
13261
|
+
const CENTER_PLACEMENTS = new Set([
|
|
13262
|
+
exports.PopoverPlacement.Top,
|
|
13263
|
+
exports.PopoverPlacement.Bottom,
|
|
13264
|
+
exports.PopoverPlacement.Left,
|
|
13265
|
+
exports.PopoverPlacement.Right,
|
|
13266
|
+
]);
|
|
13267
|
+
const OPPOSITE_PLACEMENT_SIDE = {
|
|
13268
|
+
[exports.PopoverPlacementSide.Top]: exports.PopoverPlacementSide.Bottom,
|
|
13269
|
+
[exports.PopoverPlacementSide.Bottom]: exports.PopoverPlacementSide.Top,
|
|
13270
|
+
[exports.PopoverPlacementSide.Left]: exports.PopoverPlacementSide.Right,
|
|
13271
|
+
[exports.PopoverPlacementSide.Right]: exports.PopoverPlacementSide.Left,
|
|
13272
|
+
};
|
|
13273
|
+
const VERTICAL_CENTER_PLACEMENT = {
|
|
13274
|
+
[exports.PopoverPlacementSide.Top]: exports.PopoverPlacement.Top,
|
|
13275
|
+
[exports.PopoverPlacementSide.Bottom]: exports.PopoverPlacement.Bottom,
|
|
13276
|
+
};
|
|
13277
|
+
const SIDE_CENTER_PLACEMENT = {
|
|
13278
|
+
[PopoverSidePlacement.Left]: exports.PopoverPlacement.Left,
|
|
13279
|
+
[PopoverSidePlacement.Right]: exports.PopoverPlacement.Right,
|
|
13280
|
+
};
|
|
13281
|
+
|
|
13282
|
+
const getOppositePlacementSide = (side) => OPPOSITE_PLACEMENT_SIDE[side];
|
|
13283
|
+
const getPlacementSide = (placement) => placement.split("-")[0];
|
|
13284
|
+
const getPlacementAlign = (placement) => {
|
|
13285
|
+
if (CENTER_PLACEMENTS.has(placement)) {
|
|
13286
|
+
return exports.PopoverPlacementAlign.Center;
|
|
13287
|
+
}
|
|
13288
|
+
if (placement.endsWith(`-${exports.PopoverPlacementAlign.Start}`)) {
|
|
13289
|
+
return exports.PopoverPlacementAlign.Start;
|
|
13290
|
+
}
|
|
13291
|
+
return exports.PopoverPlacementAlign.End;
|
|
13292
|
+
};
|
|
13293
|
+
const getArrowAxisAlign = (placement) => {
|
|
13294
|
+
const side = getPlacementSide(placement);
|
|
13295
|
+
const align = getPlacementAlign(placement);
|
|
13296
|
+
if (side === exports.PopoverPlacementSide.Top ||
|
|
13297
|
+
side === exports.PopoverPlacementSide.Bottom) {
|
|
13298
|
+
if (align === exports.PopoverPlacementAlign.Start) {
|
|
13299
|
+
return PopoverArrowAxisAlign.Left;
|
|
13300
|
+
}
|
|
13301
|
+
if (align === exports.PopoverPlacementAlign.End) {
|
|
13302
|
+
return PopoverArrowAxisAlign.Right;
|
|
13303
|
+
}
|
|
13304
|
+
return PopoverArrowAxisAlign.Center;
|
|
13305
|
+
}
|
|
13306
|
+
if (align === exports.PopoverPlacementAlign.Start) {
|
|
13307
|
+
return PopoverArrowAxisAlign.Top;
|
|
13308
|
+
}
|
|
13309
|
+
if (align === exports.PopoverPlacementAlign.End) {
|
|
13310
|
+
return PopoverArrowAxisAlign.Bottom;
|
|
13311
|
+
}
|
|
13312
|
+
return PopoverArrowAxisAlign.Center;
|
|
13313
|
+
};
|
|
13314
|
+
|
|
13315
|
+
const toHorizontalOrigin = (align) => {
|
|
13316
|
+
if (align === exports.PopoverPlacementAlign.Start) {
|
|
13317
|
+
return PopoverHorizontalPlacement.Left;
|
|
13318
|
+
}
|
|
13319
|
+
if (align === exports.PopoverPlacementAlign.End) {
|
|
13320
|
+
return PopoverHorizontalPlacement.Right;
|
|
13321
|
+
}
|
|
13322
|
+
return PopoverHorizontalPlacement.Center;
|
|
13323
|
+
};
|
|
13324
|
+
const toVerticalOrigin = (align) => {
|
|
13325
|
+
if (align === exports.PopoverPlacementAlign.Start) {
|
|
13326
|
+
return PopoverEdgeAlignment.Top;
|
|
13327
|
+
}
|
|
13328
|
+
if (align === exports.PopoverPlacementAlign.End) {
|
|
13329
|
+
return PopoverEdgeAlignment.Bottom;
|
|
13330
|
+
}
|
|
13331
|
+
return PopoverEdgeAlignment.Center;
|
|
13332
|
+
};
|
|
13333
|
+
const getOriginsForPlacement = (placement) => {
|
|
13334
|
+
const side = getPlacementSide(placement);
|
|
13335
|
+
const align = getPlacementAlign(placement);
|
|
13336
|
+
if (side === exports.PopoverPlacementSide.Top) {
|
|
13337
|
+
const horizontal = toHorizontalOrigin(align);
|
|
13338
|
+
return {
|
|
13339
|
+
anchorOrigin: {
|
|
13340
|
+
vertical: exports.PopoverPlacementSide.Top,
|
|
13341
|
+
horizontal,
|
|
13342
|
+
},
|
|
13343
|
+
transformOrigin: {
|
|
13344
|
+
vertical: exports.PopoverPlacementSide.Bottom,
|
|
13345
|
+
horizontal,
|
|
13346
|
+
},
|
|
13347
|
+
};
|
|
13348
|
+
}
|
|
13349
|
+
if (side === exports.PopoverPlacementSide.Bottom) {
|
|
13350
|
+
const horizontal = toHorizontalOrigin(align);
|
|
13351
|
+
return {
|
|
13352
|
+
anchorOrigin: {
|
|
13353
|
+
vertical: exports.PopoverPlacementSide.Bottom,
|
|
13354
|
+
horizontal,
|
|
13355
|
+
},
|
|
13356
|
+
transformOrigin: {
|
|
13357
|
+
vertical: exports.PopoverPlacementSide.Top,
|
|
13358
|
+
horizontal,
|
|
13359
|
+
},
|
|
13360
|
+
};
|
|
13361
|
+
}
|
|
13362
|
+
if (side === exports.PopoverPlacementSide.Left) {
|
|
13363
|
+
const vertical = toVerticalOrigin(align);
|
|
13364
|
+
return {
|
|
13365
|
+
anchorOrigin: {
|
|
13366
|
+
vertical,
|
|
13367
|
+
horizontal: exports.PopoverPlacementSide.Left,
|
|
13368
|
+
},
|
|
13369
|
+
transformOrigin: {
|
|
13370
|
+
vertical,
|
|
13371
|
+
horizontal: exports.PopoverPlacementSide.Right,
|
|
13372
|
+
},
|
|
13373
|
+
};
|
|
13374
|
+
}
|
|
13375
|
+
const vertical = toVerticalOrigin(align);
|
|
13376
|
+
return {
|
|
13377
|
+
anchorOrigin: {
|
|
13378
|
+
vertical,
|
|
13379
|
+
horizontal: exports.PopoverPlacementSide.Right,
|
|
13380
|
+
},
|
|
13381
|
+
transformOrigin: {
|
|
13382
|
+
vertical,
|
|
13383
|
+
horizontal: exports.PopoverPlacementSide.Left,
|
|
13384
|
+
},
|
|
13385
|
+
};
|
|
13386
|
+
};
|
|
13387
|
+
const getOriginsForVerticalPlacement = (placement, horizontal = PopoverHorizontalPlacement.Center) => {
|
|
13388
|
+
if (placement === PopoverVerticalPlacement.Above) {
|
|
13389
|
+
return {
|
|
13390
|
+
anchorOrigin: {
|
|
13391
|
+
vertical: exports.PopoverPlacementSide.Top,
|
|
13392
|
+
horizontal,
|
|
13393
|
+
},
|
|
13394
|
+
transformOrigin: {
|
|
13395
|
+
vertical: exports.PopoverPlacementSide.Bottom,
|
|
13396
|
+
horizontal,
|
|
13397
|
+
},
|
|
13398
|
+
};
|
|
13399
|
+
}
|
|
13400
|
+
return {
|
|
13401
|
+
anchorOrigin: {
|
|
13402
|
+
vertical: exports.PopoverPlacementSide.Bottom,
|
|
13403
|
+
horizontal,
|
|
13404
|
+
},
|
|
13405
|
+
transformOrigin: {
|
|
13406
|
+
vertical: exports.PopoverPlacementSide.Top,
|
|
13407
|
+
horizontal,
|
|
13408
|
+
},
|
|
13409
|
+
};
|
|
13410
|
+
};
|
|
13411
|
+
const getVerticalPreference = (anchorOrigin, transformOrigin) => {
|
|
13412
|
+
if (transformOrigin.vertical === exports.PopoverPlacementSide.Bottom &&
|
|
13413
|
+
anchorOrigin.vertical === exports.PopoverPlacementSide.Top) {
|
|
13414
|
+
return PopoverVerticalPlacement.Above;
|
|
13415
|
+
}
|
|
13416
|
+
if (transformOrigin.vertical === exports.PopoverPlacementSide.Top &&
|
|
13417
|
+
anchorOrigin.vertical === exports.PopoverPlacementSide.Bottom) {
|
|
13418
|
+
return PopoverVerticalPlacement.Below;
|
|
13419
|
+
}
|
|
13420
|
+
return PopoverVerticalPlacement.Above;
|
|
13421
|
+
};
|
|
13422
|
+
const getHorizontalPreference = (anchorOrigin, transformOrigin) => {
|
|
13423
|
+
var _a, _b;
|
|
13424
|
+
const anchor = (_a = anchorOrigin.horizontal) !== null && _a !== void 0 ? _a : PopoverHorizontalPlacement.Center;
|
|
13425
|
+
const transform = (_b = transformOrigin.horizontal) !== null && _b !== void 0 ? _b : PopoverHorizontalPlacement.Center;
|
|
13426
|
+
if (anchor === PopoverHorizontalPlacement.Left &&
|
|
13427
|
+
transform === PopoverHorizontalPlacement.Left) {
|
|
13428
|
+
return PopoverHorizontalPlacement.Left;
|
|
13429
|
+
}
|
|
13430
|
+
if (anchor === PopoverHorizontalPlacement.Right &&
|
|
13431
|
+
transform === PopoverHorizontalPlacement.Right) {
|
|
13432
|
+
return PopoverHorizontalPlacement.Right;
|
|
13433
|
+
}
|
|
13434
|
+
return PopoverHorizontalPlacement.Center;
|
|
13435
|
+
};
|
|
13436
|
+
const getSidePreference = (placement) => getPlacementSide(placement) === exports.PopoverPlacementSide.Right
|
|
13437
|
+
? PopoverSidePlacement.Right
|
|
13438
|
+
: PopoverSidePlacement.Left;
|
|
13439
|
+
const getEdgeAlignmentPreference = (placement) => {
|
|
13440
|
+
const align = getPlacementAlign(placement);
|
|
13441
|
+
if (align === exports.PopoverPlacementAlign.Start) {
|
|
13442
|
+
return PopoverEdgeAlignment.Top;
|
|
13443
|
+
}
|
|
13444
|
+
if (align === exports.PopoverPlacementAlign.End) {
|
|
13445
|
+
return PopoverEdgeAlignment.Bottom;
|
|
13446
|
+
}
|
|
13447
|
+
return PopoverEdgeAlignment.Center;
|
|
13448
|
+
};
|
|
13449
|
+
|
|
13450
|
+
const getPopoverHorizontalBounds = ({ anchorLeft, anchorRight, anchorWidth, popoverWidth, horizontal, }) => {
|
|
13451
|
+
switch (horizontal) {
|
|
13452
|
+
case PopoverHorizontalPlacement.Left:
|
|
13453
|
+
return { left: anchorLeft, right: anchorLeft + popoverWidth };
|
|
13454
|
+
case PopoverHorizontalPlacement.Right:
|
|
13455
|
+
return { left: anchorRight - popoverWidth, right: anchorRight };
|
|
13456
|
+
default: {
|
|
13457
|
+
const center = anchorLeft + anchorWidth / 2;
|
|
13458
|
+
return {
|
|
13459
|
+
left: center - popoverWidth / 2,
|
|
13460
|
+
right: center + popoverWidth / 2,
|
|
13461
|
+
};
|
|
13462
|
+
}
|
|
13463
|
+
}
|
|
13464
|
+
};
|
|
13465
|
+
const getPopoverVerticalBounds = ({ anchorTop, anchorBottom, anchorHeight, popoverHeight, vertical, }) => {
|
|
13466
|
+
switch (vertical) {
|
|
13467
|
+
case PopoverEdgeAlignment.Top:
|
|
13468
|
+
return { top: anchorTop, bottom: anchorTop + popoverHeight };
|
|
13469
|
+
case PopoverEdgeAlignment.Bottom:
|
|
13470
|
+
return { top: anchorBottom - popoverHeight, bottom: anchorBottom };
|
|
13471
|
+
default: {
|
|
13472
|
+
const center = anchorTop + anchorHeight / 2;
|
|
13473
|
+
return {
|
|
13474
|
+
top: center - popoverHeight / 2,
|
|
13475
|
+
bottom: center + popoverHeight / 2,
|
|
13476
|
+
};
|
|
13477
|
+
}
|
|
13478
|
+
}
|
|
13479
|
+
};
|
|
13480
|
+
|
|
13481
|
+
const resolveVerticalPlacement = ({ preferAbove, spaceAbove, spaceBelow, popoverHeight, hasArrow, margin = VIEWPORT_MARGIN, }) => {
|
|
13482
|
+
const clearance = hasArrow ? POPOVER_ARROW_HEIGHT : 0;
|
|
13483
|
+
const required = popoverHeight + clearance;
|
|
13484
|
+
const aboveRoom = spaceAbove - margin;
|
|
13485
|
+
const belowRoom = spaceBelow - margin;
|
|
13486
|
+
const fitsAbove = aboveRoom >= required;
|
|
13487
|
+
const fitsBelow = belowRoom >= required;
|
|
13488
|
+
if (preferAbove && fitsAbove)
|
|
13489
|
+
return PopoverVerticalPlacement.Above;
|
|
13490
|
+
if (!preferAbove && fitsBelow)
|
|
13491
|
+
return PopoverVerticalPlacement.Below;
|
|
13492
|
+
if (fitsAbove && !fitsBelow)
|
|
13493
|
+
return PopoverVerticalPlacement.Above;
|
|
13494
|
+
if (fitsBelow && !fitsAbove)
|
|
13495
|
+
return PopoverVerticalPlacement.Below;
|
|
13496
|
+
return aboveRoom >= belowRoom
|
|
13497
|
+
? PopoverVerticalPlacement.Above
|
|
13498
|
+
: PopoverVerticalPlacement.Below;
|
|
13499
|
+
};
|
|
13500
|
+
const resolveHorizontalPlacement = ({ preferHorizontal, anchorLeft, anchorRight, anchorWidth, popoverWidth, margin = VIEWPORT_MARGIN, viewportWidth, }) => {
|
|
13501
|
+
const fits = (horizontal) => {
|
|
13502
|
+
const { left, right } = getPopoverHorizontalBounds({
|
|
13503
|
+
anchorLeft,
|
|
13504
|
+
anchorRight,
|
|
13505
|
+
anchorWidth,
|
|
13506
|
+
popoverWidth,
|
|
13507
|
+
horizontal,
|
|
13508
|
+
});
|
|
13509
|
+
return left >= margin && right <= viewportWidth - margin;
|
|
13510
|
+
};
|
|
13511
|
+
if (fits(preferHorizontal))
|
|
13512
|
+
return preferHorizontal;
|
|
13513
|
+
const alternatives = (() => {
|
|
13514
|
+
if (preferHorizontal === PopoverHorizontalPlacement.Center) {
|
|
13515
|
+
const { left } = getPopoverHorizontalBounds({
|
|
13516
|
+
anchorLeft,
|
|
13517
|
+
anchorRight,
|
|
13518
|
+
anchorWidth,
|
|
13519
|
+
popoverWidth,
|
|
13520
|
+
horizontal: PopoverHorizontalPlacement.Center,
|
|
13521
|
+
});
|
|
13522
|
+
return left < margin
|
|
13523
|
+
? [PopoverHorizontalPlacement.Left, PopoverHorizontalPlacement.Right]
|
|
13524
|
+
: [PopoverHorizontalPlacement.Right, PopoverHorizontalPlacement.Left];
|
|
13525
|
+
}
|
|
13526
|
+
if (preferHorizontal === PopoverHorizontalPlacement.Left) {
|
|
13527
|
+
return [
|
|
13528
|
+
PopoverHorizontalPlacement.Right,
|
|
13529
|
+
PopoverHorizontalPlacement.Center,
|
|
13530
|
+
];
|
|
13531
|
+
}
|
|
13532
|
+
return [PopoverHorizontalPlacement.Left, PopoverHorizontalPlacement.Center];
|
|
13533
|
+
})();
|
|
13534
|
+
for (const horizontal of alternatives) {
|
|
13535
|
+
if (fits(horizontal))
|
|
13536
|
+
return horizontal;
|
|
13537
|
+
}
|
|
13538
|
+
const overflow = (horizontal) => {
|
|
13539
|
+
const { left, right } = getPopoverHorizontalBounds({
|
|
13540
|
+
anchorLeft,
|
|
13541
|
+
anchorRight,
|
|
13542
|
+
anchorWidth,
|
|
13543
|
+
popoverWidth,
|
|
13544
|
+
horizontal,
|
|
13545
|
+
});
|
|
13546
|
+
const leftOverflow = Math.max(0, margin - left);
|
|
13547
|
+
const rightOverflow = Math.max(0, right - (viewportWidth - margin));
|
|
13548
|
+
return leftOverflow + rightOverflow;
|
|
13549
|
+
};
|
|
13550
|
+
const all = [
|
|
13551
|
+
PopoverHorizontalPlacement.Left,
|
|
13552
|
+
PopoverHorizontalPlacement.Center,
|
|
13553
|
+
PopoverHorizontalPlacement.Right,
|
|
13554
|
+
];
|
|
13555
|
+
return all.reduce((best, current) => overflow(current) < overflow(best) ? current : best);
|
|
13556
|
+
};
|
|
13557
|
+
const resolveSidePlacement = ({ preferSide, spaceLeft, spaceRight, popoverWidth, hasArrow, margin = VIEWPORT_MARGIN, }) => {
|
|
13558
|
+
const clearance = POPOVER_ARROW_WIDTH ;
|
|
13559
|
+
const required = popoverWidth + clearance;
|
|
13560
|
+
const leftRoom = spaceLeft - margin;
|
|
13561
|
+
const rightRoom = spaceRight - margin;
|
|
13562
|
+
const fitsLeft = leftRoom >= required;
|
|
13563
|
+
const fitsRight = rightRoom >= required;
|
|
13564
|
+
if (preferSide === PopoverSidePlacement.Left && fitsLeft) {
|
|
13565
|
+
return PopoverSidePlacement.Left;
|
|
13566
|
+
}
|
|
13567
|
+
if (preferSide === PopoverSidePlacement.Right && fitsRight) {
|
|
13568
|
+
return PopoverSidePlacement.Right;
|
|
13569
|
+
}
|
|
13570
|
+
if (fitsLeft && !fitsRight)
|
|
13571
|
+
return PopoverSidePlacement.Left;
|
|
13572
|
+
if (fitsRight && !fitsLeft)
|
|
13573
|
+
return PopoverSidePlacement.Right;
|
|
13574
|
+
return leftRoom >= rightRoom
|
|
13575
|
+
? PopoverSidePlacement.Left
|
|
13576
|
+
: PopoverSidePlacement.Right;
|
|
13577
|
+
};
|
|
13578
|
+
const resolveEdgeAlignment = ({ preferAlignment, anchorTop, anchorBottom, anchorHeight, popoverHeight, margin = VIEWPORT_MARGIN, viewportHeight, }) => {
|
|
13579
|
+
const fits = (vertical) => {
|
|
13580
|
+
const { top, bottom } = getPopoverVerticalBounds({
|
|
13581
|
+
anchorTop,
|
|
13582
|
+
anchorBottom,
|
|
13583
|
+
anchorHeight,
|
|
13584
|
+
popoverHeight,
|
|
13585
|
+
vertical,
|
|
13586
|
+
});
|
|
13587
|
+
return top >= margin && bottom <= viewportHeight - margin;
|
|
13588
|
+
};
|
|
13589
|
+
if (fits(preferAlignment))
|
|
13590
|
+
return preferAlignment;
|
|
13591
|
+
const alternatives = (() => {
|
|
13592
|
+
if (preferAlignment === PopoverEdgeAlignment.Center) {
|
|
13593
|
+
const { top } = getPopoverVerticalBounds({
|
|
13594
|
+
anchorTop,
|
|
13595
|
+
anchorBottom,
|
|
13596
|
+
anchorHeight,
|
|
13597
|
+
popoverHeight,
|
|
13598
|
+
vertical: PopoverEdgeAlignment.Center,
|
|
13599
|
+
});
|
|
13600
|
+
return top < margin
|
|
13601
|
+
? [PopoverEdgeAlignment.Top, PopoverEdgeAlignment.Bottom]
|
|
13602
|
+
: [PopoverEdgeAlignment.Bottom, PopoverEdgeAlignment.Top];
|
|
13603
|
+
}
|
|
13604
|
+
if (preferAlignment === PopoverEdgeAlignment.Top) {
|
|
13605
|
+
return [PopoverEdgeAlignment.Bottom, PopoverEdgeAlignment.Center];
|
|
13606
|
+
}
|
|
13607
|
+
return [PopoverEdgeAlignment.Top, PopoverEdgeAlignment.Center];
|
|
13608
|
+
})();
|
|
13609
|
+
for (const vertical of alternatives) {
|
|
13610
|
+
if (fits(vertical))
|
|
13611
|
+
return vertical;
|
|
13612
|
+
}
|
|
13613
|
+
const overflow = (vertical) => {
|
|
13614
|
+
const { top, bottom } = getPopoverVerticalBounds({
|
|
13615
|
+
anchorTop,
|
|
13616
|
+
anchorBottom,
|
|
13617
|
+
anchorHeight,
|
|
13618
|
+
popoverHeight,
|
|
13619
|
+
vertical,
|
|
13620
|
+
});
|
|
13621
|
+
const topOverflow = Math.max(0, margin - top);
|
|
13622
|
+
const bottomOverflow = Math.max(0, bottom - (viewportHeight - margin));
|
|
13623
|
+
return topOverflow + bottomOverflow;
|
|
13624
|
+
};
|
|
13625
|
+
const all = [
|
|
13626
|
+
PopoverEdgeAlignment.Top,
|
|
13627
|
+
PopoverEdgeAlignment.Center,
|
|
13628
|
+
PopoverEdgeAlignment.Bottom,
|
|
13629
|
+
];
|
|
13630
|
+
return all.reduce((best, current) => overflow(current) < overflow(best) ? current : best);
|
|
13631
|
+
};
|
|
13632
|
+
|
|
13633
|
+
const placementSideToSidePlacement = (side) => side === exports.PopoverPlacementSide.Right
|
|
13634
|
+
? PopoverSidePlacement.Right
|
|
13635
|
+
: PopoverSidePlacement.Left;
|
|
13636
|
+
const formatVerticalPlacement = (side, align) => {
|
|
13637
|
+
if (align === exports.PopoverPlacementAlign.Center) {
|
|
13638
|
+
return VERTICAL_CENTER_PLACEMENT[side];
|
|
13639
|
+
}
|
|
13640
|
+
return `${side}-${align}`;
|
|
13641
|
+
};
|
|
13642
|
+
const formatSidePlacement = (side, align) => {
|
|
13643
|
+
if (align === exports.PopoverPlacementAlign.Center) {
|
|
13644
|
+
return SIDE_CENTER_PLACEMENT[side];
|
|
13645
|
+
}
|
|
13646
|
+
return `${side}-${align}`;
|
|
13647
|
+
};
|
|
13648
|
+
const horizontalToPlacementAlign = (horizontal) => {
|
|
13649
|
+
if (horizontal === PopoverHorizontalPlacement.Left) {
|
|
13650
|
+
return exports.PopoverPlacementAlign.Start;
|
|
13651
|
+
}
|
|
13652
|
+
if (horizontal === PopoverHorizontalPlacement.Right) {
|
|
13653
|
+
return exports.PopoverPlacementAlign.End;
|
|
13654
|
+
}
|
|
13655
|
+
return exports.PopoverPlacementAlign.Center;
|
|
13656
|
+
};
|
|
13657
|
+
const edgeToPlacementAlign = (edge) => {
|
|
13658
|
+
if (edge === PopoverEdgeAlignment.Top) {
|
|
13659
|
+
return exports.PopoverPlacementAlign.Start;
|
|
13660
|
+
}
|
|
13661
|
+
if (edge === PopoverEdgeAlignment.Bottom) {
|
|
13662
|
+
return exports.PopoverPlacementAlign.End;
|
|
13663
|
+
}
|
|
13664
|
+
return exports.PopoverPlacementAlign.Center;
|
|
13665
|
+
};
|
|
13666
|
+
const placementForVerticalPlacement = (placement, verticalPlacement) => {
|
|
13667
|
+
const side = getPlacementSide(placement);
|
|
13668
|
+
if (side !== exports.PopoverPlacementSide.Top &&
|
|
13669
|
+
side !== exports.PopoverPlacementSide.Bottom) {
|
|
13670
|
+
return placement;
|
|
13671
|
+
}
|
|
13672
|
+
const align = getPlacementAlign(placement);
|
|
13673
|
+
return verticalPlacement === PopoverVerticalPlacement.Above
|
|
13674
|
+
? formatVerticalPlacement(exports.PopoverPlacementSide.Top, align)
|
|
13675
|
+
: formatVerticalPlacement(exports.PopoverPlacementSide.Bottom, align);
|
|
13676
|
+
};
|
|
13677
|
+
const placementForHorizontalPlacement = (placement, horizontal) => {
|
|
13678
|
+
const side = getPlacementSide(placement);
|
|
13679
|
+
if (side !== exports.PopoverPlacementSide.Top &&
|
|
13680
|
+
side !== exports.PopoverPlacementSide.Bottom) {
|
|
13681
|
+
return placement;
|
|
13682
|
+
}
|
|
13683
|
+
return formatVerticalPlacement(side, horizontalToPlacementAlign(horizontal));
|
|
13684
|
+
};
|
|
13685
|
+
const placementForSidePlacement = (placement, side) => {
|
|
13686
|
+
const placementSide = getPlacementSide(placement);
|
|
13687
|
+
if (placementSide !== exports.PopoverPlacementSide.Left &&
|
|
13688
|
+
placementSide !== exports.PopoverPlacementSide.Right) {
|
|
13689
|
+
return placement;
|
|
13690
|
+
}
|
|
13691
|
+
return formatSidePlacement(side, getPlacementAlign(placement));
|
|
13692
|
+
};
|
|
13693
|
+
const placementForEdgeAlignment = (placement, align) => {
|
|
13694
|
+
const side = getPlacementSide(placement);
|
|
13695
|
+
if (side !== exports.PopoverPlacementSide.Left &&
|
|
13696
|
+
side !== exports.PopoverPlacementSide.Right) {
|
|
13697
|
+
return placement;
|
|
13698
|
+
}
|
|
13699
|
+
return formatSidePlacement(placementSideToSidePlacement(side), edgeToPlacementAlign(align));
|
|
13700
|
+
};
|
|
13701
|
+
|
|
13702
|
+
const getArrowEdgeSide = (placement) => getOppositePlacementSide(getPlacementSide(placement));
|
|
12623
13703
|
const ARROW_SIZE = 16;
|
|
12624
13704
|
const ARROW_HALF = ARROW_SIZE / 2;
|
|
12625
|
-
const ARROW_HEIGHT =
|
|
13705
|
+
const ARROW_HEIGHT = POPOVER_ARROW_HEIGHT;
|
|
12626
13706
|
const ARROW_OFFSET = 12;
|
|
12627
13707
|
const popoverWidthBySize = {
|
|
12628
13708
|
medium: "228px",
|
|
12629
13709
|
large: "360px",
|
|
12630
13710
|
};
|
|
12631
|
-
const
|
|
12632
|
-
|
|
13711
|
+
const popoverContentLayoutBySize = {
|
|
13712
|
+
medium: { padding: "12px 16px", gap: "16px" },
|
|
13713
|
+
large: { padding: "16px 20px", gap: "20px" },
|
|
13714
|
+
};
|
|
13715
|
+
const getPaperArrowOffset = (placement, anchorOrigin = {
|
|
13716
|
+
vertical: exports.PopoverPlacementSide.Top,
|
|
13717
|
+
}, transformOrigin = {
|
|
13718
|
+
vertical: exports.PopoverPlacementSide.Top,
|
|
13719
|
+
}) => {
|
|
13720
|
+
if (!placement)
|
|
12633
13721
|
return {};
|
|
12634
|
-
|
|
12635
|
-
|
|
12636
|
-
|
|
13722
|
+
const side = getPlacementSide(placement);
|
|
13723
|
+
if (side === exports.PopoverPlacementSide.Top &&
|
|
13724
|
+
anchorOrigin.vertical === exports.PopoverPlacementSide.Top &&
|
|
13725
|
+
transformOrigin.vertical === exports.PopoverPlacementSide.Bottom) {
|
|
13726
|
+
return { marginTop: `-${ARROW_HEIGHT}px` };
|
|
13727
|
+
}
|
|
13728
|
+
if (side === exports.PopoverPlacementSide.Bottom &&
|
|
13729
|
+
anchorOrigin.vertical === exports.PopoverPlacementSide.Bottom &&
|
|
13730
|
+
transformOrigin.vertical === exports.PopoverPlacementSide.Top) {
|
|
13731
|
+
return { marginTop: `${ARROW_HEIGHT}px` };
|
|
13732
|
+
}
|
|
13733
|
+
if (side === exports.PopoverPlacementSide.Left &&
|
|
13734
|
+
anchorOrigin.horizontal === exports.PopoverPlacementSide.Left &&
|
|
13735
|
+
transformOrigin.horizontal === exports.PopoverPlacementSide.Right) {
|
|
13736
|
+
return { marginLeft: `-${ARROW_HEIGHT}px` };
|
|
13737
|
+
}
|
|
13738
|
+
if (side === exports.PopoverPlacementSide.Right &&
|
|
13739
|
+
anchorOrigin.horizontal === exports.PopoverPlacementSide.Right &&
|
|
13740
|
+
transformOrigin.horizontal === exports.PopoverPlacementSide.Left) {
|
|
13741
|
+
return { marginLeft: `${ARROW_HEIGHT}px` };
|
|
13742
|
+
}
|
|
13743
|
+
return {};
|
|
12637
13744
|
};
|
|
12638
|
-
const getArrowStyles = (
|
|
13745
|
+
const getArrowStyles = (placement, bg) => {
|
|
13746
|
+
const edgeSide = getArrowEdgeSide(placement);
|
|
13747
|
+
const align = getArrowAxisAlign(placement);
|
|
12639
13748
|
const base = {
|
|
12640
13749
|
position: "absolute",
|
|
12641
|
-
width: `${ARROW_SIZE}px`,
|
|
12642
|
-
height: `${ARROW_HEIGHT}px`,
|
|
12643
13750
|
background: bg,
|
|
12644
|
-
zIndex:
|
|
13751
|
+
zIndex: 2,
|
|
13752
|
+
pointerEvents: "none",
|
|
12645
13753
|
};
|
|
12646
|
-
const horizontal =
|
|
13754
|
+
const horizontal = align === PopoverArrowAxisAlign.Center
|
|
12647
13755
|
? { left: `calc(50% - ${ARROW_HALF}px)` }
|
|
12648
|
-
:
|
|
13756
|
+
: align === PopoverArrowAxisAlign.Left
|
|
12649
13757
|
? { left: `${ARROW_OFFSET}px` }
|
|
12650
13758
|
: { right: `${ARROW_OFFSET}px` };
|
|
12651
|
-
|
|
12652
|
-
|
|
13759
|
+
const vertical = align === PopoverArrowAxisAlign.Center
|
|
13760
|
+
? { top: `calc(50% - ${ARROW_HALF}px)` }
|
|
13761
|
+
: align === PopoverArrowAxisAlign.Top
|
|
13762
|
+
? { top: `${ARROW_OFFSET}px` }
|
|
13763
|
+
: { bottom: `${ARROW_OFFSET}px` };
|
|
13764
|
+
if (edgeSide === exports.PopoverPlacementSide.Bottom) {
|
|
13765
|
+
return Object.assign(Object.assign(Object.assign({}, base), horizontal), { width: `${ARROW_SIZE}px`, height: `${ARROW_HEIGHT}px`, bottom: `-${ARROW_HEIGHT}px`, clipPath: `polygon(50% 100%, 0 0, 100% 0)` });
|
|
13766
|
+
}
|
|
13767
|
+
if (edgeSide === exports.PopoverPlacementSide.Top) {
|
|
13768
|
+
return Object.assign(Object.assign(Object.assign({}, base), horizontal), { width: `${ARROW_SIZE}px`, height: `${ARROW_HEIGHT}px`, top: `-${ARROW_HEIGHT}px`, clipPath: `polygon(0 100%, 50% 0, 100% 100%)` });
|
|
12653
13769
|
}
|
|
12654
|
-
|
|
13770
|
+
if (edgeSide === exports.PopoverPlacementSide.Left) {
|
|
13771
|
+
return Object.assign(Object.assign(Object.assign({}, base), vertical), { width: `${ARROW_HEIGHT}px`, height: `${ARROW_SIZE}px`, left: `-${ARROW_HEIGHT}px`, clipPath: `polygon(0 50%, 100% 0, 100% 100%)` });
|
|
13772
|
+
}
|
|
13773
|
+
return Object.assign(Object.assign(Object.assign({}, base), vertical), { width: `${ARROW_HEIGHT}px`, height: `${ARROW_SIZE}px`, right: `-${ARROW_HEIGHT}px`, clipPath: `polygon(100% 50%, 0 0, 0 100%)` });
|
|
12655
13774
|
};
|
|
12656
13775
|
const getPopoverPaperStyles = (theme, size = "medium") => {
|
|
12657
13776
|
var _a;
|
|
12658
|
-
|
|
13777
|
+
const width = popoverWidthBySize[size];
|
|
13778
|
+
return {
|
|
12659
13779
|
boxSizing: "border-box",
|
|
12660
|
-
width
|
|
13780
|
+
width,
|
|
13781
|
+
minWidth: width,
|
|
13782
|
+
maxWidth: width,
|
|
12661
13783
|
background: (_a = theme.palette.vars) === null || _a === void 0 ? void 0 : _a.controlBackgroundDefault,
|
|
12662
13784
|
borderRadius: "6px",
|
|
12663
13785
|
boxShadow: "none",
|
|
@@ -12665,25 +13787,34 @@ const getPopoverPaperStyles = (theme, size = "medium") => {
|
|
|
12665
13787
|
? `drop-shadow(${darkModeCardFloating})`
|
|
12666
13788
|
: `drop-shadow(${lightModeCardFloating})`,
|
|
12667
13789
|
overflow: "visible",
|
|
12668
|
-
|
|
13790
|
+
overflowX: "visible",
|
|
13791
|
+
overflowY: "visible",
|
|
13792
|
+
};
|
|
13793
|
+
};
|
|
13794
|
+
const popoverSurfaceStyles = {
|
|
13795
|
+
position: "relative",
|
|
13796
|
+
boxSizing: "border-box",
|
|
13797
|
+
width: "100%",
|
|
13798
|
+
overflow: "visible",
|
|
12669
13799
|
};
|
|
12670
|
-
const getPopoverContentStyles = (theme, featureHighlight = false) => {
|
|
13800
|
+
const getPopoverContentStyles = (theme, featureHighlight = false, size = "medium") => {
|
|
12671
13801
|
var _a, _b;
|
|
12672
|
-
|
|
13802
|
+
const layout = popoverContentLayoutBySize[size];
|
|
13803
|
+
return {
|
|
12673
13804
|
boxSizing: "border-box",
|
|
12674
13805
|
display: "flex",
|
|
12675
13806
|
flexDirection: "row",
|
|
12676
13807
|
justifyContent: "flex-end",
|
|
12677
13808
|
alignItems: "flex-start",
|
|
12678
|
-
gap:
|
|
12679
|
-
padding:
|
|
13809
|
+
gap: layout.gap,
|
|
13810
|
+
padding: layout.padding,
|
|
12680
13811
|
width: "100%",
|
|
12681
13812
|
background: (_a = theme.palette.vars) === null || _a === void 0 ? void 0 : _a.controlBackgroundDefault,
|
|
12682
13813
|
border: featureHighlight
|
|
12683
13814
|
? `2px solid ${(_b = theme.palette.vars) === null || _b === void 0 ? void 0 : _b.controlBorderActive}`
|
|
12684
13815
|
: "0px solid transparent",
|
|
12685
13816
|
borderRadius: "6px",
|
|
12686
|
-
}
|
|
13817
|
+
};
|
|
12687
13818
|
};
|
|
12688
13819
|
const popoverColumnStyles = {
|
|
12689
13820
|
display: "flex",
|
|
@@ -12735,10 +13866,15 @@ const popoverBodyStyles = (theme) => {
|
|
|
12735
13866
|
const popoverActionsStyles = {
|
|
12736
13867
|
display: "flex",
|
|
12737
13868
|
flexDirection: "row",
|
|
13869
|
+
flexWrap: "wrap",
|
|
12738
13870
|
justifyContent: "flex-end",
|
|
12739
13871
|
alignItems: "center",
|
|
12740
13872
|
gap: "12px",
|
|
12741
13873
|
width: "100%",
|
|
13874
|
+
"& .MuiButton-root": {
|
|
13875
|
+
flexShrink: 0,
|
|
13876
|
+
whiteSpace: "nowrap",
|
|
13877
|
+
},
|
|
12742
13878
|
};
|
|
12743
13879
|
const closeButtonStyles = {
|
|
12744
13880
|
padding: "2px",
|
|
@@ -12746,21 +13882,174 @@ const closeButtonStyles = {
|
|
|
12746
13882
|
flexShrink: 0,
|
|
12747
13883
|
};
|
|
12748
13884
|
|
|
13885
|
+
const resolveAnchorRect = (anchorEl) => {
|
|
13886
|
+
var _a, _b;
|
|
13887
|
+
if (!anchorEl)
|
|
13888
|
+
return null;
|
|
13889
|
+
const resolved = typeof anchorEl === "function" ? anchorEl() : anchorEl;
|
|
13890
|
+
return (_b = (_a = resolved === null || resolved === void 0 ? void 0 : resolved.getBoundingClientRect) === null || _a === void 0 ? void 0 : _a.call(resolved)) !== null && _b !== void 0 ? _b : null;
|
|
13891
|
+
};
|
|
13892
|
+
const resolvePlacementState = ({ anchorOrigin, transformOrigin, placement, }) => {
|
|
13893
|
+
if (placement) {
|
|
13894
|
+
const origins = getOriginsForPlacement(placement);
|
|
13895
|
+
return {
|
|
13896
|
+
anchorOrigin: origins.anchorOrigin,
|
|
13897
|
+
transformOrigin: origins.transformOrigin,
|
|
13898
|
+
placement,
|
|
13899
|
+
};
|
|
13900
|
+
}
|
|
13901
|
+
return { anchorOrigin, transformOrigin, placement };
|
|
13902
|
+
};
|
|
13903
|
+
const isSameResolvedState = (current, next) => current.placement === next.placement &&
|
|
13904
|
+
current.anchorOrigin.vertical === next.anchorOrigin.vertical &&
|
|
13905
|
+
current.anchorOrigin.horizontal === next.anchorOrigin.horizontal &&
|
|
13906
|
+
current.transformOrigin.vertical === next.transformOrigin.vertical &&
|
|
13907
|
+
current.transformOrigin.horizontal === next.transformOrigin.horizontal;
|
|
13908
|
+
const getPreferenceOrigins = ({ anchorOrigin, transformOrigin, placement, }) => placement
|
|
13909
|
+
? getOriginsForPlacement(placement)
|
|
13910
|
+
: { anchorOrigin, transformOrigin };
|
|
13911
|
+
const useResolvedPopoverPlacement = ({ open, anchorEl, anchorOrigin, transformOrigin, placement, }) => {
|
|
13912
|
+
const paperRef = React.useRef(null);
|
|
13913
|
+
const [resolved, setResolved] = React.useState(() => resolvePlacementState({ anchorOrigin, transformOrigin, placement }));
|
|
13914
|
+
const updateResolved = (next) => {
|
|
13915
|
+
setResolved((current) => isSameResolvedState(current, next) ? current : next);
|
|
13916
|
+
};
|
|
13917
|
+
React.useLayoutEffect(() => {
|
|
13918
|
+
if (!open) {
|
|
13919
|
+
updateResolved(resolvePlacementState({ anchorOrigin, transformOrigin, placement }));
|
|
13920
|
+
return;
|
|
13921
|
+
}
|
|
13922
|
+
const anchorRect = resolveAnchorRect(anchorEl);
|
|
13923
|
+
if (!anchorRect)
|
|
13924
|
+
return;
|
|
13925
|
+
const { anchorOrigin: preferenceAnchorOrigin, transformOrigin: preferenceTransformOrigin, } = getPreferenceOrigins({ anchorOrigin, transformOrigin, placement });
|
|
13926
|
+
const measure = () => {
|
|
13927
|
+
const paper = paperRef.current;
|
|
13928
|
+
if (!paper)
|
|
13929
|
+
return;
|
|
13930
|
+
if (placement) {
|
|
13931
|
+
const placementSide = getPlacementSide(placement);
|
|
13932
|
+
if (placementSide === exports.PopoverPlacementSide.Top ||
|
|
13933
|
+
placementSide === exports.PopoverPlacementSide.Bottom) {
|
|
13934
|
+
const preferAbove = getVerticalPreference(preferenceAnchorOrigin, preferenceTransformOrigin) === "above";
|
|
13935
|
+
const preferHorizontal = getHorizontalPreference(preferenceAnchorOrigin, preferenceTransformOrigin);
|
|
13936
|
+
const verticalPlacement = resolveVerticalPlacement({
|
|
13937
|
+
preferAbove,
|
|
13938
|
+
spaceAbove: anchorRect.top,
|
|
13939
|
+
spaceBelow: window.innerHeight - anchorRect.bottom,
|
|
13940
|
+
popoverHeight: paper.offsetHeight,
|
|
13941
|
+
hasArrow: true,
|
|
13942
|
+
});
|
|
13943
|
+
const horizontalPlacement = resolveHorizontalPlacement({
|
|
13944
|
+
preferHorizontal,
|
|
13945
|
+
anchorLeft: anchorRect.left,
|
|
13946
|
+
anchorRight: anchorRect.right,
|
|
13947
|
+
anchorWidth: anchorRect.width,
|
|
13948
|
+
popoverWidth: paper.offsetWidth,
|
|
13949
|
+
viewportWidth: window.innerWidth,
|
|
13950
|
+
});
|
|
13951
|
+
const nextPlacement = placementForHorizontalPlacement(placementForVerticalPlacement(placement, verticalPlacement), horizontalPlacement);
|
|
13952
|
+
const origins = getOriginsForPlacement(nextPlacement);
|
|
13953
|
+
updateResolved({
|
|
13954
|
+
anchorOrigin: origins.anchorOrigin,
|
|
13955
|
+
transformOrigin: origins.transformOrigin,
|
|
13956
|
+
placement: nextPlacement,
|
|
13957
|
+
});
|
|
13958
|
+
return;
|
|
13959
|
+
}
|
|
13960
|
+
const preferSide = getSidePreference(placement);
|
|
13961
|
+
const preferAlignment = getEdgeAlignmentPreference(placement);
|
|
13962
|
+
const sidePlacement = resolveSidePlacement({
|
|
13963
|
+
preferSide,
|
|
13964
|
+
spaceLeft: anchorRect.left,
|
|
13965
|
+
spaceRight: window.innerWidth - anchorRect.right,
|
|
13966
|
+
popoverWidth: paper.offsetWidth,
|
|
13967
|
+
hasArrow: true,
|
|
13968
|
+
});
|
|
13969
|
+
const edgeAlignment = resolveEdgeAlignment({
|
|
13970
|
+
preferAlignment,
|
|
13971
|
+
anchorTop: anchorRect.top,
|
|
13972
|
+
anchorBottom: anchorRect.bottom,
|
|
13973
|
+
anchorHeight: anchorRect.height,
|
|
13974
|
+
popoverHeight: paper.offsetHeight,
|
|
13975
|
+
viewportHeight: window.innerHeight,
|
|
13976
|
+
});
|
|
13977
|
+
const nextPlacement = placementForEdgeAlignment(placementForSidePlacement(placement, sidePlacement), edgeAlignment);
|
|
13978
|
+
const origins = getOriginsForPlacement(nextPlacement);
|
|
13979
|
+
updateResolved({
|
|
13980
|
+
anchorOrigin: origins.anchorOrigin,
|
|
13981
|
+
transformOrigin: origins.transformOrigin,
|
|
13982
|
+
placement: nextPlacement,
|
|
13983
|
+
});
|
|
13984
|
+
return;
|
|
13985
|
+
}
|
|
13986
|
+
const preferAbove = getVerticalPreference(preferenceAnchorOrigin, preferenceTransformOrigin) === "above";
|
|
13987
|
+
const verticalPlacement = resolveVerticalPlacement({
|
|
13988
|
+
preferAbove,
|
|
13989
|
+
spaceAbove: anchorRect.top,
|
|
13990
|
+
spaceBelow: window.innerHeight - anchorRect.bottom,
|
|
13991
|
+
popoverHeight: paper.offsetHeight,
|
|
13992
|
+
hasArrow: false,
|
|
13993
|
+
});
|
|
13994
|
+
const horizontalPlacement = resolveHorizontalPlacement({
|
|
13995
|
+
preferHorizontal: getHorizontalPreference(preferenceAnchorOrigin, preferenceTransformOrigin),
|
|
13996
|
+
anchorLeft: anchorRect.left,
|
|
13997
|
+
anchorRight: anchorRect.right,
|
|
13998
|
+
anchorWidth: anchorRect.width,
|
|
13999
|
+
popoverWidth: paper.offsetWidth,
|
|
14000
|
+
viewportWidth: window.innerWidth,
|
|
14001
|
+
});
|
|
14002
|
+
const origins = getOriginsForVerticalPlacement(verticalPlacement, horizontalPlacement);
|
|
14003
|
+
updateResolved({
|
|
14004
|
+
anchorOrigin: origins.anchorOrigin,
|
|
14005
|
+
transformOrigin: origins.transformOrigin,
|
|
14006
|
+
placement,
|
|
14007
|
+
});
|
|
14008
|
+
};
|
|
14009
|
+
const frame = requestAnimationFrame(measure);
|
|
14010
|
+
return () => cancelAnimationFrame(frame);
|
|
14011
|
+
}, [open, anchorEl, anchorOrigin, transformOrigin, placement]);
|
|
14012
|
+
const paperOffsetSx = getPaperArrowOffset(resolved.placement, resolved.anchorOrigin, resolved.transformOrigin);
|
|
14013
|
+
return {
|
|
14014
|
+
paperRef,
|
|
14015
|
+
anchorOrigin: resolved.anchorOrigin,
|
|
14016
|
+
transformOrigin: resolved.transformOrigin,
|
|
14017
|
+
placement: resolved.placement,
|
|
14018
|
+
paperOffsetSx,
|
|
14019
|
+
};
|
|
14020
|
+
};
|
|
14021
|
+
|
|
14022
|
+
const DEFAULT_POPOVER_ANCHOR_ORIGIN = {
|
|
14023
|
+
vertical: exports.PopoverPlacementSide.Top,
|
|
14024
|
+
horizontal: PopoverHorizontalPlacement.Left,
|
|
14025
|
+
};
|
|
14026
|
+
const DEFAULT_POPOVER_TRANSFORM_ORIGIN = {
|
|
14027
|
+
vertical: exports.PopoverPlacementSide.Top,
|
|
14028
|
+
horizontal: PopoverHorizontalPlacement.Left,
|
|
14029
|
+
};
|
|
12749
14030
|
const Popover = (_a) => {
|
|
12750
|
-
var { title, body, actions, icon, showCloseButton = false, featureHighlight = false, size = "medium",
|
|
14031
|
+
var { title, body, actions, icon, showCloseButton = false, featureHighlight = false, size = "medium", placement, paperSx, onClose, children, anchorOrigin = DEFAULT_POPOVER_ANCHOR_ORIGIN, transformOrigin = DEFAULT_POPOVER_TRANSFORM_ORIGIN, open = false, disableScrollLock = true } = _a, props = __rest(_a, ["title", "body", "actions", "icon", "showCloseButton", "featureHighlight", "size", "placement", "paperSx", "onClose", "children", "anchorOrigin", "transformOrigin", "open", "disableScrollLock"]);
|
|
12751
14032
|
const theme = material.useTheme();
|
|
14033
|
+
const { paperRef, anchorOrigin: resolvedAnchorOrigin, transformOrigin: resolvedTransformOrigin, placement: resolvedPlacement, paperOffsetSx, } = useResolvedPopoverPlacement({
|
|
14034
|
+
open,
|
|
14035
|
+
anchorEl: props.anchorEl,
|
|
14036
|
+
anchorOrigin,
|
|
14037
|
+
transformOrigin,
|
|
14038
|
+
placement,
|
|
14039
|
+
});
|
|
12752
14040
|
const bg = featureHighlight
|
|
12753
14041
|
? theme.palette.vars.controlBorderActive
|
|
12754
14042
|
: theme.palette.vars.controlBackgroundDefault;
|
|
12755
|
-
return (jsxRuntime.
|
|
14043
|
+
return (jsxRuntime.jsx(material.Popover, Object.assign({}, props, { open: open, disableScrollLock: disableScrollLock, marginThreshold: null, anchorOrigin: resolvedAnchorOrigin, transformOrigin: resolvedTransformOrigin, onClose: onClose, slotProps: {
|
|
12756
14044
|
paper: {
|
|
14045
|
+
ref: paperRef,
|
|
12757
14046
|
sx: [
|
|
12758
14047
|
getPopoverPaperStyles(theme, size),
|
|
12759
|
-
|
|
14048
|
+
paperOffsetSx,
|
|
12760
14049
|
...(Array.isArray(paperSx) ? paperSx : paperSx ? [paperSx] : []),
|
|
12761
14050
|
],
|
|
12762
14051
|
},
|
|
12763
|
-
}, children: [
|
|
14052
|
+
}, children: jsxRuntime.jsxs(material.Box, { sx: popoverSurfaceStyles, children: [resolvedPlacement && (jsxRuntime.jsx(material.Box, { "aria-hidden": true, "data-slot": "popover-arrow", sx: getArrowStyles(resolvedPlacement, bg) })), children !== null && children !== void 0 ? children : (jsxRuntime.jsxs(material.Box, { sx: getPopoverContentStyles(theme, featureHighlight, size), children: [icon && jsxRuntime.jsx(material.Box, { sx: popoverIconStyles, children: icon }), jsxRuntime.jsxs(material.Box, { sx: popoverColumnStyles, children: [(title || body || showCloseButton) && (jsxRuntime.jsxs(material.Box, { sx: popoverTextStyles, children: [(title || showCloseButton) && (jsxRuntime.jsxs(material.Box, { sx: popoverHeaderStyles, children: [title && (jsxRuntime.jsx(material.Typography, { component: "div", sx: popoverTitleStyles(theme), children: title })), showCloseButton && (jsxRuntime.jsx(material.IconButton, { "aria-label": "Close popover", size: "small", onClick: () => onClose === null || onClose === void 0 ? void 0 : onClose({}, "escapeKeyDown"), sx: closeButtonStyles, children: jsxRuntime.jsx(CloseIcon__default.default, { fontSize: "small" }) }))] })), body && (jsxRuntime.jsx(material.Typography, { component: "div", sx: popoverBodyStyles(theme), children: body }))] })), actions && jsxRuntime.jsx(material.Box, { sx: popoverActionsStyles, children: actions })] })] }))] }) })));
|
|
12764
14053
|
};
|
|
12765
14054
|
|
|
12766
14055
|
const getRadioButtonStyles = (theme) => ({
|
|
@@ -16109,6 +17398,7 @@ exports.NestedMenuListbox = NestedMenuListbox;
|
|
|
16109
17398
|
exports.NoData = NoData;
|
|
16110
17399
|
exports.OS_LIGHT_COLORS = OS_LIGHT_COLORS;
|
|
16111
17400
|
exports.OverflowTooltip = OverflowTooltip;
|
|
17401
|
+
exports.POPOVER_PLACEMENTS = POPOVER_PLACEMENTS;
|
|
16112
17402
|
exports.PageTitle = PageTitle;
|
|
16113
17403
|
exports.Pagination = Pagination;
|
|
16114
17404
|
exports.PathDisplay = PathDisplay;
|
|
@@ -16240,6 +17530,7 @@ exports.illustrationSurface = illustrationSurface;
|
|
|
16240
17530
|
exports.illustrationSurfaceSubtle = illustrationSurfaceSubtle;
|
|
16241
17531
|
exports.illustrationWarningGradientEnd = illustrationWarningGradientEnd;
|
|
16242
17532
|
exports.illustrationWarningGradientStart = illustrationWarningGradientStart;
|
|
17533
|
+
exports.iocVars = iocVars;
|
|
16243
17534
|
exports.isLeaf = isLeaf;
|
|
16244
17535
|
exports.lavender10 = lavender10;
|
|
16245
17536
|
exports.lavender100 = lavender100;
|