@moderneinc/design-system-components 7.9.0 → 7.9.1-next.0bed09
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/Alert/Alert.d.ts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.esm.js +14 -19
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +14 -19
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -436,21 +436,26 @@ const intentColors$1 = {
|
|
|
436
436
|
info: designSystemTokens.semanticColors.color.status.info
|
|
437
437
|
};
|
|
438
438
|
const StyledAlert$2 = styles.styled(Alert, {
|
|
439
|
-
shouldForwardProp: (prop) => prop !== "intent" && prop !== "alertType" && prop !== "alertSize" && prop !== "hasChildren"
|
|
439
|
+
shouldForwardProp: (prop) => prop !== "intent" && prop !== "alertType" && prop !== "alertSize" && prop !== "hasChildren" && prop !== "messageMaxHeight"
|
|
440
440
|
})(
|
|
441
441
|
({
|
|
442
442
|
theme,
|
|
443
443
|
intent = "success",
|
|
444
444
|
alertType = "outlined",
|
|
445
445
|
alertSize = "default",
|
|
446
|
-
hasChildren = false
|
|
446
|
+
hasChildren = false,
|
|
447
|
+
messageMaxHeight
|
|
447
448
|
}) => {
|
|
448
449
|
const palette = intentColors$1[intent];
|
|
449
450
|
const isFilled = alertType === "filled";
|
|
450
451
|
const isCompact = alertSize === "compact";
|
|
451
452
|
const iconColor = isFilled ? designSystemTokens.semanticColors.color.text.tooltip : palette.solid;
|
|
452
453
|
const messageColor = isFilled ? designSystemTokens.semanticColors.color.text.tooltip : designSystemTokens.semanticColors.color.text.primary;
|
|
453
|
-
const { verticalPadding, ...sizeStyles } = isCompact ? { minHeight: designSystemTokens.spacing.spacing_4, verticalPadding: designSystemTokens.spacing.spacing_1_2 } : hasChildren ? { minHeight: designSystemTokens.spacing.spacing_8, height: "auto", verticalPadding: designSystemTokens.spacing.spacing_1_1_2 } : {
|
|
454
|
+
const { verticalPadding, ...sizeStyles } = isCompact ? { minHeight: designSystemTokens.spacing.spacing_4, verticalPadding: designSystemTokens.spacing.spacing_1_2 } : hasChildren ? { minHeight: designSystemTokens.spacing.spacing_8, height: "auto", verticalPadding: designSystemTokens.spacing.spacing_1_1_2 } : {
|
|
455
|
+
minHeight: designSystemTokens.spacing.spacing_8,
|
|
456
|
+
boxSizing: "border-box",
|
|
457
|
+
verticalPadding: designSystemTokens.spacing.spacing_1
|
|
458
|
+
};
|
|
454
459
|
return {
|
|
455
460
|
...sizeStyles,
|
|
456
461
|
width: "100%",
|
|
@@ -477,13 +482,9 @@ const StyledAlert$2 = styles.styled(Alert, {
|
|
|
477
482
|
flex: 1,
|
|
478
483
|
display: "flex",
|
|
479
484
|
flexDirection: "column",
|
|
480
|
-
justifyContent: hasChildren ? "flex-start" : "center",
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
alignSelf: "stretch",
|
|
484
|
-
overflowY: "auto",
|
|
485
|
-
minHeight: 0
|
|
486
|
-
},
|
|
485
|
+
justifyContent: hasChildren ? "flex-start" : "safe center",
|
|
486
|
+
overflowWrap: "anywhere",
|
|
487
|
+
...messageMaxHeight !== void 0 && { maxHeight: messageMaxHeight, overflowY: "auto" },
|
|
487
488
|
"& span:last-child": {
|
|
488
489
|
fontSize: theme.typography.pxToRem(designSystemTokens.typography.fontSize.sm),
|
|
489
490
|
fontWeight: designSystemTokens.typography.fontWeight.medium,
|
|
@@ -500,15 +501,7 @@ const StyledAlert$2 = styles.styled(Alert, {
|
|
|
500
501
|
}
|
|
501
502
|
},
|
|
502
503
|
[theme.breakpoints.down("md")]: {
|
|
503
|
-
width: FILL_AVAILABLE
|
|
504
|
-
// A wrapped default alert grows instead of scrolling inside its fixed 64px.
|
|
505
|
-
...!isCompact && !hasChildren && {
|
|
506
|
-
height: "auto",
|
|
507
|
-
minHeight: designSystemTokens.spacing.spacing_8 - designSystemTokens.spacing.spacing_1_1_2 * 2,
|
|
508
|
-
paddingTop: designSystemTokens.spacing.spacing_1_1_2,
|
|
509
|
-
paddingBottom: designSystemTokens.spacing.spacing_1_1_2
|
|
510
|
-
},
|
|
511
|
-
[`& .${Alert.alertClasses.message}`]: { overflowWrap: "anywhere" }
|
|
504
|
+
width: FILL_AVAILABLE
|
|
512
505
|
}
|
|
513
506
|
};
|
|
514
507
|
}
|
|
@@ -529,6 +522,7 @@ const ModAlert = ({
|
|
|
529
522
|
icon,
|
|
530
523
|
action,
|
|
531
524
|
children,
|
|
525
|
+
maxHeight,
|
|
532
526
|
...props
|
|
533
527
|
}) => {
|
|
534
528
|
const defaultIcon = iconMap[intent];
|
|
@@ -540,6 +534,7 @@ const ModAlert = ({
|
|
|
540
534
|
alertType: type,
|
|
541
535
|
alertSize: size,
|
|
542
536
|
hasChildren: Boolean(children),
|
|
537
|
+
messageMaxHeight: maxHeight,
|
|
543
538
|
icon: icon ?? defaultIcon,
|
|
544
539
|
action,
|
|
545
540
|
children: [
|