Sha256: bfe8b1343c9f5670f8e4c07e0ff62a506a44f43f82ab88cc0fc7df38fbeb49f9

Contents?: true

Size: 1.18 KB

Versions: 17

Compression:

Stored size: 1.18 KB

Contents

/* @flow */
import React from 'react'
import classnames from 'classnames'
import { buildCss } from '../utilities/props'

type ProgressSimpleProps = {
  align?: "left" | "center" | "right",
  className?: String | Array<String>,
  dark?: Boolean,
  data?: String,
  id?: String,
  max?: String,
  muted: Boolean,
  percent: String,
  value: Number,
  width: String
}

const ProgressSimple = ({
  align,
  className,
  dark = false,
  max,
  muted = false,
  percent = '',
  value,
  width = '100%',
}: ProgressSimpleProps) => {
  const styles = {
    width: width,
  }

  const valueStyles = {
    width: percent ? `${percent}%` : `${(value * 100) / max}%`,
  }

  const wrapperClass = classnames(
    className,
    buildCss('pb_progress_simple_wrapper', align, { dark: dark })
  )

  const kitClass = classnames(
    className,
    buildCss('pb_progress_simple_kit', align, { muted: muted })
  )

  return (
    <div className={wrapperClass}>
      <div
          className={kitClass}
          data-value={value}
          style={styles}
      >
        <div
            className="progress_simple_value"
            style={valueStyles}
        />
      </div>
    </div>
  )
}

export default ProgressSimple

Version data entries

17 entries across 17 versions & 1 rubygems

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