-
Notifications
You must be signed in to change notification settings - Fork 207
feat(action-menu): S2 migration [CSS-1160] #4085
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
base: spectrum-two
Are you sure you want to change the base?
Conversation
📚 Branch previewPR #4085 has been deployed to Azure Blob Storage: https://spectrumcss.z13.web.core.windows.net/pr-4085/index.html. |
File metricsSummaryTotal size: 1.44 MB* Table reports on changes to a package's main file. Other changes can be found in the collapsed Details section below.
File change detailsactionbutton
actiongroup
actionmenu
menu
* An ASCII character in UTF-8 is 8 bits or 1 byte. |
2729f84
to
779e411
Compare
🦋 Changeset detectedLatest commit: 75c284c The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
635f709
to
242929c
Compare
4baa099
to
eb8cde2
Compare
313ee43
to
3babcfa
Compare
4d618da
to
f3fa4d4
Compare
f2ef53c
to
409436c
Compare
dbd613f
to
00038a9
Compare
96a7093
to
d1e6569
Compare
d1e6569
to
1ddcb45
Compare
@@ -23,6 +23,7 @@ export const CoachContainer = ( | |||
currentStep = 2, | |||
totalStepCount = 8, | |||
isOpen = false, | |||
alt = "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing an a11y feedback note from Chromatic.
@@ -39,6 +39,7 @@ export const Template = ({ | |||
fill, | |||
id = getRandomId("icon"), | |||
customClasses = [], | |||
customStyles = {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw a regression in the icon VRTs where the fill was inheriting to all icons due to the custom property's inheritance.
@@ -78,15 +78,12 @@ export default { | |||
labelledby: { table: { disable: true } }, | |||
items: { table: { disable: true } }, | |||
role: { table: { disable: true } }, | |||
subrole: { table: { disable: true } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subrole ended up being easier to intuit from the role instead of passing it through from the parent.
)} | ||
</ul> | ||
`, | ||
Template: ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Letting the template handle this logic because it's a bit duplicative to redefine it here and could lead to mismatches.
@@ -133,14 +127,14 @@ export const MenuItemGroup = Variants({ | |||
{ | |||
testHeading: "No selection, with thumbnails", | |||
description: undefined, | |||
thumbnailUrl: "thumbnail.png" | |||
hasThumbnail: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since thumbnail.png is the default, just the hasThumbnail is sufficient.
@@ -37,27 +41,38 @@ const Label = ({ | |||
isCollapsible = false, | |||
label, | |||
rootClass, | |||
role, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Labels can have roles too! 🥳
return html` | ||
<span | ||
role=${ifDefined(role)} | ||
id=${ifDefined(id)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need the id and role for switch labels.
@@ -258,6 +274,7 @@ export const MenuItem = ( | |||
hasExternalLink = false, | |||
hasActions = false, | |||
id = getRandomId("menuitem"), | |||
labelId = getRandomId("menuitem-label"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label id lets us connect the switch input field with the already present label for the menu item
1ddcb45
to
4a2cfe1
Compare
748e3cb
to
76988b3
Compare
".spectrum-ActionButton:not(:has(.spectrum-ActionButton-label))", | ||
"a.spectrum-ActionButton" | ||
], | ||
"modifiers": [ | ||
"--mod-actionbutton-animation-duration", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is for S2 and we've agreed to remove modifiers, I removed the mods on any lines I needed to update for this change anyway.
e4bf910
to
46a8a1b
Compare
color: inherit; | ||
transform: var(--spectrum-logical-rotation); | ||
} | ||
|
||
/* Focus indicator */ | ||
.spectrum-ActionButton { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just me tidying up a bit by combining these styles in with the initial definition for .spectrum-ActionButton
.spectrum-Menu-itemCheckbox { | ||
grid-area: checkmarkArea; | ||
} | ||
&.is-selectableMultiple:not(:has(.is-selectable)) .spectrum-Menu-itemCheckbox { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this not to prevent clash with the is-selectable placement.
46a8a1b
to
75c284c
Compare
Description
This PR:
@spectrum-css/actionmenu
component that composesActionButton
,Popover
, andMenu
to present action lists from a trigger.@spectrum-css/actionbutton
and@spectrum-css/actiongroup
to treat selection via.is-selected
as well as:where([aria-pressed="true"], [aria-expanded="true"])
to cover more accessibility use-cases while keeping selector specificity low.@spectrum-css/menu
to align with Spectrum 2 specifications and accessibility improvements.Design references:
Includes a changeset with the following bumps:
How and where has this been tested?
Action menu
stories (default, long-press, placements).Menu
stories for focus indicators, CJK line-height, external link/drill-in icons, thumbnails, and forced-colors behavior.Action button
andAction group
selected visuals using.is-selected
,[aria-pressed="true"]
, and[aria-expanded="true"]
.Validation steps
isOpen
and confirm popover/menu spacing and placement reflect updates..is-selected
, setaria-pressed="true"
, andaria-expanded="true"
; confirm identical visuals due to:where(...)
..is-selected
and ARIA attributes.Screenshots
To-do list
Notes for reviewers
:where([aria-pressed],[aria-expanded])
to avoid specificity issues and broaden accessibility support.References
https://github.com/changesets/changesets
https://www.figma.com/design/eoZHKJH9a3LJkHYCGt60Vb/S2-Token-specs?node-id=19758-3424