@synerise/ds-badge 1.0.12 → 1.0.14

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/README.md CHANGED
@@ -90,20 +90,17 @@ import Badge from '@synerise/ds-badge'
90
90
 
91
91
  ### Color
92
92
 
93
- | Values |
94
- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
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
-
93
+ | Values |
94
+ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
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` |
97
96
 
98
97
  ### IconBadge
99
98
 
100
99
  Displays a predefined (depending on status) or custom icon as badge
101
100
 
102
-
103
101
  | Property | Description | Type | Default |
104
- |----------|---------------------------|--------------------------------------------------------------|---------|
102
+ | -------- | ------------------------- | ------------------------------------------------------------ | ------- |
105
103
  | status | Set badge as a status dot | `active` / `inactive` / `blocked` / `processing` / `warning` | - |
106
104
  | icon | Custom icon to display | `ReactNode` | - |
107
105
 
108
-
109
- Either icon or status is mandatory.
106
+ Either icon or status is mandatory.
package/dist/Badge.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import '@synerise/ds-core/dist/js/style';
3
+ import { type BadgeProps } from './Badge.types';
3
4
  import './style/index.less';
4
- import { BadgeProps } from './Badge.types';
5
5
  declare const Badge: ({ dot, ...props }: BadgeProps) => React.JSX.Element;
6
6
  export default Badge;
package/dist/Badge.js CHANGED
@@ -3,8 +3,8 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
3
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
4
  import React from 'react';
5
5
  import '@synerise/ds-core/dist/js/style';
6
- import "./style/index.css";
7
6
  import StyledBadge from './Badge.styles';
7
+ import "./style/index.css";
8
8
  var Badge = function Badge(_ref) {
9
9
  var dot = _ref.dot,
10
10
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
@@ -1,12 +1,16 @@
1
1
  var _excluded = ["flag", "outlined", "backgroundColor", "textColor", "backgroundColorHue", "textColorHue", "pulsing", "customColor"];
2
2
  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; }
3
+ import Badge from 'antd/lib/badge';
3
4
  import React from 'react';
4
5
  import styled, { css, keyframes } from 'styled-components';
5
- import Badge from 'antd/lib/badge';
6
6
  import { macro } from '@synerise/ds-typography';
7
7
  var getBackgroundColor = function getBackgroundColor(props) {
8
- if (props.backgroundColor === 'transparent') return 'transparent';
9
- if (props.backgroundColor === 'white') return props.theme.palette.white;
8
+ if (props.backgroundColor === 'transparent') {
9
+ return 'transparent';
10
+ }
11
+ if (props.backgroundColor === 'white') {
12
+ return props.theme.palette.white;
13
+ }
10
14
  return props.theme.palette[props.backgroundColor + "-" + props.backgroundColorHue];
11
15
  };
12
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;}"]);
@@ -1,7 +1,7 @@
1
- import { BadgeProps as AntBadgeProps } from 'antd/lib/badge';
2
- import { DefaultColor } from '@synerise/ds-core';
1
+ import { type BadgeProps as AntBadgeProps } from 'antd/lib/badge';
2
+ import { type DefaultColor } from '@synerise/ds-core';
3
3
  export declare const color: readonly ["red", "green", "grey", "yellow", "blue", "pink", "mars", "orange", "fern", "cyan", "purple", "violet", "white", "transparent"];
4
- export type Color = typeof color[number];
4
+ export type Color = (typeof color)[number];
5
5
  export type ColorHue = '900' | '800' | '700' | '600' | '500' | '400' | '300' | '200' | '100' | '050';
6
6
  export type Status = 'active' | 'inactive' | 'blocked' | 'processing' | 'warning' | undefined;
7
7
  export type BadgeProps = Omit<AntBadgeProps, 'status'> & {
@@ -1,3 +1,3 @@
1
- import { IconProps } from '@synerise/ds-icon';
2
- import { Status } from '../Badge.types';
1
+ import { type IconProps } from '@synerise/ds-icon';
2
+ import { type Status } from '../Badge.types';
3
3
  export declare const STATUS_ICONS: Record<Exclude<Status, undefined | 'inactive'>, Partial<IconProps>>;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { Check3S, ErrorFillS, SpinnerS, WarningFillS } from '@synerise/ds-icon';
3
2
  import { theme } from '@synerise/ds-core';
3
+ import { Check3S, ErrorFillS, SpinnerS, WarningFillS } from '@synerise/ds-icon';
4
4
  export var STATUS_ICONS = {
5
5
  active: {
6
6
  component: /*#__PURE__*/React.createElement(Check3S, null),
@@ -8,7 +8,6 @@ import { hasCustomIcon, renderStatusIcon } from './IconBadge.utils';
8
8
  export var IconBadge = function IconBadge(_ref) {
9
9
  var children = _ref.children,
10
10
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
11
- // eslint-disable-next-line react/destructuring-assignment
12
11
  var iconComponent = hasCustomIcon(props) ? props.icon : renderStatusIcon(props.status);
13
12
  var rest = omitKeys(['icon', 'status'], props);
14
13
  return /*#__PURE__*/React.createElement(S.IconBadgeWrapper, _extends({
@@ -1,5 +1,5 @@
1
- import { ReactElement, ReactNode, HTMLAttributes } from 'react';
2
- import { Status } from '../Badge.types';
1
+ import { type HTMLAttributes, type ReactElement, type ReactNode } from 'react';
2
+ import { type Status } from '../Badge.types';
3
3
  export type CustomIconBadgeProps = {
4
4
  icon: ReactElement;
5
5
  };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { default } from './Badge';
2
- export type { Status as BadgeStatus, BadgeProps, Color as BadgeColor, ColorHue as BadgeColorHue } from './Badge.types';
2
+ export type { Status as BadgeStatus, BadgeProps, Color as BadgeColor, ColorHue as BadgeColorHue, } from './Badge.types';
3
3
  export * from './IconBadge/IconBadge';
4
- export type { IconBadgeProps, StatusIconBadgeProps, CustomIconBadgeProps } from './IconBadge/IconBadge.types';
4
+ export type { IconBadgeProps, StatusIconBadgeProps, CustomIconBadgeProps, } from './IconBadge/IconBadge.types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-badge",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "Badge UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -34,9 +34,9 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-icon": "^1.5.3",
38
- "@synerise/ds-typography": "^1.0.12",
39
- "@synerise/ds-utils": "^1.3.0"
37
+ "@synerise/ds-icon": "^1.5.4",
38
+ "@synerise/ds-typography": "^1.0.14",
39
+ "@synerise/ds-utils": "^1.3.1"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@synerise/ds-core": "*",
@@ -44,5 +44,5 @@
44
44
  "react": ">=16.9.0 <= 18.3.1",
45
45
  "styled-components": "^5.3.3"
46
46
  },
47
- "gitHead": "11fe1d29b2ac23e70c3d5e6ce8ae20201a619a34"
47
+ "gitHead": "8db1900bf3f7b0782c834ff82f628199530cd934"
48
48
  }