+
+ Any content inside of EuiAccordion will appear here.
+
+ `,
+ type: PropTypes.ReactNode,
+ hidden: false,
+ };
+
+ propsToUse.onToggle = {
+ ...propsToUse.onToggle,
+ type: PropTypes.Custom,
+ value: undefined,
+ custom: {
+ use: 'switch',
+ label: 'Simulate',
+ },
+ };
+
+ propsToUse.forceState = createOptionalEnum(propsToUse.forceState);
+
+ return {
+ config: {
+ componentName: 'EuiAccordion',
+ props: propsToUse,
+ scope: {
+ EuiAccordion,
+ EuiText,
+ },
+ imports: {
+ '@elastic/eui': {
+ named: ['EuiAccordion', 'EuiText'],
+ },
+ },
+ customProps: {
+ onToggle: dummyFunction,
+ },
+ },
+ };
+};
diff --git a/src-docs/src/views/badge/playground.js b/src-docs/src/views/badge/playground.js
index 91bbd4d1479..a4c60df5a37 100644
--- a/src-docs/src/views/badge/playground.js
+++ b/src-docs/src/views/badge/playground.js
@@ -7,8 +7,8 @@ import {
import {
propUtilityForPlayground,
iconValidator,
+ dummyFunction,
} from '../../services/playground';
-import * as t from '@babel/types';
export const badgeConfig = () => {
const docgenInfo = Array.isArray(EuiBadge.__docgenInfo)
@@ -88,17 +88,7 @@ export const badgeConfig = () => {
},
},
customProps: {
- onClick: {
- generate: val => {
- if (!val) return null;
- const obj = t.arrowFunctionExpression(
- [],
- t.blockStatement([]),
- false
- );
- return obj;
- },
- },
+ onClick: dummyFunction,
},
},
};
diff --git a/src-docs/src/views/card/playground.js b/src-docs/src/views/card/playground.js
index c6d68570141..981df8aee04 100644
--- a/src-docs/src/views/card/playground.js
+++ b/src-docs/src/views/card/playground.js
@@ -1,7 +1,9 @@
import { PropTypes } from 'react-view';
import { EuiCard } from '../../../../src/components/';
-import { propUtilityForPlayground } from '../../services/playground';
-import * as t from '@babel/types';
+import {
+ propUtilityForPlayground,
+ dummyFunction,
+} from '../../services/playground';
export default () => {
const docgenInfo = Array.isArray(EuiCard.__docgenInfo)
@@ -50,17 +52,7 @@ export default () => {
},
},
customProps: {
- onClick: {
- generate: val => {
- if (!val) return null;
- const obj = t.arrowFunctionExpression(
- [],
- t.blockStatement([]),
- false
- );
- return obj;
- },
- },
+ onClick: dummyFunction,
},
},
};
diff --git a/src-docs/src/views/toast/playground.js b/src-docs/src/views/toast/playground.js
index 4478ddf57f1..4aab1209fb2 100644
--- a/src-docs/src/views/toast/playground.js
+++ b/src-docs/src/views/toast/playground.js
@@ -4,8 +4,8 @@ import {
propUtilityForPlayground,
iconValidator,
createOptionalEnum,
+ dummyFunction,
} from '../../services/playground';
-import * as t from '@babel/types';
export default () => {
const docgenInfo = Array.isArray(EuiToast.__docgenInfo)
@@ -47,17 +47,7 @@ export default () => {
},
},
customProps: {
- onClose: {
- generate: val => {
- if (!val) return null;
- const obj = t.arrowFunctionExpression(
- [],
- t.blockStatement([]),
- false
- );
- return obj;
- },
- },
+ onClose: dummyFunction,
},
},
};
diff --git a/src-docs/src/views/tool_tip/playground.js b/src-docs/src/views/tool_tip/playground.js
index 2bf1dc98c50..71168bb4c06 100644
--- a/src-docs/src/views/tool_tip/playground.js
+++ b/src-docs/src/views/tool_tip/playground.js
@@ -1,7 +1,9 @@
import { PropTypes } from 'react-view';
import { EuiToolTip } from '../../../../src/components/';
-import { propUtilityForPlayground } from '../../services/playground';
-import * as t from '@babel/types';
+import {
+ propUtilityForPlayground,
+ dummyFunction,
+} from '../../services/playground';
export default () => {
const docgenInfo = Array.isArray(EuiToolTip.__docgenInfo)
@@ -52,17 +54,7 @@ export default () => {
},
},
customProps: {
- onMouseOut: {
- generate: val => {
- if (!val) return null;
- const obj = t.arrowFunctionExpression(
- [],
- t.blockStatement([]),
- false
- );
- return obj;
- },
- },
+ onMouseOut: dummyFunction,
},
},
};