// #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 { Sizeable } from '../../../Behaviors/Sizeable';
import { Themeable } from '../../../Behaviors/Themeable';
import { Valueable } from '../../../Behaviors/Valueable';
import { addInheritanceConsumerController } from '../../../Controllers/InheritanceConsumerController';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { colorSwatchElementTemplate } from './ColorSwatchElementTemplate';
import { COLOR_SWATCH_GROUP_INHERITANCE_CONTEXT } from './ColorSwatchGroupInheritanceContext';
import { colorSwatchElementCosmopolitanStyle } from './Themes/ColorSwatchElement.Cosmopolitan';
import { colorSwatchElementJoyStyle } from './Themes/ColorSwatchElement.Joy';
import { colorSwatchElementMemphisStyle } from './Themes/ColorSwatchElement.Memphis';
// #endregion
/**
 * Color Swatch - A user interface component for displaying colors.
 *
 * @description
 * The Color Swatch component is designed to showcase a collection of colors, typically in a grid or list format.
 * Users can interact with the swatch to view different color options and select a color for various purposes,
 * such as choosing a text color, background color, or customizing the look and feel of elements.
 * Color Swatches are commonly used in design applications, theming interfaces, or color selection tools.
 *
 * @element mosaik-color-swatch
 * @category Media
 *
 * @csspart back - The back part.
 * @csspart front - The front part.
 * @csspart root - The root part.
 *
 * @cssprop {String} --color-swatch-background-color - The swatch background color CSS custom property.
 * @cssprop {String} --color-swatch-border-color - The swatch border color CSS custom property.
 * @cssprop {String} --color-swatch-border-radius - The swatch border radius CSS custom property.
 * @cssprop {String} --color-swatch-border-style - The swatch border style CSS custom property.
 * @cssprop {String} --color-swatch-border-width - The swatch border width CSS custom property.
 * @cssprop {String} --color-swatch-font-family - The swatch font family CSS custom property.
 * @cssprop {String} --color-swatch-font-letter-spacing - The swatch font letter spacing CSS custom property.
 * @cssprop {String} --color-swatch-font-line-height - The swatch font line height CSS custom property.
 * @cssprop {String} --color-swatch-font-size - The swatch font size CSS custom property.
 * @cssprop {String} --color-swatch-font-text-decoration - The swatch font text decoration CSS custom property.
 * @cssprop {String} --color-swatch-font-text-transform - The swatch font text transform CSS custom property.
 * @cssprop {String} --color-swatch-font-weight - The swatch font weight CSS custom property.
 * @cssprop {String} --color-swatch-foreground-color - The swatch foreground color CSS custom property.
 * @cssprop {String} --color-swatch-gap - The swatch gap CSS custom property.
 * @cssprop {String} --color-swatch-padding-bottom - The swatch padding bottom CSS custom property.
 * @cssprop {String} --color-swatch-padding-left - The swatch padding left CSS custom property.
 * @cssprop {String} --color-swatch-padding-right - The swatch padding right CSS custom property.
 * @cssprop {String} --color-swatch-padding-top - The swatch padding top CSS custom property.
 * @cssprop {String} --color-swatch-shadow - The swatch shadow CSS custom property.
 * @cssprop {String} --color-swatch-shadow-blur - The swatch shadow blur CSS custom property.
 * @cssprop {String} --color-swatch-shadow-color - The swatch shadow color CSS custom property.
 * @cssprop {String} --color-swatch-shadow-offset-x - The swatch shadow offset x CSS custom property.
 * @cssprop {String} --color-swatch-shadow-offset-y - The swatch shadow offset y CSS custom property.
 * @cssprop {String} --color-swatch-shadow-spread - The swatch shadow spread CSS custom property.
 * @cssprop {String} --color-swatch-size - The swatch size CSS custom property.
 * @cssprop {String} --color-swatch-transition-duration - The swatch transition duration CSS custom property.
 * @cssprop {String} --color-swatch-transition-mode - The swatch transition mode CSS custom property.
 * @cssprop {String} --color-swatch-transition-property - The swatch transition property CSS custom property.
 * @cssprop {String} --color-swatch-translate - The swatch translate CSS custom property.
 *
 * @example
 * Basic usage displaying a color:
 * ```html
 * <mosaik-color-swatch value="#e91e63"></mosaik-color-swatch>
 * ```
 *
 * @example
 * With a name and large size:
 * ```html
 * <mosaik-color-swatch value="#1976d2" name="Primary Blue" size="large"></mosaik-color-swatch>
 * ```
 *
 * @example
 * With a checkerboard background for semi-transparent colors:
 * ```html
 * <mosaik-color-swatch value="rgba(233, 30, 99, 0.5)" has-background></mosaik-color-swatch>
 * ```
 *
 * @public
 */
let ColorSwatchElement = class ColorSwatchElement extends Themeable(Valueable(Sizeable(CustomElement))) {
    // #region Fields
    _inheritance = addInheritanceConsumerController(this, {
        context: COLOR_SWATCH_GROUP_INHERITANCE_CONTEXT
    });
    _name;
    _value;
    _hasBackground;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._name = null;
        this._value = null;
        this._hasBackground = false;
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     * The `is` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-color-swatch';
    }
    /**
     * Gets or sets the `size` property.
     * When used inside a ColorSwatchGroup, inherits the group's size unless explicitly set.
     *
     * @public
     * @override
     */
    get size() {
        return this._inheritance.get('size', super.size);
    }
    set size(value) {
        this._inheritance.markExplicit('size');
        super.size = value;
    }
    /**
     * Gets or sets the `name` property.
     *
     * @public
     * @attr
     */
    get name() {
        return this._name;
    }
    set name(value) {
        if (this._name !== value) {
            this._name = value;
            this.requestUpdate('name');
        }
    }
    /**
     * Gets or sets the `value` property.
     *
     * @public
     * @override
     */
    get value() {
        return this._value;
    }
    set value(value) {
        if (this._value !== value) {
            this._value = value;
            this.requestUpdate('value');
        }
    }
    /**
     * Gets or sets the `hasBackground` property.
     *
     * @public
     * @attr
     */
    get hasBackground() {
        return this._hasBackground;
    }
    set hasBackground(value) {
        if (this._hasBackground !== value) {
            this._hasBackground = value;
            this.requestUpdate('hasBackground');
        }
    }
};
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], ColorSwatchElement.prototype, "name", null);
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], ColorSwatchElement.prototype, "value", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], ColorSwatchElement.prototype, "hasBackground", null);
ColorSwatchElement = __decorate([
    Component({
        selector: 'mosaik-color-swatch',
        template: colorSwatchElementTemplate,
        themes: {
            joy: colorSwatchElementJoyStyle,
            memphis: colorSwatchElementMemphisStyle,
            cosmopolitan: colorSwatchElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], ColorSwatchElement);
export { ColorSwatchElement };
//# sourceMappingURL=ColorSwatchElement.js.map