beem-component 1.5.7 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +62 -0
- package/.prettierrc +6 -0
- package/babel.config.js +9 -10
- package/dist/components/Accordion/Accordion.js +7 -7
- package/dist/components/Accordion/Accordion.stories.js +28 -28
- package/dist/components/Avatars/avatars.js +22 -22
- package/dist/components/Avatars/avatars.stories.js +17 -17
- package/dist/components/BannerCard/bannerCard.stories.js +12 -12
- package/dist/components/BannerCard/bannerCards.js +14 -14
- package/dist/components/Buttons/Stories/basicbutton.stories.js +23 -23
- package/dist/components/Buttons/Stories/buttonAlertIcons.stories.js +16 -16
- package/dist/components/Buttons/Stories/buttonIconsOnly.stories.js +16 -16
- package/dist/components/Buttons/buttonAlertIcons.js +16 -16
- package/dist/components/Buttons/buttonIconsOnly.js +22 -22
- package/dist/components/Buttons/buttons.js +56 -56
- package/dist/components/Cards/cards.js +1 -1
- package/dist/components/Cards/cards.stories.js +6 -6
- package/dist/components/ChatComponents/ChatBody/chatBody.js +36 -36
- package/dist/components/ChatComponents/ChatBody/chatBody.stories.js +4 -4
- package/dist/components/ChatComponents/ChatHeader/chatHeader.js +1 -1
- package/dist/components/ChatComponents/ChatHeader/chatHeader.stories.js +1 -1
- package/dist/components/ChatComponents/ColorPicker/colorPicker.stories.js +7 -3
- package/dist/components/ChatComponents/ContactCards/contactCards.js +1 -2
- package/dist/components/ChatComponents/ContactCards/contactCards.stories.js +1 -1
- package/dist/components/ChatComponents/FormAccordion/FormAccordion.stories.js +9 -5
- package/dist/components/ChatComponents/InfoTab/infoTab.js +1 -1
- package/dist/components/ChatComponents/InfoTab/infoTab.stories.js +4 -4
- package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +12 -7
- package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +14 -12
- package/dist/components/Checkbox/checkboxToggler.js +64 -0
- package/dist/components/Checkbox/checkboxToggler.stories.js +92 -0
- package/dist/components/Lists/listBox.js +5 -5
- package/dist/components/Lists/listBox.stories.js +5 -5
- package/dist/components/Lists/listHeader.stories.js +11 -11
- package/dist/components/Lists/listheader.js +4 -4
- package/dist/components/Lists/rowLabels.js +2 -2
- package/dist/components/Lists/rowLabels.stories.js +16 -16
- package/dist/components/Loader/loader.js +7 -7
- package/dist/components/Loader/loader.stories.js +11 -11
- package/dist/components/MessageCounter/MessageCounter.stories.js +13 -13
- package/dist/components/MessageCounter/messageCounter.js +11 -11
- package/dist/components/Modals/modal.js +6 -8
- package/dist/components/Modals/modals.stories.js +6 -6
- package/dist/components/NoteBar/noteBar.js +14 -14
- package/dist/components/NoteBar/noteBar.stories.js +15 -15
- package/dist/components/PerformanceIndicator/performaceIndicator.stories.js +13 -13
- package/dist/components/PerformanceIndicator/performanceIndicator.js +14 -12
- package/dist/components/Pills/pills.js +10 -10
- package/dist/components/Pills/pills.stories.js +19 -21
- package/dist/components/ProfileIcon/ProfileIcon.js +14 -14
- package/dist/components/ProfileIcon/profileIcon.stories.js +16 -16
- package/dist/components/ProgressBar/progressbar.stories.js +6 -8
- package/dist/components/ProgressRing/progressRing.js +19 -19
- package/dist/components/ProgressRing/progressRing.stories.js +14 -14
- package/dist/components/RouteLink/link.js +3 -3
- package/dist/components/RouteLink/link.stories.js +1 -1
- package/dist/components/ScrollBar/scrollBar.js +9 -9
- package/dist/components/SuperFluid/SegmentCard/index.js +2 -2
- package/dist/components/Tabs/tabs.js +6 -6
- package/dist/components/Tabs/tabs.stories.js +17 -17
- package/dist/components/Tags/tags.js +21 -21
- package/dist/components/Tags/tags.stories.js +16 -16
- package/dist/components/breakpoints.js +3 -3
- package/dist/components/checkbox.js +4 -4
- package/dist/components/colors.js +32 -30
- package/dist/components/dropdownButton.js +35 -35
- package/dist/components/examples/InfoAccordion.js +0 -1
- package/dist/components/iconStyles.js +45 -45
- package/dist/components/index.js +32 -16
- package/dist/components/input.js +16 -16
- package/dist/components/typography.js +14 -14
- package/package.json +54 -31
- package/src/App.js +10 -7
- package/src/index.js +6 -8
- package/src/lib/components/Accordion/Accordion.js +32 -14
- package/src/lib/components/Accordion/Accordion.stories.js +31 -31
- package/src/lib/components/Avatars/avatars.js +33 -28
- package/src/lib/components/Avatars/avatars.stories.js +18 -18
- package/src/lib/components/BannerCard/bannerCard.stories.js +16 -17
- package/src/lib/components/BannerCard/bannerCards.js +18 -18
- package/src/lib/components/Buttons/Stories/basicbutton.stories.js +29 -29
- package/src/lib/components/Buttons/Stories/buttonAlertIcons.stories.js +17 -17
- package/src/lib/components/Buttons/Stories/buttonIconsOnly.stories.js +24 -24
- package/src/lib/components/Buttons/buttonAlertIcons.js +22 -25
- package/src/lib/components/Buttons/buttonIconsOnly.js +32 -28
- package/src/lib/components/Buttons/buttons.js +70 -73
- package/src/lib/components/Cards/cards.js +2 -3
- package/src/lib/components/Cards/cards.stories.js +10 -10
- package/src/lib/components/ChatComponents/ChatBody/chatBody.js +46 -45
- package/src/lib/components/ChatComponents/ChatBody/chatBody.stories.js +34 -28
- package/src/lib/components/ChatComponents/ChatBody/sessionDetails.js +2 -2
- package/src/lib/components/ChatComponents/ChatHeader/chatHeader.js +2 -2
- package/src/lib/components/ChatComponents/ChatHeader/chatHeader.stories.js +4 -4
- package/src/lib/components/ChatComponents/ColorPicker/colorPicker.js +2 -2
- package/src/lib/components/ChatComponents/ColorPicker/colorPicker.stories.js +4 -3
- package/src/lib/components/ChatComponents/ContactCards/contactCards.js +7 -5
- package/src/lib/components/ChatComponents/ContactCards/contactCards.stories.js +6 -6
- package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.js +3 -3
- package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.stories.js +4 -3
- package/src/lib/components/ChatComponents/InfoTab/infoTab.js +2 -2
- package/src/lib/components/ChatComponents/InfoTab/infoTab.stories.js +7 -7
- package/src/lib/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +5 -3
- package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.js +2 -2
- package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +6 -5
- package/src/lib/components/Checkbox/checkboxToggler.js +89 -0
- package/src/lib/components/Checkbox/checkboxToggler.stories.js +48 -0
- package/src/lib/components/Lists/listBox.js +7 -7
- package/src/lib/components/Lists/listBox.stories.js +8 -11
- package/src/lib/components/Lists/listHeader.stories.js +13 -13
- package/src/lib/components/Lists/listheader.js +7 -7
- package/src/lib/components/Lists/rowLabels.js +6 -6
- package/src/lib/components/Lists/rowLabels.stories.js +18 -18
- package/src/lib/components/Loader/loader.js +13 -13
- package/src/lib/components/Loader/loader.stories.js +14 -14
- package/src/lib/components/MainWrapper/index.js +2 -2
- package/src/lib/components/MessageCounter/MessageCounter.stories.js +14 -14
- package/src/lib/components/MessageCounter/messageCounter.js +16 -16
- package/src/lib/components/Modals/modal.js +25 -23
- package/src/lib/components/Modals/modals.stories.js +9 -9
- package/src/lib/components/NoteBar/noteBar.js +20 -20
- package/src/lib/components/NoteBar/noteBar.stories.js +18 -17
- package/src/lib/components/PerformanceIndicator/performaceIndicator.stories.js +15 -15
- package/src/lib/components/PerformanceIndicator/performanceIndicator.js +11 -10
- package/src/lib/components/Pills/pills.js +16 -16
- package/src/lib/components/Pills/pills.stories.js +22 -23
- package/src/lib/components/ProfileIcon/ProfileIcon.js +50 -52
- package/src/lib/components/ProfileIcon/profileIcon.stories.js +22 -22
- package/src/lib/components/ProgressBar/progressbar.js +4 -5
- package/src/lib/components/ProgressBar/progressbar.stories.js +8 -9
- package/src/lib/components/ProgressRing/progressRing.js +25 -24
- package/src/lib/components/ProgressRing/progressRing.stories.js +18 -18
- package/src/lib/components/RouteLink/link.js +10 -8
- package/src/lib/components/RouteLink/link.stories.js +4 -4
- package/src/lib/components/ScrollBar/scrollBar.js +15 -14
- package/src/lib/components/SuperFluid/Content/index.js +2 -2
- package/src/lib/components/SuperFluid/ContentTitle.js/index.js +2 -2
- package/src/lib/components/SuperFluid/SegmentCard/index.js +9 -8
- package/src/lib/components/Tabs/tabs.js +11 -11
- package/src/lib/components/Tabs/tabs.stories.js +20 -20
- package/src/lib/components/Tags/tags.js +26 -24
- package/src/lib/components/Tags/tags.stories.js +19 -19
- package/src/lib/components/breakpoints.js +3 -3
- package/src/lib/components/checkbox.js +7 -6
- package/src/lib/components/colors.js +30 -28
- package/src/lib/components/dropdownButton.js +36 -39
- package/src/lib/components/examples/InfoAccordion.js +1 -1
- package/src/lib/components/globalStyles.js +2 -2
- package/src/lib/components/iconStyles.js +45 -48
- package/src/lib/components/index.js +48 -45
- package/src/lib/components/input.js +20 -20
- package/src/lib/components/text.js +1 -1
- package/src/lib/components/typography.js +14 -14
- package/src/reportWebVitals.js +1 -1
- package/dist/components/checkboxToggler.js +0 -50
- package/src/lib/components/checkboxToggler.js +0 -19
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React from
|
|
3
|
-
import { BmLoader } from
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BmLoader } from './loader';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
component: BmLoader,
|
|
7
|
-
title:
|
|
7
|
+
title: 'components/Loader',
|
|
8
8
|
argTypes: {
|
|
9
9
|
size: {
|
|
10
|
-
options: [
|
|
11
|
-
control: { type:
|
|
12
|
-
description:
|
|
13
|
-
defaultValue: { summary:
|
|
10
|
+
options: ['small', 'medium', 'large'],
|
|
11
|
+
control: { type: 'select' },
|
|
12
|
+
description: 'Size of the loader (Can also be predefined e.g. 10px)',
|
|
13
|
+
defaultValue: { summary: 'large' },
|
|
14
14
|
},
|
|
15
15
|
type: {
|
|
16
|
-
options: [
|
|
17
|
-
control: { type:
|
|
18
|
-
description:
|
|
19
|
-
defaultValue: { summary:
|
|
16
|
+
options: ['success', 'warning', 'error'],
|
|
17
|
+
control: { type: 'select' },
|
|
18
|
+
description: 'Type of loader',
|
|
19
|
+
defaultValue: { summary: 'Beem default loader' },
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
22
|
};
|
|
@@ -25,6 +25,6 @@ const MainLoader = (args) => <BmLoader {...args} />;
|
|
|
25
25
|
|
|
26
26
|
export const Loader = MainLoader.bind({});
|
|
27
27
|
Loader.args = {
|
|
28
|
-
type:
|
|
29
|
-
size:
|
|
30
|
-
};
|
|
28
|
+
type: 'success',
|
|
29
|
+
size: 'small',
|
|
30
|
+
};
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { text, select } from '@storybook/addon-knobs';
|
|
4
|
+
import BmCounter from './messageCounter';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: BmCounter,
|
|
8
|
-
title:
|
|
8
|
+
title: 'components/MessageCounter',
|
|
9
9
|
argTypes: {
|
|
10
10
|
size: {
|
|
11
|
-
options: [
|
|
12
|
-
control: { type:
|
|
13
|
-
description:
|
|
14
|
-
defaultValue: { summary:
|
|
11
|
+
options: ['small', 'medium', 'large'],
|
|
12
|
+
control: { type: 'select' },
|
|
13
|
+
description: 'Size of the counter (can also be custom example: 10px)',
|
|
14
|
+
defaultValue: { summary: 'small' },
|
|
15
15
|
},
|
|
16
16
|
children: {
|
|
17
|
-
description:
|
|
17
|
+
description: 'Counter Text',
|
|
18
18
|
defaultValue: { summary: undefined },
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const optionSize = {
|
|
24
|
-
small:
|
|
25
|
-
medium:
|
|
26
|
-
large:
|
|
24
|
+
small: 'small',
|
|
25
|
+
medium: 'medium',
|
|
26
|
+
large: 'large',
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export const MessageCounter = () => {
|
|
30
30
|
return (
|
|
31
|
-
<BmCounter size={select(
|
|
32
|
-
{text(
|
|
31
|
+
<BmCounter size={select('size', optionSize, 'large')}>
|
|
32
|
+
{text('children', '00')}
|
|
33
33
|
</BmCounter>
|
|
34
34
|
);
|
|
35
35
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import PropTypes from
|
|
3
|
-
import { BmPrimaryWhite, BmPrimaryBlue } from
|
|
4
|
-
import { h3, h4, p } from
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { BmPrimaryWhite, BmPrimaryBlue } from '../colors';
|
|
4
|
+
import { h3, h4, p } from '../text';
|
|
5
5
|
|
|
6
6
|
const BmCounter = styled.div`
|
|
7
7
|
display: flex;
|
|
@@ -10,23 +10,23 @@ const BmCounter = styled.div`
|
|
|
10
10
|
text-align: center;
|
|
11
11
|
color: ${BmPrimaryWhite};
|
|
12
12
|
width: ${({ size }) => {
|
|
13
|
-
if (size ===
|
|
14
|
-
if (size ===
|
|
15
|
-
if (size ===
|
|
16
|
-
if (!size) return
|
|
13
|
+
if (size === 'small') return '1.429rem';
|
|
14
|
+
if (size === 'medium') return '1.714rem';
|
|
15
|
+
if (size === 'large') return '2.286rem';
|
|
16
|
+
if (!size) return '1.429rem';
|
|
17
17
|
return size;
|
|
18
18
|
}};
|
|
19
19
|
height: ${({ size }) => {
|
|
20
|
-
if (size ===
|
|
21
|
-
if (size ===
|
|
22
|
-
if (size ===
|
|
23
|
-
if (!size) return
|
|
20
|
+
if (size === 'small') return '1.429rem';
|
|
21
|
+
if (size === 'medium') return '1.714rem';
|
|
22
|
+
if (size === 'large') return '2.286rem';
|
|
23
|
+
if (!size) return '1.429rem';
|
|
24
24
|
return size;
|
|
25
25
|
}};
|
|
26
26
|
${({ size }) => {
|
|
27
|
-
if (size ===
|
|
28
|
-
if (size ===
|
|
29
|
-
if (size ===
|
|
27
|
+
if (size === 'large') return `${h3}`;
|
|
28
|
+
if (size === 'medium') return `${h4}`;
|
|
29
|
+
if (size === 'small') return `${p}`;
|
|
30
30
|
return `${p}`;
|
|
31
31
|
}}
|
|
32
32
|
border-radius: 50%;
|
|
@@ -39,4 +39,4 @@ BmCounter.propTypes = {
|
|
|
39
39
|
size: PropTypes.string,
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
export default BmCounter;
|
|
42
|
+
export default BmCounter;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
1
|
+
/* eslint-disable no-undef */
|
|
2
|
+
|
|
3
|
+
/* eslint-disable react/display-name */
|
|
4
|
+
|
|
5
|
+
import React, { useEffect, useCallback, useState } from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { Clear } from '@material-ui/icons';
|
|
8
|
+
import styled from 'styled-components';
|
|
9
|
+
import { BmBgGrey45, BmPrimaryWhite } from '../colors';
|
|
10
|
+
import { BmIcons } from '../iconStyles';
|
|
7
11
|
|
|
8
12
|
const { Provider, Consumer } = React.createContext();
|
|
9
13
|
|
|
@@ -51,14 +55,7 @@ export const ModalWrapper = styled.div`
|
|
|
51
55
|
overflow-y: auto;
|
|
52
56
|
`;
|
|
53
57
|
|
|
54
|
-
|
|
55
|
-
children,
|
|
56
|
-
show,
|
|
57
|
-
size,
|
|
58
|
-
onHide,
|
|
59
|
-
centered,
|
|
60
|
-
...rest
|
|
61
|
-
}) => {
|
|
58
|
+
const BmModal = ({ children, show, size, onHide, centered, ...rest }) => {
|
|
62
59
|
const [toggle, setToggle] = useState(show);
|
|
63
60
|
useEffect(() => {
|
|
64
61
|
setToggle(show);
|
|
@@ -66,16 +63,16 @@ export const BmModal = ({
|
|
|
66
63
|
|
|
67
64
|
const keyPress = useCallback(
|
|
68
65
|
(e) => {
|
|
69
|
-
if (e.key ===
|
|
66
|
+
if (e.key === 'Escape' && show && onHide !== undefined) {
|
|
70
67
|
onHide(false);
|
|
71
68
|
}
|
|
72
69
|
},
|
|
73
|
-
[onHide, show]
|
|
70
|
+
[onHide, show]
|
|
74
71
|
);
|
|
75
72
|
|
|
76
73
|
useEffect(() => {
|
|
77
|
-
document.addEventListener(
|
|
78
|
-
return () => document.removeEventListener(
|
|
74
|
+
document.addEventListener('keydown', keyPress);
|
|
75
|
+
return () => document.removeEventListener('keydown', keyPress);
|
|
79
76
|
}, [keyPress]);
|
|
80
77
|
|
|
81
78
|
return (
|
|
@@ -100,7 +97,7 @@ const ModalHeader = styled.div`
|
|
|
100
97
|
display: flex;
|
|
101
98
|
flex-direction: row;
|
|
102
99
|
justify-content: space-between;
|
|
103
|
-
align-items:center;
|
|
100
|
+
align-items: center;
|
|
104
101
|
`;
|
|
105
102
|
|
|
106
103
|
BmModal.Header = ({ children, size, onHide, closeButton, show, ...rest }) => {
|
|
@@ -120,7 +117,9 @@ BmModal.Header = ({ children, size, onHide, closeButton, show, ...rest }) => {
|
|
|
120
117
|
}
|
|
121
118
|
{...rest}
|
|
122
119
|
/>
|
|
123
|
-
) :
|
|
120
|
+
) : (
|
|
121
|
+
<p> </p>
|
|
122
|
+
)}
|
|
124
123
|
</ModalHeader>
|
|
125
124
|
</>
|
|
126
125
|
)}
|
|
@@ -132,7 +131,7 @@ BmModal.SubHeader = styled.div`
|
|
|
132
131
|
display: flex;
|
|
133
132
|
flex-direction: row;
|
|
134
133
|
justify-content: center;
|
|
135
|
-
align-items:center;
|
|
134
|
+
align-items: center;
|
|
136
135
|
`;
|
|
137
136
|
|
|
138
137
|
BmModal.Body = styled.div`
|
|
@@ -142,7 +141,8 @@ BmModal.Body = styled.div`
|
|
|
142
141
|
> *:not(:last-child) {
|
|
143
142
|
margin-bottom: 0.5rem;
|
|
144
143
|
}
|
|
145
|
-
${
|
|
144
|
+
${
|
|
145
|
+
'' /* max-height: ${({ size }) => {
|
|
146
146
|
if (size) {
|
|
147
147
|
if (size === "small") return "21.429rem";
|
|
148
148
|
if (size === "default") return "35.714rem";
|
|
@@ -152,7 +152,8 @@ BmModal.Body = styled.div`
|
|
|
152
152
|
}
|
|
153
153
|
return "35.714rem";
|
|
154
154
|
}};
|
|
155
|
-
overflow: auto; */
|
|
155
|
+
overflow: auto; */
|
|
156
|
+
}
|
|
156
157
|
`;
|
|
157
158
|
|
|
158
159
|
BmModal.Footer = styled.div`
|
|
@@ -167,4 +168,5 @@ BmModal.propTypes = {
|
|
|
167
168
|
onHide: PropTypes.func.isRequired,
|
|
168
169
|
closeButton: PropTypes.bool,
|
|
169
170
|
};
|
|
171
|
+
|
|
170
172
|
export default BmModal;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React, { useState } from
|
|
3
|
-
import BmModal from
|
|
4
|
-
import { BmButton } from
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import BmModal from './modal';
|
|
4
|
+
import { BmButton } from '../Buttons/buttons';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: BmModal,
|
|
8
|
-
title:
|
|
9
|
-
|
|
8
|
+
title: 'components/Modals',
|
|
9
|
+
argTypes: {
|
|
10
10
|
// size: {
|
|
11
11
|
// options: ["small", "default", "large", "xlarge"],
|
|
12
12
|
// control: { type: "select" },
|
|
@@ -15,17 +15,17 @@ export default {
|
|
|
15
15
|
// },
|
|
16
16
|
closeButton: {
|
|
17
17
|
description:
|
|
18
|
-
|
|
18
|
+
'Placed on BmModal.Header component. Displays the close button (X)',
|
|
19
19
|
},
|
|
20
20
|
// centered: {
|
|
21
21
|
// description: "Centers the modal",
|
|
22
22
|
// },
|
|
23
23
|
show: {
|
|
24
|
-
control: { type:
|
|
25
|
-
description:
|
|
24
|
+
control: { type: 'boolean' },
|
|
25
|
+
description: 'Handling the opening and closing of the modal',
|
|
26
26
|
},
|
|
27
27
|
onHide: {
|
|
28
|
-
description:
|
|
28
|
+
description: 'Handling the closing of the modal',
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import Proptypes from
|
|
3
|
-
import { Clear, Error, Info, Warning } from
|
|
4
|
-
import styled from
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import Proptypes from 'prop-types';
|
|
3
|
+
import { Clear, Error, Info, Warning } from '@material-ui/icons';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
5
|
import {
|
|
6
6
|
BmGrey400,
|
|
7
7
|
BmPrimaryBlue,
|
|
8
8
|
BmSecondaryRed,
|
|
9
9
|
BmPrimaryGold,
|
|
10
10
|
BmSecondaryGrey,
|
|
11
|
-
} from
|
|
12
|
-
import { BmIcons } from
|
|
11
|
+
} from '../colors';
|
|
12
|
+
import { BmIcons } from '../iconStyles';
|
|
13
13
|
|
|
14
14
|
export const NoteBarWrapper = styled.div`
|
|
15
15
|
display: ${({ closeButton, isOpen }) => {
|
|
16
16
|
if (!closeButton) {
|
|
17
|
-
return
|
|
17
|
+
return 'flex';
|
|
18
18
|
}
|
|
19
|
-
return isOpen ?
|
|
19
|
+
return isOpen ? 'flex' : 'none';
|
|
20
20
|
}};
|
|
21
21
|
flex-direction: row;
|
|
22
22
|
align-items: center;
|
|
@@ -39,34 +39,34 @@ export const BmNoteBar = ({
|
|
|
39
39
|
const [isOpen, setIsOpen] = useState(true);
|
|
40
40
|
return (
|
|
41
41
|
<NoteBarWrapper closeButton={closeButton} isOpen={isOpen} {...rest}>
|
|
42
|
-
{type ===
|
|
42
|
+
{type === 'info' && (
|
|
43
43
|
<BmIcons
|
|
44
44
|
icon={<Info />}
|
|
45
|
-
color={color
|
|
46
|
-
size={size
|
|
45
|
+
color={color || `${BmPrimaryBlue}`}
|
|
46
|
+
size={size || 'large'}
|
|
47
47
|
/>
|
|
48
48
|
)}
|
|
49
|
-
{type ===
|
|
49
|
+
{type === 'error' && (
|
|
50
50
|
<BmIcons
|
|
51
51
|
icon={<Error />}
|
|
52
|
-
color={color
|
|
53
|
-
size={size
|
|
52
|
+
color={color || `${BmSecondaryRed}`}
|
|
53
|
+
size={size || 'large'}
|
|
54
54
|
/>
|
|
55
55
|
)}
|
|
56
|
-
{type ===
|
|
56
|
+
{type === 'warning' && (
|
|
57
57
|
<BmIcons
|
|
58
58
|
icon={<Warning />}
|
|
59
|
-
color={color
|
|
60
|
-
size={size
|
|
59
|
+
color={color || `${BmPrimaryGold}`}
|
|
60
|
+
size={size || 'large'}
|
|
61
61
|
/>
|
|
62
62
|
)}
|
|
63
63
|
{children}
|
|
64
64
|
{closeButton && (
|
|
65
65
|
<BmIcons
|
|
66
66
|
icon={<Clear />}
|
|
67
|
-
color={color
|
|
68
|
-
size={size
|
|
69
|
-
style={{ marginLeft:
|
|
67
|
+
color={color || `${BmSecondaryGrey}`}
|
|
68
|
+
size={size || 'small'}
|
|
69
|
+
style={{ marginLeft: 'auto' }}
|
|
70
70
|
onClick={() => setIsOpen(false)}
|
|
71
71
|
/>
|
|
72
72
|
)}
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React from
|
|
3
|
-
import { BmNoteBar } from
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BmNoteBar } from './noteBar';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
component: BmNoteBar,
|
|
7
|
-
title:
|
|
7
|
+
title: 'components/NoteBar',
|
|
8
8
|
argTypes: {
|
|
9
9
|
size: {
|
|
10
|
-
options: [
|
|
11
|
-
control: { type:
|
|
12
|
-
description:
|
|
13
|
-
defaultValue: { summary:
|
|
10
|
+
options: ['small', 'medium', 'large'],
|
|
11
|
+
control: { type: 'select' },
|
|
12
|
+
description: 'Size of the icons',
|
|
13
|
+
defaultValue: { summary: 'large' },
|
|
14
14
|
},
|
|
15
15
|
children: {
|
|
16
|
-
description:
|
|
16
|
+
description: 'Note Description ',
|
|
17
17
|
defaultValue: { summary: undefined },
|
|
18
18
|
},
|
|
19
19
|
type: {
|
|
20
|
-
options: [
|
|
21
|
-
control: { type:
|
|
22
|
-
description:
|
|
20
|
+
options: ['info', 'warning', 'error'],
|
|
21
|
+
control: { type: 'select' },
|
|
22
|
+
description: 'Type of note',
|
|
23
23
|
defaultValue: { summary: undefined },
|
|
24
24
|
},
|
|
25
25
|
color: {
|
|
26
|
-
description:
|
|
26
|
+
description: 'Color of the icon ',
|
|
27
27
|
defaultValue: { summary: undefined },
|
|
28
28
|
},
|
|
29
29
|
closeButton: {
|
|
30
|
-
description:
|
|
30
|
+
description:
|
|
31
|
+
'If present will allow to close the notebar, default size of the icon is small',
|
|
31
32
|
},
|
|
32
33
|
},
|
|
33
34
|
};
|
|
@@ -36,16 +37,16 @@ const MainNoteBar = (args) => <BmNoteBar {...args} />;
|
|
|
36
37
|
|
|
37
38
|
export const NoteBar = MainNoteBar.bind({});
|
|
38
39
|
NoteBar.args = {
|
|
39
|
-
type:
|
|
40
|
-
size:
|
|
40
|
+
type: 'warning',
|
|
41
|
+
size: 'large',
|
|
41
42
|
children: <p>NoteBar</p>,
|
|
42
43
|
color: undefined,
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
export const NoteBarWithCloseButton = MainNoteBar.bind({});
|
|
46
47
|
NoteBarWithCloseButton.args = {
|
|
47
|
-
type:
|
|
48
|
-
size:
|
|
48
|
+
type: 'warning',
|
|
49
|
+
size: 'large',
|
|
49
50
|
children: <p>NoteBar</p>,
|
|
50
51
|
color: undefined,
|
|
51
52
|
closeButton: true,
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
-
import React from
|
|
3
|
-
import { BmPerformanceIndicator } from
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BmPerformanceIndicator } from './performanceIndicator';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
component: BmPerformanceIndicator,
|
|
7
|
-
title:
|
|
7
|
+
title: 'components/PerformanceIndicator',
|
|
8
8
|
argTypes: {
|
|
9
9
|
size: {
|
|
10
|
-
options: [
|
|
11
|
-
control: { type:
|
|
12
|
-
description:
|
|
13
|
-
defaultValue: { summary:
|
|
10
|
+
options: ['small', 'medium', 'large', 'xlarge'],
|
|
11
|
+
control: { type: 'select' },
|
|
12
|
+
description: 'Size of the Indicator (Can also be predefined e.g. 10px)',
|
|
13
|
+
defaultValue: { summary: 'xlarge' },
|
|
14
14
|
},
|
|
15
15
|
type: {
|
|
16
|
-
options: [
|
|
17
|
-
control: { type:
|
|
18
|
-
description:
|
|
16
|
+
options: ['upwards', 'downwards'],
|
|
17
|
+
control: { type: 'select' },
|
|
18
|
+
description: 'Type of Indicator',
|
|
19
19
|
defaultValue: { summary: undefined },
|
|
20
20
|
},
|
|
21
21
|
children: {
|
|
22
|
-
description:
|
|
22
|
+
description: 'Performance Indicator Value (h2)',
|
|
23
23
|
defaultValue: { summary: undefined },
|
|
24
24
|
},
|
|
25
25
|
color: {
|
|
26
|
-
description:
|
|
26
|
+
description: 'Color of Performance Indicator',
|
|
27
27
|
defaultValue: { summary: undefined },
|
|
28
28
|
},
|
|
29
29
|
},
|
|
@@ -33,8 +33,8 @@ const MainPI = (args) => <BmPerformanceIndicator {...args} />;
|
|
|
33
33
|
|
|
34
34
|
export const PerformanceIndicator = MainPI.bind({});
|
|
35
35
|
PerformanceIndicator.args = {
|
|
36
|
-
type:
|
|
37
|
-
size:
|
|
38
|
-
children:
|
|
36
|
+
type: 'upwards',
|
|
37
|
+
size: 'xlarge',
|
|
38
|
+
children: '100%',
|
|
39
39
|
color: undefined,
|
|
40
40
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import Proptypes from 'prop-types';
|
|
4
|
+
import ArrowCircleUpIcon from '@mui/icons-material/ArrowCircleUp';
|
|
5
|
+
import ArrowCircleDownIcon from '@mui/icons-material/ArrowCircleDown';
|
|
6
|
+
import { BmGrey400 } from '../colors';
|
|
7
|
+
import { BmIcons } from '../iconStyles';
|
|
7
8
|
|
|
8
9
|
export const BmPIWrapper = styled.div`
|
|
9
10
|
display: flex;
|
|
@@ -29,17 +30,17 @@ export const BmPerformanceIndicator = ({
|
|
|
29
30
|
}) => {
|
|
30
31
|
return (
|
|
31
32
|
<BmPIWrapper color={color} {...rest}>
|
|
32
|
-
{type ===
|
|
33
|
+
{type === 'upwards' && (
|
|
33
34
|
<BmIcons
|
|
34
35
|
icon={<ArrowCircleUpIcon />}
|
|
35
|
-
size={size ||
|
|
36
|
+
size={size || 'xlarge'}
|
|
36
37
|
color={color || `${BmGrey400}`}
|
|
37
38
|
/>
|
|
38
39
|
)}
|
|
39
|
-
{type ===
|
|
40
|
+
{type === 'downwards' && (
|
|
40
41
|
<BmIcons
|
|
41
42
|
icon={<ArrowCircleDownIcon />}
|
|
42
|
-
size={size ||
|
|
43
|
+
size={size || 'xlarge'}
|
|
43
44
|
color={color || `${BmGrey400}`}
|
|
44
45
|
/>
|
|
45
46
|
)}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import Proptypes from
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import Proptypes from 'prop-types';
|
|
3
3
|
// eslint-disable-next-line no-unused-vars
|
|
4
|
-
import { Clear, KeyboardArrowDown } from
|
|
5
|
-
import styled from
|
|
6
|
-
import
|
|
7
|
-
import { BmGrey100 } from
|
|
8
|
-
import { BmIcons } from
|
|
9
|
-
import { p } from
|
|
4
|
+
import { Clear, KeyboardArrowDown } from '@material-ui/icons';
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
import BmAvatar from '../Avatars/avatars';
|
|
7
|
+
import { BmGrey100 } from '../colors';
|
|
8
|
+
import { BmIcons } from '../iconStyles';
|
|
9
|
+
import { p } from '../text';
|
|
10
10
|
|
|
11
11
|
export const BmPillWrapper = styled.div`
|
|
12
12
|
display: ${({ clicked }) => {
|
|
13
13
|
if (clicked) {
|
|
14
|
-
return
|
|
14
|
+
return 'flex';
|
|
15
15
|
}
|
|
16
|
-
return
|
|
16
|
+
return 'none';
|
|
17
17
|
}};
|
|
18
18
|
flex-direction: row;
|
|
19
19
|
justify-content: center;
|
|
@@ -56,11 +56,11 @@ export const BmPill = ({
|
|
|
56
56
|
clicked={clicked}
|
|
57
57
|
{...rest}
|
|
58
58
|
>
|
|
59
|
-
{icon && <BmIcons size={size ||
|
|
59
|
+
{icon && <BmIcons size={size || 'xsmall'} icon={icon} color={color} />}
|
|
60
60
|
{avatarIcon && (
|
|
61
61
|
<BmAvatar
|
|
62
62
|
user={avatarIcon}
|
|
63
|
-
size={avatarSize ||
|
|
63
|
+
size={avatarSize || 'xsmall'}
|
|
64
64
|
type="circle"
|
|
65
65
|
color={color}
|
|
66
66
|
/>
|
|
@@ -68,10 +68,10 @@ export const BmPill = ({
|
|
|
68
68
|
{label}
|
|
69
69
|
{onDelete && (
|
|
70
70
|
<BmIcons
|
|
71
|
-
style={{ margin:
|
|
72
|
-
size={size ||
|
|
73
|
-
icon={deleteIcon
|
|
74
|
-
color={color ||
|
|
71
|
+
style={{ margin: '0rem 0rem 0rem 1rem' }}
|
|
72
|
+
size={size || 'xsmall'}
|
|
73
|
+
icon={deleteIcon || <Clear />}
|
|
74
|
+
color={color || 'black'}
|
|
75
75
|
/>
|
|
76
76
|
)}
|
|
77
77
|
</BmPillWrapper>
|