@cypress-design/react-modal 0.0.3 → 0.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/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) {
@@ -30939,7 +30939,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
30939
30939
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
30940
30940
  PERFORMANCE OF THIS SOFTWARE.
30941
30941
  ***************************************************************************** */
30942
- /* global Reflect, Promise */
30942
+ /* global Reflect, Promise, SuppressedError, Symbol */
30943
30943
 
30944
30944
 
30945
30945
  var __assign = function() {
@@ -30963,7 +30963,12 @@ function __rest(s, e) {
30963
30963
  t[p[i]] = s[p[i]];
30964
30964
  }
30965
30965
  return t;
30966
- }
30966
+ }
30967
+
30968
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
30969
+ var e = new Error(message);
30970
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
30971
+ };
30967
30972
 
30968
30973
  var compileReactIconProperties = function (_a) {
30969
30974
  var body = _a.body, defs = _a.defs, compiledClasses = _a.compiledClasses, size = _a.size, name = _a.name, attributes = __rest(_a, ["body", "defs", "compiledClasses", "size", "name"]);
@@ -31046,18 +31051,20 @@ function freeBodyScroll() {
31046
31051
  window.scrollTo({ top: scrollY });
31047
31052
  }
31048
31053
 
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] flex h-full w-screen items-center justify-center overflow-hidden';
31051
- const ClassModal = 'pointer-events-auto relative flex max-h-[80vh] min-w-[200px] flex-col rounded-lg border-4 border-gray-700 bg-white sm:min-w-[390px] sm:max-w-[70vw]';
31052
- const ClassTitleBox = 'flex shrink-0 items-center justify-between rounded-t-md border-b border-gray-100 p-[16px] px-[24px]';
31054
+ const ClassBackDrop = 'fixed left-0 top-0 z-[1000010] h-screen w-screen bg-gray-900/[.80] backdrop-blur-sm';
31055
+ const ClassModalContainer = 'pointer-events-none fixed left-0 top-0 z-[1000020] h-full w-screen overflow-hidden flex items-center justify-center';
31056
+ const ClassModal = 'pointer-events-auto relative flex flex-col rounded outline outline-4 outline-gray-500/[.40] bg-white';
31057
+ const ClassModalStandardDimensions = 'max-h-[80vh] min-w-[200px] sm:min-w-[390px] max-w-[calc(100vw-32px)] sm:max-w-[70vw] shrink-0';
31058
+ const ClassModalFullscreenDimensions = 'h-[calc(100vh-32px)] sm:w-[calc(100vw-32px)]';
31059
+ const ClassTitleBox = 'flex shrink-0 items-center justify-between rounded-t-md border-b border-gray-100 p-[16px] px-16px sm:px-[24px]';
31053
31060
  const ClassTitle = 'text-[18px] font-medium leading-[28px] text-gray-900';
31054
31061
  const ClassHelpLinkDash = 'mx-[8px] h-[1px] w-[32px] bg-gray-100';
31055
31062
  const ClassHelpLink = 'flex items-center text-[16px] font-normal leading-[24px] text-indigo-500';
31056
31063
  const ClassCloseButton = 'group rounded-full border-transparent p-[4px] outline-none';
31057
- const ClassContent = 'overflow-y-auto p-[16px]';
31064
+ const ClassContent = 'overflow-y-auto p-[16px] sm:px-[24px]';
31058
31065
 
31059
31066
  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;
31067
+ 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
31068
  React__namespace.useEffect(function () {
31062
31069
  if (show) {
31063
31070
  disableBodyScroll();
@@ -31073,7 +31080,9 @@ var Modal = function (_a) {
31073
31080
  reactDomExports.createPortal(React__namespace.createElement("div", null,
31074
31081
  React__namespace.createElement("div", { className: ClassBackDrop, onClick: function () { return onClose === null || onClose === void 0 ? void 0 : onClose(); } }),
31075
31082
  React__namespace.createElement("div", { className: ClassModalContainer, tabIndex: -1, "aria-modal": "true", role: "modal" },
31076
- React__namespace.createElement("div", { className: ClassModal },
31083
+ React__namespace.createElement("div", { className: clsx(ClassModal, fullscreen
31084
+ ? ClassModalFullscreenDimensions
31085
+ : ClassModalStandardDimensions) },
31077
31086
  React__namespace.createElement("div", { className: ClassTitleBox },
31078
31087
  React__namespace.createElement("div", { className: ClassTitle }, title),
31079
31088
  helpLink ? React__namespace.createElement("div", { className: ClassHelpLinkDash }) : null,
@@ -31089,4 +31098,4 @@ var Modal = function (_a) {
31089
31098
  module.exports = Modal;
31090
31099
  //# sourceMappingURL=index.umd.js.map
31091
31100
 
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] flex h-full items-center justify-center overflow-hidden pointer-events-auto relative max-h-[80vh] min-w-[200px] flex-col rounded-lg border-4 border-gray-700 bg-white sm:min-w-[390px] sm:max-w-[70vw] shrink-0 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"> */
31101
+ /* <wind-keep class="ml-[4px] grow children:transition-all fixed left-0 top-0 z-[1000010] h-screen w-screen bg-gray-900/[.80] backdrop-blur-sm pointer-events-none z-[1000020] h-full overflow-hidden flex items-center justify-center pointer-events-auto relative flex-col rounded outline outline-4 outline-gray-500/[.40] bg-white max-h-[80vh] min-w-[200px] sm:min-w-[390px] max-w-[calc(100vw-32px)] 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] sm: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"> */