# All files / layouts/Flow Flow.js

100% Statements 5/5
100% Branches 0/0
100% Functions 0/0
100% Lines 5/5

    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
    48
    49
    50

    5x

    5x
    5x
    5x
    5x

     import styled from 'styled-components';
    import FlowRowStyles from './styles/FlowRowStyles';
    import field from './fields/flowField';
    import * as fields from './fields';
    import FlowItemContainer from './styles/FlowItemContainer';
    import FlowItem from './FlowItem';
    import FlowRow from './FlowRow';
    import { HORIZONTAL_SPACING, VERTICAL_SPACING } from './constants';

    const Flow = styled.div.withConfig({ displayName: 'Flow' })`
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      justify-content: space-between;

      & > ${FlowRowStyles} {
        flex-basis: 100%;
        flex-shrink: 0;
      }

      & > ${FlowItemContainer} {
        flex-basis: calc(50% - ${HORIZONTAL_SPACING}px / 2);
        flex-grow: 0;
        flex-shrink: 0;
      }

      & > ${FlowRowStyles}, & > ${FlowItemContainer} {
        margin-top: calc(${VERTICAL_SPACING}px / 2);
        margin-bottom: calc(${VERTICAL_SPACING}px / 2);

        &:first-child {
          margin-top: 0;
        }

        &:last-child {
          margin-bottom: 0;
        }
      }
    `;

    Flow.Row = FlowRow;
    Flow.fields = fields;
    Flow.createField = field;
    Flow.Item = FlowItem;

    /**
     * @component
     */
    export default Flow;