@trackunit/react-components 0.1.393 → 0.1.394

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
@@ -1796,7 +1796,6 @@ const CopyableText = ({ text, alternativeText, dataTestId, className }) => {
1796
1796
  };
1797
1797
 
1798
1798
  const cvaDialog = cssClassVarianceUtilities.cvaMerge([
1799
- "fixed",
1800
1799
  "z-toast",
1801
1800
  "pointer-events-auto",
1802
1801
  "absolute",
@@ -1883,10 +1882,10 @@ const cvaDialog = cssClassVarianceUtilities.cvaMerge([
1883
1882
  },
1884
1883
  ],
1885
1884
  });
1886
- const cvaDialogContainer = cssClassVarianceUtilities.cvaMerge(["relative", "flex", "h-full", "flex-col", "p-4"]);
1885
+ const cvaDialogContainer = cssClassVarianceUtilities.cvaMerge(["relative", "flex", "h-full", "flex-col"]);
1887
1886
  const cvaSwipeContainer = cssClassVarianceUtilities.cvaMerge(["mb-4", "flex", "items-center", "justify-center", "lg:hidden"]);
1888
1887
  const cvaSwipeIcon = cssClassVarianceUtilities.cvaMerge(["block", "h-1", "w-10", "rounded-full", "bg-gray-400"]);
1889
- const cvaToogleContainer = cssClassVarianceUtilities.cvaMerge(["z-8", "absolute"], {
1888
+ const cvaToogleContainer = cssClassVarianceUtilities.cvaMerge(["z-8", "relative"], {
1890
1889
  variants: {
1891
1890
  position: {
1892
1891
  left: "right-[-24px] top-[calc(50%-24px)]",
@@ -2013,7 +2012,7 @@ const ToogleButton = ({ open, position, onToggle }) => {
2013
2012
  * @param {DrawerProps} props - The props for the MapSidebar component
2014
2013
  * @returns {JSX.Element | null} Drawer component
2015
2014
  */
2016
- const Drawer = ({ open = true, onToggle, onClose, disableOverlay, position = "left", children, dataTestId, }) => {
2015
+ const Drawer = ({ open = true, onToggle, onClose, disableOverlay, position = "left", children, dataTestId, className, dialogClassName, }) => {
2017
2016
  const { width } = useResize();
2018
2017
  const isLargeScreen = width >= 1024;
2019
2018
  const initialSidebarMode = () => {
@@ -2083,11 +2082,12 @@ const Drawer = ({ open = true, onToggle, onClose, disableOverlay, position = "le
2083
2082
  if (!isVisible && !onToggle) {
2084
2083
  return null;
2085
2084
  }
2086
- return (jsxRuntime.jsxs("div", { "data-testid": dataTestId, children: [!disableOverlay ? jsxRuntime.jsx(Overlay, { onClose: onClose, open: isAnimationStart }) : null, jsxRuntime.jsx("div", { ...handlers, className: cvaDialog({
2085
+ return (jsxRuntime.jsxs("div", { className: className, "data-testid": dataTestId, children: [!disableOverlay ? jsxRuntime.jsx(Overlay, { onClose: onClose, open: isAnimationStart }) : null, jsxRuntime.jsx("div", { ...handlers, className: cvaDialog({
2087
2086
  sidebarMode: isLargeScreen ? null : sidebarMode,
2088
2087
  isLargeScreen,
2089
2088
  open: isAnimationStart,
2090
2089
  position,
2090
+ className: dialogClassName,
2091
2091
  }), "data-testid": dataTestId ? `${dataTestId}-container` : undefined, onTransitionEnd: handleAnimationEnd, children: jsxRuntime.jsxs("div", { className: cvaDialogContainer(), children: [jsxRuntime.jsx("div", { className: cvaSwipeContainer(), children: jsxRuntime.jsx("div", { className: cvaSwipeIcon() }) }), isLargeScreen && onToggle ? jsxRuntime.jsx(ToogleButton, { onToggle: onToggle, open: open, position: position }) : null, children] }) })] }));
2092
2092
  };
2093
2093
 
package/index.esm.js CHANGED
@@ -1776,7 +1776,6 @@ const CopyableText = ({ text, alternativeText, dataTestId, className }) => {
1776
1776
  };
1777
1777
 
1778
1778
  const cvaDialog = cvaMerge([
1779
- "fixed",
1780
1779
  "z-toast",
1781
1780
  "pointer-events-auto",
1782
1781
  "absolute",
@@ -1863,10 +1862,10 @@ const cvaDialog = cvaMerge([
1863
1862
  },
1864
1863
  ],
1865
1864
  });
1866
- const cvaDialogContainer = cvaMerge(["relative", "flex", "h-full", "flex-col", "p-4"]);
1865
+ const cvaDialogContainer = cvaMerge(["relative", "flex", "h-full", "flex-col"]);
1867
1866
  const cvaSwipeContainer = cvaMerge(["mb-4", "flex", "items-center", "justify-center", "lg:hidden"]);
1868
1867
  const cvaSwipeIcon = cvaMerge(["block", "h-1", "w-10", "rounded-full", "bg-gray-400"]);
1869
- const cvaToogleContainer = cvaMerge(["z-8", "absolute"], {
1868
+ const cvaToogleContainer = cvaMerge(["z-8", "relative"], {
1870
1869
  variants: {
1871
1870
  position: {
1872
1871
  left: "right-[-24px] top-[calc(50%-24px)]",
@@ -1993,7 +1992,7 @@ const ToogleButton = ({ open, position, onToggle }) => {
1993
1992
  * @param {DrawerProps} props - The props for the MapSidebar component
1994
1993
  * @returns {JSX.Element | null} Drawer component
1995
1994
  */
1996
- const Drawer = ({ open = true, onToggle, onClose, disableOverlay, position = "left", children, dataTestId, }) => {
1995
+ const Drawer = ({ open = true, onToggle, onClose, disableOverlay, position = "left", children, dataTestId, className, dialogClassName, }) => {
1997
1996
  const { width } = useResize();
1998
1997
  const isLargeScreen = width >= 1024;
1999
1998
  const initialSidebarMode = () => {
@@ -2063,11 +2062,12 @@ const Drawer = ({ open = true, onToggle, onClose, disableOverlay, position = "le
2063
2062
  if (!isVisible && !onToggle) {
2064
2063
  return null;
2065
2064
  }
2066
- return (jsxs("div", { "data-testid": dataTestId, children: [!disableOverlay ? jsx(Overlay, { onClose: onClose, open: isAnimationStart }) : null, jsx("div", { ...handlers, className: cvaDialog({
2065
+ return (jsxs("div", { className: className, "data-testid": dataTestId, children: [!disableOverlay ? jsx(Overlay, { onClose: onClose, open: isAnimationStart }) : null, jsx("div", { ...handlers, className: cvaDialog({
2067
2066
  sidebarMode: isLargeScreen ? null : sidebarMode,
2068
2067
  isLargeScreen,
2069
2068
  open: isAnimationStart,
2070
2069
  position,
2070
+ className: dialogClassName,
2071
2071
  }), "data-testid": dataTestId ? `${dataTestId}-container` : undefined, onTransitionEnd: handleAnimationEnd, children: jsxs("div", { className: cvaDialogContainer(), children: [jsx("div", { className: cvaSwipeContainer(), children: jsx("div", { className: cvaSwipeIcon() }) }), isLargeScreen && onToggle ? jsx(ToogleButton, { onToggle: onToggle, open: open, position: position }) : null, children] }) })] }));
2072
2072
  };
2073
2073
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "0.1.393",
3
+ "version": "0.1.394",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -25,6 +25,7 @@ export interface DrawerProps extends CommonProps {
25
25
  * The child node that will be rendered inside the drawer.
26
26
  */
27
27
  children?: React.ReactNode;
28
+ dialogClassName?: string;
28
29
  }
29
30
  /**
30
31
  * MapSidebar is a sidebar component used with Maps.
@@ -33,4 +34,4 @@ export interface DrawerProps extends CommonProps {
33
34
  * @param {DrawerProps} props - The props for the MapSidebar component
34
35
  * @returns {JSX.Element | null} Drawer component
35
36
  */
36
- export declare const Drawer: ({ open, onToggle, onClose, disableOverlay, position, children, dataTestId, }: DrawerProps) => JSX.Element | null;
37
+ export declare const Drawer: ({ open, onToggle, onClose, disableOverlay, position, children, dataTestId, className, dialogClassName, }: DrawerProps) => JSX.Element | null;