Skip to content

Commit

Permalink
Fix typing issue with heading variants
Browse files Browse the repository at this point in the history
  • Loading branch information
selbekk committed Aug 21, 2023
1 parent 3d852b8 commit 2693928
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/soft-terms-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vygruppen/spor-react": patch
---

Heading: Fix a bug with variants
2 changes: 1 addition & 1 deletion apps/docs/app/routes/_index/HeroSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function HeroSection() {
<Container maxWidth="container.lg" mt={[0, 8]}>
<Flex flexDirection={["column-reverse", "row"]} alignItems="center">
<Flex flexDirection="column" color="white" flex={["auto", "55%"]}>
<Heading as="h1" variant="2xl">
<Heading as="h1" variant="xxl">
Velkommen til Spor
</Heading>
<Box marginBottom={[10, 0]}>
Expand Down
8 changes: 3 additions & 5 deletions packages/spor-react/src/typography/Heading.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { HeadingProps as ChakraHeadingProps, Text } from "@chakra-ui/react";
import type tokens from "@vygruppen/spor-design-tokens";
import React from "react";

type TextStyles = keyof typeof tokens.font.style;
import type { textStyles } from "../theme/foundations";

export type HeadingProps = Omit<ChakraHeadingProps, "textStyle" | "as"> & {
/** The heading level, e.g. h1, h2, h3... **/
as: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
/** The size and style of the heading */
variant?: TextStyles;
/** The size and style of the heading. Defaults to xl-display */
variant?: keyof typeof textStyles;
};
/**
* Create your own fancy headings with this component.
Expand Down

0 comments on commit 2693928

Please sign in to comment.