@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
1 lines • 1.59 kB
Source Map (JSON)
{"version":3,"file":"FloatingArrow.mjs","names":[],"sources":["../../../../src/utils/Floating/FloatingArrow/FloatingArrow.tsx"],"sourcesContent":["import { useDirection } from '../../../core';\nimport { ArrowPosition, FloatingPosition } from '../types';\nimport { getArrowPositionStyles } from './get-arrow-position-styles';\n\ninterface FloatingArrowProps extends React.ComponentProps<'div'> {\n position: FloatingPosition;\n arrowSize: number;\n arrowOffset: number;\n arrowRadius: number;\n arrowPosition: ArrowPosition;\n arrowX: number | undefined;\n arrowY: number | undefined;\n visible: boolean | undefined;\n}\n\nexport function FloatingArrow({\n position,\n arrowSize,\n arrowOffset,\n arrowRadius,\n arrowPosition,\n visible,\n arrowX,\n arrowY,\n style,\n ...others\n}: FloatingArrowProps) {\n const { dir } = useDirection();\n if (!visible) {\n return null;\n }\n\n return (\n <div\n {...others}\n style={{\n ...style,\n ...getArrowPositionStyles({\n position,\n arrowSize,\n arrowOffset,\n arrowRadius,\n arrowPosition,\n dir,\n arrowX,\n arrowY,\n }),\n }}\n />\n );\n}\n\nFloatingArrow.displayName = '@mantine/core/FloatingArrow';\n"],"mappings":";;;;;AAeA,SAAgB,cAAc,EAC5B,UACA,WACA,aACA,aACA,eACA,SACA,QACA,QACA,OACA,GAAG,UACkB;CACrB,MAAM,EAAE,QAAQ,cAAc;AAC9B,KAAI,CAAC,QACH,QAAO;AAGT,QACE,oBAAC,OAAD;EACE,GAAI;EACJ,OAAO;GACL,GAAG;GACH,GAAG,uBAAuB;IACxB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD,CAAC;GACH;EACD,CAAA;;AAIN,cAAc,cAAc"}