hrm_ui_lib 2.2.0 → 2.2.1
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.
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { Text } from '../Text';
|
|
3
|
-
import { BadgeSize
|
|
4
|
+
import { BadgeSize } from './types';
|
|
4
5
|
import classNames from 'classnames';
|
|
5
6
|
export const BadgeV2 = (props) => {
|
|
6
|
-
const { type =
|
|
7
|
-
const { size: iconSize = 'small', type: iconType, alignment: iconAlignment =
|
|
8
|
-
return (_jsxs("div", { className: classNames(`badge badge--${type} badge--${style} badge--${size}`, className), children: [iconProps && iconAlignment ===
|
|
7
|
+
const { type = 'blue', style = 'filled', size = BadgeSize.large, text, className = '', iconProps } = props;
|
|
8
|
+
const { size: iconSize = 'small', type: iconType, alignment: iconAlignment = 'left', Component } = iconProps !== null && iconProps !== void 0 ? iconProps : {};
|
|
9
|
+
return (_jsxs("div", { className: classNames(`badge badge--${type} badge--${style} badge--${size}`, className), children: [iconProps && iconAlignment === 'left' && (_jsx(iconProps.Component, { size: iconSize, type: iconType })), typeof text === 'string' || typeof text === 'number' ? (_jsx(Text, { size: "xsmall", className: "badge__inner", children: _jsx(_Fragment, { children: text }) })) : React.isValidElement(text) ? (text) : null, iconProps && iconAlignment === 'right' && (_jsx(iconProps.Component, { size: iconSize, type: iconType }))] }));
|
|
9
10
|
};
|
|
@@ -1,35 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { TSVGIconType } from '../SVGIcons/types';
|
|
2
3
|
export interface TBadgeProps extends IFormCompProps {
|
|
3
|
-
text?: number | string;
|
|
4
|
-
type?:
|
|
4
|
+
text?: number | string | ReactNode;
|
|
5
|
+
type?: 'gray' | 'blue' | 'orange' | 'red' | 'green' | 'yellow' | 'purple' | 'sky' | 'pink' | 'teal' | 'empty';
|
|
5
6
|
size?: 'large' | 'small';
|
|
6
|
-
style?:
|
|
7
|
+
style?: 'filled' | 'light' | 'lighter' | 'stroke';
|
|
7
8
|
iconProps?: TIconProps;
|
|
8
9
|
className?: string;
|
|
9
10
|
}
|
|
10
|
-
export declare enum BadgeStyle {
|
|
11
|
-
filled = "filled",
|
|
12
|
-
light = "light",
|
|
13
|
-
lighter = "lighter",
|
|
14
|
-
stroke = "stroke"
|
|
15
|
-
}
|
|
16
|
-
export declare enum BadgeType {
|
|
17
|
-
gray = "gray",
|
|
18
|
-
blue = "blue",
|
|
19
|
-
orange = "orange",
|
|
20
|
-
red = "red",
|
|
21
|
-
green = "green",
|
|
22
|
-
yellow = "yellow",
|
|
23
|
-
purple = "purple",
|
|
24
|
-
sky = "sky",
|
|
25
|
-
pink = "pink",
|
|
26
|
-
teal = "teal",
|
|
27
|
-
empty = "empty"
|
|
28
|
-
}
|
|
29
|
-
export declare enum IconAlignment {
|
|
30
|
-
left = "left",
|
|
31
|
-
right = "right"
|
|
32
|
-
}
|
|
33
11
|
export declare enum BadgeSize {
|
|
34
12
|
small = "small",
|
|
35
13
|
large = "large"
|
|
@@ -37,6 +15,6 @@ export declare enum BadgeSize {
|
|
|
37
15
|
export interface TIconProps {
|
|
38
16
|
size?: TIconSize;
|
|
39
17
|
type?: TSVGIconType;
|
|
40
|
-
alignment?:
|
|
18
|
+
alignment?: 'left' | 'right';
|
|
41
19
|
Component: TSVGIconComponent;
|
|
42
20
|
}
|
|
@@ -1,29 +1,3 @@
|
|
|
1
|
-
export var BadgeStyle;
|
|
2
|
-
(function (BadgeStyle) {
|
|
3
|
-
BadgeStyle["filled"] = "filled";
|
|
4
|
-
BadgeStyle["light"] = "light";
|
|
5
|
-
BadgeStyle["lighter"] = "lighter";
|
|
6
|
-
BadgeStyle["stroke"] = "stroke";
|
|
7
|
-
})(BadgeStyle || (BadgeStyle = {}));
|
|
8
|
-
export var BadgeType;
|
|
9
|
-
(function (BadgeType) {
|
|
10
|
-
BadgeType["gray"] = "gray";
|
|
11
|
-
BadgeType["blue"] = "blue";
|
|
12
|
-
BadgeType["orange"] = "orange";
|
|
13
|
-
BadgeType["red"] = "red";
|
|
14
|
-
BadgeType["green"] = "green";
|
|
15
|
-
BadgeType["yellow"] = "yellow";
|
|
16
|
-
BadgeType["purple"] = "purple";
|
|
17
|
-
BadgeType["sky"] = "sky";
|
|
18
|
-
BadgeType["pink"] = "pink";
|
|
19
|
-
BadgeType["teal"] = "teal";
|
|
20
|
-
BadgeType["empty"] = "empty";
|
|
21
|
-
})(BadgeType || (BadgeType = {}));
|
|
22
|
-
export var IconAlignment;
|
|
23
|
-
(function (IconAlignment) {
|
|
24
|
-
IconAlignment["left"] = "left";
|
|
25
|
-
IconAlignment["right"] = "right";
|
|
26
|
-
})(IconAlignment || (IconAlignment = {}));
|
|
27
1
|
export var BadgeSize;
|
|
28
2
|
(function (BadgeSize) {
|
|
29
3
|
BadgeSize["small"] = "small";
|