# All files / elements/Card/utils props.js

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

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    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
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

     import PropTypes from 'prop-types';

    export const cardActionsBasePropTypes = {
      cardActions: PropTypes.node,
      cardActionsLeft: PropTypes.node,
      cardActionsLeftProps: PropTypes.object,
      cardActionsProps: PropTypes.object,
      cardActionsRight: PropTypes.node,
      cardActionsRightProps: PropTypes.object,
    };

    export const cardActionsBaseDefaultProps = {
      cardActions: '',
      cardActionsLeft: '',
      cardActionsLeftProps: {},
      cardActionsProps: {},
      cardActionsRight: '',
      cardActionsRightProps: {},
    };

    export const cardBasePropTypes = {
      cardPadding: PropTypes.any,
    };

    export const cardBaseDefaultProps = {
      cardPadding: 3,
    };

    export const cardBodyBasePropTypes = {
      cardBody: PropTypes.node,
      cardBodyProps: PropTypes.object,
    };

    export const cardBodyBaseDefaultProps = {
      cardBody: '',
      cardBodyProps: {},
    };

    export const cardHeaderBasePropTypes = {
      cardHeaderProps: PropTypes.object,
      cardSubtitle: PropTypes.oneOfType([
        PropTypes.node,
        PropTypes.string,
      ]),
      cardSubtitleProps: PropTypes.object,
      cardThumbnail: PropTypes.node,
      cardThumbnailProps: PropTypes.object,
      cardTitle: PropTypes.oneOfType([
        PropTypes.node,
        PropTypes.string,
      ]),
      cardTitleContainerProps: PropTypes.object,
      cardTitleProps: PropTypes.object,
    };

    export const cardHeaderBaseDefaultProps = {
      cardHeaderProps: {},
      cardSubtitle: '',
      cardSubtitleProps: {},
      cardThumbnail: '',
      cardThumbnailProps: {},
      cardTitle: '',
      cardTitleContainerProps: {},
      cardTitleProps: {},
    };

    export const cardInnerBasePropTypes = {
      cardInnerProps: PropTypes.object,
    };

    export const cardInnerBaseDefaultProps = {
      cardInnerProps: {},
    };

    export const cardRichMediaBasePropTypes = {
      cardRichMedia: PropTypes.node,
      cardRichMediaProps: PropTypes.object,
    };

    export const cardRichMediaBaseDefaultProps = {
      cardRichMedia: '',
      cardRichMediaProps: {},
    };

    export const cardSecondaryMediaBasePropTypes = {
      cardSecondaryMedia: PropTypes.node,
      cardSecondaryMediaProps: PropTypes.object,
    };

    export const cardSecondaryMediaBaseDefaultProps = {
      cardSecondaryMedia: '',
      cardSecondaryMediaProps: {},
    };

    export const cardPropTypes = {
      ...cardActionsBasePropTypes,
      ...cardBasePropTypes,
      ...cardBodyBasePropTypes,
      ...cardHeaderBasePropTypes,
      ...cardInnerBasePropTypes,
      ...cardRichMediaBasePropTypes,
      ...cardSecondaryMediaBasePropTypes,
      children: PropTypes.node,
    };

    export const cardDefaultProps = {
      ...cardActionsBaseDefaultProps,
      ...cardBaseDefaultProps,
      ...cardBodyBaseDefaultProps,
      ...cardHeaderBaseDefaultProps,
      ...cardInnerBaseDefaultProps,
      ...cardRichMediaBaseDefaultProps,
      ...cardSecondaryMediaBaseDefaultProps,
      background: 'white',
      border: '1px solid #ddd',
      borderRadius: 4,
      children: '',
      mb: [1, null, 2],
    };