mui-dialog 1.0.15 → 1.0.18

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 i=document.createElement("style");i.appendChild(document.createTextNode(".vi-dialog .close-icon{cursor:pointer;color:#717371}.vi-dialog .p-24{padding:24px}.vi-dialog .h-fill{height:-webkit-fill-available}.vi-dialog .d-f{display:flex}.vi-dialog .ai-c{align-items:center}.vi-dialog .jc-sb{justify-content:space-between}.vi-dialog .flex-dir-col{flex-direction:column}.vi-dialog .gap-8{gap:8px}.vi-dialog .MuiPaper-root{border-radius:12px}.vi-dialog .divider{margin-top:28px;margin-bottom:-4px}.vi-dialog .vi-dialog-actions-wrapper{margin-top:28px;display:flex;justify-content:space-between;align-items:center}.vi-dialog .vi-dialog-actions-wrapper .tertiary-cta.destructive{color:#ed1d31;justify-self:flex-start}.vi-dialog .vi-dialog-actions-wrapper .vi-dialog-actions.medium{width:50%}.vi-dialog .vi-dialog-actions-wrapper .vi-dialog-actions.large{width:33%}.vi-dialog .vi-dialog-actions-wrapper .vi-dialog-actions.extra-large{width:25%}.vi-dialog .vi-dialog-actions{display:flex;align-items:center;justify-content:flex-end;gap:16px}.vi-dialog .vi-dialog-actions .vi-dialog-cta{width:-webkit-fill-available}.vi-dialog .vi-dialog-actions .tertiary-cta{padding:0}.vi-dialog .vi-dialog-actions .vi-dialog-cta.destructive{background-color:#ed1d31}.vi-dialog .vi-dialog-actions.without-tertiary{margin-top:28px}.vi-dialog .vi-dialog-actions.small{justify-content:center}.vi-dialog .vi-dialog-actions.without-tertiary.medium{max-width:50%;margin-left:50%}.vi-dialog .vi-dialog-actions.without-tertiary.large{max-width:33%;margin-left:67%}.vi-dialog .vi-dialog-actions.without-tertiary.extra-large{max-width:25%;margin-left:75%}.vi-dialog .vi-dialog-actions.with-tertiary-cta{max-width:100%;margin-left:0}.vi-dialog .vi-dialog-title{margin-bottom:28px}.vi-dialog .vi-dialog-title .description{margin-top:16px!important}.vi-dialog .vi-dialog-title.small{margin-bottom:16px}.vi-dialog .divider{margin-left:-24px;margin-right:-24px}@media only screen and (max-width: 600px){.vi-dialog .MuiPaper-root{margin:16px;width:calc(100% - 32px)}.vi-dialog .vi-dialog-actions-wrapper{flex-direction:column-reverse;gap:12px}.vi-dialog .vi-dialog-actions{flex-direction:column-reverse;width:100%!important;gap:12px}.vi-dialog .vi-dialog-actions.medium,.vi-dialog .vi-dialog-actions.large,.vi-dialog .vi-dialog-actions.extra-large{max-width:100%;margin-left:0}.vi-dialog.medium .MuiPaper-root,.vi-dialog.large .MuiPaper-root{margin:0;width:100%;height:100%;max-height:none;border-radius:0}}")),document.head.appendChild(i)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}}();
1
+ !function(){"use strict";try{if("undefined"!=typeof document){var i=document.createElement("style");i.appendChild(document.createTextNode(".vi-dialog .close-icon{cursor:pointer;color:#717371}.vi-dialog .p-24{padding:24px}.vi-dialog .h-fill{height:-webkit-fill-available}.vi-dialog .safari-height-fix{height:fit-content}.vi-dialog .d-f{display:flex}.vi-dialog .ai-c{align-items:center}.vi-dialog .jc-sb{justify-content:space-between}.vi-dialog .flex-dir-col{flex-direction:column}.vi-dialog .gap-8{gap:8px}.vi-dialog .MuiPaper-root{border-radius:12px}.vi-dialog .divider{margin-top:28px;margin-bottom:-4px}.vi-dialog .vi-dialog-actions-wrapper{margin-top:28px;display:flex;justify-content:space-between;align-items:center}.vi-dialog .vi-dialog-actions-wrapper .tertiary-cta.destructive{color:#ed1d31;justify-self:flex-start}.vi-dialog .vi-dialog-actions-wrapper .vi-dialog-actions.medium{width:50%}.vi-dialog .vi-dialog-actions-wrapper .vi-dialog-actions.large{width:33%}.vi-dialog .vi-dialog-actions-wrapper .vi-dialog-actions.extra-large{width:25%}.vi-dialog .vi-dialog-actions{display:flex;align-items:center;justify-content:flex-end;gap:16px}.vi-dialog .vi-dialog-actions .vi-dialog-cta{width:-webkit-fill-available}.vi-dialog .vi-dialog-actions .tertiary-cta{padding:0}.vi-dialog .vi-dialog-actions .vi-dialog-cta.destructive{background-color:#ed1d31}.vi-dialog .vi-dialog-actions.without-tertiary{margin-top:28px}.vi-dialog .vi-dialog-actions.small{justify-content:center}.vi-dialog .vi-dialog-actions.without-tertiary.medium{max-width:50%;margin-left:50%}.vi-dialog .vi-dialog-actions.without-tertiary.large{max-width:33%;margin-left:67%}.vi-dialog .vi-dialog-actions.without-tertiary.extra-large{max-width:25%;margin-left:75%}.vi-dialog .vi-dialog-actions.with-tertiary-cta{max-width:100%;margin-left:0}.vi-dialog .vi-dialog-title{margin-bottom:28px}.vi-dialog .vi-dialog-title .description{margin-top:16px!important}.vi-dialog .vi-dialog-title.small{margin-bottom:16px}.vi-dialog .divider{margin-left:-24px;margin-right:-24px}@media only screen and (max-width: 600px){.vi-dialog .MuiPaper-root{margin:16px;width:calc(100% - 32px)}.vi-dialog .vi-dialog-actions-wrapper{flex-direction:column-reverse;gap:12px}.vi-dialog .vi-dialog-actions{flex-direction:column-reverse;width:100%!important;gap:12px}.vi-dialog .vi-dialog-actions.medium,.vi-dialog .vi-dialog-actions.large,.vi-dialog .vi-dialog-actions.extra-large{max-width:100%;margin-left:0}.vi-dialog.medium .MuiPaper-root,.vi-dialog.large .MuiPaper-root{margin:0;width:100%;height:100%;max-height:none;border-radius:0}}")),document.head.appendChild(i)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}}();
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
4
  import { forwardRef } from 'react';
@@ -1837,6 +1837,8 @@ const checkIfTertiaryCtaIsAllowed = (type, subtype, size) => {
1837
1837
  return true;
1838
1838
  };
1839
1839
 
1840
+ const IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
1841
+
1840
1842
  const TransitionUp = forwardRef(
1841
1843
  function Transition(props, ref) {
1842
1844
  return /* @__PURE__ */ jsx(Slide, { direction: "up", ref, ...props });
@@ -1873,6 +1875,7 @@ const MuiDialog = (props) => {
1873
1875
  const {
1874
1876
  primaryCtaTitle,
1875
1877
  secondaryCtaTitle,
1878
+ primaryCtaEndIcon,
1876
1879
  isPrimaryCtaLoading = false,
1877
1880
  isSecondaryCtaLoading = false,
1878
1881
  isPrimaryCtaDisabled,
@@ -1911,7 +1914,7 @@ const MuiDialog = (props) => {
1911
1914
  maxWidth: SIZE_TO_MAX_WIDTH[selectedSize],
1912
1915
  fullWidth: true,
1913
1916
  ...rest,
1914
- children: /* @__PURE__ */ jsxs("div", { className: "p-24 h-fill", children: [
1917
+ children: /* @__PURE__ */ jsxs("div", { className: `p-24 h-fill ${IS_SAFARI ? "safari-height-fix" : ""}`, children: [
1915
1918
  title && /* @__PURE__ */ jsxs(
1916
1919
  "div",
1917
1920
  {
@@ -1983,6 +1986,7 @@ const MuiDialog = (props) => {
1983
1986
  onClick: onPrimaryCtaClick,
1984
1987
  loading: !!isPrimaryCtaLoading,
1985
1988
  disabled: isPrimaryCtaDisabled !== void 0 ? isPrimaryCtaDisabled : !!(isSecondaryCtaLoading || isTertiaryCtaLoading),
1989
+ endIcon: primaryCtaEndIcon,
1986
1990
  children: primaryCtaTitle
1987
1991
  }
1988
1992
  )
@@ -2013,6 +2017,7 @@ const MuiDialog = (props) => {
2013
2017
  onClick: onPrimaryCtaClick,
2014
2018
  loading: !!isPrimaryCtaLoading,
2015
2019
  disabled: isPrimaryCtaDisabled !== void 0 ? isPrimaryCtaDisabled : !!(isSecondaryCtaLoading || isTertiaryCtaLoading),
2020
+ endIcon: primaryCtaEndIcon,
2016
2021
  children: primaryCtaTitle
2017
2022
  }
2018
2023
  )
@@ -0,0 +1 @@
1
+ export declare const IS_SAFARI: boolean;
@@ -1,6 +1,7 @@
1
1
  import { CONFIRMATION_SUBTYPES, INFORMATION_SUBTYPES, INPUT_SUBTYPES, MODAL_TYPES, ModalSize, TERTIARY_CTA_TYPES } from './muiDialog.types';
2
2
  interface IActions {
3
3
  primaryCtaTitle?: string;
4
+ primaryCtaEndIcon?: React.ReactNode;
4
5
  secondaryCtaTitle?: string;
5
6
  isPrimaryCtaLoading?: boolean;
6
7
  isPrimaryCtaDisabled?: boolean;
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "url": "https://github.com/viplatform/mui-dialog/issues"
8
8
  },
9
9
  "homepage": "https://github.com/viplatform/mui-dialog#readme",
10
- "version": "1.0.15",
10
+ "version": "1.0.18",
11
11
  "files": [
12
12
  "dist"
13
13
  ],