forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(react-core/card): added Card Components
affects: @patternfly/react-core, @patternfly/react-docs Added Card, CardHeader, CardBody, and CardFooter components ISSUES CLOSED: patternfly#386
- Loading branch information
1 parent
0074044
commit e7618f9
Showing
34 changed files
with
381 additions
and
135 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { SFC, HTMLProps } from 'react'; | ||
|
||
export interface CardProps extends HTMLProps<HTMLDivElement> {} | ||
|
||
declare const Card: SFC<CardProps>; | ||
|
||
export default 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { css } from '@patternfly/react-styles'; | ||
import styles from '@patternfly/patternfly-next/components/Card/styles.css'; | ||
|
||
const propTypes = { | ||
children: PropTypes.any, | ||
className: PropTypes.string | ||
}; | ||
|
||
const defaultProps = { | ||
children: null, | ||
className: '' | ||
}; | ||
|
||
const Card = ({ children, className, ...props }) => ( | ||
<div className={css(styles.card, className)} {...props}> | ||
{children} | ||
</div> | ||
); | ||
|
||
Card.propTypes = propTypes; | ||
Card.defaultProps = defaultProps; | ||
|
||
export default 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { SFC, HTMLProps } from 'react'; | ||
|
||
export interface CardBodyProps extends HTMLProps<HTMLDivElement> {} | ||
|
||
declare const CardBody: SFC<CardBodyProps>; | ||
|
||
export default CardBody; |
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,25 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { css } from '@patternfly/react-styles'; | ||
import styles from '@patternfly/patternfly-next/components/Card/styles.css'; | ||
|
||
const propTypes = { | ||
children: PropTypes.any, | ||
className: PropTypes.string | ||
}; | ||
|
||
const defaultProps = { | ||
children: null, | ||
className: '' | ||
}; | ||
|
||
const CardBody = ({ children, className, ...props }) => ( | ||
<div className={css(styles.cardBody, className)} {...props}> | ||
{children} | ||
</div> | ||
); | ||
|
||
CardBody.propTypes = propTypes; | ||
CardBody.defaultProps = defaultProps; | ||
|
||
export default CardBody; |
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,7 @@ | ||
import { SFC, HTMLProps } from 'react'; | ||
|
||
export interface CardFooterProps extends HTMLProps<HTMLDivElement> {} | ||
|
||
declare const CardFooter: SFC<CardFooterProps>; | ||
|
||
export default CardFooter; |
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,25 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { css } from '@patternfly/react-styles'; | ||
import styles from '@patternfly/patternfly-next/components/Card/styles.css'; | ||
|
||
const propTypes = { | ||
children: PropTypes.any, | ||
className: PropTypes.string | ||
}; | ||
|
||
const defaultProps = { | ||
children: null, | ||
className: '' | ||
}; | ||
|
||
const CardFooter = ({ children, className, ...props }) => ( | ||
<div className={css(styles.cardFooter, className)} {...props}> | ||
{children} | ||
</div> | ||
); | ||
|
||
CardFooter.propTypes = propTypes; | ||
CardFooter.defaultProps = defaultProps; | ||
|
||
export default CardFooter; |
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,7 @@ | ||
import { SFC, HTMLProps } from 'react'; | ||
|
||
export interface CardHeaderProps extends HTMLProps<HTMLDivElement> {} | ||
|
||
declare const CardHeader: SFC<CardHeaderProps>; | ||
|
||
export default CardHeader; |
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,25 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { css } from '@patternfly/react-styles'; | ||
import styles from '@patternfly/patternfly-next/components/Card/styles.css'; | ||
|
||
const propTypes = { | ||
children: PropTypes.any, | ||
className: PropTypes.string | ||
}; | ||
|
||
const defaultProps = { | ||
children: null, | ||
className: '' | ||
}; | ||
|
||
const CardHeader = ({ children, className, ...props }) => ( | ||
<div className={css(styles.cardHeader, className)} {...props}> | ||
{children} | ||
</div> | ||
); | ||
|
||
CardHeader.propTypes = propTypes; | ||
CardHeader.defaultProps = defaultProps; | ||
|
||
export default CardHeader; |
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,4 @@ | ||
export { default as Card, CardProps } from './Card'; | ||
export { default as CardBody, CardBodyProps } from './CardBody'; | ||
export { default as CardFooter, CardFooterProps } from './CardFooter'; | ||
export { default as CardHeader, CardHeaderProps } from './CardHeader'; |
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,4 @@ | ||
export { default as Card } from './Card'; | ||
export { default as CardBody } from './CardBody'; | ||
export { default as CardFooter } from './CardFooter'; | ||
export { default as CardHeader } from './CardHeader'; |
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.