-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DE-6498: Add Storybook #12
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c4bd691
DE-6498: Add Storybook
fingerartur dd19904
Readme
fingerartur aed4c31
Update story/stories/components/BufferingIndicator.mdx
fingerartur 60f98c0
Update story/stories/components/HorizontalBar.mdx
fingerartur 0d24639
Update story/stories/components/RateText.mdx
fingerartur 9976ba4
Update story/stories/components/TimeLeft.mdx
fingerartur c96faf3
Update story/stories/components/SeekBar.mdx
fingerartur 4c6f12b
Update story/stories/components/VolumeBar.mdx
fingerartur d9f4d95
Update story/stories/components/FullscreenButton.mdx
fingerartur 5fca899
Update story/stories/components/RateButton.mdx
fingerartur 56955b5
Update story/stories/components/VerticalBar.mdx
fingerartur d8782ea
Update story/stories/components/RateButton.mdx
fingerartur File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ dist/ | |
app/dist/ | ||
.npmrc | ||
.vscode/ | ||
.DS_Store |
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,3 @@ | ||
* | ||
!dist/**/* | ||
dist/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,26 @@ | ||
|
||
import type { StorybookConfig } from "@storybook/react-webpack5"; | ||
|
||
const config: StorybookConfig = { | ||
stories: ["../story/stories/**/*.mdx", "../story/stories/**/*.stories.@(js|jsx|ts|tsx)"], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-interactions", | ||
], | ||
framework: { | ||
name: "@storybook/react-webpack5", | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: "tag", | ||
}, | ||
babel: (options) => ({ | ||
...options, | ||
configFile: './story/.babelrc.json' | ||
}), | ||
}; | ||
|
||
|
||
|
||
export default 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,6 @@ | ||
import { addons } from '@storybook/manager-api'; | ||
import theme from './theme'; | ||
|
||
addons.setConfig({ | ||
theme, | ||
}); |
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,23 @@ | ||
import { PrestoContextDecorator } from "../story/stories/prep"; | ||
import "./style.css" | ||
|
||
import type { Preview } from "@storybook/react"; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
options: { | ||
method: 'alphabetical', | ||
order: ['Intro'], | ||
}, | ||
}, | ||
decorators: [PrestoContextDecorator], | ||
}; | ||
|
||
export default preview; |
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,21 @@ | ||
button.docblock-code-toggle { | ||
font-style:italic; | ||
} | ||
|
||
.sb-clpp-anchor { | ||
font-size: 1em; | ||
cursor: pointer; | ||
color: #2c98db; | ||
font-family: "Nunito Sans",-apple-system,".SFNSText-Regular", | ||
"San Francisco",BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Helvetica,Arial,sans-serif | ||
} | ||
.sb-clpp-anchor:visited { | ||
color: #205576; | ||
} | ||
.sb-clpp-anchor:hover { | ||
color: #58baf6; | ||
} | ||
|
||
.css-79elbk { | ||
display: none; | ||
} |
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,9 @@ | ||
import { create } from '@storybook/theming/create'; | ||
|
||
export default create({ | ||
base: 'light', | ||
brandTitle: 'My custom Storybook', | ||
brandUrl: '#', | ||
brandImage: 'https://castlabs.com/wp-content/uploads/castlabs-logo.svg', | ||
brandTarget: '_self', | ||
}); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Imports from @react-hook are for some reason not resolved correctly, and they end up | ||
* importing ESM code instead of transpiled ES5 which causes a crash of the test suite. | ||
* Fix it by correcting those paths here. | ||
* | ||
* (The package.json.exports field in @react-hook/ is the problem. | ||
* Ideally I would fix this via the `options.packageFilter`, but that | ||
* for some reason is not working - possibly a bug in Jest. So I'm just | ||
* doing a simple replace here instead.) | ||
*/ | ||
function fixReactHookPaths(path) { | ||
doubeka marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const replacements = { | ||
'@react-hook/resize-observer/dist/module/index.js': '@react-hook/resize-observer/dist/main/index.js', | ||
'@react-hook/passive-layout-effect/dist/module/index.js': '@react-hook/passive-layout-effect/dist/main/index.js', | ||
'@react-hook/latest/dist/module/index.js': '@react-hook/latest/dist/main/index.js', | ||
} | ||
|
||
Object.keys(replacements).forEach(key => { | ||
path = path.replace(key, replacements[key]) | ||
}) | ||
|
||
return path | ||
} | ||
|
||
/** | ||
* https://jestjs.io/docs/configuration/#resolver-string | ||
*/ | ||
module.exports = (path, options) => { | ||
let result = options.defaultResolver(path, options) | ||
return fixReactHookPaths(result) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add note how to run storybook?