# All files / src/FileSelect/GridSource GridSource.styles.ts

75% Statements 18/24
60% Branches 12/20
0% Functions 0/3
78.26% Lines 18/23

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
    813x
    3x
    3x
    3x

    3x
    3x
    3x
    3x
    3x
    3x
    3x
    3x

    3x

    3x

    3x

    3x

    3x

    3x

     import styled, { css } from 'styled-components'
    import { EmptyState } from '../../EmptyState/EmptyState'
    import { colors } from '../../_styles/colors'
    import { spacing } from '../../_styles/spacing'

    const inputHeight = 32
    const toolbarPaddingTop = spacing.xl
    const toolbarPaddingBottom = spacing.md
    const toolbarHeight = inputHeight + toolbarPaddingTop + toolbarPaddingBottom
    const modalBodyBorderTopWidth = 1
    const modalBodyWidth = 460
    export const contentWidth = 632
    export const contentHeight =
      modalBodyWidth - modalBodyBorderTopWidth - toolbarHeight

    // TODO Update box-shadow to use getShadow instead
    export const StyledToolbar = styled.div<{
      alignRight: boolean
      hasScrollShadow: boolean
    }>`
      display: flex;
      flex-direction: row;
      width: ${contentWidth}px;
      height: ${toolbarHeight}px;
      padding: ${toolbarPaddingTop}px ${spacing.xl + spacing.lg}px
        ${toolbarPaddingBottom}px ${spacing.xl}px;

      ${({ alignRight }) =>
        css`
          justify-content: ${alignRight ? 'flex-end' : 'space-between'};
        `}

      ${({ hasScrollShadow }) =>
        hasScrollShadow &&
        `
          box-shadow: 0px ${spacing.xs}px ${spacing.xs}px ${colors.gray90};
          z-index: 1;
        `}

      & > * + * {
        margin-left: ${spacing.sm}px;
      }
    `

    export const StyledSearchWrapper = styled.div`
      width: 286px;
      flex-shrink: 1;
      min-width: 180px;
    `

    export const StyledEmptyStateWrapper = styled.div`
      width: 100%;
      height: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
    `

    export const StyledEmptyState = styled(EmptyState)`
      margin-top: 0;
      margin-bottom: 0;

      img {
        width: 160px;
      }
    `

    export const StyledSpinnerWrapper = styled.div`
      height: ${contentHeight}px;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
    `

    export const StyledGrid = styled.div<{ isEmpty: boolean }>`
      display: flex;
      flex-direction: column;
      ${({ isEmpty }) => isEmpty && 'height: 100%;'}
    `