diff --git a/packages/frontend/src/components/shared/Heading/Heading.theme.ts b/packages/frontend/src/components/shared/Heading/Heading.theme.ts new file mode 100644 index 00000000..1c7553bb --- /dev/null +++ b/packages/frontend/src/components/shared/Heading/Heading.theme.ts @@ -0,0 +1,7 @@ +import { tv, type VariantProps } from 'tailwind-variants'; + +export const headingTheme = tv({ + base: ['text-elements-high-em', 'font-display', 'font-semibold'], +}); + +export type HeadingVariants = VariantProps; diff --git a/packages/frontend/src/components/shared/Heading/Heading.tsx b/packages/frontend/src/components/shared/Heading/Heading.tsx new file mode 100644 index 00000000..0621039f --- /dev/null +++ b/packages/frontend/src/components/shared/Heading/Heading.tsx @@ -0,0 +1,30 @@ +import React, { type PropsWithChildren } from 'react'; + +import { headingTheme, type HeadingVariants } from './Heading.theme'; +import { PolymorphicProps } from 'types/common'; + +export type HeadingElementType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; + +export type HeadingProps = + PropsWithChildren>; + +export const Heading = ({ + children, + as, + className, + ...props +}: HeadingProps) => { + // Component is the element that will be rendered + const Component = as ?? 'h1'; + + return ( + + {children} + + ); +}; diff --git a/packages/frontend/src/components/shared/Heading/index.ts b/packages/frontend/src/components/shared/Heading/index.ts new file mode 100644 index 00000000..6406e7b0 --- /dev/null +++ b/packages/frontend/src/components/shared/Heading/index.ts @@ -0,0 +1 @@ +export * from './Heading';