Sha256: f113cd320a283e52f3cf250ba773a3cf7d1a08911c4d2741ade615a407c46f1b

Contents?: true

Size: 954 Bytes

Versions: 50

Compression:

Stored size: 954 Bytes

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'
import TimelineItem from './_item.jsx'
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'

type TimelineProps = {
  aria?: object,
  children?: Array<React.ReactChild>,
  className?: String,
  data?: String,
  id?: String,
  orientation?: String,
  showDate?: Boolean,
}

const Timeline = ({
  aria = {},
  className,
  children,
  data = {},
  orientation = 'horizontal',
  showDate = false,
}: TimelineProps) => {
  const ariaProps = buildAriaProps(aria)
  const dataProps = buildDataProps(data)
  const dateStyle = showDate === true ? '_with_date' : ''
  const timelineCss = buildCss('pb_timeline_kit', `_${orientation}`, dateStyle)
  return (
    <div
        {...ariaProps}
        {...dataProps}
        className={classnames(timelineCss, className)}
    >
      {children}
    </div>
  )
}

Timeline.Item = TimelineItem

export default Timeline

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
playbook_ui-6.1.0.pre.alpha5 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-6.1.0.pre.alpha4 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-6.1.0.pre.alpha3 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-6.1.0.pre.alpha2 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-6.1.0.pre.alpha1 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-6.1.0 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-6.0.1.pre.alpha6 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-6.0.1.pre.alpha5 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-6.0.1.pre.alpha4 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-6.0.1.pre.alpha3 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-6.0.1.pre.alpha2 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-5.2.0.pre.alpha15 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-5.2.0.pre.alpha14 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-5.2.0.pre.alpha13 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-6.0.1 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-5.2.0.pre.alpha12 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-6.0.0 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-5.2.0.pre.alpha11 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-5.5.1.pre.alpha4 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-5.5.1.pre.alpha3 app/pb_kits/playbook/pb_timeline/_timeline.jsx