@use 'breakpoint-increment' as *;
@use 'breakpoint-pseudo' as *;
@use 'breakpoint-dive' as *;

@use '../../helpers/strings' as *;

@mixin breakpoint-directionify(
    $label,
    $property,
    $value,
    $negatives,
    $increments,
    $pseudos,
    $dives,
    $bpLabel,
    $bpValue,
    $paradigm
) {
    $directions: top, right, bottom, left;
    $newLabel: '';
    $newProp: '';

    @each $direction in $directions {
        $newLabel: #{$label + first-char($direction)};
        $newProp: #{$property}-#{$direction};

        .#{$bpLabel}\:#{$newLabel}-0 {
            @media (#{$paradigm}: $bpValue) {
                #{$newProp}: 0 !important;
            }
        }
        
        .#{$bpLabel}\:#{$newLabel} {
            @media (#{$paradigm}: $bpValue) {
                #{$newProp}: $value !important;
            }
        }
        
        @if $negatives {
            .#{$bpLabel}\:-#{$newLabel} {
                @media (#{$paradigm}: $bpValue) {
                    #{$newProp}: -$value !important;
                }
            }
        }

        @if $increments {
            @include breakpoint-incrementify($newLabel, $newProp, $value, $negatives, $increments, $pseudos, $dives, $bpLabel, $bpValue, $paradigm);
        }

        @if $pseudos {
            @include breakpoint-pseudify($newLabel, $newProp, $value, $pseudos, $bpLabel, $bpValue, $paradigm);
        }

        @if $dives {
            @include breakpoint-diver($newLabel, $newProp, $value, $bpLabel, $bpValue, $paradigm);
        }
    }
}
