@moderneinc/design-system-components 7.5.1-next.fef5b2 → 7.5.2-next.20bee0

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.
@@ -16,8 +16,10 @@ export interface ModAlertProps extends Omit<AlertProps, 'severity' | 'variant' |
16
16
  type?: AlertType;
17
17
  /**
18
18
  * Vertical density. `default` is page-level (64px fixed height,
19
- * supports title + description). `compact` is inline-panel use
20
- * (auto height, 40px min, single-line optimized for terse messages).
19
+ * supports title + description). `compact` is inline-panel use (auto
20
+ * height, unchanged for single-line content up to a 32px-tall `action`,
21
+ * growing with comfortable padding once the message wraps onto multiple
22
+ * lines).
21
23
  * @default "default"
22
24
  */
23
25
  size?: AlertSize;
package/dist/index.d.ts CHANGED
@@ -324,8 +324,10 @@ interface ModAlertProps extends Omit<AlertProps, 'severity' | 'variant' | 'color
324
324
  type?: AlertType;
325
325
  /**
326
326
  * Vertical density. `default` is page-level (64px fixed height,
327
- * supports title + description). `compact` is inline-panel use
328
- * (auto height, 40px min, single-line optimized for terse messages).
327
+ * supports title + description). `compact` is inline-panel use (auto
328
+ * height, unchanged for single-line content up to a 32px-tall `action`,
329
+ * growing with comfortable padding once the message wraps onto multiple
330
+ * lines).
329
331
  * @default "default"
330
332
  */
331
333
  size?: AlertSize;
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { semanticColors, spacing, typography, borderRadius, shadows, colors, semanticColorsDark, semanticTypography, height } from '@moderneinc/design-system-tokens';
2
+ import { semanticColors, spacing, typography, borderRadius, shadows, colors, semanticColorsDark, semanticTypography, iconSize, height } from '@moderneinc/design-system-tokens';
3
3
  import Box from '@mui/material/Box';
4
4
  import { styled, useTheme, alpha } from '@mui/material/styles';
5
5
  import Chip, { chipClasses } from '@mui/material/Chip';
@@ -494,12 +494,16 @@ const StyledAlert$2 = styled(Alert, {
494
494
  const messageColor = isFilled
495
495
  ? semanticColors.color.text.tooltip
496
496
  : semanticColors.color.text.primary;
497
+ // Content-box sizing adds padding on top of minHeight, not absorbed by
498
+ // it, so minHeight is reduced by the same amount here — otherwise every
499
+ // compact alert would grow by the full padding, wrapped or not.
500
+ const { verticalPadding, ...sizeStyles } = isCompact
501
+ ? { minHeight: spacing.spacing_4, verticalPadding: spacing.spacing_1_2 }
502
+ : hasChildren
503
+ ? { minHeight: spacing.spacing_8, height: 'auto', verticalPadding: spacing.spacing_1_1_2 }
504
+ : { height: spacing.spacing_8, verticalPadding: 0 };
497
505
  return {
498
- ...(isCompact
499
- ? { minHeight: spacing.spacing_5 }
500
- : hasChildren
501
- ? { minHeight: spacing.spacing_8, height: 'auto' }
502
- : { height: spacing.spacing_8 }),
506
+ ...sizeStyles,
503
507
  width: '100%',
504
508
  borderRadius: borderRadius.xS,
505
509
  alignItems: hasChildren ? 'flex-start' : 'center',
@@ -507,9 +511,7 @@ const StyledAlert$2 = styled(Alert, {
507
511
  fontSize: theme.typography.pxToRem(typography.fontSize.default),
508
512
  fontWeight: typography.fontWeight.semiBold,
509
513
  lineHeight: 1.5,
510
- padding: hasChildren
511
- ? `${spacing.spacing_1_1_2}px ${spacing.spacing_2}px`
512
- : `0 ${spacing.spacing_2}px`,
514
+ padding: `${verticalPadding}px ${spacing.spacing_2}px`,
513
515
  backgroundColor: isFilled ? palette.fg : palette.bg,
514
516
  border: isFilled ? 'none' : `1px solid ${palette.tint}`,
515
517
  color: isFilled ? semanticColors.color.text.tooltip : semanticColors.color.text.primary,
@@ -1849,7 +1851,7 @@ const IconWrapper$1 = styled('span')(({ theme }) => ({
1849
1851
  alignItems: 'center',
1850
1852
  justifyContent: 'center',
1851
1853
  flexShrink: 0,
1852
- fontSize: theme.typography.pxToRem(typography.fontSize.h4),
1854
+ fontSize: theme.typography.pxToRem(iconSize.lg),
1853
1855
  color: semanticColors.color.icon.default,
1854
1856
  }));
1855
1857
  const LabelContainer$3 = styled('div')({