@uncinc/uncinc-react-kitchen-sink 2.15.0 → 2.15.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,8 +1,10 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import './style.scss';
|
|
3
|
-
|
|
3
|
+
type IconFlair = 'filled' | 'outlined' | 'round' | 'sharp' | 'two-tone';
|
|
4
|
+
export interface IconProps {
|
|
4
5
|
name: string;
|
|
5
|
-
flair?:
|
|
6
|
+
flair?: IconFlair;
|
|
7
|
+
className?: string;
|
|
6
8
|
}
|
|
7
9
|
declare const Icon: React.FC<IconProps>;
|
|
8
10
|
export default Icon;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type IconProps } from '../Icon';
|
|
2
3
|
import './style.scss';
|
|
3
4
|
export interface TagProps {
|
|
4
5
|
name: React.ReactNode;
|
|
@@ -9,6 +10,8 @@ export interface TagProps {
|
|
|
9
10
|
link?: string;
|
|
10
11
|
onClick?: () => void;
|
|
11
12
|
target?: HTMLAnchorElement['target'];
|
|
13
|
+
iconName?: IconProps['name'];
|
|
14
|
+
iconFlair?: IconProps['flair'];
|
|
12
15
|
}
|
|
13
16
|
declare const Tag: React.FC<TagProps>;
|
|
14
17
|
export default Tag;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import c from 'classnames';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import Icon from '../Icon';
|
|
4
5
|
import './style.scss';
|
|
5
6
|
var Tag = function Tag(_ref) {
|
|
6
7
|
var name = _ref.name,
|
|
@@ -11,7 +12,10 @@ var Tag = function Tag(_ref) {
|
|
|
11
12
|
link = _ref.link,
|
|
12
13
|
onClick = _ref.onClick,
|
|
13
14
|
_ref$target = _ref.target,
|
|
14
|
-
target = _ref$target === void 0 ? '_blank' : _ref$target
|
|
15
|
+
target = _ref$target === void 0 ? '_blank' : _ref$target,
|
|
16
|
+
iconName = _ref.iconName,
|
|
17
|
+
_ref$iconFlair = _ref.iconFlair,
|
|
18
|
+
iconFlair = _ref$iconFlair === void 0 ? 'outlined' : _ref$iconFlair;
|
|
15
19
|
var _useTranslation = useTranslation(),
|
|
16
20
|
t = _useTranslation.t;
|
|
17
21
|
var handleOnClick = function handleOnClick(e) {
|
|
@@ -49,7 +53,11 @@ var Tag = function Tag(_ref) {
|
|
|
49
53
|
}, className);
|
|
50
54
|
return /*#__PURE__*/React.createElement("div", {
|
|
51
55
|
className: tagClasses
|
|
52
|
-
}, renderMainInteractivePart(),
|
|
56
|
+
}, renderMainInteractivePart(), iconName && /*#__PURE__*/React.createElement(Icon, {
|
|
57
|
+
className: "Tag__icon",
|
|
58
|
+
name: iconName,
|
|
59
|
+
flair: iconFlair
|
|
60
|
+
}), onDelete && /*#__PURE__*/React.createElement("button", {
|
|
53
61
|
className: "Tag__delete-button icon-after icon-cross",
|
|
54
62
|
type: "button",
|
|
55
63
|
"aria-label": deleteButtonAriaLabel !== null && deleteButtonAriaLabel !== void 0 ? deleteButtonAriaLabel : t('atoms.tag.delete'),
|