Sha256: c157d3cefff0db2f8b68f814635ff50ac858bd89e26b7c8651dde01c381f6e8a

Contents?: true

Size: 1.13 KB

Versions: 37

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

37 entries across 37 versions & 1 rubygems

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