A custom React hook that triggers a callback when a user clicks outside a specified element, with optional exclusions.