@synerise/ds-badge 1.0.18 → 1.0.19
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 +8 -0
- package/README.md +0 -10
- package/dist/index.d.ts +0 -2
- package/dist/index.js +1 -2
- package/package.json +2 -2
- package/dist/IconBadge/IconBadge.constants.d.ts +0 -3
- package/dist/IconBadge/IconBadge.constants.js +0 -21
- package/dist/IconBadge/IconBadge.d.ts +0 -3
- package/dist/IconBadge/IconBadge.js +0 -18
- package/dist/IconBadge/IconBadge.spec.d.ts +0 -1
- package/dist/IconBadge/IconBadge.styles.d.ts +0 -5
- package/dist/IconBadge/IconBadge.styles.js +0 -17
- package/dist/IconBadge/IconBadge.types.d.ts +0 -11
- package/dist/IconBadge/IconBadge.types.js +0 -1
- package/dist/IconBadge/IconBadge.utils.d.ts +0 -4
- package/dist/IconBadge/IconBadge.utils.js +0 -15
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [1.0.19](https://github.com/Synerise/synerise-design/compare/@synerise/ds-badge@1.0.18...@synerise/ds-badge@1.0.19) (2025-08-20)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-badge
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [1.0.18](https://github.com/Synerise/synerise-design/compare/@synerise/ds-badge@1.0.17...@synerise/ds-badge@1.0.18) (2025-08-14)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-badge
|
package/README.md
CHANGED
|
@@ -94,13 +94,3 @@ import Badge from '@synerise/ds-badge'
|
|
|
94
94
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
95
95
|
| `green` / `grey` / `yellow` / `blue` / `pink`/ `mars`/ `orange`/ `fern`/ `cyan`/ `purple` / `violet` / `blue-600` / `green-600` / `mars-600` / `purple-600` / `cyan-600` / `yellow-600` / `violet-600` / `blue-700` / `green-700` / `mars-700` / `purple-700` / `cyan-700` / `yellow-700` / `violet-700` / `blue-500` / `green-500` / `mars-500` / `purple-500` / `cyan-500` / `yellow-500` / `violet-500` |
|
|
96
96
|
|
|
97
|
-
### IconBadge
|
|
98
|
-
|
|
99
|
-
Displays a predefined (depending on status) or custom icon as badge
|
|
100
|
-
|
|
101
|
-
| Property | Description | Type | Default |
|
|
102
|
-
| -------- | ------------------------- | ------------------------------------------------------------ | ------- |
|
|
103
|
-
| status | Set badge as a status dot | `active` / `inactive` / `blocked` / `processing` / `warning` | - |
|
|
104
|
-
| icon | Custom icon to display | `ReactNode` | - |
|
|
105
|
-
|
|
106
|
-
Either icon or status is mandatory.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
export { default } from './Badge';
|
|
2
2
|
export type { Status as BadgeStatus, BadgeProps, Color as BadgeColor, ColorHue as BadgeColorHue, } from './Badge.types';
|
|
3
|
-
export * from './IconBadge/IconBadge';
|
|
4
|
-
export type { IconBadgeProps, StatusIconBadgeProps, CustomIconBadgeProps, } from './IconBadge/IconBadge.types';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { default } from './Badge';
|
|
2
|
-
export * from './IconBadge/IconBadge';
|
|
1
|
+
export { default } from './Badge';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-badge",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"description": "Badge UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"react": ">=16.9.0 <= 18.3.1",
|
|
45
45
|
"styled-components": "^5.3.3"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "2393f96e57ee588efc9b56457389865b272b79fa"
|
|
48
48
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { theme } from '@synerise/ds-core';
|
|
3
|
-
import { Check3S, ErrorFillS, SpinnerS, WarningFillS } from '@synerise/ds-icon';
|
|
4
|
-
export var STATUS_ICONS = {
|
|
5
|
-
active: {
|
|
6
|
-
component: /*#__PURE__*/React.createElement(Check3S, null),
|
|
7
|
-
color: theme.palette['fern-600']
|
|
8
|
-
},
|
|
9
|
-
blocked: {
|
|
10
|
-
component: /*#__PURE__*/React.createElement(ErrorFillS, null),
|
|
11
|
-
color: theme.palette['red-600']
|
|
12
|
-
},
|
|
13
|
-
processing: {
|
|
14
|
-
component: /*#__PURE__*/React.createElement(SpinnerS, null),
|
|
15
|
-
color: theme.palette['blue-600']
|
|
16
|
-
},
|
|
17
|
-
warning: {
|
|
18
|
-
component: /*#__PURE__*/React.createElement(WarningFillS, null),
|
|
19
|
-
color: theme.palette['yellow-600']
|
|
20
|
-
}
|
|
21
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var _excluded = ["children"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { omitKeys } from '@synerise/ds-utils';
|
|
6
|
-
import * as S from './IconBadge.styles';
|
|
7
|
-
import { hasCustomIcon, renderStatusIcon } from './IconBadge.utils';
|
|
8
|
-
export var IconBadge = function IconBadge(_ref) {
|
|
9
|
-
var children = _ref.children,
|
|
10
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
11
|
-
var iconComponent = hasCustomIcon(props) ? props.icon : renderStatusIcon(props.status);
|
|
12
|
-
var rest = omitKeys(['icon', 'status'], props);
|
|
13
|
-
return /*#__PURE__*/React.createElement(S.IconBadgeWrapper, _extends({
|
|
14
|
-
"data-testid": "ds-badge-icon-badge"
|
|
15
|
-
}, rest), children, /*#__PURE__*/React.createElement(S.IconBadgeIcon, {
|
|
16
|
-
className: "ds-icon-badge"
|
|
17
|
-
}, iconComponent));
|
|
18
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const IconBadgeWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
export declare const IconBadgeIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
-
export declare const Icon: import("styled-components").StyledComponent<({ name, component, className, ...rest }: import("@synerise/ds-icon").IconProps) => React.JSX.Element, any, {
|
|
4
|
-
status?: string;
|
|
5
|
-
}, never>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import styled, { css, keyframes } from 'styled-components';
|
|
2
|
-
import DSIcon from '@synerise/ds-icon';
|
|
3
|
-
var spinnerAnimation = keyframes(["0%{transform:rotate(0deg);}100%{transform:rotate(720deg);}"]);
|
|
4
|
-
export var IconBadgeWrapper = styled.div.withConfig({
|
|
5
|
-
displayName: "IconBadgestyles__IconBadgeWrapper",
|
|
6
|
-
componentId: "sc-dio7h6-0"
|
|
7
|
-
})(["position:relative;display:inline-block;"]);
|
|
8
|
-
export var IconBadgeIcon = styled.div.withConfig({
|
|
9
|
-
displayName: "IconBadgestyles__IconBadgeIcon",
|
|
10
|
-
componentId: "sc-dio7h6-1"
|
|
11
|
-
})(["position:absolute;top:0;right:0;z-index:10;"]);
|
|
12
|
-
export var Icon = styled(DSIcon).withConfig({
|
|
13
|
-
displayName: "IconBadgestyles__Icon",
|
|
14
|
-
componentId: "sc-dio7h6-2"
|
|
15
|
-
})(["", ""], function (props) {
|
|
16
|
-
return props.status === 'processing' && css(["animation:", " 2s linear infinite;"], spinnerAnimation);
|
|
17
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type HTMLAttributes, type ReactElement, type ReactNode } from 'react';
|
|
2
|
-
import { type Status } from '../Badge.types';
|
|
3
|
-
export type CustomIconBadgeProps = {
|
|
4
|
-
icon: ReactElement;
|
|
5
|
-
};
|
|
6
|
-
export type StatusIconBadgeProps = {
|
|
7
|
-
status: Exclude<Status, undefined>;
|
|
8
|
-
};
|
|
9
|
-
export type IconBadgeProps = (CustomIconBadgeProps | StatusIconBadgeProps) & {
|
|
10
|
-
children?: ReactNode;
|
|
11
|
-
} & HTMLAttributes<HTMLDivElement>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { CustomIconBadgeProps, StatusIconBadgeProps } from './IconBadge.types';
|
|
3
|
-
export declare const hasCustomIcon: (props: CustomIconBadgeProps | StatusIconBadgeProps) => props is CustomIconBadgeProps;
|
|
4
|
-
export declare const renderStatusIcon: (status: StatusIconBadgeProps["status"]) => React.JSX.Element | null;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { STATUS_ICONS } from './IconBadge.constants';
|
|
4
|
-
import * as S from './IconBadge.styles';
|
|
5
|
-
export var hasCustomIcon = function hasCustomIcon(props) {
|
|
6
|
-
return 'icon' in props;
|
|
7
|
-
};
|
|
8
|
-
export var renderStatusIcon = function renderStatusIcon(status) {
|
|
9
|
-
if (!status || status === 'inactive') {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
return STATUS_ICONS[status] ? /*#__PURE__*/React.createElement(S.Icon, _extends({
|
|
13
|
-
status: status
|
|
14
|
-
}, STATUS_ICONS[status])) : null;
|
|
15
|
-
};
|