UNPKG

@metamask/design-system-react-native

Version:
1 lines 2.57 kB
{"version":3,"file":"BadgeWrapper.types.cjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps, StyleProp, ViewStyle } from 'react-native';\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?: ViewProps;\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?: ViewProps;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n} & ViewProps;\n"]}