@semcore/button 3.3.3-0 → 3.3.3-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 +1 -1
- package/lib/cjs/Button.js +36 -32
- package/lib/cjs/Button.js.map +1 -1
- package/lib/cjs/SpinButton.js +3 -2
- package/lib/cjs/SpinButton.js.map +1 -1
- package/lib/cjs/index.js +5 -1
- package/lib/es6/Button.js +30 -30
- package/lib/es6/Button.js.map +1 -1
- package/lib/es6/SpinButton.js +2 -1
- package/lib/es6/SpinButton.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/cjs/Button.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
|
});
|
|
@@ -35,9 +35,13 @@ var _addonTextChildren = _interopRequireDefault(require("@semcore/utils/lib/addo
|
|
|
35
35
|
|
|
36
36
|
var _SpinButton = _interopRequireDefault(require("./SpinButton"));
|
|
37
37
|
|
|
38
|
-
function
|
|
38
|
+
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); }
|
|
39
|
+
|
|
40
|
+
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; }
|
|
41
|
+
|
|
42
|
+
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; }
|
|
39
43
|
|
|
40
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
44
|
+
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; }
|
|
41
45
|
|
|
42
46
|
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); }; }
|
|
43
47
|
|
|
@@ -48,38 +52,38 @@ var style = (
|
|
|
48
52
|
/*__reshadow_css_start__*/
|
|
49
53
|
_core.sstyled.insert(
|
|
50
54
|
/*__inner_css_start__*/
|
|
51
|
-
".
|
|
55
|
+
".___SButton_1ntop_gg_{position:relative;display:inline-block;align-items:center;justify-content:center;padding:0;margin:0;white-space:nowrap;font-family:inherit;font-weight:400;line-height:normal;text-decoration:none;text-align:center;vertical-align:middle;border:1px solid transparent;color:#666666;outline:0;box-shadow:none;cursor:pointer;box-sizing:border-box;overflow:visible;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.___SButton_1ntop_gg_::-moz-focus-inner{padding:0;border:none}.___SButton_1ntop_gg_:active,.___SButton_1ntop_gg_:focus,.___SButton_1ntop_gg_:hover{outline:0;text-decoration:none}.___SButton_1ntop_gg_.__disabled_1ntop_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SButton_1ntop_gg_.__keyboardFocused_1ntop_gg_{box-shadow:0 0 0 3px rgba(43, 148, 225, 0.3);z-index:1}.___SButton_1ntop_gg_._size_s_1ntop_gg_{height:18px;min-width:18px;border-radius:2px;font-size:10px}.___SButton_1ntop_gg_._size_m_1ntop_gg_{height:26px;min-width:26px;border-radius:3px;font-size:12px}.___SButton_1ntop_gg_._size_l_1ntop_gg_{height:32px;min-width:32px;border-radius:4px;font-size:14px}.___SButton_1ntop_gg_._size_xl_1ntop_gg_{height:42px;min-width:42px;border-radius:5px;font-size:16px}.___SButton_1ntop_gg_._theme_primary-info_1ntop_gg_{color:#fff;background-color:#2b94e1}.___SButton_1ntop_gg_._theme_primary-info_1ntop_gg_:hover{background-color:#0071bc}.___SButton_1ntop_gg_._theme_primary-info_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_primary-info_1ntop_gg_.__active_1ntop_gg_{background-color:#006bb3}.___SButton_1ntop_gg_._theme_primary-success_1ntop_gg_{color:#fff;background-color:#4fae33}.___SButton_1ntop_gg_._theme_primary-success_1ntop_gg_:hover{background-color:#1d9c00}.___SButton_1ntop_gg_._theme_primary-success_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_primary-success_1ntop_gg_.__active_1ntop_gg_{background-color:#1c9400}.___SButton_1ntop_gg_._theme_primary-warning_1ntop_gg_{background-color:#ff7f00;color:#fff}.___SButton_1ntop_gg_._theme_primary-warning_1ntop_gg_:hover{background-color:#cc6600}.___SButton_1ntop_gg_._theme_primary-warning_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_primary-warning_1ntop_gg_.__active_1ntop_gg_{background-color:#c26100}.___SButton_1ntop_gg_._theme_primary-danger_1ntop_gg_{background-color:#ed2d2d;color:#fff}.___SButton_1ntop_gg_._theme_primary-danger_1ntop_gg_:hover{background-color:#d00000}.___SButton_1ntop_gg_._theme_primary-danger_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_primary-danger_1ntop_gg_.__active_1ntop_gg_{background-color:#c60000}.___SButton_1ntop_gg_._theme_primary-invert_1ntop_gg_{background-color:#fff;color:#333333}.___SButton_1ntop_gg_._theme_primary-invert_1ntop_gg_:hover{background-color:#eeeeee}.___SButton_1ntop_gg_._theme_primary-invert_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_primary-invert_1ntop_gg_.__active_1ntop_gg_{background-color:#e4e1e1}.___SButton_1ntop_gg_._theme_secondary-muted_1ntop_gg_{color:#757575;border-color:#a6b0b3;background-color:rgba(166,176,179,.1)}.___SButton_1ntop_gg_._theme_secondary-muted_1ntop_gg_:hover{background-color:rgba(166,176,179,.2)}.___SButton_1ntop_gg_._theme_secondary-muted_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_secondary-muted_1ntop_gg_.__active_1ntop_gg_{background-color:rgba(166,176,179,.3)}.___SButton_1ntop_gg_._theme_secondary-info_1ntop_gg_{background-color:rgba(43,148,225,.05);color:#2b94e1;border-color:#2b94e1}.___SButton_1ntop_gg_._theme_secondary-info_1ntop_gg_:hover{background-color:rgba(0,113,188,.2)}.___SButton_1ntop_gg_._theme_secondary-info_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_secondary-info_1ntop_gg_.__active_1ntop_gg_{background-color:rgba(0,113,188,.3)}.___SButton_1ntop_gg_._theme_secondary-invert_1ntop_gg_{background-color:hsla(0,0%,100%,.05);color:#fff;border-color:#fff}.___SButton_1ntop_gg_._theme_secondary-invert_1ntop_gg_:hover{background-color:hsla(0,0%,100%,.2)}.___SButton_1ntop_gg_._theme_secondary-invert_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_secondary-invert_1ntop_gg_.__active_1ntop_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_1ntop_gg_._theme_tertiary-info_1ntop_gg_{color:#0071bc;background-color:transparent}.___SButton_1ntop_gg_._theme_tertiary-info_1ntop_gg_:hover{background-color:rgba(43,148,225,.2)}.___SButton_1ntop_gg_._theme_tertiary-info_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_tertiary-info_1ntop_gg_.__active_1ntop_gg_{background-color:rgba(43,148,225,.3)}.___SButton_1ntop_gg_._theme_tertiary-muted_1ntop_gg_{color:#757575;background-color:transparent}.___SButton_1ntop_gg_._theme_tertiary-muted_1ntop_gg_:hover{background-color:rgba(166,176,179,.2)}.___SButton_1ntop_gg_._theme_tertiary-muted_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_tertiary-muted_1ntop_gg_.__active_1ntop_gg_{background-color:rgba(166,176,179,.3)}.___SButton_1ntop_gg_._theme_tertiary-invert_1ntop_gg_{color:#fff;background-color:transparent}.___SButton_1ntop_gg_._theme_tertiary-invert_1ntop_gg_:hover{background-color:hsla(0,0%,100%,.2)}.___SButton_1ntop_gg_._theme_tertiary-invert_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_tertiary-invert_1ntop_gg_.__active_1ntop_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_1ntop_gg_._neighborLocation_right_1ntop_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SButton_1ntop_gg_._neighborLocation_both_1ntop_gg_{border-radius:0;margin-left:-1px}.___SButton_1ntop_gg_._neighborLocation_both_1ntop_gg_._theme_primary-danger_1ntop_gg_,.___SButton_1ntop_gg_._neighborLocation_both_1ntop_gg_._theme_primary-info_1ntop_gg_,.___SButton_1ntop_gg_._neighborLocation_both_1ntop_gg_._theme_primary-success_1ntop_gg_,.___SButton_1ntop_gg_._neighborLocation_both_1ntop_gg_._theme_primary-warning_1ntop_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_1ntop_gg_._neighborLocation_both_1ntop_gg_._theme_primary-invert_1ntop_gg_{border-left-color:rgba(0,0,0,.5)}.___SButton_1ntop_gg_._neighborLocation_left_1ntop_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.___SButton_1ntop_gg_._neighborLocation_left_1ntop_gg_._theme_primary-danger_1ntop_gg_,.___SButton_1ntop_gg_._neighborLocation_left_1ntop_gg_._theme_primary-info_1ntop_gg_,.___SButton_1ntop_gg_._neighborLocation_left_1ntop_gg_._theme_primary-success_1ntop_gg_,.___SButton_1ntop_gg_._neighborLocation_left_1ntop_gg_._theme_primary-warning_1ntop_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_1ntop_gg_._neighborLocation_left_1ntop_gg_._theme_primary-invert_1ntop_gg_{border-left-color:rgba(0,0,0,.5)}.___SSpin_1ntop_gg_{position:absolute;top:0;left:0;display:flex}.___SInner_1ntop_gg_,.___SSpin_1ntop_gg_{width:100%;height:100%}.___SInner_1ntop_gg_{display:inline-flex;align-items:center;justify-content:center}.___SInner_1ntop_gg_.__loading_1ntop_gg_{visibility:hidden}.___SText_1ntop_gg_{display:inline-flex;line-height:1.1}.___SText_1ntop_gg_._size_s_1ntop_gg_{margin-left:4px;margin-right:4px}.___SText_1ntop_gg_._size_l_1ntop_gg_,.___SText_1ntop_gg_._size_m_1ntop_gg_{margin-left:8px;margin-right:8px}.___SText_1ntop_gg_._size_xl_1ntop_gg_{margin-left:12px;margin-right:12px}.___SAddon_1ntop_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_1ntop_gg_._size_s_1ntop_gg_:not(:only-child):first-child{margin-left:4px}.___SAddon_1ntop_gg_._size_s_1ntop_gg_:not(:only-child):last-child{margin-right:4px}.___SAddon_1ntop_gg_._size_s_1ntop_gg_:only-child{margin-left:-2px;margin-right:-2px}.___SAddon_1ntop_gg_._size_m_1ntop_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_1ntop_gg_._size_m_1ntop_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_1ntop_gg_._size_m_1ntop_gg_:only-child{margin-left:-4px;margin-right:-4px}.___SAddon_1ntop_gg_._size_l_1ntop_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_1ntop_gg_._size_l_1ntop_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_1ntop_gg_._size_l_1ntop_gg_:only-child{margin-left:-4px;margin-right:-4px}.___SAddon_1ntop_gg_._size_xl_1ntop_gg_:not(:only-child):first-child{margin-left:12px}.___SAddon_1ntop_gg_._size_xl_1ntop_gg_:not(:only-child):last-child{margin-right:12px}.___SAddon_1ntop_gg_._size_xl_1ntop_gg_:only-child{margin-left:-6px;margin-right:-6px}"
|
|
52
56
|
/*__inner_css_end__*/
|
|
53
57
|
, "1o9hhkh_gg_")
|
|
54
58
|
/*__reshadow_css_end__*/
|
|
55
59
|
, {
|
|
56
|
-
"__SButton": "
|
|
57
|
-
"_disabled": "
|
|
58
|
-
"_keyboardFocused": "
|
|
59
|
-
"_size_s": "
|
|
60
|
-
"_size_m": "
|
|
61
|
-
"_size_l": "
|
|
62
|
-
"_size_xl": "
|
|
63
|
-
"_theme_primary-info": "_theme_primary-
|
|
64
|
-
"_active": "
|
|
65
|
-
"_theme_primary-success": "_theme_primary-
|
|
66
|
-
"_theme_primary-warning": "_theme_primary-
|
|
67
|
-
"_theme_primary-danger": "_theme_primary-
|
|
68
|
-
"_theme_primary-invert": "_theme_primary-
|
|
69
|
-
"_theme_secondary-muted": "_theme_secondary-
|
|
70
|
-
"_theme_secondary-info": "_theme_secondary-
|
|
71
|
-
"_theme_secondary-invert": "_theme_secondary-
|
|
72
|
-
"_theme_tertiary-info": "_theme_tertiary-
|
|
73
|
-
"_theme_tertiary-muted": "_theme_tertiary-
|
|
74
|
-
"_theme_tertiary-invert": "_theme_tertiary-
|
|
75
|
-
"_neighborLocation_right": "
|
|
76
|
-
"_neighborLocation_both": "
|
|
77
|
-
"_neighborLocation_left": "
|
|
78
|
-
"__SSpin": "
|
|
79
|
-
"__SInner": "
|
|
80
|
-
"_loading": "
|
|
81
|
-
"__SText": "
|
|
82
|
-
"__SAddon": "
|
|
60
|
+
"__SButton": "___SButton_1ntop_gg_",
|
|
61
|
+
"_disabled": "__disabled_1ntop_gg_",
|
|
62
|
+
"_keyboardFocused": "__keyboardFocused_1ntop_gg_",
|
|
63
|
+
"_size_s": "_size_s_1ntop_gg_",
|
|
64
|
+
"_size_m": "_size_m_1ntop_gg_",
|
|
65
|
+
"_size_l": "_size_l_1ntop_gg_",
|
|
66
|
+
"_size_xl": "_size_xl_1ntop_gg_",
|
|
67
|
+
"_theme_primary-info": "_theme_primary-info_1ntop_gg_",
|
|
68
|
+
"_active": "__active_1ntop_gg_",
|
|
69
|
+
"_theme_primary-success": "_theme_primary-success_1ntop_gg_",
|
|
70
|
+
"_theme_primary-warning": "_theme_primary-warning_1ntop_gg_",
|
|
71
|
+
"_theme_primary-danger": "_theme_primary-danger_1ntop_gg_",
|
|
72
|
+
"_theme_primary-invert": "_theme_primary-invert_1ntop_gg_",
|
|
73
|
+
"_theme_secondary-muted": "_theme_secondary-muted_1ntop_gg_",
|
|
74
|
+
"_theme_secondary-info": "_theme_secondary-info_1ntop_gg_",
|
|
75
|
+
"_theme_secondary-invert": "_theme_secondary-invert_1ntop_gg_",
|
|
76
|
+
"_theme_tertiary-info": "_theme_tertiary-info_1ntop_gg_",
|
|
77
|
+
"_theme_tertiary-muted": "_theme_tertiary-muted_1ntop_gg_",
|
|
78
|
+
"_theme_tertiary-invert": "_theme_tertiary-invert_1ntop_gg_",
|
|
79
|
+
"_neighborLocation_right": "_neighborLocation_right_1ntop_gg_",
|
|
80
|
+
"_neighborLocation_both": "_neighborLocation_both_1ntop_gg_",
|
|
81
|
+
"_neighborLocation_left": "_neighborLocation_left_1ntop_gg_",
|
|
82
|
+
"__SSpin": "___SSpin_1ntop_gg_",
|
|
83
|
+
"__SInner": "___SInner_1ntop_gg_",
|
|
84
|
+
"_loading": "__loading_1ntop_gg_",
|
|
85
|
+
"__SText": "___SText_1ntop_gg_",
|
|
86
|
+
"__SAddon": "___SAddon_1ntop_gg_"
|
|
83
87
|
});
|
|
84
88
|
var MAP_USE_DEFAULT_THEME = {
|
|
85
89
|
primary: 'info',
|
package/lib/cjs/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Button.js"],"names":["MAP_USE_DEFAULT_THEME","primary","secondary","tertiary","RootButton","size","asProps","SButton","Box","SInner","SSpin","Children","styles","use","theme","loading","disabled","addonLeft","addonRight","useTheme","Button","Text","Addon","Component","style","props","SText","SAddon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;AACA;;AACA;;AACA
|
|
1
|
+
{"version":3,"sources":["../../src/Button.js"],"names":["MAP_USE_DEFAULT_THEME","primary","secondary","tertiary","RootButton","size","asProps","SButton","Box","SInner","SSpin","Children","styles","use","theme","loading","disabled","addonLeft","addonRight","useTheme","Button","Text","Addon","Component","style","props","SText","SAddon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,IAAMA,qBAAqB,GAAG;AACnCC,EAAAA,OAAO,EAAE,MAD0B;AAEnCC,EAAAA,SAAS,EAAE,OAFwB;AAGnCC,EAAAA,QAAQ,EAAE;AAHyB,CAA9B;;;IAMDC,U;;;;;;;;;;;;WASJ,wBAAe;AACb,UAAQC,IAAR,GAAiB,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CAAC,MAAD,CAAQ,KAAR;AAAc,QAAA,GAAG,EAAEA;AAAnB,QAAH,GAAuC,IAHpD,CADF,EAMGH,OAAO,iBACN,gCAAC,KAAD;AAAA,eAAW;AAAX,uBACE,gCAAC,sBAAD;AAAA;AAAA,gBAA2BV,IAA3B;AAAA,iBAAwCc;AAAxC,SADF,CAPJ,CADF;AAcD;;;EAtDsBI,e;;iCAAnBnB,U,iBACiB,Q;iCADjBA,U,aAEa,CAAC,uCAAD,EAAyB,gDAAzB,C;iCAFbA,U,WAGWoB,K;iCAHXpB,U,kBAIkB;AACpBS,EAAAA,GAAG,EAAE,WADe;AAEpBR,EAAAA,IAAI,EAAE;AAFc,C;;AAqDxB,SAASgB,IAAT,CAAcI,KAAd,EAAqB;AAAA;AAAA;;AACnB,MAAMC,KAAK,GACiClB,YAD5C;AACA,iBAAO,mBAAQiB,KAAK,CAACb,MAAd,CAAP,eAA6B,gCAAC,KAAD;AAAA,WAAwB;AAAxB,cAA7B;AACD;;AAED,SAASU,KAAT,CAAeG,KAAf,EAAsB;AAAA;AAAA;;AACpB,MAAME,MAAM,GACiCnB,YAD7C;AACA,iBAAO,mBAAQiB,KAAK,CAACb,MAAd,CAAP,eAA6B,gCAAC,MAAD;AAAA,WAAyB;AAAzB,cAA7B;AACD;;AAED,IAAMQ,MAAM,GAAG,sBAAgBhB,UAAhB,EAA4B;AACzCiB,EAAAA,IAAI,EAAJA,IADyC;AAEzCC,EAAAA,KAAK,EAALA;AAFyC,CAA5B,CAAf;eAKeF,M","sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport { neighborLocationEnhance } from '@semcore/neighbor-location';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\nimport SpinButton from './SpinButton';\n\nimport style from './style/button.shadow.css';\n\nexport const MAP_USE_DEFAULT_THEME = {\n primary: 'info',\n secondary: 'muted',\n tertiary: 'info',\n};\n\nclass RootButton extends Component {\n static displayName = 'Button';\n static enhance = [keyboardFocusEnhance(), neighborLocationEnhance()];\n static style = style;\n static defaultProps = {\n use: 'secondary',\n size: 'm',\n };\n\n getTextProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n getAddonProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n render() {\n const SButton = Root;\n const SInner = Box;\n const SSpin = Box;\n const {\n Children,\n styles,\n use,\n theme = typeof use === 'string' && MAP_USE_DEFAULT_THEME[use],\n loading,\n disabled = loading,\n size,\n addonLeft,\n addonRight,\n } = this.asProps;\n\n const useTheme = use && theme ? `${use}-${theme}` : false;\n return sstyled(styles)(\n <SButton render={Box} type=\"button\" tag=\"button\" disabled={disabled} use:theme={useTheme}>\n <SInner tag=\"span\" loading={loading}>\n {addonLeft ? <Button.Addon tag={addonLeft} /> : null}\n {addonTextChildren(Children, Button.Text, Button.Addon)}\n {addonRight ? <Button.Addon tag={addonRight} /> : null}\n </SInner>\n {loading && (\n <SSpin tag=\"span\">\n <SpinButton centered size={size} theme={useTheme} />\n </SSpin>\n )}\n </SButton>,\n );\n }\n}\n\nfunction Text(props) {\n const SText = Root;\n return sstyled(props.styles)(<SText render={Box} tag=\"span\" />);\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n return sstyled(props.styles)(<SAddon render={Box} tag=\"span\" />);\n}\n\nconst Button = createComponent(RootButton, {\n Text,\n Addon,\n});\n\nexport default Button;\n"],"file":"Button.js"}
|
package/lib/cjs/SpinButton.js
CHANGED
|
@@ -5,8 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports["default"] = SpinButton;
|
|
9
8
|
exports.SPIN_THEME_MAP = exports.SPIN_SIZE_MAP = void 0;
|
|
9
|
+
exports["default"] = SpinButton;
|
|
10
10
|
|
|
11
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
12
|
|
|
@@ -16,6 +16,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
16
16
|
|
|
17
17
|
var _spin = _interopRequireDefault(require("@semcore/spin"));
|
|
18
18
|
|
|
19
|
+
var _excluded = ["theme", "size"];
|
|
19
20
|
var SPIN_SIZE_MAP = {
|
|
20
21
|
xl: 'm',
|
|
21
22
|
l: 's',
|
|
@@ -39,7 +40,7 @@ exports.SPIN_THEME_MAP = SPIN_THEME_MAP;
|
|
|
39
40
|
function SpinButton(_ref) {
|
|
40
41
|
var theme = _ref.theme,
|
|
41
42
|
size = _ref.size,
|
|
42
|
-
others = (0, _objectWithoutProperties2["default"])(_ref,
|
|
43
|
+
others = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
43
44
|
return /*#__PURE__*/_react["default"].createElement(_spin["default"], (0, _extends2["default"])({
|
|
44
45
|
size: typeof size == 'string' ? SPIN_SIZE_MAP[size] : size,
|
|
45
46
|
theme: typeof theme === 'string' ? SPIN_THEME_MAP[theme] || 'dark' : theme
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/SpinButton.js"],"names":["SPIN_SIZE_MAP","xl","l","m","s","SPIN_THEME_MAP","SpinButton","theme","size","others"],"mappings":";;;;;;;;;;;;;;AAAA;;AACA
|
|
1
|
+
{"version":3,"sources":["../../src/SpinButton.js"],"names":["SPIN_SIZE_MAP","xl","l","m","s","SPIN_THEME_MAP","SpinButton","theme","size","others"],"mappings":";;;;;;;;;;;;;;AAAA;;AACA;;;AAEO,IAAMA,aAAa,GAAG;AAC3BC,EAAAA,EAAE,EAAE,GADuB;AAE3BC,EAAAA,CAAC,EAAE,GAFwB;AAG3BC,EAAAA,CAAC,EAAE,IAHwB;AAI3BC,EAAAA,CAAC,EAAE;AAJwB,CAAtB;;AAOA,IAAMC,cAAc,GAAG;AAC5B,kBAAgB,QADY;AAE5B,qBAAmB,QAFS;AAG5B,qBAAmB,QAHS;AAI5B,oBAAkB,QAJU;AAK5B,sBAAoB,QALQ;AAM5B,qBAAmB,QANS;AAO5B,oBAAkB,YAPU;AAQ5B,qBAAmB,QARS;AAS5B,mBAAiB;AATW,CAAvB;;;AAYQ,SAASC,UAAT,OAAgD;AAAA,MAA1BC,KAA0B,QAA1BA,KAA0B;AAAA,MAAnBC,IAAmB,QAAnBA,IAAmB;AAAA,MAAVC,MAAU;AAC7D,sBACE,gCAAC,gBAAD;AACE,IAAA,IAAI,EAAE,OAAOD,IAAP,IAAe,QAAf,GAA0BR,aAAa,CAACQ,IAAD,CAAvC,GAAgDA,IADxD;AAEE,IAAA,KAAK,EAAE,OAAOD,KAAP,KAAiB,QAAjB,GAA4BF,cAAc,CAACE,KAAD,CAAd,IAAyB,MAArD,GAA8DA;AAFvE,KAGME,MAHN,EADF;AAOD","sourcesContent":["import React from 'react';\nimport Spin from '@semcore/spin';\n\nexport const SPIN_SIZE_MAP = {\n xl: 'm',\n l: 's',\n m: 'xs',\n s: 'xxs',\n};\n\nexport const SPIN_THEME_MAP = {\n 'primary-info': 'invert',\n 'primary-success': 'invert',\n 'primary-warning': 'invert',\n 'primary-danger': 'invert',\n 'secondary-invert': 'invert',\n 'secondary-muted': 'gray40',\n 'secondary-info': 'light-blue',\n 'tertiary-invert': 'invert',\n 'tertiary-info': 'light-blue',\n};\n\nexport default function SpinButton({ theme, size, ...others }) {\n return (\n <Spin\n size={typeof size == 'string' ? SPIN_SIZE_MAP[size] : size}\n theme={typeof theme === 'string' ? SPIN_THEME_MAP[theme] || 'dark' : theme}\n {...others}\n />\n );\n}\n"],"file":"SpinButton.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(_Button).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/Button.js
CHANGED
|
@@ -9,9 +9,9 @@ import { assignProps as _assignProps3 } from "@semcore/core";
|
|
|
9
9
|
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
10
10
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
11
11
|
|
|
12
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
12
|
+
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; }
|
|
13
13
|
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
14
|
+
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; }
|
|
15
15
|
|
|
16
16
|
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); }; }
|
|
17
17
|
|
|
@@ -30,38 +30,38 @@ var style = (
|
|
|
30
30
|
/*__reshadow_css_start__*/
|
|
31
31
|
_sstyled.insert(
|
|
32
32
|
/*__inner_css_start__*/
|
|
33
|
-
".
|
|
33
|
+
".___SButton_1ntop_gg_{position:relative;display:inline-block;align-items:center;justify-content:center;padding:0;margin:0;white-space:nowrap;font-family:inherit;font-weight:400;line-height:normal;text-decoration:none;text-align:center;vertical-align:middle;border:1px solid transparent;color:#666666;outline:0;box-shadow:none;cursor:pointer;box-sizing:border-box;overflow:visible;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.___SButton_1ntop_gg_::-moz-focus-inner{padding:0;border:none}.___SButton_1ntop_gg_:active,.___SButton_1ntop_gg_:focus,.___SButton_1ntop_gg_:hover{outline:0;text-decoration:none}.___SButton_1ntop_gg_.__disabled_1ntop_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SButton_1ntop_gg_.__keyboardFocused_1ntop_gg_{box-shadow:0 0 0 3px rgba(43, 148, 225, 0.3);z-index:1}.___SButton_1ntop_gg_._size_s_1ntop_gg_{height:18px;min-width:18px;border-radius:2px;font-size:10px}.___SButton_1ntop_gg_._size_m_1ntop_gg_{height:26px;min-width:26px;border-radius:3px;font-size:12px}.___SButton_1ntop_gg_._size_l_1ntop_gg_{height:32px;min-width:32px;border-radius:4px;font-size:14px}.___SButton_1ntop_gg_._size_xl_1ntop_gg_{height:42px;min-width:42px;border-radius:5px;font-size:16px}.___SButton_1ntop_gg_._theme_primary-info_1ntop_gg_{color:#fff;background-color:#2b94e1}.___SButton_1ntop_gg_._theme_primary-info_1ntop_gg_:hover{background-color:#0071bc}.___SButton_1ntop_gg_._theme_primary-info_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_primary-info_1ntop_gg_.__active_1ntop_gg_{background-color:#006bb3}.___SButton_1ntop_gg_._theme_primary-success_1ntop_gg_{color:#fff;background-color:#4fae33}.___SButton_1ntop_gg_._theme_primary-success_1ntop_gg_:hover{background-color:#1d9c00}.___SButton_1ntop_gg_._theme_primary-success_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_primary-success_1ntop_gg_.__active_1ntop_gg_{background-color:#1c9400}.___SButton_1ntop_gg_._theme_primary-warning_1ntop_gg_{background-color:#ff7f00;color:#fff}.___SButton_1ntop_gg_._theme_primary-warning_1ntop_gg_:hover{background-color:#cc6600}.___SButton_1ntop_gg_._theme_primary-warning_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_primary-warning_1ntop_gg_.__active_1ntop_gg_{background-color:#c26100}.___SButton_1ntop_gg_._theme_primary-danger_1ntop_gg_{background-color:#ed2d2d;color:#fff}.___SButton_1ntop_gg_._theme_primary-danger_1ntop_gg_:hover{background-color:#d00000}.___SButton_1ntop_gg_._theme_primary-danger_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_primary-danger_1ntop_gg_.__active_1ntop_gg_{background-color:#c60000}.___SButton_1ntop_gg_._theme_primary-invert_1ntop_gg_{background-color:#fff;color:#333333}.___SButton_1ntop_gg_._theme_primary-invert_1ntop_gg_:hover{background-color:#eeeeee}.___SButton_1ntop_gg_._theme_primary-invert_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_primary-invert_1ntop_gg_.__active_1ntop_gg_{background-color:#e4e1e1}.___SButton_1ntop_gg_._theme_secondary-muted_1ntop_gg_{color:#757575;border-color:#a6b0b3;background-color:rgba(166,176,179,.1)}.___SButton_1ntop_gg_._theme_secondary-muted_1ntop_gg_:hover{background-color:rgba(166,176,179,.2)}.___SButton_1ntop_gg_._theme_secondary-muted_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_secondary-muted_1ntop_gg_.__active_1ntop_gg_{background-color:rgba(166,176,179,.3)}.___SButton_1ntop_gg_._theme_secondary-info_1ntop_gg_{background-color:rgba(43,148,225,.05);color:#2b94e1;border-color:#2b94e1}.___SButton_1ntop_gg_._theme_secondary-info_1ntop_gg_:hover{background-color:rgba(0,113,188,.2)}.___SButton_1ntop_gg_._theme_secondary-info_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_secondary-info_1ntop_gg_.__active_1ntop_gg_{background-color:rgba(0,113,188,.3)}.___SButton_1ntop_gg_._theme_secondary-invert_1ntop_gg_{background-color:hsla(0,0%,100%,.05);color:#fff;border-color:#fff}.___SButton_1ntop_gg_._theme_secondary-invert_1ntop_gg_:hover{background-color:hsla(0,0%,100%,.2)}.___SButton_1ntop_gg_._theme_secondary-invert_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_secondary-invert_1ntop_gg_.__active_1ntop_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_1ntop_gg_._theme_tertiary-info_1ntop_gg_{color:#0071bc;background-color:transparent}.___SButton_1ntop_gg_._theme_tertiary-info_1ntop_gg_:hover{background-color:rgba(43,148,225,.2)}.___SButton_1ntop_gg_._theme_tertiary-info_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_tertiary-info_1ntop_gg_.__active_1ntop_gg_{background-color:rgba(43,148,225,.3)}.___SButton_1ntop_gg_._theme_tertiary-muted_1ntop_gg_{color:#757575;background-color:transparent}.___SButton_1ntop_gg_._theme_tertiary-muted_1ntop_gg_:hover{background-color:rgba(166,176,179,.2)}.___SButton_1ntop_gg_._theme_tertiary-muted_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_tertiary-muted_1ntop_gg_.__active_1ntop_gg_{background-color:rgba(166,176,179,.3)}.___SButton_1ntop_gg_._theme_tertiary-invert_1ntop_gg_{color:#fff;background-color:transparent}.___SButton_1ntop_gg_._theme_tertiary-invert_1ntop_gg_:hover{background-color:hsla(0,0%,100%,.2)}.___SButton_1ntop_gg_._theme_tertiary-invert_1ntop_gg_:active,.___SButton_1ntop_gg_._theme_tertiary-invert_1ntop_gg_.__active_1ntop_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_1ntop_gg_._neighborLocation_right_1ntop_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SButton_1ntop_gg_._neighborLocation_both_1ntop_gg_{border-radius:0;margin-left:-1px}.___SButton_1ntop_gg_._neighborLocation_both_1ntop_gg_._theme_primary-danger_1ntop_gg_,.___SButton_1ntop_gg_._neighborLocation_both_1ntop_gg_._theme_primary-info_1ntop_gg_,.___SButton_1ntop_gg_._neighborLocation_both_1ntop_gg_._theme_primary-success_1ntop_gg_,.___SButton_1ntop_gg_._neighborLocation_both_1ntop_gg_._theme_primary-warning_1ntop_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_1ntop_gg_._neighborLocation_both_1ntop_gg_._theme_primary-invert_1ntop_gg_{border-left-color:rgba(0,0,0,.5)}.___SButton_1ntop_gg_._neighborLocation_left_1ntop_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.___SButton_1ntop_gg_._neighborLocation_left_1ntop_gg_._theme_primary-danger_1ntop_gg_,.___SButton_1ntop_gg_._neighborLocation_left_1ntop_gg_._theme_primary-info_1ntop_gg_,.___SButton_1ntop_gg_._neighborLocation_left_1ntop_gg_._theme_primary-success_1ntop_gg_,.___SButton_1ntop_gg_._neighborLocation_left_1ntop_gg_._theme_primary-warning_1ntop_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_1ntop_gg_._neighborLocation_left_1ntop_gg_._theme_primary-invert_1ntop_gg_{border-left-color:rgba(0,0,0,.5)}.___SSpin_1ntop_gg_{position:absolute;top:0;left:0;display:flex}.___SInner_1ntop_gg_,.___SSpin_1ntop_gg_{width:100%;height:100%}.___SInner_1ntop_gg_{display:inline-flex;align-items:center;justify-content:center}.___SInner_1ntop_gg_.__loading_1ntop_gg_{visibility:hidden}.___SText_1ntop_gg_{display:inline-flex;line-height:1.1}.___SText_1ntop_gg_._size_s_1ntop_gg_{margin-left:4px;margin-right:4px}.___SText_1ntop_gg_._size_l_1ntop_gg_,.___SText_1ntop_gg_._size_m_1ntop_gg_{margin-left:8px;margin-right:8px}.___SText_1ntop_gg_._size_xl_1ntop_gg_{margin-left:12px;margin-right:12px}.___SAddon_1ntop_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_1ntop_gg_._size_s_1ntop_gg_:not(:only-child):first-child{margin-left:4px}.___SAddon_1ntop_gg_._size_s_1ntop_gg_:not(:only-child):last-child{margin-right:4px}.___SAddon_1ntop_gg_._size_s_1ntop_gg_:only-child{margin-left:-2px;margin-right:-2px}.___SAddon_1ntop_gg_._size_m_1ntop_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_1ntop_gg_._size_m_1ntop_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_1ntop_gg_._size_m_1ntop_gg_:only-child{margin-left:-4px;margin-right:-4px}.___SAddon_1ntop_gg_._size_l_1ntop_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_1ntop_gg_._size_l_1ntop_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_1ntop_gg_._size_l_1ntop_gg_:only-child{margin-left:-4px;margin-right:-4px}.___SAddon_1ntop_gg_._size_xl_1ntop_gg_:not(:only-child):first-child{margin-left:12px}.___SAddon_1ntop_gg_._size_xl_1ntop_gg_:not(:only-child):last-child{margin-right:12px}.___SAddon_1ntop_gg_._size_xl_1ntop_gg_:only-child{margin-left:-6px;margin-right:-6px}"
|
|
34
34
|
/*__inner_css_end__*/
|
|
35
35
|
, "1o9hhkh_gg_")
|
|
36
36
|
/*__reshadow_css_end__*/
|
|
37
37
|
, {
|
|
38
|
-
"__SButton": "
|
|
39
|
-
"_disabled": "
|
|
40
|
-
"_keyboardFocused": "
|
|
41
|
-
"_size_s": "
|
|
42
|
-
"_size_m": "
|
|
43
|
-
"_size_l": "
|
|
44
|
-
"_size_xl": "
|
|
45
|
-
"_theme_primary-info": "_theme_primary-
|
|
46
|
-
"_active": "
|
|
47
|
-
"_theme_primary-success": "_theme_primary-
|
|
48
|
-
"_theme_primary-warning": "_theme_primary-
|
|
49
|
-
"_theme_primary-danger": "_theme_primary-
|
|
50
|
-
"_theme_primary-invert": "_theme_primary-
|
|
51
|
-
"_theme_secondary-muted": "_theme_secondary-
|
|
52
|
-
"_theme_secondary-info": "_theme_secondary-
|
|
53
|
-
"_theme_secondary-invert": "_theme_secondary-
|
|
54
|
-
"_theme_tertiary-info": "_theme_tertiary-
|
|
55
|
-
"_theme_tertiary-muted": "_theme_tertiary-
|
|
56
|
-
"_theme_tertiary-invert": "_theme_tertiary-
|
|
57
|
-
"_neighborLocation_right": "
|
|
58
|
-
"_neighborLocation_both": "
|
|
59
|
-
"_neighborLocation_left": "
|
|
60
|
-
"__SSpin": "
|
|
61
|
-
"__SInner": "
|
|
62
|
-
"_loading": "
|
|
63
|
-
"__SText": "
|
|
64
|
-
"__SAddon": "
|
|
38
|
+
"__SButton": "___SButton_1ntop_gg_",
|
|
39
|
+
"_disabled": "__disabled_1ntop_gg_",
|
|
40
|
+
"_keyboardFocused": "__keyboardFocused_1ntop_gg_",
|
|
41
|
+
"_size_s": "_size_s_1ntop_gg_",
|
|
42
|
+
"_size_m": "_size_m_1ntop_gg_",
|
|
43
|
+
"_size_l": "_size_l_1ntop_gg_",
|
|
44
|
+
"_size_xl": "_size_xl_1ntop_gg_",
|
|
45
|
+
"_theme_primary-info": "_theme_primary-info_1ntop_gg_",
|
|
46
|
+
"_active": "__active_1ntop_gg_",
|
|
47
|
+
"_theme_primary-success": "_theme_primary-success_1ntop_gg_",
|
|
48
|
+
"_theme_primary-warning": "_theme_primary-warning_1ntop_gg_",
|
|
49
|
+
"_theme_primary-danger": "_theme_primary-danger_1ntop_gg_",
|
|
50
|
+
"_theme_primary-invert": "_theme_primary-invert_1ntop_gg_",
|
|
51
|
+
"_theme_secondary-muted": "_theme_secondary-muted_1ntop_gg_",
|
|
52
|
+
"_theme_secondary-info": "_theme_secondary-info_1ntop_gg_",
|
|
53
|
+
"_theme_secondary-invert": "_theme_secondary-invert_1ntop_gg_",
|
|
54
|
+
"_theme_tertiary-info": "_theme_tertiary-info_1ntop_gg_",
|
|
55
|
+
"_theme_tertiary-muted": "_theme_tertiary-muted_1ntop_gg_",
|
|
56
|
+
"_theme_tertiary-invert": "_theme_tertiary-invert_1ntop_gg_",
|
|
57
|
+
"_neighborLocation_right": "_neighborLocation_right_1ntop_gg_",
|
|
58
|
+
"_neighborLocation_both": "_neighborLocation_both_1ntop_gg_",
|
|
59
|
+
"_neighborLocation_left": "_neighborLocation_left_1ntop_gg_",
|
|
60
|
+
"__SSpin": "___SSpin_1ntop_gg_",
|
|
61
|
+
"__SInner": "___SInner_1ntop_gg_",
|
|
62
|
+
"_loading": "__loading_1ntop_gg_",
|
|
63
|
+
"__SText": "___SText_1ntop_gg_",
|
|
64
|
+
"__SAddon": "___SAddon_1ntop_gg_"
|
|
65
65
|
});
|
|
66
66
|
export var MAP_USE_DEFAULT_THEME = {
|
|
67
67
|
primary: 'info',
|
package/lib/es6/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Button.js"],"names":["React","createComponent","Component","sstyled","Root","Box","neighborLocationEnhance","keyboardFocusEnhance","addonTextChildren","SpinButton","MAP_USE_DEFAULT_THEME","primary","secondary","tertiary","RootButton","size","asProps","SButton","SInner","SSpin","Children","styles","use","theme","loading","disabled","addonLeft","addonRight","useTheme","Button","Text","Addon","style","props","SText","SAddon"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,SAASC,uBAAT,QAAwC,4BAAxC;AACA,OAAOC,oBAAP,MAAiC,kDAAjC;AACA,OAAOC,iBAAP,MAA8B,sCAA9B;AACA,OAAOC,UAAP,MAAuB,cAAvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,OAAO,IAAMC,qBAAqB,GAAG;AACnCC,EAAAA,OAAO,EAAE,MAD0B;AAEnCC,EAAAA,SAAS,EAAE,OAFwB;AAGnCC,EAAAA,QAAQ,EAAE;AAHyB,CAA9B;;IAMDC,U;;;;;;;;;;;;;WASJ,wBAAe;
|
|
1
|
+
{"version":3,"sources":["../../src/Button.js"],"names":["React","createComponent","Component","sstyled","Root","Box","neighborLocationEnhance","keyboardFocusEnhance","addonTextChildren","SpinButton","MAP_USE_DEFAULT_THEME","primary","secondary","tertiary","RootButton","size","asProps","SButton","SInner","SSpin","Children","styles","use","theme","loading","disabled","addonLeft","addonRight","useTheme","Button","Text","Addon","style","props","SText","SAddon"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,SAASC,uBAAT,QAAwC,4BAAxC;AACA,OAAOC,oBAAP,MAAiC,kDAAjC;AACA,OAAOC,iBAAP,MAA8B,sCAA9B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CC,EAAAA,KAAK,EAALA;AAFyC,CAAb,CAA9B;AAKA,eAAeF,MAAf","sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport { neighborLocationEnhance } from '@semcore/neighbor-location';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\nimport SpinButton from './SpinButton';\n\nimport style from './style/button.shadow.css';\n\nexport const MAP_USE_DEFAULT_THEME = {\n primary: 'info',\n secondary: 'muted',\n tertiary: 'info',\n};\n\nclass RootButton extends Component {\n static displayName = 'Button';\n static enhance = [keyboardFocusEnhance(), neighborLocationEnhance()];\n static style = style;\n static defaultProps = {\n use: 'secondary',\n size: 'm',\n };\n\n getTextProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n getAddonProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n render() {\n const SButton = Root;\n const SInner = Box;\n const SSpin = Box;\n const {\n Children,\n styles,\n use,\n theme = typeof use === 'string' && MAP_USE_DEFAULT_THEME[use],\n loading,\n disabled = loading,\n size,\n addonLeft,\n addonRight,\n } = this.asProps;\n\n const useTheme = use && theme ? `${use}-${theme}` : false;\n return sstyled(styles)(\n <SButton render={Box} type=\"button\" tag=\"button\" disabled={disabled} use:theme={useTheme}>\n <SInner tag=\"span\" loading={loading}>\n {addonLeft ? <Button.Addon tag={addonLeft} /> : null}\n {addonTextChildren(Children, Button.Text, Button.Addon)}\n {addonRight ? <Button.Addon tag={addonRight} /> : null}\n </SInner>\n {loading && (\n <SSpin tag=\"span\">\n <SpinButton centered size={size} theme={useTheme} />\n </SSpin>\n )}\n </SButton>,\n );\n }\n}\n\nfunction Text(props) {\n const SText = Root;\n return sstyled(props.styles)(<SText render={Box} tag=\"span\" />);\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n return sstyled(props.styles)(<SAddon render={Box} tag=\"span\" />);\n}\n\nconst Button = createComponent(RootButton, {\n Text,\n Addon,\n});\n\nexport default Button;\n"],"file":"Button.js"}
|
package/lib/es6/SpinButton.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["theme", "size"];
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import Spin from '@semcore/spin';
|
|
5
6
|
export var SPIN_SIZE_MAP = {
|
|
@@ -22,7 +23,7 @@ export var SPIN_THEME_MAP = {
|
|
|
22
23
|
export default function SpinButton(_ref) {
|
|
23
24
|
var theme = _ref.theme,
|
|
24
25
|
size = _ref.size,
|
|
25
|
-
others = _objectWithoutProperties(_ref,
|
|
26
|
+
others = _objectWithoutProperties(_ref, _excluded);
|
|
26
27
|
|
|
27
28
|
return /*#__PURE__*/React.createElement(Spin, _extends({
|
|
28
29
|
size: typeof size == 'string' ? SPIN_SIZE_MAP[size] : size,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/SpinButton.js"],"names":["React","Spin","SPIN_SIZE_MAP","xl","l","m","s","SPIN_THEME_MAP","SpinButton","theme","size","others"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/SpinButton.js"],"names":["React","Spin","SPIN_SIZE_MAP","xl","l","m","s","SPIN_THEME_MAP","SpinButton","theme","size","others"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,IAAP,MAAiB,eAAjB;AAEA,OAAO,IAAMC,aAAa,GAAG;AAC3BC,EAAAA,EAAE,EAAE,GADuB;AAE3BC,EAAAA,CAAC,EAAE,GAFwB;AAG3BC,EAAAA,CAAC,EAAE,IAHwB;AAI3BC,EAAAA,CAAC,EAAE;AAJwB,CAAtB;AAOP,OAAO,IAAMC,cAAc,GAAG;AAC5B,kBAAgB,QADY;AAE5B,qBAAmB,QAFS;AAG5B,qBAAmB,QAHS;AAI5B,oBAAkB,QAJU;AAK5B,sBAAoB,QALQ;AAM5B,qBAAmB,QANS;AAO5B,oBAAkB,YAPU;AAQ5B,qBAAmB,QARS;AAS5B,mBAAiB;AATW,CAAvB;AAYP,eAAe,SAASC,UAAT,OAAgD;AAAA,MAA1BC,KAA0B,QAA1BA,KAA0B;AAAA,MAAnBC,IAAmB,QAAnBA,IAAmB;AAAA,MAAVC,MAAU;;AAC7D,sBACE,oBAAC,IAAD;AACE,IAAA,IAAI,EAAE,OAAOD,IAAP,IAAe,QAAf,GAA0BR,aAAa,CAACQ,IAAD,CAAvC,GAAgDA,IADxD;AAEE,IAAA,KAAK,EAAE,OAAOD,KAAP,KAAiB,QAAjB,GAA4BF,cAAc,CAACE,KAAD,CAAd,IAAyB,MAArD,GAA8DA;AAFvE,KAGME,MAHN,EADF;AAOD","sourcesContent":["import React from 'react';\nimport Spin from '@semcore/spin';\n\nexport const SPIN_SIZE_MAP = {\n xl: 'm',\n l: 's',\n m: 'xs',\n s: 'xxs',\n};\n\nexport const SPIN_THEME_MAP = {\n 'primary-info': 'invert',\n 'primary-success': 'invert',\n 'primary-warning': 'invert',\n 'primary-danger': 'invert',\n 'secondary-invert': 'invert',\n 'secondary-muted': 'gray40',\n 'secondary-info': 'light-blue',\n 'tertiary-invert': 'invert',\n 'tertiary-info': 'light-blue',\n};\n\nexport default function SpinButton({ theme, size, ...others }) {\n return (\n <Spin\n size={typeof size == 'string' ? SPIN_SIZE_MAP[size] : size}\n theme={typeof theme === 'string' ? SPIN_THEME_MAP[theme] || 'dark' : theme}\n {...others}\n />\n );\n}\n"],"file":"SpinButton.js"}
|