@nuralyui/input 0.0.5 → 0.0.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"input.component.js","sourceRoot":"","sources":["../../../src/components/input/input.component.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD;;;;GAIG;;;;;;;;;;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAuC,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,2BAA2B,CAAC;AAGnC,IAAa,cAAc,GAA3B,MAAa,cAAe,SAAQ,iBAAiB,CAAC,UAAU,CAAC;IAAjE;;QAGE,aAAQ,GAAG,KAAK,CAAC;QAGjB,UAAK,uCAAuB;QAG5B,UAAK,GAAG,YAAY,CAAC;QAGrB,SAAI,oCAAqB;QAGzB,SAAI,gCAAmB;QAYvB,gBAAW,GAAG,YAAY,CAAC;QAG3B,iBAAY,GAAG,KAAK,CAAC;QAGrB,aAAQ,GAAG,KAAK,CAAC;QAGjB,cAAS,GAAG,YAAY,CAAC;QAKzB;;WAEG;QACM,uBAAkB,GAAG,CAAC,SAAS,CAAC,CAAC;IAsP5C,CAAC;IApPC;;OAEG;IACM,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IAEQ,UAAU,CAAC,kBAAkC;QACpD,IAAI,kBAAkB,CAAC,GAAG,CA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CAkS1B;SAlSY,cAAc","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * @license\n * Copyright 2023 Google Laabidi Aymen\n * SPDX-License-Identifier: MIT\n */\n\nimport { LitElement, PropertyValues, html, nothing } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { styles } from './input.style.js';\nimport { INPUT_TYPE, INPUT_STATE, INPUT_SIZE, EMPTY_STRING } from './input.constant.js';\nimport { choose } from 'lit/directives/choose.js';\nimport { NuralyUIBaseMixin } from '../../shared/base-mixin.js';\nimport '../icon/icon.component.js';\n\n@customElement('nr-input')\nexport class NrInputElement extends NuralyUIBaseMixin(LitElement) {\n\n @property({type: Boolean, reflect: true})\n disabled = false;\n\n @property({type: String, reflect: true})\n state = INPUT_STATE.Default;\n\n @property({type: String})\n value = EMPTY_STRING;\n\n @property({type: String})\n size = INPUT_SIZE.Medium;\n\n @property({reflect: true})\n type = INPUT_TYPE.TEXT;\n\n @property({type: String})\n step?: string;\n\n @property({type: String})\n min?: string;\n\n @property({type: String})\n max?: string;\n\n @property({type: String})\n placeholder = EMPTY_STRING;\n\n @property({type: String})\n autocomplete = 'off';\n\n @property({type: Boolean, reflect: true})\n withCopy = false;\n\n @state()\n inputType = EMPTY_STRING;\n\n @query('#input')\n input!: HTMLInputElement;\n\n /**\n * Required components that must be registered for this component to work properly\n */\n override requiredComponents = ['hy-icon'];\n\n /**\n * Check for required dependencies when component is connected to DOM\n */\n override connectedCallback() {\n super.connectedCallback();\n this.validateDependencies();\n }\n\n override willUpdate(_changedProperties: PropertyValues): void {\n if (_changedProperties.has('type')) {\n this.inputType = this.type;\n if (this.inputType === INPUT_TYPE.NUMBER && this.min && !this.value) {\n this.value = this.min;\n }\n }\n }\n\n override updated(_changedProperties: PropertyValues): void {\n if (_changedProperties.has('step') || _changedProperties.has('min') || _changedProperties.has('max')) {\n const input = this.input;\n if (input) {\n if (this.step) input.setAttribute('step', this.step);\n else input.removeAttribute('step');\n \n if (this.min) input.setAttribute('min', this.min);\n else input.removeAttribute('min');\n \n if (this.max) input.setAttribute('max', this.max);\n else input.removeAttribute('max');\n }\n }\n }\n\n private _increment() {\n this.input.stepUp();\n this.value = this.input.value; // Sync the property\n this.dispatchEvent(\n new CustomEvent('nr-input', {\n detail: { \n value: this.value, \n target: this.input,\n action: 'increment'\n },\n bubbles: true\n })\n );\n }\n private _decrement() {\n this.input.stepDown();\n this.value = this.input.value; // Sync the property\n this.dispatchEvent(\n new CustomEvent('nr-input', {\n detail: { \n value: this.value, \n target: this.input,\n action: 'decrement'\n },\n bubbles: true\n })\n );\n }\n\n private _valueChange(e: Event) {\n const target = e.target as HTMLInputElement;\n this.value = target.value;\n \n this.dispatchEvent(\n new CustomEvent('nr-input', {\n detail: { \n value: this.value, \n target: target,\n originalEvent: e \n },\n bubbles: true\n })\n );\n }\n private handleKeyDown(keyDownEvent: KeyboardEvent) {\n if (keyDownEvent.key === 'Enter') {\n this.dispatchEvent(\n new CustomEvent('nr-enter', {\n detail: {\n target: keyDownEvent.target,\n value: this.value,\n originalEvent: keyDownEvent\n },\n bubbles: true\n })\n );\n }\n }\n\n private _handleIconKeydown(keyDownEvent: KeyboardEvent) {\n if (keyDownEvent.key === 'Enter' || keyDownEvent.key === ' ') {\n keyDownEvent.preventDefault();\n const target = keyDownEvent.target as HTMLElement;\n \n if (target.id === 'copy-icon') {\n this.onCopy();\n } else if (target.id === 'password-icon') {\n this._togglePasswordIcon();\n } else if (target.closest('#number-icons')) {\n if (target.getAttribute('name') === 'plus') {\n this._increment();\n } else if (target.getAttribute('name') === 'minus') {\n this._decrement();\n }\n }\n }\n }\n private async onCopy() {\n try {\n const input = this.shadowRoot!.getElementById('input')! as HTMLInputElement;\n input.select();\n await navigator.clipboard.writeText(input.value);\n \n this.dispatchEvent(new CustomEvent('nr-copy-success', {\n detail: { value: input.value },\n bubbles: true\n }));\n } catch (error) {\n this.dispatchEvent(new CustomEvent('nr-copy-error', {\n detail: { error },\n bubbles: true\n }));\n }\n }\n\n private _getAriaDescribedBy(): string {\n const describedBy: string[] = [];\n \n // Check if helper text slot has content\n const helperSlot = this.shadowRoot?.querySelector('slot[name=\"helper-text\"]');\n if (helperSlot && (helperSlot as HTMLSlotElement).assignedNodes().length > 0) {\n describedBy.push('helper-text');\n }\n \n return describedBy.join(' ') || '';\n }\n\n private _focusEvent(e: Event) {\n this.dispatchEvent(\n new CustomEvent('nr-focus', {\n detail: {\n target: e.target,\n value: this.value\n },\n bubbles: true\n })\n );\n }\n\n _togglePasswordIcon() {\n if (this.inputType === INPUT_TYPE.PASSWORD) {\n this.inputType = INPUT_TYPE.TEXT;\n } else if (this.inputType === INPUT_TYPE.TEXT && this.type === INPUT_TYPE.PASSWORD) {\n this.inputType = INPUT_TYPE.PASSWORD;\n }\n }\n\n override render() {\n return html`\n <slot name=\"label\"></slot>\n <div data-size=${this.size} id=\"input-container\">\n <input\n id=\"input\"\n .disabled=${this.disabled}\n .value=${this.value}\n .placeholder=${this.placeholder}\n .type=\"${this.inputType}\"\n .autocomplete=${this.autocomplete}\n aria-invalid=${this.state === INPUT_STATE.Error ? 'true' : 'false'}\n aria-describedby=${this._getAriaDescribedBy()}\n @input=${this._valueChange}\n @focus=${this._focusEvent}\n @keydown=${this.handleKeyDown}\n />\n ${this.withCopy\n ? html`<hy-icon\n name=\"copy\"\n type=\"regular\"\n id=\"copy-icon\"\n role=\"button\"\n aria-label=\"Copy input value\"\n tabindex=\"0\"\n @click=${!this.disabled ? this.onCopy : nothing}\n @keydown=${this._handleIconKeydown}\n ></hy-icon>`\n : nothing}\n ${choose(this.state, [\n [INPUT_STATE.Default, () => undefined],\n [INPUT_STATE.Warning, () => html`<hy-icon name=\"warning\" id=\"warning-icon\"></hy-icon>`],\n [INPUT_STATE.Error, () => html`<hy-icon name=\"exclamation-circle\" id=\"error-icon\"></hy-icon>`],\n ])}\n ${this.state == INPUT_STATE.Default && this.type == INPUT_TYPE.CALENDAR\n ? html`<hy-icon name=\"calendar\" type=\"regular\" id=\"calendar-icon\"></hy-icon>`\n : nothing}\n ${this.type == INPUT_TYPE.PASSWORD\n ? choose(this.inputType, [\n [\n INPUT_TYPE.TEXT,\n () =>\n html`<hy-icon\n name=\"eye-slash\"\n type=\"regular\"\n id=\"password-icon\"\n role=\"button\"\n aria-label=\"Hide password\"\n tabindex=\"0\"\n @click=${!this.disabled ? this._togglePasswordIcon : nothing}\n @keydown=${this._handleIconKeydown}\n ></hy-icon>`,\n ],\n [\n INPUT_TYPE.PASSWORD,\n () =>\n html`<hy-icon\n name=\"eye\"\n type=\"regular\"\n id=\"password-icon\"\n role=\"button\"\n aria-label=\"Show password\"\n tabindex=\"0\"\n @click=${!this.disabled ? this._togglePasswordIcon : nothing}\n @keydown=${this._handleIconKeydown}\n ></hy-icon>`,\n ],\n ])\n : this.type == INPUT_TYPE.NUMBER\n ? html`\n <div id=\"number-icons\">\n ${this.state != INPUT_STATE.Default ? html`<span id=\"icons-separator\">|</span>` : nothing}\n <hy-icon name=\"minus\" @click=${!this.disabled ? this._decrement : nothing}></hy-icon>\n <span id=\"icons-separator\">|</span>\n <hy-icon name=\"plus\" @click=${!this.disabled ? this._increment : nothing}></hy-icon>\n </div>\n `\n : nothing}\n </div>\n <slot name=\"helper-text\"></slot>\n `;\n }\n\n static override styles = styles;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nr-input': NrInputElement;\n }\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n 'nr-input':\n | React.DetailedHTMLProps<React.HTMLAttributes<NrInputElement>, NrInputElement>\n | Partial<NrInputElement>;\n }\n }\n}"]}
1
+ {"version":3,"file":"input.component.js","sourceRoot":"","sources":["../../../src/components/input/input.component.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD;;;;GAIG;;;;;;;;;;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ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Q,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;iDACvB;AAGlB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;iDACN;AAGnB;IADC,KAAK,EAAE;iDACiB;AAGzB;IADC,KAAK,EAAE;sDACe;AAGvB;IADC,KAAK,EAAE;qDACc;AAGtB;IADC,KAAK,EAAE;+CACQ;AAGhB;IADC,KAAK,CAAC,QAAQ,CAAC;6CACS;AA/Dd,cAAc;IAD1B,aAAa,CAAC,UAAU,CAAC;GACb,cAAc,CA4oB1B;SA5oBY,cAAc","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * @license\n * Copyright 2023 Google Laabidi Aymen\n * SPDX-License-Identifier: MIT\n */\n\nimport { LitElement, PropertyValues, html } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { styles } from './input.style.js';\nimport { INPUT_TYPE, INPUT_STATE, INPUT_SIZE, INPUT_VARIANT, EMPTY_STRING, FocusOptions, BlurOptions, FocusChangeEvent } from './input.types.js';\nimport { NuralyUIBaseMixin } from '../../shared/base-mixin.js';\nimport { InputValidationUtils } from './utils/input-validation.utils.js';\nimport { InputRenderUtils } from './utils/input-renderers.js';\nimport '../icon/icon.component.js';\n\n@customElement('nr-input')\nexport class NrInputElement extends NuralyUIBaseMixin(LitElement) {\n\n @property({type: Boolean, reflect: true})\n disabled = false;\n\n @property({type: Boolean, reflect: true})\n readonly = false;\n\n @property({type: String, reflect: true})\n state = INPUT_STATE.Default;\n\n @property({type: String})\n value = EMPTY_STRING;\n\n @property({type: String})\n size = INPUT_SIZE.Medium;\n\n @property({type: String, reflect: true})\n variant = INPUT_VARIANT.Underlined;\n\n @property({reflect: true})\n type = INPUT_TYPE.TEXT;\n\n @property({type: String})\n step?: string;\n\n @property({type: String})\n min?: string;\n\n @property({type: String})\n max?: string;\n\n @property({type: String})\n placeholder = EMPTY_STRING;\n\n @property({type: String})\n autocomplete = 'off';\n\n @property({type: Boolean, reflect: true})\n withCopy = false;\n\n @property({type: Boolean, reflect: true})\n allowClear = false;\n\n @property({type: Boolean, reflect: true})\n showCount = false;\n\n @property({type: Number})\n maxLength?: number;\n\n @state()\n inputType = EMPTY_STRING;\n\n @state()\n hasAddonBefore = false;\n\n @state()\n hasAddonAfter = false;\n\n @state()\n focused = false;\n\n @query('#input')\n input!: HTMLInputElement;\n\n /**\n * Get the character count display text\n */\n get characterCountDisplay(): string {\n const currentLength = this.value.length;\n if (this.maxLength) {\n return `${currentLength}/${this.maxLength}`;\n }\n return `${currentLength}`;\n }\n\n /**\n * Check if character count is over the limit\n */\n get isOverCharacterLimit(): boolean {\n return this.maxLength ? this.value.length > this.maxLength : false;\n }\n\n /**\n * Required components that must be registered for this component to work properly\n */\n override requiredComponents = ['hy-icon'];\n\n /**\n * Check for required dependencies when component is connected to DOM\n */\n override connectedCallback() {\n super.connectedCallback();\n this.validateDependencies();\n }\n\n override willUpdate(_changedProperties: PropertyValues): void {\n if (_changedProperties.has('type')) {\n this.inputType = this.type;\n if (this.inputType === INPUT_TYPE.NUMBER && this.min && !this.value) {\n this.value = this.min;\n }\n }\n \n // Validate numeric properties when they change\n if (_changedProperties.has('type') || \n _changedProperties.has('min') || \n _changedProperties.has('max') || \n _changedProperties.has('step')) {\n InputValidationUtils.validateNumericProperties(this.type, this.min, this.max, this.step);\n }\n }\n\n override updated(_changedProperties: PropertyValues): void {\n if (_changedProperties.has('step') || _changedProperties.has('min') || _changedProperties.has('max') || _changedProperties.has('maxLength')) {\n const input = this.input;\n if (input) {\n if (this.step) input.setAttribute('step', this.step);\n else input.removeAttribute('step');\n \n if (this.min) input.setAttribute('min', this.min);\n else input.removeAttribute('min');\n \n if (this.max) input.setAttribute('max', this.max);\n else input.removeAttribute('max');\n\n if (this.maxLength) input.setAttribute('maxlength', this.maxLength.toString());\n else input.removeAttribute('maxlength');\n }\n }\n }\n\n override firstUpdated(): void {\n this._checkInitialSlotContent();\n }\n\n /**\n * Check initial slot content on first render\n */\n private _checkInitialSlotContent(): void {\n // Check for addon-before content\n const addonBeforeElements = this.querySelectorAll('[slot=\"addon-before\"]');\n this.hasAddonBefore = addonBeforeElements.length > 0;\n\n // Check for addon-after content \n const addonAfterElements = this.querySelectorAll('[slot=\"addon-after\"]');\n this.hasAddonAfter = addonAfterElements.length > 0;\n }\n\n /**\n * Handle slot changes to determine addon visibility\n */\n private _handleSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n const slotName = slot.name;\n \n if (slotName === 'addon-before') {\n this.hasAddonBefore = slot.assignedElements().length > 0;\n } else if (slotName === 'addon-after') {\n this.hasAddonAfter = slot.assignedElements().length > 0;\n }\n }\n\n // ========================================\n // FOCUS MANAGEMENT METHODS\n // ========================================\n\n /**\n * Focus the input with advanced options\n */\n override focus(options?: FocusOptions): void {\n if (!this.input) return;\n\n const focusOptions: FocusOptions = { preventScroll: false, ...options };\n \n // Focus the input element\n this.input.focus({ preventScroll: focusOptions.preventScroll });\n\n // Handle cursor positioning\n if (focusOptions.cursor !== undefined) {\n this.setCursorPosition(focusOptions.cursor);\n }\n\n // Handle text selection\n if (focusOptions.select) {\n this.selectAll();\n }\n }\n\n /**\n * Blur the input with advanced options\n */\n override blur(options?: BlurOptions): void {\n if (!this.input) return;\n\n const currentPosition = this.getCursorPosition();\n \n this.input.blur();\n\n // Restore cursor position if requested\n if (options?.restoreCursor && currentPosition !== -1) {\n // We'll restore it on next focus\n this.input.dataset.restoreCursor = currentPosition.toString();\n }\n }\n\n /**\n * Select all text in the input\n */\n selectAll(): void {\n if (!this.input) return;\n \n // Ensure the input is focused first\n if (document.activeElement !== this.input) {\n this.input.focus();\n }\n \n // Wait for next frame to ensure focus is complete\n requestAnimationFrame(() => {\n if (!this.input) return;\n this.input.select();\n });\n }\n\n /**\n * Select a range of text in the input\n */\n selectRange(start: number, end: number): void {\n if (!this.input) return;\n \n // Ensure the input is focused first\n if (document.activeElement !== this.input) {\n this.input.focus();\n }\n \n // Wait for next frame to ensure focus is complete\n requestAnimationFrame(() => {\n if (!this.input) return;\n \n const maxLength = this.input.value.length;\n const validStart = Math.max(0, Math.min(start, maxLength));\n const validEnd = Math.max(validStart, Math.min(end, maxLength));\n \n this.input.setSelectionRange(validStart, validEnd);\n });\n }\n\n /**\n * Get the current cursor position\n */\n getCursorPosition(): number {\n if (!this.input) return -1;\n return this.input.selectionStart || 0;\n }\n\n /**\n * Set the cursor position\n */\n setCursorPosition(position: number | 'start' | 'end' | 'all'): void {\n if (!this.input) return;\n \n // Ensure the input is focused first\n if (document.activeElement !== this.input) {\n this.input.focus();\n }\n \n requestAnimationFrame(() => {\n if (!this.input) return;\n\n let pos: number;\n const valueLength = this.value.length;\n\n switch (position) {\n case 'start':\n pos = 0;\n break;\n case 'end':\n pos = valueLength;\n break;\n case 'all':\n this.selectAll();\n return;\n default:\n pos = typeof position === 'number' ? Math.min(Math.max(0, position), valueLength) : 0;\n }\n\n this.input.setSelectionRange(pos, pos);\n });\n }\n\n /**\n * Get the currently selected text\n */\n getSelectedText(): string {\n if (!this.input) return '';\n const start = this.input.selectionStart || 0;\n const end = this.input.selectionEnd || 0;\n return this.value.substring(start, end);\n }\n\n /**\n * Check if the input is currently focused\n */\n isFocused(): boolean {\n return this.focused && document.activeElement === this.input;\n }\n\n // ========================================\n // EVENT HANDLING METHODS\n // ========================================\n\n /**\n * Centralized event dispatcher to ensure consistent event structure\n */\n private _dispatchInputEvent(eventName: string, detail: any): void {\n this.dispatchEvent(\n new CustomEvent(eventName, {\n detail,\n bubbles: true\n })\n );\n }\n\n private _handleKeyDown(keyDownEvent: KeyboardEvent) {\n // Prevent all key input when readonly\n if (this.readonly) {\n const allowedReadonlyKeys = [\n 'Tab', 'Escape', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown',\n 'Home', 'End', 'PageUp', 'PageDown'\n ];\n \n if (keyDownEvent.ctrlKey || keyDownEvent.metaKey) {\n const allowedCombinations = ['KeyA', 'KeyC'];\n if (allowedCombinations.includes(keyDownEvent.code)) {\n return;\n }\n }\n \n if (!allowedReadonlyKeys.includes(keyDownEvent.key)) {\n keyDownEvent.preventDefault();\n return;\n }\n }\n\n // Handle Enter key\n if (keyDownEvent.key === 'Enter') {\n this._dispatchInputEvent('nr-enter', {\n target: keyDownEvent.target,\n value: this.value,\n originalEvent: keyDownEvent\n });\n return;\n }\n\n // Prevent non-numeric input for number type\n if (this.type === INPUT_TYPE.NUMBER) {\n InputValidationUtils.preventNonNumericInput(keyDownEvent, this.min);\n \n if (keyDownEvent.defaultPrevented) {\n this._dispatchInputEvent('nr-invalid-key', {\n key: keyDownEvent.key,\n target: keyDownEvent.target,\n value: this.value,\n originalEvent: keyDownEvent\n });\n }\n }\n }\n\n private _valueChange(e: Event) {\n if (this.readonly) {\n e.preventDefault();\n return;\n }\n\n const target = e.target as HTMLInputElement;\n const newValue = target.value;\n \n // Check character limit\n if (this.maxLength && newValue.length > this.maxLength) {\n this._dispatchInputEvent('nr-character-limit-exceeded', {\n value: newValue,\n target: target,\n limit: this.maxLength,\n originalEvent: e\n });\n // Note: HTML maxlength attribute usually prevents this, but we dispatch event for awareness\n }\n \n if (this.type === INPUT_TYPE.NUMBER && newValue) {\n const validation = InputValidationUtils.validateNumericValue(newValue, this.min, this.max);\n \n if (!validation.isValid) {\n console.warn(validation.warnings[0]);\n this._dispatchInputEvent('nr-validation-error', {\n value: newValue,\n target: target,\n error: validation.warnings[0],\n originalEvent: e\n });\n return;\n }\n \n validation.warnings.forEach(warning => console.warn(warning));\n }\n \n this.value = newValue;\n this._dispatchInputEvent('nr-input', {\n value: this.value, \n target: target,\n originalEvent: e \n });\n }\n\n private _focusEvent(e: Event) {\n this.focused = true;\n \n // Handle cursor restoration if requested\n const input = e.target as HTMLInputElement;\n if (input.dataset.restoreCursor) {\n const position = parseInt(input.dataset.restoreCursor, 10);\n this.setCursorPosition(position);\n delete input.dataset.restoreCursor;\n }\n \n const focusDetail: FocusChangeEvent = {\n focused: true,\n cursorPosition: this.getCursorPosition(),\n selectedText: this.getSelectedText()\n };\n \n this._dispatchInputEvent('nr-focus', {\n target: e.target,\n value: this.value,\n ...focusDetail\n });\n \n this._dispatchInputEvent('nr-focus-change', focusDetail);\n }\n\n private _blurEvent(e: Event) {\n this.focused = false;\n \n const focusDetail: FocusChangeEvent = {\n focused: false,\n cursorPosition: this.getCursorPosition(),\n selectedText: this.getSelectedText()\n };\n \n this._dispatchInputEvent('nr-blur', {\n target: e.target,\n value: this.value,\n ...focusDetail\n });\n \n this._dispatchInputEvent('nr-focus-change', focusDetail);\n }\n\n private _handleIconKeydown(keyDownEvent: KeyboardEvent) {\n if (keyDownEvent.key === 'Enter' || keyDownEvent.key === ' ') {\n keyDownEvent.preventDefault();\n const target = keyDownEvent.target as HTMLElement;\n \n if (target.id === 'copy-icon') {\n this._onCopy();\n } else if (target.id === 'clear-icon') {\n this._onClear();\n } else if (target.id === 'password-icon') {\n this._togglePasswordIcon();\n } else if (target.closest('#number-icons')) {\n if (target.getAttribute('name') === 'plus') {\n this._increment();\n } else if (target.getAttribute('name') === 'minus') {\n this._decrement();\n }\n }\n }\n }\n\n private async _onCopy() {\n try {\n const input = this.shadowRoot!.getElementById('input')! as HTMLInputElement;\n input.select();\n await navigator.clipboard.writeText(input.value);\n \n this._dispatchInputEvent('nr-copy-success', { value: input.value });\n } catch (error) {\n this._dispatchInputEvent('nr-copy-error', { error });\n }\n }\n\n private _onClear() {\n if (this.disabled || this.readonly) {\n return;\n }\n\n const previousValue = this.value;\n this.value = EMPTY_STRING;\n \n // Update the input element value\n if (this.input) {\n this.input.value = EMPTY_STRING;\n }\n\n this._dispatchInputEvent('nr-clear', {\n previousValue,\n target: this.input\n });\n\n // Also dispatch input event for consistency\n this._dispatchInputEvent('nr-input', {\n value: this.value,\n target: this.input,\n action: 'clear'\n });\n }\n\n // ========================================\n // OPERATION METHODS\n // ========================================\n\n private _increment() {\n try {\n this.input.stepUp();\n this.value = this.input.value;\n this._dispatchInputEvent('nr-input', {\n value: this.value, \n target: this.input,\n action: 'increment'\n });\n } catch (error) {\n console.warn('Failed to increment value:', error);\n this._dispatchInputEvent('nr-increment-error', {\n error,\n value: this.value,\n target: this.input\n });\n }\n }\n\n private _decrement() {\n try {\n this.input.stepDown();\n this.value = this.input.value;\n this._dispatchInputEvent('nr-input', {\n value: this.value, \n target: this.input,\n action: 'decrement'\n });\n } catch (error) {\n console.warn('Failed to decrement value:', error);\n this._dispatchInputEvent('nr-decrement-error', {\n error,\n value: this.value,\n target: this.input\n });\n }\n }\n\n private _togglePasswordIcon() {\n if (this.inputType === INPUT_TYPE.PASSWORD) {\n this.inputType = INPUT_TYPE.TEXT;\n } else if (this.inputType === INPUT_TYPE.TEXT && this.type === INPUT_TYPE.PASSWORD) {\n this.inputType = INPUT_TYPE.PASSWORD;\n }\n }\n\n private _getAriaDescribedBy(): string {\n const describedBy: string[] = [];\n \n const helperSlot = this.shadowRoot?.querySelector('slot[name=\"helper-text\"]');\n if (helperSlot && (helperSlot as HTMLSlotElement).assignedNodes().length > 0) {\n describedBy.push('helper-text');\n }\n \n return describedBy.join(' ') || '';\n }\n\n // ========================================\n // RENDER METHODS\n // ========================================\n\n override render() {\n return html`\n <slot name=\"label\"></slot>\n <div class=\"input-wrapper\" data-theme=\"${this.currentTheme}\">\n ${InputRenderUtils.renderAddonBefore(this.hasAddonBefore, (e: Event) => this._handleSlotChange(e))}\n <div data-size=${this.size} id=\"input-container\">\n ${InputRenderUtils.renderPrefix()}\n <input\n id=\"input\"\n .disabled=${this.disabled}\n .readOnly=${this.readonly}\n .value=${this.value}\n .placeholder=${this.placeholder}\n .type=\"${this.inputType}\"\n .autocomplete=${this.autocomplete}\n aria-invalid=${this.state === INPUT_STATE.Error ? 'true' : 'false'}\n aria-describedby=${this._getAriaDescribedBy()}\n @input=${this._valueChange}\n @focus=${this._focusEvent}\n @blur=${this._blurEvent}\n @keydown=${this._handleKeyDown}\n />\n ${InputRenderUtils.renderSuffix()}\n ${InputRenderUtils.renderCopyIcon(\n this.withCopy,\n this.disabled,\n this.readonly,\n () => this._onCopy(),\n (e: KeyboardEvent) => this._handleIconKeydown(e)\n )}\n ${InputRenderUtils.renderClearIcon(\n this.allowClear,\n this.value,\n this.disabled,\n this.readonly,\n () => this._onClear(),\n (e: KeyboardEvent) => this._handleIconKeydown(e)\n )}\n ${InputRenderUtils.renderStateIcon(this.state)}\n ${InputRenderUtils.renderCalendarIcon(this.state, this.type)}\n ${InputRenderUtils.renderPasswordIcon(\n this.type,\n this.inputType,\n this.disabled,\n this.readonly,\n () => this._togglePasswordIcon(),\n (e: KeyboardEvent) => this._handleIconKeydown(e)\n )}\n ${InputRenderUtils.renderNumberIcons(\n this.type,\n this.state,\n this.disabled,\n this.readonly,\n () => this._increment(),\n () => this._decrement(),\n (e: KeyboardEvent) => this._handleIconKeydown(e)\n )}\n </div>\n ${InputRenderUtils.renderAddonAfter(this.hasAddonAfter, (e: Event) => this._handleSlotChange(e))}\n </div>\n <slot name=\"helper-text\"></slot>\n ${this.showCount ? html`\n <div class=\"character-count\" ?data-over-limit=${this.isOverCharacterLimit}>\n ${this.characterCountDisplay}\n </div>\n ` : ''}\n `;\n }\n\n static override styles = styles;\n}\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"input.style.d.ts","sourceRoot":"","sources":["../../../src/components/input/input.style.ts"],"names":[],"mappings":"AA0VA,eAAO,MAAM,MAAM,2BAA+C,CAAC"}
1
+ {"version":3,"file":"input.style.d.ts","sourceRoot":"","sources":["../../../src/components/input/input.style.ts"],"names":[],"mappings":"AA8jBA,eAAO,MAAM,MAAM,2BAA+C,CAAC"}
package/input.style.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { css } from 'lit';
2
- import { styleVariables } from './input.style.variable..js';
2
+ import { styleVariables } from './input.style.variable.js';
3
3
  /**
4
4
  * Input component styles for the Hybrid UI Library
5
5
  *
@@ -27,22 +27,29 @@ const inputStyle = css `
27
27
  }
28
28
 
29
29
  /*
30
- * Base input container and input element styles
30
+ * Base input wrapper and input element styles
31
+ * Background applied to wrapper to cover entire container including addons
31
32
  * Uses CSS custom properties with fallbacks for comprehensive theming support
32
33
  * Properties follow the pattern: --hybrid-input-{property}, --hybrid-input-local-{property}
33
34
  */
34
- :host > #input-container,
35
- #input-container > input {
35
+ .input-wrapper {
36
36
  background-color: var(--hybrid-input-background-color, var(--hybrid-input-local-background-color));
37
37
  }
38
38
 
39
+ #input-container > input {
40
+ background-color: transparent;
41
+ }
42
+
39
43
  /*
40
- * Disabled state styles for container and input
44
+ * Disabled state styles for wrapper and input
41
45
  * Applied when input is disabled - removes interactivity and applies muted colors
42
46
  */
43
- :host([disabled]) > #input-container,
44
- :host([disabled]) > #input-container > input {
47
+ :host([disabled]) .input-wrapper {
45
48
  background-color: var(--hybrid-input-disabled-background-color, var(--hybrid-input-local-disabled-background-color));
49
+ }
50
+
51
+ :host([disabled]) #input-container > input {
52
+ background-color: transparent;
46
53
  cursor: not-allowed;
47
54
  }
48
55
 
@@ -107,6 +114,13 @@ const inputStyle = css `
107
114
  cursor: pointer;
108
115
  }
109
116
 
117
+ /* Clear functionality icon */
118
+ #clear-icon {
119
+ padding-right: var(--hybrid-input-clear-icon-padding-right, var(--hybrid-input-local-clear-icon-padding-right));
120
+ --hybrid-icon-color: var(--hybrid-input-clear-icon-color, var(--hybrid-input-local-clear-icon-color));
121
+ cursor: pointer;
122
+ }
123
+
110
124
  /*
111
125
  * Number input increment/decrement icons container
112
126
  * Positioned absolutely for overlay on input
@@ -150,14 +164,16 @@ const inputStyle = css `
150
164
  :host([disabled]) #warning-icon,
151
165
  :host([disabled]) #number-icons,
152
166
  :host([disabled]) #calendar-icon,
153
- :host([disabled]) #copy-icon {
167
+ :host([disabled]) #copy-icon,
168
+ :host([disabled]) #clear-icon {
154
169
  opacity: var(--hybrid-input-disabled-icon-opacity, var(--hybrid-input-local-disabled-icon-opacity));
155
170
  }
156
171
 
157
172
  /* Disabled icons cursor override */
158
173
  :host([disabled]) #password-icon,
159
174
  :host([disabled]) #number-icons,
160
- :host([disabled]) #copy-icon {
175
+ :host([disabled]) #copy-icon,
176
+ :host([disabled]) #clear-icon {
161
177
  cursor: not-allowed;
162
178
  }
163
179
 
@@ -165,6 +181,72 @@ const inputStyle = css `
165
181
  * INPUT CONTAINER STYLES
166
182
  * ======================================== */
167
183
 
184
+ /*
185
+ * Input wrapper - contains addons and input container
186
+ * Provides horizontal layout for addon before/after elements
187
+ */
188
+ .input-wrapper {
189
+ display: flex;
190
+ align-items: stretch;
191
+ width: 100%;
192
+ }
193
+
194
+ /*
195
+ * Addon before element - content before input (outside borders)
196
+ * Styled to visually connect with input
197
+ */
198
+ .input-addon-before {
199
+ background-color: var(--hybrid-input-addon-background-color, var(--hybrid-input-local-addon-background-color));
200
+ border: var(--hybrid-input-border, var(--hybrid-input-local-border));
201
+ border-right: none;
202
+ border-top-left-radius: var(--hybrid-input-border-radius, var(--hybrid-input-local-border-radius));
203
+ border-bottom-left-radius: var(--hybrid-input-border-radius, var(--hybrid-input-local-border-radius));
204
+ padding: var(--hybrid-input-addon-padding, var(--hybrid-input-local-addon-padding));
205
+ display: flex;
206
+ align-items: center;
207
+ color: var(--hybrid-input-addon-color, var(--hybrid-input-local-addon-color));
208
+ font-size: var(--hybrid-input-font-size, var(--hybrid-input-local-font-size));
209
+ white-space: nowrap;
210
+ min-width: 0; /* Allow shrinking */
211
+ flex-shrink: 0; /* Prevent shrinking */
212
+ }
213
+
214
+ /*
215
+ * Addon after element - content after input (outside borders)
216
+ * Styled to visually connect with input
217
+ */
218
+ .input-addon-after {
219
+ background-color: var(--hybrid-input-addon-background-color, var(--hybrid-input-local-addon-background-color));
220
+ border: var(--hybrid-input-border, var(--hybrid-input-local-border));
221
+ border-left: none;
222
+ border-top-right-radius: var(--hybrid-input-border-radius, var(--hybrid-input-local-border-radius));
223
+ border-bottom-right-radius: var(--hybrid-input-border-radius, var(--hybrid-input-local-border-radius));
224
+ padding: var(--hybrid-input-addon-padding, var(--hybrid-input-local-addon-padding));
225
+ display: flex;
226
+ align-items: center;
227
+ color: var(--hybrid-input-addon-color, var(--hybrid-input-local-addon-color));
228
+ font-size: var(--hybrid-input-font-size, var(--hybrid-input-local-font-size));
229
+ white-space: nowrap;
230
+ min-width: 0; /* Allow shrinking */
231
+ flex-shrink: 0; /* Prevent shrinking */
232
+ }
233
+
234
+ /*
235
+ * Input container border radius adjustments when addons are present
236
+ * Removes border radius on sides where addons are attached
237
+ */
238
+ .input-wrapper:has(.input-addon-before) #input-container {
239
+ border-top-left-radius: 0;
240
+ border-bottom-left-radius: 0;
241
+ border-left: none;
242
+ }
243
+
244
+ .input-wrapper:has(.input-addon-after) #input-container {
245
+ border-top-right-radius: 0;
246
+ border-bottom-right-radius: 0;
247
+ border-right: none;
248
+ }
249
+
168
250
  /*
169
251
  * Main input container element
170
252
  * Uses CSS custom properties for comprehensive border and layout control
@@ -186,6 +268,8 @@ const inputStyle = css `
186
268
  /* Layout */
187
269
  display: flex;
188
270
  position: relative;
271
+ flex: 1; /* Take available space in wrapper */
272
+ min-width: 0; /* Allow shrinking below content size */
189
273
  }
190
274
 
191
275
  /*
@@ -200,6 +284,90 @@ const inputStyle = css `
200
284
  opacity: 0.6;
201
285
  }
202
286
 
287
+ /* ========================================
288
+ * INPUT VARIANT STYLES
289
+ * ======================================== */
290
+
291
+ /*
292
+ * Outlined variant - full border around input
293
+ * Default: light border, focus: blue border
294
+ */
295
+ :host([variant='outlined']) #input-container {
296
+ border: var(--hybrid-input-outlined-border, var(--hybrid-input-local-outlined-border));
297
+ border-radius: var(--hybrid-input-outlined-border-radius, var(--hybrid-input-local-outlined-border-radius));
298
+ background-color: var(--hybrid-input-outlined-background, var(--hybrid-input-local-outlined-background));
299
+ }
300
+
301
+ :host([variant='outlined']) .input-wrapper {
302
+ background-color: transparent;
303
+ }
304
+
305
+ :host([variant='outlined']:not([state='error'])) #input-container:focus-within {
306
+ border: var(--hybrid-input-outlined-focus-border, var(--hybrid-input-local-outlined-focus-border));
307
+ }
308
+
309
+ /*
310
+ * Filled variant - background with bottom border only
311
+ * Subtle background with bottom border indication
312
+ */
313
+ :host([variant='filled']) #input-container {
314
+ background-color: var(--hybrid-input-filled-background, var(--hybrid-input-local-filled-background));
315
+ border-radius: var(--hybrid-input-filled-border-radius, var(--hybrid-input-local-filled-border-radius));
316
+ border-bottom: var(--hybrid-input-filled-border-bottom, var(--hybrid-input-local-filled-border-bottom));
317
+ border-top: none;
318
+ border-left: none;
319
+ border-right: none;
320
+ }
321
+
322
+ :host([variant='filled']) .input-wrapper {
323
+ background-color: transparent;
324
+ }
325
+
326
+ :host([variant='filled']:not([state='error'])) #input-container:focus-within {
327
+ border-bottom: var(--hybrid-input-filled-focus-border-bottom, var(--hybrid-input-local-filled-focus-border-bottom));
328
+ border-top: none;
329
+ border-left: none;
330
+ border-right: none;
331
+ }
332
+
333
+ /*
334
+ * Borderless variant - no borders, focus with outline
335
+ * Clean appearance with focus indication via outline
336
+ */
337
+ :host([variant='borderless']) #input-container {
338
+ background-color: var(--hybrid-input-borderless-background, var(--hybrid-input-local-borderless-background));
339
+ border: none;
340
+ border-radius: var(--hybrid-input-borderless-border-radius, var(--hybrid-input-local-borderless-border-radius));
341
+ }
342
+
343
+ :host([variant='borderless']) .input-wrapper {
344
+ background-color: transparent;
345
+ }
346
+
347
+ :host([variant='borderless']:not([state='error'])) #input-container:focus-within {
348
+ outline: var(--hybrid-input-borderless-focus-outline, var(--hybrid-input-local-borderless-focus-outline));
349
+ border: none;
350
+ }
351
+
352
+ /*
353
+ * Underlined variant - bottom border only (default/current behavior)
354
+ * Maintains existing behavior as default
355
+ */
356
+ :host([variant='underlined']) #input-container {
357
+ border-bottom: var(--hybrid-input-underlined-border-bottom, var(--hybrid-input-local-underlined-border-bottom));
358
+ border-top: none;
359
+ border-left: none;
360
+ border-right: none;
361
+ border-radius: 0;
362
+ }
363
+
364
+ :host([variant='underlined']:not([state='error'])) #input-container:focus-within {
365
+ border-bottom: var(--hybrid-input-underlined-focus-border-bottom, var(--hybrid-input-local-underlined-focus-border-bottom));
366
+ border-top: none;
367
+ border-left: none;
368
+ border-right: none;
369
+ }
370
+
203
371
  /* ========================================
204
372
  * INPUT ELEMENT STYLES
205
373
  * ======================================== */
@@ -234,19 +402,26 @@ const inputStyle = css `
234
402
  * ======================================== */
235
403
 
236
404
  /*
237
- * Error state styling
405
+ * Error state styling - works with all variants
238
406
  * Applied when state='error' and not disabled
239
407
  */
240
- :host(:not([disabled])[state='error']) > #input-container {
241
- border: var(--hybrid-input-error-border, var(--hybrid-input-local-error-border));
408
+ :host(:not([disabled])[state='error']) #input-container {
409
+ border: var(--hybrid-input-error-border, var(--hybrid-input-local-error-border)) !important;
410
+ outline: none !important;
242
411
  }
243
412
 
244
- /*
245
- * Focus state styling
246
- * Applied when input receives focus and not in error state
247
- */
248
- :host(:not([state='error'])) > #input-container:focus-within {
249
- border: var(--hybrid-input-focus-border, var(--hybrid-input-local-focus-border));
413
+ /* Override variant-specific error state styling */
414
+ :host([variant='borderless'][state='error']) #input-container {
415
+ border: var(--hybrid-input-error-border, var(--hybrid-input-local-error-border)) !important;
416
+ outline: none !important;
417
+ }
418
+
419
+ :host([variant='underlined'][state='error']) #input-container,
420
+ :host([variant='filled'][state='error']) #input-container {
421
+ border-top: none !important;
422
+ border-left: none !important;
423
+ border-right: none !important;
424
+ border-bottom: var(--hybrid-input-error-border, var(--hybrid-input-local-error-border)) !important;
250
425
  }
251
426
 
252
427
  /*
@@ -306,6 +481,42 @@ const inputStyle = css `
306
481
  :host([disabled]) ::slotted([slot='label']) {
307
482
  color: var(--hybrid-input-disabled-label-color, var(--hybrid-input-local-disabled-label-color));
308
483
  }
484
+
485
+ /*
486
+ * Prefix slot styling
487
+ * Applied to slotted prefix content (icons, text, etc.)
488
+ */
489
+ ::slotted([slot='prefix']) {
490
+ display: flex;
491
+ align-items: center;
492
+ padding-right: var(--hybrid-input-prefix-padding-right, var(--hybrid-input-local-prefix-padding-right));
493
+ color: var(--hybrid-input-prefix-color, var(--hybrid-input-local-prefix-color));
494
+ font-size: var(--hybrid-input-prefix-font-size, var(--hybrid-input-local-prefix-font-size));
495
+ flex-shrink: 0;
496
+ }
497
+
498
+ /*
499
+ * Suffix slot styling
500
+ * Applied to slotted suffix content (icons, text, etc.)
501
+ */
502
+ ::slotted([slot='suffix']) {
503
+ display: flex;
504
+ align-items: center;
505
+ padding-left: var(--hybrid-input-suffix-padding-left, var(--hybrid-input-local-suffix-padding-left));
506
+ color: var(--hybrid-input-suffix-color, var(--hybrid-input-local-suffix-color));
507
+ font-size: var(--hybrid-input-suffix-font-size, var(--hybrid-input-local-suffix-font-size));
508
+ flex-shrink: 0;
509
+ }
510
+
511
+ /*
512
+ * Disabled state for prefix and suffix slots
513
+ * Applied when input is disabled
514
+ */
515
+ :host([disabled]) ::slotted([slot='prefix']),
516
+ :host([disabled]) ::slotted([slot='suffix']) {
517
+ opacity: var(--hybrid-input-disabled-icon-opacity, var(--hybrid-input-local-disabled-icon-opacity));
518
+ color: var(--hybrid-input-disabled-prefix-suffix-color, var(--hybrid-input-local-disabled-prefix-suffix-color));
519
+ }
309
520
  `;
310
521
  /**
311
522
  * Size variation styles for the input component
@@ -339,6 +550,23 @@ const sizeInputStyle = css `
339
550
  padding-left: var(--hybrid-input-small-padding-left, var(--hybrid-input-local-small-padding-left));
340
551
  padding-right: var(--hybrid-input-small-padding-right, var(--hybrid-input-local-small-padding-right));
341
552
  }
553
+
554
+ /*
555
+ * Character count display
556
+ * Shows character count and limit information
557
+ */
558
+ .character-count {
559
+ font-size: var(--hybrid-input-character-count-font-size, var(--hybrid-input-local-character-count-font-size));
560
+ color: var(--hybrid-input-character-count-color, var(--hybrid-input-local-character-count-color));
561
+ text-align: right;
562
+ margin-top: var(--hybrid-input-character-count-margin-top, var(--hybrid-input-local-character-count-margin-top));
563
+ font-family: var(--hybrid-input-font-family, var(--hybrid-input-local-font-family));
564
+ }
565
+
566
+ /* Character count over limit styling */
567
+ .character-count[data-over-limit] {
568
+ color: var(--hybrid-input-character-count-over-limit-color, var(--hybrid-input-local-character-count-over-limit-color));
569
+ }
342
570
  `;
343
571
  export const styles = [inputStyle, sizeInputStyle, styleVariables];
344
572
  //# sourceMappingURL=input.style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.style.js","sourceRoot":"","sources":["../../../src/components/input/input.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D;;;;;;;;;;;;;;GAcG;AAEH,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmSrB,CAAC;AAEF;;;GAGG;AACH,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BzB,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,UAAU,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import { css } from 'lit';\nimport { styleVariables } from './input.style.variable..js';\n\n/**\n * Input component styles for the Hybrid UI Library\n * \n * This file contains all the styling for the nr-input component, including:\n * - Base input styles with CSS custom properties for theming\n * - Multiple input states (default, warning, error)\n * - Size variations (small, medium, large)\n * - Different input types (text, password, number, calendar)\n * - Icon positioning and styling\n * - Focus, disabled, and validation states\n * - Dark theme support\n * \n * The styling system uses CSS custom properties with fallbacks to allow\n * for both global and local customization of input appearance.\n */\n\nconst inputStyle = css`\n /* \n * Host element base styles\n * Container for the input component with flexible layout\n */\n :host {\n display: flex;\n flex-direction: column;\n font-family: var(--hybrid-input-font-family, var(--hybrid-input-local-font-family));\n }\n\n /* \n * Base input container and input element styles\n * Uses CSS custom properties with fallbacks for comprehensive theming support\n * Properties follow the pattern: --hybrid-input-{property}, --hybrid-input-local-{property}\n */\n :host > #input-container,\n #input-container > input {\n background-color: var(--hybrid-input-background-color, var(--hybrid-input-local-background-color));\n }\n\n /* \n * Disabled state styles for container and input\n * Applied when input is disabled - removes interactivity and applies muted colors\n */\n :host([disabled]) > #input-container,\n :host([disabled]) > #input-container > input {\n background-color: var(--hybrid-input-disabled-background-color, var(--hybrid-input-local-disabled-background-color));\n cursor: not-allowed;\n }\n\n /* \n * Icon base styles\n * Common styling for all icons within the input component\n */\n hy-icon {\n display: flex;\n align-items: center;\n }\n\n /* \n * Placeholder styling\n * Customizable placeholder text appearance\n */\n ::placeholder {\n color: var(--hybrid-input-placeholder-color, var(--hybrid-input-local-placeholder-color));\n font-size: var(--hybrid-input-placeholder-font-size, var(--hybrid-input-local-placeholder-font-size));\n font-family: var(--hybrid-input-font-family, var(--hybrid-input-local-font-family));\n }\n\n /* \n * Disabled placeholder styling\n * Applied when input is disabled\n */\n :host([disabled]) ::placeholder {\n color: var(--hybrid-input-disabled-placeholder-color, var(--hybrid-input-local-disabled-placeholder-color));\n }\n\n /* ========================================\n * ICON VARIANTS AND STATES\n * ======================================== */\n\n /* Warning state icon */\n #warning-icon {\n --hybrid-icon-color: var(--hybrid-input-warning-icon-color, var(--hybrid-input-local-warning-icon-color));\n }\n\n /* Error state icon */\n #error-icon {\n --hybrid-icon-color: var(--hybrid-input-error-icon-color, var(--hybrid-input-local-error-icon-color));\n }\n\n /* Calendar input type icon */\n #calendar-icon {\n --hybrid-icon-color: var(--hybrid-input-calendar-icon-color, var(--hybrid-input-local-calendar-icon-color));\n }\n\n /* Password toggle icon */\n #password-icon {\n padding-left: var(--hybrid-input-password-icon-padding-left, var(--hybrid-input-local-password-icon-padding-left));\n padding-right: var(--hybrid-input-password-icon-padding-right, var(--hybrid-input-local-password-icon-padding-right));\n cursor: pointer;\n --hybrid-icon-color: var(--hybrid-input-password-icon-color, var(--hybrid-input-local-password-icon-color));\n }\n\n /* Copy functionality icon */\n #copy-icon {\n padding-right: var(--hybrid-input-copy-icon-padding-right, var(--hybrid-input-local-copy-icon-padding-right));\n --hybrid-icon-color: var(--hybrid-input-copy-icon-color, var(--hybrid-input-local-copy-icon-color));\n cursor: pointer;\n }\n\n /* \n * Number input increment/decrement icons container\n * Positioned absolutely for overlay on input\n */\n #number-icons {\n display: flex;\n justify-content: space-between;\n align-items: center;\n cursor: pointer;\n position: absolute;\n right: 0;\n top: 0;\n height: 100%;\n width: var(--hybrid-input-number-icons-container-width, var(--hybrid-input-local-number-icons-container-width));\n padding-right: var(--hybrid-input-number-icons-container-padding-right, var(--hybrid-input-local-number-icons-container-padding-right));\n }\n\n /* Individual number icons styling */\n #number-icons hy-icon {\n --hybrid-icon-color: var(--hybrid-input-number-icons-color, var(--hybrid-input-local-number-icons-color));\n padding-left: var(--hybrid-input-number-icons-padding-left, var(--hybrid-input-local-number-icons-padding-left));\n padding-right: var(--hybrid-input-number-icons-padding-right, var(--hybrid-input-local-number-icons-padding-right));\n width: var(--hybrid-input-number-icons-width, var(--hybrid-input-local-number-icons-width));\n height: var(--hybrid-input-number-icons-height, var(--hybrid-input-local-number-icons-height));\n }\n\n /* Number icons separator styling */\n #icons-separator {\n color: var(--hybrid-input-number-icons-separator-color, var(--hybrid-input-local-number-icons-separator-color));\n padding-bottom: var(--hybrid-input-number-icons-separator-padding-bottom, var(--hybrid-input-local-number-icons-separator-padding-bottom));\n padding-left: var(--hybrid-input-number-icons-separator-padding-left, var(--hybrid-input-local-number-icons-separator-padding-left));\n padding-right: var(--hybrid-input-number-icons-separator-padding-right, var(--hybrid-input-local-number-icons-separator-padding-right));\n }\n\n /* \n * Disabled state for all icons\n * Applied when input is disabled - reduces opacity and disables interaction\n */\n :host([disabled]) #password-icon,\n :host([disabled]) #error-icon,\n :host([disabled]) #warning-icon,\n :host([disabled]) #number-icons,\n :host([disabled]) #calendar-icon,\n :host([disabled]) #copy-icon {\n opacity: var(--hybrid-input-disabled-icon-opacity, var(--hybrid-input-local-disabled-icon-opacity));\n }\n\n /* Disabled icons cursor override */\n :host([disabled]) #password-icon,\n :host([disabled]) #number-icons,\n :host([disabled]) #copy-icon {\n cursor: not-allowed;\n }\n\n /* ========================================\n * INPUT CONTAINER STYLES\n * ======================================== */\n\n /* \n * Main input container element\n * Uses CSS custom properties for comprehensive border and layout control\n */\n #input-container {\n /* Border properties - individual sides for granular control */\n border-bottom: var(--hybrid-input-border-bottom, var(--hybrid-input-local-border-bottom));\n border-top: var(--hybrid-input-border-top, var(--hybrid-input-local-border-top));\n border-left: var(--hybrid-input-border-left, var(--hybrid-input-local-border-left));\n border-right: var(--hybrid-input-border-right, var(--hybrid-input-local-border-right));\n \n /* Border radius - individual corners for design flexibility */\n border-radius: var(--hybrid-input-border-radius, var(--hybrid-input-local-border-radius)); \n border-top-left-radius: var(--hybrid-input-border-top-left-radius, var(--hybrid-input-local-border-top-left-radius));\n border-top-right-radius: var(--hybrid-input-border-top-right-radius, var(--hybrid-input-local-border-top-right-radius));\n border-bottom-left-radius: var(--hybrid-input-border-bottom-left-radius, var(--hybrid-input-local-border-bottom-left-radius));\n border-bottom-right-radius: var(--hybrid-input-border-bottom-right-radius, var(--hybrid-input-local-border-bottom-right-radius));\n \n /* Layout */\n display: flex;\n position: relative;\n }\n\n /* \n * Disabled container border styles\n * Applied when input is disabled\n */\n :host([disabled]) #input-container {\n border-bottom: var(--hybrid-input-disabled-border-bottom, var(--hybrid-input-local-disabled-border-bottom));\n border-top: var(--hybrid-input-disabled-border-top, var(--hybrid-input-local-disabled-border-top));\n border-left: var(--hybrid-input-disabled-border-left, var(--hybrid-input-local-disabled-border-left));\n border-right: var(--hybrid-input-disabled-border-right, var(--hybrid-input-local-disabled-border-right));\n opacity: 0.6;\n }\n\n /* ========================================\n * INPUT ELEMENT STYLES\n * ======================================== */\n\n /* \n * Base input element styling\n * Full width with no default borders, using container for styling\n */\n input {\n width: 100%;\n border: none;\n outline: none;\n color: var(--hybrid-input-text-color, var(--hybrid-input-local-text-color));\n font-family: var(--hybrid-input-font-family, var(--hybrid-input-local-font-family));\n font-size: var(--hybrid-input-font-size, var(--hybrid-input-local-font-size));\n }\n\n /* Remove default number input spinners */\n /* Chrome, Safari, Edge, Opera */\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n \n /* Firefox */\n input[type='number'] {\n -moz-appearance: textfield;\n }\n\n /* ========================================\n * STATE STYLES\n * ======================================== */\n\n /* \n * Error state styling\n * Applied when state='error' and not disabled\n */\n :host(:not([disabled])[state='error']) > #input-container {\n border: var(--hybrid-input-error-border, var(--hybrid-input-local-error-border));\n }\n\n /* \n * Focus state styling\n * Applied when input receives focus and not in error state\n */\n :host(:not([state='error'])) > #input-container:focus-within {\n border: var(--hybrid-input-focus-border, var(--hybrid-input-local-focus-border));\n }\n\n /* \n * Number input icon positioning adjustments for error/warning states\n * When validation states are present, adjust icon positioning\n */\n :host([state='error']) input[type='number'] ~ #number-icons,\n :host([state='warning']) input[type='number'] ~ #number-icons {\n position: static;\n padding-left: var(--hybrid-input-number-icons-container-padding-left, var(--hybrid-input-local-number-icons-container-padding-left));\n }\n\n /* ========================================\n * SLOTTED CONTENT STYLES\n * ======================================== */\n\n /* \n * Label slot styling\n * Applied to slotted label elements\n */\n ::slotted([slot='label']) {\n color: var(--hybrid-input-label-color, var(--hybrid-input-local-label-color));\n font-size: var(--hybrid-input-label-font-size, var(--hybrid-input-local-label-font-size));\n padding-bottom: var(--hybrid-input-label-padding-bottom, var(--hybrid-input-local-label-padding-bottom));\n }\n\n /* \n * Helper text slot styling\n * Applied to slotted helper text elements\n */\n ::slotted([slot='helper-text']) {\n color: var(--hybrid-input-helper-text-color, var(--hybrid-input-local-helper-text-color));\n font-size: var(--hybrid-input-helper-text-font-size, var(--hybrid-input-local-helper-text-font-size));\n padding-top: var(--hybrid-input-helper-text-padding-top, var(--hybrid-input-local-helper-text-padding-top));\n }\n\n /* \n * State-specific helper text colors\n * Override helper text color based on validation state\n */\n :host([state='error']) ::slotted([slot='helper-text']) {\n color: var(--hybrid-input-error-helper-text-color, var(--hybrid-input-local-error-helper-text-color));\n }\n\n :host([state='warning']) ::slotted([slot='helper-text']) {\n color: var(--hybrid-input-warning-helper-text-color, var(--hybrid-input-local-warning-helper-text-color));\n }\n\n /* \n * Disabled state for slotted content\n * Applied when input is disabled\n */\n :host([disabled]) ::slotted([slot='helper-text']) {\n color: var(--hybrid-input-disabled-helper-text-color, var(--hybrid-input-local-disabled-helper-text-color));\n }\n\n :host([disabled]) ::slotted([slot='label']) {\n color: var(--hybrid-input-disabled-label-color, var(--hybrid-input-local-disabled-label-color));\n }\n`;\n\n/**\n * Size variation styles for the input component\n * Defines padding and spacing for different input sizes\n */\nconst sizeInputStyle = css`\n /* ========================================\n * SIZE VARIATIONS\n * ======================================== */\n\n /* Large input size variant */\n div[data-size='large'] {\n padding-top: var(--hybrid-input-large-padding-top, var(--hybrid-input-local-large-padding-top));\n padding-bottom: var(--hybrid-input-large-padding-bottom, var(--hybrid-input-local-large-padding-bottom));\n padding-left: var(--hybrid-input-large-padding-left, var(--hybrid-input-local-large-padding-left));\n padding-right: var(--hybrid-input-large-padding-right, var(--hybrid-input-local-large-padding-right));\n }\n\n /* Medium input size variant (default) */\n div[data-size='medium'] {\n padding-top: var(--hybrid-input-medium-padding-top, var(--hybrid-input-local-medium-padding-top));\n padding-bottom: var(--hybrid-input-medium-padding-bottom, var(--hybrid-input-local-medium-padding-bottom));\n padding-left: var(--hybrid-input-medium-padding-left, var(--hybrid-input-local-medium-padding-left));\n padding-right: var(--hybrid-input-medium-padding-right, var(--hybrid-input-local-medium-padding-right));\n }\n\n /* Small input size variant */\n div[data-size='small'] {\n padding-top: var(--hybrid-input-small-padding-top, var(--hybrid-input-local-small-padding-top));\n padding-bottom: var(--hybrid-input-small-padding-bottom, var(--hybrid-input-local-small-padding-bottom));\n padding-left: var(--hybrid-input-small-padding-left, var(--hybrid-input-local-small-padding-left));\n padding-right: var(--hybrid-input-small-padding-right, var(--hybrid-input-local-small-padding-right));\n }\n`;\n\nexport const styles = [inputStyle, sizeInputStyle, styleVariables];\n"]}
1
+ {"version":3,"file":"input.style.js","sourceRoot":"","sources":["../../../src/components/input/input.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D;;;;;;;;;;;;;;GAcG;AAEH,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsfrB,CAAC;AAEF;;;GAGG;AACH,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CzB,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,UAAU,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import { css } from 'lit';\nimport { styleVariables } from './input.style.variable.js';\n\n/**\n * Input component styles for the Hybrid UI Library\n * \n * This file contains all the styling for the nr-input component, including:\n * - Base input styles with CSS custom properties for theming\n * - Multiple input states (default, warning, error)\n * - Size variations (small, medium, large)\n * - Different input types (text, password, number, calendar)\n * - Icon positioning and styling\n * - Focus, disabled, and validation states\n * - Dark theme support\n * \n * The styling system uses CSS custom properties with fallbacks to allow\n * for both global and local customization of input appearance.\n */\n\nconst inputStyle = css`\n /* \n * Host element base styles\n * Container for the input component with flexible layout\n */\n :host {\n display: flex;\n flex-direction: column;\n font-family: var(--hybrid-input-font-family, var(--hybrid-input-local-font-family));\n }\n\n /* \n * Base input wrapper and input element styles\n * Background applied to wrapper to cover entire container including addons\n * Uses CSS custom properties with fallbacks for comprehensive theming support\n * Properties follow the pattern: --hybrid-input-{property}, --hybrid-input-local-{property}\n */\n .input-wrapper {\n background-color: var(--hybrid-input-background-color, var(--hybrid-input-local-background-color));\n }\n\n #input-container > input {\n background-color: transparent;\n }\n\n /* \n * Disabled state styles for wrapper and input\n * Applied when input is disabled - removes interactivity and applies muted colors\n */\n :host([disabled]) .input-wrapper {\n background-color: var(--hybrid-input-disabled-background-color, var(--hybrid-input-local-disabled-background-color));\n }\n\n :host([disabled]) #input-container > input {\n background-color: transparent;\n cursor: not-allowed;\n }\n\n /* \n * Icon base styles\n * Common styling for all icons within the input component\n */\n hy-icon {\n display: flex;\n align-items: center;\n }\n\n /* \n * Placeholder styling\n * Customizable placeholder text appearance\n */\n ::placeholder {\n color: var(--hybrid-input-placeholder-color, var(--hybrid-input-local-placeholder-color));\n font-size: var(--hybrid-input-placeholder-font-size, var(--hybrid-input-local-placeholder-font-size));\n font-family: var(--hybrid-input-font-family, var(--hybrid-input-local-font-family));\n }\n\n /* \n * Disabled placeholder styling\n * Applied when input is disabled\n */\n :host([disabled]) ::placeholder {\n color: var(--hybrid-input-disabled-placeholder-color, var(--hybrid-input-local-disabled-placeholder-color));\n }\n\n /* ========================================\n * ICON VARIANTS AND STATES\n * ======================================== */\n\n /* Warning state icon */\n #warning-icon {\n --hybrid-icon-color: var(--hybrid-input-warning-icon-color, var(--hybrid-input-local-warning-icon-color));\n }\n\n /* Error state icon */\n #error-icon {\n --hybrid-icon-color: var(--hybrid-input-error-icon-color, var(--hybrid-input-local-error-icon-color));\n }\n\n /* Calendar input type icon */\n #calendar-icon {\n --hybrid-icon-color: var(--hybrid-input-calendar-icon-color, var(--hybrid-input-local-calendar-icon-color));\n }\n\n /* Password toggle icon */\n #password-icon {\n padding-left: var(--hybrid-input-password-icon-padding-left, var(--hybrid-input-local-password-icon-padding-left));\n padding-right: var(--hybrid-input-password-icon-padding-right, var(--hybrid-input-local-password-icon-padding-right));\n cursor: pointer;\n --hybrid-icon-color: var(--hybrid-input-password-icon-color, var(--hybrid-input-local-password-icon-color));\n }\n\n /* Copy functionality icon */\n #copy-icon {\n padding-right: var(--hybrid-input-copy-icon-padding-right, var(--hybrid-input-local-copy-icon-padding-right));\n --hybrid-icon-color: var(--hybrid-input-copy-icon-color, var(--hybrid-input-local-copy-icon-color));\n cursor: pointer;\n }\n\n /* Clear functionality icon */\n #clear-icon {\n padding-right: var(--hybrid-input-clear-icon-padding-right, var(--hybrid-input-local-clear-icon-padding-right));\n --hybrid-icon-color: var(--hybrid-input-clear-icon-color, var(--hybrid-input-local-clear-icon-color));\n cursor: pointer;\n }\n\n /* \n * Number input increment/decrement icons container\n * Positioned absolutely for overlay on input\n */\n #number-icons {\n display: flex;\n justify-content: space-between;\n align-items: center;\n cursor: pointer;\n position: absolute;\n right: 0;\n top: 0;\n height: 100%;\n width: var(--hybrid-input-number-icons-container-width, var(--hybrid-input-local-number-icons-container-width));\n padding-right: var(--hybrid-input-number-icons-container-padding-right, var(--hybrid-input-local-number-icons-container-padding-right));\n }\n\n /* Individual number icons styling */\n #number-icons hy-icon {\n --hybrid-icon-color: var(--hybrid-input-number-icons-color, var(--hybrid-input-local-number-icons-color));\n padding-left: var(--hybrid-input-number-icons-padding-left, var(--hybrid-input-local-number-icons-padding-left));\n padding-right: var(--hybrid-input-number-icons-padding-right, var(--hybrid-input-local-number-icons-padding-right));\n width: var(--hybrid-input-number-icons-width, var(--hybrid-input-local-number-icons-width));\n height: var(--hybrid-input-number-icons-height, var(--hybrid-input-local-number-icons-height));\n }\n\n /* Number icons separator styling */\n #icons-separator {\n color: var(--hybrid-input-number-icons-separator-color, var(--hybrid-input-local-number-icons-separator-color));\n padding-bottom: var(--hybrid-input-number-icons-separator-padding-bottom, var(--hybrid-input-local-number-icons-separator-padding-bottom));\n padding-left: var(--hybrid-input-number-icons-separator-padding-left, var(--hybrid-input-local-number-icons-separator-padding-left));\n padding-right: var(--hybrid-input-number-icons-separator-padding-right, var(--hybrid-input-local-number-icons-separator-padding-right));\n }\n\n /* \n * Disabled state for all icons\n * Applied when input is disabled - reduces opacity and disables interaction\n */\n :host([disabled]) #password-icon,\n :host([disabled]) #error-icon,\n :host([disabled]) #warning-icon,\n :host([disabled]) #number-icons,\n :host([disabled]) #calendar-icon,\n :host([disabled]) #copy-icon,\n :host([disabled]) #clear-icon {\n opacity: var(--hybrid-input-disabled-icon-opacity, var(--hybrid-input-local-disabled-icon-opacity));\n }\n\n /* Disabled icons cursor override */\n :host([disabled]) #password-icon,\n :host([disabled]) #number-icons,\n :host([disabled]) #copy-icon,\n :host([disabled]) #clear-icon {\n cursor: not-allowed;\n }\n\n /* ========================================\n * INPUT CONTAINER STYLES\n * ======================================== */\n\n /* \n * Input wrapper - contains addons and input container\n * Provides horizontal layout for addon before/after elements\n */\n .input-wrapper {\n display: flex;\n align-items: stretch;\n width: 100%;\n }\n\n /* \n * Addon before element - content before input (outside borders)\n * Styled to visually connect with input\n */\n .input-addon-before {\n background-color: var(--hybrid-input-addon-background-color, var(--hybrid-input-local-addon-background-color));\n border: var(--hybrid-input-border, var(--hybrid-input-local-border));\n border-right: none;\n border-top-left-radius: var(--hybrid-input-border-radius, var(--hybrid-input-local-border-radius));\n border-bottom-left-radius: var(--hybrid-input-border-radius, var(--hybrid-input-local-border-radius));\n padding: var(--hybrid-input-addon-padding, var(--hybrid-input-local-addon-padding));\n display: flex;\n align-items: center;\n color: var(--hybrid-input-addon-color, var(--hybrid-input-local-addon-color));\n font-size: var(--hybrid-input-font-size, var(--hybrid-input-local-font-size));\n white-space: nowrap;\n min-width: 0; /* Allow shrinking */\n flex-shrink: 0; /* Prevent shrinking */\n }\n\n /* \n * Addon after element - content after input (outside borders)\n * Styled to visually connect with input\n */\n .input-addon-after {\n background-color: var(--hybrid-input-addon-background-color, var(--hybrid-input-local-addon-background-color));\n border: var(--hybrid-input-border, var(--hybrid-input-local-border));\n border-left: none;\n border-top-right-radius: var(--hybrid-input-border-radius, var(--hybrid-input-local-border-radius));\n border-bottom-right-radius: var(--hybrid-input-border-radius, var(--hybrid-input-local-border-radius));\n padding: var(--hybrid-input-addon-padding, var(--hybrid-input-local-addon-padding));\n display: flex;\n align-items: center;\n color: var(--hybrid-input-addon-color, var(--hybrid-input-local-addon-color));\n font-size: var(--hybrid-input-font-size, var(--hybrid-input-local-font-size));\n white-space: nowrap;\n min-width: 0; /* Allow shrinking */\n flex-shrink: 0; /* Prevent shrinking */\n }\n\n /* \n * Input container border radius adjustments when addons are present\n * Removes border radius on sides where addons are attached\n */\n .input-wrapper:has(.input-addon-before) #input-container {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-left: none;\n }\n\n .input-wrapper:has(.input-addon-after) #input-container {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: none;\n }\n\n /* \n * Main input container element\n * Uses CSS custom properties for comprehensive border and layout control\n */\n #input-container {\n /* Border properties - individual sides for granular control */\n border-bottom: var(--hybrid-input-border-bottom, var(--hybrid-input-local-border-bottom));\n border-top: var(--hybrid-input-border-top, var(--hybrid-input-local-border-top));\n border-left: var(--hybrid-input-border-left, var(--hybrid-input-local-border-left));\n border-right: var(--hybrid-input-border-right, var(--hybrid-input-local-border-right));\n \n /* Border radius - individual corners for design flexibility */\n border-radius: var(--hybrid-input-border-radius, var(--hybrid-input-local-border-radius)); \n border-top-left-radius: var(--hybrid-input-border-top-left-radius, var(--hybrid-input-local-border-top-left-radius));\n border-top-right-radius: var(--hybrid-input-border-top-right-radius, var(--hybrid-input-local-border-top-right-radius));\n border-bottom-left-radius: var(--hybrid-input-border-bottom-left-radius, var(--hybrid-input-local-border-bottom-left-radius));\n border-bottom-right-radius: var(--hybrid-input-border-bottom-right-radius, var(--hybrid-input-local-border-bottom-right-radius));\n \n /* Layout */\n display: flex;\n position: relative;\n flex: 1; /* Take available space in wrapper */\n min-width: 0; /* Allow shrinking below content size */\n }\n\n /* \n * Disabled container border styles\n * Applied when input is disabled\n */\n :host([disabled]) #input-container {\n border-bottom: var(--hybrid-input-disabled-border-bottom, var(--hybrid-input-local-disabled-border-bottom));\n border-top: var(--hybrid-input-disabled-border-top, var(--hybrid-input-local-disabled-border-top));\n border-left: var(--hybrid-input-disabled-border-left, var(--hybrid-input-local-disabled-border-left));\n border-right: var(--hybrid-input-disabled-border-right, var(--hybrid-input-local-disabled-border-right));\n opacity: 0.6;\n }\n\n /* ========================================\n * INPUT VARIANT STYLES\n * ======================================== */\n\n /* \n * Outlined variant - full border around input\n * Default: light border, focus: blue border\n */\n :host([variant='outlined']) #input-container {\n border: var(--hybrid-input-outlined-border, var(--hybrid-input-local-outlined-border));\n border-radius: var(--hybrid-input-outlined-border-radius, var(--hybrid-input-local-outlined-border-radius));\n background-color: var(--hybrid-input-outlined-background, var(--hybrid-input-local-outlined-background));\n }\n\n :host([variant='outlined']) .input-wrapper {\n background-color: transparent;\n }\n\n :host([variant='outlined']:not([state='error'])) #input-container:focus-within {\n border: var(--hybrid-input-outlined-focus-border, var(--hybrid-input-local-outlined-focus-border));\n }\n\n /* \n * Filled variant - background with bottom border only\n * Subtle background with bottom border indication\n */\n :host([variant='filled']) #input-container {\n background-color: var(--hybrid-input-filled-background, var(--hybrid-input-local-filled-background));\n border-radius: var(--hybrid-input-filled-border-radius, var(--hybrid-input-local-filled-border-radius));\n border-bottom: var(--hybrid-input-filled-border-bottom, var(--hybrid-input-local-filled-border-bottom));\n border-top: none;\n border-left: none;\n border-right: none;\n }\n\n :host([variant='filled']) .input-wrapper {\n background-color: transparent;\n }\n\n :host([variant='filled']:not([state='error'])) #input-container:focus-within {\n border-bottom: var(--hybrid-input-filled-focus-border-bottom, var(--hybrid-input-local-filled-focus-border-bottom));\n border-top: none;\n border-left: none;\n border-right: none;\n }\n\n /* \n * Borderless variant - no borders, focus with outline\n * Clean appearance with focus indication via outline\n */\n :host([variant='borderless']) #input-container {\n background-color: var(--hybrid-input-borderless-background, var(--hybrid-input-local-borderless-background));\n border: none;\n border-radius: var(--hybrid-input-borderless-border-radius, var(--hybrid-input-local-borderless-border-radius));\n }\n\n :host([variant='borderless']) .input-wrapper {\n background-color: transparent;\n }\n\n :host([variant='borderless']:not([state='error'])) #input-container:focus-within {\n outline: var(--hybrid-input-borderless-focus-outline, var(--hybrid-input-local-borderless-focus-outline));\n border: none;\n }\n\n /* \n * Underlined variant - bottom border only (default/current behavior)\n * Maintains existing behavior as default\n */\n :host([variant='underlined']) #input-container {\n border-bottom: var(--hybrid-input-underlined-border-bottom, var(--hybrid-input-local-underlined-border-bottom));\n border-top: none;\n border-left: none;\n border-right: none;\n border-radius: 0;\n }\n\n :host([variant='underlined']:not([state='error'])) #input-container:focus-within {\n border-bottom: var(--hybrid-input-underlined-focus-border-bottom, var(--hybrid-input-local-underlined-focus-border-bottom));\n border-top: none;\n border-left: none;\n border-right: none;\n }\n\n /* ========================================\n * INPUT ELEMENT STYLES\n * ======================================== */\n\n /* \n * Base input element styling\n * Full width with no default borders, using container for styling\n */\n input {\n width: 100%;\n border: none;\n outline: none;\n color: var(--hybrid-input-text-color, var(--hybrid-input-local-text-color));\n font-family: var(--hybrid-input-font-family, var(--hybrid-input-local-font-family));\n font-size: var(--hybrid-input-font-size, var(--hybrid-input-local-font-size));\n }\n\n /* Remove default number input spinners */\n /* Chrome, Safari, Edge, Opera */\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n \n /* Firefox */\n input[type='number'] {\n -moz-appearance: textfield;\n }\n\n /* ========================================\n * STATE STYLES\n * ======================================== */\n\n /* \n * Error state styling - works with all variants\n * Applied when state='error' and not disabled\n */\n :host(:not([disabled])[state='error']) #input-container {\n border: var(--hybrid-input-error-border, var(--hybrid-input-local-error-border)) !important;\n outline: none !important;\n }\n\n /* Override variant-specific error state styling */\n :host([variant='borderless'][state='error']) #input-container {\n border: var(--hybrid-input-error-border, var(--hybrid-input-local-error-border)) !important;\n outline: none !important;\n }\n\n :host([variant='underlined'][state='error']) #input-container,\n :host([variant='filled'][state='error']) #input-container {\n border-top: none !important;\n border-left: none !important;\n border-right: none !important;\n border-bottom: var(--hybrid-input-error-border, var(--hybrid-input-local-error-border)) !important;\n }\n\n /* \n * Number input icon positioning adjustments for error/warning states\n * When validation states are present, adjust icon positioning\n */\n :host([state='error']) input[type='number'] ~ #number-icons,\n :host([state='warning']) input[type='number'] ~ #number-icons {\n position: static;\n padding-left: var(--hybrid-input-number-icons-container-padding-left, var(--hybrid-input-local-number-icons-container-padding-left));\n }\n\n /* ========================================\n * SLOTTED CONTENT STYLES\n * ======================================== */\n\n /* \n * Label slot styling\n * Applied to slotted label elements\n */\n ::slotted([slot='label']) {\n color: var(--hybrid-input-label-color, var(--hybrid-input-local-label-color));\n font-size: var(--hybrid-input-label-font-size, var(--hybrid-input-local-label-font-size));\n padding-bottom: var(--hybrid-input-label-padding-bottom, var(--hybrid-input-local-label-padding-bottom));\n }\n\n /* \n * Helper text slot styling\n * Applied to slotted helper text elements\n */\n ::slotted([slot='helper-text']) {\n color: var(--hybrid-input-helper-text-color, var(--hybrid-input-local-helper-text-color));\n font-size: var(--hybrid-input-helper-text-font-size, var(--hybrid-input-local-helper-text-font-size));\n padding-top: var(--hybrid-input-helper-text-padding-top, var(--hybrid-input-local-helper-text-padding-top));\n }\n\n /* \n * State-specific helper text colors\n * Override helper text color based on validation state\n */\n :host([state='error']) ::slotted([slot='helper-text']) {\n color: var(--hybrid-input-error-helper-text-color, var(--hybrid-input-local-error-helper-text-color));\n }\n\n :host([state='warning']) ::slotted([slot='helper-text']) {\n color: var(--hybrid-input-warning-helper-text-color, var(--hybrid-input-local-warning-helper-text-color));\n }\n\n /* \n * Disabled state for slotted content\n * Applied when input is disabled\n */\n :host([disabled]) ::slotted([slot='helper-text']) {\n color: var(--hybrid-input-disabled-helper-text-color, var(--hybrid-input-local-disabled-helper-text-color));\n }\n\n :host([disabled]) ::slotted([slot='label']) {\n color: var(--hybrid-input-disabled-label-color, var(--hybrid-input-local-disabled-label-color));\n }\n\n /* \n * Prefix slot styling\n * Applied to slotted prefix content (icons, text, etc.)\n */\n ::slotted([slot='prefix']) {\n display: flex;\n align-items: center;\n padding-right: var(--hybrid-input-prefix-padding-right, var(--hybrid-input-local-prefix-padding-right));\n color: var(--hybrid-input-prefix-color, var(--hybrid-input-local-prefix-color));\n font-size: var(--hybrid-input-prefix-font-size, var(--hybrid-input-local-prefix-font-size));\n flex-shrink: 0;\n }\n\n /* \n * Suffix slot styling\n * Applied to slotted suffix content (icons, text, etc.)\n */\n ::slotted([slot='suffix']) {\n display: flex;\n align-items: center;\n padding-left: var(--hybrid-input-suffix-padding-left, var(--hybrid-input-local-suffix-padding-left));\n color: var(--hybrid-input-suffix-color, var(--hybrid-input-local-suffix-color));\n font-size: var(--hybrid-input-suffix-font-size, var(--hybrid-input-local-suffix-font-size));\n flex-shrink: 0;\n }\n\n /* \n * Disabled state for prefix and suffix slots\n * Applied when input is disabled\n */\n :host([disabled]) ::slotted([slot='prefix']),\n :host([disabled]) ::slotted([slot='suffix']) {\n opacity: var(--hybrid-input-disabled-icon-opacity, var(--hybrid-input-local-disabled-icon-opacity));\n color: var(--hybrid-input-disabled-prefix-suffix-color, var(--hybrid-input-local-disabled-prefix-suffix-color));\n }\n`;\n\n/**\n * Size variation styles for the input component\n * Defines padding and spacing for different input sizes\n */\nconst sizeInputStyle = css`\n /* ========================================\n * SIZE VARIATIONS\n * ======================================== */\n\n /* Large input size variant */\n div[data-size='large'] {\n padding-top: var(--hybrid-input-large-padding-top, var(--hybrid-input-local-large-padding-top));\n padding-bottom: var(--hybrid-input-large-padding-bottom, var(--hybrid-input-local-large-padding-bottom));\n padding-left: var(--hybrid-input-large-padding-left, var(--hybrid-input-local-large-padding-left));\n padding-right: var(--hybrid-input-large-padding-right, var(--hybrid-input-local-large-padding-right));\n }\n\n /* Medium input size variant (default) */\n div[data-size='medium'] {\n padding-top: var(--hybrid-input-medium-padding-top, var(--hybrid-input-local-medium-padding-top));\n padding-bottom: var(--hybrid-input-medium-padding-bottom, var(--hybrid-input-local-medium-padding-bottom));\n padding-left: var(--hybrid-input-medium-padding-left, var(--hybrid-input-local-medium-padding-left));\n padding-right: var(--hybrid-input-medium-padding-right, var(--hybrid-input-local-medium-padding-right));\n }\n\n /* Small input size variant */\n div[data-size='small'] {\n padding-top: var(--hybrid-input-small-padding-top, var(--hybrid-input-local-small-padding-top));\n padding-bottom: var(--hybrid-input-small-padding-bottom, var(--hybrid-input-local-small-padding-bottom));\n padding-left: var(--hybrid-input-small-padding-left, var(--hybrid-input-local-small-padding-left));\n padding-right: var(--hybrid-input-small-padding-right, var(--hybrid-input-local-small-padding-right));\n }\n\n /* \n * Character count display\n * Shows character count and limit information\n */\n .character-count {\n font-size: var(--hybrid-input-character-count-font-size, var(--hybrid-input-local-character-count-font-size));\n color: var(--hybrid-input-character-count-color, var(--hybrid-input-local-character-count-color));\n text-align: right;\n margin-top: var(--hybrid-input-character-count-margin-top, var(--hybrid-input-local-character-count-margin-top));\n font-family: var(--hybrid-input-font-family, var(--hybrid-input-local-font-family));\n }\n\n /* Character count over limit styling */\n .character-count[data-over-limit] {\n color: var(--hybrid-input-character-count-over-limit-color, var(--hybrid-input-local-character-count-over-limit-color));\n }\n`;\n\nexport const styles = [inputStyle, sizeInputStyle, styleVariables];\n"]}
@@ -1,2 +1,2 @@
1
1
  export declare const styleVariables: import("lit").CSSResult;
2
- //# sourceMappingURL=input.style.variable..d.ts.map
2
+ //# sourceMappingURL=input.style.variable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.style.variable.d.ts","sourceRoot":"","sources":["../../../src/components/input/input.style.variable.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,yBA2K1B,CAAC"}