@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.cjs.js
CHANGED
|
@@ -6316,6 +6316,19 @@ const StyledIcon$2 = /*#__PURE__*/ (0, _emotion_styled_base.default)("div", { ta
|
|
|
6316
6316
|
//#region src/core/Icon/index.tsx
|
|
6317
6317
|
/**
|
|
6318
6318
|
* @see https://mui.com/material-ui/icons/#icons
|
|
6319
|
+
*
|
|
6320
|
+
* @deprecated
|
|
6321
|
+
* This component is deprecated and will be removed in a future major version.
|
|
6322
|
+
* SDS icons come from Phosphor now: import the icon you need from
|
|
6323
|
+
* `@phosphor-icons/react`, or from `@czi-sds/icons` for the icons SDS draws
|
|
6324
|
+
* itself. Both take the same props, so the only difference is the import.
|
|
6325
|
+
*
|
|
6326
|
+
* ```tsx
|
|
6327
|
+
* // Before
|
|
6328
|
+
* <Icon sdsIcon="InfoCircle" sdsSize="l" />
|
|
6329
|
+
* // After
|
|
6330
|
+
* <InfoIcon size={24} />
|
|
6331
|
+
* ```
|
|
6319
6332
|
*/
|
|
6320
6333
|
const Icon = (0, react.forwardRef)(function Icon({ className, color, shade, sdsIcon, sdsSize }, ref) {
|
|
6321
6334
|
var _iconMap$sdsIcon;
|
|
@@ -8240,17 +8253,9 @@ const SDS_WARNINGS = {
|
|
|
8240
8253
|
hasWarned: false,
|
|
8241
8254
|
message: "Warning: MenuSelect will be deprecated and replaced with <DropdownMenu />"
|
|
8242
8255
|
},
|
|
8243
|
-
["tooltipSubtitle"]: {
|
|
8244
|
-
hasWarned: false,
|
|
8245
|
-
message: "Warning: The 'subtitle' text is only available for dark tooltips!"
|
|
8246
|
-
},
|
|
8247
|
-
["tooltipWidth"]: {
|
|
8248
|
-
hasWarned: false,
|
|
8249
|
-
message: "Warning: The 'wide' width is only available for light tooltips!"
|
|
8250
|
-
},
|
|
8251
8256
|
["tooltipInvertStyle"]: {
|
|
8252
8257
|
hasWarned: false,
|
|
8253
|
-
message: "Warning: Tooltips
|
|
8258
|
+
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."
|
|
8254
8259
|
},
|
|
8255
8260
|
["contentCardActionsOnlyButtons"]: {
|
|
8256
8261
|
hasWarned: false,
|
|
@@ -8465,8 +8470,71 @@ const StyledButtonGroup = /*#__PURE__*/ (0, _emotion_styled_base.default)(_mui_m
|
|
|
8465
8470
|
return /*#__PURE__*/ (0, _emotion_react.css)(GeneralButtonGroupStyles(props), " ", sdsType === "primary" && PrimaryButtonGroupStyles(props), " ", sdsType === "secondary" && SecondaryButtonGroupStyles(props), " ", size === "large" && LargeButtonGroupStyles(props), " ", size === "medium" && MediumButtonGroupStyles(props), " ", size === "small" && SmallButtonGroupStyles(props), ";");
|
|
8466
8471
|
}, ";");
|
|
8467
8472
|
//#endregion
|
|
8473
|
+
//#region src/core/ButtonToggle/style.ts
|
|
8474
|
+
/**
|
|
8475
|
+
* (masoudmanson): Since StyledButtonToggle is built on top of Button,
|
|
8476
|
+
* we only need to exclude the `sdsStage` prop from being forwarded,
|
|
8477
|
+
* as it is not a valid prop for Button.
|
|
8478
|
+
* All other props should be passed down to Button; otherwise,
|
|
8479
|
+
* the component won’t function as expected.
|
|
8480
|
+
*/
|
|
8481
|
+
const doNotForwardProps$39 = ["sdsStage"];
|
|
8482
|
+
/**
|
|
8483
|
+
* Utility to select the appropriate color based on background appearance.
|
|
8484
|
+
* Returns the dark variant when backgroundAppearance is "dark", otherwise returns the light variant.
|
|
8485
|
+
*/
|
|
8486
|
+
const getAppearanceColor = (lightColor, darkColor, backgroundAppearance) => {
|
|
8487
|
+
return backgroundAppearance === "dark" ? darkColor : lightColor;
|
|
8488
|
+
};
|
|
8489
|
+
const StageOnStyles = (props) => {
|
|
8490
|
+
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;
|
|
8491
|
+
const { sdsType, sdsStyle, backgroundOnHover, backgroundAppearance = "matchBackground" } = props;
|
|
8492
|
+
const semanticColors = getSemanticColors(props);
|
|
8493
|
+
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);
|
|
8494
|
+
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);
|
|
8495
|
+
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);
|
|
8496
|
+
if (sdsType === "secondary")
|
|
8497
|
+
/**
|
|
8498
|
+
* Specificity boost via Emotion's `&&&&` technique.
|
|
8499
|
+
*
|
|
8500
|
+
* Each `&` repeats the component's generated class, producing a selector
|
|
8501
|
+
* like `.css-abc123.css-abc123.css-abc123.css-abc123`, which has
|
|
8502
|
+
* specificity (0,4,0).
|
|
8503
|
+
*
|
|
8504
|
+
* This is needed because ButtonGroup styles its children with
|
|
8505
|
+
* `&& .MuiButtonGroup-grouped` which has specificity (0,3,0).
|
|
8506
|
+
* Without the boost, the sdsStage="on" styles would always lose
|
|
8507
|
+
* the cascade to the ButtonGroup's parent-level overrides.
|
|
8508
|
+
*/
|
|
8509
|
+
return /*#__PURE__*/ (0, _emotion_react.css)("&&&&{color:", contentColor, ";svg{color:", ornamentColor, ";}&::before{background-color:", sdsStyle === "minimal" && !backgroundOnHover ? "transparent" : backgroundColor, ";}}");
|
|
8510
|
+
return /*#__PURE__*/ (0, _emotion_react.css)("&&&&{background-color:", sdsStyle === "minimal" && !backgroundOnHover ? "transparent" : backgroundColor, ";color:", contentColor, ";svg{color:", ornamentColor, ";}}");
|
|
8511
|
+
};
|
|
8512
|
+
const StyledButtonToggle = /*#__PURE__*/ (0, _emotion_styled_base.default)(Button, {
|
|
8513
|
+
shouldForwardProp: (prop) => !doNotForwardProps$39.includes(prop),
|
|
8514
|
+
target: "euuolxv0"
|
|
8515
|
+
})((props) => {
|
|
8516
|
+
const { sdsStage } = props;
|
|
8517
|
+
if (sdsStage === "on") return StageOnStyles(props);
|
|
8518
|
+
return null;
|
|
8519
|
+
}, ";");
|
|
8520
|
+
//#endregion
|
|
8521
|
+
//#region src/core/ButtonToggle/index.tsx
|
|
8522
|
+
const _excluded$38 = ["startIcon"];
|
|
8523
|
+
/**
|
|
8524
|
+
* @see https://mui.com/material-ui/react-button/
|
|
8525
|
+
*/
|
|
8526
|
+
const ButtonToggle = react.default.forwardRef((props, ref) => {
|
|
8527
|
+
const { startIcon } = props;
|
|
8528
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledButtonToggle, _objectSpread2(_objectSpread2({}, _objectWithoutProperties(props, _excluded$38)), {}, {
|
|
8529
|
+
startIcon,
|
|
8530
|
+
endIcon: null,
|
|
8531
|
+
backgroundOnHover: true,
|
|
8532
|
+
ref
|
|
8533
|
+
}));
|
|
8534
|
+
});
|
|
8535
|
+
//#endregion
|
|
8468
8536
|
//#region src/core/ButtonGroup/index.tsx
|
|
8469
|
-
const _excluded$
|
|
8537
|
+
const _excluded$37 = [
|
|
8470
8538
|
"sdsType",
|
|
8471
8539
|
"size",
|
|
8472
8540
|
"orientation",
|
|
@@ -8495,17 +8563,20 @@ const areAllButtonsIconOnly = (children) => {
|
|
|
8495
8563
|
return childArray.every((child) => isIconOnlyButton(child));
|
|
8496
8564
|
};
|
|
8497
8565
|
/**
|
|
8498
|
-
*
|
|
8566
|
+
* The components a group is made of, and so the ones its size applies to. A
|
|
8567
|
+
* ButtonToggle passes `size` on to the Button underneath it, which is what
|
|
8568
|
+
* keeps a mixed group at one height.
|
|
8499
8569
|
*/
|
|
8500
|
-
const
|
|
8501
|
-
|
|
8570
|
+
const GROUPED_COMPONENTS = [Button, ButtonToggle];
|
|
8571
|
+
const takesGroupSize = (element) => {
|
|
8572
|
+
return GROUPED_COMPONENTS.includes(element.type);
|
|
8502
8573
|
};
|
|
8503
8574
|
/**
|
|
8504
|
-
* Clone children and inject the size prop to
|
|
8575
|
+
* Clone children and inject the size prop to the buttons in the group.
|
|
8505
8576
|
*/
|
|
8506
8577
|
const cloneChildrenWithSize = (children, size) => {
|
|
8507
8578
|
return react.Children.map(children, (child) => {
|
|
8508
|
-
if ((0, react.isValidElement)(child) &&
|
|
8579
|
+
if ((0, react.isValidElement)(child) && takesGroupSize(child)) return (0, react.cloneElement)(child, { size });
|
|
8509
8580
|
return child;
|
|
8510
8581
|
});
|
|
8511
8582
|
};
|
|
@@ -8518,7 +8589,7 @@ const cloneChildrenWithSize = (children, size) => {
|
|
|
8518
8589
|
* Note: Vertical orientation is only available when all buttons are icon-only.
|
|
8519
8590
|
*/
|
|
8520
8591
|
const ButtonGroup = react.default.forwardRef((props, ref) => {
|
|
8521
|
-
const { sdsType = "primary", size = "large", orientation = "horizontal", children } = props, rest = _objectWithoutProperties(props, _excluded$
|
|
8592
|
+
const { sdsType = "primary", size = "large", orientation = "horizontal", children } = props, rest = _objectWithoutProperties(props, _excluded$37);
|
|
8522
8593
|
const allIconOnly = areAllButtonsIconOnly(children);
|
|
8523
8594
|
const effectiveOrientation = allIconOnly ? orientation : "horizontal";
|
|
8524
8595
|
if (orientation === "vertical" && !allIconOnly) showWarningIfFirstOccurence("ButtonGroupVerticalOrientation");
|
|
@@ -8571,7 +8642,7 @@ const large = (props) => {
|
|
|
8571
8642
|
const spaces = getSpaces(props);
|
|
8572
8643
|
return /*#__PURE__*/ (0, _emotion_react.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;` : "", ";}");
|
|
8573
8644
|
};
|
|
8574
|
-
const doNotForwardProps$
|
|
8645
|
+
const doNotForwardProps$38 = [
|
|
8575
8646
|
"on",
|
|
8576
8647
|
"sdsSize",
|
|
8577
8648
|
"sdsType",
|
|
@@ -8581,7 +8652,7 @@ const doNotForwardProps$39 = [
|
|
|
8581
8652
|
"customTheme"
|
|
8582
8653
|
];
|
|
8583
8654
|
const StyledButtonIcon = /*#__PURE__*/ (0, _emotion_styled_base.default)(_mui_material.IconButton, {
|
|
8584
|
-
shouldForwardProp: (prop) => !doNotForwardProps$
|
|
8655
|
+
shouldForwardProp: (prop) => !doNotForwardProps$38.includes(prop),
|
|
8585
8656
|
target: "e164i6480"
|
|
8586
8657
|
})("padding:0;", focusVisibleA11yStyle, " ", (props) => {
|
|
8587
8658
|
const { disabled, sdsSize = "medium", sdsType = "primary" } = props;
|
|
@@ -8627,68 +8698,6 @@ const ButtonIcon = (0, react.forwardRef)(function ButtonIcon(props, ref) {
|
|
|
8627
8698
|
}));
|
|
8628
8699
|
});
|
|
8629
8700
|
//#endregion
|
|
8630
|
-
//#region src/core/ButtonToggle/style.ts
|
|
8631
|
-
/**
|
|
8632
|
-
* (masoudmanson): Since StyledButtonToggle is built on top of Button,
|
|
8633
|
-
* we only need to exclude the `sdsStage` prop from being forwarded,
|
|
8634
|
-
* as it is not a valid prop for Button.
|
|
8635
|
-
* All other props should be passed down to Button; otherwise,
|
|
8636
|
-
* the component won’t function as expected.
|
|
8637
|
-
*/
|
|
8638
|
-
const doNotForwardProps$38 = ["sdsStage"];
|
|
8639
|
-
/**
|
|
8640
|
-
* Utility to select the appropriate color based on background appearance.
|
|
8641
|
-
* Returns the dark variant when backgroundAppearance is "dark", otherwise returns the light variant.
|
|
8642
|
-
*/
|
|
8643
|
-
const getAppearanceColor = (lightColor, darkColor, backgroundAppearance) => {
|
|
8644
|
-
return backgroundAppearance === "dark" ? darkColor : lightColor;
|
|
8645
|
-
};
|
|
8646
|
-
const StageOnStyles = (props) => {
|
|
8647
|
-
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;
|
|
8648
|
-
const { sdsType, sdsStyle, backgroundOnHover, backgroundAppearance = "matchBackground" } = props;
|
|
8649
|
-
const semanticColors = getSemanticColors(props);
|
|
8650
|
-
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);
|
|
8651
|
-
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);
|
|
8652
|
-
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);
|
|
8653
|
-
if (sdsType === "secondary")
|
|
8654
|
-
/**
|
|
8655
|
-
* Specificity boost via Emotion's `&&&&` technique.
|
|
8656
|
-
*
|
|
8657
|
-
* Each `&` repeats the component's generated class, producing a selector
|
|
8658
|
-
* like `.css-abc123.css-abc123.css-abc123.css-abc123` — specificity (0,4,0).
|
|
8659
|
-
*
|
|
8660
|
-
* This is needed because ButtonGroup styles its children with
|
|
8661
|
-
* `&& .MuiButtonGroup-grouped` which has specificity (0,3,0).
|
|
8662
|
-
* Without the boost, the sdsStage="on" styles would always lose
|
|
8663
|
-
* the cascade to the ButtonGroup's parent-level overrides.
|
|
8664
|
-
*/
|
|
8665
|
-
return /*#__PURE__*/ (0, _emotion_react.css)("&&&&{color:", contentColor, ";svg{color:", ornamentColor, ";}&::before{background-color:", sdsStyle === "minimal" && !backgroundOnHover ? "transparent" : backgroundColor, ";}}");
|
|
8666
|
-
return /*#__PURE__*/ (0, _emotion_react.css)("&&&&{background-color:", sdsStyle === "minimal" && !backgroundOnHover ? "transparent" : backgroundColor, ";color:", contentColor, ";svg{color:", ornamentColor, ";}}");
|
|
8667
|
-
};
|
|
8668
|
-
const StyledButtonToggle = /*#__PURE__*/ (0, _emotion_styled_base.default)(Button, {
|
|
8669
|
-
shouldForwardProp: (prop) => !doNotForwardProps$38.includes(prop),
|
|
8670
|
-
target: "euuolxv0"
|
|
8671
|
-
})((props) => {
|
|
8672
|
-
const { sdsStage } = props;
|
|
8673
|
-
if (sdsStage === "on") return StageOnStyles(props);
|
|
8674
|
-
return null;
|
|
8675
|
-
}, ";");
|
|
8676
|
-
//#endregion
|
|
8677
|
-
//#region src/core/ButtonToggle/index.tsx
|
|
8678
|
-
const _excluded$37 = ["startIcon"];
|
|
8679
|
-
/**
|
|
8680
|
-
* @see https://mui.com/material-ui/react-button/
|
|
8681
|
-
*/
|
|
8682
|
-
const ButtonToggle = react.default.forwardRef((props, ref) => {
|
|
8683
|
-
const { startIcon } = props;
|
|
8684
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledButtonToggle, _objectSpread2(_objectSpread2({}, _objectWithoutProperties(props, _excluded$37)), {}, {
|
|
8685
|
-
startIcon,
|
|
8686
|
-
endIcon: null,
|
|
8687
|
-
backgroundOnHover: true,
|
|
8688
|
-
ref
|
|
8689
|
-
}));
|
|
8690
|
-
});
|
|
8691
|
-
//#endregion
|
|
8692
8701
|
//#region src/core/ButtonLegacy/style.ts
|
|
8693
8702
|
const doNotForwardProps$37 = [
|
|
8694
8703
|
"isAllCaps",
|
|
@@ -9035,7 +9044,8 @@ const _excluded$35 = [
|
|
|
9035
9044
|
"hideTitle",
|
|
9036
9045
|
"hideBody",
|
|
9037
9046
|
"sdsStyle",
|
|
9038
|
-
"children"
|
|
9047
|
+
"children",
|
|
9048
|
+
"extraContent"
|
|
9039
9049
|
];
|
|
9040
9050
|
const SDS_STAGE_OPEN = "open";
|
|
9041
9051
|
const SDS_STAGE_CLOSED = "closed";
|
|
@@ -9043,7 +9053,7 @@ const SDS_STAGE_CLOSED = "closed";
|
|
|
9043
9053
|
* @see https://mui.com/material-ui/react-alert/
|
|
9044
9054
|
*/
|
|
9045
9055
|
const Callout = (props) => {
|
|
9046
|
-
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);
|
|
9056
|
+
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);
|
|
9047
9057
|
const [hide, setHide] = (0, react.useState)(dismissed);
|
|
9048
9058
|
const [stage, setStage] = (0, react.useState)(sdsStage);
|
|
9049
9059
|
(0, react.useEffect)(() => {
|
|
@@ -9123,70 +9133,62 @@ const Callout = (props) => {
|
|
|
9123
9133
|
hideTitle,
|
|
9124
9134
|
children: body
|
|
9125
9135
|
}),
|
|
9126
|
-
sdsStyle === "expandable" && !collapsed && /* @__PURE__ */ (0, react_jsx_runtime.
|
|
9136
|
+
sdsStyle === "expandable" && !collapsed && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CalloutExtraContent, {
|
|
9127
9137
|
hideTitle,
|
|
9128
9138
|
hideBody,
|
|
9129
|
-
children
|
|
9139
|
+
children: [children, extraContent]
|
|
9130
9140
|
})
|
|
9131
9141
|
] }))
|
|
9132
9142
|
});
|
|
9133
9143
|
};
|
|
9134
9144
|
//#endregion
|
|
9135
9145
|
//#region src/core/Tooltip/style.ts
|
|
9136
|
-
const
|
|
9146
|
+
const surface = (props) => {
|
|
9137
9147
|
var _semanticColors$base, _semanticColors$base2;
|
|
9138
9148
|
const spaces = getSpaces(props);
|
|
9139
9149
|
const semanticColors = getSemanticColors(props);
|
|
9140
|
-
return /*#__PURE__*/ (0, _emotion_css.css)(
|
|
9141
|
-
};
|
|
9142
|
-
const light = (props) => {
|
|
9143
|
-
var _semanticColors$base3, _semanticColors$base4;
|
|
9144
|
-
const spaces = getSpaces(props);
|
|
9145
|
-
const semanticColors = getSemanticColors(props);
|
|
9146
|
-
return /*#__PURE__*/ (0, _emotion_css.css)(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;");
|
|
9150
|
+
return /*#__PURE__*/ (0, _emotion_css.css)(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;");
|
|
9147
9151
|
};
|
|
9148
9152
|
const tableStyles = (props) => {
|
|
9149
9153
|
const spaces = getSpaces(props);
|
|
9150
9154
|
return /*#__PURE__*/ (0, _emotion_css.css)("padding:", spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;");
|
|
9151
9155
|
};
|
|
9152
|
-
const doNotForwardProps$34 = ["
|
|
9156
|
+
const doNotForwardProps$34 = ["textAlign"];
|
|
9153
9157
|
const StyledTitle = /*#__PURE__*/ (0, _emotion_styled_base.default)("p", {
|
|
9154
9158
|
shouldForwardProp: (prop) => !doNotForwardProps$34.includes(prop),
|
|
9155
9159
|
target: "e1j7jeiz3"
|
|
9156
9160
|
})(fontBodyMediumXs, " ", (props) => {
|
|
9157
|
-
var _semanticColors$
|
|
9158
|
-
const { hasInvertedStyle } = props;
|
|
9161
|
+
var _semanticColors$base3;
|
|
9159
9162
|
const semanticColors = getSemanticColors(props);
|
|
9160
9163
|
return `
|
|
9161
9164
|
margin: 0;
|
|
9162
|
-
color: ${
|
|
9165
|
+
color: ${semanticColors === null || semanticColors === void 0 || (_semanticColors$base3 = semanticColors.base) === null || _semanticColors$base3 === void 0 ? void 0 : _semanticColors$base3.textPrimary};
|
|
9163
9166
|
`;
|
|
9164
9167
|
}, ";");
|
|
9165
9168
|
const StyledSubtitle = /*#__PURE__*/ (0, _emotion_styled_base.default)("p", {
|
|
9166
9169
|
shouldForwardProp: (prop) => !doNotForwardProps$34.includes(prop),
|
|
9167
9170
|
target: "e1j7jeiz2"
|
|
9168
9171
|
})(fontBodyXxs, " ", (props) => {
|
|
9169
|
-
var _semanticColors$
|
|
9170
|
-
const { hasInvertedStyle } = props;
|
|
9172
|
+
var _semanticColors$base4;
|
|
9171
9173
|
const semanticColors = getSemanticColors(props);
|
|
9172
9174
|
return `
|
|
9173
9175
|
margin: 0;
|
|
9174
|
-
color: ${
|
|
9176
|
+
color: ${semanticColors === null || semanticColors === void 0 || (_semanticColors$base4 = semanticColors.base) === null || _semanticColors$base4 === void 0 ? void 0 : _semanticColors$base4.textSecondary};
|
|
9175
9177
|
`;
|
|
9176
9178
|
}, ";");
|
|
9177
9179
|
const tooltipCss = (props) => {
|
|
9178
|
-
var _semanticColors$
|
|
9179
|
-
const {
|
|
9180
|
+
var _semanticColors$base5;
|
|
9181
|
+
const { width, followCursor, textAlign } = props;
|
|
9180
9182
|
const shadows = getShadows(props);
|
|
9181
9183
|
const corners = getCorners(props);
|
|
9182
9184
|
const semanticColors = getSemanticColors(props);
|
|
9183
|
-
return /*#__PURE__*/ (0, _emotion_css.css)("&.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;
|
|
9185
|
+
return /*#__PURE__*/ (0, _emotion_css.css)("&.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), ";}");
|
|
9184
9186
|
};
|
|
9185
9187
|
const arrowCss = (props) => {
|
|
9186
|
-
var _semanticColors$
|
|
9187
|
-
const {
|
|
9188
|
+
var _semanticColors$base6;
|
|
9189
|
+
const { arrowOffset } = props;
|
|
9188
9190
|
const semanticColors = getSemanticColors(props);
|
|
9189
|
-
return /*#__PURE__*/ (0, _emotion_css.css)("&.MuiTooltip-arrow{", arrowOffset !== void 0 ? `left: ${arrowOffset}px !important;` : "", " color:",
|
|
9191
|
+
return /*#__PURE__*/ (0, _emotion_css.css)("&.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;}}");
|
|
9190
9192
|
};
|
|
9191
9193
|
const StyledPopper$2 = /*#__PURE__*/ (0, _emotion_styled_base.default)(_mui_material.Popper, { target: "e1j7jeiz1" })("z-index:", (props) => {
|
|
9192
9194
|
var _props$theme$zIndex$t, _props$theme;
|
|
@@ -9222,17 +9224,14 @@ const _excluded$34 = [
|
|
|
9222
9224
|
* https://mui.com/components/tooltips/#disabled-elements
|
|
9223
9225
|
*/
|
|
9224
9226
|
const Tooltip = (0, react.forwardRef)(function Tooltip(props, ref) {
|
|
9225
|
-
const { arrowOffset, classes, hasInvertedStyle
|
|
9227
|
+
const { arrowOffset, classes, hasInvertedStyle, inverted, sdsStyle, subtitle, title, width = "default", PopperComponent = StyledPopper$2, textAlign, componentSlot } = props, rest = _objectWithoutProperties(props, _excluded$34);
|
|
9226
9228
|
const { children } = rest;
|
|
9227
|
-
if (inverted || sdsStyle) showWarningIfFirstOccurence("tooltipInvertStyle");
|
|
9228
|
-
if (width === "wide" && (sdsStyle === "dark" || hasInvertedStyle)) showWarningIfFirstOccurence("tooltipWidth");
|
|
9229
|
-
const theme = (0, _mui_material.useTheme)();
|
|
9229
|
+
if (hasInvertedStyle !== void 0 || inverted !== void 0 || sdsStyle !== void 0) showWarningIfFirstOccurence("tooltipInvertStyle");
|
|
9230
9230
|
const extraProps = {
|
|
9231
9231
|
arrowOffset,
|
|
9232
9232
|
classes,
|
|
9233
|
-
hasInvertedStyle: invertStyleValue(inverted, sdsStyle, hasInvertedStyle),
|
|
9234
9233
|
textAlign,
|
|
9235
|
-
theme,
|
|
9234
|
+
theme: (0, _mui_material.useTheme)(),
|
|
9236
9235
|
width
|
|
9237
9236
|
};
|
|
9238
9237
|
const tooltip = mergeClass$1({
|
|
@@ -9251,16 +9250,9 @@ const Tooltip = (0, react.forwardRef)(function Tooltip(props, ref) {
|
|
|
9251
9250
|
arrow,
|
|
9252
9251
|
tooltip
|
|
9253
9252
|
},
|
|
9254
|
-
leaveDelay: hasInvertedStyle || inverted || sdsStyle === "dark" ? 0 : 500,
|
|
9255
9253
|
title: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
9256
|
-
title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTitle, {
|
|
9257
|
-
|
|
9258
|
-
children: title
|
|
9259
|
-
}),
|
|
9260
|
-
subtitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledSubtitle, {
|
|
9261
|
-
hasInvertedStyle,
|
|
9262
|
-
children: subtitle
|
|
9263
|
-
}),
|
|
9254
|
+
title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTitle, { children: title }),
|
|
9255
|
+
subtitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledSubtitle, { children: subtitle }),
|
|
9264
9256
|
componentSlot && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledComponentSlotWrapper, {
|
|
9265
9257
|
shouldAddMargin: !!title || !!subtitle,
|
|
9266
9258
|
children: componentSlot
|
|
@@ -9271,15 +9263,6 @@ const Tooltip = (0, react.forwardRef)(function Tooltip(props, ref) {
|
|
|
9271
9263
|
arrow: true
|
|
9272
9264
|
}, rest), {}, { slots: { popper: PopperComponent } }));
|
|
9273
9265
|
});
|
|
9274
|
-
/**
|
|
9275
|
-
* (masoudmanson): Temporary function to handle the inversion of the tooltip
|
|
9276
|
-
* based on the sdsStyle, invert and hasInvertedStyle props.
|
|
9277
|
-
* Once the sdsStyle and invert props are completely removed,
|
|
9278
|
-
* this function will be removed as well.
|
|
9279
|
-
*/
|
|
9280
|
-
function invertStyleValue(inverted, sdsStyle, hasInvertedStyle) {
|
|
9281
|
-
return hasInvertedStyle !== void 0 ? hasInvertedStyle : sdsStyle === "dark" ? true : sdsStyle === "light" ? false : inverted;
|
|
9282
|
-
}
|
|
9283
9266
|
function mergeClass$1({ props, className, key }) {
|
|
9284
9267
|
const { classes } = props;
|
|
9285
9268
|
if (!classes) return className;
|
|
@@ -9510,8 +9493,7 @@ const CellBasic = (0, react.forwardRef)((props, ref) => {
|
|
|
9510
9493
|
subtitle: secondaryText,
|
|
9511
9494
|
arrow: true,
|
|
9512
9495
|
leaveDelay: 0,
|
|
9513
|
-
leaveTouchDelay: 0
|
|
9514
|
-
sdsStyle: "dark"
|
|
9496
|
+
leaveTouchDelay: 0
|
|
9515
9497
|
}, tooltipProps), {}, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTableData, _objectSpread2(_objectSpread2({
|
|
9516
9498
|
ref,
|
|
9517
9499
|
as
|
|
@@ -9682,7 +9664,6 @@ const CellHeader = (0, react.forwardRef)((props, ref) => {
|
|
|
9682
9664
|
if (shouldShowTooltipOnHover && hover) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tooltip, _objectSpread2(_objectSpread2({
|
|
9683
9665
|
arrow: true,
|
|
9684
9666
|
placement: "top-start",
|
|
9685
|
-
sdsStyle: "dark",
|
|
9686
9667
|
subtitle: tooltipSubtitle,
|
|
9687
9668
|
title: tooltipText
|
|
9688
9669
|
}, tooltipProps), {}, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTableHeader$1, _objectSpread2(_objectSpread2({
|
|
@@ -10073,10 +10054,10 @@ const labelFontBodyS = fontBody("s", "regular");
|
|
|
10073
10054
|
const labelFontBodyXs = fontBody("xs", "regular");
|
|
10074
10055
|
const inputDropdownStyles = (props) => {
|
|
10075
10056
|
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;
|
|
10076
|
-
const { width
|
|
10057
|
+
const { width } = props;
|
|
10077
10058
|
const spaces = getSpaces(props);
|
|
10078
10059
|
const semanticColors = getSemanticColors(props);
|
|
10079
|
-
return /*#__PURE__*/ (0, _emotion_react.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;
|
|
10060
|
+
return /*#__PURE__*/ (0, _emotion_react.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;}");
|
|
10080
10061
|
};
|
|
10081
10062
|
const minimal$1 = (props) => {
|
|
10082
10063
|
var _semanticColors$base12, _semanticColors$base13, _semanticColors$base14, _semanticColors$base15, _semanticColors$base16, _semanticColors$base17, _semanticColors$base18;
|
|
@@ -10250,7 +10231,7 @@ const validateSdsStyle = (sdsStyle) => {
|
|
|
10250
10231
|
/**
|
|
10251
10232
|
* @see https://mui.com/material-ui/react-button/
|
|
10252
10233
|
*/
|
|
10253
|
-
const InputDropdown = (props)
|
|
10234
|
+
const InputDropdown = (0, react.forwardRef)(function InputDropdown(props, ref) {
|
|
10254
10235
|
const { label, multiple = false, sdsStyle: rawSdsStyle = "square", sdsType = "label", details, counter, shouldTruncateMinimalDetails, shouldPutAColonAfterLabel = true, value, classes = EMPTY_OBJECT, className } = props;
|
|
10255
10236
|
const sdsStyle = validateSdsStyle(rawSdsStyle);
|
|
10256
10237
|
const isMinimal = sdsStyle === "minimal";
|
|
@@ -10260,6 +10241,7 @@ const InputDropdown = (props) => {
|
|
|
10260
10241
|
const shouldRenderCounter = multiple && counter !== void 0 && counter !== "0" && !isMinimal;
|
|
10261
10242
|
const { root: rootClassName, label: labelClassName, contentWrapper: contentWrapperClassName, labelDetailsWrapper: labelDetailsWrapperClassName, details: detailsClassName, counter: counterClassName, iconWrapper: iconWrapperClassName, chevronIcon: chevronIconClassName, minimalDetails: minimalDetailsClassName } = classes;
|
|
10262
10243
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledInputDropdown, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
10244
|
+
ref,
|
|
10263
10245
|
className: cn(rootClassName, className),
|
|
10264
10246
|
sdsStyle,
|
|
10265
10247
|
"aria-label": "Dropdown input",
|
|
@@ -10324,7 +10306,7 @@ const InputDropdown = (props) => {
|
|
|
10324
10306
|
})
|
|
10325
10307
|
})]
|
|
10326
10308
|
}));
|
|
10327
|
-
};
|
|
10309
|
+
});
|
|
10328
10310
|
function renderLabelText(props) {
|
|
10329
10311
|
const { sdsType } = props;
|
|
10330
10312
|
if (sdsType === "label") return renderLabelTypeLabelText(props);
|
|
@@ -10397,7 +10379,7 @@ const _excluded$30 = [
|
|
|
10397
10379
|
"disabled",
|
|
10398
10380
|
"value",
|
|
10399
10381
|
"onClick"
|
|
10400
|
-
];
|
|
10382
|
+
], _excluded2$4 = ["ref"];
|
|
10401
10383
|
function useDropdownState(propValue, multiple, options) {
|
|
10402
10384
|
const getInitialValue = (0, react.useCallback)(() => {
|
|
10403
10385
|
return multiple ? [] : null;
|
|
@@ -10631,6 +10613,7 @@ const Dropdown = (props) => {
|
|
|
10631
10613
|
countMultiColumnSelections,
|
|
10632
10614
|
getSingleSelectionProps
|
|
10633
10615
|
]);
|
|
10616
|
+
const { ref } = rest, inputRest = _objectWithoutProperties(rest, _excluded2$4);
|
|
10634
10617
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(InputDropdownComponent, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
10635
10618
|
disabled,
|
|
10636
10619
|
label,
|
|
@@ -10638,7 +10621,7 @@ const Dropdown = (props) => {
|
|
|
10638
10621
|
"aria-expanded": open,
|
|
10639
10622
|
"aria-haspopup": "listbox",
|
|
10640
10623
|
multiple: multiple || isMultiColumn
|
|
10641
|
-
}, getInputDropdownProps), InputDropdownProps),
|
|
10624
|
+
}, getInputDropdownProps), InputDropdownProps), inputRest)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DropdownMenu, _objectSpread2(_objectSpread2({
|
|
10642
10625
|
anchorEl,
|
|
10643
10626
|
open,
|
|
10644
10627
|
search,
|
|
@@ -11811,6 +11794,21 @@ const doNotForwardProps$18 = [
|
|
|
11811
11794
|
"backgroundFillColor",
|
|
11812
11795
|
"overlayContentPosition"
|
|
11813
11796
|
];
|
|
11797
|
+
/**
|
|
11798
|
+
* The color the header and the caption are set in.
|
|
11799
|
+
*
|
|
11800
|
+
* `hasInvertTextColor` is for text over a dark backdrop: imagery, or a darkening
|
|
11801
|
+
* mask over it. That backdrop is dark whatever the theme, so the text has to
|
|
11802
|
+
* stay light in both — which is what `textPrimaryOnDark` is for. The theme's
|
|
11803
|
+
* inverse text would follow the theme instead and come out near-black in the
|
|
11804
|
+
* dark theme, over an image that had not changed.
|
|
11805
|
+
*/
|
|
11806
|
+
const getTextColor = (props) => {
|
|
11807
|
+
var _semanticColors$base, _semanticColors$base2;
|
|
11808
|
+
const { hasInvertTextColor } = props;
|
|
11809
|
+
const semanticColors = getSemanticColors(props);
|
|
11810
|
+
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;
|
|
11811
|
+
};
|
|
11814
11812
|
const getResponsivePadding = (props) => {
|
|
11815
11813
|
const { overlayContainerMinMargin } = props;
|
|
11816
11814
|
const spaces = getSpaces(props);
|
|
@@ -11842,18 +11840,10 @@ const HeroTitle = /*#__PURE__*/ (0, _emotion_styled_base.default)("h1", { target
|
|
|
11842
11840
|
if (headerFontSize === "s") return fontHeaderS(props);
|
|
11843
11841
|
else if (headerFontSize === "m") return fontHeaderM(props);
|
|
11844
11842
|
else if (headerFontSize === "l") return fontHeaderL(props);
|
|
11845
|
-
}, " ", (props) =>
|
|
11846
|
-
var _semanticColors$base, _semanticColors$base2;
|
|
11847
|
-
const { hasInvertTextColor } = props;
|
|
11848
|
-
const semanticColors = getSemanticColors(props);
|
|
11849
|
-
return /*#__PURE__*/ (0, _emotion_react.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, ";");
|
|
11850
|
-
}, " margin:0;padding:0;");
|
|
11843
|
+
}, " ", (props) => /*#__PURE__*/ (0, _emotion_react.css)("color:", getTextColor(props), ";"), " margin:0;padding:0;");
|
|
11851
11844
|
const HeroCaption = /*#__PURE__*/ (0, _emotion_styled_base.default)("p", { target: "e1wdq27g6" })(fontBodyXxxs, " ", (props) => {
|
|
11852
|
-
var _semanticColors$base3, _semanticColors$base4;
|
|
11853
|
-
const { hasInvertTextColor } = props;
|
|
11854
|
-
const semanticColors = getSemanticColors(props);
|
|
11855
11845
|
const spaces = getSpaces(props);
|
|
11856
|
-
return /*#__PURE__*/ (0, _emotion_react.css)("color:",
|
|
11846
|
+
return /*#__PURE__*/ (0, _emotion_react.css)("color:", getTextColor(props), ";margin:", spaces === null || spaces === void 0 ? void 0 : spaces.m, "px 0 0;");
|
|
11857
11847
|
}, " padding:0;");
|
|
11858
11848
|
const ContentSlot = /*#__PURE__*/ (0, _emotion_styled_base.default)("div", { target: "e1wdq27g5" })((props) => {
|
|
11859
11849
|
const spaces = getSpaces(props);
|
|
@@ -16632,27 +16622,47 @@ const NavigationJumpTo = (0, react.forwardRef)((props, ref) => {
|
|
|
16632
16622
|
});
|
|
16633
16623
|
return map;
|
|
16634
16624
|
}, [items, flattenedItems]);
|
|
16635
|
-
const
|
|
16625
|
+
const tabIds = (0, react.useMemo)(() => {
|
|
16626
|
+
const seen = /* @__PURE__ */ new Map();
|
|
16627
|
+
return flattenedItems.map(({ title }) => {
|
|
16628
|
+
var _seen$get;
|
|
16629
|
+
const base = toKebabCase(title);
|
|
16630
|
+
const count = ((_seen$get = seen.get(base)) !== null && _seen$get !== void 0 ? _seen$get : 0) + 1;
|
|
16631
|
+
seen.set(base, count);
|
|
16632
|
+
return count === 1 ? base : `${base}-${count}`;
|
|
16633
|
+
});
|
|
16634
|
+
}, [flattenedItems]);
|
|
16635
|
+
const itemOffsets = (0, react.useMemo)(() => {
|
|
16636
|
+
let offset = 0;
|
|
16637
|
+
return items.map((item) => {
|
|
16638
|
+
var _item$subItems$length, _item$subItems;
|
|
16639
|
+
const start = offset;
|
|
16640
|
+
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);
|
|
16641
|
+
return start;
|
|
16642
|
+
});
|
|
16643
|
+
}, [items]);
|
|
16644
|
+
const a11yProps = (tabId, elementId) => {
|
|
16636
16645
|
return {
|
|
16637
16646
|
"aria-controls": elementId,
|
|
16638
|
-
id: `navigation-tab-${
|
|
16647
|
+
id: `navigation-tab-${tabId}`
|
|
16639
16648
|
};
|
|
16640
16649
|
};
|
|
16641
|
-
const createTabsForItem = (item, itemIndex) => {
|
|
16650
|
+
const createTabsForItem = (item, itemIndex, flatIndex) => {
|
|
16642
16651
|
var _item$elementRef$curr;
|
|
16643
16652
|
const tabs = [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTab$1, _objectSpread2({
|
|
16644
16653
|
label: item.title,
|
|
16645
16654
|
tabIndex: 0,
|
|
16646
16655
|
width
|
|
16647
|
-
}, a11yProps(
|
|
16656
|
+
}, 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])];
|
|
16648
16657
|
if (item.subItems) item.subItems.forEach((subItem, subIndex) => {
|
|
16649
16658
|
var _subItem$elementRef$c;
|
|
16659
|
+
const subTabId = tabIds[flatIndex + subIndex + 1];
|
|
16650
16660
|
tabs.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTab$1, _objectSpread2({
|
|
16651
16661
|
label: subItem.title,
|
|
16652
16662
|
tabIndex: 0,
|
|
16653
16663
|
width,
|
|
16654
16664
|
isSubItem: true
|
|
16655
|
-
}, a11yProps(
|
|
16665
|
+
}, 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));
|
|
16656
16666
|
});
|
|
16657
16667
|
return tabs;
|
|
16658
16668
|
};
|
|
@@ -16705,7 +16715,7 @@ const NavigationJumpTo = (0, react.forwardRef)((props, ref) => {
|
|
|
16705
16715
|
onChange: handleChange,
|
|
16706
16716
|
"aria-label": "navigation-jump-to",
|
|
16707
16717
|
width
|
|
16708
|
-
}, rest), {}, { children: items.map((item, itemIndex) => createTabsForItem(item, itemIndex)) }));
|
|
16718
|
+
}, rest), {}, { children: items.map((item, itemIndex) => createTabsForItem(item, itemIndex, itemOffsets[itemIndex])) }));
|
|
16709
16719
|
});
|
|
16710
16720
|
//#endregion
|
|
16711
16721
|
//#region src/core/Notification/style.ts
|
|
@@ -17192,6 +17202,20 @@ const Pagination = (0, react.forwardRef)((props, ref) => {
|
|
|
17192
17202
|
}
|
|
17193
17203
|
});
|
|
17194
17204
|
//#endregion
|
|
17205
|
+
//#region src/core/Panel/Panel.types.ts
|
|
17206
|
+
/**
|
|
17207
|
+
* (masoudmanson): The SDS theme shortens MUI's global transition durations to
|
|
17208
|
+
* 20ms in and 10ms out, which suits small elements but is too brief for a surface
|
|
17209
|
+
* as large as a Panel: it arrives before the eye can follow it in, so it reads as
|
|
17210
|
+
* a jump rather than a slide. The Panel therefore keeps MUI's own drawer timings
|
|
17211
|
+
* instead of the SDS ones. Pass `transitionDuration` to change or remove the
|
|
17212
|
+
* animation, e.g. `transitionDuration={0}` or `{ enter: 300, exit: 200 }`.
|
|
17213
|
+
*/
|
|
17214
|
+
const PANEL_TRANSITION_DURATION_MS = {
|
|
17215
|
+
enter: 225,
|
|
17216
|
+
exit: 195
|
|
17217
|
+
};
|
|
17218
|
+
//#endregion
|
|
17195
17219
|
//#region src/core/Panel/style.ts
|
|
17196
17220
|
const doNotForwardProps$2 = [
|
|
17197
17221
|
"sdsType",
|
|
@@ -17215,7 +17239,7 @@ const overlayPanelStyles = (props) => {
|
|
|
17215
17239
|
const semanticColors = getSemanticColors(props);
|
|
17216
17240
|
const spaces = getSpaces(props);
|
|
17217
17241
|
const shadows = getShadows(props);
|
|
17218
|
-
return /*#__PURE__*/ (0, _emotion_react.css)("
|
|
17242
|
+
return /*#__PURE__*/ (0, _emotion_react.css)("pointer-events:none;.", _mui_material.drawerClasses.paper, ",.", _mui_material.backdropClasses.root, "{pointer-events:auto;}.", _mui_material.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;}");
|
|
17219
17243
|
};
|
|
17220
17244
|
const StyledDrawer = /*#__PURE__*/ (0, _emotion_styled_base.default)(_mui_material.Drawer, {
|
|
17221
17245
|
shouldForwardProp: (prop) => !doNotForwardProps$2.includes(prop),
|
|
@@ -17297,7 +17321,8 @@ const _excluded$5 = [
|
|
|
17297
17321
|
"width",
|
|
17298
17322
|
"ModalProps",
|
|
17299
17323
|
"isBackdropClickEnabled",
|
|
17300
|
-
"slotProps"
|
|
17324
|
+
"slotProps",
|
|
17325
|
+
"transitionDuration"
|
|
17301
17326
|
];
|
|
17302
17327
|
function isOverlayPanelProps(props) {
|
|
17303
17328
|
return props.sdsType === "overlay";
|
|
@@ -17310,7 +17335,7 @@ const SLOT_PROPS = {
|
|
|
17310
17335
|
* @see https://mui.com/material-ui/react-drawer/
|
|
17311
17336
|
*/
|
|
17312
17337
|
const Panel = react.default.forwardRef((props, ref) => {
|
|
17313
|
-
const { children, sdsType = "basic", position = "left", width, ModalProps, isBackdropClickEnabled = false, slotProps: userSlotProps } = props, rest = _objectWithoutProperties(props, _excluded$5);
|
|
17338
|
+
const { children, sdsType = "basic", position = "left", width, ModalProps, isBackdropClickEnabled = false, slotProps: userSlotProps, transitionDuration = PANEL_TRANSITION_DURATION_MS } = props, rest = _objectWithoutProperties(props, _excluded$5);
|
|
17314
17339
|
const mergedSlotProps = _objectSpread2(_objectSpread2(_objectSpread2({}, SLOT_PROPS), userSlotProps), {}, {
|
|
17315
17340
|
backdrop: _objectSpread2(_objectSpread2({}, SLOT_PROPS.backdrop), typeof (userSlotProps === null || userSlotProps === void 0 ? void 0 : userSlotProps.backdrop) === "object" ? userSlotProps.backdrop : {}),
|
|
17316
17341
|
paper: _objectSpread2(_objectSpread2({}, SLOT_PROPS.paper), typeof (userSlotProps === null || userSlotProps === void 0 ? void 0 : userSlotProps.paper) === "object" ? userSlotProps.paper : {})
|
|
@@ -17335,6 +17360,7 @@ const Panel = react.default.forwardRef((props, ref) => {
|
|
|
17335
17360
|
anchor: drawerAnchor,
|
|
17336
17361
|
variant: drawerVariant,
|
|
17337
17362
|
width: drawerWidth,
|
|
17363
|
+
transitionDuration,
|
|
17338
17364
|
ModalProps: _objectSpread2(_objectSpread2({}, ModalProps), {}, {
|
|
17339
17365
|
disableEnforceFocus: true,
|
|
17340
17366
|
disableScrollLock: true
|
|
@@ -17549,7 +17575,6 @@ const TableRow = (0, react.forwardRef)((props, ref) => {
|
|
|
17549
17575
|
const { children, shouldShowTooltipOnHover = true, tooltipProps, tooltipText = false, tooltipSubtitle, hover = true } = props;
|
|
17550
17576
|
if (shouldShowTooltipOnHover && hover) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Tooltip, _objectSpread2(_objectSpread2({
|
|
17551
17577
|
arrow: true,
|
|
17552
|
-
sdsStyle: "dark",
|
|
17553
17578
|
subtitle: tooltipSubtitle,
|
|
17554
17579
|
title: tooltipText
|
|
17555
17580
|
}, tooltipProps), {}, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTableRow, _objectSpread2(_objectSpread2({ ref }, props), {}, { children })) }));
|
|
@@ -18472,7 +18497,8 @@ const Tabs = (0, react.forwardRef)(function Tabs(props, ref) {
|
|
|
18472
18497
|
value: contextValue,
|
|
18473
18498
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTabs, _objectSpread2({
|
|
18474
18499
|
slotProps: { indicator: indicatorProps },
|
|
18475
|
-
ref
|
|
18500
|
+
ref,
|
|
18501
|
+
sdsSize
|
|
18476
18502
|
}, rest))
|
|
18477
18503
|
});
|
|
18478
18504
|
});
|