@czi-sds/components 23.9.0 → 24.1.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 +3 -3
- package/dist/index.cjs.d.ts +146 -36
- package/dist/index.cjs.js +185 -159
- package/dist/index.esm.d.ts +146 -36
- package/dist/index.esm.js +186 -160
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as React$1 from "react";
|
|
|
3
3
|
import React, { Children, Fragment, cloneElement, createContext, createElement, forwardRef, isValidElement, memo, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
4
4
|
import _styled from "@emotion/styled/base";
|
|
5
5
|
import { css } from "@emotion/react";
|
|
6
|
-
import { Accordion as Accordion$1, AccordionDetails as AccordionDetails$1, AccordionSummary, Alert as Alert$1, AlertTitle, AppBar, Autocomplete as Autocomplete$1, Box, Button as Button$1, ButtonGroup as ButtonGroup$1, Card, CardActions, CardContent, CardMedia, CardMedia as CardMedia$1, Checkbox, Chip as Chip$1, ClickAwayListener, Dialog as Dialog$1, DialogActions as DialogActions$1, DialogContent, DialogTitle as DialogTitle$1, Divider, Drawer, FormControlLabel, Grow, IconButton, InputAdornment, Link as Link$1, List as List$1, ListItem as ListItem$1, ListSubheader as ListSubheader$1, Menu as Menu$1, MenuItem as MenuItem$1, MenuList, Paper, Popover as Popover$1, Popper, Radio, Slide, Slider, SvgIcon, Switch, Tab as Tab$1, Table as Table$1, TableBody, TableCell, TableContainer, TableRow as TableRow$1, Tabs as Tabs$1, TextField, ToggleButton, ToggleButtonGroup, Toolbar, Tooltip as Tooltip$1, Typography, accordionClasses, accordionDetailsClasses, accordionSummaryClasses, alertClasses, alertTitleClasses, alpha, autocompleteClasses, buttonBaseClasses, buttonClasses, buttonGroupClasses, checkboxClasses, createTheme, css as css$1, darken, dialogActionsClasses, drawerClasses, inputAdornmentClasses, inputBaseClasses, menuClasses, menuItemClasses, outlinedInputClasses, popoverClasses, radioClasses, sliderClasses, styled, switchClasses, tabsClasses, toggleButtonClasses, useMediaQuery, useScrollTrigger, useTheme } from "@mui/material";
|
|
6
|
+
import { Accordion as Accordion$1, AccordionDetails as AccordionDetails$1, AccordionSummary, Alert as Alert$1, AlertTitle, AppBar, Autocomplete as Autocomplete$1, Box, Button as Button$1, ButtonGroup as ButtonGroup$1, Card, CardActions, CardContent, CardMedia, CardMedia as CardMedia$1, Checkbox, Chip as Chip$1, ClickAwayListener, Dialog as Dialog$1, DialogActions as DialogActions$1, DialogContent, DialogTitle as DialogTitle$1, Divider, Drawer, FormControlLabel, Grow, IconButton, InputAdornment, Link as Link$1, List as List$1, ListItem as ListItem$1, ListSubheader as ListSubheader$1, Menu as Menu$1, MenuItem as MenuItem$1, MenuList, Paper, Popover as Popover$1, Popper, Radio, Slide, Slider, SvgIcon, Switch, Tab as Tab$1, Table as Table$1, TableBody, TableCell, TableContainer, TableRow as TableRow$1, Tabs as Tabs$1, TextField, ToggleButton, ToggleButtonGroup, Toolbar, Tooltip as Tooltip$1, Typography, accordionClasses, accordionDetailsClasses, accordionSummaryClasses, alertClasses, alertTitleClasses, alpha, autocompleteClasses, backdropClasses, buttonBaseClasses, buttonClasses, buttonGroupClasses, checkboxClasses, createTheme, css as css$1, darken, dialogActionsClasses, drawerClasses, inputAdornmentClasses, inputBaseClasses, menuClasses, menuItemClasses, outlinedInputClasses, popoverClasses, radioClasses, sliderClasses, styled, switchClasses, tabsClasses, toggleButtonClasses, useMediaQuery, useScrollTrigger, useTheme } from "@mui/material";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { useForkRef } from "@mui/material/utils";
|
|
9
9
|
import { Clear } from "@mui/icons-material";
|
|
@@ -6288,6 +6288,19 @@ const StyledIcon$2 = /*#__PURE__*/ _styled("div", { target: "emi0zh40" })({
|
|
|
6288
6288
|
//#region src/core/Icon/index.tsx
|
|
6289
6289
|
/**
|
|
6290
6290
|
* @see https://mui.com/material-ui/icons/#icons
|
|
6291
|
+
*
|
|
6292
|
+
* @deprecated
|
|
6293
|
+
* This component is deprecated and will be removed in a future major version.
|
|
6294
|
+
* SDS icons come from Phosphor now: import the icon you need from
|
|
6295
|
+
* `@phosphor-icons/react`, or from `@czi-sds/icons` for the icons SDS draws
|
|
6296
|
+
* itself. Both take the same props, so the only difference is the import.
|
|
6297
|
+
*
|
|
6298
|
+
* ```tsx
|
|
6299
|
+
* // Before
|
|
6300
|
+
* <Icon sdsIcon="InfoCircle" sdsSize="l" />
|
|
6301
|
+
* // After
|
|
6302
|
+
* <InfoIcon size={24} />
|
|
6303
|
+
* ```
|
|
6291
6304
|
*/
|
|
6292
6305
|
const Icon = forwardRef(function Icon({ className, color, shade, sdsIcon, sdsSize }, ref) {
|
|
6293
6306
|
var _iconMap$sdsIcon;
|
|
@@ -8197,17 +8210,9 @@ const SDS_WARNINGS = {
|
|
|
8197
8210
|
hasWarned: false,
|
|
8198
8211
|
message: "Warning: MenuSelect will be deprecated and replaced with <DropdownMenu />"
|
|
8199
8212
|
},
|
|
8200
|
-
["tooltipSubtitle"]: {
|
|
8201
|
-
hasWarned: false,
|
|
8202
|
-
message: "Warning: The 'subtitle' text is only available for dark tooltips!"
|
|
8203
|
-
},
|
|
8204
|
-
["tooltipWidth"]: {
|
|
8205
|
-
hasWarned: false,
|
|
8206
|
-
message: "Warning: The 'wide' width is only available for light tooltips!"
|
|
8207
|
-
},
|
|
8208
8213
|
["tooltipInvertStyle"]: {
|
|
8209
8214
|
hasWarned: false,
|
|
8210
|
-
message: "Warning: Tooltips
|
|
8215
|
+
message: "Warning: The 'hasInvertedStyle', 'inverted' and 'sdsStyle' props are deprecated and no longer change how a Tooltip looks. Tooltips now follow the theme mode, and these props will be removed in a future release."
|
|
8211
8216
|
},
|
|
8212
8217
|
["contentCardActionsOnlyButtons"]: {
|
|
8213
8218
|
hasWarned: false,
|
|
@@ -8422,8 +8427,71 @@ const StyledButtonGroup = /*#__PURE__*/ _styled(ButtonGroup$1, {
|
|
|
8422
8427
|
return /*#__PURE__*/ css(GeneralButtonGroupStyles(props), " ", sdsType === "primary" && PrimaryButtonGroupStyles(props), " ", sdsType === "secondary" && SecondaryButtonGroupStyles(props), " ", size === "large" && LargeButtonGroupStyles(props), " ", size === "medium" && MediumButtonGroupStyles(props), " ", size === "small" && SmallButtonGroupStyles(props), ";");
|
|
8423
8428
|
}, ";");
|
|
8424
8429
|
//#endregion
|
|
8430
|
+
//#region src/core/ButtonToggle/style.ts
|
|
8431
|
+
/**
|
|
8432
|
+
* (masoudmanson): Since StyledButtonToggle is built on top of Button,
|
|
8433
|
+
* we only need to exclude the `sdsStage` prop from being forwarded,
|
|
8434
|
+
* as it is not a valid prop for Button.
|
|
8435
|
+
* All other props should be passed down to Button; otherwise,
|
|
8436
|
+
* the component won’t function as expected.
|
|
8437
|
+
*/
|
|
8438
|
+
const doNotForwardProps$39 = ["sdsStage"];
|
|
8439
|
+
/**
|
|
8440
|
+
* Utility to select the appropriate color based on background appearance.
|
|
8441
|
+
* Returns the dark variant when backgroundAppearance is "dark", otherwise returns the light variant.
|
|
8442
|
+
*/
|
|
8443
|
+
const getAppearanceColor = (lightColor, darkColor, backgroundAppearance) => {
|
|
8444
|
+
return backgroundAppearance === "dark" ? darkColor : lightColor;
|
|
8445
|
+
};
|
|
8446
|
+
const StageOnStyles = (props) => {
|
|
8447
|
+
var _semanticColors$accen, _semanticColors$accen2, _semanticColors$base, _semanticColors$base2, _semanticColors$accen3, _semanticColors$accen4, _semanticColors$base3, _semanticColors$base4, _semanticColors$accen5, _semanticColors$accen6, _semanticColors$base5, _semanticColors$base6, _semanticColors$accen7, _semanticColors$accen8, _semanticColors$base7, _semanticColors$base8;
|
|
8448
|
+
const { sdsType, sdsStyle, backgroundOnHover, backgroundAppearance = "matchBackground" } = props;
|
|
8449
|
+
const semanticColors = getSemanticColors(props);
|
|
8450
|
+
const contentColor = sdsType === "primary" ? getAppearanceColor(semanticColors === null || semanticColors === void 0 || (_semanticColors$accen = semanticColors.accent) === null || _semanticColors$accen === void 0 ? void 0 : _semanticColors$accen.foreground, semanticColors === null || semanticColors === void 0 || (_semanticColors$accen2 = semanticColors.accent) === null || _semanticColors$accen2 === void 0 ? void 0 : _semanticColors$accen2.foregroundOnDark, backgroundAppearance) : getAppearanceColor(semanticColors === null || semanticColors === void 0 || (_semanticColors$base = semanticColors.base) === null || _semanticColors$base === void 0 ? void 0 : _semanticColors$base.textPrimary, semanticColors === null || semanticColors === void 0 || (_semanticColors$base2 = semanticColors.base) === null || _semanticColors$base2 === void 0 ? void 0 : _semanticColors$base2.textPrimaryOnDark, backgroundAppearance);
|
|
8451
|
+
const backgroundColor = sdsStyle === "outline" && sdsType === "primary" ? getAppearanceColor(semanticColors === null || semanticColors === void 0 || (_semanticColors$accen3 = semanticColors.accent) === null || _semanticColors$accen3 === void 0 ? void 0 : _semanticColors$accen3.surfaceSecondary, semanticColors === null || semanticColors === void 0 || (_semanticColors$accen4 = semanticColors.accent) === null || _semanticColors$accen4 === void 0 ? void 0 : _semanticColors$accen4.surfaceSecondaryOnDark, backgroundAppearance) : getAppearanceColor(semanticColors === null || semanticColors === void 0 || (_semanticColors$base3 = semanticColors.base) === null || _semanticColors$base3 === void 0 ? void 0 : _semanticColors$base3.fillPrimaryInteraction, semanticColors === null || semanticColors === void 0 || (_semanticColors$base4 = semanticColors.base) === null || _semanticColors$base4 === void 0 ? void 0 : _semanticColors$base4.fillPrimaryInteractionOnDark, backgroundAppearance);
|
|
8452
|
+
const ornamentColor = sdsStyle === "outline" ? sdsType === "primary" ? getAppearanceColor(semanticColors === null || semanticColors === void 0 || (_semanticColors$accen5 = semanticColors.accent) === null || _semanticColors$accen5 === void 0 ? void 0 : _semanticColors$accen5.foreground, semanticColors === null || semanticColors === void 0 || (_semanticColors$accen6 = semanticColors.accent) === null || _semanticColors$accen6 === void 0 ? void 0 : _semanticColors$accen6.foregroundOnDark, backgroundAppearance) : getAppearanceColor(semanticColors === null || semanticColors === void 0 || (_semanticColors$base5 = semanticColors.base) === null || _semanticColors$base5 === void 0 ? void 0 : _semanticColors$base5.ornamentPrimary, semanticColors === null || semanticColors === void 0 || (_semanticColors$base6 = semanticColors.base) === null || _semanticColors$base6 === void 0 ? void 0 : _semanticColors$base6.ornamentPrimaryOnDark, backgroundAppearance) : sdsType === "primary" ? getAppearanceColor(semanticColors === null || semanticColors === void 0 || (_semanticColors$accen7 = semanticColors.accent) === null || _semanticColors$accen7 === void 0 ? void 0 : _semanticColors$accen7.foreground, semanticColors === null || semanticColors === void 0 || (_semanticColors$accen8 = semanticColors.accent) === null || _semanticColors$accen8 === void 0 ? void 0 : _semanticColors$accen8.foregroundOnDark, backgroundAppearance) : getAppearanceColor(semanticColors === null || semanticColors === void 0 || (_semanticColors$base7 = semanticColors.base) === null || _semanticColors$base7 === void 0 ? void 0 : _semanticColors$base7.ornamentSecondaryInteraction, semanticColors === null || semanticColors === void 0 || (_semanticColors$base8 = semanticColors.base) === null || _semanticColors$base8 === void 0 ? void 0 : _semanticColors$base8.ornamentSecondaryInteractionOnDark, backgroundAppearance);
|
|
8453
|
+
if (sdsType === "secondary")
|
|
8454
|
+
/**
|
|
8455
|
+
* Specificity boost via Emotion's `&&&&` technique.
|
|
8456
|
+
*
|
|
8457
|
+
* Each `&` repeats the component's generated class, producing a selector
|
|
8458
|
+
* like `.css-abc123.css-abc123.css-abc123.css-abc123`, which has
|
|
8459
|
+
* specificity (0,4,0).
|
|
8460
|
+
*
|
|
8461
|
+
* This is needed because ButtonGroup styles its children with
|
|
8462
|
+
* `&& .MuiButtonGroup-grouped` which has specificity (0,3,0).
|
|
8463
|
+
* Without the boost, the sdsStage="on" styles would always lose
|
|
8464
|
+
* the cascade to the ButtonGroup's parent-level overrides.
|
|
8465
|
+
*/
|
|
8466
|
+
return /*#__PURE__*/ css("&&&&{color:", contentColor, ";svg{color:", ornamentColor, ";}&::before{background-color:", sdsStyle === "minimal" && !backgroundOnHover ? "transparent" : backgroundColor, ";}}");
|
|
8467
|
+
return /*#__PURE__*/ css("&&&&{background-color:", sdsStyle === "minimal" && !backgroundOnHover ? "transparent" : backgroundColor, ";color:", contentColor, ";svg{color:", ornamentColor, ";}}");
|
|
8468
|
+
};
|
|
8469
|
+
const StyledButtonToggle = /*#__PURE__*/ _styled(Button, {
|
|
8470
|
+
shouldForwardProp: (prop) => !doNotForwardProps$39.includes(prop),
|
|
8471
|
+
target: "euuolxv0"
|
|
8472
|
+
})((props) => {
|
|
8473
|
+
const { sdsStage } = props;
|
|
8474
|
+
if (sdsStage === "on") return StageOnStyles(props);
|
|
8475
|
+
return null;
|
|
8476
|
+
}, ";");
|
|
8477
|
+
//#endregion
|
|
8478
|
+
//#region src/core/ButtonToggle/index.tsx
|
|
8479
|
+
const _excluded$38 = ["startIcon"];
|
|
8480
|
+
/**
|
|
8481
|
+
* @see https://mui.com/material-ui/react-button/
|
|
8482
|
+
*/
|
|
8483
|
+
const ButtonToggle = React.forwardRef((props, ref) => {
|
|
8484
|
+
const { startIcon } = props;
|
|
8485
|
+
return /* @__PURE__ */ jsx(StyledButtonToggle, _objectSpread2(_objectSpread2({}, _objectWithoutProperties(props, _excluded$38)), {}, {
|
|
8486
|
+
startIcon,
|
|
8487
|
+
endIcon: null,
|
|
8488
|
+
backgroundOnHover: true,
|
|
8489
|
+
ref
|
|
8490
|
+
}));
|
|
8491
|
+
});
|
|
8492
|
+
//#endregion
|
|
8425
8493
|
//#region src/core/ButtonGroup/index.tsx
|
|
8426
|
-
const _excluded$
|
|
8494
|
+
const _excluded$37 = [
|
|
8427
8495
|
"sdsType",
|
|
8428
8496
|
"size",
|
|
8429
8497
|
"orientation",
|
|
@@ -8452,17 +8520,20 @@ const areAllButtonsIconOnly = (children) => {
|
|
|
8452
8520
|
return childArray.every((child) => isIconOnlyButton(child));
|
|
8453
8521
|
};
|
|
8454
8522
|
/**
|
|
8455
|
-
*
|
|
8523
|
+
* The components a group is made of, and so the ones its size applies to. A
|
|
8524
|
+
* ButtonToggle passes `size` on to the Button underneath it, which is what
|
|
8525
|
+
* keeps a mixed group at one height.
|
|
8456
8526
|
*/
|
|
8457
|
-
const
|
|
8458
|
-
|
|
8527
|
+
const GROUPED_COMPONENTS = [Button, ButtonToggle];
|
|
8528
|
+
const takesGroupSize = (element) => {
|
|
8529
|
+
return GROUPED_COMPONENTS.includes(element.type);
|
|
8459
8530
|
};
|
|
8460
8531
|
/**
|
|
8461
|
-
* Clone children and inject the size prop to
|
|
8532
|
+
* Clone children and inject the size prop to the buttons in the group.
|
|
8462
8533
|
*/
|
|
8463
8534
|
const cloneChildrenWithSize = (children, size) => {
|
|
8464
8535
|
return Children.map(children, (child) => {
|
|
8465
|
-
if (isValidElement(child) &&
|
|
8536
|
+
if (isValidElement(child) && takesGroupSize(child)) return cloneElement(child, { size });
|
|
8466
8537
|
return child;
|
|
8467
8538
|
});
|
|
8468
8539
|
};
|
|
@@ -8475,7 +8546,7 @@ const cloneChildrenWithSize = (children, size) => {
|
|
|
8475
8546
|
* Note: Vertical orientation is only available when all buttons are icon-only.
|
|
8476
8547
|
*/
|
|
8477
8548
|
const ButtonGroup = React.forwardRef((props, ref) => {
|
|
8478
|
-
const { sdsType = "primary", size = "large", orientation = "horizontal", children } = props, rest = _objectWithoutProperties(props, _excluded$
|
|
8549
|
+
const { sdsType = "primary", size = "large", orientation = "horizontal", children } = props, rest = _objectWithoutProperties(props, _excluded$37);
|
|
8479
8550
|
const allIconOnly = areAllButtonsIconOnly(children);
|
|
8480
8551
|
const effectiveOrientation = allIconOnly ? orientation : "horizontal";
|
|
8481
8552
|
if (orientation === "vertical" && !allIconOnly) showWarningIfFirstOccurence("ButtonGroupVerticalOrientation");
|
|
@@ -8528,7 +8599,7 @@ const large = (props) => {
|
|
|
8528
8599
|
const spaces = getSpaces(props);
|
|
8529
8600
|
return /*#__PURE__*/ css(sdsType !== "tertiary" ? `margin: 0 ${spaces === null || spaces === void 0 ? void 0 : spaces.s}px ${spaces === null || spaces === void 0 ? void 0 : spaces.s}px 0;` : "", " .MuiSvgIcon-root{height:", iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.xl.height, "px;width:", iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.xl.height, "px;", sdsType !== "tertiary" ? `margin: ${spaces === null || spaces === void 0 ? void 0 : spaces.xxs}px;` : "", ";}");
|
|
8530
8601
|
};
|
|
8531
|
-
const doNotForwardProps$
|
|
8602
|
+
const doNotForwardProps$38 = [
|
|
8532
8603
|
"on",
|
|
8533
8604
|
"sdsSize",
|
|
8534
8605
|
"sdsType",
|
|
@@ -8538,7 +8609,7 @@ const doNotForwardProps$39 = [
|
|
|
8538
8609
|
"customTheme"
|
|
8539
8610
|
];
|
|
8540
8611
|
const StyledButtonIcon = /*#__PURE__*/ _styled(IconButton, {
|
|
8541
|
-
shouldForwardProp: (prop) => !doNotForwardProps$
|
|
8612
|
+
shouldForwardProp: (prop) => !doNotForwardProps$38.includes(prop),
|
|
8542
8613
|
target: "e164i6480"
|
|
8543
8614
|
})("padding:0;", focusVisibleA11yStyle, " ", (props) => {
|
|
8544
8615
|
const { disabled, sdsSize = "medium", sdsType = "primary" } = props;
|
|
@@ -8584,68 +8655,6 @@ const ButtonIcon = forwardRef(function ButtonIcon(props, ref) {
|
|
|
8584
8655
|
}));
|
|
8585
8656
|
});
|
|
8586
8657
|
//#endregion
|
|
8587
|
-
//#region src/core/ButtonToggle/style.ts
|
|
8588
|
-
/**
|
|
8589
|
-
* (masoudmanson): Since StyledButtonToggle is built on top of Button,
|
|
8590
|
-
* we only need to exclude the `sdsStage` prop from being forwarded,
|
|
8591
|
-
* as it is not a valid prop for Button.
|
|
8592
|
-
* All other props should be passed down to Button; otherwise,
|
|
8593
|
-
* the component won’t function as expected.
|
|
8594
|
-
*/
|
|
8595
|
-
const doNotForwardProps$38 = ["sdsStage"];
|
|
8596
|
-
/**
|
|
8597
|
-
* Utility to select the appropriate color based on background appearance.
|
|
8598
|
-
* Returns the dark variant when backgroundAppearance is "dark", otherwise returns the light variant.
|
|
8599
|
-
*/
|
|
8600
|
-
const getAppearanceColor = (lightColor, darkColor, backgroundAppearance) => {
|
|
8601
|
-
return backgroundAppearance === "dark" ? darkColor : lightColor;
|
|
8602
|
-
};
|
|
8603
|
-
const StageOnStyles = (props) => {
|
|
8604
|
-
var _semanticColors$accen, _semanticColors$accen2, _semanticColors$base, _semanticColors$base2, _semanticColors$accen3, _semanticColors$accen4, _semanticColors$base3, _semanticColors$base4, _semanticColors$accen5, _semanticColors$accen6, _semanticColors$base5, _semanticColors$base6, _semanticColors$accen7, _semanticColors$accen8, _semanticColors$base7, _semanticColors$base8;
|
|
8605
|
-
const { sdsType, sdsStyle, backgroundOnHover, backgroundAppearance = "matchBackground" } = props;
|
|
8606
|
-
const semanticColors = getSemanticColors(props);
|
|
8607
|
-
const contentColor = sdsType === "primary" ? getAppearanceColor(semanticColors === null || semanticColors === void 0 || (_semanticColors$accen = semanticColors.accent) === null || _semanticColors$accen === void 0 ? void 0 : _semanticColors$accen.foreground, semanticColors === null || semanticColors === void 0 || (_semanticColors$accen2 = semanticColors.accent) === null || _semanticColors$accen2 === void 0 ? void 0 : _semanticColors$accen2.foregroundOnDark, backgroundAppearance) : getAppearanceColor(semanticColors === null || semanticColors === void 0 || (_semanticColors$base = semanticColors.base) === null || _semanticColors$base === void 0 ? void 0 : _semanticColors$base.textPrimary, semanticColors === null || semanticColors === void 0 || (_semanticColors$base2 = semanticColors.base) === null || _semanticColors$base2 === void 0 ? void 0 : _semanticColors$base2.textPrimaryOnDark, backgroundAppearance);
|
|
8608
|
-
const backgroundColor = sdsStyle === "outline" && sdsType === "primary" ? getAppearanceColor(semanticColors === null || semanticColors === void 0 || (_semanticColors$accen3 = semanticColors.accent) === null || _semanticColors$accen3 === void 0 ? void 0 : _semanticColors$accen3.surfaceSecondary, semanticColors === null || semanticColors === void 0 || (_semanticColors$accen4 = semanticColors.accent) === null || _semanticColors$accen4 === void 0 ? void 0 : _semanticColors$accen4.surfaceSecondaryOnDark, backgroundAppearance) : getAppearanceColor(semanticColors === null || semanticColors === void 0 || (_semanticColors$base3 = semanticColors.base) === null || _semanticColors$base3 === void 0 ? void 0 : _semanticColors$base3.fillPrimaryInteraction, semanticColors === null || semanticColors === void 0 || (_semanticColors$base4 = semanticColors.base) === null || _semanticColors$base4 === void 0 ? void 0 : _semanticColors$base4.fillPrimaryInteractionOnDark, backgroundAppearance);
|
|
8609
|
-
const ornamentColor = sdsStyle === "outline" ? sdsType === "primary" ? getAppearanceColor(semanticColors === null || semanticColors === void 0 || (_semanticColors$accen5 = semanticColors.accent) === null || _semanticColors$accen5 === void 0 ? void 0 : _semanticColors$accen5.foreground, semanticColors === null || semanticColors === void 0 || (_semanticColors$accen6 = semanticColors.accent) === null || _semanticColors$accen6 === void 0 ? void 0 : _semanticColors$accen6.foregroundOnDark, backgroundAppearance) : getAppearanceColor(semanticColors === null || semanticColors === void 0 || (_semanticColors$base5 = semanticColors.base) === null || _semanticColors$base5 === void 0 ? void 0 : _semanticColors$base5.ornamentPrimary, semanticColors === null || semanticColors === void 0 || (_semanticColors$base6 = semanticColors.base) === null || _semanticColors$base6 === void 0 ? void 0 : _semanticColors$base6.ornamentPrimaryOnDark, backgroundAppearance) : sdsType === "primary" ? getAppearanceColor(semanticColors === null || semanticColors === void 0 || (_semanticColors$accen7 = semanticColors.accent) === null || _semanticColors$accen7 === void 0 ? void 0 : _semanticColors$accen7.foreground, semanticColors === null || semanticColors === void 0 || (_semanticColors$accen8 = semanticColors.accent) === null || _semanticColors$accen8 === void 0 ? void 0 : _semanticColors$accen8.foregroundOnDark, backgroundAppearance) : getAppearanceColor(semanticColors === null || semanticColors === void 0 || (_semanticColors$base7 = semanticColors.base) === null || _semanticColors$base7 === void 0 ? void 0 : _semanticColors$base7.ornamentSecondaryInteraction, semanticColors === null || semanticColors === void 0 || (_semanticColors$base8 = semanticColors.base) === null || _semanticColors$base8 === void 0 ? void 0 : _semanticColors$base8.ornamentSecondaryInteractionOnDark, backgroundAppearance);
|
|
8610
|
-
if (sdsType === "secondary")
|
|
8611
|
-
/**
|
|
8612
|
-
* Specificity boost via Emotion's `&&&&` technique.
|
|
8613
|
-
*
|
|
8614
|
-
* Each `&` repeats the component's generated class, producing a selector
|
|
8615
|
-
* like `.css-abc123.css-abc123.css-abc123.css-abc123` — specificity (0,4,0).
|
|
8616
|
-
*
|
|
8617
|
-
* This is needed because ButtonGroup styles its children with
|
|
8618
|
-
* `&& .MuiButtonGroup-grouped` which has specificity (0,3,0).
|
|
8619
|
-
* Without the boost, the sdsStage="on" styles would always lose
|
|
8620
|
-
* the cascade to the ButtonGroup's parent-level overrides.
|
|
8621
|
-
*/
|
|
8622
|
-
return /*#__PURE__*/ css("&&&&{color:", contentColor, ";svg{color:", ornamentColor, ";}&::before{background-color:", sdsStyle === "minimal" && !backgroundOnHover ? "transparent" : backgroundColor, ";}}");
|
|
8623
|
-
return /*#__PURE__*/ css("&&&&{background-color:", sdsStyle === "minimal" && !backgroundOnHover ? "transparent" : backgroundColor, ";color:", contentColor, ";svg{color:", ornamentColor, ";}}");
|
|
8624
|
-
};
|
|
8625
|
-
const StyledButtonToggle = /*#__PURE__*/ _styled(Button, {
|
|
8626
|
-
shouldForwardProp: (prop) => !doNotForwardProps$38.includes(prop),
|
|
8627
|
-
target: "euuolxv0"
|
|
8628
|
-
})((props) => {
|
|
8629
|
-
const { sdsStage } = props;
|
|
8630
|
-
if (sdsStage === "on") return StageOnStyles(props);
|
|
8631
|
-
return null;
|
|
8632
|
-
}, ";");
|
|
8633
|
-
//#endregion
|
|
8634
|
-
//#region src/core/ButtonToggle/index.tsx
|
|
8635
|
-
const _excluded$37 = ["startIcon"];
|
|
8636
|
-
/**
|
|
8637
|
-
* @see https://mui.com/material-ui/react-button/
|
|
8638
|
-
*/
|
|
8639
|
-
const ButtonToggle = React.forwardRef((props, ref) => {
|
|
8640
|
-
const { startIcon } = props;
|
|
8641
|
-
return /* @__PURE__ */ jsx(StyledButtonToggle, _objectSpread2(_objectSpread2({}, _objectWithoutProperties(props, _excluded$37)), {}, {
|
|
8642
|
-
startIcon,
|
|
8643
|
-
endIcon: null,
|
|
8644
|
-
backgroundOnHover: true,
|
|
8645
|
-
ref
|
|
8646
|
-
}));
|
|
8647
|
-
});
|
|
8648
|
-
//#endregion
|
|
8649
8658
|
//#region src/core/ButtonLegacy/style.ts
|
|
8650
8659
|
const doNotForwardProps$37 = [
|
|
8651
8660
|
"isAllCaps",
|
|
@@ -8992,7 +9001,8 @@ const _excluded$35 = [
|
|
|
8992
9001
|
"hideTitle",
|
|
8993
9002
|
"hideBody",
|
|
8994
9003
|
"sdsStyle",
|
|
8995
|
-
"children"
|
|
9004
|
+
"children",
|
|
9005
|
+
"extraContent"
|
|
8996
9006
|
];
|
|
8997
9007
|
const SDS_STAGE_OPEN = "open";
|
|
8998
9008
|
const SDS_STAGE_CLOSED = "closed";
|
|
@@ -9000,7 +9010,7 @@ const SDS_STAGE_CLOSED = "closed";
|
|
|
9000
9010
|
* @see https://mui.com/material-ui/react-alert/
|
|
9001
9011
|
*/
|
|
9002
9012
|
const Callout = (props) => {
|
|
9003
|
-
const { autoDismiss, dismissed, icon, sdsIconProps, intent, sdsStage = SDS_STAGE_OPEN, title, body, hideTitle = false, hideBody = false, sdsStyle = "persistent", children } = props, rest = _objectWithoutProperties(props, _excluded$35);
|
|
9013
|
+
const { autoDismiss, dismissed, icon, sdsIconProps, intent, sdsStage = SDS_STAGE_OPEN, title, body, hideTitle = false, hideBody = false, sdsStyle = "persistent", children, extraContent } = props, rest = _objectWithoutProperties(props, _excluded$35);
|
|
9004
9014
|
const [hide, setHide] = useState(dismissed);
|
|
9005
9015
|
const [stage, setStage] = useState(sdsStage);
|
|
9006
9016
|
useEffect(() => {
|
|
@@ -9080,70 +9090,62 @@ const Callout = (props) => {
|
|
|
9080
9090
|
hideTitle,
|
|
9081
9091
|
children: body
|
|
9082
9092
|
}),
|
|
9083
|
-
sdsStyle === "expandable" && !collapsed && /* @__PURE__ */
|
|
9093
|
+
sdsStyle === "expandable" && !collapsed && /* @__PURE__ */ jsxs(CalloutExtraContent, {
|
|
9084
9094
|
hideTitle,
|
|
9085
9095
|
hideBody,
|
|
9086
|
-
children
|
|
9096
|
+
children: [children, extraContent]
|
|
9087
9097
|
})
|
|
9088
9098
|
] }))
|
|
9089
9099
|
});
|
|
9090
9100
|
};
|
|
9091
9101
|
//#endregion
|
|
9092
9102
|
//#region src/core/Tooltip/style.ts
|
|
9093
|
-
const
|
|
9103
|
+
const surface = (props) => {
|
|
9094
9104
|
var _semanticColors$base, _semanticColors$base2;
|
|
9095
9105
|
const spaces = getSpaces(props);
|
|
9096
9106
|
const semanticColors = getSemanticColors(props);
|
|
9097
|
-
return /*#__PURE__*/ css$2(
|
|
9098
|
-
};
|
|
9099
|
-
const light = (props) => {
|
|
9100
|
-
var _semanticColors$base3, _semanticColors$base4;
|
|
9101
|
-
const spaces = getSpaces(props);
|
|
9102
|
-
const semanticColors = getSemanticColors(props);
|
|
9103
|
-
return /*#__PURE__*/ css$2(fontBodyXs(props), " background-color:", semanticColors === null || semanticColors === void 0 || (_semanticColors$base3 = semanticColors.base) === null || _semanticColors$base3 === void 0 ? void 0 : _semanticColors$base3.surfacePrimary, ";color:", semanticColors === null || semanticColors === void 0 || (_semanticColors$base4 = semanticColors.base) === null || _semanticColors$base4 === void 0 ? void 0 : _semanticColors$base4.textPrimary, ";padding:", spaces === null || spaces === void 0 ? void 0 : spaces.s, "px ", spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;");
|
|
9107
|
+
return /*#__PURE__*/ css$2(fontBodyXs(props), " background-color:", semanticColors === null || semanticColors === void 0 || (_semanticColors$base = semanticColors.base) === null || _semanticColors$base === void 0 ? void 0 : _semanticColors$base.surfacePrimary, ";color:", semanticColors === null || semanticColors === void 0 || (_semanticColors$base2 = semanticColors.base) === null || _semanticColors$base2 === void 0 ? void 0 : _semanticColors$base2.textPrimary, ";padding:", spaces === null || spaces === void 0 ? void 0 : spaces.s, "px ", spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;");
|
|
9104
9108
|
};
|
|
9105
9109
|
const tableStyles = (props) => {
|
|
9106
9110
|
const spaces = getSpaces(props);
|
|
9107
9111
|
return /*#__PURE__*/ css$2("padding:", spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;");
|
|
9108
9112
|
};
|
|
9109
|
-
const doNotForwardProps$34 = ["
|
|
9113
|
+
const doNotForwardProps$34 = ["textAlign"];
|
|
9110
9114
|
const StyledTitle = /*#__PURE__*/ _styled("p", {
|
|
9111
9115
|
shouldForwardProp: (prop) => !doNotForwardProps$34.includes(prop),
|
|
9112
9116
|
target: "e1j7jeiz3"
|
|
9113
9117
|
})(fontBodyMediumXs, " ", (props) => {
|
|
9114
|
-
var _semanticColors$
|
|
9115
|
-
const { hasInvertedStyle } = props;
|
|
9118
|
+
var _semanticColors$base3;
|
|
9116
9119
|
const semanticColors = getSemanticColors(props);
|
|
9117
9120
|
return `
|
|
9118
9121
|
margin: 0;
|
|
9119
|
-
color: ${
|
|
9122
|
+
color: ${semanticColors === null || semanticColors === void 0 || (_semanticColors$base3 = semanticColors.base) === null || _semanticColors$base3 === void 0 ? void 0 : _semanticColors$base3.textPrimary};
|
|
9120
9123
|
`;
|
|
9121
9124
|
}, ";");
|
|
9122
9125
|
const StyledSubtitle = /*#__PURE__*/ _styled("p", {
|
|
9123
9126
|
shouldForwardProp: (prop) => !doNotForwardProps$34.includes(prop),
|
|
9124
9127
|
target: "e1j7jeiz2"
|
|
9125
9128
|
})(fontBodyXxs, " ", (props) => {
|
|
9126
|
-
var _semanticColors$
|
|
9127
|
-
const { hasInvertedStyle } = props;
|
|
9129
|
+
var _semanticColors$base4;
|
|
9128
9130
|
const semanticColors = getSemanticColors(props);
|
|
9129
9131
|
return `
|
|
9130
9132
|
margin: 0;
|
|
9131
|
-
color: ${
|
|
9133
|
+
color: ${semanticColors === null || semanticColors === void 0 || (_semanticColors$base4 = semanticColors.base) === null || _semanticColors$base4 === void 0 ? void 0 : _semanticColors$base4.textSecondary};
|
|
9132
9134
|
`;
|
|
9133
9135
|
}, ";");
|
|
9134
9136
|
const tooltipCss = (props) => {
|
|
9135
|
-
var _semanticColors$
|
|
9136
|
-
const {
|
|
9137
|
+
var _semanticColors$base5;
|
|
9138
|
+
const { width, followCursor, textAlign } = props;
|
|
9137
9139
|
const shadows = getShadows(props);
|
|
9138
9140
|
const corners = getCorners(props);
|
|
9139
9141
|
const semanticColors = getSemanticColors(props);
|
|
9140
|
-
return /*#__PURE__*/ css$2("&.MuiTooltip-tooltip{border-radius:", corners === null || corners === void 0 ? void 0 : corners.l, "px;box-shadow:", shadows === null || shadows === void 0 ? void 0 : shadows.m, ";max-width:", width === "wide" ? "550px" : "250px", "!important;
|
|
9142
|
+
return /*#__PURE__*/ css$2("&.MuiTooltip-tooltip{border-radius:", corners === null || corners === void 0 ? void 0 : corners.l, "px;box-shadow:", shadows === null || shadows === void 0 ? void 0 : shadows.m, ";max-width:", width === "wide" ? "550px" : "250px", "!important;outline:1px solid ", addOpacityToHex((semanticColors === null || semanticColors === void 0 || (_semanticColors$base5 = semanticColors.base) === null || _semanticColors$base5 === void 0 ? void 0 : _semanticColors$base5.borderSecondary) || "#000000", 15), ";text-align:", textAlign ? textAlign : width === "wide" ? "left" : "center", "!important;", surface(props), " ", followCursor === true && tableStyles(props), ";}");
|
|
9141
9143
|
};
|
|
9142
9144
|
const arrowCss = (props) => {
|
|
9143
|
-
var _semanticColors$
|
|
9144
|
-
const {
|
|
9145
|
+
var _semanticColors$base6;
|
|
9146
|
+
const { arrowOffset } = props;
|
|
9145
9147
|
const semanticColors = getSemanticColors(props);
|
|
9146
|
-
return /*#__PURE__*/ css$2("&.MuiTooltip-arrow{", arrowOffset !== void 0 ? `left: ${arrowOffset}px !important;` : "", " color:",
|
|
9148
|
+
return /*#__PURE__*/ css$2("&.MuiTooltip-arrow{", arrowOffset !== void 0 ? `left: ${arrowOffset}px !important;` : "", " color:", semanticColors === null || semanticColors === void 0 || (_semanticColors$base6 = semanticColors.base) === null || _semanticColors$base6 === void 0 ? void 0 : _semanticColors$base6.surfacePrimary, ";&:before{box-sizing:border-box;width:12px;height:12px;}}");
|
|
9147
9149
|
};
|
|
9148
9150
|
const StyledPopper$2 = /*#__PURE__*/ _styled(Popper, { target: "e1j7jeiz1" })("z-index:", (props) => {
|
|
9149
9151
|
var _props$theme$zIndex$t, _props$theme;
|
|
@@ -9179,17 +9181,14 @@ const _excluded$34 = [
|
|
|
9179
9181
|
* https://mui.com/components/tooltips/#disabled-elements
|
|
9180
9182
|
*/
|
|
9181
9183
|
const Tooltip = forwardRef(function Tooltip(props, ref) {
|
|
9182
|
-
const { arrowOffset, classes, hasInvertedStyle
|
|
9184
|
+
const { arrowOffset, classes, hasInvertedStyle, inverted, sdsStyle, subtitle, title, width = "default", PopperComponent = StyledPopper$2, textAlign, componentSlot } = props, rest = _objectWithoutProperties(props, _excluded$34);
|
|
9183
9185
|
const { children } = rest;
|
|
9184
|
-
if (inverted || sdsStyle) showWarningIfFirstOccurence("tooltipInvertStyle");
|
|
9185
|
-
if (width === "wide" && (sdsStyle === "dark" || hasInvertedStyle)) showWarningIfFirstOccurence("tooltipWidth");
|
|
9186
|
-
const theme = useTheme();
|
|
9186
|
+
if (hasInvertedStyle !== void 0 || inverted !== void 0 || sdsStyle !== void 0) showWarningIfFirstOccurence("tooltipInvertStyle");
|
|
9187
9187
|
const extraProps = {
|
|
9188
9188
|
arrowOffset,
|
|
9189
9189
|
classes,
|
|
9190
|
-
hasInvertedStyle: invertStyleValue(inverted, sdsStyle, hasInvertedStyle),
|
|
9191
9190
|
textAlign,
|
|
9192
|
-
theme,
|
|
9191
|
+
theme: useTheme(),
|
|
9193
9192
|
width
|
|
9194
9193
|
};
|
|
9195
9194
|
const tooltip = mergeClass$1({
|
|
@@ -9208,16 +9207,9 @@ const Tooltip = forwardRef(function Tooltip(props, ref) {
|
|
|
9208
9207
|
arrow,
|
|
9209
9208
|
tooltip
|
|
9210
9209
|
},
|
|
9211
|
-
leaveDelay: hasInvertedStyle || inverted || sdsStyle === "dark" ? 0 : 500,
|
|
9212
9210
|
title: /* @__PURE__ */ jsxs("div", { children: [
|
|
9213
|
-
title && /* @__PURE__ */ jsx(StyledTitle, {
|
|
9214
|
-
|
|
9215
|
-
children: title
|
|
9216
|
-
}),
|
|
9217
|
-
subtitle && /* @__PURE__ */ jsx(StyledSubtitle, {
|
|
9218
|
-
hasInvertedStyle,
|
|
9219
|
-
children: subtitle
|
|
9220
|
-
}),
|
|
9211
|
+
title && /* @__PURE__ */ jsx(StyledTitle, { children: title }),
|
|
9212
|
+
subtitle && /* @__PURE__ */ jsx(StyledSubtitle, { children: subtitle }),
|
|
9221
9213
|
componentSlot && /* @__PURE__ */ jsx(StyledComponentSlotWrapper, {
|
|
9222
9214
|
shouldAddMargin: !!title || !!subtitle,
|
|
9223
9215
|
children: componentSlot
|
|
@@ -9228,15 +9220,6 @@ const Tooltip = forwardRef(function Tooltip(props, ref) {
|
|
|
9228
9220
|
arrow: true
|
|
9229
9221
|
}, rest), {}, { slots: { popper: PopperComponent } }));
|
|
9230
9222
|
});
|
|
9231
|
-
/**
|
|
9232
|
-
* (masoudmanson): Temporary function to handle the inversion of the tooltip
|
|
9233
|
-
* based on the sdsStyle, invert and hasInvertedStyle props.
|
|
9234
|
-
* Once the sdsStyle and invert props are completely removed,
|
|
9235
|
-
* this function will be removed as well.
|
|
9236
|
-
*/
|
|
9237
|
-
function invertStyleValue(inverted, sdsStyle, hasInvertedStyle) {
|
|
9238
|
-
return hasInvertedStyle !== void 0 ? hasInvertedStyle : sdsStyle === "dark" ? true : sdsStyle === "light" ? false : inverted;
|
|
9239
|
-
}
|
|
9240
9223
|
function mergeClass$1({ props, className, key }) {
|
|
9241
9224
|
const { classes } = props;
|
|
9242
9225
|
if (!classes) return className;
|
|
@@ -9461,8 +9444,7 @@ const CellBasic = forwardRef((props, ref) => {
|
|
|
9461
9444
|
subtitle: secondaryText,
|
|
9462
9445
|
arrow: true,
|
|
9463
9446
|
leaveDelay: 0,
|
|
9464
|
-
leaveTouchDelay: 0
|
|
9465
|
-
sdsStyle: "dark"
|
|
9447
|
+
leaveTouchDelay: 0
|
|
9466
9448
|
}, tooltipProps), {}, { children: /* @__PURE__ */ jsx(StyledTableData, _objectSpread2(_objectSpread2({
|
|
9467
9449
|
ref,
|
|
9468
9450
|
as
|
|
@@ -9633,7 +9615,6 @@ const CellHeader = forwardRef((props, ref) => {
|
|
|
9633
9615
|
if (shouldShowTooltipOnHover && hover) return /* @__PURE__ */ jsx(Tooltip, _objectSpread2(_objectSpread2({
|
|
9634
9616
|
arrow: true,
|
|
9635
9617
|
placement: "top-start",
|
|
9636
|
-
sdsStyle: "dark",
|
|
9637
9618
|
subtitle: tooltipSubtitle,
|
|
9638
9619
|
title: tooltipText
|
|
9639
9620
|
}, tooltipProps), {}, { children: /* @__PURE__ */ jsx(StyledTableHeader$1, _objectSpread2(_objectSpread2({
|
|
@@ -10024,10 +10005,10 @@ const labelFontBodyS = fontBody("s", "regular");
|
|
|
10024
10005
|
const labelFontBodyXs = fontBody("xs", "regular");
|
|
10025
10006
|
const inputDropdownStyles = (props) => {
|
|
10026
10007
|
var _semanticColors$base, _semanticColors$base2, _semanticColors$base3, _semanticColors$base4, _semanticColors$base5, _semanticColors$base6, _semanticColors$base7, _semanticColors$base8, _semanticColors$base9, _semanticColors$accen, _semanticColors$base10, _semanticColors$base11;
|
|
10027
|
-
const { width
|
|
10008
|
+
const { width } = props;
|
|
10028
10009
|
const spaces = getSpaces(props);
|
|
10029
10010
|
const semanticColors = getSemanticColors(props);
|
|
10030
|
-
return /*#__PURE__*/ css(labelStyle(props), " background-color:", semanticColors === null || semanticColors === void 0 || (_semanticColors$base = semanticColors.base) === null || _semanticColors$base === void 0 ? void 0 : _semanticColors$base.backgroundPrimary, "!important;border:none;box-shadow:inset 0 0 0 1px ", semanticColors === null || semanticColors === void 0 || (_semanticColors$base2 = semanticColors.base) === null || _semanticColors$base2 === void 0 ? void 0 : _semanticColors$base2.borderPrimary, ";cursor:pointer;padding:", spaces === null || spaces === void 0 ? void 0 : spaces.xs, "px ", spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;justify-content:start;
|
|
10011
|
+
return /*#__PURE__*/ css(labelStyle(props), " background-color:", semanticColors === null || semanticColors === void 0 || (_semanticColors$base = semanticColors.base) === null || _semanticColors$base === void 0 ? void 0 : _semanticColors$base.backgroundPrimary, "!important;border:none;box-shadow:inset 0 0 0 1px ", semanticColors === null || semanticColors === void 0 || (_semanticColors$base2 = semanticColors.base) === null || _semanticColors$base2 === void 0 ? void 0 : _semanticColors$base2.borderPrimary, ";cursor:pointer;padding:", spaces === null || spaces === void 0 ? void 0 : spaces.xs, "px ", spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;justify-content:start;", width ? `width: ${/^\d+$/.test(width) ? `${width}px` : width};` : "", " min-width:90px!important;&.MuiButton-text{&:hover{color:", semanticColors === null || semanticColors === void 0 || (_semanticColors$base3 = semanticColors.base) === null || _semanticColors$base3 === void 0 ? void 0 : _semanticColors$base3.textPrimary, ";}.styled-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}", IconWrapper, "{margin-left:", spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;}}path{fill:", semanticColors === null || semanticColors === void 0 || (_semanticColors$base4 = semanticColors.base) === null || _semanticColors$base4 === void 0 ? void 0 : _semanticColors$base4.ornamentSecondary, ";}&:hover{background-color:", semanticColors === null || semanticColors === void 0 || (_semanticColors$base5 = semanticColors.base) === null || _semanticColors$base5 === void 0 ? void 0 : _semanticColors$base5.fillPrimaryInteraction, ";box-shadow:inset 0 0 0 1px ", semanticColors === null || semanticColors === void 0 || (_semanticColors$base6 = semanticColors.base) === null || _semanticColors$base6 === void 0 ? void 0 : _semanticColors$base6.borderPrimaryInteraction, ";color:", semanticColors === null || semanticColors === void 0 || (_semanticColors$base7 = semanticColors.base) === null || _semanticColors$base7 === void 0 ? void 0 : _semanticColors$base7.textPrimary, ";path{fill:", semanticColors === null || semanticColors === void 0 || (_semanticColors$base8 = semanticColors.base) === null || _semanticColors$base8 === void 0 ? void 0 : _semanticColors$base8.ornamentSecondaryInteraction, ";}.styled-label{color:", semanticColors === null || semanticColors === void 0 || (_semanticColors$base9 = semanticColors.base) === null || _semanticColors$base9 === void 0 ? void 0 : _semanticColors$base9.textPrimary, ";}}&:active{background-color:transparent;box-shadow:inset 0 0 0 1px ", semanticColors === null || semanticColors === void 0 || (_semanticColors$accen = semanticColors.accent) === null || _semanticColors$accen === void 0 ? void 0 : _semanticColors$accen.foreground, ";color:", semanticColors === null || semanticColors === void 0 || (_semanticColors$base10 = semanticColors.base) === null || _semanticColors$base10 === void 0 ? void 0 : _semanticColors$base10.textPrimary, ";path{fill:", semanticColors === null || semanticColors === void 0 || (_semanticColors$base11 = semanticColors.base) === null || _semanticColors$base11 === void 0 ? void 0 : _semanticColors$base11.ornamentSecondaryInteraction, ";}}&:focus{background-color:transparent;outline-offset:-1px;}");
|
|
10031
10012
|
};
|
|
10032
10013
|
const minimal$1 = (props) => {
|
|
10033
10014
|
var _semanticColors$base12, _semanticColors$base13, _semanticColors$base14, _semanticColors$base15, _semanticColors$base16, _semanticColors$base17, _semanticColors$base18;
|
|
@@ -10195,7 +10176,7 @@ const validateSdsStyle = (sdsStyle) => {
|
|
|
10195
10176
|
/**
|
|
10196
10177
|
* @see https://mui.com/material-ui/react-button/
|
|
10197
10178
|
*/
|
|
10198
|
-
const InputDropdown = (props)
|
|
10179
|
+
const InputDropdown = forwardRef(function InputDropdown(props, ref) {
|
|
10199
10180
|
const { label, multiple = false, sdsStyle: rawSdsStyle = "square", sdsType = "label", details, counter, shouldTruncateMinimalDetails, shouldPutAColonAfterLabel = true, value, classes = EMPTY_OBJECT, className } = props;
|
|
10200
10181
|
const sdsStyle = validateSdsStyle(rawSdsStyle);
|
|
10201
10182
|
const isMinimal = sdsStyle === "minimal";
|
|
@@ -10205,6 +10186,7 @@ const InputDropdown = (props) => {
|
|
|
10205
10186
|
const shouldRenderCounter = multiple && counter !== void 0 && counter !== "0" && !isMinimal;
|
|
10206
10187
|
const { root: rootClassName, label: labelClassName, contentWrapper: contentWrapperClassName, labelDetailsWrapper: labelDetailsWrapperClassName, details: detailsClassName, counter: counterClassName, iconWrapper: iconWrapperClassName, chevronIcon: chevronIconClassName, minimalDetails: minimalDetailsClassName } = classes;
|
|
10207
10188
|
return /* @__PURE__ */ jsxs(StyledInputDropdown, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
10189
|
+
ref,
|
|
10208
10190
|
className: cn(rootClassName, className),
|
|
10209
10191
|
sdsStyle,
|
|
10210
10192
|
"aria-label": "Dropdown input",
|
|
@@ -10269,7 +10251,7 @@ const InputDropdown = (props) => {
|
|
|
10269
10251
|
})
|
|
10270
10252
|
})]
|
|
10271
10253
|
}));
|
|
10272
|
-
};
|
|
10254
|
+
});
|
|
10273
10255
|
function renderLabelText(props) {
|
|
10274
10256
|
const { sdsType } = props;
|
|
10275
10257
|
if (sdsType === "label") return renderLabelTypeLabelText(props);
|
|
@@ -10342,7 +10324,7 @@ const _excluded$30 = [
|
|
|
10342
10324
|
"disabled",
|
|
10343
10325
|
"value",
|
|
10344
10326
|
"onClick"
|
|
10345
|
-
];
|
|
10327
|
+
], _excluded2$4 = ["ref"];
|
|
10346
10328
|
function useDropdownState(propValue, multiple, options) {
|
|
10347
10329
|
const getInitialValue = useCallback(() => {
|
|
10348
10330
|
return multiple ? [] : null;
|
|
@@ -10576,6 +10558,7 @@ const Dropdown = (props) => {
|
|
|
10576
10558
|
countMultiColumnSelections,
|
|
10577
10559
|
getSingleSelectionProps
|
|
10578
10560
|
]);
|
|
10561
|
+
const { ref } = rest, inputRest = _objectWithoutProperties(rest, _excluded2$4);
|
|
10579
10562
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(InputDropdownComponent, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
10580
10563
|
disabled,
|
|
10581
10564
|
label,
|
|
@@ -10583,7 +10566,7 @@ const Dropdown = (props) => {
|
|
|
10583
10566
|
"aria-expanded": open,
|
|
10584
10567
|
"aria-haspopup": "listbox",
|
|
10585
10568
|
multiple: multiple || isMultiColumn
|
|
10586
|
-
}, getInputDropdownProps), InputDropdownProps),
|
|
10569
|
+
}, getInputDropdownProps), InputDropdownProps), inputRest)), /* @__PURE__ */ jsx(DropdownMenu, _objectSpread2(_objectSpread2({
|
|
10587
10570
|
anchorEl,
|
|
10588
10571
|
open,
|
|
10589
10572
|
search,
|
|
@@ -11750,6 +11733,21 @@ const doNotForwardProps$18 = [
|
|
|
11750
11733
|
"backgroundFillColor",
|
|
11751
11734
|
"overlayContentPosition"
|
|
11752
11735
|
];
|
|
11736
|
+
/**
|
|
11737
|
+
* The color the header and the caption are set in.
|
|
11738
|
+
*
|
|
11739
|
+
* `hasInvertTextColor` is for text over a dark backdrop: imagery, or a darkening
|
|
11740
|
+
* mask over it. That backdrop is dark whatever the theme, so the text has to
|
|
11741
|
+
* stay light in both — which is what `textPrimaryOnDark` is for. The theme's
|
|
11742
|
+
* inverse text would follow the theme instead and come out near-black in the
|
|
11743
|
+
* dark theme, over an image that had not changed.
|
|
11744
|
+
*/
|
|
11745
|
+
const getTextColor = (props) => {
|
|
11746
|
+
var _semanticColors$base, _semanticColors$base2;
|
|
11747
|
+
const { hasInvertTextColor } = props;
|
|
11748
|
+
const semanticColors = getSemanticColors(props);
|
|
11749
|
+
return hasInvertTextColor ? semanticColors === null || semanticColors === void 0 || (_semanticColors$base = semanticColors.base) === null || _semanticColors$base === void 0 ? void 0 : _semanticColors$base.textPrimaryOnDark : semanticColors === null || semanticColors === void 0 || (_semanticColors$base2 = semanticColors.base) === null || _semanticColors$base2 === void 0 ? void 0 : _semanticColors$base2.textPrimary;
|
|
11750
|
+
};
|
|
11753
11751
|
const getResponsivePadding = (props) => {
|
|
11754
11752
|
const { overlayContainerMinMargin } = props;
|
|
11755
11753
|
const spaces = getSpaces(props);
|
|
@@ -11778,18 +11776,10 @@ const HeroTitle = /*#__PURE__*/ _styled("h1", { target: "e1wdq27g7" })((props) =
|
|
|
11778
11776
|
if (headerFontSize === "s") return fontHeaderS(props);
|
|
11779
11777
|
else if (headerFontSize === "m") return fontHeaderM(props);
|
|
11780
11778
|
else if (headerFontSize === "l") return fontHeaderL(props);
|
|
11781
|
-
}, " ", (props) =>
|
|
11782
|
-
var _semanticColors$base, _semanticColors$base2;
|
|
11783
|
-
const { hasInvertTextColor } = props;
|
|
11784
|
-
const semanticColors = getSemanticColors(props);
|
|
11785
|
-
return /*#__PURE__*/ css("color:", hasInvertTextColor ? semanticColors === null || semanticColors === void 0 || (_semanticColors$base = semanticColors.base) === null || _semanticColors$base === void 0 ? void 0 : _semanticColors$base.textPrimaryInverse : semanticColors === null || semanticColors === void 0 || (_semanticColors$base2 = semanticColors.base) === null || _semanticColors$base2 === void 0 ? void 0 : _semanticColors$base2.textPrimary, ";");
|
|
11786
|
-
}, " margin:0;padding:0;");
|
|
11779
|
+
}, " ", (props) => /*#__PURE__*/ css("color:", getTextColor(props), ";"), " margin:0;padding:0;");
|
|
11787
11780
|
const HeroCaption = /*#__PURE__*/ _styled("p", { target: "e1wdq27g6" })(fontBodyXxxs, " ", (props) => {
|
|
11788
|
-
var _semanticColors$base3, _semanticColors$base4;
|
|
11789
|
-
const { hasInvertTextColor } = props;
|
|
11790
|
-
const semanticColors = getSemanticColors(props);
|
|
11791
11781
|
const spaces = getSpaces(props);
|
|
11792
|
-
return /*#__PURE__*/ css("color:",
|
|
11782
|
+
return /*#__PURE__*/ css("color:", getTextColor(props), ";margin:", spaces === null || spaces === void 0 ? void 0 : spaces.m, "px 0 0;");
|
|
11793
11783
|
}, " padding:0;");
|
|
11794
11784
|
const ContentSlot = /*#__PURE__*/ _styled("div", { target: "e1wdq27g5" })((props) => {
|
|
11795
11785
|
const spaces = getSpaces(props);
|
|
@@ -16521,27 +16511,47 @@ const NavigationJumpTo = forwardRef((props, ref) => {
|
|
|
16521
16511
|
});
|
|
16522
16512
|
return map;
|
|
16523
16513
|
}, [items, flattenedItems]);
|
|
16524
|
-
const
|
|
16514
|
+
const tabIds = useMemo(() => {
|
|
16515
|
+
const seen = /* @__PURE__ */ new Map();
|
|
16516
|
+
return flattenedItems.map(({ title }) => {
|
|
16517
|
+
var _seen$get;
|
|
16518
|
+
const base = toKebabCase(title);
|
|
16519
|
+
const count = ((_seen$get = seen.get(base)) !== null && _seen$get !== void 0 ? _seen$get : 0) + 1;
|
|
16520
|
+
seen.set(base, count);
|
|
16521
|
+
return count === 1 ? base : `${base}-${count}`;
|
|
16522
|
+
});
|
|
16523
|
+
}, [flattenedItems]);
|
|
16524
|
+
const itemOffsets = useMemo(() => {
|
|
16525
|
+
let offset = 0;
|
|
16526
|
+
return items.map((item) => {
|
|
16527
|
+
var _item$subItems$length, _item$subItems;
|
|
16528
|
+
const start = offset;
|
|
16529
|
+
offset += 1 + ((_item$subItems$length = (_item$subItems = item.subItems) === null || _item$subItems === void 0 ? void 0 : _item$subItems.length) !== null && _item$subItems$length !== void 0 ? _item$subItems$length : 0);
|
|
16530
|
+
return start;
|
|
16531
|
+
});
|
|
16532
|
+
}, [items]);
|
|
16533
|
+
const a11yProps = (tabId, elementId) => {
|
|
16525
16534
|
return {
|
|
16526
16535
|
"aria-controls": elementId,
|
|
16527
|
-
id: `navigation-tab-${
|
|
16536
|
+
id: `navigation-tab-${tabId}`
|
|
16528
16537
|
};
|
|
16529
16538
|
};
|
|
16530
|
-
const createTabsForItem = (item, itemIndex) => {
|
|
16539
|
+
const createTabsForItem = (item, itemIndex, flatIndex) => {
|
|
16531
16540
|
var _item$elementRef$curr;
|
|
16532
16541
|
const tabs = [/* @__PURE__ */ jsx(StyledTab$1, _objectSpread2({
|
|
16533
16542
|
label: item.title,
|
|
16534
16543
|
tabIndex: 0,
|
|
16535
16544
|
width
|
|
16536
|
-
}, a11yProps(
|
|
16545
|
+
}, a11yProps(tabIds[flatIndex], ((_item$elementRef$curr = item.elementRef.current) === null || _item$elementRef$curr === void 0 ? void 0 : _item$elementRef$curr.getAttribute("id")) || `navigation-panel-${itemIndex + 1}`)), tabIds[flatIndex])];
|
|
16537
16546
|
if (item.subItems) item.subItems.forEach((subItem, subIndex) => {
|
|
16538
16547
|
var _subItem$elementRef$c;
|
|
16548
|
+
const subTabId = tabIds[flatIndex + subIndex + 1];
|
|
16539
16549
|
tabs.push(/* @__PURE__ */ jsx(StyledTab$1, _objectSpread2({
|
|
16540
16550
|
label: subItem.title,
|
|
16541
16551
|
tabIndex: 0,
|
|
16542
16552
|
width,
|
|
16543
16553
|
isSubItem: true
|
|
16544
|
-
}, a11yProps(
|
|
16554
|
+
}, a11yProps(subTabId, ((_subItem$elementRef$c = subItem.elementRef.current) === null || _subItem$elementRef$c === void 0 ? void 0 : _subItem$elementRef$c.getAttribute("id")) || `navigation-panel-${itemIndex + 1}-${subIndex + 1}`)), subTabId));
|
|
16545
16555
|
});
|
|
16546
16556
|
return tabs;
|
|
16547
16557
|
};
|
|
@@ -16594,7 +16604,7 @@ const NavigationJumpTo = forwardRef((props, ref) => {
|
|
|
16594
16604
|
onChange: handleChange,
|
|
16595
16605
|
"aria-label": "navigation-jump-to",
|
|
16596
16606
|
width
|
|
16597
|
-
}, rest), {}, { children: items.map((item, itemIndex) => createTabsForItem(item, itemIndex)) }));
|
|
16607
|
+
}, rest), {}, { children: items.map((item, itemIndex) => createTabsForItem(item, itemIndex, itemOffsets[itemIndex])) }));
|
|
16598
16608
|
});
|
|
16599
16609
|
//#endregion
|
|
16600
16610
|
//#region src/core/Notification/style.ts
|
|
@@ -17075,6 +17085,20 @@ const Pagination = forwardRef((props, ref) => {
|
|
|
17075
17085
|
}
|
|
17076
17086
|
});
|
|
17077
17087
|
//#endregion
|
|
17088
|
+
//#region src/core/Panel/Panel.types.ts
|
|
17089
|
+
/**
|
|
17090
|
+
* (masoudmanson): The SDS theme shortens MUI's global transition durations to
|
|
17091
|
+
* 20ms in and 10ms out, which suits small elements but is too brief for a surface
|
|
17092
|
+
* as large as a Panel: it arrives before the eye can follow it in, so it reads as
|
|
17093
|
+
* a jump rather than a slide. The Panel therefore keeps MUI's own drawer timings
|
|
17094
|
+
* instead of the SDS ones. Pass `transitionDuration` to change or remove the
|
|
17095
|
+
* animation, e.g. `transitionDuration={0}` or `{ enter: 300, exit: 200 }`.
|
|
17096
|
+
*/
|
|
17097
|
+
const PANEL_TRANSITION_DURATION_MS = {
|
|
17098
|
+
enter: 225,
|
|
17099
|
+
exit: 195
|
|
17100
|
+
};
|
|
17101
|
+
//#endregion
|
|
17078
17102
|
//#region src/core/Panel/style.ts
|
|
17079
17103
|
const doNotForwardProps$2 = [
|
|
17080
17104
|
"sdsType",
|
|
@@ -17098,7 +17122,7 @@ const overlayPanelStyles = (props) => {
|
|
|
17098
17122
|
const semanticColors = getSemanticColors(props);
|
|
17099
17123
|
const spaces = getSpaces(props);
|
|
17100
17124
|
const shadows = getShadows(props);
|
|
17101
|
-
return /*#__PURE__*/ css("
|
|
17125
|
+
return /*#__PURE__*/ css("pointer-events:none;.", drawerClasses.paper, ",.", backdropClasses.root, "{pointer-events:auto;}.", drawerClasses.paper, "{background-color:", semanticColors === null || semanticColors === void 0 || (_semanticColors$base2 = semanticColors.base) === null || _semanticColors$base2 === void 0 ? void 0 : _semanticColors$base2.backgroundPrimary, ";padding:0 ", spaces === null || spaces === void 0 ? void 0 : spaces.xl, "px ", spaces === null || spaces === void 0 ? void 0 : spaces.xl, "px;min-width:", 320, "px;min-height:", 320, "px;box-shadow:", shadows === null || shadows === void 0 ? void 0 : shadows.l, ";background-image:none;}");
|
|
17102
17126
|
};
|
|
17103
17127
|
const StyledDrawer = /*#__PURE__*/ _styled(Drawer, {
|
|
17104
17128
|
shouldForwardProp: (prop) => !doNotForwardProps$2.includes(prop),
|
|
@@ -17180,7 +17204,8 @@ const _excluded$5 = [
|
|
|
17180
17204
|
"width",
|
|
17181
17205
|
"ModalProps",
|
|
17182
17206
|
"isBackdropClickEnabled",
|
|
17183
|
-
"slotProps"
|
|
17207
|
+
"slotProps",
|
|
17208
|
+
"transitionDuration"
|
|
17184
17209
|
];
|
|
17185
17210
|
function isOverlayPanelProps(props) {
|
|
17186
17211
|
return props.sdsType === "overlay";
|
|
@@ -17193,7 +17218,7 @@ const SLOT_PROPS = {
|
|
|
17193
17218
|
* @see https://mui.com/material-ui/react-drawer/
|
|
17194
17219
|
*/
|
|
17195
17220
|
const Panel = React.forwardRef((props, ref) => {
|
|
17196
|
-
const { children, sdsType = "basic", position = "left", width, ModalProps, isBackdropClickEnabled = false, slotProps: userSlotProps } = props, rest = _objectWithoutProperties(props, _excluded$5);
|
|
17221
|
+
const { children, sdsType = "basic", position = "left", width, ModalProps, isBackdropClickEnabled = false, slotProps: userSlotProps, transitionDuration = PANEL_TRANSITION_DURATION_MS } = props, rest = _objectWithoutProperties(props, _excluded$5);
|
|
17197
17222
|
const mergedSlotProps = _objectSpread2(_objectSpread2(_objectSpread2({}, SLOT_PROPS), userSlotProps), {}, {
|
|
17198
17223
|
backdrop: _objectSpread2(_objectSpread2({}, SLOT_PROPS.backdrop), typeof (userSlotProps === null || userSlotProps === void 0 ? void 0 : userSlotProps.backdrop) === "object" ? userSlotProps.backdrop : {}),
|
|
17199
17224
|
paper: _objectSpread2(_objectSpread2({}, SLOT_PROPS.paper), typeof (userSlotProps === null || userSlotProps === void 0 ? void 0 : userSlotProps.paper) === "object" ? userSlotProps.paper : {})
|
|
@@ -17218,6 +17243,7 @@ const Panel = React.forwardRef((props, ref) => {
|
|
|
17218
17243
|
anchor: drawerAnchor,
|
|
17219
17244
|
variant: drawerVariant,
|
|
17220
17245
|
width: drawerWidth,
|
|
17246
|
+
transitionDuration,
|
|
17221
17247
|
ModalProps: _objectSpread2(_objectSpread2({}, ModalProps), {}, {
|
|
17222
17248
|
disableEnforceFocus: true,
|
|
17223
17249
|
disableScrollLock: true
|
|
@@ -17429,7 +17455,6 @@ const TableRow = forwardRef((props, ref) => {
|
|
|
17429
17455
|
const { children, shouldShowTooltipOnHover = true, tooltipProps, tooltipText = false, tooltipSubtitle, hover = true } = props;
|
|
17430
17456
|
if (shouldShowTooltipOnHover && hover) return /* @__PURE__ */ jsx(Tooltip, _objectSpread2(_objectSpread2({
|
|
17431
17457
|
arrow: true,
|
|
17432
|
-
sdsStyle: "dark",
|
|
17433
17458
|
subtitle: tooltipSubtitle,
|
|
17434
17459
|
title: tooltipText
|
|
17435
17460
|
}, tooltipProps), {}, { children: /* @__PURE__ */ jsx(StyledTableRow, _objectSpread2(_objectSpread2({ ref }, props), {}, { children })) }));
|
|
@@ -18340,7 +18365,8 @@ const Tabs = forwardRef(function Tabs(props, ref) {
|
|
|
18340
18365
|
value: contextValue,
|
|
18341
18366
|
children: /* @__PURE__ */ jsx(StyledTabs, _objectSpread2({
|
|
18342
18367
|
slotProps: { indicator: indicatorProps },
|
|
18343
|
-
ref
|
|
18368
|
+
ref,
|
|
18369
|
+
sdsSize
|
|
18344
18370
|
}, rest))
|
|
18345
18371
|
});
|
|
18346
18372
|
});
|