@synerise/ds-editable-items-list 1.1.1 → 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,10 @@
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
+
6
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)
7
11
 
8
12
  **Note:** Version bump only for package @synerise/ds-editable-items-list
@@ -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.1",
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,10 +16,10 @@
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",
@@ -35,9 +35,9 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
- "@synerise/ds-button": "^1.5.17",
39
- "@synerise/ds-cruds": "^1.1.1",
40
- "@synerise/ds-icon": "^1.15.0"
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": "8efc031fa688c0b87c7b3915bae93546bb63bcac"
50
+ "gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
51
51
  }