|
| 1 | +--- |
| 2 | +"@spectrum-css/table": major |
| 3 | +--- |
| 4 | + |
| 5 | +### S2 table migration |
| 6 | + |
| 7 | +Compared to the S1 table, this component has updated corner rounding, updated color tokens, some updated spacing, and an overall refreshed look. |
| 8 | + |
| 9 | +#### Net-new features |
| 10 | + |
| 11 | +- The S2 table supports an empty state, rendering an illustrated message component. |
| 12 | +- As data is loading to the table, this component will render a progress circle during the loading state. |
| 13 | +- 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.) |
| 14 | +- 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. |
| 15 | +- Tables support thumbnail, avatar, and icon components as content within a cell. |
| 16 | +- Focus indicators for entire rows have been updated for rows to include a side focus indicator. |
| 17 | + |
| 18 | +#### Description of other S2 table work |
| 19 | + |
| 20 | +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. |
| 21 | + |
| 22 | +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`. |
| 23 | + |
| 24 | +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: |
| 25 | + |
| 26 | +- `.spectrum-Table-thumbnailInner` >> `.spectrum-Table-visualInner` |
| 27 | + |
| 28 | +- `.spectrum-Table-row--thumbnail` >> **removed** |
| 29 | +- `.spectrum-Table-cell--thumbnail` >> **removed** |
| 30 | +- `.spectrum-Table-thumbnailInner` >> **removed** |
| 31 | +- `.spectrum-Table-thumbnailContent` >> **removed** |
| 32 | +- `.spectrum-Table-thumbnailInner` >> **removed** |
| 33 | + |
| 34 | +The drop zones have been refactored to approach the drop zone indicators as pseudo elements, as opposed to `outline` properties. |
| 35 | + |
| 36 | +Because there are multiple sort icons in the S2 table, `.spectrum-Table-sortedIcon` has been renamed to `.spectrum-Table-sortIcon`. |
| 37 | + |
| 38 | +Individual cell focus rings have rounded corners. |
| 39 | + |
| 40 | +The outer table border extends all the way around the `thead`/`div` equivalent. |
| 41 | + |
| 42 | +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. |
| 43 | + |
| 44 | +#### Mods |
| 45 | + |
| 46 | +##### Renamed Modifiers |
| 47 | + |
| 48 | +| Old Modifier | New modifier | |
| 49 | +| -------------------------------------------------- | ------------------------------------------------- | |
| 50 | +| `--mod-table-border-radius--quiet` | `--mod-table-border-radius-quiet` | |
| 51 | +| `--mod-table-header-top-to-text` | `--mod-table-header-row-top-to-text` | |
| 52 | +| `--mod-table-header-bottom-to-text` | `--mod-table-header-row-bottom-to-text` | |
| 53 | +| `--mod-table-cell-inline-space` | `--mod-table-cell-inline-spacing` | |
| 54 | +| `--mod-table-checkbox-to-text` | `--mod-table-checkbox-to-cell-content` | |
| 55 | +| `--mod-table-header-background-color--quiet` | `--mod-table-header-background-color-quiet` | |
| 56 | +| `--mod-table-header-bottom-to-text` | `--mod-table-header-row-bottom-to-text` | |
| 57 | +| `--mod-table-header-top-to-text` | `--mod-table-header-row-top-to-text` | |
| 58 | +| `--mod-table-min-row-height--compact` | `--mod-table-min-row-height-compact` | |
| 59 | +| `--mod-table-min-row-height--spacious` | `--mod-table-min-row-height-spacious` | |
| 60 | +| `--mod-table-outer-border-inline-width--quiet` | `--mod-table-outer-border-inline-width-quiet` | |
| 61 | +| `--mod-table-row-background-color--quiet` | `--mod-table-row-background-color-quiet` | |
| 62 | +| `--mod-table-row-checkbox-block-spacing--compact` | `--mod-table-row-checkbox-block-spacing-compact` | |
| 63 | +| `--mod-table-row-checkbox-block-spacing--spacious` | `--mod-table-row-checkbox-block-spacing-spacious` | |
| 64 | +| `--mod-table-thumbnail-to-text` | `--mod-table-visual-to-text` | |
| 65 | + |
| 66 | +##### New Modifiers |
| 67 | + |
| 68 | +- `--mod-table-avatar-size` |
| 69 | +- `--mod-table-avatar-size-compact` |
| 70 | +- `--mod-table-avatar-size-spacious` |
| 71 | +- `--mod-table-section-header-inline-start-spacing` |
| 72 | +- `--mod-table-summary-row-bottom-to-text` |
| 73 | +- `--mod-table-summary-row-min-height` |
| 74 | +- `--mod-table-summary-row-top-to-text` |
| 75 | + |
| 76 | +##### Removed Modifiers |
| 77 | + |
| 78 | +- `--mod-table-edge-to-content` |
| 79 | +- `--mod-table-header-row-checkbox-block-spacing` |
| 80 | +- `--mod-table-avatar-size-spacious` |
| 81 | +- `--mod-table-row-bottom-to-text--compact` |
| 82 | +- `--mod-table-row-bottom-to-text--spacious` |
| 83 | +- `--mod-table-row-top-to-text--compact` |
| 84 | +- `--mod-table-row-top-to-text--spacious` |
| 85 | +- `--mod-table-thumbnail-block-spacing"` |
| 86 | +- `--mod-table-thumbnail-block-spacing-compact` |
| 87 | +- `--mod-table-thumbnail-block-spacing-spacious` |
0 commit comments