Sha256: 6fbdbd9c354b41ebf2cfdf0ef89044096d5a127decac5cb7096624e627724d5f

Contents?: true

Size: 1.18 KB

Versions: 11

Compression:

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

type FormPillProps = {

className?: String,
id?: String,
text: String,
name: String,
onClick?: EventHandler,
avatar?: Boolean,
avatarUrl?: String,
}
const FormPill = ({
  className,
  text,
  name,
  onClick = () => {},
  avatarUrl,
}: FormPillProps) => {
  const css = classnames([
    `pb_form_pill_kit_${'primary'}`,
    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

11 entries across 11 versions & 1 rubygems

Version Path
playbook_ui-4.17.0.pre.alpha1 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-4.16.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-4.15.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-4.14.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-4.15.1.alpha1 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-4.13.1 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-4.13.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-4.12.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-4.11.0 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-4.11.0.pre.alpha3 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx
playbook_ui-4.11.0.pre.alpha.pre.2 app/pb_kits/playbook/pb_form_pill/_form_pill.jsx