import { ReactNode } from 'react'; import type { GlobalProps } from '@lendi-ui/commons/utils'; import type { TextVariant } from '@lendi-ui/commons/typography'; export interface FontSizeType { mobile: string; desktop?: string; } export type TextAlignProp = 'left' | 'right' | 'center'; interface BaseTextProps extends GlobalProps { children: ReactNode; /** * Indicates which html tag should be used. Use the appropriate tag for the content structure for accessibility. */ tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'label'; /** * Override the text alignment if needed */ align?: TextAlignProp; /** * If you need to use Text as a wrapper, what selector should the styles target. If you use this, pass 'span' to the tag prop. */ styleTarget?: string; /** * Activate mobile styles. For docs and testing purposes only, do not use. */ isMobile?: boolean; /** * White text for on dark backgrounds */ isInverse?: boolean; /** * CSS display options */ display?: 'block' | 'flex' | 'inline-flex' | 'inline-block'; id?: string; /** * Use only when needed for error text. In most cases, errors will be provided by other LUI components and this won't be necessary. */ role?: 'alert'; className?: string; } interface BasicAppearanceProps { variant?: TextVariant; appearance?: never; } interface SecondaryAppearanceProps { variant?: 'subtitle1' | 'subtitle2' | 'body1' | 'body2' | 'lead1' | 'lead2' | 'overline'; appearance?: 'subtle'; } interface ErrorAppearanceProps { variant?: 'detail1' | 'detail2'; appearance?: 'error' | 'subtle'; } export type TextAppearance = BasicAppearanceProps | SecondaryAppearanceProps | ErrorAppearanceProps; type TextProps = BaseTextProps & TextAppearance & { for?: never; }; type LabelTextProps = BaseTextProps & { tag: 'label'; /** * Only available when using the label tag */ for?: string; variant?: TextVariant; appearance?: never; }; export type TextComponentProps = TextProps | LabelTextProps; export type StyledTextProps = Omit & { htmlFor?: string; $display?: string; }; export declare const Text: ({ children, variant, className, ...props }: TextComponentProps) => JSX.Element; export {};