Sha256: bb12569fdb2d0b805a0931bb8e527c71a089d8e48bd94909121a86af4562ea61

Contents?: true

Size: 1.85 KB

Versions: 504

Compression:

Stored size: 1.85 KB

Contents

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

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

import Body from '../pb_body/_body'
import Flex from '../pb_flex/_flex'
import FlexItem from '../pb_flex/_flex_item'
import DateYearStacked from '../pb_date_year_stacked/_date_year_stacked'
import Icon from '../pb_icon/_icon'

type DateRangeStackedProps = {
  className?: string | string[],
  data?: string,
  dark?: boolean,
  endDate: Date,
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
  id?: string,
  startDate: Date,
}

const DateRangeStacked = (props: DateRangeStackedProps): React.ReactElement => {
  const { 
    className, 
    dark = false, 
    endDate, 
    htmlOptions={},
    startDate, 
    data={},
  } = props
  const css = classnames(
    buildCss('pb_date_range_stacked'),
    globalProps(props),
    className
  )
   const dataProps = buildDataProps(data)
   const htmlProps = buildHtmlProps(htmlOptions)

  return (
    <div 
        {...dataProps}
        {...htmlProps}
        className={css}
    >
      <Flex vertical="center">
        <FlexItem>
          <DateYearStacked
              align="right"
              dark={dark}
              date={startDate}
          />
        </FlexItem>
        <FlexItem>
          <div>
            <Body
                color="light"
                tag="span"
            >
              <Icon
                  className="pb_date_range_stacked_arrow"
                  fixedWidth
                  icon="long-arrow-right"
              />
            </Body>
          </div>
        </FlexItem>
        <FlexItem>
          <DateYearStacked
              dark={dark}
              date={endDate}
          />
        </FlexItem>
      </Flex>
    </div>
  )
}

export default DateRangeStacked

Version data entries

504 entries across 504 versions & 1 rubygems

Version Path
playbook_ui-14.6.2.pre.alpha.PBNTR633dropdownavailablepropstable4305 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.7.0.pre.rc.6 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR576tooltiptruncatedformpills4304 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR633dropdownavailablepropstable4303 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR576tooltiptruncatedformpills4296 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1550lazysizesupgrade4295 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4274 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1607dependencydisplayymlupdate4271 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1538READMEroot4262 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1538READMEroot4260 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1550lazysizesupgrade4257 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1538READMEroot4254 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1538READMEroot4251 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.7.0.pre.rc.5 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4247 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.7.0.pre.rc.4 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.7.0.pre.rc.3 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.6.2 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.7.0.pre.rc.2 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx
playbook_ui-14.6.0.pre.alpha.dropdownclassfix4224 app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx