@synerise/ds-action-area 0.5.19 → 0.5.20

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,14 @@
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.5.20](https://github.com/Synerise/synerise-design/compare/@synerise/ds-action-area@0.5.19...@synerise/ds-action-area@0.5.20) (2024-11-28)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-action-area
9
+
10
+
11
+
12
+
13
+
6
14
  ## [0.5.19](https://github.com/Synerise/synerise-design/compare/@synerise/ds-action-area@0.5.18...@synerise/ds-action-area@0.5.19) (2024-11-21)
7
15
 
8
16
  **Note:** Version bump only for package @synerise/ds-action-area
@@ -1,25 +1,21 @@
1
1
  var _excluded = ["label", "description", "isFullWidth", "isError", "errorText", "className", "style"];
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 classnames from 'classnames';
7
5
  import { Title, Description } from '@synerise/ds-typography';
8
6
  import * as S from './ActionArea.styles';
9
7
  import { renderAction } from './ActionArea.utils';
10
-
11
8
  var ActionArea = function ActionArea(_ref) {
12
9
  var label = _ref.label,
13
- description = _ref.description,
14
- _ref$isFullWidth = _ref.isFullWidth,
15
- isFullWidth = _ref$isFullWidth === void 0 ? false : _ref$isFullWidth,
16
- _ref$isError = _ref.isError,
17
- isError = _ref$isError === void 0 ? false : _ref$isError,
18
- errorText = _ref.errorText,
19
- className = _ref.className,
20
- style = _ref.style,
21
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
22
-
10
+ description = _ref.description,
11
+ _ref$isFullWidth = _ref.isFullWidth,
12
+ isFullWidth = _ref$isFullWidth === void 0 ? false : _ref$isFullWidth,
13
+ _ref$isError = _ref.isError,
14
+ isError = _ref$isError === void 0 ? false : _ref$isError,
15
+ errorText = _ref.errorText,
16
+ className = _ref.className,
17
+ style = _ref.style,
18
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
23
19
  var isErrorText = isError && Boolean(errorText);
24
20
  var actionContent = renderAction(rest);
25
21
  return /*#__PURE__*/React.createElement(S.ActionAreaWrapper, {
@@ -33,7 +29,6 @@ var ActionArea = function ActionArea(_ref) {
33
29
  level: 6
34
30
  }, label), /*#__PURE__*/React.createElement(Description, null, description), /*#__PURE__*/React.createElement(S.ActionAreaAction, null, actionContent)), isErrorText && /*#__PURE__*/React.createElement(S.ErrorText, null, errorText));
35
31
  };
36
-
37
32
  ActionArea.ActionAreaWrapper = S.ActionAreaWrapper;
38
33
  ActionArea.ActionAreaContent = S.ActionAreaContent;
39
34
  ActionArea.ErrorText = S.ErrorText;
@@ -12,14 +12,14 @@ export var ActionAreaContent = styled.div.withConfig({
12
12
  componentId: "sc-10ey0kr-1"
13
13
  })(["width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:28px 24px;border-radius:3px;background-color:", ";border:1px dashed ", ";", " .ds-title{margin-bottom:8px;text-align:center;word-break:break-word;}", "{margin-bottom:16px;text-align:center;word-break:break-word;}"], function (_ref2) {
14
14
  var isError = _ref2.isError,
15
- theme = _ref2.theme;
15
+ theme = _ref2.theme;
16
16
  return isError ? theme.palette['red-050'] : 'none';
17
17
  }, function (_ref3) {
18
18
  var theme = _ref3.theme;
19
19
  return theme.palette['grey-300'];
20
20
  }, function (_ref4) {
21
21
  var isError = _ref4.isError,
22
- theme = _ref4.theme;
22
+ theme = _ref4.theme;
23
23
  return isError && "border-color: " + theme.palette['red-600'] + ";";
24
24
  }, Description);
25
25
  export var ActionAreaAction = styled.div.withConfig({
@@ -1,21 +1,17 @@
1
1
  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); }
2
-
3
2
  import React from 'react';
4
3
  import Button from '@synerise/ds-button';
5
-
6
4
  var isCustomActionArea = function isCustomActionArea(props) {
7
5
  return 'customAction' in props;
8
6
  };
9
-
10
7
  export var renderAction = function renderAction(props) {
11
8
  if (isCustomActionArea(props)) {
12
9
  var customAction = props.customAction;
13
10
  return customAction;
14
11
  }
15
-
16
12
  var action = props.action,
17
- actionLabel = props.actionLabel,
18
- buttonProps = props.buttonProps;
13
+ actionLabel = props.actionLabel,
14
+ buttonProps = props.buttonProps;
19
15
  return /*#__PURE__*/React.createElement(Button, _extends({
20
16
  type: "primary",
21
17
  onClick: action
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-action-area",
3
- "version": "0.5.19",
3
+ "version": "0.5.20",
4
4
  "description": "ActionArea UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -34,8 +34,8 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-button": "^0.21.19",
38
- "@synerise/ds-typography": "^0.16.6",
37
+ "@synerise/ds-button": "^0.21.20",
38
+ "@synerise/ds-typography": "^0.16.7",
39
39
  "@synerise/ds-utils": "^0.31.2",
40
40
  "classnames": "2.3.2"
41
41
  },
@@ -44,5 +44,5 @@
44
44
  "react": ">=16.9.0 <= 17.0.2",
45
45
  "styled-components": "5.0.1"
46
46
  },
47
- "gitHead": "05f083c767e2cec3c2f91c9475aee89852a77d6c"
47
+ "gitHead": "4a56ee7ef816c22341ce704154dc7aa65b7d1dcc"
48
48
  }