Sha256: 94faecf11a69f18b02567f7b2f0253e7a753ce1a6e8ae8bcdd03d971df9dc41e

Contents?: true

Size: 992 Bytes

Versions: 37

Compression:

Stored size: 992 Bytes

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'
import { buildAriaProps, buildDataProps } from '../utilities/props'
import { Body, Caption } from '../'
import { spacing } from '../utilities/spacing.js'

type LabelValueProps = {
  aria?: object,
  className?: String,
  dark?: Boolean,
  data?: object,
  id?: String,
  label: String,
  value: String,
}

const LabelValue = (props: LabelValueProps) => {
  const {
    aria = {},
    className,
    dark = false,
    data = {},
    id,
    label,
    value } = props

  const ariaProps = buildAriaProps(aria)
  const dataProps = buildDataProps(data)
  const themeStyle = dark === true ? '_dark' : ''
  const css = classnames(
    ['pb_label_value_kit' + themeStyle, className],
    spacing(props)
  )

  return (
    <div
        {...ariaProps}
        {...dataProps}
        className={css}
        id={id}
    >
      <Caption text={label} />
      <Body text={value} />
    </div>
  )
}

export default LabelValue

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
playbook_ui-5.2.0.pre.alpha15 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.2.0.pre.alpha14 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.2.0.pre.alpha13 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.2.0.pre.alpha12 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.2.0.pre.alpha11 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.5.1.pre.alpha4 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.5.1.pre.alpha3 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.5.1.pre.alpha2 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.5.1.pre.alpha1 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.2.0.pre.alpha10 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.5.1 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.5.0 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.5.0.pre.alpha1 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.2.0.pre.alpha9 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.2.0.pre.alpha8 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.2.0.pre.alpha7 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.3.0.pre.alpha1 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.4.0 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.2.0.pre.alpha6 app/pb_kits/playbook/pb_label_value/_label_value.jsx
playbook_ui-5.2.0.pre.alpha5 app/pb_kits/playbook/pb_label_value/_label_value.jsx