File tree Expand file tree Collapse file tree 4 files changed +54
-0
lines changed Expand file tree Collapse file tree 4 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ import PropTypes from 'prop-types' ;
2+ import React from 'react' ;
3+
4+ // Storybook story lives in /Progress folder
5+ const Busy = ( { className, children, ...rest } ) => {
6+ return < hx-busy class = { className } { ...rest } > </ hx-busy > ;
7+ } ;
8+
9+ Busy . propTypes = {
10+ paused : PropTypes . bool ,
11+ className : PropTypes . string ,
12+ } ;
13+
14+ export default Busy ;
Original file line number Diff line number Diff line change 1+ import PropTypes from 'prop-types' ;
2+ import React from 'react' ;
3+ import classnames from 'classnames' ;
4+ import useEventListener from '../hooks/useEventListener' ;
5+
6+ const Progress = ( { className, children, value, ...rest } ) => {
7+ return < hx-progress class = { className } { ...rest } value = { value . toString ( ) } > </ hx-progress > ;
8+ } ;
9+
10+ Progress . propTypes = {
11+ value : PropTypes . number ,
12+ className : PropTypes . string ,
13+ } ;
14+
15+ export default Progress ;
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { boolean , number } from '@storybook/addon-knobs/react' ;
3+ import { storiesOf } from '@storybook/react' ;
4+ import Busy from '../Busy' ;
5+ import Progress from './index' ;
6+
7+ storiesOf ( 'Loader' , module )
8+ . add ( 'Busy' , ( ) => {
9+ let paused = boolean ( 'paused' , false ) ;
10+ return < Busy { ...( paused && { paused } ) } /> ;
11+ } )
12+ . add ( 'Progress' , ( ) => {
13+ const options = {
14+ range : true ,
15+ min : 0 ,
16+ max : 100 ,
17+ step : 1 ,
18+ } ;
19+ let value = number ( 'value' , 40 , options ) ;
20+ return < Progress value = { value . toString ( ) } /> ;
21+ } ) ;
Original file line number Diff line number Diff line change 11/* Export helix-react definition */
22import Alert from './Alert' ;
33import Button from './Button' ;
4+ import Busy from './Busy' ;
45import Checkbox from './Checkbox' ;
56import ChoiceTile from './ChoiceTile' ;
67import Disclosure from './Disclosure' ;
@@ -9,6 +10,7 @@ import Drawer from './Drawer';
910import Icon from './Icon' ;
1011import Modal from './Modal' ;
1112import Pill from './Pill' ;
13+ import Progress from './Progress' ;
1214import Status from './Pill/Status' ;
1315import Popover from './Popover' ;
1416import Radio from './Radio' ;
@@ -24,6 +26,7 @@ import Tooltip from './Tooltip';
2426export {
2527 Alert ,
2628 Button ,
29+ Busy ,
2730 Checkbox ,
2831 ChoiceTile ,
2932 Disclosure ,
@@ -33,6 +36,7 @@ export {
3336 Modal ,
3437 Pill ,
3538 Popover ,
39+ Progress ,
3640 Radio ,
3741 RadioSet ,
3842 Search ,
You can’t perform that action at this time.
0 commit comments