Sha256: 3bd3d84abb57ffe2ba9aa7ef7be8b0798183914286e9bc3ea949d5c99d6c85eb

Contents?: true

Size: 797 Bytes

Versions: 28

Compression:

Stored size: 797 Bytes

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'
import { buildCss } from '../utilities/props'
import { spacing } from '../utilities/spacing.js'

type BadgeProps = {
  className?: String,
  dark?: Boolean,
  id?: String,
  text?: String,
  variant?: "success" | "warning" | "error" | "info" | "neutral",
  rounded?: Boolean,
}
const Badge = (props: BadgeProps) => {
  const {
    className,
    dark = false,
    id,
    text,
    variant = 'neutral',
    rounded = false,
  } = props
  const css = classnames(
    className,
    buildCss('pb_badge_kit', variant, {
      rounded: rounded,
      dark: dark,
    }),
    spacing(props)
  )

  return (
    <div
        className={css}
        id={id}
    >
      <span>{text}</span>
    </div>
  )
}

export default Badge

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
playbook_ui-5.2.0.pre.alpha15 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.2.0.pre.alpha14 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.2.0.pre.alpha13 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.2.0.pre.alpha12 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.2.0.pre.alpha11 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.2.0.pre.alpha10 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.2.0.pre.alpha9 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.2.0.pre.alpha8 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.2.0.pre.alpha7 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.2.0.pre.alpha6 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.2.0.pre.alpha5 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.2.0.pre.alpha4 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.2.0.pre.alpha3 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.2.0.pre.alpha2 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.2.0 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.1.0 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.0.3 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.0.2 app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.0.1.pre.beta app/pb_kits/playbook/pb_badge/_badge.jsx
playbook_ui-5.1.0.pre.alpha4 app/pb_kits/playbook/pb_badge/_badge.jsx