@storybook/cli 6.5.9 → 7.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/automigrate/fixes/angular12.js +3 -6
- package/dist/cjs/automigrate/fixes/cra5.js +13 -8
- package/dist/cjs/automigrate/fixes/index.js +3 -1
- package/dist/{modern/automigrate/fixes/cra5.js → cjs/automigrate/fixes/vue3.js} +14 -14
- package/dist/cjs/automigrate/fixes/webpack5.js +5 -8
- package/dist/cjs/automigrate/index.js +9 -3
- package/dist/cjs/babel-config.js +5 -6
- package/dist/cjs/build.js +38 -0
- package/dist/cjs/detect.js +4 -22
- package/dist/cjs/dev.js +70 -0
- package/dist/cjs/extract.js +0 -1
- package/dist/cjs/frameworks/angular/Button.stories.ts +5 -3
- package/dist/cjs/generate.js +72 -16
- package/dist/cjs/generators/ANGULAR/index.js +24 -1
- package/dist/cjs/generators/REACT_NATIVE/index.js +1 -1
- package/dist/cjs/generators/REACT_SCRIPTS/index.js +3 -2
- package/dist/cjs/generators/baseGenerator.js +94 -43
- package/dist/cjs/generators/configure.js +16 -18
- package/dist/{modern/automigrate → cjs/generators}/types.js +0 -0
- package/dist/cjs/helpers.js +10 -12
- package/dist/cjs/initiate.js +3 -13
- package/dist/cjs/js-package-manager/JsPackageManager.js +7 -5
- package/dist/cjs/project_types.js +5 -16
- package/dist/cjs/repro-generators/configs.js +55 -50
- package/dist/cjs/repro-generators/scripts.js +82 -8
- package/dist/cjs/repro.js +20 -18
- package/dist/cjs/utils.js +22 -0
- package/dist/cjs/versions.js +73 -57
- package/dist/esm/automigrate/fixes/angular12.js +3 -6
- package/dist/esm/automigrate/fixes/cra5.js +13 -8
- package/dist/esm/automigrate/fixes/index.js +3 -1
- package/dist/{modern/automigrate/fixes/angular12.js → esm/automigrate/fixes/vue3.js} +14 -14
- package/dist/esm/automigrate/fixes/webpack5.js +5 -8
- package/dist/esm/automigrate/index.js +9 -3
- package/dist/esm/babel-config.js +5 -6
- package/dist/esm/build.js +38 -0
- package/dist/esm/detect.js +4 -22
- package/dist/esm/dev.js +70 -0
- package/dist/esm/extract.js +0 -1
- package/dist/esm/frameworks/angular/Button.stories.ts +5 -3
- package/dist/esm/generate.js +72 -16
- package/dist/esm/generators/ANGULAR/index.js +24 -1
- package/dist/esm/generators/REACT_NATIVE/index.js +1 -1
- package/dist/esm/generators/REACT_SCRIPTS/index.js +3 -2
- package/dist/esm/generators/baseGenerator.js +94 -43
- package/dist/esm/generators/configure.js +16 -18
- package/dist/{modern/js-package-manager/PackageJson.js → esm/generators/types.js} +0 -0
- package/dist/esm/helpers.js +10 -12
- package/dist/esm/initiate.js +3 -13
- package/dist/esm/js-package-manager/JsPackageManager.js +7 -5
- package/dist/esm/project_types.js +5 -16
- package/dist/esm/repro-generators/configs.js +55 -50
- package/dist/esm/repro-generators/scripts.js +82 -8
- package/dist/esm/repro.js +20 -18
- package/dist/esm/utils.js +22 -0
- package/dist/esm/versions.js +73 -57
- package/dist/{ts3.9 → types}/NpmOptions.d.ts +0 -0
- package/dist/{ts3.9 → types}/add.d.ts +0 -0
- package/dist/{ts3.9 → types}/automigrate/fixes/angular12.d.ts +0 -0
- package/dist/{ts3.9 → types}/automigrate/fixes/builder-vite.d.ts +0 -0
- package/dist/{ts3.9 → types}/automigrate/fixes/cra5.d.ts +0 -0
- package/dist/{ts3.9 → types}/automigrate/fixes/eslint-plugin.d.ts +0 -0
- package/dist/{ts3.9 → types}/automigrate/fixes/index.d.ts +0 -0
- package/dist/{ts3.9 → types}/automigrate/fixes/mainjsFramework.d.ts +0 -0
- package/dist/{ts3.4/automigrate/fixes/cra5.d.ts → types/automigrate/fixes/vue3.d.ts} +15 -15
- package/dist/{ts3.9 → types}/automigrate/fixes/webpack5.d.ts +0 -0
- package/dist/{ts3.9 → types}/automigrate/helpers/getEslintInfo.d.ts +0 -0
- package/dist/{ts3.9 → types}/automigrate/index.d.ts +0 -0
- package/dist/{ts3.9 → types}/automigrate/types.d.ts +0 -0
- package/dist/{ts3.9 → types}/babel-config.d.ts +0 -0
- package/dist/types/build.d.ts +1 -0
- package/dist/{ts3.9 → types}/detect-nextjs.d.ts +0 -0
- package/dist/{ts3.9 → types}/detect-webpack.d.ts +0 -0
- package/dist/{ts3.9 → types}/detect.d.ts +4 -4
- package/dist/types/dev.d.ts +1 -0
- package/dist/{ts3.9 → types}/extract.d.ts +0 -0
- package/dist/{ts3.9 → types}/generate.d.ts +0 -0
- package/dist/{ts3.9 → types}/generators/ANGULAR/angular-helpers.d.ts +0 -0
- package/dist/{ts3.9 → types}/generators/ANGULAR/index.d.ts +1 -1
- package/dist/{ts3.9 → types}/generators/AURELIA/index.d.ts +1 -1
- package/dist/{ts3.9 → types}/generators/EMBER/index.d.ts +1 -1
- package/dist/{ts3.9 → types}/generators/HTML/index.d.ts +1 -1
- package/dist/types/generators/MARIONETTE/index.d.ts +3 -0
- package/dist/types/generators/MARKO/index.d.ts +3 -0
- package/dist/types/generators/MITHRIL/index.d.ts +3 -0
- package/dist/types/generators/PREACT/index.d.ts +3 -0
- package/dist/types/generators/RAX/index.d.ts +3 -0
- package/dist/types/generators/REACT/index.d.ts +3 -0
- package/dist/{ts3.9 → types}/generators/REACT_NATIVE/index.d.ts +0 -0
- package/dist/types/generators/REACT_SCRIPTS/index.d.ts +3 -0
- package/dist/types/generators/RIOT/index.d.ts +3 -0
- package/dist/types/generators/SERVER/index.d.ts +3 -0
- package/dist/types/generators/SFC_VUE/index.d.ts +3 -0
- package/dist/types/generators/SVELTE/index.d.ts +3 -0
- package/dist/types/generators/VUE/index.d.ts +3 -0
- package/dist/types/generators/VUE3/index.d.ts +3 -0
- package/dist/types/generators/WEB-COMPONENTS/index.d.ts +3 -0
- package/dist/types/generators/WEBPACK_REACT/index.d.ts +3 -0
- package/dist/types/generators/baseGenerator.d.ts +5 -0
- package/dist/{ts3.4 → types}/generators/configure.d.ts +19 -18
- package/dist/types/generators/types.d.ts +36 -0
- package/dist/{ts3.9 → types}/helpers.d.ts +2 -2
- package/dist/types/initiate.d.ts +3 -0
- package/dist/{ts3.9 → types}/js-package-manager/JsPackageManager.d.ts +1 -1
- package/dist/{ts3.9 → types}/js-package-manager/JsPackageManagerFactory.d.ts +0 -0
- package/dist/{ts3.9 → types}/js-package-manager/NPMProxy.d.ts +0 -0
- package/dist/{ts3.9 → types}/js-package-manager/PackageJson.d.ts +1 -0
- package/dist/{ts3.9 → types}/js-package-manager/PackageJsonHelper.d.ts +0 -0
- package/dist/{ts3.9 → types}/js-package-manager/Yarn1Proxy.d.ts +0 -0
- package/dist/{ts3.9 → types}/js-package-manager/Yarn2Proxy.d.ts +0 -0
- package/dist/{ts3.9 → types}/js-package-manager/index.d.ts +0 -0
- package/dist/{ts3.9 → types}/link.d.ts +0 -0
- package/dist/{ts3.9 → types}/migrate.d.ts +0 -0
- package/dist/{ts3.9 → types}/project_types.d.ts +2 -5
- package/dist/{ts3.9 → types}/repro-generators/configs.d.ts +7 -6
- package/dist/{ts3.4 → types}/repro-generators/scripts.d.ts +42 -36
- package/dist/{ts3.4 → types}/repro.d.ts +13 -12
- package/dist/{ts3.9 → types}/upgrade.d.ts +2 -2
- package/dist/types/utils.d.ts +2 -0
- package/dist/{ts3.4 → types}/versions.d.ts +76 -60
- package/dist/{ts3.9 → types}/warn.d.ts +0 -0
- package/package.json +10 -8
- package/dist/cjs/generators/METEOR/index.js +0 -45
- package/dist/cjs/generators/UPDATE_PACKAGE_ORGANIZATIONS/index.js +0 -78
- package/dist/esm/generators/METEOR/index.js +0 -45
- package/dist/esm/generators/UPDATE_PACKAGE_ORGANIZATIONS/index.js +0 -78
- package/dist/modern/NpmOptions.js +0 -1
- package/dist/modern/add.js +0 -151
- package/dist/modern/automigrate/fixes/builder-vite.js +0 -122
- package/dist/modern/automigrate/fixes/eslint-plugin.js +0 -129
- package/dist/modern/automigrate/fixes/index.js +0 -37
- package/dist/modern/automigrate/fixes/mainjsFramework.js +0 -95
- package/dist/modern/automigrate/fixes/webpack5.js +0 -156
- package/dist/modern/automigrate/helpers/getEslintInfo.js +0 -28
- package/dist/modern/automigrate/index.js +0 -94
- package/dist/modern/babel-config.js +0 -68
- package/dist/modern/detect-nextjs.js +0 -33
- package/dist/modern/detect-webpack.js +0 -39
- package/dist/modern/detect.js +0 -213
- package/dist/modern/extract.js +0 -96
- package/dist/modern/frameworks/common/Introduction.stories.mdx +0 -211
- package/dist/modern/frameworks/common/assets/code-brackets.svg +0 -1
- package/dist/modern/frameworks/common/assets/colors.svg +0 -1
- package/dist/modern/frameworks/common/assets/comments.svg +0 -1
- package/dist/modern/frameworks/common/assets/direction.svg +0 -1
- package/dist/modern/frameworks/common/assets/flow.svg +0 -1
- package/dist/modern/frameworks/common/assets/plugin.svg +0 -1
- package/dist/modern/frameworks/common/assets/repo.svg +0 -1
- package/dist/modern/frameworks/common/assets/stackalt.svg +0 -1
- package/dist/modern/frameworks/common/button.css +0 -30
- package/dist/modern/frameworks/common/header.css +0 -32
- package/dist/modern/frameworks/common/page.css +0 -69
- package/dist/modern/frameworks/ember/1-Button.stories.js +0 -57
- package/dist/modern/frameworks/html/js/Button.js +0 -21
- package/dist/modern/frameworks/html/js/Button.stories.js +0 -48
- package/dist/modern/frameworks/html/js/Header.js +0 -47
- package/dist/modern/frameworks/html/js/Header.stories.js +0 -27
- package/dist/modern/frameworks/html/js/Page.js +0 -94
- package/dist/modern/frameworks/html/js/Page.stories.js +0 -23
- package/dist/modern/frameworks/marionette/index.stories.js +0 -20
- package/dist/modern/frameworks/marko/1-Button.stories.js +0 -24
- package/dist/modern/frameworks/marko/Button.marko +0 -13
- package/dist/modern/frameworks/mithril/Button.js +0 -22
- package/dist/modern/frameworks/mithril/Button.stories.js +0 -43
- package/dist/modern/frameworks/mithril/Header.js +0 -51
- package/dist/modern/frameworks/mithril/Header.stories.js +0 -20
- package/dist/modern/frameworks/mithril/Page.js +0 -70
- package/dist/modern/frameworks/mithril/Page.stories.js +0 -24
- package/dist/modern/frameworks/preact/Button.jsx +0 -51
- package/dist/modern/frameworks/preact/Button.stories.jsx +0 -41
- package/dist/modern/frameworks/preact/Header.jsx +0 -58
- package/dist/modern/frameworks/preact/Header.stories.jsx +0 -29
- package/dist/modern/frameworks/preact/Page.jsx +0 -71
- package/dist/modern/frameworks/preact/Page.stories.jsx +0 -26
- package/dist/modern/frameworks/rax/Button.js +0 -26
- package/dist/modern/frameworks/rax/Button.stories.js +0 -40
- package/dist/modern/frameworks/rax/Header.js +0 -44
- package/dist/modern/frameworks/rax/Header.stories.js +0 -17
- package/dist/modern/frameworks/rax/Page.js +0 -64
- package/dist/modern/frameworks/rax/Page.stories.js +0 -21
- package/dist/modern/frameworks/react/js/Button.jsx +0 -50
- package/dist/modern/frameworks/react/js/Button.stories.jsx +0 -40
- package/dist/modern/frameworks/react/js/Header.jsx +0 -57
- package/dist/modern/frameworks/react/js/Header.stories.jsx +0 -24
- package/dist/modern/frameworks/react/js/Page.jsx +0 -69
- package/dist/modern/frameworks/react/js/Page.stories.jsx +0 -25
- package/dist/modern/frameworks/riot/1-Button.stories.js +0 -52
- package/dist/modern/frameworks/riot/MyButton.tag +0 -24
- package/dist/modern/frameworks/server/button.stories.json +0 -32
- package/dist/modern/frameworks/server/header.stories.json +0 -15
- package/dist/modern/frameworks/server/page.stories.json +0 -15
- package/dist/modern/frameworks/svelte/Button.stories.js +0 -51
- package/dist/modern/frameworks/svelte/Button.svelte +0 -42
- package/dist/modern/frameworks/svelte/Header.stories.js +0 -35
- package/dist/modern/frameworks/svelte/Header.svelte +0 -51
- package/dist/modern/frameworks/svelte/Page.stories.js +0 -27
- package/dist/modern/frameworks/svelte/Page.svelte +0 -63
- package/dist/modern/frameworks/vue/Button.stories.js +0 -46
- package/dist/modern/frameworks/vue/Button.vue +0 -54
- package/dist/modern/frameworks/vue/Header.stories.js +0 -27
- package/dist/modern/frameworks/vue/Header.vue +0 -60
- package/dist/modern/frameworks/vue/Page.stories.js +0 -27
- package/dist/modern/frameworks/vue/Page.vue +0 -88
- package/dist/modern/frameworks/vue3/Button.stories.js +0 -52
- package/dist/modern/frameworks/vue3/Button.vue +0 -52
- package/dist/modern/frameworks/vue3/Header.stories.js +0 -34
- package/dist/modern/frameworks/vue3/Header.vue +0 -50
- package/dist/modern/frameworks/vue3/Page.stories.js +0 -29
- package/dist/modern/frameworks/vue3/Page.vue +0 -88
- package/dist/modern/frameworks/web-components/js/Button.js +0 -21
- package/dist/modern/frameworks/web-components/js/Button.stories.js +0 -42
- package/dist/modern/frameworks/web-components/js/Header.js +0 -45
- package/dist/modern/frameworks/web-components/js/Header.stories.js +0 -15
- package/dist/modern/frameworks/web-components/js/Page.js +0 -61
- package/dist/modern/frameworks/web-components/js/Page.stories.js +0 -19
- package/dist/modern/generate.js +0 -145
- package/dist/modern/generators/ANGULAR/angular-helpers.js +0 -108
- package/dist/modern/generators/ANGULAR/index.js +0 -74
- package/dist/modern/generators/ANGULAR/template-csf/.storybook/tsconfig.json +0 -21
- package/dist/modern/generators/ANGULAR/template-csf/.storybook/typings.d.ts +0 -4
- package/dist/modern/generators/AURELIA/index.js +0 -43
- package/dist/modern/generators/AURELIA/template-csf/.storybook/tsconfig.json +0 -20
- package/dist/modern/generators/AURELIA/template-csf/.storybook/typings.d.ts +0 -4
- package/dist/modern/generators/EMBER/index.js +0 -22
- package/dist/modern/generators/HTML/index.js +0 -17
- package/dist/modern/generators/MARIONETTE/index.js +0 -17
- package/dist/modern/generators/MARKO/index.js +0 -17
- package/dist/modern/generators/METEOR/index.js +0 -45
- package/dist/modern/generators/MITHRIL/index.js +0 -17
- package/dist/modern/generators/PREACT/index.js +0 -19
- package/dist/modern/generators/RAX/index.js +0 -32
- package/dist/modern/generators/REACT/index.js +0 -17
- package/dist/modern/generators/REACT_NATIVE/index.js +0 -57
- package/dist/modern/generators/REACT_NATIVE/template-csf/storybook/addons.js +0 -3
- package/dist/modern/generators/REACT_NATIVE/template-csf/storybook/index.js +0 -25
- package/dist/modern/generators/REACT_NATIVE/template-csf/storybook/rn-addons.js +0 -2
- package/dist/modern/generators/REACT_NATIVE/template-csf/storybook/stories/Button/Button.stories.js +0 -20
- package/dist/modern/generators/REACT_NATIVE/template-csf/storybook/stories/Button/index.js +0 -17
- package/dist/modern/generators/REACT_NATIVE/template-csf/storybook/stories/CenterView/index.js +0 -16
- package/dist/modern/generators/REACT_NATIVE/template-csf/storybook/stories/CenterView/style.js +0 -8
- package/dist/modern/generators/REACT_NATIVE/template-csf/storybook/stories/Welcome/Welcome.stories.js +0 -6
- package/dist/modern/generators/REACT_NATIVE/template-csf/storybook/stories/Welcome/index.js +0 -57
- package/dist/modern/generators/REACT_NATIVE/template-csf/storybook/stories/index.js +0 -2
- package/dist/modern/generators/REACT_SCRIPTS/index.js +0 -69
- package/dist/modern/generators/RIOT/index.js +0 -19
- package/dist/modern/generators/SERVER/index.js +0 -22
- package/dist/modern/generators/SERVER/template-csf/.storybook/preview.js +0 -5
- package/dist/modern/generators/SFC_VUE/index.js +0 -17
- package/dist/modern/generators/SVELTE/index.js +0 -63
- package/dist/modern/generators/UPDATE_PACKAGE_ORGANIZATIONS/index.js +0 -78
- package/dist/modern/generators/VUE/index.js +0 -19
- package/dist/modern/generators/VUE3/index.js +0 -19
- package/dist/modern/generators/WEB-COMPONENTS/index.js +0 -19
- package/dist/modern/generators/WEBPACK_REACT/index.js +0 -17
- package/dist/modern/generators/baseGenerator.js +0 -153
- package/dist/modern/generators/configure.js +0 -87
- package/dist/modern/helpers.js +0 -239
- package/dist/modern/initiate.js +0 -302
- package/dist/modern/js-package-manager/JsPackageManager.js +0 -273
- package/dist/modern/js-package-manager/JsPackageManagerFactory.js +0 -57
- package/dist/modern/js-package-manager/NPMProxy.js +0 -76
- package/dist/modern/js-package-manager/PackageJsonHelper.js +0 -33
- package/dist/modern/js-package-manager/Yarn1Proxy.js +0 -61
- package/dist/modern/js-package-manager/Yarn2Proxy.js +0 -57
- package/dist/modern/js-package-manager/index.js +0 -57
- package/dist/modern/link.js +0 -98
- package/dist/modern/migrate.js +0 -35
- package/dist/modern/project_types.js +0 -274
- package/dist/modern/repro-generators/configs.js +0 -196
- package/dist/modern/repro-generators/scripts.js +0 -243
- package/dist/modern/repro.js +0 -194
- package/dist/modern/typings.d.ts +0 -3
- package/dist/modern/upgrade.js +0 -174
- package/dist/modern/versions.js +0 -67
- package/dist/modern/warn.js +0 -32
- package/dist/modern/window.d.js +0 -5
- package/dist/ts3.4/NpmOptions.d.ts +0 -4
- package/dist/ts3.4/add.d.ts +0 -10
- package/dist/ts3.4/automigrate/fixes/angular12.d.ts +0 -15
- package/dist/ts3.4/automigrate/fixes/builder-vite.d.ts +0 -19
- package/dist/ts3.4/automigrate/fixes/eslint-plugin.d.ts +0 -15
- package/dist/ts3.4/automigrate/fixes/index.d.ts +0 -3
- package/dist/ts3.4/automigrate/fixes/mainjsFramework.d.ts +0 -8
- package/dist/ts3.4/automigrate/fixes/webpack5.d.ts +0 -26
- package/dist/ts3.4/automigrate/helpers/getEslintInfo.d.ts +0 -2
- package/dist/ts3.4/automigrate/index.d.ts +0 -7
- package/dist/ts3.4/automigrate/types.d.ts +0 -15
- package/dist/ts3.4/babel-config.d.ts +0 -4
- package/dist/ts3.4/detect-nextjs.d.ts +0 -2
- package/dist/ts3.4/detect-webpack.d.ts +0 -2
- package/dist/ts3.4/detect.d.ts +0 -16
- package/dist/ts3.4/extract.d.ts +0 -1
- package/dist/ts3.4/generate.d.ts +0 -1
- package/dist/ts3.4/generators/ANGULAR/angular-helpers.d.ts +0 -6
- package/dist/ts3.4/generators/ANGULAR/index.d.ts +0 -3
- package/dist/ts3.4/generators/AURELIA/index.d.ts +0 -3
- package/dist/ts3.4/generators/EMBER/index.d.ts +0 -3
- package/dist/ts3.4/generators/HTML/index.d.ts +0 -3
- package/dist/ts3.4/generators/MARIONETTE/index.d.ts +0 -3
- package/dist/ts3.4/generators/MARKO/index.d.ts +0 -3
- package/dist/ts3.4/generators/METEOR/index.d.ts +0 -3
- package/dist/ts3.4/generators/MITHRIL/index.d.ts +0 -3
- package/dist/ts3.4/generators/PREACT/index.d.ts +0 -3
- package/dist/ts3.4/generators/RAX/index.d.ts +0 -3
- package/dist/ts3.4/generators/REACT/index.d.ts +0 -3
- package/dist/ts3.4/generators/REACT_NATIVE/index.d.ts +0 -4
- package/dist/ts3.4/generators/REACT_SCRIPTS/index.d.ts +0 -3
- package/dist/ts3.4/generators/RIOT/index.d.ts +0 -3
- package/dist/ts3.4/generators/SERVER/index.d.ts +0 -3
- package/dist/ts3.4/generators/SFC_VUE/index.d.ts +0 -3
- package/dist/ts3.4/generators/SVELTE/index.d.ts +0 -3
- package/dist/ts3.4/generators/UPDATE_PACKAGE_ORGANIZATIONS/index.d.ts +0 -4
- package/dist/ts3.4/generators/VUE/index.d.ts +0 -3
- package/dist/ts3.4/generators/VUE3/index.d.ts +0 -3
- package/dist/ts3.4/generators/WEB-COMPONENTS/index.d.ts +0 -3
- package/dist/ts3.4/generators/WEBPACK_REACT/index.d.ts +0 -3
- package/dist/ts3.4/generators/baseGenerator.d.ts +0 -22
- package/dist/ts3.4/helpers.d.ts +0 -25
- package/dist/ts3.4/initiate.d.ts +0 -17
- package/dist/ts3.4/js-package-manager/JsPackageManager.d.ts +0 -92
- package/dist/ts3.4/js-package-manager/JsPackageManagerFactory.d.ts +0 -4
- package/dist/ts3.4/js-package-manager/NPMProxy.d.ts +0 -12
- package/dist/ts3.4/js-package-manager/PackageJson.d.ts +0 -3
- package/dist/ts3.4/js-package-manager/PackageJsonHelper.d.ts +0 -3
- package/dist/ts3.4/js-package-manager/Yarn1Proxy.d.ts +0 -10
- package/dist/ts3.4/js-package-manager/Yarn2Proxy.d.ts +0 -10
- package/dist/ts3.4/js-package-manager/index.d.ts +0 -4
- package/dist/ts3.4/link.d.ts +0 -6
- package/dist/ts3.4/migrate.d.ts +0 -1
- package/dist/ts3.4/project_types.d.ts +0 -67
- package/dist/ts3.4/repro-generators/configs.d.ts +0 -43
- package/dist/ts3.4/upgrade.d.ts +0 -19
- package/dist/ts3.4/warn.d.ts +0 -5
- package/dist/ts3.9/generators/MARIONETTE/index.d.ts +0 -3
- package/dist/ts3.9/generators/MARKO/index.d.ts +0 -3
- package/dist/ts3.9/generators/METEOR/index.d.ts +0 -3
- package/dist/ts3.9/generators/MITHRIL/index.d.ts +0 -3
- package/dist/ts3.9/generators/PREACT/index.d.ts +0 -3
- package/dist/ts3.9/generators/RAX/index.d.ts +0 -3
- package/dist/ts3.9/generators/REACT/index.d.ts +0 -3
- package/dist/ts3.9/generators/REACT_SCRIPTS/index.d.ts +0 -3
- package/dist/ts3.9/generators/RIOT/index.d.ts +0 -3
- package/dist/ts3.9/generators/SERVER/index.d.ts +0 -3
- package/dist/ts3.9/generators/SFC_VUE/index.d.ts +0 -3
- package/dist/ts3.9/generators/SVELTE/index.d.ts +0 -3
- package/dist/ts3.9/generators/UPDATE_PACKAGE_ORGANIZATIONS/index.d.ts +0 -4
- package/dist/ts3.9/generators/VUE/index.d.ts +0 -3
- package/dist/ts3.9/generators/VUE3/index.d.ts +0 -3
- package/dist/ts3.9/generators/WEB-COMPONENTS/index.d.ts +0 -3
- package/dist/ts3.9/generators/WEBPACK_REACT/index.d.ts +0 -3
- package/dist/ts3.9/generators/baseGenerator.d.ts +0 -22
- package/dist/ts3.9/generators/configure.d.ts +0 -18
- package/dist/ts3.9/initiate.d.ts +0 -17
- package/dist/ts3.9/repro-generators/scripts.d.ts +0 -36
- package/dist/ts3.9/repro.d.ts +0 -12
- package/dist/ts3.9/versions.d.ts +0 -60
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Button } from './Button';
|
|
4
|
-
|
|
5
|
-
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Example/Button',
|
|
8
|
-
component: Button,
|
|
9
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
10
|
-
argTypes: {
|
|
11
|
-
backgroundColor: { control: 'color' },
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
|
|
16
|
-
const Template = (args) => <Button {...args} />;
|
|
17
|
-
|
|
18
|
-
export const Primary = Template.bind({});
|
|
19
|
-
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
|
20
|
-
Primary.args = {
|
|
21
|
-
primary: true,
|
|
22
|
-
label: 'Button',
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const Secondary = Template.bind({});
|
|
26
|
-
Secondary.args = {
|
|
27
|
-
label: 'Button',
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const Large = Template.bind({});
|
|
31
|
-
Large.args = {
|
|
32
|
-
size: 'large',
|
|
33
|
-
label: 'Button',
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const Small = Template.bind({});
|
|
37
|
-
Small.args = {
|
|
38
|
-
size: 'small',
|
|
39
|
-
label: 'Button',
|
|
40
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
import { Button } from './Button';
|
|
5
|
-
import './header.css';
|
|
6
|
-
|
|
7
|
-
export const Header = ({ user, onLogin, onLogout, onCreateAccount }) => (
|
|
8
|
-
<header>
|
|
9
|
-
<div className="wrapper">
|
|
10
|
-
<div>
|
|
11
|
-
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
12
|
-
<g fill="none" fillRule="evenodd">
|
|
13
|
-
<path
|
|
14
|
-
d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
|
|
15
|
-
fill="#FFF"
|
|
16
|
-
/>
|
|
17
|
-
<path
|
|
18
|
-
d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
|
|
19
|
-
fill="#555AB9"
|
|
20
|
-
/>
|
|
21
|
-
<path
|
|
22
|
-
d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z"
|
|
23
|
-
fill="#91BAF8"
|
|
24
|
-
/>
|
|
25
|
-
</g>
|
|
26
|
-
</svg>
|
|
27
|
-
<h1>Acme</h1>
|
|
28
|
-
</div>
|
|
29
|
-
<div>
|
|
30
|
-
{user ? (
|
|
31
|
-
<>
|
|
32
|
-
<span className="welcome">
|
|
33
|
-
Welcome, <b>{user.name}</b>!
|
|
34
|
-
</span>
|
|
35
|
-
<Button size="small" onClick={onLogout} label="Log out" />
|
|
36
|
-
</>
|
|
37
|
-
) : (
|
|
38
|
-
<>
|
|
39
|
-
<Button size="small" onClick={onLogin} label="Log in" />
|
|
40
|
-
<Button primary size="small" onClick={onCreateAccount} label="Sign up" />
|
|
41
|
-
</>
|
|
42
|
-
)}
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</header>
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
Header.propTypes = {
|
|
49
|
-
user: PropTypes.shape({}),
|
|
50
|
-
onLogin: PropTypes.func.isRequired,
|
|
51
|
-
onLogout: PropTypes.func.isRequired,
|
|
52
|
-
onCreateAccount: PropTypes.func.isRequired,
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
Header.defaultProps = {
|
|
56
|
-
user: null,
|
|
57
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Header } from './Header';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Example/Header',
|
|
7
|
-
component: Header,
|
|
8
|
-
parameters: {
|
|
9
|
-
// More on Story layout: https://storybook.js.org/docs/react/configure/story-layout
|
|
10
|
-
layout: 'fullscreen',
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const Template = (args) => <Header {...args} />;
|
|
15
|
-
|
|
16
|
-
export const LoggedIn = Template.bind({});
|
|
17
|
-
LoggedIn.args = {
|
|
18
|
-
user: {
|
|
19
|
-
name: 'Jane Doe',
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const LoggedOut = Template.bind({});
|
|
24
|
-
LoggedOut.args = {};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Header } from './Header';
|
|
4
|
-
import './page.css';
|
|
5
|
-
|
|
6
|
-
export const Page = () => {
|
|
7
|
-
const [user, setUser] = React.useState();
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<article>
|
|
11
|
-
<Header
|
|
12
|
-
user={user}
|
|
13
|
-
onLogin={() => setUser({ name: 'Jane Doe' })}
|
|
14
|
-
onLogout={() => setUser(undefined)}
|
|
15
|
-
onCreateAccount={() => setUser({ name: 'Jane Doe' })}
|
|
16
|
-
/>
|
|
17
|
-
|
|
18
|
-
<section>
|
|
19
|
-
<h2>Pages in Storybook</h2>
|
|
20
|
-
<p>
|
|
21
|
-
We recommend building UIs with a{' '}
|
|
22
|
-
<a href="https://componentdriven.org" target="_blank" rel="noopener noreferrer">
|
|
23
|
-
<strong>component-driven</strong>
|
|
24
|
-
</a>{' '}
|
|
25
|
-
process starting with atomic components and ending with pages.
|
|
26
|
-
</p>
|
|
27
|
-
<p>
|
|
28
|
-
Render pages with mock data. This makes it easy to build and review page states without
|
|
29
|
-
needing to navigate to them in your app. Here are some handy patterns for managing page
|
|
30
|
-
data in Storybook:
|
|
31
|
-
</p>
|
|
32
|
-
<ul>
|
|
33
|
-
<li>
|
|
34
|
-
Use a higher-level connected component. Storybook helps you compose such data from the
|
|
35
|
-
"args" of child component stories
|
|
36
|
-
</li>
|
|
37
|
-
<li>
|
|
38
|
-
Assemble data in the page component from your services. You can mock these services out
|
|
39
|
-
using Storybook.
|
|
40
|
-
</li>
|
|
41
|
-
</ul>
|
|
42
|
-
<p>
|
|
43
|
-
Get a guided tutorial on component-driven development at{' '}
|
|
44
|
-
<a href="https://storybook.js.org/tutorials/" target="_blank" rel="noopener noreferrer">
|
|
45
|
-
Storybook tutorials
|
|
46
|
-
</a>
|
|
47
|
-
. Read more in the{' '}
|
|
48
|
-
<a href="https://storybook.js.org/docs" target="_blank" rel="noopener noreferrer">
|
|
49
|
-
docs
|
|
50
|
-
</a>
|
|
51
|
-
.
|
|
52
|
-
</p>
|
|
53
|
-
<div className="tip-wrapper">
|
|
54
|
-
<span className="tip">Tip</span> Adjust the width of the canvas with the{' '}
|
|
55
|
-
<svg width="10" height="10" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
|
|
56
|
-
<g fill="none" fillRule="evenodd">
|
|
57
|
-
<path
|
|
58
|
-
d="M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z"
|
|
59
|
-
id="a"
|
|
60
|
-
fill="#999"
|
|
61
|
-
/>
|
|
62
|
-
</g>
|
|
63
|
-
</svg>
|
|
64
|
-
Viewports addon in the toolbar
|
|
65
|
-
</div>
|
|
66
|
-
</section>
|
|
67
|
-
</article>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { within, userEvent } from '@storybook/testing-library';
|
|
3
|
-
|
|
4
|
-
import { Page } from './Page';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Example/Page',
|
|
8
|
-
component: Page,
|
|
9
|
-
parameters: {
|
|
10
|
-
// More on Story layout: https://storybook.js.org/docs/react/configure/story-layout
|
|
11
|
-
layout: 'fullscreen',
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const Template = (args) => <Page {...args} />;
|
|
16
|
-
|
|
17
|
-
// More on interaction testing: https://storybook.js.org/docs/react/writing-tests/interaction-testing
|
|
18
|
-
export const LoggedOut = Template.bind({});
|
|
19
|
-
|
|
20
|
-
export const LoggedIn = Template.bind({});
|
|
21
|
-
LoggedIn.play = async ({ canvasElement }) => {
|
|
22
|
-
const canvas = within(canvasElement);
|
|
23
|
-
const loginButton = await canvas.getByRole('button', { name: /Log in/i });
|
|
24
|
-
await userEvent.click(loginButton);
|
|
25
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { mount } from '@storybook/riot';
|
|
2
|
-
import { linkTo } from '@storybook/addon-links';
|
|
3
|
-
import { action } from '@storybook/addon-actions';
|
|
4
|
-
|
|
5
|
-
// eslint-disable-next-line
|
|
6
|
-
import MyButtonRaw from 'raw-loader!./MyButton.tag';
|
|
7
|
-
import './MyButton.tag';
|
|
8
|
-
|
|
9
|
-
// More on default export: https://storybook.js.org/docs/riot/writing-stories/introduction#default-export
|
|
10
|
-
export default {
|
|
11
|
-
title: 'Button',
|
|
12
|
-
// More on argTypes: https://storybook.js.org/docs/riot/api/argtypes
|
|
13
|
-
argTypes: {
|
|
14
|
-
content: { control: 'text' },
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// More on component templates: https://storybook.js.org/docs/riot/writing-stories/introduction#using-args
|
|
19
|
-
const Template = (args) => mount('my-button', args);
|
|
20
|
-
|
|
21
|
-
export const Text = Template.bind({});
|
|
22
|
-
// More on args: https://storybook.js.org/docs/riot/writing-stories/args
|
|
23
|
-
Text.args = {
|
|
24
|
-
content: 'Button',
|
|
25
|
-
onClick: action('onClick'),
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const Emoji = Template.bind({});
|
|
29
|
-
Emoji.args = {
|
|
30
|
-
content: '😀 😎 👍 💯',
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const WithScenario = () => ({
|
|
34
|
-
tags: [{ content: MyButtonRaw, boundAs: 'MyButton' }],
|
|
35
|
-
template: '<MyButton>With scenario</MyButton>',
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export const TextWithAction = () =>
|
|
39
|
-
mount('my-button', {
|
|
40
|
-
content: 'Trigger Action',
|
|
41
|
-
onClick: () => action('This was clicked')(),
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
TextWithAction.storyName = 'With an action';
|
|
45
|
-
|
|
46
|
-
export const ButtonWithLinkToAnotherStory = () =>
|
|
47
|
-
mount('my-button', {
|
|
48
|
-
content: 'Go to Welcome Story',
|
|
49
|
-
onClick: linkTo('example-introduction--page'),
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
ButtonWithLinkToAnotherStory.storyName = 'button with link to another story';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<my-button>
|
|
2
|
-
<button class="buttonStyles" onclick={ onClick }>
|
|
3
|
-
{opts.content}
|
|
4
|
-
<yield/>
|
|
5
|
-
</button>
|
|
6
|
-
|
|
7
|
-
<style>
|
|
8
|
-
.buttonStyles {
|
|
9
|
-
border: solid 1px #eee;
|
|
10
|
-
border-radius: 3px;
|
|
11
|
-
background-color: #FFFFFF;
|
|
12
|
-
cursor: pointer;
|
|
13
|
-
font-size: 15px;
|
|
14
|
-
padding: 3px 10px;
|
|
15
|
-
margin: 10px;
|
|
16
|
-
}
|
|
17
|
-
</style>
|
|
18
|
-
|
|
19
|
-
<script>
|
|
20
|
-
this.onClick = this.opts.onClick || function(e){
|
|
21
|
-
console.log('clicked', e)
|
|
22
|
-
}
|
|
23
|
-
</script>
|
|
24
|
-
</my-button>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "Example/Button",
|
|
3
|
-
"parameters": {
|
|
4
|
-
"server": { "id": "button" }
|
|
5
|
-
},
|
|
6
|
-
"args": { "label": "Button" },
|
|
7
|
-
"argTypes": {
|
|
8
|
-
"label": { "control": "text" },
|
|
9
|
-
"primary": { "control": "boolean" },
|
|
10
|
-
"backgroundColor": { "control": "color" },
|
|
11
|
-
"size": {
|
|
12
|
-
"control": { "type": "select", "options": ["small", "medium", "large"] }
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"stories": [
|
|
16
|
-
{
|
|
17
|
-
"name": "Primary",
|
|
18
|
-
"args": { "primary": true }
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"name": "Secondary"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"name": "Large",
|
|
25
|
-
"args": { "size": "large" }
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"name": "Small",
|
|
29
|
-
"args": { "size": "small" }
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import Button from './Button.svelte';
|
|
2
|
-
|
|
3
|
-
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
4
|
-
// More on argTypes: https://storybook.js.org/docs/svelte/api/argtypes
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Example/Button',
|
|
7
|
-
component: Button,
|
|
8
|
-
argTypes: {
|
|
9
|
-
backgroundColor: { control: 'color' },
|
|
10
|
-
label: { control: 'text' },
|
|
11
|
-
onClick: { action: 'onClick' },
|
|
12
|
-
primary: { control: 'boolean' },
|
|
13
|
-
size: {
|
|
14
|
-
control: { type: 'select' },
|
|
15
|
-
options: ['small', 'medium', 'large'],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// More on component templates: https://storybook.js.org/docs/svelte/writing-stories/introduction#using-args
|
|
21
|
-
const Template = (args) => ({
|
|
22
|
-
Component: Button,
|
|
23
|
-
props: args,
|
|
24
|
-
on: {
|
|
25
|
-
click: args.onClick,
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
// More on args: https://storybook.js.org/docs/svelte/writing-stories/args
|
|
30
|
-
export const Primary = Template.bind({});
|
|
31
|
-
Primary.args = {
|
|
32
|
-
primary: true,
|
|
33
|
-
label: 'Button',
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const Secondary = Template.bind({});
|
|
37
|
-
Secondary.args = {
|
|
38
|
-
label: 'Button',
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const Large = Template.bind({});
|
|
42
|
-
Large.args = {
|
|
43
|
-
size: 'large',
|
|
44
|
-
label: 'Button',
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const Small = Template.bind({});
|
|
48
|
-
Small.args = {
|
|
49
|
-
size: 'small',
|
|
50
|
-
label: 'Button',
|
|
51
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import './button.css';
|
|
3
|
-
import { createEventDispatcher } from 'svelte';
|
|
4
|
-
/**
|
|
5
|
-
* Is this the principal call to action on the page?
|
|
6
|
-
*/
|
|
7
|
-
export let primary = false;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* What background color to use
|
|
11
|
-
*/
|
|
12
|
-
export let backgroundColor;
|
|
13
|
-
/**
|
|
14
|
-
* How large should the button be?
|
|
15
|
-
*/
|
|
16
|
-
export let size = 'medium';
|
|
17
|
-
/**
|
|
18
|
-
* Button contents
|
|
19
|
-
*/
|
|
20
|
-
export let label = '';
|
|
21
|
-
|
|
22
|
-
let mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
23
|
-
|
|
24
|
-
let style = backgroundColor ? `background-color: ${backgroundColor}` : '';
|
|
25
|
-
|
|
26
|
-
const dispatch = createEventDispatcher();
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Optional click handler
|
|
30
|
-
*/
|
|
31
|
-
function onClick(event) {
|
|
32
|
-
dispatch('click', event);
|
|
33
|
-
}
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<button
|
|
37
|
-
type="button"
|
|
38
|
-
class={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
|
|
39
|
-
{style}
|
|
40
|
-
on:click={onClick}>
|
|
41
|
-
{label}
|
|
42
|
-
</button>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import Header from './Header.svelte';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Example/Header',
|
|
5
|
-
component: Header,
|
|
6
|
-
parameters: {
|
|
7
|
-
// More on Story layout: https://storybook.js.org/docs/svelte/configure/story-layout
|
|
8
|
-
layout: 'fullscreen',
|
|
9
|
-
},
|
|
10
|
-
argTypes: {
|
|
11
|
-
onLogin: { action: 'onLogin' },
|
|
12
|
-
onLogout: { action: 'onLogout' },
|
|
13
|
-
onCreateAccount: { action: 'onCreateAccount' },
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const Template = (args) => ({
|
|
18
|
-
Component: Header,
|
|
19
|
-
props: args,
|
|
20
|
-
on: {
|
|
21
|
-
login: args.onLogin,
|
|
22
|
-
logout: args.onLogout,
|
|
23
|
-
createAccount: args.onCreateAccount,
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export const LoggedIn = Template.bind({});
|
|
28
|
-
LoggedIn.args = {
|
|
29
|
-
user: {
|
|
30
|
-
name: 'Jane Doe',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const LoggedOut = Template.bind({});
|
|
35
|
-
LoggedOut.args = {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import './header.css';
|
|
3
|
-
import Button from './Button.svelte';
|
|
4
|
-
|
|
5
|
-
import { createEventDispatcher } from 'svelte';
|
|
6
|
-
|
|
7
|
-
export let user = null;
|
|
8
|
-
|
|
9
|
-
const dispatch = createEventDispatcher();
|
|
10
|
-
|
|
11
|
-
function onLogin(event) {
|
|
12
|
-
dispatch('login', event);
|
|
13
|
-
}
|
|
14
|
-
function onLogout(event) {
|
|
15
|
-
dispatch('logout', event);
|
|
16
|
-
}
|
|
17
|
-
function onCreateAccount(event) {
|
|
18
|
-
dispatch('createAccount', event);
|
|
19
|
-
}
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<header>
|
|
23
|
-
<div class="wrapper">
|
|
24
|
-
<div>
|
|
25
|
-
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
26
|
-
<g fill="none" fill-rule="evenodd">
|
|
27
|
-
<path
|
|
28
|
-
d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
|
|
29
|
-
fill="#FFF" />
|
|
30
|
-
<path
|
|
31
|
-
d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
|
|
32
|
-
fill="#555AB9" />
|
|
33
|
-
<path d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z" fill="#91BAF8" />
|
|
34
|
-
</g>
|
|
35
|
-
</svg>
|
|
36
|
-
<h1>Acme</h1>
|
|
37
|
-
</div>
|
|
38
|
-
<div>
|
|
39
|
-
{#if user}
|
|
40
|
-
<span class="welcome">
|
|
41
|
-
Welcome, <b>{user.name}</b>!
|
|
42
|
-
</span>
|
|
43
|
-
<Button size="small" on:click={onLogout} label="Log out" />
|
|
44
|
-
{/if}
|
|
45
|
-
{#if !user}
|
|
46
|
-
<Button size="small" on:click={onLogin} label="Log in" />
|
|
47
|
-
<Button primary size="small" on:click={onCreateAccount} label="Sign up" />
|
|
48
|
-
{/if}
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</header>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { within, userEvent } from '@storybook/testing-library';
|
|
2
|
-
import Page from './Page.svelte';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Example/Page',
|
|
6
|
-
component: Page,
|
|
7
|
-
parameters: {
|
|
8
|
-
// More on Story layout: https://storybook.js.org/docs/svelte/configure/story-layout
|
|
9
|
-
layout: 'fullscreen',
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const Template = (args) => ({
|
|
14
|
-
Component: Page,
|
|
15
|
-
props: args,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export const LoggedOut = Template.bind({});
|
|
19
|
-
LoggedOut.args = {};
|
|
20
|
-
|
|
21
|
-
// More on interaction testing: https://storybook.js.org/docs/svelte/writing-tests/interaction-testing
|
|
22
|
-
export const LoggedIn = Template.bind({});
|
|
23
|
-
LoggedIn.play = async ({ canvasElement }) => {
|
|
24
|
-
const canvas = within(canvasElement);
|
|
25
|
-
const loginButton = await canvas.getByRole('button', { name: /Log in/i });
|
|
26
|
-
await userEvent.click(loginButton);
|
|
27
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import './page.css';
|
|
3
|
-
import Header from './Header.svelte';
|
|
4
|
-
|
|
5
|
-
let user = null;
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<article>
|
|
9
|
-
<Header {user} on:login={() => user = { name: 'Jane Doe' }} on:logout={() => user = null} on:createAccount={() => user = { name: 'Jane Doe' }} />
|
|
10
|
-
|
|
11
|
-
<section>
|
|
12
|
-
<h2>Pages in Storybook</h2>
|
|
13
|
-
<p>
|
|
14
|
-
We recommend building UIs with a
|
|
15
|
-
<a
|
|
16
|
-
href="https://blog.hichroma.com/component-driven-development-ce1109d56c8e"
|
|
17
|
-
target="_blank"
|
|
18
|
-
rel="noopener noreferrer">
|
|
19
|
-
<strong>component-driven</strong>
|
|
20
|
-
</a>
|
|
21
|
-
process starting with atomic components and ending with pages.
|
|
22
|
-
</p>
|
|
23
|
-
<p>
|
|
24
|
-
Render pages with mock data. This makes it easy to build and review page states without
|
|
25
|
-
needing to navigate to them in your app. Here are some handy patterns for managing page data
|
|
26
|
-
in Storybook:
|
|
27
|
-
</p>
|
|
28
|
-
<ul>
|
|
29
|
-
<li>
|
|
30
|
-
Use a higher-level connected component. Storybook helps you compose such data from the
|
|
31
|
-
"args" of child component stories
|
|
32
|
-
</li>
|
|
33
|
-
<li>
|
|
34
|
-
Assemble data in the page component from your services. You can mock these services out
|
|
35
|
-
using Storybook.
|
|
36
|
-
</li>
|
|
37
|
-
</ul>
|
|
38
|
-
<p>
|
|
39
|
-
Get a guided tutorial on component-driven development at
|
|
40
|
-
<a href="https://storybook.js.org/tutorials/" target="_blank" rel="noopener noreferrer">
|
|
41
|
-
Storybook tutorials
|
|
42
|
-
</a>
|
|
43
|
-
. Read more in the
|
|
44
|
-
<a href="https://storybook.js.org/docs" target="_blank" rel="noopener noreferrer">docs</a>
|
|
45
|
-
.
|
|
46
|
-
</p>
|
|
47
|
-
<div class="tip-wrapper">
|
|
48
|
-
<span class="tip">Tip</span>
|
|
49
|
-
Adjust the width of the canvas with the
|
|
50
|
-
<svg width="10" height="10" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
|
|
51
|
-
<g fill="none" fill-rule="evenodd">
|
|
52
|
-
<path
|
|
53
|
-
d="M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0
|
|
54
|
-
01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0
|
|
55
|
-
010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z"
|
|
56
|
-
id="a"
|
|
57
|
-
fill="#999" />
|
|
58
|
-
</g>
|
|
59
|
-
</svg>
|
|
60
|
-
Viewports addon in the toolbar
|
|
61
|
-
</div>
|
|
62
|
-
</section>
|
|
63
|
-
</article>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import MyButton from './Button.vue';
|
|
2
|
-
|
|
3
|
-
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Example/Button',
|
|
6
|
-
component: MyButton,
|
|
7
|
-
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
|
8
|
-
argTypes: {
|
|
9
|
-
backgroundColor: { control: 'color' },
|
|
10
|
-
size: {
|
|
11
|
-
control: { type: 'select' },
|
|
12
|
-
options: ['small', 'medium', 'large'],
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
|
18
|
-
const Template = (args, { argTypes }) => ({
|
|
19
|
-
props: Object.keys(argTypes),
|
|
20
|
-
components: { MyButton },
|
|
21
|
-
template: '<my-button @onClick="onClick" v-bind="$props" />',
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
export const Primary = Template.bind({});
|
|
25
|
-
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
|
26
|
-
Primary.args = {
|
|
27
|
-
primary: true,
|
|
28
|
-
label: 'Button',
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const Secondary = Template.bind({});
|
|
32
|
-
Secondary.args = {
|
|
33
|
-
label: 'Button',
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const Large = Template.bind({});
|
|
37
|
-
Large.args = {
|
|
38
|
-
size: 'large',
|
|
39
|
-
label: 'Button',
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const Small = Template.bind({});
|
|
43
|
-
Small.args = {
|
|
44
|
-
size: 'small',
|
|
45
|
-
label: 'Button',
|
|
46
|
-
};
|