@fluentui/react-northstar
Version:
A themable React component library.
59 lines (58 loc) • 2.86 kB
TypeScript
import * as PropTypes from 'prop-types';
import * as React from 'react';
import { UIComponentProps, ContentComponentProps, ChildrenComponentProps, ColorComponentProps, SizeValue, AlignValue } from '../../utils';
import { Accessibility } from '@fluentui/accessibility';
import { FluentComponentStaticProps } from '../../types';
export interface TextProps extends UIComponentProps, ContentComponentProps, ChildrenComponentProps, ColorComponentProps {
/**
* Accessibility behavior if overridden by the user.
*/
accessibility?: Accessibility<never>;
/** At mentions can be formatted to draw users' attention. Mentions for "me" can be formatted to appear differently. */
atMention?: boolean | 'me';
/** Set as disabled Text component */
disabled?: boolean;
/** Set as error Text component */
error?: boolean;
/** The text can appear more important and draw user's attention */
important?: boolean;
/** The size for the Text component */
size?: SizeValue;
/** The weight for the Text component */
weight?: 'light' | 'semilight' | 'regular' | 'semibold' | 'bold';
/** Set as success Text component */
success?: boolean;
/** The text can signify a temporary state */
temporary?: boolean;
/** Align text content. */
align?: AlignValue;
/** Set as timestamp Text component */
timestamp?: boolean;
/** Truncates text as needed */
truncated?: boolean;
}
export declare type TextStylesProps = Pick<TextProps, 'atMention' | 'color' | 'important' | 'timestamp' | 'truncated' | 'disabled' | 'error' | 'success' | 'temporary' | 'align' | 'weight' | 'size'>;
export declare const textClassName = "ui-text";
/**
* A Text consistently styles and formats occurrences of text.
*/
export declare const Text: (<TExtendedElementType extends React.ElementType<any> = "span">(props: React.RefAttributes<HTMLSpanElement> & Omit<import("@fluentui/react-bindings").PropsOfElement<TExtendedElementType>, "as" | keyof TextProps> & {
as?: TExtendedElementType;
} & TextProps) => JSX.Element) & {
propTypes?: React.WeakValidationMap<TextProps> & {
as: React.Requireable<string | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any)>;
};
contextTypes?: PropTypes.ValidationMap<any>;
defaultProps?: Partial<TextProps & {
as: "span";
}>;
/**
* A Text consistently styles and formats occurrences of text.
*/
displayName?: string;
readonly __PRIVATE_PROPS?: React.RefAttributes<HTMLSpanElement> & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
ref?: React.Ref<HTMLSpanElement>;
}, "as" | keyof TextProps> & {
as?: "span";
} & TextProps;
} & FluentComponentStaticProps<TextProps>;