@panneau/modal-dialog 4.0.2 → 4.0.5

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 -33
  2. package/package.json +8 -8
package/es/index.js CHANGED
@@ -5,6 +5,7 @@ import Button from '@panneau/element-button';
5
5
  import Buttons from '@panneau/element-buttons';
6
6
  import Label from '@panneau/element-label';
7
7
  import Modal from '@panneau/element-modal';
8
+ import { jsx, jsxs } from 'react/jsx-runtime';
8
9
 
9
10
  var styles = {"container":"panneau-modal-dialog-container","closeOutside":"panneau-modal-dialog-closeOutside","closeOutsideButton":"panneau-modal-dialog-closeOutsideButton"};
10
11
 
@@ -29,40 +30,49 @@ function ModalDialog(_ref) {
29
30
  _ref$className = _ref.className,
30
31
  className = _ref$className === void 0 ? null : _ref$className;
31
32
  var onCloseButtonOutside = header === null && title === null && onClose !== null || withCloseOutside && onClose !== null;
32
- return /*#__PURE__*/React.createElement(Modal, {
33
+ return /*#__PURE__*/jsx(Modal, {
33
34
  id: id,
34
- onClose: onClose
35
- }, /*#__PURE__*/React.createElement("div", {
36
- className: classNames(['modal-dialog', styles.container, _defineProperty(_defineProperty(_defineProperty({}, "modal-".concat(size), size !== null), styles.closeOutside, onCloseButtonOutside), className, className !== null)]),
37
- role: "dialog"
38
- }, /*#__PURE__*/React.createElement("div", {
39
- className: "modal-content"
40
- }, onCloseButtonOutside ? /*#__PURE__*/React.createElement(Button, {
41
- type: "button",
42
- className: classNames([styles.closeOutsideButton, 'btn', 'btn-close', 'bg-light',
43
- // 'btn-close-white',
44
- 'btn-secondary', 'p-2']),
45
- "aria-label": "Close",
46
- onClick: onClose
47
- }) : null, header !== null ? header : /*#__PURE__*/React.createElement("div", {
48
- className: classNames([{
49
- 'modal-header': title !== null
50
- }])
51
- }, title !== null ? /*#__PURE__*/React.createElement("h5", {
52
- className: "modal-title pe-2"
53
- }, isMessage(title) ? /*#__PURE__*/React.createElement(Label, null, title) : title) : null, title !== null && onClose !== null ? /*#__PURE__*/React.createElement(Button, {
54
- type: "button",
55
- className: classNames(['btn-close', 'close']),
56
- "aria-label": "Close",
57
- onClick: onClose
58
- }) : null), /*#__PURE__*/React.createElement("div", {
59
- className: classNames(['modal-body', styles.body])
60
- }, children), footer !== null || buttons !== null ? /*#__PURE__*/React.createElement("div", {
61
- className: classNames(['modal-footer', styles.footer])
62
- }, footer !== null ? footer : null, buttons !== null ? /*#__PURE__*/React.createElement(Buttons, {
63
- items: buttons,
64
- className: styles.buttons
65
- }) : 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
+ });
66
76
  }
67
77
 
68
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.2",
3
+ "version": "4.0.5",
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.2",
63
- "@panneau/element-button": "^4.0.2",
64
- "@panneau/element-buttons": "^4.0.2",
65
- "@panneau/element-label": "^4.0.2",
66
- "@panneau/element-modal": "^4.0.2",
67
- "@panneau/themes": "^4.0.2",
62
+ "@panneau/core": "^4.0.5",
63
+ "@panneau/element-button": "^4.0.5",
64
+ "@panneau/element-buttons": "^4.0.5",
65
+ "@panneau/element-label": "^4.0.5",
66
+ "@panneau/element-modal": "^4.0.5",
67
+ "@panneau/themes": "^4.0.5",
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": "53ad0f27e467992c23158732e0f7d39d8615780b"
76
+ "gitHead": "ac8b065e8c7ada1d176d15eff1c0fa53599ad31f"
77
77
  }