import { LitElement } from 'lit'; import { customElement, property } from 'lit/decorators.js'; import { html } from 'lit/html.js'; import { spread } from './utils/LitHelper'; import { SpreadController } from './utils/SpreadController'; import { AnimationController } from './utils/AnimationController'; import { Tone } from './utils/CommonTypes'; import { TailwindStylesController } from './utils/TailwindStylesController'; export type SpinnerSize = 'base' | 'md' | 'lg' | 'xl' | '2xl'; @customElement('mono-spinner') export class MonoSpinnerComp extends LitElement { private __spreadController: SpreadController = new SpreadController(this); private __stylesController: TailwindStylesController = new TailwindStylesController( this, ); private __animationController: AnimationController = new AnimationController( this, ); @property({ type: String, reflect: true }) size: SpinnerSize = 'base'; @property({ type: String, reflect: true, }) tone?: Tone; private __computSize() { switch (this.size) { case 'md': return 'w-5 h-5'; case 'lg': return 'w-10 h-10'; case 'xl': return 'w-16 h-16'; case '2xl': return 'w-20 h-20'; default: return 'w-4 h-4'; } } render() { const attributesToSpread = this.__spreadController.buildSpreadAttributesIgnoring( [ 'as', 'style', 'class', 'slot', 'size', 'tone', 'aria-live', 'aria-busy', ], ); return html` `; } } declare global { interface HTMLElementTagNameMap { 'mono-spinner': MonoSpinnerComp; } }