beem-component 1.1.3 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/preview.js +2 -1
- package/dist/assets/css/{sidebar.css → sidebar.scss} +0 -0
- package/dist/components/ChatComponents/ChatBody/chatBody.js +265 -0
- package/dist/components/{ChatBody → ChatComponents/ChatBody}/chatBody.stories.js +42 -11
- package/dist/components/{ChatHeader → ChatComponents/ChatHeader}/chatHeader.js +0 -0
- package/dist/components/{ChatHeader → ChatComponents/ChatHeader}/chatHeader.stories.js +8 -4
- package/dist/components/ChatComponents/ColorPicker/colorPicker.js +20 -0
- package/dist/components/ChatComponents/ColorPicker/colorPicker.stories.js +26 -0
- package/dist/components/ChatComponents/FormAccordion/FormAccordion.js +22 -0
- package/dist/components/ChatComponents/FormAccordion/FormAccordion.stories.js +25 -0
- package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.js +19 -0
- package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +27 -0
- package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.js +23 -0
- package/dist/components/Modals/modal.js +1 -1
- package/dist/components/index.js +34 -2
- package/package.json +2 -1
- package/src/App.js +3 -5
- package/src/Chat.js +14 -13
- package/src/ChatHeader.js +1 -1
- package/src/InfoAccordion.js +24 -0
- package/src/lib/assets/css/{sidebar.css → sidebar.scss} +0 -0
- package/src/lib/components/ChatComponents/ChatBody/chatBody.js +279 -0
- package/src/lib/components/ChatComponents/ChatBody/chatBody.stories.js +81 -0
- package/src/lib/components/{ChatHeader → ChatComponents/ChatHeader}/chatHeader.js +0 -0
- package/src/lib/components/{ChatHeader → ChatComponents/ChatHeader}/chatHeader.stories.js +6 -3
- package/src/lib/components/ChatComponents/ColorPicker/colorPicker.js +11 -0
- package/src/lib/components/ChatComponents/ColorPicker/colorPicker.stories.js +17 -0
- package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.js +44 -0
- package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.stories.js +33 -0
- package/src/lib/components/ChatComponents/LabelAccordion/LabelAccordion.js +18 -0
- package/src/lib/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +36 -0
- package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.js +46 -0
- package/src/lib/components/Modals/modal.js +9 -0
- package/src/lib/components/index.js +12 -2
- package/dist/components/ChatBody/chatBody.js +0 -140
- package/src/lib/components/ChatBody/chatBody.js +0 -148
- package/src/lib/components/ChatBody/chatBody.stories.js +0 -48
package/dist/components/index.js
CHANGED
|
@@ -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,9 +355,9 @@ var _noteBar = require("./NoteBar/noteBar");
|
|
|
331
355
|
|
|
332
356
|
var _MainWrapper = require("../components/MainWrapper");
|
|
333
357
|
|
|
334
|
-
var _chatBody = _interopRequireDefault(require("
|
|
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
362
|
var _contactCards = _interopRequireDefault(require("./ContactCards/contactCards"));
|
|
339
363
|
|
|
@@ -341,6 +365,14 @@ var _infoTab = _interopRequireDefault(require("./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.
|
|
3
|
+
"version": "1.1.7",
|
|
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.
|
|
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
|
|
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.
|
|
8
|
-
import
|
|
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>
|
|
21
|
-
|
|
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>
|
|
32
|
+
<p>Hekkoi</p>
|
|
29
33
|
</BmChat.Details>
|
|
30
34
|
<BmChat.Details
|
|
31
35
|
state="outbound"
|
|
@@ -108,18 +112,15 @@ const Chat = () => {
|
|
|
108
112
|
<p>Outbound</p>
|
|
109
113
|
</BmChat.Details>
|
|
110
114
|
</BmChat.Body>
|
|
111
|
-
<BmChat.Footer>
|
|
112
|
-
<div class="footer">
|
|
115
|
+
<BmChat.Footer style={{ justifyContent: "flex-start" }}>
|
|
116
|
+
<div class="chat-footer">
|
|
113
117
|
<BmIcons icon={<EmojiEmotionsIcon />} size="xlarge" />
|
|
114
118
|
</div>
|
|
115
|
-
<div class="footer">
|
|
119
|
+
<div class="chat-footer">
|
|
116
120
|
<BmIcons icon={<EmojiEmotionsIcon />} size="xlarge" />
|
|
117
121
|
<BmIcons icon={<AttachFile />} size="xlarge" />
|
|
118
122
|
<BmIcons icon={<QuickreplyIcon />} size="xlarge" />
|
|
119
|
-
|
|
120
|
-
<BmMessage>
|
|
121
|
-
<BmMessageTabInput placeholder="Type your message" />
|
|
122
|
-
</BmMessage>
|
|
123
|
+
<BmInput placeholder="Enter Message" style={{ flex: 1 }} />
|
|
123
124
|
<BmIcons icon={<SendIcon />} size="xlarge" />
|
|
124
125
|
</div>
|
|
125
126
|
</BmChat.Footer>
|
package/src/ChatHeader.js
CHANGED
|
@@ -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
|
+
};
|
|
File without changes
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { BmButton } from "
|
|
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
|
-
<
|
|
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 ChatBody = () => {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
{["#33b1ba", "#000000", "#F62E48", "#8CC63F"].map((color) => (
|
|
13
|
+
<BmColorPicker key={color} color={color} />
|
|
14
|
+
))}
|
|
15
|
+
</>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
const BmChatForm = styled.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
padding: 0rem 0.5rem;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
> *:not(:last-child) {
|
|
9
|
+
margin-bottom: 0.5rem;
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
BmChatForm.Group = styled.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: row;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
BmChatForm.Label = styled.div`
|
|
21
|
+
margin: 0rem;
|
|
22
|
+
text-align: left;
|
|
23
|
+
width: 50%;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
text-overflow: ellipsis;
|
|
26
|
+
`
|
|
27
|
+
|
|
28
|
+
BmChatForm.Input = styled.input`
|
|
29
|
+
text-align: right;
|
|
30
|
+
width: 50%;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
text-overflow: ellipsis;
|
|
33
|
+
border: none;
|
|
34
|
+
&:visited,
|
|
35
|
+
&:active,
|
|
36
|
+
&:hover,
|
|
37
|
+
&:focus {
|
|
38
|
+
outline: none !important;
|
|
39
|
+
text-decoration: none;
|
|
40
|
+
}
|
|
41
|
+
background: transparent;
|
|
42
|
+
`
|
|
43
|
+
|
|
44
|
+
export default BmChatForm;
|