@uncinc/uncinc-react-kitchen-sink 2.15.0 → 2.15.2

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, { type HTMLAttributes } from 'react';
1
+ import React from 'react';
2
2
  import './style.scss';
3
- interface IconProps extends React.HTMLProps<HTMLAttributes<HTMLDivElement>> {
3
+ type IconFlair = 'filled' | 'outlined' | 'round' | 'sharp' | 'two-tone';
4
+ export interface IconProps {
4
5
  name: string;
5
- flair?: string;
6
+ flair?: IconFlair;
7
+ className?: string;
6
8
  }
7
9
  declare const Icon: React.FC<IconProps>;
8
10
  export default Icon;
@@ -63,7 +63,8 @@ var Share = function Share(_ref2) {
63
63
  }, /*#__PURE__*/React.createElement("div", {
64
64
  className: "Share__wrapper"
65
65
  }, /*#__PURE__*/React.createElement("div", {
66
- className: "Share__title"
66
+ className: "Share__title",
67
+ tabIndex: "0"
67
68
  }, title), /*#__PURE__*/React.createElement("div", {
68
69
  className: "Share__buttons"
69
70
  }, buttons)));
@@ -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(), onDelete && /*#__PURE__*/React.createElement("button", {
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'),
@@ -22,6 +22,11 @@
22
22
  cursor: pointer;
23
23
  }
24
24
 
25
+ &__icon {
26
+ pointer-events: none;
27
+ user-select: none;
28
+ }
29
+
25
30
  &__delete-button {
26
31
  // Expanding the clickable area by adding padding,
27
32
  // and compensating this, using negative margin.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uncinc/uncinc-react-kitchen-sink",
3
- "version": "2.15.0",
3
+ "version": "2.15.2",
4
4
  "description": "Default React components that are easily extended.",
5
5
  "author": "uncinc",
6
6
  "license": "MIT",