@synerise/ds-tags 0.9.2 → 0.9.3

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 CHANGED
@@ -3,6 +3,17 @@
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
+ ## [0.9.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tags@0.9.2...@synerise/ds-tags@0.9.3) (2024-07-02)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **tags:** fixed spreading html attributes ([29a37bc](https://github.com/Synerise/synerise-design/commit/29a37bca2cbf1f55dae75029f5e5b4cf3afd6afb))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [0.9.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tags@0.9.1...@synerise/ds-tags@0.9.2) (2024-06-27)
7
18
 
8
19
  **Note:** Version bump only for package @synerise/ds-tags
package/dist/Tag/Tag.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { TagProps, TagShape } from './Tag.types';
3
3
  declare const Tag: {
4
- ({ id, name, className, disabled, removable, image, shape, color, textColor, onRemove, onClick, onMouseLeave, onMouseOver, prefixel, suffixel, texts, asPill, }: TagProps): React.JSX.Element;
4
+ ({ id, name, className, disabled, removable, image, shape, color, textColor, onRemove, onClick, prefixel, suffixel, texts, asPill, ...htmlAttributes }: TagProps): React.JSX.Element;
5
5
  defaultProps: {
6
6
  shape: TagShape;
7
7
  };
package/dist/Tag/Tag.js CHANGED
@@ -1,3 +1,9 @@
1
+ var _excluded = ["id", "name", "className", "disabled", "removable", "image", "shape", "color", "textColor", "onRemove", "onClick", "prefixel", "suffixel", "texts", "asPill"];
2
+
3
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+
5
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
+
1
7
  import React, { useState } from 'react';
2
8
  import Icon, { CloseS } from '@synerise/ds-icon';
3
9
  import { theme } from '@synerise/ds-core';
@@ -18,12 +24,12 @@ var Tag = function Tag(_ref) {
18
24
  textColor = _ref.textColor,
19
25
  onRemove = _ref.onRemove,
20
26
  onClick = _ref.onClick,
21
- onMouseLeave = _ref.onMouseLeave,
22
- onMouseOver = _ref.onMouseOver,
23
27
  prefixel = _ref.prefixel,
24
28
  suffixel = _ref.suffixel,
25
29
  texts = _ref.texts,
26
- asPill = _ref.asPill;
30
+ asPill = _ref.asPill,
31
+ htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
32
+
27
33
  var isDefaultType = shape && [TagShape.DEFAULT_ROUND, TagShape.DEFAULT_SQUARE].includes(shape);
28
34
  var isDefaultRound = shape === TagShape.DEFAULT_ROUND;
29
35
  var isDefaultSquare = shape === TagShape.DEFAULT_SQUARE;
@@ -62,16 +68,16 @@ var Tag = function Tag(_ref) {
62
68
  var handleMouseOver = function handleMouseOver(event) {
63
69
  setIsIconHovered(true); // eslint-disable-next-line no-unused-expressions
64
70
 
65
- onMouseOver == null || onMouseOver(event);
71
+ htmlAttributes.onMouseOver == null || htmlAttributes.onMouseOver(event);
66
72
  };
67
73
 
68
74
  var handleMouseLeave = function handleMouseLeave(event) {
69
- setIsIconHovered(true); // eslint-disable-next-line no-unused-expressions
75
+ setIsIconHovered(false); // eslint-disable-next-line no-unused-expressions
70
76
 
71
- onMouseLeave == null || onMouseLeave(event);
77
+ htmlAttributes.onMouseLeave == null || htmlAttributes.onMouseLeave(event);
72
78
  };
73
79
 
74
- return /*#__PURE__*/React.createElement(S.Tag, {
80
+ return /*#__PURE__*/React.createElement(S.Tag, _extends({
75
81
  className: "ds-tag " + (className != null ? className : ''),
76
82
  isStatusShape: isStatusShape,
77
83
  shape: shape,
@@ -87,7 +93,7 @@ var Tag = function Tag(_ref) {
87
93
  hasImage: !!image,
88
94
  iconHover: isIconHovered,
89
95
  asPill: asPill
90
- }, /*#__PURE__*/React.createElement(S.Content, {
96
+ }, htmlAttributes), /*#__PURE__*/React.createElement(S.Content, {
91
97
  iconHover: isIconHovered
92
98
  }, image && isDefaultType && /*#__PURE__*/React.createElement("img", {
93
99
  src: image,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-tags",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "description": "Tags UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -34,11 +34,11 @@
34
34
  "types": "dist/index.d.ts",
35
35
  "dependencies": {
36
36
  "@synerise/ds-button": "^0.21.1",
37
- "@synerise/ds-dropdown": "^0.18.2",
37
+ "@synerise/ds-dropdown": "^0.18.3",
38
38
  "@synerise/ds-icon": "^0.63.0",
39
39
  "@synerise/ds-result": "^0.6.58",
40
40
  "@synerise/ds-scrollbar": "^0.11.2",
41
- "@synerise/ds-search-bar": "^0.6.77",
41
+ "@synerise/ds-search-bar": "^0.6.78",
42
42
  "@synerise/ds-tooltip": "^0.14.31"
43
43
  },
44
44
  "peerDependencies": {
@@ -50,5 +50,5 @@
50
50
  "@synerise/ds-utils": "^0.27.0",
51
51
  "@testing-library/react": "10.0.1"
52
52
  },
53
- "gitHead": "587eb113074985ae21e4f0c25ec33c3e3e2e072b"
53
+ "gitHead": "0692552b018dc9c8042f18c773f88890c9ad3270"
54
54
  }