ecomlab-components-next 0.1.277 → 0.1.279

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.
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports["default"] = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
+ var _image = _interopRequireDefault(require("next/image"));
9
10
  require("./ButtonBasicV2.scss");
10
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
12
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
@@ -32,7 +33,13 @@ var ButtonBasicV2 = function ButtonBasicV2(_ref) {
32
33
  _ref$green = _ref.green,
33
34
  green = _ref$green === void 0 ? false : _ref$green,
34
35
  _ref$white = _ref.white,
35
- white = _ref$white === void 0 ? false : _ref$white;
36
+ white = _ref$white === void 0 ? false : _ref$white,
37
+ _ref$icon = _ref.icon,
38
+ icon = _ref$icon === void 0 ? '' : _ref$icon,
39
+ _ref$positionIcon = _ref.positionIcon,
40
+ positionIcon = _ref$positionIcon === void 0 ? 'left' : _ref$positionIcon,
41
+ _ref$loading = _ref.loading,
42
+ loading = _ref$loading === void 0 ? false : _ref$loading;
36
43
  // Если передан только "width" - то она становится статичной шириной, кнопка не расширяется и не сужается
37
44
  // Если передана "minWidth" кнопка становится пластичной и тянется до with(наибольшей ширины), minWidt(наименьшей ширины)
38
45
 
@@ -53,6 +60,20 @@ var ButtonBasicV2 = function ButtonBasicV2(_ref) {
53
60
  onClick: function onClick(e) {
54
61
  return _onClick && _onClick(e);
55
62
  }
56
- }, props), text);
63
+ }, props), loading ? /*#__PURE__*/_react["default"].createElement("div", {
64
+ className: "btn-basic-v2__loading"
65
+ }, /*#__PURE__*/_react["default"].createElement(MoonLoader, {
66
+ color: "#474747ff",
67
+ speedMultiplier: 0.5,
68
+ size: '20'
69
+ })) : icon ? /*#__PURE__*/_react["default"].createElement("div", {
70
+ className: "btn-basic-v2__with-icon"
71
+ }, icon && positionIcon == 'left' && /*#__PURE__*/_react["default"].createElement(_image["default"], {
72
+ src: icon,
73
+ alt: "icon"
74
+ }), text, icon && positionIcon == 'right' && /*#__PURE__*/_react["default"].createElement(_image["default"], {
75
+ src: icon,
76
+ alt: "icon"
77
+ })) : text);
57
78
  };
58
79
  var _default = exports["default"] = ButtonBasicV2;
@@ -14,6 +14,22 @@
14
14
  transition: all 0.2s ease;
15
15
  padding: 0 24px;
16
16
 
17
+ &__with-icon {
18
+ display: flex;
19
+ width: 100%;
20
+ justify-content: center;
21
+ gap: 8px;
22
+ align-items: center;
23
+ }
24
+
25
+ &__loading {
26
+ display: flex;
27
+ align-items: center;
28
+ justify-content: center;
29
+ width: 100%;
30
+ height: 100%;
31
+ }
32
+
17
33
  &:active {
18
34
  transform: translateY(0);
19
35
  }
@@ -43,7 +59,7 @@
43
59
  &:disabled {
44
60
  opacity: 0.6;
45
61
  cursor: not-allowed;
46
-
62
+
47
63
  &:hover {
48
64
  transform: none;
49
65
  box-shadow: none;
@@ -55,6 +71,7 @@
55
71
  opacity: 0;
56
72
  transform: translateY(24px);
57
73
  }
74
+
58
75
  to {
59
76
  opacity: 1;
60
77
  transform: translateY(0);
@@ -1,5 +1,5 @@
1
1
  @import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');
2
- @import '../variables.scss';
2
+ @import '../variables.scss';
3
3
 
4
4
  .features-grid-v2 {
5
5
  font-family: 'Manrope', sans-serif;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecomlab-components-next",
3
- "version": "0.1.277",
3
+ "version": "0.1.279",
4
4
  "description": "A set of common and reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "files": [