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 39 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
39 commits
Select commit Hold shift + click to select a range
aa50f7c
feat(swatch+swatchgroup): S2 migration
cdransf Apr 16, 2025
6b02b24
chore(swatch+swatchgroup): update tokens and mods
cdransf Apr 17, 2025
86d2d38
chore(swatch+swatchgroup): support interactive states for add swatch …
cdransf Apr 17, 2025
5ebbf51
chore(swatch+swatchgroup): add hovered hover + keyboard focus control…
cdransf Apr 17, 2025
f90cb81
chore(swatch+swatchgroup): add hovered hover + keyboard focus control…
cdransf Apr 17, 2025
52e9ac3
chore(swatch+swatchgroup): add focus ring
cdransf Apr 18, 2025
a6b73b7
chore(swatch+swatchgroup): spacing token updates and refactoring
cdransf Apr 18, 2025
1349cb8
chore(swatch+swatchgroup): update custom vars to use opacity token
cdransf Apr 21, 2025
2ffc938
fix(swatch+swatchgroup): duplicate custom properties
cdransf Apr 21, 2025
c71b0d4
chore(swatch+swatchgroup): update changelog
cdransf Apr 21, 2025
4693d9a
chore(swatch+swatchgroup): update corner rounding
cdransf Apr 21, 2025
143004e
fix(swatch+swatchgroup): style fix
cdransf Apr 21, 2025
d47df80
fix(swatch+swatchgroup): no rounding is default; replace test case w/…
cdransf Apr 21, 2025
58394cb
chore(swatch+swatchgroup): support swatchgroup border
cdransf Apr 22, 2025
f77cd17
chore(swatch+swatchgroup): swap none to partial rounding as the defau…
cdransf Apr 24, 2025
8fa7a11
chore(swatch+swatchgroup): add mediumLarge density variant; remove co…
cdransf Apr 24, 2025
b71022c
chore(swatch+swatchgroup): story, control and test cleanup
cdransf Apr 24, 2025
76c13f8
chore(swatch+swatchgroup): add hover + active states to add variation…
cdransf Apr 24, 2025
8a8f5ec
fix(swatch+swatchgroup): update border color
cdransf Apr 24, 2025
d8991b9
fix(swatch+swatchgroup): changelog + mod removal
cdransf Apr 24, 2025
61fa860
Update components/swatchgroup/index.css
cdransf Apr 24, 2025
5d188ea
fix(swatch+swatchgroup): split medium + large sizing back out
cdransf Apr 24, 2025
ae056fd
fix(swatch+swatchgroup): deduplicate controls inherited from swatch
cdransf Apr 24, 2025
3e77b19
fix(swatch+swatchgroup): restore no rounding test
cdransf Apr 29, 2025
d125d27
fix(swatch+swatchgroup): improvements to WHC styles
cdransf Apr 29, 2025
6aa2968
fix(swatch+swatchgroup): remove redundant focus state
cdransf Apr 29, 2025
c561823
fix(swatch+swatchgroup): remove disabled + selected controls for swat…
cdransf Apr 29, 2025
29fd7b2
chore(swatch+swatchgroup): drop custom light/dark tokens
cdransf Apr 29, 2025
97d5908
chore(swatch+swatchgroup): update border color with note to update w/…
cdransf Apr 30, 2025
da90588
chore(swatch+swatchgroup): restore outline transition
cdransf Apr 30, 2025
a1a42c9
chore(swatch+swatchgroup): clean up sizing, stories, tests and styles
cdransf May 5, 2025
0593cae
fix(swatch,swatchgroup): use relative rgb values for border colors
marissahuysentruyt May 5, 2025
ed08b41
fix(swatch+swatchgroup): disable stylelint for --spectrum-swatch-bord…
cdransf May 6, 2025
5947cef
fix(swatch+swatchgroup): remove lingering border style arg
cdransf May 6, 2025
3b7a986
chore(swatch+swatchgroup): refactor sizing, stories and tests to prop…
cdransf May 6, 2025
7567386
chore(swatch+swatchgroup): update background control description
cdransf May 6, 2025
3a6a83c
fix(swatch+swatchgroup): correct is-nothing slash direction + rectang…
cdransf May 6, 2025
f099a3b
fix(swatch+swatchgroup): add empty to test data; remove empty, add, m…
cdransf May 6, 2025
1d899cf
chore(swatch+swatchgroup): add migrated status + tag
cdransf May 7, 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 for Swatch group

This migrates the `swatch` and `swatchgroup` components to the latest Spectrum 2 designs. 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.

The `Add Swatch` and `Mixed Value` variants may not be combined with background colors or images.

The border should not be set when the swatch is selected as the border conflicts with the display of the selected state.

##### Removed custom properties

`--spectrum-swatch-border-color`
`--spectrum-swatch-dash-icon-color` (replaced by `--spectrum-swatch-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`
63 changes: 44 additions & 19 deletions components/swatch/dist/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
".spectrum-Swatch",
".spectrum-Swatch .spectrum-Swatch-disabledIcon",
".spectrum-Swatch .spectrum-Swatch-fill",
".spectrum-Swatch--lightBorder .spectrum-Swatch-fill:before",
".spectrum-Swatch--noBorder .spectrum-Swatch-fill:before",
".spectrum-Swatch--rectangle",
".spectrum-Swatch--roundingFull.is-selected:not(.spectrum-Swatch--rectangle) .spectrum-Swatch-fill",
".spectrum-Swatch--roundingFull.is-selected:not(.spectrum-Swatch--rectangle) .spectrum-Swatch-fill:before",
Expand All @@ -29,62 +27,79 @@
".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-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-mixedValue .spectrum-Swatch-icon",
".spectrum-Swatch.is-nothing.spectrum-Swatch--rectangle:not(.spectrum-Swatch.is-mixedValue, .spectrum-Swatch.is-addSwatch) .spectrum-Swatch-fill:after",
".spectrum-Swatch.is-nothing:not(.spectrum-Swatch.is-mixedValue, .spectrum-Swatch.is-addSwatch) .spectrum-Swatch-fill",
".spectrum-Swatch.is-nothing:not(.spectrum-Swatch.is-mixedValue, .spectrum-Swatch.is-addSwatch) .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",
"--mod-swatch-border-color",
"--mod-swatch-border-color-light",
"--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"
],
"component": [
"--spectrum-swatch-border",
"--spectrum-swatch-border-color",
"--spectrum-swatch-border-color-light",
"--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 @@ -98,18 +113,27 @@
"--spectrum-swatch-slash-thickness-small"
],
"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-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 +147,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