@eifi1/ui-kit 0.51.7 → 0.52.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 (746) hide show
  1. package/README.md +141 -23
  2. package/dist/account/account-parts.d.ts +10 -8
  3. package/dist/account/account-parts.js +1 -18
  4. package/dist/account/account-parts.js.map +1 -1
  5. package/dist/account/data-export-setting-labels.js +1 -1
  6. package/dist/account/data-export-setting-labels.js.map +1 -1
  7. package/dist/account/delete-account-setting-labels.js +1 -1
  8. package/dist/account/delete-account-setting-labels.js.map +1 -1
  9. package/dist/account/email-change-setting-labels.js +1 -1
  10. package/dist/account/email-change-setting-labels.js.map +1 -1
  11. package/dist/account/passkeys-setting.d.ts +9 -2
  12. package/dist/account/passkeys-setting.js +41 -29
  13. package/dist/account/passkeys-setting.js.map +1 -1
  14. package/dist/account/sessions-setting.d.ts +3 -2
  15. package/dist/account/sessions-setting.js +10 -8
  16. package/dist/account/sessions-setting.js.map +1 -1
  17. package/dist/admin/admin-action-confirm.js +1 -3
  18. package/dist/admin/admin-action-confirm.js.map +1 -1
  19. package/dist/admin/admin-parts.d.ts +6 -3
  20. package/dist/admin/admin-parts.js +6 -21
  21. package/dist/admin/admin-parts.js.map +1 -1
  22. package/dist/admin/mail-test-card-labels.js +1 -1
  23. package/dist/admin/mail-test-card-labels.js.map +1 -1
  24. package/dist/admin/plan-change-labels.d.ts +2 -2
  25. package/dist/admin/plan-change-labels.js +1 -17
  26. package/dist/admin/plan-change-labels.js.map +1 -1
  27. package/dist/admin/plan-change.d.ts +3 -42
  28. package/dist/admin/plan-change.js +1 -1
  29. package/dist/admin/plan-change.js.map +1 -1
  30. package/dist/admin/reviewer-scope-editor.js +3 -3
  31. package/dist/admin/reviewer-scope-editor.js.map +1 -1
  32. package/dist/auth/auth-errors-labels.d.ts +11 -0
  33. package/dist/auth/auth-errors-labels.js +13 -0
  34. package/dist/auth/auth-errors-labels.js.map +1 -0
  35. package/dist/auth/auth-errors.d.ts +7 -23
  36. package/dist/auth/auth-errors.js +2 -15
  37. package/dist/auth/auth-errors.js.map +1 -1
  38. package/dist/auth/complete-name-dialog.js +2 -1
  39. package/dist/auth/complete-name-dialog.js.map +1 -1
  40. package/dist/auth/forgot-password-form-labels.js +1 -1
  41. package/dist/auth/forgot-password-form-labels.js.map +1 -1
  42. package/dist/auth/forgot-password-form.js +7 -2
  43. package/dist/auth/forgot-password-form.js.map +1 -1
  44. package/dist/auth/register-form-labels.js +1 -1
  45. package/dist/auth/register-form-labels.js.map +1 -1
  46. package/dist/auth/reset-password-form-labels.js +1 -1
  47. package/dist/auth/reset-password-form-labels.js.map +1 -1
  48. package/dist/auth/reset-password-form.js +5 -1
  49. package/dist/auth/reset-password-form.js.map +1 -1
  50. package/dist/auth/sign-in-form-labels.js +1 -1
  51. package/dist/auth/sign-in-form-labels.js.map +1 -1
  52. package/dist/auth/status-parts.d.ts +0 -3
  53. package/dist/auth/status-parts.js +0 -4
  54. package/dist/auth/status-parts.js.map +1 -1
  55. package/dist/auth/verify-email-labels.js +1 -1
  56. package/dist/auth/verify-email-labels.js.map +1 -1
  57. package/dist/auth/verify-email.js +7 -2
  58. package/dist/auth/verify-email.js.map +1 -1
  59. package/dist/billing/cancel-subscription.d.ts +20 -8
  60. package/dist/billing/cancel-subscription.js +7 -5
  61. package/dist/billing/cancel-subscription.js.map +1 -1
  62. package/dist/billing/dialog-close.d.ts +29 -0
  63. package/dist/billing/dialog-close.js +8 -0
  64. package/dist/billing/dialog-close.js.map +1 -0
  65. package/dist/billing/plan-card.d.ts +14 -4
  66. package/dist/billing/plan-card.js +15 -8
  67. package/dist/billing/plan-card.js.map +1 -1
  68. package/dist/billing/plan-change-labels.d.ts +42 -0
  69. package/dist/billing/plan-change-labels.js +22 -0
  70. package/dist/billing/plan-change-labels.js.map +1 -0
  71. package/dist/billing/plan-switch.d.ts +19 -7
  72. package/dist/billing/plan-switch.js +8 -4
  73. package/dist/billing/plan-switch.js.map +1 -1
  74. package/dist/chart.d.ts +12 -0
  75. package/dist/chart.js +16 -1
  76. package/dist/chart.js.map +1 -1
  77. package/dist/components/account-chips.d.ts +5 -5
  78. package/dist/components/account-chips.js +11 -13
  79. package/dist/components/account-chips.js.map +1 -1
  80. package/dist/components/alert-banner.d.ts +16 -5
  81. package/dist/components/alert-banner.js +46 -1
  82. package/dist/components/alert-banner.js.map +1 -1
  83. package/dist/components/amount-input.d.ts +13 -0
  84. package/dist/components/amount-input.js +1 -0
  85. package/dist/components/amount-input.js.map +1 -1
  86. package/dist/components/autocomplete.js +57 -65
  87. package/dist/components/autocomplete.js.map +1 -1
  88. package/dist/components/bulk-action-bar.d.ts +12 -2
  89. package/dist/components/bulk-action-bar.js +65 -21
  90. package/dist/components/bulk-action-bar.js.map +1 -1
  91. package/dist/components/button-look.d.ts +5 -5
  92. package/dist/components/button-look.js.map +1 -1
  93. package/dist/components/button.d.ts +2 -2
  94. package/dist/components/button.js.map +1 -1
  95. package/dist/components/chart-edge.d.ts +16 -0
  96. package/dist/components/chart-edge.js +14 -1
  97. package/dist/components/chart-edge.js.map +1 -1
  98. package/dist/components/chart-figure.d.ts +13 -0
  99. package/dist/components/chart-figure.js +15 -0
  100. package/dist/components/chart-figure.js.map +1 -0
  101. package/dist/components/chart-zoom-core.js +1 -4
  102. package/dist/components/chart-zoom-core.js.map +1 -1
  103. package/dist/components/chart.d.ts +8 -1
  104. package/dist/components/chart.js +19 -10
  105. package/dist/components/chart.js.map +1 -1
  106. package/dist/components/combobox-core.d.ts +111 -2
  107. package/dist/components/combobox-core.js +148 -42
  108. package/dist/components/combobox-core.js.map +1 -1
  109. package/dist/components/combobox.d.ts +1 -1
  110. package/dist/components/combobox.js +141 -130
  111. package/dist/components/combobox.js.map +1 -1
  112. package/dist/components/copy-button.d.ts +6 -5
  113. package/dist/components/copy-button.js +5 -3
  114. package/dist/components/copy-button.js.map +1 -1
  115. package/dist/components/country-select.js +2 -2
  116. package/dist/components/country-select.js.map +1 -1
  117. package/dist/components/data-table-column-settings.d.ts +1 -1
  118. package/dist/components/data-table-column-settings.js +33 -7
  119. package/dist/components/data-table-column-settings.js.map +1 -1
  120. package/dist/components/data-table-filters.d.ts +4 -2
  121. package/dist/components/data-table-filters.js +2 -2
  122. package/dist/components/data-table-filters.js.map +1 -1
  123. package/dist/components/data-table-fit.d.ts +6 -4
  124. package/dist/components/data-table-fit.js +4 -1
  125. package/dist/components/data-table-fit.js.map +1 -1
  126. package/dist/components/data-table-groups.d.ts +1 -1
  127. package/dist/components/data-table-groups.js.map +1 -1
  128. package/dist/components/data-table-head.d.ts +1 -1
  129. package/dist/components/data-table-head.js +15 -12
  130. package/dist/components/data-table-head.js.map +1 -1
  131. package/dist/components/data-table-mobile.d.ts +12 -7
  132. package/dist/components/data-table-mobile.js +43 -30
  133. package/dist/components/data-table-mobile.js.map +1 -1
  134. package/dist/components/data-table-pagination.js +11 -6
  135. package/dist/components/data-table-pagination.js.map +1 -1
  136. package/dist/components/data-table-resize.d.ts +1 -1
  137. package/dist/components/data-table-resize.js.map +1 -1
  138. package/dist/components/data-table-row-actions.d.ts +2 -2
  139. package/dist/components/data-table-row-actions.js.map +1 -1
  140. package/dist/components/data-table-row.d.ts +6 -2
  141. package/dist/components/data-table-row.js +17 -10
  142. package/dist/components/data-table-row.js.map +1 -1
  143. package/dist/components/data-table-selection.d.ts +1 -1
  144. package/dist/components/data-table-selection.js.map +1 -1
  145. package/dist/components/data-table-shared.d.ts +10 -2
  146. package/dist/components/data-table-shared.js +18 -0
  147. package/dist/components/data-table-shared.js.map +1 -1
  148. package/dist/components/data-table-sort.d.ts +21 -2
  149. package/dist/components/data-table-sort.js +24 -0
  150. package/dist/components/data-table-sort.js.map +1 -1
  151. package/dist/components/data-table-virtual.d.ts +1 -1
  152. package/dist/components/data-table-virtual.js +18 -6
  153. package/dist/components/data-table-virtual.js.map +1 -1
  154. package/dist/components/data-table.d.ts +13 -4
  155. package/dist/components/data-table.js +139 -36
  156. package/dist/components/data-table.js.map +1 -1
  157. package/dist/components/date-field.d.ts +24 -2
  158. package/dist/components/date-field.js +33 -8
  159. package/dist/components/date-field.js.map +1 -1
  160. package/dist/components/date-picker.d.ts +15 -2
  161. package/dist/components/date-picker.js +55 -26
  162. package/dist/components/date-picker.js.map +1 -1
  163. package/dist/components/date-range-picker.d.ts +47 -20
  164. package/dist/components/date-range-picker.js +23 -7
  165. package/dist/components/date-range-picker.js.map +1 -1
  166. package/dist/components/error-boundary.js +37 -30
  167. package/dist/components/error-boundary.js.map +1 -1
  168. package/dist/components/{ui-labels.d.ts → field-base-labels.d.ts} +0 -2
  169. package/dist/components/{ui-labels.js → field-base-labels.js} +2 -9
  170. package/dist/components/field-base-labels.js.map +1 -0
  171. package/dist/components/field-base.d.ts +4 -3
  172. package/dist/components/field-base.js +3 -3
  173. package/dist/components/field-base.js.map +1 -1
  174. package/dist/components/field-sync-labels.d.ts +1 -0
  175. package/dist/components/field-sync-labels.js.map +1 -1
  176. package/dist/components/field-sync.d.ts +23 -1
  177. package/dist/components/field-sync.js.map +1 -1
  178. package/dist/components/form-actions.js +11 -5
  179. package/dist/components/form-actions.js.map +1 -1
  180. package/dist/components/hover-menu.d.ts +3 -0
  181. package/dist/components/hover-menu.js +5 -3
  182. package/dist/components/hover-menu.js.map +1 -1
  183. package/dist/components/icon-button.js +14 -9
  184. package/dist/components/icon-button.js.map +1 -1
  185. package/dist/components/inline-confirm.d.ts +43 -0
  186. package/dist/components/inline-confirm.js +67 -0
  187. package/dist/components/inline-confirm.js.map +1 -0
  188. package/dist/components/inline-entity-combobox.d.ts +4 -3
  189. package/dist/components/inline-entity-combobox.js +148 -140
  190. package/dist/components/inline-entity-combobox.js.map +1 -1
  191. package/dist/components/input.js +1 -1
  192. package/dist/components/input.js.map +1 -1
  193. package/dist/components/jump-calendar.js +28 -112
  194. package/dist/components/jump-calendar.js.map +1 -1
  195. package/dist/components/legal-page.d.ts +3 -1
  196. package/dist/components/legal-page.js +3 -2
  197. package/dist/components/legal-page.js.map +1 -1
  198. package/dist/components/legal.d.ts +4 -2
  199. package/dist/components/legal.js.map +1 -1
  200. package/dist/components/lightbox.d.ts +2 -2
  201. package/dist/components/lightbox.js +17 -6
  202. package/dist/components/lightbox.js.map +1 -1
  203. package/dist/components/list.d.ts +6 -2
  204. package/dist/components/list.js +3 -2
  205. package/dist/components/list.js.map +1 -1
  206. package/dist/components/measured-grid.d.ts +1 -1
  207. package/dist/components/measured-grid.js +2 -1
  208. package/dist/components/measured-grid.js.map +1 -1
  209. package/dist/components/mini-calendar.js +3 -5
  210. package/dist/components/mini-calendar.js.map +1 -1
  211. package/dist/components/modal.js +3 -1
  212. package/dist/components/modal.js.map +1 -1
  213. package/dist/components/month-grid.d.ts +55 -0
  214. package/dist/components/month-grid.js +148 -0
  215. package/dist/components/month-grid.js.map +1 -0
  216. package/dist/components/month-picker.d.ts +36 -4
  217. package/dist/components/month-picker.js +123 -146
  218. package/dist/components/month-picker.js.map +1 -1
  219. package/dist/components/multi-select.d.ts +2 -2
  220. package/dist/components/multi-select.js +11 -6
  221. package/dist/components/multi-select.js.map +1 -1
  222. package/dist/components/picker-sheet.js +2 -1
  223. package/dist/components/picker-sheet.js.map +1 -1
  224. package/dist/components/pie-chart-labels.d.ts +7 -0
  225. package/dist/components/pie-chart-labels.js +1 -0
  226. package/dist/components/pie-chart-labels.js.map +1 -1
  227. package/dist/components/pie-chart.d.ts +5 -3
  228. package/dist/components/pie-chart.js +7 -22
  229. package/dist/components/pie-chart.js.map +1 -1
  230. package/dist/components/popover.d.ts +3 -0
  231. package/dist/components/popover.js +7 -1
  232. package/dist/components/popover.js.map +1 -1
  233. package/dist/components/row-actions.js +2 -1
  234. package/dist/components/row-actions.js.map +1 -1
  235. package/dist/components/section-nav.d.ts +7 -0
  236. package/dist/components/section-nav.js.map +1 -1
  237. package/dist/components/series-chart-axes.d.ts +3 -3
  238. package/dist/components/series-chart-axes.js.map +1 -1
  239. package/dist/components/series-chart-labels.d.ts +7 -4
  240. package/dist/components/series-chart-labels.js.map +1 -1
  241. package/dist/components/series-chart.d.ts +31 -7
  242. package/dist/components/series-chart.js +72 -29
  243. package/dist/components/series-chart.js.map +1 -1
  244. package/dist/components/share-card.js +3 -3
  245. package/dist/components/share-card.js.map +1 -1
  246. package/dist/components/sign-chip-labels.d.ts +1 -0
  247. package/dist/components/sign-chip-labels.js.map +1 -1
  248. package/dist/components/sign-chip.d.ts +10 -1
  249. package/dist/components/sign-chip.js.map +1 -1
  250. package/dist/components/tabs-labels.d.ts +2 -0
  251. package/dist/components/tabs-labels.js +11 -0
  252. package/dist/components/tabs-labels.js.map +1 -0
  253. package/dist/components/tabs.d.ts +1 -1
  254. package/dist/components/tabs.js +1 -1
  255. package/dist/components/tabs.js.map +1 -1
  256. package/dist/components/toggle-legend.d.ts +2 -2
  257. package/dist/components/toggle-legend.js +6 -6
  258. package/dist/components/toggle-legend.js.map +1 -1
  259. package/dist/components/translation-review-editor.d.ts +4 -2
  260. package/dist/components/translation-review-editor.js +2 -3
  261. package/dist/components/translation-review-editor.js.map +1 -1
  262. package/dist/components/translation-review.d.ts +2 -1
  263. package/dist/components/translation-review.js +2 -2
  264. package/dist/components/translation-review.js.map +1 -1
  265. package/dist/components/treemap-labels.d.ts +26 -0
  266. package/dist/components/treemap-labels.js +10 -0
  267. package/dist/components/treemap-labels.js.map +1 -0
  268. package/dist/components/treemap-layout.d.ts +62 -0
  269. package/dist/components/treemap-layout.js +126 -0
  270. package/dist/components/treemap-layout.js.map +1 -0
  271. package/dist/components/treemap.d.ts +140 -17
  272. package/dist/components/treemap.js +324 -97
  273. package/dist/components/treemap.js.map +1 -1
  274. package/dist/components/use-table-state.d.ts +5 -5
  275. package/dist/components/use-table-state.js +4 -1
  276. package/dist/components/use-table-state.js.map +1 -1
  277. package/dist/data-table.d.ts +6 -2
  278. package/dist/data-table.js +7 -2
  279. package/dist/data-table.js.map +1 -1
  280. package/dist/eslint/index.js +1 -1
  281. package/dist/eslint/role-utilities.d.ts +36 -7
  282. package/dist/eslint/role-utilities.js +42 -9
  283. package/dist/eslint/role-utilities.js.map +1 -1
  284. package/dist/feedback/feedback-dialog.d.ts +25 -16
  285. package/dist/feedback/feedback-dialog.js +6 -2
  286. package/dist/feedback/feedback-dialog.js.map +1 -1
  287. package/dist/feedback/feedback-mutation.d.ts +30 -0
  288. package/dist/feedback/feedback-mutation.js +16 -0
  289. package/dist/feedback/feedback-mutation.js.map +1 -0
  290. package/dist/feedback/feedback-page-link.d.ts +53 -0
  291. package/dist/feedback/feedback-page-link.js +37 -0
  292. package/dist/feedback/feedback-page-link.js.map +1 -0
  293. package/dist/feedback/feedback-public-list.d.ts +12 -3
  294. package/dist/feedback/feedback-public-list.js +2 -1
  295. package/dist/feedback/feedback-public-list.js.map +1 -1
  296. package/dist/feedback/feedback-replies.d.ts +3 -1
  297. package/dist/feedback/feedback-replies.js +5 -4
  298. package/dist/feedback/feedback-replies.js.map +1 -1
  299. package/dist/feedback/feedback-row-detail-labels.js +5 -0
  300. package/dist/feedback/feedback-row-detail-labels.js.map +1 -1
  301. package/dist/feedback/feedback-row-detail.d.ts +64 -28
  302. package/dist/feedback/feedback-row-detail.js +30 -28
  303. package/dist/feedback/feedback-row-detail.js.map +1 -1
  304. package/dist/feedback/feedback-status-undo.d.ts +30 -11
  305. package/dist/feedback/feedback-status-undo.js +10 -15
  306. package/dist/feedback/feedback-status-undo.js.map +1 -1
  307. package/dist/feedback/feedback-submit-dialog.d.ts +1 -1
  308. package/dist/feedback/feedback-submit-dialog.js +1 -1
  309. package/dist/feedback/feedback-submit-dialog.js.map +1 -1
  310. package/dist/feedback/feedback-submit.js +9 -3
  311. package/dist/feedback/feedback-submit.js.map +1 -1
  312. package/dist/feedback/feedback-swipe.d.ts +1 -1
  313. package/dist/feedback/feedback-swipe.js.map +1 -1
  314. package/dist/feedback/feedback-table.d.ts +21 -9
  315. package/dist/feedback/feedback-table.js +45 -25
  316. package/dist/feedback/feedback-table.js.map +1 -1
  317. package/dist/feedback/feedback-thread-labels.d.ts +2 -2
  318. package/dist/feedback/feedback-thread-labels.js.map +1 -1
  319. package/dist/feedback/feedback-thread.d.ts +24 -23
  320. package/dist/feedback/feedback-thread.js +2 -1
  321. package/dist/feedback/feedback-thread.js.map +1 -1
  322. package/dist/feedback.d.ts +34 -0
  323. package/dist/feedback.js +42 -0
  324. package/dist/feedback.js.map +1 -1
  325. package/dist/hooks/use-focus-trap.d.ts +35 -0
  326. package/dist/hooks/use-focus-trap.js +6 -4
  327. package/dist/hooks/use-focus-trap.js.map +1 -1
  328. package/dist/hooks/use-hotkey.d.ts +5 -2
  329. package/dist/hooks/use-hotkey.js +5 -4
  330. package/dist/hooks/use-hotkey.js.map +1 -1
  331. package/dist/hooks/use-long-press.d.ts +7 -4
  332. package/dist/hooks/use-long-press.js +3 -0
  333. package/dist/hooks/use-long-press.js.map +1 -1
  334. package/dist/hooks/use-media-query.js +12 -4
  335. package/dist/hooks/use-media-query.js.map +1 -1
  336. package/dist/hooks/use-mounted.d.ts +22 -0
  337. package/dist/hooks/use-mounted.js +24 -0
  338. package/dist/hooks/use-mounted.js.map +1 -0
  339. package/dist/hooks/use-overlay-history.js +19 -3
  340. package/dist/hooks/use-overlay-history.js.map +1 -1
  341. package/dist/i18n/defaults.js +4 -5
  342. package/dist/i18n/defaults.js.map +1 -1
  343. package/dist/i18n/german.js +7 -1
  344. package/dist/i18n/german.js.map +1 -1
  345. package/dist/i18n/kit-labels.d.ts +9 -2
  346. package/dist/i18n/kit-labels.js.map +1 -1
  347. package/dist/i18n/locales/en.js +20 -41
  348. package/dist/i18n/locales/en.js.map +3 -3
  349. package/dist/i18n/locales/es.js +7 -1
  350. package/dist/i18n/locales/es.js.map +1 -1
  351. package/dist/i18n/locales/fr.js +20 -10
  352. package/dist/i18n/locales/fr.js.map +1 -1
  353. package/dist/i18n/locales/hu.js +9 -1
  354. package/dist/i18n/locales/hu.js.map +1 -1
  355. package/dist/i18n/locales/it.js +7 -1
  356. package/dist/i18n/locales/it.js.map +1 -1
  357. package/dist/i18n/locales/zh.js +8 -1
  358. package/dist/i18n/locales/zh.js.map +1 -1
  359. package/dist/i18n/review.js +5 -0
  360. package/dist/i18n/review.js.map +1 -1
  361. package/dist/index.d.ts +64 -17
  362. package/dist/index.js +77 -12
  363. package/dist/index.js.map +1 -1
  364. package/dist/landing/routing.d.ts +3 -1
  365. package/dist/landing/routing.js +4 -7
  366. package/dist/landing/routing.js.map +1 -1
  367. package/dist/lib/broadcast.d.ts +17 -0
  368. package/dist/lib/broadcast.js +30 -0
  369. package/dist/lib/broadcast.js.map +1 -0
  370. package/dist/lib/date-format.d.ts +37 -2
  371. package/dist/lib/date-format.js +34 -8
  372. package/dist/lib/date-format.js.map +1 -1
  373. package/dist/lib/day-format.d.ts +46 -0
  374. package/dist/lib/day-format.js +46 -0
  375. package/dist/lib/day-format.js.map +1 -0
  376. package/dist/lib/describe-failure.d.ts +14 -0
  377. package/dist/lib/describe-failure.js +9 -0
  378. package/dist/lib/describe-failure.js.map +1 -0
  379. package/dist/lib/direction.d.ts +16 -0
  380. package/dist/lib/direction.js +9 -1
  381. package/dist/lib/direction.js.map +1 -1
  382. package/dist/lib/focus-left.d.ts +63 -0
  383. package/dist/lib/focus-left.js +67 -0
  384. package/dist/lib/focus-left.js.map +1 -0
  385. package/dist/lib/format.js +5 -14
  386. package/dist/lib/format.js.map +1 -1
  387. package/dist/lib/http-status.d.ts +24 -0
  388. package/dist/lib/http-status.js +14 -0
  389. package/dist/lib/http-status.js.map +1 -0
  390. package/dist/lib/intl-cache.d.ts +14 -0
  391. package/dist/lib/intl-cache.js +15 -0
  392. package/dist/lib/intl-cache.js.map +1 -0
  393. package/dist/lib/isin.d.ts +10 -0
  394. package/dist/lib/isin.js.map +1 -1
  395. package/dist/lib/iso-day.d.ts +11 -0
  396. package/dist/lib/iso-day.js +8 -0
  397. package/dist/lib/iso-day.js.map +1 -0
  398. package/dist/lib/lazy-with-fallback.d.ts +31 -0
  399. package/dist/lib/lazy-with-fallback.js +40 -0
  400. package/dist/lib/lazy-with-fallback.js.map +1 -0
  401. package/dist/lib/path-pattern.d.ts +34 -0
  402. package/dist/lib/path-pattern.js +24 -0
  403. package/dist/lib/path-pattern.js.map +1 -0
  404. package/dist/lib/reduced-motion.d.ts +2 -1
  405. package/dist/lib/reduced-motion.js.map +1 -1
  406. package/dist/lib/round.d.ts +2 -1
  407. package/dist/lib/round.js +2 -1
  408. package/dist/lib/round.js.map +1 -1
  409. package/dist/lib/safe-storage.d.ts +24 -5
  410. package/dist/lib/safe-storage.js +27 -2
  411. package/dist/lib/safe-storage.js.map +1 -1
  412. package/dist/lib/session-refresh.js +1 -1
  413. package/dist/lib/session-refresh.js.map +1 -1
  414. package/dist/lib/share-format.d.ts +13 -0
  415. package/dist/lib/share-format.js +10 -0
  416. package/dist/lib/share-format.js.map +1 -0
  417. package/dist/lib/text-case.d.ts +17 -0
  418. package/dist/lib/text-case.js +8 -0
  419. package/dist/lib/text-case.js.map +1 -0
  420. package/dist/lib/text-match.d.ts +29 -0
  421. package/dist/lib/text-match.js +20 -2
  422. package/dist/lib/text-match.js.map +1 -1
  423. package/dist/lib/thenable.d.ts +13 -0
  424. package/dist/lib/thenable.js +8 -0
  425. package/dist/lib/thenable.js.map +1 -0
  426. package/dist/lib/translation-review.d.ts +7 -2
  427. package/dist/lib/translation-review.js +4 -4
  428. package/dist/lib/translation-review.js.map +1 -1
  429. package/dist/notifications/device-zone-report.js +1 -1
  430. package/dist/notifications/device-zone-report.js.map +1 -1
  431. package/dist/notifications/notification-bell.d.ts +2 -1
  432. package/dist/notifications/notification-bell.js +3 -3
  433. package/dist/notifications/notification-bell.js.map +1 -1
  434. package/dist/notifications/notification-inbox.d.ts +10 -6
  435. package/dist/notifications/notification-inbox.js +26 -48
  436. package/dist/notifications/notification-inbox.js.map +1 -1
  437. package/dist/notifications/notification-parts.d.ts +3 -2
  438. package/dist/notifications/notification-parts.js +1 -3
  439. package/dist/notifications/notification-parts.js.map +1 -1
  440. package/dist/notifications/notification-types-setting.js +1 -1
  441. package/dist/notifications/notification-types-setting.js.map +1 -1
  442. package/dist/notifications/notifications-labels.d.ts +6 -0
  443. package/dist/notifications/notifications-labels.js +1 -0
  444. package/dist/notifications/notifications-labels.js.map +1 -1
  445. package/dist/notifications/push-device-setting.js +1 -1
  446. package/dist/notifications/push-device-setting.js.map +1 -1
  447. package/dist/notifications/push-devices-setting.d.ts +2 -1
  448. package/dist/notifications/push-devices-setting.js +27 -49
  449. package/dist/notifications/push-devices-setting.js.map +1 -1
  450. package/dist/notifications/quiet-hours-setting.d.ts +10 -3
  451. package/dist/notifications/quiet-hours-setting.js +65 -26
  452. package/dist/notifications/quiet-hours-setting.js.map +1 -1
  453. package/dist/notifications/unsubscribe-panel.js +4 -7
  454. package/dist/notifications/unsubscribe-panel.js.map +1 -1
  455. package/dist/notifications/use-push-device.d.ts +39 -1
  456. package/dist/notifications/use-push-device.js +28 -7
  457. package/dist/notifications/use-push-device.js.map +1 -1
  458. package/dist/offline/query-persistence.d.ts +3 -1
  459. package/dist/offline/query-persistence.js +19 -2
  460. package/dist/offline/query-persistence.js.map +1 -1
  461. package/dist/rhf/fields.d.ts +11 -4
  462. package/dist/rhf/fields.js.map +1 -1
  463. package/dist/search/command-palette.js +1 -1
  464. package/dist/search/command-palette.js.map +1 -1
  465. package/dist/search/global-search.js +19 -9
  466. package/dist/search/global-search.js.map +1 -1
  467. package/dist/search/use-command-key.d.ts +12 -1
  468. package/dist/search/use-command-key.js +3 -12
  469. package/dist/search/use-command-key.js.map +1 -1
  470. package/dist/search.d.ts +7 -0
  471. package/dist/search.js +10 -0
  472. package/dist/search.js.map +1 -1
  473. package/dist/settings/use-settings-focus.js +1 -0
  474. package/dist/settings/use-settings-focus.js.map +1 -1
  475. package/dist/shell/account-menu-language.d.ts +21 -5
  476. package/dist/shell/account-menu-language.js +3 -1
  477. package/dist/shell/account-menu-language.js.map +1 -1
  478. package/dist/shell/account-menu-text-size.d.ts +26 -9
  479. package/dist/shell/account-menu-text-size.js +3 -2
  480. package/dist/shell/account-menu-text-size.js.map +1 -1
  481. package/dist/shell/dev-menu.js +5 -18
  482. package/dist/shell/dev-menu.js.map +1 -1
  483. package/dist/shell/role-switcher.d.ts +7 -0
  484. package/dist/shell/role-switcher.js.map +1 -1
  485. package/dist/shell/top-bar-actions.d.ts +1 -1
  486. package/dist/shell/top-bar-actions.js.map +1 -1
  487. package/dist/shell/top-bar-parts-labels.d.ts +0 -2
  488. package/dist/shell/top-bar-parts-labels.js +0 -1
  489. package/dist/shell/top-bar-parts-labels.js.map +1 -1
  490. package/dist/shell.d.ts +27 -8
  491. package/dist/shell.js +28 -7
  492. package/dist/shell.js.map +1 -1
  493. package/dist/sync/engine.d.ts +30 -4
  494. package/dist/sync/engine.js +172 -52
  495. package/dist/sync/engine.js.map +1 -1
  496. package/dist/sync.d.ts +6 -2
  497. package/dist/sync.js +6 -1
  498. package/dist/sync.js.map +1 -1
  499. package/dist/testing/css-variables.js +3 -8
  500. package/dist/testing/css-variables.js.map +1 -1
  501. package/dist/theme/contrast.d.ts +2 -1
  502. package/dist/theme/contrast.js +3 -8
  503. package/dist/theme/contrast.js.map +1 -1
  504. package/dist/theme/palette-store.js +6 -6
  505. package/dist/theme/palette-store.js.map +1 -1
  506. package/dist/theme/text-size.js +3 -8
  507. package/dist/theme/text-size.js.map +1 -1
  508. package/dist/theme/theme-store.js +3 -6
  509. package/dist/theme/theme-store.js.map +1 -1
  510. package/dist/tour/tour-catalogue.d.ts +7 -4
  511. package/dist/tour/tour-catalogue.js +12 -10
  512. package/dist/tour/tour-catalogue.js.map +1 -1
  513. package/dist/tour/tour-dock.d.ts +0 -2
  514. package/dist/tour/tour-dock.js +0 -2
  515. package/dist/tour/tour-dock.js.map +1 -1
  516. package/dist/tour/tour-gates.d.ts +4 -0
  517. package/dist/tour/tour-gates.js +14 -0
  518. package/dist/tour/tour-gates.js.map +1 -1
  519. package/dist/tour/tour-overlay.d.ts +27 -0
  520. package/dist/tour/tour-overlay.js +741 -0
  521. package/dist/tour/tour-overlay.js.map +1 -0
  522. package/dist/tour/tour.d.ts +13 -3
  523. package/dist/tour/tour.js +59 -781
  524. package/dist/tour/tour.js.map +1 -1
  525. package/dist/tour/use-tour-progress.js +1 -1
  526. package/dist/tour/use-tour-progress.js.map +1 -1
  527. package/dist/wizard/stepper-nav.d.ts +5 -1
  528. package/dist/wizard/stepper-nav.js.map +1 -1
  529. package/dist/wizard/types.d.ts +6 -2
  530. package/dist/wizard/types.js.map +1 -1
  531. package/dist/wizard/use-wizard.d.ts +3 -1
  532. package/dist/wizard/use-wizard.js.map +1 -1
  533. package/dist/wizard/validation.d.ts +3 -1
  534. package/dist/wizard/validation.js.map +1 -1
  535. package/package.json +10 -6
  536. package/src/account/account-parts.ts +5 -25
  537. package/src/account/data-export-setting-labels.ts +1 -1
  538. package/src/account/delete-account-setting-labels.ts +1 -1
  539. package/src/account/email-change-setting-labels.ts +1 -1
  540. package/src/account/passkeys-setting.tsx +60 -38
  541. package/src/account/sessions-setting.tsx +18 -12
  542. package/src/admin/admin-action-confirm.tsx +1 -5
  543. package/src/admin/admin-parts.ts +11 -25
  544. package/src/admin/mail-test-card-labels.ts +1 -1
  545. package/src/admin/plan-change-labels.ts +5 -23
  546. package/src/admin/plan-change.tsx +7 -44
  547. package/src/admin/reviewer-scope-editor.tsx +3 -3
  548. package/src/auth/auth-errors-labels.ts +23 -0
  549. package/src/auth/auth-errors.ts +11 -38
  550. package/src/auth/complete-name-dialog.tsx +4 -1
  551. package/src/auth/forgot-password-form-labels.ts +1 -1
  552. package/src/auth/forgot-password-form.tsx +11 -6
  553. package/src/auth/register-form-labels.ts +1 -1
  554. package/src/auth/reset-password-form-labels.ts +1 -1
  555. package/src/auth/reset-password-form.tsx +8 -4
  556. package/src/auth/sign-in-form-labels.ts +1 -1
  557. package/src/auth/status-parts.tsx +0 -6
  558. package/src/auth/verify-email-labels.ts +1 -1
  559. package/src/auth/verify-email.tsx +11 -6
  560. package/src/billing/cancel-subscription.tsx +26 -12
  561. package/src/billing/dialog-close.ts +34 -0
  562. package/src/billing/plan-card.tsx +36 -11
  563. package/src/billing/plan-change-labels.ts +66 -0
  564. package/src/billing/plan-switch.tsx +26 -12
  565. package/src/chart.ts +21 -3
  566. package/src/components/account-chips.tsx +20 -23
  567. package/src/components/alert-banner.tsx +82 -5
  568. package/src/components/amount-input.tsx +18 -7
  569. package/src/components/autocomplete.tsx +64 -70
  570. package/src/components/bulk-action-bar.tsx +70 -2
  571. package/src/components/button-look.ts +5 -5
  572. package/src/components/button.tsx +2 -2
  573. package/src/components/chart-edge.ts +34 -1
  574. package/src/components/chart-figure.tsx +35 -0
  575. package/src/components/chart-zoom-core.tsx +6 -5
  576. package/src/components/chart.tsx +26 -5
  577. package/src/components/combobox-core.tsx +293 -62
  578. package/src/components/combobox.tsx +183 -153
  579. package/src/components/copy-button.tsx +34 -23
  580. package/src/components/country-select.tsx +16 -11
  581. package/src/components/data-table-column-settings.tsx +52 -10
  582. package/src/components/data-table-filters.ts +6 -4
  583. package/src/components/data-table-fit.ts +19 -5
  584. package/src/components/data-table-groups.tsx +1 -1
  585. package/src/components/data-table-head.tsx +32 -22
  586. package/src/components/data-table-mobile.tsx +61 -26
  587. package/src/components/data-table-pagination.tsx +21 -6
  588. package/src/components/data-table-resize.ts +1 -1
  589. package/src/components/data-table-row-actions.tsx +3 -3
  590. package/src/components/data-table-row.tsx +25 -14
  591. package/src/components/data-table-selection.ts +1 -1
  592. package/src/components/data-table-shared.tsx +33 -1
  593. package/src/components/data-table-sort.ts +57 -2
  594. package/src/components/data-table-virtual.ts +32 -8
  595. package/src/components/data-table.tsx +239 -68
  596. package/src/components/date-field.tsx +65 -8
  597. package/src/components/date-picker.tsx +125 -48
  598. package/src/components/date-range-picker.tsx +82 -31
  599. package/src/components/error-boundary.tsx +53 -39
  600. package/src/components/field-base-labels.ts +20 -0
  601. package/src/components/field-base.tsx +13 -7
  602. package/src/components/field-sync-labels.ts +1 -0
  603. package/src/components/field-sync.tsx +23 -1
  604. package/src/components/form-actions.tsx +20 -5
  605. package/src/components/hover-menu.tsx +18 -8
  606. package/src/components/icon-button.tsx +14 -9
  607. package/src/components/inline-confirm.tsx +116 -0
  608. package/src/components/inline-entity-combobox.tsx +197 -153
  609. package/src/components/input.tsx +1 -1
  610. package/src/components/jump-calendar.tsx +30 -146
  611. package/src/components/legal-page.tsx +10 -7
  612. package/src/components/legal.tsx +4 -2
  613. package/src/components/lightbox.tsx +21 -8
  614. package/src/components/list.tsx +10 -4
  615. package/src/components/measured-grid.tsx +8 -4
  616. package/src/components/mini-calendar.tsx +6 -5
  617. package/src/components/modal.tsx +6 -1
  618. package/src/components/month-grid.tsx +229 -0
  619. package/src/components/month-picker.tsx +192 -200
  620. package/src/components/multi-select.tsx +21 -9
  621. package/src/components/picker-sheet.tsx +12 -9
  622. package/src/components/pie-chart-labels.ts +8 -0
  623. package/src/components/pie-chart.tsx +22 -28
  624. package/src/components/popover.tsx +18 -1
  625. package/src/components/row-actions.tsx +2 -1
  626. package/src/components/section-nav.tsx +7 -0
  627. package/src/components/series-chart-axes.ts +3 -3
  628. package/src/components/series-chart-labels.ts +7 -4
  629. package/src/components/series-chart.tsx +178 -69
  630. package/src/components/share-card.tsx +6 -6
  631. package/src/components/sign-chip-labels.ts +1 -0
  632. package/src/components/sign-chip.tsx +10 -1
  633. package/src/components/tabs-labels.ts +13 -0
  634. package/src/components/tabs.tsx +2 -2
  635. package/src/components/toggle-legend.tsx +16 -11
  636. package/src/components/translation-review-editor.tsx +6 -5
  637. package/src/components/translation-review.tsx +4 -3
  638. package/src/components/treemap-labels.ts +39 -0
  639. package/src/components/treemap-layout.ts +210 -0
  640. package/src/components/treemap.tsx +722 -133
  641. package/src/components/use-table-state.ts +12 -9
  642. package/src/data-table.ts +9 -2
  643. package/src/eslint/role-utilities.ts +97 -19
  644. package/src/feedback/feedback-dialog.tsx +30 -19
  645. package/src/feedback/feedback-mutation.ts +41 -0
  646. package/src/feedback/feedback-page-link.ts +90 -0
  647. package/src/feedback/feedback-public-list.tsx +17 -5
  648. package/src/feedback/feedback-replies.tsx +13 -6
  649. package/src/feedback/feedback-row-detail-labels.ts +5 -0
  650. package/src/feedback/feedback-row-detail.tsx +103 -67
  651. package/src/feedback/feedback-status-undo.ts +41 -27
  652. package/src/feedback/feedback-submit-dialog.tsx +2 -2
  653. package/src/feedback/feedback-submit.tsx +21 -7
  654. package/src/feedback/feedback-swipe.tsx +1 -1
  655. package/src/feedback/feedback-table.tsx +86 -38
  656. package/src/feedback/feedback-thread-labels.ts +2 -2
  657. package/src/feedback/feedback-thread.tsx +27 -25
  658. package/src/feedback.ts +42 -0
  659. package/src/hooks/use-focus-trap.ts +8 -24
  660. package/src/hooks/use-hotkey.ts +24 -7
  661. package/src/hooks/use-long-press.ts +16 -2
  662. package/src/hooks/use-media-query.ts +20 -4
  663. package/src/hooks/use-mounted.ts +39 -0
  664. package/src/hooks/use-overlay-history.ts +32 -3
  665. package/src/i18n/defaults.ts +4 -5
  666. package/src/i18n/german.ts +8 -2
  667. package/src/i18n/kit-labels.tsx +9 -2
  668. package/src/i18n/locales/es.ts +8 -2
  669. package/src/i18n/locales/fr.ts +21 -13
  670. package/src/i18n/locales/hu.ts +10 -2
  671. package/src/i18n/locales/it.ts +8 -2
  672. package/src/i18n/locales/zh.ts +9 -2
  673. package/src/i18n/review.ts +5 -0
  674. package/src/index.ts +103 -13
  675. package/src/landing/routing.tsx +14 -10
  676. package/src/lib/broadcast.ts +52 -0
  677. package/src/lib/date-format.ts +89 -13
  678. package/src/lib/day-format.ts +96 -0
  679. package/src/lib/describe-failure.ts +18 -0
  680. package/src/lib/direction.ts +39 -0
  681. package/src/lib/focus-left.ts +156 -0
  682. package/src/lib/format.ts +5 -17
  683. package/src/lib/http-status.ts +38 -0
  684. package/src/lib/intl-cache.ts +25 -0
  685. package/src/lib/isin.ts +10 -0
  686. package/src/lib/iso-day.ts +13 -0
  687. package/src/lib/lazy-with-fallback.ts +82 -0
  688. package/src/lib/path-pattern.ts +55 -0
  689. package/src/lib/reduced-motion.ts +2 -1
  690. package/src/lib/round.ts +7 -2
  691. package/src/lib/safe-storage.ts +48 -6
  692. package/src/lib/session-refresh.ts +1 -1
  693. package/src/lib/share-format.ts +18 -0
  694. package/src/lib/text-case.ts +19 -0
  695. package/src/lib/text-match.ts +57 -2
  696. package/src/lib/thenable.ts +19 -0
  697. package/src/lib/translation-review.ts +13 -5
  698. package/src/notifications/device-zone-report.ts +1 -1
  699. package/src/notifications/notification-bell.tsx +7 -4
  700. package/src/notifications/notification-inbox.tsx +40 -58
  701. package/src/notifications/notification-parts.tsx +3 -4
  702. package/src/notifications/notification-types-setting.tsx +1 -1
  703. package/src/notifications/notifications-labels.ts +7 -0
  704. package/src/notifications/push-device-setting.tsx +1 -1
  705. package/src/notifications/push-devices-setting.tsx +30 -55
  706. package/src/notifications/quiet-hours-setting.tsx +93 -31
  707. package/src/notifications/unsubscribe-panel.tsx +4 -7
  708. package/src/notifications/use-push-device.ts +76 -10
  709. package/src/offline/query-persistence.ts +35 -3
  710. package/src/rhf/fields.tsx +11 -4
  711. package/src/search/command-palette.tsx +2 -4
  712. package/src/search/global-search.tsx +36 -15
  713. package/src/search/use-command-key.ts +13 -12
  714. package/src/search.ts +9 -0
  715. package/src/settings/use-settings-focus.ts +3 -0
  716. package/src/shell/account-menu-language.tsx +27 -5
  717. package/src/shell/account-menu-text-size.tsx +32 -10
  718. package/src/shell/dev-menu.tsx +7 -21
  719. package/src/shell/role-switcher.tsx +7 -0
  720. package/src/shell/top-bar-actions.tsx +1 -1
  721. package/src/shell/top-bar-parts-labels.ts +0 -3
  722. package/src/shell.ts +40 -9
  723. package/src/sync/engine.ts +339 -61
  724. package/src/sync.ts +8 -1
  725. package/src/testing/css-variables.ts +8 -9
  726. package/src/theme/contrast.ts +8 -9
  727. package/src/theme/palette-store.ts +9 -9
  728. package/src/theme/text-size.ts +6 -8
  729. package/src/theme/theme-store.ts +7 -9
  730. package/src/tour/tour-catalogue.tsx +26 -15
  731. package/src/tour/tour-dock.ts +0 -2
  732. package/src/tour/tour-gates.ts +23 -0
  733. package/src/tour/tour-overlay.tsx +1170 -0
  734. package/src/tour/tour.tsx +108 -1202
  735. package/src/tour/use-tour-progress.ts +1 -1
  736. package/src/wizard/stepper-nav.tsx +3 -1
  737. package/src/wizard/types.ts +11 -2
  738. package/src/wizard/use-wizard.ts +2 -1
  739. package/src/wizard/validation.ts +8 -2
  740. package/tokens.css +2 -1
  741. package/dist/components/ui-labels.js.map +0 -1
  742. package/dist/shell/dev-switchers.d.ts +0 -6
  743. package/dist/shell/dev-switchers.js +0 -12
  744. package/dist/shell/dev-switchers.js.map +0 -1
  745. package/src/components/ui-labels.ts +0 -24
  746. package/src/shell/dev-switchers.tsx +0 -18
@@ -5,6 +5,7 @@ import { createPortal } from "react-dom";
5
5
  import { Check, Plus } from "lucide-react";
6
6
  import { cn } from "../lib/cn.js";
7
7
  import { CLIPS_ATTRIBUTE } from "../lib/clipping.js";
8
+ import { tabStops } from "../lib/focus-left.js";
8
9
  import { DropdownSearchHeader } from "./dropdown.js";
9
10
  import { PickerSheet, SHEET_ROW_CLASS } from "./picker-sheet.js";
10
11
  import { usePhoneLayout, useRemPx } from "../hooks/use-breakpoint.js";
@@ -179,6 +180,69 @@ function useComboboxCore({
179
180
  };
180
181
  }
181
182
  const GROUP_HEADING_STICKY = "sticky top-0 z-10 bg-surface";
183
+ function groupRuns(rows, groupOf) {
184
+ const runs = [];
185
+ rows.forEach((row, i) => {
186
+ const raw = groupOf(row);
187
+ const group = raw === void 0 || raw === null || raw === "" ? null : raw;
188
+ const last = runs[runs.length - 1];
189
+ if (last && last.group === group) last.rows.push(row);
190
+ else runs.push({ group, start: i, rows: [row] });
191
+ });
192
+ return runs;
193
+ }
194
+ function OptionGroup({
195
+ id,
196
+ heading,
197
+ className,
198
+ children
199
+ }) {
200
+ return /* @__PURE__ */ jsx("li", { role: "presentation", children: /* @__PURE__ */ jsxs("ul", { role: "group", "aria-labelledby": id, children: [
201
+ /* @__PURE__ */ jsx(
202
+ "li",
203
+ {
204
+ role: "presentation",
205
+ id,
206
+ className: cn(GROUP_HEADING_STICKY, "font-semibold uppercase tracking-wide text-muted", className),
207
+ children: heading
208
+ }
209
+ ),
210
+ children
211
+ ] }) });
212
+ }
213
+ function GroupedOptions({
214
+ runs,
215
+ listboxId,
216
+ rowKey,
217
+ row,
218
+ headingClassName
219
+ }) {
220
+ return keyRuns(runs).map(({ run, key }) => {
221
+ const grouped = run.group !== null;
222
+ const rows = run.rows.map((o, k) => /* @__PURE__ */ jsx(Fragment2, { children: row(o, run.start + k, grouped) }, rowKey(o)));
223
+ if (!grouped) return /* @__PURE__ */ jsx(Fragment2, { children: rows }, key);
224
+ return /* @__PURE__ */ jsx(
225
+ OptionGroup,
226
+ {
227
+ id: `${listboxId}-group-${run.start}`,
228
+ heading: run.group,
229
+ className: headingClassName(run),
230
+ children: rows
231
+ },
232
+ key
233
+ );
234
+ });
235
+ }
236
+ function keyRuns(runs) {
237
+ const seen = /* @__PURE__ */ new Map();
238
+ return runs.map((run) => {
239
+ const nth = seen.get(run.group) ?? 0;
240
+ seen.set(run.group, nth + 1);
241
+ return { run, key: run.group === null ? String(nth) : `${nth}:${run.group}` };
242
+ });
243
+ }
244
+ const anchoredHeadingClass = (run, first = true) => cn("px-3 pb-0.5 text-caption", run.start === 0 && first ? "pt-1" : "pt-2");
245
+ const SHEET_HEADING_CLASS = "px-4 pb-0.5 pt-3 text-caption";
182
246
  const SUGGESTION_LIST_CLASS = "max-h-64 overflow-y-auto rounded-md border border-subtle bg-surface py-1 shadow-lg";
183
247
  const suggestionRowClass = (isActive) => cn(
184
248
  "block w-full truncate-until-large px-3 py-1.5 text-start text-sm text-primary",
@@ -190,6 +254,25 @@ function useActiveOptionScroll(activeId) {
190
254
  document.getElementById(activeId)?.scrollIntoView?.({ block: "nearest" });
191
255
  }, [activeId]);
192
256
  }
257
+ function useTypedListStatus({
258
+ isPhone,
259
+ open,
260
+ inert,
261
+ rowCount,
262
+ extraRow,
263
+ query,
264
+ active,
265
+ optionId,
266
+ labels
267
+ }) {
268
+ const showing = !isPhone && open && !inert && (rowCount > 0 || extraRow);
269
+ const expanded = isPhone ? open && !inert : showing;
270
+ const activeOption = expanded && active >= 0 ? optionId(active) : void 0;
271
+ useActiveOptionScroll(activeOption);
272
+ const status = !open || inert ? null : rowCount > 0 ? labels.resultCount(rowCount) : query && !extraRow ? labels.noResults : null;
273
+ const statusRegion = /* @__PURE__ */ jsx("div", { role: "status", "aria-live": "polite", className: "sr-only", children: status });
274
+ return { showing, expanded, activeOption, statusRegion };
275
+ }
193
276
  const PANEL_MIN_REM = 13.75;
194
277
  const PANEL_EDGE = 8;
195
278
  function ComboboxPanel({
@@ -255,8 +338,36 @@ function ComboboxPanel({
255
338
  observer.observe(el);
256
339
  return () => observer.disconnect();
257
340
  }, [fit, placed, panelRef]);
341
+ const toolbarRef = useRef(null);
342
+ const toolbarStops = () => toolbarRef.current ? tabStops(toolbarRef.current, { includeSelf: false }) : [];
343
+ const toolbarBox = hasContent(toolbar) && // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- never focused itself: it only keeps a pointer press on its buttons from taking the focus out of the search box.
344
+ /* @__PURE__ */ jsx(
345
+ "div",
346
+ {
347
+ ref: toolbarRef,
348
+ onMouseDown: (e) => {
349
+ if (!e.target.closest("input, select, textarea, [contenteditable]")) e.preventDefault();
350
+ },
351
+ children: toolbar
352
+ }
353
+ );
354
+ const tabInToolbar = (e) => {
355
+ const stops = toolbarStops();
356
+ const at2 = stops.indexOf(e.target);
357
+ if (e.shiftKey && at2 === 0) {
358
+ e.preventDefault();
359
+ inputRef.current?.focus();
360
+ } else if (!e.shiftKey && at2 === stops.length - 1) {
361
+ e.preventDefault();
362
+ closeToTrigger();
363
+ }
364
+ };
258
365
  const onKeyDown = (e) => {
259
366
  if (takeEscape(e)) return;
367
+ if (toolbarRef.current?.contains(e.target)) {
368
+ if (e.key === "Tab" && !isPhone) tabInToolbar(e);
369
+ return;
370
+ }
260
371
  if (isImeEnter(e)) return;
261
372
  if (e.key === "ArrowDown") {
262
373
  e.preventDefault();
@@ -277,7 +388,9 @@ function ComboboxPanel({
277
388
  else if (showCreate && !createLocked) onCreate();
278
389
  } else if (e.key === "Tab" && !isPhone) {
279
390
  e.preventDefault();
280
- closeToTrigger();
391
+ const first = e.shiftKey ? void 0 : toolbarStops()[0];
392
+ if (first) first.focus();
393
+ else closeToTrigger();
281
394
  }
282
395
  };
283
396
  const message = busy && results.length === 0 ? (
@@ -398,15 +511,7 @@ function ComboboxPanel({
398
511
  ]
399
512
  }
400
513
  ) });
401
- const blocks = [];
402
- if (columns && !isPhone) {
403
- results.forEach((o, i) => {
404
- const group = o.group ?? "";
405
- const last = blocks[blocks.length - 1];
406
- if (last && last.group === group) last.rows.push({ o, i });
407
- else blocks.push({ group, rows: [{ o, i }] });
408
- });
409
- }
514
+ const runs = groupRuns(results, (o) => o.group);
410
515
  const list = /* @__PURE__ */ jsxs(
411
516
  "ul",
412
517
  {
@@ -421,37 +526,32 @@ function ComboboxPanel({
421
526
  isPhone && "flex-none"
422
527
  ),
423
528
  children: [
424
- columns && !isPhone ? blocks.map((block) => (
529
+ columns && !isPhone ? keyRuns(runs).map(({ run, key }) => (
425
530
  // A column block: its heading is a picture of the group's name, which the
426
531
  // `role="group"` carries for a reader — the listbox may own options and
427
- // groups, and a heading of loose text in it is neither.
532
+ // groups, and a heading of loose text in it is neither. Keyed as
533
+ // GroupedOptions keys a run, so a filter does not rebuild the later columns.
428
534
  /* @__PURE__ */ jsxs("li", { role: "presentation", className: "mb-3 break-inside-avoid", children: [
429
- block.group && /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted", children: block.group }),
430
- /* @__PURE__ */ jsx("ul", { role: "group", "aria-label": block.group || void 0, className: "space-y-0.5", children: block.rows.map(({ o, i }) => /* @__PURE__ */ jsx(Fragment2, { children: optionRow(o, i) }, `${o.group ?? ""}|${String(o.value)}`)) })
431
- ] }, `${block.group}|${block.rows[0].i}`)
432
- )) : results.map((o, i) => {
433
- const startsGroup = o.group != null && o.group !== results[i - 1]?.group;
434
- return (
435
- // Keyed by group AND value: an option may deliberately appear twice —
436
- // Keksdose repeats recently-used categories in a "Recent" group at the
437
- // top (live #203) — and a bare value key would collide.
438
- /* @__PURE__ */ jsxs(Fragment2, { children: [
439
- startsGroup && /* @__PURE__ */ jsx(
440
- "li",
441
- {
442
- role: "presentation",
443
- className: cn(
444
- GROUP_HEADING_STICKY,
445
- "font-semibold uppercase tracking-wide text-muted",
446
- isPhone ? "px-4 pb-1 pt-3 text-xs" : "px-3 pb-0.5 pt-2 text-caption first:pt-1"
447
- ),
448
- children: o.group
449
- }
450
- ),
451
- optionRow(o, i)
452
- ] }, `${o.group ?? ""}|${String(o.value)}`)
453
- );
454
- }),
535
+ run.group !== null && /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted", children: run.group }),
536
+ /* @__PURE__ */ jsx("ul", { role: "group", "aria-label": run.group ?? void 0, className: "space-y-0.5", children: run.rows.map((o, k) => /* @__PURE__ */ jsx(Fragment2, { children: optionRow(o, run.start + k) }, String(o.value))) })
537
+ ] }, key)
538
+ )) : (
539
+ // One heading per group rather than a grey suffix on every row (#136), and the
540
+ // thing the native <select>'s <optgroup> used to give the account picker for
541
+ // free (live #200) — a `role="group"` it names (INP-8). Keksdose repeats
542
+ // recently-used categories in a "Recent" group at the top (live #203): a value
543
+ // is a row's key within its group alone.
544
+ /* @__PURE__ */ jsx(
545
+ GroupedOptions,
546
+ {
547
+ runs,
548
+ listboxId,
549
+ rowKey: (o) => String(o.value),
550
+ row: optionRow,
551
+ headingClassName: (run) => isPhone ? "px-4 pb-1 pt-3 text-xs" : anchoredHeadingClass(run)
552
+ }
553
+ )
554
+ ),
455
555
  createRow
456
556
  ]
457
557
  }
@@ -465,7 +565,7 @@ function ComboboxPanel({
465
565
  className,
466
566
  style,
467
567
  open: true,
468
- onClose: () => core.setOpen(false),
568
+ onClose: closeToTrigger,
469
569
  title: sheetTitle,
470
570
  query,
471
571
  onQueryChange: setQuery,
@@ -478,7 +578,7 @@ function ComboboxPanel({
478
578
  activeId,
479
579
  done: multi,
480
580
  children: [
481
- toolbar,
581
+ toolbarBox,
482
582
  /* @__PURE__ */ jsxs("div", { className: "relative", children: [
483
583
  list,
484
584
  announcement
@@ -535,7 +635,7 @@ function ComboboxPanel({
535
635
  activeId
536
636
  }
537
637
  ),
538
- toolbar,
638
+ toolbarBox,
539
639
  list,
540
640
  announcement
541
641
  ]
@@ -549,8 +649,13 @@ export {
549
649
  ComboboxPanel,
550
650
  DISABLED_ROW_CLASS,
551
651
  GROUP_HEADING_STICKY,
652
+ GroupedOptions,
653
+ OptionGroup,
654
+ SHEET_HEADING_CLASS,
552
655
  SUGGESTION_LIST_CLASS,
656
+ anchoredHeadingClass,
553
657
  endHintRowProps,
658
+ groupRuns,
554
659
  isOptionEnabled,
555
660
  offersCreate,
556
661
  settleEnabled,
@@ -558,6 +663,7 @@ export {
558
663
  suggestionRowClass,
559
664
  useActiveOptionScroll,
560
665
  useComboboxCore,
561
- useOptionSource
666
+ useOptionSource,
667
+ useTypedListStatus
562
668
  };
563
669
  //# sourceMappingURL=combobox-core.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/combobox-core.tsx"],"sourcesContent":["import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport type {\n ComponentPropsWithoutRef,\n Dispatch,\n KeyboardEvent as ReactKeyboardEvent,\n ReactNode,\n RefObject,\n SetStateAction,\n} from \"react\";\nimport { Check, Plus } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { CLIPS_ATTRIBUTE } from \"../lib/clipping\";\nimport { DropdownSearchHeader } from \"./dropdown\";\nimport { PickerSheet, SHEET_ROW_CLASS } from \"./picker-sheet\";\nimport { usePhoneLayout, useRemPx } from \"../hooks/use-breakpoint\";\nimport { FLOATING_LABEL_STATIC } from \"./field-parts\";\nimport { Spinner } from \"./spinner\";\nimport { useAnchorDir } from \"./use-anchor-dir\";\nimport { type AnchorRect } from \"../hooks/use-anchored-rect\";\nimport { anchoredInline, useAnchoredPanel, viewportSize, type AnchoredPanel } from \"../hooks/use-anchored-panel\";\nimport { pressInside, takeEscape, useDismissLayer, useOutsideClick } from \"../hooks/use-dismiss\";\nimport { useOverlayHistory } from \"../hooks/use-overlay-history\";\nimport { isImeEnter } from \"../lib/ime\";\nimport { matchesSearch, sameName, searchWords } from \"../lib/text-match\";\nimport { DEFAULT_COMBOBOX_LABELS, useKitLabels, useKitLocale } from \"../i18n/kit-labels\";\nimport { hasContent } from \"../lib/presence\";\n\n/**\n * What an entity picker hands `onChange` when it is cleared — `clearValue` on\n * {@link EntityCombobox} and {@link InlineEntityCombobox}. `null` by default.\n *\n * A closed set rather than any value, on purpose: every member is something no\n * option can be (an option's value is a `string | number`, and `\"\"` is never a real\n * id), so the picker can also READ it back — a field whose `value` is the clear\n * value shows as empty, with no clear button, exactly as `null` does. An arbitrary\n * sentinel could collide with an id and would make that read ambiguous.\n *\n * No `undefined`: a prop set to `undefined` is a prop not passed, so it would read as\n * the default and emit `null` — the one outcome the caller had asked not to get.\n */\nexport type ComboClearValue = null | \"\";\n\nexport interface ComboOption<V extends string | number> {\n value: V;\n label: string;\n sublabel?: string;\n icon?: ReactNode;\n /**\n * Section this option belongs to. Where a consumer renders it as a heading with the\n * members indented beneath — {@link InlineEntityCombobox} does — this is a genuine\n * grouping, not decoration: the name appears once per section rather than trailing\n * every row in small grey type, which is barely legible on a phone (feedback #136).\n * The heading stays at the top of the list while its rows scroll beneath it.\n *\n * NOT searched (0.40, kk run 79): a group is where a row is filed, not what it is\n * called — with first-letter groups (\"A\", \"B\", … \"#\"), typing \"a\" matched every row\n * filed under A. Searching a category's name means putting it in `sublabel`.\n */\n group?: string;\n /**\n * Shown but not takeable: rendered dimmed with `aria-disabled`, passed over by the\n * arrow keys, and a click or Enter on it does nothing. For a row whose existence is\n * the information — a write-locked result, an account that is closed — where\n * leaving it out would read as \"there is no such thing\". Say WHY in `sublabel`: a\n * hover tooltip is the one explanation a phone cannot show.\n *\n * Honoured by {@link Autocomplete}, {@link InlineEntityCombobox} and the panel\n * pickers ({@link EntityCombobox}, {@link MultiEntityCombobox}); on those an already\n * chosen disabled option stays chosen — the row only refuses to be toggled.\n */\n disabled?: boolean;\n}\n\n/** A row the user may take — present and not {@link ComboOption.disabled}. */\nexport const isOptionEnabled = (o: { disabled?: boolean } | undefined): boolean => o !== undefined && !o.disabled;\n\n/**\n * The next takeable row from `from`, stepping `dir` — what the arrow keys use so a\n * disabled row is passed over, as the APG allows. Stays on `from` at the end of the\n * list (the family's arrows clamp rather than wrap) and answers `-1` when `from` is\n * not a row and there is nothing to step to.\n */\nexport function stepEnabled(rows: readonly { disabled?: boolean }[], from: number, dir: 1 | -1): number {\n for (let i = from + dir; i >= 0 && i < rows.length; i += dir) {\n if (!rows[i].disabled) return i;\n }\n return from >= 0 && from < rows.length ? from : -1;\n}\n\n/** `i` when that row is takeable, else the nearest takeable one after it, else\n * before it, else `-1`. For a highlight that starts on a fixed index (the panel\n * pickers open on row 0) and must never rest on a disabled row. */\nexport function settleEnabled(rows: readonly { disabled?: boolean }[], i: number): number {\n if (i < 0 || i >= rows.length) return -1;\n if (!rows[i].disabled) return i;\n const after = stepEnabled(rows, i, 1);\n if (after !== i) return after;\n const before = stepEnabled(rows, i, -1);\n return before !== i ? before : -1;\n}\n\n/** Classes a disabled row adds over its normal ones — dimmed, no hover, the\n * kit's soft-disabled look (`DangerConfirm`, `SignaturePad`). */\nexport const DISABLED_ROW_CLASS = \"cursor-not-allowed opacity-50 hover:bg-transparent\";\n\n/**\n * Whether an entity picker offers its create row — one rule for\n * {@link EntityCombobox}, {@link MultiEntityCombobox} and {@link InlineEntityCombobox}.\n *\n * With a query: while the trimmed query names no option exactly — an exact hit is a\n * record the list is already showing, and a second way to \"make\" it would mint a\n * duplicate. \"Exactly\" as the list matches, folded by `locale` ({@link sameName}): with\n * plain `toLowerCase`, \"cafe\" listed Café and offered \"Create “cafe”\" beside it (refactor\n * audit 2026-10-30, DUP-5). With NO query: only when the caller named the row for that\n * case (`createEmptyLabel`) — a row reading `Create “”` says nothing, and the kit cannot\n * know the noun (\"Create cash account\") that would make it say something (keksdose G9).\n *\n * `names` is what the query is compared against: the loaded rows for a panel picker\n * (its async list is all it knows), every option for the inline one. `locale`: the\n * provider's, which the list's match folds by; left out, the runtime's.\n */\nexport function offersCreate(\n onCreate: unknown,\n query: string,\n names: readonly string[],\n createEmptyLabel: string | undefined,\n locale?: string,\n): boolean {\n if (!onCreate) return false;\n if (!query) return Boolean(createEmptyLabel);\n return !names.some((n) => sameName(n, query, locale));\n}\n\n/**\n * {@link EndHintRow}'s `hint` and `className` for a combobox-family field, keeping the\n * 0.22 rule (keksdose): a field that was passed `hint` at all — even `undefined` — keeps\n * ONE box, so a hint coming and going never rebuilds the control under the cursor.\n *\n * A text hint is a caption after the control and never moved it; the case this covers\n * is the \"?\" (a {@link FieldHint}) on a field with no label line, which sits at the end\n * edge in a row of its own. Without this the row existed only while the \"?\" did, and\n * the control was re-parented — remounted, focus and caret lost — each time it came or\n * went. With `hint` passed the row stays, its end slot empty and its gap closed, so\n * nothing on screen moves either.\n */\nexport function endHintRowProps(\n hintPassed: boolean,\n hasLabel: boolean,\n labelHint: ReactNode | undefined,\n): { hint: ReactNode | undefined; className?: string } {\n if (hasLabel) return { hint: undefined };\n if (labelHint !== undefined) return { hint: labelHint };\n return hintPassed ? { hint: null, className: \"gap-0\" } : { hint: undefined };\n}\n\n/**\n * The family's floating label, as a real `<label for>` (lenkbank): the input is then\n * named the way {@link Input}'s is, so `getByLabelText` and any helper that walks\n * `<label htmlFor>` finds it. Same placement and type as {@link FieldLabel}, which\n * stays a `<span>` for the TRIGGER pickers — a `<button>` is labelable, but those\n * compose their own \"label: value\" name. `pointer-events-none` (from the class)\n * keeps a press on it landing on the field under it, as before.\n */\nexport function ComboboxFieldLabel({\n htmlFor,\n className,\n children,\n ...rest\n}: ComponentPropsWithoutRef<\"label\"> & { htmlFor: string }) {\n return (\n <label {...rest} htmlFor={htmlFor} className={cn(FLOATING_LABEL_STATIC, \"z-10\", className)}>\n {children}\n </label>\n );\n}\n\n/**\n * Where a combobox's rows come from, and how a query narrows them. Shared by the\n * trigger pickers ({@link useComboboxCore}) and the inline {@link Autocomplete}, so\n * the two cannot drift in what a failed lookup or a too-short query does.\n */\nexport interface OptionSourceOptions<V extends string | number> {\n /** Already-loaded options (client-side filtered unless `filter` is false), also\n * used to resolve labels. */\n options?: ComboOption<V>[];\n /** Async option source, debounced and race-safe; stale responses are ignored,\n * and a rejection is caught and reported as `failed`. */\n loadOptions?: (query: string) => Promise<ComboOption<V>[]>;\n /** External loading flag, OR-ed with the internal async state. */\n loading?: boolean;\n /**\n * Narrow `options` by the query (label/sublabel substring, folded for search: no case,\n * no accents, the locale's case rules — \"zurich\" finds Zürich, DUP-5). Default `true`.\n *\n * `false` shows `options` exactly as given, in the given order — for a list the\n * caller has already searched and ranked on a server (Keksdose's geocoder), which a\n * second, client-side substring filter could only get wrong: a provider that\n * matches \"Bahnhofstr.\" to \"Bahnhofstrasse\" is right, and a label filter would\n * throw that row away.\n */\n filter?: boolean;\n /**\n * Below this many (trimmed) characters nothing is offered and `loadOptions` is not\n * called. Default `0` — the pickers list everything on open. Set it for a source\n * that is costly or rate-limited: one letter against a geocoder matches half a\n * continent, and a request per opened panel is a request nobody asked for.\n */\n minChars?: number;\n /** Quiet time after the last keystroke before `loadOptions` runs. Default 150 ms. */\n debounceMs?: number;\n}\n\nexport interface OptionSource<V extends string | number> {\n results: ComboOption<V>[];\n busy: boolean;\n /** The last lookup for this query REJECTED. The rows are emptied with it: results\n * from an earlier query under a failed one would read as the answer to it. */\n failed: boolean;\n /** The query is shorter than `minChars`, so nothing was asked. */\n tooShort: boolean;\n}\n\n/**\n * The rows half of a combobox: client-side filtering, or a debounced, race-safe\n * `loadOptions` with its loading and failure states.\n *\n * `active` gates the async side — a closed list asks nothing. Loading is DERIVED\n * (\"the settled answer is for a different query\") rather than flagged on in the\n * effect, so there is no render between a keystroke and the debounce in which an\n * empty list could claim \"No results\" for a question still being asked.\n */\nexport function useOptionSource<V extends string | number>({\n options,\n loadOptions,\n loading,\n filter = true,\n minChars = 0,\n debounceMs = 150,\n query,\n active,\n}: OptionSourceOptions<V> & { query: string; active: boolean }): OptionSource<V> {\n const isAsync = typeof loadOptions === \"function\";\n const tooShort = query.trim().length < minChars;\n const [settled, setSettled] = useState<{\n query: string | null;\n results: ComboOption<V>[];\n failed: boolean;\n }>({ query: null, results: [], failed: false });\n const loadRef = useRef(loadOptions);\n useEffect(() => {\n loadRef.current = loadOptions;\n });\n const reqId = useRef(0);\n\n useEffect(() => {\n // Bumped even when nothing is asked, so a request still in flight from a longer\n // query cannot land after the user has deleted back below `minChars`.\n const id = ++reqId.current;\n if (!active || !isAsync || tooShort) return;\n const t = setTimeout(\n async () => {\n try {\n const r = await loadRef.current!(query);\n if (reqId.current === id) setSettled({ query, results: r, failed: false });\n } catch {\n // The one path the old `try/finally` had no answer for: the list kept the\n // previous query's rows and said nothing (Keksdose proposal §2).\n if (reqId.current === id) setSettled({ query, results: [], failed: true });\n }\n },\n query ? debounceMs : 0,\n );\n return () => clearTimeout(t);\n }, [query, active, isAsync, tooShort, debounceMs]);\n\n // Folded as every kit list folds (DUP-5, refactor audit 2026-10): plain `toLowerCase`\n // here meant \"zurich\" found no Zürich in kastlan's eighteen entity pickers, and the\n // Turkish \"ı\" no \"IRMAK\".\n const locale = useKitLocale();\n const clientResults = useMemo(() => {\n if (isAsync) return [];\n const src = options ?? [];\n // Every word of the query, in the label or the sublabel (0.51.4): \"migros zürich\".\n const words = searchWords(query, locale);\n if (!filter || words.length === 0) return src;\n return src.filter((o) => matchesSearch(words, [o.label, o.sublabel], locale));\n }, [isAsync, options, query, filter, locale]);\n\n const pending = isAsync && active && !tooShort && settled.query !== query;\n const failed = isAsync && !tooShort && settled.failed;\n return {\n results: tooShort ? [] : isAsync ? (failed ? [] : settled.results) : clientResults,\n busy: Boolean(loading) || pending,\n failed: failed && !pending,\n tooShort,\n };\n}\n\nexport interface ComboboxCoreOptions<V extends string | number> extends OptionSourceOptions<V> {\n /**\n * Back closes the open anchored list, not the page or the dialog behind it — the rule\n * `useDropdown` keeps for its lists (keksdose live #309 rework). Default `false`, as the\n * entity pickers have always been; CurrencySelect, MultiSelect, GroupedPicker and\n * AmountInput's currency chip, which came over from `useDropdown` (DUP-4), pass `true`\n * so they keep it. On a phone the `PickerSheet` registers Back itself.\n */\n backCloses?: boolean;\n}\n\nexport interface ComboboxCore<V extends string | number> {\n triggerRef: RefObject<HTMLButtonElement | null>;\n panelRef: RefObject<HTMLDivElement | null>;\n inputRef: RefObject<HTMLInputElement | null>;\n open: boolean;\n setOpen: Dispatch<SetStateAction<boolean>>;\n query: string;\n setQuery: Dispatch<SetStateAction<string>>;\n active: number;\n setActive: Dispatch<SetStateAction<number>>;\n results: ComboOption<V>[];\n busy: boolean;\n /** See {@link OptionSource}. */\n failed: boolean;\n tooShort: boolean;\n minChars: number;\n rect: AnchorRect | null;\n /** Where the dropdown goes, clamped to the visible viewport (feedback #135). */\n placement: AnchoredPanel;\n /** Put an option in the label cache, so {@link ComboboxCore.resolve} still knows a\n * value the caller just chose after the result list has moved on. */\n rememberOption: (o: ComboOption<V>) => void;\n resolve: (v: V) => ComboOption<V> | null;\n /** Close and hand focus back to the trigger — the keyboard paths only. See\n * {@link useDropdown} for why a pointer dismissal must not do this. */\n closeToTrigger: () => void;\n}\n\n/**\n * Shared plumbing for the entity pickers: open/query/active state, portalled\n * anchoring + outside-click/Escape dismissal, focus-on-open, a debounced\n * race-safe async (or client-side) result list, and a label cache so a selected\n * value still renders its label after the async list has moved on. The single-\n * and multi-value comboboxes render their triggers on top of this and share\n * {@link ComboboxPanel} for the dropdown.\n */\nexport function useComboboxCore<V extends string | number>({\n options,\n minChars = 0,\n backCloses = false,\n ...source\n}: ComboboxCoreOptions<V>): ComboboxCore<V> {\n const triggerRef = useRef<HTMLButtonElement>(null);\n const panelRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState(\"\");\n const [active, setActive] = useState(0);\n\n const close = () => setOpen(false);\n // Escape unmounts the panel the user is typing in; without this the browser drops\n // focus on <body>, so the caret disappears and the next Tab restarts at the top of\n // the page. A pointer dismissal deliberately does NOT do this — the press has\n // already decided where focus belongs.\n const closeToTrigger = () => {\n setOpen(false);\n triggerRef.current?.focus();\n };\n // Placement, not just the anchor rect: the panel has to dodge the on-screen\n // keyboard its own search box summons (feedback #135).\n const placement = useAnchoredPanel(triggerRef, open);\n const rect = placement.rect;\n // Outside-click dismissal belongs to the ANCHORED panel, and only to it. On a\n // phone `ComboboxPanel` renders a full-screen `PickerSheet` instead (live #200),\n // portalled to <body> and carrying its own ways out — the close X, Escape, and\n // Back through `useOverlayHistory` — so there is no outside left to press.\n //\n // Leaving the listener on there was not merely redundant, it was the bug:\n // `panelRef` is attached to the desktop panel alone, so with the sheet up every\n // press inside it answered \"outside\". While `useOutsideClick` listened for\n // `mousedown` the rows survived by accident — they commit on `onMouseDown` too,\n // and won the race — but `pointerdown` PRECEDES `mousedown`, so the sheet closed\n // at finger-down and the commit landed on an unmounted tree: a tapped row kept the\n // old value, and tapping the search box or the X was equally fatal. `PickerSheet`\n // stops `mousedown` for exactly this reason, but that guard was written for\n // `useDropdown`'s listener and never covered this hook.\n const isPhone = usePhoneLayout();\n useOutsideClick([triggerRef, panelRef], close, open && !isPhone);\n // A layer on the Escape stack while the anchored panel is open (Wave 2, DUP-1), so a\n // dialog around the picker closes only after it (BUG-1). `ComboboxPanel` takes the key\n // where focus is. On a phone the `PickerSheet` is the layer, as it is the outside.\n useDismissLayer(open && !isPhone, closeToTrigger);\n // See `backCloses`. The same close path a pointer dismissal takes.\n useOverlayHistory(backCloses && open && !isPhone, close);\n\n // Reset the query each time the panel opens, and the highlighted row whenever the\n // visible set changes (a new query, or the panel opening or closing). Adjusted while\n // rendering against the previous values rather than in an effect, so the render that\n // opens the panel already searches for \"\" and highlights the first row.\n const [prevOpen, setPrevOpen] = useState(open);\n const [prevQuery, setPrevQuery] = useState(query);\n if (open !== prevOpen || query !== prevQuery) {\n const opened = open && !prevOpen;\n setPrevOpen(open);\n setPrevQuery(opened ? \"\" : query);\n if (opened) setQuery(\"\");\n setActive(0);\n }\n\n // Focus the search box each time the panel opens.\n useEffect(() => {\n if (!open) return;\n const id = requestAnimationFrame(() => inputRef.current?.focus());\n return () => cancelAnimationFrame(id);\n }, [open]);\n\n // Debounced, race-safe async search (only when loadOptions is provided) or the\n // client-side filter — see {@link useOptionSource}.\n const { results, busy, failed, tooShort } = useOptionSource<V>({\n ...source,\n options,\n minChars,\n query,\n active: open,\n });\n\n // Accumulate every option we've seen so a selected value can render its label\n // even after the async list has moved on to other query results.\n const cacheRef = useRef(new Map<V, ComboOption<V>>());\n useEffect(() => {\n for (const o of options ?? []) cacheRef.current.set(o.value, o);\n for (const o of results) cacheRef.current.set(o.value, o);\n }, [options, results]);\n const resolve = (v: V): ComboOption<V> | null =>\n options?.find((o) => o.value === v) ?? cacheRef.current.get(v) ?? null;\n const rememberOption = (o: ComboOption<V>) => {\n cacheRef.current.set(o.value, o);\n };\n\n return {\n triggerRef,\n panelRef,\n inputRef,\n open,\n setOpen,\n query,\n setQuery,\n active,\n setActive,\n results,\n busy,\n failed,\n tooShort,\n minChars,\n rect,\n placement,\n rememberOption,\n resolve,\n closeToTrigger,\n };\n}\n\n// The family's `error` is every field's `useFieldError` (field-parts) since 0.34 — the\n// restatement that stood here ignored a form library's `aria-invalid` (DUP-8).\n\n/** The anchored suggestion list's box and rows — one look for {@link Combobox},\n * {@link InlineEntityCombobox} and {@link Autocomplete}. */\n/**\n * A group's heading in a picker list stays at the top of the list while its rows scroll\n * under it (kk run 79 gap 3): with first-letter groups over two hundred payees, the\n * heading is the one thing that says where in the alphabet the thumb is. Opaque — the\n * list's own `bg-surface` — so the rows pass beneath it rather than through it. Shared\n * by every list that heads groups (the panel and the sheet, `Combobox`, `Autocomplete`,\n * `InlineEntityCombobox`).\n */\nexport const GROUP_HEADING_STICKY = \"sticky top-0 z-10 bg-surface\";\n\nexport const SUGGESTION_LIST_CLASS =\n \"max-h-64 overflow-y-auto rounded-md border border-subtle bg-surface py-1 shadow-lg\";\n\n// One line at Normal; from Large up a long suggestion wraps and its row grows (text size\n// §10.17, round 0.34 T1), like every other option list of the kit.\nexport const suggestionRowClass = (isActive: boolean) =>\n cn(\n \"block w-full truncate-until-large px-3 py-1.5 text-start text-sm text-primary\",\n isActive ? \"bg-active\" : \"hover:bg-hover\",\n );\n\n/**\n * Keep the option the keyboard is on inside the visible part of the list.\n *\n * `aria-activedescendant` moves a highlight WITHOUT moving focus, which is the whole\n * point of it — and the cost is that the browser scrolls nothing on its own. In a\n * panel capped at a few hundred pixels over an account list two hundred long, Down\n * walked the highlight straight out of the box and the list sat still.\n *\n * Optional-called because jsdom does not implement `scrollIntoView`: three consumers\n * run this component in their own suites, and a picker that throws there is a worse\n * trade than a list that does not scroll in a test.\n */\nexport function useActiveOptionScroll(activeId: string | undefined): void {\n useEffect(() => {\n if (!activeId) return;\n document.getElementById(activeId)?.scrollIntoView?.({ block: \"nearest\" });\n }, [activeId]);\n}\n\n/** The anchored panel's least width, in rem: 220 px at Normal (§3.2). */\nconst PANEL_MIN_REM = 13.75;\n\n/** The room the anchored panel keeps from either edge of the glass, in px —\n * `anchoredInline`'s default. */\nconst PANEL_EDGE = 8;\n\n/**\n * How wide the anchored panel is. The phone sheet is the screen's width whatever this\n * says.\n */\nexport interface ComboboxPanelWidth {\n /** The least width, in rem — never under the trigger's own. Default 13.75 (220 px at\n * Normal, §3.2). */\n minRem?: number;\n /**\n * As wide as the rows make it (`max-content`), between the least width and `maxRem`,\n * instead of exactly the least — measured, so the clamp to the glass still knows it.\n * CurrencySelect's list grows to show the full currency names (feedback #308);\n * MultiSelect's rows to show their hints (keksdose #147). A `w-*` class in the panel's\n * `className` does not apply: the panel is portalled to <body>, where `w-full` would be\n * the screen.\n */\n fit?: boolean;\n /** With `fit`, the most it grows to, in rem. Default: the glass. */\n maxRem?: number;\n}\n\nexport interface ComboboxPanelProps<V extends string | number> extends ComponentPropsWithoutRef<\"div\"> {\n core: ComboboxCore<V>;\n /** What the trigger's `aria-controls` names. Owned by the component that renders\n * the trigger, not by the core: one id has to reach both, and only one of them\n * can be the origin. */\n listboxId: string;\n /** Default: `combobox.search` from the {@link UiKitProvider}, else English. */\n searchPlaceholder?: string;\n /** Default: `combobox.noResults` from the {@link UiKitProvider}, else English. */\n emptyLabel?: string;\n multi?: boolean;\n isSelected: (v: V) => boolean;\n onChoose: (o: ComboOption<V>) => void;\n showCreate: boolean;\n onCreate: () => void;\n createContent: ReactNode;\n /**\n * The create row is shown but not takeable, and this says why — the lock's reason\n * when the picker's `createCommit` meets a locked {@link WriteLockProvider}. Rendered\n * as the row's second line rather than a tooltip, as {@link ComboOption.disabled}\n * asks of every disabled row: a hover is the one explanation a phone cannot show.\n */\n createDisabledReason?: ReactNode;\n /** What the sheet calls itself on a phone — the field's label. Ignored on\n * desktop, where the panel sits under the field that already says it. */\n sheetTitle?: ReactNode;\n closeLabel?: string;\n /** Default: `combobox.loadError` from the {@link UiKitProvider}, else English. */\n loadErrorLabel?: string;\n /**\n * What a row shows in place of its label and sublabel — for a row that says more than\n * two strings: CurrencySelect's symbol, code and name side by side. The option's\n * `icon`, the multi checkbox and the check mark stay the panel's. Its text is the\n * option's accessible name, so separate the parts with a space.\n */\n renderOption?: (o: ComboOption<V>) => ReactNode;\n /** Controls between the search box and the list, in the anchored panel and the phone\n * sheet alike — MultiSelect's \"Select all\" and \"Clear\". */\n toolbar?: ReactNode;\n /** See {@link ComboboxPanelWidth}. */\n width?: ComboboxPanelWidth;\n /** Which of the trigger's edges the anchored panel hangs from, by reading direction.\n * Default `start`; `end` grows the panel toward the start, so a field with content\n * after it is not pushed past the page (CurrencySelect, feedback #308). */\n align?: \"start\" | \"end\";\n /**\n * Lay the rows out in columns, one block per `group`, with the group's name above it —\n * GroupedPicker's panel (feedback #267/#276): a large grouped set reads as a sheet of\n * short lists side by side rather than one long one. Each block is a `role=\"group\"`\n * named by its heading. The arrow keys walk the rows in reading order, down each\n * column. The phone sheet keeps one column with headings.\n */\n columns?: boolean;\n}\n\n/**\n * The portalled dropdown (search header + result rows + optional create row)\n * shared by the single- and multi-value comboboxes. Start-aligned to the trigger\n * and sized to its width; `multi` swaps the trailing check for a leading\n * checkbox. `onChoose` decides whether to close (single) or stay open (multi).\n *\n * ## The ARIA, which is `CommandPalette`'s\n *\n * This rendered a `role=\"listbox\"` of `role=\"option\"` rows and stopped there, so a\n * reader was handed a text box and silence: the highlight the arrow keys move lived\n * only in a background colour, and nothing tied the box being typed in to the list\n * being filtered. `CommandPalette` has had the whole model since it was written —\n * `aria-controls` from the field to the list, `aria-activedescendant` naming the row\n * the keyboard is on — and it was the only thing in the package that did.\n *\n * Two distinct states, deliberately not conflated:\n * - `aria-selected` is CHOSEN. It is the check mark, and in `multi` the checkbox.\n * - `aria-activedescendant` is where the KEYBOARD is. Announcing that as selected\n * would tell a reader that the row they are merely passing over is the answer.\n *\n * `role=\"option\"` sits on the `<button>`, not on the `<li>` around it, for the same\n * reason it does in `CommandPalette`: an option may not contain a separately\n * focusable control, and the button is the thing a pointer presses. The rows are\n * `tabIndex={-1}` because focus never leaves the search box — that is what\n * `aria-activedescendant` is FOR.\n */\nexport function ComboboxPanel<V extends string | number>({\n core,\n listboxId,\n searchPlaceholder,\n emptyLabel,\n multi,\n isSelected,\n onChoose,\n showCreate,\n onCreate,\n createContent,\n createDisabledReason,\n sheetTitle,\n closeLabel,\n loadErrorLabel,\n renderOption,\n toolbar,\n width,\n align = \"start\",\n columns,\n className,\n style,\n ...rest\n}: ComboboxPanelProps<V>) {\n const createLocked = hasContent(createDisabledReason);\n const {\n rect,\n placement,\n panelRef,\n inputRef,\n query,\n setQuery,\n results,\n busy,\n failed,\n tooShort,\n active,\n setActive,\n closeToTrigger,\n } = core;\n // The phone gets a full-screen sheet instead of an anchored panel (live #200).\n // Same core, same results, same handlers — only the container differs, so the\n // two presentations cannot drift in what they offer.\n const isPhone = usePhoneLayout();\n // Every row the keyboard can land on, the create row included — passed over, like a\n // disabled option, while a write lock holds it.\n const rows: readonly { disabled?: boolean }[] = showCreate ? [...results, { disabled: createLocked }] : results;\n const rowCount = rows.length;\n const optionId = (index: number) => `${listboxId}-option-${index}`;\n // The core opens on row 0 and knows nothing of `disabled`; the highlight is settled\n // HERE, derived, so it can never rest on a row that cannot be taken — whatever the\n // async list turned out to hold.\n const current = settleEnabled(rows, active);\n const activeId = current >= 0 ? optionId(current) : undefined;\n useActiveOptionScroll(activeId);\n // The consumers resolve their own props against the provider already; this is\n // for the loading row, which no consumer names, and for a caller that renders the\n // panel directly and leaves the two optional strings out.\n const labels = useKitLabels(\"combobox\", DEFAULT_COMBOBOX_LABELS);\n // Portalled to <body>, the panel leaves the subtree its `dir` came from — so the\n // direction is read off the trigger and put back on the panel below.\n const dir = useAnchorDir(core.triggerRef, core.open);\n const remPx = useRemPx();\n // A `fit` panel's measured width — what it takes to keep it on the glass (see\n // `ComboboxPanelWidth.fit`). Observed rather than read once: the rows change under the\n // search, and a filtered list of short names is a narrower panel. `null` where nothing\n // is laid out (jsdom), and the least width is used.\n const fit = width?.fit === true && !isPhone;\n const [fitWidth, setFitWidth] = useState<number | null>(null);\n const placed = core.open && rect !== null;\n useLayoutEffect(() => {\n const el = panelRef.current;\n if (!fit || !placed || !el || typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(() => {\n const measured = el.getBoundingClientRect().width;\n setFitWidth(measured > 0 ? measured : null);\n });\n observer.observe(el);\n return () => observer.disconnect();\n }, [fit, placed, panelRef]);\n\n // The WAI-ARIA APG's listbox keyboard, in full: Up/Down step, Home/End jump, Enter\n // commits, Tab leaves, Escape closes. On the panel's search box — in the anchored\n // panel and, through `onSearchKeyDown`, in the phone sheet's header (BUG-5).\n const onKeyDown = (e: ReactKeyboardEvent) => {\n // Escape goes to the top of the kit's Escape stack — this list, which opened over\n // any dialog it sits in — and stops HERE (round 0.34 BUG-1, Wave 2 DUP-1). The\n // panel's events travel up the React tree through that dialog, portal or not, and\n // one press used to close the dialog and throw the form away, list still open.\n if (takeEscape(e)) return;\n // The Enter that confirms an IME composition is the IME's (BUG-9).\n if (isImeEnter(e)) return;\n // Disabled rows are passed over (`stepEnabled`), and each step starts from the\n // SETTLED highlight, not the raw index, so the first Down from a disabled row 0\n // goes to the row after the one already shown as highlighted.\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n setActive(stepEnabled(rows, current, 1));\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n setActive(current < 0 ? -1 : stepEnabled(rows, current, -1));\n } else if (e.key === \"Home\") {\n e.preventDefault();\n setActive(stepEnabled(rows, -1, 1));\n } else if (e.key === \"End\") {\n e.preventDefault();\n setActive(stepEnabled(rows, rowCount, -1));\n } else if (e.key === \"Enter\") {\n e.preventDefault();\n if (current < 0) return;\n if (current < results.length) onChoose(results[current]);\n else if (showCreate && !createLocked) onCreate();\n } else if (e.key === \"Tab\" && !isPhone) {\n // The panel is PORTALLED to <body>, so the browser's own Tab would move from\n // here to whatever follows the portal — i.e. off the end of the document. The\n // trade is one extra Tab (trigger, then onward) against never stranding focus\n // at the bottom of the page. The phone sheet is a dialog, and its trap keeps Tab.\n e.preventDefault();\n closeToTrigger();\n }\n };\n\n // What the list holds, said in ONE place that is both on screen and a polite\n // live region. Focus stays in the search box, so the list changing under it was\n // silent — a reader typed and heard nothing back, and a failed lookup was the same\n // silence as a slow one. Outside the listbox, which may own only options.\n //\n // Three different empties, and only one of them is \"nothing matched\": a lookup\n // that failed must not claim there is nothing to find, and a query under\n // `minChars` was never asked. With rows showing, the count is for the reader only.\n const message: ReactNode =\n busy && results.length === 0 ? (\n // The ellipsis is the picture; the words are for a reader, who otherwise met\n // an empty-looking list with a lone \"…\" in it — or, in most readers, nothing\n // at all, since punctuation alone is skipped.\n <>\n <span aria-hidden>…</span>\n <span className=\"sr-only\">{labels.loading}</span>\n </>\n ) : busy ? (\n // Loading with the LAST query's rows still up. This was `null`, so a refetch —\n // a new query, or a caller's `loading` while it reloads — looked exactly like a\n // finished list: rows that were about to be replaced, with nothing saying so.\n // A line of its own under the rows, in words, so it reads without the spinner.\n <span className=\"flex items-center gap-2\">\n <Spinner label={null} className=\"size-3.5 border\" />\n {labels.loading}\n </span>\n ) : results.length === 0 && !showCreate ? (\n failed ? (\n (loadErrorLabel ?? labels.loadError)\n ) : tooShort ? (\n labels.minChars(core.minChars)\n ) : (\n (emptyLabel ?? labels.noResults)\n )\n ) : null;\n // `relative` so the sr-only text has a local containing block (see\n // sr-only-containment.test).\n const announcement = (\n <div\n role=\"status\"\n aria-live=\"polite\"\n className={cn(\n \"relative\",\n message !== null && cn(\"py-2 text-sm\", isPhone ? \"px-4\" : \"px-3\"),\n failed ? \"text-danger\" : \"text-muted\",\n )}\n >\n {message ?? (results.length > 0 && <span className=\"sr-only\">{labels.resultCount(results.length)}</span>)}\n </div>\n );\n\n if (!core.open || typeof document === \"undefined\") return null;\n\n // One option row — the same in both containers and in both layouts.\n const optionRow = (o: ComboOption<V>, i: number) => {\n const selected = isSelected(o.value);\n return (\n <li role=\"presentation\">\n <button\n type=\"button\"\n id={optionId(i)}\n role=\"option\"\n aria-selected={selected}\n aria-disabled={o.disabled || undefined}\n tabIndex={-1}\n onMouseDown={(e) => {\n e.preventDefault();\n if (!o.disabled) onChoose(o);\n }}\n onMouseEnter={() => {\n if (!o.disabled) setActive(i);\n }}\n className={cn(\n isPhone\n ? SHEET_ROW_CLASS\n : columns\n ? // A cell of a column (GroupedPicker): tighter, so four columns fit.\n \"flex w-full items-center gap-1.5 rounded px-1.5 py-0.5 text-start text-sm\"\n : \"flex w-full items-center gap-2 px-3 py-1.5 text-start text-sm\",\n // The row the arrows are on shows it on a phone too: the sheet takes\n // the keyboard (BUG-5), and a tablet or a desktop at Large has one.\n o.disabled ? DISABLED_ROW_CLASS : i === current ? \"bg-active\" : !isPhone && \"hover:bg-hover\",\n // After SHEET_ROW_CLASS, so its hover is the one cancelled.\n o.disabled && isPhone && DISABLED_ROW_CLASS,\n )}\n >\n {multi && (\n <span\n // The checkbox is a PICTURE of `aria-selected` above, so a reader\n // that met both would be told twice.\n aria-hidden\n className={cn(\n \"flex size-4 shrink-0 items-center justify-center rounded border\",\n selected ? \"border-[var(--bg-inverse)] bg-inverse text-inverse\" : \"border-strong bg-surface\",\n )}\n >\n {selected && <Check className=\"size-3\" />}\n </span>\n )}\n {o.icon && <span className=\"shrink-0\">{o.icon}</span>}\n {renderOption ? (\n <span className=\"flex min-w-0 flex-1 items-center gap-2\">{renderOption(o)}</span>\n ) : (\n /* Label and sublabel wrap from Large up (text size §10.17, round 0.34 T1). */\n <span className=\"min-w-0 flex-1\">\n <span className={cn(\"block truncate-until-large text-primary\", columns && selected && \"font-medium\")}>\n {o.label}\n </span>\n {o.sublabel && <span className=\"block truncate-until-large text-xs text-placeholder\">{o.sublabel}</span>}\n </span>\n )}\n {!multi && selected && <Check className=\"size-4 shrink-0 text-brand\" />}\n </button>\n </li>\n );\n };\n\n const createRow = showCreate && (\n <li role=\"presentation\">\n <button\n type=\"button\"\n id={optionId(results.length)}\n role=\"option\"\n // Never chosen — it is an action, and it disappears the moment it has\n // been taken. Whether the keyboard is ON it is `aria-activedescendant`'s\n // job to say.\n aria-selected={false}\n aria-disabled={createLocked || undefined}\n tabIndex={-1}\n onMouseDown={(e) => {\n e.preventDefault();\n if (!createLocked) onCreate();\n }}\n onMouseEnter={() => {\n if (!createLocked) setActive(results.length);\n }}\n className={cn(\n isPhone ? SHEET_ROW_CLASS : \"flex w-full items-center gap-2 px-3 py-1.5 text-start text-sm\",\n \"text-secondary\",\n createLocked ? DISABLED_ROW_CLASS : current === results.length ? \"bg-active\" : !isPhone && \"hover:bg-hover\",\n // After SHEET_ROW_CLASS, so its hover is the one cancelled.\n createLocked && isPhone && DISABLED_ROW_CLASS,\n )}\n >\n <Plus className=\"size-4 shrink-0\" />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate-until-large\">{createContent}</span>\n {createLocked && (\n <span className=\"block truncate-until-large text-xs text-placeholder\">{createDisabledReason}</span>\n )}\n </span>\n </button>\n </li>\n );\n\n // In columns, a block per run of one group; `results` keeps its source order, so a\n // run is the rows up to the next change of group.\n const blocks: { group: string; rows: { o: ComboOption<V>; i: number }[] }[] = [];\n if (columns && !isPhone) {\n results.forEach((o, i) => {\n const group = o.group ?? \"\";\n const last = blocks[blocks.length - 1];\n if (last && last.group === group) last.rows.push({ o, i });\n else blocks.push({ group, rows: [{ o, i }] });\n });\n }\n\n const list = (\n <ul\n id={listboxId}\n role=\"listbox\"\n aria-multiselectable={multi}\n // The rows are provisional while a lookup is in flight — whether or not the\n // previous query's are still showing.\n aria-busy={busy || undefined}\n // It scrolls, and says so where jsdom can see it (see `CLIPS_ATTRIBUTE`): a\n // Tooltip in a row then portals out in a test exactly as it does in the\n // browser, instead of joining the option's accessible name (keksdose E8).\n {...{ [CLIPS_ATTRIBUTE]: \"\" }}\n className={cn(\n \"min-h-0 flex-1 overflow-y-auto\",\n columns && !isPhone ? \"columns-2 gap-4 p-3 md:columns-3 xl:columns-4\" : \"py-1\",\n isPhone && \"flex-none\",\n )}\n >\n {columns && !isPhone\n ? blocks.map((block) => (\n // A column block: its heading is a picture of the group's name, which the\n // `role=\"group\"` carries for a reader — the listbox may own options and\n // groups, and a heading of loose text in it is neither.\n <li key={`${block.group}|${block.rows[0].i}`} role=\"presentation\" className=\"mb-3 break-inside-avoid\">\n {block.group && (\n <div aria-hidden className=\"mb-1 text-xs font-semibold uppercase tracking-wide text-muted\">\n {block.group}\n </div>\n )}\n <ul role=\"group\" aria-label={block.group || undefined} className=\"space-y-0.5\">\n {block.rows.map(({ o, i }) => (\n <Fragment key={`${o.group ?? \"\"}|${String(o.value)}`}>{optionRow(o, i)}</Fragment>\n ))}\n </ul>\n </li>\n ))\n : results.map((o, i) => {\n // One heading per group rather than a grey suffix on every row (#136), and\n // the thing the native <select>'s <optgroup> used to give the account\n // picker for free (live #200). `results` keeps its source order, so a\n // boundary is simply \"different from the row above\".\n const startsGroup = o.group != null && o.group !== results[i - 1]?.group;\n return (\n // Keyed by group AND value: an option may deliberately appear twice —\n // Keksdose repeats recently-used categories in a \"Recent\" group at the\n // top (live #203) — and a bare value key would collide.\n <Fragment key={`${o.group ?? \"\"}|${String(o.value)}`}>\n {startsGroup && (\n <li\n role=\"presentation\"\n className={cn(\n GROUP_HEADING_STICKY,\n \"font-semibold uppercase tracking-wide text-muted\",\n isPhone ? \"px-4 pb-1 pt-3 text-xs\" : \"px-3 pb-0.5 pt-2 text-caption first:pt-1\",\n )}\n >\n {o.group}\n </li>\n )}\n {optionRow(o, i)}\n </Fragment>\n );\n })}\n {createRow}\n </ul>\n );\n\n // The search box is NAMED, not only prompted: a placeholder is gone the moment a\n // character is typed, and jsdom's readers and some real ones never took it for a name\n // (BUG-12: GroupedPicker's filter had \"no name beyond its placeholder\").\n const searchText = searchPlaceholder ?? labels.search;\n\n if (isPhone) {\n return (\n <PickerSheet\n // First, so the sheet's own props below win: `rest` is typed as div\n // attributes, and the DOM's `title` is a tooltip string where the sheet's is\n // its heading — one name, two meanings, and the sheet's is the one the caller\n // asked for.\n {...rest}\n className={className}\n style={style}\n open\n onClose={() => core.setOpen(false)}\n title={sheetTitle}\n query={query}\n onQueryChange={setQuery}\n searchPlaceholder={searchText}\n searchLabel={searchText}\n inputRef={inputRef}\n closeLabel={closeLabel}\n // The sheet's search box is in its HEADER, outside the list: the keys go to it\n // there, and it names the list and the active row (BUG-5). A div around the list\n // used to catch them, and never did — focus is in the box, not in the list.\n onSearchKeyDown={onKeyDown}\n listboxId={listboxId}\n activeId={activeId}\n // A multi list stays open as rows are ticked, so the sheet needs a way out\n // that is not the X in its corner: the kit's sticky \"Done\" (keksdose #412).\n // A single pick closes the sheet itself.\n done={multi}\n >\n {toolbar}\n <div className=\"relative\">\n {list}\n {announcement}\n </div>\n </PickerSheet>\n );\n }\n\n if (!rect) return null;\n // The panel hangs from the trigger's START edge (or, `align=\"end\"`, its end): its left\n // in a left-to-right form, its right in a right-to-left one, at least 13.75rem wide\n // (220 px at Normal, in rem so its text keeps its room at Large, §3.2; `width.minRem`)\n // and never wider than the glass — and clamped to the glass, which in a left-to-right\n // form it never was (Wave 2, DUP-7). It is placed by the edge it hangs from, so a `fit`\n // panel grows away from the trigger's edge before its width is measured; a box hung by\n // its `right` is measured from inside any scrollbar, as the glass's width is.\n const glass = viewportSize().width - 2 * PANEL_EDGE;\n const least = Math.min(Math.max(rect.width, (width?.minRem ?? PANEL_MIN_REM) * remPx), glass);\n const most = Math.max(least, Math.min(width?.maxRem !== undefined ? width.maxRem * remPx : glass, glass));\n const panelWidth = fit ? Math.min(Math.max(fitWidth ?? least, least), most) : least;\n const at = anchoredInline(rect, panelWidth, { dir, align, edge: PANEL_EDGE });\n const inline = (dir === \"rtl\") === (align === \"start\") ? { right: at.right } : { left: at.left };\n\n return createPortal(\n /* eslint-disable-next-line jsx-a11y/no-static-element-interactions -- never focused\n itself: it catches the listbox keys bubbling from the search <input> inside it,\n which holds focus while the panel is open. */\n <div\n // Spread FIRST: `onKeyDown` below is the listbox keyboard (Up/Down/Home/End/\n // Enter/Tab) and the placement is measured rather than chosen, so neither is a\n // caller's to replace by accident — while a `data-*` anchor or an\n // `aria-describedby` has nothing to collide with.\n {...rest}\n ref={panelRef}\n // A kit layer, for the tour's layer order (0.50, docs/tours-harmonization.md §11.6).\n data-kit-layer=\"\"\n dir={dir}\n onKeyDown={onKeyDown}\n // A press in a panel opened from a row is inside this list for the core's outside\n // press, though portalled elsewhere (dev#623).\n onPointerDownCapture={(e) => {\n rest.onPointerDownCapture?.(e);\n pressInside(panelRef)?.(e);\n }}\n // `placement` keeps the panel inside the region actually on screen: on a phone\n // the search box below pulls up the keyboard, and a panel pinned under a\n // low trigger would otherwise sit entirely behind it (feedback #135). Flipped\n // above, it hangs from its bottom edge, so a list shorter than its cap still meets\n // the trigger (keksdose K1); the edge not in use is cleared, a caller's included.\n style={{\n ...style,\n position: \"fixed\",\n top: placement.above ? undefined : placement.top,\n bottom: placement.above ? placement.bottom : undefined,\n ...inline,\n // A `fit` panel takes its width from its rows between the two bounds; any other\n // is exactly the least width.\n ...(fit ? { width: \"max-content\", minWidth: least, maxWidth: most } : { width: panelWidth }),\n maxHeight: placement.maxHeight,\n }}\n className={cn(\"z-50 flex flex-col rounded-md border border-subtle bg-surface shadow-lg\", className)}\n >\n <DropdownSearchHeader\n query={query}\n onQueryChange={setQuery}\n inputRef={inputRef}\n placeholder={searchText}\n aria-label={searchText}\n // Focus is in this box while the list is up, so this is what has to name the\n // list and the row the arrows are on.\n listboxId={listboxId}\n activeId={activeId}\n />\n {toolbar}\n {/* One list, two containers: the desktop panel and the phone sheet render\n the same rows through the same handlers (live #200). */}\n {list}\n {announcement}\n </div>,\n document.body,\n );\n}\n"],"mappings":";AA2KI,SAokBE,UApkBF,KAokBE,YApkBF;AA3KJ,SAAS,YAAAA,WAAU,WAAW,iBAAiB,SAAS,QAAQ,gBAAgB;AAChF,SAAS,oBAAoB;AAS7B,SAAS,OAAO,YAAY;AAC5B,SAAS,UAAU;AACnB,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AACrC,SAAS,aAAa,uBAAuB;AAC7C,SAAS,gBAAgB,gBAAgB;AACzC,SAAS,6BAA6B;AACtC,SAAS,eAAe;AACxB,SAAS,oBAAoB;AAE7B,SAAS,gBAAgB,kBAAkB,oBAAwC;AACnF,SAAS,aAAa,YAAY,iBAAiB,uBAAuB;AAC1E,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAC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,IACH;AAAA,IACA,SAAS;AAAA,EACX;AACF;","names":["Fragment"]}
1
+ {"version":3,"sources":["../../src/components/combobox-core.tsx"],"sourcesContent":["import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport type {\n ComponentPropsWithoutRef,\n Dispatch,\n KeyboardEvent as ReactKeyboardEvent,\n ReactNode,\n RefObject,\n SetStateAction,\n} from \"react\";\nimport { Check, Plus } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { CLIPS_ATTRIBUTE } from \"../lib/clipping\";\nimport { tabStops } from \"../lib/focus-left\";\nimport { DropdownSearchHeader } from \"./dropdown\";\nimport { PickerSheet, SHEET_ROW_CLASS } from \"./picker-sheet\";\nimport { usePhoneLayout, useRemPx } from \"../hooks/use-breakpoint\";\nimport { FLOATING_LABEL_STATIC } from \"./field-parts\";\nimport { Spinner } from \"./spinner\";\nimport { useAnchorDir } from \"./use-anchor-dir\";\nimport { type AnchorRect } from \"../hooks/use-anchored-rect\";\nimport { anchoredInline, useAnchoredPanel, viewportSize, type AnchoredPanel } from \"../hooks/use-anchored-panel\";\nimport { pressInside, takeEscape, useDismissLayer, useOutsideClick } from \"../hooks/use-dismiss\";\nimport { useOverlayHistory } from \"../hooks/use-overlay-history\";\nimport { isImeEnter } from \"../lib/ime\";\nimport { matchesSearch, sameName, searchWords } from \"../lib/text-match\";\nimport { DEFAULT_COMBOBOX_LABELS, useKitLabels, useKitLocale } from \"../i18n/kit-labels\";\nimport { hasContent } from \"../lib/presence\";\n\n/**\n * What an entity picker hands `onChange` when it is cleared — `clearValue` on\n * {@link EntityCombobox} and {@link InlineEntityCombobox}. `null` by default.\n *\n * A closed set rather than any value, on purpose: every member is something no\n * option can be (an option's value is a `string | number`, and `\"\"` is never a real\n * id), so the picker can also READ it back — a field whose `value` is the clear\n * value shows as empty, with no clear button, exactly as `null` does. An arbitrary\n * sentinel could collide with an id and would make that read ambiguous.\n *\n * No `undefined`: a prop set to `undefined` is a prop not passed, so it would read as\n * the default and emit `null` — the one outcome the caller had asked not to get.\n */\nexport type ComboClearValue = null | \"\";\n\nexport interface ComboOption<V extends string | number> {\n value: V;\n label: string;\n sublabel?: string;\n icon?: ReactNode;\n /**\n * Section this option belongs to. Where a consumer renders it as a heading with the\n * members indented beneath — {@link InlineEntityCombobox} does — this is a genuine\n * grouping, not decoration: the name appears once per section rather than trailing\n * every row in small grey type, which is barely legible on a phone (feedback #136).\n * The heading stays at the top of the list while its rows scroll beneath it.\n *\n * NOT searched (0.40, kk run 79): a group is where a row is filed, not what it is\n * called — with first-letter groups (\"A\", \"B\", … \"#\"), typing \"a\" matched every row\n * filed under A. Searching a category's name means putting it in `sublabel`.\n */\n group?: string;\n /**\n * Shown but not takeable: rendered dimmed with `aria-disabled`, passed over by the\n * arrow keys, and a click or Enter on it does nothing. For a row whose existence is\n * the information — a write-locked result, an account that is closed — where\n * leaving it out would read as \"there is no such thing\". Say WHY in `sublabel`: a\n * hover tooltip is the one explanation a phone cannot show.\n *\n * Honoured by {@link Autocomplete}, {@link InlineEntityCombobox} and the panel\n * pickers ({@link EntityCombobox}, {@link MultiEntityCombobox}); on those an already\n * chosen disabled option stays chosen — the row only refuses to be toggled.\n */\n disabled?: boolean;\n}\n\n/** A row the user may take — present and not {@link ComboOption.disabled}. */\nexport const isOptionEnabled = (o: { disabled?: boolean } | undefined): boolean => o !== undefined && !o.disabled;\n\n/**\n * The next takeable row from `from`, stepping `dir` — what the arrow keys use so a\n * disabled row is passed over, as the APG allows. Stays on `from` at the end of the\n * list (the family's arrows clamp rather than wrap) and answers `-1` when `from` is\n * not a row and there is nothing to step to.\n */\nexport function stepEnabled(rows: readonly { disabled?: boolean }[], from: number, dir: 1 | -1): number {\n for (let i = from + dir; i >= 0 && i < rows.length; i += dir) {\n if (!rows[i].disabled) return i;\n }\n return from >= 0 && from < rows.length ? from : -1;\n}\n\n/** `i` when that row is takeable, else the nearest takeable one after it, else\n * before it, else `-1`. For a highlight that starts on a fixed index (the panel\n * pickers open on row 0) and must never rest on a disabled row. */\nexport function settleEnabled(rows: readonly { disabled?: boolean }[], i: number): number {\n if (i < 0 || i >= rows.length) return -1;\n if (!rows[i].disabled) return i;\n const after = stepEnabled(rows, i, 1);\n if (after !== i) return after;\n const before = stepEnabled(rows, i, -1);\n return before !== i ? before : -1;\n}\n\n/** Classes a disabled row adds over its normal ones — dimmed, no hover, the\n * kit's soft-disabled look (`DangerConfirm`, `SignaturePad`). */\nexport const DISABLED_ROW_CLASS = \"cursor-not-allowed opacity-50 hover:bg-transparent\";\n\n/**\n * Whether an entity picker offers its create row — one rule for\n * {@link EntityCombobox}, {@link MultiEntityCombobox} and {@link InlineEntityCombobox}.\n *\n * With a query: while the trimmed query names no option exactly — an exact hit is a\n * record the list is already showing, and a second way to \"make\" it would mint a\n * duplicate. \"Exactly\" as the list matches, folded by `locale` ({@link sameName}): with\n * plain `toLowerCase`, \"cafe\" listed Café and offered \"Create “cafe”\" beside it (refactor\n * audit 2026-10-30, DUP-5). With NO query: only when the caller named the row for that\n * case (`createEmptyLabel`) — a row reading `Create “”` says nothing, and the kit cannot\n * know the noun (\"Create cash account\") that would make it say something (keksdose G9).\n *\n * `names` is what the query is compared against: the loaded rows for a panel picker\n * (its async list is all it knows), every option for the inline one. `locale`: the\n * provider's, which the list's match folds by; left out, the runtime's.\n */\nexport function offersCreate(\n onCreate: unknown,\n query: string,\n names: readonly string[],\n createEmptyLabel: string | undefined,\n locale?: string,\n): boolean {\n if (!onCreate) return false;\n if (!query) return Boolean(createEmptyLabel);\n return !names.some((n) => sameName(n, query, locale));\n}\n\n/**\n * {@link EndHintRow}'s `hint` and `className` for a combobox-family field, keeping the\n * 0.22 rule (keksdose): a field that was passed `hint` at all — even `undefined` — keeps\n * ONE box, so a hint coming and going never rebuilds the control under the cursor.\n *\n * A text hint is a caption after the control and never moved it; the case this covers\n * is the \"?\" (a {@link FieldHint}) on a field with no label line, which sits at the end\n * edge in a row of its own. Without this the row existed only while the \"?\" did, and\n * the control was re-parented — remounted, focus and caret lost — each time it came or\n * went. With `hint` passed the row stays, its end slot empty and its gap closed, so\n * nothing on screen moves either.\n */\nexport function endHintRowProps(\n hintPassed: boolean,\n hasLabel: boolean,\n labelHint: ReactNode | undefined,\n): { hint: ReactNode | undefined; className?: string } {\n if (hasLabel) return { hint: undefined };\n if (labelHint !== undefined) return { hint: labelHint };\n return hintPassed ? { hint: null, className: \"gap-0\" } : { hint: undefined };\n}\n\n/**\n * The family's floating label, as a real `<label for>` (lenkbank): the input is then\n * named the way {@link Input}'s is, so `getByLabelText` and any helper that walks\n * `<label htmlFor>` finds it. Same placement and type as {@link FieldLabel}, which\n * stays a `<span>` for the TRIGGER pickers — a `<button>` is labelable, but those\n * compose their own \"label: value\" name. `pointer-events-none` (from the class)\n * keeps a press on it landing on the field under it, as before.\n */\nexport function ComboboxFieldLabel({\n htmlFor,\n className,\n children,\n ...rest\n}: ComponentPropsWithoutRef<\"label\"> & { htmlFor: string }) {\n return (\n <label {...rest} htmlFor={htmlFor} className={cn(FLOATING_LABEL_STATIC, \"z-10\", className)}>\n {children}\n </label>\n );\n}\n\n/**\n * Where a combobox's rows come from, and how a query narrows them. Shared by the\n * trigger pickers ({@link useComboboxCore}) and the inline {@link Autocomplete}, so\n * the two cannot drift in what a failed lookup or a too-short query does.\n */\nexport interface OptionSourceOptions<V extends string | number> {\n /** Already-loaded options (client-side filtered unless `filter` is false), also\n * used to resolve labels. */\n options?: ComboOption<V>[];\n /** Async option source, debounced and race-safe; stale responses are ignored,\n * and a rejection is caught and reported as `failed`. */\n loadOptions?: (query: string) => Promise<ComboOption<V>[]>;\n /** External loading flag, OR-ed with the internal async state. */\n loading?: boolean;\n /**\n * Narrow `options` by the query (label/sublabel substring, folded for search: no case,\n * no accents, the locale's case rules — \"zurich\" finds Zürich, DUP-5). Default `true`.\n *\n * `false` shows `options` exactly as given, in the given order — for a list the\n * caller has already searched and ranked on a server (Keksdose's geocoder), which a\n * second, client-side substring filter could only get wrong: a provider that\n * matches \"Bahnhofstr.\" to \"Bahnhofstrasse\" is right, and a label filter would\n * throw that row away.\n */\n filter?: boolean;\n /**\n * Below this many (trimmed) characters nothing is offered and `loadOptions` is not\n * called. Default `0` — the pickers list everything on open. Set it for a source\n * that is costly or rate-limited: one letter against a geocoder matches half a\n * continent, and a request per opened panel is a request nobody asked for.\n */\n minChars?: number;\n /** Quiet time after the last keystroke before `loadOptions` runs. Default 150 ms. */\n debounceMs?: number;\n}\n\nexport interface OptionSource<V extends string | number> {\n results: ComboOption<V>[];\n busy: boolean;\n /** The last lookup for this query REJECTED. The rows are emptied with it: results\n * from an earlier query under a failed one would read as the answer to it. */\n failed: boolean;\n /** The query is shorter than `minChars`, so nothing was asked. */\n tooShort: boolean;\n}\n\n/**\n * The rows half of a combobox: client-side filtering, or a debounced, race-safe\n * `loadOptions` with its loading and failure states.\n *\n * `active` gates the async side — a closed list asks nothing. Loading is DERIVED\n * (\"the settled answer is for a different query\") rather than flagged on in the\n * effect, so there is no render between a keystroke and the debounce in which an\n * empty list could claim \"No results\" for a question still being asked.\n */\nexport function useOptionSource<V extends string | number>({\n options,\n loadOptions,\n loading,\n filter = true,\n minChars = 0,\n debounceMs = 150,\n query,\n active,\n}: OptionSourceOptions<V> & { query: string; active: boolean }): OptionSource<V> {\n const isAsync = typeof loadOptions === \"function\";\n const tooShort = query.trim().length < minChars;\n const [settled, setSettled] = useState<{\n query: string | null;\n results: ComboOption<V>[];\n failed: boolean;\n }>({ query: null, results: [], failed: false });\n const loadRef = useRef(loadOptions);\n useEffect(() => {\n loadRef.current = loadOptions;\n });\n const reqId = useRef(0);\n\n useEffect(() => {\n // Bumped even when nothing is asked, so a request still in flight from a longer\n // query cannot land after the user has deleted back below `minChars`.\n const id = ++reqId.current;\n if (!active || !isAsync || tooShort) return;\n const t = setTimeout(\n async () => {\n try {\n const r = await loadRef.current!(query);\n if (reqId.current === id) setSettled({ query, results: r, failed: false });\n } catch {\n // The one path the old `try/finally` had no answer for: the list kept the\n // previous query's rows and said nothing (Keksdose proposal §2).\n if (reqId.current === id) setSettled({ query, results: [], failed: true });\n }\n },\n query ? debounceMs : 0,\n );\n return () => clearTimeout(t);\n }, [query, active, isAsync, tooShort, debounceMs]);\n\n // Folded as every kit list folds (DUP-5, refactor audit 2026-10): plain `toLowerCase`\n // here meant \"zurich\" found no Zürich in kastlan's eighteen entity pickers, and the\n // Turkish \"ı\" no \"IRMAK\".\n const locale = useKitLocale();\n const clientResults = useMemo(() => {\n if (isAsync) return [];\n const src = options ?? [];\n // Every word of the query, in the label or the sublabel (0.51.4): \"migros zürich\".\n const words = searchWords(query, locale);\n if (!filter || words.length === 0) return src;\n return src.filter((o) => matchesSearch(words, [o.label, o.sublabel], locale));\n }, [isAsync, options, query, filter, locale]);\n\n const pending = isAsync && active && !tooShort && settled.query !== query;\n const failed = isAsync && !tooShort && settled.failed;\n return {\n results: tooShort ? [] : isAsync ? (failed ? [] : settled.results) : clientResults,\n busy: Boolean(loading) || pending,\n failed: failed && !pending,\n tooShort,\n };\n}\n\nexport interface ComboboxCoreOptions<V extends string | number> extends OptionSourceOptions<V> {\n /**\n * Back closes the open anchored list, not the page or the dialog behind it — the rule\n * `useDropdown` keeps for its lists (keksdose live #309 rework). Default `false`, as the\n * entity pickers have always been; CurrencySelect, MultiSelect, GroupedPicker and\n * AmountInput's currency chip, which came over from `useDropdown` (DUP-4), pass `true`\n * so they keep it. On a phone the `PickerSheet` registers Back itself.\n */\n backCloses?: boolean;\n}\n\nexport interface ComboboxCore<V extends string | number> {\n triggerRef: RefObject<HTMLButtonElement | null>;\n panelRef: RefObject<HTMLDivElement | null>;\n inputRef: RefObject<HTMLInputElement | null>;\n open: boolean;\n setOpen: Dispatch<SetStateAction<boolean>>;\n query: string;\n setQuery: Dispatch<SetStateAction<string>>;\n active: number;\n setActive: Dispatch<SetStateAction<number>>;\n results: ComboOption<V>[];\n busy: boolean;\n /** See {@link OptionSource}. */\n failed: boolean;\n tooShort: boolean;\n minChars: number;\n rect: AnchorRect | null;\n /** Where the dropdown goes, clamped to the visible viewport (feedback #135). */\n placement: AnchoredPanel;\n /** Put an option in the label cache, so {@link ComboboxCore.resolve} still knows a\n * value the caller just chose after the result list has moved on. */\n rememberOption: (o: ComboOption<V>) => void;\n resolve: (v: V) => ComboOption<V> | null;\n /** Close and hand focus back to the trigger — the keyboard paths only. See\n * {@link useDropdown} for why a pointer dismissal must not do this. */\n closeToTrigger: () => void;\n}\n\n/**\n * Shared plumbing for the entity pickers: open/query/active state, portalled\n * anchoring + outside-click/Escape dismissal, focus-on-open, a debounced\n * race-safe async (or client-side) result list, and a label cache so a selected\n * value still renders its label after the async list has moved on. The single-\n * and multi-value comboboxes render their triggers on top of this and share\n * {@link ComboboxPanel} for the dropdown.\n */\nexport function useComboboxCore<V extends string | number>({\n options,\n minChars = 0,\n backCloses = false,\n ...source\n}: ComboboxCoreOptions<V>): ComboboxCore<V> {\n const triggerRef = useRef<HTMLButtonElement>(null);\n const panelRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState(\"\");\n const [active, setActive] = useState(0);\n\n const close = () => setOpen(false);\n // Escape unmounts the panel the user is typing in; without this the browser drops\n // focus on <body>, so the caret disappears and the next Tab restarts at the top of\n // the page. A pointer dismissal deliberately does NOT do this — the press has\n // already decided where focus belongs.\n const closeToTrigger = () => {\n setOpen(false);\n triggerRef.current?.focus();\n };\n // Placement, not just the anchor rect: the panel has to dodge the on-screen\n // keyboard its own search box summons (feedback #135).\n const placement = useAnchoredPanel(triggerRef, open);\n const rect = placement.rect;\n // Outside-click dismissal belongs to the ANCHORED panel, and only to it. On a\n // phone `ComboboxPanel` renders a full-screen `PickerSheet` instead (live #200),\n // portalled to <body> and carrying its own ways out — the close X, Escape, and\n // Back through `useOverlayHistory` — so there is no outside left to press.\n //\n // Leaving the listener on there was not merely redundant, it was the bug:\n // `panelRef` is attached to the desktop panel alone, so with the sheet up every\n // press inside it answered \"outside\". While `useOutsideClick` listened for\n // `mousedown` the rows survived by accident — they commit on `onMouseDown` too,\n // and won the race — but `pointerdown` PRECEDES `mousedown`, so the sheet closed\n // at finger-down and the commit landed on an unmounted tree: a tapped row kept the\n // old value, and tapping the search box or the X was equally fatal. `PickerSheet`\n // stops `mousedown` for exactly this reason, but that guard was written for\n // `useDropdown`'s listener and never covered this hook.\n const isPhone = usePhoneLayout();\n useOutsideClick([triggerRef, panelRef], close, open && !isPhone);\n // A layer on the Escape stack while the anchored panel is open (Wave 2, DUP-1), so a\n // dialog around the picker closes only after it (BUG-1). `ComboboxPanel` takes the key\n // where focus is. On a phone the `PickerSheet` is the layer, as it is the outside.\n useDismissLayer(open && !isPhone, closeToTrigger);\n // See `backCloses`. The same close path a pointer dismissal takes.\n useOverlayHistory(backCloses && open && !isPhone, close);\n\n // Reset the query each time the panel opens, and the highlighted row whenever the\n // visible set changes (a new query, or the panel opening or closing). Adjusted while\n // rendering against the previous values rather than in an effect, so the render that\n // opens the panel already searches for \"\" and highlights the first row.\n const [prevOpen, setPrevOpen] = useState(open);\n const [prevQuery, setPrevQuery] = useState(query);\n if (open !== prevOpen || query !== prevQuery) {\n const opened = open && !prevOpen;\n setPrevOpen(open);\n setPrevQuery(opened ? \"\" : query);\n if (opened) setQuery(\"\");\n setActive(0);\n }\n\n // Focus the search box each time the panel opens.\n useEffect(() => {\n if (!open) return;\n const id = requestAnimationFrame(() => inputRef.current?.focus());\n return () => cancelAnimationFrame(id);\n }, [open]);\n\n // Debounced, race-safe async search (only when loadOptions is provided) or the\n // client-side filter — see {@link useOptionSource}.\n const { results, busy, failed, tooShort } = useOptionSource<V>({\n ...source,\n options,\n minChars,\n query,\n active: open,\n });\n\n // Accumulate every option we've seen so a selected value can render its label\n // even after the async list has moved on to other query results.\n const cacheRef = useRef(new Map<V, ComboOption<V>>());\n useEffect(() => {\n for (const o of options ?? []) cacheRef.current.set(o.value, o);\n for (const o of results) cacheRef.current.set(o.value, o);\n }, [options, results]);\n const resolve = (v: V): ComboOption<V> | null =>\n options?.find((o) => o.value === v) ?? cacheRef.current.get(v) ?? null;\n const rememberOption = (o: ComboOption<V>) => {\n cacheRef.current.set(o.value, o);\n };\n\n return {\n triggerRef,\n panelRef,\n inputRef,\n open,\n setOpen,\n query,\n setQuery,\n active,\n setActive,\n results,\n busy,\n failed,\n tooShort,\n minChars,\n rect,\n placement,\n rememberOption,\n resolve,\n closeToTrigger,\n };\n}\n\n// The family's `error` is every field's `useFieldError` (field-parts) since 0.34 — the\n// restatement that stood here ignored a form library's `aria-invalid` (DUP-8).\n\n/** The anchored suggestion list's box and rows — one look for {@link Combobox},\n * {@link InlineEntityCombobox} and {@link Autocomplete}. */\n/**\n * A group's heading in a picker list stays at the top of the list while its rows scroll\n * under it (kk run 79 gap 3): with first-letter groups over two hundred payees, the\n * heading is the one thing that says where in the alphabet the thumb is. Opaque — the\n * list's own `bg-surface` — so the rows pass beneath it rather than through it. Shared\n * by every list that heads groups (the panel and the sheet, `Combobox`, `Autocomplete`,\n * `InlineEntityCombobox`). Inside its {@link OptionGroup} since 0.52, it sticks while its\n * own group is in view and the next group's heading pushes it out.\n */\nexport const GROUP_HEADING_STICKY = \"sticky top-0 z-10 bg-surface\";\n\n/** One run of rows that share a group, as {@link groupRuns} finds them: `group` is\n * `null` for rows filed under none, which stand bare in the list; `start` is the index\n * of the run's first row in the whole list (the option ids and the arrows count by it). */\nexport interface GroupRun<T> {\n group: string | null;\n start: number;\n rows: T[];\n}\n\n/**\n * A list's rows, cut where the group changes — the runs {@link OptionGroup} wraps. The\n * lists keep their rows group-contiguous (the panel's source order, or the ranked list\n * regrouped by its best member), so a run is \"the rows up to the next change of group\".\n * `groupOf` is asked once per row. An empty group name is no group: a heading of nothing\n * names nothing.\n */\nexport function groupRuns<T>(rows: readonly T[], groupOf: (row: T) => string | null | undefined): GroupRun<T>[] {\n const runs: GroupRun<T>[] = [];\n rows.forEach((row, i) => {\n const raw = groupOf(row);\n const group = raw === undefined || raw === null || raw === \"\" ? null : raw;\n const last = runs[runs.length - 1];\n if (last && last.group === group) last.rows.push(row);\n else runs.push({ group, start: i, rows: [row] });\n });\n return runs;\n}\n\n/**\n * A group of options under its heading, inside a `role=\"listbox\"`: a `role=\"group\"`\n * NAMED by the heading, so a reader moving through the list hears which group a row is\n * in (refactor audit 2026-10-30, INP-8). The heading was loose text among the options,\n * and focus stays in the search box with the row announced through\n * `aria-activedescendant` — keksdose's \"Groceries\" under Recent and again under its own\n * group were two identical names, and an account filed by its type never said the type.\n * The heading stays a visible first item of the group (sticky within it); the columns of\n * {@link ComboboxPanel} carry the same `role=\"group\"`.\n *\n * `id` must be unique in the document (the list's id plus the run's start); `className`\n * places the heading's text in its list.\n */\nexport function OptionGroup({\n id,\n heading,\n className,\n children,\n}: {\n id: string;\n heading: ReactNode;\n className?: string;\n children: ReactNode;\n}) {\n return (\n <li role=\"presentation\">\n <ul role=\"group\" aria-labelledby={id}>\n <li\n role=\"presentation\"\n id={id}\n className={cn(GROUP_HEADING_STICKY, \"font-semibold uppercase tracking-wide text-muted\", className)}\n >\n {heading}\n </li>\n {children}\n </ul>\n </li>\n );\n}\n\n/**\n * A list's rows in their {@link groupRuns}: a run filed under no group stands bare, any\n * other is an {@link OptionGroup} under its heading. The one drawing of it for\n * {@link ComboboxPanel}, {@link Combobox}, {@link InlineEntityCombobox} and\n * {@link Autocomplete}, which had a copy each (0.52 code review, combobox-core.tsx).\n *\n * A run is keyed by its group and how many runs of that group came before it — NOT by\n * the index of its first row, which every keystroke that drops a row from an earlier\n * group moves: each later group was re-keyed and React rebuilt it, every row of it, per\n * keystroke. A row is keyed by `rowKey` among the rows of its run; an option may stand\n * in two groups (keksdose's \"Recent\", live #203), never twice in one.\n *\n * `row(o, i, grouped)`: `i` is the row's index in the whole list (the option ids and the\n * arrows count by it), `grouped` whether it stands under a heading. `headingClassName`\n * places a run's heading text in its list. The group's id is the list's id and the run's\n * first row, unique in the document.\n */\nexport function GroupedOptions<T>({\n runs,\n listboxId,\n rowKey,\n row,\n headingClassName,\n}: {\n runs: readonly GroupRun<T>[];\n listboxId: string;\n rowKey: (o: T) => string;\n row: (o: T, index: number, grouped: boolean) => ReactNode;\n headingClassName: (run: GroupRun<T>) => string;\n}) {\n return keyRuns(runs).map(({ run, key }) => {\n const grouped = run.group !== null;\n const rows = run.rows.map((o, k) => <Fragment key={rowKey(o)}>{row(o, run.start + k, grouped)}</Fragment>);\n if (!grouped) return <Fragment key={key}>{rows}</Fragment>;\n return (\n <OptionGroup\n key={key}\n id={`${listboxId}-group-${run.start}`}\n heading={run.group}\n className={headingClassName(run)}\n >\n {rows}\n </OptionGroup>\n );\n });\n}\n\n/** Each run with its key — see {@link GroupedOptions}: the group and how many runs of it\n * came before, which a query narrowing an earlier group does not move. */\nfunction keyRuns<T>(runs: readonly GroupRun<T>[]): { run: GroupRun<T>; key: string }[] {\n const seen = new Map<string | null, number>();\n return runs.map((run) => {\n const nth = seen.get(run.group) ?? 0;\n seen.set(run.group, nth + 1);\n // The count first: it never holds a \":\", so no group's name can make two keys equal.\n return { run, key: run.group === null ? String(nth) : `${nth}:${run.group}` };\n });\n}\n\n/** The anchored list's heading text: the first group's sits closer to the list's top\n * edge, unless a row stands above it (`first: false`, Combobox's create row). */\nexport const anchoredHeadingClass = (run: GroupRun<unknown>, first = true) =>\n cn(\"px-3 pb-0.5 text-caption\", run.start === 0 && first ? \"pt-1\" : \"pt-2\");\n\n/** The typed comboboxes' phone sheet's heading text ({@link Combobox},\n * {@link InlineEntityCombobox}). */\nexport const SHEET_HEADING_CLASS = \"px-4 pb-0.5 pt-3 text-caption\";\n\nexport const SUGGESTION_LIST_CLASS =\n \"max-h-64 overflow-y-auto rounded-md border border-subtle bg-surface py-1 shadow-lg\";\n\n// One line at Normal; from Large up a long suggestion wraps and its row grows (text size\n// §10.17, round 0.34 T1), like every other option list of the kit.\nexport const suggestionRowClass = (isActive: boolean) =>\n cn(\n \"block w-full truncate-until-large px-3 py-1.5 text-start text-sm text-primary\",\n isActive ? \"bg-active\" : \"hover:bg-hover\",\n );\n\n/**\n * Keep the option the keyboard is on inside the visible part of the list.\n *\n * `aria-activedescendant` moves a highlight WITHOUT moving focus, which is the whole\n * point of it — and the cost is that the browser scrolls nothing on its own. In a\n * panel capped at a few hundred pixels over an account list two hundred long, Down\n * walked the highlight straight out of the box and the list sat still.\n *\n * Optional-called because jsdom does not implement `scrollIntoView`: three consumers\n * run this component in their own suites, and a picker that throws there is a worse\n * trade than a list that does not scroll in a test.\n */\nexport function useActiveOptionScroll(activeId: string | undefined): void {\n useEffect(() => {\n if (!activeId) return;\n document.getElementById(activeId)?.scrollIntoView?.({ block: \"nearest\" });\n }, [activeId]);\n}\n\n/**\n * What a TYPED combobox's list says — {@link Combobox} and {@link InlineEntityCombobox},\n * which had a copy each, the second saying \"see the twin\" (0.52 code review,\n * inline-entity-combobox.tsx; the rules are refactor audit 2026-10-30, INP-6):\n *\n * - `showing`: the anchored list is on screen — open, not inert, with a row to show (an\n * option, or `extraRow`, the create row). The list is then a layer on the Escape stack\n * (Wave 2, DUP-1). Never on a phone, where the sheet is the list and the layer.\n * - `expanded`, the field's `aria-expanded`: a list on screen. An open list with nothing\n * to show said \"expanded\" with no listbox in the document.\n * - `activeOption`: the id of the row the keyboard is on — `active`, a TAKEABLE row's\n * index, else -1 — in whichever list shows, kept scrolled into view.\n * - `statusRegion`: a polite live region with the row count, or \"No results\" for a query\n * that left nothing to show or do. Focus stays in the field, or in the sheet's search\n * box, so a list changing under it was silent. A list opened on no query asked nothing.\n * Render it outside the list, so the list going cannot take it along: on a phone inside\n * the sheet, which hides from a reader what lies outside it. There it mounts with the\n * sheet, so the count the sheet opens with is not announced — as a ComboboxPanel's is\n * not, in either shell — and every change after it is.\n */\nexport function useTypedListStatus({\n isPhone,\n open,\n inert,\n rowCount,\n extraRow,\n query,\n active,\n optionId,\n labels,\n}: {\n isPhone: boolean;\n open: boolean;\n inert: boolean;\n /** The options the list shows. */\n rowCount: number;\n /** A create row shows: the list is not empty, it offers to fill itself. */\n extraRow: boolean;\n query: string;\n active: number;\n optionId: (index: number) => string;\n labels: { resultCount: (count: number) => string; noResults: string };\n}): { showing: boolean; expanded: boolean; activeOption: string | undefined; statusRegion: ReactNode } {\n const showing = !isPhone && open && !inert && (rowCount > 0 || extraRow);\n const expanded = isPhone ? open && !inert : showing;\n const activeOption = expanded && active >= 0 ? optionId(active) : undefined;\n useActiveOptionScroll(activeOption);\n const status =\n !open || inert ? null : rowCount > 0 ? labels.resultCount(rowCount) : query && !extraRow ? labels.noResults : null;\n const statusRegion = (\n <div role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {status}\n </div>\n );\n return { showing, expanded, activeOption, statusRegion };\n}\n\n/** The anchored panel's least width, in rem: 220 px at Normal (§3.2). */\nconst PANEL_MIN_REM = 13.75;\n\n/** The room the anchored panel keeps from either edge of the glass, in px —\n * `anchoredInline`'s default. */\nconst PANEL_EDGE = 8;\n\n/**\n * How wide the anchored panel is. The phone sheet is the screen's width whatever this\n * says.\n */\nexport interface ComboboxPanelWidth {\n /** The least width, in rem — never under the trigger's own. Default 13.75 (220 px at\n * Normal, §3.2). */\n minRem?: number;\n /**\n * As wide as the rows make it (`max-content`), between the least width and `maxRem`,\n * instead of exactly the least — measured, so the clamp to the glass still knows it.\n * CurrencySelect's list grows to show the full currency names (feedback #308);\n * MultiSelect's rows to show their hints (keksdose #147). A `w-*` class in the panel's\n * `className` does not apply: the panel is portalled to <body>, where `w-full` would be\n * the screen.\n */\n fit?: boolean;\n /** With `fit`, the most it grows to, in rem. Default: the glass. */\n maxRem?: number;\n}\n\nexport interface ComboboxPanelProps<V extends string | number> extends ComponentPropsWithoutRef<\"div\"> {\n core: ComboboxCore<V>;\n /** What the trigger's `aria-controls` names. Owned by the component that renders\n * the trigger, not by the core: one id has to reach both, and only one of them\n * can be the origin. */\n listboxId: string;\n /** Default: `combobox.search` from the {@link UiKitProvider}, else English. */\n searchPlaceholder?: string;\n /** Default: `combobox.noResults` from the {@link UiKitProvider}, else English. */\n emptyLabel?: string;\n multi?: boolean;\n isSelected: (v: V) => boolean;\n onChoose: (o: ComboOption<V>) => void;\n showCreate: boolean;\n onCreate: () => void;\n createContent: ReactNode;\n /**\n * The create row is shown but not takeable, and this says why — the lock's reason\n * when the picker's `createCommit` meets a locked {@link WriteLockProvider}. Rendered\n * as the row's second line rather than a tooltip, as {@link ComboOption.disabled}\n * asks of every disabled row: a hover is the one explanation a phone cannot show.\n */\n createDisabledReason?: ReactNode;\n /** What the sheet calls itself on a phone — the field's label. Ignored on\n * desktop, where the panel sits under the field that already says it. */\n sheetTitle?: ReactNode;\n closeLabel?: string;\n /** Default: `combobox.loadError` from the {@link UiKitProvider}, else English. */\n loadErrorLabel?: string;\n /**\n * What a row shows in place of its label and sublabel — for a row that says more than\n * two strings: CurrencySelect's symbol, code and name side by side. The option's\n * `icon`, the multi checkbox and the check mark stay the panel's. Its text is the\n * option's accessible name, so separate the parts with a space.\n */\n renderOption?: (o: ComboOption<V>) => ReactNode;\n /** Controls between the search box and the list, in the anchored panel and the phone\n * sheet alike — MultiSelect's \"Select all\" and \"Clear\". In the anchored panel Tab from\n * the search box walks them before it leaves (0.52); keep them focusable when they\n * have nothing to do (`aria-disabled`), or a press drops their focus to <body>. */\n toolbar?: ReactNode;\n /** See {@link ComboboxPanelWidth}. */\n width?: ComboboxPanelWidth;\n /** Which of the trigger's edges the anchored panel hangs from, by reading direction.\n * Default `start`; `end` grows the panel toward the start, so a field with content\n * after it is not pushed past the page (CurrencySelect, feedback #308). */\n align?: \"start\" | \"end\";\n /**\n * Lay the rows out in columns, one block per `group`, with the group's name above it —\n * GroupedPicker's panel (feedback #267/#276): a large grouped set reads as a sheet of\n * short lists side by side rather than one long one. Each block is a `role=\"group\"`\n * named by its heading. The arrow keys walk the rows in reading order, down each\n * column. The phone sheet keeps one column with headings.\n */\n columns?: boolean;\n}\n\n/**\n * The portalled dropdown (search header + result rows + optional create row)\n * shared by the single- and multi-value comboboxes. Start-aligned to the trigger\n * and sized to its width; `multi` swaps the trailing check for a leading\n * checkbox. `onChoose` decides whether to close (single) or stay open (multi).\n *\n * ## The ARIA, which is `CommandPalette`'s\n *\n * This rendered a `role=\"listbox\"` of `role=\"option\"` rows and stopped there, so a\n * reader was handed a text box and silence: the highlight the arrow keys move lived\n * only in a background colour, and nothing tied the box being typed in to the list\n * being filtered. `CommandPalette` has had the whole model since it was written —\n * `aria-controls` from the field to the list, `aria-activedescendant` naming the row\n * the keyboard is on — and it was the only thing in the package that did.\n *\n * Two distinct states, deliberately not conflated:\n * - `aria-selected` is CHOSEN. It is the check mark, and in `multi` the checkbox.\n * - `aria-activedescendant` is where the KEYBOARD is. Announcing that as selected\n * would tell a reader that the row they are merely passing over is the answer.\n *\n * `role=\"option\"` sits on the `<button>`, not on the `<li>` around it, for the same\n * reason it does in `CommandPalette`: an option may not contain a separately\n * focusable control, and the button is the thing a pointer presses. The rows are\n * `tabIndex={-1}` because focus never leaves the search box — that is what\n * `aria-activedescendant` is FOR.\n */\nexport function ComboboxPanel<V extends string | number>({\n core,\n listboxId,\n searchPlaceholder,\n emptyLabel,\n multi,\n isSelected,\n onChoose,\n showCreate,\n onCreate,\n createContent,\n createDisabledReason,\n sheetTitle,\n closeLabel,\n loadErrorLabel,\n renderOption,\n toolbar,\n width,\n align = \"start\",\n columns,\n className,\n style,\n ...rest\n}: ComboboxPanelProps<V>) {\n const createLocked = hasContent(createDisabledReason);\n const {\n rect,\n placement,\n panelRef,\n inputRef,\n query,\n setQuery,\n results,\n busy,\n failed,\n tooShort,\n active,\n setActive,\n closeToTrigger,\n } = core;\n // The phone gets a full-screen sheet instead of an anchored panel (live #200).\n // Same core, same results, same handlers — only the container differs, so the\n // two presentations cannot drift in what they offer.\n const isPhone = usePhoneLayout();\n // Every row the keyboard can land on, the create row included — passed over, like a\n // disabled option, while a write lock holds it.\n const rows: readonly { disabled?: boolean }[] = showCreate ? [...results, { disabled: createLocked }] : results;\n const rowCount = rows.length;\n const optionId = (index: number) => `${listboxId}-option-${index}`;\n // The core opens on row 0 and knows nothing of `disabled`; the highlight is settled\n // HERE, derived, so it can never rest on a row that cannot be taken — whatever the\n // async list turned out to hold.\n const current = settleEnabled(rows, active);\n const activeId = current >= 0 ? optionId(current) : undefined;\n useActiveOptionScroll(activeId);\n // The consumers resolve their own props against the provider already; this is\n // for the loading row, which no consumer names, and for a caller that renders the\n // panel directly and leaves the two optional strings out.\n const labels = useKitLabels(\"combobox\", DEFAULT_COMBOBOX_LABELS);\n // Portalled to <body>, the panel leaves the subtree its `dir` came from — so the\n // direction is read off the trigger and put back on the panel below.\n const dir = useAnchorDir(core.triggerRef, core.open);\n const remPx = useRemPx();\n // A `fit` panel's measured width — what it takes to keep it on the glass (see\n // `ComboboxPanelWidth.fit`). Observed rather than read once: the rows change under the\n // search, and a filtered list of short names is a narrower panel. `null` where nothing\n // is laid out (jsdom), and the least width is used.\n const fit = width?.fit === true && !isPhone;\n const [fitWidth, setFitWidth] = useState<number | null>(null);\n const placed = core.open && rect !== null;\n useLayoutEffect(() => {\n const el = panelRef.current;\n if (!fit || !placed || !el || typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(() => {\n const measured = el.getBoundingClientRect().width;\n setFitWidth(measured > 0 ? measured : null);\n });\n observer.observe(el);\n return () => observer.disconnect();\n }, [fit, placed, panelRef]);\n\n // The toolbar's own box, so the keyboard can tell its buttons from the search box.\n const toolbarRef = useRef<HTMLDivElement>(null);\n // The kit's one tab-stop rule (0.52 code review, lib/focus-left.ts): this had a third\n // copy of the selector, without its `hidden`/`inert` half. An `aria-disabled` button\n // stays a stop — it keeps its focus (INP-9).\n const toolbarStops = () => (toolbarRef.current ? tabStops(toolbarRef.current, { includeSelf: false }) : []);\n // A POINTER press on the toolbar leaves the focus in the search box, as a press on a\n // row does: since a toolbar button's keys are its own (INP-9), a mouse press — which\n // focuses a button in Chrome and Firefox — left the arrows on \"Select all\", where they\n // did nothing; until 0.52 they moved the list's highlight (0.52 code review,\n // combobox-core.tsx). Tab still reaches the buttons. A field in a toolbar keeps its\n // press: it is there to be typed in.\n const toolbarBox = hasContent(toolbar) && (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions -- never focused itself: it only keeps a pointer press on its buttons from taking the focus out of the search box.\n <div\n ref={toolbarRef}\n onMouseDown={(e) => {\n if (!(e.target as Element).closest(\"input, select, textarea, [contenteditable]\")) e.preventDefault();\n }}\n >\n {toolbar}\n </div>\n );\n /** Tab on a toolbar button in the anchored panel: Shift+Tab off the first goes back to\n * the search box, Tab off the last leaves as the search box's Tab did; between two of\n * them the browser's own Tab is right, as they stand next to each other. */\n const tabInToolbar = (e: ReactKeyboardEvent) => {\n const stops = toolbarStops();\n const at = stops.indexOf(e.target as HTMLElement);\n if (e.shiftKey && at === 0) {\n e.preventDefault();\n inputRef.current?.focus();\n } else if (!e.shiftKey && at === stops.length - 1) {\n e.preventDefault();\n closeToTrigger();\n }\n };\n\n // The WAI-ARIA APG's listbox keyboard, in full: Up/Down step, Home/End jump, Enter\n // commits, Tab leaves, Escape closes. On the panel's search box — in the anchored\n // panel and, through `onSearchKeyDown`, in the phone sheet's header (BUG-5).\n const onKeyDown = (e: ReactKeyboardEvent) => {\n // Escape goes to the top of the kit's Escape stack — this list, which opened over\n // any dialog it sits in — and stops HERE (round 0.34 BUG-1, Wave 2 DUP-1). The\n // panel's events travel up the React tree through that dialog, portal or not, and\n // one press used to close the dialog and throw the form away, list still open.\n if (takeEscape(e)) return;\n // A key on a toolbar button is the button's — Enter and Space press it — and not the\n // list's: Enter there toggled the highlighted row instead of pressing \"Select all\".\n // Only Tab is the panel's (refactor audit 2026-10-30, INP-9). The phone sheet hands\n // this handler its search box's keys alone, and its trap keeps Tab.\n if (toolbarRef.current?.contains(e.target as Node)) {\n if (e.key === \"Tab\" && !isPhone) tabInToolbar(e);\n return;\n }\n // The Enter that confirms an IME composition is the IME's (BUG-9).\n if (isImeEnter(e)) return;\n // Disabled rows are passed over (`stepEnabled`), and each step starts from the\n // SETTLED highlight, not the raw index, so the first Down from a disabled row 0\n // goes to the row after the one already shown as highlighted.\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n setActive(stepEnabled(rows, current, 1));\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n setActive(current < 0 ? -1 : stepEnabled(rows, current, -1));\n } else if (e.key === \"Home\") {\n e.preventDefault();\n setActive(stepEnabled(rows, -1, 1));\n } else if (e.key === \"End\") {\n e.preventDefault();\n setActive(stepEnabled(rows, rowCount, -1));\n } else if (e.key === \"Enter\") {\n e.preventDefault();\n if (current < 0) return;\n if (current < results.length) onChoose(results[current]);\n else if (showCreate && !createLocked) onCreate();\n } else if (e.key === \"Tab\" && !isPhone) {\n // The panel is PORTALLED to <body>, so the browser's own Tab would move from\n // here to whatever follows the portal — i.e. off the end of the document. The\n // trade is one extra Tab (trigger, then onward) against never stranding focus\n // at the bottom of the page. The phone sheet is a dialog, and its trap keeps Tab.\n // A panel with a toolbar is walked through it first: the rows are not tab stops,\n // so MultiSelect's \"Select all\" and \"Clear\" were out of a keyboard's reach (INP-9).\n e.preventDefault();\n const first = e.shiftKey ? undefined : toolbarStops()[0];\n if (first) first.focus();\n else closeToTrigger();\n }\n };\n\n // What the list holds, said in ONE place that is both on screen and a polite\n // live region. Focus stays in the search box, so the list changing under it was\n // silent — a reader typed and heard nothing back, and a failed lookup was the same\n // silence as a slow one. Outside the listbox, which may own only options.\n //\n // Three different empties, and only one of them is \"nothing matched\": a lookup\n // that failed must not claim there is nothing to find, and a query under\n // `minChars` was never asked. With rows showing, the count is for the reader only.\n const message: ReactNode =\n busy && results.length === 0 ? (\n // The ellipsis is the picture; the words are for a reader, who otherwise met\n // an empty-looking list with a lone \"…\" in it — or, in most readers, nothing\n // at all, since punctuation alone is skipped.\n <>\n <span aria-hidden>…</span>\n <span className=\"sr-only\">{labels.loading}</span>\n </>\n ) : busy ? (\n // Loading with the LAST query's rows still up. This was `null`, so a refetch —\n // a new query, or a caller's `loading` while it reloads — looked exactly like a\n // finished list: rows that were about to be replaced, with nothing saying so.\n // A line of its own under the rows, in words, so it reads without the spinner.\n <span className=\"flex items-center gap-2\">\n <Spinner label={null} className=\"size-3.5 border\" />\n {labels.loading}\n </span>\n ) : results.length === 0 && !showCreate ? (\n failed ? (\n (loadErrorLabel ?? labels.loadError)\n ) : tooShort ? (\n labels.minChars(core.minChars)\n ) : (\n (emptyLabel ?? labels.noResults)\n )\n ) : null;\n // `relative` so the sr-only text has a local containing block (see\n // sr-only-containment.test).\n const announcement = (\n <div\n role=\"status\"\n aria-live=\"polite\"\n className={cn(\n \"relative\",\n message !== null && cn(\"py-2 text-sm\", isPhone ? \"px-4\" : \"px-3\"),\n failed ? \"text-danger\" : \"text-muted\",\n )}\n >\n {message ?? (results.length > 0 && <span className=\"sr-only\">{labels.resultCount(results.length)}</span>)}\n </div>\n );\n\n if (!core.open || typeof document === \"undefined\") return null;\n\n // One option row — the same in both containers and in both layouts.\n const optionRow = (o: ComboOption<V>, i: number) => {\n const selected = isSelected(o.value);\n return (\n <li role=\"presentation\">\n <button\n type=\"button\"\n id={optionId(i)}\n role=\"option\"\n aria-selected={selected}\n aria-disabled={o.disabled || undefined}\n tabIndex={-1}\n onMouseDown={(e) => {\n e.preventDefault();\n if (!o.disabled) onChoose(o);\n }}\n onMouseEnter={() => {\n if (!o.disabled) setActive(i);\n }}\n className={cn(\n isPhone\n ? SHEET_ROW_CLASS\n : columns\n ? // A cell of a column (GroupedPicker): tighter, so four columns fit.\n \"flex w-full items-center gap-1.5 rounded px-1.5 py-0.5 text-start text-sm\"\n : \"flex w-full items-center gap-2 px-3 py-1.5 text-start text-sm\",\n // The row the arrows are on shows it on a phone too: the sheet takes\n // the keyboard (BUG-5), and a tablet or a desktop at Large has one.\n o.disabled ? DISABLED_ROW_CLASS : i === current ? \"bg-active\" : !isPhone && \"hover:bg-hover\",\n // After SHEET_ROW_CLASS, so its hover is the one cancelled.\n o.disabled && isPhone && DISABLED_ROW_CLASS,\n )}\n >\n {multi && (\n <span\n // The checkbox is a PICTURE of `aria-selected` above, so a reader\n // that met both would be told twice.\n aria-hidden\n className={cn(\n \"flex size-4 shrink-0 items-center justify-center rounded border\",\n selected ? \"border-[var(--bg-inverse)] bg-inverse text-inverse\" : \"border-strong bg-surface\",\n )}\n >\n {selected && <Check className=\"size-3\" />}\n </span>\n )}\n {o.icon && <span className=\"shrink-0\">{o.icon}</span>}\n {renderOption ? (\n <span className=\"flex min-w-0 flex-1 items-center gap-2\">{renderOption(o)}</span>\n ) : (\n /* Label and sublabel wrap from Large up (text size §10.17, round 0.34 T1). */\n <span className=\"min-w-0 flex-1\">\n <span className={cn(\"block truncate-until-large text-primary\", columns && selected && \"font-medium\")}>\n {o.label}\n </span>\n {o.sublabel && <span className=\"block truncate-until-large text-xs text-placeholder\">{o.sublabel}</span>}\n </span>\n )}\n {!multi && selected && <Check className=\"size-4 shrink-0 text-brand\" />}\n </button>\n </li>\n );\n };\n\n const createRow = showCreate && (\n <li role=\"presentation\">\n <button\n type=\"button\"\n id={optionId(results.length)}\n role=\"option\"\n // Never chosen — it is an action, and it disappears the moment it has\n // been taken. Whether the keyboard is ON it is `aria-activedescendant`'s\n // job to say.\n aria-selected={false}\n aria-disabled={createLocked || undefined}\n tabIndex={-1}\n onMouseDown={(e) => {\n e.preventDefault();\n if (!createLocked) onCreate();\n }}\n onMouseEnter={() => {\n if (!createLocked) setActive(results.length);\n }}\n className={cn(\n isPhone ? SHEET_ROW_CLASS : \"flex w-full items-center gap-2 px-3 py-1.5 text-start text-sm\",\n \"text-secondary\",\n createLocked ? DISABLED_ROW_CLASS : current === results.length ? \"bg-active\" : !isPhone && \"hover:bg-hover\",\n // After SHEET_ROW_CLASS, so its hover is the one cancelled.\n createLocked && isPhone && DISABLED_ROW_CLASS,\n )}\n >\n <Plus className=\"size-4 shrink-0\" />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate-until-large\">{createContent}</span>\n {createLocked && (\n <span className=\"block truncate-until-large text-xs text-placeholder\">{createDisabledReason}</span>\n )}\n </span>\n </button>\n </li>\n );\n\n // The rows' group runs — `results` keeps its source order, so a run is the rows up to\n // the next change of group. In columns, a block per run.\n const runs = groupRuns(results, (o) => o.group);\n\n const list = (\n <ul\n id={listboxId}\n role=\"listbox\"\n aria-multiselectable={multi}\n // The rows are provisional while a lookup is in flight — whether or not the\n // previous query's are still showing.\n aria-busy={busy || undefined}\n // It scrolls, and says so where jsdom can see it (see `CLIPS_ATTRIBUTE`): a\n // Tooltip in a row then portals out in a test exactly as it does in the\n // browser, instead of joining the option's accessible name (keksdose E8).\n {...{ [CLIPS_ATTRIBUTE]: \"\" }}\n className={cn(\n \"min-h-0 flex-1 overflow-y-auto\",\n columns && !isPhone ? \"columns-2 gap-4 p-3 md:columns-3 xl:columns-4\" : \"py-1\",\n isPhone && \"flex-none\",\n )}\n >\n {columns && !isPhone ? (\n keyRuns(runs).map(({ run, key }) => (\n // A column block: its heading is a picture of the group's name, which the\n // `role=\"group\"` carries for a reader — the listbox may own options and\n // groups, and a heading of loose text in it is neither. Keyed as\n // GroupedOptions keys a run, so a filter does not rebuild the later columns.\n <li key={key} role=\"presentation\" className=\"mb-3 break-inside-avoid\">\n {run.group !== null && (\n <div aria-hidden className=\"mb-1 text-xs font-semibold uppercase tracking-wide text-muted\">\n {run.group}\n </div>\n )}\n <ul role=\"group\" aria-label={run.group ?? undefined} className=\"space-y-0.5\">\n {run.rows.map((o, k) => (\n <Fragment key={String(o.value)}>{optionRow(o, run.start + k)}</Fragment>\n ))}\n </ul>\n </li>\n ))\n ) : (\n // One heading per group rather than a grey suffix on every row (#136), and the\n // thing the native <select>'s <optgroup> used to give the account picker for\n // free (live #200) — a `role=\"group\"` it names (INP-8). Keksdose repeats\n // recently-used categories in a \"Recent\" group at the top (live #203): a value\n // is a row's key within its group alone.\n <GroupedOptions\n runs={runs}\n listboxId={listboxId}\n rowKey={(o) => String(o.value)}\n row={optionRow}\n headingClassName={(run) => (isPhone ? \"px-4 pb-1 pt-3 text-xs\" : anchoredHeadingClass(run))}\n />\n )}\n {createRow}\n </ul>\n );\n\n // The search box is NAMED, not only prompted: a placeholder is gone the moment a\n // character is typed, and jsdom's readers and some real ones never took it for a name\n // (BUG-12: GroupedPicker's filter had \"no name beyond its placeholder\").\n const searchText = searchPlaceholder ?? labels.search;\n\n if (isPhone) {\n return (\n <PickerSheet\n // First, so the sheet's own props below win: `rest` is typed as div\n // attributes, and the DOM's `title` is a tooltip string where the sheet's is\n // its heading — one name, two meanings, and the sheet's is the one the caller\n // asked for.\n {...rest}\n className={className}\n style={style}\n open\n // The X, Done, Escape and Back hand focus to the trigger, as taking a row does:\n // these triggers open on a click, never on focus, so focusing one re-opens\n // nothing — and the sheet, which cannot know that, leaves focus on <body>\n // (refactor audit 2026-10-30, INP-7).\n onClose={closeToTrigger}\n title={sheetTitle}\n query={query}\n onQueryChange={setQuery}\n searchPlaceholder={searchText}\n searchLabel={searchText}\n inputRef={inputRef}\n closeLabel={closeLabel}\n // The sheet's search box is in its HEADER, outside the list: the keys go to it\n // there, and it names the list and the active row (BUG-5). A div around the list\n // used to catch them, and never did — focus is in the box, not in the list.\n onSearchKeyDown={onKeyDown}\n listboxId={listboxId}\n activeId={activeId}\n // A multi list stays open as rows are ticked, so the sheet needs a way out\n // that is not the X in its corner: the kit's sticky \"Done\" (keksdose #412).\n // A single pick closes the sheet itself.\n done={multi}\n >\n {toolbarBox}\n <div className=\"relative\">\n {list}\n {announcement}\n </div>\n </PickerSheet>\n );\n }\n\n if (!rect) return null;\n // The panel hangs from the trigger's START edge (or, `align=\"end\"`, its end): its left\n // in a left-to-right form, its right in a right-to-left one, at least 13.75rem wide\n // (220 px at Normal, in rem so its text keeps its room at Large, §3.2; `width.minRem`)\n // and never wider than the glass — and clamped to the glass, which in a left-to-right\n // form it never was (Wave 2, DUP-7). It is placed by the edge it hangs from, so a `fit`\n // panel grows away from the trigger's edge before its width is measured; a box hung by\n // its `right` is measured from inside any scrollbar, as the glass's width is.\n const glass = viewportSize().width - 2 * PANEL_EDGE;\n const least = Math.min(Math.max(rect.width, (width?.minRem ?? PANEL_MIN_REM) * remPx), glass);\n const most = Math.max(least, Math.min(width?.maxRem !== undefined ? width.maxRem * remPx : glass, glass));\n const panelWidth = fit ? Math.min(Math.max(fitWidth ?? least, least), most) : least;\n const at = anchoredInline(rect, panelWidth, { dir, align, edge: PANEL_EDGE });\n const inline = (dir === \"rtl\") === (align === \"start\") ? { right: at.right } : { left: at.left };\n\n return createPortal(\n /* eslint-disable-next-line jsx-a11y/no-static-element-interactions -- never focused\n itself: it catches the listbox keys bubbling from the search <input> inside it,\n which holds focus while the panel is open. */\n <div\n // Spread FIRST: `onKeyDown` below is the listbox keyboard (Up/Down/Home/End/\n // Enter/Tab) and the placement is measured rather than chosen, so neither is a\n // caller's to replace by accident — while a `data-*` anchor or an\n // `aria-describedby` has nothing to collide with.\n {...rest}\n ref={panelRef}\n // A kit layer, for the tour's layer order (0.50, docs/tours-harmonization.md §11.6).\n data-kit-layer=\"\"\n dir={dir}\n onKeyDown={onKeyDown}\n // A press in a panel opened from a row is inside this list for the core's outside\n // press, though portalled elsewhere (dev#623).\n onPointerDownCapture={(e) => {\n rest.onPointerDownCapture?.(e);\n pressInside(panelRef)?.(e);\n }}\n // `placement` keeps the panel inside the region actually on screen: on a phone\n // the search box below pulls up the keyboard, and a panel pinned under a\n // low trigger would otherwise sit entirely behind it (feedback #135). Flipped\n // above, it hangs from its bottom edge, so a list shorter than its cap still meets\n // the trigger (keksdose K1); the edge not in use is cleared, a caller's included.\n style={{\n ...style,\n position: \"fixed\",\n top: placement.above ? undefined : placement.top,\n bottom: placement.above ? placement.bottom : undefined,\n ...inline,\n // A `fit` panel takes its width from its rows between the two bounds; any other\n // is exactly the least width.\n ...(fit ? { width: \"max-content\", minWidth: least, maxWidth: most } : { width: panelWidth }),\n maxHeight: placement.maxHeight,\n }}\n className={cn(\"z-50 flex flex-col rounded-md border border-subtle bg-surface shadow-lg\", className)}\n >\n <DropdownSearchHeader\n query={query}\n onQueryChange={setQuery}\n inputRef={inputRef}\n placeholder={searchText}\n aria-label={searchText}\n // Focus is in this box while the list is up, so this is what has to name the\n // list and the row the arrows are on.\n listboxId={listboxId}\n activeId={activeId}\n />\n {toolbarBox}\n {/* One list, two containers: the desktop panel and the phone sheet render\n the same rows through the same handlers (live #200). */}\n {list}\n {announcement}\n </div>,\n document.body,\n );\n}\n"],"mappings":";AA4KI,SA0zBE,UA1zBF,KAyWE,YAzWF;AA5KJ,SAAS,YAAAA,WAAU,WAAW,iBAAiB,SAAS,QAAQ,gBAAgB;AAChF,SAAS,oBAAoB;AAS7B,SAAS,OAAO,YAAY;AAC5B,SAAS,UAAU;AACnB,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AACzB,SAAS,4BAA4B;AACrC,SAAS,aAAa,uBAAuB;AAC7C,SAAS,gBAAgB,gBAAgB;AACzC,SAAS,6BAA6B;AACtC,SAAS,eAAe;AACxB,SAAS,oBAAoB;AAE7B,SAAS,gBAAgB,kBAAkB,oBAAwC;AACnF,SAAS,aAAa,YAAY,iBAAiB,uBAAuB;AAC1E,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAC3B,SAAS,eAAe,UAAU,mBAAmB;AACrD,SAAS,yBAAyB,cAAc,oBAAoB;AACpE,SAAS,kBAAkB;AAiDpB,MAAM,kBAAkB,CAAC,MAAmD,MAAM,UAAa,CAAC,EAAE;AAQlG,SAAS,YAAY,MAAyC,MAAc,KAAqB;AACtG,WAAS,IAAI,OAAO,KAAK,KAAK,KAAK,IAAI,KAAK,QAAQ,KAAK,KAAK;AAC5D,QAAI,CAAC,KAAK,CAAC,EAAE,SAAU,QAAO;AAAA,EAChC;AACA,SAAO,QAAQ,KAAK,OAAO,KAAK,SAAS,OAAO;AAClD;AAKO,SAAS,cAAc,MAAyC,GAAmB;AACxF,MAAI,IAAI,KAAK,KAAK,KAAK,OAAQ,QAAO;AACtC,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