# All files / src/Typography Typography.type.ts

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

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
    609x
    9x

    9x

     import * as PropTypes from 'prop-types'
    import { BoxProps, BoxPropTypes } from '../Box'
    import { StyledProps } from '../'

    export type TypographyClassProps = 'root' | 'variants' | 'gutterTop' | 'gutterBottom' | 'noWrap'

    export interface VariantMapping {
      h1: keyof JSX.IntrinsicElements
      h2: keyof JSX.IntrinsicElements
      h3: keyof JSX.IntrinsicElements
      h4: keyof JSX.IntrinsicElements
      h5: keyof JSX.IntrinsicElements
      h6: keyof JSX.IntrinsicElements
      subtitle1: keyof JSX.IntrinsicElements
      subtitle2: keyof JSX.IntrinsicElements
      body1: keyof JSX.IntrinsicElements
      body2: keyof JSX.IntrinsicElements
    }

    export type Variant =
      | 'h1'
      | 'h2'
      | 'h3'
      | 'h4'
      | 'h5'
      | 'h6'
      | 'subtitle1'
      | 'subtitle2'
      | 'body1'
      | 'body2'

    export interface TypographyProps extends BoxProps, StyledProps {
      variant?: Variant
      variantMapping?: VariantMapping
      gutterTop?: boolean
      gutterBottom?: boolean
      noWrap?: boolean
    }

    export const TypographyPropTypes = {
      children: PropTypes.node.isRequired,
      variant: PropTypes.oneOf<Variant>([
        'h1',
        'h2',
        'h3',
        'h4',
        'h5',
        'h6',
        'subtitle1',
        'subtitle2',
        'body1',
        'body2'
      ]),
      variantMapping: PropTypes.any,
      gutterTop: PropTypes.bool,
      gutterBottom: PropTypes.bool,
      noWrap: PropTypes.bool,
      ...BoxPropTypes
    }