@synerise/ds-action-area 0.3.25 → 0.4.1
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 +22 -0
- package/README.md +5 -0
- package/dist/ActionArea.d.ts +12 -2
- package/dist/ActionArea.js +21 -4
- package/dist/ActionArea.styles.d.ts +7 -1
- package/dist/ActionArea.styles.js +27 -5
- package/dist/ActionArea.types.d.ts +8 -3
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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.4.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-action-area@0.4.0...@synerise/ds-action-area@0.4.1) (2024-06-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **action-area:** add background color on validation ([78b4ad8](https://github.com/Synerise/synerise-design/commit/78b4ad86719427b7e95a1b125600a02c76a3b2a8))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [0.4.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-action-area@0.3.25...@synerise/ds-action-area@0.4.0) (2024-05-29)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **action-area:** add validation state ([a358aba](https://github.com/Synerise/synerise-design/commit/a358abac7ecef64afd9579734eeb8f4cd8677304))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [0.3.25](https://github.com/Synerise/synerise-design/compare/@synerise/ds-action-area@0.3.24...@synerise/ds-action-area@0.3.25) (2024-05-16)
|
|
7
29
|
|
|
8
30
|
**Note:** Version bump only for package @synerise/ds-action-area
|
package/README.md
CHANGED
|
@@ -33,4 +33,9 @@ import ActionArea from '@synerise/ds-action-area'
|
|
|
33
33
|
| description | Description of ActionArea | `React.ReactNode` | - |
|
|
34
34
|
| label | Label of ActionArea | `React.ReactNode` | - |
|
|
35
35
|
| buttonProps | optional additional button props | see ds-button | - |
|
|
36
|
+
| isFullWidth | Set component width to 100% available space | `boolean` | false |
|
|
37
|
+
| isError | Set component state to invalid | `boolean` | false |
|
|
38
|
+
| errorText | Text to display when is invalid state | `React.ReactNode` | - |
|
|
39
|
+
| className | custom class name | `string` | - |
|
|
40
|
+
| style | custom CSS style | `React.CSSProperties` | - |
|
|
36
41
|
|
package/dist/ActionArea.d.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ActionAreaProps } from './ActionArea.types';
|
|
3
|
+
declare const ActionArea: {
|
|
4
|
+
({ label, description, action, actionLabel, buttonProps, isFullWidth, isError, errorText, className, style, }: ActionAreaProps): React.JSX.Element;
|
|
5
|
+
ActionAreaWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
6
|
+
isFullWidth?: boolean | undefined;
|
|
7
|
+
}, never>;
|
|
8
|
+
ActionAreaContent: import("styled-components").StyledComponent<"div", any, {
|
|
9
|
+
isError?: boolean | undefined;
|
|
10
|
+
}, never>;
|
|
11
|
+
ErrorText: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
|
+
};
|
|
3
13
|
export default ActionArea;
|
package/dist/ActionArea.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import classnames from 'classnames';
|
|
4
5
|
import Button from '@synerise/ds-button';
|
|
5
6
|
import { Title, Description } from '@synerise/ds-typography';
|
|
6
7
|
import * as S from './ActionArea.styles';
|
|
@@ -10,15 +11,31 @@ var ActionArea = function ActionArea(_ref) {
|
|
|
10
11
|
description = _ref.description,
|
|
11
12
|
action = _ref.action,
|
|
12
13
|
actionLabel = _ref.actionLabel,
|
|
13
|
-
buttonProps = _ref.buttonProps
|
|
14
|
+
buttonProps = _ref.buttonProps,
|
|
15
|
+
_ref$isFullWidth = _ref.isFullWidth,
|
|
16
|
+
isFullWidth = _ref$isFullWidth === void 0 ? false : _ref$isFullWidth,
|
|
17
|
+
_ref$isError = _ref.isError,
|
|
18
|
+
isError = _ref$isError === void 0 ? false : _ref$isError,
|
|
19
|
+
errorText = _ref.errorText,
|
|
20
|
+
className = _ref.className,
|
|
21
|
+
style = _ref.style;
|
|
22
|
+
var isErrorText = isError && Boolean(errorText);
|
|
14
23
|
return /*#__PURE__*/React.createElement(S.ActionAreaWrapper, {
|
|
15
|
-
|
|
24
|
+
style: style,
|
|
25
|
+
className: classnames('ds-action-area', className),
|
|
26
|
+
isFullWidth: isFullWidth
|
|
27
|
+
}, /*#__PURE__*/React.createElement(S.ActionAreaContent, {
|
|
28
|
+
isError: isError,
|
|
29
|
+
"data-testid": "action-area-content"
|
|
16
30
|
}, label && /*#__PURE__*/React.createElement(Title, {
|
|
17
31
|
level: 6
|
|
18
32
|
}, label), /*#__PURE__*/React.createElement(Description, null, description), /*#__PURE__*/React.createElement(Button, _extends({
|
|
19
33
|
type: "primary",
|
|
20
34
|
onClick: action
|
|
21
|
-
}, buttonProps), actionLabel));
|
|
35
|
+
}, buttonProps), actionLabel)), isErrorText && /*#__PURE__*/React.createElement(S.ErrorText, null, errorText));
|
|
22
36
|
};
|
|
23
37
|
|
|
38
|
+
ActionArea.ActionAreaWrapper = S.ActionAreaWrapper;
|
|
39
|
+
ActionArea.ActionAreaContent = S.ActionAreaContent;
|
|
40
|
+
ActionArea.ErrorText = S.ErrorText;
|
|
24
41
|
export default ActionArea;
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
export declare const ActionAreaWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
1
|
+
export declare const ActionAreaWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
isFullWidth?: boolean | undefined;
|
|
3
|
+
}, never>;
|
|
4
|
+
export declare const ActionAreaContent: import("styled-components").StyledComponent<"div", any, {
|
|
5
|
+
isError?: boolean | undefined;
|
|
6
|
+
}, never>;
|
|
7
|
+
export declare const ErrorText: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,9 +1,31 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { Description } from '@synerise/ds-typography';
|
|
3
|
-
|
|
2
|
+
import { Description } from '@synerise/ds-typography';
|
|
4
3
|
export var ActionAreaWrapper = styled.div.withConfig({
|
|
5
4
|
displayName: "ActionAreastyles__ActionAreaWrapper",
|
|
6
5
|
componentId: "sc-10ey0kr-0"
|
|
7
|
-
})(["max-width:100%;width:
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
})(["max-width:100%;width:", ";"], function (_ref) {
|
|
7
|
+
var isFullWidth = _ref.isFullWidth;
|
|
8
|
+
return isFullWidth ? '100%;' : '588px;';
|
|
9
|
+
});
|
|
10
|
+
export var ActionAreaContent = styled.div.withConfig({
|
|
11
|
+
displayName: "ActionAreastyles__ActionAreaContent",
|
|
12
|
+
componentId: "sc-10ey0kr-1"
|
|
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
|
+
var isError = _ref2.isError,
|
|
15
|
+
theme = _ref2.theme;
|
|
16
|
+
return isError ? theme.palette['red-050'] : 'none';
|
|
17
|
+
}, function (_ref3) {
|
|
18
|
+
var theme = _ref3.theme;
|
|
19
|
+
return theme.palette['grey-300'];
|
|
20
|
+
}, function (_ref4) {
|
|
21
|
+
var isError = _ref4.isError,
|
|
22
|
+
theme = _ref4.theme;
|
|
23
|
+
return isError && "border-color: " + theme.palette['red-600'] + ";";
|
|
24
|
+
}, Description);
|
|
25
|
+
export var ErrorText = styled.div.withConfig({
|
|
26
|
+
displayName: "ActionAreastyles__ErrorText",
|
|
27
|
+
componentId: "sc-10ey0kr-2"
|
|
28
|
+
})(["margin-top:8px;color:", ";"], function (_ref5) {
|
|
29
|
+
var theme = _ref5.theme;
|
|
30
|
+
return theme.palette['red-600'];
|
|
31
|
+
});
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { ButtonProps } from '@synerise/ds-button';
|
|
3
3
|
export type ActionAreaProps = {
|
|
4
|
-
label?: ReactNode;
|
|
5
|
-
description: ReactNode;
|
|
6
4
|
action: () => void;
|
|
7
5
|
actionLabel: ReactNode;
|
|
8
6
|
buttonProps?: Partial<ButtonProps>;
|
|
7
|
+
className?: string;
|
|
8
|
+
description: ReactNode;
|
|
9
|
+
errorText?: ReactNode;
|
|
10
|
+
isError?: boolean;
|
|
11
|
+
isFullWidth?: boolean;
|
|
12
|
+
label?: ReactNode;
|
|
13
|
+
style?: CSSProperties;
|
|
9
14
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-action-area",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "ActionArea UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -33,8 +33,9 @@
|
|
|
33
33
|
],
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@synerise/ds-button": "^0.
|
|
37
|
-
"@synerise/ds-typography": "^0.15.0"
|
|
36
|
+
"@synerise/ds-button": "^0.21.0",
|
|
37
|
+
"@synerise/ds-typography": "^0.15.0",
|
|
38
|
+
"classnames": "2.3.2"
|
|
38
39
|
},
|
|
39
40
|
"peerDependencies": {
|
|
40
41
|
"@synerise/ds-core": "*",
|
|
@@ -42,9 +43,9 @@
|
|
|
42
43
|
"styled-components": "5.0.1"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
|
-
"@synerise/ds-utils": "^0.
|
|
46
|
+
"@synerise/ds-utils": "^0.27.0",
|
|
46
47
|
"@testing-library/jest-dom": "5.1.1",
|
|
47
48
|
"@testing-library/react": "10.0.1"
|
|
48
49
|
},
|
|
49
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "ef835e848d4f02cca258130baa6c9f44dfa15dd0"
|
|
50
51
|
}
|