# All files / layouts/Form FormBox.js

57.14% Statements 4/7
100% Branches 0/0
0% Functions 0/3
57.14% Lines 4/7

    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

    5x

    5x

    5x

    5x

     import PropTypes from 'prop-types';
    import styled from 'styled-components';

    const FormBox = styled.div.withConfig({ displayName: 'FormBox' })`
      background: ${({ theme }) => theme.form.bg};
      border: ${({ theme }) => theme.form.border};
      padding: ${({ theme }) => theme.padding.large};
      max-width: 70vw;
      width: 100%;
      margin: auto;
    `;

    FormBox.propTypes = {
      /**
       * Adds an id to the element.
       */
      id: PropTypes.string,
      /**
       * Adds a class name to the element.
       */
      className: PropTypes.string,
    };

    FormBox.defaultProps = {
      id: null,
      className: null,
    };

    FormBox.usage = `
    # FormBox

    FormBox is the containing box around a standalone form. It more or less just applies a border to make the form stand out from its surroundings.

    \`\`\`
    <FormBox>
      <Form>
        <TextInput />
      </Form>
    </FormBox>
    \`\`\`
    `;

    export default FormBox;