@trackunit/react-components 8.0.8 → 8.0.9-alpha-3123793ad15.0

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
@@ -2970,10 +2970,18 @@ const cvaCard = cssClassVarianceUtilities.cva({
2970
2970
  false: "",
2971
2971
  true: "h-full",
2972
2972
  },
2973
+ // overflow-clip is not a scroll container, so as a flex/grid item the card keeps
2974
+ // min-width/min-height: auto and grows to fit its content. Content that scrolls on its own
2975
+ // (e.g. a Table) needs the card to stay within the space its parent gives it instead.
2976
+ scrollableContent: {
2977
+ false: "",
2978
+ true: ["min-h-0", "min-w-0"],
2979
+ },
2973
2980
  },
2974
2981
  defaultVariants: {
2975
2982
  clickable: false,
2976
2983
  fullHeight: false,
2984
+ scrollableContent: false,
2977
2985
  },
2978
2986
  });
2979
2987
  const cvaCardFooterContainerRoot = cssClassVarianceUtilities.cva({
@@ -3088,8 +3096,8 @@ const ROLE_CARD = "region";
3088
3096
  * @param {CardProps} props - The props for the Card component
3089
3097
  * @returns {ReactElement} Card component
3090
3098
  */
3091
- const Card = ({ children, onClick, fullHeight = false, onMouseEnter, onMouseLeave, className, "data-testid": dataTestId, ref, ...rest }) => {
3092
- return (jsxRuntime.jsx("div", { className: cvaCard({ fullHeight, clickable: Boolean(onClick), className }), "data-card": true, "data-testid": dataTestId, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, ref: ref, role: ROLE_CARD, ...rest, children: children }));
3099
+ const Card = ({ children, onClick, fullHeight = false, scrollableContent = false, onMouseEnter, onMouseLeave, className, "data-testid": dataTestId, ref, ...rest }) => {
3100
+ return (jsxRuntime.jsx("div", { className: cvaCard({ fullHeight, scrollableContent, clickable: Boolean(onClick), className }), "data-card": true, "data-testid": dataTestId, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, ref: ref, role: ROLE_CARD, ...rest, children: children }));
3093
3101
  };
3094
3102
  Card.displayName = "Card";
3095
3103
 
package/index.esm.js CHANGED
@@ -2969,10 +2969,18 @@ const cvaCard = cva({
2969
2969
  false: "",
2970
2970
  true: "h-full",
2971
2971
  },
2972
+ // overflow-clip is not a scroll container, so as a flex/grid item the card keeps
2973
+ // min-width/min-height: auto and grows to fit its content. Content that scrolls on its own
2974
+ // (e.g. a Table) needs the card to stay within the space its parent gives it instead.
2975
+ scrollableContent: {
2976
+ false: "",
2977
+ true: ["min-h-0", "min-w-0"],
2978
+ },
2972
2979
  },
2973
2980
  defaultVariants: {
2974
2981
  clickable: false,
2975
2982
  fullHeight: false,
2983
+ scrollableContent: false,
2976
2984
  },
2977
2985
  });
2978
2986
  const cvaCardFooterContainerRoot = cva({
@@ -3087,8 +3095,8 @@ const ROLE_CARD = "region";
3087
3095
  * @param {CardProps} props - The props for the Card component
3088
3096
  * @returns {ReactElement} Card component
3089
3097
  */
3090
- const Card = ({ children, onClick, fullHeight = false, onMouseEnter, onMouseLeave, className, "data-testid": dataTestId, ref, ...rest }) => {
3091
- return (jsx("div", { className: cvaCard({ fullHeight, clickable: Boolean(onClick), className }), "data-card": true, "data-testid": dataTestId, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, ref: ref, role: ROLE_CARD, ...rest, children: children }));
3098
+ const Card = ({ children, onClick, fullHeight = false, scrollableContent = false, onMouseEnter, onMouseLeave, className, "data-testid": dataTestId, ref, ...rest }) => {
3099
+ return (jsx("div", { className: cvaCard({ fullHeight, scrollableContent, clickable: Boolean(onClick), className }), "data-card": true, "data-testid": dataTestId, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, ref: ref, role: ROLE_CARD, ...rest, children: children }));
3092
3100
  };
3093
3101
  Card.displayName = "Card";
3094
3102
 
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@trackunit/react-router-components",
3
- "version": "2.0.20",
3
+ "version": "2.0.21-alpha-3123793ad15.0",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
7
7
  "node": ">=24.x"
8
8
  },
9
9
  "dependencies": {
10
- "@trackunit/css-class-variance-utilities": "^2.6.62",
11
- "@trackunit/i18n-library-translation": "^2.14.59",
12
- "@trackunit/react-components": "^8.0.8",
13
- "@trackunit/react-drawer": "^3.0.20",
14
- "@trackunit/shared-utils": "^1.22.62",
10
+ "@trackunit/css-class-variance-utilities": "2.6.63-alpha-3123793ad15.0",
11
+ "@trackunit/i18n-library-translation": "2.14.60-alpha-3123793ad15.0",
12
+ "@trackunit/react-components": "8.0.9-alpha-3123793ad15.0",
13
+ "@trackunit/react-drawer": "3.0.21-alpha-3123793ad15.0",
14
+ "@trackunit/shared-utils": "1.22.63-alpha-3123793ad15.0",
15
15
  "dequal": "^2.0.3",
16
16
  "zod": "^3.25.76"
17
17
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "8.0.8",
3
+ "version": "8.0.9-alpha-3123793ad15.0",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "migrations": "./migrations.json",
@@ -14,15 +14,15 @@
14
14
  "@floating-ui/react": "^0.26.25",
15
15
  "string-ts": "^2.0.0",
16
16
  "tailwind-merge": "^3.7.0",
17
- "@trackunit/ui-design-tokens": "^1.21.59",
18
- "@trackunit/css-class-variance-utilities": "^2.6.62",
19
- "@trackunit/shared-utils": "^1.22.62",
20
- "@trackunit/ui-icons": "^1.20.59",
17
+ "@trackunit/ui-design-tokens": "1.21.60-alpha-3123793ad15.0",
18
+ "@trackunit/css-class-variance-utilities": "2.6.63-alpha-3123793ad15.0",
19
+ "@trackunit/shared-utils": "1.22.63-alpha-3123793ad15.0",
20
+ "@trackunit/ui-icons": "1.20.60-alpha-3123793ad15.0",
21
21
  "es-toolkit": "^1.52.0",
22
22
  "@tanstack/react-virtual": "^3.14.13",
23
23
  "fflate": "^0.8.3",
24
24
  "zod": "^3.25.76",
25
- "@trackunit/i18n-library-translation": "^2.14.59"
25
+ "@trackunit/i18n-library-translation": "2.14.60-alpha-3123793ad15.0"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "^19.0.0",
@@ -8,6 +8,12 @@ export interface CardProps extends CommonProps, Styleable, Refable<HTMLDivElemen
8
8
  * Whether the card should have full height or not.
9
9
  */
10
10
  fullHeight?: boolean;
11
+ /**
12
+ * Set this when the card's content scrolls on its own, such as a `Table`.
13
+ * The card then stays within the space its parent gives it, and the content scrolls inside it.
14
+ * Without it, a card in a flex or grid layout grows to fit all of its content.
15
+ */
16
+ scrollableContent?: boolean;
11
17
  /**
12
18
  * Children to show in the card
13
19
  */
@@ -73,6 +79,6 @@ export interface CardProps extends CommonProps, Styleable, Refable<HTMLDivElemen
73
79
  * @returns {ReactElement} Card component
74
80
  */
75
81
  export declare const Card: {
76
- ({ children, onClick, fullHeight, onMouseEnter, onMouseLeave, className, "data-testid": dataTestId, ref, ...rest }: CardProps): ReactElement;
82
+ ({ children, onClick, fullHeight, scrollableContent, onMouseEnter, onMouseLeave, className, "data-testid": dataTestId, ref, ...rest }: CardProps): ReactElement;
77
83
  displayName: string;
78
84
  };
@@ -9,10 +9,15 @@ export declare const cvaCard: import("cva").CVAComponent<Omit<{
9
9
  false: string;
10
10
  true: string;
11
11
  };
12
+ scrollableContent: {
13
+ false: string;
14
+ true: string[];
15
+ };
12
16
  };
13
17
  defaultVariants: {
14
18
  clickable: false;
15
19
  fullHeight: false;
20
+ scrollableContent: false;
16
21
  };
17
22
  }, "defaultVariants"> & {
18
23
  variants: {
@@ -24,10 +29,15 @@ export declare const cvaCard: import("cva").CVAComponent<Omit<{
24
29
  false: string;
25
30
  true: string;
26
31
  };
32
+ scrollableContent: {
33
+ false: string;
34
+ true: string[];
35
+ };
27
36
  };
28
- defaultVariants: Omit<{}, "clickable" | "fullHeight"> & {
37
+ defaultVariants: Omit<{}, "clickable" | "fullHeight" | "scrollableContent"> & {
29
38
  clickable: false;
30
39
  fullHeight: false;
40
+ scrollableContent: false;
31
41
  };
32
42
  }, {
33
43
  clickable: {
@@ -38,6 +48,10 @@ export declare const cvaCard: import("cva").CVAComponent<Omit<{
38
48
  false: string;
39
49
  true: string;
40
50
  };
51
+ scrollableContent: {
52
+ false: string;
53
+ true: string[];
54
+ };
41
55
  }>;
42
56
  export declare const cvaCardFooterContainerRoot: import("cva").CVAComponent<Omit<{
43
57
  base: string[];