diff --git a/components/TempDesignSystem/Card/index.tsx b/components/TempDesignSystem/Card/index.tsx index 7db0e7d22..9f8a52442 100644 --- a/components/TempDesignSystem/Card/index.tsx +++ b/components/TempDesignSystem/Card/index.tsx @@ -5,11 +5,13 @@ import Button from "@/components/TempDesignSystem/Button" import BiroScript from "@/components/TempDesignSystem/Text/BiroScript" import Body from "@/components/TempDesignSystem/Text/Body" import Title from "@/components/TempDesignSystem/Text/Title" -import { getBodyFontColor } from "@/utils/cardBodyFontColor" -import { getScriptFontColor } from "@/utils/cardScriptFontColor" -import { getTheme } from "@/utils/cardTheme" -import { getTitleFontColor } from "@/utils/cardTitleFontColor" +import { + getBodyFontColor, + getScriptFontColor, + getTitleFontColor, +} from "../utils/cardFontColors" +import { getTheme } from "../utils/cardTheme" import { cardVariants } from "./variants" import styles from "./card.module.css" diff --git a/components/TempDesignSystem/utils/cardFontColors.ts b/components/TempDesignSystem/utils/cardFontColors.ts new file mode 100644 index 000000000..bc9fd7f26 --- /dev/null +++ b/components/TempDesignSystem/utils/cardFontColors.ts @@ -0,0 +1,76 @@ +import { biroScriptVariants } from "@/components/TempDesignSystem/Text/BiroScript/variants" +import { bodyVariants } from "@/components/TempDesignSystem/Text/Body/variants" +import { headingVariants } from "@/components/TempDesignSystem/Text/Title/variants" + +import type { VariantProps } from "class-variance-authority" + +import type { CardProps } from "@/components/TempDesignSystem/Card/card" + +export function getTitleFontColor( + theme: CardProps["theme"] +): VariantProps["color"] { + switch (theme) { + case "one": + return "primaryLight" + case "two": + return "secondaryLight" + case "three": + return "tertiaryLight" + case "primaryDark": + return "primaryDark" + case "primaryDim": + return "primaryDim" + case "primaryInverted": + return "primaryLight" + case "primaryStrong": + return "primaryStrong" + case "image": + return "baseText" + } +} + +export function getScriptFontColor( + theme: CardProps["theme"] +): VariantProps["color"] { + switch (theme) { + case "one": + return "primaryLightOnSurfaceAccent" + case "two": + return "secondaryLightAccent" + case "three": + return "tertiaryLightAccent" + case "primaryDark": + return "pink" + case "primaryDim": + return "primaryDimAccent" + case "primaryInverted": + return "primaryLightOnSurfaceAccent" + case "primaryStrong": + return "primaryStrongAccent" + case "image": + return "baseText" + } +} + +export function getBodyFontColor( + theme: CardProps["theme"] +): VariantProps["color"] { + switch (theme) { + case "one": + return "primaryLight" + case "two": + return "secondaryLight" + case "three": + return "tertiaryLight" + case "primaryDark": + return "primaryDark" + case "primaryDim": + return "primaryDim" + case "primaryInverted": + return "primaryLight" + case "primaryStrong": + return "primaryStrong" + case "image": + return "baseText" + } +} diff --git a/utils/cardTheme.ts b/components/TempDesignSystem/utils/cardTheme.ts similarity index 100% rename from utils/cardTheme.ts rename to components/TempDesignSystem/utils/cardTheme.ts diff --git a/utils/cardBodyFontColor.ts b/utils/cardBodyFontColor.ts deleted file mode 100644 index 19791c961..000000000 --- a/utils/cardBodyFontColor.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { CardProps } from "@/components/TempDesignSystem/Card/card" -import { bodyVariants } from "@/components/TempDesignSystem/Text/Body/variants" - -import type { VariantProps } from "class-variance-authority" - -export function getBodyFontColor(theme: CardProps["theme"]) { - let color: VariantProps["color"] - - switch (theme) { - case "one": - return (color = "primaryLight") - case "two": - return (color = "secondaryLight") - case "three": - return (color = "tertiaryLight") - case "primaryDark": - return (color = "primaryDark") - case "primaryDim": - return (color = "primaryDim") - case "primaryInverted": - return (color = "primaryLight") - case "primaryStrong": - return (color = "primaryStrong") - case "image": - return (color = "baseText") - } -} diff --git a/utils/cardScriptFontColor.ts b/utils/cardScriptFontColor.ts deleted file mode 100644 index d9be92511..000000000 --- a/utils/cardScriptFontColor.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { CardProps } from "@/components/TempDesignSystem/Card/card" -import { biroScriptVariants } from "@/components/TempDesignSystem/Text/BiroScript/variants" - -import type { VariantProps } from "class-variance-authority" - -export function getScriptFontColor(theme: CardProps["theme"]) { - let color: VariantProps["color"] - - switch (theme) { - case "one": - return (color = "primaryLightOnSurfaceAccent") - case "two": - return (color = "secondaryLightAccent") - case "three": - return (color = "tertiaryLightAccent") - case "primaryDark": - return (color = "pink") - case "primaryDim": - return (color = "primaryDimAccent") - case "primaryInverted": - return (color = "primaryLightOnSurfaceAccent") - case "primaryStrong": - return (color = "primaryStrongAccent") - case "image": - return (color = "baseText") - } -} diff --git a/utils/cardTitleFontColor.ts b/utils/cardTitleFontColor.ts deleted file mode 100644 index 0c9c32eef..000000000 --- a/utils/cardTitleFontColor.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { CardProps } from "@/components/TempDesignSystem/Card/card" -import { headingVariants } from "@/components/TempDesignSystem/Text/Title/variants" - -import type { VariantProps } from "class-variance-authority" - -export function getTitleFontColor(theme: CardProps["theme"]) { - let color: VariantProps["color"] - - switch (theme) { - case "one": - return (color = "primaryLight") - case "two": - return (color = "secondaryLight") - case "three": - return (color = "tertiaryLight") - case "primaryDark": - return (color = "primaryDark") - case "primaryDim": - return (color = "primaryDim") - case "primaryInverted": - return (color = "primaryLight") - case "primaryStrong": - return (color = "primaryStrong") - case "image": - return (color = "baseText") - } -}