Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/gamut/src/DataList/DataList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,24 @@ export const DataList: DataList = ({ variant = 'default', ...rest }) => {
<DataGrid variant={variant} {...rest} scrollable={false} shadow={false} />
);
};

// USE FOR TESTING ONLY
// UNCOMMENT AND RUN THE FOLLOWING CODE TO TEST THAT size: 'content' errors

// const TestingDataList = () => {
// return (
// <DataList variant="default" columns={[
// { header: 'Name', key: 'name', size: 'lg' },
// { header: 'Age', key: 'age', size: 'sm' },
// { header: 'Species', key: 'species', size: 'md' },
// { header: 'Ship', key: 'ship', size: 'content' },
// ]}
// id="test"
// idKey="id"
// rows={[
// { id: 1, name: 'John Doe', age: 30, species: 'Human', ship: 'USS Enterprise' },
// { id: 2, name: 'Jane Doe', age: 25, species: 'Human', ship: 'USS Enterprise' },
// { id: 3, name: 'John Smith', age: 35, species: 'Human', ship: 'USS Enterprise' },
// ]} />
// )
// }
23 changes: 23 additions & 0 deletions packages/gamut/src/DataList/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,26 @@ export const DataTable: DataTable = (props) => {
/>
);
};

// USE FOR TESTING ONLY
// UNCOMMENT AND RUN THE FOLLOWING CODE TO TEST THAT size: 'content' errors

// const TestingDataTable = () => {
// return (
// <DataTable
// columns={[
// { header: 'Name', key: 'name', size: 'lg' },
// { header: 'Age', key: 'age', size: 'sm' },
// { header: 'Species', key: 'species', size: 'md' },
// { header: 'Ship', key: 'ship', size: 'content' },
// ]}
// id="test"
// idKey="id"
// rows={[
// { id: 1, name: 'John Doe', age: 30, species: 'Human', ship: 'USS Enterprise' },
// { id: 2, name: 'Jane Doe', age: 25, species: 'Human', ship: 'USS Enterprise' },
// { id: 3, name: 'John Smith', age: 35, species: 'Human', ship: 'USS Enterprise' },
// ]}
// />
// )
// }
2 changes: 1 addition & 1 deletion packages/gamut/src/DataList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export interface ColumnConfig<T> {
*/
header?: string;
type?: ListColProps['type'];
size?: ListColProps['size'];
size?: Exclude<ListColProps['size'], 'content'>;
render?: (row: T) => ReactElement<any, any> | null;
sortable?: boolean;
filters?: string[];
Expand Down
Loading