Skip to content

Commit

Permalink
add a11y and figma addons
Browse files Browse the repository at this point in the history
  • Loading branch information
josefie committed Apr 28, 2022
1 parent bddce86 commit d3b9575
Show file tree
Hide file tree
Showing 6 changed files with 1,031 additions and 676 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ dist-ssr
*.sln
*.sw?
.history

.env
4 changes: 3 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ module.exports = {
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions"
"@storybook/addon-interactions",
"@storybook/addon-a11y", // TODO: vite fix https://github.com/storybookjs/storybook/pull/17997
"storybook-addon-designs"
],
"framework": "@storybook/react",
"core": {
Expand Down
8 changes: 7 additions & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { withDesign } from "storybook-addon-designs";

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
Expand All @@ -6,4 +8,8 @@ export const parameters = {
date: /Date$/,
},
},
}
}

export const decorators = [
withDesign
];
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
},
"devDependencies": {
"@babel/core": "^7.17.9",
"@storybook/addon-a11y": "^6.4.22",
"@storybook/addon-actions": "^6.4.21",
"@storybook/addon-essentials": "^6.4.21",
"@storybook/addon-interactions": "^6.4.21",
Expand All @@ -43,6 +44,7 @@
"@types/react-dom": "^17.0.10",
"@vitejs/plugin-react": "^1.0.7",
"babel-loader": "^8.2.4",
"storybook-addon-designs": "^6.2.1",
"typescript": "^4.5.4",
"vite": "^2.9.0",
"vite-plugin-dts": "^1.0.5"
Expand Down
7 changes: 7 additions & 0 deletions src/stories/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ export default {
argTypes: {
backgroundColor: { control: 'color' },
},
parameters: {
design: {
type: 'figspec',
accessToken: process.env.STORYBOOK_FIGMA_ACCESS_TOKEN,
url: 'https://www.figma.com/file/PJ7OUutWRrSHW6qgaPNW1l/Design-System-betterplace-GENERAL?node-id=361%3A1874',
}
}
} as ComponentMeta<typeof Button>;

// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
Expand Down
Loading

0 comments on commit d3b9575

Please sign in to comment.