@synerise/ds-button 0.21.19 → 0.21.21

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 CHANGED
@@ -3,6 +3,22 @@
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.21.21](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@0.21.20...@synerise/ds-button@0.21.21) (2024-11-29)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-button
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.21.20](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@0.21.19...@synerise/ds-button@0.21.20) (2024-11-28)
15
+
16
+ **Note:** Version bump only for package @synerise/ds-button
17
+
18
+
19
+
20
+
21
+
6
22
  ## [0.21.19](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@0.21.18...@synerise/ds-button@0.21.19) (2024-11-21)
7
23
 
8
24
  **Note:** Version bump only for package @synerise/ds-button
package/dist/Button.js CHANGED
@@ -1,45 +1,38 @@
1
1
  var _excluded = ["type", "mode", "justifyContent", "groupVariant", "loading", "onClick", "className", "color", "error", "activated"];
2
-
3
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
-
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
-
7
4
  import React, { useEffect, useState, useMemo, useRef } from 'react';
8
5
  import '@synerise/ds-core/dist/js/style';
9
6
  import "./style/index.css";
10
7
  import Icon, { SpinnerM } from '@synerise/ds-icon';
11
8
  import * as S from './Button.styles';
12
9
  var RIPPLE_ANIMATION_OFFSET = 50;
13
-
14
10
  var Button = function Button(_ref) {
15
11
  var _ref$type = _ref.type,
16
- type = _ref$type === void 0 ? 'secondary' : _ref$type,
17
- mode = _ref.mode,
18
- _ref$justifyContent = _ref.justifyContent,
19
- justifyContent = _ref$justifyContent === void 0 ? 'center' : _ref$justifyContent,
20
- groupVariant = _ref.groupVariant,
21
- _ref$loading = _ref.loading,
22
- loading = _ref$loading === void 0 ? false : _ref$loading,
23
- onClick = _ref.onClick,
24
- className = _ref.className,
25
- _ref$color = _ref.color,
26
- color = _ref$color === void 0 ? 'red' : _ref$color,
27
- error = _ref.error,
28
- activated = _ref.activated,
29
- antdProps = _objectWithoutPropertiesLoose(_ref, _excluded);
30
-
12
+ type = _ref$type === void 0 ? 'secondary' : _ref$type,
13
+ mode = _ref.mode,
14
+ _ref$justifyContent = _ref.justifyContent,
15
+ justifyContent = _ref$justifyContent === void 0 ? 'center' : _ref$justifyContent,
16
+ groupVariant = _ref.groupVariant,
17
+ _ref$loading = _ref.loading,
18
+ loading = _ref$loading === void 0 ? false : _ref$loading,
19
+ onClick = _ref.onClick,
20
+ className = _ref.className,
21
+ _ref$color = _ref.color,
22
+ color = _ref$color === void 0 ? 'red' : _ref$color,
23
+ error = _ref.error,
24
+ activated = _ref.activated,
25
+ antdProps = _objectWithoutPropertiesLoose(_ref, _excluded);
31
26
  var rippleRef = useRef(null);
32
-
33
27
  var _useState = useState(''),
34
- rippleClassName = _useState[0],
35
- setRippleClassName = _useState[1];
36
-
28
+ rippleClassName = _useState[0],
29
+ setRippleClassName = _useState[1];
37
30
  var _useState2 = useState(false),
38
- pressed = _useState2[0],
39
- setPressed = _useState2[1]; // @ts-expect-error TS7030: Not all code paths return a value
40
- // eslint-disable-next-line consistent-return
41
-
31
+ pressed = _useState2[0],
32
+ setPressed = _useState2[1];
42
33
 
34
+ // @ts-expect-error TS7030: Not all code paths return a value
35
+ // eslint-disable-next-line consistent-return
43
36
  useEffect(function () {
44
37
  if (rippleClassName !== '') {
45
38
  var rippleAnimation = setTimeout(function () {
@@ -50,24 +43,19 @@ var Button = function Button(_ref) {
50
43
  };
51
44
  }
52
45
  }, [rippleClassName]);
53
-
54
46
  var handleClick = function handleClick(event) {
55
47
  var button = event.currentTarget.closest('.ant-btn');
56
-
57
48
  if (button) {
58
49
  var buttonBoundingRect = button.getBoundingClientRect();
59
50
  var x = event.clientX - buttonBoundingRect.left;
60
51
  var y = event.clientY - buttonBoundingRect.top;
61
-
62
52
  if (rippleRef.current) {
63
53
  rippleRef.current.style.cssText = "top: " + y + "px; left: " + x + "px";
64
54
  }
65
-
66
55
  setRippleClassName('animate');
67
56
  onClick && onClick(event);
68
57
  }
69
58
  };
70
-
71
59
  var classNameString = useMemo(function () {
72
60
  var modeStringifed = mode || '';
73
61
  var readOnlyStringifed = antdProps.readOnly ? 'read-only' : '';
@@ -93,7 +81,6 @@ var Button = function Button(_ref) {
93
81
  className: classNameString,
94
82
  customColor: color
95
83
  /* eslint-disable-next-line react/jsx-props-no-spreading */
96
-
97
84
  }, antdProps), !antdProps.readOnly && /*#__PURE__*/React.createElement(S.RippleEffect, {
98
85
  ref: rippleRef,
99
86
  className: "btn-ripple " + rippleClassName
@@ -107,5 +94,4 @@ var Button = function Button(_ref) {
107
94
  className: "btn-focus"
108
95
  }));
109
96
  };
110
-
111
97
  export default Button;
@@ -1,9 +1,6 @@
1
1
  var _excluded = ["mode", "type", "loading", "justifyContent", "groupVariant", "customColor", "rightIconSize", "leftIconSize", "pressed", "size", "iconColor", "error", "activated"];
2
-
3
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
-
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
-
7
4
  import React from 'react';
8
5
  import styled, { css, keyframes } from 'styled-components';
9
6
  import Button from 'antd/lib/button';
@@ -21,11 +18,9 @@ var splitType = {
21
18
  secondary: 'secondary',
22
19
  tertiary: 'tertiary'
23
20
  };
24
-
25
21
  var pressedStyles = function pressedStyles(props) {
26
22
  return css(["color:", ";background:", ";svg{fill:", ";}&.ant-btn .btn-focus{box-shadow:inset 0 0 0 1px ", ";}> span:not(.btn-focus) + .ds-icon:before{background-color:", ";}"], props.theme.palette['blue-600'], props.theme.palette['blue-100'], props.theme.palette['blue-600'], props.theme.palette['blue-300'], props.theme.palette['blue-200']);
27
23
  };
28
-
29
24
  var spinnerAnimation = keyframes(["from{transform:rotateZ(0deg);}to{transform:rotateZ(360deg);}"]);
30
25
  var rippleAnimation = keyframes(["from{opacity:1;transform:scale(1);}to{opacity:0;transform:scale(20);}"]);
31
26
  export var Spinner = styled.div.withConfig({
@@ -39,24 +34,24 @@ export var RippleEffect = styled.span.withConfig({
39
34
  export var ButtonFocus = styled.div.withConfig({
40
35
  displayName: "Buttonstyles__ButtonFocus",
41
36
  componentId: "sc-3lgta1-2"
42
- })(["content:'';display:flex;position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;transition:box-shadow 0.3s ease;border-radius:inherit;z-index:99;box-shadow:inset 0 0 0 0 transparent;"]); // eslint-disable-next-line react/jsx-props-no-spreading
37
+ })(["content:'';display:flex;position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;transition:box-shadow 0.3s ease;border-radius:inherit;z-index:99;box-shadow:inset 0 0 0 0 transparent;"]);
43
38
 
39
+ // eslint-disable-next-line react/jsx-props-no-spreading
44
40
  export var AntdButton = styled(function (_ref) {
45
41
  var mode = _ref.mode,
46
- type = _ref.type,
47
- loading = _ref.loading,
48
- justifyContent = _ref.justifyContent,
49
- groupVariant = _ref.groupVariant,
50
- customColor = _ref.customColor,
51
- rightIconSize = _ref.rightIconSize,
52
- leftIconSize = _ref.leftIconSize,
53
- pressed = _ref.pressed,
54
- size = _ref.size,
55
- iconColor = _ref.iconColor,
56
- error = _ref.error,
57
- activated = _ref.activated,
58
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
59
-
42
+ type = _ref.type,
43
+ loading = _ref.loading,
44
+ justifyContent = _ref.justifyContent,
45
+ groupVariant = _ref.groupVariant,
46
+ customColor = _ref.customColor,
47
+ rightIconSize = _ref.rightIconSize,
48
+ leftIconSize = _ref.leftIconSize,
49
+ pressed = _ref.pressed,
50
+ size = _ref.size,
51
+ iconColor = _ref.iconColor,
52
+ error = _ref.error,
53
+ activated = _ref.activated,
54
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
60
55
  // eslint-disable-next-line react/jsx-props-no-spreading
61
56
  return /*#__PURE__*/React.createElement(Button, _extends({
62
57
  type: type === 'custom-color-ghost' ? 'ghost-primary' : type,
@@ -1,74 +1,56 @@
1
1
  var _excluded = ["checked", "defaultChecked", "hasError", "indeterminate", "onChange", "onClick"];
2
-
3
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
-
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
-
7
4
  import React from 'react';
8
5
  import Icon, { CheckboxIndeterminateM, CheckboxSelectedFillM } from '@synerise/ds-icon';
9
6
  import Button from '../Button';
10
7
  import * as S from './Checkbox.styles';
11
-
12
8
  var CheckboxButtonIcon = function CheckboxButtonIcon(_ref) {
13
9
  var checked = _ref.checked,
14
- indeterminate = _ref.indeterminate;
15
-
10
+ indeterminate = _ref.indeterminate;
16
11
  if (indeterminate) {
17
12
  return /*#__PURE__*/React.createElement(CheckboxIndeterminateM, null);
18
13
  }
19
-
20
14
  if (checked) {
21
15
  return /*#__PURE__*/React.createElement(CheckboxSelectedFillM, null);
22
16
  }
23
-
24
17
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.DefaultIcon, null), /*#__PURE__*/React.createElement(S.HoverIcon, null));
25
18
  };
26
-
27
19
  var getNextCheckedState = function getNextCheckedState(prevState, _ref2) {
28
20
  var checked = _ref2.checked,
29
- indeterminate = _ref2.indeterminate;
30
-
21
+ indeterminate = _ref2.indeterminate;
31
22
  if (indeterminate === true) {
32
23
  return true;
33
24
  }
34
-
35
25
  if (checked === undefined) {
36
26
  return !prevState;
37
27
  }
38
-
39
28
  return !checked;
40
29
  };
41
-
42
30
  var CheckboxButton = function CheckboxButton(props) {
43
31
  var checked = props.checked,
44
- _props$defaultChecked = props.defaultChecked,
45
- defaultChecked = _props$defaultChecked === void 0 ? false : _props$defaultChecked,
46
- hasError = props.hasError,
47
- indeterminate = props.indeterminate,
48
- onChange = props.onChange,
49
- onClick = props.onClick,
50
- restProps = _objectWithoutPropertiesLoose(props, _excluded);
51
-
32
+ _props$defaultChecked = props.defaultChecked,
33
+ defaultChecked = _props$defaultChecked === void 0 ? false : _props$defaultChecked,
34
+ hasError = props.hasError,
35
+ indeterminate = props.indeterminate,
36
+ onChange = props.onChange,
37
+ onClick = props.onClick,
38
+ restProps = _objectWithoutPropertiesLoose(props, _excluded);
52
39
  var _React$useState = React.useState(defaultChecked),
53
- isCheckedState = _React$useState[0],
54
- setIsCheckedState = _React$useState[1];
55
-
40
+ isCheckedState = _React$useState[0],
41
+ setIsCheckedState = _React$useState[1];
56
42
  var handleButtonClick = function handleButtonClick(e) {
57
43
  if (typeof onClick === 'function') {
58
44
  onClick(e);
59
45
  }
60
-
61
46
  setIsCheckedState(function (prevState) {
62
47
  var nextState = getNextCheckedState(prevState, props);
63
-
64
48
  if (typeof onChange === 'function') {
65
49
  onChange(nextState);
66
50
  }
67
-
68
51
  return nextState;
69
52
  });
70
53
  };
71
-
72
54
  var isChecked = checked !== undefined ? checked : isCheckedState;
73
55
  return /*#__PURE__*/React.createElement(Button, _extends({
74
56
  "aria-checked": indeterminate ? 'mixed' : isChecked,
@@ -90,5 +72,4 @@ var CheckboxButton = function CheckboxButton(props) {
90
72
  })
91
73
  })));
92
74
  };
93
-
94
75
  export default CheckboxButton;
@@ -5,13 +5,11 @@ export var IconWrapper = styled.span.withConfig({
5
5
  componentId: "ssgaoj-0"
6
6
  })(["&&&& svg{fill:", ";}.ant-btn-ghost[disabled] & .ds-icon svg{fill:", " !important;}.ant-btn-ghost:hover & .ds-icon svg,.ant-btn-ghost:focus:hover & .ds-icon svg{fill:", ";}.ds-button.ant-btn-ghost &::before{content:'';display:'block';position:absolute;bottom:0;left:0;right:0;top:0;margin:5px;z-index:-1;}.ds-button.ant-btn-ghost &::before,.ds-button.ant-btn-ghost:hover &::before,.ds-button.ant-btn-ghost:focus:hover &::before{background:", ";}.ds-button.ant-btn-ghost[disabled] &::before,.ds-button.ant-btn-ghost[disabled]:hover &::before{background:", ";}"], function (_ref) {
7
7
  var theme = _ref.theme,
8
- active = _ref.active,
9
- error = _ref.error;
10
-
8
+ active = _ref.active,
9
+ error = _ref.error;
11
10
  if (error) {
12
11
  return theme.palette['red-600'];
13
12
  }
14
-
15
13
  return active ? theme.palette['blue-600'] : theme.palette['grey-300'];
16
14
  }, function (_ref2) {
17
15
  var theme = _ref2.theme;
@@ -2,19 +2,16 @@ import React from 'react';
2
2
  import classnames from 'classnames';
3
3
  import Icon, { AddM } from '@synerise/ds-icon';
4
4
  import * as S from './Creator.styles';
5
-
6
5
  var Creator = function Creator(_ref) {
7
6
  var onClick = _ref.onClick,
8
- disabled = _ref.disabled,
9
- label = _ref.label,
10
- block = _ref.block,
11
- status = _ref.status,
12
- className = _ref.className;
13
-
7
+ disabled = _ref.disabled,
8
+ label = _ref.label,
9
+ block = _ref.block,
10
+ status = _ref.status,
11
+ className = _ref.className;
14
12
  var _React$useState = React.useState(false),
15
- pressed = _React$useState[0],
16
- setPressed = _React$useState[1];
17
-
13
+ pressed = _React$useState[0],
14
+ setPressed = _React$useState[1];
18
15
  var onPress = React.useCallback(function () {
19
16
  setPressed(true);
20
17
  }, []);
@@ -38,5 +35,4 @@ var Creator = function Creator(_ref) {
38
35
  "data-testid": "ds-add-button-label"
39
36
  }, label)));
40
37
  };
41
-
42
38
  export default Creator;
@@ -1,7 +1,5 @@
1
1
  var _excluded = ["status", "pressed", "withLabel"];
2
-
3
2
  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; }
4
-
5
3
  import React from 'react';
6
4
  import styled, { css } from 'styled-components';
7
5
  import { IconContainer } from '@synerise/ds-icon';
@@ -15,23 +13,19 @@ export var CreatorLabel = styled.span.withConfig({
15
13
  })(["&&{margin:0 12px 0 0;transition:all 0.3s ease;color:", ";}"], function (props) {
16
14
  return props.theme.palette['grey-500'];
17
15
  });
18
-
19
16
  var errorStyles = function errorStyles(_ref) {
20
17
  var theme = _ref.theme;
21
18
  return css(["border:1px dashed ", ";background:", ";&:focus{background:", ";}&:hover:not(:disabled):not(:focus){border:1px dashed ", ";background:", ";}"], theme.palette['red-600'], theme.palette['red-050'], theme.palette.white, theme.palette['grey-400'], theme.palette.white);
22
19
  };
23
-
24
20
  var uploadStyles = function uploadStyles(_ref2) {
25
21
  var theme = _ref2.theme;
26
22
  return css(["&{border:1px dashed ", ";background-color:", ";", "{svg{transition:all 0.3s ease;fill:", ";}}&:hover:not(:disabled){", "{svg{fill:", " !important;}}", "{color:", ";}}", "{color:", ";}&:hover:not(:disabled):not(:focus){border:1px dashed ", ";background-color:", ";}&:focus:active{border:1px dashed ", ";background-color:", ";box-shadow:none;}&:focus{border:1px dashed ", ";box-shadow:none;}&:disabled{", "{margin:12px;svg{transition:all 0.3s ease;color:", ";fill:", ";}}", "{color:", ";}}}"], theme.palette['blue-300'], theme.palette['blue-050'], IconContainer, theme.palette['blue-500'], IconContainer, theme.palette['blue-500'], CreatorLabel, theme.palette['blue-500'], CreatorLabel, theme.palette['blue-500'], theme.palette['blue-300'], theme.palette['blue-050'], theme.palette['blue-600'], theme.palette['blue-050'], theme.palette['blue-600'], IconContainer, theme.palette['grey-500'], theme.palette['grey-500'], CreatorLabel, theme.palette['grey-500']);
27
23
  };
28
-
29
24
  export var Creator = styled(function (_ref3) {
30
25
  var status = _ref3.status,
31
- pressed = _ref3.pressed,
32
- withLabel = _ref3.withLabel,
33
- rest = _objectWithoutPropertiesLoose(_ref3, _excluded);
34
-
26
+ pressed = _ref3.pressed,
27
+ withLabel = _ref3.withLabel,
28
+ rest = _objectWithoutPropertiesLoose(_ref3, _excluded);
35
29
  return /*#__PURE__*/React.createElement(Button, rest);
36
30
  }).withConfig({
37
31
  displayName: "Creatorstyles__Creator",
@@ -1,5 +1,4 @@
1
1
  export var CreatorStatus;
2
-
3
2
  (function (CreatorStatus) {
4
3
  CreatorStatus["Default"] = "default";
5
4
  CreatorStatus["Error"] = "error";
@@ -3,14 +3,13 @@ import classnames from 'classnames';
3
3
  import Icon, { AngleDownS } from '@synerise/ds-icon';
4
4
  import * as S from './Expander.styles';
5
5
  import { ExpanderSize } from './Expander.types';
6
-
7
6
  var Expander = function Expander(_ref) {
8
7
  var _ref$size = _ref.size,
9
- size = _ref$size === void 0 ? 'S' : _ref$size,
10
- expanded = _ref.expanded,
11
- disabled = _ref.disabled,
12
- onClick = _ref.onClick,
13
- className = _ref.className;
8
+ size = _ref$size === void 0 ? 'S' : _ref$size,
9
+ expanded = _ref.expanded,
10
+ disabled = _ref.disabled,
11
+ onClick = _ref.onClick,
12
+ className = _ref.className;
14
13
  return /*#__PURE__*/React.createElement(S.Expander, {
15
14
  onClick: onClick,
16
15
  size: ExpanderSize[size],
@@ -21,5 +20,4 @@ var Expander = function Expander(_ref) {
21
20
  component: /*#__PURE__*/React.createElement(AngleDownS, null)
22
21
  }));
23
22
  };
24
-
25
23
  export default Expander;
@@ -1,9 +1,6 @@
1
1
  var _excluded = ["children", "expanded", "size"];
2
-
3
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
-
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
-
7
4
  import styled, { keyframes, css } from 'styled-components';
8
5
  import React from 'react';
9
6
  import { IconContainer } from '@synerise/ds-icon';
@@ -15,10 +12,9 @@ export var focusAnimation = function focusAnimation(_ref) {
15
12
  var SIZE_DEFAULT = 24;
16
13
  export var Expander = styled(function (_ref2) {
17
14
  var children = _ref2.children,
18
- expanded = _ref2.expanded,
19
- size = _ref2.size,
20
- rest = _objectWithoutPropertiesLoose(_ref2, _excluded);
21
-
15
+ expanded = _ref2.expanded,
16
+ size = _ref2.size,
17
+ rest = _objectWithoutPropertiesLoose(_ref2, _excluded);
22
18
  return (
23
19
  /*#__PURE__*/
24
20
  // eslint-disable-next-line react/jsx-props-no-spreading
@@ -1,5 +1,4 @@
1
1
  export var ExpanderSize;
2
-
3
2
  (function (ExpanderSize) {
4
3
  ExpanderSize[ExpanderSize["S"] = 24] = "S";
5
4
  ExpanderSize[ExpanderSize["M"] = 32] = "M";
package/dist/Star/Star.js CHANGED
@@ -1,21 +1,16 @@
1
1
  var _excluded = ["hasError", "active", "type"];
2
-
3
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
-
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
-
7
4
  import React from 'react';
8
5
  import Icon, { StarM, StarFillM } from '@synerise/ds-icon';
9
6
  import Button from '../Button';
10
7
  import * as S from './Star.styles';
11
-
12
8
  var StarButton = function StarButton(props) {
13
9
  var hasError = props.hasError,
14
- active = props.active,
15
- _props$type = props.type,
16
- type = _props$type === void 0 ? 'ghost' : _props$type,
17
- restProps = _objectWithoutPropertiesLoose(props, _excluded);
18
-
10
+ active = props.active,
11
+ _props$type = props.type,
12
+ type = _props$type === void 0 ? 'ghost' : _props$type,
13
+ restProps = _objectWithoutPropertiesLoose(props, _excluded);
19
14
  return /*#__PURE__*/React.createElement(Button, _extends({
20
15
  "aria-pressed": !!active,
21
16
  mode: "single-icon",
@@ -32,5 +27,4 @@ var StarButton = function StarButton(props) {
32
27
  component: active ? /*#__PURE__*/React.createElement(StarFillM, null) : /*#__PURE__*/React.createElement(StarM, null)
33
28
  })));
34
29
  };
35
-
36
30
  export default StarButton;
@@ -4,13 +4,11 @@ export var IconWrapper = styled.span.withConfig({
4
4
  componentId: "k1qcv4-0"
5
5
  })(["&&&& svg{fill:", ";}.ant-btn-ghost[disabled] & .ds-icon svg{fill:", " !important;}.ant-btn-ghost:hover & .ds-icon svg,.ant-btn-ghost:focus:hover & .ds-icon svg{fill:", ";}.ant-btn-ghost &::before{clip-path:path( 'M 19.606 9.598 l -4.794 -0.686 l -2.141 -4.276 a 0.781 0.781 0 0 0 -1.342 0 L 9.187 8.912 l -4.793 0.686 a 0.75 0.75 0 0 0 -0.414 1.284 l 3.462 3.325 l -0.817 4.691 a 0.751 0.751 0 0 0 0.74 0.88 a 0.742 0.742 0 0 0 0.344 -0.085 L 12 17.472 l 4.29 2.221 a 0.75 0.75 0 0 0 1.084 -0.795 l -0.816 -4.691 l 3.462 -3.325 a 0.75 0.75 0 0 0 -0.414 -1.284 z z' );content:'';position:absolute;bottom:0;left:0;right:0;top:0;margin:0;z-index:-1;}.ant-btn-ghost[disabled] &:before{background:", ";}.ant-btn-ghost &::before,.ant-btn-ghost:hover &:before,.ant-btn-ghost:focus:hover &:before{background:", ";}"], function (_ref) {
6
6
  var theme = _ref.theme,
7
- active = _ref.active,
8
- error = _ref.error;
9
-
7
+ active = _ref.active,
8
+ error = _ref.error;
10
9
  if (error) {
11
10
  return theme.palette['red-600'];
12
11
  }
13
-
14
12
  return active ? theme.palette['yellow-600'] : theme.palette['grey-300'];
15
13
  }, function (_ref2) {
16
14
  var theme = _ref2.theme;
package/dist/index.js CHANGED
@@ -1,13 +1,8 @@
1
1
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
2
-
3
2
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
4
-
5
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
-
7
4
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
8
-
9
5
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
-
11
6
  import React from 'react';
12
7
  import MainButton from './Button';
13
8
  import CheckboxButton from './Checkbox/Checkbox';
@@ -19,31 +14,21 @@ import * as CheckboxStyles from './Checkbox/Checkbox.styles';
19
14
  import * as CreatorStyles from './Creator/Creator.styles';
20
15
  import * as ExpanderStyles from './Expander/Expander.styles';
21
16
  import * as StarStyles from './Star/Star.styles';
22
-
23
17
  var Button = /*#__PURE__*/function (_React$Component) {
24
18
  function Button() {
25
19
  return _React$Component.apply(this, arguments) || this;
26
20
  }
27
-
28
21
  _inheritsLoose(Button, _React$Component);
29
-
30
22
  var _proto = Button.prototype;
31
-
32
23
  _proto.render = function render() {
33
24
  return /*#__PURE__*/React.createElement(MainButton, this.props);
34
25
  };
35
-
36
26
  return Button;
37
27
  }(React.Component);
38
-
39
28
  _defineProperty(Button, "Checkbox", CheckboxButton);
40
-
41
29
  _defineProperty(Button, "Creator", Creator);
42
-
43
30
  _defineProperty(Button, "Expander", Expander);
44
-
45
31
  _defineProperty(Button, "Star", StarButton);
46
-
47
32
  export default Button;
48
33
  export { ExpanderSize } from './Expander/Expander.types';
49
34
  export { CreatorStatus } from './Creator/Creator.types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-button",
3
- "version": "0.21.19",
3
+ "version": "0.21.21",
4
4
  "description": "Button UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -34,7 +34,7 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-icon": "^0.67.0",
37
+ "@synerise/ds-icon": "^0.68.0",
38
38
  "@synerise/ds-utils": "^0.31.2",
39
39
  "classnames": "2.3.2",
40
40
  "csstype": "^2.6.9"
@@ -45,5 +45,5 @@
45
45
  "react": ">=16.9.0 <= 17.0.2",
46
46
  "styled-components": "5.0.1"
47
47
  },
48
- "gitHead": "05f083c767e2cec3c2f91c9475aee89852a77d6c"
48
+ "gitHead": "9ebd107163650754a5f55680d62d30812d740084"
49
49
  }