chore: spectrum-two fixes#3514
Conversation
|
File metricsSummaryTotal size: 2.23 MB* 🎉 No changes detected in any packages * Size determined by adding together the size of the main file for all packages in the library.* Results are not gzipped or minified. * An ASCII character in UTF-8 is 8 bits or 1 byte. |
7099b51 to
7ec37a6
Compare
7ec37a6 to
db363d5
Compare
|
🚀 Deployed on https://pr-3514--spectrum-css.netlify.app |
| isHovered, | ||
| isActive, | ||
| content: { table: { disable: true } }, | ||
| popoverContent: { table: { disable: true } }, |
There was a problem hiding this comment.
During the picker docs-to-storybook migration, we tried to clarify this picker control by calling it popoverContent. This is the content that gets passed to the popover component in the template.
Popover has its own content arg, so that's why you'll see the content: popoverContent assignment.
There was a problem hiding this comment.
Separately, there might be more that we can pull from the docs migration PR listed above. It looks like some of those additional controls/args (like currentValue, isHovered, showWorkflowIcon, and maybe some others) are missing currently. That could probably be figured out in a separate PR.
| rootClass = "spectrum-Tooltip", | ||
| label, | ||
| placement, | ||
| variant = "neutral", |
There was a problem hiding this comment.
Looks like the informative & negative tooltips got added back to Figma 11/18/24 (approximately). We'll have to create a card to implement the CSS styles and stories (for the docs page & controls)
variant: {
name: "Variant",
type: { name: "string" },
table: {
type: { summary: "string" },
category: "Component",
},
options: ["neutral", "info", "negative"],
control: "inline-radio",
tooltip migration PR: https://github.com/adobe/spectrum-css/pull/2743/files#diff-14d4b487bc2de8da9dccaef67bce6cccc92cbce28e2ac16912884edbce436cbc
There was a problem hiding this comment.
🙀 Good catch! Who knew those variants would come back again?
8f25da7 to
c038203
Compare
| type="button" | ||
| @click=${() => { | ||
| if (window.isChromatic()) return; | ||
| @click=${function() { | ||
| updateArgs({ isOpen: !isOpen }); | ||
| }} |
There was a problem hiding this comment.
On main, this line is @click=${onclick}, and the onclick function was defined in the Popover call. This template is pretty different from main, so I plopped the function here for now.
Any thoughts or reservations on this?
There was a problem hiding this comment.
Just a nit, but should we keep it formatted as an arrow function? ✨
There was a problem hiding this comment.
I'm not sure I know enough about why this part of the code is different between the branches/how Chromatic normally handles Picker, but it does work as is, and would work as an arrow function as well 🤷♀️
cdransf
left a comment
There was a problem hiding this comment.
Ran through the validation steps and the only error I encountered were due to missing theme css files (which is out of scope and — I believe — fixed on spectrum-two).
| type="button" | ||
| @click=${() => { | ||
| if (window.isChromatic()) return; | ||
| @click=${function() { | ||
| updateArgs({ isOpen: !isOpen }); | ||
| }} |
There was a problem hiding this comment.
Just a nit, but should we keep it formatted as an arrow function? ✨
rise-erpelding
left a comment
There was a problem hiding this comment.
This works and fixes many of the other issues I was noticing in other components too!
This does a nice job preserving the changes from the picker migration in #2697 but keeps what we need to make things work! 🎉
| type="button" | ||
| @click=${() => { | ||
| if (window.isChromatic()) return; | ||
| @click=${function() { | ||
| updateArgs({ isOpen: !isOpen }); | ||
| }} |
There was a problem hiding this comment.
I'm not sure I know enough about why this part of the code is different between the branches/how Chromatic normally handles Picker, but it does work as is, and would work as an arrow function as well 🤷♀️
| rootClass = "spectrum-Tooltip", | ||
| label, | ||
| placement, | ||
| variant = "neutral", |
There was a problem hiding this comment.
🙀 Good catch! Who knew those variants would come back again?
7e783b6 to
e3585cd
Compare
- Tooltip was missing the `variant = "neutral"` arg, so adding that back in renders the component
- adds missing placeholder arg to template - corrects content arg to popoverContent
c038203 to
392cb52
Compare
* docs(tooltip): add missing args to template - Tooltip was missing the `variant = "neutral"` arg, so adding that back in renders the component * chore(picker): add/correct arg naming - adds missing placeholder arg to template - corrects content arg to popoverContent * chore(picker): remove window.isChromatic calls and click event
* docs(tooltip): add missing args to template - Tooltip was missing the `variant = "neutral"` arg, so adding that back in renders the component * chore(picker): add/correct arg naming - adds missing placeholder arg to template - corrects content arg to popoverContent * chore(picker): remove window.isChromatic calls and click event
* docs(tooltip): add missing args to template - Tooltip was missing the `variant = "neutral"` arg, so adding that back in renders the component * chore(picker): add/correct arg naming - adds missing placeholder arg to template - corrects content arg to popoverContent * chore(picker): remove window.isChromatic calls and click event
* docs(tooltip): add missing args to template - Tooltip was missing the `variant = "neutral"` arg, so adding that back in renders the component * chore(picker): add/correct arg naming - adds missing placeholder arg to template - corrects content arg to popoverContent * chore(picker): remove window.isChromatic calls and click event
* docs(tooltip): add missing args to template - Tooltip was missing the `variant = "neutral"` arg, so adding that back in renders the component * chore(picker): add/correct arg naming - adds missing placeholder arg to template - corrects content arg to popoverContent * chore(picker): remove window.isChromatic calls and click event
* docs(tooltip): add missing args to template - Tooltip was missing the `variant = "neutral"` arg, so adding that back in renders the component * chore(picker): add/correct arg naming - adds missing placeholder arg to template - corrects content arg to popoverContent * chore(picker): remove window.isChromatic calls and click event
* docs(tooltip): add missing args to template - Tooltip was missing the `variant = "neutral"` arg, so adding that back in renders the component * chore(picker): add/correct arg naming - adds missing placeholder arg to template - corrects content arg to popoverContent * chore(picker): remove window.isChromatic calls and click event
* docs(tooltip): add missing args to template - Tooltip was missing the `variant = "neutral"` arg, so adding that back in renders the component * chore(picker): add/correct arg naming - adds missing placeholder arg to template - corrects content arg to popoverContent * chore(picker): remove window.isChromatic calls and click event
Description
This PR reimplements some fixes for the
spectrum-twobranch after a rebase.variant = "neutral"default arg to the tooltip template. This should alleviate the errors on the docs page.Before 🚫

After ✅

WithTooltipstory calls for the tooltip component. 🥳Before 🚫

After ✅

window.isChromatichave been removed. It also corrects the arg names for picker, in order for them to be properly passed to the popover used in the template and render the content. This should alleviate all errors and most of the missing content on the docs page. (additional styling and content changes will need to be addressed in a separate PR).Before 🚫

After ✅

Before 🚫

After ✅

Before 🚫

After ✅

How and where has this been tested?
Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.
Validation steps
variant is not definedappear in place of theWithTooltipstory canvas. Each story step in the steplist should have a rendered tooltip with step number content.window.isChromatic(). All form components should render with a closed picker component that displays the placeholder text.variant is not defined. All tooltips should now display as expected.window.isChromatic(). The overflow tabs components should render with a closed picker component that displays the first tab item's text & chevron.Regression testing
Validate:
Screenshots
To-do list