////
/// @group utilities
////

// A mixin for styling `.close` overwrites Bootstrap 4.1.2's `&:not(:disabled):not(.disabled)` selector
/// @param {Map} $map - A map of `key: value` pairs. The keys and value types are listed below:
/// @example
/// align-items: {String | Null},
/// bg: {Color | String | Null},
/// border-color: {Color | String | List | Null},
/// border-radius: {Number | String | List | Null},
/// color: {Color | String | Null},
/// display: {String | Null},
/// font-family: {String | List | Null},
/// font-size: {Number | String | Null},
/// font-weight: {Number | String | Null},
/// height: {Number | String | Null},
/// justify-content: {String | Null},
/// line-height: {Number | String | Null},
/// margin-bottom: {Number | String | Null},
/// margin-left: {Number | String | Null},
/// margin-right: {Number | String | Null},
/// margin-top: {Number | String | Null},
/// opacity: {Number | String | Null},
/// padding-bottom: {Number | String | Null},
/// padding-left: {Number | String | Null},
/// padding-right: {Number | String | Null},
/// padding-top: {Number | String | Null},
/// position: {String | Null},
/// bottom: {Number | String | Null},
/// left: {Number | String | Null},
/// right: {Number | String | Null},
/// top: {Number | String | Null},
/// text-align: {String | Null},
/// text-decoration: {String | Null},
/// text-transform: {String | List | Null},
/// transition: {String | List | Null},
/// vertical-align: {String | Null},
/// width: {Number | String | Null},
/// hover-bg: {Color | String | Null},
/// hover-color: {Color | String | Null},
/// hover-opacity: {Number | String | Null},
/// hover-text-decoration: {String | Null},
/// focus-bg: {Color | String | Null},
/// focus-box-shadow: {String | List | Null},
/// focus-color: {Color | String | Null},
/// focus-opacity: {Number | String | Null},
/// focus-outline: {Number | String | Null},
/// focus-text-decoration: {String | Null},
/// active-bg: {Color | String | Null},
/// active-border-color: {Color | String | List | Null},
/// active-color: {Color | String | Null},
/// disabled-bg: {Color | String | Null},
/// disabled-border-color: {Color | String | List | Null},
/// disabled-box-shadow: {String | List | Null},
/// disabled-color: {Color | String | Null},
/// disabled-cursor: {String | Null},
/// disabled-opacity: {Number | String | Null},
/// disabled-pointer-events: {String | Null},
/// disabled-text-decoration: {String | Null},
/// btn-focus-box-shadow: {String | List | Null},
/// btn-focus-outline: {Number | String | Null},
/// lexicon-icon-margin-bottom: {Number | String | Null},
/// lexicon-icon-margin-left: {Number | String | Null},
/// lexicon-icon-margin-right: {Number | String | Null},
/// lexicon-icon-margin-top: {Number | String | Null},
/// @todo
/// - Add @example
/// - Add @link to documentation

@mixin clay-close($map) {
	$align-items: map-get($map, align-items);
	$bg: map-get($map, bg);
	$border-color: map-get($map, border-color);
	$border-radius: map-get($map, border-radius);
	$color: map-get($map, color);
	$display: map-get($map, display);
	$font-family: map-get($map, font-family);
	$font-size: map-get($map, font-size);
	$font-weight: map-get($map, font-weight);
	$height: map-get($map, height);
	$justify-content: map-get($map, justify-content);
	$line-height: map-get($map, line-height);
	$margin-bottom: map-get($map, margin-bottom);
	$margin-left: map-get($map, margin-left);
	$margin-right: map-get($map, margin-right);
	$margin-top: map-get($map, margin-top);
	$opacity: map-get($map, opacity);
	$padding-bottom: map-get($map, padding-bottom);
	$padding-left: map-get($map, padding-left);
	$padding-right: map-get($map, padding-right);
	$padding-top: map-get($map, padding-top);
	$position: map-get($map, position);

	$bottom: map-get($map, bottom);
	$left: map-get($map, left);
	$right: map-get($map, right);
	$top: map-get($map, top);

	$text-align: map-get($map, text-align);
	$text-decoration: map-get($map, text-decoration);
	$text-transform: map-get($map, text-transform);
	$transition: map-get($map, transition);
	$vertical-align: map-get($map, vertical-align);
	$width: map-get($map, width);

	$hover-bg: map-get($map, hover-bg);
	$hover-color: map-get($map, hover-color);
	$hover-opacity: map-get($map, hover-opacity);
	$hover-text-decoration: map-get($map, hover-text-decoration);

	$focus-bg: map-get($map, focus-bg);
	$focus-box-shadow: map-get($map, focus-box-shadow);
	$focus-color: map-get($map, focus-color);
	$focus-opacity: map-get($map, focus-opacity);
	$focus-outline: map-get($map, focus-outline);
	$focus-text-decoration: map-get($map, focus-text-decoration);

	$active-bg: map-get($map, active-bg);
	$active-border-color: map-get($map, active-border-color);
	$active-color: map-get($map, active-color);

	$disabled-bg: map-get($map, disabled-bg);
	$disabled-border-color: map-get($map, disabled-border-color);
	$disabled-box-shadow: map-get($map, disabled-box-shadow);
	$disabled-color: map-get($map, disabled-color);
	$disabled-cursor: map-get($map, disabled-cursor);
	$disabled-opacity: map-get($map, disabled-opacity);
	$disabled-pointer-events: map-get($map, disabled-pointer-events);
	$disabled-text-decoration: map-get($map, disabled-text-decoration);

	$btn-focus-box-shadow: map-get($map, btn-focus-box-shadow);
	$btn-focus-outline: map-get($map, btn-focus-outline);

	$lexicon-icon-margin-bottom: map-get($map, lexicon-icon-margin-bottom);
	$lexicon-icon-margin-left: map-get($map, lexicon-icon-margin-left);
	$lexicon-icon-margin-right: map-get($map, lexicon-icon-margin-right);
	$lexicon-icon-margin-top: map-get($map, lexicon-icon-margin-top);

	align-items: $align-items;
	background-color: $bg;
	border-color: $border-color;

	@include border-radius($border-radius);

	bottom: $bottom;
	color: $color;
	display: $display;
	font-family: $font-family;
	font-size: $font-size;
	font-weight: $font-weight;
	height: $height;
	justify-content: $justify-content;
	left: $left;
	line-height: $line-height;
	margin-bottom: $margin-bottom;
	margin-left: $margin-left;
	margin-right: $margin-right;
	margin-top: $margin-top;
	opacity: $opacity;
	padding-bottom: $padding-bottom;
	padding-left: $padding-left;
	padding-right: $padding-right;
	padding-top: $padding-top;
	position: $position;
	right: $right;
	text-align: $text-align;
	text-decoration: $text-decoration;
	text-transform: $text-transform;
	top: $top;
	transition: $transition;
	vertical-align: $vertical-align;
	width: $width;

	&:hover {
		background-color: $hover-bg;
		color: $hover-color;
		text-decoration: $hover-text-decoration;
	}

	@at-root {
		button#{&} {
			&:focus {
				box-shadow: $btn-focus-box-shadow;
				outline: $btn-focus-outline;
			}
		}
	}

	&:focus {
		background-color: $focus-bg;
		box-shadow: $focus-box-shadow;
		color: $focus-color;
		outline: $focus-outline;
		text-decoration: $focus-text-decoration;
	}

	// Bootstrap 4.1.2 Selector overwrite

	&:not(:disabled):not(.disabled) {
		&:hover {
			opacity: $hover-opacity;
		}

		&:focus {
			opacity: $focus-opacity;
		}
	}

	&:active,
	&.active {
		background-color: $active-bg;
		border-color: $active-border-color;
		color: $active-color;
	}

	&:disabled,
	&.disabled {
		background-color: $disabled-bg;
		border-color: $disabled-border-color;
		box-shadow: $disabled-box-shadow;
		color: $disabled-color;
		cursor: $disabled-cursor;
		opacity: $disabled-opacity;
		pointer-events: $disabled-pointer-events;
		text-decoration: $disabled-text-decoration;
	}

	.lexicon-icon {
		margin-bottom: $lexicon-icon-margin-bottom;
		margin-right: $lexicon-icon-margin-right;
		margin-left: $lexicon-icon-margin-left;
		margin-top: $lexicon-icon-margin-top;
	}
}