@synerise/ds-editable-items-list 1.1.0 → 1.1.2

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,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.1.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-editable-items-list@1.1.1...@synerise/ds-editable-items-list@1.1.2) (2026-03-24)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-editable-items-list
9
+
10
+ ## [1.1.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-editable-items-list@1.1.0...@synerise/ds-editable-items-list@1.1.1) (2026-03-20)
11
+
12
+ **Note:** Version bump only for package @synerise/ds-editable-items-list
13
+
6
14
  # [1.1.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-editable-items-list@1.0.44...@synerise/ds-editable-items-list@1.1.0) (2026-03-09)
7
15
 
8
16
  ### Features
package/README.md CHANGED
@@ -30,13 +30,13 @@ import EditableItemsList from '@synerise/ds-editable-items-list'
30
30
 
31
31
  | Property | Description | Type | Default |
32
32
  | ---------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------- | ------- |
33
- | renderRowElement | Function to render each row. Invoked with item index and item object. | (index: number, item: T) => ReactElement | - |
34
- | items | Array of items to be rendered, each should have a unique id. | T[] | - |
33
+ | renderRowElement | Function to render each row. Invoked with item index and item object. | (index: number, item: T) => ReactElement \| null | - |
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
- | addButtonIcon | Custom icon for the "Add" button. | ReactElement | - |
36
+ | addButtonIcon | Custom icon for the "Add" button. | ReactNode | - |
37
37
  | addButtonProps | Additional props for the "Add" button. It can override default style. | Partial<ButtonProps> | - |
38
- | onAdd | Callback function called when the "Add" button is clicked. | () => void | - |
39
- | minRowLength | The minimum number of rows to display. | number | 1 |
38
+ | onAdd | Callback function called when the "Add" button is clicked. | MouseEventHandler<HTMLElement> | - |
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 | - |
41
41
  | deleteTooltip | Tooltip text for the delete button. | string | - |
42
42
  | onDelete | Callback function called when a row's delete button is clicked. It receives the ID and index of the row to delete. | (id: string, index: number) => void | - |
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { type EditableItemsListProps } from './EditableItemsList.types';
1
+ import { default as React } from 'react';
2
+ import { EditableItemsListProps } from './EditableItemsList.types';
3
3
  declare const EditableItemsList: <T extends {
4
4
  id: string;
5
5
  }>({ renderRowElement, items, addButtonLabel, addButtonIcon, addButtonProps, onAdd, minRowLength, maxRowLength, deleteTooltip, onDelete, }: EditableItemsListProps<T>) => React.JSX.Element;
@@ -1,50 +1,46 @@
1
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React from 'react';
3
- import Button from '@synerise/ds-button';
4
- import { theme } from '@synerise/ds-core';
5
- import Cruds from '@synerise/ds-cruds';
6
- import Icon, { Add3M } from '@synerise/ds-icon';
7
- import * as S from './EditableItemsList.style';
8
- var DEFAULT_ADD_BUTTON_PROPS = {
9
- type: 'ghost-primary',
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import Button from "@synerise/ds-button";
3
+ import { theme } from "@synerise/ds-core";
4
+ import Cruds from "@synerise/ds-cruds";
5
+ import Icon, { Add3M } from "@synerise/ds-icon";
6
+ import { RowWrapper, CrudWrapper } from "./EditableItemsList.style.js";
7
+ const DEFAULT_ADD_BUTTON_PROPS = {
8
+ type: "ghost-primary",
10
9
  style: {
11
- transition: 'none'
10
+ transition: "none"
12
11
  }
13
12
  };
14
- var EditableItemsList = function EditableItemsList(_ref) {
15
- var renderRowElement = _ref.renderRowElement,
16
- _ref$items = _ref.items,
17
- items = _ref$items === void 0 ? [] : _ref$items,
18
- addButtonLabel = _ref.addButtonLabel,
19
- addButtonIcon = _ref.addButtonIcon,
20
- addButtonProps = _ref.addButtonProps,
21
- onAdd = _ref.onAdd,
22
- _ref$minRowLength = _ref.minRowLength,
23
- minRowLength = _ref$minRowLength === void 0 ? 1 : _ref$minRowLength,
24
- maxRowLength = _ref.maxRowLength,
25
- deleteTooltip = _ref.deleteTooltip,
26
- onDelete = _ref.onDelete;
27
- var mergedAddButtonProps = _extends({}, DEFAULT_ADD_BUTTON_PROPS, addButtonProps, {
28
- style: _extends({}, DEFAULT_ADD_BUTTON_PROPS.style, addButtonProps == null ? void 0 : addButtonProps.style)
29
- });
30
- return /*#__PURE__*/React.createElement(React.Fragment, null, items.map(function (item, index) {
31
- return /*#__PURE__*/React.createElement(S.RowWrapper, {
32
- key: item.id,
33
- "data-testid": "item-" + item.id
34
- }, renderRowElement(index, item), items.length > minRowLength && /*#__PURE__*/React.createElement(S.CrudWrapper, null, /*#__PURE__*/React.createElement(Cruds, {
35
- onRemove: onDelete ? function () {
36
- return onDelete(item.id, index);
37
- } : undefined,
38
- removeTooltip: deleteTooltip,
39
- "data-testid": "remove-button-" + item.id
40
- })));
41
- }), /*#__PURE__*/React.createElement(Button, _extends({}, mergedAddButtonProps, {
42
- onClick: onAdd,
43
- disabled: maxRowLength !== undefined && items.length >= maxRowLength
44
- }), addButtonIcon || /*#__PURE__*/React.createElement(Icon, {
45
- component: /*#__PURE__*/React.createElement(Add3M, null),
46
- size: 24,
47
- color: theme.palette['blue-600']
48
- }), addButtonLabel));
13
+ const EditableItemsList = ({
14
+ renderRowElement,
15
+ items = [],
16
+ addButtonLabel,
17
+ addButtonIcon,
18
+ addButtonProps,
19
+ onAdd,
20
+ minRowLength = 1,
21
+ maxRowLength,
22
+ deleteTooltip,
23
+ onDelete
24
+ }) => {
25
+ const mergedAddButtonProps = {
26
+ ...DEFAULT_ADD_BUTTON_PROPS,
27
+ ...addButtonProps,
28
+ style: {
29
+ ...DEFAULT_ADD_BUTTON_PROPS.style,
30
+ ...addButtonProps?.style
31
+ }
32
+ };
33
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
34
+ items.map((item, index) => /* @__PURE__ */ jsxs(RowWrapper, { "data-testid": `item-${item.id}`, children: [
35
+ renderRowElement(index, item),
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
+ ] }, item.id)),
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"] }),
40
+ addButtonLabel
41
+ ] })
42
+ ] });
43
+ };
44
+ export {
45
+ EditableItemsList as default
49
46
  };
50
- export default EditableItemsList;
@@ -1,2 +1,2 @@
1
- export declare const CrudWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const RowWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
1
+ export declare const CrudWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
2
+ export declare const RowWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
@@ -1,9 +1,13 @@
1
- import styled from 'styled-components';
2
- export var CrudWrapper = styled.div.withConfig({
1
+ import styled from "styled-components";
2
+ const CrudWrapper = /* @__PURE__ */ styled.div.withConfig({
3
3
  displayName: "EditableItemsListstyle__CrudWrapper",
4
4
  componentId: "sc-a71i6b-0"
5
5
  })(["padding-left:4px;visibility:hidden;margin-top:0;"]);
6
- export var RowWrapper = styled.div.withConfig({
6
+ const RowWrapper = /* @__PURE__ */ styled.div.withConfig({
7
7
  displayName: "EditableItemsListstyle__RowWrapper",
8
8
  componentId: "sc-a71i6b-1"
9
- })(["display:flex;justify-content:space-between;align-items:center;padding:0 0 16px 0;&:hover{", "{visibility:visible;}}& > *:not(:last-child){margin-right:12px;}"], CrudWrapper);
9
+ })(["display:flex;justify-content:space-between;align-items:center;padding:0 0 16px 0;&:hover{", "{visibility:visible;}}& > *:not(:last-child){margin-right:12px;}"], CrudWrapper);
10
+ export {
11
+ CrudWrapper,
12
+ RowWrapper
13
+ };
@@ -1,5 +1,5 @@
1
- import { type MouseEventHandler, type ReactElement, type ReactNode } from 'react';
2
- import { type ButtonProps } from '@synerise/ds-button';
1
+ import { MouseEventHandler, ReactElement, ReactNode } from 'react';
2
+ import { ButtonProps } from '@synerise/ds-button';
3
3
  export type EditableItemsListProps<T extends {
4
4
  id: string;
5
5
  }> = {
@@ -1 +1 @@
1
- export {};
1
+
package/dist/index.js CHANGED
@@ -1 +1,4 @@
1
- export { default } from './EditableItemsList';
1
+ import { default as default2 } from "./EditableItemsList.js";
2
+ export {
3
+ default2 as default
4
+ };
package/dist/modules.d.js CHANGED
@@ -1 +1 @@
1
- import '@testing-library/jest-dom';
1
+ import "@testing-library/jest-dom";
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-editable-items-list",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "EditableItemsList 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": "pnpm run build:js && pnpm run build:css && pnpm run defs",
19
+ "build": "vite build",
20
20
  "build:css": "node ../../../scripts/style/less.js",
21
21
  "build:js": "babel --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
22
- "build:watch": "pnpm run build:js -- --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": "pnpm run 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,9 +35,9 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
- "@synerise/ds-button": "^1.5.16",
39
- "@synerise/ds-cruds": "^1.1.0",
40
- "@synerise/ds-icon": "^1.14.1"
38
+ "@synerise/ds-button": "^1.5.18",
39
+ "@synerise/ds-cruds": "^1.1.2",
40
+ "@synerise/ds-icon": "^1.15.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "vitest": "4"
@@ -47,5 +47,5 @@
47
47
  "react": ">=16.9.0 <= 18.3.1",
48
48
  "styled-components": "^5.3.3"
49
49
  },
50
- "gitHead": "8dfafc5d7278f09d430f1e7499782d05c76b47c0"
50
+ "gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
51
51
  }