Sha256: 784db5c66928c3553332f02ff8580142e16ec77d9261119ea5be9a4269eb0ee0

Contents?: true

Size: 1.28 KB

Versions: 66

Compression:

Stored size: 1.28 KB

Contents

/* @flow */
import React from 'react'
import classnames from 'classnames'
import Title from '../pb_title/_title.jsx'
import Icon from '../pb_icon/_icon.jsx'
import Avatar from '../pb_avatar/_avatar.jsx'
import { globalProps } from '../utilities/globalProps.js'

type FormPillProps = {
  className?: string,
  id?: string,
  text: string,
  name: string,
  onClick?: EventHandler,
  avatar?: boolean,
  avatarUrl?: string,
}
const FormPill = (props: FormPillProps) => {
  const { className, text, name, onClick = () => {}, avatarUrl } = props
  const css = classnames(
    `pb_form_pill_kit_${'primary'}`,
    globalProps(props),
    className
  )
  return (
    <div className={css}>
      <If condition={name}>
        <Avatar
            imageUrl={avatarUrl}
            name={name}
            size="xs"
        />
        <Title
            className="pb_form_pill_text"
            size={4}
            text={name}
        />
      </If>
      <If condition={text}>
        <Title
            className="pb_form_pill_tag"
            size={4}
            text={text}
        />
      </If>
      <div
          className="pb_form_pill_close"
          onClick={onClick}
      >
        <Icon
            fixedWidth
            icon="times"
        />
      </div>
    </div>
  )
}
export default FormPill

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
playbook_ui-7.14.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.13.0.pre.alpha1 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.13.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.12.1 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.12.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.11.1 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.11.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.11.0.pre.alpha1 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.10.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.9.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.8.4 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.8.3 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.8.2 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.8.1 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.8.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.7.0.pre.alpha1 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.7.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.6.2.pre.alpha1 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.6.2 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.6.1.pre.alpha1 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx