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.6.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.5.2 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.5.1 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.5.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.4.1 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.4.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.3.1 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.3.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.2.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.1.2 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.1.1 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.1.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.0.1 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-4.0.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-3.5.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-3.4.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-3.3.0 app/pb_kits/playbook/pb_title/_title.jsx
playbook_ui-3.2.0 app/pb_kits/playbook/pb_title/_title.jsx