@codecademy/gamut 72.2.2-alpha.a3d3a3.0 → 72.2.2-alpha.ae087f.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.
@@ -2,6 +2,7 @@ import { memo } from 'react';
2
2
  import { FlexBox } from '../../..';
3
3
  import { ListCol } from '../../../List';
4
4
  import { useListContext } from '../../../List/ListProvider';
5
+ import { DEFAULT_COLUMN_SIZE } from '../../constants';
5
6
  import { ExpandControl, FilterControl, SelectControl, SortControl } from '../../Controls';
6
7
  import { useControlContext } from '../../hooks/useListControls';
7
8
  import { useListState } from '../../hooks/useListState';
@@ -45,6 +46,7 @@ export const TableHeaderRow = ({
45
46
  header,
46
47
  sortable,
47
48
  filters,
49
+ size,
48
50
  ...colProps
49
51
  }) => {
50
52
  const rowProperty = key;
@@ -56,6 +58,7 @@ export const TableHeaderRow = ({
56
58
  ...colProps,
57
59
  "aria-sort": sortable ? ariaSortDirection : undefined,
58
60
  columnHeader: true,
61
+ size: size ?? DEFAULT_COLUMN_SIZE,
59
62
  children: /*#__PURE__*/_jsxs(FlexBox, {
60
63
  alignItems: selectable ? 'center' : 'flex-end',
61
64
  gap: 8,
@@ -3,6 +3,7 @@ import { Text } from '../../..';
3
3
  import { ListCol, ListRow } from '../../../List';
4
4
  import { useListContext } from '../../../List/ListProvider';
5
5
  import { Shimmer } from '../../../Loading/Shimmer';
6
+ import { DEFAULT_COLUMN_SIZE } from '../../constants';
6
7
  import { ExpandControl, SelectControl } from '../../Controls';
7
8
  import { useControlContext } from '../../hooks/useListControls';
8
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -90,7 +91,7 @@ export const TableRow = ({
90
91
  const newKey = prefixId(`${id}-col-${String(key)}`);
91
92
  const colProps = {
92
93
  ...listColProps,
93
- size,
94
+ size: size ?? DEFAULT_COLUMN_SIZE,
94
95
  justify,
95
96
  fill,
96
97
  type
@@ -0,0 +1,2 @@
1
+ import { DataGridColumnSize } from './types';
2
+ export declare const DEFAULT_COLUMN_SIZE: DataGridColumnSize;
@@ -0,0 +1 @@
1
+ export const DEFAULT_COLUMN_SIZE = 'md';
@@ -53,6 +53,7 @@ export type FilterOption = string | {
53
53
  text: string;
54
54
  value: string;
55
55
  };
56
+ export type DataGridColumnSize = Exclude<ListColProps['size'], 'content'>;
56
57
  export interface ColumnConfig<T> {
57
58
  key: keyof T;
58
59
  /**
@@ -61,7 +62,7 @@ export interface ColumnConfig<T> {
61
62
  */
62
63
  header?: string;
63
64
  type?: ListColProps['type'];
64
- size?: Exclude<ListColProps['size'], 'content'>;
65
+ size?: DataGridColumnSize;
65
66
  render?: (row: T) => ReactElement<any, any> | null;
66
67
  sortable?: boolean;
67
68
  filters?: string[];
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@codecademy/gamut",
3
3
  "description": "Styleguide & Component library for Codecademy",
4
- "version": "72.2.2-alpha.a3d3a3.0",
4
+ "version": "72.2.2-alpha.ae087f.0",
5
5
  "author": "Codecademy Engineering <dev@codecademy.com>",
6
6
  "bin": "./bin/gamut.mjs",
7
7
  "dependencies": {
8
- "@codecademy/gamut-icons": "9.57.10-alpha.a3d3a3.0",
9
- "@codecademy/gamut-illustrations": "0.58.16-alpha.a3d3a3.0",
10
- "@codecademy/gamut-patterns": "0.10.35-alpha.a3d3a3.0",
11
- "@codecademy/gamut-styles": "20.0.3-alpha.a3d3a3.0",
12
- "@codecademy/variance": "0.26.2-alpha.a3d3a3.0",
8
+ "@codecademy/gamut-icons": "9.57.10-alpha.ae087f.0",
9
+ "@codecademy/gamut-illustrations": "0.58.16-alpha.ae087f.0",
10
+ "@codecademy/gamut-patterns": "0.10.35-alpha.ae087f.0",
11
+ "@codecademy/gamut-styles": "20.0.3-alpha.ae087f.0",
12
+ "@codecademy/variance": "0.26.2-alpha.ae087f.0",
13
13
  "@formatjs/intl-locale": "5.3.1",
14
14
  "@react-aria/interactions": "3.25.0",
15
15
  "@types/marked": "^4.0.8",