@cypress-design/react-modal 0.0.3 → 0.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +11 -0
- package/Modal.tsx +13 -1
- package/ModalReact.cy.tsx +8 -1
- package/dist/Modal.d.ts +1 -0
- package/dist/Modal.d.ts.map +1 -1
- package/dist/index.es.mjs +10 -6
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +10 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
require('clsx');
|
|
4
|
+
var clsx = require('clsx');
|
|
5
5
|
var iconsRegistry = require('@cypress-design/icon-registry');
|
|
6
6
|
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
@@ -31047,8 +31047,10 @@ function freeBodyScroll() {
|
|
|
31047
31047
|
}
|
|
31048
31048
|
|
|
31049
31049
|
const ClassBackDrop = 'fixed left-0 top-0 z-[1000010] h-screen w-screen bg-gray-900/[.92] backdrop-blur';
|
|
31050
|
-
const ClassModalContainer = 'pointer-events-none fixed left-0 top-0 z-[1000020]
|
|
31051
|
-
const ClassModal = 'pointer-events-auto relative flex
|
|
31050
|
+
const ClassModalContainer = 'pointer-events-none fixed left-0 top-0 z-[1000020] h-full w-screen overflow-hidden flex items-center justify-center';
|
|
31051
|
+
const ClassModal = 'pointer-events-auto relative flex flex-col rounded-lg border-4 border-gray-700 bg-white';
|
|
31052
|
+
const ClassModalStandardDimensions = 'max-h-[80vh] min-w-[200px] sm:min-w-[390px] sm:max-w-[70vw] shrink-0';
|
|
31053
|
+
const ClassModalFullscreenDimensions = 'h-[calc(100vh-32px)] sm:w-[calc(100vw-32px)]';
|
|
31052
31054
|
const ClassTitleBox = 'flex shrink-0 items-center justify-between rounded-t-md border-b border-gray-100 p-[16px] px-[24px]';
|
|
31053
31055
|
const ClassTitle = 'text-[18px] font-medium leading-[28px] text-gray-900';
|
|
31054
31056
|
const ClassHelpLinkDash = 'mx-[8px] h-[1px] w-[32px] bg-gray-100';
|
|
@@ -31057,7 +31059,7 @@ const ClassCloseButton = 'group rounded-full border-transparent p-[4px] outline-
|
|
|
31057
31059
|
const ClassContent = 'overflow-y-auto p-[16px]';
|
|
31058
31060
|
|
|
31059
31061
|
var Modal = function (_a) {
|
|
31060
|
-
var _b = _a.show, show = _b === void 0 ? false : _b, title = _a.title, helpLink = _a.helpLink, onClose = _a.onClose, children = _a.children;
|
|
31062
|
+
var _b = _a.show, show = _b === void 0 ? false : _b, title = _a.title, helpLink = _a.helpLink, onClose = _a.onClose, children = _a.children, _c = _a.fullscreen, fullscreen = _c === void 0 ? false : _c;
|
|
31061
31063
|
React__namespace.useEffect(function () {
|
|
31062
31064
|
if (show) {
|
|
31063
31065
|
disableBodyScroll();
|
|
@@ -31073,7 +31075,9 @@ var Modal = function (_a) {
|
|
|
31073
31075
|
reactDomExports.createPortal(React__namespace.createElement("div", null,
|
|
31074
31076
|
React__namespace.createElement("div", { className: ClassBackDrop, onClick: function () { return onClose === null || onClose === void 0 ? void 0 : onClose(); } }),
|
|
31075
31077
|
React__namespace.createElement("div", { className: ClassModalContainer, tabIndex: -1, "aria-modal": "true", role: "modal" },
|
|
31076
|
-
React__namespace.createElement("div", { className: ClassModal
|
|
31078
|
+
React__namespace.createElement("div", { className: clsx(ClassModal, fullscreen
|
|
31079
|
+
? ClassModalFullscreenDimensions
|
|
31080
|
+
: ClassModalStandardDimensions) },
|
|
31077
31081
|
React__namespace.createElement("div", { className: ClassTitleBox },
|
|
31078
31082
|
React__namespace.createElement("div", { className: ClassTitle }, title),
|
|
31079
31083
|
helpLink ? React__namespace.createElement("div", { className: ClassHelpLinkDash }) : null,
|
|
@@ -31089,4 +31093,4 @@ var Modal = function (_a) {
|
|
|
31089
31093
|
module.exports = Modal;
|
|
31090
31094
|
//# sourceMappingURL=index.umd.js.map
|
|
31091
31095
|
|
|
31092
|
-
/* <wind-keep class="ml-[4px] grow fixed left-0 top-0 z-[1000010] h-screen w-screen bg-gray-900/[.92] backdrop-blur pointer-events-none z-[1000020]
|
|
31096
|
+
/* <wind-keep class="ml-[4px] grow fixed left-0 top-0 z-[1000010] h-screen w-screen bg-gray-900/[.92] backdrop-blur pointer-events-none z-[1000020] h-full overflow-hidden flex items-center justify-center pointer-events-auto relative flex-col rounded-lg border-4 border-gray-700 bg-white max-h-[80vh] min-w-[200px] sm:min-w-[390px] sm:max-w-[70vw] shrink-0 h-[calc(100vh-32px)] sm:w-[calc(100vw-32px)] justify-between rounded-t-md border-b border-gray-100 p-[16px] px-[24px] text-[18px] font-medium leading-[28px] text-gray-900 mx-[8px] h-[1px] w-[32px] bg-gray-100 text-[16px] font-normal leading-[24px] text-indigo-500 rounded-full border-transparent p-[4px] outline-none overflow-y-auto cy-modal-overflow-hidden cy-modal-overflow-scroll-x cy-modal-overflow-scroll-y"> */
|