-
Notifications
You must be signed in to change notification settings - Fork 843
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Playground] EuiFlexGroup, EuiFlexItem (#3892)
* [Playground] EuiFlexGroup,EuiFlexItem * used guideDemo__highlightGrid * background fix
- Loading branch information
1 parent
3460132
commit 6fa8ae5
Showing
2 changed files
with
92 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,89 @@ | ||
import { PropTypes } from 'react-view'; | ||
import { | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiFlexGrid, | ||
} from '../../../../src/components/'; | ||
import { propUtilityForPlayground } from '../../services/playground'; | ||
|
||
export const flexGroupConfig = () => { | ||
const docgenInfo = Array.isArray(EuiFlexGroup.__docgenInfo) | ||
? EuiFlexGroup.__docgenInfo[0] | ||
: EuiFlexGroup.__docgenInfo; | ||
const propsToUse = propUtilityForPlayground(docgenInfo.props); | ||
|
||
propsToUse.children = { | ||
type: PropTypes.ReactNode, | ||
value: `<EuiFlexItem>Content grid item</EuiFlexItem> | ||
<EuiFlexItem style={{ minWidth: 100 }}>Min-width 300px</EuiFlexItem> | ||
<EuiFlexItem component="span"> | ||
This is a span component | ||
</EuiFlexItem> | ||
<EuiFlexItem> | ||
<p>Another content grid item</p> | ||
<p> | ||
Note how both of these are the same width and height despite having | ||
different content? | ||
</p> | ||
</EuiFlexItem>`, | ||
hidden: false, | ||
}; | ||
|
||
return { | ||
config: { | ||
componentName: 'EuiFlexGroup', | ||
props: propsToUse, | ||
scope: { | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
}, | ||
imports: { | ||
'@elastic/eui': { | ||
named: ['EuiFlexGroup', 'EuiFlexItem'], | ||
}, | ||
}, | ||
}, | ||
playgroundClassName: 'guideDemo__highlightGrid', | ||
}; | ||
}; | ||
|
||
export const flexGridConfig = () => { | ||
const docgenInfo = Array.isArray(EuiFlexGrid.__docgenInfo) | ||
? EuiFlexGrid.__docgenInfo[0] | ||
: EuiFlexGrid.__docgenInfo; | ||
const propsToUse = propUtilityForPlayground(docgenInfo.props); | ||
|
||
propsToUse.children = { | ||
type: PropTypes.ReactNode, | ||
value: `<EuiFlexItem>Content grid item</EuiFlexItem> | ||
<EuiFlexItem style={{ minWidth: 100 }}>Min-width 300px</EuiFlexItem> | ||
<EuiFlexItem component="span"> | ||
This is a span component | ||
</EuiFlexItem> | ||
<EuiFlexItem> | ||
<p>Another content grid item</p> | ||
<p> | ||
Note how both of these are the same width and height despite having | ||
different content? | ||
</p> | ||
</EuiFlexItem>`, | ||
hidden: false, | ||
}; | ||
|
||
return { | ||
config: { | ||
componentName: 'EuiFlexGrid', | ||
props: propsToUse, | ||
scope: { | ||
EuiFlexGrid, | ||
EuiFlexItem, | ||
}, | ||
imports: { | ||
'@elastic/eui': { | ||
named: ['EuiFlexGrid', 'EuiFlexItem'], | ||
}, | ||
}, | ||
}, | ||
playgroundClassName: 'guideDemo__highlightGrid', | ||
}; | ||
}; |