/** * Enhanced Text Component * * SwiftUI-inspired Text component with full typography support, * text formatting, and advanced styling capabilities. */ import type { ModifiableComponentWithModifiers } from '@tachui/core'; import type { Signal } from '@tachui/core'; import type { ComponentProps } from '@tachui/core'; import type { Concatenatable } from '@tachui/core'; import { type ElementOverrideProps } from '@tachui/core'; import { ComponentWithCSSClasses, type CSSClassesProps } from '@tachui/core'; import type { CloneableComponent, CloneOptions } from '@tachui/core/runtime/types'; import type { Asset, ColorAssetProxy, ImageAssetProxy, FontAssetProxy } from '@tachui/core/assets'; /** * Text component properties with element override support and CSS classes */ export interface TextProps extends ComponentProps, ElementOverrideProps, CSSClassesProps { content?: string | (() => string) | Signal; font?: { family?: string | Asset | ColorAssetProxy | ImageAssetProxy | FontAssetProxy; size?: number | string; weight?: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'; style?: 'normal' | 'italic' | 'oblique'; variant?: 'normal' | 'small-caps'; }; color?: string | Signal; backgroundColor?: string | Signal; textAlign?: 'left' | 'center' | 'right' | 'justify'; textDecoration?: 'none' | 'underline' | 'line-through' | 'overline'; textTransform?: 'none' | 'uppercase' | 'lowercase' | 'capitalize'; lineHeight?: number | string; letterSpacing?: number | string; wordSpacing?: number | string; lineLimit?: number; truncationMode?: 'head' | 'tail' | 'middle'; allowsSelection?: boolean; accessibilityLabel?: string; accessibilityRole?: 'text' | 'heading' | 'label'; accessibilityLevel?: 1 | 2 | 3 | 4 | 5 | 6; onTap?: () => void; onLongPress?: () => void; } /** * Text formatting options */ export interface TextFormatting { bold?: boolean; italic?: boolean; underline?: boolean; strikethrough?: boolean; monospace?: boolean; smallCaps?: boolean; } export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6; type TextContent = string | (() => string) | Signal; type TextComponent = ModifiableComponentWithModifiers & Concatenatable; type HeadingAdditionalProps = Omit, 'content' | 'accessibilityRole' | 'accessibilityLevel'>; export interface HeadingProps extends HeadingAdditionalProps { level?: HeadingLevel; } type TextWithHeadingShortcuts = ((content?: TextContent, additionalProps?: Partial) => TextComponent) & { H1: (content?: TextContent, additionalProps?: HeadingAdditionalProps) => TextComponent; H2: (content?: TextContent, additionalProps?: HeadingAdditionalProps) => TextComponent; H3: (content?: TextContent, additionalProps?: HeadingAdditionalProps) => TextComponent; H4: (content?: TextContent, additionalProps?: HeadingAdditionalProps) => TextComponent; H5: (content?: TextContent, additionalProps?: HeadingAdditionalProps) => TextComponent; H6: (content?: TextContent, additionalProps?: HeadingAdditionalProps) => TextComponent; }; /** * Typography presets following SwiftUI patterns */ export declare const Typography: { largeTitle: { size: number; weight: "400"; lineHeight: number; }; title: { size: number; weight: "400"; lineHeight: number; }; title2: { size: number; weight: "400"; lineHeight: number; }; title3: { size: number; weight: "400"; lineHeight: number; }; headline: { size: number; weight: "600"; lineHeight: number; }; body: { size: number; weight: "400"; lineHeight: number; }; callout: { size: number; weight: "400"; lineHeight: number; }; subheadline: { size: number; weight: "400"; lineHeight: number; }; footnote: { size: number; weight: "400"; lineHeight: number; }; caption: { size: number; weight: "400"; lineHeight: number; }; caption2: { size: number; weight: "400"; lineHeight: number; }; }; /** * Enhanced Text component class with reactive content handling, concatenation support, element override, and CSS classes */ export declare class EnhancedText extends ComponentWithCSSClasses implements CloneableComponent, Concatenatable { props: TextProps; readonly type: "component"; readonly id: string; mounted: boolean; cleanup: (() => void)[]; private effectiveTag; private validationResult; constructor(props: TextProps); private resolveDefaultTag; /** * Render the text component with reactive content handling, element override support, and CSS classes */ render(): import("@tachui/core").DOMNode[]; concat(_other: any): any; toSegment(): any; isConcatenatable(): boolean; /** * Cleanup resources */ dispose(): void; clone(options?: CloneOptions): this; shallowClone(): this; deepClone(): this; } /** * Create enhanced Text component with heading shortcuts */ export declare const Text: TextWithHeadingShortcuts; /** * Create a semantic heading element using h1-h6 tags */ export declare function Heading(content?: TextContent, options?: HeadingProps): TextComponent; /** * Text formatting utility functions */ export declare const TextFormat: { /** * Create formatted text with multiple styling options */ formatted(content: string | (() => string) | Signal, formatting: TextFormatting, additionalProps?: Partial): ModifiableComponentWithModifiers & Concatenatable; /** * Create bold text */ bold(content: string | (() => string) | Signal, additionalProps?: Partial): ModifiableComponentWithModifiers & Concatenatable; /** * Create italic text */ italic(content: string | (() => string) | Signal, additionalProps?: Partial): ModifiableComponentWithModifiers & Concatenatable; /** * Create underlined text */ underline(content: string | (() => string) | Signal, additionalProps?: Partial): ModifiableComponentWithModifiers & Concatenatable; /** * Create monospace text */ monospace(content: string | (() => string) | Signal, additionalProps?: Partial): ModifiableComponentWithModifiers & Concatenatable; }; /** * Text styling utilities */ export declare const TextStyles: { heading: (level?: 1 | 2 | 3 | 4 | 5 | 6) => { font: { size: number; weight: "400"; lineHeight: number; } | { size: number; weight: "400"; lineHeight: number; } | { size: number; weight: "400"; lineHeight: number; } | { size: number; weight: "400"; lineHeight: number; } | { size: number; weight: "600"; lineHeight: number; } | { size: number; weight: "400"; lineHeight: number; }; accessibilityRole: "heading"; accessibilityLevel: 2 | 1 | 3 | 4 | 5 | 6; }; body: () => { font: { size: number; weight: "400"; lineHeight: number; }; accessibilityRole: "text"; }; caption: () => { font: { size: number; weight: "400"; lineHeight: number; }; color: string; }; footnote: () => { font: { size: number; weight: "400"; lineHeight: number; }; color: string; }; LargeTitle: (content: string, additionalProps?: Partial) => TextComponent; Title: (content: string, additionalProps?: Partial) => TextComponent; Title2: (content: string, additionalProps?: Partial) => TextComponent; Title3: (content: string, additionalProps?: Partial) => TextComponent; Headline: (content: string, additionalProps?: Partial) => TextComponent; Body: (content: string, additionalProps?: Partial) => TextComponent; Callout: (content: string, additionalProps?: Partial) => TextComponent; Subheadline: (content: string, additionalProps?: Partial) => TextComponent; Footnote: (content: string, additionalProps?: Partial) => TextComponent; Caption: (content: string, additionalProps?: Partial) => TextComponent; Caption2: (content: string, additionalProps?: Partial) => TextComponent; }; export {}; //# sourceMappingURL=Text.d.ts.map