@semcore/tag 3.6.5 → 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 +18 -0
- package/lib/cjs/Tag.js +27 -27
- package/lib/cjs/index.d.ts +66 -0
- package/lib/cjs/index.js +2 -19
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/tag.shadow.css +2 -4
- package/lib/es6/Tag.js +27 -27
- package/lib/es6/index.d.ts +66 -0
- package/lib/es6/index.js +0 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/tag.shadow.css +2 -4
- package/package.json +4 -1
- package/src/index.js +0 -1
- package/src/style/tag.shadow.css +2 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
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
|
+
|
|
11
|
+
## [3.7.1] - 2022-03-21
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Version patch update due to children dependencies update (`@semcore/icon` [2.19.4 ~> 2.20.0]).
|
|
16
|
+
|
|
17
|
+
## [3.7.0] - 2022-03-18
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Fixed previously lost overflowed text ellipsis.
|
|
22
|
+
|
|
5
23
|
## [3.6.5] - 2022-03-14
|
|
6
24
|
|
|
7
25
|
### Changed
|
package/lib/cjs/Tag.js
CHANGED
|
@@ -50,31 +50,31 @@ var style = (
|
|
|
50
50
|
/*__reshadow_css_start__*/
|
|
51
51
|
_core.sstyled.insert(
|
|
52
52
|
/*__inner_css_start__*/
|
|
53
|
-
".
|
|
53
|
+
".___STag_u6arl_gg_{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;box-sizing:border-box;border-width:1px;border-style:solid;border-color:transparent;border-radius:21px;padding-left:4px;padding-right:4px}.___SText_u6arl_gg_{display:inline-block;padding-left:4px;padding-right:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2}.___SText_u6arl_gg_:not(:only-child):first-child{padding-right:0}.___SText_u6arl_gg_:not(:first-child):not(:last-child){padding-left:0;padding-right:0}.___SText_u6arl_gg_:not(:only-child):last-child{padding-left:0}.___SAddon_u6arl_gg_{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;padding-left:4px;padding-right:4px}.___SCircle_u6arl_gg_{display:inline-flex;align-items:center;justify-content:center;overflow:hidden;border-radius:50%;margin-right:4px}.___STag_u6arl_gg_.__disabled_u6arl_gg_{opacity:0.3;cursor:default;pointer-events:none}.___STag_u6arl_gg_.__interactive_u6arl_gg_{cursor:pointer}.___STag_u6arl_gg_._size_xl_u6arl_gg_{height:42px;min-width:42px;font-size:16px}.___STag_u6arl_gg_._size_xl_u6arl_gg_ .___SCircle_u6arl_gg_{width:28px;height:28px}.___STag_u6arl_gg_._size_l_u6arl_gg_{height:32px;min-width:32px;font-size:14px}.___STag_u6arl_gg_._size_l_u6arl_gg_ .___SCircle_u6arl_gg_{width:24px;height:24px}.___STag_u6arl_gg_._size_m_u6arl_gg_{height:26px;min-width:26px;font-size:12px}.___STag_u6arl_gg_._size_m_u6arl_gg_ .___SCircle_u6arl_gg_{width:20px;height:20px}.___STag_u6arl_gg_._size_s_u6arl_gg_{height:18px;min-width:18px;font-size:10px}.___STag_u6arl_gg_._size_s_u6arl_gg_ .___SCircle_u6arl_gg_{width:12px;height:12px}.___STag_u6arl_gg_._theme_primary-muted_u6arl_gg_{background-color:rgba(224,225,233,.5);color:#6c6e79}.___STag_u6arl_gg_._theme_primary-muted_u6arl_gg_.__active_u6arl_gg_,.___STag_u6arl_gg_._theme_primary-muted_u6arl_gg_.__interactive_u6arl_gg_:active,.___STag_u6arl_gg_._theme_primary-muted_u6arl_gg_.__interactive_u6arl_gg_:hover{background-color:#e0e1e9}.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_{background-color:rgba(255,127,0,.15);color:#ff7f00}.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__active_u6arl_gg_,.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__interactive_u6arl_gg_:active,.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__interactive_u6arl_gg_:hover{background-color:#ff7f00;color:#fff}.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__active_u6arl_gg_ .___SClose_u6arl_gg_,.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__interactive_u6arl_gg_:active .___SClose_u6arl_gg_,.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__interactive_u6arl_gg_:hover .___SClose_u6arl_gg_{color:hsla(0,0%,100%,.15)}.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__active_u6arl_gg_ .___SClose_u6arl_gg_:hover,.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__interactive_u6arl_gg_:active .___SClose_u6arl_gg_:hover,.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__interactive_u6arl_gg_:hover .___SClose_u6arl_gg_:hover{color:#fff}.___STag_u6arl_gg_._theme_primary-invert_u6arl_gg_{background-color:hsla(0,0%,100%,.2);color:#fff}.___STag_u6arl_gg_._theme_primary-invert_u6arl_gg_.__active_u6arl_gg_,.___STag_u6arl_gg_._theme_primary-invert_u6arl_gg_.__interactive_u6arl_gg_:active{background-color:#fff;color:#333333}.___STag_u6arl_gg_._theme_primary-invert_u6arl_gg_.__interactive_u6arl_gg_:hover{background-color:#fff;color:#333333}.___STag_u6arl_gg_._theme_primary-invert_u6arl_gg_.__interactive_u6arl_gg_ .___SClose_u6arl_gg_:hover{color:#333333}.___STag_u6arl_gg_._theme_secondary-muted_u6arl_gg_{background-color:#fff;color:#666666;border-color:#a6b0b3}.___STag_u6arl_gg_._theme_secondary-muted_u6arl_gg_.__interactive_u6arl_gg_:hover{color:#333333}.___STag_u6arl_gg_._theme_secondary-muted_u6arl_gg_.__active_u6arl_gg_,.___STag_u6arl_gg_._theme_secondary-muted_u6arl_gg_.__interactive_u6arl_gg_:active{background-color:#eeeeee;color:#333333}.___STag_u6arl_gg_._theme_secondary-invert_u6arl_gg_{border-color:hsla(0,0%,100%,.2);color:#fff}.___STag_u6arl_gg_._theme_secondary-invert_u6arl_gg_.__interactive_u6arl_gg_:hover{border-color:hsla(0,0%,100%,.5)}.___STag_u6arl_gg_._theme_secondary-invert_u6arl_gg_.__active_u6arl_gg_,.___STag_u6arl_gg_._theme_secondary-invert_u6arl_gg_.__interactive_u6arl_gg_:active{background-color:hsla(0,0%,100%,.1);border-color:hsla(0,0%,100%,.5)}.___STag_u6arl_gg_._theme_custom_u6arl_gg_{color:var(--colorText_rejl88);background-color:var(--colorTag_rejl88)}.___STag_u6arl_gg_._theme_custom_u6arl_gg_.__active_u6arl_gg_{color:#fff;background-color:var(--colorText_rejl88)}.___STag_u6arl_gg_._theme_custom_u6arl_gg_.__interactive_u6arl_gg_:hover{color:#fff;background-color:var(--colorText_rejl88)}.___STag_u6arl_gg_._theme_custom_u6arl_gg_.__interactive_u6arl_gg_:active{color:#fff;background-color:var(--colorText_rejl88)}.___SClose_u6arl_gg_{cursor:pointer;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;padding:4px}.___SClose_u6arl_gg_._theme_primary-warning_u6arl_gg_{color:rgba(255,127,0,.5)}.___SClose_u6arl_gg_._theme_primary-invert_u6arl_gg_{color:#999}.___SClose_u6arl_gg_._theme_primary-invert_u6arl_gg_:hover{color:#fff}.___SClose_u6arl_gg_._theme_secondary-muted_u6arl_gg_{color:hsla(0,0%,40%,.5)}.___SClose_u6arl_gg_._theme_secondary-muted_u6arl_gg_:hover{color:#333333}.___SClose_u6arl_gg_._theme_secondary-invert_u6arl_gg_{color:hsla(0,0%,100%,.5)}.___SClose_u6arl_gg_._theme_secondary-invert_u6arl_gg_:hover{color:#fff}.___SClose_u6arl_gg_._theme_custom_u6arl_gg_{opacity:.5}.___SClose_u6arl_gg_._theme_custom_u6arl_gg_:hover{opacity:1}"
|
|
54
54
|
/*__inner_css_end__*/
|
|
55
|
-
, "
|
|
55
|
+
, "rejl88_gg_")
|
|
56
56
|
/*__reshadow_css_end__*/
|
|
57
57
|
, {
|
|
58
|
-
"__STag": "
|
|
59
|
-
"__SText": "
|
|
60
|
-
"__SAddon": "
|
|
61
|
-
"__SCircle": "
|
|
62
|
-
"_disabled": "
|
|
63
|
-
"_interactive": "
|
|
64
|
-
"_size_xl": "
|
|
65
|
-
"_size_l": "
|
|
66
|
-
"_size_m": "
|
|
67
|
-
"_size_s": "
|
|
68
|
-
"_theme_primary-muted": "_theme_primary-
|
|
69
|
-
"_active": "
|
|
70
|
-
"_theme_primary-warning": "_theme_primary-
|
|
71
|
-
"__SClose": "
|
|
72
|
-
"_theme_primary-invert": "_theme_primary-
|
|
73
|
-
"_theme_secondary-muted": "_theme_secondary-
|
|
74
|
-
"_theme_secondary-invert": "_theme_secondary-
|
|
75
|
-
"_theme_custom": "
|
|
76
|
-
"--colorText": "--
|
|
77
|
-
"--colorTag": "--
|
|
58
|
+
"__STag": "___STag_u6arl_gg_",
|
|
59
|
+
"__SText": "___SText_u6arl_gg_",
|
|
60
|
+
"__SAddon": "___SAddon_u6arl_gg_",
|
|
61
|
+
"__SCircle": "___SCircle_u6arl_gg_",
|
|
62
|
+
"_disabled": "__disabled_u6arl_gg_",
|
|
63
|
+
"_interactive": "__interactive_u6arl_gg_",
|
|
64
|
+
"_size_xl": "_size_xl_u6arl_gg_",
|
|
65
|
+
"_size_l": "_size_l_u6arl_gg_",
|
|
66
|
+
"_size_m": "_size_m_u6arl_gg_",
|
|
67
|
+
"_size_s": "_size_s_u6arl_gg_",
|
|
68
|
+
"_theme_primary-muted": "_theme_primary-muted_u6arl_gg_",
|
|
69
|
+
"_active": "__active_u6arl_gg_",
|
|
70
|
+
"_theme_primary-warning": "_theme_primary-warning_u6arl_gg_",
|
|
71
|
+
"__SClose": "___SClose_u6arl_gg_",
|
|
72
|
+
"_theme_primary-invert": "_theme_primary-invert_u6arl_gg_",
|
|
73
|
+
"_theme_secondary-muted": "_theme_secondary-muted_u6arl_gg_",
|
|
74
|
+
"_theme_secondary-invert": "_theme_secondary-invert_u6arl_gg_",
|
|
75
|
+
"_theme_custom": "_theme_custom_u6arl_gg_",
|
|
76
|
+
"--colorText": "--colorText_rejl88",
|
|
77
|
+
"--colorTag": "--colorTag_rejl88"
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
function isCustomTheme(use, theme) {
|
|
@@ -113,7 +113,7 @@ var RootTag = /*#__PURE__*/function (_Component) {
|
|
|
113
113
|
}, {
|
|
114
114
|
key: "render",
|
|
115
115
|
value: function render() {
|
|
116
|
-
var _ref = this
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
|
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 =
|
|
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
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA","sourcesContent":["export { default } from './Tag';\n"],"file":"index.js"}
|
|
@@ -15,15 +15,13 @@ STag {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
SText {
|
|
18
|
-
display: inline-
|
|
19
|
-
align-items: center;
|
|
20
|
-
height: 100%;
|
|
18
|
+
display: inline-block;
|
|
21
19
|
padding-left: 4px;
|
|
22
20
|
padding-right: 4px;
|
|
23
21
|
white-space: nowrap;
|
|
24
22
|
overflow: hidden;
|
|
25
23
|
text-overflow: ellipsis;
|
|
26
|
-
line-height: 1.
|
|
24
|
+
line-height: 1.2;
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
SText:not(:only-child):first-child {
|
package/lib/es6/Tag.js
CHANGED
|
@@ -31,31 +31,31 @@ var style = (
|
|
|
31
31
|
/*__reshadow_css_start__*/
|
|
32
32
|
_sstyled.insert(
|
|
33
33
|
/*__inner_css_start__*/
|
|
34
|
-
".
|
|
34
|
+
".___STag_u6arl_gg_{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;box-sizing:border-box;border-width:1px;border-style:solid;border-color:transparent;border-radius:21px;padding-left:4px;padding-right:4px}.___SText_u6arl_gg_{display:inline-block;padding-left:4px;padding-right:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2}.___SText_u6arl_gg_:not(:only-child):first-child{padding-right:0}.___SText_u6arl_gg_:not(:first-child):not(:last-child){padding-left:0;padding-right:0}.___SText_u6arl_gg_:not(:only-child):last-child{padding-left:0}.___SAddon_u6arl_gg_{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;padding-left:4px;padding-right:4px}.___SCircle_u6arl_gg_{display:inline-flex;align-items:center;justify-content:center;overflow:hidden;border-radius:50%;margin-right:4px}.___STag_u6arl_gg_.__disabled_u6arl_gg_{opacity:0.3;cursor:default;pointer-events:none}.___STag_u6arl_gg_.__interactive_u6arl_gg_{cursor:pointer}.___STag_u6arl_gg_._size_xl_u6arl_gg_{height:42px;min-width:42px;font-size:16px}.___STag_u6arl_gg_._size_xl_u6arl_gg_ .___SCircle_u6arl_gg_{width:28px;height:28px}.___STag_u6arl_gg_._size_l_u6arl_gg_{height:32px;min-width:32px;font-size:14px}.___STag_u6arl_gg_._size_l_u6arl_gg_ .___SCircle_u6arl_gg_{width:24px;height:24px}.___STag_u6arl_gg_._size_m_u6arl_gg_{height:26px;min-width:26px;font-size:12px}.___STag_u6arl_gg_._size_m_u6arl_gg_ .___SCircle_u6arl_gg_{width:20px;height:20px}.___STag_u6arl_gg_._size_s_u6arl_gg_{height:18px;min-width:18px;font-size:10px}.___STag_u6arl_gg_._size_s_u6arl_gg_ .___SCircle_u6arl_gg_{width:12px;height:12px}.___STag_u6arl_gg_._theme_primary-muted_u6arl_gg_{background-color:rgba(224,225,233,.5);color:#6c6e79}.___STag_u6arl_gg_._theme_primary-muted_u6arl_gg_.__active_u6arl_gg_,.___STag_u6arl_gg_._theme_primary-muted_u6arl_gg_.__interactive_u6arl_gg_:active,.___STag_u6arl_gg_._theme_primary-muted_u6arl_gg_.__interactive_u6arl_gg_:hover{background-color:#e0e1e9}.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_{background-color:rgba(255,127,0,.15);color:#ff7f00}.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__active_u6arl_gg_,.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__interactive_u6arl_gg_:active,.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__interactive_u6arl_gg_:hover{background-color:#ff7f00;color:#fff}.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__active_u6arl_gg_ .___SClose_u6arl_gg_,.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__interactive_u6arl_gg_:active .___SClose_u6arl_gg_,.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__interactive_u6arl_gg_:hover .___SClose_u6arl_gg_{color:hsla(0,0%,100%,.15)}.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__active_u6arl_gg_ .___SClose_u6arl_gg_:hover,.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__interactive_u6arl_gg_:active .___SClose_u6arl_gg_:hover,.___STag_u6arl_gg_._theme_primary-warning_u6arl_gg_.__interactive_u6arl_gg_:hover .___SClose_u6arl_gg_:hover{color:#fff}.___STag_u6arl_gg_._theme_primary-invert_u6arl_gg_{background-color:hsla(0,0%,100%,.2);color:#fff}.___STag_u6arl_gg_._theme_primary-invert_u6arl_gg_.__active_u6arl_gg_,.___STag_u6arl_gg_._theme_primary-invert_u6arl_gg_.__interactive_u6arl_gg_:active{background-color:#fff;color:#333333}.___STag_u6arl_gg_._theme_primary-invert_u6arl_gg_.__interactive_u6arl_gg_:hover{background-color:#fff;color:#333333}.___STag_u6arl_gg_._theme_primary-invert_u6arl_gg_.__interactive_u6arl_gg_ .___SClose_u6arl_gg_:hover{color:#333333}.___STag_u6arl_gg_._theme_secondary-muted_u6arl_gg_{background-color:#fff;color:#666666;border-color:#a6b0b3}.___STag_u6arl_gg_._theme_secondary-muted_u6arl_gg_.__interactive_u6arl_gg_:hover{color:#333333}.___STag_u6arl_gg_._theme_secondary-muted_u6arl_gg_.__active_u6arl_gg_,.___STag_u6arl_gg_._theme_secondary-muted_u6arl_gg_.__interactive_u6arl_gg_:active{background-color:#eeeeee;color:#333333}.___STag_u6arl_gg_._theme_secondary-invert_u6arl_gg_{border-color:hsla(0,0%,100%,.2);color:#fff}.___STag_u6arl_gg_._theme_secondary-invert_u6arl_gg_.__interactive_u6arl_gg_:hover{border-color:hsla(0,0%,100%,.5)}.___STag_u6arl_gg_._theme_secondary-invert_u6arl_gg_.__active_u6arl_gg_,.___STag_u6arl_gg_._theme_secondary-invert_u6arl_gg_.__interactive_u6arl_gg_:active{background-color:hsla(0,0%,100%,.1);border-color:hsla(0,0%,100%,.5)}.___STag_u6arl_gg_._theme_custom_u6arl_gg_{color:var(--colorText_rejl88);background-color:var(--colorTag_rejl88)}.___STag_u6arl_gg_._theme_custom_u6arl_gg_.__active_u6arl_gg_{color:#fff;background-color:var(--colorText_rejl88)}.___STag_u6arl_gg_._theme_custom_u6arl_gg_.__interactive_u6arl_gg_:hover{color:#fff;background-color:var(--colorText_rejl88)}.___STag_u6arl_gg_._theme_custom_u6arl_gg_.__interactive_u6arl_gg_:active{color:#fff;background-color:var(--colorText_rejl88)}.___SClose_u6arl_gg_{cursor:pointer;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;padding:4px}.___SClose_u6arl_gg_._theme_primary-warning_u6arl_gg_{color:rgba(255,127,0,.5)}.___SClose_u6arl_gg_._theme_primary-invert_u6arl_gg_{color:#999}.___SClose_u6arl_gg_._theme_primary-invert_u6arl_gg_:hover{color:#fff}.___SClose_u6arl_gg_._theme_secondary-muted_u6arl_gg_{color:hsla(0,0%,40%,.5)}.___SClose_u6arl_gg_._theme_secondary-muted_u6arl_gg_:hover{color:#333333}.___SClose_u6arl_gg_._theme_secondary-invert_u6arl_gg_{color:hsla(0,0%,100%,.5)}.___SClose_u6arl_gg_._theme_secondary-invert_u6arl_gg_:hover{color:#fff}.___SClose_u6arl_gg_._theme_custom_u6arl_gg_{opacity:.5}.___SClose_u6arl_gg_._theme_custom_u6arl_gg_:hover{opacity:1}"
|
|
35
35
|
/*__inner_css_end__*/
|
|
36
|
-
, "
|
|
36
|
+
, "rejl88_gg_")
|
|
37
37
|
/*__reshadow_css_end__*/
|
|
38
38
|
, {
|
|
39
|
-
"__STag": "
|
|
40
|
-
"__SText": "
|
|
41
|
-
"__SAddon": "
|
|
42
|
-
"__SCircle": "
|
|
43
|
-
"_disabled": "
|
|
44
|
-
"_interactive": "
|
|
45
|
-
"_size_xl": "
|
|
46
|
-
"_size_l": "
|
|
47
|
-
"_size_m": "
|
|
48
|
-
"_size_s": "
|
|
49
|
-
"_theme_primary-muted": "_theme_primary-
|
|
50
|
-
"_active": "
|
|
51
|
-
"_theme_primary-warning": "_theme_primary-
|
|
52
|
-
"__SClose": "
|
|
53
|
-
"_theme_primary-invert": "_theme_primary-
|
|
54
|
-
"_theme_secondary-muted": "_theme_secondary-
|
|
55
|
-
"_theme_secondary-invert": "_theme_secondary-
|
|
56
|
-
"_theme_custom": "
|
|
57
|
-
"--colorText": "--
|
|
58
|
-
"--colorTag": "--
|
|
39
|
+
"__STag": "___STag_u6arl_gg_",
|
|
40
|
+
"__SText": "___SText_u6arl_gg_",
|
|
41
|
+
"__SAddon": "___SAddon_u6arl_gg_",
|
|
42
|
+
"__SCircle": "___SCircle_u6arl_gg_",
|
|
43
|
+
"_disabled": "__disabled_u6arl_gg_",
|
|
44
|
+
"_interactive": "__interactive_u6arl_gg_",
|
|
45
|
+
"_size_xl": "_size_xl_u6arl_gg_",
|
|
46
|
+
"_size_l": "_size_l_u6arl_gg_",
|
|
47
|
+
"_size_m": "_size_m_u6arl_gg_",
|
|
48
|
+
"_size_s": "_size_s_u6arl_gg_",
|
|
49
|
+
"_theme_primary-muted": "_theme_primary-muted_u6arl_gg_",
|
|
50
|
+
"_active": "__active_u6arl_gg_",
|
|
51
|
+
"_theme_primary-warning": "_theme_primary-warning_u6arl_gg_",
|
|
52
|
+
"__SClose": "___SClose_u6arl_gg_",
|
|
53
|
+
"_theme_primary-invert": "_theme_primary-invert_u6arl_gg_",
|
|
54
|
+
"_theme_secondary-muted": "_theme_secondary-muted_u6arl_gg_",
|
|
55
|
+
"_theme_secondary-invert": "_theme_secondary-invert_u6arl_gg_",
|
|
56
|
+
"_theme_custom": "_theme_custom_u6arl_gg_",
|
|
57
|
+
"--colorText": "--colorText_rejl88",
|
|
58
|
+
"--colorTag": "--colorTag_rejl88"
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
function isCustomTheme(use, theme) {
|
|
@@ -95,7 +95,7 @@ var RootTag = /*#__PURE__*/function (_Component) {
|
|
|
95
95
|
}, {
|
|
96
96
|
key: "render",
|
|
97
97
|
value: function render() {
|
|
98
|
-
var _ref = this
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
package/lib/es6/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.js"],"names":["default"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB
|
|
1
|
+
{"version":3,"sources":["../../src/index.js"],"names":["default"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB","sourcesContent":["export { default } from './Tag';\n"],"file":"index.js"}
|
|
@@ -15,15 +15,13 @@ STag {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
SText {
|
|
18
|
-
display: inline-
|
|
19
|
-
align-items: center;
|
|
20
|
-
height: 100%;
|
|
18
|
+
display: inline-block;
|
|
21
19
|
padding-left: 4px;
|
|
22
20
|
padding-right: 4px;
|
|
23
21
|
white-space: nowrap;
|
|
24
22
|
overflow: hidden;
|
|
25
23
|
text-overflow: ellipsis;
|
|
26
|
-
line-height: 1.
|
|
24
|
+
line-height: 1.2;
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
SText:not(:only-child):first-child {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/tag",
|
|
3
3
|
"description": "SEMRush Tag Component",
|
|
4
|
-
"version": "3.
|
|
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
package/src/style/tag.shadow.css
CHANGED
|
@@ -15,15 +15,13 @@ STag {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
SText {
|
|
18
|
-
display: inline-
|
|
19
|
-
align-items: center;
|
|
20
|
-
height: 100%;
|
|
18
|
+
display: inline-block;
|
|
21
19
|
padding-left: 4px;
|
|
22
20
|
padding-right: 4px;
|
|
23
21
|
white-space: nowrap;
|
|
24
22
|
overflow: hidden;
|
|
25
23
|
text-overflow: ellipsis;
|
|
26
|
-
line-height: 1.
|
|
24
|
+
line-height: 1.2;
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
SText:not(:only-child):first-child {
|