Sha256: b427096b4a983ac9cf134d36662eb949c99fcb18f39362b0c3efd2a702ed6016

Contents?: true

Size: 1.26 KB

Versions: 10

Compression:

Stored size: 1.26 KB

Contents

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

import { buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
import { globalProps } from '../utilities/globalProps'
import DateTime from '../pb_kit/dateTime';

import Body from '../pb_body/_body'
import Title from '../pb_title/_title'

type DateYearStackedProps = {
  align?: "left" | "center" | "right",
  className?: string | string[],
  dark?: boolean,
  data?: string,
  date: Date,
  htmlOptions?: {[key: string]: string | number | boolean | Function},
  id?: string,
}

const DateYearStacked = (props: DateYearStackedProps) => {
  const { 
    align = 'left', 
    className, 
    dark = false, 
    date, 
    data={},
    htmlOptions = {}, 
  } = props
  const css = classnames(
    buildCss('pb_date_year_stacked', align),
    globalProps(props),
    className
  )
   const dataProps = buildDataProps(data)
   const htmlProps = buildHtmlProps(htmlOptions)

  return (
    <div 
        {...dataProps}
        {...htmlProps}
        className={css}
    >
      <Title
          dark={dark}
          size={4}
          text={`${DateTime.toDay(date)} ${DateTime.toMonth(date).toUpperCase()}`}
      />
      <Body color="light">{DateTime.toYear(date)}</Body>
    </div>
  )
}

export default DateYearStacked

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
playbook_ui-13.14.0.pre.alpha.PLAY1109bugdisplaypropblocksfontcolor1784 app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx
playbook_ui-13.14.0.pre.alpha.play1106filter1751 app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx
playbook_ui-13.14.0.pre.alpha.play1106filter1748 app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx
playbook_ui-13.14.0 app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx
playbook_ui-13.13.0.pre.alpha.PLAY1097linterenhancedelement1728 app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx
playbook_ui-13.13.0.pre.alpha.play10221678 app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx
playbook_ui-13.13.0.pre.alpha.PLAY1090csstokens1675 app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx
playbook_ui-13.13.0.pre.alpha.play900startratingasinput1657 app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx
playbook_ui-13.13.0 app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx
playbook_ui-13.12.0.pre.alpha.play10281596 app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx