import { ReactiveElement } from 'lit'; type Constructor> = { new (...args: any[]): T; prototype: T; }; export declare const ELEMENT_SIZES: readonly ["xxs", "xs", "s", "m", "l", "xl", "xxl"]; export type ElementSize = (typeof ELEMENT_SIZES)[number]; export declare const DEFAULT_ELEMENT_SIZES: readonly ["s", "m", "l", "xl"]; export type DefaultElementSize = (typeof DEFAULT_ELEMENT_SIZES)[number]; export interface SizedElementInterface { size: ElementSize; } export interface SizedElementConstructor { readonly VALID_SIZES: readonly ElementSize[]; readonly NO_DEFAULT_SIZE: boolean; } /** * Mixes size-awareness into a Lit `ReactiveElement` subclass. * * ## Why NO_DEFAULT_SIZE is a static rather than a closure variable * * The original implementation captured `noDefaultSize` in a closure at call * time. That works when a component applies SizedMixin directly to a plain * base (e.g. `SizedMixin(SpectrumElement, { noDefaultSize: true })`), but * breaks silently when a component extends a base that is already SizedMixin'd. * * Consider InfieldButton extending ButtonBase: * - ButtonBase = SizedMixin(SpectrumElement, {}) — closure captures noDefaultSize=false * - InfieldButtonBase extends ButtonBase * * Even if a second SizedMixin wrapper is applied with noDefaultSize=true, calling * super.update() reaches the inner ButtonBase SizedMixin, whose update() still * reads noDefaultSize=false from its closure and writes size="m" to the DOM. * Likewise, when a parent calls removeAttribute('size'), the inherited setter * reads the inner closure's fallbackSize='m' and immediately re-sets the attribute. * * Making NO_DEFAULT_SIZE a static property solves both problems: the setter and * update() read this.constructor.NO_DEFAULT_SIZE, which follows the prototype * chain to the leaf class. A subclass like InfieldButtonBase only needs to * declare `static override readonly NO_DEFAULT_SIZE = true` — no mixin * re-wrapping, no lifecycle interception, and the correct value is read by every * SizedMixin layer in the chain. */ export declare function SizedMixin>(constructor: T, { validSizes, noDefaultSize, defaultSize, }?: { validSizes?: readonly ElementSize[]; noDefaultSize?: boolean; defaultSize?: ElementSize; }): T & Constructor & SizedElementConstructor; export {};