Skip to content

Commit

Permalink
feat(storybook): add story
Browse files Browse the repository at this point in the history
add support for `ts` in storybook
add story for `Email` component

fixes #18

Signed-off-by: Niloy Sikdar <niloysikdar30@gmail.com>
  • Loading branch information
niloysikdar committed Jun 18, 2022
1 parent 5d9f3fd commit e37b1d3
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// .babelrc

{
"presets": ["@babel/preset-env", "@babel/preset-typescript"]
}
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@
},
"devDependencies": {
"@babel/core": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-typescript": "^7.17.12",
"@commitlint/cli": "^17.0.2",
"@commitlint/config-conventional": "^17.0.2",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@storybook/addon-actions": "^6.5.9",
"@storybook/addon-docs": "^6.5.9",
"@storybook/addon-essentials": "^6.5.9",
"@storybook/addon-interactions": "^6.5.9",
"@storybook/addon-links": "^6.5.9",
Expand Down
13 changes: 13 additions & 0 deletions src/components/Email/Email.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { ComponentStory, ComponentMeta } from '@storybook/react';

import { Email } from './Email';

export default {
component: Email,
} as ComponentMeta<typeof Email>;

export const MyEmail: ComponentStory<typeof Email> = () => (
<Email>
<h2>Hello World</h2>
</Email>
);
2 changes: 1 addition & 1 deletion src/components/Email/Email.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ReactNode } from 'react';

interface EmailProps {
export interface EmailProps {
children?: ReactNode;
}

Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@
"@babel/helper-create-regexp-features-plugin" "^7.16.7"
"@babel/helper-plugin-utils" "^7.16.7"

"@babel/preset-env@^7.12.11":
"@babel/preset-env@^7.12.11", "@babel/preset-env@^7.18.2":
version "7.18.2"
resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.18.2.tgz#f47d3000a098617926e674c945d95a28cb90977a"
integrity sha512-PfpdxotV6afmXMU47S08F9ZKIm2bJIQ0YbAAtDfIENX7G1NUAXigLREh69CWDjtgUy7dYn7bsMzkgdtAlmS68Q==
Expand Down Expand Up @@ -1039,7 +1039,7 @@
"@babel/plugin-transform-react-jsx-development" "^7.16.7"
"@babel/plugin-transform-react-pure-annotations" "^7.16.7"

"@babel/preset-typescript@^7.12.7":
"@babel/preset-typescript@^7.12.7", "@babel/preset-typescript@^7.17.12":
version "7.17.12"
resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.17.12.tgz#40269e0a0084d56fc5731b6c40febe1c9a4a3e8c"
integrity sha512-S1ViF8W2QwAKUGJXxP9NAfNaqGDdEBJKpYkxHf5Yy2C4NPPzXGeR3Lhk7G8xJaaLcFTRfNjVbtbVtm8Gb0mqvg==
Expand Down Expand Up @@ -2027,7 +2027,7 @@
lodash "^4.17.21"
ts-dedent "^2.0.0"

"@storybook/addon-docs@6.5.9":
"@storybook/addon-docs@6.5.9", "@storybook/addon-docs@^6.5.9":
version "6.5.9"
resolved "https://registry.yarnpkg.com/@storybook/addon-docs/-/addon-docs-6.5.9.tgz#32b27fb298624afd738c1371a764d7ff4831fe6d"
integrity sha512-9lwOZyiOJFUgGd9ADVfcgpels5o0XOXqGMeVLuzT1160nopbZjNjo/3+YLJ0pyHRPpMJ4rmq2+vxRQR6PVRgPg==
Expand Down

0 comments on commit e37b1d3

Please sign in to comment.