Sha256: f7ddc6fc721fba36df2b5d289d82c021d640d1be202467452f6c678d8a5faf54

Contents?: true

Size: 1.34 KB

Versions: 10

Compression:

Stored size: 1.34 KB

Contents

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

import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } 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?: { [key: string]: string; },
  className?: string,
  dark?: boolean,
  data?: object,
  icon: string,
  htmlOptions?: {[key: string]: string | number | boolean | Function},
  id?: string,
  text: string,
}

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

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

export default IconValue

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
playbook_ui-13.14.0.pre.alpha.PLAY1109bugdisplaypropblocksfontcolor1784 app/pb_kits/playbook/pb_icon_value/_icon_value.tsx
playbook_ui-13.14.0.pre.alpha.play1106filter1751 app/pb_kits/playbook/pb_icon_value/_icon_value.tsx
playbook_ui-13.14.0.pre.alpha.play1106filter1748 app/pb_kits/playbook/pb_icon_value/_icon_value.tsx
playbook_ui-13.14.0 app/pb_kits/playbook/pb_icon_value/_icon_value.tsx
playbook_ui-13.13.0.pre.alpha.PLAY1097linterenhancedelement1728 app/pb_kits/playbook/pb_icon_value/_icon_value.tsx
playbook_ui-13.13.0.pre.alpha.play10221678 app/pb_kits/playbook/pb_icon_value/_icon_value.tsx
playbook_ui-13.13.0.pre.alpha.PLAY1090csstokens1675 app/pb_kits/playbook/pb_icon_value/_icon_value.tsx
playbook_ui-13.13.0.pre.alpha.play900startratingasinput1657 app/pb_kits/playbook/pb_icon_value/_icon_value.tsx
playbook_ui-13.13.0 app/pb_kits/playbook/pb_icon_value/_icon_value.tsx
playbook_ui-13.12.0.pre.alpha.play10281596 app/pb_kits/playbook/pb_icon_value/_icon_value.tsx