Sha256: c7db567eaaaea15a9dead0251a035aed95583dfda9d9df6587dfb35b92620be1

Contents?: true

Size: 956 Bytes

Versions: 216

Compression:

Stored size: 956 Bytes

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'

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

import TimelineItem from './_item.jsx'

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

216 entries across 216 versions & 1 rubygems

Version Path
playbook_ui-10.26.1 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.27.0.pre.lazysizes1 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.27.0.pre.datepicker1 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.26.0 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.26.0.pre.alpha5 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.26.0.pre.rc1 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.26.0.pre.alpha.sticky1 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.26.0.pre.alpha.display1 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.26.0.pre.alpha3 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.25.1 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.26.0.pre.alpha1 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.25.0 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.25.0.pre.alpha3 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.25.0.pre.treeshaking1 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.24.0 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.24.0.pre.alpha1 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.23.0 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.23.0.pre.alpha2 app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.23.0.pre.cachetest app/pb_kits/playbook/pb_timeline/_timeline.jsx
playbook_ui-10.23.0.pre.alpha1 app/pb_kits/playbook/pb_timeline/_timeline.jsx