@synerise/ds-tag 1.1.18 → 1.3.0

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,28 @@
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
+ # [1.3.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tag@1.2.0...@synerise/ds-tag@1.3.0) (2025-09-25)
7
+
8
+
9
+ ### Features
10
+
11
+ * **table:** cell with tags list ([109820e](https://github.com/Synerise/synerise-design/commit/109820ed06f931a178580633277a7643aebe1072))
12
+
13
+
14
+
15
+
16
+
17
+ # [1.2.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tag@1.1.18...@synerise/ds-tag@1.2.0) (2025-09-19)
18
+
19
+
20
+ ### Features
21
+
22
+ * **tag:** Implementation Infocard in Tag component ([d1f31fa](https://github.com/Synerise/synerise-design/commit/d1f31fa44a73da3787df1966e2046c5a577afd96))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [1.1.18](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tag@1.1.17...@synerise/ds-tag@1.1.18) (2025-09-16)
7
29
 
8
30
  **Note:** Version bump only for package @synerise/ds-tag
package/README.md CHANGED
@@ -28,19 +28,20 @@ import Tag from '@synerise/ds-tag'
28
28
 
29
29
  ## API
30
30
 
31
- | Property | Description | Type | Default |
32
- | --------- | ---------------------------------------- | --------------------------------- | ---------------------- |
33
- | className | tag container class | string | - |
34
- | color | primary color (background/border) of tag | string | - |
35
- | disabled | whether tag should be disabled | boolean | - |
36
- | id | id of tag (necessary if using Tags) | string / number | - |
37
- | name | title of tag | string | - |
38
- | onClick | onClick event on tag body | () => void | - |
39
- | onRemove | callback when tag is removed | (tagKey: string / number) => void | - |
40
- | removable | show remove button | boolean | - |
41
- | shape | shape of the tag | TagShape | TagShape.DEFAULT_ROUND |
42
- | textColor | color of tag name label | string | - |
43
- | dashed | make border dashed | boolean | - |
31
+ | Property | Description | Type | Default |
32
+ |--------------|-------------------------------------------------|-----------------------------------|------------------------|
33
+ | className | tag container class | string | - |
34
+ | color | primary color (background/border) of tag | string | - |
35
+ | disabled | whether tag should be disabled | boolean | - |
36
+ | id | id of tag (necessary if using Tags) | string / number | - |
37
+ | name | title of tag | string | - |
38
+ | onClick | onClick event on tag body | () => void | - |
39
+ | onRemove | callback when tag is removed | (tagKey: string / number) => void | - |
40
+ | removable | show remove button | boolean | - |
41
+ | shape | shape of the tag | TagShape | TagShape.DEFAULT_ROUND |
42
+ | textColor | color of tag name label | string | - |
43
+ | dashed | make border dashed | boolean | - |
44
+ | tooltipProps | tooltip to show over entire tag. see ds-tooltip | TooltipProps | |
44
45
 
45
46
  ## TagShape Enum
46
47
 
package/dist/Tag.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { type TagProps } from './Tag.types';
3
- declare const Tag: ({ id, name, className, disabled, removable, image, shape, color, textColor, onRemove, onClick, prefixel, suffixel, texts, asPill, dashed, ...htmlAttributes }: TagProps) => React.JSX.Element;
3
+ declare const Tag: ({ id, name, className, disabled, removable, image, shape, color, textColor, onRemove, onClick, prefixel, suffixel, texts, asPill, dashed, tooltipProps, ...htmlAttributes }: TagProps) => React.JSX.Element;
4
4
  export default Tag;
package/dist/Tag.js CHANGED
@@ -1,13 +1,14 @@
1
- var _excluded = ["id", "name", "className", "disabled", "removable", "image", "shape", "color", "textColor", "onRemove", "onClick", "prefixel", "suffixel", "texts", "asPill", "dashed"];
1
+ var _excluded = ["id", "name", "className", "disabled", "removable", "image", "shape", "color", "textColor", "onRemove", "onClick", "prefixel", "suffixel", "texts", "asPill", "dashed", "tooltipProps"];
2
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
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, { useState } from 'react';
5
- import { theme } from '@synerise/ds-core';
5
+ import { useTheme } from '@synerise/ds-core';
6
6
  import Icon, { CloseS } from '@synerise/ds-icon';
7
7
  import Tooltip from '@synerise/ds-tooltip';
8
8
  import * as S from './Tag.styles';
9
9
  import { getColorText } from './Tag.styles';
10
10
  import { TagShape } from './Tag.types';
11
+ import { useDefaultTexts } from './hooks/useDefaultTexts';
11
12
  var Tag = function Tag(_ref) {
12
13
  var id = _ref.id,
13
14
  name = _ref.name,
@@ -26,7 +27,10 @@ var Tag = function Tag(_ref) {
26
27
  texts = _ref.texts,
27
28
  asPill = _ref.asPill,
28
29
  dashed = _ref.dashed,
30
+ tooltipProps = _ref.tooltipProps,
29
31
  htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
32
+ var theme = useTheme();
33
+ var allTexts = useDefaultTexts(texts);
30
34
  var isDefaultType = shape && [TagShape.DEFAULT_ROUND, TagShape.DEFAULT_SQUARE].includes(shape);
31
35
  var isDefaultRound = shape === TagShape.DEFAULT_ROUND;
32
36
  var isDefaultSquare = shape === TagShape.DEFAULT_SQUARE;
@@ -63,7 +67,7 @@ var Tag = function Tag(_ref) {
63
67
  setIsIconHovered(false);
64
68
  htmlAttributes.onMouseLeave == null || htmlAttributes.onMouseLeave(event);
65
69
  };
66
- return /*#__PURE__*/React.createElement(S.Tag, _extends({
70
+ var renderedTag = /*#__PURE__*/React.createElement(S.Tag, _extends({
67
71
  className: "ds-tag " + (className != null ? className : ''),
68
72
  isStatusShape: isStatusShape,
69
73
  shape: shape,
@@ -86,8 +90,8 @@ var Tag = function Tag(_ref) {
86
90
  src: image,
87
91
  alt: ""
88
92
  }), !!prefixel && renderPrefixel(), /*#__PURE__*/React.createElement(S.TagName, null, name), !!suffixel && renderSuffixel(), isRemovable && /*#__PURE__*/React.createElement(Tooltip, {
89
- title: (texts == null ? void 0 : texts.deleteTooltip) || 'Delete',
90
- visible: isIconHovered
93
+ title: allTexts.deleteTooltip,
94
+ open: isIconHovered
91
95
  }, /*#__PURE__*/React.createElement(S.RemoveButton, {
92
96
  onClick: onRemoveCall,
93
97
  onMouseOver: handleMouseOver,
@@ -99,5 +103,6 @@ var Tag = function Tag(_ref) {
99
103
  size: 24,
100
104
  color: getColorText(theme, color)
101
105
  })))));
106
+ return tooltipProps ? /*#__PURE__*/React.createElement(Tooltip, tooltipProps, renderedTag) : renderedTag;
102
107
  };
103
108
  export default Tag;
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
+ import { type TooltipProps } from '@synerise/ds-tooltip';
2
3
  import type { WithHTMLAttributes } from '@synerise/ds-utils';
3
4
  export type TagTexts = {
4
5
  addButtonLabel?: ReactNode;
@@ -27,6 +28,7 @@ export type TagProps = WithHTMLAttributes<HTMLDivElement, {
27
28
  texts?: TagTexts;
28
29
  asPill?: boolean;
29
30
  dashed?: boolean;
31
+ tooltipProps?: TooltipProps;
30
32
  }>;
31
33
  export declare enum TagShape {
32
34
  SINGLE_CHARACTER_ROUND = "single_character_round",
@@ -0,0 +1,2 @@
1
+ import { type TagTexts } from '../Tag.types';
2
+ export declare const useDefaultTexts: (texts?: Partial<TagTexts>) => TagTexts;
@@ -0,0 +1,44 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ import React, { useMemo } from 'react';
3
+ import { FormattedMessage, useIntl } from 'react-intl';
4
+ export var useDefaultTexts = function useDefaultTexts(texts) {
5
+ var _useIntl = useIntl(),
6
+ formatMessage = _useIntl.formatMessage;
7
+ var allTexts = useMemo(function () {
8
+ return _extends({
9
+ searchPlaceholder: formatMessage({
10
+ id: 'DS.TAG.SEARCH-PLACEHOLDER',
11
+ defaultMessage: 'Search'
12
+ }),
13
+ addButtonLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
14
+ id: "DS.TAG.ADD-BUTTON-LABEL",
15
+ defaultMessage: "Add tag"
16
+ }),
17
+ manageLinkLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
18
+ id: "DS.TAG.MANAGE-LINK-LABEL",
19
+ defaultMessage: "Manage tags"
20
+ }),
21
+ createTagButtonLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
22
+ id: "DS.TAG.CREATE-TAG-LABEL",
23
+ defaultMessage: "Create tag"
24
+ }),
25
+ dropdownNoTags: /*#__PURE__*/React.createElement(FormattedMessage, {
26
+ id: "DS.TAG.NO-TAGS",
27
+ defaultMessage: "No data"
28
+ }),
29
+ clearTooltip: /*#__PURE__*/React.createElement(FormattedMessage, {
30
+ id: "DS.TAG.CLEAR-TOOLTIP",
31
+ defaultMessage: "Clear"
32
+ }),
33
+ deleteTooltip: /*#__PURE__*/React.createElement(FormattedMessage, {
34
+ id: "DS.TAG.DELETE-TOOLTIP",
35
+ defaultMessage: "Delete"
36
+ }),
37
+ noResultsLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
38
+ id: "DS.TAG.NO-SEARCH-RESULTS",
39
+ defaultMessage: "No tags found"
40
+ })
41
+ }, texts || {});
42
+ }, [texts, formatMessage]);
43
+ return allTexts;
44
+ };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default } from './Tag';
2
2
  export { TagShape, type TagProps, type TagTexts } from './Tag.types';
3
+ export { useDefaultTexts } from './hooks/useDefaultTexts';
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default } from './Tag';
2
- export { TagShape } from './Tag.types';
2
+ export { TagShape } from './Tag.types';
3
+ export { useDefaultTexts } from './hooks/useDefaultTexts';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-tag",
3
- "version": "1.1.18",
3
+ "version": "1.3.0",
4
4
  "description": "Tag UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -36,7 +36,7 @@
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
38
  "@synerise/ds-icon": "^1.7.2",
39
- "@synerise/ds-tooltip": "^1.1.18",
39
+ "@synerise/ds-tooltip": "^1.2.0",
40
40
  "@synerise/ds-utils": "^1.4.2"
41
41
  },
42
42
  "peerDependencies": {
@@ -44,5 +44,5 @@
44
44
  "react": ">=16.9.0 <= 18.3.1",
45
45
  "styled-components": "^5.3.3"
46
46
  },
47
- "gitHead": "5beb6ab5f2d77b9e98e04caab7dff20b8436078b"
47
+ "gitHead": "6a2e6e20a480aafe5d67748d04fbe3d4ce91a544"
48
48
  }