// #region Imports
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Appearanceable } from '../../../Behaviors/Appearanceable';
import { Disableable } from '../../../Behaviors/Disableable';
import { Orientable } from '../../../Behaviors/Orientable';
import { Slottable } from '../../../Behaviors/Slottable';
import { Themeable } from '../../../Behaviors/Themeable';
import { Variantable } from '../../../Behaviors/Variantable';
import { addInheritanceProviderController } from '../../../Controllers/InheritanceProviderController';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { ButtonBaseElement } from '../Abstracts/ButtonBaseElement';
import { buttonGroupElementTemplate } from './ButtonGroupElementTemplate';
import { BUTTON_GROUP_INHERITANCE_CONTEXT } from './ButtonGroupInheritanceContext';
import { buttonGroupElementCosmopolitanStyle } from './Themes/ButtonGroupElement.Cosmopolitan';
import { buttonGroupElementJoyStyle } from './Themes/ButtonGroupElement.Joy';
import { buttonGroupElementMemphisStyle } from './Themes/ButtonGroupElement.Memphis';
// #endregion
/**
 * Button Group - A user interface component for grouping multiple buttons together.
 *
 * @description
 * The Button Group component is designed to group multiple buttons together for a cohesive user interface.
 * It provides a way to organize related actions or options and visually group them as a single unit.
 * Button groups are commonly used in toolbars, navigation menus, and form layouts.
 *
 * @name Button Group
 * @element mosaik-button-group
 * @category Buttons
 *
 * @slot - The default slot.
 *
 * @cssprop {String} --button-group-font-family
 * @cssprop {String} --button-group-font-size
 * @cssprop {String} --button-group-font-line-height
 * @cssprop {String} --button-group-font-weight
 * @cssprop {String} --button-group-font-letter-spacing
 * @cssprop {String} --button-group-font-text-decoration
 * @cssprop {String} --button-group-font-text-transform
 * @cssprop {String} --button-group-padding-top
 * @cssprop {String} --button-group-padding-right
 * @cssprop {String} --button-group-padding-bottom
 * @cssprop {String} --button-group-padding-left
 * @cssprop {String} --button-group-gap
 * @cssprop {String} --button-group-transition-duration
 * @cssprop {String} --button-group-transition-mode
 * @cssprop {String} --button-group-transition-property
 * @cssprop {Color} --button-group-background-color
 * @cssprop {Color} --button-group-border-color
 * @cssprop {Color} --button-group-foreground-color
 * @cssprop {String} --button-group-border-width
 * @cssprop {String} --button-group-border-radius
 * @cssprop {String} --button-group-border-style
 * @cssprop {String} --button-group-shadow
 * @cssprop {String} --button-border-radius
 * @cssprop {String} --button-border-width
 *
 * @example
 * ```html
 * <mosaik-button-group>
 *   <mosaik-button label="Button 1"></mosaik-button>
 *   <mosaik-button label="Button 2"></mosaik-button>
 *   <mosaik-button label="Button 3"></mosaik-button>
 * </mosaik-button-group>
 * ```
 *
 * @public
 */
let ButtonGroupElement = class ButtonGroupElement extends Themeable(Orientable(Disableable(Appearanceable(Variantable(Slottable(CustomElement)))))) {
    // #region Fields
    _provider = addInheritanceProviderController(this, {
        context: BUTTON_GROUP_INHERITANCE_CONTEXT,
        values: () => ({
            disabled: this.disabled,
            appearance: this.appearance,
            variant: this.variant
        })
    });
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `{@link is}` property.
     * The `{@link is}` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-button-group';
    }
    // #endregion
    // #region Methods
    /**
     * @public
     */
    onSlotChanges() {
        const elements = this.getSlotAssignments('')
            .filter((x) => x instanceof ButtonBaseElement);
        for (const [i, e] of elements.entries()) {
            e.classList.add('button-group-button');
            e.classList.toggle('first', i === 0);
            e.classList.toggle('inner', i > 0 && i < elements.length - 1);
            e.classList.toggle('last', i === elements.length - 1);
        }
    }
};
ButtonGroupElement = __decorate([
    Component({
        selector: 'mosaik-button-group',
        template: buttonGroupElementTemplate,
        themes: {
            joy: buttonGroupElementJoyStyle,
            memphis: buttonGroupElementMemphisStyle,
            cosmopolitan: buttonGroupElementCosmopolitanStyle
        },
        host: {
            role: 'group'
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], ButtonGroupElement);
export { ButtonGroupElement };
//# sourceMappingURL=ButtonGroupElement.js.map