@prosperitainova/dumbo-react-native
Version:
Dumbo for React Native Library
35 lines • 1.78 kB
TypeScript
import React from 'react';
import { StyleProp, TextProps as ReactTextProps, TextStyle } from 'react-native';
/** Types of Text items */
export type TextTypes = 'code-01' | 'code-02' | 'label-01' | 'label-02' | 'helper-text-01' | 'helper-text-02' | 'legal-01' | 'legal-02' | 'body-compact-01' | 'body-compact-02' | 'body-01' | 'body-02' | 'heading-compact-01' | 'heading-compact-02' | 'heading-01' | 'heading-02' | 'heading-03' | 'heading-04' | 'heading-05' | 'heading-06' | 'heading-07';
/**
* Types of text break modes (where to apply ellipsis)
* `head` - Ellipsis at the beginning
* `middle` - Ellipsis at the middle of string
* `tail` - Ellipsis at the end of string
* `wrap` - No ellipsis. Text will just run on. Wrapping style may need to handle this
* */
export type TextBreakModes = 'head' | 'middle' | 'tail' | 'wrap';
/** Props for Text component */
export type TextProps = {
/** Text to render */
text?: string;
/** Type of text to render (style of Carbon) body-compact-02 is default */
type?: TextTypes;
/** Define the break mode to use. Undefined is same as wrap (tail is normal use) */
breakMode?: TextBreakModes;
/** Style to set on the item */
style?: StyleProp<TextStyle>;
/** Direct props to set on the React Native component (including iOS and Android specific props). Most use cases should not need this. */
componentProps?: ReactTextProps;
};
/**
* Text component for rendering blocks of text styled with Carbon text style
*
* {@link https://github.com/carbon-design-system/carbon-react-native/blob/main/example/src/Views/Text.tsx | Example code}
*/
export declare class Text extends React.Component<TextProps> {
private get textStyle();
render(): React.ReactNode;
}
//# sourceMappingURL=index.d.ts.map