-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5dda04a
commit cb5c8ad
Showing
6 changed files
with
49 additions
and
6 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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
module.exports = { | ||
stories: ['../stories/**/*.stories.@(ts|tsx|js|jsx)'], | ||
stories: ['../src/**/*.stories.@(ts|tsx|js|jsx)'], | ||
addons: ['@storybook/addon-links', '@storybook/addon-essentials'], | ||
// https://storybook.js.org/docs/react/configure/typescript#mainjs-configuration | ||
typescript: { | ||
check: true, // type-check stories during Storybook build | ||
} | ||
}, | ||
}; |
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,39 @@ | ||
import { ArgTypes } from '@storybook/addons/dist/ts3.9/types'; | ||
import { Meta, Story } from '@storybook/react'; | ||
import React from 'react'; | ||
import Annotation, { AnnotationPropsOptional } from './Annotation'; | ||
|
||
const argTypes: ArgTypes = { | ||
src: { | ||
defaultValue: | ||
'https://raw.githubusercontent.com/RobinNagpal/react-image-annotation-ts/HEAD/demo.gif', | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
}; | ||
|
||
const meta: Meta = { | ||
title: 'Annotation', | ||
component: Annotation, | ||
argTypes, | ||
parameters: { | ||
controls: { expanded: true }, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
const Template: Story<AnnotationPropsOptional> = (args) => ( | ||
<Annotation {...args} /> | ||
); | ||
|
||
// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test | ||
// https://storybook.js.org/docs/react/workflows/unit-testing | ||
const defaultProps: AnnotationPropsOptional = { | ||
src: | ||
'https://raw.githubusercontent.com/RobinNagpal/react-image-annotation-ts/HEAD/demo.gif', | ||
}; | ||
export const Default = Template.bind(defaultProps); | ||
|
||
Default.args = {}; |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.