@synerise/ds-badge 0.5.2 → 0.5.6
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 +35 -0
- package/dist/Badge.js +5 -5
- package/dist/Badge.styles.d.ts +1 -1
- package/dist/Badge.styles.js +6 -7
- package/dist/Badge.types.d.ts +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,41 @@
|
|
|
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.6](https://github.com/Synerise/synerise-design/compare/@synerise/ds-badge@0.5.5...@synerise/ds-badge@0.5.6) (2021-12-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-badge
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [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)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **badge:** add customColor prop ([60c12d1](https://github.com/Synerise/synerise-design/commit/60c12d1592072dab0e71bcafe50943d934a82103))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [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)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @synerise/ds-badge
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [0.5.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-badge@0.5.2...@synerise/ds-badge@0.5.3) (2021-11-22)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @synerise/ds-badge
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
6
41
|
## [0.5.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-badge@0.5.1...@synerise/ds-badge@0.5.2) (2021-11-16)
|
|
7
42
|
|
|
8
43
|
**Note:** Version bump only for package @synerise/ds-badge
|
package/dist/Badge.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
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
|
|
|
5
|
-
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; }
|
|
6
|
-
|
|
7
5
|
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; }
|
|
8
6
|
|
|
9
7
|
import * as React from 'react';
|
|
@@ -19,7 +17,8 @@ var Badge = function Badge(_ref) {
|
|
|
19
17
|
backgroundColorHue = _ref.backgroundColorHue,
|
|
20
18
|
textColorHue = _ref.textColorHue,
|
|
21
19
|
pulsing = _ref.pulsing,
|
|
22
|
-
|
|
20
|
+
customColor = _ref.customColor,
|
|
21
|
+
antdProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
23
22
|
|
|
24
23
|
return (
|
|
25
24
|
/*#__PURE__*/
|
|
@@ -31,7 +30,8 @@ var Badge = function Badge(_ref) {
|
|
|
31
30
|
textColor: textColor,
|
|
32
31
|
backgroundColorHue: backgroundColorHue,
|
|
33
32
|
textColorHue: textColorHue,
|
|
34
|
-
pulsing: pulsing
|
|
33
|
+
pulsing: pulsing,
|
|
34
|
+
customColor: customColor
|
|
35
35
|
}, antdProps))
|
|
36
36
|
);
|
|
37
37
|
};
|
package/dist/Badge.styles.d.ts
CHANGED
|
@@ -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;
|
package/dist/Badge.styles.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
var _excluded = ["flag", "outlined", "backgroundColor", "textColor", "backgroundColorHue", "textColorHue", "pulsing"];
|
|
2
|
-
|
|
3
|
-
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; }
|
|
1
|
+
var _excluded = ["flag", "outlined", "backgroundColor", "textColor", "backgroundColorHue", "textColorHue", "pulsing", "customColor"];
|
|
4
2
|
|
|
5
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; }
|
|
6
4
|
|
|
@@ -12,7 +10,7 @@ import { macro } from '@synerise/ds-typography';
|
|
|
12
10
|
var getBackgroundColor = function getBackgroundColor(props) {
|
|
13
11
|
if (props.backgroundColor === 'transparent') return 'transparent';
|
|
14
12
|
if (props.backgroundColor === 'white') return props.theme.palette.white;
|
|
15
|
-
return props.theme.palette[
|
|
13
|
+
return props.theme.palette[props.backgroundColor + "-" + props.backgroundColorHue];
|
|
16
14
|
};
|
|
17
15
|
|
|
18
16
|
export var afterElementAnimation = keyframes(["0%{transform:translate3d(-5px,-5px,0) scale(0.3);opacity:0.9;}100%{transform:translate3d(-5px,-5px,0) scale(1.5);opacity:0;}"]);
|
|
@@ -26,7 +24,8 @@ export default styled(function (_ref) {
|
|
|
26
24
|
backgroundColorHue = _ref.backgroundColorHue,
|
|
27
25
|
textColorHue = _ref.textColorHue,
|
|
28
26
|
pulsing = _ref.pulsing,
|
|
29
|
-
|
|
27
|
+
customColor = _ref.customColor,
|
|
28
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
30
29
|
|
|
31
30
|
return /*#__PURE__*/React.createElement(Badge, rest);
|
|
32
31
|
}).withConfig({
|
|
@@ -35,7 +34,7 @@ export default styled(function (_ref) {
|
|
|
35
34
|
})(["&&{.ant-scroll-number-only{height:16px;&:last-of-type:not(:first-of-type) > p{padding-right:1px;}& > p{", ";color:inherit;line-height:16px;height:16px;font-weight:400;}}.ant-badge-count{box-shadow:none;height:16px;padding:0 3px;line-height:16px;min-width:16px;font-size:13px;background-color:", ";color:", ";}", ""], macro.h200, function (props) {
|
|
36
35
|
return getBackgroundColor(props);
|
|
37
36
|
}, function (props) {
|
|
38
|
-
return props.theme.palette[
|
|
37
|
+
return props.theme.palette[props.textColor + "-" + props.textColorHue];
|
|
39
38
|
}, function (props) {
|
|
40
|
-
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)));
|
|
41
40
|
});
|
package/dist/Badge.types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-badge",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "Badge UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-typography": "^0.12.
|
|
35
|
+
"@synerise/ds-typography": "^0.12.2"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@synerise/ds-core": "*",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"react": ">=16.9.0 < 17.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@synerise/ds-utils": "^0.21.
|
|
43
|
+
"@synerise/ds-utils": "^0.21.5"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "7ddae11318ca2906145c9f48e74df41ca5f15d49"
|
|
46
46
|
}
|