@moderneinc/design-system-components 7.1.0 → 7.2.0-next.8d096f

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