beem-component 1.1.5 → 1.1.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.
- package/.storybook/preview.js +2 -1
- package/dist/assets/css/{sidebar.css → sidebar.scss} +12 -5
- 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/{ContactCards → ChatComponents/ContactCards}/contactCards.js +3 -3
- package/dist/components/{ContactCards → ChatComponents/ContactCards}/contactCards.stories.js +4 -4
- package/dist/components/ChatComponents/FormAccordion/FormAccordion.js +22 -0
- package/dist/components/ChatComponents/FormAccordion/FormAccordion.stories.js +29 -0
- package/dist/components/{InfoTab → ChatComponents/InfoTab}/infoTab.js +0 -1
- package/dist/components/{InfoTab → ChatComponents/InfoTab}/infoTab.stories.js +3 -5
- package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.js +19 -0
- package/dist/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +31 -0
- package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.js +23 -0
- package/dist/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +43 -0
- package/dist/components/Modals/modal.js +8 -1
- package/dist/components/colors.js +5 -2
- package/dist/components/index.js +35 -11
- package/package.json +2 -1
- package/src/App.js +15 -25
- package/src/Chat.js +18 -6
- package/src/ChatHeader.js +1 -1
- package/src/InfoAccordion.js +1 -1
- package/src/lib/assets/css/{sidebar.css → sidebar.scss} +12 -5
- 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/{ContactCards → ChatComponents/ContactCards}/contactCards.js +3 -3
- package/src/lib/components/{ContactCards → ChatComponents/ContactCards}/contactCards.stories.js +4 -4
- package/src/lib/components/{Forms/forms.js → ChatComponents/FormAccordion/FormAccordion.js} +14 -4
- package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.stories.js +37 -0
- package/src/lib/components/{InfoTab → ChatComponents/InfoTab}/infoTab.js +0 -1
- package/src/lib/components/{InfoTab → ChatComponents/InfoTab}/infoTab.stories.js +3 -4
- package/src/lib/components/ChatComponents/LabelAccordion/LabelAccordion.js +18 -0
- package/src/lib/components/ChatComponents/LabelAccordion/LabelAccordion.stories.js +38 -0
- package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.js +46 -0
- package/src/lib/components/ChatComponents/NoteAccordion/NoteAccordion.stories.js +47 -0
- package/src/lib/components/Modals/modal.js +9 -0
- package/src/lib/components/colors.js +3 -0
- package/src/lib/components/index.js +14 -9
- package/dist/components/ChatBody/chatBody.js +0 -144
- package/dist/components/Forms/forms.js +0 -21
- package/src/lib/components/ChatBody/chatBody.js +0 -147
- package/src/lib/components/ChatBody/chatBody.stories.js +0 -48
|
@@ -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: 0.5rem;
|
|
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: 100%;
|
|
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 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 {
|
|
2
|
+
import { BmSecondaryBlue12 } from "../../colors";
|
|
3
3
|
|
|
4
4
|
export const BmContactCard = styled.div`
|
|
5
5
|
display: flex;
|
|
@@ -9,13 +9,13 @@ export const BmContactCard = styled.div`
|
|
|
9
9
|
margin-right: 1rem;
|
|
10
10
|
}
|
|
11
11
|
&:hover {
|
|
12
|
-
background: ${
|
|
12
|
+
background: ${BmSecondaryBlue12};
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
${({ active }) =>
|
|
16
16
|
active &&
|
|
17
17
|
`
|
|
18
|
-
background: ${
|
|
18
|
+
background: ${BmSecondaryBlue12};
|
|
19
19
|
`}
|
|
20
20
|
cursor: pointer;
|
|
21
21
|
padding: 1rem 1.5rem;
|
package/src/lib/components/{ContactCards → ChatComponents/ContactCards}/contactCards.stories.js
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
2
|
import React from "react";
|
|
3
3
|
import BmContactCard from "./contactCards";
|
|
4
|
-
import BmAvatar from "
|
|
5
|
-
import BmCounter from "
|
|
6
|
-
import { BmTag } from "
|
|
4
|
+
import BmAvatar from "../../Avatars/avatars";
|
|
5
|
+
import BmCounter from "../../MessageCounter/messageCounter";
|
|
6
|
+
import { BmTag } from "../../tags";
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
component: { BmContactCard, BmAvatar, BmTag, BmCounter },
|
|
10
|
-
title: "components/ContactCard",
|
|
10
|
+
title: "components/Chat/Components/ContactCard",
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const ContactCard = () => {
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
|
|
3
|
-
const
|
|
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`
|
|
4
14
|
display: flex;
|
|
5
15
|
flex-direction: row;
|
|
6
16
|
align-items: center;
|
|
7
17
|
justify-content: space-between;
|
|
8
18
|
`;
|
|
9
19
|
|
|
10
|
-
|
|
20
|
+
BmChatForm.Label = styled.div`
|
|
11
21
|
margin: 0rem;
|
|
12
22
|
text-align: left;
|
|
13
23
|
width: 50%;
|
|
@@ -15,7 +25,7 @@ BmForm.Label = styled.div`
|
|
|
15
25
|
text-overflow: ellipsis;
|
|
16
26
|
`
|
|
17
27
|
|
|
18
|
-
|
|
28
|
+
BmChatForm.Input = styled.input`
|
|
19
29
|
text-align: right;
|
|
20
30
|
width: 50%;
|
|
21
31
|
overflow: hidden;
|
|
@@ -31,4 +41,4 @@ BmForm.Input = styled.input`
|
|
|
31
41
|
background: transparent;
|
|
32
42
|
`
|
|
33
43
|
|
|
34
|
-
export default
|
|
44
|
+
export default BmChatForm;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BmAccordion, BmChatForm } from "../..";
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line import/no-anonymous-default-export
|
|
4
|
+
export default {
|
|
5
|
+
component: BmChatForm,
|
|
6
|
+
title: "components/Chat/Components/FormAccordion",
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const FormAccordion = () => {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<div style={{ width: "30%" }}>
|
|
13
|
+
<BmAccordion>
|
|
14
|
+
<BmAccordion.Title>
|
|
15
|
+
<h3>Information</h3>
|
|
16
|
+
</BmAccordion.Title>
|
|
17
|
+
<BmAccordion.Body>
|
|
18
|
+
<BmChatForm>
|
|
19
|
+
<BmChatForm.Group>
|
|
20
|
+
<BmChatForm.Label>
|
|
21
|
+
<h4>Account No.</h4>
|
|
22
|
+
</BmChatForm.Label>
|
|
23
|
+
<BmChatForm.Input placeholder="Enter here" />
|
|
24
|
+
</BmChatForm.Group>
|
|
25
|
+
<BmChatForm.Group>
|
|
26
|
+
<BmChatForm.Label>
|
|
27
|
+
<h4>Preferred Language</h4>
|
|
28
|
+
</BmChatForm.Label>
|
|
29
|
+
<BmChatForm.Input placeholder="Enter here" />
|
|
30
|
+
</BmChatForm.Group>
|
|
31
|
+
</BmChatForm>
|
|
32
|
+
</BmAccordion.Body>
|
|
33
|
+
</BmAccordion>
|
|
34
|
+
</div>
|
|
35
|
+
</>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/* eslint-disable import/no-anonymous-default-export */
|
|
2
2
|
import React from "react";
|
|
3
3
|
import BmInfoTab from "./infoTab";
|
|
4
|
-
import {
|
|
5
|
-
import { BmBtnIcon } from "../Buttons/buttonIconsOnly";
|
|
4
|
+
import { BmBtnIcon } from "../../Buttons/buttonIconsOnly";
|
|
6
5
|
import { MoreVert, Phone } from "@material-ui/icons";
|
|
7
|
-
import { BmIcons } from "
|
|
6
|
+
import { BmIcons } from "../../iconStyles";
|
|
8
7
|
|
|
9
8
|
export default {
|
|
10
9
|
component: BmInfoTab,
|
|
11
|
-
title: "components/InfoTab",
|
|
10
|
+
title: "components/Chat/Components/InfoTab",
|
|
12
11
|
};
|
|
13
12
|
|
|
14
13
|
export const InfoTab = () => {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
const BmChatLabels = styled.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
padding: 0rem 0.5rem;
|
|
7
|
+
> *:not(:last-child) {
|
|
8
|
+
margin-bottom: 1rem;
|
|
9
|
+
}
|
|
10
|
+
> * {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: row;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
width: 100%;
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
export default BmChatLabels;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BmAccordion, BmChatLabels, BmTag } from "../..";
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line import/no-anonymous-default-export
|
|
4
|
+
export default {
|
|
5
|
+
component: BmChatLabels,
|
|
6
|
+
title: "components/Chat/Components/LabelAccordion",
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const LabelAccordion = () => {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<div style={{ width: "30%" }}>
|
|
13
|
+
<BmAccordion>
|
|
14
|
+
<BmAccordion.Title>
|
|
15
|
+
<h3>Labels</h3>
|
|
16
|
+
<a>Manage Labels</a>
|
|
17
|
+
</BmAccordion.Title>
|
|
18
|
+
<BmAccordion.Body>
|
|
19
|
+
<BmChatLabels>
|
|
20
|
+
<h4>Added labels</h4>
|
|
21
|
+
<div>
|
|
22
|
+
<BmTag variant="success">
|
|
23
|
+
<p>label</p>
|
|
24
|
+
</BmTag>
|
|
25
|
+
<BmTag variant="warning">
|
|
26
|
+
<p>label</p>
|
|
27
|
+
</BmTag>
|
|
28
|
+
<BmTag variant="error">
|
|
29
|
+
<p>label</p>
|
|
30
|
+
</BmTag>
|
|
31
|
+
</div>
|
|
32
|
+
</BmChatLabels>
|
|
33
|
+
</BmAccordion.Body>
|
|
34
|
+
</BmAccordion>
|
|
35
|
+
</div>
|
|
36
|
+
</>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { BmGrey100, BmGrey200 } from "../../colors";
|
|
3
|
+
|
|
4
|
+
const BmChatNotes = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
padding: 0rem 0.5rem;
|
|
8
|
+
> *:not(:last-child) {
|
|
9
|
+
margin-bottom: 0.5rem;
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
BmChatNotes.Input = styled.input`
|
|
14
|
+
padding: 1rem 1.5rem;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-grow: 1;
|
|
17
|
+
background: ${BmGrey100};
|
|
18
|
+
border: none !important;
|
|
19
|
+
&:visited,
|
|
20
|
+
&:active,
|
|
21
|
+
&:hover,
|
|
22
|
+
&:focus {
|
|
23
|
+
outline: none !important;
|
|
24
|
+
text-decoration: none !important;
|
|
25
|
+
}
|
|
26
|
+
width: 100%;
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
BmChatNotes.Details = styled.div`
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
padding: 0.5rem 1rem;
|
|
33
|
+
border: 1px solid ${BmGrey200};
|
|
34
|
+
border-radius: 0.25rem;
|
|
35
|
+
> *:not(:last-child) {
|
|
36
|
+
margin-bottom: 0.5rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
> * {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: row;
|
|
42
|
+
justify-content: space-between;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
export default BmChatNotes;
|