Sha256: 61513670b94b825e5b3b21dac8ddb8fca94553467fb1f4cbfe02fa1cc9bdec86

Contents?: true

Size: 1.12 KB

Versions: 43

Compression:

Stored size: 1.12 KB

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'
import { spacing } from '../utilities/spacing.js'

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

import { Body, Title } from '../'

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'), className, spacing(props))

  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

43 entries across 43 versions & 1 rubygems

Version Path
playbook_ui-6.0.1.pre.alpha5 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-6.0.1.pre.alpha4 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-6.0.1.pre.alpha3 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-6.0.1.pre.alpha2 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-5.2.0.pre.alpha15 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-5.2.0.pre.alpha14 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-5.2.0.pre.alpha13 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-6.0.1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-5.2.0.pre.alpha12 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-6.0.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-5.2.0.pre.alpha11 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-5.5.1.pre.alpha4 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-5.5.1.pre.alpha3 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-5.5.1.pre.alpha2 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-5.5.1.pre.alpha1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-5.2.0.pre.alpha10 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-5.5.1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-5.5.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-5.5.0.pre.alpha1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-5.2.0.pre.alpha9 app/pb_kits/playbook/pb_person/_person.jsx