@moderneinc/design-system-components 7.5.0-next.6d29ed → 7.5.0

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.
@@ -10,5 +10,13 @@ import type { SxProps, Theme } from '@mui/material/styles';
10
10
  export declare const panelSurfaceStyles: {
11
11
  readonly backgroundColor: "var(--mod-color-surface-raised)";
12
12
  };
13
- export declare const getDataGridHeaderStyles: () => SxProps<Theme>;
13
+ /**
14
+ * `resizable` picks header-title overflow. User-draggable widths truncate,
15
+ * since wrapped labels grow the header row mid-drag; the ellipsis also
16
+ * restores MUI's full-label tooltip, which needs `overflow: hidden`. Fixed
17
+ * widths wrap. Grid-level only: MUI has no per-column resizability class.
18
+ */
19
+ export declare const getDataGridHeaderStyles: ({ resizable, }?: {
20
+ resizable?: boolean;
21
+ }) => SxProps<Theme>;
14
22
  export declare const getDataGridRowStyles: () => SxProps<Theme>;
package/dist/index.d.ts CHANGED
@@ -893,7 +893,15 @@ declare namespace ModDataGrid {
893
893
  var displayName: string;
894
894
  }
895
895
 
896
- declare const getDataGridHeaderStyles: () => SxProps<Theme>;
896
+ /**
897
+ * `resizable` picks header-title overflow. User-draggable widths truncate,
898
+ * since wrapped labels grow the header row mid-drag; the ellipsis also
899
+ * restores MUI's full-label tooltip, which needs `overflow: hidden`. Fixed
900
+ * widths wrap. Grid-level only: MUI has no per-column resizability class.
901
+ */
902
+ declare const getDataGridHeaderStyles: ({ resizable, }?: {
903
+ resizable?: boolean;
904
+ }) => SxProps<Theme>;
897
905
  declare const getDataGridRowStyles: () => SxProps<Theme>;
898
906
 
899
907
  interface ModDataGridCellContentProps extends HTMLAttributes<HTMLDivElement> {
package/dist/index.esm.js CHANGED
@@ -1545,7 +1545,13 @@ ModCodeSnippet.displayName = 'ModCodeSnippet';
1545
1545
  const panelSurfaceStyles = {
1546
1546
  backgroundColor: semanticColors.color.surface.raised,
1547
1547
  };
1548
- const getDataGridHeaderStyles = () => {
1548
+ /**
1549
+ * `resizable` picks header-title overflow. User-draggable widths truncate,
1550
+ * since wrapped labels grow the header row mid-drag; the ellipsis also
1551
+ * restores MUI's full-label tooltip, which needs `overflow: hidden`. Fixed
1552
+ * widths wrap. Grid-level only: MUI has no per-column resizability class.
1553
+ */
1554
+ const getDataGridHeaderStyles = ({ resizable = false, } = {}) => {
1549
1555
  return {
1550
1556
  // Header cell container styles: bg, border, padding
1551
1557
  [`& .${gridClasses.columnHeader}`]: {
@@ -1571,8 +1577,9 @@ const getDataGridHeaderStyles = () => {
1571
1577
  ...semanticTypography.table.header,
1572
1578
  color: semanticColors.color.text.tertiary,
1573
1579
  transition: 'color 0.2s',
1574
- textOverflow: 'clip',
1575
- whiteSpace: 'break-spaces',
1580
+ ...(resizable
1581
+ ? { textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden' }
1582
+ : { textOverflow: 'clip', whiteSpace: 'break-spaces' }),
1576
1583
  },
1577
1584
  // Change text color on hover
1578
1585
  [`& .${gridClasses.columnHeader}:hover .${gridClasses.columnHeaderTitle}`]: {
@@ -1593,6 +1600,7 @@ const getDataGridHeaderStyles = () => {
1593
1600
  },
1594
1601
  // MUI clips this container when padding leaves < 16px of content area, which
1595
1602
  // crops the sort icon. Guards callers that shrink height.table.header.
1603
+ // NOTE: MUI's own minWidth: 0 here keeps title truncation working despite `visible`.
1596
1604
  [`& .${gridClasses.columnHeaderTitleContainer}`]: {
1597
1605
  overflow: 'visible',
1598
1606
  lineHeight: 1,
@@ -2358,7 +2366,7 @@ function ModDataGrid({ autoHeight = false, toolbar, slots, sx, density = 'standa
2358
2366
  [`&& .${gridClasses.filler}, && .${gridClasses.scrollbarFiller}`]: {
2359
2367
  backgroundColor: semanticColors.color.surface.dataGrid.default,
2360
2368
  },
2361
- ...getDataGridHeaderStyles(),
2369
+ ...getDataGridHeaderStyles({ resizable: !props.disableColumnResize }),
2362
2370
  ...getDataGridRowStyles(),
2363
2371
  border: `1px solid ${semanticColors.color.border.primary}`,
2364
2372
  // Target `& svg` (not `.MuiSvgIcon-root`) to match the lucide icons