@zenkigen-inc/component-ui 1.6.0 → 1.6.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/dist/index.esm.js +13 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +11 -8
- package/dist/index.js.map +1 -1
- package/dist/modal/modal-context.d.ts +1 -1
- package/dist/modal/modal-header.d.ts +1 -2
- package/dist/modal/modal.d.ts +2 -2
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -31505,26 +31505,23 @@ function ModalFooter(_ref) {
|
|
|
31505
31505
|
|
|
31506
31506
|
function ModalHeader(_ref) {
|
|
31507
31507
|
var children = _ref.children,
|
|
31508
|
-
isNoBorder = _ref.isNoBorder
|
|
31509
|
-
isNoCloseButton = _ref.isNoCloseButton;
|
|
31508
|
+
isNoBorder = _ref.isNoBorder;
|
|
31510
31509
|
var _useContext = useContext(ModalContext),
|
|
31511
31510
|
onClose = _useContext.onClose;
|
|
31512
31511
|
var headerClasses = clsx$1('typography-h5 flex w-full shrink-0 items-center justify-between rounded-t-lg px-6 text-text-text01', {
|
|
31513
31512
|
'border-b-[1px] border-border-uiBorder01': !isNoBorder,
|
|
31514
|
-
'h-14': !
|
|
31515
|
-
'h-12':
|
|
31513
|
+
'h-14': !onClose,
|
|
31514
|
+
'h-12': onClose
|
|
31516
31515
|
});
|
|
31517
31516
|
return /*#__PURE__*/jsxs("div", {
|
|
31518
31517
|
className: headerClasses,
|
|
31519
31518
|
children: [/*#__PURE__*/jsx("div", {
|
|
31520
31519
|
children: children
|
|
31521
|
-
}),
|
|
31520
|
+
}), onClose && /*#__PURE__*/jsx(IconButton, {
|
|
31522
31521
|
icon: "close",
|
|
31523
31522
|
size: "small",
|
|
31524
31523
|
variant: "text",
|
|
31525
|
-
onClick:
|
|
31526
|
-
return onClose();
|
|
31527
|
-
}
|
|
31524
|
+
onClick: onClose
|
|
31528
31525
|
})]
|
|
31529
31526
|
});
|
|
31530
31527
|
}
|
|
@@ -31539,9 +31536,15 @@ function Modal(_ref) {
|
|
|
31539
31536
|
isOpen = _ref.isOpen,
|
|
31540
31537
|
onClose = _ref.onClose,
|
|
31541
31538
|
portalTargetRef = _ref.portalTargetRef;
|
|
31539
|
+
var _useState = useState(false),
|
|
31540
|
+
isMounted = _useState[0],
|
|
31541
|
+
setIsMounted = _useState[1];
|
|
31542
31542
|
var renderWidth = typeof width === 'number' ? Math.max(width, LIMIT_WIDTH) : width;
|
|
31543
31543
|
var renderHeight = typeof height === 'number' ? Math.max(height, LIMIT_HEIGHT) : height;
|
|
31544
|
-
|
|
31544
|
+
useEffect(function () {
|
|
31545
|
+
setIsMounted(true);
|
|
31546
|
+
}, []);
|
|
31547
|
+
return isMounted && isOpen ? /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/jsx(ModalContext.Provider, {
|
|
31545
31548
|
value: {
|
|
31546
31549
|
onClose: onClose
|
|
31547
31550
|
},
|
|
@@ -31556,7 +31559,7 @@ function Modal(_ref) {
|
|
|
31556
31559
|
children: children
|
|
31557
31560
|
})
|
|
31558
31561
|
})
|
|
31559
|
-
}),
|
|
31562
|
+
}), (portalTargetRef == null ? void 0 : portalTargetRef.current) != null ? portalTargetRef.current : document.body) : null;
|
|
31560
31563
|
}
|
|
31561
31564
|
Modal.Body = ModalBody;
|
|
31562
31565
|
Modal.Header = ModalHeader;
|