Update and resolve test issues

This commit is contained in:
adilallo
2026-02-05 17:45:57 -07:00
parent b012c73e65
commit 794b978aab
12 changed files with 60 additions and 52 deletions
+2 -2
View File
@@ -142,13 +142,13 @@ export function normalizeVariant(
*/
export function normalizeSize(
value: string | undefined,
defaultValue: "xsmall" = "xsmall"
defaultValue: "xsmall" | "small" | "medium" | "large" | "xlarge" = "xsmall"
): "xsmall" | "small" | "medium" | "large" | "xlarge" {
if (!value) return defaultValue;
const normalized = value.toLowerCase();
const sizes = ["xsmall", "small", "medium", "large", "xlarge"];
if (sizes.includes(normalized)) {
return normalized as typeof defaultValue;
return normalized as "xsmall" | "small" | "medium" | "large" | "xlarge";
}
return defaultValue;
}