Sha256: 3873274962f0d81a84b27084cde4ba77fb0646b6975a6b6de2c0b08d3142ea7f

Contents?: true

Size: 1.18 KB

Versions: 158

Compression:

Stored size: 1.18 KB

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'

import { globalProps } from '../utilities/globalProps'
import {
  buildAriaProps,
  buildCss,
  buildDataProps,
} from '../utilities/props'

import Body from '../pb_body/_body'
import Title from '../pb_title/_title'

type PersonProps = {
  aria?: object,
  className?: string | array<string>,
  data?: object,
  firstName: string,
  id?: string,
  lastName: string,
}

const Person = (props: PersonProps) => {
  const {
    aria = {},
    className,
    data = {},
    firstName,
    id,
    lastName } = props

  const ariaProps = buildAriaProps(aria)
  const dataProps = buildDataProps(data)
  const classes = classnames(
    buildCss('pb_person_kit'),
    globalProps(props),
    className
  )

  return (
    <div
        {...ariaProps}
        {...dataProps}
        className={classes}
        id={id}
    >
      <Body
          className="pb_person_first"
          tag="span"
      >
        {firstName}
      </Body>
      <If condition={lastName}>
        <Title
            className="pb_person_first"
            size={4}
            text={` ${lastName}`}
        />
      </If>
    </div>
  )
}

export default Person

Version data entries

158 entries across 158 versions & 1 rubygems

Version Path
playbook_ui-12.3.1.pre.alpha.phone1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-12.3.1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-12.3.0.pre.alpha.patchtest1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-12.3.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-12.2.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-12.1.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-12.0.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.20.0.pre.alpha.passthrough1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.20.0.pre.alpha.railsdialog1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.20.0.pre.alpha.focus1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.20.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.19.0.pre.alpha.map1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.19.0.pre.alpha.pagpassthrough1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.19.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.18.0.pre.alpha.pagutility1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.19.0.pre.typeahead1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.18.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.17.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.15.0.pre.alpha.dependencies1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.16.0.pre.alpha.paginationrails1 app/pb_kits/playbook/pb_person/_person.jsx