Skip to content

Commit da201fc

Browse files
Kailash ChandraKailash Chandra
authored andcommitted
Updated Storybook
1 parent 76e7a1e commit da201fc

4 files changed

Lines changed: 32 additions & 30 deletions

File tree

.changeset/real-grapes-shave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'create-universal-react': minor
3+
---
4+
5+
Changed Storybook Configuration

templates/common/src/components/atoms/Button/Button.stories.tsx renamed to templates/common/src/components/atoms/Button/Button.story.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
import React from "react";
2-
import { withKnobs, text, optionsKnob } from "@storybook/addon-knobs";
1+
import React from 'react';
2+
import { withKnobs, text, optionsKnob } from '@storybook/addon-knobs';
33

4-
import Button from "./index";
4+
import Button from './index';
55

66
/* eslint import/no-anonymous-default-export: [2, {"allowObject": true}] */
77
export default {
8-
title: "Example/Button",
8+
title: 'Example/Button',
99
component: Button,
1010
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
1111
argTypes: {},
12-
decorators: [withKnobs],
12+
decorators: [withKnobs]
1313
};
1414

1515
const Template = (args) => <Button {...args} />;
1616

1717
export const Primary = Template.bind({});
1818
Primary.args = {
19-
children: text("Label", "Button"),
19+
children: text('Label', 'Button')
2020
};
2121

2222
export const KnobExample = () => (
2323
<Button
2424
theme={optionsKnob(
25-
"Theme",
26-
{ Primary: "primary", Secondary: "secondary" },
27-
"primary",
28-
{ display: "select" }
25+
'Theme',
26+
{ Primary: 'primary', Secondary: 'secondary' },
27+
'primary',
28+
{ display: 'select' }
2929
)}
3030
>
31-
{text("Label", "Button")}
31+
{text('Label', 'Button')}
3232
</Button>
3333
);
Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
1-
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
2-
const path = require("path");
1+
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
2+
const path = require('path');
33

44
module.exports = {
55
addons: [
6-
"@storybook/addon-a11y",
7-
"@storybook/addon-actions",
8-
"@storybook/addon-docs",
9-
"@storybook/addon-knobs",
10-
"@storybook/addon-links",
11-
"storybook-design-token",
12-
"@storybook/addon-viewport",
6+
'@storybook/addon-a11y',
7+
'@storybook/addon-actions',
8+
'@storybook/addon-docs',
9+
'@storybook/addon-knobs',
10+
'@storybook/addon-links',
11+
'storybook-design-token',
12+
'@storybook/addon-viewport'
1313
],
14-
framework: "@storybook/react",
14+
framework: '@storybook/react',
1515
core: {
16-
builder: "webpack5",
16+
builder: 'webpack5'
1717
},
18-
stories: [
19-
"../../**/*.stories.mdx",
20-
"../../**/*.stories.@(js|jsx|ts|tsx)",
21-
],
18+
stories: ['../../**/*.story.mdx', '../../**/*.story.@(js|jsx|ts|tsx)'],
2219
webpackFinal: async (config) => {
2320
config.resolve.plugins = [
2421
...(config.resolve.plugins || []),
2522
new TsconfigPathsPlugin({
2623
extensions: config.resolve.extensions,
27-
configFile: path.resolve("tsconfig.json"),
28-
}),
24+
configFile: path.resolve('tsconfig.json')
25+
})
2926
];
3027
return config;
31-
},
28+
}
3229
};

templates/common/storybook/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"storybook:build": "cd storybook && {commandType} build-storybook"
99
},
1010
"dependencies": {
11-
"@babel/core": "^7.15.5",
11+
"@babel/core": "^7.15.5",
1212
"@babel/preset-react": "^7.12.10",
1313
"@nextui-org/react": "^1.0.5-beta.5",
1414
"@storybook/addon-a11y": "^6.4.18",

0 commit comments

Comments
 (0)