mui-drawer 1.0.7 → 1.0.8

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.
@@ -1,4 +1,4 @@
1
- !function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".vi-drawer .h-fill{height:-webkit-fill-available}.vi-drawer .d-f{display:flex}.vi-drawer .ai-c{align-items:center}.vi-drawer .jc-sb{justify-content:space-between}.vi-drawer .fd-col{flex-direction:column}.vi-drawer .gap-8{gap:8px}.vi-drawer .MuiDrawer-paper{overflow-y:hidden;max-width:100%}.vi-drawer .drawer-body-pt{padding-top:0}.vi-drawer .drawer-body-pb{padding-bottom:0}.vi-drawer .close-icon{cursor:pointer;color:#717371}.vi-drawer .vi-drawer-actions{position:sticky;bottom:0;padding:24px;background-color:#fff;z-index:50;display:flex;align-items:center;justify-content:flex-end}.vi-drawer .vi-drawer-actions .vi-drawer-action-ctas{display:flex;align-items:center;justify-content:flex-end;gap:16px}.vi-drawer .vi-drawer-actions .vi-drawer-cta{width:50%;align-self:flex-end}.vi-drawer .vi-drawer-actions .vi-drawer-cta.destructive{background-color:#ed1d31}.vi-drawer .vi-drawer-actions.tertiary-cta{justify-content:space-between;gap:16px}.vi-drawer .vi-drawer-actions.tertiary-cta .tertiary-cta-destructive{color:#ed1d31}.vi-drawer .vi-drawer-actions.divider{border-top:1px solid #e9e9e9}.vi-drawer .vi-drawer-title{position:sticky;top:0;padding:24px 24px 28px;background-color:#fff;z-index:50}.vi-drawer .vi-drawer-title .description{margin-top:16px!important}.vi-drawer .drawer-children{padding:24px;overflow-y:auto;height:100%}.vi-drawer .drawer-children.with-header-footer{padding-top:0;padding-bottom:28px;height:calc(100% - 173px)}.vi-drawer .drawer-children.with-header{padding-top:0;height:calc(100% - 80px)}.vi-drawer .drawer-children.with-footer{padding-bottom:28px;height:calc(100% - 93px)}.vi-drawer .drawer-children.no-divider{padding-bottom:0}@media only screen and (max-width: 600px){.vi-drawer .MuiPaper-root{margin:0;width:100%;height:100%}.vi-drawer .vi-drawer-actions-wrapper,.vi-drawer .vi-drawer-actions{flex-direction:column-reverse;gap:12px}.vi-drawer .vi-drawer-actions .vi-drawer-action-ctas{flex-direction:column-reverse;width:100%!important;gap:12px}.vi-drawer .vi-drawer-actions .vi-drawer-cta{width:100%}.vi-drawer .drawer-children.one-cta.with-header-footer{height:calc(100% - 170px)}.vi-drawer .drawer-children.one-cta.with-header{height:calc(100% - 80px)}.vi-drawer .drawer-children.one-cta.with-footer{height:calc(100% - 90px)}.vi-drawer .drawer-children.two-ctas.with-header-footer{height:calc(100% - 222px)}.vi-drawer .drawer-children.two-ctas.with-header{height:calc(100% - 80px)}.vi-drawer .drawer-children.two-ctas.with-footer{height:calc(100% - 142px)}.vi-drawer .drawer-children.three-ctas.with-header-footer{height:calc(100% - 259px)}.vi-drawer .drawer-children.three-ctas.with-header{height:calc(100% - 80px)}.vi-drawer .drawer-children.three-ctas.with-footer{height:calc(100% - 179px)}}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}}();
1
+ !function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".vi-drawer .h-fill{height:-webkit-fill-available}.vi-drawer .safari-flex-container{display:flex;flex-direction:column;height:100%}.vi-drawer .d-f{display:flex}.vi-drawer .ai-c{align-items:center}.vi-drawer .jc-sb{justify-content:space-between}.vi-drawer .fd-col{flex-direction:column}.vi-drawer .gap-8{gap:8px}.vi-drawer .MuiDrawer-paper{overflow-y:hidden;max-width:100%}.vi-drawer .drawer-body-pt{padding-top:0}.vi-drawer .drawer-body-pb{padding-bottom:0}.vi-drawer .close-icon{cursor:pointer;color:#717371}.vi-drawer .vi-drawer-actions{position:sticky;bottom:0;padding:24px;background-color:#fff;z-index:50;display:flex;align-items:center;justify-content:flex-end}.vi-drawer .vi-drawer-actions .vi-drawer-action-ctas{display:flex;align-items:center;justify-content:flex-end;gap:16px}.vi-drawer .vi-drawer-actions .vi-drawer-cta{width:50%;align-self:flex-end}.vi-drawer .vi-drawer-actions .vi-drawer-cta.destructive{background-color:#ed1d31}.vi-drawer .vi-drawer-actions.tertiary-cta{justify-content:space-between;gap:16px}.vi-drawer .vi-drawer-actions.tertiary-cta .tertiary-cta-destructive{color:#ed1d31}.vi-drawer .vi-drawer-actions.divider{border-top:1px solid #e9e9e9}.vi-drawer .vi-drawer-title{position:sticky;top:0;padding:24px 24px 28px;background-color:#fff;z-index:50}.vi-drawer .vi-drawer-title .description{margin-top:16px!important}.vi-drawer .drawer-children{padding:24px;overflow-y:auto;height:100%}.vi-drawer .drawer-children.with-header-footer{padding-top:0;padding-bottom:28px;height:calc(100% - 173px)}.vi-drawer .drawer-children.with-header{padding-top:0;height:calc(100% - 80px)}.vi-drawer .drawer-children.with-footer{padding-bottom:28px;height:calc(100% - 93px)}.vi-drawer .drawer-children.no-divider{padding-bottom:0}@media only screen and (max-width: 600px){.vi-drawer .MuiPaper-root{margin:0;width:100%;height:100%}.vi-drawer .vi-drawer-actions-wrapper,.vi-drawer .vi-drawer-actions{flex-direction:column-reverse;gap:12px}.vi-drawer .vi-drawer-actions .vi-drawer-action-ctas{flex-direction:column-reverse;width:100%!important;gap:12px}.vi-drawer .vi-drawer-actions .vi-drawer-cta{width:100%}.vi-drawer .drawer-children.one-cta.with-header-footer{height:calc(100% - 170px)}.vi-drawer .drawer-children.one-cta.with-header{height:calc(100% - 80px)}.vi-drawer .drawer-children.one-cta.with-footer{height:calc(100% - 90px)}.vi-drawer .drawer-children.two-ctas.with-header-footer{height:calc(100% - 222px)}.vi-drawer .drawer-children.two-ctas.with-header{height:calc(100% - 80px)}.vi-drawer .drawer-children.two-ctas.with-footer{height:calc(100% - 142px)}.vi-drawer .drawer-children.three-ctas.with-header-footer{height:calc(100% - 259px)}.vi-drawer .drawer-children.three-ctas.with-header{height:calc(100% - 80px)}.vi-drawer .drawer-children.three-ctas.with-footer{height:calc(100% - 179px)}}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}}();
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
4
  import { useState, useRef, useEffect } from 'react';
@@ -1862,10 +1862,11 @@ const DRAWER_CONFIGS = {
1862
1862
  }
1863
1863
  };
1864
1864
  const TERTIARY_CTA_TYPES = {
1865
- DEFAULT: "default",
1866
1865
  DESTRUCTIVE: "destructive"
1867
1866
  };
1868
1867
 
1868
+ const IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
1869
+
1869
1870
  const MuiDrawer = (props) => {
1870
1871
  const [isOpen, setIsOpen] = useState(false);
1871
1872
  const [actionsMaxWidth, setActionsMaxWidth] = useState("50%");
@@ -1951,7 +1952,7 @@ const MuiDrawer = (props) => {
1951
1952
  onClose: handleClose,
1952
1953
  transitionDuration: 300,
1953
1954
  ...rest,
1954
- children: /* @__PURE__ */ jsxs("div", { ref: drawerRef, style: { width, maxWidth }, className: "h-fill", children: [
1955
+ children: /* @__PURE__ */ jsxs("div", { ref: drawerRef, style: { width, maxWidth }, className: classNames("h-fill", IS_SAFARI && "safari-flex-container"), children: [
1955
1956
  title && /* @__PURE__ */ jsxs("div", { className: "vi-drawer-title", children: [
1956
1957
  /* @__PURE__ */ jsxs("div", { className: "d-f ai-c jc-sb", children: [
1957
1958
  /* @__PURE__ */ jsxs("div", { className: "d-f fd-col gap-8", children: [
@@ -2079,4 +2080,4 @@ const MuiDrawer = (props) => {
2079
2080
  ) });
2080
2081
  };
2081
2082
 
2082
- export { DRAWER_CONFIGS, DRAWER_TYPES, INFORMATION_SUBTYPES, INPUT_SUBTYPES, MuiDrawer, TERTIARY_CTA_TYPES };
2083
+ export { MuiDrawer as default };
@@ -0,0 +1 @@
1
+ export declare const IS_SAFARI: boolean;
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "url": "https://github.com/viplatform/mui-drawer/issues"
8
8
  },
9
9
  "homepage": "https://github.com/viplatform/mui-drawer#readme",
10
- "version": "1.0.7",
10
+ "version": "1.0.8",
11
11
  "files": [
12
12
  "dist"
13
13
  ],
@@ -55,9 +55,9 @@
55
55
  "@emotion/react": "^11.14.0",
56
56
  "@emotion/styled": "^11.14.0",
57
57
  "@mui/material": "^7.0.2",
58
- "@types/react": "^18.0.0 || ^19.0.0",
59
- "react": "^18.0.0 || ^19.0.0",
60
- "react-dom": "^18.0.0 || ^19.0.0"
58
+ "@types/react": "^19.0.0",
59
+ "react": "^19.1.0",
60
+ "react-dom": "^19.1.0"
61
61
  },
62
62
  "peerDependenciesMeta": {
63
63
  "@types/react": {
@@ -70,10 +70,7 @@
70
70
  "@mui/icons-material": "^7.1.0",
71
71
  "@mui/lab": "^7.0.0-beta.12",
72
72
  "@mui/material": "^7.0.2",
73
- "@types/react": "^18.0.0 || ^19.0.0",
74
- "classnames": "^2.5.1",
75
- "react": "^18.0.0 || ^19.0.0",
76
- "react-dom": "^18.0.0 || ^19.0.0"
73
+ "classnames": "^2.5.1"
77
74
  },
78
75
  "devDependencies": {
79
76
  "@emotion/react": "^11.14.0",