Skip to content

feat(table): s2 table migration layout part-1 #3799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
499d1a1
docs(table): refactors template
marissahuysentruyt May 16, 2025
053a371
docs(table): refactors story files
marissahuysentruyt May 16, 2025
886df17
feat(table): adds new table styles
marissahuysentruyt May 16, 2025
5156ac0
refactor(table): revert table stories to previous approach
marissahuysentruyt May 20, 2025
bdea751
refactor(table): revert template to previous approach
marissahuysentruyt May 20, 2025
db3aa6c
feat(table): add styles for headCells and icons
marissahuysentruyt May 20, 2025
5e90ed1
feat(table): styles for body/rows/cells borders/focus/dropzones
marissahuysentruyt May 21, 2025
806d915
docs(table): updates to stories
marissahuysentruyt May 21, 2025
67606b7
feat(table): updates visual styles
marissahuysentruyt May 21, 2025
c596376
chore(table): whitespace changes and visual/collapsible handling
marissahuysentruyt May 21, 2025
5ec91c6
feat(table): styles for section headers and summary rows
marissahuysentruyt May 21, 2025
d6feccf
feat(table): vertically center all text in cells
marissahuysentruyt May 21, 2025
8264493
docs(table): adds migrated badge
marissahuysentruyt May 21, 2025
73ce939
feat(table): styles for focus indicators
marissahuysentruyt May 21, 2025
584ba89
chore(table): update metadata.js
marissahuysentruyt May 21, 2025
5350bdf
fix(table): linting errors fixed
marissahuysentruyt May 21, 2025
08b0d15
docs(table): remove collapsible variants from autodocs
marissahuysentruyt May 22, 2025
488ef54
fix(table): adds extra block borders for row focus
marissahuysentruyt May 22, 2025
957a3c9
chore(table): expands test coverage
marissahuysentruyt May 22, 2025
6b71860
chore(table): checkboxes and multi select stories
marissahuysentruyt May 22, 2025
797f164
docs(table): isEmphasized is true by default
marissahuysentruyt May 22, 2025
dfef793
docs(table): add specfic alignEnd class for numerical data
marissahuysentruyt May 27, 2025
4f0a3e2
revert(table): remove excessive tab index attributes
marissahuysentruyt May 28, 2025
9f48d07
docs(table): update docs with tab stops info
marissahuysentruyt May 28, 2025
9731926
docs(table): add sortable column story
marissahuysentruyt May 28, 2025
e5f27bc
docs(table): adds docs for loading, cleans up numerical docs
marissahuysentruyt May 28, 2025
e14ed84
refactor(table): body drop target indicator is ::after
marissahuysentruyt May 28, 2025
90cbf3e
fix(table): fix layout shift when row is focused
marissahuysentruyt May 28, 2025
eccd937
chore(table): update metadata
marissahuysentruyt May 28, 2025
ae0a85a
docs(table): add sort test case
marissahuysentruyt May 28, 2025
1f48275
chore(table): add changeset
marissahuysentruyt May 28, 2025
28d197c
fix(table): remove border-block-end from header row
marissahuysentruyt May 29, 2025
85ca479
fix(table): update border-radius for focused cells
marissahuysentruyt May 29, 2025
d44d1fb
fix(table): remove old custom property ref to please linter
marissahuysentruyt May 29, 2025
04ae4c2
chore(table): update metadata
marissahuysentruyt May 29, 2025
1c2ba85
docs(table): add story for action button menu
marissahuysentruyt Jun 2, 2025
75a70c7
feat(table): add menu button styles
marissahuysentruyt Jun 2, 2025
af9a99f
chore(table): update metadata
marissahuysentruyt Jun 3, 2025
6d3c439
fix(table): add mod back in
marissahuysentruyt Jun 3, 2025
fe2d4d6
docs(table): update table stories file
marissahuysentruyt Jun 3, 2025
6fbeb3e
chore(table): sort and menu button markup
marissahuysentruyt Jun 3, 2025
a305b4d
fix(table): combine some menu button styles
marissahuysentruyt Jun 3, 2025
8194a6a
chore(table): update metadata
marissahuysentruyt Jun 3, 2025
174f72f
test(table): add/fixes tests for selection mode and menu button
marissahuysentruyt Jun 4, 2025
fdc1c9f
fix(table): fix checkbox margin in head cells
marissahuysentruyt Jun 4, 2025
b70b4ca
fix(table): fix section header padding
marissahuysentruyt Jun 4, 2025
81a8d2e
chore(table): update metadata
marissahuysentruyt Jun 4, 2025
98362dc
chore(table): updates for docs and template
marissahuysentruyt Jun 5, 2025
9079f57
chore(table): fix some changeset wording
marissahuysentruyt Jun 5, 2025
039f3fb
fix(table): refactor mask-image path to chevron svg
marissahuysentruyt Jun 5, 2025
f554829
fix(table): pr fixes
marissahuysentruyt Jun 5, 2025
101b69b
chore(table): update metadata
marissahuysentruyt Jun 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .changeset/petite-toys-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
"@spectrum-css/table": major
---

### S2 table migration

Compared to the S1 table, this component has updated corner rounding, updated color tokens, some updated spacing, and an overall refreshed look.

#### Net-new features

- The S2 table supports an empty state, rendering an illustrated message component.
- As data is loading to the table, this component will render a progress circle during the loading state.
- There are 2 selection modes: single-select and multi-select. Multi-select tables (`selectionMode: "multiple"`) render an indeterminate checkbox in the `thead`/`div` equivalent. Single-select tables (`selectionMode: "single"`) do not render the indeterminate checkbox in the header row. (Note: the `selectionMode` arg is disabled and will not render in the Storybook control table.)
- For tables with sortable column, there are three new S2 icons used: `Sort` to indicate "general" sorting, `SortUp` for ascending sort direction, `SortDown` for descending sort direction.
- Tables support thumbnail, avatar, and icon components as content within a cell.
- Focus indicators for entire rows have been updated for rows to include a side focus indicator.

#### Description of other S2 table work

T-shirt sizing for tables is not technically supported, so t-shirt size classes (i.e. `.spectrum-Table--sizeS`), have been removed across all density variants.

The `.spectrum-Table-cell--alignRight` class has been renamed to `.spectrum-Table-cell--alignEnd` to reflect the preference for "logical" positioning. The `.spectrum-Table-cell--alignCenter` class has been refactored to `.spectrum-Table-cell--alignStart`.

In S1, the CSS table component only supported thumbnails. Because the S2 table supports thumbnails, as well as avatars and icons, most of the language regarding thumbnails has also changed. For instance, the `showThumbnail` storybook arg was refactored to `visualElement`. The following CSS classes have been removed or refactored to remove the thumbnail language in favor of "visual" instead:

- `.spectrum-Table-thumbnailInner` >> `.spectrum-Table-visualInner`

- `.spectrum-Table-row--thumbnail` >> **removed**
- `.spectrum-Table-cell--thumbnail` >> **removed**
- `.spectrum-Table-thumbnailInner` >> **removed**
- `.spectrum-Table-thumbnailContent` >> **removed**
- `.spectrum-Table-thumbnailInner` >> **removed**

The drop zones have been refactored to approach the drop zone indicators as pseudo elements, as opposed to `outline` properties.

Because there are multiple sort icons in the S2 table, `.spectrum-Table-sortedIcon` has been renamed to `.spectrum-Table-sortIcon`.

Individual cell focus rings have rounded corners.

The outer table border extends all the way around the `thead`/`div` equivalent.

In Storybook, several new stories have been added to the docs page and the testing grid for Chromatic. These stories include `EmptyState`, `LoadingState`, `SingleSelect`, `NumericalData`, `TableStates`, `Sortable`. Documentation has been added for each of these stories, as well as expanded in other stories.

#### Mods

##### Renamed Modifiers

| Old Modifier | New modifier |
| -------------------------------------------------- | ------------------------------------------------- |
| `--mod-table-border-radius--quiet` | `--mod-table-border-radius-quiet` |
| `--mod-table-header-top-to-text` | `--mod-table-header-row-top-to-text` |
| `--mod-table-header-bottom-to-text` | `--mod-table-header-row-bottom-to-text` |
| `--mod-table-cell-inline-space` | `--mod-table-cell-inline-spacing` |
| `--mod-table-checkbox-to-text` | `--mod-table-checkbox-to-cell-content` |
| `--mod-table-header-background-color--quiet` | `--mod-table-header-background-color-quiet` |
| `--mod-table-header-bottom-to-text` | `--mod-table-header-row-bottom-to-text` |
| `--mod-table-header-top-to-text` | `--mod-table-header-row-top-to-text` |
| `--mod-table-min-row-height--compact` | `--mod-table-min-row-height-compact` |
| `--mod-table-min-row-height--spacious` | `--mod-table-min-row-height-spacious` |
| `--mod-table-outer-border-inline-width--quiet` | `--mod-table-outer-border-inline-width-quiet` |
| `--mod-table-row-background-color--quiet` | `--mod-table-row-background-color-quiet` |
| `--mod-table-row-checkbox-block-spacing--compact` | `--mod-table-row-checkbox-block-spacing-compact` |
| `--mod-table-row-checkbox-block-spacing--spacious` | `--mod-table-row-checkbox-block-spacing-spacious` |
| `--mod-table-thumbnail-to-text` | `--mod-table-visual-to-text` |

##### New Modifiers

- `--mod-table-avatar-size`
- `--mod-table-avatar-size-compact`
- `--mod-table-avatar-size-spacious`
- `--mod-table-section-header-inline-start-spacing`
- `--mod-table-summary-row-bottom-to-text`
- `--mod-table-summary-row-min-height`
- `--mod-table-summary-row-top-to-text`

##### Removed Modifiers

- `--mod-table-edge-to-content`
- `--mod-table-header-row-checkbox-block-spacing`
- `--mod-table-avatar-size-spacious`
- `--mod-table-row-bottom-to-text--compact`
- `--mod-table-row-bottom-to-text--spacious`
- `--mod-table-row-top-to-text--compact`
- `--mod-table-row-top-to-text--spacious`
- `--mod-table-thumbnail-block-spacing"`
- `--mod-table-thumbnail-block-spacing-compact`
- `--mod-table-thumbnail-block-spacing-spacious`
Loading
Loading