@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/esm/index.js CHANGED
@@ -189,6 +189,7 @@ class ElDmInput extends BaseElement {
189
189
  helperText: { type: String, reflect: true, attribute: "helper-text" }
190
190
  };
191
191
  _focused = false;
192
+ _inputId = `input-${Math.random().toString(36).slice(2, 9)}`;
192
193
  _validators = [];
193
194
  setValidators(rules) {
194
195
  this._validators = rules;
@@ -202,11 +203,12 @@ class ElDmInput extends BaseElement {
202
203
  constructor() {
203
204
  super();
204
205
  this.attachStyles(styles);
205
- }
206
- connectedCallback() {
207
- super.connectedCallback();
208
206
  this.shadowRoot.addEventListener("slotchange", this._handleSlotChange.bind(this));
209
207
  }
208
+ disconnectedCallback() {
209
+ super.disconnectedCallback();
210
+ this._focused = false;
211
+ }
210
212
  _handleSlotChange(event) {
211
213
  const slot = event.target;
212
214
  const wrapper = slot.parentElement;
@@ -261,71 +263,92 @@ class ElDmInput extends BaseElement {
261
263
  return classes.filter(Boolean).join(" ");
262
264
  }
263
265
  update() {
264
- super.update();
265
- const input = this.shadowRoot.querySelector("input");
266
- if (input) {
266
+ let input = this.shadowRoot.querySelector("input");
267
+ if (!input) {
268
+ super.update();
269
+ input = this.shadowRoot.querySelector("input");
270
+ input.id = this._inputId;
267
271
  input.addEventListener("input", this._handleInput.bind(this));
268
272
  input.addEventListener("change", this._handleChange.bind(this));
269
273
  input.addEventListener("focus", this._handleFocus.bind(this));
270
274
  input.addEventListener("blur", this._handleBlur.bind(this));
271
275
  }
272
- }
273
- render() {
274
- const wrapperClasses = [
276
+ input.type = this.type || "text";
277
+ input.name = this.name || "";
278
+ input.placeholder = this.placeholder || "";
279
+ input.disabled = this.disabled;
280
+ input.readOnly = this.readonly;
281
+ input.required = this.required;
282
+ input.className = this._getInputClasses();
283
+ const value = this.value || "";
284
+ if (input.value !== value) {
285
+ const { selectionStart, selectionEnd, selectionDirection } = input;
286
+ input.value = value;
287
+ if (selectionStart !== null && selectionEnd !== null) {
288
+ input.setSelectionRange(selectionStart, selectionEnd, selectionDirection || undefined);
289
+ }
290
+ }
291
+ input.setAttribute("value", value);
292
+ input.setAttribute("aria-invalid", String(this.validationState === "invalid"));
293
+ const showError = this.validationState === "invalid" && !!this.errorMessage;
294
+ const showHelper = !!this.helperText && this.validationState !== "invalid";
295
+ input.setAttribute("aria-describedby", showError ? "error" : showHelper ? "helper" : "");
296
+ const wrapper = this.shadowRoot.querySelector(".input-wrapper");
297
+ wrapper.className = [
275
298
  "input-wrapper",
276
299
  this._focused ? "focused" : "",
277
300
  this.disabled ? "disabled" : "",
278
301
  this.validationState || ""
279
302
  ].filter(Boolean).join(" ");
280
- const labelClasses = ["label", this.required ? "required" : ""].filter(Boolean).join(" ");
281
- const inputClasses = this._getInputClasses();
282
- const inputId = `input-${Math.random().toString(36).slice(2, 9)}`;
303
+ const container = this.shadowRoot.querySelector(".container");
304
+ let label = container.querySelector("label");
305
+ if (this.label) {
306
+ if (!label) {
307
+ label = document.createElement("label");
308
+ label.setAttribute("part", "label");
309
+ label.htmlFor = this._inputId;
310
+ container.prepend(label);
311
+ }
312
+ label.className = this.required ? "label required" : "label";
313
+ label.textContent = this.label;
314
+ } else {
315
+ label?.remove();
316
+ }
317
+ for (const [id, text] of [
318
+ ["error", showError ? this.errorMessage : ""],
319
+ ["helper", showHelper ? this.helperText : ""]
320
+ ]) {
321
+ let message = container.querySelector(`#${id}`);
322
+ if (text) {
323
+ if (!message) {
324
+ message = document.createElement("span");
325
+ message.id = id;
326
+ message.className = id;
327
+ message.setAttribute("part", id);
328
+ if (id === "error")
329
+ message.setAttribute("role", "alert");
330
+ container.append(message);
331
+ }
332
+ if (message.textContent !== text)
333
+ message.textContent = text;
334
+ } else {
335
+ message?.remove();
336
+ }
337
+ }
338
+ }
339
+ render() {
283
340
  return `
284
341
  <div class="container" part="container">
285
- ${this.label ? `
286
- <label class="${labelClasses}" for="${inputId}" part="label">
287
- ${this.label}
288
- </label>
289
- ` : ""}
290
-
291
- <div class="${wrapperClasses}" part="input-wrapper">
342
+ <div class="input-wrapper" part="input-wrapper">
292
343
  <span class="prefix" part="prefix">
293
344
  <slot name="prefix"></slot>
294
345
  </span>
295
-
296
- <input
297
- class="${inputClasses}"
298
- id="${inputId}"
299
- type="${this.type || "text"}"
300
- name="${this.name || ""}"
301
- value="${this.value || ""}"
302
- placeholder="${this.placeholder || ""}"
303
- ${this.disabled ? "disabled" : ""}
304
- ${this.readonly ? "readonly" : ""}
305
- ${this.required ? "required" : ""}
306
- aria-invalid="${this.validationState === "invalid" ? "true" : "false"}"
307
- aria-describedby="${this.errorMessage ? "error" : this.helperText ? "helper" : ""}"
308
- part="input"
309
- />
310
-
346
+ <input part="input" />
311
347
  <span class="pending-indicator"></span>
312
-
313
348
  <span class="suffix" part="suffix">
314
349
  <slot name="suffix"></slot>
315
350
  </span>
316
351
  </div>
317
-
318
- ${this.validationState === "invalid" && this.errorMessage ? `
319
- <span id="error" class="error" part="error" role="alert">
320
- ${this.errorMessage}
321
- </span>
322
- ` : ""}
323
-
324
- ${this.helperText && this.validationState !== "invalid" ? `
325
- <span id="helper" class="helper" part="helper">
326
- ${this.helperText}
327
- </span>
328
- ` : ""}
329
352
  </div>
330
353
  `;
331
354
  }
@@ -342,5 +365,5 @@ export {
342
365
  register
343
366
  };
344
367
 
345
- //# debugId=AD251EC1A6601BC364756E2164756E21
368
+ //# debugId=629CCA8752B0693664756E2164756E21
346
369
  //# 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": ";AAuCA;AACA,gBAAS;AAST,IAAM,eAAuC;AAAA,EAC3C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAGA,IAAM,qBAA6C;AAAA,EACjD,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AACX;AAGA,IAAM,aAAa,SAAS,QAAQ,4BAA4B,EAAE,EA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;",
9
+ "debugId": "629CCA8752B0693664756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -189,6 +189,7 @@ class ElDmInput extends BaseElement {
189
189
  helperText: { type: String, reflect: true, attribute: "helper-text" }
190
190
  };
191
191
  _focused = false;
192
+ _inputId = `input-${Math.random().toString(36).slice(2, 9)}`;
192
193
  _validators = [];
193
194
  setValidators(rules) {
194
195
  this._validators = rules;
@@ -202,11 +203,12 @@ class ElDmInput extends BaseElement {
202
203
  constructor() {
203
204
  super();
204
205
  this.attachStyles(styles);
205
- }
206
- connectedCallback() {
207
- super.connectedCallback();
208
206
  this.shadowRoot.addEventListener("slotchange", this._handleSlotChange.bind(this));
209
207
  }
208
+ disconnectedCallback() {
209
+ super.disconnectedCallback();
210
+ this._focused = false;
211
+ }
210
212
  _handleSlotChange(event) {
211
213
  const slot = event.target;
212
214
  const wrapper = slot.parentElement;
@@ -261,71 +263,92 @@ class ElDmInput extends BaseElement {
261
263
  return classes.filter(Boolean).join(" ");
262
264
  }
263
265
  update() {
264
- super.update();
265
- const input = this.shadowRoot.querySelector("input");
266
- if (input) {
266
+ let input = this.shadowRoot.querySelector("input");
267
+ if (!input) {
268
+ super.update();
269
+ input = this.shadowRoot.querySelector("input");
270
+ input.id = this._inputId;
267
271
  input.addEventListener("input", this._handleInput.bind(this));
268
272
  input.addEventListener("change", this._handleChange.bind(this));
269
273
  input.addEventListener("focus", this._handleFocus.bind(this));
270
274
  input.addEventListener("blur", this._handleBlur.bind(this));
271
275
  }
272
- }
273
- render() {
274
- const wrapperClasses = [
276
+ input.type = this.type || "text";
277
+ input.name = this.name || "";
278
+ input.placeholder = this.placeholder || "";
279
+ input.disabled = this.disabled;
280
+ input.readOnly = this.readonly;
281
+ input.required = this.required;
282
+ input.className = this._getInputClasses();
283
+ const value = this.value || "";
284
+ if (input.value !== value) {
285
+ const { selectionStart, selectionEnd, selectionDirection } = input;
286
+ input.value = value;
287
+ if (selectionStart !== null && selectionEnd !== null) {
288
+ input.setSelectionRange(selectionStart, selectionEnd, selectionDirection || undefined);
289
+ }
290
+ }
291
+ input.setAttribute("value", value);
292
+ input.setAttribute("aria-invalid", String(this.validationState === "invalid"));
293
+ const showError = this.validationState === "invalid" && !!this.errorMessage;
294
+ const showHelper = !!this.helperText && this.validationState !== "invalid";
295
+ input.setAttribute("aria-describedby", showError ? "error" : showHelper ? "helper" : "");
296
+ const wrapper = this.shadowRoot.querySelector(".input-wrapper");
297
+ wrapper.className = [
275
298
  "input-wrapper",
276
299
  this._focused ? "focused" : "",
277
300
  this.disabled ? "disabled" : "",
278
301
  this.validationState || ""
279
302
  ].filter(Boolean).join(" ");
280
- const labelClasses = ["label", this.required ? "required" : ""].filter(Boolean).join(" ");
281
- const inputClasses = this._getInputClasses();
282
- const inputId = `input-${Math.random().toString(36).slice(2, 9)}`;
303
+ const container = this.shadowRoot.querySelector(".container");
304
+ let label = container.querySelector("label");
305
+ if (this.label) {
306
+ if (!label) {
307
+ label = document.createElement("label");
308
+ label.setAttribute("part", "label");
309
+ label.htmlFor = this._inputId;
310
+ container.prepend(label);
311
+ }
312
+ label.className = this.required ? "label required" : "label";
313
+ label.textContent = this.label;
314
+ } else {
315
+ label?.remove();
316
+ }
317
+ for (const [id, text] of [
318
+ ["error", showError ? this.errorMessage : ""],
319
+ ["helper", showHelper ? this.helperText : ""]
320
+ ]) {
321
+ let message = container.querySelector(`#${id}`);
322
+ if (text) {
323
+ if (!message) {
324
+ message = document.createElement("span");
325
+ message.id = id;
326
+ message.className = id;
327
+ message.setAttribute("part", id);
328
+ if (id === "error")
329
+ message.setAttribute("role", "alert");
330
+ container.append(message);
331
+ }
332
+ if (message.textContent !== text)
333
+ message.textContent = text;
334
+ } else {
335
+ message?.remove();
336
+ }
337
+ }
338
+ }
339
+ render() {
283
340
  return `
284
341
  <div class="container" part="container">
285
- ${this.label ? `
286
- <label class="${labelClasses}" for="${inputId}" part="label">
287
- ${this.label}
288
- </label>
289
- ` : ""}
290
-
291
- <div class="${wrapperClasses}" part="input-wrapper">
342
+ <div class="input-wrapper" part="input-wrapper">
292
343
  <span class="prefix" part="prefix">
293
344
  <slot name="prefix"></slot>
294
345
  </span>
295
-
296
- <input
297
- class="${inputClasses}"
298
- id="${inputId}"
299
- type="${this.type || "text"}"
300
- name="${this.name || ""}"
301
- value="${this.value || ""}"
302
- placeholder="${this.placeholder || ""}"
303
- ${this.disabled ? "disabled" : ""}
304
- ${this.readonly ? "readonly" : ""}
305
- ${this.required ? "required" : ""}
306
- aria-invalid="${this.validationState === "invalid" ? "true" : "false"}"
307
- aria-describedby="${this.errorMessage ? "error" : this.helperText ? "helper" : ""}"
308
- part="input"
309
- />
310
-
346
+ <input part="input" />
311
347
  <span class="pending-indicator"></span>
312
-
313
348
  <span class="suffix" part="suffix">
314
349
  <slot name="suffix"></slot>
315
350
  </span>
316
351
  </div>
317
-
318
- ${this.validationState === "invalid" && this.errorMessage ? `
319
- <span id="error" class="error" part="error" role="alert">
320
- ${this.errorMessage}
321
- </span>
322
- ` : ""}
323
-
324
- ${this.helperText && this.validationState !== "invalid" ? `
325
- <span id="helper" class="helper" part="helper">
326
- ${this.helperText}
327
- </span>
328
- ` : ""}
329
352
  </div>
330
353
  `;
331
354
  }
@@ -341,5 +364,5 @@ function register() {
341
364
  // src/register.ts
342
365
  register();
343
366
 
344
- //# debugId=280D1D9161FA17AE64756E2164756E21
367
+ //# debugId=ACB882625252DFD664756E2164756E21
345
368
  //# 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 */\nimport { register } from './index.js';\n\nregister();\n"
8
8
  ],
9
- "mappings": ";AAuCA;AACA,gBAAS;AAST,IAAM,eAAuC;AAAA,EAC3C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAGA,IAAM,qBAA6C;AAAA,EACjD,OAAO;A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