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.16.0.pre.alpha.pagination.rails1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.15.0 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.14.0 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.13.0.pre.alpha.fontawesome1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.13.0 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.12.1.pre.alpha.charts1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.12.1.pre.alpha.passphrase1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.12.1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.13.0.pre.alpha.fileupload1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.12.0 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.11.0.pre.alpha.paginate2 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.11.0.pre.alpha.dialog2 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.11.0.pre.alpha.paginate1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.11.0.pre.alpha.renderer1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.11.0.pre.alpha.dialog1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.11.0 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.10.0.pre.alpha.pre.bold1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.10.0.pre.alpha.pagination1 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.10.0 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx
playbook_ui-11.9.0 app/pb_kits/playbook/pb_label_pill/_label_pill.tsx