-
Notifications
You must be signed in to change notification settings - Fork 0
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
60d45e7
commit fa6a7de
Showing
9 changed files
with
11,261 additions
and
0 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,2 @@ | ||
node_modules | ||
esm |
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,24 @@ | ||
module.exports = { | ||
addons: [ | ||
'@storybook/addon-knobs', | ||
'@storybook/addon-docs', | ||
'@storybook/addon-controls', | ||
'@storybook/addon-viewport/register', | ||
], | ||
features: { | ||
postcss: false, | ||
}, | ||
stories: ['../src/**/*.stories.@(tsx|mdx)'], | ||
webpackFinal: async config => { | ||
config.module.rules.push({ | ||
test: /\.(ts|tsx)$/, | ||
use: [ | ||
{ | ||
loader: require.resolve('ts-loader'), | ||
}, | ||
], | ||
}); | ||
config.resolve.extensions.push('.ts', '.tsx'); | ||
return config; | ||
}, | ||
}; |
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,24 @@ | ||
{ | ||
"name": "storybook-issue", | ||
"version": "1.0.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "ssh://[email protected]/vinassefranche/storybook-issue.git" | ||
}, | ||
"scripts": { | ||
"start": "start-storybook -p 6061" | ||
}, | ||
"dependencies": { | ||
"@types/react": "^16.9.44", | ||
"@types/storybook__addon-info": "^5.2.3", | ||
"typescript": "4.2.3", | ||
"@storybook/addon-controls": "^6.2.9", | ||
"@storybook/addon-docs": "^6.2.9", | ||
"@storybook/addon-knobs": "^6.2.9", | ||
"@storybook/addon-viewport": "^6.2.9", | ||
"@storybook/react": "^6.2.9", | ||
"react": "^16.13.1", | ||
"react-dom": "^16.13.1", | ||
"ts-loader": "^8.0.2" | ||
} | ||
} |
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,17 @@ | ||
import { Meta, Story, Canvas } from "@storybook/addon-docs/blocks"; | ||
import { MyComponent } from "./MyComponent"; | ||
import { Playground } from "./MyComponent.stories.tsx"; | ||
|
||
<Meta title="Components/MyComponent" component={MyComponent} /> | ||
|
||
# MyComponent | ||
|
||
Displays MyComponent | ||
|
||
## Playground | ||
|
||
Experiment with `MyComponent` properties in Canvas tab. | ||
|
||
<Story name="playground"> | ||
<Playground /> | ||
</Story> |
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,18 @@ | ||
import { Story } from '@storybook/react'; | ||
import React from 'react'; | ||
|
||
import { MyComponent, MyComponentProps } from './MyComponent'; | ||
|
||
export default { | ||
title: 'Components/MyComponent', | ||
component: MyComponent, | ||
parameters: { | ||
knobs: { | ||
disabled: true, | ||
}, | ||
}, | ||
}; | ||
|
||
const Template: Story<MyComponentProps> = props => (<MyComponent {...props}/>); | ||
|
||
export const Playground = Template.bind({}); |
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,18 @@ | ||
import React from 'react'; | ||
|
||
export enum Test { | ||
test1 = 'test1', | ||
} | ||
|
||
const mapping = { | ||
[Test.test1]: { | ||
data: 'data for test1' | ||
}, | ||
}; | ||
|
||
export type MyComponentProps = { | ||
someProp?: Test; | ||
} | ||
|
||
export const MyComponent = ({someProp}: MyComponentProps) => | ||
(<div>Component {someProp && mapping[someProp].data}</div>) |
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 @@ | ||
export * from "./MyComponent"; |
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,30 @@ | ||
{ | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"skipLibCheck": true, | ||
"outDir": "esm", | ||
"module": "esnext", | ||
"target": "es5", | ||
"jsx": "react", | ||
"lib": ["dom", "esnext"], | ||
"esModuleInterop": true, | ||
"allowSyntheticDefaultImports": true, | ||
"allowJs": true, | ||
"strict": true, | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"sourceMap": true, | ||
"inlineSources": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"noEmit": false, | ||
"noImplicitAny": true, | ||
"declaration": true | ||
}, | ||
"include": ["src", "typings", "danger"], | ||
"exclude": ["danger"] | ||
} |
Oops, something went wrong.