@storybook/vue3 7.0.0-alpha.50 → 7.0.0-alpha.52

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-52740da1.js';
4
- export { r as render, a as renderToCanvas } from './render-52740da1.js';
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-52740da1.js';
6
- export { V as VueRenderer, s as setup } from './render-52740da1.js';
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
- declare type Meta<TCmpOrArgs = Args> = ComponentAnnotations<VueRenderer, ComponentPropsOrProps<TCmpOrArgs>>;
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
- declare type StoryFn<TCmpOrArgs = Args> = AnnotatedStoryFn<VueRenderer, ComponentPropsOrProps<TCmpOrArgs>>;
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
- declare type StoryObj<TMetaOrCmpOrArgs = Args> = TMetaOrCmpOrArgs extends {
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
- declare type ComponentProps<C> = C extends ComponentOptions<infer P> ? P : C extends FunctionalComponent<infer P> ? P : unknown;
44
- declare type ComponentPropsOrProps<TCmpOrArgs> = TCmpOrArgs extends ConcreteComponent<any> ? unknown extends ComponentProps<TCmpOrArgs> ? TCmpOrArgs : ComponentProps<TCmpOrArgs> : TCmpOrArgs;
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
- declare type Story<TArgs = Args> = StoryFn<TArgs>;
55
- declare type Decorator<TArgs = StrictArgs> = DecoratorFunction<VueRenderer, TArgs>;
56
- declare type Loader<TArgs = StrictArgs> = LoaderFunction<VueRenderer, TArgs>;
57
- declare type StoryContext<TArgs = StrictArgs> = StoryContext$1<VueRenderer, TArgs>;
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
- declare type StoryFnVueReturnType = ConcreteComponent<any>;
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.50",
3
+ "version": "7.0.0-alpha.52",
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.50",
55
- "@storybook/core-client": "7.0.0-alpha.50",
56
- "@storybook/docs-tools": "7.0.0-alpha.50",
57
- "@storybook/store": "7.0.0-alpha.50",
58
- "@storybook/types": "7.0.0-alpha.50",
54
+ "@storybook/addons": "7.0.0-alpha.52",
55
+ "@storybook/core-client": "7.0.0-alpha.52",
56
+ "@storybook/docs-tools": "7.0.0-alpha.52",
57
+ "@storybook/store": "7.0.0-alpha.52",
58
+ "@storybook/types": "7.0.0-alpha.52",
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": "28",
68
- "typescript": "~4.6.3",
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": "77184d039091f4782dc4540df6d271a24fb3e242"
95
+ "gitHead": "d2494e3f51ce0f55bcb1ef693a6477c669fbe666"
96
96
  }
@@ -1,27 +1,10 @@
1
1
  import MyButton from './Button.vue';
2
2
 
3
- // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
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 Story layout: https://storybook.js.org/docs/vue/configure/story-layout
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 Story layout: https://storybook.js.org/docs/vue/configure/story-layout
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: {