Sha256: ed6c79c0a9cad5b023864e85f0936c9642475eb1b9d72230c2fd00f455db73d0

Contents?: true

Size: 1.16 KB

Versions: 105

Compression:

Stored size: 1.16 KB

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'

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

import Body from '../pb_body/_body'
import Icon from '../pb_icon/_icon'

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

105 entries across 105 versions & 1 rubygems

Version Path
playbook_ui-11.6.0.pre.alpha.rubocopperf1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.6.1.pre.alpha.rubocop.pre.performance1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.5.0.pre.alpha.pre.rubocop app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.6.0.pre.alpha.momenttz1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.5.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.4.0.pre.alpha.rubytheme2 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.4.0.pre.alpha.rubytheme1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.4.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.3.0.pre.alpha2 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.3.0.pre.alpha1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.3.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.2.7 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.2.6 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.2.5 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.2.4 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.2.4.pre.alpha1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.2.3 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.2.2 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.2.1 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx
playbook_ui-11.2.0 app/pb_kits/playbook/pb_icon_value/_icon_value.jsx