@synerise/ds-confirmation 1.2.25 → 1.3.0

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,12 @@
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.3.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-confirmation@1.2.25...@synerise/ds-confirmation@1.3.0) (2026-05-22)
7
+
8
+ ### Features
9
+
10
+ - **modal:** migration from antd ([3588b65](https://github.com/Synerise/synerise-design/commit/3588b65fbe67838fed4ee5125090ad47d334e04b))
11
+
6
12
  ## [1.2.25](https://github.com/Synerise/synerise-design/compare/@synerise/ds-confirmation@1.2.24...@synerise/ds-confirmation@1.2.25) (2026-05-15)
7
13
 
8
14
  **Note:** Version bump only for package @synerise/ds-confirmation
@@ -67,9 +67,7 @@ const Confirmation = ({
67
67
  /* @__PURE__ */ jsx(Icon, { onClick: () => setMode("default"), component: /* @__PURE__ */ jsx(ArrowLeftM, {}) }),
68
68
  allTexts.relatedObjectsTitle
69
69
  ] }) : void 0;
70
- return /* @__PURE__ */ jsx(Modal, { ...modalProps, onCancel, size: "small", blank: mode === "default", footer: modalFooter, bodyStyle: {
71
- padding: 0
72
- }, title: modalTitle, children: modalContent });
70
+ return /* @__PURE__ */ jsx(Modal, { ...modalProps, onCancel, size: "small", centered: true, blank: mode === "default", footer: modalFooter, bodyFullWidth: true, title: modalTitle, children: modalContent });
73
71
  };
74
72
  export {
75
73
  Confirmation as default
@@ -23,7 +23,7 @@ const Title = /* @__PURE__ */ styled(Title$1).withConfig({
23
23
  const FooterRight = /* @__PURE__ */ styled.div.withConfig({
24
24
  displayName: "Confirmationstyles__FooterRight",
25
25
  componentId: "sc-17izghl-4"
26
- })(["flex:1 1 auto;"]);
26
+ })(["flex:1 1 auto;display:flex;gap:8px;justify-content:end;"]);
27
27
  const FooterLeft = /* @__PURE__ */ styled.div.withConfig({
28
28
  displayName: "Confirmationstyles__FooterLeft",
29
29
  componentId: "sc-17izghl-5"
@@ -31,7 +31,7 @@ const FooterLeft = /* @__PURE__ */ styled.div.withConfig({
31
31
  const Footer = /* @__PURE__ */ styled.div.withConfig({
32
32
  displayName: "Confirmationstyles__Footer",
33
33
  componentId: "sc-17izghl-6"
34
- })(["display:flex;justify-content:space-between;"]);
34
+ })(["display:flex;flex:0 0 100%;justify-content:space-between;"]);
35
35
  const ConfirmationExtra = /* @__PURE__ */ styled.div.withConfig({
36
36
  displayName: "Confirmationstyles__ConfirmationExtra",
37
37
  componentId: "sc-17izghl-7"
@@ -4,6 +4,9 @@ import { ListItemProps } from '@synerise/ds-list-item';
4
4
  import { ModalProps } from '@synerise/ds-modal';
5
5
  import { RadioProps } from '@synerise/ds-radio';
6
6
  import { DataAttributes } from '@synerise/ds-utils';
7
+ export type ConfirmationHandle = {
8
+ destroy: () => void;
9
+ };
7
10
  export type ConfirmationType = 'success' | 'warning' | 'negative' | 'informative';
8
11
  export type ConfirmationButtonProps = Pick<ButtonProps, 'mode' | 'loading' | 'readOnly' | 'disabled' | 'tagProps'> & DataAttributes;
9
12
  export type ConfirmationTexts = {
@@ -28,7 +31,7 @@ export type DecisionSectionProps = {
28
31
  title: ReactNode;
29
32
  };
30
33
  export type DisplayMode = 'default' | 'related-objects';
31
- type SharedProps = Pick<ModalProps, 'open' | 'title' | 'zIndex' | 'onCancel' | 'onOk'> & {
34
+ type SharedProps = Pick<ModalProps, 'open' | 'title' | 'zIndex' | 'onCancel' | 'onOk' | 'afterClose'> & {
32
35
  title: ReactNode;
33
36
  texts?: Partial<ConfirmationTexts>;
34
37
  /**
@@ -0,0 +1,3 @@
1
+ import { ListItemProps } from '@synerise/ds-list-item';
2
+ import { ConfirmationHandle, ConfirmationProps } from './Confirmation.types';
3
+ export declare const showConfirmation: <ItemType extends ListItemProps>({ afterClose, onOk, onCancel, ...props }: ConfirmationProps<ItemType>) => ConfirmationHandle;
@@ -0,0 +1,31 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { setPortalContent } from "@synerise/ds-core";
3
+ import Confirmation from "./Confirmation.js";
4
+ let instanceId = 0;
5
+ const showConfirmation = ({
6
+ afterClose,
7
+ onOk,
8
+ onCancel,
9
+ ...props
10
+ }) => {
11
+ const cleanup = () => {
12
+ setPortalContent(null);
13
+ };
14
+ const handleOk = (event) => {
15
+ Promise.resolve(onOk?.(event)).then(cleanup);
16
+ };
17
+ const handleCancel = (event) => {
18
+ Promise.resolve(onCancel?.(event)).then(cleanup);
19
+ };
20
+ instanceId += 1;
21
+ setPortalContent(/* @__PURE__ */ jsx(Confirmation, { ...props, open: true, onOk: handleOk, onCancel: handleCancel, afterClose: () => {
22
+ afterClose?.();
23
+ cleanup();
24
+ } }, `confirmation-${instanceId}`));
25
+ return {
26
+ destroy: cleanup
27
+ };
28
+ };
29
+ export {
30
+ showConfirmation
31
+ };
@@ -23,9 +23,7 @@ const Prompt = ({
23
23
  /* @__PURE__ */ jsx(Button, { type: "custom-color", onClick: onOk, color: buttonColor, ...mainButtonProps, children: allTexts.mainButtonLabel })
24
24
  ] }) });
25
25
  }, [buttonColor, onCancel, onOk, mainButtonProps, allTexts.mainButtonLabel, allTexts.secondaryButtonLabel, secondaryButtonProps]);
26
- return /* @__PURE__ */ jsx(Modal, { ...modalProps, onCancel, size: "small", footer: modalFooter, bodyStyle: {
27
- padding: 0
28
- }, children: /* @__PURE__ */ jsx(PromptContent, { children: content }) });
26
+ return /* @__PURE__ */ jsx(Modal, { ...modalProps, onCancel, size: "small", footer: modalFooter, bodyFullWidth: true, children: /* @__PURE__ */ jsx(PromptContent, { children: content }) });
29
27
  };
30
28
  export {
31
29
  Prompt
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { default } from './Confirmation';
2
+ export { showConfirmation } from './ShowConfirmation';
2
3
  export type { ConfirmationProps, PromptProps, ConfirmationTexts, } from './Confirmation.types';
3
4
  export { Prompt } from './components/Prompt';
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import { default as default2 } from "./Confirmation.js";
2
+ import { showConfirmation } from "./ShowConfirmation.js";
2
3
  import { Prompt } from "./components/Prompt.js";
3
4
  export {
4
5
  Prompt,
5
- default2 as default
6
+ default2 as default,
7
+ showConfirmation
6
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-confirmation",
3
- "version": "1.2.25",
3
+ "version": "1.3.0",
4
4
  "description": "Confirmation UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -41,15 +41,15 @@
41
41
  ],
42
42
  "types": "dist/index.d.ts",
43
43
  "dependencies": {
44
- "@synerise/ds-button": "^1.5.29",
45
- "@synerise/ds-icon": "^1.18.0",
46
- "@synerise/ds-list-item": "^1.4.20",
47
- "@synerise/ds-modal": "^1.4.14",
48
- "@synerise/ds-panel": "^1.2.12",
49
- "@synerise/ds-radio": "^1.1.12",
50
- "@synerise/ds-scrollbar": "^1.3.5",
51
- "@synerise/ds-typography": "^1.1.22",
52
- "@synerise/ds-utils": "^1.8.1"
44
+ "@synerise/ds-button": "^1.5.30",
45
+ "@synerise/ds-icon": "^1.18.1",
46
+ "@synerise/ds-list-item": "^1.4.21",
47
+ "@synerise/ds-modal": "^1.5.0",
48
+ "@synerise/ds-panel": "^1.2.13",
49
+ "@synerise/ds-radio": "^1.1.13",
50
+ "@synerise/ds-scrollbar": "^1.4.0",
51
+ "@synerise/ds-typography": "^1.1.23",
52
+ "@synerise/ds-utils": "^1.9.0"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@synerise/ds-core": "*",
@@ -58,5 +58,5 @@
58
58
  "styled-components": "^5.3.3",
59
59
  "vitest": "4"
60
60
  },
61
- "gitHead": "ef14a62702ad420add6ad1c56da88df1f70a1bb8"
61
+ "gitHead": "f257f56d8991010593efd5ea9915335e813671a6"
62
62
  }