@semcore/tag 3.7.1 → 3.7.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
+ ## [3.7.2] - 2022-04-28
6
+
7
+ ### Changed
8
+
9
+ - Version patch update due to children dependencies update (`@semcore/icon` [2.20.0 ~> 2.21.0]).
10
+
5
11
  ## [3.7.1] - 2022-03-21
6
12
 
7
13
  ### Changed
package/lib/cjs/Tag.js CHANGED
@@ -113,7 +113,7 @@ var RootTag = /*#__PURE__*/function (_Component) {
113
113
  }, {
114
114
  key: "render",
115
115
  value: function render() {
116
- var _ref = this ? this.asProps : arguments[0],
116
+ var _ref = this.asProps,
117
117
  _ref6;
118
118
 
119
119
  var STag = _flexBox.Box;
@@ -158,7 +158,7 @@ var RootTag = /*#__PURE__*/function (_Component) {
158
158
  });
159
159
 
160
160
  function Text(props) {
161
- var _ref2 = this ? this.asProps : arguments[0],
161
+ var _ref2 = arguments[0],
162
162
  _ref7;
163
163
 
164
164
  var SText = _flexBox.Box;
@@ -169,7 +169,7 @@ function Text(props) {
169
169
  }
170
170
 
171
171
  function Close(props) {
172
- var _ref3 = this ? this.asProps : arguments[0],
172
+ var _ref3 = arguments[0],
173
173
  _ref8;
174
174
 
175
175
  var SClose = _flexBox.Box;
@@ -183,7 +183,7 @@ function Close(props) {
183
183
  }
184
184
 
185
185
  function Addon(props) {
186
- var _ref4 = this ? this.asProps : arguments[0],
186
+ var _ref4 = arguments[0],
187
187
  _ref9;
188
188
 
189
189
  var SAddon = _flexBox.Box;
@@ -194,7 +194,7 @@ function Addon(props) {
194
194
  }
195
195
 
196
196
  function Circle(props) {
197
- var _ref5 = this ? this.asProps : arguments[0],
197
+ var _ref5 = arguments[0],
198
198
  _ref10;
199
199
 
200
200
  var SCircle = _flexBox.Box;
@@ -0,0 +1,66 @@
1
+ import React from 'react';
2
+ import { CProps, ReturnEl, PropGetterFn } from '@semcore/core';
3
+ import { IBoxProps } from '@semcore/flex-box';
4
+ import { IIconProps } from '@semcore/icon';
5
+
6
+ export type TagSize = 'xl' | 'l' | 'm' | 's';
7
+ export type TagTheme = 'muted' | 'invert' | 'warning' | string;
8
+ export type TagUse = 'primary' | 'secondary' | 'custom';
9
+
10
+ export interface ITagProps extends IBoxProps {
11
+ /** Value responsible for tag availability
12
+ */
13
+ disabled?: boolean;
14
+ /** Value responsible for tag activity
15
+ */
16
+ active?: boolean;
17
+ /** Interactive tag
18
+ */
19
+ interactive?: boolean;
20
+ /** Tag type
21
+ * @default secondary
22
+ */
23
+ use?: TagUse;
24
+ /** Tag theme, there are several default themes or you can use your color
25
+ * @default muted
26
+ */
27
+ theme?: TagTheme;
28
+ /** Tag color text */
29
+ color?: string;
30
+ /** Tag size
31
+ * @default m
32
+ */
33
+ size?: TagSize;
34
+ /** Left addon tag */
35
+ addonLeft?: React.ElementType;
36
+ /** Right addon tag */
37
+ addonRight?: React.ElementType;
38
+ }
39
+
40
+ export interface ITagCloseProps extends IIconProps {
41
+ /** Tag type
42
+ * @default secondary
43
+ */
44
+ use?: TagUse;
45
+ /** Tag theme, there are several default themes or you can use your color
46
+ * @default muted
47
+ */
48
+ theme?: TagTheme;
49
+ }
50
+
51
+ export interface ITagContext extends ITagProps {
52
+ getCloseProps?: PropGetterFn;
53
+ }
54
+
55
+ export interface ITagAddonProps extends IBoxProps {}
56
+
57
+ export interface ITagTextProps extends IBoxProps {}
58
+
59
+ declare const Tag: (<T>(props: CProps<ITagProps & T, ITagContext>) => ReturnEl) & {
60
+ Text: <T>(props: ITagTextProps & T) => ReturnEl;
61
+ Addon: <T>(props: ITagAddonProps & T) => ReturnEl;
62
+ Close: <T>(props: ITagCloseProps & T) => ReturnEl;
63
+ Circle: <T>(props: ITagAddonProps & T) => ReturnEl;
64
+ };
65
+
66
+ export default Tag;
package/lib/cjs/index.js CHANGED
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _typeof = require("@babel/runtime/helpers/typeof");
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- var _exportNames = {};
9
8
  Object.defineProperty(exports, "default", {
10
9
  enumerable: true,
11
10
  get: function get() {
@@ -13,21 +12,5 @@ Object.defineProperty(exports, "default", {
13
12
  }
14
13
  });
15
14
 
16
- var _Tag = _interopRequireWildcard(require("./Tag"));
17
-
18
- Object.keys(_Tag).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
21
- if (key in exports && exports[key] === _Tag[key]) return;
22
- Object.defineProperty(exports, key, {
23
- enumerable: true,
24
- get: function get() {
25
- return _Tag[key];
26
- }
27
- });
28
- });
29
-
30
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
-
32
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+ var _Tag = _interopRequireDefault(require("./Tag"));
33
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export { default } from './Tag';\nexport * from './Tag';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA","sourcesContent":["export { default } from './Tag';\n"],"file":"index.js"}
package/lib/es6/Tag.js CHANGED
@@ -95,7 +95,7 @@ var RootTag = /*#__PURE__*/function (_Component) {
95
95
  }, {
96
96
  key: "render",
97
97
  value: function render() {
98
- var _ref = this ? this.asProps : arguments[0],
98
+ var _ref = this.asProps,
99
99
  _ref6;
100
100
 
101
101
  var STag = Box;
@@ -143,7 +143,7 @@ _defineProperty(RootTag, "defaultProps", {
143
143
  });
144
144
 
145
145
  function Text(props) {
146
- var _ref2 = this ? this.asProps : arguments[0],
146
+ var _ref2 = arguments[0],
147
147
  _ref7;
148
148
 
149
149
  var SText = Box;
@@ -154,7 +154,7 @@ function Text(props) {
154
154
  }
155
155
 
156
156
  function Close(props) {
157
- var _ref3 = this ? this.asProps : arguments[0],
157
+ var _ref3 = arguments[0],
158
158
  _ref8;
159
159
 
160
160
  var SClose = Box;
@@ -168,7 +168,7 @@ function Close(props) {
168
168
  }
169
169
 
170
170
  function Addon(props) {
171
- var _ref4 = this ? this.asProps : arguments[0],
171
+ var _ref4 = arguments[0],
172
172
  _ref9;
173
173
 
174
174
  var SAddon = Box;
@@ -179,7 +179,7 @@ function Addon(props) {
179
179
  }
180
180
 
181
181
  function Circle(props) {
182
- var _ref5 = this ? this.asProps : arguments[0],
182
+ var _ref5 = arguments[0],
183
183
  _ref10;
184
184
 
185
185
  var SCircle = Box;
@@ -0,0 +1,66 @@
1
+ import React from 'react';
2
+ import { CProps, ReturnEl, PropGetterFn } from '@semcore/core';
3
+ import { IBoxProps } from '@semcore/flex-box';
4
+ import { IIconProps } from '@semcore/icon';
5
+
6
+ export type TagSize = 'xl' | 'l' | 'm' | 's';
7
+ export type TagTheme = 'muted' | 'invert' | 'warning' | string;
8
+ export type TagUse = 'primary' | 'secondary' | 'custom';
9
+
10
+ export interface ITagProps extends IBoxProps {
11
+ /** Value responsible for tag availability
12
+ */
13
+ disabled?: boolean;
14
+ /** Value responsible for tag activity
15
+ */
16
+ active?: boolean;
17
+ /** Interactive tag
18
+ */
19
+ interactive?: boolean;
20
+ /** Tag type
21
+ * @default secondary
22
+ */
23
+ use?: TagUse;
24
+ /** Tag theme, there are several default themes or you can use your color
25
+ * @default muted
26
+ */
27
+ theme?: TagTheme;
28
+ /** Tag color text */
29
+ color?: string;
30
+ /** Tag size
31
+ * @default m
32
+ */
33
+ size?: TagSize;
34
+ /** Left addon tag */
35
+ addonLeft?: React.ElementType;
36
+ /** Right addon tag */
37
+ addonRight?: React.ElementType;
38
+ }
39
+
40
+ export interface ITagCloseProps extends IIconProps {
41
+ /** Tag type
42
+ * @default secondary
43
+ */
44
+ use?: TagUse;
45
+ /** Tag theme, there are several default themes or you can use your color
46
+ * @default muted
47
+ */
48
+ theme?: TagTheme;
49
+ }
50
+
51
+ export interface ITagContext extends ITagProps {
52
+ getCloseProps?: PropGetterFn;
53
+ }
54
+
55
+ export interface ITagAddonProps extends IBoxProps {}
56
+
57
+ export interface ITagTextProps extends IBoxProps {}
58
+
59
+ declare const Tag: (<T>(props: CProps<ITagProps & T, ITagContext>) => ReturnEl) & {
60
+ Text: <T>(props: ITagTextProps & T) => ReturnEl;
61
+ Addon: <T>(props: ITagAddonProps & T) => ReturnEl;
62
+ Close: <T>(props: ITagCloseProps & T) => ReturnEl;
63
+ Circle: <T>(props: ITagAddonProps & T) => ReturnEl;
64
+ };
65
+
66
+ export default Tag;
package/lib/es6/index.js CHANGED
@@ -1,3 +1,2 @@
1
1
  export { default } from './Tag';
2
- export * from './Tag';
3
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.js"],"names":["default"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AACA,cAAc,OAAd","sourcesContent":["export { default } from './Tag';\nexport * from './Tag';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/index.js"],"names":["default"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB","sourcesContent":["export { default } from './Tag';\n"],"file":"index.js"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/tag",
3
3
  "description": "SEMRush Tag Component",
4
- "version": "3.7.1",
4
+ "version": "3.7.2",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -28,5 +28,8 @@
28
28
  "type": "git",
29
29
  "url": "https://github.com/semrush/intergalactic.git",
30
30
  "directory": "semcore/tag"
31
+ },
32
+ "devDependencies": {
33
+ "@semcore/jest-preset-ui": "1.0.0"
31
34
  }
32
35
  }
package/src/index.js CHANGED
@@ -1,2 +1 @@
1
1
  export { default } from './Tag';
2
- export * from './Tag';