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.
- 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/{ContactCards → ChatComponents/ContactCards}/contactCards.js +1 -1
- 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 +1 -1
- package/dist/components/index.js +36 -4
- package/package.json +2 -1
- package/src/App.js +3 -5
- package/src/Chat.js +10 -6
- 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/{ContactCards → ChatComponents/ContactCards}/contactCards.js +1 -1
- package/src/lib/components/{ContactCards → ChatComponents/ContactCards}/contactCards.stories.js +4 -4
- package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.js +44 -0
- 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/index.js +14 -4
- package/dist/components/ChatBody/chatBody.js +0 -144
- package/src/lib/components/ChatBody/chatBody.js +0 -148
- package/src/lib/components/ChatBody/chatBody.stories.js +0 -48
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 = () => {
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { BmAccordion, BmChatLabels, BmChatNotes, BmIcons } from "../..";
|
|
2
|
+
import ContentCopyIcon from "@mui/icons-material/ContentCopy";
|
|
3
|
+
import { Delete, Edit } from "@material-ui/icons";
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line import/no-anonymous-default-export
|
|
6
|
+
export default {
|
|
7
|
+
component: BmChatLabels,
|
|
8
|
+
title: "components/Chat/Components/NoteAccordion",
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const NoteAccordion = () => {
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<div style={{ width: "30%" }}>
|
|
15
|
+
<BmAccordion>
|
|
16
|
+
<BmAccordion.Title>
|
|
17
|
+
<h3>Notes</h3>
|
|
18
|
+
</BmAccordion.Title>
|
|
19
|
+
<BmAccordion.Body>
|
|
20
|
+
<BmChatNotes>
|
|
21
|
+
<BmChatNotes.Input type="text" placeholder="Add Note" />
|
|
22
|
+
{/* Display Note */}
|
|
23
|
+
<BmChatNotes.Details>
|
|
24
|
+
<div>
|
|
25
|
+
<p>Description</p>
|
|
26
|
+
</div>
|
|
27
|
+
<div>
|
|
28
|
+
<BmIcons icon={<Edit />} size="xsmall" />
|
|
29
|
+
<BmIcons icon={<ContentCopyIcon />} size="xsmall" />
|
|
30
|
+
<BmIcons icon={<Delete />} size="xsmall" />
|
|
31
|
+
</div>
|
|
32
|
+
<div>
|
|
33
|
+
<p>
|
|
34
|
+
<i>By User</i>
|
|
35
|
+
</p>
|
|
36
|
+
<p>
|
|
37
|
+
<i>12:00pm</i>
|
|
38
|
+
</p>
|
|
39
|
+
</div>
|
|
40
|
+
</BmChatNotes.Details>
|
|
41
|
+
</BmChatNotes>
|
|
42
|
+
</BmAccordion.Body>
|
|
43
|
+
</BmAccordion>
|
|
44
|
+
</div>
|
|
45
|
+
</>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
@@ -135,6 +135,15 @@ BmModal.Body = styled.div`
|
|
|
135
135
|
display: flex;
|
|
136
136
|
flex-direction: column;
|
|
137
137
|
justify-content: space-between;
|
|
138
|
+
> *:not(:last-child) {
|
|
139
|
+
margin-bottom: 0.5rem;
|
|
140
|
+
}
|
|
141
|
+
> * {
|
|
142
|
+
display: flex;
|
|
143
|
+
flex-direction: row;
|
|
144
|
+
justify-content: space-between;
|
|
145
|
+
width: 100%;
|
|
146
|
+
}
|
|
138
147
|
`;
|
|
139
148
|
|
|
140
149
|
BmModal.Footer = styled.div`
|
|
@@ -32,11 +32,16 @@ import { BmNoteBar } from "./NoteBar/noteBar";
|
|
|
32
32
|
import { MainWrapper } from "../components/MainWrapper";
|
|
33
33
|
|
|
34
34
|
//Chat Components
|
|
35
|
-
import BmChat from "
|
|
36
|
-
import { BmChatHeader } from "./ChatHeader/chatHeader";
|
|
37
|
-
import BmContactCard from "./ContactCards/contactCards";
|
|
38
|
-
import BmInfoTab from "./InfoTab/infoTab";
|
|
35
|
+
import BmChat from "./ChatComponents/ChatBody/chatBody";
|
|
36
|
+
import { BmChatHeader } from "./ChatComponents/ChatHeader/chatHeader";
|
|
37
|
+
import BmContactCard from "./ChatComponents/ContactCards/contactCards";
|
|
38
|
+
import BmInfoTab from "./ChatComponents/InfoTab/infoTab";
|
|
39
39
|
import BmCounter from "./MessageCounter/messageCounter";
|
|
40
|
+
//Chat Accordion components
|
|
41
|
+
import BmChatForm from "./ChatComponents/FormAccordion/FormAccordion";
|
|
42
|
+
import BmChatLabels from "./ChatComponents/LabelAccordion/LabelAccordion";
|
|
43
|
+
import BmChatNotes from "./ChatComponents/NoteAccordion/NoteAccordion";
|
|
44
|
+
import { BmColorPicker } from "./ChatComponents/ColorPicker/colorPicker";
|
|
40
45
|
|
|
41
46
|
//SuperFluid Components
|
|
42
47
|
import { BmContent } from "./SuperFluid/Content/index";
|
|
@@ -109,4 +114,9 @@ export {
|
|
|
109
114
|
BmInfoTab,
|
|
110
115
|
BmContactCard,
|
|
111
116
|
BmCounter,
|
|
117
|
+
//Chat Accordion Components
|
|
118
|
+
BmChatForm,
|
|
119
|
+
BmChatLabels,
|
|
120
|
+
BmChatNotes,
|
|
121
|
+
BmColorPicker,
|
|
112
122
|
};
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _icons = require("@material-ui/icons");
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
|
|
14
|
-
var _avatars = _interopRequireDefault(require("../Avatars/avatars"));
|
|
15
|
-
|
|
16
|
-
var _iconStyles = require("../iconStyles");
|
|
17
|
-
|
|
18
|
-
var _colors = require("../colors");
|
|
19
|
-
|
|
20
|
-
var _excluded = ["children", "state", "displayTime", "status", "session"];
|
|
21
|
-
|
|
22
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
23
|
-
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
|
-
|
|
28
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
|
-
|
|
30
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
|
-
|
|
32
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
33
|
-
|
|
34
|
-
var BmChat = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n height: 100%;\n ", "\n"])), ""
|
|
35
|
-
/* border: 0.071rem solid ${BmGrey400}; */
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
BmChat.Body = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n padding: 0rem 1.5rem;\n flex-grow: 1;\n overflow: auto;\n"])));
|
|
39
|
-
|
|
40
|
-
var Details = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n ", "\n justify-content: ", ";\n > *:not(:last-child) {\n margin-right: 1rem;\n }\n overflow-wrap: break-word !important;\n word-wrap: break-word !important;\n margin: 0rem;\n flex-grow: 1;\n"])), ""
|
|
41
|
-
/* align-items: center; */
|
|
42
|
-
, function (_ref) {
|
|
43
|
-
var state = _ref.state;
|
|
44
|
-
|
|
45
|
-
if (state === "inbound") {
|
|
46
|
-
return "flex-start";
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (state === "outbound") {
|
|
50
|
-
return "flex-end";
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return "row";
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
var MessageDetails = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n max-width: 50%;\n > * {\n margin-top: 0.5rem;\n }\n"])));
|
|
57
|
-
|
|
58
|
-
var Messages = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 1.143rem;\n background: ", ";\n color: ", ";\n border-radius: ", ";\n border: 0.071rem solid ", ";\n word-break: break-all;\n margin: 0rem;\n"])), function (_ref2) {
|
|
59
|
-
var state = _ref2.state;
|
|
60
|
-
|
|
61
|
-
if (state) {
|
|
62
|
-
if (state === "inbound") return "".concat(_colors.BmPrimaryWhite);
|
|
63
|
-
if (state === "outbound") return "".concat(_colors.BmPrimaryBlue);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return "".concat(_colors.BmPrimaryWhite);
|
|
67
|
-
}, function (_ref3) {
|
|
68
|
-
var state = _ref3.state;
|
|
69
|
-
|
|
70
|
-
if (state) {
|
|
71
|
-
if (state === "inbound") return "".concat(_colors.BmPrimaryBlack);
|
|
72
|
-
if (state === "outbound") return "".concat(_colors.BmPrimaryWhite);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return "".concat(_colors.BmPrimaryWhite);
|
|
76
|
-
}, function (_ref4) {
|
|
77
|
-
var state = _ref4.state;
|
|
78
|
-
|
|
79
|
-
if (state) {
|
|
80
|
-
if (state === "inbound") return "0.21875rem 0.21875rem 0.21875rem 0rem";
|
|
81
|
-
if (state === "outbound") return "0.21875rem 0.21875rem 0rem 0.21875rem";
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return "".concat(_colors.BmPrimaryWhite);
|
|
85
|
-
}, _colors.BmGrey400);
|
|
86
|
-
|
|
87
|
-
var MessagesSubDetails = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n > *:not(:last-child) {\n margin-right: 0.5rem;\n }\n margin-top: 0.5rem;\n"])));
|
|
88
|
-
|
|
89
|
-
var handleState = function handleState(_ref5) {
|
|
90
|
-
var session = _ref5.session;
|
|
91
|
-
|
|
92
|
-
if (session === "bot") {
|
|
93
|
-
return /*#__PURE__*/_react.default.createElement(_avatars.default, {
|
|
94
|
-
size: "small",
|
|
95
|
-
user: "chatbot"
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (session === "live") {
|
|
100
|
-
return /*#__PURE__*/_react.default.createElement(_avatars.default, {
|
|
101
|
-
size: "small",
|
|
102
|
-
user: "employee"
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
BmChat.Details = function (_ref6) {
|
|
108
|
-
var children = _ref6.children,
|
|
109
|
-
state = _ref6.state,
|
|
110
|
-
displayTime = _ref6.displayTime,
|
|
111
|
-
status = _ref6.status,
|
|
112
|
-
session = _ref6.session,
|
|
113
|
-
rest = _objectWithoutProperties(_ref6, _excluded);
|
|
114
|
-
|
|
115
|
-
return /*#__PURE__*/_react.default.createElement(Details, _extends({
|
|
116
|
-
state: state
|
|
117
|
-
}, rest), state === "inbound" && session && handleState({
|
|
118
|
-
state: state,
|
|
119
|
-
session: session
|
|
120
|
-
}), /*#__PURE__*/_react.default.createElement(MessageDetails, null, /*#__PURE__*/_react.default.createElement(Messages, {
|
|
121
|
-
state: state
|
|
122
|
-
}, children), /*#__PURE__*/_react.default.createElement(MessagesSubDetails, null, displayTime && displayTime, status === "sent" && /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
123
|
-
icon: /*#__PURE__*/_react.default.createElement(_icons.DoneAll, null),
|
|
124
|
-
color: "".concat(_colors.BmSecondaryDarkGreen),
|
|
125
|
-
size: "small"
|
|
126
|
-
}), status === "failed" && /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
127
|
-
icon: /*#__PURE__*/_react.default.createElement(_icons.Done, null),
|
|
128
|
-
color: "".concat(_colors.BmPrimaryBlack),
|
|
129
|
-
size: "small"
|
|
130
|
-
}))), state === "outbound" && session && handleState({
|
|
131
|
-
state: state,
|
|
132
|
-
session: session
|
|
133
|
-
}));
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
BmChat.Footer = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n ", "\n padding: 0.5rem 0.5rem;\n ", "\n ", "\n > *:not(:last-child) {\n margin-bottom: 0.5rem;\n }\n"])), ''
|
|
137
|
-
/* border-top: 0.071rem solid ${BmGrey200}; */
|
|
138
|
-
, ''
|
|
139
|
-
/* align-items: center; */
|
|
140
|
-
, ''
|
|
141
|
-
/* justify-content: center; */
|
|
142
|
-
);
|
|
143
|
-
var _default = BmChat;
|
|
144
|
-
exports.default = _default;
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { Done, DoneAll } from "@material-ui/icons";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import styled from "styled-components";
|
|
4
|
-
import BmAvatar from "../Avatars/avatars";
|
|
5
|
-
import { BmIcons } from "../iconStyles";
|
|
6
|
-
import {
|
|
7
|
-
BmGrey400,
|
|
8
|
-
BmPrimaryWhite,
|
|
9
|
-
BmPrimaryBlue,
|
|
10
|
-
BmPrimaryBlack,
|
|
11
|
-
BmSecondaryDarkGreen,
|
|
12
|
-
BmGrey200,
|
|
13
|
-
} from "../colors";
|
|
14
|
-
|
|
15
|
-
const BmChat = styled.div`
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
height: 100%;
|
|
19
|
-
${"" /* border: 0.071rem solid ${BmGrey400}; */}
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
BmChat.Body = styled.div`
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
padding: 0rem 1.5rem;
|
|
26
|
-
flex-grow: 1;
|
|
27
|
-
overflow: auto;
|
|
28
|
-
`;
|
|
29
|
-
|
|
30
|
-
const Details = styled.div`
|
|
31
|
-
display: flex;
|
|
32
|
-
${"" /* align-items: center; */}
|
|
33
|
-
justify-content: ${({ state }) => {
|
|
34
|
-
if (state === "inbound") {
|
|
35
|
-
return "flex-start";
|
|
36
|
-
}
|
|
37
|
-
if (state === "outbound") {
|
|
38
|
-
return "flex-end";
|
|
39
|
-
}
|
|
40
|
-
return "row";
|
|
41
|
-
}};
|
|
42
|
-
> *:not(:last-child) {
|
|
43
|
-
margin-right: 1rem;
|
|
44
|
-
}
|
|
45
|
-
overflow-wrap: break-word !important;
|
|
46
|
-
word-wrap: break-word !important;
|
|
47
|
-
margin: 0rem;
|
|
48
|
-
flex-grow: 1;
|
|
49
|
-
`;
|
|
50
|
-
|
|
51
|
-
const MessageDetails = styled.div`
|
|
52
|
-
display: flex;
|
|
53
|
-
flex-direction: column;
|
|
54
|
-
max-width: 50%;
|
|
55
|
-
> * {
|
|
56
|
-
margin-top: 0.5rem;
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
59
|
-
|
|
60
|
-
const Messages = styled.div`
|
|
61
|
-
display: flex;
|
|
62
|
-
flex-direction: row;
|
|
63
|
-
align-items: center;
|
|
64
|
-
padding: 1.143rem;
|
|
65
|
-
background: ${({ state }) => {
|
|
66
|
-
if (state) {
|
|
67
|
-
if (state === "inbound") return `${BmPrimaryWhite}`;
|
|
68
|
-
if (state === "outbound") return `${BmPrimaryBlue}`;
|
|
69
|
-
}
|
|
70
|
-
return `${BmPrimaryWhite}`;
|
|
71
|
-
}};
|
|
72
|
-
color: ${({ state }) => {
|
|
73
|
-
if (state) {
|
|
74
|
-
if (state === "inbound") return `${BmPrimaryBlack}`;
|
|
75
|
-
if (state === "outbound") return `${BmPrimaryWhite}`;
|
|
76
|
-
}
|
|
77
|
-
return `${BmPrimaryWhite}`;
|
|
78
|
-
}};
|
|
79
|
-
border-radius: ${({ state }) => {
|
|
80
|
-
if (state) {
|
|
81
|
-
if (state === "inbound") return "0.21875rem 0.21875rem 0.21875rem 0rem";
|
|
82
|
-
if (state === "outbound") return "0.21875rem 0.21875rem 0rem 0.21875rem";
|
|
83
|
-
}
|
|
84
|
-
return `${BmPrimaryWhite}`;
|
|
85
|
-
}};
|
|
86
|
-
border: 0.071rem solid ${BmGrey400};
|
|
87
|
-
word-break: break-all;
|
|
88
|
-
margin: 0rem;
|
|
89
|
-
`;
|
|
90
|
-
|
|
91
|
-
const MessagesSubDetails = styled.div`
|
|
92
|
-
display: flex;
|
|
93
|
-
flex-direction: row;
|
|
94
|
-
align-items: center;
|
|
95
|
-
> *:not(:last-child) {
|
|
96
|
-
margin-right: 0.5rem;
|
|
97
|
-
}
|
|
98
|
-
margin-top: 0.5rem;
|
|
99
|
-
`;
|
|
100
|
-
|
|
101
|
-
const handleState = ({ session }) => {
|
|
102
|
-
if (session === "bot") {
|
|
103
|
-
return <BmAvatar size="small" user="chatbot" />;
|
|
104
|
-
}
|
|
105
|
-
if (session === "live") {
|
|
106
|
-
return <BmAvatar size="small" user="employee" />;
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
BmChat.Details = ({
|
|
111
|
-
children,
|
|
112
|
-
state,
|
|
113
|
-
displayTime,
|
|
114
|
-
status,
|
|
115
|
-
session,
|
|
116
|
-
...rest
|
|
117
|
-
}) => {
|
|
118
|
-
return (
|
|
119
|
-
<Details state={state} {...rest}>
|
|
120
|
-
{state === "inbound" && session && handleState({ state, session })}
|
|
121
|
-
<MessageDetails>
|
|
122
|
-
<Messages state={state}>{children}</Messages>
|
|
123
|
-
<MessagesSubDetails>
|
|
124
|
-
{displayTime && displayTime}
|
|
125
|
-
{status === "sent" && (
|
|
126
|
-
<BmIcons icon={<DoneAll />} color={`${BmSecondaryDarkGreen}`} size="small" />
|
|
127
|
-
)}
|
|
128
|
-
{status === "failed" && <BmIcons icon={<Done />} color={`${BmPrimaryBlack}`} size="small" />}
|
|
129
|
-
</MessagesSubDetails>
|
|
130
|
-
</MessageDetails>
|
|
131
|
-
{state === "outbound" && session && handleState({ state, session })}
|
|
132
|
-
</Details>
|
|
133
|
-
);
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
BmChat.Footer = styled.div`
|
|
137
|
-
display: flex;
|
|
138
|
-
flex-direction: column;
|
|
139
|
-
${'' /* border-top: 0.071rem solid ${BmGrey200}; */}
|
|
140
|
-
padding: 0.5rem 0.5rem;
|
|
141
|
-
${'' /* align-items: center; */}
|
|
142
|
-
${'' /* justify-content: center; */}
|
|
143
|
-
> *:not(:last-child) {
|
|
144
|
-
margin-bottom: 0.5rem;
|
|
145
|
-
}
|
|
146
|
-
`;
|
|
147
|
-
|
|
148
|
-
export default BmChat;
|
|
@@ -1,48 +0,0 @@
|
|
|
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 BmAvatar from "../Avatars/avatars";
|
|
10
|
-
import { DoneAll } from "@material-ui/icons";
|
|
11
|
-
import { BmInput } from "../input";
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
component: BmChat,
|
|
15
|
-
title: "components/Chat/ChatBody",
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const ChatBody = () => {
|
|
19
|
-
return (
|
|
20
|
-
<BmChat>
|
|
21
|
-
<BmChat.Body>
|
|
22
|
-
<BmChat.Details
|
|
23
|
-
state="inbound"
|
|
24
|
-
session="bot"
|
|
25
|
-
displayTime={<p>12:00pm</p>}
|
|
26
|
-
status="sent"
|
|
27
|
-
>
|
|
28
|
-
<p>Inbound</p>
|
|
29
|
-
</BmChat.Details>
|
|
30
|
-
<BmChat.Details
|
|
31
|
-
state="outbound"
|
|
32
|
-
session="live"
|
|
33
|
-
displayTime={<p>10:00am</p>}
|
|
34
|
-
status="failed"
|
|
35
|
-
>
|
|
36
|
-
<p>Outbound</p>
|
|
37
|
-
</BmChat.Details>
|
|
38
|
-
</BmChat.Body>
|
|
39
|
-
<BmChat.Footer>
|
|
40
|
-
<BmIcons icon={<EmojiEmotionsIcon />} size="xlarge" />
|
|
41
|
-
<BmIcons icon={<AttachFileIcon />} size="xlarge" />
|
|
42
|
-
<BmIcons icon={<QuickreplyIcon />} size="xlarge" />
|
|
43
|
-
<BmInput placeholder="Enter Message" />
|
|
44
|
-
<BmIcons icon={<SendIcon />} size="xlarge" />
|
|
45
|
-
</BmChat.Footer>
|
|
46
|
-
</BmChat>
|
|
47
|
-
);
|
|
48
|
-
};
|