@semcore/tag 3.6.0 → 3.6.1
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 +6 -0
- package/lib/cjs/Tag.js +30 -26
- package/lib/cjs/Tag.js.map +1 -1
- package/lib/cjs/index.js +5 -1
- package/lib/cjs/style/tag.shadow.css +3 -1
- package/lib/es6/Tag.js +24 -24
- package/lib/es6/Tag.js.map +1 -1
- package/lib/es6/style/tag.shadow.css +3 -1
- package/package.json +2 -2
- package/src/style/tag.shadow.css +3 -1
package/CHANGELOG.md
CHANGED
package/lib/cjs/Tag.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -33,9 +33,13 @@ var _addonTextChildren = _interopRequireDefault(require("@semcore/utils/lib/addo
|
|
|
33
33
|
|
|
34
34
|
var _m = _interopRequireDefault(require("@semcore/icon/Close/m"));
|
|
35
35
|
|
|
36
|
-
function
|
|
36
|
+
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); }
|
|
37
|
+
|
|
38
|
+
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; }
|
|
39
|
+
|
|
40
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
37
41
|
|
|
38
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
42
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
39
43
|
|
|
40
44
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
41
45
|
|
|
@@ -46,31 +50,31 @@ var style = (
|
|
|
46
50
|
/*__reshadow_css_start__*/
|
|
47
51
|
_core.sstyled.insert(
|
|
48
52
|
/*__inner_css_start__*/
|
|
49
|
-
".
|
|
53
|
+
".___STag_1ikt5_gg_{justify-content:center;vertical-align:middle;box-sizing:border-box;border-width:1px;border-style:solid;border-color:transparent;border-radius:21px}.___STag_1ikt5_gg_,.___SText_1ikt5_gg_{display:inline-flex;align-items:center;padding-left:4px;padding-right:4px}.___SText_1ikt5_gg_{height:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.1}.___SText_1ikt5_gg_:not(:only-child):first-child{padding-right:0}.___SText_1ikt5_gg_:not(:first-child):not(:last-child){padding-left:0;padding-right:0}.___SText_1ikt5_gg_:not(:only-child):last-child{padding-left:0}.___SAddon_1ikt5_gg_{flex-shrink:0;padding-left:4px;padding-right:4px}.___SAddon_1ikt5_gg_,.___SCircle_1ikt5_gg_{display:inline-flex;align-items:center;justify-content:center}.___SCircle_1ikt5_gg_{overflow:hidden;border-radius:50%;margin-right:4px}.___STag_1ikt5_gg_.__disabled_1ikt5_gg_{opacity:0.3;cursor:default;pointer-events:none}.___STag_1ikt5_gg_.__interactive_1ikt5_gg_{cursor:pointer}.___STag_1ikt5_gg_._size_xl_1ikt5_gg_{height:42px;min-width:42px;font-size:16px}.___STag_1ikt5_gg_._size_xl_1ikt5_gg_ .___SCircle_1ikt5_gg_{width:28px;height:28px}.___STag_1ikt5_gg_._size_l_1ikt5_gg_{height:32px;min-width:32px;font-size:14px}.___STag_1ikt5_gg_._size_l_1ikt5_gg_ .___SCircle_1ikt5_gg_{width:24px;height:24px}.___STag_1ikt5_gg_._size_m_1ikt5_gg_{height:26px;min-width:26px;font-size:12px}.___STag_1ikt5_gg_._size_m_1ikt5_gg_ .___SCircle_1ikt5_gg_{width:20px;height:20px}.___STag_1ikt5_gg_._size_s_1ikt5_gg_{height:18px;min-width:18px;font-size:10px}.___STag_1ikt5_gg_._size_s_1ikt5_gg_ .___SCircle_1ikt5_gg_{width:12px;height:12px}.___STag_1ikt5_gg_._theme_primary-muted_1ikt5_gg_{background-color:rgba(224,225,233,.5);color:#6c6e79}.___STag_1ikt5_gg_._theme_primary-muted_1ikt5_gg_.__active_1ikt5_gg_,.___STag_1ikt5_gg_._theme_primary-muted_1ikt5_gg_.__interactive_1ikt5_gg_:active,.___STag_1ikt5_gg_._theme_primary-muted_1ikt5_gg_.__interactive_1ikt5_gg_:hover{background-color:#e0e1e9}.___STag_1ikt5_gg_._theme_primary-warning_1ikt5_gg_{background-color:#ff7f00;color:#fff;border-color:#ff7f00}.___STag_1ikt5_gg_._theme_primary-invert_1ikt5_gg_{background-color:hsla(0,0%,100%,.2);color:#fff}.___STag_1ikt5_gg_._theme_primary-invert_1ikt5_gg_.__active_1ikt5_gg_,.___STag_1ikt5_gg_._theme_primary-invert_1ikt5_gg_.__interactive_1ikt5_gg_:active,.___STag_1ikt5_gg_._theme_primary-invert_1ikt5_gg_.__interactive_1ikt5_gg_:hover{background-color:#fff;color:#333333}.___STag_1ikt5_gg_._theme_primary-invert_1ikt5_gg_.__interactive_1ikt5_gg_ .___SClose_1ikt5_gg_:hover{color:#333333}.___STag_1ikt5_gg_._theme_secondary-muted_1ikt5_gg_{background-color:#fff;color:#666666;border-color:#a6b0b3}.___STag_1ikt5_gg_._theme_secondary-muted_1ikt5_gg_.__interactive_1ikt5_gg_:hover{color:#333333}.___STag_1ikt5_gg_._theme_secondary-muted_1ikt5_gg_.__active_1ikt5_gg_,.___STag_1ikt5_gg_._theme_secondary-muted_1ikt5_gg_.__interactive_1ikt5_gg_:active{background-color:#eeeeee;color:#333333}.___STag_1ikt5_gg_._theme_secondary-invert_1ikt5_gg_{border-color:hsla(0,0%,100%,.2);color:#fff}.___STag_1ikt5_gg_._theme_secondary-invert_1ikt5_gg_.__interactive_1ikt5_gg_:hover{border-color:hsla(0,0%,100%,.5)}.___STag_1ikt5_gg_._theme_secondary-invert_1ikt5_gg_.__active_1ikt5_gg_,.___STag_1ikt5_gg_._theme_secondary-invert_1ikt5_gg_.__interactive_1ikt5_gg_:active{background-color:hsla(0,0%,100%,.1);border-color:hsla(0,0%,100%,.5)}.___STag_1ikt5_gg_._theme_custom_1ikt5_gg_{color:var(--colorText_1bujtnd);background-color:var(--colorTag_1bujtnd)}.___STag_1ikt5_gg_._theme_custom_1ikt5_gg_.__active_1ikt5_gg_,.___STag_1ikt5_gg_._theme_custom_1ikt5_gg_.__interactive_1ikt5_gg_:active,.___STag_1ikt5_gg_._theme_custom_1ikt5_gg_.__interactive_1ikt5_gg_:hover{color:#fff;background-color:var(--colorText_1bujtnd)}.___SClose_1ikt5_gg_{cursor:pointer;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;padding:4px}.___SClose_1ikt5_gg_._theme_primary-warning_1ikt5_gg_,.___SClose_1ikt5_gg_._theme_primary-warning_1ikt5_gg_:hover{color:#fff}.___SClose_1ikt5_gg_._theme_primary-invert_1ikt5_gg_{color:#999}.___SClose_1ikt5_gg_._theme_primary-invert_1ikt5_gg_:hover{color:#fff}.___SClose_1ikt5_gg_._theme_secondary-muted_1ikt5_gg_{color:hsla(0,0%,40%,.5)}.___SClose_1ikt5_gg_._theme_secondary-muted_1ikt5_gg_:hover{color:#333333}.___SClose_1ikt5_gg_._theme_secondary-invert_1ikt5_gg_{color:hsla(0,0%,100%,.5)}.___SClose_1ikt5_gg_._theme_secondary-invert_1ikt5_gg_:hover{color:#fff}.___SClose_1ikt5_gg_._theme_custom_1ikt5_gg_{opacity:.5}.___SClose_1ikt5_gg_._theme_custom_1ikt5_gg_:hover{opacity:1}"
|
|
50
54
|
/*__inner_css_end__*/
|
|
51
|
-
, "
|
|
55
|
+
, "1bujtnd_gg_")
|
|
52
56
|
/*__reshadow_css_end__*/
|
|
53
57
|
, {
|
|
54
|
-
"__STag": "
|
|
55
|
-
"__SText": "
|
|
56
|
-
"__SAddon": "
|
|
57
|
-
"__SCircle": "
|
|
58
|
-
"_disabled": "
|
|
59
|
-
"_interactive": "
|
|
60
|
-
"_size_xl": "
|
|
61
|
-
"_size_l": "
|
|
62
|
-
"_size_m": "
|
|
63
|
-
"_size_s": "
|
|
64
|
-
"_theme_primary-muted": "_theme_primary-
|
|
65
|
-
"_active": "
|
|
66
|
-
"_theme_primary-warning": "_theme_primary-
|
|
67
|
-
"_theme_primary-invert": "_theme_primary-
|
|
68
|
-
"__SClose": "
|
|
69
|
-
"_theme_secondary-muted": "_theme_secondary-
|
|
70
|
-
"_theme_secondary-invert": "_theme_secondary-
|
|
71
|
-
"_theme_custom": "
|
|
72
|
-
"--colorText": "--
|
|
73
|
-
"--colorTag": "--
|
|
58
|
+
"__STag": "___STag_1ikt5_gg_",
|
|
59
|
+
"__SText": "___SText_1ikt5_gg_",
|
|
60
|
+
"__SAddon": "___SAddon_1ikt5_gg_",
|
|
61
|
+
"__SCircle": "___SCircle_1ikt5_gg_",
|
|
62
|
+
"_disabled": "__disabled_1ikt5_gg_",
|
|
63
|
+
"_interactive": "__interactive_1ikt5_gg_",
|
|
64
|
+
"_size_xl": "_size_xl_1ikt5_gg_",
|
|
65
|
+
"_size_l": "_size_l_1ikt5_gg_",
|
|
66
|
+
"_size_m": "_size_m_1ikt5_gg_",
|
|
67
|
+
"_size_s": "_size_s_1ikt5_gg_",
|
|
68
|
+
"_theme_primary-muted": "_theme_primary-muted_1ikt5_gg_",
|
|
69
|
+
"_active": "__active_1ikt5_gg_",
|
|
70
|
+
"_theme_primary-warning": "_theme_primary-warning_1ikt5_gg_",
|
|
71
|
+
"_theme_primary-invert": "_theme_primary-invert_1ikt5_gg_",
|
|
72
|
+
"__SClose": "___SClose_1ikt5_gg_",
|
|
73
|
+
"_theme_secondary-muted": "_theme_secondary-muted_1ikt5_gg_",
|
|
74
|
+
"_theme_secondary-invert": "_theme_secondary-invert_1ikt5_gg_",
|
|
75
|
+
"_theme_custom": "_theme_custom_1ikt5_gg_",
|
|
76
|
+
"--colorText": "--colorText_1bujtnd",
|
|
77
|
+
"--colorTag": "--colorTag_1bujtnd"
|
|
74
78
|
});
|
|
75
79
|
|
|
76
80
|
function isCustomTheme(use, theme) {
|
package/lib/cjs/Tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Tag.js"],"names":["isCustomTheme","use","theme","type","primary","secondary","includes","getThemeName","RootTag","asProps","size","STag","Box","Children","styles","color","interactive","disabled","addonLeft","addonRight","useTheme","colorTag","colorText","Tag","Text","Addon","Component","style","props","SText","Close","SClose","CloseM","SAddon","Circle","SCircle"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;AACA;;AACA
|
|
1
|
+
{"version":3,"sources":["../../src/Tag.js"],"names":["isCustomTheme","use","theme","type","primary","secondary","includes","getThemeName","RootTag","asProps","size","STag","Box","Children","styles","color","interactive","disabled","addonLeft","addonRight","useTheme","colorTag","colorText","Tag","Text","Addon","Component","style","props","SText","Close","SClose","CloseM","SAddon","Circle","SCircle"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAASA,aAAT,CAAuBC,GAAvB,EAA4BC,KAA5B,EAAmC;AACjC,MAAMC,IAAI,GAAG;AACXC,IAAAA,OAAO,EAAE,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,CADE;AAEXC,IAAAA,SAAS,EAAE,CAAC,OAAD,EAAU,QAAV;AAFA,GAAb;AAIA,SAAOF,IAAI,CAACF,GAAD,CAAJ,GAAY,CAACE,IAAI,CAACF,GAAD,CAAJ,CAAUK,QAAV,CAAmBJ,KAAnB,CAAb,GAAyC,IAAhD;AACD;;AAED,SAASK,YAAT,CAAsBN,GAAtB,EAA2BC,KAA3B,EAAkC;AAChC,SAAOF,aAAa,CAACC,GAAD,EAAMC,KAAN,CAAb,GAA4B,QAA5B,aAA0CD,GAA1C,cAAiDC,KAAjD,CAAP;AACD;;IAEKM,O;;;;;;;;;;;;WASJ,yBAAgB;AACd,0BAA6B,KAAKC,OAAlC;AAAA,U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ACrB,MAAMO,OAAO,GAE2BvB,YAFxC;AACA,MAAQE,MAAR,GAAmBc,KAAnB,CAAQd,MAAR;AACA,kBAAO,mBAAQA,MAAR,CAAP,eAAuB,gCAAC,OAAD;AAAA,WAA0B;AAA1B,cAAvB;AACD;;AAED,IAAMS,GAAG,GAAG,sBAAgBf,OAAhB,EAAyB;AACnCgB,EAAAA,IAAI,EAAJA,IADmC;AAEnCC,EAAAA,KAAK,EAALA,KAFmC;AAGnCK,EAAAA,KAAK,EAALA,KAHmC;AAInCI,EAAAA,MAAM,EAANA;AAJmC,CAAzB,CAAZ;eAOeX,G","sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport resolveColor, { opacity } from '@semcore/utils/lib/color';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\nimport CloseM from '@semcore/icon/Close/m';\n\nimport style from './style/tag.shadow.css';\n\nfunction isCustomTheme(use, theme) {\n const type = {\n primary: ['muted', 'invert', 'warning'],\n secondary: ['muted', 'invert'],\n };\n return type[use] ? !type[use].includes(theme) : true;\n}\n\nfunction getThemeName(use, theme) {\n return isCustomTheme(use, theme) ? 'custom' : `${use}-${theme}`;\n}\n\nclass RootTag extends Component {\n static displayName = 'Tag';\n static style = style;\n static defaultProps = {\n use: 'secondary',\n theme: 'muted',\n size: 'm',\n };\n\n getCloseProps() {\n const { use, theme, size } = this.asProps;\n return { use, theme, size };\n }\n\n render() {\n const STag = Root;\n let {\n Children,\n styles,\n theme,\n use,\n color,\n interactive,\n disabled,\n addonLeft,\n addonRight,\n } = this.asProps;\n\n if (disabled) {\n interactive = false;\n }\n\n const useTheme = getThemeName(use, theme);\n const colorTag = theme ? opacity(resolveColor(theme), 0.5) : '';\n const colorText = color ? resolveColor(color) : resolveColor(theme);\n\n return sstyled(styles)(\n <STag\n render={Box}\n use:theme={useTheme}\n use:interactive={interactive}\n colorText={colorText}\n colorTag={colorTag}\n >\n {addonLeft ? <Tag.Addon tag={addonLeft} /> : null}\n {addonTextChildren(Children, Tag.Text, Tag.Addon)}\n {addonRight ? <Tag.Addon tag={addonRight} /> : null}\n </STag>,\n );\n }\n}\n\nfunction Text(props) {\n const SText = Root;\n const { styles } = props;\n return sstyled(styles)(<SText render={Box} tag=\"span\" />);\n}\n\nfunction Close(props) {\n const SClose = Root;\n const { styles, use, theme, size } = props;\n\n return sstyled(styles)(<SClose render={Box} use:theme={getThemeName(use, theme)} tag={CloseM} />);\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n const { styles } = props;\n return sstyled(styles)(<SAddon render={Box} tag=\"span\" />);\n}\n\nfunction Circle(props) {\n const SCircle = Root;\n const { styles } = props;\n return sstyled(styles)(<SCircle render={Box} tag=\"span\" />);\n}\n\nconst Tag = createComponent(RootTag, {\n Text,\n Addon,\n Close,\n Circle,\n});\n\nexport default Tag;\n"],"file":"Tag.js"}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -26,4 +26,8 @@ Object.keys(_Tag).forEach(function (key) {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
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; }
|
|
29
33
|
//# sourceMappingURL=index.js.map
|
package/lib/es6/Tag.js
CHANGED
|
@@ -11,9 +11,9 @@ import { assignProps as _assignProps3 } from "@semcore/core";
|
|
|
11
11
|
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
12
12
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
13
13
|
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
15
|
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
17
|
|
|
18
18
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
19
19
|
|
|
@@ -31,31 +31,31 @@ var style = (
|
|
|
31
31
|
/*__reshadow_css_start__*/
|
|
32
32
|
_sstyled.insert(
|
|
33
33
|
/*__inner_css_start__*/
|
|
34
|
-
".
|
|
34
|
+
".___STag_1ikt5_gg_{justify-content:center;vertical-align:middle;box-sizing:border-box;border-width:1px;border-style:solid;border-color:transparent;border-radius:21px}.___STag_1ikt5_gg_,.___SText_1ikt5_gg_{display:inline-flex;align-items:center;padding-left:4px;padding-right:4px}.___SText_1ikt5_gg_{height:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.1}.___SText_1ikt5_gg_:not(:only-child):first-child{padding-right:0}.___SText_1ikt5_gg_:not(:first-child):not(:last-child){padding-left:0;padding-right:0}.___SText_1ikt5_gg_:not(:only-child):last-child{padding-left:0}.___SAddon_1ikt5_gg_{flex-shrink:0;padding-left:4px;padding-right:4px}.___SAddon_1ikt5_gg_,.___SCircle_1ikt5_gg_{display:inline-flex;align-items:center;justify-content:center}.___SCircle_1ikt5_gg_{overflow:hidden;border-radius:50%;margin-right:4px}.___STag_1ikt5_gg_.__disabled_1ikt5_gg_{opacity:0.3;cursor:default;pointer-events:none}.___STag_1ikt5_gg_.__interactive_1ikt5_gg_{cursor:pointer}.___STag_1ikt5_gg_._size_xl_1ikt5_gg_{height:42px;min-width:42px;font-size:16px}.___STag_1ikt5_gg_._size_xl_1ikt5_gg_ .___SCircle_1ikt5_gg_{width:28px;height:28px}.___STag_1ikt5_gg_._size_l_1ikt5_gg_{height:32px;min-width:32px;font-size:14px}.___STag_1ikt5_gg_._size_l_1ikt5_gg_ .___SCircle_1ikt5_gg_{width:24px;height:24px}.___STag_1ikt5_gg_._size_m_1ikt5_gg_{height:26px;min-width:26px;font-size:12px}.___STag_1ikt5_gg_._size_m_1ikt5_gg_ .___SCircle_1ikt5_gg_{width:20px;height:20px}.___STag_1ikt5_gg_._size_s_1ikt5_gg_{height:18px;min-width:18px;font-size:10px}.___STag_1ikt5_gg_._size_s_1ikt5_gg_ .___SCircle_1ikt5_gg_{width:12px;height:12px}.___STag_1ikt5_gg_._theme_primary-muted_1ikt5_gg_{background-color:rgba(224,225,233,.5);color:#6c6e79}.___STag_1ikt5_gg_._theme_primary-muted_1ikt5_gg_.__active_1ikt5_gg_,.___STag_1ikt5_gg_._theme_primary-muted_1ikt5_gg_.__interactive_1ikt5_gg_:active,.___STag_1ikt5_gg_._theme_primary-muted_1ikt5_gg_.__interactive_1ikt5_gg_:hover{background-color:#e0e1e9}.___STag_1ikt5_gg_._theme_primary-warning_1ikt5_gg_{background-color:#ff7f00;color:#fff;border-color:#ff7f00}.___STag_1ikt5_gg_._theme_primary-invert_1ikt5_gg_{background-color:hsla(0,0%,100%,.2);color:#fff}.___STag_1ikt5_gg_._theme_primary-invert_1ikt5_gg_.__active_1ikt5_gg_,.___STag_1ikt5_gg_._theme_primary-invert_1ikt5_gg_.__interactive_1ikt5_gg_:active,.___STag_1ikt5_gg_._theme_primary-invert_1ikt5_gg_.__interactive_1ikt5_gg_:hover{background-color:#fff;color:#333333}.___STag_1ikt5_gg_._theme_primary-invert_1ikt5_gg_.__interactive_1ikt5_gg_ .___SClose_1ikt5_gg_:hover{color:#333333}.___STag_1ikt5_gg_._theme_secondary-muted_1ikt5_gg_{background-color:#fff;color:#666666;border-color:#a6b0b3}.___STag_1ikt5_gg_._theme_secondary-muted_1ikt5_gg_.__interactive_1ikt5_gg_:hover{color:#333333}.___STag_1ikt5_gg_._theme_secondary-muted_1ikt5_gg_.__active_1ikt5_gg_,.___STag_1ikt5_gg_._theme_secondary-muted_1ikt5_gg_.__interactive_1ikt5_gg_:active{background-color:#eeeeee;color:#333333}.___STag_1ikt5_gg_._theme_secondary-invert_1ikt5_gg_{border-color:hsla(0,0%,100%,.2);color:#fff}.___STag_1ikt5_gg_._theme_secondary-invert_1ikt5_gg_.__interactive_1ikt5_gg_:hover{border-color:hsla(0,0%,100%,.5)}.___STag_1ikt5_gg_._theme_secondary-invert_1ikt5_gg_.__active_1ikt5_gg_,.___STag_1ikt5_gg_._theme_secondary-invert_1ikt5_gg_.__interactive_1ikt5_gg_:active{background-color:hsla(0,0%,100%,.1);border-color:hsla(0,0%,100%,.5)}.___STag_1ikt5_gg_._theme_custom_1ikt5_gg_{color:var(--colorText_1bujtnd);background-color:var(--colorTag_1bujtnd)}.___STag_1ikt5_gg_._theme_custom_1ikt5_gg_.__active_1ikt5_gg_,.___STag_1ikt5_gg_._theme_custom_1ikt5_gg_.__interactive_1ikt5_gg_:active,.___STag_1ikt5_gg_._theme_custom_1ikt5_gg_.__interactive_1ikt5_gg_:hover{color:#fff;background-color:var(--colorText_1bujtnd)}.___SClose_1ikt5_gg_{cursor:pointer;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;padding:4px}.___SClose_1ikt5_gg_._theme_primary-warning_1ikt5_gg_,.___SClose_1ikt5_gg_._theme_primary-warning_1ikt5_gg_:hover{color:#fff}.___SClose_1ikt5_gg_._theme_primary-invert_1ikt5_gg_{color:#999}.___SClose_1ikt5_gg_._theme_primary-invert_1ikt5_gg_:hover{color:#fff}.___SClose_1ikt5_gg_._theme_secondary-muted_1ikt5_gg_{color:hsla(0,0%,40%,.5)}.___SClose_1ikt5_gg_._theme_secondary-muted_1ikt5_gg_:hover{color:#333333}.___SClose_1ikt5_gg_._theme_secondary-invert_1ikt5_gg_{color:hsla(0,0%,100%,.5)}.___SClose_1ikt5_gg_._theme_secondary-invert_1ikt5_gg_:hover{color:#fff}.___SClose_1ikt5_gg_._theme_custom_1ikt5_gg_{opacity:.5}.___SClose_1ikt5_gg_._theme_custom_1ikt5_gg_:hover{opacity:1}"
|
|
35
35
|
/*__inner_css_end__*/
|
|
36
|
-
, "
|
|
36
|
+
, "1bujtnd_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
|
-
"_theme_primary-invert": "_theme_primary-
|
|
53
|
-
"__SClose": "
|
|
54
|
-
"_theme_secondary-muted": "_theme_secondary-
|
|
55
|
-
"_theme_secondary-invert": "_theme_secondary-
|
|
56
|
-
"_theme_custom": "
|
|
57
|
-
"--colorText": "--
|
|
58
|
-
"--colorTag": "--
|
|
39
|
+
"__STag": "___STag_1ikt5_gg_",
|
|
40
|
+
"__SText": "___SText_1ikt5_gg_",
|
|
41
|
+
"__SAddon": "___SAddon_1ikt5_gg_",
|
|
42
|
+
"__SCircle": "___SCircle_1ikt5_gg_",
|
|
43
|
+
"_disabled": "__disabled_1ikt5_gg_",
|
|
44
|
+
"_interactive": "__interactive_1ikt5_gg_",
|
|
45
|
+
"_size_xl": "_size_xl_1ikt5_gg_",
|
|
46
|
+
"_size_l": "_size_l_1ikt5_gg_",
|
|
47
|
+
"_size_m": "_size_m_1ikt5_gg_",
|
|
48
|
+
"_size_s": "_size_s_1ikt5_gg_",
|
|
49
|
+
"_theme_primary-muted": "_theme_primary-muted_1ikt5_gg_",
|
|
50
|
+
"_active": "__active_1ikt5_gg_",
|
|
51
|
+
"_theme_primary-warning": "_theme_primary-warning_1ikt5_gg_",
|
|
52
|
+
"_theme_primary-invert": "_theme_primary-invert_1ikt5_gg_",
|
|
53
|
+
"__SClose": "___SClose_1ikt5_gg_",
|
|
54
|
+
"_theme_secondary-muted": "_theme_secondary-muted_1ikt5_gg_",
|
|
55
|
+
"_theme_secondary-invert": "_theme_secondary-invert_1ikt5_gg_",
|
|
56
|
+
"_theme_custom": "_theme_custom_1ikt5_gg_",
|
|
57
|
+
"--colorText": "--colorText_1bujtnd",
|
|
58
|
+
"--colorTag": "--colorTag_1bujtnd"
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
function isCustomTheme(use, theme) {
|
package/lib/es6/Tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Tag.js"],"names":["React","createComponent","Component","sstyled","Root","Box","resolveColor","opacity","addonTextChildren","CloseM","isCustomTheme","use","theme","type","primary","secondary","includes","getThemeName","RootTag","asProps","size","STag","Children","styles","color","interactive","disabled","addonLeft","addonRight","useTheme","colorTag","colorText","Tag","Text","Addon","style","props","SText","Close","SClose","SAddon","Circle","SCircle"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,OAAOC,YAAP,IAAuBC,OAAvB,QAAsC,0BAAtC;AACA,OAAOC,iBAAP,MAA8B,sCAA9B;AACA,OAAOC,MAAP,MAAmB,uBAAnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAASC,aAAT,CAAuBC,GAAvB,EAA4BC,KAA5B,EAAmC;AACjC,MAAMC,IAAI,GAAG;AACXC,IAAAA,OAAO,EAAE,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,CADE;AAEXC,IAAAA,SAAS,EAAE,CAAC,OAAD,EAAU,QAAV;AAFA,GAAb;AAIA,SAAOF,IAAI,CAACF,GAAD,CAAJ,GAAY,CAACE,IAAI,CAACF,GAAD,CAAJ,CAAUK,QAAV,CAAmBJ,KAAnB,CAAb,GAAyC,IAAhD;AACD;;AAED,SAASK,YAAT,CAAsBN,GAAtB,EAA2BC,KAA3B,EAAkC;AAChC,SAAOF,aAAa,CAACC,GAAD,EAAMC,KAAN,CAAb,GAA4B,QAA5B,aAA0CD,GAA1C,cAAiDC,KAAjD,CAAP;AACD;;IAEKM,O;;;;;;;;;;;;;WASJ,yBAAgB;
|
|
1
|
+
{"version":3,"sources":["../../src/Tag.js"],"names":["React","createComponent","Component","sstyled","Root","Box","resolveColor","opacity","addonTextChildren","CloseM","isCustomTheme","use","theme","type","primary","secondary","includes","getThemeName","RootTag","asProps","size","STag","Children","styles","color","interactive","disabled","addonLeft","addonRight","useTheme","colorTag","colorText","Tag","Text","Addon","style","props","SText","Close","SClose","SAddon","Circle","SCircle"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,OAAOC,YAAP,IAAuBC,OAAvB,QAAsC,0BAAtC;AACA,OAAOC,iBAAP,MAA8B,sCAA9B;AACA,OAAOC,MAAP,MAAmB,uBAAnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAASC,aAAT,CAAuBC,GAAvB,EAA4BC,KAA5B,EAAmC;AACjC,MAAMC,IAAI,GAAG;AACXC,IAAAA,OAAO,EAAE,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,CADE;AAEXC,IAAAA,SAAS,EAAE,CAAC,OAAD,EAAU,QAAV;AAFA,GAAb;AAIA,SAAOF,IAAI,CAACF,GAAD,CAAJ,GAAY,CAACE,IAAI,CAACF,GAAD,CAAJ,CAAUK,QAAV,CAAmBJ,KAAnB,CAAb,GAAyC,IAAhD;AACD;;AAED,SAASK,YAAT,CAAsBN,GAAtB,EAA2BC,KAA3B,EAAkC;AAChC,SAAOF,aAAa,CAACC,GAAD,EAAMC,KAAN,CAAb,GAA4B,QAA5B,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AR,GAAmBa,KAAnB,CAAQb,MAAR;AACA,iBAAOpB,OAAO,CAACoB,MAAD,CAAd,eAAuB,oBAAC,MAAD;AAAA,WAAyB;AAAzB,cAAvB;AACD;;AAED,SAASkB,MAAT,CAAgBL,KAAhB,EAAuB;AAAA;AAAA;;AACrB,MAAMM,OAAO,GAE2BrC,GAFxC;AACA,MAAQkB,MAAR,GAAmBa,KAAnB,CAAQb,MAAR;AACA,kBAAOpB,OAAO,CAACoB,MAAD,CAAd,eAAuB,oBAAC,OAAD;AAAA,WAA0B;AAA1B,cAAvB;AACD;;AAED,IAAMS,GAAG,GAAG/B,eAAe,CAACiB,OAAD,EAAU;AACnCe,EAAAA,IAAI,EAAJA,IADmC;AAEnCC,EAAAA,KAAK,EAALA,KAFmC;AAGnCI,EAAAA,KAAK,EAALA,KAHmC;AAInCG,EAAAA,MAAM,EAANA;AAJmC,CAAV,CAA3B;AAOA,eAAeT,GAAf","sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport resolveColor, { opacity } from '@semcore/utils/lib/color';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\nimport CloseM from '@semcore/icon/Close/m';\n\nimport style from './style/tag.shadow.css';\n\nfunction isCustomTheme(use, theme) {\n const type = {\n primary: ['muted', 'invert', 'warning'],\n secondary: ['muted', 'invert'],\n };\n return type[use] ? !type[use].includes(theme) : true;\n}\n\nfunction getThemeName(use, theme) {\n return isCustomTheme(use, theme) ? 'custom' : `${use}-${theme}`;\n}\n\nclass RootTag extends Component {\n static displayName = 'Tag';\n static style = style;\n static defaultProps = {\n use: 'secondary',\n theme: 'muted',\n size: 'm',\n };\n\n getCloseProps() {\n const { use, theme, size } = this.asProps;\n return { use, theme, size };\n }\n\n render() {\n const STag = Root;\n let {\n Children,\n styles,\n theme,\n use,\n color,\n interactive,\n disabled,\n addonLeft,\n addonRight,\n } = this.asProps;\n\n if (disabled) {\n interactive = false;\n }\n\n const useTheme = getThemeName(use, theme);\n const colorTag = theme ? opacity(resolveColor(theme), 0.5) : '';\n const colorText = color ? resolveColor(color) : resolveColor(theme);\n\n return sstyled(styles)(\n <STag\n render={Box}\n use:theme={useTheme}\n use:interactive={interactive}\n colorText={colorText}\n colorTag={colorTag}\n >\n {addonLeft ? <Tag.Addon tag={addonLeft} /> : null}\n {addonTextChildren(Children, Tag.Text, Tag.Addon)}\n {addonRight ? <Tag.Addon tag={addonRight} /> : null}\n </STag>,\n );\n }\n}\n\nfunction Text(props) {\n const SText = Root;\n const { styles } = props;\n return sstyled(styles)(<SText render={Box} tag=\"span\" />);\n}\n\nfunction Close(props) {\n const SClose = Root;\n const { styles, use, theme, size } = props;\n\n return sstyled(styles)(<SClose render={Box} use:theme={getThemeName(use, theme)} tag={CloseM} />);\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n const { styles } = props;\n return sstyled(styles)(<SAddon render={Box} tag=\"span\" />);\n}\n\nfunction Circle(props) {\n const SCircle = Root;\n const { styles } = props;\n return sstyled(styles)(<SCircle render={Box} tag=\"span\" />);\n}\n\nconst Tag = createComponent(RootTag, {\n Text,\n Addon,\n Close,\n Circle,\n});\n\nexport default Tag;\n"],"file":"Tag.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.6.
|
|
4
|
+
"version": "3.6.1",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"react": "16.8 - 17"
|
|
23
23
|
},
|
|
24
24
|
"jest": {
|
|
25
|
-
"preset": "jest-preset-ui"
|
|
25
|
+
"preset": "@semcore/jest-preset-ui"
|
|
26
26
|
}
|
|
27
27
|
}
|