-
Notifications
You must be signed in to change notification settings - Fork 202
chore: spectrum-two fixes #3514
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,8 +64,7 @@ export const Picker = ({ | |
id=${id} | ||
style=${styleMap(customStyles)} | ||
type="button" | ||
@click=${() => { | ||
if (window.isChromatic()) return; | ||
@click=${function() { | ||
updateArgs({ isOpen: !isOpen }); | ||
}} | ||
Comment on lines
-68
to
69
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On Any thoughts or reservations on this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a nit, but should we keep it formatted as an arrow function? β¨ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 π€·ββοΈ |
||
aria-labelledby=${ifDefined(ariaLabeledBy)} | ||
|
@@ -109,6 +108,7 @@ export const Template = ({ | |
size = "m", | ||
label, | ||
labelPosition = "top", | ||
placeholder, | ||
helpText, | ||
isQuiet = false, | ||
isOpen = false, | ||
|
@@ -125,7 +125,7 @@ export const Template = ({ | |
// Helps ensure that Popover appears below the Picker, with side labels layout. | ||
display: "block", | ||
}, | ||
content = [], | ||
popoverContent = [], | ||
} = {}, context = {}) => { | ||
const pickerMarkup = Picker({ | ||
size, | ||
|
@@ -134,17 +134,18 @@ export const Template = ({ | |
isInvalid, | ||
isDisabled, | ||
isLoading, | ||
content, | ||
placeholder, | ||
popoverContent, | ||
labelPosition, | ||
ariaLabeledBy: fieldLabelId, | ||
}, context); | ||
|
||
const popoverMarkup = content.length !== 0 ? Popover({ | ||
const popoverMarkup = popoverContent.length !== 0 ? Popover({ | ||
isOpen: isOpen && !isDisabled && !isLoading, | ||
withTip: false, | ||
position: "bottom", | ||
isQuiet, | ||
content, | ||
content: popoverContent, | ||
size, | ||
customStyles: customPopoverStyles, | ||
}, context) : ""; | ||
|
@@ -193,12 +194,6 @@ export const Template = ({ | |
}, context) | ||
)} | ||
</div>`; | ||
|
||
// Make sure there is a wrapper around sibling components when using the Chromatic | ||
// template, so their layout is not affected by the flex and grid layouts used. | ||
if (window.isChromatic()) { | ||
return html`<div style="position: relative;">${markup}</div>`; | ||
} | ||
return markup; | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ export const Template = ({ | |
rootClass = "spectrum-Tooltip", | ||
label, | ||
placement, | ||
variant = "neutral", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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)
tooltip migration PR: https://github.com/adobe/spectrum-css/pull/2743/files#diff-14d4b487bc2de8da9dccaef67bce6cccc92cbce28e2ac16912884edbce436cbc There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π Good catch! Who knew those variants would come back again? |
||
isOpen = true, | ||
isFocused = false, | ||
showOnHover = false, | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
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 thecontent: popoverContent
assignment.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.
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.