beem-component 2.0.1 → 2.0.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/ChatComponents/FormAccordion/FormAccordion.js +1 -1
- package/dist/components/Tags/tags.js +31 -17
- package/package.json +1 -1
- package/src/App.js +22 -3
- package/src/lib/components/ChatComponents/FormAccordion/FormAccordion.js +1 -1
- package/src/lib/components/Tags/tags.js +36 -26
|
@@ -17,6 +17,6 @@ BmChatForm.Label = _styledComponents.default.div.withConfig({
|
|
|
17
17
|
})(["font-family:'OpenSans';font-size:1rem;margin:0rem;text-align:left;width:50%;overflow:hidden;text-overflow:ellipsis;"]);
|
|
18
18
|
BmChatForm.Input = _styledComponents.default.input.withConfig({
|
|
19
19
|
displayName: "FormAccordion__Input"
|
|
20
|
-
})(["font-family:'OpenSans';font-size:1rem;text-align:
|
|
20
|
+
})(["font-family:'OpenSans';font-size:1rem;text-align:left;width:50%;overflow:hidden;text-overflow:ellipsis;border:none;&:visited,&:active,&:hover,&:focus{outline:none !important;text-decoration:none;}background:transparent;"]);
|
|
21
21
|
var _default = BmChatForm;
|
|
22
22
|
exports.default = _default;
|
|
@@ -11,7 +11,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
var _icons = require("@material-ui/icons");
|
|
12
12
|
var _iconStyles = require("../iconStyles");
|
|
13
13
|
var _colors = require("../colors");
|
|
14
|
-
var _excluded = ["variant", "size", "disabled", "children", "leadingIcon", "trailingIcon", "color", "textColor", "bgColor", "closeButton", "onHide"];
|
|
14
|
+
var _excluded = ["variant", "size", "disabled", "children", "leadingIcon", "trailingIcon", "color", "textColor", "bgColor", "closeButton", "dot", "onHide"];
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
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); }
|
|
17
17
|
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; }
|
|
@@ -31,9 +31,10 @@ var Color = function Color(_ref) {
|
|
|
31
31
|
if (textColor) {
|
|
32
32
|
return textColor;
|
|
33
33
|
}
|
|
34
|
-
if (variant === 'success'
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
if (variant === 'success') return "#17b26a";
|
|
35
|
+
if (variant === 'warning') return "#f79009";
|
|
36
|
+
if (variant === 'danger') return "#f04438";
|
|
37
|
+
if (variant === 'primary') return "".concat(_colors.BmPrimaryWhite);
|
|
37
38
|
if (!variant && color) {
|
|
38
39
|
return color;
|
|
39
40
|
}
|
|
@@ -41,7 +42,7 @@ var Color = function Color(_ref) {
|
|
|
41
42
|
};
|
|
42
43
|
var BeemTag = _styledComponents.default.button.withConfig({
|
|
43
44
|
displayName: "tags__BeemTag"
|
|
44
|
-
})(["", " display:", ";flex-direction:row;justify-content:center;align-items:center;padding:0.
|
|
45
|
+
})(["", " display:", ";flex-direction:row;justify-content:center;align-items:center;padding:0.2143rem 0.5714rem;border-radius:0.4286rem;background:", ";border:0.1071rem solid ", ";> *{color:", ";text-transform:capitalize;}> *:not(:last-child){margin-right:0.5rem;}"], '' /* display: flex; */, function (_ref2) {
|
|
45
46
|
var closeButton = _ref2.closeButton,
|
|
46
47
|
show = _ref2.show;
|
|
47
48
|
if (!closeButton) {
|
|
@@ -49,24 +50,22 @@ var BeemTag = _styledComponents.default.button.withConfig({
|
|
|
49
50
|
}
|
|
50
51
|
return show ? 'flex' : 'none';
|
|
51
52
|
}, function (_ref3) {
|
|
52
|
-
var variant = _ref3.variant
|
|
53
|
-
bgColor = _ref3.bgColor;
|
|
54
|
-
if (bgColor && !variant) return bgColor;
|
|
53
|
+
var variant = _ref3.variant;
|
|
55
54
|
if (variant === 'neutral') return "".concat(_colors.BmGrey100);
|
|
56
|
-
if (variant === 'success') return ""
|
|
57
|
-
if (variant === 'warning') return ""
|
|
58
|
-
if (variant === 'danger') return ""
|
|
55
|
+
if (variant === 'success') return "#dcfac6";
|
|
56
|
+
if (variant === 'warning') return "#fef0c7";
|
|
57
|
+
if (variant === 'danger') return "#fee4e2";
|
|
59
58
|
if (variant === 'light') return "".concat(_colors.BmPrimaryWhite);
|
|
60
59
|
if (variant === 'primary') return "".concat(_colors.BmPrimaryBlue);
|
|
61
|
-
if (!variant
|
|
60
|
+
if (!variant) return "white";
|
|
62
61
|
}, function (_ref4) {
|
|
63
62
|
var variant = _ref4.variant;
|
|
64
63
|
if (variant === 'neutral') return "".concat(_colors.BmGrey100);
|
|
65
|
-
if (variant === 'success') return ""
|
|
66
|
-
if (variant === 'warning') return ""
|
|
67
|
-
if (variant === 'danger') return ""
|
|
64
|
+
if (variant === 'success') return "#47cd89";
|
|
65
|
+
if (variant === 'warning') return "#fdb022";
|
|
66
|
+
if (variant === 'danger') return "#f97066";
|
|
68
67
|
if (variant === 'light') return "".concat(_colors.BmGrey400);
|
|
69
|
-
return ""
|
|
68
|
+
return "#d0d5dd";
|
|
70
69
|
}, function (_ref5) {
|
|
71
70
|
var variant = _ref5.variant,
|
|
72
71
|
color = _ref5.color,
|
|
@@ -77,6 +76,17 @@ var BeemTag = _styledComponents.default.button.withConfig({
|
|
|
77
76
|
textColor: textColor
|
|
78
77
|
});
|
|
79
78
|
});
|
|
79
|
+
var Dot = _styledComponents.default.div.withConfig({
|
|
80
|
+
displayName: "tags__Dot"
|
|
81
|
+
})(["width:6px;height:6px;background-color:", ";border-radius:50%;"], function (_ref6) {
|
|
82
|
+
var bgColor = _ref6.bgColor,
|
|
83
|
+
variant = _ref6.variant;
|
|
84
|
+
if (variant === 'success') return "#47cd89";
|
|
85
|
+
if (variant === 'warning') return "#fdb022";
|
|
86
|
+
if (variant === 'danger') return "#f97066";
|
|
87
|
+
if (bgColor) return bgColor;
|
|
88
|
+
return '#344054';
|
|
89
|
+
});
|
|
80
90
|
var BmTag = function BmTag(props) {
|
|
81
91
|
var _useState = (0, _react.useState)(true),
|
|
82
92
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -92,6 +102,7 @@ var BmTag = function BmTag(props) {
|
|
|
92
102
|
textColor = props.textColor,
|
|
93
103
|
bgColor = props.bgColor,
|
|
94
104
|
closeButton = props.closeButton,
|
|
105
|
+
dot = props.dot,
|
|
95
106
|
onHide = props.onHide,
|
|
96
107
|
rest = _objectWithoutProperties(props, _excluded);
|
|
97
108
|
return /*#__PURE__*/_react.default.createElement(BeemTag, _extends({
|
|
@@ -113,6 +124,9 @@ var BmTag = function BmTag(props) {
|
|
|
113
124
|
variant: variant
|
|
114
125
|
}),
|
|
115
126
|
size: size || 'small'
|
|
127
|
+
}), dot && /*#__PURE__*/_react.default.createElement(Dot, {
|
|
128
|
+
variant: variant,
|
|
129
|
+
bgColor: bgColor
|
|
116
130
|
}), children, trailingIcon && /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
117
131
|
icon: trailingIcon,
|
|
118
132
|
disabled: disabled,
|
|
@@ -127,7 +141,7 @@ var BmTag = function BmTag(props) {
|
|
|
127
141
|
color: color,
|
|
128
142
|
variant: variant
|
|
129
143
|
}),
|
|
130
|
-
size: size || '
|
|
144
|
+
size: size || 'xsmall',
|
|
131
145
|
style: {
|
|
132
146
|
marginLeft: 'auto'
|
|
133
147
|
},
|
package/package.json
CHANGED
package/src/App.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/* eslint-disable jsx-a11y/media-has-caption */
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
4
|
// import AbcIcon from '@mui/icons-material/Abc';
|
|
5
|
+
// import CircleIcon from '@mui/icons-material/Circle';
|
|
5
6
|
|
|
6
7
|
import {
|
|
7
8
|
BmChat,
|
|
@@ -188,7 +189,9 @@ const Chat = () => {
|
|
|
188
189
|
<BmCounter>10</BmCounter>
|
|
189
190
|
</BmContactCard.SubDetails>
|
|
190
191
|
<BmContactCard.SubDetails>
|
|
191
|
-
<BmTag variant="success">
|
|
192
|
+
<BmTag dot variant="success">
|
|
193
|
+
<p>{ms.id}</p>
|
|
194
|
+
</BmTag>
|
|
192
195
|
<p>10:00 am</p>
|
|
193
196
|
</BmContactCard.SubDetails>
|
|
194
197
|
</BmContactCard.Details>
|
|
@@ -223,7 +226,8 @@ const Chat = () => {
|
|
|
223
226
|
<h3>Information</h3>
|
|
224
227
|
</BmAccordion.Title>
|
|
225
228
|
<BmAccordion.Body>
|
|
226
|
-
<BmChatForm>
|
|
229
|
+
{/* <BmChatForm> */}
|
|
230
|
+
<div>
|
|
227
231
|
<BmChatForm.Group>
|
|
228
232
|
<BmChatForm.Label>
|
|
229
233
|
<h4>Account No.</h4>
|
|
@@ -236,9 +240,24 @@ const Chat = () => {
|
|
|
236
240
|
</BmChatForm.Label>
|
|
237
241
|
<BmChatForm.Input placeholder="Enter here" />
|
|
238
242
|
</BmChatForm.Group>
|
|
239
|
-
</
|
|
243
|
+
</div>
|
|
244
|
+
{/* </BmChatForm> */}
|
|
240
245
|
</BmAccordion.Body>
|
|
241
246
|
</BmAccordion>
|
|
247
|
+
<BmTag
|
|
248
|
+
// variant="danger"
|
|
249
|
+
// textColor="#17b26a"
|
|
250
|
+
bgColor="#17b26a"
|
|
251
|
+
// color="black"
|
|
252
|
+
closeButton
|
|
253
|
+
dot
|
|
254
|
+
// size="xsmall"
|
|
255
|
+
>
|
|
256
|
+
<p>Pending</p>
|
|
257
|
+
</BmTag>
|
|
258
|
+
<BmTag dot closeButton>
|
|
259
|
+
<p>Bot</p>
|
|
260
|
+
</BmTag>
|
|
242
261
|
</div>
|
|
243
262
|
</>
|
|
244
263
|
);
|
|
@@ -7,12 +7,12 @@ import { Clear } from '@material-ui/icons';
|
|
|
7
7
|
import { BmIcons } from '../iconStyles';
|
|
8
8
|
import {
|
|
9
9
|
BmPrimaryWhite,
|
|
10
|
-
BmSecondaryDarkGreen,
|
|
11
|
-
BmSecondaryRed,
|
|
10
|
+
// BmSecondaryDarkGreen,
|
|
11
|
+
// BmSecondaryRed,
|
|
12
12
|
BmPrimaryBlack,
|
|
13
13
|
BmGrey100,
|
|
14
14
|
BmGrey400,
|
|
15
|
-
BmPrimaryGold,
|
|
15
|
+
// BmPrimaryGold,
|
|
16
16
|
BmPrimaryBlue,
|
|
17
17
|
} from '../colors';
|
|
18
18
|
|
|
@@ -20,14 +20,11 @@ const Color = ({ variant, color, textColor }) => {
|
|
|
20
20
|
if (textColor) {
|
|
21
21
|
return textColor;
|
|
22
22
|
}
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
) {
|
|
29
|
-
return `${BmPrimaryWhite}`;
|
|
30
|
-
}
|
|
23
|
+
if (variant === 'success') return `#17b26a`;
|
|
24
|
+
if (variant === 'warning') return `#f79009`;
|
|
25
|
+
if (variant === 'danger') return `#f04438`;
|
|
26
|
+
if (variant === 'primary') return `${BmPrimaryWhite}`;
|
|
27
|
+
|
|
31
28
|
if (!variant && color) {
|
|
32
29
|
return color;
|
|
33
30
|
}
|
|
@@ -45,37 +42,48 @@ const BeemTag = styled.button`
|
|
|
45
42
|
flex-direction: row;
|
|
46
43
|
justify-content: center;
|
|
47
44
|
align-items: center;
|
|
48
|
-
padding: 0.
|
|
49
|
-
border-radius: 0.
|
|
50
|
-
background: ${({ variant
|
|
51
|
-
if (bgColor && !variant) return bgColor;
|
|
45
|
+
padding: 0.2143rem 0.5714rem;
|
|
46
|
+
border-radius: 0.4286rem;
|
|
47
|
+
background: ${({ variant }) => {
|
|
52
48
|
if (variant === 'neutral') return `${BmGrey100}`;
|
|
53
|
-
if (variant === 'success') return
|
|
54
|
-
if (variant === 'warning') return
|
|
55
|
-
if (variant === 'danger') return
|
|
49
|
+
if (variant === 'success') return `#dcfac6`;
|
|
50
|
+
if (variant === 'warning') return `#fef0c7`;
|
|
51
|
+
if (variant === 'danger') return `#fee4e2`;
|
|
56
52
|
if (variant === 'light') return `${BmPrimaryWhite}`;
|
|
57
53
|
if (variant === 'primary') return `${BmPrimaryBlue}`;
|
|
58
|
-
if (!variant
|
|
54
|
+
if (!variant) return `white`;
|
|
59
55
|
}};
|
|
60
|
-
border: 0.
|
|
56
|
+
border: 0.1071rem solid
|
|
61
57
|
${({ variant }) => {
|
|
62
58
|
if (variant === 'neutral') return `${BmGrey100}`;
|
|
63
|
-
if (variant === 'success') return
|
|
64
|
-
if (variant === 'warning') return
|
|
65
|
-
if (variant === 'danger') return
|
|
59
|
+
if (variant === 'success') return `#47cd89`;
|
|
60
|
+
if (variant === 'warning') return `#fdb022`;
|
|
61
|
+
if (variant === 'danger') return `#f97066`;
|
|
66
62
|
if (variant === 'light') return `${BmGrey400}`;
|
|
67
|
-
return
|
|
63
|
+
return `#d0d5dd`;
|
|
68
64
|
}};
|
|
69
65
|
> * {
|
|
70
66
|
color: ${({ variant, color, textColor }) =>
|
|
71
67
|
Color({ variant, color, textColor })};
|
|
72
|
-
text-transform:
|
|
68
|
+
text-transform: capitalize;
|
|
73
69
|
}
|
|
74
70
|
|
|
75
71
|
> *:not(:last-child) {
|
|
76
72
|
margin-right: 0.5rem;
|
|
77
73
|
}
|
|
78
74
|
`;
|
|
75
|
+
const Dot = styled.div`
|
|
76
|
+
width: 6px;
|
|
77
|
+
height: 6px;
|
|
78
|
+
background-color: ${({ bgColor, variant }) => {
|
|
79
|
+
if (variant === 'success') return `#47cd89`;
|
|
80
|
+
if (variant === 'warning') return `#fdb022`;
|
|
81
|
+
if (variant === 'danger') return `#f97066`;
|
|
82
|
+
if (bgColor) return bgColor;
|
|
83
|
+
return '#344054';
|
|
84
|
+
}};
|
|
85
|
+
border-radius: 50%;
|
|
86
|
+
`;
|
|
79
87
|
|
|
80
88
|
export const BmTag = (props) => {
|
|
81
89
|
const [toggle, setToggle] = useState(true);
|
|
@@ -91,6 +99,7 @@ export const BmTag = (props) => {
|
|
|
91
99
|
textColor,
|
|
92
100
|
bgColor,
|
|
93
101
|
closeButton,
|
|
102
|
+
dot,
|
|
94
103
|
onHide,
|
|
95
104
|
...rest
|
|
96
105
|
} = props;
|
|
@@ -117,6 +126,7 @@ export const BmTag = (props) => {
|
|
|
117
126
|
size={size || 'small'}
|
|
118
127
|
/>
|
|
119
128
|
)}
|
|
129
|
+
{dot && <Dot variant={variant} bgColor={bgColor} />}
|
|
120
130
|
{children}
|
|
121
131
|
{trailingIcon && (
|
|
122
132
|
<BmIcons
|
|
@@ -130,7 +140,7 @@ export const BmTag = (props) => {
|
|
|
130
140
|
<BmIcons
|
|
131
141
|
icon={<Clear />}
|
|
132
142
|
color={Color({ color, variant })}
|
|
133
|
-
size={size || '
|
|
143
|
+
size={size || 'xsmall'}
|
|
134
144
|
style={{ marginLeft: 'auto' }}
|
|
135
145
|
onClick={() => onHide && onHide(setToggle(!toggle))}
|
|
136
146
|
/>
|