Sha256: 0bc05adb9cb0cc39bedf14801f3989360e1505587610df22edd029dd003cc619

Contents?: true

Size: 1.32 KB

Versions: 507

Compression:

Stored size: 1.32 KB

Contents

import React from 'react'

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

type PillProps = {
  aria?: {[key: string]: string},
  className?: string,
  data?: {[key: string]: string},
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
  id?: string,
  text: string,
  variant?: "success" | "warning" | "error" | "info" | "neutral" | "primary",
  textTransform?: "none" | "lowercase"
} & GlobalProps

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

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

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

export default Pill

Version data entries

507 entries across 507 versions & 1 rubygems

Version Path
playbook_ui-14.8.0.pre.alpha.PLAY1615movenegativetoleftofcurrencysign4543 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.8.0.pre.alpha.PLAY1615movenegativetoleftofcurrencysign4539 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.9.0.pre.rc.0 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.7.0.pre.alpha.dependabotnpmandyarnfloatinguireact026284532 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.8.0 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.7.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4523 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.8.0.pre.rc.8 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.8.0.pre.rc.7 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.8.0.pre.rc.6 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.8.0.pre.rc.5 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.8.0.pre.rc.4 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.8.0.pre.rc.3 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.7.0.pre.alpha.PBNTR637quickpickdefaultdate4492 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.8.0.pre.rc.2 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.7.0.pre.alpha.spacingquickchange4482 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.7.0.pre.alpha.PBNTR637quickpickdefaultdate4478 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.7.0.pre.alpha.PBNTR667railstypeaheadformintegration4454 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.8.0.pre.rc.1 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.7.0.pre.alpha.dependabotnpmandyarnintltelinput24704448 app/pb_kits/playbook/pb_pill/_pill.tsx
playbook_ui-14.8.0.pre.rc.0 app/pb_kits/playbook/pb_pill/_pill.tsx