@metamask/design-system-react
Version:
Design system react ui components
1 lines • 2.8 kB
Source Map (JSON)
{"version":3,"file":"BadgeWrapper.types.cjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps } from 'react';\n\nimport type {\n BadgeWrapperPosition,\n BadgeWrapperCustomPosition,\n BadgeWrapperPositionAnchorShape,\n} from '../../types';\n\n/**\n * Badge component props.\n */\nexport type BadgeWrapperProps = {\n /**\n * Optional prop to determine the shape of the anchoring element.\n * This prop gets used along with position, positionXOffset, and positionYOffset\n * to determine the final position.\n * Possible values:\n * BadgeWrapperPositionAnchorShape.Circular,\n * - BadgeWrapperPositionAnchorShape.Rectangular,\n *\n * @default BadgeWrapperPositionAnchorShape.Circular\n */\n positionAnchorShape?: BadgeWrapperPositionAnchorShape;\n /**\n * Optional prop to control the preset position of the badge.\n * This prop gets used along with positionAnchorShape, positionXOffset, and positionYOffset\n * to determine the final position.\n *\n * @default BadgeWrapperPosition.TopRight\n */\n position?: BadgeWrapperPosition;\n /**\n * Optional prop to move the preset position horizontally.\n * This prop gets used along with position, positionAnchorShape, and positionYOffset\n * to determine the final position.\n *\n * @default 0\n */\n positionXOffset?: number;\n /**\n * Optional prop to move the preset position vertically.\n * This prop gets used along with position, positionAnchorShape, and positionXOffset\n * to determine the final position.\n *\n * @default 0\n */\n positionYOffset?: number;\n /**\n * Optional prop to customize the position through the position object.\n * Position object - {top: 0, right: 0, bottom: 0, left: 0}\n */\n customPosition?: BadgeWrapperCustomPosition;\n /**\n * The element that the badge will attach itself to.\n */\n children: React.ReactNode;\n /**\n * Optional prop to pass additional props to the children container\n */\n childrenContainerProps?: ComponentProps<'div'>;\n /**\n * Any element that will be placed in the position of the badge.\n */\n badge: React.ReactNode;\n /**\n * Optional prop to pass additional props to the badge container\n */\n badgeContainerProps?: ComponentProps<'div'>;\n /**\n * Optional prop for additional CSS classes to be applied to the BadgeWrapper 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 style.\n */\n style?: React.CSSProperties;\n /**\n * Optional prop to add a test id to the BadgeWrapper\n */\n 'data-testid'?: string;\n} & ComponentProps<'div'>;\n"]}