Sha256: aff0bb371982a54673b20707543163334cf96449d6d3f792722e97e5d09bbe09

Contents?: true

Size: 1.01 KB

Versions: 44

Compression:

Stored size: 1.01 KB

Contents

/* @flow */

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

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

import { spacing } from '../utilities/spacing.js'

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

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

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

export default IconValue

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
playbook_ui-6.0.1.pre.alpha5 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-6.0.1.pre.alpha4 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-6.0.1.pre.alpha3 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-6.0.1.pre.alpha2 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-5.2.0.pre.alpha15 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-5.2.0.pre.alpha14 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-5.2.0.pre.alpha13 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-6.0.1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-5.2.0.pre.alpha12 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-6.0.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-5.2.0.pre.alpha11 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-5.5.1.pre.alpha4 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-5.5.1.pre.alpha3 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-5.5.1.pre.alpha2 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-5.5.1.pre.alpha1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-5.2.0.pre.alpha10 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-5.5.1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-5.5.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-5.5.0.pre.alpha1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-5.2.0.pre.alpha9 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx