This repository has been archived by the owner on Aug 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from Tripwire/accordian
Thin Card
- Loading branch information
Showing
33 changed files
with
1,168 additions
and
19 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,31 @@ | ||
import React from 'react' | ||
import Flexbox from 'flexbox-react' | ||
import LargeCardAction from './LargeCardAction' | ||
import LargeCardClose from './LargeCardClose' | ||
import LargeCardGutter from './LargeCardGutter' | ||
import LargeCardContent from './LargeCardContent' | ||
import LargeCardKeyValue from './LargeCardKeyValue' | ||
import LargeCardRecentList from './LargeCardRecentList' | ||
import '../../styles/components/large-card.css' | ||
|
||
class LargeCard extends React.Component { | ||
static Action = LargeCardAction; | ||
static Close = LargeCardClose; | ||
static Gutter = LargeCardGutter; | ||
static Content = LargeCardContent; | ||
static KeyValue = LargeCardKeyValue; | ||
static RecentList = LargeCardRecentList; | ||
render () { | ||
return ( | ||
<div className={`large_card is-fullview-open-${this.props.showCard} ${this.props.className} `} style={this.props.style}> | ||
<Flexbox flexDirection='row' className='large_card__container'> | ||
{this.props.children} | ||
</Flexbox> | ||
</div> | ||
) | ||
} | ||
} | ||
LargeCard.propTypes = { | ||
cardContent: React.PropTypes.object | ||
} | ||
export default LargeCard |
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,20 @@ | ||
import React from 'react' | ||
|
||
const LargeCardAction = (props) => { | ||
return ( | ||
<a className={'fullview__goto__button button buttton-rect'} onClick={props.onClick}> | ||
{props.label} | ||
{props.children} | ||
</a> | ||
) | ||
} | ||
|
||
LargeCardAction.defaultProps = { | ||
|
||
} | ||
|
||
LargeCardAction.propTypes = { | ||
|
||
} | ||
|
||
export default LargeCardAction |
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,20 @@ | ||
import React from 'react' | ||
import Icon from '../suir/icon/Icon' | ||
|
||
const LargeCardClose = (props) => { | ||
return ( | ||
<span className='close__fullview' onClick={props.onClick}> | ||
<Icon className='ei icon_close' aria-hidden='true' /> | ||
</span> | ||
) | ||
} | ||
|
||
LargeCardClose.defaultProps = { | ||
|
||
} | ||
|
||
LargeCardClose.propTypes = { | ||
|
||
} | ||
|
||
export default LargeCardClose |
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,20 @@ | ||
import React from 'react' | ||
import Flexbox from 'flexbox-react' | ||
|
||
const LargeCardContent = (props) => { | ||
return ( | ||
<Flexbox flexDirection='row' flexGrow={3} className={` ${props.className}`} style={props.style}> | ||
{props.children} | ||
</Flexbox> | ||
) | ||
} | ||
|
||
LargeCardContent.defaultProps = { | ||
|
||
} | ||
|
||
LargeCardContent.propTypes = { | ||
|
||
} | ||
|
||
export default LargeCardContent |
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,36 @@ | ||
import React from 'react' | ||
import colorPallete from '../colorPallete' | ||
import Flexbox from 'flexbox-react' | ||
|
||
const LargeCardGutter = (props) => { | ||
let color = '' | ||
switch (props.color) { | ||
case 'critical': | ||
color = colorPallete.red | ||
break | ||
case 'warning': | ||
color = colorPallete.yellow | ||
break | ||
case 'normal': | ||
color = colorPallete.blue | ||
break | ||
case 'blue': | ||
color = colorPallete.blue | ||
break | ||
default: | ||
color = props.color | ||
} | ||
return ( | ||
<Flexbox className='fullview__left_border' width='9px' style={{backgroundColor: color}} /> | ||
) | ||
} | ||
|
||
LargeCardGutter.defaultProps = { | ||
|
||
} | ||
|
||
LargeCardGutter.propTypes = { | ||
|
||
} | ||
|
||
export default LargeCardGutter |
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,20 @@ | ||
import React from 'react' | ||
|
||
const LargeCardKeyValue = (props) => { | ||
return ( | ||
<div className={`summary_info ${props.className}`} onClick={props.onClick}> | ||
<span className='label'>{props.name}</span> | ||
<span className='count'>{props.value}</span> | ||
</div> | ||
) | ||
} | ||
|
||
LargeCardKeyValue.defaultProps = { | ||
|
||
} | ||
|
||
LargeCardKeyValue.propTypes = { | ||
|
||
} | ||
|
||
export default LargeCardKeyValue |
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,50 @@ | ||
import React from 'react' | ||
import Icon from '../suir/icon/Icon' | ||
import Flexbox from 'flexbox-react' | ||
|
||
const LargeCardRecentList = (props) => { | ||
return ( | ||
<Flexbox flexDirection='column' flexGrow={1} className={props.className}> | ||
|
||
<h4 className='label'>Recent</h4> | ||
{props.items.map((item) => { | ||
let icon = '' | ||
switch (item.state) { | ||
case 'warning': | ||
icon = 'icon_error-triangle_alt' | ||
break | ||
case 'critical': | ||
icon = 'icon_error-circle_alt' | ||
break | ||
default: | ||
icon = 'icon_check_alt2' | ||
} | ||
return ( | ||
<Flexbox key={item.id} flexDirection='row' className={`state__body-${item.state} recent__activity__row`}> | ||
<Flexbox className={`state__body-${item.state}`} alignItems='center' marginRight='20px'> | ||
<Icon className={`text-uppercase text-small ei ${icon} text-large`} /> | ||
</Flexbox> | ||
<Flexbox className={`text-uppercase text-small state__body-${item.state}`} alignItems='center'marginRight='20px'> | ||
{item.status} | ||
</Flexbox> | ||
<Flexbox className={`text-uppercase text-small state__body-${item.state}`} alignItems='center'> | ||
{item.date} | ||
</Flexbox> | ||
</Flexbox> | ||
) | ||
}) | ||
} | ||
|
||
</Flexbox> | ||
) | ||
} | ||
|
||
LargeCardRecentList.defaultProps = { | ||
|
||
} | ||
|
||
LargeCardRecentList.propTypes = { | ||
items: React.PropTypes.array | ||
} | ||
|
||
export default LargeCardRecentList |
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,36 @@ | ||
import React from 'react' | ||
import Flexbox from 'flexbox-react' | ||
import MicroCardGutter from './MicroCardGutter' | ||
import MicroCardAction from './MicroCardAction' | ||
import MicroCardFavorite from './MicroCardFavorite' | ||
import MicroCardContent from './MicroCardContent' | ||
import MicroCardCount from './MicroCardCount' | ||
import '../../styles/components/micro-card.css' | ||
|
||
class MicroCard extends React.Component { | ||
static Gutter = MicroCardGutter; | ||
static Action = MicroCardAction; | ||
static Favorite = MicroCardFavorite; | ||
static Content = MicroCardContent; | ||
static Count = MicroCardCount; | ||
render () { | ||
return ( | ||
<Flexbox | ||
flexDirection='row' | ||
key={this.props.cardContent.id} | ||
className={`microcard bordered ${this.props.className}`} | ||
style={this.props.style} | ||
onClick={this.props.onClick} | ||
> | ||
{this.props.children} | ||
|
||
</Flexbox> | ||
) | ||
} | ||
} | ||
|
||
MicroCard.propTypes = { | ||
cardContent: React.PropTypes.object | ||
} | ||
|
||
export default MicroCard |
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,18 @@ | ||
import React from 'react' | ||
import Icon from '../suir/icon/Icon' | ||
|
||
const MicroCardAction = (props) => { | ||
return ( | ||
<Icon onClick={props.onClick} className='ei microcard__arrow-right arrow_carrot-right' /> | ||
) | ||
} | ||
|
||
MicroCardAction.defaultProps = { | ||
|
||
} | ||
|
||
MicroCardAction.propTypes = { | ||
|
||
} | ||
|
||
export default MicroCardAction |
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,23 @@ | ||
import React from 'react' | ||
import Flexbox from 'flexbox-react' | ||
|
||
const MicroCardContent = (props) => { | ||
return ( | ||
<Flexbox flexDirection='column' paddingBottom='10px' paddingLeft='10px' paddingTop='5px'> | ||
{(props.cardContent.title) ? <Flexbox className='box__header'>{props.cardContent.title}</Flexbox> : '' } | ||
<Flexbox flexGrow={2}> | ||
{props.children} | ||
</Flexbox> | ||
</Flexbox> | ||
) | ||
} | ||
|
||
MicroCardContent.defaultProps = { | ||
|
||
} | ||
|
||
MicroCardContent.propTypes = { | ||
isFavorited: React.PropTypes.bool | ||
} | ||
|
||
export default MicroCardContent |
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,19 @@ | ||
import React from 'react' | ||
import Flexbox from 'flexbox-react' | ||
|
||
const MicroCardCount = (props) => { | ||
return ( | ||
<Flexbox className='microcard__count'>{props.value}</Flexbox> | ||
) | ||
} | ||
|
||
MicroCardCount.defaultProps = { | ||
color: '#FFFFFF' | ||
} | ||
|
||
MicroCardCount.propTypes = { | ||
color: React.PropTypes.string | ||
|
||
} | ||
|
||
export default MicroCardCount |
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,20 @@ | ||
import React from 'react' | ||
import FavoriteButton from '../FavoriteButton' | ||
|
||
const MicroCardFavorite = (props) => { | ||
return ( | ||
<div className='microcard_favorite'> | ||
<FavoriteButton isFavorited={props.isFavorited} /> | ||
</div> | ||
) | ||
} | ||
|
||
MicroCardFavorite.defaultProps = { | ||
|
||
} | ||
|
||
MicroCardFavorite.propTypes = { | ||
isFavorited: React.PropTypes.bool | ||
} | ||
|
||
export default MicroCardFavorite |
Oops, something went wrong.