Skip to content

Commit

Permalink
Added Progress Bar and build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
w3aseL committed Jul 31, 2020
1 parent bb739e6 commit 1c3340c
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Basic Ignores
/node_modules
package-lock.json
package-lock.json
/build
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "./src/components/index.js",
"scripts": {
"test": "jest",
"docs": "styleguidist server"
"docs": "styleguidist server",
"build": "styleguidist build"
},
"keywords": [
"revibe",
Expand Down
75 changes: 75 additions & 0 deletions src/components/Progress/Progress.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*!
=========================================================
* BLK Design System PRO React - v1.0.0
=========================================================
* Product Page: https://www.creative-tim.com/product/blk-design-system-pro-react
* Copyright 2019 Creative Tim (https://www.creative-tim.com)
* Coded by Creative Tim
=========================================================
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*/
import React from 'react'
import PropTypes from 'prop-types'

import { Progress as ProgressBar } from 'reactstrap'

// Add your info to the docs if you edit this!

/**
* ### Baseline progress bar!
*
* @version 0.0.1
* @author Noah Templet ([w3aseL](https://github.com/w3aseL))
*/
class Progress extends React.Component {
constructor(props) {
super(props)
}

static propTypes = {
/**
* The value of the progress bar.
*/
value: PropTypes.number.isRequired,
/**
* The maximum value of the progress bar.
*/
max: PropTypes.number,
/**
* The label for the progress bar.
*/
label: PropTypes.string,
/**
* The color of the progress bar.
*/
color: PropTypes.string
}

static defaultProps = {
max: 100,
label: "Default"
}

render() {
const { value, max, label, color } = this.props

return (
<div className={`progress-container ${color ? `progress-${color}` : ""}`}>
<span className="progress-badge">{label}</span>
<ProgressBar max={max} value={value}>
<span className="progress-value">{((value / max) * 100).toFixed(0)}%</span>
</ProgressBar>
</div>
)
}
}

export { Progress }

export default Progress
29 changes: 29 additions & 0 deletions src/components/Progress/Progress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
### Progress Bar Syntax

Importing the progress bar.
```js static
import Progress from 'revibe-component-library/Progress'

import { Progress } from 'revibe-component-library'
```

### Progress Simple Example
```js
<Progress value={25} />
```

### Progress Color Examples
```js
<Progress value={25} />
<Progress value={30} color="primary" label="Primary" />
<Progress value={35} color="secondary" label="Secondary" />
<Progress value={40} color="info" label="Info" />
<Progress value={45} color="success" label="Success" />
<Progress value={50} color="warning" label="Warning" />
<Progress value={55} color="danger" label="Danger" />
```

### Progress Max Examples
```js
<Progress value={25} max={75} color="primary" label="25/75" />
```
Empty file.
3 changes: 3 additions & 0 deletions src/components/Progress/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"main": "Progress.jsx"
}
3 changes: 2 additions & 1 deletion src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export * from './Slider'
export * from './Tags'
export * from './InfoArea'
export * from './Text'
export * from './Dropdown'
export * from './Dropdown'
export * from './Progress'
3 changes: 2 additions & 1 deletion styleguide.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ module.exports = {
title: "Revibe Component Library",
styleguideComponents: {
StyleGuideRenderer: path.join(__dirname, 'styleguide/StyleGuide')
}
},
styleguideDir: "./build"
};

0 comments on commit 1c3340c

Please sign in to comment.