react-asc 25.2.7 → 25.2.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,2 +1,6 @@
1
1
  import React from 'react';
2
- export declare const ModalFooter: ({ children }: React.ComponentProps<'div'>) => JSX.Element;
2
+ interface IModalFooterProps extends React.ComponentProps<'div'> {
3
+ shadow?: boolean;
4
+ }
5
+ export declare const ModalFooter: (props: IModalFooterProps) => JSX.Element;
6
+ export {};
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  interface IModalHeaderProps extends React.ComponentProps<'div'> {
3
3
  onClose?: () => void;
4
4
  isDismissable?: boolean;
5
+ shadow?: boolean;
5
6
  }
6
7
  export declare const ModalHeader: (props: IModalHeaderProps) => JSX.Element;
7
8
  export {};
package/index.es.js CHANGED
@@ -1798,32 +1798,49 @@ class LoadingIndicatorService {
1798
1798
  }
1799
1799
  const loadingIndicatorService = new LoadingIndicatorService();
1800
1800
 
1801
- var css_248z$p = ".ModalHeader-module_modalHeader__tw-u- {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: space-between;\n padding: 1rem 1rem 0 1rem;\n border-top-left-radius: calc(0.3rem - 1px);\n border-top-right-radius: calc(0.3rem - 1px);\n border-bottom: none;\n align-items: center;\n}\n\n.ModalHeader-module_modalTitle__2xShH {\n margin-bottom: 0;\n line-height: 1.5;\n}";
1802
- var styles$p = {"modalHeader":"ModalHeader-module_modalHeader__tw-u-","modalTitle":"ModalHeader-module_modalTitle__2xShH"};
1801
+ var css_248z$p = ".ModalHeader-module_modalHeader__tw-u- {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: space-between;\n padding: 1rem;\n border-top-left-radius: calc(0.3rem - 1px);\n border-top-right-radius: calc(0.3rem - 1px);\n border-bottom: none;\n align-items: center;\n}\n.ModalHeader-module_modalHeader__tw-u-.ModalHeader-module_shadow__qELWb {\n box-shadow: var(--shadow);\n}\n\n.ModalHeader-module_modalTitle__2xShH {\n margin-bottom: 0;\n line-height: 1.5;\n}";
1802
+ var styles$p = {"modalHeader":"ModalHeader-module_modalHeader__tw-u-","shadow":"ModalHeader-module_shadow__qELWb","modalTitle":"ModalHeader-module_modalTitle__2xShH"};
1803
1803
  styleInject(css_248z$p);
1804
1804
 
1805
1805
  const ModalHeader = (props) => {
1806
- const { children, isDismissable = false, onClose, ...rest } = props;
1806
+ const { children, shadow, className, isDismissable = false, onClose, ...rest } = props;
1807
+ const getCssClasses = () => {
1808
+ const cssClasses = [];
1809
+ cssClasses.push(styles$p.modalHeader);
1810
+ shadow && cssClasses.push(styles$p.shadow);
1811
+ className && cssClasses.push(className);
1812
+ return cssClasses.filter(css => css).join(' ');
1813
+ };
1807
1814
  const handleClick = () => {
1808
1815
  onClose && onClose();
1809
1816
  };
1810
- return (React.createElement("div", { className: styles$p.modalHeader, ...rest },
1817
+ return (React.createElement("div", { className: getCssClasses(), ...rest },
1811
1818
  React.createElement("h5", { className: styles$p.modalTitle }, children),
1812
1819
  isDismissable &&
1813
1820
  React.createElement(IconButton, { icon: React.createElement(TimesSolidIcon, null), variant: VARIANT.text, onClick: handleClick })));
1814
1821
  };
1815
1822
 
1816
- var css_248z$o = ".ModalBody-module_modalBody__D-gk2 {\n position: relative;\n flex: 1 1 auto;\n padding: 1rem;\n}";
1823
+ var css_248z$o = ".ModalBody-module_modalBody__D-gk2 {\n position: relative;\n flex: 1 1 auto;\n padding: 1rem;\n overflow-y: auto;\n}";
1817
1824
  var styles$o = {"modalBody":"ModalBody-module_modalBody__D-gk2"};
1818
1825
  styleInject(css_248z$o);
1819
1826
 
1820
1827
  const ModalBody = ({ children }) => (React.createElement("div", { className: styles$o.modalBody }, children));
1821
1828
 
1822
- var css_248z$n = ".ModalFooter-module_modalFooter__SNm-f {\n display: flex;\n flex-wrap: wrap;\n flex-shrink: 0;\n align-items: center;\n justify-content: flex-end;\n padding: 0.75rem;\n border-bottom-right-radius: calc(0.3rem - 1px);\n border-bottom-left-radius: calc(0.3rem - 1px);\n}\n.ModalFooter-module_modalFooter__SNm-f > * {\n margin: 0.25rem;\n}";
1823
- var styles$n = {"modalFooter":"ModalFooter-module_modalFooter__SNm-f"};
1829
+ var css_248z$n = ".ModalFooter-module_modalFooter__SNm-f {\n display: flex;\n flex-wrap: wrap;\n flex-shrink: 0;\n align-items: center;\n justify-content: flex-end;\n padding: 0.75rem;\n border-bottom-right-radius: calc(0.3rem - 1px);\n border-bottom-left-radius: calc(0.3rem - 1px);\n}\n.ModalFooter-module_modalFooter__SNm-f.ModalFooter-module_shadow__z29Cy {\n box-shadow: var(--shadow);\n}\n.ModalFooter-module_modalFooter__SNm-f > * {\n margin: 0.25rem;\n}";
1830
+ var styles$n = {"modalFooter":"ModalFooter-module_modalFooter__SNm-f","shadow":"ModalFooter-module_shadow__z29Cy"};
1824
1831
  styleInject(css_248z$n);
1825
1832
 
1826
- const ModalFooter = ({ children }) => (React.createElement("div", { className: styles$n.modalFooter }, children));
1833
+ const ModalFooter = (props) => {
1834
+ const { children, shadow, className, ...rest } = props;
1835
+ const getCssClasses = () => {
1836
+ const cssClasses = [];
1837
+ cssClasses.push(styles$n.modalFooter);
1838
+ shadow && cssClasses.push(styles$n.shadow);
1839
+ className && cssClasses.push(className);
1840
+ return cssClasses.filter(css => css).join(' ');
1841
+ };
1842
+ return (React.createElement("div", { className: getCssClasses(), ...rest }, children));
1843
+ };
1827
1844
 
1828
1845
  var css_248z$m = ".Modal-module_modal__HMxWV {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n outline: 0;\n z-index: 1111 !important;\n border-radius: var(--borderRadius);\n}\n.Modal-module_modal__HMxWV .Modal-module_modal-dialog__U2wGf .Modal-module_sm__CsR6U {\n max-width: 300px;\n}\n.Modal-module_modal__HMxWV .Modal-module_modal-dialog__U2wGf .Modal-module_md__lNggx {\n max-width: 500px;\n}\n.Modal-module_modal__HMxWV .Modal-module_modal-dialog__U2wGf .Modal-module_lg__6dtT2 {\n max-width: 1140px;\n}\n@media (min-width: 576px) {\n .Modal-module_modal__HMxWV .Modal-module_modal-dialog__U2wGf {\n max-width: 600px;\n }\n}\n\n.Modal-module_modalDialog__fNqyK {\n position: relative;\n width: auto;\n pointer-events: none;\n}\n\n.Modal-module_modalDialogCentered__sa2wv {\n height: 100%;\n display: flex;\n align-items: center;\n}\n\n.Modal-module_modalContent__9wAwB {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n pointer-events: auto;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-radius: 0.3rem;\n box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.08);\n outline: 0;\n margin: 1rem;\n}\n@media (min-width: 576px) {\n .Modal-module_modalContent__9wAwB {\n max-width: 500px;\n margin: auto;\n }\n}\n\n.Modal-module_fullscreen__iepGa {\n width: 100% !important;\n height: 100% !important;\n max-height: 100% !important;\n margin: 0;\n padding: 0;\n}\n.Modal-module_fullscreen__iepGa .Modal-module_modalContent__9wAwB {\n margin: 0;\n height: auto;\n min-height: 100%;\n max-height: 100%;\n border-radius: 0;\n overflow: auto;\n max-width: 100%;\n}\n@media (min-width: 320px) {\n .Modal-module_fullscreen__iepGa {\n max-width: 100% !important;\n }\n}";
1829
1846
  var styles$m = {"modal":"Modal-module_modal__HMxWV","modal-dialog":"Modal-module_modal-dialog__U2wGf","sm":"Modal-module_sm__CsR6U","md":"Modal-module_md__lNggx","lg":"Modal-module_lg__6dtT2","modalDialog":"Modal-module_modalDialog__fNqyK","modalDialogCentered":"Modal-module_modalDialogCentered__sa2wv","modalContent":"Modal-module_modalContent__9wAwB","fullscreen":"Modal-module_fullscreen__iepGa"};
@@ -1831,11 +1848,21 @@ styleInject(css_248z$m);
1831
1848
 
1832
1849
  const Modal = (props) => {
1833
1850
  const { target = document.body, className, size, fullScreen, children, header, footer, onHeaderCloseClick, onBackdropClick, isDismissable = false } = props;
1851
+ const { isMobile } = useMobileDetect();
1852
+ const [isFullScreen, setIsFullScreen] = useState(fullScreen);
1853
+ useEffect(() => {
1854
+ if (isMobile === true && (fullScreen === true || fullScreen === undefined)) {
1855
+ setIsFullScreen(true);
1856
+ }
1857
+ else {
1858
+ setIsFullScreen(false);
1859
+ }
1860
+ }, [isMobile, fullScreen]);
1834
1861
  const getCssClass = () => {
1835
1862
  const cssClasses = [];
1836
1863
  cssClasses.push(styles$m.modalDialog);
1837
1864
  cssClasses.push(styles$m.modalDialogCentered);
1838
- fullScreen && cssClasses.push(styles$m.fullscreen);
1865
+ isFullScreen && cssClasses.push(styles$m.fullscreen);
1839
1866
  size && cssClasses.push(styles$m[size]);
1840
1867
  className && cssClasses.push(className);
1841
1868
  return cssClasses.filter(r => r).join(' ');
@@ -1855,7 +1882,7 @@ const Modal = (props) => {
1855
1882
  React.createElement("div", { className: getCssClass() },
1856
1883
  React.createElement("div", { className: styles$m.modalContent },
1857
1884
  header &&
1858
- React.createElement(ModalHeader, { isDismissable: isDismissable, onClose: () => onHeaderCloseClick && onHeaderCloseClick() }, header),
1885
+ React.createElement(ModalHeader, { shadow: fullScreen, isDismissable: isDismissable, onClose: () => onHeaderCloseClick && onHeaderCloseClick() }, header),
1859
1886
  React.createElement(ModalBody, null, children),
1860
1887
  footer &&
1861
1888
  React.createElement(ModalFooter, null, footer))))),
package/index.js CHANGED
@@ -1807,32 +1807,49 @@ class LoadingIndicatorService {
1807
1807
  }
1808
1808
  const loadingIndicatorService = new LoadingIndicatorService();
1809
1809
 
1810
- var css_248z$p = ".ModalHeader-module_modalHeader__tw-u- {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: space-between;\n padding: 1rem 1rem 0 1rem;\n border-top-left-radius: calc(0.3rem - 1px);\n border-top-right-radius: calc(0.3rem - 1px);\n border-bottom: none;\n align-items: center;\n}\n\n.ModalHeader-module_modalTitle__2xShH {\n margin-bottom: 0;\n line-height: 1.5;\n}";
1811
- var styles$p = {"modalHeader":"ModalHeader-module_modalHeader__tw-u-","modalTitle":"ModalHeader-module_modalTitle__2xShH"};
1810
+ var css_248z$p = ".ModalHeader-module_modalHeader__tw-u- {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: space-between;\n padding: 1rem;\n border-top-left-radius: calc(0.3rem - 1px);\n border-top-right-radius: calc(0.3rem - 1px);\n border-bottom: none;\n align-items: center;\n}\n.ModalHeader-module_modalHeader__tw-u-.ModalHeader-module_shadow__qELWb {\n box-shadow: var(--shadow);\n}\n\n.ModalHeader-module_modalTitle__2xShH {\n margin-bottom: 0;\n line-height: 1.5;\n}";
1811
+ var styles$p = {"modalHeader":"ModalHeader-module_modalHeader__tw-u-","shadow":"ModalHeader-module_shadow__qELWb","modalTitle":"ModalHeader-module_modalTitle__2xShH"};
1812
1812
  styleInject(css_248z$p);
1813
1813
 
1814
1814
  const ModalHeader = (props) => {
1815
- const { children, isDismissable = false, onClose, ...rest } = props;
1815
+ const { children, shadow, className, isDismissable = false, onClose, ...rest } = props;
1816
+ const getCssClasses = () => {
1817
+ const cssClasses = [];
1818
+ cssClasses.push(styles$p.modalHeader);
1819
+ shadow && cssClasses.push(styles$p.shadow);
1820
+ className && cssClasses.push(className);
1821
+ return cssClasses.filter(css => css).join(' ');
1822
+ };
1816
1823
  const handleClick = () => {
1817
1824
  onClose && onClose();
1818
1825
  };
1819
- return (React__default["default"].createElement("div", { className: styles$p.modalHeader, ...rest },
1826
+ return (React__default["default"].createElement("div", { className: getCssClasses(), ...rest },
1820
1827
  React__default["default"].createElement("h5", { className: styles$p.modalTitle }, children),
1821
1828
  isDismissable &&
1822
1829
  React__default["default"].createElement(IconButton, { icon: React__default["default"].createElement(TimesSolidIcon, null), variant: exports.VARIANT.text, onClick: handleClick })));
1823
1830
  };
1824
1831
 
1825
- var css_248z$o = ".ModalBody-module_modalBody__D-gk2 {\n position: relative;\n flex: 1 1 auto;\n padding: 1rem;\n}";
1832
+ var css_248z$o = ".ModalBody-module_modalBody__D-gk2 {\n position: relative;\n flex: 1 1 auto;\n padding: 1rem;\n overflow-y: auto;\n}";
1826
1833
  var styles$o = {"modalBody":"ModalBody-module_modalBody__D-gk2"};
1827
1834
  styleInject(css_248z$o);
1828
1835
 
1829
1836
  const ModalBody = ({ children }) => (React__default["default"].createElement("div", { className: styles$o.modalBody }, children));
1830
1837
 
1831
- var css_248z$n = ".ModalFooter-module_modalFooter__SNm-f {\n display: flex;\n flex-wrap: wrap;\n flex-shrink: 0;\n align-items: center;\n justify-content: flex-end;\n padding: 0.75rem;\n border-bottom-right-radius: calc(0.3rem - 1px);\n border-bottom-left-radius: calc(0.3rem - 1px);\n}\n.ModalFooter-module_modalFooter__SNm-f > * {\n margin: 0.25rem;\n}";
1832
- var styles$n = {"modalFooter":"ModalFooter-module_modalFooter__SNm-f"};
1838
+ var css_248z$n = ".ModalFooter-module_modalFooter__SNm-f {\n display: flex;\n flex-wrap: wrap;\n flex-shrink: 0;\n align-items: center;\n justify-content: flex-end;\n padding: 0.75rem;\n border-bottom-right-radius: calc(0.3rem - 1px);\n border-bottom-left-radius: calc(0.3rem - 1px);\n}\n.ModalFooter-module_modalFooter__SNm-f.ModalFooter-module_shadow__z29Cy {\n box-shadow: var(--shadow);\n}\n.ModalFooter-module_modalFooter__SNm-f > * {\n margin: 0.25rem;\n}";
1839
+ var styles$n = {"modalFooter":"ModalFooter-module_modalFooter__SNm-f","shadow":"ModalFooter-module_shadow__z29Cy"};
1833
1840
  styleInject(css_248z$n);
1834
1841
 
1835
- const ModalFooter = ({ children }) => (React__default["default"].createElement("div", { className: styles$n.modalFooter }, children));
1842
+ const ModalFooter = (props) => {
1843
+ const { children, shadow, className, ...rest } = props;
1844
+ const getCssClasses = () => {
1845
+ const cssClasses = [];
1846
+ cssClasses.push(styles$n.modalFooter);
1847
+ shadow && cssClasses.push(styles$n.shadow);
1848
+ className && cssClasses.push(className);
1849
+ return cssClasses.filter(css => css).join(' ');
1850
+ };
1851
+ return (React__default["default"].createElement("div", { className: getCssClasses(), ...rest }, children));
1852
+ };
1836
1853
 
1837
1854
  var css_248z$m = ".Modal-module_modal__HMxWV {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n outline: 0;\n z-index: 1111 !important;\n border-radius: var(--borderRadius);\n}\n.Modal-module_modal__HMxWV .Modal-module_modal-dialog__U2wGf .Modal-module_sm__CsR6U {\n max-width: 300px;\n}\n.Modal-module_modal__HMxWV .Modal-module_modal-dialog__U2wGf .Modal-module_md__lNggx {\n max-width: 500px;\n}\n.Modal-module_modal__HMxWV .Modal-module_modal-dialog__U2wGf .Modal-module_lg__6dtT2 {\n max-width: 1140px;\n}\n@media (min-width: 576px) {\n .Modal-module_modal__HMxWV .Modal-module_modal-dialog__U2wGf {\n max-width: 600px;\n }\n}\n\n.Modal-module_modalDialog__fNqyK {\n position: relative;\n width: auto;\n pointer-events: none;\n}\n\n.Modal-module_modalDialogCentered__sa2wv {\n height: 100%;\n display: flex;\n align-items: center;\n}\n\n.Modal-module_modalContent__9wAwB {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n pointer-events: auto;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-radius: 0.3rem;\n box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.08);\n outline: 0;\n margin: 1rem;\n}\n@media (min-width: 576px) {\n .Modal-module_modalContent__9wAwB {\n max-width: 500px;\n margin: auto;\n }\n}\n\n.Modal-module_fullscreen__iepGa {\n width: 100% !important;\n height: 100% !important;\n max-height: 100% !important;\n margin: 0;\n padding: 0;\n}\n.Modal-module_fullscreen__iepGa .Modal-module_modalContent__9wAwB {\n margin: 0;\n height: auto;\n min-height: 100%;\n max-height: 100%;\n border-radius: 0;\n overflow: auto;\n max-width: 100%;\n}\n@media (min-width: 320px) {\n .Modal-module_fullscreen__iepGa {\n max-width: 100% !important;\n }\n}";
1838
1855
  var styles$m = {"modal":"Modal-module_modal__HMxWV","modal-dialog":"Modal-module_modal-dialog__U2wGf","sm":"Modal-module_sm__CsR6U","md":"Modal-module_md__lNggx","lg":"Modal-module_lg__6dtT2","modalDialog":"Modal-module_modalDialog__fNqyK","modalDialogCentered":"Modal-module_modalDialogCentered__sa2wv","modalContent":"Modal-module_modalContent__9wAwB","fullscreen":"Modal-module_fullscreen__iepGa"};
@@ -1840,11 +1857,21 @@ styleInject(css_248z$m);
1840
1857
 
1841
1858
  const Modal = (props) => {
1842
1859
  const { target = document.body, className, size, fullScreen, children, header, footer, onHeaderCloseClick, onBackdropClick, isDismissable = false } = props;
1860
+ const { isMobile } = useMobileDetect();
1861
+ const [isFullScreen, setIsFullScreen] = React.useState(fullScreen);
1862
+ React.useEffect(() => {
1863
+ if (isMobile === true && (fullScreen === true || fullScreen === undefined)) {
1864
+ setIsFullScreen(true);
1865
+ }
1866
+ else {
1867
+ setIsFullScreen(false);
1868
+ }
1869
+ }, [isMobile, fullScreen]);
1843
1870
  const getCssClass = () => {
1844
1871
  const cssClasses = [];
1845
1872
  cssClasses.push(styles$m.modalDialog);
1846
1873
  cssClasses.push(styles$m.modalDialogCentered);
1847
- fullScreen && cssClasses.push(styles$m.fullscreen);
1874
+ isFullScreen && cssClasses.push(styles$m.fullscreen);
1848
1875
  size && cssClasses.push(styles$m[size]);
1849
1876
  className && cssClasses.push(className);
1850
1877
  return cssClasses.filter(r => r).join(' ');
@@ -1864,7 +1891,7 @@ const Modal = (props) => {
1864
1891
  React__default["default"].createElement("div", { className: getCssClass() },
1865
1892
  React__default["default"].createElement("div", { className: styles$m.modalContent },
1866
1893
  header &&
1867
- React__default["default"].createElement(ModalHeader, { isDismissable: isDismissable, onClose: () => onHeaderCloseClick && onHeaderCloseClick() }, header),
1894
+ React__default["default"].createElement(ModalHeader, { shadow: fullScreen, isDismissable: isDismissable, onClose: () => onHeaderCloseClick && onHeaderCloseClick() }, header),
1868
1895
  React__default["default"].createElement(ModalBody, null, children),
1869
1896
  footer &&
1870
1897
  React__default["default"].createElement(ModalFooter, null, footer))))),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-asc",
3
- "version": "25.2.7",
3
+ "version": "25.2.8",
4
4
  "description": "handcrafted react components",
5
5
  "main": "index.js",
6
6
  "module": "index.es.js",