Sha256: b42fd3a668a9ffa3883819fe89b496d97ff57d2291711faf02ba1c8dac64f029

Contents?: true

Size: 1.13 KB

Versions: 155

Compression:

Stored size: 1.13 KB

Contents

/* @flow */

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

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

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

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

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

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

export default IconValue

Version data entries

155 entries across 155 versions & 1 rubygems

Version Path
playbook_ui-9.19.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.19.0.pre.alphafonts app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.18.0.flow.bin.alpha app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.18.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.17.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.17.0.pre.decouple.website2 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.16.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.15.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.15.0.pre.decouple.website1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.14.1.alpha.radio.alignment app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.14.1.alpha.highcharts9 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.14.1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.13.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.12.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.12.0.pre.text.addon app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.11.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.10.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.10.0.pre.date.time.stacked.1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.10.0.pre.alpha2 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-9.10.0.pre.alpha1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx