Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/Busy/index.js
Original file line number Diff line number Diff line change
@@ -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 <hx-busy class={className} {...rest}></hx-busy>;
};

Busy.propTypes = {
paused: PropTypes.bool,
className: PropTypes.string,
};

export default Busy;
15 changes: 15 additions & 0 deletions src/Progress/index.js
Original file line number Diff line number Diff line change
@@ -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 <hx-progress class={className} {...rest} value={value.toString()}></hx-progress>;
};

Progress.propTypes = {
value: PropTypes.number,
className: PropTypes.string,
};

export default Progress;
21 changes: 21 additions & 0 deletions src/Progress/stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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 <Busy {...(paused && { paused })} />;
})
.add('Progress', () => {
const options = {
range: true,
min: 0,
max: 100,
step: 1,
};
let value = number('value', 40, options);
return <Progress value={value.toString()} />;
});
4 changes: 4 additions & 0 deletions src/index.mjs
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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';
Expand All @@ -24,6 +26,7 @@ import Tooltip from './Tooltip';
export {
Alert,
Button,
Busy,
Checkbox,
ChoiceTile,
Disclosure,
Expand All @@ -33,6 +36,7 @@ export {
Modal,
Pill,
Popover,
Progress,
Radio,
RadioSet,
Search,
Expand Down