@proyecto-viviana/solidaria-components 0.4.0 → 0.5.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.
Files changed (226) hide show
  1. package/dist/ActionBar.d.ts.map +1 -1
  2. package/dist/ActionBar.js +2 -11
  3. package/dist/ActionBar.js.map +1 -1
  4. package/dist/ActionBar.jsx +2 -11
  5. package/dist/ActionBar.jsx.map +1 -1
  6. package/dist/ActionGroup.d.ts.map +1 -1
  7. package/dist/ActionGroup.js +1 -1
  8. package/dist/ActionGroup.js.map +1 -1
  9. package/dist/ActionGroup.jsx +1 -1
  10. package/dist/ActionGroup.jsx.map +1 -1
  11. package/dist/Autocomplete.d.ts +2 -2
  12. package/dist/Autocomplete.d.ts.map +1 -1
  13. package/dist/Autocomplete.js +7 -7
  14. package/dist/Autocomplete.js.map +1 -1
  15. package/dist/Autocomplete.jsx +7 -7
  16. package/dist/Autocomplete.jsx.map +1 -1
  17. package/dist/Breadcrumbs.d.ts.map +1 -1
  18. package/dist/Breadcrumbs.js +18 -18
  19. package/dist/Breadcrumbs.js.map +1 -1
  20. package/dist/Breadcrumbs.jsx +21 -26
  21. package/dist/Breadcrumbs.jsx.map +1 -1
  22. package/dist/Calendar.d.ts.map +1 -1
  23. package/dist/Calendar.js +100 -65
  24. package/dist/Calendar.js.map +1 -1
  25. package/dist/Calendar.jsx +10 -1
  26. package/dist/Calendar.jsx.map +1 -1
  27. package/dist/Color.d.ts.map +1 -1
  28. package/dist/Color.js +15 -18
  29. package/dist/Color.js.map +1 -1
  30. package/dist/Color.jsx +15 -19
  31. package/dist/Color.jsx.map +1 -1
  32. package/dist/ComboBox.d.ts +4 -0
  33. package/dist/ComboBox.d.ts.map +1 -1
  34. package/dist/ComboBox.js +21 -13
  35. package/dist/ComboBox.js.map +1 -1
  36. package/dist/ComboBox.jsx +23 -13
  37. package/dist/ComboBox.jsx.map +1 -1
  38. package/dist/DateField.d.ts +11 -2
  39. package/dist/DateField.d.ts.map +1 -1
  40. package/dist/DateField2.js +237 -234
  41. package/dist/DateField2.js.map +1 -1
  42. package/dist/DateField2.jsx +134 -97
  43. package/dist/DateField2.jsx.map +1 -1
  44. package/dist/DatePicker.d.ts +42 -3
  45. package/dist/DatePicker.d.ts.map +1 -1
  46. package/dist/DatePicker.js +6 -990
  47. package/dist/DatePicker.jsx +6 -681
  48. package/dist/DatePicker2.js +1171 -0
  49. package/dist/DatePicker2.js.map +1 -0
  50. package/dist/DatePicker2.jsx +820 -0
  51. package/dist/DatePicker2.jsx.map +1 -0
  52. package/dist/DateRangePickerContext.d.ts +2 -0
  53. package/dist/DateRangePickerContext.d.ts.map +1 -1
  54. package/dist/Disclosure.d.ts.map +1 -1
  55. package/dist/Disclosure.js +3 -0
  56. package/dist/Disclosure.js.map +1 -1
  57. package/dist/Disclosure.jsx +1 -1
  58. package/dist/Disclosure.jsx.map +1 -1
  59. package/dist/ElementTag.d.ts +29 -0
  60. package/dist/ElementTag.d.ts.map +1 -0
  61. package/dist/ElementTag.js +220 -0
  62. package/dist/ElementTag.js.map +1 -0
  63. package/dist/ElementTag.jsx +67 -0
  64. package/dist/ElementTag.jsx.map +1 -0
  65. package/dist/GridList.d.ts.map +1 -1
  66. package/dist/GridList.js +2 -2
  67. package/dist/GridList.js.map +1 -1
  68. package/dist/GridList.jsx +2 -2
  69. package/dist/GridList.jsx.map +1 -1
  70. package/dist/Landmark.js +4 -3
  71. package/dist/Landmark.js.map +1 -1
  72. package/dist/Landmark.jsx +3 -3
  73. package/dist/Landmark.jsx.map +1 -1
  74. package/dist/Link.js +3 -2
  75. package/dist/Link.js.map +1 -1
  76. package/dist/Link.jsx +3 -3
  77. package/dist/Link.jsx.map +1 -1
  78. package/dist/ListBox.d.ts +2 -2
  79. package/dist/ListBox.d.ts.map +1 -1
  80. package/dist/ListBox.js +327 -166
  81. package/dist/ListBox.js.map +1 -1
  82. package/dist/ListBox.jsx +161 -25
  83. package/dist/ListBox.jsx.map +1 -1
  84. package/dist/Modal.d.ts.map +1 -1
  85. package/dist/Modal.js +7 -5
  86. package/dist/Modal.js.map +1 -1
  87. package/dist/Modal.jsx +5 -5
  88. package/dist/Modal.jsx.map +1 -1
  89. package/dist/Popover.d.ts.map +1 -1
  90. package/dist/Popover.js +16 -9
  91. package/dist/Popover.js.map +1 -1
  92. package/dist/Popover.jsx +25 -4
  93. package/dist/Popover.jsx.map +1 -1
  94. package/dist/RangeCalendar.d.ts.map +1 -1
  95. package/dist/RangeCalendar.js +182 -46
  96. package/dist/RangeCalendar.js.map +1 -1
  97. package/dist/RangeCalendar.jsx +72 -2
  98. package/dist/RangeCalendar.jsx.map +1 -1
  99. package/dist/SearchField.d.ts.map +1 -1
  100. package/dist/SearchField.js +26 -2
  101. package/dist/SearchField.js.map +1 -1
  102. package/dist/SearchField.jsx +26 -2
  103. package/dist/SearchField.jsx.map +1 -1
  104. package/dist/Select.d.ts +7 -0
  105. package/dist/Select.d.ts.map +1 -1
  106. package/dist/Select.js +64 -51
  107. package/dist/Select.js.map +1 -1
  108. package/dist/Select.jsx +35 -20
  109. package/dist/Select.jsx.map +1 -1
  110. package/dist/Separator.js +3 -2
  111. package/dist/Separator.js.map +1 -1
  112. package/dist/Separator.jsx +2 -2
  113. package/dist/Separator.jsx.map +1 -1
  114. package/dist/SharedElementTransition.d.ts.map +1 -1
  115. package/dist/SharedElementTransition.js +35 -33
  116. package/dist/SharedElementTransition.js.map +1 -1
  117. package/dist/SharedElementTransition.jsx +35 -33
  118. package/dist/SharedElementTransition.jsx.map +1 -1
  119. package/dist/StepList.d.ts.map +1 -1
  120. package/dist/StepList.js +2 -9
  121. package/dist/StepList.js.map +1 -1
  122. package/dist/StepList.jsx +1 -6
  123. package/dist/StepList.jsx.map +1 -1
  124. package/dist/Table.d.ts +2 -0
  125. package/dist/Table.d.ts.map +1 -1
  126. package/dist/Table.js +10 -3
  127. package/dist/Table.js.map +1 -1
  128. package/dist/Table.jsx +10 -3
  129. package/dist/Table.jsx.map +1 -1
  130. package/dist/Tabs.d.ts.map +1 -1
  131. package/dist/Tabs.js +3 -0
  132. package/dist/Tabs.js.map +1 -1
  133. package/dist/Tabs.jsx +1 -1
  134. package/dist/Tabs.jsx.map +1 -1
  135. package/dist/TagGroup.d.ts +3 -1
  136. package/dist/TagGroup.d.ts.map +1 -1
  137. package/dist/TagGroup.js +12 -8
  138. package/dist/TagGroup.js.map +1 -1
  139. package/dist/TagGroup.jsx +11 -8
  140. package/dist/TagGroup.jsx.map +1 -1
  141. package/dist/Text.d.ts.map +1 -1
  142. package/dist/Text.js +9 -8
  143. package/dist/Text.js.map +1 -1
  144. package/dist/Text.jsx +3 -3
  145. package/dist/Text.jsx.map +1 -1
  146. package/dist/TextField.js +4 -1
  147. package/dist/TextField.js.map +1 -1
  148. package/dist/TextField.jsx +4 -1
  149. package/dist/TextField.jsx.map +1 -1
  150. package/dist/TimeField.d.ts +14 -50
  151. package/dist/TimeField.d.ts.map +1 -1
  152. package/dist/TimeField.js +111 -205
  153. package/dist/TimeField.js.map +1 -1
  154. package/dist/TimeField.jsx +76 -82
  155. package/dist/TimeField.jsx.map +1 -1
  156. package/dist/Tree.d.ts.map +1 -1
  157. package/dist/Tree.js +3 -3
  158. package/dist/Tree.js.map +1 -1
  159. package/dist/Tree.jsx +3 -3
  160. package/dist/Tree.jsx.map +1 -1
  161. package/dist/VisuallyHidden.d.ts.map +1 -1
  162. package/dist/VisuallyHidden.js +3 -11
  163. package/dist/VisuallyHidden.js.map +1 -1
  164. package/dist/VisuallyHidden.jsx +3 -4
  165. package/dist/VisuallyHidden.jsx.map +1 -1
  166. package/dist/index.d.ts +3 -3
  167. package/dist/index.d.ts.map +1 -1
  168. package/dist/index.js +6 -6
  169. package/dist/index.jsx +6 -6
  170. package/dist/useDragAndDrop.d.ts +0 -8
  171. package/dist/useDragAndDrop.d.ts.map +1 -1
  172. package/dist/useDragAndDrop2.js +6 -2
  173. package/dist/useDragAndDrop2.js.map +1 -1
  174. package/dist/useDragAndDrop2.jsx +6 -2
  175. package/dist/useDragAndDrop2.jsx.map +1 -1
  176. package/dist/utils.d.ts +1 -0
  177. package/dist/utils.d.ts.map +1 -1
  178. package/dist/utils.js +2 -2
  179. package/dist/utils.js.map +1 -1
  180. package/dist/utils.jsx +2 -2
  181. package/dist/utils.jsx.map +1 -1
  182. package/package.json +3 -9
  183. package/src/ActionBar.tsx +10 -12
  184. package/src/ActionGroup.tsx +5 -3
  185. package/src/Autocomplete.tsx +14 -9
  186. package/src/Breadcrumbs.tsx +57 -42
  187. package/src/Calendar.tsx +30 -1
  188. package/src/Color.tsx +42 -27
  189. package/src/ComboBox.tsx +49 -17
  190. package/src/DateField.tsx +285 -52
  191. package/src/DatePicker.tsx +345 -57
  192. package/src/DateRangePickerContext.tsx +2 -0
  193. package/src/Disclosure.tsx +4 -0
  194. package/src/ElementTag.tsx +116 -0
  195. package/src/GridList.tsx +8 -2
  196. package/src/Landmark.tsx +4 -4
  197. package/src/Link.tsx +4 -4
  198. package/src/ListBox.tsx +323 -21
  199. package/src/Modal.tsx +21 -5
  200. package/src/Popover.tsx +28 -7
  201. package/src/RangeCalendar.tsx +120 -1
  202. package/src/SearchField.tsx +53 -1
  203. package/src/Select.tsx +114 -22
  204. package/src/Separator.tsx +3 -3
  205. package/src/SharedElementTransition.tsx +92 -36
  206. package/src/StepList.tsx +0 -7
  207. package/src/Table.tsx +19 -4
  208. package/src/Tabs.tsx +1 -0
  209. package/src/TagGroup.tsx +26 -6
  210. package/src/Text.tsx +5 -4
  211. package/src/TextField.tsx +1 -1
  212. package/src/TimeField.tsx +113 -196
  213. package/src/Tree.tsx +14 -4
  214. package/src/VisuallyHidden.tsx +8 -12
  215. package/src/index.ts +3 -8
  216. package/src/useDragAndDrop.ts +8 -10
  217. package/src/utils.tsx +3 -3
  218. package/dist/DatePicker.js.map +0 -1
  219. package/dist/DatePicker.jsx.map +0 -1
  220. package/dist/HiddenTimeInput.d.ts +0 -25
  221. package/dist/HiddenTimeInput.d.ts.map +0 -1
  222. package/dist/HiddenTimeInput.js +0 -104
  223. package/dist/HiddenTimeInput.js.map +0 -1
  224. package/dist/HiddenTimeInput.jsx +0 -69
  225. package/dist/HiddenTimeInput.jsx.map +0 -1
  226. package/src/HiddenTimeInput.tsx +0 -133
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","names":["JSX","Accessor","createContext","createEffect","createMemo","createSignal","createUniqueId","splitProps","useContext","For","Show","untrack","createSelect","createHiddenSelect","createListBox","createOption","createHover","createInteractOutside","FocusScope","focusSafely","mergeProps","AriaSelectProps","AriaListBoxProps","AriaOptionProps","createSelectState","ListState","SelectState","Key","CollectionNode","DEFAULT_VALIDATION_RESULT","ValidationResult","FieldErrorContext","FieldErrorContextValue","RenderChildren","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","SelectionIndicatorContext","SelectionIndicatorContextValue","ListBoxLoadMoreItem","RefLike","el","T","current","assignRef","ref","getNativeSelectValidation","select","HTMLSelectElement","isInvalid","validity","valid","validationDetails","badInput","customError","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing","validationErrors","validationMessage","SelectRenderProps","isOpen","isFocused","isFocusVisible","isDisabled","isRequired","isSelected","SelectProps","Omit","items","getKey","item","getTextValue","getDisabled","disabledKeys","Iterable","selectionMode","selectedKey","defaultSelectedKey","selectedKeys","defaultSelectedKeys","onSelectionChange","key","onSelectionChangeKeys","keys","Set","defaultOpen","onOpenChange","placeholder","name","children","class","style","render","props","HTMLAttributes","HTMLDivElement","renderProps","Element","SelectValueRenderProps","selectedItem","selectedItems","selectedText","SelectValueProps","SelectTriggerRenderProps","isHovered","SelectTriggerProps","SelectListBoxRenderProps","SelectListBoxProps","renderEmptyState","onLoadMore","Promise","isLoading","renderLoadMore","loadMoreClass","isInPopover","SelectOptionRenderProps","isPressed","SelectOptionProps","id","textValue","SelectContextValue","state","rootRef","HTMLElement","triggerRef","setTriggerRef","triggerProps","valueProps","labelProps","menuProps","errorMessageProps","validation","renderItem","slots","Record","Partial","autoFocus","SelectContext","SelectStateContext","SelectValueContext","selectRootLabelProps","Select","parentContext","contextSlotProps","slot","mergedSelectProps","local","stateProps","ariaProps","selectValidation","setSelectValidation","errorMessageId","resolveDisabled","disabled","selectAriaProps","clean","startsWith","hoverProps","renderValues","size","childRenderValues","hasSelection","defaultClassName","domProps","filtered","global","cleanHoverProps","_ref","rest","cleanLabelProps","setRootRef","triggerDescribedBy","ids","undefined","filter","Boolean","join","split","length","Array","from","triggerPropsWithValidation","fieldErrorContext","focusTrigger","focus","hasNativeValidation","validationBehavior","getSelectValidation","containerProps","selectProps","hiddenSelectProps","form","handleHiddenSelectInvalid","EventHandler","Event","event","currentTarget","preventDefault","handleHiddenSelectChange","onChange","RootChildren","selectChildren","values","_el$","_$getNextElement","_tmpl$3","_el$2","firstChild","_el$4","_el$5","_co$","_$getNextMarker","nextSibling","_el$6","_el$7","_co$2","_el$9","_el$0","_co$3","_el$1","_el$10","_co$4","_$spread","_$mergeProps","_$memo","required","_$insert","_$createComponent","when","_el$3","_tmpl$","_$effect","_$setProperty","each","itemRecord","isObjectRecord","fallbackKey","toKey","String","fallbackTextValue","toTextValue","label","has","_el$12","collection","map","_el$13","_tmpl$2","_p$","_v$4","_v$5","_v$6","e","_$setAttribute","t","a","_el$8","_v$","_v$2","_v$3","_$runHydrationEvents","_el$11","_tmpl$4","baseRootProps","RootContent","renderedRootChildren","rootProps","_el$14","_tmpl$5","Provider","value","SelectTrigger","context","Error","HTMLButtonElement","cleanTriggerProps","_ref1","_ref2","triggerAriaProps","menuAriaProps","_el$15","_tmpl$6","_$use","tabIndex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-disabled","aria-required","aria-describedby","data-open","data-focused","data-focus-visible","data-hovered","data-disabled","renderChildren","defaultSelectValueChildren","SelectValue","contextPlaceholder","getItem","Intl","ListFormat","type","format","_el$16","data-placeholder","_c$","SelectListBox","selectState","focusedKey","setFocusedKey","listBoxRef","HTMLUListElement","onInteractOutside","close","listBoxProps","shouldSelectOnPressUp","shouldFocusOnHover","shouldSelectOnFocus","createSelectListStateAdapter","selectionManager","cleanMenuProps","cleanListBoxProps","queueMicrotask","option","querySelectorAll","find","element","document","activeElement","listBox","_el$17","_tmpl$7","_el$18","_el$19","_co$5","_el$20","_el$21","_co$6","data-empty","_c$2","_el$22","_tmpl$8","fallback","node","SelectOption","restoreFocus","selectContext","setRef","HTMLLIElement","optionAria","onHoverStart","onHoverEnd","onHoverChange","setSelectedKeys","setSelectedKey","toggleSelection","next","delete","add","replaceSelection","isOptionFocusVisible","hasPrimitiveLabel","selectionIndicatorContext","cleanOptionProps","_ariaDescribedby","optionProps","onClick","MouseEvent","wasSelected","PointerEvent","selectOption","_el$23","_tmpl$9","data-selected","data-pressed","_c$3","_el$24","setFocused","childFocusStrategy","selectionBehavior","disallowEmptySelection","disabledBehavior","isEmpty","isSelectAll","isKeyDisabled","setSelectionBehavior","selectAll","clearSelection","toggleSelectAll","extendSelection","Trigger","Value","ListBox","Option"],"sources":["../src/Select.tsx"],"sourcesContent":["/**\n * Select component for solidaria-components\n *\n * A pre-wired headless select that combines state + aria hooks.\n * Port of react-aria-components/src/Select.tsx\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n splitProps,\n useContext,\n For,\n Show,\n untrack,\n} from \"solid-js\";\nimport {\n createSelect,\n createHiddenSelect,\n createListBox,\n createOption,\n createHover,\n createInteractOutside,\n FocusScope,\n focusSafely,\n mergeProps,\n type AriaSelectProps,\n type AriaListBoxProps,\n type AriaOptionProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSelectState,\n type ListState,\n type SelectState,\n type Key,\n type CollectionNode,\n DEFAULT_VALIDATION_RESULT,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport {\n SelectionIndicatorContext,\n type SelectionIndicatorContextValue,\n} from \"./SelectionIndicator\";\nimport { ListBoxLoadMoreItem } from \"./ListBox\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nfunction getNativeSelectValidation(select: HTMLSelectElement): ValidationResult {\n return {\n isInvalid: !select.validity.valid,\n validationDetails: {\n badInput: select.validity.badInput,\n customError: select.validity.customError,\n patternMismatch: select.validity.patternMismatch,\n rangeOverflow: select.validity.rangeOverflow,\n rangeUnderflow: select.validity.rangeUnderflow,\n stepMismatch: select.validity.stepMismatch,\n tooLong: select.validity.tooLong,\n tooShort: select.validity.tooShort,\n typeMismatch: select.validity.typeMismatch,\n valueMissing: select.validity.valueMissing,\n valid: select.validity.valid,\n },\n validationErrors: select.validationMessage ? [select.validationMessage] : [],\n };\n}\n\nexport interface SelectRenderProps {\n /** Whether the select is open. */\n isOpen: boolean;\n /** Whether the select is focused. */\n isFocused: boolean;\n /** Whether the select has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the select is disabled. */\n isDisabled: boolean;\n /** Whether the select is required. */\n isRequired: boolean;\n /** Whether a value is selected. */\n isSelected: boolean;\n}\n\nexport interface SelectProps<T> extends Omit<AriaSelectProps, \"children\">, SlotProps {\n /** The items to render in the select. */\n items: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Selection mode. */\n selectionMode?: \"single\" | \"multiple\";\n /** The currently selected key (controlled). */\n selectedKey?: Key | null;\n /** The default selected key (uncontrolled). */\n defaultSelectedKey?: Key | null;\n /** Currently selected keys (controlled, for multiple selection). */\n selectedKeys?: \"all\" | Iterable<Key>;\n /** Default selected keys (uncontrolled, for multiple selection). */\n defaultSelectedKeys?: \"all\" | Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (key: Key | null) => void;\n /** Handler called when selected keys change. */\n onSelectionChangeKeys?: (keys: \"all\" | Set<Key>) => void;\n /** Whether the select is open (controlled). */\n isOpen?: boolean;\n /** Whether the select is open by default (uncontrolled). */\n defaultOpen?: boolean;\n /** Handler called when the open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** Placeholder text when no option is selected. */\n placeholder?: string;\n /** The name of the select, used when submitting an HTML form. */\n name?: string;\n /** The children of the component (compound components: SelectTrigger, SelectListBox). */\n children: RenderChildren<SelectRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectRenderProps>;\n /** Custom renderer for the outer select element. */\n render?: (\n props: JSX.HTMLAttributes<HTMLDivElement>,\n renderProps: SelectRenderProps,\n ) => JSX.Element;\n /** Ref for the outer select element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface SelectValueRenderProps<T> {\n /** The selected item. */\n selectedItem: CollectionNode<T> | null;\n /** The selected items. */\n selectedItems: CollectionNode<T>[];\n /** The text value of the selected item. */\n selectedText: string | null;\n /** Whether a value is selected. */\n isSelected: boolean;\n /** The placeholder text. */\n placeholder: string | undefined;\n}\n\nexport interface SelectValueProps<T> extends SlotProps {\n /** The children of the value. A function may be provided to receive render props. */\n children?: RenderChildren<SelectValueRenderProps<T>>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectValueRenderProps<T>>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectValueRenderProps<T>>;\n /** Placeholder text when no option is selected. Overrides the placeholder from Select. */\n placeholder?: string;\n}\n\nexport interface SelectTriggerRenderProps {\n /** Whether the select is open. */\n isOpen: boolean;\n /** Whether the trigger is focused. */\n isFocused: boolean;\n /** Whether the trigger has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the trigger is hovered. */\n isHovered: boolean;\n /** Whether the trigger is disabled. */\n isDisabled: boolean;\n}\n\nexport interface SelectTriggerProps extends SlotProps {\n /** The children of the trigger. A function may be provided to receive render props. */\n children?: RenderChildren<SelectTriggerRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectTriggerRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectTriggerRenderProps>;\n}\n\nexport interface SelectListBoxRenderProps {\n /** Whether the listbox is focused. */\n isFocused: boolean;\n}\n\nexport interface SelectListBoxProps<T> extends SlotProps {\n /** The children of the listbox. A function may be provided to render each item. */\n children?: (item: T) => JSX.Element;\n /** Content to display when the listbox has no items. */\n renderEmptyState?: () => JSX.Element;\n /** Called when the load more sentinel becomes visible. */\n onLoadMore?: () => void | Promise<void>;\n /** Whether additional items are currently loading. */\n isLoading?: boolean;\n /** Content to display in the load more sentinel row. */\n renderLoadMore?: () => JSX.Element | undefined;\n /** CSS class for the load more sentinel row. */\n loadMoreClass?: ClassNameOrFunction<{ isLoading: boolean }>;\n /** Whether the listbox is rendered inside an overlay popover. */\n isInPopover?: boolean;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectListBoxRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectListBoxRenderProps>;\n}\n\nexport interface SelectOptionRenderProps {\n /** Whether the option is selected. */\n isSelected: boolean;\n /** Whether the option is focused. */\n isFocused: boolean;\n /** Whether the option has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the option is pressed. */\n isPressed: boolean;\n /** Whether the option is hovered. */\n isHovered: boolean;\n /** Whether the option is disabled. */\n isDisabled: boolean;\n}\n\nexport interface SelectOptionProps<T> extends Omit<AriaOptionProps, \"children\" | \"key\">, SlotProps {\n /** The unique key for the option. */\n id: Key;\n /** The item value. */\n item?: T;\n /** The children of the option. A function may be provided to receive render props. */\n children?: RenderChildren<SelectOptionRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectOptionRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectOptionRenderProps>;\n /** The text value of the option (for typeahead). */\n textValue?: string;\n}\n\ninterface SelectContextValue<T> {\n state: SelectState<T>;\n rootRef: Accessor<HTMLElement | null>;\n triggerRef: Accessor<HTMLElement | null>;\n setTriggerRef: (el: HTMLElement | null) => void;\n triggerProps: JSX.HTMLAttributes<HTMLElement>;\n valueProps: JSX.HTMLAttributes<HTMLElement>;\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n menuProps: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps?: JSX.HTMLAttributes<HTMLElement>;\n validation?: ValidationResult;\n isOpen: Accessor<boolean>;\n isFocused: Accessor<boolean>;\n isFocusVisible: Accessor<boolean>;\n isDisabled: Accessor<boolean>;\n placeholder?: string;\n items: T[];\n renderItem?: (item: T) => JSX.Element;\n slots?: Record<string, Partial<SelectProps<T>>>;\n autoFocus?: boolean;\n}\n\nexport const SelectContext = createContext<SelectContextValue<unknown> | null>(null);\nexport const SelectStateContext = createContext<SelectState<unknown> | null>(null);\nexport const SelectValueContext = SelectContext;\n\nconst selectRootLabelProps = new Set([\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n]);\n\n/**\n * A select displays a collapsible list of options and allows a user to select one of them.\n */\nexport function Select<T>(props: SelectProps<T>): JSX.Element {\n const parentContext = useContext(SelectContext) as SelectContextValue<T> | null;\n const contextSlotProps = parentContext?.slots?.[props.slot ?? \"default\"] as\n | Partial<SelectProps<T>>\n | undefined;\n const mergedSelectProps = (\n contextSlotProps ? mergeProps(contextSlotProps, props) : props\n ) as SelectProps<T>;\n const [local, stateProps, ariaProps] = splitProps(\n mergedSelectProps,\n [\"class\", \"style\", \"render\", \"ref\", \"slot\", \"children\"],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"selectionMode\",\n \"selectedKey\",\n \"defaultSelectedKey\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"onSelectionChangeKeys\",\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"name\",\n ],\n );\n let rootRef: HTMLDivElement | undefined;\n const [selectValidation, setSelectValidation] =\n createSignal<ValidationResult>(DEFAULT_VALIDATION_RESULT);\n const errorMessageId = createUniqueId();\n\n const resolveDisabled = (): boolean => {\n const disabled = ariaProps.isDisabled;\n if (typeof disabled === \"function\") {\n return (disabled as () => boolean)();\n }\n return !!disabled;\n };\n\n const state = createSelectState<T>({\n get items() {\n return stateProps.items;\n },\n get getKey() {\n return stateProps.getKey;\n },\n get getTextValue() {\n return stateProps.getTextValue;\n },\n get getDisabled() {\n return stateProps.getDisabled;\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get selectionMode() {\n return stateProps.selectionMode;\n },\n get selectedKey() {\n return stateProps.selectedKey;\n },\n get defaultSelectedKey() {\n return stateProps.defaultSelectedKey;\n },\n get selectedKeys() {\n return stateProps.selectedKeys;\n },\n get defaultSelectedKeys() {\n return stateProps.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n get onSelectionChangeKeys() {\n return stateProps.onSelectionChangeKeys;\n },\n get isOpen() {\n return stateProps.isOpen;\n },\n get defaultOpen() {\n return stateProps.defaultOpen;\n },\n get onOpenChange() {\n return stateProps.onOpenChange;\n },\n get isDisabled() {\n return resolveDisabled();\n },\n get isRequired() {\n return ariaProps.isRequired;\n },\n });\n\n const selectAriaProps = createMemo(() => {\n const clean: Record<string, unknown> = {};\n for (const key in ariaProps as Record<string, unknown>) {\n if (!key.startsWith(\"data-\")) {\n clean[key] = (ariaProps as Record<string, unknown>)[key];\n }\n }\n return clean as typeof ariaProps;\n });\n\n const { labelProps, triggerProps, valueProps, menuProps, isFocused, isFocusVisible, isOpen } =\n createSelect<T>(selectAriaProps, state);\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return resolveDisabled();\n },\n });\n\n const renderValues = createMemo<SelectRenderProps>(() => ({\n isOpen: isOpen(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: resolveDisabled(),\n isRequired: !!ariaProps.isRequired,\n isSelected:\n state.selectionMode() === \"multiple\"\n ? state.selectedKeys() === \"all\" || (state.selectedKeys() as Set<Key>).size > 0\n : state.selectedKey() != null,\n }));\n const childRenderValues: SelectRenderProps = {\n get isOpen() {\n return isOpen();\n },\n get isFocused() {\n return isFocused();\n },\n get isFocusVisible() {\n return isFocusVisible();\n },\n get isDisabled() {\n return resolveDisabled();\n },\n get isRequired() {\n return !!ariaProps.isRequired;\n },\n get isSelected() {\n return hasSelection();\n },\n };\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n for (const key of selectRootLabelProps) {\n delete filtered[key];\n }\n return filtered;\n });\n\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanLabelProps = () => {\n const { ref: _ref, ...rest } = labelProps as Record<string, unknown>;\n return rest;\n };\n const setRootRef = (el: HTMLDivElement) => {\n rootRef = el;\n assignRef(local.ref, el);\n };\n const validation = createMemo<ValidationResult>(() => {\n const current = selectValidation();\n if (current.isInvalid || !ariaProps.isInvalid) {\n return current;\n }\n\n return {\n ...DEFAULT_VALIDATION_RESULT,\n isInvalid: true,\n };\n });\n const isInvalid = createMemo(() => validation().isInvalid);\n const triggerDescribedBy = () => {\n const ids = [\n (triggerProps as { \"aria-describedby\"?: string })[\"aria-describedby\"],\n isInvalid() ? errorMessageId : undefined,\n ]\n .filter(Boolean)\n .join(\" \")\n .split(\" \")\n .filter(Boolean);\n return ids.length ? Array.from(new Set(ids)).join(\" \") : undefined;\n };\n const triggerPropsWithValidation = () =>\n ({\n ...triggerProps,\n \"aria-describedby\": triggerDescribedBy(),\n }) as JSX.HTMLAttributes<HTMLElement>;\n const fieldErrorContext: FieldErrorContextValue = {\n get validation() {\n return validation();\n },\n get errorMessageProps() {\n return { id: errorMessageId };\n },\n };\n const focusTrigger = () => {\n triggerRef?.focus();\n };\n const hasSelection = () =>\n state.selectionMode() === \"multiple\"\n ? state.selectedKeys() === \"all\" || (state.selectedKeys() as Set<Key>).size > 0\n : state.selectedKey() != null;\n const hasNativeValidation = () => (ariaProps.validationBehavior ?? \"native\") === \"native\";\n const getSelectValidation = (select: HTMLSelectElement): ValidationResult => {\n if (ariaProps.isRequired && !hasSelection()) {\n return {\n isInvalid: true,\n validationDetails: {\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valueMissing: true,\n valid: false,\n },\n validationErrors: [select.validationMessage || \"Constraints not satisfied\"],\n };\n }\n return getNativeSelectValidation(select);\n };\n\n const { containerProps, selectProps: hiddenSelectProps } = createHiddenSelect({\n state,\n name: stateProps.name,\n form: ariaProps.form,\n isRequired: ariaProps.isRequired,\n validationBehavior: ariaProps.validationBehavior ?? \"native\",\n get isDisabled() {\n return resolveDisabled();\n },\n });\n const handleHiddenSelectInvalid: JSX.EventHandler<HTMLSelectElement, Event> = (event) => {\n setSelectValidation(getSelectValidation(event.currentTarget));\n focusTrigger();\n event.preventDefault();\n };\n const handleHiddenSelectChange: JSX.EventHandler<HTMLSelectElement, Event> = (event) => {\n (hiddenSelectProps as { onChange?: JSX.EventHandler<HTMLSelectElement, Event> }).onChange?.(\n event,\n );\n setSelectValidation(\n hasSelection() && event.currentTarget.validity.valid\n ? DEFAULT_VALIDATION_RESULT\n : getSelectValidation(event.currentTarget),\n );\n };\n createEffect(() => {\n if (hasSelection() && selectValidation().isInvalid) {\n setSelectValidation(DEFAULT_VALIDATION_RESULT);\n }\n });\n let triggerRef: HTMLElement | null = null;\n const setTriggerRef = (el: HTMLElement | null) => {\n triggerRef = el;\n };\n\n const RootChildren = () => {\n const selectChildren = untrack(() =>\n typeof local.children === \"function\"\n ? (local.children as (values: SelectRenderProps) => JSX.Element)(childRenderValues)\n : local.children,\n );\n\n return (\n <>\n <div {...containerProps}>\n <select\n {...hiddenSelectProps}\n name={hasSelection() ? undefined : stateProps.name}\n required={\n (hasNativeValidation() && ariaProps.isRequired && !hasSelection()) || undefined\n }\n onInvalid={handleHiddenSelectInvalid}\n onChange={handleHiddenSelectChange}\n >\n <Show when={state.selectionMode() !== \"multiple\"}>\n <option selected={state.selectedKey() == null} />\n </Show>\n <For each={stateProps.items}>\n {(item) => {\n const itemRecord = isObjectRecord(item) ? item : null;\n const fallbackKey =\n itemRecord != null ? (toKey(itemRecord.key) ?? toKey(itemRecord.id)) : undefined;\n const key = stateProps.getKey?.(item) ?? fallbackKey ?? String(item);\n const fallbackTextValue =\n itemRecord != null\n ? (toTextValue(itemRecord.textValue) ?? toTextValue(itemRecord.label))\n : undefined;\n const textValue =\n stateProps.getTextValue?.(item) ?? fallbackTextValue ?? String(item);\n const selectedKeys = state.selectedKeys();\n const isSelected =\n state.selectionMode() === \"multiple\"\n ? selectedKeys === \"all\"\n ? true\n : (selectedKeys as Set<Key>).has(key)\n : key === state.selectedKey();\n return (\n <option value={String(key)} selected={isSelected}>\n {textValue}\n </option>\n );\n }}\n </For>\n </select>\n <Show when={state.selectionMode() === \"multiple\" && stateProps.name}>\n <For\n each={\n state.selectedKeys() === \"all\"\n ? Array.from(state.collection()).map((item) => item.key)\n : Array.from(state.selectedKeys() as Set<Key>)\n }\n >\n {(key) => (\n <input\n type=\"hidden\"\n name={stateProps.name}\n form={ariaProps.form}\n value={String(key)}\n disabled={resolveDisabled()}\n />\n )}\n </For>\n </Show>\n <Show\n when={\n state.selectionMode() !== \"multiple\" && stateProps.name && state.selectedKey() != null\n }\n >\n <input\n type=\"hidden\"\n name={stateProps.name}\n form={ariaProps.form}\n value={String(state.selectedKey())}\n disabled={resolveDisabled()}\n />\n </Show>\n </div>\n <Show when={ariaProps.label}>\n <span {...cleanLabelProps()}>{ariaProps.label as JSX.Element}</span>\n </Show>\n {selectChildren}\n </>\n );\n };\n const baseRootProps = () =>\n ({\n ...domProps(),\n ...cleanHoverProps(),\n ref: setRootRef,\n class: renderProps.class(),\n style: renderProps.style(),\n slot: local.slot,\n \"data-open\": isOpen() || undefined,\n \"data-disabled\": resolveDisabled() || undefined,\n \"data-required\": ariaProps.isRequired || undefined,\n \"data-invalid\": isInvalid() || undefined,\n \"data-hovered\": isHovered() || undefined,\n }) as JSX.HTMLAttributes<HTMLDivElement>;\n const RootContent = () => {\n const renderedRootChildren = <RootChildren />;\n const rootProps = () =>\n ({\n ...baseRootProps(),\n children: renderedRootChildren,\n }) as JSX.HTMLAttributes<HTMLDivElement>;\n\n return local.render ? (\n local.render(rootProps(), renderValues())\n ) : (\n <div {...baseRootProps()}>{renderedRootChildren}</div>\n );\n };\n\n return (\n <SelectContext.Provider\n value={\n {\n state,\n rootRef: () => rootRef ?? null,\n triggerRef: () => triggerRef,\n setTriggerRef,\n get triggerProps() {\n return triggerPropsWithValidation();\n },\n valueProps,\n labelProps,\n menuProps,\n get errorMessageProps() {\n return { id: errorMessageId };\n },\n get validation() {\n return validation();\n },\n isOpen,\n isFocused,\n isFocusVisible,\n isDisabled: resolveDisabled,\n placeholder: ariaProps.placeholder,\n items: stateProps.items,\n autoFocus: !!ariaProps.autoFocus,\n } as SelectContextValue<unknown>\n }\n >\n <SelectStateContext.Provider value={state}>\n <FieldErrorContext.Provider value={fieldErrorContext}>\n <RootContent />\n </FieldErrorContext.Provider>\n </SelectStateContext.Provider>\n </SelectContext.Provider>\n );\n}\n\n/**\n * The trigger button for a select.\n */\nexport function SelectTrigger(props: SelectTriggerProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\"]);\n\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error(\"SelectTrigger must be used within a Select\");\n }\n const { isOpen, isFocused, isFocusVisible, state } = context;\n let triggerRef: HTMLButtonElement | undefined;\n const setTriggerRef = (el: HTMLButtonElement) => {\n triggerRef = el;\n context.setTriggerRef(el);\n };\n\n createEffect(() => {\n if (context.autoFocus) {\n triggerRef?.focus();\n }\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n const renderValues = createMemo<SelectTriggerRenderProps>(() => ({\n isOpen: isOpen(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isDisabled: state.isDisabled,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-trigger\",\n },\n renderValues,\n );\n\n const cleanTriggerProps = () => {\n const { ref: _ref1, ...rest } = context.triggerProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const triggerAriaProps = () => context.triggerProps as Record<string, unknown>;\n const menuAriaProps = () => context.menuProps as Record<string, unknown>;\n return (\n <button\n ref={setTriggerRef}\n {...domProps}\n {...cleanTriggerProps()}\n {...cleanHoverProps()}\n type=\"button\"\n id={triggerAriaProps().id as string | undefined}\n tabIndex={state.isDisabled ? undefined : 0}\n aria-label={triggerAriaProps()[\"aria-label\"] as string | undefined}\n aria-labelledby={triggerAriaProps()[\"aria-labelledby\"] as string | undefined}\n aria-haspopup=\"listbox\"\n aria-expanded={isOpen()}\n aria-controls={isOpen() ? (menuAriaProps().id as string | undefined) : undefined}\n aria-disabled={state.isDisabled || undefined}\n aria-required={triggerAriaProps()[\"aria-required\"] as boolean | undefined}\n aria-describedby={triggerAriaProps()[\"aria-describedby\"] as string | undefined}\n class={renderProps.class()}\n style={renderProps.style()}\n data-open={isOpen() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={state.isDisabled || undefined}\n >\n {renderProps.renderChildren()}\n </button>\n );\n}\n\n// Default children function for SelectValue - defined at module level for SSR stability\nfunction defaultSelectValueChildren<T>(values: SelectValueRenderProps<T>) {\n return values.selectedText ?? values.placeholder ?? \"\";\n}\n\n/**\n * Displays the selected value in a select.\n */\nexport function SelectValue<T>(props: SelectValueProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"placeholder\",\n \"children\",\n ]);\n\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error(\"SelectValue must be used within a Select\");\n }\n const { valueProps, placeholder: contextPlaceholder } = context;\n const state = context.state as SelectState<T>;\n\n const placeholder = () => local.placeholder ?? contextPlaceholder;\n\n const renderValues = createMemo<SelectValueRenderProps<T>>(() => {\n const collection = state.collection();\n const selectedItem =\n state.selectedKey() == null ? null : collection.getItem(state.selectedKey() as Key);\n const selectedKeys = state.selectedKeys();\n const selectedItems =\n selectedKeys === \"all\"\n ? Array.from(collection)\n : Array.from(selectedKeys as Set<Key>)\n .map((key) => collection.getItem(key))\n .filter((item): item is CollectionNode<T> => item != null);\n const selectedText =\n state.selectionMode() === \"multiple\"\n ? selectedItems.length > 0\n ? new Intl.ListFormat(undefined, { style: \"long\", type: \"conjunction\" }).format(\n selectedItems.map((item) => item.textValue),\n )\n : null\n : (selectedItem?.textValue ?? null);\n return {\n selectedItem,\n selectedItems,\n selectedText,\n isSelected:\n state.selectionMode() === \"multiple\" ? selectedItems.length > 0 : selectedItem != null,\n placeholder: placeholder(),\n };\n });\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children ?? defaultSelectValueChildren;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-value\",\n },\n renderValues,\n );\n\n return (\n <span\n {...domProps}\n {...valueProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-placeholder={!renderValues().isSelected || undefined}\n >\n {props.children == null\n ? (renderValues().selectedText ?? renderValues().placeholder ?? \"\")\n : renderProps.renderChildren()}\n </span>\n );\n}\n\n/**\n * The listbox popup for a select.\n */\nexport function SelectListBox<T>(props: SelectListBoxProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"children\",\n \"renderEmptyState\",\n \"onLoadMore\",\n \"isLoading\",\n \"renderLoadMore\",\n \"loadMoreClass\",\n \"isInPopover\",\n ]);\n\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error(\"SelectListBox must be used within a Select\");\n }\n const { menuProps, rootRef, state: selectState, isOpen } = context;\n const state = selectState as SelectState<T>;\n\n createEffect(() => {\n if (!isOpen()) {\n return;\n }\n if (state.focusedKey() != null) {\n return;\n }\n const selectedKey = state.selectedKey();\n if (selectedKey != null && !state.collection().getItem(selectedKey)?.isDisabled) {\n state.setFocusedKey(selectedKey);\n }\n });\n\n let listBoxRef: HTMLUListElement | undefined;\n\n createInteractOutside({\n ref: () => rootRef() ?? listBoxRef ?? null,\n onInteractOutside: () => {\n if (isOpen()) {\n state.close();\n }\n },\n get isDisabled() {\n return !isOpen() || local.isInPopover === true;\n },\n });\n\n const { listBoxProps } = createListBox(\n {\n ...(menuProps as unknown as AriaListBoxProps),\n shouldSelectOnPressUp: true,\n shouldFocusOnHover: true,\n shouldSelectOnFocus: local.isInPopover === true ? false : undefined,\n get isDisabled() {\n return state.isDisabled;\n },\n },\n createSelectListStateAdapter(state),\n );\n\n const renderValues = createMemo<SelectListBoxRenderProps>(() => ({\n // Focus within the listbox itself (the selection manager's focus state),\n // not the select-level trigger focus.\n isFocused: state.selectionManager.isFocused,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-listbox\",\n },\n renderValues,\n );\n\n const cleanMenuProps = () => {\n const { ref: _ref1, ...rest } = menuProps as Record<string, unknown>;\n return rest;\n };\n const cleanListBoxProps = () => {\n const { ref: _ref2, ...rest } = listBoxProps as Record<string, unknown>;\n return rest;\n };\n\n const items = () => Array.from(state.collection());\n createEffect(() => {\n if (!isOpen()) return;\n const focusedKey = state.focusedKey();\n if (focusedKey == null) return;\n\n queueMicrotask(() => {\n const option = Array.from(\n listBoxRef?.querySelectorAll<HTMLElement>(\"[role='option']\") ?? [],\n ).find((element) => element.id === String(focusedKey));\n if (option && document.activeElement !== option) {\n focusSafely(option);\n }\n });\n });\n\n const listBox = () => (\n <ul\n ref={(el) => (listBoxRef = el)}\n {...domProps}\n {...cleanMenuProps()}\n {...cleanListBoxProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={state.selectionManager.isFocused || undefined}\n data-empty={state.collection().size === 0 || undefined}\n >\n {state.collection().size === 0 && local.renderEmptyState ? (\n <li role=\"option\" style={{ display: \"contents\" }} data-empty-state>\n {local.renderEmptyState()}\n </li>\n ) : (\n <Show\n when={local.children}\n fallback={\n <For each={items()}>\n {(node) => <SelectOption id={node.key}>{node.textValue}</SelectOption>}\n </For>\n }\n >\n <For each={items()}>\n {(node) => (node.value != null ? local.children!(node.value) : null)}\n </For>\n </Show>\n )}\n <Show when={local.onLoadMore}>\n <ListBoxLoadMoreItem\n onLoadMore={local.onLoadMore!}\n isLoading={local.isLoading}\n class={local.loadMoreClass}\n >\n {local.renderLoadMore?.()}\n </ListBoxLoadMoreItem>\n </Show>\n </ul>\n );\n\n return (\n <Show when={isOpen()}>\n <Show\n when={local.isInPopover}\n fallback={\n <FocusScope restoreFocus autoFocus>\n {listBox()}\n </FocusScope>\n }\n >\n {listBox()}\n </Show>\n </Show>\n );\n}\n\n/**\n * An option in a select listbox.\n */\nexport function SelectOption<T>(props: SelectOptionProps<T>): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"id\",\n \"item\",\n \"textValue\",\n ]);\n\n const context = useContext(SelectStateContext);\n if (!context) {\n throw new Error(\"SelectOption must be used within a Select\");\n }\n const state = context as SelectState<T>;\n const selectContext = useContext(SelectContext) as SelectContextValue<T> | null;\n const [ref, setRef] = createSignal<HTMLLIElement | null>(null);\n\n const optionAria = createOption<T>(\n {\n key: local.id,\n get isDisabled() {\n return Boolean(ariaProps.isDisabled || selectContext?.isDisabled());\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"] ?? local.textValue;\n },\n shouldSelectOnPressUp: true,\n shouldFocusOnHover: true,\n get onHoverStart() {\n return ariaProps.onHoverStart;\n },\n get onHoverEnd() {\n return ariaProps.onHoverEnd;\n },\n get onHoverChange() {\n return ariaProps.onHoverChange;\n },\n },\n {\n ...createSelectListStateAdapter(state),\n select: (key: Key) => {\n if (state.selectionMode() === \"multiple\") {\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n state.setSelectedKeys(new Set([...keys, key]));\n return;\n }\n state.setSelectedKey(key);\n state.close();\n },\n toggleSelection: (key: Key) => {\n if (state.selectionMode() === \"multiple\") {\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n const next = new Set(keys);\n if (next.has(key)) next.delete(key);\n else next.add(key);\n state.setSelectedKeys(next);\n return;\n }\n state.setSelectedKey(key);\n state.close();\n },\n replaceSelection: (key: Key) => {\n state.setSelectedKey(key);\n if (state.selectionMode() !== \"multiple\") {\n state.close();\n }\n },\n },\n () => ref(),\n );\n const isOptionFocusVisible = () =>\n optionAria.isFocused() && (selectContext?.isFocusVisible() ?? optionAria.isFocusVisible());\n\n const renderValues = createMemo<SelectOptionRenderProps>(() => ({\n isSelected: optionAria.isSelected(),\n isFocused: optionAria.isFocused(),\n isFocusVisible: isOptionFocusVisible(),\n isPressed: optionAria.isPressed(),\n isHovered: optionAria.isHovered(),\n isDisabled: optionAria.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-option\",\n },\n renderValues,\n );\n const hasPrimitiveLabel = () => {\n return typeof props.children === \"string\" || typeof props.children === \"number\";\n };\n\n const selectionIndicatorContext = createMemo<SelectionIndicatorContextValue>(() => ({\n isSelected: optionAria.isSelected,\n }));\n\n const cleanOptionProps = () => {\n const {\n ref: _ref1,\n \"aria-describedby\": _ariaDescribedby,\n ...rest\n } = optionAria.optionProps as Record<string, unknown>;\n if (!hasPrimitiveLabel() && rest[\"aria-label\"] == null) {\n delete rest[\"aria-labelledby\"];\n }\n const onClick = rest.onClick as ((event: MouseEvent) => void) | undefined;\n rest.onClick = ((event: MouseEvent) => {\n const wasSelected = optionAria.isSelected();\n onClick?.(event);\n if (typeof PointerEvent === \"undefined\") {\n return;\n }\n queueMicrotask(() => {\n if (state.selectionMode() !== \"multiple\" || optionAria.isSelected() === wasSelected) {\n selectOption();\n }\n });\n }) as JSX.EventHandler<HTMLLIElement, MouseEvent>;\n return rest;\n };\n const selectOption = () => {\n if (optionAria.isDisabled()) {\n return;\n }\n if (state.selectionMode() === \"multiple\") {\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n const next = new Set(keys);\n if (next.has(local.id)) next.delete(local.id);\n else next.add(local.id);\n state.setSelectedKeys(next);\n return;\n }\n state.setSelectedKey(local.id);\n state.close();\n };\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n <li\n ref={setRef}\n {...cleanOptionProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={optionAria.isSelected() || undefined}\n data-focused={optionAria.isFocused() || undefined}\n data-focus-visible={isOptionFocusVisible() || undefined}\n data-pressed={optionAria.isPressed() || undefined}\n data-hovered={optionAria.isHovered() || undefined}\n data-disabled={optionAria.isDisabled() || undefined}\n >\n {hasPrimitiveLabel() ? (\n <span {...optionAria.labelProps}>{renderProps.renderChildren()}</span>\n ) : (\n renderProps.renderChildren()\n )}\n </li>\n </SelectionIndicatorContext.Provider>\n );\n}\n\nfunction isObjectRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction toKey(value: unknown): Key | undefined {\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value;\n }\n return undefined;\n}\n\nfunction toTextValue(value: unknown): string | undefined {\n if (typeof value === \"string\" || typeof value === \"number\") {\n return String(value);\n }\n return undefined;\n}\n\nfunction createSelectListStateAdapter<T>(state: SelectState<T>): ListState<T> {\n const selectedKeys = createMemo(() => {\n const keys = state.selectedKeys();\n return keys === \"all\" ? new Set(Array.from(state.collection()).map((item) => item.key)) : keys;\n });\n\n const disabledKeys = createMemo(() => {\n const keys = new Set<Key>();\n for (const node of state.collection()) {\n if (node.isDisabled) keys.add(node.key);\n }\n return keys;\n });\n\n return {\n collection: state.collection,\n selectionManager: state.selectionManager,\n // Collection-level focus (the selection manager's), not the select-level\n // trigger focus — upstream listbox internals only ever read\n // state.selectionManager.isFocused.\n isFocused: () => state.selectionManager.isFocused,\n setFocused: (isFocused) => state.selectionManager.setFocused(isFocused),\n focusedKey: state.focusedKey,\n setFocusedKey: (key) => state.setFocusedKey(key ?? null),\n childFocusStrategy: () => null,\n selectionMode: () => state.selectionMode(),\n selectionBehavior: () => \"replace\",\n disallowEmptySelection: () => true,\n selectedKeys,\n disabledKeys,\n disabledBehavior: () => \"all\",\n isEmpty: () => selectedKeys().size === 0,\n isSelectAll: () => state.selectedKeys() === \"all\",\n isSelected: (key) => selectedKeys().has(key),\n isDisabled: state.isKeyDisabled,\n setSelectionBehavior: () => {},\n toggleSelection: (key) => {\n if (state.selectionMode() !== \"multiple\") {\n state.setSelectedKey(key);\n return;\n }\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n const next = new Set(keys);\n if (next.has(key)) next.delete(key);\n else next.add(key);\n state.setSelectedKeys(next);\n },\n replaceSelection: (key) => state.setSelectedKey(key),\n setSelectedKeys: (keys) => state.setSelectedKeys(keys),\n selectAll: () => {},\n clearSelection: () =>\n state.selectionMode() === \"multiple\" ? state.setSelectedKeys([]) : state.setSelectedKey(null),\n toggleSelectAll: () => {},\n extendSelection: (toKey) => state.setSelectedKey(toKey),\n select: (key) =>\n state.selectionMode() === \"multiple\"\n ? state.setSelectedKeys([\n ...(state.selectedKeys() === \"all\" ? [] : (state.selectedKeys() as Set<Key>)),\n key,\n ])\n : state.setSelectedKey(key),\n };\n}\n\nSelect.Trigger = SelectTrigger;\nSelect.Value = SelectValue;\nSelect.ListBox = SelectListBox;\nSelect.Option = SelectOption;\n"],"mappings":";;;;;;;;;;;;;;;;AA6DA,SAAS8C,UAAaC,KAAiBJ,IAAa;CAClD,IAAI,CAACI,KAAK;CACV,IAAI,OAAOA,QAAQ,YACjBA,IAAIJ,EAAE;MAENI,IAAIF,UAAUF;AAElB;AAEA,SAASK,0BAA0BC,QAA6C;CAC9E,OAAO;EACLE,WAAW,CAACF,OAAOG,SAASC;EAC5BC,mBAAmB;GACjBC,UAAUN,OAAOG,SAASG;GAC1BC,aAAaP,OAAOG,SAASI;GAC7BC,iBAAiBR,OAAOG,SAASK;GACjCC,eAAeT,OAAOG,SAASM;GAC/BC,gBAAgBV,OAAOG,SAASO;GAChCC,cAAcX,OAAOG,SAASQ;GAC9BC,SAASZ,OAAOG,SAASS;GACzBC,UAAUb,OAAOG,SAASU;GAC1BC,cAAcd,OAAOG,SAASW;GAC9BC,cAAcf,OAAOG,SAASY;GAC9BX,OAAOJ,OAAOG,SAASC;EACzB;EACAY,kBAAkBhB,OAAOiB,oBAAoB,CAACjB,OAAOiB,iBAAiB,IAAI,CAAA;CAC5E;AACF;AA+LA,MAAa+E,gBAAgB/I,cAAkD,IAAI;AACnF,MAAagJ,qBAAqBhJ,cAA2C,IAAI;AACjF,MAAaiJ,qBAAqBF;AAElC,MAAMG,uBAAuB,IAAIxD,IAAI;CACnC;CACA;CACA;CACA;AAAc,CACf;;;;AAKD,SAAgByD,OAAUhD,OAAoC;CAE5D,MAAMkD,mBADgB/I,WAAWyI,aACRK,CAAa,EAAET,QAAQxC,MAAMmD,QAAQ;CAM9D,MAAM,CAACE,OAAOC,YAAYC,aAAarJ,WAFrC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A,MAAME,OAAOsC,MAAM3C,aAAa;GAChC,IAAIK,SAAS,OAAO;GACpB,MAAMmR,OAAO,IAAIlR,IAAID,IAAI;GACzB,IAAImR,KAAKpH,IAAIjK,GAAG,GAAGqR,KAAKC,OAAOtR,GAAG;QAC7BqR,KAAKE,IAAIvR,GAAG;GACjBwC,MAAM0O,gBAAgBG,IAAI;EAC5B;EACAG,mBAAmBxR,QAAQwC,MAAM2O,eAAenR,GAAG;EACnDkR,kBAAkBhR,SAASsC,MAAM0O,gBAAgBhR,IAAI;EACrDiT,iBAAiB,CAAC;EAClBC,sBACE5Q,MAAM9C,cAAc,MAAM,aAAa8C,MAAM0O,gBAAgB,CAAA,CAAE,IAAI1O,MAAM2O,eAAe,IAAI;EAC9FkC,uBAAuB,CAAC;EACxBC,kBAAkB1J,UAAUpH,MAAM2O,eAAevH,KAAK;EACtDpM,SAASwC,QACPwC,MAAM9C,cAAc,MAAM,aACtB8C,MAAM0O,gBAAgB,CACpB,GAAI1O,MAAM3C,aAAa,MAAM,QAAQ,CAAA,IAAM2C,MAAM3C,aAAa,GAC9DG,GAAG,CACJ,IACDwC,MAAM2O,eAAenR,GAAG;CAChC;AACF;AAEA4D,OAAO2P,UAAUzH;AACjBlI,OAAO4P,QAAQ/F;AACf7J,OAAO6P,UAAUtF;AACjBvK,OAAO8P,SAASjD"}
1
+ {"version":3,"file":"Select.js","names":["JSX","Accessor","createContext","createEffect","createMemo","createSignal","createUniqueId","splitProps","useContext","For","Show","untrack","createSelect","createHiddenSelect","createListBox","createOption","createHover","createInteractOutside","FocusScope","focusSafely","mergeProps","AriaSelectProps","AriaListBoxProps","AriaOptionProps","createSelectState","ListState","SelectState","Key","CollectionNode","DEFAULT_VALIDATION_RESULT","ValidationResult","FieldErrorContext","FieldErrorContextValue","RenderChildren","ClassNameOrFunction","StyleOrFunction","SlotProps","useRenderProps","filterDOMProps","SelectionIndicatorContext","SelectionIndicatorContextValue","ListBoxLoadMoreItem","RefLike","el","T","current","assignRef","ref","getNativeSelectValidation","select","HTMLSelectElement","isInvalid","validity","valid","validationDetails","badInput","customError","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing","validationErrors","validationMessage","SelectRenderProps","isOpen","isFocused","isFocusVisible","isDisabled","isRequired","isSelected","SelectProps","Omit","items","getKey","item","getTextValue","getDisabled","disabledKeys","Iterable","selectionMode","selectedKey","defaultSelectedKey","selectedKeys","defaultSelectedKeys","onSelectionChange","key","onSelectionChangeKeys","keys","Set","defaultOpen","onOpenChange","placeholder","name","children","class","style","render","props","HTMLAttributes","HTMLDivElement","renderProps","Element","SelectValueRenderProps","selectedItem","selectedItems","selectedText","SelectValueProps","SelectTriggerRenderProps","isHovered","isPressed","SelectTriggerProps","HTMLButtonElement","SelectListBoxRenderProps","SelectListBoxProps","renderEmptyState","onLoadMore","Promise","isLoading","renderLoadMore","loadMoreClass","isInPopover","SelectOptionRenderProps","SelectOptionProps","id","textValue","SelectContextValue","state","rootRef","HTMLElement","triggerRef","setTriggerRef","triggerProps","valueProps","labelProps","menuProps","errorMessageProps","validation","renderItem","slots","Record","Partial","autoFocus","SelectContext","SelectStateContext","SelectValueContext","selectRootLabelProps","Select","parentContext","contextSlotProps","slot","mergedSelectProps","local","stateProps","ariaProps","selectValidation","setSelectValidation","errorMessageId","resolveDisabled","disabled","selectAriaProps","clean","startsWith","hoverProps","renderValues","size","childRenderValues","hasSelection","defaultClassName","domProps","filtered","global","cleanHoverProps","_ref","rest","cleanLabelProps","setRootRef","triggerDescribedBy","ids","undefined","filter","Boolean","join","split","length","Array","from","triggerPropsWithValidation","fieldErrorContext","focusTrigger","focus","hasNativeValidation","validationBehavior","getSelectValidation","containerProps","selectProps","hiddenSelectProps","form","handleHiddenSelectInvalid","EventHandler","Event","event","currentTarget","preventDefault","handleHiddenSelectChange","onChange","RootChildren","selectChildren","values","_$createComponent","when","label","_el$","_$getNextElement","_tmpl$","_$spread","_$mergeProps","_$insert","_$runHydrationEvents","_el$2","_tmpl$4","_el$3","firstChild","_el$5","_el$6","_co$","_$getNextMarker","nextSibling","_el$7","_el$8","_co$2","_el$0","_el$1","_co$3","_el$10","_el$11","_co$4","_$memo","required","_el$4","_tmpl$2","_$effect","_$setProperty","each","itemRecord","isObjectRecord","fallbackKey","toKey","String","fallbackTextValue","toTextValue","title","has","_el$12","collection","map","_el$13","_tmpl$3","_p$","_v$4","_v$5","_v$6","e","_$setAttribute","t","a","_el$9","_v$","_v$2","_v$3","baseRootProps","RootContent","renderedRootChildren","rootProps","_el$14","_tmpl$5","Provider","value","SelectTrigger","context","Error","cleanTriggerProps","_ref1","_ref2","triggerAriaProps","menuAriaProps","_el$15","_tmpl$6","_$use","tabIndex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-disabled","aria-required","aria-describedby","data-open","data-focused","data-focus-visible","data-hovered","data-disabled","renderChildren","defaultSelectValueChildren","SelectValue","contextPlaceholder","getItem","Intl","ListFormat","type","format","_el$16","data-placeholder","_c$","SelectListBox","selectState","selectionManager","setFocused","focusedKey","setFocusedKey","listBoxRef","onInteractOutside","close","listBoxHook","shouldSelectOnPressUp","shouldFocusOnHover","shouldSelectOnFocus","createSelectListStateAdapter","cleanMenuProps","cleanListBoxProps","_activeDescendant","onFocus","_onFocus","listBoxProps","queueMicrotask","option","querySelectorAll","find","element","document","activeElement","listBox","_el$17","_tmpl$7","_el$18","_el$19","_co$5","_el$20","_el$21","_co$6","data-empty","_c$2","_el$22","_tmpl$8","fallback","node","SelectOption","restoreFocus","selectContext","setRefSignal","setRef","optionAria","onHoverStart","onHoverEnd","onHoverChange","setSelectedKeys","setSelectedKey","toggleSelection","next","delete","add","replaceSelection","isOptionFocusVisible","hasPrimitiveLabel","selectionIndicatorContext","cleanOptionProps","_ariaDescribedby","optionProps","onClick","MouseEvent","wasSelected","PointerEvent","selectOption","_el$23","data-selected","data-pressed","_c$3","_el$24","childFocusStrategy","selectionBehavior","disallowEmptySelection","disabledBehavior","isEmpty","isSelectAll","isKeyDisabled","setSelectionBehavior","selectAll","clearSelection","toggleSelectAll","extendSelection","Trigger","Value","ListBox","Option"],"sources":["../src/Select.tsx"],"sourcesContent":["/**\n * Select component for solidaria-components\n *\n * A pre-wired headless select that combines state + aria hooks.\n * Port of react-aria-components/src/Select.tsx\n */\n\nimport {\n type JSX,\n type Accessor,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n splitProps,\n useContext,\n For,\n Show,\n untrack,\n} from \"solid-js\";\nimport {\n createSelect,\n createHiddenSelect,\n createListBox,\n createOption,\n createHover,\n createInteractOutside,\n FocusScope,\n focusSafely,\n mergeProps,\n type AriaSelectProps,\n type AriaListBoxProps,\n type AriaOptionProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createSelectState,\n type ListState,\n type SelectState,\n type Key,\n type CollectionNode,\n DEFAULT_VALIDATION_RESULT,\n type ValidationResult,\n} from \"@proyecto-viviana/solid-stately\";\nimport { FieldErrorContext, type FieldErrorContextValue } from \"./FieldError\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n filterDOMProps,\n} from \"./utils\";\nimport {\n SelectionIndicatorContext,\n type SelectionIndicatorContextValue,\n} from \"./SelectionIndicator\";\nimport { ListBoxLoadMoreItem } from \"./ListBox\";\n\ntype RefLike<T> = ((el: T) => void) | { current?: T | null } | undefined;\n\nfunction assignRef<T>(ref: RefLike<T>, el: T): void {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(el);\n } else {\n ref.current = el;\n }\n}\n\nfunction getNativeSelectValidation(select: HTMLSelectElement): ValidationResult {\n return {\n isInvalid: !select.validity.valid,\n validationDetails: {\n badInput: select.validity.badInput,\n customError: select.validity.customError,\n patternMismatch: select.validity.patternMismatch,\n rangeOverflow: select.validity.rangeOverflow,\n rangeUnderflow: select.validity.rangeUnderflow,\n stepMismatch: select.validity.stepMismatch,\n tooLong: select.validity.tooLong,\n tooShort: select.validity.tooShort,\n typeMismatch: select.validity.typeMismatch,\n valueMissing: select.validity.valueMissing,\n valid: select.validity.valid,\n },\n validationErrors: select.validationMessage ? [select.validationMessage] : [],\n };\n}\n\nexport interface SelectRenderProps {\n /** Whether the select is open. */\n isOpen: boolean;\n /** Whether the select is focused. */\n isFocused: boolean;\n /** Whether the select has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the select is disabled. */\n isDisabled: boolean;\n /** Whether the select is required. */\n isRequired: boolean;\n /** Whether a value is selected. */\n isSelected: boolean;\n}\n\nexport interface SelectProps<T> extends Omit<AriaSelectProps, \"children\">, SlotProps {\n /** The items to render in the select. */\n items: T[];\n /** Function to get the key from an item. */\n getKey?: (item: T) => Key;\n /** Function to get the text value from an item. */\n getTextValue?: (item: T) => string;\n /** Function to check if an item is disabled. */\n getDisabled?: (item: T) => boolean;\n /** Keys of disabled items. */\n disabledKeys?: Iterable<Key>;\n /** Selection mode. */\n selectionMode?: \"single\" | \"multiple\";\n /** The currently selected key (controlled). */\n selectedKey?: Key | null;\n /** The default selected key (uncontrolled). */\n defaultSelectedKey?: Key | null;\n /** Currently selected keys (controlled, for multiple selection). */\n selectedKeys?: \"all\" | Iterable<Key>;\n /** Default selected keys (uncontrolled, for multiple selection). */\n defaultSelectedKeys?: \"all\" | Iterable<Key>;\n /** Handler called when selection changes. */\n onSelectionChange?: (key: Key | null) => void;\n /** Handler called when selected keys change. */\n onSelectionChangeKeys?: (keys: \"all\" | Set<Key>) => void;\n /** Whether the select is open (controlled). */\n isOpen?: boolean;\n /** Whether the select is open by default (uncontrolled). */\n defaultOpen?: boolean;\n /** Handler called when the open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** Placeholder text when no option is selected. */\n placeholder?: string;\n /** The name of the select, used when submitting an HTML form. */\n name?: string;\n /** The children of the component (compound components: SelectTrigger, SelectListBox). */\n children: RenderChildren<SelectRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectRenderProps>;\n /** Custom renderer for the outer select element. */\n render?: (\n props: JSX.HTMLAttributes<HTMLDivElement>,\n renderProps: SelectRenderProps,\n ) => JSX.Element;\n /** Ref for the outer select element. */\n ref?: RefLike<HTMLDivElement>;\n}\n\nexport interface SelectValueRenderProps<T> {\n /** The selected item. */\n selectedItem: CollectionNode<T> | null;\n /** The selected items. */\n selectedItems: CollectionNode<T>[];\n /** The text value of the selected item. */\n selectedText: string | null;\n /** Whether a value is selected. */\n isSelected: boolean;\n /** The placeholder text. */\n placeholder: string | undefined;\n}\n\nexport interface SelectValueProps<T> extends SlotProps {\n /** The children of the value. A function may be provided to receive render props. */\n children?: RenderChildren<SelectValueRenderProps<T>>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectValueRenderProps<T>>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectValueRenderProps<T>>;\n /** Placeholder text when no option is selected. Overrides the placeholder from Select. */\n placeholder?: string;\n}\n\nexport interface SelectTriggerRenderProps {\n /** Whether the select is open. */\n isOpen: boolean;\n /** Whether the trigger is focused. */\n isFocused: boolean;\n /** Whether the trigger has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the trigger is hovered. */\n isHovered: boolean;\n /** Whether the trigger is pressed. */\n isPressed: boolean;\n /** Whether the trigger is disabled. */\n isDisabled: boolean;\n}\n\nexport interface SelectTriggerProps extends SlotProps {\n /** A ref callback/object for the underlying trigger button element. */\n ref?: RefLike<HTMLButtonElement>;\n /** The children of the trigger. A function may be provided to receive render props. */\n children?: RenderChildren<SelectTriggerRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectTriggerRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectTriggerRenderProps>;\n}\n\nexport interface SelectListBoxRenderProps {\n /** Whether the listbox is focused. */\n isFocused: boolean;\n}\n\nexport interface SelectListBoxProps<T> extends SlotProps {\n /** The children of the listbox. A function may be provided to render each item. */\n children?: (item: T) => JSX.Element;\n /** Content to display when the listbox has no items. */\n renderEmptyState?: () => JSX.Element;\n /** Called when the load more sentinel becomes visible. */\n onLoadMore?: () => void | Promise<void>;\n /** Whether additional items are currently loading. */\n isLoading?: boolean;\n /** Content to display in the load more sentinel row. */\n renderLoadMore?: () => JSX.Element | undefined;\n /** CSS class for the load more sentinel row. */\n loadMoreClass?: ClassNameOrFunction<{ isLoading: boolean }>;\n /** Whether the listbox is rendered inside an overlay popover. */\n isInPopover?: boolean;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectListBoxRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectListBoxRenderProps>;\n}\n\nexport interface SelectOptionRenderProps {\n /** Whether the option is selected. */\n isSelected: boolean;\n /** Whether the option is focused. */\n isFocused: boolean;\n /** Whether the option has keyboard focus. */\n isFocusVisible: boolean;\n /** Whether the option is pressed. */\n isPressed: boolean;\n /** Whether the option is hovered. */\n isHovered: boolean;\n /** Whether the option is disabled. */\n isDisabled: boolean;\n}\n\nexport interface SelectOptionProps<T> extends Omit<AriaOptionProps, \"children\" | \"key\">, SlotProps {\n /** A ref callback/object for the underlying option element. */\n ref?: RefLike<HTMLDivElement>;\n /** The unique key for the option. */\n id: Key;\n /** The item value. */\n item?: T;\n /** The children of the option. A function may be provided to receive render props. */\n children?: RenderChildren<SelectOptionRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<SelectOptionRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<SelectOptionRenderProps>;\n /** The text value of the option (for typeahead). */\n textValue?: string;\n}\n\ninterface SelectContextValue<T> {\n state: SelectState<T>;\n rootRef: Accessor<HTMLElement | null>;\n triggerRef: Accessor<HTMLElement | null>;\n setTriggerRef: (el: HTMLElement | null) => void;\n triggerProps: JSX.HTMLAttributes<HTMLElement>;\n valueProps: JSX.HTMLAttributes<HTMLElement>;\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n menuProps: JSX.HTMLAttributes<HTMLElement>;\n errorMessageProps?: JSX.HTMLAttributes<HTMLElement>;\n validation?: ValidationResult;\n isOpen: Accessor<boolean>;\n isFocused: Accessor<boolean>;\n isFocusVisible: Accessor<boolean>;\n isPressed: Accessor<boolean>;\n isDisabled: Accessor<boolean>;\n placeholder?: string;\n items: T[];\n renderItem?: (item: T) => JSX.Element;\n slots?: Record<string, Partial<SelectProps<T>>>;\n autoFocus?: boolean;\n}\n\nexport const SelectContext = createContext<SelectContextValue<unknown> | null>(null);\nexport const SelectStateContext = createContext<SelectState<unknown> | null>(null);\nexport const SelectValueContext = SelectContext;\n\nconst selectRootLabelProps = new Set([\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n]);\n\n/**\n * A select displays a collapsible list of options and allows a user to select one of them.\n */\nexport function Select<T>(props: SelectProps<T>): JSX.Element {\n const parentContext = useContext(SelectContext) as SelectContextValue<T> | null;\n const contextSlotProps = parentContext?.slots?.[props.slot ?? \"default\"] as\n | Partial<SelectProps<T>>\n | undefined;\n const mergedSelectProps = (\n contextSlotProps ? mergeProps(contextSlotProps, props) : props\n ) as SelectProps<T>;\n const [local, stateProps, ariaProps] = splitProps(\n mergedSelectProps,\n [\"class\", \"style\", \"render\", \"ref\", \"slot\", \"children\"],\n [\n \"items\",\n \"getKey\",\n \"getTextValue\",\n \"getDisabled\",\n \"disabledKeys\",\n \"selectionMode\",\n \"selectedKey\",\n \"defaultSelectedKey\",\n \"selectedKeys\",\n \"defaultSelectedKeys\",\n \"onSelectionChange\",\n \"onSelectionChangeKeys\",\n \"isOpen\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"name\",\n ],\n );\n let rootRef: HTMLDivElement | undefined;\n const [selectValidation, setSelectValidation] =\n createSignal<ValidationResult>(DEFAULT_VALIDATION_RESULT);\n const errorMessageId = createUniqueId();\n\n const resolveDisabled = (): boolean => {\n const disabled = ariaProps.isDisabled;\n if (typeof disabled === \"function\") {\n return (disabled as () => boolean)();\n }\n return !!disabled;\n };\n\n const state = createSelectState<T>({\n get items() {\n return stateProps.items;\n },\n get getKey() {\n return stateProps.getKey;\n },\n get getTextValue() {\n return stateProps.getTextValue;\n },\n get getDisabled() {\n return stateProps.getDisabled;\n },\n get disabledKeys() {\n return stateProps.disabledKeys;\n },\n get selectionMode() {\n return stateProps.selectionMode;\n },\n get selectedKey() {\n return stateProps.selectedKey;\n },\n get defaultSelectedKey() {\n return stateProps.defaultSelectedKey;\n },\n get selectedKeys() {\n return stateProps.selectedKeys;\n },\n get defaultSelectedKeys() {\n return stateProps.defaultSelectedKeys;\n },\n get onSelectionChange() {\n return stateProps.onSelectionChange;\n },\n get onSelectionChangeKeys() {\n return stateProps.onSelectionChangeKeys;\n },\n get isOpen() {\n return stateProps.isOpen;\n },\n get defaultOpen() {\n return stateProps.defaultOpen;\n },\n get onOpenChange() {\n return stateProps.onOpenChange;\n },\n get isDisabled() {\n return resolveDisabled();\n },\n get isRequired() {\n return ariaProps.isRequired;\n },\n });\n\n const selectAriaProps = createMemo(() => {\n const clean: Record<string, unknown> = {};\n for (const key in ariaProps as Record<string, unknown>) {\n if (!key.startsWith(\"data-\")) {\n clean[key] = (ariaProps as Record<string, unknown>)[key];\n }\n }\n return clean as typeof ariaProps;\n });\n\n const {\n labelProps,\n triggerProps,\n valueProps,\n menuProps,\n isFocused,\n isFocusVisible,\n isOpen,\n isPressed,\n } = createSelect<T>(selectAriaProps, state);\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return resolveDisabled();\n },\n });\n\n const renderValues = createMemo<SelectRenderProps>(() => ({\n isOpen: isOpen(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isDisabled: resolveDisabled(),\n isRequired: !!ariaProps.isRequired,\n isSelected:\n state.selectionMode() === \"multiple\"\n ? state.selectedKeys() === \"all\" || (state.selectedKeys() as Set<Key>).size > 0\n : state.selectedKey() != null,\n }));\n const childRenderValues: SelectRenderProps = {\n get isOpen() {\n return isOpen();\n },\n get isFocused() {\n return isFocused();\n },\n get isFocusVisible() {\n return isFocusVisible();\n },\n get isDisabled() {\n return resolveDisabled();\n },\n get isRequired() {\n return !!ariaProps.isRequired;\n },\n get isSelected() {\n return hasSelection();\n },\n };\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select\",\n },\n renderValues,\n );\n\n const domProps = createMemo(() => {\n const filtered = filterDOMProps(ariaProps as Record<string, unknown>, { global: true });\n for (const key of selectRootLabelProps) {\n delete filtered[key];\n }\n return filtered;\n });\n\n const cleanHoverProps = () => {\n const { ref: _ref, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const cleanLabelProps = () => {\n const { ref: _ref, ...rest } = labelProps as Record<string, unknown>;\n return rest;\n };\n const setRootRef = (el: HTMLDivElement) => {\n rootRef = el;\n assignRef(local.ref, el);\n };\n const validation = createMemo<ValidationResult>(() => {\n const current = selectValidation();\n if (current.isInvalid || !ariaProps.isInvalid) {\n return current;\n }\n\n return {\n ...DEFAULT_VALIDATION_RESULT,\n isInvalid: true,\n };\n });\n const isInvalid = createMemo(() => validation().isInvalid);\n const triggerDescribedBy = () => {\n const ids = [\n (triggerProps as { \"aria-describedby\"?: string })[\"aria-describedby\"],\n isInvalid() ? errorMessageId : undefined,\n ]\n .filter(Boolean)\n .join(\" \")\n .split(\" \")\n .filter(Boolean);\n return ids.length ? Array.from(new Set(ids)).join(\" \") : undefined;\n };\n const triggerPropsWithValidation = () =>\n ({\n ...triggerProps,\n \"aria-describedby\": triggerDescribedBy(),\n }) as JSX.HTMLAttributes<HTMLElement>;\n const fieldErrorContext: FieldErrorContextValue = {\n get validation() {\n return validation();\n },\n get errorMessageProps() {\n return { id: errorMessageId };\n },\n };\n const focusTrigger = () => {\n triggerRef?.focus();\n };\n const hasSelection = () =>\n state.selectionMode() === \"multiple\"\n ? state.selectedKeys() === \"all\" || (state.selectedKeys() as Set<Key>).size > 0\n : state.selectedKey() != null;\n const hasNativeValidation = () => (ariaProps.validationBehavior ?? \"native\") === \"native\";\n const getSelectValidation = (select: HTMLSelectElement): ValidationResult => {\n if (ariaProps.isRequired && !hasSelection()) {\n return {\n isInvalid: true,\n validationDetails: {\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valueMissing: true,\n valid: false,\n },\n validationErrors: [select.validationMessage || \"Constraints not satisfied\"],\n };\n }\n return getNativeSelectValidation(select);\n };\n\n const { containerProps, selectProps: hiddenSelectProps } = createHiddenSelect({\n state,\n name: stateProps.name,\n form: ariaProps.form,\n isRequired: ariaProps.isRequired,\n validationBehavior: ariaProps.validationBehavior ?? \"native\",\n get isDisabled() {\n return resolveDisabled();\n },\n });\n const handleHiddenSelectInvalid: JSX.EventHandler<HTMLSelectElement, Event> = (event) => {\n setSelectValidation(getSelectValidation(event.currentTarget));\n focusTrigger();\n event.preventDefault();\n };\n const handleHiddenSelectChange: JSX.EventHandler<HTMLSelectElement, Event> = (event) => {\n (hiddenSelectProps as { onChange?: JSX.EventHandler<HTMLSelectElement, Event> }).onChange?.(\n event,\n );\n setSelectValidation(\n hasSelection() && event.currentTarget.validity.valid\n ? DEFAULT_VALIDATION_RESULT\n : getSelectValidation(event.currentTarget),\n );\n };\n createEffect(() => {\n if (hasSelection() && selectValidation().isInvalid) {\n setSelectValidation(DEFAULT_VALIDATION_RESULT);\n }\n });\n let triggerRef: HTMLElement | null = null;\n const setTriggerRef = (el: HTMLElement | null) => {\n triggerRef = el;\n };\n\n const RootChildren = () => {\n const selectChildren = untrack(() =>\n typeof local.children === \"function\"\n ? (local.children as (values: SelectRenderProps) => JSX.Element)(childRenderValues)\n : local.children,\n );\n\n return (\n <>\n <Show when={ariaProps.label}>\n <span {...cleanLabelProps()}>{ariaProps.label as JSX.Element}</span>\n </Show>\n {selectChildren}\n {/*\n The HiddenSelect (native `<select>` for form autofill/submission) renders\n AFTER the trigger button, mirroring upstream RAC `Select` which emits\n `{renderProps.children}` then `<HiddenSelect>` (Select.tsx:288-289). Order\n matters for the DOM tab/focus trail: the visible button must precede the\n form-only hidden control.\n */}\n <div {...containerProps}>\n <select\n {...hiddenSelectProps}\n name={hasSelection() ? undefined : stateProps.name}\n required={\n (hasNativeValidation() && ariaProps.isRequired && !hasSelection()) || undefined\n }\n onInvalid={handleHiddenSelectInvalid}\n onChange={handleHiddenSelectChange}\n >\n <Show when={state.selectionMode() !== \"multiple\"}>\n <option selected={state.selectedKey() == null} />\n </Show>\n <For each={stateProps.items}>\n {(item) => {\n const itemRecord = isObjectRecord(item) ? item : null;\n const fallbackKey =\n itemRecord != null ? (toKey(itemRecord.key) ?? toKey(itemRecord.id)) : undefined;\n const key = stateProps.getKey?.(item) ?? fallbackKey ?? String(item);\n // This hidden <select> re-derives each option's label straight\n // from the raw items array, bypassing the collection's textValue.\n // Mirror createListState's derivation: read the conventional\n // display fields (textValue/label/name/title) and, for an object\n // item with none of them, fall back to the key rather than\n // String(item) — which would render the useless \"[object Object]\".\n const fallbackTextValue =\n itemRecord != null\n ? (toTextValue(itemRecord.textValue) ??\n toTextValue(itemRecord.label) ??\n toTextValue(itemRecord.name) ??\n toTextValue(itemRecord.title))\n : undefined;\n const textValue =\n stateProps.getTextValue?.(item) ??\n fallbackTextValue ??\n (itemRecord != null ? String(key) : String(item));\n const selectedKeys = state.selectedKeys();\n const isSelected =\n state.selectionMode() === \"multiple\"\n ? selectedKeys === \"all\"\n ? true\n : (selectedKeys as Set<Key>).has(key)\n : key === state.selectedKey();\n return (\n <option value={String(key)} selected={isSelected}>\n {textValue}\n </option>\n );\n }}\n </For>\n </select>\n <Show when={state.selectionMode() === \"multiple\" && stateProps.name}>\n <For\n each={\n state.selectedKeys() === \"all\"\n ? Array.from(state.collection()).map((item) => item.key)\n : Array.from(state.selectedKeys() as Set<Key>)\n }\n >\n {(key) => (\n <input\n type=\"hidden\"\n name={stateProps.name}\n form={ariaProps.form}\n value={String(key)}\n disabled={resolveDisabled()}\n />\n )}\n </For>\n </Show>\n <Show\n when={\n state.selectionMode() !== \"multiple\" && stateProps.name && state.selectedKey() != null\n }\n >\n <input\n type=\"hidden\"\n name={stateProps.name}\n form={ariaProps.form}\n value={String(state.selectedKey())}\n disabled={resolveDisabled()}\n />\n </Show>\n </div>\n </>\n );\n };\n const baseRootProps = () =>\n ({\n ...domProps(),\n ...cleanHoverProps(),\n ref: setRootRef,\n class: renderProps.class(),\n style: renderProps.style(),\n slot: local.slot,\n \"data-open\": isOpen() || undefined,\n \"data-disabled\": resolveDisabled() || undefined,\n \"data-required\": ariaProps.isRequired || undefined,\n \"data-invalid\": isInvalid() || undefined,\n \"data-hovered\": isHovered() || undefined,\n }) as JSX.HTMLAttributes<HTMLDivElement>;\n const RootContent = () => {\n const renderedRootChildren = <RootChildren />;\n const rootProps = () =>\n ({\n ...baseRootProps(),\n children: renderedRootChildren,\n }) as JSX.HTMLAttributes<HTMLDivElement>;\n\n return local.render ? (\n local.render(rootProps(), renderValues())\n ) : (\n <div {...baseRootProps()}>{renderedRootChildren}</div>\n );\n };\n\n return (\n <SelectContext.Provider\n value={\n {\n state,\n rootRef: () => rootRef ?? null,\n triggerRef: () => triggerRef,\n setTriggerRef,\n get triggerProps() {\n return triggerPropsWithValidation();\n },\n valueProps,\n labelProps,\n menuProps,\n get errorMessageProps() {\n return { id: errorMessageId };\n },\n get validation() {\n return validation();\n },\n isOpen,\n isFocused,\n isFocusVisible,\n isPressed,\n isDisabled: resolveDisabled,\n placeholder: ariaProps.placeholder,\n items: stateProps.items,\n autoFocus: !!ariaProps.autoFocus,\n } as SelectContextValue<unknown>\n }\n >\n <SelectStateContext.Provider value={state}>\n <FieldErrorContext.Provider value={fieldErrorContext}>\n <RootContent />\n </FieldErrorContext.Provider>\n </SelectStateContext.Provider>\n </SelectContext.Provider>\n );\n}\n\n/**\n * The trigger button for a select.\n */\nexport function SelectTrigger(props: SelectTriggerProps): JSX.Element {\n const [local, domProps] = splitProps(props, [\"class\", \"style\", \"slot\", \"children\", \"ref\"]);\n\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error(\"SelectTrigger must be used within a Select\");\n }\n const { isOpen, isFocused, isFocusVisible, isPressed, state } = context;\n let triggerRef: HTMLButtonElement | undefined;\n const setTriggerRef = (el: HTMLButtonElement) => {\n triggerRef = el;\n context.setTriggerRef(el);\n assignRef(local.ref, el);\n };\n\n createEffect(() => {\n if (context.autoFocus) {\n triggerRef?.focus();\n }\n });\n\n const { isHovered, hoverProps } = createHover({\n get isDisabled() {\n return state.isDisabled;\n },\n });\n\n const renderValues = createMemo<SelectTriggerRenderProps>(() => ({\n isOpen: isOpen(),\n isFocused: isFocused(),\n isFocusVisible: isFocusVisible(),\n isHovered: isHovered(),\n isPressed: isPressed(),\n isDisabled: state.isDisabled,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-trigger\",\n },\n renderValues,\n );\n\n const cleanTriggerProps = () => {\n const { ref: _ref1, ...rest } = context.triggerProps as Record<string, unknown>;\n return rest;\n };\n const cleanHoverProps = () => {\n const { ref: _ref2, ...rest } = hoverProps as Record<string, unknown>;\n return rest;\n };\n const triggerAriaProps = () => context.triggerProps as Record<string, unknown>;\n const menuAriaProps = () => context.menuProps as Record<string, unknown>;\n return (\n <button\n ref={setTriggerRef}\n {...domProps}\n {...cleanTriggerProps()}\n {...cleanHoverProps()}\n type=\"button\"\n id={triggerAriaProps().id as string | undefined}\n tabIndex={state.isDisabled ? undefined : 0}\n aria-label={triggerAriaProps()[\"aria-label\"] as string | undefined}\n aria-labelledby={triggerAriaProps()[\"aria-labelledby\"] as string | undefined}\n aria-haspopup=\"listbox\"\n aria-expanded={isOpen()}\n aria-controls={isOpen() ? (menuAriaProps().id as string | undefined) : undefined}\n aria-disabled={state.isDisabled || undefined}\n aria-required={triggerAriaProps()[\"aria-required\"] as boolean | undefined}\n aria-describedby={triggerAriaProps()[\"aria-describedby\"] as string | undefined}\n class={renderProps.class()}\n style={renderProps.style()}\n data-open={isOpen() || undefined}\n data-focused={isFocused() || undefined}\n data-focus-visible={isFocusVisible() || undefined}\n data-hovered={isHovered() || undefined}\n data-disabled={state.isDisabled || undefined}\n >\n {renderProps.renderChildren()}\n </button>\n );\n}\n\n// Default children function for SelectValue - defined at module level for SSR stability\nfunction defaultSelectValueChildren<T>(values: SelectValueRenderProps<T>) {\n return values.selectedText ?? values.placeholder ?? \"\";\n}\n\n/**\n * Displays the selected value in a select.\n */\nexport function SelectValue<T>(props: SelectValueProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"placeholder\",\n \"children\",\n ]);\n\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error(\"SelectValue must be used within a Select\");\n }\n const { valueProps, placeholder: contextPlaceholder } = context;\n const state = context.state as SelectState<T>;\n\n const placeholder = () => local.placeholder ?? contextPlaceholder;\n\n const renderValues = createMemo<SelectValueRenderProps<T>>(() => {\n const collection = state.collection();\n const selectedItem =\n state.selectedKey() == null ? null : collection.getItem(state.selectedKey() as Key);\n const selectedKeys = state.selectedKeys();\n const selectedItems =\n selectedKeys === \"all\"\n ? Array.from(collection)\n : Array.from(selectedKeys as Set<Key>)\n .map((key) => collection.getItem(key))\n .filter((item): item is CollectionNode<T> => item != null);\n const selectedText =\n state.selectionMode() === \"multiple\"\n ? selectedItems.length > 0\n ? new Intl.ListFormat(undefined, { style: \"long\", type: \"conjunction\" }).format(\n selectedItems.map((item) => item.textValue),\n )\n : null\n : (selectedItem?.textValue ?? null);\n return {\n selectedItem,\n selectedItems,\n selectedText,\n isSelected:\n state.selectionMode() === \"multiple\" ? selectedItems.length > 0 : selectedItem != null,\n placeholder: placeholder(),\n };\n });\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children ?? defaultSelectValueChildren;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-value\",\n },\n renderValues,\n );\n\n return (\n <span\n {...domProps}\n {...valueProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-placeholder={!renderValues().isSelected || undefined}\n >\n {props.children == null\n ? (renderValues().selectedText ?? renderValues().placeholder ?? \"\")\n : renderProps.renderChildren()}\n </span>\n );\n}\n\n/**\n * The listbox popup for a select.\n */\nexport function SelectListBox<T>(props: SelectListBoxProps<T>): JSX.Element {\n const [local, domProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"children\",\n \"renderEmptyState\",\n \"onLoadMore\",\n \"isLoading\",\n \"renderLoadMore\",\n \"loadMoreClass\",\n \"isInPopover\",\n ]);\n\n const context = useContext(SelectContext);\n if (!context) {\n throw new Error(\"SelectListBox must be used within a Select\");\n }\n const { menuProps, rootRef, state: selectState, isOpen } = context;\n const state = selectState as SelectState<T>;\n\n createEffect(() => {\n if (!isOpen()) {\n return;\n }\n // On open the listbox takes collection focus. Upstream `useSelect` sets\n // `menuProps.autoFocus = state.focusStrategy || true`, so the ListBox's\n // `useSelectableCollection` auto-focuses on mount — setting the selection\n // manager's `isFocused` true and focusing the selected option. Our\n // `createListBox` reimplements keyboard nav inline (no `autoFocus` effect),\n // so we set the manager focus here to match. Without it the selected option\n // never paints its focus-visible background (`data-focused` stays unset).\n state.selectionManager.setFocused(true);\n if (state.focusedKey() != null) {\n return;\n }\n const selectedKey = state.selectedKey();\n if (selectedKey != null && !state.collection().getItem(selectedKey)?.isDisabled) {\n state.setFocusedKey(selectedKey);\n }\n });\n\n let listBoxRef: HTMLDivElement | undefined;\n\n createInteractOutside({\n ref: () => rootRef() ?? listBoxRef ?? null,\n onInteractOutside: () => {\n if (isOpen()) {\n state.close();\n }\n },\n get isDisabled() {\n return !isOpen() || local.isInPopover === true;\n },\n });\n\n // Keep the hook result intact — destructuring `{ listBoxProps }` invokes the\n // `get listBoxProps()` getter ONCE and freezes it (the Solid \"destructuring a\n // get-prop freezes reactivity\" gotcha). The listbox `tabIndex` is computed from\n // `focusedKey` (`focusedKey != null ? -1 : 0`); on open the effect above sets a\n // focused key, so a frozen snapshot would leave the listbox tabbable (`0`) when\n // upstream flips it to `-1`. Reading `listBoxHook.listBoxProps` per access keeps\n // it reactive.\n const listBoxHook = createListBox(\n {\n ...(menuProps as unknown as AriaListBoxProps),\n shouldSelectOnPressUp: true,\n shouldFocusOnHover: true,\n shouldSelectOnFocus: local.isInPopover === true ? false : undefined,\n get isDisabled() {\n return state.isDisabled;\n },\n },\n createSelectListStateAdapter(state),\n );\n\n const renderValues = createMemo<SelectListBoxRenderProps>(() => ({\n // Focus within the listbox itself (the selection manager's focus state),\n // not the select-level trigger focus.\n isFocused: state.selectionManager.isFocused,\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-listbox\",\n },\n renderValues,\n );\n\n const cleanMenuProps = () => {\n const { ref: _ref1, ...rest } = menuProps as Record<string, unknown>;\n return rest;\n };\n const cleanListBoxProps = () => {\n const {\n ref: _ref2,\n \"aria-activedescendant\": _activeDescendant,\n onFocus: _onFocus,\n ...rest\n } = listBoxHook.listBoxProps as Record<string, unknown>;\n // Faithful Select listbox focus model: the focused option receives REAL DOM\n // focus (the open effect above + `createSelectableItem`'s self-focus move\n // `document.activeElement` onto it), mirroring upstream `useSelect`. So the\n // listbox must (a) leave the tab sequence once an option is focused —\n // `useSelectableCollection` uses `tabIndex = focusedKey == null ? 0 : -1`\n // (useSelectableCollection.ts:687-690) — and (b) NOT expose\n // `aria-activedescendant`, which is the virtual-focus channel upstream Select\n // never uses. These are overridden here, not in the shared `createListBox`,\n // because the standalone `ListBox` keeps its container-focus model (focus\n // stays on the listbox, `aria-activedescendant` is its AT channel).\n //\n // We also drop `createListBox`'s container-focus TRAMPOLINE (`onFocus`): it\n // marshals the first key when the container is focused with `focusedKey ==\n // null`, which is exactly Select's deliberate click-open state (the open\n // effect sets `isFocused` true but leaves `focusedKey` null when nothing is\n // selected, so the first arrow enters the first item). Upstream's own\n // trampoline no-ops in this case because it guards on `manager.isFocused`\n // (already true); our shared guard uses `focusedKey == null` for the\n // standalone ListBox, so we strip it here to preserve Select's faithful\n // model. (Auto-selecting on focus under replace behavior would also toggle\n // the first item selected on open — the bug this override prevents.)\n return {\n ...rest,\n tabIndex: state.isDisabled ? undefined : state.focusedKey() != null ? -1 : 0,\n };\n };\n\n const items = () => Array.from(state.collection());\n createEffect(() => {\n if (!isOpen()) return;\n const focusedKey = state.focusedKey();\n if (focusedKey == null) return;\n\n queueMicrotask(() => {\n const option = Array.from(\n listBoxRef?.querySelectorAll<HTMLElement>(\"[role='option']\") ?? [],\n ).find((element) => element.id === String(focusedKey));\n if (option && document.activeElement !== option) {\n focusSafely(option);\n }\n });\n });\n\n const listBox = () => (\n // Upstream RAC ListBox (and our own Menu.tsx) render a `<div role=\"listbox\">`\n // over `<div role=\"option\">` rows, NOT `<ul>`/`<li>` — the collection is\n // div-based for virtualization parity. `<ul>`/`<li>` here was a self-inflicted\n // structural divergence surfaced by the Picker recertification (D5/D6/D8 saw\n // `li[option]`/`ul[listbox]` where the React oracle sees `div`).\n <div\n ref={(el) => (listBoxRef = el)}\n {...domProps}\n {...cleanMenuProps()}\n {...cleanListBoxProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={state.selectionManager.isFocused || undefined}\n data-empty={state.collection().size === 0 || undefined}\n >\n {state.collection().size === 0 && local.renderEmptyState ? (\n <div role=\"option\" style={{ display: \"contents\" }} data-empty-state>\n {local.renderEmptyState()}\n </div>\n ) : (\n <Show\n when={local.children}\n fallback={\n <For each={items()}>\n {(node) => <SelectOption id={node.key}>{node.textValue}</SelectOption>}\n </For>\n }\n >\n <For each={items()}>\n {(node) => (node.value != null ? local.children!(node.value) : null)}\n </For>\n </Show>\n )}\n <Show when={local.onLoadMore}>\n <ListBoxLoadMoreItem\n onLoadMore={local.onLoadMore!}\n isLoading={local.isLoading}\n class={local.loadMoreClass}\n >\n {local.renderLoadMore?.()}\n </ListBoxLoadMoreItem>\n </Show>\n </div>\n );\n\n return (\n <Show when={isOpen()}>\n <Show\n when={local.isInPopover}\n fallback={\n <FocusScope restoreFocus autoFocus>\n {listBox()}\n </FocusScope>\n }\n >\n {listBox()}\n </Show>\n </Show>\n );\n}\n\n/**\n * An option in a select listbox.\n */\nexport function SelectOption<T>(props: SelectOptionProps<T>): JSX.Element {\n const [local, ariaProps] = splitProps(props, [\n \"class\",\n \"style\",\n \"slot\",\n \"id\",\n \"item\",\n \"textValue\",\n \"ref\",\n ]);\n\n const context = useContext(SelectStateContext);\n if (!context) {\n throw new Error(\"SelectOption must be used within a Select\");\n }\n const state = context as SelectState<T>;\n const selectContext = useContext(SelectContext) as SelectContextValue<T> | null;\n const [ref, setRefSignal] = createSignal<HTMLDivElement | null>(null);\n const setRef = (el: HTMLDivElement | null) => {\n setRefSignal(el);\n assignRef(local.ref, el as HTMLDivElement);\n };\n\n const optionAria = createOption<T>(\n {\n key: local.id,\n get isDisabled() {\n return Boolean(ariaProps.isDisabled || selectContext?.isDisabled());\n },\n get \"aria-label\"() {\n return ariaProps[\"aria-label\"] ?? local.textValue;\n },\n shouldSelectOnPressUp: true,\n shouldFocusOnHover: true,\n get onHoverStart() {\n return ariaProps.onHoverStart;\n },\n get onHoverEnd() {\n return ariaProps.onHoverEnd;\n },\n get onHoverChange() {\n return ariaProps.onHoverChange;\n },\n },\n {\n ...createSelectListStateAdapter(state),\n select: (key: Key) => {\n if (state.selectionMode() === \"multiple\") {\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n state.setSelectedKeys(new Set([...keys, key]));\n return;\n }\n state.setSelectedKey(key);\n state.close();\n },\n toggleSelection: (key: Key) => {\n if (state.selectionMode() === \"multiple\") {\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n const next = new Set(keys);\n if (next.has(key)) next.delete(key);\n else next.add(key);\n state.setSelectedKeys(next);\n return;\n }\n state.setSelectedKey(key);\n state.close();\n },\n replaceSelection: (key: Key) => {\n state.setSelectedKey(key);\n if (state.selectionMode() !== \"multiple\") {\n state.close();\n }\n },\n },\n () => ref(),\n );\n const isOptionFocusVisible = () =>\n optionAria.isFocused() && (selectContext?.isFocusVisible() ?? optionAria.isFocusVisible());\n\n const renderValues = createMemo<SelectOptionRenderProps>(() => ({\n isSelected: optionAria.isSelected(),\n isFocused: optionAria.isFocused(),\n isFocusVisible: isOptionFocusVisible(),\n isPressed: optionAria.isPressed(),\n isHovered: optionAria.isHovered(),\n isDisabled: optionAria.isDisabled(),\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-Select-option\",\n },\n renderValues,\n );\n const hasPrimitiveLabel = () => {\n return typeof props.children === \"string\" || typeof props.children === \"number\";\n };\n\n const selectionIndicatorContext = createMemo<SelectionIndicatorContextValue>(() => ({\n isSelected: optionAria.isSelected,\n }));\n\n const cleanOptionProps = () => {\n const {\n ref: _ref1,\n \"aria-describedby\": _ariaDescribedby,\n ...rest\n } = optionAria.optionProps as Record<string, unknown>;\n if (!hasPrimitiveLabel() && rest[\"aria-label\"] == null) {\n delete rest[\"aria-labelledby\"];\n }\n const onClick = rest.onClick as ((event: MouseEvent) => void) | undefined;\n rest.onClick = ((event: MouseEvent) => {\n const wasSelected = optionAria.isSelected();\n onClick?.(event);\n if (typeof PointerEvent === \"undefined\") {\n return;\n }\n queueMicrotask(() => {\n if (state.selectionMode() !== \"multiple\" || optionAria.isSelected() === wasSelected) {\n selectOption();\n }\n });\n }) as JSX.EventHandler<HTMLDivElement, MouseEvent>;\n return rest;\n };\n const selectOption = () => {\n if (optionAria.isDisabled()) {\n return;\n }\n if (state.selectionMode() === \"multiple\") {\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n const next = new Set(keys);\n if (next.has(local.id)) next.delete(local.id);\n else next.add(local.id);\n state.setSelectedKeys(next);\n return;\n }\n state.setSelectedKey(local.id);\n state.close();\n };\n\n return (\n <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>\n {/* `<div role=\"option\">`, not `<li>` — see the SelectListBox note; upstream\n RAC options are div-based. */}\n <div\n ref={setRef}\n {...cleanOptionProps()}\n class={renderProps.class()}\n style={renderProps.style()}\n data-selected={optionAria.isSelected() || undefined}\n data-focused={optionAria.isFocused() || undefined}\n data-focus-visible={isOptionFocusVisible() || undefined}\n data-pressed={optionAria.isPressed() || undefined}\n data-hovered={optionAria.isHovered() || undefined}\n data-disabled={optionAria.isDisabled() || undefined}\n >\n {hasPrimitiveLabel() ? (\n <span {...optionAria.labelProps}>{renderProps.renderChildren()}</span>\n ) : (\n renderProps.renderChildren()\n )}\n </div>\n </SelectionIndicatorContext.Provider>\n );\n}\n\nfunction isObjectRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\nfunction toKey(value: unknown): Key | undefined {\n if (typeof value === \"string\" || typeof value === \"number\") {\n return value;\n }\n return undefined;\n}\n\nfunction toTextValue(value: unknown): string | undefined {\n if (typeof value === \"string\" || typeof value === \"number\") {\n return String(value);\n }\n return undefined;\n}\n\nfunction createSelectListStateAdapter<T>(state: SelectState<T>): ListState<T> {\n const selectedKeys = createMemo(() => {\n const keys = state.selectedKeys();\n return keys === \"all\" ? new Set(Array.from(state.collection()).map((item) => item.key)) : keys;\n });\n\n const disabledKeys = createMemo(() => {\n const keys = new Set<Key>();\n for (const node of state.collection()) {\n if (node.isDisabled) keys.add(node.key);\n }\n return keys;\n });\n\n return {\n collection: state.collection,\n selectionManager: state.selectionManager,\n // Collection-level focus (the selection manager's), not the select-level\n // trigger focus — upstream listbox internals only ever read\n // state.selectionManager.isFocused.\n isFocused: () => state.selectionManager.isFocused,\n setFocused: (isFocused) => state.selectionManager.setFocused(isFocused),\n focusedKey: state.focusedKey,\n setFocusedKey: (key) => state.setFocusedKey(key ?? null),\n childFocusStrategy: () => null,\n selectionMode: () => state.selectionMode(),\n selectionBehavior: () => \"replace\",\n disallowEmptySelection: () => true,\n selectedKeys,\n disabledKeys,\n disabledBehavior: () => \"all\",\n isEmpty: () => selectedKeys().size === 0,\n isSelectAll: () => state.selectedKeys() === \"all\",\n isSelected: (key) => selectedKeys().has(key),\n isDisabled: state.isKeyDisabled,\n setSelectionBehavior: () => {},\n toggleSelection: (key) => {\n if (state.selectionMode() !== \"multiple\") {\n state.setSelectedKey(key);\n return;\n }\n const keys = state.selectedKeys();\n if (keys === \"all\") return;\n const next = new Set(keys);\n if (next.has(key)) next.delete(key);\n else next.add(key);\n state.setSelectedKeys(next);\n },\n replaceSelection: (key) => state.setSelectedKey(key),\n setSelectedKeys: (keys) => state.setSelectedKeys(keys),\n selectAll: () => {},\n clearSelection: () =>\n state.selectionMode() === \"multiple\" ? state.setSelectedKeys([]) : state.setSelectedKey(null),\n toggleSelectAll: () => {},\n extendSelection: (toKey) => state.setSelectedKey(toKey),\n select: (key) =>\n state.selectionMode() === \"multiple\"\n ? state.setSelectedKeys([\n ...(state.selectedKeys() === \"all\" ? [] : (state.selectedKeys() as Set<Key>)),\n key,\n ])\n : state.setSelectedKey(key),\n };\n}\n\nSelect.Trigger = SelectTrigger;\nSelect.Value = SelectValue;\nSelect.ListBox = SelectListBox;\nSelect.Option = SelectOption;\n"],"mappings":";;;;;;;;;;;;;;;;AA6DA,SAAS8C,UAAaC,KAAiBJ,IAAa;CAClD,IAAI,CAACI,KAAK;CACV,IAAI,OAAOA,QAAQ,YACjBA,IAAIJ,EAAE;MAENI,IAAIF,UAAUF;AAElB;AAEA,SAASK,0BAA0BC,QAA6C;CAC9E,OAAO;EACLE,WAAW,CAACF,OAAOG,SAASC;EAC5BC,mBAAmB;GACjBC,UAAUN,OAAOG,SAASG;GAC1BC,aAAaP,OAAOG,SAASI;GAC7BC,iBAAiBR,OAAOG,SAASK;GACjCC,eAAeT,OAAOG,SAASM;GAC/BC,gBAAgBV,OAAOG,SAASO;GAChCC,cAAcX,OAAOG,SAASQ;GAC9BC,SAASZ,OAAOG,SAASS;GACzBC,UAAUb,OAAOG,SAASU;GAC1BC,cAAcd,OAA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AG;EACnDuR,kBAAkBrR,SAASuC,MAAM8O,gBAAgBrR,IAAI;EACrDoT,iBAAiB,CAAC;EAClBC,sBACE9Q,MAAM/C,cAAc,MAAM,aAAa+C,MAAM8O,gBAAgB,CAAA,CAAE,IAAI9O,MAAM+O,eAAe,IAAI;EAC9FgC,uBAAuB,CAAC;EACxBC,kBAAkBxJ,UAAUxH,MAAM+O,eAAevH,KAAK;EACtDzM,SAASwC,QACPyC,MAAM/C,cAAc,MAAM,aACtB+C,MAAM8O,gBAAgB,CACpB,GAAI9O,MAAM5C,aAAa,MAAM,QAAQ,CAAA,IAAM4C,MAAM5C,aAAa,GAC9DG,GAAG,CACJ,IACDyC,MAAM+O,eAAexR,GAAG;CAChC;AACF;AAEA6D,OAAO6P,UAAU1H;AACjBnI,OAAO8P,QAAQjG;AACf7J,OAAO+P,UAAUxF;AACjBvK,OAAOgQ,SAAS/C"}
package/dist/Select.jsx CHANGED
@@ -136,7 +136,7 @@ function Select(props) {
136
136
  return ariaProps.isRequired;
137
137
  }
138
138
  });
139
- const { labelProps, triggerProps, valueProps, menuProps, isFocused, isFocusVisible, isOpen } = createSelect(createMemo(() => {
139
+ const { labelProps, triggerProps, valueProps, menuProps, isFocused, isFocusVisible, isOpen, isPressed } = createSelect(createMemo(() => {
140
140
  const clean = {};
141
141
  for (const key in ariaProps) if (!key.startsWith("data-")) clean[key] = ariaProps[key];
142
142
  return clean;
@@ -273,6 +273,11 @@ function Select(props) {
273
273
  const RootChildren = () => {
274
274
  const selectChildren = untrack(() => typeof local.children === "function" ? local.children(childRenderValues) : local.children);
275
275
  return <>
276
+ <Show when={ariaProps.label}>
277
+ <span {...cleanLabelProps()}>{ariaProps.label}</span>
278
+ </Show>
279
+ {selectChildren}
280
+ {}
276
281
  <div {...containerProps}>
277
282
  <select {...hiddenSelectProps} name={hasSelection() ? void 0 : stateProps.name} required={hasNativeValidation() && ariaProps.isRequired && !hasSelection() || void 0} onInvalid={handleHiddenSelectInvalid} onChange={handleHiddenSelectChange}>
278
283
  <Show when={state.selectionMode() !== "multiple"}>
@@ -283,8 +288,8 @@ function Select(props) {
283
288
  const itemRecord = isObjectRecord(item) ? item : null;
284
289
  const fallbackKey = itemRecord != null ? toKey(itemRecord.key) ?? toKey(itemRecord.id) : void 0;
285
290
  const key = stateProps.getKey?.(item) ?? fallbackKey ?? String(item);
286
- const fallbackTextValue = itemRecord != null ? toTextValue(itemRecord.textValue) ?? toTextValue(itemRecord.label) : void 0;
287
- const textValue = stateProps.getTextValue?.(item) ?? fallbackTextValue ?? String(item);
291
+ const fallbackTextValue = itemRecord != null ? toTextValue(itemRecord.textValue) ?? toTextValue(itemRecord.label) ?? toTextValue(itemRecord.name) ?? toTextValue(itemRecord.title) : void 0;
292
+ const textValue = stateProps.getTextValue?.(item) ?? fallbackTextValue ?? (itemRecord != null ? String(key) : String(item));
288
293
  const selectedKeys = state.selectedKeys();
289
294
  const isSelected = state.selectionMode() === "multiple" ? selectedKeys === "all" ? true : selectedKeys.has(key) : key === state.selectedKey();
290
295
  return <option value={String(key)} selected={isSelected}>
@@ -302,10 +307,6 @@ function Select(props) {
302
307
  <input type="hidden" name={stateProps.name} form={ariaProps.form} value={String(state.selectedKey())} disabled={resolveDisabled()} />
303
308
  </Show>
304
309
  </div>
305
- <Show when={ariaProps.label}>
306
- <span {...cleanLabelProps()}>{ariaProps.label}</span>
307
- </Show>
308
- {selectChildren}
309
310
  </>;
310
311
  };
311
312
  const baseRootProps = () => ({
@@ -349,6 +350,7 @@ function Select(props) {
349
350
  isOpen,
350
351
  isFocused,
351
352
  isFocusVisible,
353
+ isPressed,
352
354
  isDisabled: resolveDisabled,
353
355
  placeholder: ariaProps.placeholder,
354
356
  items: stateProps.items,
@@ -369,15 +371,17 @@ function SelectTrigger(props) {
369
371
  "class",
370
372
  "style",
371
373
  "slot",
372
- "children"
374
+ "children",
375
+ "ref"
373
376
  ]);
374
377
  const context = useContext(SelectContext);
375
378
  if (!context) throw new Error("SelectTrigger must be used within a Select");
376
- const { isOpen, isFocused, isFocusVisible, state } = context;
379
+ const { isOpen, isFocused, isFocusVisible, isPressed, state } = context;
377
380
  let triggerRef;
378
381
  const setTriggerRef = (el) => {
379
382
  triggerRef = el;
380
383
  context.setTriggerRef(el);
384
+ assignRef(local.ref, el);
381
385
  };
382
386
  createEffect(() => {
383
387
  if (context.autoFocus) triggerRef?.focus();
@@ -390,6 +394,7 @@ function SelectTrigger(props) {
390
394
  isFocused: isFocused(),
391
395
  isFocusVisible: isFocusVisible(),
392
396
  isHovered: isHovered(),
397
+ isPressed: isPressed(),
393
398
  isDisabled: state.isDisabled
394
399
  }));
395
400
  const renderProps = useRenderProps({
@@ -483,6 +488,7 @@ function SelectListBox(props) {
483
488
  const state = selectState;
484
489
  createEffect(() => {
485
490
  if (!isOpen()) return;
491
+ state.selectionManager.setFocused(true);
486
492
  if (state.focusedKey() != null) return;
487
493
  const selectedKey = state.selectedKey();
488
494
  if (selectedKey != null && !state.collection().getItem(selectedKey)?.isDisabled) state.setFocusedKey(selectedKey);
@@ -497,7 +503,7 @@ function SelectListBox(props) {
497
503
  return !isOpen() || local.isInPopover === true;
498
504
  }
499
505
  });
500
- const { listBoxProps } = createListBox({
506
+ const listBoxHook = createListBox({
501
507
  ...menuProps,
502
508
  shouldSelectOnPressUp: true,
503
509
  shouldFocusOnHover: true,
@@ -517,8 +523,11 @@ function SelectListBox(props) {
517
523
  return rest;
518
524
  };
519
525
  const cleanListBoxProps = () => {
520
- const { ref: _ref2, ...rest } = listBoxProps;
521
- return rest;
526
+ const { ref: _ref2, "aria-activedescendant": _activeDescendant, onFocus: _onFocus, ...rest } = listBoxHook.listBoxProps;
527
+ return {
528
+ ...rest,
529
+ tabIndex: state.isDisabled ? void 0 : state.focusedKey() != null ? -1 : 0
530
+ };
522
531
  };
523
532
  const items = () => Array.from(state.collection());
524
533
  createEffect(() => {
@@ -530,10 +539,10 @@ function SelectListBox(props) {
530
539
  if (option && document.activeElement !== option) focusSafely(option);
531
540
  });
532
541
  });
533
- const listBox = () => <ul ref={(el) => listBoxRef = el} {...domProps} {...cleanMenuProps()} {...cleanListBoxProps()} class={renderProps.class()} style={renderProps.style()} data-focused={state.selectionManager.isFocused || void 0} data-empty={state.collection().size === 0 || void 0}>
534
- {state.collection().size === 0 && local.renderEmptyState ? <li role="option" style={{ display: "contents" }} data-empty-state>
542
+ const listBox = () => <div ref={(el) => listBoxRef = el} {...domProps} {...cleanMenuProps()} {...cleanListBoxProps()} class={renderProps.class()} style={renderProps.style()} data-focused={state.selectionManager.isFocused || void 0} data-empty={state.collection().size === 0 || void 0}>
543
+ {state.collection().size === 0 && local.renderEmptyState ? <div role="option" style={{ display: "contents" }} data-empty-state>
535
544
  {local.renderEmptyState()}
536
- </li> : <Show when={local.children} fallback={<For each={items()}>
545
+ </div> : <Show when={local.children} fallback={<For each={items()}>
537
546
  {(node) => <SelectOption id={node.key}>{node.textValue}</SelectOption>}
538
547
  </For>}>
539
548
  <For each={items()}>
@@ -545,7 +554,7 @@ function SelectListBox(props) {
545
554
  {local.renderLoadMore?.()}
546
555
  </ListBoxLoadMoreItem>
547
556
  </Show>
548
- </ul>;
557
+ </div>;
549
558
  return <Show when={isOpen()}>
550
559
  <Show when={local.isInPopover} fallback={<FocusScope restoreFocus autoFocus>
551
560
  {listBox()}
@@ -564,13 +573,18 @@ function SelectOption(props) {
564
573
  "slot",
565
574
  "id",
566
575
  "item",
567
- "textValue"
576
+ "textValue",
577
+ "ref"
568
578
  ]);
569
579
  const context = useContext(SelectStateContext);
570
580
  if (!context) throw new Error("SelectOption must be used within a Select");
571
581
  const state = context;
572
582
  const selectContext = useContext(SelectContext);
573
- const [ref, setRef] = createSignal(null);
583
+ const [ref, setRefSignal] = createSignal(null);
584
+ const setRef = (el) => {
585
+ setRefSignal(el);
586
+ assignRef(local.ref, el);
587
+ };
574
588
  const optionAria = createOption({
575
589
  key: local.id,
576
590
  get isDisabled() {
@@ -670,9 +684,10 @@ function SelectOption(props) {
670
684
  state.close();
671
685
  };
672
686
  return <SelectionIndicatorContext.Provider value={selectionIndicatorContext()}>
673
- <li ref={setRef} {...cleanOptionProps()} class={renderProps.class()} style={renderProps.style()} data-selected={optionAria.isSelected() || void 0} data-focused={optionAria.isFocused() || void 0} data-focus-visible={isOptionFocusVisible() || void 0} data-pressed={optionAria.isPressed() || void 0} data-hovered={optionAria.isHovered() || void 0} data-disabled={optionAria.isDisabled() || void 0}>
687
+ {}
688
+ <div ref={setRef} {...cleanOptionProps()} class={renderProps.class()} style={renderProps.style()} data-selected={optionAria.isSelected() || void 0} data-focused={optionAria.isFocused() || void 0} data-focus-visible={isOptionFocusVisible() || void 0} data-pressed={optionAria.isPressed() || void 0} data-hovered={optionAria.isHovered() || void 0} data-disabled={optionAria.isDisabled() || void 0}>
674
689
  {hasPrimitiveLabel() ? <span {...optionAria.labelProps}>{renderProps.renderChildren()}</span> : renderProps.renderChildren()}
675
- </li>
690
+ </div>
676
691
  </SelectionIndicatorContext.Provider>;
677
692
  }
678
693
  function isObjectRecord(value) {