@moderneinc/design-system-components 7.5.1 → 7.5.2-next.3de710

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.js CHANGED
@@ -496,12 +496,16 @@ const StyledAlert$2 = styles.styled(Alert, {
496
496
  const messageColor = isFilled
497
497
  ? designSystemTokens.semanticColors.color.text.tooltip
498
498
  : designSystemTokens.semanticColors.color.text.primary;
499
+ // Content-box sizing adds padding on top of minHeight, not absorbed by
500
+ // it, so minHeight is reduced by the same amount here — otherwise every
501
+ // compact alert would grow by the full padding, wrapped or not.
502
+ const { verticalPadding, ...sizeStyles } = isCompact
503
+ ? { minHeight: designSystemTokens.spacing.spacing_4, verticalPadding: designSystemTokens.spacing.spacing_1_2 }
504
+ : hasChildren
505
+ ? { minHeight: designSystemTokens.spacing.spacing_8, height: 'auto', verticalPadding: designSystemTokens.spacing.spacing_1_1_2 }
506
+ : { height: designSystemTokens.spacing.spacing_8, verticalPadding: 0 };
499
507
  return {
500
- ...(isCompact
501
- ? { minHeight: designSystemTokens.spacing.spacing_5 }
502
- : hasChildren
503
- ? { minHeight: designSystemTokens.spacing.spacing_8, height: 'auto' }
504
- : { height: designSystemTokens.spacing.spacing_8 }),
508
+ ...sizeStyles,
505
509
  width: '100%',
506
510
  borderRadius: designSystemTokens.borderRadius.xS,
507
511
  alignItems: hasChildren ? 'flex-start' : 'center',
@@ -509,9 +513,7 @@ const StyledAlert$2 = styles.styled(Alert, {
509
513
  fontSize: theme.typography.pxToRem(designSystemTokens.typography.fontSize.default),
510
514
  fontWeight: designSystemTokens.typography.fontWeight.semiBold,
511
515
  lineHeight: 1.5,
512
- padding: hasChildren
513
- ? `${designSystemTokens.spacing.spacing_1_1_2}px ${designSystemTokens.spacing.spacing_2}px`
514
- : `0 ${designSystemTokens.spacing.spacing_2}px`,
516
+ padding: `${verticalPadding}px ${designSystemTokens.spacing.spacing_2}px`,
515
517
  backgroundColor: isFilled ? palette.fg : palette.bg,
516
518
  border: isFilled ? 'none' : `1px solid ${palette.tint}`,
517
519
  color: isFilled ? designSystemTokens.semanticColors.color.text.tooltip : designSystemTokens.semanticColors.color.text.primary,