From 80012dab222a5b40ee34edf399ba94a0e22fd1b5 Mon Sep 17 00:00:00 2001 From: Anish Aggarwal Date: Thu, 13 Aug 2020 04:14:02 +0530 Subject: [PATCH] [Playground] EuiBeacon (#3900) --- src-docs/src/views/beacon/beacon_example.js | 3 ++ src-docs/src/views/beacon/playground.js | 31 +++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src-docs/src/views/beacon/playground.js diff --git a/src-docs/src/views/beacon/beacon_example.js b/src-docs/src/views/beacon/beacon_example.js index ce381dc9db5..c02abbb582f 100644 --- a/src-docs/src/views/beacon/beacon_example.js +++ b/src-docs/src/views/beacon/beacon_example.js @@ -6,6 +6,8 @@ import { GuideSectionTypes } from '../../components'; import { EuiBeacon, EuiText } from '../../../../src/components'; +import { beaconConfig } from './playground'; + import Beacon from './beacon'; const beaconSource = require('!!raw-loader!./beacon'); const beaconHtml = renderToHtml(Beacon); @@ -38,4 +40,5 @@ export const BeaconExample = { demo: , }, ], + playground: beaconConfig, }; diff --git a/src-docs/src/views/beacon/playground.js b/src-docs/src/views/beacon/playground.js new file mode 100644 index 00000000000..d740b6c408a --- /dev/null +++ b/src-docs/src/views/beacon/playground.js @@ -0,0 +1,31 @@ +import { PropTypes } from 'react-view'; +import { EuiBeacon } from '../../../../src/components/'; +import { propUtilityForPlayground } from '../../services/playground'; + +export const beaconConfig = () => { + const docgenInfo = Array.isArray(EuiBeacon.__docgenInfo) + ? EuiBeacon.__docgenInfo[0] + : EuiBeacon.__docgenInfo; + const propsToUse = propUtilityForPlayground(docgenInfo.props); + + propsToUse.size = { + ...propsToUse.size, + type: PropTypes.Number, + defaultValue: 12, + }; + + return { + config: { + componentName: 'EuiBeacon', + props: propsToUse, + scope: { + EuiBeacon, + }, + imports: { + '@elastic/eui': { + named: ['EuiBeacon'], + }, + }, + }, + }; +};