-
Notifications
You must be signed in to change notification settings - Fork 234
docs(button, buttongroup, actionbutton, actiongroup): component analysis #5788
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: 2nd-gen-component-analysis
Are you sure you want to change the base?
docs(button, buttongroup, actionbutton, actiongroup): component analysis #5788
Conversation
|
📚 Branch Preview🔍 Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
Tachometer resultsCurrently, no packages are changed by this PR... |
### CSS => SWC implementation gaps | ||
|
||
**Missing from WC:** | ||
None. All CSS selectors have corresponding web component implementations. |
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.
Nit: should we remove this line break? ✨
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.
Looks good! Just a few nits (feel free to ignore them 😅) ✨
|
||
### CSS => SWC implementation gaps | ||
|
||
**Missing from WC:** |
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.
Same nit here ✨
```diff | ||
--- Legacy (CSS main branch) | ||
+++ Spectrum 2 (CSS spectrum-two branch) | ||
@@ -1,18 +1,18 @@ |
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.
Do we need this diff artifact? ✨
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.
Nice work on this! I think the only real "changes" necessary would be a correction in the progress circle size modifier class in the Button.md file, and maybe double checking the active
attribute for button as well.
The rest of my comments are either non-blocking or just questions!
</button> | ||
``` | ||
- `treatment` (values: `fill`, `outline`) - defaults to `fill` | ||
- `quiet` - boolean property that maps to `treatment` (when true, sets `treatment="outline"`) |
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 find this really strange to have a quiet property that just maps to a different property. Not that this is anything we can do about this now, but I do wonder why we even have this. Maybe something extends Button
(that I can't find very quickly) and that thing needs quiet?
</div> | ||
</button> | ||
``` | ||
- `icon-only` - indicates button contains only an icon without visible 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.
I guess I thought the button could be icon-only by just supplying an icon in the icon slot, but I see icon-only
in the SWC storybook, along with the boolean binding in ButtonBase
.
Speaking of ButtonBase
- is there any particular migration things we would need to mention specifically for that file? That seems like it might be out-of-scope for us, but I was just curious.
| `a.spectrum-Button` | Link variant | Missing from WC | | ||
| - | `pending-label` attribute | Missing from CSS | | ||
| - | `quiet` property (deprecated) | Missing from CSS | | ||
- `disabled` - disables the button |
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.
There might also be an active
state. That could potentially be for the link behaviors, though.
<span class="spectrum-Button-label">Label</span> | ||
|
||
### Action Items for Web Component Maintainers | ||
<!-- Icon can also appear after label when iconAfterLabel is 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.
🤯 I didn't even know this arg existed. It's not in our story args!
**Required Additions:** | ||
<!-- Progress Circle (when isPending is true) --> | ||
<div | ||
class="spectrum-ProgressCircle spectrum-ProgressCircle--sizeS spectrum-ProgressCircle--indeterminate" |
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.
Looks like main
uses .spectrum-ProgressCircle--small
instead of a nice t-shirt size.
|
||
```html | ||
<div class="spectrum-ActionGroup spectrum-ActionGroup--sizeM"> | ||
<button class="spectrum-ActionButton spectrum-ActionGroup-item">...</button> |
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.
This may be unnecessary, but should we show that the t-shirt size of the action group trickles down to the individual action buttons at all?
Both the CSS and SWC components already do this, so I'm good with leaving it off as it is, too.
``` | ||
|
||
</details> | ||
|
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 think I left a similar comment with button group- did we want to be super clear that CSS had no structural changes?
| `.spectrum-ActionGroup--justified .spectrum-ActionGroup-item` | Slotted buttons when `justified` | Implemented | | ||
| `.spectrum-ActionGroup:not(.spectrum-ActionGroup--vertical, .spectrum-ActionGroup--compact) .spectrum-ActionGroup-item` | Slotted buttons in regular mode | Implemented | | ||
|
||
**Note:** In CSS templates, `.spectrum-ActionGroup-item` is applied as a class to each child button. In SWC, the group uses `::slotted(*)` to style slotted action buttons without adding an additional class. |
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.
Nice! This note is a really great reminder. ❤️
| `.spectrum-ActionButton--sizeL` | `size="l"` | Implemented | | ||
| `.spectrum-ActionButton--sizeXL` | `size="xl"` | Implemented | | ||
|
||
#### Variants and treatments |
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.
Love the attribute column here! This is what I was thinking of when I made that other comment in button! 😍
#### WC-only attributes | ||
|
||
| SWC attribute | CSS equivalent | Notes | | ||
| ------------- | -------------- | --------------------------------------------- | | ||
| `toggles` | N/A | Manages selected state automatically on click | | ||
| `value` | N/A | Used for identification in action groups | | ||
| `role` | N/A | Dynamic ARIA role management | |
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.
This is a great idea- I might have to steal it 😊
Description
Creates AI-generated migration documentation to analyze component differences to guide SWC migration to S2, with human vetting. The documentation serves as a bridge between the migrated Spectrum 2 CSS work and the corresponding web components, in order to help engineers understand what needs to be implemented, updated, or aligned between the two systems to guide the development of 2nd generation web components.
This batch is for the components: Button, Button Group, Action Button, Action Group.
Motivation and context
Related issue(s)
SWC-1220
Screenshots (if appropriate)
N/A - Documentation only
Author's checklist
I have added automated tests to cover my changes.I have included a well-written changeset if my change needs to be published.Reviewer's checklist
patch
,minor
, ormajor
featuresResources that might help when reviewing
Note: These urls are set for the button component.
spectrum-two
branch)spectrum-two
Manual review test cases
Documentation Quality
Recommendation: It's probably easier to check out the files with proper markdown formatting. While you can change the display from source diff to rich diff within the PR, I prefer to look through the files on the branch
Cross-Reference Accuracy
metadata.json
filesDevice review