Sha256: 3d1881c9ba1fb5cc52839ffbdd05248953ab2ba40b91d20b1009b04740093782

Contents?: true

Size: 1.14 KB

Versions: 155

Compression:

Stored size: 1.14 KB

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'
import { globalProps } from '../utilities/globalProps.js'

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

import { Caption, Pill } from '../'

type LabelPillProps = {
  aria?: object,
  className?: string,
  data?: object,
  id?: string,
  label?: string,
  pillValue?: string,
  variant: "error" | "info" | "neutral" | "primary" | "success" | "warning",
}

const LabelPill = (props: LabelPillProps) => {
  const {
    aria = {},
    className,
    data = {},
    id,
    label,
    pillValue,
    variant = 'neutral',
  } = props
  const ariaProps = buildAriaProps(aria)
  const dataProps = buildDataProps(data)
  const css = classnames(
    'pb_label_pill_kit',
    globalProps(props),
    className
  )

  return (
    <div
        {...ariaProps}
        {...dataProps}
        className={css}
        id={id}
    >
      <Caption
          className="pb_label_pill_label"
          text={label}
      />

      <Pill
          className="pb_label_pill_pill"
          text={pillValue}
          variant={variant}
      />
    </div>
  )
}

export default LabelPill

Version data entries

155 entries across 155 versions & 1 rubygems

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