Skip to content

Commit

Permalink
deploy: 9d3c7b0
Browse files Browse the repository at this point in the history
  • Loading branch information
eyevana committed Oct 16, 2023
1 parent 6a6797d commit 9af4910
Show file tree
Hide file tree
Showing 357 changed files with 11,291 additions and 246 deletions.
12 changes: 11 additions & 1 deletion 404.html

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion about/how-we-build/index.html

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion about/index.html

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion about/roadmap/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/style.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/css/style.css.map

Large diffs are not rendered by default.

151 changes: 151 additions & 0 deletions assets/packages/@rhds/elements/elements/rh-table/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Table

A table is a container for displaying information. It allows a user to scan, examine, and compare large amounts of data.

## Usage

### Title

Specify the title of the table using a `caption` element.

```html
<rh-table>
<table>
<caption>
Concerts
</caption>
<!-- ...table data -->
</table>
</rh-table>
```

### Column highlighting

To enable column highlighting, the `table` element must also include a `col` element for each column in the table, typically wrapped with a `colgroup`.

```html
<rh-table>
<table>
<caption>
Concerts
</caption>
<colgroup>
<col>
<col>
<col>
</colgroup>
<!-- ...table with three columns -->
</table>
</rh-table>
```

### Sorting

To enable sorting on a column, add an `rh-sort-button` as the last child of the `th` cell.

```html
<rh-table>
<table>
<caption>
Concerts
</caption>
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th scope="col" data-label="Date">Date</th>
<th scope="col" data-label="Event">Event<rh-sort-button></rh-sort-button></th>
<th scope="col" data-label="Venue">Venue<rh-sort-button></rh-sort-button></th>
</tr>
</thead>
<!-- ...table data sortable by Event and Venue -->
</table>
</rh-table>
```

### Summary

Additional information about the data in the table should be slotted into the `summary` slot after the `table` element.

```html
<rh-table>
<table>
<caption>
Concerts
</caption>
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th scope="col" data-label="Date">Date</th>
<th scope="col" data-label="Event">Event<rh-sort-button></rh-sort-button></th>
<th scope="col" data-label="Venue">Venue<rh-sort-button></rh-sort-button></th>
</tr>
</thead>
<tbody>
<tr>
<td data-label="Date">12 February</td>
<td data-label="Event">Waltz with Strauss</td>
<td data-label="Venue">Main Hall</td>
</tr>
<tr>
<td data-label="Date">24 March</td>
<td data-label="Event">The Obelisks</td>
<td data-label="Venue">West Wing</td>
</tr>
<tr>
<td data-label="Date">14 April</td>
<td data-label="Event">The What</td>
<td data-label="Venue">Main Hall</td>
</tr>
</tbody>
</table>
<small slot="summary">Dates and venues subject to change.</small>
</rh-table>
```

## Example

<rh-table>
<table>
<caption>
Concerts
</caption>
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th scope="col" data-label="Date">Date</th>
<th scope="col" data-label="Event">Event<rh-sort-button></rh-sort-button></th>
<th scope="col" data-label="Venue">Venue<rh-sort-button></rh-sort-button></th>
</tr>
</thead>
<tbody>
<tr>
<td data-label="Date">12 February</td>
<td data-label="Event">Waltz with Strauss</td>
<td data-label="Venue">Main Hall</td>
</tr>
<tr>
<td data-label="Date">24 March</td>
<td data-label="Event">The Obelisks</td>
<td data-label="Venue">West Wing</td>
</tr>
<tr>
<td data-label="Date">14 April</td>
<td data-label="Event">The What</td>
<td data-label="Venue">Main Hall</td>
</tr>
</tbody>
</table>
<small slot="summary">Dates and venues subject to change.</small>
</rh-table>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<link rel="stylesheet" href="../rh-table-lightdom.css">

<style>
section {
margin-top: var(--rh-space-5xl, 80px);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
</style>

<section>
<h2>Column headers</h2>
<p><strong>Note: </strong>Tables with no <code>thead</code> will not stack on mobile.</p>
<rh-table>
<table>
<tbody>
<tr>
<th scope="row">Date</th>
<td>12 February</td>
<td>24 March</td>
<td>14 April</td>
</tr>
<tr>
<th scope="row">Event</th>
<td>Waltz with Strauss</td>
<td>The Obelisks</td>
<td>The What</td>
</tr>
<tr>
<th scope="row">Venue</th>
<td>Main Hall</td>
<td>West Wing</td>
<td>Main Hall</td>
</tr>
</tbody>
</table>
</rh-table>
</section>

<script type="module">
import '@rhds/elements/rh-table/rh-table.js';
</script>
11 changes: 11 additions & 0 deletions assets/packages/@rhds/elements/elements/rh-table/demo/demo.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
section {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}

h2, p {
margin-top: var(--rh-space-5xl, 80px);
text-align: center;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<link rel="stylesheet" href="../rh-table-lightdom.css">

<style>
section {
margin-top: var(--rh-space-5xl, 80px);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
</style>

<section>
<h2>Basic</h2>
<rh-table>
<table>
<caption>
Concerts
</caption>
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th scope="col" data-label="Date">Date</th>
<th scope="col" data-label="Event">Event<rh-sort-button></rh-sort-button>
</th>
<th scope="col" data-label="Venue">Venue<rh-sort-button></rh-sort-button>
</th>
</tr>
</thead>
<tbody>
<tr>
<td data-label="Date">12 February</td>
<td data-label="Event">Waltz with Strauss</td>
<td data-label="Venue">Main Hall</td>
</tr>
<tr>
<td data-label="Date">24 March</td>
<td data-label="Event">The Obelisks</td>
<td data-label="Venue">West Wing</td>
</tr>
<tr>
<td data-label="Date">14 April</td>
<td data-label="Event">The What</td>
<td data-label="Venue">Main Hall</td>
</tr>
</tbody>
</table>
<small slot="summary">Dates and venues subject to change.</small>
</rh-table>
</section>

<script type="module">
import '@rhds/elements/rh-table/rh-table.js';
</script>
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<link rel="stylesheet" href="../rh-table-lightdom.css">

<style>
section {
margin-top: var(--rh-space-5xl, 80px);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
</style>

<section>
<h2>Row and column headers</h2>
<rh-table>
<table>
<caption>Delivery slots:</caption>
<col>
<col>
<col>
<col>
<col>
<col>
<thead>
<tr>
<td></td>
<th sortable scope="col" data-label="Monday">Monday</th>
<th sortable scope="col" data-label="Tuesday">Tuesday</th>
<th sortable scope="col" data-label="Wednesday">Wednesday</th>
<th sortable scope="col" data-label="Thursday">Thursday</th>
<th sortable scope="col" data-label="Friday">Friday</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">09:00 – 11:00</th>
<td data-label="Monday">Closed</td>
<td data-label="Tuesday">Open</td>
<td data-label="Wednesday">Open</td>
<td data-label="Thursday">Closed</td>
<td data-label="Friday">Closed</td>
</tr>
<tr>
<th scope="row">11:00 – 13:00</th>
<td data-label="Monday">Open</td>
<td data-label="Tuesday">Open</td>
<td data-label="Wednesday">Closed</td>
<td data-label="Thursday">Closed</td>
<td data-label="Friday">Closed</td>
</tr>
<tr>
<th cope="row">13:00 – 15:00</th>
<td data-label="Monday">Open</td>
<td data-label="Tuesday">Open</td>
<td data-label="Wednesday">Open</td>
<td data-label="Thursday">Closed</td>
<td data-label="Friday">Closed</td>
</tr>
<tr>
<th scope="row">15:00 – 17:00</th>
<td data-label="Monday">Closed</td>
<td data-label="Tuesday">Closed</td>
<td data-label="Wednesday">Closed</td>
<td data-label="Thursday">Open</td>
<td data-label="Friday">Open</td>
</tr>
</tbody>
</table>
</rh-table>
</section>

<script type="module">
import '@rhds/elements/rh-table/rh-table.js';
</script>
Loading

0 comments on commit 9af4910

Please sign in to comment.