@semcore/button 3.2.0 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/lib/cjs/Button.js +74 -99
- package/lib/cjs/Button.js.map +1 -1
- package/lib/cjs/SpinButton.js +15 -17
- package/lib/cjs/SpinButton.js.map +1 -1
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/button.shadow.css +37 -37
- package/lib/es6/Button.js +78 -99
- package/lib/es6/Button.js.map +1 -1
- package/lib/es6/SpinButton.js +15 -18
- package/lib/es6/SpinButton.js.map +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/button.shadow.css +37 -37
- package/lib/types/index.d.ts +52 -2
- package/package.json +4 -3
- package/src/Button.js +89 -0
- package/src/SpinButton.js +31 -0
- package/src/index.d.ts +52 -0
- package/src/{index.tsx → index.js} +0 -0
- package/src/style/button.shadow.css +37 -37
- package/lib/types/Button.d.ts +0 -68
- package/lib/types/SpinButton.d.ts +0 -25
- package/src/Button.tsx +0 -157
- package/src/SpinButton.tsx +0 -41
- package/tsconfig.json +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [3.3.2] - 2021-12-23
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Changed `line-height` from 1.2 to 1.1 for correct display in all browsers.
|
|
10
|
+
|
|
11
|
+
## [3.3.1] - 2021-8-26
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Add 'sideEffect=false' for more optimal build via webpack
|
|
16
|
+
|
|
17
|
+
## [3.3.0] - 2021-04-26
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Version of dependence `@semcore/core` has been changed to `1.11`.
|
|
22
|
+
- Improved performance. Removed one component wrapper.
|
|
23
|
+
- The style processing system has been changed.
|
|
24
|
+
- Removed the ability to apply media styles via a plugin `babel-plugin-react-semcore`.
|
|
25
|
+
|
|
26
|
+
## [3.2.1] - 2021-04-16
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- Changed line-height value
|
|
31
|
+
|
|
5
32
|
## [3.2.0] - 2020-12-17
|
|
6
33
|
|
|
7
34
|
### Added
|
package/lib/cjs/Button.js
CHANGED
|
@@ -21,14 +21,12 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
21
21
|
|
|
22
22
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _core = _interopRequireWildcard(require("@semcore/core"));
|
|
25
25
|
|
|
26
26
|
var _react = _interopRequireDefault(require("react"));
|
|
27
27
|
|
|
28
28
|
var _flexBox = require("@semcore/flex-box");
|
|
29
29
|
|
|
30
|
-
var _core = _interopRequireWildcard(require("@semcore/core"));
|
|
31
|
-
|
|
32
30
|
var _neighborLocation = require("@semcore/neighbor-location");
|
|
33
31
|
|
|
34
32
|
var _keyboardFocusEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/keyboardFocusEnhance"));
|
|
@@ -37,71 +35,58 @@ var _addonTextChildren = _interopRequireDefault(require("@semcore/utils/lib/addo
|
|
|
37
35
|
|
|
38
36
|
var _SpinButton = _interopRequireDefault(require("./SpinButton"));
|
|
39
37
|
|
|
38
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
39
|
+
|
|
40
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
41
|
+
|
|
40
42
|
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
43
|
|
|
42
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
44
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
43
45
|
|
|
44
46
|
/*__reshadow-styles__:"./style/button.shadow.css"*/
|
|
45
|
-
var
|
|
47
|
+
var style = (
|
|
46
48
|
/*__reshadow_css_start__*/
|
|
47
|
-
|
|
49
|
+
_core.sstyled.insert(
|
|
48
50
|
/*__inner_css_start__*/
|
|
49
|
-
".___SButton_cipg3_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:#666;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_cipg3_gg_::-moz-focus-inner{padding:0;border:none}.___SButton_cipg3_gg_:active,.___SButton_cipg3_gg_:focus,.___SButton_cipg3_gg_:hover{outline:0;text-decoration:none}.___SButton_cipg3_gg_.__disabled_cipg3_gg_{opacity:.3;cursor:default;pointer-events:none}.___SButton_cipg3_gg_.__keyboardFocused_cipg3_gg_{box-shadow:0 0 0 3px rgba(43,148,225,.3);z-index:1}.___SButton_cipg3_gg_.__size_cipg3_gg_.__size_s_cipg3_gg_{height:18px;min-width:18px;border-radius:2px;font-size:10px}.___SButton_cipg3_gg_.__size_cipg3_gg_.__size_m_cipg3_gg_{height:26px;min-width:26px;border-radius:3px;font-size:12px}.___SButton_cipg3_gg_.__size_cipg3_gg_.__size_l_cipg3_gg_{height:32px;min-width:32px;border-radius:4px;font-size:14px}.___SButton_cipg3_gg_.__size_cipg3_gg_.__size_xl_cipg3_gg_{height:42px;min-width:42px;border-radius:5px;font-size:16px}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-info_cipg3_gg_{color:#fff;background-color:#2b94e1}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-info_cipg3_gg_:hover{background-color:#0071bc}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-info_cipg3_gg_.__active_cipg3_gg_,.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-info_cipg3_gg_:active{background-color:#006bb3}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-success_cipg3_gg_{color:#fff;background-color:#4fae33}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-success_cipg3_gg_:hover{background-color:#1d9c00}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-success_cipg3_gg_.__active_cipg3_gg_,.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-success_cipg3_gg_:active{background-color:#1c9400}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-warning_cipg3_gg_{background-color:#ff7f00;color:#fff}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-warning_cipg3_gg_:hover{background-color:#c60}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-warning_cipg3_gg_.__active_cipg3_gg_,.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-warning_cipg3_gg_:active{background-color:#c26100}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-danger_cipg3_gg_{background-color:#ed2d2d;color:#fff}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-danger_cipg3_gg_:hover{background-color:#d00000}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-danger_cipg3_gg_.__active_cipg3_gg_,.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-danger_cipg3_gg_:active{background-color:#c60000}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-invert_cipg3_gg_{background-color:#fff;color:#333}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-invert_cipg3_gg_:hover{background-color:#eee}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-invert_cipg3_gg_.__active_cipg3_gg_,.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-invert_cipg3_gg_:active{background-color:#e4e1e1}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_secondary-muted_cipg3_gg_{color:#757575;border-color:#a6b0b3;background-color:rgba(166,176,179,.1)}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_secondary-muted_cipg3_gg_:hover{background-color:rgba(166,176,179,.2)}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_secondary-muted_cipg3_gg_.__active_cipg3_gg_,.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_secondary-muted_cipg3_gg_:active{background-color:rgba(166,176,179,.3)}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_secondary-info_cipg3_gg_{background-color:rgba(43,148,225,.05);color:#2b94e1;border-color:#2b94e1}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_secondary-info_cipg3_gg_:hover{background-color:rgba(0,113,188,.2)}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_secondary-info_cipg3_gg_.__active_cipg3_gg_,.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_secondary-info_cipg3_gg_:active{background-color:rgba(0,113,188,.3)}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_secondary-invert_cipg3_gg_{background-color:hsla(0,0%,100%,.05);color:#fff;border-color:#fff}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_secondary-invert_cipg3_gg_:hover{background-color:hsla(0,0%,100%,.2)}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_secondary-invert_cipg3_gg_.__active_cipg3_gg_,.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_secondary-invert_cipg3_gg_:active{background-color:hsla(0,0%,100%,.3)}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_tertiary-info_cipg3_gg_{color:#0071bc;background-color:transparent}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_tertiary-info_cipg3_gg_:hover{background-color:rgba(43,148,225,.2)}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_tertiary-info_cipg3_gg_.__active_cipg3_gg_,.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_tertiary-info_cipg3_gg_:active{background-color:rgba(43,148,225,.3)}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_tertiary-muted_cipg3_gg_{color:#757575;background-color:transparent}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_tertiary-muted_cipg3_gg_:hover{background-color:rgba(166,176,179,.2)}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_tertiary-muted_cipg3_gg_.__active_cipg3_gg_,.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_tertiary-muted_cipg3_gg_:active{background-color:rgba(166,176,179,.3)}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_tertiary-invert_cipg3_gg_{color:#fff;background-color:transparent}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_tertiary-invert_cipg3_gg_:hover{background-color:hsla(0,0%,100%,.2)}.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_tertiary-invert_cipg3_gg_.__active_cipg3_gg_,.___SButton_cipg3_gg_.__theme_cipg3_gg_.__theme_tertiary-invert_cipg3_gg_:active{background-color:hsla(0,0%,100%,.3)}.___SButton_cipg3_gg_.__neighborLocation_cipg3_gg_.__neighborLocation_right_cipg3_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SButton_cipg3_gg_.__neighborLocation_cipg3_gg_.__neighborLocation_both_cipg3_gg_{border-radius:0;margin-left:-1px}.___SButton_cipg3_gg_.__neighborLocation_cipg3_gg_.__neighborLocation_both_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-danger_cipg3_gg_,.___SButton_cipg3_gg_.__neighborLocation_cipg3_gg_.__neighborLocation_both_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-info_cipg3_gg_,.___SButton_cipg3_gg_.__neighborLocation_cipg3_gg_.__neighborLocation_both_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-success_cipg3_gg_,.___SButton_cipg3_gg_.__neighborLocation_cipg3_gg_.__neighborLocation_both_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-warning_cipg3_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_cipg3_gg_.__neighborLocation_cipg3_gg_.__neighborLocation_both_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-invert_cipg3_gg_{border-left-color:rgba(0,0,0,.5)}.___SButton_cipg3_gg_.__neighborLocation_cipg3_gg_.__neighborLocation_left_cipg3_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.___SButton_cipg3_gg_.__neighborLocation_cipg3_gg_.__neighborLocation_left_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-danger_cipg3_gg_,.___SButton_cipg3_gg_.__neighborLocation_cipg3_gg_.__neighborLocation_left_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-info_cipg3_gg_,.___SButton_cipg3_gg_.__neighborLocation_cipg3_gg_.__neighborLocation_left_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-success_cipg3_gg_,.___SButton_cipg3_gg_.__neighborLocation_cipg3_gg_.__neighborLocation_left_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-warning_cipg3_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_cipg3_gg_.__neighborLocation_cipg3_gg_.__neighborLocation_left_cipg3_gg_.__theme_cipg3_gg_.__theme_primary-invert_cipg3_gg_{border-left-color:rgba(0,0,0,.5)}.___SSpin_cipg3_gg_{position:absolute;top:0;left:0;width:100%;height:100%;display:flex}.___SInner_cipg3_gg_{display:inline-flex;align-items:center;justify-content:center;height:100%;width:100%}.___SInner_cipg3_gg_.__loading_cipg3_gg_{visibility:hidden}.___SText_cipg3_gg_{display:inline-flex;line-height:1}.___SText_cipg3_gg_.__size_cipg3_gg_.__size_s_cipg3_gg_{margin-left:4px;margin-right:4px}.___SText_cipg3_gg_.__size_cipg3_gg_.__size_l_cipg3_gg_,.___SText_cipg3_gg_.__size_cipg3_gg_.__size_m_cipg3_gg_{margin-left:8px;margin-right:8px}.___SText_cipg3_gg_.__size_cipg3_gg_.__size_xl_cipg3_gg_{margin-left:12px;margin-right:12px}.___SAddon_cipg3_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_s_cipg3_gg_:not(:only-child):first-child{margin-left:4px}.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_s_cipg3_gg_:not(:only-child):last-child{margin-right:4px}.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_s_cipg3_gg_:only-child{margin-left:-2px;margin-right:-2px}.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_m_cipg3_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_m_cipg3_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_m_cipg3_gg_:only-child{margin-left:-4px;margin-right:-4px}.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_l_cipg3_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_l_cipg3_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_l_cipg3_gg_:only-child{margin-left:-4px;margin-right:-4px}.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_xl_cipg3_gg_:not(:only-child):first-child{margin-left:12px}.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_xl_cipg3_gg_:not(:only-child):last-child{margin-right:12px}.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_xl_cipg3_gg_:only-child{margin-left:-6px;margin-right:-6px}"
|
|
51
|
+
".___SButton_t5ktd_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:#666;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_t5ktd_gg_::-moz-focus-inner{padding:0;border:none}.___SButton_t5ktd_gg_:active,.___SButton_t5ktd_gg_:focus,.___SButton_t5ktd_gg_:hover{outline:0;text-decoration:none}.___SButton_t5ktd_gg_.__disabled_t5ktd_gg_{opacity:.3;cursor:default;pointer-events:none}.___SButton_t5ktd_gg_.__keyboardFocused_t5ktd_gg_{box-shadow:0 0 0 3px rgba(43,148,225,.3);z-index:1}.___SButton_t5ktd_gg_._size_s_t5ktd_gg_{height:18px;min-width:18px;border-radius:2px;font-size:10px}.___SButton_t5ktd_gg_._size_m_t5ktd_gg_{height:26px;min-width:26px;border-radius:3px;font-size:12px}.___SButton_t5ktd_gg_._size_l_t5ktd_gg_{height:32px;min-width:32px;border-radius:4px;font-size:14px}.___SButton_t5ktd_gg_._size_xl_t5ktd_gg_{height:42px;min-width:42px;border-radius:5px;font-size:16px}.___SButton_t5ktd_gg_._theme_primary-info_t5ktd_gg_{color:#fff;background-color:#2b94e1}.___SButton_t5ktd_gg_._theme_primary-info_t5ktd_gg_:hover{background-color:#0071bc}.___SButton_t5ktd_gg_._theme_primary-info_t5ktd_gg_:active,.___SButton_t5ktd_gg_._theme_primary-info_t5ktd_gg_.__active_t5ktd_gg_{background-color:#006bb3}.___SButton_t5ktd_gg_._theme_primary-success_t5ktd_gg_{color:#fff;background-color:#4fae33}.___SButton_t5ktd_gg_._theme_primary-success_t5ktd_gg_:hover{background-color:#1d9c00}.___SButton_t5ktd_gg_._theme_primary-success_t5ktd_gg_:active,.___SButton_t5ktd_gg_._theme_primary-success_t5ktd_gg_.__active_t5ktd_gg_{background-color:#1c9400}.___SButton_t5ktd_gg_._theme_primary-warning_t5ktd_gg_{background-color:#ff7f00;color:#fff}.___SButton_t5ktd_gg_._theme_primary-warning_t5ktd_gg_:hover{background-color:#c60}.___SButton_t5ktd_gg_._theme_primary-warning_t5ktd_gg_:active,.___SButton_t5ktd_gg_._theme_primary-warning_t5ktd_gg_.__active_t5ktd_gg_{background-color:#c26100}.___SButton_t5ktd_gg_._theme_primary-danger_t5ktd_gg_{background-color:#ed2d2d;color:#fff}.___SButton_t5ktd_gg_._theme_primary-danger_t5ktd_gg_:hover{background-color:#d00000}.___SButton_t5ktd_gg_._theme_primary-danger_t5ktd_gg_:active,.___SButton_t5ktd_gg_._theme_primary-danger_t5ktd_gg_.__active_t5ktd_gg_{background-color:#c60000}.___SButton_t5ktd_gg_._theme_primary-invert_t5ktd_gg_{background-color:#fff;color:#333}.___SButton_t5ktd_gg_._theme_primary-invert_t5ktd_gg_:hover{background-color:#eee}.___SButton_t5ktd_gg_._theme_primary-invert_t5ktd_gg_:active,.___SButton_t5ktd_gg_._theme_primary-invert_t5ktd_gg_.__active_t5ktd_gg_{background-color:#e4e1e1}.___SButton_t5ktd_gg_._theme_secondary-muted_t5ktd_gg_{color:#757575;border-color:#a6b0b3;background-color:rgba(166,176,179,.1)}.___SButton_t5ktd_gg_._theme_secondary-muted_t5ktd_gg_:hover{background-color:rgba(166,176,179,.2)}.___SButton_t5ktd_gg_._theme_secondary-muted_t5ktd_gg_:active,.___SButton_t5ktd_gg_._theme_secondary-muted_t5ktd_gg_.__active_t5ktd_gg_{background-color:rgba(166,176,179,.3)}.___SButton_t5ktd_gg_._theme_secondary-info_t5ktd_gg_{background-color:rgba(43,148,225,.05);color:#2b94e1;border-color:#2b94e1}.___SButton_t5ktd_gg_._theme_secondary-info_t5ktd_gg_:hover{background-color:rgba(0,113,188,.2)}.___SButton_t5ktd_gg_._theme_secondary-info_t5ktd_gg_:active,.___SButton_t5ktd_gg_._theme_secondary-info_t5ktd_gg_.__active_t5ktd_gg_{background-color:rgba(0,113,188,.3)}.___SButton_t5ktd_gg_._theme_secondary-invert_t5ktd_gg_{background-color:hsla(0,0%,100%,.05);color:#fff;border-color:#fff}.___SButton_t5ktd_gg_._theme_secondary-invert_t5ktd_gg_:hover{background-color:hsla(0,0%,100%,.2)}.___SButton_t5ktd_gg_._theme_secondary-invert_t5ktd_gg_:active,.___SButton_t5ktd_gg_._theme_secondary-invert_t5ktd_gg_.__active_t5ktd_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_t5ktd_gg_._theme_tertiary-info_t5ktd_gg_{color:#0071bc;background-color:transparent}.___SButton_t5ktd_gg_._theme_tertiary-info_t5ktd_gg_:hover{background-color:rgba(43,148,225,.2)}.___SButton_t5ktd_gg_._theme_tertiary-info_t5ktd_gg_:active,.___SButton_t5ktd_gg_._theme_tertiary-info_t5ktd_gg_.__active_t5ktd_gg_{background-color:rgba(43,148,225,.3)}.___SButton_t5ktd_gg_._theme_tertiary-muted_t5ktd_gg_{color:#757575;background-color:transparent}.___SButton_t5ktd_gg_._theme_tertiary-muted_t5ktd_gg_:hover{background-color:rgba(166,176,179,.2)}.___SButton_t5ktd_gg_._theme_tertiary-muted_t5ktd_gg_:active,.___SButton_t5ktd_gg_._theme_tertiary-muted_t5ktd_gg_.__active_t5ktd_gg_{background-color:rgba(166,176,179,.3)}.___SButton_t5ktd_gg_._theme_tertiary-invert_t5ktd_gg_{color:#fff;background-color:transparent}.___SButton_t5ktd_gg_._theme_tertiary-invert_t5ktd_gg_:hover{background-color:hsla(0,0%,100%,.2)}.___SButton_t5ktd_gg_._theme_tertiary-invert_t5ktd_gg_:active,.___SButton_t5ktd_gg_._theme_tertiary-invert_t5ktd_gg_.__active_t5ktd_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_t5ktd_gg_._neighborLocation_right_t5ktd_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SButton_t5ktd_gg_._neighborLocation_both_t5ktd_gg_{border-radius:0;margin-left:-1px}.___SButton_t5ktd_gg_._neighborLocation_both_t5ktd_gg_._theme_primary-danger_t5ktd_gg_,.___SButton_t5ktd_gg_._neighborLocation_both_t5ktd_gg_._theme_primary-info_t5ktd_gg_,.___SButton_t5ktd_gg_._neighborLocation_both_t5ktd_gg_._theme_primary-success_t5ktd_gg_,.___SButton_t5ktd_gg_._neighborLocation_both_t5ktd_gg_._theme_primary-warning_t5ktd_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_t5ktd_gg_._neighborLocation_both_t5ktd_gg_._theme_primary-invert_t5ktd_gg_{border-left-color:rgba(0,0,0,.5)}.___SButton_t5ktd_gg_._neighborLocation_left_t5ktd_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.___SButton_t5ktd_gg_._neighborLocation_left_t5ktd_gg_._theme_primary-danger_t5ktd_gg_,.___SButton_t5ktd_gg_._neighborLocation_left_t5ktd_gg_._theme_primary-info_t5ktd_gg_,.___SButton_t5ktd_gg_._neighborLocation_left_t5ktd_gg_._theme_primary-success_t5ktd_gg_,.___SButton_t5ktd_gg_._neighborLocation_left_t5ktd_gg_._theme_primary-warning_t5ktd_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_t5ktd_gg_._neighborLocation_left_t5ktd_gg_._theme_primary-invert_t5ktd_gg_{border-left-color:rgba(0,0,0,.5)}.___SSpin_t5ktd_gg_{position:absolute;top:0;left:0;display:flex}.___SInner_t5ktd_gg_,.___SSpin_t5ktd_gg_{width:100%;height:100%}.___SInner_t5ktd_gg_{display:inline-flex;align-items:center;justify-content:center}.___SInner_t5ktd_gg_.__loading_t5ktd_gg_{visibility:hidden}.___SText_t5ktd_gg_{display:inline-flex;line-height:1.1}.___SText_t5ktd_gg_._size_s_t5ktd_gg_{margin-left:4px;margin-right:4px}.___SText_t5ktd_gg_._size_l_t5ktd_gg_,.___SText_t5ktd_gg_._size_m_t5ktd_gg_{margin-left:8px;margin-right:8px}.___SText_t5ktd_gg_._size_xl_t5ktd_gg_{margin-left:12px;margin-right:12px}.___SAddon_t5ktd_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_t5ktd_gg_._size_s_t5ktd_gg_:not(:only-child):first-child{margin-left:4px}.___SAddon_t5ktd_gg_._size_s_t5ktd_gg_:not(:only-child):last-child{margin-right:4px}.___SAddon_t5ktd_gg_._size_s_t5ktd_gg_:only-child{margin-left:-2px;margin-right:-2px}.___SAddon_t5ktd_gg_._size_m_t5ktd_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_t5ktd_gg_._size_m_t5ktd_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_t5ktd_gg_._size_m_t5ktd_gg_:only-child{margin-left:-4px;margin-right:-4px}.___SAddon_t5ktd_gg_._size_l_t5ktd_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_t5ktd_gg_._size_l_t5ktd_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_t5ktd_gg_._size_l_t5ktd_gg_:only-child{margin-left:-4px;margin-right:-4px}.___SAddon_t5ktd_gg_._size_xl_t5ktd_gg_:not(:only-child):first-child{margin-left:12px}.___SAddon_t5ktd_gg_._size_xl_t5ktd_gg_:not(:only-child):last-child{margin-right:12px}.___SAddon_t5ktd_gg_._size_xl_t5ktd_gg_:only-child{margin-left:-6px;margin-right:-6px}"
|
|
50
52
|
/*__inner_css_end__*/
|
|
51
|
-
, "
|
|
53
|
+
, "1o9hhkh_gg_")
|
|
52
54
|
/*__reshadow_css_end__*/
|
|
53
55
|
, {
|
|
54
|
-
"__SButton": "
|
|
55
|
-
"_disabled": "
|
|
56
|
-
"_keyboardFocused": "
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"_theme_primary-
|
|
64
|
-
"
|
|
65
|
-
"_theme_primary-
|
|
66
|
-
"_theme_primary-
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"_theme_secondary-
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"_theme_tertiary-
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
"__SText": "___SText_cipg3_gg_",
|
|
83
|
-
"__SAddon": "___SAddon_cipg3_gg_"
|
|
84
|
-
}),
|
|
85
|
-
style = (0, _extends2["default"])({}, _ref);
|
|
86
|
-
|
|
87
|
-
if (false) {
|
|
88
|
-
/*__reshadow_css_start__*/
|
|
89
|
-
(0, _core.__css__)(
|
|
90
|
-
/*__inner_css_start__*/
|
|
91
|
-
"@media (max-width: 768px) {\n\n.___SButton_cipg3_gg_.__size_cipg3_gg_.__size_s_cipg3_gg_ {\n height: 23.4px;\n min-width: 23.4px;\n font-size: 13px;\n}\n\n.___SButton_cipg3_gg_.__size_cipg3_gg_.__size_m_cipg3_gg_ {\n height: 33.8px;\n min-width: 33.8px;\n font-size: 15.6px;\n}\n\n.___SButton_cipg3_gg_.__size_cipg3_gg_.__size_l_cipg3_gg_ {\n height: 41.6px;\n min-width: 41.6px;\n font-size: 18.2px;\n}\n\n.___SButton_cipg3_gg_.__size_cipg3_gg_.__size_xl_cipg3_gg_ {\n height: 54.6px;\n min-width: 54.6px;\n font-size: 20.8px;\n}\n\n.___SText_cipg3_gg_.__size_cipg3_gg_.__size_s_cipg3_gg_ {\n margin-left: 5.2px;\n margin-right: 5.2px;\n}\n\n.___SText_cipg3_gg_.__size_cipg3_gg_.__size_m_cipg3_gg_ {\n margin-left: 10.4px;\n margin-right: 10.4px;\n}\n\n.___SText_cipg3_gg_.__size_cipg3_gg_.__size_l_cipg3_gg_ {\n margin-left: 10.4px;\n margin-right: 10.4px;\n}\n\n.___SText_cipg3_gg_.__size_cipg3_gg_.__size_xl_cipg3_gg_ {\n margin-left: 15.6px;\n margin-right: 15.6px;\n}\n\n.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_s_cipg3_gg_:not(:only-child):first-child {\n margin-left: 5.2px;\n }\n\n.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_s_cipg3_gg_:not(:only-child):last-child {\n margin-right: 5.2px;\n }\n\n.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_s_cipg3_gg_:only-child {\n margin-left: -2.6px;\n margin-right: -2.6px;\n }\n\n.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_m_cipg3_gg_:not(:only-child):first-child {\n margin-left: 10.4px;\n }\n\n.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_m_cipg3_gg_:not(:only-child):last-child {\n margin-right: 10.4px;\n }\n\n.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_m_cipg3_gg_:only-child {\n margin-left: -5.2px;\n margin-right: -5.2px;\n }\n\n.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_l_cipg3_gg_:not(:only-child):first-child {\n margin-left: 10.4px;\n }\n\n.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_l_cipg3_gg_:not(:only-child):last-child {\n margin-right: 10.4px;\n }\n\n.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_l_cipg3_gg_:only-child {\n margin-left: -5.2px;\n margin-right: -5.2px;\n }\n\n.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_xl_cipg3_gg_:not(:only-child):first-child {\n margin-left: 15.6px;\n }\n\n.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_xl_cipg3_gg_:not(:only-child):last-child {\n margin-right: 15.6px;\n }\n\n.___SAddon_cipg3_gg_.__size_cipg3_gg_.__size_xl_cipg3_gg_:only-child {\n margin-left: -7.8px;\n margin-right: -7.8px;\n }}"
|
|
92
|
-
/*__inner_css_end__*/
|
|
93
|
-
, "i5meff_gg_")
|
|
94
|
-
/*__reshadow_css_end__*/
|
|
95
|
-
;
|
|
96
|
-
}
|
|
97
|
-
|
|
56
|
+
"__SButton": "___SButton_t5ktd_gg_",
|
|
57
|
+
"_disabled": "__disabled_t5ktd_gg_",
|
|
58
|
+
"_keyboardFocused": "__keyboardFocused_t5ktd_gg_",
|
|
59
|
+
"_size_s": "_size_s_t5ktd_gg_",
|
|
60
|
+
"_size_m": "_size_m_t5ktd_gg_",
|
|
61
|
+
"_size_l": "_size_l_t5ktd_gg_",
|
|
62
|
+
"_size_xl": "_size_xl_t5ktd_gg_",
|
|
63
|
+
"_theme_primary-info": "_theme_primary-info_t5ktd_gg_",
|
|
64
|
+
"_active": "__active_t5ktd_gg_",
|
|
65
|
+
"_theme_primary-success": "_theme_primary-success_t5ktd_gg_",
|
|
66
|
+
"_theme_primary-warning": "_theme_primary-warning_t5ktd_gg_",
|
|
67
|
+
"_theme_primary-danger": "_theme_primary-danger_t5ktd_gg_",
|
|
68
|
+
"_theme_primary-invert": "_theme_primary-invert_t5ktd_gg_",
|
|
69
|
+
"_theme_secondary-muted": "_theme_secondary-muted_t5ktd_gg_",
|
|
70
|
+
"_theme_secondary-info": "_theme_secondary-info_t5ktd_gg_",
|
|
71
|
+
"_theme_secondary-invert": "_theme_secondary-invert_t5ktd_gg_",
|
|
72
|
+
"_theme_tertiary-info": "_theme_tertiary-info_t5ktd_gg_",
|
|
73
|
+
"_theme_tertiary-muted": "_theme_tertiary-muted_t5ktd_gg_",
|
|
74
|
+
"_theme_tertiary-invert": "_theme_tertiary-invert_t5ktd_gg_",
|
|
75
|
+
"_neighborLocation_right": "_neighborLocation_right_t5ktd_gg_",
|
|
76
|
+
"_neighborLocation_both": "_neighborLocation_both_t5ktd_gg_",
|
|
77
|
+
"_neighborLocation_left": "_neighborLocation_left_t5ktd_gg_",
|
|
78
|
+
"__SSpin": "___SSpin_t5ktd_gg_",
|
|
79
|
+
"__SInner": "___SInner_t5ktd_gg_",
|
|
80
|
+
"_loading": "__loading_t5ktd_gg_",
|
|
81
|
+
"__SText": "___SText_t5ktd_gg_",
|
|
82
|
+
"__SAddon": "___SAddon_t5ktd_gg_"
|
|
83
|
+
});
|
|
98
84
|
var MAP_USE_DEFAULT_THEME = {
|
|
99
85
|
primary: 'info',
|
|
100
86
|
secondary: 'muted',
|
|
101
87
|
tertiary: 'info'
|
|
102
88
|
};
|
|
103
89
|
exports.MAP_USE_DEFAULT_THEME = MAP_USE_DEFAULT_THEME;
|
|
104
|
-
var styled_c8 = (0, _core.create)([]);
|
|
105
90
|
|
|
106
91
|
var RootButton = /*#__PURE__*/function (_Component) {
|
|
107
92
|
(0, _inherits2["default"])(RootButton, _Component);
|
|
@@ -132,7 +117,10 @@ var RootButton = /*#__PURE__*/function (_Component) {
|
|
|
132
117
|
}, {
|
|
133
118
|
key: "render",
|
|
134
119
|
value: function render() {
|
|
135
|
-
var
|
|
120
|
+
var _ref = this ? this.asProps : arguments[0],
|
|
121
|
+
_ref4;
|
|
122
|
+
|
|
123
|
+
var SButton = _flexBox.Box;
|
|
136
124
|
var SInner = _flexBox.Box;
|
|
137
125
|
var SSpin = _flexBox.Box;
|
|
138
126
|
var _this$asProps = this.asProps,
|
|
@@ -144,37 +132,29 @@ var RootButton = /*#__PURE__*/function (_Component) {
|
|
|
144
132
|
loading = _this$asProps.loading,
|
|
145
133
|
_this$asProps$disable = _this$asProps.disabled,
|
|
146
134
|
disabled = _this$asProps$disable === void 0 ? loading : _this$asProps$disable,
|
|
147
|
-
active = _this$asProps.active,
|
|
148
135
|
size = _this$asProps.size,
|
|
149
136
|
addonLeft = _this$asProps.addonLeft,
|
|
150
|
-
addonRight = _this$asProps.addonRight
|
|
151
|
-
keyboardFocused = _this$asProps.keyboardFocused,
|
|
152
|
-
neighborLocation = _this$asProps.neighborLocation;
|
|
137
|
+
addonRight = _this$asProps.addonRight;
|
|
153
138
|
var useTheme = use && theme ? "".concat(use, "-").concat(theme) : false;
|
|
154
|
-
return
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
keyboardFocused: keyboardFocused
|
|
164
|
-
}), /*#__PURE__*/_react["default"].createElement(SInner, (0, _core.map)("SInner", {
|
|
165
|
-
tag: "span",
|
|
166
|
-
loading: loading
|
|
167
|
-
}), addonLeft ? /*#__PURE__*/_react["default"].createElement(Button.Addon, (0, _core.map)("Button.Addon", {
|
|
139
|
+
return _ref4 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SButton, _ref4.cn("SButton", _objectSpread({}, (0, _core.assignProps)({
|
|
140
|
+
"type": "button",
|
|
141
|
+
"tag": "button",
|
|
142
|
+
"disabled": disabled,
|
|
143
|
+
"use:theme": useTheme
|
|
144
|
+
}, _ref))), /*#__PURE__*/_react["default"].createElement(SInner, _ref4.cn("SInner", {
|
|
145
|
+
"tag": "span",
|
|
146
|
+
"loading": loading
|
|
147
|
+
}), addonLeft ? /*#__PURE__*/_react["default"].createElement(Button.Addon, {
|
|
168
148
|
tag: addonLeft
|
|
169
|
-
})
|
|
149
|
+
}) : null, (0, _addonTextChildren["default"])(Children, Button.Text, Button.Addon), addonRight ? /*#__PURE__*/_react["default"].createElement(Button.Addon, {
|
|
170
150
|
tag: addonRight
|
|
171
|
-
})
|
|
172
|
-
tag: "span"
|
|
173
|
-
}), /*#__PURE__*/_react["default"].createElement(_SpinButton["default"],
|
|
174
|
-
centered: true,
|
|
175
|
-
size: size,
|
|
176
|
-
theme: useTheme
|
|
177
|
-
}))))
|
|
151
|
+
}) : null), loading && /*#__PURE__*/_react["default"].createElement(SSpin, _ref4.cn("SSpin", {
|
|
152
|
+
"tag": "span"
|
|
153
|
+
}), /*#__PURE__*/_react["default"].createElement(_SpinButton["default"], _ref4.cn("SpinButton", {
|
|
154
|
+
"centered": true,
|
|
155
|
+
"size": size,
|
|
156
|
+
"theme": useTheme
|
|
157
|
+
}))));
|
|
178
158
|
}
|
|
179
159
|
}]);
|
|
180
160
|
return RootButton;
|
|
@@ -187,30 +167,25 @@ var RootButton = /*#__PURE__*/function (_Component) {
|
|
|
187
167
|
use: 'secondary',
|
|
188
168
|
size: 'm'
|
|
189
169
|
});
|
|
190
|
-
var styled_12c = (0, _core.create)([]);
|
|
191
170
|
|
|
192
171
|
function Text(props) {
|
|
193
|
-
var
|
|
194
|
-
|
|
195
|
-
styles = props.styles;
|
|
196
|
-
return (0, _core.styled)(((0, _core.set)([styled_12c, styles]), /*#__PURE__*/_react["default"].createElement(SText, (0, _core.map)("SText", {
|
|
197
|
-
render: _flexBox.Box,
|
|
198
|
-
tag: "span",
|
|
199
|
-
size: size
|
|
200
|
-
}))));
|
|
201
|
-
}
|
|
172
|
+
var _ref2 = this ? this.asProps : arguments[0],
|
|
173
|
+
_ref5;
|
|
202
174
|
|
|
203
|
-
var
|
|
175
|
+
var SText = _flexBox.Box;
|
|
176
|
+
return _ref5 = (0, _core.sstyled)(props.styles), /*#__PURE__*/_react["default"].createElement(SText, _ref5.cn("SText", _objectSpread({}, (0, _core.assignProps)({
|
|
177
|
+
"tag": "span"
|
|
178
|
+
}, _ref2))));
|
|
179
|
+
}
|
|
204
180
|
|
|
205
181
|
function Addon(props) {
|
|
206
|
-
var
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
tag: "span"
|
|
212
|
-
|
|
213
|
-
}))));
|
|
182
|
+
var _ref3 = this ? this.asProps : arguments[0],
|
|
183
|
+
_ref6;
|
|
184
|
+
|
|
185
|
+
var SAddon = _flexBox.Box;
|
|
186
|
+
return _ref6 = (0, _core.sstyled)(props.styles), /*#__PURE__*/_react["default"].createElement(SAddon, _ref6.cn("SAddon", _objectSpread({}, (0, _core.assignProps)({
|
|
187
|
+
"tag": "span"
|
|
188
|
+
}, _ref3))));
|
|
214
189
|
}
|
|
215
190
|
|
|
216
191
|
var Button = (0, _core["default"])(RootButton, {
|
package/lib/cjs/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Button.
|
|
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":"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","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
|
@@ -23,25 +23,23 @@ var SPIN_SIZE_MAP = {
|
|
|
23
23
|
s: 'xxs'
|
|
24
24
|
};
|
|
25
25
|
exports.SPIN_SIZE_MAP = SPIN_SIZE_MAP;
|
|
26
|
-
var SPIN_THEME_MAP
|
|
26
|
+
var SPIN_THEME_MAP = {
|
|
27
|
+
'primary-info': 'invert',
|
|
28
|
+
'primary-success': 'invert',
|
|
29
|
+
'primary-warning': 'invert',
|
|
30
|
+
'primary-danger': 'invert',
|
|
31
|
+
'secondary-invert': 'invert',
|
|
32
|
+
'secondary-muted': 'gray40',
|
|
33
|
+
'secondary-info': 'light-blue',
|
|
34
|
+
'tertiary-invert': 'invert',
|
|
35
|
+
'tertiary-info': 'light-blue'
|
|
36
|
+
};
|
|
27
37
|
exports.SPIN_THEME_MAP = SPIN_THEME_MAP;
|
|
28
38
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
SPIN_THEME_MAP["primary-danger"] = "invert";
|
|
34
|
-
SPIN_THEME_MAP["secondary-invert"] = "invert";
|
|
35
|
-
SPIN_THEME_MAP["secondary-muted"] = "gray40";
|
|
36
|
-
SPIN_THEME_MAP["secondary-info"] = "light-blue";
|
|
37
|
-
SPIN_THEME_MAP["tertiary-invert"] = "invert";
|
|
38
|
-
SPIN_THEME_MAP["tertiary-info"] = "light-blue";
|
|
39
|
-
})(SPIN_THEME_MAP || (exports.SPIN_THEME_MAP = SPIN_THEME_MAP = {}));
|
|
40
|
-
|
|
41
|
-
function SpinButton(props) {
|
|
42
|
-
var theme = props.theme,
|
|
43
|
-
size = props.size,
|
|
44
|
-
others = (0, _objectWithoutProperties2["default"])(props, ["theme", "size"]);
|
|
39
|
+
function SpinButton(_ref) {
|
|
40
|
+
var theme = _ref.theme,
|
|
41
|
+
size = _ref.size,
|
|
42
|
+
others = (0, _objectWithoutProperties2["default"])(_ref, ["theme", "size"]);
|
|
45
43
|
return /*#__PURE__*/_react["default"].createElement(_spin["default"], (0, _extends2["default"])({
|
|
46
44
|
size: typeof size == 'string' ? SPIN_SIZE_MAP[size] : size,
|
|
47
45
|
theme: typeof theme === 'string' ? SPIN_THEME_MAP[theme] || 'dark' : theme
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/SpinButton.
|
|
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
|
@@ -18,6 +18,7 @@ var _Button = _interopRequireWildcard(require("./Button"));
|
|
|
18
18
|
Object.keys(_Button).forEach(function (key) {
|
|
19
19
|
if (key === "default" || key === "__esModule") return;
|
|
20
20
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
21
|
+
if (key in exports && exports[key] === _Button[key]) return;
|
|
21
22
|
Object.defineProperty(exports, key, {
|
|
22
23
|
enumerable: true,
|
|
23
24
|
get: function get() {
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.
|
|
1
|
+
{"version":3,"sources":["../../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export { default } from './Button';\nexport * from './Button';\n"],"file":"index.js"}
|
|
@@ -50,31 +50,31 @@ SButton[keyboardFocused] {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
SButton[size='s'] {
|
|
53
|
-
height:
|
|
54
|
-
min-width:
|
|
53
|
+
height: 18px;
|
|
54
|
+
min-width: 18px;
|
|
55
55
|
border-radius: 2px;
|
|
56
|
-
font-size:
|
|
56
|
+
font-size: 10px;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
SButton[size='m'] {
|
|
60
|
-
height:
|
|
61
|
-
min-width:
|
|
60
|
+
height: 26px;
|
|
61
|
+
min-width: 26px;
|
|
62
62
|
border-radius: 3px;
|
|
63
|
-
font-size:
|
|
63
|
+
font-size: 12px;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
SButton[size='l'] {
|
|
67
|
-
height:
|
|
68
|
-
min-width:
|
|
67
|
+
height: 32px;
|
|
68
|
+
min-width: 32px;
|
|
69
69
|
border-radius: 4px;
|
|
70
|
-
font-size:
|
|
70
|
+
font-size: 14px;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
SButton[size='xl'] {
|
|
74
|
-
height:
|
|
75
|
-
min-width:
|
|
74
|
+
height: 42px;
|
|
75
|
+
min-width: 42px;
|
|
76
76
|
border-radius: 5px;
|
|
77
|
-
font-size:
|
|
77
|
+
font-size: 16px;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
SButton[theme='primary-info'] {
|
|
@@ -295,27 +295,27 @@ SInner[loading] {
|
|
|
295
295
|
|
|
296
296
|
SText {
|
|
297
297
|
display: inline-flex;
|
|
298
|
-
line-height: 1;
|
|
298
|
+
line-height: 1.1;
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
SText[size='s'] {
|
|
302
|
-
margin-left:
|
|
303
|
-
margin-right:
|
|
302
|
+
margin-left: 4px;
|
|
303
|
+
margin-right: 4px;
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
SText[size='m'] {
|
|
307
|
-
margin-left:
|
|
308
|
-
margin-right:
|
|
307
|
+
margin-left: 8px;
|
|
308
|
+
margin-right: 8px;
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
SText[size='l'] {
|
|
312
|
-
margin-left:
|
|
313
|
-
margin-right:
|
|
312
|
+
margin-left: 8px;
|
|
313
|
+
margin-right: 8px;
|
|
314
314
|
}
|
|
315
315
|
|
|
316
316
|
SText[size='xl'] {
|
|
317
|
-
margin-left:
|
|
318
|
-
margin-right:
|
|
317
|
+
margin-left: 12px;
|
|
318
|
+
margin-right: 12px;
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
SAddon {
|
|
@@ -326,60 +326,60 @@ SAddon {
|
|
|
326
326
|
|
|
327
327
|
SAddon[size='s'] {
|
|
328
328
|
&:not(:only-child):first-child {
|
|
329
|
-
margin-left:
|
|
329
|
+
margin-left: 4px;
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
&:not(:only-child):last-child {
|
|
333
|
-
margin-right:
|
|
333
|
+
margin-right: 4px;
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
&:only-child {
|
|
337
|
-
margin-left:
|
|
338
|
-
margin-right:
|
|
337
|
+
margin-left: -2px;
|
|
338
|
+
margin-right: -2px;
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
SAddon[size='m'] {
|
|
343
343
|
&:not(:only-child):first-child {
|
|
344
|
-
margin-left:
|
|
344
|
+
margin-left: 8px;
|
|
345
345
|
}
|
|
346
346
|
|
|
347
347
|
&:not(:only-child):last-child {
|
|
348
|
-
margin-right:
|
|
348
|
+
margin-right: 8px;
|
|
349
349
|
}
|
|
350
350
|
|
|
351
351
|
&:only-child {
|
|
352
|
-
margin-left:
|
|
353
|
-
margin-right:
|
|
352
|
+
margin-left: -4px;
|
|
353
|
+
margin-right: -4px;
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
SAddon[size='l'] {
|
|
358
358
|
&:not(:only-child):first-child {
|
|
359
|
-
margin-left:
|
|
359
|
+
margin-left: 8px;
|
|
360
360
|
}
|
|
361
361
|
|
|
362
362
|
&:not(:only-child):last-child {
|
|
363
|
-
margin-right:
|
|
363
|
+
margin-right: 8px;
|
|
364
364
|
}
|
|
365
365
|
|
|
366
366
|
&:only-child {
|
|
367
|
-
margin-left:
|
|
368
|
-
margin-right:
|
|
367
|
+
margin-left: -4px;
|
|
368
|
+
margin-right: -4px;
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
371
|
|
|
372
372
|
SAddon[size='xl'] {
|
|
373
373
|
&:not(:only-child):first-child {
|
|
374
|
-
margin-left:
|
|
374
|
+
margin-left: 12px;
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
&:not(:only-child):last-child {
|
|
378
|
-
margin-right:
|
|
378
|
+
margin-right: 12px;
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
&:only-child {
|
|
382
|
-
margin-left:
|
|
383
|
-
margin-right:
|
|
382
|
+
margin-left: -6px;
|
|
383
|
+
margin-right: -6px;
|
|
384
384
|
}
|
|
385
385
|
}
|