@synerise/ds-modal 1.4.0 → 1.4.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.4.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@1.4.1...@synerise/ds-modal@1.4.2) (2026-04-01)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-modal
9
+
10
+ ## [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)
11
+
12
+ **Note:** Version bump only for package @synerise/ds-modal
13
+
6
14
  # [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
15
 
8
16
  ### Features
@@ -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,73 +1,62 @@
1
- var _excluded = ["texts", "bodyBackground", "headerActions", "title", "description", "headerBottomBar", "size", "blank", "titleContainerStyle", "maxViewportHeight", "disableScrollbar", "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 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
- disableScrollbar = props.disableScrollbar,
38
- children = props.children,
39
- antModalProps = _objectWithoutPropertiesLoose(props, _excluded);
40
- var className = classnames("bodybg-" + bodyBackground, antModalProps.className, {
41
- '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)
42
37
  }, {
43
- 'with-description': Boolean(description)
38
+ "with-description": Boolean(description)
44
39
  });
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() && !disableScrollbar ? /*#__PURE__*/React.createElement(S.ModalWrapper, null, /*#__PURE__*/React.createElement(S.Scrollbar, {
65
- absolute: true
66
- }, 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
67
62
  };
68
- Modal.info = AntModal.info;
69
- Modal.success = AntModal.success;
70
- Modal.error = AntModal.error;
71
- Modal.warning = AntModal.warning;
72
- Modal.confirm = AntModal.confirm;
73
- 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,7 +1,7 @@
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
  /**
@@ -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.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "Modal 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 --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",
@@ -35,11 +35,11 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
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",
38
+ "@synerise/ds-button": "^1.5.19",
39
+ "@synerise/ds-icon": "^1.15.2",
40
+ "@synerise/ds-scrollbar": "^1.2.18",
41
+ "@synerise/ds-tabs": "^1.1.25",
42
+ "@synerise/ds-typography": "^1.1.14",
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": "8efc031fa688c0b87c7b3915bae93546bb63bcac"
54
+ "gitHead": "c2384982c3533a31eb5e5e0408f8dcecb2b0f399"
55
55
  }