Skip to content

feat(swatch+swatchgroup): S2 migration #3677

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

Open
wants to merge 30 commits into
base: spectrum-two
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3e96e97
feat(swatch+swatchgroup): S2 migration
cdransf Apr 16, 2025
4aede42
chore(swatch+swatchgroup): update tokens and mods
cdransf Apr 17, 2025
30ec559
chore(swatch+swatchgroup): support interactive states for add swatch …
cdransf Apr 17, 2025
a52f84b
chore(swatch+swatchgroup): add hovered hover + keyboard focus control…
cdransf Apr 17, 2025
653f959
chore(swatch+swatchgroup): add hovered hover + keyboard focus control…
cdransf Apr 17, 2025
c34b88c
chore(swatch+swatchgroup): add focus ring
cdransf Apr 18, 2025
8f00f71
chore(swatch+swatchgroup): spacing token updates and refactoring
cdransf Apr 18, 2025
4f1e18a
chore(swatch+swatchgroup): update custom vars to use opacity token
cdransf Apr 21, 2025
16fc9ef
fix(swatch+swatchgroup): duplicate custom properties
cdransf Apr 21, 2025
e548aa9
chore(swatch+swatchgroup): update changelog
cdransf Apr 21, 2025
37ec2a0
chore(swatch+swatchgroup): update corner rounding
cdransf Apr 21, 2025
9da47eb
fix(swatch+swatchgroup): style fix
cdransf Apr 21, 2025
7e64e93
fix(swatch+swatchgroup): no rounding is default; replace test case w/…
cdransf Apr 21, 2025
a5fdc6a
chore(swatch+swatchgroup): support swatchgroup border
cdransf Apr 22, 2025
0bcfa9f
chore(swatch+swatchgroup): swap none to partial rounding as the defau…
cdransf Apr 24, 2025
5939bdd
chore(swatch+swatchgroup): add mediumLarge density variant; remove co…
cdransf Apr 24, 2025
77ba4b1
chore(swatch+swatchgroup): story, control and test cleanup
cdransf Apr 24, 2025
d8bb20e
chore(swatch+swatchgroup): add hover + active states to add variation…
cdransf Apr 24, 2025
0992e7c
fix(swatch+swatchgroup): update border color
cdransf Apr 24, 2025
e6bd685
fix(swatch+swatchgroup): changelog + mod removal
cdransf Apr 24, 2025
f793b96
Update components/swatchgroup/index.css
cdransf Apr 24, 2025
40a4f7a
fix(swatch+swatchgroup): split medium + large sizing back out
cdransf Apr 24, 2025
0dbcb29
fix(swatch+swatchgroup): deduplicate controls inherited from swatch
cdransf Apr 24, 2025
aea0a3a
fix(swatch+swatchgroup): restore no rounding test
cdransf Apr 29, 2025
4866f22
fix(swatch+swatchgroup): improvements to WHC styles
cdransf Apr 29, 2025
82d6515
fix(swatch+swatchgroup): remove redundant focus state
cdransf Apr 29, 2025
57ecf28
fix(swatch+swatchgroup): remove disabled + selected controls for swat…
cdransf Apr 29, 2025
9704300
chore(swatch+swatchgroup): drop custom light/dark tokens
cdransf Apr 29, 2025
b9eb21f
chore(swatch+swatchgroup): update border color with note to update w/…
cdransf Apr 30, 2025
a044f6d
chore(swatch+swatchgroup): restore outline transition
cdransf Apr 30, 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
42 changes: 42 additions & 0 deletions .changeset/proud-schools-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
`@spectrum-css/swatchgroup`: major
`@spectrum-css/swatch`: major
---

#### S2 migration swatchgroup

This migrates the `swatch` and `swatchgroup` components to S2. Custom properties have been remapped and added per the design specification.

An `Add Swatch` variant has been added with the required color tokens and the specified add UI icon.

##### Removed custom properties

`--spectrum-swatch-border-color`
`--spectrum-swatch-dash-icon-color`

##### New custom properties

`--spectrum-swatch-border-color-rgb`
`--spectrum-swatch-border-opacity`
`--spectrum-corner-radius-full`
`--spectrum-corner-radius-none`
`--spectrum-swatch-disabled-icon-border-opacity`
`--spectrum-swatch-icon-color`
`--spectrum-swatch-rectangle-width-multiplier`
`--spectrum-swatchgroup-border-color`

##### New mods

`--mod-add-button-background`
`--mod-add-button-background-down`
`--mod-add-button-background-hover`
`--mod-add-button-background-keyboard-focus`
`--mod-corner-radius-full`
`--mod-mixed-button-background`
`--mod-swatchgroup-border-color`
`--mod-swatch-border-color-rgb`
`--mod-swatch-border-opacity`

##### Removed mods

`--mod-swatchgroup-spacing-compact`
62 changes: 47 additions & 15 deletions components/swatch/dist/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
".spectrum-Swatch",
".spectrum-Swatch .spectrum-Swatch-disabledIcon",
".spectrum-Swatch .spectrum-Swatch-fill",
".spectrum-Swatch--border .spectrum-Swatch-fill:before",
".spectrum-Swatch--lightBorder .spectrum-Swatch-fill:before",
".spectrum-Swatch--noBorder .spectrum-Swatch-fill:before",
".spectrum-Swatch--rectangle",
Expand All @@ -29,62 +30,81 @@
".spectrum-Swatch-disabledIcon path:last-child",
".spectrum-Swatch-fill",
".spectrum-Swatch-fill:before",
".spectrum-Swatch-icon",
".spectrum-Swatch-image",
".spectrum-Swatch-mixedValueIcon",
".spectrum-Swatch.is-addSwatch",
".spectrum-Swatch.is-addSwatch .spectrum-Swatch-fill",
".spectrum-Swatch.is-addSwatch .spectrum-Swatch-icon",
".spectrum-Swatch.is-addSwatch.is-keyboardFocused",
".spectrum-Swatch.is-addSwatch:active",
".spectrum-Swatch.is-addSwatch:focus-visible",
".spectrum-Swatch.is-addSwatch:hover",
".spectrum-Swatch.is-disabled",
".spectrum-Swatch.is-disabled .spectrum-Swatch-disabledIcon",
".spectrum-Swatch.is-image .spectrum-Swatch-fill:before",
".spectrum-Swatch.is-keyboardFocused",
".spectrum-Swatch.is-mixedValue",
".spectrum-Swatch.is-mixedValue .spectrum-Swatch-fill",
".spectrum-Swatch.is-mixedValue .spectrum-Swatch-mixedValueIcon",
".spectrum-Swatch.is-mixedValue .spectrum-Swatch-icon",
".spectrum-Swatch.is-nothing .spectrum-Swatch-fill",
".spectrum-Swatch.is-nothing .spectrum-Swatch-fill:after",
".spectrum-Swatch.is-nothing.spectrum-Swatch--rectangle .spectrum-Swatch-fill:after",
".spectrum-Swatch.is-selected",
".spectrum-Swatch.is-selected .spectrum-Swatch-fill",
".spectrum-Swatch.is-selected .spectrum-Swatch-fill:before",
".spectrum-Swatch.is-selected:before",
".spectrum-Swatch:after",
".spectrum-Swatch:before",
".spectrum-Swatch:focus-visible:after",
".spectrum-Swatch:focus-visible",
".spectrum-Swatch[disabled]",
".spectrum-Swatch[disabled] .spectrum-Swatch-disabledIcon"
],
"modifiers": [
"--mod-add-button-background",
"--mod-add-button-background-down",
"--mod-add-button-background-hover",
"--mod-add-button-background-keyboard-focus",
"--mod-animation-duration-100",
"--mod-corner-radius-full",
"--mod-mixed-button-background",
"--mod-swatch-border-color",
"--mod-swatch-border-color-light",
"--mod-swatch-border-color-rgb",
"--mod-swatch-border-color-selected",
"--mod-swatch-border-opacity",
"--mod-swatch-border-radius",
"--mod-swatch-border-thickness",
"--mod-swatch-border-thickness-selected",
"--mod-swatch-disabled-icon-color",
"--mod-swatch-disabled-icon-size",
"--mod-swatch-focus-indicator-border-radius",
"--mod-swatch-focus-indicator-color",
"--mod-swatch-focus-indicator-gap",
"--mod-swatch-focus-indicator-thickness",
"--mod-swatch-icon-border-color",
"--mod-swatch-icon-color",
"--mod-swatch-inner-border-color-selected",
"--mod-swatch-size",
"--mod-swatch-slash-icon-color",
"--mod-swatch-slash-thickness"
"--mod-swatch-slash-thickness",
"--mod-swatchgroup-border-color"
],
"component": [
"--spectrum-swatch-border-color",
"--spectrum-swatch-border-color-light",
"--spectrum-swatch-border-color-rgb",
"--spectrum-swatch-border-color-selected",
"--spectrum-swatch-border-opacity",
"--spectrum-swatch-border-radius",
"--spectrum-swatch-border-thickness",
"--spectrum-swatch-border-thickness-selected",
"--spectrum-swatch-dash-icon-color",
"--spectrum-swatch-disabled-icon-border-opacity",
"--spectrum-swatch-disabled-icon-color",
"--spectrum-swatch-disabled-icon-size",
"--spectrum-swatch-focus-indicator-border-radius",
"--spectrum-swatch-focus-indicator-color",
"--spectrum-swatch-focus-indicator-gap",
"--spectrum-swatch-focus-indicator-thickness",
"--spectrum-swatch-icon-border-color",
"--spectrum-swatch-icon-color",
"--spectrum-swatch-inner-border-color-selected",
"--spectrum-swatch-rectangle-width-multiplier",
"--spectrum-swatch-size",
"--spectrum-swatch-size-extra-small",
"--spectrum-swatch-size-large",
Expand All @@ -95,21 +115,32 @@
"--spectrum-swatch-slash-thickness-extra-small",
"--spectrum-swatch-slash-thickness-large",
"--spectrum-swatch-slash-thickness-medium",
"--spectrum-swatch-slash-thickness-small"
"--spectrum-swatch-slash-thickness-small",
"--spectrum-swatchgroup-border-color"
],
"global": [
"--spectrum-add-button-background",
"--spectrum-add-button-background-down",
"--spectrum-add-button-background-hover",
"--spectrum-add-button-background-keyboard-focus",
"--spectrum-animation-duration-100",
"--spectrum-border-width-100",
"--spectrum-border-width-200",
"--spectrum-corner-radius-100",
"--spectrum-corner-radius-75",
"--spectrum-corner-radius-full",
"--spectrum-corner-radius-none",
"--spectrum-focus-indicator-color",
"--spectrum-focus-indicator-gap",
"--spectrum-focus-indicator-thickness",
"--spectrum-gray-100",
"--spectrum-gray-1000",
"--spectrum-gray-1000-rgb",
"--spectrum-gray-200",
"--spectrum-gray-25",
"--spectrum-gray-800",
"--spectrum-gray-900",
"--spectrum-mixed-button-background",
"--spectrum-negative-visual-color",
"--spectrum-neutral-content-color-default",
"--spectrum-picked-color",
"--spectrum-red-900",
"--spectrum-white",
"--spectrum-workflow-icon-size-100",
"--spectrum-workflow-icon-size-200",
Expand All @@ -123,6 +154,7 @@
"--highcontrast-swatch-border-color-selected",
"--highcontrast-swatch-disabled-icon-color",
"--highcontrast-swatch-fill-foreground-color",
"--highcontrast-swatch-focus-indicator-color"
"--highcontrast-swatch-focus-indicator-color",
"--highcontrast-swatch-icon-color"
]
}
Loading
Loading