@czi-sds/components 24.0.0 → 24.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.cjs.d.ts +137 -24
- package/dist/index.cjs.js +214 -174
- package/dist/index.esm.d.ts +137 -24
- package/dist/index.esm.js +215 -175
- package/dist/tailwind.json +20 -14
- package/dist/variables.css +20 -14
- package/dist/variables.scss +20 -14
- package/package.json +3 -6
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";
|
|
@@ -645,7 +645,7 @@ const SDSDarkThemeColors = {
|
|
|
645
645
|
"500": "#aaaaaa",
|
|
646
646
|
"600": "#cdcdcd",
|
|
647
647
|
"700": "#ededed",
|
|
648
|
-
"75": "#
|
|
648
|
+
"75": "#1b1b1b",
|
|
649
649
|
"800": "#fafafa",
|
|
650
650
|
"900": "#ffffff"
|
|
651
651
|
},
|
|
@@ -902,7 +902,8 @@ const SDSPaletteLight = (appTheme) => {
|
|
|
902
902
|
borderPrimaryOnDark: appTheme.colors.gray[300],
|
|
903
903
|
borderPrimaryInverse: appTheme.colors.gray[300],
|
|
904
904
|
borderPrimaryPressedInverse: appTheme.colors.gray[50],
|
|
905
|
-
borderSecondary: appTheme.colors.gray[300],
|
|
905
|
+
borderSecondary: addOpacityToHex(appTheme.colors.gray[300], 70),
|
|
906
|
+
borderHighlight: addOpacityToHex(appTheme.colors.gray[900], 10),
|
|
906
907
|
borderSecondaryOnDark: appTheme.colors.gray[600],
|
|
907
908
|
divider: appTheme.colors.gray[200],
|
|
908
909
|
dividerOnDark: appTheme.colors.gray[700],
|
|
@@ -932,6 +933,7 @@ const SDSPaletteLight = (appTheme) => {
|
|
|
932
933
|
ornamentPrimaryOnDark: appTheme.colors.gray[50],
|
|
933
934
|
ornamentPrimaryInverse: appTheme.colors.gray[50],
|
|
934
935
|
ornamentSecondary: appTheme.colors.gray[600],
|
|
936
|
+
ornamentTertiary: appTheme.colors.gray[300],
|
|
935
937
|
ornamentSecondaryInteraction: appTheme.colors.gray[900],
|
|
936
938
|
ornamentSecondaryInteractionOnDark: appTheme.colors.gray[50],
|
|
937
939
|
ornamentSecondaryHoverInverse: appTheme.colors.gray[50],
|
|
@@ -940,6 +942,7 @@ const SDSPaletteLight = (appTheme) => {
|
|
|
940
942
|
ornamentSecondaryPressedInverse: appTheme.colors.gray[50],
|
|
941
943
|
surfacePrimary: appTheme.colors.gray[50],
|
|
942
944
|
surfaceSecondary: addOpacityToHex(appTheme.colors.gray[300], 20),
|
|
945
|
+
surfaceTertiary: appTheme.colors.gray[200],
|
|
943
946
|
surfacePrimaryDark: appTheme.colors.gray[900],
|
|
944
947
|
surfaceInverse: appTheme.colors.gray[900],
|
|
945
948
|
textDisabled: appTheme.colors.gray[300],
|
|
@@ -1100,8 +1103,8 @@ const SDSPaletteDark = (appTheme) => {
|
|
|
1100
1103
|
textActionPressed: appTheme.colors.indigo[800]
|
|
1101
1104
|
},
|
|
1102
1105
|
base: {
|
|
1103
|
-
backgroundPrimary: appTheme.colors.gray[
|
|
1104
|
-
backgroundPrimaryDark: appTheme.colors.gray[
|
|
1106
|
+
backgroundPrimary: appTheme.colors.gray[50],
|
|
1107
|
+
backgroundPrimaryDark: appTheme.colors.gray[50],
|
|
1105
1108
|
backgroundPrimaryInverse: appTheme.colors.gray[75],
|
|
1106
1109
|
backgroundSecondary: addOpacityToHex(appTheme.colors.gray[100], 60),
|
|
1107
1110
|
backgroundSecondaryDark: addOpacityToHex(appTheme.colors.gray[100], 60),
|
|
@@ -1118,20 +1121,21 @@ const SDSPaletteDark = (appTheme) => {
|
|
|
1118
1121
|
borderPrimaryOnDark: appTheme.colors.gray[600],
|
|
1119
1122
|
borderPrimaryInverse: appTheme.colors.gray[600],
|
|
1120
1123
|
borderPrimaryPressedInverse: appTheme.colors.gray[900],
|
|
1121
|
-
borderSecondary: appTheme.colors.gray[300],
|
|
1124
|
+
borderSecondary: addOpacityToHex(appTheme.colors.gray[300], 70),
|
|
1125
|
+
borderHighlight: addOpacityToHex(appTheme.colors.gray[900], 10),
|
|
1122
1126
|
borderSecondaryOnDark: appTheme.colors.gray[300],
|
|
1123
1127
|
divider: appTheme.colors.gray[200],
|
|
1124
1128
|
dividerOnDark: appTheme.colors.gray[200],
|
|
1125
1129
|
dividerInverse: appTheme.colors.gray[200],
|
|
1126
|
-
fillDisabled: appTheme.colors.gray[
|
|
1130
|
+
fillDisabled: appTheme.colors.gray[75],
|
|
1127
1131
|
fillPrimaryInteraction: addOpacityToHex(appTheme.colors.gray[300], 32),
|
|
1128
|
-
fillPrimaryInteractionOnDark: addOpacityToHex(appTheme.colors.gray[300],
|
|
1132
|
+
fillPrimaryInteractionOnDark: addOpacityToHex(appTheme.colors.gray[300], 24),
|
|
1129
1133
|
fillHoverInverse: addOpacityToHex(appTheme.colors.gray[300], 32),
|
|
1130
1134
|
fillOpenInverse: addOpacityToHex(appTheme.colors.gray[300], 32),
|
|
1131
|
-
fillPrimaryPressed: addOpacityToHex(appTheme.colors.gray[300],
|
|
1135
|
+
fillPrimaryPressed: addOpacityToHex(appTheme.colors.gray[300], 34),
|
|
1132
1136
|
fillPrimaryPressedOnDark: addOpacityToHex(appTheme.colors.gray[300], 40),
|
|
1133
1137
|
fillPressedInverse: addOpacityToHex(appTheme.colors.gray[300], 32),
|
|
1134
|
-
fillPrimary: appTheme.colors.gray[
|
|
1138
|
+
fillPrimary: appTheme.colors.gray[75],
|
|
1135
1139
|
fillSelected: appTheme.colors.gray[900],
|
|
1136
1140
|
fillSecondary: appTheme.colors.gray[200],
|
|
1137
1141
|
fillSecondaryInteraction: addOpacityToHex(appTheme.colors.gray[400], 26),
|
|
@@ -1139,7 +1143,7 @@ const SDSPaletteDark = (appTheme) => {
|
|
|
1139
1143
|
fillSecondaryOnDark: appTheme.colors.gray[200],
|
|
1140
1144
|
fillSecondaryInteractionOnDark: addOpacityToHex(appTheme.colors.gray[400], 34),
|
|
1141
1145
|
fillSecondaryPressedOnDark: addOpacityToHex(appTheme.colors.gray[400], 46),
|
|
1142
|
-
fillDisabledOnDark: appTheme.colors.gray[
|
|
1146
|
+
fillDisabledOnDark: appTheme.colors.gray[75],
|
|
1143
1147
|
ornamentDisabled: appTheme.colors.gray[300],
|
|
1144
1148
|
ornamentDisabledOnDark: appTheme.colors.gray[300],
|
|
1145
1149
|
ornamentDisabledInverse: appTheme.colors.gray[300],
|
|
@@ -1154,9 +1158,11 @@ const SDSPaletteDark = (appTheme) => {
|
|
|
1154
1158
|
ornamentSecondaryOnDark: appTheme.colors.gray[600],
|
|
1155
1159
|
ornamentSecondaryInverse: appTheme.colors.gray[600],
|
|
1156
1160
|
ornamentSecondaryPressedInverse: appTheme.colors.gray[900],
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1161
|
+
ornamentTertiary: appTheme.colors.gray[300],
|
|
1162
|
+
surfacePrimary: appTheme.colors.gray[75],
|
|
1163
|
+
surfaceSecondary: addOpacityToHex(appTheme.colors.gray[100], 64),
|
|
1164
|
+
surfaceTertiary: appTheme.colors.gray[100],
|
|
1165
|
+
surfacePrimaryDark: appTheme.colors.gray[75],
|
|
1160
1166
|
surfaceInverse: appTheme.colors.gray[100],
|
|
1161
1167
|
textDisabled: appTheme.colors.gray[300],
|
|
1162
1168
|
textDisabledOnDark: appTheme.colors.gray[300],
|
|
@@ -1286,6 +1292,7 @@ const SDSPaletteDark = (appTheme) => {
|
|
|
1286
1292
|
* This function creates the theme options for the MUI theme provider
|
|
1287
1293
|
*/
|
|
1288
1294
|
function makeThemeOptions(appTheme, mode) {
|
|
1295
|
+
const semanticColors = mode === "dark" ? SDSPaletteDark(appTheme) : SDSPaletteLight(appTheme);
|
|
1289
1296
|
return {
|
|
1290
1297
|
app: appTheme,
|
|
1291
1298
|
breakpoints: { values: Breakpoints$1 },
|
|
@@ -1326,7 +1333,14 @@ function makeThemeOptions(appTheme, mode) {
|
|
|
1326
1333
|
disabled: appTheme.colors.gray[400],
|
|
1327
1334
|
disabledBackground: appTheme.colors.gray[300]
|
|
1328
1335
|
},
|
|
1329
|
-
|
|
1336
|
+
/**
|
|
1337
|
+
* What `CssBaseline` paints the page with, so it has to be the same token
|
|
1338
|
+
* a component fills its own background with — otherwise a component sits
|
|
1339
|
+
* on a page a shade off from itself. The two are only one token in dark
|
|
1340
|
+
* mode, where the background and the surfaces above it are deliberately
|
|
1341
|
+
* different shades of near-black.
|
|
1342
|
+
*/
|
|
1343
|
+
background: { default: semanticColors.base.backgroundPrimary },
|
|
1330
1344
|
divider: appTheme.colors.gray[200],
|
|
1331
1345
|
error: {
|
|
1332
1346
|
"100": appTheme.colors.red[100],
|
|
@@ -1373,7 +1387,7 @@ function makeThemeOptions(appTheme, mode) {
|
|
|
1373
1387
|
light: appTheme.colors.blue[200],
|
|
1374
1388
|
main: appTheme.colors.blue[400]
|
|
1375
1389
|
},
|
|
1376
|
-
sds:
|
|
1390
|
+
sds: semanticColors,
|
|
1377
1391
|
secondary: {
|
|
1378
1392
|
"100": appTheme.colors.green[100],
|
|
1379
1393
|
"200": appTheme.colors.green[200],
|
|
@@ -6288,6 +6302,19 @@ const StyledIcon$2 = /*#__PURE__*/ _styled("div", { target: "emi0zh40" })({
|
|
|
6288
6302
|
//#region src/core/Icon/index.tsx
|
|
6289
6303
|
/**
|
|
6290
6304
|
* @see https://mui.com/material-ui/icons/#icons
|
|
6305
|
+
*
|
|
6306
|
+
* @deprecated
|
|
6307
|
+
* This component is deprecated and will be removed in a future major version.
|
|
6308
|
+
* SDS icons come from Phosphor now: import the icon you need from
|
|
6309
|
+
* `@phosphor-icons/react`, or from `@czi-sds/icons` for the icons SDS draws
|
|
6310
|
+
* itself. Both take the same props, so the only difference is the import.
|
|
6311
|
+
*
|
|
6312
|
+
* ```tsx
|
|
6313
|
+
* // Before
|
|
6314
|
+
* <Icon sdsIcon="InfoCircle" sdsSize="l" />
|
|
6315
|
+
* // After
|
|
6316
|
+
* <InfoIcon size={24} />
|
|
6317
|
+
* ```
|
|
6291
6318
|
*/
|
|
6292
6319
|
const Icon = forwardRef(function Icon({ className, color, shade, sdsIcon, sdsSize }, ref) {
|
|
6293
6320
|
var _iconMap$sdsIcon;
|
|
@@ -8197,17 +8224,9 @@ const SDS_WARNINGS = {
|
|
|
8197
8224
|
hasWarned: false,
|
|
8198
8225
|
message: "Warning: MenuSelect will be deprecated and replaced with <DropdownMenu />"
|
|
8199
8226
|
},
|
|
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
8227
|
["tooltipInvertStyle"]: {
|
|
8209
8228
|
hasWarned: false,
|
|
8210
|
-
message: "Warning: Tooltips
|
|
8229
|
+
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
8230
|
},
|
|
8212
8231
|
["contentCardActionsOnlyButtons"]: {
|
|
8213
8232
|
hasWarned: false,
|
|
@@ -8422,8 +8441,71 @@ const StyledButtonGroup = /*#__PURE__*/ _styled(ButtonGroup$1, {
|
|
|
8422
8441
|
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
8442
|
}, ";");
|
|
8424
8443
|
//#endregion
|
|
8444
|
+
//#region src/core/ButtonToggle/style.ts
|
|
8445
|
+
/**
|
|
8446
|
+
* (masoudmanson): Since StyledButtonToggle is built on top of Button,
|
|
8447
|
+
* we only need to exclude the `sdsStage` prop from being forwarded,
|
|
8448
|
+
* as it is not a valid prop for Button.
|
|
8449
|
+
* All other props should be passed down to Button; otherwise,
|
|
8450
|
+
* the component won’t function as expected.
|
|
8451
|
+
*/
|
|
8452
|
+
const doNotForwardProps$39 = ["sdsStage"];
|
|
8453
|
+
/**
|
|
8454
|
+
* Utility to select the appropriate color based on background appearance.
|
|
8455
|
+
* Returns the dark variant when backgroundAppearance is "dark", otherwise returns the light variant.
|
|
8456
|
+
*/
|
|
8457
|
+
const getAppearanceColor = (lightColor, darkColor, backgroundAppearance) => {
|
|
8458
|
+
return backgroundAppearance === "dark" ? darkColor : lightColor;
|
|
8459
|
+
};
|
|
8460
|
+
const StageOnStyles = (props) => {
|
|
8461
|
+
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;
|
|
8462
|
+
const { sdsType, sdsStyle, backgroundOnHover, backgroundAppearance = "matchBackground" } = props;
|
|
8463
|
+
const semanticColors = getSemanticColors(props);
|
|
8464
|
+
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);
|
|
8465
|
+
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);
|
|
8466
|
+
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);
|
|
8467
|
+
if (sdsType === "secondary")
|
|
8468
|
+
/**
|
|
8469
|
+
* Specificity boost via Emotion's `&&&&` technique.
|
|
8470
|
+
*
|
|
8471
|
+
* Each `&` repeats the component's generated class, producing a selector
|
|
8472
|
+
* like `.css-abc123.css-abc123.css-abc123.css-abc123`, which has
|
|
8473
|
+
* specificity (0,4,0).
|
|
8474
|
+
*
|
|
8475
|
+
* This is needed because ButtonGroup styles its children with
|
|
8476
|
+
* `&& .MuiButtonGroup-grouped` which has specificity (0,3,0).
|
|
8477
|
+
* Without the boost, the sdsStage="on" styles would always lose
|
|
8478
|
+
* the cascade to the ButtonGroup's parent-level overrides.
|
|
8479
|
+
*/
|
|
8480
|
+
return /*#__PURE__*/ css("&&&&{color:", contentColor, ";svg{color:", ornamentColor, ";}&::before{background-color:", sdsStyle === "minimal" && !backgroundOnHover ? "transparent" : backgroundColor, ";}}");
|
|
8481
|
+
return /*#__PURE__*/ css("&&&&{background-color:", sdsStyle === "minimal" && !backgroundOnHover ? "transparent" : backgroundColor, ";color:", contentColor, ";svg{color:", ornamentColor, ";}}");
|
|
8482
|
+
};
|
|
8483
|
+
const StyledButtonToggle = /*#__PURE__*/ _styled(Button, {
|
|
8484
|
+
shouldForwardProp: (prop) => !doNotForwardProps$39.includes(prop),
|
|
8485
|
+
target: "euuolxv0"
|
|
8486
|
+
})((props) => {
|
|
8487
|
+
const { sdsStage } = props;
|
|
8488
|
+
if (sdsStage === "on") return StageOnStyles(props);
|
|
8489
|
+
return null;
|
|
8490
|
+
}, ";");
|
|
8491
|
+
//#endregion
|
|
8492
|
+
//#region src/core/ButtonToggle/index.tsx
|
|
8493
|
+
const _excluded$38 = ["startIcon"];
|
|
8494
|
+
/**
|
|
8495
|
+
* @see https://mui.com/material-ui/react-button/
|
|
8496
|
+
*/
|
|
8497
|
+
const ButtonToggle = React.forwardRef((props, ref) => {
|
|
8498
|
+
const { startIcon } = props;
|
|
8499
|
+
return /* @__PURE__ */ jsx(StyledButtonToggle, _objectSpread2(_objectSpread2({}, _objectWithoutProperties(props, _excluded$38)), {}, {
|
|
8500
|
+
startIcon,
|
|
8501
|
+
endIcon: null,
|
|
8502
|
+
backgroundOnHover: true,
|
|
8503
|
+
ref
|
|
8504
|
+
}));
|
|
8505
|
+
});
|
|
8506
|
+
//#endregion
|
|
8425
8507
|
//#region src/core/ButtonGroup/index.tsx
|
|
8426
|
-
const _excluded$
|
|
8508
|
+
const _excluded$37 = [
|
|
8427
8509
|
"sdsType",
|
|
8428
8510
|
"size",
|
|
8429
8511
|
"orientation",
|
|
@@ -8452,17 +8534,20 @@ const areAllButtonsIconOnly = (children) => {
|
|
|
8452
8534
|
return childArray.every((child) => isIconOnlyButton(child));
|
|
8453
8535
|
};
|
|
8454
8536
|
/**
|
|
8455
|
-
*
|
|
8537
|
+
* The components a group is made of, and so the ones its size applies to. A
|
|
8538
|
+
* ButtonToggle passes `size` on to the Button underneath it, which is what
|
|
8539
|
+
* keeps a mixed group at one height.
|
|
8456
8540
|
*/
|
|
8457
|
-
const
|
|
8458
|
-
|
|
8541
|
+
const GROUPED_COMPONENTS = [Button, ButtonToggle];
|
|
8542
|
+
const takesGroupSize = (element) => {
|
|
8543
|
+
return GROUPED_COMPONENTS.includes(element.type);
|
|
8459
8544
|
};
|
|
8460
8545
|
/**
|
|
8461
|
-
* Clone children and inject the size prop to
|
|
8546
|
+
* Clone children and inject the size prop to the buttons in the group.
|
|
8462
8547
|
*/
|
|
8463
8548
|
const cloneChildrenWithSize = (children, size) => {
|
|
8464
8549
|
return Children.map(children, (child) => {
|
|
8465
|
-
if (isValidElement(child) &&
|
|
8550
|
+
if (isValidElement(child) && takesGroupSize(child)) return cloneElement(child, { size });
|
|
8466
8551
|
return child;
|
|
8467
8552
|
});
|
|
8468
8553
|
};
|
|
@@ -8475,7 +8560,7 @@ const cloneChildrenWithSize = (children, size) => {
|
|
|
8475
8560
|
* Note: Vertical orientation is only available when all buttons are icon-only.
|
|
8476
8561
|
*/
|
|
8477
8562
|
const ButtonGroup = React.forwardRef((props, ref) => {
|
|
8478
|
-
const { sdsType = "primary", size = "large", orientation = "horizontal", children } = props, rest = _objectWithoutProperties(props, _excluded$
|
|
8563
|
+
const { sdsType = "primary", size = "large", orientation = "horizontal", children } = props, rest = _objectWithoutProperties(props, _excluded$37);
|
|
8479
8564
|
const allIconOnly = areAllButtonsIconOnly(children);
|
|
8480
8565
|
const effectiveOrientation = allIconOnly ? orientation : "horizontal";
|
|
8481
8566
|
if (orientation === "vertical" && !allIconOnly) showWarningIfFirstOccurence("ButtonGroupVerticalOrientation");
|
|
@@ -8528,7 +8613,7 @@ const large = (props) => {
|
|
|
8528
8613
|
const spaces = getSpaces(props);
|
|
8529
8614
|
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
8615
|
};
|
|
8531
|
-
const doNotForwardProps$
|
|
8616
|
+
const doNotForwardProps$38 = [
|
|
8532
8617
|
"on",
|
|
8533
8618
|
"sdsSize",
|
|
8534
8619
|
"sdsType",
|
|
@@ -8538,7 +8623,7 @@ const doNotForwardProps$39 = [
|
|
|
8538
8623
|
"customTheme"
|
|
8539
8624
|
];
|
|
8540
8625
|
const StyledButtonIcon = /*#__PURE__*/ _styled(IconButton, {
|
|
8541
|
-
shouldForwardProp: (prop) => !doNotForwardProps$
|
|
8626
|
+
shouldForwardProp: (prop) => !doNotForwardProps$38.includes(prop),
|
|
8542
8627
|
target: "e164i6480"
|
|
8543
8628
|
})("padding:0;", focusVisibleA11yStyle, " ", (props) => {
|
|
8544
8629
|
const { disabled, sdsSize = "medium", sdsType = "primary" } = props;
|
|
@@ -8584,68 +8669,6 @@ const ButtonIcon = forwardRef(function ButtonIcon(props, ref) {
|
|
|
8584
8669
|
}));
|
|
8585
8670
|
});
|
|
8586
8671
|
//#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
8672
|
//#region src/core/ButtonLegacy/style.ts
|
|
8650
8673
|
const doNotForwardProps$37 = [
|
|
8651
8674
|
"isAllCaps",
|
|
@@ -8992,7 +9015,8 @@ const _excluded$35 = [
|
|
|
8992
9015
|
"hideTitle",
|
|
8993
9016
|
"hideBody",
|
|
8994
9017
|
"sdsStyle",
|
|
8995
|
-
"children"
|
|
9018
|
+
"children",
|
|
9019
|
+
"extraContent"
|
|
8996
9020
|
];
|
|
8997
9021
|
const SDS_STAGE_OPEN = "open";
|
|
8998
9022
|
const SDS_STAGE_CLOSED = "closed";
|
|
@@ -9000,7 +9024,7 @@ const SDS_STAGE_CLOSED = "closed";
|
|
|
9000
9024
|
* @see https://mui.com/material-ui/react-alert/
|
|
9001
9025
|
*/
|
|
9002
9026
|
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);
|
|
9027
|
+
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
9028
|
const [hide, setHide] = useState(dismissed);
|
|
9005
9029
|
const [stage, setStage] = useState(sdsStage);
|
|
9006
9030
|
useEffect(() => {
|
|
@@ -9080,70 +9104,62 @@ const Callout = (props) => {
|
|
|
9080
9104
|
hideTitle,
|
|
9081
9105
|
children: body
|
|
9082
9106
|
}),
|
|
9083
|
-
sdsStyle === "expandable" && !collapsed && /* @__PURE__ */
|
|
9107
|
+
sdsStyle === "expandable" && !collapsed && /* @__PURE__ */ jsxs(CalloutExtraContent, {
|
|
9084
9108
|
hideTitle,
|
|
9085
9109
|
hideBody,
|
|
9086
|
-
children
|
|
9110
|
+
children: [children, extraContent]
|
|
9087
9111
|
})
|
|
9088
9112
|
] }))
|
|
9089
9113
|
});
|
|
9090
9114
|
};
|
|
9091
9115
|
//#endregion
|
|
9092
9116
|
//#region src/core/Tooltip/style.ts
|
|
9093
|
-
const
|
|
9117
|
+
const surface = (props) => {
|
|
9094
9118
|
var _semanticColors$base, _semanticColors$base2;
|
|
9095
9119
|
const spaces = getSpaces(props);
|
|
9096
9120
|
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;");
|
|
9121
|
+
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
9122
|
};
|
|
9105
9123
|
const tableStyles = (props) => {
|
|
9106
9124
|
const spaces = getSpaces(props);
|
|
9107
9125
|
return /*#__PURE__*/ css$2("padding:", spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;");
|
|
9108
9126
|
};
|
|
9109
|
-
const doNotForwardProps$34 = ["
|
|
9127
|
+
const doNotForwardProps$34 = ["textAlign"];
|
|
9110
9128
|
const StyledTitle = /*#__PURE__*/ _styled("p", {
|
|
9111
9129
|
shouldForwardProp: (prop) => !doNotForwardProps$34.includes(prop),
|
|
9112
9130
|
target: "e1j7jeiz3"
|
|
9113
9131
|
})(fontBodyMediumXs, " ", (props) => {
|
|
9114
|
-
var _semanticColors$
|
|
9115
|
-
const { hasInvertedStyle } = props;
|
|
9132
|
+
var _semanticColors$base3;
|
|
9116
9133
|
const semanticColors = getSemanticColors(props);
|
|
9117
9134
|
return `
|
|
9118
9135
|
margin: 0;
|
|
9119
|
-
color: ${
|
|
9136
|
+
color: ${semanticColors === null || semanticColors === void 0 || (_semanticColors$base3 = semanticColors.base) === null || _semanticColors$base3 === void 0 ? void 0 : _semanticColors$base3.textPrimary};
|
|
9120
9137
|
`;
|
|
9121
9138
|
}, ";");
|
|
9122
9139
|
const StyledSubtitle = /*#__PURE__*/ _styled("p", {
|
|
9123
9140
|
shouldForwardProp: (prop) => !doNotForwardProps$34.includes(prop),
|
|
9124
9141
|
target: "e1j7jeiz2"
|
|
9125
9142
|
})(fontBodyXxs, " ", (props) => {
|
|
9126
|
-
var _semanticColors$
|
|
9127
|
-
const { hasInvertedStyle } = props;
|
|
9143
|
+
var _semanticColors$base4;
|
|
9128
9144
|
const semanticColors = getSemanticColors(props);
|
|
9129
9145
|
return `
|
|
9130
9146
|
margin: 0;
|
|
9131
|
-
color: ${
|
|
9147
|
+
color: ${semanticColors === null || semanticColors === void 0 || (_semanticColors$base4 = semanticColors.base) === null || _semanticColors$base4 === void 0 ? void 0 : _semanticColors$base4.textSecondary};
|
|
9132
9148
|
`;
|
|
9133
9149
|
}, ";");
|
|
9134
9150
|
const tooltipCss = (props) => {
|
|
9135
|
-
var _semanticColors$
|
|
9136
|
-
const {
|
|
9151
|
+
var _semanticColors$base5;
|
|
9152
|
+
const { width, followCursor, textAlign } = props;
|
|
9137
9153
|
const shadows = getShadows(props);
|
|
9138
9154
|
const corners = getCorners(props);
|
|
9139
9155
|
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;
|
|
9156
|
+
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
9157
|
};
|
|
9142
9158
|
const arrowCss = (props) => {
|
|
9143
|
-
var _semanticColors$
|
|
9144
|
-
const {
|
|
9159
|
+
var _semanticColors$base6;
|
|
9160
|
+
const { arrowOffset } = props;
|
|
9145
9161
|
const semanticColors = getSemanticColors(props);
|
|
9146
|
-
return /*#__PURE__*/ css$2("&.MuiTooltip-arrow{", arrowOffset !== void 0 ? `left: ${arrowOffset}px !important;` : "", " color:",
|
|
9162
|
+
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
9163
|
};
|
|
9148
9164
|
const StyledPopper$2 = /*#__PURE__*/ _styled(Popper, { target: "e1j7jeiz1" })("z-index:", (props) => {
|
|
9149
9165
|
var _props$theme$zIndex$t, _props$theme;
|
|
@@ -9179,17 +9195,14 @@ const _excluded$34 = [
|
|
|
9179
9195
|
* https://mui.com/components/tooltips/#disabled-elements
|
|
9180
9196
|
*/
|
|
9181
9197
|
const Tooltip = forwardRef(function Tooltip(props, ref) {
|
|
9182
|
-
const { arrowOffset, classes, hasInvertedStyle
|
|
9198
|
+
const { arrowOffset, classes, hasInvertedStyle, inverted, sdsStyle, subtitle, title, width = "default", PopperComponent = StyledPopper$2, textAlign, componentSlot } = props, rest = _objectWithoutProperties(props, _excluded$34);
|
|
9183
9199
|
const { children } = rest;
|
|
9184
|
-
if (inverted || sdsStyle) showWarningIfFirstOccurence("tooltipInvertStyle");
|
|
9185
|
-
if (width === "wide" && (sdsStyle === "dark" || hasInvertedStyle)) showWarningIfFirstOccurence("tooltipWidth");
|
|
9186
|
-
const theme = useTheme();
|
|
9200
|
+
if (hasInvertedStyle !== void 0 || inverted !== void 0 || sdsStyle !== void 0) showWarningIfFirstOccurence("tooltipInvertStyle");
|
|
9187
9201
|
const extraProps = {
|
|
9188
9202
|
arrowOffset,
|
|
9189
9203
|
classes,
|
|
9190
|
-
hasInvertedStyle: invertStyleValue(inverted, sdsStyle, hasInvertedStyle),
|
|
9191
9204
|
textAlign,
|
|
9192
|
-
theme,
|
|
9205
|
+
theme: useTheme(),
|
|
9193
9206
|
width
|
|
9194
9207
|
};
|
|
9195
9208
|
const tooltip = mergeClass$1({
|
|
@@ -9208,16 +9221,9 @@ const Tooltip = forwardRef(function Tooltip(props, ref) {
|
|
|
9208
9221
|
arrow,
|
|
9209
9222
|
tooltip
|
|
9210
9223
|
},
|
|
9211
|
-
leaveDelay: hasInvertedStyle || inverted || sdsStyle === "dark" ? 0 : 500,
|
|
9212
9224
|
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
|
-
}),
|
|
9225
|
+
title && /* @__PURE__ */ jsx(StyledTitle, { children: title }),
|
|
9226
|
+
subtitle && /* @__PURE__ */ jsx(StyledSubtitle, { children: subtitle }),
|
|
9221
9227
|
componentSlot && /* @__PURE__ */ jsx(StyledComponentSlotWrapper, {
|
|
9222
9228
|
shouldAddMargin: !!title || !!subtitle,
|
|
9223
9229
|
children: componentSlot
|
|
@@ -9228,15 +9234,6 @@ const Tooltip = forwardRef(function Tooltip(props, ref) {
|
|
|
9228
9234
|
arrow: true
|
|
9229
9235
|
}, rest), {}, { slots: { popper: PopperComponent } }));
|
|
9230
9236
|
});
|
|
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
9237
|
function mergeClass$1({ props, className, key }) {
|
|
9241
9238
|
const { classes } = props;
|
|
9242
9239
|
if (!classes) return className;
|
|
@@ -9461,8 +9458,7 @@ const CellBasic = forwardRef((props, ref) => {
|
|
|
9461
9458
|
subtitle: secondaryText,
|
|
9462
9459
|
arrow: true,
|
|
9463
9460
|
leaveDelay: 0,
|
|
9464
|
-
leaveTouchDelay: 0
|
|
9465
|
-
sdsStyle: "dark"
|
|
9461
|
+
leaveTouchDelay: 0
|
|
9466
9462
|
}, tooltipProps), {}, { children: /* @__PURE__ */ jsx(StyledTableData, _objectSpread2(_objectSpread2({
|
|
9467
9463
|
ref,
|
|
9468
9464
|
as
|
|
@@ -9633,7 +9629,6 @@ const CellHeader = forwardRef((props, ref) => {
|
|
|
9633
9629
|
if (shouldShowTooltipOnHover && hover) return /* @__PURE__ */ jsx(Tooltip, _objectSpread2(_objectSpread2({
|
|
9634
9630
|
arrow: true,
|
|
9635
9631
|
placement: "top-start",
|
|
9636
|
-
sdsStyle: "dark",
|
|
9637
9632
|
subtitle: tooltipSubtitle,
|
|
9638
9633
|
title: tooltipText
|
|
9639
9634
|
}, tooltipProps), {}, { children: /* @__PURE__ */ jsx(StyledTableHeader$1, _objectSpread2(_objectSpread2({
|
|
@@ -10024,10 +10019,10 @@ const labelFontBodyS = fontBody("s", "regular");
|
|
|
10024
10019
|
const labelFontBodyXs = fontBody("xs", "regular");
|
|
10025
10020
|
const inputDropdownStyles = (props) => {
|
|
10026
10021
|
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
|
|
10022
|
+
const { width } = props;
|
|
10028
10023
|
const spaces = getSpaces(props);
|
|
10029
10024
|
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;
|
|
10025
|
+
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
10026
|
};
|
|
10032
10027
|
const minimal$1 = (props) => {
|
|
10033
10028
|
var _semanticColors$base12, _semanticColors$base13, _semanticColors$base14, _semanticColors$base15, _semanticColors$base16, _semanticColors$base17, _semanticColors$base18;
|
|
@@ -10195,7 +10190,7 @@ const validateSdsStyle = (sdsStyle) => {
|
|
|
10195
10190
|
/**
|
|
10196
10191
|
* @see https://mui.com/material-ui/react-button/
|
|
10197
10192
|
*/
|
|
10198
|
-
const InputDropdown = (props)
|
|
10193
|
+
const InputDropdown = forwardRef(function InputDropdown(props, ref) {
|
|
10199
10194
|
const { label, multiple = false, sdsStyle: rawSdsStyle = "square", sdsType = "label", details, counter, shouldTruncateMinimalDetails, shouldPutAColonAfterLabel = true, value, classes = EMPTY_OBJECT, className } = props;
|
|
10200
10195
|
const sdsStyle = validateSdsStyle(rawSdsStyle);
|
|
10201
10196
|
const isMinimal = sdsStyle === "minimal";
|
|
@@ -10205,6 +10200,7 @@ const InputDropdown = (props) => {
|
|
|
10205
10200
|
const shouldRenderCounter = multiple && counter !== void 0 && counter !== "0" && !isMinimal;
|
|
10206
10201
|
const { root: rootClassName, label: labelClassName, contentWrapper: contentWrapperClassName, labelDetailsWrapper: labelDetailsWrapperClassName, details: detailsClassName, counter: counterClassName, iconWrapper: iconWrapperClassName, chevronIcon: chevronIconClassName, minimalDetails: minimalDetailsClassName } = classes;
|
|
10207
10202
|
return /* @__PURE__ */ jsxs(StyledInputDropdown, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
10203
|
+
ref,
|
|
10208
10204
|
className: cn(rootClassName, className),
|
|
10209
10205
|
sdsStyle,
|
|
10210
10206
|
"aria-label": "Dropdown input",
|
|
@@ -10269,7 +10265,7 @@ const InputDropdown = (props) => {
|
|
|
10269
10265
|
})
|
|
10270
10266
|
})]
|
|
10271
10267
|
}));
|
|
10272
|
-
};
|
|
10268
|
+
});
|
|
10273
10269
|
function renderLabelText(props) {
|
|
10274
10270
|
const { sdsType } = props;
|
|
10275
10271
|
if (sdsType === "label") return renderLabelTypeLabelText(props);
|
|
@@ -10342,7 +10338,7 @@ const _excluded$30 = [
|
|
|
10342
10338
|
"disabled",
|
|
10343
10339
|
"value",
|
|
10344
10340
|
"onClick"
|
|
10345
|
-
];
|
|
10341
|
+
], _excluded2$4 = ["ref"];
|
|
10346
10342
|
function useDropdownState(propValue, multiple, options) {
|
|
10347
10343
|
const getInitialValue = useCallback(() => {
|
|
10348
10344
|
return multiple ? [] : null;
|
|
@@ -10576,6 +10572,7 @@ const Dropdown = (props) => {
|
|
|
10576
10572
|
countMultiColumnSelections,
|
|
10577
10573
|
getSingleSelectionProps
|
|
10578
10574
|
]);
|
|
10575
|
+
const { ref } = rest, inputRest = _objectWithoutProperties(rest, _excluded2$4);
|
|
10579
10576
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(InputDropdownComponent, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
10580
10577
|
disabled,
|
|
10581
10578
|
label,
|
|
@@ -10583,7 +10580,7 @@ const Dropdown = (props) => {
|
|
|
10583
10580
|
"aria-expanded": open,
|
|
10584
10581
|
"aria-haspopup": "listbox",
|
|
10585
10582
|
multiple: multiple || isMultiColumn
|
|
10586
|
-
}, getInputDropdownProps), InputDropdownProps),
|
|
10583
|
+
}, getInputDropdownProps), InputDropdownProps), inputRest)), /* @__PURE__ */ jsx(DropdownMenu, _objectSpread2(_objectSpread2({
|
|
10587
10584
|
anchorEl,
|
|
10588
10585
|
open,
|
|
10589
10586
|
search,
|
|
@@ -11750,6 +11747,21 @@ const doNotForwardProps$18 = [
|
|
|
11750
11747
|
"backgroundFillColor",
|
|
11751
11748
|
"overlayContentPosition"
|
|
11752
11749
|
];
|
|
11750
|
+
/**
|
|
11751
|
+
* The color the header and the caption are set in.
|
|
11752
|
+
*
|
|
11753
|
+
* `hasInvertTextColor` is for text over a dark backdrop: imagery, or a darkening
|
|
11754
|
+
* mask over it. That backdrop is dark whatever the theme, so the text has to
|
|
11755
|
+
* stay light in both — which is what `textPrimaryOnDark` is for. The theme's
|
|
11756
|
+
* inverse text would follow the theme instead and come out near-black in the
|
|
11757
|
+
* dark theme, over an image that had not changed.
|
|
11758
|
+
*/
|
|
11759
|
+
const getTextColor = (props) => {
|
|
11760
|
+
var _semanticColors$base, _semanticColors$base2;
|
|
11761
|
+
const { hasInvertTextColor } = props;
|
|
11762
|
+
const semanticColors = getSemanticColors(props);
|
|
11763
|
+
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;
|
|
11764
|
+
};
|
|
11753
11765
|
const getResponsivePadding = (props) => {
|
|
11754
11766
|
const { overlayContainerMinMargin } = props;
|
|
11755
11767
|
const spaces = getSpaces(props);
|
|
@@ -11778,18 +11790,10 @@ const HeroTitle = /*#__PURE__*/ _styled("h1", { target: "e1wdq27g7" })((props) =
|
|
|
11778
11790
|
if (headerFontSize === "s") return fontHeaderS(props);
|
|
11779
11791
|
else if (headerFontSize === "m") return fontHeaderM(props);
|
|
11780
11792
|
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;");
|
|
11793
|
+
}, " ", (props) => /*#__PURE__*/ css("color:", getTextColor(props), ";"), " margin:0;padding:0;");
|
|
11787
11794
|
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
11795
|
const spaces = getSpaces(props);
|
|
11792
|
-
return /*#__PURE__*/ css("color:",
|
|
11796
|
+
return /*#__PURE__*/ css("color:", getTextColor(props), ";margin:", spaces === null || spaces === void 0 ? void 0 : spaces.m, "px 0 0;");
|
|
11793
11797
|
}, " padding:0;");
|
|
11794
11798
|
const ContentSlot = /*#__PURE__*/ _styled("div", { target: "e1wdq27g5" })((props) => {
|
|
11795
11799
|
const spaces = getSpaces(props);
|
|
@@ -16521,27 +16525,47 @@ const NavigationJumpTo = forwardRef((props, ref) => {
|
|
|
16521
16525
|
});
|
|
16522
16526
|
return map;
|
|
16523
16527
|
}, [items, flattenedItems]);
|
|
16524
|
-
const
|
|
16528
|
+
const tabIds = useMemo(() => {
|
|
16529
|
+
const seen = /* @__PURE__ */ new Map();
|
|
16530
|
+
return flattenedItems.map(({ title }) => {
|
|
16531
|
+
var _seen$get;
|
|
16532
|
+
const base = toKebabCase(title);
|
|
16533
|
+
const count = ((_seen$get = seen.get(base)) !== null && _seen$get !== void 0 ? _seen$get : 0) + 1;
|
|
16534
|
+
seen.set(base, count);
|
|
16535
|
+
return count === 1 ? base : `${base}-${count}`;
|
|
16536
|
+
});
|
|
16537
|
+
}, [flattenedItems]);
|
|
16538
|
+
const itemOffsets = useMemo(() => {
|
|
16539
|
+
let offset = 0;
|
|
16540
|
+
return items.map((item) => {
|
|
16541
|
+
var _item$subItems$length, _item$subItems;
|
|
16542
|
+
const start = offset;
|
|
16543
|
+
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);
|
|
16544
|
+
return start;
|
|
16545
|
+
});
|
|
16546
|
+
}, [items]);
|
|
16547
|
+
const a11yProps = (tabId, elementId) => {
|
|
16525
16548
|
return {
|
|
16526
16549
|
"aria-controls": elementId,
|
|
16527
|
-
id: `navigation-tab-${
|
|
16550
|
+
id: `navigation-tab-${tabId}`
|
|
16528
16551
|
};
|
|
16529
16552
|
};
|
|
16530
|
-
const createTabsForItem = (item, itemIndex) => {
|
|
16553
|
+
const createTabsForItem = (item, itemIndex, flatIndex) => {
|
|
16531
16554
|
var _item$elementRef$curr;
|
|
16532
16555
|
const tabs = [/* @__PURE__ */ jsx(StyledTab$1, _objectSpread2({
|
|
16533
16556
|
label: item.title,
|
|
16534
16557
|
tabIndex: 0,
|
|
16535
16558
|
width
|
|
16536
|
-
}, a11yProps(
|
|
16559
|
+
}, 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
16560
|
if (item.subItems) item.subItems.forEach((subItem, subIndex) => {
|
|
16538
16561
|
var _subItem$elementRef$c;
|
|
16562
|
+
const subTabId = tabIds[flatIndex + subIndex + 1];
|
|
16539
16563
|
tabs.push(/* @__PURE__ */ jsx(StyledTab$1, _objectSpread2({
|
|
16540
16564
|
label: subItem.title,
|
|
16541
16565
|
tabIndex: 0,
|
|
16542
16566
|
width,
|
|
16543
16567
|
isSubItem: true
|
|
16544
|
-
}, a11yProps(
|
|
16568
|
+
}, 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
16569
|
});
|
|
16546
16570
|
return tabs;
|
|
16547
16571
|
};
|
|
@@ -16594,7 +16618,7 @@ const NavigationJumpTo = forwardRef((props, ref) => {
|
|
|
16594
16618
|
onChange: handleChange,
|
|
16595
16619
|
"aria-label": "navigation-jump-to",
|
|
16596
16620
|
width
|
|
16597
|
-
}, rest), {}, { children: items.map((item, itemIndex) => createTabsForItem(item, itemIndex)) }));
|
|
16621
|
+
}, rest), {}, { children: items.map((item, itemIndex) => createTabsForItem(item, itemIndex, itemOffsets[itemIndex])) }));
|
|
16598
16622
|
});
|
|
16599
16623
|
//#endregion
|
|
16600
16624
|
//#region src/core/Notification/style.ts
|
|
@@ -17075,6 +17099,20 @@ const Pagination = forwardRef((props, ref) => {
|
|
|
17075
17099
|
}
|
|
17076
17100
|
});
|
|
17077
17101
|
//#endregion
|
|
17102
|
+
//#region src/core/Panel/Panel.types.ts
|
|
17103
|
+
/**
|
|
17104
|
+
* (masoudmanson): The SDS theme shortens MUI's global transition durations to
|
|
17105
|
+
* 20ms in and 10ms out, which suits small elements but is too brief for a surface
|
|
17106
|
+
* as large as a Panel: it arrives before the eye can follow it in, so it reads as
|
|
17107
|
+
* a jump rather than a slide. The Panel therefore keeps MUI's own drawer timings
|
|
17108
|
+
* instead of the SDS ones. Pass `transitionDuration` to change or remove the
|
|
17109
|
+
* animation, e.g. `transitionDuration={0}` or `{ enter: 300, exit: 200 }`.
|
|
17110
|
+
*/
|
|
17111
|
+
const PANEL_TRANSITION_DURATION_MS = {
|
|
17112
|
+
enter: 225,
|
|
17113
|
+
exit: 195
|
|
17114
|
+
};
|
|
17115
|
+
//#endregion
|
|
17078
17116
|
//#region src/core/Panel/style.ts
|
|
17079
17117
|
const doNotForwardProps$2 = [
|
|
17080
17118
|
"sdsType",
|
|
@@ -17098,7 +17136,7 @@ const overlayPanelStyles = (props) => {
|
|
|
17098
17136
|
const semanticColors = getSemanticColors(props);
|
|
17099
17137
|
const spaces = getSpaces(props);
|
|
17100
17138
|
const shadows = getShadows(props);
|
|
17101
|
-
return /*#__PURE__*/ css("
|
|
17139
|
+
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
17140
|
};
|
|
17103
17141
|
const StyledDrawer = /*#__PURE__*/ _styled(Drawer, {
|
|
17104
17142
|
shouldForwardProp: (prop) => !doNotForwardProps$2.includes(prop),
|
|
@@ -17180,7 +17218,8 @@ const _excluded$5 = [
|
|
|
17180
17218
|
"width",
|
|
17181
17219
|
"ModalProps",
|
|
17182
17220
|
"isBackdropClickEnabled",
|
|
17183
|
-
"slotProps"
|
|
17221
|
+
"slotProps",
|
|
17222
|
+
"transitionDuration"
|
|
17184
17223
|
];
|
|
17185
17224
|
function isOverlayPanelProps(props) {
|
|
17186
17225
|
return props.sdsType === "overlay";
|
|
@@ -17193,7 +17232,7 @@ const SLOT_PROPS = {
|
|
|
17193
17232
|
* @see https://mui.com/material-ui/react-drawer/
|
|
17194
17233
|
*/
|
|
17195
17234
|
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);
|
|
17235
|
+
const { children, sdsType = "basic", position = "left", width, ModalProps, isBackdropClickEnabled = false, slotProps: userSlotProps, transitionDuration = PANEL_TRANSITION_DURATION_MS } = props, rest = _objectWithoutProperties(props, _excluded$5);
|
|
17197
17236
|
const mergedSlotProps = _objectSpread2(_objectSpread2(_objectSpread2({}, SLOT_PROPS), userSlotProps), {}, {
|
|
17198
17237
|
backdrop: _objectSpread2(_objectSpread2({}, SLOT_PROPS.backdrop), typeof (userSlotProps === null || userSlotProps === void 0 ? void 0 : userSlotProps.backdrop) === "object" ? userSlotProps.backdrop : {}),
|
|
17199
17238
|
paper: _objectSpread2(_objectSpread2({}, SLOT_PROPS.paper), typeof (userSlotProps === null || userSlotProps === void 0 ? void 0 : userSlotProps.paper) === "object" ? userSlotProps.paper : {})
|
|
@@ -17218,6 +17257,7 @@ const Panel = React.forwardRef((props, ref) => {
|
|
|
17218
17257
|
anchor: drawerAnchor,
|
|
17219
17258
|
variant: drawerVariant,
|
|
17220
17259
|
width: drawerWidth,
|
|
17260
|
+
transitionDuration,
|
|
17221
17261
|
ModalProps: _objectSpread2(_objectSpread2({}, ModalProps), {}, {
|
|
17222
17262
|
disableEnforceFocus: true,
|
|
17223
17263
|
disableScrollLock: true
|
|
@@ -17429,7 +17469,6 @@ const TableRow = forwardRef((props, ref) => {
|
|
|
17429
17469
|
const { children, shouldShowTooltipOnHover = true, tooltipProps, tooltipText = false, tooltipSubtitle, hover = true } = props;
|
|
17430
17470
|
if (shouldShowTooltipOnHover && hover) return /* @__PURE__ */ jsx(Tooltip, _objectSpread2(_objectSpread2({
|
|
17431
17471
|
arrow: true,
|
|
17432
|
-
sdsStyle: "dark",
|
|
17433
17472
|
subtitle: tooltipSubtitle,
|
|
17434
17473
|
title: tooltipText
|
|
17435
17474
|
}, tooltipProps), {}, { children: /* @__PURE__ */ jsx(StyledTableRow, _objectSpread2(_objectSpread2({ ref }, props), {}, { children })) }));
|
|
@@ -18340,7 +18379,8 @@ const Tabs = forwardRef(function Tabs(props, ref) {
|
|
|
18340
18379
|
value: contextValue,
|
|
18341
18380
|
children: /* @__PURE__ */ jsx(StyledTabs, _objectSpread2({
|
|
18342
18381
|
slotProps: { indicator: indicatorProps },
|
|
18343
|
-
ref
|
|
18382
|
+
ref,
|
|
18383
|
+
sdsSize
|
|
18344
18384
|
}, rest))
|
|
18345
18385
|
});
|
|
18346
18386
|
});
|