Files
web/packages/design-system/lib/components/ChipStatic/ChipStatic.tsx
Anton Gunnarsson d371d45fd2 Merged in chore/configure-knip (pull request #3417)
Add knip configuration

* Add knip configuration


Approved-by: Joakim Jäderberg
2026-01-12 09:07:10 +00:00

38 lines
912 B
TypeScript

import { Typography } from "../Typography"
import { variants } from "./variants"
import type { TypographyProps } from "../Typography/types"
import type { VariantProps } from "class-variance-authority"
import type { ReactNode } from "react"
type ChipStaticProps = {
children: ReactNode
className?: string
lowerCase?: boolean
} & VariantProps<typeof variants>
export function ChipStatic({
className,
color,
size,
lowerCase = false,
children,
}: ChipStaticProps) {
const classNames = variants({ className, color, size })
const typographyVariant = getTypographyVariant(lowerCase)
return (
<Typography variant={typographyVariant}>
<span className={classNames}>{children}</span>
</Typography>
)
}
function getTypographyVariant(lowerCase: boolean): TypographyProps["variant"] {
if (lowerCase) {
return "Body/Supporting text (caption)/smRegular"
}
return "Tag/sm"
}