Sha256: 1fc4b9f8522bbc6ffe30d3769effa8e178e86eb22048c98e05a412f0b012bf28

Contents?: true

Size: 1.75 KB

Versions: 192

Compression:

Stored size: 1.75 KB

Contents

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

type FormPillProps = {
  className?: string,
  id?: string,
  text: string,
  name: string,
  onClick?: React.MouseEventHandler<HTMLSpanElement>,
  avatar?: boolean,
  avatarUrl?: string,
  size?: string,
  textTransform?: 'none' | 'lowercase',
  closeProps?: {
    onClick?: React.MouseEventHandler<HTMLSpanElement>,
    onMouseDown?: React.MouseEventHandler<HTMLSpanElement>,
    onTouchEnd?: React.TouchEventHandler<HTMLSpanElement>,
  }, 
} & GlobalProps
const FormPill = (props: FormPillProps) => {
  const {
    className,
    text,
    name,
    onClick = () => {},
    avatarUrl,
    closeProps = {},
    size = '',
    textTransform = 'none',
  } = props
  const css = classnames(
    `pb_form_pill_kit_${'primary'}`,
    globalProps(props),
    className,
    size === 'small' ? 'small' : null,
    textTransform,
  )
  return (
    <div className={css}>
        {name &&
        <>
        <Avatar
            imageUrl={avatarUrl}
            name={name}
            size="xs"
            status={null}
        />
        <Title
            className="pb_form_pill_text"
            size={4}
            text={name}
        />
        </>
        }

      {text &&
        <Title
            className="pb_form_pill_tag"
            size={4}
            text={text}
        />
      }
      <div
          className="pb_form_pill_close"
          onClick={onClick}
          {...closeProps}
      >
        <Icon
            fixedWidth
            icon="times"
        />
      </div>
    </div>
  )
}
export default FormPill

Version data entries

192 entries across 192 versions & 1 rubygems

Version Path
playbook_ui-12.25.0.pre.alpha.play822bolddefaultfortitle3764 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.25.0.pre.alpha.PLAY733DetailKit761 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.25.0.pre.alpha.railsmultilevelimprovements758 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.25.0 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.24.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown756 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.24.0.pre.alpha.play824753 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.24.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown752 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.24.0.pre.alpha.play824751 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.24.0.pre.alpha.railsmultilevelimprovements749 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.24.0.pre.alpha.play824745 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.24.0.pre.alpha.railsmultilevelimprovements742 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.24.0.pre.alpha.railsmultilevelimprovements741 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.24.0.pre.alpha.railsmultilevelimprovements739 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.24.0.pre.alpha.play824733 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.24.0.pre.alpha.play833boldoptionfortitle2and3721 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.24.0.pre.alpha.alphatestforselfhostfak720 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.24.0.pre.alpha.play833boldoptionfortitle2and3719 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.24.0.pre.alpha.play833boldoptionfortitle2and3717 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.24.0 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.23.0.pre.alpha.movemarkdown712 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx