Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@semcore/button

Package Overview
Dependencies
Maintainers
1
Versions
301
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@semcore/button - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Changelog

## [1.1.0] - 2018-08-17
### Added
- Добавленна возможность работы с компонентом `ControlsGroup`
### Removed
- Убрали поддержку зависимости от React15
## [1.0.0] - 2018-08-08

@@ -7,0 +17,0 @@

73

lib/index.js

@@ -14,2 +14,3 @@ 'use strict';

var WithKeyboardFocus = _interopDefault(require('@semcore/utils/lib/enhances/WithKeyboardFocus'));
var WithNeighborLocation = _interopDefault(require('@semcore/utils/lib/enhances/WithNeighborLocation'));
var propsForElement = _interopDefault(require('@semcore/utils/lib/propsForElement'));

@@ -128,15 +129,10 @@ var isNode = _interopDefault(require('@semcore/utils/lib/isNode'));

return React__default.createElement(Spin, _extends({
size: SPIN_SIZE_MAP[size],
theme: SPIN_THEME_MAP[theme] || 'dark'
}, others));
return React__default.createElement(Spin, _extends({ size: SPIN_SIZE_MAP[size], theme: SPIN_THEME_MAP[theme] || 'dark' }, others));
}
var data = { "block": { "block": "_button_1id24_3", "disabled": { "block": "_button--disabled_1id24_40" }, "keyboard-focused": { "block": "_button--keyboard-focused_1id24_46" }, "full-width": { "block": "_button--full-width_1id24_50" }, "size": { "s": "_button--size_s_1id24_54", "m": "_button--size_m_1id24_61", "l": "_button--size_l_1id24_68", "xl": "_button--size_xl_1id24_75" }, "theme": { "primary-info": "_button--theme_primary-info_1id24_82", "primary-success": "_button--theme_primary-success_1id24_93", "primary-warning": "_button--theme_primary-warning_1id24_104", "primary-danger": "_button--theme_primary-danger_1id24_115", "primary-invert": "_button--theme_primary-invert_1id24_126", "secondary-muted": "_button--theme_secondary-muted_1id24_137",
"secondary-success": "_button--theme_secondary-success_1id24_153", "secondary-warning": "_button--theme_secondary-warning_1id24_169", "secondary-danger": "_button--theme_secondary-danger_1id24_185", "secondary-invert": "_button--theme_secondary-invert_1id24_201", "tertiary-info": "_button--theme_tertiary-info_1id24_213", "tertiary-success": "_button--theme_tertiary-success_1id24_227",
"tertiary-warning": "_button--theme_tertiary-warning_1id24_241", "tertiary-danger": "_button--theme_tertiary-danger_1id24_255", "tertiary-muted": "_button--theme_tertiary-muted_1id24_269", "tertiary-invert": "_button--theme_tertiary-invert_1id24_279" } }, "spin": { "block": "_button__spin_1id24_149" }, "inner": { "block": "_button__inner_1id24_289", "loading": { "block": "_button__inner--loading_1id24_297" } }, "text": { "block": "_button__text_1id24_301", "size": { "s": "_button__text--size_s_1id24_307", "m": "_button__text--size_m_1id24_312", "l": "_button__text--size_l_1id24_317", "xl": "_button__text--size_xl_1id24_322" } }, "additional": { "block": "_button__additional_1id24_327",
"size": { "s": "_button__additional--size_s_1id24_335", "m": "_button__additional--size_m_1id24_340", "l": "_button__additional--size_l_1id24_345", "xl": "_button__additional--size_xl_1id24_350" } } };(function cssModulesFnInject() {
var data = { "block": { "block": "_button_w0xey_3", "disabled": { "block": "_button--disabled_w0xey_40" }, "full-width": { "block": "_button--full-width_w0xey_48" }, "keyboard-focused": { "block": "_button--keyboard-focused_w0xey_44" }, "neighbor-location": { "both": "_button--neighbor-location_both_w0xey_382", "left": "_button--neighbor-location_left_w0xey_393", "right": "_button--neighbor-location_right_w0xey_377" }, "size": { "l": "_button--size_l_w0xey_66", "m": "_button--size_m_w0xey_59", "s": "_button--size_s_w0xey_52", "xl": "_button--size_xl_w0xey_73" }, "theme": { "primary-danger": "_button--theme_primary-danger_w0xey_113", "primary-info": "_button--theme_primary-info_w0xey_80", "primary-invert": "_button--theme_primary-invert_w0xey_124", "primary-success": "_button--theme_primary-success_w0xey_91", "primary-warning": "_button--theme_primary-warning_w0xey_102", "secondary-danger": "_button--theme_secondary-danger_w0xey_199", "secondary-info": "_button--theme_secondary-info_w0xey_151", "secondary-invert": "_button--theme_secondary-invert_w0xey_215", "secondary-muted": "_button--theme_secondary-muted_w0xey_135", "secondary-success": "_button--theme_secondary-success_w0xey_167", "secondary-warning": "_button--theme_secondary-warning_w0xey_183", "tertiary-danger": "_button--theme_tertiary-danger_w0xey_269", "tertiary-info": "_button--theme_tertiary-info_w0xey_227", "tertiary-invert": "_button--theme_tertiary-invert_w0xey_293", "tertiary-muted": "_button--theme_tertiary-muted_w0xey_283", "tertiary-success": "_button--theme_tertiary-success_w0xey_241", "tertiary-warning": "_button--theme_tertiary-warning_w0xey_255" } }, "additional": { "block": "_button__additional_w0xey_341", "size": { "l": "_button__additional--size_l_w0xey_359", "m": "_button__additional--size_m_w0xey_354", "s": "_button__additional--size_s_w0xey_349", "xl": "_button__additional--size_xl_w0xey_364" } }, "inner": {
"block": "_button__inner_w0xey_303", "loading": { "block": "_button__inner--loading_w0xey_311" } }, "spin": { "block": "_button__spin_w0xey_147" }, "text": { "block": "_button__text_w0xey_315", "size": { "l": "_button__text--size_l_w0xey_331", "m": "_button__text--size_m_w0xey_326", "s": "_button__text--size_s_w0xey_321",
"xl": "_button__text--size_xl_w0xey_336" } } };(function cssModulesFnInject() {
if (typeof window !== 'undefined') {
var head = window.document.head;var style = window.document.createElement("style");style.classList.add('_css-style');style.innerHTML = '._button_1id24_3 {\n line-height: normal;\n position: relative;\n text-align: center;\n touch-action: manipulation;\n cursor: pointer;\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n box-shadow: none;\n outline: none;\n border-radius: 0;\n text-decoration: none;\n background-color: transparent;\n -webkit-tap-highlight-color: transparent;\n color: inherit;\n overflow: visible;\n -webkit-appearance: button;\n -moz-appearance: button;\n appearance: button; /* for input */\n outline: 0;\n\n border: 1px solid transparent\n}\n\n._button_1id24_3::-moz-focus-inner {\n border: none;\n padding: 0;\n }\n\n._button_1id24_3:active,\n ._button_1id24_3:hover,\n ._button_1id24_3:focus {\n outline: 0;\n text-decoration: none;\n }\n\n._button--disabled_1id24_40 {\n opacity: 0.3;\n cursor: default;\n}\n\n._button--keyboard-focused_1id24_46 {\n box-shadow: 0 0 0 3px rgba(43, 148, 225, 0.3);\n}\n\n._button--full-width_1id24_50 {\n width: 100%;\n}\n\n._button--size_s_1id24_54 {\n height: 18px;\n min-width: 18px;\n border-radius: 2px;\n font-size: 10px;\n}\n\n._button--size_m_1id24_61 {\n height: 26px;\n min-width: 26px;\n border-radius: 3px;\n font-size: 12px;\n}\n\n._button--size_l_1id24_68 {\n height: 32px;\n min-width: 32px;\n border-radius: 4px;\n font-size: 14px;\n}\n\n._button--size_xl_1id24_75 {\n height: 42px;\n min-width: 42px;\n border-radius: 5px;\n font-size: 16px;\n}\n\n._button--theme_primary-info_1id24_82 {\n background-color: #2b94e1;\n color: #fff\n}\n\n._button--theme_primary-info_1id24_82:enabled:hover {\n background-color: #0071bc;\n }\n\n._button--theme_primary-info_1id24_82:enabled:active {\n background-color: hsl(203.936170212766, 100%, 35.0196078431%);\n }\n\n._button--theme_primary-success_1id24_93 {\n background-color: #4fae33;\n color: #fff\n}\n\n._button--theme_primary-success_1id24_93:enabled:hover {\n background-color: #1d9c00;\n }\n\n._button--theme_primary-success_1id24_93:enabled:active {\n background-color: hsl(108.84615384615384, 100%, 29.0588235294%);\n }\n\n._button--theme_primary-warning_1id24_104 {\n background-color: #ff7f00;\n color: #fff\n}\n\n._button--theme_primary-warning_1id24_104:enabled:hover {\n background-color: #cc6600;\n }\n\n._button--theme_primary-warning_1id24_104:enabled:active {\n background-color: hsl(30, 100%, 38%);\n }\n\n._button--theme_primary-danger_1id24_115 {\n background-color: #ed2d2d;\n color: #fff\n}\n\n._button--theme_primary-danger_1id24_115:enabled:hover {\n background-color: #d00000;\n }\n\n._button--theme_primary-danger_1id24_115:enabled:active {\n background-color: hsl(0, 100%, 38.7450980392%);\n }\n\n._button--theme_primary-invert_1id24_126 {\n background-color: #fff;\n color: #333333\n}\n\n._button--theme_primary-invert_1id24_126:enabled:hover {\n background-color: #eeeeee;\n }\n\n._button--theme_primary-invert_1id24_126:enabled:active {\n background-color: hsl(0, 5%, 88.6666666667%);\n }\n\n._button--theme_secondary-muted_1id24_137 {\n background-color: rgba(166, 176, 179, 0.1);\n color: #666666;\n border-color: #a6b0b3\n}\n\n._button--theme_secondary-muted_1id24_137:enabled:hover {\n background-color: rgba(166, 176, 179, 0.2);\n }\n\n._button--theme_secondary-muted_1id24_137:enabled:active {\n background-color: rgba(166, 176, 179, 0.3);\n }\n\n._button--theme_secondary-muted_1id24_137 > ._button__spin_1id24_149 div:nth-child(1) {\n border-color: #666666 #666666 transparent transparent;\n}\n\n._button--theme_secondary-success_1id24_153 {\n background-color: rgba(79, 174, 51, 0.05);\n color: #4fae33;\n border-color: #4fae33\n}\n\n._button--theme_secondary-success_1id24_153:enabled:hover {\n background-color: rgba(79, 174, 51, 0.2);\n }\n\n._button--theme_secondary-success_1id24_153:enabled:active {\n background-color: rgba(79, 174, 51, 0.3);\n }\n\n._button--theme_secondary-success_1id24_153 > ._button__spin_1id24_149 div:nth-child(1) {\n border-color: #4fae33 #4fae33 transparent transparent;\n}\n\n._button--theme_secondary-warning_1id24_169 {\n background-color: rgba(255, 127, 0, 0.05);\n color: #ff7f00;\n border-color: #ff7f00\n}\n\n._button--theme_secondary-warning_1id24_169:enabled:hover {\n background-color: rgba(255, 127, 0, 0.2);\n }\n\n._button--theme_secondary-warning_1id24_169:enabled:active {\n background-color: rgba(255, 127, 0, 0.3);\n }\n\n._button--theme_secondary-warning_1id24_169 > ._button__spin_1id24_149 div:nth-child(1) {\n border-color: #ff7f00 #ff7f00 transparent transparent;\n}\n\n._button--theme_secondary-danger_1id24_185 {\n background-color: rgba(237, 45, 45, 0.05);\n color: #ed2d2d;\n border-color: #ed2d2d\n}\n\n._button--theme_secondary-danger_1id24_185:enabled:hover {\n background-color: rgba(237, 45, 45, 0.2);\n }\n\n._button--theme_secondary-danger_1id24_185:enabled:active {\n background-color: rgba(237, 45, 45, 0.3);\n }\n\n._button--theme_secondary-danger_1id24_185 > ._button__spin_1id24_149 div:nth-child(1) {\n border-color: #ed2d2d #ed2d2d transparent transparent;\n}\n\n._button--theme_secondary-invert_1id24_201 {\n background-color: rgba(255, 255, 255, 0.05);\n color: #fff;\n border-color: #fff\n}\n\n._button--theme_secondary-invert_1id24_201:enabled:hover {\n background-color: rgba(255, 255, 255, 0.2);\n }\n\n._button--theme_secondary-invert_1id24_201:enabled:active {\n background-color: rgba(255, 255, 255, 0.3);\n }\n\n._button--theme_tertiary-info_1id24_213 {\n color: #2b94e1\n}\n\n._button--theme_tertiary-info_1id24_213:enabled:hover {\n background-color: rgba(43, 148, 225, 0.2);\n }\n\n._button--theme_tertiary-info_1id24_213:enabled:active {\n background-color: rgba(43, 148, 225, 0.3);\n }\n\n._button--theme_tertiary-info_1id24_213 > ._button__spin_1id24_149 div:nth-child(1) {\n border-color: #2b94e1 #2b94e1 transparent transparent;\n}\n\n._button--theme_tertiary-success_1id24_227 {\n color: #4fae33\n}\n\n._button--theme_tertiary-success_1id24_227:enabled:hover {\n background-color: rgba(79, 174, 51, 0.2);\n }\n\n._button--theme_tertiary-success_1id24_227:enabled:active {\n background-color: rgba(79, 174, 51, 0.3);\n }\n\n._button--theme_tertiary-success_1id24_227 > ._button__spin_1id24_149 div:nth-child(1) {\n border-color: #4fae33 #4fae33 transparent transparent;\n}\n\n._button--theme_tertiary-warning_1id24_241 {\n color: #ff7f00\n}\n\n._button--theme_tertiary-warning_1id24_241:enabled:hover {\n background-color: rgba(255, 127, 0, 0.2);\n }\n\n._button--theme_tertiary-warning_1id24_241:enabled:active {\n background-color: rgba(255, 127, 0, 0.3);\n }\n\n._button--theme_tertiary-warning_1id24_241 > ._button__spin_1id24_149 div:nth-child(1) {\n border-color: #ff7f00 #ff7f00 transparent transparent;\n}\n\n._button--theme_tertiary-danger_1id24_255 {\n color: #ed2d2d\n}\n\n._button--theme_tertiary-danger_1id24_255:enabled:hover {\n background-color: rgba(237, 45, 45, 0.2);\n }\n\n._button--theme_tertiary-danger_1id24_255:enabled:active {\n background-color: rgba(237, 45, 45, 0.3);\n }\n\n._button--theme_tertiary-danger_1id24_255 > ._button__spin_1id24_149 div:nth-child(1) {\n border-color: #ed2d2d #ed2d2d transparent transparent;\n}\n\n._button--theme_tertiary-muted_1id24_269 {\n color: #666666\n}\n\n._button--theme_tertiary-muted_1id24_269:enabled:hover {\n background-color: rgba(166, 176, 179, 0.2);\n }\n\n._button--theme_tertiary-muted_1id24_269:enabled:active {\n background-color: rgba(166, 176, 179, 0.3);\n }\n\n._button--theme_tertiary-invert_1id24_279 {\n color: #fff\n}\n\n._button--theme_tertiary-invert_1id24_279:enabled:hover {\n background-color: rgba(255, 255, 255, 0.2);\n }\n\n._button--theme_tertiary-invert_1id24_279:enabled:active {\n background-color: rgba(255, 255, 255, 0.3);\n }\n\n._button__inner_1id24_289 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n}\n\n._button__inner--loading_1id24_297 {\n visibility: hidden;\n}\n\n._button__text_1id24_301 {\n display: inline-block;\n padding-top: 0;\n padding-bottom: 0;\n}\n\n._button__text--size_s_1id24_307 {\n padding-left: 7px;\n padding-right: 7px;\n}\n\n._button__text--size_m_1id24_312 {\n padding-left: 12px;\n padding-right: 12px;\n}\n\n._button__text--size_l_1id24_317 {\n padding-left: 14px;\n padding-right: 14px;\n}\n\n._button__text--size_xl_1id24_322 {\n padding-left: 20px;\n padding-right: 20px;\n}\n\n._button__additional_1id24_327 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding-top: 0;\n padding-bottom: 0;\n}\n\n._button__additional--size_s_1id24_335 {\n padding-left: 5px;\n padding-right: 5px;\n}\n\n._button__additional--size_m_1id24_340 {\n padding-left: 7px;\n padding-right: 7px;\n}\n\n._button__additional--size_l_1id24_345 {\n padding-left: 7px;\n padding-right: 7px;\n}\n\n._button__additional--size_xl_1id24_350 {\n padding-left: 10px;\n padding-right: 10px;\n}\n\n._button__spin_1id24_149 {\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n left: 0;\n}\n\n/* For icon + text */\n\n._button_1id24_3 ._button__additional_1id24_327 + ._button__text_1id24_301 {\n padding-left: 0;\n}\n\n/* For text + icon */\n\n._button_1id24_3 ._button__text_1id24_301:not(:last-child) {\n padding-right: 0;\n}\n\n/* For icon + icon */\n\n._button_1id24_3 ._button__additional_1id24_327 + ._button__additional_1id24_327 {\n padding-left: 0;\n}\n\n/* For only icon */\n\n._button_1id24_3 ._button__additional_1id24_327:only-child {\n padding-left: 0;\n padding-right: 0;\n}\n';head.appendChild(style);
var head = window.document.head;var style = window.document.createElement("style");style.classList.add('_css-style');style.innerHTML = '._button_w0xey_3{-moz-appearance:button;-moz-user-select:none;-ms-user-select:none;-webkit-appearance:button;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;appearance:button;background-color:transparent;border:1px solid transparent;border-radius:0;box-shadow:none;box-sizing:border-box;color:inherit;cursor:pointer;line-height:normal;margin:0;outline:none;outline:0;overflow:visible;padding:0;position:relative;text-align:center;text-decoration:none;touch-action:manipulation;user-select:none;white-space:nowrap}._button_w0xey_3::-moz-focus-inner{border:none;padding:0}._button_w0xey_3:active,._button_w0xey_3:focus,._button_w0xey_3:hover{outline:0;text-decoration:none}._button--disabled_w0xey_40{opacity:.3}._button--keyboard-focused_w0xey_44{box-shadow:0 0 0 3px rgba(43,148,225,.3)}._button--full-width_w0xey_48{width:100%}._button--size_s_w0xey_52{border-radius:2px;font-size:10px;height:18px;min-width:18px}._button--size_m_w0xey_59{border-radius:3px;font-size:12px;height:26px;min-width:26px}._button--size_l_w0xey_66{border-radius:4px;font-size:14px;height:32px;min-width:32px}._button--size_xl_w0xey_73{border-radius:5px;font-size:16px;height:42px;min-width:42px}._button--theme_primary-info_w0xey_80{background-color:#2b94e1;color:#fff}._button--theme_primary-info_w0xey_80:enabled:hover{background-color:#0071bc}._button--theme_primary-info_w0xey_80:enabled:active{background-color:#006bb3}._button--theme_primary-success_w0xey_91{background-color:#4fae33;color:#fff}._button--theme_primary-success_w0xey_91:enabled:hover{background-color:#1d9c00}._button--theme_primary-success_w0xey_91:enabled:active{background-color:#1c9400}._button--theme_primary-warning_w0xey_102{background-color:#ff7f00;color:#fff}._button--theme_primary-warning_w0xey_102:enabled:hover{background-color:#c60}._button--theme_primary-warning_w0xey_102:enabled:active{background-color:#c26100}._button--theme_primary-danger_w0xey_113{background-color:#ed2d2d;color:#fff}._button--theme_primary-danger_w0xey_113:enabled:hover{background-color:#d00000}._button--theme_primary-danger_w0xey_113:enabled:active{background-color:#c60000}._button--theme_primary-invert_w0xey_124{background-color:#fff;color:#333}._button--theme_primary-invert_w0xey_124:enabled:hover{background-color:#eee}._button--theme_primary-invert_w0xey_124:enabled:active{background-color:#e4e1e1}._button--theme_secondary-muted_w0xey_135{background-color:rgba(166,176,179,.1);border-color:#a6b0b3;color:#666}._button--theme_secondary-muted_w0xey_135:enabled:hover{background-color:rgba(166,176,179,.2)}._button--theme_secondary-muted_w0xey_135:enabled:active{background-color:rgba(166,176,179,.3)}._button--theme_secondary-muted_w0xey_135>._button__spin_w0xey_147 div:first-child{border-color:#666 #666 transparent transparent}._button--theme_secondary-info_w0xey_151{background-color:rgba(43,148,225,.05);border-color:#2b94e1;color:#2b94e1}._button--theme_secondary-info_w0xey_151:enabled:hover{background-color:rgba(0,113,188,.2)}._button--theme_secondary-info_w0xey_151:enabled:active{background-color:rgba(0,113,188,.3)}._button--theme_secondary-info_w0xey_151>._button__spin_w0xey_147 div:first-child{border-color:#4fae33 #4fae33 transparent transparent}._button--theme_secondary-success_w0xey_167{background-color:rgba(79,174,51,.05);border-color:#4fae33;color:#4fae33}._button--theme_secondary-success_w0xey_167:enabled:hover{background-color:rgba(79,174,51,.2)}._button--theme_secondary-success_w0xey_167:enabled:active{background-color:rgba(79,174,51,.3)}._button--theme_secondary-success_w0xey_167>._button__spin_w0xey_147 div:first-child{border-color:#4fae33 #4fae33 transparent transparent}._button--theme_secondary-warning_w0xey_183{background-color:rgba(255,127,0,.05);border-color:#ff7f00;color:#ff7f00}._button--theme_secondary-warning_w0xey_183:enabled:hover{background-color:rgba(255,127,0,.2)}._button--theme_secondary-warning_w0xey_183:enabled:active{background-color:rgba(255,127,0,.3)}._button--theme_secondary-warning_w0xey_183>._button__spin_w0xey_147 div:first-child{border-color:#ff7f00 #ff7f00 transparent transparent}._button--theme_secondary-danger_w0xey_199{background-color:rgba(237,45,45,.05);border-color:#ed2d2d;color:#ed2d2d}._button--theme_secondary-danger_w0xey_199:enabled:hover{background-color:rgba(237,45,45,.2)}._button--theme_secondary-danger_w0xey_199:enabled:active{background-color:rgba(237,45,45,.3)}._button--theme_secondary-danger_w0xey_199>._button__spin_w0xey_147 div:first-child{border-color:#ed2d2d #ed2d2d transparent transparent}._button--theme_secondary-invert_w0xey_215{background-color:hsla(0,0%,100%,.05);border-color:#fff;color:#fff}._button--theme_secondary-invert_w0xey_215:enabled:hover{background-color:hsla(0,0%,100%,.2)}._button--theme_secondary-invert_w0xey_215:enabled:active{background-color:hsla(0,0%,100%,.3)}._button--theme_tertiary-info_w0xey_227{color:#2b94e1}._button--theme_tertiary-info_w0xey_227:enabled:hover{background-color:rgba(43,148,225,.2)}._button--theme_tertiary-info_w0xey_227:enabled:active{background-color:rgba(43,148,225,.3)}._button--theme_tertiary-info_w0xey_227>._button__spin_w0xey_147 div:first-child{border-color:#2b94e1 #2b94e1 transparent transparent}._button--theme_tertiary-success_w0xey_241{color:#4fae33}._button--theme_tertiary-success_w0xey_241:enabled:hover{background-color:rgba(79,174,51,.2)}._button--theme_tertiary-success_w0xey_241:enabled:active{background-color:rgba(79,174,51,.3)}._button--theme_tertiary-success_w0xey_241>._button__spin_w0xey_147 div:first-child{border-color:#4fae33 #4fae33 transparent transparent}._button--theme_tertiary-warning_w0xey_255{color:#ff7f00}._button--theme_tertiary-warning_w0xey_255:enabled:hover{background-color:rgba(255,127,0,.2)}._button--theme_tertiary-warning_w0xey_255:enabled:active{background-color:rgba(255,127,0,.3)}._button--theme_tertiary-warning_w0xey_255>._button__spin_w0xey_147 div:first-child{border-color:#ff7f00 #ff7f00 transparent transparent}._button--theme_tertiary-danger_w0xey_269{color:#ed2d2d}._button--theme_tertiary-danger_w0xey_269:enabled:hover{background-color:rgba(237,45,45,.2)}._button--theme_tertiary-danger_w0xey_269:enabled:active{background-color:rgba(237,45,45,.3)}._button--theme_tertiary-danger_w0xey_269>._button__spin_w0xey_147 div:first-child{border-color:#ed2d2d #ed2d2d transparent transparent}._button--theme_tertiary-muted_w0xey_283{color:#666}._button--theme_tertiary-muted_w0xey_283:enabled:hover{background-color:rgba(166,176,179,.2)}._button--theme_tertiary-muted_w0xey_283:enabled:active{background-color:rgba(166,176,179,.3)}._button--theme_tertiary-invert_w0xey_293{color:#fff}._button--theme_tertiary-invert_w0xey_293:enabled:hover{background-color:hsla(0,0%,100%,.2)}._button--theme_tertiary-invert_w0xey_293:enabled:active{background-color:hsla(0,0%,100%,.3)}._button__inner_w0xey_303{align-items:center;display:inline-flex;height:100%;justify-content:center;width:100%}._button__inner--loading_w0xey_311{visibility:hidden}._button__text_w0xey_315{display:inline-block;padding-bottom:0;padding-top:0}._button__text--size_s_w0xey_321{padding-left:7px;padding-right:7px}._button__text--size_m_w0xey_326{padding-left:12px;padding-right:12px}._button__text--size_l_w0xey_331{padding-left:14px;padding-right:14px}._button__text--size_xl_w0xey_336{padding-left:20px;padding-right:20px}._button__additional_w0xey_341{align-items:center;display:inline-flex;justify-content:center;padding-bottom:0;padding-top:0}._button__additional--size_s_w0xey_349{padding-left:5px;padding-right:5px}._button__additional--size_l_w0xey_359,._button__additional--size_m_w0xey_354{padding-left:7px;padding-right:7px}._button__additional--size_xl_w0xey_364{padding-left:10px;padding-right:10px}._button__spin_w0xey_147{height:100%;left:0;position:absolute;top:0;width:100%}._button--neighbor-location_right_w0xey_377{border-bottom-right-radius:0;border-top-right-radius:0}._button--neighbor-location_both_w0xey_382{border-radius:0;margin-left:-1px}._button--neighbor-location_both_w0xey_382[class*=button--theme_primary-]{border-left-color:hsla(0,0%,100%,.5)}._button--neighbor-location_both_w0xey_382._button--theme_primary-invert_w0xey_124{border-left-color:rgba(0,0,0,.5)}._button--neighbor-location_left_w0xey_393{border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px}._button--neighbor-location_left_w0xey_393[class*=button--theme_primary-]{border-left-color:hsla(0,0%,100%,.5)}._button--neighbor-location_left_w0xey_393._button--theme_primary-invert_w0xey_124{border-left-color:rgba(0,0,0,.5)}._button_w0xey_3 ._button__additional_w0xey_341+._button__text_w0xey_315{padding-left:0}._button_w0xey_3 ._button__text_w0xey_315:not(:last-child){padding-right:0}._button_w0xey_3 ._button__additional_w0xey_341+._button__additional_w0xey_341{padding-left:0}._button_w0xey_3 ._button__additional_w0xey_341:only-child{padding-left:0;padding-right:0}';head.appendChild(style);
}

@@ -148,8 +144,11 @@ })('./button.style.css');function block() {

return data['block']['disabled'][value];
};block['fullWidth'] = function () {
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'block';
return data['block']['full-width'][value];
};block['keyboardFocused'] = function () {
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'block';
return data['block']['keyboard-focused'][value];
};block['fullWidth'] = function () {
};block['neighborLocation'] = function () {
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'block';
return data['block']['full-width'][value];
return data['block']['neighbor-location'][value];
};block['size'] = function () {

@@ -161,5 +160,8 @@ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'block';

return data['block']['theme'][value];
};function spin() {
return data['spin']['block'];
}function inner() {
};function additional() {
return data['additional']['block'];
}additional['size'] = function () {
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'block';
return data['additional']['size'][value];
};function inner() {
return data['inner']['block'];

@@ -169,3 +171,5 @@ }inner['loading'] = function () {

return data['inner']['loading'][value];
};function text() {
};function spin() {
return data['spin']['block'];
}function text() {
return data['text']['block'];

@@ -175,7 +179,2 @@ }text['size'] = function () {

return data['text']['size'][value];
};function additional() {
return data['additional']['block'];
}additional['size'] = function () {
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'block';
return data['additional']['size'][value];
};

@@ -186,3 +185,4 @@

var USE = ['primary', 'secondary', 'tertiary'];
var MAP_USE_DEFAULT_THEME = { primary: 'info',
var MAP_USE_DEFAULT_THEME = {
primary: 'info',
secondary: 'muted',

@@ -221,22 +221,25 @@ tertiary: 'info'

keyboardFocused = _props.keyboardFocused,
neighborLocation = _props.neighborLocation,
fullWidth = _props.fullWidth,
className = _props.className;
var disabled = loading || disabledProp;
var theme = themeProp || MAP_USE_DEFAULT_THEME[use];
var styleBlock = cn(block(), block.size(size), block.theme(use + '-' + theme), (_cn = {}, defineProperty(_cn, block.keyboardFocused(), keyboardFocused), defineProperty(_cn, block.fullWidth(), fullWidth), defineProperty(_cn, block.disabled(), disabled), _cn), className);
var styleInner = cn(inner(), defineProperty({}, inner.loading(), loading));
var styleText = cn(text(), text.size(size));
var styleAdditional = cn(additional(), additional.size(size));
var styles = {
button: cn(block(), block.size(size), block.theme(use + '-' + theme), (_cn = {}, defineProperty(_cn, block.neighborLocation(neighborLocation), neighborLocation), defineProperty(_cn, block.keyboardFocused(), keyboardFocused), defineProperty(_cn, block.fullWidth(), fullWidth), defineProperty(_cn, block.disabled(), disabled), _cn), className),
inner: cn(inner(), defineProperty({}, inner.loading(), loading)),
text: cn(text(), text.size(size)),
additional: cn(additional(), additional.size(size))
};
return React__default.createElement(
'button',
_extends({}, propsForElement(this.props), { disabled: disabled, className: styleBlock }),
_extends({}, propsForElement(this.props), { disabled: disabled, className: styles.button }),
React__default.createElement(
'span',
{ className: styleInner },
{ className: styles.inner },
isNode(before) && React__default.createElement(
'span',
{ className: styleAdditional },
{ className: styles.additional },
before

@@ -246,3 +249,3 @@ ),

'span',
{ className: styleText },
{ className: styles.text },
children

@@ -252,3 +255,3 @@ ),

'span',
{ className: styleAdditional },
{ className: styles.additional },
after

@@ -272,3 +275,4 @@ )

Button.propTypes = {
/** Размер кнопки */size: PropTypes.oneOf(SIZES).isRequired,
/** Размер кнопки */
size: PropTypes.oneOf(SIZES).isRequired,
/** Тип использования кнопки */

@@ -288,7 +292,8 @@ use: PropTypes.oneOf(USE).isRequired,

keyboardFocused: PropTypes.bool,
/** Значение изменяющие слить в зависимости от расположения соседий */neighborLocation: PropTypes.oneOf(['right', 'both', 'left']),
/** Значение отвечающее за активность кнопки */
disabled: PropTypes.bool
};
var Button$1 = compose(WithKeyboardFocus())(Button);
var Button$1 = compose(WithKeyboardFocus(), WithNeighborLocation())(Button);
exports.default = Button$1;
{
"name": "@semcore/button",
"description": "SEMRush Button Component",
"version": "1.0.0",
"version": "1.1.0",
"main": "lib/index.js",

@@ -19,3 +19,3 @@ "author": "Roman Lysov <r.lysov@semrush.com>",

"peerDependencies": {
"react": ">=15.0.0 || >=16.0.0"
"react": "^16.0.0"
},

@@ -22,0 +22,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc