@trackunit/react-components 7.0.4 → 7.0.6

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
@@ -6945,7 +6945,9 @@ const cvaLabeledValueLabel = cssClassVarianceUtilities.cva({
6945
6945
  base: ["font-medium", "text-neutral-500"],
6946
6946
  variants: {
6947
6947
  orientation: {
6948
- horizontal: ["min-w-[30%]", "max-w-[30%]"],
6948
+ // Clip the label to its column. A label wider than 30% would paint across
6949
+ // the row gap and into the value.
6950
+ horizontal: ["flex", "min-w-[30%]", "max-w-[30%]", "items-baseline", "overflow-hidden"],
6949
6951
  vertical: ["mb-1"],
6950
6952
  },
6951
6953
  },
@@ -6955,7 +6957,7 @@ const cvaLabeledValueLabel = cssClassVarianceUtilities.cva({
6955
6957
  });
6956
6958
  const cvaLabeledValueValue = cssClassVarianceUtilities.cva({ base: ["min-w-0", "font-normal", "text-neutral-900"] });
6957
6959
  const cvaLabeledValueList = cssClassVarianceUtilities.cva({ base: ["flex", "flex-col", "gap-4"] });
6958
- const cvaLabeledValueTooltip = cssClassVarianceUtilities.cva({ base: ["ml-1", "inline-flex", "align-sub"] });
6960
+ const cvaLabeledValueTooltip = cssClassVarianceUtilities.cva({ base: ["ml-1", "inline-flex", "shrink-0", "align-sub"] });
6959
6961
 
6960
6962
  /**
6961
6963
  * LabeledValue displays a single piece of labeled information, pairing a descriptive label with its corresponding value.
@@ -6977,7 +6979,7 @@ const cvaLabeledValueTooltip = cssClassVarianceUtilities.cva({ base: ["ml-1", "i
6977
6979
  * @param {LabeledValueProps} props - The props for the LabeledValue component
6978
6980
  * @returns {ReactElement} LabeledValue component
6979
6981
  */
6980
- const LabeledValue = ({ label, labelTooltip, value, orientation = "horizontal", className, "data-testid": dataTestId, style, ref, }) => {
6982
+ const LabeledValue = ({ label, labelTooltip, value, orientation = "horizontal", valueClassName, className, "data-testid": dataTestId, style, ref, }) => {
6981
6983
  const renderValue = () => {
6982
6984
  const valueIsEmpty = value === null || value === undefined || value === "" || typeof value === "boolean";
6983
6985
  if (valueIsEmpty) {
@@ -6985,7 +6987,7 @@ const LabeledValue = ({ label, labelTooltip, value, orientation = "horizontal",
6985
6987
  }
6986
6988
  return value;
6987
6989
  };
6988
- return (jsxRuntime.jsxs("div", { className: cvaLabeledValue({ className, orientation }), "data-testid": dataTestId, ref: ref, style: style, children: [jsxRuntime.jsxs("div", { className: cvaLabeledValueLabel({ orientation }), "data-testid": dataTestId ? `${dataTestId}-label` : undefined, children: [jsxRuntime.jsx("span", { children: label }), labelTooltip !== undefined ? jsxRuntime.jsx("span", { className: cvaLabeledValueTooltip(), children: labelTooltip }) : null] }), jsxRuntime.jsx("div", { className: cvaLabeledValueValue(), "data-testid": dataTestId ? `${dataTestId}-value` : undefined, children: renderValue() })] }));
6990
+ return (jsxRuntime.jsxs("div", { className: cvaLabeledValue({ className, orientation }), "data-testid": dataTestId, ref: ref, style: style, children: [jsxRuntime.jsxs("div", { className: cvaLabeledValueLabel({ orientation }), "data-testid": dataTestId ? `${dataTestId}-label` : undefined, children: [jsxRuntime.jsx("span", { className: orientation === "horizontal" ? "min-w-0 truncate" : undefined, children: label }), labelTooltip !== undefined ? jsxRuntime.jsx("span", { className: cvaLabeledValueTooltip(), children: labelTooltip }) : null] }), jsxRuntime.jsx("div", { className: cvaLabeledValueValue({ className: valueClassName }), "data-testid": dataTestId ? `${dataTestId}-value` : undefined, children: renderValue() })] }));
6989
6991
  };
6990
6992
 
6991
6993
  /**
package/index.esm.js CHANGED
@@ -6944,7 +6944,9 @@ const cvaLabeledValueLabel = cva({
6944
6944
  base: ["font-medium", "text-neutral-500"],
6945
6945
  variants: {
6946
6946
  orientation: {
6947
- horizontal: ["min-w-[30%]", "max-w-[30%]"],
6947
+ // Clip the label to its column. A label wider than 30% would paint across
6948
+ // the row gap and into the value.
6949
+ horizontal: ["flex", "min-w-[30%]", "max-w-[30%]", "items-baseline", "overflow-hidden"],
6948
6950
  vertical: ["mb-1"],
6949
6951
  },
6950
6952
  },
@@ -6954,7 +6956,7 @@ const cvaLabeledValueLabel = cva({
6954
6956
  });
6955
6957
  const cvaLabeledValueValue = cva({ base: ["min-w-0", "font-normal", "text-neutral-900"] });
6956
6958
  const cvaLabeledValueList = cva({ base: ["flex", "flex-col", "gap-4"] });
6957
- const cvaLabeledValueTooltip = cva({ base: ["ml-1", "inline-flex", "align-sub"] });
6959
+ const cvaLabeledValueTooltip = cva({ base: ["ml-1", "inline-flex", "shrink-0", "align-sub"] });
6958
6960
 
6959
6961
  /**
6960
6962
  * LabeledValue displays a single piece of labeled information, pairing a descriptive label with its corresponding value.
@@ -6976,7 +6978,7 @@ const cvaLabeledValueTooltip = cva({ base: ["ml-1", "inline-flex", "align-sub"]
6976
6978
  * @param {LabeledValueProps} props - The props for the LabeledValue component
6977
6979
  * @returns {ReactElement} LabeledValue component
6978
6980
  */
6979
- const LabeledValue = ({ label, labelTooltip, value, orientation = "horizontal", className, "data-testid": dataTestId, style, ref, }) => {
6981
+ const LabeledValue = ({ label, labelTooltip, value, orientation = "horizontal", valueClassName, className, "data-testid": dataTestId, style, ref, }) => {
6980
6982
  const renderValue = () => {
6981
6983
  const valueIsEmpty = value === null || value === undefined || value === "" || typeof value === "boolean";
6982
6984
  if (valueIsEmpty) {
@@ -6984,7 +6986,7 @@ const LabeledValue = ({ label, labelTooltip, value, orientation = "horizontal",
6984
6986
  }
6985
6987
  return value;
6986
6988
  };
6987
- return (jsxs("div", { className: cvaLabeledValue({ className, orientation }), "data-testid": dataTestId, ref: ref, style: style, children: [jsxs("div", { className: cvaLabeledValueLabel({ orientation }), "data-testid": dataTestId ? `${dataTestId}-label` : undefined, children: [jsx("span", { children: label }), labelTooltip !== undefined ? jsx("span", { className: cvaLabeledValueTooltip(), children: labelTooltip }) : null] }), jsx("div", { className: cvaLabeledValueValue(), "data-testid": dataTestId ? `${dataTestId}-value` : undefined, children: renderValue() })] }));
6989
+ return (jsxs("div", { className: cvaLabeledValue({ className, orientation }), "data-testid": dataTestId, ref: ref, style: style, children: [jsxs("div", { className: cvaLabeledValueLabel({ orientation }), "data-testid": dataTestId ? `${dataTestId}-label` : undefined, children: [jsx("span", { className: orientation === "horizontal" ? "min-w-0 truncate" : undefined, children: label }), labelTooltip !== undefined ? jsx("span", { className: cvaLabeledValueTooltip(), children: labelTooltip }) : null] }), jsx("div", { className: cvaLabeledValueValue({ className: valueClassName }), "data-testid": dataTestId ? `${dataTestId}-value` : undefined, children: renderValue() })] }));
6988
6990
  };
6989
6991
 
6990
6992
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-router-components",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -8,9 +8,9 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@trackunit/css-class-variance-utilities": "^2.6.57",
11
- "@trackunit/i18n-library-translation": "^2.14.51",
12
- "@trackunit/react-components": "^7.0.4",
13
- "@trackunit/react-drawer": "^3.0.4",
11
+ "@trackunit/i18n-library-translation": "^2.14.52",
12
+ "@trackunit/react-components": "^7.0.6",
13
+ "@trackunit/react-drawer": "^3.0.6",
14
14
  "@trackunit/shared-utils": "^1.22.57",
15
15
  "dequal": "^2.0.3",
16
16
  "zod": "^3.25.76"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "7.0.4",
3
+ "version": "7.0.6",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "migrations": "./migrations.json",
@@ -22,7 +22,7 @@
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.51"
25
+ "@trackunit/i18n-library-translation": "^2.14.52"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "^19.0.0",
@@ -21,6 +21,10 @@ export interface LabeledValueProps extends CommonProps, Styleable, Refable<HTMLD
21
21
  * Layout of the pair. `horizontal` (default) renders label and value side-by-side; `vertical` stacks the value under the label.
22
22
  */
23
23
  orientation?: LabeledValueOrientation;
24
+ /**
25
+ * Classes added to the value element. The value stays content-sized unless the caller sets this.
26
+ */
27
+ valueClassName?: string;
24
28
  }
25
29
  /**
26
30
  * LabeledValue displays a single piece of labeled information, pairing a descriptive label with its corresponding value.
@@ -42,4 +46,4 @@ export interface LabeledValueProps extends CommonProps, Styleable, Refable<HTMLD
42
46
  * @param {LabeledValueProps} props - The props for the LabeledValue component
43
47
  * @returns {ReactElement} LabeledValue component
44
48
  */
45
- export declare const LabeledValue: ({ label, labelTooltip, value, orientation, className, "data-testid": dataTestId, style, ref, }: LabeledValueProps) => ReactElement;
49
+ export declare const LabeledValue: ({ label, labelTooltip, value, orientation, valueClassName, className, "data-testid": dataTestId, style, ref, }: LabeledValueProps) => ReactElement;