function PointerBox()

in src/PointerBox.tsx [23:44]


function PointerBox(props: PointerBoxProps) {
  // don't destructure these, just grab them
  const {bg, border, borderColor, theme, sx} = props
  const {caret, children, ...boxProps} = props

  const caretProps = {
    bg: bg || sx?.bg || sx?.backgroundColor,
    borderColor: borderColor || sx?.borderColor,
    borderWidth: border,
    location: caret,
    theme
  }

  const defaultBoxProps = {borderWidth: '1px', borderStyle: 'solid', borderColor: 'border.default', borderRadius: 2}

  return (
    <Box {...defaultBoxProps} {...boxProps} sx={{...sx, position: 'relative'}}>
      {children}
      <Caret {...caretProps} />
    </Box>
  )
}