@trackunit/react-components 1.8.40 → 1.8.44

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
@@ -4078,7 +4078,27 @@ const TabContent = ({ className, dataTestId, children, ...rest }) => {
4078
4078
  * Wrapper for radix tab list component.
4079
4079
  */
4080
4080
  const TabList = ({ className, dataTestId, children, ...rest }) => {
4081
- return (jsxRuntime.jsx(reactTabs.List, { className: cvaTabList({ className }), "data-testid": dataTestId, ...rest, children: children }));
4081
+ const listRef = react.useRef(null);
4082
+ react.useEffect(() => {
4083
+ const element = listRef.current;
4084
+ if (!element)
4085
+ return;
4086
+ const handleWheel = (event) => {
4087
+ const canScrollHorizontally = element.scrollWidth > element.clientWidth;
4088
+ if (canScrollHorizontally) {
4089
+ // Prevent vertical scrolling of the page if we can scroll horizontally
4090
+ event.preventDefault();
4091
+ const scrollAmount = event.deltaX || event.deltaY;
4092
+ element.scrollLeft += scrollAmount;
4093
+ }
4094
+ };
4095
+ // Add event listener with passive: false to allow preventDefault()
4096
+ element.addEventListener("wheel", handleWheel, { passive: false });
4097
+ return () => {
4098
+ element.removeEventListener("wheel", handleWheel);
4099
+ };
4100
+ }, []);
4101
+ return (jsxRuntime.jsx(reactTabs.List, { className: cvaTabList({ className }), "data-testid": dataTestId, ref: listRef, ...rest, children: children }));
4082
4102
  };
4083
4103
 
4084
4104
  /**
package/index.esm.js CHANGED
@@ -4076,7 +4076,27 @@ const TabContent = ({ className, dataTestId, children, ...rest }) => {
4076
4076
  * Wrapper for radix tab list component.
4077
4077
  */
4078
4078
  const TabList = ({ className, dataTestId, children, ...rest }) => {
4079
- return (jsx(List$1, { className: cvaTabList({ className }), "data-testid": dataTestId, ...rest, children: children }));
4079
+ const listRef = useRef(null);
4080
+ useEffect(() => {
4081
+ const element = listRef.current;
4082
+ if (!element)
4083
+ return;
4084
+ const handleWheel = (event) => {
4085
+ const canScrollHorizontally = element.scrollWidth > element.clientWidth;
4086
+ if (canScrollHorizontally) {
4087
+ // Prevent vertical scrolling of the page if we can scroll horizontally
4088
+ event.preventDefault();
4089
+ const scrollAmount = event.deltaX || event.deltaY;
4090
+ element.scrollLeft += scrollAmount;
4091
+ }
4092
+ };
4093
+ // Add event listener with passive: false to allow preventDefault()
4094
+ element.addEventListener("wheel", handleWheel, { passive: false });
4095
+ return () => {
4096
+ element.removeEventListener("wheel", handleWheel);
4097
+ };
4098
+ }, []);
4099
+ return (jsx(List$1, { className: cvaTabList({ className }), "data-testid": dataTestId, ref: listRef, ...rest, children: children }));
4080
4100
  };
4081
4101
 
4082
4102
  /**
package/package.json CHANGED
@@ -1,28 +1,28 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "1.8.40",
3
+ "version": "1.8.44",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
7
7
  "node": ">=22.x"
8
8
  },
9
9
  "dependencies": {
10
- "@radix-ui/react-slot": "^1.0.2",
10
+ "@radix-ui/react-slot": "^1.2.3",
11
+ "@radix-ui/react-tabs": "^1.1.13",
11
12
  "react": "19.0.0",
12
13
  "usehooks-ts": "^3.1.0",
13
- "@radix-ui/react-tabs": "^1.0.4",
14
14
  "react-helmet-async": "^1.3.0",
15
15
  "lodash": "4.17.21",
16
16
  "@testing-library/react": "16.2.0",
17
17
  "@floating-ui/react": "^0.26.25",
18
18
  "string-ts": "^2.0.0",
19
19
  "tailwind-merge": "^2.0.0",
20
- "@trackunit/ui-design-tokens": "1.6.63",
21
- "@trackunit/css-class-variance-utilities": "1.6.61",
22
- "@trackunit/shared-utils": "1.8.62",
23
- "@trackunit/ui-icons": "1.6.60",
24
- "@trackunit/react-table-pagination": "1.6.60",
25
- "@trackunit/react-test-setup": "1.3.61",
20
+ "@trackunit/ui-design-tokens": "1.6.67",
21
+ "@trackunit/css-class-variance-utilities": "1.6.65",
22
+ "@trackunit/shared-utils": "1.8.66",
23
+ "@trackunit/ui-icons": "1.6.64",
24
+ "@trackunit/react-table-pagination": "1.6.64",
25
+ "@trackunit/react-test-setup": "1.3.65",
26
26
  "@tanstack/react-router": "1.114.29"
27
27
  },
28
28
  "module": "./index.esm.js",