@synerise/ds-confirmation 2.0.12 → 2.1.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,25 @@
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
+ # [2.1.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-confirmation@2.0.13...@synerise/ds-confirmation@2.1.0) (2026-10-29)
7
+
8
+
9
+ ### Features
10
+
11
+ * integrate Token Studio design tokens across the design system ([aabb447](https://github.com/Synerise/synerise-design/commit/aabb447edfb2d0c85e3de1f07e809ef84083453b))
12
+
13
+
14
+
15
+
16
+
17
+ ## [2.0.13](https://github.com/Synerise/synerise-design/compare/@synerise/ds-confirmation@2.0.12...@synerise/ds-confirmation@2.0.13) (2026-10-28)
18
+
19
+ **Note:** Version bump only for package @synerise/ds-confirmation
20
+
21
+
22
+
23
+
24
+
6
25
  ## [2.0.12](https://github.com/Synerise/synerise-design/compare/@synerise/ds-confirmation@2.0.11...@synerise/ds-confirmation@2.0.12) (2026-10-26)
7
26
 
8
27
 
package/CLAUDE.md CHANGED
@@ -8,9 +8,9 @@
8
8
  src/
9
9
  Confirmation.tsx — main component (generic over ListItemProps)
10
10
  Confirmation.types.ts — all prop interfaces and shared types
11
- Confirmation.styles.ts — styled-components (no hardcoded tokens — uses ds-core palette via useTheme)
12
- Confirmation.const.ts — BUTTON_COLOR_MAPPING, ICON_COLOR_MAPPING, ITEM_SIZE, MAX_ITEMS
13
- Confirmation.utils.ts — getIconColor(type, theme) helper
11
+ Confirmation.styles.ts — styled-components (layout only — no colours)
12
+ Confirmation.const.ts — BUTTON_TYPE_MAPPING, ICON_COLOR_MAPPING, ITEM_SIZE, MAX_ITEMS
13
+ Confirmation.utils.ts — getIconColor(type) helper (looks up ICON_COLOR_MAPPING)
14
14
  index.ts — public exports
15
15
  components/
16
16
  Prompt.tsx — simpler modal variant with free-form content
@@ -143,7 +143,7 @@ The title prop is **ignored** in `'related-objects'` mode — the internal back-
143
143
 
144
144
  ## Styling
145
145
 
146
- Styles live in `Confirmation.styles.ts`. Colours are resolved at runtime via `useTheme()` from `@synerise/ds-core` — icon colour is looked up from `theme.palette[colorToken]`, not hardcoded. The modal always renders at `size="small"` with `blank={true}` (no default modal padding) in default mode.
146
+ Styles live in `Confirmation.styles.ts`. They set no colours; the type icon colour comes from `getIconColor(type)`, which returns the semantic `var(--ds-color-icon-*)` token from `ICON_COLOR_MAPPING` (`negative`→`danger-default`, `success`→`success-default`, `warning`→`warning-default`, `informative`→`base-default`). The modal always renders at `size="small"` with `blank={true}` (no default modal padding) in default mode.
147
147
 
148
148
  `BatchItemsList` is capped at `MAX_ITEMS × ITEM_SIZE` (6 × 32 = 192px) height via `@synerise/ds-scrollbar`.
149
149
 
@@ -163,7 +163,7 @@ Merges `Partial<ConfirmationTexts>` supplied by the caller with `react-intl` `<F
163
163
  - `@synerise/ds-list-item` — `BatchItemsList` items; generic `ItemType extends ListItemProps`
164
164
  - `@synerise/ds-scrollbar` — caps `BatchItemsList` height
165
165
  - `@synerise/ds-panel` — `AdditionalInfo` and `DecisionSection` frames
166
- - `@synerise/ds-core` — `useTheme` for palette-based icon colour resolution
166
+ - `@synerise/ds-core` — `setPortalContent` (used by `ShowConfirmation`)
167
167
  - `react-intl` — default label strings (peer dependency, `^6.8.7`)
168
168
 
169
169
  ## Implementation notes
@@ -172,4 +172,5 @@ Merges `Partial<ConfirmationTexts>` supplied by the caller with `react-intl` `<F
172
172
  - All modal content and footer are wrapped in `useMemo` — dependencies must be kept in sync to avoid stale renders.
173
173
  - `bodyStyle={{ padding: 0 }}` is hardcoded — content components own their own padding via styled-components.
174
174
  - `onOk` and `onCancel` are **optional**; the footer renders conditionally only when at least one is provided (or `relatedObjects` is set).
175
- - `ConfirmationButtonProps` is a limited subset of `ButtonProps` (`mode`, `loading`, `readOnly`, `disabled`, `tagProps`) plus `DataAttributes` — arbitrary button props cannot be passed through.
175
+ - `ConfirmationButtonProps` is a limited subset of `ButtonProps` (`mode`, `loading`, `readOnly`, `disabled`, `tagProps`) plus `DataAttributes` — arbitrary button props cannot be passed through.
176
+ - **Confirm button uses a semantic ds-button `type`** — `BUTTON_TYPE_MAPPING` maps each `ConfirmationType` to a ds-button `type` (`negative`→`danger`, `success`→`success`, `warning`→`warning`, `informative`→`primary`), replacing the previous `type="custom-color"` + `color` keyword approach. The type-driven icon still comes from `ICON_COLOR_MAPPING` (semantic icon tokens).
@@ -1,5 +1,5 @@
1
1
  import { ConfirmationType } from './Confirmation.types';
2
- export declare const BUTTON_COLOR_MAPPING: Record<ConfirmationType, string>;
2
+ export declare const BUTTON_TYPE_MAPPING: Record<ConfirmationType, string>;
3
3
  export declare const ICON_COLOR_MAPPING: Record<ConfirmationType, string>;
4
4
  export declare const ITEM_SIZE = 32;
5
5
  export declare const MAX_ITEMS = 6;
@@ -1,19 +1,19 @@
1
- const BUTTON_COLOR_MAPPING = {
2
- negative: "red",
3
- success: "green",
4
- warning: "yellow",
5
- informative: "blue"
1
+ const BUTTON_TYPE_MAPPING = {
2
+ negative: "danger",
3
+ success: "success",
4
+ warning: "warning",
5
+ informative: "primary"
6
6
  };
7
7
  const ICON_COLOR_MAPPING = {
8
- negative: "red-600",
9
- success: "green-600",
10
- warning: "yellow-600",
11
- informative: "grey-600"
8
+ negative: "var(--ds-color-icon-danger-default)",
9
+ success: "var(--ds-color-icon-success-default)",
10
+ warning: "var(--ds-color-icon-warning-default)",
11
+ informative: "var(--ds-color-icon-base-default)"
12
12
  };
13
13
  const ITEM_SIZE = 32;
14
14
  const MAX_ITEMS = 6;
15
15
  export {
16
- BUTTON_COLOR_MAPPING,
16
+ BUTTON_TYPE_MAPPING,
17
17
  ICON_COLOR_MAPPING,
18
18
  ITEM_SIZE,
19
19
  MAX_ITEMS
@@ -1,12 +1,11 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useState, useCallback, useMemo } from "react";
3
3
  import Button from "@synerise/ds-button";
4
- import { useTheme } from "@synerise/ds-core";
5
4
  import Icon, { ShowM, ArrowLeftM } from "@synerise/ds-icon";
6
5
  import Modal from "@synerise/ds-modal";
7
6
  import Panel from "@synerise/ds-panel";
8
7
  import { Paragraph } from "@synerise/ds-typography";
9
- import { BUTTON_COLOR_MAPPING } from "./Confirmation.const.js";
8
+ import { BUTTON_TYPE_MAPPING } from "./Confirmation.const.js";
10
9
  import { ConfirmationModalContent, ConfirmationModalContentMain, Title, Footer, FooterLeft, FooterRight, ModalBackTitle } from "./Confirmation.styles.js";
11
10
  import { getIconColor } from "./Confirmation.utils.js";
12
11
  import { BatchItemsList } from "./components/BatchItemsList.js";
@@ -31,14 +30,13 @@ const Confirmation = ({
31
30
  ...modalProps
32
31
  }) => {
33
32
  const [mode, setMode] = useState("default");
34
- const theme = useTheme();
35
33
  const allTexts = useDefaultTexts(texts);
36
34
  const handleAfterClose = useCallback(() => {
37
35
  setMode("default");
38
36
  afterClose?.();
39
37
  }, [afterClose]);
40
- const buttonColor = BUTTON_COLOR_MAPPING[type];
41
- const iconColor = getIconColor(type, theme);
38
+ const buttonType = BUTTON_TYPE_MAPPING[type];
39
+ const iconColor = getIconColor(type);
42
40
  const modalContent = useMemo(() => {
43
41
  if (mode === "default") {
44
42
  return /* @__PURE__ */ jsxs(ConfirmationModalContent, { children: [
@@ -64,10 +62,10 @@ const Confirmation = ({
64
62
  customFooterComponent && /* @__PURE__ */ jsx(FooterLeft, { children: customFooterComponent }),
65
63
  (onOk || onCancel) && /* @__PURE__ */ jsxs(FooterRight, { children: [
66
64
  onCancel && /* @__PURE__ */ jsx(Button, { type: "secondary", onClick: onCancel, ...secondaryButtonProps, children: allTexts.secondaryButtonLabel }),
67
- onOk && /* @__PURE__ */ jsx(Button, { type: "custom-color", onClick: onOk, color: buttonColor, ...mainButtonProps, children: allTexts.mainButtonLabel })
65
+ onOk && /* @__PURE__ */ jsx(Button, { type: buttonType, onClick: onOk, ...mainButtonProps, children: allTexts.mainButtonLabel })
68
66
  ] })
69
67
  ] }) : null;
70
- }, [mode, onOk, onCancel, buttonColor, mainButtonProps, relatedObjects, secondaryButtonProps, allTexts.secondaryButtonLabel, allTexts.mainButtonLabel, allTexts.relatedObjectsButtonLabel]);
68
+ }, [mode, onOk, onCancel, buttonType, mainButtonProps, relatedObjects, secondaryButtonProps, allTexts.secondaryButtonLabel, allTexts.mainButtonLabel, allTexts.relatedObjectsButtonLabel]);
71
69
  const modalTitle = mode === "related-objects" ? /* @__PURE__ */ jsxs(ModalBackTitle, { children: [
72
70
  /* @__PURE__ */ jsx(Icon, { onClick: () => setMode("default"), component: /* @__PURE__ */ jsx(ArrowLeftM, {}) }),
73
71
  allTexts.relatedObjectsTitle
@@ -1,3 +1,2 @@
1
- import { ThemePropsVars } from '@synerise/ds-core';
2
1
  import { ConfirmationType } from './Confirmation.types';
3
- export declare const getIconColor: (type: ConfirmationType, theme: ThemePropsVars) => string;
2
+ export declare const getIconColor: (type: ConfirmationType) => string;
@@ -1,8 +1,5 @@
1
1
  import { ICON_COLOR_MAPPING } from "./Confirmation.const.js";
2
- const getIconColor = (type, theme) => {
3
- const colorToken = ICON_COLOR_MAPPING[type];
4
- return theme.palette[colorToken];
5
- };
2
+ const getIconColor = (type) => ICON_COLOR_MAPPING[type];
6
3
  export {
7
4
  getIconColor
8
5
  };
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
3
  import Button from "@synerise/ds-button";
4
4
  import Modal from "@synerise/ds-modal";
5
- import { BUTTON_COLOR_MAPPING } from "../Confirmation.const.js";
5
+ import { BUTTON_TYPE_MAPPING } from "../Confirmation.const.js";
6
6
  import { Footer, FooterRight, PromptContent } from "../Confirmation.styles.js";
7
7
  import { useDefaultTexts } from "../hooks/useDefaultTexts.js";
8
8
  const Prompt = ({
@@ -16,13 +16,13 @@ const Prompt = ({
16
16
  ...modalProps
17
17
  }) => {
18
18
  const allTexts = useDefaultTexts(texts);
19
- const buttonColor = BUTTON_COLOR_MAPPING[type];
19
+ const buttonType = BUTTON_TYPE_MAPPING[type];
20
20
  const modalFooter = useMemo(() => {
21
21
  return /* @__PURE__ */ jsx(Footer, { children: /* @__PURE__ */ jsxs(FooterRight, { children: [
22
22
  /* @__PURE__ */ jsx(Button, { type: "secondary", onClick: onCancel, ...secondaryButtonProps, children: allTexts.secondaryButtonLabel }),
23
- /* @__PURE__ */ jsx(Button, { type: "custom-color", onClick: onOk, color: buttonColor, ...mainButtonProps, children: allTexts.mainButtonLabel })
23
+ /* @__PURE__ */ jsx(Button, { type: buttonType, onClick: onOk, ...mainButtonProps, children: allTexts.mainButtonLabel })
24
24
  ] }) });
25
- }, [buttonColor, onCancel, onOk, mainButtonProps, allTexts.mainButtonLabel, allTexts.secondaryButtonLabel, secondaryButtonProps]);
25
+ }, [buttonType, onCancel, onOk, mainButtonProps, allTexts.mainButtonLabel, allTexts.secondaryButtonLabel, secondaryButtonProps]);
26
26
  return /* @__PURE__ */ jsx(Modal, { ...modalProps, onCancel, size: "small", footer: modalFooter, bodyFullWidth: true, children: /* @__PURE__ */ jsx(PromptContent, { children: content }) });
27
27
  };
28
28
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-confirmation",
3
- "version": "2.0.12",
3
+ "version": "2.1.0",
4
4
  "description": "Confirmation UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -42,15 +42,15 @@
42
42
  ],
43
43
  "types": "dist/index.d.ts",
44
44
  "dependencies": {
45
- "@synerise/ds-button": "^2.1.5",
46
- "@synerise/ds-icon": "^2.2.3",
47
- "@synerise/ds-list-item": "^2.2.3",
48
- "@synerise/ds-modal": "^2.1.0",
49
- "@synerise/ds-panel": "^2.0.11",
50
- "@synerise/ds-radio": "^2.0.10",
51
- "@synerise/ds-scrollbar": "^2.0.9",
52
- "@synerise/ds-typography": "^2.0.10",
53
- "@synerise/ds-utils": "^2.2.2"
45
+ "@synerise/ds-button": "^2.2.0",
46
+ "@synerise/ds-icon": "^2.3.0",
47
+ "@synerise/ds-list-item": "^2.3.0",
48
+ "@synerise/ds-modal": "^2.2.0",
49
+ "@synerise/ds-panel": "^2.1.0",
50
+ "@synerise/ds-radio": "^2.1.0",
51
+ "@synerise/ds-scrollbar": "^2.1.0",
52
+ "@synerise/ds-typography": "^2.1.0",
53
+ "@synerise/ds-utils": "^2.3.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "vitest": "4"
@@ -61,5 +61,5 @@
61
61
  "react-intl": "^6.8.7",
62
62
  "styled-components": "^5.3.3"
63
63
  },
64
- "gitHead": "5ac0f7dcb7c3995b402c86c087d8f32770f80a1d"
64
+ "gitHead": "5c3d61e30289486d14c7d6becb682e2d4a08ce41"
65
65
  }