Sha256: b2fd1d9ced8d22902a305b308737a188d5b6eb6ada33fe6210b9559a0a421daa

Contents?: true

Size: 1.77 KB

Versions: 185

Compression:

Stored size: 1.77 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,
    id,
    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} id={id}>
        {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

185 entries across 185 versions & 1 rubygems

Version Path
playbook_ui-13.1.0 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-13.0.0.pre.alpha.PLAY966collapsiblenav41129 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-13.0.0.pre.alpha.PLAY966collapsiblenav41128 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-13.0.0.pre.alpha.PLAY966collapsiblenav41126 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-13.0.0.pre.alpha.salesbookmismatchingdate1120 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.39.0.pre.alpha.salesbookmismatchingdate1117 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-13.0.0 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.39.0.pre.alpha.PLAY966collapsiblenav41115 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.39.0.pre.alpha.salesbookmismatchingdate1114 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.39.0 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.38.0.pre.alpha.PBNTR78selectkitmultipleprop1094 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.38.0.pre.alpha.PLAY932removemomentqp1088 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.38.0.pre.alpha.PLAY966collapsiblenav41086 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.38.0.pre.alpha.audiencesalpha1083 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.38.0.pre.alpha.PLAY966collapsiblenav41082 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.38.0.pre.alpha.PLAYaddingdatapropselectkit1080 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.37.0.pre.alpha.PLAY951collapsiblenav31078 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.38.0.pre.alpha.playbook123801077 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.37.0.pre.alpha.PLAY951collapsiblenav31074 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx
playbook_ui-12.37.0.pre.alpha.PLAY951collapsiblenav31073 app/pb_kits/playbook/pb_form_pill/_form_pill.tsx