Skip to content
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

chore: Expandable component style refactor #3128

Conversation

williamjstanton
Copy link
Collaborator

@williamjstanton williamjstanton commented Feb 8, 2025

Summary

Fixes: #2954

Expandable style re-factor is needed with the new cs prop. We will need to update this component to use the new system level tokens via CSS variables.

Release Category

Tokens

Release Note

  • The ExpandableTarget component is now rendering the BaseButton component, and may have some small impact on the visual styling of the keyboard focus ring.
  • The ExpandableIcon stencil is extending the SystemIcon stencil, and may have had an impact on the chevron icon color.
  • Fixed an accessibility bug in the Avatar component where an aria-label string was rendered on a generic HTML element that did not have an explicit or implicit role

Checklist

For the Reviewer

  • PR title is short and descriptive
  • PR summary describes the change (Fixes/Resolves linked correctly)
  • PR Release Notes describes additional information useful to call out in a release message or removed if not applicable
  • Breaking Changes provides useful information to upgrade to this code or removed if not applicable

Where Should the Reviewer Start?

modules/labs-react/expandable/lib/Expandable.tsx
(all subcomponents)
Line 274: modules/react/avatar/lib/Avatar.tsx

Areas for Feedback? (optional)

  • Code
  • Documentation
  • Testing
  • Codemods

Testing Manually

Screenshots or GIFs (if applicable)

expandable-focus expandable-hover

Thank You Gif (optional)

William Stanton added 12 commits January 22, 2025 18:25
Explicit ARIA role is unnecessary when roles are implied from Element. If Element is button, then set aria-label string to altText, else aria-label is undefined. Consumers can pass ARIA role and aria-label through props if using Avatar in an informative way.
Replaced <Box> with <Element> to remove 'as' prop and simplify code.
Copy link

cypress bot commented Feb 8, 2025

Workday/canvas-kit    Run #8459

Run Properties:  status check passed Passed #8459  •  git commit 16ea7080d5 ℹ️: Merge 4a4ad0cceba863fbf143f1a3d4ba272ac7a270f7 into 1d31c5bee6dbae914e2af4f9f73d...
Project Workday/canvas-kit
Branch Review william-issue-2954-expandable-style-refactor
Run status status check passed Passed #8459
Run duration 02m 54s
Commit git commit 16ea7080d5 ℹ️: Merge 4a4ad0cceba863fbf143f1a3d4ba272ac7a270f7 into 1d31c5bee6dbae914e2af4f9f73d...
Committer William Stanton
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 21
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 936
View all changes introduced in this branch ↗︎
UI Coverage  21.29%
  Untested elements 1525  
  Tested elements 410  
Accessibility  99.28%
  Failed rules  6 critical   5 serious   0 moderate   2 minor
  Failed elements 98  

@williamjstanton williamjstanton changed the base branch from master to prerelease/major February 10, 2025 20:09
@mannycarrera4 mannycarrera4 added the ready for review Code is ready for review label Feb 13, 2025
@mannycarrera4
Copy link
Contributor

Looks like the gap / padding seems off

Your PR

image

Master

image

williamjstanton and others added 4 commits March 2, 2025 09:43
@@ -271,8 +271,7 @@ export const Avatar = createComponent('button')({
return (
<Element
ref={ref}
aria-label={altText}
role={Element === 'button' ? 'button' : 'img'}
aria-label={Element === 'button' ? altText : undefined}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@@ -191,6 +191,7 @@ export const systemIconStencil = createStencil({
),
},
}),
modifiers: {},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaulting this to an empty object. If you extend a stencil and it's missing a property, typescript doesn't know to default to an empty object and crashes.

@mannycarrera4 mannycarrera4 added automerge and removed ready for review Code is ready for review labels Mar 10, 2025
@alanbsmith alanbsmith merged commit 7dab7ee into Workday:prerelease/major Mar 10, 2025
18 of 20 checks passed
@williamjstanton williamjstanton deleted the william-issue-2954-expandable-style-refactor branch March 12, 2025 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expandable Styles Refactor
4 participants