Sha256: a52fdf5fe6bea1f1b7a1e0b263cfce0412101a86d1366afa0100af22dee85763

Contents?: true

Size: 702 Bytes

Versions: 38

Compression:

Stored size: 702 Bytes

Contents

/* @flow */

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

type TitleProps = {
  className?: String,
  children?: Array<React.ReactNode> | React.ReactNode,
  dark?: Boolean,
  size?: 1 | 2 | 3 | 4,
  text?: String,
  tag?: 'h1' | 'h2' | 'h3',
}

const tagCSS = ({
  dark = false,
  size = 3,
}) => {
  let css = ''

  css += `_${size}`
  css += dark === true ? '_dark' : ''

  return css
}

const Title = (props: TitleProps) => {
  const {
    className,
    children,
    text,
    tag = 'h3',
  } = props

  const Tag = `${tag}`

  return (
    <Tag className={classnames(`pb_title_kit${tagCSS(props)}`, className)}>
      { text || children }
    </Tag>
  )
}

export default Title

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
playbook_ui-4.17.0.pre.alpha1 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.16.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.15.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.14.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.15.1.alpha1 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.13.1 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.13.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.12.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.11.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.11.0.pre.alpha3 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.11.0.pre.alpha.pre.2 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.10.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.10.0.pre.alpha1 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.9.0.pre.alpha1 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.9.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.8.2 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.8.1 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.7.1 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.7.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.6.1 app/pb_kits/playbook/pb_title/_title.jsx