UNPKG

@metamask/design-system-react

Version:
1 lines 2.49 kB
{"version":3,"file":"Text.types.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n FontFamily,\n FontStyle,\n FontWeight,\n OverflowWrap,\n TextAlign,\n TextVariant,\n TextTransform,\n TextColor,\n} from '../../types';\n\nexport type TextProps = {\n /**\n * Optional prop for inline styles\n */\n style?: React.CSSProperties;\n /**\n * Optional prop to change the font size of the component. The Text component uses responsive font sizes.\n * Different variants map to specific HTML elements by default.\n *\n * @default TextVariant.BodyMd\n */\n variant?: TextVariant;\n /**\n * The text content or elements to be rendered within the component.\n */\n children: React.ReactNode;\n /**\n * Optional prop for additional CSS classes to be applied to the Text component.\n */\n className?: string;\n /**\n * Optional prop to control the font weight of the text.\n * Regular: 400\n * Medium: 500\n * Bold: 700\n */\n fontWeight?: FontWeight;\n /**\n * Optional prop to adjust the font family.\n * Default: Geist\n * Accent: MM Sans\n * Hero: MM Poly\n */\n fontFamily?: FontFamily;\n /**\n * Optional prop to control the font style of the text.\n * Options: Normal, Italic\n */\n fontStyle?: FontStyle;\n /**\n * Optional prop to apply text transformation to the content.\n * Options: Uppercase, Lowercase, Capitalize, Normal\n */\n textTransform?: TextTransform;\n /**\n * Optional prop to control the text alignment within its container.\n * Options: Left, Center, Right, Justify\n */\n textAlign?: TextAlign;\n /**\n * Optional prop to determine how text should wrap when it reaches the edge of its container.\n * Options: BreakWord, Anywhere, Normal\n */\n overflowWrap?: OverflowWrap;\n /**\n * Optional prop that when true, adds an ellipsis (...) when text overflows its container.\n *\n * @default false\n */\n ellipsis?: boolean;\n /**\n * Optional boolean that determines if the component should merge its props onto its immediate child\n * instead of rendering a default DOM element.\n *\n * @default false\n */\n asChild?: boolean;\n /**\n * Optional prop that sets the color of the text using predefined theme colors.\n *\n * @default TextColor.TextDefault\n */\n color?: TextColor;\n /**\n * Optional prop for testing purposes\n */\n 'data-testid'?: string;\n};\n"]}