Sha256: 5b6ede41902cd288fc00b5d13b806a24af25eff4fda38e6ef124fb4054897d05

Contents?: true

Size: 1.18 KB

Versions: 53

Compression:

Stored size: 1.18 KB

Contents

/* @flow */

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

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

import Pill from '../pb_pill/_pill'
import Caption from '../pb_caption/_caption'

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

53 entries across 53 versions & 1 rubygems

Version Path
playbook_ui-10.23.0.pre.cachetest app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.21.0.pre.alpha.lightbox.2 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.21.0.pre.alpha.lightbox app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.21.0.pre.alpha.rg1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.21.0.pre.alpha.jg1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.21.0.pre.alpha.na1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.21.0.pre.alpha.jd1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.20.0 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.19.0 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.19.0.pre.lightbox app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.18.2 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.19.0.pre.popover.alpha1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.18.1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.18.0 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.17.0 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.16.0 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.15.1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.15.1.pre.alpha.rubocop.deps app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.15.0 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.14.1.pre.alpha2 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx