beem-component 1.5.5 → 1.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/assets/fb.png +0 -0
  2. package/dist/assets/insta.png +0 -0
  3. package/dist/assets/wa.png +0 -0
  4. package/dist/components/ChatComponents/ChatBody/chatBody.js +1 -1
  5. package/dist/components/ChatComponents/ContactCards/contactCards.stories.js +1 -1
  6. package/dist/components/Modals/modal.js +7 -6
  7. package/dist/components/Modals/modals.stories.js +24 -2
  8. package/dist/components/ProfileIcon/ProfileIcon.js +97 -0
  9. package/dist/components/ProfileIcon/profileIcon.stories.js +82 -0
  10. package/dist/components/ScrollBar/scrollBar.js +44 -0
  11. package/dist/components/examples/App.js +137 -0
  12. package/dist/components/examples/InfoAccordion.js +24 -0
  13. package/dist/components/examples/chatBodyExample.js +72 -0
  14. package/dist/components/examples/selectExample.js +77 -0
  15. package/dist/components/globalStyles.js +1 -1
  16. package/dist/components/index.js +8 -0
  17. package/dist/components/text.js +15 -6
  18. package/package.json +3 -2
  19. package/src/App.js +26 -14
  20. package/src/lib/assets/fb.png +0 -0
  21. package/src/lib/assets/insta.png +0 -0
  22. package/src/lib/assets/wa.png +0 -0
  23. package/src/lib/components/ChatComponents/ChatBody/chatBody.js +1 -1
  24. package/src/lib/components/ChatComponents/ContactCards/contactCards.stories.js +1 -1
  25. package/src/lib/components/Modals/modal.js +11 -3
  26. package/src/lib/components/Modals/modals.stories.js +25 -0
  27. package/src/lib/components/ProfileIcon/ProfileIcon.js +78 -0
  28. package/src/lib/components/ProfileIcon/profileIcon.stories.js +57 -0
  29. package/src/lib/components/ScrollBar/scrollBar.js +26 -0
  30. package/src/{Chat.js → lib/components/examples/App.js} +1 -2
  31. package/src/{InfoAccordion.js → lib/components/examples/InfoAccordion.js} +0 -0
  32. package/src/lib/components/examples/chatBodyExample.js +75 -0
  33. package/src/{App copy.js → lib/components/examples/selectExample.js} +0 -0
  34. package/src/lib/components/globalStyles.js +3 -1
  35. package/src/lib/components/index.js +2 -0
  36. package/src/lib/components/text.js +16 -2
  37. package/dist/components/example.js +0 -47
  38. package/dist/components/sidebar.js +0 -32
  39. package/dist/components/tabs.js +0 -106
  40. package/dist/components/tags.js +0 -100
  41. package/dist/images/azam.png +0 -0
  42. package/dist/images/azam1.png +0 -0
  43. package/src/ChatHeader.js +0 -22
  44. package/src/CustomerInfo.js +0 -46
  45. package/src/MainChat.js +0 -41
  46. package/src/SideBar.js +0 -81
  47. package/src/lib/components/example.js +0 -30
  48. package/src/lib/components/sidebar.js +0 -33
  49. package/src/lib/components/tabs.js +0 -123
  50. package/src/lib/components/tags.js +0 -101
  51. package/src/lib/images/azam.png +0 -0
  52. package/src/lib/images/azam1.png +0 -0
  53. package/src/list.scss +0 -4
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _map = _interopRequireDefault(require("lodash/map"));
13
+
14
+ var _components = require("./lib/components");
15
+
16
+ var _reactSelect = _interopRequireDefault(require("react-select"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
24
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
25
+
26
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
27
+
28
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
29
+
30
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
31
+
32
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
33
+
34
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
35
+
36
+ var App = function App() {
37
+ var _useState = (0, _react.useState)(false),
38
+ _useState2 = _slicedToArray(_useState, 2),
39
+ showModal = _useState2[0],
40
+ setShowModal = _useState2[1];
41
+
42
+ var VENDOR_ACCOUNT_STATUSES = {
43
+ 0: "Inactive",
44
+ 1: "Active"
45
+ };
46
+ var VENDOR_ACCOUNT_STATUS_OPTIONS = (0, _map.default)(VENDOR_ACCOUNT_STATUSES, function (type, key) {
47
+ return {
48
+ value: key,
49
+ label: type
50
+ };
51
+ });
52
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_components.GlobalStyle, null), /*#__PURE__*/_react.default.createElement(_components.BmButton, {
53
+ onClick: function onClick() {
54
+ return setShowModal(!showModal);
55
+ }
56
+ }, "Click Me!"), /*#__PURE__*/_react.default.createElement(_components.BmModal, {
57
+ size: "small",
58
+ show: showModal,
59
+ onHide: function onHide() {
60
+ return setShowModal(false);
61
+ },
62
+ centered: true
63
+ }, /*#__PURE__*/_react.default.createElement(_components.BmModal.Header, {
64
+ closeButton: true
65
+ }, /*#__PURE__*/_react.default.createElement("h2", null, "Header")), /*#__PURE__*/_react.default.createElement(_components.BmModal.Body, null, /*#__PURE__*/_react.default.createElement(_reactSelect.default, {
66
+ options: VENDOR_ACCOUNT_STATUS_OPTIONS,
67
+ placeholder: "Select"
68
+ })), /*#__PURE__*/_react.default.createElement(_components.BmModal.Footer, null, /*#__PURE__*/_react.default.createElement(_components.BmButton, {
69
+ size: "small"
70
+ }, "Send"), /*#__PURE__*/_react.default.createElement(_components.BmButton, {
71
+ size: "small",
72
+ variant: "secondary"
73
+ }, "View"))));
74
+ };
75
+
76
+ var _default = App;
77
+ exports.default = _default;
@@ -13,5 +13,5 @@ var _templateObject;
13
13
 
14
14
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
15
15
 
16
- var GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n* { font-size: 14px; cursor: pointer}\n h1 { ", " }\n h2 { ", " }\n h3 { ", " }\n h4 { ", " }\n p { ", " }\n input {", "}\n a {", "}\n"])), _text.h1, _text.h2, _text.h3, _text.h4, _text.p, _text.input, _text.a);
16
+ var GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n* { font-size: 14px; cursor: pointer}\n h1 { ", " }\n h2 { ", " }\n h3 { ", " }\n h4 { ", " }\n h5 { ", " }\n h6 { ", " }\n p { ", " }\n input {", "}\n a {", "}\n"])), _text.h1, _text.h2, _text.h3, _text.h4, _text.h5, _text.h6, _text.p, _text.input, _text.a);
17
17
  exports.GlobalStyle = GlobalStyle;
@@ -204,6 +204,12 @@ Object.defineProperty(exports, "BmNoteBar", {
204
204
  return _noteBar.BmNoteBar;
205
205
  }
206
206
  });
207
+ Object.defineProperty(exports, "BmProfileIcon", {
208
+ enumerable: true,
209
+ get: function get() {
210
+ return _ProfileIcon.BmProfileIcon;
211
+ }
212
+ });
207
213
  Object.defineProperty(exports, "BmProgressBar", {
208
214
  enumerable: true,
209
215
  get: function get() {
@@ -365,6 +371,8 @@ var _bannerCards = _interopRequireDefault(require("../components/BannerCard/bann
365
371
 
366
372
  var _progressRing = _interopRequireDefault(require("./ProgressRing/progressRing"));
367
373
 
374
+ var _ProfileIcon = require("./ProfileIcon/ProfileIcon");
375
+
368
376
  var _iconStyles = require("./iconStyles");
369
377
 
370
378
  var _noteBar = require("./NoteBar/noteBar");
@@ -3,20 +3,29 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.p = exports.input = exports.h5 = exports.h4 = exports.h3 = exports.h2 = exports.h1 = exports.a = void 0;
6
+ exports.p = exports.input = exports.h6 = exports.h5 = exports.h4 = exports.h3 = exports.h2 = exports.h1 = exports.a = void 0;
7
7
 
8
8
  var _typography = require("./typography");
9
9
 
10
- var h1 = "font-family: ".concat(_typography.PoppinsMedium, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 2.571rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
10
+ // 32px
11
+ var h1 = "font-family: ".concat(_typography.PoppinsMedium, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 2.286rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;"); // 24px
12
+
11
13
  exports.h1 = h1;
12
- var h2 = "font-family: ".concat(_typography.PoppinsMedium, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 1.714rem;\nletter-spacing: -0.02em;\nmargin: 0rem;");
14
+ var h2 = "font-family: ".concat(_typography.PoppinsMedium, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 1.714rem;\nletter-spacing: -0.02em;\nmargin: 0rem;"); // 18px
15
+
13
16
  exports.h2 = h2;
14
- var h3 = "font-family: ".concat(_typography.PoppinsMedium, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 1.286rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
17
+ var h3 = "font-family: ".concat(_typography.PoppinsMedium, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 1.286rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;"); // 16px
18
+
15
19
  exports.h3 = h3;
16
- var h4 = " font-family: ".concat(_typography.PoppinsMedium, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
20
+ var h4 = " font-family: ".concat(_typography.PoppinsMedium, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 1.143rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;"); // 14px
21
+
17
22
  exports.h4 = h4;
18
- var h5 = " font-family: ".concat(_typography.PoppinsMedium, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
23
+ var h5 = " font-family: ".concat(_typography.PoppinsMedium, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;"); // 12px
24
+
19
25
  exports.h5 = h5;
26
+ var h6 = " font-family: ".concat(_typography.PoppinsMedium, ";\nfont-style: normal;\nfont-weight: 500;\nfont-size: 0.857rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;"); // 14px
27
+
28
+ exports.h6 = h6;
20
29
  var p = "font-family: ".concat(_typography.OpenSans, ";\nfont-style: normal;\nfont-weight: normal;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
21
30
  exports.p = p;
22
31
  var input = " font-family: ".concat(_typography.OpenSans, ";\nfont-style: normal;\nfont-weight: normal;\nfont-size: 1rem;\nletter-spacing: -0.02rem;\nmargin: 0rem;");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beem-component",
3
- "version": "1.5.5",
3
+ "version": "1.5.8",
4
4
  "private": false,
5
5
  "main": "dist/components/index.js",
6
6
  "scripts": {
@@ -17,7 +17,8 @@
17
17
  "react": "^17.0.2",
18
18
  "react-dom": "^17.0.2",
19
19
  "react-scripts": "4.0.3",
20
- "web-vitals": "^1.1.2"
20
+ "web-vitals": "^1.1.2",
21
+ "babel-loader": "8.1.0"
21
22
  },
22
23
  "dependencies": {
23
24
  "@emotion/react": "^11.7.1",
package/src/App.js CHANGED
@@ -1,23 +1,35 @@
1
1
  import React, { useState } from "react";
2
- import { GlobalStyle, BmRowLabel, BmListBox, BmButton } from "./lib/components";
3
- import "./list.scss";
2
+ import { BmModal, BmButton, GlobalStyle } from "./lib/components";
3
+ import { BmProfileIcon } from "./lib/components/ProfileIcon/ProfileIcon";
4
+ import beem from './lib/assets/beem.jpeg';
5
+
6
+ const Chat = () => {
7
+ const [showModal, setShowModal] = useState(false);
4
8
 
5
- const App = () => {
6
- const [showList, setShowList] = useState(false);
7
9
  return (
8
10
  <>
9
11
  <GlobalStyle />
10
- <BmListBox className="listbox" setShowList={setShowList}>
11
- <BmRowLabel size="large">
12
- <h4>Row Label</h4>
13
- </BmRowLabel>
14
- <BmRowLabel size="large">
15
- <h4>Row Label</h4>
16
- </BmRowLabel>
17
- </BmListBox>
18
- <BmButton onClick={() => setShowList(!showList)}>Click Me!</BmButton>
12
+ <div>
13
+ <BmButton onClick={() => setShowModal(!showModal)}>Click Me!</BmButton>
14
+ </div>
15
+ <BmModal show={showModal} onHide={() => setShowModal(false)}>
16
+ <BmModal.Header closeButton>
17
+ <h2>Header</h2>
18
+ </BmModal.Header>
19
+ <BmModal.SubHeader>
20
+ <h5>This modal has a sub heading</h5>
21
+ </BmModal.SubHeader>
22
+ <BmModal.Body>
23
+ <BmProfileIcon img={beem} content={<h3>TV</h3>} channel="facebook" size="xsmall" />
24
+ <p>This is a body</p>
25
+ </BmModal.Body>
26
+ <BmModal.Footer>
27
+ <p>This is a footer</p>
28
+ </BmModal.Footer>
29
+ </BmModal>
30
+ <BmProfileIcon img={beem} channel="instagram" />
19
31
  </>
20
32
  );
21
33
  };
22
34
 
23
- export default App;
35
+ export default Chat;
Binary file
Binary file
Binary file
@@ -89,7 +89,7 @@ const Messages = styled.div`
89
89
  return `${BmPrimaryWhite}`;
90
90
  }};
91
91
  border: 0.071rem solid ${BmGrey200};
92
- word-break: break-all;
92
+ word-break: keep-all;
93
93
  margin: 0rem;
94
94
  `;
95
95
 
@@ -3,7 +3,7 @@ import React from "react";
3
3
  import BmContactCard from "./contactCards";
4
4
  import BmAvatar from "../../Avatars/avatars";
5
5
  import BmCounter from "../../MessageCounter/messageCounter";
6
- import { BmTag } from "../../tags";
6
+ import { BmTag } from "../../Tags/tags";
7
7
 
8
8
  export default {
9
9
  component: { BmContactCard, BmAvatar, BmTag, BmCounter },
@@ -28,7 +28,7 @@ export const ModalContent = styled.div`
28
28
  max-width: 100%;
29
29
 
30
30
  > *:not(:last-child) {
31
- margin-bottom: 1rem;
31
+ margin-bottom: 0.5rem;
32
32
  }
33
33
  @media (min-width: 576px) {
34
34
  max-width: 500px;
@@ -109,8 +109,9 @@ BmModal.Header = ({ children, size, onHide, closeButton, show, ...rest }) => {
109
109
  {(value) => (
110
110
  <>
111
111
  <ModalHeader {...rest}>
112
+ <p>&nbsp;</p>
112
113
  {children}
113
- {closeButton && (
114
+ {closeButton ? (
114
115
  <BmIcons
115
116
  size="xlarge"
116
117
  icon={<Clear />}
@@ -119,7 +120,7 @@ BmModal.Header = ({ children, size, onHide, closeButton, show, ...rest }) => {
119
120
  }
120
121
  {...rest}
121
122
  />
122
- )}
123
+ ) : <p>&nbsp;</p>}
123
124
  </ModalHeader>
124
125
  </>
125
126
  )}
@@ -127,6 +128,13 @@ BmModal.Header = ({ children, size, onHide, closeButton, show, ...rest }) => {
127
128
  );
128
129
  };
129
130
 
131
+ BmModal.SubHeader = styled.div`
132
+ display: flex;
133
+ flex-direction: row;
134
+ justify-content: center;
135
+ align-items:center;
136
+ `;
137
+
130
138
  BmModal.Body = styled.div`
131
139
  display: flex;
132
140
  flex-direction: column;
@@ -51,6 +51,31 @@ export const SampleModal = () => {
51
51
  </>
52
52
  );
53
53
  };
54
+
55
+ export const ModalWithSubHeader = () => {
56
+ const [showModal, setShowModal] = useState(false);
57
+ return (
58
+ <>
59
+ <div>
60
+ <BmButton onClick={() => setShowModal(!showModal)}>Click Me!</BmButton>
61
+ </div>
62
+ <BmModal show={showModal} onHide={() => setShowModal(false)}>
63
+ <BmModal.Header closeButton>
64
+ <h2>Header</h2>
65
+ </BmModal.Header>
66
+ <BmModal.SubHeader>
67
+ <h5>This modal has a sub heading</h5>
68
+ </BmModal.SubHeader>
69
+ <BmModal.Body>
70
+ <p>This is a body</p>
71
+ </BmModal.Body>
72
+ <BmModal.Footer>
73
+ <p>This is a footer</p>
74
+ </BmModal.Footer>
75
+ </BmModal>
76
+ </>
77
+ );
78
+ };
54
79
  export const ExampleModal = () => {
55
80
  const [showModal, setShowModal] = useState(false);
56
81
  return (
@@ -0,0 +1,78 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { BmSecondaryBlue12, BmBgLightBlue } from '../colors';
4
+ import wa from '../../assets/wa.png';
5
+ import fb from '../../assets/fb.png';
6
+ import insta from '../../assets/insta.png';
7
+
8
+
9
+ const handleSize = (size) => {
10
+ if (size) {
11
+ if (size === "large") return "3.429rem";
12
+ if (size === "medium") return "2.286rem";
13
+ if (size === "small") return "1.714rem";
14
+ if (size === "xsmall") return "1.429rem";
15
+ }
16
+ return "3.429rem"
17
+ };
18
+
19
+ const position = (size) => {
20
+ if (size) {
21
+ if (size === "large") return "2.286rem";
22
+ if (size === "medium") return "1.5rem";
23
+ if (size === "small") return "1rem";
24
+ if (size === "xsmall") return "0.714rem";
25
+ }
26
+ return "2.286rem"
27
+ };
28
+
29
+ const ProfileImg = styled.img`
30
+ height: ${(props) => handleSize(props.size)};
31
+ width: ${(props) => handleSize(props.size)};
32
+ object-fit: contain;
33
+ border-radius: 50%;
34
+ display:flex;
35
+ `;
36
+
37
+ const Profile = styled.div`
38
+ height: ${(props) => handleSize(props.size)};
39
+ width: ${(props) => handleSize(props.size)};
40
+ border-radius: 50%;
41
+ border: 1px solid ${BmBgLightBlue};
42
+ display:flex;
43
+ align-items:center;
44
+ justify-content: center;
45
+ position: relative;
46
+ background: ${BmSecondaryBlue12};
47
+ `;
48
+
49
+ const Content = styled.div`
50
+ display:flex;
51
+ align-items:center;
52
+ justify-content: center;
53
+ position: absolute;
54
+ `;
55
+
56
+
57
+ const Dot = styled.img`
58
+ position: absolute;
59
+ left: ${(props) => position(props.size)};
60
+ bottom: 0rem;
61
+ object-fit: contain;
62
+ height: 1rem;
63
+ width: 1rem;
64
+ `;
65
+
66
+ export const BmProfileIcon = ({ img, content, channel, size, ...rest }) => {
67
+ return (
68
+ <>
69
+ <Profile size={size} {...rest}>
70
+ {content && !img && <Content>{content}</Content>}
71
+ {img && !content && <ProfileImg src={img} />}
72
+ {channel && channel === 'whatsapp' && <Dot size={size} src={wa} />}
73
+ {channel && channel === 'facebook' && <Dot size={size} src={fb} />}
74
+ {channel && channel === 'instagram' && <Dot size={size} src={insta} />}
75
+ </Profile>
76
+ </>
77
+ )
78
+ }
@@ -0,0 +1,57 @@
1
+ /* eslint-disable import/no-anonymous-default-export */
2
+ import React from "react";
3
+ import { BmProfileIcon } from "./ProfileIcon";
4
+ import beem from '../../assets/beem.jpeg';
5
+
6
+
7
+ export default {
8
+ component: BmProfileIcon,
9
+ title: "components/ProfileIcon",
10
+ argTypes: {
11
+ size: {
12
+ options: ["xsmall", "small", "medium", "large"],
13
+ control: { type: "select" },
14
+ description: "Size of the profile",
15
+ defaultValue: { summary: "large" },
16
+ },
17
+ img: {
18
+ description: "Image to be displayed (will not be displayed if content is present)",
19
+ defaultValue: { summary: undefined },
20
+ },
21
+ content: {
22
+ description: "Content to be displayed (will not be displayed if image is present)",
23
+ defaultValue: { summary: undefined },
24
+ },
25
+ channel: {
26
+ options: ["whatsapp", "instagram", "facebook"],
27
+ control: { type: "select" },
28
+ description: "Profile badge",
29
+ defaultValue: { summary: undefined },
30
+ },
31
+ },
32
+ };
33
+
34
+ const MainProfileIcon = (args) => <BmProfileIcon {...args} />;
35
+
36
+ export const Sample = MainProfileIcon.bind({});
37
+ Sample.args = {
38
+ channel: "whatsapp",
39
+ size: "large",
40
+ };
41
+
42
+ export const ImageProfile = MainProfileIcon.bind({});
43
+ ImageProfile.args = {
44
+ channel: "whatsapp",
45
+ size: "large",
46
+ img: beem,
47
+ content: undefined
48
+ };
49
+
50
+ export const ContentProfile = MainProfileIcon.bind({});
51
+ ContentProfile.args = {
52
+ channel: "whatsapp",
53
+ size: "large",
54
+ content: <h4>BC</h4>,
55
+ img: undefined
56
+ };
57
+
@@ -0,0 +1,26 @@
1
+ import styled from "styled-components";
2
+
3
+ export const ScrollbarWrapper = styled.div(() => ({
4
+ "::-webkit-scrollbar-thumb": {
5
+ background: "blue",
6
+ maxHeight: "10px",
7
+ display: "block",
8
+ width: "10em",
9
+ overflow: "auto",
10
+ height: "2em",
11
+ },
12
+ }));
13
+
14
+ export const Scrollbar = styled.div`
15
+ ::-webkit-scrollbar {
16
+ width: 0.714rem !important;
17
+ }
18
+ ::-webkit-scrollbar-thumb {
19
+ background-color: #E2E2E2;
20
+ }`;
21
+
22
+ export const Content = styled.div(() => ({
23
+ direction: "ltr", // if you want to show the scroll bar on the left
24
+ }));
25
+
26
+ export default ScrollbarWrapper;
@@ -6,7 +6,6 @@ import SendIcon from "@mui/icons-material/Send";
6
6
  import { BmChat, BmIcons, BmInput } from "./lib/components";
7
7
  import "../src/lib/assets/css/sidebar.scss";
8
8
  import image from "../src/lib/assets/chart-img.png";
9
- import azam from "../src/lib/images/azam1.png";
10
9
 
11
10
  const Chat = () => {
12
11
  return (
@@ -69,7 +68,7 @@ Je, kwako inasoma ngapi? Kama ipo chini ya 60%, wasiliana na aliyekufungia dish
69
68
  session="live"
70
69
  displayTime={<p>10:00am</p>}
71
70
  status="failed"
72
- src={azam}
71
+ // src={azam}
73
72
  file={<p>fildjfdlkfjlkfdjfldjfldsjfldsje.jpg</p>}
74
73
  >
75
74
  <p>Hekkoi</p>
@@ -0,0 +1,75 @@
1
+ import React, { useState } from "react";
2
+ import { GlobalStyle, BmChat } from "..";
3
+ import "./list.scss";
4
+ import { ScrollbarWrapper } from "../ScrollBar/scrollBar";
5
+
6
+ const App = () => {
7
+ return (
8
+ <>
9
+ <GlobalStyle />
10
+ <ScrollbarWrapper>
11
+ <BmChat>
12
+ <BmChat.Body>
13
+ <BmChat.Details
14
+ state="inbound"
15
+ session="bot"
16
+ displayTime={<p>12:00pm</p>}
17
+ status="sent"
18
+ sessionDetails={{
19
+ message: <h3>Session Message</h3>,
20
+ time: <p>12:00pm</p>,
21
+ }}
22
+ >
23
+ <p>Inbound Text Message</p>
24
+ </BmChat.Details>
25
+ <BmChat.Details
26
+ state="inbound"
27
+ session="live"
28
+ displayTime={<p>12:00pm</p>}
29
+ status="sent"
30
+ fileName={<p>chat.png</p>}
31
+ sessionDetails={{
32
+ message: <h3>Session Message</h3>,
33
+ time: <p>12:00pm</p>,
34
+ }}
35
+ />
36
+ <BmChat.Details
37
+ state="inbound"
38
+ session="live"
39
+ displayTime={<p>10:00am</p>}
40
+ status="failed"
41
+ fileName={<p>file.csv</p>}
42
+ />
43
+ <BmChat.Details
44
+ state="outbound"
45
+ session="bot"
46
+ displayTime={<p>12:00pm</p>}
47
+ status="sent"
48
+ >
49
+ <p>Outbound Text Message</p>
50
+ </BmChat.Details>
51
+ <BmChat.Details
52
+ state="outbound"
53
+ session="live"
54
+ displayTime={<p>12:00pm</p>}
55
+ status="sent"
56
+ fileName={<p>chat.png</p>}
57
+ />
58
+ <BmChat.Details
59
+ state="outbound"
60
+ session="live"
61
+ displayTime={<p>10:00am</p>}
62
+ status="failed"
63
+ fileName={<p>file.csv</p>}
64
+ onDownload={() => {
65
+ alert("hello");
66
+ }}
67
+ />
68
+ </BmChat.Body>
69
+ </BmChat>
70
+ </ScrollbarWrapper>
71
+ </>
72
+ );
73
+ };
74
+
75
+ export default App;
@@ -1,5 +1,5 @@
1
1
  import { createGlobalStyle } from "styled-components";
2
- import { h1, h2, h3, h4, p, input, a } from "./text";
2
+ import { h1, h2, h3, h4, h5, h6, p, input, a } from "./text";
3
3
 
4
4
  export const GlobalStyle = createGlobalStyle`
5
5
  * { font-size: 14px; cursor: pointer}
@@ -7,6 +7,8 @@ export const GlobalStyle = createGlobalStyle`
7
7
  h2 { ${h2} }
8
8
  h3 { ${h3} }
9
9
  h4 { ${h4} }
10
+ h5 { ${h5} }
11
+ h6 { ${h6} }
10
12
  p { ${p} }
11
13
  input {${input}}
12
14
  a {${a}}
@@ -20,6 +20,7 @@ import { BmCheckbox } from "./checkbox";
20
20
  import { BmTag } from "../components/Tags/tags";
21
21
  import BmBanner from "../components/BannerCard/bannerCards";
22
22
  import BmProgressRing from "./ProgressRing/progressRing";
23
+ import {BmProfileIcon} from './ProfileIcon/ProfileIcon';
23
24
 
24
25
  import {
25
26
  BmTagIcon,
@@ -77,6 +78,7 @@ export {
77
78
  BmRowLabel,
78
79
  BmBanner,
79
80
  BmProgressRing,
81
+ BmProfileIcon,
80
82
  // Fix height and if there is dropdown option inside the modal body
81
83
  BmModal,
82
84
  BmNoteBar,