@synerise/ds-badge 0.5.4 → 0.5.5

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.5.5](https://github.com/Synerise/synerise-design/compare/@synerise/ds-badge@0.5.4...@synerise/ds-badge@0.5.5) (2021-12-22)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **badge:** add customColor prop ([60c12d1](https://github.com/Synerise/synerise-design/commit/60c12d1592072dab0e71bcafe50943d934a82103))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [0.5.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-badge@0.5.3...@synerise/ds-badge@0.5.4) (2021-11-23)
7
18
 
8
19
  **Note:** Version bump only for package @synerise/ds-badge
package/dist/Badge.js CHANGED
@@ -1,4 +1,4 @@
1
- var _excluded = ["flag", "outlined", "backgroundColor", "textColor", "backgroundColorHue", "textColorHue", "pulsing"];
1
+ var _excluded = ["flag", "outlined", "backgroundColor", "textColor", "backgroundColorHue", "textColorHue", "pulsing", "customColor"];
2
2
 
3
3
  function _extends() { _extends = Object.assign || 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); }
4
4
 
@@ -17,6 +17,7 @@ var Badge = function Badge(_ref) {
17
17
  backgroundColorHue = _ref.backgroundColorHue,
18
18
  textColorHue = _ref.textColorHue,
19
19
  pulsing = _ref.pulsing,
20
+ customColor = _ref.customColor,
20
21
  antdProps = _objectWithoutPropertiesLoose(_ref, _excluded);
21
22
 
22
23
  return (
@@ -29,7 +30,8 @@ var Badge = function Badge(_ref) {
29
30
  textColor: textColor,
30
31
  backgroundColorHue: backgroundColorHue,
31
32
  textColorHue: textColorHue,
32
- pulsing: pulsing
33
+ pulsing: pulsing,
34
+ customColor: customColor
33
35
  }, antdProps))
34
36
  );
35
37
  };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export declare const afterElementAnimation: import("styled-components").Keyframes;
3
3
  export declare const beforeElementAnimation: import("styled-components").Keyframes;
4
- declare const _default: import("styled-components").StyledComponent<({ flag, outlined, backgroundColor, textColor, backgroundColorHue, textColorHue, pulsing, ...rest }: any) => JSX.Element, any, {}, never>;
4
+ declare const _default: import("styled-components").StyledComponent<({ flag, outlined, backgroundColor, textColor, backgroundColorHue, textColorHue, pulsing, customColor, ...rest }: any) => JSX.Element, any, {}, never>;
5
5
  export default _default;
@@ -1,4 +1,4 @@
1
- var _excluded = ["flag", "outlined", "backgroundColor", "textColor", "backgroundColorHue", "textColorHue", "pulsing"];
1
+ var _excluded = ["flag", "outlined", "backgroundColor", "textColor", "backgroundColorHue", "textColorHue", "pulsing", "customColor"];
2
2
 
3
3
  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; }
4
4
 
@@ -24,6 +24,7 @@ export default styled(function (_ref) {
24
24
  backgroundColorHue = _ref.backgroundColorHue,
25
25
  textColorHue = _ref.textColorHue,
26
26
  pulsing = _ref.pulsing,
27
+ customColor = _ref.customColor,
27
28
  rest = _objectWithoutPropertiesLoose(_ref, _excluded);
28
29
 
29
30
  return /*#__PURE__*/React.createElement(Badge, rest);
@@ -35,5 +36,5 @@ export default styled(function (_ref) {
35
36
  }, function (props) {
36
37
  return props.theme.palette[props.textColor + "-" + props.textColorHue];
37
38
  }, function (props) {
38
- return css(["", " ", " ", " ", " ", " ", ";"], props.status === 'active' && css([".ant-badge-status-active{background-color:", ";}"], props.theme.palette['green-600']), props.status === 'inactive' && css([".ant-badge-status-inactive{background-color:", ";}"], props.theme.palette['grey-400']), props.status === 'blocked' && css([".ant-badge-status-blocked{background-color:", ";}"], props.theme.palette['red-600']), props.status === 'processing' && css([".ant-badge-status-processing{background-color:", ";}"], props.theme.palette['blue-600']), props.outlined && css([".ant-badge-count{box-shadow:0 0 0 1px ", ";}"], props.theme.palette.white), (!!props.flag || !!props.status) && css([".ant-badge-dot{box-shadow:none;&.ant-badge-status-processing{display:inline-block;position:absolute;}}.ant-badge-dot,.ant-badge-status-dot{overflow:visible;border:2px solid ", ";width:10px;height:10px;&::before{display:flex;content:", ";transform:translate3d(-2px,-2px,0);", " transform-origin:center;}&::after{display:flex;content:", ";transform:translate3d(-5px,-5px,0);", " transform-origin:center;}}"], props.theme.palette.white, props.flag ? '""' : 'none', props.pulsing && css(["animation:", " 2s infinite;position:absolute;top:0;left:0;width:10px;height:10px;background-color:inherit;border-radius:50%;"], beforeElementAnimation), props.flag ? '""' : 'none', props.pulsing && css(["animation:", " 2s infinite;position:absolute;top:0;left:0;width:16px;height:16px;background-color:inherit;border-radius:50%;"], afterElementAnimation)));
39
+ return css(["", " ", " ", " ", " ", " ", " ", ";"], props.status === 'active' && !props.customColor && css([".ant-badge-status-active{background-color:", ";}"], props.theme.palette['green-600']), props.customColor && css([".ant-badge-dot,.ant-badge-status-dot{background-color:", ";}"], props.theme.palette[props.customColor + "-600"]), props.status === 'inactive' && !props.customColor && css([".ant-badge-status-inactive{background-color:", ";}"], props.theme.palette['grey-400']), props.status === 'blocked' && !props.customColor && css([".ant-badge-status-blocked{background-color:", ";}"], props.theme.palette['red-600']), props.status === 'processing' && !props.customColor && css([".ant-badge-status-processing{background-color:", ";}"], props.theme.palette['blue-600']), props.outlined && css([".ant-badge-count{box-shadow:0 0 0 1px ", ";}"], props.theme.palette.white), (!!props.flag || !!props.status) && css([".ant-badge-dot{box-shadow:none;&.ant-badge-status-processing{display:inline-block;position:absolute;}}.ant-badge-dot,.ant-badge-status-dot{overflow:visible;border:2px solid ", ";width:10px;height:10px;&::before{display:flex;content:", ";transform:translate3d(-2px,-2px,0);", " transform-origin:center;}&::after{display:flex;content:", ";transform:translate3d(-5px,-5px,0);", " transform-origin:center;}}"], props.theme.palette.white, props.flag ? '""' : 'none', props.pulsing && css(["animation:", " 2s infinite;position:absolute;top:0;left:0;width:10px;height:10px;background-color:inherit;border-radius:50%;"], beforeElementAnimation), props.flag ? '""' : 'none', props.pulsing && css(["animation:", " 2s infinite;position:absolute;top:0;left:0;width:16px;height:16px;background-color:inherit;border-radius:50%;"], afterElementAnimation)));
39
40
  });
@@ -11,4 +11,5 @@ export interface BadgeProps extends Omit<AntBadgeProps, 'status'> {
11
11
  backgroundColorHue?: ColorHue;
12
12
  textColorHue?: ColorHue;
13
13
  pulsing?: boolean;
14
+ customColor?: Color;
14
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-badge",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "Badge UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -42,5 +42,5 @@
42
42
  "devDependencies": {
43
43
  "@synerise/ds-utils": "^0.21.4"
44
44
  },
45
- "gitHead": "3e5f807c3c9ce7bbcb707b1e229ad5d7ef50d830"
45
+ "gitHead": "a89cd14cdbe25b06949b3b9763e58a080111c160"
46
46
  }