@panneau/modal-dialog 4.0.1 → 4.0.4

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.
Files changed (2) hide show
  1. package/es/index.js +43 -34
  2. package/package.json +8 -8
package/es/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import classNames from 'classnames';
3
- import React from 'react';
4
3
  import { isMessage } from '@panneau/core/utils';
5
4
  import Button from '@panneau/element-button';
6
5
  import Buttons from '@panneau/element-buttons';
7
6
  import Label from '@panneau/element-label';
8
7
  import Modal from '@panneau/element-modal';
8
+ import { jsx, jsxs } from 'react/jsx-runtime';
9
9
 
10
10
  var styles = {"container":"panneau-modal-dialog-container","closeOutside":"panneau-modal-dialog-closeOutside","closeOutsideButton":"panneau-modal-dialog-closeOutsideButton"};
11
11
 
@@ -30,40 +30,49 @@ function ModalDialog(_ref) {
30
30
  _ref$className = _ref.className,
31
31
  className = _ref$className === void 0 ? null : _ref$className;
32
32
  var onCloseButtonOutside = header === null && title === null && onClose !== null || withCloseOutside && onClose !== null;
33
- return /*#__PURE__*/React.createElement(Modal, {
33
+ return /*#__PURE__*/jsx(Modal, {
34
34
  id: id,
35
- onClose: onClose
36
- }, /*#__PURE__*/React.createElement("div", {
37
- className: classNames(['modal-dialog', styles.container, _defineProperty(_defineProperty(_defineProperty({}, "modal-".concat(size), size !== null), styles.closeOutside, onCloseButtonOutside), className, className !== null)]),
38
- role: "dialog"
39
- }, /*#__PURE__*/React.createElement("div", {
40
- className: "modal-content"
41
- }, onCloseButtonOutside ? /*#__PURE__*/React.createElement(Button, {
42
- type: "button",
43
- className: classNames([styles.closeOutsideButton, 'btn', 'btn-close', 'bg-light',
44
- // 'btn-close-white',
45
- 'btn-secondary', 'p-2']),
46
- "aria-label": "Close",
47
- onClick: onClose
48
- }) : null, header !== null ? header : /*#__PURE__*/React.createElement("div", {
49
- className: classNames([{
50
- 'modal-header': title !== null
51
- }])
52
- }, title !== null ? /*#__PURE__*/React.createElement("h5", {
53
- className: "modal-title pe-2"
54
- }, isMessage(title) ? /*#__PURE__*/React.createElement(Label, null, title) : title) : null, title !== null && onClose !== null ? /*#__PURE__*/React.createElement(Button, {
55
- type: "button",
56
- className: classNames(['btn-close', 'close']),
57
- "aria-label": "Close",
58
- onClick: onClose
59
- }) : null), /*#__PURE__*/React.createElement("div", {
60
- className: classNames(['modal-body', styles.body])
61
- }, children), footer !== null || buttons !== null ? /*#__PURE__*/React.createElement("div", {
62
- className: classNames(['modal-footer', styles.footer])
63
- }, footer !== null ? footer : null, buttons !== null ? /*#__PURE__*/React.createElement(Buttons, {
64
- items: buttons,
65
- className: styles.buttons
66
- }) : null) : null)));
35
+ onClose: onClose,
36
+ children: /*#__PURE__*/jsx("div", {
37
+ className: classNames(['modal-dialog', styles.container, _defineProperty(_defineProperty(_defineProperty({}, "modal-".concat(size), size !== null), styles.closeOutside, onCloseButtonOutside), className, className !== null)]),
38
+ role: "dialog",
39
+ children: /*#__PURE__*/jsxs("div", {
40
+ className: "modal-content",
41
+ children: [onCloseButtonOutside ? /*#__PURE__*/jsx(Button, {
42
+ type: "button",
43
+ className: classNames([styles.closeOutsideButton, 'btn', 'btn-close', 'bg-light',
44
+ // 'btn-close-white',
45
+ 'btn-secondary', 'p-2']),
46
+ "aria-label": "Close",
47
+ onClick: onClose
48
+ }) : null, header !== null ? header : /*#__PURE__*/jsxs("div", {
49
+ className: classNames([{
50
+ 'modal-header': title !== null
51
+ }]),
52
+ children: [title !== null ? /*#__PURE__*/jsx("h5", {
53
+ className: "modal-title pe-2",
54
+ children: isMessage(title) ? /*#__PURE__*/jsx(Label, {
55
+ children: title
56
+ }) : title
57
+ }) : null, title !== null && onClose !== null ? /*#__PURE__*/jsx(Button, {
58
+ type: "button",
59
+ className: classNames(['btn-close', 'close']),
60
+ "aria-label": "Close",
61
+ onClick: onClose
62
+ }) : null]
63
+ }), /*#__PURE__*/jsx("div", {
64
+ className: classNames(['modal-body', styles.body]),
65
+ children: children
66
+ }), footer !== null || buttons !== null ? /*#__PURE__*/jsxs("div", {
67
+ className: classNames(['modal-footer', styles.footer]),
68
+ children: [footer !== null ? footer : null, buttons !== null ? /*#__PURE__*/jsx(Buttons, {
69
+ items: buttons,
70
+ className: styles.buttons
71
+ }) : null]
72
+ }) : null]
73
+ })
74
+ })
75
+ });
67
76
  }
68
77
 
69
78
  export { ModalDialog as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/modal-dialog",
3
- "version": "4.0.1",
3
+ "version": "4.0.4",
4
4
  "description": "Default modal",
5
5
  "keywords": [
6
6
  "javascript"
@@ -59,12 +59,12 @@
59
59
  },
60
60
  "dependencies": {
61
61
  "@babel/runtime": "^7.12.5",
62
- "@panneau/core": "^4.0.1",
63
- "@panneau/element-button": "^4.0.1",
64
- "@panneau/element-buttons": "^4.0.1",
65
- "@panneau/element-label": "^4.0.1",
66
- "@panneau/element-modal": "^4.0.1",
67
- "@panneau/themes": "^4.0.1",
62
+ "@panneau/core": "^4.0.4",
63
+ "@panneau/element-button": "^4.0.4",
64
+ "@panneau/element-buttons": "^4.0.4",
65
+ "@panneau/element-label": "^4.0.4",
66
+ "@panneau/element-modal": "^4.0.4",
67
+ "@panneau/themes": "^4.0.4",
68
68
  "classnames": "^2.5.1",
69
69
  "lodash-es": "^4.17.21",
70
70
  "prop-types": "^15.7.2",
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "dbdf65640625c027ecd56cf2b816b80a5c38cb8d"
76
+ "gitHead": "e854451a718c6bc7dcde2b804c9913d8ac0297ff"
77
77
  }