// #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 { RendererServiceLocator } from '../../../../Dom/Renderer';
import { Busyable } from '../../../Behaviors/Busyable';
import { ContentAlignable } from '../../../Behaviors/ContentAlignable';
import { Fitable } from '../../../Behaviors/Fitable';
import { Iconable } from '../../../Behaviors/Iconable';
import { Labelable } from '../../../Behaviors/Labelable';
import { Orientable } from '../../../Behaviors/Orientable';
import { Reversible } from '../../../Behaviors/Reversible';
import { Component } from '../../../Decorators/ComponentDecorator';
import { Property } from '../../../Decorators/PropertyDecorator';
import { Watch } from '../../../Decorators/WatchDecorator';
import { RippleElement } from '../../Effects/Ripple/RippleElement';
import { StackElement } from '../../Layouts/Stack/StackElement';
import { IconElement } from '../../Media/Icon/IconElement';
import { FocusRingElement } from '../../Primitives/FocusRing/FocusRingElement';
import { TextElement } from '../../Primitives/Text/TextElement';
import { ProgressRingElement } from '../../Ranges/ProgressRing/ProgressRingElement';
import { ButtonBaseElement } from '../Abstracts/ButtonBaseElement';
import { buttonElementMemphisStyle } from './Themes/ButtonElement.Memphis';
import { buttonElementTemplate } from './ButtonElementTemplate';
import { buttonElementJoyStyle } from './Themes/ButtonElement.Joy';
import { Themeable } from '../../../../Controls/Behaviors/Themeable';
import { buttonElementCosmopolitanStyle } from './Themes/ButtonElement.Cosmopolitan';
// #endregion
/**
 * Button - A versatile interactive element for triggering actions and user interactions.
 *
 * @description
 * The Button component is a fundamental user interface element that provides interactive
 * functionality within applications. It supports various configurations including text labels,
 * icons, busy states, different orientations, and content alignment options. The button can
 * function as a traditional button, a link, or a download trigger, making it highly versatile
 * for different use cases. It includes advanced features like ripple effects, focus rings,
 * progress indicators, and comprehensive accessibility support.
 *
 * @name Button
 * @element mosaik-button
 * @category Buttons
 *
 * @slot label - The text content or label displayed on the button
 * @slot icon - The icon displayed alongside or instead of the label
 * @slot overlay - Additional overlay content such as badges or indicators
 *
 * @csspart button - The main button element container
 * @csspart link - The link element when href is provided
 * @csspart focusRing - The focus indicator ring for keyboard navigation
 * @csspart ripple - The touch feedback ripple effect container
 * @csspart icon - The icon display area within the button
 * @csspart label - The text label display area within the button
 * @csspart progressRing - The busy state progress indicator
 *
 * @cssprop {String} --button-font-family - The font family for button text
 * @cssprop {String} --button-font-size - The font size for button text
 * @cssprop {String} --button-font-line-height - The line height for button text
 * @cssprop {String} --button-font-weight - The font weight for button text
 * @cssprop {String} --button-font-letter-spacing - The letter spacing for button text
 * @cssprop {String} --button-font-text-decoration - The text decoration style
 * @cssprop {String} --button-font-text-transform - The text transformation style
 * @cssprop {String} --button-padding-top - The top padding inside the button
 * @cssprop {String} --button-padding-right - The right padding inside the button
 * @cssprop {String} --button-padding-bottom - The bottom padding inside the button
 * @cssprop {String} --button-padding-left - The left padding inside the button
 * @cssprop {String} --button-gap - The spacing between icon and label elements
 * @cssprop {String} --button-transition-duration - The duration of hover/focus transitions
 * @cssprop {String} --button-transition-mode - The timing function for transitions
 * @cssprop {String} --button-transition-property - The CSS properties to transition
 * @cssprop {String} --button-foreground-color - The text and icon color
 * @cssprop {String} --button-background-color - The background fill color
 * @cssprop {String} --button-border-color - The border outline color
 * @cssprop {String} --button-border-width - The border thickness
 * @cssprop {String} --button-border-radius - The corner rounding radius
 * @cssprop {String} --button-border-style - The border line style
 * @cssprop {String} --button-shadow - The drop shadow or elevation effect
 * @cssprop {String} --button-width - The button width (when not using fit behavior)
 * @cssprop {String} --button-height - The button height
 * @cssprop {String} --focus-ring-outward-offset - The focus ring distance from button edge
 * @cssprop {String} --button-focus-ring-color - The focus ring color
 * @cssprop {String} --button-progress-thickness - The busy state progress ring thickness
 *
 * @dependency {StackElement} - Layout container for organizing button content
 * @dependency {IconElement} - Icon display component for button graphics
 * @dependency {RippleElement} - Touch feedback effect component
 * @dependency {FocusRingElement} - Keyboard focus indicator component
 * @dependency {TextElement} - Text rendering component for button labels
 * @dependency {ProgressRingElement} - Progress indicator for busy states
 *
 * @example
 * Basic button with label:
 * ```html
 * <mosaik-button label="Click Me"></mosaik-button>
 * ```
 *
 * @example
 * Button with icon and label:
 * ```html
 * <mosaik-button label="Save" icon="save-icon-path" variant="primary"></mosaik-button>
 * ```
 *
 * @example
 * Icon-only button:
 * ```html
 * <mosaik-button icon="menu-icon-path" aria-label="Open menu"></mosaik-button>
 * ```
 *
 * @example
 * Button as a link:
 * ```html
 * <mosaik-button label="Visit Site" href="https://example.com" target="_blank"></mosaik-button>
 * ```
 *
 * @example
 * Busy/loading button:
 * ```html
 * <mosaik-button label="Processing..." busy disabled></mosaik-button>
 * ```
 *
 * @example
 * Download button:
 * ```html
 * <mosaik-button label="Download PDF" href="/document.pdf" download="document.pdf"></mosaik-button>
 * ```
 *
 * @example
 * Vertical button layout:
 * ```html
 * <mosaik-button label="Upload" icon="upload-icon-path" orientation="vertical"></mosaik-button>
 * ```
 *
 * @public
 */
let ButtonElement = class ButtonElement extends Themeable(Reversible(Orientable(ContentAlignable(Fitable(Busyable(Labelable(Iconable(ButtonBaseElement)))))))) {
    // #region Fields
    _href;
    _download;
    _rel;
    _target;
    // #endregion
    // #region Ctor
    /**
     * Constructs a new instance of the `ButtonElement` class.
     *
     * @public
     */
    constructor() {
        super();
        this._href = '';
        this._download = '';
        this._rel = '';
        this._target = '';
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     *
     * @public
     * @static
     * @readonly
    */
    static get is() {
        return 'mosaik-button';
    }
    /**
     * Gets or sets the `href` property.
     *
     * @public
     */
    get href() {
        return this._href;
    }
    set href(value) {
        if (this._href !== value) {
            this._href = value;
            this.requestUpdate('href');
        }
    }
    /**
     * Gets or sets the `download` property.
     *
     * @public
     */
    get download() {
        return this._download;
    }
    set download(value) {
        if (this._download !== value) {
            this._download = value;
            this.requestUpdate('download');
        }
    }
    /**
     * Gets or sets the `rel` property.
     *
     * @public
     */
    get rel() {
        return this._rel;
    }
    set rel(value) {
        if (this._rel !== value) {
            this._rel = value;
            this.requestUpdate('rel');
        }
    }
    /**
     * Gets or sets the `target` property.
     *
     * @public
     */
    get target() {
        return this._target;
    }
    set target(value) {
        if (this._target !== value) {
            this._target = value;
            this.requestUpdate('target');
        }
    }
    // #endregion
    // #region Methods
    /**
     * @protected
     */
    onHrefPropertyChanged(_prev, next) {
        if (next === '') {
            RendererServiceLocator.current.removeAttribute(this, 'has-link');
        }
        else {
            RendererServiceLocator.current.setAttribute(this, 'has-link');
        }
    }
};
__decorate([
    Property({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], ButtonElement.prototype, "href", null);
__decorate([
    Property({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], ButtonElement.prototype, "download", null);
__decorate([
    Property({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], ButtonElement.prototype, "rel", null);
__decorate([
    Property({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], ButtonElement.prototype, "target", null);
__decorate([
    Watch('href'),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, String]),
    __metadata("design:returntype", void 0)
], ButtonElement.prototype, "onHrefPropertyChanged", null);
ButtonElement = __decorate([
    Component({
        selector: 'mosaik-button',
        template: buttonElementTemplate,
        themes: {
            joy: buttonElementJoyStyle,
            memphis: buttonElementMemphisStyle,
            cosmopolitan: buttonElementCosmopolitanStyle
        },
        options: {
            mode: 'open',
            delegatesFocus: true
        },
        imports: [
            StackElement,
            IconElement,
            RippleElement,
            FocusRingElement,
            TextElement,
            ProgressRingElement
        ]
    }),
    __metadata("design:paramtypes", [])
], ButtonElement);
export { ButtonElement };
//# sourceMappingURL=ButtonElement.js.map