@synerise/ds-editable-items-list 2.0.10 → 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-editable-items-list@2.0.11...@synerise/ds-editable-items-list@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.11](https://github.com/Synerise/synerise-design/compare/@synerise/ds-editable-items-list@2.0.10...@synerise/ds-editable-items-list@2.0.11) (2026-10-28)
18
+
19
+ **Note:** Version bump only for package @synerise/ds-editable-items-list
20
+
21
+
22
+
23
+
24
+
6
25
  ## [2.0.10](https://github.com/Synerise/synerise-design/compare/@synerise/ds-editable-items-list@2.0.9...@synerise/ds-editable-items-list@2.0.10) (2026-10-26)
7
26
 
8
27
  **Note:** Version bump only for package @synerise/ds-editable-items-list
package/CLAUDE.md CHANGED
@@ -25,8 +25,8 @@ Generic component: `EditableItemsList<T extends { id: string }>`. Not a `forward
25
25
  | `renderRowElement` | `(index: number, data: T) => ReactElement \| null` | — | **Required.** Renders content for each row |
26
26
  | `items` | `T[]` | `[]` | Items to display. Each must have a unique `id: string` |
27
27
  | `addButtonLabel` | `string \| ReactNode` | — | **Required.** Label for the Add button |
28
- | `addButtonIcon` | `ReactNode` | `undefined` | Custom icon for the Add button. Defaults to `<Add3M />` in blue |
29
- | `addButtonProps` | `Partial<ButtonProps>` | `undefined` | Overrides for the Add button. Merged on top of `{ type: 'ghost-primary', style: { transition: 'none' } }` |
28
+ | `addButtonIcon` | `ReactNode` | `undefined` | Custom icon for the Add button. Defaults to `<Add3M />`, coloured by the ghost-primary button |
29
+ | `addButtonProps` | `Partial<ButtonProps>` | `undefined` | Overrides for the Add button. Merged on top of `{ type: 'ghost-primary', mode, style: { transition: 'none' } }`, where `mode` is `'icon-label'` when `addButtonLabel` is set and `'single-icon'` otherwise |
30
30
  | `onAdd` | `MouseEventHandler<HTMLElement>` | — | **Required.** Called when Add button is clicked |
31
31
  | `minRowLength` | `number` | `1` | Delete button is hidden while `items.length <= minRowLength` |
32
32
  | `maxRowLength` | `number` | `undefined` | Add button is disabled once `items.length >= maxRowLength` |
@@ -72,7 +72,7 @@ Styles in `EditableItemsList.style.ts`. No design-system tokens — layout only:
72
72
  ## Implementation notes
73
73
 
74
74
  - **Delete visibility:** The delete (`CrudWrapper`) is rendered in the DOM at all times but hidden via `visibility: hidden`. It only becomes visible on hover — and only when `items.length > minRowLength`. At or below the minimum, the `CrudWrapper` is not rendered at all.
75
- - **Add button defaults:** A `DEFAULT_ADD_BUTTON_PROPS` constant sets `type: 'ghost-primary'` and `style: { transition: 'none' }`. `addButtonProps.style` is shallow-merged (not replaced), so individual style keys override but others persist.
75
+ - **Add button defaults:** A `DEFAULT_ADD_BUTTON_PROPS` constant sets `type: 'ghost-primary'` and `style: { transition: 'none' }`. `mode` is derived from `addButtonLabel` — `'icon-label'` (8px/4px/12px icon spacing) with a label, `'single-icon'` (32px square) without — and `addButtonProps.mode` overrides it. `addButtonProps.style` is shallow-merged (not replaced), so individual style keys override but others persist.
76
76
  - **Generic constraint:** `T` must extend `{ id: string }`. Item identity for `key` and for `onDelete` is taken from `item.id`.
77
77
  - **Row key:** Rows are keyed by `item.id` — duplicate IDs will cause React reconciliation issues.
78
78
  - **No state:** Fully controlled — `items` array managed by the caller; this component has no internal list state.
package/README.md CHANGED
@@ -34,7 +34,7 @@ import EditableItemsList from '@synerise/ds-editable-items-list'
34
34
  | items | Array of items to be rendered, each should have a unique id. | T[] | `[]` |
35
35
  | addButtonLabel | Text or custom component for the "Add" button. | string \| ReactNode | - |
36
36
  | addButtonIcon | Custom icon for the "Add" button. | ReactNode | - |
37
- | addButtonProps | Additional props for the "Add" button. It can override default style. | Partial&lt;ButtonProps&gt; | - |
37
+ | addButtonProps | Additional props for the "Add" button. It can override default style and `mode`. | Partial&lt;ButtonProps&gt; | - |
38
38
  | onAdd | Callback function called when the "Add" button is clicked. | MouseEventHandler&lt;HTMLElement&gt; | - |
39
39
  | minRowLength | The minimum number of rows to display. Delete button hidden while at or below this count. | number | 1 |
40
40
  | maxRowLength | The maximum number of rows allowed. | number | - |
@@ -1,6 +1,5 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import Button from "@synerise/ds-button";
3
- import { theme } from "@synerise/ds-core";
4
3
  import Cruds from "@synerise/ds-cruds";
5
4
  import Icon, { Add3M } from "@synerise/ds-icon";
6
5
  import { RowWrapper, CrudWrapper } from "./EditableItemsList.style.js";
@@ -24,6 +23,7 @@ const EditableItemsList = ({
24
23
  }) => {
25
24
  const mergedAddButtonProps = {
26
25
  ...DEFAULT_ADD_BUTTON_PROPS,
26
+ mode: addButtonLabel ? "icon-label" : "single-icon",
27
27
  ...addButtonProps,
28
28
  style: {
29
29
  ...DEFAULT_ADD_BUTTON_PROPS.style,
@@ -36,7 +36,7 @@ const EditableItemsList = ({
36
36
  items.length > minRowLength && /* @__PURE__ */ jsx(CrudWrapper, { children: /* @__PURE__ */ jsx(Cruds, { onRemove: onDelete ? () => onDelete(item.id, index) : void 0, removeTooltip: deleteTooltip, "data-testid": `remove-button-${item.id}` }) })
37
37
  ] }, item.id)),
38
38
  /* @__PURE__ */ jsxs(Button, { ...mergedAddButtonProps, onClick: onAdd, disabled: maxRowLength !== void 0 && items.length >= maxRowLength, children: [
39
- addButtonIcon || /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(Add3M, {}), size: 24, color: theme.palette["blue-600"] }),
39
+ addButtonIcon || /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(Add3M, {}), size: 24 }),
40
40
  addButtonLabel
41
41
  ] })
42
42
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-editable-items-list",
3
- "version": "2.0.10",
3
+ "version": "2.1.0",
4
4
  "description": "EditableItemsList UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -42,9 +42,9 @@
42
42
  ],
43
43
  "types": "dist/index.d.ts",
44
44
  "dependencies": {
45
- "@synerise/ds-button": "^2.1.5",
46
- "@synerise/ds-cruds": "^2.0.10",
47
- "@synerise/ds-icon": "^2.2.3"
45
+ "@synerise/ds-button": "^2.2.0",
46
+ "@synerise/ds-cruds": "^2.1.0",
47
+ "@synerise/ds-icon": "^2.3.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "vitest": "4"
@@ -54,5 +54,5 @@
54
54
  "react": ">=16.9.0 <= 18.3.1",
55
55
  "styled-components": "^5.3.3"
56
56
  },
57
- "gitHead": "5ac0f7dcb7c3995b402c86c087d8f32770f80a1d"
57
+ "gitHead": "5c3d61e30289486d14c7d6becb682e2d4a08ce41"
58
58
  }