@storybook/react 7.3.2 → 7.4.0-alpha.1
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/package.json +10 -9
- package/src/__test__/README.md +0 -3
- package/src/typings.d.ts +0 -48
- package/template/components/Button.jsx +0 -13
- package/template/components/Form.jsx +0 -36
- package/template/components/Html.jsx +0 -9
- package/template/components/Pre.jsx +0 -20
- package/template/stories/decorators.stories.tsx +0 -48
- package/template/stories/docgen-components/10017-ts-union/argTypes.snapshot +0 -36
- package/template/stories/docgen-components/10017-ts-union/docgen.snapshot +0 -34
- package/template/stories/docgen-components/10017-ts-union/input.tsx +0 -12
- package/template/stories/docgen-components/10017-ts-union/properties.snapshot +0 -32
- package/template/stories/docgen-components/10278-ts-multiple-components/argTypes.snapshot +0 -26
- package/template/stories/docgen-components/10278-ts-multiple-components/docgen.snapshot +0 -49
- package/template/stories/docgen-components/10278-ts-multiple-components/input.tsx +0 -27
- package/template/stories/docgen-components/10278-ts-multiple-components/properties.snapshot +0 -22
- package/template/stories/docgen-components/8140-js-prop-types-oneof/argTypes.snapshot +0 -127
- package/template/stories/docgen-components/8140-js-prop-types-oneof/docgen.snapshot +0 -97
- package/template/stories/docgen-components/8140-js-prop-types-oneof/input.jsx +0 -27
- package/template/stories/docgen-components/8140-js-prop-types-oneof/properties.snapshot +0 -89
- package/template/stories/docgen-components/8143-ts-imported-types/argTypes.snapshot +0 -27
- package/template/stories/docgen-components/8143-ts-imported-types/docgen.snapshot +0 -22
- package/template/stories/docgen-components/8143-ts-imported-types/input.tsx +0 -10
- package/template/stories/docgen-components/8143-ts-imported-types/properties.snapshot +0 -23
- package/template/stories/docgen-components/8143-ts-imported-types/types.ts +0 -3
- package/template/stories/docgen-components/8143-ts-react-fc-generics/argTypes.snapshot +0 -27
- package/template/stories/docgen-components/8143-ts-react-fc-generics/docgen.snapshot +0 -24
- package/template/stories/docgen-components/8143-ts-react-fc-generics/input.tsx +0 -10
- package/template/stories/docgen-components/8143-ts-react-fc-generics/properties.snapshot +0 -21
- package/template/stories/docgen-components/8428-js-static-prop-types/argTypes.snapshot +0 -25
- package/template/stories/docgen-components/8428-js-static-prop-types/docgen.snapshot +0 -39
- package/template/stories/docgen-components/8428-js-static-prop-types/input.jsx +0 -20
- package/template/stories/docgen-components/8428-js-static-prop-types/properties.snapshot +0 -21
- package/template/stories/docgen-components/8740-ts-multi-props/argTypes.snapshot +0 -27
- package/template/stories/docgen-components/8740-ts-multi-props/docgen.snapshot +0 -49
- package/template/stories/docgen-components/8740-ts-multi-props/input.tsx +0 -23
- package/template/stories/docgen-components/8740-ts-multi-props/properties.snapshot +0 -21
- package/template/stories/docgen-components/8894-9511-ts-forward-ref/argTypes.snapshot +0 -48
- package/template/stories/docgen-components/8894-9511-ts-forward-ref/docgen.snapshot +0 -39
- package/template/stories/docgen-components/8894-9511-ts-forward-ref/input.tsx +0 -31
- package/template/stories/docgen-components/8894-9511-ts-forward-ref/properties.snapshot +0 -34
- package/template/stories/docgen-components/9023-js-hoc/argTypes.snapshot +0 -89
- package/template/stories/docgen-components/9023-js-hoc/docgen.snapshot +0 -84
- package/template/stories/docgen-components/9023-js-hoc/input.jsx +0 -40
- package/template/stories/docgen-components/9023-js-hoc/properties.snapshot +0 -67
- package/template/stories/docgen-components/9399-js-proptypes-shape/argTypes.snapshot +0 -39
- package/template/stories/docgen-components/9399-js-proptypes-shape/docgen.snapshot +0 -48
- package/template/stories/docgen-components/9399-js-proptypes-shape/input.jsx +0 -16
- package/template/stories/docgen-components/9399-js-proptypes-shape/properties.snapshot +0 -35
- package/template/stories/docgen-components/9465-ts-type-props/argTypes.snapshot +0 -28
- package/template/stories/docgen-components/9465-ts-type-props/docgen.snapshot +0 -33
- package/template/stories/docgen-components/9465-ts-type-props/input.tsx +0 -12
- package/template/stories/docgen-components/9465-ts-type-props/properties.snapshot +0 -24
- package/template/stories/docgen-components/9493-ts-display-name/argTypes.snapshot +0 -62
- package/template/stories/docgen-components/9493-ts-display-name/docgen.snapshot +0 -50
- package/template/stories/docgen-components/9493-ts-display-name/input.tsx +0 -30
- package/template/stories/docgen-components/9493-ts-display-name/properties.snapshot +0 -52
- package/template/stories/docgen-components/9556-ts-react-default-exports/argTypes.snapshot +0 -28
- package/template/stories/docgen-components/9556-ts-react-default-exports/docgen.snapshot +0 -32
- package/template/stories/docgen-components/9556-ts-react-default-exports/input.tsx +0 -12
- package/template/stories/docgen-components/9556-ts-react-default-exports/properties.snapshot +0 -24
- package/template/stories/docgen-components/9575-ts-camel-case/argTypes.snapshot +0 -28
- package/template/stories/docgen-components/9575-ts-camel-case/docgen.snapshot +0 -38
- package/template/stories/docgen-components/9575-ts-camel-case/input.tsx +0 -26
- package/template/stories/docgen-components/9575-ts-camel-case/properties.snapshot +0 -24
- package/template/stories/docgen-components/9586-js-react-memo/argTypes.snapshot +0 -41
- package/template/stories/docgen-components/9586-js-react-memo/docgen.snapshot +0 -42
- package/template/stories/docgen-components/9586-js-react-memo/input.jsx +0 -15
- package/template/stories/docgen-components/9586-js-react-memo/properties.snapshot +0 -34
- package/template/stories/docgen-components/9591-ts-import-types/Bar.tsx +0 -3
- package/template/stories/docgen-components/9591-ts-import-types/argTypes.snapshot +0 -25
- package/template/stories/docgen-components/9591-ts-import-types/docgen.snapshot +0 -21
- package/template/stories/docgen-components/9591-ts-import-types/input.tsx +0 -10
- package/template/stories/docgen-components/9591-ts-import-types/properties.snapshot +0 -21
- package/template/stories/docgen-components/9626-js-default-values/argTypes.snapshot +0 -27
- package/template/stories/docgen-components/9626-js-default-values/docgen.snapshot +0 -25
- package/template/stories/docgen-components/9626-js-default-values/input.jsx +0 -5
- package/template/stories/docgen-components/9626-js-default-values/properties.snapshot +0 -21
- package/template/stories/docgen-components/9668-js-proptypes-no-jsdoc/argTypes.snapshot +0 -42
- package/template/stories/docgen-components/9668-js-proptypes-no-jsdoc/docgen.snapshot +0 -36
- package/template/stories/docgen-components/9668-js-proptypes-no-jsdoc/input.jsx +0 -13
- package/template/stories/docgen-components/9668-js-proptypes-no-jsdoc/properties.snapshot +0 -35
- package/template/stories/docgen-components/9721-ts-deprecated-jsdoc/argTypes.snapshot +0 -34
- package/template/stories/docgen-components/9721-ts-deprecated-jsdoc/docgen.snapshot +0 -38
- package/template/stories/docgen-components/9721-ts-deprecated-jsdoc/input.tsx +0 -12
- package/template/stories/docgen-components/9721-ts-deprecated-jsdoc/properties.snapshot +0 -30
- package/template/stories/docgen-components/9764-ts-extend-props/argTypes.snapshot +0 -72
- package/template/stories/docgen-components/9764-ts-extend-props/docgen.snapshot +0 -41
- package/template/stories/docgen-components/9764-ts-extend-props/input.tsx +0 -17
- package/template/stories/docgen-components/9764-ts-extend-props/properties.snapshot +0 -56
- package/template/stories/docgen-components/9827-ts-default-values/argTypes.snapshot +0 -72
- package/template/stories/docgen-components/9827-ts-default-values/docgen.snapshot +0 -52
- package/template/stories/docgen-components/9827-ts-default-values/input.tsx +0 -17
- package/template/stories/docgen-components/9827-ts-default-values/properties.snapshot +0 -56
- package/template/stories/docgen-components/9832-ts-enum-export/argTypes.snapshot +0 -3
- package/template/stories/docgen-components/9832-ts-enum-export/docgen.snapshot +0 -16
- package/template/stories/docgen-components/9832-ts-enum-export/input.tsx +0 -8
- package/template/stories/docgen-components/9832-ts-enum-export/properties.snapshot +0 -7
- package/template/stories/docgen-components/9922-ts-component-props/argTypes.snapshot +0 -25
- package/template/stories/docgen-components/9922-ts-component-props/docgen.snapshot +0 -35
- package/template/stories/docgen-components/9922-ts-component-props/input.tsx +0 -24
- package/template/stories/docgen-components/9922-ts-component-props/properties.snapshot +0 -21
- package/template/stories/docgen-components/js-class-component/argTypes.snapshot +0 -386
- package/template/stories/docgen-components/js-class-component/docgen.snapshot +0 -252
- package/template/stories/docgen-components/js-class-component/input.jsx +0 -57
- package/template/stories/docgen-components/js-class-component/properties.snapshot +0 -286
- package/template/stories/docgen-components/js-function-component/argTypes.snapshot +0 -386
- package/template/stories/docgen-components/js-function-component/docgen.snapshot +0 -236
- package/template/stories/docgen-components/js-function-component/input.jsx +0 -50
- package/template/stories/docgen-components/js-function-component/properties.snapshot +0 -286
- package/template/stories/docgen-components/js-function-component-inline-defaults/argTypes.snapshot +0 -386
- package/template/stories/docgen-components/js-function-component-inline-defaults/docgen.snapshot +0 -247
- package/template/stories/docgen-components/js-function-component-inline-defaults/input.jsx +0 -65
- package/template/stories/docgen-components/js-function-component-inline-defaults/properties.snapshot +0 -286
- package/template/stories/docgen-components/js-function-component-inline-defaults-no-propTypes/argTypes.snapshot +0 -237
- package/template/stories/docgen-components/js-function-component-inline-defaults-no-propTypes/docgen.snapshot +0 -124
- package/template/stories/docgen-components/js-function-component-inline-defaults-no-propTypes/input.jsx +0 -41
- package/template/stories/docgen-components/js-function-component-inline-defaults-no-propTypes/properties.snapshot +0 -151
- package/template/stories/docgen-components/js-proptypes/docgen.snapshot +0 -1770
- package/template/stories/docgen-components/js-proptypes/input.jsx +0 -497
- package/template/stories/docgen-components/jsdoc/argTypes.snapshot +0 -1129
- package/template/stories/docgen-components/jsdoc/docgen.snapshot +0 -548
- package/template/stories/docgen-components/jsdoc/input.jsx +0 -231
- package/template/stories/docgen-components/jsdoc/properties.snapshot +0 -1017
- package/template/stories/docgen-components/ts-function-component/argTypes.snapshot +0 -396
- package/template/stories/docgen-components/ts-function-component/docgen.snapshot +0 -241
- package/template/stories/docgen-components/ts-function-component/input.tsx +0 -52
- package/template/stories/docgen-components/ts-function-component/properties.snapshot +0 -296
- package/template/stories/docgen-components/ts-function-component-inline-defaults/argTypes.snapshot +0 -279
- package/template/stories/docgen-components/ts-function-component-inline-defaults/docgen.snapshot +0 -151
- package/template/stories/docgen-components/ts-function-component-inline-defaults/input.tsx +0 -80
- package/template/stories/docgen-components/ts-function-component-inline-defaults/properties.snapshot +0 -177
- package/template/stories/docgen-components/ts-html/argTypes.snapshot +0 -3
- package/template/stories/docgen-components/ts-html/docgen.snapshot +0 -12
- package/template/stories/docgen-components/ts-html/input.tsx +0 -12
- package/template/stories/docgen-components/ts-html/properties.snapshot +0 -7
- package/template/stories/docgen-components/ts-jsdoc/argTypes.snapshot +0 -3
- package/template/stories/docgen-components/ts-jsdoc/docgen.snapshot +0 -21
- package/template/stories/docgen-components/ts-jsdoc/input.tsx +0 -27
- package/template/stories/docgen-components/ts-jsdoc/properties.snapshot +0 -7
- package/template/stories/docgen-components/ts-types/argTypes.snapshot +0 -656
- package/template/stories/docgen-components/ts-types/docgen.snapshot +0 -317
- package/template/stories/docgen-components/ts-types/input.tsx +0 -130
- package/template/stories/docgen-components/ts-types/properties.snapshot +0 -410
- package/template/stories/errors.stories.tsx +0 -37
- package/template/stories/hooks.stories.tsx +0 -17
- package/template/stories/js-argtypes.stories.jsx +0 -91
- package/template/stories/react-mdx.stories.mdx +0 -26
- package/template/stories/teardown.stories.tsx +0 -23
- package/template/stories/ts-argtypes.stories.tsx +0 -104
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0-alpha.1",
|
|
4
4
|
"description": "Storybook React renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -42,23 +42,24 @@
|
|
|
42
42
|
"types": "dist/index.d.ts",
|
|
43
43
|
"files": [
|
|
44
44
|
"dist/**/*",
|
|
45
|
-
"template/**/*",
|
|
45
|
+
"template/cli/**/*",
|
|
46
46
|
"README.md",
|
|
47
47
|
"*.js",
|
|
48
|
-
"*.d.ts"
|
|
48
|
+
"*.d.ts",
|
|
49
|
+
"!src/**/*"
|
|
49
50
|
],
|
|
50
51
|
"scripts": {
|
|
51
52
|
"check": "../../../scripts/prepare/check.ts",
|
|
52
53
|
"prep": "../../../scripts/prepare/bundle.ts"
|
|
53
54
|
},
|
|
54
55
|
"dependencies": {
|
|
55
|
-
"@storybook/client-logger": "7.
|
|
56
|
-
"@storybook/core-client": "7.
|
|
57
|
-
"@storybook/docs-tools": "7.
|
|
56
|
+
"@storybook/client-logger": "7.4.0-alpha.1",
|
|
57
|
+
"@storybook/core-client": "7.4.0-alpha.1",
|
|
58
|
+
"@storybook/docs-tools": "7.4.0-alpha.1",
|
|
58
59
|
"@storybook/global": "^5.0.0",
|
|
59
|
-
"@storybook/preview-api": "7.
|
|
60
|
-
"@storybook/react-dom-shim": "7.
|
|
61
|
-
"@storybook/types": "7.
|
|
60
|
+
"@storybook/preview-api": "7.4.0-alpha.1",
|
|
61
|
+
"@storybook/react-dom-shim": "7.4.0-alpha.1",
|
|
62
|
+
"@storybook/types": "7.4.0-alpha.1",
|
|
62
63
|
"@types/escodegen": "^0.0.6",
|
|
63
64
|
"@types/estree": "^0.0.51",
|
|
64
65
|
"@types/node": "^16.0.0",
|
package/src/__test__/README.md
DELETED
package/src/typings.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// TODO: Replace, as soon as @types/react-dom 17.0.14 is used
|
|
2
|
-
// Source: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/fb0f14b7a35cde26ffaa82e7536c062e593e9ae6/types/react-dom/client.d.ts
|
|
3
|
-
declare module 'react-dom/client' {
|
|
4
|
-
import React = require('react');
|
|
5
|
-
|
|
6
|
-
export interface HydrationOptions {
|
|
7
|
-
onHydrated?(suspenseInstance: Comment): void;
|
|
8
|
-
onDeleted?(suspenseInstance: Comment): void;
|
|
9
|
-
/**
|
|
10
|
-
* Prefix for `useId`.
|
|
11
|
-
*/
|
|
12
|
-
identifierPrefix?: string;
|
|
13
|
-
onRecoverableError?: (error: unknown) => void;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface RootOptions {
|
|
17
|
-
/**
|
|
18
|
-
* Prefix for `useId`.
|
|
19
|
-
*/
|
|
20
|
-
identifierPrefix?: string;
|
|
21
|
-
onRecoverableError?: (error: unknown) => void;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface Root {
|
|
25
|
-
render(children: React.ReactChild | Iterable<React.ReactNode>): void;
|
|
26
|
-
unmount(): void;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Replaces `ReactDOM.render` when the `.render` method is called and enables Concurrent Mode.
|
|
31
|
-
*
|
|
32
|
-
* @see https://reactjs.org/docs/concurrent-mode-reference.html#createroot
|
|
33
|
-
*/
|
|
34
|
-
export function createRoot(
|
|
35
|
-
container: Element | Document | DocumentFragment | Comment,
|
|
36
|
-
options?: RootOptions
|
|
37
|
-
): Root;
|
|
38
|
-
|
|
39
|
-
export function hydrateRoot(
|
|
40
|
-
container: Element | Document | DocumentFragment | Comment,
|
|
41
|
-
initialChildren: React.ReactChild | Iterable<React.ReactNode>,
|
|
42
|
-
options?: HydrationOptions
|
|
43
|
-
): Root;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
declare var STORYBOOK_ENV: 'react';
|
|
47
|
-
declare var FRAMEWORK_OPTIONS: any;
|
|
48
|
-
declare var LOGLEVEL: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent' | undefined;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
export const Button = ({ onClick, label }) => (
|
|
5
|
-
<button type="button" onClick={onClick}>
|
|
6
|
-
{label}
|
|
7
|
-
</button>
|
|
8
|
-
);
|
|
9
|
-
|
|
10
|
-
Button.propTypes = {
|
|
11
|
-
onClick: PropTypes.func.isRequired,
|
|
12
|
-
label: PropTypes.string.isRequired,
|
|
13
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
export const Form = ({ onSuccess }) => {
|
|
5
|
-
const [value, setValue] = useState('');
|
|
6
|
-
const [complete, setComplete] = useState(false);
|
|
7
|
-
|
|
8
|
-
function onSubmit(event) {
|
|
9
|
-
event.preventDefault();
|
|
10
|
-
onSuccess(value);
|
|
11
|
-
|
|
12
|
-
setTimeout(() => setComplete(true), 500);
|
|
13
|
-
setTimeout(() => setComplete(false), 1500);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<form id="interaction-test-form" onSubmit={onSubmit}>
|
|
18
|
-
<label>
|
|
19
|
-
Enter Value
|
|
20
|
-
<input
|
|
21
|
-
type="text"
|
|
22
|
-
data-testid="value"
|
|
23
|
-
value={value}
|
|
24
|
-
required
|
|
25
|
-
onChange={(event) => setValue(event.target.value)}
|
|
26
|
-
/>
|
|
27
|
-
</label>
|
|
28
|
-
<button type="submit">Submit</button>
|
|
29
|
-
{complete && <p>Completed!!</p>}
|
|
30
|
-
</form>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
Form.propTypes = {
|
|
35
|
-
onSuccess: PropTypes.func.isRequired,
|
|
36
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
// eslint-disable-next-line react/no-danger
|
|
5
|
-
export const Html = ({ content }) => <div dangerouslySetInnerHTML={{ __html: content }} />;
|
|
6
|
-
|
|
7
|
-
Html.propTypes = {
|
|
8
|
-
content: PropTypes.string.isRequired,
|
|
9
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
export const Pre = ({ style, object, text }) => (
|
|
5
|
-
<pre style={style} data-testid="pre">
|
|
6
|
-
{object ? JSON.stringify(object, null, 2) : text}
|
|
7
|
-
</pre>
|
|
8
|
-
);
|
|
9
|
-
|
|
10
|
-
Pre.propTypes = {
|
|
11
|
-
style: PropTypes.shape({}),
|
|
12
|
-
object: PropTypes.shape({}),
|
|
13
|
-
text: PropTypes.string,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
Pre.defaultProps = {
|
|
17
|
-
style: {},
|
|
18
|
-
object: null,
|
|
19
|
-
text: '',
|
|
20
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
import React, { useContext, createContext } from 'react';
|
|
3
|
-
import type { StoryObj, Meta } from '@storybook/react';
|
|
4
|
-
|
|
5
|
-
const Component: FC = () => <p>Story</p>;
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
component: Component,
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
decorators: [
|
|
11
|
-
(Story) => (
|
|
12
|
-
<>
|
|
13
|
-
<p>Component Decorator</p>
|
|
14
|
-
<Story />
|
|
15
|
-
</>
|
|
16
|
-
),
|
|
17
|
-
],
|
|
18
|
-
} as Meta<typeof Component>;
|
|
19
|
-
|
|
20
|
-
export const All: StoryObj<typeof Component> = {
|
|
21
|
-
decorators: [
|
|
22
|
-
(Story) => (
|
|
23
|
-
<>
|
|
24
|
-
<p>Local Decorator</p>
|
|
25
|
-
<Story />
|
|
26
|
-
</>
|
|
27
|
-
),
|
|
28
|
-
],
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// This story will error if `parameters.docs.source.excludeDecorators` is true:
|
|
32
|
-
// See https://github.com/storybookjs/storybook/issues/21900
|
|
33
|
-
const TestContext = createContext<boolean>(false);
|
|
34
|
-
export const Context: StoryObj<typeof Component> = {
|
|
35
|
-
// parameters: { docs: { source: { excludeDecorators: true } } },
|
|
36
|
-
decorators: [
|
|
37
|
-
(Story) => (
|
|
38
|
-
<TestContext.Provider value>
|
|
39
|
-
<Story />
|
|
40
|
-
</TestContext.Provider>
|
|
41
|
-
),
|
|
42
|
-
],
|
|
43
|
-
render: function Render(args, context) {
|
|
44
|
-
const value = useContext(TestContext);
|
|
45
|
-
if (!value) throw new Error('TestContext not set, decorator did not run!');
|
|
46
|
-
return <p>Story</p>;
|
|
47
|
-
},
|
|
48
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`react component properties 10017-ts-union 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"icon": Object {
|
|
6
|
-
"control": Object {
|
|
7
|
-
"type": "object",
|
|
8
|
-
},
|
|
9
|
-
"description": "specify icon=\\"search\\" or icon={IconComponent}",
|
|
10
|
-
"name": "icon",
|
|
11
|
-
"table": Object {
|
|
12
|
-
"defaultValue": null,
|
|
13
|
-
"jsDocTags": undefined,
|
|
14
|
-
"type": Object {
|
|
15
|
-
"detail": undefined,
|
|
16
|
-
"summary": "union",
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
"type": Object {
|
|
20
|
-
"name": "union",
|
|
21
|
-
"raw": "React.ReactNode | string",
|
|
22
|
-
"required": true,
|
|
23
|
-
"value": Array [
|
|
24
|
-
Object {
|
|
25
|
-
"name": "other",
|
|
26
|
-
"raw": "React.ReactNode",
|
|
27
|
-
"value": "ReactReactNode",
|
|
28
|
-
},
|
|
29
|
-
Object {
|
|
30
|
-
"name": "string",
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`react component properties 10017-ts-union 1`] = `
|
|
4
|
-
"import React from 'react';
|
|
5
|
-
const Avatar = ({
|
|
6
|
-
icon
|
|
7
|
-
}) => {
|
|
8
|
-
return /*#__PURE__*/React.createElement(\\"div\\", {
|
|
9
|
-
className: \\"hello\\"
|
|
10
|
-
}, \\"Hello Component \\", icon);
|
|
11
|
-
};
|
|
12
|
-
export const component = Avatar;
|
|
13
|
-
Avatar.__docgenInfo = {
|
|
14
|
-
\\"description\\": \\"\\",
|
|
15
|
-
\\"methods\\": [],
|
|
16
|
-
\\"displayName\\": \\"Avatar\\",
|
|
17
|
-
\\"props\\": {
|
|
18
|
-
\\"icon\\": {
|
|
19
|
-
\\"required\\": true,
|
|
20
|
-
\\"tsType\\": {
|
|
21
|
-
\\"name\\": \\"union\\",
|
|
22
|
-
\\"raw\\": \\"React.ReactNode | string\\",
|
|
23
|
-
\\"elements\\": [{
|
|
24
|
-
\\"name\\": \\"ReactReactNode\\",
|
|
25
|
-
\\"raw\\": \\"React.ReactNode\\"
|
|
26
|
-
}, {
|
|
27
|
-
\\"name\\": \\"string\\"
|
|
28
|
-
}]
|
|
29
|
-
},
|
|
30
|
-
\\"description\\": \\"specify icon=\\\\\\"search\\\\\\" or icon={IconComponent}\\"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
};"
|
|
34
|
-
`;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
interface AvatarProps {
|
|
4
|
-
/** specify icon="search" or icon={IconComponent} */
|
|
5
|
-
icon: React.ReactNode | string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const Avatar = ({ icon }: AvatarProps) => {
|
|
9
|
-
return <div className="hello">Hello Component {icon}</div>;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const component = Avatar;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`react component properties 10017-ts-union 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"rows": Array [
|
|
6
|
-
Object {
|
|
7
|
-
"defaultValue": null,
|
|
8
|
-
"description": "specify icon=\\"search\\" or icon={IconComponent}",
|
|
9
|
-
"name": "icon",
|
|
10
|
-
"required": true,
|
|
11
|
-
"sbType": Object {
|
|
12
|
-
"name": "union",
|
|
13
|
-
"raw": "React.ReactNode | string",
|
|
14
|
-
"value": Array [
|
|
15
|
-
Object {
|
|
16
|
-
"name": "other",
|
|
17
|
-
"raw": "React.ReactNode",
|
|
18
|
-
"value": "ReactReactNode",
|
|
19
|
-
},
|
|
20
|
-
Object {
|
|
21
|
-
"name": "string",
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
},
|
|
25
|
-
"type": Object {
|
|
26
|
-
"detail": undefined,
|
|
27
|
-
"summary": "union",
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
}
|
|
32
|
-
`;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`react component properties 10278-ts-multiple-components 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"aProperty": Object {
|
|
6
|
-
"control": Object {
|
|
7
|
-
"type": "object",
|
|
8
|
-
},
|
|
9
|
-
"description": "",
|
|
10
|
-
"name": "aProperty",
|
|
11
|
-
"table": Object {
|
|
12
|
-
"defaultValue": null,
|
|
13
|
-
"jsDocTags": undefined,
|
|
14
|
-
"type": Object {
|
|
15
|
-
"detail": undefined,
|
|
16
|
-
"summary": "any",
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
"type": Object {
|
|
20
|
-
"name": "other",
|
|
21
|
-
"required": true,
|
|
22
|
-
"value": "any",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`react component properties 10278-ts-multiple-components 1`] = `
|
|
4
|
-
"/* eslint-disable react/destructuring-assignment */
|
|
5
|
-
import React from 'react';
|
|
6
|
-
/**
|
|
7
|
-
* A component
|
|
8
|
-
*/
|
|
9
|
-
const A = props => {
|
|
10
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, \\"Hi \\", props.aProperty);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* B component
|
|
15
|
-
*/
|
|
16
|
-
const B = props => {
|
|
17
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, \\"Hi \\", props.bProperty);
|
|
18
|
-
};
|
|
19
|
-
A.__docgenInfo = {
|
|
20
|
-
\\"description\\": \\"A component\\",
|
|
21
|
-
\\"methods\\": [],
|
|
22
|
-
\\"displayName\\": \\"A\\",
|
|
23
|
-
\\"props\\": {
|
|
24
|
-
\\"aProperty\\": {
|
|
25
|
-
\\"required\\": true,
|
|
26
|
-
\\"tsType\\": {
|
|
27
|
-
\\"name\\": \\"any\\"
|
|
28
|
-
},
|
|
29
|
-
\\"description\\": \\"\\"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
B.__docgenInfo = {
|
|
34
|
-
\\"description\\": \\"B component\\",
|
|
35
|
-
\\"methods\\": [],
|
|
36
|
-
\\"displayName\\": \\"B\\",
|
|
37
|
-
\\"props\\": {
|
|
38
|
-
\\"bProperty\\": {
|
|
39
|
-
\\"required\\": true,
|
|
40
|
-
\\"tsType\\": {
|
|
41
|
-
\\"name\\": \\"any\\"
|
|
42
|
-
},
|
|
43
|
-
\\"description\\": \\"\\"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
export { A, B };
|
|
48
|
-
export const component = A;"
|
|
49
|
-
`;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/destructuring-assignment */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
interface IAProps {
|
|
5
|
-
aProperty: any;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface IBProps {
|
|
9
|
-
bProperty: any;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* A component
|
|
14
|
-
*/
|
|
15
|
-
const A = (props: IAProps): JSX.Element => {
|
|
16
|
-
return <>Hi {props.aProperty}</>;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* B component
|
|
21
|
-
*/
|
|
22
|
-
const B = (props: IBProps): JSX.Element => {
|
|
23
|
-
return <>Hi {props.bProperty}</>;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export { A, B };
|
|
27
|
-
export const component = A;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`react component properties 10278-ts-multiple-components 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"rows": Array [
|
|
6
|
-
Object {
|
|
7
|
-
"defaultValue": null,
|
|
8
|
-
"description": "",
|
|
9
|
-
"name": "aProperty",
|
|
10
|
-
"required": true,
|
|
11
|
-
"sbType": Object {
|
|
12
|
-
"name": "other",
|
|
13
|
-
"value": "any",
|
|
14
|
-
},
|
|
15
|
-
"type": Object {
|
|
16
|
-
"detail": undefined,
|
|
17
|
-
"summary": "any",
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`react component properties 8140-js-prop-types-oneof 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"blank": Object {
|
|
6
|
-
"control": Object {
|
|
7
|
-
"type": "boolean",
|
|
8
|
-
},
|
|
9
|
-
"description": "No background or border if static alert",
|
|
10
|
-
"name": "blank",
|
|
11
|
-
"table": Object {
|
|
12
|
-
"defaultValue": null,
|
|
13
|
-
"jsDocTags": undefined,
|
|
14
|
-
"type": Object {
|
|
15
|
-
"detail": undefined,
|
|
16
|
-
"summary": "bool",
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
"type": Object {
|
|
20
|
-
"name": "boolean",
|
|
21
|
-
"required": false,
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
"icon": Object {
|
|
25
|
-
"control": Object {
|
|
26
|
-
"type": "text",
|
|
27
|
-
},
|
|
28
|
-
"description": "Allows icon override, accepts material icon name",
|
|
29
|
-
"name": "icon",
|
|
30
|
-
"table": Object {
|
|
31
|
-
"defaultValue": null,
|
|
32
|
-
"jsDocTags": undefined,
|
|
33
|
-
"type": Object {
|
|
34
|
-
"detail": undefined,
|
|
35
|
-
"summary": "string",
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
"type": Object {
|
|
39
|
-
"name": "string",
|
|
40
|
-
"required": false,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
"message": Object {
|
|
44
|
-
"control": Object {
|
|
45
|
-
"type": "text",
|
|
46
|
-
},
|
|
47
|
-
"description": "",
|
|
48
|
-
"name": "message",
|
|
49
|
-
"table": Object {
|
|
50
|
-
"defaultValue": null,
|
|
51
|
-
"jsDocTags": undefined,
|
|
52
|
-
"type": Object {
|
|
53
|
-
"detail": undefined,
|
|
54
|
-
"summary": "string",
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
"type": Object {
|
|
58
|
-
"name": "string",
|
|
59
|
-
"required": true,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
"mode": Object {
|
|
63
|
-
"control": Object {
|
|
64
|
-
"type": "radio",
|
|
65
|
-
},
|
|
66
|
-
"description": "",
|
|
67
|
-
"name": "mode",
|
|
68
|
-
"options": Array [
|
|
69
|
-
"static",
|
|
70
|
-
"timed",
|
|
71
|
-
],
|
|
72
|
-
"table": Object {
|
|
73
|
-
"defaultValue": Object {
|
|
74
|
-
"detail": undefined,
|
|
75
|
-
"summary": "'static'",
|
|
76
|
-
},
|
|
77
|
-
"jsDocTags": undefined,
|
|
78
|
-
"type": Object {
|
|
79
|
-
"detail": undefined,
|
|
80
|
-
"summary": "'static' | 'timed'",
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
"type": Object {
|
|
84
|
-
"name": "enum",
|
|
85
|
-
"required": false,
|
|
86
|
-
"value": Array [
|
|
87
|
-
"static",
|
|
88
|
-
"timed",
|
|
89
|
-
],
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
"type": Object {
|
|
93
|
-
"control": Object {
|
|
94
|
-
"type": "radio",
|
|
95
|
-
},
|
|
96
|
-
"description": "",
|
|
97
|
-
"name": "type",
|
|
98
|
-
"options": Array [
|
|
99
|
-
"success",
|
|
100
|
-
"warning",
|
|
101
|
-
"error",
|
|
102
|
-
"primary",
|
|
103
|
-
],
|
|
104
|
-
"table": Object {
|
|
105
|
-
"defaultValue": Object {
|
|
106
|
-
"detail": undefined,
|
|
107
|
-
"summary": "'warning'",
|
|
108
|
-
},
|
|
109
|
-
"jsDocTags": undefined,
|
|
110
|
-
"type": Object {
|
|
111
|
-
"detail": undefined,
|
|
112
|
-
"summary": "'success' | 'warning' | 'error' | 'primary'",
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
"type": Object {
|
|
116
|
-
"name": "enum",
|
|
117
|
-
"required": false,
|
|
118
|
-
"value": Array [
|
|
119
|
-
"success",
|
|
120
|
-
"warning",
|
|
121
|
-
"error",
|
|
122
|
-
"primary",
|
|
123
|
-
],
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
}
|
|
127
|
-
`;
|