@storybook/vue3 7.0.0-alpha.50 → 7.0.0-alpha.51
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/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as lib_docs_tools_dist from 'lib/docs-tools/dist';
|
|
2
2
|
import * as lib_types_dist from 'lib/types/dist';
|
|
3
|
-
import { V as VueRenderer } from './render-
|
|
4
|
-
export { r as render, a as renderToCanvas } from './render-
|
|
3
|
+
import { V as VueRenderer } from './render-913dae32.js';
|
|
4
|
+
export { r as render, a as renderToCanvas } from './render-913dae32.js';
|
|
5
5
|
import { LegacyStoryFn, DecoratorFunction } from '@storybook/types';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import * as _storybook_types from '@storybook/types';
|
|
|
2
2
|
import { Addon_ClientStoryApi, Addon_Loadable, Args, ComponentAnnotations, AnnotatedStoryFn, ArgsStoryFn, ArgsFromMeta, StoryAnnotations, StrictArgs, DecoratorFunction, LoaderFunction, StoryContext as StoryContext$1 } from '@storybook/types';
|
|
3
3
|
export { ArgTypes, Args, Parameters, StrictArgs } from '@storybook/types';
|
|
4
4
|
import { App, ComponentOptions, FunctionalComponent, ConcreteComponent } from 'vue';
|
|
5
|
-
import { V as VueRenderer } from './render-
|
|
6
|
-
export { V as VueRenderer, s as setup } from './render-
|
|
5
|
+
import { V as VueRenderer } from './render-913dae32.js';
|
|
6
|
+
export { V as VueRenderer, s as setup } from './render-913dae32.js';
|
|
7
7
|
import { Simplify, SetOptional } from 'type-fest';
|
|
8
8
|
|
|
9
9
|
interface ClientApi extends Addon_ClientStoryApi<VueRenderer['storyResult']> {
|
|
@@ -23,25 +23,25 @@ declare const raw: ((...args: any[]) => never) | (() => _storybook_types.Store_B
|
|
|
23
23
|
*
|
|
24
24
|
* @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
type Meta<TCmpOrArgs = Args> = ComponentAnnotations<VueRenderer, ComponentPropsOrProps<TCmpOrArgs>>;
|
|
27
27
|
/**
|
|
28
28
|
* Story function that represents a CSFv2 component example.
|
|
29
29
|
*
|
|
30
30
|
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
type StoryFn<TCmpOrArgs = Args> = AnnotatedStoryFn<VueRenderer, ComponentPropsOrProps<TCmpOrArgs>>;
|
|
33
33
|
/**
|
|
34
34
|
* Story function that represents a CSFv3 component example.
|
|
35
35
|
*
|
|
36
36
|
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
type StoryObj<TMetaOrCmpOrArgs = Args> = TMetaOrCmpOrArgs extends {
|
|
39
39
|
render?: ArgsStoryFn<VueRenderer, any>;
|
|
40
40
|
component?: infer Component;
|
|
41
41
|
args?: infer DefaultArgs;
|
|
42
42
|
} ? Simplify<ComponentProps<Component> & ArgsFromMeta<VueRenderer, TMetaOrCmpOrArgs>> extends infer TArgs ? StoryAnnotations<VueRenderer, TArgs, SetOptional<TArgs, Extract<keyof TArgs, keyof DefaultArgs>>> : never : StoryAnnotations<VueRenderer, ComponentPropsOrProps<TMetaOrCmpOrArgs>>;
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
type ComponentProps<C> = C extends ComponentOptions<infer P> ? P : C extends FunctionalComponent<infer P> ? P : unknown;
|
|
44
|
+
type ComponentPropsOrProps<TCmpOrArgs> = TCmpOrArgs extends ConcreteComponent<any> ? unknown extends ComponentProps<TCmpOrArgs> ? TCmpOrArgs : ComponentProps<TCmpOrArgs> : TCmpOrArgs;
|
|
45
45
|
/**
|
|
46
46
|
* @deprecated Use `StoryFn` instead.
|
|
47
47
|
* Use `StoryObj` if you want to migrate to CSF3, which uses objects instead of functions to represent stories.
|
|
@@ -51,9 +51,9 @@ declare type ComponentPropsOrProps<TCmpOrArgs> = TCmpOrArgs extends ConcreteComp
|
|
|
51
51
|
*
|
|
52
52
|
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
53
53
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
type Story<TArgs = Args> = StoryFn<TArgs>;
|
|
55
|
+
type Decorator<TArgs = StrictArgs> = DecoratorFunction<VueRenderer, TArgs>;
|
|
56
|
+
type Loader<TArgs = StrictArgs> = LoaderFunction<VueRenderer, TArgs>;
|
|
57
|
+
type StoryContext<TArgs = StrictArgs> = StoryContext$1<VueRenderer, TArgs>;
|
|
58
58
|
|
|
59
59
|
export { Decorator, Loader, Meta, Story, StoryContext, StoryFn, StoryObj, configure, forceReRender, raw, storiesOf };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WebRenderer, ArgsStoryFn, Store_RenderContext } from '@storybook/types';
|
|
2
2
|
import { ConcreteComponent } from 'vue';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type StoryFnVueReturnType = ConcreteComponent<any>;
|
|
5
5
|
interface VueRenderer extends WebRenderer {
|
|
6
6
|
component: Omit<ConcreteComponent<this['T']>, 'props'>;
|
|
7
7
|
storyResult: StoryFnVueReturnType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/vue3",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.51",
|
|
4
4
|
"description": "Storybook Vue 3 renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
"prep": "../../../scripts/prepare/bundle.ts"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@storybook/addons": "7.0.0-alpha.
|
|
55
|
-
"@storybook/core-client": "7.0.0-alpha.
|
|
56
|
-
"@storybook/docs-tools": "7.0.0-alpha.
|
|
57
|
-
"@storybook/store": "7.0.0-alpha.
|
|
58
|
-
"@storybook/types": "7.0.0-alpha.
|
|
54
|
+
"@storybook/addons": "7.0.0-alpha.51",
|
|
55
|
+
"@storybook/core-client": "7.0.0-alpha.51",
|
|
56
|
+
"@storybook/docs-tools": "7.0.0-alpha.51",
|
|
57
|
+
"@storybook/store": "7.0.0-alpha.51",
|
|
58
|
+
"@storybook/types": "7.0.0-alpha.51",
|
|
59
59
|
"global": "^4.4.0",
|
|
60
60
|
"react": "16.14.0",
|
|
61
61
|
"react-dom": "16.14.0",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@digitak/esrun": "^3.2.2",
|
|
67
|
-
"@vue/vue3-jest": "
|
|
68
|
-
"typescript": "
|
|
67
|
+
"@vue/vue3-jest": "29",
|
|
68
|
+
"typescript": "^4.9.3",
|
|
69
69
|
"vue": "^3.2.41",
|
|
70
70
|
"vue-tsc": "^1.0.8"
|
|
71
71
|
},
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
],
|
|
93
93
|
"platform": "browser"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "4fec76c3f5135854d9834ebc1cf2f1f325696ded"
|
|
96
96
|
}
|
|
@@ -1,27 +1,10 @@
|
|
|
1
1
|
import MyButton from './Button.vue';
|
|
2
2
|
|
|
3
|
-
// More on
|
|
3
|
+
// More on how to set up stories at: https://storybook.js.org/docs/7.0/vue/writing-stories/introduction
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Example/Button',
|
|
6
6
|
component: MyButton,
|
|
7
|
-
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/docs-page
|
|
8
7
|
tags: ['docsPage'],
|
|
9
|
-
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
|
10
|
-
render: (args) => ({
|
|
11
|
-
// Components used in your story `template` are defined in the `components` object
|
|
12
|
-
components: {
|
|
13
|
-
MyButton,
|
|
14
|
-
},
|
|
15
|
-
// The story's `args` need to be mapped into the template through the `setup()` method
|
|
16
|
-
setup() {
|
|
17
|
-
return {
|
|
18
|
-
args,
|
|
19
|
-
};
|
|
20
|
-
},
|
|
21
|
-
// And then the `args` are bound to your component with `v-bind="args"`
|
|
22
|
-
template: '<my-button v-bind="args" />',
|
|
23
|
-
}),
|
|
24
|
-
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
|
25
8
|
argTypes: {
|
|
26
9
|
backgroundColor: {
|
|
27
10
|
control: 'color',
|
|
@@ -36,6 +19,7 @@ export default {
|
|
|
36
19
|
},
|
|
37
20
|
};
|
|
38
21
|
|
|
22
|
+
// More on writing stories with args: https://storybook.js.org/docs/7.0/vue/writing-stories/args
|
|
39
23
|
export const Primary = {
|
|
40
24
|
args: {
|
|
41
25
|
primary: true,
|
|
@@ -3,7 +3,7 @@ import MyHeader from './Header.vue';
|
|
|
3
3
|
export default {
|
|
4
4
|
title: 'Example/Header',
|
|
5
5
|
component: MyHeader,
|
|
6
|
-
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/docs-page
|
|
6
|
+
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/7.0/vue/writing-docs/docs-page
|
|
7
7
|
tags: ['docsPage'],
|
|
8
8
|
render: (args) => ({
|
|
9
9
|
// Components used in your story `template` are defined in the `components` object
|
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
template: '<my-header :user="user" />',
|
|
22
22
|
}),
|
|
23
23
|
parameters: {
|
|
24
|
-
// More on
|
|
24
|
+
// More on how to position stories at: https://storybook.js.org/docs/7.0/vue/configure/story-layout
|
|
25
25
|
layout: 'fullscreen',
|
|
26
26
|
},
|
|
27
27
|
};
|
|
@@ -4,21 +4,15 @@ import MyPage from './Page.vue';
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Example/Page',
|
|
6
6
|
component: MyPage,
|
|
7
|
-
render: () => ({
|
|
8
|
-
// Components used in your story `template` are defined in the `components` object
|
|
9
|
-
components: { MyPage },
|
|
10
|
-
// Here we define the `template`
|
|
11
|
-
template: '<my-page />',
|
|
12
|
-
}),
|
|
13
7
|
parameters: {
|
|
14
|
-
// More on
|
|
8
|
+
// More on how to position stories at: https://storybook.js.org/docs/7.0/vue/configure/story-layout
|
|
15
9
|
layout: 'fullscreen',
|
|
16
10
|
},
|
|
17
11
|
};
|
|
18
12
|
|
|
19
13
|
export const LoggedOut = {};
|
|
20
14
|
|
|
21
|
-
// More on interaction testing: https://storybook.js.org/docs/vue/writing-tests/interaction-testing
|
|
15
|
+
// More on interaction testing: https://storybook.js.org/docs/7.0/vue/writing-tests/interaction-testing
|
|
22
16
|
export const LoggedIn = {
|
|
23
17
|
render: () => ({
|
|
24
18
|
components: {
|