-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,755 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@ebay/skin": minor | ||
--- | ||
|
||
feat(table): new module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
:root { | ||
--density-compact-cell-height: 36px; | ||
--density-default-cell-height: 48px; | ||
--density-relaxed-cell-height: 56px; | ||
} | ||
|
||
.table { | ||
overflow-x: auto; | ||
position: relative; | ||
} | ||
|
||
.table table { | ||
border-collapse: collapse; | ||
border-spacing: 0; | ||
width: 100%; | ||
} | ||
|
||
.table td, | ||
.table th { | ||
background-color: var(--color-background-primary); | ||
border-bottom: 1px solid var(--color-stroke-subtle); | ||
box-sizing: border-box; | ||
height: var(--density-default-cell-height); | ||
max-width: 400px; | ||
min-width: 124px; | ||
padding-block: var(--spacing-100); | ||
padding-inline: var(--spacing-200); | ||
} | ||
|
||
.table__cell { | ||
text-align: left; | ||
} | ||
|
||
.table [data-type="numeric"], | ||
.table__cell--numeric { | ||
text-align: right; | ||
} | ||
|
||
.table td:last-child, | ||
.table th:last-child { | ||
-webkit-padding-end: 0; | ||
padding-inline-end: 0; | ||
} | ||
|
||
.table--density-compact td, | ||
.table--density-compact th { | ||
height: var(--density-compact-cell-height); | ||
} | ||
|
||
.table--density-relaxed td, | ||
.table--density-relaxed th { | ||
height: var(--density-relaxed-cell-height); | ||
} | ||
|
||
.table--mode-selection td:first-child, | ||
.table--mode-selection th:first-child { | ||
min-width: unset; | ||
} | ||
|
||
.table tbody th { | ||
font-weight: 400; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,254 @@ | ||
export default { title: "Skin/Table" }; | ||
|
||
export const base = () => ` | ||
<div class="table" role="group" aria-label="Video games for sale" tabindex="0"> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Seller</th> | ||
<th>Item</th> | ||
<th>Image</th> | ||
<th class="table__cell table__cell--numeric">List Price</th> | ||
<th class="table__cell table__cell--numeric">Quantity Available</th> | ||
<th class="table__cell table__cell--numeric">Quantity Sold</th> | ||
<th class="table__cell table__cell--numeric">Watchers</th> | ||
<th class="table__cell table__cell--numeric">Protection</th> | ||
<th>Shipping</th> | ||
<th>Delivery</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<th class="table__cell>Nintendo</th> | ||
<td class="table__cell>Switch</td> | ||
<td class="table__cell></td> | ||
<td class="table__cell table__cell--numeric">$287.96</td> | ||
<td class="table__cell table__cell--numeric">300</td> | ||
<td class="table__cell table__cell--numeric">207</td> | ||
<td class="table__cell table__cell--numeric">95</td> | ||
<td class="table__cell table__cell--numeric">$17.99</td> | ||
<td class="table__cell>FREE</td> | ||
<td class="table__cell>4/1 - 4/5</td> | ||
</tr> | ||
<tr> | ||
<th class="table__cell>Nintendo</th> | ||
<td class="table__cell>SNES</td> | ||
<td class="table__cell></td> | ||
<td class="table__cell table__cell--numeric">$89.85</td> | ||
<td class="table__cell table__cell--numeric">45</td> | ||
<td class="table__cell table__cell--numeric">17</td> | ||
<td class="table__cell table__cell--numeric">5</td> | ||
<td class="table__cell table__cell--numeric">$18.95</td> | ||
<td class="table__cell>FREE</td> | ||
<td class="table__cell>4/11 - 4/15</td> | ||
</tr> | ||
<tr> | ||
<th class="table__cell>Microsoft</th> | ||
<td class="table__cell>XBOX 360</td> | ||
<td class="table__cell></td> | ||
<td class="table__cell table__cell--numeric">$499.99</td> | ||
<td class="table__cell table__cell--numeric">345</td> | ||
<td class="table__cell table__cell--numeric">455</td> | ||
<td class="table__cell table__cell--numeric">205</td> | ||
<td class="table__cell table__cell--numeric">$17.99</td> | ||
<td class="table__cell>FREE</td> | ||
<td class="table__cell>4/17 - 4/25</td> | ||
</tr> | ||
<tr> | ||
<th class="table__cell>Microsoft</th> | ||
<td class="table__cell>XBOX One</td> | ||
<td class="table__cell></td> | ||
<td class="table__cell table__cell--numeric">$499.99</td> | ||
<td class="table__cell table__cell--numeric">399</td> | ||
<td class="table__cell table__cell--numeric">407</td> | ||
<td class="table__cell table__cell--numeric">305</td> | ||
<td class="table__cell table__cell--numeric">$27.99</td> | ||
<td class="table__cell>FREE</td> | ||
<td class="table__cell>4/9 - 4/11</td> | ||
</tr> | ||
<tr> | ||
<th class="table__cell>Sony</th> | ||
<td class="table__cell>Playstation 5</td> | ||
<td class="table__cell></td> | ||
<td class="table__cell table__cell--numeric">$519.99</td> | ||
<td class="table__cell table__cell--numeric">205</td> | ||
<td class="table__cell table__cell--numeric">265</td> | ||
<td class="table__cell table__cell--numeric">199</td> | ||
<td class="table__cell table__cell--numeric">$29.99</td> | ||
<td class="table__cell>FREE</td> | ||
<td class="table__cell>4/11 - 4/15</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
`; | ||
|
||
export const compact = () => ` | ||
<div class="table table--density-compact" role="group" aria-label="Video games for sale" tabindex="0"> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Seller</th> | ||
<th>Item</th> | ||
<th>Image</th> | ||
<th class="table__cell table__cell--numeric">List Price</th> | ||
<th class="table__cell table__cell--numeric">Quantity Available</th> | ||
<th class="table__cell table__cell--numeric">Quantity Sold</th> | ||
<th class="table__cell table__cell--numeric">Watchers</th> | ||
<th class="table__cell table__cell--numeric">Protection</th> | ||
<th>Shipping</th> | ||
<th>Delivery</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<th class="table__cell>Nintendo</th> | ||
<td class="table__cell>Switch</td> | ||
<td class="table__cell></td> | ||
<td class="table__cell table__cell--numeric">$287.96</td> | ||
<td class="table__cell table__cell--numeric">300</td> | ||
<td class="table__cell table__cell--numeric">207</td> | ||
<td class="table__cell table__cell--numeric">95</td> | ||
<td class="table__cell table__cell--numeric">$17.99</td> | ||
<td class="table__cell>FREE</td> | ||
<td class="table__cell>4/1 - 4/5</td> | ||
</tr> | ||
<tr> | ||
<th class="table__cell>Nintendo</th> | ||
<td class="table__cell>SNES</td> | ||
<td class="table__cell></td> | ||
<td class="table__cell table__cell--numeric"> | ||
$89.85 | ||
</td> | ||
<td class="table__cell table__cell--numeric">45</td> | ||
<td class="table__cell table__cell--numeric">17</td> | ||
<td class="table__cell table__cell--numeric">5</td> | ||
<td class="table__cell table__cell--numeric">$18.95</td> | ||
<td class="table__cell>FREE</td> | ||
<td class="table__cell>4/11 - 4/15</td> | ||
</tr> | ||
<tr> | ||
<th class="table__cell>Microsoft</th> | ||
<td class="table__cell>XBOX 360</td> | ||
<td class="table__cell></td> | ||
<td class="table__cell table__cell--numeric">$499.99</td> | ||
<td class="table__cell table__cell--numeric">345</td> | ||
<td class="table__cell table__cell--numeric">455</td> | ||
<td class="table__cell table__cell--numeric">205</td> | ||
<td class="table__cell table__cell--numeric">$17.99</td> | ||
<td class="table__cell>FREE</td> | ||
<td class="table__cell>4/17 - 4/25</td> | ||
</tr> | ||
<tr> | ||
<th class="table__cell>Microsoft</th> | ||
<td class="table__cell>XBOX One</td> | ||
<td class="table__cell></td> | ||
<td class="table__cell table__cell--numeric">$499.99</td> | ||
<td class="table__cell table__cell--numeric">399</td> | ||
<td class="table__cell table__cell--numeric">407</td> | ||
<td class="table__cell table__cell--numeric">305</td> | ||
<td class="table__cell table__cell--numeric">$27.99</td> | ||
<td class="table__cell>FREE</td> | ||
<td class="table__cell>4/9 - 4/11</td> | ||
</tr> | ||
<tr> | ||
<th class="table__cell>Sony</th> | ||
<td class="table__cell>Playstation 5</td> | ||
<td class="table__cell></td> | ||
<td class="table__cell table__cell--numeric">$519.99</td> | ||
<td class="table__cell table__cell--numeric">205</td> | ||
<td class="table__cell table__cell--numeric">265</td> | ||
<td class="table__cell table__cell--numeric">199</td> | ||
<td class="table__cell table__cell--numeric">$29.99</td> | ||
<td class="table__cell>FREE</td> | ||
<td class="table__cell>4/11 - 4/15</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
`; | ||
|
||
export const relaxed = () => ` | ||
<div class="table table--density-relaxed" role="group" aria-label="Video games for sale" tabindex="0"> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Seller</th> | ||
<th>Item</th> | ||
<th>Image</th> | ||
<th class="table__cell table__cell--numeric">List Price</th> | ||
<th class="table__cell table__cell--numeric">Quantity Available</th> | ||
<th class="table__cell table__cell--numeric">Quantity Sold</th> | ||
<th class="table__cell table__cell--numeric">Watchers</th> | ||
<th class="table__cell table__cell--numeric">Protection</th> | ||
<th>Shipping</th> | ||
<th>Delivery</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<th class="table__cell>Nintendo</th> | ||
<td class="table__cell>Switch</td> | ||
<td class="table__cell></td> | ||
<td class="table__cell table__cell--numeric">$287.96</td> | ||
<td class="table__cell table__cell--numeric">300</td> | ||
<td class="table__cell table__cell--numeric">207</td> | ||
<td class="table__cell table__cell--numeric">95</td> | ||
<td class="table__cell table__cell--numeric">$17.99</td> | ||
<td class="table__cell>FREE</td> | ||
<td class="table__cell>4/1 - 4/5</td> | ||
</tr> | ||
<tr> | ||
<th class="table__cell>Nintendo</th> | ||
<td class="table__cell>SNES</td> | ||
<td class="table__cell></td> | ||
<td class="table__cell table__cell--numeric"> | ||
$89.85 | ||
</td> | ||
<td class="table__cell table__cell--numeric">45</td> | ||
<td class="table__cell table__cell--numeric">17</td> | ||
<td class="table__cell table__cell--numeric">5</td> | ||
<td class="table__cell table__cell--numeric">$18.95</td> | ||
<td class="table__cell>FREE</td> | ||
<td class="table__cell>4/11 - 4/15</td> | ||
</tr> | ||
<tr> | ||
<th class="table__cell>Microsoft</th> | ||
<td class="table__cell>XBOX 360</td> | ||
<td class="table__cell></td> | ||
<td class="table__cell table__cell--numeric">$499.99</td> | ||
<td class="table__cell table__cell--numeric">345</td> | ||
<td class="table__cell table__cell--numeric">455</td> | ||
<td class="table__cell table__cell--numeric">205</td> | ||
<td class="table__cell table__cell--numeric">$17.99</td> | ||
<td class="table__cell>FREE</td> | ||
<td class="table__cell>4/17 - 4/25</td> | ||
</tr> | ||
<tr> | ||
<th class="table__cell>Microsoft</th> | ||
<td class="table__cell>XBOX One</td> | ||
<td class="table__cell></td> | ||
<td class="table__cell table__cell--numeric">$499.99</td> | ||
<td class="table__cell table__cell--numeric">399</td> | ||
<td class="table__cell table__cell--numeric">407</td> | ||
<td class="table__cell table__cell--numeric">305</td> | ||
<td class="table__cell table__cell--numeric">$27.99</td> | ||
<td class="table__cell>FREE</td> | ||
<td class="table__cell>4/9 - 4/11</td> | ||
</tr> | ||
<tr> | ||
<th class="table__cell>Sony</th> | ||
<td class="table__cell>Playstation 5</td> | ||
<td class="table__cell></td> | ||
<td class="table__cell table__cell--numeric">$519.99</td> | ||
<td class="table__cell table__cell--numeric">205</td> | ||
<td class="table__cell table__cell--numeric">265</td> | ||
<td class="table__cell table__cell--numeric">199</td> | ||
<td class="table__cell table__cell--numeric">$29.99</td> | ||
<td class="table__cell>FREE</td> | ||
<td class="table__cell>4/11 - 4/15</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
`; |
Oops, something went wrong.