Sha256: 0adb131f66490bd2f2e9537cec7b2459f024fde9f61c4ef9c50d57a9c4081369

Contents?: true

Size: 1.13 KB

Versions: 7

Compression:

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

  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

7 entries across 7 versions & 1 rubygems

Version Path
playbook_ui-6.1.0.pre.alpha5 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-6.1.0.pre.alpha4 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-6.1.0.pre.alpha3 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-6.1.0.pre.alpha2 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-6.1.0.pre.alpha1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-6.1.0 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-6.0.1.pre.alpha6 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx