beem-component 1.6.0 → 1.6.3
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/dist/components/Avatars/avatars.js +9 -1
- package/dist/components/ChatComponents/ChatBody/chatBody.js +15 -5
- package/dist/components/ChatComponents/ChatBody/chatBody.stories.js +2 -1
- package/dist/components/PaymentBox/paymentBox.js +47 -0
- package/dist/components/PaymentBox/paymentBox.stories.js +33 -0
- package/dist/components/index.js +8 -0
- package/package.json +1 -1
- package/src/App.js +87 -8
- package/src/lib/components/Avatars/avatars.js +12 -2
- package/src/lib/components/ChatComponents/ChatBody/chatBody.js +8 -1
- package/src/lib/components/ChatComponents/ChatBody/chatBody.stories.js +2 -1
- package/src/lib/components/PaymentBox/paymentBox.js +51 -0
- package/src/lib/components/PaymentBox/paymentBox.stories.js +30 -0
- package/src/lib/components/index.js +2 -0
|
@@ -15,6 +15,8 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
15
15
|
|
|
16
16
|
var _SmartToy = _interopRequireDefault(require("@mui/icons-material/SmartToy"));
|
|
17
17
|
|
|
18
|
+
var _Chat = _interopRequireDefault(require("@mui/icons-material/Chat"));
|
|
19
|
+
|
|
18
20
|
var _colors = require("../colors");
|
|
19
21
|
|
|
20
22
|
var _iconStyles = require("../iconStyles");
|
|
@@ -53,6 +55,7 @@ var BmAvatarWrapper = _styledComponents.default.div(_templateObject || (_templat
|
|
|
53
55
|
var user = _ref3.user;
|
|
54
56
|
if (user === 'chatbot') return "".concat(_colors.BmPrimaryBlue);
|
|
55
57
|
if (user === 'employee') return "".concat(_colors.BmPrimaryBlue);
|
|
58
|
+
if (user === 'sms') return "".concat(_colors.BmPrimaryBlue);
|
|
56
59
|
return "".concat(_colors.BmGrey100);
|
|
57
60
|
}, function (_ref4) {
|
|
58
61
|
var type = _ref4.type;
|
|
@@ -63,6 +66,7 @@ var BmAvatarWrapper = _styledComponents.default.div(_templateObject || (_templat
|
|
|
63
66
|
var user = _ref5.user;
|
|
64
67
|
if (user === 'chatbot') return "".concat(_colors.BmPrimaryBlue);
|
|
65
68
|
if (user === 'employee') return "".concat(_colors.BmPrimaryBlue);
|
|
69
|
+
if (user === 'sms') return "".concat(_colors.BmPrimaryBlue);
|
|
66
70
|
return "".concat(_colors.BmGrey100);
|
|
67
71
|
});
|
|
68
72
|
|
|
@@ -85,7 +89,11 @@ var BmAvatar = function BmAvatar(props) {
|
|
|
85
89
|
icon: /*#__PURE__*/_react.default.createElement(_SmartToy.default, null),
|
|
86
90
|
size: size,
|
|
87
91
|
color: color
|
|
88
|
-
}, rest)), user
|
|
92
|
+
}, rest)), user === 'sms' && /*#__PURE__*/_react.default.createElement(_iconStyles.BmAvatarIcon, _extends({
|
|
93
|
+
icon: /*#__PURE__*/_react.default.createElement(_Chat.default, null),
|
|
94
|
+
size: size,
|
|
95
|
+
color: color
|
|
96
|
+
}, rest)), user !== 'chatbot' && user !== 'employee' && user !== 'sms' && user !== 'default' && /*#__PURE__*/_react.default.createElement(_iconStyles.BmAvatarIcon, _extends({
|
|
89
97
|
icon: user,
|
|
90
98
|
size: size,
|
|
91
99
|
color: color
|
|
@@ -23,7 +23,7 @@ var _sessionDetails = require("./sessionDetails");
|
|
|
23
23
|
|
|
24
24
|
var _colors = require("../../colors");
|
|
25
25
|
|
|
26
|
-
var _excluded = ["state", "file", "src", "fileName", "onDownload"],
|
|
26
|
+
var _excluded = ["state", "file", "src", "fileName", "onDownload", "link"],
|
|
27
27
|
_excluded2 = ["state", "src", "fileName"],
|
|
28
28
|
_excluded3 = ["children", "state", "displayTime", "status", "session", "src", "file", "fileName", "sessionDetails"];
|
|
29
29
|
|
|
@@ -110,6 +110,13 @@ var handleState = function handleState(_ref5) {
|
|
|
110
110
|
user: "employee"
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
+
|
|
114
|
+
if (session === 'sms') {
|
|
115
|
+
return /*#__PURE__*/_react.default.createElement(_avatars.default, {
|
|
116
|
+
size: "small",
|
|
117
|
+
user: "sms"
|
|
118
|
+
});
|
|
119
|
+
}
|
|
113
120
|
}; // Start of File Attachment
|
|
114
121
|
|
|
115
122
|
|
|
@@ -161,16 +168,19 @@ var BmFileAttachment = function BmFileAttachment(_ref10) {
|
|
|
161
168
|
src = _ref10.src,
|
|
162
169
|
fileName = _ref10.fileName,
|
|
163
170
|
onDownload = _ref10.onDownload,
|
|
171
|
+
link = _ref10.link,
|
|
164
172
|
rest = _objectWithoutProperties(_ref10, _excluded);
|
|
165
173
|
|
|
166
174
|
return /*#__PURE__*/_react.default.createElement(FileAttachmentWrapper, _extends({
|
|
167
175
|
state: state
|
|
168
176
|
}, rest), /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
169
177
|
icon: /*#__PURE__*/_react.default.createElement(_FilePresent.default, null)
|
|
170
|
-
}), fileName, /*#__PURE__*/_react.default.createElement(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
178
|
+
}), fileName, /*#__PURE__*/_react.default.createElement("a", {
|
|
179
|
+
href: link,
|
|
180
|
+
download: true
|
|
181
|
+
}, /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
182
|
+
icon: /*#__PURE__*/_react.default.createElement(_Download.default, null)
|
|
183
|
+
})));
|
|
174
184
|
}; // Start of Component for Images
|
|
175
185
|
|
|
176
186
|
|
|
@@ -36,7 +36,7 @@ exports.default = _default;
|
|
|
36
36
|
var ChatBody = function ChatBody() {
|
|
37
37
|
return /*#__PURE__*/_react.default.createElement(_chatBody.default, null, /*#__PURE__*/_react.default.createElement(_chatBody.default.Body, null, /*#__PURE__*/_react.default.createElement(_chatBody.default.Details, {
|
|
38
38
|
state: "inbound",
|
|
39
|
-
session: "
|
|
39
|
+
session: "sms",
|
|
40
40
|
displayTime: /*#__PURE__*/_react.default.createElement("p", null, "12:00pm"),
|
|
41
41
|
status: "sent",
|
|
42
42
|
sessionDetails: {
|
|
@@ -80,6 +80,7 @@ var ChatBody = function ChatBody() {
|
|
|
80
80
|
status: "failed",
|
|
81
81
|
fileName: /*#__PURE__*/_react.default.createElement("p", null, "file.csv"),
|
|
82
82
|
file: _chartImg.default,
|
|
83
|
+
link: _chartImg.default,
|
|
83
84
|
onDownload: function onDownload() {
|
|
84
85
|
alert('hello');
|
|
85
86
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _colors = require("../colors");
|
|
15
|
+
|
|
16
|
+
var _excluded = ["children"];
|
|
17
|
+
|
|
18
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
27
|
+
|
|
28
|
+
var BmPaymentBoxWrapper = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n flex-direction: column;\n min-width: 240px;\n min-height: 280px;\n border: 0.071rem solid ", ";\n border-radius: 0.5rem;\n > * {\n margin-bottom: 1rem;\n }\n &:hover {\n box-shadow: 0 0 60px rgba(0, 0, 0, 0.08);\n }\n"])), _colors.BmGrey200);
|
|
29
|
+
|
|
30
|
+
var BmPaymentBox = function BmPaymentBox(_ref) {
|
|
31
|
+
var children = _ref.children,
|
|
32
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
+
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement(BmPaymentBoxWrapper, rest, children);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
BmPaymentBox.Header = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: 0.5rem 0rem;\n border-radius: 0.5rem 0.5rem 0rem 0rem;\n background: ", "} \n"])), function (_ref2) {
|
|
38
|
+
var headerColor = _ref2.headerColor;
|
|
39
|
+
return headerColor || _colors.BmPrimaryBlue;
|
|
40
|
+
});
|
|
41
|
+
BmPaymentBox.Body = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n flex: 1;\n"])));
|
|
42
|
+
BmPaymentBox.Footer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n margin-top: auto;\n"])));
|
|
43
|
+
BmPaymentBox.propTypes = {
|
|
44
|
+
children: _propTypes.default.node.isRequired
|
|
45
|
+
};
|
|
46
|
+
var _default = BmPaymentBox;
|
|
47
|
+
exports.default = _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.SamplePaymentBox = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _paymentBox = _interopRequireDefault(require("./paymentBox"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
15
|
+
var _default = {
|
|
16
|
+
component: _paymentBox.default,
|
|
17
|
+
title: 'components/PaymentBox',
|
|
18
|
+
argTypes: {
|
|
19
|
+
headerColor: {
|
|
20
|
+
description: 'Color of the box header ',
|
|
21
|
+
defaultValue: {
|
|
22
|
+
summary: undefined
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.default = _default;
|
|
28
|
+
|
|
29
|
+
var SamplePaymentBox = function SamplePaymentBox() {
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_paymentBox.default, null, /*#__PURE__*/_react.default.createElement(_paymentBox.default.Header, null, /*#__PURE__*/_react.default.createElement("h2", null, "Header")), /*#__PURE__*/_react.default.createElement(_paymentBox.default.Body, null, /*#__PURE__*/_react.default.createElement("p", null, "This is a body")), /*#__PURE__*/_react.default.createElement(_paymentBox.default.Footer, null, /*#__PURE__*/_react.default.createElement("p", null, "This is a footer")));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.SamplePaymentBox = SamplePaymentBox;
|
package/dist/components/index.js
CHANGED
|
@@ -210,6 +210,12 @@ Object.defineProperty(exports, "BmNoteBar", {
|
|
|
210
210
|
return _noteBar.BmNoteBar;
|
|
211
211
|
}
|
|
212
212
|
});
|
|
213
|
+
Object.defineProperty(exports, "BmPaymentBox", {
|
|
214
|
+
enumerable: true,
|
|
215
|
+
get: function get() {
|
|
216
|
+
return _paymentBox.default;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
213
219
|
Object.defineProperty(exports, "BmProfileIcon", {
|
|
214
220
|
enumerable: true,
|
|
215
221
|
get: function get() {
|
|
@@ -381,6 +387,8 @@ var _ProfileIcon = require("./ProfileIcon/ProfileIcon");
|
|
|
381
387
|
|
|
382
388
|
var _checkboxToggler = require("./Checkbox/checkboxToggler");
|
|
383
389
|
|
|
390
|
+
var _paymentBox = _interopRequireDefault(require("./PaymentBox/paymentBox"));
|
|
391
|
+
|
|
384
392
|
var _iconStyles = require("./iconStyles");
|
|
385
393
|
|
|
386
394
|
var _noteBar = require("./NoteBar/noteBar");
|
package/package.json
CHANGED
package/src/App.js
CHANGED
|
@@ -1,14 +1,93 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { GlobalStyle,
|
|
3
|
-
import { BmCheckboxToggle } from './lib/components/Checkbox/checkboxToggler';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GlobalStyle, BmChat } from './lib/components';
|
|
3
|
+
// import { BmCheckboxToggle } from './lib/components/Checkbox/checkboxToggler';
|
|
4
|
+
// import BmChat from './lib/components';
|
|
4
5
|
|
|
5
6
|
const Chat = () => {
|
|
6
|
-
const [checked, setChecked] = useState(false);
|
|
7
|
-
const [showModal, setShowModal] = useState(false);
|
|
7
|
+
// const [checked, setChecked] = useState(false);
|
|
8
|
+
// const [showModal, setShowModal] = useState(false);
|
|
9
|
+
const image =
|
|
10
|
+
'https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/3ba5560f-5446-4623-940e-c92b0f50a9b1?AWSAccessKeyId=AKIAVCAYXA54IQYB6C7A&Expires=1733652431&Signature=WEt9my0kkm3SRkiJjvth2vQKcHc%3D';
|
|
11
|
+
const file =
|
|
12
|
+
'https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/270e8552-064f-42aa-970c-0593b5cf3a20?AWSAccessKeyId=AKIAVCAYXA54IQYB6C7A&Expires=1733652558&Signature=0sTEvpH0UoKHeb8mrFSXlf65h24%3D';
|
|
8
13
|
return (
|
|
9
14
|
<>
|
|
10
15
|
<GlobalStyle />
|
|
11
|
-
<
|
|
16
|
+
<BmChat>
|
|
17
|
+
<BmChat.Body>
|
|
18
|
+
<BmChat.Details
|
|
19
|
+
state="inbound"
|
|
20
|
+
session="sms"
|
|
21
|
+
displayTime={<p>12:00pm</p>}
|
|
22
|
+
status="sent"
|
|
23
|
+
sessionDetails={{
|
|
24
|
+
message: <h3>Session Message</h3>,
|
|
25
|
+
time: <p>12:00pm</p>,
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<p>Inbound Text Message</p>
|
|
29
|
+
</BmChat.Details>
|
|
30
|
+
<BmChat.Details
|
|
31
|
+
state="inbound"
|
|
32
|
+
session="live"
|
|
33
|
+
displayTime={<p>12:00pm</p>}
|
|
34
|
+
status="sent"
|
|
35
|
+
fileName={<p>chahhhhhhhht.png</p>}
|
|
36
|
+
src={image}
|
|
37
|
+
link={image}
|
|
38
|
+
sessionDetails={{
|
|
39
|
+
message: <h3>Session Message</h3>,
|
|
40
|
+
time: <p>12:00pm</p>,
|
|
41
|
+
}}
|
|
42
|
+
/>
|
|
43
|
+
<BmChat.Details
|
|
44
|
+
state="inbound"
|
|
45
|
+
session="live"
|
|
46
|
+
displayTime={<p>10:00am</p>}
|
|
47
|
+
status="failed"
|
|
48
|
+
fileName={<p>fifdsfdsfsdfsfle.csv</p>}
|
|
49
|
+
file={file}
|
|
50
|
+
link={file}
|
|
51
|
+
/>
|
|
52
|
+
<BmChat.Details
|
|
53
|
+
state="outbound"
|
|
54
|
+
session="bot"
|
|
55
|
+
displayTime={<p>12:00pm</p>}
|
|
56
|
+
status="sent"
|
|
57
|
+
>
|
|
58
|
+
<p>Outbound Text Message</p>
|
|
59
|
+
</BmChat.Details>
|
|
60
|
+
<BmChat.Details
|
|
61
|
+
state="outbound"
|
|
62
|
+
session="live"
|
|
63
|
+
displayTime={<p>12:00pm</p>}
|
|
64
|
+
status="sent"
|
|
65
|
+
fileName={<p>chat.png</p>}
|
|
66
|
+
src={image}
|
|
67
|
+
/>
|
|
68
|
+
<BmChat.Details
|
|
69
|
+
state="outbound"
|
|
70
|
+
session="live"
|
|
71
|
+
displayTime={<p>10:00am</p>}
|
|
72
|
+
status="failed"
|
|
73
|
+
fileName={<p>file.csv</p>}
|
|
74
|
+
file={image}
|
|
75
|
+
// onDownload={() => {
|
|
76
|
+
// alert('hello');
|
|
77
|
+
// }}
|
|
78
|
+
/>
|
|
79
|
+
</BmChat.Body>
|
|
80
|
+
{/* <BmChat.Footer>
|
|
81
|
+
<div className="chat-footer">
|
|
82
|
+
<BmIcons icon={<EmojiEmotionsIcon />} size="xlarge" />
|
|
83
|
+
<BmIcons icon={<AttachFileIcon />} size="xlarge" />
|
|
84
|
+
<BmIcons icon={<QuickreplyIcon />} size="xlarge" />
|
|
85
|
+
<BmInput placeholder="Enter Message" style={{ flex: '1' }} />
|
|
86
|
+
<BmIcons icon={<SendIcon />} size="xlarge" />
|
|
87
|
+
</div>
|
|
88
|
+
</BmChat.Footer> */}
|
|
89
|
+
</BmChat>
|
|
90
|
+
{/* <div>
|
|
12
91
|
<BmButton onClick={() => setShowModal(!showModal)}>Click Me!</BmButton>
|
|
13
92
|
</div>
|
|
14
93
|
<BmModal show={showModal} onHide={() => setShowModal(false)}>
|
|
@@ -29,8 +108,8 @@ const Chat = () => {
|
|
|
29
108
|
</BmModal.Body>
|
|
30
109
|
<BmModal.Footer>
|
|
31
110
|
<p>This is a footer</p>
|
|
32
|
-
</BmModal.Footer>
|
|
33
|
-
</BmModal>
|
|
111
|
+
</BmModal.Footer> */}
|
|
112
|
+
{/* </BmModal> */}
|
|
34
113
|
</>
|
|
35
114
|
);
|
|
36
115
|
};
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import SmartToyIcon from '@mui/icons-material/SmartToy';
|
|
6
|
+
import ChatIcon from '@mui/icons-material/Chat';
|
|
6
7
|
import { BmGrey100, BmPrimaryBlue } from '../colors';
|
|
7
8
|
import { BmAvatarIcon } from '../iconStyles';
|
|
8
9
|
|
|
@@ -29,6 +30,7 @@ export const BmAvatarWrapper = styled.div`
|
|
|
29
30
|
background: ${({ user }) => {
|
|
30
31
|
if (user === 'chatbot') return `${BmPrimaryBlue}`;
|
|
31
32
|
if (user === 'employee') return `${BmPrimaryBlue}`;
|
|
33
|
+
if (user === 'sms') return `${BmPrimaryBlue}`;
|
|
32
34
|
return `${BmGrey100}`;
|
|
33
35
|
}};
|
|
34
36
|
border-radius: ${({ type }) => {
|
|
@@ -40,6 +42,8 @@ export const BmAvatarWrapper = styled.div`
|
|
|
40
42
|
${({ user }) => {
|
|
41
43
|
if (user === 'chatbot') return `${BmPrimaryBlue}`;
|
|
42
44
|
if (user === 'employee') return `${BmPrimaryBlue}`;
|
|
45
|
+
if (user === 'sms') return `${BmPrimaryBlue}`;
|
|
46
|
+
|
|
43
47
|
return `${BmGrey100}`;
|
|
44
48
|
}};
|
|
45
49
|
`;
|
|
@@ -59,9 +63,15 @@ const BmAvatar = (props) => {
|
|
|
59
63
|
{...rest}
|
|
60
64
|
/>
|
|
61
65
|
)}
|
|
62
|
-
{user
|
|
63
|
-
<BmAvatarIcon icon={
|
|
66
|
+
{user === 'sms' && (
|
|
67
|
+
<BmAvatarIcon icon={<ChatIcon />} size={size} color={color} {...rest} />
|
|
64
68
|
)}
|
|
69
|
+
{user !== 'chatbot' &&
|
|
70
|
+
user !== 'employee' &&
|
|
71
|
+
user !== 'sms' &&
|
|
72
|
+
user !== 'default' && (
|
|
73
|
+
<BmAvatarIcon icon={user} size={size} color={color} {...rest} />
|
|
74
|
+
)}
|
|
65
75
|
</BmAvatarWrapper>
|
|
66
76
|
);
|
|
67
77
|
};
|
|
@@ -111,6 +111,9 @@ const handleState = ({ session }) => {
|
|
|
111
111
|
if (session === 'live') {
|
|
112
112
|
return <BmAvatar size="small" user="employee" />;
|
|
113
113
|
}
|
|
114
|
+
if (session === 'sms') {
|
|
115
|
+
return <BmAvatar size="small" user="sms" />;
|
|
116
|
+
}
|
|
114
117
|
};
|
|
115
118
|
|
|
116
119
|
// Start of File Attachment
|
|
@@ -169,13 +172,17 @@ const BmFileAttachment = ({
|
|
|
169
172
|
src,
|
|
170
173
|
fileName,
|
|
171
174
|
onDownload,
|
|
175
|
+
link,
|
|
172
176
|
...rest
|
|
173
177
|
}) => {
|
|
174
178
|
return (
|
|
175
179
|
<FileAttachmentWrapper state={state} {...rest}>
|
|
176
180
|
<BmIcons icon={<FilePresentIcon />} />
|
|
181
|
+
{/* {fileName} */}
|
|
177
182
|
{fileName}
|
|
178
|
-
<
|
|
183
|
+
<a href={link} download>
|
|
184
|
+
<BmIcons icon={<DownloadIcon />} />
|
|
185
|
+
</a>
|
|
179
186
|
</FileAttachmentWrapper>
|
|
180
187
|
);
|
|
181
188
|
};
|
|
@@ -20,7 +20,7 @@ export const ChatBody = () => {
|
|
|
20
20
|
<BmChat.Body>
|
|
21
21
|
<BmChat.Details
|
|
22
22
|
state="inbound"
|
|
23
|
-
session="
|
|
23
|
+
session="sms"
|
|
24
24
|
displayTime={<p>12:00pm</p>}
|
|
25
25
|
status="sent"
|
|
26
26
|
sessionDetails={{
|
|
@@ -73,6 +73,7 @@ export const ChatBody = () => {
|
|
|
73
73
|
status="failed"
|
|
74
74
|
fileName={<p>file.csv</p>}
|
|
75
75
|
file={image}
|
|
76
|
+
link={image}
|
|
76
77
|
onDownload={() => {
|
|
77
78
|
alert('hello');
|
|
78
79
|
}}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { BmGrey200, BmPrimaryBlue } from '../colors';
|
|
5
|
+
|
|
6
|
+
const BmPaymentBoxWrapper = styled.div`
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
min-width: 240px;
|
|
10
|
+
min-height: 280px;
|
|
11
|
+
border: 0.071rem solid ${BmGrey200};
|
|
12
|
+
border-radius: 0.5rem;
|
|
13
|
+
> * {
|
|
14
|
+
margin-bottom: 1rem;
|
|
15
|
+
}
|
|
16
|
+
&:hover {
|
|
17
|
+
box-shadow: 0 0 60px rgba(0, 0, 0, 0.08);
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
const BmPaymentBox = ({ children, ...rest }) => {
|
|
22
|
+
return <BmPaymentBoxWrapper {...rest}>{children}</BmPaymentBoxWrapper>;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
BmPaymentBox.Header = styled.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
align-items: center;
|
|
30
|
+
padding: 0.5rem 0rem;
|
|
31
|
+
border-radius: 0.5rem 0.5rem 0rem 0rem;
|
|
32
|
+
background: ${({ headerColor }) => headerColor || BmPrimaryBlue}}
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
BmPaymentBox.Body = styled.div`
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
flex: 1;
|
|
39
|
+
`;
|
|
40
|
+
BmPaymentBox.Footer = styled.div`
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: row;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
margin-top: auto;
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
BmPaymentBox.propTypes = {
|
|
48
|
+
children: PropTypes.node.isRequired,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default BmPaymentBox;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import BmPaymentBox from './paymentBox';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
component: BmPaymentBox,
|
|
7
|
+
title: 'components/PaymentBox',
|
|
8
|
+
argTypes: {
|
|
9
|
+
headerColor: {
|
|
10
|
+
description: 'Color of the box header ',
|
|
11
|
+
defaultValue: { summary: undefined },
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const SamplePaymentBox = () => {
|
|
17
|
+
return (
|
|
18
|
+
<BmPaymentBox>
|
|
19
|
+
<BmPaymentBox.Header>
|
|
20
|
+
<h2>Header</h2>
|
|
21
|
+
</BmPaymentBox.Header>
|
|
22
|
+
<BmPaymentBox.Body>
|
|
23
|
+
<p>This is a body</p>
|
|
24
|
+
</BmPaymentBox.Body>
|
|
25
|
+
<BmPaymentBox.Footer>
|
|
26
|
+
<p>This is a footer</p>
|
|
27
|
+
</BmPaymentBox.Footer>
|
|
28
|
+
</BmPaymentBox>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -22,6 +22,7 @@ import BmBanner from './BannerCard/bannerCards';
|
|
|
22
22
|
import BmProgressRing from './ProgressRing/progressRing';
|
|
23
23
|
import { BmProfileIcon } from './ProfileIcon/ProfileIcon';
|
|
24
24
|
import { BmCheckboxToggle } from './Checkbox/checkboxToggler';
|
|
25
|
+
import BmPaymentBox from './PaymentBox/paymentBox';
|
|
25
26
|
import {
|
|
26
27
|
BmTagIcon,
|
|
27
28
|
BmAvatarIcon,
|
|
@@ -80,6 +81,7 @@ export {
|
|
|
80
81
|
BmProgressRing,
|
|
81
82
|
BmProfileIcon,
|
|
82
83
|
BmCheckboxToggle,
|
|
84
|
+
BmPaymentBox,
|
|
83
85
|
// Fix height and if there is dropdown option inside the modal body
|
|
84
86
|
BmModal,
|
|
85
87
|
BmNoteBar,
|