Skip to content

Commit f20e1e7

Browse files
feat(table): migrate s2 tokens for colors/typography (#3818)
* feat(tokens): adds light/dark custom vars for selected row * chore(tokens): create changeset * docs(table): update stories and template - add focused cell to table states story - add sparkline chart story - adds hasChartContent arg to story file and story - handles hasChartContent in template markup - add sparkline svgs - add sparkline test case - correct wording in stories - adds hover state to table rows states test - updates table rows states story - updates cellCustomClasses to use is-focus-visible for focused cells - adds isHovered arg to template - updates isFocused arg to apply is-focus-visible class instead of is-focused * test(table): add hover state to table rows states test * feat(table): update tokens to s2 colors - updates row colors for header row, summary, section header, and selected row - updates sort icon colors - updates disclosure/menu icons - fixes checkbox indeterminate icon color - adds .spectrum-Table-headCell--alignEnd class - selected rows have a 1px border around all cells in blue - row focus should be indicated by the side-focus-indicator regardless of selection state. this means a focused+unselected row will have a 1px gray border around cells, while a focused+selected row will have a 1px blue border around cells. - adjacent selected rows have a 1px border between them in blue (avoids duplicate borders between cells) - adds support for CJK languages for line-height - adds missing font tokens for header and body row text - remove quiet table cell background colors lines - there's not really color changes specc'd out for the header table cell background states, so header table cell background states are removed - quiet and scroller styles fixed up - in focused unselected rows, the text color was the same as the background color. This is now fixed, and should also distinguish the focused+selected rows from the focused+unselected rows as well. - add missing mod from documentation - add sparkline chart styles - opts for border on the ::after pesudo element for the button's focus indicator - styles the button so it fills the header cell's space - corrects the icon colors in the head cells - fixes background colors, text colors, icon colors, interactive states, and border radius in high contrast mode for the button in the head cell - removes duplicate quiet styles - adds forced-color-adjust: none to avoid flash of orange button text color in WHCM - update cell borders in whcm - adds table mods to button passthroughs for fallbacks - removes transition on header cells - removes unnecessary commas in some property definitions - define summary row text color in WHCM - removes is-focused class from table rows and cells in favor of using :focus-visible and :focus pseudo-classes only. * chore(table): update metadata * chore(table): edit changesets - correct syntax in part 1 table changeset (fixes stray quote) - creates separate changeset for part 2 table migration only
1 parent 22a7dcb commit f20e1e7

File tree

14 files changed

+489
-146
lines changed

14 files changed

+489
-146
lines changed

.changeset/hip-shoes-listen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@spectrum-css/tokens": patch
3+
---
4+
5+
Adds `--spectrum-table-selected-row-background-color-rgb` to `light-vars.css` and `dark-vars.css` for custom tokens.

.changeset/petite-toys-greet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,6 @@ In Storybook, several new stories have been added to the docs page and the testi
8282
- `--mod-table-row-bottom-to-text--spacious`
8383
- `--mod-table-row-top-to-text--compact`
8484
- `--mod-table-row-top-to-text--spacious`
85-
- `--mod-table-thumbnail-block-spacing"`
85+
- `--mod-table-thumbnail-block-spacing`
8686
- `--mod-table-thumbnail-block-spacing-compact`
8787
- `--mod-table-thumbnail-block-spacing-spacious`

.changeset/real-jobs-flow.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
"@spectrum-css/table": minor
3+
---
4+
5+
### S2 table migration (continued)
6+
7+
#### Net-new features
8+
9+
- New sparkline SVGs available for cell content
10+
11+
#### Description of other S2 table work
12+
13+
A new `.spectrum-Table-headCell--alignEnd` class was created to correspond to tables that may have end-aligned numerical data so the head cell follows the text alignment correctly.
14+
15+
Semantically, if a table should enable column sorting, the content of a column's head cell should actually be a button, since it is triggering an action. If the column header cell could trigger a menu, the content of that cell should also be a button. New markup has been included to improve the semantic design of the content of header cells, utilizing button components to signify an action can be triggered, or a menu can be triggered.
16+
17+
In Storybook, new stories have been added to the docs page and the testing grid for Chromatic. These stories include `WithMenuButton`, `WithChartContent`. Documentation has been added for each of these stories, as well as expanded in other stories.
18+
19+
#### Mods
20+
21+
##### Renamed Modifiers
22+
23+
| Old Modifier | New modifier |
24+
| ------------------------------ | ----------------------------------------- |
25+
| `--mod-table-row-active-color` | `--mod-table-row-background-color-active` |
26+
27+
##### New Modifiers
28+
29+
- `--mod-table-header-font-style`
30+
- `--mod-table-header-icons-color-active`
31+
- `--mod-table-header-icons-color-default`
32+
- `--mod-table-header-icons-color-hover`
33+
- `--mod-table-header-icons-color-key-focus`
34+
- `--mod-table-row-font-family`
35+
- `--mod-table-row-font-style`
36+
- `--mod-table-row-text-color-active`
37+
- `--mod-table-row-text-color-hover`
38+
39+
##### Removed Modifiers
40+
41+
- `--mod-table-header-background-color-quiet`
42+
- `--mod-table-row-background-color-quiet`
Lines changed: 17 additions & 0 deletions
Loading
Lines changed: 17 additions & 0 deletions
Loading
Lines changed: 17 additions & 0 deletions
Loading
Lines changed: 17 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)