beem-component 1.1.4 → 1.1.8

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 (47) hide show
  1. package/.storybook/preview.js +2 -1
  2. package/dist/assets/css/{sidebar.css → sidebar.scss} +0 -0
  3. package/dist/components/ChatComponents/ChatBody/chatBody.js +265 -0
  4. package/dist/components/{ChatBody → ChatComponents/ChatBody}/chatBody.stories.js +42 -11
  5. package/dist/components/{ChatHeader → ChatComponents/ChatHeader}/chatHeader.js +0 -0
  6. package/dist/components/{ChatHeader → ChatComponents/ChatHeader}/chatHeader.stories.js +8 -4
  7. package/dist/components/ChatComponents/ColorPicker/colorPicker.js +20 -0
  8. package/dist/components/ChatComponents/ColorPicker/colorPicker.stories.js +26 -0
  9. package/dist/components/{ContactCards → ChatComponents/ContactCards}/contactCards.js +1 -1
  10. package/dist/components/{ContactCards → ChatComponents/ContactCards}/contactCards.stories.js +4 -4
  11. package/dist/components/ChatComponents/FormAccordion/FormAccordion.js +22 -0
  12. package/dist/components/ChatComponents/FormAccordion/FormAccordion.stories.js +29 -0
  13. package/dist/components/{InfoTab → ChatComponents/InfoTab}/infoTab.js +0 -1
  14. package/dist/components/{InfoTab → ChatComponents/InfoTab}/infoTab.stories.js +3 -5
  15. package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.js +19 -0
  16. package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +31 -0
  17. package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.js +23 -0
  18. package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +43 -0
  19. package/dist/components/Modals/modal.js +1 -1
  20. package/dist/components/index.js +36 -4
  21. package/package.json +2 -1
  22. package/src/App.js +3 -5
  23. package/src/Chat.js +10 -6
  24. package/src/ChatHeader.js +1 -1
  25. package/src/InfoAccordion.js +24 -0
  26. package/src/lib/assets/css/{sidebar.css → sidebar.scss} +0 -0
  27. package/src/lib/components/ChatComponents/ChatBody/chatBody.js +279 -0
  28. package/src/lib/components/ChatComponents/ChatBody/chatBody.stories.js +81 -0
  29. package/src/lib/components/{ChatHeader → ChatComponents/ChatHeader}/chatHeader.js +0 -0
  30. package/src/lib/components/{ChatHeader → ChatComponents/ChatHeader}/chatHeader.stories.js +6 -3
  31. package/src/lib/components/ChatComponents/ColorPicker/colorPicker.js +11 -0
  32. package/src/lib/components/ChatComponents/ColorPicker/colorPicker.stories.js +17 -0
  33. package/src/lib/components/{ContactCards → ChatComponents/ContactCards}/contactCards.js +1 -1
  34. package/src/lib/components/{ContactCards → ChatComponents/ContactCards}/contactCards.stories.js +4 -4
  35. package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.js +44 -0
  36. package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.stories.js +37 -0
  37. package/src/lib/components/{InfoTab → ChatComponents/InfoTab}/infoTab.js +0 -1
  38. package/src/lib/components/{InfoTab → ChatComponents/InfoTab}/infoTab.stories.js +3 -4
  39. package/src/lib/components/ChatComponents/LabelAccordion/LabelAccordion.js +18 -0
  40. package/src/lib/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +38 -0
  41. package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.js +46 -0
  42. package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +47 -0
  43. package/src/lib/components/Modals/modal.js +9 -0
  44. package/src/lib/components/index.js +14 -4
  45. package/dist/components/ChatBody/chatBody.js +0 -144
  46. package/src/lib/components/ChatBody/chatBody.js +0 -148
  47. package/src/lib/components/ChatBody/chatBody.stories.js +0 -48
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.NoteAccordion = void 0;
7
+
8
+ var _ = require("../..");
9
+
10
+ var _ContentCopy = _interopRequireDefault(require("@mui/icons-material/ContentCopy"));
11
+
12
+ var _icons = require("@material-ui/icons");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ // eslint-disable-next-line import/no-anonymous-default-export
17
+ var _default = {
18
+ component: _.BmChatLabels,
19
+ title: "components/Chat/Components/NoteAccordion"
20
+ };
21
+ exports.default = _default;
22
+
23
+ var NoteAccordion = function NoteAccordion() {
24
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
25
+ style: {
26
+ width: "30%"
27
+ }
28
+ }, /*#__PURE__*/React.createElement(_.BmAccordion, null, /*#__PURE__*/React.createElement(_.BmAccordion.Title, null, /*#__PURE__*/React.createElement("h3", null, "Notes")), /*#__PURE__*/React.createElement(_.BmAccordion.Body, null, /*#__PURE__*/React.createElement(_.BmChatNotes, null, /*#__PURE__*/React.createElement(_.BmChatNotes.Input, {
29
+ type: "text",
30
+ placeholder: "Add Note"
31
+ }), /*#__PURE__*/React.createElement(_.BmChatNotes.Details, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, "Description")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_.BmIcons, {
32
+ icon: /*#__PURE__*/React.createElement(_icons.Edit, null),
33
+ size: "xsmall"
34
+ }), /*#__PURE__*/React.createElement(_.BmIcons, {
35
+ icon: /*#__PURE__*/React.createElement(_ContentCopy.default, null),
36
+ size: "xsmall"
37
+ }), /*#__PURE__*/React.createElement(_.BmIcons, {
38
+ icon: /*#__PURE__*/React.createElement(_icons.Delete, null),
39
+ size: "xsmall"
40
+ })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("i", null, "By User")), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("i", null, "12:00pm")))))))));
41
+ };
42
+
43
+ exports.NoteAccordion = NoteAccordion;
@@ -153,7 +153,7 @@ BmModal.Header = function (_ref4) {
153
153
  });
154
154
  };
155
155
 
156
- BmModal.Body = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n"])));
156
+ BmModal.Body = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n > *:not(:last-child) {\n margin-bottom: 0.5rem;\n }\n > * {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n }\n"])));
157
157
  BmModal.Footer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n"])));
158
158
  BmModal.propTypes = {
159
159
  size: _propTypes.default.string,
@@ -59,12 +59,30 @@ Object.defineProperty(exports, "BmChat", {
59
59
  return _chatBody.default;
60
60
  }
61
61
  });
62
+ Object.defineProperty(exports, "BmChatForm", {
63
+ enumerable: true,
64
+ get: function get() {
65
+ return _FormAccordion.default;
66
+ }
67
+ });
62
68
  Object.defineProperty(exports, "BmChatHeader", {
63
69
  enumerable: true,
64
70
  get: function get() {
65
71
  return _chatHeader.BmChatHeader;
66
72
  }
67
73
  });
74
+ Object.defineProperty(exports, "BmChatLabels", {
75
+ enumerable: true,
76
+ get: function get() {
77
+ return _LabelAccordion.default;
78
+ }
79
+ });
80
+ Object.defineProperty(exports, "BmChatNotes", {
81
+ enumerable: true,
82
+ get: function get() {
83
+ return _NoteAccordion.default;
84
+ }
85
+ });
68
86
  Object.defineProperty(exports, "BmChatbotIcon", {
69
87
  enumerable: true,
70
88
  get: function get() {
@@ -77,6 +95,12 @@ Object.defineProperty(exports, "BmCheckbox", {
77
95
  return _checkbox.BmCheckbox;
78
96
  }
79
97
  });
98
+ Object.defineProperty(exports, "BmColorPicker", {
99
+ enumerable: true,
100
+ get: function get() {
101
+ return _colorPicker.BmColorPicker;
102
+ }
103
+ });
80
104
  exports.BmColors = void 0;
81
105
  Object.defineProperty(exports, "BmContactCard", {
82
106
  enumerable: true,
@@ -331,16 +355,24 @@ var _noteBar = require("./NoteBar/noteBar");
331
355
 
332
356
  var _MainWrapper = require("../components/MainWrapper");
333
357
 
334
- var _chatBody = _interopRequireDefault(require("../components/ChatBody/chatBody"));
358
+ var _chatBody = _interopRequireDefault(require("./ChatComponents/ChatBody/chatBody"));
335
359
 
336
- var _chatHeader = require("./ChatHeader/chatHeader");
360
+ var _chatHeader = require("./ChatComponents/ChatHeader/chatHeader");
337
361
 
338
- var _contactCards = _interopRequireDefault(require("./ContactCards/contactCards"));
362
+ var _contactCards = _interopRequireDefault(require("./ChatComponents/ContactCards/contactCards"));
339
363
 
340
- var _infoTab = _interopRequireDefault(require("./InfoTab/infoTab"));
364
+ var _infoTab = _interopRequireDefault(require("./ChatComponents/InfoTab/infoTab"));
341
365
 
342
366
  var _messageCounter = _interopRequireDefault(require("./MessageCounter/messageCounter"));
343
367
 
368
+ var _FormAccordion = _interopRequireDefault(require("./ChatComponents/FormAccordion/FormAccordion"));
369
+
370
+ var _LabelAccordion = _interopRequireDefault(require("./ChatComponents/LabelAccordion/LabelAccordion"));
371
+
372
+ var _NoteAccordion = _interopRequireDefault(require("./ChatComponents/NoteAccordion/NoteAccordion"));
373
+
374
+ var _colorPicker = require("./ChatComponents/ColorPicker/colorPicker");
375
+
344
376
  var _index = require("./SuperFluid/Content/index");
345
377
 
346
378
  var _index2 = require("./SuperFluid/ContentTitle.js/index.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beem-component",
3
- "version": "1.1.4",
3
+ "version": "1.1.8",
4
4
  "private": false,
5
5
  "main": "dist/components/index.js",
6
6
  "scripts": {
@@ -26,6 +26,7 @@
26
26
  "@material-ui/icons": "^4.11.2",
27
27
  "@mui/icons-material": "^5.2.1",
28
28
  "@mui/material": "^5.2.3",
29
+ "js-file-download": "^0.4.12",
29
30
  "node-sass": "^6.0.1",
30
31
  "polished": "^4.1.3",
31
32
  "react": "^17.0.2",
package/src/App.js CHANGED
@@ -2,21 +2,18 @@ import React from "react";
2
2
  import "../src/main.scss";
3
3
  import { MainWrapper } from "./lib/components";
4
4
  import { GlobalStyle } from "./lib/components/globalStyles";
5
- import "./lib/assets/css/sidebar.css";
5
+ import "./lib/assets/css/sidebar.scss";
6
6
  import SideBar from "./SideBar";
7
7
  import ChatHeader from "./ChatHeader";
8
8
  import Chat from "./Chat";
9
9
  import CustomerInfo from "./CustomerInfo";
10
- import { BmTag } from "./lib/components/Tags/tags";
11
- import { Home } from "@material-ui/icons";
10
+ import InfoAccordion from "./InfoAccordion";
12
11
 
13
12
  export const App = () => {
14
13
  return (
15
14
  <>
16
15
  <GlobalStyle />
17
16
  <MainWrapper>
18
- <BmTag leadingIcon={<Home/>} trailingIcon={<Home/>}><p>Hello</p></BmTag>
19
-
20
17
  <div className="main-chat-container">
21
18
  <div className="sidebar">
22
19
  <SideBar />
@@ -29,6 +26,7 @@ export const App = () => {
29
26
  </div>
30
27
  <div className="chat-contact-info">
31
28
  <CustomerInfo />
29
+ <InfoAccordion />
32
30
  </div>
33
31
  </div>
34
32
  </div>
package/src/Chat.js CHANGED
@@ -4,8 +4,9 @@ import EmojiEmotionsIcon from "@material-ui/icons/EmojiEmotions";
4
4
  import QuickreplyIcon from "@mui/icons-material/Quickreply";
5
5
  import SendIcon from "@mui/icons-material/Send";
6
6
  import { BmChat, BmIcons, BmInput } from "./lib/components";
7
- import "../src/lib/assets/css/sidebar.css";
8
- import { BmMessage, BmMessageTabInput } from "./lib/components/Chats/chatInput";
7
+ import "../src/lib/assets/css/sidebar.scss";
8
+ import image from "../src/lib/assets/chart-img.png";
9
+ import azam from '../src/lib/images/azam1.png';
9
10
 
10
11
  const Chat = () => {
11
12
  return (
@@ -16,16 +17,19 @@ const Chat = () => {
16
17
  session="bot"
17
18
  displayTime={<p>12:00pm</p>}
18
19
  status="sent"
19
- >
20
- <p>Inbound</p>
21
- </BmChat.Details>
20
+ src={image}
21
+ fileName={<p>attachment.jpg</p>}
22
+ />
23
+
22
24
  <BmChat.Details
23
25
  state="outbound"
24
26
  session="live"
25
27
  displayTime={<p>10:00am</p>}
26
28
  status="failed"
29
+ src={azam}
30
+ file={<p>fildjfdlkfjlkfdjfldjfldsjfldsje.jpg</p>}
27
31
  >
28
- <p>Outbound</p>
32
+ <p>Hekkoi</p>
29
33
  </BmChat.Details>
30
34
  <BmChat.Details
31
35
  state="outbound"
package/src/ChatHeader.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { BmChatHeader, BmButton } from "../src/lib/components/";
3
- import "../src/lib/assets/css/sidebar.css";
3
+ import "../src/lib/assets/css/sidebar.scss";
4
4
 
5
5
  export const ChatHeader = () => {
6
6
  return (
@@ -0,0 +1,24 @@
1
+ /* eslint-disable react/prop-types */
2
+ import React from "react";
3
+ import { BmAccordion } from "./lib/components";
4
+ import BmForm from "./lib/components/ChatComponents/FormAccordion/FormAccordion";
5
+
6
+ const InfoAccordion = () => {
7
+ return (
8
+ <>
9
+ <BmAccordion>
10
+ <BmAccordion.Title>
11
+ <h3>Notes</h3>
12
+ </BmAccordion.Title>
13
+ <BmAccordion.Body>
14
+ <BmForm>
15
+ <BmForm.Label><h4>Hello</h4></BmForm.Label>
16
+ <BmForm.Input placeholder="Hello" />
17
+ </BmForm>
18
+ </BmAccordion.Body>
19
+ </BmAccordion>
20
+ </>
21
+ );
22
+ };
23
+
24
+ export default InfoAccordion;
File without changes
@@ -0,0 +1,279 @@
1
+ import React from "react";
2
+ import { Done, DoneAll } from "@material-ui/icons";
3
+ import FilePresentIcon from "@mui/icons-material/FilePresent";
4
+ import DownloadIcon from "@mui/icons-material/Download";
5
+ import styled from "styled-components";
6
+ import BmAvatar from "../../Avatars/avatars";
7
+ import { BmIcons } from "../../iconStyles";
8
+
9
+ import {
10
+ BmPrimaryWhite,
11
+ BmPrimaryBlue,
12
+ BmPrimaryBlack,
13
+ BmSecondaryDarkGreen,
14
+ BmGrey200,
15
+ } from "../../colors";
16
+
17
+ const BmChat = styled.div`
18
+ display: flex;
19
+ flex-direction: column;
20
+ height: 100%;
21
+ ${"" /* border: 0.071rem solid ${BmGrey400}; */}
22
+ `;
23
+
24
+ BmChat.Body = styled.div`
25
+ display: flex;
26
+ flex-direction: column;
27
+ padding: 0rem 1.5rem;
28
+ flex-grow: 1;
29
+ overflow: auto;
30
+ `;
31
+
32
+ const Details = styled.div`
33
+ display: flex;
34
+ ${"" /* align-items: center; */}
35
+ justify-content: ${({ state }) => {
36
+ if (state === "inbound") {
37
+ return "flex-start";
38
+ }
39
+ if (state === "outbound") {
40
+ return "flex-end";
41
+ }
42
+ return "row";
43
+ }};
44
+ > *:not(:last-child) {
45
+ margin-right: 1rem;
46
+ margin-bottom: 0.5rem;
47
+ }
48
+ overflow-wrap: break-word !important;
49
+ word-wrap: break-word !important;
50
+ margin: 0rem;
51
+ flex-grow: 1;
52
+ `;
53
+
54
+ const MessageDetails = styled.div`
55
+ display: flex;
56
+ flex-direction: column;
57
+ max-width: 50%;
58
+ > * {
59
+ margin-top: 0.5rem;
60
+ }
61
+ `;
62
+
63
+ const Messages = styled.div`
64
+ display: flex;
65
+ flex-direction: row;
66
+ align-items: center;
67
+ padding: 1.143rem;
68
+ background: ${({ state }) => {
69
+ if (state) {
70
+ if (state === "inbound") return `${BmPrimaryWhite}`;
71
+ if (state === "outbound") return `${BmPrimaryBlue}`;
72
+ }
73
+ return `${BmPrimaryWhite}`;
74
+ }};
75
+ color: ${({ state }) => {
76
+ if (state) {
77
+ if (state === "inbound") return `${BmPrimaryBlack}`;
78
+ if (state === "outbound") return `${BmPrimaryWhite}`;
79
+ }
80
+ return `${BmPrimaryWhite}`;
81
+ }};
82
+ border-radius: ${({ state }) => {
83
+ if (state) {
84
+ if (state === "inbound") return "0.21875rem 0.21875rem 0.21875rem 0rem";
85
+ if (state === "outbound") return "0.21875rem 0.21875rem 0rem 0.21875rem";
86
+ }
87
+ return `${BmPrimaryWhite}`;
88
+ }};
89
+ border: 0.071rem solid ${BmGrey200};
90
+ word-break: break-all;
91
+ margin: 0rem;
92
+ `;
93
+
94
+ const MessagesSubDetails = styled.div`
95
+ display: flex;
96
+ flex-direction: row;
97
+ align-items: center;
98
+ > *:not(:last-child) {
99
+ margin-right: 0.5rem;
100
+ }
101
+ margin-top: 0.5rem;
102
+ `;
103
+
104
+ const handleState = ({ session }) => {
105
+ if (session === "bot") {
106
+ return <BmAvatar size="small" user="chatbot" />;
107
+ }
108
+ if (session === "live") {
109
+ return <BmAvatar size="small" user="employee" />;
110
+ }
111
+ };
112
+
113
+ // Start of File Attachment
114
+ const FileAttachmentWrapper = styled.div`
115
+ display: flex;
116
+ cursor: pointer;
117
+ flex-direction: row;
118
+ padding: 1rem;
119
+ background: ${({ state }) => {
120
+ if (state) {
121
+ if (state === "inbound") return `${BmPrimaryWhite}`;
122
+ if (state === "outbound") return `${BmPrimaryBlue}`;
123
+ }
124
+ return `${BmPrimaryWhite}`;
125
+ }};
126
+ color: ${({ state }) => {
127
+ if (state) {
128
+ if (state === "inbound") return `${BmPrimaryBlack}`;
129
+ if (state === "outbound") return `${BmPrimaryWhite}`;
130
+ }
131
+ return `${BmPrimaryWhite}`;
132
+ }};
133
+ border-radius: ${({ state }) => {
134
+ if (state) {
135
+ if (state === "inbound") return "0.21875rem 0.21875rem 0.21875rem 0rem";
136
+ if (state === "outbound") return "0.21875rem 0.21875rem 0rem 0.21875rem";
137
+ }
138
+ return `${BmPrimaryWhite}`;
139
+ }};
140
+ border: 0.071rem solid ${BmGrey200};
141
+ > * {
142
+ &:last-child {
143
+ margin-left: auto;
144
+ }
145
+ :not(:last-child) {
146
+ margin-right: 0.5rem;
147
+ }
148
+ }
149
+ &&& > * {
150
+ align-items: center;
151
+ color: ${({ state }) => {
152
+ if (state) {
153
+ if (state === "inbound") return `${BmPrimaryBlue}`;
154
+ if (state === "outbound") return `${BmPrimaryWhite}`;
155
+ }
156
+ return `${BmPrimaryWhite}`;
157
+ }};
158
+ }
159
+ ${"" /* max-width: 100%; */}
160
+ ${"" /* max-height: 100%; */}
161
+ `;
162
+
163
+ const BmFileAttachment = ({ state, file, src, fileName, ...rest }) => {
164
+ return (
165
+ <FileAttachmentWrapper state={state} {...rest}>
166
+ <BmIcons icon={<FilePresentIcon />} />
167
+ {fileName}
168
+ <BmIcons icon={<DownloadIcon />} />
169
+ </FileAttachmentWrapper>
170
+ );
171
+ };
172
+ //Start of Component for Images
173
+ export const BmImageWrapper = styled.div`
174
+ display: flex;
175
+ flex-direction: column;
176
+ color: ${({ state }) => {
177
+ if (state) {
178
+ if (state === "inbound") return `${BmPrimaryBlack}`;
179
+ if (state === "outbound") return `${BmPrimaryWhite}`;
180
+ }
181
+ return `${BmPrimaryWhite}`;
182
+ }};
183
+ border-radius: ${({ state }) => {
184
+ if (state) {
185
+ if (state === "inbound") return "0.21875rem 0.21875rem 0.21875rem 0rem";
186
+ if (state === "outbound") return "0.21875rem 0.21875rem 0rem 0.21875rem";
187
+ }
188
+ return `${BmPrimaryWhite}`;
189
+ }};
190
+ border: 0.071rem solid ${BmGrey200};
191
+ `;
192
+
193
+ export const BmImage = styled.img`
194
+ ${"" /* Fix width */}
195
+ width: 21.429rem;
196
+ object-fit: cover;
197
+ flex-grow: 1;
198
+ `;
199
+
200
+ export const BmImageChat = ({ state, src, fileName, ...rest }) => {
201
+ return (
202
+ <>
203
+ <BmImageWrapper state={state} {...rest}>
204
+ <BmImage src={src} alt="src" />
205
+ {fileName && (
206
+ <BmFileAttachment
207
+ state={state}
208
+ file={src}
209
+ fileName={fileName}
210
+ {...rest}
211
+ />
212
+ )}
213
+ </BmImageWrapper>
214
+ </>
215
+ );
216
+ };
217
+
218
+ //End of Component for Images
219
+
220
+ BmChat.Details = ({
221
+ children,
222
+ state,
223
+ displayTime,
224
+ status,
225
+ session,
226
+ src,
227
+ file,
228
+ fileName,
229
+ ...rest
230
+ }) => {
231
+ console.log("bbbb", fileName);
232
+ return (
233
+ <Details state={state} {...rest}>
234
+ {state === "inbound" && session && handleState({ state, session })}
235
+ <MessageDetails>
236
+ {/* For Images */}
237
+ {src && (
238
+ <BmImageChat state={state} src={src} fileName={fileName} {...rest} />
239
+ )}
240
+ {/* For Messages */}
241
+ {children && <Messages state={state}>{children}</Messages>}
242
+ {/* For files */}
243
+ {file && (
244
+ <BmFileAttachment
245
+ file={file}
246
+ fileName={fileName}
247
+ state={state}
248
+ {...rest}
249
+ />
250
+ )}
251
+ <MessagesSubDetails>
252
+ {displayTime && displayTime}
253
+ {status === "sent" && (
254
+ <BmIcons
255
+ icon={<DoneAll />}
256
+ color={`${BmSecondaryDarkGreen}`}
257
+ size="small"
258
+ />
259
+ )}
260
+ {status === "failed" && (
261
+ <BmIcons icon={<Done />} color={`${BmPrimaryBlack}`} size="small" />
262
+ )}
263
+ </MessagesSubDetails>
264
+ </MessageDetails>
265
+ {state === "outbound" && session && handleState({ state, session })}
266
+ </Details>
267
+ );
268
+ };
269
+
270
+ BmChat.Footer = styled.div`
271
+ display: flex;
272
+ flex-direction: column;
273
+ padding: 0.5rem 0.5rem;
274
+ > *:not(:last-child) {
275
+ margin-bottom: 0.5rem;
276
+ }
277
+ `;
278
+
279
+ export default BmChat;
@@ -0,0 +1,81 @@
1
+ /* eslint-disable import/no-anonymous-default-export */
2
+ import React from "react";
3
+ import BmChat from "./chatBody";
4
+ import { BmIcons } from "../../iconStyles";
5
+ import EmojiEmotionsIcon from "@mui/icons-material/EmojiEmotions";
6
+ import AttachFileIcon from "@mui/icons-material/AttachFile";
7
+ import QuickreplyIcon from "@mui/icons-material/Quickreply";
8
+ import SendIcon from "@mui/icons-material/Send";
9
+ import { BmInput } from "../../input";
10
+ import image from "../../../assets/chart-img.png";
11
+
12
+ export default {
13
+ component: BmChat,
14
+ title: "components/Chat/MainChat/ChatBody",
15
+ };
16
+
17
+ export const ChatBody = () => {
18
+ return (
19
+ <BmChat>
20
+ <BmChat.Body>
21
+ <BmChat.Details
22
+ state="inbound"
23
+ session="bot"
24
+ displayTime={<p>12:00pm</p>}
25
+ status="sent"
26
+ >
27
+ <p>Inbound Text Message</p>
28
+ </BmChat.Details>
29
+ <BmChat.Details
30
+ state="inbound"
31
+ session="live"
32
+ displayTime={<p>12:00pm</p>}
33
+ status="sent"
34
+ fileName={<p>chat.png</p>}
35
+ src={image}
36
+ />
37
+ <BmChat.Details
38
+ state="inbound"
39
+ session="live"
40
+ displayTime={<p>10:00am</p>}
41
+ status="failed"
42
+ fileName={<p>file.csv</p>}
43
+ file={image}
44
+ />
45
+ <BmChat.Details
46
+ state="outbound"
47
+ session="bot"
48
+ displayTime={<p>12:00pm</p>}
49
+ status="sent"
50
+ >
51
+ <p>Outbound Text Message</p>
52
+ </BmChat.Details>
53
+ <BmChat.Details
54
+ state="outbound"
55
+ session="live"
56
+ displayTime={<p>12:00pm</p>}
57
+ status="sent"
58
+ fileName={<p>chat.png</p>}
59
+ src={image}
60
+ />
61
+ <BmChat.Details
62
+ state="outbound"
63
+ session="live"
64
+ displayTime={<p>10:00am</p>}
65
+ status="failed"
66
+ fileName={<p>file.csv</p>}
67
+ file={image}
68
+ />
69
+ </BmChat.Body>
70
+ <BmChat.Footer>
71
+ <div className="chat-footer">
72
+ <BmIcons icon={<EmojiEmotionsIcon />} size="xlarge" />
73
+ <BmIcons icon={<AttachFileIcon />} size="xlarge" />
74
+ <BmIcons icon={<QuickreplyIcon />} size="xlarge" />
75
+ <BmInput placeholder="Enter Message" style={{ flex: "1" }} />
76
+ <BmIcons icon={<SendIcon />} size="xlarge" />
77
+ </div>
78
+ </BmChat.Footer>
79
+ </BmChat>
80
+ );
81
+ };
@@ -1,11 +1,11 @@
1
1
  /* eslint-disable import/no-anonymous-default-export */
2
2
  import React from "react";
3
- import { BmButton } from "../Buttons/buttons";
3
+ import { BmButton } from "../../Buttons/buttons";
4
4
  import { BmChatHeader } from "./chatHeader";
5
5
 
6
6
  export default {
7
7
  component: BmChatHeader,
8
- title: "components/Chat/ChatHeader",
8
+ title: "components/Chat/MainChat/ChatHeader",
9
9
  };
10
10
 
11
11
  export const ChatHeader = () => {
@@ -13,7 +13,10 @@ export const ChatHeader = () => {
13
13
  <BmChatHeader>
14
14
  <h2>Contact Name</h2>
15
15
  <p>Last seen: 00:00</p>
16
- <BmButton size="medium">End Session</BmButton>
16
+ <div className="chat-header-buttons">
17
+ <BmButton size="medium">End Session</BmButton>
18
+ <BmButton size="medium">End Session</BmButton>
19
+ </div>
17
20
  </BmChatHeader>
18
21
  );
19
22
  };
@@ -0,0 +1,11 @@
1
+ import styled from "styled-components";
2
+
3
+ export const BmColorPicker = styled.div`
4
+ width: 1.429rem;
5
+ height: 1.429rem;
6
+ border-radius: 50%;
7
+ background: ${(props) => (props.color ? props.color : 'green')};
8
+ > *:not(:last-child) {
9
+ margin-right: 0.5rem;
10
+ }
11
+ `;
@@ -0,0 +1,17 @@
1
+ import { BmColorPicker } from "./colorPicker";
2
+
3
+ // eslint-disable-next-line import/no-anonymous-default-export
4
+ export default {
5
+ component: BmColorPicker,
6
+ title: "components/Chat/Components/ColorPicker",
7
+ };
8
+
9
+ export const ColorPicker = () => {
10
+ return (
11
+ <>
12
+ {["#33b1ba", "#000000", "#F62E48", "#8CC63F"].map((color) => (
13
+ <BmColorPicker key={color} color={color} />
14
+ ))}
15
+ </>
16
+ );
17
+ };
@@ -1,5 +1,5 @@
1
1
  import styled from "styled-components";
2
- import { BmGrey100 } from "../colors";
2
+ import { BmGrey100 } from "../../colors";
3
3
 
4
4
  export const BmContactCard = styled.div`
5
5
  display: flex;