@codecademy/gamut
72.2.172.2.2-alpha.ae087f.0
+
Added (2 files)
~
Modified (4 files)
Index: package/dist/DataList/Tables/Rows/TableHeaderRow.js
===================================================================
--- package/dist/DataList/Tables/Rows/TableHeaderRow.js
+++ package/dist/DataList/Tables/Rows/TableHeaderRow.js
@@ -1,8 +1,9 @@
import { memo } from 'react';
import { FlexBox } from '../../..';
import { ListCol } from '../../../List';
import { useListContext } from '../../../List/ListProvider';
+import { DEFAULT_COLUMN_SIZE } from '../../constants';
import { ExpandControl, FilterControl, SelectControl, SortControl } from '../../Controls';
import { useControlContext } from '../../hooks/useListControls';
import { useListState } from '../../hooks/useListState';
import { StyledHeaderRow } from './elements';
@@ -44,8 +45,9 @@
key,
header,
sortable,
filters,
+ size,
...colProps
}) => {
const rowProperty = key;
const renderKey = prefixId(`header-col-${rowProperty}`);
@@ -55,8 +57,9 @@
return /*#__PURE__*/_jsx(ListCol, {
...colProps,
"aria-sort": sortable ? ariaSortDirection : undefined,
columnHeader: true,
+ size: size ?? DEFAULT_COLUMN_SIZE,
children: /*#__PURE__*/_jsxs(FlexBox, {
alignItems: selectable ? 'center' : 'flex-end',
gap: 8,
height: "100%", Index: package/dist/DataList/Tables/Rows/TableRow.js
===================================================================
--- package/dist/DataList/Tables/Rows/TableRow.js
+++ package/dist/DataList/Tables/Rows/TableRow.js
@@ -2,8 +2,9 @@
import { Text } from '../../..';
import { ListCol, ListRow } from '../../../List';
import { useListContext } from '../../../List/ListProvider';
import { Shimmer } from '../../../Loading/Shimmer';
+import { DEFAULT_COLUMN_SIZE } from '../../constants';
import { ExpandControl, SelectControl } from '../../Controls';
import { useControlContext } from '../../hooks/useListControls';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export const TableRow = ({
@@ -89,9 +90,9 @@
};
const newKey = prefixId(`${id}-col-${String(key)}`);
const colProps = {
...listColProps,
- size,
+ size: size ?? DEFAULT_COLUMN_SIZE,
justify,
fill,
type
}; Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,16 +1,16 @@
{
"name": "@codecademy/gamut",
"description": "Styleguide & Component library for Codecademy",
- "version": "72.2.1",
+ "version": "72.2.2-alpha.ae087f.0",
"author": "Codecademy Engineering <[email protected]>",
"bin": "./bin/gamut.mjs",
"dependencies": {
- "@codecademy/gamut-icons": "9.57.9",
- "@codecademy/gamut-illustrations": "0.58.15",
- "@codecademy/gamut-patterns": "0.10.34",
- "@codecademy/gamut-styles": "20.0.2",
- "@codecademy/variance": "0.26.1",
+ "@codecademy/gamut-icons": "9.57.10-alpha.ae087f.0",
+ "@codecademy/gamut-illustrations": "0.58.16-alpha.ae087f.0",
+ "@codecademy/gamut-patterns": "0.10.35-alpha.ae087f.0",
+ "@codecademy/gamut-styles": "20.0.3-alpha.ae087f.0",
+ "@codecademy/variance": "0.26.2-alpha.ae087f.0",
"@formatjs/intl-locale": "5.3.1",
"@react-aria/interactions": "3.25.0",
"@types/marked": "^4.0.8",
"@vidstack/react": "^1.12.12", Index: package/dist/DataList/types.d.ts
===================================================================
--- package/dist/DataList/types.d.ts
+++ package/dist/DataList/types.d.ts
@@ -52,17 +52,18 @@
export type FilterOption = string | {
text: string;
value: string;
};
+export type DataGridColumnSize = Exclude<ListColProps['size'], 'content'>;
export interface ColumnConfig<T> {
key: keyof T;
/**
* Whether this column's _data rows_ should also behave like a header.
* This will cause the column to be sticky and slightly offset from the rest of the data.
*/
header?: string;
type?: ListColProps['type'];
- size?: Exclude<ListColProps['size'], 'content'>;
+ size?: DataGridColumnSize;
render?: (row: T) => ReactElement<any, any> | null;
sortable?: boolean;
filters?: string[];
options?: FilterOption[];