mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-03 05:04:51 +08:00
Merge branch 'next' of github.com:storybooks/storybook into next
This commit is contained in:
commit
da29a967b9
28
CHANGELOG.md
28
CHANGELOG.md
@ -1,3 +1,31 @@
|
|||||||
|
## 5.2.0-beta.2 (July 18, 2019)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* CLI: convert mdx to module format ([#7419](https://github.com/storybookjs/storybook/pull/7419))
|
||||||
|
* CLI: sb migrate npm & typescript support ([#7463](https://github.com/storybookjs/storybook/pull/7463))
|
||||||
|
* Addon-Docs: HTML support & example ([#7454](https://github.com/storybookjs/storybook/pull/7454))
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Convert-storiesof-to-module: user exports, collisions, reserved keywords ([#7471](https://github.com/storybookjs/storybook/pull/7471))
|
||||||
|
* React-native: On-device knobs fixes ([#7470](https://github.com/storybookjs/storybook/pull/7470))
|
||||||
|
|
||||||
|
### Dependency Upgrades
|
||||||
|
|
||||||
|
* Addon-docs: Upgrade MDX to 1.1 ([#7476](https://github.com/storybookjs/storybook/pull/7476))
|
||||||
|
|
||||||
|
## 5.2.0-beta.1 (July 18, 2019)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* React native: Emit event when story is rendered ([#7449](https://github.com/storybookjs/storybook/pull/7449))
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Addon-knobs: improve types via generics and readonlyarray ([#7411](https://github.com/storybookjs/storybook/pull/7411))
|
||||||
|
* Ondevice-backgrounds: use same param key as addon-backgrounds ([#7437](https://github.com/storybookjs/storybook/pull/7437))
|
||||||
|
|
||||||
## 5.2.0-beta.0 (July 15, 2019)
|
## 5.2.0-beta.0 (July 15, 2019)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-a11y",
|
"name": "@storybook/addon-a11y",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "a11y addon for storybook",
|
"description": "a11y addon for storybook",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"a11y",
|
"a11y",
|
||||||
@ -26,12 +26,12 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/api": "5.2.0-beta.0",
|
"@storybook/api": "5.2.0-beta.2",
|
||||||
"@storybook/client-logger": "5.2.0-beta.0",
|
"@storybook/client-logger": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"axe-core": "^3.2.2",
|
"axe-core": "^3.2.2",
|
||||||
"common-tags": "^1.8.0",
|
"common-tags": "^1.8.0",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-actions",
|
"name": "@storybook/addon-actions",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Action Logger addon for storybook",
|
"description": "Action Logger addon for storybook",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"storybook"
|
"storybook"
|
||||||
@ -21,12 +21,12 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/api": "5.2.0-beta.0",
|
"@storybook/api": "5.2.0-beta.2",
|
||||||
"@storybook/client-api": "5.2.0-beta.0",
|
"@storybook/client-api": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"fast-deep-equal": "^2.0.1",
|
"fast-deep-equal": "^2.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-backgrounds",
|
"name": "@storybook/addon-backgrounds",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "A storybook addon to show different backgrounds for your preview",
|
"description": "A storybook addon to show different backgrounds for your preview",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -25,12 +25,12 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/api": "5.2.0-beta.0",
|
"@storybook/api": "5.2.0-beta.2",
|
||||||
"@storybook/client-logger": "5.2.0-beta.0",
|
"@storybook/client-logger": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"memoizerific": "^1.11.3",
|
"memoizerific": "^1.11.3",
|
||||||
"react": "^16.8.3",
|
"react": "^16.8.3",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-centered",
|
"name": "@storybook/addon-centered",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook decorator to center components",
|
"description": "Storybook decorator to center components",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -23,7 +23,7 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
"util-deprecate": "^1.0.2"
|
"util-deprecate": "^1.0.2"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-contexts",
|
"name": "@storybook/addon-contexts",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook Addon Contexts",
|
"description": "Storybook Addon Contexts",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"storybook",
|
"storybook",
|
||||||
@ -28,10 +28,10 @@
|
|||||||
"dev:check-types": "tsc --noEmit"
|
"dev:check-types": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/api": "5.2.0-beta.0",
|
"@storybook/api": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1"
|
"core-js": "^3.0.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-cssresources",
|
"name": "@storybook/addon-cssresources",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "A storybook addon to switch between css resources at runtime for your story",
|
"description": "A storybook addon to switch between css resources at runtime for your story",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -25,10 +25,10 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/api": "5.2.0-beta.0",
|
"@storybook/api": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
"react": "^16.8.3"
|
"react": "^16.8.3"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-design-assets",
|
"name": "@storybook/addon-design-assets",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Design asset preview for storybook",
|
"description": "Design asset preview for storybook",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -27,12 +27,12 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/api": "5.2.0-beta.0",
|
"@storybook/api": "5.2.0-beta.2",
|
||||||
"@storybook/client-logger": "5.2.0-beta.0",
|
"@storybook/client-logger": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"common-tags": "^1.8.0",
|
"common-tags": "^1.8.0",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
|
1
addons/docs/html/index.js
Normal file
1
addons/docs/html/index.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
module.exports = require('../common/index');
|
1
addons/docs/html/preset.js
Normal file
1
addons/docs/html/preset.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
module.exports = require('../common/preset');
|
@ -4,7 +4,14 @@ const mdx = require('@mdx-js/mdx');
|
|||||||
const prettier = require('prettier');
|
const prettier = require('prettier');
|
||||||
const plugin = require('./mdx-compiler-plugin');
|
const plugin = require('./mdx-compiler-plugin');
|
||||||
|
|
||||||
function format(code) {
|
async function generate(filePath) {
|
||||||
|
const content = await fs.readFile(filePath, 'utf8');
|
||||||
|
|
||||||
|
const code = mdx.sync(content, {
|
||||||
|
filepath: filePath,
|
||||||
|
compilers: [plugin({})],
|
||||||
|
});
|
||||||
|
|
||||||
return prettier.format(code, {
|
return prettier.format(code, {
|
||||||
parser: 'babel',
|
parser: 'babel',
|
||||||
printWidth: 100,
|
printWidth: 100,
|
||||||
@ -15,17 +22,6 @@ function format(code) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function generate(filePath) {
|
|
||||||
const content = await fs.readFile(filePath, 'utf8');
|
|
||||||
|
|
||||||
const result = mdx.sync(content, {
|
|
||||||
filepath: filePath,
|
|
||||||
compilers: [plugin({})],
|
|
||||||
});
|
|
||||||
|
|
||||||
return format(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
describe('docs-mdx-compiler-plugin', () => {
|
describe('docs-mdx-compiler-plugin', () => {
|
||||||
it('supports vanilla mdx', async () => {
|
it('supports vanilla mdx', async () => {
|
||||||
const code = await generate(path.resolve(__dirname, './fixtures/vanilla.mdx'));
|
const code = await generate(path.resolve(__dirname, './fixtures/vanilla.mdx'));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-docs",
|
"name": "@storybook/addon-docs",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Superior documentation for your components",
|
"description": "Superior documentation for your components",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -25,14 +25,14 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/generator": "^7.4.0",
|
"@babel/generator": "^7.4.0",
|
||||||
"@babel/parser": "^7.4.2",
|
"@babel/parser": "^7.4.2",
|
||||||
"@mdx-js/loader": "^1.0.0",
|
"@mdx-js/loader": "^1.1.0",
|
||||||
"@mdx-js/mdx": "^1.0.0",
|
"@mdx-js/mdx": "^1.1.0",
|
||||||
"@mdx-js/react": "^1.0.16",
|
"@mdx-js/react": "^1.0.27",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/api": "5.2.0-beta.0",
|
"@storybook/api": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/router": "5.2.0-beta.0",
|
"@storybook/router": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
"lodash": "^4.17.11",
|
"lodash": "^4.17.11",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-events",
|
"name": "@storybook/addon-events",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Add events to your Storybook stories.",
|
"description": "Add events to your Storybook stories.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -24,11 +24,11 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/api": "5.2.0-beta.0",
|
"@storybook/api": "5.2.0-beta.2",
|
||||||
"@storybook/client-api": "5.2.0-beta.0",
|
"@storybook/client-api": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"format-json": "^1.0.3",
|
"format-json": "^1.0.3",
|
||||||
"lodash": "^4.17.11",
|
"lodash": "^4.17.11",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-google-analytics",
|
"name": "@storybook/addon-google-analytics",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook addon for google analytics",
|
"description": "Storybook addon for google analytics",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -20,8 +20,8 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
"react-ga": "^2.5.7"
|
"react-ga": "^2.5.7"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-graphql",
|
"name": "@storybook/addon-graphql",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook addon to display the GraphiQL IDE",
|
"description": "Storybook addon to display the GraphiQL IDE",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -22,8 +22,8 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/api": "5.2.0-beta.0",
|
"@storybook/api": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
"graphiql": "^0.13.0",
|
"graphiql": "^0.13.0",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-info",
|
"name": "@storybook/addon-info",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "A Storybook addon to show additional information for your stories.",
|
"description": "A Storybook addon to show additional information for your stories.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -22,10 +22,10 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/client-logger": "5.2.0-beta.0",
|
"@storybook/client-logger": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
"jsx-to-string": "^1.4.0",
|
"jsx-to-string": "^1.4.0",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-jest",
|
"name": "@storybook/addon-jest",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "React storybook addon that show component jest report",
|
"description": "React storybook addon that show component jest report",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -28,11 +28,11 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/api": "5.2.0-beta.0",
|
"@storybook/api": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
"react": "^16.8.3",
|
"react": "^16.8.3",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-knobs",
|
"name": "@storybook/addon-knobs",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook Addon Prop Editor Component",
|
"description": "Storybook Addon Prop Editor Component",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -22,11 +22,11 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/client-api": "5.2.0-beta.0",
|
"@storybook/client-api": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"copy-to-clipboard": "^3.0.8",
|
"copy-to-clipboard": "^3.0.8",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
|
@ -7,7 +7,7 @@ import { getQueryParams } from '@storybook/client-api';
|
|||||||
import { Channel } from '@storybook/channels';
|
import { Channel } from '@storybook/channels';
|
||||||
|
|
||||||
import KnobStore, { KnobStoreKnob } from './KnobStore';
|
import KnobStore, { KnobStoreKnob } from './KnobStore';
|
||||||
import { Knob, KnobType } from './type-defs';
|
import { Knob, KnobType, Mutable } from './type-defs';
|
||||||
import { SET } from './shared';
|
import { SET } from './shared';
|
||||||
|
|
||||||
import { deserializers } from './converters';
|
import { deserializers } from './converters';
|
||||||
@ -72,7 +72,7 @@ export default class KnobManager {
|
|||||||
return this.options.escapeHTML ? escapeStrings(value) : value;
|
return this.options.escapeHTML ? escapeStrings(value) : value;
|
||||||
}
|
}
|
||||||
|
|
||||||
knob<T extends KnobType = any>(name: string, options: Knob<T>): Knob<T>['value'] {
|
knob<T extends KnobType = any>(name: string, options: Knob<T>): Mutable<Knob<T>['value']> {
|
||||||
this._mayCallChannel();
|
this._mayCallChannel();
|
||||||
|
|
||||||
const knobName = options.groupId ? `${name}_${options.groupId}` : name;
|
const knobName = options.groupId ? `${name}_${options.groupId}` : name;
|
||||||
|
204
addons/knobs/src/__types__/knob-test-cases.ts
Normal file
204
addons/knobs/src/__types__/knob-test-cases.ts
Normal file
@ -0,0 +1,204 @@
|
|||||||
|
import {
|
||||||
|
number,
|
||||||
|
color,
|
||||||
|
files,
|
||||||
|
object,
|
||||||
|
boolean,
|
||||||
|
text,
|
||||||
|
select,
|
||||||
|
date,
|
||||||
|
array,
|
||||||
|
button,
|
||||||
|
knob,
|
||||||
|
radios,
|
||||||
|
optionsKnob as options,
|
||||||
|
} from '../index';
|
||||||
|
|
||||||
|
// Note: this is a helper to batch test return types and avoid "declared but never read" errors
|
||||||
|
function expectKnobOfType<T>(..._: T[]) {}
|
||||||
|
|
||||||
|
const groupId = 'GROUP-ID1';
|
||||||
|
|
||||||
|
/** Text knob */
|
||||||
|
|
||||||
|
expectKnobOfType<string>(
|
||||||
|
text('text simple', 'Batman'),
|
||||||
|
text('text with group', 'default', groupId)
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Date knob */
|
||||||
|
|
||||||
|
expectKnobOfType<number>(
|
||||||
|
date('date simple', new Date('January 20 1887')),
|
||||||
|
date('date with group', new Date(), groupId)
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Boolean knob */
|
||||||
|
|
||||||
|
expectKnobOfType<boolean>(
|
||||||
|
boolean('boolean simple', false),
|
||||||
|
boolean('boolean with group', true, groupId)
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Color knob */
|
||||||
|
|
||||||
|
expectKnobOfType<string>(
|
||||||
|
color('color simple', 'black'),
|
||||||
|
color('color with group', '#ffffff', groupId)
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Number knob */
|
||||||
|
|
||||||
|
expectKnobOfType<number>(
|
||||||
|
number('number basic', 42),
|
||||||
|
number('number with options', 72, { range: true, min: 60, max: 90, step: 1 }),
|
||||||
|
number('number with group', 1, {}, groupId)
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Radios knob */
|
||||||
|
|
||||||
|
expectKnobOfType(
|
||||||
|
radios<string>(
|
||||||
|
'radio with string values',
|
||||||
|
{
|
||||||
|
1100: '1100',
|
||||||
|
2200: '2200',
|
||||||
|
3300: '3300',
|
||||||
|
},
|
||||||
|
'2200'
|
||||||
|
),
|
||||||
|
radios<number>('radio with number values', { 3: 3, 7: 7, 23: 23 }, 3),
|
||||||
|
radios(
|
||||||
|
'radio with mixed value',
|
||||||
|
{
|
||||||
|
1100: '1100',
|
||||||
|
2200: 2200,
|
||||||
|
3300: '3300',
|
||||||
|
},
|
||||||
|
null,
|
||||||
|
groupId
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Select knob */
|
||||||
|
|
||||||
|
enum SomeEnum {
|
||||||
|
Type1 = 1,
|
||||||
|
Type2,
|
||||||
|
}
|
||||||
|
enum ButtonVariant {
|
||||||
|
primary = 'primary',
|
||||||
|
secondary = 'secondary',
|
||||||
|
}
|
||||||
|
const stringLiteralArray: ('Apple' | 'Banana' | 'Grapes')[] = ['Apple', 'Banana', 'Grapes'];
|
||||||
|
|
||||||
|
expectKnobOfType<string>(
|
||||||
|
select(
|
||||||
|
'select with string options',
|
||||||
|
{
|
||||||
|
None: 'none',
|
||||||
|
Underline: 'underline',
|
||||||
|
'Line-through': 'line-through',
|
||||||
|
},
|
||||||
|
'none'
|
||||||
|
),
|
||||||
|
select('select with string array', ['yes', 'no'], 'yes'),
|
||||||
|
select('select with string literal array', stringLiteralArray, stringLiteralArray[0]),
|
||||||
|
select('select with readonly array', ['red', 'blue'] as const, 'red'),
|
||||||
|
select<ButtonVariant>('select with string enum options', ButtonVariant, ButtonVariant.primary),
|
||||||
|
select('select with null option', { a: 'Option', b: null }, null, groupId)
|
||||||
|
);
|
||||||
|
|
||||||
|
expectKnobOfType<number>(
|
||||||
|
select('select with number options', { 'type a': 1, 'type b': 2 }, 1),
|
||||||
|
select<SomeEnum>(
|
||||||
|
'select with numeric enum options',
|
||||||
|
{ 'type a': SomeEnum.Type1, 'type b': SomeEnum.Type2 },
|
||||||
|
SomeEnum.Type2
|
||||||
|
),
|
||||||
|
select('select with number array', [1, 2, 3, 4], 1),
|
||||||
|
select('select with readonly number array', [1, 2] as const, 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Object knob */
|
||||||
|
|
||||||
|
expectKnobOfType(
|
||||||
|
object('object simple', {
|
||||||
|
fontFamily: 'Arial',
|
||||||
|
padding: 20,
|
||||||
|
}),
|
||||||
|
object('object with group', {}, groupId)
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Options knob */
|
||||||
|
|
||||||
|
type Tool = 'hammer' | 'saw' | 'drill';
|
||||||
|
const visibleToolOptions: Record<string, Tool> = {
|
||||||
|
hammer: 'hammer',
|
||||||
|
saw: 'saw',
|
||||||
|
drill: 'drill',
|
||||||
|
};
|
||||||
|
|
||||||
|
expectKnobOfType(
|
||||||
|
options<Tool>('options with single selection', visibleToolOptions, 'hammer', {
|
||||||
|
display: 'check',
|
||||||
|
}),
|
||||||
|
options<Tool>('options with multi selection', visibleToolOptions, ['hammer', 'saw'], {
|
||||||
|
display: 'inline-check',
|
||||||
|
}),
|
||||||
|
options<Tool>('options with readonly multi selection', visibleToolOptions, ['hammer'] as const, {
|
||||||
|
display: 'radio',
|
||||||
|
}),
|
||||||
|
options('options with group', {}, '', { display: 'check' })
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Array knob */
|
||||||
|
|
||||||
|
const arrayReadonly = array('array as readonly', ['hi', 'there'] as const);
|
||||||
|
|
||||||
|
expectKnobOfType<string[]>(
|
||||||
|
array('array simple', ['red', 'green', 'blue']),
|
||||||
|
arrayReadonly,
|
||||||
|
array('array with group', [], ',', groupId)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Should return a mutable array despite the readonly input
|
||||||
|
arrayReadonly.push('Make sure that the output is still mutable although the input need not be!');
|
||||||
|
|
||||||
|
/** Button knob */
|
||||||
|
|
||||||
|
expectKnobOfType(
|
||||||
|
button('button simple', () => {}),
|
||||||
|
button('button with group', () => undefined, groupId)
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Files knob */
|
||||||
|
|
||||||
|
expectKnobOfType<string[]>(
|
||||||
|
files('files simple', 'image/*', []),
|
||||||
|
files('files with group', 'image/*', ['img.jpg'], groupId)
|
||||||
|
);
|
||||||
|
|
||||||
|
/** Generic knob */
|
||||||
|
|
||||||
|
expectKnobOfType<string>(
|
||||||
|
knob('generic knob as text', { type: 'text', value: 'a' }),
|
||||||
|
knob('generic knob as color', { type: 'color', value: 'black' }),
|
||||||
|
knob<'select', string>('generic knob as string select', {
|
||||||
|
type: 'select',
|
||||||
|
value: 'yes',
|
||||||
|
options: ['yes', 'no'],
|
||||||
|
selectV2: true,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
expectKnobOfType<number>(
|
||||||
|
knob('generic knob as number', { type: 'number', value: 42 }),
|
||||||
|
knob('generic knob as select', { type: 'radios', value: 3, options: { 3: 3, 7: 7, 23: 23 } }),
|
||||||
|
knob('generic knob as number select', {
|
||||||
|
type: 'select',
|
||||||
|
value: 1,
|
||||||
|
options: [1, 2],
|
||||||
|
selectV2: true,
|
||||||
|
})
|
||||||
|
);
|
@ -2,18 +2,16 @@ import PropTypes from 'prop-types';
|
|||||||
import React, { ChangeEvent, Component, WeakValidationMap } from 'react';
|
import React, { ChangeEvent, Component, WeakValidationMap } from 'react';
|
||||||
|
|
||||||
import { Form } from '@storybook/components';
|
import { Form } from '@storybook/components';
|
||||||
|
import { KnobControlConfig, KnobControlProps } from './types';
|
||||||
|
|
||||||
type ArrayTypeKnobValue = string[];
|
export type ArrayTypeKnobValue = string[] | readonly string[];
|
||||||
|
|
||||||
export interface ArrayTypeKnob {
|
export interface ArrayTypeKnob extends KnobControlConfig<ArrayTypeKnobValue> {
|
||||||
name: string;
|
|
||||||
value: ArrayTypeKnobValue;
|
|
||||||
separator: string;
|
separator: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ArrayTypeProps {
|
interface ArrayTypeProps extends KnobControlProps<ArrayTypeKnobValue> {
|
||||||
knob: ArrayTypeKnob;
|
knob: ArrayTypeKnob;
|
||||||
onChange: (value: ArrayTypeKnobValue) => ArrayTypeKnobValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatArray(value: string, separator: string) {
|
function formatArray(value: string, separator: string) {
|
||||||
@ -41,7 +39,7 @@ export default class ArrayType extends Component<ArrayTypeProps> {
|
|||||||
|
|
||||||
static serialize = (value: ArrayTypeKnobValue) => value;
|
static serialize = (value: ArrayTypeKnobValue) => value;
|
||||||
|
|
||||||
static deserialize = (value: ArrayTypeKnobValue) => {
|
static deserialize = (value: string[]) => {
|
||||||
if (Array.isArray(value)) return value;
|
if (Array.isArray(value)) return value;
|
||||||
|
|
||||||
return Object.keys(value)
|
return Object.keys(value)
|
||||||
|
@ -2,18 +2,14 @@ import PropTypes from 'prop-types';
|
|||||||
import React, { FunctionComponent } from 'react';
|
import React, { FunctionComponent } from 'react';
|
||||||
|
|
||||||
import { styled } from '@storybook/theming';
|
import { styled } from '@storybook/theming';
|
||||||
|
import { KnobControlConfig, KnobControlProps } from './types';
|
||||||
|
|
||||||
type BooleanTypeKnobValue = boolean;
|
type BooleanTypeKnobValue = boolean;
|
||||||
|
|
||||||
export interface BooleanTypeKnob {
|
export type BooleanTypeKnob = KnobControlConfig<BooleanTypeKnobValue>;
|
||||||
name: string;
|
|
||||||
value: BooleanTypeKnobValue;
|
|
||||||
separator: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface BooleanTypeProps {
|
export interface BooleanTypeProps extends KnobControlProps<BooleanTypeKnobValue> {
|
||||||
knob: BooleanTypeKnob;
|
knob: BooleanTypeKnob;
|
||||||
onChange: (value: BooleanTypeKnobValue) => BooleanTypeKnobValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Input = styled.input({
|
const Input = styled.input({
|
||||||
|
@ -2,19 +2,17 @@ import PropTypes from 'prop-types';
|
|||||||
import React, { FunctionComponent, Validator } from 'react';
|
import React, { FunctionComponent, Validator } from 'react';
|
||||||
|
|
||||||
import { Form } from '@storybook/components';
|
import { Form } from '@storybook/components';
|
||||||
|
import { KnobControlConfig, KnobControlProps } from './types';
|
||||||
|
|
||||||
export interface ButtonTypeKnob {
|
export type ButtonTypeKnob = KnobControlConfig<never>;
|
||||||
name: string;
|
|
||||||
value: unknown;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type ButtonTypeOnClickProp = (knob: ButtonTypeKnob) => any;
|
export interface ButtonTypeProps extends KnobControlProps<never> {
|
||||||
|
|
||||||
export interface ButtonTypeProps {
|
|
||||||
knob: ButtonTypeKnob;
|
knob: ButtonTypeKnob;
|
||||||
onClick: ButtonTypeOnClickProp;
|
onClick: ButtonTypeOnClickProp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type ButtonTypeOnClickProp = (knob: ButtonTypeKnob) => any;
|
||||||
|
|
||||||
const serialize = (): undefined => undefined;
|
const serialize = (): undefined => undefined;
|
||||||
const deserialize = (): undefined => undefined;
|
const deserialize = (): undefined => undefined;
|
||||||
|
|
||||||
|
@ -1,32 +1,28 @@
|
|||||||
import React, { Component, ChangeEvent, WeakValidationMap } from 'react';
|
import React, { Component, ChangeEvent, WeakValidationMap } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { styled } from '@storybook/theming';
|
import { styled } from '@storybook/theming';
|
||||||
|
import { KnobControlConfig, KnobControlProps } from './types';
|
||||||
|
|
||||||
type CheckboxesTypeKnobValue = string[];
|
type CheckboxesTypeKnobValue = string[];
|
||||||
|
|
||||||
interface CheckboxesWrapperProps {
|
export interface CheckboxesTypeKnob extends KnobControlConfig<CheckboxesTypeKnobValue> {
|
||||||
isInline: boolean;
|
options: Record<string, string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CheckboxesTypeKnob {
|
interface CheckboxesTypeProps
|
||||||
name: string;
|
extends KnobControlProps<CheckboxesTypeKnobValue>,
|
||||||
value: CheckboxesTypeKnobValue;
|
CheckboxesWrapperProps {
|
||||||
defaultValue: CheckboxesTypeKnobValue;
|
|
||||||
options: {
|
|
||||||
[key: string]: string;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
interface CheckboxesTypeProps {
|
|
||||||
knob: CheckboxesTypeKnob;
|
knob: CheckboxesTypeKnob;
|
||||||
isInline: boolean;
|
|
||||||
onChange: (value: CheckboxesTypeKnobValue) => CheckboxesTypeKnobValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CheckboxesTypeState {
|
interface CheckboxesTypeState {
|
||||||
values: CheckboxesTypeKnobValue;
|
values: CheckboxesTypeKnobValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface CheckboxesWrapperProps {
|
||||||
|
isInline: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
const CheckboxesWrapper = styled.div(({ isInline }: CheckboxesWrapperProps) =>
|
const CheckboxesWrapper = styled.div(({ isInline }: CheckboxesWrapperProps) =>
|
||||||
isInline
|
isInline
|
||||||
? {
|
? {
|
||||||
|
@ -5,18 +5,11 @@ import { SketchPicker, ColorResult } from 'react-color';
|
|||||||
|
|
||||||
import { styled } from '@storybook/theming';
|
import { styled } from '@storybook/theming';
|
||||||
import { Form } from '@storybook/components';
|
import { Form } from '@storybook/components';
|
||||||
|
import { KnobControlConfig, KnobControlProps } from './types';
|
||||||
|
|
||||||
type ColorTypeKnobValue = string;
|
type ColorTypeKnobValue = string;
|
||||||
|
export type ColorTypeKnob = KnobControlConfig<ColorTypeKnobValue>;
|
||||||
export interface ColorTypeKnob {
|
type ColorTypeProps = KnobControlProps<ColorTypeKnobValue>;
|
||||||
name: string;
|
|
||||||
value: ColorTypeKnobValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ColorTypeProps {
|
|
||||||
knob: ColorTypeKnob;
|
|
||||||
onChange: (value: ColorTypeKnobValue) => ColorTypeKnobValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ColorTypeState {
|
interface ColorTypeState {
|
||||||
displayColorPicker: boolean;
|
displayColorPicker: boolean;
|
||||||
|
@ -2,18 +2,11 @@ import React, { Component, ChangeEvent, WeakValidationMap } from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { styled } from '@storybook/theming';
|
import { styled } from '@storybook/theming';
|
||||||
import { Form } from '@storybook/components';
|
import { Form } from '@storybook/components';
|
||||||
|
import { KnobControlConfig, KnobControlProps } from './types';
|
||||||
|
|
||||||
type DateTypeKnobValue = number;
|
type DateTypeKnobValue = number;
|
||||||
|
export type DateTypeKnob = KnobControlConfig<DateTypeKnobValue>;
|
||||||
export interface DateTypeKnob {
|
type DateTypeProps = KnobControlProps<DateTypeKnobValue>;
|
||||||
name: string;
|
|
||||||
value: DateTypeKnobValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface DateTypeProps {
|
|
||||||
knob: DateTypeKnob;
|
|
||||||
onChange: (value: DateTypeKnobValue) => DateTypeKnobValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface DateTypeState {
|
interface DateTypeState {
|
||||||
valid: boolean | undefined;
|
valid: boolean | undefined;
|
||||||
|
@ -4,18 +4,16 @@ import React, { ChangeEvent, FunctionComponent } from 'react';
|
|||||||
import { styled } from '@storybook/theming';
|
import { styled } from '@storybook/theming';
|
||||||
|
|
||||||
import { Form } from '@storybook/components';
|
import { Form } from '@storybook/components';
|
||||||
|
import { KnobControlConfig, KnobControlProps } from './types';
|
||||||
|
|
||||||
type DateTypeKnobValue = string[];
|
type DateTypeKnobValue = string[];
|
||||||
|
|
||||||
export interface FileTypeKnob {
|
export interface FileTypeKnob extends KnobControlConfig<DateTypeKnobValue> {
|
||||||
name: string;
|
|
||||||
accept: string;
|
accept: string;
|
||||||
value: DateTypeKnobValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FilesTypeProps {
|
export interface FilesTypeProps extends KnobControlProps<DateTypeKnobValue> {
|
||||||
knob: FileTypeKnob;
|
knob: FileTypeKnob;
|
||||||
onChange: (value: DateTypeKnobValue) => DateTypeKnobValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const FileInput = styled(Form.Input)({
|
const FileInput = styled(Form.Input)({
|
||||||
|
@ -3,6 +3,7 @@ import React, { Component, ChangeEvent } from 'react';
|
|||||||
|
|
||||||
import { styled } from '@storybook/theming';
|
import { styled } from '@storybook/theming';
|
||||||
import { Form } from '@storybook/components';
|
import { Form } from '@storybook/components';
|
||||||
|
import { KnobControlConfig, KnobControlProps } from './types';
|
||||||
|
|
||||||
type NumberTypeKnobValue = number;
|
type NumberTypeKnobValue = number;
|
||||||
|
|
||||||
@ -13,14 +14,14 @@ export interface NumberTypeKnobOptions {
|
|||||||
step?: number;
|
step?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NumberTypeKnob extends NumberTypeKnobOptions {
|
export interface NumberTypeKnob
|
||||||
name: string;
|
extends KnobControlConfig<NumberTypeKnobValue>,
|
||||||
value: number;
|
NumberTypeKnobOptions {
|
||||||
|
value: NumberTypeKnobValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface NumberTypeProps {
|
interface NumberTypeProps extends KnobControlProps<NumberTypeKnobValue> {
|
||||||
knob: NumberTypeKnob;
|
knob: NumberTypeKnob;
|
||||||
onChange: (value: NumberTypeKnobValue) => NumberTypeKnobValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const RangeInput = styled.input(
|
const RangeInput = styled.input(
|
||||||
|
@ -3,16 +3,10 @@ import PropTypes from 'prop-types';
|
|||||||
import deepEqual from 'fast-deep-equal';
|
import deepEqual from 'fast-deep-equal';
|
||||||
import { polyfill } from 'react-lifecycles-compat';
|
import { polyfill } from 'react-lifecycles-compat';
|
||||||
import { Form } from '@storybook/components';
|
import { Form } from '@storybook/components';
|
||||||
|
import { KnobControlConfig, KnobControlProps } from './types';
|
||||||
|
|
||||||
export interface ObjectTypeKnob<T> {
|
export type ObjectTypeKnob<T> = KnobControlConfig<T>;
|
||||||
name: string;
|
type ObjectTypeProps<T> = KnobControlProps<T>;
|
||||||
value: T;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ObjectTypeProps<T> {
|
|
||||||
knob: ObjectTypeKnob<T>;
|
|
||||||
onChange: (value: T) => T;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ObjectTypeState<T> {
|
interface ObjectTypeState<T> {
|
||||||
value: string;
|
value: string;
|
||||||
|
@ -3,12 +3,19 @@ import PropTypes from 'prop-types';
|
|||||||
import ReactSelect from 'react-select';
|
import ReactSelect from 'react-select';
|
||||||
import { ValueType } from 'react-select/lib/types';
|
import { ValueType } from 'react-select/lib/types';
|
||||||
import { styled } from '@storybook/theming';
|
import { styled } from '@storybook/theming';
|
||||||
|
import { KnobControlConfig, KnobControlProps } from './types';
|
||||||
|
|
||||||
import RadiosType from './Radio';
|
import RadiosType from './Radio';
|
||||||
import CheckboxesType from './Checkboxes';
|
import CheckboxesType from './Checkboxes';
|
||||||
|
|
||||||
// TODO: Apply the Storybook theme to react-select
|
// TODO: Apply the Storybook theme to react-select
|
||||||
|
|
||||||
|
export type OptionsTypeKnobSingleValue = string | number | null | undefined;
|
||||||
|
|
||||||
|
export type OptionsTypeKnobValue<
|
||||||
|
T extends OptionsTypeKnobSingleValue = OptionsTypeKnobSingleValue
|
||||||
|
> = T | NonNullable<T>[] | readonly NonNullable<T>[];
|
||||||
|
|
||||||
export type OptionsKnobOptionsDisplay =
|
export type OptionsKnobOptionsDisplay =
|
||||||
| 'radio'
|
| 'radio'
|
||||||
| 'inline-radio'
|
| 'inline-radio'
|
||||||
@ -21,10 +28,7 @@ export interface OptionsKnobOptions {
|
|||||||
display?: OptionsKnobOptionsDisplay;
|
display?: OptionsKnobOptionsDisplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OptionsTypeKnob<T> {
|
export interface OptionsTypeKnob<T extends OptionsTypeKnobValue> extends KnobControlConfig<T> {
|
||||||
name: string;
|
|
||||||
value: T;
|
|
||||||
defaultValue: T;
|
|
||||||
options: OptionsTypeOptionsProp<T>;
|
options: OptionsTypeOptionsProp<T>;
|
||||||
optionsObj: OptionsKnobOptions;
|
optionsObj: OptionsKnobOptions;
|
||||||
}
|
}
|
||||||
@ -33,10 +37,9 @@ export interface OptionsTypeOptionsProp<T> {
|
|||||||
[key: string]: T;
|
[key: string]: T;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OptionsTypeProps<T> {
|
export interface OptionsTypeProps<T extends OptionsTypeKnobValue> extends KnobControlProps<T> {
|
||||||
knob: OptionsTypeKnob<T>;
|
knob: OptionsTypeKnob<T>;
|
||||||
display: OptionsKnobOptionsDisplay;
|
display: OptionsKnobOptionsDisplay;
|
||||||
onChange: (value: T) => T;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// : React.ComponentType<ReactSelectProps>
|
// : React.ComponentType<ReactSelectProps>
|
||||||
|
@ -1,24 +1,18 @@
|
|||||||
import React, { Component, WeakValidationMap } from 'react';
|
import React, { Component, WeakValidationMap } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { styled } from '@storybook/theming';
|
import { styled } from '@storybook/theming';
|
||||||
|
import { KnobControlConfig, KnobControlProps } from './types';
|
||||||
|
|
||||||
type RadiosTypeKnobValue = string;
|
export type RadiosTypeKnobValue = string | number | null | undefined;
|
||||||
|
|
||||||
export interface RadiosTypeKnob {
|
export type RadiosTypeOptionsProp<T extends RadiosTypeKnobValue> = Record<string | number, T>;
|
||||||
name: string;
|
|
||||||
value: RadiosTypeKnobValue;
|
export interface RadiosTypeKnob extends KnobControlConfig<RadiosTypeKnobValue> {
|
||||||
defaultValue: RadiosTypeKnobValue;
|
options: RadiosTypeOptionsProp<RadiosTypeKnobValue>;
|
||||||
options: RadiosTypeOptionsProp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RadiosTypeOptionsProp {
|
interface RadiosTypeProps extends KnobControlProps<RadiosTypeKnobValue>, RadiosWrapperProps {
|
||||||
[key: string]: RadiosTypeKnobValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface RadiosTypeProps {
|
|
||||||
knob: RadiosTypeKnob;
|
knob: RadiosTypeKnob;
|
||||||
isInline: boolean;
|
|
||||||
onChange: (value: RadiosTypeKnobValue) => RadiosTypeKnobValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RadiosWrapperProps {
|
interface RadiosWrapperProps {
|
||||||
|
@ -2,22 +2,24 @@ import React, { FunctionComponent, ChangeEvent } from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { Form } from '@storybook/components';
|
import { Form } from '@storybook/components';
|
||||||
|
import { KnobControlConfig, KnobControlProps } from './types';
|
||||||
|
|
||||||
export type SelectTypeKnobValue = string | number | null | undefined;
|
export type SelectTypeKnobValue = string | number | null | undefined;
|
||||||
|
|
||||||
export interface SelectTypeKnob {
|
export type SelectTypeOptionsProp<T extends SelectTypeKnobValue = SelectTypeKnobValue> =
|
||||||
name: string;
|
| Record<string, T>
|
||||||
value: SelectTypeKnobValue;
|
| Record<T, T[keyof T]>
|
||||||
options: SelectTypeOptionsProp;
|
| T[]
|
||||||
|
| readonly T[];
|
||||||
|
|
||||||
|
export interface SelectTypeKnob<T extends SelectTypeKnobValue = SelectTypeKnobValue>
|
||||||
|
extends KnobControlConfig<T> {
|
||||||
|
options: SelectTypeOptionsProp<T>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SelectTypeOptionsProp =
|
export interface SelectTypeProps<T extends SelectTypeKnobValue = SelectTypeKnobValue>
|
||||||
| Record<string, SelectTypeKnobValue>
|
extends KnobControlProps<T> {
|
||||||
| NonNullable<SelectTypeKnobValue>[];
|
knob: SelectTypeKnob<T>;
|
||||||
|
|
||||||
export interface SelectTypeProps {
|
|
||||||
knob: SelectTypeKnob;
|
|
||||||
onChange: (value: SelectTypeKnobValue) => SelectTypeKnobValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const serialize = (value: SelectTypeKnobValue) => value;
|
const serialize = (value: SelectTypeKnobValue) => value;
|
||||||
@ -29,8 +31,11 @@ const SelectType: FunctionComponent<SelectTypeProps> & {
|
|||||||
} = ({ knob, onChange }) => {
|
} = ({ knob, onChange }) => {
|
||||||
const { options } = knob;
|
const { options } = knob;
|
||||||
const entries = Array.isArray(options)
|
const entries = Array.isArray(options)
|
||||||
? options.reduce((acc, k) => Object.assign(acc, { [k]: k }), {})
|
? options.reduce<Record<number, SelectTypeKnobValue>>(
|
||||||
: options;
|
(acc, k) => Object.assign(acc, { [k]: k }),
|
||||||
|
{}
|
||||||
|
)
|
||||||
|
: (options as Record<string, SelectTypeKnobValue>);
|
||||||
|
|
||||||
const selectedKey = Object.keys(entries).find(k => entries[k] === knob.value);
|
const selectedKey = Object.keys(entries).find(k => entries[k] === knob.value);
|
||||||
|
|
||||||
|
@ -2,18 +2,11 @@ import PropTypes from 'prop-types';
|
|||||||
import React, { Component, ChangeEvent, WeakValidationMap } from 'react';
|
import React, { Component, ChangeEvent, WeakValidationMap } from 'react';
|
||||||
|
|
||||||
import { Form } from '@storybook/components';
|
import { Form } from '@storybook/components';
|
||||||
|
import { KnobControlConfig, KnobControlProps } from './types';
|
||||||
|
|
||||||
type TextTypeKnobValue = string;
|
type TextTypeKnobValue = string;
|
||||||
|
export type TextTypeKnob = KnobControlConfig<TextTypeKnobValue>;
|
||||||
export interface TextTypeKnob {
|
type TextTypeProps = KnobControlProps<TextTypeKnobValue>;
|
||||||
name: string;
|
|
||||||
value: TextTypeKnobValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TextTypeProps {
|
|
||||||
knob: TextTypeKnob;
|
|
||||||
onChange: (value: TextTypeKnobValue) => TextTypeKnobValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default class TextType extends Component<TextTypeProps> {
|
export default class TextType extends Component<TextTypeProps> {
|
||||||
static defaultProps: TextTypeProps = {
|
static defaultProps: TextTypeProps = {
|
||||||
|
@ -45,9 +45,15 @@ export { ColorTypeKnob } from './Color';
|
|||||||
export { BooleanTypeKnob } from './Boolean';
|
export { BooleanTypeKnob } from './Boolean';
|
||||||
export { ObjectTypeKnob } from './Object';
|
export { ObjectTypeKnob } from './Object';
|
||||||
export { SelectTypeKnob, SelectTypeOptionsProp, SelectTypeKnobValue } from './Select';
|
export { SelectTypeKnob, SelectTypeOptionsProp, SelectTypeKnobValue } from './Select';
|
||||||
export { RadiosTypeKnob, RadiosTypeOptionsProp } from './Radio';
|
export { RadiosTypeKnob, RadiosTypeOptionsProp, RadiosTypeKnobValue } from './Radio';
|
||||||
export { ArrayTypeKnob } from './Array';
|
export { ArrayTypeKnob, ArrayTypeKnobValue } from './Array';
|
||||||
export { DateTypeKnob } from './Date';
|
export { DateTypeKnob } from './Date';
|
||||||
export { ButtonTypeKnob, ButtonTypeOnClickProp } from './Button';
|
export { ButtonTypeKnob, ButtonTypeOnClickProp } from './Button';
|
||||||
export { FileTypeKnob } from './Files';
|
export { FileTypeKnob } from './Files';
|
||||||
export { OptionsTypeKnob, OptionsTypeOptionsProp, OptionsKnobOptions } from './Options';
|
export {
|
||||||
|
OptionsTypeKnob,
|
||||||
|
OptionsKnobOptions,
|
||||||
|
OptionsTypeOptionsProp,
|
||||||
|
OptionsTypeKnobSingleValue,
|
||||||
|
OptionsTypeKnobValue,
|
||||||
|
} from './Options';
|
||||||
|
10
addons/knobs/src/components/types/types.ts
Normal file
10
addons/knobs/src/components/types/types.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
export interface KnobControlConfig<T = never> {
|
||||||
|
name: string;
|
||||||
|
value: T;
|
||||||
|
defaultValue?: T;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface KnobControlProps<T> {
|
||||||
|
knob: KnobControlConfig<T>;
|
||||||
|
onChange: (value: T) => T;
|
||||||
|
}
|
@ -2,19 +2,26 @@ import addons, { makeDecorator } from '@storybook/addons';
|
|||||||
|
|
||||||
import { SET_OPTIONS } from './shared';
|
import { SET_OPTIONS } from './shared';
|
||||||
import { manager, registerKnobs } from './registerKnobs';
|
import { manager, registerKnobs } from './registerKnobs';
|
||||||
import { Knob, KnobType } from './type-defs';
|
import { Knob, KnobType, Mutable } from './type-defs';
|
||||||
import {
|
import {
|
||||||
NumberTypeKnobOptions,
|
NumberTypeKnobOptions,
|
||||||
ButtonTypeOnClickProp,
|
ButtonTypeOnClickProp,
|
||||||
RadiosTypeOptionsProp,
|
RadiosTypeOptionsProp,
|
||||||
SelectTypeOptionsProp,
|
SelectTypeOptionsProp,
|
||||||
SelectTypeKnobValue,
|
SelectTypeKnobValue,
|
||||||
|
OptionsTypeKnobValue,
|
||||||
OptionsTypeOptionsProp,
|
OptionsTypeOptionsProp,
|
||||||
|
OptionsTypeKnobSingleValue,
|
||||||
OptionsKnobOptions,
|
OptionsKnobOptions,
|
||||||
|
RadiosTypeKnobValue,
|
||||||
|
ArrayTypeKnobValue,
|
||||||
} from './components/types';
|
} from './components/types';
|
||||||
|
|
||||||
export function knob<T extends KnobType>(name: string, options: Knob<T>) {
|
export function knob<T extends KnobType, V = Mutable<Knob<T>['value']>>(
|
||||||
return manager.knob(name, options);
|
name: string,
|
||||||
|
options: Knob<T>
|
||||||
|
): V {
|
||||||
|
return manager.knob(name, options) as V;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function text(name: string, value: string, groupId?: string) {
|
export function text(name: string, value: string, groupId?: string) {
|
||||||
@ -62,25 +69,31 @@ export function object<T>(name: string, value: T, groupId?: string): T {
|
|||||||
return manager.knob(name, { type: 'object', value, groupId });
|
return manager.knob(name, { type: 'object', value, groupId });
|
||||||
}
|
}
|
||||||
|
|
||||||
export function select(
|
export function select<T extends SelectTypeKnobValue>(
|
||||||
name: string,
|
name: string,
|
||||||
options: SelectTypeOptionsProp,
|
options: SelectTypeOptionsProp<T>,
|
||||||
value: SelectTypeKnobValue,
|
value: T,
|
||||||
groupId?: string
|
groupId?: string
|
||||||
) {
|
): T {
|
||||||
return manager.knob(name, { type: 'select', selectV2: true, options, value, groupId });
|
return manager.knob(name, {
|
||||||
|
type: 'select',
|
||||||
|
selectV2: true,
|
||||||
|
options: options as SelectTypeOptionsProp,
|
||||||
|
value,
|
||||||
|
groupId,
|
||||||
|
}) as T;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function radios(
|
export function radios<T extends RadiosTypeKnobValue>(
|
||||||
name: string,
|
name: string,
|
||||||
options: RadiosTypeOptionsProp,
|
options: RadiosTypeOptionsProp<T>,
|
||||||
value: string,
|
value: T,
|
||||||
groupId?: string
|
groupId?: string
|
||||||
) {
|
): T {
|
||||||
return manager.knob(name, { type: 'radios', options, value, groupId });
|
return manager.knob(name, { type: 'radios', options, value, groupId }) as T;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function array(name: string, value: string[], separator = ',', groupId?: string) {
|
export function array(name: string, value: ArrayTypeKnobValue, separator = ',', groupId?: string) {
|
||||||
return manager.knob(name, { type: 'array', value, separator, groupId });
|
return manager.knob(name, { type: 'array', value, separator, groupId });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,10 +110,10 @@ export function files(name: string, accept: string, value: string[] = [], groupI
|
|||||||
return manager.knob(name, { type: 'files', accept, value, groupId });
|
return manager.knob(name, { type: 'files', accept, value, groupId });
|
||||||
}
|
}
|
||||||
|
|
||||||
export function optionsKnob<T>(
|
export function optionsKnob<T extends OptionsTypeKnobSingleValue>(
|
||||||
name: string,
|
name: string,
|
||||||
valuesObj: OptionsTypeOptionsProp<T>,
|
valuesObj: OptionsTypeOptionsProp<T>,
|
||||||
value: T,
|
value: OptionsTypeKnobValue<T>,
|
||||||
optionsObj: OptionsKnobOptions,
|
optionsObj: OptionsKnobOptions,
|
||||||
groupId?: string
|
groupId?: string
|
||||||
): T {
|
): T {
|
||||||
|
@ -14,6 +14,10 @@ import {
|
|||||||
KnobType,
|
KnobType,
|
||||||
} from './components/types';
|
} from './components/types';
|
||||||
|
|
||||||
|
export type Mutable<T> = {
|
||||||
|
-readonly [P in keyof T]: T[P] extends readonly (infer U)[] ? U[] : T[P];
|
||||||
|
};
|
||||||
|
|
||||||
type KnobPlus<T extends KnobType, K> = K & { type: T; groupId?: string };
|
type KnobPlus<T extends KnobType, K> = K & { type: T; groupId?: string };
|
||||||
|
|
||||||
export type Knob<T extends KnobType = any> = T extends 'text'
|
export type Knob<T extends KnobType = any> = T extends 'text'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-links",
|
"name": "@storybook/addon-links",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Story Links addon for storybook",
|
"description": "Story Links addon for storybook",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -22,9 +22,9 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/router": "5.2.0-beta.0",
|
"@storybook/router": "5.2.0-beta.2",
|
||||||
"common-tags": "^1.8.0",
|
"common-tags": "^1.8.0",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-notes",
|
"name": "@storybook/addon-notes",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Write notes for your Storybook stories.",
|
"description": "Write notes for your Storybook stories.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -23,13 +23,13 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/api": "5.2.0-beta.0",
|
"@storybook/api": "5.2.0-beta.2",
|
||||||
"@storybook/client-logger": "5.2.0-beta.0",
|
"@storybook/client-logger": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/router": "5.2.0-beta.0",
|
"@storybook/router": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
"markdown-to-jsx": "^6.9.3",
|
"markdown-to-jsx": "^6.9.3",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-ondevice-actions",
|
"name": "@storybook/addon-ondevice-actions",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Action Logger addon for react-native storybook",
|
"description": "Action Logger addon for react-native storybook",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"storybook"
|
"storybook"
|
||||||
@ -19,13 +19,13 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"core-js": "^2.5.7",
|
"core-js": "^2.5.7",
|
||||||
"fast-deep-equal": "^2.0.1"
|
"fast-deep-equal": "^2.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0"
|
"@storybook/addon-actions": "5.2.0-beta.2"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@storybook/addon-actions": "*",
|
"@storybook/addon-actions": "*",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-ondevice-backgrounds",
|
"name": "@storybook/addon-ondevice-backgrounds",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "A react-native storybook addon to show different backgrounds for your preview",
|
"description": "A react-native storybook addon to show different backgrounds for your preview",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -24,7 +24,7 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"prop-types": "^15.7.2"
|
"prop-types": "^15.7.2"
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-ondevice-knobs",
|
"name": "@storybook/addon-ondevice-knobs",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Display storybook story knobs on your deviced.",
|
"description": "Display storybook story knobs on your deviced.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -21,8 +21,8 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"deep-equal": "^1.0.1",
|
"deep-equal": "^1.0.1",
|
||||||
"prop-types": "^15.7.2",
|
"prop-types": "^15.7.2",
|
||||||
|
@ -14,6 +14,7 @@ class GroupTabs extends Component {
|
|||||||
return (
|
return (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={{
|
style={{
|
||||||
|
marginTop: 5,
|
||||||
marginRight: 15,
|
marginRight: 15,
|
||||||
paddingBottom: 10,
|
paddingBottom: 10,
|
||||||
}}
|
}}
|
||||||
|
@ -19,7 +19,7 @@ const PropField = ({ onChange, onPress, knob }) => {
|
|||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{`${knob.name}`}
|
{`${knob.label || knob.name}`}
|
||||||
</Text>
|
</Text>
|
||||||
) : null}
|
) : null}
|
||||||
<InputType knob={knob} onChange={onChange} onPress={onPress} />
|
<InputType knob={knob} onChange={onChange} onPress={onPress} />
|
||||||
@ -30,6 +30,7 @@ const PropField = ({ onChange, onPress, knob }) => {
|
|||||||
PropField.propTypes = {
|
PropField.propTypes = {
|
||||||
knob: PropTypes.shape({
|
knob: PropTypes.shape({
|
||||||
name: PropTypes.string,
|
name: PropTypes.string,
|
||||||
|
label: PropTypes.string,
|
||||||
value: PropTypes.any,
|
value: PropTypes.any,
|
||||||
hideLabel: PropTypes.bool,
|
hideLabel: PropTypes.bool,
|
||||||
type: PropTypes.oneOf([
|
type: PropTypes.oneOf([
|
||||||
|
@ -118,6 +118,11 @@ export default class Panel extends React.Component {
|
|||||||
render: () => <Text id={DEFAULT_GROUP_ID}>{DEFAULT_GROUP_ID}</Text>,
|
render: () => <Text id={DEFAULT_GROUP_ID}>{DEFAULT_GROUP_ID}</Text>,
|
||||||
title: DEFAULT_GROUP_ID,
|
title: DEFAULT_GROUP_ID,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (groupId === DEFAULT_GROUP_ID) {
|
||||||
|
knobsArray = knobsArray.filter(key => !knobs[key].groupId);
|
||||||
|
}
|
||||||
|
|
||||||
if (groupId !== DEFAULT_GROUP_ID) {
|
if (groupId !== DEFAULT_GROUP_ID) {
|
||||||
knobsArray = knobsArray.filter(key => knobs[key].groupId === groupId);
|
knobsArray = knobsArray.filter(key => knobs[key].groupId === groupId);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-ondevice-notes",
|
"name": "@storybook/addon-ondevice-notes",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Write notes for your react-native Storybook stories.",
|
"description": "Write notes for your react-native Storybook stories.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -20,8 +20,8 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/client-logger": "5.2.0-beta.0",
|
"@storybook/client-logger": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"prop-types": "^15.7.2",
|
"prop-types": "^15.7.2",
|
||||||
"react-native-simple-markdown": "^1.1.0"
|
"react-native-simple-markdown": "^1.1.0"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-options",
|
"name": "@storybook/addon-options",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Options addon for storybook",
|
"description": "Options addon for storybook",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -22,7 +22,7 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"util-deprecate": "^1.0.2"
|
"util-deprecate": "^1.0.2"
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-queryparams",
|
"name": "@storybook/addon-queryparams",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "parameter addon for storybook",
|
"description": "parameter addon for storybook",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -23,12 +23,12 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/api": "5.2.0-beta.0",
|
"@storybook/api": "5.2.0-beta.2",
|
||||||
"@storybook/client-logger": "5.2.0-beta.0",
|
"@storybook/client-logger": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"common-tags": "^1.8.0",
|
"common-tags": "^1.8.0",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-storyshots",
|
"name": "@storybook/addon-storyshots",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "StoryShots is a Jest Snapshot Testing Addon for Storybook.",
|
"description": "StoryShots is a Jest Snapshot Testing Addon for Storybook.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -25,7 +25,7 @@
|
|||||||
"storybook": "start-storybook -p 6006"
|
"storybook": "start-storybook -p 6006"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"glob": "^7.1.3",
|
"glob": "^7.1.3",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
|
@ -23,7 +23,7 @@ function loadFramework(options) {
|
|||||||
|
|
||||||
if (!loader) {
|
if (!loader) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Couldn't find an appropriate framework loader -- do you need to set the `frameowrk` option?"
|
"Couldn't find an appropriate framework loader -- do you need to set the `framework` option?"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-storyshots-puppeteer",
|
"name": "@storybook/addon-storyshots-puppeteer",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Image snappshots addition to StoryShots base on puppeteer",
|
"description": "Image snappshots addition to StoryShots base on puppeteer",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -22,8 +22,8 @@
|
|||||||
"prepare": "node ../../../scripts/prepare.js"
|
"prepare": "node ../../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/node-logger": "5.2.0-beta.0",
|
"@storybook/node-logger": "5.2.0-beta.2",
|
||||||
"@storybook/router": "5.2.0-beta.0",
|
"@storybook/router": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"jest-image-snapshot": "^2.8.2",
|
"jest-image-snapshot": "^2.8.2",
|
||||||
"regenerator-runtime": "^0.12.1"
|
"regenerator-runtime": "^0.12.1"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-storysource",
|
"name": "@storybook/addon-storysource",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Stories addon for storybook",
|
"description": "Stories addon for storybook",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -22,10 +22,10 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/router": "5.2.0-beta.0",
|
"@storybook/router": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"estraverse": "^4.2.0",
|
"estraverse": "^4.2.0",
|
||||||
"loader-utils": "^1.2.3",
|
"loader-utils": "^1.2.3",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-viewport",
|
"name": "@storybook/addon-viewport",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook addon to change the viewport size to mobile",
|
"description": "Storybook addon to change the viewport size to mobile",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"addon",
|
"addon",
|
||||||
@ -21,12 +21,12 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/api": "5.2.0-beta.0",
|
"@storybook/api": "5.2.0-beta.2",
|
||||||
"@storybook/client-logger": "5.2.0-beta.0",
|
"@storybook/client-logger": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
"memoizerific": "^1.11.3",
|
"memoizerific": "^1.11.3",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/angular",
|
"name": "@storybook/angular",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook for Angular: Develop Angular Components in isolation with Hot Reloading.",
|
"description": "Storybook for Angular: Develop Angular Components in isolation with Hot Reloading.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"storybook"
|
"storybook"
|
||||||
@ -26,9 +26,9 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/core": "5.2.0-beta.0",
|
"@storybook/core": "5.2.0-beta.2",
|
||||||
"@storybook/node-logger": "5.2.0-beta.0",
|
"@storybook/node-logger": "5.2.0-beta.2",
|
||||||
"angular2-template-loader": "^0.6.2",
|
"angular2-template-loader": "^0.6.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"fork-ts-checker-webpack-plugin": "^1.3.4",
|
"fork-ts-checker-webpack-plugin": "^1.3.4",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/ember",
|
"name": "@storybook/ember",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
|
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
|
||||||
"homepage": "https://github.com/storybookjs/storybook/tree/master/app/ember",
|
"homepage": "https://github.com/storybookjs/storybook/tree/master/app/ember",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
@ -24,7 +24,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ember/test-helpers": "^1.5.0",
|
"@ember/test-helpers": "^1.5.0",
|
||||||
"@storybook/core": "5.2.0-beta.0",
|
"@storybook/core": "5.2.0-beta.2",
|
||||||
"common-tags": "^1.8.0",
|
"common-tags": "^1.8.0",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/html",
|
"name": "@storybook/html",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
|
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"storybook"
|
"storybook"
|
||||||
@ -26,8 +26,8 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/core": "5.2.0-beta.0",
|
"@storybook/core": "5.2.0-beta.2",
|
||||||
"common-tags": "^1.8.0",
|
"common-tags": "^1.8.0",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/marko",
|
"name": "@storybook/marko",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook for Marko: Develop Marko Component in isolation with Hot Reloading.",
|
"description": "Storybook for Marko: Develop Marko Component in isolation with Hot Reloading.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"storybook"
|
"storybook"
|
||||||
@ -26,7 +26,7 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/core": "5.2.0-beta.0",
|
"@storybook/core": "5.2.0-beta.2",
|
||||||
"common-tags": "^1.8.0",
|
"common-tags": "^1.8.0",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/mithril",
|
"name": "@storybook/mithril",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook for Mithril: Develop Mithril Component in isolation.",
|
"description": "Storybook for Mithril: Develop Mithril Component in isolation.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"storybook"
|
"storybook"
|
||||||
@ -27,7 +27,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/plugin-transform-react-jsx": "^7.3.0",
|
"@babel/plugin-transform-react-jsx": "^7.3.0",
|
||||||
"@storybook/core": "5.2.0-beta.0",
|
"@storybook/core": "5.2.0-beta.2",
|
||||||
"common-tags": "^1.8.0",
|
"common-tags": "^1.8.0",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/polymer",
|
"name": "@storybook/polymer",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook for Polymer: Develop Polymer components in isolation with Hot Reloading.",
|
"description": "Storybook for Polymer: Develop Polymer components in isolation with Hot Reloading.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"storybook"
|
"storybook"
|
||||||
@ -25,7 +25,7 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/core": "5.2.0-beta.0",
|
"@storybook/core": "5.2.0-beta.2",
|
||||||
"@webcomponents/webcomponentsjs": "^1.2.0",
|
"@webcomponents/webcomponentsjs": "^1.2.0",
|
||||||
"common-tags": "^1.8.0",
|
"common-tags": "^1.8.0",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/preact",
|
"name": "@storybook/preact",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook for Preact: Develop Preact Component in isolation.",
|
"description": "Storybook for Preact: Develop Preact Component in isolation.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"storybook"
|
"storybook"
|
||||||
@ -27,7 +27,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/plugin-transform-react-jsx": "^7.3.0",
|
"@babel/plugin-transform-react-jsx": "^7.3.0",
|
||||||
"@storybook/core": "5.2.0-beta.0",
|
"@storybook/core": "5.2.0-beta.2",
|
||||||
"common-tags": "^1.8.0",
|
"common-tags": "^1.8.0",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/rax",
|
"name": "@storybook/rax",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook for Rax: Develop Rax Component in isolation.",
|
"description": "Storybook for Rax: Develop Rax Component in isolation.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"storybook",
|
"storybook",
|
||||||
@ -27,7 +27,7 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/core": "5.2.0-beta.0",
|
"@storybook/core": "5.2.0-beta.2",
|
||||||
"babel-preset-rax": "^1.0.0-beta.0",
|
"babel-preset-rax": "^1.0.0-beta.0",
|
||||||
"common-tags": "^1.8.0",
|
"common-tags": "^1.8.0",
|
||||||
"core-js": "^2.6.2",
|
"core-js": "^2.6.2",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/react-native-server",
|
"name": "@storybook/react-native-server",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "A better way to develop React Native Components for your app",
|
"description": "A better way to develop React Native Components for your app",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
@ -24,12 +24,12 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/api": "5.2.0-beta.0",
|
"@storybook/api": "5.2.0-beta.2",
|
||||||
"@storybook/channel-websocket": "5.2.0-beta.0",
|
"@storybook/channel-websocket": "5.2.0-beta.2",
|
||||||
"@storybook/core": "5.2.0-beta.0",
|
"@storybook/core": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/ui": "5.2.0-beta.0",
|
"@storybook/ui": "5.2.0-beta.2",
|
||||||
"commander": "^2.19.0",
|
"commander": "^2.19.0",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/react-native",
|
"name": "@storybook/react-native",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "A better way to develop React Native Components for your app",
|
"description": "A better way to develop React Native Components for your app",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
@ -24,11 +24,11 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/core": "^10.0.14",
|
"@emotion/core": "^10.0.14",
|
||||||
"@emotion/native": "^10.0.14",
|
"@emotion/native": "^10.0.14",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/channel-websocket": "5.2.0-beta.0",
|
"@storybook/channel-websocket": "5.2.0-beta.2",
|
||||||
"@storybook/channels": "5.2.0-beta.0",
|
"@storybook/channels": "5.2.0-beta.2",
|
||||||
"@storybook/client-api": "5.2.0-beta.0",
|
"@storybook/client-api": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"emotion-theming": "^10.0.14",
|
"emotion-theming": "^10.0.14",
|
||||||
"react-native-swipe-gestures": "^1.0.3",
|
"react-native-swipe-gestures": "^1.0.3",
|
||||||
|
@ -25,6 +25,16 @@ export default class StoryView extends Component<Props> {
|
|||||||
channel.on(Events.FORCE_RE_RENDER, this.forceReRender);
|
channel.on(Events.FORCE_RE_RENDER, this.forceReRender);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidUpdate() {
|
||||||
|
const channel = addons.getChannel();
|
||||||
|
const { stories } = this.props;
|
||||||
|
const { storyId } = stories.getSelection();
|
||||||
|
|
||||||
|
if (storyId) {
|
||||||
|
channel.emit(Events.STORY_RENDERED, { storyId });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
const channel = addons.getChannel();
|
const channel = addons.getChannel();
|
||||||
channel.removeListener(Events.STORY_RENDER, this.forceReRender);
|
channel.removeListener(Events.STORY_RENDER, this.forceReRender);
|
||||||
@ -66,7 +76,7 @@ export default class StoryView extends Component<Props> {
|
|||||||
if (story && story.storyFn) {
|
if (story && story.storyFn) {
|
||||||
const { id, storyFn } = story;
|
const { id, storyFn } = story;
|
||||||
return (
|
return (
|
||||||
<View key={id} style={{ flex: 1 }}>
|
<View key={id} testID={id} style={{ flex: 1 }}>
|
||||||
{storyFn()}
|
{storyFn()}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/react",
|
"name": "@storybook/react",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
|
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"storybook"
|
"storybook"
|
||||||
@ -29,9 +29,9 @@
|
|||||||
"@babel/plugin-transform-react-constant-elements": "^7.2.0",
|
"@babel/plugin-transform-react-constant-elements": "^7.2.0",
|
||||||
"@babel/preset-flow": "^7.0.0",
|
"@babel/preset-flow": "^7.0.0",
|
||||||
"@babel/preset-react": "^7.0.0",
|
"@babel/preset-react": "^7.0.0",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/core": "5.2.0-beta.0",
|
"@storybook/core": "5.2.0-beta.2",
|
||||||
"@storybook/node-logger": "5.2.0-beta.0",
|
"@storybook/node-logger": "5.2.0-beta.2",
|
||||||
"@svgr/webpack": "^4.0.3",
|
"@svgr/webpack": "^4.0.3",
|
||||||
"babel-plugin-add-react-displayname": "^0.0.5",
|
"babel-plugin-add-react-displayname": "^0.0.5",
|
||||||
"babel-plugin-named-asset-import": "^0.3.1",
|
"babel-plugin-named-asset-import": "^0.3.1",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/riot",
|
"name": "@storybook/riot",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook for riot.js: View riot snippets in isolation with Hot Reloading.",
|
"description": "Storybook for riot.js: View riot snippets in isolation with Hot Reloading.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"storybook"
|
"storybook"
|
||||||
@ -25,7 +25,7 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/core": "5.2.0-beta.0",
|
"@storybook/core": "5.2.0-beta.2",
|
||||||
"common-tags": "^1.8.0",
|
"common-tags": "^1.8.0",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/svelte",
|
"name": "@storybook/svelte",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
|
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"storybook"
|
"storybook"
|
||||||
@ -26,7 +26,7 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/core": "5.2.0-beta.0",
|
"@storybook/core": "5.2.0-beta.2",
|
||||||
"common-tags": "^1.8.0",
|
"common-tags": "^1.8.0",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/vue",
|
"name": "@storybook/vue",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.",
|
"description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"storybook"
|
"storybook"
|
||||||
@ -26,7 +26,7 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/core": "5.2.0-beta.0",
|
"@storybook/core": "5.2.0-beta.2",
|
||||||
"common-tags": "^1.8.0",
|
"common-tags": "^1.8.0",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-decorator",
|
"name": "@storybook/addon-decorator",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "decorator addon for storybook",
|
"description": "decorator addon for storybook",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"devkit",
|
"devkit",
|
||||||
@ -24,8 +24,8 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/client-api": "5.2.0-beta.0",
|
"@storybook/client-api": "5.2.0-beta.2",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^3.0.1"
|
"global": "^3.0.1"
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-parameter",
|
"name": "@storybook/addon-parameter",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "parameter addon for storybook",
|
"description": "parameter addon for storybook",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"devkit",
|
"devkit",
|
||||||
@ -24,12 +24,12 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/api": "5.2.0-beta.0",
|
"@storybook/api": "5.2.0-beta.2",
|
||||||
"@storybook/client-logger": "5.2.0-beta.0",
|
"@storybook/client-logger": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"common-tags": "^1.8.0",
|
"common-tags": "^1.8.0",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/addon-roundtrip",
|
"name": "@storybook/addon-roundtrip",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"description": "roundtrip addon for storybook",
|
"description": "roundtrip addon for storybook",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"devkit",
|
"devkit",
|
||||||
@ -24,13 +24,13 @@
|
|||||||
"prepare": "node ../../scripts/prepare.js"
|
"prepare": "node ../../scripts/prepare.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/api": "5.2.0-beta.0",
|
"@storybook/api": "5.2.0-beta.2",
|
||||||
"@storybook/client-api": "5.2.0-beta.0",
|
"@storybook/client-api": "5.2.0-beta.2",
|
||||||
"@storybook/client-logger": "5.2.0-beta.0",
|
"@storybook/client-logger": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"common-tags": "^1.8.0",
|
"common-tags": "^1.8.0",
|
||||||
"core-js": "^3.0.1",
|
"core-js": "^3.0.1",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
|
@ -1 +1 @@
|
|||||||
{"version":"5.2.0-beta.0","info":{"plain":"### Features\n\n* Codemod: Convert module format to MDX ([#7418](https://github.com/storybookjs/storybook/pull/7418))"}}
|
{"version":"5.2.0-beta.2","info":{"plain":"### Features\n\n* CLI: convert mdx to module format ([#7419](https://github.com/storybookjs/storybook/pull/7419))\n* CLI: sb migrate npm & typescript support ([#7463](https://github.com/storybookjs/storybook/pull/7463))\n* Addon-Docs: HTML support & example ([#7454](https://github.com/storybookjs/storybook/pull/7454))\n\n### Bug Fixes\n\n* Convert-storiesof-to-module: user exports, collisions, reserved keywords ([#7471](https://github.com/storybookjs/storybook/pull/7471))\n* React-native: On-device knobs fixes ([#7470](https://github.com/storybookjs/storybook/pull/7470))\n\n### Dependency Upgrades\n\n* Addon-docs: Upgrade MDX to 1.1 ([#7476](https://github.com/storybookjs/storybook/pull/7476))"}}
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"expo": {
|
"expo": {
|
||||||
"sdkVersion": "32.0.0",
|
"sdkVersion": "33.0.0",
|
||||||
"platforms": [
|
"platforms": [
|
||||||
"ios",
|
"ios",
|
||||||
"android"
|
"android"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "crna-kitchen-sink",
|
"name": "crna-kitchen-sink",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "node_modules/expo/AppEntry.js",
|
"main": "node_modules/expo/AppEntry.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -15,23 +15,23 @@
|
|||||||
"preset": "jest-expo"
|
"preset": "jest-expo"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"expo": "^32.0.6",
|
"expo": "^33.0.7",
|
||||||
"prop-types": "^15.6.2",
|
"prop-types": "^15.6.2",
|
||||||
"react": "16.8.6",
|
"react": "16.8.6",
|
||||||
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
|
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
|
||||||
"whatwg-fetch": "^3.0.0"
|
"whatwg-fetch": "^3.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.2.2",
|
"@babel/core": "^7.2.2",
|
||||||
"@babel/plugin-transform-react-jsx-source": "^7.2.0",
|
"@babel/plugin-transform-react-jsx-source": "^7.2.0",
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0",
|
"@storybook/addon-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-knobs": "5.2.0-beta.0",
|
"@storybook/addon-knobs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-ondevice-actions": "5.2.0-beta.0",
|
"@storybook/addon-ondevice-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-ondevice-backgrounds": "5.2.0-beta.0",
|
"@storybook/addon-ondevice-backgrounds": "5.2.0-beta.2",
|
||||||
"@storybook/addon-ondevice-knobs": "5.2.0-beta.0",
|
"@storybook/addon-ondevice-knobs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-ondevice-notes": "5.2.0-beta.0",
|
"@storybook/addon-ondevice-notes": "5.2.0-beta.2",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/react-native": "5.2.0-beta.0",
|
"@storybook/react-native": "5.2.0-beta.2",
|
||||||
"babel-loader": "^8.0.4",
|
"babel-loader": "^8.0.4",
|
||||||
"babel-plugin-module-resolver": "^3.2.0",
|
"babel-plugin-module-resolver": "^3.2.0",
|
||||||
"babel-preset-expo": "^5.1.1",
|
"babel-preset-expo": "^5.1.1",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "angular-cli",
|
"name": "angular-cli",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -34,21 +34,21 @@
|
|||||||
"@angular-devkit/build-angular": "^0.13.4",
|
"@angular-devkit/build-angular": "^0.13.4",
|
||||||
"@angular/cli": "^7.3.6",
|
"@angular/cli": "^7.3.6",
|
||||||
"@angular/compiler-cli": "^7.2.6",
|
"@angular/compiler-cli": "^7.2.6",
|
||||||
"@storybook/addon-a11y": "5.2.0-beta.0",
|
"@storybook/addon-a11y": "5.2.0-beta.2",
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0",
|
"@storybook/addon-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-backgrounds": "5.2.0-beta.0",
|
"@storybook/addon-backgrounds": "5.2.0-beta.2",
|
||||||
"@storybook/addon-centered": "5.2.0-beta.0",
|
"@storybook/addon-centered": "5.2.0-beta.2",
|
||||||
"@storybook/addon-docs": "5.2.0-beta.0",
|
"@storybook/addon-docs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-jest": "5.2.0-beta.0",
|
"@storybook/addon-jest": "5.2.0-beta.2",
|
||||||
"@storybook/addon-knobs": "5.2.0-beta.0",
|
"@storybook/addon-knobs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-links": "5.2.0-beta.0",
|
"@storybook/addon-links": "5.2.0-beta.2",
|
||||||
"@storybook/addon-notes": "5.2.0-beta.0",
|
"@storybook/addon-notes": "5.2.0-beta.2",
|
||||||
"@storybook/addon-options": "5.2.0-beta.0",
|
"@storybook/addon-options": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storyshots": "5.2.0-beta.0",
|
"@storybook/addon-storyshots": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storysource": "5.2.0-beta.0",
|
"@storybook/addon-storysource": "5.2.0-beta.2",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/angular": "5.2.0-beta.0",
|
"@storybook/angular": "5.2.0-beta.2",
|
||||||
"@storybook/source-loader": "5.2.0-beta.0",
|
"@storybook/source-loader": "5.2.0-beta.2",
|
||||||
"@types/core-js": "^2.5.0",
|
"@types/core-js": "^2.5.0",
|
||||||
"@types/jest": "^24.0.11",
|
"@types/jest": "^24.0.11",
|
||||||
"@types/node": "~12.0.2",
|
"@types/node": "~12.0.2",
|
||||||
|
@ -23,3 +23,4 @@ addParameters({
|
|||||||
});
|
});
|
||||||
|
|
||||||
load(require.context('../src/stories', true, /\.stories\.js$/), module);
|
load(require.context('../src/stories', true, /\.stories\.js$/), module);
|
||||||
|
load(require.context('../src/stories', true, /\.stories\.mdx$/), module);
|
||||||
|
8
examples/cra-kitchen-sink/.storybook/presets.js
Normal file
8
examples/cra-kitchen-sink/.storybook/presets.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
module.exports = [
|
||||||
|
{
|
||||||
|
name: '@storybook/addon-docs/react/preset',
|
||||||
|
options: {
|
||||||
|
configureJSX: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cra-kitchen-sink",
|
"name": "cra-kitchen-sink",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "react-scripts build",
|
"build": "react-scripts build",
|
||||||
@ -19,22 +19,22 @@
|
|||||||
"react-lifecycles-compat": "^3.0.4"
|
"react-lifecycles-compat": "^3.0.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@storybook/addon-a11y": "5.2.0-beta.0",
|
"@storybook/addon-a11y": "5.2.0-beta.2",
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0",
|
"@storybook/addon-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-backgrounds": "5.2.0-beta.0",
|
"@storybook/addon-backgrounds": "5.2.0-beta.2",
|
||||||
"@storybook/addon-centered": "5.2.0-beta.0",
|
"@storybook/addon-centered": "5.2.0-beta.2",
|
||||||
"@storybook/addon-events": "5.2.0-beta.0",
|
"@storybook/addon-events": "5.2.0-beta.2",
|
||||||
"@storybook/addon-info": "5.2.0-beta.0",
|
"@storybook/addon-info": "5.2.0-beta.2",
|
||||||
"@storybook/addon-jest": "5.2.0-beta.0",
|
"@storybook/addon-jest": "5.2.0-beta.2",
|
||||||
"@storybook/addon-knobs": "5.2.0-beta.0",
|
"@storybook/addon-knobs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-links": "5.2.0-beta.0",
|
"@storybook/addon-links": "5.2.0-beta.2",
|
||||||
"@storybook/addon-notes": "5.2.0-beta.0",
|
"@storybook/addon-notes": "5.2.0-beta.2",
|
||||||
"@storybook/addon-options": "5.2.0-beta.0",
|
"@storybook/addon-options": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storyshots": "5.2.0-beta.0",
|
"@storybook/addon-storyshots": "5.2.0-beta.2",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/client-logger": "5.2.0-beta.0",
|
"@storybook/client-logger": "5.2.0-beta.2",
|
||||||
"@storybook/react": "5.2.0-beta.0",
|
"@storybook/react": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"react-scripts": "^3.0.1"
|
"react-scripts": "^3.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
7
examples/cra-kitchen-sink/src/stories/test.stories.mdx
Normal file
7
examples/cra-kitchen-sink/src/stories/test.stories.mdx
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import { Story, Meta } from '@storybook/addon-docs/blocks';
|
||||||
|
|
||||||
|
<Meta title="Docs|Test" />
|
||||||
|
|
||||||
|
<Story name="NewStory123">
|
||||||
|
<h2> Hello </h2>
|
||||||
|
</Story>
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cra-react15",
|
"name": "cra-react15",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"babel-loader": "8.0.6",
|
"babel-loader": "8.0.6",
|
||||||
@ -19,10 +19,10 @@
|
|||||||
"build-storybook": "build-storybook -s public"
|
"build-storybook": "build-storybook -s public"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0",
|
"@storybook/addon-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-links": "5.2.0-beta.0",
|
"@storybook/addon-links": "5.2.0-beta.2",
|
||||||
"@storybook/react": "5.2.0-beta.0",
|
"@storybook/react": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"babel-core": "6",
|
"babel-core": "6",
|
||||||
"babel-runtime": "6"
|
"babel-runtime": "6"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cra-ts-kitchen-sink",
|
"name": "cra-ts-kitchen-sink",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build-storybook": "build-storybook -s public",
|
"build-storybook": "build-storybook -s public",
|
||||||
@ -14,12 +14,12 @@
|
|||||||
"react-dom": "^16.8.3"
|
"react-dom": "^16.8.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@storybook/addon-a11y": "5.2.0-beta.0",
|
"@storybook/addon-a11y": "5.2.0-beta.2",
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0",
|
"@storybook/addon-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-info": "5.2.0-beta.0",
|
"@storybook/addon-info": "5.2.0-beta.2",
|
||||||
"@storybook/addon-options": "5.2.0-beta.0",
|
"@storybook/addon-options": "5.2.0-beta.2",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/react": "5.2.0-beta.0",
|
"@storybook/react": "5.2.0-beta.2",
|
||||||
"@types/enzyme": "^3.9.0",
|
"@types/enzyme": "^3.9.0",
|
||||||
"@types/react": "^16.8.3",
|
"@types/react": "^16.8.3",
|
||||||
"@types/react-dom": "^16.8.2",
|
"@types/react-dom": "^16.8.2",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@storybook/example-devkits",
|
"name": "@storybook/example-devkits",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build-storybook": "build-storybook -c ./ -s built-storybooks",
|
"build-storybook": "build-storybook -c ./ -s built-storybooks",
|
||||||
@ -8,15 +8,15 @@
|
|||||||
"storybook": "start-storybook -p 9011 -c ./"
|
"storybook": "start-storybook -p 9011 -c ./"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@storybook/addon-decorator": "5.2.0-beta.0",
|
"@storybook/addon-decorator": "5.2.0-beta.2",
|
||||||
"@storybook/addon-parameter": "5.2.0-beta.0",
|
"@storybook/addon-parameter": "5.2.0-beta.2",
|
||||||
"@storybook/addon-roundtrip": "5.2.0-beta.0",
|
"@storybook/addon-roundtrip": "5.2.0-beta.2",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/node-logger": "5.2.0-beta.0",
|
"@storybook/node-logger": "5.2.0-beta.2",
|
||||||
"@storybook/react": "5.2.0-beta.0",
|
"@storybook/react": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"cross-env": "^5.2.0",
|
"cross-env": "^5.2.0",
|
||||||
"enzyme-to-json": "^3.3.5",
|
"enzyme-to-json": "^3.3.5",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ember-example",
|
"name": "ember-example",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "ember build",
|
"build": "ember build",
|
||||||
@ -15,19 +15,19 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.3.4",
|
"@babel/core": "^7.3.4",
|
||||||
"@storybook/addon-a11y": "5.2.0-beta.0",
|
"@storybook/addon-a11y": "5.2.0-beta.2",
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0",
|
"@storybook/addon-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-backgrounds": "5.2.0-beta.0",
|
"@storybook/addon-backgrounds": "5.2.0-beta.2",
|
||||||
"@storybook/addon-centered": "5.2.0-beta.0",
|
"@storybook/addon-centered": "5.2.0-beta.2",
|
||||||
"@storybook/addon-knobs": "5.2.0-beta.0",
|
"@storybook/addon-knobs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-links": "5.2.0-beta.0",
|
"@storybook/addon-links": "5.2.0-beta.2",
|
||||||
"@storybook/addon-notes": "5.2.0-beta.0",
|
"@storybook/addon-notes": "5.2.0-beta.2",
|
||||||
"@storybook/addon-options": "5.2.0-beta.0",
|
"@storybook/addon-options": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storysource": "5.2.0-beta.0",
|
"@storybook/addon-storysource": "5.2.0-beta.2",
|
||||||
"@storybook/addon-viewport": "5.2.0-beta.0",
|
"@storybook/addon-viewport": "5.2.0-beta.2",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/ember": "5.2.0-beta.0",
|
"@storybook/ember": "5.2.0-beta.2",
|
||||||
"@storybook/source-loader": "5.2.0-beta.0",
|
"@storybook/source-loader": "5.2.0-beta.2",
|
||||||
"babel-loader": "^8",
|
"babel-loader": "^8",
|
||||||
"broccoli-asset-rev": "^3.0.0",
|
"broccoli-asset-rev": "^3.0.0",
|
||||||
"cross-env": "^5.2.0",
|
"cross-env": "^5.2.0",
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { load, addParameters, addDecorator } from '@storybook/html';
|
import { load, addParameters, addDecorator } from '@storybook/html';
|
||||||
import { withA11y } from '@storybook/addon-a11y';
|
import { withA11y } from '@storybook/addon-a11y';
|
||||||
|
import { DocsPage } from '@storybook/addon-docs/blocks';
|
||||||
|
|
||||||
addDecorator(withA11y);
|
addDecorator(withA11y);
|
||||||
|
|
||||||
@ -13,7 +14,12 @@ addParameters({
|
|||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
hierarchyRootSeparator: /\|/,
|
hierarchyRootSeparator: /\|/,
|
||||||
|
docs: {
|
||||||
|
iframeHeight: '200px',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
docs: DocsPage,
|
||||||
});
|
});
|
||||||
|
|
||||||
load(require.context('../stories', true, /\.stories\.js$/), module);
|
load(require.context('../stories', true, /\.stories\.js$/), module);
|
||||||
|
load(require.context('../stories', true, /\.stories\.mdx$/), module);
|
||||||
|
8
examples/html-kitchen-sink/.storybook/presets.js
Normal file
8
examples/html-kitchen-sink/.storybook/presets.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
module.exports = [
|
||||||
|
{
|
||||||
|
name: '@storybook/addon-docs/html/preset',
|
||||||
|
options: {
|
||||||
|
configureJSX: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "html-kitchen-sink",
|
"name": "html-kitchen-sink",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "",
|
"description": "",
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
@ -14,25 +14,26 @@
|
|||||||
"storybook": "start-storybook -p 9006 --no-dll"
|
"storybook": "start-storybook -p 9006 --no-dll"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@storybook/addon-a11y": "5.2.0-beta.0",
|
"@storybook/addon-a11y": "5.2.0-beta.2",
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0",
|
"@storybook/addon-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-backgrounds": "5.2.0-beta.0",
|
"@storybook/addon-backgrounds": "5.2.0-beta.2",
|
||||||
"@storybook/addon-centered": "5.2.0-beta.0",
|
"@storybook/addon-centered": "5.2.0-beta.2",
|
||||||
"@storybook/addon-events": "5.2.0-beta.0",
|
"@storybook/addon-docs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-jest": "5.2.0-beta.0",
|
"@storybook/addon-events": "5.2.0-beta.2",
|
||||||
"@storybook/addon-knobs": "5.2.0-beta.0",
|
"@storybook/addon-jest": "5.2.0-beta.2",
|
||||||
"@storybook/addon-links": "5.2.0-beta.0",
|
"@storybook/addon-knobs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-notes": "5.2.0-beta.0",
|
"@storybook/addon-links": "5.2.0-beta.2",
|
||||||
"@storybook/addon-options": "5.2.0-beta.0",
|
"@storybook/addon-notes": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storyshots": "5.2.0-beta.0",
|
"@storybook/addon-options": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storysource": "5.2.0-beta.0",
|
"@storybook/addon-storyshots": "5.2.0-beta.2",
|
||||||
"@storybook/addon-viewport": "5.2.0-beta.0",
|
"@storybook/addon-storysource": "5.2.0-beta.2",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addon-viewport": "5.2.0-beta.2",
|
||||||
"@storybook/client-api": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/core": "5.2.0-beta.0",
|
"@storybook/client-api": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core": "5.2.0-beta.2",
|
||||||
"@storybook/html": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/source-loader": "5.2.0-beta.0",
|
"@storybook/html": "5.2.0-beta.2",
|
||||||
|
"@storybook/source-loader": "5.2.0-beta.2",
|
||||||
"eventemitter3": "^3.1.0",
|
"eventemitter3": "^3.1.0",
|
||||||
"format-json": "^1.0.3",
|
"format-json": "^1.0.3",
|
||||||
"global": "^4.3.2"
|
"global": "^4.3.2"
|
||||||
|
20
examples/html-kitchen-sink/stories/addon-docs.stories.mdx
Normal file
20
examples/html-kitchen-sink/stories/addon-docs.stories.mdx
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { Story, Preview, Meta } from '@storybook/addon-docs/blocks';
|
||||||
|
|
||||||
|
# Storybook Docs for HTML
|
||||||
|
|
||||||
|
<Meta title="Addons|Docs" />
|
||||||
|
|
||||||
|
## Story definition
|
||||||
|
|
||||||
|
Hallelujah! HTML is working out of the box without modification.
|
||||||
|
How you like them apples?!
|
||||||
|
|
||||||
|
<Story name="heading" height="100px">
|
||||||
|
{'<h1>Hello World</h1>'}
|
||||||
|
</Story>
|
||||||
|
|
||||||
|
## Story reference
|
||||||
|
|
||||||
|
You can also reference an existing story from within your MDX file.
|
||||||
|
|
||||||
|
<Story id="welcome--welcome" height="800px" />
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "marko-cli",
|
"name": "marko-cli",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Demo of how to build an app using marko-starter",
|
"description": "Demo of how to build an app using marko-starter",
|
||||||
"repository": {
|
"repository": {
|
||||||
@ -24,14 +24,14 @@
|
|||||||
"marko-starter": "^2.0.4"
|
"marko-starter": "^2.0.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@storybook/addon-a11y": "5.2.0-beta.0",
|
"@storybook/addon-a11y": "5.2.0-beta.2",
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0",
|
"@storybook/addon-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-knobs": "5.2.0-beta.0",
|
"@storybook/addon-knobs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-options": "5.2.0-beta.0",
|
"@storybook/addon-options": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storysource": "5.2.0-beta.0",
|
"@storybook/addon-storysource": "5.2.0-beta.2",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/marko": "5.2.0-beta.0",
|
"@storybook/marko": "5.2.0-beta.2",
|
||||||
"@storybook/source-loader": "5.2.0-beta.0",
|
"@storybook/source-loader": "5.2.0-beta.2",
|
||||||
"prettier": "^1.16.4",
|
"prettier": "^1.16.4",
|
||||||
"webpack": "^4.33.0"
|
"webpack": "^4.33.0"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mithril-example",
|
"name": "mithril-example",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build-storybook": "build-storybook",
|
"build-storybook": "build-storybook",
|
||||||
@ -11,20 +11,20 @@
|
|||||||
"mithril": "^1.1.6"
|
"mithril": "^1.1.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@storybook/addon-a11y": "5.2.0-beta.0",
|
"@storybook/addon-a11y": "5.2.0-beta.2",
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0",
|
"@storybook/addon-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-backgrounds": "5.2.0-beta.0",
|
"@storybook/addon-backgrounds": "5.2.0-beta.2",
|
||||||
"@storybook/addon-centered": "5.2.0-beta.0",
|
"@storybook/addon-centered": "5.2.0-beta.2",
|
||||||
"@storybook/addon-knobs": "5.2.0-beta.0",
|
"@storybook/addon-knobs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-links": "5.2.0-beta.0",
|
"@storybook/addon-links": "5.2.0-beta.2",
|
||||||
"@storybook/addon-notes": "5.2.0-beta.0",
|
"@storybook/addon-notes": "5.2.0-beta.2",
|
||||||
"@storybook/addon-options": "5.2.0-beta.0",
|
"@storybook/addon-options": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storyshots": "5.2.0-beta.0",
|
"@storybook/addon-storyshots": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storysource": "5.2.0-beta.0",
|
"@storybook/addon-storysource": "5.2.0-beta.2",
|
||||||
"@storybook/addon-viewport": "5.2.0-beta.0",
|
"@storybook/addon-viewport": "5.2.0-beta.2",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/mithril": "5.2.0-beta.0",
|
"@storybook/mithril": "5.2.0-beta.2",
|
||||||
"@storybook/source-loader": "5.2.0-beta.0",
|
"@storybook/source-loader": "5.2.0-beta.2",
|
||||||
"webpack": "^4.33.0"
|
"webpack": "^4.33.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "official-storybook",
|
"name": "official-storybook",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build-storybook": "build-storybook -c ./ -s built-storybooks",
|
"build-storybook": "build-storybook -c ./ -s built-storybooks",
|
||||||
@ -15,34 +15,34 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@packtracker/webpack-plugin": "^2.0.1",
|
"@packtracker/webpack-plugin": "^2.0.1",
|
||||||
"@storybook/addon-a11y": "5.2.0-beta.0",
|
"@storybook/addon-a11y": "5.2.0-beta.2",
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0",
|
"@storybook/addon-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-backgrounds": "5.2.0-beta.0",
|
"@storybook/addon-backgrounds": "5.2.0-beta.2",
|
||||||
"@storybook/addon-centered": "5.2.0-beta.0",
|
"@storybook/addon-centered": "5.2.0-beta.2",
|
||||||
"@storybook/addon-contexts": "5.2.0-beta.0",
|
"@storybook/addon-contexts": "5.2.0-beta.2",
|
||||||
"@storybook/addon-cssresources": "5.2.0-beta.0",
|
"@storybook/addon-cssresources": "5.2.0-beta.2",
|
||||||
"@storybook/addon-design-assets": "5.2.0-beta.0",
|
"@storybook/addon-design-assets": "5.2.0-beta.2",
|
||||||
"@storybook/addon-docs": "5.2.0-beta.0",
|
"@storybook/addon-docs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-events": "5.2.0-beta.0",
|
"@storybook/addon-events": "5.2.0-beta.2",
|
||||||
"@storybook/addon-graphql": "5.2.0-beta.0",
|
"@storybook/addon-graphql": "5.2.0-beta.2",
|
||||||
"@storybook/addon-info": "5.2.0-beta.0",
|
"@storybook/addon-info": "5.2.0-beta.2",
|
||||||
"@storybook/addon-jest": "5.2.0-beta.0",
|
"@storybook/addon-jest": "5.2.0-beta.2",
|
||||||
"@storybook/addon-knobs": "5.2.0-beta.0",
|
"@storybook/addon-knobs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-links": "5.2.0-beta.0",
|
"@storybook/addon-links": "5.2.0-beta.2",
|
||||||
"@storybook/addon-notes": "5.2.0-beta.0",
|
"@storybook/addon-notes": "5.2.0-beta.2",
|
||||||
"@storybook/addon-options": "5.2.0-beta.0",
|
"@storybook/addon-options": "5.2.0-beta.2",
|
||||||
"@storybook/addon-queryparams": "5.2.0-beta.0",
|
"@storybook/addon-queryparams": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storyshots": "5.2.0-beta.0",
|
"@storybook/addon-storyshots": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storyshots-puppeteer": "5.2.0-beta.0",
|
"@storybook/addon-storyshots-puppeteer": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storysource": "5.2.0-beta.0",
|
"@storybook/addon-storysource": "5.2.0-beta.2",
|
||||||
"@storybook/addon-viewport": "5.2.0-beta.0",
|
"@storybook/addon-viewport": "5.2.0-beta.2",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/components": "5.2.0-beta.0",
|
"@storybook/components": "5.2.0-beta.2",
|
||||||
"@storybook/core-events": "5.2.0-beta.0",
|
"@storybook/core-events": "5.2.0-beta.2",
|
||||||
"@storybook/node-logger": "5.2.0-beta.0",
|
"@storybook/node-logger": "5.2.0-beta.2",
|
||||||
"@storybook/react": "5.2.0-beta.0",
|
"@storybook/react": "5.2.0-beta.2",
|
||||||
"@storybook/source-loader": "5.2.0-beta.0",
|
"@storybook/source-loader": "5.2.0-beta.2",
|
||||||
"@storybook/theming": "5.2.0-beta.0",
|
"@storybook/theming": "5.2.0-beta.2",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"cross-env": "^5.2.0",
|
"cross-env": "^5.2.0",
|
||||||
"enzyme-to-json": "^3.3.5",
|
"enzyme-to-json": "^3.3.5",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React from 'react';
|
import React, { useState } from 'react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { Button } from '@storybook/react/demo';
|
import { Button } from '@storybook/react/demo';
|
||||||
|
|
||||||
@ -21,7 +21,17 @@ export const withSomeEmoji = () => (
|
|||||||
</span>
|
</span>
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
|
||||||
withSomeEmoji.story = {
|
withSomeEmoji.story = {
|
||||||
name: 'with some emoji',
|
name: 'with some emoji',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const withCounter = () =>
|
||||||
|
React.createElement(() => {
|
||||||
|
const [counter, setCounter] = useState(0);
|
||||||
|
const label = `Testing: ${counter}`;
|
||||||
|
return <Button onClick={() => setCounter(counter + 1)}>{label}</Button>;
|
||||||
|
});
|
||||||
|
|
||||||
|
withCounter.story = {
|
||||||
|
name: 'with coumter',
|
||||||
|
};
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
import { render, fireEvent } from 'react-testing-library';
|
||||||
|
import { withText, withCounter } from './button.stories';
|
||||||
|
|
||||||
|
const mockAction = jest.fn();
|
||||||
|
jest.mock('@storybook/addon-actions', () => ({
|
||||||
|
action: () => mockAction,
|
||||||
|
}));
|
||||||
|
|
||||||
|
describe('module story embedding', () => {
|
||||||
|
it('should test actions', () => {
|
||||||
|
const comp = render(withText());
|
||||||
|
fireEvent.click(comp.getByText('Hello Button'));
|
||||||
|
expect(mockAction).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should test story state', () => {
|
||||||
|
const comp = render(withCounter());
|
||||||
|
fireEvent.click(comp.getByText('Testing: 0'));
|
||||||
|
expect(comp.getByText('Testing: 1')).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "polymer-cli",
|
"name": "polymer-cli",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build-storybook": "build-storybook",
|
"build-storybook": "build-storybook",
|
||||||
@ -10,17 +10,17 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@polymer/polymer": "^2.6.0",
|
"@polymer/polymer": "^2.6.0",
|
||||||
"@storybook/addon-a11y": "5.2.0-beta.0",
|
"@storybook/addon-a11y": "5.2.0-beta.2",
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0",
|
"@storybook/addon-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-backgrounds": "5.2.0-beta.0",
|
"@storybook/addon-backgrounds": "5.2.0-beta.2",
|
||||||
"@storybook/addon-knobs": "5.2.0-beta.0",
|
"@storybook/addon-knobs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-links": "5.2.0-beta.0",
|
"@storybook/addon-links": "5.2.0-beta.2",
|
||||||
"@storybook/addon-notes": "5.2.0-beta.0",
|
"@storybook/addon-notes": "5.2.0-beta.2",
|
||||||
"@storybook/addon-options": "5.2.0-beta.0",
|
"@storybook/addon-options": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storysource": "5.2.0-beta.0",
|
"@storybook/addon-storysource": "5.2.0-beta.2",
|
||||||
"@storybook/addon-viewport": "5.2.0-beta.0",
|
"@storybook/addon-viewport": "5.2.0-beta.2",
|
||||||
"@storybook/polymer": "5.2.0-beta.0",
|
"@storybook/polymer": "5.2.0-beta.2",
|
||||||
"@storybook/source-loader": "5.2.0-beta.0",
|
"@storybook/source-loader": "5.2.0-beta.2",
|
||||||
"@webcomponents/webcomponentsjs": "^1.2.0",
|
"@webcomponents/webcomponentsjs": "^1.2.0",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
"lit-html": "^1.0.0",
|
"lit-html": "^1.0.0",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "preact-example",
|
"name": "preact-example",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
|
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
|
||||||
@ -16,21 +16,21 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.3.4",
|
"@babel/core": "^7.3.4",
|
||||||
"@babel/plugin-transform-runtime": "^7.2.0",
|
"@babel/plugin-transform-runtime": "^7.2.0",
|
||||||
"@storybook/addon-a11y": "5.2.0-beta.0",
|
"@storybook/addon-a11y": "5.2.0-beta.2",
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0",
|
"@storybook/addon-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-backgrounds": "5.2.0-beta.0",
|
"@storybook/addon-backgrounds": "5.2.0-beta.2",
|
||||||
"@storybook/addon-centered": "5.2.0-beta.0",
|
"@storybook/addon-centered": "5.2.0-beta.2",
|
||||||
"@storybook/addon-contexts": "5.2.0-beta.0",
|
"@storybook/addon-contexts": "5.2.0-beta.2",
|
||||||
"@storybook/addon-knobs": "5.2.0-beta.0",
|
"@storybook/addon-knobs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-links": "5.2.0-beta.0",
|
"@storybook/addon-links": "5.2.0-beta.2",
|
||||||
"@storybook/addon-notes": "5.2.0-beta.0",
|
"@storybook/addon-notes": "5.2.0-beta.2",
|
||||||
"@storybook/addon-options": "5.2.0-beta.0",
|
"@storybook/addon-options": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storyshots": "5.2.0-beta.0",
|
"@storybook/addon-storyshots": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storysource": "5.2.0-beta.0",
|
"@storybook/addon-storysource": "5.2.0-beta.2",
|
||||||
"@storybook/addon-viewport": "5.2.0-beta.0",
|
"@storybook/addon-viewport": "5.2.0-beta.2",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/preact": "5.2.0-beta.0",
|
"@storybook/preact": "5.2.0-beta.2",
|
||||||
"@storybook/source-loader": "5.2.0-beta.0",
|
"@storybook/source-loader": "5.2.0-beta.2",
|
||||||
"babel-loader": "^8.0.4",
|
"babel-loader": "^8.0.4",
|
||||||
"cross-env": "^5.2.0",
|
"cross-env": "^5.2.0",
|
||||||
"file-loader": "^3.0.1",
|
"file-loader": "^3.0.1",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rax-kitchen-sink",
|
"name": "rax-kitchen-sink",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test:generate-output": "jest --json --outputFile=jest-test-results.json --config=./jest-addon.config.js",
|
"test:generate-output": "jest --json --outputFile=jest-test-results.json --config=./jest-addon.config.js",
|
||||||
@ -24,23 +24,23 @@
|
|||||||
"rax-view": "^0.6.5"
|
"rax-view": "^0.6.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@storybook/addon-a11y": "5.2.0-beta.0",
|
"@storybook/addon-a11y": "5.2.0-beta.2",
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0",
|
"@storybook/addon-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-backgrounds": "5.2.0-beta.0",
|
"@storybook/addon-backgrounds": "5.2.0-beta.2",
|
||||||
"@storybook/addon-centered": "5.2.0-beta.0",
|
"@storybook/addon-centered": "5.2.0-beta.2",
|
||||||
"@storybook/addon-events": "5.2.0-beta.0",
|
"@storybook/addon-events": "5.2.0-beta.2",
|
||||||
"@storybook/addon-info": "5.2.0-beta.0",
|
"@storybook/addon-info": "5.2.0-beta.2",
|
||||||
"@storybook/addon-jest": "5.2.0-beta.0",
|
"@storybook/addon-jest": "5.2.0-beta.2",
|
||||||
"@storybook/addon-knobs": "5.2.0-beta.0",
|
"@storybook/addon-knobs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-links": "5.2.0-beta.0",
|
"@storybook/addon-links": "5.2.0-beta.2",
|
||||||
"@storybook/addon-notes": "5.2.0-beta.0",
|
"@storybook/addon-notes": "5.2.0-beta.2",
|
||||||
"@storybook/addon-options": "5.2.0-beta.0",
|
"@storybook/addon-options": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storyshots": "5.2.0-beta.0",
|
"@storybook/addon-storyshots": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storysource": "5.2.0-beta.0",
|
"@storybook/addon-storysource": "5.2.0-beta.2",
|
||||||
"@storybook/addon-viewport": "5.2.0-beta.0",
|
"@storybook/addon-viewport": "5.2.0-beta.2",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/rax": "5.2.0-beta.0",
|
"@storybook/rax": "5.2.0-beta.2",
|
||||||
"@storybook/source-loader": "5.2.0-beta.0",
|
"@storybook/source-loader": "5.2.0-beta.2",
|
||||||
"babel-eslint": "^8.2.2",
|
"babel-eslint": "^8.2.2",
|
||||||
"babel-preset-rax": "^1.0.0-beta.0",
|
"babel-preset-rax": "^1.0.0-beta.0",
|
||||||
"rax-scripts": "^1.0.0-beta.10",
|
"rax-scripts": "^1.0.0-beta.10",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "riot-example",
|
"name": "riot-example",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
|
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
|
||||||
@ -16,20 +16,20 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.3.4",
|
"@babel/core": "^7.3.4",
|
||||||
"@storybook/addon-a11y": "5.2.0-beta.0",
|
"@storybook/addon-a11y": "5.2.0-beta.2",
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0",
|
"@storybook/addon-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-backgrounds": "5.2.0-beta.0",
|
"@storybook/addon-backgrounds": "5.2.0-beta.2",
|
||||||
"@storybook/addon-centered": "5.2.0-beta.0",
|
"@storybook/addon-centered": "5.2.0-beta.2",
|
||||||
"@storybook/addon-knobs": "5.2.0-beta.0",
|
"@storybook/addon-knobs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-links": "5.2.0-beta.0",
|
"@storybook/addon-links": "5.2.0-beta.2",
|
||||||
"@storybook/addon-notes": "5.2.0-beta.0",
|
"@storybook/addon-notes": "5.2.0-beta.2",
|
||||||
"@storybook/addon-options": "5.2.0-beta.0",
|
"@storybook/addon-options": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storyshots": "5.2.0-beta.0",
|
"@storybook/addon-storyshots": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storysource": "5.2.0-beta.0",
|
"@storybook/addon-storysource": "5.2.0-beta.2",
|
||||||
"@storybook/addon-viewport": "5.2.0-beta.0",
|
"@storybook/addon-viewport": "5.2.0-beta.2",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/riot": "5.2.0-beta.0",
|
"@storybook/riot": "5.2.0-beta.2",
|
||||||
"@storybook/source-loader": "5.2.0-beta.0",
|
"@storybook/source-loader": "5.2.0-beta.2",
|
||||||
"babel-loader": "^8.0.4",
|
"babel-loader": "^8.0.4",
|
||||||
"cross-env": "^5.2.0",
|
"cross-env": "^5.2.0",
|
||||||
"file-loader": "^3.0.1",
|
"file-loader": "^3.0.1",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "standalone-preview",
|
"name": "standalone-preview",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"storybook": "parcel ./storybook.html --port 1337"
|
"storybook": "parcel ./storybook.html --port 1337"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "svelte-example",
|
"name": "svelte-example",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build-storybook": "build-storybook -s public",
|
"build-storybook": "build-storybook -s public",
|
||||||
@ -11,19 +11,19 @@
|
|||||||
"global": "^4.3.2"
|
"global": "^4.3.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@storybook/addon-a11y": "5.2.0-beta.0",
|
"@storybook/addon-a11y": "5.2.0-beta.2",
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0",
|
"@storybook/addon-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-backgrounds": "5.2.0-beta.0",
|
"@storybook/addon-backgrounds": "5.2.0-beta.2",
|
||||||
"@storybook/addon-centered": "5.2.0-beta.0",
|
"@storybook/addon-centered": "5.2.0-beta.2",
|
||||||
"@storybook/addon-knobs": "5.2.0-beta.0",
|
"@storybook/addon-knobs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-links": "5.2.0-beta.0",
|
"@storybook/addon-links": "5.2.0-beta.2",
|
||||||
"@storybook/addon-notes": "5.2.0-beta.0",
|
"@storybook/addon-notes": "5.2.0-beta.2",
|
||||||
"@storybook/addon-options": "5.2.0-beta.0",
|
"@storybook/addon-options": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storyshots": "5.2.0-beta.0",
|
"@storybook/addon-storyshots": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storysource": "5.2.0-beta.0",
|
"@storybook/addon-storysource": "5.2.0-beta.2",
|
||||||
"@storybook/addon-viewport": "5.2.0-beta.0",
|
"@storybook/addon-viewport": "5.2.0-beta.2",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/source-loader": "5.2.0-beta.0",
|
"@storybook/source-loader": "5.2.0-beta.2",
|
||||||
"@storybook/svelte": "5.2.0-beta.0"
|
"@storybook/svelte": "5.2.0-beta.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-example",
|
"name": "vue-example",
|
||||||
"version": "5.2.0-beta.0",
|
"version": "5.2.0-beta.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
|
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
|
||||||
@ -15,22 +15,22 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.3.4",
|
"@babel/core": "^7.3.4",
|
||||||
"@storybook/addon-a11y": "5.2.0-beta.0",
|
"@storybook/addon-a11y": "5.2.0-beta.2",
|
||||||
"@storybook/addon-actions": "5.2.0-beta.0",
|
"@storybook/addon-actions": "5.2.0-beta.2",
|
||||||
"@storybook/addon-backgrounds": "5.2.0-beta.0",
|
"@storybook/addon-backgrounds": "5.2.0-beta.2",
|
||||||
"@storybook/addon-centered": "5.2.0-beta.0",
|
"@storybook/addon-centered": "5.2.0-beta.2",
|
||||||
"@storybook/addon-contexts": "5.2.0-beta.0",
|
"@storybook/addon-contexts": "5.2.0-beta.2",
|
||||||
"@storybook/addon-docs": "5.2.0-beta.0",
|
"@storybook/addon-docs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-knobs": "5.2.0-beta.0",
|
"@storybook/addon-knobs": "5.2.0-beta.2",
|
||||||
"@storybook/addon-links": "5.2.0-beta.0",
|
"@storybook/addon-links": "5.2.0-beta.2",
|
||||||
"@storybook/addon-notes": "5.2.0-beta.0",
|
"@storybook/addon-notes": "5.2.0-beta.2",
|
||||||
"@storybook/addon-options": "5.2.0-beta.0",
|
"@storybook/addon-options": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storyshots": "5.2.0-beta.0",
|
"@storybook/addon-storyshots": "5.2.0-beta.2",
|
||||||
"@storybook/addon-storysource": "5.2.0-beta.0",
|
"@storybook/addon-storysource": "5.2.0-beta.2",
|
||||||
"@storybook/addon-viewport": "5.2.0-beta.0",
|
"@storybook/addon-viewport": "5.2.0-beta.2",
|
||||||
"@storybook/addons": "5.2.0-beta.0",
|
"@storybook/addons": "5.2.0-beta.2",
|
||||||
"@storybook/source-loader": "5.2.0-beta.0",
|
"@storybook/source-loader": "5.2.0-beta.2",
|
||||||
"@storybook/vue": "5.2.0-beta.0",
|
"@storybook/vue": "5.2.0-beta.2",
|
||||||
"babel-core": "^7.0.0-bridge.0",
|
"babel-core": "^7.0.0-bridge.0",
|
||||||
"babel-loader": "^8.0.5",
|
"babel-loader": "^8.0.5",
|
||||||
"cross-env": "^5.2.0",
|
"cross-env": "^5.2.0",
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"useWorkspaces": true,
|
"useWorkspaces": true,
|
||||||
"registry": "https://registry.npmjs.org",
|
"registry": "https://registry.npmjs.org",
|
||||||
"version": "5.2.0-beta.0"
|
"version": "5.2.0-beta.2"
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user