Sha256: 8ddb5481673cfac1a4e3ec472dad95531d309eaba636833042c82c2b3339e86d

Contents?: true

Size: 1.14 KB

Versions: 155

Compression:

Stored size: 1.14 KB

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'
import { globalProps } from '../utilities/globalProps.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'),
    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

155 entries across 155 versions & 1 rubygems

Version Path
playbook_ui-9.9.0.alpha.inline1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.9.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.8.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.7.0.pre.alphawidth1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.7.0.pre.alpha.a11y.btn app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.7.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.6.1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.6.1.pre.deps1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.6.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.5.0.alpha.rs.downgrade app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.5.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.4.0.alpha.sisense app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.4.0.alpha.user.kit.bug app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.4.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.3.1.pre.alpha2 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.4.0.pre.alpha2 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.4.0.pre.alpha1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.3.1.pre.alpha1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.3.0.alpha.inline3 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-9.3.0.pre.alpha.password.strength.2 app/pb_kits/playbook/pb_person/_person.jsx