-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Card: Enhance CardHeader and CardFooter with Flex (#22916)
This update enhances the CardHeader and CardFooter sub-components of Card with the new layout-based Flex component. This improves the alignment of child content for common header/footer use-cases. The various Card `README.md` files were updated to reflect the changes.
- Loading branch information
Q
authored
Jun 17, 2020
1 parent
29647c8
commit f932b9a
Showing
13 changed files
with
225 additions
and
60 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
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
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
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
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 |
---|---|---|
@@ -1,27 +1,44 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import { boolean, text } from '@storybook/addon-knobs'; | ||
/* eslint-enable import/no-extraneous-dependencies */ | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import Card from '../index'; | ||
import CardHeader from '../header'; | ||
import Button from '../../button'; | ||
import { FlexBlock, FlexItem } from '../../flex'; | ||
import { getCardStoryProps } from './_utils'; | ||
|
||
export default { title: 'Components/Card/Header', component: CardHeader }; | ||
|
||
export const _default = () => { | ||
const props = getCardStoryProps(); | ||
const content = text( 'Footer: children', 'Content' ); | ||
const isShady = boolean( 'Footer: isShady', false ); | ||
const content = text( 'Header: children', 'Content' ); | ||
const isShady = boolean( 'Header: isShady', false ); | ||
|
||
return ( | ||
<Card { ...props }> | ||
<CardHeader isShady={ isShady }>{ content }</CardHeader> | ||
</Card> | ||
); | ||
}; | ||
|
||
export const alignment = () => { | ||
const props = getCardStoryProps(); | ||
const content = text( 'Header: children', 'Content' ); | ||
const isShady = boolean( 'Header: isShady', false ); | ||
|
||
return ( | ||
<Card { ...props }> | ||
<CardHeader isShady={ isShady }> | ||
<FlexBlock>{ content }</FlexBlock> | ||
<FlexItem> | ||
<Button isPrimary>Action</Button> | ||
</FlexItem> | ||
</CardHeader> | ||
</Card> | ||
); | ||
}; |
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
Oops, something went wrong.