Skip to content

Commit 68d9788

Browse files
jawinnpfulton
andauthored
docs(button): fix appearance of pending in forced colors story (#2602)
* docs(button): fix appearance of pending in forced colors story The pending icon was not appearing in the Button story titled "With Forced Colors". Updates a conditional in the template so the progress circle renders. * chore(button): resolve eslint error --------- Co-authored-by: Patrick Fulton <[email protected]>
1 parent c1ae008 commit 68d9788

File tree

1 file changed

+27
-26
lines changed

1 file changed

+27
-26
lines changed

components/button/stories/template.js

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,38 @@ import { Template as ProgressCircle } from "@spectrum-css/progresscircle/stories
1313
import "../index.css";
1414

1515
export const Template = ({
16-
rootClass = "spectrum-Button",
17-
id,
18-
customClasses = [],
19-
customStyles = {},
20-
size = "m",
21-
label,
22-
hideLabel = false,
23-
iconName,
24-
iconAfterLabel = false,
25-
variant,
26-
staticColor,
27-
treatment,
28-
onclick,
29-
isDisabled = false,
30-
isPending = false,
31-
isPendingStory = false,
32-
ariaExpanded,
33-
ariaControls,
34-
...globals
16+
rootClass = "spectrum-Button",
17+
id,
18+
customClasses = [],
19+
customStyles = {},
20+
size = "m",
21+
label,
22+
hideLabel = false,
23+
iconName,
24+
iconAfterLabel = false,
25+
variant,
26+
staticColor,
27+
treatment,
28+
onclick,
29+
isDisabled = false,
30+
isPending = false,
31+
isPendingStory = false,
32+
ariaExpanded,
33+
ariaControls,
34+
...globals
3535
}) => {
3636
const { express } = globals;
3737
try {
3838
if (express) import(/* webpackPrefetch: true */ "../themes/express.css");
3939
else import(/* webpackPrefetch: true */ "../themes/spectrum.css");
40-
} catch (e) {
40+
}
41+
catch (e) {
4142
console.warn(e);
4243
}
4344

44-
const [, updateArgs] = useArgs();
45+
const [, updateArgs] = useArgs();
4546

46-
return html`
47+
return html`
4748
<button
4849
class=${classMap({
4950
[rootClass]: true,
@@ -72,15 +73,15 @@ export const Template = ({
7273
() => html`<span class=${`${rootClass}-label`}>${label}</span>`
7374
)}
7475
${when(iconName && iconAfterLabel, () => Icon({ ...globals, iconName, size }))}
75-
${when(isPendingStory, () => {
76-
const isOverBackground = staticColor === 'white';
76+
${when(isPendingStory || isPending, () => {
77+
const isOverBackground = staticColor === "white";
7778
return ProgressCircle({
7879
...globals,
79-
size: 's',
80+
size: "s",
8081
overBackground: isOverBackground,
8182
isIndeterminate: true,
8283
addStaticBackground: false
83-
})
84+
});
8485
})}
8586
</button>
8687
`;

0 commit comments

Comments
 (0)