Skip to content

Commit b2b2230

Browse files
WesSouzaarturbien
authored andcommitted
docs(table): categorize under Controls
This also moves the Table* subcomponents into the Table folder.
1 parent c1d84d4 commit b2b2230

14 files changed

+30
-94
lines changed

src/Table/Table.mdx

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/Table/Table.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const Wrapper = styled.div`
1919
`;
2020

2121
export default {
22-
title: 'Table',
22+
title: 'Controls/Table',
2323
component: Table,
2424
subcomponents: {
2525
Table,

src/Table/Table.tsx

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,24 @@ const Wrapper = styled(StyledScrollView)`
2222
}
2323
`;
2424

25-
const Table = forwardRef<HTMLTableElement, TableProps>(function Table(
26-
{ children, ...otherProps },
27-
ref
28-
) {
29-
return (
30-
<Wrapper>
31-
<StyledTable ref={ref} {...otherProps}>
32-
{children}
33-
</StyledTable>
34-
</Wrapper>
35-
);
36-
});
25+
const Table = forwardRef<HTMLTableElement, TableProps>(
26+
({ children, ...otherProps }, ref) => {
27+
return (
28+
<Wrapper>
29+
<StyledTable ref={ref} {...otherProps}>
30+
{children}
31+
</StyledTable>
32+
</Wrapper>
33+
);
34+
}
35+
);
36+
37+
Table.displayName = 'Table';
38+
39+
export * from './TableBody';
40+
export * from './TableDataCell';
41+
export * from './TableHead';
42+
export * from './TableHeadCell';
43+
export * from './TableRow';
3744

3845
export { Table, TableProps };
File renamed without changes.

src/TableBody/TableBody.tsx renamed to src/Table/TableBody.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(
2525
}
2626
);
2727

28+
TableBody.displayName = 'TableBody';
29+
2830
export { TableBody, TableBodyProps };
File renamed without changes.

src/TableDataCell/TableDataCell.tsx renamed to src/Table/TableDataCell.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ const TableDataCell = forwardRef<HTMLTableCellElement, TableDataCellProps>(
2121
}
2222
);
2323

24+
TableDataCell.displayName = 'TableDataCell';
25+
2426
export { TableDataCell, TableDataCellProps };
File renamed without changes.

src/TableHead/TableHead.tsx renamed to src/Table/TableHead.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ const TableHead = forwardRef<HTMLTableSectionElement, TableHeadProps>(
2020
}
2121
);
2222

23+
TableHead.displayName = 'TableHead';
24+
2325
export { TableHead, TableHeadProps };
File renamed without changes.

0 commit comments

Comments
 (0)