@czi-sds/components 22.3.0 → 22.3.1
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/dist/index.cjs.d.ts +36 -30
- package/dist/index.cjs.js +69 -41
- package/dist/index.esm.d.ts +36 -30
- package/dist/index.esm.js +70 -42
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { forwardRef, useEffect, useRef, useState, useCallback, createElement, useMemo, createContext, memo, Fragment as Fragment$1, useContext } from 'react';
|
|
5
5
|
import { css, ThemeContext as ThemeContext$1 } from '@emotion/react';
|
|
6
|
-
import { createTheme as createTheme$2, AccordionDetails as AccordionDetails$1, AccordionSummary, accordionSummaryClasses, SvgIcon, Accordion as Accordion$1, accordionClasses, accordionDetailsClasses, Alert as Alert$2, Button as Button$1, buttonClasses, IconButton, TextField, outlinedInputClasses, inputBaseClasses, buttonBaseClasses, inputAdornmentClasses, InputAdornment, MenuItem as MenuItem$1, menuItemClasses, Autocomplete as Autocomplete$1, autocompleteClasses, Paper, useTheme as useTheme$4, Popper, ClickAwayListener, alertClasses, alertTitleClasses, AlertTitle, Grow, Tooltip as Tooltip$1, Chip as Chip$1, darken as darken$1, Card,
|
|
6
|
+
import { createTheme as createTheme$2, AccordionDetails as AccordionDetails$1, AccordionSummary, accordionSummaryClasses, SvgIcon, Accordion as Accordion$1, accordionClasses, accordionDetailsClasses, Alert as Alert$2, Button as Button$1, buttonClasses, IconButton, TextField, outlinedInputClasses, inputBaseClasses, buttonBaseClasses, inputAdornmentClasses, InputAdornment, MenuItem as MenuItem$1, menuItemClasses, Autocomplete as Autocomplete$1, autocompleteClasses, Paper, useTheme as useTheme$4, Popper, ClickAwayListener, alertClasses, alertTitleClasses, AlertTitle, Grow, Tooltip as Tooltip$1, Chip as Chip$1, darken as darken$1, Card, CardContent, styled as styled$3, CardActions, css as css$2, CardMedia, Dialog as Dialog$1, DialogActions as DialogActions$1, dialogActionsClasses, DialogContent, DialogTitle as DialogTitle$1, Typography, Checkbox, checkboxClasses, FormControlLabel, Radio, radioClasses, Slider, sliderClasses, Switch, switchClasses, Link as Link$1, List as List$1, ListItem as ListItem$1, ListSubheader as ListSubheader$1, Menu as Menu$1, menuClasses, Divider, useMediaQuery, AppBar, Toolbar, Drawer, Tabs as Tabs$1, tabsClasses, Tab as Tab$1, Slide, Box as Box$1, drawerClasses, ToggleButtonGroup, toggleButtonClasses, ToggleButton, TableCell, TableContainer, Table as Table$1, TableBody, TableRow as TableRow$1 } from '@mui/material';
|
|
7
7
|
export { CardMedia as ContentCardMedia } from '@mui/material';
|
|
8
8
|
import styled$2 from '@emotion/styled';
|
|
9
9
|
import { Check, Remove, Clear } from '@mui/icons-material';
|
|
@@ -6878,6 +6878,9 @@ var doNotForwardProps$o = [
|
|
|
6878
6878
|
"buttonsPosition",
|
|
6879
6879
|
"clickableCard",
|
|
6880
6880
|
"imageSize",
|
|
6881
|
+
"clickableCardProps",
|
|
6882
|
+
"cardSdsType",
|
|
6883
|
+
"classes",
|
|
6881
6884
|
];
|
|
6882
6885
|
var StyledCard = styled$2(Card, {
|
|
6883
6886
|
shouldForwardProp: function (prop) { return !doNotForwardProps$o.includes(prop); },
|
|
@@ -6895,24 +6898,25 @@ var StyledCard = styled$2(Card, {
|
|
|
6895
6898
|
var showDecorativeBorder = visualElementType === "image"
|
|
6896
6899
|
? boundingBox && decorativeBorder && imagePadding
|
|
6897
6900
|
: boundingBox && decorativeBorder;
|
|
6898
|
-
return css(templateObject_4$g || (templateObject_4$g = __makeTemplateObject(["\n display: flex;\n background-color: ", ";\n flex-direction: ", ";\n box-shadow: none;\n\n .MuiCardActionArea-focusHighlight {\n background: transparent;\n }\n\n ", "\n\n ", "\n\n ", "\n "], ["\n display: flex;\n background-color: ", ";\n flex-direction: ", ";\n box-shadow: none;\n\n .MuiCardActionArea-focusHighlight {\n background: transparent;\n }\n\n ", "\n\n ", "\n\n ", "\n "])), (_a = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.base) === null || _a === void 0 ? void 0 : _a.backgroundPrimary, flexDirection, boundingBox && css(templateObject_1$I || (templateObject_1$I = __makeTemplateObject(["\n border: 1px solid ", ";\n "], ["\n border: 1px solid ", ";\n "])), (_b = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.base) === null || _b === void 0 ? void 0 : _b.borderSecondary), sdsType === "wide" &&
|
|
6901
|
+
return css(templateObject_4$g || (templateObject_4$g = __makeTemplateObject(["\n display: flex;\n background-color: ", ";\n flex-direction: ", ";\n box-shadow: none;\n overflow: visible;\n\n .MuiCardActionArea-focusHighlight {\n background: transparent;\n }\n\n ", "\n\n ", "\n\n ", "\n "], ["\n display: flex;\n background-color: ", ";\n flex-direction: ", ";\n box-shadow: none;\n overflow: visible;\n\n .MuiCardActionArea-focusHighlight {\n background: transparent;\n }\n\n ", "\n\n ", "\n\n ", "\n "])), (_a = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.base) === null || _a === void 0 ? void 0 : _a.backgroundPrimary, flexDirection, boundingBox && css(templateObject_1$I || (templateObject_1$I = __makeTemplateObject(["\n border: 1px solid ", ";\n "], ["\n border: 1px solid ", ";\n "])), (_b = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.base) === null || _b === void 0 ? void 0 : _b.borderSecondary), sdsType === "wide" &&
|
|
6899
6902
|
showDecorativeBorder && css(templateObject_2$r || (templateObject_2$r = __makeTemplateObject(["\n border-left: 4px solid ", ";\n "], ["\n border-left: 4px solid ", ";\n "])), (_c = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.accent) === null || _c === void 0 ? void 0 : _c.border), sdsType === "narrow" &&
|
|
6900
6903
|
showDecorativeBorder && css(templateObject_3$j || (templateObject_3$j = __makeTemplateObject(["\n border-top: 4px solid ", ";\n "], ["\n border-top: 4px solid ", ";\n "])), (_d = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.accent) === null || _d === void 0 ? void 0 : _d.border));
|
|
6901
6904
|
});
|
|
6902
|
-
var StyledCardActionArea = styled$2(
|
|
6905
|
+
var StyledCardActionArea = styled$2(Button, {
|
|
6903
6906
|
shouldForwardProp: function (prop) { return !doNotForwardProps$o.includes(prop); },
|
|
6904
6907
|
})(templateObject_6$a || (templateObject_6$a = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
6905
6908
|
var _a, _b;
|
|
6906
|
-
var _c = props.imagePosition, imagePosition = _c === void 0 ? "left" : _c, _d = props.
|
|
6909
|
+
var _c = props.imagePosition, imagePosition = _c === void 0 ? "left" : _c, _d = props.cardSdsType, cardSdsType = _d === void 0 ? "wide" : _d, visualElementType = props.visualElementType;
|
|
6907
6910
|
var semanticColors = getSemanticColors(props);
|
|
6908
|
-
var
|
|
6911
|
+
var shadows = getShadows(props);
|
|
6912
|
+
var flexDirection = cardSdsType === "wide"
|
|
6909
6913
|
? imagePosition === "left"
|
|
6910
6914
|
? "row"
|
|
6911
6915
|
: "row-reverse"
|
|
6912
6916
|
: visualElementType === "image"
|
|
6913
6917
|
? "column"
|
|
6914
6918
|
: "row";
|
|
6915
|
-
return "\n display: flex;\n flex-direction: ".concat(flexDirection, ";\n align-items: unset;\n\n background-color: ").concat((_a = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.base) === null || _a === void 0 ? void 0 : _a.backgroundPrimary, ";\n\n &:hover,\n &:active {\n background-color: ").concat((_b = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.base) === null || _b === void 0 ? void 0 : _b.
|
|
6919
|
+
return "\n display: flex;\n flex-direction: ".concat(flexDirection, ";\n align-items: unset;\n height: 100%;\n padding: 0;\n margin: 0;\n overflow: scroll;\n text-align: unset;\n\n background-color: ").concat((_a = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.base) === null || _a === void 0 ? void 0 : _a.backgroundPrimary, ";\n\n &:hover,\n &:active {\n background-color: ").concat((_b = semanticColors === null || semanticColors === void 0 ? void 0 : semanticColors.base) === null || _b === void 0 ? void 0 : _b.surface, ";\n box-shadow: ").concat(shadows === null || shadows === void 0 ? void 0 : shadows.l, " !important;\n }\n ");
|
|
6916
6920
|
});
|
|
6917
6921
|
var StyledIconMediaWrapper = styled$2("div", {
|
|
6918
6922
|
shouldForwardProp: function (prop) { return !doNotForwardProps$o.includes(prop); },
|
|
@@ -6925,9 +6929,9 @@ var StyledIconMediaWrapper = styled$2("div", {
|
|
|
6925
6929
|
var StyledCardContent = styled$2("div", {
|
|
6926
6930
|
shouldForwardProp: function (prop) { return !doNotForwardProps$o.includes(prop); },
|
|
6927
6931
|
})(templateObject_13$2 || (templateObject_13$2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
6928
|
-
var _a = props.boundingBox, boundingBox = _a === void 0 ? true : _a
|
|
6932
|
+
var _a = props.boundingBox, boundingBox = _a === void 0 ? true : _a;
|
|
6929
6933
|
var spaces = getSpaces(props);
|
|
6930
|
-
return css(templateObject_12$2 || (templateObject_12$2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n
|
|
6934
|
+
return css(templateObject_12$2 || (templateObject_12$2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n min-width: 100px;\n width: 100%;\n\n ", "\n "], ["\n display: flex;\n flex-direction: column;\n min-width: 100px;\n width: 100%;\n\n ", "\n "])), boundingBox && css(templateObject_11$2 || (templateObject_11$2 = __makeTemplateObject(["\n padding: ", "px;\n "], ["\n padding: ", "px;\n "])), spaces === null || spaces === void 0 ? void 0 : spaces.xl));
|
|
6931
6935
|
});
|
|
6932
6936
|
var StyledContentCardBody = styled$2(CardContent, {
|
|
6933
6937
|
shouldForwardProp: function (prop) { return !doNotForwardProps$o.includes(prop); },
|
|
@@ -6992,8 +6996,9 @@ var templateObject_1$H, templateObject_2$q, templateObject_3$i, templateObject_4
|
|
|
6992
6996
|
* @see https://mui.com/material-ui/react-dialog/
|
|
6993
6997
|
*/
|
|
6994
6998
|
var ContentCardTitle = forwardRef(function ContentCardTitle(props, ref) {
|
|
6995
|
-
var overlineText = props.overlineText, titleText = props.titleText, subtitleText = props.subtitleText, metadataText = props.metadataText;
|
|
6996
|
-
|
|
6999
|
+
var overlineText = props.overlineText, titleText = props.titleText, subtitleText = props.subtitleText, metadataText = props.metadataText, _a = props.classes, classes = _a === void 0 ? EMPTY_OBJECT : _a;
|
|
7000
|
+
var cardHeader = classes.cardHeader, cardOverline = classes.cardOverline, cardTitle = classes.cardTitle, cardSubtitle = classes.cardSubtitle, cardMetadata = classes.cardMetadata;
|
|
7001
|
+
return (jsxs("div", { ref: ref, children: [jsxs(StyledTitleWrapper, { className: cardHeader, children: [overlineText && (jsx(StyledOverlineText, { className: cardOverline, children: overlineText })), titleText && (jsx(StyledTitleText, { className: cardTitle, children: titleText })), subtitleText && (jsx(StyledSubtitleText, { className: cardSubtitle, children: subtitleText }))] }), metadataText && (jsx(StyledMetadataText, { className: cardMetadata, children: metadataText }))] }));
|
|
6997
7002
|
});
|
|
6998
7003
|
|
|
6999
7004
|
var doNotForwardProps$m = ["buttonsPosition"];
|
|
@@ -7019,7 +7024,8 @@ var isButtonElement = function (child) {
|
|
|
7019
7024
|
* @see https://mui.com/material-ui/api/card-actions/
|
|
7020
7025
|
*/
|
|
7021
7026
|
var ContentCardActions = forwardRef(function ContentCardActions(props, ref) {
|
|
7022
|
-
var buttonsPosition = props.buttonsPosition, clickableCard = props.clickableCard, children = props.children;
|
|
7027
|
+
var buttonsPosition = props.buttonsPosition, clickableCard = props.clickableCard, children = props.children, _a = props.classes, classes = _a === void 0 ? EMPTY_OBJECT : _a;
|
|
7028
|
+
var cardActions = classes.cardActions;
|
|
7023
7029
|
/**
|
|
7024
7030
|
* (masoudmanson):
|
|
7025
7031
|
* We need to ensure that only SDS buttons are used within the
|
|
@@ -7047,11 +7053,11 @@ var ContentCardActions = forwardRef(function ContentCardActions(props, ref) {
|
|
|
7047
7053
|
if (!clickableCardButton) {
|
|
7048
7054
|
return null;
|
|
7049
7055
|
}
|
|
7050
|
-
return (jsx(StyledCardActions, { ref: ref, buttonsPosition: buttonsPosition, children: [
|
|
7051
|
-
React__default.cloneElement(clickableCardButton, __assign({ component: "
|
|
7056
|
+
return (jsx(StyledCardActions, { ref: ref, buttonsPosition: buttonsPosition, className: cardActions, children: [
|
|
7057
|
+
React__default.cloneElement(clickableCardButton, __assign({ component: "div" }, clickableCardButton === null || clickableCardButton === void 0 ? void 0 : clickableCardButton.props)),
|
|
7052
7058
|
] }));
|
|
7053
7059
|
}
|
|
7054
|
-
return (jsx(StyledCardActions, { ref: ref, buttonsPosition: buttonsPosition, children: validChildren }));
|
|
7060
|
+
return (jsx(StyledCardActions, { ref: ref, buttonsPosition: buttonsPosition, className: cardActions, children: validChildren }));
|
|
7055
7061
|
});
|
|
7056
7062
|
|
|
7057
7063
|
var doNotForwardProps$l = [
|
|
@@ -7085,7 +7091,7 @@ var templateObject_1$F, templateObject_2$p, templateObject_3$h, templateObject_4
|
|
|
7085
7091
|
* @see https://mui.com/material-ui/api/card-media/
|
|
7086
7092
|
*/
|
|
7087
7093
|
var ContentCardImageMedia = forwardRef(function ContentCardImageMedia(props, ref) {
|
|
7088
|
-
var image = props.image, imageSize = props.imageSize, sdsType = props.sdsType;
|
|
7094
|
+
var image = props.image, imageSize = props.imageSize, sdsType = props.sdsType, className = props.className;
|
|
7089
7095
|
/**
|
|
7090
7096
|
* (masoudmanson): These styles makes the image responsive and
|
|
7091
7097
|
* ensures the image is the right aspect ratio in different card sizes.
|
|
@@ -7102,12 +7108,16 @@ var ContentCardImageMedia = forwardRef(function ContentCardImageMedia(props, ref
|
|
|
7102
7108
|
* (masoudmanson): We need to make sure the image is wrapped in a CardMedia component.
|
|
7103
7109
|
* - If it's a string, wrap it in CardMedia with proper styles.
|
|
7104
7110
|
* - If it's already a CardMedia component, clone it and apply the styles.
|
|
7111
|
+
* - If it's a valid element, clone it and apply the styles.
|
|
7112
|
+
* - If it's null, return null.
|
|
7105
7113
|
*/
|
|
7106
7114
|
var imageElement = typeof image === "string" ? (jsx(CardMedia, { component: "img", src: image, alt: "Content Card Media", sx: __assign({}, imageMediaStyles) })) : React__default.isValidElement(image) && image.type === CardMedia ? (React__default.cloneElement(image, {
|
|
7107
7115
|
component: "img",
|
|
7108
7116
|
sx: __assign(__assign({}, image.props.sx), imageMediaStyles),
|
|
7117
|
+
})) : React__default.isValidElement(image) ? (React__default.cloneElement(image, {
|
|
7118
|
+
style: __assign(__assign({}, imageMediaStyles), { objectFit: "cover", objectPosition: "center" }),
|
|
7109
7119
|
})) : null;
|
|
7110
|
-
return (jsx(StyledImageMediaWrapper, __assign({ ref: ref }, props, { children: imageElement })));
|
|
7120
|
+
return (jsx(StyledImageMediaWrapper, __assign({ ref: ref }, props, { className: className, children: imageElement })));
|
|
7111
7121
|
});
|
|
7112
7122
|
|
|
7113
7123
|
var CONTENT_CARD_DEFAULT_IMAGE_MEDIA_SIZE = 300;
|
|
@@ -7135,10 +7145,10 @@ var useResponsiveWidth = function (initialSdsType) {
|
|
|
7135
7145
|
* (masoudmanson): This function is used to add the clickableCard and
|
|
7136
7146
|
* buttonsPosition props to the ContentCardActions sub-component.
|
|
7137
7147
|
*/
|
|
7138
|
-
var enhanceChildrenWithCardActionsProps = function (children, clickableCard, buttonsPosition) {
|
|
7148
|
+
var enhanceChildrenWithCardActionsProps = function (children, clickableCard, buttonsPosition, classes) {
|
|
7139
7149
|
return React__default.Children.map(children, function (child) {
|
|
7140
7150
|
if (React__default.isValidElement(child) && child.type === ContentCardActions) {
|
|
7141
|
-
return React__default.cloneElement(child, __assign(__assign({}, child.props), { buttonsPosition: buttonsPosition, clickableCard: clickableCard }));
|
|
7151
|
+
return React__default.cloneElement(child, __assign(__assign({}, child.props), { buttonsPosition: buttonsPosition, classes: classes, clickableCard: clickableCard }));
|
|
7142
7152
|
}
|
|
7143
7153
|
return child;
|
|
7144
7154
|
});
|
|
@@ -7147,11 +7157,12 @@ var enhanceChildrenWithCardActionsProps = function (children, clickableCard, but
|
|
|
7147
7157
|
* @see https://mui.com/material-ui/react-card/
|
|
7148
7158
|
*/
|
|
7149
7159
|
var ContentCard = React__default.forwardRef(function (props, ref) {
|
|
7150
|
-
var _a = props.visualElementType, visualElementType = _a === void 0 ? "none" : _a, image = props.image, icon = props.icon, _b = props.imagePadding, imagePadding = _b === void 0 ? false : _b, _c = props.imageSize, imageSize = _c === void 0 ? CONTENT_CARD_DEFAULT_IMAGE_MEDIA_SIZE : _c, overlineText = props.overlineText, titleText = props.titleText, subtitleText = props.subtitleText, metadataText = props.metadataText, _d = props.boundingBox, propsBoundingBox = _d === void 0 ? true : _d, children = props.children, _e = props.sdsType, sdsType = _e === void 0 ? "wide" : _e, _f = props.clickableCard, clickableCard = _f === void 0 ? false : _f, _g = props.imagePosition, imagePosition = _g === void 0 ? "left" : _g, _h = props.buttonsPosition, buttonsPosition = _h === void 0 ? "left" : _h;
|
|
7160
|
+
var _a = props.visualElementType, visualElementType = _a === void 0 ? "none" : _a, image = props.image, icon = props.icon, _b = props.imagePadding, imagePadding = _b === void 0 ? false : _b, _c = props.imageSize, imageSize = _c === void 0 ? CONTENT_CARD_DEFAULT_IMAGE_MEDIA_SIZE : _c, overlineText = props.overlineText, titleText = props.titleText, subtitleText = props.subtitleText, metadataText = props.metadataText, _d = props.boundingBox, propsBoundingBox = _d === void 0 ? true : _d, children = props.children, _e = props.sdsType, sdsType = _e === void 0 ? "wide" : _e, _f = props.clickableCard, clickableCard = _f === void 0 ? false : _f, _g = props.imagePosition, imagePosition = _g === void 0 ? "left" : _g, _h = props.buttonsPosition, buttonsPosition = _h === void 0 ? "left" : _h, clickableCardProps = props.clickableCardProps, _j = props.classes, classes = _j === void 0 ? EMPTY_OBJECT : _j;
|
|
7161
|
+
var cardMedia = classes.cardMedia, cardContent = classes.cardContent, cardHeader = classes.cardHeader, cardMetadata = classes.cardMetadata, cardOverline = classes.cardOverline, cardSubtitle = classes.cardSubtitle, cardTitle = classes.cardTitle, cardActions = classes.cardActions, cardPaper = classes.cardPaper, clickableCardButton = classes.clickableCardButton;
|
|
7151
7162
|
// Force boundingBox to be true when clickableCard is true
|
|
7152
7163
|
var boundingBox = clickableCard ? true : propsBoundingBox;
|
|
7153
7164
|
var cardRef = useRef(null);
|
|
7154
|
-
var
|
|
7165
|
+
var _k = useResponsiveWidth(sdsType), handleResize = _k.handleResize, dynamicSdsType = _k.dynamicSdsType;
|
|
7155
7166
|
useEffect(function () {
|
|
7156
7167
|
var element = cardRef.current;
|
|
7157
7168
|
if (!element)
|
|
@@ -7167,9 +7178,17 @@ var ContentCard = React__default.forwardRef(function (props, ref) {
|
|
|
7167
7178
|
resizeObserver.disconnect();
|
|
7168
7179
|
};
|
|
7169
7180
|
}, [handleResize]);
|
|
7170
|
-
var visualElement = visualElementType === "image" && image ? (jsx(ContentCardImageMedia, { imagePadding: imagePadding, boundingBox: boundingBox, sdsType: dynamicSdsType, imageSize: imageSize, image: image, imagePosition: imagePosition })) : visualElementType === "icon" && icon ? (jsx(StyledIconMediaWrapper, { boundingBox: boundingBox, children: icon })) : null;
|
|
7171
|
-
var cardInnerContent = (jsxs(Fragment, { children: [visualElement, jsxs(StyledCardContent, { boundingBox: boundingBox, clickableCard: clickableCard, children: [jsx(ContentCardTitle, { overlineText: overlineText, titleText: titleText, subtitleText: subtitleText, metadataText: metadataText
|
|
7172
|
-
|
|
7181
|
+
var visualElement = visualElementType === "image" && image ? (jsx(ContentCardImageMedia, { imagePadding: imagePadding, boundingBox: boundingBox, sdsType: dynamicSdsType, imageSize: imageSize, image: image, imagePosition: imagePosition, className: cardMedia })) : visualElementType === "icon" && icon ? (jsx(StyledIconMediaWrapper, { boundingBox: boundingBox, className: cardMedia, children: icon })) : null;
|
|
7182
|
+
var cardInnerContent = (jsxs(Fragment, { children: [visualElement, jsxs(StyledCardContent, { boundingBox: boundingBox, clickableCard: clickableCard, className: cardContent, children: [jsx(ContentCardTitle, { overlineText: overlineText, titleText: titleText, subtitleText: subtitleText, metadataText: metadataText, classes: {
|
|
7183
|
+
cardHeader: cardHeader,
|
|
7184
|
+
cardMetadata: cardMetadata,
|
|
7185
|
+
cardOverline: cardOverline,
|
|
7186
|
+
cardSubtitle: cardSubtitle,
|
|
7187
|
+
cardTitle: cardTitle,
|
|
7188
|
+
} }), jsx(StyledCardContentAligner, { children: enhanceChildrenWithCardActionsProps(children, clickableCard, buttonsPosition, {
|
|
7189
|
+
cardActions: cardActions,
|
|
7190
|
+
}) })] })] }));
|
|
7191
|
+
return (jsx(StyledCard, __assign({ ref: mergeRefs([ref, cardRef]) }, props, { sdsType: dynamicSdsType, boundingBox: boundingBox, className: cardPaper, children: clickableCard ? (jsx(StyledCardActionArea, __assign({ sdsStyle: "minimal", cardSdsType: dynamicSdsType, visualElementType: visualElementType, imagePosition: imagePosition, className: clickableCardButton }, clickableCardProps, { children: cardInnerContent }))) : (cardInnerContent) })));
|
|
7173
7192
|
});
|
|
7174
7193
|
|
|
7175
7194
|
var DialogContext = createContext({ sdsSize: "m" });
|
|
@@ -14273,6 +14292,8 @@ var doNotForwardProps$9 = [
|
|
|
14273
14292
|
"isNarrow",
|
|
14274
14293
|
"primaryNavPosition",
|
|
14275
14294
|
"showSearch",
|
|
14295
|
+
"logoLinkComponent",
|
|
14296
|
+
"logoLinkProps",
|
|
14276
14297
|
];
|
|
14277
14298
|
var StyledHeader = styled$2(AppBar, {
|
|
14278
14299
|
shouldForwardProp: function (prop) { return !doNotForwardProps$9.includes(prop); },
|
|
@@ -14519,7 +14540,7 @@ var NarrowStyledTextItem = function (props) {
|
|
|
14519
14540
|
};
|
|
14520
14541
|
var StyledTextItem = styled$2(Button, {
|
|
14521
14542
|
shouldForwardProp: function (prop) { return !ButtonDoNotForwardProps.includes(prop); },
|
|
14522
|
-
})(templateObject_3$4 || (templateObject_3$4 = __makeTemplateObject(["\n ", "\n\n background: none;\n justify-content: flex-start;\n min-height: 44px;\n width:
|
|
14543
|
+
})(templateObject_3$4 || (templateObject_3$4 = __makeTemplateObject(["\n ", "\n\n background: none;\n justify-content: flex-start;\n min-height: 44px;\n width: fit-content;\n min-width: unset;\n\n ", "\n"], ["\n ", "\n\n background: none;\n justify-content: flex-start;\n min-height: 44px;\n width: fit-content;\n min-width: unset;\n\n ", "\n"])), fontHeaderS, function (props) {
|
|
14523
14544
|
var _a, _b;
|
|
14524
14545
|
var hasInvertedStyle = props.hasInvertedStyle, open = props.open, isNarrow = props.isNarrow;
|
|
14525
14546
|
var semanticColors = getSemanticColors(props);
|
|
@@ -14545,7 +14566,7 @@ var StyledTextItem = styled$2(Button, {
|
|
|
14545
14566
|
var doNotForwardProps$6 = ["hasInvertedStyle", "isNarrow"];
|
|
14546
14567
|
var StyledAccordion = styled$2(Accordion, {
|
|
14547
14568
|
shouldForwardProp: function (prop) { return !doNotForwardProps$6.includes(prop); },
|
|
14548
|
-
})(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject(["\n width:
|
|
14569
|
+
})(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject(["\n width: fit-content;\n min-width: unset;\n\n .MuiAccordionDetails-root .MuiButtonBase-root .primary-text {\n ", "\n }\n\n ", "\n"], ["\n width: fit-content;\n min-width: unset;\n\n .MuiAccordionDetails-root .MuiButtonBase-root .primary-text {\n ", "\n }\n\n ", "\n"])), fontBodyS$1, function (props) {
|
|
14549
14570
|
var _a, _b;
|
|
14550
14571
|
var hasInvertedStyle = props.hasInvertedStyle, isNarrow = props.isNarrow;
|
|
14551
14572
|
var spaces = getSpaces(props);
|
|
@@ -14579,7 +14600,7 @@ var StyledSubItem = styled$2(MenuItem)(templateObject_7 || (templateObject_7 = _
|
|
|
14579
14600
|
var templateObject_1$g, templateObject_2$9, templateObject_3$4, templateObject_4$3, templateObject_5$2, templateObject_6$1, templateObject_7;
|
|
14580
14601
|
|
|
14581
14602
|
function SecondaryNavItem(_a) {
|
|
14582
|
-
var item = _a.item, hasInvertedStyle = _a.hasInvertedStyle, isNarrow = _a.isNarrow;
|
|
14603
|
+
var item = _a.item, hasInvertedStyle = _a.hasInvertedStyle, isNarrow = _a.isNarrow, rest = __rest(_a, ["item", "hasInvertedStyle", "isNarrow"]);
|
|
14583
14604
|
var _b = useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
14584
14605
|
var open = Boolean(anchorEl);
|
|
14585
14606
|
function onClose() {
|
|
@@ -14594,32 +14615,39 @@ function SecondaryNavItem(_a) {
|
|
|
14594
14615
|
}
|
|
14595
14616
|
setMenuWidth(button.offsetWidth);
|
|
14596
14617
|
}, []);
|
|
14597
|
-
return (jsxs(Fragment$1, { children: [item.
|
|
14598
|
-
|
|
14599
|
-
|
|
14600
|
-
|
|
14601
|
-
|
|
14602
|
-
|
|
14603
|
-
|
|
14604
|
-
|
|
14605
|
-
|
|
14618
|
+
return (jsxs(Fragment$1, { children: [item.itemType === "text" && (jsx(StyledTextItem, __assign({ sdsStyle: "minimal", onClick: item.onClick, hasInvertedStyle: hasInvertedStyle, open: open, isNarrow: isNarrow }, rest, { children: item.label }))), item.itemType === "dropdown" && !isNarrow && (jsxs(Fragment, { children: [jsxs(StyledTextItem, { sdsStyle: "minimal", ref: buttonRef, onClick: function (event) { return setAnchorEl(event.currentTarget); }, hasInvertedStyle: hasInvertedStyle, open: open, isNarrow: isNarrow, children: [jsx("span", { children: item.label }), jsx(Icon, { sdsIcon: open ? "ChevronUp" : "ChevronDown", sdsSize: "xs" })] }), jsx(Menu, { anchorEl: anchorEl, open: open, onClose: onClose, children: item.items.map(function (subItem) {
|
|
14619
|
+
var label = subItem.label, onClick = subItem.onClick, subItemRest = __rest(subItem, ["label", "onClick"]);
|
|
14620
|
+
return (jsx(MenuItem, __assign({ onClick: function () {
|
|
14621
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
14622
|
+
onClose();
|
|
14623
|
+
} }, subItemRest, { children: label }), label));
|
|
14624
|
+
}) })] })), item.itemType === "dropdown" && isNarrow && (jsxs(StyledAccordion, { id: "".concat(item.label, "-dropdown"), hasInvertedStyle: hasInvertedStyle, isNarrow: isNarrow, children: [jsx(AccordionHeader, { children: item.label }), jsx(AccordionDetails, { children: item.items.map(function (subItem) {
|
|
14625
|
+
var label = subItem.label, onClick = subItem.onClick, accordionSubItemRest = __rest(subItem, ["label", "onClick"]);
|
|
14626
|
+
return (jsx(StyledSubItem, __assign({ onClick: function () {
|
|
14627
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
14628
|
+
onClose();
|
|
14629
|
+
}, sx: { width: menuWidth } }, accordionSubItemRest, { children: label }), label));
|
|
14630
|
+
}) })] }))] }, item.label));
|
|
14606
14631
|
}
|
|
14607
14632
|
function NavigationHeaderSecondaryNav(_a) {
|
|
14608
14633
|
var items = _a.items, hasInvertedStyle = _a.hasInvertedStyle, isNarrow = _a.isNarrow;
|
|
14609
|
-
return (jsx(StyledSection, { gap: "l", isNarrow: isNarrow, children: items.map(function (item) {
|
|
14634
|
+
return (jsx(StyledSection, { gap: "l", isNarrow: isNarrow, children: items.map(function (item) {
|
|
14635
|
+
var itemType = item.itemType, label = item.label, rest = __rest(item, ["itemType", "label"]);
|
|
14636
|
+
return (jsx(SecondaryNavItem, __assign({ item: item, hasInvertedStyle: hasInvertedStyle, isNarrow: isNarrow }, rest), "".concat(label, "-").concat(itemType)));
|
|
14637
|
+
}) }));
|
|
14610
14638
|
}
|
|
14611
14639
|
|
|
14612
14640
|
var NavigationHeader = forwardRef(function (props, ref) {
|
|
14613
|
-
var activePrimaryNavKey = props.activePrimaryNavKey, buttons = props.buttons, hasInvertedStyle = props.hasInvertedStyle, logo = props.logo, logoUrl = props.logoUrl, primaryNavItems = props.primaryNavItems,
|
|
14641
|
+
var activePrimaryNavKey = props.activePrimaryNavKey, buttons = props.buttons, hasInvertedStyle = props.hasInvertedStyle, logo = props.logo, logoUrl = props.logoUrl, _a = props.logoLinkComponent, logoLinkComponent = _a === void 0 ? "a" : _a, logoLinkProps = props.logoLinkProps, primaryNavItems = props.primaryNavItems, _b = props.primaryNavPosition, primaryNavPosition = _b === void 0 ? "left" : _b, searchProps = props.searchProps, secondaryNavItems = props.secondaryNavItems, setActivePrimaryNavKey = props.setActivePrimaryNavKey, _c = props.showSearch, showSearch = _c === void 0 ? true : _c, tag = props.tag, tagColor = props.tagColor, title = props.title, rest = __rest(props, ["activePrimaryNavKey", "buttons", "hasInvertedStyle", "logo", "logoUrl", "logoLinkComponent", "logoLinkProps", "primaryNavItems", "primaryNavPosition", "searchProps", "secondaryNavItems", "setActivePrimaryNavKey", "showSearch", "tag", "tagColor", "title"]);
|
|
14614
14642
|
var navRef = useRef(null);
|
|
14615
14643
|
var theme = useTheme();
|
|
14616
14644
|
var isMdScreen = useMediaQuery(theme.breakpoints.down("md"));
|
|
14617
14645
|
useEffect(function () {
|
|
14618
14646
|
setIsNarrow(isMdScreen);
|
|
14619
14647
|
}, [isMdScreen]);
|
|
14620
|
-
var
|
|
14621
|
-
var
|
|
14622
|
-
var
|
|
14648
|
+
var _d = useState(true), drawerOpen = _d[0], setDrawerOpen = _d[1];
|
|
14649
|
+
var _e = useState(isMdScreen), isNarrow = _e[0], setIsNarrow = _e[1];
|
|
14650
|
+
var _f = useState(0), breakpoint = _f[0], setBreakpoint = _f[1];
|
|
14623
14651
|
var checkScrollable = useCallback(function () {
|
|
14624
14652
|
if (!navRef.current)
|
|
14625
14653
|
return;
|
|
@@ -14644,8 +14672,8 @@ var NavigationHeader = forwardRef(function (props, ref) {
|
|
|
14644
14672
|
};
|
|
14645
14673
|
var renderLogoNode = function () {
|
|
14646
14674
|
var logoNode = (jsxs(StyledTitleContainer, { hasInvertedStyle: hasInvertedStyle, isNarrow: isNarrow, children: [jsx(StyledLogoWrapper, { children: logo }), jsx("p", { children: title }), tag && jsx(StyledTag, { color: tagColor, label: tag, hover: false })] }));
|
|
14647
|
-
if (logoUrl) {
|
|
14648
|
-
logoNode = (jsx(StyledLogoLinkWrapper, { href: logoUrl, isNarrow: isNarrow, children: logoNode }));
|
|
14675
|
+
if (logoLinkComponent || logoUrl) {
|
|
14676
|
+
logoNode = (jsx(StyledLogoLinkWrapper, __assign({ component: logoLinkComponent, href: logoUrl }, logoLinkProps, { isNarrow: isNarrow, children: logoNode })));
|
|
14649
14677
|
}
|
|
14650
14678
|
return logoNode;
|
|
14651
14679
|
};
|