@synerise/ds-cruds 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-cruds@1.1.1...@synerise/ds-cruds@1.1.2) (2026-03-24)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-cruds
9
+
10
+ ## [1.1.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-cruds@1.1.0...@synerise/ds-cruds@1.1.1) (2026-03-20)
11
+
12
+ **Note:** Version bump only for package @synerise/ds-cruds
13
+
6
14
  # [1.1.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-cruds@1.0.37...@synerise/ds-cruds@1.1.0) (2026-03-09)
7
15
 
8
16
  ### Features
package/README.md CHANGED
@@ -38,8 +38,8 @@ import Cruds from '@synerise/ds-cruds'
38
38
  ## Usage SingleAction
39
39
 
40
40
  ```
41
- import SingleAction from '@synerise/ds-cruds/dist/SingleAction'
42
- <SingleAction
41
+ import Cruds from '@synerise/ds-cruds'
42
+ <Cruds.CustomAction
43
43
  className="settings"
44
44
  title={'Settings'}
45
45
  icon={<Settings2S />}
@@ -53,19 +53,25 @@ import SingleAction from '@synerise/ds-cruds/dist/SingleAction'
53
53
 
54
54
  ## API
55
55
 
56
- | Property | Description | Type | Default |
57
- | ---------------- | ---------------------------------------------------------------------------- | --------------------------------- | ------- |
58
- | addTooltip | Tooltip of the add button | React.ReactNode / string | - |
59
- | duplicateTooltip | Tooltip of the duplicate button | React.ReactNode / string | - |
60
- | deleteTooltip | Tooltip of the delete button (which has a different icon than remove button) | React.ReactNode / string | - |
61
- | editTooltip | Tooltip of the edit button | React.ReactNode / string | - |
62
- | moveTooltip | Tooltip of the move button | React.ReactNode / string | - |
63
- | removeTooltip | Tooltip of the remove button | React.ReactNode / string | - |
64
- | previewTooltip | Tooltip of the preview button | React.ReactNode / string | - |
65
- | onAdd | Callback executed after clicking the add button. | (event: React.MouseEvent) => void | - |
66
- | onDuplicate | Callback executed after clicking the duplicate button. | (event: React.MouseEvent) => void | - |
67
- | onDelete | Callback executed after clicking the delete button. | (event: React.MouseEvent) => void | - |
68
- | onEdit | Callback executed after clicking the edit button. | (event: React.MouseEvent) => void | - |
69
- | onMove | Callback executed after clicking the move button. | (event: React.MouseEvent) => void | - |
70
- | onRemove | Callback executed after clicking the remove button. | (event: React.MouseEvent) => void | - |
71
- | onPreview | Callback executed after clicking the preview button. | (event: React.MouseEvent) => void | - |
56
+ | Property | Description | Type | Default |
57
+ | ----------------- | ---------------------------------------------------------------------------- | ---------------------------------- | ------- |
58
+ | addTooltip | Tooltip of the add button | React.ReactNode / string | - |
59
+ | duplicateTooltip | Tooltip of the duplicate button | React.ReactNode / string | - |
60
+ | deleteTooltip | Tooltip of the delete button (which has a different icon than remove button) | React.ReactNode / string | - |
61
+ | editTooltip | Tooltip of the edit button | React.ReactNode / string | - |
62
+ | moveTooltip | Tooltip of the move button | React.ReactNode / string | - |
63
+ | moveUpTooltip | Tooltip of the move-up button | React.ReactNode / string | - |
64
+ | moveDownTooltip | Tooltip of the move-down button | React.ReactNode / string | - |
65
+ | removeTooltip | Tooltip of the remove button | React.ReactNode / string | - |
66
+ | previewTooltip | Tooltip of the preview button | React.ReactNode / string | - |
67
+ | moveUpInactive | Disables the move-up button visually | boolean | - |
68
+ | moveDownInactive | Disables the move-down button visually | boolean | - |
69
+ | onAdd | Callback executed after clicking the add button. | (event?: React.MouseEvent) => void | - |
70
+ | onDuplicate | Callback executed after clicking the duplicate button. | (event?: React.MouseEvent) => void | - |
71
+ | onDelete | Callback executed after clicking the delete button. | (event?: React.MouseEvent) => void | - |
72
+ | onEdit | Callback executed after clicking the edit button. | (event?: React.MouseEvent) => void | - |
73
+ | onMove | Callback executed after clicking the move button. | (event?: React.MouseEvent) => void | - |
74
+ | onMoveUp | Callback executed after clicking the move-up button. | (event?: React.MouseEvent) => void | - |
75
+ | onMoveDown | Callback executed after clicking the move-down button. | (event?: React.MouseEvent) => void | - |
76
+ | onRemove | Callback executed after clicking the remove button. | (event?: React.MouseEvent) => void | - |
77
+ | onPreview | Callback executed after clicking the preview button. | () => void | - |
package/dist/Cruds.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type CrudsProps, type CrudsSubComponents } from './Cruds.types';
1
+ import { default as React } from 'react';
2
+ import { CrudsProps, CrudsSubComponents } from './Cruds.types';
3
3
  declare const Cruds: React.FC<CrudsProps> & CrudsSubComponents;
4
4
  export default Cruds;
package/dist/Cruds.js CHANGED
@@ -1,93 +1,43 @@
1
- var _excluded = ["onDelete", "onAdd", "onPreview", "onEdit", "onDuplicate", "onMove", "onRemove", "onMoveUp", "onMoveDown", "moveDownInactive", "moveUpInactive", "addTooltip", "previewTooltip", "editTooltip", "duplicateTooltip", "removeTooltip", "moveTooltip", "moveUpTooltip", "moveDownTooltip", "deleteTooltip"];
2
- 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); }
3
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import React from 'react';
5
- import { AddS, ArrowDownS, ArrowUpS, CloseS, DragHandleM, DuplicateS, EditS, ShowM, TrashS } from '@synerise/ds-icon';
6
- import * as S from './Cruds.styles';
7
- import SingleAction from './SingleAction';
8
- var Cruds = function Cruds(_ref) {
9
- var onDelete = _ref.onDelete,
10
- onAdd = _ref.onAdd,
11
- onPreview = _ref.onPreview,
12
- onEdit = _ref.onEdit,
13
- onDuplicate = _ref.onDuplicate,
14
- onMove = _ref.onMove,
15
- onRemove = _ref.onRemove,
16
- onMoveUp = _ref.onMoveUp,
17
- onMoveDown = _ref.onMoveDown,
18
- moveDownInactive = _ref.moveDownInactive,
19
- moveUpInactive = _ref.moveUpInactive,
20
- addTooltip = _ref.addTooltip,
21
- previewTooltip = _ref.previewTooltip,
22
- editTooltip = _ref.editTooltip,
23
- duplicateTooltip = _ref.duplicateTooltip,
24
- removeTooltip = _ref.removeTooltip,
25
- moveTooltip = _ref.moveTooltip,
26
- moveUpTooltip = _ref.moveUpTooltip,
27
- moveDownTooltip = _ref.moveDownTooltip,
28
- deleteTooltip = _ref.deleteTooltip,
29
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
30
- return /*#__PURE__*/React.createElement(S.CrudsContainer, _extends({
31
- className: "ds-cruds"
32
- }, rest), onMoveUp && /*#__PURE__*/React.createElement(SingleAction, {
33
- title: moveUpTooltip,
34
- inactive: moveUpInactive,
35
- className: "moveup",
36
- onClick: onMoveUp,
37
- icon: /*#__PURE__*/React.createElement(ArrowUpS, null),
38
- "data-testid": "ds-cruds-moveup"
39
- }), onMoveDown && /*#__PURE__*/React.createElement(SingleAction, {
40
- title: moveDownTooltip,
41
- inactive: moveDownInactive,
42
- className: "movedown",
43
- onClick: onMoveDown,
44
- icon: /*#__PURE__*/React.createElement(ArrowDownS, null),
45
- "data-testid": "ds-cruds-movedown"
46
- }), onAdd && /*#__PURE__*/React.createElement(SingleAction, {
47
- title: addTooltip,
48
- className: "add",
49
- onClick: onAdd,
50
- icon: /*#__PURE__*/React.createElement(AddS, null),
51
- "data-testid": "ds-cruds-add"
52
- }), onEdit && /*#__PURE__*/React.createElement(SingleAction, {
53
- title: editTooltip,
54
- className: "edit",
55
- onClick: onEdit,
56
- icon: /*#__PURE__*/React.createElement(EditS, null),
57
- "data-testid": "ds-cruds-edit"
58
- }), onPreview && /*#__PURE__*/React.createElement(SingleAction, {
59
- title: previewTooltip,
60
- className: "preview",
61
- onClick: onPreview,
62
- icon: /*#__PURE__*/React.createElement(ShowM, null),
63
- "data-testid": "ds-cruds-preview"
64
- }), onDuplicate && /*#__PURE__*/React.createElement(SingleAction, {
65
- title: duplicateTooltip,
66
- className: "duplicate",
67
- onClick: onDuplicate,
68
- icon: /*#__PURE__*/React.createElement(DuplicateS, null),
69
- "data-testid": "ds-cruds-duplicate"
70
- }), onDelete && /*#__PURE__*/React.createElement(SingleAction, {
71
- title: deleteTooltip,
72
- className: "delete",
73
- onClick: onDelete,
74
- icon: /*#__PURE__*/React.createElement(TrashS, null),
75
- "data-testid": "ds-cruds-delete"
76
- }), onMove && /*#__PURE__*/React.createElement(SingleAction, {
77
- title: moveTooltip,
78
- className: "move",
79
- onClick: onMove,
80
- icon: /*#__PURE__*/React.createElement(DragHandleM, null),
81
- "data-testid": "ds-cruds-move"
82
- }), onRemove && /*#__PURE__*/React.createElement(SingleAction, {
83
- title: removeTooltip,
84
- className: "remove",
85
- onClick: onRemove,
86
- icon: /*#__PURE__*/React.createElement(CloseS, null),
87
- "data-testid": "ds-cruds-remove"
88
- }));
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { ArrowUpS, ArrowDownS, AddS, EditS, ShowM, DuplicateS, TrashS, DragHandleM, CloseS } from "@synerise/ds-icon";
3
+ import { CrudsContainer } from "./Cruds.styles.js";
4
+ import SingleAction from "./SingleAction.js";
5
+ const Cruds = ({
6
+ onDelete,
7
+ onAdd,
8
+ onPreview,
9
+ onEdit,
10
+ onDuplicate,
11
+ onMove,
12
+ onRemove,
13
+ onMoveUp,
14
+ onMoveDown,
15
+ moveDownInactive,
16
+ moveUpInactive,
17
+ addTooltip,
18
+ previewTooltip,
19
+ editTooltip,
20
+ duplicateTooltip,
21
+ removeTooltip,
22
+ moveTooltip,
23
+ moveUpTooltip,
24
+ moveDownTooltip,
25
+ deleteTooltip,
26
+ ...rest
27
+ }) => {
28
+ return /* @__PURE__ */ jsxs(CrudsContainer, { className: "ds-cruds", ...rest, children: [
29
+ onMoveUp && /* @__PURE__ */ jsx(SingleAction, { title: moveUpTooltip, inactive: moveUpInactive, className: "moveup", onClick: onMoveUp, icon: /* @__PURE__ */ jsx(ArrowUpS, {}), "data-testid": "ds-cruds-moveup" }),
30
+ onMoveDown && /* @__PURE__ */ jsx(SingleAction, { title: moveDownTooltip, inactive: moveDownInactive, className: "movedown", onClick: onMoveDown, icon: /* @__PURE__ */ jsx(ArrowDownS, {}), "data-testid": "ds-cruds-movedown" }),
31
+ onAdd && /* @__PURE__ */ jsx(SingleAction, { title: addTooltip, className: "add", onClick: onAdd, icon: /* @__PURE__ */ jsx(AddS, {}), "data-testid": "ds-cruds-add" }),
32
+ onEdit && /* @__PURE__ */ jsx(SingleAction, { title: editTooltip, className: "edit", onClick: onEdit, icon: /* @__PURE__ */ jsx(EditS, {}), "data-testid": "ds-cruds-edit" }),
33
+ onPreview && /* @__PURE__ */ jsx(SingleAction, { title: previewTooltip, className: "preview", onClick: onPreview, icon: /* @__PURE__ */ jsx(ShowM, {}), "data-testid": "ds-cruds-preview" }),
34
+ onDuplicate && /* @__PURE__ */ jsx(SingleAction, { title: duplicateTooltip, className: "duplicate", onClick: onDuplicate, icon: /* @__PURE__ */ jsx(DuplicateS, {}), "data-testid": "ds-cruds-duplicate" }),
35
+ onDelete && /* @__PURE__ */ jsx(SingleAction, { title: deleteTooltip, className: "delete", onClick: onDelete, icon: /* @__PURE__ */ jsx(TrashS, {}), "data-testid": "ds-cruds-delete" }),
36
+ onMove && /* @__PURE__ */ jsx(SingleAction, { title: moveTooltip, className: "move", onClick: onMove, icon: /* @__PURE__ */ jsx(DragHandleM, {}), "data-testid": "ds-cruds-move" }),
37
+ onRemove && /* @__PURE__ */ jsx(SingleAction, { title: removeTooltip, className: "remove", onClick: onRemove, icon: /* @__PURE__ */ jsx(CloseS, {}), "data-testid": "ds-cruds-remove" })
38
+ ] });
89
39
  };
90
- Cruds.CustomAction = function (props) {
91
- return SingleAction(props);
40
+ Cruds.CustomAction = (props) => SingleAction(props);
41
+ export {
42
+ Cruds as default
92
43
  };
93
- export default Cruds;
@@ -1,4 +1,4 @@
1
- export declare const CrudsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const IconWrapper: import("styled-components").StyledComponent<"div", any, {
1
+ export declare const CrudsContainer: import('styled-components').StyledComponent<"div", any, {}, never>;
2
+ export declare const IconWrapper: import('styled-components').StyledComponent<"div", any, {
3
3
  inactive?: boolean;
4
4
  }, never>;
@@ -1,17 +1,13 @@
1
- import styled, { css } from 'styled-components';
2
- export var CrudsContainer = styled.div.withConfig({
1
+ import styled, { css } from "styled-components";
2
+ const CrudsContainer = /* @__PURE__ */ styled.div.withConfig({
3
3
  displayName: "Crudsstyles__CrudsContainer",
4
4
  componentId: "sc-14u9591-0"
5
- })(["display:flex;height:24px;cursor:pointer;.add,.duplicate,.edit,.move,.moveup,.movedown{svg{fill:", ";}}.add:hover,.duplicate:hover,.edit:hover,.move:hover,.moveup:hover,.movedown:hover{svg{fill:", ";}}.delete,.remove{svg{fill:", ";}}"], function (props) {
6
- return props.theme.palette['grey-600'];
7
- }, function (props) {
8
- return props.theme.palette['blue-600'];
9
- }, function (props) {
10
- return props.theme.palette['red-600'];
11
- });
12
- export var IconWrapper = styled.div.withConfig({
5
+ })(["display:flex;height:24px;cursor:pointer;.add,.duplicate,.edit,.move,.moveup,.movedown{svg{fill:", ";}}.add:hover,.duplicate:hover,.edit:hover,.move:hover,.moveup:hover,.movedown:hover{svg{fill:", ";}}.delete,.remove{svg{fill:", ";}}"], (props) => props.theme.palette["grey-600"], (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["red-600"]);
6
+ const IconWrapper = /* @__PURE__ */ styled.div.withConfig({
13
7
  displayName: "Crudsstyles__IconWrapper",
14
8
  componentId: "sc-14u9591-1"
15
- })(["", ""], function (props) {
16
- return Boolean(props.inactive) && css(["&&,&&:hover{cursor:default;svg{pointer-events:none;fill:", ";}}"], props.theme.palette['grey-300']);
17
- });
9
+ })(["", ""], (props) => Boolean(props.inactive) && css(["&&,&&:hover{cursor:default;svg{pointer-events:none;fill:", ";}}"], props.theme.palette["grey-300"]));
10
+ export {
11
+ CrudsContainer,
12
+ IconWrapper
13
+ };
@@ -1,5 +1,5 @@
1
- import { type MouseEvent, type ReactNode } from 'react';
2
- import type SingleAction from './SingleAction';
1
+ import { MouseEvent, ReactNode } from 'react';
2
+ import { default as SingleAction } from './SingleAction';
3
3
  export interface CrudsProps {
4
4
  addTooltip?: ReactNode;
5
5
  previewTooltip?: ReactNode;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type SingleActionProps } from './SingleAction.types';
1
+ import { default as React } from 'react';
2
+ import { SingleActionProps } from './SingleAction.types';
3
3
  declare const SingleAction: ({ title, inactive, className, onClick, icon, iconSize, ...htmlProps }: SingleActionProps) => React.JSX.Element;
4
4
  export default SingleAction;
@@ -1,30 +1,21 @@
1
- var _excluded = ["title", "inactive", "className", "onClick", "icon", "iconSize"];
2
- 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); }
3
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import React from 'react';
5
- import Icon from '@synerise/ds-icon';
6
- import Tooltip from '@synerise/ds-tooltip/dist/Tooltip';
7
- import * as S from './Cruds.styles';
8
- var SingleAction = function SingleAction(_ref) {
9
- var title = _ref.title,
10
- inactive = _ref.inactive,
11
- className = _ref.className,
12
- _onClick = _ref.onClick,
13
- icon = _ref.icon,
14
- iconSize = _ref.iconSize,
15
- htmlProps = _objectWithoutPropertiesLoose(_ref, _excluded);
16
- return /*#__PURE__*/React.createElement(Tooltip, {
17
- title: title
18
- }, /*#__PURE__*/React.createElement(S.IconWrapper, _extends({
19
- inactive: inactive,
20
- className: className,
21
- onClick: function onClick(event) {
22
- event.stopPropagation();
23
- _onClick && _onClick();
24
- }
25
- }, htmlProps), /*#__PURE__*/React.createElement(Icon, {
26
- component: icon,
27
- size: iconSize || 24
28
- })));
1
+ import { jsx } from "react/jsx-runtime";
2
+ import Icon from "@synerise/ds-icon";
3
+ import Tooltip from "@synerise/ds-tooltip/dist/Tooltip";
4
+ import { IconWrapper } from "./Cruds.styles.js";
5
+ const SingleAction = ({
6
+ title,
7
+ inactive,
8
+ className,
9
+ onClick,
10
+ icon,
11
+ iconSize,
12
+ ...htmlProps
13
+ }) => {
14
+ return /* @__PURE__ */ jsx(Tooltip, { title, children: /* @__PURE__ */ jsx(IconWrapper, { inactive, className, onClick: (event) => {
15
+ event.stopPropagation();
16
+ onClick && onClick();
17
+ }, ...htmlProps, children: /* @__PURE__ */ jsx(Icon, { component: icon, size: iconSize || 24 }) }) });
18
+ };
19
+ export {
20
+ SingleAction as default
29
21
  };
30
- export default SingleAction;
@@ -1,5 +1,5 @@
1
- import type { ReactNode } from 'react';
2
- import type { WithHTMLAttributes } from '@synerise/ds-utils';
1
+ import { ReactNode } from 'react';
2
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
3
3
  export type SingleActionProps = WithHTMLAttributes<HTMLDivElement, {
4
4
  title: ReactNode;
5
5
  className?: string;
@@ -1 +1 @@
1
- export {};
1
+
package/dist/index.js CHANGED
@@ -1 +1,4 @@
1
- export { default } from './Cruds';
1
+ import { default as default2 } from "./Cruds.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-cruds",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Cruds 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 --delete-dir-on-start --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-icon": "^1.14.1",
39
- "@synerise/ds-tooltip": "^1.4.8",
40
- "@synerise/ds-utils": "^1.6.0"
38
+ "@synerise/ds-icon": "^1.15.1",
39
+ "@synerise/ds-tooltip": "^1.4.10",
40
+ "@synerise/ds-utils": "^1.7.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
  }