From fbd5573f60f56a143d1b071196e37b6d72b9be06 Mon Sep 17 00:00:00 2001 From: Caleb Jacob Date: Wed, 31 Jul 2024 11:07:24 -0600 Subject: [PATCH] Support as label for text --- package.json | 2 +- src/components/Text.tsx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0f8b1dd..42fae91 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@near-pagoda/ui", - "version": "0.2.2", + "version": "0.2.3", "description": "A React component library that implements the official NEAR design system.", "license": "MIT", "repository": { diff --git a/src/components/Text.tsx b/src/components/Text.tsx index d2219a7..ff0140b 100644 --- a/src/components/Text.tsx +++ b/src/components/Text.tsx @@ -3,7 +3,7 @@ import { CSSProperties, ReactNode } from 'react'; import { ThemeColor, ThemeFontSize } from '../utils/types'; import s from './Text.module.scss'; -type Tag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span'; +type Tag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'label'; const defaultSizes: Record = { h1: 'text-3xl', @@ -14,10 +14,11 @@ const defaultSizes: Record = { h6: 'text-s', p: 'text-base', span: 'text-base', + label: 'text-base', }; type Props = { - as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span'; + as?: Tag; children: ReactNode; clampLines?: number; className?: string;