@neo4j-ndl/react 4.18.13 → 4.19.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 (234) hide show
  1. package/lib/LICENSES.txt +54 -0
  2. package/lib/NOTICE.txt +8 -0
  3. package/lib/cjs/_common/use-semi-controlled-state.js +6 -1
  4. package/lib/cjs/_common/use-semi-controlled-state.js.map +1 -1
  5. package/lib/cjs/combobox/Combobox.js +1031 -0
  6. package/lib/cjs/combobox/Combobox.js.map +1 -0
  7. package/lib/cjs/combobox/combobox-types.js +23 -0
  8. package/lib/cjs/combobox/combobox-types.js.map +1 -0
  9. package/lib/cjs/combobox/combobox-utils.js +129 -0
  10. package/lib/cjs/combobox/combobox-utils.js.map +1 -0
  11. package/lib/cjs/combobox/index.js +26 -0
  12. package/lib/cjs/combobox/index.js.map +1 -0
  13. package/lib/cjs/combobox/stories/combobox-action-on-select.story.js +82 -0
  14. package/lib/cjs/combobox/stories/combobox-action-on-select.story.js.map +1 -0
  15. package/lib/cjs/combobox/stories/combobox-actions.story.js +78 -0
  16. package/lib/cjs/combobox/stories/combobox-actions.story.js.map +1 -0
  17. package/lib/cjs/combobox/stories/combobox-async.story.js +75 -0
  18. package/lib/cjs/combobox/stories/combobox-async.story.js.map +1 -0
  19. package/lib/cjs/combobox/stories/combobox-clean.story.js +38 -0
  20. package/lib/cjs/combobox/stories/combobox-clean.story.js.map +1 -0
  21. package/lib/cjs/combobox/stories/combobox-creatable.story.js +41 -0
  22. package/lib/cjs/combobox/stories/combobox-creatable.story.js.map +1 -0
  23. package/lib/cjs/combobox/stories/combobox-custom-multi.story.js +45 -0
  24. package/lib/cjs/combobox/stories/combobox-custom-multi.story.js.map +1 -0
  25. package/lib/cjs/combobox/stories/combobox-custom-single.story.js +44 -0
  26. package/lib/cjs/combobox/stories/combobox-custom-single.story.js.map +1 -0
  27. package/lib/cjs/combobox/stories/combobox-custom-trigger.story.js +60 -0
  28. package/lib/cjs/combobox/stories/combobox-custom-trigger.story.js.map +1 -0
  29. package/lib/cjs/combobox/stories/combobox-default.story.js +42 -0
  30. package/lib/cjs/combobox/stories/combobox-default.story.js.map +1 -0
  31. package/lib/cjs/combobox/stories/combobox-descriptions.story.js +45 -0
  32. package/lib/cjs/combobox/stories/combobox-descriptions.story.js.map +1 -0
  33. package/lib/cjs/combobox/stories/combobox-disabled.story.js +34 -0
  34. package/lib/cjs/combobox/stories/combobox-disabled.story.js.map +1 -0
  35. package/lib/cjs/combobox/stories/combobox-fluid.story.js +34 -0
  36. package/lib/cjs/combobox/stories/combobox-fluid.story.js.map +1 -0
  37. package/lib/cjs/combobox/stories/combobox-groups.story.js +49 -0
  38. package/lib/cjs/combobox/stories/combobox-groups.story.js.map +1 -0
  39. package/lib/cjs/combobox/stories/combobox-hidden-label.story.js +33 -0
  40. package/lib/cjs/combobox/stories/combobox-hidden-label.story.js.map +1 -0
  41. package/lib/cjs/combobox/stories/combobox-icons.story.js +46 -0
  42. package/lib/cjs/combobox/stories/combobox-icons.story.js.map +1 -0
  43. package/lib/cjs/combobox/stories/combobox-in-dialog.story.js +40 -0
  44. package/lib/cjs/combobox/stories/combobox-in-dialog.story.js.map +1 -0
  45. package/lib/cjs/combobox/stories/combobox-in-popover-dialog.story.js +40 -0
  46. package/lib/cjs/combobox/stories/combobox-in-popover-dialog.story.js.map +1 -0
  47. package/lib/cjs/combobox/stories/combobox-in-popover.story.js +36 -0
  48. package/lib/cjs/combobox/stories/combobox-in-popover.story.js.map +1 -0
  49. package/lib/cjs/combobox/stories/combobox-large-data-set.story.js +36 -0
  50. package/lib/cjs/combobox/stories/combobox-large-data-set.story.js.map +1 -0
  51. package/lib/cjs/combobox/stories/combobox-max-rows.story.js +42 -0
  52. package/lib/cjs/combobox/stories/combobox-max-rows.story.js.map +1 -0
  53. package/lib/cjs/combobox/stories/combobox-multi.story.js +45 -0
  54. package/lib/cjs/combobox/stories/combobox-multi.story.js.map +1 -0
  55. package/lib/cjs/combobox/stories/combobox-native-form.story.js +49 -0
  56. package/lib/cjs/combobox/stories/combobox-native-form.story.js.map +1 -0
  57. package/lib/cjs/combobox/stories/combobox-select-only.story.js +38 -0
  58. package/lib/cjs/combobox/stories/combobox-select-only.story.js.map +1 -0
  59. package/lib/cjs/combobox/stories/combobox-sizes.story.js +33 -0
  60. package/lib/cjs/combobox/stories/combobox-sizes.story.js.map +1 -0
  61. package/lib/cjs/combobox/stories/combobox-unlimited-rows.story.js +42 -0
  62. package/lib/cjs/combobox/stories/combobox-unlimited-rows.story.js.map +1 -0
  63. package/lib/cjs/combobox/stories/combobox-validation.story.js +33 -0
  64. package/lib/cjs/combobox/stories/combobox-validation.story.js.map +1 -0
  65. package/lib/cjs/combobox/stories/index.js +133 -0
  66. package/lib/cjs/combobox/stories/index.js.map +1 -0
  67. package/lib/cjs/combobox/use-combobox-multi-value-overflow.js +173 -0
  68. package/lib/cjs/combobox/use-combobox-multi-value-overflow.js.map +1 -0
  69. package/lib/cjs/combobox/use-combobox-popover.js +80 -0
  70. package/lib/cjs/combobox/use-combobox-popover.js.map +1 -0
  71. package/lib/cjs/date-picker/DatePicker.js.map +1 -1
  72. package/lib/cjs/dismissible-tag/DismissibleTag.js +1 -1
  73. package/lib/cjs/dismissible-tag/DismissibleTag.js.map +1 -1
  74. package/lib/cjs/index.js +1 -0
  75. package/lib/cjs/index.js.map +1 -1
  76. package/lib/cjs/select/Select.js +3 -0
  77. package/lib/cjs/select/Select.js.map +1 -1
  78. package/lib/cjs/text-area/TextArea.js.map +1 -1
  79. package/lib/cjs/text-input/TextInput.js.map +1 -1
  80. package/lib/esm/_common/use-semi-controlled-state.js +6 -1
  81. package/lib/esm/_common/use-semi-controlled-state.js.map +1 -1
  82. package/lib/esm/combobox/Combobox.js +1024 -0
  83. package/lib/esm/combobox/Combobox.js.map +1 -0
  84. package/lib/esm/combobox/combobox-types.js +22 -0
  85. package/lib/esm/combobox/combobox-types.js.map +1 -0
  86. package/lib/esm/combobox/combobox-utils.js +112 -0
  87. package/lib/esm/combobox/combobox-utils.js.map +1 -0
  88. package/lib/esm/combobox/index.js +22 -0
  89. package/lib/esm/combobox/index.js.map +1 -0
  90. package/lib/esm/combobox/stories/combobox-action-on-select.story.js +80 -0
  91. package/lib/esm/combobox/stories/combobox-action-on-select.story.js.map +1 -0
  92. package/lib/esm/combobox/stories/combobox-actions.story.js +76 -0
  93. package/lib/esm/combobox/stories/combobox-actions.story.js.map +1 -0
  94. package/lib/esm/combobox/stories/combobox-async.story.js +73 -0
  95. package/lib/esm/combobox/stories/combobox-async.story.js.map +1 -0
  96. package/lib/esm/combobox/stories/combobox-clean.story.js +36 -0
  97. package/lib/esm/combobox/stories/combobox-clean.story.js.map +1 -0
  98. package/lib/esm/combobox/stories/combobox-creatable.story.js +39 -0
  99. package/lib/esm/combobox/stories/combobox-creatable.story.js.map +1 -0
  100. package/lib/esm/combobox/stories/combobox-custom-multi.story.js +43 -0
  101. package/lib/esm/combobox/stories/combobox-custom-multi.story.js.map +1 -0
  102. package/lib/esm/combobox/stories/combobox-custom-single.story.js +42 -0
  103. package/lib/esm/combobox/stories/combobox-custom-single.story.js.map +1 -0
  104. package/lib/esm/combobox/stories/combobox-custom-trigger.story.js +58 -0
  105. package/lib/esm/combobox/stories/combobox-custom-trigger.story.js.map +1 -0
  106. package/lib/esm/combobox/stories/combobox-default.story.js +40 -0
  107. package/lib/esm/combobox/stories/combobox-default.story.js.map +1 -0
  108. package/lib/esm/combobox/stories/combobox-descriptions.story.js +43 -0
  109. package/lib/esm/combobox/stories/combobox-descriptions.story.js.map +1 -0
  110. package/lib/esm/combobox/stories/combobox-disabled.story.js +32 -0
  111. package/lib/esm/combobox/stories/combobox-disabled.story.js.map +1 -0
  112. package/lib/esm/combobox/stories/combobox-fluid.story.js +32 -0
  113. package/lib/esm/combobox/stories/combobox-fluid.story.js.map +1 -0
  114. package/lib/esm/combobox/stories/combobox-groups.story.js +47 -0
  115. package/lib/esm/combobox/stories/combobox-groups.story.js.map +1 -0
  116. package/lib/esm/combobox/stories/combobox-hidden-label.story.js +31 -0
  117. package/lib/esm/combobox/stories/combobox-hidden-label.story.js.map +1 -0
  118. package/lib/esm/combobox/stories/combobox-icons.story.js +44 -0
  119. package/lib/esm/combobox/stories/combobox-icons.story.js.map +1 -0
  120. package/lib/esm/combobox/stories/combobox-in-dialog.story.js +38 -0
  121. package/lib/esm/combobox/stories/combobox-in-dialog.story.js.map +1 -0
  122. package/lib/esm/combobox/stories/combobox-in-popover-dialog.story.js +38 -0
  123. package/lib/esm/combobox/stories/combobox-in-popover-dialog.story.js.map +1 -0
  124. package/lib/esm/combobox/stories/combobox-in-popover.story.js +34 -0
  125. package/lib/esm/combobox/stories/combobox-in-popover.story.js.map +1 -0
  126. package/lib/esm/combobox/stories/combobox-large-data-set.story.js +34 -0
  127. package/lib/esm/combobox/stories/combobox-large-data-set.story.js.map +1 -0
  128. package/lib/esm/combobox/stories/combobox-max-rows.story.js +40 -0
  129. package/lib/esm/combobox/stories/combobox-max-rows.story.js.map +1 -0
  130. package/lib/esm/combobox/stories/combobox-multi.story.js +43 -0
  131. package/lib/esm/combobox/stories/combobox-multi.story.js.map +1 -0
  132. package/lib/esm/combobox/stories/combobox-native-form.story.js +47 -0
  133. package/lib/esm/combobox/stories/combobox-native-form.story.js.map +1 -0
  134. package/lib/esm/combobox/stories/combobox-select-only.story.js +36 -0
  135. package/lib/esm/combobox/stories/combobox-select-only.story.js.map +1 -0
  136. package/lib/esm/combobox/stories/combobox-sizes.story.js +31 -0
  137. package/lib/esm/combobox/stories/combobox-sizes.story.js.map +1 -0
  138. package/lib/esm/combobox/stories/combobox-unlimited-rows.story.js +40 -0
  139. package/lib/esm/combobox/stories/combobox-unlimited-rows.story.js.map +1 -0
  140. package/lib/esm/combobox/stories/combobox-validation.story.js +31 -0
  141. package/lib/esm/combobox/stories/combobox-validation.story.js.map +1 -0
  142. package/lib/esm/combobox/stories/index.js +100 -0
  143. package/lib/esm/combobox/stories/index.js.map +1 -0
  144. package/lib/esm/combobox/use-combobox-multi-value-overflow.js +166 -0
  145. package/lib/esm/combobox/use-combobox-multi-value-overflow.js.map +1 -0
  146. package/lib/esm/combobox/use-combobox-popover.js +77 -0
  147. package/lib/esm/combobox/use-combobox-popover.js.map +1 -0
  148. package/lib/esm/date-picker/DatePicker.js.map +1 -1
  149. package/lib/esm/dismissible-tag/DismissibleTag.js +1 -1
  150. package/lib/esm/dismissible-tag/DismissibleTag.js.map +1 -1
  151. package/lib/esm/index.js +1 -0
  152. package/lib/esm/index.js.map +1 -1
  153. package/lib/esm/select/Select.js +3 -0
  154. package/lib/esm/select/Select.js.map +1 -1
  155. package/lib/esm/text-area/TextArea.js.map +1 -1
  156. package/lib/esm/text-input/TextInput.js.map +1 -1
  157. package/lib/types/_common/use-semi-controlled-state.d.ts +5 -1
  158. package/lib/types/_common/use-semi-controlled-state.d.ts.map +1 -1
  159. package/lib/types/combobox/Combobox.d.ts +24 -0
  160. package/lib/types/combobox/Combobox.d.ts.map +1 -0
  161. package/lib/types/combobox/combobox-types.d.ts +419 -0
  162. package/lib/types/combobox/combobox-types.d.ts.map +1 -0
  163. package/lib/types/combobox/combobox-utils.d.ts +81 -0
  164. package/lib/types/combobox/combobox-utils.d.ts.map +1 -0
  165. package/lib/types/combobox/index.d.ts +23 -0
  166. package/lib/types/combobox/index.d.ts.map +1 -0
  167. package/lib/types/combobox/stories/combobox-action-on-select.story.d.ts +24 -0
  168. package/lib/types/combobox/stories/combobox-action-on-select.story.d.ts.map +1 -0
  169. package/lib/types/combobox/stories/combobox-actions.story.d.ts +24 -0
  170. package/lib/types/combobox/stories/combobox-actions.story.d.ts.map +1 -0
  171. package/lib/types/combobox/stories/combobox-async.story.d.ts +24 -0
  172. package/lib/types/combobox/stories/combobox-async.story.d.ts.map +1 -0
  173. package/lib/types/combobox/stories/combobox-clean.story.d.ts +24 -0
  174. package/lib/types/combobox/stories/combobox-clean.story.d.ts.map +1 -0
  175. package/lib/types/combobox/stories/combobox-creatable.story.d.ts +24 -0
  176. package/lib/types/combobox/stories/combobox-creatable.story.d.ts.map +1 -0
  177. package/lib/types/combobox/stories/combobox-custom-multi.story.d.ts +24 -0
  178. package/lib/types/combobox/stories/combobox-custom-multi.story.d.ts.map +1 -0
  179. package/lib/types/combobox/stories/combobox-custom-single.story.d.ts +24 -0
  180. package/lib/types/combobox/stories/combobox-custom-single.story.d.ts.map +1 -0
  181. package/lib/types/combobox/stories/combobox-custom-trigger.story.d.ts +24 -0
  182. package/lib/types/combobox/stories/combobox-custom-trigger.story.d.ts.map +1 -0
  183. package/lib/types/combobox/stories/combobox-default.story.d.ts +24 -0
  184. package/lib/types/combobox/stories/combobox-default.story.d.ts.map +1 -0
  185. package/lib/types/combobox/stories/combobox-descriptions.story.d.ts +24 -0
  186. package/lib/types/combobox/stories/combobox-descriptions.story.d.ts.map +1 -0
  187. package/lib/types/combobox/stories/combobox-disabled.story.d.ts +24 -0
  188. package/lib/types/combobox/stories/combobox-disabled.story.d.ts.map +1 -0
  189. package/lib/types/combobox/stories/combobox-fluid.story.d.ts +24 -0
  190. package/lib/types/combobox/stories/combobox-fluid.story.d.ts.map +1 -0
  191. package/lib/types/combobox/stories/combobox-groups.story.d.ts +24 -0
  192. package/lib/types/combobox/stories/combobox-groups.story.d.ts.map +1 -0
  193. package/lib/types/combobox/stories/combobox-hidden-label.story.d.ts +24 -0
  194. package/lib/types/combobox/stories/combobox-hidden-label.story.d.ts.map +1 -0
  195. package/lib/types/combobox/stories/combobox-icons.story.d.ts +24 -0
  196. package/lib/types/combobox/stories/combobox-icons.story.d.ts.map +1 -0
  197. package/lib/types/combobox/stories/combobox-in-dialog.story.d.ts +24 -0
  198. package/lib/types/combobox/stories/combobox-in-dialog.story.d.ts.map +1 -0
  199. package/lib/types/combobox/stories/combobox-in-popover-dialog.story.d.ts +24 -0
  200. package/lib/types/combobox/stories/combobox-in-popover-dialog.story.d.ts.map +1 -0
  201. package/lib/types/combobox/stories/combobox-in-popover.story.d.ts +24 -0
  202. package/lib/types/combobox/stories/combobox-in-popover.story.d.ts.map +1 -0
  203. package/lib/types/combobox/stories/combobox-large-data-set.story.d.ts +24 -0
  204. package/lib/types/combobox/stories/combobox-large-data-set.story.d.ts.map +1 -0
  205. package/lib/types/combobox/stories/combobox-max-rows.story.d.ts +24 -0
  206. package/lib/types/combobox/stories/combobox-max-rows.story.d.ts.map +1 -0
  207. package/lib/types/combobox/stories/combobox-multi.story.d.ts +24 -0
  208. package/lib/types/combobox/stories/combobox-multi.story.d.ts.map +1 -0
  209. package/lib/types/combobox/stories/combobox-native-form.story.d.ts +24 -0
  210. package/lib/types/combobox/stories/combobox-native-form.story.d.ts.map +1 -0
  211. package/lib/types/combobox/stories/combobox-select-only.story.d.ts +24 -0
  212. package/lib/types/combobox/stories/combobox-select-only.story.d.ts.map +1 -0
  213. package/lib/types/combobox/stories/combobox-sizes.story.d.ts +24 -0
  214. package/lib/types/combobox/stories/combobox-sizes.story.d.ts.map +1 -0
  215. package/lib/types/combobox/stories/combobox-unlimited-rows.story.d.ts +24 -0
  216. package/lib/types/combobox/stories/combobox-unlimited-rows.story.d.ts.map +1 -0
  217. package/lib/types/combobox/stories/combobox-validation.story.d.ts +24 -0
  218. package/lib/types/combobox/stories/combobox-validation.story.d.ts.map +1 -0
  219. package/lib/types/combobox/stories/index.d.ts +73 -0
  220. package/lib/types/combobox/stories/index.d.ts.map +1 -0
  221. package/lib/types/combobox/use-combobox-multi-value-overflow.d.ts +76 -0
  222. package/lib/types/combobox/use-combobox-multi-value-overflow.d.ts.map +1 -0
  223. package/lib/types/combobox/use-combobox-popover.d.ts +66 -0
  224. package/lib/types/combobox/use-combobox-popover.d.ts.map +1 -0
  225. package/lib/types/date-picker/DatePicker.d.ts.map +1 -1
  226. package/lib/types/dismissible-tag/DismissibleTag.d.ts.map +1 -1
  227. package/lib/types/index.d.ts +1 -0
  228. package/lib/types/index.d.ts.map +1 -1
  229. package/lib/types/select/Select.d.ts +3 -0
  230. package/lib/types/select/Select.d.ts.map +1 -1
  231. package/lib/types/text-input/TextInput.d.ts.map +1 -1
  232. package/package.json +10 -4
  233. package/skills/ndl-react/SKILL.md +20 -0
  234. package/skills/ndl-react/components/combobox.md +1487 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Combobox.js","sourceRoot":"","sources":["../../../src/combobox/Combobox.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,EAC1B,eAAe,EACf,gBAAgB,GACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAkB3C,OAAO,EACL,WAAW,EACX,cAAc,EACd,iBAAiB,EAIjB,q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","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport {\n FloatingFocusManager,\n FloatingPortal,\n useMergeRefs,\n} from '@floating-ui/react';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport classNames from 'classnames';\nimport { Fragment, useEffect, useId, useMemo, useRef, useState } from 'react';\n\nimport { type CommonProps } from '../_common/types';\nimport { useSemicontrolledState } from '../_common/use-semi-controlled-state';\nimport { needleWarningMessage } from '../_common/utils';\nimport { Checkbox } from '../checkbox';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { DismissibleTag } from '../dismissible-tag';\nimport { Divider } from '../divider';\nimport {\n CheckIconOutline,\n ChevronDownIconOutline,\n ExclamationCircleIconSolid,\n MagnifyingGlassIconOutline,\n PlusIconOutline,\n XMarkIconOutline,\n} from '../icons/generated/heroIcons';\nimport { LoadingSpinner } from '../loading-spinner';\nimport { ReadOnlyTag } from '../read-only-tag';\nimport { useNeedleTheme } from '../theme';\nimport { Typography } from '../typography';\nimport {\n type ComboboxControlProps,\n type ComboboxEmptyStateProps,\n type ComboboxFieldState,\n type ComboboxGroupProps,\n type ComboboxInputProps,\n type ComboboxListBoxProps,\n type ComboboxOption,\n type ComboboxOptionContentProps,\n type ComboboxOptionGroup,\n type ComboboxOptionProps,\n type ComboboxPanelProps,\n type ComboboxProps,\n type ComboboxSize,\n type ComboboxTriggerProps,\n type ComboboxTriggerState,\n} from './combobox-types';\nimport {\n asActionRow,\n asCreateOption,\n buildCreateOption,\n type ComboboxActionRow,\n type ComboboxRow,\n type ComboboxValue,\n filterComboboxOptions,\n flattenComboboxOptions,\n formatCreateOptionLabel,\n getAction,\n getFirstOptionIndex,\n getInitialValue,\n getLastOptionIndex,\n getNextOptionIndex,\n isActionRow,\n isCreateOption,\n isOptionGroup,\n isValidNewComboboxOption,\n} from './combobox-utils';\nimport {\n formatOverflowCount,\n getOverflowCounterMeasureTexts,\n useComboboxMultiValueOverflow,\n} from './use-combobox-multi-value-overflow';\nimport { useComboboxPopover } from './use-combobox-popover';\n\nconst DEFAULT_SEARCH_PLACEHOLDER = 'Search';\nconst DEFAULT_PLACEHOLDER = 'Select...';\nconst DEFAULT_LOADING_MESSAGE = 'Loading...';\nconst NO_ACTIVE_INDEX = -1;\nconst OPENING_KEYS = ['ArrowDown', 'ArrowUp', 'Enter', ' '];\n// Above this many rendered rows - options and group headers - the listbox\n// switches to windowed rendering. Below it, the DOM, including the nested\n// group semantics, is exactly what it always was.\nconst VIRTUALIZATION_ROW_THRESHOLD = 100;\n// Starting guess only: every virtual row is measured once rendered.\nconst VIRTUAL_ROW_ESTIMATED_HEIGHT = 38;\n// With a row limit, at most this many candidate tags per permitted row are\n// rendered and measured; anything past them is overflowed arithmetically. Far\n// more than fit a row even with the narrowest plausible tags.\nconst TAG_CANDIDATES_PER_ROW = 50;\n// The counter's title and screen reader text name at most this many overflowed\n// options before summarizing the rest as a count.\nconst OVERFLOW_LABEL_LIMIT = 20;\n// The hidden form select mirrors the options so browser autofill can match\n// against them, but past this many the DOM cost outweighs an autofill list\n// nobody scrolls. Above it, only what submission, validation, and reset need\n// is mirrored: the selection and the default value. Matches the limit React\n// Aria's HiddenSelect uses for the same trade-off.\nconst FORM_OPTION_MIRROR_LIMIT = 300;\n\n/**\n * One row of the windowed listbox. Group headers become rows of their own,\n * since windowing cannot keep the nested group wrappers. Action rows are never\n * windowed: they are pinned below the listbox and always rendered.\n */\ntype ComboboxDisplayRow<TOption extends ComboboxOption> =\n | { kind: 'group-header'; label: string }\n | { kind: 'option'; row: TOption };\n\n/**\n * Flattens the grouped option items into display rows for the virtualizer,\n * along with a lookup from an option's flat index - the one behind option ids\n * and the active index - to its display row index. Pinned action rows sit at\n * the end of the flat indices but get no display row, so the lookup simply\n * misses for them.\n */\nconst buildComboboxDisplayRows = <TOption extends ComboboxOption>(\n optionItems: (TOption | ComboboxOptionGroup<TOption>)[],\n) => {\n const displayRows: ComboboxDisplayRow<TOption>[] = [];\n const flatToDisplayIndex: number[] = [];\n const pushOption = (row: TOption) => {\n flatToDisplayIndex.push(displayRows.length);\n displayRows.push({ kind: 'option', row });\n };\n\n optionItems.forEach((item) => {\n if (isOptionGroup(item)) {\n displayRows.push({ kind: 'group-header', label: item.label });\n item.options.forEach(pushOption);\n return;\n }\n\n pushOption(item);\n });\n\n return { displayRows, flatToDisplayIndex };\n};\n\nexport const Combobox = <TOption extends ComboboxOption = ComboboxOption>({\n label,\n name,\n formId,\n autoComplete,\n triggerRef,\n hasVisuallyHiddenLabel = false,\n helpText,\n errorText,\n isRequired = false,\n hasRequiredIndicator = false,\n options,\n value,\n defaultValue,\n onChange,\n isMulti = false,\n isSearchable = true,\n searchValue,\n defaultSearchValue,\n onSearchChange,\n filterOption,\n searchPlaceholder = DEFAULT_SEARCH_PLACEHOLDER,\n isLoading = false,\n loadingMessage = DEFAULT_LOADING_MESSAGE,\n isCreatable = false,\n onCreateOption,\n createOption = buildCreateOption,\n formatCreateLabel = formatCreateOptionLabel,\n isValidNewOption = isValidNewComboboxOption,\n actions,\n maxRows = 1,\n isOpen,\n onOpenChange,\n isClearable = false,\n placeholder = DEFAULT_PLACEHOLDER,\n isDisabled = false,\n size = 'medium',\n isFluid = false,\n isClean = false,\n isPortaled,\n portalTarget,\n floatingStrategy,\n renderTrigger,\n components = {},\n className,\n style,\n htmlAttributes,\n ref,\n}: CommonProps<'div', ComboboxProps<TOption>>) => {\n const baseId = useId();\n const listboxId = `${baseId}-listbox`;\n const panelId = `${baseId}-panel`;\n const triggerId = `${baseId}-trigger`;\n const labelId = `${baseId}-label`;\n const helpTextId = `${baseId}-help-text`;\n const errorTextId = `${baseId}-error-text`;\n const initialValue = getInitialValue(value, defaultValue, isMulti);\n const [selectedValue, setSelectedValue, resetSelectedValue] =\n useSemicontrolledState<ComboboxValue<TOption>>({\n isControlled: value !== undefined,\n onChange: (nextValue) => {\n if (isMulti) {\n (onChange as ((value: TOption[]) => void) | undefined)?.(\n Array.isArray(nextValue) ? nextValue : [],\n );\n } else if (!Array.isArray(nextValue)) {\n (onChange as ((value: TOption | null) => void) | undefined)?.(\n nextValue,\n );\n }\n },\n state: initialValue,\n });\n\n const [currentSearchValue, setCurrentSearchValue, resetSearchValue] =\n useSemicontrolledState<string>({\n isControlled: searchValue !== undefined,\n onChange: onSearchChange,\n state: searchValue ?? defaultSearchValue ?? '',\n });\n\n const [isPanelOpen, setIsPanelOpen, resetPanelOpen] =\n useSemicontrolledState<boolean>({\n isControlled: isOpen !== undefined,\n onChange: onOpenChange,\n state: isOpen ?? false,\n });\n\n const { themeClassName } = useNeedleTheme();\n const internalTriggerRef = useRef<HTMLElement | null>(null);\n const searchInputRef = useRef<HTMLInputElement | null>(null);\n const {\n context,\n floatingStyles,\n getFloatingProps,\n getReferenceProps,\n isPortaled: isPanelPortaled,\n refs,\n } = useComboboxPopover({\n floatingStrategy,\n isDisabled,\n isOpen: isPanelOpen,\n isPortaled,\n onOpenChange: setIsPanelOpen,\n });\n const hasCustomTrigger = renderTrigger !== undefined;\n const builtInTriggerRef = useMergeRefs([internalTriggerRef, triggerRef]);\n const customTriggerRef = useMergeRefs([\n refs.setReference,\n internalTriggerRef,\n triggerRef,\n ]);\n\n // Creating builds an option out of the search value, so there is nothing to\n // create from without a search input.\n const canCreate = isCreatable && isSearchable;\n\n useEffect(() => {\n if (isCreatable && !isSearchable) {\n needleWarningMessage(\n 'A creatable Combobox also needs isSearchable, since a new option is built from the search value.',\n );\n }\n }, [isCreatable, isSearchable]);\n\n const selectedOptions = getSelectedOptions(selectedValue);\n const resetValue = getInitialValue(undefined, defaultValue, isMulti);\n const resetSelectedOptions = getSelectedOptions(resetValue);\n const selectedValuesKey = selectedOptions\n .map((option) => option.value)\n .join('\\u0000');\n // Selection checks run once per rendered option, so with large lists they\n // must not scan the selection array each time.\n const selectedValuesSet = useMemo(\n () => new Set(getSelectedOptions(selectedValue).map(({ value }) => value)),\n [selectedValue],\n );\n const allOptions = useMemo(() => flattenComboboxOptions(options), [options]);\n const [nativeValidationMessage, setNativeValidationMessage] = useState<\n string | undefined\n >(undefined);\n const formOptions = useMemo(() => {\n const seenValues = new Set<string>();\n // The default value options are mirrored even above the limit, since the\n // native select can only reset to options it renders.\n const mirroredOptions =\n allOptions.length > FORM_OPTION_MIRROR_LIMIT\n ? [\n ...getSelectedOptions(selectedValue),\n ...getSelectedOptions(\n getInitialValue(undefined, defaultValue, isMulti),\n ),\n ]\n : [...allOptions, ...getSelectedOptions(selectedValue)];\n\n return mirroredOptions.filter((option) => {\n if (seenValues.has(option.value)) {\n return false;\n }\n\n seenValues.add(option.value);\n return true;\n });\n }, [allOptions, selectedValue, defaultValue, isMulti]);\n\n useEffect(() => {\n setNativeValidationMessage(undefined);\n }, [selectedValuesKey]);\n\n const resetFromForm = () => {\n resetSelectedValue(resetValue);\n resetSearchValue(defaultSearchValue ?? '');\n resetPanelOpen(false);\n setNativeValidationMessage(undefined);\n };\n const filteredOptions = useMemo(\n () =>\n isSearchable\n ? filterComboboxOptions(options, currentSearchValue, filterOption)\n : options,\n [isSearchable, options, currentSearchValue, filterOption],\n );\n // Created options are never added to `options`, so the selection is offered\n // for deduplication as well.\n const createRow =\n canCreate &&\n isValidNewOption(currentSearchValue, [...allOptions, ...selectedOptions])\n ? asCreateOption(createOption(currentSearchValue))\n : undefined;\n // The create row is appended after any groups rather than inside one, since it\n // belongs to the list as a whole.\n const optionItems: (TOption | ComboboxOptionGroup<TOption>)[] =\n createRow === undefined ? filteredOptions : [...filteredOptions, createRow];\n // Actions are not data, so they survive filtering and close the list off at\n // the end, after anything that selects.\n const actionRows = (actions ?? []).map(asActionRow);\n const flatOptions: ComboboxRow<TOption>[] = [\n ...flattenComboboxOptions(optionItems),\n ...actionRows,\n ];\n const optionsKey = flatOptions.map((option) => option.value).join('\\u0000');\n // Ids and hover both need a row's index; one O(n) map build per render\n // replaces an O(n) scan per rendered row.\n const rowIndexes = new Map<ComboboxRow<TOption>, number>(\n flatOptions.map((row, index) => [row, index]),\n );\n const getOptionId = (row: ComboboxRow<TOption>) =>\n `${baseId}-option-${rowIndexes.get(row) ?? NO_ACTIVE_INDEX}`;\n const groupHeaderCount = optionItems.reduce(\n (count, item) => (isOptionGroup(item) ? count + 1 : count),\n 0,\n );\n // Only the options listbox is windowed; the pinned action rows below it\n // are always rendered, so they do not count towards the threshold.\n const displayRowCount =\n flatOptions.length - actionRows.length + groupHeaderCount;\n const isListVirtualized = displayRowCount > VIRTUALIZATION_ROW_THRESHOLD;\n const virtualRows = isListVirtualized\n ? buildComboboxDisplayRows(optionItems)\n : undefined;\n // Registered by the virtualized listbox while it is mounted, since scrolling\n // a windowed list works by index rather than by element.\n const scrollToActiveRowRef = useRef<((flatIndex: number) => void) | null>(\n null,\n );\n\n // No option is active until the user navigates or hovers, so nothing is\n // highlighted and Enter is inert before then.\n const [activeIndex, setActiveIndex] = useState(NO_ACTIVE_INDEX);\n const [renderedOptionsKey, setRenderedOptionsKey] = useState(optionsKey);\n const wasActivatedByPointerRef = useRef(false);\n\n // Indices change meaning when the list is filtered, so a stale one would\n // point at the wrong option.\n if (renderedOptionsKey !== optionsKey) {\n setRenderedOptionsKey(optionsKey);\n setActiveIndex(NO_ACTIVE_INDEX);\n }\n\n const activeOption = flatOptions[activeIndex];\n const activeOptionId =\n activeOption === undefined ? undefined : getOptionId(activeOption);\n\n // The listbox scrolls, so keep the virtually focused option visible.\n // Pointer activation is skipped, otherwise hovering a partially visible\n // option would nudge the list out from under the cursor. Pinned action rows\n // sit outside the scrolling listbox and are always visible, so scrolling\n // for them is a harmless no-op in both paths.\n useEffect(() => {\n if (wasActivatedByPointerRef.current) {\n wasActivatedByPointerRef.current = false;\n return;\n }\n\n if (activeOptionId === undefined) {\n return;\n }\n\n // A windowed listbox scrolls by index, since the active option's element\n // may not be mounted yet. Scrolling is also what mounts it, keeping\n // aria-activedescendant resolvable.\n if (scrollToActiveRowRef.current !== null) {\n scrollToActiveRowRef.current(activeIndex);\n return;\n }\n\n document\n .getElementById(activeOptionId)\n ?.scrollIntoView({ block: 'nearest' });\n }, [activeOptionId, activeIndex]);\n\n // Reopening the panel starts with nothing highlighted, the same as the first\n // open, so a stale active option can never be one Enter away from selection.\n useEffect(() => {\n if (!isPanelOpen) {\n setActiveIndex(NO_ACTIVE_INDEX);\n }\n }, [isPanelOpen]);\n\n const isOptionSelected = (option: TOption) =>\n selectedValuesSet.has(option.value);\n\n const selectOption = (option: TOption) => {\n if (isMulti) {\n const currentValue = Array.isArray(selectedValue) ? selectedValue : [];\n const isSelected = selectedValuesSet.has(option.value);\n const nextValue = isSelected\n ? currentValue.filter((selected) => selected.value !== option.value)\n : [...currentValue, option];\n\n setSelectedValue(nextValue);\n // Multi select keeps the panel open so several options can be picked in\n // one pass, matching Select.\n return;\n }\n\n if (Array.isArray(selectedValue) || selectedValue?.value !== option.value) {\n setSelectedValue(option);\n }\n\n setIsPanelOpen(false);\n };\n\n const createFromSearch = () => {\n const created = createOption(currentSearchValue);\n\n selectOption(created);\n onCreateOption?.(created);\n // Multi select stays open, so the query is reset to leave the full list\n // usable for the next pick.\n setCurrentSearchValue('');\n };\n\n const handleOptionChange = (row: ComboboxRow<TOption>) => {\n if (isDisabled || row.isDisabled) {\n return;\n }\n\n // An action leaves the selection alone, so it only runs and closes.\n if (isActionRow(row)) {\n getAction(row).onSelect({ searchValue: currentSearchValue });\n setIsPanelOpen(false);\n return;\n }\n\n if (isCreateOption(row)) {\n createFromSearch();\n return;\n }\n\n selectOption(row);\n };\n\n const clearSelection = () => {\n if (isDisabled) {\n return;\n }\n\n setSelectedValue(isMulti ? [] : null);\n };\n\n const removeOption = (option: TOption) => {\n if (isDisabled) {\n return;\n }\n\n if (!isMulti) {\n clearSelection();\n return;\n }\n\n setSelectedValue(\n selectedOptions.filter((selected) => selected.value !== option.value),\n );\n };\n\n // Hover and the keyboard share one active option, so exactly one option is\n // ever highlighted. Unlike the keyboard, hover skips disabled options: a\n // pointer user sees the disabled state directly, so there is no\n // discoverability to preserve.\n const handleOptionHover = (row: ComboboxRow<TOption>) => {\n if (row.isDisabled === true) {\n return;\n }\n\n const index = rowIndexes.get(row) ?? NO_ACTIVE_INDEX;\n\n if (index === activeIndex) {\n return;\n }\n\n wasActivatedByPointerRef.current = true;\n setActiveIndex(index);\n };\n\n // Disabled options are included so they stay discoverable to screen reader\n // users, per the APG guidance on disabled controls in composite widgets.\n // Activating one is a no-op.\n const moveActiveIndex = (direction: 1 | -1) => {\n if (activeIndex === NO_ACTIVE_INDEX) {\n setActiveIndex(\n direction === 1\n ? getFirstOptionIndex(flatOptions)\n : getLastOptionIndex(flatOptions),\n );\n return;\n }\n\n setActiveIndex(getNextOptionIndex(flatOptions, activeIndex, direction));\n };\n\n /**\n * Shared by the search input and the select-only trigger, since both drive\n * the same virtual focus. Returns whether the key was consumed.\n */\n const handleNavigationKeyDown = (event: React.KeyboardEvent) => {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n moveActiveIndex(1);\n return true;\n case 'ArrowUp':\n event.preventDefault();\n moveActiveIndex(-1);\n return true;\n case 'Home':\n event.preventDefault();\n setActiveIndex(getFirstOptionIndex(flatOptions));\n return true;\n case 'End':\n event.preventDefault();\n setActiveIndex(getLastOptionIndex(flatOptions));\n return true;\n case 'Enter':\n if (activeOption === undefined) {\n return false;\n }\n event.preventDefault();\n handleOptionChange(activeOption);\n return true;\n default:\n return false;\n }\n };\n\n const handleSearchKeyDown = (\n event: React.KeyboardEvent<HTMLInputElement>,\n ) => {\n // Home and End belong to the text cursor while typing.\n if (event.key === 'Home' || event.key === 'End') {\n return;\n }\n\n if (handleNavigationKeyDown(event)) {\n return;\n }\n\n if (event.key === 'Escape') {\n // Escape belongs to this combobox: close immediately and keep it from\n // dismissing an enclosing dialog, popover, or other composite widget.\n event.preventDefault();\n event.stopPropagation();\n if (currentSearchValue !== '') {\n setCurrentSearchValue('');\n }\n setIsPanelOpen(false);\n }\n };\n\n const handleTriggerKeyDown = (event: React.KeyboardEvent) => {\n if (isDisabled) {\n return;\n }\n\n if (!isPanelOpen) {\n if (!OPENING_KEYS.includes(event.key)) {\n return;\n }\n\n // Preventing the default keeps the button from synthesizing a click,\n // which would let useClick toggle the panel straight back shut.\n event.preventDefault();\n setIsPanelOpen(true);\n\n if (!isSearchable && event.key === 'ArrowDown') {\n setActiveIndex(getFirstOptionIndex(flatOptions));\n } else if (!isSearchable && event.key === 'ArrowUp') {\n setActiveIndex(getLastOptionIndex(flatOptions));\n }\n\n return;\n }\n\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n setIsPanelOpen(false);\n return;\n }\n\n // A searchable panel holds DOM focus in its search input, so the trigger\n // only ever sees keys while the panel is closed.\n if (isSearchable) {\n return;\n }\n\n if (event.key === ' ' && activeOption !== undefined) {\n event.preventDefault();\n handleOptionChange(activeOption);\n return;\n }\n\n if (handleNavigationKeyDown(event)) {\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n setIsPanelOpen(false);\n }\n };\n\n // Actions are rows of the listbox but not results, so they keep the list\n // rendered without hiding the message that nothing matched.\n const hasRows = flatOptions.length > 0;\n const hasOptionRows = flatOptions.length > actionRows.length;\n // The pinned action rows live outside the scrolling listbox, so the listbox\n // claims them through aria-owns to keep them its logical children.\n const actionOwnsIds =\n actionRows.length > 0\n ? actionRows.map((row) => getOptionId(row)).join(' ')\n : undefined;\n const isDialogPanel = isSearchable;\n // An error replaces the help text, so only one message is ever rendered and\n // only that one is described.\n const displayedErrorText = errorText ?? nativeValidationMessage;\n const hasError = Boolean(displayedErrorText);\n const hasHelpText = Boolean(helpText) && !hasError;\n const messageId = hasError ? errorTextId : helpTextId;\n const describedById = hasError || hasHelpText ? messageId : undefined;\n const triggerAria = {\n 'aria-activedescendant':\n isPanelOpen && !isSearchable ? activeOptionId : undefined,\n 'aria-controls': getTriggerControlsId({\n hasRows,\n isDialogPanel,\n isPanelOpen,\n listboxId,\n panelId,\n }),\n 'aria-describedby': describedById,\n 'aria-disabled': isDisabled ? true : undefined,\n 'aria-expanded': isPanelOpen,\n 'aria-haspopup': isDialogPanel ? ('dialog' as const) : ('listbox' as const),\n 'aria-invalid': hasError ? true : undefined,\n 'aria-required': isRequired ? true : undefined,\n // The label points at the trigger through `htmlFor`, so clicking it moves\n // focus to the trigger.\n id: triggerId,\n onKeyDown: handleTriggerKeyDown,\n role: 'combobox' as const,\n };\n // A custom trigger becomes the anchor itself, so it gets the reference props\n // and the reference ref. The built-in trigger leaves both to its wrapper,\n // which is what the panel should size to, and takes only the ARIA.\n //\n // It is also named by the label text itself rather than by a reference to it,\n // since a custom trigger is free to leave the label unrendered.\n const triggerProps: ComboboxTriggerProps = {\n ...(getReferenceProps() as React.HTMLAttributes<HTMLElement>),\n ...triggerAria,\n 'aria-label': label,\n ref: customTriggerRef,\n };\n const builtInTriggerProps: ComboboxTriggerProps = {\n ...triggerAria,\n // The label row also holds the required indicator, so only the label text\n // is referenced, keeping \"Optional\" out of the accessible name.\n 'aria-labelledby': labelId,\n ref: builtInTriggerRef,\n };\n const field: ComboboxFieldState = {\n errorText: displayedErrorText,\n errorTextId,\n hasError,\n hasRequiredIndicator,\n hasVisuallyHiddenLabel,\n helpText,\n helpTextId,\n isRequired,\n label,\n labelId,\n triggerId,\n };\n const triggerState: ComboboxTriggerState<TOption> = {\n clear: clearSelection,\n field,\n isDisabled,\n isMulti,\n isOpen: isPanelOpen,\n remove: removeOption,\n selectedOptions,\n };\n\n // While windowed, the DOM no longer holds every option, so each one carries\n // its position in the full list for assistive technology.\n const getSetPositionProps = (row: ComboboxRow<TOption>) =>\n isListVirtualized\n ? {\n posInSet: (rowIndexes.get(row) ?? 0) + 1,\n setSize: flatOptions.length,\n }\n : {};\n\n const renderOption = (option: TOption) => {\n const sharedProps = {\n id: getOptionId(option),\n isFocused: option === activeOption,\n onClick: () => handleOptionChange(option),\n onHover: () => handleOptionHover(option),\n ...getSetPositionProps(option),\n };\n\n // The create row is never selected and shows the create text rather than\n // the label of the option it would produce.\n if (isCreateOption(option)) {\n return (\n <Option\n key=\"ndl-combobox-create\"\n {...sharedProps}\n isCreate\n isSelected={false}\n >\n <CreateOptionContent>\n {formatCreateLabel(currentSearchValue)}\n </CreateOptionContent>\n </Option>\n );\n }\n\n const { OptionLabel } = components;\n const isSelected = isOptionSelected(option);\n\n return (\n <Option\n key={option.value}\n {...sharedProps}\n isSelected={isSelected}\n isDisabled={option.isDisabled}\n >\n <OptionContent\n label={option.label}\n customLabel={\n OptionLabel === undefined ? undefined : (\n <OptionLabel\n option={option}\n isSelected={isSelected}\n isDisabled={option.isDisabled ?? false}\n isFocused={option === activeOption}\n isMulti={isMulti}\n size={size}\n />\n )\n }\n description={option.description}\n leadingVisual={option.leadingVisual}\n isDisabled={option.isDisabled}\n isSelected={isSelected}\n isMulti={isMulti}\n />\n </Option>\n );\n };\n\n // An action row shares the chrome of an option but never the selection, so it\n // is rendered as a single select row: its own leading visual instead of a\n // checkbox, and no selection indicator.\n const renderAction = (row: ComboboxActionRow) => {\n const action = getAction(row);\n\n return (\n <Option\n key={row.value}\n id={getOptionId(row)}\n isAction\n isDisabled={action.isDisabled}\n isFocused={row === activeOption}\n onClick={() => handleOptionChange(row)}\n onHover={() => handleOptionHover(row)}\n {...getSetPositionProps(row)}\n >\n <OptionContent\n label={action.label}\n description={action.description}\n leadingVisual={action.leadingVisual}\n isDisabled={action.isDisabled}\n />\n </Option>\n );\n };\n\n const panel = (\n <Panel\n {...getFloatingProps()}\n ref={refs.setFloating}\n id={panelId}\n ariaLabel={label}\n isDialog={isDialogPanel}\n className={themeClassName}\n style={floatingStyles}\n >\n {isSearchable && (\n <Input\n ref={searchInputRef}\n ariaLabel={searchPlaceholder}\n value={currentSearchValue}\n onValueChange={setCurrentSearchValue}\n placeholder={searchPlaceholder}\n listboxId={hasRows ? listboxId : undefined}\n activeOptionId={hasRows ? activeOptionId : undefined}\n onKeyDown={handleSearchKeyDown}\n />\n )}\n {/* Actions keep the list rendered when nothing matched, so the message\n sits above the list rather than replacing it. Loading replaces the\n empty message while there are no options. */}\n {!hasOptionRows &&\n (isLoading ? (\n <LoadingState>{loadingMessage}</LoadingState>\n ) : (\n <EmptyState />\n ))}\n {/* Actions sit below the scrolling listbox, pinned and always visible\n rather than scrolling away with a long list. The listbox aria-owns\n them, so they stay its logical children for aria-activedescendant\n even though the scroll container leaves them behind. Keeping the\n scroll on the listbox itself also keeps the scrollable element\n recognizable as the combobox popup, which scrollable-region audits\n exempt from needing focusable content. */}\n {hasOptionRows &&\n (virtualRows !== undefined ? (\n <VirtualizedListBox\n id={listboxId}\n ariaLabel={label}\n isMulti={isMulti}\n ownsIds={actionOwnsIds}\n rows={virtualRows.displayRows}\n rowsKey={optionsKey}\n flatToDisplayIndex={virtualRows.flatToDisplayIndex}\n scrollToFlatIndexRef={scrollToActiveRowRef}\n renderRow={renderOption}\n />\n ) : (\n <ListBox\n id={listboxId}\n ariaLabel={label}\n isMulti={isMulti}\n ownsIds={actionOwnsIds}\n >\n {optionItems.map((item) =>\n isOptionGroup(item) ? (\n <Group key={item.label} label={item.label}>\n {item.options.map(renderOption)}\n </Group>\n ) : (\n renderOption(item)\n ),\n )}\n </ListBox>\n ))}\n {actionRows.length > 0 && (\n <div\n // Without any option rows there is no scrolling listbox, so the\n // footer itself is the listbox the trigger controls and the actions\n // are its direct children rather than aria-owned ones.\n {...(hasOptionRows\n ? { role: 'presentation' as const }\n : {\n 'aria-label': label,\n 'aria-multiselectable': isMulti || undefined,\n id: listboxId,\n role: 'listbox' as const,\n })}\n className=\"ndl-combobox-actions\"\n >\n <Divider\n className=\"ndl-combobox-action-divider\"\n htmlAttributes={{ 'aria-hidden': true }}\n />\n {actionRows.map((row, index) => (\n <Fragment key={row.value}>\n {/* An extra divider only ever sits between two actions: the\n first action already sits below the actions divider. */}\n {index > 0 && getAction(row).hasDivider === true && (\n <Divider\n className=\"ndl-combobox-action-divider\"\n htmlAttributes={{ 'aria-hidden': true }}\n />\n )}\n {renderAction(row)}\n </Fragment>\n ))}\n </div>\n )}\n </Panel>\n );\n\n return (\n <div\n ref={ref}\n style={style}\n className={classNames(\n 'ndl-combobox',\n {\n 'ndl-clean': isClean,\n 'ndl-combobox-custom-trigger': hasCustomTrigger,\n 'ndl-combobox-field': !hasCustomTrigger,\n 'ndl-disabled': isDisabled,\n 'ndl-fluid': isFluid,\n 'ndl-has-error': hasError,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-small': size === 'small',\n },\n className,\n )}\n {...htmlAttributes}\n >\n {name !== undefined && (\n <ComboboxFormControl\n ref={internalTriggerRef}\n name={name}\n form={formId}\n autoComplete={autoComplete}\n options={formOptions}\n selectedOptions={selectedOptions}\n resetSelectedOptions={resetSelectedOptions}\n isMulti={isMulti}\n isDisabled={isDisabled}\n isRequired={isRequired}\n isSelectionControlled={value !== undefined}\n onValueChange={setSelectedValue}\n onInvalid={setNativeValidationMessage}\n onReset={resetFromForm}\n />\n )}\n {renderTrigger === undefined ? (\n <Control\n triggerProps={builtInTriggerProps}\n state={triggerState}\n field={field}\n placeholder={placeholder}\n isClearable={isClearable}\n isClean={isClean}\n size={size}\n maxRows={isMulti ? maxRows : undefined}\n components={components}\n referenceProps={getReferenceProps()}\n referenceRef={refs.setReference}\n />\n ) : (\n renderTrigger(triggerProps, triggerState)\n )}\n {context.open && (\n <ConditionalWrap\n shouldWrap={isPanelPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal root={portalTarget}>{wrapChildren}</FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={context}\n modal={false}\n // A select-only combobox keeps DOM focus on the trigger and speaks\n // through aria-activedescendant, so nothing inside is focused.\n initialFocus={isSearchable ? searchInputRef : -1}\n returnFocus={internalTriggerRef}\n >\n {panel}\n </FloatingFocusManager>\n </ConditionalWrap>\n )}\n </div>\n );\n};\n\nconst getTriggerControlsId = ({\n isPanelOpen,\n isDialogPanel,\n hasRows,\n panelId,\n listboxId,\n}: {\n isPanelOpen: boolean;\n isDialogPanel: boolean;\n hasRows: boolean;\n panelId: string;\n listboxId: string;\n}) => {\n if (!isPanelOpen) {\n return undefined;\n }\n\n if (isDialogPanel) {\n return panelId;\n }\n\n // An expanded combobox must always control something, so fall back to the\n // panel when the list is empty and only the status message is rendered.\n return hasRows ? listboxId : panelId;\n};\n\nconst getSelectedOptions = <TOption extends ComboboxOption>(\n value: ComboboxValue<TOption>,\n): TOption[] => {\n if (Array.isArray(value)) {\n return value;\n }\n\n return value === null ? [] : [value];\n};\n\ntype ComboboxFormControlProps<TOption extends ComboboxOption> = {\n ref: React.RefObject<HTMLElement | null>;\n name: string;\n form?: string;\n autoComplete?: string;\n options: TOption[];\n selectedOptions: TOption[];\n resetSelectedOptions: TOption[];\n isMulti: boolean;\n isDisabled: boolean;\n isRequired: boolean;\n isSelectionControlled: boolean;\n onValueChange: (value: ComboboxValue<TOption>) => void;\n onInvalid: (message: string) => void;\n onReset: () => void;\n};\n\n/**\n * A native select mirrors the custom control for submission, autofill,\n * constraint validation, and reset. It is hidden from assistive technology\n * because the combobox trigger exposes the same field semantics.\n *\n * Above `FORM_OPTION_MIRROR_LIMIT` it receives only the selected and default\n * options rather than the full list, so autofill has nothing to offer but\n * everything else keeps working without thousands of mirrored options.\n */\nconst ComboboxFormControl = <TOption extends ComboboxOption>({\n ref: triggerRef,\n name,\n form,\n autoComplete,\n options,\n selectedOptions,\n resetSelectedOptions,\n isMulti,\n isDisabled,\n isRequired,\n isSelectionControlled,\n onValueChange,\n onInvalid,\n onReset,\n}: ComboboxFormControlProps<TOption>) => {\n const selectRef = useRef<HTMLSelectElement | null>(null);\n const isDispatchingChangeRef = useRef(false);\n const isResettingRef = useRef(false);\n const skipNextChangeRef = useRef(false);\n const selectedValues = selectedOptions.map((option) => option.value);\n const resetSelectedValues = resetSelectedOptions.map(\n (option) => option.value,\n );\n const selectedValuesKey = selectedValues.join('\\u0000');\n const previousValuesKeyRef = useRef(selectedValuesKey);\n const valuesOnReset = isSelectionControlled\n ? selectedValues\n : resetSelectedValues;\n const valuesOnResetKey = valuesOnReset.join('\\u0000');\n\n useEffect(() => {\n const select = selectRef.current;\n if (select === null) {\n return;\n }\n\n const resetValues = new Set(valuesOnReset);\n\n Array.from(select.options).forEach((option) => {\n option.defaultSelected = resetValues.has(option.value);\n });\n // valuesOnReset is rebuilt every render, so the effect keys on its content.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [valuesOnResetKey]);\n\n useEffect(() => {\n if (previousValuesKeyRef.current === selectedValuesKey) {\n return;\n }\n\n previousValuesKeyRef.current = selectedValuesKey;\n if (isResettingRef.current || skipNextChangeRef.current) {\n skipNextChangeRef.current = false;\n return;\n }\n\n const select = selectRef.current;\n if (select === null) {\n return;\n }\n\n isDispatchingChangeRef.current = true;\n select.dispatchEvent(new Event('change', { bubbles: true }));\n isDispatchingChangeRef.current = false;\n }, [selectedValuesKey]);\n\n useEffect(() => {\n const select = selectRef.current;\n const formElement = select?.form;\n if (\n select === null ||\n select === undefined ||\n formElement === null ||\n formElement === undefined\n ) {\n return;\n }\n\n const handleReset = () => {\n isResettingRef.current = true;\n onReset();\n\n window.setTimeout(() => {\n isResettingRef.current = false;\n });\n };\n\n formElement.addEventListener('reset', handleReset);\n return () => formElement.removeEventListener('reset', handleReset);\n }, [onReset]);\n\n const handleChange = (event: React.ChangeEvent<HTMLSelectElement>) => {\n if (isDispatchingChangeRef.current) {\n return;\n }\n\n const optionsByValue = new Map(\n options.map((option) => [option.value, option]),\n );\n const nextOptions = Array.from(event.currentTarget.selectedOptions)\n .map((selectedOption) => optionsByValue.get(selectedOption.value))\n .filter((option): option is TOption => option !== undefined);\n skipNextChangeRef.current =\n nextOptions.map((option) => option.value).join('\\u0000') !==\n selectedValuesKey;\n\n onValueChange(isMulti ? nextOptions : (nextOptions[0] ?? null));\n };\n\n return (\n <select\n ref={selectRef}\n className=\"ndl-combobox-form-control\"\n aria-hidden=\"true\"\n tabIndex={-1}\n name={name}\n form={form}\n autoComplete={autoComplete}\n disabled={isDisabled}\n required={isRequired}\n multiple={isMulti}\n value={isMulti ? selectedValues : (selectedValues[0] ?? '')}\n onChange={handleChange}\n onInvalid={(event) => {\n event.preventDefault();\n onInvalid(event.currentTarget.validationMessage);\n triggerRef.current?.focus();\n }}\n >\n {!isMulti && <option value=\"\" />}\n {options.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n );\n};\n\nconst Control = <TOption extends ComboboxOption>({\n triggerProps,\n state,\n field,\n placeholder,\n isClearable,\n isClean,\n size,\n maxRows,\n components,\n referenceProps,\n referenceRef,\n}: ComboboxControlProps<TOption>) => {\n const { isOpen, isMulti, isDisabled, selectedOptions, clear, remove } = state;\n const { MultiValue, SingleValue } = components;\n const { ref: triggerRef, ...triggerAria } = triggerProps;\n const hasValue = selectedOptions.length > 0;\n const singleValueOption = isMulti ? undefined : selectedOptions[0];\n // Selected values are shown as tags, so the trigger renders nothing and is\n // taken out of the wrapping flow rather than claiming a row of its own.\n const isTriggerCollapsed = isMulti && hasValue;\n const multiValueSize = size === 'large' ? 'small' : 'x-small';\n // `null` opts out of the default row limit, so both it and a missing value\n // resolve to unlimited, which the hook expresses as undefined.\n const rowLimit =\n isMulti && maxRows !== null && maxRows !== undefined ? maxRows : undefined;\n // Under a row limit only the tags that could possibly be visible are\n // rendered and measured; the rest of a huge selection is overflowed\n // arithmetically without ever touching the DOM. Without a limit every tag\n // renders, so unlimited rows with a huge selection is on the consumer.\n const tagCandidateCap =\n rowLimit === undefined\n ? selectedOptions.length\n : Math.max(1, Math.floor(rowLimit)) * TAG_CANDIDATES_PER_ROW;\n const renderedOptions =\n selectedOptions.length > tagCandidateCap\n ? selectedOptions.slice(0, tagCandidateCap)\n : selectedOptions;\n const { containerRef: valueContainerRef, visibleCount } =\n useComboboxMultiValueOverflow({\n maxRows: rowLimit,\n // Disabling swaps the dismissible tags for read-only ones, which have no\n // remove button and are narrower. The total count is included since it\n // sets the measure tag texts.\n measureKey: [\n size,\n isDisabled,\n selectedOptions.length,\n ...renderedOptions.map((option) => `${option.value}:${option.label}`),\n ].join('\\u0000'),\n tagCount: renderedOptions.length,\n });\n const visibleTagCount = visibleCount ?? renderedOptions.length;\n const overflowCount = selectedOptions.length - visibleTagCount;\n const overflowedOptions = selectedOptions.slice(\n visibleTagCount,\n visibleTagCount + OVERFLOW_LABEL_LIMIT,\n );\n const unnamedOverflowCount = overflowCount - overflowedOptions.length;\n const overflowedLabels =\n overflowedOptions.map((option) => option.label).join(', ') +\n (unnamedOverflowCount > 0 ? `, and ${unnamedOverflowCount} more` : '');\n // \"+999\" is wider than \"+1K\", so each text the counter could show at its\n // widest is measured; the hook reserves room for the widest of them.\n const counterMeasureTexts = getOverflowCounterMeasureTexts(\n selectedOptions.length,\n );\n const internalTriggerRef = useRef<HTMLButtonElement | null>(null);\n const mergedTriggerRef = useMergeRefs([\n triggerRef,\n internalTriggerRef,\n ]) as React.Ref<HTMLButtonElement>;\n\n const handleAuxiliaryActionKeyDown = (\n event: React.KeyboardEvent<HTMLElement>,\n ) => {\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n event.stopPropagation();\n internalTriggerRef.current?.focus();\n triggerAria.onKeyDown?.(event);\n }\n };\n\n const handleTagRemove = (\n event: React.MouseEvent<HTMLButtonElement>,\n option: TOption,\n ) => {\n // Capture the following removal targets before React removes the current\n // tag. With `maxRows`, the removal can promote a collapsed tag into view,\n // so which of them is focusable is only known after the update.\n const tag = event.currentTarget.closest('[data-ndl-combobox-multi-value]');\n const followingRemoveButtons: HTMLButtonElement[] = [];\n let sibling = tag?.nextElementSibling ?? null;\n\n while (sibling !== null) {\n const removeButton = sibling.querySelector<HTMLButtonElement>(\n '[data-ndl-dismissible-tag-remove]',\n );\n\n if (removeButton !== null) {\n followingRemoveButtons.push(removeButton);\n }\n\n sibling = sibling.nextElementSibling;\n }\n\n // Otherwise the click bubbles to the control and opens the panel.\n event.stopPropagation();\n remove(option);\n\n requestAnimationFrame(() => {\n // A tag collapsed into the overflow counter is invisible and cannot take\n // focus, so it is passed over.\n const nextRemoveButton = followingRemoveButtons.find(\n (removeButton) =>\n removeButton.isConnected &&\n removeButton.closest('.ndl-overflowed') === null,\n );\n\n if (nextRemoveButton !== undefined) {\n nextRemoveButton.focus();\n return;\n }\n\n internalTriggerRef.current?.focus();\n });\n };\n\n const handleClear = (event: React.MouseEvent<HTMLButtonElement>) => {\n // Otherwise the click bubbles to the control and opens the panel.\n event.stopPropagation();\n clear();\n\n // Clearing removes the focused clear button from the DOM. Restore focus to\n // the combobox after React has committed that update.\n requestAnimationFrame(() => {\n internalTriggerRef.current?.focus();\n });\n };\n\n // Clicking the label moves focus to the trigger without opening the panel,\n // as with a native select. Preventing the default cancels the click the\n // label would otherwise forward to the trigger button, which would toggle\n // the panel.\n const handleLabelClick = (event: React.MouseEvent<HTMLLabelElement>) => {\n event.preventDefault();\n internalTriggerRef.current?.focus();\n };\n\n return (\n // A fragment, so the label, the control, and the message are rows of the\n // combobox itself. A custom trigger replaces all three.\n <>\n <FieldLabel field={field} size={size} onLabelClick={handleLabelClick} />\n {/* The reference props carry the click handler that opens the panel. The\n wrapper cannot be focusable itself, since it contains the tag remove\n and clear buttons; the focusable role=\"combobox\" button is a sibling of\n them. */}\n <div\n ref={referenceRef}\n className={classNames('ndl-combobox-control', {\n 'ndl-clean': isClean,\n 'ndl-disabled': isDisabled,\n 'ndl-has-error': field.hasError,\n 'ndl-is-multi': isMulti,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-small': size === 'small',\n })}\n {...referenceProps}\n >\n <div\n ref={valueContainerRef}\n className={classNames('ndl-combobox-value-container', {\n // While a counter may be needed, every tag reserves room for it,\n // so an extreme-width tag shrinks instead of collapsing entirely.\n 'ndl-counter-reserved':\n rowLimit !== undefined && selectedOptions.length > 1,\n })}\n >\n {/* Rendered before tag remove buttons so the combobox is the first\n control reached by Tab. CSS keeps selected tags visually first. */}\n <button\n type=\"button\"\n className={classNames('ndl-combobox-trigger', {\n 'ndl-collapsed': isTriggerCollapsed,\n 'ndl-disabled': isDisabled,\n })}\n {...triggerAria}\n ref={mergedTriggerRef}\n >\n {singleValueOption !== undefined &&\n (SingleValue === undefined ? (\n <span className=\"ndl-combobox-single-value\">\n {singleValueOption.label}\n </span>\n ) : (\n <SingleValue\n option={singleValueOption}\n isDisabled={isDisabled}\n size={size}\n />\n ))}\n {!hasValue && (\n <span className=\"ndl-combobox-placeholder\">{placeholder}</span>\n )}\n </button>\n {isMulti &&\n renderedOptions.map((option, index) => {\n // Tags past the overflow cutoff stay rendered so they keep their\n // measurements, but the stylesheet takes them out of the layout,\n // out of the accessibility tree, and out of focus reach.\n const multiValueClasses = classNames('ndl-combobox-multi-value', {\n 'ndl-overflowed': index >= visibleTagCount,\n });\n\n // A custom value owns its own presentation, so it is only given\n // the wrapper the value container lays out, and no remove button.\n if (MultiValue !== undefined) {\n return (\n <span key={option.value} className={multiValueClasses}>\n <MultiValue\n option={option}\n index={index}\n isDisabled={isDisabled}\n size={size}\n remove={() => remove(option)}\n />\n </span>\n );\n }\n\n return isDisabled ? (\n <ReadOnlyTag\n key={option.value}\n className={multiValueClasses}\n size={multiValueSize}\n >\n {option.label}\n </ReadOnlyTag>\n ) : (\n <DismissibleTag\n key={option.value}\n className={multiValueClasses}\n size={multiValueSize}\n htmlAttributes={{\n 'data-ndl-combobox-multi-value': '',\n onKeyDown: handleAuxiliaryActionKeyDown,\n }}\n onRemove={(event) => handleTagRemove(event, option)}\n >\n {option.label}\n </DismissibleTag>\n );\n })}\n {overflowCount > 0 && (\n <ReadOnlyTag\n className=\"ndl-combobox-multi-value-counter\"\n size={multiValueSize}\n htmlAttributes={{\n title: overflowedLabels,\n }}\n >\n <span aria-hidden=\"true\">\n +{formatOverflowCount(overflowCount)}\n </span>\n <span className=\"ndl-combobox-visually-hidden\">\n {overflowCount} more selected: {overflowedLabels}\n </span>\n </ReadOnlyTag>\n )}\n {rowLimit !== undefined &&\n hasValue &&\n // Invisible and out of the layout, purely to measure the widest\n // counter the current selection could need, so the fit computation\n // can reserve room for it in a single deterministic pass.\n counterMeasureTexts.map((text) => (\n <ReadOnlyTag\n key={text}\n className=\"ndl-combobox-multi-value-measure\"\n size={multiValueSize}\n htmlAttributes={{ 'aria-hidden': true }}\n >\n +{text}\n </ReadOnlyTag>\n ))}\n </div>\n <div className=\"ndl-combobox-indicators-container\">\n {isClearable && hasValue && !isDisabled && (\n // The divider only separates the clear button from the chevron, so\n // it is tied to the button rather than always rendered, as in\n // Select.\n <div className=\"ndl-combobox-clear\">\n <button\n type=\"button\"\n className=\"ndl-combobox-clear-button\"\n aria-label=\"Clear selection\"\n onKeyDown={handleAuxiliaryActionKeyDown}\n onClick={handleClear}\n >\n <XMarkIconOutline />\n </button>\n <div className=\"ndl-combobox-divider\" />\n </div>\n )}\n <div\n className={classNames('ndl-combobox-dropdown-indicator', {\n 'ndl-open': isOpen,\n })}\n >\n <ChevronDownIconOutline\n aria-hidden=\"true\"\n className=\"ndl-combobox-icon\"\n />\n </div>\n </div>\n </div>\n <FieldMessage field={field} size={size} />\n </>\n );\n};\n\ntype FieldPartProps = {\n field: ComboboxFieldState;\n size: ComboboxSize;\n onLabelClick?: React.MouseEventHandler<HTMLLabelElement>;\n};\n\n/**\n * The trigger is a button with `role=\"combobox\"`, which takes its accessible\n * name from the author rather than from its content, so the label is referenced\n * through `aria-labelledby` instead of wrapping the control in a `<label>`.\n * The label is still a `<label>` associated through `htmlFor`, and clicking it\n * moves focus to the trigger, as with a native select. It deliberately does\n * not open the panel, which is also what a native select label leaves alone.\n */\nconst FieldLabel = ({ field, size, onLabelClick }: FieldPartProps) => {\n const {\n label,\n labelId,\n triggerId,\n hasVisuallyHiddenLabel,\n hasRequiredIndicator,\n isRequired,\n } = field;\n const variant = size === 'large' ? 'body-large' : 'body-medium';\n\n return (\n <div\n className={classNames('ndl-combobox-label-row', {\n 'ndl-visually-hidden': hasVisuallyHiddenLabel,\n })}\n >\n <Typography\n as=\"label\"\n variant={variant}\n className=\"ndl-combobox-label\"\n htmlAttributes={{\n htmlFor: triggerId,\n id: labelId,\n onClick: onLabelClick,\n }}\n >\n {label}\n </Typography>\n {hasRequiredIndicator && (\n <Typography variant={variant} className=\"ndl-combobox-label-indicator\">\n {isRequired ? 'Required' : 'Optional'}\n </Typography>\n )}\n </div>\n );\n};\n\n/**\n * Rendered whether or not there is a message, so the live region is in the\n * document before the text arrives and a validation error is announced.\n */\nconst FieldMessage = ({ field, size }: FieldPartProps) => {\n const { errorText, hasError, helpText, helpTextId, errorTextId } = field;\n const variant = size === 'large' ? 'body-medium' : 'body-small';\n\n return (\n <div className=\"ndl-combobox-message\" aria-live=\"polite\">\n {hasError && (\n <>\n <div className=\"ndl-error-icon\">\n <ExclamationCircleIconSolid />\n </div>\n <Typography\n variant={variant}\n className=\"ndl-error-text\"\n htmlAttributes={{ id: errorTextId }}\n >\n {errorText}\n </Typography>\n </>\n )}\n {!hasError && Boolean(helpText) && (\n <Typography variant={variant} htmlAttributes={{ id: helpTextId }}>\n {helpText}\n </Typography>\n )}\n </div>\n );\n};\n\nconst Panel = ({\n children,\n ref,\n id,\n ariaLabel,\n isDialog,\n className,\n style,\n ...restProps\n}: ComboboxPanelProps) => {\n return (\n <div\n ref={ref}\n id={id}\n role={isDialog === true ? 'dialog' : undefined}\n aria-label={isDialog === true ? ariaLabel : undefined}\n className={classNames('ndl-combobox-panel', className)}\n style={style}\n {...restProps}\n >\n {children}\n </div>\n );\n};\n\nconst Input = ({\n ref,\n ariaLabel,\n value,\n onValueChange,\n placeholder,\n listboxId,\n activeOptionId,\n onKeyDown,\n}: ComboboxInputProps) => {\n return (\n <label className=\"ndl-combobox-input-wrapper\">\n <span className=\"ndl-combobox-input-label\">{ariaLabel}</span>\n <MagnifyingGlassIconOutline className=\"ndl-combobox-input-leading\" />\n <input\n ref={ref}\n type=\"text\"\n role=\"combobox\"\n autoComplete=\"off\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n aria-expanded={listboxId !== undefined}\n aria-controls={listboxId}\n aria-activedescendant={activeOptionId}\n className=\"ndl-combobox-input\"\n placeholder={placeholder}\n value={value}\n onChange={(event) => onValueChange(event.target.value)}\n onKeyDown={onKeyDown}\n />\n </label>\n );\n};\n\nconst ListBox = ({\n ariaLabel,\n children,\n isMulti,\n id,\n ownsIds,\n}: ComboboxListBoxProps) => {\n return (\n <div\n id={id}\n role=\"listbox\"\n aria-label={ariaLabel}\n aria-owns={ownsIds}\n aria-multiselectable={isMulti || undefined}\n className=\"ndl-combobox-listbox\"\n >\n {children}\n </div>\n );\n};\n\ntype ComboboxVirtualizedListBoxProps<TOption extends ComboboxOption> = {\n id?: string;\n ariaLabel: string;\n isMulti?: boolean;\n /** Ids of the pinned action rows the listbox owns without containing. */\n ownsIds?: string;\n rows: ComboboxDisplayRow<TOption>[];\n /** Content identity of the rows, so a filtered list starts back at the top. */\n rowsKey: string;\n /** Display row index for each flat option index, for index-based scrolling. */\n flatToDisplayIndex: number[];\n /** Receives the scroll-to-row callback while this listbox is mounted. */\n scrollToFlatIndexRef: React.RefObject<((flatIndex: number) => void) | null>;\n renderRow: (row: TOption) => React.ReactNode;\n};\n\n/**\n * The windowed listbox used above the row threshold: only the visible slice of\n * rows is in the DOM, absolutely positioned inside one full-height spacer.\n * Group nesting cannot survive windowing, so headers render as presentational\n * rows of their own and options carry `aria-setsize`/`aria-posinset` instead.\n * Pinned action rows render outside, below the listbox, so they are never\n * windowed.\n */\nconst VirtualizedListBox = <TOption extends ComboboxOption>({\n id,\n ariaLabel,\n isMulti,\n ownsIds,\n rows,\n rowsKey,\n flatToDisplayIndex,\n scrollToFlatIndexRef,\n renderRow,\n}: ComboboxVirtualizedListBoxProps<TOption>) => {\n const scrollRef = useRef<HTMLDivElement | null>(null);\n const virtualizer = useVirtualizer({\n count: rows.length,\n estimateSize: () => VIRTUAL_ROW_ESTIMATED_HEIGHT,\n getScrollElement: () => scrollRef.current,\n overscan: 10,\n });\n const pendingScrollIndexRef = useRef<number | null>(null);\n\n useEffect(() => {\n scrollToFlatIndexRef.current = (flatIndex: number) => {\n const displayIndex = flatToDisplayIndex[flatIndex];\n\n if (displayIndex !== undefined) {\n pendingScrollIndexRef.current = displayIndex;\n virtualizer.scrollToIndex(displayIndex);\n }\n };\n\n return () => {\n scrollToFlatIndexRef.current = null;\n };\n });\n\n // A long jump scrolls to an offset built from estimated sizes, and the\n // estimates only get corrected once the rows near the target render, so one\n // scroll can land short. Each render after a scroll re-issues it until the\n // target row is actually mounted, which is also what lets\n // aria-activedescendant resolve.\n useEffect(() => {\n const target = pendingScrollIndexRef.current;\n\n if (target === null) {\n return;\n }\n\n const isRendered = virtualizer\n .getVirtualItems()\n .some((item) => item.index === target);\n\n if (isRendered) {\n pendingScrollIndexRef.current = null;\n return;\n }\n\n virtualizer.scrollToIndex(target);\n });\n\n // A filtered list is a different list, so it starts at the top.\n useEffect(() => {\n virtualizer.scrollToOffset(0);\n // The virtualizer is stable and scrolling must not rerun on its rerenders.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [rowsKey]);\n\n return (\n <div\n ref={scrollRef}\n id={id}\n role=\"listbox\"\n aria-label={ariaLabel}\n aria-owns={ownsIds}\n aria-multiselectable={isMulti === true || undefined}\n className=\"ndl-combobox-listbox\"\n >\n <div\n role=\"presentation\"\n className=\"ndl-combobox-virtual-space\"\n style={{ height: virtualizer.getTotalSize() }}\n >\n {virtualizer.getVirtualItems().map((item) => {\n const row = rows[item.index];\n\n return (\n <div\n key={item.key}\n ref={virtualizer.measureElement}\n data-index={item.index}\n role=\"presentation\"\n className=\"ndl-combobox-virtual-row\"\n style={{ transform: `translateY(${item.start}px)` }}\n >\n {row.kind === 'group-header' ? (\n <GroupHeader isPresentational label={row.label} />\n ) : (\n renderRow(row.row)\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n\nconst Option = ({\n children,\n id,\n isSelected,\n isDisabled,\n isFocused,\n isCreate,\n isAction,\n onClick,\n onHover,\n posInSet,\n setSize,\n}: ComboboxOptionProps) => {\n const classes = classNames('ndl-combobox-option', {\n 'ndl-combobox-option-action': isAction,\n 'ndl-combobox-option-create': isCreate,\n 'ndl-disabled': isDisabled,\n 'ndl-focused': isFocused,\n });\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/interactive-supports-focus -- options are never DOM focused; keyboard is handled on the search input or the listbox and exposed through aria-activedescendant\n <div\n id={id}\n role=\"option\"\n // Left off an action row, since it is not something that can be selected.\n aria-selected={isSelected}\n aria-disabled={isDisabled}\n aria-posinset={posInSet}\n aria-setsize={setSize}\n className={classes}\n onClick={onClick}\n // Options are not focusable, so a plain mousedown would blur whatever\n // holds DOM focus - the search input or the trigger - and drop the panel.\n onMouseDown={(event) => event.preventDefault()}\n // mouseover fires when the element under a stationary cursor changes\n // because the list scrolled, which would let a rested mouse steal virtual\n // focus back during keyboard navigation. mousemove needs real movement.\n onMouseMove={onHover}\n >\n {children}\n </div>\n );\n};\n\nconst OptionContent = ({\n label,\n customLabel,\n description,\n leadingVisual,\n isDisabled,\n isSelected,\n isMulti,\n}: ComboboxOptionContentProps) => {\n return (\n <div className=\"ndl-combobox-option-content\">\n {isMulti ? (\n <MultiSelectIndicator isDisabled={isDisabled} isSelected={isSelected} />\n ) : (\n leadingVisual && (\n <LeadingVisual isDisabled={isDisabled}>{leadingVisual}</LeadingVisual>\n )\n )}\n <div className=\"ndl-combobox-option-content-main\">\n {customLabel ?? <Label isDisabled={isDisabled}>{label}</Label>}\n {description && (\n <Description isDisabled={isDisabled}>{description}</Description>\n )}\n </div>\n {!isMulti && isSelected && <SelectionIndicator isDisabled={isDisabled} />}\n </div>\n );\n};\n\ntype OptionContentPartProps = {\n children?: React.ReactNode;\n isDisabled?: boolean;\n};\n\nconst CreateOptionContent = ({ children }: OptionContentPartProps) => {\n return (\n <div className=\"ndl-combobox-option-content\">\n <LeadingVisual>\n <PlusIconOutline />\n </LeadingVisual>\n <div className=\"ndl-combobox-option-content-main\">\n <Label>{children}</Label>\n </div>\n </div>\n );\n};\n\nconst LeadingVisual = ({ children, isDisabled }: OptionContentPartProps) => {\n const classes = classNames('ndl-combobox-option-content-leading-visual', {\n 'ndl-disabled': isDisabled,\n });\n\n return <div className={classes}>{children}</div>;\n};\n\nconst Label = ({ children, isDisabled }: OptionContentPartProps) => {\n const classes = classNames('ndl-combobox-option-content-label', {\n 'ndl-disabled': isDisabled,\n });\n\n return (\n <Typography variant=\"body-medium\" className={classes}>\n {children}\n </Typography>\n );\n};\n\nconst Description = ({ children, isDisabled }: OptionContentPartProps) => {\n const classes = classNames('ndl-combobox-option-content-description', {\n 'ndl-disabled': isDisabled,\n });\n\n return (\n <Typography variant=\"body-small\" className={classes}>\n {children}\n </Typography>\n );\n};\n\nconst SelectionIndicator = ({\n isDisabled,\n}: Pick<OptionContentPartProps, 'isDisabled'>) => {\n const classes = classNames(\n 'ndl-combobox-option-content-selection-indicator',\n {\n 'ndl-disabled': isDisabled,\n },\n );\n\n return <CheckIconOutline className={classes} />;\n};\n\ntype MultiSelectIndicatorProps = {\n isDisabled?: boolean;\n isSelected?: boolean;\n};\n\n/**\n * The option itself owns selection through `aria-selected` and its click\n * handler, so the checkbox is decorative. `inert` keeps it out of the\n * accessibility tree and out of hit testing - without it the wrapping label\n * forwards a second click to the input, which bubbles back to the option and\n * undoes the toggle.\n */\nconst MultiSelectIndicator = ({\n isDisabled,\n isSelected,\n}: MultiSelectIndicatorProps) => {\n return (\n <span className=\"ndl-combobox-option-content-multi-select-indicator\" inert>\n <Checkbox\n ariaLabel=\"Select\"\n isChecked={isSelected}\n isDisabled={isDisabled}\n />\n </span>\n );\n};\n\ntype ComboboxGroupHeaderProps = {\n label: string;\n /** Names the surrounding `role=\"group\"` when nested; absent when windowed. */\n id?: string;\n /** The windowed listbox keeps its headers out of the accessibility tree. */\n isPresentational?: boolean;\n};\n\n/**\n * The visible group header text, shared by both listbox paths: nested inside a\n * `role=\"group\"` wrapper below the row threshold, or as a presentational row of\n * its own while windowed.\n */\nconst GroupHeader = ({\n label,\n id,\n isPresentational,\n}: ComboboxGroupHeaderProps) => {\n return (\n <div\n id={id}\n role={isPresentational === true ? 'presentation' : undefined}\n className=\"ndl-combobox-group-header\"\n >\n {label}\n </div>\n );\n};\n\nconst Group = ({ children, label }: ComboboxGroupProps) => {\n const headerId = useId();\n\n return (\n <div role=\"group\" aria-labelledby={headerId} className=\"ndl-combobox-group\">\n <GroupHeader id={headerId} label={label} />\n {children}\n </div>\n );\n};\n\nconst EmptyState = ({ children }: ComboboxEmptyStateProps) => {\n return (\n <Typography\n variant=\"body-medium\"\n className=\"ndl-combobox-empty-state\"\n htmlAttributes={{ role: 'status' }}\n >\n {children ?? 'No results found'}\n </Typography>\n );\n};\n\nconst LoadingState = ({ children }: ComboboxEmptyStateProps) => {\n return (\n <div\n role=\"status\"\n className=\"ndl-combobox-empty-state ndl-combobox-loading-state\"\n >\n <LoadingSpinner size=\"small\" htmlAttributes={{ 'aria-hidden': true }} />\n <Typography variant=\"body-medium\">\n {children ?? DEFAULT_LOADING_MESSAGE}\n </Typography>\n </div>\n );\n};\n"]}
@@ -0,0 +1,22 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export {};
22
+ //# sourceMappingURL=combobox-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-types.js","sourceRoot":"","sources":["../../../src/combobox/combobox-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\ntype ComboboxOption = {\n label: string;\n value: string;\n /** If the option is disabled */\n isDisabled?: boolean;\n /** A visual element to display before the label. Incompatible with multi select. */\n leadingVisual?: React.ReactNode;\n /** A description to display below the label. */\n description?: string;\n};\n\ntype ComboboxOptionGroup<TOption extends ComboboxOption = ComboboxOption> = {\n label: string;\n options: TOption[];\n};\n\ntype ComboboxFilterOption<TOption extends ComboboxOption = ComboboxOption> =\n | ((option: TOption, searchValue: string) => boolean)\n | false;\n\ntype ComboboxSize = 'small' | 'medium' | 'large';\n\n/**\n * A row at the end of the panel that acts instead of selecting.\n *\n * @remarks\n * Deliberately not a `ComboboxOption`, since an action never becomes part of\n * the value. Use it for something that leads out of the selection, such as a\n * link into a create flow.\n */\ntype ComboboxAction = {\n /** Text of the row. */\n label: string;\n /**\n * Called when the row is activated, with the current search value so the\n * action can carry the query with it. The selection is left untouched.\n */\n onSelect: (context: { searchValue: string }) => void;\n /** A description to display below the label. */\n description?: string;\n /** A visual element to display before the label. */\n leadingVisual?: React.ReactNode;\n /** If the action is disabled. */\n isDisabled?: boolean;\n /**\n * Whether a divider is rendered above the action, separating it from the\n * action before it. Ignored on the first action, which already sits below\n * the divider that separates actions from options.\n */\n hasDivider?: boolean;\n};\n\ntype ComboboxBaseProps<TOption extends ComboboxOption = ComboboxOption> = {\n /** Accessible label for the combobox. Rendered above the control. */\n label: string;\n /**\n * Name used to submit the selected option value through a native form.\n * Above 300 options, only the selection is mirrored to the form, so browser\n * autofill no longer offers the option list.\n */\n name?: string;\n /** Id of the form the combobox belongs to when it is outside that form. */\n formId?: string;\n /** Hint for browser autofill on the native form control. */\n autoComplete?: string;\n /** Ref to the focusable combobox trigger. */\n triggerRef?: React.Ref<HTMLElement>;\n /** Whether the label is clipped out of the layout, leaving it to screen readers only. */\n hasVisuallyHiddenLabel?: boolean;\n /** Assistive text below the control. Replaced by `errorText` while there is an error. */\n helpText?: React.ReactNode;\n /** Error message below the control. Puts the control in its error state. */\n errorText?: React.ReactNode;\n /**\n * Whether a selection is required. Sets `aria-required` and, when `name` is\n * provided, enables native form validation.\n */\n isRequired?: boolean;\n /** Whether Required or Optional is shown at the end of the label row. */\n hasRequiredIndicator?: boolean;\n /** The options to display in the combobox. Either an array of options or an array of option groups. */\n options: TOption[] | ComboboxOptionGroup<TOption>[];\n /**\n * Whether a search input is rendered inside the panel. On by default; turn\n * it off for a short list (roughly 10 options or fewer) where filtering\n * adds nothing.\n */\n isSearchable?: boolean;\n /** The search value in controlled mode. */\n searchValue?: string;\n /** The initial search value in uncontrolled mode. */\n defaultSearchValue?: string;\n /** Called when the search value changes. */\n onSearchChange?: (searchValue: string) => void;\n /**\n * How options are matched against the search value. Defaults to a\n * case-insensitive match on the option label. Pass `false` to skip internal\n * filtering when the options are already filtered, such as when searching\n * server side.\n */\n filterOption?: ComboboxFilterOption<TOption>;\n /** Placeholder for the search input, which also names it. */\n searchPlaceholder?: string;\n /**\n * Whether the panel is waiting for options. Replaces the empty message while\n * there are no options.\n */\n isLoading?: boolean;\n /** Text of the loading status. Defaults to `Loading...`. */\n loadingMessage?: React.ReactNode;\n /**\n * Whether the search value can be turned into a new option, shown as an extra\n * row at the end of the list. Requires `isSearchable`.\n */\n isCreatable?: boolean;\n /**\n * Called after a created option has been selected, so it can be persisted\n * into `options`. Created options are not added to `options` by the combobox.\n */\n onCreateOption?: (option: TOption) => void;\n /**\n * Builds the option to create from the search value. Defaults to using the\n * search value as both label and value, which is only enough when the options\n * carry no fields of their own beyond `ComboboxOption`.\n */\n createOption?: (searchValue: string) => TOption;\n /** Text of the create row. Defaults to `Create \"<search value>\"`. */\n formatCreateLabel?: (searchValue: string) => React.ReactNode;\n /**\n * Whether the search value can become a new option. Defaults to requiring a\n * non-blank value that does not exactly match an existing option or a\n * currently selected one.\n */\n isValidNewOption?: (searchValue: string, options: TOption[]) => boolean;\n /**\n * Rows that act instead of selecting, pinned below the scrolling options\n * after a divider so they stay visible however long the list is. They are\n * always shown, never filtered by the search value, and never part of the\n * selection.\n */\n actions?: ComboboxAction[];\n /** Whether the panel is controlled open. */\n isOpen?: boolean;\n /** Called when the panel opens or closes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** Whether a button for clearing the selection is rendered in the trigger. */\n isClearable?: boolean;\n /** Text shown in the trigger while nothing is selected. */\n placeholder?: string;\n /** Whether the combobox is disabled. */\n isDisabled?: boolean;\n /** Size of the combobox control. */\n size?: ComboboxSize;\n /** Whether the combobox fills the available width. */\n isFluid?: boolean;\n /** Whether the control hugs its content without a background or resting outline. */\n isClean?: boolean;\n /** Whether the panel is wrapped in a floating portal. Defaults to true outside a dialog. */\n isPortaled?: boolean;\n /** Portal target element. Defaults to `document.body`. */\n portalTarget?: HTMLElement | null;\n /** Positioning strategy used by Floating UI. */\n floatingStrategy?: 'absolute' | 'fixed';\n /**\n * Replaces the built-in trigger. Spread `triggerProps` onto the focusable\n * element that should open the panel; the panel is anchored to it. The root\n * element then lays out as `display: contents`, so the trigger is placed by\n * whatever contains the combobox, and `isFluid`, `isClean`, `size`,\n * `className` and `style` no longer shape it.\n */\n renderTrigger?: (\n triggerProps: ComboboxTriggerProps,\n state: ComboboxTriggerState<TOption>,\n ) => React.ReactNode;\n /**\n * Replaces how selected values and option labels are presented, keeping the\n * behavior and the ARIA of the combobox.\n */\n components?: ComboboxComponents<TOption>;\n};\n\n/**\n * Presentation overrides for the parts of the combobox that show an option.\n *\n * @remarks\n * Each override is handed the option itself, so widening the option type is\n * what gives them typed access to fields of your own, such as a color. Only\n * presentation is replaced; selection, filtering, keyboard interaction and the\n * ARIA of the surrounding elements stay with the combobox. Use `renderTrigger`\n * instead to replace the control as a whole.\n */\ntype ComboboxComponents<TOption extends ComboboxOption = ComboboxOption> = {\n /** Replaces the tag rendered per selected option in multi select. */\n MultiValue?: React.ComponentType<ComboboxMultiValueProps<TOption>>;\n /** Replaces the value shown in the trigger in single select. Must be non-interactive. */\n SingleValue?: React.ComponentType<ComboboxSingleValueProps<TOption>>;\n /** Replaces the label of an option. The selection and description chrome stays. */\n OptionLabel?: React.ComponentType<ComboboxOptionLabelProps<TOption>>;\n};\n\n/** Props of a `MultiValue` override, rendered once per selected option. */\ntype ComboboxMultiValueProps<TOption extends ComboboxOption = ComboboxOption> =\n {\n option: TOption;\n /** Position of the option in the selection. */\n index: number;\n isDisabled: boolean;\n size: ComboboxSize;\n /**\n * Deselects this option. Nothing calls it unless the override renders an\n * affordance for it, which also makes focus after the removal its own\n * responsibility.\n */\n remove: () => void;\n };\n\n/** Props of a `SingleValue` override, rendered inside the trigger. */\ntype ComboboxSingleValueProps<TOption extends ComboboxOption = ComboboxOption> =\n {\n option: TOption;\n isDisabled: boolean;\n size: ComboboxSize;\n };\n\n/** Props of an `OptionLabel` override, rendered inside each option. */\ntype ComboboxOptionLabelProps<TOption extends ComboboxOption = ComboboxOption> =\n {\n option: TOption;\n isSelected: boolean;\n isDisabled: boolean;\n /** Whether the option currently holds virtual focus. */\n isFocused: boolean;\n isMulti: boolean;\n size: ComboboxSize;\n };\n\n/**\n * Props that must be spread onto a custom trigger element. Includes the\n * Floating UI reference props, so the element it lands on becomes the anchor\n * the panel is positioned against.\n */\ntype ComboboxTriggerProps = React.HTMLAttributes<HTMLElement> & {\n ref: React.Ref<HTMLElement>;\n role: 'combobox';\n 'aria-haspopup': 'dialog' | 'listbox';\n // These are DOM attribute names, so the boolean naming convention cannot apply.\n /* eslint-disable @typescript-eslint/naming-convention */\n 'aria-expanded': boolean;\n 'aria-disabled': boolean | undefined;\n 'aria-invalid': boolean | undefined;\n 'aria-required': boolean | undefined;\n /* eslint-enable @typescript-eslint/naming-convention */\n 'aria-controls': string | undefined;\n 'aria-activedescendant': string | undefined;\n 'aria-describedby': string | undefined;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n};\n\n/**\n * The label, help text, and error text of the combobox, for rendering them from\n * a custom trigger.\n *\n * @remarks\n * A custom trigger is named through `aria-label` and carries the\n * `aria-describedby` of whichever message is currently shown, so it has to\n * render that message with the id it is handed here.\n */\ntype ComboboxFieldState = {\n label: string;\n hasVisuallyHiddenLabel: boolean;\n helpText?: React.ReactNode;\n errorText?: React.ReactNode;\n hasError: boolean;\n isRequired: boolean;\n hasRequiredIndicator: boolean;\n /** Id the trigger's `aria-labelledby` points at when the label is rendered. */\n labelId: string;\n /** Id of the trigger, so a rendered `<label>` can point at it with `htmlFor`. */\n triggerId: string;\n /** Ids the trigger's `aria-describedby` points at. Only one is used at a time. */\n helpTextId: string;\n errorTextId: string;\n};\n\n/** Current combobox state, for rendering a custom trigger. */\ntype ComboboxTriggerState<TOption extends ComboboxOption = ComboboxOption> = {\n isOpen: boolean;\n isMulti: boolean;\n isDisabled: boolean;\n /** The selected options, as a list in both single and multi select. */\n selectedOptions: TOption[];\n /** Clears the whole selection. */\n clear: () => void;\n /** Deselects a single option. */\n remove: (option: TOption) => void;\n /** The label and messages of the combobox, so a custom trigger can present them. */\n field: ComboboxFieldState;\n};\n\ntype ComboboxSingleProps<TOption extends ComboboxOption = ComboboxOption> = {\n /** The selected option in controlled mode. */\n value?: TOption | null;\n /** The initially selected option in uncontrolled mode. */\n defaultValue?: TOption | null;\n /** Called when the selected option changes. `null` when the selection is cleared. */\n onChange?: (value: TOption | null) => void;\n /** Whether multiple options can be selected. */\n isMulti?: false;\n maxRows?: never;\n};\n\ntype ComboboxMultiProps<TOption extends ComboboxOption = ComboboxOption> = {\n /** The selected options in controlled mode. */\n value?: TOption[];\n /** The initially selected options in uncontrolled mode. */\n defaultValue?: TOption[];\n /** Called when the selected options change. */\n onChange?: (value: TOption[]) => void;\n /** Whether multiple options can be selected. */\n isMulti: true;\n /**\n * Maximum number of rows the selected tags may wrap into, a single row by\n * default. Tags that do not fit are collapsed into a read-only counter tag,\n * such as `+4`, at the end of the last row. Pass `null` to let the control\n * grow with the selection.\n */\n maxRows?: number | null;\n};\n\ntype ComboboxProps<TOption extends ComboboxOption = ComboboxOption> =\n ComboboxBaseProps<TOption> &\n (ComboboxSingleProps<TOption> | ComboboxMultiProps<TOption>);\n\ntype ComboboxPanelProps = {\n children?: React.ReactNode;\n ref?: React.Ref<HTMLDivElement>;\n id?: string;\n className?: string;\n style?: React.CSSProperties;\n /**\n * Set when the panel is a dialog popup, which is the case while the search\n * input inside it holds DOM focus.\n */\n ariaLabel?: string;\n isDialog?: boolean;\n} & Record<string, unknown>;\n\ntype ComboboxControlProps<TOption extends ComboboxOption = ComboboxOption> = {\n triggerProps: ComboboxTriggerProps;\n state: ComboboxTriggerState<TOption>;\n field: ComboboxFieldState;\n placeholder: string;\n isClearable: boolean;\n isClean: boolean;\n size: ComboboxSize;\n /** Maximum number of rows the selected tags may wrap into in multi select. `null` is unlimited. */\n maxRows?: number | null;\n components: ComboboxComponents<TOption>;\n /** Floating UI reference props, so clicking anywhere in the control opens the panel. */\n referenceProps: React.HTMLAttributes<HTMLDivElement>;\n referenceRef: React.Ref<HTMLDivElement>;\n};\n\ntype ComboboxEmptyStateProps = {\n children?: React.ReactNode;\n};\n\ntype ComboboxInputProps = {\n ref?: React.Ref<HTMLInputElement>;\n ariaLabel: string;\n value: string;\n onValueChange: (searchValue: string) => void;\n placeholder?: string;\n /** Id of the listbox the input controls, when the listbox is rendered. */\n listboxId?: string;\n /** Id of the virtually focused option, when one is active. */\n activeOptionId?: string;\n onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n};\n\ntype ComboboxListBoxProps = {\n ariaLabel: string;\n children?: React.ReactNode;\n isMulti?: boolean;\n id?: string;\n /** Ids of the pinned action rows the listbox owns without containing. */\n ownsIds?: string;\n};\n\ntype ComboboxGroupProps = {\n children?: React.ReactNode;\n label: string;\n};\n\ntype ComboboxOptionProps = {\n children?: React.ReactNode;\n /** Left out on rows that cannot be selected, which drops `aria-selected`. */\n isSelected?: boolean;\n isDisabled?: boolean;\n isFocused?: boolean;\n /** Whether the option is the row that creates a new option from the search value. */\n isCreate?: boolean;\n /** Whether the option is an action row, which acts instead of selecting. */\n isAction?: boolean;\n id?: string;\n onClick?: () => void;\n /** Called when the pointer moves over the option, so hover can drive virtual focus. */\n onHover?: () => void;\n /**\n * One-based position in the full list. Only set while the listbox is\n * virtualized, where the DOM no longer holds every option.\n */\n posInSet?: number;\n /** Total options in the full list. Only set while the listbox is virtualized. */\n setSize?: number;\n};\n\ntype ComboboxOptionContentProps = {\n label: string;\n /**\n * Replaces the label text. Rendered in place of the label typography rather\n * than inside it, so it can be any element rather than inline text.\n */\n customLabel?: React.ReactNode;\n description?: string;\n leadingVisual?: React.ReactNode;\n isDisabled?: boolean;\n isSelected?: boolean;\n isMulti?: boolean;\n};\n\nexport type {\n ComboboxProps,\n ComboboxAction,\n ComboboxComponents,\n ComboboxControlProps,\n ComboboxFieldState,\n ComboboxMultiValueProps,\n ComboboxOptionLabelProps,\n ComboboxSingleValueProps,\n ComboboxTriggerProps,\n ComboboxTriggerState,\n ComboboxPanelProps,\n ComboboxEmptyStateProps,\n ComboboxFilterOption,\n ComboboxInputProps,\n ComboboxListBoxProps,\n ComboboxGroupProps,\n ComboboxOptionProps,\n ComboboxOptionContentProps,\n ComboboxOption,\n ComboboxOptionGroup,\n ComboboxSize,\n};\n"]}
@@ -0,0 +1,112 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ const isOptionGroup = (item) => 'options' in item;
22
+ const matchesLabel = (option, searchValue) => option.label.toLowerCase().includes(searchValue.toLowerCase());
23
+ /**
24
+ * Filters options against the search value, keeping the grouped or flat shape
25
+ * of the input. Groups that end up without matches are dropped.
26
+ */
27
+ const filterComboboxOptions = (options, searchValue, filterOption) => {
28
+ if (filterOption === false || searchValue.trim() === '') {
29
+ return options;
30
+ }
31
+ const matches = filterOption !== null && filterOption !== void 0 ? filterOption : matchesLabel;
32
+ if (options.every(isOptionGroup)) {
33
+ return options
34
+ .map((group) => (Object.assign(Object.assign({}, group), { options: group.options.filter((option) => matches(option, searchValue)) })))
35
+ .filter((group) => group.options.length > 0);
36
+ }
37
+ return options.filter((option) => matches(option, searchValue));
38
+ };
39
+ /** Flattens grouped options into the visual order used for option ids. */
40
+ const flattenComboboxOptions = (options) => options.flatMap((item) => (isOptionGroup(item) ? item.options : item));
41
+ // A symbol keeps the marker out of consumer data and out of anything that walks
42
+ // option keys, so the create row travels through the list as a normal option.
43
+ const CREATE_MARKER = Symbol('ndlComboboxCreateOption');
44
+ const isCreateOption = (option) => CREATE_MARKER in option;
45
+ /** Tags an option as the create row, so activating it creates instead of selects. */
46
+ const asCreateOption = (option) => (Object.assign(Object.assign({}, option), { [CREATE_MARKER]: true }));
47
+ /**
48
+ * The default way to build the option to create. It can only fill in the fields
49
+ * of `ComboboxOption`, so an option type with more required fields of its own
50
+ * has to supply `createOption`.
51
+ */
52
+ const buildCreateOption = (searchValue) => ({
53
+ label: searchValue,
54
+ value: searchValue,
55
+ });
56
+ const formatCreateOptionLabel = (searchValue) => `Create "${searchValue}"`;
57
+ // Actions travel through the list as rows, which is what gives them virtual
58
+ // focus, an option id and keyboard activation. They cannot be options, since an
59
+ // option type with fields of its own is the consumer's to build, so they are
60
+ // their own row shape marked the same way as the create row.
61
+ const ACTION_MARKER = Symbol('ndlComboboxAction');
62
+ const isActionRow = (row) => ACTION_MARKER in row;
63
+ /**
64
+ * Wraps an action as a list row. The position in `actions` gives the row a
65
+ * stable value, which keeps the active row from being reset every render.
66
+ */
67
+ const asActionRow = (action, index) => ({
68
+ isDisabled: action.isDisabled,
69
+ label: action.label,
70
+ value: `ndl-combobox-action-${index}`,
71
+ [ACTION_MARKER]: action,
72
+ });
73
+ const getAction = (row) => row[ACTION_MARKER];
74
+ const matchesExactly = (option, searchValue) => {
75
+ const normalized = searchValue.trim().toLowerCase();
76
+ return (option.label.toLowerCase() === normalized ||
77
+ option.value.toLowerCase() === normalized);
78
+ };
79
+ /**
80
+ * A created option is never added to `options`, so the current selection is
81
+ * checked too. Without that, retyping a created value would offer to create it
82
+ * again and toggle the existing selection back off in multi select.
83
+ */
84
+ const isValidNewComboboxOption = (searchValue, options) => searchValue.trim() !== '' &&
85
+ !options.some((option) => matchesExactly(option, searchValue));
86
+ /**
87
+ * Disabled options are deliberately included in keyboard navigation, following
88
+ * the APG guidance on the focusability of disabled controls: skipping them
89
+ * would make them undiscoverable to screen reader users. Activation is what
90
+ * ignores them instead.
91
+ */
92
+ const getFirstOptionIndex = (options) => options.length > 0 ? 0 : -1;
93
+ const getLastOptionIndex = (options) => options.length - 1;
94
+ /**
95
+ * Steps one option in the given direction, clamping at the ends of the list
96
+ * as the combobox pattern permits.
97
+ */
98
+ const getNextOptionIndex = (options, fromIndex, direction) => Math.min(Math.max(fromIndex + direction, 0), options.length - 1);
99
+ const getInitialValue = (value, defaultValue, isMulti) => {
100
+ if (value !== undefined) {
101
+ return value;
102
+ }
103
+ if (defaultValue !== undefined) {
104
+ return defaultValue;
105
+ }
106
+ if (isMulti) {
107
+ return [];
108
+ }
109
+ return null;
110
+ };
111
+ export { asActionRow, asCreateOption, buildCreateOption, filterComboboxOptions, flattenComboboxOptions, formatCreateOptionLabel, getAction, getFirstOptionIndex, getLastOptionIndex, getNextOptionIndex, isActionRow, isCreateOption, isOptionGroup, isValidNewComboboxOption, getInitialValue, };
112
+ //# sourceMappingURL=combobox-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-utils.js","sourceRoot":"","sources":["../../../src/combobox/combobox-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAaH,MAAM,aAAa,GAAG,CACpB,IAA4C,EACN,EAAE,CAAC,SAAS,IAAI,IAAI,CAAC;AAE7D,MAAM,YAAY,GAAG,CAAC,MAAsB,EAAE,WAAmB,EAAE,EAAE,CACnE,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;AAEjE;;;GAGG;AACH,MAAM,qBAAqB,GAAG,CAC5B,OAAiC,EACjC,WAAmB,EACnB,YAA4C,EAClB,EAAE;IAC5B,IAAI,YAAY,KAAK,KAAK,IAAI,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACxD,OAAO,OA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M,mBAAmB,GAAG,CAAC,OAAyB,EAAE,EAAE,CACxD,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9B,MAAM,kBAAkB,GAAG,CAAC,OAAyB,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;AAE7E;;;GAGG;AACH,MAAM,kBAAkB,GAAG,CACzB,OAAyB,EACzB,SAAiB,EACjB,SAAiB,EACjB,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,SAAS,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAItE,MAAM,eAAe,GAAG,CACtB,KAAyC,EACzC,YAAgD,EAChD,OAAgB,EACQ,EAAE;IAC1B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,OAAO,EACL,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,aAAa,EACb,wBAAwB,EACxB,eAAe,GAChB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport {\n type ComboboxAction,\n type ComboboxFilterOption,\n type ComboboxOption,\n type ComboboxOptionGroup,\n} from './combobox-types';\n\ntype ComboboxOptions<TOption extends ComboboxOption> =\n | TOption[]\n | ComboboxOptionGroup<TOption>[];\n\nconst isOptionGroup = <TOption extends ComboboxOption>(\n item: TOption | ComboboxOptionGroup<TOption>,\n): item is ComboboxOptionGroup<TOption> => 'options' in item;\n\nconst matchesLabel = (option: ComboboxOption, searchValue: string) =>\n option.label.toLowerCase().includes(searchValue.toLowerCase());\n\n/**\n * Filters options against the search value, keeping the grouped or flat shape\n * of the input. Groups that end up without matches are dropped.\n */\nconst filterComboboxOptions = <TOption extends ComboboxOption>(\n options: ComboboxOptions<TOption>,\n searchValue: string,\n filterOption?: ComboboxFilterOption<TOption>,\n): ComboboxOptions<TOption> => {\n if (filterOption === false || searchValue.trim() === '') {\n return options;\n }\n\n const matches = filterOption ?? matchesLabel;\n\n if (options.every(isOptionGroup)) {\n return options\n .map((group) => ({\n ...group,\n options: group.options.filter((option) => matches(option, searchValue)),\n }))\n .filter((group) => group.options.length > 0);\n }\n\n return (options as TOption[]).filter((option) =>\n matches(option, searchValue),\n );\n};\n\n/** Flattens grouped options into the visual order used for option ids. */\nconst flattenComboboxOptions = <TOption extends ComboboxOption>(\n options: (TOption | ComboboxOptionGroup<TOption>)[],\n): TOption[] =>\n options.flatMap((item) => (isOptionGroup(item) ? item.options : item));\n\n// A symbol keeps the marker out of consumer data and out of anything that walks\n// option keys, so the create row travels through the list as a normal option.\nconst CREATE_MARKER = Symbol('ndlComboboxCreateOption');\n\ntype ComboboxCreateOption<TOption extends ComboboxOption> = TOption & {\n readonly [CREATE_MARKER]: true;\n};\n\nconst isCreateOption = <TOption extends ComboboxOption>(\n option: TOption,\n): option is ComboboxCreateOption<TOption> => CREATE_MARKER in option;\n\n/** Tags an option as the create row, so activating it creates instead of selects. */\nconst asCreateOption = <TOption extends ComboboxOption>(\n option: TOption,\n): ComboboxCreateOption<TOption> => ({\n ...option,\n [CREATE_MARKER]: true,\n});\n\n/**\n * The default way to build the option to create. It can only fill in the fields\n * of `ComboboxOption`, so an option type with more required fields of its own\n * has to supply `createOption`.\n */\nconst buildCreateOption = <TOption extends ComboboxOption>(\n searchValue: string,\n): TOption =>\n ({\n label: searchValue,\n value: searchValue,\n }) as TOption;\n\nconst formatCreateOptionLabel = (searchValue: string) =>\n `Create \"${searchValue}\"`;\n\n// Actions travel through the list as rows, which is what gives them virtual\n// focus, an option id and keyboard activation. They cannot be options, since an\n// option type with fields of its own is the consumer's to build, so they are\n// their own row shape marked the same way as the create row.\nconst ACTION_MARKER = Symbol('ndlComboboxAction');\n\ntype ComboboxActionRow = ComboboxOption & {\n readonly [ACTION_MARKER]: ComboboxAction;\n};\n\n/** A row of the rendered list, which is either an option or an action. */\ntype ComboboxRow<TOption extends ComboboxOption> = TOption | ComboboxActionRow;\n\nconst isActionRow = <TOption extends ComboboxOption>(\n row: ComboboxRow<TOption>,\n): row is ComboboxActionRow => ACTION_MARKER in row;\n\n/**\n * Wraps an action as a list row. The position in `actions` gives the row a\n * stable value, which keeps the active row from being reset every render.\n */\nconst asActionRow = (\n action: ComboboxAction,\n index: number,\n): ComboboxActionRow => ({\n isDisabled: action.isDisabled,\n label: action.label,\n value: `ndl-combobox-action-${index}`,\n [ACTION_MARKER]: action,\n});\n\nconst getAction = (row: ComboboxActionRow) => row[ACTION_MARKER];\n\nconst matchesExactly = (option: ComboboxOption, searchValue: string) => {\n const normalized = searchValue.trim().toLowerCase();\n\n return (\n option.label.toLowerCase() === normalized ||\n option.value.toLowerCase() === normalized\n );\n};\n\n/**\n * A created option is never added to `options`, so the current selection is\n * checked too. Without that, retyping a created value would offer to create it\n * again and toggle the existing selection back off in multi select.\n */\nconst isValidNewComboboxOption = (\n searchValue: string,\n options: ComboboxOption[],\n) =>\n searchValue.trim() !== '' &&\n !options.some((option) => matchesExactly(option, searchValue));\n\n/**\n * Disabled options are deliberately included in keyboard navigation, following\n * the APG guidance on the focusability of disabled controls: skipping them\n * would make them undiscoverable to screen reader users. Activation is what\n * ignores them instead.\n */\nconst getFirstOptionIndex = (options: ComboboxOption[]) =>\n options.length > 0 ? 0 : -1;\n\nconst getLastOptionIndex = (options: ComboboxOption[]) => options.length - 1;\n\n/**\n * Steps one option in the given direction, clamping at the ends of the list\n * as the combobox pattern permits.\n */\nconst getNextOptionIndex = (\n options: ComboboxOption[],\n fromIndex: number,\n direction: 1 | -1,\n) => Math.min(Math.max(fromIndex + direction, 0), options.length - 1);\n\ntype ComboboxValue<TOption extends ComboboxOption> = TOption | TOption[] | null;\n\nconst getInitialValue = <TOption extends ComboboxOption>(\n value: ComboboxValue<TOption> | undefined,\n defaultValue: ComboboxValue<TOption> | undefined,\n isMulti: boolean,\n): ComboboxValue<TOption> => {\n if (value !== undefined) {\n return value;\n }\n\n if (defaultValue !== undefined) {\n return defaultValue;\n }\n\n if (isMulti) {\n return [];\n }\n\n return null;\n};\n\nexport {\n asActionRow,\n asCreateOption,\n buildCreateOption,\n filterComboboxOptions,\n flattenComboboxOptions,\n formatCreateOptionLabel,\n getAction,\n getFirstOptionIndex,\n getLastOptionIndex,\n getNextOptionIndex,\n isActionRow,\n isCreateOption,\n isOptionGroup,\n isValidNewComboboxOption,\n getInitialValue,\n};\nexport type { ComboboxActionRow, ComboboxRow, ComboboxValue };\n"]}
@@ -0,0 +1,22 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export { Combobox } from './Combobox';
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/combobox/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { Combobox } from './Combobox';\nexport type {\n ComboboxAction,\n ComboboxComponents,\n ComboboxMultiValueProps,\n ComboboxOption,\n ComboboxOptionGroup,\n ComboboxOptionLabelProps,\n ComboboxSingleValueProps,\n ComboboxSize,\n ComboboxTriggerProps,\n ComboboxTriggerState,\n} from './combobox-types';\n"]}
@@ -0,0 +1,80 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ /**
14
+ *
15
+ * Copyright (c) "Neo4j"
16
+ * Neo4j Sweden AB [http://neo4j.com]
17
+ *
18
+ * This file is part of Neo4j.
19
+ *
20
+ * Neo4j is free software: you can redistribute it and/or modify
21
+ * it under the terms of the GNU General Public License as published by
22
+ * the Free Software Foundation, either version 3 of the License, or
23
+ * (at your option) any later version.
24
+ *
25
+ * This program is distributed in the hope that it will be useful,
26
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
+ * GNU General Public License for more details.
29
+ *
30
+ * You should have received a copy of the GNU General Public License
31
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
32
+ */
33
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
34
+ import { Combobox, IconButton, TextArea } from '@neo4j-ndl/react';
35
+ import { CommandLineIconOutline } from '@neo4j-ndl/react/icons';
36
+ import { useRef, useState } from 'react';
37
+ const commands = [
38
+ {
39
+ description: 'Return a small sample of nodes',
40
+ label: 'Match nodes',
41
+ value: 'MATCH (n) RETURN n LIMIT 25',
42
+ },
43
+ {
44
+ description: 'Show the labels and relationships in the database',
45
+ label: 'Visualize schema',
46
+ value: 'CALL db.schema.visualization()',
47
+ },
48
+ {
49
+ description: 'List the indexes available to the current user',
50
+ label: 'Show indexes',
51
+ value: 'SHOW INDEXES',
52
+ },
53
+ ];
54
+ const Component = () => {
55
+ const [terminalValue, setTerminalValue] = useState('');
56
+ const [searchValue, setSearchValue] = useState('');
57
+ const textAreaRef = useRef(null);
58
+ return (_jsxs("div", { className: "n-flex n-gap-token-2 n-items-center", children: [_jsx(TextArea, { ref: textAreaRef, label: "Command input", value: terminalValue, htmlAttributes: {
59
+ onChange: (event) => setTerminalValue(event.target.value),
60
+ rows: 5,
61
+ }, helpText: "Use the button below to search for a command." }), _jsx(Combobox, { label: "Insert command", options: commands, searchPlaceholder: "Search commands", searchValue: searchValue, onSearchChange: setSearchValue,
62
+ // The picker activates an option but never keeps it as its value.
63
+ // Keeping the controlled value empty avoids a persistent selected state.
64
+ value: null, onChange: (command) => {
65
+ var _a;
66
+ if (command === null) {
67
+ return;
68
+ }
69
+ setTerminalValue((currentValue) => currentValue === ''
70
+ ? command.value
71
+ : `${currentValue}\n${command.value}`);
72
+ setSearchValue('');
73
+ (_a = textAreaRef.current) === null || _a === void 0 ? void 0 : _a.focus();
74
+ }, renderTrigger: (_a) => {
75
+ var { ref } = _a, triggerProps = __rest(_a, ["ref"]);
76
+ return (_jsx(IconButton, { ref: ref, description: "Insert command", htmlAttributes: triggerProps, children: _jsx(CommandLineIconOutline, {}) }));
77
+ } })] }));
78
+ };
79
+ export default Component;
80
+ //# sourceMappingURL=combobox-action-on-select.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-action-on-select.story.js","sourceRoot":"","sources":["../../../../src/combobox/stories/combobox-action-on-select.story.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,MAAM,QAAQ,GAAG;IACf;QACE,WAAW,EAAE,gCAAgC;QAC7C,KAAK,EAAE,aAAa;QACpB,KAAK,EAAE,6BAA6B;KACrC;IACD;QACE,WAAW,EAAE,mDAAmD;QAChE,KAAK,EAAE,kBAAkB;QACzB,KAAK,EAAE,gCAAgC;KACxC;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KAAK,EAAE,CAAC;gBAC/B,CAAC,EACD,aAAa,EAAE,CAAC,EAAwB,EAAE,EAAE;wBAA5B,EAAE,GAAG,OAAmB,EAAd,YAAY,cAAtB,OAAwB,CAAF;oBAAO,OAAA,CAC3C,KAAC,UAAU,IACT,GAAG,EAAE,GAAmC,EACxC,WAAW,EAAC,gBAAgB,EAC5B,cAAc,EAAE,YAAY,YAE5B,KAAC,sBAAsB,KAAG,GACf,CACd,CAAA;iBAAA,GACD,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Combobox, IconButton, TextArea } from '@neo4j-ndl/react';\nimport { CommandLineIconOutline } from '@neo4j-ndl/react/icons';\nimport { useRef, useState } from 'react';\n\nconst commands = [\n {\n description: 'Return a small sample of nodes',\n label: 'Match nodes',\n value: 'MATCH (n) RETURN n LIMIT 25',\n },\n {\n description: 'Show the labels and relationships in the database',\n label: 'Visualize schema',\n value: 'CALL db.schema.visualization()',\n },\n {\n description: 'List the indexes available to the current user',\n label: 'Show indexes',\n value: 'SHOW INDEXES',\n },\n];\n\nconst Component = () => {\n const [terminalValue, setTerminalValue] = useState('');\n const [searchValue, setSearchValue] = useState('');\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n return (\n <div className=\"n-flex n-gap-token-2 n-items-center\">\n <TextArea\n ref={textAreaRef}\n label=\"Command input\"\n value={terminalValue}\n htmlAttributes={{\n onChange: (event) => setTerminalValue(event.target.value),\n rows: 5,\n }}\n helpText=\"Use the button below to search for a command.\"\n />\n <Combobox\n label=\"Insert command\"\n options={commands}\n searchPlaceholder=\"Search commands\"\n searchValue={searchValue}\n onSearchChange={setSearchValue}\n // The picker activates an option but never keeps it as its value.\n // Keeping the controlled value empty avoids a persistent selected state.\n value={null}\n onChange={(command) => {\n if (command === null) {\n return;\n }\n\n setTerminalValue((currentValue) =>\n currentValue === ''\n ? command.value\n : `${currentValue}\\n${command.value}`,\n );\n setSearchValue('');\n textAreaRef.current?.focus();\n }}\n renderTrigger={({ ref, ...triggerProps }) => (\n <IconButton\n ref={ref as React.Ref<HTMLButtonElement>}\n description=\"Insert command\"\n htmlAttributes={triggerProps}\n >\n <CommandLineIconOutline />\n </IconButton>\n )}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}