@synerise/ds-modal 1.3.9 → 1.4.1

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.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@1.4.0...@synerise/ds-modal@1.4.1) (2026-03-24)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-modal
9
+
10
+ # [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)
11
+
12
+ ### Features
13
+
14
+ - **modal:** disableScrollbar prop ([d6a80ec](https://github.com/synerise/synerise-design/commit/d6a80ec2a5394703974d2b369f25a13fc4e5eeb0))
15
+
6
16
  ## [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)
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
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type ModalProps } from '../../Modal.types';
1
+ import { default as React } from 'react';
2
+ import { ModalProps } from '../../Modal.types';
3
3
  export type ModalFooterProps = Pick<ModalProps, 'prefix' | 'infix' | 'suffix' | 'okButton' | 'cancelButton' | 'CustomFooterButton' | 'DSButton' | 'texts' | 'onOk' | 'onCancel' | 'cancelText' | 'okText' | 'cancelButtonProps' | 'okType' | 'okButtonProps'>;
4
4
  export declare const ModalFooter: ({ CustomFooterButton, DSButton, prefix, infix, suffix, ...antModalProps }: ModalFooterProps) => React.JSX.Element;
@@ -1,35 +1,31 @@
1
- var _excluded = ["CustomFooterButton", "DSButton", "prefix", "infix", "suffix"];
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 Button from '@synerise/ds-button';
6
- import * as S from './ModalFooter.styles';
7
- export var ModalFooter = function ModalFooter(_ref) {
8
- var _ref$CustomFooterButt = _ref.CustomFooterButton,
9
- CustomFooterButton = _ref$CustomFooterButt === void 0 ? Button : _ref$CustomFooterButt,
10
- _ref$DSButton = _ref.DSButton,
11
- DSButton = _ref$DSButton === void 0 ? Button : _ref$DSButton,
12
- prefix = _ref.prefix,
13
- infix = _ref.infix,
14
- suffix = _ref.suffix,
15
- antModalProps = _objectWithoutPropertiesLoose(_ref, _excluded);
16
- var onOk = antModalProps.onOk,
17
- onCancel = antModalProps.onCancel,
18
- _antModalProps$texts = antModalProps.texts,
19
- texts = _antModalProps$texts === void 0 ? {
20
- okButton: 'Apply',
21
- cancelButton: 'Cancel'
22
- } : _antModalProps$texts;
23
- var CustomButton = CustomFooterButton || DSButton;
24
- return /*#__PURE__*/React.createElement(S.FooterContainer, {
25
- "data-testid": "modal-footer"
26
- }, prefix, antModalProps.cancelButton || /*#__PURE__*/React.createElement(CustomButton, _extends({
27
- type: "ghost",
28
- onClick: onCancel,
29
- disabled: !onCancel
30
- }, antModalProps.cancelButtonProps), antModalProps.cancelText || (texts == null ? void 0 : texts.cancelButton)), infix, antModalProps.okButton || /*#__PURE__*/React.createElement(CustomButton, _extends({
31
- type: antModalProps.okType || 'primary',
32
- onClick: onOk,
33
- disabled: !onOk
34
- }, antModalProps.okButtonProps), antModalProps.okText || (texts == null ? void 0 : texts.okButton)), suffix);
35
- };
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import Button from "@synerise/ds-button";
3
+ import { FooterContainer } from "./ModalFooter.styles.js";
4
+ const ModalFooter = ({
5
+ CustomFooterButton = Button,
6
+ DSButton = Button,
7
+ prefix,
8
+ infix,
9
+ suffix,
10
+ ...antModalProps
11
+ }) => {
12
+ const {
13
+ onOk,
14
+ onCancel,
15
+ texts = {
16
+ okButton: "Apply",
17
+ cancelButton: "Cancel"
18
+ }
19
+ } = antModalProps;
20
+ const CustomButton = CustomFooterButton || DSButton;
21
+ return /* @__PURE__ */ jsxs(FooterContainer, { "data-testid": "modal-footer", children: [
22
+ prefix,
23
+ antModalProps.cancelButton || /* @__PURE__ */ jsx(CustomButton, { type: "ghost", onClick: onCancel, disabled: !onCancel, ...antModalProps.cancelButtonProps, children: antModalProps.cancelText || texts?.cancelButton }),
24
+ infix,
25
+ antModalProps.okButton || /* @__PURE__ */ jsx(CustomButton, { type: antModalProps.okType || "primary", onClick: onOk, disabled: !onOk, ...antModalProps.okButtonProps, children: antModalProps.okText || texts?.okButton }),
26
+ suffix
27
+ ] });
28
+ };
29
+ export {
30
+ ModalFooter
31
+ };
@@ -1,2 +1,2 @@
1
- export declare const FooterContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const CustomFooterContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
1
+ export declare const FooterContainer: import('styled-components').StyledComponent<"div", any, {}, never>;
2
+ export declare const CustomFooterContainer: import('styled-components').StyledComponent<"div", any, {}, never>;
@@ -1,9 +1,13 @@
1
- import styled from 'styled-components';
2
- export var FooterContainer = styled.div.withConfig({
1
+ import styled from "styled-components";
2
+ const FooterContainer = /* @__PURE__ */ styled.div.withConfig({
3
3
  displayName: "ModalFooterstyles__FooterContainer",
4
4
  componentId: "sc-1h4mu26-0"
5
5
  })(["display:flex;align-items:center;justify-content:flex-end;"]);
6
- export var CustomFooterContainer = styled.div.withConfig({
6
+ const CustomFooterContainer = /* @__PURE__ */ styled.div.withConfig({
7
7
  displayName: "ModalFooterstyles__CustomFooterContainer",
8
8
  componentId: "sc-1h4mu26-1"
9
- })(["display:flex;flex-wrap:nowrap;"]);
9
+ })(["display:flex;flex-wrap:nowrap;"]);
10
+ export {
11
+ CustomFooterContainer,
12
+ FooterContainer
13
+ };
@@ -1 +1,4 @@
1
- export * from './ModalFooter';
1
+ import { ModalFooter } from "./ModalFooter.js";
2
+ export {
3
+ ModalFooter
4
+ };
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { type ModalProps } from '../../Modal.types';
1
+ import { default as React } from 'react';
2
+ import { ModalProps } from '../../Modal.types';
3
3
  type ModalTitleProps = Pick<ModalProps, 'headerActions' | 'headerTabProps' | 'onCancel' | 'titleContainerStyle' | 'blank' | 'description' | 'title' | 'headerBottomBar'>;
4
4
  export declare const ModalTitle: ({ headerActions, blank, titleContainerStyle, onCancel, title, description, headerTabProps, headerBottomBar, }: ModalTitleProps) => React.JSX.Element;
5
5
  export {};
@@ -1,40 +1,34 @@
1
- import React from 'react';
2
- import Button from '@synerise/ds-button';
3
- import Icon, { CloseM } from '@synerise/ds-icon';
4
- import Tabs from '@synerise/ds-tabs';
5
- import * as S from './ModalTitle.styles';
6
- export var ModalTitle = function ModalTitle(_ref) {
7
- var headerActions = _ref.headerActions,
8
- blank = _ref.blank,
9
- titleContainerStyle = _ref.titleContainerStyle,
10
- onCancel = _ref.onCancel,
11
- title = _ref.title,
12
- description = _ref.description,
13
- headerTabProps = _ref.headerTabProps,
14
- headerBottomBar = _ref.headerBottomBar;
15
- return /*#__PURE__*/React.createElement(React.Fragment, null, blank && onCancel && /*#__PURE__*/React.createElement(Button, {
16
- mode: "single-icon",
17
- "data-testid": "modal-close",
18
- className: "close-modal",
19
- type: "ghost",
20
- onClick: onCancel
21
- }, /*#__PURE__*/React.createElement(Icon, {
22
- component: /*#__PURE__*/React.createElement(CloseM, null)
23
- })), (title || description || headerTabProps) && /*#__PURE__*/React.createElement(S.ModalTitleWrapper, {
24
- withDescription: !!description,
25
- withTabs: !!headerTabProps
26
- }, title && /*#__PURE__*/React.createElement(S.TitleContainer, {
27
- style: titleContainerStyle,
28
- "data-testid": "modal-title"
29
- }, /*#__PURE__*/React.createElement(S.Title, {
30
- level: 3
31
- }, title), /*#__PURE__*/React.createElement(S.ActionButtons, null, headerActions, onCancel && /*#__PURE__*/React.createElement(Button, {
32
- mode: "single-icon",
33
- "data-testid": "modal-close",
34
- className: "close-modal",
35
- type: "ghost",
36
- onClick: onCancel
37
- }, /*#__PURE__*/React.createElement(Icon, {
38
- component: /*#__PURE__*/React.createElement(CloseM, null)
39
- })))), description && /*#__PURE__*/React.createElement(S.Description, null, description), headerTabProps && /*#__PURE__*/React.createElement(S.TabsWrapper, null, /*#__PURE__*/React.createElement(Tabs, headerTabProps))), headerBottomBar && /*#__PURE__*/React.createElement(S.BottomBar, null, headerBottomBar));
40
- };
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import Button from "@synerise/ds-button";
3
+ import Icon, { CloseM } from "@synerise/ds-icon";
4
+ import Tabs from "@synerise/ds-tabs";
5
+ import { ModalTitleWrapper, TitleContainer, Title, ActionButtons, Description, TabsWrapper, BottomBar } from "./ModalTitle.styles.js";
6
+ const ModalTitle = ({
7
+ headerActions,
8
+ blank,
9
+ titleContainerStyle,
10
+ onCancel,
11
+ title,
12
+ description,
13
+ headerTabProps,
14
+ headerBottomBar
15
+ }) => {
16
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
17
+ blank && onCancel && /* @__PURE__ */ jsx(Button, { mode: "single-icon", "data-testid": "modal-close", className: "close-modal", type: "ghost", onClick: onCancel, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(CloseM, {}) }) }),
18
+ (title || description || headerTabProps) && /* @__PURE__ */ jsxs(ModalTitleWrapper, { withDescription: !!description, withTabs: !!headerTabProps, children: [
19
+ title && /* @__PURE__ */ jsxs(TitleContainer, { style: titleContainerStyle, "data-testid": "modal-title", children: [
20
+ /* @__PURE__ */ jsx(Title, { level: 3, children: title }),
21
+ /* @__PURE__ */ jsxs(ActionButtons, { children: [
22
+ headerActions,
23
+ onCancel && /* @__PURE__ */ jsx(Button, { mode: "single-icon", "data-testid": "modal-close", className: "close-modal", type: "ghost", onClick: onCancel, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(CloseM, {}) }) })
24
+ ] })
25
+ ] }),
26
+ description && /* @__PURE__ */ jsx(Description, { children: description }),
27
+ headerTabProps && /* @__PURE__ */ jsx(TabsWrapper, { children: /* @__PURE__ */ jsx(Tabs, { ...headerTabProps }) })
28
+ ] }),
29
+ headerBottomBar && /* @__PURE__ */ jsx(BottomBar, { children: headerBottomBar })
30
+ ] });
31
+ };
32
+ export {
33
+ ModalTitle
34
+ };
@@ -1,10 +1,10 @@
1
- export declare const TitleContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const Title: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/lib/typography/Title").TitleProps & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
3
- export declare const ActionButtons: import("styled-components").StyledComponent<"div", any, {}, never>;
4
- export declare const BottomBar: import("styled-components").StyledComponent<"div", any, {}, never>;
5
- export declare const ModalTitleWrapper: import("styled-components").StyledComponent<"div", any, {
1
+ export declare const TitleContainer: import('styled-components').StyledComponent<"div", any, {}, never>;
2
+ export declare const Title: import('styled-components').StyledComponent<import('react').ForwardRefExoticComponent<import('antd/lib/typography/Title').TitleProps & import('react').RefAttributes<HTMLElement>>, any, {}, never>;
3
+ export declare const ActionButtons: import('styled-components').StyledComponent<"div", any, {}, never>;
4
+ export declare const BottomBar: import('styled-components').StyledComponent<"div", any, {}, never>;
5
+ export declare const ModalTitleWrapper: import('styled-components').StyledComponent<"div", any, {
6
6
  withDescription?: boolean;
7
7
  withTabs?: boolean;
8
8
  }, never>;
9
- export declare const Description: import("styled-components").StyledComponent<"div", any, {}, never>;
10
- export declare const TabsWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
9
+ export declare const Description: import('styled-components').StyledComponent<"div", any, {}, never>;
10
+ export declare const TabsWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
@@ -1,6 +1,6 @@
1
- import styled from 'styled-components';
2
- import Typography from '@synerise/ds-typography';
3
- var getBottomPadding = function getBottomPadding(withTabs, withDescription) {
1
+ import styled from "styled-components";
2
+ import Typography from "@synerise/ds-typography";
3
+ const getBottomPadding = (withTabs, withDescription) => {
4
4
  if (withTabs) {
5
5
  return 0;
6
6
  }
@@ -9,43 +9,40 @@ var getBottomPadding = function getBottomPadding(withTabs, withDescription) {
9
9
  }
10
10
  return 20;
11
11
  };
12
- export var TitleContainer = styled.div.withConfig({
12
+ const TitleContainer = /* @__PURE__ */ styled.div.withConfig({
13
13
  displayName: "ModalTitlestyles__TitleContainer",
14
14
  componentId: "sc-hnk65g-0"
15
15
  })(["display:flex;align-items:center;flex-wrap:nowrap;&&{.close-modal{line-height:1;}}"]);
16
- export var Title = styled(Typography.Title).withConfig({
16
+ const Title = /* @__PURE__ */ styled(Typography.Title).withConfig({
17
17
  displayName: "ModalTitlestyles__Title",
18
18
  componentId: "sc-hnk65g-1"
19
- })(["width:100%;color:", ";white-space:nowrap;overflow:hidden;text-overflow:ellipsis;&&{margin:0;}"], function (props) {
20
- return props.theme.palette['grey-800'];
21
- });
22
- export var ActionButtons = styled.div.withConfig({
19
+ })(["width:100%;color:", ";white-space:nowrap;overflow:hidden;text-overflow:ellipsis;&&{margin:0;}"], (props) => props.theme.palette["grey-800"]);
20
+ const ActionButtons = /* @__PURE__ */ styled.div.withConfig({
23
21
  displayName: "ModalTitlestyles__ActionButtons",
24
22
  componentId: "sc-hnk65g-2"
25
23
  })(["display:flex;flex-direction:row;align-items:center;.ant-btn{margin:0 4px;}.close-modal{padding:0;display:flex;align-items:center;justify-content:center;margin-right:0;}"]);
26
- export var BottomBar = styled.div.withConfig({
24
+ const BottomBar = /* @__PURE__ */ styled.div.withConfig({
27
25
  displayName: "ModalTitlestyles__BottomBar",
28
26
  componentId: "sc-hnk65g-3"
29
- })(["padding:12px 24px;border-bottom:1px solid ", ";"], function (props) {
30
- return props.theme.palette['grey-100'];
31
- });
32
- export var ModalTitleWrapper = styled.div.withConfig({
27
+ })(["padding:12px 24px;border-bottom:1px solid ", ";"], (props) => props.theme.palette["grey-100"]);
28
+ const ModalTitleWrapper = /* @__PURE__ */ styled.div.withConfig({
33
29
  displayName: "ModalTitlestyles__ModalTitleWrapper",
34
30
  componentId: "sc-hnk65g-4"
35
- })(["padding:20px 24px;padding-bottom:", "px;font-size:18px;line-height:32px;border-bottom:1px solid ", ";"], function (props) {
36
- return getBottomPadding(!!props.withTabs, !!props.withDescription);
37
- }, function (props) {
38
- return props.theme.palette['grey-100'];
39
- });
40
- export var Description = styled.div.withConfig({
31
+ })(["padding:20px 24px;padding-bottom:", "px;font-size:18px;line-height:32px;border-bottom:1px solid ", ";"], (props) => getBottomPadding(!!props.withTabs, !!props.withDescription), (props) => props.theme.palette["grey-100"]);
32
+ const Description = /* @__PURE__ */ styled.div.withConfig({
41
33
  displayName: "ModalTitlestyles__Description",
42
34
  componentId: "sc-hnk65g-5"
43
- })(["font-size:13px;font-weight:normal;line-height:18px;color:", ";display:block;padding:12px 0 0;margin:14px 0 0;background-image:linear-gradient( to right,", " 33%,rgba(255,255,255,0) 0% );background-repeat:repeat-x;background-size:4px 1px;background-position:top;"], function (props) {
44
- return props.theme.palette['grey-600'];
45
- }, function (props) {
46
- return props.theme.palette['grey-300'];
47
- });
48
- export var TabsWrapper = styled.div.withConfig({
35
+ })(["font-size:13px;font-weight:normal;line-height:18px;color:", ";display:block;padding:12px 0 0;margin:14px 0 0;background-image:linear-gradient( to right,", " 33%,rgba(255,255,255,0) 0% );background-repeat:repeat-x;background-size:4px 1px;background-position:top;"], (props) => props.theme.palette["grey-600"], (props) => props.theme.palette["grey-300"]);
36
+ const TabsWrapper = /* @__PURE__ */ styled.div.withConfig({
49
37
  displayName: "ModalTitlestyles__TabsWrapper",
50
38
  componentId: "sc-hnk65g-6"
51
- })(["padding-bottom:1px;"]);
39
+ })(["padding-bottom:1px;"]);
40
+ export {
41
+ ActionButtons,
42
+ BottomBar,
43
+ Description,
44
+ ModalTitleWrapper,
45
+ TabsWrapper,
46
+ Title,
47
+ TitleContainer
48
+ };
@@ -1,2 +1,6 @@
1
- export * from './ModalTitle';
2
- export { TitleContainer } from './ModalTitle.styles';
1
+ import { ModalTitle } from "./ModalTitle.js";
2
+ import { TitleContainer } from "./ModalTitle.styles.js";
3
+ export {
4
+ ModalTitle,
5
+ TitleContainer
6
+ };
package/dist/Modal.d.ts CHANGED
@@ -1,16 +1,14 @@
1
- import React from 'react';
2
- import '@synerise/ds-core/dist/js/style';
3
- import { type ModalFooterProps } from './Elements/ModalFooter';
4
- import type { ModalProps } from './Modal.types';
5
- import './style/index.less';
1
+ import { default as React } from 'react';
2
+ import { ModalFooterProps } from './Elements/ModalFooter';
3
+ import { ModalProps } from './Modal.types';
6
4
  /** @deprecated */
7
5
  export declare const buildModalFooter: (props: ModalFooterProps) => React.JSX.Element;
8
6
  export declare const Modal: {
9
7
  (props: ModalProps): React.JSX.Element;
10
- info: import("antd/lib/modal/confirm").ModalFunc;
11
- success: import("antd/lib/modal/confirm").ModalFunc;
12
- error: import("antd/lib/modal/confirm").ModalFunc;
13
- warning: import("antd/lib/modal/confirm").ModalFunc;
14
- confirm: import("antd/lib/modal/confirm").ModalFunc;
8
+ info: import('antd/lib/modal/confirm').ModalFunc;
9
+ success: import('antd/lib/modal/confirm').ModalFunc;
10
+ error: import('antd/lib/modal/confirm').ModalFunc;
11
+ warning: import('antd/lib/modal/confirm').ModalFunc;
12
+ confirm: import('antd/lib/modal/confirm').ModalFunc;
15
13
  };
16
14
  export default Modal;
package/dist/Modal.js CHANGED
@@ -1,75 +1,62 @@
1
- var _excluded = ["texts", "bodyBackground", "headerActions", "title", "description", "headerBottomBar", "size", "blank", "titleContainerStyle", "maxViewportHeight", "children"];
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 { Modal as AntModal } from 'antd';
5
- import classnames from 'classnames';
6
- import React, { useRef } from 'react';
7
- import '@synerise/ds-core/dist/js/style';
8
- import { ModalFooter } from './Elements/ModalFooter';
9
- import { ModalTitle } from './Elements/ModalTitle';
10
- import * as S from './Modal.styles';
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Modal as Modal$1 } from "antd";
3
+ import classnames from "classnames";
4
+ import { ModalFooter } from "./Elements/ModalFooter/ModalFooter.js";
5
+ import { ModalTitle } from "./Elements/ModalTitle/ModalTitle.js";
6
+ import "styled-components";
7
+ import "@synerise/ds-typography";
8
+ import { AntdModal, ModalWrapper, Scrollbar } from "./Modal.styles.js";
11
9
  import "./style/index.css";
12
- var mapSizeToWidth = {
10
+ const mapSizeToWidth = {
13
11
  small: 520,
14
12
  medium: 792,
15
13
  large: 1044,
16
14
  extraLarge: 1280,
17
- fullSize: '100%',
18
- fullScreen: '100%'
15
+ fullSize: "100%",
16
+ fullScreen: "100%"
19
17
  };
20
-
21
- /** @deprecated */
22
- export var buildModalFooter = function buildModalFooter(props) {
23
- return /*#__PURE__*/React.createElement(ModalFooter, props);
24
- };
25
- export var Modal = function Modal(props) {
26
- var texts = props.texts,
27
- _props$bodyBackground = props.bodyBackground,
28
- bodyBackground = _props$bodyBackground === void 0 ? 'white' : _props$bodyBackground,
29
- headerActions = props.headerActions,
30
- title = props.title,
31
- description = props.description,
32
- headerBottomBar = props.headerBottomBar,
33
- size = props.size,
34
- blank = props.blank,
35
- titleContainerStyle = props.titleContainerStyle,
36
- maxViewportHeight = props.maxViewportHeight,
37
- children = props.children,
38
- antModalProps = _objectWithoutPropertiesLoose(props, _excluded);
39
- var className = classnames("bodybg-" + bodyBackground, antModalProps.className, {
40
- 'modal-blank': Boolean(blank)
18
+ const buildModalFooter = (props) => /* @__PURE__ */ jsx(ModalFooter, { ...props });
19
+ const Modal = (props) => {
20
+ const {
21
+ texts,
22
+ bodyBackground = "white",
23
+ headerActions,
24
+ title,
25
+ description,
26
+ headerBottomBar,
27
+ size,
28
+ blank,
29
+ titleContainerStyle,
30
+ maxViewportHeight,
31
+ disableScrollbar,
32
+ children,
33
+ ...antModalProps
34
+ } = props;
35
+ const className = classnames(`bodybg-${bodyBackground}`, antModalProps.className, {
36
+ "modal-blank": Boolean(blank)
41
37
  }, {
42
- 'with-description': Boolean(description)
38
+ "with-description": Boolean(description)
43
39
  });
44
- var mainSlideRef = useRef(null);
45
- var DEFAULT_VIEWPORT_HEIGHT = 80;
46
- var maxHeight = function maxHeight() {
47
- if (maxViewportHeight !== undefined) {
48
- if (typeof maxViewportHeight === 'number') {
40
+ const DEFAULT_VIEWPORT_HEIGHT = 80;
41
+ const maxHeight = () => {
42
+ if (maxViewportHeight !== void 0) {
43
+ if (typeof maxViewportHeight === "number") {
49
44
  return maxViewportHeight;
50
45
  }
51
46
  return DEFAULT_VIEWPORT_HEIGHT;
52
47
  }
53
- return undefined;
48
+ return void 0;
54
49
  };
55
- var isFullscreen = size === 'fullScreen';
56
- return /*#__PURE__*/React.createElement(S.AntdModal, _extends({}, antModalProps, {
57
- maxHeight: maxHeight(),
58
- className: className,
59
- isFullscreen: isFullscreen,
60
- width: size && mapSizeToWidth[size],
61
- closable: false,
62
- title: (title || description || blank || headerBottomBar) && /*#__PURE__*/React.createElement(ModalTitle, props),
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, {
67
- absolute: true
68
- }, children)) : children);
50
+ const isFullscreen = size === "fullScreen";
51
+ return /* @__PURE__ */ jsx(AntdModal, { ...antModalProps, maxHeight: maxHeight(), className, isFullscreen, width: size && mapSizeToWidth[size], closable: false, title: (title || description || blank || headerBottomBar) && /* @__PURE__ */ jsx(ModalTitle, { ...props }), footer: antModalProps.footer !== null ? antModalProps.footer || /* @__PURE__ */ jsx(ModalFooter, { ...props }) : null, children: maxHeight() && !disableScrollbar ? /* @__PURE__ */ jsx(ModalWrapper, { children: /* @__PURE__ */ jsx(Scrollbar, { absolute: true, children }) }) : children });
52
+ };
53
+ Modal.info = Modal$1.info;
54
+ Modal.success = Modal$1.success;
55
+ Modal.error = Modal$1.error;
56
+ Modal.warning = Modal$1.warning;
57
+ Modal.confirm = Modal$1.confirm;
58
+ export {
59
+ Modal,
60
+ buildModalFooter,
61
+ Modal as default
69
62
  };
70
- Modal.info = AntModal.info;
71
- Modal.success = AntModal.success;
72
- Modal.error = AntModal.error;
73
- Modal.warning = AntModal.warning;
74
- Modal.confirm = AntModal.confirm;
75
- export default Modal;
@@ -1,12 +1,12 @@
1
- export declare const SettingButton: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const ButtonsWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const Scrollbar: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<(import("@synerise/ds-scrollbar").ScrollbarProps | import("@synerise/ds-scrollbar").VirtualScrollbarProps) & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
4
- export declare const AntdModal: import("styled-components").StyledComponent<import("react").FC<import("antd/lib/modal").ModalProps> & import("antd/lib/modal/confirm").ModalStaticFunctions & {
5
- useModal: typeof import("antd/lib/modal/useModal").default;
1
+ export declare const SettingButton: import('styled-components').StyledComponent<"div", any, {}, never>;
2
+ export declare const ButtonsWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
3
+ export declare const Scrollbar: import('styled-components').StyledComponent<import('react').ForwardRefExoticComponent<(import('@synerise/ds-scrollbar').ScrollbarProps | import('@synerise/ds-scrollbar').VirtualScrollbarProps) & import('react').RefAttributes<HTMLElement>>, any, {}, never>;
4
+ export declare const AntdModal: import('styled-components').StyledComponent<import('react').FC<import('antd/lib/modal').ModalProps> & import('antd/lib/modal/confirm').ModalStaticFunctions & {
5
+ useModal: typeof import('antd/lib/modal/useModal').default;
6
6
  destroyAll: () => void;
7
- config: typeof import("antd/lib/modal/confirm").modalGlobalConfig;
7
+ config: typeof import('antd/lib/modal/confirm').modalGlobalConfig;
8
8
  }, any, {
9
9
  isFullscreen?: boolean;
10
10
  maxHeight?: number;
11
11
  }, never>;
12
- export declare const ModalWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
12
+ export declare const ModalWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
@@ -1,27 +1,30 @@
1
- import Modal from 'antd/lib/modal';
2
- import styled, { css } from 'styled-components';
3
- import ScrollbarBase from '@synerise/ds-scrollbar';
4
- export var SettingButton = styled.div.withConfig({
1
+ import Modal from "antd/lib/modal";
2
+ import styled, { css } from "styled-components";
3
+ import ScrollbarBase from "@synerise/ds-scrollbar";
4
+ const SettingButton = /* @__PURE__ */ styled.div.withConfig({
5
5
  displayName: "Modalstyles__SettingButton",
6
6
  componentId: "sc-jdspxw-0"
7
7
  })(["display:flex;width:100%;"]);
8
- export var ButtonsWrapper = styled.div.withConfig({
8
+ const ButtonsWrapper = /* @__PURE__ */ styled.div.withConfig({
9
9
  displayName: "Modalstyles__ButtonsWrapper",
10
10
  componentId: "sc-jdspxw-1"
11
11
  })(["display:flex;"]);
12
- export var Scrollbar = styled(ScrollbarBase).withConfig({
12
+ const Scrollbar = /* @__PURE__ */ styled(ScrollbarBase).withConfig({
13
13
  displayName: "Modalstyles__Scrollbar",
14
14
  componentId: "sc-jdspxw-2"
15
15
  })(["display:flex;flex-direction:column;min-height:0;.scrollbar-container{min-height:0;}"]);
16
- export var AntdModal = styled(Modal).withConfig({
16
+ const AntdModal = /* @__PURE__ */ styled(Modal).withConfig({
17
17
  displayName: "Modalstyles__AntdModal",
18
18
  componentId: "sc-jdspxw-3"
19
- })(["", " ", ""], function (props) {
20
- return props.isFullscreen && css(["&&{position:fixed;top:0;left:0;right:0;bottom:0;margin:0;max-width:none;padding:0;.ant-modal-content{display:flex;flex-direction:column;height:100%;}.ant-modal-body{flex:1 1 100%;overflow:scroll;}}"]);
21
- }, function (props) {
22
- return props.maxHeight && css(["&&{position:fixed;left:50%;bottom:0;translate:-50%;.ant-modal-content{max-height:", "vh;display:flex;flex-direction:column;}.ant-modal-body{flex:1 1 100%;overflow:scroll;padding-right:0px;display:flex;flex-direction:column;min-height:0;}}"], props.maxHeight);
23
- });
24
- export var ModalWrapper = styled.div.withConfig({
19
+ })(["", " ", ""], (props) => props.isFullscreen && css(["&&{position:fixed;top:0;left:0;right:0;bottom:0;margin:0;max-width:none;padding:0;.ant-modal-content{display:flex;flex-direction:column;height:100%;}.ant-modal-body{flex:1 1 100%;overflow:scroll;}}"]), (props) => props.maxHeight && css(["&&{position:fixed;left:50%;bottom:0;translate:-50%;.ant-modal-content{max-height:", "vh;display:flex;flex-direction:column;}.ant-modal-body{flex:1 1 100%;overflow:scroll;padding-right:0px;display:flex;flex-direction:column;min-height:0;}}"], props.maxHeight));
20
+ const ModalWrapper = /* @__PURE__ */ styled.div.withConfig({
25
21
  displayName: "Modalstyles__ModalWrapper",
26
22
  componentId: "sc-jdspxw-4"
27
- })(["position:relative;height:100%;min-height:0;display:flex;flex-direction:column;overflow:hidden;"]);
23
+ })(["position:relative;height:100%;min-height:0;display:flex;flex-direction:column;overflow:hidden;"]);
24
+ export {
25
+ AntdModal,
26
+ ButtonsWrapper,
27
+ ModalWrapper,
28
+ Scrollbar,
29
+ SettingButton
30
+ };
@@ -1,26 +1,37 @@
1
- import { type ModalProps as AntdModalProps } from 'antd/lib/modal';
2
- import type { CSSProperties, ComponentType, ReactNode } from 'react';
3
- import { type ButtonProps } from '@synerise/ds-button';
4
- import { type TabsProps } from '@synerise/ds-tabs';
1
+ import { ModalProps as AntdModalProps } from 'antd/lib/modal';
2
+ import { CSSProperties, ComponentType, ReactNode } from 'react';
3
+ import { ButtonProps } from '@synerise/ds-button';
4
+ import { TabsProps } from '@synerise/ds-tabs';
5
5
  export type Props = ModalProps;
6
6
  export type ModalProps = {
7
7
  /**
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;
@@ -1 +1 @@
1
- export {};
1
+
File without changes
package/dist/index.js CHANGED
@@ -1,3 +1,11 @@
1
- export { default, buildModalFooter } from './Modal';
2
- export { ModalTitle, TitleContainer } from './Elements/ModalTitle';
3
- export { ModalFooter } from './Elements/ModalFooter';
1
+ import { buildModalFooter, Modal } from "./Modal.js";
2
+ import { ModalTitle } from "./Elements/ModalTitle/ModalTitle.js";
3
+ import { TitleContainer } from "./Elements/ModalTitle/ModalTitle.styles.js";
4
+ import { ModalFooter } from "./Elements/ModalFooter/ModalFooter.js";
5
+ export {
6
+ ModalFooter,
7
+ ModalTitle,
8
+ TitleContainer,
9
+ buildModalFooter,
10
+ Modal as default
11
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-modal",
3
- "version": "1.3.9",
3
+ "version": "1.4.1",
4
4
  "description": "Modal 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,11 +35,11 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
- "@synerise/ds-button": "^1.5.16",
39
- "@synerise/ds-icon": "^1.14.1",
40
- "@synerise/ds-scrollbar": "^1.2.15",
41
- "@synerise/ds-tabs": "^1.1.22",
42
- "@synerise/ds-typography": "^1.1.11",
38
+ "@synerise/ds-button": "^1.5.18",
39
+ "@synerise/ds-icon": "^1.15.1",
40
+ "@synerise/ds-scrollbar": "^1.2.17",
41
+ "@synerise/ds-tabs": "^1.1.24",
42
+ "@synerise/ds-typography": "^1.1.13",
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": "8dfafc5d7278f09d430f1e7499782d05c76b47c0"
54
+ "gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
55
55
  }