Skip to content

Commit 2c8b591

Browse files
author
Kubit
committed
Add new Table component
Add new Table V2 component The oldest one, will be deprecated on next MAJOR version
1 parent 5db2fb7 commit 2c8b591

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+756
-3
lines changed

src/constants/stylesName.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,13 @@ export const STYLES_NAME = {
106106
VIDEO: 'VIDEO_STYLES',
107107
DROPDOWN_SELECTED: 'DROPDOWN_SELECTED_STYLES',
108108
INPUT_SIGNATURE: 'INPUT_SIGNATURE_STYLES',
109+
TABLE_CELL: 'TABLE_CELL_STYLES',
110+
TABLE_ROW: 'TABLE_ROW_STYLES',
111+
TABLE_BODY: 'TABLE_BODY_STYLES',
112+
TABLE_HEAD: 'TABLE_HEAD_STYLES',
113+
TABLE_FOOT: 'TABLE_FOOT_STYLES',
114+
TABLE_CAPTION: 'TABLE_CAPTION_STYLES',
115+
TABLE_DIVIDER: 'TABLE_DIVIDER_STYLES',
116+
TABLE_V2: 'TABLE_V2_STYLES',
117+
DATA_TABLE: 'DATA_TABLE_STYLES',
109118
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './styles';
2+
export * from './variants';
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
import { DataTableStylesType } from '@/components';
2+
3+
import { Z_INDEX } from '../../foundations';
4+
import {
5+
TableBodyVariantType,
6+
TableCaptionVariantType,
7+
TableCellVariantType,
8+
TableHeadVariantType,
9+
TableRowVariantTypeV2,
10+
TableV2VariantType,
11+
} from '../variants';
12+
import { DataTableVariantType } from './variants';
13+
14+
export const DATA_TABLE_STYLES: DataTableStylesType<DataTableVariantType> = {
15+
[DataTableVariantType.DEFAULT]: {
16+
wrapper: {
17+
display: 'block',
18+
width: '100%',
19+
position: 'relative',
20+
},
21+
scrollableContainer: {
22+
width: '100%',
23+
overflow: 'auto',
24+
},
25+
table: {
26+
variant: TableV2VariantType.DEFAULT,
27+
z_index: Z_INDEX.INTERN_1,
28+
},
29+
tableCaption: {
30+
variant: TableCaptionVariantType.DEFAULT,
31+
},
32+
tableHead: {
33+
variant: TableHeadVariantType.DEFAULT,
34+
},
35+
tableHeadRow: {
36+
variant: TableRowVariantTypeV2.HEADER_ROW_DEFAULT,
37+
},
38+
tableHeadCell: {
39+
variant: TableCellVariantType.HEADER_CELL_DEFAULT,
40+
},
41+
tableBody: {
42+
variant: TableBodyVariantType.DEFAULT,
43+
},
44+
tableBodyRow: {
45+
variant: TableRowVariantTypeV2.BODY_ROW_DEFAULT,
46+
},
47+
tableBodyCell: {
48+
variant: TableCellVariantType.BODY_CELL_DEFAULT,
49+
},
50+
rowGroup: {
51+
table: {
52+
variant: TableV2VariantType.DEFAULT,
53+
},
54+
tableCaption: {
55+
variant: TableCaptionVariantType.DEFAULT,
56+
},
57+
tableHead: {
58+
variant: TableHeadVariantType.DEFAULT,
59+
},
60+
tableHeadRow: {
61+
variant: TableRowVariantTypeV2.HEADER_ROW_DEFAULT,
62+
},
63+
tableHeadCell: {
64+
variant: TableCellVariantType.HEADER_CELL_DEFAULT,
65+
},
66+
tableBody: {
67+
variant: TableBodyVariantType.DEFAULT,
68+
},
69+
tableBodyRow: {
70+
variant: TableRowVariantTypeV2.BODY_ROW_DEFAULT,
71+
},
72+
tableBodyCell: {
73+
variant: TableCellVariantType.BODY_CELL_DEFAULT,
74+
},
75+
},
76+
leftBoxShadowContainer: {
77+
position: 'absolute',
78+
top: '0',
79+
bottom: '0',
80+
width: '5px',
81+
pointer_events: 'none',
82+
transition: 'box-shadow 200ms',
83+
z_index: Z_INDEX.INTERN_2,
84+
},
85+
rightBoxShadowContainer: {
86+
position: 'absolute',
87+
top: '0',
88+
bottom: '0',
89+
width: '5px',
90+
pointer_events: 'none',
91+
transition: 'box-shadow 200ms',
92+
z_index: Z_INDEX.INTERN_2,
93+
},
94+
// TODO When specified - update tokens
95+
headBoxShadow: '0 2px 4px 0 #d62c2c',
96+
leftBoxShadow: 'rgb(214, 44, 44) 8px 0px 5px -7px inset',
97+
rightBoxShadow: 'rgb(214, 44, 44) -8px 0px 5px -7px inset',
98+
},
99+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export enum DataTableVariantType {
2+
DEFAULT = 'DEFAULT',
3+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './styles';
2+
export * from './variants';
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { TableCellStylesType } from '@/components';
2+
3+
import { TableBodyVariantType } from './variants';
4+
5+
export const TABLE_BODY_STYLES: TableCellStylesType<TableBodyVariantType> = {
6+
[TableBodyVariantType.DEFAULT]: {
7+
container: {
8+
display: 'table-row-group',
9+
},
10+
},
11+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export enum TableBodyVariantType {
2+
DEFAULT = 'DEFAULT',
3+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './styles';
2+
export * from './variants';
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { TableCellStylesType } from '@/components';
2+
3+
import { TableCaptionVariantType } from './variants';
4+
5+
export const TABLE_CAPTION_STYLES: TableCellStylesType<TableCaptionVariantType> = {
6+
[TableCaptionVariantType.DEFAULT]: {
7+
container: {
8+
display: 'table-caption',
9+
},
10+
},
11+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export enum TableCaptionVariantType {
2+
DEFAULT = 'DEFAULT',
3+
}

0 commit comments

Comments
 (0)