Sha256: 8a01faa15903415c7a80b334ea2920494fd4c38db24bfa164b85dd98f2fbd72b

Contents?: true

Size: 937 Bytes

Versions: 38

Compression:

Stored size: 937 Bytes

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'
import {
  Body,
  Icon,
} from '../'

import {
  buildAriaProps,
  buildCss,
  buildDataProps,
} from '../utilities/props'

type IconValueProps = {
  align?: 'left' | 'center' | 'right',
  aria?: object,
  className?: string,
  data?: object,
  icon: string,
  id?: number,
  text: string,
}

const IconValue = ({
  align = 'left',
  aria = {},
  className,
  data = {},
  icon,
  id,
  text,
}: IconValueProps) => {
  const ariaProps = buildAriaProps(aria)
  const dataProps = buildDataProps(data)
  const pbCss = buildCss('pb_icon_value_kit', align)

  return (
    <div
        {...ariaProps}
        {...dataProps}
        className={classnames(className, pbCss)}
        id={id}
    >
      <Body color="light">
        <Icon
            fixedWidth
            icon={icon}
        />
        {text}
      </Body>
    </div>
  )
}

export default IconValue

Version data entries

38 entries across 38 versions & 1 rubygems

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