Skip to content

Commit

Permalink
Fix Heading > xs size
Browse files Browse the repository at this point in the history
  • Loading branch information
florianduros committed Nov 8, 2023
1 parent 5a703b4 commit c3c8ff0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/Typography/Heading.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default {
component: HeadingComponent,
argTypes: {
size: {
options: ["xs", "sm", "md", "lg"],
options: ["sm", "md", "lg", "xl"],
control: { type: "inline-radio" },
},
weight: {
Expand Down
7 changes: 6 additions & 1 deletion src/components/Typography/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@ import React from "react";
import { Typography } from "./Typography";
import { Text } from "./Text";

type TypographyProps = React.ComponentProps<typeof Typography>;

/**
* A heading component.
*/
export const Heading: React.FC<
Omit<React.ComponentProps<typeof Typography>, "type">
Omit<TypographyProps, "type"> & {
// xs is not a valid heading size
size?: Exclude<TypographyProps["size"], "xs">;
}
> = ({ as = "h1", children, ...props }) => {
return (
<Typography as={as} type="heading" {...props}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Typography/Typography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type TypographyProps<C extends React.ElementType> = {
/**
* The t-shirt size of the content.
*/
size?: "xs" | "sm" | "md" | "lg";
size?: "xs" | "sm" | "md" | "lg" | "xl";
/**
* The CSS class name.
*/
Expand Down

0 comments on commit c3c8ff0

Please sign in to comment.