-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
install of storybook 6, first test without Next import
- Loading branch information
1 parent
8333171
commit b33bed6
Showing
5 changed files
with
3,588 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
stories: [ | ||
"../stories/**/*.stories.@(js|ts|jsx|tsx)", | ||
"../src/**/*.stories.@(js|ts|jsx|tsx)", | ||
], | ||
addons: ["@storybook/addon-actions", "@storybook/addon-links"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import { linkTo } from '@storybook/addon-links'; | ||
import { Welcome } from '@storybook/react/demo'; | ||
|
||
export default { | ||
title: 'Welcome', | ||
component: Welcome, | ||
}; | ||
|
||
export const ToStorybook = () => <Welcome showApp={linkTo('Button')} />; | ||
|
||
ToStorybook.story = { | ||
name: 'to Storybook', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from "react"; | ||
import { action } from "@storybook/addon-actions"; | ||
import { Button } from "@storybook/react/demo"; | ||
|
||
export default { | ||
title: "TypeScript", | ||
component: Button, | ||
}; | ||
|
||
interface MyComponentProps { | ||
children: React.ReactNode; | ||
} | ||
const MyComponent = (props: MyComponentProps) => <p>{props.children}</p>; | ||
|
||
export const Text = () => ( | ||
<div> | ||
<MyComponent>This story comes from a .tsx file</MyComponent> | ||
<Button onClick={action("clicked")}>Hello TypeScript Button</Button> | ||
</div> | ||
); |
Oops, something went wrong.