diff --git a/src/app/atoms/chip/Chip.jsx b/src/app/atoms/chip/Chip.jsx new file mode 100644 index 0000000..3cededf --- /dev/null +++ b/src/app/atoms/chip/Chip.jsx @@ -0,0 +1,34 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import './Chip.scss'; + +import Text from '../text/Text'; +import RawIcon from '../system-icons/RawIcon'; + +function Chip({ + iconSrc, iconColor, text, children, +}) { + return ( +
+ {iconSrc != null && } + {(text != null && text !== '') && {text}} + {children} +
+ ); +} + +Chip.propTypes = { + iconSrc: PropTypes.string, + iconColor: PropTypes.string, + text: PropTypes.string, + children: PropTypes.element, +}; + +Chip.defaultProps = { + iconSrc: null, + iconColor: null, + text: null, + children: null, +}; + +export default Chip; diff --git a/src/app/atoms/chip/Chip.scss b/src/app/atoms/chip/Chip.scss new file mode 100644 index 0000000..c53f5ba --- /dev/null +++ b/src/app/atoms/chip/Chip.scss @@ -0,0 +1,19 @@ +.chip { + padding: var(--sp-ultra-tight) var(--sp-extra-tight); + + display: inline-flex; + flex-direction: row; + align-items: center; + + background: var(--bg-surface-low); + border-radius: var(--bo-radius); + border: 1px solid var(--bg-surface-border); + + & > .ic-raw { + margin-right: var(--sp-extra-tight); + [dir=rtl] & { + margin-right: 0; + margin-left: var(--sp-extra-tight); + } + } +} \ No newline at end of file