@storybook/react 6.4.0-alpha.38 → 6.4.0-alpha.41

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.
@@ -0,0 +1 @@
1
+ "use strict";
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  import { ComponentType } from 'react';
2
- import { Args, ComponentAnnotations, StoryAnnotationsOrFn } from '@storybook/csf';
2
+ import { Args, ComponentAnnotations, StoryAnnotations, AnnotatedStoryFn } from '@storybook/csf';
3
3
  import { StoryFnReactReturnType } from './types';
4
4
  export { Args, ArgTypes, Parameters, StoryContext } from '@storybook/csf';
5
5
  export declare type ReactFramework = {
@@ -13,8 +13,23 @@ export declare type ReactFramework = {
13
13
  */
14
14
  export declare type Meta<TArgs = Args> = ComponentAnnotations<ReactFramework, TArgs>;
15
15
  /**
16
- * Story function that represents a component example.
16
+ * Story function that represents a CSFv2 component example.
17
17
  *
18
18
  * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
19
19
  */
20
- export declare type Story<TArgs = Args> = StoryAnnotationsOrFn<ReactFramework, TArgs>;
20
+ export declare type StoryFn<TArgs = Args> = AnnotatedStoryFn<ReactFramework, TArgs>;
21
+ /**
22
+ * Story function that represents a CSFv3 component example.
23
+ *
24
+ * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
25
+ */
26
+ export declare type StoryObj<TArgs = Args> = StoryAnnotations<ReactFramework, TArgs>;
27
+ /**
28
+ * Story function that represents a CSFv2 component example.
29
+ *
30
+ * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
31
+ *
32
+ * NOTE that in Storybook 7.0, this type will be renamed to `StoryFn` and replaced by the current `StoryObj` type.
33
+ *
34
+ */
35
+ export declare type Story<TArgs = Args> = StoryFn<TArgs>;
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps, JSXElementConstructor } from 'react';
2
- import { Story, Meta } from './types-6-0';
2
+ import { StoryFn, StoryObj, Story, Meta } from './types-6-0';
3
3
  export * from './types-6-0';
4
4
  /**
5
5
  * For the common case where a component's stories are simple components that receives args as props:
@@ -10,10 +10,31 @@ export * from './types-6-0';
10
10
  */
11
11
  export declare type ComponentMeta<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = Meta<ComponentProps<T>>;
12
12
  /**
13
- * For the common case where a story is a simple component that receives args as props:
13
+ * For the common case where a (CSFv2) story is a simple component that receives args as props:
14
14
  *
15
15
  * ```tsx
16
16
  * const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />
17
17
  * ```
18
18
  */
19
+ export declare type ComponentStoryFn<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = StoryFn<ComponentProps<T>>;
20
+ /**
21
+ * For the common case where a (CSFv3) story is a simple component that receives args as props:
22
+ *
23
+ * ```tsx
24
+ * const MyStory: ComponentStory<typeof Button> = {
25
+ * args: { buttonArg1: 'val' },
26
+ * }
27
+ * ```
28
+ */
29
+ export declare type ComponentStoryObj<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = StoryObj<ComponentProps<T>>;
30
+ /**
31
+ * For the common case where a (CSFv2) story is a simple component that receives args as props:
32
+ *
33
+ * ```tsx
34
+ * const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />
35
+ * ```
36
+ *
37
+ * NOTE: this is an alias for `ComponentStoryFn`.
38
+ * In Storybook v7, `ComponentStory` will alias `ComponentStoryObj`
39
+ */
19
40
  export declare type ComponentStory<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = Story<ComponentProps<T>>;
@@ -0,0 +1,21 @@
1
+ import { JSXElementConstructor } from 'react';
2
+ import { Args } from '@storybook/csf';
3
+ import { StoryObj } from './types-6-0';
4
+ import { ComponentStoryObj } from './types-6-3';
5
+ export { StoryFn, StoryObj, Meta } from './types-6-0';
6
+ export { ComponentStoryFn, ComponentStoryObj, ComponentMeta } from './types-6-3';
7
+ /**
8
+ * Story function that represents a CSFv3 component example.
9
+ *
10
+ * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
11
+ */
12
+ export declare type Story<TArgs = Args> = StoryObj<TArgs>;
13
+ /**
14
+ * For the common case where a (CSFv3) story is a simple component that receives args as props:
15
+ *
16
+ * ```tsx
17
+ * const MyStory: ComponentStory<typeof Button> = {
18
+ * args: { buttonArg1: 'val' },
19
+ * }
20
+ * ```
21
+ */ export declare type ComponentStory<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = ComponentStoryObj<T>;
@@ -1,5 +1,5 @@
1
1
  import { ComponentType } from 'react';
2
- import { Args, ComponentAnnotations, StoryAnnotationsOrFn } from '@storybook/csf';
2
+ import { Args, ComponentAnnotations, StoryAnnotations, AnnotatedStoryFn } from '@storybook/csf';
3
3
  import { StoryFnReactReturnType } from './types';
4
4
  export type { Args, ArgTypes, Parameters, StoryContext } from '@storybook/csf';
5
5
  export declare type ReactFramework = {
@@ -13,8 +13,23 @@ export declare type ReactFramework = {
13
13
  */
14
14
  export declare type Meta<TArgs = Args> = ComponentAnnotations<ReactFramework, TArgs>;
15
15
  /**
16
- * Story function that represents a component example.
16
+ * Story function that represents a CSFv2 component example.
17
17
  *
18
18
  * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
19
19
  */
20
- export declare type Story<TArgs = Args> = StoryAnnotationsOrFn<ReactFramework, TArgs>;
20
+ export declare type StoryFn<TArgs = Args> = AnnotatedStoryFn<ReactFramework, TArgs>;
21
+ /**
22
+ * Story function that represents a CSFv3 component example.
23
+ *
24
+ * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
25
+ */
26
+ export declare type StoryObj<TArgs = Args> = StoryAnnotations<ReactFramework, TArgs>;
27
+ /**
28
+ * Story function that represents a CSFv2 component example.
29
+ *
30
+ * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
31
+ *
32
+ * NOTE that in Storybook 7.0, this type will be renamed to `StoryFn` and replaced by the current `StoryObj` type.
33
+ *
34
+ */
35
+ export declare type Story<TArgs = Args> = StoryFn<TArgs>;
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps, JSXElementConstructor } from 'react';
2
- import type { Story, Meta } from './types-6-0';
2
+ import type { StoryFn, StoryObj, Story, Meta } from './types-6-0';
3
3
  export * from './types-6-0';
4
4
  /**
5
5
  * For the common case where a component's stories are simple components that receives args as props:
@@ -10,10 +10,31 @@ export * from './types-6-0';
10
10
  */
11
11
  export declare type ComponentMeta<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = Meta<ComponentProps<T>>;
12
12
  /**
13
- * For the common case where a story is a simple component that receives args as props:
13
+ * For the common case where a (CSFv2) story is a simple component that receives args as props:
14
14
  *
15
15
  * ```tsx
16
16
  * const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />
17
17
  * ```
18
18
  */
19
+ export declare type ComponentStoryFn<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = StoryFn<ComponentProps<T>>;
20
+ /**
21
+ * For the common case where a (CSFv3) story is a simple component that receives args as props:
22
+ *
23
+ * ```tsx
24
+ * const MyStory: ComponentStory<typeof Button> = {
25
+ * args: { buttonArg1: 'val' },
26
+ * }
27
+ * ```
28
+ */
29
+ export declare type ComponentStoryObj<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = StoryObj<ComponentProps<T>>;
30
+ /**
31
+ * For the common case where a (CSFv2) story is a simple component that receives args as props:
32
+ *
33
+ * ```tsx
34
+ * const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />
35
+ * ```
36
+ *
37
+ * NOTE: this is an alias for `ComponentStoryFn`.
38
+ * In Storybook v7, `ComponentStory` will alias `ComponentStoryObj`
39
+ */
19
40
  export declare type ComponentStory<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = Story<ComponentProps<T>>;
@@ -0,0 +1,21 @@
1
+ import { JSXElementConstructor } from 'react';
2
+ import { Args } from '@storybook/csf';
3
+ import type { StoryObj } from './types-6-0';
4
+ import type { ComponentStoryObj } from './types-6-3';
5
+ export type { StoryFn, StoryObj, Meta } from './types-6-0';
6
+ export type { ComponentStoryFn, ComponentStoryObj, ComponentMeta } from './types-6-3';
7
+ /**
8
+ * Story function that represents a CSFv3 component example.
9
+ *
10
+ * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
11
+ */
12
+ export declare type Story<TArgs = Args> = StoryObj<TArgs>;
13
+ /**
14
+ * For the common case where a (CSFv3) story is a simple component that receives args as props:
15
+ *
16
+ * ```tsx
17
+ * const MyStory: ComponentStory<typeof Button> = {
18
+ * args: { buttonArg1: 'val' },
19
+ * }
20
+ * ```
21
+ */ export declare type ComponentStory<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = ComponentStoryObj<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/react",
3
- "version": "6.4.0-alpha.38",
3
+ "version": "6.4.0-alpha.41",
4
4
  "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
5
5
  "keywords": [
6
6
  "storybook"
@@ -49,14 +49,14 @@
49
49
  "@babel/preset-flow": "^7.12.1",
50
50
  "@babel/preset-react": "^7.12.10",
51
51
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.0-rc.2",
52
- "@storybook/addons": "6.4.0-alpha.38",
53
- "@storybook/core": "6.4.0-alpha.38",
54
- "@storybook/core-common": "6.4.0-alpha.38",
55
- "@storybook/csf": "0.0.2--canary.68887a1.0",
56
- "@storybook/node-logger": "6.4.0-alpha.38",
52
+ "@storybook/addons": "6.4.0-alpha.41",
53
+ "@storybook/core": "6.4.0-alpha.41",
54
+ "@storybook/core-common": "6.4.0-alpha.41",
55
+ "@storybook/csf": "0.0.2--canary.6aca495.0",
56
+ "@storybook/node-logger": "6.4.0-alpha.41",
57
57
  "@storybook/react-docgen-typescript-plugin": "1.0.2-canary.253f8c1.0",
58
58
  "@storybook/semver": "^7.3.2",
59
- "@storybook/store": "6.4.0-alpha.38",
59
+ "@storybook/store": "6.4.0-alpha.41",
60
60
  "@types/webpack-env": "^1.16.0",
61
61
  "babel-plugin-add-react-displayname": "^0.0.5",
62
62
  "babel-plugin-named-asset-import": "^0.3.1",
@@ -73,7 +73,7 @@
73
73
  "webpack": "4"
74
74
  },
75
75
  "devDependencies": {
76
- "@storybook/client-api": "6.4.0-alpha.38",
76
+ "@storybook/client-api": "6.4.0-alpha.41",
77
77
  "@types/node": "^14.14.20",
78
78
  "@types/prompts": "^2.0.9"
79
79
  },
@@ -96,6 +96,6 @@
96
96
  "publishConfig": {
97
97
  "access": "public"
98
98
  },
99
- "gitHead": "14b9d19e7e9e3de84729ce0c7989efa372c6987c",
99
+ "gitHead": "64746ce270eb58d30a58d4df358c927780bc1a64",
100
100
  "sbmodern": "dist/modern/client/index.js"
101
101
  }