Skip to content

Commit af95af7

Browse files
marissahuysentruytcastastrophe
authored andcommitted
chore: spectrum-two fixes (#3514)
* 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
1 parent eadcbf7 commit af95af7

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

components/picker/stories/picker.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export default {
9797
},
9898
isHovered,
9999
isActive,
100-
content: { table: { disable: true } },
100+
popoverContent: { table: { disable: true } },
101101
},
102102
args: {
103103
rootClass: "spectrum-Picker",

components/picker/stories/template.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ export const Picker = ({
6464
id=${id}
6565
style=${styleMap(customStyles)}
6666
type="button"
67-
@click=${() => {
68-
if (window.isChromatic()) return;
67+
@click=${function() {
6968
updateArgs({ isOpen: !isOpen });
7069
}}
7170
aria-labelledby=${ifDefined(ariaLabeledBy)}
@@ -109,6 +108,7 @@ export const Template = ({
109108
size = "m",
110109
label,
111110
labelPosition = "top",
111+
placeholder,
112112
helpText,
113113
isQuiet = false,
114114
isOpen = false,
@@ -125,7 +125,7 @@ export const Template = ({
125125
// Helps ensure that Popover appears below the Picker, with side labels layout.
126126
display: "block",
127127
},
128-
content = [],
128+
popoverContent = [],
129129
} = {}, context = {}) => {
130130
const pickerMarkup = Picker({
131131
size,
@@ -134,17 +134,18 @@ export const Template = ({
134134
isInvalid,
135135
isDisabled,
136136
isLoading,
137-
content,
137+
placeholder,
138+
popoverContent,
138139
labelPosition,
139140
ariaLabeledBy: fieldLabelId,
140141
}, context);
141142

142-
const popoverMarkup = content.length !== 0 ? Popover({
143+
const popoverMarkup = popoverContent.length !== 0 ? Popover({
143144
isOpen: isOpen && !isDisabled && !isLoading,
144145
withTip: false,
145146
position: "bottom",
146147
isQuiet,
147-
content,
148+
content: popoverContent,
148149
size,
149150
customStyles: customPopoverStyles,
150151
}, context) : "";
@@ -193,12 +194,6 @@ export const Template = ({
193194
}, context)
194195
)}
195196
</div>`;
196-
197-
// Make sure there is a wrapper around sibling components when using the Chromatic
198-
// template, so their layout is not affected by the flex and grid layouts used.
199-
if (window.isChromatic()) {
200-
return html`<div style="position: relative;">${markup}</div>`;
201-
}
202197
return markup;
203198
};
204199

components/tooltip/stories/template.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const Template = ({
1212
rootClass = "spectrum-Tooltip",
1313
label,
1414
placement,
15+
variant = "neutral",
1516
isOpen = true,
1617
isFocused = false,
1718
showOnHover = false,

0 commit comments

Comments
 (0)