UNPKG

@metamask/design-system-react

Version:
1 lines 2.07 kB
{"version":3,"file":"AvatarBase.types.mjs","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps } from 'react';\n\nimport type { AvatarBaseSize, AvatarBaseShape } from '../../types';\nimport type { TextProps } from '../Text';\n\nexport type AvatarBaseProps = ComponentProps<'div'> & {\n /**\n * Required prop for the content to be rendered within the AvatarBase\n * Not required if fallbackText is provided\n */\n children?: React.ReactNode;\n /**\n * Optional text to display when no children are provided\n */\n fallbackText?: string;\n /**\n * Optional props to be passed to the Text component when rendering fallback text\n * Only used when fallbackText is provided and no children\n */\n fallbackTextProps?: Partial<\n React.HTMLAttributes<HTMLSpanElement> & TextProps\n >;\n /**\n * Optional prop for additional CSS classes to be applied to the AvatarBase component.\n * These classes will be merged with the component's default classes using twMerge.\n */\n className?: string;\n /**\n * Optional prop to control the size of the AvatarBase\n *\n * @default AvatarBaseSize.Md\n */\n size?: AvatarBaseSize;\n /**\n * Optional boolean that determines if the component should merge its props onto its immediate child\n * instead of rendering a div element\n *\n * @default false\n */\n asChild?: boolean;\n /**\n * Optional CSS styles to be applied to the component.\n * Should be used sparingly and only for dynamic styles that can't be achieved with className.\n */\n style?: React.CSSProperties;\n /**\n * Optional prop to control the shape of the AvatarBase\n *\n * @default AvatarBaseShape.Circle\n */\n shape?: AvatarBaseShape;\n /**\n * Optional prop to include the border with the Avatar.\n * For internal use only\n *\n * @default false\n */\n hasBorder?: boolean;\n /**\n * Optional prop to add a test id to the icon\n */\n 'data-testid'?: string;\n};\n"]}