beem-component 1.5.6 → 1.5.9

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 (209) hide show
  1. package/.babelrc +17 -0
  2. package/.eslintrc +62 -0
  3. package/.prettierrc +6 -0
  4. package/dist/assets/fb.png +0 -0
  5. package/dist/assets/insta.png +0 -0
  6. package/dist/assets/wa.png +0 -0
  7. package/dist/components/Accordion/Accordion.js +31 -64
  8. package/dist/components/Accordion/Accordion.stories.js +29 -29
  9. package/dist/components/Avatars/avatars.js +31 -46
  10. package/dist/components/Avatars/avatars.stories.js +18 -18
  11. package/dist/components/BannerCard/bannerCard.stories.js +14 -14
  12. package/dist/components/BannerCard/bannerCards.js +30 -48
  13. package/dist/components/Buttons/Stories/basicbutton.stories.js +24 -24
  14. package/dist/components/Buttons/Stories/buttonAlertIcons.stories.js +17 -17
  15. package/dist/components/Buttons/Stories/buttonIconsOnly.stories.js +17 -17
  16. package/dist/components/Buttons/buttonAlertIcons.js +28 -44
  17. package/dist/components/Buttons/buttonDropdown copy.js +15 -18
  18. package/dist/components/Buttons/buttonDropdown.js +2 -2
  19. package/dist/components/Buttons/buttonIconsOnly.js +35 -49
  20. package/dist/components/Buttons/buttons.js +75 -86
  21. package/dist/components/Cards/cards.js +15 -11
  22. package/dist/components/Cards/cards.stories.js +8 -8
  23. package/dist/components/ChatComponents/ChatBody/chatBody.js +80 -69
  24. package/dist/components/ChatComponents/ChatBody/chatBody.stories.js +6 -6
  25. package/dist/components/ChatComponents/ChatBody/sessionDetails.js +9 -16
  26. package/dist/components/ChatComponents/ChatHeader/chatHeader.js +5 -7
  27. package/dist/components/ChatComponents/ChatHeader/chatHeader.stories.js +3 -3
  28. package/dist/components/ChatComponents/ColorPicker/colorPicker.js +5 -7
  29. package/dist/components/ChatComponents/ColorPicker/colorPicker.stories.js +7 -3
  30. package/dist/components/ChatComponents/ContactCards/contactCards.js +15 -12
  31. package/dist/components/ChatComponents/ContactCards/contactCards.stories.js +4 -4
  32. package/dist/components/ChatComponents/FormAccordion/FormAccordion.js +14 -10
  33. package/dist/components/ChatComponents/FormAccordion/FormAccordion.stories.js +9 -5
  34. package/dist/components/ChatComponents/InfoTab/infoTab.js +11 -9
  35. package/dist/components/ChatComponents/InfoTab/infoTab.stories.js +6 -6
  36. package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.js +5 -7
  37. package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +12 -7
  38. package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.js +11 -9
  39. package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +15 -13
  40. package/dist/components/Chats/chat.js +41 -32
  41. package/dist/components/Chats/chatInput.js +18 -14
  42. package/dist/components/Chats/chatwrapper.js +20 -12
  43. package/dist/components/Checkbox/checkboxToggler.js +61 -0
  44. package/dist/components/Checkbox/checkboxToggler.stories.js +81 -0
  45. package/dist/components/Lists/listBox.js +14 -30
  46. package/dist/components/Lists/listBox.stories.js +12 -23
  47. package/dist/components/Lists/listHeader.stories.js +13 -13
  48. package/dist/components/Lists/listheader.js +12 -27
  49. package/dist/components/Lists/rowLabels.js +19 -30
  50. package/dist/components/Lists/rowLabels.stories.js +22 -25
  51. package/dist/components/Loader/loader.js +17 -31
  52. package/dist/components/Loader/loader.stories.js +13 -13
  53. package/dist/components/MainWrapper/index.js +5 -7
  54. package/dist/components/MessageCounter/MessageCounter.stories.js +14 -14
  55. package/dist/components/MessageCounter/messageCounter.js +16 -18
  56. package/dist/components/Modals/modal.js +38 -57
  57. package/dist/components/Modals/modals.stories.js +38 -29
  58. package/dist/components/NoteBar/noteBar.js +28 -57
  59. package/dist/components/NoteBar/noteBar.stories.js +17 -17
  60. package/dist/components/PerformanceIndicator/performaceIndicator.stories.js +15 -15
  61. package/dist/components/PerformanceIndicator/performanceIndicator.js +21 -34
  62. package/dist/components/Pills/pills.js +24 -56
  63. package/dist/components/Pills/pills.stories.js +21 -23
  64. package/dist/components/ProfileIcon/ProfileIcon.js +96 -0
  65. package/dist/components/ProfileIcon/profileIcon.stories.js +82 -0
  66. package/dist/components/ProgressBar/progressbar.js +15 -17
  67. package/dist/components/ProgressBar/progressbar.stories.js +8 -10
  68. package/dist/components/ProgressRing/progressRing.js +38 -54
  69. package/dist/components/ProgressRing/progressRing.stories.js +16 -16
  70. package/dist/components/RouteLink/link.js +8 -10
  71. package/dist/components/RouteLink/link.stories.js +3 -3
  72. package/dist/components/ScrollBar/scrollBar.js +19 -17
  73. package/dist/components/SuperFluid/Content/index.js +5 -7
  74. package/dist/components/SuperFluid/ContentTitle.js/index.js +14 -10
  75. package/dist/components/SuperFluid/SegmentCard/index.js +22 -13
  76. package/dist/components/Tabs/tabs.js +16 -35
  77. package/dist/components/Tabs/tabs.stories.js +19 -19
  78. package/dist/components/Tags/tags.js +33 -65
  79. package/dist/components/Tags/tags.stories.js +18 -18
  80. package/dist/components/breakpoints.js +3 -3
  81. package/dist/components/chatHeader.js +17 -11
  82. package/dist/components/checkbox.js +27 -26
  83. package/dist/components/colors.js +32 -30
  84. package/dist/components/contacts.js +39 -25
  85. package/dist/components/dropdown.js +29 -35
  86. package/dist/components/dropdownButton.js +50 -53
  87. package/dist/components/dropdownItems.js +26 -19
  88. package/dist/components/examples/App.js +137 -0
  89. package/dist/components/examples/InfoAccordion.js +23 -0
  90. package/dist/components/examples/chatBodyExample.js +68 -0
  91. package/dist/components/examples/selectExample.js +63 -0
  92. package/dist/components/globalStyles.js +1 -5
  93. package/dist/components/iconStyles.js +56 -58
  94. package/dist/components/index.js +35 -23
  95. package/dist/components/input.js +33 -36
  96. package/dist/components/logo.js +9 -16
  97. package/dist/components/navbar.js +24 -13
  98. package/dist/components/search.js +20 -21
  99. package/dist/components/text.js +15 -6
  100. package/dist/components/typography.js +14 -14
  101. package/dist/components/wrapper.js +8 -8
  102. package/package.json +54 -30
  103. package/src/App.js +31 -175
  104. package/src/index.js +6 -8
  105. package/src/lib/assets/fb.png +0 -0
  106. package/src/lib/assets/insta.png +0 -0
  107. package/src/lib/assets/wa.png +0 -0
  108. package/src/lib/components/Accordion/Accordion.js +32 -14
  109. package/src/lib/components/Accordion/Accordion.stories.js +31 -31
  110. package/src/lib/components/Avatars/avatars.js +33 -28
  111. package/src/lib/components/Avatars/avatars.stories.js +18 -18
  112. package/src/lib/components/BannerCard/bannerCard.stories.js +16 -17
  113. package/src/lib/components/BannerCard/bannerCards.js +18 -18
  114. package/src/lib/components/Buttons/Stories/basicbutton.stories.js +29 -29
  115. package/src/lib/components/Buttons/Stories/buttonAlertIcons.stories.js +17 -17
  116. package/src/lib/components/Buttons/Stories/buttonIconsOnly.stories.js +24 -24
  117. package/src/lib/components/Buttons/buttonAlertIcons.js +22 -25
  118. package/src/lib/components/Buttons/buttonIconsOnly.js +32 -28
  119. package/src/lib/components/Buttons/buttons.js +70 -73
  120. package/src/lib/components/Cards/cards.js +2 -3
  121. package/src/lib/components/Cards/cards.stories.js +10 -10
  122. package/src/lib/components/ChatComponents/ChatBody/chatBody.js +46 -45
  123. package/src/lib/components/ChatComponents/ChatBody/chatBody.stories.js +34 -28
  124. package/src/lib/components/ChatComponents/ChatBody/sessionDetails.js +2 -2
  125. package/src/lib/components/ChatComponents/ChatHeader/chatHeader.js +2 -2
  126. package/src/lib/components/ChatComponents/ChatHeader/chatHeader.stories.js +4 -4
  127. package/src/lib/components/ChatComponents/ColorPicker/colorPicker.js +2 -2
  128. package/src/lib/components/ChatComponents/ColorPicker/colorPicker.stories.js +4 -3
  129. package/src/lib/components/ChatComponents/ContactCards/contactCards.js +7 -5
  130. package/src/lib/components/ChatComponents/ContactCards/contactCards.stories.js +6 -6
  131. package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.js +3 -3
  132. package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.stories.js +4 -3
  133. package/src/lib/components/ChatComponents/InfoTab/infoTab.js +2 -2
  134. package/src/lib/components/ChatComponents/InfoTab/infoTab.stories.js +7 -7
  135. package/src/lib/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +5 -3
  136. package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.js +2 -2
  137. package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +6 -5
  138. package/src/lib/components/Checkbox/checkboxToggler.js +89 -0
  139. package/src/lib/components/Checkbox/checkboxToggler.stories.js +48 -0
  140. package/src/lib/components/Lists/listBox.js +7 -7
  141. package/src/lib/components/Lists/listBox.stories.js +8 -11
  142. package/src/lib/components/Lists/listHeader.stories.js +13 -13
  143. package/src/lib/components/Lists/listheader.js +7 -7
  144. package/src/lib/components/Lists/rowLabels.js +6 -6
  145. package/src/lib/components/Lists/rowLabels.stories.js +18 -18
  146. package/src/lib/components/Loader/loader.js +13 -13
  147. package/src/lib/components/Loader/loader.stories.js +14 -14
  148. package/src/lib/components/MainWrapper/index.js +2 -2
  149. package/src/lib/components/MessageCounter/MessageCounter.stories.js +14 -14
  150. package/src/lib/components/MessageCounter/messageCounter.js +16 -16
  151. package/src/lib/components/Modals/modal.js +33 -23
  152. package/src/lib/components/Modals/modals.stories.js +34 -9
  153. package/src/lib/components/NoteBar/noteBar.js +20 -20
  154. package/src/lib/components/NoteBar/noteBar.stories.js +18 -17
  155. package/src/lib/components/PerformanceIndicator/performaceIndicator.stories.js +15 -15
  156. package/src/lib/components/PerformanceIndicator/performanceIndicator.js +11 -10
  157. package/src/lib/components/Pills/pills.js +16 -16
  158. package/src/lib/components/Pills/pills.stories.js +22 -23
  159. package/src/lib/components/ProfileIcon/ProfileIcon.js +76 -0
  160. package/src/lib/components/ProfileIcon/profileIcon.stories.js +57 -0
  161. package/src/lib/components/ProgressBar/progressbar.js +4 -5
  162. package/src/lib/components/ProgressBar/progressbar.stories.js +8 -9
  163. package/src/lib/components/ProgressRing/progressRing.js +25 -24
  164. package/src/lib/components/ProgressRing/progressRing.stories.js +18 -18
  165. package/src/lib/components/RouteLink/link.js +10 -8
  166. package/src/lib/components/RouteLink/link.stories.js +4 -4
  167. package/src/lib/components/ScrollBar/scrollBar.js +15 -14
  168. package/src/lib/components/SuperFluid/Content/index.js +2 -2
  169. package/src/lib/components/SuperFluid/ContentTitle.js/index.js +2 -2
  170. package/src/lib/components/SuperFluid/SegmentCard/index.js +9 -8
  171. package/src/lib/components/Tabs/tabs.js +11 -11
  172. package/src/lib/components/Tabs/tabs.stories.js +20 -20
  173. package/src/lib/components/Tags/tags.js +26 -24
  174. package/src/lib/components/Tags/tags.stories.js +19 -19
  175. package/src/lib/components/breakpoints.js +3 -3
  176. package/src/lib/components/checkbox.js +7 -6
  177. package/src/lib/components/colors.js +30 -28
  178. package/src/lib/components/dropdownButton.js +36 -39
  179. package/src/lib/components/examples/App.js +181 -0
  180. package/src/{InfoAccordion.js → lib/components/examples/InfoAccordion.js} +1 -1
  181. package/src/{App1.js → lib/components/examples/chatBodyExample.js} +2 -2
  182. package/src/{App copy.js → lib/components/examples/selectExample.js} +0 -0
  183. package/src/lib/components/globalStyles.js +4 -5
  184. package/src/lib/components/iconStyles.js +45 -48
  185. package/src/lib/components/index.js +48 -45
  186. package/src/lib/components/input.js +20 -20
  187. package/src/lib/components/text.js +17 -3
  188. package/src/lib/components/typography.js +14 -14
  189. package/src/reportWebVitals.js +1 -1
  190. package/babel.config.js +0 -12
  191. package/dist/components/checkboxToggler.js +0 -50
  192. package/dist/components/example.js +0 -47
  193. package/dist/components/sidebar.js +0 -32
  194. package/dist/components/tabs.js +0 -106
  195. package/dist/components/tags.js +0 -100
  196. package/dist/images/azam.png +0 -0
  197. package/dist/images/azam1.png +0 -0
  198. package/src/ChatHeader.js +0 -22
  199. package/src/CustomerInfo.js +0 -46
  200. package/src/MainChat.js +0 -41
  201. package/src/SideBar.js +0 -81
  202. package/src/lib/components/checkboxToggler.js +0 -19
  203. package/src/lib/components/example.js +0 -30
  204. package/src/lib/components/sidebar.js +0 -33
  205. package/src/lib/components/tabs.js +0 -123
  206. package/src/lib/components/tags.js +0 -101
  207. package/src/lib/images/azam.png +0 -0
  208. package/src/lib/images/azam1.png +0 -0
  209. package/src/list.scss +0 -4
@@ -1,9 +1,13 @@
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";
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
 
@@ -28,7 +32,7 @@ export const ModalContent = styled.div`
28
32
  max-width: 100%;
29
33
 
30
34
  > *:not(:last-child) {
31
- margin-bottom: 1rem;
35
+ margin-bottom: 0.5rem;
32
36
  }
33
37
  @media (min-width: 576px) {
34
38
  max-width: 500px;
@@ -51,14 +55,7 @@ export const ModalWrapper = styled.div`
51
55
  overflow-y: auto;
52
56
  `;
53
57
 
54
- export const BmModal = ({
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 === "Escape" && show && onHide !== undefined) {
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("keydown", keyPress);
78
- return () => document.removeEventListener("keydown", keyPress);
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 }) => {
@@ -109,8 +106,9 @@ BmModal.Header = ({ children, size, onHide, closeButton, show, ...rest }) => {
109
106
  {(value) => (
110
107
  <>
111
108
  <ModalHeader {...rest}>
109
+ <p>&nbsp;</p>
112
110
  {children}
113
- {closeButton && (
111
+ {closeButton ? (
114
112
  <BmIcons
115
113
  size="xlarge"
116
114
  icon={<Clear />}
@@ -119,6 +117,8 @@ BmModal.Header = ({ children, size, onHide, closeButton, show, ...rest }) => {
119
117
  }
120
118
  {...rest}
121
119
  />
120
+ ) : (
121
+ <p>&nbsp;</p>
122
122
  )}
123
123
  </ModalHeader>
124
124
  </>
@@ -127,6 +127,13 @@ BmModal.Header = ({ children, size, onHide, closeButton, show, ...rest }) => {
127
127
  );
128
128
  };
129
129
 
130
+ BmModal.SubHeader = styled.div`
131
+ display: flex;
132
+ flex-direction: row;
133
+ justify-content: center;
134
+ align-items: center;
135
+ `;
136
+
130
137
  BmModal.Body = styled.div`
131
138
  display: flex;
132
139
  flex-direction: column;
@@ -134,7 +141,8 @@ BmModal.Body = styled.div`
134
141
  > *:not(:last-child) {
135
142
  margin-bottom: 0.5rem;
136
143
  }
137
- ${'' /* max-height: ${({ size }) => {
144
+ ${
145
+ '' /* max-height: ${({ size }) => {
138
146
  if (size) {
139
147
  if (size === "small") return "21.429rem";
140
148
  if (size === "default") return "35.714rem";
@@ -144,7 +152,8 @@ BmModal.Body = styled.div`
144
152
  }
145
153
  return "35.714rem";
146
154
  }};
147
- overflow: auto; */}
155
+ overflow: auto; */
156
+ }
148
157
  `;
149
158
 
150
159
  BmModal.Footer = styled.div`
@@ -159,4 +168,5 @@ BmModal.propTypes = {
159
168
  onHide: PropTypes.func.isRequired,
160
169
  closeButton: PropTypes.bool,
161
170
  };
171
+
162
172
  export default BmModal;
@@ -1,12 +1,12 @@
1
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";
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: "components/Modals",
9
- argType: {
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
- "Placed on BmModal.Header component. Displays the close button (X)",
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: "boolean" },
25
- description: "Handling the opening and closing of the modal",
24
+ control: { type: 'boolean' },
25
+ description: 'Handling the opening and closing of the modal',
26
26
  },
27
27
  onHide: {
28
- description: "Handling the closing of the modal",
28
+ description: 'Handling the closing of the modal',
29
29
  },
30
30
  },
31
31
  };
@@ -51,6 +51,31 @@ export const SampleModal = () => {
51
51
  </>
52
52
  );
53
53
  };
54
+
55
+ export const ModalWithSubHeader = () => {
56
+ const [showModal, setShowModal] = useState(false);
57
+ return (
58
+ <>
59
+ <div>
60
+ <BmButton onClick={() => setShowModal(!showModal)}>Click Me!</BmButton>
61
+ </div>
62
+ <BmModal show={showModal} onHide={() => setShowModal(false)}>
63
+ <BmModal.Header closeButton>
64
+ <h2>Header</h2>
65
+ </BmModal.Header>
66
+ <BmModal.SubHeader>
67
+ <h5>This modal has a sub heading</h5>
68
+ </BmModal.SubHeader>
69
+ <BmModal.Body>
70
+ <p>This is a body</p>
71
+ </BmModal.Body>
72
+ <BmModal.Footer>
73
+ <p>This is a footer</p>
74
+ </BmModal.Footer>
75
+ </BmModal>
76
+ </>
77
+ );
78
+ };
54
79
  export const ExampleModal = () => {
55
80
  const [showModal, setShowModal] = useState(false);
56
81
  return (
@@ -1,22 +1,22 @@
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";
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 "../colors";
12
- import { BmIcons } from "../iconStyles";
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 "flex";
17
+ return 'flex';
18
18
  }
19
- return isOpen ? "flex" : "none";
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 === "info" && (
42
+ {type === 'info' && (
43
43
  <BmIcons
44
44
  icon={<Info />}
45
- color={color ? color : `${BmPrimaryBlue}`}
46
- size={size ? size : "large"}
45
+ color={color || `${BmPrimaryBlue}`}
46
+ size={size || 'large'}
47
47
  />
48
48
  )}
49
- {type === "error" && (
49
+ {type === 'error' && (
50
50
  <BmIcons
51
51
  icon={<Error />}
52
- color={color ? color : `${BmSecondaryRed}`}
53
- size={size ? size : "large"}
52
+ color={color || `${BmSecondaryRed}`}
53
+ size={size || 'large'}
54
54
  />
55
55
  )}
56
- {type === "warning" && (
56
+ {type === 'warning' && (
57
57
  <BmIcons
58
58
  icon={<Warning />}
59
- color={color ? color : `${BmPrimaryGold}`}
60
- size={size ? size : "large"}
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 ? color : `${BmSecondaryGrey}`}
68
- size={size ? size : "small"}
69
- style={{ marginLeft: "auto" }}
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 "react";
3
- import { BmNoteBar } from "./noteBar";
2
+ import React from 'react';
3
+ import { BmNoteBar } from './noteBar';
4
4
 
5
5
  export default {
6
6
  component: BmNoteBar,
7
- title: "components/NoteBar",
7
+ title: 'components/NoteBar',
8
8
  argTypes: {
9
9
  size: {
10
- options: ["small", "medium", "large"],
11
- control: { type: "select" },
12
- description: "Size of the icons",
13
- defaultValue: { summary: "large" },
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: "Note Description ",
16
+ description: 'Note Description ',
17
17
  defaultValue: { summary: undefined },
18
18
  },
19
19
  type: {
20
- options: ["info", "warning", "error"],
21
- control: { type: "select" },
22
- description: "Type of note",
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: "Color of the icon ",
26
+ description: 'Color of the icon ',
27
27
  defaultValue: { summary: undefined },
28
28
  },
29
29
  closeButton: {
30
- description: "If present will allow to close the notebar, default size of the icon is small",
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: "warning",
40
- size: "large",
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: "warning",
48
- size: "large",
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 "react";
3
- import { BmPerformanceIndicator } from "./performanceIndicator";
2
+ import React from 'react';
3
+ import { BmPerformanceIndicator } from './performanceIndicator';
4
4
 
5
5
  export default {
6
6
  component: BmPerformanceIndicator,
7
- title: "components/PerformanceIndicator",
7
+ title: 'components/PerformanceIndicator',
8
8
  argTypes: {
9
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" },
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: ["upwards", "downwards"],
17
- control: { type: "select" },
18
- description: "Type of Indicator",
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: "Performance Indicator Value (h2)",
22
+ description: 'Performance Indicator Value (h2)',
23
23
  defaultValue: { summary: undefined },
24
24
  },
25
25
  color: {
26
- description: "Color of Performance Indicator",
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: "upwards",
37
- size: "xlarge",
38
- children: "100%",
36
+ type: 'upwards',
37
+ size: 'xlarge',
38
+ children: '100%',
39
39
  color: undefined,
40
40
  };
@@ -1,9 +1,10 @@
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";
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 === "upwards" && (
33
+ {type === 'upwards' && (
33
34
  <BmIcons
34
35
  icon={<ArrowCircleUpIcon />}
35
- size={size || "xlarge"}
36
+ size={size || 'xlarge'}
36
37
  color={color || `${BmGrey400}`}
37
38
  />
38
39
  )}
39
- {type === "downwards" && (
40
+ {type === 'downwards' && (
40
41
  <BmIcons
41
42
  icon={<ArrowCircleDownIcon />}
42
- size={size || "xlarge"}
43
+ size={size || 'xlarge'}
43
44
  color={color || `${BmGrey400}`}
44
45
  />
45
46
  )}
@@ -1,19 +1,19 @@
1
- import React, { useState } from "react";
2
- import Proptypes from "prop-types";
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 "@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";
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 "flex";
14
+ return 'flex';
15
15
  }
16
- return "none";
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 || "xsmall"} icon={icon} color={color} />}
59
+ {icon && <BmIcons size={size || 'xsmall'} icon={icon} color={color} />}
60
60
  {avatarIcon && (
61
61
  <BmAvatar
62
62
  user={avatarIcon}
63
- size={avatarSize || "xsmall"}
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: "0rem 0rem 0rem 1rem" }}
72
- size={size || "xsmall"}
73
- icon={deleteIcon ? deleteIcon : <Clear />}
74
- color={color || "black"}
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>
@@ -1,47 +1,46 @@
1
1
  /* eslint-disable import/no-anonymous-default-export */
2
- import { Delete, Favorite, Person } from "@material-ui/icons";
3
- import React from "react";
4
- import { BmPrimaryBlue } from "../colors";
5
- import { BmPill } from "./pills";
2
+ import { Delete, Favorite, Person } from '@material-ui/icons';
3
+ import React from 'react';
4
+ import { BmPill } from './pills';
6
5
 
7
6
  export default {
8
7
  component: BmPill,
9
- title: "components/Pills",
8
+ title: 'components/Pills',
10
9
  argTypes: {
11
10
  icon: {
12
- description: "Material-UI icon(optional)",
11
+ description: 'Material-UI icon(optional)',
13
12
  defaultValue: { summary: undefined },
14
13
  },
15
14
  avatarIcon: {
16
- description: "Material-UI icon(optional)",
15
+ description: 'Material-UI icon(optional)',
17
16
  defaultValue: { summary: undefined },
18
17
  },
19
18
  size: {
20
- options: ["xsmall", "small", "medium", "large", "xlarge"],
21
- control: { type: "select" },
22
- description: "Size of the Icon (Can also be predefined e.g. 10px)",
23
- defaultValue: { summary: "xsmall" },
19
+ options: ['xsmall', 'small', 'medium', 'large', 'xlarge'],
20
+ control: { type: 'select' },
21
+ description: 'Size of the Icon (Can also be predefined e.g. 10px)',
22
+ defaultValue: { summary: 'xsmall' },
24
23
  },
25
24
  avatarSize: {
26
- options: ["xsmall", "small", "medium", "large", "xlarge"],
27
- control: { type: "select" },
28
- description: "Size of the AvatarIcon (Can also be predefined e.g. 10px)",
29
- defaultValue: { summary: "xsmall" },
25
+ options: ['xsmall', 'small', 'medium', 'large', 'xlarge'],
26
+ control: { type: 'select' },
27
+ description: 'Size of the AvatarIcon (Can also be predefined e.g. 10px)',
28
+ defaultValue: { summary: 'xsmall' },
30
29
  },
31
30
  label: {
32
- description: "Pill label in uppercase",
33
- defaultValue: { summary: "undefined" },
31
+ description: 'Pill label in uppercase',
32
+ defaultValue: { summary: 'undefined' },
34
33
  },
35
34
  color: {
36
- description: "Color of Pill ",
37
- defaultValue: { summary: "black" },
35
+ description: 'Color of Pill ',
36
+ defaultValue: { summary: 'black' },
38
37
  },
39
38
  onDelete: {
40
- description: "Handles Deleting Pill",
39
+ description: 'Handles Deleting Pill',
41
40
  defaultValue: { summary: undefined },
42
41
  },
43
42
  deleteIcon: {
44
- description: "Material-UI icon (Used only when OnDelete is present)",
43
+ description: 'Material-UI icon (Used only when OnDelete is present)',
45
44
  defaultValue: { summary: undefined },
46
45
  },
47
46
  },
@@ -52,7 +51,7 @@ const MainPill = (args) => <BmPill {...args} />;
52
51
  export const BasicPill = MainPill.bind({});
53
52
  BasicPill.args = {
54
53
  icon: <Favorite />,
55
- label: "label",
54
+ label: 'label',
56
55
  color: undefined,
57
56
  onDelete: undefined,
58
57
  deleteIcon: undefined,
@@ -64,7 +63,7 @@ BasicPill.args = {
64
63
  export const CustomPill = MainPill.bind({});
65
64
  CustomPill.args = {
66
65
  icon: undefined,
67
- label: "label",
66
+ label: 'label',
68
67
  color: undefined,
69
68
  onDelete: true,
70
69
  deleteIcon: <Delete />,
@@ -0,0 +1,76 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { BmSecondaryBlue12, BmBgLightBlue } from '../colors';
4
+ import wa from '../../assets/wa.png';
5
+ import fb from '../../assets/fb.png';
6
+ import insta from '../../assets/insta.png';
7
+
8
+ const handleSize = (size) => {
9
+ if (size) {
10
+ if (size === 'large') return '3.429rem';
11
+ if (size === 'medium') return '2.286rem';
12
+ if (size === 'small') return '1.714rem';
13
+ if (size === 'xsmall') return '1.429rem';
14
+ }
15
+ return '3.429rem';
16
+ };
17
+
18
+ const position = (size) => {
19
+ if (size) {
20
+ if (size === 'large') return '2.286rem';
21
+ if (size === 'medium') return '1.5rem';
22
+ if (size === 'small') return '1rem';
23
+ if (size === 'xsmall') return '0.714rem';
24
+ }
25
+ return '2.286rem';
26
+ };
27
+
28
+ const ProfileImg = styled.img`
29
+ height: ${(props) => handleSize(props.size)};
30
+ width: ${(props) => handleSize(props.size)};
31
+ object-fit: contain;
32
+ border-radius: 50%;
33
+ display: flex;
34
+ `;
35
+
36
+ const Profile = styled.div`
37
+ height: ${(props) => handleSize(props.size)};
38
+ width: ${(props) => handleSize(props.size)};
39
+ border-radius: 50%;
40
+ border: 1px solid ${BmBgLightBlue};
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ position: relative;
45
+ background: ${BmSecondaryBlue12};
46
+ `;
47
+
48
+ const Content = styled.div`
49
+ display: flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ position: absolute;
53
+ `;
54
+
55
+ const Dot = styled.img`
56
+ position: absolute;
57
+ left: ${(props) => position(props.size)};
58
+ bottom: 0rem;
59
+ object-fit: contain;
60
+ height: 1rem;
61
+ width: 1rem;
62
+ `;
63
+
64
+ export const BmProfileIcon = ({ img, content, channel, size, ...rest }) => {
65
+ return (
66
+ <>
67
+ <Profile size={size} {...rest}>
68
+ {content && !img && <Content>{content}</Content>}
69
+ {img && !content && <ProfileImg src={img} />}
70
+ {channel && channel === 'whatsapp' && <Dot size={size} src={wa} />}
71
+ {channel && channel === 'facebook' && <Dot size={size} src={fb} />}
72
+ {channel && channel === 'instagram' && <Dot size={size} src={insta} />}
73
+ </Profile>
74
+ </>
75
+ );
76
+ };