From c0d1563ee5316a88d3183a37630c48383af7d2d8 Mon Sep 17 00:00:00 2001 From: Anthony Le Courric Date: Tue, 3 Oct 2023 18:29:37 +0200 Subject: [PATCH] =?UTF-8?q?fixup!=20=E2=9C=A8(frontend)=20create=20Text=20?= =?UTF-8?q?component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/common/Text/Text/index.tsx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/frontend/packages/lib_components/src/common/Text/Text/index.tsx b/src/frontend/packages/lib_components/src/common/Text/Text/index.tsx index 91eed5d071..e1bdfff364 100644 --- a/src/frontend/packages/lib_components/src/common/Text/Text/index.tsx +++ b/src/frontend/packages/lib_components/src/common/Text/Text/index.tsx @@ -1,10 +1,7 @@ +import { Maybe } from 'lib-common'; import { ReactHTML } from 'react'; -import { - ObtainHTMLProps, - Typo, - TypoPropsOnly, -} from '@lib-components/common/Typo'; +import { Typo, TypoProps } from '@lib-components/common/Typo'; export const TextWeights = { black: 'fw-black', @@ -25,15 +22,16 @@ export const TextSizes = { tiny: 'fs-t', } as const; -export interface TextPropsOnly extends TypoPropsOnly { +export interface TextPropsOnly { size?: keyof typeof TextSizes; weight?: keyof typeof TextWeights; } type TextTypes = Pick; - -export type TextProps = TextPropsOnly & - ObtainHTMLProps; +export type TextProps> = TypoProps< + T, + TextPropsOnly +>; /** * @param TextPropsOnly - @@ -43,7 +41,7 @@ export type TextProps = TextPropsOnly & * @See {@link Typo } * @returns Text component */ -export const Text = ({ +export const Text = >({ className, size = 'medium-large', type = 'span',