UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

1 lines 1.66 kB
{"version":3,"file":"FloatingArrow.cjs","names":["useDirection","getArrowPositionStyles"],"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,QAAQA,0BAAAA,cAAc;AAC9B,KAAI,CAAC,QACH,QAAO;AAGT,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,GAAI;EACJ,OAAO;GACL,GAAG;GACH,GAAGC,kCAAAA,uBAAuB;IACxB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD,CAAC;GACH;EACD,CAAA;;AAIN,cAAc,cAAc"}