@synerise/ds-modal 1.4.0 → 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 +4 -0
- package/dist/Elements/ModalFooter/ModalFooter.d.ts +2 -2
- package/dist/Elements/ModalFooter/ModalFooter.js +31 -35
- package/dist/Elements/ModalFooter/ModalFooter.styles.d.ts +2 -2
- package/dist/Elements/ModalFooter/ModalFooter.styles.js +8 -4
- package/dist/Elements/ModalFooter/index.js +4 -1
- package/dist/Elements/ModalTitle/ModalTitle.d.ts +2 -2
- package/dist/Elements/ModalTitle/ModalTitle.js +34 -40
- package/dist/Elements/ModalTitle/ModalTitle.styles.d.ts +7 -7
- package/dist/Elements/ModalTitle/ModalTitle.styles.js +24 -27
- package/dist/Elements/ModalTitle/index.js +6 -2
- package/dist/Modal.d.ts +8 -10
- package/dist/Modal.js +48 -59
- package/dist/Modal.styles.d.ts +7 -7
- package/dist/Modal.styles.js +17 -14
- package/dist/Modal.types.d.ts +4 -4
- package/dist/Modal.types.js +1 -1
- package/dist/assets/style/index-tn0RQdqM.css +0 -0
- package/dist/index.js +11 -3
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.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
|
+
|
|
6
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)
|
|
7
11
|
|
|
8
12
|
### Features
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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(
|
|
2
|
-
export declare const CustomFooterContainer: import(
|
|
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
|
|
2
|
-
|
|
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
|
-
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
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
|
|
2
|
-
import Button from
|
|
3
|
-
import Icon, { CloseM } from
|
|
4
|
-
import Tabs from
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"data-testid": "modal-close",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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(
|
|
2
|
-
export declare const Title: import(
|
|
3
|
-
export declare const ActionButtons: import(
|
|
4
|
-
export declare const BottomBar: import(
|
|
5
|
-
export declare const ModalTitleWrapper: import(
|
|
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(
|
|
10
|
-
export declare const TabsWrapper: import(
|
|
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
|
|
2
|
-
import Typography from
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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;}"],
|
|
20
|
-
|
|
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
|
-
|
|
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 ", ";"],
|
|
30
|
-
|
|
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 ", ";"],
|
|
36
|
-
|
|
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;"],
|
|
44
|
-
|
|
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
|
+
};
|
package/dist/Modal.d.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import '
|
|
3
|
-
import {
|
|
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(
|
|
11
|
-
success: import(
|
|
12
|
-
error: import(
|
|
13
|
-
warning: import(
|
|
14
|
-
confirm: import(
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
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
|
-
|
|
10
|
+
const mapSizeToWidth = {
|
|
13
11
|
small: 520,
|
|
14
12
|
medium: 792,
|
|
15
13
|
large: 1044,
|
|
16
14
|
extraLarge: 1280,
|
|
17
|
-
fullSize:
|
|
18
|
-
fullScreen:
|
|
15
|
+
fullSize: "100%",
|
|
16
|
+
fullScreen: "100%"
|
|
19
17
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
38
|
+
"with-description": Boolean(description)
|
|
44
39
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (maxViewportHeight !==
|
|
48
|
-
if (typeof maxViewportHeight ===
|
|
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
|
|
48
|
+
return void 0;
|
|
54
49
|
};
|
|
55
|
-
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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;
|
package/dist/Modal.styles.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export declare const SettingButton: import(
|
|
2
|
-
export declare const ButtonsWrapper: import(
|
|
3
|
-
export declare const Scrollbar: import(
|
|
4
|
-
export declare const AntdModal: import(
|
|
5
|
-
useModal: typeof import(
|
|
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(
|
|
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(
|
|
12
|
+
export declare const ModalWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
package/dist/Modal.styles.js
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
import Modal from
|
|
2
|
-
import styled, { css } from
|
|
3
|
-
import ScrollbarBase from
|
|
4
|
-
|
|
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
|
-
|
|
8
|
+
const ButtonsWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
9
9
|
displayName: "Modalstyles__ButtonsWrapper",
|
|
10
10
|
componentId: "sc-jdspxw-1"
|
|
11
11
|
})(["display:flex;"]);
|
|
12
|
-
|
|
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
|
-
|
|
16
|
+
const AntdModal = /* @__PURE__ */ styled(Modal).withConfig({
|
|
17
17
|
displayName: "Modalstyles__AntdModal",
|
|
18
18
|
componentId: "sc-jdspxw-3"
|
|
19
|
-
})(["", " ", ""],
|
|
20
|
-
|
|
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
|
+
};
|
package/dist/Modal.types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
/**
|
package/dist/Modal.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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.
|
|
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,10 +16,10 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
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": "
|
|
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.
|
|
39
|
-
"@synerise/ds-icon": "^1.15.
|
|
40
|
-
"@synerise/ds-scrollbar": "^1.2.
|
|
41
|
-
"@synerise/ds-tabs": "^1.1.
|
|
42
|
-
"@synerise/ds-typography": "^1.1.
|
|
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": "
|
|
54
|
+
"gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
|
|
55
55
|
}
|