Skip to content

Commit 7a7e7af

Browse files
authored
Merge branch 'master' into Breadcrumb
2 parents 094b974 + fd265ff commit 7a7e7af

4 files changed

Lines changed: 54 additions & 0 deletions

File tree

src/Busy/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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;

src/Progress/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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;

src/Progress/stories.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
});

src/index.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import Alert from './Alert';
33
import Button from './Button';
44
import Breadcrumb from './Breadcrumb';
5+
import Busy from './Busy';
56
import Checkbox from './Checkbox';
67
import ChoiceTile from './ChoiceTile';
78
import Disclosure from './Disclosure';
@@ -10,6 +11,7 @@ import Drawer from './Drawer';
1011
import Icon from './Icon';
1112
import Modal from './Modal';
1213
import Pill from './Pill';
14+
import Progress from './Progress';
1315
import Status from './Pill/Status';
1416
import Popover from './Popover';
1517
import Radio from './Radio';
@@ -26,6 +28,7 @@ export {
2628
Alert,
2729
Button,
2830
Breadcrumb,
31+
Busy,
2932
Checkbox,
3033
ChoiceTile,
3134
Disclosure,
@@ -35,6 +38,7 @@ export {
3538
Modal,
3639
Pill,
3740
Popover,
41+
Progress,
3842
Radio,
3943
RadioSet,
4044
Search,

0 commit comments

Comments
 (0)