@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,54 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<button type="button" :class="classes" @click="onClick" :style="style">{{ label }}</button>
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script>
|
|
6
|
-
import './button.css';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
name: 'my-button',
|
|
10
|
-
|
|
11
|
-
props: {
|
|
12
|
-
label: {
|
|
13
|
-
type: String,
|
|
14
|
-
required: true,
|
|
15
|
-
},
|
|
16
|
-
primary: {
|
|
17
|
-
type: Boolean,
|
|
18
|
-
default: false,
|
|
19
|
-
},
|
|
20
|
-
size: {
|
|
21
|
-
type: String,
|
|
22
|
-
default: 'medium',
|
|
23
|
-
validator: function (value) {
|
|
24
|
-
return ['small', 'medium', 'large'].indexOf(value) !== -1;
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
backgroundColor: {
|
|
28
|
-
type: String,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
computed: {
|
|
33
|
-
classes() {
|
|
34
|
-
return {
|
|
35
|
-
'storybook-button': true,
|
|
36
|
-
'storybook-button--primary': this.primary,
|
|
37
|
-
'storybook-button--secondary': !this.primary,
|
|
38
|
-
[`storybook-button--${this.size}`]: true,
|
|
39
|
-
};
|
|
40
|
-
},
|
|
41
|
-
style() {
|
|
42
|
-
return {
|
|
43
|
-
backgroundColor: this.backgroundColor,
|
|
44
|
-
};
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
methods: {
|
|
49
|
-
onClick() {
|
|
50
|
-
this.$emit('onClick');
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
</script>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import MyHeader from './Header';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Example/Header',
|
|
5
|
-
component: MyHeader,
|
|
6
|
-
parameters: {
|
|
7
|
-
// More on Story layout: https://storybook.js.org/docs/vue/configure/story-layout
|
|
8
|
-
layout: 'fullscreen',
|
|
9
|
-
},
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const Template = (args, { argTypes }) => ({
|
|
13
|
-
props: Object.keys(argTypes),
|
|
14
|
-
components: { MyHeader },
|
|
15
|
-
template:
|
|
16
|
-
'<my-header :user="user" @onLogin="onLogin" @onLogout="onLogout" @onCreateAccount="onCreateAccount" />',
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export const LoggedIn = Template.bind({});
|
|
20
|
-
LoggedIn.args = {
|
|
21
|
-
user: {
|
|
22
|
-
name: 'Jane Doe',
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const LoggedOut = Template.bind({});
|
|
27
|
-
LoggedOut.args = {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<header>
|
|
3
|
-
<div class="wrapper">
|
|
4
|
-
<div>
|
|
5
|
-
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
-
<g fill="none" fill-rule="evenodd">
|
|
7
|
-
<path
|
|
8
|
-
d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
|
|
9
|
-
fill="#FFF"
|
|
10
|
-
/>
|
|
11
|
-
<path
|
|
12
|
-
d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
|
|
13
|
-
fill="#555AB9"
|
|
14
|
-
/>
|
|
15
|
-
<path
|
|
16
|
-
d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z"
|
|
17
|
-
fill="#91BAF8"
|
|
18
|
-
/>
|
|
19
|
-
</g>
|
|
20
|
-
</svg>
|
|
21
|
-
<h1>Acme</h1>
|
|
22
|
-
</div>
|
|
23
|
-
<div>
|
|
24
|
-
<span class="welcome" v-if="user">Welcome, <b>{{ user.name }}</b>!</span>
|
|
25
|
-
<my-button size="small" @onClick="onLogout" label="Log out" v-if="user" />
|
|
26
|
-
<my-button size="small" @onClick="onLogin" label="Log in" v-if="!user" />
|
|
27
|
-
<my-button primary size="small" @onClick="onCreateAccount" label="Sign up" v-if="!user" />
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</header>
|
|
31
|
-
</template>
|
|
32
|
-
|
|
33
|
-
<script>
|
|
34
|
-
import './header.css';
|
|
35
|
-
import MyButton from './Button.vue';
|
|
36
|
-
|
|
37
|
-
export default {
|
|
38
|
-
name: 'my-header',
|
|
39
|
-
|
|
40
|
-
components: { MyButton },
|
|
41
|
-
|
|
42
|
-
props: {
|
|
43
|
-
user: {
|
|
44
|
-
type: Object,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
methods: {
|
|
49
|
-
onLogin() {
|
|
50
|
-
this.$emit('onLogin');
|
|
51
|
-
},
|
|
52
|
-
onLogout() {
|
|
53
|
-
this.$emit('onLogout');
|
|
54
|
-
},
|
|
55
|
-
onCreateAccount() {
|
|
56
|
-
this.$emit('onCreateAccount');
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
</script>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { within, userEvent } from '@storybook/testing-library';
|
|
2
|
-
|
|
3
|
-
import MyPage from './Page';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Example/Page',
|
|
7
|
-
component: MyPage,
|
|
8
|
-
parameters: {
|
|
9
|
-
// More on Story layout: https://storybook.js.org/docs/vue/configure/story-layout
|
|
10
|
-
layout: 'fullscreen',
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const Template = () => ({
|
|
15
|
-
components: { MyPage },
|
|
16
|
-
template: '<my-page />',
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export const LoggedOut = Template.bind({});
|
|
20
|
-
|
|
21
|
-
// More on interaction testing: https://storybook.js.org/docs/vue/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,88 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<article>
|
|
3
|
-
<my-header
|
|
4
|
-
:user="user"
|
|
5
|
-
@onLogin="onLogin"
|
|
6
|
-
@onLogout="onLogout"
|
|
7
|
-
@onCreateAccount="onCreateAccount"
|
|
8
|
-
/>
|
|
9
|
-
|
|
10
|
-
<section>
|
|
11
|
-
<h2>Pages in Storybook</h2>
|
|
12
|
-
<p>
|
|
13
|
-
We recommend building UIs with a
|
|
14
|
-
<a href="https://componentdriven.org" target="_blank" rel="noopener noreferrer">
|
|
15
|
-
<strong>component-driven</strong>
|
|
16
|
-
</a>
|
|
17
|
-
process starting with atomic components and ending with pages.
|
|
18
|
-
</p>
|
|
19
|
-
<p>
|
|
20
|
-
Render pages with mock data. This makes it easy to build and review page states without
|
|
21
|
-
needing to navigate to them in your app. Here are some handy patterns for managing page data
|
|
22
|
-
in Storybook:
|
|
23
|
-
</p>
|
|
24
|
-
<ul>
|
|
25
|
-
<li>
|
|
26
|
-
Use a higher-level connected component. Storybook helps you compose such data from the
|
|
27
|
-
"args" of child component stories
|
|
28
|
-
</li>
|
|
29
|
-
<li>
|
|
30
|
-
Assemble data in the page component from your services. You can mock these services out
|
|
31
|
-
using Storybook.
|
|
32
|
-
</li>
|
|
33
|
-
</ul>
|
|
34
|
-
<p>
|
|
35
|
-
Get a guided tutorial on component-driven development at
|
|
36
|
-
<a href="https://storybook.js.org/tutorials/" target="_blank" rel="noopener noreferrer"
|
|
37
|
-
>Storybook tutorials</a
|
|
38
|
-
>
|
|
39
|
-
. Read more in the
|
|
40
|
-
<a href="https://storybook.js.org/docs" target="_blank" rel="noopener noreferrer">docs</a>
|
|
41
|
-
.
|
|
42
|
-
</p>
|
|
43
|
-
<div class="tip-wrapper">
|
|
44
|
-
<span class="tip">Tip</span>
|
|
45
|
-
Adjust the width of the canvas with the
|
|
46
|
-
<svg width="10" height="10" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
|
|
47
|
-
<g fill="none" fill-rule="evenodd">
|
|
48
|
-
<path
|
|
49
|
-
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"
|
|
50
|
-
id="a"
|
|
51
|
-
fill="#999"
|
|
52
|
-
/>
|
|
53
|
-
</g>
|
|
54
|
-
</svg>
|
|
55
|
-
Viewports addon in the toolbar
|
|
56
|
-
</div>
|
|
57
|
-
</section>
|
|
58
|
-
</article>
|
|
59
|
-
</template>
|
|
60
|
-
|
|
61
|
-
<script>
|
|
62
|
-
import './page.css';
|
|
63
|
-
import MyHeader from './Header.vue';
|
|
64
|
-
|
|
65
|
-
export default {
|
|
66
|
-
name: 'my-page',
|
|
67
|
-
|
|
68
|
-
components: { MyHeader },
|
|
69
|
-
|
|
70
|
-
data() {
|
|
71
|
-
return {
|
|
72
|
-
user: null,
|
|
73
|
-
};
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
methods: {
|
|
77
|
-
onLogin() {
|
|
78
|
-
this.user = { name: 'Jane Doe' };
|
|
79
|
-
},
|
|
80
|
-
onLogout() {
|
|
81
|
-
this.user = null;
|
|
82
|
-
},
|
|
83
|
-
onCreateAccount() {
|
|
84
|
-
this.user = { name: 'Jane Doe' };
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
</script>
|
|
@@ -1,52 +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
|
-
onClick: {},
|
|
11
|
-
size: {
|
|
12
|
-
control: { type: 'select' },
|
|
13
|
-
options: ['small', 'medium', 'large'],
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
|
19
|
-
const Template = (args) => ({
|
|
20
|
-
// Components used in your story `template` are defined in the `components` object
|
|
21
|
-
components: { MyButton },
|
|
22
|
-
// The story's `args` need to be mapped into the template through the `setup()` method
|
|
23
|
-
setup() {
|
|
24
|
-
return { args };
|
|
25
|
-
},
|
|
26
|
-
// And then the `args` are bound to your component with `v-bind="args"`
|
|
27
|
-
template: '<my-button v-bind="args" />',
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
export const Primary = Template.bind({});
|
|
31
|
-
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
|
32
|
-
Primary.args = {
|
|
33
|
-
primary: true,
|
|
34
|
-
label: 'Button',
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const Secondary = Template.bind({});
|
|
38
|
-
Secondary.args = {
|
|
39
|
-
label: 'Button',
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const Large = Template.bind({});
|
|
43
|
-
Large.args = {
|
|
44
|
-
size: 'large',
|
|
45
|
-
label: 'Button',
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const Small = Template.bind({});
|
|
49
|
-
Small.args = {
|
|
50
|
-
size: 'small',
|
|
51
|
-
label: 'Button',
|
|
52
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<button type="button" :class="classes" @click="onClick" :style="style">{{ label }}</button>
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script>
|
|
6
|
-
import './button.css';
|
|
7
|
-
import { reactive, computed } from 'vue';
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
name: 'my-button',
|
|
11
|
-
|
|
12
|
-
props: {
|
|
13
|
-
label: {
|
|
14
|
-
type: String,
|
|
15
|
-
required: true,
|
|
16
|
-
},
|
|
17
|
-
primary: {
|
|
18
|
-
type: Boolean,
|
|
19
|
-
default: false,
|
|
20
|
-
},
|
|
21
|
-
size: {
|
|
22
|
-
type: String,
|
|
23
|
-
validator: function (value) {
|
|
24
|
-
return ['small', 'medium', 'large'].indexOf(value) !== -1;
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
backgroundColor: {
|
|
28
|
-
type: String,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
emits: ['click'],
|
|
33
|
-
|
|
34
|
-
setup(props, { emit }) {
|
|
35
|
-
props = reactive(props);
|
|
36
|
-
return {
|
|
37
|
-
classes: computed(() => ({
|
|
38
|
-
'storybook-button': true,
|
|
39
|
-
'storybook-button--primary': props.primary,
|
|
40
|
-
'storybook-button--secondary': !props.primary,
|
|
41
|
-
[`storybook-button--${props.size || 'medium'}`]: true,
|
|
42
|
-
})),
|
|
43
|
-
style: computed(() => ({
|
|
44
|
-
backgroundColor: props.backgroundColor,
|
|
45
|
-
})),
|
|
46
|
-
onClick() {
|
|
47
|
-
emit('click');
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
</script>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import MyHeader from './Header.vue';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Example/Header',
|
|
5
|
-
component: MyHeader,
|
|
6
|
-
parameters: {
|
|
7
|
-
// More on Story layout: https://storybook.js.org/docs/vue/configure/story-layout
|
|
8
|
-
layout: 'fullscreen',
|
|
9
|
-
},
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const Template = (args) => ({
|
|
13
|
-
// Components used in your story `template` are defined in the `components` object
|
|
14
|
-
components: { MyHeader },
|
|
15
|
-
// The story's `args` need to be mapped into the template through the `setup()` method
|
|
16
|
-
setup() {
|
|
17
|
-
// Story args can be spread into the returned object
|
|
18
|
-
return { ...args };
|
|
19
|
-
},
|
|
20
|
-
// Then, the spread values can be accessed directly in the template
|
|
21
|
-
template: '<my-header :user="user" />',
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
export const LoggedIn = Template.bind({});
|
|
25
|
-
LoggedIn.args = {
|
|
26
|
-
user: {
|
|
27
|
-
name: 'Jane Doe',
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const LoggedOut = Template.bind({});
|
|
32
|
-
LoggedOut.args = {
|
|
33
|
-
user: null,
|
|
34
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<header>
|
|
3
|
-
<div class="wrapper">
|
|
4
|
-
<div>
|
|
5
|
-
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
-
<g fill="none" fill-rule="evenodd">
|
|
7
|
-
<path
|
|
8
|
-
d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
|
|
9
|
-
fill="#FFF"
|
|
10
|
-
/>
|
|
11
|
-
<path
|
|
12
|
-
d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
|
|
13
|
-
fill="#555AB9"
|
|
14
|
-
/>
|
|
15
|
-
<path
|
|
16
|
-
d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z"
|
|
17
|
-
fill="#91BAF8"
|
|
18
|
-
/>
|
|
19
|
-
</g>
|
|
20
|
-
</svg>
|
|
21
|
-
<h1>Acme</h1>
|
|
22
|
-
</div>
|
|
23
|
-
<div>
|
|
24
|
-
<span class="welcome" v-if="user">Welcome, <b>{{ user.name }}</b>!</span>
|
|
25
|
-
<my-button size="small" @click="$emit('logout')" label="Log out" v-if="user" />
|
|
26
|
-
<my-button size="small" @click="$emit('login')" label="Log in" v-if="!user" />
|
|
27
|
-
<my-button primary size="small" @click="$emit('createAccount')" label="Sign up" v-if="!user" />
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</header>
|
|
31
|
-
</template>
|
|
32
|
-
|
|
33
|
-
<script>
|
|
34
|
-
import './header.css';
|
|
35
|
-
import MyButton from './Button.vue';
|
|
36
|
-
|
|
37
|
-
export default {
|
|
38
|
-
name: 'my-header',
|
|
39
|
-
|
|
40
|
-
components: { MyButton },
|
|
41
|
-
|
|
42
|
-
props: {
|
|
43
|
-
user: {
|
|
44
|
-
type: Object,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
emits: ['login', 'logout', 'createAccount'],
|
|
49
|
-
};
|
|
50
|
-
</script>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { within, userEvent } from '@storybook/testing-library';
|
|
2
|
-
import MyPage from './Page.vue';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Example/Page',
|
|
6
|
-
component: MyPage,
|
|
7
|
-
parameters: {
|
|
8
|
-
// More on Story layout: https://storybook.js.org/docs/vue/configure/story-layout
|
|
9
|
-
layout: 'fullscreen',
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const Template = () => ({
|
|
14
|
-
// Components used in your story `template` are defined in the `components` object
|
|
15
|
-
components: { MyPage },
|
|
16
|
-
|
|
17
|
-
// Here we define the `template`
|
|
18
|
-
template: '<my-page />',
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
export const LoggedOut = Template.bind({});
|
|
22
|
-
|
|
23
|
-
// More on interaction testing: https://storybook.js.org/docs/vue/writing-tests/interaction-testing
|
|
24
|
-
export const LoggedIn = Template.bind({});
|
|
25
|
-
LoggedIn.play = async ({ canvasElement }) => {
|
|
26
|
-
const canvas = within(canvasElement);
|
|
27
|
-
const loginButton = await canvas.getByRole('button', { name: /Log in/i });
|
|
28
|
-
await userEvent.click(loginButton);
|
|
29
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<article>
|
|
3
|
-
<my-header
|
|
4
|
-
:user="user"
|
|
5
|
-
@login="onLogin"
|
|
6
|
-
@logout="onLogout"
|
|
7
|
-
@createAccount="onCreateAccount"
|
|
8
|
-
/>
|
|
9
|
-
|
|
10
|
-
<section>
|
|
11
|
-
<h2>Pages in Storybook</h2>
|
|
12
|
-
<p>
|
|
13
|
-
We recommend building UIs with a
|
|
14
|
-
<a href="https://componentdriven.org" target="_blank" rel="noopener noreferrer">
|
|
15
|
-
<strong>component-driven</strong>
|
|
16
|
-
</a>
|
|
17
|
-
process starting with atomic components and ending with pages.
|
|
18
|
-
</p>
|
|
19
|
-
<p>
|
|
20
|
-
Render pages with mock data. This makes it easy to build and review page states without
|
|
21
|
-
needing to navigate to them in your app. Here are some handy patterns for managing page data
|
|
22
|
-
in Storybook:
|
|
23
|
-
</p>
|
|
24
|
-
<ul>
|
|
25
|
-
<li>
|
|
26
|
-
Use a higher-level connected component. Storybook helps you compose such data from the
|
|
27
|
-
"args" of child component stories
|
|
28
|
-
</li>
|
|
29
|
-
<li>
|
|
30
|
-
Assemble data in the page component from your services. You can mock these services out
|
|
31
|
-
using Storybook.
|
|
32
|
-
</li>
|
|
33
|
-
</ul>
|
|
34
|
-
<p>
|
|
35
|
-
Get a guided tutorial on component-driven development at
|
|
36
|
-
<a href="https://storybook.js.org/tutorials/" target="_blank" rel="noopener noreferrer"
|
|
37
|
-
>Storybook tutorials</a
|
|
38
|
-
>
|
|
39
|
-
. Read more in the
|
|
40
|
-
<a href="https://storybook.js.org/docs" target="_blank" rel="noopener noreferrer">docs</a>
|
|
41
|
-
.
|
|
42
|
-
</p>
|
|
43
|
-
<div class="tip-wrapper">
|
|
44
|
-
<span class="tip">Tip</span>
|
|
45
|
-
Adjust the width of the canvas with the
|
|
46
|
-
<svg width="10" height="10" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
|
|
47
|
-
<g fill="none" fill-rule="evenodd">
|
|
48
|
-
<path
|
|
49
|
-
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"
|
|
50
|
-
id="a"
|
|
51
|
-
fill="#999"
|
|
52
|
-
/>
|
|
53
|
-
</g>
|
|
54
|
-
</svg>
|
|
55
|
-
Viewports addon in the toolbar
|
|
56
|
-
</div>
|
|
57
|
-
</section>
|
|
58
|
-
</article>
|
|
59
|
-
</template>
|
|
60
|
-
|
|
61
|
-
<script>
|
|
62
|
-
import './page.css';
|
|
63
|
-
import MyHeader from './Header.vue';
|
|
64
|
-
|
|
65
|
-
export default {
|
|
66
|
-
name: 'my-page',
|
|
67
|
-
|
|
68
|
-
components: { MyHeader },
|
|
69
|
-
|
|
70
|
-
data() {
|
|
71
|
-
return {
|
|
72
|
-
user: null
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
methods: {
|
|
77
|
-
onLogin() {
|
|
78
|
-
this.user = { name: 'Jane Doe' };
|
|
79
|
-
},
|
|
80
|
-
onLogout() {
|
|
81
|
-
this.user = null;
|
|
82
|
-
},
|
|
83
|
-
onCreateAccount() {
|
|
84
|
-
this.user = { name: 'Jane Doe' };
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
</script>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit-html';
|
|
2
|
-
import { styleMap } from 'lit-html/directives/style-map.js';
|
|
3
|
-
import './button.css';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Primary UI component for user interaction
|
|
7
|
-
*/
|
|
8
|
-
export const Button = ({ primary, backgroundColor = null, size, label, onClick }) => {
|
|
9
|
-
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
10
|
-
|
|
11
|
-
return html`
|
|
12
|
-
<button
|
|
13
|
-
type="button"
|
|
14
|
-
class=${['storybook-button', `storybook-button--${size || 'medium'}`, mode].join(' ')}
|
|
15
|
-
style=${styleMap({ backgroundColor })}
|
|
16
|
-
@click=${onClick}
|
|
17
|
-
>
|
|
18
|
-
${label}
|
|
19
|
-
</button>
|
|
20
|
-
`;
|
|
21
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Button } from './Button';
|
|
2
|
-
|
|
3
|
-
// More on default export: https://storybook.js.org/docs/web-components/writing-stories/introduction#default-export
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Example/Button',
|
|
6
|
-
// More on argTypes: https://storybook.js.org/docs/web-components/api/argtypes
|
|
7
|
-
argTypes: {
|
|
8
|
-
backgroundColor: { control: 'color' },
|
|
9
|
-
onClick: { action: 'onClick' },
|
|
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/web-components/writing-stories/introduction#using-args
|
|
18
|
-
const Template = (args) => Button(args);
|
|
19
|
-
|
|
20
|
-
export const Primary = Template.bind({});
|
|
21
|
-
// More on args: https://storybook.js.org/docs/web-components/writing-stories/args
|
|
22
|
-
Primary.args = {
|
|
23
|
-
primary: true,
|
|
24
|
-
label: 'Button',
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const Secondary = Template.bind({});
|
|
28
|
-
Secondary.args = {
|
|
29
|
-
label: 'Button',
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const Large = Template.bind({});
|
|
33
|
-
Large.args = {
|
|
34
|
-
size: 'large',
|
|
35
|
-
label: 'Button',
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const Small = Template.bind({});
|
|
39
|
-
Small.args = {
|
|
40
|
-
size: 'small',
|
|
41
|
-
label: 'Button',
|
|
42
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit-html';
|
|
2
|
-
|
|
3
|
-
import { Button } from './Button';
|
|
4
|
-
import './header.css';
|
|
5
|
-
|
|
6
|
-
export const Header = ({ user, onLogin, onLogout, onCreateAccount }) => html`
|
|
7
|
-
<header>
|
|
8
|
-
<div class="wrapper">
|
|
9
|
-
<div>
|
|
10
|
-
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
11
|
-
<g fill="none" fillRule="evenodd">
|
|
12
|
-
<path
|
|
13
|
-
d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
|
|
14
|
-
fill="#FFF"
|
|
15
|
-
/>
|
|
16
|
-
<path
|
|
17
|
-
d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
|
|
18
|
-
fill="#555AB9"
|
|
19
|
-
/>
|
|
20
|
-
<path
|
|
21
|
-
d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z"
|
|
22
|
-
fill="#91BAF8"
|
|
23
|
-
/>
|
|
24
|
-
</g>
|
|
25
|
-
</svg>
|
|
26
|
-
<h1>Acme</h1>
|
|
27
|
-
</div>
|
|
28
|
-
<div>
|
|
29
|
-
${user
|
|
30
|
-
? Button({ size: 'small', onClick: onLogout, label: 'Log out' })
|
|
31
|
-
: html`${Button({
|
|
32
|
-
size: 'small',
|
|
33
|
-
onClick: onLogin,
|
|
34
|
-
label: 'Log in',
|
|
35
|
-
})}
|
|
36
|
-
${Button({
|
|
37
|
-
primary: true,
|
|
38
|
-
size: 'small',
|
|
39
|
-
onClick: onCreateAccount,
|
|
40
|
-
label: 'Sign up',
|
|
41
|
-
})}`}
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
</header>
|
|
45
|
-
`;
|