@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.umd.js
CHANGED
|
@@ -6265,6 +6265,13 @@
|
|
|
6265
6265
|
textTransform: "none",
|
|
6266
6266
|
transition: "none",
|
|
6267
6267
|
borderRadius: "4px",
|
|
6268
|
+
width: "max-content",
|
|
6269
|
+
maxWidth: "100%",
|
|
6270
|
+
whiteSpace: "normal",
|
|
6271
|
+
overflowWrap: "break-word",
|
|
6272
|
+
textAlign: "center",
|
|
6273
|
+
alignItems: "center",
|
|
6274
|
+
height: "auto",
|
|
6268
6275
|
"& .MuiButton-startIcon": {
|
|
6269
6276
|
marginLeft: "0px",
|
|
6270
6277
|
},
|
|
@@ -6276,16 +6283,22 @@
|
|
|
6276
6283
|
padding: "8px",
|
|
6277
6284
|
minWidth: "40px",
|
|
6278
6285
|
width: "40px",
|
|
6286
|
+
height: "40px",
|
|
6287
|
+
minHeight: "40px",
|
|
6279
6288
|
},
|
|
6280
6289
|
"&.MuiButton-sizeMedium": {
|
|
6281
6290
|
padding: "6px",
|
|
6282
6291
|
minWidth: "32px",
|
|
6283
6292
|
width: "32px",
|
|
6293
|
+
height: "32px",
|
|
6294
|
+
minHeight: "32px",
|
|
6284
6295
|
},
|
|
6285
6296
|
"&.MuiButton-sizeSmall": {
|
|
6286
6297
|
padding: "2px",
|
|
6287
6298
|
minWidth: "24px",
|
|
6288
6299
|
width: "24px",
|
|
6300
|
+
height: "24px",
|
|
6301
|
+
minHeight: "24px",
|
|
6289
6302
|
},
|
|
6290
6303
|
},
|
|
6291
6304
|
"&.MuiButton-sizeLarge": {
|
|
@@ -6293,7 +6306,8 @@
|
|
|
6293
6306
|
fontWeight: 600,
|
|
6294
6307
|
fontSize: "16px",
|
|
6295
6308
|
lineHeight: "125%",
|
|
6296
|
-
|
|
6309
|
+
minHeight: "40px",
|
|
6310
|
+
height: "auto",
|
|
6297
6311
|
padding: "10px 16px",
|
|
6298
6312
|
},
|
|
6299
6313
|
"&.OuiButton-hasIcon.MuiButton-sizeLarge": {
|
|
@@ -6304,7 +6318,8 @@
|
|
|
6304
6318
|
fontWeight: 600,
|
|
6305
6319
|
fontSize: "14px",
|
|
6306
6320
|
lineHeight: "125%",
|
|
6307
|
-
|
|
6321
|
+
minHeight: "32px",
|
|
6322
|
+
height: "auto",
|
|
6308
6323
|
padding: "7px 16px",
|
|
6309
6324
|
},
|
|
6310
6325
|
"&.MuiButton-sizeSmall": {
|
|
@@ -6312,7 +6327,8 @@
|
|
|
6312
6327
|
fontWeight: 600,
|
|
6313
6328
|
fontSize: "14px",
|
|
6314
6329
|
lineHeight: "125%",
|
|
6315
|
-
|
|
6330
|
+
minHeight: "24px",
|
|
6331
|
+
height: "auto",
|
|
6316
6332
|
padding: "3px 12px",
|
|
6317
6333
|
},
|
|
6318
6334
|
"&.MuiButton-sizeLarge svg": {
|
|
@@ -6531,7 +6547,7 @@
|
|
|
6531
6547
|
}
|
|
6532
6548
|
return child.props.children == null;
|
|
6533
6549
|
};
|
|
6534
|
-
const Button = (_a) => {
|
|
6550
|
+
const Button = React.forwardRef((_a, ref) => {
|
|
6535
6551
|
var { children, className, disableRipple = true, endIcon, startIcon } = _a, props = __rest(_a, ["children", "className", "disableRipple", "endIcon", "startIcon"]);
|
|
6536
6552
|
const hasIcon = Boolean(startIcon || endIcon);
|
|
6537
6553
|
const isIconOnly = !hasIcon && isIconOnlyChild(children);
|
|
@@ -6542,8 +6558,9 @@
|
|
|
6542
6558
|
]
|
|
6543
6559
|
.filter(Boolean)
|
|
6544
6560
|
.join(" ");
|
|
6545
|
-
return (jsxRuntime.jsx(StyledButton$1, Object.assign({ className: buttonClassName || undefined, disableRipple: disableRipple, endIcon: endIcon, startIcon: startIcon }, props, { children: children })));
|
|
6546
|
-
};
|
|
6561
|
+
return (jsxRuntime.jsx(StyledButton$1, Object.assign({ ref: ref, className: buttonClassName || undefined, disableRipple: disableRipple, endIcon: endIcon, startIcon: startIcon }, props, { children: children })));
|
|
6562
|
+
});
|
|
6563
|
+
Button.displayName = "Button";
|
|
6547
6564
|
|
|
6548
6565
|
const getSpinnerWrapperStyles = (size) => ({
|
|
6549
6566
|
position: "relative",
|
|
@@ -7562,18 +7579,48 @@
|
|
|
7562
7579
|
}, children: [selectNodeElement, selectableLeavesCount && (jsxRuntime.jsx(material.Typography, { variant: "body2", sx: { cursor: "pointer", color: theme.palette.vars.baseTextWeak }, children: selectableLeavesCount }))] })));
|
|
7563
7580
|
};
|
|
7564
7581
|
|
|
7582
|
+
const TOOLTIP_ARROW_WIDTH = 10;
|
|
7583
|
+
const TOOLTIP_ARROW_HEIGHT = 6;
|
|
7565
7584
|
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" }));
|
|
7566
7585
|
const tooltipArrowStyles = (theme) => ({
|
|
7567
7586
|
color: theme.palette.vars.inactiveBackgroundActive,
|
|
7568
|
-
height:
|
|
7569
|
-
width:
|
|
7587
|
+
height: `${TOOLTIP_ARROW_HEIGHT}px`,
|
|
7588
|
+
width: `${TOOLTIP_ARROW_WIDTH}px`,
|
|
7570
7589
|
"&::before": {
|
|
7571
7590
|
backgroundColor: "currentColor",
|
|
7572
|
-
|
|
7573
|
-
height: "
|
|
7574
|
-
width: "
|
|
7591
|
+
display: "block",
|
|
7592
|
+
height: "100%",
|
|
7593
|
+
width: "100%",
|
|
7575
7594
|
},
|
|
7576
7595
|
});
|
|
7596
|
+
const tooltipPopperSx = {
|
|
7597
|
+
[`&[data-popper-placement*="bottom"] .MuiTooltip-arrow`]: {
|
|
7598
|
+
marginTop: `-${TOOLTIP_ARROW_HEIGHT}px`,
|
|
7599
|
+
},
|
|
7600
|
+
[`&[data-popper-placement*="top"] .MuiTooltip-arrow`]: {
|
|
7601
|
+
marginBottom: `-${TOOLTIP_ARROW_HEIGHT}px`,
|
|
7602
|
+
},
|
|
7603
|
+
[`&[data-popper-placement*="left"] .MuiTooltip-arrow, &[data-popper-placement*="right"] .MuiTooltip-arrow`]: {
|
|
7604
|
+
height: `${TOOLTIP_ARROW_WIDTH}px`,
|
|
7605
|
+
width: `${TOOLTIP_ARROW_HEIGHT}px`,
|
|
7606
|
+
},
|
|
7607
|
+
[`&[data-popper-placement*="right"] .MuiTooltip-arrow`]: {
|
|
7608
|
+
marginLeft: `-${TOOLTIP_ARROW_HEIGHT}px`,
|
|
7609
|
+
marginRight: 0,
|
|
7610
|
+
},
|
|
7611
|
+
[`&[data-popper-placement*="left"] .MuiTooltip-arrow`]: {
|
|
7612
|
+
marginRight: `-${TOOLTIP_ARROW_HEIGHT}px`,
|
|
7613
|
+
marginLeft: 0,
|
|
7614
|
+
},
|
|
7615
|
+
'[dir="rtl"] &[data-popper-placement*="right"] .MuiTooltip-arrow': {
|
|
7616
|
+
marginLeft: 0,
|
|
7617
|
+
marginRight: `-${TOOLTIP_ARROW_HEIGHT}px`,
|
|
7618
|
+
},
|
|
7619
|
+
'[dir="rtl"] &[data-popper-placement*="left"] .MuiTooltip-arrow': {
|
|
7620
|
+
marginRight: 0,
|
|
7621
|
+
marginLeft: `-${TOOLTIP_ARROW_HEIGHT}px`,
|
|
7622
|
+
},
|
|
7623
|
+
};
|
|
7577
7624
|
const largeTooltipStyles = {
|
|
7578
7625
|
height: "32px",
|
|
7579
7626
|
padding: "8px 12px",
|
|
@@ -7598,12 +7645,7 @@
|
|
|
7598
7645
|
},
|
|
7599
7646
|
},
|
|
7600
7647
|
],
|
|
7601
|
-
sx:
|
|
7602
|
-
'&[data-popper-placement*="left"] .MuiTooltip-arrow, &[data-popper-placement*="right"] .MuiTooltip-arrow': {
|
|
7603
|
-
height: "10px",
|
|
7604
|
-
width: "6px",
|
|
7605
|
-
},
|
|
7606
|
-
},
|
|
7648
|
+
sx: tooltipPopperSx,
|
|
7607
7649
|
};
|
|
7608
7650
|
const tooltipSlotProps = {
|
|
7609
7651
|
[exports.TooltipSize.Medium]: {
|
|
@@ -10430,7 +10472,7 @@
|
|
|
10430
10472
|
darkModeFooterBottom,
|
|
10431
10473
|
...Array(17).fill("none"),
|
|
10432
10474
|
];
|
|
10433
|
-
const palette$
|
|
10475
|
+
const palette$2 = {
|
|
10434
10476
|
mode: "dark",
|
|
10435
10477
|
primary: bluePalette,
|
|
10436
10478
|
secondary: Object.assign(Object.assign({}, surfaceDarkPalette), { main: surfaceDarkPalette[500] }),
|
|
@@ -10460,7 +10502,7 @@
|
|
|
10460
10502
|
};
|
|
10461
10503
|
const theme$1 = material.createTheme({
|
|
10462
10504
|
breakpoints,
|
|
10463
|
-
palette: palette$
|
|
10505
|
+
palette: palette$2,
|
|
10464
10506
|
typography,
|
|
10465
10507
|
mixins: commonMixins,
|
|
10466
10508
|
});
|
|
@@ -10497,6 +10539,519 @@
|
|
|
10497
10539
|
};
|
|
10498
10540
|
const darkTheme = material.createTheme(theme$1, darkThemeOptions);
|
|
10499
10541
|
|
|
10542
|
+
const iocSurface50 = "rgba(255, 255, 255, 0.02)";
|
|
10543
|
+
const iocSurface100 = "rgba(255, 255, 255, 0.035)";
|
|
10544
|
+
const iocSurface200 = "rgba(255, 255, 255, 0.06)";
|
|
10545
|
+
const iocSurface300 = "rgba(255, 255, 255, 0.09)";
|
|
10546
|
+
const iocSurface400 = "rgba(255, 255, 255, 0.12)";
|
|
10547
|
+
const iocSurface500 = "rgba(255, 255, 255, 0.16)";
|
|
10548
|
+
const iocSurfacePalette = {
|
|
10549
|
+
50: iocSurface50,
|
|
10550
|
+
100: iocSurface100,
|
|
10551
|
+
200: iocSurface200,
|
|
10552
|
+
300: iocSurface300,
|
|
10553
|
+
400: iocSurface400,
|
|
10554
|
+
500: iocSurface500,
|
|
10555
|
+
};
|
|
10556
|
+
const iocBackdrop900 = "#020508";
|
|
10557
|
+
const iocBackdrop800 = "#03080F";
|
|
10558
|
+
const iocBackdrop700 = "#050C18";
|
|
10559
|
+
const iocBackdrop600 = "#07111F";
|
|
10560
|
+
const iocBackdrop500 = "#091428";
|
|
10561
|
+
const iocBackdropPalette = {
|
|
10562
|
+
900: iocBackdrop900,
|
|
10563
|
+
800: iocBackdrop800,
|
|
10564
|
+
700: iocBackdrop700,
|
|
10565
|
+
600: iocBackdrop600,
|
|
10566
|
+
500: iocBackdrop500};
|
|
10567
|
+
const iocTeal50 = "#E6F9FE";
|
|
10568
|
+
const iocTeal100 = "#B3EEFB";
|
|
10569
|
+
const iocTeal200 = "#7DE0F8";
|
|
10570
|
+
const iocTeal300 = "#40D0F4";
|
|
10571
|
+
const iocTeal400 = "#1AC6F0";
|
|
10572
|
+
const iocTeal500 = "#00BCEB";
|
|
10573
|
+
const iocTeal600 = "#00A0D1";
|
|
10574
|
+
const iocTeal700 = "#0082AD";
|
|
10575
|
+
const iocTeal800 = "#006B8A";
|
|
10576
|
+
const iocTeal900 = "#003D54";
|
|
10577
|
+
const iocTealAlpha40 = "rgba(0, 188, 235, 0.40)";
|
|
10578
|
+
const iocTealAlpha20 = "rgba(0, 188, 235, 0.20)";
|
|
10579
|
+
const iocTealAlpha10 = "rgba(0, 188, 235, 0.10)";
|
|
10580
|
+
const iocTealAlpha05 = "rgba(0, 188, 235, 0.05)";
|
|
10581
|
+
const iocTealPalette = {
|
|
10582
|
+
50: iocTeal50,
|
|
10583
|
+
100: iocTeal100,
|
|
10584
|
+
200: iocTeal200,
|
|
10585
|
+
300: iocTeal300,
|
|
10586
|
+
400: iocTeal400,
|
|
10587
|
+
500: iocTeal500,
|
|
10588
|
+
600: iocTeal600,
|
|
10589
|
+
700: iocTeal700,
|
|
10590
|
+
800: iocTeal800,
|
|
10591
|
+
900: iocTeal900,
|
|
10592
|
+
alpha40: iocTealAlpha40,
|
|
10593
|
+
alpha20: iocTealAlpha20,
|
|
10594
|
+
alpha10: iocTealAlpha10,
|
|
10595
|
+
alpha05: iocTealAlpha05,
|
|
10596
|
+
};
|
|
10597
|
+
const iocBlue500 = "#2B82F6";
|
|
10598
|
+
const iocBlue400 = "#3B92FF";
|
|
10599
|
+
const iocBlue600 = "#1E6FD9";
|
|
10600
|
+
const iocBluePalette = {
|
|
10601
|
+
400: iocBlue400,
|
|
10602
|
+
500: iocBlue500,
|
|
10603
|
+
600: iocBlue600,
|
|
10604
|
+
};
|
|
10605
|
+
const iocBorder100 = "rgba(255, 255, 255, 0.05)";
|
|
10606
|
+
const iocBorder200 = "rgba(255, 255, 255, 0.07)";
|
|
10607
|
+
const iocBorder300 = "rgba(255, 255, 255, 0.09)";
|
|
10608
|
+
const iocBorder500 = "rgba(255, 255, 255, 0.18)";
|
|
10609
|
+
const iocBorderPalette = {
|
|
10610
|
+
100: iocBorder100,
|
|
10611
|
+
200: iocBorder200,
|
|
10612
|
+
300: iocBorder300,
|
|
10613
|
+
500: iocBorder500,
|
|
10614
|
+
};
|
|
10615
|
+
const iocTextPrimary = "rgba(255, 255, 255, 0.94)";
|
|
10616
|
+
const iocTextSecondary = "rgba(255, 255, 255, 0.55)";
|
|
10617
|
+
const iocTextTertiary = "rgba(255, 255, 255, 0.32)";
|
|
10618
|
+
const iocTextDisabled = "rgba(255, 255, 255, 0.22)";
|
|
10619
|
+
const iocPageBackground = `
|
|
10620
|
+
radial-gradient(ellipse 130% 90% at -15% -5%, rgba(0, 70, 160, 0.50) 0%, rgba(0, 40, 100, 0.15) 45%, transparent 65%),
|
|
10621
|
+
radial-gradient(ellipse 80% 60% at 60% 110%, rgba(0, 30, 80, 0.30) 0%, transparent 60%),
|
|
10622
|
+
linear-gradient(160deg, #07111F 0%, #050C18 40%, #030810 100%)
|
|
10623
|
+
`;
|
|
10624
|
+
const iocShadowSm = "0 2px 8px rgba(0, 0, 0, 0.30)";
|
|
10625
|
+
const iocShadowMd = "0 4px 16px rgba(0, 0, 0, 0.40)";
|
|
10626
|
+
const iocShadowLg = "0 8px 32px rgba(0, 0, 0, 0.50)";
|
|
10627
|
+
`linear-gradient(180deg, ${iocTealPalette[400]} 0%, ${iocTealPalette[600]} 100%)`;
|
|
10628
|
+
`linear-gradient(180deg, ${iocBluePalette[500]} 0%, ${iocBluePalette[600]} 100%)`;
|
|
10629
|
+
`linear-gradient(180deg, ${redPalette[400]} 0%, ${redPalette[500]} 100%)`;
|
|
10630
|
+
`linear-gradient(135deg, ${iocTealPalette[400]} 0%, ${iocBluePalette[500]} 100%)`;
|
|
10631
|
+
`0 0 6px ${iocTealPalette[500]}CC, 0 0 16px ${iocTealPalette[500]}77, 0 0 28px ${iocTealPalette[500]}33`;
|
|
10632
|
+
`0 0 6px ${iocBluePalette[500]}CC, 0 0 16px ${iocBluePalette[500]}77, 0 0 28px ${iocBluePalette[500]}33`;
|
|
10633
|
+
`0 0 6px ${greenPalette[500]}CC, 0 0 16px ${greenPalette[500]}77, 0 0 28px ${greenPalette[500]}33`;
|
|
10634
|
+
`0 0 6px ${lightOrangePalette[500]}CC, 0 0 16px ${lightOrangePalette[500]}77, 0 0 28px ${lightOrangePalette[500]}33`;
|
|
10635
|
+
`0 0 6px ${redPalette[500]}CC, 0 0 16px ${redPalette[500]}77, 0 0 28px ${redPalette[500]}33`;
|
|
10636
|
+
`0 0 6px ${orangePalette[500]}CC, 0 0 16px ${orangePalette[500]}77, 0 0 28px ${orangePalette[500]}33`;
|
|
10637
|
+
`0 0 6px ${lightBluePalette[500]}CC, 0 0 16px ${lightBluePalette[500]}77, 0 0 28px ${lightBluePalette[500]}33`;
|
|
10638
|
+
`0 0 6px ${iocTealPalette[600]}99, 0 0 14px ${iocTealPalette[600]}44`;
|
|
10639
|
+
|
|
10640
|
+
const iocVars = {
|
|
10641
|
+
brandOrange: lightOrangePalette[500],
|
|
10642
|
+
brandOrangeDark: lightOrangePalette[900],
|
|
10643
|
+
brandBlue: iocTealPalette[500],
|
|
10644
|
+
brandMidnightBlue: iocBackdropPalette[500],
|
|
10645
|
+
agentcyYellow: lightOrangePalette[500],
|
|
10646
|
+
agentcyBlue: iocTealPalette[500],
|
|
10647
|
+
agentcyDarkBlue: iocBackdropPalette[900],
|
|
10648
|
+
baseTextDark: iocBackdropPalette[900],
|
|
10649
|
+
baseTextStrong: iocTextPrimary,
|
|
10650
|
+
baseTextDefault: iocTextSecondary,
|
|
10651
|
+
baseTextMedium: iocTextTertiary,
|
|
10652
|
+
baseTextWeak: iocTextDisabled,
|
|
10653
|
+
baseTextInverse: iocBackdropPalette[900],
|
|
10654
|
+
baseTextDisabled: iocTextDisabled,
|
|
10655
|
+
baseBackgroundStrong: iocBackdropPalette[600],
|
|
10656
|
+
baseBackgroundMedium: iocSurfacePalette[200],
|
|
10657
|
+
baseBackgroundWeak: iocSurfacePalette[100],
|
|
10658
|
+
baseBackgroundHover: iocSurfacePalette[300],
|
|
10659
|
+
baseBorderDefault: iocBorderPalette[300],
|
|
10660
|
+
baseBorderStrong: iocBorderPalette[500],
|
|
10661
|
+
baseBorderMedium: iocBorderPalette[200],
|
|
10662
|
+
baseBorderWeak: iocBorderPalette[100],
|
|
10663
|
+
brandIconPrimaryDefault: iocTealPalette[500],
|
|
10664
|
+
brandIconPrimaryWeak: iocTealPalette[200],
|
|
10665
|
+
brandIconPrimaryMedium: iocTealPalette[400],
|
|
10666
|
+
brandIconPrimaryStrong: iocTealPalette[700],
|
|
10667
|
+
brandIconSecondaryDefault: iocBluePalette[500],
|
|
10668
|
+
brandIconSecondaryWeak: iocBluePalette[400],
|
|
10669
|
+
brandIconSecondaryMedium: iocBluePalette[500],
|
|
10670
|
+
brandIconTertiaryDefault: lightOrangePalette[500],
|
|
10671
|
+
brandIconTertiaryWeak: lightOrangePalette[200],
|
|
10672
|
+
brandIconTertiaryMedium: lightOrangePalette[400],
|
|
10673
|
+
brandBackgroundPrimaryDefault: iocTealPalette[500],
|
|
10674
|
+
brandBackgroundPrimaryWeak: iocTealPalette.alpha10,
|
|
10675
|
+
brandBackgroundPrimaryMedium: iocTealPalette.alpha20,
|
|
10676
|
+
brandBackgroundSecondaryDefault: iocBluePalette[500],
|
|
10677
|
+
brandLogoPrimary: iocTealPalette[400],
|
|
10678
|
+
brandLogoSecondary: iocTextPrimary,
|
|
10679
|
+
brandTextPrimary: iocTealPalette[400],
|
|
10680
|
+
brandTextSecondary: iocTextPrimary,
|
|
10681
|
+
brandTextTertiary: lightOrangePalette[500],
|
|
10682
|
+
controlBackgroundDefault: iocSurfacePalette[200],
|
|
10683
|
+
controlBackgroundDisabled: iocSurfacePalette[50],
|
|
10684
|
+
controlBackgroundWeak: iocSurfacePalette[300],
|
|
10685
|
+
controlBackgroundMedium: iocSurfacePalette[500],
|
|
10686
|
+
controlBorderDefault: iocBorderPalette[300],
|
|
10687
|
+
controlBorderStrong: iocBorderPalette[500],
|
|
10688
|
+
controlBorderMedium: iocBorderPalette[200],
|
|
10689
|
+
controlBorderWeak: iocBorderPalette[100],
|
|
10690
|
+
controlBorderHover: iocTealPalette[500],
|
|
10691
|
+
controlBorderActive: iocTealPalette[600],
|
|
10692
|
+
controlBorderNegative: redPalette[500],
|
|
10693
|
+
controlBorderDisabled: iocBorderPalette[100],
|
|
10694
|
+
controlIconDefault: iocTextSecondary,
|
|
10695
|
+
controlIconStrong: iocTextPrimary,
|
|
10696
|
+
controlIconMedium: iocTextTertiary,
|
|
10697
|
+
controlIconWeak: iocTextDisabled,
|
|
10698
|
+
controlIconHover: iocTealPalette[400],
|
|
10699
|
+
controlIconActive: iocTealPalette[500],
|
|
10700
|
+
controlIconDisabled: iocTextDisabled,
|
|
10701
|
+
controlFocusRingWeak: iocTealPalette.alpha10,
|
|
10702
|
+
controlFocusRingStrong: iocTealPalette.alpha20,
|
|
10703
|
+
interactivePrimaryDefaultDefault: iocTealPalette[500],
|
|
10704
|
+
interactivePrimaryDefaultHover: iocTealPalette[400],
|
|
10705
|
+
interactivePrimaryDefaultActive: iocTealPalette[600],
|
|
10706
|
+
interactivePrimaryDefaultDisabled: iocTealPalette.alpha40,
|
|
10707
|
+
interactivePrimaryWeakDefault: iocTealPalette.alpha10,
|
|
10708
|
+
interactivePrimaryWeakHover: iocTealPalette.alpha20,
|
|
10709
|
+
interactivePrimaryWeakActive: iocTealPalette.alpha40,
|
|
10710
|
+
interactivePrimaryWeakDisabled: iocTealPalette.alpha05,
|
|
10711
|
+
interactiveSecondaryDefaultDefault: iocBluePalette[500],
|
|
10712
|
+
interactiveSecondaryDefaultHover: iocBluePalette[400],
|
|
10713
|
+
interactiveSecondaryDefaultActive: iocBluePalette[600],
|
|
10714
|
+
interactiveSecondaryDefaultDisabled: "rgba(43,130,246,0.40)",
|
|
10715
|
+
interactiveSecondaryWeakDefault: iocSurfacePalette[200],
|
|
10716
|
+
interactiveSecondaryWeakHover: iocSurfacePalette[300],
|
|
10717
|
+
interactiveSecondaryWeakActive: iocSurfacePalette[400],
|
|
10718
|
+
interactiveSecondaryWeakDisabled: iocSurfacePalette[100],
|
|
10719
|
+
interactiveInverseBackgroundDefault: "rgba(255,255,255,0.90)",
|
|
10720
|
+
interactiveInverseBackgroundHover: "rgba(255,255,255,0.95)",
|
|
10721
|
+
interactiveInverseBackgroundActive: "rgba(255,255,255,0.85)",
|
|
10722
|
+
interactiveInverseBackgroundDisabled: "rgba(255,255,255,0.40)",
|
|
10723
|
+
interactiveInverseTextDefault: iocBackdropPalette[900],
|
|
10724
|
+
interactiveInverseTextHover: iocBackdropPalette[700],
|
|
10725
|
+
interactiveInverseTextActive: iocBackdropPalette[800],
|
|
10726
|
+
interactiveInverseTextDisabled: "rgba(0,0,0,0.30)",
|
|
10727
|
+
interactiveTextInDefault: iocTextPrimary,
|
|
10728
|
+
interactiveTextInHover: iocTextPrimary,
|
|
10729
|
+
interactiveTextInActive: iocTextPrimary,
|
|
10730
|
+
interactiveTextInDisabled: iocTextDisabled,
|
|
10731
|
+
interactiveTertiaryDefault: lightOrangePalette[500],
|
|
10732
|
+
interactiveTertiaryHover: lightOrangePalette[400],
|
|
10733
|
+
interactiveTertiaryActive: lightOrangePalette[600],
|
|
10734
|
+
interactiveTertiaryDisabled: lightOrangePalette["alpha40"],
|
|
10735
|
+
successBackgroundDefault: greenPalette[500],
|
|
10736
|
+
successBackgroundDisabled: greenPalette[40],
|
|
10737
|
+
successBackgroundHover: greenPalette[400],
|
|
10738
|
+
successBackgroundActive: greenPalette[600],
|
|
10739
|
+
successBackgroundWeak: "rgba(0, 185, 141, 0.10)",
|
|
10740
|
+
successIconActive: greenPalette[600],
|
|
10741
|
+
successIconDisabled: greenPalette[40],
|
|
10742
|
+
successIconHover: greenPalette[400],
|
|
10743
|
+
successIconDefault: greenPalette[500],
|
|
10744
|
+
successTextActive: greenPalette[300],
|
|
10745
|
+
successTextHover: greenPalette[200],
|
|
10746
|
+
successTextDefault: greenPalette[300],
|
|
10747
|
+
successTextInDisabled: greenPalette[10],
|
|
10748
|
+
successTextInDefault: greyPalette[900],
|
|
10749
|
+
successBorderDisabled: greenPalette[40],
|
|
10750
|
+
successBorderActive: greenPalette[600],
|
|
10751
|
+
successBorderHover: greenPalette[400],
|
|
10752
|
+
successBorderDefault: greenPalette[500],
|
|
10753
|
+
successBorderWeak: "rgba(0, 185, 141, 0.30)",
|
|
10754
|
+
successIconInDisabled: greenPalette[10],
|
|
10755
|
+
successIconInActive: greenPalette[200],
|
|
10756
|
+
successIconInHover: greenPalette[100],
|
|
10757
|
+
successIconInDefault: greenPalette[50],
|
|
10758
|
+
negativeBackgroundHover: redPalette[400],
|
|
10759
|
+
negativeBackgroundActive: redPalette[600],
|
|
10760
|
+
negativeBackgroundDisabled: redPalette["alpha40"],
|
|
10761
|
+
negativeBackgroundDefault: redPalette[500],
|
|
10762
|
+
negativeBackgroundWeak: "rgba(198, 41, 83, 0.10)",
|
|
10763
|
+
negativeTextDefault: redPalette[300],
|
|
10764
|
+
negativeTextHover: redPalette[200],
|
|
10765
|
+
negativeTextActive: redPalette[400],
|
|
10766
|
+
negativeBorderActive: redPalette[600],
|
|
10767
|
+
negativeBorderHover: redPalette[400],
|
|
10768
|
+
negativeBorderDisabled: redPalette["alpha40"],
|
|
10769
|
+
negativeBorderDefault: redPalette[500],
|
|
10770
|
+
negativeBorderWeak: "rgba(198, 41, 83, 0.30)",
|
|
10771
|
+
negativeIconDisabled: redPalette["alpha40"],
|
|
10772
|
+
negativeIconActive: redPalette[600],
|
|
10773
|
+
negativeIconHover: redPalette[400],
|
|
10774
|
+
negativeIconDefault: redPalette[500],
|
|
10775
|
+
negativeTextInDefault: redPalette[50],
|
|
10776
|
+
negativeTextInDisabled: redPalette["alpha10"],
|
|
10777
|
+
negativeIconInDefault: redPalette[50],
|
|
10778
|
+
negativeIconInHover: redPalette[100],
|
|
10779
|
+
negativeIconInActive: redPalette[200],
|
|
10780
|
+
negativeIconInDisabled: redPalette["alpha10"],
|
|
10781
|
+
excellentBackgroundDefault: lightBluePalette[600],
|
|
10782
|
+
excellentBackgroundWeak: "rgba(31, 210, 255, 0.10)",
|
|
10783
|
+
excellentBackgroundDisabled: lightBluePalette["alpha40"],
|
|
10784
|
+
excellentBackgroundHover: lightBluePalette[500],
|
|
10785
|
+
excellentBackgroundActive: lightBluePalette[700],
|
|
10786
|
+
excellentTextDefault: lightBluePalette[200],
|
|
10787
|
+
excellentTextHover: lightBluePalette[100],
|
|
10788
|
+
excellentTextActive: lightBluePalette[300],
|
|
10789
|
+
excellentTextInDefault: greyPalette[900],
|
|
10790
|
+
excellentTextInDisabled: lightBluePalette["alpha10"],
|
|
10791
|
+
excellentBorderDefault: lightBluePalette[600],
|
|
10792
|
+
excellentBorderHover: lightBluePalette[500],
|
|
10793
|
+
excellentBorderActive: lightBluePalette[700],
|
|
10794
|
+
excellentBorderDisabled: lightBluePalette["alpha40"],
|
|
10795
|
+
excellentBorderWeak: "rgba(31, 210, 255, 0.30)",
|
|
10796
|
+
excellentIconDefault: lightBluePalette[500],
|
|
10797
|
+
excellentIconHover: lightBluePalette[400],
|
|
10798
|
+
excellentIconActive: lightBluePalette[600],
|
|
10799
|
+
excellentIconDisabled: lightBluePalette["alpha40"],
|
|
10800
|
+
excellentIconInDefault: lightBluePalette[50],
|
|
10801
|
+
excellentIconInHover: lightBluePalette[100],
|
|
10802
|
+
excellentIconInActive: lightBluePalette[200],
|
|
10803
|
+
excellentIconInDisabled: lightBluePalette["alpha10"],
|
|
10804
|
+
neutralBackgroundDefault: iocTealPalette[600],
|
|
10805
|
+
neutralBackgroundWeak: iocTealPalette.alpha10,
|
|
10806
|
+
neutralBackgroundDisabled: iocTealPalette.alpha40,
|
|
10807
|
+
neutralBackgroundHover: iocTealPalette[500],
|
|
10808
|
+
neutralBackgroundActive: iocTealPalette[700],
|
|
10809
|
+
neutralTextDefault: iocTealPalette[200],
|
|
10810
|
+
neutralTextHover: iocTealPalette[100],
|
|
10811
|
+
neutralTextActive: iocTealPalette[300],
|
|
10812
|
+
neutralTextInDefault: greyPalette[900],
|
|
10813
|
+
neutralTextInDisabled: iocTealPalette.alpha10,
|
|
10814
|
+
neutralBorderDefault: iocTealPalette[600],
|
|
10815
|
+
neutralBorderHover: iocTealPalette[500],
|
|
10816
|
+
neutralBorderActive: iocTealPalette[700],
|
|
10817
|
+
neutralBorderDisabled: iocTealPalette.alpha40,
|
|
10818
|
+
neutralBorderWeak: iocTealPalette.alpha20,
|
|
10819
|
+
neutralIconDefault: iocTealPalette[500],
|
|
10820
|
+
neutralIconHover: iocTealPalette[400],
|
|
10821
|
+
neutralIconActive: iocTealPalette[600],
|
|
10822
|
+
neutralIconDisabled: iocTealPalette.alpha40,
|
|
10823
|
+
neutralIconInDefault: iocTealPalette[50],
|
|
10824
|
+
neutralIconInHover: iocTealPalette[100],
|
|
10825
|
+
neutralIconInActive: iocTealPalette[200],
|
|
10826
|
+
neutralIconInDisabled: iocTealPalette.alpha10,
|
|
10827
|
+
infoBackgroundDefault: iocBluePalette[600],
|
|
10828
|
+
infoBackgroundWeak: "rgba(43,130,246,0.10)",
|
|
10829
|
+
infoBackgroundDisabled: "rgba(43,130,246,0.40)",
|
|
10830
|
+
infoBackgroundHover: iocBluePalette[500],
|
|
10831
|
+
infoBackgroundActive: iocBluePalette[600],
|
|
10832
|
+
infoTextDefault: "#93C5FD",
|
|
10833
|
+
infoTextHover: "#BFDBFE",
|
|
10834
|
+
infoTextActive: "#60A5FA",
|
|
10835
|
+
infoTextInDefault: greyPalette[900],
|
|
10836
|
+
infoTextInDisabled: "rgba(43,130,246,0.10)",
|
|
10837
|
+
infoBorderDefault: iocBluePalette[600],
|
|
10838
|
+
infoBorderHover: iocBluePalette[500],
|
|
10839
|
+
infoBorderActive: iocBluePalette[600],
|
|
10840
|
+
infoBorderDisabled: "rgba(43,130,246,0.40)",
|
|
10841
|
+
infoBorderWeak: "rgba(43,130,246,0.20)",
|
|
10842
|
+
infoIconDefault: iocBluePalette[500],
|
|
10843
|
+
infoIconHover: iocBluePalette[400],
|
|
10844
|
+
infoIconActive: iocBluePalette[600],
|
|
10845
|
+
infoIconDisabled: "rgba(43,130,246,0.40)",
|
|
10846
|
+
infoIconInDefault: "#EFF6FF",
|
|
10847
|
+
infoIconInHover: "#BFDBFE",
|
|
10848
|
+
infoIconInActive: "#93C5FD",
|
|
10849
|
+
infoIconInDisabled: "rgba(43,130,246,0.10)",
|
|
10850
|
+
inactiveBackgroundDefault: greyPalette[600],
|
|
10851
|
+
inactiveBackgroundWeak: "rgba(60, 69, 81, 0.10)",
|
|
10852
|
+
inactiveBackgroundDisabled: greyPalette["alpha40"],
|
|
10853
|
+
inactiveBackgroundHover: greyPalette[500],
|
|
10854
|
+
inactiveBackgroundActive: greyPalette[700],
|
|
10855
|
+
inactiveTextDefault: greyPalette[200],
|
|
10856
|
+
inactiveTextHover: greyPalette[100],
|
|
10857
|
+
inactiveTextActive: greyPalette[300],
|
|
10858
|
+
inactiveTextInDefault: greyPalette[50],
|
|
10859
|
+
inactiveTextInDisabled: greyPalette["alpha40"],
|
|
10860
|
+
inactiveBorderDefault: greyPalette[600],
|
|
10861
|
+
inactiveBorderHover: greyPalette[500],
|
|
10862
|
+
inactiveBorderActive: greyPalette[700],
|
|
10863
|
+
inactiveBorderDisabled: greyPalette["alpha40"],
|
|
10864
|
+
inactiveBorderWeak: "rgba(60, 69, 81, 0.30)",
|
|
10865
|
+
inactiveIconDefault: greyPalette[400],
|
|
10866
|
+
inactiveIconHover: greyPalette[300],
|
|
10867
|
+
inactiveIconActive: greyPalette[500],
|
|
10868
|
+
inactiveIconDisabled: greyPalette["alpha40"],
|
|
10869
|
+
inactiveIconInDefault: greyPalette[0],
|
|
10870
|
+
inactiveIconInHover: greyPalette[50],
|
|
10871
|
+
inactiveIconInActive: greyPalette[100],
|
|
10872
|
+
inactiveIconInDisabled: greyPalette["alpha10"],
|
|
10873
|
+
warningBackgroundDefault: lightOrangePalette[500],
|
|
10874
|
+
warningBackgroundWeak: "rgba(251, 175, 69, 0.10)",
|
|
10875
|
+
warningBackgroundHover: lightOrangePalette[400],
|
|
10876
|
+
warningBackgroundActive: lightOrangePalette[600],
|
|
10877
|
+
warningBackgroundDisabled: lightOrangePalette["alpha40"],
|
|
10878
|
+
warningTextDefault: lightOrangePalette[200],
|
|
10879
|
+
warningTextHover: lightOrangePalette[100],
|
|
10880
|
+
warningTextActive: lightOrangePalette[300],
|
|
10881
|
+
warningTextInDefault: greyPalette[900],
|
|
10882
|
+
warningTextInDisabled: lightOrangePalette["alpha10"],
|
|
10883
|
+
warningBorderDefault: lightOrangePalette[500],
|
|
10884
|
+
warningBorderHover: lightOrangePalette[400],
|
|
10885
|
+
warningBorderActive: lightOrangePalette[600],
|
|
10886
|
+
warningBorderDisabled: lightOrangePalette["alpha40"],
|
|
10887
|
+
warningBorderWeak: "rgba(251, 175, 69, 0.30)",
|
|
10888
|
+
warningIconDefault: lightOrangePalette[500],
|
|
10889
|
+
warningIconHover: lightOrangePalette[400],
|
|
10890
|
+
warningIconActive: lightOrangePalette[600],
|
|
10891
|
+
warningIconDisabled: lightOrangePalette["alpha40"],
|
|
10892
|
+
warningIconInDefault: lightOrangePalette[50],
|
|
10893
|
+
warningIconInHover: lightOrangePalette[100],
|
|
10894
|
+
warningIconInActive: lightOrangePalette[200],
|
|
10895
|
+
warningIconInDisabled: lightOrangePalette["alpha10"],
|
|
10896
|
+
severeWarningBackgroundDefault: orangePalette[500],
|
|
10897
|
+
severeWarningBackgroundWeak: "rgba(242, 100, 61, 0.10)",
|
|
10898
|
+
severeWarningBackgroundHover: orangePalette[400],
|
|
10899
|
+
severeWarningBackgroundActive: orangePalette[600],
|
|
10900
|
+
severeWarningBackgroundDisabled: orangePalette["alpha40"],
|
|
10901
|
+
severeWarningTextDefault: orangePalette[200],
|
|
10902
|
+
severeWarningTextHover: orangePalette[100],
|
|
10903
|
+
severeWarningTextActive: orangePalette[300],
|
|
10904
|
+
severeWarningTextInDefault: greyPalette[900],
|
|
10905
|
+
severeWarningTextInDisabled: orangePalette["alpha10"],
|
|
10906
|
+
severeWarningBorderDefault: orangePalette[500],
|
|
10907
|
+
severeWarningBorderHover: orangePalette[400],
|
|
10908
|
+
severeWarningBorderActive: orangePalette[600],
|
|
10909
|
+
severeWarningBorderDisabled: orangePalette["alpha40"],
|
|
10910
|
+
severeWarningBorderWeak: "rgba(242, 100, 61, 0.30)",
|
|
10911
|
+
severeWarningIconDefault: orangePalette[500],
|
|
10912
|
+
severeWarningIconHover: orangePalette[400],
|
|
10913
|
+
severeWarningIconActive: orangePalette[600],
|
|
10914
|
+
severeWarningIconDisabled: orangePalette["alpha40"],
|
|
10915
|
+
severeWarningIconInDefault: orangePalette[50],
|
|
10916
|
+
severeWarningIconInHover: orangePalette[100],
|
|
10917
|
+
severeWarningIconInActive: orangePalette[200],
|
|
10918
|
+
severeWarningIconInDisabled: orangePalette["alpha10"],
|
|
10919
|
+
moderateBackgroundDefault: yellowPalette[500],
|
|
10920
|
+
moderateBackgroundWeak: "rgba(255, 230, 89, 0.10)",
|
|
10921
|
+
moderateBackgroundHover: yellowPalette[400],
|
|
10922
|
+
moderateBackgroundActive: yellowPalette[600],
|
|
10923
|
+
moderateBackgroundDisabled: yellowPalette["alpha40"],
|
|
10924
|
+
moderateTextDefault: yellowPalette[900],
|
|
10925
|
+
moderateTextHover: yellowPalette[800],
|
|
10926
|
+
moderateTextActive: yellowPalette[700],
|
|
10927
|
+
moderateTextInDefault: greyPalette[900],
|
|
10928
|
+
moderateTextInDisabled: yellowPalette["alpha10"],
|
|
10929
|
+
moderateBorderDefault: yellowPalette[500],
|
|
10930
|
+
moderateBorderHover: yellowPalette[400],
|
|
10931
|
+
moderateBorderActive: yellowPalette[600],
|
|
10932
|
+
moderateBorderDisabled: yellowPalette["alpha40"],
|
|
10933
|
+
moderateBorderWeak: "rgba(255, 230, 89, 0.30)",
|
|
10934
|
+
moderateIconDefault: yellowPalette[700],
|
|
10935
|
+
moderateIconHover: yellowPalette[600],
|
|
10936
|
+
moderateIconActive: yellowPalette[800],
|
|
10937
|
+
moderateIconDisabled: yellowPalette["alpha40"],
|
|
10938
|
+
moderateIconInDefault: yellowPalette[900],
|
|
10939
|
+
moderateIconInHover: yellowPalette[800],
|
|
10940
|
+
moderateIconInActive: yellowPalette[700],
|
|
10941
|
+
moderateIconInDisabled: yellowPalette["alpha10"],
|
|
10942
|
+
accentADefault: lavenderPalette[400],
|
|
10943
|
+
accentAWeak: "rgba(140, 149, 255, 0.15)",
|
|
10944
|
+
accentBDefault: sunsetPalette[300],
|
|
10945
|
+
accentBWeak: "rgba(233, 106, 141, 0.15)",
|
|
10946
|
+
accentCDefault: sunsetPalette[100],
|
|
10947
|
+
accentCWeak: "rgba(243, 172, 162, 0.15)",
|
|
10948
|
+
accentDDefault: purplePalette[400],
|
|
10949
|
+
accentDWeak: "rgba(192, 128, 255, 0.15)",
|
|
10950
|
+
accentEDefault: limePalette[400],
|
|
10951
|
+
accentEWeak: "rgba(164, 197, 71, 0.15)",
|
|
10952
|
+
accentFDefault: orangePalette[400],
|
|
10953
|
+
accentFWeak: "rgba(244, 123, 90, 0.15)",
|
|
10954
|
+
accentGDefault: nightPalette[200],
|
|
10955
|
+
accentGWeak: "rgba(70, 170, 206, 0.15)",
|
|
10956
|
+
accentHDefault: iocTealPalette[400],
|
|
10957
|
+
accentHWeak: iocTealPalette.alpha10,
|
|
10958
|
+
accentIDefault: pinkPalette[400],
|
|
10959
|
+
accentIWeak: "rgba(242, 99, 140, 0.15)",
|
|
10960
|
+
accentJDefault: tealPalette[400],
|
|
10961
|
+
accentJWeak: "rgba(62, 203, 209, 0.15)",
|
|
10962
|
+
};
|
|
10963
|
+
|
|
10964
|
+
const iocShadows = [
|
|
10965
|
+
"none",
|
|
10966
|
+
iocShadowSm,
|
|
10967
|
+
iocShadowMd,
|
|
10968
|
+
iocShadowLg,
|
|
10969
|
+
iocShadowLg,
|
|
10970
|
+
iocShadowLg,
|
|
10971
|
+
...Array(19).fill("none"),
|
|
10972
|
+
];
|
|
10973
|
+
const palette$1 = {
|
|
10974
|
+
mode: "dark",
|
|
10975
|
+
primary: Object.assign(Object.assign({}, iocTealPalette), { main: iocTealPalette[500], light: iocTealPalette[300], dark: iocTealPalette[700], contrastText: iocBackdropPalette[900] }),
|
|
10976
|
+
secondary: {
|
|
10977
|
+
main: iocBluePalette[500],
|
|
10978
|
+
light: iocBluePalette[400],
|
|
10979
|
+
dark: iocBluePalette[600],
|
|
10980
|
+
contrastText: "#ffffff",
|
|
10981
|
+
},
|
|
10982
|
+
tertiary: lightOrangePalette,
|
|
10983
|
+
error: redPalette,
|
|
10984
|
+
warning: lightOrangePalette,
|
|
10985
|
+
info: iocBluePalette,
|
|
10986
|
+
success: greenPalette,
|
|
10987
|
+
negative: redPalette,
|
|
10988
|
+
orange: orangePalette,
|
|
10989
|
+
grey: greyPalette,
|
|
10990
|
+
vars: iocVars,
|
|
10991
|
+
text: {
|
|
10992
|
+
primary: iocTextPrimary,
|
|
10993
|
+
secondary: iocTextSecondary,
|
|
10994
|
+
disabled: iocTextDisabled,
|
|
10995
|
+
},
|
|
10996
|
+
background: {
|
|
10997
|
+
paper: iocSurfacePalette[100],
|
|
10998
|
+
default: iocBackdropPalette[600],
|
|
10999
|
+
},
|
|
11000
|
+
action: {
|
|
11001
|
+
hoverOpacity: 0.08,
|
|
11002
|
+
selectedOpacity: 0.14,
|
|
11003
|
+
focusOpacity: 0.1,
|
|
11004
|
+
},
|
|
11005
|
+
};
|
|
11006
|
+
const baseTheme = material.createTheme({
|
|
11007
|
+
breakpoints,
|
|
11008
|
+
palette: palette$1,
|
|
11009
|
+
typography,
|
|
11010
|
+
mixins: commonMixins,
|
|
11011
|
+
});
|
|
11012
|
+
const iocCssBaselineComponent = {
|
|
11013
|
+
MuiCssBaseline: {
|
|
11014
|
+
styleOverrides: {
|
|
11015
|
+
html: {
|
|
11016
|
+
scrollbarWidth: "thin",
|
|
11017
|
+
scrollbarColor: `${baseTheme.palette.vars.baseTextMedium} ${baseTheme.palette.background.default}`,
|
|
11018
|
+
},
|
|
11019
|
+
body: {
|
|
11020
|
+
background: iocPageBackground,
|
|
11021
|
+
backgroundAttachment: "fixed",
|
|
11022
|
+
minHeight: "100vh",
|
|
11023
|
+
},
|
|
11024
|
+
"*::-webkit-scrollbar": { width: "12px", height: "12px" },
|
|
11025
|
+
"*::-webkit-scrollbar-track": {
|
|
11026
|
+
backgroundColor: baseTheme.palette.background.default,
|
|
11027
|
+
borderRadius: 8,
|
|
11028
|
+
},
|
|
11029
|
+
"*::-webkit-scrollbar-thumb": {
|
|
11030
|
+
backgroundColor: baseTheme.palette.vars.controlIconMedium,
|
|
11031
|
+
borderRadius: 8,
|
|
11032
|
+
border: "2px solid transparent",
|
|
11033
|
+
backgroundClip: "content-box",
|
|
11034
|
+
},
|
|
11035
|
+
"*::-webkit-scrollbar-thumb:hover": {
|
|
11036
|
+
backgroundColor: baseTheme.palette.vars.baseTextMedium,
|
|
11037
|
+
},
|
|
11038
|
+
"*::-webkit-scrollbar-corner": {
|
|
11039
|
+
backgroundColor: baseTheme.palette.background.default,
|
|
11040
|
+
},
|
|
11041
|
+
"::selection": {
|
|
11042
|
+
backgroundColor: baseTheme.palette.vars.controlFocusRingStrong,
|
|
11043
|
+
color: baseTheme.palette.vars.baseTextStrong,
|
|
11044
|
+
},
|
|
11045
|
+
},
|
|
11046
|
+
},
|
|
11047
|
+
};
|
|
11048
|
+
const iocThemeOptions = {
|
|
11049
|
+
shadows: iocShadows,
|
|
11050
|
+
components: Object.assign(Object.assign(Object.assign(Object.assign({}, buttonComponent(baseTheme)), inputComponents(baseTheme)), snackbarComponent(baseTheme)), iocCssBaselineComponent),
|
|
11051
|
+
};
|
|
11052
|
+
const iocTheme = material.createTheme(baseTheme, iocThemeOptions);
|
|
11053
|
+
iocTheme.palette.vars = iocVars;
|
|
11054
|
+
|
|
10500
11055
|
const lightVars = {
|
|
10501
11056
|
brandOrange: lightOrangePalette[500],
|
|
10502
11057
|
brandOrangeDark: lightOrangePalette[900],
|
|
@@ -10876,6 +11431,7 @@
|
|
|
10876
11431
|
(function (ThemeMode) {
|
|
10877
11432
|
ThemeMode["Light"] = "light";
|
|
10878
11433
|
ThemeMode["Dark"] = "dark";
|
|
11434
|
+
ThemeMode["IoC"] = "ioc";
|
|
10879
11435
|
})(exports.ThemeMode || (exports.ThemeMode = {}));
|
|
10880
11436
|
const ThemeModeContext = React.createContext(null);
|
|
10881
11437
|
function useThemeMode() {
|
|
@@ -10885,17 +11441,23 @@
|
|
|
10885
11441
|
}
|
|
10886
11442
|
return ctx;
|
|
10887
11443
|
}
|
|
11444
|
+
function resolveBuiltInTheme(mode) {
|
|
11445
|
+
if (mode === exports.ThemeMode.IoC) {
|
|
11446
|
+
return iocTheme;
|
|
11447
|
+
}
|
|
11448
|
+
return mode === exports.ThemeMode.Dark ? darkTheme : lightTheme;
|
|
11449
|
+
}
|
|
10888
11450
|
const ThemeProvider = ({ children, defaultMode, customTheme, }) => {
|
|
10889
11451
|
const [mode, setMode] = React.useState(defaultMode !== null && defaultMode !== void 0 ? defaultMode : exports.ThemeMode.Light);
|
|
10890
|
-
const
|
|
10891
|
-
setMode(
|
|
11452
|
+
const setTheme = React.useCallback((theme) => {
|
|
11453
|
+
setMode(theme);
|
|
10892
11454
|
}, []);
|
|
10893
|
-
const resolvedTheme = customTheme !== null && customTheme !== void 0 ? customTheme : (mode
|
|
11455
|
+
const resolvedTheme = customTheme !== null && customTheme !== void 0 ? customTheme : resolveBuiltInTheme(mode);
|
|
10894
11456
|
const themeModeValue = React.useMemo(() => ({
|
|
10895
11457
|
mode,
|
|
10896
11458
|
setMode,
|
|
10897
|
-
|
|
10898
|
-
}), [mode,
|
|
11459
|
+
setTheme,
|
|
11460
|
+
}), [mode, setTheme]);
|
|
10899
11461
|
return (jsxRuntime.jsx(ThemeModeContext.Provider, { value: themeModeValue, children: jsxRuntime.jsxs(material.ThemeProvider, { theme: resolvedTheme, children: [jsxRuntime.jsx(material.CssBaseline, {}), children] }) }));
|
|
10900
11462
|
};
|
|
10901
11463
|
|
|
@@ -12549,44 +13111,604 @@
|
|
|
12549
13111
|
], children: [jsxRuntime.jsx(material.Box, { className: "picker-icon", "aria-hidden": true, children: icon }), jsxRuntime.jsx(material.Box, { component: "span", className: "picker-label", children: label })] })));
|
|
12550
13112
|
};
|
|
12551
13113
|
|
|
13114
|
+
exports.PopoverPlacementSide = void 0;
|
|
13115
|
+
(function (PopoverPlacementSide) {
|
|
13116
|
+
PopoverPlacementSide["Top"] = "top";
|
|
13117
|
+
PopoverPlacementSide["Bottom"] = "bottom";
|
|
13118
|
+
PopoverPlacementSide["Left"] = "left";
|
|
13119
|
+
PopoverPlacementSide["Right"] = "right";
|
|
13120
|
+
})(exports.PopoverPlacementSide || (exports.PopoverPlacementSide = {}));
|
|
13121
|
+
exports.PopoverPlacementAlign = void 0;
|
|
13122
|
+
(function (PopoverPlacementAlign) {
|
|
13123
|
+
PopoverPlacementAlign["Start"] = "start";
|
|
13124
|
+
PopoverPlacementAlign["End"] = "end";
|
|
13125
|
+
PopoverPlacementAlign["Center"] = "center";
|
|
13126
|
+
})(exports.PopoverPlacementAlign || (exports.PopoverPlacementAlign = {}));
|
|
13127
|
+
exports.PopoverPlacement = void 0;
|
|
13128
|
+
(function (PopoverPlacement) {
|
|
13129
|
+
PopoverPlacement["Top"] = "top";
|
|
13130
|
+
PopoverPlacement["TopStart"] = "top-start";
|
|
13131
|
+
PopoverPlacement["TopEnd"] = "top-end";
|
|
13132
|
+
PopoverPlacement["Bottom"] = "bottom";
|
|
13133
|
+
PopoverPlacement["BottomStart"] = "bottom-start";
|
|
13134
|
+
PopoverPlacement["BottomEnd"] = "bottom-end";
|
|
13135
|
+
PopoverPlacement["Left"] = "left";
|
|
13136
|
+
PopoverPlacement["LeftStart"] = "left-start";
|
|
13137
|
+
PopoverPlacement["LeftEnd"] = "left-end";
|
|
13138
|
+
PopoverPlacement["Right"] = "right";
|
|
13139
|
+
PopoverPlacement["RightStart"] = "right-start";
|
|
13140
|
+
PopoverPlacement["RightEnd"] = "right-end";
|
|
13141
|
+
})(exports.PopoverPlacement || (exports.PopoverPlacement = {}));
|
|
13142
|
+
const POPOVER_PLACEMENTS = [
|
|
13143
|
+
exports.PopoverPlacement.BottomStart,
|
|
13144
|
+
exports.PopoverPlacement.Bottom,
|
|
13145
|
+
exports.PopoverPlacement.BottomEnd,
|
|
13146
|
+
exports.PopoverPlacement.TopStart,
|
|
13147
|
+
exports.PopoverPlacement.Top,
|
|
13148
|
+
exports.PopoverPlacement.TopEnd,
|
|
13149
|
+
exports.PopoverPlacement.LeftStart,
|
|
13150
|
+
exports.PopoverPlacement.Left,
|
|
13151
|
+
exports.PopoverPlacement.LeftEnd,
|
|
13152
|
+
exports.PopoverPlacement.RightStart,
|
|
13153
|
+
exports.PopoverPlacement.Right,
|
|
13154
|
+
exports.PopoverPlacement.RightEnd,
|
|
13155
|
+
];
|
|
13156
|
+
var PopoverVerticalPlacement;
|
|
13157
|
+
(function (PopoverVerticalPlacement) {
|
|
13158
|
+
PopoverVerticalPlacement["Above"] = "above";
|
|
13159
|
+
PopoverVerticalPlacement["Below"] = "below";
|
|
13160
|
+
})(PopoverVerticalPlacement || (PopoverVerticalPlacement = {}));
|
|
13161
|
+
var PopoverHorizontalPlacement;
|
|
13162
|
+
(function (PopoverHorizontalPlacement) {
|
|
13163
|
+
PopoverHorizontalPlacement["Left"] = "left";
|
|
13164
|
+
PopoverHorizontalPlacement["Center"] = "center";
|
|
13165
|
+
PopoverHorizontalPlacement["Right"] = "right";
|
|
13166
|
+
})(PopoverHorizontalPlacement || (PopoverHorizontalPlacement = {}));
|
|
13167
|
+
var PopoverSidePlacement;
|
|
13168
|
+
(function (PopoverSidePlacement) {
|
|
13169
|
+
PopoverSidePlacement["Left"] = "left";
|
|
13170
|
+
PopoverSidePlacement["Right"] = "right";
|
|
13171
|
+
})(PopoverSidePlacement || (PopoverSidePlacement = {}));
|
|
13172
|
+
var PopoverEdgeAlignment;
|
|
13173
|
+
(function (PopoverEdgeAlignment) {
|
|
13174
|
+
PopoverEdgeAlignment["Top"] = "top";
|
|
13175
|
+
PopoverEdgeAlignment["Center"] = "center";
|
|
13176
|
+
PopoverEdgeAlignment["Bottom"] = "bottom";
|
|
13177
|
+
})(PopoverEdgeAlignment || (PopoverEdgeAlignment = {}));
|
|
13178
|
+
var PopoverArrowAxisAlign;
|
|
13179
|
+
(function (PopoverArrowAxisAlign) {
|
|
13180
|
+
PopoverArrowAxisAlign["Left"] = "left";
|
|
13181
|
+
PopoverArrowAxisAlign["Right"] = "right";
|
|
13182
|
+
PopoverArrowAxisAlign["Top"] = "top";
|
|
13183
|
+
PopoverArrowAxisAlign["Bottom"] = "bottom";
|
|
13184
|
+
PopoverArrowAxisAlign["Center"] = "center";
|
|
13185
|
+
})(PopoverArrowAxisAlign || (PopoverArrowAxisAlign = {}));
|
|
13186
|
+
|
|
13187
|
+
const VIEWPORT_MARGIN = 16;
|
|
13188
|
+
const POPOVER_ARROW_HEIGHT = 8;
|
|
13189
|
+
const POPOVER_ARROW_WIDTH = POPOVER_ARROW_HEIGHT;
|
|
13190
|
+
const CENTER_PLACEMENTS = new Set([
|
|
13191
|
+
exports.PopoverPlacement.Top,
|
|
13192
|
+
exports.PopoverPlacement.Bottom,
|
|
13193
|
+
exports.PopoverPlacement.Left,
|
|
13194
|
+
exports.PopoverPlacement.Right,
|
|
13195
|
+
]);
|
|
13196
|
+
const OPPOSITE_PLACEMENT_SIDE = {
|
|
13197
|
+
[exports.PopoverPlacementSide.Top]: exports.PopoverPlacementSide.Bottom,
|
|
13198
|
+
[exports.PopoverPlacementSide.Bottom]: exports.PopoverPlacementSide.Top,
|
|
13199
|
+
[exports.PopoverPlacementSide.Left]: exports.PopoverPlacementSide.Right,
|
|
13200
|
+
[exports.PopoverPlacementSide.Right]: exports.PopoverPlacementSide.Left,
|
|
13201
|
+
};
|
|
13202
|
+
const VERTICAL_CENTER_PLACEMENT = {
|
|
13203
|
+
[exports.PopoverPlacementSide.Top]: exports.PopoverPlacement.Top,
|
|
13204
|
+
[exports.PopoverPlacementSide.Bottom]: exports.PopoverPlacement.Bottom,
|
|
13205
|
+
};
|
|
13206
|
+
const SIDE_CENTER_PLACEMENT = {
|
|
13207
|
+
[PopoverSidePlacement.Left]: exports.PopoverPlacement.Left,
|
|
13208
|
+
[PopoverSidePlacement.Right]: exports.PopoverPlacement.Right,
|
|
13209
|
+
};
|
|
13210
|
+
|
|
13211
|
+
const getOppositePlacementSide = (side) => OPPOSITE_PLACEMENT_SIDE[side];
|
|
13212
|
+
const getPlacementSide = (placement) => placement.split("-")[0];
|
|
13213
|
+
const getPlacementAlign = (placement) => {
|
|
13214
|
+
if (CENTER_PLACEMENTS.has(placement)) {
|
|
13215
|
+
return exports.PopoverPlacementAlign.Center;
|
|
13216
|
+
}
|
|
13217
|
+
if (placement.endsWith(`-${exports.PopoverPlacementAlign.Start}`)) {
|
|
13218
|
+
return exports.PopoverPlacementAlign.Start;
|
|
13219
|
+
}
|
|
13220
|
+
return exports.PopoverPlacementAlign.End;
|
|
13221
|
+
};
|
|
13222
|
+
const getArrowAxisAlign = (placement) => {
|
|
13223
|
+
const side = getPlacementSide(placement);
|
|
13224
|
+
const align = getPlacementAlign(placement);
|
|
13225
|
+
if (side === exports.PopoverPlacementSide.Top ||
|
|
13226
|
+
side === exports.PopoverPlacementSide.Bottom) {
|
|
13227
|
+
if (align === exports.PopoverPlacementAlign.Start) {
|
|
13228
|
+
return PopoverArrowAxisAlign.Left;
|
|
13229
|
+
}
|
|
13230
|
+
if (align === exports.PopoverPlacementAlign.End) {
|
|
13231
|
+
return PopoverArrowAxisAlign.Right;
|
|
13232
|
+
}
|
|
13233
|
+
return PopoverArrowAxisAlign.Center;
|
|
13234
|
+
}
|
|
13235
|
+
if (align === exports.PopoverPlacementAlign.Start) {
|
|
13236
|
+
return PopoverArrowAxisAlign.Top;
|
|
13237
|
+
}
|
|
13238
|
+
if (align === exports.PopoverPlacementAlign.End) {
|
|
13239
|
+
return PopoverArrowAxisAlign.Bottom;
|
|
13240
|
+
}
|
|
13241
|
+
return PopoverArrowAxisAlign.Center;
|
|
13242
|
+
};
|
|
13243
|
+
|
|
13244
|
+
const toHorizontalOrigin = (align) => {
|
|
13245
|
+
if (align === exports.PopoverPlacementAlign.Start) {
|
|
13246
|
+
return PopoverHorizontalPlacement.Left;
|
|
13247
|
+
}
|
|
13248
|
+
if (align === exports.PopoverPlacementAlign.End) {
|
|
13249
|
+
return PopoverHorizontalPlacement.Right;
|
|
13250
|
+
}
|
|
13251
|
+
return PopoverHorizontalPlacement.Center;
|
|
13252
|
+
};
|
|
13253
|
+
const toVerticalOrigin = (align) => {
|
|
13254
|
+
if (align === exports.PopoverPlacementAlign.Start) {
|
|
13255
|
+
return PopoverEdgeAlignment.Top;
|
|
13256
|
+
}
|
|
13257
|
+
if (align === exports.PopoverPlacementAlign.End) {
|
|
13258
|
+
return PopoverEdgeAlignment.Bottom;
|
|
13259
|
+
}
|
|
13260
|
+
return PopoverEdgeAlignment.Center;
|
|
13261
|
+
};
|
|
13262
|
+
const getOriginsForPlacement = (placement) => {
|
|
13263
|
+
const side = getPlacementSide(placement);
|
|
13264
|
+
const align = getPlacementAlign(placement);
|
|
13265
|
+
if (side === exports.PopoverPlacementSide.Top) {
|
|
13266
|
+
const horizontal = toHorizontalOrigin(align);
|
|
13267
|
+
return {
|
|
13268
|
+
anchorOrigin: {
|
|
13269
|
+
vertical: exports.PopoverPlacementSide.Top,
|
|
13270
|
+
horizontal,
|
|
13271
|
+
},
|
|
13272
|
+
transformOrigin: {
|
|
13273
|
+
vertical: exports.PopoverPlacementSide.Bottom,
|
|
13274
|
+
horizontal,
|
|
13275
|
+
},
|
|
13276
|
+
};
|
|
13277
|
+
}
|
|
13278
|
+
if (side === exports.PopoverPlacementSide.Bottom) {
|
|
13279
|
+
const horizontal = toHorizontalOrigin(align);
|
|
13280
|
+
return {
|
|
13281
|
+
anchorOrigin: {
|
|
13282
|
+
vertical: exports.PopoverPlacementSide.Bottom,
|
|
13283
|
+
horizontal,
|
|
13284
|
+
},
|
|
13285
|
+
transformOrigin: {
|
|
13286
|
+
vertical: exports.PopoverPlacementSide.Top,
|
|
13287
|
+
horizontal,
|
|
13288
|
+
},
|
|
13289
|
+
};
|
|
13290
|
+
}
|
|
13291
|
+
if (side === exports.PopoverPlacementSide.Left) {
|
|
13292
|
+
const vertical = toVerticalOrigin(align);
|
|
13293
|
+
return {
|
|
13294
|
+
anchorOrigin: {
|
|
13295
|
+
vertical,
|
|
13296
|
+
horizontal: exports.PopoverPlacementSide.Left,
|
|
13297
|
+
},
|
|
13298
|
+
transformOrigin: {
|
|
13299
|
+
vertical,
|
|
13300
|
+
horizontal: exports.PopoverPlacementSide.Right,
|
|
13301
|
+
},
|
|
13302
|
+
};
|
|
13303
|
+
}
|
|
13304
|
+
const vertical = toVerticalOrigin(align);
|
|
13305
|
+
return {
|
|
13306
|
+
anchorOrigin: {
|
|
13307
|
+
vertical,
|
|
13308
|
+
horizontal: exports.PopoverPlacementSide.Right,
|
|
13309
|
+
},
|
|
13310
|
+
transformOrigin: {
|
|
13311
|
+
vertical,
|
|
13312
|
+
horizontal: exports.PopoverPlacementSide.Left,
|
|
13313
|
+
},
|
|
13314
|
+
};
|
|
13315
|
+
};
|
|
13316
|
+
const getOriginsForVerticalPlacement = (placement, horizontal = PopoverHorizontalPlacement.Center) => {
|
|
13317
|
+
if (placement === PopoverVerticalPlacement.Above) {
|
|
13318
|
+
return {
|
|
13319
|
+
anchorOrigin: {
|
|
13320
|
+
vertical: exports.PopoverPlacementSide.Top,
|
|
13321
|
+
horizontal,
|
|
13322
|
+
},
|
|
13323
|
+
transformOrigin: {
|
|
13324
|
+
vertical: exports.PopoverPlacementSide.Bottom,
|
|
13325
|
+
horizontal,
|
|
13326
|
+
},
|
|
13327
|
+
};
|
|
13328
|
+
}
|
|
13329
|
+
return {
|
|
13330
|
+
anchorOrigin: {
|
|
13331
|
+
vertical: exports.PopoverPlacementSide.Bottom,
|
|
13332
|
+
horizontal,
|
|
13333
|
+
},
|
|
13334
|
+
transformOrigin: {
|
|
13335
|
+
vertical: exports.PopoverPlacementSide.Top,
|
|
13336
|
+
horizontal,
|
|
13337
|
+
},
|
|
13338
|
+
};
|
|
13339
|
+
};
|
|
13340
|
+
const getVerticalPreference = (anchorOrigin, transformOrigin) => {
|
|
13341
|
+
if (transformOrigin.vertical === exports.PopoverPlacementSide.Bottom &&
|
|
13342
|
+
anchorOrigin.vertical === exports.PopoverPlacementSide.Top) {
|
|
13343
|
+
return PopoverVerticalPlacement.Above;
|
|
13344
|
+
}
|
|
13345
|
+
if (transformOrigin.vertical === exports.PopoverPlacementSide.Top &&
|
|
13346
|
+
anchorOrigin.vertical === exports.PopoverPlacementSide.Bottom) {
|
|
13347
|
+
return PopoverVerticalPlacement.Below;
|
|
13348
|
+
}
|
|
13349
|
+
return PopoverVerticalPlacement.Above;
|
|
13350
|
+
};
|
|
13351
|
+
const getHorizontalPreference = (anchorOrigin, transformOrigin) => {
|
|
13352
|
+
var _a, _b;
|
|
13353
|
+
const anchor = (_a = anchorOrigin.horizontal) !== null && _a !== void 0 ? _a : PopoverHorizontalPlacement.Center;
|
|
13354
|
+
const transform = (_b = transformOrigin.horizontal) !== null && _b !== void 0 ? _b : PopoverHorizontalPlacement.Center;
|
|
13355
|
+
if (anchor === PopoverHorizontalPlacement.Left &&
|
|
13356
|
+
transform === PopoverHorizontalPlacement.Left) {
|
|
13357
|
+
return PopoverHorizontalPlacement.Left;
|
|
13358
|
+
}
|
|
13359
|
+
if (anchor === PopoverHorizontalPlacement.Right &&
|
|
13360
|
+
transform === PopoverHorizontalPlacement.Right) {
|
|
13361
|
+
return PopoverHorizontalPlacement.Right;
|
|
13362
|
+
}
|
|
13363
|
+
return PopoverHorizontalPlacement.Center;
|
|
13364
|
+
};
|
|
13365
|
+
const getSidePreference = (placement) => getPlacementSide(placement) === exports.PopoverPlacementSide.Right
|
|
13366
|
+
? PopoverSidePlacement.Right
|
|
13367
|
+
: PopoverSidePlacement.Left;
|
|
13368
|
+
const getEdgeAlignmentPreference = (placement) => {
|
|
13369
|
+
const align = getPlacementAlign(placement);
|
|
13370
|
+
if (align === exports.PopoverPlacementAlign.Start) {
|
|
13371
|
+
return PopoverEdgeAlignment.Top;
|
|
13372
|
+
}
|
|
13373
|
+
if (align === exports.PopoverPlacementAlign.End) {
|
|
13374
|
+
return PopoverEdgeAlignment.Bottom;
|
|
13375
|
+
}
|
|
13376
|
+
return PopoverEdgeAlignment.Center;
|
|
13377
|
+
};
|
|
13378
|
+
|
|
13379
|
+
const getPopoverHorizontalBounds = ({ anchorLeft, anchorRight, anchorWidth, popoverWidth, horizontal, }) => {
|
|
13380
|
+
switch (horizontal) {
|
|
13381
|
+
case PopoverHorizontalPlacement.Left:
|
|
13382
|
+
return { left: anchorLeft, right: anchorLeft + popoverWidth };
|
|
13383
|
+
case PopoverHorizontalPlacement.Right:
|
|
13384
|
+
return { left: anchorRight - popoverWidth, right: anchorRight };
|
|
13385
|
+
default: {
|
|
13386
|
+
const center = anchorLeft + anchorWidth / 2;
|
|
13387
|
+
return {
|
|
13388
|
+
left: center - popoverWidth / 2,
|
|
13389
|
+
right: center + popoverWidth / 2,
|
|
13390
|
+
};
|
|
13391
|
+
}
|
|
13392
|
+
}
|
|
13393
|
+
};
|
|
13394
|
+
const getPopoverVerticalBounds = ({ anchorTop, anchorBottom, anchorHeight, popoverHeight, vertical, }) => {
|
|
13395
|
+
switch (vertical) {
|
|
13396
|
+
case PopoverEdgeAlignment.Top:
|
|
13397
|
+
return { top: anchorTop, bottom: anchorTop + popoverHeight };
|
|
13398
|
+
case PopoverEdgeAlignment.Bottom:
|
|
13399
|
+
return { top: anchorBottom - popoverHeight, bottom: anchorBottom };
|
|
13400
|
+
default: {
|
|
13401
|
+
const center = anchorTop + anchorHeight / 2;
|
|
13402
|
+
return {
|
|
13403
|
+
top: center - popoverHeight / 2,
|
|
13404
|
+
bottom: center + popoverHeight / 2,
|
|
13405
|
+
};
|
|
13406
|
+
}
|
|
13407
|
+
}
|
|
13408
|
+
};
|
|
13409
|
+
|
|
13410
|
+
const resolveVerticalPlacement = ({ preferAbove, spaceAbove, spaceBelow, popoverHeight, hasArrow, margin = VIEWPORT_MARGIN, }) => {
|
|
13411
|
+
const clearance = hasArrow ? POPOVER_ARROW_HEIGHT : 0;
|
|
13412
|
+
const required = popoverHeight + clearance;
|
|
13413
|
+
const aboveRoom = spaceAbove - margin;
|
|
13414
|
+
const belowRoom = spaceBelow - margin;
|
|
13415
|
+
const fitsAbove = aboveRoom >= required;
|
|
13416
|
+
const fitsBelow = belowRoom >= required;
|
|
13417
|
+
if (preferAbove && fitsAbove)
|
|
13418
|
+
return PopoverVerticalPlacement.Above;
|
|
13419
|
+
if (!preferAbove && fitsBelow)
|
|
13420
|
+
return PopoverVerticalPlacement.Below;
|
|
13421
|
+
if (fitsAbove && !fitsBelow)
|
|
13422
|
+
return PopoverVerticalPlacement.Above;
|
|
13423
|
+
if (fitsBelow && !fitsAbove)
|
|
13424
|
+
return PopoverVerticalPlacement.Below;
|
|
13425
|
+
return aboveRoom >= belowRoom
|
|
13426
|
+
? PopoverVerticalPlacement.Above
|
|
13427
|
+
: PopoverVerticalPlacement.Below;
|
|
13428
|
+
};
|
|
13429
|
+
const resolveHorizontalPlacement = ({ preferHorizontal, anchorLeft, anchorRight, anchorWidth, popoverWidth, margin = VIEWPORT_MARGIN, viewportWidth, }) => {
|
|
13430
|
+
const fits = (horizontal) => {
|
|
13431
|
+
const { left, right } = getPopoverHorizontalBounds({
|
|
13432
|
+
anchorLeft,
|
|
13433
|
+
anchorRight,
|
|
13434
|
+
anchorWidth,
|
|
13435
|
+
popoverWidth,
|
|
13436
|
+
horizontal,
|
|
13437
|
+
});
|
|
13438
|
+
return left >= margin && right <= viewportWidth - margin;
|
|
13439
|
+
};
|
|
13440
|
+
if (fits(preferHorizontal))
|
|
13441
|
+
return preferHorizontal;
|
|
13442
|
+
const alternatives = (() => {
|
|
13443
|
+
if (preferHorizontal === PopoverHorizontalPlacement.Center) {
|
|
13444
|
+
const { left } = getPopoverHorizontalBounds({
|
|
13445
|
+
anchorLeft,
|
|
13446
|
+
anchorRight,
|
|
13447
|
+
anchorWidth,
|
|
13448
|
+
popoverWidth,
|
|
13449
|
+
horizontal: PopoverHorizontalPlacement.Center,
|
|
13450
|
+
});
|
|
13451
|
+
return left < margin
|
|
13452
|
+
? [PopoverHorizontalPlacement.Left, PopoverHorizontalPlacement.Right]
|
|
13453
|
+
: [PopoverHorizontalPlacement.Right, PopoverHorizontalPlacement.Left];
|
|
13454
|
+
}
|
|
13455
|
+
if (preferHorizontal === PopoverHorizontalPlacement.Left) {
|
|
13456
|
+
return [
|
|
13457
|
+
PopoverHorizontalPlacement.Right,
|
|
13458
|
+
PopoverHorizontalPlacement.Center,
|
|
13459
|
+
];
|
|
13460
|
+
}
|
|
13461
|
+
return [PopoverHorizontalPlacement.Left, PopoverHorizontalPlacement.Center];
|
|
13462
|
+
})();
|
|
13463
|
+
for (const horizontal of alternatives) {
|
|
13464
|
+
if (fits(horizontal))
|
|
13465
|
+
return horizontal;
|
|
13466
|
+
}
|
|
13467
|
+
const overflow = (horizontal) => {
|
|
13468
|
+
const { left, right } = getPopoverHorizontalBounds({
|
|
13469
|
+
anchorLeft,
|
|
13470
|
+
anchorRight,
|
|
13471
|
+
anchorWidth,
|
|
13472
|
+
popoverWidth,
|
|
13473
|
+
horizontal,
|
|
13474
|
+
});
|
|
13475
|
+
const leftOverflow = Math.max(0, margin - left);
|
|
13476
|
+
const rightOverflow = Math.max(0, right - (viewportWidth - margin));
|
|
13477
|
+
return leftOverflow + rightOverflow;
|
|
13478
|
+
};
|
|
13479
|
+
const all = [
|
|
13480
|
+
PopoverHorizontalPlacement.Left,
|
|
13481
|
+
PopoverHorizontalPlacement.Center,
|
|
13482
|
+
PopoverHorizontalPlacement.Right,
|
|
13483
|
+
];
|
|
13484
|
+
return all.reduce((best, current) => overflow(current) < overflow(best) ? current : best);
|
|
13485
|
+
};
|
|
13486
|
+
const resolveSidePlacement = ({ preferSide, spaceLeft, spaceRight, popoverWidth, hasArrow, margin = VIEWPORT_MARGIN, }) => {
|
|
13487
|
+
const clearance = POPOVER_ARROW_WIDTH ;
|
|
13488
|
+
const required = popoverWidth + clearance;
|
|
13489
|
+
const leftRoom = spaceLeft - margin;
|
|
13490
|
+
const rightRoom = spaceRight - margin;
|
|
13491
|
+
const fitsLeft = leftRoom >= required;
|
|
13492
|
+
const fitsRight = rightRoom >= required;
|
|
13493
|
+
if (preferSide === PopoverSidePlacement.Left && fitsLeft) {
|
|
13494
|
+
return PopoverSidePlacement.Left;
|
|
13495
|
+
}
|
|
13496
|
+
if (preferSide === PopoverSidePlacement.Right && fitsRight) {
|
|
13497
|
+
return PopoverSidePlacement.Right;
|
|
13498
|
+
}
|
|
13499
|
+
if (fitsLeft && !fitsRight)
|
|
13500
|
+
return PopoverSidePlacement.Left;
|
|
13501
|
+
if (fitsRight && !fitsLeft)
|
|
13502
|
+
return PopoverSidePlacement.Right;
|
|
13503
|
+
return leftRoom >= rightRoom
|
|
13504
|
+
? PopoverSidePlacement.Left
|
|
13505
|
+
: PopoverSidePlacement.Right;
|
|
13506
|
+
};
|
|
13507
|
+
const resolveEdgeAlignment = ({ preferAlignment, anchorTop, anchorBottom, anchorHeight, popoverHeight, margin = VIEWPORT_MARGIN, viewportHeight, }) => {
|
|
13508
|
+
const fits = (vertical) => {
|
|
13509
|
+
const { top, bottom } = getPopoverVerticalBounds({
|
|
13510
|
+
anchorTop,
|
|
13511
|
+
anchorBottom,
|
|
13512
|
+
anchorHeight,
|
|
13513
|
+
popoverHeight,
|
|
13514
|
+
vertical,
|
|
13515
|
+
});
|
|
13516
|
+
return top >= margin && bottom <= viewportHeight - margin;
|
|
13517
|
+
};
|
|
13518
|
+
if (fits(preferAlignment))
|
|
13519
|
+
return preferAlignment;
|
|
13520
|
+
const alternatives = (() => {
|
|
13521
|
+
if (preferAlignment === PopoverEdgeAlignment.Center) {
|
|
13522
|
+
const { top } = getPopoverVerticalBounds({
|
|
13523
|
+
anchorTop,
|
|
13524
|
+
anchorBottom,
|
|
13525
|
+
anchorHeight,
|
|
13526
|
+
popoverHeight,
|
|
13527
|
+
vertical: PopoverEdgeAlignment.Center,
|
|
13528
|
+
});
|
|
13529
|
+
return top < margin
|
|
13530
|
+
? [PopoverEdgeAlignment.Top, PopoverEdgeAlignment.Bottom]
|
|
13531
|
+
: [PopoverEdgeAlignment.Bottom, PopoverEdgeAlignment.Top];
|
|
13532
|
+
}
|
|
13533
|
+
if (preferAlignment === PopoverEdgeAlignment.Top) {
|
|
13534
|
+
return [PopoverEdgeAlignment.Bottom, PopoverEdgeAlignment.Center];
|
|
13535
|
+
}
|
|
13536
|
+
return [PopoverEdgeAlignment.Top, PopoverEdgeAlignment.Center];
|
|
13537
|
+
})();
|
|
13538
|
+
for (const vertical of alternatives) {
|
|
13539
|
+
if (fits(vertical))
|
|
13540
|
+
return vertical;
|
|
13541
|
+
}
|
|
13542
|
+
const overflow = (vertical) => {
|
|
13543
|
+
const { top, bottom } = getPopoverVerticalBounds({
|
|
13544
|
+
anchorTop,
|
|
13545
|
+
anchorBottom,
|
|
13546
|
+
anchorHeight,
|
|
13547
|
+
popoverHeight,
|
|
13548
|
+
vertical,
|
|
13549
|
+
});
|
|
13550
|
+
const topOverflow = Math.max(0, margin - top);
|
|
13551
|
+
const bottomOverflow = Math.max(0, bottom - (viewportHeight - margin));
|
|
13552
|
+
return topOverflow + bottomOverflow;
|
|
13553
|
+
};
|
|
13554
|
+
const all = [
|
|
13555
|
+
PopoverEdgeAlignment.Top,
|
|
13556
|
+
PopoverEdgeAlignment.Center,
|
|
13557
|
+
PopoverEdgeAlignment.Bottom,
|
|
13558
|
+
];
|
|
13559
|
+
return all.reduce((best, current) => overflow(current) < overflow(best) ? current : best);
|
|
13560
|
+
};
|
|
13561
|
+
|
|
13562
|
+
const placementSideToSidePlacement = (side) => side === exports.PopoverPlacementSide.Right
|
|
13563
|
+
? PopoverSidePlacement.Right
|
|
13564
|
+
: PopoverSidePlacement.Left;
|
|
13565
|
+
const formatVerticalPlacement = (side, align) => {
|
|
13566
|
+
if (align === exports.PopoverPlacementAlign.Center) {
|
|
13567
|
+
return VERTICAL_CENTER_PLACEMENT[side];
|
|
13568
|
+
}
|
|
13569
|
+
return `${side}-${align}`;
|
|
13570
|
+
};
|
|
13571
|
+
const formatSidePlacement = (side, align) => {
|
|
13572
|
+
if (align === exports.PopoverPlacementAlign.Center) {
|
|
13573
|
+
return SIDE_CENTER_PLACEMENT[side];
|
|
13574
|
+
}
|
|
13575
|
+
return `${side}-${align}`;
|
|
13576
|
+
};
|
|
13577
|
+
const horizontalToPlacementAlign = (horizontal) => {
|
|
13578
|
+
if (horizontal === PopoverHorizontalPlacement.Left) {
|
|
13579
|
+
return exports.PopoverPlacementAlign.Start;
|
|
13580
|
+
}
|
|
13581
|
+
if (horizontal === PopoverHorizontalPlacement.Right) {
|
|
13582
|
+
return exports.PopoverPlacementAlign.End;
|
|
13583
|
+
}
|
|
13584
|
+
return exports.PopoverPlacementAlign.Center;
|
|
13585
|
+
};
|
|
13586
|
+
const edgeToPlacementAlign = (edge) => {
|
|
13587
|
+
if (edge === PopoverEdgeAlignment.Top) {
|
|
13588
|
+
return exports.PopoverPlacementAlign.Start;
|
|
13589
|
+
}
|
|
13590
|
+
if (edge === PopoverEdgeAlignment.Bottom) {
|
|
13591
|
+
return exports.PopoverPlacementAlign.End;
|
|
13592
|
+
}
|
|
13593
|
+
return exports.PopoverPlacementAlign.Center;
|
|
13594
|
+
};
|
|
13595
|
+
const placementForVerticalPlacement = (placement, verticalPlacement) => {
|
|
13596
|
+
const side = getPlacementSide(placement);
|
|
13597
|
+
if (side !== exports.PopoverPlacementSide.Top &&
|
|
13598
|
+
side !== exports.PopoverPlacementSide.Bottom) {
|
|
13599
|
+
return placement;
|
|
13600
|
+
}
|
|
13601
|
+
const align = getPlacementAlign(placement);
|
|
13602
|
+
return verticalPlacement === PopoverVerticalPlacement.Above
|
|
13603
|
+
? formatVerticalPlacement(exports.PopoverPlacementSide.Top, align)
|
|
13604
|
+
: formatVerticalPlacement(exports.PopoverPlacementSide.Bottom, align);
|
|
13605
|
+
};
|
|
13606
|
+
const placementForHorizontalPlacement = (placement, horizontal) => {
|
|
13607
|
+
const side = getPlacementSide(placement);
|
|
13608
|
+
if (side !== exports.PopoverPlacementSide.Top &&
|
|
13609
|
+
side !== exports.PopoverPlacementSide.Bottom) {
|
|
13610
|
+
return placement;
|
|
13611
|
+
}
|
|
13612
|
+
return formatVerticalPlacement(side, horizontalToPlacementAlign(horizontal));
|
|
13613
|
+
};
|
|
13614
|
+
const placementForSidePlacement = (placement, side) => {
|
|
13615
|
+
const placementSide = getPlacementSide(placement);
|
|
13616
|
+
if (placementSide !== exports.PopoverPlacementSide.Left &&
|
|
13617
|
+
placementSide !== exports.PopoverPlacementSide.Right) {
|
|
13618
|
+
return placement;
|
|
13619
|
+
}
|
|
13620
|
+
return formatSidePlacement(side, getPlacementAlign(placement));
|
|
13621
|
+
};
|
|
13622
|
+
const placementForEdgeAlignment = (placement, align) => {
|
|
13623
|
+
const side = getPlacementSide(placement);
|
|
13624
|
+
if (side !== exports.PopoverPlacementSide.Left &&
|
|
13625
|
+
side !== exports.PopoverPlacementSide.Right) {
|
|
13626
|
+
return placement;
|
|
13627
|
+
}
|
|
13628
|
+
return formatSidePlacement(placementSideToSidePlacement(side), edgeToPlacementAlign(align));
|
|
13629
|
+
};
|
|
13630
|
+
|
|
13631
|
+
const getArrowEdgeSide = (placement) => getOppositePlacementSide(getPlacementSide(placement));
|
|
12552
13632
|
const ARROW_SIZE = 16;
|
|
12553
13633
|
const ARROW_HALF = ARROW_SIZE / 2;
|
|
12554
|
-
const ARROW_HEIGHT =
|
|
13634
|
+
const ARROW_HEIGHT = POPOVER_ARROW_HEIGHT;
|
|
12555
13635
|
const ARROW_OFFSET = 12;
|
|
12556
13636
|
const popoverWidthBySize = {
|
|
12557
13637
|
medium: "228px",
|
|
12558
13638
|
large: "360px",
|
|
12559
13639
|
};
|
|
12560
|
-
const
|
|
12561
|
-
|
|
13640
|
+
const popoverContentLayoutBySize = {
|
|
13641
|
+
medium: { padding: "12px 16px", gap: "16px" },
|
|
13642
|
+
large: { padding: "16px 20px", gap: "20px" },
|
|
13643
|
+
};
|
|
13644
|
+
const getPaperArrowOffset = (placement, anchorOrigin = {
|
|
13645
|
+
vertical: exports.PopoverPlacementSide.Top,
|
|
13646
|
+
}, transformOrigin = {
|
|
13647
|
+
vertical: exports.PopoverPlacementSide.Top,
|
|
13648
|
+
}) => {
|
|
13649
|
+
if (!placement)
|
|
12562
13650
|
return {};
|
|
12563
|
-
|
|
12564
|
-
|
|
12565
|
-
|
|
13651
|
+
const side = getPlacementSide(placement);
|
|
13652
|
+
if (side === exports.PopoverPlacementSide.Top &&
|
|
13653
|
+
anchorOrigin.vertical === exports.PopoverPlacementSide.Top &&
|
|
13654
|
+
transformOrigin.vertical === exports.PopoverPlacementSide.Bottom) {
|
|
13655
|
+
return { marginTop: `-${ARROW_HEIGHT}px` };
|
|
13656
|
+
}
|
|
13657
|
+
if (side === exports.PopoverPlacementSide.Bottom &&
|
|
13658
|
+
anchorOrigin.vertical === exports.PopoverPlacementSide.Bottom &&
|
|
13659
|
+
transformOrigin.vertical === exports.PopoverPlacementSide.Top) {
|
|
13660
|
+
return { marginTop: `${ARROW_HEIGHT}px` };
|
|
13661
|
+
}
|
|
13662
|
+
if (side === exports.PopoverPlacementSide.Left &&
|
|
13663
|
+
anchorOrigin.horizontal === exports.PopoverPlacementSide.Left &&
|
|
13664
|
+
transformOrigin.horizontal === exports.PopoverPlacementSide.Right) {
|
|
13665
|
+
return { marginLeft: `-${ARROW_HEIGHT}px` };
|
|
13666
|
+
}
|
|
13667
|
+
if (side === exports.PopoverPlacementSide.Right &&
|
|
13668
|
+
anchorOrigin.horizontal === exports.PopoverPlacementSide.Right &&
|
|
13669
|
+
transformOrigin.horizontal === exports.PopoverPlacementSide.Left) {
|
|
13670
|
+
return { marginLeft: `${ARROW_HEIGHT}px` };
|
|
13671
|
+
}
|
|
13672
|
+
return {};
|
|
12566
13673
|
};
|
|
12567
|
-
const getArrowStyles = (
|
|
13674
|
+
const getArrowStyles = (placement, bg) => {
|
|
13675
|
+
const edgeSide = getArrowEdgeSide(placement);
|
|
13676
|
+
const align = getArrowAxisAlign(placement);
|
|
12568
13677
|
const base = {
|
|
12569
13678
|
position: "absolute",
|
|
12570
|
-
width: `${ARROW_SIZE}px`,
|
|
12571
|
-
height: `${ARROW_HEIGHT}px`,
|
|
12572
13679
|
background: bg,
|
|
12573
|
-
zIndex:
|
|
13680
|
+
zIndex: 2,
|
|
13681
|
+
pointerEvents: "none",
|
|
12574
13682
|
};
|
|
12575
|
-
const horizontal =
|
|
13683
|
+
const horizontal = align === PopoverArrowAxisAlign.Center
|
|
12576
13684
|
? { left: `calc(50% - ${ARROW_HALF}px)` }
|
|
12577
|
-
:
|
|
13685
|
+
: align === PopoverArrowAxisAlign.Left
|
|
12578
13686
|
? { left: `${ARROW_OFFSET}px` }
|
|
12579
13687
|
: { right: `${ARROW_OFFSET}px` };
|
|
12580
|
-
|
|
12581
|
-
|
|
13688
|
+
const vertical = align === PopoverArrowAxisAlign.Center
|
|
13689
|
+
? { top: `calc(50% - ${ARROW_HALF}px)` }
|
|
13690
|
+
: align === PopoverArrowAxisAlign.Top
|
|
13691
|
+
? { top: `${ARROW_OFFSET}px` }
|
|
13692
|
+
: { bottom: `${ARROW_OFFSET}px` };
|
|
13693
|
+
if (edgeSide === exports.PopoverPlacementSide.Bottom) {
|
|
13694
|
+
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)` });
|
|
13695
|
+
}
|
|
13696
|
+
if (edgeSide === exports.PopoverPlacementSide.Top) {
|
|
13697
|
+
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%)` });
|
|
12582
13698
|
}
|
|
12583
|
-
|
|
13699
|
+
if (edgeSide === exports.PopoverPlacementSide.Left) {
|
|
13700
|
+
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%)` });
|
|
13701
|
+
}
|
|
13702
|
+
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%)` });
|
|
12584
13703
|
};
|
|
12585
13704
|
const getPopoverPaperStyles = (theme, size = "medium") => {
|
|
12586
13705
|
var _a;
|
|
12587
|
-
|
|
13706
|
+
const width = popoverWidthBySize[size];
|
|
13707
|
+
return {
|
|
12588
13708
|
boxSizing: "border-box",
|
|
12589
|
-
width
|
|
13709
|
+
width,
|
|
13710
|
+
minWidth: width,
|
|
13711
|
+
maxWidth: width,
|
|
12590
13712
|
background: (_a = theme.palette.vars) === null || _a === void 0 ? void 0 : _a.controlBackgroundDefault,
|
|
12591
13713
|
borderRadius: "6px",
|
|
12592
13714
|
boxShadow: "none",
|
|
@@ -12594,25 +13716,34 @@
|
|
|
12594
13716
|
? `drop-shadow(${darkModeCardFloating})`
|
|
12595
13717
|
: `drop-shadow(${lightModeCardFloating})`,
|
|
12596
13718
|
overflow: "visible",
|
|
12597
|
-
|
|
13719
|
+
overflowX: "visible",
|
|
13720
|
+
overflowY: "visible",
|
|
13721
|
+
};
|
|
13722
|
+
};
|
|
13723
|
+
const popoverSurfaceStyles = {
|
|
13724
|
+
position: "relative",
|
|
13725
|
+
boxSizing: "border-box",
|
|
13726
|
+
width: "100%",
|
|
13727
|
+
overflow: "visible",
|
|
12598
13728
|
};
|
|
12599
|
-
const getPopoverContentStyles = (theme, featureHighlight = false) => {
|
|
13729
|
+
const getPopoverContentStyles = (theme, featureHighlight = false, size = "medium") => {
|
|
12600
13730
|
var _a, _b;
|
|
12601
|
-
|
|
13731
|
+
const layout = popoverContentLayoutBySize[size];
|
|
13732
|
+
return {
|
|
12602
13733
|
boxSizing: "border-box",
|
|
12603
13734
|
display: "flex",
|
|
12604
13735
|
flexDirection: "row",
|
|
12605
13736
|
justifyContent: "flex-end",
|
|
12606
13737
|
alignItems: "flex-start",
|
|
12607
|
-
gap:
|
|
12608
|
-
padding:
|
|
13738
|
+
gap: layout.gap,
|
|
13739
|
+
padding: layout.padding,
|
|
12609
13740
|
width: "100%",
|
|
12610
13741
|
background: (_a = theme.palette.vars) === null || _a === void 0 ? void 0 : _a.controlBackgroundDefault,
|
|
12611
13742
|
border: featureHighlight
|
|
12612
13743
|
? `2px solid ${(_b = theme.palette.vars) === null || _b === void 0 ? void 0 : _b.controlBorderActive}`
|
|
12613
13744
|
: "0px solid transparent",
|
|
12614
13745
|
borderRadius: "6px",
|
|
12615
|
-
}
|
|
13746
|
+
};
|
|
12616
13747
|
};
|
|
12617
13748
|
const popoverColumnStyles = {
|
|
12618
13749
|
display: "flex",
|
|
@@ -12664,10 +13795,15 @@
|
|
|
12664
13795
|
const popoverActionsStyles = {
|
|
12665
13796
|
display: "flex",
|
|
12666
13797
|
flexDirection: "row",
|
|
13798
|
+
flexWrap: "wrap",
|
|
12667
13799
|
justifyContent: "flex-end",
|
|
12668
13800
|
alignItems: "center",
|
|
12669
13801
|
gap: "12px",
|
|
12670
13802
|
width: "100%",
|
|
13803
|
+
"& .MuiButton-root": {
|
|
13804
|
+
flexShrink: 0,
|
|
13805
|
+
whiteSpace: "nowrap",
|
|
13806
|
+
},
|
|
12671
13807
|
};
|
|
12672
13808
|
const closeButtonStyles = {
|
|
12673
13809
|
padding: "2px",
|
|
@@ -12675,21 +13811,174 @@
|
|
|
12675
13811
|
flexShrink: 0,
|
|
12676
13812
|
};
|
|
12677
13813
|
|
|
13814
|
+
const resolveAnchorRect = (anchorEl) => {
|
|
13815
|
+
var _a, _b;
|
|
13816
|
+
if (!anchorEl)
|
|
13817
|
+
return null;
|
|
13818
|
+
const resolved = typeof anchorEl === "function" ? anchorEl() : anchorEl;
|
|
13819
|
+
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;
|
|
13820
|
+
};
|
|
13821
|
+
const resolvePlacementState = ({ anchorOrigin, transformOrigin, placement, }) => {
|
|
13822
|
+
if (placement) {
|
|
13823
|
+
const origins = getOriginsForPlacement(placement);
|
|
13824
|
+
return {
|
|
13825
|
+
anchorOrigin: origins.anchorOrigin,
|
|
13826
|
+
transformOrigin: origins.transformOrigin,
|
|
13827
|
+
placement,
|
|
13828
|
+
};
|
|
13829
|
+
}
|
|
13830
|
+
return { anchorOrigin, transformOrigin, placement };
|
|
13831
|
+
};
|
|
13832
|
+
const isSameResolvedState = (current, next) => current.placement === next.placement &&
|
|
13833
|
+
current.anchorOrigin.vertical === next.anchorOrigin.vertical &&
|
|
13834
|
+
current.anchorOrigin.horizontal === next.anchorOrigin.horizontal &&
|
|
13835
|
+
current.transformOrigin.vertical === next.transformOrigin.vertical &&
|
|
13836
|
+
current.transformOrigin.horizontal === next.transformOrigin.horizontal;
|
|
13837
|
+
const getPreferenceOrigins = ({ anchorOrigin, transformOrigin, placement, }) => placement
|
|
13838
|
+
? getOriginsForPlacement(placement)
|
|
13839
|
+
: { anchorOrigin, transformOrigin };
|
|
13840
|
+
const useResolvedPopoverPlacement = ({ open, anchorEl, anchorOrigin, transformOrigin, placement, }) => {
|
|
13841
|
+
const paperRef = React.useRef(null);
|
|
13842
|
+
const [resolved, setResolved] = React.useState(() => resolvePlacementState({ anchorOrigin, transformOrigin, placement }));
|
|
13843
|
+
const updateResolved = (next) => {
|
|
13844
|
+
setResolved((current) => isSameResolvedState(current, next) ? current : next);
|
|
13845
|
+
};
|
|
13846
|
+
React.useLayoutEffect(() => {
|
|
13847
|
+
if (!open) {
|
|
13848
|
+
updateResolved(resolvePlacementState({ anchorOrigin, transformOrigin, placement }));
|
|
13849
|
+
return;
|
|
13850
|
+
}
|
|
13851
|
+
const anchorRect = resolveAnchorRect(anchorEl);
|
|
13852
|
+
if (!anchorRect)
|
|
13853
|
+
return;
|
|
13854
|
+
const { anchorOrigin: preferenceAnchorOrigin, transformOrigin: preferenceTransformOrigin, } = getPreferenceOrigins({ anchorOrigin, transformOrigin, placement });
|
|
13855
|
+
const measure = () => {
|
|
13856
|
+
const paper = paperRef.current;
|
|
13857
|
+
if (!paper)
|
|
13858
|
+
return;
|
|
13859
|
+
if (placement) {
|
|
13860
|
+
const placementSide = getPlacementSide(placement);
|
|
13861
|
+
if (placementSide === exports.PopoverPlacementSide.Top ||
|
|
13862
|
+
placementSide === exports.PopoverPlacementSide.Bottom) {
|
|
13863
|
+
const preferAbove = getVerticalPreference(preferenceAnchorOrigin, preferenceTransformOrigin) === "above";
|
|
13864
|
+
const preferHorizontal = getHorizontalPreference(preferenceAnchorOrigin, preferenceTransformOrigin);
|
|
13865
|
+
const verticalPlacement = resolveVerticalPlacement({
|
|
13866
|
+
preferAbove,
|
|
13867
|
+
spaceAbove: anchorRect.top,
|
|
13868
|
+
spaceBelow: window.innerHeight - anchorRect.bottom,
|
|
13869
|
+
popoverHeight: paper.offsetHeight,
|
|
13870
|
+
hasArrow: true,
|
|
13871
|
+
});
|
|
13872
|
+
const horizontalPlacement = resolveHorizontalPlacement({
|
|
13873
|
+
preferHorizontal,
|
|
13874
|
+
anchorLeft: anchorRect.left,
|
|
13875
|
+
anchorRight: anchorRect.right,
|
|
13876
|
+
anchorWidth: anchorRect.width,
|
|
13877
|
+
popoverWidth: paper.offsetWidth,
|
|
13878
|
+
viewportWidth: window.innerWidth,
|
|
13879
|
+
});
|
|
13880
|
+
const nextPlacement = placementForHorizontalPlacement(placementForVerticalPlacement(placement, verticalPlacement), horizontalPlacement);
|
|
13881
|
+
const origins = getOriginsForPlacement(nextPlacement);
|
|
13882
|
+
updateResolved({
|
|
13883
|
+
anchorOrigin: origins.anchorOrigin,
|
|
13884
|
+
transformOrigin: origins.transformOrigin,
|
|
13885
|
+
placement: nextPlacement,
|
|
13886
|
+
});
|
|
13887
|
+
return;
|
|
13888
|
+
}
|
|
13889
|
+
const preferSide = getSidePreference(placement);
|
|
13890
|
+
const preferAlignment = getEdgeAlignmentPreference(placement);
|
|
13891
|
+
const sidePlacement = resolveSidePlacement({
|
|
13892
|
+
preferSide,
|
|
13893
|
+
spaceLeft: anchorRect.left,
|
|
13894
|
+
spaceRight: window.innerWidth - anchorRect.right,
|
|
13895
|
+
popoverWidth: paper.offsetWidth,
|
|
13896
|
+
hasArrow: true,
|
|
13897
|
+
});
|
|
13898
|
+
const edgeAlignment = resolveEdgeAlignment({
|
|
13899
|
+
preferAlignment,
|
|
13900
|
+
anchorTop: anchorRect.top,
|
|
13901
|
+
anchorBottom: anchorRect.bottom,
|
|
13902
|
+
anchorHeight: anchorRect.height,
|
|
13903
|
+
popoverHeight: paper.offsetHeight,
|
|
13904
|
+
viewportHeight: window.innerHeight,
|
|
13905
|
+
});
|
|
13906
|
+
const nextPlacement = placementForEdgeAlignment(placementForSidePlacement(placement, sidePlacement), edgeAlignment);
|
|
13907
|
+
const origins = getOriginsForPlacement(nextPlacement);
|
|
13908
|
+
updateResolved({
|
|
13909
|
+
anchorOrigin: origins.anchorOrigin,
|
|
13910
|
+
transformOrigin: origins.transformOrigin,
|
|
13911
|
+
placement: nextPlacement,
|
|
13912
|
+
});
|
|
13913
|
+
return;
|
|
13914
|
+
}
|
|
13915
|
+
const preferAbove = getVerticalPreference(preferenceAnchorOrigin, preferenceTransformOrigin) === "above";
|
|
13916
|
+
const verticalPlacement = resolveVerticalPlacement({
|
|
13917
|
+
preferAbove,
|
|
13918
|
+
spaceAbove: anchorRect.top,
|
|
13919
|
+
spaceBelow: window.innerHeight - anchorRect.bottom,
|
|
13920
|
+
popoverHeight: paper.offsetHeight,
|
|
13921
|
+
hasArrow: false,
|
|
13922
|
+
});
|
|
13923
|
+
const horizontalPlacement = resolveHorizontalPlacement({
|
|
13924
|
+
preferHorizontal: getHorizontalPreference(preferenceAnchorOrigin, preferenceTransformOrigin),
|
|
13925
|
+
anchorLeft: anchorRect.left,
|
|
13926
|
+
anchorRight: anchorRect.right,
|
|
13927
|
+
anchorWidth: anchorRect.width,
|
|
13928
|
+
popoverWidth: paper.offsetWidth,
|
|
13929
|
+
viewportWidth: window.innerWidth,
|
|
13930
|
+
});
|
|
13931
|
+
const origins = getOriginsForVerticalPlacement(verticalPlacement, horizontalPlacement);
|
|
13932
|
+
updateResolved({
|
|
13933
|
+
anchorOrigin: origins.anchorOrigin,
|
|
13934
|
+
transformOrigin: origins.transformOrigin,
|
|
13935
|
+
placement,
|
|
13936
|
+
});
|
|
13937
|
+
};
|
|
13938
|
+
const frame = requestAnimationFrame(measure);
|
|
13939
|
+
return () => cancelAnimationFrame(frame);
|
|
13940
|
+
}, [open, anchorEl, anchorOrigin, transformOrigin, placement]);
|
|
13941
|
+
const paperOffsetSx = getPaperArrowOffset(resolved.placement, resolved.anchorOrigin, resolved.transformOrigin);
|
|
13942
|
+
return {
|
|
13943
|
+
paperRef,
|
|
13944
|
+
anchorOrigin: resolved.anchorOrigin,
|
|
13945
|
+
transformOrigin: resolved.transformOrigin,
|
|
13946
|
+
placement: resolved.placement,
|
|
13947
|
+
paperOffsetSx,
|
|
13948
|
+
};
|
|
13949
|
+
};
|
|
13950
|
+
|
|
13951
|
+
const DEFAULT_POPOVER_ANCHOR_ORIGIN = {
|
|
13952
|
+
vertical: exports.PopoverPlacementSide.Top,
|
|
13953
|
+
horizontal: PopoverHorizontalPlacement.Left,
|
|
13954
|
+
};
|
|
13955
|
+
const DEFAULT_POPOVER_TRANSFORM_ORIGIN = {
|
|
13956
|
+
vertical: exports.PopoverPlacementSide.Top,
|
|
13957
|
+
horizontal: PopoverHorizontalPlacement.Left,
|
|
13958
|
+
};
|
|
12678
13959
|
const Popover = (_a) => {
|
|
12679
|
-
var { title, body, actions, icon, showCloseButton = false, featureHighlight = false, size = "medium",
|
|
13960
|
+
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"]);
|
|
12680
13961
|
const theme = material.useTheme();
|
|
13962
|
+
const { paperRef, anchorOrigin: resolvedAnchorOrigin, transformOrigin: resolvedTransformOrigin, placement: resolvedPlacement, paperOffsetSx, } = useResolvedPopoverPlacement({
|
|
13963
|
+
open,
|
|
13964
|
+
anchorEl: props.anchorEl,
|
|
13965
|
+
anchorOrigin,
|
|
13966
|
+
transformOrigin,
|
|
13967
|
+
placement,
|
|
13968
|
+
});
|
|
12681
13969
|
const bg = featureHighlight
|
|
12682
13970
|
? theme.palette.vars.controlBorderActive
|
|
12683
13971
|
: theme.palette.vars.controlBackgroundDefault;
|
|
12684
|
-
return (jsxRuntime.
|
|
13972
|
+
return (jsxRuntime.jsx(material.Popover, Object.assign({}, props, { open: open, disableScrollLock: disableScrollLock, marginThreshold: null, anchorOrigin: resolvedAnchorOrigin, transformOrigin: resolvedTransformOrigin, onClose: onClose, slotProps: {
|
|
12685
13973
|
paper: {
|
|
13974
|
+
ref: paperRef,
|
|
12686
13975
|
sx: [
|
|
12687
13976
|
getPopoverPaperStyles(theme, size),
|
|
12688
|
-
|
|
13977
|
+
paperOffsetSx,
|
|
12689
13978
|
...(Array.isArray(paperSx) ? paperSx : paperSx ? [paperSx] : []),
|
|
12690
13979
|
],
|
|
12691
13980
|
},
|
|
12692
|
-
}, children: [
|
|
13981
|
+
}, 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, { fontSize: "small" }) }))] })), body && (jsxRuntime.jsx(material.Typography, { component: "div", sx: popoverBodyStyles(theme), children: body }))] })), actions && jsxRuntime.jsx(material.Box, { sx: popoverActionsStyles, children: actions })] })] }))] }) })));
|
|
12693
13982
|
};
|
|
12694
13983
|
|
|
12695
13984
|
const getRadioButtonStyles = (theme) => ({
|
|
@@ -16038,6 +17327,7 @@
|
|
|
16038
17327
|
exports.NoData = NoData;
|
|
16039
17328
|
exports.OS_LIGHT_COLORS = OS_LIGHT_COLORS;
|
|
16040
17329
|
exports.OverflowTooltip = OverflowTooltip;
|
|
17330
|
+
exports.POPOVER_PLACEMENTS = POPOVER_PLACEMENTS;
|
|
16041
17331
|
exports.PageTitle = PageTitle;
|
|
16042
17332
|
exports.Pagination = Pagination;
|
|
16043
17333
|
exports.PathDisplay = PathDisplay;
|
|
@@ -16169,6 +17459,7 @@
|
|
|
16169
17459
|
exports.illustrationSurfaceSubtle = illustrationSurfaceSubtle;
|
|
16170
17460
|
exports.illustrationWarningGradientEnd = illustrationWarningGradientEnd;
|
|
16171
17461
|
exports.illustrationWarningGradientStart = illustrationWarningGradientStart;
|
|
17462
|
+
exports.iocVars = iocVars;
|
|
16172
17463
|
exports.isLeaf = isLeaf;
|
|
16173
17464
|
exports.lavender10 = lavender10;
|
|
16174
17465
|
exports.lavender100 = lavender100;
|