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.10.0.pre.alpha.pagination1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.10.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.9.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.9.0.pre.alpha.fileupload1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.8.1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.8.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.7.0.pre.alpha.table1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.7.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.6.0.pre.alpha.fontawesome app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.5.0.pre.alpha.fontawesome app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.7.0.pre.alpha.pre.guagechart1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.6.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.5.0.pre.alpha.datepicker1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.6.0.pre.alpha.rubocopperf1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.6.1.pre.alpha.rubocop.pre.performance1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.5.0.pre.alpha.pre.rubocop app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.6.0.pre.alpha.momenttz1 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.5.0 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.4.0.pre.alpha.rubytheme2 app/pb_kits/playbook/pb_person/_person.jsx
playbook_ui-11.4.0.pre.alpha.rubytheme1 app/pb_kits/playbook/pb_person/_person.jsx