@cypress-design/react-modal 1.1.0 → 1.2.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 -6
- package/CHANGELOG.md +6 -0
- package/dist/index.umd.js +7 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
yarn run v1.22.22
|
|
2
|
-
$ yarn build:module && yarn build:types
|
|
3
|
-
$ rollup -c ./rollup.config.mjs
|
|
4
1
|
[36m
|
|
5
2
|
[1m./index.ts[22m → [1m./dist/index.umd.js, ./dist/index.es.mjs[22m...[39m
|
|
6
|
-
[32mcreated [1m./dist/index.umd.js, ./dist/index.es.mjs[22m in [
|
|
7
|
-
$ tsc --project ./tsconfig.build.json
|
|
8
|
-
Done in 28.92s.
|
|
3
|
+
[32mcreated [1m./dist/index.umd.js, ./dist/index.es.mjs[22m in [1m10.3s[22m[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @cypress-design/react-modal
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#733](https://github.com/cypress-io/cypress-design/pull/733) [`5e916fb`](https://github.com/cypress-io/cypress-design/commit/5e916fbe2b83d1503ed80820a85a8705bdcaeef1) Thanks [@jennifer-shehane](https://github.com/jennifer-shehane)! - Depend on `@cypress-design/vue-icon` and `@cypress-design/react-icon` 3.x. These packages were last published against icon 1.x, so installs stayed on 1.x and missed the 3.x fixes, including tree-shakable named icon imports. None of the icons these components use were renamed or removed in 2.0 or 3.0, so there are no API changes. `@cypress-design/vue-modal` now also lists `@cypress-design/vue-icon` as a dependency instead of a devDependency, since its build imports it at runtime.
|
|
8
|
+
|
|
3
9
|
## 1.1.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/index.umd.js
CHANGED
|
@@ -5,7 +5,10 @@ var reactDom = require('react-dom');
|
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var reactIcon = require('@cypress-design/react-icon');
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
|
|
10
|
+
function _interopNamespace(e) {
|
|
11
|
+
if (e && e.__esModule) return e;
|
|
9
12
|
var n = Object.create(null);
|
|
10
13
|
if (e) {
|
|
11
14
|
Object.keys(e).forEach(function (k) {
|
|
@@ -22,7 +25,8 @@ function _interopNamespaceDefault(e) {
|
|
|
22
25
|
return Object.freeze(n);
|
|
23
26
|
}
|
|
24
27
|
|
|
25
|
-
var React__namespace = /*#__PURE__*/
|
|
28
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
29
|
+
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
26
30
|
|
|
27
31
|
const ATTR_DATA_MODAL_SCROLL_TOP = 'data-modal-scroll-top';
|
|
28
32
|
const CY_MODAL_CLASS = 'cy-modal-overflow-hidden';
|
|
@@ -85,7 +89,7 @@ var Modal = function (_a) {
|
|
|
85
89
|
}
|
|
86
90
|
}, [onClose]);
|
|
87
91
|
return (show &&
|
|
88
|
-
reactDom.createPortal(React__namespace.createElement("dialog", { ref: dialogRef, className:
|
|
92
|
+
reactDom.createPortal(React__namespace.createElement("dialog", { ref: dialogRef, className: clsx__default.default(show ? ClassModal : null, fullscreen
|
|
89
93
|
? ClassModalFullscreenDimensions
|
|
90
94
|
: ClassModalStandardDimensions, className), onClick: closeOnClickBackdrop },
|
|
91
95
|
React__namespace.createElement("div", { className: ClassTitleBox },
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../../constants/dist/index.es.mjs","../Modal.tsx"],"sourcesContent":["const ATTR_DATA_MODAL_SCROLL_TOP = 'data-modal-scroll-top';\nconst CY_MODAL_CLASS = 'cy-modal-overflow-hidden';\nfunction disableBodyScroll() {\n document.body.setAttribute(ATTR_DATA_MODAL_SCROLL_TOP, `${window.scrollY}`);\n if (document.documentElement.clientWidth > window.innerWidth) {\n document.documentElement.classList.add('cy-modal-overflow-scroll-x');\n }\n if (document.documentElement.clientHeight > window.innerHeight) {\n document.documentElement.classList.add('cy-modal-overflow-scroll-y');\n }\n document.body.classList.add(CY_MODAL_CLASS);\n}\nfunction freeBodyScroll() {\n const scrollY = parseInt(document.body.getAttribute(ATTR_DATA_MODAL_SCROLL_TOP) || '0');\n document.body.classList.remove(CY_MODAL_CLASS);\n document.documentElement.classList.remove('cy-modal-overflow-scroll-x');\n document.documentElement.classList.remove('cy-modal-overflow-scroll-y');\n window.scrollTo({ top: scrollY });\n}\n\nconst ClassModal = 'pointer-events-auto fixed flex flex-col rounded outline outline-4 outline-gray-500/[.40] bg-white backdrop:bg-gray-900/[.80] backdrop:backdrop-blur-sm';\nconst ClassModalStandardDimensions = 'max-h-[80vh] min-w-[200px] sm:min-w-[390px] max-w-[calc(100vw-32px)] sm:max-w-[70vw] shrink-0';\nconst ClassModalFullscreenDimensions = 'h-[calc(100vh-32px)] sm:w-[calc(100vw-32px)]';\nconst ClassTitleBox = 'flex shrink-0 items-center justify-between rounded-t-md border-b border-gray-100 p-[16px] sm:px-[24px]';\nconst ClassTitle = 'text-[18px] font-medium leading-[28px] text-gray-900';\nconst ClassHelpLinkDash = 'mx-[8px] h-[1px] w-[32px] bg-gray-100';\nconst ClassHelpLink = 'flex items-center text-[16px] font-normal leading-[24px] text-indigo-500';\nconst ClassCloseButton = 'rounded-full border-transparent p-[4px] outline-none';\nconst ClassContent = 'overflow-y-auto p-[16px] sm:px-[24px]';\n\nexport { ClassCloseButton, ClassContent, ClassHelpLink, ClassHelpLinkDash, ClassModal, ClassModalFullscreenDimensions, ClassModalStandardDimensions, ClassTitle, ClassTitleBox, disableBodyScroll, freeBodyScroll };\n//# sourceMappingURL=index.es.mjs.map\n",null],"names":["React","createPortal","IconActionQuestionMarkCircle","IconActionDelete"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../../constants/dist/index.es.mjs","../Modal.tsx"],"sourcesContent":["const ATTR_DATA_MODAL_SCROLL_TOP = 'data-modal-scroll-top';\nconst CY_MODAL_CLASS = 'cy-modal-overflow-hidden';\nfunction disableBodyScroll() {\n document.body.setAttribute(ATTR_DATA_MODAL_SCROLL_TOP, `${window.scrollY}`);\n if (document.documentElement.clientWidth > window.innerWidth) {\n document.documentElement.classList.add('cy-modal-overflow-scroll-x');\n }\n if (document.documentElement.clientHeight > window.innerHeight) {\n document.documentElement.classList.add('cy-modal-overflow-scroll-y');\n }\n document.body.classList.add(CY_MODAL_CLASS);\n}\nfunction freeBodyScroll() {\n const scrollY = parseInt(document.body.getAttribute(ATTR_DATA_MODAL_SCROLL_TOP) || '0');\n document.body.classList.remove(CY_MODAL_CLASS);\n document.documentElement.classList.remove('cy-modal-overflow-scroll-x');\n document.documentElement.classList.remove('cy-modal-overflow-scroll-y');\n window.scrollTo({ top: scrollY });\n}\n\nconst ClassModal = 'pointer-events-auto fixed flex flex-col rounded outline outline-4 outline-gray-500/[.40] bg-white backdrop:bg-gray-900/[.80] backdrop:backdrop-blur-sm';\nconst ClassModalStandardDimensions = 'max-h-[80vh] min-w-[200px] sm:min-w-[390px] max-w-[calc(100vw-32px)] sm:max-w-[70vw] shrink-0';\nconst ClassModalFullscreenDimensions = 'h-[calc(100vh-32px)] sm:w-[calc(100vw-32px)]';\nconst ClassTitleBox = 'flex shrink-0 items-center justify-between rounded-t-md border-b border-gray-100 p-[16px] sm:px-[24px]';\nconst ClassTitle = 'text-[18px] font-medium leading-[28px] text-gray-900';\nconst ClassHelpLinkDash = 'mx-[8px] h-[1px] w-[32px] bg-gray-100';\nconst ClassHelpLink = 'flex items-center text-[16px] font-normal leading-[24px] text-indigo-500';\nconst ClassCloseButton = 'rounded-full border-transparent p-[4px] outline-none';\nconst ClassContent = 'overflow-y-auto p-[16px] sm:px-[24px]';\n\nexport { ClassCloseButton, ClassContent, ClassHelpLink, ClassHelpLinkDash, ClassModal, ClassModalFullscreenDimensions, ClassModalStandardDimensions, ClassTitle, ClassTitleBox, disableBodyScroll, freeBodyScroll };\n//# sourceMappingURL=index.es.mjs.map\n",null],"names":["React","createPortal","clsx","IconActionQuestionMarkCircle","IconActionDelete"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,0BAA0B,GAAG,uBAAuB,CAAC;AAC3D,MAAM,cAAc,GAAG,0BAA0B,CAAC;AAClD,SAAS,iBAAiB,GAAG;AAC7B,IAAI,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,0BAA0B,EAAE,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAChF,IAAI,IAAI,QAAQ,CAAC,eAAe,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,EAAE;AAClE,QAAQ,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC7E,KAAK;AACL,IAAI,IAAI,QAAQ,CAAC,eAAe,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,EAAE;AACpE,QAAQ,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC7E,KAAK;AACL,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AAChD,CAAC;AACD,SAAS,cAAc,GAAG;AAC1B,IAAI,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,0BAA0B,CAAC,IAAI,GAAG,CAAC,CAAC;AAC5F,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AACnD,IAAI,QAAQ,CAAC,eAAe,CAAC,SAAS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,yBAAyB,EACtB,cAAA,EAAA,UAAU,wBACJ,UAAU,EAC7B,wBAAwB,EACxB,IAAA,EAAA,CAAA,CACH,CACM,CACL;AACN,YAAAJ,gBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,YAAY,EAAA,EAAG,QAAQ,CAAO,CACvC,EACT,QAAQ,CAAC,IAAI,CACd,EACF;AACH;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cypress-design/react-modal",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"*"
|
|
6
6
|
],
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"build:types": "tsc --project ./tsconfig.build.json"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@cypress-design/react-icon": "^
|
|
22
|
+
"@cypress-design/react-icon": "^3.3.2",
|
|
23
23
|
"clsx": "^2.1.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|