import * as React from 'react'; import { type VariantProps } from 'class-variance-authority'; import type { SerializedEditorState, SerializedLexicalNode } from 'lexical'; import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'; declare const textVariants: (props?: ({ size?: 1 | "none" | 2 | 3 | 4 | null | undefined; weight?: "bold" | "medium" | "semibold" | "extraBold" | "black" | null | undefined; align?: "left" | "right" | "center" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string; type TextSpanProps = { as?: 'span'; } & ComponentPropsWithout<'span', RemovedProps>; type TextDivProps = { as: 'div'; } & ComponentPropsWithout<'div', RemovedProps>; type TextLabelProps = { as: 'label'; } & ComponentPropsWithout<'label', RemovedProps>; type TextPProps = { as: 'p'; } & ComponentPropsWithout<'p', RemovedProps>; interface CommonTextProps extends VariantProps { as?: 'div' | 'label' | 'p' | 'span'; asChild?: boolean; color?: string; /** 相当于 dangerouslySetInnerHTML */ html?: string | SerializedEditorState; } type TextProps = CommonTextProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps); /** * Text - 文本组件 * * @description 用于显示文本内容的组件,支持多种尺寸、字重、对齐方式和HTML内容 * * @param {object} props - 组件属性 * @param {1|2|3|4|"none"} props.size - 文字尺寸 * - `1`: 12px (小号文字,适用于说明文字) * - `2`: 14px (常规文字,适用于正文内容) * - `3`: 16px (中号文字,适用于重要内容) * - `4`: 18px (大号文字,适用于标题或强调内容) * - `none`: 无预设大小,继承父级样式 * @param {"medium"|"semibold"|"bold"|"extraBold"|"black"} props.weight - 字重 * @param {"left"|"center"|"right"} props.align - 文字对齐方式 * @param {"div"|"label"|"p"|"span"} props.as - 渲染的 HTML 标签 * @param {boolean} props.asChild - 是否作为子组件渲染 * @param {string} props.color - 文字颜色 * @param {string|SerializedEditorState} props.html - HTML 内容或富文本编辑器状态 * * @example * ```tsx * // 基础用法 * 这是一段正文 * * // 大号加粗文字 * 重要标题 * * // 居中对齐的小号文字 * 说明文字 * * // 渲染为段落标签 * 段落内容 * ``` */ declare const Text: React.ForwardRefExoticComponent>; export { Text }; export type { TextProps };