Sha256: 2816e2237d5fb0bd8c9486efd79ec145e1dc1cd85609c4077bba4682af6c752c

Contents?: true

Size: 1.2 KB

Versions: 358

Compression:

Stored size: 1.2 KB

Contents

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

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

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

type LabelPillProps = {
  aria?: {[key: string]:string},
  className?: string,
  data?: {[key: string]:string},
  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

358 entries across 358 versions & 1 rubygems

Version Path
playbook_ui-11.9.0.pre.alpha.fileupload1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.8.1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.8.0 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.7.0.pre.alpha.table1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.7.0 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.6.0.pre.alpha.fontawesome app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.5.0.pre.alpha.fontawesome app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.7.0.pre.alpha.pre.guagechart1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.6.0 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.5.0.pre.alpha.datepicker1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.6.0.pre.alpha.rubocopperf1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.6.1.pre.alpha.rubocop.pre.performance1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.5.0.pre.alpha.pre.rubocop app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.6.0.pre.alpha.momenttz1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.5.0 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.4.0.pre.alpha.rubytheme2 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.4.0.pre.alpha.rubytheme1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.4.0 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx