@use '../../base' as *;
@use 'sass:string';

/// @access private
/// @author <a href="https://github.com/desig9stein" target="_blank">Marin Popov</a>
@mixin component {
    @include b(igx-chip-area) {
        @extend %igx-chip-area !optional;
    }

    @include b(igx-chip) {
        $this: bem--selector-to-string(&);
        @include register-component(
            $name: string.slice($this, 2, -1),
            $deps: (
                igx-icon,
            )
        );

        @extend %igx-chip !optional;

        @include e(item) {
            @extend %igx-chip__item !optional;
        }

        @include e(start) {
            @extend %igx-chip__start !optional;
        }

        @include e(end) {
            @extend %igx-chip__end !optional;
        }

        @include e(item, $m: 'selected') {
            @extend %igx-chip__item--selected !optional;
        }

        @include m(primary) {
            @extend %igx-chip--primary !optional;

            @include e(item) {
                @extend %igx-chip__item--primary !optional;
            }
        }

        @include m(info) {
            @extend %igx-chip--info !optional;

            @include e(item) {
                @extend %igx-chip__item--info !optional;
            }
        }

        @include m(success) {
            @extend %igx-chip--success !optional;

            @include e(item) {
                @extend %igx-chip__item--success !optional;
            }
        }

        @include m(warning) {
            @extend %igx-chip--warning !optional;

            @include e(item) {
                @extend %igx-chip__item--warning !optional;
            }
        }

        @include m(danger) {
            @extend %igx-chip--danger !optional;

            @include e(item) {
                @extend %igx-chip__item--danger !optional;
            }
        }

        @include e(content) {
            @extend %igx-chip__content !optional;
        }

        @include e(select) {
            @extend %igx-chip__select !optional;
        }

        @include e(remove) {
            @extend %igx-chip__remove !optional;
        }

        @include e(ghost) {
            @extend %igx-chip__ghost !optional;
        }

        @include m(disabled) {
            @extend %igx-chip--disabled !optional;

            @include e(item) {
                @extend %igx-chip__item--disabled !optional;
            }
        }
    }
}
