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.
Files changed (222) hide show
  1. package/.storybook/favicon.ico +0 -0
  2. package/.storybook/logo-blue.png +0 -0
  3. package/.storybook/main.js +15 -0
  4. package/.storybook/manager-head.html +14 -0
  5. package/.storybook/manager.js +6 -0
  6. package/.storybook/preview.js +10 -0
  7. package/.storybook/theme.js +10 -0
  8. package/Dockerfile +30 -0
  9. package/Jenkinsfile +73 -0
  10. package/build-storybook.log +14621 -0
  11. package/dist/assets/beem.jpeg +0 -0
  12. package/dist/components/{Accordion.js → Accordion/Accordion.js} +12 -6
  13. package/dist/components/Accordion/Accordion.stories.js +86 -0
  14. package/dist/components/{avatars.js → Avatars/avatars.js} +31 -11
  15. package/dist/components/Avatars/avatars.stories.js +69 -0
  16. package/dist/components/Buttons/Stories/basicbutton.stories.js +67 -0
  17. package/dist/components/Buttons/Stories/buttonAlertIcons.stories.js +65 -0
  18. package/dist/components/Buttons/Stories/buttonIconsOnly.stories.js +65 -0
  19. package/dist/components/{buttonAlertIcons.js → Buttons/buttonAlertIcons.js} +17 -9
  20. package/dist/components/{buttonIconsOnly.js → Buttons/buttonIconsOnly.js} +13 -4
  21. package/dist/components/{buttons.js → Buttons/buttons.js} +11 -10
  22. package/dist/components/{Reports → Cards}/cards.js +9 -24
  23. package/dist/components/Cards/cards.stories.js +61 -0
  24. package/dist/components/Chats/chat.js +1 -1
  25. package/dist/components/Chats/chatInput.js +1 -1
  26. package/dist/components/Chats/chatwrapper.js +1 -1
  27. package/dist/components/Lists/listBox.js +41 -0
  28. package/dist/components/Lists/listBox.stories.js +78 -0
  29. package/dist/components/Lists/listHeader.stories.js +58 -0
  30. package/dist/components/Lists/listheader.js +17 -12
  31. package/dist/components/Lists/rowLabels.js +34 -16
  32. package/dist/components/Lists/rowLabels.stories.js +85 -0
  33. package/dist/components/{loaders.js → Loader/loader.js} +13 -7
  34. package/dist/components/Loader/loader.stories.js +52 -0
  35. package/dist/components/{Reports/buttons.js → MainWrapper/index.js} +5 -3
  36. package/dist/components/Modals/modal copy.js +160 -0
  37. package/dist/components/Modals/modal.js +166 -0
  38. package/dist/components/Modals/modals.stories.js +117 -0
  39. package/dist/components/{infoNote.js → NoteBar.js/noteBar.js} +23 -19
  40. package/dist/components/NoteBar.js/noteBar.stories.js +66 -0
  41. package/dist/components/PerformanceIndicator/performaceIndicator.stories.js +66 -0
  42. package/dist/components/PerformanceIndicator/performanceIndicator.js +68 -0
  43. package/dist/components/Pills/pills.js +126 -0
  44. package/dist/components/Pills/pills.stories.js +110 -0
  45. package/dist/components/{progressbar.js → ProgressBar/progressbar.js} +8 -2
  46. package/dist/components/ProgressBar/progressbar.stories.js +45 -0
  47. package/dist/components/{Link.js → RouteLink/link.js} +8 -3
  48. package/dist/components/RouteLink/link.stories.js +29 -0
  49. package/dist/components/SuperFluid/ContentTitle.js/index.js +1 -1
  50. package/dist/components/SuperFluid/SegmentCard/index.js +1 -1
  51. package/dist/components/Tabs/tabs.js +85 -0
  52. package/dist/components/Tabs/tabs.stories.js +59 -0
  53. package/dist/components/breakpoints.js +18 -0
  54. package/dist/components/chatHeader.js +1 -1
  55. package/dist/components/checkboxToggler.js +2 -2
  56. package/dist/components/colors.js +5 -3
  57. package/dist/components/contacts.js +1 -1
  58. package/dist/components/dropdown.js +1 -1
  59. package/dist/components/dropdownButton.js +3 -3
  60. package/dist/components/dropdownItems.js +1 -1
  61. package/dist/components/example.js +47 -0
  62. package/dist/components/iconStyles.js +69 -119
  63. package/dist/components/index-copy.js +1285 -0
  64. package/dist/components/index.js +80 -1155
  65. package/dist/components/input.js +9 -3
  66. package/dist/components/logo.js +1 -1
  67. package/dist/components/navbar.js +1 -1
  68. package/dist/components/sidebar.js +2 -2
  69. package/dist/components/tabs.js +1 -1
  70. package/dist/components/text.js +1 -1
  71. package/dist/components/typography.js +1 -1
  72. package/nginx.conf +17 -0
  73. package/package.json +30 -11
  74. package/public/favicon.ico +0 -0
  75. package/public/index.html +1 -1
  76. package/src/App.js +12 -29
  77. package/src/examples/Navbar.js +1 -1
  78. package/src/lib/assets/beem.jpeg +0 -0
  79. package/src/lib/components/{Accordion.js → Accordion/Accordion.js} +5 -4
  80. package/src/lib/components/Accordion/Accordion.stories.js +63 -0
  81. package/src/lib/components/{avatars.js → Avatars/avatars.js} +24 -8
  82. package/src/lib/components/Avatars/avatars.stories.js +45 -0
  83. package/src/lib/components/Buttons/Stories/basicbutton.stories.js +51 -0
  84. package/src/lib/components/Buttons/Stories/buttonAlertIcons.stories.js +42 -0
  85. package/src/lib/components/Buttons/Stories/buttonIconsOnly.stories.js +49 -0
  86. package/src/lib/components/{buttonAlertIcons.js → Buttons/buttonAlertIcons.js} +20 -9
  87. package/src/lib/components/{buttonIconsOnly.js → Buttons/buttonIconsOnly.js} +12 -2
  88. package/src/lib/components/{buttons.js → Buttons/buttons.js} +10 -10
  89. package/src/lib/components/{Reports → Cards}/cards.js +10 -18
  90. package/src/lib/components/Cards/cards.stories.js +52 -0
  91. package/src/lib/components/Lists/listBox.js +34 -0
  92. package/src/lib/components/Lists/listBox.stories.js +47 -0
  93. package/src/lib/components/Lists/listHeader.stories.js +36 -0
  94. package/src/lib/components/Lists/listheader.js +17 -11
  95. package/src/lib/components/Lists/rowLabels.js +47 -16
  96. package/src/lib/components/Lists/rowLabels.stories.js +59 -0
  97. package/src/lib/components/{loaders.js → Loader/loader.js} +18 -7
  98. package/src/lib/components/Loader/loader.stories.js +30 -0
  99. package/src/lib/components/MainWrapper/index.js +7 -0
  100. package/src/lib/components/Modals/modal copy.js +159 -0
  101. package/src/lib/components/Modals/modal.js +152 -0
  102. package/src/lib/components/Modals/modals.stories.js +82 -0
  103. package/src/lib/components/{infoNote.js → NoteBar.js/noteBar.js} +24 -25
  104. package/src/lib/components/NoteBar.js/noteBar.stories.js +40 -0
  105. package/src/lib/components/PerformanceIndicator/performaceIndicator.stories.js +40 -0
  106. package/src/lib/components/PerformanceIndicator/performanceIndicator.js +56 -0
  107. package/src/lib/components/Pills/pills.js +91 -0
  108. package/src/lib/components/Pills/pills.stories.js +74 -0
  109. package/src/lib/components/{progressbar.js → ProgressBar/progressbar.js} +8 -1
  110. package/src/lib/components/ProgressBar/progressbar.stories.js +26 -0
  111. package/src/lib/components/{Link.js → RouteLink/link.js} +5 -4
  112. package/src/lib/components/RouteLink/link.stories.js +21 -0
  113. package/src/lib/components/Tabs/tabs.js +84 -0
  114. package/src/lib/components/Tabs/tabs.stories.js +36 -0
  115. package/src/lib/components/breakpoints.js +11 -0
  116. package/src/lib/components/colors.js +2 -0
  117. package/src/lib/components/dropdownButton.js +2 -2
  118. package/src/lib/components/example.js +30 -0
  119. package/src/lib/components/iconStyles.js +46 -101
  120. package/src/lib/components/index-copy.js +468 -0
  121. package/src/lib/components/index.js +38 -445
  122. package/src/lib/components/input.js +8 -2
  123. package/src/lib/components/sidebar.js +1 -1
  124. package/storybook-static/0.00c62ec79c260aedbb98.manager.bundle.js +2 -0
  125. package/storybook-static/0.00c62ec79c260aedbb98.manager.bundle.js.LICENSE.txt +8 -0
  126. package/storybook-static/0.96c45dd8.iframe.bundle.js +1 -0
  127. package/storybook-static/1.dc6acfa9.iframe.bundle.js +3 -0
  128. package/storybook-static/1.dc6acfa9.iframe.bundle.js.LICENSE.txt +8 -0
  129. package/storybook-static/1.dc6acfa9.iframe.bundle.js.map +1 -0
  130. package/storybook-static/1.dc7dcdaec2def2f224fd.manager.bundle.js +1 -0
  131. package/storybook-static/2.24353ddc.iframe.bundle.js +1 -0
  132. package/storybook-static/3.8bb2173c.iframe.bundle.js +1 -0
  133. package/storybook-static/5.0779e3847d325dece216.manager.bundle.js +1 -0
  134. package/storybook-static/6.8bd405c2576206749a16.manager.bundle.js +2 -0
  135. package/storybook-static/6.8bd405c2576206749a16.manager.bundle.js.LICENSE.txt +12 -0
  136. package/storybook-static/7.9d4ba19cf58425e7ff0d.manager.bundle.js +1 -0
  137. package/storybook-static/7.f0cfc757.iframe.bundle.js +1 -0
  138. package/storybook-static/8.91de97de.iframe.bundle.js +3 -0
  139. package/storybook-static/8.91de97de.iframe.bundle.js.LICENSE.txt +12 -0
  140. package/storybook-static/8.91de97de.iframe.bundle.js.map +1 -0
  141. package/storybook-static/8.b4e9ec0ec7648e02a923.manager.bundle.js +1 -0
  142. package/storybook-static/9.40ec65d6.iframe.bundle.js +1 -0
  143. package/storybook-static/asset-manifest.json +30 -0
  144. package/storybook-static/favicon.ico +0 -0
  145. package/storybook-static/iframe.html +348 -0
  146. package/storybook-static/index.html +110 -0
  147. package/storybook-static/main.3c8d8027.iframe.bundle.js +1 -0
  148. package/storybook-static/main.3e5804fe56d1f580b088.manager.bundle.js +1 -0
  149. package/storybook-static/runtime~main.d3a18d6a.iframe.bundle.js +1 -0
  150. package/storybook-static/runtime~main.ff106120648356c6069d.manager.bundle.js +1 -0
  151. package/storybook-static/static/css/main.b44a190d.chunk.css +4 -0
  152. package/storybook-static/static/css/main.b44a190d.chunk.css.map +1 -0
  153. package/storybook-static/static/media/OpenSans-Regular.1b0809d5.ttf +0 -0
  154. package/storybook-static/static/media/PoppinsBold.1eae2d48.woff2 +0 -0
  155. package/storybook-static/static/media/PoppinsBold.53ff6749.eot +0 -0
  156. package/storybook-static/static/media/PoppinsBold.53ff971f.ttf +0 -0
  157. package/storybook-static/static/media/PoppinsBold.850fc4f3.svg +3066 -0
  158. package/storybook-static/static/media/PoppinsBold.b33c148b.woff +0 -0
  159. package/storybook-static/static/media/PoppinsMedium.0ba26f6c.woff +0 -0
  160. package/storybook-static/static/media/PoppinsMedium.49b46ace.eot +0 -0
  161. package/storybook-static/static/media/PoppinsMedium.57a99fa8.woff2 +0 -0
  162. package/storybook-static/static/media/PoppinsMedium.b7e43707.svg +3103 -0
  163. package/storybook-static/static/media/PoppinsMedium.c98dddbd.ttf +0 -0
  164. package/storybook-static/static/media/PoppinsRegular.13b9af9c.eot +0 -0
  165. package/storybook-static/static/media/PoppinsRegular.43e9b50d.svg +3138 -0
  166. package/storybook-static/static/media/PoppinsRegular.4a4d5420.woff +0 -0
  167. package/storybook-static/static/media/PoppinsRegular.9a7cc7ec.woff2 +0 -0
  168. package/storybook-static/static/media/PoppinsRegular.e1bc9021.ttf +0 -0
  169. package/storybook-static/static/media/PoppinsSemiBold.5692c77f.ttf +0 -0
  170. package/storybook-static/static/media/PoppinsSemiBold.80138c67.woff +0 -0
  171. package/storybook-static/static/media/PoppinsSemiBold.c442695a.eot +0 -0
  172. package/storybook-static/static/media/PoppinsSemiBold.e1948d56.svg +3098 -0
  173. package/storybook-static/static/media/PoppinsSemiBold.f27050e2.woff2 +0 -0
  174. package/storybook-static/static/media/logo-blue.bfc5ba6d.png +0 -0
  175. package/storybook-static/vendors~main.1750028c2d68e574fb1d.manager.bundle.js +2 -0
  176. package/storybook-static/vendors~main.1750028c2d68e574fb1d.manager.bundle.js.LICENSE.txt +104 -0
  177. package/storybook-static/vendors~main.7fe78cc2.iframe.bundle.js +3 -0
  178. package/storybook-static/vendors~main.7fe78cc2.iframe.bundle.js.LICENSE.txt +122 -0
  179. package/storybook-static/vendors~main.7fe78cc2.iframe.bundle.js.map +1 -0
  180. package/dist/assets/content_copy_black.svg +0 -1
  181. package/dist/assets/profile-pic.jpg +0 -0
  182. package/dist/components/Accordicon.js +0 -51
  183. package/dist/components/CustomerInfo/customerInfo.js +0 -89
  184. package/dist/components/CustomerInfo/customerInfoBar.js +0 -24
  185. package/dist/components/CustomerInfo/infoAccordion.js +0 -78
  186. package/dist/components/CustomerInfo/labelsInfo.js +0 -37
  187. package/dist/components/CustomerInfo/notesInfo.js +0 -39
  188. package/dist/components/Modals/modalBody.js +0 -61
  189. package/dist/components/Modals/noteModalBody.js +0 -20
  190. package/dist/components/Modals/noteModalFooter.js +0 -24
  191. package/dist/components/Modals/noteModalHeader.js +0 -93
  192. package/dist/components/Reports/charts.js +0 -70
  193. package/dist/components/Reports/infoHeader.js +0 -65
  194. package/dist/components/Reports/reportsBody.js +0 -28
  195. package/dist/components/Reports/title.js +0 -28
  196. package/dist/components/performanceIndicator.js +0 -41
  197. package/dist/components/pills.js +0 -73
  198. package/src/App1.js +0 -229
  199. package/src/CHAT.js +0 -170
  200. package/src/Complete.js +0 -48
  201. package/src/CreateSegments.js +0 -48
  202. package/src/FileUploadSFL.js +0 -110
  203. package/src/examples/CustomerInfo.js +0 -248
  204. package/src/lib/assets/content_copy_black.svg +0 -1
  205. package/src/lib/assets/profile-pic.jpg +0 -0
  206. package/src/lib/components/Accordicon.js +0 -43
  207. package/src/lib/components/CustomerInfo/customerInfo.js +0 -91
  208. package/src/lib/components/CustomerInfo/customerInfoBar.js +0 -23
  209. package/src/lib/components/CustomerInfo/infoAccordion.js +0 -96
  210. package/src/lib/components/CustomerInfo/labelsInfo.js +0 -37
  211. package/src/lib/components/CustomerInfo/notesInfo.js +0 -61
  212. package/src/lib/components/Modals/modalBody.js +0 -66
  213. package/src/lib/components/Modals/noteModalBody.js +0 -10
  214. package/src/lib/components/Modals/noteModalFooter.js +0 -16
  215. package/src/lib/components/Modals/noteModalHeader.js +0 -103
  216. package/src/lib/components/Reports/buttons.js +0 -5
  217. package/src/lib/components/Reports/charts.js +0 -79
  218. package/src/lib/components/Reports/infoHeader.js +0 -63
  219. package/src/lib/components/Reports/reportsBody.js +0 -29
  220. package/src/lib/components/Reports/title.js +0 -19
  221. package/src/lib/components/performanceIndicator.js +0 -27
  222. package/src/lib/components/pills.js +0 -65
@@ -1,8 +1,14 @@
1
- import React from 'react';
1
+ import React from "react";
2
2
  import styled from "styled-components";
3
+ import PropTypes from "prop-types";
3
4
  import { withStyles } from "@material-ui/core/styles";
4
- import { BmSecondaryGrey, BmSecondaryRed, BmPrimaryWhite } from "./colors";
5
+ import {
6
+ BmSecondaryGrey,
7
+ BmSecondaryRed,
8
+ BmPrimaryWhite,
9
+ } from "../colors";
5
10
  import Badge from "@material-ui/core/Badge";
11
+ import { PoppinsMedium } from "../typography";
6
12
 
7
13
  const size = (props) => {
8
14
  if (props.size === "small") return "1.429rem";
@@ -22,22 +28,21 @@ const AlertIcon = {
22
28
  root: {
23
29
  height: (props) => size(props),
24
30
  width: (props) => size(props),
25
- fill: (props) => props.color ||`${BmSecondaryGrey}`
31
+ fill: (props) => props.color || `${BmSecondaryGrey}`,
26
32
  },
27
33
  };
28
34
 
29
- const BadgeIcon = (props) => ({
35
+ const BadgeIcon = () => ({
30
36
  badge: {
31
37
  height: (props) => Badgesize(props),
32
38
  width: (props) => Badgesize(props),
33
39
  minWidth: (props) => Badgesize(props),
34
- background:(props) => props.badgeColor || `${BmSecondaryRed}`,
40
+ background: (props) => props.badgeColor || `${BmSecondaryRed}`,
35
41
  color: `${BmPrimaryWhite}`,
36
- fontFamily: "Poppins",
42
+ fontFamily: `${PoppinsMedium}`,
37
43
  fontStyle: "normal",
38
44
  fontWeight: 500,
39
45
  fontSize: "0.643rem",
40
- lineHeight: "0.929rem",
41
46
  display: "flex",
42
47
  alignItems: "center",
43
48
  textAlign: "center",
@@ -69,8 +74,6 @@ export const BmBtnIconWrapper = styled.button`
69
74
  justify-content: center;
70
75
  align-items: center;
71
76
  padding: 0.536rem;
72
- height: 3.357rem;
73
- ${"" /* added */}
74
77
  border: none;
75
78
  background: none;
76
79
  `;
@@ -89,3 +92,11 @@ export const BmAlertIcon = (props) => {
89
92
  </BmBtnIconWrapper>
90
93
  );
91
94
  };
95
+
96
+ BmAlertIcon.propTypes = {
97
+ size: PropTypes.string,
98
+ badgeColor: PropTypes.string,
99
+ badgeContent: PropTypes.string,
100
+ icon: PropTypes.node,
101
+ color: PropTypes.string,
102
+ };
@@ -1,5 +1,7 @@
1
1
  import React from "react";
2
2
  import styled from "styled-components";
3
+ import PropTypes from "prop-types";
4
+
3
5
  import {
4
6
  BmPrimaryWhite,
5
7
  BmPrimaryBlue,
@@ -8,8 +10,8 @@ import {
8
10
  BmSecondaryRed,
9
11
  BmSecondaryDarkGreen,
10
12
  BmGrey400,
11
- } from "./colors";
12
- import { BmButtonIcon } from "./iconStyles";
13
+ } from "../colors";
14
+ import { BmButtonIcon } from "../iconStyles";
13
15
 
14
16
  const BeemButtonIcon = styled.button`
15
17
  display: flex;
@@ -75,3 +77,11 @@ export const BmBtnIcon = (props) => {
75
77
  </BeemButtonIcon>
76
78
  );
77
79
  };
80
+
81
+ BmBtnIcon.propTypes = {
82
+ size: PropTypes.string,
83
+ variant: PropTypes.string,
84
+ icon: PropTypes.node,
85
+ color: PropTypes.string,
86
+ disabled: PropTypes.bool,
87
+ };
@@ -13,9 +13,9 @@ import {
13
13
  BmSecondaryCyan,
14
14
  BmSecondaryGreen8,
15
15
  BmSecondaryRed8,
16
- } from "./colors";
17
- import { BmButtonIcon } from "./iconStyles";
18
- import { h3, h4 } from "./text";
16
+ } from "../colors";
17
+ import { BmButtonIcon } from "../iconStyles";
18
+ import { h3, h4 } from "../text";
19
19
 
20
20
  const ButtonText = styled.div`
21
21
  ${({ size }) => {
@@ -161,11 +161,11 @@ const BeemButton = styled.button`
161
161
  `;
162
162
 
163
163
  export const BmLeftIcon = styled(BmButtonIcon)`
164
- padding-right: 0.5rem;
164
+ margin-right: 0.5rem;
165
165
  `;
166
166
 
167
167
  export const BmRightIcon = styled(BmButtonIcon)`
168
- padding-left: 0.5rem;
168
+ margin-left: 0.5rem;
169
169
  `;
170
170
  export const BmButton = (props) => {
171
171
  const {
@@ -219,9 +219,9 @@ export const BmButton = (props) => {
219
219
 
220
220
  BmButton.propTypes = {
221
221
  size: PropTypes.string,
222
- variant: PropTypes.string.isRequired,
223
- };
224
-
225
- BmButton.defaultProps = {
226
- onClick: undefined,
222
+ variant: PropTypes.string,
223
+ leadingIcon: PropTypes.node,
224
+ trailingIcon: PropTypes.node,
225
+ color: PropTypes.string,
226
+ disabled: PropTypes.bool,
227
227
  };
@@ -13,29 +13,15 @@ export const BmCard = styled.div`
13
13
  background: ${BmPrimaryWhite};
14
14
  border: 0.0625rem solid ${BmGrey400};
15
15
  border-radius: 0.21875rem;
16
- width: calc(25% - 1rem);
17
- ${'' /* margin-right: 0.5rem; */}
18
16
  `;
19
17
 
20
- export const CardTitleWrapper = styled.div`
18
+ BmCard.Header = styled.div`
21
19
  display: flex;
22
20
  flex-direction: row;
23
21
  padding: 1rem 1rem 0rem 1rem;
24
22
  `;
25
23
 
26
- export const CardTitleText = styled.h3`
27
- color: ${BmPrimaryBlack};
28
- `;
29
-
30
- export const CardTitle = (props) => {
31
- return (
32
- <CardTitleWrapper>
33
- <CardTitleText>{props.children}</CardTitleText>
34
- </CardTitleWrapper>
35
- );
36
- };
37
-
38
- export const BmCardBody = styled.div`
24
+ BmCard.Body = styled.div`
39
25
  display: flex;
40
26
  flex-direction: row;
41
27
  justify-content: space-between;
@@ -44,6 +30,10 @@ export const BmCardBody = styled.div`
44
30
  padding: 0rem 1rem;
45
31
  `;
46
32
 
33
+ export const CardTitleText = styled.h3`
34
+ color: ${BmPrimaryBlack};
35
+ `;
36
+
47
37
  export const BmCardBodyText = styled.h1`
48
38
  display: flex;
49
39
  color: ${BmPrimaryBlack};
@@ -57,12 +47,12 @@ export const BmCardBodyImg = styled.div`
57
47
  width: 3rem;
58
48
  `;
59
49
 
60
- export const BmCardFooter = styled.div`
50
+ BmCard.Footer = styled.div`
61
51
  display: flex;
62
52
  flex-direction: row;
63
53
  justify-content: space-between;
64
54
  border-top: 0.0625rem solid ${BmGrey400};
65
- padding: 1rem 0rem 1rem 1rem;
55
+ padding: 1rem;
66
56
  align-items: center;
67
57
  `;
68
58
 
@@ -76,3 +66,5 @@ export const BmCardDetails = styled.div`
76
66
  display: flex;
77
67
  align-items: center;
78
68
  `;
69
+
70
+ export default BmCard;
@@ -0,0 +1,52 @@
1
+ /* eslint-disable import/no-anonymous-default-export */
2
+ import React from "react";
3
+ import BmCard from "./cards";
4
+ import { text, boolean, select } from "@storybook/addon-knobs";
5
+ import "../../../main.scss";
6
+ import { Favorite, Home } from "@material-ui/icons";
7
+ import { BmButton } from "../Buttons/buttons";
8
+ import { BmTag } from "../tags";
9
+ import Image from "../../assets/beem.jpeg";
10
+
11
+ export default {
12
+ component: BmCard,
13
+ title: "components/Card",
14
+ argTypes: {
15
+ children: {
16
+ description: "Accordion Title Text",
17
+ defaultValue: { summary: undefined },
18
+ },
19
+ },
20
+ };
21
+ export const BasicCardSample = () => {
22
+ return (
23
+ <div>
24
+ <BmCard disabled={boolean("disabled", false)}>
25
+ <BmCard.Header>
26
+ <h3>{text("children", "Card Header")}</h3>
27
+ </BmCard.Header>
28
+ <BmCard.Body>Card Body</BmCard.Body>
29
+ <BmCard.Footer>Card Footer</BmCard.Footer>
30
+ </BmCard>
31
+ </div>
32
+ );
33
+ };
34
+
35
+ export const Example = () => {
36
+ return (
37
+ <BmCard>
38
+ <BmCard.Header>
39
+ <h3>Overview</h3>
40
+ </BmCard.Header>
41
+ <BmCard.Body>
42
+ <img src={Image} alt="Imagebody" />
43
+ </BmCard.Body>
44
+ <BmCard.Footer>
45
+ <BmButton size="small">Send</BmButton>
46
+ <BmButton variant="tertiary" size="small">
47
+ View
48
+ </BmButton>
49
+ </BmCard.Footer>
50
+ </BmCard>
51
+ );
52
+ };
@@ -0,0 +1,34 @@
1
+ import styled from "styled-components";
2
+ import { BmGrey400, BmPrimaryWhite } from "../colors";
3
+ import PropTypes from "prop-types";
4
+
5
+ const show = (isOpen) => {
6
+ if (isOpen !== undefined) {
7
+ if (isOpen === true) {
8
+ return `display: flex;
9
+ position: absolute;
10
+ margin-top: 0.5rem`;
11
+ }
12
+ if (isOpen === false) {
13
+ return `display: none;
14
+ position: absolute;
15
+ margin-top: 0.5rem`;
16
+ }
17
+ }
18
+ return "flex";
19
+ };
20
+ export const BmListBox = styled.div`
21
+ ${(props) => show(props.isOpen)};
22
+ flex-direction: column;
23
+ padding: 0.286rem 0rem;
24
+ background: ${BmPrimaryWhite};
25
+ border: 0.071rem solid ${BmGrey400};
26
+ box-shadow: 0rem 0.286rem 0.286rem rgba(0, 0, 0, 0.25);
27
+ border-radius: 0.21875rem;
28
+ z-index: 99999;
29
+ cursor: pointer;
30
+ `;
31
+
32
+ BmListBox.propTypes = {
33
+ isOpen: PropTypes.bool,
34
+ }
@@ -0,0 +1,47 @@
1
+ /* eslint-disable import/no-anonymous-default-export */
2
+ import React, { useState } from "react";
3
+ import { BmListBox } from "./listBox";
4
+ import { KeyboardArrowRight } from "@material-ui/icons";
5
+ import { BmRowLabel } from "./rowLabels";
6
+ import { BmButton } from "../Buttons/buttons";
7
+
8
+ export default {
9
+ component: BmListBox,
10
+ title: "components/Lists/ListBox",
11
+ argTypes: {
12
+ isOpen: {
13
+ description:
14
+ "true/false (optional), Used for handling the display of listbox",
15
+ },
16
+ },
17
+ };
18
+
19
+ export const ListBox = () => {
20
+ return (
21
+ <BmListBox>
22
+ <BmRowLabel trailingIcon={<KeyboardArrowRight />} size="large">
23
+ <h4>Row Label</h4>
24
+ </BmRowLabel>
25
+ <BmRowLabel size="large">
26
+ <h4>Row Label</h4>
27
+ </BmRowLabel>
28
+ </BmListBox>
29
+ );
30
+ };
31
+
32
+ export const FunctionalListBox = () => {
33
+ const [List, showList] = useState(true);
34
+ return (
35
+ <>
36
+ <BmButton onClick={() => showList(!List)}>Click Me!</BmButton>
37
+ <BmListBox isOpen={List}>
38
+ <BmRowLabel trailingIcon={<KeyboardArrowRight />} size="large">
39
+ <h4>Row Label</h4>
40
+ </BmRowLabel>
41
+ <BmRowLabel size="large">
42
+ <h4>Row Label</h4>
43
+ </BmRowLabel>
44
+ </BmListBox>
45
+ </>
46
+ );
47
+ };
@@ -0,0 +1,36 @@
1
+ /* eslint-disable import/no-anonymous-default-export */
2
+ import React from "react";
3
+ import { BmListHeader } from "./listheader";
4
+ import "../../../main.scss";
5
+ import { Favorite } from "@material-ui/icons";
6
+
7
+ export default {
8
+ component: BmListHeader,
9
+ title: "components/Lists/ListHeader",
10
+ argType: {
11
+ size: {
12
+ options: ["small", "medium", "large"],
13
+ control: { type: "select" },
14
+ description: "Size of the trailing icon",
15
+ defaultValue: { summary: "large" },
16
+ },
17
+ trailingIcon: {
18
+ description: "Material-UI Icon(optional)",
19
+ defaultValue: { summary: undefined },
20
+ },
21
+ color: {
22
+ description: "Color of the Icon",
23
+ },
24
+ children: {
25
+ description: "List header text",
26
+ },
27
+ },
28
+ };
29
+
30
+ const MainListHeader = (args) => <BmListHeader {...args} />;
31
+
32
+ export const ListHeader = MainListHeader.bind({});
33
+ ListHeader.args = {
34
+ children: <h3>List Header</h3>,
35
+ trailingIcon: <Favorite />,
36
+ };
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import styled from "styled-components";
3
3
  import { BmPrimaryBlack, BmPrimaryBlue } from "../colors";
4
4
  import { BmIcons } from "../iconStyles";
5
+ import PropTypes from "prop-types";
5
6
 
6
7
  export const Container = styled.div`
7
8
  display: flex;
@@ -11,19 +12,24 @@ export const Container = styled.div`
11
12
  border-bottom: 0.125rem solid ${BmPrimaryBlue};
12
13
  `;
13
14
 
14
- export const Title = styled.h3`
15
- color: ${BmPrimaryBlack};
16
- `;
17
-
18
- export const Icon = styled(BmIcons)`
19
- margin-left: auto;
20
- `;
21
-
22
- export const BmListHeader = ({ children, trailingIcon }) => {
15
+ export const BmListHeader = ({ children, trailingIcon, size, color }) => {
23
16
  return (
24
17
  <Container>
25
- <Title>{children}</Title>
26
- {trailingIcon && <Icon icon={trailingIcon} color={`${BmPrimaryBlack}`} />}
18
+ {children}
19
+ {trailingIcon && (
20
+ <BmIcons
21
+ icon={trailingIcon}
22
+ color={color || `${BmPrimaryBlack}` }
23
+ size={size || 'large'}
24
+ />
25
+ )}
27
26
  </Container>
28
27
  );
29
28
  };
29
+
30
+ BmListHeader.propTypes = {
31
+ children: PropTypes.object,
32
+ trailingIcon: PropTypes.node,
33
+ color: PropTypes.string,
34
+ size: PropTypes.string,
35
+ };
@@ -2,31 +2,34 @@ import React from "react";
2
2
  import styled from "styled-components";
3
3
  import { BmGrey100, BmPrimaryBlack, BmPrimaryWhite } from "../colors";
4
4
  import { BmIcons } from "../iconStyles";
5
+ import PropTypes from "prop-types";
5
6
 
6
7
  export const Container = styled.div`
7
8
  display: flex;
8
9
  flex-direction: row;
9
10
  align-items: center;
10
11
  padding: 0.5rem 1rem;
12
+ justify-content: space-between;
11
13
  background: ${BmPrimaryWhite};
12
14
  margin: 0rem;
13
-
14
15
  &:hover {
15
16
  background: ${BmGrey100};
16
17
  }
17
18
  `;
18
19
 
19
- export const Title = styled.p`
20
- color: ${BmPrimaryBlack};
21
- `;
22
-
23
- export const LeftIcon = styled(BmIcons)`
24
- margin-right: 0.5rem;
20
+ export const LeftContainer = styled.div`
21
+ display: flex;
22
+ flex-direction: flex-start;
23
+ align-items: center;
24
+ > * {
25
+ margin-right: 0.5rem;
26
+ }
25
27
  `;
26
28
 
27
29
  export const RightContainer = styled.div`
28
30
  margin-left: auto;
29
31
  display: flex;
32
+ flex-direction: flex-end;
30
33
  align-items: center;
31
34
  `;
32
35
 
@@ -38,24 +41,52 @@ export const Label = styled.p`
38
41
  margin-right: 0.5rem;
39
42
  `}
40
43
  `;
41
-
42
- export const BmRowLabel = ({ children, trailingIcon, leadingIcon, label, ...rest }) => {
44
+ export const BmRowLabel = ({
45
+ children,
46
+ trailingIcon,
47
+ leadingIcon,
48
+ label,
49
+ color,
50
+ size,
51
+ ...rest
52
+ }) => {
43
53
  return (
44
- <Container {...rest}>
45
- {leadingIcon && (
46
- <LeftIcon icon={leadingIcon} color={`${BmPrimaryBlack}`} />
47
- )}
48
- <Title>{children}</Title>
54
+ <Container
55
+ trailingIcon={trailingIcon}
56
+ leadingIcon={leadingIcon}
57
+ label={label}
58
+ size={size}
59
+ {...rest}
60
+ >
61
+ <LeftContainer>
62
+ {leadingIcon && (
63
+ <BmIcons
64
+ icon={leadingIcon}
65
+ color={color || `${BmPrimaryBlack}}`}
66
+ size={size || 'small'}
67
+ />
68
+ )}
69
+ {children}
70
+ </LeftContainer>
49
71
  <RightContainer>
50
72
  {label && <Label trailingIcon={trailingIcon}>{label}</Label>}
51
73
  {trailingIcon && (
52
74
  <BmIcons
53
75
  icon={trailingIcon}
54
- color={`${BmPrimaryBlack}`}
55
- size="small"
76
+ color={color || `${BmPrimaryBlack}}`}
77
+ size={size || 'small'}
56
78
  />
57
79
  )}
58
80
  </RightContainer>
59
81
  </Container>
60
82
  );
61
83
  };
84
+
85
+ BmRowLabel.propTypes = {
86
+ children: PropTypes.object,
87
+ trailingIcon: PropTypes.node,
88
+ label: PropTypes.object,
89
+ leadingIcon: PropTypes.node,
90
+ color: PropTypes.string,
91
+ size: PropTypes.string,
92
+ };
@@ -0,0 +1,59 @@
1
+ /* eslint-disable import/no-anonymous-default-export */
2
+ import React from "react";
3
+ import { BmRowLabel } from "./rowLabels";
4
+ import "../../../main.scss";
5
+ import { Favorite, KeyboardArrowRight } from "@material-ui/icons";
6
+
7
+ export default {
8
+ component: BmRowLabel,
9
+ title: "components/Lists/RowLabels",
10
+ argType: {
11
+ size: {
12
+ options: ["small", "medium", "large"],
13
+ control: { type: "select" },
14
+ description: "Size of the icons",
15
+ defaultValue: { summary: "small" },
16
+ },
17
+ trailingIcon: {
18
+ description: "Material-UI Icon(optional)",
19
+ defaultValue: { summary: undefined },
20
+ },
21
+ leadingIcon: {
22
+ description: "Material-UI Icon(optional)",
23
+ defaultValue: { summary: undefined },
24
+ },
25
+ color: {
26
+ description: "Color of the Icons",
27
+ },
28
+ children: {
29
+ description: "Row Label text",
30
+ },
31
+ label: {
32
+ description: "Label Text",
33
+ },
34
+ },
35
+ };
36
+
37
+ const MainRowLabel = (args) => <BmRowLabel {...args} />;
38
+
39
+ export const TextOnly = MainRowLabel.bind({});
40
+ TextOnly.args = {
41
+ children: <h3>Row Label</h3>,
42
+ };
43
+
44
+ export const TextLabel = MainRowLabel.bind({});
45
+ TextLabel.args = {
46
+ children: <h3>Row Label</h3>,
47
+ label: <h3>Label</h3>,
48
+ };
49
+
50
+ export const LabelIcons = MainRowLabel.bind({});
51
+ LabelIcons.args = {
52
+ ...TextLabel.args,
53
+ trailingIcon: <KeyboardArrowRight />,
54
+ leadingIcon: <Favorite />,
55
+ size: "large",
56
+ };
57
+
58
+ //TODO: add checkbox button example
59
+ //TODO: size not working
@@ -1,26 +1,32 @@
1
- import React from 'react';
1
+ import React from "react";
2
+ import Proptypes from 'prop-types';
2
3
  import CircularProgress from "@material-ui/core/CircularProgress";
3
4
  import styled from "styled-components";
4
5
  import { withStyles } from "@material-ui/core/styles";
5
- import { BmPrimaryBlue } from "./colors";
6
+ import {
7
+ BmPrimaryBlue,
8
+ BmSecondaryDarkGreen,
9
+ BmSecondaryRed,
10
+ BmPrimaryGold,
11
+ } from "../colors";
6
12
 
7
13
  const style = {
8
14
  colorPrimary: {
9
- color: ({ color }) => {
10
- if (color) return color;
15
+ color: ({ type }) => {
16
+ if (type === "success") return `${BmSecondaryDarkGreen}`;
17
+ if (type === "warning") return `${BmPrimaryGold}`;
18
+ if (type === "error") return `${BmSecondaryRed}`;
11
19
  return `${BmPrimaryBlue}`;
12
20
  },
13
21
  },
14
22
  };
15
23
 
16
24
  export const BmLoader = withStyles(style)(({ size, ...rest }) => {
17
- let defaultSize;
25
+ let defaultSize = size || "2.286rem";
18
26
  if (size) {
19
27
  if (size === "large") defaultSize = "2.286rem";
20
28
  if (size === "medium") defaultSize = "1.714rem";
21
29
  if (size === "small") defaultSize = "1.429rem";
22
- } else {
23
- defaultSize = size;
24
30
  }
25
31
  return <CircularProgress action size={defaultSize} {...rest} />;
26
32
  });
@@ -30,3 +36,8 @@ export const Loader = styled.div`
30
36
  align-items: center;
31
37
  justify-content: center;
32
38
  `;
39
+
40
+ BmLoader.propTypes = {
41
+ size: Proptypes.string,
42
+ type: Proptypes.string,
43
+ }
@@ -0,0 +1,30 @@
1
+ /* eslint-disable import/no-anonymous-default-export */
2
+ import React from "react";
3
+ import { BmLoader } from "./loader";
4
+
5
+ export default {
6
+ component: BmLoader,
7
+ title: "components/Loader",
8
+ argTypes: {
9
+ size: {
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
+ },
15
+ type: {
16
+ options: ["success", "warning", "error"],
17
+ control: { type: "select" },
18
+ description: "Type of loader",
19
+ defaultValue: { summary: "Beem default loader" },
20
+ },
21
+ },
22
+ };
23
+
24
+ const MainLoader = (args) => <BmLoader {...args} />;
25
+
26
+ export const Loader = MainLoader.bind({});
27
+ Loader.args = {
28
+ type: "success",
29
+ size: "small",
30
+ };
@@ -0,0 +1,7 @@
1
+ import styled from "styled-components";
2
+ import { BmBgGreyBlue } from "../colors";
3
+
4
+ export const MainWrapper = styled.div`
5
+ padding: 2.1875rem;
6
+ background-color: ${BmBgGreyBlue};
7
+ `;