@synerise/ds-modal 1.3.8 → 1.4.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,16 @@
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.4.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@1.3.9...@synerise/ds-modal@1.4.0) (2026-03-20)
7
+
8
+ ### Features
9
+
10
+ - **modal:** disableScrollbar prop ([d6a80ec](https://github.com/synerise/synerise-design/commit/d6a80ec2a5394703974d2b369f25a13fc4e5eeb0))
11
+
12
+ ## [1.3.9](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@1.3.8...@synerise/ds-modal@1.3.9) (2026-03-09)
13
+
14
+ **Note:** Version bump only for package @synerise/ds-modal
15
+
6
16
  ## [1.3.8](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@1.3.7...@synerise/ds-modal@1.3.8) (2026-02-23)
7
17
 
8
18
  **Note:** Version bump only for package @synerise/ds-modal
package/README.md CHANGED
@@ -16,7 +16,7 @@ The Modal component provides a flexible and customizable way to display modal di
16
16
  Install the Modal component using npm:
17
17
 
18
18
  ```bash
19
- npm install @synerise/ds-core
19
+ npm install @synerise/ds-modal
20
20
  ```
21
21
 
22
22
  ## Deprecated Features
@@ -31,25 +31,24 @@ Some features of the Modal component have been deprecated. Please refer to the [
31
31
 
32
32
  | Property | Description | Type | Default |
33
33
  | ------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ----------------------------------------------- |
34
- | description | The modal dialog's description | ReactNode | - |
34
+ | description | **(Deprecated)** The modal dialog's description | ReactNode | - |
35
35
  | headerBottomBar | Bottom bar rendered below title and description | ReactNode | - |
36
36
  | headerActions | Append additional content to header actions space | React.ReactNode | - |
37
+ | headerTabProps | Props forwarded to the Tabs component rendered in the header | TabsProps | - |
37
38
  | size | The modal size | `small` / `medium` / `large` / `extraLarge`/ `fullSize`/ `fullScreen`. | - |
38
39
  | bodyBackground | Set color for body of modal | `white` / `grey` | `white` |
39
40
  | blank | Modal with header which contains only close button | Boolean | `false` |
40
41
  | titleContainerStyle | The modal title's container styles object | React.CSSProperties / undefined | - |
41
- | settingButtonText | Text of the setting button | string | `Setting` |
42
- | texts | Labels to render | `{ okButton: string; cancelButton: string }` | `{ okButton: 'Apply', cancelButton: 'Cancel' }` |
43
- | children | Children element to render | `{ okButton: string; cancelButton: string }` | - |
44
- | visible | Whether the modal dialog is visible or not | boolean | `false` |
42
+ | texts | Labels to render | `{ okButton?: ReactNode; cancelButton?: ReactNode }` | `{ okButton: 'Apply', cancelButton: 'Cancel' }` |
43
+ | children | Children element to render | ReactNode | - |
44
+ | open | Whether the modal dialog is visible or not | boolean | `false` |
45
45
  | confirmLoading | Whether to apply loading visual effect for OK button or not | boolean | `false` |
46
46
  | title | The modal dialog's title | string / ReactNode | - |
47
- | closable | Whether a close (x) button is visible on top right of the modal dialog or not | boolean | `true` |
48
47
  | onOk | Specify a function that will be called when a user clicks the OK button | function(e) | - |
49
48
  | onCancel | Specify a function that will be called when a user clicks mask, close button on top right or Cancel button | function(e) | - |
50
49
  | afterClose | Specify a function that will be called when modal is closed completely. | function | - |
51
50
  | centered | Centered Modal | Boolean | `false` |
52
- | width | Width of the modal dialog | string / number | 520 |
51
+ | width | Width of the modal dialog (overridden by `size` when set) | string / number | 520 |
53
52
  | footer | Footer content, set as `footer={null}` when you don't need default buttons | ReactNode | OK and Cancel buttons |
54
53
  | okText | Text of the OK button | string / ReactNode | `OK` |
55
54
  | okType | Button `type` of the OK button | string | `primary` |
@@ -67,17 +66,20 @@ Some features of the Modal component have been deprecated. Please refer to the [
67
66
  | mask | Whether show mask or not. | Boolean | `true` |
68
67
  | closeIcon | custom close icon | ReactNode | - |
69
68
  | maskStyle | Style for modal's mask element. | object | {} |
70
- | maxHeightViewport | height of modal with with scrollbar | true / number | 80 |
69
+ | maxViewportHeight | Caps modal height and wraps body in a scrollbar. `true` = 80vh, number = custom vh | true / number | - |
70
+ | disableScrollbar | Disables automatic scrollbar wrapping applied by `maxViewportHeight` | boolean | - |
71
71
 
72
72
  and it is extended by props for ModalFooterBuilder:
73
73
 
74
- | Property | Description | Type | Default | Version |
75
- | ------------ | ------------------------------------------------------------ | --------- | ------- | ------- |
76
- | prefix | Element in footer, before Cancel Button | ReactNode | - |
77
- | infix | Element in footer between Cancel Button nad before Ok Button | ReactNode | - |
78
- | suffix | Element in footer, after Ok Button | ReactNode | - |
79
- | okButton | Custom OK button in footer | ReactNode | - |
80
- | cancelButton | Custom Cancel button in footer | ReactNode | - |
74
+ | Property | Description | Type | Default | Version |
75
+ | ------------------- | ------------------------------------------------------------ | ---------------------------- | -------- | ------- |
76
+ | prefix | Element in footer, before Cancel Button | ReactNode | - | |
77
+ | infix | Element in footer between Cancel Button and before Ok Button | ReactNode | - | |
78
+ | suffix | Element in footer, after Ok Button | ReactNode | - | |
79
+ | okButton | Custom OK button in footer | ReactNode | - | |
80
+ | cancelButton | Custom Cancel button in footer | ReactNode | - | |
81
+ | CustomFooterButton | Button component used to render ok/cancel buttons | `ComponentType<ButtonProps>` | `Button` | |
82
+ | DSButton | **(Deprecated)** use `CustomFooterButton` | `ComponentType<ButtonProps>` | `Button` | |
81
83
 
82
84
  ## ModalTitle
83
85
 
@@ -85,11 +87,13 @@ and it is extended by props for ModalFooterBuilder:
85
87
  type ModalTitleProps = Pick<
86
88
  ModalProps,
87
89
  | 'headerActions'
90
+ | 'headerTabProps'
88
91
  | 'onCancel'
89
92
  | 'titleContainerStyle'
90
93
  | 'blank'
91
94
  | 'description'
92
95
  | 'title'
96
+ | 'headerBottomBar'
93
97
  >;
94
98
  ```
95
99
 
@@ -116,4 +120,4 @@ export type ModalFooterProps = Pick<
116
120
  >;
117
121
  ```
118
122
 
119
- **(Deprecated)** method buildModalFooter - use ModalFooter Component instead
123
+ **(Deprecated)** method buildModalFooter - use ModalFooter Component instead
package/dist/Modal.js CHANGED
@@ -1,9 +1,9 @@
1
- var _excluded = ["texts", "bodyBackground", "headerActions", "title", "description", "headerBottomBar", "size", "blank", "titleContainerStyle", "maxViewportHeight", "children"];
1
+ var _excluded = ["texts", "bodyBackground", "headerActions", "title", "description", "headerBottomBar", "size", "blank", "titleContainerStyle", "maxViewportHeight", "disableScrollbar", "children"];
2
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
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
4
  import { Modal as AntModal } from 'antd';
5
5
  import classnames from 'classnames';
6
- import React, { useRef } from 'react';
6
+ import React from 'react';
7
7
  import '@synerise/ds-core/dist/js/style';
8
8
  import { ModalFooter } from './Elements/ModalFooter';
9
9
  import { ModalTitle } from './Elements/ModalTitle';
@@ -34,6 +34,7 @@ export var Modal = function Modal(props) {
34
34
  blank = props.blank,
35
35
  titleContainerStyle = props.titleContainerStyle,
36
36
  maxViewportHeight = props.maxViewportHeight,
37
+ disableScrollbar = props.disableScrollbar,
37
38
  children = props.children,
38
39
  antModalProps = _objectWithoutPropertiesLoose(props, _excluded);
39
40
  var className = classnames("bodybg-" + bodyBackground, antModalProps.className, {
@@ -41,7 +42,6 @@ export var Modal = function Modal(props) {
41
42
  }, {
42
43
  'with-description': Boolean(description)
43
44
  });
44
- var mainSlideRef = useRef(null);
45
45
  var DEFAULT_VIEWPORT_HEIGHT = 80;
46
46
  var maxHeight = function maxHeight() {
47
47
  if (maxViewportHeight !== undefined) {
@@ -61,9 +61,7 @@ export var Modal = function Modal(props) {
61
61
  closable: false,
62
62
  title: (title || description || blank || headerBottomBar) && /*#__PURE__*/React.createElement(ModalTitle, props),
63
63
  footer: antModalProps.footer !== null ? antModalProps.footer || /*#__PURE__*/React.createElement(ModalFooter, props) : null
64
- }), maxHeight() ? /*#__PURE__*/React.createElement(S.ModalWrapper, {
65
- ref: mainSlideRef
66
- }, /*#__PURE__*/React.createElement(S.Scrollbar, {
64
+ }), maxHeight() && !disableScrollbar ? /*#__PURE__*/React.createElement(S.ModalWrapper, null, /*#__PURE__*/React.createElement(S.Scrollbar, {
67
65
  absolute: true
68
66
  }, children)) : children);
69
67
  };
@@ -8,19 +8,30 @@ export type ModalProps = {
8
8
  * @deprecated - this prop will be removed soon
9
9
  */
10
10
  description?: ReactNode;
11
+ /** Content rendered below the modal header */
11
12
  headerBottomBar?: ReactNode;
13
+ /** Actions rendered in the top-right area of the header */
12
14
  headerActions?: ReactNode;
15
+ /** Props forwarded to the Tabs component rendered in the header */
13
16
  headerTabProps?: TabsProps;
17
+ /** Predefined modal width */
14
18
  size?: 'small' | 'medium' | 'large' | 'extraLarge' | 'fullSize' | 'fullScreen';
19
+ /** Background color of the modal body */
15
20
  bodyBackground?: 'white' | 'grey';
21
+ /** Renders a minimal modal without header and footer chrome */
16
22
  blank?: boolean;
23
+ /** Custom styles applied to the title container */
17
24
  titleContainerStyle?: CSSProperties;
25
+ /** Localised button labels */
18
26
  texts?: {
19
27
  okButton?: ReactNode;
20
28
  cancelButton?: ReactNode;
21
29
  };
22
30
  children?: ReactNode;
31
+ /** Constrains modal height to a percentage of the viewport and wraps children in a scrollbar. Pass `true` for 80 vh or a number for a custom value. */
23
32
  maxViewportHeight?: true | number;
33
+ /** When `true`, disables the automatic scrollbar wrapping applied by `maxViewportHeight` */
34
+ disableScrollbar?: boolean;
24
35
  } & AntdModalProps & ModalFooterBuilder;
25
36
  export type ModalFooterBuilder = {
26
37
  prefix?: ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-modal",
3
- "version": "1.3.8",
3
+ "version": "1.4.0",
4
4
  "description": "Modal UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -23,8 +23,8 @@
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,11 +35,11 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
- "@synerise/ds-button": "^1.5.15",
39
- "@synerise/ds-icon": "^1.14.1",
40
- "@synerise/ds-scrollbar": "^1.2.14",
41
- "@synerise/ds-tabs": "^1.1.21",
42
- "@synerise/ds-typography": "^1.1.10",
38
+ "@synerise/ds-button": "^1.5.17",
39
+ "@synerise/ds-icon": "^1.15.0",
40
+ "@synerise/ds-scrollbar": "^1.2.16",
41
+ "@synerise/ds-tabs": "^1.1.23",
42
+ "@synerise/ds-typography": "^1.1.12",
43
43
  "classnames": "^2.5.1"
44
44
  },
45
45
  "devDependencies": {
@@ -51,5 +51,5 @@
51
51
  "react": ">=16.9.0 <= 18.3.1",
52
52
  "styled-components": "^5.3.3"
53
53
  },
54
- "gitHead": "2997f77d657c1aed2fc39901d3e0b8f88b05cc53"
54
+ "gitHead": "8efc031fa688c0b87c7b3915bae93546bb63bcac"
55
55
  }