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-11.0.0.pre.alpha.2 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.0.0.pre.alpha.1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.26.1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.27.0.pre.lazysizes1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.27.0.pre.datepicker1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.26.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.26.0.pre.alpha5 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.26.0.pre.rc1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.26.0.pre.alpha.sticky1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.26.0.pre.alpha.display1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.26.0.pre.alpha3 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.25.1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.26.0.pre.alpha1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.25.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.25.0.pre.alpha3 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.25.0.pre.treeshaking1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.24.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.24.0.pre.alpha1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.23.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-10.23.0.pre.alpha2 app/pb_kits/playbook/pb_person/_person.jsx