beem-component 1.0.1 → 1.0.5
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/.storybook/favicon.ico +0 -0
- package/.storybook/logo-blue.png +0 -0
- package/.storybook/main.js +15 -0
- package/.storybook/manager-head.html +14 -0
- package/.storybook/manager.js +6 -0
- package/.storybook/preview.js +10 -0
- package/.storybook/theme.js +10 -0
- package/Dockerfile +30 -0
- package/Jenkinsfile +73 -0
- package/build-storybook.log +14621 -0
- package/dist/assets/beem.jpeg +0 -0
- package/dist/components/{Accordion.js → Accordion/Accordion.js} +12 -6
- package/dist/components/Accordion/Accordion.stories.js +86 -0
- package/dist/components/{avatars.js → Avatars/avatars.js} +31 -11
- package/dist/components/Avatars/avatars.stories.js +69 -0
- package/dist/components/Buttons/Stories/basicbutton.stories.js +67 -0
- package/dist/components/Buttons/Stories/buttonAlertIcons.stories.js +65 -0
- package/dist/components/Buttons/Stories/buttonIconsOnly.stories.js +65 -0
- package/dist/components/{buttonAlertIcons.js → Buttons/buttonAlertIcons.js} +17 -9
- package/dist/components/{buttonIconsOnly.js → Buttons/buttonIconsOnly.js} +13 -4
- package/dist/components/{buttons.js → Buttons/buttons.js} +11 -10
- package/dist/components/{Reports → Cards}/cards.js +9 -24
- package/dist/components/Cards/cards.stories.js +61 -0
- package/dist/components/Chats/chat.js +1 -1
- package/dist/components/Chats/chatInput.js +1 -1
- package/dist/components/Chats/chatwrapper.js +1 -1
- package/dist/components/Lists/listBox.js +41 -0
- package/dist/components/Lists/listBox.stories.js +78 -0
- package/dist/components/Lists/listHeader.stories.js +58 -0
- package/dist/components/Lists/listheader.js +17 -12
- package/dist/components/Lists/rowLabels.js +34 -16
- package/dist/components/Lists/rowLabels.stories.js +85 -0
- package/dist/components/{loaders.js → Loader/loader.js} +13 -7
- package/dist/components/Loader/loader.stories.js +52 -0
- package/dist/components/{Reports/buttons.js → MainWrapper/index.js} +5 -3
- package/dist/components/Modals/modal copy.js +160 -0
- package/dist/components/Modals/modal.js +166 -0
- package/dist/components/Modals/modals.stories.js +117 -0
- package/dist/components/{infoNote.js → NoteBar.js/noteBar.js} +23 -19
- package/dist/components/NoteBar.js/noteBar.stories.js +66 -0
- package/dist/components/PerformanceIndicator/performaceIndicator.stories.js +66 -0
- package/dist/components/PerformanceIndicator/performanceIndicator.js +68 -0
- package/dist/components/Pills/pills.js +126 -0
- package/dist/components/Pills/pills.stories.js +110 -0
- package/dist/components/{progressbar.js → ProgressBar/progressbar.js} +8 -2
- package/dist/components/ProgressBar/progressbar.stories.js +45 -0
- package/dist/components/{Link.js → RouteLink/link.js} +8 -3
- package/dist/components/RouteLink/link.stories.js +29 -0
- package/dist/components/SuperFluid/ContentTitle.js/index.js +1 -1
- package/dist/components/SuperFluid/SegmentCard/index.js +1 -1
- package/dist/components/Tabs/tabs.js +85 -0
- package/dist/components/Tabs/tabs.stories.js +59 -0
- package/dist/components/breakpoints.js +18 -0
- package/dist/components/chatHeader.js +1 -1
- package/dist/components/checkboxToggler.js +2 -2
- package/dist/components/colors.js +5 -3
- package/dist/components/contacts.js +1 -1
- package/dist/components/dropdown.js +1 -1
- package/dist/components/dropdownButton.js +3 -3
- package/dist/components/dropdownItems.js +1 -1
- package/dist/components/example.js +47 -0
- package/dist/components/iconStyles.js +69 -119
- package/dist/components/index-copy.js +1285 -0
- package/dist/components/index.js +80 -1155
- package/dist/components/input.js +9 -3
- package/dist/components/logo.js +1 -1
- package/dist/components/navbar.js +1 -1
- package/dist/components/sidebar.js +2 -2
- package/dist/components/tabs.js +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/typography.js +1 -1
- package/nginx.conf +17 -0
- package/package.json +30 -11
- package/public/favicon.ico +0 -0
- package/public/index.html +1 -1
- package/src/App.js +12 -29
- package/src/examples/Navbar.js +1 -1
- package/src/lib/assets/beem.jpeg +0 -0
- package/src/lib/components/{Accordion.js → Accordion/Accordion.js} +5 -4
- package/src/lib/components/Accordion/Accordion.stories.js +63 -0
- package/src/lib/components/{avatars.js → Avatars/avatars.js} +24 -8
- package/src/lib/components/Avatars/avatars.stories.js +45 -0
- package/src/lib/components/Buttons/Stories/basicbutton.stories.js +51 -0
- package/src/lib/components/Buttons/Stories/buttonAlertIcons.stories.js +42 -0
- package/src/lib/components/Buttons/Stories/buttonIconsOnly.stories.js +49 -0
- package/src/lib/components/{buttonAlertIcons.js → Buttons/buttonAlertIcons.js} +20 -9
- package/src/lib/components/{buttonIconsOnly.js → Buttons/buttonIconsOnly.js} +12 -2
- package/src/lib/components/{buttons.js → Buttons/buttons.js} +10 -10
- package/src/lib/components/{Reports → Cards}/cards.js +10 -18
- package/src/lib/components/Cards/cards.stories.js +52 -0
- package/src/lib/components/Lists/listBox.js +34 -0
- package/src/lib/components/Lists/listBox.stories.js +47 -0
- package/src/lib/components/Lists/listHeader.stories.js +36 -0
- package/src/lib/components/Lists/listheader.js +17 -11
- package/src/lib/components/Lists/rowLabels.js +47 -16
- package/src/lib/components/Lists/rowLabels.stories.js +59 -0
- package/src/lib/components/{loaders.js → Loader/loader.js} +18 -7
- package/src/lib/components/Loader/loader.stories.js +30 -0
- package/src/lib/components/MainWrapper/index.js +7 -0
- package/src/lib/components/Modals/modal copy.js +159 -0
- package/src/lib/components/Modals/modal.js +152 -0
- package/src/lib/components/Modals/modals.stories.js +82 -0
- package/src/lib/components/{infoNote.js → NoteBar.js/noteBar.js} +24 -25
- package/src/lib/components/NoteBar.js/noteBar.stories.js +40 -0
- package/src/lib/components/PerformanceIndicator/performaceIndicator.stories.js +40 -0
- package/src/lib/components/PerformanceIndicator/performanceIndicator.js +56 -0
- package/src/lib/components/Pills/pills.js +91 -0
- package/src/lib/components/Pills/pills.stories.js +74 -0
- package/src/lib/components/{progressbar.js → ProgressBar/progressbar.js} +8 -1
- package/src/lib/components/ProgressBar/progressbar.stories.js +26 -0
- package/src/lib/components/{Link.js → RouteLink/link.js} +5 -4
- package/src/lib/components/RouteLink/link.stories.js +21 -0
- package/src/lib/components/Tabs/tabs.js +84 -0
- package/src/lib/components/Tabs/tabs.stories.js +36 -0
- package/src/lib/components/breakpoints.js +11 -0
- package/src/lib/components/colors.js +2 -0
- package/src/lib/components/dropdownButton.js +2 -2
- package/src/lib/components/example.js +30 -0
- package/src/lib/components/iconStyles.js +46 -101
- package/src/lib/components/index-copy.js +468 -0
- package/src/lib/components/index.js +38 -445
- package/src/lib/components/input.js +8 -2
- package/src/lib/components/sidebar.js +1 -1
- package/storybook-static/0.00c62ec79c260aedbb98.manager.bundle.js +2 -0
- package/storybook-static/0.00c62ec79c260aedbb98.manager.bundle.js.LICENSE.txt +8 -0
- package/storybook-static/0.96c45dd8.iframe.bundle.js +1 -0
- package/storybook-static/1.dc6acfa9.iframe.bundle.js +3 -0
- package/storybook-static/1.dc6acfa9.iframe.bundle.js.LICENSE.txt +8 -0
- package/storybook-static/1.dc6acfa9.iframe.bundle.js.map +1 -0
- package/storybook-static/1.dc7dcdaec2def2f224fd.manager.bundle.js +1 -0
- package/storybook-static/2.24353ddc.iframe.bundle.js +1 -0
- package/storybook-static/3.8bb2173c.iframe.bundle.js +1 -0
- package/storybook-static/5.0779e3847d325dece216.manager.bundle.js +1 -0
- package/storybook-static/6.8bd405c2576206749a16.manager.bundle.js +2 -0
- package/storybook-static/6.8bd405c2576206749a16.manager.bundle.js.LICENSE.txt +12 -0
- package/storybook-static/7.9d4ba19cf58425e7ff0d.manager.bundle.js +1 -0
- package/storybook-static/7.f0cfc757.iframe.bundle.js +1 -0
- package/storybook-static/8.91de97de.iframe.bundle.js +3 -0
- package/storybook-static/8.91de97de.iframe.bundle.js.LICENSE.txt +12 -0
- package/storybook-static/8.91de97de.iframe.bundle.js.map +1 -0
- package/storybook-static/8.b4e9ec0ec7648e02a923.manager.bundle.js +1 -0
- package/storybook-static/9.40ec65d6.iframe.bundle.js +1 -0
- package/storybook-static/asset-manifest.json +30 -0
- package/storybook-static/favicon.ico +0 -0
- package/storybook-static/iframe.html +348 -0
- package/storybook-static/index.html +110 -0
- package/storybook-static/main.3c8d8027.iframe.bundle.js +1 -0
- package/storybook-static/main.3e5804fe56d1f580b088.manager.bundle.js +1 -0
- package/storybook-static/runtime~main.d3a18d6a.iframe.bundle.js +1 -0
- package/storybook-static/runtime~main.ff106120648356c6069d.manager.bundle.js +1 -0
- package/storybook-static/static/css/main.b44a190d.chunk.css +4 -0
- package/storybook-static/static/css/main.b44a190d.chunk.css.map +1 -0
- package/storybook-static/static/media/OpenSans-Regular.1b0809d5.ttf +0 -0
- package/storybook-static/static/media/PoppinsBold.1eae2d48.woff2 +0 -0
- package/storybook-static/static/media/PoppinsBold.53ff6749.eot +0 -0
- package/storybook-static/static/media/PoppinsBold.53ff971f.ttf +0 -0
- package/storybook-static/static/media/PoppinsBold.850fc4f3.svg +3066 -0
- package/storybook-static/static/media/PoppinsBold.b33c148b.woff +0 -0
- package/storybook-static/static/media/PoppinsMedium.0ba26f6c.woff +0 -0
- package/storybook-static/static/media/PoppinsMedium.49b46ace.eot +0 -0
- package/storybook-static/static/media/PoppinsMedium.57a99fa8.woff2 +0 -0
- package/storybook-static/static/media/PoppinsMedium.b7e43707.svg +3103 -0
- package/storybook-static/static/media/PoppinsMedium.c98dddbd.ttf +0 -0
- package/storybook-static/static/media/PoppinsRegular.13b9af9c.eot +0 -0
- package/storybook-static/static/media/PoppinsRegular.43e9b50d.svg +3138 -0
- package/storybook-static/static/media/PoppinsRegular.4a4d5420.woff +0 -0
- package/storybook-static/static/media/PoppinsRegular.9a7cc7ec.woff2 +0 -0
- package/storybook-static/static/media/PoppinsRegular.e1bc9021.ttf +0 -0
- package/storybook-static/static/media/PoppinsSemiBold.5692c77f.ttf +0 -0
- package/storybook-static/static/media/PoppinsSemiBold.80138c67.woff +0 -0
- package/storybook-static/static/media/PoppinsSemiBold.c442695a.eot +0 -0
- package/storybook-static/static/media/PoppinsSemiBold.e1948d56.svg +3098 -0
- package/storybook-static/static/media/PoppinsSemiBold.f27050e2.woff2 +0 -0
- package/storybook-static/static/media/logo-blue.bfc5ba6d.png +0 -0
- package/storybook-static/vendors~main.1750028c2d68e574fb1d.manager.bundle.js +2 -0
- package/storybook-static/vendors~main.1750028c2d68e574fb1d.manager.bundle.js.LICENSE.txt +104 -0
- package/storybook-static/vendors~main.7fe78cc2.iframe.bundle.js +3 -0
- package/storybook-static/vendors~main.7fe78cc2.iframe.bundle.js.LICENSE.txt +122 -0
- package/storybook-static/vendors~main.7fe78cc2.iframe.bundle.js.map +1 -0
- package/dist/assets/content_copy_black.svg +0 -1
- package/dist/assets/profile-pic.jpg +0 -0
- package/dist/components/Accordicon.js +0 -51
- package/dist/components/CustomerInfo/customerInfo.js +0 -89
- package/dist/components/CustomerInfo/customerInfoBar.js +0 -24
- package/dist/components/CustomerInfo/infoAccordion.js +0 -78
- package/dist/components/CustomerInfo/labelsInfo.js +0 -37
- package/dist/components/CustomerInfo/notesInfo.js +0 -39
- package/dist/components/Modals/modalBody.js +0 -61
- package/dist/components/Modals/noteModalBody.js +0 -20
- package/dist/components/Modals/noteModalFooter.js +0 -24
- package/dist/components/Modals/noteModalHeader.js +0 -93
- package/dist/components/Reports/charts.js +0 -70
- package/dist/components/Reports/infoHeader.js +0 -65
- package/dist/components/Reports/reportsBody.js +0 -28
- package/dist/components/Reports/title.js +0 -28
- package/dist/components/performanceIndicator.js +0 -41
- package/dist/components/pills.js +0 -73
- package/src/App1.js +0 -229
- package/src/CHAT.js +0 -170
- package/src/Complete.js +0 -48
- package/src/CreateSegments.js +0 -48
- package/src/FileUploadSFL.js +0 -110
- package/src/examples/CustomerInfo.js +0 -248
- package/src/lib/assets/content_copy_black.svg +0 -1
- package/src/lib/assets/profile-pic.jpg +0 -0
- package/src/lib/components/Accordicon.js +0 -43
- package/src/lib/components/CustomerInfo/customerInfo.js +0 -91
- package/src/lib/components/CustomerInfo/customerInfoBar.js +0 -23
- package/src/lib/components/CustomerInfo/infoAccordion.js +0 -96
- package/src/lib/components/CustomerInfo/labelsInfo.js +0 -37
- package/src/lib/components/CustomerInfo/notesInfo.js +0 -61
- package/src/lib/components/Modals/modalBody.js +0 -66
- package/src/lib/components/Modals/noteModalBody.js +0 -10
- package/src/lib/components/Modals/noteModalFooter.js +0 -16
- package/src/lib/components/Modals/noteModalHeader.js +0 -103
- package/src/lib/components/Reports/buttons.js +0 -5
- package/src/lib/components/Reports/charts.js +0 -79
- package/src/lib/components/Reports/infoHeader.js +0 -63
- package/src/lib/components/Reports/reportsBody.js +0 -29
- package/src/lib/components/Reports/title.js +0 -19
- package/src/lib/components/performanceIndicator.js +0 -27
- package/src/lib/components/pills.js +0 -65
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import React, { useEffect, useCallback, useState } from "react";
|
|
2
|
+
import { Clear } from "@material-ui/icons";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import { BmBgGrey45, BmPrimaryBlack, BmPrimaryWhite } from "../colors";
|
|
5
|
+
import { BmIcons } from "../iconStyles";
|
|
6
|
+
|
|
7
|
+
const { Provider, Consumer } = React.createContext();
|
|
8
|
+
|
|
9
|
+
export const Overlay = styled.div`
|
|
10
|
+
position: fixed;
|
|
11
|
+
top: 0;
|
|
12
|
+
left: 0;
|
|
13
|
+
z-index: 9999;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
background-color: ${BmBgGrey45};
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
export const ModalContent = styled.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
border-radius: 0.25rem;
|
|
23
|
+
padding: 1rem;
|
|
24
|
+
margin: auto;
|
|
25
|
+
background: ${BmPrimaryWhite};
|
|
26
|
+
width: ${({ size }) => {
|
|
27
|
+
if (size) {
|
|
28
|
+
console.log({ size });
|
|
29
|
+
if (size === "small") return "21.429rem";
|
|
30
|
+
if (size === "default") return "35.714rem";
|
|
31
|
+
if (size === "large") return "57.143rem";
|
|
32
|
+
if (size === "xlarge") return "81.429rem";
|
|
33
|
+
return size;
|
|
34
|
+
}
|
|
35
|
+
return "35.714rem";
|
|
36
|
+
}};
|
|
37
|
+
> *:not(:last-child) {
|
|
38
|
+
margin-bottom: 1rem;
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
export const ModalWrapper = styled.div`
|
|
43
|
+
z-index: 9999;
|
|
44
|
+
overflow-x: auto;
|
|
45
|
+
overflow-y: auto;
|
|
46
|
+
outline: 0;
|
|
47
|
+
position: fixed;
|
|
48
|
+
height: auto;
|
|
49
|
+
top: ${({ centered }) => {
|
|
50
|
+
if (centered) {
|
|
51
|
+
return "50%";
|
|
52
|
+
}
|
|
53
|
+
return "10%";
|
|
54
|
+
}};
|
|
55
|
+
left: 50%;
|
|
56
|
+
transform: translate(-50%, -50%);
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
export const HeaderWrapper = styled.div`
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: row;
|
|
62
|
+
justify-content: space-between;
|
|
63
|
+
padding: 1.143rem 0rem;
|
|
64
|
+
`;
|
|
65
|
+
|
|
66
|
+
export const HeaderText = styled.h2`
|
|
67
|
+
text-align: center;
|
|
68
|
+
display: flex;
|
|
69
|
+
color: ${BmPrimaryBlack};
|
|
70
|
+
margin-left: auto;
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
export const Close = styled.div`
|
|
74
|
+
display: flex;
|
|
75
|
+
justify-content: flex-end;
|
|
76
|
+
margin-left: auto;
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
export const BmModal = ({
|
|
80
|
+
children,
|
|
81
|
+
show,
|
|
82
|
+
size,
|
|
83
|
+
centered,
|
|
84
|
+
setShowModals,
|
|
85
|
+
...rest
|
|
86
|
+
}) => {
|
|
87
|
+
const [toggle, setToggle] = useState(show);
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
setToggle(show);
|
|
90
|
+
}, [show]);
|
|
91
|
+
return (
|
|
92
|
+
<>
|
|
93
|
+
{toggle && (
|
|
94
|
+
<>
|
|
95
|
+
<Overlay />
|
|
96
|
+
<ModalWrapper showModal={show} centered={centered}>
|
|
97
|
+
<Provider value={{ toggle, setToggle, size, show }}>
|
|
98
|
+
<ModalContent size={size} {...rest}>
|
|
99
|
+
{children}
|
|
100
|
+
</ModalContent>
|
|
101
|
+
</Provider>
|
|
102
|
+
</ModalWrapper>
|
|
103
|
+
</>
|
|
104
|
+
)}
|
|
105
|
+
</>
|
|
106
|
+
);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const ModalHeader = styled.div`
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-direction: row;
|
|
112
|
+
justify-content: space-between;
|
|
113
|
+
`;
|
|
114
|
+
|
|
115
|
+
BmModal.Header = ({
|
|
116
|
+
children,
|
|
117
|
+
leadingIcon,
|
|
118
|
+
trailingIcon,
|
|
119
|
+
size,
|
|
120
|
+
closeButton,
|
|
121
|
+
show,
|
|
122
|
+
...rest
|
|
123
|
+
}) => {
|
|
124
|
+
return (
|
|
125
|
+
<Consumer>
|
|
126
|
+
{(value) => (
|
|
127
|
+
<>
|
|
128
|
+
<ModalHeader {...rest}>
|
|
129
|
+
{JSON.stringify(value)}
|
|
130
|
+
{children}
|
|
131
|
+
{closeButton && (
|
|
132
|
+
<BmIcons
|
|
133
|
+
size="xlarge"
|
|
134
|
+
icon={<Clear />}
|
|
135
|
+
onClick={() =>
|
|
136
|
+
value.setToggle(!value.toggle)
|
|
137
|
+
}
|
|
138
|
+
{...rest}
|
|
139
|
+
/>
|
|
140
|
+
)}
|
|
141
|
+
</ModalHeader>
|
|
142
|
+
</>
|
|
143
|
+
)}
|
|
144
|
+
</Consumer>
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
BmModal.Body = styled.div`
|
|
149
|
+
display: flex;
|
|
150
|
+
flex-direction: column;
|
|
151
|
+
justify-content: space-between;
|
|
152
|
+
`;
|
|
153
|
+
|
|
154
|
+
BmModal.Footer = styled.div`
|
|
155
|
+
display: flex;
|
|
156
|
+
justify-content: space-between;
|
|
157
|
+
`;
|
|
158
|
+
|
|
159
|
+
export default BmModal;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import React, { useEffect, useCallback, useState } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { Clear } from "@material-ui/icons";
|
|
4
|
+
import styled from "styled-components";
|
|
5
|
+
import { BmBgGrey45, BmPrimaryWhite } from "../colors";
|
|
6
|
+
import { BmIcons } from "../iconStyles";
|
|
7
|
+
|
|
8
|
+
const { Provider, Consumer } = React.createContext();
|
|
9
|
+
|
|
10
|
+
export const Overlay = styled.div`
|
|
11
|
+
position: fixed;
|
|
12
|
+
top: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
z-index: 9999;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
background-color: ${BmBgGrey45};
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
export const ModalContent = styled.div`
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
border-radius: 0.25rem;
|
|
24
|
+
padding: 1rem;
|
|
25
|
+
margin: auto;
|
|
26
|
+
background: ${BmPrimaryWhite};
|
|
27
|
+
width: ${({ size }) => {
|
|
28
|
+
if (size) {
|
|
29
|
+
if (size === "small") return "21.429rem";
|
|
30
|
+
if (size === "default") return "35.714rem";
|
|
31
|
+
if (size === "large") return "57.143rem";
|
|
32
|
+
if (size === "xlarge") return "81.429rem";
|
|
33
|
+
return size;
|
|
34
|
+
}
|
|
35
|
+
return "35.714rem";
|
|
36
|
+
}};
|
|
37
|
+
> *:not(:last-child) {
|
|
38
|
+
margin-bottom: 1rem;
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
export const ModalWrapper = styled.div`
|
|
43
|
+
z-index: 9999;
|
|
44
|
+
overflow-x: auto;
|
|
45
|
+
overflow-y: auto;
|
|
46
|
+
outline: 0;
|
|
47
|
+
position: fixed;
|
|
48
|
+
height: auto;
|
|
49
|
+
top: ${({ centered }) => {
|
|
50
|
+
if (centered) {
|
|
51
|
+
return "50%";
|
|
52
|
+
}
|
|
53
|
+
return "10%";
|
|
54
|
+
}};
|
|
55
|
+
left: 50%;
|
|
56
|
+
transform: translate(-50%, -50%);
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
export const BmModal = ({
|
|
60
|
+
children,
|
|
61
|
+
show,
|
|
62
|
+
size,
|
|
63
|
+
onHide,
|
|
64
|
+
centered,
|
|
65
|
+
...rest
|
|
66
|
+
}) => {
|
|
67
|
+
const [toggle, setToggle] = useState(show);
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
setToggle(show);
|
|
70
|
+
}, [show]);
|
|
71
|
+
|
|
72
|
+
const keyPress = useCallback(
|
|
73
|
+
(e) => {
|
|
74
|
+
if (e.key === "Escape" && show && onHide !== undefined) {
|
|
75
|
+
onHide(false);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
[onHide, show],
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
document.addEventListener("keydown", keyPress);
|
|
83
|
+
return () => document.removeEventListener("keydown", keyPress);
|
|
84
|
+
}, [keyPress]);
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<>
|
|
88
|
+
{toggle && (
|
|
89
|
+
<>
|
|
90
|
+
<Overlay />
|
|
91
|
+
<ModalWrapper showModal={show} centered={centered} onHide={onHide}>
|
|
92
|
+
<Provider value={{ toggle, setToggle, size, show, onHide }}>
|
|
93
|
+
<ModalContent size={size} {...rest}>
|
|
94
|
+
{children}
|
|
95
|
+
</ModalContent>
|
|
96
|
+
</Provider>
|
|
97
|
+
</ModalWrapper>
|
|
98
|
+
</>
|
|
99
|
+
)}
|
|
100
|
+
</>
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const ModalHeader = styled.div`
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: row;
|
|
107
|
+
justify-content: space-between;
|
|
108
|
+
`;
|
|
109
|
+
|
|
110
|
+
BmModal.Header = ({ children, size, onHide, closeButton, show, ...rest }) => {
|
|
111
|
+
return (
|
|
112
|
+
<Consumer>
|
|
113
|
+
{(value) => (
|
|
114
|
+
<>
|
|
115
|
+
<ModalHeader {...rest}>
|
|
116
|
+
{children}
|
|
117
|
+
{closeButton && (
|
|
118
|
+
<BmIcons
|
|
119
|
+
size="xlarge"
|
|
120
|
+
icon={<Clear />}
|
|
121
|
+
onClick={() =>
|
|
122
|
+
value && value.onHide && value.onHide(!value.show)
|
|
123
|
+
}
|
|
124
|
+
{...rest}
|
|
125
|
+
/>
|
|
126
|
+
)}
|
|
127
|
+
</ModalHeader>
|
|
128
|
+
</>
|
|
129
|
+
)}
|
|
130
|
+
</Consumer>
|
|
131
|
+
);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
BmModal.Body = styled.div`
|
|
135
|
+
display: flex;
|
|
136
|
+
flex-direction: column;
|
|
137
|
+
justify-content: space-between;
|
|
138
|
+
`;
|
|
139
|
+
|
|
140
|
+
BmModal.Footer = styled.div`
|
|
141
|
+
display: flex;
|
|
142
|
+
justify-content: space-between;
|
|
143
|
+
`;
|
|
144
|
+
|
|
145
|
+
BmModal.propTypes = {
|
|
146
|
+
size: PropTypes.string,
|
|
147
|
+
centered: PropTypes.bool,
|
|
148
|
+
show: PropTypes.bool.isRequired,
|
|
149
|
+
onHide: PropTypes.func.isRequired,
|
|
150
|
+
closeButton: PropTypes.bool,
|
|
151
|
+
};
|
|
152
|
+
export default BmModal;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import BmModal from "./modal";
|
|
4
|
+
import { BmButton } from "../Buttons/buttons";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
component: BmModal,
|
|
8
|
+
title: "components/Modals",
|
|
9
|
+
argType: {
|
|
10
|
+
size: {
|
|
11
|
+
options: ["small", "default", "large", "xlarge"],
|
|
12
|
+
control: { type: "select" },
|
|
13
|
+
description: "Size of the Modal (Optional)",
|
|
14
|
+
defaultValue: { summary: "default" },
|
|
15
|
+
},
|
|
16
|
+
closeButton: {
|
|
17
|
+
description:
|
|
18
|
+
"Placed on BmModal.Header component. Displays the close button (X)",
|
|
19
|
+
},
|
|
20
|
+
centered: {
|
|
21
|
+
description: "Centers the modal",
|
|
22
|
+
},
|
|
23
|
+
show: {
|
|
24
|
+
control: { type: "boolean" },
|
|
25
|
+
description: "Handling the opening and closing of the modal",
|
|
26
|
+
},
|
|
27
|
+
onHide: {
|
|
28
|
+
description: "Handling the closing of the modal",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const SampleModal = () => {
|
|
34
|
+
const [showModal, setShowModal] = useState(false);
|
|
35
|
+
return (
|
|
36
|
+
<>
|
|
37
|
+
<div>
|
|
38
|
+
<BmButton onClick={() => setShowModal(!showModal)}>Click Me!</BmButton>
|
|
39
|
+
</div>
|
|
40
|
+
<BmModal show={showModal} onHide={() => setShowModal(false)} centered>
|
|
41
|
+
<BmModal.Header closeButton>
|
|
42
|
+
<h2>Header</h2>
|
|
43
|
+
</BmModal.Header>
|
|
44
|
+
<BmModal.Body>
|
|
45
|
+
<p>This is a body</p>
|
|
46
|
+
</BmModal.Body>
|
|
47
|
+
<BmModal.Footer>
|
|
48
|
+
<p>This is a footer</p>
|
|
49
|
+
</BmModal.Footer>
|
|
50
|
+
</BmModal>
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
export const ExampleModal = () => {
|
|
55
|
+
const [showModal, setShowModal] = useState(false);
|
|
56
|
+
return (
|
|
57
|
+
<>
|
|
58
|
+
<div>
|
|
59
|
+
<BmButton onClick={() => setShowModal(!showModal)}>Click Me!</BmButton>
|
|
60
|
+
</div>
|
|
61
|
+
<BmModal
|
|
62
|
+
size="small"
|
|
63
|
+
show={showModal}
|
|
64
|
+
onHide={() => setShowModal(false)}
|
|
65
|
+
centered
|
|
66
|
+
>
|
|
67
|
+
<BmModal.Header closeButton>
|
|
68
|
+
<h2>Header</h2>
|
|
69
|
+
</BmModal.Header>
|
|
70
|
+
<BmModal.Body>
|
|
71
|
+
<p>This is a body</p>
|
|
72
|
+
</BmModal.Body>
|
|
73
|
+
<BmModal.Footer>
|
|
74
|
+
<BmButton size="small">Send</BmButton>
|
|
75
|
+
<BmButton size="small" variant="secondary">
|
|
76
|
+
View
|
|
77
|
+
</BmButton>
|
|
78
|
+
</BmModal.Footer>
|
|
79
|
+
</BmModal>
|
|
80
|
+
</>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
@@ -1,60 +1,59 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import Proptypes from "prop-types";
|
|
2
3
|
import { Error, Info, Warning } from "@material-ui/icons";
|
|
3
4
|
import styled from "styled-components";
|
|
4
5
|
import {
|
|
5
6
|
BmGrey400,
|
|
6
|
-
BmPrimaryWhite,
|
|
7
7
|
BmPrimaryBlue,
|
|
8
|
-
BmSecondaryGrey,
|
|
9
8
|
BmSecondaryRed,
|
|
10
9
|
BmPrimaryGold,
|
|
11
|
-
} from "
|
|
12
|
-
import { BmIcons } from "
|
|
10
|
+
} from "../colors";
|
|
11
|
+
import { BmIcons } from "../iconStyles";
|
|
13
12
|
|
|
14
|
-
export const
|
|
13
|
+
export const NoteBarWrapper = styled.div`
|
|
15
14
|
display: flex;
|
|
16
|
-
flex-direction:
|
|
15
|
+
flex-direction: row;
|
|
17
16
|
align-items: center;
|
|
18
17
|
padding: 0.5rem 1rem;
|
|
19
|
-
background: ${BmPrimaryWhite};
|
|
20
18
|
border: 0.071rem solid ${BmGrey400};
|
|
21
19
|
border-radius: 0.25rem;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
p {
|
|
25
|
-
color: ${(props) => (props.color ? props.color : `${BmSecondaryGrey}`)};
|
|
20
|
+
> *:not(:last-child) {
|
|
21
|
+
margin-right: 0.5rem;
|
|
26
22
|
}
|
|
27
23
|
`;
|
|
28
24
|
|
|
29
|
-
export const
|
|
30
|
-
margin-right: 0.5rem;
|
|
31
|
-
`;
|
|
32
|
-
|
|
33
|
-
export const BmInfoNote = ({ type, children, color, size, ...rest }) => {
|
|
25
|
+
export const BmNoteBar = ({ type, children, color, size, ...rest }) => {
|
|
34
26
|
return (
|
|
35
|
-
<
|
|
27
|
+
<NoteBarWrapper {...rest}>
|
|
36
28
|
{type === "info" && (
|
|
37
|
-
<
|
|
29
|
+
<BmIcons
|
|
38
30
|
icon={<Info />}
|
|
39
31
|
color={color ? color : `${BmPrimaryBlue}`}
|
|
40
|
-
size={size ? size : "
|
|
32
|
+
size={size ? size : "large"}
|
|
41
33
|
/>
|
|
42
34
|
)}
|
|
43
35
|
{type === "error" && (
|
|
44
|
-
<
|
|
36
|
+
<BmIcons
|
|
45
37
|
icon={<Error />}
|
|
46
38
|
color={color ? color : `${BmSecondaryRed}`}
|
|
47
|
-
size={size ? size : "
|
|
39
|
+
size={size ? size : "large"}
|
|
48
40
|
/>
|
|
49
41
|
)}
|
|
50
42
|
{type === "warning" && (
|
|
51
|
-
<
|
|
43
|
+
<BmIcons
|
|
52
44
|
icon={<Warning />}
|
|
53
45
|
color={color ? color : `${BmPrimaryGold}`}
|
|
54
|
-
size={size ? size : "
|
|
46
|
+
size={size ? size : "large"}
|
|
55
47
|
/>
|
|
56
48
|
)}
|
|
57
|
-
|
|
58
|
-
</
|
|
49
|
+
{children}
|
|
50
|
+
</NoteBarWrapper>
|
|
59
51
|
);
|
|
60
52
|
};
|
|
53
|
+
|
|
54
|
+
BmNoteBar.propTypes = {
|
|
55
|
+
children: Proptypes.object,
|
|
56
|
+
color: Proptypes.string,
|
|
57
|
+
size: Proptypes.string,
|
|
58
|
+
type: Proptypes.string,
|
|
59
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { BmNoteBar } from "./noteBar";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
component: BmNoteBar,
|
|
7
|
+
title: "components/NoteBar",
|
|
8
|
+
argTypes: {
|
|
9
|
+
size: {
|
|
10
|
+
options: ["small", "medium", "large"],
|
|
11
|
+
control: { type: "select" },
|
|
12
|
+
description: "Size of the icons",
|
|
13
|
+
defaultValue: { summary: "large" },
|
|
14
|
+
},
|
|
15
|
+
children: {
|
|
16
|
+
description: "Note Description ",
|
|
17
|
+
defaultValue: { summary: undefined },
|
|
18
|
+
},
|
|
19
|
+
type: {
|
|
20
|
+
options: ["info", "warning", "error"],
|
|
21
|
+
control: { type: "select" },
|
|
22
|
+
description: "Type of note",
|
|
23
|
+
defaultValue: { summary: undefined },
|
|
24
|
+
},
|
|
25
|
+
color: {
|
|
26
|
+
description: "Color of the icon ",
|
|
27
|
+
defaultValue: { summary: undefined },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const MainNoteBar = (args) => <BmNoteBar {...args} />;
|
|
33
|
+
|
|
34
|
+
export const NoteBar = MainNoteBar.bind({});
|
|
35
|
+
NoteBar.args = {
|
|
36
|
+
type: "warning",
|
|
37
|
+
size: "large",
|
|
38
|
+
children: <p>NoteBar</p>,
|
|
39
|
+
color: undefined,
|
|
40
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { BmPerformanceIndicator } from "./performanceIndicator";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
component: BmPerformanceIndicator,
|
|
7
|
+
title: "components/PerformanceIndicator",
|
|
8
|
+
argTypes: {
|
|
9
|
+
size: {
|
|
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
|
+
},
|
|
15
|
+
type: {
|
|
16
|
+
options: ["upwards", "downwards"],
|
|
17
|
+
control: { type: "select" },
|
|
18
|
+
description: "Type of Indicator",
|
|
19
|
+
defaultValue: { summary: undefined },
|
|
20
|
+
},
|
|
21
|
+
children: {
|
|
22
|
+
description: "Performance Indicator Value (h2)",
|
|
23
|
+
defaultValue: { summary: undefined },
|
|
24
|
+
},
|
|
25
|
+
color: {
|
|
26
|
+
description: "Color of Performance Indicator",
|
|
27
|
+
defaultValue: { summary: undefined },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const MainPI = (args) => <BmPerformanceIndicator {...args} />;
|
|
33
|
+
|
|
34
|
+
export const PerformanceIndicator = MainPI.bind({});
|
|
35
|
+
PerformanceIndicator.args = {
|
|
36
|
+
type: "upwards",
|
|
37
|
+
size: "xlarge",
|
|
38
|
+
children: "100%",
|
|
39
|
+
color: undefined,
|
|
40
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import Proptypes from "prop-types";
|
|
3
|
+
import { BmGrey400 } from "../colors";
|
|
4
|
+
import { BmIcons } from "../iconStyles";
|
|
5
|
+
import ArrowCircleUpIcon from "@mui/icons-material/ArrowCircleUp";
|
|
6
|
+
import ArrowCircleDownIcon from "@mui/icons-material/ArrowCircleDown";
|
|
7
|
+
|
|
8
|
+
export const BmPIWrapper = styled.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
align-items: center;
|
|
12
|
+
> *:not(:last-child) {
|
|
13
|
+
margin-right: 0.5rem;
|
|
14
|
+
}
|
|
15
|
+
h2 {
|
|
16
|
+
color: ${({ color }) => {
|
|
17
|
+
if (color) return color;
|
|
18
|
+
return `${BmGrey400}`;
|
|
19
|
+
}};
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
export const BmPerformanceIndicator = ({
|
|
24
|
+
type,
|
|
25
|
+
children,
|
|
26
|
+
size,
|
|
27
|
+
color,
|
|
28
|
+
...rest
|
|
29
|
+
}) => {
|
|
30
|
+
return (
|
|
31
|
+
<BmPIWrapper color={color} {...rest}>
|
|
32
|
+
{type === "upwards" && (
|
|
33
|
+
<BmIcons
|
|
34
|
+
icon={<ArrowCircleUpIcon />}
|
|
35
|
+
size={size || "xlarge"}
|
|
36
|
+
color={color || `${BmGrey400}`}
|
|
37
|
+
/>
|
|
38
|
+
)}
|
|
39
|
+
{type === "downwards" && (
|
|
40
|
+
<BmIcons
|
|
41
|
+
icon={<ArrowCircleDownIcon />}
|
|
42
|
+
size={size || "xlarge"}
|
|
43
|
+
color={color || `${BmGrey400}`}
|
|
44
|
+
/>
|
|
45
|
+
)}
|
|
46
|
+
<h2>{children}</h2>
|
|
47
|
+
</BmPIWrapper>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
BmPerformanceIndicator.propTypes = {
|
|
52
|
+
children: Proptypes.string,
|
|
53
|
+
color: Proptypes.string,
|
|
54
|
+
size: Proptypes.string,
|
|
55
|
+
type: Proptypes.string,
|
|
56
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import Proptypes from "prop-types";
|
|
3
|
+
// eslint-disable-next-line no-unused-vars
|
|
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
|
+
|
|
11
|
+
export const BmPillWrapper = styled.div`
|
|
12
|
+
display: ${({ clicked }) => {
|
|
13
|
+
if (clicked) {
|
|
14
|
+
return "flex";
|
|
15
|
+
}
|
|
16
|
+
return "none";
|
|
17
|
+
}};
|
|
18
|
+
flex-direction: row;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
align-items: center;
|
|
21
|
+
padding: 0.214rem 0.571rem;
|
|
22
|
+
background: ${BmGrey100};
|
|
23
|
+
border-radius: 0.25rem;
|
|
24
|
+
${({ label, color }) =>
|
|
25
|
+
label &&
|
|
26
|
+
`
|
|
27
|
+
${p}
|
|
28
|
+
text-transform: uppercase;
|
|
29
|
+
color: ${color};
|
|
30
|
+
`}
|
|
31
|
+
> * {
|
|
32
|
+
margin-right: 0.25rem;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
export const BmPill = ({
|
|
37
|
+
type,
|
|
38
|
+
icon,
|
|
39
|
+
avatarIcon,
|
|
40
|
+
size,
|
|
41
|
+
avatarSize,
|
|
42
|
+
color,
|
|
43
|
+
label,
|
|
44
|
+
onDelete,
|
|
45
|
+
deleteIcon,
|
|
46
|
+
...rest
|
|
47
|
+
}) => {
|
|
48
|
+
const [clicked, setClicked] = useState(true);
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<BmPillWrapper
|
|
52
|
+
label={label}
|
|
53
|
+
onDelete={onDelete}
|
|
54
|
+
onClick={() => (onDelete ? setClicked(false) : setClicked(true))}
|
|
55
|
+
color={color}
|
|
56
|
+
clicked={clicked}
|
|
57
|
+
{...rest}
|
|
58
|
+
>
|
|
59
|
+
{icon && <BmIcons size={size || "xsmall"} icon={icon} color={color} />}
|
|
60
|
+
{avatarIcon && (
|
|
61
|
+
<BmAvatar
|
|
62
|
+
user={avatarIcon}
|
|
63
|
+
size={avatarSize || "xsmall"}
|
|
64
|
+
type="circle"
|
|
65
|
+
color={color}
|
|
66
|
+
/>
|
|
67
|
+
)}
|
|
68
|
+
{label}
|
|
69
|
+
{onDelete && (
|
|
70
|
+
<BmIcons
|
|
71
|
+
style={{ margin: "0rem 0rem 0rem 1rem" }}
|
|
72
|
+
size={size || "xsmall"}
|
|
73
|
+
icon={deleteIcon ? deleteIcon : <Clear />}
|
|
74
|
+
color={color || "black"}
|
|
75
|
+
/>
|
|
76
|
+
)}
|
|
77
|
+
</BmPillWrapper>
|
|
78
|
+
</>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
BmPill.propTypes = {
|
|
83
|
+
icon: Proptypes.object,
|
|
84
|
+
avatarIcon: Proptypes.object,
|
|
85
|
+
size: Proptypes.string,
|
|
86
|
+
avatarSize: Proptypes.string,
|
|
87
|
+
color: Proptypes.string,
|
|
88
|
+
label: Proptypes.string,
|
|
89
|
+
onDelete: Proptypes.object,
|
|
90
|
+
deleteIcon: Proptypes.object,
|
|
91
|
+
};
|