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-10.23.0.pre.cachetest app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.23.0.pre.alpha1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.22.1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.22.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.21.1.pre.alpha1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.21.0.pre.alpha.lightbox.2 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.21.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.21.0.pre.alpha.lightbox app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.21.0.pre.alpha.rg1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.21.0.pre.alpha.jg1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.21.0.pre.alpha.na1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.21.0.pre.alpha.jd1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.20.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.19.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.19.0.pre.lightbox app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.18.2 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.19.0.pre.popover.alpha1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.18.1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.18.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.17.0 app/pb_kits/playbook/pb_person/_person.jsx