# All files / components/H H5.js

0% Statements 0/19
0% Branches 0/4
0% Functions 0/2
0% Lines 0/11

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47

     import React from 'react';
    import PropTypes from 'prop-types';
    import styled from 'styled-components';
    import tag from 'clean-tag';
    import get from 'extensions/themeGet';
    import userSpacing from 'extensions/userSpacing';

    const H5 = styled(tag.h5)
      .withConfig({ displayName: 'H5' })
      .attrs({
        spacing: userSpacing.text,
      })`
      color: ${get('colors.text.default')};
      font-weight: 800;
      font-family: ${get('fonts.brand')};
      font-size: 1.15em;
      margin: ${props => props.spacing};
      padding: 0;
    `;

    H5.propTypes = {
      /**
       * Specify a CSS value or an object { top, right, bottom, left } or { vertical, horizontal } to
       * control the spacing around the heading. Defaults to a large space below the element.
       */
      spacing: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
      /**
       * Adds a class name to the element.
       */
      className: PropTypes.string,
      /**
       * Adds an id to the element.
       */
      id: PropTypes.string,
    };

    H5.defaultProps = {
      spacing: { bottom: 'lg' },
      className: null,
      id: null,
    };

    /**
     * @component
     */
    export default H5;