beem-component 1.6.8 → 1.7.1
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/assets/Google_Messages_logo.png +0 -0
- package/dist/components/ChatComponents/ChatBody/chatBody.js +7 -2
- package/dist/components/ChatComponents/ChatBody/sessionTimeline.js +44 -0
- package/dist/components/ProfileIcon/ProfileIcon.js +6 -0
- package/dist/components/Tags/tags.js +10 -5
- package/dist/components/Tags/tags.stories.js +7 -1
- package/package.json +1 -1
- package/src/App.js +93 -2
- package/src/lib/assets/Google_Messages_logo.png +0 -0
- package/src/lib/components/ChatComponents/ChatBody/chatBody.js +5 -0
- package/src/lib/components/ChatComponents/ChatBody/sessionTimeline.js +29 -0
- package/src/lib/components/ProfileIcon/ProfileIcon.js +4 -0
- package/src/lib/components/Tags/tags.js +13 -3
- package/src/lib/components/Tags/tags.stories.js +14 -1
|
Binary file
|
|
@@ -21,11 +21,13 @@ var _iconStyles = require("../../iconStyles");
|
|
|
21
21
|
|
|
22
22
|
var _sessionDetails = require("./sessionDetails");
|
|
23
23
|
|
|
24
|
+
var _sessionTimeline = require("./sessionTimeline");
|
|
25
|
+
|
|
24
26
|
var _colors = require("../../colors");
|
|
25
27
|
|
|
26
28
|
var _excluded = ["state", "file", "src", "fileName", "onDownload", "link"],
|
|
27
29
|
_excluded2 = ["state", "src", "fileName"],
|
|
28
|
-
_excluded3 = ["children", "state", "displayTime", "status", "session", "src", "file", "fileName", "sessionDetails"];
|
|
30
|
+
_excluded3 = ["children", "state", "displayTime", "status", "session", "src", "file", "fileName", "sessionDetails", "sessionTimeline"];
|
|
29
31
|
|
|
30
32
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
31
33
|
|
|
@@ -247,9 +249,12 @@ BmChat.Details = function (_ref14) {
|
|
|
247
249
|
file = _ref14.file,
|
|
248
250
|
fileName = _ref14.fileName,
|
|
249
251
|
sessionDetails = _ref14.sessionDetails,
|
|
252
|
+
sessionTimeline = _ref14.sessionTimeline,
|
|
250
253
|
rest = _objectWithoutProperties(_ref14, _excluded3);
|
|
251
254
|
|
|
252
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null,
|
|
255
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, sessionTimeline && /*#__PURE__*/_react.default.createElement(_sessionTimeline.SessionTimeline, _extends({
|
|
256
|
+
message: sessionTimeline.message
|
|
257
|
+
}, rest)), sessionDetails && /*#__PURE__*/_react.default.createElement(_sessionDetails.SessionDetails, _extends({
|
|
253
258
|
time: sessionDetails.time,
|
|
254
259
|
message: sessionDetails.message
|
|
255
260
|
}, rest)), /*#__PURE__*/_react.default.createElement(Details, _extends({
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SessionTimeline = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
|
|
12
|
+
var _colors = require("../../colors");
|
|
13
|
+
|
|
14
|
+
var _excluded = ["message", "time"];
|
|
15
|
+
|
|
16
|
+
var _templateObject, _templateObject2;
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
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 SessionTimelineWrapper = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n text-align: center;\n"])));
|
|
29
|
+
|
|
30
|
+
var container = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-radius: 0.714rem 0.714rem 0.714rem 0.714rem;\n border: 0.071rem solid ", ";\n padding: 0.5rem;\n background-color: ", ";\n"])), _colors.BmBgGreyBlue, _colors.BmSecondaryBlue12);
|
|
31
|
+
|
|
32
|
+
SessionTimelineWrapper.Container = container;
|
|
33
|
+
|
|
34
|
+
var SessionTimeline = function SessionTimeline(_ref) {
|
|
35
|
+
var message = _ref.message,
|
|
36
|
+
time = _ref.time,
|
|
37
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
+
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement(SessionTimelineWrapper, _extends({
|
|
40
|
+
message: message
|
|
41
|
+
}, rest), /*#__PURE__*/_react.default.createElement(SessionTimelineWrapper.Container, null, message || /*#__PURE__*/_react.default.createElement("p", null, "\xA0")));
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.SessionTimeline = SessionTimeline;
|
|
@@ -17,6 +17,8 @@ var _fb = _interopRequireDefault(require("../../assets/fb.png"));
|
|
|
17
17
|
|
|
18
18
|
var _insta = _interopRequireDefault(require("../../assets/insta.png"));
|
|
19
19
|
|
|
20
|
+
var _Google_Messages_logo = _interopRequireDefault(require("../../assets/Google_Messages_logo.png"));
|
|
21
|
+
|
|
20
22
|
var _excluded = ["img", "content", "channel", "size"];
|
|
21
23
|
|
|
22
24
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
@@ -95,6 +97,10 @@ var BmProfileIcon = function BmProfileIcon(_ref) {
|
|
|
95
97
|
size: size,
|
|
96
98
|
src: _insta.default,
|
|
97
99
|
alt: "icon"
|
|
100
|
+
}), channel && channel === 'google_business_messaging' && /*#__PURE__*/_react.default.createElement(Dot, {
|
|
101
|
+
size: size,
|
|
102
|
+
src: _Google_Messages_logo.default,
|
|
103
|
+
alt: "icon"
|
|
98
104
|
})));
|
|
99
105
|
};
|
|
100
106
|
|
|
@@ -19,7 +19,7 @@ var _iconStyles = require("../iconStyles");
|
|
|
19
19
|
|
|
20
20
|
var _colors = require("../colors");
|
|
21
21
|
|
|
22
|
-
var _excluded = ["variant", "size", "disabled", "children", "leadingIcon", "trailingIcon", "color", "closeButton", "onHide"];
|
|
22
|
+
var _excluded = ["variant", "size", "disabled", "children", "leadingIcon", "trailingIcon", "color", "bgColor", "closeButton", "onHide"];
|
|
23
23
|
|
|
24
24
|
var _templateObject;
|
|
25
25
|
|
|
@@ -53,7 +53,7 @@ var Color = function Color(_ref) {
|
|
|
53
53
|
var variant = _ref.variant,
|
|
54
54
|
color = _ref.color;
|
|
55
55
|
|
|
56
|
-
if (variant === 'success' || variant === 'warning' || variant === 'danger') {
|
|
56
|
+
if (variant === 'success' || variant === 'warning' || variant === 'danger' || variant === 'primary') {
|
|
57
57
|
return "".concat(_colors.BmPrimaryWhite);
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -76,13 +76,16 @@ var BeemTag = _styledComponents.default.button(_templateObject || (_templateObje
|
|
|
76
76
|
|
|
77
77
|
return show ? 'flex' : 'none';
|
|
78
78
|
}, function (_ref3) {
|
|
79
|
-
var variant = _ref3.variant
|
|
79
|
+
var variant = _ref3.variant,
|
|
80
|
+
bgColor = _ref3.bgColor;
|
|
81
|
+
if (bgColor && !variant) return bgColor;
|
|
80
82
|
if (variant === 'neutral') return "".concat(_colors.BmGrey100);
|
|
81
83
|
if (variant === 'success') return "".concat(_colors.BmSecondaryDarkGreen);
|
|
82
84
|
if (variant === 'warning') return "".concat(_colors.BmPrimaryGold);
|
|
83
85
|
if (variant === 'danger') return "".concat(_colors.BmSecondaryRed);
|
|
84
86
|
if (variant === 'light') return "".concat(_colors.BmPrimaryWhite);
|
|
85
|
-
if (
|
|
87
|
+
if (variant === 'primary') return "".concat(_colors.BmPrimaryBlue);
|
|
88
|
+
if (!variant && !bgColor) return "".concat(_colors.BmGrey100);
|
|
86
89
|
}, function (_ref4) {
|
|
87
90
|
var variant = _ref4.variant;
|
|
88
91
|
if (variant === 'neutral') return "".concat(_colors.BmGrey100);
|
|
@@ -113,6 +116,7 @@ var BmTag = function BmTag(props) {
|
|
|
113
116
|
leadingIcon = props.leadingIcon,
|
|
114
117
|
trailingIcon = props.trailingIcon,
|
|
115
118
|
color = props.color,
|
|
119
|
+
bgColor = props.bgColor,
|
|
116
120
|
closeButton = props.closeButton,
|
|
117
121
|
onHide = props.onHide,
|
|
118
122
|
rest = _objectWithoutProperties(props, _excluded);
|
|
@@ -124,7 +128,8 @@ var BmTag = function BmTag(props) {
|
|
|
124
128
|
children: children,
|
|
125
129
|
color: color,
|
|
126
130
|
closeButton: closeButton,
|
|
127
|
-
show: toggle
|
|
131
|
+
show: toggle,
|
|
132
|
+
bgColor: bgColor
|
|
128
133
|
}, rest), leadingIcon && /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
129
134
|
disabled: disabled,
|
|
130
135
|
icon: leadingIcon,
|
|
@@ -24,6 +24,12 @@ var _default = {
|
|
|
24
24
|
},
|
|
25
25
|
description: 'Color of the Icons and Text, will work only if variant is not present'
|
|
26
26
|
},
|
|
27
|
+
bgColor: {
|
|
28
|
+
control: {
|
|
29
|
+
type: 'text'
|
|
30
|
+
},
|
|
31
|
+
description: 'Background Color of Tags, will work only if variant is not present'
|
|
32
|
+
},
|
|
27
33
|
closeButton: {
|
|
28
34
|
control: {
|
|
29
35
|
type: 'boolean'
|
|
@@ -44,7 +50,7 @@ var _default = {
|
|
|
44
50
|
}
|
|
45
51
|
},
|
|
46
52
|
variant: {
|
|
47
|
-
options: ['success', 'warning', 'danger', 'light', 'neutral', undefined],
|
|
53
|
+
options: ['success', 'warning', 'danger', 'light', 'neutral', 'primary', undefined],
|
|
48
54
|
control: {
|
|
49
55
|
type: 'select'
|
|
50
56
|
},
|
package/package.json
CHANGED
package/src/App.js
CHANGED
|
@@ -1,8 +1,99 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import AttachFileIcon from '@mui/icons-material/AttachFile';
|
|
4
|
+
import EmojiEmotionsIcon from '@mui/icons-material/EmojiEmotions';
|
|
5
|
+
import SendIcon from '@mui/icons-material/Send';
|
|
6
|
+
import QuickreplyIcon from '@mui/icons-material/Quickreply';
|
|
7
|
+
import {
|
|
8
|
+
BmChat,
|
|
9
|
+
BmInput,
|
|
10
|
+
BmIcons,
|
|
11
|
+
GlobalStyle,
|
|
12
|
+
BmProfileIcon,
|
|
13
|
+
} from './lib/components';
|
|
3
14
|
|
|
4
15
|
const Chat = () => {
|
|
5
|
-
|
|
16
|
+
const image =
|
|
17
|
+
'https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/1225211.jpg?AWSAccessKeyId=AKIAVCAYXA54EPKHSRGL&Expires=1734873821&Signature=ySZ23PaUxUeUVA4lCZCE1RZIrnc%3D';
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
<GlobalStyle />
|
|
21
|
+
<BmProfileIcon channel="google_business_messaging" />
|
|
22
|
+
<BmChat>
|
|
23
|
+
<BmChat.Body>
|
|
24
|
+
<BmChat.Details
|
|
25
|
+
state="inbound"
|
|
26
|
+
session="sms"
|
|
27
|
+
displayTime={<p>12:00pm</p>}
|
|
28
|
+
status="sent"
|
|
29
|
+
sessionTimeline={{
|
|
30
|
+
message: <p>2022-07-28</p>,
|
|
31
|
+
// time: <p>12:00pm</p>,
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
<p>Inbound Text Message</p>
|
|
35
|
+
</BmChat.Details>
|
|
36
|
+
<BmChat.Details
|
|
37
|
+
state="inbound"
|
|
38
|
+
session="live"
|
|
39
|
+
displayTime={<p>12:00pm</p>}
|
|
40
|
+
status="sent"
|
|
41
|
+
fileName={<p>chat.png</p>}
|
|
42
|
+
src={image}
|
|
43
|
+
sessionDetails={{
|
|
44
|
+
message: <h3>Session Message</h3>,
|
|
45
|
+
time: <p>12:00pm</p>,
|
|
46
|
+
}}
|
|
47
|
+
/>
|
|
48
|
+
<BmChat.Details
|
|
49
|
+
state="inbound"
|
|
50
|
+
session="live"
|
|
51
|
+
displayTime={<p>10:00am</p>}
|
|
52
|
+
status="failed"
|
|
53
|
+
fileName={<p>file.csv</p>}
|
|
54
|
+
file={image}
|
|
55
|
+
/>
|
|
56
|
+
<BmChat.Details
|
|
57
|
+
state="outbound"
|
|
58
|
+
session="bot"
|
|
59
|
+
displayTime={<p>12:00pm</p>}
|
|
60
|
+
status="sent"
|
|
61
|
+
>
|
|
62
|
+
<p>Outbound Text Message</p>
|
|
63
|
+
</BmChat.Details>
|
|
64
|
+
<BmChat.Details
|
|
65
|
+
state="outbound"
|
|
66
|
+
session="live"
|
|
67
|
+
displayTime={<p>12:00pm</p>}
|
|
68
|
+
status="sent"
|
|
69
|
+
fileName={<p>chat.png</p>}
|
|
70
|
+
src={image}
|
|
71
|
+
/>
|
|
72
|
+
<BmChat.Details
|
|
73
|
+
state="outbound"
|
|
74
|
+
session="live"
|
|
75
|
+
displayTime={<p>10:00am</p>}
|
|
76
|
+
status="failed"
|
|
77
|
+
fileName={<p>file.csv</p>}
|
|
78
|
+
file={image}
|
|
79
|
+
link={image}
|
|
80
|
+
onDownload={() => {
|
|
81
|
+
alert('hello');
|
|
82
|
+
}}
|
|
83
|
+
/>
|
|
84
|
+
</BmChat.Body>
|
|
85
|
+
<BmChat.Footer>
|
|
86
|
+
<div className="chat-footer">
|
|
87
|
+
<BmIcons icon={<EmojiEmotionsIcon />} size="xlarge" />
|
|
88
|
+
<BmIcons icon={<AttachFileIcon />} size="xlarge" />
|
|
89
|
+
<BmIcons icon={<QuickreplyIcon />} size="xlarge" />
|
|
90
|
+
<BmInput placeholder="Enter Message" style={{ flex: '1' }} />
|
|
91
|
+
<BmIcons icon={<SendIcon />} size="xlarge" />
|
|
92
|
+
</div>
|
|
93
|
+
</BmChat.Footer>
|
|
94
|
+
</BmChat>
|
|
95
|
+
</>
|
|
96
|
+
);
|
|
6
97
|
};
|
|
7
98
|
|
|
8
99
|
export default Chat;
|
|
Binary file
|
|
@@ -7,6 +7,7 @@ import styled from 'styled-components';
|
|
|
7
7
|
import BmAvatar from '../../Avatars/avatars';
|
|
8
8
|
import { BmIcons } from '../../iconStyles';
|
|
9
9
|
import { SessionDetails } from './sessionDetails';
|
|
10
|
+
import { SessionTimeline } from './sessionTimeline';
|
|
10
11
|
import {
|
|
11
12
|
BmPrimaryWhite,
|
|
12
13
|
BmPrimaryBlue,
|
|
@@ -250,10 +251,14 @@ BmChat.Details = ({
|
|
|
250
251
|
file,
|
|
251
252
|
fileName,
|
|
252
253
|
sessionDetails,
|
|
254
|
+
sessionTimeline,
|
|
253
255
|
...rest
|
|
254
256
|
}) => {
|
|
255
257
|
return (
|
|
256
258
|
<>
|
|
259
|
+
{sessionTimeline && (
|
|
260
|
+
<SessionTimeline message={sessionTimeline.message} {...rest} />
|
|
261
|
+
)}
|
|
257
262
|
{sessionDetails && (
|
|
258
263
|
<SessionDetails
|
|
259
264
|
time={sessionDetails.time}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { BmSecondaryBlue12, BmBgGreyBlue } from '../../colors';
|
|
4
|
+
|
|
5
|
+
const SessionTimelineWrapper = styled.div`
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: row;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
align-items: center;
|
|
10
|
+
text-align: center;
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
const container = styled.div`
|
|
14
|
+
border-radius: 0.714rem 0.714rem 0.714rem 0.714rem;
|
|
15
|
+
border: 0.071rem solid ${BmBgGreyBlue};
|
|
16
|
+
padding: 0.5rem;
|
|
17
|
+
background-color: ${BmSecondaryBlue12};
|
|
18
|
+
`;
|
|
19
|
+
SessionTimelineWrapper.Container = container;
|
|
20
|
+
|
|
21
|
+
export const SessionTimeline = ({ message, time, ...rest }) => {
|
|
22
|
+
return (
|
|
23
|
+
<SessionTimelineWrapper message={message} {...rest}>
|
|
24
|
+
<SessionTimelineWrapper.Container>
|
|
25
|
+
{message || <p> </p>}
|
|
26
|
+
</SessionTimelineWrapper.Container>
|
|
27
|
+
</SessionTimelineWrapper>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
@@ -4,6 +4,7 @@ import { BmSecondaryBlue12, BmBgLightBlue } from '../colors';
|
|
|
4
4
|
import wa from '../../assets/wa.png';
|
|
5
5
|
import fb from '../../assets/fb.png';
|
|
6
6
|
import insta from '../../assets/insta.png';
|
|
7
|
+
import gbm from '../../assets/Google_Messages_logo.png';
|
|
7
8
|
|
|
8
9
|
const handleSize = (size) => {
|
|
9
10
|
if (size) {
|
|
@@ -76,6 +77,9 @@ export const BmProfileIcon = ({ img, content, channel, size, ...rest }) => {
|
|
|
76
77
|
{channel && channel === 'instagram' && (
|
|
77
78
|
<Dot size={size} src={insta} alt="icon" />
|
|
78
79
|
)}
|
|
80
|
+
{channel && channel === 'google_business_messaging' && (
|
|
81
|
+
<Dot size={size} src={gbm} alt="icon" />
|
|
82
|
+
)}
|
|
79
83
|
</Profile>
|
|
80
84
|
</>
|
|
81
85
|
);
|
|
@@ -13,10 +13,16 @@ import {
|
|
|
13
13
|
BmGrey100,
|
|
14
14
|
BmGrey400,
|
|
15
15
|
BmPrimaryGold,
|
|
16
|
+
BmPrimaryBlue,
|
|
16
17
|
} from '../colors';
|
|
17
18
|
|
|
18
19
|
const Color = ({ variant, color }) => {
|
|
19
|
-
if (
|
|
20
|
+
if (
|
|
21
|
+
variant === 'success' ||
|
|
22
|
+
variant === 'warning' ||
|
|
23
|
+
variant === 'danger' ||
|
|
24
|
+
variant === 'primary'
|
|
25
|
+
) {
|
|
20
26
|
return `${BmPrimaryWhite}`;
|
|
21
27
|
}
|
|
22
28
|
if (!variant && color) {
|
|
@@ -38,13 +44,15 @@ const BeemTag = styled.button`
|
|
|
38
44
|
align-items: center;
|
|
39
45
|
padding: 0.25rem 0.5rem;
|
|
40
46
|
border-radius: 0.25rem;
|
|
41
|
-
background: ${({ variant }) => {
|
|
47
|
+
background: ${({ variant, bgColor }) => {
|
|
48
|
+
if (bgColor && !variant) return bgColor;
|
|
42
49
|
if (variant === 'neutral') return `${BmGrey100}`;
|
|
43
50
|
if (variant === 'success') return `${BmSecondaryDarkGreen}`;
|
|
44
51
|
if (variant === 'warning') return `${BmPrimaryGold}`;
|
|
45
52
|
if (variant === 'danger') return `${BmSecondaryRed}`;
|
|
46
53
|
if (variant === 'light') return `${BmPrimaryWhite}`;
|
|
47
|
-
if (
|
|
54
|
+
if (variant === 'primary') return `${BmPrimaryBlue}`;
|
|
55
|
+
if (!variant && !bgColor) return `${BmGrey100}`;
|
|
48
56
|
}};
|
|
49
57
|
border: 0.071rem solid
|
|
50
58
|
${({ variant }) => {
|
|
@@ -76,6 +84,7 @@ export const BmTag = (props) => {
|
|
|
76
84
|
leadingIcon,
|
|
77
85
|
trailingIcon,
|
|
78
86
|
color,
|
|
87
|
+
bgColor,
|
|
79
88
|
closeButton,
|
|
80
89
|
onHide,
|
|
81
90
|
...rest
|
|
@@ -90,6 +99,7 @@ export const BmTag = (props) => {
|
|
|
90
99
|
color={color}
|
|
91
100
|
closeButton={closeButton}
|
|
92
101
|
show={toggle}
|
|
102
|
+
bgColor={bgColor}
|
|
93
103
|
{...rest}
|
|
94
104
|
>
|
|
95
105
|
{leadingIcon && (
|
|
@@ -12,6 +12,11 @@ export default {
|
|
|
12
12
|
description:
|
|
13
13
|
'Color of the Icons and Text, will work only if variant is not present',
|
|
14
14
|
},
|
|
15
|
+
bgColor: {
|
|
16
|
+
control: { type: 'text' },
|
|
17
|
+
description:
|
|
18
|
+
'Background Color of Tags, will work only if variant is not present',
|
|
19
|
+
},
|
|
15
20
|
closeButton: {
|
|
16
21
|
control: { type: 'boolean' },
|
|
17
22
|
description: 'Will display (x) - Optional',
|
|
@@ -27,7 +32,15 @@ export default {
|
|
|
27
32
|
defaultValue: { summary: 'small' },
|
|
28
33
|
},
|
|
29
34
|
variant: {
|
|
30
|
-
options: [
|
|
35
|
+
options: [
|
|
36
|
+
'success',
|
|
37
|
+
'warning',
|
|
38
|
+
'danger',
|
|
39
|
+
'light',
|
|
40
|
+
'neutral',
|
|
41
|
+
'primary',
|
|
42
|
+
undefined,
|
|
43
|
+
],
|
|
31
44
|
control: { type: 'select' },
|
|
32
45
|
description: 'Type of tag',
|
|
33
46
|
defaultValue: { summary: 'neutral' },
|