forked from jsoref/tigera-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Table.ts
137 lines (135 loc) · 3.12 KB
/
Table.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/* eslint-disable sonarjs/no-duplicate-string */
const defaultStyles = {
table: {
bg: 'tigeraWhite',
border: '0px solid',
},
th: {
bg: 'tigeraGrey.100',
border: '1px solid',
borderTopColor: 'tigeraGrey.100',
borderBottomColor: 'tigeraGrey.100',
borderLeftColor: 'tigeraGrey.100',
borderLeft: 0,
paddingLeft: 0,
borderTop: 0,
borderRightColor: 'tigeraGrey.100',
fontSize: 'xs',
fontWeight: '700',
letterSpacing: 'normal',
px: 2,
py: 2,
color: 'tigeraBlack',
_last: {
borderRight: 0,
},
_first: {
paddingLeft: 4,
},
},
tr: {
borderBottom: '1px',
borderBottomColor: 'tigeraGrey.200',
},
td: {
fontWeight: '500',
color: 'tigeraBlack',
px: 2,
py: 2,
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
border: 'none',
fontSize: 'xs',
_first: {
paddingLeft: 4,
},
},
};
const smallStyles = {
table: defaultStyles.table,
th: {
...defaultStyles.th,
fontSize: 'xxs',
fontWeight: '700',
},
tr: {
...defaultStyles.tr,
},
td: {
...defaultStyles.td,
fontSize: 'xxs',
lineHeight: '18px',
},
};
export default {
baseStyle: {
table: {
bg: 'tigeraWhite',
},
th: {
borderColor: 'tigeraGrey.200',
borderBottom: '1px',
textTransform: 'capitalize',
},
tr: {
_last: {
borderBottom: 0,
},
},
td: {
borderBottom: 0,
},
},
sizes: {
sm: smallStyles,
md: defaultStyles,
lg: defaultStyles, //could do with updating if required at some point
},
variants: {
simple: {
th: {
borderBottom: '0',
border: 'none',
color: 'tigeraBlack',
},
},
light: {
th: {
borderBottomColor: 'tigeraGrey.200',
borderColor: 'tigeraWhite',
bg: 'tigeraWhite',
borderRightColor: 'tigeraWhite',
borderBottom: '0',
},
},
modal: {
table: {
bg: 'transparent',
border: '0px solid',
},
th: {
borderBottomColor: 'tigeraGrey.200',
borderColor: 'tigeraGrey.200',
bg: 'tigeraGrey.200',
borderRightColor: 'tigeraGrey.200',
borderBottom: '0',
},
},
innerExpando: {
table: {
bg: 'transparent',
},
td: {
_first: {
verticalAlign: 'top',
color: 'tigeraGrey.700',
pl: 8,
},
_last: {
pr: 0,
},
},
},
},
};