-
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.
Add Storybook as a framework to develop and document UI. So far this is groundwork, once the Storybook docs are finished, `./app` folder can be deleted. * FIXES Several small fixes to some components such as `Duration` and `CurrentTime`, fixes to the UI and some improvements to the API. * FEATURES Create `PlayPauseIndicator`. Add CSS classes `.pp-ui-layers` and `.pp-ui-layer` intended to stack layers of UI on top of each other (e.g. player and its overlay). * TOOLING In Jest remove `transformIgnorePatterns` of `@castlabs/prestoplay` because it is not being transformed anyway, because it is getting mocked instead.
- Loading branch information
1 parent
85c4e79
commit c4bd691
Showing
112 changed files
with
25,263 additions
and
8,825 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 |
---|---|---|
|
@@ -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) { | ||
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.