Sha256: 1963476b1369d75c71ac7fb5369b18cd9a31e31faeccc368d3566eeaaf6e84f4

Contents?: true

Size: 928 Bytes

Versions: 36

Compression:

Stored size: 928 Bytes

Contents

/* @flow */

import React from 'react'
import { buildCss } from '../utilities/props'

import {
  Body,
  Title,
} from '../'

type LegendProps = {
  color?: 'data_1' | 'data_2' | 'data_3' | 'data_4' | 'data_5' | 'data_6' | 'data_7',
  dark?: Boolean,
  prefixText?: String,
  text: String,
}

const Legend = ({
  color = 'data_1',
  dark = false,
  prefixText,
  text,
}: LegendProps) => {
  const darkClass = dark ? 'dark' : 'light'
  const bodyCSS = buildCss('pb_legend_kit', color, darkClass)

  return (
    <div className={bodyCSS}>
      <Body
          color={dark ? 'lighter' : 'light'}
      >
        <span className="pb_legend_indicator_circle" />
        <If condition={prefixText}>
          <Title
              dark={dark}
              size={4}
              tag="span"
              text={` ${prefixText} `}
          />
        </If>
        {` ${text} `}
      </Body>
    </div>
  )
}

export default Legend

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
playbook_ui-4.17.0.pre.alpha1 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.16.0 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.15.0 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.14.0 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.15.1.alpha1 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.13.1 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.13.0 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.12.0 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.11.0 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.11.0.pre.alpha3 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.11.0.pre.alpha.pre.2 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.10.0 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.10.0.pre.alpha1 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.9.0.pre.alpha1 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.9.0 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.8.2 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.8.1 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.7.1 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.7.0 app/pb_kits/playbook/pb_legend/_legend.jsx
playbook_ui-4.6.1 app/pb_kits/playbook/pb_legend/_legend.jsx