<script lang="ts" setup>
type BlockUiProps = {
	show: boolean;
};

withDefaults(defineProps<BlockUiProps>(), {
	show: false,
});
</script>

<template>
	<Transition name="fade" mode="out-in">
		<div
			v-show="show"
			:class="['n8n-block-ui', $style.uiBlocker]"
			role="dialog"
			:aria-hidden="true"
		/>
	</Transition>
</template>

<style lang="scss" module>
.uiBlocker {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: var(--block-ui--overlay--color);
	z-index: 10;
	opacity: 0.6;
	border-radius: var(--radius--lg);
}
</style>

<style lang="scss" scoped>
.fade-enter-active,
.fade-leave-active {
	transition: opacity 200ms;
}
.fade-enter-from,
.fade-leave-to {
	opacity: 0;
}
</style>
