@use '@lucca-front/icons/src/commons/utils/icon';
@use '@lucca-front/scss/src/commons/utils/form';

@mixin disabled {
	~ .checkbox-label {
		color: var(--palettes-neutral-600); // disabled token candidate
		cursor: default;

		&::before {
			border-color: var(--palettes-neutral-500); // disabled token candidate
		}

		.checkbox-label-helper {
			color: var(--palettes-neutral-600); // disabled token candidate
		}
	}

	&:checked ~ .checkbox-label {
		&::before {
			color: var(--palettes-neutral-600); // disabled token candidate
			background-color: var(--commons-disabled-background);
			border-color: var(--commons-disabled-background);
		}
	}
}

@mixin incomplete {
	~ .checkbox-mixed ~ .checkbox-label,
	~ .checkbox-label {
		&::before {
			@include icon.generate('maths_minus');
		}
	}
}

@mixin required {
	~ .checkbox-label,
	.checkbox-label {
		&:not(:empty) {
			&::after {
				@include form.required;
			}
		}
	}
}

@mixin state($state) {
	.checkbox-label {
		&::before {
			border-color: var(--palettes-#{$state}-600);
		}
	}
}
