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.2.1.alpha.sisensefix app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.2.1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.2.0 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.1.0 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.0.3.pre.alpha.walkthrough2 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.0.3.pre.alpha.walkthrough app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.0.1.alpha.railscusticon app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.0.2.pre.alpha.pre.iconfix app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.0.1.alpha.rtflexfix app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.0.0.pre.alphafonts app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.0.1 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-10.0.0 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx
playbook_ui-9.19.0.pre.alpha.pre.fonts2 app/pb_kits/playbook/pb_label_pill/_label_pill.jsx