-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* playgorund * Update src-docs/src/views/empty_prompt/playground.js Co-authored-by: Greg Thompson <[email protected]> * Update src-docs/src/views/empty_prompt/playground.js Co-authored-by: Greg Thompson <[email protected]> Co-authored-by: Greg Thompson <[email protected]>
- Loading branch information
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { PropTypes } from 'react-view'; | ||
import { EuiEmptyPrompt, EuiButton } from '../../../../src/components/'; | ||
import { | ||
propUtilityForPlayground, | ||
iconValidator, | ||
} from '../../services/playground'; | ||
|
||
export default () => { | ||
const docgenInfo = Array.isArray(EuiEmptyPrompt.__docgenInfo) | ||
? EuiEmptyPrompt.__docgenInfo[0] | ||
: EuiEmptyPrompt.__docgenInfo; | ||
const propsToUse = propUtilityForPlayground(docgenInfo.props); | ||
|
||
propsToUse.title = { | ||
...propsToUse.title, | ||
value: '<>You have no spice</>', | ||
type: PropTypes.ReactNode, | ||
}; | ||
|
||
propsToUse.iconColor = { | ||
...propsToUse.iconColor, | ||
type: PropTypes.Enum, | ||
defaultValue: 'subdued', | ||
options: { | ||
default: 'default', | ||
subdued: 'subdued', | ||
secondary: 'secondary', | ||
accent: 'accent', | ||
danger: 'danger', | ||
warning: 'warning', | ||
ghost: 'ghost', | ||
}, | ||
}; | ||
|
||
propsToUse.actions.type = PropTypes.String; | ||
propsToUse.body.type = PropTypes.String; | ||
propsToUse.body.value = `Navigators use massive amounts of spice to gain a limited form of | ||
prescience. This allows them to safely navigate interstellar space, | ||
enabling trade and travel throughout the galaxy. | ||
`; | ||
|
||
propsToUse.iconType = iconValidator(propsToUse.iconType); | ||
|
||
return { | ||
config: { | ||
componentName: 'EuiEmptyPrompt', | ||
props: propsToUse, | ||
scope: { | ||
EuiEmptyPrompt, | ||
EuiButton, | ||
}, | ||
imports: { | ||
'@elastic/eui': { | ||
named: ['EuiEmptyPrompt', 'EuiButton'], | ||
}, | ||
}, | ||
}, | ||
}; | ||
}; |