gilbarbara/styled-minimal

View on GitHub
docs/main.3fb5344832e4a0a40ece.bundle.js.map

Summary

Maintainability
Test Coverage
{"version":3,"file":"main.3fb5344832e4a0a40ece.bundle.js","sources":["webpack:///./src/Alert.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport styled, { css } from 'styled-components';\n\nimport { getTheme, isDefined, px } from './utils/helpers';\nimport { baseStyles, sizesAllPropTypes, variantPropTypes } from './utils/system';\n\nimport Box, { basePropTypes } from './Box';\n\nconst Alert = styled(Box).attrs({\n  role: 'alert',\n})(props => {\n  const { borderRadius: br, lineHeight, size, width } = props;\n  const { borderRadius, maxWidth, padding } = getTheme(props, 'alert');\n\n  return css`\n    ${baseStyles.variant};\n    border-radius: ${px(isDefined(br) ? br : borderRadius)};\n    font-size: ${baseStyles.fontSize};\n    line-height: ${lineHeight || baseStyles.lineHeight};\n    max-width: ${px(maxWidth)};\n    padding: ${px(padding[size][0])} ${px(padding[size][1])};\n    width: ${width || '100%'};\n\n    a {\n      ${baseStyles.color};\n    }\n  `;\n});\n\nAlert.displayName = 'Alert';\n\nAlert.propTypes = {\n  as: PropTypes.string,\n  bordered: PropTypes.bool,\n  children: PropTypes.node.isRequired,\n  dark: PropTypes.bool,\n  /** button size */\n  size: sizesAllPropTypes,\n  /** button variant */\n  variant: variantPropTypes,\n  ...basePropTypes,\n};\n\nAlert.defaultProps = {\n  bordered: false,\n  dark: false,\n  size: 'md',\n  variant: 'primary',\n};\n\nexport default Alert;\n"],"mappings":"AAQA","sourceRoot":""}