Sha256: 6204ab5b08ccb49059d5a06d9f34260fc3985e37fc0a7751eb536dfa69587909

Contents?: true

Size: 1.28 KB

Versions: 37

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'}`, className],
    globalProps(props)
  )
  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

37 entries across 37 versions & 1 rubygems

Version Path
playbook_ui-7.3.0.pre.alpha2 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-6.7.0.pre.alpha1 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-6.7.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-6.6.1 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.0.0.pre.alpha10 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-6.6.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-6.5.2 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.0.1.pre.alpha12 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.0.1.pre.alpha11 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.0.1.pre.alpha10 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.0.1.pre.alpha9 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-6.5.1 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-6.5.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.0.1.pre.alpha8 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.0.1.pre.alpha7 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.0.1.pre.alpha6 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.0.1.pre.alpha5 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.0.1.pre.alpha4 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.0.1.pre.alpha3 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-7.0.1.pre.alpha2 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx