import { __decorate } from "tslib";
import { attr, nullableNumberConverter } from '@ni/fast-element';
import { DesignSystem, Checkbox as FoundationCheckbox } from '@ni/fast-foundation';
import { check16X16, minus16X16 } from '@ni/nimble-tokens/dist/icons/js';
import { styles } from './styles';
import { template } from './template';
import { mixinErrorPattern } from '../patterns/error/types';
/**
 * A nimble-styled checkbox control.
 */
export class Checkbox extends mixinErrorPattern(FoundationCheckbox) {
    constructor() {
        super(...arguments);
        /**
         * @public
         * @remarks
         * HTML Attribute: appearance-indeterminate
         */
        this.appearanceIndeterminate = false;
    }
    /**
     * @internal
     */
    get resolvedTabindex() {
        const tabIndex = this.tabIndex ?? 0;
        return this.disabled ? undefined : `${tabIndex}`;
    }
}
__decorate([
    attr({ attribute: 'tabindex', converter: nullableNumberConverter })
], Checkbox.prototype, "tabIndex", void 0);
__decorate([
    attr({ attribute: 'appearance-indeterminate', mode: 'boolean' })
], Checkbox.prototype, "appearanceIndeterminate", void 0);
const nimbleCheckbox = Checkbox.compose({
    baseName: 'checkbox',
    baseClass: FoundationCheckbox,
    template,
    styles,
    checkedIndicator: check16X16.data,
    indeterminateIndicator: minus16X16.data
});
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCheckbox());
export const checkboxTag = 'nimble-checkbox';
//# sourceMappingURL=index.js.map