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-7.8.3 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.8.2 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.8.1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.8.0 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.7.0.pre.alpha1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.7.0 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.6.2.pre.alpha1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.6.2 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.6.1.pre.alpha1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.6.1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.6.0 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.5.1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.5.0 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.4.2 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.4.1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.4.0.pre.alpha6 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.4.0.pre.alpha5 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.4.0 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.4.0.pre.test4 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-7.4.0.pre.test3 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx