@semcore/tag 4.1.4 → 4.1.6
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 +2 -98
- package/LICENSE +21 -0
- package/lib/cjs/Tag.js +22 -22
- package/lib/cjs/index.d.js +2 -0
- package/lib/cjs/index.d.js.map +1 -0
- package/lib/es6/Tag.js +22 -22
- package/lib/es6/index.d.js +2 -0
- package/lib/es6/index.d.js.map +1 -0
- package/package.json +7 -6
- package/lib/cjs/index.d.ts +0 -69
- package/lib/es6/index.d.ts +0 -69
package/CHANGELOG.md
CHANGED
|
@@ -2,23 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
-
## [4.1.
|
|
5
|
+
## [4.1.6] - 2022-10-06
|
|
6
6
|
|
|
7
7
|
### Changed
|
|
8
8
|
|
|
9
|
-
- Version patch update due to children dependencies update (`@semcore/icon` [2.
|
|
10
|
-
|
|
11
|
-
## [4.1.3] - 2022-09-21
|
|
12
|
-
|
|
13
|
-
### Changed
|
|
14
|
-
|
|
15
|
-
- Version patch update due to children dependencies update (`@semcore/icon` [2.30.3 ~> 2.30.4]).
|
|
16
|
-
|
|
17
|
-
## [4.1.2] - 2022-09-21
|
|
18
|
-
|
|
19
|
-
### Changed
|
|
20
|
-
|
|
21
|
-
- Version patch update due to children dependencies update (`@semcore/icon` [2.30.2 ~> 2.30.3]).
|
|
9
|
+
- Version patch update due to children dependencies update (`@semcore/icon` [2.32.2 ~> 2.33.0]).
|
|
22
10
|
|
|
23
11
|
## [4.1.1] - 2022-09-07
|
|
24
12
|
|
|
@@ -50,54 +38,6 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
|
|
|
50
38
|
|
|
51
39
|
- Version patch update due to children dependencies update (`@semcore/icon` [2.30.0 ~> 2.30.1]).
|
|
52
40
|
|
|
53
|
-
## [4.0.14] - 2022-08-18
|
|
54
|
-
|
|
55
|
-
### Changed
|
|
56
|
-
|
|
57
|
-
- Version patch update due to children dependencies update (`@semcore/icon` [2.29.5 ~> 2.30.0]).
|
|
58
|
-
|
|
59
|
-
## [4.0.13] - 2022-08-18
|
|
60
|
-
|
|
61
|
-
### Changed
|
|
62
|
-
|
|
63
|
-
- Version patch update due to children dependencies update (`@semcore/utils` [3.36.0 ~> 3.37.0], `@semcore/icon` [2.29.4 ~> 2.29.5], `@semcore/flex-box` [4.5.9 ~> 4.5.10]).
|
|
64
|
-
|
|
65
|
-
## [4.0.12] - 2022-08-11
|
|
66
|
-
|
|
67
|
-
### Changed
|
|
68
|
-
|
|
69
|
-
- Version patch update due to children dependencies update (`@semcore/utils` [3.35.1 ~> 3.36.0], `@semcore/icon` [2.29.3 ~> 2.29.4], `@semcore/flex-box` [4.5.8 ~> 4.5.9]).
|
|
70
|
-
|
|
71
|
-
## [4.0.11] - 2022-08-01
|
|
72
|
-
|
|
73
|
-
### Changed
|
|
74
|
-
|
|
75
|
-
- Version patch update due to children dependencies update (`@semcore/utils` [3.35.0 ~> 3.35.1], `@semcore/icon` [2.29.2 ~> 2.29.3], `@semcore/flex-box` [4.5.7 ~> 4.5.8]).
|
|
76
|
-
|
|
77
|
-
## [4.0.10] - 2022-07-25
|
|
78
|
-
|
|
79
|
-
### Changed
|
|
80
|
-
|
|
81
|
-
- Version patch update due to children dependencies update (`@semcore/icon` [2.29.1 ~> 2.29.2]).
|
|
82
|
-
|
|
83
|
-
## [4.0.9] - 2022-07-22
|
|
84
|
-
|
|
85
|
-
### Changed
|
|
86
|
-
|
|
87
|
-
- Version patch update due to children dependencies update (`@semcore/utils` [3.34.0 ~> 3.35.0], `@semcore/icon` [2.29.0 ~> 2.29.1], `@semcore/flex-box` [4.5.6 ~> 4.5.7]).
|
|
88
|
-
|
|
89
|
-
## [4.0.8] - 2022-07-21
|
|
90
|
-
|
|
91
|
-
### Changed
|
|
92
|
-
|
|
93
|
-
- Version patch update due to children dependencies update (`@semcore/icon` [2.28.0 ~> 2.29.0]).
|
|
94
|
-
|
|
95
|
-
## [4.0.7] - 2022-07-07
|
|
96
|
-
|
|
97
|
-
### Changed
|
|
98
|
-
|
|
99
|
-
- Version patch update due to children dependencies update (`@semcore/utils` [3.33.0 ~> 3.34.0], `@semcore/icon` [2.27.0 ~> 2.28.0], `@semcore/flex-box` [4.5.5 ~> 4.5.6]).
|
|
100
|
-
|
|
101
41
|
## [4.0.6] - 2022-06-07
|
|
102
42
|
|
|
103
43
|
### Fixed
|
|
@@ -110,30 +50,6 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
|
|
|
110
50
|
|
|
111
51
|
- Version patch update due to children dependencies update (`@semcore/utils` [3.32.2 ~> 3.33.0], `@semcore/icon` [2.26.1 ~> 2.27.0], `@semcore/flex-box` [4.5.4 ~> 4.5.5]).
|
|
112
52
|
|
|
113
|
-
## [4.0.4] - 2022-05-31
|
|
114
|
-
|
|
115
|
-
### Changed
|
|
116
|
-
|
|
117
|
-
- Version patch update due to children dependencies update (`@semcore/utils` [3.32.1 ~> 3.32.2], `@semcore/icon` [2.26.0 ~> 2.26.1], `@semcore/flex-box` [4.5.3 ~> 4.5.4]).
|
|
118
|
-
|
|
119
|
-
## [4.0.3] - 2022-05-23
|
|
120
|
-
|
|
121
|
-
### Changed
|
|
122
|
-
|
|
123
|
-
- Version patch update due to children dependencies update (`@semcore/icon` [2.25.1 ~> 2.26.0]).
|
|
124
|
-
|
|
125
|
-
## [4.0.2] - 2022-05-19
|
|
126
|
-
|
|
127
|
-
### Changed
|
|
128
|
-
|
|
129
|
-
- Version patch update due to children dependencies update (`@semcore/utils` [3.32.0 ~> 3.32.1], `@semcore/icon` [2.25.0 ~> 2.25.1], `@semcore/flex-box` [4.5.1 ~> 4.5.3]).
|
|
130
|
-
|
|
131
|
-
## [4.0.1] - 2022-05-18
|
|
132
|
-
|
|
133
|
-
### Changed
|
|
134
|
-
|
|
135
|
-
- Version patch update due to children dependencies update (`@semcore/icon` [2.24.0 ~> 2.25.0]).
|
|
136
|
-
|
|
137
53
|
## [4.0.0] - 2022-05-17
|
|
138
54
|
|
|
139
55
|
### BREAK
|
|
@@ -151,18 +67,6 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
|
|
|
151
67
|
|
|
152
68
|
- Version patch update due to children dependencies update (`@semcore/icon` [2.21.0 ~> 2.24.0]).
|
|
153
69
|
|
|
154
|
-
## [3.7.2] - 2022-04-28
|
|
155
|
-
|
|
156
|
-
### Changed
|
|
157
|
-
|
|
158
|
-
- Version patch update due to children dependencies update (`@semcore/icon` [2.20.0 ~> 2.21.0]).
|
|
159
|
-
|
|
160
|
-
## [3.7.1] - 2022-03-21
|
|
161
|
-
|
|
162
|
-
### Changed
|
|
163
|
-
|
|
164
|
-
- Version patch update due to children dependencies update (`@semcore/icon` [2.19.4 ~> 2.20.0]).
|
|
165
|
-
|
|
166
70
|
## [3.7.0] - 2022-03-18
|
|
167
71
|
|
|
168
72
|
### Fixed
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright ©, 2022, Semrush Inc. (written by Roman Lysov, Sergey Kobets, Mikhail Karachev, Julia Mnizhek, Elena Krasnopolskaia, Mikhail Sereniti).
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/lib/cjs/Tag.js
CHANGED
|
@@ -52,31 +52,31 @@ var style = (
|
|
|
52
52
|
/*__reshadow_css_start__*/
|
|
53
53
|
_core.sstyled.insert(
|
|
54
54
|
/*__inner_css_start__*/
|
|
55
|
-
".
|
|
55
|
+
":root {\n\n /* DEPRECATED START\n Deprecated variables should never be used in\n components styles but preserved for backward\n compatibility if they used in projects\n like `<Badge bg=\"red\">alpha</Badge>`\n */\n /* DEPRECATED END */\n}\n\n.___STag_17nfn_gg_ {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n box-sizing: border-box;\n border-width: 1px;\n border-style: solid;\n border-color: transparent;\n border-radius: 24px;\n padding-left: 4px;\n padding-right: 4px;\n font-weight: 500;\n background-color: var(--colorBg_17nfn);\n color: var(--colorText_17nfn);\n border-color: var(--colorBorder_17nfn)\n}\n\n.___STag_17nfn_gg_.__interactive_17nfn_gg_:hover,\n .___STag_17nfn_gg_.__interactive_17nfn_gg_:active,\n .___STag_17nfn_gg_.__active_17nfn_gg_ {\n background-color: var(--colorBgHover_17nfn);\n }\n\n.___STag_17nfn_gg_.__disabled_17nfn_gg_ {\n opacity: 0.3;\n cursor: default;\n pointer-events: none; /* Disable link interactions */\n}\n\n.___STag_17nfn_gg_.__interactive_17nfn_gg_ {\n cursor: pointer;\n}\n\n.___STag_17nfn_gg_._size_m_17nfn_gg_ {\n height: 20px;\n min-width: 20px\n}\n\n.___STag_17nfn_gg_._size_m_17nfn_gg_ .___SCircle_17nfn_gg_:first-child {\n margin-left: -2px;\n }\n\n.___STag_17nfn_gg_._size_m_17nfn_gg_ .___SCircle_17nfn_gg_:last-child {\n margin-right: -2px;\n }\n\n.___STag_17nfn_gg_._size_m_17nfn_gg_ .___SText_17nfn_gg_ {\n font-size: 12px;\n line-height: 1.33;\n }\n\n.___STag_17nfn_gg_._size_l_17nfn_gg_ {\n height: 28px;\n min-width: 28px\n}\n\n.___STag_17nfn_gg_._size_l_17nfn_gg_ .___SText_17nfn_gg_ {\n font-size: 14px;\n line-height: 1.42;\n }\n\n.___STag_17nfn_gg_._size_xl_17nfn_gg_ {\n height: 40px;\n min-width: 40px\n}\n\n.___STag_17nfn_gg_._size_xl_17nfn_gg_ .___SText_17nfn_gg_ {\n font-size: 16px;\n line-height: 1.5;\n }\n\n.___STag_17nfn_gg_._theme_primary_17nfn_gg_ {\n background-color: var(--colorBg_17nfn);\n border-color: var(--colorBg_17nfn);\n color: var(--colorText_17nfn)\n}\n\n.___STag_17nfn_gg_._theme_primary_17nfn_gg_.__interactive_17nfn_gg_:hover,\n .___STag_17nfn_gg_._theme_primary_17nfn_gg_.__interactive_17nfn_gg_:active,\n .___STag_17nfn_gg_._theme_primary_17nfn_gg_.__active_17nfn_gg_ {\n background-color: var(--colorBgHover_17nfn);\n }\n\n.___STag_17nfn_gg_._theme_primary-invert_17nfn_gg_ {\n background-color: rgba(255, 255, 255, 0.15);\n color: #ffffff\n}\n\n.___STag_17nfn_gg_._theme_primary-invert_17nfn_gg_.__interactive_17nfn_gg_:hover,\n .___STag_17nfn_gg_._theme_primary-invert_17nfn_gg_.__interactive_17nfn_gg_:active,\n .___STag_17nfn_gg_._theme_primary-invert_17nfn_gg_.__active_17nfn_gg_ {\n background-color: rgba(255, 255, 255, 0.3);\n }\n\n.___STag_17nfn_gg_._theme_secondary-invert_17nfn_gg_,\n.___STag_17nfn_gg_._theme_additional-invert_17nfn_gg_ {\n color: #ffffff;\n border-color: rgba(255, 255, 255, 0.3)\n}\n\n.___STag_17nfn_gg_._theme_secondary-invert_17nfn_gg_.__interactive_17nfn_gg_:hover,\n .___STag_17nfn_gg_._theme_secondary-invert_17nfn_gg_.__interactive_17nfn_gg_:active,\n .___STag_17nfn_gg_._theme_secondary-invert_17nfn_gg_.__active_17nfn_gg_,\n .___STag_17nfn_gg_._theme_additional-invert_17nfn_gg_.__interactive_17nfn_gg_:hover,\n .___STag_17nfn_gg_._theme_additional-invert_17nfn_gg_.__interactive_17nfn_gg_:active,\n .___STag_17nfn_gg_._theme_additional-invert_17nfn_gg_.__active_17nfn_gg_ {\n background-color: rgba(255, 255, 255, 0.1);\n }\n\n.___STag_17nfn_gg_._theme_additional_17nfn_gg_ {\n border-style: dashed;\n}\n\n.___SText_17nfn_gg_ {\n display: inline-block;\n padding-left: 4px;\n padding-right: 4px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.___SText_17nfn_gg_:not(:only-child):first-child {\n padding-right: 0;\n}\n\n.___SText_17nfn_gg_:not(:first-child):not(:last-child) {\n padding-left: 0;\n padding-right: 0;\n}\n\n.___SText_17nfn_gg_:not(:only-child):last-child {\n padding-left: 0;\n}\n\n.___SAddon_17nfn_gg_ {\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n padding-left: 4px;\n padding-right: 4px;\n}\n\n.___SCircle_17nfn_gg_ {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n border-radius: 50%;\n margin: 0 4px\n}\n\n.___SCircle_17nfn_gg_:first-child {\n margin-left: 0;\n }\n\n.___SCircle_17nfn_gg_:last-child {\n margin-right: 0;\n }\n\n.___SCircle_17nfn_gg_._size_m_17nfn_gg_ {\n width: 16px;\n height: 16px;\n}\n\n.___SCircle_17nfn_gg_._size_l_17nfn_gg_ {\n width: 20px;\n height: 20px;\n}\n\n.___SCircle_17nfn_gg_._size_xl_17nfn_gg_ {\n width: 20px;\n height: 20px;\n}\n\n.___SClose_17nfn_gg_ {\n cursor: pointer;\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n padding: 4px;\n}\n"
|
|
56
56
|
/*__inner_css_end__*/
|
|
57
|
-
, "
|
|
57
|
+
, "17nfn_gg_")
|
|
58
58
|
/*__reshadow_css_end__*/
|
|
59
59
|
, {
|
|
60
|
-
"__STag": "
|
|
61
|
-
"--colorBg": "--
|
|
62
|
-
"--colorText": "--
|
|
63
|
-
"--colorBorder": "--
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"--colorBgHover": "--
|
|
67
|
-
"_disabled": "
|
|
68
|
-
"_size_m": "
|
|
69
|
-
"__SCircle": "
|
|
70
|
-
"__SText": "
|
|
71
|
-
"_size_l": "
|
|
72
|
-
"_size_xl": "
|
|
73
|
-
"_theme_primary": "
|
|
74
|
-
"_theme_primary-invert": "_theme_primary-
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"_theme_additional": "
|
|
78
|
-
"__SAddon": "
|
|
79
|
-
"__SClose": "
|
|
60
|
+
"__STag": "___STag_17nfn_gg_",
|
|
61
|
+
"--colorBg": "--colorBg_17nfn",
|
|
62
|
+
"--colorText": "--colorText_17nfn",
|
|
63
|
+
"--colorBorder": "--colorBorder_17nfn",
|
|
64
|
+
"_interactive": "__interactive_17nfn_gg_",
|
|
65
|
+
"_active": "__active_17nfn_gg_",
|
|
66
|
+
"--colorBgHover": "--colorBgHover_17nfn",
|
|
67
|
+
"_disabled": "__disabled_17nfn_gg_",
|
|
68
|
+
"_size_m": "_size_m_17nfn_gg_",
|
|
69
|
+
"__SCircle": "___SCircle_17nfn_gg_",
|
|
70
|
+
"__SText": "___SText_17nfn_gg_",
|
|
71
|
+
"_size_l": "_size_l_17nfn_gg_",
|
|
72
|
+
"_size_xl": "_size_xl_17nfn_gg_",
|
|
73
|
+
"_theme_primary": "_theme_primary_17nfn_gg_",
|
|
74
|
+
"_theme_primary-invert": "_theme_primary-invert_17nfn_gg_",
|
|
75
|
+
"_theme_secondary-invert": "_theme_secondary-invert_17nfn_gg_",
|
|
76
|
+
"_theme_additional-invert": "_theme_additional-invert_17nfn_gg_",
|
|
77
|
+
"_theme_additional": "_theme_additional_17nfn_gg_",
|
|
78
|
+
"__SAddon": "___SAddon_17nfn_gg_",
|
|
79
|
+
"__SClose": "___SClose_17nfn_gg_"
|
|
80
80
|
});
|
|
81
81
|
var textColorToBgColor = {
|
|
82
82
|
'gray-500': 'gray-100',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { CProps, ReturnEl, PropGetterFn } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\nimport { IIconProps } from '@semcore/icon';\n\nexport type TagSize = 'xl' | 'l' | 'm';\nexport type TagThemeOld = 'muted' | 'info' | 'success' | 'warning' | 'danger' | 'invert';\nexport type TagTheme = 'primary' | 'secondary' | 'additional' | (string & TagThemeOld);\nexport type TagUse = 'primary' | 'secondary';\n\nexport interface ITagProps extends IBoxProps {\n /** Value responsible for tag availability\n */\n disabled?: boolean;\n /** Value responsible for tag activity\n */\n active?: boolean;\n /** Interactive tag\n */\n interactive?: boolean;\n /** Tag type\n * @default secondary\n * @deprecated v4.0.0\n * @use ITagProps.theme\n */\n use?: TagUse;\n /** Tag theme, there are several default themes or you can use your color\n * @default muted\n */\n theme?: TagTheme;\n /** Tag color text */\n color?: string;\n /** Tag size\n * @default m\n */\n size?: TagSize;\n /** Left addon tag */\n addonLeft?: React.ElementType;\n /** Right addon tag */\n addonRight?: React.ElementType;\n}\n\nexport interface ITagCloseProps extends IIconProps {\n /** Tag type\n * @default secondary\n */\n use?: TagUse;\n /** Tag theme, there are several default themes or you can use your color\n * @default muted\n */\n theme?: TagTheme;\n}\n\nexport interface ITagContext extends ITagProps {\n getCloseProps?: PropGetterFn;\n}\n\nexport interface ITagAddonProps extends IBoxProps {}\n\nexport interface ITagTextProps extends IBoxProps {}\n\ndeclare const Tag: (<T>(props: CProps<ITagProps & T, ITagContext>) => ReturnEl) & {\n Text: <T>(props: ITagTextProps & T) => ReturnEl;\n Addon: <T>(props: ITagAddonProps & T) => ReturnEl;\n Close: <T>(props: ITagCloseProps & T) => ReturnEl;\n Circle: <T>(props: ITagAddonProps & T) => ReturnEl;\n};\n\nexport default Tag;\n"],"mappings":""}
|
package/lib/es6/Tag.js
CHANGED
|
@@ -32,31 +32,31 @@ var style = (
|
|
|
32
32
|
/*__reshadow_css_start__*/
|
|
33
33
|
_sstyled.insert(
|
|
34
34
|
/*__inner_css_start__*/
|
|
35
|
-
".
|
|
35
|
+
":root {\n\n /* DEPRECATED START\n Deprecated variables should never be used in\n components styles but preserved for backward\n compatibility if they used in projects\n like `<Badge bg=\"red\">alpha</Badge>`\n */\n /* DEPRECATED END */\n}\n\n.___STag_17nfn_gg_ {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n box-sizing: border-box;\n border-width: 1px;\n border-style: solid;\n border-color: transparent;\n border-radius: 24px;\n padding-left: 4px;\n padding-right: 4px;\n font-weight: 500;\n background-color: var(--colorBg_17nfn);\n color: var(--colorText_17nfn);\n border-color: var(--colorBorder_17nfn)\n}\n\n.___STag_17nfn_gg_.__interactive_17nfn_gg_:hover,\n .___STag_17nfn_gg_.__interactive_17nfn_gg_:active,\n .___STag_17nfn_gg_.__active_17nfn_gg_ {\n background-color: var(--colorBgHover_17nfn);\n }\n\n.___STag_17nfn_gg_.__disabled_17nfn_gg_ {\n opacity: 0.3;\n cursor: default;\n pointer-events: none; /* Disable link interactions */\n}\n\n.___STag_17nfn_gg_.__interactive_17nfn_gg_ {\n cursor: pointer;\n}\n\n.___STag_17nfn_gg_._size_m_17nfn_gg_ {\n height: 20px;\n min-width: 20px\n}\n\n.___STag_17nfn_gg_._size_m_17nfn_gg_ .___SCircle_17nfn_gg_:first-child {\n margin-left: -2px;\n }\n\n.___STag_17nfn_gg_._size_m_17nfn_gg_ .___SCircle_17nfn_gg_:last-child {\n margin-right: -2px;\n }\n\n.___STag_17nfn_gg_._size_m_17nfn_gg_ .___SText_17nfn_gg_ {\n font-size: 12px;\n line-height: 1.33;\n }\n\n.___STag_17nfn_gg_._size_l_17nfn_gg_ {\n height: 28px;\n min-width: 28px\n}\n\n.___STag_17nfn_gg_._size_l_17nfn_gg_ .___SText_17nfn_gg_ {\n font-size: 14px;\n line-height: 1.42;\n }\n\n.___STag_17nfn_gg_._size_xl_17nfn_gg_ {\n height: 40px;\n min-width: 40px\n}\n\n.___STag_17nfn_gg_._size_xl_17nfn_gg_ .___SText_17nfn_gg_ {\n font-size: 16px;\n line-height: 1.5;\n }\n\n.___STag_17nfn_gg_._theme_primary_17nfn_gg_ {\n background-color: var(--colorBg_17nfn);\n border-color: var(--colorBg_17nfn);\n color: var(--colorText_17nfn)\n}\n\n.___STag_17nfn_gg_._theme_primary_17nfn_gg_.__interactive_17nfn_gg_:hover,\n .___STag_17nfn_gg_._theme_primary_17nfn_gg_.__interactive_17nfn_gg_:active,\n .___STag_17nfn_gg_._theme_primary_17nfn_gg_.__active_17nfn_gg_ {\n background-color: var(--colorBgHover_17nfn);\n }\n\n.___STag_17nfn_gg_._theme_primary-invert_17nfn_gg_ {\n background-color: rgba(255, 255, 255, 0.15);\n color: #ffffff\n}\n\n.___STag_17nfn_gg_._theme_primary-invert_17nfn_gg_.__interactive_17nfn_gg_:hover,\n .___STag_17nfn_gg_._theme_primary-invert_17nfn_gg_.__interactive_17nfn_gg_:active,\n .___STag_17nfn_gg_._theme_primary-invert_17nfn_gg_.__active_17nfn_gg_ {\n background-color: rgba(255, 255, 255, 0.3);\n }\n\n.___STag_17nfn_gg_._theme_secondary-invert_17nfn_gg_,\n.___STag_17nfn_gg_._theme_additional-invert_17nfn_gg_ {\n color: #ffffff;\n border-color: rgba(255, 255, 255, 0.3)\n}\n\n.___STag_17nfn_gg_._theme_secondary-invert_17nfn_gg_.__interactive_17nfn_gg_:hover,\n .___STag_17nfn_gg_._theme_secondary-invert_17nfn_gg_.__interactive_17nfn_gg_:active,\n .___STag_17nfn_gg_._theme_secondary-invert_17nfn_gg_.__active_17nfn_gg_,\n .___STag_17nfn_gg_._theme_additional-invert_17nfn_gg_.__interactive_17nfn_gg_:hover,\n .___STag_17nfn_gg_._theme_additional-invert_17nfn_gg_.__interactive_17nfn_gg_:active,\n .___STag_17nfn_gg_._theme_additional-invert_17nfn_gg_.__active_17nfn_gg_ {\n background-color: rgba(255, 255, 255, 0.1);\n }\n\n.___STag_17nfn_gg_._theme_additional_17nfn_gg_ {\n border-style: dashed;\n}\n\n.___SText_17nfn_gg_ {\n display: inline-block;\n padding-left: 4px;\n padding-right: 4px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.___SText_17nfn_gg_:not(:only-child):first-child {\n padding-right: 0;\n}\n\n.___SText_17nfn_gg_:not(:first-child):not(:last-child) {\n padding-left: 0;\n padding-right: 0;\n}\n\n.___SText_17nfn_gg_:not(:only-child):last-child {\n padding-left: 0;\n}\n\n.___SAddon_17nfn_gg_ {\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n padding-left: 4px;\n padding-right: 4px;\n}\n\n.___SCircle_17nfn_gg_ {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n border-radius: 50%;\n margin: 0 4px\n}\n\n.___SCircle_17nfn_gg_:first-child {\n margin-left: 0;\n }\n\n.___SCircle_17nfn_gg_:last-child {\n margin-right: 0;\n }\n\n.___SCircle_17nfn_gg_._size_m_17nfn_gg_ {\n width: 16px;\n height: 16px;\n}\n\n.___SCircle_17nfn_gg_._size_l_17nfn_gg_ {\n width: 20px;\n height: 20px;\n}\n\n.___SCircle_17nfn_gg_._size_xl_17nfn_gg_ {\n width: 20px;\n height: 20px;\n}\n\n.___SClose_17nfn_gg_ {\n cursor: pointer;\n display: inline-flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n padding: 4px;\n}\n"
|
|
36
36
|
/*__inner_css_end__*/
|
|
37
|
-
, "
|
|
37
|
+
, "17nfn_gg_")
|
|
38
38
|
/*__reshadow_css_end__*/
|
|
39
39
|
, {
|
|
40
|
-
"__STag": "
|
|
41
|
-
"--colorBg": "--
|
|
42
|
-
"--colorText": "--
|
|
43
|
-
"--colorBorder": "--
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"--colorBgHover": "--
|
|
47
|
-
"_disabled": "
|
|
48
|
-
"_size_m": "
|
|
49
|
-
"__SCircle": "
|
|
50
|
-
"__SText": "
|
|
51
|
-
"_size_l": "
|
|
52
|
-
"_size_xl": "
|
|
53
|
-
"_theme_primary": "
|
|
54
|
-
"_theme_primary-invert": "_theme_primary-
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"_theme_additional": "
|
|
58
|
-
"__SAddon": "
|
|
59
|
-
"__SClose": "
|
|
40
|
+
"__STag": "___STag_17nfn_gg_",
|
|
41
|
+
"--colorBg": "--colorBg_17nfn",
|
|
42
|
+
"--colorText": "--colorText_17nfn",
|
|
43
|
+
"--colorBorder": "--colorBorder_17nfn",
|
|
44
|
+
"_interactive": "__interactive_17nfn_gg_",
|
|
45
|
+
"_active": "__active_17nfn_gg_",
|
|
46
|
+
"--colorBgHover": "--colorBgHover_17nfn",
|
|
47
|
+
"_disabled": "__disabled_17nfn_gg_",
|
|
48
|
+
"_size_m": "_size_m_17nfn_gg_",
|
|
49
|
+
"__SCircle": "___SCircle_17nfn_gg_",
|
|
50
|
+
"__SText": "___SText_17nfn_gg_",
|
|
51
|
+
"_size_l": "_size_l_17nfn_gg_",
|
|
52
|
+
"_size_xl": "_size_xl_17nfn_gg_",
|
|
53
|
+
"_theme_primary": "_theme_primary_17nfn_gg_",
|
|
54
|
+
"_theme_primary-invert": "_theme_primary-invert_17nfn_gg_",
|
|
55
|
+
"_theme_secondary-invert": "_theme_secondary-invert_17nfn_gg_",
|
|
56
|
+
"_theme_additional-invert": "_theme_additional-invert_17nfn_gg_",
|
|
57
|
+
"_theme_additional": "_theme_additional_17nfn_gg_",
|
|
58
|
+
"__SAddon": "___SAddon_17nfn_gg_",
|
|
59
|
+
"__SClose": "___SClose_17nfn_gg_"
|
|
60
60
|
});
|
|
61
61
|
var textColorToBgColor = {
|
|
62
62
|
'gray-500': 'gray-100',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { CProps, ReturnEl, PropGetterFn } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\nimport { IIconProps } from '@semcore/icon';\n\nexport type TagSize = 'xl' | 'l' | 'm';\nexport type TagThemeOld = 'muted' | 'info' | 'success' | 'warning' | 'danger' | 'invert';\nexport type TagTheme = 'primary' | 'secondary' | 'additional' | (string & TagThemeOld);\nexport type TagUse = 'primary' | 'secondary';\n\nexport interface ITagProps extends IBoxProps {\n /** Value responsible for tag availability\n */\n disabled?: boolean;\n /** Value responsible for tag activity\n */\n active?: boolean;\n /** Interactive tag\n */\n interactive?: boolean;\n /** Tag type\n * @default secondary\n * @deprecated v4.0.0\n * @use ITagProps.theme\n */\n use?: TagUse;\n /** Tag theme, there are several default themes or you can use your color\n * @default muted\n */\n theme?: TagTheme;\n /** Tag color text */\n color?: string;\n /** Tag size\n * @default m\n */\n size?: TagSize;\n /** Left addon tag */\n addonLeft?: React.ElementType;\n /** Right addon tag */\n addonRight?: React.ElementType;\n}\n\nexport interface ITagCloseProps extends IIconProps {\n /** Tag type\n * @default secondary\n */\n use?: TagUse;\n /** Tag theme, there are several default themes or you can use your color\n * @default muted\n */\n theme?: TagTheme;\n}\n\nexport interface ITagContext extends ITagProps {\n getCloseProps?: PropGetterFn;\n}\n\nexport interface ITagAddonProps extends IBoxProps {}\n\nexport interface ITagTextProps extends IBoxProps {}\n\ndeclare const Tag: (<T>(props: CProps<ITagProps & T, ITagContext>) => ReturnEl) & {\n Text: <T>(props: ITagTextProps & T) => ReturnEl;\n Addon: <T>(props: ITagAddonProps & T) => ReturnEl;\n Close: <T>(props: ITagCloseProps & T) => ReturnEl;\n Circle: <T>(props: ITagAddonProps & T) => ReturnEl;\n};\n\nexport default Tag;\n"],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/tag",
|
|
3
3
|
"description": "Semrush Tag Component",
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.6",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"author": "UI-kit team <ui-kit-team@semrush.com>",
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"scripts": {
|
|
12
|
-
"build": "build --source=js",
|
|
13
|
-
"test": "jest"
|
|
14
|
-
},
|
|
15
11
|
"dependencies": {
|
|
16
12
|
"@semcore/utils": "^3.37",
|
|
17
13
|
"@semcore/icon": "^2.16",
|
|
@@ -30,6 +26,11 @@
|
|
|
30
26
|
"directory": "semcore/tag"
|
|
31
27
|
},
|
|
32
28
|
"devDependencies": {
|
|
29
|
+
"@types/react": "16.8 - 17",
|
|
33
30
|
"@semcore/jest-preset-ui": "1.0.0"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "pnpm semcore-builder --source=js",
|
|
34
|
+
"test": "jest"
|
|
34
35
|
}
|
|
35
|
-
}
|
|
36
|
+
}
|
package/lib/cjs/index.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
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';
|
|
7
|
-
export type TagThemeOld = 'muted' | 'info' | 'success' | 'warning' | 'danger' | 'invert';
|
|
8
|
-
export type TagTheme = 'primary' | 'secondary' | 'additional' | (string & TagThemeOld);
|
|
9
|
-
export type TagUse = 'primary' | 'secondary';
|
|
10
|
-
|
|
11
|
-
export interface ITagProps extends IBoxProps {
|
|
12
|
-
/** Value responsible for tag availability
|
|
13
|
-
*/
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
/** Value responsible for tag activity
|
|
16
|
-
*/
|
|
17
|
-
active?: boolean;
|
|
18
|
-
/** Interactive tag
|
|
19
|
-
*/
|
|
20
|
-
interactive?: boolean;
|
|
21
|
-
/** Tag type
|
|
22
|
-
* @default secondary
|
|
23
|
-
* @deprecated v4.0.0
|
|
24
|
-
* @use ITagProps.theme
|
|
25
|
-
*/
|
|
26
|
-
use?: TagUse;
|
|
27
|
-
/** Tag theme, there are several default themes or you can use your color
|
|
28
|
-
* @default muted
|
|
29
|
-
*/
|
|
30
|
-
theme?: TagTheme;
|
|
31
|
-
/** Tag color text */
|
|
32
|
-
color?: string;
|
|
33
|
-
/** Tag size
|
|
34
|
-
* @default m
|
|
35
|
-
*/
|
|
36
|
-
size?: TagSize;
|
|
37
|
-
/** Left addon tag */
|
|
38
|
-
addonLeft?: React.ElementType;
|
|
39
|
-
/** Right addon tag */
|
|
40
|
-
addonRight?: React.ElementType;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface ITagCloseProps extends IIconProps {
|
|
44
|
-
/** Tag type
|
|
45
|
-
* @default secondary
|
|
46
|
-
*/
|
|
47
|
-
use?: TagUse;
|
|
48
|
-
/** Tag theme, there are several default themes or you can use your color
|
|
49
|
-
* @default muted
|
|
50
|
-
*/
|
|
51
|
-
theme?: TagTheme;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface ITagContext extends ITagProps {
|
|
55
|
-
getCloseProps?: PropGetterFn;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface ITagAddonProps extends IBoxProps {}
|
|
59
|
-
|
|
60
|
-
export interface ITagTextProps extends IBoxProps {}
|
|
61
|
-
|
|
62
|
-
declare const Tag: (<T>(props: CProps<ITagProps & T, ITagContext>) => ReturnEl) & {
|
|
63
|
-
Text: <T>(props: ITagTextProps & T) => ReturnEl;
|
|
64
|
-
Addon: <T>(props: ITagAddonProps & T) => ReturnEl;
|
|
65
|
-
Close: <T>(props: ITagCloseProps & T) => ReturnEl;
|
|
66
|
-
Circle: <T>(props: ITagAddonProps & T) => ReturnEl;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export default Tag;
|
package/lib/es6/index.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
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';
|
|
7
|
-
export type TagThemeOld = 'muted' | 'info' | 'success' | 'warning' | 'danger' | 'invert';
|
|
8
|
-
export type TagTheme = 'primary' | 'secondary' | 'additional' | (string & TagThemeOld);
|
|
9
|
-
export type TagUse = 'primary' | 'secondary';
|
|
10
|
-
|
|
11
|
-
export interface ITagProps extends IBoxProps {
|
|
12
|
-
/** Value responsible for tag availability
|
|
13
|
-
*/
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
/** Value responsible for tag activity
|
|
16
|
-
*/
|
|
17
|
-
active?: boolean;
|
|
18
|
-
/** Interactive tag
|
|
19
|
-
*/
|
|
20
|
-
interactive?: boolean;
|
|
21
|
-
/** Tag type
|
|
22
|
-
* @default secondary
|
|
23
|
-
* @deprecated v4.0.0
|
|
24
|
-
* @use ITagProps.theme
|
|
25
|
-
*/
|
|
26
|
-
use?: TagUse;
|
|
27
|
-
/** Tag theme, there are several default themes or you can use your color
|
|
28
|
-
* @default muted
|
|
29
|
-
*/
|
|
30
|
-
theme?: TagTheme;
|
|
31
|
-
/** Tag color text */
|
|
32
|
-
color?: string;
|
|
33
|
-
/** Tag size
|
|
34
|
-
* @default m
|
|
35
|
-
*/
|
|
36
|
-
size?: TagSize;
|
|
37
|
-
/** Left addon tag */
|
|
38
|
-
addonLeft?: React.ElementType;
|
|
39
|
-
/** Right addon tag */
|
|
40
|
-
addonRight?: React.ElementType;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface ITagCloseProps extends IIconProps {
|
|
44
|
-
/** Tag type
|
|
45
|
-
* @default secondary
|
|
46
|
-
*/
|
|
47
|
-
use?: TagUse;
|
|
48
|
-
/** Tag theme, there are several default themes or you can use your color
|
|
49
|
-
* @default muted
|
|
50
|
-
*/
|
|
51
|
-
theme?: TagTheme;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface ITagContext extends ITagProps {
|
|
55
|
-
getCloseProps?: PropGetterFn;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface ITagAddonProps extends IBoxProps {}
|
|
59
|
-
|
|
60
|
-
export interface ITagTextProps extends IBoxProps {}
|
|
61
|
-
|
|
62
|
-
declare const Tag: (<T>(props: CProps<ITagProps & T, ITagContext>) => ReturnEl) & {
|
|
63
|
-
Text: <T>(props: ITagTextProps & T) => ReturnEl;
|
|
64
|
-
Addon: <T>(props: ITagAddonProps & T) => ReturnEl;
|
|
65
|
-
Close: <T>(props: ITagCloseProps & T) => ReturnEl;
|
|
66
|
-
Circle: <T>(props: ITagAddonProps & T) => ReturnEl;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export default Tag;
|