@trackunit/react-components 0.1.249 → 0.1.250
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/index.cjs.js
CHANGED
|
@@ -1814,7 +1814,6 @@ const cvaModalBackdrop = cssClassVarianceUtilities.cvaMerge([
|
|
|
1814
1814
|
"left-0",
|
|
1815
1815
|
"w-full",
|
|
1816
1816
|
"h-full",
|
|
1817
|
-
"bg-black/50",
|
|
1818
1817
|
"z-20",
|
|
1819
1818
|
"invisible",
|
|
1820
1819
|
"opacity-0",
|
|
@@ -1825,6 +1824,10 @@ const cvaModalBackdrop = cssClassVarianceUtilities.cvaMerge([
|
|
|
1825
1824
|
true: "animate-modal-fade",
|
|
1826
1825
|
false: "",
|
|
1827
1826
|
},
|
|
1827
|
+
noShadow: {
|
|
1828
|
+
true: "",
|
|
1829
|
+
false: "bg-black/50",
|
|
1830
|
+
},
|
|
1828
1831
|
},
|
|
1829
1832
|
});
|
|
1830
1833
|
|
|
@@ -1834,9 +1837,9 @@ const cvaModalBackdrop = cssClassVarianceUtilities.cvaMerge([
|
|
|
1834
1837
|
* @param {ModalBackdropProps} props - The props for the ModalBackdrop component
|
|
1835
1838
|
* @returns {JSX.Element} ModalBackdrop component
|
|
1836
1839
|
*/
|
|
1837
|
-
const ModalBackdrop = ({ children, isVisible, onClick }) => {
|
|
1840
|
+
const ModalBackdrop = ({ children, isVisible, onClick, noShadow }) => {
|
|
1838
1841
|
const ref = React__namespace.useRef(null);
|
|
1839
|
-
return (jsxRuntime.jsx("div", { ref: ref, className: cvaModalBackdrop({ show: isVisible }), onMouseDown: e => {
|
|
1842
|
+
return (jsxRuntime.jsx("div", { ref: ref, className: cvaModalBackdrop({ show: isVisible, noShadow }), onMouseDown: e => {
|
|
1840
1843
|
// only react on click on backdrop - accessing first child to get around styled element element
|
|
1841
1844
|
if (ref.current !== null && e.target === ref.current.children[0]) {
|
|
1842
1845
|
onClick();
|
|
@@ -1850,10 +1853,10 @@ const ModalBackdrop = ({ children, isVisible, onClick }) => {
|
|
|
1850
1853
|
* - The modal component provides a foundation for creating dialogs, lightboxes, etc.
|
|
1851
1854
|
|
|
1852
1855
|
*/
|
|
1853
|
-
const Modal = React__namespace.forwardRef(({ isOpen, children, dataTestId, className, role = "", onDismissClick = () => {
|
|
1856
|
+
const Modal = React__namespace.forwardRef(({ isOpen, children, dataTestId, className, role = "", noBackdropShadow = false, onDismissClick = () => {
|
|
1854
1857
|
return;
|
|
1855
1858
|
}, }, ref) => {
|
|
1856
|
-
return (jsxRuntime.jsx(ModalBackdrop, { isVisible: isOpen, onClick: onDismissClick, children: isOpen ? (jsxRuntime.jsx("div", { className: cvaModalContainer(), ref: ref, role: role, children: jsxRuntime.jsx(Card, { dataTestId: dataTestId, className: cvaModalCard({ className }), children: children }) })) : null }));
|
|
1859
|
+
return (jsxRuntime.jsx(ModalBackdrop, { isVisible: isOpen, onClick: onDismissClick, noShadow: noBackdropShadow, children: isOpen ? (jsxRuntime.jsx("div", { className: cvaModalContainer(), ref: ref, role: role, children: jsxRuntime.jsx(Card, { dataTestId: dataTestId, className: cvaModalCard({ className }), children: children }) })) : null }));
|
|
1857
1860
|
});
|
|
1858
1861
|
Modal.displayName = "Modal";
|
|
1859
1862
|
|
package/index.esm.js
CHANGED
|
@@ -1783,7 +1783,6 @@ const cvaModalBackdrop = cvaMerge([
|
|
|
1783
1783
|
"left-0",
|
|
1784
1784
|
"w-full",
|
|
1785
1785
|
"h-full",
|
|
1786
|
-
"bg-black/50",
|
|
1787
1786
|
"z-20",
|
|
1788
1787
|
"invisible",
|
|
1789
1788
|
"opacity-0",
|
|
@@ -1794,6 +1793,10 @@ const cvaModalBackdrop = cvaMerge([
|
|
|
1794
1793
|
true: "animate-modal-fade",
|
|
1795
1794
|
false: "",
|
|
1796
1795
|
},
|
|
1796
|
+
noShadow: {
|
|
1797
|
+
true: "",
|
|
1798
|
+
false: "bg-black/50",
|
|
1799
|
+
},
|
|
1797
1800
|
},
|
|
1798
1801
|
});
|
|
1799
1802
|
|
|
@@ -1803,9 +1806,9 @@ const cvaModalBackdrop = cvaMerge([
|
|
|
1803
1806
|
* @param {ModalBackdropProps} props - The props for the ModalBackdrop component
|
|
1804
1807
|
* @returns {JSX.Element} ModalBackdrop component
|
|
1805
1808
|
*/
|
|
1806
|
-
const ModalBackdrop = ({ children, isVisible, onClick }) => {
|
|
1809
|
+
const ModalBackdrop = ({ children, isVisible, onClick, noShadow }) => {
|
|
1807
1810
|
const ref = React.useRef(null);
|
|
1808
|
-
return (jsx("div", { ref: ref, className: cvaModalBackdrop({ show: isVisible }), onMouseDown: e => {
|
|
1811
|
+
return (jsx("div", { ref: ref, className: cvaModalBackdrop({ show: isVisible, noShadow }), onMouseDown: e => {
|
|
1809
1812
|
// only react on click on backdrop - accessing first child to get around styled element element
|
|
1810
1813
|
if (ref.current !== null && e.target === ref.current.children[0]) {
|
|
1811
1814
|
onClick();
|
|
@@ -1819,10 +1822,10 @@ const ModalBackdrop = ({ children, isVisible, onClick }) => {
|
|
|
1819
1822
|
* - The modal component provides a foundation for creating dialogs, lightboxes, etc.
|
|
1820
1823
|
|
|
1821
1824
|
*/
|
|
1822
|
-
const Modal = React.forwardRef(({ isOpen, children, dataTestId, className, role = "", onDismissClick = () => {
|
|
1825
|
+
const Modal = React.forwardRef(({ isOpen, children, dataTestId, className, role = "", noBackdropShadow = false, onDismissClick = () => {
|
|
1823
1826
|
return;
|
|
1824
1827
|
}, }, ref) => {
|
|
1825
|
-
return (jsx(ModalBackdrop, { isVisible: isOpen, onClick: onDismissClick, children: isOpen ? (jsx("div", { className: cvaModalContainer(), ref: ref, role: role, children: jsx(Card, { dataTestId: dataTestId, className: cvaModalCard({ className }), children: children }) })) : null }));
|
|
1828
|
+
return (jsx(ModalBackdrop, { isVisible: isOpen, onClick: onDismissClick, noShadow: noBackdropShadow, children: isOpen ? (jsx("div", { className: cvaModalContainer(), ref: ref, role: role, children: jsx(Card, { dataTestId: dataTestId, className: cvaModalCard({ className }), children: children }) })) : null }));
|
|
1826
1829
|
});
|
|
1827
1830
|
Modal.displayName = "Modal";
|
|
1828
1831
|
|
package/package.json
CHANGED
|
@@ -21,6 +21,10 @@ export interface ModalProps extends CommonProps {
|
|
|
21
21
|
* Aria role to be applied to element
|
|
22
22
|
*/
|
|
23
23
|
role?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Whether modal has backdrop shadow or not
|
|
26
|
+
*/
|
|
27
|
+
noBackdropShadow?: boolean;
|
|
24
28
|
}
|
|
25
29
|
/**
|
|
26
30
|
* - Modals are used to present critical information or request user input needed to complete a user's workflow.
|
|
@@ -2,4 +2,5 @@ export declare const cvaModalContainer: (props?: import("class-variance-authorit
|
|
|
2
2
|
export declare const cvaModalCard: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
3
3
|
export declare const cvaModalBackdrop: (props?: ({
|
|
4
4
|
show?: boolean | null | undefined;
|
|
5
|
+
noShadow?: boolean | null | undefined;
|
|
5
6
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
@@ -3,6 +3,7 @@ export interface ModalBackdropProps {
|
|
|
3
3
|
onClick: () => void;
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
isVisible?: boolean;
|
|
6
|
+
noShadow?: boolean;
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* The Backdrop for the modal.
|
|
@@ -10,4 +11,4 @@ export interface ModalBackdropProps {
|
|
|
10
11
|
* @param {ModalBackdropProps} props - The props for the ModalBackdrop component
|
|
11
12
|
* @returns {JSX.Element} ModalBackdrop component
|
|
12
13
|
*/
|
|
13
|
-
export declare const ModalBackdrop: ({ children, isVisible, onClick }: ModalBackdropProps) => JSX.Element;
|
|
14
|
+
export declare const ModalBackdrop: ({ children, isVisible, onClick, noShadow }: ModalBackdropProps) => JSX.Element;
|