Skip to content

Commit

Permalink
Merge pull request #10 from babylonlabs-io/improvements
Browse files Browse the repository at this point in the history
feat: make variant prop optional for Text component
  • Loading branch information
totraev authored Nov 21, 2024
2 parents 812bc6c + 0b77b2f commit 9d4c462
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@babylonlabs-io/bbn-core-ui",
"version": "0.0.3",
"version": "0.0.4",
"type": "module",
"types": "dist/index.d.ts",
"publishConfig": {
Expand Down Expand Up @@ -84,4 +84,4 @@
"plugin:storybook/recommended"
]
}
}
}
6 changes: 3 additions & 3 deletions src/components/Text/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HTMLProps, createElement, forwardRef } from "react";
import { type HTMLProps, createElement, forwardRef } from "react";
import { twMerge } from "tailwind-merge";

const STYLES = {
Expand All @@ -13,12 +13,12 @@ const STYLES = {
type Variant = keyof typeof STYLES;

export interface TextProps extends HTMLProps<HTMLElement> {
variant: Variant;
variant?: Variant;
as?: string;
}

export const Text = forwardRef<HTMLElement, TextProps>(
({ variant, as = "p", children, className, ...restProps }, ref) => {
({ variant = "body1", as = "p", children, className, ...restProps }, ref) => {
return createElement(
as,
{
Expand Down

0 comments on commit 9d4c462

Please sign in to comment.