Sha256: 6249e714bec6c324e5a65e47eee02b4e61c7769c3c1495647a1d4864da97885f

Contents?: true

Size: 1 KB

Versions: 46

Compression:

Stored size: 1 KB

Contents

/* @flow */

import React from 'react'

import classnames from 'classnames'
import Title from '../pb_title/_title.jsx'
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
import { globalProps } from '../utilities/globalProps.js'

type PillProps = {
  aria?: object,
  className?: string,
  data?: object,
  id?: string,
  text: string,
  variant?: "success" | "warning" | "error" | "info" | "neutral",
}

const Pill = (props: PillProps) => {
  const {
    aria = {},
    className,
    data = {},
    id,
    text,
    variant = 'neutral',
  } = props

  const ariaProps = buildAriaProps(aria)
  const dataProps = buildDataProps(data)
  const classes = classnames(buildCss('pb_pill_kit', variant), globalProps(props), className)

  return (
    <div
        {...ariaProps}
        {...dataProps}
        className={classes}
        id={id}
    >
      <Title
          className="pb_pill_text"
          size={4}
          tag="div"
          text={text}
      />
    </div>
  )
}

export default Pill

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
playbook_ui-10.14.1.pre.alpha2 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.14.1.pre.alpha1 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.14.0 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.13.1 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.13.0 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.13.0.pre.node.update app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.12.0 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.11.0 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.10.0 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.9.0 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.8.1.pre.alpha.flexdeps app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.9.0.pre.alpha1 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.8.0 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.7.1 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.7.0 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.6.2.pre.alpha.dep app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.6.1.pre.alpha1 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.6.0 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.5.0 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.4.0 app/pb_kits/playbook/pb_pill/_pill.jsx