@synerise/ds-action-area 1.0.46 → 1.0.48
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 +8 -0
- package/dist/ActionArea.d.ts +5 -5
- package/dist/ActionArea.figma.d.ts +1 -0
- package/dist/ActionArea.figma.js +49 -0
- package/dist/ActionArea.js +31 -34
- package/dist/ActionArea.styles.d.ts +4 -4
- package/dist/ActionArea.styles.js +27 -26
- package/dist/ActionArea.types.d.ts +2 -2
- package/dist/ActionArea.types.js +1 -1
- package/dist/ActionArea.utils.d.ts +2 -2
- package/dist/ActionArea.utils.js +18 -15
- package/dist/index.js +4 -1
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/package.json +8 -8
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
|
+
## [1.0.48](https://github.com/Synerise/synerise-design/compare/@synerise/ds-action-area@1.0.47...@synerise/ds-action-area@1.0.48) (2026-03-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-action-area
|
|
9
|
+
|
|
10
|
+
## [1.0.47](https://github.com/Synerise/synerise-design/compare/@synerise/ds-action-area@1.0.46...@synerise/ds-action-area@1.0.47) (2026-03-20)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @synerise/ds-action-area
|
|
13
|
+
|
|
6
14
|
## [1.0.46](https://github.com/Synerise/synerise-design/compare/@synerise/ds-action-area@1.0.45...@synerise/ds-action-area@1.0.46) (2026-03-09)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-action-area
|
package/dist/ActionArea.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ActionAreaProps } from './ActionArea.types';
|
|
3
3
|
declare const ActionArea: {
|
|
4
4
|
({ label, description, isFullWidth, isError, errorText, className, style, ...rest }: ActionAreaProps): React.JSX.Element;
|
|
5
|
-
ActionAreaWrapper: import(
|
|
5
|
+
ActionAreaWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
6
6
|
isFullWidth?: boolean;
|
|
7
7
|
}, never>;
|
|
8
|
-
ActionAreaContent: import(
|
|
8
|
+
ActionAreaContent: import('styled-components').StyledComponent<"div", any, {
|
|
9
9
|
isError?: boolean;
|
|
10
10
|
}, never>;
|
|
11
|
-
ErrorText: import(
|
|
11
|
+
ErrorText: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
12
12
|
};
|
|
13
13
|
export default ActionArea;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import figma from "@figma/code-connect";
|
|
3
|
+
import ActionArea from "./ActionArea.js";
|
|
4
|
+
const FIGMA_URL = "https://www.figma.com/design/fsSZONXpVvtrDsCgtu01Jb/Synerise-Design-System?node-id=1302:19040&m=dev";
|
|
5
|
+
const baseProps = {
|
|
6
|
+
label: figma.boolean("Show Header", {
|
|
7
|
+
true: figma.string("✏️Header Text"),
|
|
8
|
+
false: void 0
|
|
9
|
+
}),
|
|
10
|
+
description: figma.boolean("Show description", {
|
|
11
|
+
true: figma.string("✏️Description Text"),
|
|
12
|
+
false: void 0
|
|
13
|
+
})
|
|
14
|
+
};
|
|
15
|
+
figma.connect(ActionArea, FIGMA_URL, {
|
|
16
|
+
variant: {
|
|
17
|
+
State: "Default"
|
|
18
|
+
},
|
|
19
|
+
props: baseProps,
|
|
20
|
+
example: ({
|
|
21
|
+
label,
|
|
22
|
+
description
|
|
23
|
+
}) => /* @__PURE__ */ jsx(ActionArea, { label, description, action: () => {
|
|
24
|
+
}, actionLabel: "Select template" })
|
|
25
|
+
});
|
|
26
|
+
figma.connect(ActionArea, FIGMA_URL, {
|
|
27
|
+
variant: {
|
|
28
|
+
State: "Disabled"
|
|
29
|
+
},
|
|
30
|
+
props: baseProps,
|
|
31
|
+
example: ({
|
|
32
|
+
label,
|
|
33
|
+
description
|
|
34
|
+
}) => /* @__PURE__ */ jsx(ActionArea, { label, description, action: () => {
|
|
35
|
+
}, actionLabel: "Select template", buttonProps: {
|
|
36
|
+
disabled: true
|
|
37
|
+
} })
|
|
38
|
+
});
|
|
39
|
+
figma.connect(ActionArea, FIGMA_URL, {
|
|
40
|
+
variant: {
|
|
41
|
+
State: "Error"
|
|
42
|
+
},
|
|
43
|
+
props: baseProps,
|
|
44
|
+
example: ({
|
|
45
|
+
label,
|
|
46
|
+
description
|
|
47
|
+
}) => /* @__PURE__ */ jsx(ActionArea, { label, description, action: () => {
|
|
48
|
+
}, actionLabel: "Select template", isError: true, errorText: "Error message" })
|
|
49
|
+
});
|
package/dist/ActionArea.js
CHANGED
|
@@ -1,35 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import classnames from "classnames";
|
|
3
|
+
import { Title, Description } from "@synerise/ds-typography";
|
|
4
|
+
import { ActionAreaWrapper, ActionAreaContent, ActionAreaAction, ErrorText } from "./ActionArea.styles.js";
|
|
5
|
+
import { renderAction } from "./ActionArea.utils.js";
|
|
6
|
+
const ActionArea = ({
|
|
7
|
+
label,
|
|
8
|
+
description,
|
|
9
|
+
isFullWidth = false,
|
|
10
|
+
isError = false,
|
|
11
|
+
errorText,
|
|
12
|
+
className,
|
|
13
|
+
style,
|
|
14
|
+
...rest
|
|
15
|
+
}) => {
|
|
16
|
+
const isErrorText = isError && Boolean(errorText);
|
|
17
|
+
const actionContent = renderAction(rest);
|
|
18
|
+
return /* @__PURE__ */ jsxs(ActionAreaWrapper, { style, className: classnames("ds-action-area", className), isFullWidth, children: [
|
|
19
|
+
/* @__PURE__ */ jsxs(ActionAreaContent, { isError, "data-testid": "action-area-content", children: [
|
|
20
|
+
label && /* @__PURE__ */ jsx(Title, { level: 6, children: label }),
|
|
21
|
+
/* @__PURE__ */ jsx(Description, { children: description }),
|
|
22
|
+
/* @__PURE__ */ jsx(ActionAreaAction, { children: actionContent })
|
|
23
|
+
] }),
|
|
24
|
+
isErrorText && /* @__PURE__ */ jsx(ErrorText, { children: errorText })
|
|
25
|
+
] });
|
|
26
|
+
};
|
|
27
|
+
ActionArea.ActionAreaWrapper = ActionAreaWrapper;
|
|
28
|
+
ActionArea.ActionAreaContent = ActionAreaContent;
|
|
29
|
+
ActionArea.ErrorText = ErrorText;
|
|
30
|
+
export {
|
|
31
|
+
ActionArea as default
|
|
31
32
|
};
|
|
32
|
-
ActionArea.ActionAreaWrapper = S.ActionAreaWrapper;
|
|
33
|
-
ActionArea.ActionAreaContent = S.ActionAreaContent;
|
|
34
|
-
ActionArea.ErrorText = S.ErrorText;
|
|
35
|
-
export default ActionArea;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare const ActionAreaWrapper: import(
|
|
1
|
+
export declare const ActionAreaWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
2
2
|
isFullWidth?: boolean;
|
|
3
3
|
}, never>;
|
|
4
|
-
export declare const ActionAreaContent: import(
|
|
4
|
+
export declare const ActionAreaContent: import('styled-components').StyledComponent<"div", any, {
|
|
5
5
|
isError?: boolean;
|
|
6
6
|
}, never>;
|
|
7
|
-
export declare const ActionAreaAction: import(
|
|
8
|
-
export declare const ErrorText: import(
|
|
7
|
+
export declare const ActionAreaAction: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
8
|
+
export declare const ErrorText: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import { Description } from
|
|
3
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { Description } from "@synerise/ds-typography";
|
|
3
|
+
const ActionAreaWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
4
4
|
displayName: "ActionAreastyles__ActionAreaWrapper",
|
|
5
5
|
componentId: "sc-10ey0kr-0"
|
|
6
|
-
})(["max-width:100%;width:", ";"],
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export var ActionAreaContent = styled.div.withConfig({
|
|
6
|
+
})(["max-width:100%;width:", ";"], ({
|
|
7
|
+
isFullWidth
|
|
8
|
+
}) => isFullWidth ? "100%;" : "588px;");
|
|
9
|
+
const ActionAreaContent = /* @__PURE__ */ styled.div.withConfig({
|
|
11
10
|
displayName: "ActionAreastyles__ActionAreaContent",
|
|
12
11
|
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;}", "{text-align:center;margin-bottom:16px;word-break:break-word;}"],
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return isError && "border-color: " + theme.palette['red-600'] + ";";
|
|
24
|
-
}, Description);
|
|
25
|
-
export var ActionAreaAction = styled.div.withConfig({
|
|
12
|
+
})(["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;}", "{text-align:center;margin-bottom:16px;word-break:break-word;}"], ({
|
|
13
|
+
isError,
|
|
14
|
+
theme
|
|
15
|
+
}) => isError ? theme.palette["red-050"] : "none", ({
|
|
16
|
+
theme
|
|
17
|
+
}) => theme.palette["grey-300"], ({
|
|
18
|
+
isError,
|
|
19
|
+
theme
|
|
20
|
+
}) => isError && `border-color: ${theme.palette["red-600"]};`, Description);
|
|
21
|
+
const ActionAreaAction = /* @__PURE__ */ styled.div.withConfig({
|
|
26
22
|
displayName: "ActionAreastyles__ActionAreaAction",
|
|
27
23
|
componentId: "sc-10ey0kr-2"
|
|
28
24
|
})([""]);
|
|
29
|
-
|
|
25
|
+
const ErrorText = /* @__PURE__ */ styled.div.withConfig({
|
|
30
26
|
displayName: "ActionAreastyles__ErrorText",
|
|
31
27
|
componentId: "sc-10ey0kr-3"
|
|
32
|
-
})(["margin-top:8px;color:", ";"],
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
})(["margin-top:8px;color:", ";"], ({
|
|
29
|
+
theme
|
|
30
|
+
}) => theme.palette["red-600"]);
|
|
31
|
+
export {
|
|
32
|
+
ActionAreaAction,
|
|
33
|
+
ActionAreaContent,
|
|
34
|
+
ActionAreaWrapper,
|
|
35
|
+
ErrorText
|
|
36
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from '@synerise/ds-button';
|
|
3
3
|
type CommonProps = {
|
|
4
4
|
className?: string;
|
|
5
5
|
description: ReactNode;
|
package/dist/ActionArea.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ActionAreaWithCustomActionProps, ActionAreaWithStandardActionProps } from './ActionArea.types';
|
|
3
3
|
export declare const renderAction: (props: ActionAreaWithCustomActionProps | ActionAreaWithStandardActionProps) => ReactNode;
|
package/dist/ActionArea.utils.js
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return 'customAction' in props;
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import Button from "@synerise/ds-button";
|
|
3
|
+
const isCustomActionArea = (props) => {
|
|
4
|
+
return "customAction" in props;
|
|
6
5
|
};
|
|
7
|
-
|
|
6
|
+
const renderAction = (props) => {
|
|
8
7
|
if (isCustomActionArea(props)) {
|
|
9
|
-
|
|
8
|
+
const {
|
|
9
|
+
customAction
|
|
10
|
+
} = props;
|
|
10
11
|
return customAction;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
const {
|
|
14
|
+
action,
|
|
15
|
+
actionLabel,
|
|
16
|
+
buttonProps
|
|
17
|
+
} = props;
|
|
18
|
+
return /* @__PURE__ */ jsx(Button, { type: "primary", onClick: action, ...buttonProps, children: actionLabel });
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
renderAction
|
|
22
|
+
};
|
package/dist/index.js
CHANGED
package/dist/modules.d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-action-area",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.48",
|
|
4
4
|
"description": "ActionArea UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
19
|
+
"build": "vite build",
|
|
20
20
|
"build:css": "node ../../../scripts/style/less.js",
|
|
21
21
|
"build:js": "babel --delete-dir-on-start --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
|
|
22
|
-
"build:watch": "
|
|
22
|
+
"build:watch": "vite build --watch",
|
|
23
23
|
"defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
|
|
24
24
|
"pack:ci": "pnpm pack --pack-destination ../../storybook/storybook-static/static",
|
|
25
25
|
"prepublish": "pnpm run build",
|
|
26
|
-
"test": "vitest",
|
|
27
|
-
"test:watch": "
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test:watch": "vitest",
|
|
28
28
|
"types": "tsc --noEmit",
|
|
29
29
|
"check:circular-dependencies": "madge --circular --extensions ts,tsx,js,jsx --ts-config tsconfig.json src/ --exclude '/dist/'",
|
|
30
30
|
"upgrade:ds": "ncu -f \"@synerise/ds-*\" -u"
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
],
|
|
36
36
|
"types": "dist/index.d.ts",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@synerise/ds-button": "^1.5.
|
|
39
|
-
"@synerise/ds-typography": "^1.1.
|
|
38
|
+
"@synerise/ds-button": "^1.5.18",
|
|
39
|
+
"@synerise/ds-typography": "^1.1.13",
|
|
40
40
|
"classnames": "^2.5.1"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"styled-components": "^5.3.3",
|
|
46
46
|
"vitest": "4"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
|
|
49
49
|
}
|