@storybook/react 7.0.0-alpha.8 → 7.0.0-beta.0
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/chunk-LSK4KSW4.mjs +1 -0
- package/dist/config.d.ts +11 -13
- package/dist/config.js +3 -7
- package/dist/config.mjs +3 -7
- package/dist/index.d.ts +57 -37
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types-0a347bb9.d.ts +10 -0
- package/jest.config.js +7 -0
- package/package.json +27 -22
- package/template/cli/.eslintrc.json +5 -0
- package/template/cli/js/Button.jsx +50 -0
- package/template/cli/js/Button.stories.js +39 -0
- package/template/cli/js/Header.jsx +59 -0
- package/template/cli/js/Header.stories.js +22 -0
- package/template/cli/js/Page.jsx +69 -0
- package/template/cli/js/Page.stories.js +25 -0
- package/template/cli/ts/Button.stories.ts +44 -0
- package/template/cli/ts/Button.tsx +48 -0
- package/template/cli/ts/Header.stories.ts +26 -0
- package/template/cli/ts/Header.tsx +56 -0
- package/template/cli/ts/Page.stories.ts +29 -0
- package/template/cli/ts/Page.tsx +73 -0
- package/template/cli/ts-legacy/Button.stories.ts +45 -0
- package/template/cli/ts-legacy/Button.tsx +48 -0
- package/template/cli/ts-legacy/Header.stories.ts +24 -0
- package/template/cli/ts-legacy/Header.tsx +56 -0
- package/template/cli/ts-legacy/Page.stories.ts +29 -0
- package/template/cli/ts-legacy/Page.tsx +73 -0
- package/template/components/Button.jsx +13 -0
- package/template/components/Form.jsx +36 -0
- package/template/components/Html.jsx +9 -0
- package/template/components/Pre.jsx +20 -0
- package/template/components/index.js +9 -0
- package/template/stories/decorators.stories.tsx +28 -0
- package/template/stories/docgen-components/10017-ts-union/argTypes.snapshot +36 -0
- package/template/stories/docgen-components/10017-ts-union/docgen.snapshot +34 -0
- package/template/stories/docgen-components/10017-ts-union/input.tsx +12 -0
- package/template/stories/docgen-components/10017-ts-union/properties.snapshot +32 -0
- package/template/stories/docgen-components/10278-ts-multiple-components/argTypes.snapshot +26 -0
- package/template/stories/docgen-components/10278-ts-multiple-components/docgen.snapshot +49 -0
- package/template/stories/docgen-components/10278-ts-multiple-components/input.tsx +27 -0
- package/template/stories/docgen-components/10278-ts-multiple-components/properties.snapshot +22 -0
- package/template/stories/docgen-components/8140-js-prop-types-oneof/argTypes.snapshot +127 -0
- package/template/stories/docgen-components/8140-js-prop-types-oneof/docgen.snapshot +97 -0
- package/template/stories/docgen-components/8140-js-prop-types-oneof/input.jsx +27 -0
- package/template/stories/docgen-components/8140-js-prop-types-oneof/properties.snapshot +89 -0
- package/template/stories/docgen-components/8143-ts-imported-types/argTypes.snapshot +27 -0
- package/template/stories/docgen-components/8143-ts-imported-types/docgen.snapshot +22 -0
- package/template/stories/docgen-components/8143-ts-imported-types/input.tsx +10 -0
- package/template/stories/docgen-components/8143-ts-imported-types/properties.snapshot +23 -0
- package/template/stories/docgen-components/8143-ts-imported-types/types.ts +3 -0
- package/template/stories/docgen-components/8143-ts-react-fc-generics/argTypes.snapshot +27 -0
- package/template/stories/docgen-components/8143-ts-react-fc-generics/docgen.snapshot +24 -0
- package/template/stories/docgen-components/8143-ts-react-fc-generics/input.tsx +10 -0
- package/template/stories/docgen-components/8143-ts-react-fc-generics/properties.snapshot +21 -0
- package/template/stories/docgen-components/8428-js-static-prop-types/argTypes.snapshot +25 -0
- package/template/stories/docgen-components/8428-js-static-prop-types/docgen.snapshot +39 -0
- package/template/stories/docgen-components/8428-js-static-prop-types/input.jsx +20 -0
- package/template/stories/docgen-components/8428-js-static-prop-types/properties.snapshot +21 -0
- package/template/stories/docgen-components/8740-ts-multi-props/argTypes.snapshot +27 -0
- package/template/stories/docgen-components/8740-ts-multi-props/docgen.snapshot +49 -0
- package/template/stories/docgen-components/8740-ts-multi-props/input.tsx +23 -0
- package/template/stories/docgen-components/8740-ts-multi-props/properties.snapshot +21 -0
- package/template/stories/docgen-components/8894-9511-ts-forward-ref/argTypes.snapshot +48 -0
- package/template/stories/docgen-components/8894-9511-ts-forward-ref/docgen.snapshot +39 -0
- package/template/stories/docgen-components/8894-9511-ts-forward-ref/input.tsx +31 -0
- package/template/stories/docgen-components/8894-9511-ts-forward-ref/properties.snapshot +34 -0
- package/template/stories/docgen-components/9023-js-hoc/argTypes.snapshot +89 -0
- package/template/stories/docgen-components/9023-js-hoc/docgen.snapshot +84 -0
- package/template/stories/docgen-components/9023-js-hoc/input.jsx +40 -0
- package/template/stories/docgen-components/9023-js-hoc/properties.snapshot +67 -0
- package/template/stories/docgen-components/9399-js-proptypes-shape/argTypes.snapshot +39 -0
- package/template/stories/docgen-components/9399-js-proptypes-shape/docgen.snapshot +48 -0
- package/template/stories/docgen-components/9399-js-proptypes-shape/input.jsx +16 -0
- package/template/stories/docgen-components/9399-js-proptypes-shape/properties.snapshot +35 -0
- package/template/stories/docgen-components/9465-ts-type-props/argTypes.snapshot +28 -0
- package/template/stories/docgen-components/9465-ts-type-props/docgen.snapshot +33 -0
- package/template/stories/docgen-components/9465-ts-type-props/input.tsx +12 -0
- package/template/stories/docgen-components/9465-ts-type-props/properties.snapshot +24 -0
- package/template/stories/docgen-components/9493-ts-display-name/argTypes.snapshot +62 -0
- package/template/stories/docgen-components/9493-ts-display-name/docgen.snapshot +50 -0
- package/template/stories/docgen-components/9493-ts-display-name/input.tsx +30 -0
- package/template/stories/docgen-components/9493-ts-display-name/properties.snapshot +52 -0
- package/template/stories/docgen-components/9556-ts-react-default-exports/argTypes.snapshot +28 -0
- package/template/stories/docgen-components/9556-ts-react-default-exports/docgen.snapshot +32 -0
- package/template/stories/docgen-components/9556-ts-react-default-exports/input.tsx +12 -0
- package/template/stories/docgen-components/9556-ts-react-default-exports/properties.snapshot +24 -0
- package/template/stories/docgen-components/9575-ts-camel-case/argTypes.snapshot +28 -0
- package/template/stories/docgen-components/9575-ts-camel-case/docgen.snapshot +38 -0
- package/template/stories/docgen-components/9575-ts-camel-case/input.tsx +26 -0
- package/template/stories/docgen-components/9575-ts-camel-case/properties.snapshot +24 -0
- package/template/stories/docgen-components/9586-js-react-memo/argTypes.snapshot +41 -0
- package/template/stories/docgen-components/9586-js-react-memo/docgen.snapshot +42 -0
- package/template/stories/docgen-components/9586-js-react-memo/input.jsx +15 -0
- package/template/stories/docgen-components/9586-js-react-memo/properties.snapshot +34 -0
- package/template/stories/docgen-components/9591-ts-import-types/Bar.tsx +3 -0
- package/template/stories/docgen-components/9591-ts-import-types/argTypes.snapshot +25 -0
- package/template/stories/docgen-components/9591-ts-import-types/docgen.snapshot +21 -0
- package/template/stories/docgen-components/9591-ts-import-types/input.tsx +10 -0
- package/template/stories/docgen-components/9591-ts-import-types/properties.snapshot +21 -0
- package/template/stories/docgen-components/9626-js-default-values/argTypes.snapshot +27 -0
- package/template/stories/docgen-components/9626-js-default-values/docgen.snapshot +25 -0
- package/template/stories/docgen-components/9626-js-default-values/input.jsx +5 -0
- package/template/stories/docgen-components/9626-js-default-values/properties.snapshot +21 -0
- package/template/stories/docgen-components/9668-js-proptypes-no-jsdoc/argTypes.snapshot +42 -0
- package/template/stories/docgen-components/9668-js-proptypes-no-jsdoc/docgen.snapshot +36 -0
- package/template/stories/docgen-components/9668-js-proptypes-no-jsdoc/input.jsx +13 -0
- package/template/stories/docgen-components/9668-js-proptypes-no-jsdoc/properties.snapshot +35 -0
- package/template/stories/docgen-components/9721-ts-deprecated-jsdoc/argTypes.snapshot +53 -0
- package/template/stories/docgen-components/9721-ts-deprecated-jsdoc/docgen.snapshot +45 -0
- package/template/stories/docgen-components/9721-ts-deprecated-jsdoc/input.tsx +18 -0
- package/template/stories/docgen-components/9721-ts-deprecated-jsdoc/properties.snapshot +43 -0
- package/template/stories/docgen-components/9764-ts-extend-props/argTypes.snapshot +72 -0
- package/template/stories/docgen-components/9764-ts-extend-props/docgen.snapshot +41 -0
- package/template/stories/docgen-components/9764-ts-extend-props/input.tsx +17 -0
- package/template/stories/docgen-components/9764-ts-extend-props/properties.snapshot +56 -0
- package/template/stories/docgen-components/9827-ts-default-values/argTypes.snapshot +72 -0
- package/template/stories/docgen-components/9827-ts-default-values/docgen.snapshot +52 -0
- package/template/stories/docgen-components/9827-ts-default-values/input.tsx +17 -0
- package/template/stories/docgen-components/9827-ts-default-values/properties.snapshot +56 -0
- package/template/stories/docgen-components/9832-ts-enum-export/argTypes.snapshot +3 -0
- package/template/stories/docgen-components/9832-ts-enum-export/docgen.snapshot +16 -0
- package/template/stories/docgen-components/9832-ts-enum-export/input.tsx +8 -0
- package/template/stories/docgen-components/9832-ts-enum-export/properties.snapshot +7 -0
- package/template/stories/docgen-components/9922-ts-component-props/argTypes.snapshot +25 -0
- package/template/stories/docgen-components/9922-ts-component-props/docgen.snapshot +35 -0
- package/template/stories/docgen-components/9922-ts-component-props/input.tsx +24 -0
- package/template/stories/docgen-components/9922-ts-component-props/properties.snapshot +21 -0
- package/template/stories/docgen-components/imported.js +1 -0
- package/template/stories/docgen-components/js-class-component/argTypes.snapshot +386 -0
- package/template/stories/docgen-components/js-class-component/docgen.snapshot +252 -0
- package/template/stories/docgen-components/js-class-component/input.jsx +57 -0
- package/template/stories/docgen-components/js-class-component/properties.snapshot +286 -0
- package/template/stories/docgen-components/js-function-component/argTypes.snapshot +386 -0
- package/template/stories/docgen-components/js-function-component/docgen.snapshot +236 -0
- package/template/stories/docgen-components/js-function-component/input.jsx +50 -0
- package/template/stories/docgen-components/js-function-component/properties.snapshot +286 -0
- package/template/stories/docgen-components/js-function-component-inline-defaults/argTypes.snapshot +386 -0
- package/template/stories/docgen-components/js-function-component-inline-defaults/docgen.snapshot +247 -0
- package/template/stories/docgen-components/js-function-component-inline-defaults/input.jsx +65 -0
- package/template/stories/docgen-components/js-function-component-inline-defaults/properties.snapshot +286 -0
- package/template/stories/docgen-components/js-function-component-inline-defaults-no-propTypes/argTypes.snapshot +237 -0
- package/template/stories/docgen-components/js-function-component-inline-defaults-no-propTypes/docgen.snapshot +124 -0
- package/template/stories/docgen-components/js-function-component-inline-defaults-no-propTypes/input.jsx +41 -0
- package/template/stories/docgen-components/js-function-component-inline-defaults-no-propTypes/properties.snapshot +151 -0
- package/template/stories/docgen-components/js-proptypes/docgen.snapshot +1770 -0
- package/template/stories/docgen-components/js-proptypes/ext.js +13 -0
- package/template/stories/docgen-components/js-proptypes/input.jsx +497 -0
- package/template/stories/docgen-components/jsdoc/argTypes.snapshot +969 -0
- package/template/stories/docgen-components/jsdoc/docgen.snapshot +548 -0
- package/template/stories/docgen-components/jsdoc/input.jsx +231 -0
- package/template/stories/docgen-components/jsdoc/properties.snapshot +857 -0
- package/template/stories/docgen-components/ts-function-component/argTypes.snapshot +396 -0
- package/template/stories/docgen-components/ts-function-component/docgen.snapshot +241 -0
- package/template/stories/docgen-components/ts-function-component/input.tsx +52 -0
- package/template/stories/docgen-components/ts-function-component/properties.snapshot +296 -0
- package/template/stories/docgen-components/ts-function-component-inline-defaults/argTypes.snapshot +279 -0
- package/template/stories/docgen-components/ts-function-component-inline-defaults/docgen.snapshot +151 -0
- package/template/stories/docgen-components/ts-function-component-inline-defaults/input.tsx +80 -0
- package/template/stories/docgen-components/ts-function-component-inline-defaults/properties.snapshot +177 -0
- package/template/stories/docgen-components/ts-html/argTypes.snapshot +3 -0
- package/template/stories/docgen-components/ts-html/docgen.snapshot +12 -0
- package/template/stories/docgen-components/ts-html/input.tsx +12 -0
- package/template/stories/docgen-components/ts-html/properties.snapshot +7 -0
- package/template/stories/docgen-components/ts-jsdoc/argTypes.snapshot +3 -0
- package/template/stories/docgen-components/ts-jsdoc/docgen.snapshot +21 -0
- package/template/stories/docgen-components/ts-jsdoc/input.tsx +27 -0
- package/template/stories/docgen-components/ts-jsdoc/properties.snapshot +7 -0
- package/template/stories/docgen-components/ts-types/argTypes.snapshot +656 -0
- package/template/stories/docgen-components/ts-types/docgen.snapshot +317 -0
- package/template/stories/docgen-components/ts-types/input.tsx +130 -0
- package/template/stories/docgen-components/ts-types/properties.snapshot +410 -0
- package/template/stories/errors.stories.tsx +37 -0
- package/template/stories/hooks.stories.tsx +17 -0
- package/template/stories/js-argtypes.stories.jsx +91 -0
- package/template/stories/react-mdx.stories.mdx +26 -0
- package/template/stories/ts-argtypes.stories.tsx +81 -0
- package/LICENSE +0 -21
- package/dist/chunk-DGYCFUMN.mjs +0 -1
- package/dist/types-9f8d440a.d.ts +0 -17
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`react component properties 9465-ts-type-props 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"disabled": Object {
|
|
6
|
+
"control": Object {
|
|
7
|
+
"type": "boolean",
|
|
8
|
+
},
|
|
9
|
+
"description": "",
|
|
10
|
+
"name": "disabled",
|
|
11
|
+
"table": Object {
|
|
12
|
+
"defaultValue": Object {
|
|
13
|
+
"detail": undefined,
|
|
14
|
+
"summary": "false",
|
|
15
|
+
},
|
|
16
|
+
"jsDocTags": undefined,
|
|
17
|
+
"type": Object {
|
|
18
|
+
"detail": undefined,
|
|
19
|
+
"summary": "boolean",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
"type": Object {
|
|
23
|
+
"name": "boolean",
|
|
24
|
+
"required": false,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`react component properties 9465-ts-type-props 1`] = `
|
|
4
|
+
"import React from 'react';
|
|
5
|
+
const Component = ({
|
|
6
|
+
disabled = false,
|
|
7
|
+
children
|
|
8
|
+
}) =>
|
|
9
|
+
/*#__PURE__*/
|
|
10
|
+
// eslint-disable-next-line react/button-has-type
|
|
11
|
+
React.createElement(\\"button\\", {
|
|
12
|
+
disabled: disabled
|
|
13
|
+
}, children);
|
|
14
|
+
export const component = Component;
|
|
15
|
+
Component.__docgenInfo = {
|
|
16
|
+
\\"description\\": \\"\\",
|
|
17
|
+
\\"methods\\": [],
|
|
18
|
+
\\"displayName\\": \\"Component\\",
|
|
19
|
+
\\"props\\": {
|
|
20
|
+
\\"disabled\\": {
|
|
21
|
+
\\"defaultValue\\": {
|
|
22
|
+
\\"value\\": \\"false\\",
|
|
23
|
+
\\"computed\\": false
|
|
24
|
+
},
|
|
25
|
+
\\"required\\": false,
|
|
26
|
+
\\"tsType\\": {
|
|
27
|
+
\\"name\\": \\"boolean\\"
|
|
28
|
+
},
|
|
29
|
+
\\"description\\": \\"\\"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};"
|
|
33
|
+
`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type Props = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const Component = ({ disabled = false, children }: Props) => (
|
|
8
|
+
// eslint-disable-next-line react/button-has-type
|
|
9
|
+
<button disabled={disabled}>{children}</button>
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
export const component = Component;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`react component properties 9465-ts-type-props 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"rows": Array [
|
|
6
|
+
Object {
|
|
7
|
+
"defaultValue": Object {
|
|
8
|
+
"detail": undefined,
|
|
9
|
+
"summary": "false",
|
|
10
|
+
},
|
|
11
|
+
"description": "",
|
|
12
|
+
"name": "disabled",
|
|
13
|
+
"required": false,
|
|
14
|
+
"sbType": Object {
|
|
15
|
+
"name": "boolean",
|
|
16
|
+
},
|
|
17
|
+
"type": Object {
|
|
18
|
+
"detail": undefined,
|
|
19
|
+
"summary": "boolean",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`react component properties 9493-ts-display-name 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"message": Object {
|
|
6
|
+
"control": Object {
|
|
7
|
+
"type": "text",
|
|
8
|
+
},
|
|
9
|
+
"description": "A message alerting about Empire activities.",
|
|
10
|
+
"name": "message",
|
|
11
|
+
"table": Object {
|
|
12
|
+
"defaultValue": null,
|
|
13
|
+
"jsDocTags": undefined,
|
|
14
|
+
"type": Object {
|
|
15
|
+
"detail": undefined,
|
|
16
|
+
"summary": "string",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
"type": Object {
|
|
20
|
+
"name": "string",
|
|
21
|
+
"required": true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
"title": Object {
|
|
25
|
+
"control": Object {
|
|
26
|
+
"type": "object",
|
|
27
|
+
},
|
|
28
|
+
"description": "A title that brings attention to the alert.",
|
|
29
|
+
"name": "title",
|
|
30
|
+
"table": Object {
|
|
31
|
+
"defaultValue": Object {
|
|
32
|
+
"detail": undefined,
|
|
33
|
+
"summary": "'Code Yellow'",
|
|
34
|
+
},
|
|
35
|
+
"jsDocTags": undefined,
|
|
36
|
+
"type": Object {
|
|
37
|
+
"detail": undefined,
|
|
38
|
+
"summary": "union",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
"type": Object {
|
|
42
|
+
"name": "union",
|
|
43
|
+
"raw": "'Code Red' | 'Code Yellow' | 'Code Green'",
|
|
44
|
+
"required": false,
|
|
45
|
+
"value": Array [
|
|
46
|
+
Object {
|
|
47
|
+
"name": "other",
|
|
48
|
+
"value": "literal",
|
|
49
|
+
},
|
|
50
|
+
Object {
|
|
51
|
+
"name": "other",
|
|
52
|
+
"value": "literal",
|
|
53
|
+
},
|
|
54
|
+
Object {
|
|
55
|
+
"name": "other",
|
|
56
|
+
"value": "literal",
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`react component properties 9493-ts-display-name 1`] = `
|
|
4
|
+
"import React from 'react';
|
|
5
|
+
/**
|
|
6
|
+
* This message should show up in the Docs panel if everything works fine.
|
|
7
|
+
*/
|
|
8
|
+
export const EmpireAlert = ({
|
|
9
|
+
title = 'Code Yellow',
|
|
10
|
+
message
|
|
11
|
+
}) => /*#__PURE__*/React.createElement(\\"div\\", null, /*#__PURE__*/React.createElement(\\"h1\\", null, title), /*#__PURE__*/React.createElement(\\"p\\", null, message));
|
|
12
|
+
EmpireAlert.displayName = 'SomeOtherDisplayName';
|
|
13
|
+
export const component = EmpireAlert;
|
|
14
|
+
EmpireAlert.__docgenInfo = {
|
|
15
|
+
\\"description\\": \\"This message should show up in the Docs panel if everything works fine.\\",
|
|
16
|
+
\\"methods\\": [],
|
|
17
|
+
\\"displayName\\": \\"SomeOtherDisplayName\\",
|
|
18
|
+
\\"props\\": {
|
|
19
|
+
\\"title\\": {
|
|
20
|
+
\\"defaultValue\\": {
|
|
21
|
+
\\"value\\": \\"'Code Yellow'\\",
|
|
22
|
+
\\"computed\\": false
|
|
23
|
+
},
|
|
24
|
+
\\"required\\": false,
|
|
25
|
+
\\"tsType\\": {
|
|
26
|
+
\\"name\\": \\"union\\",
|
|
27
|
+
\\"raw\\": \\"'Code Red' | 'Code Yellow' | 'Code Green'\\",
|
|
28
|
+
\\"elements\\": [{
|
|
29
|
+
\\"name\\": \\"literal\\",
|
|
30
|
+
\\"value\\": \\"'Code Red'\\"
|
|
31
|
+
}, {
|
|
32
|
+
\\"name\\": \\"literal\\",
|
|
33
|
+
\\"value\\": \\"'Code Yellow'\\"
|
|
34
|
+
}, {
|
|
35
|
+
\\"name\\": \\"literal\\",
|
|
36
|
+
\\"value\\": \\"'Code Green'\\"
|
|
37
|
+
}]
|
|
38
|
+
},
|
|
39
|
+
\\"description\\": \\"A title that brings attention to the alert.\\"
|
|
40
|
+
},
|
|
41
|
+
\\"message\\": {
|
|
42
|
+
\\"required\\": true,
|
|
43
|
+
\\"tsType\\": {
|
|
44
|
+
\\"name\\": \\"string\\"
|
|
45
|
+
},
|
|
46
|
+
\\"description\\": \\"A message alerting about Empire activities.\\"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};"
|
|
50
|
+
`;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type AlertCode = 'Code Red' | 'Code Yellow' | 'Code Green';
|
|
4
|
+
|
|
5
|
+
export interface EmpireAlertProps {
|
|
6
|
+
/**
|
|
7
|
+
* A title that brings attention to the alert.
|
|
8
|
+
*/
|
|
9
|
+
title: AlertCode;
|
|
10
|
+
/**
|
|
11
|
+
* A message alerting about Empire activities.
|
|
12
|
+
*/
|
|
13
|
+
message: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This message should show up in the Docs panel if everything works fine.
|
|
18
|
+
*/
|
|
19
|
+
export const EmpireAlert: React.FC<EmpireAlertProps> = ({
|
|
20
|
+
title = 'Code Yellow',
|
|
21
|
+
message,
|
|
22
|
+
}: EmpireAlertProps) => (
|
|
23
|
+
<div>
|
|
24
|
+
<h1>{title}</h1>
|
|
25
|
+
<p>{message}</p>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
EmpireAlert.displayName = 'SomeOtherDisplayName';
|
|
29
|
+
|
|
30
|
+
export const component = EmpireAlert;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`react component properties 9493-ts-display-name 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"rows": Array [
|
|
6
|
+
Object {
|
|
7
|
+
"defaultValue": Object {
|
|
8
|
+
"detail": undefined,
|
|
9
|
+
"summary": "'Code Yellow'",
|
|
10
|
+
},
|
|
11
|
+
"description": "A title that brings attention to the alert.",
|
|
12
|
+
"name": "title",
|
|
13
|
+
"required": false,
|
|
14
|
+
"sbType": Object {
|
|
15
|
+
"name": "union",
|
|
16
|
+
"raw": "'Code Red' | 'Code Yellow' | 'Code Green'",
|
|
17
|
+
"value": Array [
|
|
18
|
+
Object {
|
|
19
|
+
"name": "other",
|
|
20
|
+
"value": "literal",
|
|
21
|
+
},
|
|
22
|
+
Object {
|
|
23
|
+
"name": "other",
|
|
24
|
+
"value": "literal",
|
|
25
|
+
},
|
|
26
|
+
Object {
|
|
27
|
+
"name": "other",
|
|
28
|
+
"value": "literal",
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
"type": Object {
|
|
33
|
+
"detail": undefined,
|
|
34
|
+
"summary": "union",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
Object {
|
|
38
|
+
"defaultValue": null,
|
|
39
|
+
"description": "A message alerting about Empire activities.",
|
|
40
|
+
"name": "message",
|
|
41
|
+
"required": true,
|
|
42
|
+
"sbType": Object {
|
|
43
|
+
"name": "string",
|
|
44
|
+
},
|
|
45
|
+
"type": Object {
|
|
46
|
+
"detail": undefined,
|
|
47
|
+
"summary": "string",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`react component properties 9556-ts-react-default-exports 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"isDisabled": Object {
|
|
6
|
+
"control": Object {
|
|
7
|
+
"type": "boolean",
|
|
8
|
+
},
|
|
9
|
+
"description": "",
|
|
10
|
+
"name": "isDisabled",
|
|
11
|
+
"table": Object {
|
|
12
|
+
"defaultValue": Object {
|
|
13
|
+
"detail": undefined,
|
|
14
|
+
"summary": "false",
|
|
15
|
+
},
|
|
16
|
+
"jsDocTags": undefined,
|
|
17
|
+
"type": Object {
|
|
18
|
+
"detail": undefined,
|
|
19
|
+
"summary": "boolean",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
"type": Object {
|
|
23
|
+
"name": "boolean",
|
|
24
|
+
"required": false,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`react component properties 9556-ts-react-default-exports 1`] = `
|
|
4
|
+
"function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
+
/* eslint-disable react/button-has-type */
|
|
6
|
+
import React from 'react';
|
|
7
|
+
export const Button = ({
|
|
8
|
+
isDisabled = false,
|
|
9
|
+
...props
|
|
10
|
+
}) => /*#__PURE__*/React.createElement(\\"button\\", _extends({
|
|
11
|
+
disabled: isDisabled
|
|
12
|
+
}, props));
|
|
13
|
+
export const component = Button;
|
|
14
|
+
Button.__docgenInfo = {
|
|
15
|
+
\\"description\\": \\"\\",
|
|
16
|
+
\\"methods\\": [],
|
|
17
|
+
\\"displayName\\": \\"Button\\",
|
|
18
|
+
\\"props\\": {
|
|
19
|
+
\\"isDisabled\\": {
|
|
20
|
+
\\"defaultValue\\": {
|
|
21
|
+
\\"value\\": \\"false\\",
|
|
22
|
+
\\"computed\\": false
|
|
23
|
+
},
|
|
24
|
+
\\"required\\": false,
|
|
25
|
+
\\"tsType\\": {
|
|
26
|
+
\\"name\\": \\"boolean\\"
|
|
27
|
+
},
|
|
28
|
+
\\"description\\": \\"\\"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};"
|
|
32
|
+
`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* eslint-disable react/button-has-type */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
export interface Props extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const Button: React.FC<Props> = ({ isDisabled = false, ...props }: Props) => (
|
|
9
|
+
<button disabled={isDisabled} {...props} />
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
export const component = Button;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`react component properties 9556-ts-react-default-exports 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"rows": Array [
|
|
6
|
+
Object {
|
|
7
|
+
"defaultValue": Object {
|
|
8
|
+
"detail": undefined,
|
|
9
|
+
"summary": "false",
|
|
10
|
+
},
|
|
11
|
+
"description": "",
|
|
12
|
+
"name": "isDisabled",
|
|
13
|
+
"required": false,
|
|
14
|
+
"sbType": Object {
|
|
15
|
+
"name": "boolean",
|
|
16
|
+
},
|
|
17
|
+
"type": Object {
|
|
18
|
+
"detail": undefined,
|
|
19
|
+
"summary": "boolean",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`react component properties 9575-ts-camel-case 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"color": Object {
|
|
6
|
+
"control": Object {
|
|
7
|
+
"type": "text",
|
|
8
|
+
},
|
|
9
|
+
"description": "",
|
|
10
|
+
"name": "color",
|
|
11
|
+
"table": Object {
|
|
12
|
+
"defaultValue": Object {
|
|
13
|
+
"detail": undefined,
|
|
14
|
+
"summary": "'primary'",
|
|
15
|
+
},
|
|
16
|
+
"jsDocTags": undefined,
|
|
17
|
+
"type": Object {
|
|
18
|
+
"detail": undefined,
|
|
19
|
+
"summary": "string",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
"type": Object {
|
|
23
|
+
"name": "string",
|
|
24
|
+
"required": false,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`react component properties 9575-ts-camel-case 1`] = `
|
|
4
|
+
"import PropTypes from 'prop-types';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
const iconButton = function IconButton(props) {
|
|
7
|
+
return /*#__PURE__*/React.createElement(\\"div\\", {
|
|
8
|
+
className: \\"icon-button\\"
|
|
9
|
+
}, \\"icon-button\\");
|
|
10
|
+
};
|
|
11
|
+
iconButton.propTypes = {
|
|
12
|
+
// deepscan-disable-next-line
|
|
13
|
+
color: PropTypes.string
|
|
14
|
+
};
|
|
15
|
+
iconButton.defaultProps = {
|
|
16
|
+
color: 'primary'
|
|
17
|
+
};
|
|
18
|
+
iconButton.__docgenInfo = {
|
|
19
|
+
\\"description\\": \\"\\",
|
|
20
|
+
\\"methods\\": [],
|
|
21
|
+
\\"displayName\\": \\"iconButton\\",
|
|
22
|
+
\\"props\\": {
|
|
23
|
+
\\"color\\": {
|
|
24
|
+
\\"defaultValue\\": {
|
|
25
|
+
\\"value\\": \\"'primary'\\",
|
|
26
|
+
\\"computed\\": false
|
|
27
|
+
},
|
|
28
|
+
\\"description\\": \\"\\",
|
|
29
|
+
\\"type\\": {
|
|
30
|
+
\\"name\\": \\"string\\"
|
|
31
|
+
},
|
|
32
|
+
\\"required\\": false
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
export default iconButton;
|
|
37
|
+
export const component = iconButton;"
|
|
38
|
+
`;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
export interface IProps {
|
|
6
|
+
/**
|
|
7
|
+
* button color
|
|
8
|
+
*/
|
|
9
|
+
color?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const iconButton: FC<IProps> = function IconButton(props) {
|
|
13
|
+
return <div className="icon-button">icon-button</div>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
iconButton.propTypes = {
|
|
17
|
+
// deepscan-disable-next-line
|
|
18
|
+
color: PropTypes.string,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
iconButton.defaultProps = {
|
|
22
|
+
color: 'primary',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default iconButton;
|
|
26
|
+
export const component = iconButton;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`react component properties 9575-ts-camel-case 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"rows": Array [
|
|
6
|
+
Object {
|
|
7
|
+
"defaultValue": Object {
|
|
8
|
+
"detail": undefined,
|
|
9
|
+
"summary": "'primary'",
|
|
10
|
+
},
|
|
11
|
+
"description": "",
|
|
12
|
+
"name": "color",
|
|
13
|
+
"required": false,
|
|
14
|
+
"sbType": Object {
|
|
15
|
+
"name": "string",
|
|
16
|
+
},
|
|
17
|
+
"type": Object {
|
|
18
|
+
"detail": undefined,
|
|
19
|
+
"summary": "string",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`react component properties 9586-js-react-memo 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"label": Object {
|
|
6
|
+
"control": Object {
|
|
7
|
+
"type": "text",
|
|
8
|
+
},
|
|
9
|
+
"description": "",
|
|
10
|
+
"name": "label",
|
|
11
|
+
"table": Object {
|
|
12
|
+
"defaultValue": null,
|
|
13
|
+
"jsDocTags": undefined,
|
|
14
|
+
"type": Object {
|
|
15
|
+
"detail": undefined,
|
|
16
|
+
"summary": "string",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
"type": Object {
|
|
20
|
+
"name": "string",
|
|
21
|
+
"required": true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
"onClick": Object {
|
|
25
|
+
"description": "",
|
|
26
|
+
"name": "onClick",
|
|
27
|
+
"table": Object {
|
|
28
|
+
"defaultValue": null,
|
|
29
|
+
"jsDocTags": undefined,
|
|
30
|
+
"type": Object {
|
|
31
|
+
"detail": undefined,
|
|
32
|
+
"summary": "func",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
"type": Object {
|
|
36
|
+
"name": "function",
|
|
37
|
+
"required": true,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`react component properties 9586-js-react-memo 1`] = `
|
|
4
|
+
"import React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
function Button({
|
|
7
|
+
label,
|
|
8
|
+
onClick
|
|
9
|
+
}) {
|
|
10
|
+
// eslint-disable-next-line react/button-has-type
|
|
11
|
+
return /*#__PURE__*/React.createElement(\\"button\\", {
|
|
12
|
+
onClick: onClick
|
|
13
|
+
}, label);
|
|
14
|
+
}
|
|
15
|
+
Button.propTypes = {
|
|
16
|
+
label: PropTypes.string.isRequired,
|
|
17
|
+
onClick: PropTypes.func.isRequired
|
|
18
|
+
};
|
|
19
|
+
const MemoButton = /*#__PURE__*/React.memo(Button);
|
|
20
|
+
export const component = MemoButton;
|
|
21
|
+
Button.__docgenInfo = {
|
|
22
|
+
\\"description\\": \\"\\",
|
|
23
|
+
\\"methods\\": [],
|
|
24
|
+
\\"displayName\\": \\"Button\\",
|
|
25
|
+
\\"props\\": {
|
|
26
|
+
\\"label\\": {
|
|
27
|
+
\\"description\\": \\"\\",
|
|
28
|
+
\\"type\\": {
|
|
29
|
+
\\"name\\": \\"string\\"
|
|
30
|
+
},
|
|
31
|
+
\\"required\\": true
|
|
32
|
+
},
|
|
33
|
+
\\"onClick\\": {
|
|
34
|
+
\\"description\\": \\"\\",
|
|
35
|
+
\\"type\\": {
|
|
36
|
+
\\"name\\": \\"func\\"
|
|
37
|
+
},
|
|
38
|
+
\\"required\\": true
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};"
|
|
42
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
function Button({ label, onClick }) {
|
|
5
|
+
// eslint-disable-next-line react/button-has-type
|
|
6
|
+
return <button onClick={onClick}>{label}</button>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
Button.propTypes = {
|
|
10
|
+
label: PropTypes.string.isRequired,
|
|
11
|
+
onClick: PropTypes.func.isRequired,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const MemoButton = React.memo(Button);
|
|
15
|
+
export const component = MemoButton;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`react component properties 9586-js-react-memo 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"rows": Array [
|
|
6
|
+
Object {
|
|
7
|
+
"defaultValue": null,
|
|
8
|
+
"description": "",
|
|
9
|
+
"name": "label",
|
|
10
|
+
"required": true,
|
|
11
|
+
"sbType": Object {
|
|
12
|
+
"name": "string",
|
|
13
|
+
},
|
|
14
|
+
"type": Object {
|
|
15
|
+
"detail": undefined,
|
|
16
|
+
"summary": "string",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
Object {
|
|
20
|
+
"defaultValue": null,
|
|
21
|
+
"description": "",
|
|
22
|
+
"name": "onClick",
|
|
23
|
+
"required": true,
|
|
24
|
+
"sbType": Object {
|
|
25
|
+
"name": "function",
|
|
26
|
+
},
|
|
27
|
+
"type": Object {
|
|
28
|
+
"detail": undefined,
|
|
29
|
+
"summary": "func",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
}
|
|
34
|
+
`;
|