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

/// @access private
/// @author <a href="https://github.com/simeonoff" target="_blank">Simeon Simeonoff</a>
@mixin component {
    @include b(igx-list) {
        $this: bem--selector-to-string(&);
        @include register-component(
            $name: string.slice($this, 2, -1),
            $deps: ()
        );

        @extend %igx-list !optional;

        // css class 'igx-list__header'
        @include e(header) {
            @extend %igx-list-header !optional;
        }

        // css class 'igx-list__item-base'
        @include e(item-base) {
            @extend %igx-list-item-base !optional;
        }

        // css class `igx-list__item-base--active
        @include e(item-base, $m: active) {
            @extend %igx-list-item-base--active !optional;
        }

        // css class `igx-list__item-base--selected
        @include e(item-base, $m: selected) {
            @extend %igx-list-item-base--selected !optional;
        }

        // css class 'igx-list__item-right' applied to the panning container shown when the list item is panned left
        @include e(item-right) {
            @extend %igx-list-item-pan !optional;
        }

        // css class 'igx-list__item-left' applied to the panning container shown when the list item in panned right
        @include e(item-left) {
            @extend %igx-list-item-pan !optional;
        }

        // css class 'igx-list__item-content'
        @include e(item-content) {
            @extend %igx-list-item-content !optional;

            &:active {
                @extend %igx-list-item-content !optional;
                @extend %igx-list-item-content--active !optional;
            }

            &:not(:active) {
                @extend %igx-list-item-content--inactive !optional;
            }
        }

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

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

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

        @include e(item-line-title) {
            @extend %igx-list__item-line-title !optional;
        }

        @include e(item-line-subtitle) {
            @extend %igx-list__item-line-subtitle !optional;
        }

        @include m(empty) {
            @extend %igx-list !optional;
            @extend %igx-list--empty !optional;

            @include e(message) {
                @extend %igx-list__message--empty !optional;
            }
        }
    }
}
