@moderneinc/design-system-components 7.1.0 → 7.1.1-next.9c4186

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.esm.js CHANGED
@@ -1542,37 +1542,35 @@ const panelSurfaceStyles = {
1542
1542
  const getDataGridHeaderStyles = () => {
1543
1543
  return {
1544
1544
  // Header cell container styles - from Figma: bg, border, padding
1545
- // Height is set via density-specific selectors in DataGrid.tsx
1546
1545
  [`& .${gridClasses.columnHeader}`]: {
1547
1546
  backgroundColor: semanticColors.color.surface.dataGrid.header,
1548
1547
  borderBottom: `1px solid ${semanticColors.color.border.primary}`,
1549
- paddingTop: `${spacing.spacing_1_1_2}px`,
1550
- paddingBottom: `${spacing.spacing_1_1_2}px`,
1551
- paddingLeft: `${spacing.spacing_2}px`,
1552
- paddingRight: `${spacing.spacing_2}px`,
1548
+ paddingTop: `${spacing.spacing_1_1_4}px`,
1549
+ paddingBottom: `${spacing.spacing_1_1_4}px`,
1550
+ // WARNING: must track cell padding in DataGrid.tsx or labels sit left of
1551
+ // the column they label.
1552
+ paddingLeft: `${spacing.spacing_3}px`,
1553
+ paddingRight: `${spacing.spacing_3}px`,
1553
1554
  boxSizing: 'border-box',
1554
1555
  },
1555
1556
  // Style the filler element to match header
1556
- // Height is set via density-specific selectors in DataGrid.tsx
1557
1557
  [`& .${gridClasses.filler}`]: {
1558
1558
  backgroundColor: semanticColors.color.surface.dataGrid.header,
1559
1559
  borderBottom: `1px solid ${semanticColors.color.border.primary}`,
1560
1560
  boxSizing: 'border-box',
1561
1561
  },
1562
- // Style the default MUI column header title text to match Figma
1562
+ // NOTE: tertiary, not secondary the mock's `--muted` is text.tertiary in
1563
+ // both modes.
1563
1564
  [`& .${gridClasses.columnHeaderTitle}`]: {
1564
- fontFamily: `${typography.fontFamily.body}, sans-serif`,
1565
- fontSize: typography.fontSize.sm,
1566
- fontWeight: typography.fontWeight.semiBold, // Always semiBold (600)
1567
- lineHeight: 'normal',
1568
- color: semanticColors.color.text.secondary, // #6b7280 by default
1565
+ ...semanticTypography.table.header,
1566
+ color: semanticColors.color.text.tertiary,
1569
1567
  transition: 'color 0.2s',
1570
1568
  textOverflow: 'clip',
1571
1569
  whiteSpace: 'break-spaces',
1572
1570
  },
1573
1571
  // Change text color on hover
1574
1572
  [`& .${gridClasses.columnHeader}:hover .${gridClasses.columnHeaderTitle}`]: {
1575
- color: semanticColors.color.icon.default, // #1f2937 on hover
1573
+ color: semanticColors.color.text.primary,
1576
1574
  },
1577
1575
  // Style the checkbox in header to match design system (16x16 from Figma)
1578
1576
  [`& .${gridClasses.columnHeaderCheckbox}`]: {
@@ -1587,9 +1585,8 @@ const getDataGridHeaderStyles = () => {
1587
1585
  },
1588
1586
  },
1589
1587
  },
1590
- // MUI clips this container when header vertical padding leaves < 16px of content
1591
- // area (e.g. compact: 38px 24px padding = 14px). overflow:visible lets the
1592
- // sort icon render at full 16px without being cropped.
1588
+ // MUI clips this container when padding leaves < 16px of content area, which
1589
+ // crops the sort icon. Guards callers that shrink height.table.header.
1593
1590
  [`& .${gridClasses.columnHeaderTitleContainer}`]: {
1594
1591
  overflow: 'visible',
1595
1592
  lineHeight: 1,
@@ -2388,7 +2385,9 @@ function ModDataGrid({ autoHeight = false, toolbar, slots, sx, density = 'standa
2388
2385
  },
2389
2386
  ...sx,
2390
2387
  };
2391
- return (jsx(DataGridPro, { apiRef: apiRef, columnHeaderHeight: density === 'compact' ? 38 : density === 'comfortable' ? 52 : 44, autoHeight: autoHeight, autoPageSize: !autoHeight, getRowHeight: () => 'auto', showToolbar: !!toolbar, slots: mergedSlots, slotProps: {
2388
+ return (jsx(DataGridPro, { apiRef: apiRef,
2389
+ // One height at every density; `cell.minHeight` below still scales.
2390
+ columnHeaderHeight: height.table.header, autoHeight: autoHeight, autoPageSize: !autoHeight, getRowHeight: () => 'auto', showToolbar: !!toolbar, slots: mergedSlots, slotProps: {
2392
2391
  basePopper: {
2393
2392
  placement: 'bottom-start',
2394
2393
  },
@@ -2561,13 +2560,7 @@ ModDataGridFiltersButton.displayName = 'ModDataGridFiltersButton';
2561
2560
  /**
2562
2561
  * ModDataGridHeaderLabel - Header label for DataGrid columns with help icon support
2563
2562
  *
2564
- * Design tokens used:
2565
- * - Font: typography.fontWeight.semiBold (600)
2566
- * - Font size: 14px (from Figma Table/header)
2567
- * - Colors:
2568
- * - Default: semanticColors.typography.bodySecondary (#6b7280)
2569
- * - Hover: semanticColors.icons.default (#1f2937)
2570
- * - Icons: semanticColors.icons.utility (#9ca3af)
2563
+ * Shares semanticTypography.table.header with the plain DataGrid column title.
2571
2564
  *
2572
2565
  * @example
2573
2566
  * // Basic usage (for custom header content)
@@ -2585,18 +2578,15 @@ const LabelContainer$2 = styled('div')({
2585
2578
  gap: `${spacing.spacing_1_2}px`,
2586
2579
  });
2587
2580
  const LabelText$1 = styled('p')({
2588
- fontFamily: `${typography.fontFamily.body}, sans-serif`,
2589
- fontSize: typography.fontSize.sm,
2590
- fontWeight: typography.fontWeight.semiBold, // Always semiBold (600)
2591
- lineHeight: 'normal',
2592
- color: semanticColors.color.text.secondary, // #6b7280 by default
2581
+ ...semanticTypography.table.header,
2582
+ color: semanticColors.color.text.tertiary,
2593
2583
  whiteSpace: 'nowrap',
2594
2584
  margin: 0,
2595
2585
  padding: 0,
2596
2586
  transition: 'color 0.2s',
2597
2587
  // Hover state - changes to primary text color
2598
2588
  '&:hover': {
2599
- color: semanticColors.color.icon.default, // #1f2937 on hover
2589
+ color: semanticColors.color.text.primary,
2600
2590
  },
2601
2591
  });
2602
2592
  const IconWrapper = styled('div')({
@@ -5686,9 +5676,13 @@ const ModSkeleton = ({ colorTheme = 'light', position = 'start', ...props }) =>
5686
5676
  };
5687
5677
  ModSkeleton.displayName = 'ModSkeleton';
5688
5678
 
5689
- const sizePadding = {
5690
- small: `${spacing.spacing_3_4}px ${spacing.spacing_1_1_2}px`,
5691
- medium: `${spacing.spacing_1_1_2}px ${spacing.spacing_2}px`,
5679
+ const sizePaddingY = {
5680
+ small: spacing.spacing_3_4,
5681
+ medium: spacing.spacing_1_1_2,
5682
+ };
5683
+ const sizePaddingX = {
5684
+ small: spacing.spacing_1_1_2,
5685
+ medium: spacing.spacing_2,
5692
5686
  };
5693
5687
  const sizeFontSize = {
5694
5688
  small: typography.fontSize.xs,
@@ -5699,14 +5693,12 @@ const StyledTable = styled(MuiTable, {
5699
5693
  })(({ theme, tableSize = 'small' }) => ({
5700
5694
  borderCollapse: 'separate',
5701
5695
  borderSpacing: 0,
5696
+ // `size` scales the rows only; headers hold one treatment and one height.
5702
5697
  [`& .${tableCellClasses.head}`]: {
5698
+ ...semanticTypography.table.header,
5703
5699
  backgroundColor: semanticColors.color.surface.dataGrid.header,
5704
- color: semanticColors.color.text.primary,
5705
- fontFamily: typography.fontFamily.body,
5706
- fontSize: theme.typography.pxToRem(sizeFontSize[tableSize]),
5707
- fontWeight: typography.fontWeight.semiBold,
5708
- lineHeight: 1.4,
5709
- padding: sizePadding[tableSize],
5700
+ color: semanticColors.color.text.tertiary,
5701
+ padding: `${spacing.spacing_1_1_4}px ${sizePaddingX[tableSize]}px`,
5710
5702
  borderBottom: `1px solid ${semanticColors.color.border.primary}`,
5711
5703
  },
5712
5704
  [`& .${tableCellClasses.body}`]: {
@@ -5715,7 +5707,7 @@ const StyledTable = styled(MuiTable, {
5715
5707
  fontSize: theme.typography.pxToRem(sizeFontSize[tableSize]),
5716
5708
  fontWeight: typography.fontWeight.regular,
5717
5709
  lineHeight: 1.4,
5718
- padding: sizePadding[tableSize],
5710
+ padding: `${sizePaddingY[tableSize]}px ${sizePaddingX[tableSize]}px`,
5719
5711
  borderBottom: `1px solid ${semanticColors.color.border.primary}`,
5720
5712
  },
5721
5713
  // Drop the trailing row's bottom border so the container border (if