From 47f77348991bbc47199b7a2465f70f43d579edba Mon Sep 17 00:00:00 2001 From: Nicko Winner-Arroyo Date: Fri, 16 Oct 2020 17:18:34 -0400 Subject: [PATCH 1/2] Loader --- src/Busy/index.js | 14 ++++++++++++++ src/Progress/index.js | 15 +++++++++++++++ src/Progress/stories.js | 25 +++++++++++++++++++++++++ src/index.mjs | 4 ++++ 4 files changed, 58 insertions(+) create mode 100644 src/Busy/index.js create mode 100644 src/Progress/index.js create mode 100644 src/Progress/stories.js diff --git a/src/Busy/index.js b/src/Busy/index.js new file mode 100644 index 0000000..edb3bfa --- /dev/null +++ b/src/Busy/index.js @@ -0,0 +1,14 @@ +import PropTypes from 'prop-types'; +import React from 'react'; + +// Storybook story lives in /Progress folder +const Busy = ({ className, children, ...rest }) => { + return (); +}; + +Busy.propTypes = { + paused: PropTypes.bool, + className: PropTypes.string +}; + +export default Busy; diff --git a/src/Progress/index.js b/src/Progress/index.js new file mode 100644 index 0000000..b2b6126 --- /dev/null +++ b/src/Progress/index.js @@ -0,0 +1,15 @@ +import PropTypes from 'prop-types'; +import React from 'react'; +import classnames from 'classnames'; +import useEventListener from '../hooks/useEventListener'; + +const Progress = ({ className, children, value, ...rest }) => { + return (); +}; + +Progress.propTypes = { + value: PropTypes.number, + className: PropTypes.string +}; + +export default Progress; diff --git a/src/Progress/stories.js b/src/Progress/stories.js new file mode 100644 index 0000000..406ab35 --- /dev/null +++ b/src/Progress/stories.js @@ -0,0 +1,25 @@ +import React from 'react'; +import { boolean, number } from '@storybook/addon-knobs/react'; +import { storiesOf } from '@storybook/react'; +import Busy from '../Busy'; +import Progress from './index'; + +storiesOf('Loader', module) + .add('Busy', () => { + let paused = boolean('paused', false); + return ( + + ); + }) + .add('Progress', () => { + const options = { + range: true, + min: 0, + max: 100, + step: 1, + }; + let value = number('value', 40, options) + return ( + + ); + }); diff --git a/src/index.mjs b/src/index.mjs index 33e8fac..c00e075 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -1,6 +1,7 @@ /* Export helix-react definition */ import Alert from './Alert'; import Button from './Button'; +import Busy from './Busy'; import Checkbox from './Checkbox'; import ChoiceTile from './ChoiceTile'; import Disclosure from './Disclosure'; @@ -9,6 +10,7 @@ import Drawer from './Drawer'; import Icon from './Icon'; import Modal from './Modal'; import Pill from './Pill'; +import Progress from './Progress'; import Status from './Pill/Status'; import Popover from './Popover'; import Radio from './Radio'; @@ -24,6 +26,7 @@ import Tooltip from './Tooltip'; export { Alert, Button, + Busy, Checkbox, ChoiceTile, Disclosure, @@ -33,6 +36,7 @@ export { Modal, Pill, Popover, + Progress, Radio, RadioSet, Search, From f9744e6654914b37823d048ba7c049c9c8f45371 Mon Sep 17 00:00:00 2001 From: Nicko Winner-Arroyo Date: Fri, 16 Oct 2020 17:18:49 -0400 Subject: [PATCH 2/2] make it pretty --- src/Busy/index.js | 4 ++-- src/Progress/index.js | 4 ++-- src/Progress/stories.js | 10 +++------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/Busy/index.js b/src/Busy/index.js index edb3bfa..bb5515e 100644 --- a/src/Busy/index.js +++ b/src/Busy/index.js @@ -3,12 +3,12 @@ import React from 'react'; // Storybook story lives in /Progress folder const Busy = ({ className, children, ...rest }) => { - return (); + return ; }; Busy.propTypes = { paused: PropTypes.bool, - className: PropTypes.string + className: PropTypes.string, }; export default Busy; diff --git a/src/Progress/index.js b/src/Progress/index.js index b2b6126..4600d48 100644 --- a/src/Progress/index.js +++ b/src/Progress/index.js @@ -4,12 +4,12 @@ import classnames from 'classnames'; import useEventListener from '../hooks/useEventListener'; const Progress = ({ className, children, value, ...rest }) => { - return (); + return ; }; Progress.propTypes = { value: PropTypes.number, - className: PropTypes.string + className: PropTypes.string, }; export default Progress; diff --git a/src/Progress/stories.js b/src/Progress/stories.js index 406ab35..4b5cc2e 100644 --- a/src/Progress/stories.js +++ b/src/Progress/stories.js @@ -7,9 +7,7 @@ import Progress from './index'; storiesOf('Loader', module) .add('Busy', () => { let paused = boolean('paused', false); - return ( - - ); + return ; }) .add('Progress', () => { const options = { @@ -18,8 +16,6 @@ storiesOf('Loader', module) max: 100, step: 1, }; - let value = number('value', 40, options) - return ( - - ); + let value = number('value', 40, options); + return ; });