fix(SW-719): use utils inside components folder
This commit is contained in:
@@ -9,9 +9,9 @@ import Title from "@/components/TempDesignSystem/Text/Title"
|
|||||||
import {
|
import {
|
||||||
getBodyFontColor,
|
getBodyFontColor,
|
||||||
getScriptFontColor,
|
getScriptFontColor,
|
||||||
|
getTheme,
|
||||||
getTitleFontColor,
|
getTitleFontColor,
|
||||||
} from "../utils/cardFontColors"
|
} from "./utils"
|
||||||
import { getTheme } from "../utils/cardTheme"
|
|
||||||
import { cardVariants } from "./variants"
|
import { cardVariants } from "./variants"
|
||||||
|
|
||||||
import styles from "./card.module.css"
|
import styles from "./card.module.css"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { headingVariants } from "@/components/TempDesignSystem/Text/Title/varian
|
|||||||
|
|
||||||
import type { VariantProps } from "class-variance-authority"
|
import type { VariantProps } from "class-variance-authority"
|
||||||
|
|
||||||
|
import type { ButtonProps } from "@/components/TempDesignSystem/Button/button"
|
||||||
import type { CardProps } from "@/components/TempDesignSystem/Card/card"
|
import type { CardProps } from "@/components/TempDesignSystem/Card/card"
|
||||||
|
|
||||||
export function getTitleFontColor(
|
export function getTitleFontColor(
|
||||||
@@ -74,3 +75,22 @@ export function getBodyFontColor(
|
|||||||
return "baseText"
|
return "baseText"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getTheme(theme: CardProps["theme"]): ButtonProps["theme"] {
|
||||||
|
switch (theme) {
|
||||||
|
case "two":
|
||||||
|
return "secondaryLight"
|
||||||
|
case "three":
|
||||||
|
return "tertiaryLight"
|
||||||
|
case "primaryDark":
|
||||||
|
return "primaryDark"
|
||||||
|
case "primaryStrong":
|
||||||
|
case "image":
|
||||||
|
return "primaryStrong"
|
||||||
|
case "one":
|
||||||
|
case "primaryDim":
|
||||||
|
case "primaryInverted":
|
||||||
|
default:
|
||||||
|
return "primaryLight"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import type { ButtonProps } from "@/components/TempDesignSystem/Button/button"
|
|
||||||
import type { CardProps } from "@/components/TempDesignSystem/Card/card"
|
|
||||||
|
|
||||||
export function getTheme(theme: CardProps["theme"]): ButtonProps["theme"] {
|
|
||||||
switch (theme) {
|
|
||||||
case "two":
|
|
||||||
return "secondaryLight"
|
|
||||||
case "three":
|
|
||||||
return "tertiaryLight"
|
|
||||||
case "primaryDark":
|
|
||||||
return "primaryDark"
|
|
||||||
case "primaryStrong":
|
|
||||||
case "image":
|
|
||||||
return "primaryStrong"
|
|
||||||
case "one":
|
|
||||||
case "primaryDim":
|
|
||||||
case "primaryInverted":
|
|
||||||
default:
|
|
||||||
return "primaryLight"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user