@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/lib/es6/Button.js
CHANGED
|
@@ -4,80 +4,70 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
import
|
|
7
|
+
import { sstyled as _sstyled } from "@semcore/core";
|
|
8
|
+
import { assignProps as _assignProps3 } from "@semcore/core";
|
|
9
|
+
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
10
|
+
import { assignProps as _assignProps } from "@semcore/core";
|
|
11
|
+
|
|
12
|
+
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; }
|
|
13
|
+
|
|
14
|
+
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) { _defineProperty(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; }
|
|
8
15
|
|
|
9
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); }; }
|
|
10
17
|
|
|
11
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
18
|
+
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; } }
|
|
12
19
|
|
|
13
20
|
import React from 'react';
|
|
21
|
+
import createComponent, { Component, sstyled, Root } from '@semcore/core';
|
|
14
22
|
import { Box } from '@semcore/flex-box';
|
|
15
|
-
import createComponent, { Component, styled, css, __css__, set, create, map } from '@semcore/core';
|
|
16
23
|
import { neighborLocationEnhance } from '@semcore/neighbor-location';
|
|
17
24
|
import keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
|
|
18
25
|
import addonTextChildren from '@semcore/utils/lib/addonTextChildren';
|
|
19
26
|
import SpinButton from './SpinButton';
|
|
20
27
|
|
|
21
28
|
/*__reshadow-styles__:"./style/button.shadow.css"*/
|
|
22
|
-
var
|
|
29
|
+
var style = (
|
|
23
30
|
/*__reshadow_css_start__*/
|
|
24
|
-
|
|
31
|
+
_sstyled.insert(
|
|
25
32
|
/*__inner_css_start__*/
|
|
26
|
-
".___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}"
|
|
33
|
+
".___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}"
|
|
27
34
|
/*__inner_css_end__*/
|
|
28
|
-
, "
|
|
35
|
+
, "1o9hhkh_gg_")
|
|
29
36
|
/*__reshadow_css_end__*/
|
|
30
37
|
, {
|
|
31
|
-
"__SButton": "
|
|
32
|
-
"_disabled": "
|
|
33
|
-
"_keyboardFocused": "
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"_theme_primary-
|
|
41
|
-
"
|
|
42
|
-
"_theme_primary-
|
|
43
|
-
"_theme_primary-
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"_theme_secondary-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"_theme_tertiary-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
"__SText": "___SText_cipg3_gg_",
|
|
60
|
-
"__SAddon": "___SAddon_cipg3_gg_"
|
|
61
|
-
}),
|
|
62
|
-
style = _extends({}, _ref);
|
|
63
|
-
|
|
64
|
-
if (false) {
|
|
65
|
-
/*__reshadow_css_start__*/
|
|
66
|
-
__css__(
|
|
67
|
-
/*__inner_css_start__*/
|
|
68
|
-
"@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 }}"
|
|
69
|
-
/*__inner_css_end__*/
|
|
70
|
-
, "i5meff_gg_")
|
|
71
|
-
/*__reshadow_css_end__*/
|
|
72
|
-
;
|
|
73
|
-
}
|
|
74
|
-
|
|
38
|
+
"__SButton": "___SButton_t5ktd_gg_",
|
|
39
|
+
"_disabled": "__disabled_t5ktd_gg_",
|
|
40
|
+
"_keyboardFocused": "__keyboardFocused_t5ktd_gg_",
|
|
41
|
+
"_size_s": "_size_s_t5ktd_gg_",
|
|
42
|
+
"_size_m": "_size_m_t5ktd_gg_",
|
|
43
|
+
"_size_l": "_size_l_t5ktd_gg_",
|
|
44
|
+
"_size_xl": "_size_xl_t5ktd_gg_",
|
|
45
|
+
"_theme_primary-info": "_theme_primary-info_t5ktd_gg_",
|
|
46
|
+
"_active": "__active_t5ktd_gg_",
|
|
47
|
+
"_theme_primary-success": "_theme_primary-success_t5ktd_gg_",
|
|
48
|
+
"_theme_primary-warning": "_theme_primary-warning_t5ktd_gg_",
|
|
49
|
+
"_theme_primary-danger": "_theme_primary-danger_t5ktd_gg_",
|
|
50
|
+
"_theme_primary-invert": "_theme_primary-invert_t5ktd_gg_",
|
|
51
|
+
"_theme_secondary-muted": "_theme_secondary-muted_t5ktd_gg_",
|
|
52
|
+
"_theme_secondary-info": "_theme_secondary-info_t5ktd_gg_",
|
|
53
|
+
"_theme_secondary-invert": "_theme_secondary-invert_t5ktd_gg_",
|
|
54
|
+
"_theme_tertiary-info": "_theme_tertiary-info_t5ktd_gg_",
|
|
55
|
+
"_theme_tertiary-muted": "_theme_tertiary-muted_t5ktd_gg_",
|
|
56
|
+
"_theme_tertiary-invert": "_theme_tertiary-invert_t5ktd_gg_",
|
|
57
|
+
"_neighborLocation_right": "_neighborLocation_right_t5ktd_gg_",
|
|
58
|
+
"_neighborLocation_both": "_neighborLocation_both_t5ktd_gg_",
|
|
59
|
+
"_neighborLocation_left": "_neighborLocation_left_t5ktd_gg_",
|
|
60
|
+
"__SSpin": "___SSpin_t5ktd_gg_",
|
|
61
|
+
"__SInner": "___SInner_t5ktd_gg_",
|
|
62
|
+
"_loading": "__loading_t5ktd_gg_",
|
|
63
|
+
"__SText": "___SText_t5ktd_gg_",
|
|
64
|
+
"__SAddon": "___SAddon_t5ktd_gg_"
|
|
65
|
+
});
|
|
75
66
|
export var MAP_USE_DEFAULT_THEME = {
|
|
76
67
|
primary: 'info',
|
|
77
68
|
secondary: 'muted',
|
|
78
69
|
tertiary: 'info'
|
|
79
70
|
};
|
|
80
|
-
var styled_c8 = create([]);
|
|
81
71
|
|
|
82
72
|
var RootButton = /*#__PURE__*/function (_Component) {
|
|
83
73
|
_inherits(RootButton, _Component);
|
|
@@ -109,7 +99,10 @@ var RootButton = /*#__PURE__*/function (_Component) {
|
|
|
109
99
|
}, {
|
|
110
100
|
key: "render",
|
|
111
101
|
value: function render() {
|
|
112
|
-
var
|
|
102
|
+
var _ref = this ? this.asProps : arguments[0],
|
|
103
|
+
_ref4;
|
|
104
|
+
|
|
105
|
+
var SButton = Box;
|
|
113
106
|
var SInner = Box;
|
|
114
107
|
var SSpin = Box;
|
|
115
108
|
var _this$asProps = this.asProps,
|
|
@@ -121,37 +114,29 @@ var RootButton = /*#__PURE__*/function (_Component) {
|
|
|
121
114
|
loading = _this$asProps.loading,
|
|
122
115
|
_this$asProps$disable = _this$asProps.disabled,
|
|
123
116
|
disabled = _this$asProps$disable === void 0 ? loading : _this$asProps$disable,
|
|
124
|
-
active = _this$asProps.active,
|
|
125
117
|
size = _this$asProps.size,
|
|
126
118
|
addonLeft = _this$asProps.addonLeft,
|
|
127
|
-
addonRight = _this$asProps.addonRight
|
|
128
|
-
keyboardFocused = _this$asProps.keyboardFocused,
|
|
129
|
-
neighborLocation = _this$asProps.neighborLocation;
|
|
119
|
+
addonRight = _this$asProps.addonRight;
|
|
130
120
|
var useTheme = use && theme ? "".concat(use, "-").concat(theme) : false;
|
|
131
|
-
return
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
keyboardFocused: keyboardFocused
|
|
141
|
-
}), /*#__PURE__*/React.createElement(SInner, map("SInner", {
|
|
142
|
-
tag: "span",
|
|
143
|
-
loading: loading
|
|
144
|
-
}), addonLeft ? /*#__PURE__*/React.createElement(Button.Addon, map("Button.Addon", {
|
|
121
|
+
return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(SButton, _ref4.cn("SButton", _objectSpread({}, _assignProps({
|
|
122
|
+
"type": "button",
|
|
123
|
+
"tag": "button",
|
|
124
|
+
"disabled": disabled,
|
|
125
|
+
"use:theme": useTheme
|
|
126
|
+
}, _ref))), /*#__PURE__*/React.createElement(SInner, _ref4.cn("SInner", {
|
|
127
|
+
"tag": "span",
|
|
128
|
+
"loading": loading
|
|
129
|
+
}), addonLeft ? /*#__PURE__*/React.createElement(Button.Addon, {
|
|
145
130
|
tag: addonLeft
|
|
146
|
-
})
|
|
131
|
+
}) : null, addonTextChildren(Children, Button.Text, Button.Addon), addonRight ? /*#__PURE__*/React.createElement(Button.Addon, {
|
|
147
132
|
tag: addonRight
|
|
148
|
-
})
|
|
149
|
-
tag: "span"
|
|
150
|
-
}), /*#__PURE__*/React.createElement(SpinButton,
|
|
151
|
-
centered: true,
|
|
152
|
-
size: size,
|
|
153
|
-
theme: useTheme
|
|
154
|
-
}))))
|
|
133
|
+
}) : null), loading && /*#__PURE__*/React.createElement(SSpin, _ref4.cn("SSpin", {
|
|
134
|
+
"tag": "span"
|
|
135
|
+
}), /*#__PURE__*/React.createElement(SpinButton, _ref4.cn("SpinButton", {
|
|
136
|
+
"centered": true,
|
|
137
|
+
"size": size,
|
|
138
|
+
"theme": useTheme
|
|
139
|
+
}))));
|
|
155
140
|
}
|
|
156
141
|
}]);
|
|
157
142
|
|
|
@@ -169,30 +154,24 @@ _defineProperty(RootButton, "defaultProps", {
|
|
|
169
154
|
size: 'm'
|
|
170
155
|
});
|
|
171
156
|
|
|
172
|
-
var styled_12c = create([]);
|
|
173
|
-
|
|
174
157
|
function Text(props) {
|
|
175
|
-
var
|
|
176
|
-
|
|
177
|
-
styles = props.styles;
|
|
178
|
-
return styled((set([styled_12c, styles]), /*#__PURE__*/React.createElement(SText, map("SText", {
|
|
179
|
-
render: Box,
|
|
180
|
-
tag: "span",
|
|
181
|
-
size: size
|
|
182
|
-
}))));
|
|
183
|
-
}
|
|
158
|
+
var _ref2 = this ? this.asProps : arguments[0],
|
|
159
|
+
_ref5;
|
|
184
160
|
|
|
185
|
-
var
|
|
161
|
+
var SText = Box;
|
|
162
|
+
return _ref5 = sstyled(props.styles), /*#__PURE__*/React.createElement(SText, _ref5.cn("SText", _objectSpread({}, _assignProps2({
|
|
163
|
+
"tag": "span"
|
|
164
|
+
}, _ref2))));
|
|
165
|
+
}
|
|
186
166
|
|
|
187
167
|
function Addon(props) {
|
|
188
|
-
var
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
tag: "span"
|
|
194
|
-
|
|
195
|
-
}))));
|
|
168
|
+
var _ref3 = this ? this.asProps : arguments[0],
|
|
169
|
+
_ref6;
|
|
170
|
+
|
|
171
|
+
var SAddon = Box;
|
|
172
|
+
return _ref6 = sstyled(props.styles), /*#__PURE__*/React.createElement(SAddon, _ref6.cn("SAddon", _objectSpread({}, _assignProps3({
|
|
173
|
+
"tag": "span"
|
|
174
|
+
}, _ref3))));
|
|
196
175
|
}
|
|
197
176
|
|
|
198
177
|
var Button = createComponent(RootButton, {
|
package/lib/es6/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Button.
|
|
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;AAAA,UACLC,IADK,GACI,KAAKC,OADT,CACLD,IADK;AAEb,aAAO;AACLA,QAAAA,IAAI,EAAJA;AADK,OAAP;AAGD;;;WAED,yBAAgB;AAAA,UACNA,IADM,GACG,KAAKC,OADR,CACND,IADM;AAEd,aAAO;AACLA,QAAAA,IAAI,EAAJA;AADK,OAAP;AAGD;;;WAED,kBAAS;AAAA;AAAA;;AACP,UAAME,OAAO,GAiBMZ,GAjBnB;AACA,UAAMa,MAAM,GAAGb,GAAf;AACA,UAAMc,KAAK,GAAGd,GAAd;AAHO,0BAcH,KAAKW,OAdF;AAAA,UAKLI,QALK,iBAKLA,QALK;AAAA,UAMLC,MANK,iBAMLA,MANK;AAAA,UAOLC,GAPK,iBAOLA,GAPK;AAAA,8CAQLC,KARK;AAAA,UAQLA,KARK,oCAQG,OAAOD,GAAP,KAAe,QAAf,IAA2BZ,qBAAqB,CAACY,GAAD,CARnD;AAAA,UASLE,OATK,iBASLA,OATK;AAAA,gDAULC,QAVK;AAAA,UAULA,QAVK,sCAUMD,OAVN;AAAA,UAWLT,IAXK,iBAWLA,IAXK;AAAA,UAYLW,SAZK,iBAYLA,SAZK;AAAA,UAaLC,UAbK,iBAaLA,UAbK;AAgBP,UAAMC,QAAQ,GAAGN,GAAG,IAAIC,KAAP,aAAkBD,GAAlB,cAAyBC,KAAzB,IAAmC,KAApD;AACA,qBAAOpB,OAAO,CAACkB,MAAD,CAAd,eACE,oBAAC,OAAD;AAAA,gBAA2B,QAA3B;AAAA,eAAwC,QAAxC;AAAA,oBAA2DI,QAA3D;AAAA,qBAAgFG;AAAhF,+BACE,oBAAC,MAAD;AAAA,eAAY,MAAZ;AAAA,mBAA4BJ;AAA5B,UACGE,SAAS,gBAAG,oBAAC,MAAD,CAAQ,KAAR;AAAc,QAAA,GAAG,EAAEA;AAAnB,QAAH,GAAsC,IADlD,EAEGlB,iBAAiB,CAACY,QAAD,EAAWS,MAAM,CAACC,IAAlB,EAAwBD,MAAM,CAACE,KAA/B,CAFpB,EAGGJ,UAAU,gBAAG,oBAAC,MAAD,CAAQ,KAAR;AAAc,QAAA,GAAG,EAAEA;AAAnB,QAAH,GAAuC,IAHpD,CADF,EAMGH,OAAO,iBACN,oBAAC,KAAD;AAAA,eAAW;AAAX,uBACE,oBAAC,UAAD;AAAA;AAAA,gBAA2BT,IAA3B;AAAA,iBAAwCa;AAAxC,SADF,CAPJ,CADF;AAcD;;;;EAtDsB1B,S;;gBAAnBY,U,iBACiB,Q;;gBADjBA,U,aAEa,CAACP,oBAAoB,EAArB,EAAyBD,uBAAuB,EAAhD,C;;gBAFbQ,U,WAGWkB,K;;gBAHXlB,U,kBAIkB;AACpBQ,EAAAA,GAAG,EAAE,WADe;AAEpBP,EAAAA,IAAI,EAAE;AAFc,C;;AAqDxB,SAASe,IAAT,CAAcG,KAAd,EAAqB;AAAA;AAAA;;AACnB,MAAMC,KAAK,GACiC7B,GAD5C;AACA,iBAAOF,OAAO,CAAC8B,KAAK,CAACZ,MAAP,CAAd,eAA6B,oBAAC,KAAD;AAAA,WAAwB;AAAxB,cAA7B;AACD;;AAED,SAASU,KAAT,CAAeE,KAAf,EAAsB;AAAA;AAAA;;AACpB,MAAME,MAAM,GACiC9B,GAD7C;AACA,iBAAOF,OAAO,CAAC8B,KAAK,CAACZ,MAAP,CAAd,eAA6B,oBAAC,MAAD;AAAA,WAAyB;AAAzB,cAA7B;AACD;;AAED,IAAMQ,MAAM,GAAG5B,eAAe,CAACa,UAAD,EAAa;AACzCgB,EAAAA,IAAI,EAAJA,IADyC;AAEzCC,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
|
@@ -8,24 +8,21 @@ export var SPIN_SIZE_MAP = {
|
|
|
8
8
|
m: 'xs',
|
|
9
9
|
s: 'xxs'
|
|
10
10
|
};
|
|
11
|
-
export var SPIN_THEME_MAP
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var theme = props.theme,
|
|
27
|
-
size = props.size,
|
|
28
|
-
others = _objectWithoutProperties(props, ["theme", "size"]);
|
|
11
|
+
export var SPIN_THEME_MAP = {
|
|
12
|
+
'primary-info': 'invert',
|
|
13
|
+
'primary-success': 'invert',
|
|
14
|
+
'primary-warning': 'invert',
|
|
15
|
+
'primary-danger': 'invert',
|
|
16
|
+
'secondary-invert': 'invert',
|
|
17
|
+
'secondary-muted': 'gray40',
|
|
18
|
+
'secondary-info': 'light-blue',
|
|
19
|
+
'tertiary-invert': 'invert',
|
|
20
|
+
'tertiary-info': 'light-blue'
|
|
21
|
+
};
|
|
22
|
+
export default function SpinButton(_ref) {
|
|
23
|
+
var theme = _ref.theme,
|
|
24
|
+
size = _ref.size,
|
|
25
|
+
others = _objectWithoutProperties(_ref, ["theme", "size"]);
|
|
29
26
|
|
|
30
27
|
return /*#__PURE__*/React.createElement(Spin, _extends({
|
|
31
28
|
size: typeof size == 'string' ? SPIN_SIZE_MAP[size] : size,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/SpinButton.
|
|
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"}
|
package/lib/es6/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.
|
|
1
|
+
{"version":3,"sources":["../../src/index.js"],"names":["default"],"mappings":"AAAA,SAASA,OAAT,QAAwB,UAAxB;AACA,cAAc,UAAd","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
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,2 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
|
|
3
|
+
import { IKeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
|
|
4
|
+
import { IBoxProps } from '@semcore/flex-box';
|
|
5
|
+
import { INeighborItemProps } from '@semcore/neighbor-location';
|
|
6
|
+
|
|
7
|
+
export type ButtonSize = 'xl' | 'l' | 'm' | 's';
|
|
8
|
+
|
|
9
|
+
export interface IButtonProps extends IBoxProps, INeighborItemProps, IKeyboardFocusProps {
|
|
10
|
+
/**
|
|
11
|
+
* Button type
|
|
12
|
+
* @default secondary
|
|
13
|
+
*/
|
|
14
|
+
use?: 'primary' | 'secondary' | 'tertiary';
|
|
15
|
+
/** Button theme */
|
|
16
|
+
theme?: 'info' | 'success' | 'warning' | 'danger' | 'muted' | 'invert';
|
|
17
|
+
/** Button activity state */
|
|
18
|
+
active?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Button size
|
|
21
|
+
* @default m
|
|
22
|
+
*/
|
|
23
|
+
size?: ButtonSize;
|
|
24
|
+
/** Disabled button state */
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** Loading button state */
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
/** Tag for the left Addon */
|
|
29
|
+
addonLeft?: React.ElementType;
|
|
30
|
+
/** Tag for the right Addon */
|
|
31
|
+
addonRight?: React.ElementType;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface IButtonTextProps extends IBoxProps {
|
|
35
|
+
size?: ButtonSize;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface IButtonAddonProps extends IBoxProps {
|
|
39
|
+
size?: ButtonSize;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface IButtonContext {
|
|
43
|
+
getTextProps: PropGetterFn;
|
|
44
|
+
getAddonProps: PropGetterFn;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare const Button: (<T>(props: CProps<IButtonProps & T, IButtonContext>) => ReturnEl) & {
|
|
48
|
+
Text: <T>(props: IButtonTextProps & T) => ReturnEl;
|
|
49
|
+
Addon: <T>(props: IButtonAddonProps & T) => ReturnEl;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default Button;
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/button",
|
|
3
3
|
"description": "SEMRush Button Component",
|
|
4
|
-
"version": "3.2
|
|
4
|
+
"version": "3.3.2",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
8
9
|
"author": "Roman Lysov <r.lysov@semrush.com>",
|
|
9
10
|
"license": "MIT",
|
|
10
11
|
"scripts": {
|
|
11
|
-
"build": "build",
|
|
12
|
+
"build": "build --source=js",
|
|
12
13
|
"test": "jest"
|
|
13
14
|
},
|
|
14
15
|
"dependencies": {
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
"@semcore/flex-box": "^4"
|
|
19
20
|
},
|
|
20
21
|
"peerDependencies": {
|
|
21
|
-
"@semcore/core": "^1",
|
|
22
|
+
"@semcore/core": "^1.11",
|
|
22
23
|
"react": "16.8 - 17"
|
|
23
24
|
},
|
|
24
25
|
"jest": {
|