@duskmoon-dev/el-input 1.10.2 → 1.10.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -235,6 +235,7 @@ class ElDmInput extends import_el_base.BaseElement {
235
235
  helperText: { type: String, reflect: true, attribute: "helper-text" }
236
236
  };
237
237
  _focused = false;
238
+ _inputId = `input-${Math.random().toString(36).slice(2, 9)}`;
238
239
  _validators = [];
239
240
  setValidators(rules) {
240
241
  this._validators = rules;
@@ -248,11 +249,12 @@ class ElDmInput extends import_el_base.BaseElement {
248
249
  constructor() {
249
250
  super();
250
251
  this.attachStyles(styles);
251
- }
252
- connectedCallback() {
253
- super.connectedCallback();
254
252
  this.shadowRoot.addEventListener("slotchange", this._handleSlotChange.bind(this));
255
253
  }
254
+ disconnectedCallback() {
255
+ super.disconnectedCallback();
256
+ this._focused = false;
257
+ }
256
258
  _handleSlotChange(event) {
257
259
  const slot = event.target;
258
260
  const wrapper = slot.parentElement;
@@ -307,71 +309,92 @@ class ElDmInput extends import_el_base.BaseElement {
307
309
  return classes.filter(Boolean).join(" ");
308
310
  }
309
311
  update() {
310
- super.update();
311
- const input = this.shadowRoot.querySelector("input");
312
- if (input) {
312
+ let input = this.shadowRoot.querySelector("input");
313
+ if (!input) {
314
+ super.update();
315
+ input = this.shadowRoot.querySelector("input");
316
+ input.id = this._inputId;
313
317
  input.addEventListener("input", this._handleInput.bind(this));
314
318
  input.addEventListener("change", this._handleChange.bind(this));
315
319
  input.addEventListener("focus", this._handleFocus.bind(this));
316
320
  input.addEventListener("blur", this._handleBlur.bind(this));
317
321
  }
318
- }
319
- render() {
320
- const wrapperClasses = [
322
+ input.type = this.type || "text";
323
+ input.name = this.name || "";
324
+ input.placeholder = this.placeholder || "";
325
+ input.disabled = this.disabled;
326
+ input.readOnly = this.readonly;
327
+ input.required = this.required;
328
+ input.className = this._getInputClasses();
329
+ const value = this.value || "";
330
+ if (input.value !== value) {
331
+ const { selectionStart, selectionEnd, selectionDirection } = input;
332
+ input.value = value;
333
+ if (selectionStart !== null && selectionEnd !== null) {
334
+ input.setSelectionRange(selectionStart, selectionEnd, selectionDirection || undefined);
335
+ }
336
+ }
337
+ input.setAttribute("value", value);
338
+ input.setAttribute("aria-invalid", String(this.validationState === "invalid"));
339
+ const showError = this.validationState === "invalid" && !!this.errorMessage;
340
+ const showHelper = !!this.helperText && this.validationState !== "invalid";
341
+ input.setAttribute("aria-describedby", showError ? "error" : showHelper ? "helper" : "");
342
+ const wrapper = this.shadowRoot.querySelector(".input-wrapper");
343
+ wrapper.className = [
321
344
  "input-wrapper",
322
345
  this._focused ? "focused" : "",
323
346
  this.disabled ? "disabled" : "",
324
347
  this.validationState || ""
325
348
  ].filter(Boolean).join(" ");
326
- const labelClasses = ["label", this.required ? "required" : ""].filter(Boolean).join(" ");
327
- const inputClasses = this._getInputClasses();
328
- const inputId = `input-${Math.random().toString(36).slice(2, 9)}`;
349
+ const container = this.shadowRoot.querySelector(".container");
350
+ let label = container.querySelector("label");
351
+ if (this.label) {
352
+ if (!label) {
353
+ label = document.createElement("label");
354
+ label.setAttribute("part", "label");
355
+ label.htmlFor = this._inputId;
356
+ container.prepend(label);
357
+ }
358
+ label.className = this.required ? "label required" : "label";
359
+ label.textContent = this.label;
360
+ } else {
361
+ label?.remove();
362
+ }
363
+ for (const [id, text] of [
364
+ ["error", showError ? this.errorMessage : ""],
365
+ ["helper", showHelper ? this.helperText : ""]
366
+ ]) {
367
+ let message = container.querySelector(`#${id}`);
368
+ if (text) {
369
+ if (!message) {
370
+ message = document.createElement("span");
371
+ message.id = id;
372
+ message.className = id;
373
+ message.setAttribute("part", id);
374
+ if (id === "error")
375
+ message.setAttribute("role", "alert");
376
+ container.append(message);
377
+ }
378
+ if (message.textContent !== text)
379
+ message.textContent = text;
380
+ } else {
381
+ message?.remove();
382
+ }
383
+ }
384
+ }
385
+ render() {
329
386
  return `
330
387
  <div class="container" part="container">
331
- ${this.label ? `
332
- <label class="${labelClasses}" for="${inputId}" part="label">
333
- ${this.label}
334
- </label>
335
- ` : ""}
336
-
337
- <div class="${wrapperClasses}" part="input-wrapper">
388
+ <div class="input-wrapper" part="input-wrapper">
338
389
  <span class="prefix" part="prefix">
339
390
  <slot name="prefix"></slot>
340
391
  </span>
341
-
342
- <input
343
- class="${inputClasses}"
344
- id="${inputId}"
345
- type="${this.type || "text"}"
346
- name="${this.name || ""}"
347
- value="${this.value || ""}"
348
- placeholder="${this.placeholder || ""}"
349
- ${this.disabled ? "disabled" : ""}
350
- ${this.readonly ? "readonly" : ""}
351
- ${this.required ? "required" : ""}
352
- aria-invalid="${this.validationState === "invalid" ? "true" : "false"}"
353
- aria-describedby="${this.errorMessage ? "error" : this.helperText ? "helper" : ""}"
354
- part="input"
355
- />
356
-
392
+ <input part="input" />
357
393
  <span class="pending-indicator"></span>
358
-
359
394
  <span class="suffix" part="suffix">
360
395
  <slot name="suffix"></slot>
361
396
  </span>
362
397
  </div>
363
-
364
- ${this.validationState === "invalid" && this.errorMessage ? `
365
- <span id="error" class="error" part="error" role="alert">
366
- ${this.errorMessage}
367
- </span>
368
- ` : ""}
369
-
370
- ${this.helperText && this.validationState !== "invalid" ? `
371
- <span id="helper" class="helper" part="helper">
372
- ${this.helperText}
373
- </span>
374
- ` : ""}
375
398
  </div>
376
399
  `;
377
400
  }
@@ -384,5 +407,5 @@ function register() {
384
407
  }
385
408
  }
386
409
 
387
- //# debugId=427A6775CED2D09B64756E2164756E21
410
+ //# debugId=53587B4DC145DBEF64756E2164756E21
388
411
  //# sourceMappingURL=index.js.map
@@ -2,10 +2,10 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/el-dm-input.ts", "../../src/index.ts"],
4
4
  "sourcesContent": [
5
- "/**\n * DuskMoon Input Element\n *\n * A text input component with label and validation states.\n * Uses styles from @duskmoon-dev/core for consistent theming.\n *\n * @element el-dm-input\n *\n * @attr {string} type - Input type: text, password, email, number, tel, url, search\n * @attr {string} value - Current input value\n * @attr {string} name - Form field name\n * @attr {string} label - Label text\n * @attr {string} placeholder - Placeholder text\n * @attr {boolean} disabled - Whether the input is disabled\n * @attr {boolean} readonly - Whether the input is readonly\n * @attr {boolean} required - Whether the input is required\n * @attr {string} size - Input size: sm, md, lg\n * @attr {string} validation-state - Validation state: valid, invalid, pending\n * @attr {string} error-message - Error message to display\n * @attr {string} helper-text - Helper text to display\n *\n * @slot prefix - Content before the input\n * @slot suffix - Content after the input\n *\n * @csspart container - The outer container\n * @csspart label - The label element\n * @csspart input-wrapper - The wrapper around the input\n * @csspart input - The native input element\n * @csspart prefix - The prefix slot wrapper\n * @csspart suffix - The suffix slot wrapper\n * @csspart helper - The helper text element\n * @csspart error - The error message element\n *\n * @fires dm-input - Fired when value changes during input\n * @fires dm-change - Fired when value changes and input loses focus\n * @fires dm-focus - Fired when input gains focus\n * @fires dm-blur - Fired when input loses focus\n */\n\nimport { BaseElement, css, validate } from '@duskmoon-dev/el-base';\nimport { css as inputCSS } from '@duskmoon-dev/core/components/input';\nimport type { Size, ValidationState, Validator, ValidationResult } from '@duskmoon-dev/el-base';\n\n/**\n * Supported input types\n */\nexport type InputType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search';\n\n// Map of size attribute values to CSS classes\nconst SIZE_CLASSES: Record<string, string> = {\n sm: 'input-sm',\n md: '',\n lg: 'input-lg',\n};\n\n// Map of validation state to CSS classes\nconst VALIDATION_CLASSES: Record<string, string> = {\n valid: 'input-success',\n invalid: 'input-error',\n pending: '',\n};\n\n// Strip @layer wrapper for Shadow DOM compatibility\nconst coreStyles = inputCSS.replace(/@layer\\s+components\\s*\\{/, '').replace(/\\}\\s*$/, '');\n\nconst styles = css`\n :host {\n display: block;\n }\n\n :host([hidden]) {\n display: none !important;\n }\n\n /* Import core input styles */\n ${coreStyles}\n\n /* Form field container */\n .container {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n\n /* Label */\n .label {\n display: block;\n font-size: 0.875rem;\n font-weight: 500;\n color: var(--color-on-surface);\n }\n\n .label.required::after {\n content: ' *';\n color: var(--color-error);\n }\n\n /* Input wrapper for prefix/suffix */\n .input-wrapper {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n border: 1px solid var(--color-outline);\n border-radius: 0.5rem;\n background-color: var(--color-surface);\n transition:\n border-color 150ms ease-in-out,\n box-shadow 150ms ease-in-out;\n }\n\n .input-wrapper:hover:not(.disabled) {\n border-color: var(--color-outline-variant);\n }\n\n .input-wrapper.focused {\n border-color: var(--color-primary);\n box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-primary) 10%, transparent);\n }\n\n .input-wrapper.disabled {\n background-color: var(--color-surface-container);\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n /* Validation states for wrapper */\n .input-wrapper.valid {\n border-color: var(--color-success);\n }\n\n .input-wrapper.valid.focused {\n box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-success) 10%, transparent);\n }\n\n .input-wrapper.invalid {\n border-color: var(--color-error);\n }\n\n .input-wrapper.invalid.focused {\n box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-error) 10%, transparent);\n }\n\n /* Size variants for wrapper */\n :host(:not([size])) .input-wrapper,\n :host([size='md']) .input-wrapper {\n min-height: 2.5rem;\n padding: 0 0.75rem;\n }\n\n :host([size='sm']) .input-wrapper {\n min-height: 2rem;\n padding: 0 0.5rem;\n }\n\n :host([size='lg']) .input-wrapper {\n min-height: 3rem;\n padding: 0 1rem;\n }\n\n /* Native input - use base .input class but remove redundant styles */\n .input-wrapper .input {\n flex: 1;\n min-width: 0;\n border: none;\n background: transparent;\n padding: 0;\n height: auto;\n }\n\n .input-wrapper .input:focus,\n .input-wrapper .input:focus-visible {\n box-shadow: none;\n border-color: transparent;\n }\n\n /* Prefix and suffix */\n .prefix,\n .suffix {\n display: none;\n flex-shrink: 0;\n color: var(--color-on-surface-variant);\n }\n\n .prefix.has-content,\n .suffix.has-content {\n display: flex;\n align-items: center;\n }\n\n /* Helper and error text */\n .helper,\n .error {\n font-size: 0.875rem;\n margin-top: 0.25rem;\n }\n\n .helper {\n color: var(--color-on-surface-variant);\n }\n\n .error {\n color: var(--color-error);\n }\n\n /* Pending state spinner */\n .pending-indicator {\n display: none;\n width: 1em;\n height: 1em;\n border: 2px solid var(--color-outline);\n border-top-color: var(--color-primary);\n border-radius: 50%;\n animation: spin 0.6s linear infinite;\n }\n\n :host([validation-state='pending']) .pending-indicator {\n display: block;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n`;\n\nexport class ElDmInput extends BaseElement {\n static properties = {\n type: { type: String, reflect: true, default: 'text' },\n value: { type: String, reflect: true, default: '' },\n name: { type: String, reflect: true },\n label: { type: String, reflect: true },\n placeholder: { type: String, reflect: true },\n disabled: { type: Boolean, reflect: true },\n readonly: { type: Boolean, reflect: true },\n required: { type: Boolean, reflect: true },\n size: { type: String, reflect: true },\n validationState: { type: String, reflect: true, attribute: 'validation-state' },\n errorMessage: { type: String, reflect: true, attribute: 'error-message' },\n helperText: { type: String, reflect: true, attribute: 'helper-text' },\n };\n\n /** Input type */\n declare type: InputType;\n\n /** Current value */\n declare value: string;\n\n /** Form field name */\n declare name: string;\n\n /** Label text */\n declare label: string;\n\n /** Placeholder text */\n declare placeholder: string;\n\n /** Whether the input is disabled */\n declare disabled: boolean;\n\n /** Whether the input is readonly */\n declare readonly: boolean;\n\n /** Whether the input is required */\n declare required: boolean;\n\n /** Input size */\n declare size: Size;\n\n /** Validation state */\n declare validationState: ValidationState;\n\n /** Error message */\n declare errorMessage: string;\n\n /** Helper text */\n declare helperText: string;\n\n /** Whether the input is focused */\n private _focused = false;\n\n /** Registered validators */\n private _validators: Validator[] = [];\n\n /**\n * Set the list of validators for this input.\n * Validators are run in order; the first failure wins.\n *\n * @example\n * ```ts\n * import { validators } from '@duskmoon-dev/el-base';\n * input.setValidators([\n * validators.required('Email is required'),\n * validators.email('Must be a valid email'),\n * ]);\n * ```\n */\n setValidators(rules: Validator[]): void {\n this._validators = rules;\n }\n\n /**\n * Run all registered validators against the current value.\n * Updates `validationState` and `errorMessage` automatically.\n *\n * @returns The validation result\n */\n validate(): ValidationResult {\n const result = validate(this.value ?? '', this._validators);\n this.validationState = result.state as ValidationState;\n this.errorMessage = result.message ?? '';\n return result;\n }\n\n constructor() {\n super();\n this.attachStyles(styles);\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.shadowRoot.addEventListener('slotchange', this._handleSlotChange.bind(this));\n }\n\n /**\n * Handle slot content changes\n */\n private _handleSlotChange(event: Event): void {\n const slot = event.target as HTMLSlotElement;\n const wrapper = slot.parentElement;\n if (wrapper) {\n const hasContent = slot.assignedNodes().length > 0;\n wrapper.classList.toggle('has-content', hasContent);\n }\n }\n\n /**\n * Handle input events\n */\n private _handleInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n\n this.emit('dm-input', { value: this.value });\n }\n\n /**\n * Handle change events\n */\n private _handleChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n\n this.emit('dm-change', { value: this.value });\n }\n\n /**\n * Handle focus events\n */\n private _handleFocus(): void {\n this._focused = true;\n this.update();\n this.emit('dm-focus');\n }\n\n /**\n * Handle blur events\n */\n private _handleBlur(): void {\n this._focused = false;\n if (this._validators.length > 0) {\n this.validate();\n }\n this.update();\n this.emit('dm-blur');\n }\n\n /**\n * Focus the input element\n */\n focus(): void {\n const input = this.shadowRoot.querySelector('input');\n input?.focus();\n }\n\n /**\n * Blur the input element\n */\n blur(): void {\n const input = this.shadowRoot.querySelector('input');\n input?.blur();\n }\n\n /**\n * Select all text in the input\n */\n select(): void {\n const input = this.shadowRoot.querySelector('input');\n input?.select();\n }\n\n /**\n * Build CSS class string for the input\n */\n private _getInputClasses(): string {\n const classes = ['input', 'input-bordered'];\n\n // Add size class\n if (this.size && SIZE_CLASSES[this.size]) {\n classes.push(SIZE_CLASSES[this.size]);\n }\n\n // Add validation class\n if (this.validationState && VALIDATION_CLASSES[this.validationState]) {\n classes.push(VALIDATION_CLASSES[this.validationState]);\n }\n\n return classes.filter(Boolean).join(' ');\n }\n\n protected update(): void {\n super.update();\n\n // Re-attach event listeners after render\n const input = this.shadowRoot.querySelector('input');\n if (input) {\n input.addEventListener('input', this._handleInput.bind(this));\n input.addEventListener('change', this._handleChange.bind(this));\n input.addEventListener('focus', this._handleFocus.bind(this));\n input.addEventListener('blur', this._handleBlur.bind(this));\n }\n }\n\n render(): string {\n const wrapperClasses = [\n 'input-wrapper',\n this._focused ? 'focused' : '',\n this.disabled ? 'disabled' : '',\n this.validationState || '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const labelClasses = ['label', this.required ? 'required' : ''].filter(Boolean).join(' ');\n const inputClasses = this._getInputClasses();\n const inputId = `input-${Math.random().toString(36).slice(2, 9)}`;\n\n return `\n <div class=\"container\" part=\"container\">\n ${\n this.label\n ? `\n <label class=\"${labelClasses}\" for=\"${inputId}\" part=\"label\">\n ${this.label}\n </label>\n `\n : ''\n }\n\n <div class=\"${wrapperClasses}\" part=\"input-wrapper\">\n <span class=\"prefix\" part=\"prefix\">\n <slot name=\"prefix\"></slot>\n </span>\n\n <input\n class=\"${inputClasses}\"\n id=\"${inputId}\"\n type=\"${this.type || 'text'}\"\n name=\"${this.name || ''}\"\n value=\"${this.value || ''}\"\n placeholder=\"${this.placeholder || ''}\"\n ${this.disabled ? 'disabled' : ''}\n ${this.readonly ? 'readonly' : ''}\n ${this.required ? 'required' : ''}\n aria-invalid=\"${this.validationState === 'invalid' ? 'true' : 'false'}\"\n aria-describedby=\"${this.errorMessage ? 'error' : this.helperText ? 'helper' : ''}\"\n part=\"input\"\n />\n\n <span class=\"pending-indicator\"></span>\n\n <span class=\"suffix\" part=\"suffix\">\n <slot name=\"suffix\"></slot>\n </span>\n </div>\n\n ${\n this.validationState === 'invalid' && this.errorMessage\n ? `\n <span id=\"error\" class=\"error\" part=\"error\" role=\"alert\">\n ${this.errorMessage}\n </span>\n `\n : ''\n }\n\n ${\n this.helperText && this.validationState !== 'invalid'\n ? `\n <span id=\"helper\" class=\"helper\" part=\"helper\">\n ${this.helperText}\n </span>\n `\n : ''\n }\n </div>\n `;\n }\n}\n",
5
+ "/**\n * DuskMoon Input Element\n *\n * A text input component with label and validation states.\n * Uses styles from @duskmoon-dev/core for consistent theming.\n *\n * @element el-dm-input\n *\n * @attr {string} type - Input type: text, password, email, number, tel, url, search\n * @attr {string} value - Current input value\n * @attr {string} name - Form field name\n * @attr {string} label - Label text\n * @attr {string} placeholder - Placeholder text\n * @attr {boolean} disabled - Whether the input is disabled\n * @attr {boolean} readonly - Whether the input is readonly\n * @attr {boolean} required - Whether the input is required\n * @attr {string} size - Input size: sm, md, lg\n * @attr {string} validation-state - Validation state: valid, invalid, pending\n * @attr {string} error-message - Error message to display\n * @attr {string} helper-text - Helper text to display\n *\n * @slot prefix - Content before the input\n * @slot suffix - Content after the input\n *\n * @csspart container - The outer container\n * @csspart label - The label element\n * @csspart input-wrapper - The wrapper around the input\n * @csspart input - The native input element\n * @csspart prefix - The prefix slot wrapper\n * @csspart suffix - The suffix slot wrapper\n * @csspart helper - The helper text element\n * @csspart error - The error message element\n *\n * @fires dm-input - Fired when value changes during input\n * @fires dm-change - Fired when value changes and input loses focus\n * @fires dm-focus - Fired when input gains focus\n * @fires dm-blur - Fired when input loses focus\n */\n\nimport { BaseElement, css, validate } from '@duskmoon-dev/el-base';\nimport { css as inputCSS } from '@duskmoon-dev/core/components/input';\nimport type { Size, ValidationState, Validator, ValidationResult } from '@duskmoon-dev/el-base';\n\n/**\n * Supported input types\n */\nexport type InputType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search';\n\n// Map of size attribute values to CSS classes\nconst SIZE_CLASSES: Record<string, string> = {\n sm: 'input-sm',\n md: '',\n lg: 'input-lg',\n};\n\n// Map of validation state to CSS classes\nconst VALIDATION_CLASSES: Record<string, string> = {\n valid: 'input-success',\n invalid: 'input-error',\n pending: '',\n};\n\n// Strip @layer wrapper for Shadow DOM compatibility\nconst coreStyles = inputCSS.replace(/@layer\\s+components\\s*\\{/, '').replace(/\\}\\s*$/, '');\n\nconst styles = css`\n :host {\n display: block;\n }\n\n :host([hidden]) {\n display: none !important;\n }\n\n /* Import core input styles */\n ${coreStyles}\n\n /* Form field container */\n .container {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n\n /* Label */\n .label {\n display: block;\n font-size: 0.875rem;\n font-weight: 500;\n color: var(--color-on-surface);\n }\n\n .label.required::after {\n content: ' *';\n color: var(--color-error);\n }\n\n /* Input wrapper for prefix/suffix */\n .input-wrapper {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n border: 1px solid var(--color-outline);\n border-radius: 0.5rem;\n background-color: var(--color-surface);\n transition:\n border-color 150ms ease-in-out,\n box-shadow 150ms ease-in-out;\n }\n\n .input-wrapper:hover:not(.disabled) {\n border-color: var(--color-outline-variant);\n }\n\n .input-wrapper.focused {\n border-color: var(--color-primary);\n box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-primary) 10%, transparent);\n }\n\n .input-wrapper.disabled {\n background-color: var(--color-surface-container);\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n /* Validation states for wrapper */\n .input-wrapper.valid {\n border-color: var(--color-success);\n }\n\n .input-wrapper.valid.focused {\n box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-success) 10%, transparent);\n }\n\n .input-wrapper.invalid {\n border-color: var(--color-error);\n }\n\n .input-wrapper.invalid.focused {\n box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-error) 10%, transparent);\n }\n\n /* Size variants for wrapper */\n :host(:not([size])) .input-wrapper,\n :host([size='md']) .input-wrapper {\n min-height: 2.5rem;\n padding: 0 0.75rem;\n }\n\n :host([size='sm']) .input-wrapper {\n min-height: 2rem;\n padding: 0 0.5rem;\n }\n\n :host([size='lg']) .input-wrapper {\n min-height: 3rem;\n padding: 0 1rem;\n }\n\n /* Native input - use base .input class but remove redundant styles */\n .input-wrapper .input {\n flex: 1;\n min-width: 0;\n border: none;\n background: transparent;\n padding: 0;\n height: auto;\n }\n\n .input-wrapper .input:focus,\n .input-wrapper .input:focus-visible {\n box-shadow: none;\n border-color: transparent;\n }\n\n /* Prefix and suffix */\n .prefix,\n .suffix {\n display: none;\n flex-shrink: 0;\n color: var(--color-on-surface-variant);\n }\n\n .prefix.has-content,\n .suffix.has-content {\n display: flex;\n align-items: center;\n }\n\n /* Helper and error text */\n .helper,\n .error {\n font-size: 0.875rem;\n margin-top: 0.25rem;\n }\n\n .helper {\n color: var(--color-on-surface-variant);\n }\n\n .error {\n color: var(--color-error);\n }\n\n /* Pending state spinner */\n .pending-indicator {\n display: none;\n width: 1em;\n height: 1em;\n border: 2px solid var(--color-outline);\n border-top-color: var(--color-primary);\n border-radius: 50%;\n animation: spin 0.6s linear infinite;\n }\n\n :host([validation-state='pending']) .pending-indicator {\n display: block;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n`;\n\nexport class ElDmInput extends BaseElement {\n static properties = {\n type: { type: String, reflect: true, default: 'text' },\n value: { type: String, reflect: true, default: '' },\n name: { type: String, reflect: true },\n label: { type: String, reflect: true },\n placeholder: { type: String, reflect: true },\n disabled: { type: Boolean, reflect: true },\n readonly: { type: Boolean, reflect: true },\n required: { type: Boolean, reflect: true },\n size: { type: String, reflect: true },\n validationState: { type: String, reflect: true, attribute: 'validation-state' },\n errorMessage: { type: String, reflect: true, attribute: 'error-message' },\n helperText: { type: String, reflect: true, attribute: 'helper-text' },\n };\n\n /** Input type */\n declare type: InputType;\n\n /** Current value */\n declare value: string;\n\n /** Form field name */\n declare name: string;\n\n /** Label text */\n declare label: string;\n\n /** Placeholder text */\n declare placeholder: string;\n\n /** Whether the input is disabled */\n declare disabled: boolean;\n\n /** Whether the input is readonly */\n declare readonly: boolean;\n\n /** Whether the input is required */\n declare required: boolean;\n\n /** Input size */\n declare size: Size;\n\n /** Validation state */\n declare validationState: ValidationState;\n\n /** Error message */\n declare errorMessage: string;\n\n /** Helper text */\n declare helperText: string;\n\n /** Whether the input is focused */\n private _focused = false;\n\n private readonly _inputId = `input-${Math.random().toString(36).slice(2, 9)}`;\n\n /** Registered validators */\n private _validators: Validator[] = [];\n\n /**\n * Set the list of validators for this input.\n * Validators are run in order; the first failure wins.\n *\n * @example\n * ```ts\n * import { validators } from '@duskmoon-dev/el-base';\n * input.setValidators([\n * validators.required('Email is required'),\n * validators.email('Must be a valid email'),\n * ]);\n * ```\n */\n setValidators(rules: Validator[]): void {\n this._validators = rules;\n }\n\n /**\n * Run all registered validators against the current value.\n * Updates `validationState` and `errorMessage` automatically.\n *\n * @returns The validation result\n */\n validate(): ValidationResult {\n const result = validate(this.value ?? '', this._validators);\n this.validationState = result.state as ValidationState;\n this.errorMessage = result.message ?? '';\n return result;\n }\n\n constructor() {\n super();\n this.attachStyles(styles);\n this.shadowRoot.addEventListener('slotchange', this._handleSlotChange.bind(this));\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this._focused = false;\n }\n\n /**\n * Handle slot content changes\n */\n private _handleSlotChange(event: Event): void {\n const slot = event.target as HTMLSlotElement;\n const wrapper = slot.parentElement;\n if (wrapper) {\n const hasContent = slot.assignedNodes().length > 0;\n wrapper.classList.toggle('has-content', hasContent);\n }\n }\n\n /**\n * Handle input events\n */\n private _handleInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n\n this.emit('dm-input', { value: this.value });\n }\n\n /**\n * Handle change events\n */\n private _handleChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n\n this.emit('dm-change', { value: this.value });\n }\n\n /**\n * Handle focus events\n */\n private _handleFocus(): void {\n this._focused = true;\n this.update();\n this.emit('dm-focus');\n }\n\n /**\n * Handle blur events\n */\n private _handleBlur(): void {\n this._focused = false;\n if (this._validators.length > 0) {\n this.validate();\n }\n this.update();\n this.emit('dm-blur');\n }\n\n /**\n * Focus the input element\n */\n focus(): void {\n const input = this.shadowRoot.querySelector('input');\n input?.focus();\n }\n\n /**\n * Blur the input element\n */\n blur(): void {\n const input = this.shadowRoot.querySelector('input');\n input?.blur();\n }\n\n /**\n * Select all text in the input\n */\n select(): void {\n const input = this.shadowRoot.querySelector('input');\n input?.select();\n }\n\n /**\n * Build CSS class string for the input\n */\n private _getInputClasses(): string {\n const classes = ['input', 'input-bordered'];\n\n // Add size class\n if (this.size && SIZE_CLASSES[this.size]) {\n classes.push(SIZE_CLASSES[this.size]);\n }\n\n // Add validation class\n if (this.validationState && VALIDATION_CLASSES[this.validationState]) {\n classes.push(VALIDATION_CLASSES[this.validationState]);\n }\n\n return classes.filter(Boolean).join(' ');\n }\n\n protected update(): void {\n let input = this.shadowRoot.querySelector('input');\n if (!input) {\n super.update();\n input = this.shadowRoot.querySelector('input')!;\n input.id = this._inputId;\n input.addEventListener('input', this._handleInput.bind(this));\n input.addEventListener('change', this._handleChange.bind(this));\n input.addEventListener('focus', this._handleFocus.bind(this));\n input.addEventListener('blur', this._handleBlur.bind(this));\n }\n\n // Keep the live control mounted: replacing it drops focus and native editing state.\n input.type = this.type || 'text';\n input.name = this.name || '';\n input.placeholder = this.placeholder || '';\n input.disabled = this.disabled;\n input.readOnly = this.readonly;\n input.required = this.required;\n input.className = this._getInputClasses();\n const value = this.value || '';\n if (input.value !== value) {\n const { selectionStart, selectionEnd, selectionDirection } = input;\n input.value = value;\n if (selectionStart !== null && selectionEnd !== null) {\n input.setSelectionRange(selectionStart, selectionEnd, selectionDirection || undefined);\n }\n }\n input.setAttribute('value', value);\n input.setAttribute('aria-invalid', String(this.validationState === 'invalid'));\n const showError = this.validationState === 'invalid' && !!this.errorMessage;\n const showHelper = !!this.helperText && this.validationState !== 'invalid';\n input.setAttribute('aria-describedby', showError ? 'error' : showHelper ? 'helper' : '');\n\n const wrapper = this.shadowRoot.querySelector('.input-wrapper')!;\n wrapper.className = [\n 'input-wrapper',\n this._focused ? 'focused' : '',\n this.disabled ? 'disabled' : '',\n this.validationState || '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const container = this.shadowRoot.querySelector('.container')!;\n let label = container.querySelector('label');\n if (this.label) {\n if (!label) {\n label = document.createElement('label');\n label.setAttribute('part', 'label');\n label.htmlFor = this._inputId;\n container.prepend(label);\n }\n label.className = this.required ? 'label required' : 'label';\n label.textContent = this.label;\n } else {\n label?.remove();\n }\n for (const [id, text] of [\n ['error', showError ? this.errorMessage : ''],\n ['helper', showHelper ? this.helperText : ''],\n ]) {\n let message = container.querySelector<HTMLElement>(`#${id}`);\n if (text) {\n if (!message) {\n message = document.createElement('span');\n message.id = id;\n message.className = id;\n message.setAttribute('part', id);\n if (id === 'error') message.setAttribute('role', 'alert');\n container.append(message);\n }\n if (message.textContent !== text) message.textContent = text;\n } else {\n message?.remove();\n }\n }\n }\n\n render(): string {\n return `\n <div class=\"container\" part=\"container\">\n <div class=\"input-wrapper\" part=\"input-wrapper\">\n <span class=\"prefix\" part=\"prefix\">\n <slot name=\"prefix\"></slot>\n </span>\n <input part=\"input\" />\n <span class=\"pending-indicator\"></span>\n <span class=\"suffix\" part=\"suffix\">\n <slot name=\"suffix\"></slot>\n </span>\n </div>\n </div>\n `;\n }\n}\n",
6
6
  "/**\n * @duskmoon-dev/el-input\n *\n * DuskMoon Input custom element\n */\n\nimport { ElDmInput } from './el-dm-input.js';\n\nexport { ElDmInput };\nexport type { InputType } from './el-dm-input.js';\n\n/**\n * Register the el-dm-input custom element\n *\n * @example\n * ```ts\n * import { register } from '@duskmoon-dev/el-input';\n * register();\n * ```\n */\nexport function register(): void {\n if (!customElements.get('el-dm-input')) {\n customElements.define('el-dm-input', ElDmInput);\n }\n}\n"
7
7
  ],
8
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuC2C,IAA3C;AACgC,IAAhC;AASA,IAAM,eAAuC;AAAA,EAC3C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAGA,IAAM,qBAA6C;AAAA,EACjD,O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A;AAAA;AAAA;AAAA;AAAA;AAeX;;;AClfO,SAAS,QAAQ,GAAS;AAAA,EAC/B,IAAI,CAAC,eAAe,IAAI,aAAa,GAAG;AAAA,IACtC,eAAe,OAAO,eAAe,SAAS;AAAA,EAChD;AAAA;",
9
+ "debugId": "53587B4DC145DBEF64756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -234,6 +234,7 @@ class ElDmInput extends import_el_base.BaseElement {
234
234
  helperText: { type: String, reflect: true, attribute: "helper-text" }
235
235
  };
236
236
  _focused = false;
237
+ _inputId = `input-${Math.random().toString(36).slice(2, 9)}`;
237
238
  _validators = [];
238
239
  setValidators(rules) {
239
240
  this._validators = rules;
@@ -247,11 +248,12 @@ class ElDmInput extends import_el_base.BaseElement {
247
248
  constructor() {
248
249
  super();
249
250
  this.attachStyles(styles);
250
- }
251
- connectedCallback() {
252
- super.connectedCallback();
253
251
  this.shadowRoot.addEventListener("slotchange", this._handleSlotChange.bind(this));
254
252
  }
253
+ disconnectedCallback() {
254
+ super.disconnectedCallback();
255
+ this._focused = false;
256
+ }
255
257
  _handleSlotChange(event) {
256
258
  const slot = event.target;
257
259
  const wrapper = slot.parentElement;
@@ -306,71 +308,92 @@ class ElDmInput extends import_el_base.BaseElement {
306
308
  return classes.filter(Boolean).join(" ");
307
309
  }
308
310
  update() {
309
- super.update();
310
- const input = this.shadowRoot.querySelector("input");
311
- if (input) {
311
+ let input = this.shadowRoot.querySelector("input");
312
+ if (!input) {
313
+ super.update();
314
+ input = this.shadowRoot.querySelector("input");
315
+ input.id = this._inputId;
312
316
  input.addEventListener("input", this._handleInput.bind(this));
313
317
  input.addEventListener("change", this._handleChange.bind(this));
314
318
  input.addEventListener("focus", this._handleFocus.bind(this));
315
319
  input.addEventListener("blur", this._handleBlur.bind(this));
316
320
  }
317
- }
318
- render() {
319
- const wrapperClasses = [
321
+ input.type = this.type || "text";
322
+ input.name = this.name || "";
323
+ input.placeholder = this.placeholder || "";
324
+ input.disabled = this.disabled;
325
+ input.readOnly = this.readonly;
326
+ input.required = this.required;
327
+ input.className = this._getInputClasses();
328
+ const value = this.value || "";
329
+ if (input.value !== value) {
330
+ const { selectionStart, selectionEnd, selectionDirection } = input;
331
+ input.value = value;
332
+ if (selectionStart !== null && selectionEnd !== null) {
333
+ input.setSelectionRange(selectionStart, selectionEnd, selectionDirection || undefined);
334
+ }
335
+ }
336
+ input.setAttribute("value", value);
337
+ input.setAttribute("aria-invalid", String(this.validationState === "invalid"));
338
+ const showError = this.validationState === "invalid" && !!this.errorMessage;
339
+ const showHelper = !!this.helperText && this.validationState !== "invalid";
340
+ input.setAttribute("aria-describedby", showError ? "error" : showHelper ? "helper" : "");
341
+ const wrapper = this.shadowRoot.querySelector(".input-wrapper");
342
+ wrapper.className = [
320
343
  "input-wrapper",
321
344
  this._focused ? "focused" : "",
322
345
  this.disabled ? "disabled" : "",
323
346
  this.validationState || ""
324
347
  ].filter(Boolean).join(" ");
325
- const labelClasses = ["label", this.required ? "required" : ""].filter(Boolean).join(" ");
326
- const inputClasses = this._getInputClasses();
327
- const inputId = `input-${Math.random().toString(36).slice(2, 9)}`;
348
+ const container = this.shadowRoot.querySelector(".container");
349
+ let label = container.querySelector("label");
350
+ if (this.label) {
351
+ if (!label) {
352
+ label = document.createElement("label");
353
+ label.setAttribute("part", "label");
354
+ label.htmlFor = this._inputId;
355
+ container.prepend(label);
356
+ }
357
+ label.className = this.required ? "label required" : "label";
358
+ label.textContent = this.label;
359
+ } else {
360
+ label?.remove();
361
+ }
362
+ for (const [id, text] of [
363
+ ["error", showError ? this.errorMessage : ""],
364
+ ["helper", showHelper ? this.helperText : ""]
365
+ ]) {
366
+ let message = container.querySelector(`#${id}`);
367
+ if (text) {
368
+ if (!message) {
369
+ message = document.createElement("span");
370
+ message.id = id;
371
+ message.className = id;
372
+ message.setAttribute("part", id);
373
+ if (id === "error")
374
+ message.setAttribute("role", "alert");
375
+ container.append(message);
376
+ }
377
+ if (message.textContent !== text)
378
+ message.textContent = text;
379
+ } else {
380
+ message?.remove();
381
+ }
382
+ }
383
+ }
384
+ render() {
328
385
  return `
329
386
  <div class="container" part="container">
330
- ${this.label ? `
331
- <label class="${labelClasses}" for="${inputId}" part="label">
332
- ${this.label}
333
- </label>
334
- ` : ""}
335
-
336
- <div class="${wrapperClasses}" part="input-wrapper">
387
+ <div class="input-wrapper" part="input-wrapper">
337
388
  <span class="prefix" part="prefix">
338
389
  <slot name="prefix"></slot>
339
390
  </span>
340
-
341
- <input
342
- class="${inputClasses}"
343
- id="${inputId}"
344
- type="${this.type || "text"}"
345
- name="${this.name || ""}"
346
- value="${this.value || ""}"
347
- placeholder="${this.placeholder || ""}"
348
- ${this.disabled ? "disabled" : ""}
349
- ${this.readonly ? "readonly" : ""}
350
- ${this.required ? "required" : ""}
351
- aria-invalid="${this.validationState === "invalid" ? "true" : "false"}"
352
- aria-describedby="${this.errorMessage ? "error" : this.helperText ? "helper" : ""}"
353
- part="input"
354
- />
355
-
391
+ <input part="input" />
356
392
  <span class="pending-indicator"></span>
357
-
358
393
  <span class="suffix" part="suffix">
359
394
  <slot name="suffix"></slot>
360
395
  </span>
361
396
  </div>
362
-
363
- ${this.validationState === "invalid" && this.errorMessage ? `
364
- <span id="error" class="error" part="error" role="alert">
365
- ${this.errorMessage}
366
- </span>
367
- ` : ""}
368
-
369
- ${this.helperText && this.validationState !== "invalid" ? `
370
- <span id="helper" class="helper" part="helper">
371
- ${this.helperText}
372
- </span>
373
- ` : ""}
374
397
  </div>
375
398
  `;
376
399
  }
@@ -386,5 +409,5 @@ function register() {
386
409
  // src/register.ts
387
410
  register();
388
411
 
389
- //# debugId=1C60F550BFABAB9064756E2164756E21
412
+ //# debugId=48BE26278B8A5CC564756E2164756E21
390
413
  //# sourceMappingURL=register.js.map
@@ -2,11 +2,11 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/el-dm-input.ts", "../../src/index.ts", "../../src/register.ts"],
4
4
  "sourcesContent": [
5
- "/**\n * DuskMoon Input Element\n *\n * A text input component with label and validation states.\n * Uses styles from @duskmoon-dev/core for consistent theming.\n *\n * @element el-dm-input\n *\n * @attr {string} type - Input type: text, password, email, number, tel, url, search\n * @attr {string} value - Current input value\n * @attr {string} name - Form field name\n * @attr {string} label - Label text\n * @attr {string} placeholder - Placeholder text\n * @attr {boolean} disabled - Whether the input is disabled\n * @attr {boolean} readonly - Whether the input is readonly\n * @attr {boolean} required - Whether the input is required\n * @attr {string} size - Input size: sm, md, lg\n * @attr {string} validation-state - Validation state: valid, invalid, pending\n * @attr {string} error-message - Error message to display\n * @attr {string} helper-text - Helper text to display\n *\n * @slot prefix - Content before the input\n * @slot suffix - Content after the input\n *\n * @csspart container - The outer container\n * @csspart label - The label element\n * @csspart input-wrapper - The wrapper around the input\n * @csspart input - The native input element\n * @csspart prefix - The prefix slot wrapper\n * @csspart suffix - The suffix slot wrapper\n * @csspart helper - The helper text element\n * @csspart error - The error message element\n *\n * @fires dm-input - Fired when value changes during input\n * @fires dm-change - Fired when value changes and input loses focus\n * @fires dm-focus - Fired when input gains focus\n * @fires dm-blur - Fired when input loses focus\n */\n\nimport { BaseElement, css, validate } from '@duskmoon-dev/el-base';\nimport { css as inputCSS } from '@duskmoon-dev/core/components/input';\nimport type { Size, ValidationState, Validator, ValidationResult } from '@duskmoon-dev/el-base';\n\n/**\n * Supported input types\n */\nexport type InputType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search';\n\n// Map of size attribute values to CSS classes\nconst SIZE_CLASSES: Record<string, string> = {\n sm: 'input-sm',\n md: '',\n lg: 'input-lg',\n};\n\n// Map of validation state to CSS classes\nconst VALIDATION_CLASSES: Record<string, string> = {\n valid: 'input-success',\n invalid: 'input-error',\n pending: '',\n};\n\n// Strip @layer wrapper for Shadow DOM compatibility\nconst coreStyles = inputCSS.replace(/@layer\\s+components\\s*\\{/, '').replace(/\\}\\s*$/, '');\n\nconst styles = css`\n :host {\n display: block;\n }\n\n :host([hidden]) {\n display: none !important;\n }\n\n /* Import core input styles */\n ${coreStyles}\n\n /* Form field container */\n .container {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n\n /* Label */\n .label {\n display: block;\n font-size: 0.875rem;\n font-weight: 500;\n color: var(--color-on-surface);\n }\n\n .label.required::after {\n content: ' *';\n color: var(--color-error);\n }\n\n /* Input wrapper for prefix/suffix */\n .input-wrapper {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n border: 1px solid var(--color-outline);\n border-radius: 0.5rem;\n background-color: var(--color-surface);\n transition:\n border-color 150ms ease-in-out,\n box-shadow 150ms ease-in-out;\n }\n\n .input-wrapper:hover:not(.disabled) {\n border-color: var(--color-outline-variant);\n }\n\n .input-wrapper.focused {\n border-color: var(--color-primary);\n box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-primary) 10%, transparent);\n }\n\n .input-wrapper.disabled {\n background-color: var(--color-surface-container);\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n /* Validation states for wrapper */\n .input-wrapper.valid {\n border-color: var(--color-success);\n }\n\n .input-wrapper.valid.focused {\n box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-success) 10%, transparent);\n }\n\n .input-wrapper.invalid {\n border-color: var(--color-error);\n }\n\n .input-wrapper.invalid.focused {\n box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-error) 10%, transparent);\n }\n\n /* Size variants for wrapper */\n :host(:not([size])) .input-wrapper,\n :host([size='md']) .input-wrapper {\n min-height: 2.5rem;\n padding: 0 0.75rem;\n }\n\n :host([size='sm']) .input-wrapper {\n min-height: 2rem;\n padding: 0 0.5rem;\n }\n\n :host([size='lg']) .input-wrapper {\n min-height: 3rem;\n padding: 0 1rem;\n }\n\n /* Native input - use base .input class but remove redundant styles */\n .input-wrapper .input {\n flex: 1;\n min-width: 0;\n border: none;\n background: transparent;\n padding: 0;\n height: auto;\n }\n\n .input-wrapper .input:focus,\n .input-wrapper .input:focus-visible {\n box-shadow: none;\n border-color: transparent;\n }\n\n /* Prefix and suffix */\n .prefix,\n .suffix {\n display: none;\n flex-shrink: 0;\n color: var(--color-on-surface-variant);\n }\n\n .prefix.has-content,\n .suffix.has-content {\n display: flex;\n align-items: center;\n }\n\n /* Helper and error text */\n .helper,\n .error {\n font-size: 0.875rem;\n margin-top: 0.25rem;\n }\n\n .helper {\n color: var(--color-on-surface-variant);\n }\n\n .error {\n color: var(--color-error);\n }\n\n /* Pending state spinner */\n .pending-indicator {\n display: none;\n width: 1em;\n height: 1em;\n border: 2px solid var(--color-outline);\n border-top-color: var(--color-primary);\n border-radius: 50%;\n animation: spin 0.6s linear infinite;\n }\n\n :host([validation-state='pending']) .pending-indicator {\n display: block;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n`;\n\nexport class ElDmInput extends BaseElement {\n static properties = {\n type: { type: String, reflect: true, default: 'text' },\n value: { type: String, reflect: true, default: '' },\n name: { type: String, reflect: true },\n label: { type: String, reflect: true },\n placeholder: { type: String, reflect: true },\n disabled: { type: Boolean, reflect: true },\n readonly: { type: Boolean, reflect: true },\n required: { type: Boolean, reflect: true },\n size: { type: String, reflect: true },\n validationState: { type: String, reflect: true, attribute: 'validation-state' },\n errorMessage: { type: String, reflect: true, attribute: 'error-message' },\n helperText: { type: String, reflect: true, attribute: 'helper-text' },\n };\n\n /** Input type */\n declare type: InputType;\n\n /** Current value */\n declare value: string;\n\n /** Form field name */\n declare name: string;\n\n /** Label text */\n declare label: string;\n\n /** Placeholder text */\n declare placeholder: string;\n\n /** Whether the input is disabled */\n declare disabled: boolean;\n\n /** Whether the input is readonly */\n declare readonly: boolean;\n\n /** Whether the input is required */\n declare required: boolean;\n\n /** Input size */\n declare size: Size;\n\n /** Validation state */\n declare validationState: ValidationState;\n\n /** Error message */\n declare errorMessage: string;\n\n /** Helper text */\n declare helperText: string;\n\n /** Whether the input is focused */\n private _focused = false;\n\n /** Registered validators */\n private _validators: Validator[] = [];\n\n /**\n * Set the list of validators for this input.\n * Validators are run in order; the first failure wins.\n *\n * @example\n * ```ts\n * import { validators } from '@duskmoon-dev/el-base';\n * input.setValidators([\n * validators.required('Email is required'),\n * validators.email('Must be a valid email'),\n * ]);\n * ```\n */\n setValidators(rules: Validator[]): void {\n this._validators = rules;\n }\n\n /**\n * Run all registered validators against the current value.\n * Updates `validationState` and `errorMessage` automatically.\n *\n * @returns The validation result\n */\n validate(): ValidationResult {\n const result = validate(this.value ?? '', this._validators);\n this.validationState = result.state as ValidationState;\n this.errorMessage = result.message ?? '';\n return result;\n }\n\n constructor() {\n super();\n this.attachStyles(styles);\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.shadowRoot.addEventListener('slotchange', this._handleSlotChange.bind(this));\n }\n\n /**\n * Handle slot content changes\n */\n private _handleSlotChange(event: Event): void {\n const slot = event.target as HTMLSlotElement;\n const wrapper = slot.parentElement;\n if (wrapper) {\n const hasContent = slot.assignedNodes().length > 0;\n wrapper.classList.toggle('has-content', hasContent);\n }\n }\n\n /**\n * Handle input events\n */\n private _handleInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n\n this.emit('dm-input', { value: this.value });\n }\n\n /**\n * Handle change events\n */\n private _handleChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n\n this.emit('dm-change', { value: this.value });\n }\n\n /**\n * Handle focus events\n */\n private _handleFocus(): void {\n this._focused = true;\n this.update();\n this.emit('dm-focus');\n }\n\n /**\n * Handle blur events\n */\n private _handleBlur(): void {\n this._focused = false;\n if (this._validators.length > 0) {\n this.validate();\n }\n this.update();\n this.emit('dm-blur');\n }\n\n /**\n * Focus the input element\n */\n focus(): void {\n const input = this.shadowRoot.querySelector('input');\n input?.focus();\n }\n\n /**\n * Blur the input element\n */\n blur(): void {\n const input = this.shadowRoot.querySelector('input');\n input?.blur();\n }\n\n /**\n * Select all text in the input\n */\n select(): void {\n const input = this.shadowRoot.querySelector('input');\n input?.select();\n }\n\n /**\n * Build CSS class string for the input\n */\n private _getInputClasses(): string {\n const classes = ['input', 'input-bordered'];\n\n // Add size class\n if (this.size && SIZE_CLASSES[this.size]) {\n classes.push(SIZE_CLASSES[this.size]);\n }\n\n // Add validation class\n if (this.validationState && VALIDATION_CLASSES[this.validationState]) {\n classes.push(VALIDATION_CLASSES[this.validationState]);\n }\n\n return classes.filter(Boolean).join(' ');\n }\n\n protected update(): void {\n super.update();\n\n // Re-attach event listeners after render\n const input = this.shadowRoot.querySelector('input');\n if (input) {\n input.addEventListener('input', this._handleInput.bind(this));\n input.addEventListener('change', this._handleChange.bind(this));\n input.addEventListener('focus', this._handleFocus.bind(this));\n input.addEventListener('blur', this._handleBlur.bind(this));\n }\n }\n\n render(): string {\n const wrapperClasses = [\n 'input-wrapper',\n this._focused ? 'focused' : '',\n this.disabled ? 'disabled' : '',\n this.validationState || '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const labelClasses = ['label', this.required ? 'required' : ''].filter(Boolean).join(' ');\n const inputClasses = this._getInputClasses();\n const inputId = `input-${Math.random().toString(36).slice(2, 9)}`;\n\n return `\n <div class=\"container\" part=\"container\">\n ${\n this.label\n ? `\n <label class=\"${labelClasses}\" for=\"${inputId}\" part=\"label\">\n ${this.label}\n </label>\n `\n : ''\n }\n\n <div class=\"${wrapperClasses}\" part=\"input-wrapper\">\n <span class=\"prefix\" part=\"prefix\">\n <slot name=\"prefix\"></slot>\n </span>\n\n <input\n class=\"${inputClasses}\"\n id=\"${inputId}\"\n type=\"${this.type || 'text'}\"\n name=\"${this.name || ''}\"\n value=\"${this.value || ''}\"\n placeholder=\"${this.placeholder || ''}\"\n ${this.disabled ? 'disabled' : ''}\n ${this.readonly ? 'readonly' : ''}\n ${this.required ? 'required' : ''}\n aria-invalid=\"${this.validationState === 'invalid' ? 'true' : 'false'}\"\n aria-describedby=\"${this.errorMessage ? 'error' : this.helperText ? 'helper' : ''}\"\n part=\"input\"\n />\n\n <span class=\"pending-indicator\"></span>\n\n <span class=\"suffix\" part=\"suffix\">\n <slot name=\"suffix\"></slot>\n </span>\n </div>\n\n ${\n this.validationState === 'invalid' && this.errorMessage\n ? `\n <span id=\"error\" class=\"error\" part=\"error\" role=\"alert\">\n ${this.errorMessage}\n </span>\n `\n : ''\n }\n\n ${\n this.helperText && this.validationState !== 'invalid'\n ? `\n <span id=\"helper\" class=\"helper\" part=\"helper\">\n ${this.helperText}\n </span>\n `\n : ''\n }\n </div>\n `;\n }\n}\n",
5
+ "/**\n * DuskMoon Input Element\n *\n * A text input component with label and validation states.\n * Uses styles from @duskmoon-dev/core for consistent theming.\n *\n * @element el-dm-input\n *\n * @attr {string} type - Input type: text, password, email, number, tel, url, search\n * @attr {string} value - Current input value\n * @attr {string} name - Form field name\n * @attr {string} label - Label text\n * @attr {string} placeholder - Placeholder text\n * @attr {boolean} disabled - Whether the input is disabled\n * @attr {boolean} readonly - Whether the input is readonly\n * @attr {boolean} required - Whether the input is required\n * @attr {string} size - Input size: sm, md, lg\n * @attr {string} validation-state - Validation state: valid, invalid, pending\n * @attr {string} error-message - Error message to display\n * @attr {string} helper-text - Helper text to display\n *\n * @slot prefix - Content before the input\n * @slot suffix - Content after the input\n *\n * @csspart container - The outer container\n * @csspart label - The label element\n * @csspart input-wrapper - The wrapper around the input\n * @csspart input - The native input element\n * @csspart prefix - The prefix slot wrapper\n * @csspart suffix - The suffix slot wrapper\n * @csspart helper - The helper text element\n * @csspart error - The error message element\n *\n * @fires dm-input - Fired when value changes during input\n * @fires dm-change - Fired when value changes and input loses focus\n * @fires dm-focus - Fired when input gains focus\n * @fires dm-blur - Fired when input loses focus\n */\n\nimport { BaseElement, css, validate } from '@duskmoon-dev/el-base';\nimport { css as inputCSS } from '@duskmoon-dev/core/components/input';\nimport type { Size, ValidationState, Validator, ValidationResult } from '@duskmoon-dev/el-base';\n\n/**\n * Supported input types\n */\nexport type InputType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search';\n\n// Map of size attribute values to CSS classes\nconst SIZE_CLASSES: Record<string, string> = {\n sm: 'input-sm',\n md: '',\n lg: 'input-lg',\n};\n\n// Map of validation state to CSS classes\nconst VALIDATION_CLASSES: Record<string, string> = {\n valid: 'input-success',\n invalid: 'input-error',\n pending: '',\n};\n\n// Strip @layer wrapper for Shadow DOM compatibility\nconst coreStyles = inputCSS.replace(/@layer\\s+components\\s*\\{/, '').replace(/\\}\\s*$/, '');\n\nconst styles = css`\n :host {\n display: block;\n }\n\n :host([hidden]) {\n display: none !important;\n }\n\n /* Import core input styles */\n ${coreStyles}\n\n /* Form field container */\n .container {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n\n /* Label */\n .label {\n display: block;\n font-size: 0.875rem;\n font-weight: 500;\n color: var(--color-on-surface);\n }\n\n .label.required::after {\n content: ' *';\n color: var(--color-error);\n }\n\n /* Input wrapper for prefix/suffix */\n .input-wrapper {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n border: 1px solid var(--color-outline);\n border-radius: 0.5rem;\n background-color: var(--color-surface);\n transition:\n border-color 150ms ease-in-out,\n box-shadow 150ms ease-in-out;\n }\n\n .input-wrapper:hover:not(.disabled) {\n border-color: var(--color-outline-variant);\n }\n\n .input-wrapper.focused {\n border-color: var(--color-primary);\n box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-primary) 10%, transparent);\n }\n\n .input-wrapper.disabled {\n background-color: var(--color-surface-container);\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n /* Validation states for wrapper */\n .input-wrapper.valid {\n border-color: var(--color-success);\n }\n\n .input-wrapper.valid.focused {\n box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-success) 10%, transparent);\n }\n\n .input-wrapper.invalid {\n border-color: var(--color-error);\n }\n\n .input-wrapper.invalid.focused {\n box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-error) 10%, transparent);\n }\n\n /* Size variants for wrapper */\n :host(:not([size])) .input-wrapper,\n :host([size='md']) .input-wrapper {\n min-height: 2.5rem;\n padding: 0 0.75rem;\n }\n\n :host([size='sm']) .input-wrapper {\n min-height: 2rem;\n padding: 0 0.5rem;\n }\n\n :host([size='lg']) .input-wrapper {\n min-height: 3rem;\n padding: 0 1rem;\n }\n\n /* Native input - use base .input class but remove redundant styles */\n .input-wrapper .input {\n flex: 1;\n min-width: 0;\n border: none;\n background: transparent;\n padding: 0;\n height: auto;\n }\n\n .input-wrapper .input:focus,\n .input-wrapper .input:focus-visible {\n box-shadow: none;\n border-color: transparent;\n }\n\n /* Prefix and suffix */\n .prefix,\n .suffix {\n display: none;\n flex-shrink: 0;\n color: var(--color-on-surface-variant);\n }\n\n .prefix.has-content,\n .suffix.has-content {\n display: flex;\n align-items: center;\n }\n\n /* Helper and error text */\n .helper,\n .error {\n font-size: 0.875rem;\n margin-top: 0.25rem;\n }\n\n .helper {\n color: var(--color-on-surface-variant);\n }\n\n .error {\n color: var(--color-error);\n }\n\n /* Pending state spinner */\n .pending-indicator {\n display: none;\n width: 1em;\n height: 1em;\n border: 2px solid var(--color-outline);\n border-top-color: var(--color-primary);\n border-radius: 50%;\n animation: spin 0.6s linear infinite;\n }\n\n :host([validation-state='pending']) .pending-indicator {\n display: block;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n`;\n\nexport class ElDmInput extends BaseElement {\n static properties = {\n type: { type: String, reflect: true, default: 'text' },\n value: { type: String, reflect: true, default: '' },\n name: { type: String, reflect: true },\n label: { type: String, reflect: true },\n placeholder: { type: String, reflect: true },\n disabled: { type: Boolean, reflect: true },\n readonly: { type: Boolean, reflect: true },\n required: { type: Boolean, reflect: true },\n size: { type: String, reflect: true },\n validationState: { type: String, reflect: true, attribute: 'validation-state' },\n errorMessage: { type: String, reflect: true, attribute: 'error-message' },\n helperText: { type: String, reflect: true, attribute: 'helper-text' },\n };\n\n /** Input type */\n declare type: InputType;\n\n /** Current value */\n declare value: string;\n\n /** Form field name */\n declare name: string;\n\n /** Label text */\n declare label: string;\n\n /** Placeholder text */\n declare placeholder: string;\n\n /** Whether the input is disabled */\n declare disabled: boolean;\n\n /** Whether the input is readonly */\n declare readonly: boolean;\n\n /** Whether the input is required */\n declare required: boolean;\n\n /** Input size */\n declare size: Size;\n\n /** Validation state */\n declare validationState: ValidationState;\n\n /** Error message */\n declare errorMessage: string;\n\n /** Helper text */\n declare helperText: string;\n\n /** Whether the input is focused */\n private _focused = false;\n\n private readonly _inputId = `input-${Math.random().toString(36).slice(2, 9)}`;\n\n /** Registered validators */\n private _validators: Validator[] = [];\n\n /**\n * Set the list of validators for this input.\n * Validators are run in order; the first failure wins.\n *\n * @example\n * ```ts\n * import { validators } from '@duskmoon-dev/el-base';\n * input.setValidators([\n * validators.required('Email is required'),\n * validators.email('Must be a valid email'),\n * ]);\n * ```\n */\n setValidators(rules: Validator[]): void {\n this._validators = rules;\n }\n\n /**\n * Run all registered validators against the current value.\n * Updates `validationState` and `errorMessage` automatically.\n *\n * @returns The validation result\n */\n validate(): ValidationResult {\n const result = validate(this.value ?? '', this._validators);\n this.validationState = result.state as ValidationState;\n this.errorMessage = result.message ?? '';\n return result;\n }\n\n constructor() {\n super();\n this.attachStyles(styles);\n this.shadowRoot.addEventListener('slotchange', this._handleSlotChange.bind(this));\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this._focused = false;\n }\n\n /**\n * Handle slot content changes\n */\n private _handleSlotChange(event: Event): void {\n const slot = event.target as HTMLSlotElement;\n const wrapper = slot.parentElement;\n if (wrapper) {\n const hasContent = slot.assignedNodes().length > 0;\n wrapper.classList.toggle('has-content', hasContent);\n }\n }\n\n /**\n * Handle input events\n */\n private _handleInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n\n this.emit('dm-input', { value: this.value });\n }\n\n /**\n * Handle change events\n */\n private _handleChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n\n this.emit('dm-change', { value: this.value });\n }\n\n /**\n * Handle focus events\n */\n private _handleFocus(): void {\n this._focused = true;\n this.update();\n this.emit('dm-focus');\n }\n\n /**\n * Handle blur events\n */\n private _handleBlur(): void {\n this._focused = false;\n if (this._validators.length > 0) {\n this.validate();\n }\n this.update();\n this.emit('dm-blur');\n }\n\n /**\n * Focus the input element\n */\n focus(): void {\n const input = this.shadowRoot.querySelector('input');\n input?.focus();\n }\n\n /**\n * Blur the input element\n */\n blur(): void {\n const input = this.shadowRoot.querySelector('input');\n input?.blur();\n }\n\n /**\n * Select all text in the input\n */\n select(): void {\n const input = this.shadowRoot.querySelector('input');\n input?.select();\n }\n\n /**\n * Build CSS class string for the input\n */\n private _getInputClasses(): string {\n const classes = ['input', 'input-bordered'];\n\n // Add size class\n if (this.size && SIZE_CLASSES[this.size]) {\n classes.push(SIZE_CLASSES[this.size]);\n }\n\n // Add validation class\n if (this.validationState && VALIDATION_CLASSES[this.validationState]) {\n classes.push(VALIDATION_CLASSES[this.validationState]);\n }\n\n return classes.filter(Boolean).join(' ');\n }\n\n protected update(): void {\n let input = this.shadowRoot.querySelector('input');\n if (!input) {\n super.update();\n input = this.shadowRoot.querySelector('input')!;\n input.id = this._inputId;\n input.addEventListener('input', this._handleInput.bind(this));\n input.addEventListener('change', this._handleChange.bind(this));\n input.addEventListener('focus', this._handleFocus.bind(this));\n input.addEventListener('blur', this._handleBlur.bind(this));\n }\n\n // Keep the live control mounted: replacing it drops focus and native editing state.\n input.type = this.type || 'text';\n input.name = this.name || '';\n input.placeholder = this.placeholder || '';\n input.disabled = this.disabled;\n input.readOnly = this.readonly;\n input.required = this.required;\n input.className = this._getInputClasses();\n const value = this.value || '';\n if (input.value !== value) {\n const { selectionStart, selectionEnd, selectionDirection } = input;\n input.value = value;\n if (selectionStart !== null && selectionEnd !== null) {\n input.setSelectionRange(selectionStart, selectionEnd, selectionDirection || undefined);\n }\n }\n input.setAttribute('value', value);\n input.setAttribute('aria-invalid', String(this.validationState === 'invalid'));\n const showError = this.validationState === 'invalid' && !!this.errorMessage;\n const showHelper = !!this.helperText && this.validationState !== 'invalid';\n input.setAttribute('aria-describedby', showError ? 'error' : showHelper ? 'helper' : '');\n\n const wrapper = this.shadowRoot.querySelector('.input-wrapper')!;\n wrapper.className = [\n 'input-wrapper',\n this._focused ? 'focused' : '',\n this.disabled ? 'disabled' : '',\n this.validationState || '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const container = this.shadowRoot.querySelector('.container')!;\n let label = container.querySelector('label');\n if (this.label) {\n if (!label) {\n label = document.createElement('label');\n label.setAttribute('part', 'label');\n label.htmlFor = this._inputId;\n container.prepend(label);\n }\n label.className = this.required ? 'label required' : 'label';\n label.textContent = this.label;\n } else {\n label?.remove();\n }\n for (const [id, text] of [\n ['error', showError ? this.errorMessage : ''],\n ['helper', showHelper ? this.helperText : ''],\n ]) {\n let message = container.querySelector<HTMLElement>(`#${id}`);\n if (text) {\n if (!message) {\n message = document.createElement('span');\n message.id = id;\n message.className = id;\n message.setAttribute('part', id);\n if (id === 'error') message.setAttribute('role', 'alert');\n container.append(message);\n }\n if (message.textContent !== text) message.textContent = text;\n } else {\n message?.remove();\n }\n }\n }\n\n render(): string {\n return `\n <div class=\"container\" part=\"container\">\n <div class=\"input-wrapper\" part=\"input-wrapper\">\n <span class=\"prefix\" part=\"prefix\">\n <slot name=\"prefix\"></slot>\n </span>\n <input part=\"input\" />\n <span class=\"pending-indicator\"></span>\n <span class=\"suffix\" part=\"suffix\">\n <slot name=\"suffix\"></slot>\n </span>\n </div>\n </div>\n `;\n }\n}\n",
6
6
  "/**\n * @duskmoon-dev/el-input\n *\n * DuskMoon Input custom element\n */\n\nimport { ElDmInput } from './el-dm-input.js';\n\nexport { ElDmInput };\nexport type { InputType } from './el-dm-input.js';\n\n/**\n * Register the el-dm-input custom element\n *\n * @example\n * ```ts\n * import { register } from '@duskmoon-dev/el-input';\n * register();\n * ```\n */\nexport function register(): void {\n if (!customElements.get('el-dm-input')) {\n customElements.define('el-dm-input', ElDmInput);\n }\n}\n",
7
7
  "/**\n * Auto-register el-dm-input custom element\n *\n * @example\n * ```ts\n * import '@duskmoon-dev/el-input/register';\n *\n * // Now you can use <el-dm-input> in HTML\n * ```\n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