import { LitElement, html } from "lit"; import { customElement, property, state } from "lit/decorators.js"; import { v4 as uuidv4 } from "uuid"; import { translateText } from "../client/Utils"; import { MAX_USERNAME_LENGTH, validateUsername, } from "../core/validations/username"; const usernameKey: string = "username"; @customElement("username-input") export class UsernameInput extends LitElement { @state() private username: string = ""; @property({ type: String }) validationError: string = ""; private _isValid: boolean = true; // Remove static styles since we're using Tailwind createRenderRoot() { // Disable shadow DOM to allow Tailwind classes to work return this; } public getCurrentUsername(): string { return this.username; } connectedCallback() { super.connectedCallback(); this.username = this.getStoredUsername(); } render() { return html` ${this.validationError ? html`