beem-component 1.6.6 → 1.6.9

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.
@@ -149,7 +149,7 @@ BmModal.Footer = _styledComponents.default.div(_templateObject7 || (_templateObj
149
149
  BmModal.propTypes = {
150
150
  size: _propTypes.default.string,
151
151
  centered: _propTypes.default.bool,
152
- show: _propTypes.default.bool.isRequired,
152
+ show: _propTypes.default.bool,
153
153
  onHide: _propTypes.default.func.isRequired,
154
154
  closeButton: _propTypes.default.bool
155
155
  };
@@ -81,16 +81,20 @@ var BmProfileIcon = function BmProfileIcon(_ref) {
81
81
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Profile, _extends({
82
82
  size: size
83
83
  }, rest), content && !img && /*#__PURE__*/_react.default.createElement(Content, null, content), img && !content && /*#__PURE__*/_react.default.createElement(ProfileImg, {
84
- src: img
84
+ src: img,
85
+ alt: "profileicon"
85
86
  }), channel && channel === 'whatsapp' && /*#__PURE__*/_react.default.createElement(Dot, {
86
87
  size: size,
87
- src: _wa.default
88
+ src: _wa.default,
89
+ alt: "icon"
88
90
  }), channel && channel === 'facebook' && /*#__PURE__*/_react.default.createElement(Dot, {
89
91
  size: size,
90
- src: _fb.default
92
+ src: _fb.default,
93
+ alt: "icon"
91
94
  }), channel && channel === 'instagram' && /*#__PURE__*/_react.default.createElement(Dot, {
92
95
  size: size,
93
- src: _insta.default
96
+ src: _insta.default,
97
+ alt: "icon"
94
98
  })));
95
99
  };
96
100
 
@@ -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 (!variant) return "".concat(_colors.BmGrey100);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beem-component",
3
- "version": "1.6.6",
3
+ "version": "1.6.9",
4
4
  "private": false,
5
5
  "main": "dist/components/index.js",
6
6
  "scripts": {
@@ -52,9 +52,10 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@babel/cli": "^7.16.0",
55
- "@babel/core": "^7.16.0",
55
+ "@babel/core": "^7.17.8",
56
+ "@babel/eslint-parser": "^7.18.2",
56
57
  "@babel/preset-env": "^7.14.8",
57
- "@babel/preset-react": "^7.14.5",
58
+ "@babel/preset-react": "^7.18.6",
58
59
  "@commitlint/cli": "^14.1.0",
59
60
  "@commitlint/config-conventional": "^14.1.0",
60
61
  "@commitlint/travis-cli": "^14.1.0",
package/src/App.js CHANGED
@@ -1,8 +1,12 @@
1
1
  import React from 'react';
2
- import { BmButton } from './lib/components';
2
+ import { BmTag } from './lib/components';
3
3
 
4
4
  const Chat = () => {
5
- return <BmButton type="submit">Hello</BmButton>;
5
+ return (
6
+ <BmTag bgColor="red" variant="primary" color="white">
7
+ <p>Hello</p>
8
+ </BmTag>
9
+ );
6
10
  };
7
11
 
8
12
  export default Chat;
@@ -164,7 +164,7 @@ BmModal.Footer = styled.div`
164
164
  BmModal.propTypes = {
165
165
  size: PropTypes.string,
166
166
  centered: PropTypes.bool,
167
- show: PropTypes.bool.isRequired,
167
+ show: PropTypes.bool,
168
168
  onHide: PropTypes.func.isRequired,
169
169
  closeButton: PropTypes.bool,
170
170
  };
@@ -66,10 +66,16 @@ export const BmProfileIcon = ({ img, content, channel, size, ...rest }) => {
66
66
  <>
67
67
  <Profile size={size} {...rest}>
68
68
  {content && !img && <Content>{content}</Content>}
69
- {img && !content && <ProfileImg src={img} />}
70
- {channel && channel === 'whatsapp' && <Dot size={size} src={wa} />}
71
- {channel && channel === 'facebook' && <Dot size={size} src={fb} />}
72
- {channel && channel === 'instagram' && <Dot size={size} src={insta} />}
69
+ {img && !content && <ProfileImg src={img} alt="profileicon" />}
70
+ {channel && channel === 'whatsapp' && (
71
+ <Dot size={size} src={wa} alt="icon" />
72
+ )}
73
+ {channel && channel === 'facebook' && (
74
+ <Dot size={size} src={fb} alt="icon" />
75
+ )}
76
+ {channel && channel === 'instagram' && (
77
+ <Dot size={size} src={insta} alt="icon" />
78
+ )}
73
79
  </Profile>
74
80
  </>
75
81
  );
@@ -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 (variant === 'success' || variant === 'warning' || variant === 'danger') {
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 (!variant) return `${BmGrey100}`;
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: ['success', 'warning', 'danger', 'light', 'neutral', undefined],
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' },