@synerise/ds-modal 1.0.7 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.1.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@1.0.7...@synerise/ds-modal@1.1.0) (2025-05-19)
7
+
8
+
9
+ ### Features
10
+
11
+ * **modal:** fullScreen size ([a9d217d](https://github.com/synerise/synerise-design/commit/a9d217d0cc256f46adc95fd804bb9a7f389a4173))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [1.0.7](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@1.0.6...@synerise/ds-modal@1.0.7) (2025-05-07)
7
18
 
8
19
  **Note:** Version bump only for package @synerise/ds-modal
package/README.md CHANGED
@@ -20,6 +20,7 @@ npm install @synerise/ds-core
20
20
  ```
21
21
 
22
22
  ## Deprecated Features
23
+
23
24
  Some features of the Modal component have been deprecated. Please refer to the [API](#api) and [FOOTER](#modalfooter) section for more information on deprecated features.
24
25
 
25
26
  ## API
@@ -28,69 +29,70 @@ Some features of the Modal component have been deprecated. Please refer to the [
28
29
 
29
30
  ## ModalProps
30
31
 
31
- | Property | Description | Type | Default | Version |
32
- |---------------------|------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|-------------------------------------------------| ------- |
33
- | description | The modal dialog's description | string | - |
34
- | headerActions | Append additional content to header actions space | React.ReactNode | - |
35
- | size | The modal size | `small` / `medium` / `large` / `extraLarge`/ `fullSize`. | - |
36
- | bodyBackground | Set color for body of modal | `white` / `grey` | `white` |
37
- | blank | Modal with header which contains only close button | Boolean | `false` |
38
- | titleContainerStyle | The modal title's container styles object | React.CSSProperties / undefined | - |
39
- | settingButtonText | Text of the setting button | string | `Setting` |
40
- | texts | Labels to render | `{ okButton: string; cancelButton: string }` | `{ okButton: 'Apply', cancelButton: 'Cancel' }` |
41
- | children | Children element to render | `{ okButton: string; cancelButton: string }` | - |
42
- | visible | Whether the modal dialog is visible or not | boolean | `false` |
43
- | confirmLoading | Whether to apply loading visual effect for OK button or not | boolean | `false` |
44
- | title | The modal dialog's title | string / ReactNode | - |
45
- | closable | Whether a close (x) button is visible on top right of the modal dialog or not | boolean | `true` |
46
- | onOk | Specify a function that will be called when a user clicks the OK button | function(e) | - |
47
- | onCancel | Specify a function that will be called when a user clicks mask, close button on top right or Cancel button | function(e) | - |
48
- | afterClose | Specify a function that will be called when modal is closed completely. | function | - |
49
- | centered | Centered Modal | Boolean | `false` |
50
- | width | Width of the modal dialog | string / number | 520 |
51
- | footer | Footer content, set as `footer={null}` when you don't need default buttons | ReactNode | OK and Cancel buttons |
52
- | okText | Text of the OK button | string / ReactNode | `OK` |
53
- | okType | Button `type` of the OK button | string | `primary` |
54
- | cancelText | Text of the Cancel button | string / ReactNode | `Cancel` |
55
- | maskClosable | Whether to close the modal dialog when the mask (area outside the modal) is clicked | boolean | `true` |
56
- | forceRender | Force render Modal | boolean | `false` |
57
- | okButtonProps | The ok button props | [ButtonProps](/components/button) | - |
58
- | cancelButtonProps | The cancel button props | [ButtonProps](/components/button) | - |
59
- | destroyOnClose | Whether to unmount child components on onClose | boolean | `false` |
60
- | style | Style of floating layer, typically used at least for adjusting the position. | object | - |
61
- | wrapClassName | The class name of the container of the modal dialog | string | - |
62
- | getContainer | Return the mount node for Modal | HTMLElement / () => HTMLElement / Selectors /`false` | document.body |
63
- | zIndex | The `z-index` of the Modal | Number | 1000 |
64
- | bodyStyle | Body style for modal body element. Such as height, padding etc. | object | {} |
65
- | mask | Whether show mask or not. | Boolean | `true` |
66
- | closeIcon | custom close icon | ReactNode | - |
67
- | maskStyle | Style for modal's mask element. | object | {} |
32
+ | Property | Description | Type | Default | Version |
33
+ | ------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ----------------------------------------------- | ------- |
34
+ | description | The modal dialog's description | string | - |
35
+ | headerActions | Append additional content to header actions space | React.ReactNode | - |
36
+ | size | The modal size | `small` / `medium` / `large` / `extraLarge`/ `fullSize`/ `fullScreen`. | - |
37
+ | bodyBackground | Set color for body of modal | `white` / `grey` | `white` |
38
+ | blank | Modal with header which contains only close button | Boolean | `false` |
39
+ | titleContainerStyle | The modal title's container styles object | React.CSSProperties / undefined | - |
40
+ | settingButtonText | Text of the setting button | string | `Setting` |
41
+ | texts | Labels to render | `{ okButton: string; cancelButton: string }` | `{ okButton: 'Apply', cancelButton: 'Cancel' }` |
42
+ | children | Children element to render | `{ okButton: string; cancelButton: string }` | - |
43
+ | visible | Whether the modal dialog is visible or not | boolean | `false` |
44
+ | confirmLoading | Whether to apply loading visual effect for OK button or not | boolean | `false` |
45
+ | title | The modal dialog's title | string / ReactNode | - |
46
+ | closable | Whether a close (x) button is visible on top right of the modal dialog or not | boolean | `true` |
47
+ | onOk | Specify a function that will be called when a user clicks the OK button | function(e) | - |
48
+ | onCancel | Specify a function that will be called when a user clicks mask, close button on top right or Cancel button | function(e) | - |
49
+ | afterClose | Specify a function that will be called when modal is closed completely. | function | - |
50
+ | centered | Centered Modal | Boolean | `false` |
51
+ | width | Width of the modal dialog | string / number | 520 |
52
+ | footer | Footer content, set as `footer={null}` when you don't need default buttons | ReactNode | OK and Cancel buttons |
53
+ | okText | Text of the OK button | string / ReactNode | `OK` |
54
+ | okType | Button `type` of the OK button | string | `primary` |
55
+ | cancelText | Text of the Cancel button | string / ReactNode | `Cancel` |
56
+ | maskClosable | Whether to close the modal dialog when the mask (area outside the modal) is clicked | boolean | `true` |
57
+ | forceRender | Force render Modal | boolean | `false` |
58
+ | okButtonProps | The ok button props | [ButtonProps](/components/button) | - |
59
+ | cancelButtonProps | The cancel button props | [ButtonProps](/components/button) | - |
60
+ | destroyOnClose | Whether to unmount child components on onClose | boolean | `false` |
61
+ | style | Style of floating layer, typically used at least for adjusting the position. | object | - |
62
+ | wrapClassName | The class name of the container of the modal dialog | string | - |
63
+ | getContainer | Return the mount node for Modal | HTMLElement / () => HTMLElement / Selectors /`false` | document.body |
64
+ | zIndex | The `z-index` of the Modal | Number | 1000 |
65
+ | bodyStyle | Body style for modal body element. Such as height, padding etc. | object | {} |
66
+ | mask | Whether show mask or not. | Boolean | `true` |
67
+ | closeIcon | custom close icon | ReactNode | - |
68
+ | maskStyle | Style for modal's mask element. | object | {} |
68
69
 
69
70
  and it is extended by props for ModalFooterBuilder:
70
71
 
71
- | Property | Description | Type | Default | Version |
72
- |----------------|--------------------------------------------------------------|-----------------------|---------| ------- |
73
- | prefix | Element in footer, before Cancel Button | ReactNode | - |
74
- | infix | Element in footer between Cancel Button nad before Ok Button | ReactNode | - |
75
- | suffix | Element in footer, after Ok Button | ReactNode | - |
76
- | okButton | Custom OK button in footer | ReactNode | - |
77
- | cancelButton | Custom Cancel button in footer | ReactNode | - |
72
+ | Property | Description | Type | Default | Version |
73
+ | ------------ | ------------------------------------------------------------ | --------- | ------- | ------- |
74
+ | prefix | Element in footer, before Cancel Button | ReactNode | - |
75
+ | infix | Element in footer between Cancel Button nad before Ok Button | ReactNode | - |
76
+ | suffix | Element in footer, after Ok Button | ReactNode | - |
77
+ | okButton | Custom OK button in footer | ReactNode | - |
78
+ | cancelButton | Custom Cancel button in footer | ReactNode | - |
78
79
 
79
80
  ## ModalTitle
80
81
 
81
82
  ```bash
82
83
  type ModalTitleProps = Pick<
83
84
  ModalProps,
84
- | 'headerActions'
85
- | 'onCancel'
86
- | 'titleContainerStyle'
87
- | 'blank'
88
- | 'description'
85
+ | 'headerActions'
86
+ | 'onCancel'
87
+ | 'titleContainerStyle'
88
+ | 'blank'
89
+ | 'description'
89
90
  | 'title'
90
91
  >;
91
92
  ```
92
93
 
93
94
  ## ModalFooter
95
+
94
96
  ```bash
95
97
  export type ModalFooterProps = Pick<
96
98
  ModalProps,
@@ -111,4 +113,5 @@ export type ModalFooterProps = Pick<
111
113
  | 'okButtonProps'
112
114
  >;
113
115
  ```
116
+
114
117
  **(Deprecated)** method buildModalFooter - use ModalFooter Component instead
package/dist/Modal.js CHANGED
@@ -14,7 +14,8 @@ var mapSizeToWidth = {
14
14
  medium: 792,
15
15
  large: 1044,
16
16
  extraLarge: 1280,
17
- fullSize: '100%'
17
+ fullSize: '100%',
18
+ fullScreen: '100%'
18
19
  };
19
20
 
20
21
  /** @deprecated */
@@ -38,8 +39,10 @@ export var Modal = function Modal(props) {
38
39
  }, {
39
40
  'with-description': Boolean(description)
40
41
  });
42
+ var isFullscreen = size === 'fullScreen';
41
43
  return /*#__PURE__*/React.createElement(S.AntdModal, _extends({}, antModalProps, {
42
44
  className: className,
45
+ isFullscreen: isFullscreen,
43
46
  width: size && mapSizeToWidth[size],
44
47
  closable: false,
45
48
  title: (title || description || blank) && /*#__PURE__*/React.createElement(ModalTitle, props),
@@ -1,4 +1,10 @@
1
- import { ModalProps } from 'antd/lib/modal';
1
+ /// <reference types="react" />
2
2
  export declare const SettingButton: import("styled-components").StyledComponent<"div", any, {}, never>;
3
3
  export declare const ButtonsWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
4
- export declare const AntdModal: import("styled-components").StyledComponent<any, any, object & ModalProps, string | number | symbol>;
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
+ destroyAll: () => void;
7
+ config: typeof import("antd/lib/modal/confirm").modalGlobalConfig;
8
+ }, any, {
9
+ isFullscreen?: boolean | undefined;
10
+ }, never>;
@@ -1,4 +1,4 @@
1
- import styled from 'styled-components';
1
+ import styled, { css } from 'styled-components';
2
2
  import Modal from 'antd/lib/modal';
3
3
  export var SettingButton = styled.div.withConfig({
4
4
  displayName: "Modalstyles__SettingButton",
@@ -8,10 +8,9 @@ export var ButtonsWrapper = styled.div.withConfig({
8
8
  displayName: "Modalstyles__ButtonsWrapper",
9
9
  componentId: "sc-jdspxw-1"
10
10
  })(["display:flex;"]);
11
-
12
- // FIXME: Exported variable 'AntdModal' has or is using name 'ModalInterface' from external module (probabli Antd's types issue)
13
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
11
  export var AntdModal = styled(Modal).withConfig({
15
12
  displayName: "Modalstyles__AntdModal",
16
13
  componentId: "sc-jdspxw-2"
17
- })([""]);
14
+ })(["", ""], function (props) {
15
+ 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;}"]);
16
+ });
@@ -5,7 +5,7 @@ export type Props = ModalProps;
5
5
  export type ModalProps = {
6
6
  description?: string;
7
7
  headerActions?: ReactNode;
8
- size?: 'small' | 'medium' | 'large' | 'extraLarge' | 'fullSize';
8
+ size?: 'small' | 'medium' | 'large' | 'extraLarge' | 'fullSize' | 'fullScreen';
9
9
  bodyBackground?: 'white' | 'grey';
10
10
  blank?: boolean;
11
11
  titleContainerStyle?: CSSProperties;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-modal",
3
- "version": "1.0.7",
3
+ "version": "1.1.0",
4
4
  "description": "Modal UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -34,9 +34,9 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-button": "^1.2.0",
38
- "@synerise/ds-icon": "^1.4.2",
39
- "@synerise/ds-typography": "^1.0.7",
37
+ "@synerise/ds-button": "^1.3.0",
38
+ "@synerise/ds-icon": "^1.5.0",
39
+ "@synerise/ds-typography": "^1.0.8",
40
40
  "@synerise/ds-utils": "^1.1.0",
41
41
  "classnames": "2.3.2"
42
42
  },
@@ -46,5 +46,5 @@
46
46
  "react": ">=16.9.0 <= 18.3.1",
47
47
  "styled-components": "^5.3.3"
48
48
  },
49
- "gitHead": "90af7549cf0f556340bdd0deec4bb59bacf3e95e"
49
+ "gitHead": "8aa16b27c86c97e3ac774d92561ab0a03176c439"
50
50
  }