@synerise/ds-modal 0.14.14 → 0.15.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,38 @@
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
+ ## [0.15.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@0.15.1...@synerise/ds-modal@0.15.2) (2021-11-22)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-modal
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.15.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@0.14.15...@synerise/ds-modal@0.15.1) (2021-11-09)
15
+
16
+ **Note:** Version bump only for package @synerise/ds-modal
17
+
18
+
19
+
20
+
21
+
22
+ # [0.15.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@0.14.15...@synerise/ds-modal@0.15.0) (2021-11-09)
23
+
24
+ **Note:** Version bump only for package @synerise/ds-modal
25
+
26
+
27
+
28
+
29
+
30
+ ## [0.14.15](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@0.14.14...@synerise/ds-modal@0.14.15) (2021-11-05)
31
+
32
+ **Note:** Version bump only for package @synerise/ds-modal
33
+
34
+
35
+
36
+
37
+
6
38
  ## [0.14.14](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@0.14.12...@synerise/ds-modal@0.14.14) (2021-10-26)
7
39
 
8
40
  **Note:** Version bump only for package @synerise/ds-modal
package/dist/Modal.js CHANGED
@@ -1,35 +1,16 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1
+ var _excluded = ["texts", "bodyBackground", "closable", "headerActions", "title", "description", "size", "blank", "titleContainerStyle"];
2
2
 
3
3
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
 
5
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
6
-
7
5
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
8
6
 
9
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10
-
11
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
12
-
13
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
14
-
15
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
16
-
17
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
18
-
19
- function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
20
-
21
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
22
-
23
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
24
-
25
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
7
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
26
8
 
27
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
9
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
28
10
 
29
11
  import * as React from 'react';
30
12
  import Modal from 'antd/lib/modal';
31
- import Icon from '@synerise/ds-icon';
32
- import CloseM from '@synerise/ds-icon/dist/icons/CloseM';
13
+ import Icon, { CloseM } from '@synerise/ds-icon';
33
14
  import Button from '@synerise/ds-button';
34
15
  import '@synerise/ds-core/dist/js/style';
35
16
  import "./style/index.css";
@@ -44,89 +25,90 @@ var mapSizeToWidth = {
44
25
  };
45
26
 
46
27
  var ModalProxy = /*#__PURE__*/function (_React$Component) {
47
- _inherits(ModalProxy, _React$Component);
48
-
49
- var _super = _createSuper(ModalProxy);
28
+ _inheritsLoose(ModalProxy, _React$Component);
50
29
 
51
30
  function ModalProxy() {
52
- _classCallCheck(this, ModalProxy);
53
-
54
- return _super.apply(this, arguments);
31
+ return _React$Component.apply(this, arguments) || this;
55
32
  }
56
33
 
57
- _createClass(ModalProxy, [{
58
- key: "render",
59
- value: function render() {
60
- var _this$props = this.props,
61
- texts = _this$props.texts,
62
- bodyBackground = _this$props.bodyBackground,
63
- closable = _this$props.closable,
64
- headerActions = _this$props.headerActions,
65
- title = _this$props.title,
66
- description = _this$props.description,
67
- size = _this$props.size,
68
- blank = _this$props.blank,
69
- titleContainerStyle = _this$props.titleContainerStyle,
70
- antModalProps = _objectWithoutProperties(_this$props, ["texts", "bodyBackground", "closable", "headerActions", "title", "description", "size", "blank", "titleContainerStyle"]);
71
-
72
- var handleOnClose = antModalProps.onCancel;
73
- var className = classnames("bodybg-".concat(bodyBackground), antModalProps.className, {
74
- 'modal-blank': Boolean(blank)
75
- }, {
76
- 'with-description': Boolean(description)
77
- });
78
- var titleContainer = React.createElement(React.Fragment, null, blank && closable && React.createElement(Button, {
79
- mode: "single-icon",
80
- "data-testid": "modal-close",
81
- className: "close-modal",
82
- type: "ghost",
83
- onClick: handleOnClose
84
- }, React.createElement(Icon, {
85
- component: React.createElement(CloseM, null)
86
- })), title && React.createElement(S.TitleContainer, {
87
- style: titleContainerStyle
88
- }, React.createElement(S.Title, {
89
- level: 3
90
- }, title), React.createElement(S.ActionButtons, null, headerActions, closable && React.createElement(Button, {
91
- mode: "single-icon",
92
- "data-testid": "modal-close",
93
- className: "close-modal",
94
- type: "ghost",
95
- onClick: handleOnClose
96
- }, React.createElement(Icon, {
97
- component: React.createElement(CloseM, null)
98
- })))), description && React.createElement(S.Description, null, description));
99
- var footerContainer = antModalProps.footer || React.createElement(S.FooterContainer, null, React.createElement(Button, _extends({
100
- type: "ghost",
101
- onClick: antModalProps.onCancel
102
- }, antModalProps.cancelButtonProps), texts && texts.cancelButton), React.createElement(Button, _extends({
103
- type: antModalProps.okType || 'primary',
104
- onClick: antModalProps.onOk
105
- }, antModalProps.okButtonProps), texts && texts.okButton));
106
- return React.createElement(S.AntdModal, _extends({}, antModalProps, {
107
- className: className,
108
- width: !size ? undefined : mapSizeToWidth[size],
109
- closable: false,
110
- title: (title || description || blank) && titleContainer,
111
- footer: antModalProps.footer !== null ? footerContainer : null
112
- }));
113
- }
114
- }]);
34
+ var _proto = ModalProxy.prototype;
35
+
36
+ _proto.render = function render() {
37
+ var _this$props = this.props,
38
+ texts = _this$props.texts,
39
+ bodyBackground = _this$props.bodyBackground,
40
+ closable = _this$props.closable,
41
+ headerActions = _this$props.headerActions,
42
+ title = _this$props.title,
43
+ description = _this$props.description,
44
+ size = _this$props.size,
45
+ blank = _this$props.blank,
46
+ titleContainerStyle = _this$props.titleContainerStyle,
47
+ antModalProps = _objectWithoutPropertiesLoose(_this$props, _excluded);
48
+
49
+ var handleOnClose = antModalProps.onCancel;
50
+ var className = classnames("bodybg-" + bodyBackground, antModalProps.className, {
51
+ 'modal-blank': Boolean(blank)
52
+ }, {
53
+ 'with-description': Boolean(description)
54
+ });
55
+ var titleContainer = /*#__PURE__*/React.createElement(React.Fragment, null, blank && closable && /*#__PURE__*/React.createElement(Button, {
56
+ mode: "single-icon",
57
+ "data-testid": "modal-close",
58
+ className: "close-modal",
59
+ type: "ghost",
60
+ onClick: handleOnClose
61
+ }, /*#__PURE__*/React.createElement(Icon, {
62
+ component: /*#__PURE__*/React.createElement(CloseM, null)
63
+ })), title && /*#__PURE__*/React.createElement(S.TitleContainer, {
64
+ style: titleContainerStyle
65
+ }, /*#__PURE__*/React.createElement(S.Title, {
66
+ level: 3
67
+ }, title), /*#__PURE__*/React.createElement(S.ActionButtons, null, headerActions, closable && /*#__PURE__*/React.createElement(Button, {
68
+ mode: "single-icon",
69
+ "data-testid": "modal-close",
70
+ className: "close-modal",
71
+ type: "ghost",
72
+ onClick: handleOnClose
73
+ }, /*#__PURE__*/React.createElement(Icon, {
74
+ component: /*#__PURE__*/React.createElement(CloseM, null)
75
+ })))), description && /*#__PURE__*/React.createElement(S.Description, null, description));
76
+ var footerContainer = antModalProps.footer || /*#__PURE__*/React.createElement(S.FooterContainer, null, /*#__PURE__*/React.createElement(Button, _extends({
77
+ type: "ghost",
78
+ onClick: antModalProps.onCancel
79
+ }, antModalProps.cancelButtonProps), texts && texts.cancelButton), /*#__PURE__*/React.createElement(Button, _extends({
80
+ type: antModalProps.okType || 'primary',
81
+ onClick: antModalProps.onOk
82
+ }, antModalProps.okButtonProps), texts && texts.okButton));
83
+ return /*#__PURE__*/React.createElement(S.AntdModal, _extends({}, antModalProps, {
84
+ className: className,
85
+ width: !size ? undefined : mapSizeToWidth[size],
86
+ closable: false,
87
+ title: (title || description || blank) && titleContainer,
88
+ footer: antModalProps.footer !== null ? footerContainer : null
89
+ }));
90
+ };
115
91
 
116
92
  return ModalProxy;
117
93
  }(React.Component);
118
94
 
119
- ModalProxy.defaultProps = {
95
+ _defineProperty(ModalProxy, "defaultProps", {
120
96
  closable: true,
121
97
  bodyBackground: 'white',
122
98
  texts: {
123
99
  okButton: 'Apply',
124
100
  cancelButton: 'Cancel'
125
101
  }
126
- };
127
- ModalProxy.info = Modal.info;
128
- ModalProxy.success = Modal.success;
129
- ModalProxy.error = Modal.error;
130
- ModalProxy.warning = Modal.warning;
131
- ModalProxy.confirm = Modal.confirm;
102
+ });
103
+
104
+ _defineProperty(ModalProxy, "info", Modal.info);
105
+
106
+ _defineProperty(ModalProxy, "success", Modal.success);
107
+
108
+ _defineProperty(ModalProxy, "error", Modal.error);
109
+
110
+ _defineProperty(ModalProxy, "warning", Modal.warning);
111
+
112
+ _defineProperty(ModalProxy, "confirm", Modal.confirm);
113
+
132
114
  export default ModalProxy;
@@ -14,7 +14,9 @@ export var Title = styled(Typography.Title).withConfig({
14
14
  export var Description = styled.div.withConfig({
15
15
  displayName: "Modalstyles__Description",
16
16
  componentId: "jdspxw-2"
17
- })(["font-weight:normal;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) {
17
+ })(["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) {
18
+ return props.theme.palette['grey-600'];
19
+ }, function (props) {
18
20
  return props.theme.palette['grey-300'];
19
21
  });
20
22
  export var ActionButtons = styled.div.withConfig({
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-modal",
3
- "version": "0.14.14",
3
+ "version": "0.15.2",
4
4
  "description": "Modal UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -32,9 +32,9 @@
32
32
  ],
33
33
  "types": "dist/index.d.ts",
34
34
  "dependencies": {
35
- "@synerise/ds-button": "^0.15.0",
36
- "@synerise/ds-icon": "^0.45.2",
37
- "@synerise/ds-typography": "^0.11.9",
35
+ "@synerise/ds-button": "^0.16.2",
36
+ "@synerise/ds-icon": "^0.46.2",
37
+ "@synerise/ds-typography": "^0.12.2",
38
38
  "classnames": "^2.2.6"
39
39
  },
40
40
  "peerDependencies": {
@@ -45,5 +45,5 @@
45
45
  "devDependencies": {
46
46
  "@synerise/ds-utils": "^0.19.0"
47
47
  },
48
- "gitHead": "daaf50ad62081d7ad77eb4ac65100173df77c731"
48
+ "gitHead": "2468359677783819939fb9f1ef5acc36667ecd1a"
49
49
  }