@synerise/ds-button 0.16.1 → 0.16.5
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 +35 -0
- package/dist/Button.js +9 -25
- package/dist/Button.styles.js +5 -7
- package/dist/Checkbox/Checkbox.js +3 -18
- package/dist/Creator/Creator.js +2 -15
- package/dist/Creator/Creator.styles.js +2 -4
- package/dist/Expander/Expander.styles.js +1 -3
- package/dist/Star/Star.js +1 -3
- package/dist/index.js +18 -37
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,41 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.16.5](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@0.16.4...@synerise/ds-button@0.16.5) (2022-02-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-button
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.16.4](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@0.16.3...@synerise/ds-button@0.16.4) (2022-01-17)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-button
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [0.16.3](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@0.16.2...@synerise/ds-button@0.16.3) (2021-12-22)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* **button:** fix width of the search button ([71aefef](https://github.com/synerise/synerise-design/commit/71aefef45295565fd8b6ce7b67d7ef88fa5cf9d6))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [0.16.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@0.16.1...@synerise/ds-button@0.16.2) (2021-11-22)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @synerise/ds-button
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
6
41
|
## [0.16.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@0.15.0...@synerise/ds-button@0.16.1) (2021-11-09)
|
|
7
42
|
|
|
8
43
|
**Note:** Version bump only for package @synerise/ds-button
|
package/dist/Button.js
CHANGED
|
@@ -2,20 +2,6 @@ var _excluded = ["type", "mode", "justifyContent", "groupVariant", "loading", "o
|
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
-
|
|
7
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
-
|
|
9
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
-
|
|
11
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
12
|
-
|
|
13
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
14
|
-
|
|
15
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
-
|
|
17
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
18
|
-
|
|
19
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
20
6
|
|
|
21
7
|
import * as React from 'react';
|
|
@@ -40,19 +26,17 @@ var Button = function Button(_ref) {
|
|
|
40
26
|
color = _ref$color === void 0 ? 'red' : _ref$color,
|
|
41
27
|
error = _ref.error,
|
|
42
28
|
activated = _ref.activated,
|
|
43
|
-
antdProps =
|
|
29
|
+
antdProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
44
30
|
|
|
45
31
|
var rippleRef = React.useRef(null);
|
|
46
32
|
|
|
47
33
|
var _React$useState = React.useState(''),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
setRippleClassName = _React$useState2[1];
|
|
34
|
+
rippleClassName = _React$useState[0],
|
|
35
|
+
setRippleClassName = _React$useState[1];
|
|
51
36
|
|
|
52
|
-
var _React$
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
setPressed = _React$useState4[1];
|
|
37
|
+
var _React$useState2 = React.useState(false),
|
|
38
|
+
pressed = _React$useState2[0],
|
|
39
|
+
setPressed = _React$useState2[1];
|
|
56
40
|
|
|
57
41
|
React.useEffect(function () {
|
|
58
42
|
if (rippleClassName !== '') {
|
|
@@ -71,7 +55,7 @@ var Button = function Button(_ref) {
|
|
|
71
55
|
var y = event.clientY - buttonBoundingRect.top;
|
|
72
56
|
|
|
73
57
|
if (rippleRef.current) {
|
|
74
|
-
rippleRef.current.style.cssText = "top: "
|
|
58
|
+
rippleRef.current.style.cssText = "top: " + y + "px; left: " + x + "px";
|
|
75
59
|
}
|
|
76
60
|
|
|
77
61
|
setRippleClassName('animate');
|
|
@@ -82,7 +66,7 @@ var Button = function Button(_ref) {
|
|
|
82
66
|
var classNameString = React.useMemo(function () {
|
|
83
67
|
var modeStringifed = !mode ? '' : mode;
|
|
84
68
|
var classNameStringifed = !className ? '' : className;
|
|
85
|
-
return "ds-button "
|
|
69
|
+
return "ds-button " + modeStringifed + " " + classNameStringifed;
|
|
86
70
|
}, [mode, className]);
|
|
87
71
|
return /*#__PURE__*/React.createElement(S.AntdButton, _extends({
|
|
88
72
|
justifyContent: justifyContent,
|
|
@@ -106,7 +90,7 @@ var Button = function Button(_ref) {
|
|
|
106
90
|
|
|
107
91
|
}, antdProps), /*#__PURE__*/React.createElement(S.RippleEffect, {
|
|
108
92
|
ref: rippleRef,
|
|
109
|
-
className: "btn-ripple "
|
|
93
|
+
className: "btn-ripple " + rippleClassName
|
|
110
94
|
}), antdProps.children, loading && /*#__PURE__*/React.createElement(S.Spinner, {
|
|
111
95
|
className: "btn-spinner",
|
|
112
96
|
"data-testid": "button-spinner"
|
package/dist/Button.styles.js
CHANGED
|
@@ -2,8 +2,6 @@ var _excluded = ["mode", "type", "loading", "justifyContent", "groupVariant", "c
|
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
-
|
|
7
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
6
|
|
|
9
7
|
import * as React from 'react';
|
|
@@ -57,7 +55,7 @@ export var AntdButton = styled(function (_ref) {
|
|
|
57
55
|
iconColor = _ref.iconColor,
|
|
58
56
|
error = _ref.error,
|
|
59
57
|
activated = _ref.activated,
|
|
60
|
-
rest =
|
|
58
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
61
59
|
|
|
62
60
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
63
61
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
@@ -72,7 +70,7 @@ export var AntdButton = styled(function (_ref) {
|
|
|
72
70
|
}, function (props) {
|
|
73
71
|
return props.shape && props.shape === 'circle' && css(["border-radius:50%;"]);
|
|
74
72
|
}, ButtonFocus, function (props) {
|
|
75
|
-
return props.mode !== 'single-icon' && css(["&.ant-btn:not(.ds-expander):not(.ds-button-creator){min-width:54px;}"]);
|
|
73
|
+
return props.mode !== 'single-icon' && css(["&.ant-btn:not(.ds-expander):not(.ds-button-creator):not(.btn-search):not(.btn-search-open){min-width:54px;}"]);
|
|
76
74
|
}, function (props) {
|
|
77
75
|
return pressedStyles(props);
|
|
78
76
|
}, function (props) {
|
|
@@ -96,7 +94,7 @@ export var AntdButton = styled(function (_ref) {
|
|
|
96
94
|
}, function (props) {
|
|
97
95
|
return props.loading && css(["> *:not(.btn-focus){opacity:0;visibility:hidden;}", "{opacity:1;visibility:visible;}"], Spinner);
|
|
98
96
|
}, function (props) {
|
|
99
|
-
return props.type === buttonType[props.type] && css(["&.ant-btn{&:not(:disabled){svg{fill:", ";}&:hover{svg{fill:", ";}}}}"], props.iconColor ? props.theme.palette[
|
|
97
|
+
return props.type === buttonType[props.type] && css(["&.ant-btn{&:not(:disabled){svg{fill:", ";}&:hover{svg{fill:", ";}}}}"], props.iconColor ? props.theme.palette[props.iconColor + "-600"] : props.theme.palette['grey-600'], props.iconColor ? props.theme.palette['blue-600'] : props.theme.palette['grey-600']);
|
|
100
98
|
}, function (props) {
|
|
101
99
|
return props.mode === 'split' && css(["&.ant-btn{padding-right:0;> span:not(.btn-focus){padding-right:12px;position:relative;}> span:not(.btn-focus) + .ds-icon{margin:0 4px 0 3px;position:relative;&:before{content:'';background-color:", ";top:", ";height:", ";width:1px;left:-4px;position:absolute;transition:all 0.3s ease;}}}"], props.type !== splitType[props.type] ? "rgba(255, 255, 255, 0.15);" : props.theme.palette['grey-300'], props.size === 'large' ? '-12px' : '-4px', props.size === 'large' ? '48px' : '32px');
|
|
102
100
|
}, function (props) {
|
|
@@ -122,7 +120,7 @@ export var AntdButton = styled(function (_ref) {
|
|
|
122
120
|
}, function (props) {
|
|
123
121
|
return props.error && props.type === 'secondary' && css(["&&&.ant-btn .btn-focus{box-shadow:inset 0 0 0 1px ", " !important;&&&:hover{background-color:", ";}&&&:active{background-color:", ";box-shadow:inset 0 0 0 2px ", ";span{color:", ";}svg{fill:", ";}}", "{background-color:", ";}}"], props.theme.palette['red-600'], props.theme.palette["red-200"], props.theme.palette["red-600"], props.theme.palette['blue-600'], props.theme.palette.white, props.theme.palette.white, RippleEffect, props.theme.palette["red-700"]);
|
|
124
122
|
}, function (props) {
|
|
125
|
-
return props.type === 'custom-color' && css(["&.ant-btn{background-color:", ";border:0 solid transparent;span{color:", ";}svg{color:", ";fill:", ";}", "{box-shadow:inset 0 0 0 0px transparent;}", "{background-color:", ";}&:focus{", "{box-shadow:inset 0 0 0 2px ", ";}}&:hover:not(:disabled):not(:focus){background-color:", ";span{color:", ";}svg{color:", " !important;fill:", " !important;}}&:disabled{opacity:0.4;background-color:", ";span{color:", ";}svg{color:", " !important;fill:", " !important;}}}"], props.theme.palette[
|
|
123
|
+
return props.type === 'custom-color' && css(["&.ant-btn{background-color:", ";border:0 solid transparent;span{color:", ";}svg{color:", ";fill:", ";}", "{box-shadow:inset 0 0 0 0px transparent;}", "{background-color:", ";}&:focus{", "{box-shadow:inset 0 0 0 2px ", ";}}&:hover:not(:disabled):not(:focus){background-color:", ";span{color:", ";}svg{color:", " !important;fill:", " !important;}}&:disabled{opacity:0.4;background-color:", ";span{color:", ";}svg{color:", " !important;fill:", " !important;}}}"], props.theme.palette[props.customColor + "-600"], props.theme.palette.white, props.theme.palette.white, props.theme.palette.white, ButtonFocus, RippleEffect, props.theme.palette[props.customColor + "-700"], ButtonFocus, props.theme.palette['blue-600'], props.theme.palette[props.customColor + "-500"], props.theme.palette.white, props.theme.palette.white, props.theme.palette.white, props.theme.palette[props.customColor + "-600"], props.theme.palette.white, props.theme.palette.white, props.theme.palette.white);
|
|
126
124
|
}, function (props) {
|
|
127
|
-
return props.type === 'custom-color-ghost' && css(["color:", ";.ds-icon > svg{fill:", ";}&:hover:not(:disabled):not(:focus){color:", ";span{color:", ";}svg{fill:", " !important;}}&:disabled{opacity:0.4;color:", ";.ds-icon > svg{fill:", " !important;}}"], props.theme.palette[
|
|
125
|
+
return props.type === 'custom-color-ghost' && css(["color:", ";.ds-icon > svg{fill:", ";}&:hover:not(:disabled):not(:focus){color:", ";span{color:", ";}svg{fill:", " !important;}}&:disabled{opacity:0.4;color:", ";.ds-icon > svg{fill:", " !important;}}"], props.theme.palette[props.customColor + "-600"], props.theme.palette[props.customColor + "-600"], props.theme.palette[props.customColor + "-500"], props.theme.palette[props.customColor + "-500"], props.theme.palette[props.customColor + "-500"], props.theme.palette[props.customColor + "-600"], props.theme.palette[props.customColor + "-600"]);
|
|
128
126
|
});
|
|
@@ -2,20 +2,6 @@ var _excluded = ["checked", "defaultChecked", "hasError", "indeterminate", "onCh
|
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
-
|
|
7
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
-
|
|
9
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
-
|
|
11
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
12
|
-
|
|
13
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
14
|
-
|
|
15
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
-
|
|
17
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
18
|
-
|
|
19
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
20
6
|
|
|
21
7
|
import * as React from 'react';
|
|
@@ -61,12 +47,11 @@ var CheckboxButton = function CheckboxButton(props) {
|
|
|
61
47
|
indeterminate = props.indeterminate,
|
|
62
48
|
onChange = props.onChange,
|
|
63
49
|
onClick = props.onClick,
|
|
64
|
-
restProps =
|
|
50
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
65
51
|
|
|
66
52
|
var _React$useState = React.useState(defaultChecked),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
setIsCheckedState = _React$useState2[1];
|
|
53
|
+
isCheckedState = _React$useState[0],
|
|
54
|
+
setIsCheckedState = _React$useState[1];
|
|
70
55
|
|
|
71
56
|
var handleButtonClick = function handleButtonClick(e) {
|
|
72
57
|
if (typeof onClick === 'function') {
|
package/dist/Creator/Creator.js
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
-
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
1
|
import * as React from 'react';
|
|
14
2
|
import Icon, { AddM } from '@synerise/ds-icon';
|
|
15
3
|
import * as S from './Creator.styles';
|
|
@@ -22,9 +10,8 @@ var Creator = function Creator(_ref) {
|
|
|
22
10
|
status = _ref.status;
|
|
23
11
|
|
|
24
12
|
var _React$useState = React.useState(false),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
setPressed = _React$useState2[1];
|
|
13
|
+
pressed = _React$useState[0],
|
|
14
|
+
setPressed = _React$useState[1];
|
|
28
15
|
|
|
29
16
|
var onPress = React.useCallback(function () {
|
|
30
17
|
setPressed(true);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
var _excluded = ["pressed", "withLabel"];
|
|
2
2
|
|
|
3
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
-
|
|
5
3
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
4
|
|
|
7
5
|
import * as React from 'react';
|
|
@@ -31,7 +29,7 @@ var uploadStyles = function uploadStyles(_ref2) {
|
|
|
31
29
|
export var Creator = styled(function (_ref3) {
|
|
32
30
|
var pressed = _ref3.pressed,
|
|
33
31
|
withLabel = _ref3.withLabel,
|
|
34
|
-
rest =
|
|
32
|
+
rest = _objectWithoutPropertiesLoose(_ref3, _excluded);
|
|
35
33
|
|
|
36
34
|
return /*#__PURE__*/React.createElement(Button, rest);
|
|
37
35
|
}).withConfig({
|
|
@@ -71,7 +69,7 @@ export var Creator = styled(function (_ref3) {
|
|
|
71
69
|
var theme = _ref7.theme;
|
|
72
70
|
return hexToRgba(theme.palette['grey-200'], 0.2);
|
|
73
71
|
}, function (props) {
|
|
74
|
-
return props.pressed && "&&{ background-color: "
|
|
72
|
+
return props.pressed && "&&{ background-color: " + hexToRgba(props.theme.palette['grey-200'], 0.4) + "; }";
|
|
75
73
|
}, function (props) {
|
|
76
74
|
return props.theme.palette['grey-400'];
|
|
77
75
|
}, function (props) {
|
|
@@ -2,8 +2,6 @@ var _excluded = ["children", "expanded", "size"];
|
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
-
|
|
7
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
6
|
|
|
9
7
|
import styled, { keyframes, css } from 'styled-components';
|
|
@@ -19,7 +17,7 @@ export var Expander = styled(function (_ref2) {
|
|
|
19
17
|
var children = _ref2.children,
|
|
20
18
|
expanded = _ref2.expanded,
|
|
21
19
|
size = _ref2.size,
|
|
22
|
-
rest =
|
|
20
|
+
rest = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
23
21
|
|
|
24
22
|
return (
|
|
25
23
|
/*#__PURE__*/
|
package/dist/Star/Star.js
CHANGED
|
@@ -2,8 +2,6 @@ var _excluded = ["hasError", "active"];
|
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
-
|
|
7
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
6
|
|
|
9
7
|
import * as React from 'react';
|
|
@@ -14,7 +12,7 @@ import * as S from './Star.styles';
|
|
|
14
12
|
var StarButton = function StarButton(props) {
|
|
15
13
|
var hasError = props.hasError,
|
|
16
14
|
active = props.active,
|
|
17
|
-
restProps =
|
|
15
|
+
restProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
18
16
|
|
|
19
17
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
20
18
|
"aria-pressed": !!active,
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
2
2
|
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
6
|
-
|
|
7
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
8
|
-
|
|
9
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10
|
-
|
|
11
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
|
-
|
|
13
|
-
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); }; }
|
|
14
|
-
|
|
15
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
16
|
-
|
|
17
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
|
-
|
|
19
|
-
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; } }
|
|
20
|
-
|
|
21
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
3
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
4
|
|
|
23
5
|
import * as React from 'react';
|
|
24
6
|
import MainButton from './Button';
|
|
@@ -28,29 +10,28 @@ import Expander from './Expander/Expander';
|
|
|
28
10
|
import StarButton from './Star/Star';
|
|
29
11
|
|
|
30
12
|
var Button = /*#__PURE__*/function (_React$Component) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var _super = _createSuper(Button);
|
|
13
|
+
_inheritsLoose(Button, _React$Component);
|
|
34
14
|
|
|
35
15
|
function Button() {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return _super.apply(this, arguments);
|
|
16
|
+
return _React$Component.apply(this, arguments) || this;
|
|
39
17
|
}
|
|
40
18
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}]);
|
|
19
|
+
var _proto = Button.prototype;
|
|
20
|
+
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
22
|
+
_proto.render = function render() {
|
|
23
|
+
return /*#__PURE__*/React.createElement(MainButton, this.props);
|
|
24
|
+
};
|
|
48
25
|
|
|
49
26
|
return Button;
|
|
50
27
|
}(React.Component);
|
|
51
28
|
|
|
52
|
-
Button
|
|
53
|
-
|
|
54
|
-
Button
|
|
55
|
-
|
|
29
|
+
_defineProperty(Button, "Checkbox", CheckboxButton);
|
|
30
|
+
|
|
31
|
+
_defineProperty(Button, "Creator", Creator);
|
|
32
|
+
|
|
33
|
+
_defineProperty(Button, "Expander", Expander);
|
|
34
|
+
|
|
35
|
+
_defineProperty(Button, "Star", StarButton);
|
|
36
|
+
|
|
56
37
|
export default Button;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-button",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.5",
|
|
4
4
|
"description": "Button UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-icon": "^0.
|
|
35
|
+
"@synerise/ds-icon": "^0.47.1"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@synerise/ds-core": "*",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"@synerise/ds-utils": "^0.19.0",
|
|
44
44
|
"csstype": "2.6.9"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "27ef26e44f1814e7fc97b46668078e9a78e8f217"
|
|
47
47
|
}
|