Sha256: bdc73c687bf745fb3021e297415d45628acecf4e508dec53c634a812d223aded

Contents?: true

Size: 1.09 KB

Versions: 15

Compression:

Stored size: 1.09 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'

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

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

  const ariaProps = buildAriaProps(aria)
  const dataProps = buildDataProps(data)
  const classes = classnames(buildCss('pb_pill_kit', variant, textTransform), 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

15 entries across 15 versions & 1 rubygems

Version Path
playbook_ui-10.26.0.pre.alpha.sticky1 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.26.0.pre.alpha3 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.25.1 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.25.0 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.25.0.pre.alpha3 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.25.0.pre.treeshaking1 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.24.0 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.24.0.pre.alpha1 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.23.0 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.23.0.pre.alpha2 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.23.0.pre.alpha1 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.22.1 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.22.0 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.21.1.pre.alpha1 app/pb_kits/playbook/pb_pill/_pill.jsx
playbook_ui-10.21.0 app/pb_kits/playbook/pb_pill/_pill.jsx