Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
feat(chip): dense style
Browse files Browse the repository at this point in the history
  • Loading branch information
cooper-joe committed Apr 14, 2020
1 parent 5f78064 commit 9d7cb52
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Chip.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { Remove } from './Chip/Remove.js'
*/
const Chip = ({
selected,
dense,
disabled,
dragging,
overflow,
Expand All @@ -36,6 +37,7 @@ const Chip = ({
}}
className={cx(className, {
selected,
dense,
disabled,
dragging,
})}
Expand All @@ -60,6 +62,12 @@ const Chip = ({
color: ${colors.grey900};
}
.dense {
height: 24px;
font-size: 13px;
line-height: 15px;
}
span:hover {
background-color: ${colors.grey300};
}
Expand Down Expand Up @@ -110,6 +118,7 @@ Chip.defaultProps = {
* @prop {function} [onClick]
* @prop {function} [onRemove]
* @prop {boolean} [selected]
* @prop {boolean} [dense]
* @prop {boolean} [disabled]
* @prop {boolean} [dragging]
* @prop {boolean} [overflow]
Expand All @@ -119,6 +128,7 @@ Chip.propTypes = {
children: propTypes.string,
className: propTypes.string,
dataTest: propTypes.string,
dense: propTypes.bool,
disabled: propTypes.bool,
dragging: propTypes.bool,
icon: propTypes.element,
Expand Down
8 changes: 8 additions & 0 deletions src/__demo__/Chip.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ storiesOf('Chip', module)
</Chip>
))

.add('Dense', () => <Chip dense>I am dense</Chip>)

.add('Dense removeable', () => (
<Chip dense onRemove={onRemove}>
Removeable and dense
</Chip>
))

const Globe = () => (
<svg role="img" viewBox="0 0 24 24" height="100px" width="100px">
<title>LGTM icon</title>
Expand Down

0 comments on commit 9d7cb52

Please sign in to comment.