@trackunit/react-components 1.0.5 → 1.0.7

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
@@ -1163,9 +1163,8 @@ const useGeometry = (ref) => {
1163
1163
  y: 0,
1164
1164
  });
1165
1165
  const resizeObserver = React.useRef(null);
1166
- const refCurrent = ref.current;
1167
1166
  React.useEffect(() => {
1168
- if (!refCurrent) {
1167
+ if (!ref.current) {
1169
1168
  return;
1170
1169
  }
1171
1170
  if (!resizeObserver.current) {
@@ -1185,13 +1184,14 @@ const useGeometry = (ref) => {
1185
1184
  }
1186
1185
  });
1187
1186
  }
1188
- resizeObserver.current.observe(refCurrent);
1187
+ resizeObserver.current.observe(ref.current);
1189
1188
  return () => {
1190
1189
  if (resizeObserver.current) {
1191
1190
  resizeObserver.current.disconnect();
1192
1191
  }
1193
1192
  };
1194
- }, [refCurrent]);
1193
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1194
+ }, [ref.current]);
1195
1195
  return geometry;
1196
1196
  };
1197
1197
 
@@ -1660,8 +1660,8 @@ const Card = ({ children, onClick, fullHeight = false, onMouseEnter, onMouseLeav
1660
1660
  * @param {CardBodyProps} props - The props for the CardBody component
1661
1661
  * @returns {JSX.Element} CardBody component
1662
1662
  */
1663
- const CardBody = ({ density = "auto", children, dataTestId, className, disableGap, id }) => {
1664
- return (jsxRuntime.jsx("div", { className: cvaCardBodyDensityContainer({ density, disableGap, className }), "data-testid": dataTestId, id: id, children: children }));
1663
+ const CardBody = ({ density = "auto", children, dataTestId, className, direction, disableGap, id, }) => {
1664
+ return (jsxRuntime.jsx("div", { className: cvaCardBodyDensityContainer({ density, disableGap, className, direction }), "data-testid": dataTestId, id: id, children: children }));
1665
1665
  };
1666
1666
 
1667
1667
  /**
package/index.esm.js CHANGED
@@ -1143,9 +1143,8 @@ const useGeometry = (ref) => {
1143
1143
  y: 0,
1144
1144
  });
1145
1145
  const resizeObserver = useRef(null);
1146
- const refCurrent = ref.current;
1147
1146
  useEffect(() => {
1148
- if (!refCurrent) {
1147
+ if (!ref.current) {
1149
1148
  return;
1150
1149
  }
1151
1150
  if (!resizeObserver.current) {
@@ -1165,13 +1164,14 @@ const useGeometry = (ref) => {
1165
1164
  }
1166
1165
  });
1167
1166
  }
1168
- resizeObserver.current.observe(refCurrent);
1167
+ resizeObserver.current.observe(ref.current);
1169
1168
  return () => {
1170
1169
  if (resizeObserver.current) {
1171
1170
  resizeObserver.current.disconnect();
1172
1171
  }
1173
1172
  };
1174
- }, [refCurrent]);
1173
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1174
+ }, [ref.current]);
1175
1175
  return geometry;
1176
1176
  };
1177
1177
 
@@ -1640,8 +1640,8 @@ const Card = ({ children, onClick, fullHeight = false, onMouseEnter, onMouseLeav
1640
1640
  * @param {CardBodyProps} props - The props for the CardBody component
1641
1641
  * @returns {JSX.Element} CardBody component
1642
1642
  */
1643
- const CardBody = ({ density = "auto", children, dataTestId, className, disableGap, id }) => {
1644
- return (jsx("div", { className: cvaCardBodyDensityContainer({ density, disableGap, className }), "data-testid": dataTestId, id: id, children: children }));
1643
+ const CardBody = ({ density = "auto", children, dataTestId, className, direction, disableGap, id, }) => {
1644
+ return (jsx("div", { className: cvaCardBodyDensityContainer({ density, disableGap, className, direction }), "data-testid": dataTestId, id: id, children: children }));
1645
1645
  };
1646
1646
 
1647
1647
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -5,6 +5,10 @@ export interface CardBodyProps extends CommonProps {
5
5
  * Sets gap, padding and margin.
6
6
  */
7
7
  density?: Density;
8
+ /**
9
+ * Sets flex direction
10
+ */
11
+ direction?: "row" | "row-reverse" | "column" | "column-reverse";
8
12
  /**
9
13
  * Set gap to be 0px (not preferable)
10
14
  */
@@ -26,4 +30,4 @@ export interface CardBodyProps extends CommonProps {
26
30
  * @param {CardBodyProps} props - The props for the CardBody component
27
31
  * @returns {JSX.Element} CardBody component
28
32
  */
29
- export declare const CardBody: ({ density, children, dataTestId, className, disableGap, id }: CardBodyProps) => import("react/jsx-runtime").JSX.Element;
33
+ export declare const CardBody: ({ density, children, dataTestId, className, direction, disableGap, id, }: CardBodyProps) => import("react/jsx-runtime").JSX.Element;