@use '../abstracts/cds-vars' as vars;
@use '../abstracts/cds-mixins' as mixins;
@use '../abstracts/cds-config' as config;
@use '../abstracts/cds-icons' as icons;

//$_chip-border-radius: config.$config-global-border-radius !default;
$_cds-chip-border-radius: var(--cds-chip-br) !default;

.cds-chip {
    border-radius: $_cds-chip-border-radius;
    padding: 0;
    display: inline-flex;
    white-space: pre;
    flex-direction: row;
    align-items: center;
    gap: vars.$cds-spacing-25;
    height: min-content;

    /* DEFAULT */
    @include mixins.cds-feedback(information);

    &__text {
        @include mixins.cds-paragraph-m;
        padding-right: vars.$cds-spacing-100;
    }

    //&__icon {
    &::before {
        padding: 0;
        @include mixins.cds-icon-size(vars.$cds-icon-200);
    }

    &.is-loading {
        pointer-events: none !important;
        @include mixins.cds-icon(config.$default-icon-spinner);
        color: var(--cds-color-text-subtle);
        background-color: var(--cds-color-background-medium);

        &::before {
            color: var(--cds-color-text-muted);
            @include mixins.cds-icon-size(vars.$cds-icon-200);
        }
    }

    //SIZE MODIFIERS
    &--small {
        .cds-chip__text {
            @include mixins.cds-paragraph-s;
        }

        &::before {
            @include mixins.cds-icon-size(vars.$cds-icon-150);
        }
    }

    &--medium {
        .cds-chip__text {
            @include mixins.cds-paragraph-m;
        }

        &::before {
            @include mixins.cds-icon-size(vars.$cds-icon-200);
        }
    }

    //FEEDBACK MODIFIERS
    &--information {
        @include mixins.cds-feedback('information');
    }

    &--alert {
        @include mixins.cds-feedback('alert');
    }

    &--error {
        @include mixins.cds-feedback('error');
    }

    &--success {
        @include mixins.cds-feedback('success');
    }
}