Sha256: 3cf057bb1dc8cad27096566e123f1e8c111b5dd7b82cd5877fe2f63b3895801e

Contents?: true

Size: 1.08 KB

Versions: 6

Compression:

Stored size: 1.08 KB

Contents

/* @flow */

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

import styles from './styles.scss'


type Props = {
  children?: Array<React.Node>,
  color: "sky-lighter" | "sky-light" | "sky" | "sky-dark" | "ink-lightest" | "ink-lighter" | "ink-light"| "ink" | "ink-dark",
  size: "base" | "large" | "larger" | "largest" | "small" | "smaller" | "smallest",
  bold: boolean,
  italic: boolean,
  className: string,
}

export default class Text extends React.Component<Props> {
  static defaultProps = {
    children: <span/>,
    size: "base",
    color: "ink",
    bold: false,
    italic: false,
    className: "",
  }
  props: Props
  render() {
    const {
      children,
      className,
      bold,
      italic,
      size,
      color,
    } = this.props
    const css = [
      className,
      styles.badge,
      styles[`text-${color}`],
      styles[`text-${size}`],
      bold ? styles["font-weight-bold"] : null,
      italic ? styles["font-italic"] : null,
    ]
    return (
      <span
          className={classnames(css)}
      >
        {children}
      </span>
    )
  }
}

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
playbook_ui-2.7.2 components/Text/Text.jsx
playbook_ui-2.7.1 components/Text/Text.jsx
playbook_ui-2.7.0 components/Text/Text.jsx
playbook_ui-2.6.0 components/Text/Text.jsx
playbook_ui-2.5.0 components/Text/Text.jsx
nitro_sg-3.0.2 components/Text/Text.jsx