@nuralyui/select 0.0.5 → 0.1.0

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":"select.component.js","sourceRoot":"","sources":["../../../src/components/select/select.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAAuD;AACvD,OAAO,EAAC,UAAU,EAAkB,IAAI,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAC,GAAG,EAAC,MAAM,uBAAuB,CAAC;AAC1C,OAAO,EAAU,mBAAmB,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AACrG,OAAO,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAC,YAAY,EAAE,0BAA0B,EAAC,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGvD,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,UAAU;IAAjD;;QAME,oBAAe,GAAU,EAAE,CAAA;QAE3B,gBAAW,GAAG,kBAAkB,CAAC;QAEjC,aAAQ,GAAG,KAAK,CAAC;QAEjB,SAAI,GAAG,UAAU,CAAC,OAAO,CAAC;QAE1B,kBAAa,GAAG,mBAAmB,CAAC,MAAM,CAAC;QAE3C,SAAI,GAAG,KAAK,CAAC;QAEb,WAAM,GAAG,YAAY,CAAC,OAAO,CAAC;QAE9B,SAAI,GAAG,UAAU,CAAC,MAAM,CAAC;QAGzB,aAAQ,GAAc,EAAE,CAAC;IAoJ3B,CAAC;IA7IoB,OAAO,CAAC,kBAAkC;QAC3D,IAAG,kBAAkB,CAAC,GAAG,C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nothing} from 'lit';\nimport {property,state, customElement, query} from 'lit/decorators.js';\nimport {styles} from './select.style.js';\nimport {map} from 'lit/directives/map.js';\nimport {IOption, OptionSelectionMode, OptionSize, OptionStatus, OptionType} from './select.types.js';\nimport {choose} from 'lit/directives/choose.js';\nimport {EMPTY_STRING, MULTIPLE_OPTIONS_SEPARATOR} from './select.constant.js';\nimport { styleMap } from 'lit/directives/style-map.js';\n\n@customElement('hy-select')\nexport class HySelectComponent extends LitElement {\n static override styles = styles;\n\n @property()\n options!: IOption[];\n @property()\n defaultSelected:string[]=[]\n @property()\n placeholder = 'Select an option';\n @property({type: Boolean, reflect: true})\n disabled = false;\n @property({reflect: true})\n type = OptionType.Default;\n @property()\n selectionMode = OptionSelectionMode.Single;\n @property({type: Boolean, reflect: true})\n show = false;\n @property({reflect: true})\n status = OptionStatus.Default;\n @property({reflect: true})\n size = OptionSize.Medium;\n\n @state()\n selected: IOption[] = [];\n\n @query('.options')\n optionsElement!: HTMLElement;\n @query('.wrapper')\n wrapper!: HTMLElement;\n\n protected override updated(_changedProperties: PropertyValues): void {\n if(_changedProperties.has('defaultSelected') && JSON.stringify(_changedProperties.get('defaultSelected'))!=JSON.stringify(this.defaultSelected)){\n let defaultOptions:IOption[]=[]\n\n this.defaultSelected.forEach((value)=>{\n const option = this.options.find((option)=>option.value ==value)\n if(option)\n defaultOptions.push(option)\n })\n this.selected =[...defaultOptions]\n }\n \n }\n \n private async toggleOptions() {\n this.show = !this.show;\n await this.updateComplete;\n if (this.show) this.calculateOptionsPosition();\n else this.initOptionsPosition();\n }\n private calculateOptionsPosition() {\n const wrapperBorderBottomWidth = +getComputedStyle(this.wrapper).borderBottomWidth.split('px')[0];\n const wrapperBorderTopWidth = +getComputedStyle(this.wrapper).borderTopWidth.split('px')[0];\n const clientRect = this.optionsElement.getBoundingClientRect();\n const availableBottomSpace =\n window.visualViewport!.height -\n clientRect.bottom +\n clientRect.height -\n this.wrapper.getBoundingClientRect().height;\n const availableTopSpace = clientRect.top;\n if (clientRect.height > availableBottomSpace && availableTopSpace > clientRect.height) {\n this.optionsElement.style.top = `${-clientRect.height - wrapperBorderTopWidth}px`;\n } else {\n this.optionsElement.style.top = `calc(100% + ${wrapperBorderBottomWidth}px)`;\n }\n }\n private initOptionsPosition() {\n this.optionsElement.style.removeProperty('top');\n }\n\n private selectOption(selectOptionEvent: Event, selectedOption: IOption) {\n selectOptionEvent.stopPropagation();\n if (this.selectionMode == OptionSelectionMode.Single) {\n this.selected = this.selected.length && this.selected[0].label == selectedOption.label ? [] : [selectedOption];\n this.toggleOptions();\n } else {\n if (this.selected.includes(selectedOption)) {\n this.selected = this.selected.filter(\n (previousSelectedOption) => previousSelectedOption.label != selectedOption.label\n );\n } else {\n this.selected = [...this.selected, selectedOption];\n }\n }\n this.dispatchChangeEvent()\n }\n private unselectAll(unselectAllEvent: Event) {\n unselectAllEvent.stopPropagation();\n this.selected = [];\n this.dispatchChangeEvent()\n }\n private unselectOne(unselectOneEvent: Event, selectedIndex: number) {\n unselectOneEvent.stopPropagation();\n this.selected = this.selected.filter((_, index) => index != selectedIndex);\n this.dispatchChangeEvent()\n }\n private dispatchChangeEvent() {\n let result = this.selectionMode == OptionSelectionMode.Single?this.selected[0]:this.selected\n this.dispatchEvent(new CustomEvent('changed', {detail: {value: result}, bubbles: true, composed: true}));\n }\n\n private onBlur() {\n this.show = false;\n this.initOptionsPosition();\n }\n\n protected override render(): unknown {\n return html`\n <slot name=\"label\"></slot>\n <div class=\"wrapper\" tabindex=\"0\" @click=\"${!this.disabled ? this.toggleOptions : nothing}\" @blur=${this.onBlur}>\n <div class=\"select\">\n <div class=\"select-trigger\">\n ${choose(this.selectionMode, [\n [\n OptionSelectionMode.Single,\n () => html`${this.selected.length ? this.selected[0].label : this.placeholder}`,\n ],\n [\n OptionSelectionMode.Multiple,\n () =>\n html`${this.selected.length\n ? map(\n this.selected,\n (option, index) =>\n html`<span class=\"label\">\n <hy-icon\n name=\"remove\"\n id=\"unselect-one\"\n @click=${(e: Event) => this.unselectOne(e, index)}\n ></hy-icon\n >${option.label}</span\n >${this.selected.length - 1 != index ? MULTIPLE_OPTIONS_SEPARATOR : EMPTY_STRING}`\n )\n : this.placeholder}`,\n ],\n ])}\n </div>\n <div class=\"icons-container\">\n ${choose(this.status, [\n [OptionStatus.Default, () => undefined],\n [OptionStatus.Warning, () => html`<hy-icon name=\"warning\" id=\"warning-icon\"></hy-icon>`],\n [OptionStatus.Error, () => html`<hy-icon name=\"exclamation-circle\" id=\"error-icon\"></hy-icon>`],\n ])}\n ${this.selected.length\n ? html`<hy-icon\n name=\"remove\"\n id=\"unselect-multiple\"\n @click=${(e: Event) => this.unselectAll(e)}\n ></hy-icon>`\n : nothing}\n <hy-icon name=\"angle-down\" id=\"arrow-icon\"></hy-icon>\n </div>\n <div class=\"options\">\n ${map(\n this.options,\n (option) =>\n html`<div class=\"option\" @click=\"${(e: Event) => this.selectOption(e, option)}\">\n ${this.selected.includes(option) ? html`<hy-icon name=\"check\" id=\"check-icon\"></hy-icon>` : nothing}\n <span class=\"option-text\" \n style=${styleMap({\n ...option.additionalStyle ?? []\n })}\n >${option.label}</span>\n </div>`\n )}\n </div>\n </div>\n </div>\n <slot name=\"helper-text\"></slot>\n `;\n }\n}"]}
1
+ {"version":3,"file":"select.component.js","sourceRoot":"","sources":["../../../src/components/select/select.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD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port { LitElement, html, nothing } from 'lit';\nimport { property, customElement, query } from 'lit/decorators.js';\nimport { styles } from './select.style.js';\nimport { map } from 'lit/directives/map.js';\nimport { choose } from 'lit/directives/choose.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { NuralyUIBaseMixin } from '../../shared/base-mixin.js';\n\n// Import types\nimport { \n SelectOption, \n SelectType,\n SelectSize,\n SelectStatus\n} from './select.types.js';\n\n// Import controllers\nimport {\n SelectSelectionController,\n SelectKeyboardController,\n SelectDropdownController,\n SelectFocusController,\n SelectValidationController,\n SelectSearchController,\n SelectEventController\n} from './controllers/index.js';\n\n// Import interfaces\nimport { SelectHost } from './interfaces/index.js';\n\n/**\n * Advanced select component with multiple selection modes, validation, and accessibility features.\n * \n * Supports single and multiple selection, custom rendering, validation states, keyboard navigation,\n * and various display types including default, inline, button, and slot-based configurations.\n * \n * @example\n * ```html\n * <!-- Basic select -->\n * <hy-select placeholder=\"Choose an option\">\n * <option value=\"1\">Option 1</option>\n * <option value=\"2\">Option 2</option>\n * </hy-select>\n * \n * <!-- Multiple selection -->\n * <hy-select multiple placeholder=\"Choose multiple options\"></hy-select>\n * \n * <!-- With validation -->\n * <hy-select required status=\"error\"></hy-select>\n * \n * <!-- Button style -->\n * <hy-select type=\"button\"></hy-select>\n * \n * <!-- With search functionality -->\n * <hy-select searchable search-placeholder=\"Search options...\"></hy-select>\n * ```\n * \n * @fires nr-change - Selection changed\n * @fires nr-focus - Component focused \n * @fires nr-blur - Component blurred\n * @fires nr-dropdown-open - Dropdown opened\n * @fires nr-dropdown-close - Dropdown closed\n * @fires nr-validation - Validation state changed\n * \n * @slot label - Select label content\n * @slot helper-text - Helper text below select\n * @slot trigger - Custom trigger content (slot type only)\n * \n * @cssproperty --select-border-color - Border color\n * @cssproperty --select-background - Background color\n * @cssproperty --select-text-color - Text color\n * @cssproperty --select-focus-color - Focus indicator color\n * @cssproperty --select-dropdown-shadow - Dropdown shadow\n * @cssproperty --select-no-options-color - No options message text color\n * @cssproperty --select-no-options-icon-color - No options icon color\n * @cssproperty --select-no-options-padding - Padding for no options message\n * @cssproperty --select-no-options-gap - Gap between icon and text\n * @cssproperty --select-search-border - Search input border\n * @cssproperty --select-search-background - Search input background\n * @cssproperty --select-search-padding - Search input padding\n */\n@customElement('hy-select')\nexport class HySelectComponent extends NuralyUIBaseMixin(LitElement) implements SelectHost {\n static override styles = styles;\n \n // Temporarily disable dependency validation\n override requiredComponents = [];\n\n // === Properties ===\n \n /** Array of options to display in the select dropdown */\n @property({ type: Array }) \n options: SelectOption[] = [];\n \n /** Default selected values (for initialization) */\n @property({ type: Array, attribute: 'default-value' }) \n defaultValue: string[] = [];\n \n /** Placeholder text shown when no option is selected */\n @property({ type: String }) \n placeholder: string = 'Select an option';\n \n /** Disables the select component */\n @property({ type: Boolean, reflect: true }) \n disabled: boolean = false;\n \n /** Select display type (default, inline, button, slot) */\n @property({ type: String, reflect: true }) \n type: SelectType = SelectType.Default;\n \n /** Enables multiple option selection */\n @property({ type: Boolean, attribute: 'multiple' }) \n multiple: boolean = false;\n \n /** Controls dropdown visibility */\n @property({ type: Boolean, reflect: true }) \n show: boolean = false;\n \n /** Validation status (default, warning, error, success) */\n @property({ type: String, reflect: true }) \n status: SelectStatus = SelectStatus.Default;\n \n /** Select size (small, medium, large) */\n @property({ type: String, reflect: true }) \n size: SelectSize = SelectSize.Medium;\n \n /** Makes the select required for form validation */\n @property({ type: Boolean, reflect: true }) \n required: boolean = false;\n \n /** Form field name */\n @property({ type: String }) \n name: string = '';\n \n /** Current selected value(s) */\n @property({ type: String }) \n value: string | string[] = '';\n \n /** Message to display when no options are available */\n @property({ type: String, attribute: 'no-options-message' })\n noOptionsMessage: string = 'No options available';\n \n /** Icon to display with the no options message */\n @property({ type: String, attribute: 'no-options-icon' })\n noOptionsIcon: string = 'circle-info';\n \n /** Enable search/filter functionality */\n @property({ type: Boolean, reflect: true })\n searchable: boolean = false;\n \n /** Placeholder text for the search input */\n @property({ type: String, attribute: 'search-placeholder' })\n searchPlaceholder: string = 'Search options...';\n \n /** Current search query */\n @property({ type: String })\n searchQuery: string = '';\n\n // === Query selectors ===\n \n /** Options dropdown container element */\n @query('.options') \n optionsElement!: HTMLElement;\n \n /** Main wrapper element */\n @query('.wrapper') \n wrapper!: HTMLElement;\n \n /** Search input element */\n @query('.search-input')\n searchInput?: HTMLInputElement;\n\n // === Controller instances ===\n \n /** Handles option selection logic */\n private selectionController = new SelectSelectionController(this);\n \n /** Manages dropdown visibility and positioning */\n private dropdownController = new SelectDropdownController(this);\n \n /** Handles keyboard navigation */\n private keyboardController = new SelectKeyboardController(this, this.selectionController, this.dropdownController);\n \n /** Manages focus states */\n private focusController = new SelectFocusController(this);\n \n /** Handles validation logic */\n private validationController = new SelectValidationController(this, this.selectionController);\n \n /** Handles search/filter functionality */\n private searchController = new SelectSearchController(this);\n \n /** Handles all event management */\n private eventController = new SelectEventController(this);\n\n // === Lifecycle methods ===\n \n /**\n * Component connected to DOM - initialize base functionality\n */\n override connectedCallback(): void {\n super.connectedCallback();\n // Window click listener is setup only when dropdown opens for better performance\n }\n\n /**\n * Component disconnected from DOM - cleanup event listeners\n */\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n // Event cleanup is now handled by EventController\n }\n\n /**\n * First render complete - setup controllers and initialize state\n */\n override firstUpdated(changedProperties: any): void {\n super.firstUpdated(changedProperties);\n \n // Configure dropdown controller with DOM element references\n if (this.optionsElement && this.wrapper) {\n this.dropdownController.setElements(this.optionsElement, this.wrapper);\n } else {\n // Retry element setup if DOM isn't ready yet\n setTimeout(() => {\n if (this.optionsElement && this.wrapper) {\n this.dropdownController.setElements(this.optionsElement, this.wrapper);\n }\n }, 100);\n }\n\n // Apply default selection if specified\n if (this.defaultValue.length > 0) {\n this.selectionController.initializeFromDefaultValue();\n }\n }\n\n // === Public API Methods ===\n\n /**\n * Gets the currently selected options\n * @returns Array of selected options\n */\n get selectedOptions(): SelectOption[] {\n return this.selectionController.getSelectedOptions();\n }\n\n /**\n * Gets the first selected option (for single selection mode)\n * @returns Selected option or undefined if none selected\n */\n get selectedOption(): SelectOption | undefined {\n return this.selectionController.getSelectedOption();\n }\n\n /**\n * Selects an option programmatically\n * @param option - The option to select\n */\n selectOption(option: SelectOption): void {\n this.selectionController.selectOption(option);\n }\n\n /**\n * Unselects an option programmatically\n * @param option - The option to unselect\n */\n unselectOption(option: SelectOption): void {\n this.selectionController.unselectOption(option);\n }\n\n /**\n * Clears all current selections\n */\n clearSelection(): void {\n this.selectionController.clearSelection();\n }\n\n /**\n * Checks if a specific option is currently selected\n * @param option - The option to check\n * @returns True if the option is selected\n */\n isOptionSelected(option: SelectOption): boolean {\n return this.selectionController.isOptionSelected(option);\n }\n\n /**\n * Toggles the dropdown visibility\n */\n toggleDropdown(): void {\n this.dropdownController.toggle();\n }\n\n /**\n * Opens the dropdown programmatically\n */\n openDropdown(): void {\n this.dropdownController.open();\n }\n\n /**\n * Closes the dropdown programmatically\n */\n closeDropdown(): void {\n this.dropdownController.close();\n }\n\n /**\n * Focuses the select component\n */\n override focus(): void {\n this.focusController.focus();\n }\n\n /**\n * Removes focus from the select component\n */\n override blur(): void {\n this.focusController.blur();\n }\n\n /**\n * Validates the current selection according to component rules\n * @returns True if valid, false otherwise\n */\n validate(): boolean {\n return this.validationController.validate();\n }\n\n /**\n * Checks if the current selection is valid without showing validation UI\n * @returns True if valid, false otherwise\n */\n checkValidity(): boolean {\n return this.validationController.checkValidity();\n }\n\n /**\n * Reports the current validation state and shows validation UI if invalid\n * @returns True if valid, false otherwise\n */\n reportValidity(): boolean {\n return this.validationController.reportValidity();\n }\n\n /**\n * Sets a custom validation message\n * @param message - Custom validation message (empty string to clear)\n */\n setCustomValidity(message: string): void {\n this.validationController.setCustomValidity(message);\n }\n\n /**\n * Searches for options with the given query\n * @param query - Search query string\n */\n searchOptions(query: string): void {\n this.searchController.search(query);\n }\n\n /**\n * Clears the current search query\n */\n clearSearch(): void {\n this.searchController.clearSearch();\n }\n\n /**\n * Gets the filtered options based on current search\n * @returns Array of filtered options\n */\n getSearchFilteredOptions(): SelectOption[] {\n return this.searchController.getFilteredOptions(this.options);\n }\n\n /**\n * Gets the current search query\n * @returns Current search query string\n */\n getCurrentSearchQuery(): string {\n return this.searchController.searchQuery;\n }\n\n /**\n * Manually trigger setup of global event listeners\n */\n setupGlobalEventListeners(): void {\n this.eventController.setupEventListeners();\n }\n\n /**\n * Manually trigger removal of global event listeners\n */\n removeGlobalEventListeners(): void {\n this.eventController.removeEventListeners();\n }\n\n // === Private Event Handlers ===\n // Note: Event handling logic has been extracted to SelectEventController\n // These methods serve as thin wrappers for template bindings\n \n /**\n * Handles clicks on the select trigger element\n */\n private handleTriggerClick = (event: Event): void => {\n this.eventController.handleTriggerClick(event);\n };\n\n /**\n * Handles clicks on individual options\n */\n private handleOptionClick = (event: Event, option: SelectOption): void => {\n this.eventController.handleOptionClick(event, option);\n };\n\n /**\n * Handles removal of selected tags in multiple selection mode\n */\n private handleTagRemove = (event: Event, option: SelectOption): void => {\n this.eventController.handleTagRemove(event, option);\n };\n\n /**\n * Handles the clear all selections button\n */\n private handleClearAll = (event: Event): void => {\n this.eventController.handleClearAll(event);\n };\n\n /**\n * Handles keyboard navigation and interactions\n */\n private handleKeyDown = (event: KeyboardEvent): void => {\n this.eventController.handleKeyDown(event);\n };\n\n /**\n * Handles focus events\n */\n private handleFocus = (): void => {\n this.eventController.handleFocus();\n };\n\n /**\n * Handles blur events\n */\n private handleBlur = (): void => {\n this.eventController.handleBlur();\n };\n\n /**\n * Filters options based on search query\n */\n private getFilteredOptions(): SelectOption[] {\n return this.searchController.getFilteredOptions(this.options);\n };\n\n // === Event Listener Management ===\n \n /**\n * Sets up global event listeners (called when dropdown opens)\n */\n public setupEventListeners(): void {\n this.eventController.setupEventListeners();\n }\n\n /**\n * Removes global event listeners (called on disconnect or dropdown close)\n */\n public removeEventListeners(): void {\n this.eventController.removeEventListeners();\n }\n\n // === Main Render Method ===\n \n /**\n * Main render method that delegates to specific type renderers\n */\n protected override render() {\n return html`${choose(this.type, [\n [SelectType.Default, () => this.renderDefault()],\n [SelectType.Inline, () => this.renderInline()],\n [SelectType.Button, () => this.renderButton()],\n [SelectType.Slot, () => this.renderSlot()],\n ])}`;\n }\n\n // === Type-Specific Render Methods ===\n \n /**\n * Renders the default select appearance with full features\n */\n private renderDefault() {\n const selectedOptions = this.selectedOptions;\n const validationClasses = this.validationController.getValidationClasses();\n \n return html`\n <slot name=\"label\"></slot>\n <div \n class=\"${classMap({\n 'wrapper': true,\n ...validationClasses\n })}\"\n tabindex=\"0\"\n role=\"combobox\"\n aria-expanded=\"${this.show}\"\n aria-haspopup=\"listbox\"\n aria-labelledby=\"select-label\"\n\n @click=${this.handleTriggerClick}\n @keydown=${this.handleKeyDown}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n >\n <div class=\"select\">\n <div class=\"select-trigger\">\n ${this.renderSelectedContent(selectedOptions)}\n </div>\n \n <div class=\"icons-container\">\n ${this.renderStatusIcon()}\n ${this.renderClearButton(selectedOptions)}\n <hy-icon \n name=\"angle-down\" \n class=\"arrow-icon\"\n aria-hidden=\"true\"\n ></hy-icon>\n </div>\n \n <div \n class=\"options\"\n role=\"listbox\"\n aria-multiselectable=\"${this.multiple}\"\n >\n ${this.searchable ? this.renderSearchInput() : nothing}\n ${this.renderSelectOptions()}\n </div>\n </div>\n </div>\n \n ${this.renderValidationMessage()}\n <slot name=\"helper-text\"></slot>\n `;\n }\n\n /**\n * Renders inline select with integrated label and helper text\n */\n private renderInline() {\n return html`\n <slot name=\"label\"></slot>\n ${this.renderDefault()}\n <slot name=\"helper-text\"></slot>\n `;\n }\n\n /**\n * Renders select as a button-style component\n */\n private renderButton() {\n const selectedOptions = this.selectedOptions;\n return html`\n <button\n class=\"select-button\"\n ?disabled=${this.disabled}\n @click=${this.handleTriggerClick}\n @keydown=${this.handleKeyDown}\n >\n ${selectedOptions.length > 0 ? selectedOptions[0].label : this.placeholder}\n <hy-icon name=\"angle-down\" class=\"arrow-icon\"></hy-icon>\n </button>\n \n <div class=\"options\" role=\"listbox\">\n ${this.searchable ? this.renderSearchInput() : nothing}\n ${this.renderSelectOptions()}\n </div>\n `;\n }\n\n /**\n * Renders select with custom trigger content via slots\n */\n private renderSlot() {\n return html`\n <slot name=\"trigger\" @click=${this.handleTriggerClick}></slot>\n <div class=\"options\" role=\"listbox\">\n ${this.searchable ? this.renderSearchInput() : nothing}\n ${this.renderSelectOptions()}\n </div>\n `;\n }\n\n // === Helper Render Methods ===\n \n /**\n * Renders the selected content in the trigger area\n */\n private renderSelectedContent(selectedOptions: SelectOption[]) {\n if (selectedOptions.length === 0) {\n return html`<span class=\"placeholder\" aria-hidden=\"true\">${this.placeholder}</span>`;\n }\n\n if (this.multiple) {\n return map(selectedOptions, (option) => html`\n <span class=\"tag\">\n <span class=\"tag-label\">${option.label}</span>\n <hy-icon \n name=\"remove\"\n class=\"tag-close\"\n @click=${(e: Event) => this.handleTagRemove(e, option)}\n aria-label=\"Remove ${option.label}\"\n ></hy-icon>\n </span>\n `);\n } else {\n return html`${selectedOptions[0].label}`;\n }\n }\n\n /**\n * Renders status/validation icons based on current status\n */\n private renderStatusIcon() {\n switch (this.status) {\n case SelectStatus.Warning:\n return html`<hy-icon name=\"warning\" class=\"status-icon warning\"></hy-icon>`;\n case SelectStatus.Error:\n return html`<hy-icon name=\"exclamation-circle\" class=\"status-icon error\"></hy-icon>`;\n case SelectStatus.Success:\n return html`<hy-icon name=\"check-circle\" class=\"status-icon success\"></hy-icon>`;\n default:\n return nothing;\n }\n }\n\n /**\n * Renders the clear all selections button when applicable\n */\n private renderClearButton(selectedOptions: SelectOption[]) {\n if (selectedOptions.length === 0 || this.disabled) {\n return nothing;\n }\n\n return html`\n <hy-icon\n name=\"remove\"\n class=\"clear-icon\"\n @click=${this.handleClearAll}\n aria-label=\"Clear selection\"\n tabindex=\"-1\"\n ></hy-icon>\n `;\n }\n\n /**\n * Renders all available options in the dropdown\n */\n private renderSelectOptions() {\n const filteredOptions = this.getFilteredOptions();\n \n // Show \"no options\" message when no options are available (original array empty)\n if (!this.options || this.options.length === 0) {\n return html`\n <div class=\"no-options\" role=\"option\" aria-disabled=\"true\">\n <div class=\"no-options-content\">\n <hy-icon \n name=\"${this.noOptionsIcon}\" \n class=\"no-options-icon\"\n aria-hidden=\"true\">\n </hy-icon>\n <span class=\"no-options-text\">${this.noOptionsMessage}</span>\n </div>\n </div>\n `;\n }\n \n // Show \"no results\" message when search returns no results\n if (this.searchController.hasNoResults(this.options)) {\n return this.searchController.renderNoResults();\n }\n \n // Cache the focused option to avoid multiple controller accesses\n const focusedOption = this.keyboardController.focusedOption;\n \n return map(filteredOptions, (option) => {\n const isSelected = this.isOptionSelected(option);\n const isFocused = focusedOption && focusedOption.value === option.value;\n \n return html`\n <div\n class=\"${classMap({\n 'option': true,\n 'selected': isSelected,\n 'focused': isFocused,\n 'disabled': Boolean(option.disabled)\n })}\"\n role=\"option\"\n aria-selected=\"${isSelected}\"\n aria-disabled=\"${Boolean(option.disabled)}\"\n data-value=\"${option.value}\"\n @click=${(e: Event) => this.handleOptionClick(e, option)}\n style=${styleMap(option.style ? { style: option.style } : {})}\n title=\"${option.title || ''}\"\n >\n <div class=\"option-content\">\n ${option.icon ? html`<hy-icon name=\"${option.icon}\" class=\"option-icon\"></hy-icon>` : nothing}\n <div class=\"option-text\">\n ${option.htmlContent ? html`<div .innerHTML=${option.htmlContent}></div>` : option.label}\n ${option.description ? html`<div class=\"option-description\">${option.description}</div>` : nothing}\n </div>\n </div>\n \n ${isSelected ? html`<hy-icon name=\"check\" class=\"check-icon\" aria-hidden=\"true\"></hy-icon>` : nothing}\n \n ${option.state && option.message ? html`\n <div class=\"option-message ${option.state}\">\n <hy-icon name=\"${option.state === 'error' ? 'exclamation-circle' : 'warning'}\"></hy-icon>\n <span>${option.message}</span>\n </div>\n ` : nothing}\n </div>\n `;\n });\n }\n\n /**\n * Renders the search input when searchable is enabled\n */\n private renderSearchInput() {\n return this.searchController.renderSearchInput();\n }\n\n /**\n * Renders validation message when present\n */\n private renderValidationMessage() {\n const validationMessage = this.validationController.validationMessage;\n if (!validationMessage) return nothing;\n\n return html`\n <div class=\"validation-message ${this.status}\" id=\"validation-message\">\n ${validationMessage}\n </div>\n `;\n }\n}"]}
@@ -1,3 +1,133 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Nuraly, Laabidi Aymen
4
+ * SPDX-License-Identifier: MIT
5
+ */
6
+ /**
7
+ * Constants for the select component
8
+ */
9
+ /**
10
+ * Event names fired by the select component
11
+ */
12
+ export declare const SELECT_EVENTS: {
13
+ /** Fired when selection changes */
14
+ readonly CHANGE: "nr-change";
15
+ /** Fired when component receives focus */
16
+ readonly FOCUS: "nr-focus";
17
+ /** Fired when component loses focus */
18
+ readonly BLUR: "nr-blur";
19
+ /** Fired when dropdown opens */
20
+ readonly DROPDOWN_OPEN: "nr-dropdown-open";
21
+ /** Fired when dropdown closes */
22
+ readonly DROPDOWN_CLOSE: "nr-dropdown-close";
23
+ /** Fired when validation state changes */
24
+ readonly VALIDATION: "nr-validation";
25
+ /** Fired when validation error occurs */
26
+ readonly ERROR: "nr-select-error";
27
+ };
28
+ /**
29
+ * CSS class names used throughout the select component
30
+ */
31
+ export declare const SELECT_CLASSES: {
32
+ /** Main wrapper element class */
33
+ readonly WRAPPER: "wrapper";
34
+ /** Select container class */
35
+ readonly SELECT: "select";
36
+ /** Clickable trigger area class */
37
+ readonly TRIGGER: "select-trigger";
38
+ /** Dropdown options container class */
39
+ readonly OPTIONS: "options";
40
+ /** Individual option class */
41
+ readonly OPTION: "option";
42
+ /** Selected option state class */
43
+ readonly SELECTED: "selected";
44
+ /** Focused option state class */
45
+ readonly FOCUSED: "focused";
46
+ /** Disabled state class */
47
+ readonly DISABLED: "disabled";
48
+ /** Selected option tag class (multiple mode) */
49
+ readonly TAG: "tag";
50
+ /** Tag label text class */
51
+ readonly TAG_LABEL: "tag-label";
52
+ /** Tag close button class */
53
+ readonly TAG_CLOSE: "tag-close";
54
+ /** Icons container class */
55
+ readonly ICONS_CONTAINER: "icons-container";
56
+ /** Dropdown arrow icon class */
57
+ readonly ARROW_ICON: "arrow-icon";
58
+ /** Clear selection icon class */
59
+ readonly CLEAR_ICON: "clear-icon";
60
+ /** Status/validation icon class */
61
+ readonly STATUS_ICON: "status-icon";
62
+ /** Selected option check mark class */
63
+ readonly CHECK_ICON: "check-icon";
64
+ /** Validation message class */
65
+ readonly VALIDATION_MESSAGE: "validation-message";
66
+ /** Placeholder text class */
67
+ readonly PLACEHOLDER: "placeholder";
68
+ /** No options available message class */
69
+ readonly NO_OPTIONS: "no-options";
70
+ /** No options content wrapper class */
71
+ readonly NO_OPTIONS_CONTENT: "no-options-content";
72
+ /** No options icon class */
73
+ readonly NO_OPTIONS_ICON: "no-options-icon";
74
+ /** No options text class */
75
+ readonly NO_OPTIONS_TEXT: "no-options-text";
76
+ /** Search container class */
77
+ readonly SEARCH_CONTAINER: "search-container";
78
+ /** Search input class */
79
+ readonly SEARCH_INPUT: "search-input";
80
+ /** Search icon class */
81
+ readonly SEARCH_ICON: "search-icon";
82
+ /** Search clear button class */
83
+ readonly SEARCH_CLEAR: "search-clear";
84
+ };
85
+ /**
86
+ * ARIA roles and attributes for accessibility compliance
87
+ */
88
+ export declare const SELECT_ARIA: {
89
+ /** ARIA role for the main select element */
90
+ readonly COMBOBOX: "combobox";
91
+ /** ARIA role for the options container */
92
+ readonly LISTBOX: "listbox";
93
+ /** ARIA role for individual options */
94
+ readonly OPTION: "option";
95
+ /** ARIA attribute indicating dropdown expanded state */
96
+ readonly EXPANDED: "aria-expanded";
97
+ /** ARIA attribute indicating popup presence */
98
+ readonly HASPOPUP: "aria-haspopup";
99
+ /** ARIA attribute for multiple selection capability */
100
+ readonly MULTISELECTABLE: "aria-multiselectable";
101
+ /** ARIA attribute for selected state */
102
+ readonly SELECTED: "aria-selected";
103
+ /** ARIA attribute for disabled state */
104
+ readonly DISABLED: "aria-disabled";
105
+ /** ARIA attribute for required field */
106
+ readonly REQUIRED: "aria-required";
107
+ /** ARIA attribute for validation state */
108
+ readonly INVALID: "aria-invalid";
109
+ /** ARIA attribute linking to description */
110
+ readonly DESCRIBEDBY: "aria-describedby";
111
+ readonly LABELLEDBY: "aria-labelledby";
112
+ };
113
+ export declare const SELECT_DEFAULTS: {
114
+ readonly PLACEHOLDER: "Select an option";
115
+ readonly MAX_HEIGHT: "200px";
116
+ readonly DROPDOWN_OFFSET: 4;
117
+ readonly TAG_MAX_WIDTH: "150px";
118
+ readonly TRANSITION_DURATION: 200;
119
+ readonly DEBOUNCE_DELAY: 300;
120
+ };
121
+ export declare const SELECT_KEYS: {
122
+ readonly ENTER: "Enter";
123
+ readonly SPACE: " ";
124
+ readonly ESCAPE: "Escape";
125
+ readonly ARROW_DOWN: "ArrowDown";
126
+ readonly ARROW_UP: "ArrowUp";
127
+ readonly HOME: "Home";
128
+ readonly END: "End";
129
+ readonly TAB: "Tab";
130
+ };
1
131
  export declare const EMPTY_STRING = "";
2
132
  export declare const MULTIPLE_OPTIONS_SEPARATOR = ", ";
3
133
  //# sourceMappingURL=select.constant.d.ts.map
@@ -1,3 +1,136 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Nuraly, Laabidi Aymen
4
+ * SPDX-License-Identifier: MIT
5
+ */
6
+ /**
7
+ * Constants for the select component
8
+ */
9
+ /**
10
+ * Event names fired by the select component
11
+ */
12
+ export const SELECT_EVENTS = {
13
+ /** Fired when selection changes */
14
+ CHANGE: 'nr-change',
15
+ /** Fired when component receives focus */
16
+ FOCUS: 'nr-focus',
17
+ /** Fired when component loses focus */
18
+ BLUR: 'nr-blur',
19
+ /** Fired when dropdown opens */
20
+ DROPDOWN_OPEN: 'nr-dropdown-open',
21
+ /** Fired when dropdown closes */
22
+ DROPDOWN_CLOSE: 'nr-dropdown-close',
23
+ /** Fired when validation state changes */
24
+ VALIDATION: 'nr-validation',
25
+ /** Fired when validation error occurs */
26
+ ERROR: 'nr-select-error',
27
+ };
28
+ /**
29
+ * CSS class names used throughout the select component
30
+ */
31
+ export const SELECT_CLASSES = {
32
+ /** Main wrapper element class */
33
+ WRAPPER: 'wrapper',
34
+ /** Select container class */
35
+ SELECT: 'select',
36
+ /** Clickable trigger area class */
37
+ TRIGGER: 'select-trigger',
38
+ /** Dropdown options container class */
39
+ OPTIONS: 'options',
40
+ /** Individual option class */
41
+ OPTION: 'option',
42
+ /** Selected option state class */
43
+ SELECTED: 'selected',
44
+ /** Focused option state class */
45
+ FOCUSED: 'focused',
46
+ /** Disabled state class */
47
+ DISABLED: 'disabled',
48
+ /** Selected option tag class (multiple mode) */
49
+ TAG: 'tag',
50
+ /** Tag label text class */
51
+ TAG_LABEL: 'tag-label',
52
+ /** Tag close button class */
53
+ TAG_CLOSE: 'tag-close',
54
+ /** Icons container class */
55
+ ICONS_CONTAINER: 'icons-container',
56
+ /** Dropdown arrow icon class */
57
+ ARROW_ICON: 'arrow-icon',
58
+ /** Clear selection icon class */
59
+ CLEAR_ICON: 'clear-icon',
60
+ /** Status/validation icon class */
61
+ STATUS_ICON: 'status-icon',
62
+ /** Selected option check mark class */
63
+ CHECK_ICON: 'check-icon',
64
+ /** Validation message class */
65
+ VALIDATION_MESSAGE: 'validation-message',
66
+ /** Placeholder text class */
67
+ PLACEHOLDER: 'placeholder',
68
+ /** No options available message class */
69
+ NO_OPTIONS: 'no-options',
70
+ /** No options content wrapper class */
71
+ NO_OPTIONS_CONTENT: 'no-options-content',
72
+ /** No options icon class */
73
+ NO_OPTIONS_ICON: 'no-options-icon',
74
+ /** No options text class */
75
+ NO_OPTIONS_TEXT: 'no-options-text',
76
+ /** Search container class */
77
+ SEARCH_CONTAINER: 'search-container',
78
+ /** Search input class */
79
+ SEARCH_INPUT: 'search-input',
80
+ /** Search icon class */
81
+ SEARCH_ICON: 'search-icon',
82
+ /** Search clear button class */
83
+ SEARCH_CLEAR: 'search-clear',
84
+ };
85
+ /**
86
+ * ARIA roles and attributes for accessibility compliance
87
+ */
88
+ export const SELECT_ARIA = {
89
+ /** ARIA role for the main select element */
90
+ COMBOBOX: 'combobox',
91
+ /** ARIA role for the options container */
92
+ LISTBOX: 'listbox',
93
+ /** ARIA role for individual options */
94
+ OPTION: 'option',
95
+ /** ARIA attribute indicating dropdown expanded state */
96
+ EXPANDED: 'aria-expanded',
97
+ /** ARIA attribute indicating popup presence */
98
+ HASPOPUP: 'aria-haspopup',
99
+ /** ARIA attribute for multiple selection capability */
100
+ MULTISELECTABLE: 'aria-multiselectable',
101
+ /** ARIA attribute for selected state */
102
+ SELECTED: 'aria-selected',
103
+ /** ARIA attribute for disabled state */
104
+ DISABLED: 'aria-disabled',
105
+ /** ARIA attribute for required field */
106
+ REQUIRED: 'aria-required',
107
+ /** ARIA attribute for validation state */
108
+ INVALID: 'aria-invalid',
109
+ /** ARIA attribute linking to description */
110
+ DESCRIBEDBY: 'aria-describedby',
111
+ LABELLEDBY: 'aria-labelledby',
112
+ };
113
+ // Default values
114
+ export const SELECT_DEFAULTS = {
115
+ PLACEHOLDER: 'Select an option',
116
+ MAX_HEIGHT: '200px',
117
+ DROPDOWN_OFFSET: 4,
118
+ TAG_MAX_WIDTH: '150px',
119
+ TRANSITION_DURATION: 200,
120
+ DEBOUNCE_DELAY: 300,
121
+ };
122
+ // Key codes for keyboard navigation
123
+ export const SELECT_KEYS = {
124
+ ENTER: 'Enter',
125
+ SPACE: ' ',
126
+ ESCAPE: 'Escape',
127
+ ARROW_DOWN: 'ArrowDown',
128
+ ARROW_UP: 'ArrowUp',
129
+ HOME: 'Home',
130
+ END: 'End',
131
+ TAB: 'Tab',
132
+ };
133
+ // Legacy constants for backward compatibility
1
134
  export const EMPTY_STRING = '';
2
135
  export const MULTIPLE_OPTIONS_SEPARATOR = ', ';
3
136
  //# sourceMappingURL=select.constant.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"select.constant.js","sourceRoot":"","sources":["../../../src/components/select/select.constant.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAC/B,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC","sourcesContent":["export const EMPTY_STRING = '';\nexport const MULTIPLE_OPTIONS_SEPARATOR = ', ';\n"]}
1
+ {"version":3,"file":"select.constant.js","sourceRoot":"","sources":["../../../src/components/select/select.constant.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,mCAAmC;IACnC,MAAM,EAAE,WAAW;IACnB,0CAA0C;IAC1C,KAAK,EAAE,UAAU;IACjB,uCAAuC;IACvC,IAAI,EAAE,SAAS;IACf,gCAAgC;IAChC,aAAa,EAAE,kBAAkB;IACjC,iCAAiC;IACjC,cAAc,EAAE,mBAAmB;IACnC,0CAA0C;IAC1C,UAAU,EAAE,eAAe;IAC3B,yCAAyC;IACzC,KAAK,EAAE,iBAAiB;CAChB,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,iCAAiC;IACjC,OAAO,EAAE,SAAS;IAClB,6BAA6B;IAC7B,MAAM,EAAE,QAAQ;IAChB,mCAAmC;IACnC,OAAO,EAAE,gBAAgB;IACzB,uCAAuC;IACvC,OAAO,EAAE,SAAS;IAClB,8BAA8B;IAC9B,MAAM,EAAE,QAAQ;IAChB,kCAAkC;IAClC,QAAQ,EAAE,UAAU;IACpB,iCAAiC;IACjC,OAAO,EAAE,SAAS;IAClB,2BAA2B;IAC3B,QAAQ,EAAE,UAAU;IACpB,gDAAgD;IAChD,GAAG,EAAE,KAAK;IACV,2BAA2B;IAC3B,SAAS,EAAE,WAAW;IACtB,6BAA6B;IAC7B,SAAS,EAAE,WAAW;IACtB,4BAA4B;IAC5B,eAAe,EAAE,iBAAiB;IAClC,gCAAgC;IAChC,UAAU,EAAE,YAAY;IACxB,iCAAiC;IACjC,UAAU,EAAE,YAAY;IACxB,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ACX,CAAC;AAEX,oCAAoC;AACpC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,WAAW;IACvB,QAAQ,EAAE,SAAS;IACnB,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;CACF,CAAC;AAEX,8CAA8C;AAC9C,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAC/B,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Nuraly, Laabidi Aymen\n * SPDX-License-Identifier: MIT\n */\n\n/**\n * Constants for the select component\n */\n\n/**\n * Event names fired by the select component\n */\nexport const SELECT_EVENTS = {\n /** Fired when selection changes */\n CHANGE: 'nr-change',\n /** Fired when component receives focus */\n FOCUS: 'nr-focus',\n /** Fired when component loses focus */\n BLUR: 'nr-blur',\n /** Fired when dropdown opens */\n DROPDOWN_OPEN: 'nr-dropdown-open',\n /** Fired when dropdown closes */\n DROPDOWN_CLOSE: 'nr-dropdown-close',\n /** Fired when validation state changes */\n VALIDATION: 'nr-validation',\n /** Fired when validation error occurs */\n ERROR: 'nr-select-error',\n} as const;\n\n/**\n * CSS class names used throughout the select component\n */\nexport const SELECT_CLASSES = {\n /** Main wrapper element class */\n WRAPPER: 'wrapper',\n /** Select container class */\n SELECT: 'select',\n /** Clickable trigger area class */\n TRIGGER: 'select-trigger',\n /** Dropdown options container class */\n OPTIONS: 'options',\n /** Individual option class */\n OPTION: 'option',\n /** Selected option state class */\n SELECTED: 'selected',\n /** Focused option state class */\n FOCUSED: 'focused',\n /** Disabled state class */\n DISABLED: 'disabled',\n /** Selected option tag class (multiple mode) */\n TAG: 'tag',\n /** Tag label text class */\n TAG_LABEL: 'tag-label',\n /** Tag close button class */\n TAG_CLOSE: 'tag-close',\n /** Icons container class */\n ICONS_CONTAINER: 'icons-container',\n /** Dropdown arrow icon class */\n ARROW_ICON: 'arrow-icon',\n /** Clear selection icon class */\n CLEAR_ICON: 'clear-icon',\n /** Status/validation icon class */\n STATUS_ICON: 'status-icon',\n /** Selected option check mark class */\n CHECK_ICON: 'check-icon',\n /** Validation message class */\n VALIDATION_MESSAGE: 'validation-message',\n /** Placeholder text class */\n PLACEHOLDER: 'placeholder',\n /** No options available message class */\n NO_OPTIONS: 'no-options',\n /** No options content wrapper class */\n NO_OPTIONS_CONTENT: 'no-options-content',\n /** No options icon class */\n NO_OPTIONS_ICON: 'no-options-icon',\n /** No options text class */\n NO_OPTIONS_TEXT: 'no-options-text',\n /** Search container class */\n SEARCH_CONTAINER: 'search-container',\n /** Search input class */\n SEARCH_INPUT: 'search-input',\n /** Search icon class */\n SEARCH_ICON: 'search-icon',\n /** Search clear button class */\n SEARCH_CLEAR: 'search-clear',\n} as const;\n\n/**\n * ARIA roles and attributes for accessibility compliance\n */\nexport const SELECT_ARIA = {\n /** ARIA role for the main select element */\n COMBOBOX: 'combobox',\n /** ARIA role for the options container */\n LISTBOX: 'listbox',\n /** ARIA role for individual options */\n OPTION: 'option',\n /** ARIA attribute indicating dropdown expanded state */\n EXPANDED: 'aria-expanded',\n /** ARIA attribute indicating popup presence */\n HASPOPUP: 'aria-haspopup',\n /** ARIA attribute for multiple selection capability */\n MULTISELECTABLE: 'aria-multiselectable',\n /** ARIA attribute for selected state */\n SELECTED: 'aria-selected',\n /** ARIA attribute for disabled state */\n DISABLED: 'aria-disabled',\n /** ARIA attribute for required field */\n REQUIRED: 'aria-required',\n /** ARIA attribute for validation state */\n INVALID: 'aria-invalid',\n /** ARIA attribute linking to description */\n DESCRIBEDBY: 'aria-describedby',\n LABELLEDBY: 'aria-labelledby',\n} as const;\n\n// Default values\nexport const SELECT_DEFAULTS = {\n PLACEHOLDER: 'Select an option',\n MAX_HEIGHT: '200px',\n DROPDOWN_OFFSET: 4,\n TAG_MAX_WIDTH: '150px',\n TRANSITION_DURATION: 200,\n DEBOUNCE_DELAY: 300,\n} as const;\n\n// Key codes for keyboard navigation\nexport const SELECT_KEYS = {\n ENTER: 'Enter',\n SPACE: ' ',\n ESCAPE: 'Escape',\n ARROW_DOWN: 'ArrowDown',\n ARROW_UP: 'ArrowUp',\n HOME: 'Home',\n END: 'End',\n TAB: 'Tab',\n} as const;\n\n// Legacy constants for backward compatibility\nexport const EMPTY_STRING = '';\nexport const MULTIPLE_OPTIONS_SEPARATOR = ', ';\n"]}