@trackunit/react-components 1.16.13 → 1.17.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
@@ -2147,25 +2147,6 @@ const getHeightValue = (height, variant) => {
2147
2147
  }
2148
2148
  return height;
2149
2149
  };
2150
- /**
2151
- * Calculate the vertical margin value for text variant to align with text baseline.
2152
- * Formula: (line-height - cap-height) / 2, where cap-height = font-size × 0.7
2153
- *
2154
- * @param height - The height value (number, CSS length, or text size key)
2155
- * @returns {string} The calculated CSS margin value
2156
- */
2157
- const getMarginValue = (height) => {
2158
- if (typeof height === "string") {
2159
- const sizeKey = extractSizeKey(height);
2160
- if (sizeKey) {
2161
- // margin = (line-height - cap-height) / 2
2162
- // cap-height = font-size × 0.7
2163
- // For large text sizes, this may be negative, which matches how actual text extends beyond its line-height box
2164
- return `calc((var(--line-height-${sizeKey}) - var(--font-size-${sizeKey}) * 0.7) / 2)`;
2165
- }
2166
- }
2167
- return "0";
2168
- };
2169
2150
  /**
2170
2151
  * Type-safe helper to construct a CSSLength from a number and unit.
2171
2152
  * Uses a generic to preserve the specific unit type in the return type.
@@ -2209,7 +2190,7 @@ const cvaSkeleton = cssClassVarianceUtilities.cvaMerge([
2209
2190
  "overflow-hidden",
2210
2191
  "rounded-lg",
2211
2192
  // Gradient background
2212
- "bg-gradient-to-r",
2193
+ "bg-linear-to-r",
2213
2194
  "from-neutral-200/80",
2214
2195
  "via-neutral-300/60",
2215
2196
  "to-neutral-200/80",
@@ -2218,7 +2199,7 @@ const cvaSkeleton = cssClassVarianceUtilities.cvaMerge([
2218
2199
  // Shimmer overlay
2219
2200
  "before:absolute",
2220
2201
  "before:inset-0",
2221
- "before:bg-gradient-to-r",
2202
+ "before:bg-linear-to-r",
2222
2203
  "before:from-transparent",
2223
2204
  "before:via-white/50",
2224
2205
  "before:to-transparent",
@@ -2228,7 +2209,25 @@ const cvaSkeleton = cssClassVarianceUtilities.cvaMerge([
2228
2209
  "transition-all",
2229
2210
  "duration-300",
2230
2211
  "ease-in-out",
2231
- ]);
2212
+ ], {
2213
+ variants: {
2214
+ textSize: {
2215
+ "text-xs": ["my-[calc((var(--line-height-xs)-var(--font-size-xs)*0.7)/2)]"],
2216
+ "text-sm": ["my-[calc((var(--line-height-sm)-var(--font-size-sm)*0.7)/2)]"],
2217
+ "text-base": ["my-[calc((var(--line-height-base)-var(--font-size-base)*0.7)/2)]"],
2218
+ "text-lg": ["my-[calc((var(--line-height-lg)-var(--font-size-lg)*0.7)/2)]"],
2219
+ "text-xl": ["my-[calc((var(--line-height-xl)-var(--font-size-xl)*0.7)/2)]"],
2220
+ "text-2xl": ["my-[calc((var(--line-height-2xl)-var(--font-size-2xl)*0.7)/2)]"],
2221
+ "text-3xl": ["my-[calc((var(--line-height-3xl)-var(--font-size-3xl)*0.7)/2)]"],
2222
+ "text-4xl": ["my-[calc((var(--line-height-4xl)-var(--font-size-4xl)*0.7)/2)]"],
2223
+ "text-5xl": ["my-[calc((var(--line-height-5xl)-var(--font-size-5xl)*0.7)/2)]"],
2224
+ "text-6xl": ["my-[calc((var(--line-height-6xl)-var(--font-size-6xl)*0.7)/2)]"],
2225
+ "text-7xl": ["my-[calc((var(--line-height-7xl)-var(--font-size-7xl)*0.7)/2)]"],
2226
+ "text-8xl": ["my-[calc((var(--line-height-8xl)-var(--font-size-8xl)*0.7)/2)]"],
2227
+ "text-9xl": ["my-[calc((var(--line-height-9xl)-var(--font-size-9xl)*0.7)/2)]"],
2228
+ },
2229
+ },
2230
+ });
2232
2231
 
2233
2232
  /**
2234
2233
  * Display a single placeholder line for text content before data gets loaded to reduce load-time frustration.
@@ -2243,13 +2242,10 @@ const SkeletonLabel = react.memo((props) => {
2243
2242
  const { width = "100%", textSize = "text-base", flexibleWidth = true, className, "data-testid": dataTestId, children, } = props;
2244
2243
  const widthValue = typeof width === "number" ? `${width}px` : width;
2245
2244
  const heightValue = getHeightValue(textSize);
2246
- const marginValue = getMarginValue(textSize);
2247
- return (jsxRuntime.jsx("div", { "aria-label": "Loading", className: cvaSkeleton({ className }), "data-testid": dataTestId, role: "status", style: {
2245
+ return (jsxRuntime.jsx("div", { "aria-label": "Loading", className: cvaSkeleton({ textSize, className }), "data-testid": dataTestId, role: "status", style: {
2248
2246
  width: flexibleWidth ? "100%" : widthValue,
2249
2247
  maxWidth: flexibleWidth ? widthValue : undefined,
2250
2248
  height: heightValue,
2251
- marginTop: marginValue,
2252
- marginBottom: marginValue,
2253
2249
  }, children: children }));
2254
2250
  });
2255
2251
  SkeletonLabel.displayName = "SkeletonLabel";
@@ -4540,12 +4536,12 @@ const getScore = (value, min, max, zeroScoreAllowed) => {
4540
4536
  */
4541
4537
  const getDefaultFillColor = (score) => {
4542
4538
  if (score < 0.3) {
4543
- return uiDesignTokens.color("DANGER", 500, "CSS");
4539
+ return uiDesignTokens.color("DANGER", 500, "HEX");
4544
4540
  }
4545
4541
  if (score >= 0.6) {
4546
- return uiDesignTokens.color("SUCCESS", 600, "CSS");
4542
+ return uiDesignTokens.color("SUCCESS", 600, "HEX");
4547
4543
  }
4548
- return uiDesignTokens.color("WARNING", 300, "CSS");
4544
+ return uiDesignTokens.color("WARNING", 300, "HEX");
4549
4545
  };
4550
4546
  /**
4551
4547
  * Helper function to get custom color used by the ValueBar
@@ -5372,7 +5368,7 @@ const cvaMenuList = cssClassVarianceUtilities.cvaMerge([
5372
5368
  "p-1",
5373
5369
  "gap-y-0.5",
5374
5370
  "grid",
5375
- "max-h-[max(40dvh,var(--spacing-64))]",
5371
+ "max-h-[max(40dvh_var(--spacing-64))]",
5376
5372
  "overflow-y-auto",
5377
5373
  ]);
5378
5374
  const cvaMenuListDivider = cssClassVarianceUtilities.cvaMerge(["mx-[-4px]", "my-0.5", "min-h-px", "bg-neutral-300"]);
@@ -6833,7 +6829,7 @@ const cvaToggleGroupWithSlidingBackground = cssClassVarianceUtilities.cvaMerge([
6833
6829
  "before:bottom-0.5",
6834
6830
  "before:left-[var(--sliding-left)]",
6835
6831
  "before:w-[var(--sliding-width)]",
6836
- "before:transition-[left,width]",
6832
+ "before:transition-[left_width]",
6837
6833
  "before:duration-[var(--transition-duration)]",
6838
6834
  "before:ease-out",
6839
6835
  "before:rounded",
package/index.esm.js CHANGED
@@ -2145,25 +2145,6 @@ const getHeightValue = (height, variant) => {
2145
2145
  }
2146
2146
  return height;
2147
2147
  };
2148
- /**
2149
- * Calculate the vertical margin value for text variant to align with text baseline.
2150
- * Formula: (line-height - cap-height) / 2, where cap-height = font-size × 0.7
2151
- *
2152
- * @param height - The height value (number, CSS length, or text size key)
2153
- * @returns {string} The calculated CSS margin value
2154
- */
2155
- const getMarginValue = (height) => {
2156
- if (typeof height === "string") {
2157
- const sizeKey = extractSizeKey(height);
2158
- if (sizeKey) {
2159
- // margin = (line-height - cap-height) / 2
2160
- // cap-height = font-size × 0.7
2161
- // For large text sizes, this may be negative, which matches how actual text extends beyond its line-height box
2162
- return `calc((var(--line-height-${sizeKey}) - var(--font-size-${sizeKey}) * 0.7) / 2)`;
2163
- }
2164
- }
2165
- return "0";
2166
- };
2167
2148
  /**
2168
2149
  * Type-safe helper to construct a CSSLength from a number and unit.
2169
2150
  * Uses a generic to preserve the specific unit type in the return type.
@@ -2207,7 +2188,7 @@ const cvaSkeleton = cvaMerge([
2207
2188
  "overflow-hidden",
2208
2189
  "rounded-lg",
2209
2190
  // Gradient background
2210
- "bg-gradient-to-r",
2191
+ "bg-linear-to-r",
2211
2192
  "from-neutral-200/80",
2212
2193
  "via-neutral-300/60",
2213
2194
  "to-neutral-200/80",
@@ -2216,7 +2197,7 @@ const cvaSkeleton = cvaMerge([
2216
2197
  // Shimmer overlay
2217
2198
  "before:absolute",
2218
2199
  "before:inset-0",
2219
- "before:bg-gradient-to-r",
2200
+ "before:bg-linear-to-r",
2220
2201
  "before:from-transparent",
2221
2202
  "before:via-white/50",
2222
2203
  "before:to-transparent",
@@ -2226,7 +2207,25 @@ const cvaSkeleton = cvaMerge([
2226
2207
  "transition-all",
2227
2208
  "duration-300",
2228
2209
  "ease-in-out",
2229
- ]);
2210
+ ], {
2211
+ variants: {
2212
+ textSize: {
2213
+ "text-xs": ["my-[calc((var(--line-height-xs)-var(--font-size-xs)*0.7)/2)]"],
2214
+ "text-sm": ["my-[calc((var(--line-height-sm)-var(--font-size-sm)*0.7)/2)]"],
2215
+ "text-base": ["my-[calc((var(--line-height-base)-var(--font-size-base)*0.7)/2)]"],
2216
+ "text-lg": ["my-[calc((var(--line-height-lg)-var(--font-size-lg)*0.7)/2)]"],
2217
+ "text-xl": ["my-[calc((var(--line-height-xl)-var(--font-size-xl)*0.7)/2)]"],
2218
+ "text-2xl": ["my-[calc((var(--line-height-2xl)-var(--font-size-2xl)*0.7)/2)]"],
2219
+ "text-3xl": ["my-[calc((var(--line-height-3xl)-var(--font-size-3xl)*0.7)/2)]"],
2220
+ "text-4xl": ["my-[calc((var(--line-height-4xl)-var(--font-size-4xl)*0.7)/2)]"],
2221
+ "text-5xl": ["my-[calc((var(--line-height-5xl)-var(--font-size-5xl)*0.7)/2)]"],
2222
+ "text-6xl": ["my-[calc((var(--line-height-6xl)-var(--font-size-6xl)*0.7)/2)]"],
2223
+ "text-7xl": ["my-[calc((var(--line-height-7xl)-var(--font-size-7xl)*0.7)/2)]"],
2224
+ "text-8xl": ["my-[calc((var(--line-height-8xl)-var(--font-size-8xl)*0.7)/2)]"],
2225
+ "text-9xl": ["my-[calc((var(--line-height-9xl)-var(--font-size-9xl)*0.7)/2)]"],
2226
+ },
2227
+ },
2228
+ });
2230
2229
 
2231
2230
  /**
2232
2231
  * Display a single placeholder line for text content before data gets loaded to reduce load-time frustration.
@@ -2241,13 +2240,10 @@ const SkeletonLabel = memo((props) => {
2241
2240
  const { width = "100%", textSize = "text-base", flexibleWidth = true, className, "data-testid": dataTestId, children, } = props;
2242
2241
  const widthValue = typeof width === "number" ? `${width}px` : width;
2243
2242
  const heightValue = getHeightValue(textSize);
2244
- const marginValue = getMarginValue(textSize);
2245
- return (jsx("div", { "aria-label": "Loading", className: cvaSkeleton({ className }), "data-testid": dataTestId, role: "status", style: {
2243
+ return (jsx("div", { "aria-label": "Loading", className: cvaSkeleton({ textSize, className }), "data-testid": dataTestId, role: "status", style: {
2246
2244
  width: flexibleWidth ? "100%" : widthValue,
2247
2245
  maxWidth: flexibleWidth ? widthValue : undefined,
2248
2246
  height: heightValue,
2249
- marginTop: marginValue,
2250
- marginBottom: marginValue,
2251
2247
  }, children: children }));
2252
2248
  });
2253
2249
  SkeletonLabel.displayName = "SkeletonLabel";
@@ -4538,12 +4534,12 @@ const getScore = (value, min, max, zeroScoreAllowed) => {
4538
4534
  */
4539
4535
  const getDefaultFillColor = (score) => {
4540
4536
  if (score < 0.3) {
4541
- return color("DANGER", 500, "CSS");
4537
+ return color("DANGER", 500, "HEX");
4542
4538
  }
4543
4539
  if (score >= 0.6) {
4544
- return color("SUCCESS", 600, "CSS");
4540
+ return color("SUCCESS", 600, "HEX");
4545
4541
  }
4546
- return color("WARNING", 300, "CSS");
4542
+ return color("WARNING", 300, "HEX");
4547
4543
  };
4548
4544
  /**
4549
4545
  * Helper function to get custom color used by the ValueBar
@@ -5370,7 +5366,7 @@ const cvaMenuList = cvaMerge([
5370
5366
  "p-1",
5371
5367
  "gap-y-0.5",
5372
5368
  "grid",
5373
- "max-h-[max(40dvh,var(--spacing-64))]",
5369
+ "max-h-[max(40dvh_var(--spacing-64))]",
5374
5370
  "overflow-y-auto",
5375
5371
  ]);
5376
5372
  const cvaMenuListDivider = cvaMerge(["mx-[-4px]", "my-0.5", "min-h-px", "bg-neutral-300"]);
@@ -6831,7 +6827,7 @@ const cvaToggleGroupWithSlidingBackground = cvaMerge([], {
6831
6827
  "before:bottom-0.5",
6832
6828
  "before:left-[var(--sliding-left)]",
6833
6829
  "before:w-[var(--sliding-width)]",
6834
- "before:transition-[left,width]",
6830
+ "before:transition-[left_width]",
6835
6831
  "before:duration-[var(--transition-duration)]",
6836
6832
  "before:ease-out",
6837
6833
  "before:rounded",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "1.16.13",
3
+ "version": "1.17.0",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -14,10 +14,10 @@
14
14
  "@floating-ui/react": "^0.26.25",
15
15
  "string-ts": "^2.0.0",
16
16
  "tailwind-merge": "^2.0.0",
17
- "@trackunit/ui-design-tokens": "1.11.30",
18
- "@trackunit/css-class-variance-utilities": "1.11.30",
19
- "@trackunit/shared-utils": "1.13.30",
20
- "@trackunit/ui-icons": "1.11.29",
17
+ "@trackunit/ui-design-tokens": "1.11.31",
18
+ "@trackunit/css-class-variance-utilities": "1.11.31",
19
+ "@trackunit/shared-utils": "1.13.31",
20
+ "@trackunit/ui-icons": "1.11.30",
21
21
  "@tanstack/react-router": "1.114.29",
22
22
  "es-toolkit": "^1.39.10",
23
23
  "@tanstack/react-virtual": "3.13.12",
@@ -1 +1,3 @@
1
- export declare const cvaSkeleton: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
1
+ export declare const cvaSkeleton: (props?: ({
2
+ textSize?: "text-xs" | "text-sm" | "text-base" | "text-lg" | "text-xl" | "text-2xl" | "text-3xl" | "text-4xl" | "text-5xl" | "text-6xl" | "text-7xl" | "text-8xl" | "text-9xl" | null | undefined;
3
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;