@eifi1/ui-kit 0.51.7 → 0.53.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 (775) hide show
  1. package/README.md +178 -67
  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 +10 -7
  60. package/dist/billing/cancel-subscription.js +6 -6
  61. package/dist/billing/cancel-subscription.js.map +1 -1
  62. package/dist/billing/plan-card.d.ts +5 -3
  63. package/dist/billing/plan-card.js +7 -8
  64. package/dist/billing/plan-card.js.map +1 -1
  65. package/dist/billing/plan-change-labels.d.ts +42 -0
  66. package/dist/billing/plan-change-labels.js +22 -0
  67. package/dist/billing/plan-change-labels.js.map +1 -0
  68. package/dist/billing/plan-switch.d.ts +9 -6
  69. package/dist/billing/plan-switch.js +7 -5
  70. package/dist/billing/plan-switch.js.map +1 -1
  71. package/dist/chart.d.ts +4 -3
  72. package/dist/chart.js +72 -4
  73. package/dist/chart.js.map +1 -1
  74. package/dist/components/account-chips.d.ts +5 -5
  75. package/dist/components/account-chips.js +11 -13
  76. package/dist/components/account-chips.js.map +1 -1
  77. package/dist/components/alert-banner.d.ts +16 -5
  78. package/dist/components/alert-banner.js +46 -1
  79. package/dist/components/alert-banner.js.map +1 -1
  80. package/dist/components/amount-input.d.ts +13 -0
  81. package/dist/components/amount-input.js +1 -0
  82. package/dist/components/amount-input.js.map +1 -1
  83. package/dist/components/autocomplete.js +57 -65
  84. package/dist/components/autocomplete.js.map +1 -1
  85. package/dist/components/bulk-action-bar.d.ts +12 -2
  86. package/dist/components/bulk-action-bar.js +65 -21
  87. package/dist/components/bulk-action-bar.js.map +1 -1
  88. package/dist/components/button-look.d.ts +5 -5
  89. package/dist/components/button-look.js.map +1 -1
  90. package/dist/components/button.d.ts +2 -2
  91. package/dist/components/button.js.map +1 -1
  92. package/dist/components/chart-edge.d.ts +16 -0
  93. package/dist/components/chart-edge.js +14 -1
  94. package/dist/components/chart-edge.js.map +1 -1
  95. package/dist/components/chart-figure.d.ts +13 -0
  96. package/dist/components/chart-figure.js +15 -0
  97. package/dist/components/chart-figure.js.map +1 -0
  98. package/dist/components/chart-zoom-core.js +1 -4
  99. package/dist/components/chart-zoom-core.js.map +1 -1
  100. package/dist/components/chart.d.ts +8 -1
  101. package/dist/components/chart.js +19 -10
  102. package/dist/components/chart.js.map +1 -1
  103. package/dist/components/combobox-core.d.ts +111 -2
  104. package/dist/components/combobox-core.js +148 -42
  105. package/dist/components/combobox-core.js.map +1 -1
  106. package/dist/components/combobox.d.ts +1 -1
  107. package/dist/components/combobox.js +141 -130
  108. package/dist/components/combobox.js.map +1 -1
  109. package/dist/components/copy-button.d.ts +6 -5
  110. package/dist/components/copy-button.js +5 -3
  111. package/dist/components/copy-button.js.map +1 -1
  112. package/dist/components/country-select.js +2 -2
  113. package/dist/components/country-select.js.map +1 -1
  114. package/dist/components/data-table-column-settings.d.ts +1 -1
  115. package/dist/components/data-table-column-settings.js +33 -7
  116. package/dist/components/data-table-column-settings.js.map +1 -1
  117. package/dist/components/data-table-filters.d.ts +4 -2
  118. package/dist/components/data-table-filters.js +2 -2
  119. package/dist/components/data-table-filters.js.map +1 -1
  120. package/dist/components/data-table-fit.d.ts +6 -4
  121. package/dist/components/data-table-fit.js +4 -1
  122. package/dist/components/data-table-fit.js.map +1 -1
  123. package/dist/components/data-table-groups.d.ts +1 -1
  124. package/dist/components/data-table-groups.js.map +1 -1
  125. package/dist/components/data-table-head.d.ts +1 -1
  126. package/dist/components/data-table-head.js +15 -12
  127. package/dist/components/data-table-head.js.map +1 -1
  128. package/dist/components/data-table-mobile.d.ts +12 -7
  129. package/dist/components/data-table-mobile.js +43 -30
  130. package/dist/components/data-table-mobile.js.map +1 -1
  131. package/dist/components/data-table-pagination.js +11 -6
  132. package/dist/components/data-table-pagination.js.map +1 -1
  133. package/dist/components/data-table-resize.d.ts +1 -1
  134. package/dist/components/data-table-resize.js.map +1 -1
  135. package/dist/components/data-table-row-actions.d.ts +2 -2
  136. package/dist/components/data-table-row-actions.js.map +1 -1
  137. package/dist/components/data-table-row.d.ts +6 -2
  138. package/dist/components/data-table-row.js +17 -10
  139. package/dist/components/data-table-row.js.map +1 -1
  140. package/dist/components/data-table-selection.d.ts +1 -1
  141. package/dist/components/data-table-selection.js.map +1 -1
  142. package/dist/components/data-table-shared.d.ts +10 -2
  143. package/dist/components/data-table-shared.js +18 -0
  144. package/dist/components/data-table-shared.js.map +1 -1
  145. package/dist/components/data-table-sort.d.ts +21 -2
  146. package/dist/components/data-table-sort.js +24 -0
  147. package/dist/components/data-table-sort.js.map +1 -1
  148. package/dist/components/data-table-virtual.d.ts +1 -1
  149. package/dist/components/data-table-virtual.js +18 -6
  150. package/dist/components/data-table-virtual.js.map +1 -1
  151. package/dist/components/data-table.d.ts +13 -4
  152. package/dist/components/data-table.js +139 -36
  153. package/dist/components/data-table.js.map +1 -1
  154. package/dist/components/date-field.d.ts +25 -3
  155. package/dist/components/date-field.js +33 -8
  156. package/dist/components/date-field.js.map +1 -1
  157. package/dist/components/date-picker.d.ts +16 -3
  158. package/dist/components/date-picker.js +55 -26
  159. package/dist/components/date-picker.js.map +1 -1
  160. package/dist/components/date-range-picker.d.ts +38 -24
  161. package/dist/components/date-range-picker.js +23 -7
  162. package/dist/components/date-range-picker.js.map +1 -1
  163. package/dist/components/error-boundary.js +37 -30
  164. package/dist/components/error-boundary.js.map +1 -1
  165. package/dist/components/{ui-labels.d.ts → field-base-labels.d.ts} +0 -2
  166. package/dist/components/{ui-labels.js → field-base-labels.js} +2 -9
  167. package/dist/components/field-base-labels.js.map +1 -0
  168. package/dist/components/field-base.d.ts +4 -3
  169. package/dist/components/field-base.js +3 -3
  170. package/dist/components/field-base.js.map +1 -1
  171. package/dist/components/form-actions.js +11 -5
  172. package/dist/components/form-actions.js.map +1 -1
  173. package/dist/components/hover-menu.d.ts +3 -0
  174. package/dist/components/hover-menu.js +5 -3
  175. package/dist/components/hover-menu.js.map +1 -1
  176. package/dist/components/icon-button.js +14 -9
  177. package/dist/components/icon-button.js.map +1 -1
  178. package/dist/components/inline-confirm.d.ts +43 -0
  179. package/dist/components/inline-confirm.js +67 -0
  180. package/dist/components/inline-confirm.js.map +1 -0
  181. package/dist/components/inline-entity-combobox.d.ts +4 -3
  182. package/dist/components/inline-entity-combobox.js +148 -140
  183. package/dist/components/inline-entity-combobox.js.map +1 -1
  184. package/dist/components/input.js +1 -1
  185. package/dist/components/input.js.map +1 -1
  186. package/dist/components/jump-calendar.js +28 -112
  187. package/dist/components/jump-calendar.js.map +1 -1
  188. package/dist/components/legal-page.d.ts +3 -1
  189. package/dist/components/legal-page.js +3 -2
  190. package/dist/components/legal-page.js.map +1 -1
  191. package/dist/components/legal.d.ts +4 -2
  192. package/dist/components/legal.js.map +1 -1
  193. package/dist/components/lightbox.d.ts +2 -2
  194. package/dist/components/lightbox.js +17 -6
  195. package/dist/components/lightbox.js.map +1 -1
  196. package/dist/components/list.d.ts +6 -2
  197. package/dist/components/list.js +3 -2
  198. package/dist/components/list.js.map +1 -1
  199. package/dist/components/measured-grid.d.ts +1 -1
  200. package/dist/components/measured-grid.js +2 -1
  201. package/dist/components/measured-grid.js.map +1 -1
  202. package/dist/components/mini-calendar.js +3 -5
  203. package/dist/components/mini-calendar.js.map +1 -1
  204. package/dist/components/modal.js +3 -1
  205. package/dist/components/modal.js.map +1 -1
  206. package/dist/components/month-grid.d.ts +55 -0
  207. package/dist/components/month-grid.js +148 -0
  208. package/dist/components/month-grid.js.map +1 -0
  209. package/dist/components/month-picker.d.ts +36 -4
  210. package/dist/components/month-picker.js +123 -146
  211. package/dist/components/month-picker.js.map +1 -1
  212. package/dist/components/multi-select.d.ts +2 -2
  213. package/dist/components/multi-select.js +11 -6
  214. package/dist/components/multi-select.js.map +1 -1
  215. package/dist/components/nav-pills.d.ts +1 -1
  216. package/dist/components/nav-pills.js.map +1 -1
  217. package/dist/components/picker-sheet.js +2 -1
  218. package/dist/components/picker-sheet.js.map +1 -1
  219. package/dist/components/pie-chart-labels.d.ts +7 -0
  220. package/dist/components/pie-chart-labels.js +1 -0
  221. package/dist/components/pie-chart-labels.js.map +1 -1
  222. package/dist/components/pie-chart.d.ts +5 -3
  223. package/dist/components/pie-chart.js +7 -22
  224. package/dist/components/pie-chart.js.map +1 -1
  225. package/dist/components/popover.d.ts +3 -0
  226. package/dist/components/popover.js +7 -1
  227. package/dist/components/popover.js.map +1 -1
  228. package/dist/components/row-actions.js +2 -1
  229. package/dist/components/row-actions.js.map +1 -1
  230. package/dist/components/series-chart-axes.d.ts +4 -4
  231. package/dist/components/series-chart-axes.js.map +1 -1
  232. package/dist/components/series-chart-labels.d.ts +7 -4
  233. package/dist/components/series-chart-labels.js.map +1 -1
  234. package/dist/components/series-chart.d.ts +92 -23
  235. package/dist/components/series-chart.js +74 -30
  236. package/dist/components/series-chart.js.map +1 -1
  237. package/dist/components/share-card.js +3 -3
  238. package/dist/components/share-card.js.map +1 -1
  239. package/dist/components/tabs-labels.d.ts +2 -0
  240. package/dist/components/tabs-labels.js +11 -0
  241. package/dist/components/tabs-labels.js.map +1 -0
  242. package/dist/components/tabs.d.ts +1 -1
  243. package/dist/components/tabs.js +1 -1
  244. package/dist/components/tabs.js.map +1 -1
  245. package/dist/components/toggle-legend.d.ts +2 -2
  246. package/dist/components/toggle-legend.js +6 -6
  247. package/dist/components/toggle-legend.js.map +1 -1
  248. package/dist/components/translation-review-editor.d.ts +4 -2
  249. package/dist/components/translation-review-editor.js +2 -3
  250. package/dist/components/translation-review-editor.js.map +1 -1
  251. package/dist/components/translation-review.d.ts +2 -1
  252. package/dist/components/translation-review.js +2 -2
  253. package/dist/components/translation-review.js.map +1 -1
  254. package/dist/components/treemap-labels.d.ts +31 -0
  255. package/dist/components/treemap-labels.js +10 -0
  256. package/dist/components/treemap-labels.js.map +1 -0
  257. package/dist/components/treemap-layout.d.ts +62 -0
  258. package/dist/components/treemap-layout.js +126 -0
  259. package/dist/components/treemap-layout.js.map +1 -0
  260. package/dist/components/treemap.d.ts +167 -19
  261. package/dist/components/treemap.js +340 -100
  262. package/dist/components/treemap.js.map +1 -1
  263. package/dist/components/use-table-state.d.ts +5 -5
  264. package/dist/components/use-table-state.js +4 -1
  265. package/dist/components/use-table-state.js.map +1 -1
  266. package/dist/data-table.d.ts +1 -2
  267. package/dist/data-table.js +1 -4
  268. package/dist/data-table.js.map +1 -1
  269. package/dist/demo/demo-countdown.d.ts +0 -5
  270. package/dist/demo/demo-countdown.js +0 -4
  271. package/dist/demo/demo-countdown.js.map +1 -1
  272. package/dist/eslint/index.js +1 -1
  273. package/dist/eslint/role-utilities.d.ts +36 -7
  274. package/dist/eslint/role-utilities.js +42 -9
  275. package/dist/eslint/role-utilities.js.map +1 -1
  276. package/dist/feedback/feedback-dialog.d.ts +25 -16
  277. package/dist/feedback/feedback-dialog.js +6 -2
  278. package/dist/feedback/feedback-dialog.js.map +1 -1
  279. package/dist/feedback/feedback-mutation.d.ts +18 -0
  280. package/dist/feedback/feedback-mutation.js +8 -0
  281. package/dist/feedback/feedback-mutation.js.map +1 -0
  282. package/dist/feedback/feedback-page-link.d.ts +53 -0
  283. package/dist/feedback/feedback-page-link.js +37 -0
  284. package/dist/feedback/feedback-page-link.js.map +1 -0
  285. package/dist/feedback/feedback-public-list.d.ts +8 -4
  286. package/dist/feedback/feedback-public-list.js +2 -2
  287. package/dist/feedback/feedback-public-list.js.map +1 -1
  288. package/dist/feedback/feedback-replies.d.ts +3 -1
  289. package/dist/feedback/feedback-replies.js +5 -4
  290. package/dist/feedback/feedback-replies.js.map +1 -1
  291. package/dist/feedback/feedback-row-detail-labels.js +0 -3
  292. package/dist/feedback/feedback-row-detail-labels.js.map +1 -1
  293. package/dist/feedback/feedback-row-detail.d.ts +33 -44
  294. package/dist/feedback/feedback-row-detail.js +28 -34
  295. package/dist/feedback/feedback-row-detail.js.map +1 -1
  296. package/dist/feedback/feedback-status-undo.d.ts +17 -14
  297. package/dist/feedback/feedback-status-undo.js +10 -15
  298. package/dist/feedback/feedback-status-undo.js.map +1 -1
  299. package/dist/feedback/feedback-submit-dialog.d.ts +1 -1
  300. package/dist/feedback/feedback-submit-dialog.js +1 -1
  301. package/dist/feedback/feedback-submit-dialog.js.map +1 -1
  302. package/dist/feedback/feedback-submit.js +9 -3
  303. package/dist/feedback/feedback-submit.js.map +1 -1
  304. package/dist/feedback/feedback-swipe.d.ts +1 -1
  305. package/dist/feedback/feedback-swipe.js.map +1 -1
  306. package/dist/feedback/feedback-table.d.ts +21 -9
  307. package/dist/feedback/feedback-table.js +45 -25
  308. package/dist/feedback/feedback-table.js.map +1 -1
  309. package/dist/feedback/feedback-thread-labels.d.ts +2 -2
  310. package/dist/feedback/feedback-thread-labels.js.map +1 -1
  311. package/dist/feedback/feedback-thread.d.ts +15 -23
  312. package/dist/feedback/feedback-thread.js +2 -1
  313. package/dist/feedback/feedback-thread.js.map +1 -1
  314. package/dist/feedback.d.ts +6 -6
  315. package/dist/feedback.js +90 -6
  316. package/dist/feedback.js.map +1 -1
  317. package/dist/hooks/use-focus-trap.d.ts +35 -0
  318. package/dist/hooks/use-focus-trap.js +6 -4
  319. package/dist/hooks/use-focus-trap.js.map +1 -1
  320. package/dist/hooks/use-hotkey.d.ts +5 -2
  321. package/dist/hooks/use-hotkey.js +5 -4
  322. package/dist/hooks/use-hotkey.js.map +1 -1
  323. package/dist/hooks/use-long-press.d.ts +7 -4
  324. package/dist/hooks/use-long-press.js +3 -0
  325. package/dist/hooks/use-long-press.js.map +1 -1
  326. package/dist/hooks/use-media-query.js +12 -4
  327. package/dist/hooks/use-media-query.js.map +1 -1
  328. package/dist/hooks/use-mounted.d.ts +22 -0
  329. package/dist/hooks/use-mounted.js +24 -0
  330. package/dist/hooks/use-mounted.js.map +1 -0
  331. package/dist/hooks/use-overlay-history.js +19 -3
  332. package/dist/hooks/use-overlay-history.js.map +1 -1
  333. package/dist/i18n/defaults.js +4 -9
  334. package/dist/i18n/defaults.js.map +1 -1
  335. package/dist/i18n/german.js +7 -18
  336. package/dist/i18n/german.js.map +1 -1
  337. package/dist/i18n/kit-labels.d.ts +9 -11
  338. package/dist/i18n/kit-labels.js.map +1 -1
  339. package/dist/i18n/locales/en.js +15 -64
  340. package/dist/i18n/locales/en.js.map +3 -3
  341. package/dist/i18n/locales/es.js +7 -18
  342. package/dist/i18n/locales/es.js.map +1 -1
  343. package/dist/i18n/locales/fr.js +20 -27
  344. package/dist/i18n/locales/fr.js.map +1 -1
  345. package/dist/i18n/locales/hu.js +9 -18
  346. package/dist/i18n/locales/hu.js.map +1 -1
  347. package/dist/i18n/locales/it.js +7 -19
  348. package/dist/i18n/locales/it.js.map +1 -1
  349. package/dist/i18n/locales/zh.js +8 -18
  350. package/dist/i18n/locales/zh.js.map +1 -1
  351. package/dist/i18n/review.js +12 -2
  352. package/dist/i18n/review.js.map +1 -1
  353. package/dist/i18n/shared-labels.js +0 -1
  354. package/dist/i18n/shared-labels.js.map +1 -1
  355. package/dist/index.d.ts +21 -23
  356. package/dist/index.js +50 -65
  357. package/dist/index.js.map +1 -1
  358. package/dist/landing/routing.d.ts +3 -1
  359. package/dist/landing/routing.js +4 -7
  360. package/dist/landing/routing.js.map +1 -1
  361. package/dist/lib/broadcast.d.ts +17 -0
  362. package/dist/lib/broadcast.js +30 -0
  363. package/dist/lib/broadcast.js.map +1 -0
  364. package/dist/lib/date-format.d.ts +37 -2
  365. package/dist/lib/date-format.js +34 -8
  366. package/dist/lib/date-format.js.map +1 -1
  367. package/dist/lib/day-format.d.ts +46 -0
  368. package/dist/lib/day-format.js +46 -0
  369. package/dist/lib/day-format.js.map +1 -0
  370. package/dist/lib/describe-failure.d.ts +14 -0
  371. package/dist/lib/describe-failure.js +9 -0
  372. package/dist/lib/describe-failure.js.map +1 -0
  373. package/dist/lib/direction.d.ts +16 -0
  374. package/dist/lib/direction.js +9 -1
  375. package/dist/lib/direction.js.map +1 -1
  376. package/dist/lib/focus-left.d.ts +63 -0
  377. package/dist/lib/focus-left.js +67 -0
  378. package/dist/lib/focus-left.js.map +1 -0
  379. package/dist/lib/format.js +5 -14
  380. package/dist/lib/format.js.map +1 -1
  381. package/dist/lib/http-status.d.ts +24 -0
  382. package/dist/lib/http-status.js +14 -0
  383. package/dist/lib/http-status.js.map +1 -0
  384. package/dist/lib/intl-cache.d.ts +14 -0
  385. package/dist/lib/intl-cache.js +15 -0
  386. package/dist/lib/intl-cache.js.map +1 -0
  387. package/dist/lib/iso-day.d.ts +11 -0
  388. package/dist/lib/iso-day.js +8 -0
  389. package/dist/lib/iso-day.js.map +1 -0
  390. package/dist/lib/lazy-with-fallback.d.ts +31 -0
  391. package/dist/lib/lazy-with-fallback.js +40 -0
  392. package/dist/lib/lazy-with-fallback.js.map +1 -0
  393. package/dist/lib/path-pattern.d.ts +34 -0
  394. package/dist/lib/path-pattern.js +24 -0
  395. package/dist/lib/path-pattern.js.map +1 -0
  396. package/dist/lib/reduced-motion.d.ts +2 -1
  397. package/dist/lib/reduced-motion.js.map +1 -1
  398. package/dist/lib/round.d.ts +2 -1
  399. package/dist/lib/round.js +2 -1
  400. package/dist/lib/round.js.map +1 -1
  401. package/dist/lib/safe-storage.d.ts +24 -5
  402. package/dist/lib/safe-storage.js +27 -2
  403. package/dist/lib/safe-storage.js.map +1 -1
  404. package/dist/lib/session-refresh.js +1 -1
  405. package/dist/lib/session-refresh.js.map +1 -1
  406. package/dist/lib/share-format.d.ts +13 -0
  407. package/dist/lib/share-format.js +10 -0
  408. package/dist/lib/share-format.js.map +1 -0
  409. package/dist/lib/text-case.d.ts +17 -0
  410. package/dist/lib/text-case.js +8 -0
  411. package/dist/lib/text-case.js.map +1 -0
  412. package/dist/lib/text-match.d.ts +29 -0
  413. package/dist/lib/text-match.js +20 -2
  414. package/dist/lib/text-match.js.map +1 -1
  415. package/dist/lib/thenable.d.ts +13 -0
  416. package/dist/lib/thenable.js +8 -0
  417. package/dist/lib/thenable.js.map +1 -0
  418. package/dist/lib/translation-review.d.ts +7 -2
  419. package/dist/lib/translation-review.js +4 -4
  420. package/dist/lib/translation-review.js.map +1 -1
  421. package/dist/notifications/device-zone-report.js +1 -1
  422. package/dist/notifications/device-zone-report.js.map +1 -1
  423. package/dist/notifications/notification-bell.d.ts +2 -1
  424. package/dist/notifications/notification-bell.js +3 -3
  425. package/dist/notifications/notification-bell.js.map +1 -1
  426. package/dist/notifications/notification-inbox.d.ts +10 -6
  427. package/dist/notifications/notification-inbox.js +26 -48
  428. package/dist/notifications/notification-inbox.js.map +1 -1
  429. package/dist/notifications/notification-parts.d.ts +3 -2
  430. package/dist/notifications/notification-parts.js +1 -3
  431. package/dist/notifications/notification-parts.js.map +1 -1
  432. package/dist/notifications/notification-types-setting.js +1 -1
  433. package/dist/notifications/notification-types-setting.js.map +1 -1
  434. package/dist/notifications/notifications-labels.d.ts +6 -0
  435. package/dist/notifications/notifications-labels.js +1 -0
  436. package/dist/notifications/notifications-labels.js.map +1 -1
  437. package/dist/notifications/push-device-setting.js +1 -1
  438. package/dist/notifications/push-device-setting.js.map +1 -1
  439. package/dist/notifications/push-devices-setting.d.ts +2 -1
  440. package/dist/notifications/push-devices-setting.js +27 -49
  441. package/dist/notifications/push-devices-setting.js.map +1 -1
  442. package/dist/notifications/quiet-hours-setting.d.ts +10 -3
  443. package/dist/notifications/quiet-hours-setting.js +65 -26
  444. package/dist/notifications/quiet-hours-setting.js.map +1 -1
  445. package/dist/notifications/unsubscribe-panel.js +4 -7
  446. package/dist/notifications/unsubscribe-panel.js.map +1 -1
  447. package/dist/notifications/use-push-device.d.ts +39 -1
  448. package/dist/notifications/use-push-device.js +28 -7
  449. package/dist/notifications/use-push-device.js.map +1 -1
  450. package/dist/offline/query-persistence.d.ts +3 -1
  451. package/dist/offline/query-persistence.js +19 -2
  452. package/dist/offline/query-persistence.js.map +1 -1
  453. package/dist/rhf/fields.d.ts +11 -4
  454. package/dist/rhf/fields.js.map +1 -1
  455. package/dist/search/command-palette.js +1 -1
  456. package/dist/search/command-palette.js.map +1 -1
  457. package/dist/search/global-search.js +19 -9
  458. package/dist/search/global-search.js.map +1 -1
  459. package/dist/search/search-index.d.ts +0 -6
  460. package/dist/search/search-index.js +0 -4
  461. package/dist/search/search-index.js.map +1 -1
  462. package/dist/search/use-command-key.d.ts +12 -1
  463. package/dist/search/use-command-key.js +3 -12
  464. package/dist/search/use-command-key.js.map +1 -1
  465. package/dist/search.d.ts +1 -1
  466. package/dist/search.js +6 -1
  467. package/dist/search.js.map +1 -1
  468. package/dist/settings/use-settings-focus.js +1 -0
  469. package/dist/settings/use-settings-focus.js.map +1 -1
  470. package/dist/shell/account-menu-language.d.ts +5 -3
  471. package/dist/shell/account-menu-language.js +2 -2
  472. package/dist/shell/account-menu-language.js.map +1 -1
  473. package/dist/shell/account-menu-text-size.d.ts +9 -6
  474. package/dist/shell/account-menu-text-size.js +2 -2
  475. package/dist/shell/account-menu-text-size.js.map +1 -1
  476. package/dist/shell/app-shell.d.ts +0 -10
  477. package/dist/shell/app-shell.js +1 -7
  478. package/dist/shell/app-shell.js.map +1 -1
  479. package/dist/shell/company-switcher.d.ts +1 -1
  480. package/dist/shell/company-switcher.js.map +1 -1
  481. package/dist/shell/dev-menu.d.ts +1 -1
  482. package/dist/shell/dev-menu.js +5 -18
  483. package/dist/shell/dev-menu.js.map +1 -1
  484. package/dist/shell/top-bar-actions.d.ts +1 -1
  485. package/dist/shell/top-bar-actions.js.map +1 -1
  486. package/dist/shell/top-bar-parts-labels.d.ts +1 -3
  487. package/dist/shell/top-bar-parts-labels.js +0 -1
  488. package/dist/shell/top-bar-parts-labels.js.map +1 -1
  489. package/dist/shell.d.ts +7 -10
  490. package/dist/shell.js +14 -23
  491. package/dist/shell.js.map +1 -1
  492. package/dist/sync/engine.d.ts +30 -4
  493. package/dist/sync/engine.js +172 -52
  494. package/dist/sync/engine.js.map +1 -1
  495. package/dist/sync.d.ts +2 -2
  496. package/dist/sync.js +2 -10
  497. package/dist/sync.js.map +1 -1
  498. package/dist/testing/css-variables.js +3 -8
  499. package/dist/testing/css-variables.js.map +1 -1
  500. package/dist/theme/chart-palette.d.ts +0 -5
  501. package/dist/theme/chart-palette.js +0 -2
  502. package/dist/theme/chart-palette.js.map +1 -1
  503. package/dist/theme/contrast.d.ts +2 -1
  504. package/dist/theme/contrast.js +3 -8
  505. package/dist/theme/contrast.js.map +1 -1
  506. package/dist/theme/palette-store.js +6 -6
  507. package/dist/theme/palette-store.js.map +1 -1
  508. package/dist/theme/text-size.js +3 -8
  509. package/dist/theme/text-size.js.map +1 -1
  510. package/dist/theme/theme-store.js +3 -6
  511. package/dist/theme/theme-store.js.map +1 -1
  512. package/dist/tour/tour-catalogue.d.ts +7 -4
  513. package/dist/tour/tour-catalogue.js +12 -10
  514. package/dist/tour/tour-catalogue.js.map +1 -1
  515. package/dist/tour/tour-dock.d.ts +0 -2
  516. package/dist/tour/tour-dock.js +0 -2
  517. package/dist/tour/tour-dock.js.map +1 -1
  518. package/dist/tour/tour-gates.d.ts +4 -0
  519. package/dist/tour/tour-gates.js +14 -0
  520. package/dist/tour/tour-gates.js.map +1 -1
  521. package/dist/tour/tour-overlay.d.ts +27 -0
  522. package/dist/tour/tour-overlay.js +741 -0
  523. package/dist/tour/tour-overlay.js.map +1 -0
  524. package/dist/tour/tour.d.ts +13 -3
  525. package/dist/tour/tour.js +59 -781
  526. package/dist/tour/tour.js.map +1 -1
  527. package/dist/tour/use-tour-progress.js +1 -1
  528. package/dist/tour/use-tour-progress.js.map +1 -1
  529. package/dist/wizard/stepper-nav.d.ts +5 -1
  530. package/dist/wizard/stepper-nav.js.map +1 -1
  531. package/dist/wizard/types.d.ts +6 -2
  532. package/dist/wizard/types.js.map +1 -1
  533. package/dist/wizard/use-wizard.d.ts +3 -1
  534. package/dist/wizard/use-wizard.js.map +1 -1
  535. package/dist/wizard/validation.d.ts +3 -1
  536. package/dist/wizard/validation.js.map +1 -1
  537. package/package.json +10 -6
  538. package/src/account/account-parts.ts +5 -25
  539. package/src/account/data-export-setting-labels.ts +1 -1
  540. package/src/account/delete-account-setting-labels.ts +1 -1
  541. package/src/account/email-change-setting-labels.ts +1 -1
  542. package/src/account/passkeys-setting.tsx +60 -38
  543. package/src/account/sessions-setting.tsx +18 -12
  544. package/src/admin/admin-action-confirm.tsx +1 -5
  545. package/src/admin/admin-parts.ts +11 -25
  546. package/src/admin/mail-test-card-labels.ts +1 -1
  547. package/src/admin/plan-change-labels.ts +5 -23
  548. package/src/admin/plan-change.tsx +7 -44
  549. package/src/admin/reviewer-scope-editor.tsx +3 -3
  550. package/src/auth/auth-errors-labels.ts +23 -0
  551. package/src/auth/auth-errors.ts +11 -38
  552. package/src/auth/complete-name-dialog.tsx +4 -1
  553. package/src/auth/forgot-password-form-labels.ts +1 -1
  554. package/src/auth/forgot-password-form.tsx +11 -6
  555. package/src/auth/register-form-labels.ts +1 -1
  556. package/src/auth/reset-password-form-labels.ts +1 -1
  557. package/src/auth/reset-password-form.tsx +8 -4
  558. package/src/auth/sign-in-form-labels.ts +1 -1
  559. package/src/auth/status-parts.tsx +0 -6
  560. package/src/auth/verify-email-labels.ts +1 -1
  561. package/src/auth/verify-email.tsx +11 -6
  562. package/src/billing/cancel-subscription.tsx +15 -12
  563. package/src/billing/plan-card.tsx +18 -10
  564. package/src/billing/plan-change-labels.ts +66 -0
  565. package/src/billing/plan-switch.tsx +15 -12
  566. package/src/chart.ts +73 -6
  567. package/src/components/account-chips.tsx +20 -23
  568. package/src/components/alert-banner.tsx +82 -5
  569. package/src/components/amount-input.tsx +18 -7
  570. package/src/components/autocomplete.tsx +64 -70
  571. package/src/components/bulk-action-bar.tsx +70 -2
  572. package/src/components/button-look.ts +5 -5
  573. package/src/components/button.tsx +2 -2
  574. package/src/components/chart-edge.ts +34 -1
  575. package/src/components/chart-figure.tsx +35 -0
  576. package/src/components/chart-zoom-core.tsx +6 -5
  577. package/src/components/chart.tsx +26 -5
  578. package/src/components/combobox-core.tsx +293 -62
  579. package/src/components/combobox.tsx +183 -153
  580. package/src/components/copy-button.tsx +34 -23
  581. package/src/components/country-select.tsx +16 -11
  582. package/src/components/data-table-column-settings.tsx +52 -10
  583. package/src/components/data-table-filters.ts +6 -4
  584. package/src/components/data-table-fit.ts +19 -5
  585. package/src/components/data-table-groups.tsx +1 -1
  586. package/src/components/data-table-head.tsx +32 -22
  587. package/src/components/data-table-mobile.tsx +61 -26
  588. package/src/components/data-table-pagination.tsx +21 -6
  589. package/src/components/data-table-resize.ts +1 -1
  590. package/src/components/data-table-row-actions.tsx +3 -3
  591. package/src/components/data-table-row.tsx +25 -14
  592. package/src/components/data-table-selection.ts +1 -1
  593. package/src/components/data-table-shared.tsx +33 -1
  594. package/src/components/data-table-sort.ts +57 -2
  595. package/src/components/data-table-virtual.ts +32 -8
  596. package/src/components/data-table.tsx +239 -68
  597. package/src/components/date-field.tsx +66 -9
  598. package/src/components/date-picker.tsx +125 -49
  599. package/src/components/date-range-picker.tsx +71 -36
  600. package/src/components/error-boundary.tsx +53 -39
  601. package/src/components/field-base-labels.ts +20 -0
  602. package/src/components/field-base.tsx +13 -7
  603. package/src/components/form-actions.tsx +20 -5
  604. package/src/components/hover-menu.tsx +18 -8
  605. package/src/components/icon-button.tsx +14 -9
  606. package/src/components/inline-confirm.tsx +116 -0
  607. package/src/components/inline-entity-combobox.tsx +197 -153
  608. package/src/components/input.tsx +1 -1
  609. package/src/components/jump-calendar.tsx +30 -146
  610. package/src/components/legal-page.tsx +10 -7
  611. package/src/components/legal.tsx +4 -2
  612. package/src/components/lightbox.tsx +21 -8
  613. package/src/components/list.tsx +10 -4
  614. package/src/components/measured-grid.tsx +8 -4
  615. package/src/components/mini-calendar.tsx +6 -5
  616. package/src/components/modal.tsx +6 -1
  617. package/src/components/month-grid.tsx +229 -0
  618. package/src/components/month-picker.tsx +192 -200
  619. package/src/components/multi-select.tsx +21 -9
  620. package/src/components/nav-pills.tsx +1 -1
  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/series-chart-axes.ts +9 -4
  627. package/src/components/series-chart-labels.ts +7 -4
  628. package/src/components/series-chart.tsx +253 -87
  629. package/src/components/share-card.tsx +6 -6
  630. package/src/components/tabs-labels.ts +13 -0
  631. package/src/components/tabs.tsx +2 -2
  632. package/src/components/toggle-legend.tsx +16 -11
  633. package/src/components/translation-review-editor.tsx +6 -5
  634. package/src/components/translation-review.tsx +4 -3
  635. package/src/components/treemap-labels.ts +47 -0
  636. package/src/components/treemap-layout.ts +210 -0
  637. package/src/components/treemap.tsx +780 -138
  638. package/src/components/use-table-state.ts +12 -9
  639. package/src/data-table.ts +1 -4
  640. package/src/demo/demo-countdown.ts +3 -8
  641. package/src/eslint/role-utilities.ts +97 -19
  642. package/src/feedback/feedback-dialog.tsx +30 -19
  643. package/src/feedback/feedback-mutation.ts +20 -0
  644. package/src/feedback/feedback-page-link.ts +90 -0
  645. package/src/feedback/feedback-public-list.tsx +13 -7
  646. package/src/feedback/feedback-replies.tsx +13 -6
  647. package/src/feedback/feedback-row-detail-labels.ts +0 -3
  648. package/src/feedback/feedback-row-detail.tsx +70 -84
  649. package/src/feedback/feedback-status-undo.ts +28 -28
  650. package/src/feedback/feedback-submit-dialog.tsx +2 -2
  651. package/src/feedback/feedback-submit.tsx +21 -7
  652. package/src/feedback/feedback-swipe.tsx +1 -1
  653. package/src/feedback/feedback-table.tsx +86 -38
  654. package/src/feedback/feedback-thread-labels.ts +2 -2
  655. package/src/feedback/feedback-thread.tsx +18 -26
  656. package/src/feedback.ts +89 -6
  657. package/src/hooks/use-focus-trap.ts +8 -24
  658. package/src/hooks/use-hotkey.ts +24 -7
  659. package/src/hooks/use-long-press.ts +16 -2
  660. package/src/hooks/use-media-query.ts +20 -4
  661. package/src/hooks/use-mounted.ts +39 -0
  662. package/src/hooks/use-overlay-history.ts +32 -3
  663. package/src/i18n/defaults.ts +4 -9
  664. package/src/i18n/german.ts +8 -19
  665. package/src/i18n/kit-labels.tsx +9 -11
  666. package/src/i18n/locales/es.ts +8 -19
  667. package/src/i18n/locales/fr.ts +21 -30
  668. package/src/i18n/locales/hu.ts +10 -19
  669. package/src/i18n/locales/it.ts +8 -20
  670. package/src/i18n/locales/zh.ts +9 -19
  671. package/src/i18n/review.ts +12 -2
  672. package/src/i18n/shared-labels.ts +0 -1
  673. package/src/index.ts +57 -49
  674. package/src/landing/routing.tsx +14 -10
  675. package/src/lib/broadcast.ts +52 -0
  676. package/src/lib/date-format.ts +89 -13
  677. package/src/lib/day-format.ts +96 -0
  678. package/src/lib/describe-failure.ts +18 -0
  679. package/src/lib/direction.ts +39 -0
  680. package/src/lib/focus-left.ts +156 -0
  681. package/src/lib/format.ts +5 -17
  682. package/src/lib/http-status.ts +38 -0
  683. package/src/lib/intl-cache.ts +25 -0
  684. package/src/lib/iso-day.ts +13 -0
  685. package/src/lib/lazy-with-fallback.ts +82 -0
  686. package/src/lib/path-pattern.ts +55 -0
  687. package/src/lib/reduced-motion.ts +2 -1
  688. package/src/lib/round.ts +7 -2
  689. package/src/lib/safe-storage.ts +48 -6
  690. package/src/lib/session-refresh.ts +1 -1
  691. package/src/lib/share-format.ts +18 -0
  692. package/src/lib/text-case.ts +19 -0
  693. package/src/lib/text-match.ts +57 -2
  694. package/src/lib/thenable.ts +19 -0
  695. package/src/lib/translation-review.ts +13 -5
  696. package/src/notifications/device-zone-report.ts +1 -1
  697. package/src/notifications/notification-bell.tsx +7 -4
  698. package/src/notifications/notification-inbox.tsx +40 -58
  699. package/src/notifications/notification-parts.tsx +3 -4
  700. package/src/notifications/notification-types-setting.tsx +1 -1
  701. package/src/notifications/notifications-labels.ts +7 -0
  702. package/src/notifications/push-device-setting.tsx +1 -1
  703. package/src/notifications/push-devices-setting.tsx +30 -55
  704. package/src/notifications/quiet-hours-setting.tsx +93 -31
  705. package/src/notifications/unsubscribe-panel.tsx +4 -7
  706. package/src/notifications/use-push-device.ts +76 -10
  707. package/src/offline/query-persistence.ts +35 -3
  708. package/src/rhf/fields.tsx +11 -4
  709. package/src/search/command-palette.tsx +2 -4
  710. package/src/search/global-search.tsx +36 -15
  711. package/src/search/search-index.ts +0 -15
  712. package/src/search/use-command-key.ts +13 -12
  713. package/src/search.ts +10 -1
  714. package/src/settings/use-settings-focus.ts +3 -0
  715. package/src/shell/account-menu-language.tsx +6 -4
  716. package/src/shell/account-menu-text-size.tsx +10 -7
  717. package/src/shell/app-shell.tsx +0 -13
  718. package/src/shell/company-switcher.tsx +1 -1
  719. package/src/shell/dev-menu.tsx +8 -22
  720. package/src/shell/top-bar-actions.tsx +1 -1
  721. package/src/shell/top-bar-parts-labels.ts +1 -4
  722. package/src/shell.ts +21 -17
  723. package/src/sync/engine.ts +339 -61
  724. package/src/sync.ts +2 -8
  725. package/src/testing/css-variables.ts +8 -9
  726. package/src/theme/chart-palette.ts +0 -2
  727. package/src/theme/contrast.ts +8 -9
  728. package/src/theme/palette-store.ts +9 -9
  729. package/src/theme/text-size.ts +6 -8
  730. package/src/theme/theme-store.ts +7 -9
  731. package/src/tour/tour-catalogue.tsx +26 -15
  732. package/src/tour/tour-dock.ts +0 -2
  733. package/src/tour/tour-gates.ts +23 -0
  734. package/src/tour/tour-overlay.tsx +1170 -0
  735. package/src/tour/tour.tsx +108 -1202
  736. package/src/tour/use-tour-progress.ts +1 -1
  737. package/src/wizard/stepper-nav.tsx +3 -1
  738. package/src/wizard/types.ts +11 -2
  739. package/src/wizard/use-wizard.ts +2 -1
  740. package/src/wizard/validation.ts +8 -2
  741. package/tokens.css +6 -5
  742. package/dist/components/field-sync-labels.d.ts +0 -2
  743. package/dist/components/field-sync-labels.js +0 -12
  744. package/dist/components/field-sync-labels.js.map +0 -1
  745. package/dist/components/field-sync.d.ts +0 -164
  746. package/dist/components/field-sync.js +0 -269
  747. package/dist/components/field-sync.js.map +0 -1
  748. package/dist/components/section-nav.d.ts +0 -37
  749. package/dist/components/section-nav.js +0 -33
  750. package/dist/components/section-nav.js.map +0 -1
  751. package/dist/components/sign-chip-labels.d.ts +0 -2
  752. package/dist/components/sign-chip-labels.js +0 -11
  753. package/dist/components/sign-chip-labels.js.map +0 -1
  754. package/dist/components/sign-chip.d.ts +0 -68
  755. package/dist/components/sign-chip.js +0 -47
  756. package/dist/components/sign-chip.js.map +0 -1
  757. package/dist/components/ui-labels.js.map +0 -1
  758. package/dist/lib/isin.d.ts +0 -28
  759. package/dist/lib/isin.js +0 -36
  760. package/dist/lib/isin.js.map +0 -1
  761. package/dist/shell/dev-switchers.d.ts +0 -6
  762. package/dist/shell/dev-switchers.js +0 -12
  763. package/dist/shell/dev-switchers.js.map +0 -1
  764. package/dist/shell/role-switcher.d.ts +0 -21
  765. package/dist/shell/role-switcher.js +0 -31
  766. package/dist/shell/role-switcher.js.map +0 -1
  767. package/src/components/field-sync-labels.ts +0 -13
  768. package/src/components/field-sync.tsx +0 -482
  769. package/src/components/section-nav.tsx +0 -65
  770. package/src/components/sign-chip-labels.ts +0 -12
  771. package/src/components/sign-chip.tsx +0 -124
  772. package/src/components/ui-labels.ts +0 -24
  773. package/src/lib/isin.ts +0 -62
  774. package/src/shell/dev-switchers.tsx +0 -18
  775. package/src/shell/role-switcher.tsx +0 -46
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/data-table-fit.ts"],"sourcesContent":["import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport type { DataTableColumn } from \"./data-table\";\n\n// DataTable's fit to its own width (0.48, keksdose live #451: \"On expanded sidebar for\n// desktop the table scrolls horizontally. On collapsed sidebar it fits […] Compute the\n// width selectively\"). Two column options, both opt-in:\n//\n// - `grow`: the column takes what the others leave and ellipsises (`w-full max-w-0` on\n// its cells: in an auto table layout that is \"the rest of the row\", never its content's\n// width), so one long title can no longer widen the table.\n// - `fitPriority`: while the table is wider than its scroller — or, with a `grow` column,\n// while that column would get less than {@link GROW_MIN_REM} — the table leaves out\n// its `fitPriority` columns, the LOWEST number first (ties: the later column first),\n// and brings them back in the reverse order as soon as the table, as it is NOW, has\n// room for them (its need re-measured, plus the column's own header width from when\n// it was left out), so narrower content (a filter, another page) counts as much as a\n// wider scroller. The scroller's own width, through a ResizeObserver: a sidebar, a\n// narrower window, the Columns drawer and Large text all count the same. A column\n// whose return the very next measure undoes stays out until the table has more room\n// for it than it had then (0.48.3, keksdose B2: see the bring-back in `measure`). And\n// the TABLE's own width, through the same observer (0.51.2): anything that widens it\n// after a measure — rows drawn a frame later, `virtualize` locking its column widths —\n// is measured again, so the table never stays wider than its scroller.\n\n/** The least a `grow` column keeps before the table starts leaving columns out: about\n * a sentence of a title. In rem, so Large text asks for more. */\nexport const GROW_MIN_REM = 10;\n\n/** The `<th>`/`<td>` classes of a `grow` column. `truncate-until-large`: one line and an\n * ellipsis at Normal, a wrap from Large up (text size §10.17), as every kit title. The\n * header's `min-w-[10rem]` ({@link GROW_MIN_REM}) is the floor once no `fitPriority`\n * column is left to leave out: the table then scrolls sideways rather than crushing the\n * column it exists for (Kurvenschmiede S1, 0.48: Subject was 24px at 1100px). */\nexport const GROW_HEAD_CLASS = \"w-full max-w-0 min-w-[10rem]\";\nexport const GROW_CELL_CLASS = \"w-full max-w-0 truncate-until-large\";\n\n/** Every OTHER cell of a table with a `grow` column (kastlan S2, 0.48). A `w-full` column\n * squeezes the rest to their min-content width, so any text with a space broke in two\n * even at 1920px (\"CHF 2'568.38\", \"Peter Mueller\", a date with its time). One line at\n * Normal, so a column is never narrower than its text and `fitPriority` measures what\n * the columns really need; from Large up the cell wraps as before (§10.17). The headers\n * are `whitespace-nowrap` already. A column whose prose should wrap anyway passes\n * `not-large:whitespace-normal` in its `className`. */\nexport const GROW_PEER_CELL_CLASS = \"not-large:whitespace-nowrap\";\n\n// A cell's own flex-wrap row (chips) is left to wrap beside a `grow` column: a row of\n// badges reads as well stacked, and held to one line it widened the user roster's Status\n// until kastlan's admin pane scrolled 21px at 1280px (0.48 build review 2, kastlan S1).\n\n/** The auto-hide order: lowest `fitPriority` first, the later column first on a tie. */\nexport function fitHideOrder<T>(columns: DataTableColumn<T>[]): DataTableColumn<T>[] {\n return columns\n .map((col, index) => ({ col, index }))\n .filter(({ col }) => col.fitPriority != null)\n .sort((a, b) => a.col.fitPriority! - b.col.fitPriority! || b.index - a.index)\n .map(({ col }) => col);\n}\n\n/**\n * Which columns the table leaves out for width, and the Columns panel's \"keep it\".\n *\n * A column the user TICKS in the Columns panel is theirs: it is never left out for width\n * again while the table is mounted (`keep`): the table makes room by leaving out the next\n * candidate, and scrolls sideways once none is left — what they asked for. Unticking it hides it as before (the persisted `hiddenCols`) and\n * drops the keep. Keeps are not persisted: on the next visit the table fits again.\n */\nexport function useColumnFit<T>({\n columns,\n hiddenCols,\n headRefs,\n scroller,\n enabled,\n content,\n}: {\n columns: DataTableColumn<T>[];\n /** The user's hidden columns: never candidates (they are out already). */\n hiddenCols: Set<string>;\n headRefs: Map<string, HTMLTableCellElement>;\n /** The desktop scroller, read after render (it is declared below the call). */\n scroller: () => HTMLElement | null;\n /** The wide layout. On a phone (the card list) nothing is left out for width. */\n enabled: boolean;\n /**\n * What can change the columns' widths besides the scroller (0.48.2): the rows on\n * screen, the columns, the stored widths, the text size. Compared item by item after\n * each render, and the table is measured only when one changed — a selection tick no\n * longer forces a layout of the whole table. Without it, every render measures.\n */\n content?: readonly unknown[];\n}): {\n /** The columns left out for width now — empty while off. */\n autoHidden: Set<string>;\n /** The user's choice in the Columns panel: `true` keeps the column in whatever the width. */\n keep: (key: string, on: boolean) => void;\n} {\n const [kept, setKept] = useState<ReadonlySet<string>>(() => new Set());\n const [hidden, setHidden] = useState<string[]>([]);\n // A column's own header width, written when it is left out: it comes back once the\n // table's need as it is now, plus this, fits the scroller (keksdose S3, 0.48: not the\n // whole table's need at hide time, which went stale when the content narrowed).\n const ownWidth = useRef(new Map<string, number>());\n // A column whose return the very next measure undid, at the same scroller width: the\n // room the table had for it when it came back (keksdose B2, 0.48.3). It stays out\n // until the table has more. Dropped once the column is no longer left out for width.\n const stuck = useRef(new Map<string, number>());\n // What the last measure brought back, each column with the room it had then, and at\n // which scroller width: read (and cleared) by the measure right after it.\n const lastShown = useRef<{ avail: number; rooms: Map<string, number> } | null>(null);\n\n const hasFit = columns.some((c) => c.fitPriority != null);\n const active = enabled && hasFit;\n const order = useMemo(\n () => fitHideOrder(columns).filter((c) => !hiddenCols.has(c.key) && !kept.has(c.key)),\n [columns, hiddenCols, kept],\n );\n // Only the candidates still in play, in hide order — a column the user hid or kept\n // since, or one the app dropped, is no longer \"hidden for width\".\n const current = useMemo(\n () => (active ? order.filter((c) => hidden.includes(c.key)).map((c) => c.key) : []),\n [active, order, hidden],\n );\n const growCol = columns.find((c) => c.grow && !hiddenCols.has(c.key));\n const growKey = growCol?.key;\n const growMin = growCol?.growMin ?? GROW_MIN_REM;\n\n // What `measure` reads, refreshed after each render (before the measure below runs):\n // the ResizeObserver's callback is set up once and must see the current columns.\n const latest = useRef({ order, current, growKey, growMin, active, scroller });\n useLayoutEffect(() => {\n latest.current = { order, current, growKey, growMin, active, scroller };\n });\n\n const measure = useCallback(() => {\n const { order, current, growKey, growMin, active, scroller } = latest.current;\n // Only the measure right after a bring-back can undo it.\n const flip = lastShown.current;\n lastShown.current = null;\n for (const k of stuck.current.keys()) if (!current.includes(k)) stuck.current.delete(k);\n const el = scroller();\n if (!active || !el) return;\n const table = el.querySelector(\"table\");\n const avail = el.clientWidth;\n // Not laid out (display:none, jsdom): nothing to fit to.\n if (!table || avail <= 0) return;\n const growTh = growKey ? headRefs.get(growKey) : undefined;\n const rem = parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;\n let need = growTh ? table.offsetWidth - growTh.offsetWidth + growMin * rem : table.offsetWidth;\n if (!growTh && need <= avail + 0.5 && current.length > 0) {\n // A `w-full` table is at least the scroller's width, which says nothing about how\n // much room its content leaves: probe its content's width (what it takes once it\n // overflows) for the bring-back below. Read and put back in one layout pass.\n const before = table.style.width;\n table.style.width = \"min-content\";\n need = table.offsetWidth;\n table.style.width = before;\n }\n if (need > avail + 0.5) {\n // Leave out, in order, until the rest fits: each column saves its header's width\n // (the others are at their content's width while a `grow` column takes the rest).\n const next = [...current];\n for (const col of order) {\n if (need <= avail + 0.5) break;\n if (next.includes(col.key)) continue;\n const w = headRefs.get(col.key)?.offsetWidth ?? 0;\n ownWidth.current.set(col.key, w);\n need -= w;\n next.push(col.key);\n }\n if (next.length === current.length) return;\n // The last measure brought these back at this same width, and the table cannot\n // hold them: their header width fell short of what they cost drawn (see below).\n if (flip && Math.abs(flip.avail - avail) <= 0.5)\n for (const k of next.slice(current.length)) {\n const room = flip.rooms.get(k);\n if (room != null) stuck.current.set(k, room);\n }\n setHidden(next);\n return;\n }\n // Bring back, the last left out first, while the table as it is now has room for\n // them by their recorded header width. A column that costs more drawn than that is\n // left out again by the next measure, before paint. That alone does not settle it:\n // the re-hide records its header's width again, and the header can measure the same\n // while the column costs more (`virtualize`'s locked widths, keksdose B2, 0.48.3: the\n // drawn column cost the table ~80–110px more than its header), so it came back, went, came back … until React's\n // update limit (#185). So a column whose return the next measure undid, at the same\n // scroller width, waits for more room than it had then: a wider scroller or narrower\n // content. Whatever the error in its width, that is one invisible flip per room it is\n // tried at.\n let n = current.length;\n const rooms = new Map<string, number>();\n while (n > 0) {\n const k = current[n - 1];\n const w = ownWidth.current.get(k);\n if (w == null || need + w > avail + 0.5) break;\n const room = stuck.current.get(k);\n if (room != null && avail - need <= room + 0.5) break;\n rooms.set(k, avail - need);\n need += w;\n n--;\n }\n if (n === current.length) return;\n lastShown.current = { avail, rooms };\n setHidden(current.slice(0, n));\n }, [headRefs]);\n\n // The table the observer below watches, kept to this render's.\n const observer = useRef<ResizeObserver | null>(null);\n const watched = useRef<{ table: Element; width: number } | null>(null);\n const watchTable = useCallback(() => {\n const ro = observer.current;\n const table = latest.current.scroller()?.querySelector(\"table\") ?? null;\n if (!ro || table === (watched.current?.table ?? null)) return;\n if (watched.current) ro.unobserve(watched.current.table);\n // Its width now, as the measure that just ran saw it: a report of the same width is\n // not news, one that differs is (it may come a frame later, rows drawn by then).\n watched.current = table ? { table, width: (table as HTMLElement).offsetWidth } : null;\n if (table) ro.observe(table);\n }, []);\n\n // After a render that changed what is drawn: rows, a filter or a page can widen a\n // column as much as a resize. Before paint, so a column the table cannot hold is never\n // drawn first. A render that changed none of it (a ticked box, a focused row) skips the\n // measure, which forces a layout of the whole table (0.48.2, keksdose dev #632).\n const lastContent = useRef<readonly unknown[] | null>(null);\n useLayoutEffect(() => {\n // The table the observer watches is this render's (a table drawn after a loading\n // state, or remounted, is a new element).\n watchTable();\n const now = content ? [...content, order, current, growKey, active] : null;\n const prev = lastContent.current;\n lastContent.current = now;\n if (now && prev && prev.length === now.length && prev.every((v, i) => Object.is(v, now[i]))) return;\n measure();\n });\n\n // The scroller, and the table in it (0.51.2, keksdose's register). The fit measured\n // after a render that changed `content` and when the SCROLLER changed size, but the table\n // also widens on its own after that: under `virtualize` the rows actually drawn are the\n // window's, set a frame later, and its column-width lock lands a frame later still —\n // neither is `content`, and the scroller keeps its size. A load whose first measure saw\n // the table before its rows were in kept every `fitPriority` column and then overflowed\n // for good (893px in 757 at 1124, 1058 in 913 at 1280, on 0.50.1 as on 0.51). Watched,\n // a table that grows past what was measured is measured again. Only a WIDTH change of\n // the table counts: its height moves with every row the window draws, and each measure\n // lays the whole table out.\n useEffect(() => {\n const el = latest.current.scroller();\n if (!active || !el || typeof ResizeObserver === \"undefined\") return;\n const ro = new ResizeObserver((entries) => {\n let changed = false;\n for (const entry of entries) {\n if (entry.target === el) changed = true;\n else if (watched.current && entry.target === watched.current.table) {\n // The border box, as `offsetWidth` reads it (the content rect leaves the border out).\n const width = entry.borderBoxSize?.[0]?.inlineSize ?? entry.contentRect.width;\n if (Math.abs(width - watched.current.width) > 0.5) {\n watched.current.width = width;\n changed = true;\n }\n }\n }\n if (changed) measure();\n });\n ro.observe(el);\n observer.current = ro;\n watchTable();\n return () => {\n ro.disconnect();\n observer.current = null;\n watched.current = null;\n };\n }, [active, measure, watchTable]);\n\n const keep = useCallback((key: string, on: boolean) => {\n setKept((s) => {\n if (s.has(key) === on) return s;\n const next = new Set(s);\n if (on) next.add(key);\n else next.delete(key);\n return next;\n });\n }, []);\n\n const autoHidden = useMemo(() => new Set(current), [current]);\n return { autoHidden, keep };\n}\n"],"mappings":";AAAA,SAAS,aAAa,WAAW,iBAAiB,SAAS,QAAQ,gBAAgB;AA0B5E,MAAM,eAAe;AAOrB,MAAM,kBAAkB;AACxB,MAAM,kBAAkB;AASxB,MAAM,uBAAuB;AAO7B,SAAS,aAAgB,SAAqD;AACnF,SAAO,QACJ,IAAI,CAAC,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,EACpC,OAAO,CAAC,EAAE,IAAI,MAAM,IAAI,eAAe,IAAI,EAC3C,KAAK,CAAC,GAAG,MAAM,EAAE,IAAI,cAAe,EAAE,IAAI,eAAgB,EAAE,QAAQ,EAAE,KAAK,EAC3E,IAAI,CAAC,EAAE,IAAI,MAAM,GAAG;AACzB;AAUO,SAAS,aAAgB;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C;AAC5D,SAAO,EAAE,YAAY,KAAK;AAC5B;","names":["order","current","growKey","growMin","active","scroller"]}
1
+ {"version":3,"sources":["../../src/components/data-table-fit.ts"],"sourcesContent":["import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport type { DataTableColumn } from \"./data-table\";\n\n// DataTable's fit to its own width (0.48, keksdose live #451: \"On expanded sidebar for\n// desktop the table scrolls horizontally. On collapsed sidebar it fits […] Compute the\n// width selectively\"). Two column options, both opt-in:\n//\n// - `grow`: the column takes what the others leave and ellipsises (`w-full max-w-0` on\n// its cells: in an auto table layout that is \"the rest of the row\", never its content's\n// width), so one long title can no longer widen the table.\n// - `fitPriority`: while the table is wider than its scroller — or, with a `grow` column,\n// while that column would get less than {@link GROW_MIN_REM} — the table leaves out\n// its `fitPriority` columns, the LOWEST number first (ties: the later column first),\n// and brings them back in the reverse order as soon as the table, as it is NOW, has\n// room for them (its need re-measured, plus the column's own header width from when\n// it was left out), so narrower content (a filter, another page) counts as much as a\n// wider scroller. The scroller's own width, through a ResizeObserver: a sidebar, a\n// narrower window, the Columns drawer and Large text all count the same. A column\n// whose return the very next measure undoes stays out until the table has more room\n// for it than it had then (0.48.3, keksdose B2: see the bring-back in `measure`). And\n// the TABLE's own width, through the same observer (0.51.2): anything that widens it\n// after a measure — rows drawn a frame later, `virtualize` locking its column widths —\n// is measured again, so the table never stays wider than its scroller.\n\n/** The least a `grow` column keeps before the table starts leaving columns out: about\n * a sentence of a title. In rem, so Large text asks for more. */\nexport const GROW_MIN_REM = 10;\n\n/** The `<th>`/`<td>` classes of a `grow` column. `truncate-until-large`: one line and an\n * ellipsis at Normal, a wrap from Large up (text size §10.17), as every kit title. The\n * header's `min-w-[10rem]` ({@link GROW_MIN_REM}) is the floor once no `fitPriority`\n * column is left to leave out: the table then scrolls sideways rather than crushing the\n * column it exists for (Kurvenschmiede S1, 0.48: Subject was 24px at 1100px). */\nexport const GROW_HEAD_CLASS = \"w-full max-w-0 min-w-[10rem]\";\nexport const GROW_CELL_CLASS = \"w-full max-w-0 truncate-until-large\";\n\n/** Every OTHER cell of a table with a `grow` column (kastlan S2, 0.48). A `w-full` column\n * squeezes the rest to their min-content width, so any text with a space broke in two\n * even at 1920px (\"CHF 2'568.38\", \"Peter Mueller\", a date with its time). One line at\n * Normal, so a column is never narrower than its text and `fitPriority` measures what\n * the columns really need; from Large up the cell wraps as before (§10.17). The headers\n * are `whitespace-nowrap` already. A column whose prose should wrap anyway passes\n * `not-large:whitespace-normal` in its `className`. */\nexport const GROW_PEER_CELL_CLASS = \"not-large:whitespace-nowrap\";\n\n// A cell's own flex-wrap row (chips) is left to wrap beside a `grow` column: a row of\n// badges reads as well stacked, and held to one line it widened the user roster's Status\n// until kastlan's admin pane scrolled 21px at 1280px (0.48 build review 2, kastlan S1).\n\n/** The auto-hide order: lowest `fitPriority` first, the later column first on a tie. */\nexport function fitHideOrder<T>(columns: readonly DataTableColumn<T>[]): DataTableColumn<T>[] {\n return columns\n .map((col, index) => ({ col, index }))\n .filter(({ col }) => col.fitPriority != null)\n .sort((a, b) => a.col.fitPriority! - b.col.fitPriority! || b.index - a.index)\n .map(({ col }) => col);\n}\n\n/**\n * Which columns the table leaves out for width, and the Columns panel's \"keep it\".\n *\n * A column the user TICKS in the Columns panel is theirs: it is never left out for width\n * again while the table is mounted (`keep`): the table makes room by leaving out the next\n * candidate, and scrolls sideways once none is left — what they asked for. Unticking it hides it as before (the persisted `hiddenCols`) and\n * drops the keep. Keeps are not persisted: on the next visit the table fits again.\n */\nexport function useColumnFit<T>({\n columns,\n hiddenCols,\n headRefs,\n scroller,\n enabled,\n content,\n}: {\n columns: readonly DataTableColumn<T>[];\n /** The user's hidden columns: never candidates (they are out already). */\n hiddenCols: Set<string>;\n headRefs: Map<string, HTMLTableCellElement>;\n /** The desktop scroller, read after render (it is declared below the call). */\n scroller: () => HTMLElement | null;\n /** The wide layout. On a phone (the card list) nothing is left out for width. */\n enabled: boolean;\n /**\n * What can change the columns' widths besides the scroller (0.48.2): the rows on\n * screen, the columns, the stored widths, the text size. Compared item by item after\n * each render (`Object.is`), and the table is measured only when one changed — a\n * selection tick no longer forces a layout of the whole table. Without it, every render\n * measures. So each item must keep its identity while it means the same: the page's\n * rows memoised, the columns as their keys (DSP-19).\n */\n content?: readonly unknown[];\n}): {\n /** The columns left out for width now — empty while off. */\n autoHidden: Set<string>;\n /** The user's choice in the Columns panel: `true` keeps the column in whatever the width. */\n keep: (key: string, on: boolean) => void;\n} {\n const [kept, setKept] = useState<ReadonlySet<string>>(() => new Set());\n const [hidden, setHidden] = useState<string[]>([]);\n // A column's own header width, written when it is left out: it comes back once the\n // table's need as it is now, plus this, fits the scroller (keksdose S3, 0.48: not the\n // whole table's need at hide time, which went stale when the content narrowed).\n const ownWidth = useRef(new Map<string, number>());\n // A column whose return the very next measure undid, at the same scroller width: the\n // room the table had for it when it came back (keksdose B2, 0.48.3). It stays out\n // until the table has more. Dropped once the column is no longer left out for width.\n const stuck = useRef(new Map<string, number>());\n // What the last measure brought back, each column with the room it had then, and at\n // which scroller width: read (and cleared) by the measure right after it.\n const lastShown = useRef<{ avail: number; rooms: Map<string, number> } | null>(null);\n\n const hasFit = columns.some((c) => c.fitPriority != null);\n const active = enabled && hasFit;\n const order = useMemo(\n () => fitHideOrder(columns).filter((c) => !hiddenCols.has(c.key) && !kept.has(c.key)),\n [columns, hiddenCols, kept],\n );\n // Only the candidates still in play, in hide order — a column the user hid or kept\n // since, or one the app dropped, is no longer \"hidden for width\".\n const current = useMemo(\n () => (active ? order.filter((c) => hidden.includes(c.key)).map((c) => c.key) : []),\n [active, order, hidden],\n );\n const growCol = columns.find((c) => c.grow && !hiddenCols.has(c.key));\n const growKey = growCol?.key;\n const growMin = growCol?.growMin ?? GROW_MIN_REM;\n\n // What `measure` reads, refreshed after each render (before the measure below runs):\n // the ResizeObserver's callback is set up once and must see the current columns.\n const latest = useRef({ order, current, growKey, growMin, active, scroller });\n useLayoutEffect(() => {\n latest.current = { order, current, growKey, growMin, active, scroller };\n });\n\n const measure = useCallback(() => {\n const { order, current, growKey, growMin, active, scroller } = latest.current;\n // Only the measure right after a bring-back can undo it.\n const flip = lastShown.current;\n lastShown.current = null;\n for (const k of stuck.current.keys()) if (!current.includes(k)) stuck.current.delete(k);\n const el = scroller();\n if (!active || !el) return;\n const table = el.querySelector(\"table\");\n const avail = el.clientWidth;\n // Not laid out (display:none, jsdom): nothing to fit to.\n if (!table || avail <= 0) return;\n const growTh = growKey ? headRefs.get(growKey) : undefined;\n const rem = parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;\n let need = growTh ? table.offsetWidth - growTh.offsetWidth + growMin * rem : table.offsetWidth;\n if (!growTh && need <= avail + 0.5 && current.length > 0) {\n // A `w-full` table is at least the scroller's width, which says nothing about how\n // much room its content leaves: probe its content's width (what it takes once it\n // overflows) for the bring-back below. Read and put back in one layout pass.\n const before = table.style.width;\n table.style.width = \"min-content\";\n need = table.offsetWidth;\n table.style.width = before;\n }\n if (need > avail + 0.5) {\n // Leave out, in order, until the rest fits: each column saves its header's width\n // (the others are at their content's width while a `grow` column takes the rest).\n const next = [...current];\n for (const col of order) {\n if (need <= avail + 0.5) break;\n if (next.includes(col.key)) continue;\n const w = headRefs.get(col.key)?.offsetWidth ?? 0;\n ownWidth.current.set(col.key, w);\n need -= w;\n next.push(col.key);\n }\n if (next.length === current.length) return;\n // The last measure brought these back at this same width, and the table cannot\n // hold them: their header width fell short of what they cost drawn (see below).\n if (flip && Math.abs(flip.avail - avail) <= 0.5)\n for (const k of next.slice(current.length)) {\n const room = flip.rooms.get(k);\n if (room != null) stuck.current.set(k, room);\n }\n setHidden(next);\n return;\n }\n // Bring back, the last left out first, while the table as it is now has room for\n // them by their recorded header width. A column that costs more drawn than that is\n // left out again by the next measure, before paint. That alone does not settle it:\n // the re-hide records its header's width again, and the header can measure the same\n // while the column costs more (`virtualize`'s locked widths, keksdose B2, 0.48.3: the\n // drawn column cost the table ~80–110px more than its header), so it came back, went, came back … until React's\n // update limit (#185). So a column whose return the next measure undid, at the same\n // scroller width, waits for more room than it had then: a wider scroller or narrower\n // content. Whatever the error in its width, that is one invisible flip per room it is\n // tried at.\n let n = current.length;\n const rooms = new Map<string, number>();\n while (n > 0) {\n const k = current[n - 1];\n const w = ownWidth.current.get(k);\n if (w == null || need + w > avail + 0.5) break;\n const room = stuck.current.get(k);\n if (room != null && avail - need <= room + 0.5) break;\n rooms.set(k, avail - need);\n need += w;\n n--;\n }\n if (n === current.length) return;\n lastShown.current = { avail, rooms };\n setHidden(current.slice(0, n));\n }, [headRefs]);\n\n // The table the observer below watches, kept to this render's.\n const observer = useRef<ResizeObserver | null>(null);\n const watched = useRef<{ table: Element; width: number } | null>(null);\n const watchTable = useCallback(() => {\n const ro = observer.current;\n const table = latest.current.scroller()?.querySelector(\"table\") ?? null;\n if (!ro || table === (watched.current?.table ?? null)) return;\n if (watched.current) ro.unobserve(watched.current.table);\n // Its width now, as the measure that just ran saw it: a report of the same width is\n // not news, one that differs is (it may come a frame later, rows drawn by then).\n watched.current = table ? { table, width: (table as HTMLElement).offsetWidth } : null;\n if (table) ro.observe(table);\n }, []);\n\n // After a render that changed what is drawn: rows, a filter or a page can widen a\n // column as much as a resize. Before paint, so a column the table cannot hold is never\n // drawn first. A render that changed none of it (a ticked box, a focused row) skips the\n // measure, which forces a layout of the whole table (0.48.2, keksdose dev #632).\n const lastContent = useRef<readonly unknown[] | null>(null);\n // The candidates by their keys, not by identity (refactor audit 2026-10-30, DSP-19):\n // both are memoised on `columns`, which a call site writes inline — a new array, and\n // so a \"change\", on every render of the page around the table.\n const orderSig = order.map((c) => c.key).join(\"\\u0000\");\n const currentSig = current.join(\"\\u0000\");\n useLayoutEffect(() => {\n // The table the observer watches is this render's (a table drawn after a loading\n // state, or remounted, is a new element).\n watchTable();\n // And what the fit measures under the same keys (0.52 code review, data-table.tsx):\n // the headers' text as drawn — a locale switch keeps every key and changes every\n // header, and German → English left out the columns German had no room for, on a\n // table with room to spare (narrower, a `w-full` table keeps the scroller's width,\n // which the observer below watches) — and the grow column's floor. Text is read\n // without a layout.\n const headText = active ? (scroller()?.querySelector(\"thead\")?.textContent ?? \"\") : \"\";\n const now = content ? [...content, orderSig, currentSig, growKey, growMin, active, headText] : null;\n const prev = lastContent.current;\n lastContent.current = now;\n if (now && prev && prev.length === now.length && prev.every((v, i) => Object.is(v, now[i]))) return;\n measure();\n });\n\n // The scroller, and the table in it (0.51.2, keksdose's register). The fit measured\n // after a render that changed `content` and when the SCROLLER changed size, but the table\n // also widens on its own after that: under `virtualize` the rows actually drawn are the\n // window's, set a frame later, and its column-width lock lands a frame later still —\n // neither is `content`, and the scroller keeps its size. A load whose first measure saw\n // the table before its rows were in kept every `fitPriority` column and then overflowed\n // for good (893px in 757 at 1124, 1058 in 913 at 1280, on 0.50.1 as on 0.51). Watched,\n // a table that grows past what was measured is measured again. Only a WIDTH change of\n // the table counts: its height moves with every row the window draws, and each measure\n // lays the whole table out.\n useEffect(() => {\n const el = latest.current.scroller();\n if (!active || !el || typeof ResizeObserver === \"undefined\") return;\n const ro = new ResizeObserver((entries) => {\n let changed = false;\n for (const entry of entries) {\n if (entry.target === el) changed = true;\n else if (watched.current && entry.target === watched.current.table) {\n // The border box, as `offsetWidth` reads it (the content rect leaves the border out).\n const width = entry.borderBoxSize?.[0]?.inlineSize ?? entry.contentRect.width;\n if (Math.abs(width - watched.current.width) > 0.5) {\n watched.current.width = width;\n changed = true;\n }\n }\n }\n if (changed) measure();\n });\n ro.observe(el);\n observer.current = ro;\n watchTable();\n return () => {\n ro.disconnect();\n observer.current = null;\n watched.current = null;\n };\n }, [active, measure, watchTable]);\n\n const keep = useCallback((key: string, on: boolean) => {\n setKept((s) => {\n if (s.has(key) === on) return s;\n const next = new Set(s);\n if (on) next.add(key);\n else next.delete(key);\n return next;\n });\n }, []);\n\n const autoHidden = useMemo(() => new Set(current), [current]);\n return { autoHidden, keep };\n}\n"],"mappings":";AAAA,SAAS,aAAa,WAAW,iBAA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,sBAAU;AAAA,UACZ;AAAA,QACF;AAAA,MACF;AACA,UAAI,QAAS,SAAQ;AAAA,IACvB,CAAC;AACD,OAAG,QAAQ,EAAE;AACb,aAAS,UAAU;AACnB,eAAW;AACX,WAAO,MAAM;AACX,SAAG,WAAW;AACd,eAAS,UAAU;AACnB,cAAQ,UAAU;AAAA,IACpB;AAAA,EACF,GAAG,CAAC,QAAQ,SAAS,UAAU,CAAC;AAEhC,QAAM,OAAO,YAAY,CAAC,KAAa,OAAgB;AACrD,YAAQ,CAAC,MAAM;AACb,UAAI,EAAE,IAAI,GAAG,MAAM,GAAI,QAAO;AAC9B,YAAM,OAAO,IAAI,IAAI,CAAC;AACtB,UAAI,GAAI,MAAK,IAAI,GAAG;AAAA,UACf,MAAK,OAAO,GAAG;AACpB,aAAO;AAAA,IACT,CAAC;AAAA,EACH,GAAG,CAAC,CAAC;AAEL,QAAM,aAAa,QAAQ,MAAM,IAAI,IAAI,OAAO,GAAG,CAAC,OAAO,CAAC;AAC5D,SAAO,EAAE,YAAY,KAAK;AAC5B;","names":["order","current","growKey","growMin","active","scroller"]}
@@ -49,7 +49,7 @@ export interface RowGroup<T> {
49
49
  children: RowGroup<T>[] | null;
50
50
  }
51
51
  /** Consecutive runs by `level.key`, nested once for a second level. */
52
- export declare function groupRows<T>(rows: T[], levels: readonly DataTableGroupBy<T>[], offset?: number): RowGroup<T>[];
52
+ export declare function groupRows<T>(rows: readonly T[], levels: readonly DataTableGroupBy<T>[], offset?: number): RowGroup<T>[];
53
53
  /** `groupBy` as a list of at most two levels. */
54
54
  export declare function groupLevels<T>(groupBy: DataTableGroupBy<T> | readonly [DataTableGroupBy<T>, DataTableGroupBy<T>?] | undefined): DataTableGroupBy<T>[];
55
55
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/data-table-groups.tsx"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport type { ReactNode, RefObject } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { Button } from \"./button\";\nimport { Spinner } from \"./spinner\";\n\n/**\n * One level of {@link DataTableProps.groupBy} (0.48, keksdose dev #605): the rows are cut\n * into consecutive runs of equal `key` — the rows must already be ordered so equal keys\n * are contiguous, as for `mobileGroupBy` — and each run is headed by a full-width band.\n *\n * The same object drives the phone: `mobileGroupBy` takes a level too, so\n * `groupBy={[period, day]} mobileGroupBy={period}` is one definition for both layouts.\n */\nexport interface DataTableGroupBy<T> {\n /** The group a row belongs to. */\n key: (row: T) => string;\n /** The band's label. Default: the key itself. */\n label?: (key: string, rows: T[]) => ReactNode;\n /**\n * The band's end slot — a count, a total (\"176 · +8'782.30 · −3'200.10\"). `rows` are\n * the group's rows the table holds; an app whose total covers rows not yet loaded\n * looks it up by `key` instead.\n */\n end?: (key: string, rows: T[]) => ReactNode;\n}\n\n/**\n * {@link DataTableProps.loadMore} (0.48, keksdose dev #605): a footer in place of the\n * pager that loads the next slice of rows — on its own as it scrolls into view (an\n * IntersectionObserver), and through a button that is always there for the keyboard and\n * the screen reader. The owner appends the rows; the table renders every row it is given.\n */\nexport interface DataTableLoadMore {\n /** Whether there is anything left to load. False draws the end state. */\n hasMore: boolean;\n /** Load the next slice. Called at most once per row count while `loading` is false. */\n onLoadMore: () => void;\n /** A load is in flight: the button says \"Loading…\" and ignores presses. */\n loading?: boolean;\n /** The button's words — what it loads (\"Load August 2026\"). Default: the kit's \"Load more\". */\n label?: ReactNode;\n /** What the footer says once `hasMore` is false. Default: the kit's \"All rows loaded\";\n * `null` draws nothing. */\n endLabel?: ReactNode;\n /** Load as the footer scrolls into view. Default true; false leaves only the button. */\n auto?: boolean;\n}\n\n/** A run of rows under one band; `start` is its first row's index in the slice. */\nexport interface RowGroup<T> {\n key: string;\n rows: T[];\n start: number;\n /** The second level's runs inside this one, or null with one level. */\n children: RowGroup<T>[] | null;\n}\n\n/** Consecutive runs by `level.key`, nested once for a second level. */\nexport function groupRows<T>(rows: T[], levels: readonly DataTableGroupBy<T>[], offset = 0): RowGroup<T>[] {\n const [level, ...rest] = levels;\n if (!level) return [];\n const out: RowGroup<T>[] = [];\n rows.forEach((row, i) => {\n const key = level.key(row);\n const last = out[out.length - 1];\n if (last && last.key === key) last.rows.push(row);\n else out.push({ key, rows: [row], start: offset + i, children: null });\n });\n if (rest.length > 0) for (const g of out) g.children = groupRows(g.rows, rest.slice(0, 1), g.start);\n return out;\n}\n\n/** `groupBy` as a list of at most two levels. */\nexport function groupLevels<T>(\n groupBy: DataTableGroupBy<T> | readonly [DataTableGroupBy<T>, DataTableGroupBy<T>?] | undefined,\n): DataTableGroupBy<T>[] {\n if (!groupBy) return [];\n const list = \"key\" in groupBy ? [groupBy] : (groupBy as readonly (DataTableGroupBy<T> | undefined)[]);\n return list.filter((l): l is DataTableGroupBy<T> => !!l).slice(0, 2);\n}\n\n/**\n * The bands' sticky offsets: the first level under the header (and under a sticky\n * `leadingRow`), the second under the first. Measured — the header grows at Large text,\n * a band's end slot can wrap — and followed with a ResizeObserver.\n */\nexport function useGroupBandTops(\n tableRef: RefObject<HTMLTableElement | null>,\n enabled: boolean,\n signature: string,\n): [number, number] {\n const [tops, setTops] = useState<[number, number]>([0, 0]);\n useLayoutEffect(() => {\n const table = tableRef.current;\n if (!enabled || !table) return;\n // Looked up afresh on each measure: under `virtualize` (0.48.2) the first band can\n // leave the DOM as the rows scroll, and a detached cell measures 0 — the bands would\n // stack on one another. A band missing for now keeps the height it had.\n const parts = () => [\n table.tHead,\n table.querySelector<HTMLElement>(\"[data-leading-row='sticky']\"),\n table.querySelector<HTMLElement>(\"th[data-group-band='1']\"),\n ];\n let bandHeight = 0;\n const measure = () => {\n const [headEl, leadEl, bandEl] = parts();\n const head = headEl ? headEl.getBoundingClientRect().height : 0;\n const lead = leadEl ? leadEl.getBoundingClientRect().height : 0;\n if (bandEl) bandHeight = bandEl.getBoundingClientRect().height;\n const band = bandHeight;\n setTops((prev) =>\n prev[0] === head + lead && prev[1] === head + lead + band ? prev : [head + lead, head + lead + band],\n );\n };\n measure();\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(measure);\n for (const el of parts()) if (el) observer.observe(el);\n return () => observer.disconnect();\n }, [tableRef, enabled, signature]);\n return tops;\n}\n\n/**\n * A band row. A `<th scope=\"rowgroup\">` spanning the row — the header of the `<tbody>` it\n * opens, which a screen reader announces as the reader enters the group — and sticky on\n * the cell, not the `<tr>`, as the header's and the leading row's are. Opaque, under the\n * sticky leading row's `z-[5]`: the first level `z-[4]` over the second's `z-[3]`, so a\n * period arriving from below covers the day still pinned under the one before. The line\n * over it is the cell's own `::before`, which moves with the stuck cell.\n */\nexport function DataTableGroupBand({\n level,\n colSpan,\n top,\n compact,\n label,\n end,\n ariaRowIndex,\n}: {\n level: 1 | 2;\n colSpan: number;\n top: number;\n compact: boolean;\n label: ReactNode;\n end: ReactNode;\n /** Under `virtualize` (0.48.2). */\n ariaRowIndex?: number;\n}) {\n return (\n <tr data-group-row={level} aria-rowindex={ariaRowIndex}>\n <th\n scope=\"rowgroup\"\n colSpan={colSpan}\n data-group-band={level}\n style={{ top }}\n className={cn(\n \"sticky p-0 text-start align-middle\",\n \"before:pointer-events-none before:absolute before:inset-x-0 before:top-0 before:z-[1] before:h-px before:bg-[var(--border)] before:content-['']\",\n level === 1 ? \"z-[4] bg-surface-2 font-semibold text-primary\" : \"z-[3] bg-surface font-medium text-secondary\",\n level === 1 ? (compact ? \"text-xs\" : \"text-sm\") : \"text-xs\",\n )}\n >\n {/* Pinned to what the scroller shows, as the expansion row's panel is: the end\n slot stays at the visible end of a table wider than its scroller. */}\n <div className=\"w-0 min-w-full\">\n <div\n className={cn(\n \"sticky start-0 flex w-[var(--dt-visible-w,100%)] max-w-full flex-wrap items-baseline justify-between gap-x-3\",\n compact ? \"px-2 py-1\" : level === 1 ? \"px-3 py-2\" : \"px-3 py-1.5\",\n )}\n >\n <span className=\"min-w-0\">{label}</span>\n {end != null && end !== false && <span className=\"ms-auto tabular-nums\">{end}</span>}\n </div>\n </div>\n </th>\n </tr>\n );\n}\n\n/**\n * The load-more footer. Observed against the viewport (an implicit root sees through the\n * clipping scroller, so it works in a bounded body, under `fillHeight`, and in a page that\n * scrolls), and guarded: one call per row count, none while `loading`, so an observer\n * that reports twice — or a footer still in view while the owner sets `loading` — loads\n * once. When the rows arrive and the footer is still in view (a short slice), it loads\n * again, until the scroller is full.\n */\nexport function DataTableLoadMoreFooter({\n loadMore,\n rowCount,\n labels,\n compact,\n as: Tag = \"div\",\n}: {\n loadMore: DataTableLoadMore;\n rowCount: number;\n labels: { loadMore: string; allLoaded: string; loading: string };\n compact: boolean;\n as?: \"div\" | \"li\";\n}) {\n const { hasMore, onLoadMore, loading = false, auto = true, label, endLabel } = loadMore;\n const rootRef = useRef<HTMLElement | null>(null);\n const endRef = useRef<HTMLParagraphElement | null>(null);\n const firedAt = useRef<number | null>(null);\n const buttonFocused = useRef(false);\n // What the observer's callback acts on: the latest props, not the ones it was made with.\n const latest = useRef({ onLoadMore, loading, rowCount });\n useEffect(() => {\n latest.current = { onLoadMore, loading, rowCount };\n });\n\n // A fresh observer whenever the rows or the in-flight flag change: its first report is\n // the footer's position AFTER the new rows are laid out. Acting on a remembered \"in\n // view\" instead fired a second load the moment the rows arrived, while the footer was\n // still where the old last row had been (headless Chromium caught it).\n useEffect(() => {\n const el = rootRef.current;\n if (!auto || !hasMore || loading || !el || typeof IntersectionObserver === \"undefined\") return;\n const io = new IntersectionObserver(\n (entries) => {\n const now = latest.current;\n if (!entries.some((e) => e.isIntersecting) || now.loading || firedAt.current === now.rowCount) return;\n firedAt.current = now.rowCount;\n now.onLoadMore();\n },\n { rootMargin: \"200px\" },\n );\n io.observe(el);\n return () => io.disconnect();\n }, [auto, hasMore, loading, rowCount]);\n\n // A focused button that goes away (nothing left) hands its focus to the end line.\n useEffect(() => {\n if (!hasMore && buttonFocused.current) {\n buttonFocused.current = false;\n endRef.current?.focus();\n }\n }, [hasMore]);\n\n const end = endLabel === undefined ? labels.allLoaded : endLabel;\n return (\n <Tag\n ref={(el: HTMLElement | null) => {\n rootRef.current = el;\n }}\n data-table-load-more=\"\"\n className={cn(\n \"sticky start-0 flex w-[var(--dt-visible-w,100%)] max-w-full flex-col items-center border-t border-subtle text-center\",\n compact ? \"px-2 py-2\" : \"px-3 py-3\",\n )}\n >\n {hasMore ? (\n <Button\n variant=\"secondary\"\n size=\"sm\"\n aria-busy={loading || undefined}\n onFocus={() => (buttonFocused.current = true)}\n onBlur={() => (buttonFocused.current = false)}\n onClick={() => {\n if (loading) return;\n firedAt.current = rowCount;\n onLoadMore();\n }}\n >\n {loading ? (\n <span className=\"inline-flex items-center gap-2\">\n <Spinner label={null} className=\"size-4\" />\n <bdi>{labels.loading}</bdi>\n </span>\n ) : (\n (label ?? labels.loadMore)\n )}\n </Button>\n ) : end != null && end !== false ? (\n <p ref={endRef} tabIndex={-1} className=\"text-xs text-muted outline-none\">\n {end}\n </p>\n ) : null}\n {/* Mounted throughout, so a screen reader hears the load start. */}\n <span role=\"status\" className=\"sr-only\">\n {loading ? labels.loading : \"\"}\n </span>\n </Tag>\n );\n}\n"],"mappings":";AAuKU,SAME,KANF;AAvKV,SAAS,WAAW,iBAAiB,QAAQ,gBAAgB;AAE7D,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,SAAS,eAAe;AAuDjB,SAAS,UAAa,MAAW,QAAwC,SAAS,GAAkB;AACzG,QAAM,CAAC,OAAO,GAAG,IAAI,IAAI;AACzB,MAAI,CAAC,MAAO,QAAO,CAAC;AACpB,QAAM,MAAqB,CAAC;AAC5B,OAAK,QAAQ,CAAC,KAAK,MAAM;AACvB,UAAM,MAAM,MAAM,IAAI,GAAG;AACzB,UAAM,OAAO,IAAI,IAAI,SAAS,CAAC;AAC/B,QAAI,QAAQ,KAAK,QAAQ,IAAK,MAAK,KAAK,KAAK,GAAG;AAAA,QAC3C,KAAI,KAAK,EAAE,KAAK,MAAM,CAAC,GAAG,GAAG,OAAO,SAAS,GAAG,UAAU,KAAK,CAAC;AA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IAEC,SAAS,OAAO;AAAA;AAAA,QAErB,IACE,OAAO,QAAQ,QAAQ,QACzB,oBAAC,OAAE,KAAK,QAAQ,UAAU,IAAI,WAAU,mCACrC,eACH,IACE;AAAA,QAEJ,oBAAC,UAAK,MAAK,UAAS,WAAU,WAC3B,oBAAU,OAAO,UAAU,IAC9B;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/data-table-groups.tsx"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport type { ReactNode, RefObject } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { Button } from \"./button\";\nimport { Spinner } from \"./spinner\";\n\n/**\n * One level of {@link DataTableProps.groupBy} (0.48, keksdose dev #605): the rows are cut\n * into consecutive runs of equal `key` — the rows must already be ordered so equal keys\n * are contiguous, as for `mobileGroupBy` — and each run is headed by a full-width band.\n *\n * The same object drives the phone: `mobileGroupBy` takes a level too, so\n * `groupBy={[period, day]} mobileGroupBy={period}` is one definition for both layouts.\n */\nexport interface DataTableGroupBy<T> {\n /** The group a row belongs to. */\n key: (row: T) => string;\n /** The band's label. Default: the key itself. */\n label?: (key: string, rows: T[]) => ReactNode;\n /**\n * The band's end slot — a count, a total (\"176 · +8'782.30 · −3'200.10\"). `rows` are\n * the group's rows the table holds; an app whose total covers rows not yet loaded\n * looks it up by `key` instead.\n */\n end?: (key: string, rows: T[]) => ReactNode;\n}\n\n/**\n * {@link DataTableProps.loadMore} (0.48, keksdose dev #605): a footer in place of the\n * pager that loads the next slice of rows — on its own as it scrolls into view (an\n * IntersectionObserver), and through a button that is always there for the keyboard and\n * the screen reader. The owner appends the rows; the table renders every row it is given.\n */\nexport interface DataTableLoadMore {\n /** Whether there is anything left to load. False draws the end state. */\n hasMore: boolean;\n /** Load the next slice. Called at most once per row count while `loading` is false. */\n onLoadMore: () => void;\n /** A load is in flight: the button says \"Loading…\" and ignores presses. */\n loading?: boolean;\n /** The button's words — what it loads (\"Load August 2026\"). Default: the kit's \"Load more\". */\n label?: ReactNode;\n /** What the footer says once `hasMore` is false. Default: the kit's \"All rows loaded\";\n * `null` draws nothing. */\n endLabel?: ReactNode;\n /** Load as the footer scrolls into view. Default true; false leaves only the button. */\n auto?: boolean;\n}\n\n/** A run of rows under one band; `start` is its first row's index in the slice. */\nexport interface RowGroup<T> {\n key: string;\n rows: T[];\n start: number;\n /** The second level's runs inside this one, or null with one level. */\n children: RowGroup<T>[] | null;\n}\n\n/** Consecutive runs by `level.key`, nested once for a second level. */\nexport function groupRows<T>(rows: readonly T[], levels: readonly DataTableGroupBy<T>[], offset = 0): RowGroup<T>[] {\n const [level, ...rest] = levels;\n if (!level) return [];\n const out: RowGroup<T>[] = [];\n rows.forEach((row, i) => {\n const key = level.key(row);\n const last = out[out.length - 1];\n if (last && last.key === key) last.rows.push(row);\n else out.push({ key, rows: [row], start: offset + i, children: null });\n });\n if (rest.length > 0) for (const g of out) g.children = groupRows(g.rows, rest.slice(0, 1), g.start);\n return out;\n}\n\n/** `groupBy` as a list of at most two levels. */\nexport function groupLevels<T>(\n groupBy: DataTableGroupBy<T> | readonly [DataTableGroupBy<T>, DataTableGroupBy<T>?] | undefined,\n): DataTableGroupBy<T>[] {\n if (!groupBy) return [];\n const list = \"key\" in groupBy ? [groupBy] : (groupBy as readonly (DataTableGroupBy<T> | undefined)[]);\n return list.filter((l): l is DataTableGroupBy<T> => !!l).slice(0, 2);\n}\n\n/**\n * The bands' sticky offsets: the first level under the header (and under a sticky\n * `leadingRow`), the second under the first. Measured — the header grows at Large text,\n * a band's end slot can wrap — and followed with a ResizeObserver.\n */\nexport function useGroupBandTops(\n tableRef: RefObject<HTMLTableElement | null>,\n enabled: boolean,\n signature: string,\n): [number, number] {\n const [tops, setTops] = useState<[number, number]>([0, 0]);\n useLayoutEffect(() => {\n const table = tableRef.current;\n if (!enabled || !table) return;\n // Looked up afresh on each measure: under `virtualize` (0.48.2) the first band can\n // leave the DOM as the rows scroll, and a detached cell measures 0 — the bands would\n // stack on one another. A band missing for now keeps the height it had.\n const parts = () => [\n table.tHead,\n table.querySelector<HTMLElement>(\"[data-leading-row='sticky']\"),\n table.querySelector<HTMLElement>(\"th[data-group-band='1']\"),\n ];\n let bandHeight = 0;\n const measure = () => {\n const [headEl, leadEl, bandEl] = parts();\n const head = headEl ? headEl.getBoundingClientRect().height : 0;\n const lead = leadEl ? leadEl.getBoundingClientRect().height : 0;\n if (bandEl) bandHeight = bandEl.getBoundingClientRect().height;\n const band = bandHeight;\n setTops((prev) =>\n prev[0] === head + lead && prev[1] === head + lead + band ? prev : [head + lead, head + lead + band],\n );\n };\n measure();\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(measure);\n for (const el of parts()) if (el) observer.observe(el);\n return () => observer.disconnect();\n }, [tableRef, enabled, signature]);\n return tops;\n}\n\n/**\n * A band row. A `<th scope=\"rowgroup\">` spanning the row — the header of the `<tbody>` it\n * opens, which a screen reader announces as the reader enters the group — and sticky on\n * the cell, not the `<tr>`, as the header's and the leading row's are. Opaque, under the\n * sticky leading row's `z-[5]`: the first level `z-[4]` over the second's `z-[3]`, so a\n * period arriving from below covers the day still pinned under the one before. The line\n * over it is the cell's own `::before`, which moves with the stuck cell.\n */\nexport function DataTableGroupBand({\n level,\n colSpan,\n top,\n compact,\n label,\n end,\n ariaRowIndex,\n}: {\n level: 1 | 2;\n colSpan: number;\n top: number;\n compact: boolean;\n label: ReactNode;\n end: ReactNode;\n /** Under `virtualize` (0.48.2). */\n ariaRowIndex?: number;\n}) {\n return (\n <tr data-group-row={level} aria-rowindex={ariaRowIndex}>\n <th\n scope=\"rowgroup\"\n colSpan={colSpan}\n data-group-band={level}\n style={{ top }}\n className={cn(\n \"sticky p-0 text-start align-middle\",\n \"before:pointer-events-none before:absolute before:inset-x-0 before:top-0 before:z-[1] before:h-px before:bg-[var(--border)] before:content-['']\",\n level === 1 ? \"z-[4] bg-surface-2 font-semibold text-primary\" : \"z-[3] bg-surface font-medium text-secondary\",\n level === 1 ? (compact ? \"text-xs\" : \"text-sm\") : \"text-xs\",\n )}\n >\n {/* Pinned to what the scroller shows, as the expansion row's panel is: the end\n slot stays at the visible end of a table wider than its scroller. */}\n <div className=\"w-0 min-w-full\">\n <div\n className={cn(\n \"sticky start-0 flex w-[var(--dt-visible-w,100%)] max-w-full flex-wrap items-baseline justify-between gap-x-3\",\n compact ? \"px-2 py-1\" : level === 1 ? \"px-3 py-2\" : \"px-3 py-1.5\",\n )}\n >\n <span className=\"min-w-0\">{label}</span>\n {end != null && end !== false && <span className=\"ms-auto tabular-nums\">{end}</span>}\n </div>\n </div>\n </th>\n </tr>\n );\n}\n\n/**\n * The load-more footer. Observed against the viewport (an implicit root sees through the\n * clipping scroller, so it works in a bounded body, under `fillHeight`, and in a page that\n * scrolls), and guarded: one call per row count, none while `loading`, so an observer\n * that reports twice — or a footer still in view while the owner sets `loading` — loads\n * once. When the rows arrive and the footer is still in view (a short slice), it loads\n * again, until the scroller is full.\n */\nexport function DataTableLoadMoreFooter({\n loadMore,\n rowCount,\n labels,\n compact,\n as: Tag = \"div\",\n}: {\n loadMore: DataTableLoadMore;\n rowCount: number;\n labels: { loadMore: string; allLoaded: string; loading: string };\n compact: boolean;\n as?: \"div\" | \"li\";\n}) {\n const { hasMore, onLoadMore, loading = false, auto = true, label, endLabel } = loadMore;\n const rootRef = useRef<HTMLElement | null>(null);\n const endRef = useRef<HTMLParagraphElement | null>(null);\n const firedAt = useRef<number | null>(null);\n const buttonFocused = useRef(false);\n // What the observer's callback acts on: the latest props, not the ones it was made with.\n const latest = useRef({ onLoadMore, loading, rowCount });\n useEffect(() => {\n latest.current = { onLoadMore, loading, rowCount };\n });\n\n // A fresh observer whenever the rows or the in-flight flag change: its first report is\n // the footer's position AFTER the new rows are laid out. Acting on a remembered \"in\n // view\" instead fired a second load the moment the rows arrived, while the footer was\n // still where the old last row had been (headless Chromium caught it).\n useEffect(() => {\n const el = rootRef.current;\n if (!auto || !hasMore || loading || !el || typeof IntersectionObserver === \"undefined\") return;\n const io = new IntersectionObserver(\n (entries) => {\n const now = latest.current;\n if (!entries.some((e) => e.isIntersecting) || now.loading || firedAt.current === now.rowCount) return;\n firedAt.current = now.rowCount;\n now.onLoadMore();\n },\n { rootMargin: \"200px\" },\n );\n io.observe(el);\n return () => io.disconnect();\n }, [auto, hasMore, loading, rowCount]);\n\n // A focused button that goes away (nothing left) hands its focus to the end line.\n useEffect(() => {\n if (!hasMore && buttonFocused.current) {\n buttonFocused.current = false;\n endRef.current?.focus();\n }\n }, [hasMore]);\n\n const end = endLabel === undefined ? labels.allLoaded : endLabel;\n return (\n <Tag\n ref={(el: HTMLElement | null) => {\n rootRef.current = el;\n }}\n data-table-load-more=\"\"\n className={cn(\n \"sticky start-0 flex w-[var(--dt-visible-w,100%)] max-w-full flex-col items-center border-t border-subtle text-center\",\n compact ? \"px-2 py-2\" : \"px-3 py-3\",\n )}\n >\n {hasMore ? (\n <Button\n variant=\"secondary\"\n size=\"sm\"\n aria-busy={loading || undefined}\n onFocus={() => (buttonFocused.current = true)}\n onBlur={() => (buttonFocused.current = false)}\n onClick={() => {\n if (loading) return;\n firedAt.current = rowCount;\n onLoadMore();\n }}\n >\n {loading ? (\n <span className=\"inline-flex items-center gap-2\">\n <Spinner label={null} className=\"size-4\" />\n <bdi>{labels.loading}</bdi>\n </span>\n ) : (\n (label ?? labels.loadMore)\n )}\n </Button>\n ) : end != null && end !== false ? (\n <p ref={endRef} tabIndex={-1} className=\"text-xs text-muted outline-none\">\n {end}\n </p>\n ) : null}\n {/* Mounted throughout, so a screen reader hears the load start. */}\n <span role=\"status\" className=\"sr-only\">\n {loading ? labels.loading : \"\"}\n </span>\n </Tag>\n );\n}\n"],"mappings":";AAuKU,SAME,KANF;AAvKV,SAAS,WAAW,iBAAiB,QAAQ,gBAAgB;AAE7D,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,SAAS,eAAe;AAuDjB,SAAS,UAAa,MAAoB,QAAwC,SAAS,GA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C;AAAA,kBACC;AAAA,UAAC;AAAA;AAAA,YACC,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,aAAW,WAAW;AAAA,YACtB,SAAS,MAAO,cAAc,UAAU;AAAA,YACxC,QAAQ,MAAO,cAAc,UAAU;AAAA,YACvC,SAAS,MAAM;AACb,kBAAI,QAAS;AACb,sBAAQ,UAAU;AAClB,yBAAW;AAAA,YACb;AAAA,YAEC,oBACC,qBAAC,UAAK,WAAU,kCACd;AAAA,kCAAC,WAAQ,OAAO,MAAM,WAAU,UAAS;AAAA,cACzC,oBAAC,SAAK,iBAAO,SAAQ;AAAA,eACvB,IAEC,SAAS,OAAO;AAAA;AAAA,QAErB,IACE,OAAO,QAAQ,QAAQ,QACzB,oBAAC,OAAE,KAAK,QAAQ,UAAU,IAAI,WAAU,mCACrC,eACH,IACE;AAAA,QAEJ,oBAAC,UAAK,MAAK,UAAS,WAAU,WAC3B,oBAAU,OAAO,UAAU,IAC9B;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -15,7 +15,7 @@ export declare function DataTableHead<T>({ visibleColumns, selection, compact, l
15
15
  hasSortCallback: boolean;
16
16
  /** The caller owns the filters (`onFiltersChange`), likewise. */
17
17
  hasFilterCallback: boolean;
18
- sorts: SortState[];
18
+ sorts: readonly SortState[];
19
19
  filters: FilterState;
20
20
  selectOptionsByKey: Record<string, {
21
21
  value: string;
@@ -7,6 +7,7 @@ import { defaultFilterState, isFilterActive, resolveFilter } from "./data-table-
7
7
  import { FilterPopover } from "./data-table-filter-popover.js";
8
8
  import { Popover } from "./popover.js";
9
9
  import { Tooltip } from "./tooltip.js";
10
+ import { Checkbox } from "./checkbox.js";
10
11
  import { isTableOwnColumn } from "./data-table-row-actions.js";
11
12
  import { columnLabel, logicalAlign, splitCellProps } from "./data-table-shared.js";
12
13
  import { GROW_HEAD_CLASS } from "./data-table-fit.js";
@@ -49,14 +50,12 @@ function DataTableHead({
49
50
  compact ? "w-8 px-2 py-1" : "w-10 px-3 py-2"
50
51
  ),
51
52
  children: /* @__PURE__ */ jsx(
52
- "input",
53
+ Checkbox,
53
54
  {
54
- type: "checkbox",
55
- className: cn("align-middle accent-indigo-600", compact ? "size-3.5" : "size-4"),
55
+ className: "align-middle",
56
+ inputClassName: compact ? "size-3.5" : void 0,
56
57
  checked: selection.allSelected,
57
- ref: (el) => {
58
- if (el) el.indeterminate = selection.someSelected && !selection.allSelected;
59
- },
58
+ indeterminate: selection.someSelected && !selection.allSelected,
60
59
  onChange: (e) => selection.onToggleAll(e.target.checked),
61
60
  "aria-label": labels.selectAllRows
62
61
  }
@@ -109,20 +108,24 @@ function DataTableHead({
109
108
  )
110
109
  },
111
110
  /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-1", isEndAligned && "flex-row-reverse"), children: [
112
- /* @__PURE__ */ jsx(Tooltip, { label: sortable && multiSort ? labels.sortHint : void 0, portal: true, children: /* @__PURE__ */ jsxs(
111
+ sortable ? /* @__PURE__ */ jsx(Tooltip, { label: multiSort ? labels.sortHint : void 0, portal: true, children: /* @__PURE__ */ jsxs(
113
112
  "button",
114
113
  {
115
114
  type: "button",
116
- onClick: (e) => sortable && toggleSort(col.key, e.shiftKey),
117
- disabled: !sortable,
118
- className: cn("flex items-center gap-1 text-start", sortable && "hover:text-primary"),
115
+ onClick: (e) => toggleSort(col.key, e.shiftKey),
116
+ className: "flex items-center gap-1 text-start hover:text-primary",
119
117
  children: [
120
118
  /* @__PURE__ */ jsx("span", { children: col.header }),
121
- sortable && /* @__PURE__ */ jsx(Icon, { className: cn("size-3", active ? "opacity-100" : "opacity-40") }),
119
+ /* @__PURE__ */ jsx(Icon, { className: cn("size-3", active ? "opacity-100" : "opacity-40") }),
122
120
  active && sorts.length > 1 && /* @__PURE__ */ jsx("span", { className: "text-micro font-semibold leading-none text-brand", children: sortIdx + 1 })
123
121
  ]
124
122
  }
125
- ) }),
123
+ ) }) : (
124
+ // Plain text (refactor audit 2026-10-30, DSP-23 a): a `<button disabled>`
125
+ // round it was read out as a dimmed button on every column that cannot
126
+ // be sorted — a control that is not there.
127
+ /* @__PURE__ */ jsx("span", { className: "text-start", children: col.header })
128
+ ),
126
129
  filter && /* @__PURE__ */ jsx(
127
130
  Popover,
128
131
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/data-table-head.tsx"],"sourcesContent":["import type { Dispatch, SetStateAction } from \"react\";\nimport { ArrowDown, ArrowUp, ArrowUpDown, Filter } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { defaultFilterState, isFilterActive, resolveFilter } from \"./data-table-filters\";\nimport type { FilterValue } from \"./data-table-filters\";\nimport type { SortState } from \"./data-table-sort\";\nimport { FilterPopover } from \"./data-table-filter-popover\";\nimport { Popover } from \"./popover\";\nimport { Tooltip } from \"./tooltip\";\nimport type { DataTableLabels } from \"./data-table-labels\";\nimport { isTableOwnColumn } from \"./data-table-row-actions\";\nimport { columnLabel, logicalAlign, splitCellProps } from \"./data-table-shared\";\nimport { GROW_HEAD_CLASS } from \"./data-table-fit\";\nimport type { DataTableColumn, DataTableProps, FilterState } from \"./data-table\";\n\n// DataTable's `<thead>` on a wide screen: the select-all box, and per column the sort\n// button, the filter popover and the resize handle. Moved out of data-table.tsx whole\n// (refactor audit 2026-10, MOD-3 step 5); the state it shows and changes stays the\n// table's.\n\n/** Whether a column is end-aligned — the header then puts its filter button first. */\nconst END_ALIGN = /(^|\\s)text-end(?=\\s|$)/;\n\n/** The wide-screen table's header row. */\nexport function DataTableHead<T>({\n visibleColumns,\n selection,\n compact,\n labels,\n locale,\n isServer,\n hasSortCallback,\n hasFilterCallback,\n sorts,\n filters,\n selectOptionsByKey,\n multiSort,\n resizable,\n widths,\n setWidths,\n headRefs,\n toggleSort,\n setFilterValue,\n clearFilter,\n startResize,\n moveResize,\n finishResize,\n ariaRowIndex,\n lockedWidths,\n selectionLockKey,\n}: {\n visibleColumns: DataTableColumn<T>[];\n selection: DataTableProps<T>[\"selection\"];\n compact: boolean;\n labels: DataTableLabels;\n locale?: string;\n isServer: boolean;\n /** The caller owns the sort (`onSortsChange`), so a server table can offer it. */\n hasSortCallback: boolean;\n /** The caller owns the filters (`onFiltersChange`), likewise. */\n hasFilterCallback: boolean;\n sorts: SortState[];\n filters: FilterState;\n selectOptionsByKey: Record<string, { value: string; label: string }[]>;\n multiSort: boolean;\n resizable: boolean;\n widths: Record<string, number>;\n setWidths: Dispatch<SetStateAction<Record<string, number>>>;\n /** Filled here, one `<th>` per column — what a resize and \"Auto-size\" measure. */\n headRefs: Map<string, HTMLTableCellElement>;\n toggleSort: (key: string, shiftKey: boolean) => void;\n setFilterValue: (key: string, value: FilterValue) => void;\n clearFilter: (key: string) => void;\n startResize: (e: React.PointerEvent<HTMLElement>, key: string) => void;\n moveResize: (e: React.PointerEvent<HTMLElement>) => void;\n finishResize: (e: React.PointerEvent<HTMLElement>, commit: boolean) => void;\n /** Under `virtualize` (0.48.2): 1. */\n ariaRowIndex?: number;\n /** Under `virtualize` (0.48.2): each column's locked width, as the header cell's\n * `min-width` — a `<col>` width alone gave way to a `grow` column's 100%. */\n lockedWidths?: Record<string, number> | null;\n /** The selection column's key in `lockedWidths`. */\n selectionLockKey?: string;\n}) {\n return (\n <thead className=\"bg-surface-2 text-secondary\">\n <tr className=\"text-start\" aria-rowindex={ariaRowIndex}>\n {selection && (\n <th\n scope=\"col\"\n style={\n selectionLockKey && lockedWidths?.[selectionLockKey] !== undefined\n ? { minWidth: lockedWidths[selectionLockKey] }\n : undefined\n }\n className={cn(\n \"sticky top-0 z-10 bg-surface-2 align-middle backdrop-blur-sm\",\n compact ? \"w-8 px-2 py-1\" : \"w-10 px-3 py-2\",\n )}\n >\n <input\n type=\"checkbox\"\n className={cn(\"align-middle accent-indigo-600\", compact ? \"size-3.5\" : \"size-4\")}\n checked={selection.allSelected}\n ref={(el) => {\n if (el) el.indeterminate = selection.someSelected && !selection.allSelected;\n }}\n onChange={(e) => selection.onToggleAll(e.target.checked)}\n aria-label={labels.selectAllRows}\n />\n </th>\n )}\n {visibleColumns.map((col) => {\n // In server mode the utilities stay hidden unless the caller\n // takes them over and feeds them back into the server query.\n const sortable = (!isServer || hasSortCallback) && !!col.sortBy;\n const filter = !isServer || hasFilterCallback ? resolveFilter(col) : null;\n const filterState = filters[col.key] ?? (filter ? defaultFilterState(filter) : undefined);\n const sortIdx = sorts.findIndex((s) => s.key === col.key);\n const active = sortIdx !== -1;\n const Icon = active ? (sorts[sortIdx].dir === \"asc\" ? ArrowUp : ArrowDown) : ArrowUpDown;\n const filterActive = filterState && isFilterActive(filterState);\n // Logical, and a legacy `text-right` still counts — see `logicalAlign`.\n const headClass = logicalAlign(col.headClassName);\n const isEndAligned = !!headClass && END_ALIGN.test(headClass);\n const width = widths[col.key];\n const ownHead = splitCellProps(col.headProps);\n const growFloor = col.grow && col.growMin != null ? `${col.growMin}rem` : undefined;\n const pinnedHead = width ? { width, minWidth: width, maxWidth: width } : undefined;\n return (\n <th\n {...ownHead.attrs}\n key={col.key}\n ref={(el) => {\n if (el) headRefs.set(col.key, el);\n else headRefs.delete(col.key);\n }}\n scope=\"col\"\n // Only a header the user can actually sort says anything: an\n // `aria-sort` on a plain column is a control that is not there,\n // and a persisted or URL sort can name a column with no `sortBy`\n // (the sort chain drops it silently) — which would otherwise\n // claim a sort the table is not applying.\n //\n // \"none\" on the rest is the half that was missing. Without it a\n // sortable header is indistinguishable from a plain one until the\n // user presses it. Secondary criteria read \"none\" too: ARIA allows\n // exactly one sorted column, and the priority is carried by the\n // badge and by what the header button announces on press.\n aria-sort={\n sortable ? (sortIdx === 0 ? (sorts[0].dir === \"asc\" ? \"ascending\" : \"descending\") : \"none\") : undefined\n }\n style={\n ownHead.style || pinnedHead || lockedWidths?.[col.key] !== undefined || growFloor\n ? {\n // A `grow` column's own floor (0.51.4), over the class's 10rem; a\n // locked width below wins, as it does over the class.\n ...(growFloor ? { minWidth: growFloor } : null),\n ...ownHead.style,\n ...(lockedWidths?.[col.key] !== undefined ? { minWidth: lockedWidths[col.key] } : null),\n ...pinnedHead,\n }\n : undefined\n }\n className={cn(\n \"relative font-medium align-middle whitespace-nowrap\",\n compact ? \"px-2 py-1\" : \"px-3 py-2\",\n // Keep the header visible while the user scrolls the page.\n // Each <th> carries its own bg so the row doesn't render\n // transparent over the data rows underneath.\n \"sticky top-0 z-10 bg-surface-2 backdrop-blur-sm\",\n col.grow && GROW_HEAD_CLASS,\n logicalAlign(ownHead.className),\n headClass,\n )}\n >\n <div className={cn(\"flex items-center gap-1\", isEndAligned && \"flex-row-reverse\")}>\n <Tooltip label={sortable && multiSort ? labels.sortHint : undefined} portal>\n <button\n type=\"button\"\n onClick={(e) => sortable && toggleSort(col.key, e.shiftKey)}\n disabled={!sortable}\n className={cn(\"flex items-center gap-1 text-start\", sortable && \"hover:text-primary\")}\n >\n <span>{col.header}</span>\n {sortable && <Icon className={cn(\"size-3\", active ? \"opacity-100\" : \"opacity-40\")} />}\n {/* Priority badge, only meaningful with 2+ sort keys */}\n {active && sorts.length > 1 && (\n <span className=\"text-micro font-semibold leading-none text-brand\">{sortIdx + 1}</span>\n )}\n </button>\n </Tooltip>\n {filter && (\n <Popover\n // 420 px at Normal, in rem so the calendar grows with its\n // text (§3.2); Popover caps it at the viewport.\n width={filter.type === \"date\" ? \"26.25rem\" : undefined}\n // The panel is THIS column's filter, and says so. Unnamed it was\n // announced as the kit-wide fallback, \"Popover\"; then as \"Filter\"\n // in every column alike (round 0.34 Wave 2, BUG-7c).\n labels={{ panel: labels.filterColumn(columnLabel(col, labels), false) }}\n trigger={({ open, toggle, ref }) => (\n <button\n type=\"button\"\n ref={ref}\n onClick={toggle}\n // Named for its column, and for being filtered: the tint\n // alone said that to nobody who cannot see it (BUG-7c).\n aria-label={labels.filterColumn(columnLabel(col, labels), Boolean(filterActive))}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n className={cn(\n \"rounded p-1 transition-colors\",\n filterActive\n ? \"bg-brand-soft text-brand-muted\"\n : \"text-placeholder hover:text-secondary hover:bg-hover\",\n )}\n >\n <Filter className=\"size-3\" />\n </button>\n )}\n >\n {() => (\n <FilterPopover\n column={col}\n state={filterState ?? defaultFilterState(filter)}\n onChange={(next) => setFilterValue(col.key, next)}\n onClear={() => clearFilter(col.key)}\n selectOptions={selectOptionsByKey[col.key] ?? []}\n labels={labels}\n locale={locale}\n />\n )}\n </Popover>\n )}\n </div>\n {/* A `grow` column takes the rest: no width of its own to drag (0.48, KS N2). */}\n {resizable && !isTableOwnColumn(col.key) && !col.grow && (\n /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- a\n pointer-only drag handle for a visual preference (column width); it is\n deliberately not a tab stop, and no content or action depends on it. */\n <span\n role=\"separator\"\n aria-orientation=\"vertical\"\n onPointerDown={(e) => startResize(e, col.key)}\n onPointerMove={moveResize}\n onPointerUp={(e) => finishResize(e, true)}\n onPointerCancel={(e) => finishResize(e, false)}\n onDoubleClick={(e) => {\n e.preventDefault();\n setWidths((w) => {\n const next = { ...w };\n delete next[col.key];\n return next;\n });\n }}\n // `touch-none`: without it the browser claims a finger drag for\n // scrolling before the first `pointermove` ever arrives.\n // `end-0` and a translate that flips with it: the handle sits on the column's\n // trailing edge, which is its left one in a right-to-left table.\n className=\"absolute end-0 top-0 z-10 h-full w-1.5 -translate-x-1/2 rtl:translate-x-1/2 cursor-col-resize select-none touch-none hover:bg-brand-soft-hover\"\n />\n )}\n </th>\n );\n })}\n </tr>\n </thead>\n );\n}\n"],"mappings":";AAoGY,cA8EM,YA9EN;AA8BA;AAjIZ,SAAS,WAAW,SAAS,aAAa,cAAc;AACxD,SAAS,UAAU;AACnB,SAAS,oBAAoB,gBAAgB,qBAAqB;AAGlE,SAAS,qBAAqB;AAC9B,SAAS,eAAe;AACxB,SAAS,eAAe;AAExB,SAAS,wBAAwB;AACjC,SAAS,aAAa,cAAc,sBAAsB;AAC1D,SAAS,uBAAuB;AAShC,MAAM,YAAY;AAGX,SAAS,cAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,E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;AAAA;AAAA,cACF;AAAA;AAAA,UAEJ;AAAA,WAEJ;AAAA,QAEC,aAAa,CAAC,iBAAiB,IAAI,GAAG,KAAK,CAAC,IAAI;AAAA;AAAA;AAAA,QAI/C;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,oBAAiB;AAAA,YACjB,eAAe,CAAC,MAAM,YAAY,GAAG,IAAI,GAAG;AAAA,YAC5C,eAAe;AAAA,YACf,aAAa,CAAC,MAAM,aAAa,GAAG,IAAI;AAAA,YACxC,iBAAiB,CAAC,MAAM,aAAa,GAAG,KAAK;AAAA,YAC7C,eAAe,CAAC,MAAM;AACpB,gBAAE,eAAe;AACjB,wBAAU,CAAC,MAAM;AACf,sBAAM,OAAO,EAAE,GAAG,EAAE;AACpB,uBAAO,KAAK,IAAI,GAAG;AACnB,uBAAO;AAAA,cACT,CAAC;AAAA,YACH;AAAA,YAKA,WAAU;AAAA;AAAA,QACZ;AAAA,MAEJ;AAAA,IAEJ,CAAC;AAAA,KACH,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/data-table-head.tsx"],"sourcesContent":["import type { Dispatch, SetStateAction } from \"react\";\nimport { ArrowDown, ArrowUp, ArrowUpDown, Filter } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { defaultFilterState, isFilterActive, resolveFilter } from \"./data-table-filters\";\nimport type { FilterValue } from \"./data-table-filters\";\nimport type { SortState } from \"./data-table-sort\";\nimport { FilterPopover } from \"./data-table-filter-popover\";\nimport { Popover } from \"./popover\";\nimport { Tooltip } from \"./tooltip\";\nimport { Checkbox } from \"./checkbox\";\nimport type { DataTableLabels } from \"./data-table-labels\";\nimport { isTableOwnColumn } from \"./data-table-row-actions\";\nimport { columnLabel, logicalAlign, splitCellProps } from \"./data-table-shared\";\nimport { GROW_HEAD_CLASS } from \"./data-table-fit\";\nimport type { DataTableColumn, DataTableProps, FilterState } from \"./data-table\";\n\n// DataTable's `<thead>` on a wide screen: the select-all box, and per column the sort\n// button, the filter popover and the resize handle. Moved out of data-table.tsx whole\n// (refactor audit 2026-10, MOD-3 step 5); the state it shows and changes stays the\n// table's.\n\n/** Whether a column is end-aligned — the header then puts its filter button first. */\nconst END_ALIGN = /(^|\\s)text-end(?=\\s|$)/;\n\n/** The wide-screen table's header row. */\nexport function DataTableHead<T>({\n visibleColumns,\n selection,\n compact,\n labels,\n locale,\n isServer,\n hasSortCallback,\n hasFilterCallback,\n sorts,\n filters,\n selectOptionsByKey,\n multiSort,\n resizable,\n widths,\n setWidths,\n headRefs,\n toggleSort,\n setFilterValue,\n clearFilter,\n startResize,\n moveResize,\n finishResize,\n ariaRowIndex,\n lockedWidths,\n selectionLockKey,\n}: {\n visibleColumns: DataTableColumn<T>[];\n selection: DataTableProps<T>[\"selection\"];\n compact: boolean;\n labels: DataTableLabels;\n locale?: string;\n isServer: boolean;\n /** The caller owns the sort (`onSortsChange`), so a server table can offer it. */\n hasSortCallback: boolean;\n /** The caller owns the filters (`onFiltersChange`), likewise. */\n hasFilterCallback: boolean;\n sorts: readonly SortState[];\n filters: FilterState;\n selectOptionsByKey: Record<string, { value: string; label: string }[]>;\n multiSort: boolean;\n resizable: boolean;\n widths: Record<string, number>;\n setWidths: Dispatch<SetStateAction<Record<string, number>>>;\n /** Filled here, one `<th>` per column — what a resize and \"Auto-size\" measure. */\n headRefs: Map<string, HTMLTableCellElement>;\n toggleSort: (key: string, shiftKey: boolean) => void;\n setFilterValue: (key: string, value: FilterValue) => void;\n clearFilter: (key: string) => void;\n startResize: (e: React.PointerEvent<HTMLElement>, key: string) => void;\n moveResize: (e: React.PointerEvent<HTMLElement>) => void;\n finishResize: (e: React.PointerEvent<HTMLElement>, commit: boolean) => void;\n /** Under `virtualize` (0.48.2): 1. */\n ariaRowIndex?: number;\n /** Under `virtualize` (0.48.2): each column's locked width, as the header cell's\n * `min-width` — a `<col>` width alone gave way to a `grow` column's 100%. */\n lockedWidths?: Record<string, number> | null;\n /** The selection column's key in `lockedWidths`. */\n selectionLockKey?: string;\n}) {\n return (\n <thead className=\"bg-surface-2 text-secondary\">\n <tr className=\"text-start\" aria-rowindex={ariaRowIndex}>\n {selection && (\n <th\n scope=\"col\"\n style={\n selectionLockKey && lockedWidths?.[selectionLockKey] !== undefined\n ? { minWidth: lockedWidths[selectionLockKey] }\n : undefined\n }\n className={cn(\n \"sticky top-0 z-10 bg-surface-2 align-middle backdrop-blur-sm\",\n compact ? \"w-8 px-2 py-1\" : \"w-10 px-3 py-2\",\n )}\n >\n {/* The kit's Checkbox, as the phone card's (refactor audit 2026-10-30, DSP-14): the\n native box wore `accent-indigo-600` over the kit's `--brand` accent, indigo on\n every palette and, in dark mode, a checked box that read as unchecked. \"Some\"\n is its `indeterminate` dash, set on the element after every render as the\n ref here did. */}\n <Checkbox\n className=\"align-middle\"\n inputClassName={compact ? \"size-3.5\" : undefined}\n checked={selection.allSelected}\n indeterminate={selection.someSelected && !selection.allSelected}\n onChange={(e) => selection.onToggleAll(e.target.checked)}\n aria-label={labels.selectAllRows}\n />\n </th>\n )}\n {visibleColumns.map((col) => {\n // In server mode the utilities stay hidden unless the caller\n // takes them over and feeds them back into the server query.\n const sortable = (!isServer || hasSortCallback) && !!col.sortBy;\n const filter = !isServer || hasFilterCallback ? resolveFilter(col) : null;\n const filterState = filters[col.key] ?? (filter ? defaultFilterState(filter) : undefined);\n const sortIdx = sorts.findIndex((s) => s.key === col.key);\n const active = sortIdx !== -1;\n const Icon = active ? (sorts[sortIdx].dir === \"asc\" ? ArrowUp : ArrowDown) : ArrowUpDown;\n const filterActive = filterState && isFilterActive(filterState);\n // Logical, and a legacy `text-right` still counts — see `logicalAlign`.\n const headClass = logicalAlign(col.headClassName);\n const isEndAligned = !!headClass && END_ALIGN.test(headClass);\n const width = widths[col.key];\n const ownHead = splitCellProps(col.headProps);\n const growFloor = col.grow && col.growMin != null ? `${col.growMin}rem` : undefined;\n const pinnedHead = width ? { width, minWidth: width, maxWidth: width } : undefined;\n return (\n <th\n {...ownHead.attrs}\n key={col.key}\n ref={(el) => {\n if (el) headRefs.set(col.key, el);\n else headRefs.delete(col.key);\n }}\n scope=\"col\"\n // Only a header the user can actually sort says anything: an\n // `aria-sort` on a plain column is a control that is not there,\n // and a persisted or URL sort can name a column with no `sortBy`\n // (the sort chain drops it silently) — which would otherwise\n // claim a sort the table is not applying.\n //\n // \"none\" on the rest is the half that was missing. Without it a\n // sortable header is indistinguishable from a plain one until the\n // user presses it. Secondary criteria read \"none\" too: ARIA allows\n // exactly one sorted column, and the priority is carried by the\n // badge and by what the header button announces on press.\n aria-sort={\n sortable ? (sortIdx === 0 ? (sorts[0].dir === \"asc\" ? \"ascending\" : \"descending\") : \"none\") : undefined\n }\n style={\n ownHead.style || pinnedHead || lockedWidths?.[col.key] !== undefined || growFloor\n ? {\n // A `grow` column's own floor (0.51.4), over the class's 10rem; a\n // locked width below wins, as it does over the class.\n ...(growFloor ? { minWidth: growFloor } : null),\n ...ownHead.style,\n ...(lockedWidths?.[col.key] !== undefined ? { minWidth: lockedWidths[col.key] } : null),\n ...pinnedHead,\n }\n : undefined\n }\n className={cn(\n \"relative font-medium align-middle whitespace-nowrap\",\n compact ? \"px-2 py-1\" : \"px-3 py-2\",\n // Keep the header visible while the user scrolls the page.\n // Each <th> carries its own bg so the row doesn't render\n // transparent over the data rows underneath.\n \"sticky top-0 z-10 bg-surface-2 backdrop-blur-sm\",\n col.grow && GROW_HEAD_CLASS,\n logicalAlign(ownHead.className),\n headClass,\n )}\n >\n <div className={cn(\"flex items-center gap-1\", isEndAligned && \"flex-row-reverse\")}>\n {sortable ? (\n <Tooltip label={multiSort ? labels.sortHint : undefined} portal>\n <button\n type=\"button\"\n onClick={(e) => toggleSort(col.key, e.shiftKey)}\n className=\"flex items-center gap-1 text-start hover:text-primary\"\n >\n <span>{col.header}</span>\n <Icon className={cn(\"size-3\", active ? \"opacity-100\" : \"opacity-40\")} />\n {/* Priority badge, only meaningful with 2+ sort keys */}\n {active && sorts.length > 1 && (\n <span className=\"text-micro font-semibold leading-none text-brand\">{sortIdx + 1}</span>\n )}\n </button>\n </Tooltip>\n ) : (\n // Plain text (refactor audit 2026-10-30, DSP-23 a): a `<button disabled>`\n // round it was read out as a dimmed button on every column that cannot\n // be sorted — a control that is not there.\n <span className=\"text-start\">{col.header}</span>\n )}\n {filter && (\n <Popover\n // 420 px at Normal, in rem so the calendar grows with its\n // text (§3.2); Popover caps it at the viewport.\n width={filter.type === \"date\" ? \"26.25rem\" : undefined}\n // The panel is THIS column's filter, and says so. Unnamed it was\n // announced as the kit-wide fallback, \"Popover\"; then as \"Filter\"\n // in every column alike (round 0.34 Wave 2, BUG-7c).\n labels={{ panel: labels.filterColumn(columnLabel(col, labels), false) }}\n trigger={({ open, toggle, ref }) => (\n <button\n type=\"button\"\n ref={ref}\n onClick={toggle}\n // Named for its column, and for being filtered: the tint\n // alone said that to nobody who cannot see it (BUG-7c).\n aria-label={labels.filterColumn(columnLabel(col, labels), Boolean(filterActive))}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n className={cn(\n \"rounded p-1 transition-colors\",\n filterActive\n ? \"bg-brand-soft text-brand-muted\"\n : \"text-placeholder hover:text-secondary hover:bg-hover\",\n )}\n >\n <Filter className=\"size-3\" />\n </button>\n )}\n >\n {() => (\n <FilterPopover\n column={col}\n state={filterState ?? defaultFilterState(filter)}\n onChange={(next) => setFilterValue(col.key, next)}\n onClear={() => clearFilter(col.key)}\n selectOptions={selectOptionsByKey[col.key] ?? []}\n labels={labels}\n locale={locale}\n />\n )}\n </Popover>\n )}\n </div>\n {/* A `grow` column takes the rest: no width of its own to drag (0.48, KS N2). */}\n {resizable && !isTableOwnColumn(col.key) && !col.grow && (\n /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- a\n pointer-only drag handle for a visual preference (column width); it is\n deliberately not a tab stop, and no content or action depends on it. */\n <span\n role=\"separator\"\n aria-orientation=\"vertical\"\n onPointerDown={(e) => startResize(e, col.key)}\n onPointerMove={moveResize}\n onPointerUp={(e) => finishResize(e, true)}\n onPointerCancel={(e) => finishResize(e, false)}\n onDoubleClick={(e) => {\n e.preventDefault();\n setWidths((w) => {\n const next = { ...w };\n delete next[col.key];\n return next;\n });\n }}\n // `touch-none`: without it the browser claims a finger drag for\n // scrolling before the first `pointermove` ever arrives.\n // `end-0` and a translate that flips with it: the handle sits on the column's\n // trailing edge, which is its left one in a right-to-left table.\n className=\"absolute end-0 top-0 z-10 h-full w-1.5 -translate-x-1/2 rtl:translate-x-1/2 cursor-col-resize select-none touch-none hover:bg-brand-soft-hover\"\n />\n )}\n </th>\n );\n })}\n </tr>\n </thead>\n );\n}\n"],"mappings":";AA0GY,cA6EQ,YA7ER;AA4BA;AArIZ,SAAS,WAAW,SAAS,aAAa,cAAc;AACxD,SAAS,UAAU;AACnB,SAAS,oBAAoB,gBAAgB,qBAAqB;AAGlE,SAAS,qBAAqB;AAC9B,SAAS,eAAe;AACxB,SAAS,eAAe;AACxB,SAAS,gBAAgB;AAEzB,SAAS,wBAAwB;AACjC,SAAS,aAAa,cAAc,sBAAsB;AAC1D,SAAS,uBAAuB;AAShC,MAAM,YAAY;AAGX,SAAS,cAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAiCG;AACD,SACE,oBAAC,WAAM,WAAU,+BACf,+BAAC,QAAG,WAAU,cAAa,iBAAe,cACvC;AAAA,iBACC;AAAA,MAAC;AAAA;AAAA,QACC,OAAM;AAAA,QACN,OACE,oBAAoB,eAAe,gBAAgB,MAAM,SACrD,EAAE,UAAU,aAAa,gBAAgB,EAAE,IAC3C;AAAA,QAEN,WAAW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H;AAAA,YAKA,WAAU;AAAA;AAAA,QACZ;AAAA,MAEJ;AAAA,IAEJ,CAAC;AAAA,KACH,GACF;AAEJ;","names":[]}
@@ -12,7 +12,7 @@ import type { DataTableColumn, DataTableProps, FilterState, MobileSwipeActions }
12
12
  * header's `sr-only` text (an actions column's), as every kit container must.
13
13
  */
14
14
  export declare function StackedFields<T>({ columns, row, compact, liftOwnClicks, }: {
15
- columns: DataTableColumn<T>[];
15
+ columns: readonly DataTableColumn<T>[];
16
16
  row: T;
17
17
  compact: boolean;
18
18
  /** On a stretched card (0.50 K4): lift the own-click fields above its title link. */
@@ -30,7 +30,7 @@ export declare const MOBILE_CARD_FIELDS = 3;
30
30
  * fields and the marks leave it on the card; only `mobileHidden` / `mobile: "hidden"`
31
31
  * (which keep it out of `columns`) remove it.
32
32
  */
33
- export declare function mobileCardColumns<T>(columns: DataTableColumn<T>[]): {
33
+ export declare function mobileCardColumns<T>(columns: readonly DataTableColumn<T>[]): {
34
34
  primary: DataTableColumn<T> | null;
35
35
  status: DataTableColumn<T>[];
36
36
  fields: DataTableColumn<T>[];
@@ -51,7 +51,7 @@ export declare function keepsOwnClicks<T>(col: DataTableColumn<T>): boolean;
51
51
  * (the table's `storageKey` or `urlSync` prefix) says which table, else its title
52
52
  * column does.
53
53
  */
54
- export declare function useCardColumnWarnings<T>(columns: DataTableColumn<T>[], enabled: boolean, name?: string): void;
54
+ export declare function useCardColumnWarnings<T>(columns: readonly DataTableColumn<T>[], enabled: boolean, name?: string): void;
55
55
  /**
56
56
  * Whether a rendered cell shows nothing worth a line (0.49 KIT-7): `null`, `undefined`,
57
57
  * a boolean (React draws neither), `""` or blank text, and the formatters' empty value
@@ -81,8 +81,8 @@ export declare function isEmptyCell(value: ReactNode): boolean;
81
81
  * open the select.
82
82
  */
83
83
  export declare function MobileSort<T>({ columns, sorts, sortCycle, compact, labels, onPick, onFlip, }: {
84
- columns: DataTableColumn<T>[];
85
- sorts: SortState[];
84
+ columns: readonly DataTableColumn<T>[];
85
+ sorts: readonly SortState[];
86
86
  sortCycle: SortCycle;
87
87
  compact: boolean;
88
88
  labels: DataTableLabels;
@@ -127,6 +127,11 @@ export interface MobileRowProps<T> {
127
127
  large: boolean;
128
128
  /** Phone selection (0.40, keksdose live #421); null without DataTable's `selection`. */
129
129
  select: MobileRowSelect | null;
130
+ /** The card's place in the list, on its `<li>` — where the table finds the card that
131
+ * takes the focus when a focused one leaves (refactor audit 2026-10-30, DSP-4). */
132
+ rowIndex?: number;
133
+ /** The focus came into the card, or into anything it opened (a portal included). */
134
+ onFocusIn?: () => void;
130
135
  }
131
136
  /** A phone card's part in DataTable's `selection` (0.40, keksdose live #421). */
132
137
  export interface MobileRowSelect {
@@ -141,7 +146,7 @@ export interface MobileRowSelect {
141
146
  }
142
147
  /** One mobile card. Shared by the flat list and the grouped list, so both draw
143
148
  * identical row markup. */
144
- export declare function MobileRow<T>({ row, isExpanded, openedRowContent, opensRow, rowClassName, rowAttributes, onRowClick, rowHref, swipeActionsFor, mobileDir, mobileCardLinkable, mobileCardStretched, mobileCard, mobilePrimaryCol, mobileStatusColumns, mobileSecondaryColumns, mobileActionColumns, mobileExpandAsDialog, compact, large, select, }: MobileRowProps<T>): import("react").JSX.Element;
149
+ export declare function MobileRow<T>({ row, isExpanded, openedRowContent, opensRow, rowClassName, rowAttributes, onRowClick, rowHref, swipeActionsFor, mobileDir, mobileCardLinkable, mobileCardStretched, mobileCard, mobilePrimaryCol, mobileStatusColumns, mobileSecondaryColumns, mobileActionColumns, mobileExpandAsDialog, compact, large, select, rowIndex, onFocusIn, }: MobileRowProps<T>): import("react").JSX.Element;
145
150
  /**
146
151
  * DataTable's `leadingRow` on a phone: the card list's first item. It was desktop-only
147
152
  * and the card list dropped it without a word — kastlan's inline "Add meter" editor
@@ -204,7 +209,7 @@ export declare function MobileSelectBar({ active, allSelected, someSelected, com
204
209
  * of that, and the exit motion, from the one place every other dialog gets it.
205
210
  */
206
211
  export declare function MobileFilters<T>({ columns, filters, selectOptionsByKey, isServer, hasFilterCallback, onSetFilter, onClearFilter, onClearAll, labels, locale, }: {
207
- columns: DataTableColumn<T>[];
212
+ columns: readonly DataTableColumn<T>[];
208
213
  filters: FilterState;
209
214
  selectOptionsByKey: Record<string, {
210
215
  value: string;
@@ -195,7 +195,9 @@ function MobileRow({
195
195
  mobileExpandAsDialog,
196
196
  compact,
197
197
  large,
198
- select
198
+ select,
199
+ rowIndex,
200
+ onFocusIn
199
201
  }) {
200
202
  const expanded = isExpanded?.(row) ?? false;
201
203
  const selecting = !!select?.active;
@@ -204,12 +206,15 @@ function MobileRow({
204
206
  const expansion = expanded ? openedRowContent(row) : null;
205
207
  const tint = rowClassName?.(row);
206
208
  const interactive = !!onRowClick;
209
+ const rowUrl = rowHref?.(row);
210
+ const linkOnly = !interactive && rowUrl !== void 0;
207
211
  const opensDetail = interactive && opensRow;
208
212
  const swipeActions = swipeActionsFor?.(row);
209
213
  const swipe = swipeActions ? physicalSwipe(swipeActions, mobileDir) : null;
210
214
  const swipeEnabled = !!swipe && !selecting;
211
- const stretched = mobileCardStretched && interactive && !selecting && !mobileCard && !!mobilePrimaryCol;
212
- const href = mobileCardLinkable || stretched ? rowHref?.(row) : void 0;
215
+ const stretched = mobileCardStretched && (interactive || linkOnly) && !selecting && !mobileCard && !!mobilePrimaryCol;
216
+ const href = mobileCardLinkable || stretched ? rowUrl : void 0;
217
+ const opens = interactive || linkOnly && href !== void 0;
213
218
  const cardClass = cn(
214
219
  "w-full text-start flex items-center",
215
220
  // §4: more room per row at Large — a taller row is a bigger tap target too.
@@ -221,14 +226,14 @@ function MobileRow({
221
226
  // on every row of a long list, so anything larger becomes the list's personality
222
227
  // rather than feedback. `transition-transform` alone, so the existing background
223
228
  // flip stays instant.
224
- interactive && "cursor-pointer transition-transform duration-100 active:scale-[0.995] active:bg-active motion-reduce:transition-none motion-reduce:active:scale-100",
229
+ opens && "cursor-pointer transition-transform duration-100 active:scale-[0.995] active:bg-active motion-reduce:transition-none motion-reduce:active:scale-100",
225
230
  // The keyboard's frame drawn INSIDE the card, as the desktop row's is (keksdose live
226
231
  // #394): the browser's own ring and tap highlight sit on the card's outer edge, and
227
232
  // three ancestors clip it — SwipeableRow's `overflow-hidden`, the card list, and
228
233
  // AppShell main's `overflow-x-clip` — so the frame went missing on one side. A press
229
234
  // keeps the fill and the squeeze above; an outline on every tap of a long list would
230
235
  // be louder than the acknowledgement it replaces.
231
- (interactive || selecting) && !stretched && cn("[-webkit-tap-highlight-color:transparent] focus-visible:ring-inset", FOCUS_RING),
236
+ (opens || selecting) && !stretched && cn("[-webkit-tap-highlight-color:transparent] focus-visible:ring-inset", FOCUS_RING),
232
237
  // A stretched card (0.50 K4) draws the same frame, inside the card, while its TITLE
233
238
  // control has the keyboard: the ring outlines the whole tap target, as on every other
234
239
  // card, not the title's line alone. The own-click cells draw their own.
@@ -247,14 +252,15 @@ function MobileRow({
247
252
  href,
248
253
  "data-card-link": "",
249
254
  "data-row-link": "",
250
- onActivate: () => onRowClick(row),
251
- "aria-expanded": opensRow ? expanded : void 0,
255
+ navigate: linkOnly,
256
+ onActivate: interactive ? () => onRowClick(row) : void 0,
257
+ "aria-expanded": opensRow && interactive ? expanded : void 0,
252
258
  className: stretchedClass,
253
- onKeyDown: (e) => {
259
+ onKeyDown: interactive ? (e) => {
254
260
  if (e.key !== " ") return;
255
261
  e.preventDefault();
256
262
  onRowClick(row);
257
- },
263
+ } : void 0,
258
264
  children: title
259
265
  }
260
266
  ) : /* @__PURE__ */ jsx(
@@ -417,7 +423,7 @@ function MobileRow({
417
423
  ) : stretched ? (
418
424
  // The stretched card (0.50 K4): a plain box; its title is the control (above).
419
425
  /* @__PURE__ */ jsx("div", { ...press, "data-card-stretched": "", className: cardClass, children: cardInner })
420
- ) : interactive && href ? (
426
+ ) : opens && href ? (
421
427
  // A card with a URL of its own is a LINK, not a div wearing role="button"
422
428
  // (feedback #451): the phone's long-press "open in new tab" and a screen
423
429
  // reader's link semantics both come free, and the fake role goes away.
@@ -426,14 +432,15 @@ function MobileRow({
426
432
  {
427
433
  href,
428
434
  ...press,
429
- onActivate: () => onRowClick(row),
430
- "aria-expanded": opensRow ? expanded : void 0,
435
+ navigate: linkOnly,
436
+ onActivate: interactive ? () => onRowClick(row) : void 0,
437
+ "aria-expanded": opensRow && interactive ? expanded : void 0,
431
438
  className: cardClass,
432
- onKeyDown: (e) => {
439
+ onKeyDown: interactive ? (e) => {
433
440
  if (e.key !== " ") return;
434
441
  e.preventDefault();
435
442
  onRowClick(row);
436
- },
443
+ } : void 0,
437
444
  children: cardInner
438
445
  }
439
446
  )
@@ -465,22 +472,28 @@ function MobileRow({
465
472
  }
466
473
  )
467
474
  );
468
- return /* @__PURE__ */ jsxs(
469
- "li",
470
- {
471
- className: cn(tint),
472
- ...cleanAttrs(rowAttributes?.(row)),
473
- "data-selected": selecting && select.selected ? "" : void 0,
474
- onClickCapture: select ? (e) => {
475
- if (!longPress.consumeClick()) return;
476
- e.preventDefault();
477
- e.stopPropagation();
478
- } : void 0,
479
- children: [
480
- swipeEnabled ? /* @__PURE__ */ jsx(SwipeableRow, { enabled: true, left: swipe.left, right: swipe.right, children: body }) : body,
481
- expansion && !mobileExpandAsDialog && /* @__PURE__ */ jsx("div", { className: cn("bg-surface-2 border-t border-subtle", compact ? "px-3 py-2" : "px-4 py-3"), children: expansion })
482
- ]
483
- }
475
+ return (
476
+ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- `onFocus`
477
+ only notes that the focus is in this card (DSP-4); the card inside is the control. */
478
+ /* @__PURE__ */ jsxs(
479
+ "li",
480
+ {
481
+ className: cn(tint),
482
+ ...cleanAttrs(rowAttributes?.(row)),
483
+ "data-row-index": rowIndex,
484
+ onFocus: onFocusIn,
485
+ "data-selected": selecting && select.selected ? "" : void 0,
486
+ onClickCapture: select ? (e) => {
487
+ if (!longPress.consumeClick()) return;
488
+ e.preventDefault();
489
+ e.stopPropagation();
490
+ } : void 0,
491
+ children: [
492
+ swipeEnabled ? /* @__PURE__ */ jsx(SwipeableRow, { enabled: true, left: swipe.left, right: swipe.right, children: body }) : body,
493
+ expansion && !mobileExpandAsDialog && /* @__PURE__ */ jsx("div", { className: cn("bg-surface-2 border-t border-subtle", compact ? "px-3 py-2" : "px-4 py-3"), children: expansion })
494
+ ]
495
+ }
496
+ )
484
497
  );
485
498
  }
486
499
  function MobileLeadingRow({