Sha256: 7e1bdfbb420d1fd3e1a8b26aafc21654e37dca03ca15f7b54cdb5a31adfd01e8

Contents?: true

Size: 1.11 KB

Versions: 34

Compression:

Stored size: 1.11 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), className, globalProps(props))

  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

34 entries across 34 versions & 1 rubygems

Version Path
playbook_ui-7.3.0.pre.alpha2 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-6.7.0.pre.alpha1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-6.7.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-6.6.1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-7.0.0.pre.alpha10 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-6.6.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-6.5.2 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-7.0.1.pre.alpha12 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-7.0.1.pre.alpha11 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-7.0.1.pre.alpha10 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-7.0.1.pre.alpha9 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-6.5.1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-6.5.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-7.0.1.pre.alpha8 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-7.0.1.pre.alpha7 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-7.0.1.pre.alpha6 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-7.0.1.pre.alpha5 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-7.0.1.pre.alpha4 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-7.0.1.pre.alpha3 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-7.0.1.pre.alpha2 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx