UNPKG

@primer/components

Version:
48 lines 1.51 kB
import styled from 'styled-components'; import { variant } from 'styled-system'; import { COMMON, get } from './constants'; import sx from './sx'; const variants = variant({ variants: { default: { color: 'alert.info.text', backgroundColor: 'alert.info.bg', borderColor: 'alert.info.border', svg: { color: 'alert.info.icon' } }, success: { color: 'alert.success.text', backgroundColor: 'alert.success.bg', borderColor: 'alert.success.border', svg: { color: 'alert.success.icon' } }, danger: { color: 'alert.error.text', backgroundColor: 'alert.error.bg', borderColor: 'alert.error.border', svg: { color: 'alert.error.icon' } }, warning: { color: 'alert.warn.text', backgroundColor: 'alert.warn.bg', borderColor: 'alert.warn.border', svg: { color: 'alert.warn.icon' } } } }); const Flash = styled.div.withConfig({ displayName: "Flash", componentId: "sc-4y90bn-0" })(["position:relative;color:", ";padding:", ";border-style:solid;border-width:", ";border-radius:", ";margin-top:", ";p:last-child{margin-bottom:0;}svg{margin-right:", ";}", ";", ";", ";"], get('colors.fg.default'), get('space.3'), props => props.full ? '1px 0px' : '1px', props => props.full ? '0' : get('radii.2'), props => props.full ? '-1px' : '0', get('space.2'), COMMON, variants, sx); Flash.defaultProps = { variant: 'default' }; export default Flash;