Skip to content

Commit

Permalink
Fix typing issue with heading variants (#789)
Browse files Browse the repository at this point in the history
  • Loading branch information
selbekk authored Aug 21, 2023
1 parent 41f9825 commit a19a1e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 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
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 a19a1e8

Please sign in to comment.