@synerise/ds-tags 0.6.2 → 0.6.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,14 @@
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.6.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tags@0.6.2...@synerise/ds-tags@0.6.3) (2021-11-22)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-tags
9
+
10
+
11
+
12
+
13
+
6
14
  ## [0.6.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-tags@0.6.1...@synerise/ds-tags@0.6.2) (2021-11-16)
7
15
 
8
16
  **Note:** Version bump only for package @synerise/ds-tags
package/dist/Tag/Tag.js CHANGED
@@ -1,15 +1,3 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
-
3
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
-
5
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
-
7
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
-
9
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
-
11
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
1
  import * as React from 'react';
14
2
  import Icon, { CloseS } from '@synerise/ds-icon';
15
3
  import theme from '@synerise/ds-core/dist/js/DSProvider/ThemeProvider/theme';
@@ -42,9 +30,8 @@ var Tag = function Tag(_ref) {
42
30
  var isActionable = !disabled && isRemovable;
43
31
 
44
32
  var _React$useState = React.useState(false),
45
- _React$useState2 = _slicedToArray(_React$useState, 2),
46
- iconHover = _React$useState2[0],
47
- setIconHover = _React$useState2[1];
33
+ iconHover = _React$useState[0],
34
+ setIconHover = _React$useState[1];
48
35
 
49
36
  var onRemoveCall = function onRemoveCall() {
50
37
  return !!onRemove && !!id && onRemove(id);
@@ -71,7 +58,7 @@ var Tag = function Tag(_ref) {
71
58
  };
72
59
 
73
60
  return /*#__PURE__*/React.createElement(S.Tag, {
74
- className: "ds-tag ".concat(className !== null && className !== void 0 ? className : ''),
61
+ className: "ds-tag " + (className != null ? className : ''),
75
62
  isStatusShape: isStatusShape,
76
63
  shape: shape,
77
64
  color: color,
@@ -80,7 +67,7 @@ var Tag = function Tag(_ref) {
80
67
  disabled: disabled,
81
68
  isActionable: isActionable,
82
69
  onClick: onClick,
83
- "data-testid": typeof id !== 'undefined' ? "tag-".concat(id) : 'tag',
70
+ "data-testid": typeof id !== 'undefined' ? "tag-" + id : 'tag',
84
71
  preffixel: !!prefixel,
85
72
  suffixel: !!suffixel,
86
73
  hasImage: !!image,
@@ -92,7 +79,7 @@ var Tag = function Tag(_ref) {
92
79
  src: image,
93
80
  alt: ""
94
81
  }), !!prefixel && renderPrefixel(), /*#__PURE__*/React.createElement(S.TagName, null, name), !!suffixel && renderSuffixel(), isRemovable && /*#__PURE__*/React.createElement(Tooltip, {
95
- title: (texts === null || texts === void 0 ? void 0 : texts.deleteTooltip) || 'Delete',
82
+ title: (texts == null ? void 0 : texts.deleteTooltip) || 'Delete',
96
83
  visible: iconHover
97
84
  }, /*#__PURE__*/React.createElement(S.RemoveButton, {
98
85
  onClick: onRemoveCall,
@@ -38,7 +38,7 @@ var getFilterColor = function getFilterColor(props) {
38
38
  };
39
39
 
40
40
  var addonStyles = function addonStyles(props) {
41
- return "\n border: 1px solid;\n border-radius: 10px;\n height: 50%;\n padding: 0 3px;\n border-color: ".concat(props.theme.palette.white, ";\n font-size: 9px;\n line-height: 10px;\n text-align: center;\n");
41
+ return "\n border: 1px solid;\n border-radius: 10px;\n height: 50%;\n padding: 0 3px;\n border-color: " + props.theme.palette.white + ";\n font-size: 9px;\n line-height: 10px;\n text-align: center;\n";
42
42
  };
43
43
 
44
44
  export var TagName = styled.span.withConfig({
@@ -99,7 +99,7 @@ export var Content = styled.div.withConfig({
99
99
  displayName: "Tagstyles__Content",
100
100
  componentId: "h010xe-2"
101
101
  })(["position:relative;display:flex;align-items:center;flex-grow:0;flex-shrink:1;", ""], function (props) {
102
- return !!props.iconHover && "\n &&& {\n color:".concat(props.theme.palette['red-600'], ";\n }\n");
102
+ return !!props.iconHover && "\n &&& {\n color:" + props.theme.palette['red-600'] + ";\n }\n";
103
103
  });
104
104
  export var PrefixWrapper = styled.div.withConfig({
105
105
  displayName: "Tagstyles__PrefixWrapper",
@@ -107,7 +107,7 @@ export var PrefixWrapper = styled.div.withConfig({
107
107
  })(["", ";", ""], function (props) {
108
108
  return addonStyles(props);
109
109
  }, function (props) {
110
- return !!props.iconHover && ".ant-scroll-number{ \n color: ".concat(props.theme.palette['red-600'], "!important;\n box-shadow: 0 0 0 1px ").concat(props.theme.palette['red-600'], "!important;\n }\n .ds-icon svg {\n fill: ").concat(props.theme.palette['red-600'], ";\n}");
110
+ return !!props.iconHover && ".ant-scroll-number{ \n color: " + props.theme.palette['red-600'] + "!important;\n box-shadow: 0 0 0 1px " + props.theme.palette['red-600'] + "!important;\n }\n .ds-icon svg {\n fill: " + props.theme.palette['red-600'] + ";\n}";
111
111
  });
112
112
  export var SuffixWrapper = styled.div.withConfig({
113
113
  displayName: "Tagstyles__SuffixWrapper",
@@ -123,7 +123,7 @@ export var DefaultPrefixWrapper = styled.div.withConfig({
123
123
  displayName: "Tagstyles__DefaultPrefixWrapper",
124
124
  componentId: "h010xe-6"
125
125
  })(["", ""], function (props) {
126
- return !!props.iconHover && ".ant-scroll-number{ \n color: ".concat(props.theme.palette['red-600'], "!important;\n box-shadow: 0 0 0 1px ").concat(props.theme.palette['red-600'], "!important;\n }\n.ds-icon svg {\n fill: ").concat(props.theme.palette['red-600'], ";\n}");
126
+ return !!props.iconHover && ".ant-scroll-number{ \n color: " + props.theme.palette['red-600'] + "!important;\n box-shadow: 0 0 0 1px " + props.theme.palette['red-600'] + "!important;\n }\n.ds-icon svg {\n fill: " + props.theme.palette['red-600'] + ";\n}";
127
127
  });
128
128
  export var Tag = styled.div.withConfig({
129
129
  displayName: "Tagstyles__Tag",
@@ -133,7 +133,7 @@ export var Tag = styled.div.withConfig({
133
133
  }, function (props) {
134
134
  return insertShapeStyles(props);
135
135
  }, function (props) {
136
- return !!props.iconHover && "\n &&&:before{\n background-color:".concat(props.theme.palette['red-050'], ";\n }\n");
136
+ return !!props.iconHover && "\n &&&:before{\n background-color:" + props.theme.palette['red-050'] + ";\n }\n";
137
137
  }, function (props) {
138
138
  return !!props.disabled && css(["opacity:0.4;cursor:not-allowed;"]);
139
139
  }, function (props) {
package/dist/Tags.js CHANGED
@@ -1,25 +1,5 @@
1
1
  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); }
2
2
 
3
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
-
5
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
-
7
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
-
9
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
-
11
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
-
13
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
-
15
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
16
-
17
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
18
-
19
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
20
-
21
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
-
23
3
  import * as React from 'react';
24
4
  import { withTheme } from 'styled-components';
25
5
  import Dropdown from '@synerise/ds-dropdown';
@@ -50,14 +30,12 @@ var Tags = function Tags(_ref) {
50
30
  onManageTagClick = _ref.onManageTagClick;
51
31
 
52
32
  var _React$useState = React.useState(false),
53
- _React$useState2 = _slicedToArray(_React$useState, 2),
54
- isAdding = _React$useState2[0],
55
- setAddingState = _React$useState2[1];
33
+ isAdding = _React$useState[0],
34
+ setAddingState = _React$useState[1];
56
35
 
57
- var _React$useState3 = React.useState(''),
58
- _React$useState4 = _slicedToArray(_React$useState3, 2),
59
- searchQuery = _React$useState4[0],
60
- setSearchQuery = _React$useState4[1];
36
+ var _React$useState2 = React.useState(''),
37
+ searchQuery = _React$useState2[0],
38
+ setSearchQuery = _React$useState2[1];
61
39
 
62
40
  var addIcon = /*#__PURE__*/React.createElement(S.AddIconWrapper, null, /*#__PURE__*/React.createElement(Icon, {
63
41
  component: /*#__PURE__*/React.createElement(Add3M, null),
@@ -107,7 +85,7 @@ var Tags = function Tags(_ref) {
107
85
  };
108
86
 
109
87
  var onPoolTagSelect = function onPoolTagSelect(tag) {
110
- onSelectedChange && selected && onSelectedChange([].concat(_toConsumableArray(selected), [tag]), {
88
+ onSelectedChange && selected && onSelectedChange([].concat(selected, [tag]), {
111
89
  type: 'ADD',
112
90
  tag: tag
113
91
  });
@@ -160,7 +138,7 @@ var Tags = function Tags(_ref) {
160
138
  })), emptyPool && !isCreatable && !manageLink && /*#__PURE__*/React.createElement(S.DropdownNoTags, null, texts && texts.dropdownNoTags), emptyPool && isCreatable && /*#__PURE__*/React.createElement(Result, {
161
139
  type: "no-results",
162
140
  noSearchResults: true,
163
- description: (texts === null || texts === void 0 ? void 0 : texts.noResultsLabel) || 'No results'
141
+ description: (texts == null ? void 0 : texts.noResultsLabel) || 'No results'
164
142
  })), manageLink && selectablePool && !selectablePool.length && /*#__PURE__*/React.createElement(Dropdown.BottomAction, {
165
143
  onClickAction: function onClickAction() {
166
144
  onManageTagClick && onManageTagClick();
@@ -180,7 +158,7 @@ var Tags = function Tags(_ref) {
180
158
  color: theme.palette['grey-500']
181
159
  }), ' ', texts && texts.manageLinkLabel)));
182
160
  return /*#__PURE__*/React.createElement(S.Container, {
183
- className: "ds-tags ".concat(className || ''),
161
+ className: "ds-tags " + (className || ''),
184
162
  style: style,
185
163
  "data-testid": "tags"
186
164
  }, /*#__PURE__*/React.createElement(S.SelectedTags, null, selected && selected.map(function (tag) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-tags",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Tags UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -32,10 +32,10 @@
32
32
  ],
33
33
  "types": "dist/index.d.ts",
34
34
  "dependencies": {
35
- "@synerise/ds-button": "^0.16.1",
36
- "@synerise/ds-dropdown": "^0.17.2",
37
- "@synerise/ds-icon": "^0.46.1",
38
- "@synerise/ds-search-bar": "^0.5.1"
35
+ "@synerise/ds-button": "^0.16.2",
36
+ "@synerise/ds-dropdown": "^0.17.3",
37
+ "@synerise/ds-icon": "^0.46.2",
38
+ "@synerise/ds-search-bar": "^0.5.2"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@synerise/ds-core": "*",
@@ -44,5 +44,5 @@
44
44
  "devDependencies": {
45
45
  "@synerise/ds-utils": "^0.19.0"
46
46
  },
47
- "gitHead": "8e667a88a48d774c550ff4766de71c4aab01f5a9"
47
+ "gitHead": "2468359677783819939fb9f1ef5acc36667ecd1a"
48
48
  }