Skip to content

Commit

Permalink
chore: vrt enhancements for button & actionbutton (#2578)
Browse files Browse the repository at this point in the history
  • Loading branch information
castastrophe committed Mar 28, 2024
1 parent 7423db5 commit f7e6ea8
Show file tree
Hide file tree
Showing 17 changed files with 806 additions and 606 deletions.
10 changes: 9 additions & 1 deletion .storybook/decorators/contextsWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,15 @@ export const withContextWrapper = makeDecorator({
for (const s of scales) {
container.classList.toggle(`spectrum--${s}`, s === scale);
}
}, [color, scale, isExpress]);

if (args.staticColor === "black") {
container.style.backgroundColor = "rgb(181, 209, 211)";
} else if (args.staticColor === "white") {
container.style.backgroundColor = "rgb(15, 121, 125)";
} else {
container.style.removeProperty("background-color");
}
}, [color, scale, isExpress, args.staticColor]);

return StoryFn(context);
},
Expand Down
8 changes: 8 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ module.exports = {
implementation: require("postcss"),
postcssOptions: {
config: resolve(__dirname, "../postcss.config.js"),
additionalPlugins: {
"postcss-pseudo-classes": {
restrictTo: ['focus-visible', 'focus-within', 'hover', 'active', 'disabled'],
allCombinations: true,
preserveBeforeAfter: false,
prefix: 'is-'
},
}
},
},
},
Expand Down
3 changes: 3 additions & 0 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@ addons.setConfig({
}),
sidebar: {
showRoots: false,
filters: {
patterns: (item) => !item.id.includes('forced-colors'),
}
},
});
1 change: 1 addition & 0 deletions .storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"lodash-es": "^4.17.21",
"postcss": "^8.4.35",
"postcss-loader": "^8.1.1",
"postcss-pseudo-classes": "^0.4.0",
"prettier": "^2.8.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
1 change: 1 addition & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export const parameters = {
panelPosition: "bottom",
showToolbar: true,
isFullscreen: false,
actions: { argTypesRegex: '^on.*' },
options: {
storySort: {
method: "alphabetical",
Expand Down
55 changes: 0 additions & 55 deletions components/actionbutton/stories/actionbutton-quiet.stories.js

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit f7e6ea8

Please sign in to comment.