feat(WEB-249): first iteration design system primitives (typography, grid)
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
.body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.bold {
|
||||
font-family: var(--typography-Footnote-Bold-fontFamily);
|
||||
font-size: var(--typography-Footnote-Bold-fontSize);
|
||||
font-weight: var(--typography-Footnote-Bold-fontWeight);
|
||||
letter-spacing: var(--typography-Footnote-Bold-letterSpacing);
|
||||
line-height: var(--typography-Footnote-Bold-lineHeight);
|
||||
text-decoration: var(--typography-Footnote-Bold-textDecoration);
|
||||
}
|
||||
|
||||
.regular {
|
||||
font-family: var(--typography-Footnote-Regular-fontFamily);
|
||||
font-size: var(--typography-Footnote-Regular-fontSize);
|
||||
font-weight: var(--typography-Footnote-Regular-fontWeight);
|
||||
letter-spacing: var(--typography-Footnote-Regular-letterSpacing);
|
||||
line-height: var(--typography-Footnote-Regular-lineHeight);
|
||||
text-decoration: var(--typography-Footnote-Regular-textDecoration);
|
||||
}
|
||||
|
||||
.black {
|
||||
/* No black variable exist yet */
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.burgundy {
|
||||
color: var(--Scandic-Brand-Burgundy);
|
||||
}
|
||||
|
||||
.pale {
|
||||
color: var(--Scandic-Brand-Pale-Peach);
|
||||
}
|
||||
7
components/TempDesignSystem/Text/Footnote/footnote.ts
Normal file
7
components/TempDesignSystem/Text/Footnote/footnote.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { footnoteVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
export interface FootnoteProps
|
||||
extends Omit<React.HTMLAttributes<HTMLHeadingElement>, "color">,
|
||||
VariantProps<typeof footnoteVariants> {}
|
||||
17
components/TempDesignSystem/Text/Footnote/index.tsx
Normal file
17
components/TempDesignSystem/Text/Footnote/index.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { footnoteVariants } from "./variants"
|
||||
|
||||
import type { FootnoteProps } from "./footnote"
|
||||
|
||||
export default function Footnote({
|
||||
children,
|
||||
className = "",
|
||||
color,
|
||||
textTransform,
|
||||
}: FootnoteProps) {
|
||||
const classNames = footnoteVariants({
|
||||
className,
|
||||
color,
|
||||
textTransform,
|
||||
})
|
||||
return <p className={classNames}>{children}</p>
|
||||
}
|
||||
23
components/TempDesignSystem/Text/Footnote/variants.ts
Normal file
23
components/TempDesignSystem/Text/Footnote/variants.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { cva } from "class-variance-authority"
|
||||
|
||||
import styles from "./footnote.module.css"
|
||||
|
||||
const config = {
|
||||
variants: {
|
||||
color: {
|
||||
black: styles.black,
|
||||
burgundy: styles.burgundy,
|
||||
pale: styles.pale,
|
||||
},
|
||||
textTransform: {
|
||||
bold: styles.bold,
|
||||
regular: styles.regular,
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
color: "black",
|
||||
textTransform: "regular",
|
||||
},
|
||||
} as const
|
||||
|
||||
export const footnoteVariants = cva(styles.footnote, config)
|
||||
Reference in New Issue
Block a user