Sha256: c9d04f867328d1df06cf9eeba3191f38d5979ff4f8150dd16b715be65b345bbf

Contents?: true

Size: 1.3 KB

Versions: 272

Compression:

Stored size: 1.3 KB

Contents

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

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

import TimelineItem from './_item'

type TimelineProps = {
  aria?: { [key: string]: string },
  children?: React.ReactChild[] | React.ReactChild,
  className?: string,
  data?: { [key: string]: string },
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
  id?: string,
  orientation?: string,
  showDate?: boolean,
} & GlobalProps

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

Timeline.Item = TimelineItem

export default Timeline

Version data entries

272 entries across 272 versions & 1 rubygems

Version Path
playbook_ui-14.7.0.pre.rc.10 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1551tiptapextbump4350 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.6.2.pre.alpha.PLAY15814348 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.7.0.pre.rc.9 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.7.0.pre.rc.8 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR633dropdownavailablepropstable4316 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.7.0.pre.rc.7 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR576tooltiptruncatedformpills4312 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR633dropdownavailablepropstable4305 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.7.0.pre.rc.6 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR576tooltiptruncatedformpills4304 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR633dropdownavailablepropstable4303 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR576tooltiptruncatedformpills4296 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1550lazysizesupgrade4295 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4274 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1607dependencydisplayymlupdate4271 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1538READMEroot4262 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1538READMEroot4260 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1550lazysizesupgrade4257 app/pb_kits/playbook/pb_timeline/_timeline.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1538READMEroot4254 app/pb_kits/playbook/pb_timeline/_timeline.tsx