Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 5e59592

Browse files
authored
feat(table): added sorting, cell types, actions, and inputs (#2444)
1 parent 4c54904 commit 5e59592

File tree

9 files changed

+7155
-1067
lines changed

9 files changed

+7155
-1067
lines changed

.changeset/wise-cougars-cross.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ebay/skin": minor
3+
---
4+
5+
feat(table): added sorting, cell types, actions, and inputs

dist/table/table.css

Lines changed: 178 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
:root {
2-
--density-compact-cell-height: 36px;
3-
--density-default-cell-height: 48px;
4-
--density-relaxed-cell-height: 56px;
5-
}
6-
71
.table {
82
overflow-x: auto;
93
position: relative;
@@ -20,42 +14,206 @@
2014
background-color: var(--color-background-primary);
2115
border-bottom: 1px solid var(--color-stroke-subtle);
2216
box-sizing: border-box;
23-
height: var(--density-default-cell-height);
17+
height: 80px;
18+
max-height: 80px;
2419
max-width: 400px;
2520
min-width: 124px;
26-
padding-block: var(--spacing-100);
27-
padding-inline: var(--spacing-200);
21+
padding: 12px;
22+
}
23+
24+
.table th {
25+
white-space: nowrap;
2826
}
2927

28+
.table--density-compact td,
29+
.table--density-compact th {
30+
height: 64px;
31+
max-height: 64px;
32+
padding: 12px;
33+
}
34+
35+
.table--density-relaxed td,
36+
.table--density-relaxed th {
37+
height: 112px;
38+
max-height: 112px;
39+
padding: 16px;
40+
}
41+
42+
.table th button {
43+
font-weight: 700;
44+
}
45+
46+
.table tbody tr:last-child td,
47+
.table tbody tr:last-child th {
48+
border-bottom: none;
49+
}
50+
51+
.table-cell {
52+
text-align: left;
53+
}
54+
55+
.table-cell--numeric {
56+
text-align: right;
57+
}
3058
.table__cell {
3159
text-align: left;
3260
}
3361

34-
.table [data-type="numeric"],
3562
.table__cell--numeric {
3663
text-align: right;
3764
}
3865

39-
.table td:last-child,
40-
.table th:last-child {
41-
padding-inline-end: 0;
66+
.table-cell--icon-action {
67+
text-align: center;
68+
width: 64px;
4269
}
4370

44-
.table--density-compact td,
45-
.table--density-compact th {
46-
height: var(--density-compact-cell-height);
71+
.table [data-type="numeric"] {
72+
text-align: right;
4773
}
4874

49-
.table--density-relaxed td,
50-
.table--density-relaxed th {
51-
height: var(--density-relaxed-cell-height);
75+
.table-cell img {
76+
max-height: 56px;
77+
max-width: 56px;
78+
}
79+
80+
.table--density-compact .table-cell img {
81+
max-height: 40px;
82+
max-width: 40px;
83+
}
84+
85+
.table--density-relaxed .table-cell img {
86+
max-height: 72px;
87+
max-width: 72px;
88+
}
89+
90+
.table th[scope="row"] {
91+
text-align: left;
92+
}
93+
94+
.table td:last-child,
95+
.table th:last-child {
96+
padding-inline-end: 0;
5297
}
5398

5499
.table--mode-selection td:first-child,
55100
.table--mode-selection th:first-child {
56-
min-width: unset;
101+
min-width: 48px;
102+
text-align: center;
103+
width: 48px;
57104
}
58105

59106
.table tbody th {
60107
font-weight: 400;
61108
}
109+
110+
.table thead button {
111+
background-color: initial;
112+
border: 1px solid transparent;
113+
border-radius: 10px;
114+
box-sizing: border-box;
115+
color: inherit;
116+
display: inline-block;
117+
font-family: inherit;
118+
font-size: var(--font-size-default);
119+
margin: 0;
120+
min-height: 40px;
121+
min-width: auto;
122+
padding: 3px;
123+
text-align: center;
124+
text-decoration: none;
125+
transform: translateZ(0);
126+
vertical-align: initial;
127+
white-space: nowrap;
128+
}
129+
130+
.table-cell__data {
131+
line-height: var(--spacing-250);
132+
max-width: 400px;
133+
min-width: 124px;
134+
}
135+
136+
.table-cell__data--secondary {
137+
color: var(--color-foreground-secondary);
138+
font-size: var(--font-size-12);
139+
line-height: var(--spacing-200);
140+
}
141+
142+
.table-cell__thumbnail {
143+
align-items: center;
144+
background-color: var(--color-background-tertiary);
145+
border-radius: 8px;
146+
display: flex;
147+
flex-wrap: nowrap;
148+
height: 56px;
149+
justify-content: center;
150+
overflow: hidden;
151+
text-align: center;
152+
width: 56px;
153+
}
154+
155+
.table--density-compact .table-cell__thumbnail {
156+
border-radius: 4px;
157+
height: 40px;
158+
width: 40px;
159+
}
160+
161+
.table--density-relaxed .table-cell__thumbnail {
162+
border-radius: 8px;
163+
height: 72px;
164+
width: 72px;
165+
}
166+
167+
.table-cell__layout {
168+
align-items: center;
169+
display: flex;
170+
gap: var(--spacing-200);
171+
width: max-content;
172+
}
173+
174+
.table-cell__layout > * {
175+
flex-shrink: 0;
176+
}
177+
178+
.table-cell__multiline {
179+
max-height: 80px;
180+
max-width: 304px;
181+
}
182+
183+
.table--density-compact .table-cell__multiline {
184+
max-height: 64px;
185+
max-width: 320px;
186+
}
187+
188+
.table--density-relaxed .table-cell__multiline {
189+
max-height: 112px;
190+
max-width: 272px;
191+
}
192+
193+
.table-cell__layout .table-cell__multiline .table-cell__data {
194+
-webkit-margin-after: var(--spacing-50);
195+
margin-block-end: var(--spacing-50);
196+
overflow: hidden;
197+
text-overflow: ellipsis;
198+
white-space: nowrap;
199+
}
200+
201+
.table-cell .textbox,
202+
.table-cell .textbox__control {
203+
width: 100%;
204+
}
205+
206+
.table-cell--numeric .textbox__control {
207+
text-align: right;
208+
}
209+
210+
.table-cell .signal {
211+
white-space: nowrap;
212+
}
213+
[dir="rtl"] .table th[scope="row"],
214+
[dir="rtl"] .table-cell {
215+
text-align: right;
216+
}
217+
[dir="rtl"] .table-cell--numeric {
218+
text-align: left;
219+
}

0 commit comments

Comments
 (0)