Skip to content

Commit f7e6ea8

Browse files
authored
chore: vrt enhancements for button & actionbutton (#2578)
1 parent 7423db5 commit f7e6ea8

File tree

17 files changed

+806
-606
lines changed

17 files changed

+806
-606
lines changed

.storybook/decorators/contextsWrapper.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@ export const withContextWrapper = makeDecorator({
4343
for (const s of scales) {
4444
container.classList.toggle(`spectrum--${s}`, s === scale);
4545
}
46-
}, [color, scale, isExpress]);
46+
47+
if (args.staticColor === "black") {
48+
container.style.backgroundColor = "rgb(181, 209, 211)";
49+
} else if (args.staticColor === "white") {
50+
container.style.backgroundColor = "rgb(15, 121, 125)";
51+
} else {
52+
container.style.removeProperty("background-color");
53+
}
54+
}, [color, scale, isExpress, args.staticColor]);
4755

4856
return StoryFn(context);
4957
},

.storybook/main.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@ module.exports = {
132132
implementation: require("postcss"),
133133
postcssOptions: {
134134
config: resolve(__dirname, "../postcss.config.js"),
135+
additionalPlugins: {
136+
"postcss-pseudo-classes": {
137+
restrictTo: ['focus-visible', 'focus-within', 'hover', 'active', 'disabled'],
138+
allCombinations: true,
139+
preserveBeforeAfter: false,
140+
prefix: 'is-'
141+
},
142+
}
135143
},
136144
},
137145
},

.storybook/manager.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,8 @@ addons.setConfig({
4949
}),
5050
sidebar: {
5151
showRoots: false,
52+
filters: {
53+
patterns: (item) => !item.id.includes('forced-colors'),
54+
}
5255
},
5356
});

.storybook/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"lodash-es": "^4.17.21",
4444
"postcss": "^8.4.35",
4545
"postcss-loader": "^8.1.1",
46+
"postcss-pseudo-classes": "^0.4.0",
4647
"prettier": "^2.8.8",
4748
"react": "^18.2.0",
4849
"react-dom": "^18.2.0",

.storybook/preview.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ export const parameters = {
187187
panelPosition: "bottom",
188188
showToolbar: true,
189189
isFullscreen: false,
190+
actions: { argTypesRegex: '^on.*' },
190191
options: {
191192
storySort: {
192193
method: "alphabetical",

components/actionbutton/stories/actionbutton-quiet.stories.js

Lines changed: 0 additions & 55 deletions
This file was deleted.

components/actionbutton/stories/actionbutton-staticblack.stories.js

Lines changed: 0 additions & 50 deletions
This file was deleted.

components/actionbutton/stories/actionbutton-staticwhite.stories.js

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)