A themed box container with optional header and close icon, used to wrap content in modals, cards, or sidebars.

This component conditionally renders a title and close button if headerTitle or onClose is provided. It supports dynamic theming using useColorParser, and custom styles via the sx prop.

<BoxWithCloseContainer
headerTitle="Details"
onClose={() => setOpen(false)}
backgroundColor="background"
>
<Typography>This is some content inside the container.</Typography>
</BoxWithCloseContainer>